diff --git a/.checkpatch.conf b/.checkpatch.conf index b2a7fdbad57f..a1d04494df29 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -39,6 +39,7 @@ --exclude modules/tfm/tfm/boards/src --exclude modules/tfm/tfm/boards/common --exclude subsys/nrf_security/src/legacy +--exclude subsys/sdfw_services/services/.*/zcbor_generated --exclude doc/nrf/images --exclude doc/nrf/.*/images --exclude doc/nrf/.*/.*/images diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 2b2816c1dbb0..4b0a118243a8 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -57,7 +57,6 @@ "CI-audio-test": - "applications/nrf5340_audio/**/*" - - "boards/arm/nrf5340_audio_dk_nrf5340/**/*" - "tests/nrf5340_audio/**/*" - "tests/lib/contin_array/**/*" - "tests/lib/pcm_mix/**/*" @@ -69,7 +68,6 @@ - "lib/data_fifo/**/*" - "lib/pcm_stream_channel_modifier/**/*" - "lib/tone/**/*" - - "lib/bin/bt_ll_acs_nrf53/**/*" "CI-iot-samples-test": - "include/modem/at_monitor.h" @@ -198,13 +196,23 @@ - any: - "include/bluetooth/**/*" - "!include/bluetooth/mesh/**/*" - - any: - - "samples/bluetooth/**/*" - - "!samples/bluetooth/mesh/**/*" - "subsys/nrf_rpc/**/*" - "subsys/mpsl/**/*" - "drivers/mpsl/**/*" +"CI-ble-samples-test": + - "samples/bluetooth/**/*" + - "subsys/nrf_rpc/**/*" + - "subsys/mpsl/**/*" + - "drivers/mpsl/**/*" + - any: + - "subsys/bluetooth/**/*" + - "!subsys/bluetooth/mesh/**/*" + - any: + - "include/bluetooth/**/*" + - "!include/bluetooth/mesh/**/*" + + "CI-mesh-test": - "subsys/bluetooth/mesh/**/*" - "include/bluetooth/mesh/**/*" @@ -257,10 +265,9 @@ "CI-desktop-test": - "applications/nrf_desktop/**/*" - - "boards/arm/*dmouse*/**/*" - - "boards/arm/*kbd*/**/*" - - "boards/arm/*dongle*/**/*" - - "boards/arm/*gmouse*/**/*" + - "boards/nordic/*mouse/**/*" + - "boards/nordic/*kbd/**/*" + - "boards/nordic/*dongle/**/*" - "cmake/*" - "drivers/sensor/pmw3360/**/*" - "drivers/sensor/paw3212/**/*" diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index cbf9ecff3425..67e5d2b87baf 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -71,10 +71,10 @@ jobs: working-directory: ncs/nrf run: | MONITOR="monitor_${{ github.run_id }}.txt" - ARCHIVE="doc_build_${{ github.run_id }}.zip" # Create documentation upload files if [[ "${{ github.event_name }}" == "pull_request" ]]; then + ARCHIVE="doc_build_pr_${{ github.event.number }}.zip" echo "publish2 dev PR-${{ github.event.number }} ${ARCHIVE}" > "${MONITOR}" echo "${{ github.event.number }}" > pr.txt else @@ -87,6 +87,7 @@ jobs: echo "Not a release or latest, skipping publish" exit 0 fi + ARCHIVE="doc_build_${VERSION}.zip" echo "publish2 main ${VERSION} ${ARCHIVE}" > "${MONITOR}" fi diff --git a/.github/workflows/src-mirror.yml b/.github/workflows/src-mirror.yml new file mode 100644 index 000000000000..c02df548c7d6 --- /dev/null +++ b/.github/workflows/src-mirror.yml @@ -0,0 +1,34 @@ +name: src-mirror +on: + push: + tags: + - '*' + +jobs: + zip-and-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: nordicbuilder/action-checkout-west-update@main + with: + git-fetch-depth: 0 + path: workspace/nrf + + - name: Create tar + run: > + tar -C ./workspace -cvf src.tar.gz . + + - name: Set up JFrog CLI + uses: jfrog/setup-jfrog-cli@v4 + + - name: Configure and Upload to Artifactory + env: + ARTIFACTORY_URL: https://eu.files.nordicsemi.com/artifactory + REPOSITORY: ncs-src-mirror + FILE_PATH: src.tar.gz + TARGET_PATH: external/${{ github.ref_name }}/ + run: > + jfrog rt u $FILE_PATH $REPOSITORY/$TARGET_PATH + --url=$ARTIFACTORY_URL + --user=${{ secrets.COM_NORDICSEMI_FILES_USERNAME }} + --password=${{ secrets.COM_NORDICSEMI_FILES_PASSWORD }} diff --git a/CMakeLists.txt b/CMakeLists.txt index fdcac39b2a9a..afb77b67ed04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,6 @@ set(NRF_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "NCS root directory") # is cached. set(CONF_FILE_BUILD_TYPE ${CONF_FILE_BUILD_TYPE} CACHE INTERNAL "The build type") -# Customize the Zephyr kernel version.h using nRF Connect SDK ncs_version.h. -set(KERNEL_VERSION_CUSTOMIZATION \#include; PARENT_SCOPE) - foreach(runner_ext BIN HEX ELF) zephyr_get(NCS_RUNNER_${runner_ext} SYSBUILD) if(DEFINED NCS_RUNNER_${runner_ext}) @@ -26,6 +23,7 @@ endforeach() include(cmake/extensions.cmake) include(cmake/version.cmake) +include(cmake/version_app.cmake) include(cmake/multi_image.cmake) zephyr_include_directories(include) @@ -37,3 +35,4 @@ add_subdirectory(subsys) add_subdirectory(modules) add_subdirectory(drivers) add_subdirectory(tests) +add_subdirectory(kernel) diff --git a/CODEOWNERS b/CODEOWNERS index c181b9375684..ebbb54ff8bad 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -35,11 +35,12 @@ /applications/matter_bridge/ @Damian-Nordic @kkasperczyk-no /applications/matter_weather_station/ @Damian-Nordic @kkasperczyk-no /applications/nrf_desktop/ @MarekPieta -/applications/nrf5340_audio/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/applications/nrf5340_audio/ @nrfconnect/ncs-audio /applications/serial_lte_modem/ @SeppoTakalo @MarkusLassila @rlubos @tomi-font /applications/zigbee_weather_station/ @milewr # Boards /boards/ @anangl +/boards/nordic/thingy91* @anangl @nrfconnect/ncs-cia # All cmake related files /cmake/ @tejlmand /CMakeLists.txt @tejlmand @@ -86,7 +87,6 @@ Kconfig* @tejlmand /drivers/wifi/nrf700x/ @krish2718 @sachinthegreen @rado17 @rlubos /dts/ @anangl /ext/ @carlescufi -/ext/oberon/ @frkv @Vge0rge @vili-nordic @SebastianBoe @mswarowsky /include/ @anangl @rlubos /include/net/azure_* @nrfconnect/ncs-cia @coderbyheart /include/net/wifi_credentials.h @nrfconnect/ncs-cia @@ -101,7 +101,9 @@ Kconfig* @tejlmand /include/mpsl/ @nrfconnect/ncs-dragoon /include/net/ @rlubos /include/nfc/ @anangl @grochu +/include/sdfw/ @anhmolt @hakonfam @jonathannilsen /include/shell/ @nordic-krch +/kernel/ @nordicjm /lib/bin/ @rlubos @lemrey /lib/adp536x/ @nrfconnect/ncs-cia /lib/at_cmd_parser/ @rlubos @@ -138,17 +140,18 @@ Kconfig* @tejlmand /lib/modem_slm/ @SeppoTakalo @MarkusLassila @tomi-font /lib/modem_attest_token/ @jayteemo /lib/qos/ @nrfconnect/ncs-cia -/lib/contin_array/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/lib/data_fifo/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/lib/pcm_mix/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/lib/pcm_stream_channel_modifier/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/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/ @andvib @gWacey -/lib/tone/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/lib/tone/ @nrfconnect/ncs-audio /modules/ @tejlmand /modules/hostap/ @krish2718 @jukkar @rado17 @sachinthegreen @rlubos /modules/mcuboot/ @de-nordic @nordicjm /modules/cjson/ @nrfconnect/ncs-cia @plskeggs @sigvartmh /modules/trusted-firmware-m/ @frkv @Vge0rge @vili-nordic @SebastianBoe @mswarowsky +/modules/coremark/ @zycz /samples/ @nrfconnect/ncs-test-leads /samples/net/ @nrfconnect/ncs-cia @lemrey /samples/sensor/bh1749/ @nrfconnect/ncs-cia @@ -196,6 +199,9 @@ Kconfig* @tejlmand /samples/CMakeLists.txt @tejlmand /samples/nrf5340/netboot/ @hakonfam /samples/nrf5340/multiprotocol_rpmsg/ @hubertmis +/samples/sdfw/ @hakonfam @jonathannilsen +/samples/sdfw/ssf_client/ @anhmolt +/samples/suit/ @tomchy @ahasztag /samples/wifi/provisioning/ @wentong-li @bama-nordic /samples/wifi/radio_test/ @bama-nordic @sachinthegreen /samples/wifi/scan/ @D-Triveni @bama-nordic @@ -204,10 +210,11 @@ Kconfig* @tejlmand /samples/wifi/ble_coex/ @muraliThokala @bama-nordic /samples/wifi/shutdown/ @krish2718 @sachinthegreen /samples/wifi/twt/ @chiranjeevi2776 @krish2718 -/samples/wifi/throughput/ @SusanGRapaka @D-Triveni +/samples/wifi/throughput/ @D-Triveni /samples/wifi/raw_tx_packet/ @D-Triveni /samples/wifi/softap/ @D-Triveni @krish2718 /samples/wifi/monitor/ @chiranjeevi2776 @krish2718 +/samples/benchmarks/coremark/ @zycz /scripts/ @tejlmand @nrfconnect/ncs-test-leads /scripts/hid_configurator/ @MarekPieta /scripts/tools-versions-*.txt @tejlmand @grho @shanthanordic @ihansse @@ -224,7 +231,7 @@ Kconfig* @tejlmand /snippets/tfm-enable-share-uart/ @nrfconnect/ncs-cia /snippets/nrf70-debug/ @krish2718 @sachinthegreen /snippets/nrf70-fw-patch-ext-flash/ @krish2718 @sachinthegreen -/subsys/audio_module/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/subsys/audio_module/ @nrfconnect/ncs-audio /subsys/bluetooth/ @alwa-nordic @jori-nordic @carlescufi @KAGA164 /subsys/bluetooth/mesh/ @ludvigsj /subsys/bluetooth/controller/ @nrfconnect/ncs-dragoon @@ -239,6 +246,7 @@ Kconfig* @tejlmand /subsys/dm/ @maje-emb /subsys/ieee802154/ @rlubos @ankuns @jciupis @ahasztag /subsys/mgmt/ @hakonfam @sigvartmh +/subsys/mgmt/suitfu/ @tomchy @ahasztag /subsys/emds/ @balaklaka /subsys/esb/ @lemrey /subsys/app_event_manager/ @pdunaj @@ -267,13 +275,16 @@ Kconfig* @tejlmand /subsys/pcd/ @hakonfam /subsys/nrf_profiler/ @pdunaj /subsys/shell/ @nordic-krch +/subsys/sdfw_services/ @anhmolt @hakonfam @jonathannilsen +/subsys/suit/ @tomchy @ahasztag /subsys/nrf_security/ @frkv @Vge0rge @vili-nordic @SebastianBoe @mswarowsky /subsys/trusted_storage/ @frkv @Vge0rge @vili-nordic @SebastianBoe @mswarowsky +/subsys/uart_async_adapter/ @rakons /subsys/net_core_monitor/ @maje-emb /subsys/zigbee/ @milewr /tests/ @PerMac @katgiadla /tests/bluetooth/tester/ @carlescufi @ludvigsj -/tests/bluetooth/iso/ @koffes @alexsven @erikrobstad @rick1082 @gWacey @Frodevan +/tests/bluetooth/iso/ @nrfconnect/ncs-audio @Frodevan /tests/crypto/ @stephen-nordic @magnev /tests/drivers/flash_patch/ @oyvindronningstad /tests/drivers/fprotect/ @oyvindronningstad @@ -300,17 +311,17 @@ Kconfig* @tejlmand /tests/lib/nrf_modem_lib/nrf91_sockets/ @MirkoCovizzi /tests/lib/pdn/ @lemrey @eivindj-nordic /tests/lib/ram_pwrdn/ @Damian-Nordic -/tests/lib/contin_array/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/tests/lib/data_fifo/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/tests/lib/pcm_mix/ @koffes @alexsven @erikrobstad @rick1082 @gWacey -/tests/lib/pcm_stream_channel_modifier/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/tests/lib/contin_array/ @nrfconnect/ncs-audio +/tests/lib/data_fifo/ @nrfconnect/ncs-audio +/tests/lib/pcm_mix/ @nrfconnect/ncs-audio +/tests/lib/pcm_stream_channel_modifier/ @nrfconnect/ncs-audio /tests/lib/sample_rate_converter/ @andvib @gWacey -/tests/lib/tone/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/tests/lib/tone/ @nrfconnect/ncs-audio /tests/modules/lib/zcbor/ @oyvindronningstad /tests/modules/mcuboot/direct_xip/ @hakonfam /tests/modules/mcuboot/external_flash/ @hakonfam @sigvartmh -/tests/nrf5340_audio/ @koffes @alexsven @erikrobstad @rick1082 @nordic-auko -/tests/subsys/audio_module/ @koffes @alexsven @erikrobstad @rick1082 @gWacey +/tests/nrf5340_audio/ @nrfconnect/ncs-audio @nordic-auko +/tests/subsys/audio_module/ @nrfconnect/ncs-audio /tests/subsys/bluetooth/gatt_dm/ @doki-nordic /tests/subsys/bluetooth/mesh/ @ludvigsj /tests/subsys/bluetooth/fast_pair/ @alstrzebonski @MarekPieta @kapi-no @@ -334,7 +345,9 @@ Kconfig* @tejlmand /tests/subsys/partition_manager/region/ @hakonfam @sigvartmh /tests/subsys/pcd/ @hakonfam @sigvartmh /tests/subsys/nrf_profiler/ @pdunaj @MarekPieta +/tests/subsys/sdfw_services/ @anhmolt @hakonfam @jonathannilsen /tests/subsys/zigbee/ @milewr +/tests/subsys/suit/ @tomchy @ahasztag @robertstypa /tests/tfm/ @frkv @Vge0rge @vili-nordic @SebastianBoe @mswarowsky @stephen-nordic @magnev /tests/unity/ @nordic-krch /zephyr/ @carlescufi diff --git a/Kconfig.nrf b/Kconfig.nrf index 335cad1bd51f..0feac6b7bd99 100644 --- a/Kconfig.nrf +++ b/Kconfig.nrf @@ -34,10 +34,6 @@ config HIDE_CHILD_PARENT_CONFIG default y if "$(HIDE_CHILD_PARENT_CONFIG)" = "True" default n -# Override boot banner -config BOOT_BANNER_STRING - default "Booting nRF Connect SDK" - # Override configuration from zephyr which sets this to 0x200 if MCUboot is # enabled (CONFIG_BOOTLOADER_MCUBOOT), since NCS use partition_manager to # get this offset intsead. @@ -51,7 +47,7 @@ config WARN_EXPERIMENTAL # Zephyr default is newlib and not newlib-nano for consistency between architectures. # To reduce FLASH footprint, newlib-nano is preferred default in NCS when newlib is selected. config NEWLIB_LIBC_NANO - default y + default y if SOC_FAMILY_NORDIC_NRF depends on NEWLIB_LIBC && HAS_NEWLIB_LIBC_NANO # This is a temporary solution to whitelist @@ -111,6 +107,7 @@ config NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE config GETOPT default n +rsource "kernel/Kconfig" rsource "samples/Kconfig" rsource "subsys/Kconfig" rsource "modules/Kconfig" diff --git a/README.rst b/README.rst index d94fe8155338..04211a266609 100644 --- a/README.rst +++ b/README.rst @@ -6,14 +6,13 @@ nRF Connect SDK: sdk-nrf :depth: 2 This repository contains the core of nRF Connect SDK, including subsystems, -libraries, samples and applications. +libraries, samples, and applications. It is also the SDK's west manifest repository, containing the nRF Connect SDK manifest (west.yml). Documentation ************* -Official documentation at: +Official latest documentation at https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html -* Latest: http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest -* All versions: http://developer.nordicsemi.com/nRF_Connect_SDK/doc/ +For earlier versions, open the latest version and use the drop-down under the title header. diff --git a/VERSION b/VERSION index e70b4523ae7f..40bd3f64267d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6.0 +2.6.99 diff --git a/applications/asset_tracker_v2/CMakeLists.txt b/applications/asset_tracker_v2/CMakeLists.txt index 47129e073882..55cbf60d8ebe 100644 --- a/applications/asset_tracker_v2/CMakeLists.txt +++ b/applications/asset_tracker_v2/CMakeLists.txt @@ -30,16 +30,19 @@ add_subdirectory_ifdef(CONFIG_WATCHDOG_APPLICATION src/watchdog) # Include nRF modem library header file for PC builds. # These are used throughout the application in type definitions. if (CONFIG_BOARD_QEMU_X86 OR CONFIG_BOARD_NATIVE_POSIX) - target_include_directories(app PRIVATE ${NRFXLIB_DIR}/nrf_modem/include/) + target_include_directories(app PRIVATE ${NRFXLIB_DIR}/nrf_modem/include/) - # Make folder containing certificates global so that it can be located by the configured - # cloud library. - zephyr_include_directories(src/cloud-certs) + # Make the folder that contains the certificates global so that it can be located by the + # nRF Cloud library. For the other clouds integrations, the certificates are handled by the + # MQTT helper library, see CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES. + if (CONFIG_NRF_CLOUD_PROVISION_CERTIFICATES) + zephyr_include_directories(src/cloud-certs) + endif() - target_compile_options(app PRIVATE - -DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10) + target_compile_options(app PRIVATE + -DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10) endif() if(CONFIG_ASSET_TRACKER_V2_LTO) - target_compile_options(app PRIVATE "-flto") + target_compile_options(app PRIVATE "-flto") endif() diff --git a/applications/asset_tracker_v2/Kconfig.sysbuild b/applications/asset_tracker_v2/Kconfig.sysbuild index dd74e2419457..4b2483949861 100644 --- a/applications/asset_tracker_v2/Kconfig.sysbuild +++ b/applications/asset_tracker_v2/Kconfig.sysbuild @@ -5,9 +5,9 @@ # config SECURE_BOOT - default y if $(BOARD) = "nrf9160dk_nrf9160_ns" + default y if BOARD_NRF9160DK_NRF9160_NS config SECURE_BOOT_APPCORE - default y if $(BOARD) = "nrf9160dk_nrf9160_ns" + default y if BOARD_NRF9160DK_NRF9160_NS source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/applications/asset_tracker_v2/boards/native_sim.conf b/applications/asset_tracker_v2/boards/native_sim.conf index 9bd7854b5d2c..05e817b38fe1 100644 --- a/applications/asset_tracker_v2/boards/native_sim.conf +++ b/applications/asset_tracker_v2/boards/native_sim.conf @@ -116,3 +116,6 @@ CONFIG_BUILD_S1_VARIANT=n # Watchdog CONFIG_WATCHDOG_APPLICATION=n + +# Cloud module certificates +CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER="src/cloud-certs" diff --git a/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.conf b/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.conf index 602fee6bcbee..c4b9e54f0e79 100644 --- a/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.conf +++ b/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.conf @@ -27,3 +27,53 @@ CONFIG_ADXL367_REFERENCED_ACTIVITY_DETECTION_MODE=y CONFIG_ADXL367_ACTIVITY_THRESHOLD=1000 # App does not set activity time, set to 0 to disable CONFIG_ADXL367_ACTIVITY_TIME=0 + +# configs for Wi-Fi +CONFIG_WIFI=y +CONFIG_WIFI_NRF700X=y +CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y +# Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT +CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=10 + +# Wi-Fi location +CONFIG_LOCATION_METHOD_WIFI=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_GNSS=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_WIFI=y +CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_THIRD_CELLULAR=y + +# Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT +CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=10 +CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 + +# Not for LTE throughput testing +CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=4096 +CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE=4096 + +# Scan only using offload API +CONFIG_WPA_SUPP=n + +# For nRF9160 the default is socket interface +CONFIG_NET_DEFAULT_IF_ETHERNET=y +CONFIG_MBEDTLS=n +CONFIG_NORDIC_SECURITY_BACKEND=n + +# Networking +CONFIG_NET_L2_ETHERNET=y +CONFIG_NET_NATIVE=y +CONFIG_NET_IPV4=y +CONFIG_NET_DHCPV4=y +CONFIG_NET_STATISTICS=y +CONFIG_NET_STATISTICS_WIFI=y +CONFIG_NET_STATISTICS_USER_API=y +CONFIG_NET_CONTEXT_SYNC_RECV=y + +# Memory configurations +CONFIG_NET_BUF_RX_COUNT=8 +CONFIG_NET_BUF_TX_COUNT=8 +CONFIG_NET_PKT_RX_COUNT=1 +CONFIG_NET_PKT_TX_COUNT=1 +CONFIG_NET_TX_STACK_SIZE=4096 +CONFIG_NET_RX_STACK_SIZE=4096 +CONFIG_NET_TC_TX_COUNT=1 +CONFIG_NET_MAX_CONTEXTS=5 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 diff --git a/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.overlay b/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.overlay index c75d1a28aff5..e46ea2e715ed 100644 --- a/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.overlay +++ b/applications/asset_tracker_v2/boards/thingy91x_nrf9151_ns.overlay @@ -4,6 +4,8 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#include + / { aliases { temp-sensor = &bme680; 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 d7a2b1e16dc5..967045710af8 100644 --- a/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst +++ b/applications/asset_tracker_v2/doc/asset_tracker_v2_description.rst @@ -107,7 +107,7 @@ The application provides predefined configuration files for typical use cases. Following are the available configuration files: * :file:`prj.conf` - Configuration file for all build targets. -* :file:`boards/.conf` - Configuration file specific for a build target specified with ****, where **** is the build target, for example ``nrf9161dk_nrf9161_ns``. +* :file:`boards/.conf` - Configuration file specific for a build target specified with ****, where **** is the build target, for example ``nrf9161dk/nrf9161/ns``. This file is automatically merged with the :file:`prj.conf` file when you build for that target. The :file:`include//led_state_def.h` header file describes the LED behavior of the CAF LEDs module. diff --git a/applications/asset_tracker_v2/doc/cloud_module.rst b/applications/asset_tracker_v2/doc/cloud_module.rst index 062b5ec6cd97..b632a2903bdb 100644 --- a/applications/asset_tracker_v2/doc/cloud_module.rst +++ b/applications/asset_tracker_v2/doc/cloud_module.rst @@ -99,7 +99,7 @@ This application implements full modem FOTA for the nRF91x1 DKs and for the nRF9 To enable full modem FOTA, add the ``-DEXTRA_CONF_FILE=overlay-full_modem_fota.conf`` parameter to your build command. Also, specify your development kit version by appending it to the board name. -For example, if your development kit version is 1.0.1, use the board name ``nrf9160dk_nrf9160_ns@1_0_1`` in your build command. +For example, if your development kit version is 1.0.1, use the board name ``nrf9160dk@1.0.1/nrf9160/ns`` in your build command. Connection awareness ==================== @@ -188,7 +188,7 @@ If not using the default DPS (Device Provisioning Service) host, ensure that the Configurations for LwM2M integration layer ------------------------------------------ -When building for LwM2M, the cloud module's default configuration is to communicate with AVSystem's `Coiote Device Management`_, with a runtime provisioned `Pre-shared key (PSK)`_ set by the :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK` option. +When building for LwM2M, the cloud module's default configuration is to communicate with AVSystem's `Coiote Device Management`_, with a runtime provisioned `pre-shared key `_ set by the :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK` option. This enables the device to work with `Coiote Device Management`_ without provisioning the PSK to the modem before running the application. To allow the device to communicate with other LwM2M Servers, modify the default configuration by changing the following Kconfig options: diff --git a/applications/asset_tracker_v2/doc/cloud_wrapper.rst b/applications/asset_tracker_v2/doc/cloud_wrapper.rst index 8d56d70edafa..037d13962585 100644 --- a/applications/asset_tracker_v2/doc/cloud_wrapper.rst +++ b/applications/asset_tracker_v2/doc/cloud_wrapper.rst @@ -53,7 +53,7 @@ The application integrates LwM2M through the following APIs: Bootstrapping and credential handling ------------------------------------- -When the option :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK` is enabled, the modem is provisioned at run time after boot with a `Pre-Shared Key (PSK)`_ set by :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK`. +When the option :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK` is enabled, the modem is provisioned at run time after boot with a `pre-shared key (PSK) `_ set by :kconfig:option:`CONFIG_LWM2M_INTEGRATION_PSK`. If :kconfig:option:`CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP` is enabled, the PSK is provisioned to a security tag dedicated to the bootstrap server connection. During bootstrapping, the application receives a separate newly generated key from the bootstrap server that is provisioned to a security tag dedicated to the management server connection. @@ -115,40 +115,40 @@ The following tables list the various topics used in the AWS IoT implementation. Device-to-cloud (D2C) --------------------- -+------------------------------+--------------------------------------------------------+ -| Data | Topic | -+==============================+========================================================+ -| A-GNSS requests | ``/agps/get`` | -+------------------------------+--------------------------------------------------------+ -| P-GPS requests | ``/pgps/get`` | -+------------------------------+--------------------------------------------------------+ -| Neighbor cell measurements | ``/ncellmeas`` | -+------------------------------+--------------------------------------------------------+ -| Button presses | ``/messages`` | -+------------------------------+--------------------------------------------------------+ -| Sensor/device data | ``$aws/things//shadow/update`` | -+------------------------------+--------------------------------------------------------+ -| Device configuration | ``$aws/things//shadow/update`` | -+------------------------------+--------------------------------------------------------+ -| Buffered sensor/device data | ``/batch`` | -+------------------------------+--------------------------------------------------------+ ++------------------------------+---------------------------------------------------------+ +| Data | Topic | ++==============================+=========================================================+ +| A-GNSS requests | ``/agnss/get`` | ++------------------------------+---------------------------------------------------------+ +| P-GPS requests | ``/pgps/get`` | ++------------------------------+---------------------------------------------------------+ +| Neighbor cell measurements | ``/ncellmeas`` | ++------------------------------+---------------------------------------------------------+ +| Button presses | ``/messages`` | ++------------------------------+---------------------------------------------------------+ +| Sensor/device data | ``$aws/things//shadow/update`` | ++------------------------------+---------------------------------------------------------+ +| Device configuration | ``$aws/things//shadow/update`` | ++------------------------------+---------------------------------------------------------+ +| Buffered sensor/device data | ``/batch`` | ++------------------------------+---------------------------------------------------------+ Cloud-to-device (C2D) --------------------- -+------------------------------+--------------------------------------------------------+ -| Data | Topic | -+==============================+========================================================+ -| A-GNSS response | ``/agps`` | -+------------------------------+--------------------------------------------------------+ -| P-GPS response | ``/pgps`` | -+------------------------------+--------------------------------------------------------+ -| Device configuration updates | ``$aws/things//shadow/delta`` | -| +--------------------------------------------------------+ -| | ``$aws/things//shadow/get/accepted`` | -| +--------------------------------------------------------+ -| | ``$aws/things//shadow/get/accepted/desired/cfg`` | -+------------------------------+--------------------------------------------------------+ ++------------------------------+---------------------------------------------------------+ +| Data | Topic | ++==============================+=========================================================+ +| A-GNSS response | ``/agnss`` | ++------------------------------+---------------------------------------------------------+ +| P-GPS response | ``/pgps`` | ++------------------------------+---------------------------------------------------------+ +| Device configuration updates | ``$aws/things//shadow/delta`` | +| +---------------------------------------------------------+ +| | ``$aws/things//shadow/get/accepted`` | +| +---------------------------------------------------------+ +| | ``$aws/things//shadow/get/accepted/desired/cfg`` | ++------------------------------+---------------------------------------------------------+ Azure IoT Hub topics ==================== @@ -159,36 +159,36 @@ For more information on MQTT topics and property bags in Azure IoT Hub, refer to Device-to-cloud (D2C) --------------------- -+------------------------------+---------------------------------------------+--------------+ -| Data | Topic | Property bag | -+==============================+=============================================+==============+ -| A-GNSS requests | ``devices//messages/events/`` | ``agps=get`` | -+------------------------------+---------------------------------------------+--------------+ -| P-GPS requests | ``devices//messages/events/`` | ``pgps=get`` | -+------------------------------+---------------------------------------------+--------------+ -| Neighbor cell measurements | ``devices//messages/events/`` | ``ncellmeas``| -+------------------------------+---------------------------------------------+--------------+ -| Button presses | ``devices//messages/events/`` | NA | -+------------------------------+---------------------------------------------+--------------+ -| Sensor/device data | ``$iothub/twin/PATCH/properties/reported/`` | NA | -+------------------------------+---------------------------------------------+--------------+ -| Device configuration | ``$iothub/twin/PATCH/properties/reported/`` | NA | -+------------------------------+---------------------------------------------+--------------+ -| Buffered sensor/device data | ``devices//messages/events/`` | ``batch`` | -+------------------------------+---------------------------------------------+--------------+ ++------------------------------+---------------------------------------------+---------------+ +| Data | Topic | Property bag | ++==============================+=============================================+===============+ +| A-GNSS requests | ``devices//messages/events/`` | ``agnss=get`` | ++------------------------------+---------------------------------------------+---------------+ +| P-GPS requests | ``devices//messages/events/`` | ``pgps=get`` | ++------------------------------+---------------------------------------------+---------------+ +| Neighbor cell measurements | ``devices//messages/events/`` | ``ncellmeas`` | ++------------------------------+---------------------------------------------+---------------+ +| Button presses | ``devices//messages/events/`` | NA | ++------------------------------+---------------------------------------------+---------------+ +| Sensor/device data | ``$iothub/twin/PATCH/properties/reported/`` | NA | ++------------------------------+---------------------------------------------+---------------+ +| Device configuration | ``$iothub/twin/PATCH/properties/reported/`` | NA | ++------------------------------+---------------------------------------------+---------------+ +| Buffered sensor/device data | ``devices//messages/events/`` | ``batch`` | ++------------------------------+---------------------------------------------+---------------+ Cloud-to-device (C2D) --------------------- -+------------------------------+------------------------------------------+----------------+ -| Data | Topic | Property bag | -+==============================+==========================================+================+ -| A-GNSS response | ``devices//messages/devicebound/`` | ``agps=result``| -+------------------------------+------------------------------------------+----------------+ -| P-GPS response | ``devices//messages/devicebound/`` | ``pgps=result``| -+------------------------------+------------------------------------------+----------------+ -| Device configuration updates | ``$iothub/twin/res//`` | NA | -+------------------------------+------------------------------------------+----------------+ ++------------------------------+------------------------------------------+-----------------+ +| Data | Topic | Property bag | ++==============================+==========================================+=================+ +| A-GNSS response | ``devices//messages/devicebound/`` | ``agnss=result``| ++------------------------------+------------------------------------------+-----------------+ +| P-GPS response | ``devices//messages/devicebound/`` | ``pgps=result`` | ++------------------------------+------------------------------------------+-----------------+ +| Device configuration updates | ``$iothub/twin/res//`` | NA | ++------------------------------+------------------------------------------+-----------------+ nRF Cloud topics ================ diff --git a/applications/asset_tracker_v2/doc/unit_test.rst b/applications/asset_tracker_v2/doc/unit_test.rst index 1af401e9927b..7608b3cd1e55 100644 --- a/applications/asset_tracker_v2/doc/unit_test.rst +++ b/applications/asset_tracker_v2/doc/unit_test.rst @@ -18,63 +18,8 @@ Following are the modules that have unit tests: * LwM2M integration layer - :file:`asset_tracker_v2/src/cloud/lwm2m_integration/lwm2m_integration.c` * nRF Cloud codec backend - :file:`asset_tracker_v2/src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c` -Running the unit test -********************* - To run the unit test, you must navigate to the test directory of the respective internal module. For example, to run the unit test for :ref:`asset_tracker_v2_debug_module`, navigate to :file:`asset_tracker_v2/tests/debug_module`. -The unit tests can be executed using West or Twister. - -Running unit tests using West -============================= - -Enter the following west commands to execute the tests on different board targets: - -* :ref:`zephyr:native_sim` board target: - -.. code-block:: console - - west build -b native_sim -t run - -* ``qemu_cortex_m3`` board target: - -.. code-block:: console - - west build -b qemu_cortex_m3 -t run - -Running unit tests using Twister -================================ - -Enter the following twister commands to execute the tests on different board targets: - -* On both :ref:`zephyr:native_sim` and ``qemu_cortex_m3`` board targets: - -.. code-block:: console - - twister -T . - -* ``qemu_cortex_m3`` board target: - -.. code-block:: console - - twister -T . -p qemu_cortex_m3 - -Running the unit tests on the nRF9160 DK ----------------------------------------- - -Enter the following command to execute the unit tests on nRF9160 DK: - -.. code-block:: console - - twister -T . -p nrf9160dk_nrf9160_ns --device-testing --device-serial - -In this console snippet, ``serial port`` must be the port where you receive logs from the DK, normally the first port listed by ``nrfjprog --com``, for example ``/dev/ttyACM0``. - -The :file:`testcase.yaml` file for that unit test must have the entry ``platform_allow: nrf9160dk_nrf9160_ns``. -See :file:`nrf/applications/asset_tracker_v2/tests/location_module/testcase.yaml` for an example. - -Twister can also be used to see code coverage reports. -For more information about Twister, see the :ref:`zephyr:twister_script` documentation. -.. note:: - The Twister commands only work on Linux operating system. +The unit tests can be executed using west or Twister. +For more information, see :ref:`running_unit_tests`, and in particular the :ref:`example for nRF9160 DK `. diff --git a/applications/asset_tracker_v2/include/nrf9151dk_nrf9151_ns/led_state_def.h b/applications/asset_tracker_v2/include/nrf9151dk/led_state_def.h similarity index 100% rename from applications/asset_tracker_v2/include/nrf9151dk_nrf9151_ns/led_state_def.h rename to applications/asset_tracker_v2/include/nrf9151dk/led_state_def.h diff --git a/applications/asset_tracker_v2/include/nrf9160dk_nrf9160_ns/led_state_def.h b/applications/asset_tracker_v2/include/nrf9160dk/led_state_def.h similarity index 100% rename from applications/asset_tracker_v2/include/nrf9160dk_nrf9160_ns/led_state_def.h rename to applications/asset_tracker_v2/include/nrf9160dk/led_state_def.h diff --git a/applications/asset_tracker_v2/include/nrf9161dk_nrf9161_ns/led_state_def.h b/applications/asset_tracker_v2/include/nrf9161dk/led_state_def.h similarity index 100% rename from applications/asset_tracker_v2/include/nrf9161dk_nrf9161_ns/led_state_def.h rename to applications/asset_tracker_v2/include/nrf9161dk/led_state_def.h diff --git a/applications/asset_tracker_v2/include/thingy91_nrf9160_ns/led_state_def.h b/applications/asset_tracker_v2/include/thingy91/led_state_def.h similarity index 100% rename from applications/asset_tracker_v2/include/thingy91_nrf9160_ns/led_state_def.h rename to applications/asset_tracker_v2/include/thingy91/led_state_def.h diff --git a/applications/asset_tracker_v2/include/thingy91x_nrf9151_ns/led_state_def.h b/applications/asset_tracker_v2/include/thingy91x/led_state_def.h similarity index 100% rename from applications/asset_tracker_v2/include/thingy91x_nrf9151_ns/led_state_def.h rename to applications/asset_tracker_v2/include/thingy91x/led_state_def.h diff --git a/applications/asset_tracker_v2/overlay-nrf7002ek-wifi-scan-only.conf b/applications/asset_tracker_v2/overlay-nrf7002ek-wifi-scan-only.conf index b5b9c1bfc3e7..35d1507e4df1 100644 --- a/applications/asset_tracker_v2/overlay-nrf7002ek-wifi-scan-only.conf +++ b/applications/asset_tracker_v2/overlay-nrf7002ek-wifi-scan-only.conf @@ -22,7 +22,7 @@ CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y # Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT -CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=30 +CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=20 # Wi-Fi location CONFIG_LOCATION_METHOD_WIFI=y @@ -31,7 +31,7 @@ CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_SECOND_WIFI=y CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_THIRD_CELLULAR=y # Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT -CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=30 +CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=20 CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 # Needed to handle more scan results CONFIG_HEAP_MEM_POOL_SIZE=60000 diff --git a/applications/asset_tracker_v2/sample.yaml b/applications/asset_tracker_v2/sample.yaml index cd17eb41f7c0..1c8be59e5a93 100644 --- a/applications/asset_tracker_v2/sample.yaml +++ b/applications/asset_tracker_v2/sample.yaml @@ -5,15 +5,15 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns - native_sim integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns - native_sim tags: ci_build applications.asset_tracker_v2.nrf_cloud.sysbuild: @@ -21,25 +21,24 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns tags: ci_build sysbuild applications.asset_tracker_v2.nrf_cloud-pgps: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-pgps.conf tags: ci_build applications.asset_tracker_v2.nrf_cloud-pgps.sysbuild: @@ -47,26 +46,25 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-pgps.conf tags: ci_build sysbuild applications.asset_tracker_v2.nrf_cloud-no-agnss: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: CONFIG_NRF_CLOUD_AGNSS=n tags: ci_build applications.asset_tracker_v2.nrf_cloud-no-agnss.sysbuild: @@ -74,27 +72,27 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: CONFIG_NRF_CLOUD_AGNSS=n tags: ci_build sysbuild applications.asset_tracker_v2.aws: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns - native_sim integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns - native_sim extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" @@ -105,12 +103,12 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" extra_args: EXTRA_CONF_FILE="overlay-aws.conf" @@ -119,14 +117,14 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" extra_args: EXTRA_CONF_FILE="overlay-aws.conf;overlay-pgps.conf" @@ -136,12 +134,12 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" extra_args: EXTRA_CONF_FILE="overlay-aws.conf;overlay-pgps.conf" @@ -150,14 +148,13 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" @@ -169,12 +166,11 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com" - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" @@ -185,15 +181,15 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns - native_sim integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns - native_sim extra_configs: - CONFIG_AZURE_IOT_HUB_DPS_HOSTNAME="global.azure-devices-provisioning.net" @@ -205,12 +201,12 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_AZURE_IOT_HUB_DPS_HOSTNAME="global.azure-devices-provisioning.net" - CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE="IDSCOPE" @@ -220,15 +216,15 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns - native_sim integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns - native_sim extra_args: EXTRA_CONF_FILE=overlay-debug.conf tags: ci_build @@ -237,26 +233,25 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-debug.conf tags: ci_build sysbuild applications.asset_tracker_v2.debug-memfault: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-debug.conf;overlay-memfault.conf" @@ -266,12 +261,11 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-debug.conf;overlay-memfault.conf" @@ -280,14 +274,14 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE=overlay-memfault.conf @@ -297,12 +291,12 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE=overlay-memfault.conf @@ -311,14 +305,14 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-low-power.conf tags: ci_build applications.asset_tracker_v2.low-power.sysbuild: @@ -326,23 +320,22 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-low-power.conf tags: ci_build sysbuild applications.asset_tracker_v2.carrier.nrf9160dk: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-carrier.conf tags: ci_build applications.asset_tracker_v2.carrier.nrf9160dk.sysbuild: @@ -350,42 +343,41 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE=overlay-carrier.conf tags: ci_build sysbuild applications.asset_tracker_v2.carrier.nrf9161dk: build_only: true build_on_all: true - platform_allow: nrf9161dk_nrf9161_ns + platform_allow: nrf9161dk/nrf9161/ns integration_platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns extra_args: EXTRA_CONF_FILE=overlay-carrier.conf tags: ci_build applications.asset_tracker_v2.carrier.nrf9151dk: build_only: true build_on_all: true - platform_allow: nrf9151dk_nrf9151_ns + platform_allow: nrf9151dk/nrf9151/ns integration_platforms: - - nrf9151dk_nrf9151_ns + - nrf9151dk/nrf9151/ns extra_args: EXTRA_CONF_FILE=overlay-carrier.conf tags: ci_build applications.asset_tracker_v2.lwm2m.bootstrap-low_power: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP=y extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-low-power.conf" @@ -395,26 +387,25 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-low-power.conf" tags: ci_build sysbuild applications.asset_tracker_v2.lwm2m.debug: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-debug.conf" tags: ci_build applications.asset_tracker_v2.lwm2m.debug.sysbuild: @@ -422,23 +413,22 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-debug.conf" tags: ci_build sysbuild applications.asset_tracker_v2.lwm2m.debug-modem_trace: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-debug.conf" SNIPPET="nrf91-modem-trace-uart;tfm-enable-share-uart" @@ -448,9 +438,9 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: > EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-debug.conf" asset_tracker_v2_SNIPPET="nrf91-modem-trace-uart;tfm-enable-share-uart" @@ -459,14 +449,13 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf" SNIPPET="nrf91-modem-trace-uart;tfm-enable-share-uart" @@ -476,12 +465,11 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: > EXTRA_CONF_FILE="overlay-lwm2m.conf" asset_tracker_v2_SNIPPET="nrf91-modem-trace-uart;tfm-enable-share-uart" @@ -490,16 +478,15 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-memfault.conf" @@ -509,12 +496,11 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-memfault.conf" @@ -523,16 +509,16 @@ tests: build_only: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-low-power.conf;overlay-memfault.conf" @@ -542,12 +528,12 @@ tests: sysbuild: true build_on_all: true platform_allow: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="PROJECTKEY" extra_args: EXTRA_CONF_FILE="overlay-low-power.conf;overlay-memfault.conf" @@ -555,42 +541,42 @@ tests: applications.asset_tracker_v2.nrf7002ek_wifi.nrf9160dk: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build applications.asset_tracker_v2.nrf7002ek_wifi.nrf9160dk.sysbuild: build_only: true sysbuild: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build sysbuild applications.asset_tracker_v2.nrf7002ek_wifi.nrf9161dk: build_only: true integration_platforms: - - nrf9161dk_nrf9161_ns - platform_allow: nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns + platform_allow: nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build applications.asset_tracker_v2.nrf7002ek_wifi.nrf9151dk: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - platform_allow: nrf9151dk_nrf9151_ns + - nrf9151dk/nrf9151/ns + platform_allow: nrf9151dk/nrf9151/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build applications.asset_tracker_v2.nrf7002ek_wifi-debug: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf;overlay-debug.conf" tags: ci_build @@ -598,8 +584,8 @@ tests: build_only: true sysbuild: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf;overlay-debug.conf" tags: ci_build sysbuild diff --git a/applications/asset_tracker_v2/src/cloud-certs/ca-cert.pem b/applications/asset_tracker_v2/src/cloud-certs/ca-cert.pem deleted file mode 100644 index 0d6eaa7df0b5..000000000000 --- a/applications/asset_tracker_v2/src/cloud-certs/ca-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CA CERTIFICATE-----\n" -"-----CERTIFICATE-----\n" -"-----END CA CERTIFICATE-----\n" diff --git a/applications/asset_tracker_v2/src/cloud-certs/client-cert.pem b/applications/asset_tracker_v2/src/cloud-certs/client-cert.pem deleted file mode 100644 index 0ee47f337c82..000000000000 --- a/applications/asset_tracker_v2/src/cloud-certs/client-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CLIENT CERTIFICATE-----\n" -"-----CERTIFICATE-----\n" -"-----END CLIENT CERTIFICATE-----\n" diff --git a/applications/asset_tracker_v2/src/cloud-certs/private-key.pem b/applications/asset_tracker_v2/src/cloud-certs/private-key.pem deleted file mode 100644 index 18bee64d9cb1..000000000000 --- a/applications/asset_tracker_v2/src/cloud-certs/private-key.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN PRIVATE KEY-----\n" -"-----KEY-----\n" -"-----END PRIVATE KEY-----\n" diff --git a/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c b/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c index 1e2cb665663b..7b9160867d74 100644 --- a/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c +++ b/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c @@ -21,31 +21,26 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_CLOUD_INTEGRATION_LOG_LEVEL); #endif #define AWS "$aws/things/" -#define AWS_LEN (sizeof(AWS) - 1) #define CFG_TOPIC AWS "%s/shadow/get/accepted/desired/cfg" -#define CFG_TOPIC_LEN (AWS_LEN + AWS_CLOUD_CLIENT_ID_LEN + 32) +#define CFG_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(CFG_TOPIC) - 3) #define BATCH_TOPIC "%s/batch" -#define BATCH_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 6) +#define BATCH_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(BATCH_TOPIC) - 3) #define MESSAGES_TOPIC "%s/messages" -#define MESSAGES_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 9) +#define MESSAGES_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(MESSAGES_TOPIC) - 3) #define GROUND_FIX_TOPIC "%s/ground-fix" -#define GROUND_FIX_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 11) -#define AGNSS_REQUEST_TOPIC "%s/agps/get" -#define AGNSS_REQUEST_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 9) -#define AGNSS_RESPONSE_TOPIC "%s/agps" -#define AGNSS_RESPONSE_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 5) +#define GROUND_FIX_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(GROUND_FIX_TOPIC) - 3) +#define AGNSS_REQUEST_TOPIC "%s/agnss/get" +#define AGNSS_REQUEST_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(AGNSS_REQUEST_TOPIC) - 3) +#define AGNSS_RESPONSE_TOPIC "%s/agnss" +#define AGNSS_RESPONSE_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(AGNSS_RESPONSE_TOPIC) - 3) #define PGPS_REQUEST_TOPIC "%s/pgps/get" -#define PGPS_REQUEST_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 9) +#define PGPS_REQUEST_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(PGPS_REQUEST_TOPIC) - 3) #define PGPS_RESPONSE_TOPIC "%s/pgps" -#define PGPS_RESPONSE_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 5) +#define PGPS_RESPONSE_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(PGPS_RESPONSE_TOPIC) - 3) #define MEMFAULT_TOPIC "%s/memfault" \ IF_ENABLED(CONFIG_DEBUG_MODULE_MEMFAULT_USE_EXTERNAL_TRANSPORT, \ ("/" CONFIG_MEMFAULT_NCS_PROJECT_KEY)) -#if defined(CONFIG_DEBUG_MODULE_MEMFAULT_USE_EXTERNAL_TRANSPORT) -#define MEMFAULT_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 9 + sizeof(CONFIG_MEMFAULT_NCS_PROJECT_KEY)) -#else -#define MEMFAULT_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + 9) -#endif /* if defined(CONFIG_DEBUG_MODULE_MEMFAULT_USE_EXTERNAL_TRANSPORT) */ +#define MEMFAULT_TOPIC_LEN (AWS_CLOUD_CLIENT_ID_LEN + sizeof(MEMFAULT_TOPIC) - 3) #define APP_SUB_TOPIC_IDX_CFG 0 #define APP_SUB_TOPIC_IDX_AGNSS 1 @@ -153,8 +148,8 @@ static int populate_app_endpoint_topics(void) sub_topics[APP_SUB_TOPIC_IDX_CFG].topic.utf8 = cfg_topic; sub_topics[APP_SUB_TOPIC_IDX_CFG].topic.size = CFG_TOPIC_LEN; - err = snprintf(agnss_response_topic, sizeof(agnss_response_topic), AGNSS_RESPONSE_TOPIC, - client_id_buf); + err = snprintf(agnss_response_topic, sizeof(agnss_response_topic), + AGNSS_RESPONSE_TOPIC, client_id_buf); if (err != AGNSS_RESPONSE_TOPIC_LEN) { return -ENOMEM; } @@ -517,7 +512,7 @@ int cloud_wrap_agnss_request_send(char *buf, size_t len, bool ack, uint32_t id) .len = len, .message_id = id, .qos = ack ? MQTT_QOS_1_AT_LEAST_ONCE : MQTT_QOS_0_AT_MOST_ONCE, - /* /agps/get */ + /* /agnss/get */ .topic.str = pub_topics[APP_PUB_TOPIC_IDX_AGNSS].topic.utf8, .topic.len = pub_topics[APP_PUB_TOPIC_IDX_AGNSS].topic.size }; diff --git a/applications/asset_tracker_v2/src/cloud/azure_iot_hub_integration.c b/applications/asset_tracker_v2/src/cloud/azure_iot_hub_integration.c index 64a9bd20df38..56667de9d7f8 100644 --- a/applications/asset_tracker_v2/src/cloud/azure_iot_hub_integration.c +++ b/applications/asset_tracker_v2/src/cloud/azure_iot_hub_integration.c @@ -29,7 +29,7 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_CLOUD_INTEGRATION_LOG_LEVEL); #define PROP_BAG_BATCH_KEY "batch" #define PROP_BAG_GROUND_FIX_KEY "ground-fix" -#define PROP_BAG_AGNSS_KEY "agps" +#define PROP_BAG_AGNSS_KEY "agnss" #define PROP_BAG_AGNSS_GET_VALUE "get" #define PROP_BAG_AGNSS_RESPONSE_VALUE "result" diff --git a/applications/asset_tracker_v2/src/cloud/cloud_codec/cloud_codec.h b/applications/asset_tracker_v2/src/cloud/cloud_codec/cloud_codec.h index 58ce7427db0c..54a83b13bb4d 100644 --- a/applications/asset_tracker_v2/src/cloud/cloud_codec/cloud_codec.h +++ b/applications/asset_tracker_v2/src/cloud/cloud_codec/cloud_codec.h @@ -38,6 +38,11 @@ extern "C" { #endif +/** Heading accuracy limit for the heading to be considered valid. Heading is only sent to the + * cloud if it is accurate enough. + */ +#define CLOUD_GNSS_HEADING_ACC_LIMIT (float)60.0 + /** @brief Structure containing battery data published to cloud. */ struct cloud_data_battery { /** Battery fuel gauge percentage. */ @@ -49,18 +54,24 @@ struct cloud_data_battery { }; struct cloud_data_gnss_pvt { - /** Longitude. */ - double longi; /** Latitude. */ double lat; + /** Longitude. */ + double lon; + /** Position accuracy in (2D 1-sigma) in meters. */ + float acc; /** Altitude above WGS-84 ellipsoid in meters. */ float alt; - /** Accuracy in (2D 1-sigma) in meters. */ - float acc; - /** Horizontal speed in meters. */ + /** Altitude accuracy (1-sigma) in meters. */ + float alt_acc; + /** Horizontal speed in m/s. */ float spd; + /** Horizontal speed accuracy (1-sigma) in m/s. */ + float spd_acc; /** Heading of movement in degrees. */ float hdg; + /** Heading of movement accuracy (1-sigma) in degrees. */ + float hdg_acc; }; /** @brief Structure containing GNSS data published to cloud. */ diff --git a/applications/asset_tracker_v2/src/cloud/cloud_codec/json_common.c b/applications/asset_tracker_v2/src/cloud/cloud_codec/json_common.c index f2e310f0fd84..1c194fecbffd 100644 --- a/applications/asset_tracker_v2/src/cloud/cloud_codec/json_common.c +++ b/applications/asset_tracker_v2/src/cloud/cloud_codec/json_common.c @@ -350,13 +350,13 @@ int json_common_gnss_data_add(cJSON *parent, goto exit; } - err = json_add_number(gnss_val_obj, DATA_GNSS_LONGITUDE, data->pvt.longi); + err = json_add_number(gnss_val_obj, DATA_GNSS_LATITUDE, data->pvt.lat); if (err) { LOG_ERR("Encoding error: %d returned at %s:%d", err, __FILE__, __LINE__); goto exit; } - err = json_add_number(gnss_val_obj, DATA_GNSS_LATITUDE, data->pvt.lat); + err = json_add_number(gnss_val_obj, DATA_GNSS_LONGITUDE, data->pvt.lon); if (err) { LOG_ERR("Encoding error: %d returned at %s:%d", err, __FILE__, __LINE__); goto exit; @@ -380,10 +380,12 @@ int json_common_gnss_data_add(cJSON *parent, goto exit; } - err = json_add_number(gnss_val_obj, DATA_GNSS_HEADING, data->pvt.hdg); - if (err) { - LOG_ERR("Encoding error: %d returned at %s:%d", err, __FILE__, __LINE__); - goto exit; + if (data->pvt.hdg_acc < CLOUD_GNSS_HEADING_ACC_LIMIT) { + err = json_add_number(gnss_val_obj, DATA_GNSS_HEADING, data->pvt.hdg); + if (err) { + LOG_ERR("Encoding error: %d returned at %s:%d", err, __FILE__, __LINE__); + goto exit; + } } json_add_obj(gnss_obj, DATA_VALUE, gnss_val_obj); diff --git a/applications/asset_tracker_v2/src/cloud/cloud_codec/lwm2m/lwm2m_codec_helpers.c b/applications/asset_tracker_v2/src/cloud/cloud_codec/lwm2m/lwm2m_codec_helpers.c index 5d202538cdcc..63006e916486 100644 --- a/applications/asset_tracker_v2/src/cloud/cloud_codec/lwm2m/lwm2m_codec_helpers.c +++ b/applications/asset_tracker_v2/src/cloud/cloud_codec/lwm2m/lwm2m_codec_helpers.c @@ -623,7 +623,7 @@ int lwm2m_codec_helpers_set_gnss_data(struct cloud_data_gnss *gnss) } err = lwm2m_set_f64(&LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LONGITUDE_RID), - gnss->pvt.longi); + gnss->pvt.lon); if (err) { return err; } diff --git a/applications/asset_tracker_v2/src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c b/applications/asset_tracker_v2/src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c index e3ca81365478..dca50e1358ed 100644 --- a/applications/asset_tracker_v2/src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c +++ b/applications/asset_tracker_v2/src/cloud/cloud_codec/nrf_cloud/nrf_cloud_codec.c @@ -156,15 +156,15 @@ static int add_pvt_data(cJSON *parent, struct cloud_data_gnss *gnss) .type = NRF_CLOUD_GNSS_TYPE_PVT, .ts_ms = NRF_CLOUD_NO_TIMESTAMP, .pvt = { - .lon = gnss->pvt.longi, .lat = gnss->pvt.lat, + .lon = gnss->pvt.lon, .accuracy = gnss->pvt.acc, .alt = gnss->pvt.alt, .has_alt = 1, .speed = gnss->pvt.spd, .has_speed = 1, .heading = gnss->pvt.hdg, - .has_heading = 1 + .has_heading = gnss->pvt.hdg_acc < CLOUD_GNSS_HEADING_ACC_LIMIT ? 1 : 0 } }; cJSON *data_obj = cJSON_CreateObject(); diff --git a/applications/asset_tracker_v2/src/events/location_module_event.h b/applications/asset_tracker_v2/src/events/location_module_event.h index cc2f86a8e83d..9a7d094b10cb 100644 --- a/applications/asset_tracker_v2/src/events/location_module_event.h +++ b/applications/asset_tracker_v2/src/events/location_module_event.h @@ -94,23 +94,32 @@ enum location_module_event_type { /** @brief Position, velocity and time (PVT) data. */ struct location_module_pvt { + /** Latitude in degrees. */ + double latitude; + /** Longitude in degrees. */ double longitude; - /** Latitude in degrees. */ - double latitude; + /** Position accuracy (2D 1-sigma) in meters. */ + float accuracy; /** Altitude above WGS-84 ellipsoid in meters. */ float altitude; - /** Position accuracy (2D 1-sigma) in meters. */ - float accuracy; + /** Altitude accuracy in meters. */ + float altitude_accuracy; /** Horizontal speed in m/s. */ float speed; + /** Horizontal speed accuracy (1-sigma) in m/s. */ + float speed_accuracy; + /** Heading of user movement in degrees. */ float heading; + + /** Heading of user movement accuracy (1-sigma) in degrees. */ + float heading_accuracy; }; /** @brief Location module data for neighbor cells. */ diff --git a/applications/asset_tracker_v2/src/ext_sensors/ext_sensors.c b/applications/asset_tracker_v2/src/ext_sensors/ext_sensors.c index 3586a71db29e..b4b38581dfb5 100644 --- a/applications/asset_tracker_v2/src/ext_sensors/ext_sensors.c +++ b/applications/asset_tracker_v2/src/ext_sensors/ext_sensors.c @@ -374,7 +374,7 @@ int ext_sensors_pressure_get(double *ext_press) k_spinlock_key_t key = k_spin_lock(&(press_sensor.lock)); #if defined(CONFIG_BME680) /* Pressure is in kPascals */ - *ext_press = sensor_value_to_double(&data) * 1000.0f; + *ext_press = sensor_value_to_double(&data) * 1000.0; #else /* Pressure is in Pascals */ *ext_press = sensor_value_to_double(&data); diff --git a/applications/asset_tracker_v2/src/modules/data_module.c b/applications/asset_tracker_v2/src/modules/data_module.c index 448b20ae50d9..494d5c12d8ed 100644 --- a/applications/asset_tracker_v2/src/modules/data_module.c +++ b/applications/asset_tracker_v2/src/modules/data_module.c @@ -1204,12 +1204,18 @@ static void on_all_states(struct data_msg_data *msg) .queued = true }; + new_location_data.pvt.lat = msg->module.location.data.location.pvt.latitude; + new_location_data.pvt.lon = msg->module.location.data.location.pvt.longitude; new_location_data.pvt.acc = msg->module.location.data.location.pvt.accuracy; new_location_data.pvt.alt = msg->module.location.data.location.pvt.altitude; - new_location_data.pvt.hdg = msg->module.location.data.location.pvt.heading; - new_location_data.pvt.lat = msg->module.location.data.location.pvt.latitude; - new_location_data.pvt.longi = msg->module.location.data.location.pvt.longitude; + new_location_data.pvt.alt_acc = + msg->module.location.data.location.pvt.altitude_accuracy; new_location_data.pvt.spd = msg->module.location.data.location.pvt.speed; + new_location_data.pvt.spd_acc = + msg->module.location.data.location.pvt.speed_accuracy; + new_location_data.pvt.hdg = msg->module.location.data.location.pvt.heading; + new_location_data.pvt.hdg_acc = + msg->module.location.data.location.pvt.heading_accuracy; cloud_codec_populate_gnss_buffer(gnss_buf, &new_location_data, &head_gnss_buf, diff --git a/applications/asset_tracker_v2/src/modules/location_module.c b/applications/asset_tracker_v2/src/modules/location_module.c index df7366b9e69a..b59c094d1584 100644 --- a/applications/asset_tracker_v2/src/modules/location_module.c +++ b/applications/asset_tracker_v2/src/modules/location_module.c @@ -217,12 +217,15 @@ static void data_send_pvt(void) { struct location_module_event *location_module_event = new_location_module_event(); - location_module_event->data.location.pvt.longitude = pvt_data.longitude; location_module_event->data.location.pvt.latitude = pvt_data.latitude; - location_module_event->data.location.pvt.altitude = pvt_data.altitude; + location_module_event->data.location.pvt.longitude = pvt_data.longitude; location_module_event->data.location.pvt.accuracy = pvt_data.accuracy; + location_module_event->data.location.pvt.altitude = pvt_data.altitude; + location_module_event->data.location.pvt.altitude_accuracy = pvt_data.altitude_accuracy; location_module_event->data.location.pvt.speed = pvt_data.speed; + location_module_event->data.location.pvt.speed_accuracy = pvt_data.speed_accuracy; location_module_event->data.location.pvt.heading = pvt_data.heading; + location_module_event->data.location.pvt.heading_accuracy = pvt_data.heading_accuracy; location_module_event->data.location.timestamp = k_uptime_get(); location_module_event->type = LOCATION_MODULE_EVT_GNSS_DATA_READY; @@ -395,10 +398,13 @@ void location_event_handler(const struct location_event_data *event_data) LOG_DBG(" method: %s", location_method_str(event_data->method)); LOG_DBG(" latitude: %.06f", event_data->location.latitude); LOG_DBG(" longitude: %.06f", event_data->location.longitude); - LOG_DBG(" accuracy: %.01f m", event_data->location.accuracy); - LOG_DBG(" altitude: %.01f m", event_data->location.details.gnss.pvt_data.altitude); - LOG_DBG(" speed: %.01f m", event_data->location.details.gnss.pvt_data.speed); - LOG_DBG(" heading: %.01f deg", event_data->location.details.gnss.pvt_data.heading); + LOG_DBG(" accuracy: %.01f m", (double)event_data->location.accuracy); + LOG_DBG(" altitude: %.01f m", + (double)event_data->location.details.gnss.pvt_data.altitude); + LOG_DBG(" speed: %.01f m", + (double)event_data->location.details.gnss.pvt_data.speed); + LOG_DBG(" heading: %.01f deg", + (double)event_data->location.details.gnss.pvt_data.heading); if (event_data->location.datetime.valid) { LOG_DBG(" date: %04d-%02d-%02d", diff --git a/applications/asset_tracker_v2/src/modules/modem_module.c b/applications/asset_tracker_v2/src/modules/modem_module.c index 669159b56ba9..8a8e2736db19 100644 --- a/applications/asset_tracker_v2/src/modules/modem_module.c +++ b/applications/asset_tracker_v2/src/modules/modem_module.c @@ -212,7 +212,7 @@ static void lte_evt_handler(const struct lte_lc_evt *const evt) len = snprintf(log_buf, sizeof(log_buf), "eDRX parameter update: eDRX: %.2f, PTW: %.2f", - evt->edrx_cfg.edrx, evt->edrx_cfg.ptw); + (double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw); if (len > 0) { LOG_DBG("%s", log_buf); } diff --git a/applications/asset_tracker_v2/tests/debug_module/testcase.yaml b/applications/asset_tracker_v2/tests/debug_module/testcase.yaml index ae39a538c666..c60a4dc2d67f 100644 --- a/applications/asset_tracker_v2/tests/debug_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/debug_module/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.debug_module_test.tester: - platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk/nrf9160/ns integration_platforms: - native_sim - qemu_cortex_m3 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: debug_module diff --git a/applications/asset_tracker_v2/tests/json_common/src/json_validate.h b/applications/asset_tracker_v2/tests/json_common/src/json_validate.h index ebc958ea4a4b..e4fc279ed524 100644 --- a/applications/asset_tracker_v2/tests/json_common/src/json_validate.h +++ b/applications/asset_tracker_v2/tests/json_common/src/json_validate.h @@ -16,8 +16,8 @@ "{" \ "\"gnss\":{" \ "\"v\":{" \ - "\"lng\":10," \ "\"lat\":62," \ + "\"lng\":10," \ "\"acc\":24," \ "\"alt\":170," \ "\"spd\":1," \ @@ -179,8 +179,8 @@ "[" \ "{" \ "\"v\":{" \ - "\"lng\":10," \ "\"lat\":62," \ + "\"lng\":10," \ "\"acc\":24," \ "\"alt\":170," \ "\"spd\":1," \ @@ -190,6 +190,20 @@ "}" \ "]" +#define TEST_VALIDATE_ARRAY_GNSS_NO_HEADING_JSON_SCHEMA \ + "[" \ + "{" \ + "\"v\":{" \ + "\"lat\":62," \ + "\"lng\":10," \ + "\"acc\":24," \ + "\"alt\":170," \ + "\"spd\":1" \ + "}," \ + "\"ts\":1563968747123" \ + "}" \ + "]" + #define TEST_VALIDATE_ARRAY_ENVIRONMENTAL_JSON_SCHEMA \ "[" \ "{" \ @@ -302,8 +316,8 @@ "\"gnss\":[" \ "{" \ "\"v\":{" \ - "\"lng\":10," \ "\"lat\":62," \ + "\"lng\":10," \ "\"acc\":24," \ "\"alt\":170," \ "\"spd\":1," \ @@ -313,8 +327,8 @@ "}," \ "{" \ "\"v\":{" \ - "\"lng\":10," \ "\"lat\":62," \ + "\"lng\":10," \ "\"acc\":24," \ "\"alt\":170," \ "\"spd\":1," \ diff --git a/applications/asset_tracker_v2/tests/json_common/src/main.c b/applications/asset_tracker_v2/tests/json_common/src/main.c index 34cff72e96c0..01f156748141 100644 --- a/applications/asset_tracker_v2/tests/json_common/src/main.c +++ b/applications/asset_tracker_v2/tests/json_common/src/main.c @@ -158,12 +158,15 @@ void test_encode_gnss_data_object(void) * encoding. */ struct cloud_data_gnss data = { - .pvt.longi = 10, .pvt.lat = 62, + .pvt.lon = 10, .pvt.acc = 24, .pvt.alt = 170, + .pvt.alt_acc = 10, .pvt.spd = 1, + .pvt.spd_acc = 1, .pvt.hdg = 176, + .pvt.hdg_acc = 5, .queued = true, .gnss_ts = 1000 }; @@ -213,12 +216,15 @@ void test_encode_gnss_data_array(void) * encoding. */ struct cloud_data_gnss data = { - .pvt.longi = 10, .pvt.lat = 62, + .pvt.lon = 10, .pvt.acc = 24, .pvt.alt = 170, + .pvt.alt_acc = 10, .pvt.spd = 1, + .pvt.spd_acc = 1, .pvt.hdg = 176, + .pvt.hdg_acc = 5, .queued = true, .gnss_ts = 1000 }; @@ -235,6 +241,38 @@ void test_encode_gnss_data_array(void) TEST_ASSERT_EQUAL(0, ret); } +void test_encode_gnss_data_array_no_heading(void) +{ + int ret; + /* Avoid using high precision floating point values to ease string comparison post + * encoding. + */ + struct cloud_data_gnss data = { + .pvt.lat = 62, + .pvt.lon = 10, + .pvt.acc = 24, + .pvt.alt = 170, + .pvt.alt_acc = 10, + .pvt.spd = 1, + .pvt.spd_acc = 1, + .pvt.hdg = 176, + .pvt.hdg_acc = 180, /* 180 deg heading accuracy means that heading is unknown */ + .queued = true, + .gnss_ts = 1000 + }; + + ret = json_common_gnss_data_add(dummy.array_obj, + &data, + JSON_COMMON_ADD_DATA_TO_ARRAY, + NULL, + NULL); + TEST_ASSERT_EQUAL(0, ret); + + ret = encoded_output_check(dummy.array_obj, TEST_VALIDATE_ARRAY_GNSS_NO_HEADING_JSON_SCHEMA, + data.queued); + TEST_ASSERT_EQUAL(0, ret); +} + /* Environmental */ void test_encode_environmental_data_object(void) @@ -874,21 +912,27 @@ void test_encode_batch_data_object(void) [1].queued = true }; struct cloud_data_gnss gnss[2] = { - [0].pvt.longi = 10, [0].pvt.lat = 62, + [0].pvt.lon = 10, [0].pvt.acc = 24, [0].pvt.alt = 170, + [0].pvt.alt_acc = 10, [0].pvt.spd = 1, + [0].pvt.spd_acc = 1, [0].pvt.hdg = 176, + [0].pvt.hdg_acc = 5, [0].gnss_ts = 1000, [0].queued = true, /* Second entry */ - [1].pvt.longi = 10, [1].pvt.lat = 62, + [1].pvt.lon = 10, [1].pvt.acc = 24, [1].pvt.alt = 170, + [1].pvt.alt_acc = 10, [1].pvt.spd = 1, + [1].pvt.spd_acc = 1, [1].pvt.hdg = 176, + [1].pvt.hdg_acc = 5, [1].gnss_ts = 1000, [1].queued = true }; @@ -1038,12 +1082,15 @@ void test_floating_point_encoding_gnss(void) cJSON *decoded_value_obj; struct cloud_data_gnss decoded_values = {0}; struct cloud_data_gnss data = { - .pvt.longi = 10.417852141870654, .pvt.lat = 63.43278762669529, + .pvt.lon = 10.417852141870654, .pvt.acc = 15.455987930297852, .pvt.alt = 53.67230987548828, + .pvt.alt_acc = 10.12345298374867, .pvt.spd = 0.4443884789943695, + .pvt.spd_acc = 1.12345298374867, .pvt.hdg = 176.12345298374867, + .pvt.hdg_acc = 5.12345298374867, .gnss_ts = 1000, .queued = true }; @@ -1068,29 +1115,29 @@ void test_floating_point_encoding_gnss(void) decoded_value_obj = json_object_decode(decoded_gnss_obj, DATA_VALUE); TEST_ASSERT_NOT_NULL(decoded_value_obj); - cJSON *longitude = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_LONGITUDE); cJSON *latitude = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_LATITUDE); + cJSON *longitude = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_LONGITUDE); cJSON *accuracy = cJSON_GetObjectItem(decoded_value_obj, DATA_MOVEMENT); cJSON *altitude = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_ALTITUDE); cJSON *speed = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_SPEED); cJSON *heading = cJSON_GetObjectItem(decoded_value_obj, DATA_GNSS_HEADING); - TEST_ASSERT_NOT_NULL(longitude); TEST_ASSERT_NOT_NULL(latitude); + TEST_ASSERT_NOT_NULL(longitude); TEST_ASSERT_NOT_NULL(accuracy); TEST_ASSERT_NOT_NULL(altitude); TEST_ASSERT_NOT_NULL(speed); TEST_ASSERT_NOT_NULL(heading); - decoded_values.pvt.longi = longitude->valuedouble; decoded_values.pvt.lat = latitude->valuedouble; + decoded_values.pvt.lon = longitude->valuedouble; decoded_values.pvt.acc = accuracy->valuedouble; decoded_values.pvt.alt = altitude->valuedouble; decoded_values.pvt.spd = speed->valuedouble; decoded_values.pvt.hdg = heading->valuedouble; - TEST_ASSERT_DOUBLE_WITHIN(0.1, data.pvt.longi, decoded_values.pvt.longi); TEST_ASSERT_DOUBLE_WITHIN(0.1, data.pvt.lat, decoded_values.pvt.lat); + TEST_ASSERT_DOUBLE_WITHIN(0.1, data.pvt.lon, decoded_values.pvt.lon); TEST_ASSERT_FLOAT_WITHIN(0.1, data.pvt.acc, decoded_values.pvt.acc); TEST_ASSERT_FLOAT_WITHIN(0.1, data.pvt.alt, decoded_values.pvt.alt); TEST_ASSERT_FLOAT_WITHIN(0.1, data.pvt.spd, decoded_values.pvt.spd); diff --git a/applications/asset_tracker_v2/tests/json_common/testcase.yaml b/applications/asset_tracker_v2/tests/json_common/testcase.yaml index 16cb05468e59..fe53ded41d28 100644 --- a/applications/asset_tracker_v2/tests/json_common/testcase.yaml +++ b/applications/asset_tracker_v2/tests/json_common/testcase.yaml @@ -1,17 +1,17 @@ tests: applications.asset_tracker_v2.cloud.cloud_codec.json_common.aws: - platform_allow: nrf9160dk_nrf9160 native_sim qemu_cortex_m3 + platform_allow: nrf9160dk/nrf9160 native_sim qemu_cortex_m3 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 - native_sim - qemu_cortex_m3 tags: json_common_test-aws extra_configs: - CONFIG_CLOUD_CODEC_AWS_IOT=y applications.asset_tracker_v2.cloud.cloud_codec.json_common.azure: - platform_allow: nrf9160dk_nrf9160 native_sim qemu_cortex_m3 + platform_allow: nrf9160dk/nrf9160 native_sim qemu_cortex_m3 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 - native_sim - qemu_cortex_m3 tags: json_common_test-azure diff --git a/applications/asset_tracker_v2/tests/location_module/CMakeLists.txt b/applications/asset_tracker_v2/tests/location_module/CMakeLists.txt index a18fd68a2861..ac5ab5cbd55f 100644 --- a/applications/asset_tracker_v2/tests/location_module/CMakeLists.txt +++ b/applications/asset_tracker_v2/tests/location_module/CMakeLists.txt @@ -19,7 +19,6 @@ cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/subsys/app_event_manager/app_event_manager cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/date_time.h) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/location.h) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h - FUNC_EXCLUDE ".*(lte_lc_rai_req|lte_lc_rai_param_set)" WORD_EXCLUDE "__deprecated") cmock_handle(${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_modem/include/nrf_modem_gnss.h) @@ -47,6 +46,7 @@ target_compile_options(app PRIVATE -DCONFIG_CLOUD_CODEC_LWM2M_PATH_ENTRY_SIZE_MAX=1 -DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10 -DCONFIG_LOCATION_SERVICE_EXTERNAL=y + -DCONFIG_LOCATION_METHOD_GNSS=y -DCONFIG_LOCATION_METHOD_CELLULAR=y -DCONFIG_NRF_CLOUD_AGNSS=y -DCONFIG_AT_MONITOR_HEAP_SIZE=1024 diff --git a/applications/asset_tracker_v2/tests/location_module/testcase.yaml b/applications/asset_tracker_v2/tests/location_module/testcase.yaml index 1addf5483608..0941e837aff6 100644 --- a/applications/asset_tracker_v2/tests/location_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/location_module/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.location_module_test.tester: - platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk/nrf9160/ns integration_platforms: - native_sim - qemu_cortex_m3 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: location_module diff --git a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/CMakeLists.txt b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/CMakeLists.txt index f36615f7c1f1..6ec793a11dc1 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/CMakeLists.txt +++ b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/CMakeLists.txt @@ -27,7 +27,6 @@ cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/lwm2m.h lwm2m) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/lwm2m_client_utils.h lwm2m_client_utils) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/lwm2m_client_utils_location.h lwm2m_client_utils) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h lte_lc - FUNC_EXCLUDE ".*(lte_lc_rai_req|lte_lc_rai_param_set)" WORD_EXCLUDE "__deprecated") cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/date_time.h date_time) diff --git a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/src/lwm2m_codec_helpers_test.c b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/src/lwm2m_codec_helpers_test.c index b74b5f5c3ff2..6bd3351719a7 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/src/lwm2m_codec_helpers_test.c +++ b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/src/lwm2m_codec_helpers_test.c @@ -470,12 +470,15 @@ void test_codec_helpers_get_configuration_object(void) void test_codec_helpers_set_gnss_data(void) { struct cloud_data_gnss gnss = { - .pvt.longi = 10, .pvt.lat = 62, + .pvt.lon = 10, .pvt.acc = 24, .pvt.alt = 170, + .pvt.alt_acc = 10, .pvt.spd = 1, + .pvt.spd_acc = 1, .pvt.hdg = 176, + .pvt.hdg_acc = 5, .gnss_ts = 1000, .queued = true, }; @@ -490,7 +493,7 @@ void test_codec_helpers_set_gnss_data(void) &LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LATITUDE_RID), gnss.pvt.lat, 0); __cmock_lwm2m_set_f64_ExpectAndReturn( - &LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LONGITUDE_RID), gnss.pvt.longi, 0); + &LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LONGITUDE_RID), gnss.pvt.lon, 0); __cmock_lwm2m_set_f64_ExpectAndReturn( &LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, ALTITUDE_RID), alt, 0); diff --git a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml index dc71aa93ecd8..c34e6bb759fb 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml +++ b/applications/asset_tracker_v2/tests/lwm2m_codec_helpers/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.lwm2m_codec: - platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk/nrf9160/ns integration_platforms: - native_sim - qemu_cortex_m3 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: lwm2m_codec diff --git a/applications/asset_tracker_v2/tests/lwm2m_integration/CMakeLists.txt b/applications/asset_tracker_v2/tests/lwm2m_integration/CMakeLists.txt index ed6d0c343d5d..857fc71c8f11 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_integration/CMakeLists.txt +++ b/applications/asset_tracker_v2/tests/lwm2m_integration/CMakeLists.txt @@ -24,7 +24,6 @@ cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/lwm2m.h lwm2m) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/lwm2m_client_utils.h lwm2m_client_utils) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/net/lwm2m_client_utils_location.h lwm2m_client_utils) cmock_handle(${ZEPHYR_NRF_MODULE_DIR}/include/modem/lte_lc.h lte_lc - FUNC_EXCLUDE ".*(lte_lc_rai_req|lte_lc_rai_param_set)" WORD_EXCLUDE "__deprecated") # Add Unit Under Test source files diff --git a/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml b/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml index c39991ae5106..074e829c2774 100644 --- a/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml +++ b/applications/asset_tracker_v2/tests/lwm2m_integration/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.lwm2m_integration: - platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk/nrf9160/ns integration_platforms: - native_sim - qemu_cortex_m3 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: lwm2m_integration diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec/src/nrf_cloud_codec_test.c b/applications/asset_tracker_v2/tests/nrf_cloud_codec/src/nrf_cloud_codec_test.c index 17bc249a6eae..cb716a09b901 100644 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec/src/nrf_cloud_codec_test.c +++ b/applications/asset_tracker_v2/tests/nrf_cloud_codec/src/nrf_cloud_codec_test.c @@ -102,12 +102,39 @@ const static struct cloud_data_gnss gnss_data_example = { .queued = true, .gnss_ts = 1563968747123, .pvt = { - .longi = 30, .lat = 40, + .lon = 30, + .acc = 180, .alt = 245, + .alt_acc = 10, + .spd = 5, + .spd_acc = 1, + .hdg = 39, + .hdg_acc = 5 + } +}; + +#define GNSS_BATCH_EXAMPLE_NO_HEADING \ +"[{"\ + "\"appId\":\"GNSS\","\ + "\"messageType\":\"DATA\","\ + "\"ts\":1563968747123,"\ + "\"data\":{\"lng\":30,\"lat\":40,\"acc\":180,\"alt\":245,\"spd\":5}"\ +"}]" + +const static struct cloud_data_gnss gnss_data_example_no_heading = { + .queued = true, + .gnss_ts = 1563968747123, + .pvt = { + .lat = 40, + .lon = 30, .acc = 180, + .alt = 245, + .alt_acc = 10, .spd = 5, - .hdg = 39 + .spd_acc = 1, + .hdg = 39, + .hdg_acc = 180 } }; @@ -521,6 +548,31 @@ void test_enc_batch_data_gnss(void) TEST_ASSERT_FALSE(gnss_buf.queued); } +/* tests batch encoding GNSS data without heading */ +void test_enc_batch_data_gnss_no_heading(void) +{ + struct cloud_data_gnss gnss_buf = gnss_data_example_no_heading; + struct cloud_data_sensors sensor_buf = {0}; + struct cloud_data_modem_static modem_stat_buf = {0}; + struct cloud_data_modem_dynamic modem_dyn_buf = {0}; + struct cloud_data_ui ui_buf = {0}; + struct cloud_data_impact impact_buf = {0}; + struct cloud_data_battery bat_buf = {0}; + + ret = cloud_codec_encode_batch_data(&codec, + &gnss_buf, + &sensor_buf, + &modem_stat_buf, + &modem_dyn_buf, + &ui_buf, + &impact_buf, + &bat_buf, + 1, 1, 1, 1, 1, 1, 1); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, ret); + TEST_ASSERT_EQUAL_STRING(GNSS_BATCH_EXAMPLE_NO_HEADING, codec.buf); + TEST_ASSERT_FALSE(gnss_buf.queued); +} + /* tests batch encoding typical dynamic modem data */ void test_enc_batch_data_modem_dynamic(void) { diff --git a/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml b/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml index 35aca809dee7..d3fe448f804b 100644 --- a/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml +++ b/applications/asset_tracker_v2/tests/nrf_cloud_codec/testcase.yaml @@ -1,8 +1,8 @@ tests: asset_tracker_v2.nrf_cloud_codec_test: - platform_allow: native_sim qemu_cortex_m3 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 nrf9160dk/nrf9160/ns integration_platforms: - native_sim - qemu_cortex_m3 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: nrf_cloud_codec diff --git a/applications/asset_tracker_v2/tests/ui_module/testcase.yaml b/applications/asset_tracker_v2/tests/ui_module/testcase.yaml index ae09e99cf6c3..8565a5e6af3a 100644 --- a/applications/asset_tracker_v2/tests/ui_module/testcase.yaml +++ b/applications/asset_tracker_v2/tests/ui_module/testcase.yaml @@ -1,7 +1,7 @@ tests: asset_tracker_v2.ui_module_test.tester: - platform_allow: native_sim nrf9160dk_nrf9160_ns + platform_allow: native_sim nrf9160dk/nrf9160/ns integration_platforms: - native_sim - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: ui_module diff --git a/applications/connectivity_bridge/CMakeLists.txt b/applications/connectivity_bridge/CMakeLists.txt index 8d8b4ac94843..289083cd70ae 100644 --- a/applications/connectivity_bridge/CMakeLists.txt +++ b/applications/connectivity_bridge/CMakeLists.txt @@ -16,11 +16,13 @@ target_sources(app PRIVATE src/main.c) # Generate a C header file with the readme text as a string variable set(OUTPUT_README_HEADER_FILE "${CMAKE_BINARY_DIR}/generated/readme/readme.h") -set(INPUT_README_FILE ${CMAKE_SOURCE_DIR}/boards/${BOARD}_readme.txt) +set(INPUT_README_FILE ${CMAKE_SOURCE_DIR}/boards/${NORMALIZED_BOARD_TARGET}_readme.txt) + if(NOT EXISTS ${INPUT_README_FILE}) -message(WARNING "${INPUT_README_FILE} does not exist") -set(INPUT_README_FILE ${CMAKE_SOURCE_DIR}/README_TEMPLATE.txt) + message(WARNING "${INPUT_README_FILE} does not exist") + set(INPUT_README_FILE ${CMAKE_SOURCE_DIR}/README_TEMPLATE.txt) endif() + file(READ ${INPUT_README_FILE} README_CONTENT) if(GIT_FOUND) execute_process( diff --git a/applications/connectivity_bridge/boards/thingy91x_nrf5340_cpuapp_readme.txt b/applications/connectivity_bridge/boards/thingy91x_nrf5340_cpuapp_readme.txt index f4d5cd271322..a3fa4e224f03 100644 --- a/applications/connectivity_bridge/boards/thingy91x_nrf5340_cpuapp_readme.txt +++ b/applications/connectivity_bridge/boards/thingy91x_nrf5340_cpuapp_readme.txt @@ -8,9 +8,6 @@ This USB interface has the following functions: COM Ports ==================== -This USB interface exposes two COM ports mapped to the physical UART interfaces between the nRF91 and nRF5340 devices. -When opening these ports manually (without using LTE Link Monitor) be aware that the USB COM port baud rate selection is applied to the UART. - This USB interface exposes two COM ports mapped to the physical UART interfaces between the nRF91 Series and nRF5340 devices. When opening these ports manually (without using the LTE Link Monitor), be aware that the USB COM port baud rate selection is applied to the UART. diff --git a/applications/connectivity_bridge/sample.yaml b/applications/connectivity_bridge/sample.yaml index 20cac2d5f19c..8378141b3bab 100644 --- a/applications/connectivity_bridge/sample.yaml +++ b/applications/connectivity_bridge/sample.yaml @@ -5,8 +5,8 @@ tests: applications.connectivity_bridge: build_only: true platform_allow: - - thingy91_nrf52840 - - thingy91x_nrf5340_cpuapp + - thingy91/nrf52840 + - thingy91x/nrf5340/cpuapp integration_platforms: - - thingy91_nrf52840 + - thingy91/nrf52840 tags: ci_build diff --git a/applications/ipc_radio/README.rst b/applications/ipc_radio/README.rst index 120c1c40f826..039d62a9038a 100644 --- a/applications/ipc_radio/README.rst +++ b/applications/ipc_radio/README.rst @@ -47,7 +47,10 @@ The firmware supports the following development kits: .. table-from-sample-yaml:: -To automatically attach the firmware image, you need to use the :ref:`sysbuild`. +To automatically attach the firmware image, you need to use Zephyr's :ref:`zephyr:sysbuild`. + +The |nRFVSC| supports sysbuild during `build configuration setup `_. +To learn more about sysbuild in the extension, see `sysbuild support`_ page in its documentation. Configuration ************* @@ -89,24 +92,23 @@ The following files are available: * :file:`overlay-bt_hci_ipc.conf` - Configuration file enabling Bluetooth Low Energy over HCI. * :file:`overlay-bt_rpc.conf` - Configuration file enabling Bluetooth Low Energy over RPC. -Building and running -******************** - -.. |application path| replace:: :file:`applications/ipc_radio` +.. note:: + When you use sysbuild to build an application which uses the ipc_radio as network core image the preceding configuration files are added automatically to ipc_radio. + The selection of specific configuration files is determined by the sysbuild kconfig. -.. include:: /includes/application_build_and_run.txt + For instance the :kconfig:option:`SB_CONFIG_NETCORE_IPC_RADIO_IEEE802154` kconfig enables the :file:`overlay-802154.conf` configuration file to be used with ipc_radio. -To enable a specific configuration overlay file, use the following command: +Building and running as a single image +************************************** -.. code-block:: console +.. |application path| replace:: :file:`applications/ipc_radio` - west build |application path| -b board_name -- -DEXTRA_CONF_FILE="overlay-***.conf" +.. include:: /includes/application_build_and_run.txt -You can add multiple configuration files separated by a semicolon. -You cannot use :ref:`ble_rpc` together with the HCI :ref:`bluetooth_controller`. +For instructions on how to enable a specific configuration overlay file, see :ref:`building_advanced`. .. note:: - When using Sysbuild, the configuration files are added automatically. + You cannot use :ref:`ble_rpc` together with the HCI :ref:`bluetooth_controller`. Dependencies ************ diff --git a/applications/ipc_radio/sample.yaml b/applications/ipc_radio/sample.yaml index 3c83abe14b84..9f1187497c92 100644 --- a/applications/ipc_radio/sample.yaml +++ b/applications/ipc_radio/sample.yaml @@ -4,33 +4,33 @@ sample: tests: applications.ipc_radio.hci: build_only: true - platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet + platform_allow: nrf5340dk/nrf5340/cpunet thingy53/nrf5340/cpunet tags: bluetooth ci_build integration_platforms: - - nrf5340dk_nrf5340_cpunet - - thingy53_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + - thingy53/nrf5340/cpunet extra_args: EXTRA_CONF_FILE=overlay-bt_hci_ipc.conf applications.ipc_radio.rpc: build_only: true - platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet + platform_allow: nrf5340dk/nrf5340/cpunet thingy53/nrf5340/cpunet tags: bluetooth ci_build integration_platforms: - - nrf5340dk_nrf5340_cpunet - - thingy53_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + - thingy53/nrf5340/cpunet extra_args: EXTRA_CONF_FILE=overlay-bt_rpc.conf applications.ipc_radio.802154: build_only: true - platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet + platform_allow: nrf5340dk/nrf5340/cpunet thingy53/nrf5340/cpunet tags: ci_build integration_platforms: - - nrf5340dk_nrf5340_cpunet - - thingy53_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + - thingy53/nrf5340/cpunet extra_args: EXTRA_CONF_FILE=overlay-802154.conf applications.ipc_radio.hci802154: build_only: true - platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet + platform_allow: nrf5340dk/nrf5340/cpunet thingy53/nrf5340/cpunet tags: bluetooth ci_build integration_platforms: - - nrf5340dk_nrf5340_cpunet - - thingy53_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + - thingy53/nrf5340/cpunet extra_args: EXTRA_CONF_FILE="overlay-bt_hci_ipc.conf;overlay-802154.conf" diff --git a/applications/machine_learning/CMakeLists.txt b/applications/machine_learning/CMakeLists.txt index 2f2330a03521..4d9155aec968 100644 --- a/applications/machine_learning/CMakeLists.txt +++ b/applications/machine_learning/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) ################################################################################ # The application uses the configuration/ scheme for configuration files. -set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${BOARD}") +set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${NORMALIZED_BOARD_TARGET}") find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project("Machine learning" diff --git a/applications/machine_learning/Kconfig.sysbuild b/applications/machine_learning/Kconfig.sysbuild index f25ac1a0aba5..7ccf43c294f1 100644 --- a/applications/machine_learning/Kconfig.sysbuild +++ b/applications/machine_learning/Kconfig.sysbuild @@ -5,16 +5,16 @@ # choice BOOTLOADER - default BOOTLOADER_MCUBOOT if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" + default BOOTLOADER_MCUBOOT if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS endchoice config NRF_DEFAULT_BLUETOOTH - default y if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" + default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config SECURE_BOOT - default y if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" + default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS config NETCORE_APP_UPDATE - default y if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" + default y if BOARD_NRF5340DK_NRF5340_CPUAPP source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/applications/machine_learning/README.rst b/applications/machine_learning/README.rst index df99a8f8f770..48b7e8412932 100644 --- a/applications/machine_learning/README.rst +++ b/applications/machine_learning/README.rst @@ -98,7 +98,7 @@ In the nRF Machine Learning application, application modules are automatically s The application uses :ref:`caf_power_manager` for this purpose. This means that Zephyr power management is forced to the :c:enumerator:`PM_STATE_ACTIVE` state when the device is in either the Power management active or the Power management suspended state, but the power off state is forced directly by :ref:`caf_power_manager` as Zephyr's :c:enumerator:`PM_STATE_SOFT_OFF` state. -* In the :c:enumerator:`POWER_MANAGER_LEVEL_ALIVE` state, the device is in working condition, Bluetooth is advertising whenever required and all the connections are maintained. +* In the :c:enumerator:`POWER_MANAGER_LEVEL_ALIVE` state, the device is in working condition, Bluetooth® is advertising whenever required and all the connections are maintained. * In the :c:enumerator:`POWER_MANAGER_LEVEL_SUSPENDED` state, the device maintains the active Bluetooth connection. * In the :c:enumerator:`POWER_MANAGER_LEVEL_OFF` state, the CPU is switched to the off mode. @@ -132,7 +132,7 @@ The figure visualizes relations between Application Event Manager, modules, driv Since the application architecture is uniform and the code is shared, the set of modules in use depends on configuration. In other words, not all of the modules need to be enabled for a given reference design. -For example, the :ref:`caf_ble_state` and :ref:`caf_ble_adv` modules are not enabled if the configuration does not use Bluetooth®. +For example, the :ref:`caf_ble_state` and :ref:`caf_ble_adv` modules are not enabled if the configuration does not use Bluetooth. See :ref:`nrf_machine_learning_app_internal_modules` for detailed information about every module used by the nRF Machine Learning application. @@ -285,7 +285,7 @@ For example, the configuration files for the Thingy:53 are defined in the :file: The following configuration files can be defined for any supported board: -* :file:`prj_build_type.conf` - Kconfig configuration file for a build type. +* :file:`prj_.conf` - Kconfig configuration file for a :ref:`custom build type `. To support a given build type for the selected board, you must define the configuration file with a proper name. See :ref:`nrf_machine_learning_app_configuration_build_types` for more information. * :file:`app.overlay` - DTS overlay file specific for the board. @@ -311,8 +311,8 @@ The Thingy:53 and nRF53 Development Kit use multi-image build with the following * Bluetooth HCI RPMsg You can define the application-specific configuration for the mentioned child images in the board-specific directory in the :file:`applications/machine_learning/configuration/` directory. -The Kconfig configuration file should be located in subdirectory :file:`child_image/child_image_name` and its name should match the application Kconfig file name, that is contain the build type if necessary -For example, the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf` file defines configuration of Bluetooth HCI RPMsg for ``debug`` build type on ``thingy53_nrf5340_cpuapp`` board, while the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf` file defines configuration of Bluetooth HCI RPMsg for ``release`` build type. +The Kconfig configuration file should be located in subdirectory :file:`child_image/` and its name should match the application Kconfig file name, and it should contain the build type if necessary. +For example, the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj.conf` file defines configuration of Bluetooth HCI RPMsg for the ``debug`` build type on ``thingy53_nrf5340_cpuapp`` board, while the :file:`applications/machine_learning/configuration/thingy53_nrf5340_cpuapp/child_image/hci_ipc/prj_release.conf` file defines configuration of Bluetooth HCI RPMsg for the ``release`` build type. See :ref:`ug_multi_image` for detailed information about multi-image builds and child image configuration. .. _nrf_machine_learning_app_requirements_build_types: @@ -325,7 +325,7 @@ The nRF Machine Learning application does not use a single :file:`prj.conf` file Before you start testing the application, you can select one of the build types supported by the application. Not every board supports both mentioned build types. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The application supports the following build types: @@ -335,7 +335,7 @@ The application supports the following build types: * - Build type - File name - - Supported board + - Supported build target - Description * - Debug (default) - :file:`prj.conf` @@ -343,15 +343,15 @@ The application supports the following build types: - Debug version of the application; can be used to verify if the application works correctly. * - Release - :file:`prj_release.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Release version of the application; can be used to achieve better performance and reduce memory consumption. * - NUS - :file:`prj_nus.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Debug version of the application that uses :ref:`nus_service_readme` instead of :ref:`zephyr:uart_api` for data forwarding. * - RTT - :file:`prj_rtt.conf` - - ``thingy53_nrf5340_cpuapp`` and ``thingy53_nrf5340_cpuapp_ns`` + - ``thingy53/nrf5340/cpuapp`` and ``thingy53/nrf5340/cpuapp/ns`` - Debug version of the application that uses RTT for printing logs instead of USB CDC. Building and running @@ -368,13 +368,13 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the :ref:`nrf_machine_learning_app_requirements_build_types`. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Providing API key ================= If the URI of the Edge Impulse zip file requires providing an additional API key, you can provide it using the following CMake definition: :c:macro:`EI_API_KEY_HEADER`. -This definition is set in a similar way as selected build type. +This definition is set in a similar way as selecting a build type. For more detailed information about building the machine learning model in the |NCS|, see :ref:`ug_edge_impulse`. .. tip:: @@ -424,16 +424,16 @@ After programming the application, perform the following steps to test the nRF M After the mode is switched, the LED color changes to red and the LED starts blinking very slowly. #. Program the :ref:`central_uart` sample to a compatible development kit, for example the nRF52840 Development Kit. #. Turn on the programmed device. - After a brief delay, the Bluetooth® connection between the sample and the Thingy is established. + After a brief delay, the Bluetooth connection between the sample and the Thingy is established. The Thingy forwards the sensor readouts over NUS. The LED on the Thingy starts to blink rapidly. -#. Connect to the Bluetooth® Central UART sample with a terminal emulator (for example, PuTTY). - See :ref:`putty` for the required settings. +#. Connect to the Bluetooth Central UART sample with a terminal emulator (for example, `nRF Connect Serial Terminal`_). + See :ref:`test_and_optimize` for the required settings. #. Observe the sensor readouts represented as comma-separated values. Every line represents a single sensor readout. The Thingy forwards sensor readouts over NUS to the Central UART sample. The sample forwards the data to the host over UART. -#. Turn off PuTTY to ensure that only one program has access to data on UART. +#. Turn off the terminal emulator to ensure that only one program has access to data on UART. Optionally, you can also connect to the device using `Edge Impulse's data forwarder`_ and forward data to `Edge Impulse studio`_ (after logging in). See `Forwarding data to Edge Impulse studio`_ for details. @@ -456,11 +456,11 @@ After programming the application, perform the following steps to test the nRF M This signal is marked as anomaly by the machine learning model and **LED1** starts breathing. #. Press and hold **Button 1** for more than 5 seconds to switch to the data forwarding mode. After the mode is switched, **LED1** starts to blink rapidly. -#. Connect to the development kit with a terminal emulator (for example, PuTTY). - See :ref:`putty` for the required settings. +#. Connect to the development kit with a terminal emulator (for example, `nRF Connect Serial Terminal`_). + See :ref:`test_and_optimize` for the required settings. #. Observe the sensor readouts represented as comma-separated values. Every line represents a single sensor readout. -#. Turn off PuTTY to ensure that only one program will access data on UART. +#. Turn off the terminal emulator to ensure that only one program will access data on UART. Optionally, you can also connect to the device using `Edge Impulse's data forwarder`_ and forward data to `Edge Impulse studio`_ (after logging in). See `Forwarding data to Edge Impulse studio`_ for details. diff --git a/applications/machine_learning/VERSION b/applications/machine_learning/VERSION index 8cb838926497..808984a04c51 100644 --- a/applications/machine_learning/VERSION +++ b/applications/machine_learning/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/applications/machine_learning/sample.yaml b/applications/machine_learning/sample.yaml index ff10fafb44fd..8fc079244326 100644 --- a/applications/machine_learning/sample.yaml +++ b/applications/machine_learning/sample.yaml @@ -5,35 +5,35 @@ tests: applications.machine_learning.zdebug: build_only: true platform_allow: > - nrf52840dk_nrf52840 thingy53_nrf5340_cpuapp thingy53_nrf5340_cpuapp_ns - nrf5340dk_nrf5340_cpuapp + nrf52840dk/nrf52840 thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp tags: ci_build applications.machine_learning.zdebug_nus: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: ci_build extra_args: CONF_FILE=prj_nus.conf applications.machine_learning.zdebug_rtt: build_only: true - platform_allow: thingy53_nrf5340_cpuapp thingy53_nrf5340_cpuapp_ns + platform_allow: thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns integration_platforms: - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns tags: ci_build extra_args: CONF_FILE=prj_rtt.conf applications.machine_learning.zrelease: build_only: true - platform_allow: nrf52840dk_nrf52840 thingy53_nrf5340_cpuapp thingy53_nrf5340_cpuapp_ns + platform_allow: nrf52840dk/nrf52840 thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns integration_platforms: - - nrf52840dk_nrf52840 - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns tags: ci_build extra_args: CONF_FILE=prj_release.conf diff --git a/applications/machine_learning/src/events/ml_result_event.c b/applications/machine_learning/src/events/ml_result_event.c index 146ee5f0e1eb..ca19b38ac684 100644 --- a/applications/machine_learning/src/events/ml_result_event.c +++ b/applications/machine_learning/src/events/ml_result_event.c @@ -14,7 +14,7 @@ static void log_ml_result_event(const struct app_event_header *aeh) const struct ml_result_event *event = cast_ml_result_event(aeh); APP_EVENT_MANAGER_LOG(aeh, "%s val: %0.2f anomaly: %0.2f", - event->label, event->value, event->anomaly); + event->label, (double)event->value, (double)event->anomaly); } static void profile_ml_result_event(struct log_event_buf *buf, diff --git a/applications/machine_learning/src/modules/led_state.c b/applications/machine_learning/src/modules/led_state.c index 37498f81413a..5a92dc01c9e3 100644 --- a/applications/machine_learning/src/modules/led_state.c +++ b/applications/machine_learning/src/modules/led_state.c @@ -24,8 +24,8 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_ML_APP_LED_STATE_LOG_LEVEL); #define DISPLAY_SIM_SIGNAL IS_ENABLED(CONFIG_ML_APP_SENSOR_SIM_EVENTS) #define DISPLAY_DATA_FORWARDER IS_ENABLED(CONFIG_ML_APP_EI_DATA_FORWARDER_EVENTS) -#define ANOMALY_THRESH (CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH / 1000.0) -#define VALUE_THRESH (CONFIG_ML_APP_LED_STATE_VALUE_THRESH / 1000.0) +#define ANOMALY_THRESH (CONFIG_ML_APP_LED_STATE_ANOMALY_THRESH / 1000.0f) +#define VALUE_THRESH (CONFIG_ML_APP_LED_STATE_VALUE_THRESH / 1000.0f) #define PREDICTION_STREAK_THRESH CONFIG_ML_APP_LED_STATE_PREDICTION_STREAK_THRESH BUILD_ASSERT(PREDICTION_STREAK_THRESH > 0); diff --git a/applications/machine_learning/src/modules/ml_runner.c b/applications/machine_learning/src/modules/ml_runner.c index c35259f88d56..e405408f8813 100644 --- a/applications/machine_learning/src/modules/ml_runner.c +++ b/applications/machine_learning/src/modules/ml_runner.c @@ -67,8 +67,10 @@ static void submit_result(void) int err = ei_wrapper_get_next_classification_result(&evt->label, &evt->value, NULL); - if (!err) { + if (!err && ei_wrapper_classifier_has_anomaly()) { err = ei_wrapper_get_anomaly(&evt->anomaly); + } else { + evt->anomaly = 0.0; } __ASSERT_NO_MSG(!err); diff --git a/applications/matter_bridge/CMakeLists.txt b/applications/matter_bridge/CMakeLists.txt index 039093344e18..c638eb946d4b 100644 --- a/applications/matter_bridge/CMakeLists.txt +++ b/applications/matter_bridge/CMakeLists.txt @@ -10,15 +10,6 @@ cmake_minimum_required(VERSION 3.20.0) set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT CONFIG_FILE_NAME STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-bridge) @@ -48,7 +39,6 @@ target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/bridge/bridge_storage_manager.cpp ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/bridge/bridged_device_data_provider.cpp ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/binding/binding_handler.cpp - ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/persistent_storage/persistent_storage_util.cpp ) if(CONFIG_BRIDGED_DEVICE_BT) diff --git a/applications/matter_bridge/Kconfig b/applications/matter_bridge/Kconfig index eae983839c09..212aecdc7f04 100644 --- a/applications/matter_bridge/Kconfig +++ b/applications/matter_bridge/Kconfig @@ -156,8 +156,12 @@ endif config CHIP_ENABLE_READ_CLIENT default y +config NCS_SAMPLE_MATTER_PERSISTENT_STORAGE + default y + source "${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.features" source "${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.defaults" +source "${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/persistent_storage/Kconfig" source "${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/bridge/Kconfig" source "${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/src/Kconfig" source "Kconfig.zephyr" diff --git a/applications/matter_bridge/Kconfig.sysbuild b/applications/matter_bridge/Kconfig.sysbuild index 9e53f4f992f1..b6cd92e432cc 100644 --- a/applications/matter_bridge/Kconfig.sysbuild +++ b/applications/matter_bridge/Kconfig.sysbuild @@ -5,17 +5,37 @@ # config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) + +if BOARD_NRF5340DK_NRF5340_CPUAPP + +config NRF_WIFI_PATCHES_EXT_FLASH_STORE + default y + +config NRF_WIFI_FW_PATCH_DFU + default y + +config MCUBOOT_UPDATEABLE_IMAGES + default 3 + +config DFU_MULTI_IMAGE_MAX_IMAGE_COUNT + default 3 + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP config MCUBOOT_UPDATEABLE_IMAGES default 2 +endif + choice MCUBOOT_MODE default MCUBOOT_MODE_OVERWRITE_ONLY endchoice diff --git a/applications/matter_bridge/VERSION b/applications/matter_bridge/VERSION index 8cb838926497..808984a04c51 100644 --- a/applications/matter_bridge/VERSION +++ b/applications/matter_bridge/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/applications/matter_bridge/doc/matter_bridge_description.rst b/applications/matter_bridge/doc/matter_bridge_description.rst index e7bcb552a2de..ef7314c504b9 100644 --- a/applications/matter_bridge/doc/matter_bridge_description.rst +++ b/applications/matter_bridge/doc/matter_bridge_description.rst @@ -55,16 +55,16 @@ For information about how to add a new bridged Matter device type to the applica Except for the On/Off Light Switch, all of the listed device types are enabled by default. To disable one of them, set any of the following configuration options: -* :kconfig:option:`CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE` to ``n`` to disable On/Off Light. -* :kconfig:option:`CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE` to ``n`` to disable Generic Switch -* :kconfig:option:`CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE` to ``n`` to disable Temperature Sensor. -* :kconfig:option:`CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE` to ``n`` to disable Humidity Sensor. +* :ref:`CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE ` to ``n`` to disable On/Off Light. +* :ref:`CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE ` to ``n`` to disable Generic Switch +* :ref:`CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE ` to ``n`` to disable Temperature Sensor. +* :ref:`CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE ` to ``n`` to disable Humidity Sensor. Additionally, you can choose to use the On/Off Light Switch implementation instead of the Generic Switch implementation for a switch device. To enable the On/Off Light Switch implementation, set the following configuration options: -* :kconfig:option:`CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE` to ``n`` to disable Generic Switch. -* :kconfig:option:`CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE` to ``y`` to enable On/Off Light Switch. +* :ref:`CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE ` to ``n`` to disable Generic Switch. +* :ref:`CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE ` to ``y`` to enable On/Off Light Switch. The application supports over-the-air (OTA) device firmware upgrade (DFU) using either of the two following protocols: @@ -94,7 +94,7 @@ For example: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y For information about how to upgrade the device firmware using a PC or a smartphone, see the :ref:`matter_bridge_app_dfu` section. @@ -144,7 +144,7 @@ Button 1: * If pressed for less than three seconds: * If the device is not provisioned to the Matter network, it initiates the SMP server (Simple Management Protocol) and Bluetooth LE advertising for Matter commissioning. - After that, the Direct Firmware Update (DFU) over Bluetooth Low Energy can be started. + After that, the Device Firmware Update (DFU) over Bluetooth Low Energy can be started. (See `Updating the device firmware`_.) Bluetooth LE advertising makes the device discoverable over Bluetooth LE for the predefined period of time (15 minutes by default). @@ -160,7 +160,7 @@ Button 1: :end-before: matter_door_lock_sample_led1_end LED 2: - If the :kconfig:option:`CONFIG_BRIDGED_DEVICE_BT` Kconfig option is set to ``y``, shows the current state of Bridge's Bluetooth LE connectivity. + If the :ref:`CONFIG_BRIDGED_DEVICE_BT ` Kconfig option is set to ``y``, shows the current state of Bridge's Bluetooth LE connectivity. The following states are possible: * Turned Off - The Bridge device is in the idle state and has no Bluetooth LE devices paired. @@ -245,7 +245,7 @@ Controlling a simulated On/Off Light bridged device uart:~$ matter_bridge onoff 1 3 - Note that the above command will only work if the :kconfig:option:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL` option is selected in the build configuration. + Note that the above command will only work if the :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL ` option is selected in the build configuration. If the Kconfig option is not selected, the simulated device changes its state periodically in autonomous manner and can not be controlled by using shell commands. Controlling a simulated On/Off Light Switch bridged device @@ -358,6 +358,122 @@ Configuration |config| +Configuration options +===================== + +Check and configure the following configuration options: + +.. _CONFIG_BRIDGED_DEVICE_IMPLEMENTATION: + +CONFIG_BRIDGED_DEVICE_IMPLEMENTATION + Select bridged device implementation. + See the :ref:`matter_bridge_app_bridged_support_configs` section for more information. + Accepts the following values: + + .. _CONFIG_BRIDGED_DEVICE_SIMULATED: + + CONFIG_BRIDGED_DEVICE_SIMULATED + Implement a simulated bridged device. + You must also configure :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_IMPLEMENTATION ` + + .. _CONFIG_BRIDGED_DEVICE_BT: + + CONFIG_BRIDGED_DEVICE_BT + Implement a Bluetooth LE bridged device. + +.. _CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE: + +CONFIG_BRIDGE_HUMIDITY_SENSOR_BRIDGED_DEVICE + Enable support for Humidity Sensor bridged device. + +.. _CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE: + +CONFIG_BRIDGE_ONOFF_LIGHT_BRIDGED_DEVICE + Enable support for OnOff Light bridged device. + +.. _CONFIG_BRIDGE_SWITCH_BRIDGED_DEVICE: + +CONFIG_BRIDGE_SWITCH_BRIDGED_DEVICE + Enable support for a switch bridged device. + Accepts the following values: + + .. _CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE: + + CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE + Enable support for Generic Switch bridged device. + + .. _CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE: + + CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE + Enable support for OnOff Light Switch bridged device. + +.. _CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE: + +CONFIG_BRIDGE_TEMPERATURE_SENSOR_BRIDGED_DEVICE + Enable support for Temperature Sensor bridged device. + +If you selected the simulated device implementation using the :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED ` Kconfig option, also check and configure the following option: + +.. _CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_IMPLEMENTATION: + +CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_IMPLEMENTATION + Select the simulated OnOff device implementation. + Accepts the following values: + + .. _CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC: + + CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC + Automatically simulated OnOff device. + The simulated device automatically changes its state periodically. + + .. _CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL: + + CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL + Shell-controlled simulated OnOff device. + The state of the simulated device is changed using shell commands. + +If you selected the Bluetooth LE device implementation using the :ref:`CONFIG_BRIDGED_DEVICE_BT ` Kconfig option, also check and configure the following options: + +.. _CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES: + +CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES + Set the maximum amount of scanned devices. + +.. _CONFIG_BRIDGE_BT_MINIMUM_SECURITY_LEVEL: + +CONFIG_BRIDGE_BT_MINIMUM_SECURITY_LEVEL + Set the minimum Bluetooth security level of bridged devices that the bridge device will accept. + Bridged devices using this or a higher level will be allowed to connect to the bridge. + See the :ref:`matter_bridge_app_bt_security` section for more information. + +.. _CONFIG_BRIDGE_BT_RECOVERY_MAX_INTERVAL: + +CONFIG_BRIDGE_BT_RECOVERY_MAX_INTERVAL + Set the maximum time (in seconds) between recovery attempts when the Bluetooth LE connection to the bridged device is lost. + +.. _CONFIG_BRIDGE_BT_RECOVERY_SCAN_TIMEOUT_MS: + +CONFIG_BRIDGE_BT_RECOVERY_SCAN_TIMEOUT_MS + Set the time (in milliseconds) within which the Bridge will try to re-establish a connection to the lost Bluetooth LE device. + +.. _CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS: + +CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS + Set the Bluetooth LE scan timeout in milliseconds. + +The following options affect how many bridged devices the application supports. +See the :ref:`matter_bridge_app_bridged_support_configs` section for more information. + +.. _CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER: + +CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER + Set the maximum number of physical non-Matter devices supported by the Bridge. + +.. _CONFIG_BRIDGE_MAX_DYNAMIC_ENDPOINTS_NUMBER: + +CONFIG_BRIDGE_MAX_DYNAMIC_ENDPOINTS_NUMBER + Set the maximum number of dynamic endpoints supported by the Bridge. + .. _matter_bridge_app_bridged_support_configs: Bridged device configuration @@ -365,15 +481,15 @@ Bridged device configuration You can enable the :ref:`matter_bridge_app_bridged_support` by using the following Kconfig options: -* :kconfig:option:`CONFIG_BRIDGED_DEVICE_SIMULATED` - For the simulated bridged device. -* :kconfig:option:`CONFIG_BRIDGED_DEVICE_BT` - For the Bluetooth LE bridged device. +* :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED ` - For the simulated bridged device. +* :ref:`CONFIG_BRIDGED_DEVICE_BT ` - For the Bluetooth LE bridged device. The simulated On/Off Light bridged device can operate in the following modes: * Autonomous - The simulated device periodically changes its state. - To build the simulated On/Off Light data provider in this mode, select the :kconfig:option:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC` Kconfig option. + To build the simulated On/Off Light data provider in this mode, select the :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_AUTOMATIC ` Kconfig option. * Controllable - The user can explicitly control the On/Off state by using shell commands. - To build the simulated On/Off Light data provider in this mode, select the :kconfig:option:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL` Kconfig option. + To build the simulated On/Off Light data provider in this mode, select the :ref:`CONFIG_BRIDGED_DEVICE_SIMULATED_ONOFF_SHELL ` Kconfig option. This is enabled by default. Additionally, you can decide how many bridged devices the bridge application will support. @@ -381,9 +497,9 @@ The decision will make an impact on the flash and RAM memory usage, and is verif The application uses dynamic memory allocation and stores bridged device objects on the heap, so it may be necessary to increase the heap size using the :kconfig:option:`CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE` Kconfig option. Use the following configuration options to customize the number of supported bridged devices: -* :kconfig:option:`CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER` - For changing the maximum number of non-Matter bridged devices supported by the bridge application -* :kconfig:option:`CONFIG_BRIDGE_MAX_DYNAMIC_ENDPOINTS_NUMBER` - For changing the maximum number of Matter endpoints used for bridging devices by the bridge application. - This option does not have to be equal to :kconfig:option:`CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER`, as it is possible to use non-Matter devices that are represented using more than one Matter endpoint. +* :ref:`CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER ` - For changing the maximum number of non-Matter bridged devices supported by the bridge application +* :ref:`CONFIG_BRIDGE_MAX_DYNAMIC_ENDPOINTS_NUMBER ` - For changing the maximum number of Matter endpoints used for bridging devices by the bridge application. + This option does not have to be equal to :ref:`CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER `, as it is possible to use non-Matter devices that are represented using more than one Matter endpoint. Configuring the number of Bluetooth LE bridged devices ------------------------------------------------------ @@ -400,10 +516,12 @@ Build the target using the following command in the project directory to enable .. parsed-literal:: :class: highlight - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_BRIDGED_DEVICE_BT=y -DOVERLAY_CONFIG="overlay-bt_max_connections_app.conf" -Dhci_ipc_OVERLAY_CONFIG="*absoule_path*/overlay-bt_max_connections_net.conf" + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_BRIDGED_DEVICE_BT=y -DEXTRA_CONF_FILE="overlay-bt_max_connections_app.conf" -Dhci_ipc_EXTRA_CONF_FILE="*absoule_path*/overlay-bt_max_connections_net.conf" Replace *absolute_path* with the absolute path to the Matter bridge application on your local disk. +.. _matter_bridge_app_bt_security: + Configuring the Bluetooth LE security ------------------------------------- @@ -429,7 +547,7 @@ You can select the minimum security level required by the application. When selected, the Matter bridge will require setting the selected minimum level from the connected Bluetooth LE bridged device. If the bridged device supports also levels higher than the selected minimum, the devices may negotiate using the highest shared security level. In case the bridged device does not support the minimum required level, the connection will be terminated. -To select the minimum security level, set the :kconfig:option:`CONFIG_BRIDGE_BT_MINIMUM_SECURITY_LEVEL` Kconfig option to ``2``, ``3`` or ``4``. +To select the minimum security level, set the :ref:`CONFIG_BRIDGE_BT_MINIMUM_SECURITY_LEVEL ` Kconfig option to ``2``, ``3`` or ``4``. .. _matter_bridge_app_build_types: @@ -476,7 +594,7 @@ For example: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -p -- -DSHIELD=nrf7002ek -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 + west build -b nrf5340dk/nrf5340/cpuapp -p -- -DSHIELD=nrf7002ek -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 Selecting a build type ====================== diff --git a/applications/matter_bridge/overlay-bt_max_connections_app.conf b/applications/matter_bridge/overlay-bt_max_connections_app.conf index 86e08626cb44..83de533d7cd6 100644 --- a/applications/matter_bridge/overlay-bt_max_connections_app.conf +++ b/applications/matter_bridge/overlay-bt_max_connections_app.conf @@ -10,7 +10,6 @@ CONFIG_BT_MAX_CONN=20 # Set buffer sizes in a consistent way with the ones used by the network core. CONFIG_BT_BUF_ACL_RX_SIZE=84 CONFIG_BT_BUF_ACL_TX_SIZE=84 -CONFIG_BT_CTLR_DATA_LENGTH_MAX=84 # Set MTU size to fit in the single buffer and avoid fragmentation (BUF_SIZE = MTU_SIZE + 4 B of L2CAP header). CONFIG_BT_L2CAP_TX_MTU=80 diff --git a/applications/matter_bridge/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/applications/matter_bridge/pm_static_nrf5340dk_nrf5340_cpuapp.yml similarity index 100% rename from applications/matter_bridge/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to applications/matter_bridge/pm_static_nrf5340dk_nrf5340_cpuapp.yml diff --git a/samples/matter/light_bulb/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/applications/matter_bridge/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/light_bulb/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to applications/matter_bridge/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml diff --git a/applications/matter_bridge/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/applications/matter_bridge/pm_static_nrf7002dk_nrf5340_cpuapp.yml similarity index 100% rename from applications/matter_bridge/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to applications/matter_bridge/pm_static_nrf7002dk_nrf5340_cpuapp.yml diff --git a/samples/matter/light_bulb/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/applications/matter_bridge/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/light_bulb/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to applications/matter_bridge/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml diff --git a/applications/matter_bridge/sample.yaml b/applications/matter_bridge/sample.yaml index 4fb4a14ad210..99f8445c92a9 100644 --- a/applications/matter_bridge/sample.yaml +++ b/applications/matter_bridge/sample.yaml @@ -8,43 +8,51 @@ tests: CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp applications.matter_bridge.debug: build_only: true extra_args: CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp applications.matter_bridge.smp_dfu: build_only: true extra_args: CONFIG_CHIP_DFU_OVER_BT_SMP=y CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp applications.matter_bridge.release.br_ble: build_only: true extra_args: CONF_FILE=prj_release.conf CONFIG_BRIDGED_DEVICE_BT=y CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp applications.matter_bridge.smp_dfu.br_ble: build_only: true extra_args: CONFIG_CHIP_DFU_OVER_BT_SMP=y CONFIG_BRIDGED_DEVICE_BT=y CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp applications.matter_bridge.nrf70ek: build_only: true extra_args: SHIELD=nrf7002ek CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y mcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp + applications.matter_bridge.memory_profiling: + build_only: true + extra_args: CONFIG_BRIDGE_GENERIC_SWITCH_BRIDGED_DEVICE=n + CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE=y + CONFIG_CHIP_MEMORY_PROFILING=y + integration_platforms: + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp diff --git a/applications/matter_bridge/src/app_task.cpp b/applications/matter_bridge/src/app_task.cpp index 9b7067525669..7a3c3f4419de 100644 --- a/applications/matter_bridge/src/app_task.cpp +++ b/applications/matter_bridge/src/app_task.cpp @@ -44,9 +44,9 @@ using namespace ::chip::DeviceLayer; namespace { #ifdef CONFIG_BRIDGED_DEVICE_BT -static bt_uuid *sUuidLbs = BT_UUID_LBS; -static bt_uuid *sUuidEs = BT_UUID_ESS; -static bt_uuid *sUuidServices[] = { sUuidLbs, sUuidEs }; +static const bt_uuid *sUuidLbs = BT_UUID_LBS; +static const bt_uuid *sUuidEs = BT_UUID_ESS; +static const bt_uuid *sUuidServices[] = { sUuidLbs, sUuidEs }; static constexpr uint8_t kUuidServicesNumber = ARRAY_SIZE(sUuidServices); /** * @brief Blink rates for indication the BLE Connectivity Manager state. @@ -106,36 +106,26 @@ CHIP_ERROR AppTask::RestoreBridgedDevices() /* Load all devices based on the read count number. */ for (size_t i = 0; i < indexesCount; i++) { - uint16_t endpointId; - char label[Nrf::MatterBridgedDevice::kNodeLabelSize] = { 0 }; - size_t labelSize; - uint16_t deviceType; - - if (!Nrf::BridgeStorageManager::Instance().LoadBridgedDeviceEndpointId(endpointId, indexes[i])) { - return CHIP_ERROR_NOT_FOUND; - } - - /* Ignore an error, as node label is optional, so it may not be found. */ - Nrf::BridgeStorageManager::Instance().LoadBridgedDeviceNodeLabel(label, sizeof(label), labelSize, - indexes[i]); + Nrf::BridgeStorageManager::BridgedDevice device; +#ifdef CONFIG_BRIDGED_DEVICE_BT + bt_addr_le_t btAddr; + device.mUserData = reinterpret_cast(&btAddr); + device.mUserDataSize = sizeof(btAddr); +#endif - if (!Nrf::BridgeStorageManager::Instance().LoadBridgedDeviceType(deviceType, indexes[i])) { + if (!Nrf::BridgeStorageManager::Instance().LoadBridgedDevice(device, indexes[i])) { return CHIP_ERROR_NOT_FOUND; } - LOG_INF("Loaded bridged device on endpoint id %d from the storage", endpointId); + LOG_INF("Loaded bridged device on endpoint id %d from the storage", device.mEndpointId); #ifdef CONFIG_BRIDGED_DEVICE_BT - bt_addr_le_t addr; - - if (!Nrf::BridgeStorageManager::Instance().LoadBtAddress(addr, indexes[i])) { - return CHIP_ERROR_NOT_FOUND; - } - - BleBridgedDeviceFactory::CreateDevice(deviceType, addr, label, indexes[i], endpointId); + BleBridgedDeviceFactory::CreateDevice(device.mDeviceType, btAddr, device.mNodeLabel, indexes[i], + device.mEndpointId); #else - SimulatedBridgedDeviceFactory::CreateDevice(deviceType, label, chip::Optional(indexes[i]), - chip::Optional(endpointId)); + SimulatedBridgedDeviceFactory::CreateDevice(device.mDeviceType, device.mNodeLabel, + chip::Optional(indexes[i]), + chip::Optional(device.mEndpointId)); #endif } return CHIP_NO_ERROR; diff --git a/applications/matter_bridge/src/ble_providers/ble_bridged_device_factory.cpp b/applications/matter_bridge/src/ble_providers/ble_bridged_device_factory.cpp index a00b5cdab6db..4a142b98a03a 100644 --- a/applications/matter_bridge/src/ble_providers/ble_bridged_device_factory.cpp +++ b/applications/matter_bridge/src/ble_providers/ble_bridged_device_factory.cpp @@ -72,27 +72,30 @@ CHIP_ERROR BleServiceToMatterDeviceType(BleBridgedDeviceFactory::ServiceUuid ser CHIP_ERROR StoreDevice(MatterBridgedDevice *device, BridgedDeviceDataProvider *provider, uint8_t index) { - uint16_t endpointId; uint8_t count = 0; uint8_t indexes[BridgeManager::kMaxBridgedDevices] = { 0 }; bool deviceRefresh = false; + BridgeStorageManager::BridgedDevice bridgedDevice; /* Check if a device is already present in the storage. */ - if (BridgeStorageManager::Instance().LoadBridgedDeviceEndpointId(endpointId, index)) { + if (BridgeStorageManager::Instance().LoadBridgedDevice(bridgedDevice, index)) { deviceRefresh = true; } - if (!BridgeStorageManager::Instance().StoreBridgedDevice(device, index)) { - LOG_ERR("Failed to store bridged device"); - return CHIP_ERROR_INTERNAL; - } - BLEBridgedDeviceProvider *bleProvider = static_cast(provider); - bt_addr_le_t addr = bleProvider->GetBtAddress(); - if (!BridgeStorageManager::Instance().StoreBtAddress(addr, index)) { - LOG_ERR("Failed to store bridged device's Bluetooth address"); + bridgedDevice.mEndpointId = device->GetEndpointId(); + bridgedDevice.mDeviceType = device->GetDeviceType(); + bridgedDevice.mNodeLabelLength = strlen(device->GetNodeLabel()); + memcpy(bridgedDevice.mNodeLabel, device->GetNodeLabel(), strlen(device->GetNodeLabel())); + + /* Fill BT address information as a part of implementation specific user data. */ + bridgedDevice.mUserDataSize = sizeof(addr); + bridgedDevice.mUserData = reinterpret_cast(&addr); + + if (!BridgeStorageManager::Instance().StoreBridgedDevice(bridgedDevice, index)) { + LOG_ERR("Failed to store bridged device"); return CHIP_ERROR_INTERNAL; } @@ -445,21 +448,8 @@ CHIP_ERROR BleBridgedDeviceFactory::RemoveDevice(int endpointId) return CHIP_ERROR_INTERNAL; } - if (!BridgeStorageManager::Instance().RemoveBridgedDeviceEndpointId(index)) { - LOG_ERR("Failed to remove bridged device endpoint id."); - return CHIP_ERROR_INTERNAL; - } - - /* Ignore error, as node label may not be present in the storage. */ - BridgeStorageManager::Instance().RemoveBridgedDeviceNodeLabel(index); - - if (!BridgeStorageManager::Instance().RemoveBridgedDeviceType(index)) { - LOG_ERR("Failed to remove bridged device type."); - return CHIP_ERROR_INTERNAL; - } - - if (!BridgeStorageManager::Instance().RemoveBtAddress(index)) { - LOG_ERR("Failed to remove bridged device Bluetooth address."); + if (!BridgeStorageManager::Instance().RemoveBridgedDevice(index)) { + LOG_ERR("Failed to remove bridged device from the storage."); return CHIP_ERROR_INTERNAL; } diff --git a/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.cpp b/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.cpp index 157bc6d74c3e..e089362badd8 100644 --- a/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.cpp +++ b/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.cpp @@ -18,10 +18,10 @@ using namespace ::chip; using namespace ::chip::app; using namespace Nrf; -static bt_uuid *sServiceUuid = BT_UUID_ESS; -static bt_uuid *sUuidTemperature = BT_UUID_TEMPERATURE; -static bt_uuid *sUuidHumidity = BT_UUID_HUMIDITY; -static bt_uuid *sUuidCcc = BT_UUID_GATT_CCC; +static const bt_uuid *sServiceUuid = BT_UUID_ESS; +static const bt_uuid *sUuidTemperature = BT_UUID_TEMPERATURE; +static const bt_uuid *sUuidHumidity = BT_UUID_HUMIDITY; +static const bt_uuid *sUuidCcc = BT_UUID_GATT_CCC; bt_gatt_read_params BleEnvironmentalDataProvider::sHumidityReadParams{}; @@ -31,7 +31,7 @@ BleEnvironmentalDataProvider *GetProvider(bt_conn *conn) BLEConnectivityManager::Instance().FindBLEProvider(*bt_conn_get_dst(conn))); } -bt_uuid *BleEnvironmentalDataProvider::GetServiceUuid() +const bt_uuid *BleEnvironmentalDataProvider::GetServiceUuid() { return sServiceUuid; } diff --git a/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.h b/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.h index 7775223caa91..edc4d28655ae 100644 --- a/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.h +++ b/applications/matter_bridge/src/ble_providers/ble_environmental_data_provider.h @@ -19,7 +19,7 @@ class BleEnvironmentalDataProvider : public Nrf::BLEBridgedDeviceProvider { void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override; CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) override; - bt_uuid *GetServiceUuid() override; + const bt_uuid *GetServiceUuid() override; int ParseDiscoveredData(bt_gatt_dm *discoveredData) override; private: diff --git a/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.cpp b/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.cpp index 81904acc65ab..38954ecbf96c 100644 --- a/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.cpp +++ b/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.cpp @@ -22,10 +22,10 @@ using namespace ::chip; using namespace ::chip::app; using namespace Nrf; -static bt_uuid *sServiceUuid = BT_UUID_LBS; -static bt_uuid *sUuidLED = BT_UUID_LBS_LED; -static bt_uuid *sUuidButton = BT_UUID_LBS_BUTTON; -static bt_uuid *sUuidCcc = BT_UUID_GATT_CCC; +static const bt_uuid *sServiceUuid = BT_UUID_LBS; +static const bt_uuid *sUuidLED = BT_UUID_LBS_LED; +static const bt_uuid *sUuidButton = BT_UUID_LBS_BUTTON; +static const bt_uuid *sUuidCcc = BT_UUID_GATT_CCC; #ifdef CONFIG_BRIDGE_ONOFF_LIGHT_SWITCH_BRIDGED_DEVICE void ProcessCommand(const EmberBindingTableEntry &aBinding, OperationalDeviceProxy *aDevice, Nrf::Matter::BindingHandler::BindingData &aData) @@ -171,13 +171,13 @@ CHIP_ERROR BleLBSDataProvider::UpdateState(chip::ClusterId clusterId, chip::Attr return CHIP_NO_ERROR; } default: - return CHIP_ERROR_INVALID_ARGUMENT; + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } return CHIP_NO_ERROR; } -bt_uuid *BleLBSDataProvider::GetServiceUuid() +const bt_uuid *BleLBSDataProvider::GetServiceUuid() { return sServiceUuid; } diff --git a/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.h b/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.h index cc787ea32dc8..8ba37b929850 100644 --- a/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.h +++ b/applications/matter_bridge/src/ble_providers/ble_lbs_data_provider.h @@ -33,7 +33,7 @@ class BleLBSDataProvider : public Nrf::BLEBridgedDeviceProvider { static uint8_t GattNotifyCallback(bt_conn *conn, bt_gatt_subscribe_params *params, const void *data, uint16_t length); - bt_uuid *GetServiceUuid() override; + const bt_uuid *GetServiceUuid() override; int ParseDiscoveredData(bt_gatt_dm *discoveredData) override; private: diff --git a/applications/matter_bridge/src/bridge_shell.cpp b/applications/matter_bridge/src/bridge_shell.cpp index e95632114f54..f3009210e630 100644 --- a/applications/matter_bridge/src/bridge_shell.cpp +++ b/applications/matter_bridge/src/bridge_shell.cpp @@ -24,14 +24,22 @@ static void BluetoothConnectionSecurityRequest(void *context) const struct shell *shell = reinterpret_cast(context); - shell_fprintf(shell, SHELL_INFO, "----------------------------------------------------------------------------------------\n"); - shell_fprintf(shell, SHELL_INFO, "| Bridged Bluetooth LE device authentication |\n"); - shell_fprintf(shell, SHELL_INFO, "| |\n"); - shell_fprintf(shell, SHELL_INFO, "| Insert pin code displayed by the Bluetooth LE peripheral device |\n"); - shell_fprintf(shell, SHELL_INFO, "| to authenticate the pairing operation. |\n"); - shell_fprintf(shell, SHELL_INFO, "| |\n"); - shell_fprintf(shell, SHELL_INFO, "| To do that, use matter_bridge pincode shell command. |\n"); - shell_fprintf(shell, SHELL_INFO, "----------------------------------------------------------------------------------------\n"); + shell_fprintf(shell, SHELL_INFO, + "----------------------------------------------------------------------------------------\n"); + shell_fprintf(shell, SHELL_INFO, + "| Bridged Bluetooth LE device authentication |\n"); + shell_fprintf(shell, SHELL_INFO, + "| |\n"); + shell_fprintf(shell, SHELL_INFO, + "| Insert pin code displayed by the Bluetooth LE peripheral device |\n"); + shell_fprintf(shell, SHELL_INFO, + "| to authenticate the pairing operation. |\n"); + shell_fprintf(shell, SHELL_INFO, + "| |\n"); + shell_fprintf(shell, SHELL_INFO, + "| To do that, use matter_bridge pincode shell command. |\n"); + shell_fprintf(shell, SHELL_INFO, + "----------------------------------------------------------------------------------------\n"); } #endif /* CONFIG_BRIDGED_DEVICE_BT && CONFIG_BT_SMP */ @@ -178,7 +186,7 @@ static int SimulatedBridgedDeviceOnOffLightSwitchWriteHandler(const struct shell #endif #ifdef CONFIG_BRIDGED_DEVICE_BT -static void BluetoothScanResult(Nrf::BLEConnectivityManager::ScanResult & result, void *context) +static void BluetoothScanResult(Nrf::BLEConnectivityManager::ScanResult &result, void *context) { if (!result.mDevices || !context) { return; @@ -192,9 +200,11 @@ static void BluetoothScanResult(Nrf::BLEConnectivityManager::ScanResult & result shell_fprintf(shell, SHELL_INFO, "---------------------------------------------------------------------\n"); for (int i = 0; i < result.mCount; i++) { shell_fprintf(shell, SHELL_INFO, "| %d | %02x:%02x:%02x:%02x:%02x:%02x | 0x%04x (%s)\n", i, - result.mDevices[i].mAddr.a.val[5], result.mDevices[i].mAddr.a.val[4], result.mDevices[i].mAddr.a.val[3], - result.mDevices[i].mAddr.a.val[2], result.mDevices[i].mAddr.a.val[1], result.mDevices[i].mAddr.a.val[0], - result.mDevices[i].mUuid, BleBridgedDeviceFactory::GetUuidString(result.mDevices[i].mUuid)); + result.mDevices[i].mAddr.a.val[5], result.mDevices[i].mAddr.a.val[4], + result.mDevices[i].mAddr.a.val[3], result.mDevices[i].mAddr.a.val[2], + result.mDevices[i].mAddr.a.val[1], result.mDevices[i].mAddr.a.val[0], + result.mDevices[i].mUuid, + BleBridgedDeviceFactory::GetUuidString(result.mDevices[i].mUuid)); } } @@ -219,7 +229,7 @@ static int InsertBridgedDevicePincodeHandler(const struct shell *shell, size_t a static int ScanBridgedDeviceHandler(const struct shell *shell, size_t argc, char **argv) { - shell_fprintf(shell, SHELL_INFO, "Scanning for 10 s ...\n"); + shell_fprintf(shell, SHELL_INFO, "Scanning for %d s ...\n", CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS / 1000); Nrf::BLEConnectivityManager::Instance().Scan(BluetoothScanResult, const_cast(shell)); @@ -278,7 +288,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( SHELL_CMD_ARG(pincode, NULL, "Insert pincode for Bluetooth LE device pairing. \n" "Usage: pincode \n" - "* ble_device_index - the Bluetooth LE device's index on the list returned by the scan command\n" + "* ble_device_index - the Bluetooth LE device's index on the list returned by the scan command\n" "* pincode - is a pin required for Bluetooth LE pairing authentication\n", InsertBridgedDevicePincodeHandler, 3, 0), #endif /* CONFIG_BT_SMP */ diff --git a/applications/matter_bridge/src/bridged_device_types/humidity_sensor.h b/applications/matter_bridge/src/bridged_device_types/humidity_sensor.h index a9dfbc44e799..52ce5813e42f 100644 --- a/applications/matter_bridge/src/bridged_device_types/humidity_sensor.h +++ b/applications/matter_bridge/src/bridged_device_types/humidity_sensor.h @@ -10,21 +10,13 @@ class HumiditySensorDevice : public Nrf::MatterBridgedDevice { public: - static constexpr uint16_t kRelativeHumidityMeasurementClusterRevision = 3; - static constexpr uint32_t kRelativeHumidityMeasurementFeatureMap = 0; - HumiditySensorDevice(const char *nodeLabel); uint16_t GetMeasuredValue() { return mMeasuredValue; } uint16_t GetMinMeasuredValue() { return mMinMeasuredValue; } uint16_t GetMaxMeasuredValue() { return mMaxMeasuredValue; } - uint16_t GetRelativeHumidityMeasurementClusterRevision() { return kRelativeHumidityMeasurementClusterRevision; } - uint32_t GetRelativeHumidityMeasurementFeatureMap() { return kRelativeHumidityMeasurementFeatureMap; } - uint16_t GetDeviceType() const override - { - return Nrf::MatterBridgedDevice::DeviceType::HumiditySensor; - } + uint16_t GetDeviceType() const override { return Nrf::MatterBridgedDevice::DeviceType::HumiditySensor; } CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override; CHIP_ERROR HandleReadRelativeHumidityMeasurement(chip::AttributeId attributeId, uint8_t *buffer, @@ -36,6 +28,9 @@ class HumiditySensorDevice : public Nrf::MatterBridgedDevice { CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override; + static constexpr uint16_t GetRelativeHumidityMeasurementClusterRevision() { return 3; } + static constexpr uint32_t GetRelativeHumidityMeasurementFeatureMap() { return 0; } + private: void SetMeasuredValue(int16_t value) { mMeasuredValue = value; } void SetMinMeasuredValue(int16_t value) { mMinMeasuredValue = value; } diff --git a/applications/matter_bridge/src/bridged_device_types/onoff_light.cpp b/applications/matter_bridge/src/bridged_device_types/onoff_light.cpp index 0a10c5c7a973..87b0255f97e6 100644 --- a/applications/matter_bridge/src/bridged_device_types/onoff_light.cpp +++ b/applications/matter_bridge/src/bridged_device_types/onoff_light.cpp @@ -33,9 +33,9 @@ DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(onOffAttrs) DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::OnOff::Id, BOOLEAN, 1, 0), DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::FeatureMap::Id, BITMAP32, 4, 0), DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::GlobalSceneControl::Id, BOOLEAN, 1, 0), - DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::OnTime::Id, INT16U, 2, 0), - DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::OffWaitTime::Id, INT16U, 2, 0), - DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::StartUpOnOff::Id, ENUM8, 1, 0), + DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::OnTime::Id, INT16U, 2, ZAP_ATTRIBUTE_MASK(WRITABLE)), + DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::OffWaitTime::Id, INT16U, 2, ZAP_ATTRIBUTE_MASK(WRITABLE)), + DECLARE_DYNAMIC_ATTRIBUTE(Clusters::OnOff::Attributes::StartUpOnOff::Id, ENUM8, 1, ZAP_ATTRIBUTE_MASK(WRITABLE)), DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); constexpr CommandId onOffIncomingCommands[] = { @@ -130,6 +130,18 @@ CHIP_ERROR OnOffLightDevice::HandleReadOnOff(AttributeId attributeId, uint8_t *b uint32_t featureMap = GetOnOffFeatureMap(); return CopyAttribute(&featureMap, sizeof(featureMap), buffer, maxReadLength); } + case Clusters::OnOff::Attributes::OnTime::Id: { + return CopyAttribute(&mOnTime, sizeof(mOnTime), buffer, maxReadLength); + } + case Clusters::OnOff::Attributes::OffWaitTime::Id: { + return CopyAttribute(&mOffWaitTime, sizeof(mOffWaitTime), buffer, maxReadLength); + } + case Clusters::OnOff::Attributes::StartUpOnOff::Id: { + return CopyAttribute(&mStartUpOnOff, sizeof(mStartUpOnOff), buffer, maxReadLength); + } + case Clusters::OnOff::Attributes::GlobalSceneControl::Id: { + return CopyAttribute(&mGlobalSceneControl, sizeof(mGlobalSceneControl), buffer, maxReadLength); + } default: return CHIP_ERROR_INVALID_ARGUMENT; } @@ -162,13 +174,22 @@ CHIP_ERROR OnOffLightDevice::HandleWrite(ClusterId clusterId, AttributeId attrib } switch (attributeId) { - case Clusters::OnOff::Attributes::OnOff::Id: { - SetOnOff(*buffer); - return CHIP_NO_ERROR; - } + case Clusters::OnOff::Attributes::OnOff::Id: + mOnOff = *buffer; + break; + case Clusters::OnOff::Attributes::OnTime::Id: + mOnTime = *buffer; + break; + case Clusters::OnOff::Attributes::OffWaitTime::Id: + mOffWaitTime = *buffer; + break; + case Clusters::OnOff::Attributes::StartUpOnOff::Id: + mStartUpOnOff = static_cast(*buffer); + break; default: return CHIP_ERROR_INVALID_ARGUMENT; } + return CHIP_NO_ERROR; } CHIP_ERROR OnOffLightDevice::HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, @@ -194,8 +215,7 @@ CHIP_ERROR OnOffLightDevice::HandleAttributeChange(chip::ClusterId clusterId, ch if (err != CHIP_NO_ERROR) { return err; } - - SetOnOff(value); + mOnOff = value; break; } default: diff --git a/applications/matter_bridge/src/bridged_device_types/onoff_light.h b/applications/matter_bridge/src/bridged_device_types/onoff_light.h index e8003c37a7e6..4226a009f85f 100644 --- a/applications/matter_bridge/src/bridged_device_types/onoff_light.h +++ b/applications/matter_bridge/src/bridged_device_types/onoff_light.h @@ -10,27 +10,12 @@ class OnOffLightDevice : public Nrf::MatterBridgedDevice { public: - static constexpr uint32_t kIdentifyFeatureMap = 0; - static constexpr uint16_t kOnOffClusterRevision = 5; - static constexpr uint32_t kOnOffFeatureMap = 1; - static constexpr uint16_t kGroupsClusterRevision = 4; - static constexpr uint32_t kGroupsFeatureMap = 1; - static constexpr uint8_t kGroupsNameSupportMap = 0; - OnOffLightDevice(const char *nodeLabel); bool GetOnOff() { return mOnOff; } void Toggle() { mOnOff = !mOnOff; } - uint16_t GetOnOffClusterRevision() { return kOnOffClusterRevision; } - uint32_t GetOnOffFeatureMap() { return kOnOffFeatureMap; } - uint16_t GetGroupsClusterRevision() { return kGroupsClusterRevision; } - uint32_t GetGroupsFeatureMap() { return kGroupsFeatureMap; } - uint8_t GetGroupsNameSupportMap() { return kGroupsNameSupportMap; } - uint16_t GetDeviceType() const override - { - return Nrf::MatterBridgedDevice::DeviceType::OnOffLight; - } + uint16_t GetDeviceType() const override { return Nrf::MatterBridgedDevice::DeviceType::OnOffLight; } CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override; CHIP_ERROR HandleReadOnOff(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength); @@ -39,8 +24,18 @@ class OnOffLightDevice : public Nrf::MatterBridgedDevice { CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override; -private: - void SetOnOff(bool onOff) { mOnOff = onOff; } + static constexpr uint16_t GetOnOffClusterRevision() { return 5; } + static constexpr uint32_t GetOnOffFeatureMap() { return 1; } + static constexpr uint16_t GetGroupsClusterRevision() { return 4; } + static constexpr uint32_t GetGroupsFeatureMap() { return 1; } + static constexpr uint8_t GetGroupsNameSupportMap() { return 0; } - bool mOnOff = false; +private: + bool mOnOff{ false }; + bool mGlobalSceneControl{ false }; + int16_t mOnTime{ 0 }; + int16_t mOffWaitTime{ 0 }; + chip::app::Clusters::OnOff::StartUpOnOffEnum mStartUpOnOff{ + chip::app::Clusters::OnOff::StartUpOnOffEnum::kUnknownEnumValue + }; }; diff --git a/applications/matter_bridge/src/bridged_device_types/onoff_light_switch.h b/applications/matter_bridge/src/bridged_device_types/onoff_light_switch.h index 99d12bf91efd..7382fd13ce66 100644 --- a/applications/matter_bridge/src/bridged_device_types/onoff_light_switch.h +++ b/applications/matter_bridge/src/bridged_device_types/onoff_light_switch.h @@ -10,22 +10,9 @@ class OnOffLightSwitchDevice : public Nrf::MatterBridgedDevice { public: - static constexpr uint16_t kOnOffClusterRevision = 4; - static constexpr uint32_t kOnOffFeatureMap = 1; - static constexpr uint16_t kBindingClusterRevision = 1; - static constexpr uint32_t kBindingFeatureMap = 0; - OnOffLightSwitchDevice(const char *nodeLabel); - uint16_t GetOnOffClusterRevision() { return kOnOffClusterRevision; } - uint32_t GetOnOffFeatureMap() { return kOnOffFeatureMap; } - uint16_t GetBindingClusterRevision() { return kBindingClusterRevision; } - uint32_t GetBindingFeatureMap() { return kBindingFeatureMap; } - - uint16_t GetDeviceType() const override - { - return Nrf::MatterBridgedDevice::DeviceType::OnOffLightSwitch; - } + uint16_t GetDeviceType() const override { return Nrf::MatterBridgedDevice::DeviceType::OnOffLightSwitch; } CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override; CHIP_ERROR HandleReadOnOff(chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength); @@ -40,5 +27,8 @@ class OnOffLightSwitchDevice : public Nrf::MatterBridgedDevice { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -private: + static constexpr uint16_t GetOnOffClusterRevision() { return 4; } + static constexpr uint32_t GetOnOffFeatureMap() { return 1; } + static constexpr uint16_t GetBindingClusterRevision() { return 1; } + static constexpr uint32_t GetBindingFeatureMap() { return 0; } }; diff --git a/applications/matter_bridge/src/bridged_device_types/temperature_sensor.h b/applications/matter_bridge/src/bridged_device_types/temperature_sensor.h index b14b19851f33..7f07a7a27282 100644 --- a/applications/matter_bridge/src/bridged_device_types/temperature_sensor.h +++ b/applications/matter_bridge/src/bridged_device_types/temperature_sensor.h @@ -10,21 +10,13 @@ class TemperatureSensorDevice : public Nrf::MatterBridgedDevice { public: - static constexpr uint16_t kTemperatureMeasurementClusterRevision = 4; - static constexpr uint32_t kTemperatureMeasurementFeatureMap = 0; - TemperatureSensorDevice(const char *nodeLabel); int16_t GetMeasuredValue() { return mMeasuredValue; } int16_t GetMinMeasuredValue() { return mMinMeasuredValue; } int16_t GetMaxMeasuredValue() { return mMaxMeasuredValue; } - uint16_t GetTemperatureMeasurementClusterRevision() { return kTemperatureMeasurementClusterRevision; } - uint32_t GetTemperatureMeasurementFeatureMap() { return kTemperatureMeasurementFeatureMap; } - uint16_t GetDeviceType() const override - { - return Nrf::MatterBridgedDevice::DeviceType::TemperatureSensor; - } + uint16_t GetDeviceType() const override { return Nrf::MatterBridgedDevice::DeviceType::TemperatureSensor; } CHIP_ERROR HandleRead(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer, uint16_t maxReadLength) override; CHIP_ERROR HandleReadTemperatureMeasurement(chip::AttributeId attributeId, uint8_t *buffer, @@ -36,6 +28,9 @@ class TemperatureSensorDevice : public Nrf::MatterBridgedDevice { CHIP_ERROR HandleAttributeChange(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) override; + static constexpr uint16_t GetTemperatureMeasurementClusterRevision() { return 4; } + static constexpr uint32_t GetTemperatureMeasurementFeatureMap() { return 0; } + private: void SetMeasuredValue(int16_t value) { mMeasuredValue = value; } void SetMinMeasuredValue(int16_t value) { mMinMeasuredValue = value; } diff --git a/applications/matter_bridge/src/chip_project_config.h b/applications/matter_bridge/src/chip_project_config.h index 7d2af176ad67..f6c66f0e8e49 100644 --- a/applications/matter_bridge/src/chip_project_config.h +++ b/applications/matter_bridge/src/chip_project_config.h @@ -21,6 +21,5 @@ #define CHIP_CONFIG_LOG_MODULE_DataManagement_PROGRESS 0 #define CHIP_CONFIG_LOG_MODULE_FabricProvisioning_PROGRESS 0 #define CHIP_CONFIG_LOG_MODULE_SecureChannel_PROGRESS 0 -#define CHIP_CONFIG_LOG_MODULE_AppServer_PROGRESS 0 #define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT CONFIG_BRIDGE_MAX_DYNAMIC_ENDPOINTS_NUMBER diff --git a/applications/matter_bridge/src/simulated_providers/simulated_bridged_device_factory.cpp b/applications/matter_bridge/src/simulated_providers/simulated_bridged_device_factory.cpp index df2a06e8433c..051912fe1263 100644 --- a/applications/matter_bridge/src/simulated_providers/simulated_bridged_device_factory.cpp +++ b/applications/matter_bridge/src/simulated_providers/simulated_bridged_device_factory.cpp @@ -16,17 +16,22 @@ namespace { CHIP_ERROR StoreDevice(Nrf::MatterBridgedDevice *device, Nrf::BridgedDeviceDataProvider *provider, uint8_t index) { - uint16_t endpointId; uint8_t count = 0; uint8_t indexes[Nrf::BridgeManager::kMaxBridgedDevices] = { 0 }; bool deviceRefresh = false; + Nrf::BridgeStorageManager::BridgedDevice bridgedDevice; /* Check if a device is already present in the storage. */ - if (Nrf::BridgeStorageManager::Instance().LoadBridgedDeviceEndpointId(endpointId, index)) { + if (Nrf::BridgeStorageManager::Instance().LoadBridgedDevice(bridgedDevice, index)) { deviceRefresh = true; } - if (!Nrf::BridgeStorageManager::Instance().StoreBridgedDevice(device, index)) { + bridgedDevice.mEndpointId = device->GetEndpointId(); + bridgedDevice.mDeviceType = device->GetDeviceType(); + bridgedDevice.mNodeLabelLength = strlen(device->GetNodeLabel()); + memcpy(bridgedDevice.mNodeLabel, device->GetNodeLabel(), strlen(device->GetNodeLabel())); + + if (!Nrf::BridgeStorageManager::Instance().StoreBridgedDevice(bridgedDevice, index)) { LOG_ERR("Failed to store bridged device"); return CHIP_ERROR_INTERNAL; } @@ -231,16 +236,8 @@ CHIP_ERROR SimulatedBridgedDeviceFactory::RemoveDevice(int endpointId) return CHIP_ERROR_INTERNAL; } - if (!Nrf::BridgeStorageManager::Instance().RemoveBridgedDeviceEndpointId(index)) { - LOG_ERR("Failed to remove bridged device endpoint id."); - return CHIP_ERROR_INTERNAL; - } - - /* Ignore error, as node label may not be present in the storage. */ - Nrf::BridgeStorageManager::Instance().RemoveBridgedDeviceNodeLabel(index); - - if (!Nrf::BridgeStorageManager::Instance().RemoveBridgedDeviceType(index)) { - LOG_ERR("Failed to remove bridged device type."); + if (!Nrf::BridgeStorageManager::Instance().RemoveBridgedDevice(index)) { + LOG_ERR("Failed to remove bridged device from the storage."); return CHIP_ERROR_INTERNAL; } diff --git a/applications/matter_bridge/src/simulated_providers/simulated_generic_switch_data_provider.cpp b/applications/matter_bridge/src/simulated_providers/simulated_generic_switch_data_provider.cpp index 0e75efc52510..76f62142d0ef 100644 --- a/applications/matter_bridge/src/simulated_providers/simulated_generic_switch_data_provider.cpp +++ b/applications/matter_bridge/src/simulated_providers/simulated_generic_switch_data_provider.cpp @@ -47,7 +47,7 @@ CHIP_ERROR SimulatedGenericSwitchDataProvider::UpdateState(chip::ClusterId clust return CHIP_NO_ERROR; } default: - return CHIP_ERROR_INVALID_ARGUMENT; + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } return CHIP_NO_ERROR; diff --git a/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_data_provider.cpp b/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_data_provider.cpp index 7db26f148059..4bd25daa0de7 100644 --- a/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_data_provider.cpp +++ b/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_data_provider.cpp @@ -49,7 +49,7 @@ CHIP_ERROR SimulatedOnOffLightDataProvider::UpdateState(chip::ClusterId clusterI return CHIP_NO_ERROR; } default: - return CHIP_ERROR_INVALID_ARGUMENT; + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } return CHIP_NO_ERROR; diff --git a/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_switch_data_provider.cpp b/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_switch_data_provider.cpp index 08d5debc4837..1777629a1950 100644 --- a/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_switch_data_provider.cpp +++ b/applications/matter_bridge/src/simulated_providers/simulated_onoff_light_switch_data_provider.cpp @@ -61,10 +61,14 @@ void ProcessCommand(const EmberBindingTableEntry &aBinding, OperationalDevicePro CHIP_ERROR SimulatedOnOffLightSwitchDataProvider::UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) { - if (clusterId != Clusters::OnOff::Id || attributeId != Clusters::OnOff::Attributes::OnOff::Id) { + if (clusterId != Clusters::OnOff::Id) { return CHIP_ERROR_INVALID_ARGUMENT; } + if (attributeId != Clusters::OnOff::Attributes::OnOff::Id) { + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } + bool mOnOff; memcpy(&mOnOff, buffer, sizeof(mOnOff)); diff --git a/applications/matter_bridge/sysbuild.cmake b/applications/matter_bridge/sysbuild.cmake deleted file mode 100644 index 96fcb6969bc4..000000000000 --- a/applications/matter_bridge/sysbuild.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Set the paritions configuration -set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/applications/matter_bridge/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) diff --git a/applications/matter_weather_station/CMakeLists.txt b/applications/matter_weather_station/CMakeLists.txt index 4c78fd220ccb..791b77e907a9 100644 --- a/applications/matter_weather_station/CMakeLists.txt +++ b/applications/matter_weather_station/CMakeLists.txt @@ -9,10 +9,6 @@ cmake_minimum_required(VERSION 3.20.0) set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -if("${OVERLAY_CONFIG}" STREQUAL "overlay-factory_data.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_factory_data.yml) -endif() - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(matter-weather-station) diff --git a/applications/matter_weather_station/Kconfig.sysbuild b/applications/matter_weather_station/Kconfig.sysbuild index 33ac7693c392..c759cd1901fc 100644 --- a/applications/matter_weather_station/Kconfig.sysbuild +++ b/applications/matter_weather_station/Kconfig.sysbuild @@ -5,13 +5,13 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "thingy53_nrf5340_cpuapp") + default y if BOARD_THINGY53_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && ($(BOARD) = "thingy53_nrf5340_cpuapp") +if BOOTLOADER_MCUBOOT && BOARD_THINGY53_NRF5340_CPUAPP config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/applications/matter_weather_station/README.rst b/applications/matter_weather_station/README.rst index a7cb0de654cb..0056b869047d 100644 --- a/applications/matter_weather_station/README.rst +++ b/applications/matter_weather_station/README.rst @@ -130,7 +130,7 @@ The Matter weather station application does not use a single :file:`prj.conf` fi Configuration files are provided for different build types, and they are located in the :file:`configuration/thingy53_nrf5340_cpuapp` directory. Before you start testing the application, you can select one of the build types supported by the application. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The application supports the following build types: @@ -166,6 +166,14 @@ The application comes with the following overlays: See `Generating factory data`_ to learn how to put factory data into device's storage. To learn more about factory data, read the :doc:`matter:nrfconnect_factory_data_configuration` page in the Matter documentation. + This overlay requires providing of the :file:`pm_static_factory_data.yml` Partition Manager static configuration file. + + To build the example with the factory data support, run the following command: + + .. code-block:: console + + west build -b thingy53_nrf5340_cpuapp -- -DEXTRA_CONF_FILE=overlay-factory_data.conf -DPM_STATIC_YML_FILE=pm_static_factory_data.yml + .. note:: Matter factory data support requires the dedicated partition layout. This means that if you build the application using the ``overlay-factory_data`` configuration overlay, it will not be compatible with other :ref:`Thingy:53 applications and samples `. @@ -181,7 +189,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the :ref:`matter_weather_station_app_build_types`. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Building for the nRF7002 Wi-Fi expansion board ============================================== @@ -215,7 +223,7 @@ You can generate new factory data set when building for the target board by invo .. parsed-literal:: :class: highlight - west build -b thingy53_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-factory_data.conf + west build -b thingy53_nrf5340_cpuapp -- -DEXTRA_CONF_FILE=overlay-factory_data.conf This command builds the application with default certificates. After building the target, the generated :file:`factory_data.hex` file will be merged with the application target HEX file, so you can use the :ref:`regular command to flash it to the device `. @@ -311,7 +319,7 @@ The onboarding information representation depends on your commissioner setup. For this application, the data payload, which includes the device discriminator and setup PIN code, is encoded and shared using an NFC tag. When using the debug configuration, you can also get this type of information from the USB interface logs. -Alternatively, depending on your build type and selected configuration overlay, you can also use one of the following :ref:`onboarding information formats ` to provide the commissioner with the data required: +Alternatively, depending on your build type and selected overlay, you can also use one of the following :ref:`onboarding information formats ` to provide the commissioner with the data required: * For the debug and release build types: diff --git a/applications/matter_weather_station/VERSION b/applications/matter_weather_station/VERSION index 8cb838926497..808984a04c51 100644 --- a/applications/matter_weather_station/VERSION +++ b/applications/matter_weather_station/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/pm_static_factory_data.yml b/applications/matter_weather_station/pm_static_factory_data.yml similarity index 100% rename from applications/matter_weather_station/configuration/thingy53_nrf5340_cpuapp/pm_static_factory_data.yml rename to applications/matter_weather_station/pm_static_factory_data.yml diff --git a/applications/matter_weather_station/sample.yaml b/applications/matter_weather_station/sample.yaml index ab3a043793e4..9e154a2e9b4b 100644 --- a/applications/matter_weather_station/sample.yaml +++ b/applications/matter_weather_station/sample.yaml @@ -6,28 +6,30 @@ tests: # applications on Thingy53. applications.matter_weather_station.debug.no_fd: build_only: true - platform_allow: thingy53_nrf5340_cpuapp - platform_exclude: thingy53_nrf5340_cpuapp_ns + platform_allow: thingy53/nrf5340/cpuapp + platform_exclude: thingy53/nrf5340/cpuapp/ns integration_platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp applications.matter_weather_station.debug: build_only: true extra_args: OVERLAY_CONFIG=overlay-factory_data.conf - platform_allow: thingy53_nrf5340_cpuapp - platform_exclude: thingy53_nrf5340_cpuapp_ns + PM_STATIC_YML_FILE=${CMAKE_CURRENT_SOURCE_DIR}/pm_static_factory_data.yml + platform_allow: thingy53/nrf5340/cpuapp + platform_exclude: thingy53/nrf5340/cpuapp/ns integration_platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp applications.matter_weather_station.release: build_only: true extra_args: OVERLAY_CONFIG=overlay-factory_data.conf CONF_FILE=prj_release.conf - platform_allow: thingy53_nrf5340_cpuapp - platform_exclude: thingy53_nrf5340_cpuapp_ns + PM_STATIC_YML_FILE=${CMAKE_CURRENT_SOURCE_DIR}/pm_static_factory_data.yml + platform_allow: thingy53/nrf5340/cpuapp + platform_exclude: thingy53/nrf5340/cpuapp/ns integration_platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp applications.matter_weather_station.nrf7002eb: build_only: true extra_args: SHIELD=nrf7002eb CONF_FILE=prj_release.conf - platform_allow: thingy53_nrf5340_cpuapp - platform_exclude: thingy53_nrf5340_cpuapp_ns + platform_allow: thingy53/nrf5340/cpuapp + platform_exclude: thingy53/nrf5340/cpuapp/ns integration_platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp diff --git a/applications/matter_weather_station/sysbuild.cmake b/applications/matter_weather_station/sysbuild.cmake deleted file mode 100644 index 8970053e5900..000000000000 --- a/applications/matter_weather_station/sysbuild.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if("${OVERLAY_CONFIG}" STREQUAL "overlay-factory_data.conf") - set(PM_STATIC_YML_FILE ${APPLICATION_CONFIG_DIR}/pm_static_factory_data.yml PARENT_SCOPE) -endif() diff --git a/applications/nrf5340_audio/CMakeLists.txt b/applications/nrf5340_audio/CMakeLists.txt index bdefa4a0923f..929b1f3bf1ce 100644 --- a/applications/nrf5340_audio/CMakeLists.txt +++ b/applications/nrf5340_audio/CMakeLists.txt @@ -27,24 +27,6 @@ if(CONFIG_AUDIO_DFU EQUAL 2) set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/dfu/conf/pm_dfu_external_flash.yml) endif() -if (CONFIG_BT_LL_ACS_NRF53) - if ((CONFIG_AUDIO_DFU EQUAL 1) OR (CONFIG_AUDIO_DFU EQUAL 2)) - list(APPEND empty_net_core_OVERLAY_CONFIG - "${CMAKE_CURRENT_LIST_DIR}/dfu/conf/overlay-empty_net_core.conf" - ) - - # Disable pretick anomaly workaround. The workaround causes a resource conflict between B0N and - # the controller, and as the controller does not use RTC to wake up from sleep it is not - # affected by the anomaly. - list(APPEND empty_net_core_b0n_CONFIG_SOC_NRF53_RTC_PRETICK n) - - if (CONFIG_B0N_MINIMAL) - set(min_b0n_flag "-m") - list(APPEND empty_net_core_b0n_OVERLAY_CONFIG overlay-minimal-size.conf) - endif() - endif() -endif() - # Flag which defines whether application is compiled as gateway/dongle or headset add_compile_definitions(HEADSET=1) add_compile_definitions(GATEWAY=2) @@ -112,24 +94,3 @@ if (CONFIG_HW_CODEC_CIRRUS_LOGIC) message(FATAL_ERROR "Cirrus Logic/sdk-mcu-drivers repository not found\n") endif() endif() - -if (CONFIG_BT_LL_ACS_NRF53) - if ((CONFIG_AUDIO_DFU EQUAL 1) OR (CONFIG_AUDIO_DFU EQUAL 2)) - set(BLE5_CTR_SIGN_STEP ${APPLICATION_BINARY_DIR}/dummy) - file(TO_CMAKE_PATH ${ZEPHYR_NRF_MODULE_DIR}/lib/bin/bt_ll_acs_nrf53/bin CMAKE_STYLE_LL_ACS_NRF53_BIN) - - add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/tools/buildprog/ble5-ctr-rpmsg_sign.py - -I ${CMAKE_STYLE_LL_ACS_NRF53_BIN} -b ${APPLICATION_BINARY_DIR} ${min_b0n_flag} - OUTPUT ${BLE5_CTR_SIGN_STEP} - DEPENDS merged_domains_hex - COMMENT "Running post-build ble5-ctr signing step..." - ) - - add_custom_target( - post_bin ALL - DEPENDS - ${BLE5_CTR_SIGN_STEP} - ) - endif() -endif() diff --git a/applications/nrf5340_audio/Kconfig.defaults b/applications/nrf5340_audio/Kconfig.defaults index 59b8005189f0..ca2babba8161 100644 --- a/applications/nrf5340_audio/Kconfig.defaults +++ b/applications/nrf5340_audio/Kconfig.defaults @@ -22,7 +22,7 @@ config THREAD_NAME default y config NCS_INCLUDE_RPMSG_CHILD_IMAGE - default !BT_LL_ACS_NRF53 + default y # Workaround to not use fatal_error.c in NCS. Note that the system may still # reset on error depending on the build configuraion diff --git a/applications/nrf5340_audio/broadcast_sink/main.c b/applications/nrf5340_audio/broadcast_sink/main.c index aa011a3337cd..d757295dd587 100644 --- a/applications/nrf5340_audio/broadcast_sink/main.c +++ b/applications/nrf5340_audio/broadcast_sink/main.c @@ -17,7 +17,7 @@ #include "macros_common.h" #include "audio_system.h" #include "bt_mgmt.h" -#include "bt_rend.h" +#include "bt_rendering_and_capture.h" #include "audio_datapath.h" #include "le_audio_rx.h" @@ -105,7 +105,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_UP: - ret = bt_rend_volume_up(); + ret = bt_r_and_c_volume_up(); if (ret) { LOG_WRN("Failed to increase volume: %d", ret); } @@ -113,7 +113,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_DOWN: - ret = bt_rend_volume_down(); + ret = bt_r_and_c_volume_down(); if (ret) { LOG_WRN("Failed to decrease volume: %d", ret); } @@ -130,7 +130,7 @@ static void button_msg_sub_thread(void) case BUTTON_5: if (IS_ENABLED(CONFIG_AUDIO_MUTE)) { - ret = bt_rend_volume_mute(false); + ret = bt_r_and_c_volume_mute(false); if (ret) { LOG_WRN("Failed to mute, ret: %d", ret); } @@ -351,7 +351,7 @@ static void bt_mgmt_evt_handler(const struct zbus_channel *chan) switch (msg->event) { case BT_MGMT_PA_SYNCED: - LOG_INF("PA synced"); + LOG_DBG("PA synced"); ret = broadcast_sink_pa_sync_set(msg->pa_sync, msg->broadcast_id); if (ret) { diff --git a/applications/nrf5340_audio/broadcast_source/Kconfig.defaults b/applications/nrf5340_audio/broadcast_source/Kconfig.defaults index 50e982e54186..0861c049295e 100644 --- a/applications/nrf5340_audio/broadcast_source/Kconfig.defaults +++ b/applications/nrf5340_audio/broadcast_source/Kconfig.defaults @@ -8,6 +8,9 @@ config BT_CAP_INITIATOR default y +config BT_MAX_CONN + default 1 + # Broadcasting Device - 0x0885 config BT_DEVICE_APPEARANCE default 2181 diff --git a/applications/nrf5340_audio/child_image/hci_ipc.conf b/applications/nrf5340_audio/child_image/hci_ipc.conf index 3d3a6c0522be..ff93820e55ae 100644 --- a/applications/nrf5340_audio/child_image/hci_ipc.conf +++ b/applications/nrf5340_audio/child_image/hci_ipc.conf @@ -30,7 +30,7 @@ CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=251 CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START=y CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START_CHANNEL=4 -# -# If using FEM the CONFIG_BT_CTLR_TX_PWR_ANTENNA should be set here if the -# value required is not 10 dBm -# +# Needed for builds with nrf21540 +# Can also be set to 20, but check local restrictions first +#CONFIG_BT_CTLR_TX_PWR_ANTENNA=10 +#CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=10 diff --git a/applications/nrf5340_audio/dfu/conf/Kconfig.dfu b/applications/nrf5340_audio/dfu/conf/Kconfig.dfu index 416ba6ce9a2a..2b11beb417da 100644 --- a/applications/nrf5340_audio/dfu/conf/Kconfig.dfu +++ b/applications/nrf5340_audio/dfu/conf/Kconfig.dfu @@ -21,11 +21,6 @@ config B0N_MINIMAL if AUDIO_DFU = 1 || AUDIO_DFU = 2 -# Empty net core image is needed when DFU is enabled -config NCS_SAMPLE_EMPTY_NET_CORE_CHILD_IMAGE - bool "Dummy Net core application" - default y if BT_LL_ACS_NRF53 - config AUDIO_DFU_ENABLE bool default y diff --git a/applications/nrf5340_audio/doc/adapting_application.rst b/applications/nrf5340_audio/doc/adapting_application.rst index 8317f32ca741..a812ee7a245c 100644 --- a/applications/nrf5340_audio/doc/adapting_application.rst +++ b/applications/nrf5340_audio/doc/adapting_application.rst @@ -20,7 +20,7 @@ The nRF5340 Audio applications use the following files as board configuration so See :ref:`kconfig_tips_and_tricks` for information about how to configure them. * Memory layout configuration files - These define the memory layout of the application. -You can see the :file:`zephyr/boards/arm/nrf5340_audio_dk_nrf5340` directory as an example of how these files are structured. +You can see the :file:`zephyr/boards/nordic/nrf5340_audio_dk` directory as an example of how these files are structured. For information about differences between DTS and Kconfig, see :ref:`zephyr:dt_vs_kconfig`. For detailed instructions for adding Zephyr support to a custom board, see Zephyr's :ref:`zephyr:board_porting_guide`. @@ -54,8 +54,8 @@ To use the nRF5340 Audio application with your custom board: 1. Define the board files for your custom board: - a. Create a new directory in the :file:`nrf/boards/arm/` directory with the name of the new board. - #. Copy the nRF5340 Audio board files from the :file:`nrf5340_audio_dk_nrf5340` directory located in the :file:`zephyr/boards/arm/` folder to the newly created directory. + a. Create a new directory in the :file:`nrf/boards//` directory with the name of the new board. + #. Copy the nRF5340 Audio board files from the :file:`nrf5340_audio_dk` directory located in the :file:`zephyr/boards/nordic/` folder to the newly created directory. #. Edit the DTS files to make sure they match the hardware configuration. Pay attention to the following elements: diff --git a/applications/nrf5340_audio/doc/building.rst b/applications/nrf5340_audio/doc/building.rst index 605e71483591..af19fb650d34 100644 --- a/applications/nrf5340_audio/doc/building.rst +++ b/applications/nrf5340_audio/doc/building.rst @@ -209,14 +209,14 @@ Complete the following steps to build the application: #. Choose the application version by using one of the following options: * For the debug version: No build flag needed. - * For the release version: ``-DCONF_FILE="prj_release.conf"`` + * For the release version: ``-DFILE_SUFFIX=release`` #. Build the application using the standard :ref:`build steps ` for the command line. For example, if you want to build the firmware for the application core as a headset using the ``release`` application version, you can run the following command from the :file:`applications/nrf5340_audio/` directory: .. code-block:: console - west build -b nrf5340_audio_dk_nrf5340_cpuapp --pristine -- -DCONFIG_AUDIO_DEV=1 -DCONF_FILE="prj_release.conf" + west build -b nrf5340_audio_dk/nrf5340/cpuapp --pristine -- -DCONFIG_AUDIO_DEV=1 -DFILE_SUFFIX=release Unlike when :ref:`nrf53_audio_app_building_script`, this command creates the build files directly in the :file:`build` directory. This means that you first need to program the headset development kits before you build and program gateway development kits. diff --git a/applications/nrf5340_audio/doc/configuration.rst b/applications/nrf5340_audio/doc/configuration.rst index f8b22d4ec895..6041fe81c8be 100644 --- a/applications/nrf5340_audio/doc/configuration.rst +++ b/applications/nrf5340_audio/doc/configuration.rst @@ -76,12 +76,8 @@ You can use one of the following options, depending on how you decide to build t .. code-block:: console - west build -b nrf5340_audio_dk_nrf5340_cpuapp --pristine -- -DCONFIG_AUDIO_DEV=1 -DSHIELD=nrf21540ek_fwd -DCONF_FILE=prj_release.conf + west build -b nrf5340_audio_dk/nrf5340/cpuapp --pristine -- -DCONFIG_AUDIO_DEV=1 -DSHIELD=nrf21540ek_fwd -DFILE_SUFFIX=release To set the TX power output, use the ``CONFIG_NRF_21540_MAIN_TX_POWER`` and ``CONFIG_NRF_21540_PRI_ADV_TX_POWER`` Kconfig options. -.. note:: - When you build the nRF5340 Audio application with the nRF21540 FEM support, the :ref:`lib_bt_ll_acs_nrf53_readme` does not support the +20 dBm setting. - This is because of a power class restriction in the controller's QDID. - See :ref:`ug_radio_fem` for more information about FEM in the |NCS|. diff --git a/applications/nrf5340_audio/doc/feature_support.rst b/applications/nrf5340_audio/doc/feature_support.rst index 5a46ade2bce7..45d22ad8b830 100644 --- a/applications/nrf5340_audio/doc/feature_support.rst +++ b/applications/nrf5340_audio/doc/feature_support.rst @@ -27,7 +27,3 @@ The following QDIDs are related to the nRF5340 Audio application: :docset: nrfxlib :start-after: lc3_qdid_start :end-before: lc3_qdid_end - -.. include:: /libraries/bin/bt_ll_acs_nrf53/index.rst - :start-after: le_audio_controller_qdid_start - :end-before: le_audio_controller_qdid_end diff --git a/applications/nrf5340_audio/doc/firmware_architecture.rst b/applications/nrf5340_audio/doc/firmware_architecture.rst index 3c1f03b3626f..dd237a2f0644 100644 --- a/applications/nrf5340_audio/doc/firmware_architecture.rst +++ b/applications/nrf5340_audio/doc/firmware_architecture.rst @@ -258,7 +258,7 @@ The received audio data in the I2S-based firmware devices follows the following #. The data is sent from the FIFO buffer to the :file:`audio_datapath.c` synchronization module. The :file:`audio_datapath.c` module performs the audio synchronization based on the SDU reference timestamps. Each package sent from the gateway gets a unique SDU reference timestamp. - These timestamps are generated on the headset controllers (in the network core). + These timestamps are generated on the headset Bluetooth LE controller (in the network core). This enables the creation of True Wireless Stereo (TWS) earbuds where the audio is synchronized in the CIS mode. It does also keep the speed of the inter-IC sound (I2S) interface synchronized with the sending and receiving speed of Bluetooth packets. #. The :file:`audio_datapath.c` module sends the compressed audio data to the LC3 audio decoder for decoding. diff --git a/applications/nrf5340_audio/doc/fota.rst b/applications/nrf5340_audio/doc/fota.rst index 7167a03916f8..fb42294581ce 100644 --- a/applications/nrf5340_audio/doc/fota.rst +++ b/applications/nrf5340_audio/doc/fota.rst @@ -7,14 +7,12 @@ Configuring and testing FOTA upgrades for nRF5340 Audio applications :local: :depth: 2 -All nRF5340 Audio applications share the same configuration and testing procedures for FOTA upgrades. +The nRF5340 Audio applications all support FOTA upgrades, and the application implementation is based on the procedure described in :ref:`ug_nrf53_developing_ble_fota`. Requirements for FOTA ********************* -To test Firmware Over-The-Air (FOTA), you need an Android or iOS device with the `nRF Connect Device Manager`_ app installed. - -To enable the external flash DFU and do FOTA upgrades for the application core and the network core at the same time, you need an external flash shield. +If the application is running on the nRF5340 Audio DK, you need an external flash shield to upgrade both the application and network core at the same time. See `Requirements for external flash memory DFU`_ in the nRF5340 Audio DK Hardware documentation for more information. .. _nrf53_audio_app_configuration_configure_fota: @@ -22,56 +20,37 @@ See `Requirements for external flash memory DFU`_ in the nRF5340 Audio DK Hardwa Configuring FOTA upgrades ************************* -.. caution:: - Firmware based on the |NCS| versions earlier than v2.1.0 does not support DFU. - FOTA is not available for those versions. - - You can test performing separate application and network core upgrades, but for production, both cores must be updated at the same time. - When updates take place in the inter-core communication module (HCI IPC), communication between the cores will break if they are not updated together. - -You can configure Firmware Over-The-Air (FOTA) upgrades to replace the applications on both the application core and the network core. -The nRF5340 Audio applications support the following types of DFU flash memory layouts: - -* Internal flash memory layout - which supports only single-image DFU. -* External flash memory layout - which supports :ref:`multi-image DFU `. - -The LE Audio Controller Subsystem for nRF53 supports both the normal and minimal sizes of the bootloader. -The minimal size is specified using the :kconfig:option:`CONFIG_NETBOOT_MIN_PARTITION_SIZE`. +The nRF5340 Audio application supports two strategies for upgrading the applications on the application and network core: single-image and multi-image. +You control which of the two strategies is used by setting the Kconfig :kconfig:option:`CONFIG_AUDIO_DFU` to the appropriate setting. -Enabling FOTA upgrades -********************** +* Single-image upgrade - Uses the internal flash to upgrade either the application core or network core separately. + You can select this method by setting :kconfig:option:`CONFIG_AUDIO_DFU` to ``1``. +* Multi-image upgrade - Uses external flash to upgrade both the application and network core at the same time. + You can select this method by setting :kconfig:option:`CONFIG_AUDIO_DFU` to ``2``. + See :ref:`multi-image DFU ` for more information about the process. -The FOTA upgrades are only available when :ref:`nrf53_audio_app_building_script`. -With the appropriate parameters provided, the :file:`buildprog.py` Python script will add overlay files for the given DFU type. -To enable the desired FOTA functions: - -* To define flash memory layout, include the ``-m internal`` parameter for the internal layout (when using the ``release`` application version) or the ``-m external`` parameter for the external layout (when using either ``release`` or ``debug``). -* To use the minimal size network core bootloader, add the ``-M`` parameter. - -For the full list of parameters and examples, see the :ref:`nrf53_audio_app_building_script_running` section. - -FOTA build files -================ - -The generated FOTA build files use the following naming patterns: +.. caution:: + Using the single-image upgrade strategy carries risk of the device being in a state where the application core firmware and network core firmware are no longer compatible, which can result in a bricked device. + For devices where FOTA is the only DFU method available, multi-image upgrades are recommended to ensure compatibility between the cores. + Make sure to evaluate the risks for your device when selecting the FOTA method. -* For multi-image DFU, the file is called ``dfu_application.zip``. - This file updates two cores with one single file. -* For single-image DFU, the bin file for the application core is called ``app_update.bin``. - The bin file for the network core is called ``net_core_app_update.bin``. - In this scenario, the cores are updated one by one with two separate files in two actions. +Updating the SoftDevice +======================= -See :ref:`app_build_output_files` for more information about the image files. +Both FOTA upgrade methods support updating the SoftDevice on the network core. +However, the current default build options for the SoftDevice create a binary that is too large to run on the network core together with a bootloader. +To reduce the size of the SoftDevice binary, you can disable unused features in the SoftDevice. +See :ref:`softdevice_controller` documentation for more information. Entering the DFU mode ===================== The |NCS| uses :ref:`SMP server and mcumgr ` as the DFU backend. -Unlike the CIS and BIS modes for gateway and headsets, the DFU mode is advertising using the SMP server service. -For this reason, to enter the DFU mode, you must long press **BTN 4** during each device startup to have the nRF5340 Audio DK enter the DFU mode. +The SMP server service is separated from CIS and BIS services, and is only advertised when the application is in the DFU mode. +To enter the DFU mode, press **BTN 4** on the nRF5340 Audio DK during startup. To identify the devices before the DFU takes place, the DFU mode advertising names mention the device type directly. -The names follow the pattern in which the device *ROLE* is inserted before the ``_DFU`` suffix. +The names follow the pattern in which the device role is inserted between the device name and the ``_DFU`` suffix. For example: * Gateway: ``NRF5340_AUDIO_GW_DFU`` @@ -88,44 +67,6 @@ The first part of these names is based on :kconfig:option:`CONFIG_BT_DEVICE_NAME .. _nrf53_audio_unicast_client_app_testing_steps_fota: Testing FOTA upgrades -********************* - -`nRF Connect Device Manager`_ can be used for testing FOTA upgrades. -The procedure for upgrading the firmware is identical for all applications. - -Testing FOTA upgrades on a headset device -========================================= - -You can test upgrading the firmware on both cores at the same time on a headset device by completing the following steps: - -1. Make sure you have :ref:`configured the application for FOTA `. -#. Install `nRF Connect Device Manager`_ on your Android or iOS device. -#. Connect an external flash shield to the headset. -#. Make sure the headset runs a firmware that supports DFU using external flash memory. - One way of doing this is to connect the headset to the USB port, turn it on, and then run this command: - - .. code-block:: console - - python buildprog.py -c both -b debug -d headset --pristine -m external -p - - .. note:: - When using the FOTA related functionality in the :file:`buildprog.py` script on Linux, the ``python`` command must execute Python 3. - -#. Use the :file:`buildprog.py` script to create a zip file that contains new firmware for both cores: - - .. code-block:: console - - python buildprog.py -c both -b debug -d headset --pristine -m external +===================== -#. Transfer the generated file to your Android or iOS device, depending on the DFU scenario. - See the `FOTA build files`_ section for information about FOTA file name patterns. - For transfer, you can use cloud services like Google Drive for Android or iCloud for iOS. -#. Enter the DFU mode by pressing and holding down **RESET** and **BTN 4** at the same time, and then releasing **RESET** while continuing to hold down **BTN 4** for a couple more seconds. -#. Open `nRF Connect Device Manager`_ and look for ``NRF5340_AUDIO_HL_DFU`` in the scanned devices window. - The headset is left by default. -#. Tap on :guilabel:`NRF5340_AUDIO_HL_DFU` and then on the downward arrow icon at the bottom of the screen. -#. In the :guilabel:`Firmware Upgrade` section, tap :guilabel:`SELECT FILE`. -#. Select the file you transferred to the device. -#. Tap :guilabel:`START` and check :guilabel:`Confirm only` in the notification. -#. Tap :guilabel:`START` again to start the DFU process. -#. When the DFU has finished, verify that the new application core and network core firmware works properly. +To test FOTA for the nRF5340 Audio application, ensure the application is in the DFU mode, and then follow the testing steps in the FOTA over Bluetooth Low Energy section of :ref:`ug_nrf53_developing_ble_fota` (you can skip the configuration steps). diff --git a/applications/nrf5340_audio/index.rst b/applications/nrf5340_audio/index.rst index 36fac0c00d4b..a1221002fe88 100644 --- a/applications/nrf5340_audio/index.rst +++ b/applications/nrf5340_audio/index.rst @@ -13,26 +13,26 @@ The following table summarizes the differences between the available nRF5340 Aud .. list-table:: Differences between nRF5340 Audio applications :header-rows: 1 - * - Application - - LE Audio mode and role + * - :ref:`Application name (LE Audio role) ` + - :ref:`Application mode ` - Minimum amount of nRF5340 Audio DKs recommended for testing - - FEM support - * - :ref:`Unicast client` - - CIS gateway - - 3 - - ✔ - * - :ref:`Unicast server` - - CIS headset - - 3 - - ✔ + - :ref:`FEM support ` * - :ref:`Broadcast sink` - - BIS gateway + - BIS (headset) - 2 - * - :ref:`Broadcast source` - - BIS headset + - BIS (gateway) - 2 - ✔ + * - :ref:`Unicast client` + - CIS (gateway) + - 3 + - ✔ + * - :ref:`Unicast server` + - CIS (headset) + - 3 + - ✔ See the subpages for detailed documentation of each of the nRF5340 applications and their internal modules: diff --git a/applications/nrf5340_audio/prj.conf b/applications/nrf5340_audio/prj.conf index 52342a9f6e3d..65b79447d10c 100644 --- a/applications/nrf5340_audio/prj.conf +++ b/applications/nrf5340_audio/prj.conf @@ -28,6 +28,7 @@ CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_LOG_TAG_MAX_LEN=2 CONFIG_LOG_TAG_DEFAULT="--" CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_BUFFER_SIZE=4096 # Use this for debugging thread usage #CONFIG_LOG_THREAD_ID_PREFIX=y diff --git a/applications/nrf5340_audio/sample.yaml b/applications/nrf5340_audio/sample.yaml index 2150b28376a0..1f9c35416bdf 100644 --- a/applications/nrf5340_audio/sample.yaml +++ b/applications/nrf5340_audio/sample.yaml @@ -3,23 +3,23 @@ sample: description: LE Audio implementation example common: integration_platforms: - - nrf5340_audio_dk_nrf5340_cpuapp + - nrf5340_audio_dk/nrf5340/cpuapp tests: applications.nrf5340_audio.headset: build_only: true - platform_allow: nrf5340_audio_dk_nrf5340_cpuapp - platform_exclude: nrf5340_audio_dk_nrf5340_cpuapp_ns + platform_allow: nrf5340_audio_dk/nrf5340/cpuapp + platform_exclude: nrf5340_audio_dk/nrf5340/cpuapp/ns tags: ci_build extra_args: CONF_FILE="prj_release.conf" CONFIG_AUDIO_DEV=1 applications.nrf5340_audio.gateway: build_only: true - platform_allow: nrf5340_audio_dk_nrf5340_cpuapp - platform_exclude: nrf5340_audio_dk_nrf5340_cpuapp_ns + platform_allow: nrf5340_audio_dk/nrf5340/cpuapp + platform_exclude: nrf5340_audio_dk/nrf5340/cpuapp/ns tags: ci_build extra_args: CONF_FILE="prj_release.conf" CONFIG_AUDIO_DEV=2 applications.nrf5340_audio.headset_sd_card_playback: build_only: true - platform_allow: nrf5340_audio_dk_nrf5340_cpuapp - platform_exclude: nrf5340_audio_dk_nrf5340_cpuapp_ns + platform_allow: nrf5340_audio_dk/nrf5340/cpuapp + platform_exclude: nrf5340_audio_dk/nrf5340/cpuapp/ns tags: ci_build extra_args: CONF_FILE="prj_release.conf" CONFIG_AUDIO_DEV=1 CONFIG_SD_CARD_PLAYBACK=y diff --git a/applications/nrf5340_audio/src/audio/Kconfig b/applications/nrf5340_audio/src/audio/Kconfig index f6457c0520ca..8d9665091333 100644 --- a/applications/nrf5340_audio/src/audio/Kconfig +++ b/applications/nrf5340_audio/src/audio/Kconfig @@ -45,6 +45,12 @@ config AUDIO_MAX_PRES_DLY_US choice AUDIO_SYSTEM_SAMPLE_RATE prompt "System audio sample rate" + default AUDIO_SAMPLE_RATE_16000_HZ if BT_BAP_BROADCAST_16_2_1 + default AUDIO_SAMPLE_RATE_16000_HZ if BT_BAP_BROADCAST_16_2_2 + default AUDIO_SAMPLE_RATE_16000_HZ if BT_BAP_UNICAST_16_2_1 + default AUDIO_SAMPLE_RATE_24000_HZ if BT_BAP_BROADCAST_24_2_1 + default AUDIO_SAMPLE_RATE_24000_HZ if BT_BAP_BROADCAST_24_2_2 + default AUDIO_SAMPLE_RATE_24000_HZ if BT_BAP_UNICAST_24_2_1 default AUDIO_SAMPLE_RATE_48000_HZ help This configuration reflects the system sample rate, but the audio data may be resampled to @@ -212,7 +218,7 @@ visible if SW_CODEC_LC3 config LC3_BITRATE_MAX int "Max bitrate for LC3" - default 96000 + default 124000 config LC3_BITRATE_MIN int "Min bitrate for LC3" diff --git a/applications/nrf5340_audio/src/audio/audio_datapath.c b/applications/nrf5340_audio/src/audio/audio_datapath.c index 87c9489245e5..afe14b9fed6f 100644 --- a/applications/nrf5340_audio/src/audio/audio_datapath.c +++ b/applications/nrf5340_audio/src/audio/audio_datapath.c @@ -85,12 +85,8 @@ LOG_MODULE_REGISTER(audio_datapath, CONFIG_AUDIO_DATAPATH_LOG_LEVEL); #define DRIFT_REGULATOR_DIV_FACTOR 2 /* To allow BLE transmission and (host -> HCI -> controller) */ -#if defined(CONFIG_BT_LL_ACS_NRF53) -#define JUST_IN_TIME_TARGET_DLY_US (CONFIG_AUDIO_FRAME_DURATION_US - 3000) -#else /* !CONFIG_BT_LL_ACS_NRF53 */ #define JUST_IN_TIME_TARGET_DLY_US 3000 -#endif /* !CONFIG_BT_LL_ACS_NRF53 */ -#define JUST_IN_TIME_BOUND_US 2500 +#define JUST_IN_TIME_BOUND_US 2500 /* How often to print under-run warning */ #define UNDERRUN_LOG_INTERVAL_BLKS 5000 @@ -185,16 +181,6 @@ static int32_t err_us_calculate(uint32_t sdu_ref_us, uint32_t frame_start_ts_us) { bool err_neg = false; - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53) && IS_ENABLED(CONFIG_TRANSPORT_BIS)) { - /* To make the drift compensation work as expected - * when using the LE Audio Controller Subsystem Link Layer - * and BIS we must add CONFIG_AUDIO_FRAME_DURATION_US to - * sdu_ref_us. - * This is a temporary workaround. - */ - sdu_ref_us += CONFIG_AUDIO_FRAME_DURATION_US; - } - int64_t total_err = ((int64_t)sdu_ref_us - (int64_t)frame_start_ts_us); /* Store sign for later use, since remainder operation is undefined for negatives */ @@ -807,12 +793,7 @@ static void audio_datapath_just_in_time_check_and_adjust(uint32_t tx_sync_ts_us, static int32_t print_count; int64_t diff; - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53)) { - /* CONFIG_BT_LL_ACS_NRF53 custom implementation. */ - diff = (int64_t)curr_ts_us - tx_sync_ts_us; - } else { - diff = (int64_t)tx_sync_ts_us - curr_ts_us; - } + diff = (int64_t)tx_sync_ts_us - curr_ts_us; /* * The diff should always be positive. If diff is a large negative number, it is likely @@ -829,15 +810,8 @@ static void audio_datapath_just_in_time_check_and_adjust(uint32_t tx_sync_ts_us, } if (print_count % 100 == 0) { - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53)) { - LOG_DBG("JIT diff: %lld us. Target: %u +/- %u", - CONFIG_AUDIO_FRAME_DURATION_US - diff, - CONFIG_AUDIO_FRAME_DURATION_US - JUST_IN_TIME_TARGET_DLY_US, - JUST_IN_TIME_BOUND_US); - } else { - LOG_DBG("JIT diff: %lld us. Target: %u +/- %u", diff, - JUST_IN_TIME_TARGET_DLY_US, JUST_IN_TIME_BOUND_US); - } + LOG_DBG("JIT diff: %lld us. Target: %u +/- %u", diff, JUST_IN_TIME_TARGET_DLY_US, + JUST_IN_TIME_BOUND_US); } print_count++; @@ -1066,16 +1040,7 @@ int audio_datapath_init(void) audio_i2s_init(); ctrl_blk.datapath_initialized = true; ctrl_blk.drift_comp.enabled = true; - if (IS_ENABLED(CONFIG_STREAM_BIDIRECTIONAL) && (CONFIG_AUDIO_DEV == GATEWAY) && - IS_ENABLED(CONFIG_BT_LL_ACS_NRF53)) { - /* Disable presentation compensation feature for microphone return on gateway when - * using Audio Controller Subsystem. Also, since there's only one stream output from - * gateway for now, so no need to have presentation compensation. - */ - ctrl_blk.pres_comp.enabled = false; - } else { - ctrl_blk.pres_comp.enabled = true; - } + ctrl_blk.pres_comp.enabled = true; ctrl_blk.pres_comp.pres_delay_us = CONFIG_BT_AUDIO_PRESENTATION_DELAY_US; @@ -1129,7 +1094,7 @@ static int cmd_i2s_tone_play(const struct shell *shell, size_t argc, const char } shell_print(shell, "Tone play: %d Hz for %d ms with amplitude %.02f", freq, dur_ms, - amplitude); + (double)amplitude); return ret; } diff --git a/applications/nrf5340_audio/src/audio/audio_system.c b/applications/nrf5340_audio/src/audio/audio_system.c index 2c24e3840bb2..7174030241fd 100644 --- a/applications/nrf5340_audio/src/audio/audio_system.c +++ b/applications/nrf5340_audio/src/audio/audio_system.c @@ -68,7 +68,6 @@ static void audio_gateway_configure(void) } #if (CONFIG_STREAM_BIDIRECTIONAL) - sw_codec_cfg.decoder.enabled = true; sw_codec_cfg.decoder.num_ch = 1; sw_codec_cfg.decoder.channel_mode = SW_CODEC_MONO; #endif /* (CONFIG_STREAM_BIDIRECTIONAL) */ @@ -81,7 +80,6 @@ static void audio_gateway_configure(void) sw_codec_cfg.encoder.channel_mode = (sw_codec_cfg.encoder.num_ch == 1) ? SW_CODEC_MONO : SW_CODEC_STEREO; - sw_codec_cfg.encoder.enabled = true; } static void audio_headset_configure(void) @@ -93,7 +91,6 @@ static void audio_headset_configure(void) } #if (CONFIG_STREAM_BIDIRECTIONAL) - sw_codec_cfg.encoder.enabled = true; sw_codec_cfg.encoder.num_ch = 1; sw_codec_cfg.encoder.channel_mode = SW_CODEC_MONO; #endif /* (CONFIG_STREAM_BIDIRECTIONAL) */ @@ -105,8 +102,6 @@ static void audio_headset_configure(void) /* Need an extra decoder channel to decode data from SD card */ sw_codec_cfg.decoder.num_ch++; } - - sw_codec_cfg.decoder.enabled = true; } static void encoder_thread(void *arg1, void *arg2, void *arg3) @@ -267,6 +262,7 @@ int audio_system_config_set(uint32_t encoder_sample_rate_hz, uint32_t encoder_bi } if (sample_rate_valid(decoder_sample_rate_hz)) { + sw_codec_cfg.decoder.enabled = true; sw_codec_cfg.decoder.sample_rate_hz = decoder_sample_rate_hz; } else if (decoder_sample_rate_hz) { LOG_ERR("%d is not a valid sample rate", decoder_sample_rate_hz); @@ -274,6 +270,7 @@ int audio_system_config_set(uint32_t encoder_sample_rate_hz, uint32_t encoder_bi } if (encoder_bitrate) { + sw_codec_cfg.encoder.enabled = true; sw_codec_cfg.encoder.bitrate = encoder_bitrate; } diff --git a/applications/nrf5340_audio/src/audio/le_audio_rx.c b/applications/nrf5340_audio/src/audio/le_audio_rx.c index c88a545b0457..8c7c93701571 100644 --- a/applications/nrf5340_audio/src/audio/le_audio_rx.c +++ b/applications/nrf5340_audio/src/audio/le_audio_rx.c @@ -47,6 +47,7 @@ void le_audio_rx_data_handler(uint8_t const *const p_data, size_t data_size, boo struct ble_iso_data *iso_received = NULL; static struct rx_stats rx_stats[AUDIO_CH_NUM]; static uint32_t num_overruns; + static uint32_t num_thrown; if (!initialized) { ERR_CHK_MSG(-EPERM, "Data received but le_audio_rx is not initialized"); @@ -78,7 +79,11 @@ void le_audio_rx_data_handler(uint8_t const *const p_data, size_t data_size, boo if (stream_state_get() != STATE_STREAMING) { /* Throw away data */ - LOG_WRN("Not in streaming state, throwing data: %d", stream_state_get()); + num_thrown++; + if ((num_thrown % 100) == 1) { + LOG_WRN("Not in streaming state (%d), thrown %d packet(s)", + stream_state_get(), num_thrown); + } return; } diff --git a/applications/nrf5340_audio/src/audio/sw_codec_select.h b/applications/nrf5340_audio/src/audio/sw_codec_select.h index 0941ee678273..3771fa79ae21 100644 --- a/applications/nrf5340_audio/src/audio/sw_codec_select.h +++ b/applications/nrf5340_audio/src/audio/sw_codec_select.h @@ -53,7 +53,6 @@ struct sw_codec_encoder { struct sw_codec_decoder { bool enabled; - bool started; enum sw_codec_channel_mode channel_mode; /* Mono or stereo. */ uint8_t num_ch; /* Number of decoder channels. */ enum audio_channel audio_ch; /* Used to choose which channel to use. */ diff --git a/applications/nrf5340_audio/src/bluetooth/CMakeLists.txt b/applications/nrf5340_audio/src/bluetooth/CMakeLists.txt index c180f299790a..42a4f65e113e 100644 --- a/applications/nrf5340_audio/src/bluetooth/CMakeLists.txt +++ b/applications/nrf5340_audio/src/bluetooth/CMakeLists.txt @@ -5,13 +5,13 @@ # add_subdirectory(bt_management) -add_subdirectory(bt_renderer) +add_subdirectory(bt_rendering_and_capture) add_subdirectory(bt_content_control) add_subdirectory(bt_stream) zephyr_library_include_directories( bt_management - bt_renderer + bt_rendering_and_capture bt_content_control bt_stream ) diff --git a/applications/nrf5340_audio/src/bluetooth/Kconfig b/applications/nrf5340_audio/src/bluetooth/Kconfig index de6ff644a073..fea6769527f5 100644 --- a/applications/nrf5340_audio/src/bluetooth/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/Kconfig @@ -34,11 +34,19 @@ config BT_AUDIO_PREF_SAMPLE_RATE_VALUE default 0x08 if BT_AUDIO_PREF_SAMPLE_RATE_48KHZ choice BT_AUDIO_PREF_SAMPLE_RATE - prompt "Preferred audio sample rate" + prompt "Preferred BT audio sample rate" + default BT_AUDIO_PREF_SAMPLE_RATE_16KHZ if BT_BAP_BROADCAST_16_2_1 + default BT_AUDIO_PREF_SAMPLE_RATE_16KHZ if BT_BAP_BROADCAST_16_2_2 + default BT_AUDIO_PREF_SAMPLE_RATE_16KHZ if BT_BAP_UNICAST_16_2_1 default BT_AUDIO_PREF_SAMPLE_RATE_24KHZ if STREAM_BIDIRECTIONAL + default BT_AUDIO_PREF_SAMPLE_RATE_24KHZ if BT_BAP_BROADCAST_24_2_1 + default BT_AUDIO_PREF_SAMPLE_RATE_24KHZ if BT_BAP_BROADCAST_24_2_2 + default BT_AUDIO_PREF_SAMPLE_RATE_24KHZ if BT_BAP_UNICAST_24_2_1 default BT_AUDIO_PREF_SAMPLE_RATE_48KHZ help - Select the preferred sample rate if there are more than one to choose from. + Select the preferred sample rate to stream if there are more than one to choose from. + Only valid when used by unicast_client if CONFIG_SAMPLE_RATE_CONVERTER=y and + CONFIG_AUDIO_SAMPLE_RATE_48000_HZ=y, meaning 16, 24, and 48kHz are supported. config BT_AUDIO_PREF_SAMPLE_RATE_48KHZ bool "48 kHz" @@ -89,7 +97,7 @@ config BT_AUDIO_RETRANSMITS endmenu # QoS endmenu # Bluetooth audio -rsource "bt_renderer/Kconfig" +rsource "bt_rendering_and_capture/Kconfig" rsource "bt_content_control/Kconfig" #----------------------------------------------------------------------------# diff --git a/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.c b/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.c index 6214a2453d7c..484393721bc0 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.c @@ -86,7 +86,10 @@ int bt_content_ctrl_conn_disconnected(struct bt_conn *conn) if (IS_ENABLED(CONFIG_BT_MCC)) { ret = bt_content_ctrl_media_conn_disconnected(conn); - if (ret) { + /* Try to reset MCS state. -ESRCH is returned if MCS hasn't been discovered + * yet, and shouldn't cause an error print + */ + if (ret && ret != -ESRCH) { LOG_ERR("bt_content_ctrl_media_conn_disconnected failed with %d", ret); } } diff --git a/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.h b/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.h index 67038a28dee3..805dedc8fa5d 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_content_control/bt_content_ctrl.h @@ -56,6 +56,14 @@ int bt_content_ctrl_discover(struct bt_conn *conn); */ int bt_content_ctrl_uuid_populate(struct net_buf_simple *uuid_buf); +/** + * @brief Check if the media player is playing. + * + * @retval true Media player is in a playing state. + * @retval false Media player is not in a playing state. + */ +bool bt_content_ctlr_media_state_playing(void); + /** * @brief Initialize the content control module. * diff --git a/applications/nrf5340_audio/src/bluetooth/bt_content_control/media/bt_content_ctrl_media.c b/applications/nrf5340_audio/src/bluetooth/bt_content_control/media/bt_content_ctrl_media.c index 370e8ad6973c..de090822bf25 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_content_control/media/bt_content_ctrl_media.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_content_control/media/bt_content_ctrl_media.c @@ -128,6 +128,7 @@ static void mcc_discover_mcs_cb(struct bt_conn *conn, int err) } } +#if defined(CONFIG_BT_MCC_SET_MEDIA_CONTROL_POINT) /** * @brief Callback handler for sent MCS commands. * @@ -143,6 +144,7 @@ static void mcc_send_command_cb(struct bt_conn *conn, int err, const struct mpl_ cmd->param); } } +#endif /* defined(CONFIG_BT_MCC_SET_MEDIA_CONTROL_POINT) */ /** * @brief Callback handler for received notifications. @@ -160,6 +162,7 @@ static void mcc_cmd_notification_cb(struct bt_conn *conn, int err, const struct } } +#if defined(CONFIG_BT_MCC_READ_MEDIA_STATE) /** * @brief Callback handler for reading media state. * @@ -177,6 +180,7 @@ static void mcc_read_media_state_cb(struct bt_conn *conn, int err, uint8_t state media_player_state = state; } +#endif /* defined(CONFIG_BT_MCC_READ_MEDIA_STATE) */ /** * @brief Callback handler for received MCS commands. @@ -438,6 +442,15 @@ int bt_content_ctrl_media_pause(struct bt_conn *conn) return 0; } +bool bt_content_ctlr_media_state_playing(void) +{ + if (media_player_state == BT_MCS_MEDIA_STATE_PLAYING) { + return true; + } + + return false; +} + int bt_content_ctrl_media_conn_disconnected(struct bt_conn *conn) { int idx = mcc_peer_index_get(conn); @@ -463,9 +476,13 @@ int bt_content_ctrl_media_client_init(void) static struct bt_mcc_cb mcc_cb; mcc_cb.discover_mcs = mcc_discover_mcs_cb; +#if defined(CONFIG_BT_MCC_SET_MEDIA_CONTROL_POINT) mcc_cb.send_cmd = mcc_send_command_cb; +#endif /* defined(CONFIG_BT_MCC_SET_MEDIA_CONTROL_POINT) */ mcc_cb.cmd_ntf = mcc_cmd_notification_cb; +#if defined(CONFIG_BT_MCC_READ_MEDIA_STATE) mcc_cb.read_media_state = mcc_read_media_state_cb; +#endif /* defined(CONFIG_BT_MCC_READ_MEDIA_STATE) */ return bt_mcc_init(&mcc_cb); } diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_management/Kconfig index 23de1818d362..b2313dd13152 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/Kconfig @@ -9,15 +9,6 @@ menu "BT management" rsource "controller_config/Kconfig" #----------------------------------------------------------------------------# -menu "Power control" - -config BLE_LE_POWER_CONTROL_ENABLED - bool "Enable the Bluetooth LE power control feature" - default n - help - The Bluetooth LE power control feature makes devices be able to change TX power - dynamically and automatically during connection, which may reduce power consumption. - config WDT_CTLR bool "Enable watchdog for controller" default y @@ -26,139 +17,11 @@ config WDT_CTLR Turn off to reduce overhead, or HCI traffic. The watchdog will be deactivated automatically for DFU procedures. -choice BLE_CONN_TX_POWER - prompt "Default TX power for the Bluetooth LE connections" - default BLE_CONN_TX_POWER_0DBM - help - Set the default TX power for Bluetooth LE connections. - -config BLE_CONN_TX_POWER_0DBM - bool "0dBm" - -config BLE_CONN_TX_POWER_NEG_1DBM - bool "-1dBm" - -config BLE_CONN_TX_POWER_NEG_2DBM - bool "-2dBm" - -config BLE_CONN_TX_POWER_NEG_3DBM - bool "-3dBm" - -config BLE_CONN_TX_POWER_NEG_4DBM - bool "-4dBm" - -config BLE_CONN_TX_POWER_NEG_5DBM - bool "-5dBm" - -config BLE_CONN_TX_POWER_NEG_6DBM - bool "-6dBm" - -config BLE_CONN_TX_POWER_NEG_7DBM - bool "-7dBm" - -config BLE_CONN_TX_POWER_NEG_8DBM - bool "-8dBm" - -config BLE_CONN_TX_POWER_NEG_12DBM - bool "-12dBm" - -config BLE_CONN_TX_POWER_NEG_16DBM - bool "-14dBm" - -config BLE_CONN_TX_POWER_NEG_20DBM - bool "-20dBm" - -config BLE_CONN_TX_POWER_NEG_40DBM - bool "-40dBm" - -endchoice - -config BLE_CONN_TX_POWER_DBM - int - default 0 if BLE_CONN_TX_POWER_0DBM - default -1 if BLE_CONN_TX_POWER_NEG_1DBM - default -2 if BLE_CONN_TX_POWER_NEG_2DBM - default -3 if BLE_CONN_TX_POWER_NEG_3DBM - default -4 if BLE_CONN_TX_POWER_NEG_4DBM - default -5 if BLE_CONN_TX_POWER_NEG_5DBM - default -6 if BLE_CONN_TX_POWER_NEG_6DBM - default -7 if BLE_CONN_TX_POWER_NEG_7DBM - default -8 if BLE_CONN_TX_POWER_NEG_8DBM - default -12 if BLE_CONN_TX_POWER_NEG_12DBM - default -16 if BLE_CONN_TX_POWER_NEG_16DBM - default -20 if BLE_CONN_TX_POWER_NEG_20DBM - default -40 if BLE_CONN_TX_POWER_NEG_40DBM - -choice BLE_ADV_TX_POWER - prompt "Default TX power for the Bluetooth LE advertising" - default BLE_ADV_TX_POWER_0DBM - help - Set the default TX power for the Bluetooth LE advertising. - -config BLE_ADV_TX_POWER_0DBM - bool "0dBm" - -config BLE_ADV_TX_POWER_NEG_1DBM - bool "-1dBm" - -config BLE_ADV_TX_POWER_NEG_2DBM - bool "-2dBm" - -config BLE_ADV_TX_POWER_NEG_3DBM - bool "-3dBm" - -config BLE_ADV_TX_POWER_NEG_4DBM - bool "-4dBm" - -config BLE_ADV_TX_POWER_NEG_5DBM - bool "-5dBm" - -config BLE_ADV_TX_POWER_NEG_6DBM - bool "-6dBm" - -config BLE_ADV_TX_POWER_NEG_7DBM - bool "-7dBm" - -config BLE_ADV_TX_POWER_NEG_8DBM - bool "-8dBm" - -config BLE_ADV_TX_POWER_NEG_12DBM - bool "-12dBm" - -config BLE_ADV_TX_POWER_NEG_16DBM - bool "-14dBm" - -config BLE_ADV_TX_POWER_NEG_20DBM - bool "-20dBm" - -config BLE_ADV_TX_POWER_NEG_40DBM - bool "-40dBm" - -endchoice - -config BLE_ADV_TX_POWER_DBM - int - default 0 if BLE_ADV_TX_POWER_0DBM - default -1 if BLE_ADV_TX_POWER_NEG_1DBM - default -2 if BLE_ADV_TX_POWER_NEG_2DBM - default -3 if BLE_ADV_TX_POWER_NEG_3DBM - default -4 if BLE_ADV_TX_POWER_NEG_4DBM - default -5 if BLE_ADV_TX_POWER_NEG_5DBM - default -6 if BLE_ADV_TX_POWER_NEG_6DBM - default -7 if BLE_ADV_TX_POWER_NEG_7DBM - default -8 if BLE_ADV_TX_POWER_NEG_8DBM - default -12 if BLE_ADV_TX_POWER_NEG_12DBM - default -16 if BLE_ADV_TX_POWER_NEG_16DBM - default -20 if BLE_ADV_TX_POWER_NEG_20DBM - default -40 if BLE_ADV_TX_POWER_NEG_40DBM - -endmenu # Power control - menu "Thread priorities" config CTLR_POLL_WORK_Q_PRIO int "Work queue priority for controller poll" - default 6 + default 2 help This is a preemptible work queue. This work queue will poll the controller to check it is alive. diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/Kconfig index 4db9ed4f3b84..038ba36e6815 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/Kconfig @@ -54,6 +54,19 @@ config EXT_ADV_UUID_BUF_MAX int "Maximum number of UUIDs to add to extended advertisements" default 20 +config BT_DEVICE_MANUFACTURER_ID + hex "Manufacturer ID" + default 0xFE58 + help + Bluetooth manufacturer ID. For the list of possible values please + consult the following link: + https://www.bluetooth.com/specifications/assigned-numbers + +config BLE_ACL_ADV_SID + hex "Advertising set ID" + range 0x00 0x0F + default 0x00 + #----------------------------------------------------------------------------# menu "Log level" diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/bt_mgmt_adv.c b/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/bt_mgmt_adv.c index 9b182bee3c2f..0d241f971438 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/bt_mgmt_adv.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/advertising/bt_mgmt_adv.c @@ -36,6 +36,16 @@ static size_t per_adv_local_size; /* Bonded address queue */ K_MSGQ_DEFINE(bonds_queue, sizeof(bt_addr_le_t), BONDS_QUEUE_SIZE, 4); +static struct bt_le_adv_param ext_adv_param = { + .id = BT_ID_DEFAULT, + .sid = CONFIG_BLE_ACL_ADV_SID, + .secondary_max_skip = 0, + .options = BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME, + .interval_min = CONFIG_BLE_ACL_EXT_ADV_INT_MIN, + .interval_max = CONFIG_BLE_ACL_EXT_ADV_INT_MAX, + .peer = NULL, +}; + static void bond_find(const struct bt_bond_info *info, void *user_data) { int ret; @@ -137,12 +147,11 @@ static const struct bt_le_ext_adv_cb adv_cb = { static int direct_adv_create(bt_addr_le_t addr) { int ret; - struct bt_le_adv_param adv_param; struct bt_le_ext_adv_info ext_adv_info; - adv_param = *BT_LE_ADV_CONN_DIR(&addr); - adv_param.id = BT_ID_DEFAULT; - adv_param.options |= BT_LE_ADV_OPT_DIR_ADDR_RPA; + ext_adv_param = *BT_LE_ADV_CONN_DIR(&addr); + ext_adv_param.id = BT_ID_DEFAULT; + ext_adv_param.options |= BT_LE_ADV_OPT_DIR_ADDR_RPA; /* Clear ADV data set before update to direct advertising */ ret = bt_le_ext_adv_set_data(ext_adv, NULL, 0, NULL, 0); @@ -151,7 +160,7 @@ static int direct_adv_create(bt_addr_le_t addr) return ret; } - ret = bt_le_ext_adv_update_param(ext_adv, &adv_param); + ret = bt_le_ext_adv_update_param(ext_adv, &ext_adv_param); if (ret) { LOG_ERR("Failed to update ext_adv to direct advertising. Err = %d", ret); return ret; @@ -180,15 +189,10 @@ static int extended_adv_create(void) return -ENXIO; } - if (dir_adv_timed_out) { - /* If the directed adv has timed out it means we only need to update the adv data */ - bt_le_adv_update_data(adv_local, adv_local_size, NULL, 0); - } else { - ret = bt_le_ext_adv_set_data(ext_adv, adv_local, adv_local_size, NULL, 0); - if (ret) { - LOG_ERR("Failed to set advertising data: %d", ret); - return ret; - } + ret = bt_le_ext_adv_set_data(ext_adv, adv_local, adv_local_size, NULL, 0); + if (ret) { + LOG_ERR("Failed to set advertising data: %d", ret); + return ret; } if (per_adv_local != NULL && IS_ENABLED(CONFIG_BT_PER_ADV)) { @@ -316,6 +320,17 @@ void bt_mgmt_dir_adv_timed_out(void) bt_mgmt_adv_start(NULL, 0, NULL, 0, true); } +int bt_mgmt_manufacturer_uuid_populate(struct net_buf_simple *uuid_buf, uint16_t company_id) +{ + if (net_buf_simple_tailroom(uuid_buf) >= BT_UUID_SIZE_16) { + net_buf_simple_add_le16(uuid_buf, company_id); + } else { + return -ENOMEM; + } + + return 0; +} + int bt_mgmt_adv_start(const struct bt_data *adv, size_t adv_size, const struct bt_data *per_adv, size_t per_adv_size, bool connectable) { @@ -355,7 +370,7 @@ int bt_mgmt_adv_start(const struct bt_data *adv, size_t adv_size, const struct b return ret; } } else { - ret = bt_le_ext_adv_create(LE_AUDIO_EXTENDED_ADV_NAME, &adv_cb, &ext_adv); + ret = bt_le_ext_adv_create(&ext_adv_param, &adv_cb, &ext_adv); if (ret) { LOG_ERR("Unable to create extended advertising set: %d", ret); return ret; diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c b/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c index 9af8f24d38df..3f486f313cfd 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c @@ -24,10 +24,6 @@ #include "bt_mgmt_dfu_internal.h" #endif -#if (CONFIG_BT_LL_ACS_NRF53) -#include "ble_hci_vsc.h" -#endif /* (CONFIG_BT_LL_ACS_NRF53) */ - #include LOG_MODULE_REGISTER(bt_mgmt, CONFIG_BT_MGMT_LOG_LEVEL); @@ -132,30 +128,6 @@ static void connected_cb(struct bt_conn *conn, uint8_t err) } } -#if (CONFIG_BT_LL_ACS_NRF53) - enum ble_hci_vs_tx_power conn_tx_pwr; - uint16_t conn_handle; - - ret = bt_hci_get_conn_handle(conn, &conn_handle); - if (ret) { - LOG_ERR("Unable to get conn handle"); - } else { - if (IS_ENABLED(CONFIG_NRF_21540_ACTIVE)) { - conn_tx_pwr = CONFIG_NRF_21540_MAIN_DBM; - } else { - conn_tx_pwr = CONFIG_BLE_CONN_TX_POWER_DBM; - } - - ret = ble_hci_vsc_conn_tx_pwr_set(conn_handle, conn_tx_pwr); - if (ret) { - LOG_ERR("Failed to set TX power for conn"); - } else { - LOG_DBG("TX power set to %d dBm for connection %p", conn_tx_pwr, - (void *)conn); - } - } -#endif /* (CONFIG_BT_LL_ACS_NRF53) */ - msg.event = BT_MGMT_CONNECTED; msg.conn = conn; @@ -221,7 +193,7 @@ static void security_changed_cb(struct bt_conn *conn, bt_security_t level, enum if (err) { LOG_WRN("Security failed: level %d err %d", level, err); - ret = bt_conn_disconnect(conn, err); + ret = bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL); if (ret) { LOG_WRN("Failed to disconnect %d", ret); } diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.h b/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.h index fcf2502257bd..9611a26d9dfd 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.h @@ -80,6 +80,17 @@ enum bt_mgmt_scan_type { */ int bt_mgmt_scan_start(uint16_t scan_intvl, uint16_t scan_win, enum bt_mgmt_scan_type type, char const *const name, uint32_t brdcast_id); + +/** + * @brief Add manufacturer ID UUID to the advertisement packet. + * + * @param[out] uuid_buf Buffer being populated with UUIDs. + * @param[in] company_id 16 bit UUID specific to the company. + * + * @return 0 for success, error otherwise. + */ +int bt_mgmt_manufacturer_uuid_populate(struct net_buf_simple *uuid_buf, uint16_t company_id); + /** * @brief Create and start advertising for ACL connection. * diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig index d9582da718eb..987ca4b0d7a7 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig @@ -4,8 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -rsource "Kconfig.defaults" - menu "Controller config" #----------------------------------------------------------------------------# diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig.defaults b/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig.defaults deleted file mode 100644 index 1a41d1511bdf..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/Kconfig.defaults +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Bluetooth controller type -if BT_LL_ACS_NRF53 - -# Not supported on LE Audio Controller Subsystem for nRF53 -config BT_ATT_ENFORCE_FLOW - default n - -# Disable Zephyr HCI Vendor-Specific extensions -config BT_HCI_VS_EXT - default n - -# HCI ACL flow control is not supported on BT_LL_ACS_NRF53 -config BT_HCI_ACL_FLOW_CONTROL - default n - -endif # BT_LL_ACS_NRF53 diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/bt_mgmt_ctlr_cfg.c b/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/bt_mgmt_ctlr_cfg.c index b7f6d37beee4..bf384229a249 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/bt_mgmt_ctlr_cfg.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/controller_config/bt_mgmt_ctlr_cfg.c @@ -10,20 +10,17 @@ #include #include #include +#include #include "macros_common.h" -#if (CONFIG_BT_LL_ACS_NRF53) -#include "ble_hci_vsc.h" -#endif /* (CONFIG_BT_LL_ACS_NRF53) */ #include LOG_MODULE_REGISTER(bt_mgmt_ctlr_cfg, CONFIG_BT_MGMT_CTLR_CFG_LOG_LEVEL); -#define COMPANY_ID_NORDIC 0x0059 -#define COMPANY_ID_PACKETCRAFT 0x07E8 +#define COMPANY_ID_NORDIC 0x0059 -#define WDT_TIMEOUT_MS 1500 -#define CTLR_POLL_INTERVAL_MS (WDT_TIMEOUT_MS - 500) +#define WDT_TIMEOUT_MS 3000 +#define CTLR_POLL_INTERVAL_MS (WDT_TIMEOUT_MS - 1000) static struct k_work work_ctlr_poll; @@ -43,100 +40,6 @@ static int wdt_ch_id; K_TIMER_DEFINE(ctlr_poll_timer, ctlr_poll_timer_handler, NULL); -static int bt_ll_acs_nrf53_cfg(void) -{ -#if (CONFIG_BT_LL_ACS_NRF53) - int ret; - /* Enable notification of lost ISO packets */ - ret = ble_hci_vsc_op_flag_set(BLE_HCI_VSC_OP_ISO_LOST_NOTIFY, 1); - if (ret) { - return ret; - } - -#if (CONFIG_NRF_21540_ACTIVE) - /* Indexes for the pins gotten from nrf21540ek_fwd.overlay */ - uint8_t tx_pin = NRF_DT_GPIOS_TO_PSEL_BY_IDX(DT_PATH(nrf_gpio_forwarder, nrf21540_gpio_if), - gpios, 0); - uint8_t rx_pin = NRF_DT_GPIOS_TO_PSEL_BY_IDX(DT_PATH(nrf_gpio_forwarder, nrf21540_gpio_if), - gpios, 1); - uint8_t pdn_pin = NRF_DT_GPIOS_TO_PSEL_BY_IDX(DT_PATH(nrf_gpio_forwarder, nrf21540_gpio_if), - gpios, 2); - uint8_t ant_pin = NRF_DT_GPIOS_TO_PSEL_BY_IDX(DT_PATH(nrf_gpio_forwarder, nrf21540_gpio_if), - gpios, 3); - uint8_t mode_pin = NRF_DT_GPIOS_TO_PSEL_BY_IDX( - DT_PATH(nrf_gpio_forwarder, nrf21540_gpio_if), gpios, 4); - - struct ble_hci_vs_cp_nrf21540_pins nrf21540_pins = { - .mode = mode_pin, - .txen = tx_pin, - .rxen = rx_pin, - .antsel = ant_pin, - .pdn = pdn_pin, - /* Set CS pin to ffff since we are not using the SPI */ - .csn = 0xffff}; - - ret = ble_hci_vsc_nrf21540_pins_set(&nrf21540_pins); - if (ret) { - return ret; - } - - ret = ble_hci_vsc_radio_high_pwr_mode_set( - MAX(CONFIG_NRF_21540_MAIN_DBM, CONFIG_NRF_21540_PRI_ADV_DBM)); - if (ret) { - return ret; - } - - ret = ble_hci_vsc_adv_tx_pwr_set(CONFIG_NRF_21540_MAIN_DBM); - if (ret) { - return ret; - } - - LOG_DBG("TX power set to %d", CONFIG_NRF_21540_MAIN_DBM); - - ret = ble_hci_vsc_pri_adv_chan_max_tx_pwr_set(CONFIG_NRF_21540_PRI_ADV_DBM); - if (ret) { - return ret; - } - - LOG_DBG("Primary advertising TX power set to %d", CONFIG_NRF_21540_PRI_ADV_DBM); -#else - ret = ble_hci_vsc_adv_tx_pwr_set(CONFIG_BLE_ADV_TX_POWER_DBM); - if (ret) { - return ret; - } - - LOG_DBG("TX power set to %d", CONFIG_BLE_ADV_TX_POWER_DBM); - - /* Disabled by default, only used if another TX power for primary adv channels is needed */ - ret = ble_hci_vsc_pri_adv_chan_max_tx_pwr_set(BLE_HCI_VSC_PRI_EXT_ADV_MAX_TX_PWR_DISABLE); - if (ret) { - return ret; - } - -#endif /*CONFIG_NRF_21540_ACTIVE*/ - - /* Map controller LEDs*/ - - ret = ble_hci_vsc_led_pin_map(PAL_LED_ID_CPU_ACTIVE, - DT_GPIO_FLAGS_BY_IDX(DT_NODELABEL(rgb2_green), gpios, 0), - DT_GPIO_PIN_BY_IDX(DT_NODELABEL(rgb2_green), gpios, 0)); - if (ret) { - return ret; - } - - ret = ble_hci_vsc_led_pin_map(PAL_LED_ID_ERROR, - DT_GPIO_FLAGS_BY_IDX(DT_NODELABEL(rgb2_red), gpios, 0), - DT_GPIO_PIN_BY_IDX(DT_NODELABEL(rgb2_red), gpios, 0)); - if (ret) { - return ret; - } - - return 0; -#else - return -ENODEV; -#endif /* CONFIG_BT_LL_ACS_NRF53*/ -} - static void work_ctlr_poll_handler(struct k_work *work) { int ret; @@ -177,12 +80,7 @@ int bt_mgmt_ctlr_cfg_manufacturer_get(bool print_version, uint16_t *manufacturer struct bt_hci_rp_read_local_version_info *rp = (void *)rsp->data; if (print_version) { - if (rp->manufacturer == COMPANY_ID_PACKETCRAFT) { - /* NOTE: The string below is used by the Nordic CI system */ - LOG_INF("Controller: LL_ACS_NRF53: Version %s (0x%02x), Revision %d", - bt_hci_get_ver_str(rp->hci_version), rp->hci_version, - rp->hci_revision); - } else if (rp->manufacturer == COMPANY_ID_NORDIC) { + if (rp->manufacturer == COMPANY_ID_NORDIC) { /* NOTE: The string below is used by the Nordic CI system */ LOG_INF("Controller: SoftDevice: Version %s (0x%02x), Revision %d", bt_hci_get_ver_str(rp->hci_version), rp->hci_version, @@ -210,18 +108,6 @@ int bt_mgmt_ctlr_cfg_init(bool watchdog_enable) return ret; } - if ((IS_ENABLED(CONFIG_BT_LL_ACS_NRF53) && (manufacturer != COMPANY_ID_PACKETCRAFT)) || - (!IS_ENABLED(CONFIG_BT_LL_ACS_NRF53) && (manufacturer == COMPANY_ID_PACKETCRAFT))) { - LOG_ERR("Controller config on APP and controller on NET mismatch."); - } - - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53) && (manufacturer == COMPANY_ID_PACKETCRAFT)) { - ret = bt_ll_acs_nrf53_cfg(); - if (ret) { - return ret; - } - } - if (watchdog_enable) { ret = task_wdt_init(NULL); if (ret != 0) { diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c b/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c index 2369d628fb7b..1440c322d63a 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "bt_mgmt.h" #include "macros_common.h" @@ -36,13 +37,14 @@ static bool sync_cb_registered; static char const *srch_name; static uint32_t srch_brdcast_id = BRDCAST_ID_NOT_USED; static struct bt_le_per_adv_sync *pa_sync; -static uint32_t broadcaster_broadcast_id; struct broadcast_source { char name[BLE_SEARCH_NAME_MAX_LEN]; - uint32_t broadcast_id; + uint32_t id; }; +static struct broadcast_source brcast_src_info; + static void scan_restart_worker(struct k_work *work) { int ret; @@ -91,7 +93,8 @@ static uint16_t interval_to_sync_timeout(uint16_t interval) return timeout; } -static void periodic_adv_sync(const struct bt_le_scan_recv_info *info, uint32_t broadcast_id) +static void periodic_adv_sync(const struct bt_le_scan_recv_info *info, + struct broadcast_source source) { int ret; struct bt_le_per_adv_sync_param param; @@ -105,8 +108,6 @@ static void periodic_adv_sync(const struct bt_le_scan_recv_info *info, uint32_t param.skip = PA_SYNC_SKIP; param.timeout = interval_to_sync_timeout(info->interval); - broadcaster_broadcast_id = broadcast_id; - /* Set timeout to same value as PA sync timeout in ms */ k_timer_start(&pa_sync_timer, K_MSEC(param.timeout * 10), K_NO_WAIT); @@ -119,6 +120,7 @@ static void periodic_adv_sync(const struct bt_le_scan_recv_info *info, uint32_t } return; } + brcast_src_info = source; } /** @@ -163,7 +165,7 @@ static bool scan_check_broadcast_source(struct bt_data *data, void *user_data) return true; } - source->broadcast_id = sys_get_le24(data->data + BT_UUID_SIZE_16); + source->id = sys_get_le24(data->data + BT_UUID_SIZE_16); return true; } @@ -176,7 +178,7 @@ static bool scan_check_broadcast_source(struct bt_data *data, void *user_data) */ static void scan_recv_cb(const struct bt_le_scan_recv_info *info, struct net_buf_simple *ad) { - struct broadcast_source source = {.broadcast_id = INVALID_BROADCAST_ID}; + struct broadcast_source source = {.id = INVALID_BROADCAST_ID}; /* We are only interested in non-connectable periodic advertisers */ if ((info->adv_props & BT_GAP_ADV_PROP_CONNECTABLE) || info->interval == 0) { @@ -185,10 +187,10 @@ static void scan_recv_cb(const struct bt_le_scan_recv_info *info, struct net_buf bt_data_parse(ad, scan_check_broadcast_source, (void *)&source); - if (source.broadcast_id != INVALID_BROADCAST_ID) { + if (source.id != INVALID_BROADCAST_ID) { if (srch_brdcast_id < BRDCAST_ID_NOT_USED) { /* Valid srch_brdcast_id supplied */ - if (source.broadcast_id != srch_brdcast_id) { + if (source.id != srch_brdcast_id) { /* Broadcaster does not match src_brdcast_id */ return; } @@ -198,8 +200,8 @@ static void scan_recv_cb(const struct bt_le_scan_recv_info *info, struct net_buf return; } - LOG_INF("Broadcast source %s found, id: 0x%06x", source.name, source.broadcast_id); - periodic_adv_sync(info, source.broadcast_id); + LOG_DBG("Broadcast source %s found, id: 0x%06x", source.name, source.id); + periodic_adv_sync(info, source); } } @@ -214,7 +216,10 @@ static void pa_synced_cb(struct bt_le_per_adv_sync *sync, return; } - LOG_DBG("PA synced"); + char addr_str[BT_ADDR_LE_STR_LEN]; + (void)bt_addr_le_to_str(&sync->addr, addr_str, BT_ADDR_LE_STR_LEN); + LOG_INF("PA synced to name: %s, id: 0x%06x, addr: %s", brcast_src_info.name, + brcast_src_info.id, addr_str); k_timer_stop(&pa_sync_timer); @@ -225,7 +230,7 @@ static void pa_synced_cb(struct bt_le_per_adv_sync *sync, msg.event = BT_MGMT_PA_SYNCED; msg.pa_sync = sync; - msg.broadcast_id = broadcaster_broadcast_id; + msg.broadcast_id = brcast_src_info.id; ret = zbus_chan_pub(&bt_mgmt_chan, &msg, K_NO_WAIT); ERR_CHK(ret); diff --git a/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_conn.c b/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_conn.c index 7328db182ed6..4216d4c10860 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_conn.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_conn.c @@ -102,11 +102,26 @@ static bool device_name_check(struct bt_data *data, void *user_data) char addr_string[BT_ADDR_LE_STR_LEN]; /* We only care about LTVs with name */ - if (data->type == BT_DATA_NAME_COMPLETE) { + if (data->type == BT_DATA_NAME_COMPLETE || data->type == BT_DATA_NAME_SHORTENED) { size_t srch_name_size = strlen(srch_name); if ((data->data_len == srch_name_size) && (strncmp(srch_name, data->data, srch_name_size) == 0)) { + /* Check if the device is still connected due to waiting for ACL timeout */ + struct bt_conn_info info; + struct bt_conn *existing_conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr); + + if (existing_conn != NULL) { + ret = bt_conn_get_info(existing_conn, &info); + if (ret == 0 && info.state == BT_CONN_STATE_CONNECTED) { + LOG_DBG("Trying to connect to an already connected conn"); + bt_conn_unref(existing_conn); + return false; + } + + /* Unref is needed due to bt_conn_lookup */ + bt_conn_unref(existing_conn); + } LOG_DBG("Device found: %s", srch_name); bt_le_scan_cb_unregister(&scan_callback); @@ -124,7 +139,7 @@ static bool device_name_check(struct bt_data *data, void *user_data) ret = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN, CONNECTION_PARAMETERS, &conn); if (ret) { - LOG_ERR("Could not init connection"); + LOG_ERR("Could not init connection: %d", ret); ret = bt_mgmt_scan_start(0, 0, BT_MGMT_SCAN_TYPE_CONN, NULL, BRDCAST_ID_NOT_USED); diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/CMakeLists.txt b/applications/nrf5340_audio/src/bluetooth/bt_renderer/CMakeLists.txt deleted file mode 100644 index deb967c8e01a..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_library_include_directories( - volume -) - -target_sources(app PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/bt_rend.c) - -if (CONFIG_BT_VCP_VOL_CTLR OR CONFIG_BT_VCP_VOL_REND) -target_sources(app PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/volume/bt_rend_vol.c) -endif() diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_renderer/Kconfig deleted file mode 100644 index 4eb3dfffb1c4..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -menu "BT renderer" - -rsource "volume/Kconfig" - -#----------------------------------------------------------------------------# -menu "Log level" - -module = BT_REND -module-str = bt-rend -source "subsys/logging/Kconfig.template.log_config" - -endmenu # Log level -endmenu # BT renderer diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.c b/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.c deleted file mode 100644 index 5820bf872cdb..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "bt_rend.h" - -#include -#include -#include - -#include "bt_rend_vol_internal.h" -#include "nrf5340_audio_common.h" - -#include -LOG_MODULE_REGISTER(bt_rend, CONFIG_BT_REND_LOG_LEVEL); - -ZBUS_CHAN_DEFINE(volume_chan, struct volume_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, - ZBUS_MSG_INIT(0)); - -int bt_rend_volume_up(void) -{ - int ret; - struct volume_msg msg; - - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR) || IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - ret = bt_rend_vol_up(); - return ret; - } - - msg.event = VOLUME_UP; - - ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); - return ret; -} - -int bt_rend_volume_down(void) -{ - int ret; - struct volume_msg msg; - - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR) || IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - ret = bt_rend_vol_down(); - return ret; - } - - msg.event = VOLUME_DOWN; - - ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); - return ret; -} - -int bt_rend_volume_set(uint8_t volume, bool from_vcp) -{ - int ret; - struct volume_msg msg; - - if ((IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR) || IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) && - !from_vcp) { - ret = bt_rend_vol_set(volume); - return ret; - } - - msg.event = VOLUME_SET; - msg.volume = volume; - - ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); - return ret; -} - -int bt_rend_volume_mute(bool from_vcp) -{ - int ret; - struct volume_msg msg; - - if ((IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR) || IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) && - !from_vcp) { - ret = bt_rend_vol_mute(); - return ret; - } - - msg.event = VOLUME_MUTE; - - ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); - return ret; -} - -int bt_rend_volume_unmute(void) -{ - int ret; - struct volume_msg msg; - - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR) || IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - ret = bt_rend_vol_unmute(); - return ret; - } - - msg.event = VOLUME_UNMUTE; - - ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); - return ret; -} - -int bt_rend_discover(struct bt_conn *conn) -{ - int ret; - - /* Only do a VCS discover if we are volume controller */ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - ret = bt_rend_vol_discover(conn); - if (ret) { - LOG_WRN("Failed to discover VCS: %d", ret); - return ret; - } - } - - return 0; -} - -int bt_rend_uuid_populate(struct net_buf_simple *uuid_buf) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - if (net_buf_simple_tailroom(uuid_buf) >= BT_UUID_SIZE_16) { - net_buf_simple_add_le16(uuid_buf, BT_UUID_VCS_VAL); - } else { - return -ENOMEM; - } - } - - return 0; -} - -int bt_rend_init(void) -{ - int ret; - - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - ret = bt_rend_vol_ctlr_init(); - - if (ret) { - LOG_WRN("Failed to initialize VCS controller: %d", ret); - return ret; - } - } - - if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - ret = bt_rend_vol_rend_init(); - - if (ret) { - LOG_WRN("Failed to initialize VCS renderer: %d", ret); - return ret; - } - } - - return 0; -} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.h b/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.h deleted file mode 100644 index a0fd5d51b5ad..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/bt_rend.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef _BT_REND_H_ -#define _BT_REND_H_ - -#include - -/** - * @brief Adjust volume up by one step. - * - * @return 0 if success, error otherwise. - */ -int bt_rend_volume_up(void); - -/** - * @brief Adjust volume down by one step. - * - * @return 0 if success, error otherwise. - */ -int bt_rend_volume_down(void); - -/** - * @brief Set the volume to the given @p volume value. - * - * @param[in] volume Value to set the volume to (0-255). - * @param[in] from_vcp Describe if the function was called from a service - * or from somewhere else (buttons, shell, etc). - * - * @return 0 if success, error otherwise. - */ -int bt_rend_volume_set(uint8_t volume, bool from_vcp); - -/** - * @brief Mute the volume. - * - * @param[in] from_vcp Describe if the function was called from a service - * or from somewhere else (buttons, shell, etc). - * - * @return 0 if success, error otherwise. - */ -int bt_rend_volume_mute(bool from_vcp); - -/** - * @brief Unmute the volume. - * - * @return 0 if success, error otherwise. - */ -int bt_rend_volume_unmute(void); - -/** - * @brief Discover the rendering services. - * - * @param[in] conn Pointer to the connection on which to do the discovery. - * - * @return 0 if success, error otherwise. - */ -int bt_rend_discover(struct bt_conn *conn); - -/** - * @brief Put the UUIDs from this module into the buffer. - * - * @note This partial data is used to build a complete extended advertising packet. - * - * @param[out] uuid_buf Buffer being populated with UUIDs. - * - * @return 0 for success, error otherwise. - */ -int bt_rend_uuid_populate(struct net_buf_simple *uuid_buf); - -/** - * @brief Initialize the rendering services or profiles, or both. - * - * @return 0 if success, error otherwise. - */ -int bt_rend_init(void); - -#endif /* _BT_REND_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/Kconfig deleted file mode 100644 index 2cc2f7de218e..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/Kconfig +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -menu "Volume" - -config BT_AUDIO_VOL_DEFAULT - int "Default volume" - range 0 255 - default 195 - help - The default volume when starting a volume control renderer. - -config BT_AUDIO_VOL_STEP_SIZE - int "Volume adjust step size" - range 6 32 - default 16 - -#----------------------------------------------------------------------------# -menu "Log level" - -module = BT_REND_VOL -module-str = bt-rend-vol -source "subsys/logging/Kconfig.template.log_config" - -endmenu # Log level -endmenu # Volume diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol.c b/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol.c deleted file mode 100644 index 40d0d37e1fb5..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "bt_rend_vol_internal.h" - -#include -#include -#include -#include - -#include "macros_common.h" -#include "bt_rend.h" - -#include -LOG_MODULE_REGISTER(bt_rend_vol, CONFIG_BT_REND_VOL_LOG_LEVEL); - -static struct bt_vcp_vol_ctlr *vcs_client_peer[CONFIG_BT_MAX_CONN]; - -/** - * @brief Get the index of the first available vcs_client_peer. - * - * @retval Index if success. - * @retval -ENOMEM if no available indexes. - */ -static int vcs_client_peer_index_free_get(void) -{ - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] == NULL) { - return i; - } - } - - LOG_WRN("No more indexes for VCS peer clients"); - - return -ENOMEM; -} - -/** - * @brief Check if the given @p conn has a vcs_client_peer pointer. - * - * @param[in] conn The connection pointer to be checked. - * - * @retval True if vcs_client_peer exists. - * @retval False otherwise. - */ -static bool vcs_client_peer_exists(struct bt_conn *conn) -{ - int ret; - - struct bt_conn *result_conn = NULL; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - ret = bt_vcp_vol_ctlr_conn_get(vcs_client_peer[i], &result_conn); - - if (!ret && conn == result_conn) { - return true; - } - - if (ret == -ENOTCONN) { - /* VCS client no longer connected, free the index */ - vcs_client_peer[i] = NULL; - return false; - } - } - - return false; -} - -/** - * @brief Callback handler for the volume state. - * - * @note This callback handler will be triggered if volume state has changed, - * or the playback was muted or unmuted. - */ -static void vcs_state_ctlr_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t volume, - uint8_t mute) -{ - int ret; - - if (err) { - LOG_ERR("VCS state callback error: %d", err); - return; - } - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs == vcs_client_peer[i]) { - LOG_DBG("VCS state from remote device %d:", i); - continue; - } - - LOG_DBG("Sync with other devices %d", i); - - if (vcs_client_peer[i] == NULL) { - /* Skip */ - continue; - } - - ret = bt_vcp_vol_ctlr_set_vol(vcs_client_peer[i], volume); - if (ret) { - LOG_DBG("Failed to sync volume to remote device %d, err = " - "%d", - i, ret); - } - } -} - -/** - * @brief Callback handler for the VCS controller flags. - * - * @note This callback handler will be triggered if VCS flags changed. - */ -static void vcs_flags_ctlr_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t flags) -{ - if (err) { - LOG_ERR("VCS flag callback error: %d", err); - } else { - LOG_DBG("Volume flags = 0x%01X", flags); - } -} - -/** - * @brief Callback handler for the volume state. - * - * @note This callback handler will be triggered if volume state has changed, - * or the playback was muted or unmuted from the volume_controller. - */ -static void vcs_state_rend_cb_handler(int err, uint8_t volume, uint8_t mute) -{ - int ret; - - if (err) { - LOG_ERR("VCS state callback error: %d", err); - return; - } - LOG_INF("Volume = %d, mute state = %d", volume, mute); - - /* Send to bt_rend */ - ret = bt_rend_volume_set(volume, true); - if (ret) { - LOG_WRN("Failed to set volume"); - } - - if (mute) { - ret = bt_rend_volume_mute(true); - if (ret) { - LOG_WRN("Error muting volume"); - } - } -} - -/** - * @brief Callback handler for the changed VCS renderer flags. - * - * @note This callback handler will be triggered if the VCS flags has changed. - */ -static void vcs_flags_rend_cb_handler(int err, uint8_t flags) -{ - if (err) { - LOG_ERR("VCS flag callback error: %d", err); - } else { - LOG_DBG("Volume flags = 0x%01X", flags); - } -} - -/** - * @brief Callback handler for the finished VCS discovery. - * - * @note This callback handler will be triggered when the VCS discovery has finished. - */ -static void vcs_discover_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t vocs_count, - uint8_t aics_count) -{ - if (err) { - LOG_WRN("VCS discover finished callback error: %d", err); - } else { - LOG_INF("VCS discover finished"); - } -} - -int bt_rend_vol_set(uint8_t volume) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - int ret; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] != NULL) { - ret = bt_vcp_vol_ctlr_set_vol(vcs_client_peer[i], volume); - if (ret) { - LOG_WRN("Failed to set volume for remote channel %d, ret = " - "%d", - i, ret); - } - } - } - - return 0; - } else if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - return bt_vcp_vol_rend_set_vol(volume); - } - - LOG_WRN("VCP not enabled"); - return -EIO; -} - -int bt_rend_vol_up(void) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - int ret; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] != NULL) { - ret = bt_vcp_vol_ctlr_unmute_vol_up(vcs_client_peer[i]); - if (ret) { - LOG_WRN("Failed to volume up for remote channel %d, ret = " - "%d", - i, ret); - } - } - } - - return 0; - } else if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - return bt_vcp_vol_rend_unmute_vol_up(); - } - - LOG_WRN("VCP not enabled"); - return -EIO; -} - -int bt_rend_vol_down(void) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - int ret; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] != NULL) { - ret = bt_vcp_vol_ctlr_unmute_vol_down(vcs_client_peer[i]); - if (ret) { - LOG_WRN("Failed to volume down for remote channel %d, ret " - "= %d", - i, ret); - } - } - } - - return 0; - } else if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - return bt_vcp_vol_rend_unmute_vol_down(); - } - - LOG_WRN("VCP not enabled"); - return -EIO; -} - -int bt_rend_vol_mute(void) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - int ret; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] != NULL) { - ret = bt_vcp_vol_ctlr_mute(vcs_client_peer[i]); - if (ret) { - LOG_WRN("Failed to mute for remote channel %d, ret " - "= %d", - i, ret); - } - } - } - - return 0; - } else if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - return bt_vcp_vol_rend_mute(); - } - - LOG_WRN("VCP not enabled"); - return -EIO; -} - -int bt_rend_vol_unmute(void) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - int ret; - - for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { - if (vcs_client_peer[i] != NULL) { - ret = bt_vcp_vol_ctlr_unmute(vcs_client_peer[i]); - if (ret) { - LOG_WRN("Failed to unmute for remote channel %d, " - "ret = %d", - i, ret); - } - } - } - - return 0; - } else if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - return bt_vcp_vol_rend_unmute(); - } - - LOG_WRN("VCP not enabled"); - return -EIO; -} - -int bt_rend_vol_discover(struct bt_conn *conn) -{ - if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - - int ret, index; - - if (vcs_client_peer_exists(conn)) { - return -EAGAIN; - } - - index = vcs_client_peer_index_free_get(); - if (index < 0) { - return index; - } - - ret = bt_vcp_vol_ctlr_discover(conn, &vcs_client_peer[index]); - return ret; - } - - LOG_ERR("VCP volume controller not enabled"); - return -ECANCELED; -} - -int bt_rend_vol_ctlr_init(void) -{ - if (!IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { - LOG_ERR("VCP volume controller not enabled"); - return -ECANCELED; - } - - static struct bt_vcp_vol_ctlr_cb vcs_client_callback; - - vcs_client_callback.discover = vcs_discover_cb_handler; - vcs_client_callback.state = vcs_state_ctlr_cb_handler; - vcs_client_callback.flags = vcs_flags_ctlr_cb_handler; - - return bt_vcp_vol_ctlr_cb_register(&vcs_client_callback); -} - -int bt_rend_vol_rend_init(void) -{ - if (!IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { - LOG_ERR("VCP volume renderer not enabled"); - return -ECANCELED; - } - - int ret; - struct bt_vcp_vol_rend_register_param vcs_param; - static struct bt_vcp_vol_rend_cb vcs_server_callback; - - vcs_server_callback.state = vcs_state_rend_cb_handler; - vcs_server_callback.flags = vcs_flags_rend_cb_handler; - vcs_param.cb = &vcs_server_callback; - vcs_param.mute = BT_VCP_STATE_UNMUTED; - vcs_param.step = CONFIG_BT_AUDIO_VOL_STEP_SIZE; - vcs_param.volume = CONFIG_BT_AUDIO_VOL_DEFAULT; - - ret = bt_vcp_vol_rend_register(&vcs_param); - if (ret) { - return ret; - } - - return 0; -} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol_internal.h b/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol_internal.h deleted file mode 100644 index 123b76eb5916..000000000000 --- a/applications/nrf5340_audio/src/bluetooth/bt_renderer/volume/bt_rend_vol_internal.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef _BT_REND_VOL_INTERNAL_H_ -#define _BT_REND_VOL_INTERNAL_H_ - -#include - -/** - * @brief Set volume to a specific value. - * - * @param[in] volume The absolute volume to be set. - * - * @retval 0 Volume change success. - * @retval -ENXIO The feature is disabled. - * @retval other Errors from underlying drivers. - */ -int bt_rend_vol_set(uint8_t volume); - -/** - * @brief Turn the volume up by one step. - * - * @retval 0 Volume change success. - * @retval -ENXIO The feature is disabled. - * @retval other Errors from underlying drivers. - */ -int bt_rend_vol_up(void); - -/** - * @brief Turn the volume down by one step. - * - * @retval 0 Volume change success. - * @retval -ENXIO The feature is disabled. - * @retval other Errors from underlying drivers. - */ -int bt_rend_vol_down(void); - -/** - * @brief Mute the output volume of the device. - * - * @retval 0 Volume change success. - * @retval -ENXIO The feature is disabled. - * @retval other Errors from underlying drivers. - */ -int bt_rend_vol_mute(void); - -/** - * @brief Unmute the output volume of the device. - * - * @retval 0 Volume change success. - * @retval -ENXIO The feature is disabled. - * @retval other Errors from underlying drivers. - */ -int bt_rend_vol_unmute(void); - -/** - * @brief Discover Volume Control Service and included services. - * - * @param[in] conn Pointer to the connection on which to discover the services. - * - * @note This function starts a GATT discovery and sets up handles and - * subscriptions for the VCS and included services. - * Call it once before any other actions related to the VCS. - * - * @return 0 for success, error otherwise. - */ -int bt_rend_vol_discover(struct bt_conn *conn); - -/** - * @brief Initialize the Volume Control Service client. - * - * @return 0 for success, error otherwise. - */ -int bt_rend_vol_ctlr_init(void); - -/** - * @brief Initialize the Volume renderer. - * - * @return 0 for success, error otherwise. - */ -int bt_rend_vol_rend_init(void); - -#endif /* _BT_REND_VOL_INTERNAL_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/CMakeLists.txt b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/CMakeLists.txt new file mode 100644 index 000000000000..b7f7ac8c9389 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library_include_directories( + volume +) + +target_sources(app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/bt_rendering_and_capture.c) + +if (CONFIG_BT_VCP_VOL_CTLR AND CONFIG_BT_VCP_VOL_REND) + message(FATAL_ERROR "No support for vol controller and renderer on same device") +endif() + +if (CONFIG_BT_VCP_VOL_REND) +target_sources(app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/volume/bt_vol_rend.c) +endif() + +if (CONFIG_BT_VCP_VOL_CTLR) + target_sources(app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/volume/bt_vol_ctlr.c) +endif() diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/Kconfig new file mode 100644 index 000000000000..e4d526c0d3b9 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/Kconfig @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "BT renderer" + +rsource "volume/Kconfig" + +#----------------------------------------------------------------------------# +menu "Log level" + +module = BT_RENDERING_AND_CAPTURE +module-str = bt-rendering-and-capture +source "subsys/logging/Kconfig.template.log_config" + +endmenu # Log level +endmenu # BT renderer diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.c b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.c new file mode 100644 index 000000000000..3dd388a5a931 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "bt_rendering_and_capture.h" + +#include +#include +#include + +#include "bt_vol_rend_internal.h" +#include "bt_vol_ctlr_internal.h" +#include "nrf5340_audio_common.h" + +#include +LOG_MODULE_REGISTER(bt_r_c, CONFIG_BT_RENDERING_AND_CAPTURE_LOG_LEVEL); + +ZBUS_CHAN_DEFINE(volume_chan, struct volume_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, + ZBUS_MSG_INIT(0)); + +int bt_r_and_c_volume_up(void) +{ + int ret; + struct volume_msg msg; + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { + ret = bt_vol_rend_up(); + return ret; + } + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { + ret = bt_vol_ctlr_up(); + return ret; + } + + msg.event = VOLUME_UP; + + ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); + return ret; +} + +int bt_r_and_c_volume_down(void) +{ + int ret; + struct volume_msg msg; + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { + ret = bt_vol_rend_down(); + return ret; + } + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { + ret = bt_vol_ctlr_down(); + return ret; + } + + msg.event = VOLUME_DOWN; + + ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); + return ret; +} + +int bt_r_and_c_volume_set(uint8_t volume, bool from_vcp) +{ + int ret; + struct volume_msg msg; + + if ((IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) && !from_vcp) { + ret = bt_vol_rend_set(volume); + return ret; + } + + if ((IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) && !from_vcp) { + ret = bt_vol_ctlr_set(volume); + return ret; + } + + msg.event = VOLUME_SET; + msg.volume = volume; + + ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); + return ret; +} + +int bt_r_and_c_volume_mute(bool from_vcp) +{ + int ret; + struct volume_msg msg; + + if ((IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) && !from_vcp) { + ret = bt_vol_rend_mute(); + return ret; + } + + if ((IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) && !from_vcp) { + ret = bt_vol_ctlr_mute(); + return ret; + } + + msg.event = VOLUME_MUTE; + + ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); + return ret; +} + +int bt_r_and_c_volume_unmute(void) +{ + int ret; + struct volume_msg msg; + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { + ret = bt_vol_rend_unmute(); + return ret; + } + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { + ret = bt_vol_ctlr_unmute(); + return ret; + } + + msg.event = VOLUME_UNMUTE; + + ret = zbus_chan_pub(&volume_chan, &msg, K_NO_WAIT); + return ret; +} + +int bt_r_and_c_discover(struct bt_conn *conn) +{ + int ret; + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { + ret = bt_vol_ctlr_discover(conn); + if (ret) { + LOG_WRN("Failed to discover VCS: %d", ret); + return ret; + } + } else { + return -ENOTSUP; + } + + return 0; +} + +int bt_r_and_c_uuid_populate(struct net_buf_simple *uuid_buf) +{ + if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { + if (net_buf_simple_tailroom(uuid_buf) >= BT_UUID_SIZE_16) { + net_buf_simple_add_le16(uuid_buf, BT_UUID_VCS_VAL); + } else { + return -ENOMEM; + } + } else { + return -ENOTSUP; + } + + return 0; +} + +int bt_r_and_c_init(void) +{ + int ret; + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_REND)) { + ret = bt_vol_rend_init(); + + if (ret) { + LOG_WRN("Failed to initialize VCS renderer: %d", ret); + return ret; + } + } + + if (IS_ENABLED(CONFIG_BT_VCP_VOL_CTLR)) { + ret = bt_vol_ctlr_init(); + + if (ret) { + LOG_WRN("Failed to initialize VCS controller: %d", ret); + return ret; + } + } + + return 0; +} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.h b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.h new file mode 100644 index 000000000000..cfefb496efe6 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/bt_rendering_and_capture.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _BT_REND_H_ +#define _BT_REND_H_ + +#include + +/** + * @brief Adjust volume up by one step. + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_volume_up(void); + +/** + * @brief Adjust volume down by one step. + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_volume_down(void); + +/** + * @brief Set the volume to the given @p volume value. + * + * @param[in] volume Value to set the volume to (0-255). + * @param[in] from_vcp Describe if the function was called from a service + * or from somewhere else (buttons, shell, etc). + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_volume_set(uint8_t volume, bool from_vcp); + +/** + * @brief Mute the volume. + * + * @param[in] from_vcp Describe if the function was called from a service + * or from somewhere else (buttons, shell, etc). + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_volume_mute(bool from_vcp); + +/** + * @brief Unmute the volume. + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_volume_unmute(void); + +/** + * @brief Discover the rendering services. + * + * @param[in] conn Pointer to the connection on which to do the discovery. + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_discover(struct bt_conn *conn); + +/** + * @brief Put the UUIDs from this module into the buffer. + * + * @note This partial data is used to build a complete extended advertising packet. + * + * @param[out] uuid_buf Buffer being populated with UUIDs. + * + * @return 0 for success, error otherwise. + */ +int bt_r_and_c_uuid_populate(struct net_buf_simple *uuid_buf); + +/** + * @brief Initialize the rendering services or profiles, or both. + * + * @return 0 if success, error otherwise. + */ +int bt_r_and_c_init(void); + +#endif /* _BT_REND_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/Kconfig new file mode 100644 index 000000000000..35306eb08f7a --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/Kconfig @@ -0,0 +1,29 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "Volume" + +config BT_AUDIO_VOL_DEFAULT + int "Default volume" + range 0 255 + default 195 + help + The default volume when starting a volume control renderer. + +config BT_AUDIO_VOL_STEP_SIZE + int "Volume adjust step size" + range 6 32 + default 16 + +#----------------------------------------------------------------------------# +menu "Log level" + +module = BT_VOL +module-str = bt-vol +source "subsys/logging/Kconfig.template.log_config" + +endmenu # Log level +endmenu # Volume diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr.c b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr.c new file mode 100644 index 000000000000..1024c5ffa3af --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr.c @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "bt_vol_ctlr_internal.h" + +#include +#include +#include +#include + +#include "macros_common.h" +#include "bt_rendering_and_capture.h" + +#include +LOG_MODULE_REGISTER(bt_vol_ctlr, CONFIG_BT_VOL_LOG_LEVEL); + +static struct bt_vcp_vol_ctlr *vcs_client_peer[CONFIG_BT_MAX_CONN]; + +/** + * @brief Get the index of the first available vcs_client_peer. + * + * @retval Index if success. + * @retval -ENOMEM if no available indexes. + */ +static int vcs_client_peer_index_free_get(void) +{ + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] == NULL) { + return i; + } + } + + LOG_WRN("No more indexes for VCS peer clients"); + + return -ENOMEM; +} + +/** + * @brief Check if the given @p conn has a vcs_client_peer pointer. + * + * @param[in] conn The connection pointer to be checked. + * + * @retval True if vcs_client_peer exists. + * @retval False otherwise. + */ +static bool vcs_client_peer_exists(struct bt_conn *conn) +{ + int ret; + + struct bt_conn *result_conn = NULL; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + ret = bt_vcp_vol_ctlr_conn_get(vcs_client_peer[i], &result_conn); + + if (!ret && conn == result_conn) { + return true; + } + + if (ret == -ENOTCONN) { + /* VCS client no longer connected, free the index */ + vcs_client_peer[i] = NULL; + return false; + } + } + + return false; +} + +/** + * @brief Callback handler for the volume state. + * + * @note This callback handler will be triggered if volume state has changed, + * or the playback was muted or unmuted. + */ +static void vcs_state_ctlr_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t volume, + uint8_t mute) +{ + int ret; + + if (err) { + LOG_ERR("VCS state callback error: %d", err); + return; + } + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs == vcs_client_peer[i]) { + LOG_DBG("VCS state from remote device %d:", i); + continue; + } + + LOG_DBG("Sync with other devices %d", i); + + if (vcs_client_peer[i] == NULL) { + /* Skip */ + continue; + } + + ret = bt_vcp_vol_ctlr_set_vol(vcs_client_peer[i], volume); + if (ret) { + LOG_DBG("Failed to sync volume to remote device %d, err = " + "%d", + i, ret); + } + } +} + +/** + * @brief Callback handler for the VCS controller flags. + * + * @note This callback handler will be triggered if VCS flags changed. + */ +static void vcs_flags_ctlr_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t flags) +{ + if (err) { + LOG_ERR("VCS flag callback error: %d", err); + } else { + LOG_DBG("Volume flags = 0x%01X", flags); + } +} + +/** + * @brief Callback handler for the finished VCS discovery. + * + * @note This callback handler will be triggered when the VCS discovery has finished. + */ +static void vcs_discover_cb_handler(struct bt_vcp_vol_ctlr *vcs, int err, uint8_t vocs_count, + uint8_t aics_count) +{ + if (err) { + LOG_WRN("VCS discover finished callback error: %d", err); + } else { + LOG_INF("VCS discover finished"); + } +} + +int bt_vol_ctlr_set(uint8_t volume) +{ + int ret; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] != NULL) { + ret = bt_vcp_vol_ctlr_set_vol(vcs_client_peer[i], volume); + if (ret) { + LOG_WRN("Failed to set volume for remote channel %d, ret = " + "%d", + i, ret); + } + } + } + + return 0; +} + +int bt_vol_ctlr_up(void) +{ + int ret; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] != NULL) { + ret = bt_vcp_vol_ctlr_unmute_vol_up(vcs_client_peer[i]); + if (ret) { + LOG_WRN("Failed to volume up for remote channel %d, ret = " + "%d", + i, ret); + } + } + } + + return 0; +} + +int bt_vol_ctlr_down(void) +{ + int ret; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] != NULL) { + ret = bt_vcp_vol_ctlr_unmute_vol_down(vcs_client_peer[i]); + if (ret) { + LOG_WRN("Failed to volume down for remote channel %d, ret " + "= %d", + i, ret); + } + } + } + + return 0; +} + +int bt_vol_ctlr_mute(void) +{ + int ret; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] != NULL) { + ret = bt_vcp_vol_ctlr_mute(vcs_client_peer[i]); + if (ret) { + LOG_WRN("Failed to mute for remote channel %d, ret " + "= %d", + i, ret); + } + } + } + + return 0; +} + +int bt_vol_ctlr_unmute(void) +{ + + int ret; + + for (int i = 0; i < ARRAY_SIZE(vcs_client_peer); i++) { + if (vcs_client_peer[i] != NULL) { + ret = bt_vcp_vol_ctlr_unmute(vcs_client_peer[i]); + if (ret) { + LOG_WRN("Failed to unmute for remote channel %d, " + "ret = %d", + i, ret); + } + } + } + + return 0; +} + +int bt_vol_ctlr_discover(struct bt_conn *conn) +{ + + int ret, index; + + if (vcs_client_peer_exists(conn)) { + return -EAGAIN; + } + + index = vcs_client_peer_index_free_get(); + if (index < 0) { + return index; + } + + ret = bt_vcp_vol_ctlr_discover(conn, &vcs_client_peer[index]); + return ret; +} + +int bt_vol_ctlr_init(void) +{ + static struct bt_vcp_vol_ctlr_cb vcs_client_callback; + + vcs_client_callback.discover = vcs_discover_cb_handler; + vcs_client_callback.state = vcs_state_ctlr_cb_handler; + vcs_client_callback.flags = vcs_flags_ctlr_cb_handler; + + return bt_vcp_vol_ctlr_cb_register(&vcs_client_callback); +} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr_internal.h b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr_internal.h new file mode 100644 index 000000000000..cab34789b565 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_ctlr_internal.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _BT_VOL_CTLR_INTERNAL_H_ +#define _BT_VOL_CTLR_INTERNAL_H_ + +#include + +/** + * @brief Set volume to a specific value. + * + * @param[in] volume The absolute volume to be set. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_ctlr_set(uint8_t volume); + +/** + * @brief Turn the volume up by one step. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_ctlr_up(void); + +/** + * @brief Turn the volume down by one step. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_ctlr_down(void); + +/** + * @brief Mute the output volume of the device. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_ctlr_mute(void); + +/** + * @brief Unmute the output volume of the device. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_ctlr_unmute(void); + +/** + * @brief Discover Volume Control Service and included services. + * + * @param[in] conn Pointer to the connection on which to discover the services. + * + * @note This function starts a GATT discovery and sets up handles and + * subscriptions for the VCS and included services. + * Call it once before any other actions related to the VCS. + * + * @return 0 for success, error otherwise. + */ +int bt_vol_ctlr_discover(struct bt_conn *conn); + +/** + * @brief Initialize the Volume Control Service client. + * + * @return 0 for success, error otherwise. + */ +int bt_vol_ctlr_init(void); + +#endif /* _BT_VOL_CTLR_INTERNAL_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend.c b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend.c new file mode 100644 index 000000000000..3954365997e8 --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "bt_vol_rend_internal.h" + +#include +#include +#include +#include + +#include "macros_common.h" +#include "bt_rendering_and_capture.h" + +#include +LOG_MODULE_REGISTER(bt_vol_rend, CONFIG_BT_VOL_LOG_LEVEL); + +/** + * @brief Callback handler for the volume state. + * + * @note This callback handler will be triggered if volume state has changed, + * or the playback was muted or unmuted from the volume_controller. + */ +static void vcs_state_rend_cb_handler(int err, uint8_t volume, uint8_t mute) +{ + int ret; + + if (err) { + LOG_ERR("VCS state callback error: %d", err); + return; + } + LOG_INF("Volume = %d, mute state = %d", volume, mute); + + /* Send to bt_rend */ + ret = bt_r_and_c_volume_set(volume, true); + if (ret) { + LOG_WRN("Failed to set volume"); + } + + if (mute) { + ret = bt_r_and_c_volume_mute(true); + if (ret) { + LOG_WRN("Error muting volume"); + } + } +} + +/** + * @brief Callback handler for the changed VCS renderer flags. + * + * @note This callback handler will be triggered if the VCS flags has changed. + */ +static void vcs_flags_rend_cb_handler(int err, uint8_t flags) +{ + if (err) { + LOG_ERR("VCS flag callback error: %d", err); + } else { + LOG_DBG("Volume flags = 0x%01X", flags); + } +} + +int bt_vol_rend_set(uint8_t volume) +{ + + return bt_vcp_vol_rend_set_vol(volume); +} + +int bt_vol_rend_up(void) +{ + return bt_vcp_vol_rend_unmute_vol_up(); +} + +int bt_vol_rend_down(void) +{ + + return bt_vcp_vol_rend_unmute_vol_down(); +} + +int bt_vol_rend_mute(void) +{ + return bt_vcp_vol_rend_mute(); +} + +int bt_vol_rend_unmute(void) +{ + return bt_vcp_vol_rend_unmute(); +} + +int bt_vol_rend_init(void) +{ + int ret; + struct bt_vcp_vol_rend_register_param vcs_param; + static struct bt_vcp_vol_rend_cb vcs_server_callback; + + vcs_server_callback.state = vcs_state_rend_cb_handler; + vcs_server_callback.flags = vcs_flags_rend_cb_handler; + vcs_param.cb = &vcs_server_callback; + vcs_param.mute = BT_VCP_STATE_UNMUTED; + vcs_param.step = CONFIG_BT_AUDIO_VOL_STEP_SIZE; + vcs_param.volume = CONFIG_BT_AUDIO_VOL_DEFAULT; + + ret = bt_vcp_vol_rend_register(&vcs_param); + if (ret) { + return ret; + } + + return 0; +} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend_internal.h b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend_internal.h new file mode 100644 index 000000000000..cdbd1f81b2da --- /dev/null +++ b/applications/nrf5340_audio/src/bluetooth/bt_rendering_and_capture/volume/bt_vol_rend_internal.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _BT_VOL_REND_INTERNAL_H_ +#define _BT_VOL_REND_INTERNAL_H_ + +#include +/** + * @brief Set volume to a specific value. + * + * @param[in] volume The absolute volume to be set. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_rend_set(uint8_t volume); + +/** + * @brief Turn the volume up by one step. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_rend_up(void); + +/** + * @brief Turn the volume down by one step. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_rend_down(void); + +/** + * @brief Mute the output volume of the device. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_rend_mute(void); + +/** + * @brief Unmute the output volume of the device. + * + * @retval 0 Volume change success. + * @retval -ENXIO The feature is disabled. + * @retval other Errors from underlying drivers. + */ +int bt_vol_rend_unmute(void); + +/** + * @brief Initialize the Volume renderer. + * + * @return 0 for success, error otherwise. + */ +int bt_vol_rend_init(void); + +#endif /* _BT_VOL_REND_INTERNAL_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/Kconfig index 8b6de8beefe6..34ac24170991 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/Kconfig @@ -30,13 +30,6 @@ config BT_BAP_BROADCAST_16_2_1 Broadcast mandatory codec capability 16_2_1. 16kHz, 32kbps, 2 retransmits, 10ms transport latency, and 40ms presentation delay. -config BT_BAP_BROADCAST_24_2_1 - bool "24_2_1" - depends on TRANSPORT_BIS - help - Broadcast codec capability 24_2_1. - 24kHz, 48kbps, 2 retransmits, 10ms transport latency, and 40ms presentation delay. - config BT_BAP_BROADCAST_16_2_2 bool "16_2_2" depends on TRANSPORT_BIS @@ -44,12 +37,62 @@ config BT_BAP_BROADCAST_16_2_2 Broadcast mandatory codec capability 16_2_2. 16kHz, 32kbps, 4 retransmits, 60ms transport latency, and 40ms presentation delay. +config BT_BAP_BROADCAST_24_2_1 + bool "24_2_1" + depends on TRANSPORT_BIS + help + Broadcast codec capability 24_2_1. + 24kHz, 48kbps, 2 retransmits, 10ms transport latency, and 40ms presentation delay. + config BT_BAP_BROADCAST_24_2_2 bool "24_2_2" depends on TRANSPORT_BIS help Broadcast codec capability 24_2_2. 24kHz, 48kbps, 4 retransmits, 60ms transport latency, and 40ms presentation delay. + +config BT_BAP_BROADCAST_48_2_1 + bool "48_2_1" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_2_1. + 48kHz, 80kbps, 4 retransmits, 20ms transport latency, and 40ms presentation delay. + +config BT_BAP_BROADCAST_48_2_2 + bool "48_2_2" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_2_2. + 48kHz, 80kbps, 4 retransmits, 65ms transport latency, and 40ms presentation delay. + +config BT_BAP_BROADCAST_48_4_1 + bool "48_4_1" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_4_1. + 48kHz, 96kbps, 4 retransmits, 20ms transport latency, and 40ms presentation delay. + +config BT_BAP_BROADCAST_48_4_2 + bool "48_4_2" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_4_2. + 48kHz, 96kbps, 4 retransmits, 65ms transport latency, and 40ms presentation delay. + + +config BT_BAP_BROADCAST_48_6_1 + bool "48_6_1" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_6_1. + 48kHz, 124kbps, 4 retransmits, 20ms transport latency, and 40ms presentation delay. + +config BT_BAP_BROADCAST_48_6_2 + bool "48_6_2" + depends on TRANSPORT_BIS + help + Broadcast codec capability 48_6_2. + 48kHz, 124kbps, 4 retransmits, 65ms transport latency, and 40ms presentation delay. endchoice config BT_AUDIO_BROADCAST_NAME @@ -149,6 +192,9 @@ config BT_AUDIO_BITRATE_BROADCAST_SRC default 96000 if BT_AUDIO_BROADCAST_CONFIGURABLE default 32000 if BT_BAP_BROADCAST_16_2_1 || BT_BAP_BROADCAST_16_2_2 default 48000 if BT_BAP_BROADCAST_24_2_1 || BT_BAP_BROADCAST_24_2_2 + default 80000 if BT_BAP_BROADCAST_48_2_1 || BT_BAP_BROADCAST_48_2_2 + default 96000 if BT_BAP_BROADCAST_48_4_1 || BT_BAP_BROADCAST_48_4_2 + default 124000 if BT_BAP_BROADCAST_48_6_1 || BT_BAP_BROADCAST_48_6_2 help Bitrate for the broadcast source ISO stream. diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c index bf253e8bb138..adf3d31984cb 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c @@ -63,9 +63,9 @@ static uint8_t active_stream_index; static struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3( BT_AUDIO_CODEC_CAPABILIY_FREQ, - (BT_AUDIO_CODEC_LC3_DURATION_10 | BT_AUDIO_CODEC_LC3_DURATION_PREFER_10), - BT_AUDIO_CODEC_LC3_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), - LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX), 1u, BT_AUDIO_CONTEXT_TYPE_MEDIA); + (BT_AUDIO_CODEC_CAP_DURATION_10 | BT_AUDIO_CODEC_CAP_DURATION_PREFER_10), + BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), + LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX), 1u, BT_AUDIO_CONTEXT_TYPE_ANY); static struct bt_pacs_cap capabilities = { .codec_cap = &codec_cap, @@ -128,17 +128,13 @@ static void le_audio_event_publish(enum le_audio_evt_type event) static void print_codec(const struct audio_codec_info *codec) { - if (codec->id == BT_HCI_CODING_FORMAT_LC3) { - LOG_INF("Codec config for LC3:"); - LOG_INF("\tFrequency: %d Hz", codec->frequency); - LOG_INF("\tFrame Duration: %d us", codec->frame_duration_us); - LOG_INF("\tOctets per frame: %d (%d kbps)", codec->octets_per_sdu, codec->bitrate); - LOG_INF("\tFrames per SDU: %d", codec->blocks_per_sdu); - if (codec->chan_allocation >= 0) { - LOG_INF("\tChannel allocation: 0x%x", codec->chan_allocation); - } - } else { - LOG_WRN("Codec is not LC3, codec_id: 0x%2hhx", codec->id); + LOG_INF("Codec config for LC3:"); + LOG_INF("\tFrequency: %d Hz", codec->frequency); + LOG_INF("\tFrame Duration: %d us", codec->frame_duration_us); + LOG_INF("\tOctets per frame: %d (%d kbps)", codec->octets_per_sdu, codec->bitrate); + LOG_INF("\tFrames per SDU: %d", codec->blocks_per_sdu); + if (codec->chan_allocation >= 0) { + LOG_INF("\tChannel allocation: 0x%x", codec->chan_allocation); } } @@ -147,74 +143,38 @@ static void get_codec_info(const struct bt_audio_codec_cfg *codec, { int ret; - if (codec->id == BT_HCI_CODING_FORMAT_LC3) { - /* LC3 uses the generic LTV format - other codecs might do as well */ - LOG_DBG("Retrieve the codec configuration for LC3"); - codec_info->id = codec->id; - codec_info->cid = codec->cid; - codec_info->vid = codec->vid; - - ret = le_audio_freq_hz_get(codec, &codec_info->frequency); - if (ret) { - LOG_ERR("Error retrieving sampling frequency: %d", ret); - return; - } - - ret = le_audio_duration_us_get(codec, &codec_info->frame_duration_us); - if (ret) { - LOG_ERR("Error retrieving frame duration: %d", ret); - return; - } - - ret = bt_audio_codec_cfg_get_chan_allocation(codec, &codec_info->chan_allocation); - if (ret) { - LOG_ERR("Error retrieving channel allocation: %d", ret); - return; - } - - ret = le_audio_octets_per_frame_get(codec, &codec_info->octets_per_sdu); - if (ret) { - LOG_ERR("Error retrieving octets per frame: %d", ret); - return; - } - - ret = le_audio_bitrate_get(codec, &codec_info->bitrate); - if (ret) { - LOG_ERR("Error calculating bitrate: %d", ret); - return; - } + ret = le_audio_freq_hz_get(codec, &codec_info->frequency); + if (ret) { + LOG_DBG("Failed retrieving sampling frequency: %d", ret); + } - ret = le_audio_frame_blocks_per_sdu_get(codec, &codec_info->blocks_per_sdu); - if (codec_info->octets_per_sdu < 0) { - LOG_ERR("Error retrieving frame blocks per SDU: %d", - codec_info->octets_per_sdu); - return; - } - } else { - LOG_WRN("Codec is not LC3, codec_id: 0x%2hhx", codec->id); + ret = le_audio_duration_us_get(codec, &codec_info->frame_duration_us); + if (ret) { + LOG_DBG("Failed retrieving frame duration: %d", ret); } -} -static bool bitrate_check(const struct bt_audio_codec_cfg *codec) -{ - int ret; - uint32_t octets_per_sdu; + ret = bt_audio_codec_cfg_get_chan_allocation(codec, &codec_info->chan_allocation); + if (ret == -ENODATA) { + /* Codec channel allocation not set, defaulting to 0 */ + codec_info->chan_allocation = 0; + } else if (ret) { + LOG_DBG("Failed retrieving channel allocation: %d", ret); + } - ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); + ret = le_audio_octets_per_frame_get(codec, &codec_info->octets_per_sdu); if (ret) { - LOG_ERR("Error retrieving octets per frame: %d", ret); - return false; + LOG_DBG("Failed retrieving octets per frame: %d", ret); } - if (octets_per_sdu < LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN)) { - LOG_WRN("Bitrate too low"); - return false; - } else if (octets_per_sdu > LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX)) { - LOG_WRN("Bitrate too high"); - return false; + ret = le_audio_bitrate_get(codec, &codec_info->bitrate); + if (ret) { + LOG_DBG("Failed calculating bitrate: %d", ret); } - return true; + ret = le_audio_frame_blocks_per_sdu_get(codec, &codec_info->blocks_per_sdu); + if (codec_info->octets_per_sdu < 0) { + LOG_DBG("Failed retrieving frame blocks per SDU: %d", codec_info->octets_per_sdu); + } } static void stream_started_cb(struct bt_bap_stream *stream) @@ -252,6 +212,10 @@ static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) break; + case BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL: + LOG_INF("MIC fail. The encryption key may be wrong"); + break; + default: LOG_WRN("Unhandled reason: %d", reason); @@ -286,96 +250,134 @@ static struct bt_bap_stream_ops stream_ops = { .recv = stream_recv_cb, }; -static bool parse_cb(struct bt_data *data, void *codec) +static bool base_subgroup_bis_cb(const struct bt_bap_base_subgroup_bis *bis, void *user_data) { - if (data->type == BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC) { - ((struct audio_codec_info *)codec)->chan_allocation = sys_get_le32(data->data); - return false; + int ret; + struct bt_audio_codec_cfg codec_cfg = {0}; + + LOG_DBG("BIS found, index %d", bis->index); + + ret = bt_bap_base_subgroup_bis_codec_to_codec_cfg(bis, &codec_cfg); + if (ret != 0) { + LOG_WRN("Could not find codec configuration for BIS index %d, ret " + "= %d", + bis->index, ret); + return true; + } + + get_codec_info(&codec_cfg, &audio_codec_info[bis->index - 1]); + + LOG_DBG("Channel allocation: 0x%x for BIS index %d", + audio_codec_info[bis->index - 1].chan_allocation, bis->index); + + uint32_t chan_bitfield = audio_codec_info[bis->index - 1].chan_allocation; + bool single_bit = (chan_bitfield & (chan_bitfield - 1)) == 0; + + if (single_bit) { + bis_index_bitfields[bis->index - 1] = BIT(bis->index); + } else { + LOG_WRN("More than one bit set in channel location, we only support 1 channel per " + "BIS"); } return true; } -/** - * @brief Function which overwrites BIS specific codec information. - * I.e. level 3 specific information overwrites general level 2 information. - * - * @note This will change when new host APIs are available. - * - * @return 0 for success, error otherwise. - */ -static int bis_specific_codec_config(struct bt_bap_base_bis_data bis_data, - struct audio_codec_info *codec) +static bool base_subgroup_cb(const struct bt_bap_base_subgroup *subgroup, void *user_data) { int ret; + int bis_num; + struct bt_audio_codec_cfg codec_cfg = {0}; + struct bt_bap_base_codec_id codec_id; + bool *suitable_stream_found = user_data; - ret = bt_audio_data_parse(bis_data.data, bis_data.data_len, parse_cb, codec); - if (ret && ret != -ECANCELED) { - LOG_WRN("Could not overwrite BIS specific codec info: %d", ret); - return -ENXIO; + ret = bt_bap_base_subgroup_codec_to_codec_cfg(subgroup, &codec_cfg); + if (ret) { + LOG_WRN("Failed to convert codec to codec_cfg: %d", ret); + return true; } - return 0; + ret = bt_bap_base_get_subgroup_codec_id(subgroup, &codec_id); + if (ret && codec_id.cid != BT_HCI_CODING_FORMAT_LC3) { + LOG_WRN("Failed to get codec ID or codec ID is not supported: %d", ret); + return true; + } + + ret = le_audio_bitrate_check(&codec_cfg); + if (!ret) { + LOG_WRN("Bitrate check failed"); + return true; + } + + ret = le_audio_freq_check(&codec_cfg); + if (!ret) { + LOG_WRN("Sample rate not supported"); + return true; + } + + bis_num = bt_bap_base_get_subgroup_bis_count(subgroup); + LOG_DBG("Subgroup %p has %d BISes", (void *)subgroup, bis_num); + if (bis_num > 0) { + *suitable_stream_found = true; + sync_stream_cnt = bis_num; + for (int i = 0; i < bis_num; i++) { + get_codec_info(&codec_cfg, &audio_codec_info[i]); + } + + ret = bt_bap_base_subgroup_foreach_bis(subgroup, base_subgroup_bis_cb, NULL); + if (ret < 0) { + LOG_WRN("Could not get BIS for subgroup %p: %d", (void *)subgroup, ret); + } + return false; + } + + return true; } -static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap_base *base) +static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap_base *base, + size_t base_size) { + int ret; bool suitable_stream_found = false; if (init_routine_completed) { return; } - LOG_DBG("Received BASE with %zu subgroup(s) from broadcast sink", base->subgroup_count); - sync_stream_cnt = 0; - /* Search each subgroup for the BIS of interest */ - for (int i = 0; i < base->subgroup_count; i++) { - for (int j = 0; j < base->subgroups[i].bis_count; j++) { - const uint8_t index = base->subgroups[i].bis_data[j].index; - - LOG_DBG("Subgroup: %d BIS: %d index = %d", i, j, index); - - if (bitrate_check(&base->subgroups[i].codec_cfg)) { - suitable_stream_found = true; - - bis_index_bitfields[sync_stream_cnt] = BIT(index); - - /* Get general (level 2) codec config from the subgroup */ - audio_streams[sync_stream_cnt].codec_cfg = - (struct bt_audio_codec_cfg *)&base->subgroups[i].codec_cfg; - get_codec_info(audio_streams[sync_stream_cnt].codec_cfg, - &audio_codec_info[sync_stream_cnt]); + uint32_t subgroup_count = bt_bap_base_get_subgroup_count(base); - /* Overwrite codec config with level 3 BIS specific codec config. - * For now, this is only done for channel allocation - */ - (void)bis_specific_codec_config(base->subgroups[i].bis_data[j], - &audio_codec_info[sync_stream_cnt]); + LOG_DBG("Received BASE with %d subgroup(s) from broadcast sink", subgroup_count); - LOG_DBG("Stream %d in subgroup %d from broadcast sink", - sync_stream_cnt, i); - - sync_stream_cnt += 1; - if (sync_stream_cnt >= ARRAY_SIZE(audio_streams)) { - break; - } - } - } - - if (sync_stream_cnt >= ARRAY_SIZE(audio_streams)) { - break; - } + ret = bt_bap_base_foreach_subgroup(base, base_subgroup_cb, &suitable_stream_found); + if (ret != 0 && ret != -ECANCELED) { + LOG_WRN("Failed to parse subgroups: %d", ret); + return; } if (suitable_stream_found) { /* Set the initial active stream based on the defined channel of the device */ channel_assignment_get((enum audio_channel *)&active_stream_index); + + /** If the stream matching channel is not present, revert back to first BIS, e.g. + * mono stream but channel assignment is RIGHT + */ + if ((active_stream_index + 1) > sync_stream_cnt) { + LOG_WRN("BIS index: %d not found, reverting to first BIS", + (active_stream_index + 1)); + active_stream_index = 0; + } + active_stream.stream = &audio_streams[active_stream_index]; active_stream.codec = &audio_codec_info[active_stream_index]; - active_stream.pd = base->pd; - + ret = bt_bap_base_get_pres_delay(base); + if (ret == -EINVAL) { + LOG_WRN("Failed to get pres_delay: %d", ret); + active_stream.pd = 0; + } else { + active_stream.pd = ret; + } le_audio_event_publish(LE_AUDIO_EVT_CONFIG_RECEIVED); LOG_DBG("Channel %s active", @@ -387,7 +389,7 @@ static void base_recv_cb(struct bt_bap_broadcast_sink *sink, const struct bt_bap } } -static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) +static void syncable_cb(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo) { int ret; static uint8_t bis_encryption_key[BT_ISO_BROADCAST_CODE_SIZE] = {0}; @@ -413,9 +415,6 @@ static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) return; } - /* NOTE: The string below is used by the Nordic CI system */ - LOG_INF("Syncing to broadcast stream index %d", active_stream_index); - if (bis_index_bitfields[active_stream_index] == 0) { LOG_ERR("No bits set in bitfield"); return; @@ -425,6 +424,9 @@ static void syncable_cb(struct bt_bap_broadcast_sink *sink, bool encrypted) return; } + /* NOTE: The string below is used by the Nordic CI system */ + LOG_INF("Syncing to broadcast stream index %d", active_stream_index); + ret = bt_bap_broadcast_sink_sync(broadcast_sink, bis_index_bitfields[active_stream_index], audio_streams_p, bis_encryption_key); diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.c index 9c72638f94f8..36edc1a10ae6 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.c @@ -19,6 +19,7 @@ #include "macros_common.h" #include "bt_le_audio_tx.h" +#include "le_audio.h" #include "nrf5340_audio_common.h" #include @@ -33,40 +34,6 @@ BUILD_ASSERT(CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT <= 2, ZBUS_CHAN_DEFINE(le_audio_chan, struct le_audio_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, ZBUS_MSG_INIT(0)); -#if CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE -#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ - BT_BAP_LC3_PRESET_CONFIGURABLE( \ - BT_AUDIO_LOCATION_FRONT_LEFT | BT_AUDIO_LOCATION_FRONT_RIGHT, \ - BT_AUDIO_CONTEXT_TYPE_MEDIA, CONFIG_BT_AUDIO_BITRATE_BROADCAST_SRC) - -#elif CONFIG_BT_BAP_BROADCAST_16_2_1 -#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ - BT_BAP_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT, \ - BT_AUDIO_CONTEXT_TYPE_MEDIA) - -#elif CONFIG_BT_BAP_BROADCAST_24_2_1 -#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ - BT_BAP_LC3_BROADCAST_PRESET_24_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT, \ - BT_AUDIO_CONTEXT_TYPE_MEDIA) - -#elif CONFIG_BT_BAP_BROADCAST_16_2_2 -#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ - BT_BAP_LC3_BROADCAST_PRESET_16_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT, \ - BT_AUDIO_CONTEXT_TYPE_MEDIA) - -#elif CONFIG_BT_BAP_BROADCAST_24_2_2 -#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ - BT_BAP_LC3_BROADCAST_PRESET_24_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ - BT_AUDIO_LOCATION_FRONT_RIGHT, \ - BT_AUDIO_CONTEXT_TYPE_MEDIA) - -#else -#error Unsupported LC3 codec preset for broadcast -#endif /* CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE */ - static struct bt_cap_broadcast_source *broadcast_source; static struct bt_cap_stream cap_streams[CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT]; static struct bt_bap_lc3_preset lc3_preset = BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO; @@ -74,14 +41,16 @@ static struct bt_le_ext_adv *adv; static bool initialized; static bool delete_broadcast_src; +uint8_t audio_mapping_mask[CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT] = {UINT8_MAX}; + #if (CONFIG_AURACAST) /* Make sure pba_buf is large enough for a 16bit UUID and meta data * (any addition to pba_buf requires an increase of this value) */ NET_BUF_SIMPLE_DEFINE(pba_buf, BT_UUID_SIZE_16 + 8); -static struct bt_data ext_ad[4]; +static struct bt_data ext_ad[5]; #else -static struct bt_data ext_ad[3]; +static struct bt_data ext_ad[4]; #endif /* (CONFIG_AURACAST) */ static struct bt_data per_ad[1]; @@ -130,6 +99,8 @@ static void stream_started_cb(struct bt_bap_stream *stream) /* NOTE: The string below is used by the Nordic CI system */ LOG_INF("Broadcast source %p started", (void *)stream); + + le_audio_print_codec(stream->codec_cfg, BT_AUDIO_DIR_SOURCE); } static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) @@ -181,10 +152,9 @@ static void public_broadcast_features_set(uint8_t *features) *features |= 0x01; } - if (freq == BT_AUDIO_CODEC_CONFIG_LC3_FREQ_16KHZ || - freq == BT_AUDIO_CODEC_CONFIG_LC3_FREQ_24KHZ) { + if (freq == BT_AUDIO_CODEC_CFG_FREQ_16KHZ || freq == BT_AUDIO_CODEC_CFG_FREQ_24KHZ) { *features |= 0x02; - } else if (freq == BT_AUDIO_CODEC_CONFIG_LC3_FREQ_48KHZ) { + } else if (freq == BT_AUDIO_CODEC_CFG_FREQ_48KHZ) { *features |= 0x04; } else { LOG_WRN("%dkHz is not compatible with Auracast, choose 16kHz, 24kHz or 48kHz", @@ -202,9 +172,17 @@ static int adv_create(void) NET_BUF_SIMPLE_DEFINE_STATIC(brdcst_id_buf, BT_UUID_SIZE_16 + BT_AUDIO_BROADCAST_ID_SIZE); /* Buffer for Appearance */ NET_BUF_SIMPLE_DEFINE_STATIC(brdcst_appearance_buf, BT_UUID_SIZE_16); + /* Buffer for manufacturer ID */ + NET_BUF_SIMPLE_DEFINE_STATIC(manufacturer_id_buf, BT_UUID_SIZE_16); /* Buffer for Public Broadcast Announcement */ NET_BUF_SIMPLE_DEFINE_STATIC(base_buf, 128); + net_buf_simple_add_le16(&manufacturer_id_buf, CONFIG_BT_DEVICE_MANUFACTURER_ID); + + ext_ad[0].data_len = manufacturer_id_buf.len; + ext_ad[0].type = BT_DATA_UUID16_SOME; + ext_ad[0].data = manufacturer_id_buf.data; + if (IS_ENABLED(CONFIG_BT_AUDIO_USE_BROADCAST_ID_RANDOM)) { ret = bt_cap_initiator_broadcast_get_id(broadcast_source, &broadcast_id); if (ret) { @@ -216,11 +194,11 @@ static int adv_create(void) } if (IS_ENABLED(CONFIG_BT_AUDIO_USE_BROADCAST_NAME_ALT)) { - ext_ad[0] = (struct bt_data)BT_DATA(BT_DATA_BROADCAST_NAME, + ext_ad[1] = (struct bt_data)BT_DATA(BT_DATA_BROADCAST_NAME, CONFIG_BT_AUDIO_BROADCAST_NAME_ALT, sizeof(CONFIG_BT_AUDIO_BROADCAST_NAME_ALT) - 1); } else { - ext_ad[0] = (struct bt_data)BT_DATA(BT_DATA_BROADCAST_NAME, + ext_ad[1] = (struct bt_data)BT_DATA(BT_DATA_BROADCAST_NAME, CONFIG_BT_AUDIO_BROADCAST_NAME, sizeof(CONFIG_BT_AUDIO_BROADCAST_NAME) - 1); } @@ -229,15 +207,15 @@ static int adv_create(void) net_buf_simple_add_le16(&brdcst_id_buf, BT_UUID_BROADCAST_AUDIO_VAL); net_buf_simple_add_le24(&brdcst_id_buf, broadcast_id); - ext_ad[1].data_len = brdcst_id_buf.len; - ext_ad[1].type = BT_DATA_SVC_DATA16; - ext_ad[1].data = brdcst_id_buf.data; + ext_ad[2].data_len = brdcst_id_buf.len; + ext_ad[2].type = BT_DATA_SVC_DATA16; + ext_ad[2].data = brdcst_id_buf.data; net_buf_simple_add_le16(&brdcst_appearance_buf, CONFIG_BT_DEVICE_APPEARANCE); - ext_ad[2].data_len = brdcst_appearance_buf.len; - ext_ad[2].type = BT_DATA_GAP_APPEARANCE; - ext_ad[2].data = brdcst_appearance_buf.data; + ext_ad[3].data_len = brdcst_appearance_buf.len; + ext_ad[3].type = BT_DATA_GAP_APPEARANCE; + ext_ad[3].data = brdcst_appearance_buf.data; #if (CONFIG_AURACAST) uint8_t pba_features = 0; @@ -268,9 +246,9 @@ static int adv_create(void) /* If any additional data is to be added, remember to increase NET_BUF size */ - ext_ad[3].data_len = pba_buf.len; - ext_ad[3].type = BT_DATA_SVC_DATA16; - ext_ad[3].data = pba_buf.data; + ext_ad[4].data_len = pba_buf.len; + ext_ad[4].type = BT_DATA_SVC_DATA16; + ext_ad[4].data = pba_buf.data; #endif /* (CONFIG_AURACAST) */ /* Setup periodic advertising data */ @@ -298,7 +276,7 @@ static void bt_audio_codec_allocation_set(uint8_t *data, uint8_t data_len, enum bt_audio_location loc) { data[0] = data_len - 1; - data[1] = BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC; + data[1] = BT_AUDIO_CODEC_CFG_CHAN_ALLOC; sys_put_le32((const uint32_t)loc, &data[2]); } @@ -383,7 +361,8 @@ int broadcast_source_send(struct le_audio_encoded_audio enc_audio) bap_tx_streams[i] = &cap_streams[i].bap_stream; } - ret = bt_le_audio_tx_send(bap_tx_streams, enc_audio, ARRAY_SIZE(cap_streams)); + ret = bt_le_audio_tx_send(bap_tx_streams, audio_mapping_mask, enc_audio, + ARRAY_SIZE(cap_streams)); if (ret) { return ret; } @@ -457,6 +436,7 @@ int broadcast_source_enable(void) /* The channel allocation is set incrementally */ bt_audio_codec_allocation_set(stream_params[i].data, stream_params[i].data_len, BIT(i)); + audio_mapping_mask[i] = i; } /* Create BIGs */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.h b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.h index 90ca20e686c9..e2f14ab9f6ef 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_source.h @@ -9,6 +9,74 @@ #include "bt_le_audio_tx.h" +#if CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_PRESET_CONFIGURABLE( \ + BT_AUDIO_LOCATION_FRONT_LEFT | BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA, CONFIG_BT_AUDIO_BITRATE_BROADCAST_SRC) + +#elif CONFIG_BT_BAP_BROADCAST_16_2_1 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_16_2_2 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_16_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_24_2_1 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_24_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_24_2_2 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_24_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_48_2_1 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) +#elif CONFIG_BT_BAP_BROADCAST_48_2_2 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_48_4_1 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_4_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_48_4_2 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_4_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_48_6_1 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_6_1(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) + +#elif CONFIG_BT_BAP_BROADCAST_48_6_2 +#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \ + BT_BAP_LC3_BROADCAST_PRESET_48_6_2(BT_AUDIO_LOCATION_FRONT_LEFT | \ + BT_AUDIO_LOCATION_FRONT_RIGHT, \ + BT_AUDIO_CONTEXT_TYPE_MEDIA) +#else +#error Unsupported LC3 codec preset for broadcast +#endif /* CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE */ + /** * @brief Get the data to advertise. * diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.c index b3c138838980..c424e1176a31 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.c @@ -12,6 +12,7 @@ #include "nrf5340_audio_common.h" #include "audio_sync_timer.h" +#include "sdc_hci_vs.h" #include LOG_MODULE_REGISTER(bt_le_audio_tx, CONFIG_BLE_LOG_LEVEL); @@ -29,6 +30,8 @@ ZBUS_CHAN_DEFINE(sdu_ref_chan, struct sdu_ref_msg, NULL, NULL, ZBUS_OBSERVERS_EM #define SRC_STREAM_COUNT 0 #endif +#define HANDLE_INVALID 0xFFFF + #define HCI_ISO_BUF_ALLOC_PER_CHAN 2 /* For being able to dynamically define iso_tx_pools */ @@ -43,6 +46,7 @@ static struct net_buf_pool *iso_tx_pools[] = { LISTIFY(SRC_STREAM_COUNT, /* clang-format on */ struct tx_inf { + uint16_t iso_conn_handle; struct bt_iso_tx_info iso_tx; struct bt_iso_tx_info iso_tx_readback; struct net_buf_pool *iso_tx_pool; @@ -106,11 +110,10 @@ static int iso_stream_send(uint8_t const *const data, size_t size, struct bt_bap atomic_inc(&tx_info->iso_tx_pool_alloc); - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53)) { - ret = bt_bap_stream_send(bap_stream, buf, tx_info->iso_tx.seq_num, - BT_ISO_TIMESTAMP_NONE); + if (ts_tx == 0) { + ret = bt_bap_stream_send(bap_stream, buf, tx_info->iso_tx.seq_num); } else { - ret = bt_bap_stream_send(bap_stream, buf, tx_info->iso_tx.seq_num, ts_tx); + ret = bt_bap_stream_send_ts(bap_stream, buf, tx_info->iso_tx.seq_num, ts_tx); } if (ret < 0) { @@ -127,8 +130,69 @@ static int iso_stream_send(uint8_t const *const data, size_t size, struct bt_bap return 0; } -int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_encoded_audio enc_audio, - uint8_t streams_to_tx) +static int get_tx_sync_sdc(uint16_t iso_conn_handle, struct bt_iso_tx_info *info) +{ + int ret; + struct net_buf *buf; + struct net_buf *rsp; + sdc_hci_cmd_vs_iso_read_tx_timestamp_t *cmd_read_tx_timestamp; + + buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_ISO_READ_TX_TIMESTAMP, + sizeof(*cmd_read_tx_timestamp)); + if (!buf) { + LOG_ERR("Could not allocate command buffer"); + return -ENOBUFS; + } + + cmd_read_tx_timestamp = net_buf_add(buf, sizeof(*cmd_read_tx_timestamp)); + cmd_read_tx_timestamp->conn_handle = iso_conn_handle; + + ret = bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_ISO_READ_TX_TIMESTAMP, buf, &rsp); + if (ret) { + return ret; + } + + if (rsp) { + sdc_hci_cmd_vs_iso_read_tx_timestamp_return_t *rsp_params = (void *)&rsp->data[1]; + + info->ts = rsp_params->tx_time_stamp; + info->seq_num = rsp_params->packet_sequence_number; + info->offset = 0; + + net_buf_unref(rsp); + return 0; + } + + return -EINVAL; +} + +static int iso_conn_handle_set(struct bt_bap_stream *bap_stream, uint16_t *iso_conn_handle) +{ + int ret; + + if (*iso_conn_handle == HANDLE_INVALID) { + struct bt_bap_ep_info ep_info; + + ret = bt_bap_ep_get_info(bap_stream->ep, &ep_info); + if (ret) { + LOG_WRN("Unable to get info for ep"); + return -EACCES; + } + + ret = bt_hci_get_conn_handle(ep_info.iso_chan->iso, iso_conn_handle); + if (ret) { + LOG_ERR("Failed obtaining conn_handle (ret:%d)", ret); + return ret; + } + } else { + /* Already set. */ + } + + return 0; +} + +int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, uint8_t *audio_mapping_mask, + struct le_audio_encoded_audio enc_audio, uint8_t streams_to_tx) { int ret; size_t data_size_pr_stream = 0; @@ -150,12 +214,7 @@ int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_enco return -ENOMEM; } - if ((enc_audio.num_ch == 1) || (enc_audio.num_ch == streams_to_tx)) { - data_size_pr_stream = enc_audio.size / enc_audio.num_ch; - } else { - LOG_ERR("Num encoded channels must be 1 or equal to num streams"); - return -EINVAL; - } + data_size_pr_stream = enc_audio.size / enc_audio.num_ch; /* When sending ISO data, we always send ts = 0 to the first active transmitting channel. * The controller will populate with a ts which is fetched using bt_iso_chan_get_tx_sync. @@ -182,6 +241,11 @@ int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_enco continue; } + if (audio_mapping_mask[i] > enc_audio.num_ch) { + LOG_WRN("Unsupported audio_channel: %d", audio_mapping_mask[i]); + continue; + } + uint32_t bitrate; ret = le_audio_bitrate_get(bap_streams[i]->codec_cfg, &bitrate); @@ -206,9 +270,10 @@ int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_enco ret = iso_stream_send(enc_audio.data, data_size_pr_stream, bap_streams[i], &tx_info_arr[i], common_tx_sync_ts_us); } else { - ret = iso_stream_send(&enc_audio.data[data_size_pr_stream * i], - data_size_pr_stream, bap_streams[i], &tx_info_arr[i], - common_tx_sync_ts_us); + ret = iso_stream_send( + &enc_audio.data[data_size_pr_stream * audio_mapping_mask[i]], + data_size_pr_stream, bap_streams[i], &tx_info_arr[i], + common_tx_sync_ts_us); } if (ret) { @@ -218,11 +283,17 @@ int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_enco continue; } - /* Strictly, it is only required to call get_tx_sync on the first streaming channel - * to get the timestamp which is sent to all other channels. However, to be able to - * detect errors, this is called on each TX. + ret = iso_conn_handle_set(bap_streams[i], &tx_info_arr[i].iso_conn_handle); + if (ret) { + continue; + } + + /* Strictly, it is only required to call get_tx_sync_sdc on the first streaming + * channel to get the timestamp which is sent to all other channels. + * However, to be able to detect errors, this is called on each TX. */ - ret = bt_bap_stream_get_tx_sync(bap_streams[i], &tx_info_arr[i].iso_tx_readback); + ret = get_tx_sync_sdc(tx_info_arr[i].iso_conn_handle, + &tx_info_arr[i].iso_tx_readback); if (ret) { if (ret != -ENOTCONN) { LOG_WRN("Unable to get tx sync. ret: %d stream: %p", ret, @@ -239,11 +310,6 @@ int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_enco } if (ts_common_acquired) { - /*TODO: Disabled for LL_ACS_NRF53 BIS due to timestamp issue */ - if (IS_ENABLED(CONFIG_BT_LL_ACS_NRF53) && IS_ENABLED(CONFIG_TRANSPORT_BIS)) { - return 0; - } - struct sdu_ref_msg msg; msg.tx_sync_ts_us = common_tx_sync_ts_us; @@ -266,7 +332,6 @@ int bt_le_audio_tx_stream_stopped(uint8_t stream_idx) } atomic_clear(&tx_info_arr[stream_idx].iso_tx_pool_alloc); - tx_info_arr[stream_idx].hci_wrn_printed = false; return 0; } @@ -277,6 +342,8 @@ int bt_le_audio_tx_stream_started(uint8_t stream_idx) return -EACCES; } + tx_info_arr[stream_idx].hci_wrn_printed = false; + tx_info_arr[stream_idx].iso_conn_handle = HANDLE_INVALID; tx_info_arr[stream_idx].iso_tx.seq_num = 0; tx_info_arr[stream_idx].iso_tx_readback.seq_num = 0; return 0; @@ -301,6 +368,7 @@ int bt_le_audio_tx_init(void) for (int i = 0; i < SRC_STREAM_COUNT; i++) { tx_info_arr[i].iso_tx_pool = iso_tx_pools[i]; tx_info_arr[i].hci_wrn_printed = false; + tx_info_arr[i].iso_conn_handle = HANDLE_INVALID; tx_info_arr[i].iso_tx.ts = 0; tx_info_arr[i].iso_tx.offset = 0; tx_info_arr[i].iso_tx.seq_num = 0; diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.h b/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.h index a5ff4c47fa82..08d12457b88b 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.h @@ -19,13 +19,14 @@ * Do not call this for each channel. * * @param bap_streams Pointer to an array of BAP streams. + * @param channel_mask Pointer to an array of channel masks. * @param enc_audio Encoded audio data. * @param streams_to_tx Number of streams to send. * * @return 0 if successful, error otherwise. */ -int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, struct le_audio_encoded_audio enc_audio, - uint8_t streams_to_tx); +int bt_le_audio_tx_send(struct bt_bap_stream **bap_streams, uint8_t *channel_mask, + struct le_audio_encoded_audio enc_audio, uint8_t streams_to_tx); /** * @brief Resets TX buffers. Must be called when a TX stream is stopped. diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.c index 2b75cba2f527..6d03b400cb04 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.c @@ -42,13 +42,11 @@ int le_audio_freq_hz_get(const struct bt_audio_codec_cfg *codec, int *freq_hz) ret = bt_audio_codec_cfg_get_freq(codec); if (ret < 0) { - *freq_hz = 0; return ret; } ret = bt_audio_codec_cfg_freq_to_freq_hz(ret); if (ret < 0) { - *freq_hz = 0; return ret; } @@ -63,13 +61,11 @@ int le_audio_duration_us_get(const struct bt_audio_codec_cfg *codec, int *frame_ ret = bt_audio_codec_cfg_get_frame_dur(codec); if (ret < 0) { - *frame_dur_us = 0; return ret; } ret = bt_audio_codec_cfg_frame_dur_to_frame_dur_us(ret); if (ret < 0) { - *frame_dur_us = 0; return ret; } @@ -84,7 +80,6 @@ int le_audio_octets_per_frame_get(const struct bt_audio_codec_cfg *codec, uint32 ret = bt_audio_codec_cfg_get_octets_per_frame(codec); if (ret < 0) { - *octets_per_sdu = 0; return ret; } @@ -100,7 +95,6 @@ int le_audio_frame_blocks_per_sdu_get(const struct bt_audio_codec_cfg *codec, ret = bt_audio_codec_cfg_get_frame_blocks_per_sdu(codec, true); if (ret < 0) { - *frame_blks_per_sdu = 0; return ret; } @@ -116,7 +110,6 @@ int le_audio_bitrate_get(const struct bt_audio_codec_cfg *const codec, uint32_t ret = le_audio_duration_us_get(codec, &dur_us); if (ret) { - *bitrate = 0; return ret; } @@ -125,7 +118,6 @@ int le_audio_bitrate_get(const struct bt_audio_codec_cfg *const codec, uint32_t ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); if (ret) { - *bitrate = 0; return ret; } @@ -148,3 +140,137 @@ int le_audio_stream_dir_get(struct bt_bap_stream const *const stream) return ep_info.dir; } + +bool le_audio_bitrate_check(const struct bt_audio_codec_cfg *codec) +{ + int ret; + uint32_t octets_per_sdu; + + ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); + if (ret) { + LOG_ERR("Error retrieving octets per frame: %d", ret); + return false; + } + + if (octets_per_sdu < LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN)) { + LOG_WRN("Bitrate too low"); + return false; + } else if (octets_per_sdu > LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX)) { + LOG_WRN("Bitrate too high"); + return false; + } + + return true; +} + +bool le_audio_freq_check(const struct bt_audio_codec_cfg *codec) +{ + int ret; + uint32_t frequency_hz; + + ret = le_audio_freq_hz_get(codec, &frequency_hz); + if (ret) { + LOG_ERR("Error retrieving sampling rate: %d", ret); + return false; + } + + switch (frequency_hz) { + case 8000U: + return (BT_AUDIO_CODEC_CAP_FREQ_8KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 11025U: + return (BT_AUDIO_CODEC_CAP_FREQ_11KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 16000U: + return (BT_AUDIO_CODEC_CAP_FREQ_16KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 22050U: + return (BT_AUDIO_CODEC_CAP_FREQ_22KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 24000U: + return (BT_AUDIO_CODEC_CAP_FREQ_24KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 32000U: + return (BT_AUDIO_CODEC_CAP_FREQ_32KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 44100U: + return (BT_AUDIO_CODEC_CAP_FREQ_44KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 48000U: + return (BT_AUDIO_CODEC_CAP_FREQ_48KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 88200U: + return (BT_AUDIO_CODEC_CAP_FREQ_88KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 96000U: + return (BT_AUDIO_CODEC_CAP_FREQ_96KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 176400U: + return (BT_AUDIO_CODEC_CAP_FREQ_176KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 192000U: + return (BT_AUDIO_CODEC_CAP_FREQ_192KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + case 384000U: + return (BT_AUDIO_CODEC_CAP_FREQ_384KHZ & (BT_AUDIO_CODEC_CAPABILIY_FREQ)); + default: + return false; + } +} + +void le_audio_print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir) +{ + if (codec->id == BT_HCI_CODING_FORMAT_LC3) { + /* LC3 uses the generic LTV format - other codecs might do as well */ + int ret; + enum bt_audio_location chan_allocation; + int freq_hz; + int dur_us; + uint32_t octets_per_sdu; + int frame_blks_per_sdu; + uint32_t bitrate; + + ret = le_audio_freq_hz_get(codec, &freq_hz); + if (ret) { + LOG_ERR("Error retrieving sampling frequency: %d", ret); + return; + } + + ret = le_audio_duration_us_get(codec, &dur_us); + if (ret) { + LOG_ERR("Error retrieving frame duration: %d", ret); + return; + } + + ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); + if (ret) { + LOG_ERR("Error retrieving octets per frame: %d", ret); + return; + } + + ret = le_audio_frame_blocks_per_sdu_get(codec, &frame_blks_per_sdu); + if (ret) { + LOG_ERR("Error retrieving frame blocks per SDU: %d", ret); + return; + } + + ret = bt_audio_codec_cfg_get_chan_allocation(codec, &chan_allocation); + if (ret == -ENODATA) { + /* Codec channel allocation not set, defaulting to 0 */ + chan_allocation = 0; + } else if (ret) { + LOG_ERR("Error retrieving channel allocation: %d", ret); + return; + } + + ret = le_audio_bitrate_get(codec, &bitrate); + if (ret) { + LOG_ERR("Unable to calculate bitrate: %d", ret); + return; + } + + if (dir == BT_AUDIO_DIR_SINK) { + LOG_INF("LC3 codec config for sink:"); + } else if (dir == BT_AUDIO_DIR_SOURCE) { + LOG_INF("LC3 codec config for source:"); + } else { + LOG_INF("LC3 codec config for :"); + } + + LOG_INF("\tFrequency: %d Hz", freq_hz); + LOG_INF("\tDuration: %d us", dur_us); + LOG_INF("\tChannel allocation: 0x%x", chan_allocation); + LOG_INF("\tOctets per frame: %d (%d bps)", octets_per_sdu, bitrate); + LOG_INF("\tFrames per SDU: %d", frame_blks_per_sdu); + } else { + LOG_WRN("Codec is not LC3, codec_id: 0x%2x", codec->id); + } +} diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.h b/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.h index f43bdab1f8df..3cdfc8d4dd2d 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/le_audio.h @@ -13,33 +13,33 @@ #define LE_AUDIO_ZBUS_EVENT_WAIT_TIME K_MSEC(5) #define LE_AUDIO_SDU_SIZE_OCTETS(bitrate) (bitrate / (1000000 / CONFIG_AUDIO_FRAME_DURATION_US) / 8) -#if CONFIG_SAMPLE_RATE_CONVERTER +#if CONFIG_SAMPLE_RATE_CONVERTER && CONFIG_AUDIO_SAMPLE_RATE_48000_HZ #define BT_AUDIO_CODEC_CAPABILIY_FREQ \ - BT_AUDIO_CODEC_LC3_FREQ_48KHZ | BT_AUDIO_CODEC_LC3_FREQ_24KHZ | \ - BT_AUDIO_CODEC_LC3_FREQ_16KHZ + BT_AUDIO_CODEC_CAP_FREQ_48KHZ | BT_AUDIO_CODEC_CAP_FREQ_24KHZ | \ + BT_AUDIO_CODEC_CAP_FREQ_16KHZ #elif CONFIG_AUDIO_SAMPLE_RATE_16000_HZ -#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_LC3_FREQ_16KHZ +#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_16KHZ #elif CONFIG_AUDIO_SAMPLE_RATE_24000_HZ -#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_LC3_FREQ_24KHZ +#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_24KHZ #elif CONFIG_AUDIO_SAMPLE_RATE_48000_HZ -#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_LC3_FREQ_48KHZ +#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_48KHZ #else #error No sample rate supported #endif /* CONFIG_SAMPLE_RATE_CONVERTER */ #define BT_BAP_LC3_PRESET_CONFIGURABLE(_loc, _stream_context, _bitrate) \ - BT_BAP_LC3_PRESET( \ - BT_AUDIO_CODEC_LC3_CONFIG(CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_VALUE, \ - BT_AUDIO_CODEC_CONFIG_LC3_DURATION_10, _loc, \ - LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), 1, _stream_context), \ - BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), \ - CONFIG_BT_AUDIO_RETRANSMITS, \ - CONFIG_BT_AUDIO_MAX_TRANSPORT_LATENCY_MS, \ - CONFIG_BT_AUDIO_PRESENTATION_DELAY_US)) + BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_VALUE, \ + BT_AUDIO_CODEC_CFG_DURATION_10, _loc, \ + LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), 1, \ + _stream_context), \ + BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), \ + CONFIG_BT_AUDIO_RETRANSMITS, \ + CONFIG_BT_AUDIO_MAX_TRANSPORT_LATENCY_MS, \ + CONFIG_BT_AUDIO_PRESENTATION_DELAY_US)) /** * @brief Callback for receiving Bluetooth LE Audio data. @@ -49,6 +49,7 @@ * @param bad_frame Indicating if the frame is a bad frame or not. * @param sdu_ref ISO timestamp. * @param channel_index Audio channel index. + * @param desired_size The expected data size. */ typedef void (*le_audio_receive_cb)(const uint8_t *const data, size_t size, bool bad_frame, uint32_t sdu_ref, enum audio_channel channel_index, @@ -81,7 +82,7 @@ bool le_audio_ep_state_check(struct bt_bap_ep *ep, enum bt_bap_ep_state state); /** * @brief Decode the audio sampling frequency in the codec configuration. * - * @param[in] codec The audio codec structure. + * @param[in] codec Pointer to the audio codec structure. * @param[out] freq_hz Pointer to the sampling frequency in Hz. * * @return 0 for success, error otherwise. @@ -91,7 +92,7 @@ int le_audio_freq_hz_get(const struct bt_audio_codec_cfg *codec, int *freq_hz); /** * @brief Decode the audio frame duration in us in the codec configuration. * - * @param[in] codec The audio codec structure. + * @param[in] codec Pointer to the audio codec structure. * @param[out] frame_dur_us Pointer to the frame duration in us. * * @return 0 for success, error otherwise. @@ -101,7 +102,7 @@ int le_audio_duration_us_get(const struct bt_audio_codec_cfg *codec, int *frame_ /** * @brief Decode the number of octets per frame in the codec configuration. * - * @param[in] codec The audio codec structure. + * @param[in] codec Pointer to the audio codec structure. * @param[out] octets_per_sdu Pointer to the number of octets per SDU. * * @return 0 for success, error otherwise. @@ -111,7 +112,7 @@ int le_audio_octets_per_frame_get(const struct bt_audio_codec_cfg *codec, uint32 /** * @brief Decode the number of frame blocks per SDU in the codec configuration. * - * @param[in] codec The audio codec structure. + * @param[in] codec Pointer to the audio codec structure. * @param[out] frame_blks_per_sdu Pointer to the number of frame blocks per SDU. * * @return 0 for success, error otherwise. @@ -125,15 +126,15 @@ int le_audio_frame_blocks_per_sdu_get(const struct bt_audio_codec_cfg *codec, * @details Decodes the audio frame duration and the number of octets per fram from the codec * configuration, and calculates the bitrate. * - * @param[in] codec The audio codec structure. + * @param[in] codec Pointer to the audio codec structure. * @param[out] bitrate Pointer to the bitrate in bps. */ int le_audio_bitrate_get(const struct bt_audio_codec_cfg *const codec, uint32_t *bitrate); /** - * @brief Get the direction of the @p stream provided + * @brief Get the direction of the @p stream provided. * - * @param stream Stream to check direction for. + * @param[in] stream Stream to check direction for. * * @retval BT_AUDIO_DIR_SINK sink direction. * @retval BT_AUDIO_DIR_SOURCE source direction. @@ -142,4 +143,32 @@ int le_audio_bitrate_get(const struct bt_audio_codec_cfg *const codec, uint32_t */ int le_audio_stream_dir_get(struct bt_bap_stream const *const stream); +/** + * @brief Check that the bitrate is within the supported range. + * + * @param[in] codec The audio codec structure. + * + * retval true The bitrate is in the supported range. + * retval false Otherwise. + */ +bool le_audio_bitrate_check(const struct bt_audio_codec_cfg *codec); + +/** + * @brief Check that the sample rate is supported. + * + * @param[in] codec The audio codec structure. + * + * retval true The sample rate is supported. + * retval false Otherwise. + */ +bool le_audio_freq_check(const struct bt_audio_codec_cfg *codec); + +/** + * @brief Print the codec configuration + * + * @param[in] codec Pointer to the audio codec structure. + * @param[in] dir Direction to print the codec configuration for. + */ +void le_audio_print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir); + #endif /* _LE_AUDIO_H_ */ diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig index 54ce3bf6ee7f..d354988fe8e8 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig @@ -81,6 +81,13 @@ config BT_AUDIO_PRES_DELAY_SRCH_SOURCE then it will revert to the closest supported value. endchoice +config BT_AUDIO_EP_PRINT + bool "Print discovered endpoint capabilities" + default n + help + Print the supported capabilities of an endpoint when it is discovered. + + config CODEC_CAP_COUNT_MAX int "Max storage of codec capabilities" default 5 @@ -122,6 +129,23 @@ config BT_AUDIO_BITRATE_UNICAST_SRC help Bitrate for the unicast source ISO stream. +config BT_SET_IDENTITY_RESOLVING_KEY_DEFAULT + string + default "NRF5340_TWS_DEMO" + help + Default string to configure the Set Identify Resolving Key (SIRK), must + be changed before production uniquely for each coordinated set. + +config BT_SET_IDENTITY_RESOLVING_KEY + string "String used to configure the SIRK" + depends on TRANSPORT_CIS && BT_BAP_UNICAST_SERVER + default BT_SET_IDENTITY_RESOLVING_KEY_DEFAULT + help + Defines a string to configure the Set Identify Resolving Key (SIRK), must + be changed before production uniquely for each coordinated set. The SIRK + must be 16 characters (16 bytes). + + #----------------------------------------------------------------------------# menu "Log levels" diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults index 04a69a852f96..fd607265d15d 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/Kconfig.defaults @@ -35,6 +35,9 @@ config BT_BUF_ACL_RX_SIZE default 502 if (AUDIO_DFU > 0) default 259 +config BT_BUF_ACL_TX_COUNT + default 12 + config SETTINGS default y diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c index 34c81c65724d..3baef5fdcdb6 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.c @@ -52,6 +52,7 @@ struct le_audio_headset { struct bt_conn *headset_conn; struct k_work_delayable stream_start_sink_work; struct k_work_delayable stream_start_source_work; + enum bt_audio_location location; bool qos_reconfigure; uint32_t reconfigure_pd; }; @@ -76,7 +77,6 @@ struct temp_cap_storage { }; static struct le_audio_headset headsets[CONFIG_BT_MAX_CONN]; -static struct discover_dir discover_list[CONFIG_BT_MAX_CONN]; K_MSGQ_DEFINE(kwork_msgq, sizeof(struct worker_data), 2 * (CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT + @@ -99,23 +99,23 @@ static struct bt_bap_unicast_group *unicast_group; /* Used for group creation only */ static struct bt_bap_lc3_preset lc3_preset_max = BT_BAP_LC3_PRESET_CONFIGURABLE( - BT_AUDIO_LOCATION_FRONT_LEFT, BT_AUDIO_CONTEXT_TYPE_MEDIA, CONFIG_LC3_BITRATE_MAX); + BT_AUDIO_LOCATION_FRONT_LEFT, BT_AUDIO_CONTEXT_TYPE_ANY, CONFIG_LC3_BITRATE_MAX); static struct bt_bap_lc3_preset lc3_preset_sink = BT_BAP_LC3_UNICAST_PRESET_NRF5340_AUDIO_SINK; static struct bt_bap_lc3_preset lc3_preset_sink_48_4_1 = - BT_BAP_LC3_UNICAST_PRESET_48_4_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_MEDIA)); + BT_BAP_LC3_UNICAST_PRESET_48_4_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_ANY)); static struct bt_bap_lc3_preset lc3_preset_sink_24_2_1 = - BT_BAP_LC3_UNICAST_PRESET_24_2_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_MEDIA)); + BT_BAP_LC3_UNICAST_PRESET_24_2_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_ANY)); static struct bt_bap_lc3_preset lc3_preset_sink_16_2_1 = - BT_BAP_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_MEDIA)); + BT_BAP_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_ANY, (BT_AUDIO_CONTEXT_TYPE_ANY)); static struct bt_bap_lc3_preset lc3_preset_source = BT_BAP_LC3_UNICAST_PRESET_NRF5340_AUDIO_SOURCE; static struct bt_bap_lc3_preset lc3_preset_source_48_4_1 = - BT_BAP_LC3_UNICAST_PRESET_48_4_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_MEDIA); + BT_BAP_LC3_UNICAST_PRESET_48_4_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_ANY); static struct bt_bap_lc3_preset lc3_preset_source_24_2_1 = - BT_BAP_LC3_UNICAST_PRESET_24_2_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_MEDIA); + BT_BAP_LC3_UNICAST_PRESET_24_2_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_ANY); static struct bt_bap_lc3_preset lc3_preset_source_16_2_1 = - BT_BAP_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_MEDIA); + BT_BAP_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_ANY, BT_AUDIO_CONTEXT_TYPE_ANY); static bool playing_state = true; @@ -133,101 +133,6 @@ static void le_audio_event_publish(enum le_audio_evt_type event, struct bt_conn ERR_CHK(ret); } -/** - * @brief Add a conn pointer to the discover list. - * - * @param[in] conn Pointer to the connection to add. - * @param[in] dir Directions to do discovery for. - * - * @retval -ENOMEM No more space for connections. - * @retval 0 Successfully added connection. - */ -static int discover_list_add(struct bt_conn *conn, enum unicast_discover_dir dir) -{ - if (!(dir & BT_AUDIO_DIR_SOURCE) && !(dir & BT_AUDIO_DIR_SINK)) { - LOG_ERR("No direction is set for the discover list entry"); - return -EINVAL; - } - - /* Check if conn is already in the list */ - for (int i = 0; i < ARRAY_SIZE(discover_list); i++) { - if (discover_list[i].conn == conn) { - discover_list[i].source = false; - discover_list[i].sink = false; - - if (dir & BT_AUDIO_DIR_SOURCE) { - discover_list[i].source = true; - } - - if (dir & BT_AUDIO_DIR_SINK) { - discover_list[i].sink = true; - } - - return 0; - } - } - - /* If not already in the list, add to list if there is room */ - for (int i = 0; i < ARRAY_SIZE(discover_list); i++) { - if (discover_list[i].conn == NULL) { - discover_list[i].conn = conn; - - if (dir & BT_AUDIO_DIR_SOURCE) { - discover_list[i].source = true; - } - - if (dir & BT_AUDIO_DIR_SINK) { - discover_list[i].sink = true; - } - - return 0; - } - } - - return -ENOMEM; -} - -/** - * @brief Remove a conn pointer from the discover list. - * - * @param[in] conn Pointer to the connection to remove. - * - * @retval -EINVAL No such connection found. - * @retval 0 Successfully removed connection. - */ -static int discover_list_remove(struct bt_conn const *const conn) -{ - for (int i = 0; i < ARRAY_SIZE(discover_list); i++) { - if (discover_list[i].conn == conn) { - discover_list[i].conn = NULL; - discover_list[i].sink = false; - discover_list[i].source = false; - - return 0; - } - } - - return -EINVAL; -} - -/** - * @brief Get discover_list index for given @p conn. - * - * @param[in] conn Pointer to the connection. - * - * @return -ESRCH if @p conn not found, index otherwise. - */ -static int discover_list_index_get(struct bt_conn const *const conn) -{ - for (int i = 0; i < ARRAY_SIZE(discover_list); i++) { - if (conn == discover_list[i].conn) { - return i; - } - } - - return -ESRCH; -} - /** * @brief Get the common presentation delay for all headsets. * @@ -323,19 +228,40 @@ static int channel_index_get(const struct bt_conn *conn, uint8_t *index) return -EINVAL; } +static int channel_index_vacant_get(const struct bt_conn *conn, uint8_t *index) +{ + + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (headsets[i].headset_conn == conn) { + LOG_WRN("Device has already been discovered"); + return -EALREADY; + } + } + + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (headsets[i].headset_conn == NULL) { + *index = i; + return 0; + } + } + + LOG_WRN("No more room in headset list"); + return -ENOSPC; +} + static void supported_sample_rates_print(uint16_t supported_sample_rates, enum bt_audio_dir dir) { char supported_str[20] = ""; - if (supported_sample_rates & BT_AUDIO_CODEC_LC3_FREQ_48KHZ) { + if (supported_sample_rates & BT_AUDIO_CODEC_CAP_FREQ_48KHZ) { strcat(supported_str, "48, "); } - if (supported_sample_rates & BT_AUDIO_CODEC_LC3_FREQ_24KHZ) { + if (supported_sample_rates & BT_AUDIO_CODEC_CAP_FREQ_24KHZ) { strcat(supported_str, "24, "); } - if (supported_sample_rates & BT_AUDIO_CODEC_LC3_FREQ_16KHZ) { + if (supported_sample_rates & BT_AUDIO_CODEC_CAP_FREQ_16KHZ) { strcat(supported_str, "16, "); } @@ -348,15 +274,15 @@ static void supported_sample_rates_print(uint16_t supported_sample_rates, enum b static bool sink_parse_cb(struct bt_data *data, void *user_data) { - if (data->type == BT_AUDIO_CODEC_LC3_FREQ) { + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_FREQ) { uint16_t lc3_freq_bit = sys_get_le16(data->data); supported_sample_rates_print(lc3_freq_bit, BT_AUDIO_DIR_SINK); /* Try with the preferred sample rate first */ switch (CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_VALUE) { - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_48KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_48KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_48KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_48KHZ) { lc3_preset_sink = lc3_preset_sink_48_4_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -365,8 +291,8 @@ static bool sink_parse_cb(struct bt_data *data, void *user_data) break; - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_24KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_24KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_24KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_24KHZ) { lc3_preset_sink = lc3_preset_sink_24_2_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -375,8 +301,8 @@ static bool sink_parse_cb(struct bt_data *data, void *user_data) break; - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_16KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_16KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_16KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_16KHZ) { lc3_preset_sink = lc3_preset_sink_16_2_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -387,13 +313,13 @@ static bool sink_parse_cb(struct bt_data *data, void *user_data) } /* If no match with the preferred, revert to trying highest first */ - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_48KHZ) { + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_48KHZ) { lc3_preset_sink = lc3_preset_sink_48_4_1; *(bool *)user_data = true; - } else if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_24KHZ) { + } else if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_24KHZ) { lc3_preset_sink = lc3_preset_sink_24_2_1; *(bool *)user_data = true; - } else if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_16KHZ) { + } else if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_16KHZ) { lc3_preset_sink = lc3_preset_sink_16_2_1; *(bool *)user_data = true; } @@ -406,17 +332,115 @@ static bool sink_parse_cb(struct bt_data *data, void *user_data) return true; } +static void set_color_if_supported(char *str, uint16_t bitfield, uint16_t mask) +{ + if (bitfield & mask) { + strcat(str, COLOR_GREEN); + } else { + strcat(str, COLOR_RED); + } +} + +static bool caps_print_cb(struct bt_data *data, void *user_data) +{ + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_FREQ) { + uint16_t freq_bit = sys_get_le16(data->data); + char supported_freq[320] = ""; + + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_8KHZ); + strcat(supported_freq, "8, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_11KHZ); + strcat(supported_freq, "11.025, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_16KHZ); + strcat(supported_freq, "16, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_22KHZ); + strcat(supported_freq, "22.05, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_24KHZ); + strcat(supported_freq, "24, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_32KHZ); + strcat(supported_freq, "32, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_44KHZ); + strcat(supported_freq, "44.1, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_48KHZ); + strcat(supported_freq, "48, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_88KHZ); + strcat(supported_freq, "88.2, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_96KHZ); + strcat(supported_freq, "96, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_176KHZ); + strcat(supported_freq, "176, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_192KHZ); + strcat(supported_freq, "192, "); + set_color_if_supported(supported_freq, freq_bit, BT_AUDIO_CODEC_CAP_FREQ_384KHZ); + strcat(supported_freq, "384"); + + LOG_INF("\tFrequencies kHz: %s", supported_freq); + } + + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_DURATION) { + uint16_t dur_bit = sys_get_le16(data->data); + char supported_dur[30] = ""; + + set_color_if_supported(supported_dur, dur_bit, BT_AUDIO_CODEC_CAP_DURATION_7_5); + strcat(supported_dur, "7.5, "); + set_color_if_supported(supported_dur, dur_bit, BT_AUDIO_CODEC_CAP_DURATION_10); + strcat(supported_dur, "10"); + + LOG_INF("\tFrame duration ms: %s", supported_dur); + } + + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT) { + uint16_t chan_bit = sys_get_le16(data->data); + char supported_chan[120] = ""; + + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_1); + strcat(supported_chan, "1, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_2); + strcat(supported_chan, "2, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_3); + strcat(supported_chan, "3, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_4); + strcat(supported_chan, "4, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_5); + strcat(supported_chan, "5, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_6); + strcat(supported_chan, "6, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_7); + strcat(supported_chan, "7, "); + set_color_if_supported(supported_chan, chan_bit, BT_AUDIO_CODEC_CAP_CHAN_COUNT_8); + strcat(supported_chan, "8"); + + LOG_INF("\tChannels supported: %s", supported_chan); + } + + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN) { + uint16_t lc3_min_frame_length = sys_get_le16(data->data); + uint16_t lc3_max_frame_length = sys_get_le16(data->data + sizeof(uint16_t)); + + LOG_INF("\tFrame length bytes: %d - %d", lc3_min_frame_length, + lc3_max_frame_length); + } + + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT) { + uint16_t lc3_frame_per_sdu = sys_get_le16(data->data); + + LOG_INF("\tMax frames per SDU: %d", lc3_frame_per_sdu); + } + + return true; +} + static bool source_parse_cb(struct bt_data *data, void *user_data) { - if (data->type == BT_AUDIO_CODEC_LC3_FREQ) { + if (data->type == BT_AUDIO_CODEC_CAP_TYPE_FREQ) { uint16_t lc3_freq_bit = sys_get_le16(data->data); supported_sample_rates_print(lc3_freq_bit, BT_AUDIO_DIR_SOURCE); /* Try with the preferred sample rate first */ switch (CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_VALUE) { - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_48KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_48KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_48KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_48KHZ) { lc3_preset_source = lc3_preset_source_48_4_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -425,8 +449,8 @@ static bool source_parse_cb(struct bt_data *data, void *user_data) break; - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_24KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_24KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_24KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_24KHZ) { lc3_preset_source = lc3_preset_source_24_2_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -435,8 +459,8 @@ static bool source_parse_cb(struct bt_data *data, void *user_data) break; - case BT_AUDIO_CODEC_CONFIG_LC3_FREQ_16KHZ: - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_16KHZ) { + case BT_AUDIO_CODEC_CFG_FREQ_16KHZ: + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_16KHZ) { lc3_preset_source = lc3_preset_source_16_2_1; *(bool *)user_data = true; /* Found what we were looking for, stop parsing LTV */ @@ -447,13 +471,13 @@ static bool source_parse_cb(struct bt_data *data, void *user_data) } /* If no match with the preferred, revert to trying highest first */ - if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_48KHZ) { + if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_48KHZ) { lc3_preset_source = lc3_preset_source_48_4_1; *(bool *)user_data = true; - } else if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_24KHZ) { + } else if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_24KHZ) { lc3_preset_source = lc3_preset_source_24_2_1; *(bool *)user_data = true; - } else if (lc3_freq_bit & BT_AUDIO_CODEC_LC3_FREQ_16KHZ) { + } else if (lc3_freq_bit & BT_AUDIO_CODEC_CAP_FREQ_16KHZ) { lc3_preset_source = lc3_preset_source_16_2_1; *(bool *)user_data = true; } @@ -474,22 +498,41 @@ static bool source_parse_cb(struct bt_data *data, void *user_data) * @param[in] cap_array The array of pointers to codec capabilities. * @param[in] num_caps The size of cap_array. * @param[in] dir Direction of the capabilities to check. + * @param[in] index Channel index. * * @return True if valid codec capability found, false otherwise. */ static bool valid_codec_cap_check(struct bt_audio_codec_cap cap_array[], uint8_t num_caps, - enum bt_audio_dir dir) + enum bt_audio_dir dir, uint8_t index) { bool valid_result = false; /* Only the sampling frequency is checked */ if (dir == BT_AUDIO_DIR_SINK) { + LOG_INF("Discovered %d sink endpoint(s) for device %d", num_caps, index); for (int i = 0; i < num_caps; i++) { + if (IS_ENABLED(CONFIG_BT_AUDIO_EP_PRINT)) { + LOG_INF(""); + LOG_INF("Dev: %d Sink EP %d", index, i); + (void)bt_audio_data_parse(cap_array[i].data, cap_array[i].data_len, + caps_print_cb, NULL); + LOG_INF("__________________________"); + } + (void)bt_audio_data_parse(cap_array[i].data, cap_array[i].data_len, sink_parse_cb, &valid_result); } } else if (dir == BT_AUDIO_DIR_SOURCE) { + LOG_INF("Discovered %d source endpoint(s) for device %d", num_caps, index); for (int i = 0; i < num_caps; i++) { + if (IS_ENABLED(CONFIG_BT_AUDIO_EP_PRINT)) { + LOG_INF(""); + LOG_INF("Dev: %d Source EP %d", index, i); + (void)bt_audio_data_parse(cap_array[i].data, cap_array[i].data_len, + caps_print_cb, NULL); + LOG_INF("__________________________"); + } + (void)bt_audio_data_parse(cap_array[i].data, cap_array[i].data_len, source_parse_cb, &valid_result); } @@ -514,7 +557,7 @@ static void bt_audio_codec_allocation_set(struct bt_audio_codec_cfg *codec_cfg, uint8_t *value = &codec_cfg->data[i]; const uint8_t value_len = len - sizeof(type); - if (type == BT_AUDIO_CODEC_CONFIG_LC3_CHAN_ALLOC) { + if (type == BT_AUDIO_CODEC_CFG_CHAN_ALLOC) { const uint32_t loc_32 = loc; sys_put_le32(loc_32, value); @@ -576,28 +619,26 @@ static int update_sink_stream_qos(struct le_audio_headset *headset, uint32_t pre static void unicast_client_location_cb(struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_location loc) { - int index = discover_list_index_get(conn); + int ret; + uint8_t index; + + ret = channel_index_get(conn, &index); - if (index < 0) { - LOG_WRN("Failed to get discover_list index"); + if (ret) { + LOG_ERR("Channel index not found"); return; } - if ((loc & BT_AUDIO_LOCATION_FRONT_LEFT) || (loc & BT_AUDIO_LOCATION_SIDE_LEFT)) { - if (headsets[AUDIO_CH_L].headset_conn == NULL) { - headsets[AUDIO_CH_L].headset_conn = conn; - headsets[AUDIO_CH_L].waiting_for_sink_disc = discover_list[index].sink; - headsets[AUDIO_CH_L].waiting_for_source_disc = discover_list[index].source; - } + if ((loc & BT_AUDIO_LOCATION_FRONT_LEFT) || (loc & BT_AUDIO_LOCATION_SIDE_LEFT) || + (loc == BT_AUDIO_LOCATION_MONO_AUDIO)) { + headsets[index].location = BT_AUDIO_LOCATION_FRONT_LEFT; + headsets[index].ch_name = "LEFT"; } else if ((loc & BT_AUDIO_LOCATION_FRONT_RIGHT) || (loc & BT_AUDIO_LOCATION_SIDE_RIGHT)) { - if (headsets[AUDIO_CH_R].headset_conn == NULL) { - headsets[AUDIO_CH_R].headset_conn = conn; - headsets[AUDIO_CH_R].waiting_for_sink_disc = discover_list[index].sink; - headsets[AUDIO_CH_R].waiting_for_source_disc = discover_list[index].source; - } + headsets[index].location = BT_AUDIO_LOCATION_FRONT_RIGHT; + headsets[index].ch_name = "RIGHT"; } else { - LOG_WRN("Channel location not supported"); + LOG_WRN("Channel location not supported: %d", loc); le_audio_event_publish(LE_AUDIO_EVT_NO_VALID_CFG, conn, dir); } } @@ -783,16 +824,10 @@ static void discover_cb(struct bt_conn *conn, int err, enum bt_audio_dir dir) if (dir == BT_AUDIO_DIR_SINK) { if (valid_codec_cap_check(headsets[channel_index].sink_codec_cap, - temp_cap[temp_cap_index].num_caps, BT_AUDIO_DIR_SINK)) { - if (conn == headsets[AUDIO_CH_L].headset_conn) { - bt_audio_codec_allocation_set(&lc3_preset_sink.codec_cfg, - BT_AUDIO_LOCATION_FRONT_LEFT); - } else if (conn == headsets[AUDIO_CH_R].headset_conn) { - bt_audio_codec_allocation_set(&lc3_preset_sink.codec_cfg, - BT_AUDIO_LOCATION_FRONT_RIGHT); - } else { - LOG_ERR("Unknown connection, cannot set allocation"); - } + temp_cap[temp_cap_index].num_caps, BT_AUDIO_DIR_SINK, + channel_index)) { + bt_audio_codec_allocation_set(&lc3_preset_sink.codec_cfg, + headsets[channel_index].location); } else { /* NOTE: The string below is used by the Nordic CI system */ LOG_WRN("No valid codec capability found for %s headset sink", @@ -801,16 +836,10 @@ static void discover_cb(struct bt_conn *conn, int err, enum bt_audio_dir dir) } } else if (dir == BT_AUDIO_DIR_SOURCE) { if (valid_codec_cap_check(headsets[channel_index].source_codec_cap, - temp_cap[temp_cap_index].num_caps, BT_AUDIO_DIR_SOURCE)) { - if (conn == headsets[AUDIO_CH_L].headset_conn) { - bt_audio_codec_allocation_set(&lc3_preset_source.codec_cfg, - BT_AUDIO_LOCATION_FRONT_LEFT); - } else if (conn == headsets[AUDIO_CH_R].headset_conn) { - bt_audio_codec_allocation_set(&lc3_preset_source.codec_cfg, - BT_AUDIO_LOCATION_FRONT_RIGHT); - } else { - LOG_ERR("Unknown connection, cannot set allocation"); - } + temp_cap[temp_cap_index].num_caps, BT_AUDIO_DIR_SOURCE, + channel_index)) { + bt_audio_codec_allocation_set(&lc3_preset_source.codec_cfg, + headsets[channel_index].location); } else { LOG_WRN("No valid codec capability found for %s headset source", headsets[channel_index].ch_name); @@ -865,6 +894,7 @@ static struct bt_bap_unicast_client_cb unicast_client_cbs = { .discover = discover_cb, }; +#if (CONFIG_BT_AUDIO_TX) static void stream_sent_cb(struct bt_bap_stream *stream) { int ret; @@ -882,6 +912,7 @@ static void stream_sent_cb(struct bt_bap_stream *stream) LOG_WRN("Not in streaming state"); } } +#endif /* CONFIG_BT_AUDIO_TX */ static void stream_configured_cb(struct bt_bap_stream *stream, const struct bt_audio_codec_qos_pref *pref) @@ -899,8 +930,12 @@ static void stream_configured_cb(struct bt_bap_stream *stream, if (stream->ep->dir == BT_AUDIO_DIR_SINK) { /* NOTE: The string below is used by the Nordic CI system */ LOG_INF("%s sink stream configured", headsets[channel_index].ch_name); + le_audio_print_codec(headsets[channel_index].sink_stream.codec_cfg, + stream->ep->dir); } else if (stream->ep->dir == BT_AUDIO_DIR_SOURCE) { LOG_INF("%s source stream configured", headsets[channel_index].ch_name); + le_audio_print_codec(headsets[channel_index].source_stream.codec_cfg, + stream->ep->dir); } else { LOG_WRN("Endpoint direction not recognized: %d", stream->ep->dir); return; @@ -1063,7 +1098,6 @@ static void stream_enabled_cb(struct bt_bap_stream *stream) static void stream_started_cb(struct bt_bap_stream *stream) { int ret; - uint8_t channel_index; enum bt_audio_dir dir; dir = le_audio_stream_dir_get(stream); @@ -1072,11 +1106,15 @@ static void stream_started_cb(struct bt_bap_stream *stream) return; } - ret = channel_index_get(stream->conn, &channel_index); - if (ret) { - LOG_ERR("Channel index not found"); - } else { - ERR_CHK(bt_le_audio_tx_stream_started(channel_index)); + if (IS_ENABLED(CONFIG_BT_AUDIO_TX)) { + uint8_t channel_index; + + ret = channel_index_get(stream->conn, &channel_index); + if (ret) { + LOG_ERR("Channel index not found"); + } else { + ERR_CHK(bt_le_audio_tx_stream_started(channel_index)); + } } /* NOTE: The string below is used by the Nordic CI system */ @@ -1098,64 +1136,48 @@ static void stream_disabled_cb(struct bt_bap_stream *stream) static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) { int ret; - uint8_t channel_index; /* NOTE: The string below is used by the Nordic CI system */ LOG_INF("Stream %p stopped. Reason %d", (void *)stream, reason); - ret = channel_index_get(stream->conn, &channel_index); - if (ret) { - LOG_ERR("Channel index not found"); - } else { - ERR_CHK(bt_le_audio_tx_stream_stopped(channel_index)); - } + if (IS_ENABLED(CONFIG_BT_AUDIO_TX)) { + uint8_t channel_index; - /* Check if the other stream is streaming, send event if not */ - if (stream == &headsets[AUDIO_CH_L].sink_stream) { - if (!le_audio_ep_state_check(headsets[AUDIO_CH_R].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, - BT_AUDIO_DIR_SINK); + ret = channel_index_get(stream->conn, &channel_index); + if (ret) { + LOG_ERR("Channel index not found"); + } else { + ret = bt_le_audio_tx_stream_stopped(channel_index); + ERR_CHK(ret); } - } else if (stream == &headsets[AUDIO_CH_R].sink_stream) { - if (!le_audio_ep_state_check(headsets[AUDIO_CH_L].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, - BT_AUDIO_DIR_SINK); + } + + /* Check if the other streams are streaming, send event if not */ + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (le_audio_ep_state_check(headsets[i].sink_stream.ep, + BT_BAP_EP_STATE_STREAMING) || + le_audio_ep_state_check(headsets[i].source_stream.ep, + BT_BAP_EP_STATE_STREAMING)) { + return; } - } else { - LOG_WRN("Unknown stream"); } + + le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, BT_AUDIO_DIR_SINK); } static void stream_released_cb(struct bt_bap_stream *stream) { LOG_DBG("Audio Stream %p released", (void *)stream); - /* Check if the other stream is streaming, send event if not */ - if (stream == &headsets[AUDIO_CH_L].sink_stream) { - if (!le_audio_ep_state_check(headsets[AUDIO_CH_R].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, - BT_AUDIO_DIR_SINK); - } - - LOG_DBG("Left sink stream released"); - } else if (stream == &headsets[AUDIO_CH_R].sink_stream) { - if (!le_audio_ep_state_check(headsets[AUDIO_CH_L].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, - BT_AUDIO_DIR_SINK); + /* Check if the other streams are streaming, send event if not */ + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (le_audio_ep_state_check(headsets[i].source_stream.ep, + BT_BAP_EP_STATE_STREAMING)) { + return; } - - LOG_DBG("Right sink stream released"); - } else if (stream == &headsets[AUDIO_CH_L].source_stream) { - LOG_DBG("Left source stream released"); - } else if (stream == &headsets[AUDIO_CH_R].source_stream) { - LOG_DBG("Right source stream released"); - } else { - LOG_WRN("Unknown stream"); } + + le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, stream->conn, BT_AUDIO_DIR_SINK); } #if (CONFIG_BT_AUDIO_RX) @@ -1259,9 +1281,10 @@ static void work_stream_start(struct k_work *work) } } else if (ret != 0) { LOG_WRN("Failed to establish CIS, ret = %d", ret); - /** The connection could have invalid configs, or abnormal behavior cause the CIS - * failed to establish. Sending an event for triggering disconnection could clean up - * the abnormal state and restart the connection. + /** The connection could have invalid configs, or abnormal behavior cause + * the CIS failed to establish. Sending an event for triggering + * disconnection could clean up the abnormal state and restart the + * connection. */ le_audio_event_publish(LE_AUDIO_EVT_NO_VALID_CFG, headsets[work_data.channel_index].headset_conn, @@ -1375,12 +1398,6 @@ void unicast_client_conn_disconnected(struct bt_conn *conn) int ret; uint8_t channel_index; - /* Make sure discovery_list is purged for the disconnected conn */ - ret = discover_list_remove(conn); - if (ret) { - LOG_WRN("Failed to remove conn from discover_list: %d", ret); - } - ret = channel_index_get(conn, &channel_index); if (ret) { LOG_WRN("Unknown connection disconnected"); @@ -1392,13 +1409,23 @@ void unicast_client_conn_disconnected(struct bt_conn *conn) int unicast_client_discover(struct bt_conn *conn, enum unicast_discover_dir dir) { int ret; + uint8_t index; - ret = discover_list_add(conn, dir); + ret = channel_index_vacant_get(conn, &index); if (ret) { - LOG_ERR("Failed to add to discover_list: %d", ret); return ret; } + headsets[index].headset_conn = conn; + + if (dir & BT_AUDIO_DIR_SOURCE) { + headsets[index].waiting_for_source_disc = true; + } + + if (dir & BT_AUDIO_DIR_SINK) { + headsets[index].waiting_for_sink_disc = true; + } + if (dir == UNICAST_SERVER_BIDIR) { /* If we need to discover both source and sink, do sink first */ ret = bt_bap_unicast_client_discover(conn, BT_AUDIO_DIR_SINK); @@ -1409,34 +1436,41 @@ int unicast_client_discover(struct bt_conn *conn, enum unicast_discover_dir dir) return ret; } -int unicast_client_start(void) +int unicast_client_start(enum bt_audio_dir dir) { - int ret_left = 0; - int ret_right = 0; + int ret; + bool any_errors = false; - if (le_audio_ep_state_check(headsets[AUDIO_CH_L].sink_stream.ep, - BT_BAP_EP_STATE_QOS_CONFIGURED)) { - ret_left = bt_bap_stream_enable(&headsets[AUDIO_CH_L].sink_stream, - lc3_preset_sink.codec_cfg.meta, - lc3_preset_sink.codec_cfg.meta_len); + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (dir == BT_AUDIO_DIR_SINK && + le_audio_ep_state_check(headsets[i].sink_stream.ep, + BT_BAP_EP_STATE_QOS_CONFIGURED)) { + /* Start all streams in the configured state */ + ret = bt_bap_stream_enable(&headsets[i].sink_stream, + lc3_preset_sink.codec_cfg.meta, + lc3_preset_sink.codec_cfg.meta_len); - if (ret_left) { - LOG_WRN("Failed to enable left stream: %d", ret_left); - } - } + if (ret) { + LOG_WRN("Failed to enable stream %d: %d", i, ret); + any_errors = true; + } - if (le_audio_ep_state_check(headsets[AUDIO_CH_R].sink_stream.ep, - BT_BAP_EP_STATE_QOS_CONFIGURED)) { - ret_right = bt_bap_stream_enable(&headsets[AUDIO_CH_R].sink_stream, - lc3_preset_sink.codec_cfg.meta, - lc3_preset_sink.codec_cfg.meta_len); + } else if (dir == BT_AUDIO_DIR_SOURCE && + le_audio_ep_state_check(headsets[i].source_stream.ep, + BT_BAP_EP_STATE_QOS_CONFIGURED)) { + /* Start all streams in the configured state */ + ret = bt_bap_stream_enable(&headsets[i].source_stream, + lc3_preset_source.codec_cfg.meta, + lc3_preset_source.codec_cfg.meta_len); - if (ret_right) { - LOG_WRN("Failed to enable right stream: %d", ret_right); + if (ret) { + LOG_WRN("Failed to enable stream %d: %d", i, ret); + any_errors = true; + } } } - if (ret_left || ret_right) { + if (any_errors) { return -EIO; } @@ -1445,32 +1479,39 @@ int unicast_client_start(void) return 0; } -int unicast_client_stop(void) +int unicast_client_stop(enum bt_audio_dir dir) { - int ret_left = 0; - int ret_right = 0; + int ret; + bool any_errors = false; le_audio_event_publish(LE_AUDIO_EVT_NOT_STREAMING, NULL, 0); - if (le_audio_ep_state_check(headsets[AUDIO_CH_L].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - ret_left = bt_bap_stream_disable(&headsets[AUDIO_CH_L].sink_stream); + for (int i = 0; i < ARRAY_SIZE(headsets); i++) { + if (dir == BT_AUDIO_DIR_SINK && + le_audio_ep_state_check(headsets[i].sink_stream.ep, + BT_BAP_EP_STATE_STREAMING)) { + /* Stop all streams currently in a streaming state */ + ret = bt_bap_stream_disable(&headsets[i].sink_stream); - if (ret_left) { - LOG_WRN("Failed to disable left stream: %d", ret_left); - } - } + if (ret) { + LOG_WRN("Failed to disable stream %d: %d", i, ret); + any_errors = true; + } - if (le_audio_ep_state_check(headsets[AUDIO_CH_R].sink_stream.ep, - BT_BAP_EP_STATE_STREAMING)) { - ret_right = bt_bap_stream_disable(&headsets[AUDIO_CH_R].sink_stream); + } else if (dir == BT_AUDIO_DIR_SOURCE && + le_audio_ep_state_check(headsets[i].source_stream.ep, + BT_BAP_EP_STATE_STREAMING)) { + /* Stop all streams currently in a streaming state */ + ret = bt_bap_stream_disable(&headsets[i].source_stream); - if (ret_right) { - LOG_WRN("Failed to disable right stream: %d", ret_right); + if (ret) { + LOG_WRN("Failed to disable stream %d: %d", i, ret); + any_errors = true; + } } } - if (ret_left || ret_right) { + if (any_errors) { return -EIO; } @@ -1481,20 +1522,27 @@ int unicast_client_stop(void) int unicast_client_send(struct le_audio_encoded_audio enc_audio) { +#if (CONFIG_BT_AUDIO_TX) int ret; -#if CONFIG_BT_AUDIO_TX struct bt_bap_stream *bap_tx_streams[CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT]; + uint8_t audio_mapping_mask[CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT] = {UINT8_MAX}; for (int i = 0; i < CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT; i++) { bap_tx_streams[i] = &headsets[i].sink_stream; + if (headsets[i].location == BT_AUDIO_LOCATION_FRONT_RIGHT) { + audio_mapping_mask[i] = AUDIO_CH_R; + } else { + /* Both mono and left devices will receive left channel */ + audio_mapping_mask[i] = AUDIO_CH_L; + } } - ret = bt_le_audio_tx_send(bap_tx_streams, enc_audio, + ret = bt_le_audio_tx_send(bap_tx_streams, audio_mapping_mask, enc_audio, CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT); if (ret) { return ret; } -#endif /*CONFIG_BT_AUDIO_TX*/ +#endif /* (CONFIG_BT_AUDIO_TX) */ return 0; } @@ -1530,8 +1578,8 @@ int unicast_client_enable(le_audio_receive_cb recv_cb) LOG_DBG("Start workers"); for (int i = 0; i < ARRAY_SIZE(headsets); i++) { - headsets[i].sink_stream.ops = &stream_ops; headsets[i].source_stream.ops = &stream_ops; + headsets[i].sink_stream.ops = &stream_ops; k_work_init_delayable(&headsets[i].stream_start_sink_work, work_stream_start); k_work_init_delayable(&headsets[i].stream_start_source_work, work_stream_start); } @@ -1542,23 +1590,10 @@ int unicast_client_enable(le_audio_receive_cb recv_cb) return ret; } - ret = bt_le_audio_tx_init(); - if (ret) { - return ret; - } - - for (int i = 0; i < ARRAY_SIZE(headsets); i++) { - switch (i) { - case AUDIO_CH_L: - headsets[i].ch_name = "LEFT"; - break; - case AUDIO_CH_R: - headsets[i].ch_name = "RIGHT"; - break; - default: - LOG_WRN("Trying to set name to undefined channel"); - headsets[i].ch_name = "UNDEFINED"; - break; + if (IS_ENABLED(CONFIG_BT_AUDIO_TX)) { + ret = bt_le_audio_tx_init(); + if (ret) { + return ret; } } @@ -1575,7 +1610,11 @@ int unicast_client_enable(le_audio_receive_cb recv_cb) } for (int i = 0; i < ARRAY_SIZE(pair_params); i++) { - pair_params[i].tx_param = &group_stream_params[stream_iterator]; + if (IS_ENABLED(CONFIG_BT_AUDIO_TX)) { + pair_params[i].tx_param = &group_stream_params[stream_iterator]; + } else { + pair_params[i].tx_param = NULL; + } stream_iterator++; if (IS_ENABLED(CONFIG_BT_AUDIO_RX)) { diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.h b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.h index 7b64e0d77e72..88e1ef80b3bf 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_client.h @@ -69,7 +69,9 @@ int unicast_client_config_get(struct bt_conn *conn, enum bt_audio_dir dir, uint3 * @param[in] conn Pointer to the connection. * @param[in] dir Direction of the stream. * - * @return 0 for success, error otherwise. + * @retval -EALREADY Device has already been discovered. + * @retval -ENOSPC No more room in headset list. + * @retval 0 Success. */ int unicast_client_discover(struct bt_conn *conn, enum unicast_discover_dir dir); @@ -83,16 +85,20 @@ void unicast_client_conn_disconnected(struct bt_conn *conn); /** * @brief Start the Bluetooth LE Audio unicast (CIS) client. * + * @param[in] dir Direction of the stream to start. + * * @return 0 for success, error otherwise. */ -int unicast_client_start(void); +int unicast_client_start(enum bt_audio_dir dir); /** * @brief Stop the Bluetooth LE Audio unicast (CIS) client. * + * @param[in] dir Direction of the stream to stop. + * * @return 0 for success, error otherwise. */ -int unicast_client_stop(void); +int unicast_client_stop(enum bt_audio_dir dir); /** * @brief Send encoded audio using the Bluetooth LE Audio unicast. diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c index 14c11557debf..cbb3ae6650da 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.c @@ -17,7 +17,6 @@ #include "macros_common.h" #include "nrf5340_audio_common.h" -#include "channel_assignment.h" #include "bt_le_audio_tx.h" #include "le_audio.h" @@ -29,6 +28,9 @@ LOG_MODULE_REGISTER(unicast_server, CONFIG_UNICAST_SERVER_LOG_LEVEL); BUILD_ASSERT(CONFIG_BT_ASCS_ASE_SRC_COUNT <= 1, "A maximum of one source stream is currently supported"); +BUILD_ASSERT(strlen(CONFIG_BT_SET_IDENTITY_RESOLVING_KEY) == BT_CSIP_SET_SIRK_SIZE, + "SIRK incorrect size, must be 16 bytes"); + ZBUS_CHAN_DEFINE(le_audio_chan, struct le_audio_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY, ZBUS_MSG_INIT(0)); @@ -57,17 +59,16 @@ static const uint8_t cap_adv_data[] = { }; #if defined(CONFIG_BT_AUDIO_RX) -#define AVAILABLE_SINK_CONTEXT \ - (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | BT_AUDIO_CONTEXT_TYPE_MEDIA | \ - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL) +#define AVAILABLE_SINK_CONTEXT (BT_AUDIO_CONTEXT_TYPE_ANY) #else #define AVAILABLE_SINK_CONTEXT BT_AUDIO_CONTEXT_TYPE_PROHIBITED #endif /* CONFIG_BT_AUDIO_RX */ -#if defined(CONFIG_BT_AUDIO_TX) static struct bt_bap_stream *bap_tx_streams[CONFIG_BT_ASCS_ASE_SRC_COUNT]; -#define AVAILABLE_SOURCE_CONTEXT \ - (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL) + +#if defined(CONFIG_BT_AUDIO_TX) +static uint8_t audio_mapping_mask[CONFIG_BT_ASCS_ASE_SRC_COUNT] = {0}; +#define AVAILABLE_SOURCE_CONTEXT (BT_AUDIO_CONTEXT_TYPE_ANY) #else #define AVAILABLE_SOURCE_CONTEXT BT_AUDIO_CONTEXT_TYPE_PROHIBITED #endif /* CONFIG_BT_AUDIO_TX */ @@ -115,31 +116,30 @@ static struct bt_csip_set_member_cb csip_callbacks = { struct bt_csip_set_member_register_param csip_param = { .set_size = CSIP_SET_SIZE, .lockable = true, -#if !CONFIG_BT_CSIP_SET_MEMBER_TEST_SAMPLE_DATA - /* CSIP SIRK for demo is used, must be changed before production */ - .set_sirk = {'N', 'R', 'F', '5', '3', '4', '0', '_', 'T', 'W', 'S', '_', 'D', 'E', 'M', - 'O'}, -#else -#warning "CSIP test sample data is used, must be changed before production" -#endif .cb = &csip_callbacks, }; +#if defined(CONFIG_BT_AUDIO_RX) static struct bt_audio_codec_cap lc3_codec_sink = BT_AUDIO_CODEC_CAP_LC3( BT_AUDIO_CODEC_CAPABILIY_FREQ, - (BT_AUDIO_CODEC_LC3_DURATION_10 | BT_AUDIO_CODEC_LC3_DURATION_PREFER_10), - BT_AUDIO_CODEC_LC3_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), + (BT_AUDIO_CODEC_CAP_DURATION_10 | BT_AUDIO_CODEC_CAP_DURATION_PREFER_10), + BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX), 1u, AVAILABLE_SINK_CONTEXT); +#endif /* (CONFIG_BT_AUDIO_RX) */ +#if defined(CONFIG_BT_AUDIO_TX) static struct bt_audio_codec_cap lc3_codec_source = BT_AUDIO_CODEC_CAP_LC3( BT_AUDIO_CODEC_CAPABILIY_FREQ, - (BT_AUDIO_CODEC_LC3_DURATION_10 | BT_AUDIO_CODEC_LC3_DURATION_PREFER_10), - BT_AUDIO_CODEC_LC3_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), + (BT_AUDIO_CODEC_CAP_DURATION_10 | BT_AUDIO_CODEC_CAP_DURATION_PREFER_10), + BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN), LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX), 1u, AVAILABLE_SOURCE_CONTEXT); +#endif /* (CONFIG_BT_AUDIO_TX) */ static enum bt_audio_dir caps_dirs[] = { +#if defined(CONFIG_BT_AUDIO_RX) BT_AUDIO_DIR_SINK, -#if (CONFIG_BT_AUDIO_TX) +#endif /* CONFIG_BT_AUDIO_RX */ +#if defined(CONFIG_BT_AUDIO_TX) BT_AUDIO_DIR_SOURCE, #endif /* (CONFIG_BT_AUDIO_TX) */ }; @@ -172,76 +172,11 @@ BUILD_ASSERT(CONFIG_BT_ASCS_ASE_SRC_COUNT <= 1, "CIS headset only supports one source stream for now"); #endif /* (CONFIG_BT_AUDIO_TX) */ -static void print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir) -{ - if (codec->id == BT_HCI_CODING_FORMAT_LC3) { - /* LC3 uses the generic LTV format - other codecs might do as well */ - int ret; - enum bt_audio_location chan_allocation; - int freq_hz; - int dur_us; - uint32_t octets_per_sdu; - int frame_blks_per_sdu; - uint32_t bitrate; - - ret = le_audio_freq_hz_get(codec, &freq_hz); - if (ret) { - LOG_ERR("Error retrieving sampling frequency: %d", ret); - return; - } - - ret = le_audio_duration_us_get(codec, &dur_us); - if (ret) { - LOG_ERR("Error retrieving frame duration: %d", ret); - return; - } - - ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); - if (ret) { - LOG_ERR("Error retrieving octets per frame: %d", ret); - return; - } - - ret = le_audio_frame_blocks_per_sdu_get(codec, &frame_blks_per_sdu); - if (ret) { - LOG_ERR("Error retrieving frame blocks per SDU: %d", ret); - return; - } - - ret = bt_audio_codec_cfg_get_chan_allocation(codec, &chan_allocation); - if (ret) { - LOG_ERR("Error retrieving channel allocation: %d", ret); - return; - } - - ret = le_audio_bitrate_get(codec, &bitrate); - if (ret) { - LOG_ERR("Unable to calculate bitrate: %d", ret); - return; - } - - if (dir == BT_AUDIO_DIR_SINK) { - LOG_INF("LC3 codec config for sink:"); - } else if (dir == BT_AUDIO_DIR_SOURCE) { - LOG_INF("LC3 codec config for source:"); - } else { - LOG_INF("LC3 codec config for :"); - } - - LOG_INF("\tFrequency: %d Hz", freq_hz); - LOG_INF("\tDuration: %d us", dur_us); - LOG_INF("\tChannel allocation: 0x%x", chan_allocation); - LOG_INF("\tOctets per frame: %d (%d bps)", octets_per_sdu, bitrate); - LOG_INF("\tFrames per SDU: %d", frame_blks_per_sdu); - } else { - LOG_WRN("Codec is not LC3, codec_id: 0x%2x", codec->id); - } -} - static int lc3_config_cb(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec, struct bt_bap_stream **stream, struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) { + int ret; LOG_DBG("LC3 config callback"); for (int i = 0; i < ARRAY_SIZE(audio_streams); i++) { @@ -250,33 +185,27 @@ static int lc3_config_cb(struct bt_conn *conn, const struct bt_bap_ep *ep, enum if (!audio_stream->conn) { LOG_DBG("ASE Codec Config stream %p", (void *)audio_stream); - int ret; - uint32_t octets_per_sdu; - - ret = le_audio_octets_per_frame_get(codec, &octets_per_sdu); - if (ret) { - LOG_ERR("Error retrieving octets frame:, %d", ret); - return ret; + ret = le_audio_bitrate_check(codec); + if (!ret) { + LOG_WRN("Bitrate check failed"); + return -EINVAL; } - if (octets_per_sdu > LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MAX)) { - LOG_ERR("Too high bitrate"); - return -EINVAL; - } else if (octets_per_sdu < - LE_AUDIO_SDU_SIZE_OCTETS(CONFIG_LC3_BITRATE_MIN)) { - LOG_ERR("Too low bitrate"); + ret = le_audio_freq_check(codec); + if (!ret) { + LOG_WRN("Sample rate not supported"); return -EINVAL; } if (dir == BT_AUDIO_DIR_SINK) { LOG_DBG("BT_AUDIO_DIR_SINK"); - print_codec(codec, dir); + le_audio_print_codec(codec, dir); le_audio_event_publish(LE_AUDIO_EVT_CONFIG_RECEIVED, conn, dir); } #if (CONFIG_BT_AUDIO_TX) else if (dir == BT_AUDIO_DIR_SOURCE) { LOG_DBG("BT_AUDIO_DIR_SOURCE"); - print_codec(codec, dir); + le_audio_print_codec(codec, dir); le_audio_event_publish(LE_AUDIO_EVT_CONFIG_RECEIVED, conn, dir); /* CIS headset only supports one source stream for now */ @@ -478,7 +407,7 @@ static void stream_started_cb(struct bt_bap_stream *stream) LOG_INF("Stream %p started", stream); - if (dir == BT_AUDIO_DIR_SOURCE) { + if (dir == BT_AUDIO_DIR_SOURCE && IS_ENABLED(CONFIG_BT_AUDIO_TX)) { ERR_CHK(bt_le_audio_tx_stream_started(0)); } @@ -497,7 +426,7 @@ static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) LOG_DBG("Stream %p stopped. Reason: %d", stream, reason); - if (dir == BT_AUDIO_DIR_SOURCE) { + if (dir == BT_AUDIO_DIR_SOURCE && IS_ENABLED(CONFIG_BT_AUDIO_TX)) { ERR_CHK(bt_le_audio_tx_stream_stopped(0)); } @@ -583,7 +512,7 @@ int unicast_server_config_get(struct bt_conn *conn, enum bt_audio_dir dir, uint3 *pres_delay_us = audio_streams[0].qos->pd; } - } else if (dir == BT_AUDIO_DIR_SOURCE) { + } else if (dir == BT_AUDIO_DIR_SOURCE && IS_ENABLED(CONFIG_BT_AUDIO_TX)) { /* If multiple source streams exists, they should have the same configurations, * hence we only check the first one. */ @@ -681,7 +610,8 @@ int unicast_server_send(struct le_audio_encoded_audio enc_audio) #if (CONFIG_BT_AUDIO_TX) int ret; - ret = bt_le_audio_tx_send(bap_tx_streams, enc_audio, CONFIG_BT_ASCS_ASE_SRC_COUNT); + ret = bt_le_audio_tx_send(bap_tx_streams, audio_mapping_mask, enc_audio, + CONFIG_BT_ASCS_ASE_SRC_COUNT); if (ret) { return ret; } @@ -697,7 +627,7 @@ int unicast_server_disable(void) return -ENOTSUP; } -int unicast_server_enable(le_audio_receive_cb recv_cb) +int unicast_server_enable(le_audio_receive_cb recv_cb, enum bt_audio_location location) { int ret; static bool initialized; @@ -707,7 +637,7 @@ int unicast_server_enable(le_audio_receive_cb recv_cb) return -EALREADY; } - if (recv_cb == NULL) { + if (recv_cb == NULL && IS_ENABLED(CONFIG_BT_AUDIO_RX)) { LOG_ERR("Receive callback is NULL"); return -EINVAL; } @@ -716,116 +646,79 @@ int unicast_server_enable(le_audio_receive_cb recv_cb) bt_bap_unicast_server_register_cb(&unicast_server_cb); - channel_assignment_get(&channel); + if (IS_ENABLED(CONFIG_BT_CSIP_SET_MEMBER_TEST_SAMPLE_DATA)) { + LOG_WRN("CSIP test sample data is used, must be changed " + "before production"); + } else { + if (strcmp(CONFIG_BT_SET_IDENTITY_RESOLVING_KEY_DEFAULT, + CONFIG_BT_SET_IDENTITY_RESOLVING_KEY) == 0) { + LOG_WRN("CSIP using the default SIRK, must be changed " + "before production"); + } + + memcpy(csip_param.set_sirk, CONFIG_BT_SET_IDENTITY_RESOLVING_KEY, + BT_CSIP_SET_SIRK_SIZE); + } for (int i = 0; i < ARRAY_SIZE(caps); i++) { ret = bt_pacs_cap_register(caps_dirs[i], &caps[i]); if (ret) { - LOG_ERR("Capability register failed"); + LOG_ERR("Capability register failed. Err: %d", ret); return ret; } } - if (channel == AUDIO_CH_L) { - csip_param.rank = CSIP_HL_RANK; + if (IS_ENABLED(CONFIG_BT_AUDIO_RX)) { + ret = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SINK, AVAILABLE_SINK_CONTEXT); - ret = bt_pacs_set_location(BT_AUDIO_DIR_SINK, BT_AUDIO_LOCATION_FRONT_LEFT); if (ret) { - LOG_ERR("Location set failed"); + LOG_ERR("Supported context set failed. Err: %d", ret); return ret; } - } else if (channel == AUDIO_CH_R) { - csip_param.rank = CSIP_HR_RANK; - - ret = bt_pacs_set_location(BT_AUDIO_DIR_SINK, BT_AUDIO_LOCATION_FRONT_RIGHT); + ret = bt_pacs_set_available_contexts(BT_AUDIO_DIR_SINK, AVAILABLE_SINK_CONTEXT); if (ret) { - LOG_ERR("Location set failed"); + LOG_ERR("Available context set failed. Err: %d", ret); return ret; } - - } else { - LOG_ERR("Channel not supported"); - return -ECANCELED; - } - - if (IS_ENABLED(CONFIG_STREAM_BIDIRECTIONAL)) { - ret = bt_le_audio_tx_init(); - if (ret) { - return ret; + if (location == BT_AUDIO_LOCATION_FRONT_LEFT) { + csip_param.rank = CSIP_HL_RANK; + } else if (location == BT_AUDIO_LOCATION_FRONT_RIGHT) { + csip_param.rank = CSIP_HR_RANK; + } else { + LOG_ERR("Channel not supported"); + return -ECANCELED; } - ret = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SINK, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); + ret = bt_pacs_set_location(BT_AUDIO_DIR_SINK, location); if (ret) { - LOG_ERR("Supported context set failed. Err: %d", ret); + LOG_ERR("Location set failed. Err: %d", ret); return ret; } + } - ret = bt_pacs_set_available_contexts(BT_AUDIO_DIR_SINK, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); + if (IS_ENABLED(CONFIG_BT_AUDIO_TX)) { + ret = bt_le_audio_tx_init(); if (ret) { - LOG_ERR("Available context set failed. Err: %d", ret); return ret; } - ret = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SOURCE, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); + ret = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SOURCE, AVAILABLE_SOURCE_CONTEXT); if (ret) { LOG_ERR("Supported context set failed. Err: %d", ret); return ret; } - ret = bt_pacs_set_available_contexts(BT_AUDIO_DIR_SOURCE, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); + ret = bt_pacs_set_available_contexts(BT_AUDIO_DIR_SOURCE, AVAILABLE_SOURCE_CONTEXT); if (ret) { LOG_ERR("Available context set failed. Err: %d", ret); return ret; } - if (channel == AUDIO_CH_L) { - ret = bt_pacs_set_location(BT_AUDIO_DIR_SOURCE, - BT_AUDIO_LOCATION_FRONT_LEFT); - if (ret) { - LOG_ERR("Location set failed"); - return ret; - } - } else if (channel == AUDIO_CH_R) { - ret = bt_pacs_set_location(BT_AUDIO_DIR_SOURCE, - BT_AUDIO_LOCATION_FRONT_RIGHT); - if (ret) { - LOG_ERR("Location set failed"); - return ret; - } - } else { - LOG_ERR("Channel not supported"); - return -ECANCELED; - } - } else { - ret = bt_pacs_set_supported_contexts(BT_AUDIO_DIR_SINK, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); - - if (ret) { - LOG_ERR("Supported context set failed. Err: %d ", ret); - return ret; - } - - ret = bt_pacs_set_available_contexts(BT_AUDIO_DIR_SINK, - BT_AUDIO_CONTEXT_TYPE_MEDIA | - BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED); - + ret = bt_pacs_set_location(BT_AUDIO_DIR_SOURCE, location); if (ret) { - LOG_ERR("Available context set failed. Err: %d", ret); + LOG_ERR("Location set failed. Err: %d", ret); return ret; } } @@ -837,13 +730,13 @@ int unicast_server_enable(le_audio_receive_cb recv_cb) if (IS_ENABLED(CONFIG_BT_CSIP_SET_MEMBER)) { ret = bt_cap_acceptor_register(&csip_param, &csip); if (ret) { - LOG_ERR("Failed to register CAP acceptor"); + LOG_ERR("Failed to register CAP acceptor. Err: %d", ret); return ret; } ret = bt_csip_set_member_generate_rsi(csip, csip_rsi_adv_data); if (ret) { - LOG_ERR("Failed to generate RSI (ret %d)", ret); + LOG_ERR("Failed to generate RSI. Err: %d", ret); return ret; } } diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.h b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.h index bb6a98374b04..a6f633c5bc4e 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.h +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/unicast/unicast_server.h @@ -70,8 +70,11 @@ int unicast_server_disable(void); /** * @brief Enable the Bluetooth LE Audio unicast (CIS) server. * + * @param[in] rx_cb Callback for handling received data. + * @param[in] location Location of the unicast_server to be enabled. + * * @return 0 for success, error otherwise. */ -int unicast_server_enable(le_audio_receive_cb rx_cb); +int unicast_server_enable(le_audio_receive_cb rx_cb, enum bt_audio_location location); #endif /* _UNICAST_SERVER_H_ */ diff --git a/applications/nrf5340_audio/src/modules/CMakeLists.txt b/applications/nrf5340_audio/src/modules/CMakeLists.txt index 535e453b350a..a1734af98d2d 100644 --- a/applications/nrf5340_audio/src/modules/CMakeLists.txt +++ b/applications/nrf5340_audio/src/modules/CMakeLists.txt @@ -14,11 +14,7 @@ set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/sd_card.c ) -if (CONFIG_AUDIO_SYNC_TIMER_USES_RTC) - list(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/audio_sync_timer_rtc.c) -else() - list(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/audio_sync_timer.c) -endif() +list(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/audio_sync_timer_rtc.c) if (CONFIG_SD_CARD_PLAYBACK) list(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/sd_card_playback.c) diff --git a/applications/nrf5340_audio/src/modules/Kconfig b/applications/nrf5340_audio/src/modules/Kconfig index 7fbb5b6ec112..424b46387f72 100644 --- a/applications/nrf5340_audio/src/modules/Kconfig +++ b/applications/nrf5340_audio/src/modules/Kconfig @@ -14,7 +14,7 @@ config BUTTON_DEBOUNCE_MS config AUDIO_SYNC_TIMER_USES_RTC bool - default !BT_LL_ACS_NRF53 + default y select NRFX_RTC0 #----------------------------------------------------------------------------# diff --git a/applications/nrf5340_audio/src/modules/audio_i2s.c b/applications/nrf5340_audio/src/modules/audio_i2s.c index 02706fba071f..d8c113ae644e 100644 --- a/applications/nrf5340_audio/src/modules/audio_i2s.c +++ b/applications/nrf5340_audio/src/modules/audio_i2s.c @@ -86,8 +86,9 @@ void audio_i2s_set_next_buf(const uint8_t *tx_buf, uint32_t *rx_buf) __ASSERT_NO_MSG(tx_buf != NULL); } - const nrfx_i2s_buffers_t i2s_buf = { .p_rx_buffer = rx_buf, - .p_tx_buffer = (uint32_t *)tx_buf }; + const nrfx_i2s_buffers_t i2s_buf = {.p_rx_buffer = rx_buf, + .p_tx_buffer = (uint32_t *)tx_buf, + .buffer_size = I2S_SAMPLES_NUM}; nrfx_err_t ret; @@ -106,13 +107,14 @@ void audio_i2s_start(const uint8_t *tx_buf, uint32_t *rx_buf) __ASSERT_NO_MSG(tx_buf != NULL); } - const nrfx_i2s_buffers_t i2s_buf = { .p_rx_buffer = rx_buf, - .p_tx_buffer = (uint32_t *)tx_buf }; + const nrfx_i2s_buffers_t i2s_buf = {.p_rx_buffer = rx_buf, + .p_tx_buffer = (uint32_t *)tx_buf, + .buffer_size = I2S_SAMPLES_NUM}; nrfx_err_t ret; /* Buffer size in 32-bit words */ - ret = nrfx_i2s_start(&i2s_inst, &i2s_buf, I2S_SAMPLES_NUM, 0); + ret = nrfx_i2s_start(&i2s_inst, &i2s_buf, 0); __ASSERT_NO_MSG(ret == NRFX_SUCCESS); state = AUDIO_I2S_STATE_STARTED; diff --git a/applications/nrf5340_audio/src/modules/audio_sync_timer.c b/applications/nrf5340_audio/src/modules/audio_sync_timer.c deleted file mode 100644 index 483ebbe8e856..000000000000 --- a/applications/nrf5340_audio/src/modules/audio_sync_timer.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2021, PACKETCRAFT, INC. - * - * SPDX-License-Identifier: LicenseRef-PCFT - */ - -#include "audio_sync_timer.h" - -#include -#include -#include -#include -#include -#include - - -#include -LOG_MODULE_REGISTER(audio_sync_timer, CONFIG_AUDIO_SYNC_TIMER_LOG_LEVEL); - -#define AUDIO_SYNC_TIMER_INSTANCE_NUMBER 1 - -#define AUDIO_SYNC_TIMER_I2S_FRAME_START_EVT_CAPTURE_CHANNEL 0 -#define AUDIO_SYNC_TIMER_CURR_TIME_CAPTURE_CHANNEL 1 -#define AUDIO_SYNC_TIMER_I2S_FRAME_START_EVT_CAPTURE NRF_TIMER_TASK_CAPTURE0 - -#define AUDIO_SYNC_TIMER_NET_APP_IPC_EVT NRF_IPC_EVENT_RECEIVE_4 - -static const nrfx_timer_t audio_sync_timer_instance = - NRFX_TIMER_INSTANCE(AUDIO_SYNC_TIMER_INSTANCE_NUMBER); - -static uint8_t dppi_channel_timer_clear; -static uint8_t dppi_channel_i2s_frame_start; - -static nrfx_timer_config_t cfg = {.frequency = NRFX_MHZ_TO_HZ(1UL), - .mode = NRF_TIMER_MODE_TIMER, - .bit_width = NRF_TIMER_BIT_WIDTH_32, - .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, - .p_context = NULL}; - -uint32_t audio_sync_timer_capture(void) -{ - return nrfx_timer_capture(&audio_sync_timer_instance, - AUDIO_SYNC_TIMER_CURR_TIME_CAPTURE_CHANNEL); -} - -uint32_t audio_sync_timer_capture_get(void) -{ - return nrfx_timer_capture_get(&audio_sync_timer_instance, - AUDIO_SYNC_TIMER_I2S_FRAME_START_EVT_CAPTURE_CHANNEL); -} - -static void event_handler(nrf_timer_event_t event_type, void *ctx) -{ -} - -/** - * @brief Initialize audio sync timer - * - * @note Clearing of the nRF5340 APP core sync - * timer is initialized here. The sync timers on - * APP core and NET core are cleared at exactly - * the same time using an IPC signal sent from - * the NET core. This makes the two timers - * synchronized. - * - * @param unused Unused - * - * @return 0 if successful, error otherwise - */ -static int audio_sync_timer_init(void) -{ - nrfx_err_t ret; - - ret = nrfx_timer_init(&audio_sync_timer_instance, &cfg, event_handler); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx timer init error - Return value: %d", ret); - return ret; - } - - nrfx_timer_enable(&audio_sync_timer_instance); - - /* Initialize capturing of I2S frame start event timestamps */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_i2s_frame_start); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel alloc error (I2S frame start) - Return value: %d", ret); - return ret; - } - - nrf_timer_subscribe_set(audio_sync_timer_instance.p_reg, - AUDIO_SYNC_TIMER_I2S_FRAME_START_EVT_CAPTURE, - dppi_channel_i2s_frame_start); - nrf_i2s_publish_set(NRF_I2S0, NRF_I2S_EVENT_FRAMESTART, dppi_channel_i2s_frame_start); - ret = nrfx_dppi_channel_enable(dppi_channel_i2s_frame_start); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (I2S frame start) - Return value: %d", ret); - return ret; - } - - /* Initialize functionality for synchronization between APP and NET core */ - ret = nrfx_dppi_channel_alloc(&dppi_channel_timer_clear); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel alloc error (timer clear) - Return value: %d", ret); - return ret; - } - - nrf_ipc_publish_set(NRF_IPC, AUDIO_SYNC_TIMER_NET_APP_IPC_EVT, dppi_channel_timer_clear); - nrf_timer_subscribe_set(audio_sync_timer_instance.p_reg, NRF_TIMER_TASK_CLEAR, - dppi_channel_timer_clear); - ret = nrfx_dppi_channel_enable(dppi_channel_timer_clear); - if (ret - NRFX_ERROR_BASE_NUM) { - LOG_ERR("nrfx DPPI channel enable error (timer clear) - Return value: %d", ret); - return ret; - } - - LOG_DBG("Audio sync timer initialized"); - - return 0; -} - -SYS_INIT(audio_sync_timer_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/applications/nrf5340_audio/src/modules/led.h b/applications/nrf5340_audio/src/modules/led.h index dd3f4f4f7b2d..59dff83f4bbe 100644 --- a/applications/nrf5340_audio/src/modules/led.h +++ b/applications/nrf5340_audio/src/modules/led.h @@ -9,28 +9,28 @@ #include -#define LED_APP_RGB 0 -#define LED_NET_RGB 1 -#define LED_APP_1_BLUE 2 +#define LED_APP_RGB 0 +#define LED_NET_RGB 1 +#define LED_APP_1_BLUE 2 #define LED_APP_2_GREEN 3 #define LED_APP_3_GREEN 4 -#define RED 0 +#define RED 0 #define GREEN 1 -#define BLUE 2 +#define BLUE 2 #define GRN GREEN #define BLU BLUE enum led_color { - LED_COLOR_OFF, /* 000 */ - LED_COLOR_RED, /* 001 */ - LED_COLOR_GREEN, /* 010 */ - LED_COLOR_YELLOW, /* 011 */ - LED_COLOR_BLUE, /* 100 */ + LED_COLOR_OFF, /* 000 */ + LED_COLOR_RED, /* 001 */ + LED_COLOR_GREEN, /* 010 */ + LED_COLOR_YELLOW, /* 011 */ + LED_COLOR_BLUE, /* 100 */ LED_COLOR_MAGENTA, /* 101 */ - LED_COLOR_CYAN, /* 110 */ - LED_COLOR_WHITE, /* 111 */ + LED_COLOR_CYAN, /* 110 */ + LED_COLOR_WHITE, /* 111 */ LED_COLOR_NUM, }; @@ -44,14 +44,14 @@ enum led_color { * * @note A led unit is defined as an RGB LED or a monochrome LED. * - * @param led_unit Selected LED unit. Defines are located in board.h + * @param led_unit Selected LED unit. Defines are located in board.h. * @note If the given LED unit is an RGB LED, color must be * provided as a single vararg. See led_color. * For monochrome LEDs, the vararg will be ignored. * Using a LED unit assigned to another core will do nothing and return 0. - * @return 0 on success - * -EPERM if the module has not been initialised - * -EINVAL if the color argument is illegal + * @return 0 on success. + * -EPERM if the module has not been initialized. + * -EINVAL if the color argument is illegal. * Other errors from underlying drivers. */ int led_blink(uint8_t led_unit, ...); @@ -61,14 +61,14 @@ int led_blink(uint8_t led_unit, ...); * * @note A led unit is defined as an RGB LED or a monochrome LED. * - * @param led_unit Selected LED unit. Defines are located in board.h + * @param led_unit Selected LED unit. Defines are located in board.h. * @note If the given LED unit is an RGB LED, color must be * provided as a single vararg. See led_color. * For monochrome LEDs, the vararg will be ignored. -* Using a LED unit assigned to another core will do nothing and return 0. - * @return 0 on success - * -EPERM if the module has not been initialised - * -EINVAL if the color argument is illegal + * Using a LED unit assigned to another core will do nothing and return 0. + * @return 0 on success. + * -EPERM if the module has not been initialized. + * -EINVAL if the color argument is illegal. * Other errors from underlying drivers. */ int led_on(uint8_t led_unit, ...); @@ -79,23 +79,23 @@ int led_on(uint8_t led_unit, ...); * @note A led unit is defined as an RGB LED or a monochrome LED. * Using a LED unit assigned to another core will do nothing and return 0. * - * @param led_unit Selected LED unit. Defines are located in board.h - * @return 0 on success - * -EPERM if the module has not been initialised - * -EINVAL if the color argument is illegal + * @param led_unit Selected LED unit. Defines are located in board.h. + * @return 0 on success. + * -EPERM if the module has not been initialized. + * -EINVAL if the color argument is illegal. * Other errors from underlying drivers. */ int led_off(uint8_t led_unit); /** - * @brief Initialise the LED module + * @brief Initialise the LED module. * * @note This will parse the .dts files and configure all LEDs. * - * @return 0 on success - * -EPERM if already initialsed - * -ENXIO if a LED is missing unit number in dts - * -ENODEV if a LED is missing color identifier + * @return 0 on success. + * -EPERM if already initialized. + * -ENXIO if a LED is missing unit number in dts. + * -ENODEV if a LED is missing color identifier. */ int led_init(void); diff --git a/applications/nrf5340_audio/src/modules/power_meas.c b/applications/nrf5340_audio/src/modules/power_meas.c index d5dfb738af62..836dbfea3a3e 100644 --- a/applications/nrf5340_audio/src/modules/power_meas.c +++ b/applications/nrf5340_audio/src/modules/power_meas.c @@ -68,8 +68,8 @@ static int read_and_log(const struct power_rail_config *config) } LOG_INF("%-10s:\t%.3fV, %06.3fmA, %06.3fmW", config->name, sensor_value_to_double(&voltage), - sensor_value_to_double(¤t) * 1000.0f, - sensor_value_to_double(&power) * 1000.0f); + sensor_value_to_double(¤t) * 1000.0, + sensor_value_to_double(&power) * 1000.0); return 0; } diff --git a/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.c b/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.c index dd2c3c138489..d4baa459f8b9 100644 --- a/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.c +++ b/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.c @@ -32,10 +32,6 @@ static int hfclock_config_and_start(void) return ret; } - nrfx_clock_hfclk_start(); - while (!nrfx_clock_hfclk_is_running()) { - } - return 0; } @@ -59,16 +55,13 @@ static int leds_set(void) } else { ret = led_on(LED_APP_RGB, LED_COLOR_MAGENTA); } - - if (ret) { - return ret; - } #elif (CONFIG_AUDIO_DEV == GATEWAY) ret = led_on(LED_APP_RGB, LED_COLOR_GREEN); +#endif /* (CONFIG_AUDIO_DEV == HEADSET) */ + if (ret) { return ret; } -#endif /* (CONFIG_AUDIO_DEV == HEADSET) */ return 0; } diff --git a/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.h b/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.h index 1fdcc86b08cc..25490f58b7c9 100644 --- a/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.h +++ b/applications/nrf5340_audio/src/utils/nrf5340_audio_dk.h @@ -4,9 +4,16 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#ifndef _NRF5340_AUDIO_DK_H_ +#define _NRF5340_AUDIO_DK_H_ + +#include "led.h" + /** - * @brief Initialize the hardware related modules on the nRF5340 Audio DK/PCA10121 + * @brief Initialize the hardware related modules on the nRF5340 Audio DK/PCA10121. * * @return 0 if successful, error otherwise. */ int nrf5340_audio_dk_init(void); + +#endif /* _NRF5340_AUDIO_DK_H_ */ diff --git a/applications/nrf5340_audio/tools/buildprog/ble5-ctr-rpmsg_sign.py b/applications/nrf5340_audio/tools/buildprog/ble5-ctr-rpmsg_sign.py deleted file mode 100644 index 360fdc423dc3..000000000000 --- a/applications/nrf5340_audio/tools/buildprog/ble5-ctr-rpmsg_sign.py +++ /dev/null @@ -1,309 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -""" -Sign ble5-ctr-rpmsg BT Controller with B0N -""" - -import argparse -import sys -import shutil -import os -from pathlib import Path -import re - -BLE5_CTR_HEX = 'new_fw_info_ble5-ctr.hex' -FINAL_BLE5_CTR_HEX = 'ble5-ctr_CPUNET.hex' -FINAL_BLE5_CTR_UPDATE_BIN = 'ble5-ctr_net_core_update.bin' -ORIG_BLE5_CTR_PATTERN = r'ble5-ctr-rpmsg_shifted_\d+\.hex' -ORIG_BLE5_CTR_MIN_PATTERN = r'ble5-ctr-rpmsg_shifted_min_\d+\.hex' -NET_CORE_APP_NAME = 'empty_net_core' - -ZEPHYR_BASE = os.environ['ZEPHYR_BASE'] -MANUALLY_SIGN_DIR = Path(__file__).resolve().parent -BIN_DIR = (MANUALLY_SIGN_DIR / '../../bin').resolve() - - -def awklike(field_str, filename): - """ A function like unix awk to split string""" - ret = '' - try: - with open(filename, encoding='utf8') as file_pointer: - for line in file_pointer: - if field_str in line: - ret = line.replace(field_str, '').replace( - '\n', '').replace('"', '') - break - except (OSError, IOError) as exp: - print(exp) - return ret - - -def sign(orig_hex, build_dir): - """ A function to combine and sign ble5-ctr-""" - - if os.name == 'nt': - folder_slash = '\\' - else: - folder_slash = '/' - - # RETEIVE setting value from .config - # "${ZEPHYR_BASE}/../bootloader/mcuboot/root-rsa-2048.pem" - - mcuboot_rsa_key = awklike('CONFIG_BOOT_SIGNATURE_KEY_FILE=', build_dir + - '/mcuboot/zephyr/.config') - - # '\\' is used for Windows, '/' is used for other Operating Systems like Linux. - if ('/' in mcuboot_rsa_key) or ('\\' in mcuboot_rsa_key): - print('absolute path') - # Zephyr script convert folder separator to '/'. Should do the same here no matter Windows or not. - if folder_slash in mcuboot_rsa_key: - mcuboot_rsa_key.replace(folder_slash, '/') - else: - print('relative path') - mcuboot_rsa_key = ZEPHYR_BASE + '/../bootloader/mcuboot/' + mcuboot_rsa_key - - # IMAGE_VERSION="0.0.0+1" - image_version = awklike('CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION=', - build_dir + '/zephyr/.config') - # VALIDATION_MAGIC_VALUE="0x281ee6de,0x86518483,79106" - fw_info_magic_common = awklike('CONFIG_FW_INFO_MAGIC_COMMON=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - fw_info_magic_firmware_info = awklike('CONFIG_FW_INFO_MAGIC_FIRMWARE_INFO=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - sb_validation_info_magic = awklike('CONFIG_SB_VALIDATION_INFO_MAGIC=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - fw_info_firmware_version = awklike('CONFIG_FW_INFO_FIRMWARE_VERSION=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - fw_info_valid_val = awklike('CONFIG_FW_INFO_VALID_VAL=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - temp_ver = int(awklike('CONFIG_SB_VALIDATION_INFO_VERSION=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config')) - temp_hwid = int(awklike('CONFIG_FW_INFO_HARDWARE_ID=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config')) - temp_valid_crypto_id = int(awklike('CONFIG_SB_VALIDATION_INFO_CRYPTO_ID=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config')) - temp_crypto_id = int(awklike('CONFIG_FW_INFO_CRYPTO_ID=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config')) - temp_compat_id = int(awklike('CONFIG_FW_INFO_MAGIC_COMPATIBILITY_ID=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config')) - magic_compatibility_validation_info = temp_ver + (temp_hwid << 8) + (temp_valid_crypto_id << 16)\ - + (temp_compat_id << 24) - magic_compatibility_info = temp_ver + (temp_hwid << 8) + (temp_crypto_id << 16)\ - + (temp_compat_id << 24) - - validation_magic_value = f'{fw_info_magic_common},{sb_validation_info_magic},\ -{magic_compatibility_validation_info}' - - firmware_info_magic = f'{fw_info_magic_common},{fw_info_magic_firmware_info},\ -{magic_compatibility_info}' - - # 0x01008800 - pm_net_app_address = int(awklike('PM_APP_ADDRESS=', build_dir + - f'/{NET_CORE_APP_NAME}/pm_CPUNET.config'), 16) - # 0xc200/0x10200 - #PM_APP_APP_ADDRESS = int(awklike('PM_APP_ADDRESS=', build_dir + '/pm.config'), 16) - pm_app_app_address = awklike('PM_APP_ADDRESS=', build_dir + '/pm.config') - # CONFIG_FW_INFO_OFFSET 0x200 - fw_info_offset = int(awklike('CONFIG_FW_INFO_OFFSET=', build_dir + - f'/{NET_CORE_APP_NAME}/b0n/zephyr/.config'), 16) - # nRF5340_CPUAPP_QKAA - soc_name = awklike('CONFIG_SOC=', build_dir + '/zephyr/.config') - # nRF5340_CPUNET_QKAA - net_soc_name = awklike('CONFIG_SOC=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config') - # CONFIG_DOMAIN_CPUNET_BOARD net_core_app_update.binboard - net_core_app_binboard = awklike( - 'CONFIG_DOMAIN_CPUNET_BOARD=', build_dir + '/zephyr/.config') - # CONFIG_BOARD="nrf5340_audio_nrf5340_cpuapp" - config_board = awklike('CONFIG_BOARD=', build_dir + '/zephyr/.config') - - net_core_fw_info_address = pm_net_app_address + fw_info_offset - net_core_fw_info_address = f'0x{net_core_fw_info_address:08X}' - - # Inject FW_INFO from .config - os_cmd = f'{sys.executable} {MANUALLY_SIGN_DIR}/fw_info_data.py --input {orig_hex} --output-hex {build_dir}/{BLE5_CTR_HEX}\ - --offset {net_core_fw_info_address} --magic-value {firmware_info_magic}\ - --fw-version {fw_info_firmware_version} --fw-valid-val {fw_info_valid_val}' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - # 240 - num_ver_counter_slots = int(awklike('CONFIG_SB_NUM_VER_COUNTER_SLOTS=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config'), 10) - pm_partition_size_provision = int(awklike('CONFIG_PM_PARTITION_SIZE_PROVISION=', build_dir + - f'/{NET_CORE_APP_NAME}/zephyr/.config'), 16) - cpunet_pm_app_address = hex(int(awklike('PM_APP_ADDRESS=', build_dir + - f'/{NET_CORE_APP_NAME}/pm_CPUNET.config'), 16)) - pm_provision_address = int(awklike('PM_PROVISION_ADDRESS=', build_dir + - f'/{NET_CORE_APP_NAME}/pm_CPUNET.config'), 16) - pm_mcuboot_secondary_size = int(awklike('PM_MCUBOOT_SECONDARY_SIZE=', build_dir + - '/pm.config'), 16) - - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../nrf/scripts/bootloader/hash.py --in {build_dir}/{BLE5_CTR_HEX}\ - > {build_dir}/app_firmware.sha256' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../nrf/scripts/bootloader/do_sign.py --private-key\ - {build_dir}/{NET_CORE_APP_NAME}/zephyr/GENERATED_NON_SECURE_SIGN_KEY_PRIVATE.pem --in\ - {build_dir}/app_firmware.sha256 > {build_dir}/app_firmware.signature' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - public_keys = f' {build_dir}/{NET_CORE_APP_NAME}/zephyr/nrf/subsys/bootloader/generated/public.pem' - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../nrf/scripts/bootloader/validation_data.py\ - --input {build_dir}/{BLE5_CTR_HEX} --output-hex {build_dir}/signed_by_b0_ble5_ctr.hex\ - --output-bin {build_dir}/signed_by_b0_ble5_ctr.bin --offset 0 --signature\ - {build_dir}/app_firmware.signature --public-key {public_keys}\ - --magic-value {validation_magic_value}' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - # Generate net_core_app_update.bin - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../bootloader/mcuboot/scripts/imgtool.py sign --key\ - {mcuboot_rsa_key} --header-size {fw_info_offset} --align 4 --version {image_version}\ - --pad-header --slot-size {pm_mcuboot_secondary_size} {build_dir}/signed_by_b0_ble5_ctr.bin\ - {build_dir}/{FINAL_BLE5_CTR_UPDATE_BIN}' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - # Check if debug key exists - debug_public_key_0 = Path(f'{build_dir}/{NET_CORE_APP_NAME}/zephyr/GENERATED_NON_SECURE_PUBLIC_0.pem').resolve() - debug_public_key_1 = Path(f'{build_dir}/{NET_CORE_APP_NAME}/zephyr/GENERATED_NON_SECURE_PUBLIC_1.pem').resolve() - if debug_public_key_0.exists(): - public_keys += f',{str(debug_public_key_0)}' - if debug_public_key_1.exists(): - public_keys += f',{str(debug_public_key_1)}' - - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../nrf/scripts/bootloader/provision.py\ - --s0-addr {cpunet_pm_app_address} --provision-addr {pm_provision_address}\ - --public-key-files {public_keys}\ - --output {build_dir}/provision.hex --num-counter-slots-version {num_ver_counter_slots}\ - --max-size {pm_partition_size_provision}' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/scripts/build/mergehex.py -o {build_dir}/b0n_container.hex\ - {build_dir}/{BLE5_CTR_HEX} {build_dir}/provision.hex' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/scripts/build/mergehex.py -o {build_dir}/{FINAL_BLE5_CTR_HEX}\ - --overlap=replace {build_dir}/{NET_CORE_APP_NAME}/b0n/zephyr/zephyr.hex {build_dir}/b0n_container.hex\ - {build_dir}/provision.hex {build_dir}/{BLE5_CTR_HEX} {build_dir}/signed_by_b0_ble5_ctr.hex' - - ret_val = os.system(os_cmd) - if ret_val: - raise Exception('python error: ' + str(ret_val)) - - # Replace built net_core - src_path = f'{build_dir}/{FINAL_BLE5_CTR_UPDATE_BIN}' - dst_path = f'{build_dir}/zephyr/net_core_app_update.bin' - shutil.copy(src_path, dst_path) - - src_path = f'{build_dir}/{FINAL_BLE5_CTR_HEX}' - dst_path = f'{build_dir}/zephyr/net_core_app_signed.hex' - shutil.copy(src_path, dst_path) - - # Generate merged_domains.hex - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/scripts/build/mergehex.py -o {build_dir}/zephyr/merged_domains.hex\ - {build_dir}/{FINAL_BLE5_CTR_HEX} {build_dir}/zephyr/merged.hex' - - ret_val = os.system(os_cmd) - # Generate dfu_application.zip - # set(generate_script_params - # "${app_core_binary_name}load_address=$" - # "${app_core_binary_name}image_index=0" - # "${app_core_binary_name}slot_index_primary=1" - # "${app_core_binary_name}slot_index_secondary=2" - # "${app_core_binary_name}version_MCUBOOT=${CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION}" - # "${net_core_binary_name}image_index=1" - # "${net_core_binary_name}slot_index_primary=3" - # "${net_core_binary_name}slot_index_secondary=4" - # "${net_core_binary_name}load_address=$" - # "${net_core_binary_name}board=${CONFIG_DOMAIN_CPUNET_BOARD}" - # "${net_core_binary_name}version=${net_core_version}" - # "${net_core_binary_name}soc=${net_core_soc}" - # ) - os.remove(f'{build_dir}/zephyr/dfu_application.zip') - os_cmd = f'{sys.executable} {ZEPHYR_BASE}/../nrf/scripts/bootloader/generate_zip.py --bin-files\ - {build_dir}/zephyr/app_update.bin {build_dir}/zephyr/net_core_app_update.bin\ - --output {build_dir}/zephyr/dfu_application.zip --name nrf5340_audio\ - --meta-info-file {build_dir}/zephyr/zephyr.meta\ - app_update.binload_address={pm_app_app_address}\ - app_update.binimage_index=0\ - app_update.binslot_index_primary=1\ - app_update.binslot_index_secondary=2\ - app_update.binversion_MCUBOOT={image_version}\ - net_core_app_update.binimage_index=1\ - net_core_app_update.binslot_index_primary=3\ - net_core_app_update.binslot_index_secondary=4\ - net_core_app_update.binload_address={cpunet_pm_app_address}\ - net_core_app_update.binboard={net_core_app_binboard}\ - net_core_app_update.binversion={fw_info_firmware_version}\ - net_core_app_update.binsoc={net_soc_name}\ - type=application board={config_board} soc={soc_name}' - - ret_val = os.system(os_cmd) - - -def find_hex_name(options): - - in_path = Path(options.input_folder).resolve() - - # Add files only match pattern filename and includes digits for build number - pattern_found = sorted([ - file for file in in_path.iterdir()\ - if re.match(ORIG_BLE5_CTR_MIN_PATTERN if options.min_b0n else ORIG_BLE5_CTR_PATTERN, file.name)\ - is not None - ]) - - # Last hex file should be latest version. - return pattern_found[-1] - - -def __main(): - parser = argparse.ArgumentParser( - formatter_class=argparse.RawDescriptionHelpFormatter, - description='This script sign and generate netcore hex and upgradable binary for the\ - nRF5340 Audio project on Windows and Linux', - allow_abbrev=False) - parser.add_argument('-i', '--input_file', type=str, - help='Input hex file name. Higher priority than -I') - parser.add_argument('-b', '--build_dir', required=True, type=str, - help='Build folder.') - parser.add_argument('-I', '--input_folder', type=str, - help='Input hex folder, let script choose filename automatically.\ - Lower priority than -i') - parser.add_argument('-m', '--min_b0n', default=False, action='store_true', - help='B0N use minimal. Only valid if -I is assigned') - options = parser.parse_args(args=sys.argv[1:]) - - if options.input_file is not None: - input_file_name = options.input_file - elif options.input_folder is not None: - input_file_name = find_hex_name(options) - print(f'input hex name {input_file_name}') - sign(input_file_name, options.build_dir) - - -if __name__ == '__main__': - __main() diff --git a/applications/nrf5340_audio/tools/buildprog/buildprog.py b/applications/nrf5340_audio/tools/buildprog/buildprog.py index f475584a7f3f..ca1bc3feb947 100644 --- a/applications/nrf5340_audio/tools/buildprog/buildprog.py +++ b/applications/nrf5340_audio/tools/buildprog/buildprog.py @@ -15,8 +15,8 @@ import json import subprocess import re -import glob import getpass +from pathlib import Path from colorama import Fore, Style from prettytable import PrettyTable from nrf5340_audio_dk_devices import ( @@ -27,10 +27,8 @@ AudioDevice, SelectFlags, Core, - Controller, ) from program import program_threads_run -from pathlib import Path BUILDPROG_FOLDER = Path(__file__).resolve().parent @@ -41,7 +39,7 @@ else: AUDIO_KIT_SERIAL_NUMBERS_JSON = Path( os.getenv("AUDIO_KIT_SERIAL_NUMBERS_JSON")) -TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME = "nrf5340_audio_dk_nrf5340_cpuapp" +TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME = "nrf5340_audio_dk/nrf5340/cpuapp" TARGET_CORE_APP_FOLDER = NRF5340_AUDIO_FOLDER TARGET_DEV_HEADSET_FOLDER = NRF5340_AUDIO_FOLDER / "build/dev_headset" @@ -86,9 +84,11 @@ def __print_dev_conf(device_list): print(table) -def __build_cmd_get(core: Core, device: AudioDevice, build: BuildType, pristine, controller: Controller, child_image, options): +def __build_cmd_get(core: Core, device: AudioDevice, build: BuildType, + pristine, child_image, options): if core == Core.app: - build_cmd = f"west build {TARGET_CORE_APP_FOLDER} -b {TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME}" + build_cmd = (f"west build {TARGET_CORE_APP_FOLDER} " + f"-b {TARGET_BOARD_NRF5340_AUDIO_DK_APP_NAME}") if device == AudioDevice.headset: device_flag = "-DCONFIG_AUDIO_DEV=1" dest_folder = TARGET_DEV_HEADSET_FOLDER @@ -107,25 +107,12 @@ def __build_cmd_get(core: Core, device: AudioDevice, build: BuildType, pristine, else: raise Exception("Invalid build type!") - if options.mcuboot == 'internal': - device_flag += " -DCONFIG_AUDIO_DFU=1" - elif options.mcuboot == 'external': - device_flag += " -DCONFIG_AUDIO_DFU=2" - if options.min_b0n: - device_flag += " -DCONFIG_B0N_MINIMAL=y" - - if options.controller == Controller.acs_nrf53: - device_flag += " -DCONFIG_BT_LL_ACS_NRF53=y" + if not child_image: device_flag += " -DCONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=n" - if options.controller == Controller.sdc: - if not child_image: - device_flag += " -DCONFIG_NCS_INCLUDE_RPMSG_CHILD_IMAGE=n" - if options.nrf21540: device_flag += " -DSHIELD=nrf21540ek_fwd" - if options.controller == Controller.sdc: - device_flag += " -Dhci_ipc_SHIELD=nrf21540ek" + device_flag += " -Dhci_ipc_SHIELD=nrf21540ek" if options.custom_bt_name is not None and options.user_bt_name: raise Exception( @@ -168,7 +155,6 @@ def __build_module(build_config, options): build_config.device, build_config.build, build_config.pristine, - build_config.controller, build_config.child_image, options, ) @@ -207,38 +193,11 @@ def __populate_hex_paths(dev, options, child_image): """Poplulate hex paths where relevant""" _, temp_dest_folder, _, _ = __build_cmd_get( - Core.app, dev.nrf5340_audio_dk_dev, options.build, options.pristine, options.controller, child_image, options + Core.app, dev.nrf5340_audio_dk_dev, options.build, options.pristine, child_image, options ) - dest_folder = temp_dest_folder - - if options.controller == Controller.sdc: - dev.hex_path_app = dest_folder / "zephyr/zephyr.hex" - dev.hex_path_net = dest_folder / "hci_ipc/zephyr/zephyr.hex" - return - - if dev.core_app_programmed == SelectFlags.TBD: - if options.mcuboot != '': - dev.hex_path_app = dest_folder / "zephyr/merged.hex" - else: - dev.hex_path_app = dest_folder / "zephyr/zephyr.hex" - - if dev.core_net_programmed == SelectFlags.TBD: - hex_files_found = 0 - for hex_path in glob.glob(str(NRF_FOLDER) + "/lib/bin/bt_ll_acs_nrf53/bin/" + "ble5-ctr-rpmsg_" + "[0-9]" + "*" + ".hex"): - dev.hex_path_net = hex_path - hex_files_found += 1 - - if options.mcuboot != '': - dev.hex_path_net = dest_folder / "zephyr/net_core_app_signed.hex" - else: - dest_folder = NRF_FOLDER / "lib/bin/bt_ll_acs_nrf53/bin" - - if hex_files_found != 1: - raise Exception( - f"Found zero or multiple NET hex files in folder: {dest_folder}") - else: - print(f"Using NET hex: {dev.hex_path_net} for {dev}") + dev.hex_path_app = temp_dest_folder / "zephyr/zephyr.hex" + dev.hex_path_net = temp_dest_folder / "hci_ipc/zephyr/zephyr.hex" def __finish(device_list): @@ -255,8 +214,9 @@ def __main(): "This script builds and programs the nRF5340 " "Audio project on Windows and Linux" ), - epilog=("If there exists an environmental variable called \"AUDIO_KIT_SERIAL_NUMBERS_JSON\" which contains" - "the location of a json file, the program will use this file as a substitute for nrf5340_audio_dk_devices.json"), + epilog=("If there exists an environmental variable called \"AUDIO_KIT_SERIAL_NUMBERS_JSON\"" + "which contains the location of a json file," + "the program will use this file as a substitute for nrf5340_audio_dk_devices.json"), allow_abbrev=False ) parser.add_argument( @@ -311,8 +271,7 @@ def __main(): action="store_true", dest="sequential_prog", default=False, - help="Run nrfjprog sequentially instead of in \ - parallel", + help="Run nrfjprog sequentially instead of in parallel", ) parser.add_argument( "-f", @@ -322,34 +281,6 @@ def __main(): default=False, help="Recover device if programming fails", ) - parser.add_argument( - # Deprecated argument - "--ctlr", - type=str, - choices=[i.value for i in Controller], - dest="controller", - default=Controller.sdc.value, - help=Controller.acs_nrf53.value + \ - " is deprecated. Use the SoftDevice Controller instead (enabled by default).", - ) - # DFU relative option - parser.add_argument( - "-M", - "--min_b0n", - dest="min_b0n", - action='store_true', - default=False, - help="net core bootloader use minimal size build. Only for controller: " + - Controller.acs_nrf53, - ) - parser.add_argument( - "-m", - "--mcuboot", - required=("-M" in sys.argv or "--min_b0n" in sys.argv), - choices=["external", "internal"], - default='', - help="MCUBOOT with external, internal flash. Only for controller: " + Controller.acs_nrf53, - ) parser.add_argument( "--nrf21540", action="store_true", @@ -371,19 +302,12 @@ def __main(): action="store_true", dest="user_bt_name", default=False, - help="Set to generate a user specific Bluetooth device name. Note that this will put the computer user name on air in clear text", + help="Set to generate a user specific Bluetooth device name.\ + Note that this will put the computer user name on air in clear text", ) options = parser.parse_args(args=sys.argv[1:]) - if options.controller == Controller.acs_nrf53: - print(Fore.YELLOW + - "Deprecated app - controller combination" + Style.RESET_ALL) - if options.controller == Controller.sdc: - if options.mcuboot != '' or options.min_b0n: - raise Exception("DFU arguments only accepted when using controller: " + - Controller.acs_nrf53 + ". Please use standard tools.") - # Post processing for Enums if options.core is None: cores = [] @@ -424,7 +348,6 @@ def __main(): cores=cores, devices=devices, _only_reboot=options.only_reboot, - controller=options.controller, ) for dev in dev_arr ] @@ -435,8 +358,7 @@ def __main(): # Reboot step start if options.only_reboot == SelectFlags.TBD: - program_threads_run(device_list, options.mcuboot, - sequential=options.sequential_prog) + program_threads_run(device_list, sequential=options.sequential_prog) __finish(device_list) # Reboot step finished @@ -457,7 +379,6 @@ def __main(): device=AudioDevice.headset, pristine=options.pristine, build=options.build, - controller=options.controller, child_image=child_image, ) ) @@ -468,7 +389,6 @@ def __main(): device=AudioDevice.gateway, pristine=options.pristine, build=options.build, - controller=options.controller, child_image=child_image, ) ) @@ -486,8 +406,7 @@ def __main(): for dev in device_list: if dev.snr_connected: __populate_hex_paths(dev, options, child_image) - program_threads_run(device_list, options.mcuboot, - sequential=options.sequential_prog) + program_threads_run(device_list, sequential=options.sequential_prog) # Program step finished diff --git a/applications/nrf5340_audio/tools/buildprog/nrf5340_audio_dk_devices.py b/applications/nrf5340_audio/tools/buildprog/nrf5340_audio_dk_devices.py index 7d8eb296c78f..3da7ec4c0248 100644 --- a/applications/nrf5340_audio/tools/buildprog/nrf5340_audio_dk_devices.py +++ b/applications/nrf5340_audio/tools/buildprog/nrf5340_audio_dk_devices.py @@ -15,7 +15,6 @@ class SelectFlags(str, Enum): """Holds the available status flags""" - NOT = "Not selected" TBD = "Selected" DONE = "Done" @@ -23,34 +22,32 @@ class SelectFlags(str, Enum): class Core(str, Enum): + """SoC core""" app = "app" net = "network" both = "both" class AudioDevice(str, Enum): + """Audio device""" headset = "headset" gateway = "gateway" both = "both" class BuildType(str, Enum): + """Release or debug build""" release = "release" debug = "debug" class Channel(Enum): - # Value represents UICR channel + """Left or right Value represents UICR channel""" left = 0 right = 1 NA = auto() -class Controller(str, Enum): - acs_nrf53 = "ACS_nRF53" - sdc = "SDC" - - @dataclass class DeviceConf: """This config is populated according to connected SEGGER serial numbers @@ -66,7 +63,6 @@ class DeviceConf: cores: InitVar[List[Core]] devices: InitVar[List[AudioDevice]] _only_reboot: InitVar[SelectFlags] - controller: InitVar[List[Controller]] # Post init variables only_reboot: SelectFlags = field(init=False, default=SelectFlags.NOT) hex_path_app: Path = field(init=False, default=None) @@ -77,11 +73,10 @@ class DeviceConf: init=False, default=SelectFlags.NOT) def __post_init__( - self, cores: List[Core], devices: List[AudioDevice], _only_reboot: SelectFlags, controller: Controller, + self, cores: List[Core], devices: List[AudioDevice], _only_reboot: SelectFlags, ): device_selected = self.nrf5340_audio_dk_dev in devices self.only_reboot = _only_reboot if device_selected else SelectFlags.NOT - self.controller = controller if self.only_reboot == SelectFlags.TBD: return @@ -91,10 +86,10 @@ def __post_init__( self.core_net_programmed = SelectFlags.TBD def __str__(self): - str = f"{self.nrf5340_audio_dk_snr} {self.nrf5340_audio_dk_dev.name}" + result = f"{self.nrf5340_audio_dk_snr} {self.nrf5340_audio_dk_dev.name}" if self.nrf5340_audio_dk_dev == AudioDevice.headset: - str += f" {self.channel.name}" - return str + result += f" {self.channel.name}" + return result @dataclass @@ -105,5 +100,4 @@ class BuildConf: device: AudioDevice build: BuildType pristine: bool - controller: Controller child_image: bool diff --git a/applications/nrf5340_audio/tools/buildprog/program.py b/applications/nrf5340_audio/tools/buildprog/program.py index a5ca7ac7dc18..a75b80c4053b 100644 --- a/applications/nrf5340_audio/tools/buildprog/program.py +++ b/applications/nrf5340_audio/tools/buildprog/program.py @@ -9,16 +9,17 @@ from threading import Thread from os import system, path from typing import List -from nrf5340_audio_dk_devices import DeviceConf, SelectFlags, AudioDevice, Controller +from nrf5340_audio_dk_devices import DeviceConf, SelectFlags, AudioDevice MEM_ADDR_UICR_SNR = 0x00FF80F0 MEM_ADDR_UICR_CH = 0x00FF80F4 -def __populate_UICR(dev): +def __populate_uicr(dev): """Program UICR in device with information from JSON file""" if dev.nrf5340_audio_dk_dev == AudioDevice.headset: - cmd = f"nrfjprog --memwr {MEM_ADDR_UICR_CH} --val {dev.channel.value} --snr {dev.nrf5340_audio_dk_snr}" + cmd = (f"nrfjprog --memwr {MEM_ADDR_UICR_CH} --val {dev.channel.value} " + f"--snr {dev.nrf5340_audio_dk_snr}") # Write channel information to UICR print("Programming UICR") ret_val = system(cmd) @@ -26,7 +27,8 @@ def __populate_UICR(dev): if ret_val: return False - cmd = f"nrfjprog --memwr {MEM_ADDR_UICR_SNR} --val {dev.nrf5340_audio_dk_snr} --snr {dev.nrf5340_audio_dk_snr}" + cmd = (f"nrfjprog --memwr {MEM_ADDR_UICR_SNR} --val {dev.nrf5340_audio_dk_snr} " + f"--snr {dev.nrf5340_audio_dk_snr}") # Write segger nr to UICR ret_val = system(cmd) @@ -36,18 +38,15 @@ def __populate_UICR(dev): return True -def _program_cores(dev: DeviceConf, mcuboot_type) -> int: +def _program_cores(dev: DeviceConf) -> int: if dev.core_net_programmed == SelectFlags.TBD: if not path.isfile(dev.hex_path_net): - if dev.controller == Controller.sdc: - print( - "Controller: SDC. NET core hex not found. Built as APP core child image.") - if dev.controller == Controller.acs_nrf53: - print("Controller: acs_nrf53. NET core hex not found.") + print("NET core hex not found. Built as APP core child image.") return 1 print(f"Programming net core on: {dev}") - cmd = f"nrfjprog --program {dev.hex_path_net} -f NRF53 -q --snr {dev.nrf5340_audio_dk_snr} --sectorerase --coprocessor CP_NETWORK" + cmd = (f"nrfjprog --program {dev.hex_path_net} -f NRF53 -q " + f"--snr {dev.nrf5340_audio_dk_snr} --sectorerase --coprocessor CP_NETWORK") ret_val = system(cmd) if ret_val != 0: if not dev.recover_on_fail: @@ -58,7 +57,8 @@ def _program_cores(dev: DeviceConf, mcuboot_type) -> int: if dev.core_app_programmed == SelectFlags.TBD: print(f"Programming app core on: {dev}") - cmd = f"nrfjprog --program {dev.hex_path_app} -f NRF53 -q --snr {dev.nrf5340_audio_dk_snr} --chiperase --coprocessor CP_APPLICATION" + cmd = (f"nrfjprog --program {dev.hex_path_app} -f NRF53 -q " + f"--snr {dev.nrf5340_audio_dk_snr} --chiperase --coprocessor CP_APPLICATION") ret_val = system(cmd) if ret_val != 0: if not dev.recover_on_fail: @@ -67,17 +67,13 @@ def _program_cores(dev: DeviceConf, mcuboot_type) -> int: else: dev.core_app_programmed = SelectFlags.DONE # Populate UICR data matching the JSON file - if not __populate_UICR(dev): + if not __populate_uicr(dev): dev.core_app_programmed = SelectFlags.FAIL return 1 if dev.core_net_programmed != SelectFlags.NOT or dev.core_app_programmed != SelectFlags.NOT: - if mcuboot_type == 'external': - print(f"Hard resetting {dev}") - cmd = f"nrfjprog -p --snr {dev.nrf5340_audio_dk_snr}" - else: - print(f"Resetting {dev}") - cmd = f"nrfjprog -r --snr {dev.nrf5340_audio_dk_snr}" + print(f"Resetting {dev}") + cmd = f"nrfjprog -r --snr {dev.nrf5340_audio_dk_snr}" ret_val = system(cmd) if ret_val != 0: return ret_val @@ -99,7 +95,7 @@ def _recover(dev: DeviceConf): dev.core_app_programmed = SelectFlags.FAIL -def __program_thread(dev: DeviceConf, mcuboot_type): +def __program_thread(dev: DeviceConf): if dev.only_reboot == SelectFlags.TBD: print(f"Resetting {dev}") cmd = f"nrfjprog -r --snr {dev.nrf5340_audio_dk_snr}" @@ -107,13 +103,13 @@ def __program_thread(dev: DeviceConf, mcuboot_type): dev.only_reboot = SelectFlags.FAIL if ret_val else SelectFlags.DONE return - return_code = _program_cores(dev, mcuboot_type) + return_code = _program_cores(dev) if return_code != 0 and dev.recover_on_fail: _recover(dev) - _program_cores(dev, mcuboot_type) + _program_cores(dev) -def program_threads_run(devices_list: List[DeviceConf], mcuboot_type, sequential: bool = False): +def program_threads_run(devices_list: List[DeviceConf], sequential: bool = False): """Program devices in parallel""" threads = [] # First program net cores if applicable @@ -123,7 +119,7 @@ def program_threads_run(devices_list: List[DeviceConf], mcuboot_type, sequential dev.core_app_programmed = SelectFlags.NOT dev.core_net_programmed = SelectFlags.NOT continue - thread = Thread(target=__program_thread, args=(dev, mcuboot_type)) + thread = Thread(target=__program_thread, args=(dev,)) threads.append(thread) thread.start() if sequential: diff --git a/applications/nrf5340_audio/unicast_client/main.c b/applications/nrf5340_audio/unicast_client/main.c index 606a21330274..0631d154b7ed 100644 --- a/applications/nrf5340_audio/unicast_client/main.c +++ b/applications/nrf5340_audio/unicast_client/main.c @@ -17,7 +17,7 @@ #include "button_handler.h" #include "bt_le_audio_tx.h" #include "bt_mgmt.h" -#include "bt_rend.h" +#include "bt_rendering_and_capture.h" #include "bt_content_ctrl.h" #include "unicast_client.h" #include "le_audio_rx.h" @@ -75,11 +75,11 @@ static void content_control_msg_sub_thread(void) switch (msg.event) { case MEDIA_START: - unicast_client_start(); + unicast_client_start(BT_AUDIO_DIR_SINK); break; case MEDIA_STOP: - unicast_client_stop(); + unicast_client_stop(BT_AUDIO_DIR_SINK); break; default: @@ -118,9 +118,8 @@ static void button_msg_sub_thread(void) switch (msg.button_pin) { case BUTTON_PLAY_PAUSE: - if (IS_ENABLED(CONFIG_STREAM_BIDIRECTIONAL)) { - LOG_WRN("Play/pause not supported in walkie-talkie and " - "bidirectional mode"); + if (IS_ENABLED(CONFIG_WALKIE_TALKIE_DEMO)) { + LOG_WRN("Play/pause not supported in walkie-talkie mode"); break; } @@ -143,7 +142,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_UP: - ret = bt_rend_volume_up(); + ret = bt_r_and_c_volume_up(); if (ret) { LOG_WRN("Failed to increase volume: %d", ret); } @@ -151,7 +150,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_DOWN: - ret = bt_rend_volume_down(); + ret = bt_r_and_c_volume_down(); if (ret) { LOG_WRN("Failed to decrease volume: %d", ret); } @@ -182,7 +181,7 @@ static void button_msg_sub_thread(void) case BUTTON_5: if (IS_ENABLED(CONFIG_AUDIO_MUTE)) { - ret = bt_rend_volume_mute(false); + ret = bt_r_and_c_volume_mute(false); if (ret) { LOG_WRN("Failed to mute, ret: %d", ret); } @@ -325,7 +324,7 @@ static void bt_mgmt_evt_handler(const struct zbus_channel *chan) case BT_MGMT_SECURITY_CHANGED: LOG_INF("Security changed"); - ret = bt_rend_discover(msg->conn); + ret = bt_r_and_c_discover(msg->conn); if (ret) { LOG_WRN("Failed to discover rendering services"); } @@ -489,7 +488,7 @@ int main(void) ret = le_audio_rx_init(); ERR_CHK(ret); - ret = bt_rend_init(); + ret = bt_r_and_c_init(); ERR_CHK(ret); ret = bt_content_ctrl_init(); diff --git a/applications/nrf5340_audio/unicast_server/Kconfig.defaults b/applications/nrf5340_audio/unicast_server/Kconfig.defaults index f044c447e36c..eccf06f9662e 100644 --- a/applications/nrf5340_audio/unicast_server/Kconfig.defaults +++ b/applications/nrf5340_audio/unicast_server/Kconfig.defaults @@ -39,7 +39,8 @@ config BT_ASCS_ASE_SNK_COUNT default 1 config BT_ASCS_ASE_SRC_COUNT - default 1 + default 1 if STREAM_BIDIRECTIONAL + default 0 if !STREAM_BIDIRECTIONAL config BT_VCP_VOL_REND default y @@ -47,6 +48,12 @@ config BT_VCP_VOL_REND config BT_MCC default y +config BT_MCC_READ_MEDIA_STATE + default y + +config BT_MCC_SET_MEDIA_CONTROL_POINT + default y + # For fixing compatibility issue with Android 14 config BT_PAC_SNK_NOTIFIABLE default y diff --git a/applications/nrf5340_audio/unicast_server/main.c b/applications/nrf5340_audio/unicast_server/main.c index 749706358e1e..c85e30551bf5 100644 --- a/applications/nrf5340_audio/unicast_server/main.c +++ b/applications/nrf5340_audio/unicast_server/main.c @@ -17,7 +17,7 @@ #include "button_handler.h" #include "bt_le_audio_tx.h" #include "bt_mgmt.h" -#include "bt_rend.h" +#include "bt_rendering_and_capture.h" #include "audio_datapath.h" #include "bt_content_ctrl.h" #include "unicast_server.h" @@ -82,19 +82,18 @@ static void button_msg_sub_thread(void) switch (msg.button_pin) { case BUTTON_PLAY_PAUSE: - if (IS_ENABLED(CONFIG_STREAM_BIDIRECTIONAL)) { - LOG_WRN("Play/pause not supported in walkie-talkie and " - "bidirectional mode"); + if (IS_ENABLED(CONFIG_WALKIE_TALKIE_DEMO)) { + LOG_WRN("Play/pause not supported in walkie-talkie mode"); break; } - if (strm_state == STATE_STREAMING) { + if (bt_content_ctlr_media_state_playing()) { ret = bt_content_ctrl_stop(NULL); if (ret) { LOG_WRN("Could not stop: %d", ret); } - } else if (strm_state == STATE_PAUSED) { + } else if (!bt_content_ctlr_media_state_playing()) { ret = bt_content_ctrl_start(NULL); if (ret) { LOG_WRN("Could not start: %d", ret); @@ -107,7 +106,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_UP: - ret = bt_rend_volume_up(); + ret = bt_r_and_c_volume_up(); if (ret) { LOG_WRN("Failed to increase volume: %d", ret); } @@ -115,7 +114,7 @@ static void button_msg_sub_thread(void) break; case BUTTON_VOLUME_DOWN: - ret = bt_rend_volume_down(); + ret = bt_r_and_c_volume_down(); if (ret) { LOG_WRN("Failed to decrease volume: %d", ret); } @@ -146,7 +145,7 @@ static void button_msg_sub_thread(void) case BUTTON_5: if (IS_ENABLED(CONFIG_AUDIO_MUTE)) { - ret = bt_rend_volume_mute(false); + ret = bt_r_and_c_volume_mute(false); if (ret) { LOG_WRN("Failed to mute, ret: %d", ret); } @@ -353,11 +352,6 @@ static void bt_mgmt_evt_handler(const struct zbus_channel *chan) case BT_MGMT_SECURITY_CHANGED: LOG_INF("Security changed"); - ret = bt_rend_discover(msg->conn); - if (ret) { - LOG_WRN("Failed to discover rendering services"); - } - ret = bt_content_ctrl_discover(msg->conn); if (ret == -EALREADY) { LOG_DBG("Discovery in progress or already done"); @@ -429,7 +423,7 @@ static int ext_adv_populate(struct bt_data *ext_adv_buf, size_t ext_adv_buf_size ext_adv_buf[ext_adv_buf_cnt].data = uuid_buf.data; ext_adv_buf_cnt++; - ret = bt_rend_uuid_populate(&uuid_buf); + ret = bt_r_and_c_uuid_populate(&uuid_buf); if (ret) { LOG_ERR("Failed to add adv data from renderer: %d", ret); @@ -443,6 +437,12 @@ static int ext_adv_populate(struct bt_data *ext_adv_buf, size_t ext_adv_buf_size return ret; } + ret = bt_mgmt_manufacturer_uuid_populate(&uuid_buf, CONFIG_BT_DEVICE_MANUFACTURER_ID); + if (ret) { + LOG_ERR("Failed to add adv data with manufacturer ID: %d", ret); + return ret; + } + ret = unicast_server_adv_populate(&ext_adv_buf[ext_adv_buf_cnt], ext_adv_buf_size - ext_adv_buf_cnt); @@ -494,6 +494,8 @@ void streamctrl_send(void const *const data, size_t size, uint8_t num_ch) int main(void) { int ret; + enum bt_audio_location location; + enum audio_channel channel; static struct bt_data ext_adv_buf[CONFIG_EXT_ADV_BUF_MAX]; LOG_DBG("nRF5340 APP core started"); @@ -515,10 +517,18 @@ int main(void) ret = le_audio_rx_init(); ERR_CHK_MSG(ret, "Failed to initialize rx path"); - ret = unicast_server_enable(le_audio_rx_data_handler); + channel_assignment_get(&channel); + + if (channel == AUDIO_CH_L) { + location = BT_AUDIO_LOCATION_FRONT_LEFT; + } else { + location = BT_AUDIO_LOCATION_FRONT_RIGHT; + } + + ret = unicast_server_enable(le_audio_rx_data_handler, location); ERR_CHK_MSG(ret, "Failed to enable LE Audio"); - ret = bt_rend_init(); + ret = bt_r_and_c_init(); ERR_CHK(ret); ret = bt_content_ctrl_init(); diff --git a/applications/nrf_desktop/CMakeLists.txt b/applications/nrf_desktop/CMakeLists.txt index 61ef21d82dbf..572bbb99217a 100644 --- a/applications/nrf_desktop/CMakeLists.txt +++ b/applications/nrf_desktop/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) ################################################################################ # The application uses the configuration/ scheme for configuration files. -set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${BOARD}") +set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${NORMALIZED_BOARD_TARGET}") find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project("nRF52 Desktop" diff --git a/applications/nrf_desktop/board_configuration.rst b/applications/nrf_desktop/board_configuration.rst index 7f603dc59c53..71dc28cb9849 100644 --- a/applications/nrf_desktop/board_configuration.rst +++ b/applications/nrf_desktop/board_configuration.rst @@ -35,8 +35,8 @@ nRF Desktop board configuration files The nRF Desktop application comes with configuration files for the following reference designs: -nRF52840 Gaming Mouse (``nrf52840gmouse_nrf52840``) - * The reference design is defined in :file:`nrf/boards/arm/nrf52840gmouse_nrf52840` for the project-specific hardware. +nRF52840 Gaming Mouse (``nrf52840gmouse``) + * The reference design is defined in :file:`nrf/boards/nordic/nrf52840gmouse` for the project-specific hardware. * To achieve gaming-grade performance: * The application is configured to act as a gaming mouse, with both Bluetooth LE and USB transports enabled. @@ -46,14 +46,14 @@ nRF52840 Gaming Mouse (``nrf52840gmouse_nrf52840``) * The board supports ``debug`` (:file:`prj_fast_pair.conf`) and ``release`` (:file:`prj_release_fast_pair.conf`) :ref:`nrf_desktop_bluetooth_guide_fast_pair` configurations. Both configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``), and they support the firmware updates using the :ref:`nrf_desktop_dfu` and the :ref:`nrf_desktop_dfu_mcumgr`. -nRF52832 Desktop Mouse (``nrf52dmouse_nrf52832``) and nRF52810 Desktop Mouse (``nrf52810dmouse_nrf52810``) - * Both reference designs are meant for the project-specific hardware and are defined in :file:`nrf/boards/arm/nrf52dmouse_nrf52832` and :file:`nrf/boards/arm/nrf52810dmouse_nrf52810`, respectively. +nRF52832 Desktop Mouse (``nrf52dmouse``) and nRF52810 Desktop Mouse (``nrf52810dmouse``) + * Both reference designs are meant for the project-specific hardware and are defined in :file:`nrf/boards/nordic/nrf52dmouse` and :file:`nrf/boards/nordic/nrf52810dmouse`, respectively. * The application is configured to act as a mouse. * Only the Bluetooth LE transport is enabled. - Bluetooth uses either Zephyr's software link layer (``nrf52810dmouse_nrf52810``) or Nordic's SoftDevice link layer (``nrf52dmouse_nrf52832``). - * The preconfigured build types for both ``nrf52dmouse_nrf52832`` and ``nrf52810dmouse_nrf52810`` boards are without the bootloader due to memory size limits on the ``nrf52810dmouse_nrf52810`` board. + Bluetooth uses either Zephyr's software link layer (``nrf52810dmouse``) or Nordic's SoftDevice link layer (``nrf52dmouse``). + * The preconfigured build types for both ``nrf52dmouse`` and ``nrf52810dmouse`` boards are without the bootloader due to memory size limits on the ``nrf52810dmouse`` board. -Sample mouse, keyboard or dongle (``nrf52840dk_nrf52840``) +Sample mouse, keyboard or dongle (``nrf52840dk/nrf52840``) * The configuration uses the nRF52840 Development Kit. * The build types allow to build the application as mouse, keyboard or dongle. * Inputs are simulated based on the hardware button presses. @@ -61,43 +61,63 @@ Sample mouse, keyboard or dongle (``nrf52840dk_nrf52840``) * The board supports ``debug`` :ref:`nrf_desktop_bluetooth_guide_fast_pair` configuration that acts as a mouse (:file:`prj_fast_pair.conf`). The configuration uses the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``), and supports firmware updates using the :ref:`nrf_desktop_dfu` and the :ref:`nrf_desktop_dfu_mcumgr`. -Sample dongle (``nrf52833dk_nrf52833``) +Sample dongle (``nrf52833dk/nrf52833``) * The configuration uses the nRF52833 Development Kit. * The application is configured to act as a dongle that forwards data from both mouse and keyboard. * Bluetooth uses Nordic Semiconductor's SoftDevice link layer and is configured to act as a central. Input data comes from Bluetooth and is retransmitted to USB. * The configuration with the MCUboot bootloader is set as default. -Sample dongle (``nrf52833dk_nrf52820``) +Sample dongle (``nrf52833dk/nrf52820``) * The configuration uses the nRF52820 emulation on the nRF52833 Development Kit. * The application is configured to act as a dongle that forwards data from both mouse and keyboard. * Bluetooth uses Zephyr's software link layer and is configured to act as a central. Input data comes from Bluetooth and is retransmitted to USB. * |preconfigured_build_types| -nRF52832 Desktop Keyboard (``nrf52kbd_nrf52832``) - * The reference design used is defined in :file:`nrf/boards/arm/nrf52kbd_nrf52832` for the project-specific hardware. +nRF52832 Desktop Keyboard (``nrf52kbd``) + * The reference design used is defined in :file:`nrf/boards/nordic/nrf52kbd` for the project-specific hardware. * The application is configured to act as a keyboard, with the Bluetooth LE transport enabled. * Bluetooth is configured to use Nordic Semiconductor's SoftDevice link layer. * The preconfigured build types configure the device without the bootloader in debug mode and with B0 bootloader in release mode due to memory size limits. * The board supports ``release`` :ref:`nrf_desktop_bluetooth_guide_fast_pair` configuration (:file:`prj_release_fast_pair.conf`). The configuration uses the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``), and supports firmware updates using the :ref:`nrf_desktop_dfu` and the :ref:`nrf_desktop_dfu_mcumgr`. -nRF52840 USB Dongle (``nrf52840dongle_nrf52840``) and nRF52833 USB Dongle (``nrf52833dongle_nrf52833``) +nRF52840 USB Dongle (``nrf52840dongle/nrf52840``) and nRF52833 USB Dongle (``nrf52833dongle``) * Since the nRF52840 Dongle is generic and defined in Zephyr, project-specific changes are applied in the DTS overlay file. * The application is configured to act as a dongle that forwards data from both mouse and keyboard. * Bluetooth uses Nordic Semiconductor's SoftDevice link layer and is configured to act as a central. Input data comes from Bluetooth and is retransmitted to USB. - * The configuration with the B0 bootloader is set as default for the ``nrf52840dongle_nrf52840`` board and with the MCUboot bootloader is set as default for the ``nrf52833dongle_nrf52833`` board. + * The configuration with the B0 bootloader is set as default for the ``nrf52840dongle/nrf52840`` board and with the MCUboot bootloader is set as default for the ``nrf52833dongle`` board. -nRF52820 USB Dongle (``nrf52820dongle_nrf52820``) +nRF52820 USB Dongle (``nrf52820dongle``) * The application is configured to act as a dongle that forwards data from both mouse and keyboard. * Bluetooth uses Zephyr's software link layer and is configured to act as a central. Input data comes from Bluetooth and is retransmitted to USB. * |preconfigured_build_types| -Sample dongle (``nrf5340dk_nrf5340``) +Sample dongle (``nrf5340dk/nrf5340``) * The application is configured to act as a dongle that forwards data from both mouse and keyboard. * Bluetooth uses Nordic Semiconductor's SoftDevice link layer without LLPM and is configured to act as a central. Input data comes from Bluetooth and is retransmitted to USB. * The configuration with the B0 bootloader is set as default. + +Sample mouse or keyboard (``nrf54l15pdk/nrf54l15/cpuapp``) + * The configuration uses the nRF54L15 Preview Development Kit (PDK). + * The build types allow to build the application as a mouse or a keyboard. + * Inputs are simulated based on the hardware button presses. + On the PDK PCA10156, revision v0.2.1, GPIOs assigned to **Button 3** and **Button 4** do not support interrupts. + Because of this, the application cannot use those buttons. + * On the nRF54L15 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output. + Because of that, the PDK PCA10156 has the following limitations: + + * On the PDK revision v0.2.1, **LED 1** cannot be used for PWM output. + * On the PDK 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. + * Only Bluetooth LE transport is enabled. + Bluetooth LE is configured to use Nordic Semiconductor's SoftDevice Link Layer and Low Latency Packet Mode (LLPM). + * In debug configurations, logs are provided through the UART. + For detailed information on working with the nRF54L15 PDK, see the :ref:`ug_nrf54l15_gs` documentation. + * The configurations use the MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and support firmware updates using the :ref:`nrf_desktop_dfu`. diff --git a/applications/nrf_desktop/bootloader_dfu.rst b/applications/nrf_desktop/bootloader_dfu.rst index c5b74746b83a..1248ec732606 100644 --- a/applications/nrf_desktop/bootloader_dfu.rst +++ b/applications/nrf_desktop/bootloader_dfu.rst @@ -153,14 +153,14 @@ The pin is configured with the ``mcuboot-button0`` alias. The ``mcuboot-led0`` alias can be used to define the LED activated in the serial recovery mode. You must select the ``CONFIG_MCUBOOT_INDICATION_LED`` Kconfig option to enable the LED. By default, both the GPIO pin and the LED are defined in the board's DTS file. -See :file:`boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.dts` for an example of board's DTS file used by the nRF Desktop application. +See :file:`boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.dts` for an example of board's DTS file used by the nRF Desktop application. For an example of bootloader Kconfig configuration file defined by the application, see the MCUboot bootloader ``debug`` configuration defined for nRF52833 dongle (:file:`applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/child_image/mcuboot/prj.conf`). .. note:: The nRF Desktop devices use either the serial recovery DFU with a single application slot or the background DFU. Both mentioned firmware upgrade methods are not used simultaneously by any of the configurations. - For example, the ``nrf52840dk_nrf52840`` board in ``prj_mcuboot_smp.conf`` uses only the background DFU and does not enable the serial recovery feature. + For example, the ``nrf52840dk/nrf52840`` board in ``prj_mcuboot_smp.conf`` uses only the background DFU and does not enable the serial recovery feature. .. _nrf_desktop_bootloader_background_dfu: @@ -291,6 +291,6 @@ For example, the following line starts the upload of the new image to the device .. code-block:: console - mcumgr -t 60 --conntype serial --connstring=/dev/ttyACM0 image upload build-nrf52833dongle_nrf52833/zephyr/app_update.bin + mcumgr -t 60 --conntype serial --connstring=/dev/ttyACM0 image upload build-nrf52833dongle/zephyr/app_update.bin The command assumes that ``/dev/ttyACM0`` serial device is used by the MCUboot bootloader for the serial recovery. diff --git a/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj.conf b/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj.conf index 8d8a6a921e46..e3a889b2197c 100644 --- a/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj.conf @@ -54,10 +54,12 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=n ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1280 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1460 CONFIG_ISR_STACK_SIZE=1536 CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=1460 + +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y CONFIG_BOOT_BANNER=n diff --git a/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj_release.conf b/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj_release.conf index 4f5c1e929757..8fdc7fe3a557 100644 --- a/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52810dmouse_nrf52810/prj_release.conf @@ -50,10 +50,12 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=n ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1280 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1460 CONFIG_ISR_STACK_SIZE=1536 CONFIG_MAIN_STACK_SIZE=840 -CONFIG_BT_RX_STACK_SIZE=1460 + +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y CONFIG_BOOT_BANNER=n diff --git a/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj.conf b/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj.conf index 5997f5cc6913..a867cee25169 100644 --- a/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj.conf @@ -33,13 +33,15 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_ISR_STACK_SIZE=1280 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 +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y + CONFIG_BOOT_BANNER=n CONFIG_NUM_COOP_PRIORITIES=10 @@ -70,7 +72,7 @@ CONFIG_BT_LL_SW_SPLIT=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj_release.conf b/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj_release.conf index 64c8435c70bc..c3d21baeec01 100644 --- a/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj_release.conf @@ -31,13 +31,15 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_ISR_STACK_SIZE=1280 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 +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y + CONFIG_BOOT_BANNER=n CONFIG_PRINTK=n @@ -69,7 +71,7 @@ CONFIG_BT_LL_SW_SPLIT=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj.conf b/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj.conf index d83bacc06201..5437455eca33 100644 --- a/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj.conf @@ -33,14 +33,16 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_ISR_STACK_SIZE=1280 CONFIG_MAIN_STACK_SIZE=840 CONFIG_IDLE_STACK_SIZE=128 -CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y CONFIG_BT_HCI_TX_STACK_SIZE=1536 +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y + CONFIG_BOOT_BANNER=n CONFIG_NUM_COOP_PRIORITIES=10 @@ -71,7 +73,7 @@ CONFIG_BT_LL_SW_SPLIT=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj_release.conf b/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj_release.conf index 19dae57d0d2a..b553b69ed07f 100644 --- a/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj_release.conf @@ -31,14 +31,16 @@ CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y ################################################################################ # Zephyr Configuration -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_ISR_STACK_SIZE=1280 CONFIG_MAIN_STACK_SIZE=840 CONFIG_IDLE_STACK_SIZE=128 -CONFIG_BT_RX_STACK_SIZE=2048 CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y CONFIG_BT_HCI_TX_STACK_SIZE=1536 +# Reuse system workqueue as Bluetooth RX context to reduce memory consumption +CONFIG_BT_RECV_WORKQ_SYS=y + CONFIG_BOOT_BANNER=n CONFIG_PRINTK=n @@ -70,7 +72,7 @@ CONFIG_BT_LL_SW_SPLIT=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj.conf b/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj.conf index 006d157e4be4..8401d10d163a 100644 --- a/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj.conf @@ -77,7 +77,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ diff --git a/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj_release.conf b/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj_release.conf index 4c15881bf2eb..cad9ec490501 100644 --- a/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52833dk_nrf52833/prj_release.conf @@ -76,7 +76,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ # Bootloader Configuration diff --git a/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj.conf b/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj.conf index 28bb75f60127..75ae24186f35 100644 --- a/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj.conf @@ -73,7 +73,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ diff --git a/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj_release.conf b/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj_release.conf index cd7b00d2e486..79c54c0ef98b 100644 --- a/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj_release.conf @@ -71,7 +71,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ # Bootloader Configuration diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/app.overlay b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/app.overlay index 5fa69dcb1b21..af06a4db90da 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/app.overlay +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/app.overlay @@ -34,7 +34,7 @@ pwm_led2: led_pwm_2 { status = "okay"; pwms = <&pwm2 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>; - label = "LED Caps Lock"; + label = "LED Num Lock"; }; }; @@ -45,7 +45,7 @@ pwm_led3: led_pwm_3 { status = "okay"; pwms = <&pwm3 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>; - label = "LED Num Lock"; + label = "LED Caps Lock"; }; }; }; diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_fast_pair.conf index 8d2ab9c9a2d0..341958fff5d5 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_fast_pair.conf @@ -25,7 +25,6 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private_fast_pair.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y # Reduce memory consumption diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf index c1ee68152aad..5e143ee16def 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf @@ -22,7 +22,6 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y # Logger diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj.conf index 457d4c93b3c9..1267a78d64f3 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj.conf @@ -45,6 +45,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf index 09444481625b..bbe99cca8e75 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf @@ -83,7 +83,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n 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 d7ca3c3cac8b..e693b7e5055d 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_fast_pair.conf @@ -67,6 +67,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_keyboard.conf index bc47b121a297..d6bce8e801cd 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_keyboard.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_keyboard.conf @@ -52,6 +52,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_qspi.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_qspi.conf index 320ea40495bc..109fc076caae 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_qspi.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_qspi.conf @@ -49,6 +49,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=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 0984a5ea6798..3e16613868cb 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_mcuboot_smp.conf @@ -53,6 +53,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_release.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_release.conf index f6d92388a09f..9b8f067d780f 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -41,6 +41,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_wwcb.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_wwcb.conf index 10c73c80f7ff..839d7bc70943 100644 --- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_wwcb.conf +++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_wwcb.conf @@ -51,6 +51,7 @@ 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 CONFIG_DESKTOP_HFCLK_LOCK_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf index ca03286a5a2b..db473725db75 100644 --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf @@ -85,7 +85,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_3bleconn.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_3bleconn.conf index 9d4c2403550b..4bbfa6037236 100644 --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_3bleconn.conf +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_3bleconn.conf @@ -96,7 +96,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=2500 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_BT_HOGP_REPORTS_MAX=30 diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_4llpmconn.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_4llpmconn.conf index fa6565544be6..4c9e1d2126b4 100644 --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_4llpmconn.conf +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_4llpmconn.conf @@ -95,7 +95,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_BT_HOGP_REPORTS_MAX=30 diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release.conf index bbc5308688bf..677b8842f242 100644 --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release.conf @@ -83,7 +83,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_ENTROPY_CC3XX=n diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release_4llpmconn.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release_4llpmconn.conf index c868103101c0..3987b727c2f7 100644 --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release_4llpmconn.conf +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj_release_4llpmconn.conf @@ -93,7 +93,7 @@ CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_BUF_ACL_TX_SIZE=35 CONFIG_BT_CTLR_DATA_LENGTH_MAX=35 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 CONFIG_BT_HOGP_REPORTS_MAX=30 diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj.conf index ad366480bcb8..a74ea1c2baef 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj.conf @@ -35,6 +35,13 @@ CONFIG_SERIAL=n CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ASSERT=n +# Disable USB +CONFIG_USB_NRFX=n +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_NRF_USBD_COMMON=n +CONFIG_USB_DEVICE_STACK=n +CONFIG_USB_DEVICE_DRIVER=n + # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj_release.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj_release.conf index 7145ab14ce69..6d48da9aed80 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/b0/prj_release.conf @@ -35,6 +35,12 @@ CONFIG_SERIAL=n CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ASSERT=n +CONFIG_USB_NRFX=n +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_NRF_USBD_COMMON=n +CONFIG_USB_DEVICE_STACK=n +CONFIG_USB_DEVICE_DRIVER=n + # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_fast_pair.conf index c2eae49fc0b2..969caa6c2a60 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_fast_pair.conf @@ -25,12 +25,18 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private_fast_pair.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y # Reduce memory consumption CONFIG_BOOT_BANNER=n +# Disable USB +CONFIG_USB_NRFX=n +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_NRF_USBD_COMMON=n +CONFIG_USB_DEVICE_STACK=n +CONFIG_USB_DEVICE_DRIVER=n + # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf index 18a918ca320c..2210cb5a36f7 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_mcuboot_smp.conf @@ -20,7 +20,6 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y # Decrease memory footprint @@ -36,6 +35,13 @@ CONFIG_TIMESLICING=n CONFIG_ARM_MPU=n CONFIG_THREAD_STACK_INFO=n +# Disable USB +CONFIG_USB_NRFX=n +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_NRF_USBD_COMMON=n +CONFIG_USB_DEVICE_STACK=n +CONFIG_USB_DEVICE_DRIVER=n + # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y diff --git a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_release_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_release_fast_pair.conf index bc23e736e5ac..f0ed1590e740 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_release_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/child_image/mcuboot/prj_release_fast_pair.conf @@ -25,9 +25,15 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private_fast_pair.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y +# Disable USB +CONFIG_USB_NRFX=n +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_NRF_USBD_COMMON=n +CONFIG_USB_DEVICE_STACK=n +CONFIG_USB_DEVICE_DRIVER=n + # Reduce memory consumption CONFIG_BOOT_BANNER=n 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 f3ee305e5f3b..6054e38aea94 100644 --- a/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_fast_pair.conf @@ -81,7 +81,7 @@ 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=-18 +CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-11 CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=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 017a47d9c8ae..ea47f85af501 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 @@ -74,7 +74,7 @@ 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=-18 +CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-11 CONFIG_DESKTOP_BLE_PEER_CONTROL=y CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0007 diff --git a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/child_image/mcuboot/prj_release_fast_pair.conf b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/child_image/mcuboot/prj_release_fast_pair.conf index bc23e736e5ac..be69f05f0731 100644 --- a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/child_image/mcuboot/prj_release_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/child_image/mcuboot/prj_release_fast_pair.conf @@ -25,7 +25,6 @@ CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private_fast_pair.pem" # Flash CONFIG_FLASH=y -CONFIG_BOOT_ERASE_PROGRESSIVELY=y CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y # Reduce memory consumption diff --git a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj.conf b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj.conf index 7baef301a38c..95a3919183e5 100644 --- a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj.conf +++ b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj.conf @@ -49,6 +49,7 @@ CONFIG_DESKTOP_BLE_ENABLE_PASSKEY=y CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y +CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y CONFIG_DESKTOP_FN_KEYS_ENABLE=y CONFIG_DESKTOP_FN_KEYS_SWITCH=0x111 diff --git a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release.conf b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release.conf index 032193ce15b5..aebcfedd5a0b 100644 --- a/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf52kbd_nrf52832/prj_release.conf @@ -45,6 +45,7 @@ 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 CONFIG_DESKTOP_FN_KEYS_ENABLE=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 1a8ecfb1a532..40043c3189f4 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 @@ -62,6 +62,7 @@ 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 CONFIG_DESKTOP_FN_KEYS_ENABLE=y diff --git a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf index b461405bb85c..7fb1d3a30650 100644 --- a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf +++ b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -74,7 +74,7 @@ CONFIG_LED_PWM=y CONFIG_BT_PRIVACY=y CONFIG_BT_BUF_ACL_TX_SIZE=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ diff --git a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf index 68867d915172..11930543cebc 100644 --- a/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -72,7 +72,7 @@ CONFIG_LED_PWM=y CONFIG_BT_PRIVACY=y CONFIG_BT_BUF_ACL_TX_SIZE=35 -CONFIG_BT_L2CAP_TX_BUF_COUNT=6 +CONFIG_BT_ATT_TX_COUNT=6 ################################################################################ # Bootloader Configuration 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 72d898304164..000000000000 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* Redefine the partition map. */ -&rram0 { - /delete-node/ partitions; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - app_partition: partition@0 { - label = "application"; - reg = <0x0 0x177000>; - }; - - storage_partition: partition@177000 { - label = "storage"; - reg = <0x177000 0x6000>; - }; - }; -}; - -/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */ -&wdt30 { - status = "okay"; -}; - -/ { - chosen { - zephyr,flash = &rram0; - zephyr,code-partition = &app_partition; - }; - - /* Disable leds and redefine them to align configuration with CAF LEDs requirements. */ - leds { - status = "disabled"; - }; - - gpioled0 { - compatible = "gpio-leds"; - status = "okay"; - label = "LED System State"; - - led0_g: led_0 { - gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - }; - - gpioled1 { - compatible = "gpio-leds"; - status = "okay"; - label = "LED Conn State"; - - led1_g: led_1 { - gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - }; - - gpioled2 { - compatible = "gpio-leds"; - status = "okay"; - label = "LED Num Lock"; - - led2_g: led_2 { - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - label = "Green LED 2"; - }; - }; - - gpioled3 { - compatible = "gpio-leds"; - status = "okay"; - label = "LED Caps Lock"; - - led3_g: led_3 { - gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; - label = "Green LED 3"; - }; - }; -}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.conf new file mode 100644 index 000000000000..34d5670086e0 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ + +# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.1 do not support interrupts. +# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to +# generate motion. +CONFIG_CAF_BUTTONS_DEF_PATH="buttons_def_0_2_0.h" +CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 +CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 +CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay new file mode 100644 index 000000000000..fedf236dc8ae --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay @@ -0,0 +1,112 @@ +/* + * 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. */ +&wdt30 { + status = "okay"; +}; + +/ { + /* Disable pwmleds and redefine them to align configuration with CAF LEDs requirements. + * The configuration needs to match the used board revision (v0.2.0). + */ + /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/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_keyboard.conf new file mode 100644 index 000000000000..6f8691262b50 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_keyboard.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ + + +# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.1 do not support interrupts. +# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to +# generate keypresses. +CONFIG_CAF_BUTTONS_DEF_PATH="buttons_def_0_2_0.h" +CONFIG_DESKTOP_HID_STATE_HID_KEYMAP_DEF_PATH="hid_keymap_def_keyboard_0_2_0.h" +CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID=0x01 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_release.conf new file mode 100644 index 000000000000..34d5670086e0 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1_release.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ + +# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.1 do not support interrupts. +# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to +# generate motion. +CONFIG_CAF_BUTTONS_DEF_PATH="buttons_def_0_2_0.h" +CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 +CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 +CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay new file mode 100644 index 000000000000..2420ad373c44 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf54l15pdk_nrf54l15_cpuapp_0_3_0_fixup.dtsi" + +/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */ +&wdt30 { + status = "okay"; +}; + +/ { + /* Disable pwmleds and redefine them to align configuration with CAF LEDs requirements. + * The configuration needs to match the used board revision (v0.3.0). + */ + /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/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0_fixup.dtsi b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0_fixup.dtsi new file mode 100644 index 000000000000..bf0931cdfb05 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0_fixup.dtsi @@ -0,0 +1,44 @@ +/* Ths file content is copied from the "nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay" file defined in + * nrf54l15pdk_nrf54l15 board directory. The file from the board directory is not automatically used + * e.g. for mcuboot_secondary_app child image. Application applies content of the file manually to + * workaround the problem. + */ + +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + +&led0 { + gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; +}; + +&led1 { + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; +}; + +&led2 { + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; +}; + +&led3 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; +}; + +&button0 { + gpios = <&gpio1 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; + +&button1 { + gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; + +&button2 { + gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; + +&button3 { + gpios = <&gpio0 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h index 6187040060d6..5aee49473efb 100644 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h @@ -20,7 +20,6 @@ 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) }, - /* GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. - * Because of this, the GPIOs cannot be used by the CAF buttons module. - */ + { .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_def_0_2_0.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def_0_2_0.h new file mode 100644 index 000000000000..6bca390a720c --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def_0_2_0.h @@ -0,0 +1,26 @@ +/* + * 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) }, + /* GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.1 do not support interrupts. + * Because of this, the GPIOs cannot be used by the CAF buttons module. + */ +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/mcuboot_private.pem b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/mcuboot_private.pem new file mode 100644 index 000000000000..af30c7b46e05 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/mcuboot_private.pem @@ -0,0 +1,28 @@ +-----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/child_image/mcuboot/prj.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj.conf new file mode 100644 index 000000000000..fe3fdc1383b5 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj.conf @@ -0,0 +1,41 @@ +# +# 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_DIRECT_XIP=y +CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y + +CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n +CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem" + +# Flash +CONFIG_FLASH=y + +# Reduce memory consumption +CONFIG_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/child_image/mcuboot/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj_keyboard.conf new file mode 100644 index 000000000000..fe3fdc1383b5 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj_keyboard.conf @@ -0,0 +1,41 @@ +# +# 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_DIRECT_XIP=y +CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y + +CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n +CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem" + +# Flash +CONFIG_FLASH=y + +# Reduce memory consumption +CONFIG_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/child_image/mcuboot/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj_release.conf new file mode 100644 index 000000000000..fe3fdc1383b5 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/child_image/mcuboot/prj_release.conf @@ -0,0 +1,41 @@ +# +# 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_DIRECT_XIP=y +CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y + +CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=n +CONFIG_BOOT_SIGNATURE_KEY_FILE="mcuboot_private.pem" + +# Flash +CONFIG_FLASH=y + +# Reduce memory consumption +CONFIG_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/hid_keyboard_leds_def_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h index 3292b1cb6197..5a22e001e202 100644 --- 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 @@ -15,13 +15,23 @@ */ 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, the PDK PCA10156 has the following limitations: + * + * - On the PDK revision v0.2.1, **LED 1** cannot be used for PWM output. + * - On the PDK 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] = 3, + [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_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h index 7720cc8331bc..02dff560c18c 100644 --- 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 @@ -23,6 +23,8 @@ const struct {} hid_keymap_def_include_once; */ 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 */ diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard_0_2_0.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard_0_2_0.h new file mode 100644 index 000000000000..7720cc8331bc --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard_0_2_0.h @@ -0,0 +1,55 @@ +/* + * 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, 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/led_state_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h index 7fdac8b5b42f..2ed42ce067b6 100644 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h @@ -23,10 +23,21 @@ static const uint8_t led_map[LED_ID_COUNT] = { [LED_ID_PEER_STATE] = 1 }; +/* On the nRF54L15 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output. + * Because of that, the PDK PCA10156 has the following limitations: + * + * - On the PDK revision v0.2.1, **LED 1** cannot be used for PWM output. + * - On the PDK 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(200, 200, 200)), - [LED_SYSTEM_STATE_CHARGING] = LED_EFFECT_LED_ON(LED_COLOR(200, 200, 200)), - [LED_SYSTEM_STATE_ERROR] = LED_EFFECT_LED_BLINK(200, LED_COLOR(200, 200, 200)), + [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] = { diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml new file mode 100644 index 000000000000..0525b519b522 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static.yml @@ -0,0 +1,47 @@ +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_keyboard.yml b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_keyboard.yml new file mode 100644 index 000000000000..0525b519b522 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_keyboard.yml @@ -0,0 +1,47 @@ +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 new file mode 100644 index 000000000000..0525b519b522 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/pm_static_release.yml @@ -0,0 +1,47 @@ +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/prj.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf index 8ae5717df59c..c5c462f04c9a 100644 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf @@ -17,13 +17,10 @@ CONFIG_DESKTOP_DEVICE_PID=0x52DE CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y -CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 -CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 -# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. -# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to -# generate motion. -CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +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 @@ -43,15 +40,12 @@ CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -# The nRF54L target does not support DFU yet. -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n +CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y ################################################################################ # Zephyr Configuration -# Use code partition defined in the DTS. -CONFIG_USE_DT_CODE_PARTITION=y - CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 CONFIG_ISR_STACK_SIZE=1536 CONFIG_MAIN_STACK_SIZE=840 @@ -78,8 +72,10 @@ CONFIG_REBOOT=y CONFIG_SPEED_OPTIMIZATIONS=y +CONFIG_PWM=y + CONFIG_LED=y -CONFIG_LED_GPIO=y +CONFIG_LED_PWM=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_ID_MAX=3 @@ -106,3 +102,13 @@ CONFIG_LOG_MODE_DEFERRED=y CONFIG_LOG_PRINTK=y CONFIG_LOG_BUFFER_SIZE=4096 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 + +################################################################################ +# Bootloader Configuration + +CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y +CONFIG_STREAM_FLASH=y +CONFIG_IMG_MANAGER=y +CONFIG_MCUBOOT_IMG_MANAGER=y +CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf index c973afaee511..f9cef0666503 100644 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf @@ -34,7 +34,7 @@ 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=0x01 +CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID=0x03 CONFIG_DESKTOP_BLE_PEER_CONTROL=y CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 @@ -46,15 +46,12 @@ CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -# The nRF54L target does not support DFU yet. -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n +CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y ################################################################################ # Zephyr Configuration -# Use code partition defined in the DTS. -CONFIG_USE_DT_CODE_PARTITION=y - CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 CONFIG_ISR_STACK_SIZE=1536 CONFIG_MAIN_STACK_SIZE=840 @@ -80,8 +77,10 @@ CONFIG_REBOOT=y CONFIG_SPEED_OPTIMIZATIONS=y +CONFIG_PWM=y + CONFIG_LED=y -CONFIG_LED_GPIO=y +CONFIG_LED_PWM=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_ID_MAX=3 @@ -108,3 +107,13 @@ CONFIG_LOG_MODE_DEFERRED=y CONFIG_LOG_PRINTK=y CONFIG_LOG_BUFFER_SIZE=4096 CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 + +################################################################################ +# Bootloader Configuration + +CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y +CONFIG_STREAM_FLASH=y +CONFIG_IMG_MANAGER=y +CONFIG_MCUBOOT_IMG_MANAGER=y +CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf index ab877607be9c..5e9b34a691c3 100644 --- a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf @@ -12,13 +12,10 @@ CONFIG_DESKTOP_DEVICE_PID=0x52DE CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y -CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 -CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 -# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. -# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to -# generate motion. -CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +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 @@ -39,15 +36,12 @@ CONFIG_DESKTOP_WATCHDOG_ENABLE=y CONFIG_DESKTOP_FAILSAFE_ENABLE=y CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y -# The nRF54L target does not support DFU yet. -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n +CONFIG_DESKTOP_CONFIG_CHANNEL_OUT_REPORT=y +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y ################################################################################ # Zephyr Configuration -# Use code partition defined in the DTS. -CONFIG_USE_DT_CODE_PARTITION=y - CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 CONFIG_ISR_STACK_SIZE=1536 CONFIG_MAIN_STACK_SIZE=840 @@ -79,8 +73,10 @@ CONFIG_REBOOT=y CONFIG_SPEED_OPTIMIZATIONS=y +CONFIG_PWM=y + CONFIG_LED=y -CONFIG_LED_GPIO=y +CONFIG_LED_PWM=y CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_ID_MAX=3 @@ -88,3 +84,13 @@ CONFIG_BT_ID_MAX=3 CONFIG_BT_CTLR_SDC_LLPM=y CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y CONFIG_BT_CONN_TX_MAX=4 + +################################################################################ +# Bootloader Configuration + +CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP=y +CONFIG_STREAM_FLASH=y +CONFIG_IMG_MANAGER=y +CONFIG_MCUBOOT_IMG_MANAGER=y +CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n diff --git a/applications/nrf_desktop/description.rst b/applications/nrf_desktop/description.rst index d476f4b17180..2df6341b1747 100644 --- a/applications/nrf_desktop/description.rst +++ b/applications/nrf_desktop/description.rst @@ -206,7 +206,7 @@ All of these reports use predefined report format and provide the given informat For example, the mouse motion is forwarded as HID mouse report. An nRF Desktop device supports the selected subset of the HID input reports. -For example, the nRF Desktop keyboard reference design (``nrf52kbd_nrf52832``) supports HID keyboard report, HID consumer control report and HID system control report. +For example, the nRF Desktop keyboard reference design (``nrf52kbd``) supports HID keyboard report, HID consumer control report and HID system control report. As an example, the following section describes handling HID mouse report data. @@ -261,7 +261,7 @@ The nRF Desktop supports the HID keyboard LED report. The report is used by the host to update the state of the keyboard LEDs, for example to indicate that the Caps Lock key is active. .. note:: - Only the ``nrf52840dk_nrf52840`` in ``keyboard`` configuration has hardware LEDs that can be used to display the Caps Lock and Num Lock state. + Only the ``nrf52840dk/nrf52840`` in ``keyboard`` configuration has hardware LEDs that can be used to display the Caps Lock and Num Lock state. The following diagrams show the HID output report data exchange between the application modules. @@ -363,7 +363,7 @@ Depending on the development kit you use, you need to select the respective conf .. table-from-rows:: /includes/sample_board_rows.txt :header: heading - :rows: nrf52840dk_nrf52840, nrf52833dk_nrf52833, nrf52833dk_nrf52820, nrf5340dk_nrf5340_cpuapp + :rows: nrf52840dk_nrf52840, nrf52833dk_nrf52833, nrf52833dk_nrf52820, nrf5340dk_nrf5340_cpuapp, nrf54l15pdk_nrf54l15_cpuapp Depending on the configuration, a DK may act either as mouse, keyboard or dongle. For information about supported configurations for each board, see the :ref:`nrf_desktop_board_configuration_files` section. @@ -382,7 +382,7 @@ The nRF Desktop application does not use a single :file:`prj.conf` file. Before you start testing the application, you can select one of the build types supported by the application. Not every board supports all of the mentioned build types. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The application supports the following build types: @@ -392,7 +392,7 @@ The application supports the following build types: * - Build type - File name - - Supported board + - Supported build target - Description * - Debug (default) - :file:`prj.conf` @@ -404,44 +404,44 @@ The application supports the following build types: - Release version of the application with no debugging features. * - Debug Fast Pair - :file:`prj_fast_pair.conf` - - ``nrf52840dk_nrf52840``, ``nrf52840gmouse_nrf52840`` + - ``nrf52840dk/nrf52840``, ``nrf52840gmouse/nrf52840`` - Debug version of the application with `Fast Pair`_ support. * - Release Fast Pair - :file:`prj_release_fast_pair.conf` - - ``nrf52kbd_nrf52832``, ``nrf52840gmouse_nrf52840`` + - ``nrf52kbd/nrf52832``, ``nrf52840gmouse/nrf52840`` - Release version of the application with `Fast Pair`_ support. * - Dongle - :file:`prj_dongle.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Debug version of the application that lets you generate the application with the dongle role. * - Keyboard - :file:`prj_keyboard.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Debug version of the application that lets you generate the application with the keyboard role. * - MCUboot QSPI - :file:`prj_mcuboot_qspi.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Debug version of the application that uses MCUboot with the secondary slot in the external QSPI FLASH. * - MCUboot SMP - :file:`prj_mcuboot_smp.conf` - - ``nrf52840dk_nrf52840``, ``nrf52840gmouse_nrf52840`` + - ``nrf52840dk/nrf52840``, ``nrf52840gmouse/nrf52840`` - | Debug version of the application that enables MCUmgr with DFU support and offers support for the MCUboot DFU procedure over SMP. | See the :ref:`nrf_desktop_bootloader_background_dfu` section for more information. * - WWCB - :file:`prj_wwcb.conf` - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - Debug version of the application with the support for the B0 bootloader enabled for `Works With ChromeBook (WWCB)`_. * - Triple Bluetooth LE connection - :file:`prj_3bleconn.conf` - - ``nrf52840dongle_nrf52840`` + - ``nrf52840dongle/nrf52840`` - Debug version of the application with the support for up to three simultaneous Bluetooth LE connections. * - Quadruple LLPM connection - :file:`prj_4llpmconn.conf` - - ``nrf52840dongle_nrf52840`` + - ``nrf52840dongle/nrf52840`` - Debug version of the application with the support for up to four simultaneous Bluetooth LE connections, in Low Latency Packet Mode. * - Release quadruple LLPM connection - :file:`prj_release_4llpmconn.conf` - - ``nrf52840dongle_nrf52840`` + - ``nrf52840dongle/nrf52840`` - Release version of the application with the support for up to four simultaneous Bluetooth LE connections, in Low Latency Packet Mode. .. note:: @@ -900,7 +900,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the :ref:`nrf_desktop_requirements_build_types`, depending on your development kit. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. .. note:: If nRF Desktop is built with `Fast Pair`_ support, you must provide Fast Pair Model ID and Anti Spoofing private key as CMake options. diff --git a/applications/nrf_desktop/doc/config_channel.rst b/applications/nrf_desktop/doc/config_channel.rst index 0fce1c16d1ef..7cc78b3174ee 100644 --- a/applications/nrf_desktop/doc/config_channel.rst +++ b/applications/nrf_desktop/doc/config_channel.rst @@ -194,7 +194,7 @@ Module discovery operations The Hardware ID is represented as 8 bytes. * ``CONFIG_STATUS_GET_BOARD_NAME`` - Obtain the device's board name. The board name is part of the Zephyr board name (:kconfig:option:`CONFIG_BOARD`) from a beginning to the first underscore (``_``) character. - For example, the ``nrf52840gmouse_nrf52840`` build target would return ``nrf52840gmouse`` as the board name. + For example, the ``nrf52840gmouse/nrf52840`` build target would return ``nrf52840gmouse`` as the board name. .. note:: You must use :ref:`nrf_desktop_info` for every device that is configurable with the configuration channel. diff --git a/applications/nrf_desktop/doc/hid_forward.rst b/applications/nrf_desktop/doc/hid_forward.rst index 471694c9acf6..65a24bfd7fbc 100644 --- a/applications/nrf_desktop/doc/hid_forward.rst +++ b/applications/nrf_desktop/doc/hid_forward.rst @@ -107,8 +107,8 @@ Enqueuing incoming HID input reports The |hid_forward| forwards only one HID input report to the HID-class USB device at a time. Another HID input report may be received from a peripheral connected over Bluetooth before the previous one was sent. In that case, ``hid_report_event`` is enqueued and submitted later. -Up to the number of reports specified in :ref:`CONFIG_DESKTOP_HID_FORWARD_MAX_ENQUEUED_REPORTS ` reports can be enqueued at a time for each report type and for each connected peripheral. -If there is not enough space to enqueue a new event, the module drops the oldest enqueued event that was received from this peripheral (of the same type). +Up to the number of reports specified in :ref:`CONFIG_DESKTOP_HID_FORWARD_MAX_ENQUEUED_REPORTS ` Kconfig option can be enqueued at a time for each report type and for each HID subscriber (HID-class USB device). +If there is not enough space to enqueue a new event, the module drops the oldest enqueued event (of the same type) that was enqueued for a given HID subscriber. Upon receiving the ``hid_report_sent_event``, the |hid_forward| submits the ``hid_report_event`` enqueued for the peripheral that is associated with the HID-class USB device. The enqueued report to be sent is chosen by the |hid_forward| in the round-robin fashion. diff --git a/applications/nrf_desktop/doc/hids.rst b/applications/nrf_desktop/doc/hids.rst index 7645e74984a3..6394cc4a9f95 100644 --- a/applications/nrf_desktop/doc/hids.rst +++ b/applications/nrf_desktop/doc/hids.rst @@ -74,8 +74,8 @@ The module can receive a HID output report setting state of the keyboard LEDs, f The report is received from the Bluetooth connected host. The module forwards the report using ``hid_report_event`` that is handled by |hid_state|. -Right now, the only board that displays information received in the HID output report using hardware LEDs is the :ref:`nrf52840dk_nrf52840 ` in ``keyboard`` build type configuration. -The keyboard reference design (nrf52kbd_nrf52832) has only one LED that is used to display the Bluetooth LE peer state. +Right now, the only board that displays information received in the HID output report using hardware LEDs is the :ref:`nrf52840dk ` in ``keyboard`` build type configuration. +The keyboard reference design (nrf52kbd) has only one LED that is used to display the Bluetooth LE peer state. Detailed information about the usage of LEDs to display information about Bluetooth LE peer state and system state to the user is available in the :ref:`nrf_desktop_led_state` documentation. Detailed information about displaying state of the HID keyboard LEDs using hardware LEDs is available in :ref:`nrf_desktop_hid_state` documentation. diff --git a/applications/nrf_desktop/doc/wheel.rst b/applications/nrf_desktop/doc/wheel.rst index ba7a0714474e..6ef3096eb914 100644 --- a/applications/nrf_desktop/doc/wheel.rst +++ b/applications/nrf_desktop/doc/wheel.rst @@ -26,6 +26,8 @@ Enable the module with the :ref:`CONFIG_DESKTOP_WHEEL_ENABLE - nrf52dmouse_nrf52832 nrf52kbd_nrf52832 nrf52810dmouse_nrf52810 nrf52820dongle_nrf52820 - nrf52833dk_nrf52820 nrf52833dk_nrf52833 nrf52833dongle_nrf52833 nrf52840dk_nrf52840 - nrf52840dongle_nrf52840 nrf52840gmouse_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf54l15pdk_nrf54l15_cpuapp - integration_platforms: - - nrf52dmouse_nrf52832 - - nrf52kbd_nrf52832 - - nrf52810dmouse_nrf52810 - - nrf52820dongle_nrf52820 - - nrf52833dk_nrf52820 - - nrf52833dk_nrf52833 - - nrf52833dongle_nrf52833 - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - - nrf52840gmouse_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf54l15pdk_nrf54l15_cpuapp + nrf52dmouse/nrf52832 nrf52kbd/nrf52832 nrf52810dmouse/nrf52810 nrf52820dongle/nrf52820 + nrf52833dk/nrf52820 nrf52833dk/nrf52833 nrf52833dongle/nrf52833 nrf52840dk/nrf52840 + nrf52840dongle/nrf52840 nrf52840gmouse/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + integration_platforms: + - nrf52dmouse/nrf52832 + - nrf52kbd/nrf52832 + - nrf52810dmouse/nrf52810 + - nrf52820dongle/nrf52820 + - nrf52833dk/nrf52820 + - nrf52833dk/nrf52833 + - nrf52833dongle/nrf52833 + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf52840gmouse/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: bluetooth ci_build applications.nrf_desktop.zdebug_wwcb: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_wwcb.conf applications.nrf_desktop.zdebug_fast_pair.gmouse: build_only: true - platform_allow: nrf52840dk_nrf52840 nrf52840gmouse_nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52840gmouse/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52840gmouse_nrf52840 + - nrf52840dk/nrf52840 + - nrf52840gmouse/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_fast_pair.conf FP_MODEL_ID=0x8E717D FP_ANTI_SPOOFING_KEY=dZxFzP7X9CcfLPC0apyRkmgsh3n2EbWo9NFNXfVuxAM= applications.nrf_desktop.zdebug_mcuboot_qspi: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_mcuboot_qspi.conf applications.nrf_desktop.zdebug_mcuboot_smp: build_only: true - platform_allow: nrf52840dk_nrf52840 nrf52840gmouse_nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52840gmouse/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52840gmouse_nrf52840 + - nrf52840dk/nrf52840 + - nrf52840gmouse/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_mcuboot_smp.conf applications.nrf_desktop.zdebugwithshell: build_only: true platform_allow: > - nrf52kbd_nrf52832 nrf52833dk_nrf52833 nrf52833dongle_nrf52833 nrf52840dk_nrf52840 - nrf52840dongle_nrf52840 nrf52840gmouse_nrf52840 + nrf52kbd/nrf52832 nrf52833dk/nrf52833 nrf52833dongle/nrf52833 nrf52840dk/nrf52840 + nrf52840dongle/nrf52840 nrf52840gmouse/nrf52840 integration_platforms: - - nrf52kbd_nrf52832 - - nrf52833dk_nrf52833 - - nrf52833dongle_nrf52833 - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - - nrf52840gmouse_nrf52840 + - nrf52kbd/nrf52832 + - nrf52833dk/nrf52833 + - nrf52833dongle/nrf52833 + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf52840gmouse/nrf52840 tags: bluetooth ci_build extra_configs: - CONFIG_DESKTOP_SHELL=y applications.nrf_desktop.zdebug_3bleconn: build_only: true - platform_allow: nrf52840dongle_nrf52840 + platform_allow: nrf52840dongle/nrf52840 integration_platforms: - - nrf52840dongle_nrf52840 + - nrf52840dongle/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_3bleconn.conf applications.nrf_desktop.zdebug_4llpmconn: build_only: true - platform_allow: nrf52840dongle_nrf52840 + platform_allow: nrf52840dongle/nrf52840 integration_platforms: - - nrf52840dongle_nrf52840 + - nrf52840dongle/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_4llpmconn.conf applications.nrf_desktop.zdebug_dongle: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_dongle.conf applications.nrf_desktop.zdebug_keyboard: build_only: true - platform_allow: nrf52840dk_nrf52840 nrf54l15pdk_nrf54l15_cpuapp + platform_allow: + - nrf52840dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf54l15pdk_nrf54l15_cpuapp + - nrf52840dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: bluetooth ci_build extra_args: CONF_FILE=prj_keyboard.conf applications.nrf_desktop.zdebug_nrf21540ek: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: SHIELD=nrf21540ek extra_configs: - CONFIG_CAF_BLE_USE_LLPM=n applications.nrf_desktop.zdebug_nrf21540ek_multicore: build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build extra_args: SHIELD=nrf21540ek_fwd hci_ipc_SHIELD=nrf21540ek @@ -121,47 +126,48 @@ tests: applications.nrf_desktop.zrelease: build_only: true platform_allow: > - nrf52dmouse_nrf52832 nrf52kbd_nrf52832 nrf52810dmouse_nrf52810 nrf52820dongle_nrf52820 - nrf52833dk_nrf52820 nrf52833dk_nrf52833 nrf52833dongle_nrf52833 nrf52840dk_nrf52840 - nrf52840dongle_nrf52840 nrf52840gmouse_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf54l15pdk_nrf54l15_cpuapp - integration_platforms: - - nrf52dmouse_nrf52832 - - nrf52kbd_nrf52832 - - nrf52810dmouse_nrf52810 - - nrf52820dongle_nrf52820 - - nrf52833dk_nrf52820 - - nrf52833dk_nrf52833 - - nrf52833dongle_nrf52833 - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - - nrf52840gmouse_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf54l15pdk_nrf54l15_cpuapp + nrf52dmouse/nrf52832 nrf52kbd/nrf52832 nrf52810dmouse/nrf52810 nrf52820dongle/nrf52820 + nrf52833dk/nrf52820 nrf52833dk/nrf52833 nrf52833dongle/nrf52833 nrf52840dk/nrf52840 + nrf52840dongle/nrf52840 nrf52840gmouse/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + integration_platforms: + - nrf52dmouse/nrf52832 + - nrf52kbd/nrf52832 + - nrf52810dmouse/nrf52810 + - nrf52820dongle/nrf52820 + - nrf52833dk/nrf52820 + - nrf52833dk/nrf52833 + - nrf52833dongle/nrf52833 + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf52840gmouse/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: bluetooth ci_build extra_args: CONF_FILE=prj_release.conf applications.nrf_desktop.zrelease_fast_pair.keyboard: build_only: true - platform_allow: nrf52kbd_nrf52832 + platform_allow: nrf52kbd/nrf52832 integration_platforms: - - nrf52kbd_nrf52832 + - nrf52kbd/nrf52832 tags: bluetooth ci_build extra_args: CONF_FILE=prj_release_fast_pair.conf FP_MODEL_ID=0x52FF02 FP_ANTI_SPOOFING_KEY=8E8ulwhSIp/skZeg27xmWv2SxRxTOagypHrf2OdrhGY= applications.nrf_desktop.zrelease_fast_pair.gmouse: build_only: true - platform_allow: nrf52840gmouse_nrf52840 + platform_allow: nrf52840gmouse/nrf52840 integration_platforms: - - nrf52840gmouse_nrf52840 + - nrf52840gmouse/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_release_fast_pair.conf FP_MODEL_ID=0x8E717D FP_ANTI_SPOOFING_KEY=dZxFzP7X9CcfLPC0apyRkmgsh3n2EbWo9NFNXfVuxAM= applications.nrf_desktop.zrelease_4llpmconn: build_only: true - platform_allow: nrf52840dongle_nrf52840 + platform_allow: nrf52840dongle/nrf52840 integration_platforms: - - nrf52840dongle_nrf52840 + - nrf52840dongle/nrf52840 tags: bluetooth ci_build extra_args: CONF_FILE=prj_release_4llpmconn.conf diff --git a/applications/nrf_desktop/src/hw_interface/wheel.c b/applications/nrf_desktop/src/hw_interface/wheel.c index 6cce0f665a00..bb12cecac51f 100644 --- a/applications/nrf_desktop/src/hw_interface/wheel.c +++ b/applications/nrf_desktop/src/hw_interface/wheel.c @@ -37,13 +37,21 @@ enum state { STATE_SUSPENDED }; +#if DT_NODE_HAS_STATUS(DT_ALIAS(nrfdesktop_wheel_qdec), okay) + #define QDEC_DT_NODE_ID DT_ALIAS(nrfdesktop_wheel_qdec) +#elif DT_NODE_HAS_STATUS(DT_NODELABEL(qdec), okay) + #define QDEC_DT_NODE_ID DT_NODELABEL(qdec) +#else + #error DT node for QDEC must be specified. +#endif + #define QDEC_PIN_INIT(node_id, prop, idx) \ NRF_GET_PIN(DT_PROP_BY_IDX(node_id, prop, idx)), /* obtan qdec pins from default state */ static const uint32_t qdec_pin[] = { DT_FOREACH_CHILD_VARGS( - DT_PINCTRL_BY_NAME(DT_NODELABEL(qdec), default, 0), + DT_PINCTRL_BY_NAME(QDEC_DT_NODE_ID, default, 0), DT_FOREACH_PROP_ELEM, psels, QDEC_PIN_INIT ) }; @@ -53,7 +61,7 @@ static const struct sensor_trigger qdec_trig = { .chan = SENSOR_CHAN_ROTATION, }; -static const struct device *qdec_dev = DEVICE_DT_GET(DT_NODELABEL(qdec)); +static const struct device *qdec_dev = DEVICE_DT_GET(QDEC_DT_NODE_ID); static struct gpio_callback gpio_cbs[ARRAY_SIZE(qdec_pin)]; static struct k_spinlock lock; static struct k_work_delayable idle_timeout; @@ -208,7 +216,7 @@ static void wakeup_cb(const struct device *gpio_dev, struct gpio_callback *cb, static int setup_wakeup(void) { - int enable_pin = DT_PROP(DT_NODELABEL(qdec), enable_pin); + int enable_pin = DT_PROP(QDEC_DT_NODE_ID, enable_pin); const struct device *port = map_gpio_port(enable_pin); gpio_pin_t pin = map_gpio_pin(enable_pin); diff --git a/applications/nrf_desktop/src/modules/Kconfig.config_channel b/applications/nrf_desktop/src/modules/Kconfig.config_channel index 6b72a034f686..b654f6b4385f 100644 --- a/applications/nrf_desktop/src/modules/Kconfig.config_channel +++ b/applications/nrf_desktop/src/modules/Kconfig.config_channel @@ -58,7 +58,7 @@ config DESKTOP_CONFIG_CHANNEL_DFU_ENABLE bool "DFU over the config channel" depends on DESKTOP_CONFIG_CHANNEL_ENABLE select SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS if \ - !PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY + (SOC_FLASH_NRF && !PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) help This option enables DFU over the config channel. The option automatically enables 8-bit write block size emulation to diff --git a/applications/nrf_desktop/src/modules/hid_forward.c b/applications/nrf_desktop/src/modules/hid_forward.c index b30625362d4c..f711bfa9311c 100644 --- a/applications/nrf_desktop/src/modules/hid_forward.c +++ b/applications/nrf_desktop/src/modules/hid_forward.c @@ -64,14 +64,11 @@ struct subscriber { struct enqueued_reports enqueued_reports; struct report_data out_reports[ARRAY_SIZE(output_reports)]; uint32_t saved_out_reports_bm; - bool busy; - uint8_t last_peripheral_id; }; struct hids_peripheral { struct bt_hogp hogp; - struct enqueued_reports enqueued_reports; uint32_t enqueued_out_reports_bm; struct k_work_delayable read_rsp; @@ -229,17 +226,6 @@ static bool is_report_enqueued(struct enqueued_reports *enqueued_reports, return true; } -static bool is_any_report_enqueued(struct enqueued_reports *enqueued_reports) -{ - for (size_t irep_idx = 0; irep_idx < ARRAY_SIZE(enqueued_reports->reports); irep_idx++) { - if (is_report_enqueued(enqueued_reports, irep_idx)) { - return true; - } - } - - return false; -} - static struct enqueued_report *get_enqueued_report(struct enqueued_reports *enqueued_reports, size_t irep_idx) { @@ -301,48 +287,6 @@ static struct enqueued_report *get_next_enqueued_report(struct enqueued_reports return item; } -static void migrate_enqueued_reports(struct enqueued_reports *dst_reports, - struct enqueued_reports *src_reports) -{ - /* Migrate only up to MAX_ENQUEUED_ITEMS newest items. - * As per can hold up only up to MAX_ENQUEUED_ITEMS at a time, - * migration from per to sub will affect entire list. - * When migrating from sub to par we will never get more items - * then the defined limit. - * Leaving the oldest items at sub will allow them to be sent - * out first. - */ - for (size_t irep_idx = 0; irep_idx < ARRAY_SIZE(dst_reports->reports); irep_idx++) { - if (is_report_enqueued(src_reports, irep_idx)) { - struct counted_list *dst = &dst_reports->reports[irep_idx]; - struct counted_list *src = &src_reports->reports[irep_idx]; - - sys_slist_t tmp_list; - size_t count = 0; - - sys_slist_init(&tmp_list); - - /* Move excessive items to a temporary list. */ - while (src->count > MAX_ENQUEUED_ITEMS) { - sys_snode_t *node = sys_slist_get(&src->list); - src->count--; - - sys_slist_append(&tmp_list, node); - count++; - } - - /* Source hold MAX_ENQUEUED_ITEMS items max. - * Migrate the entire list. */ - sys_slist_merge_slist(&dst->list, &src->list); - dst->count += src->count; - - /* Bring back excessive items to the source list. */ - src->list = tmp_list; - src->count = count; - } - } -} - static void enqueue_hid_report(struct enqueued_reports *enqueued_reports, size_t irep_idx, struct hid_report_event *report) @@ -410,13 +354,13 @@ static void forward_hid_report(struct hids_peripheral *per, uint8_t report_id, memcpy(&report->dyndata.data[1], data, size); if (!sub->busy) { - __ASSERT_NO_MSG(!is_report_enqueued(&per->enqueued_reports, irep_idx)); + __ASSERT_NO_MSG(!is_report_enqueued(&sub->enqueued_reports, irep_idx)); APP_EVENT_SUBMIT(report); - per->enqueued_reports.last_idx = irep_idx; + sub->enqueued_reports.last_idx = irep_idx; sub->busy = true; } else { - enqueue_hid_report(&per->enqueued_reports, irep_idx, report); + enqueue_hid_report(&sub->enqueued_reports, irep_idx, report); } } @@ -557,15 +501,6 @@ static int register_peripheral(struct bt_gatt_dm *dm, const uint8_t *hwid, per->sub_id = sub_id; - /* Migrate part of the unsent reports to this peripheral. - * This is needed to make sure that at any time number of - * allocated reports is within configured bounds. - */ - __ASSERT_NO_MSG(!is_any_report_enqueued(&per->enqueued_reports)); - ARG_UNUSED(is_any_report_enqueued); - migrate_enqueued_reports(&per->enqueued_reports, - &get_subscriber(per)->enqueued_reports); - __ASSERT_NO_MSG(hwid_len == HWID_LEN); memcpy(per->hwid, hwid, hwid_len); @@ -1005,10 +940,6 @@ static void disconnect_peripheral(struct hids_peripheral *per) } } - migrate_enqueued_reports(&get_subscriber(per)->enqueued_reports, - &per->enqueued_reports); - __ASSERT_NO_MSG(!is_any_report_enqueued(&per->enqueued_reports)); - per->enqueued_out_reports_bm = 0; bt_hogp_release(&per->hogp); @@ -1067,11 +998,8 @@ static void disable_subscription(struct subscriber *sub, uint8_t report_id) if (sub_disconnected) { send_empty_hid_out_reports(per, sub); } - - drop_enqueued_reports(&per->enqueued_reports, irep_idx); } - /* And also this subscriber. */ drop_enqueued_reports(&sub->enqueued_reports, irep_idx); if (sub_disconnected) { @@ -1175,7 +1103,6 @@ static void init(void) per->cfg_chan_id = CFG_CHAN_UNUSED_PEER_ID; per->enqueued_out_reports_bm = 0; - init_enqueued_reports(&per->enqueued_reports); } reset_peripheral_address(); @@ -1201,27 +1128,6 @@ static void send_enqueued_report(struct subscriber *sub) /* First try to send report left at subscriber. */ item = get_next_enqueued_report(&sub->enqueued_reports); - if (!item) { - /* Look for any report to sent at linked peripherals. */ - for (size_t i = 0; i < ARRAY_SIZE(peripherals); i++) { - size_t per_id = next_id(sub->last_peripheral_id + i, - ARRAY_SIZE(peripherals)); - struct hids_peripheral *per = &peripherals[per_id]; - - /* Check if peripheral is linked with the subscriber. */ - if (sub != get_subscriber(per)) { - continue; - } - - item = get_next_enqueued_report(&per->enqueued_reports); - - if (item) { - sub->last_peripheral_id = per_id; - break; - } - } - } - if (item) { APP_EVENT_SUBMIT(item->report); diff --git a/applications/nrf_desktop/src/modules/info.c b/applications/nrf_desktop/src/modules/info.c index 0691ef5fb665..4002f96ab2b8 100644 --- a/applications/nrf_desktop/src/modules/info.c +++ b/applications/nrf_desktop/src/modules/info.c @@ -12,11 +12,12 @@ #define MODULE info #include -#define BOARD_NAME_SEPARATOR '_' - #include LOG_MODULE_REGISTER(MODULE, CONFIG_DESKTOP_INFO_LOG_LEVEL); +/* Board name is defined by CONFIG_BOARD Kconfig option. Null-terminator character is excluded. */ +#define BOARD_NAME CONFIG_BOARD +#define BOARD_NAME_LEN (sizeof(CONFIG_BOARD) - 1) static struct config_event *generate_response(const struct config_event *event, size_t dyndata_size) @@ -68,18 +69,12 @@ static bool handle_config_event(const struct config_event *event) case CONFIG_STATUS_GET_BOARD_NAME: { - const char *start_ptr = CONFIG_BOARD; - const char *end_ptr = strchr(start_ptr, BOARD_NAME_SEPARATOR); - - __ASSERT_NO_MSG(end_ptr != NULL); - size_t name_len = end_ptr - start_ptr; - - __ASSERT_NO_MSG((name_len > 0) && - (name_len <= CONFIG_CHANNEL_FETCHED_DATA_MAX_SIZE)); + BUILD_ASSERT(BOARD_NAME_LEN > 0); + BUILD_ASSERT(BOARD_NAME_LEN <= CONFIG_CHANNEL_FETCHED_DATA_MAX_SIZE); - struct config_event *rsp = generate_response(event, name_len); + struct config_event *rsp = generate_response(event, BOARD_NAME_LEN); - strncpy((char *)rsp->dyndata.data, start_ptr, name_len); + memcpy(rsp->dyndata.data, BOARD_NAME, BOARD_NAME_LEN); submit_response(rsp); return true; } diff --git a/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.conf b/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.conf new file mode 100644 index 000000000000..13159e9815fb --- /dev/null +++ b/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Configuration file for nRF9131EK. +# This file is merged with prj.conf in the application folder, and options +# set here will take precedence if they are present in both files. + +CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2 +CONFIG_UART_0_NRF_HW_ASYNC=y +CONFIG_SLM_POWER_PIN=28 +CONFIG_SLM_INDICATE_PIN=0 diff --git a/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.overlay b/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.overlay new file mode 100644 index 000000000000..1ff0f2d66b48 --- /dev/null +++ b/applications/serial_lte_modem/boards/nrf9131ek_nrf9131_ns.overlay @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + ncs,slm-uart = &uart0; + }; +}; + +&uart0 { + status = "okay"; + hw-flow-control; +}; diff --git a/applications/serial_lte_modem/doc/CMUX_AT_commands.rst b/applications/serial_lte_modem/doc/CMUX_AT_commands.rst index 5932d0bd842a..6246fa99fbb2 100644 --- a/applications/serial_lte_modem/doc/CMUX_AT_commands.rst +++ b/applications/serial_lte_modem/doc/CMUX_AT_commands.rst @@ -19,6 +19,18 @@ For example, it can be used to exchange AT data and have a :ref:`Point-to-Point CMUX is enabled in SLM by compiling it with the appropriate configuration files, depending on your use case. See the :ref:`slm_config_files` section for more information. +.. slm_cmux_baud_rate_note_start + +.. note:: + + The maximum recommended baud rate is 460 800. + At higher baud rates (921 600, 1 000 000), it is possible for bytes to come in faster than the chip is able to handle, which causes the buffer space to run out if it goes on for too long. + UART RX is not disabled in that case, which results in data loss and communication failures. + + At a baud rate of 460 800, the maximum throughput is slightly below that of the nRF91 Series modem when using LTE-M. + +.. slm_cmux_baud_rate_note_end + .. note:: SLM does not have an equivalent to the ``AT+CMUX`` command described in 3GPP TS 27.007. diff --git a/applications/serial_lte_modem/doc/GNSS_AT_commands.rst b/applications/serial_lte_modem/doc/GNSS_AT_commands.rst index 9ac97b0fea96..f66483b6a3c8 100644 --- a/applications/serial_lte_modem/doc/GNSS_AT_commands.rst +++ b/applications/serial_lte_modem/doc/GNSS_AT_commands.rst @@ -115,7 +115,7 @@ Unsolicited notification * The ```` value represents the heading of the movement of the user in degrees. * The ```` value represents the UTC date-time. -.. gps_status_notif_start +.. slm_gps_status_notif_start .. code-block:: @@ -133,7 +133,7 @@ Unsolicited notification * ``3`` - GNSS enters sleep because of timeout. * ``4`` - GNSS enters sleep because a fix is acquired. -.. gps_status_notif_end +.. slm_gps_status_notif_end Example ~~~~~~~ @@ -265,8 +265,8 @@ Response syntax ~~~~~~~~~~~~~~~ .. include:: GNSS_AT_commands.rst - :start-after: gps_status_notif_start - :end-before: gps_status_notif_end + :start-after: slm_gps_status_notif_start + :end-before: slm_gps_status_notif_end Example ~~~~~~~ diff --git a/applications/serial_lte_modem/doc/Generic_AT_commands.rst b/applications/serial_lte_modem/doc/Generic_AT_commands.rst index 2679f6f9d73d..7b8ee9f98c31 100644 --- a/applications/serial_lte_modem/doc/Generic_AT_commands.rst +++ b/applications/serial_lte_modem/doc/Generic_AT_commands.rst @@ -440,7 +440,7 @@ The ```` parameter can have the following integer values: * ``0`` - Root CA certificate (PEM format) * ``1`` - Certificate (PEM format) * ``2`` - Private key (PEM format) -* ``3`` - Pre-shared Key (PSK) (ASCII text) +* ``3`` - Pre-shared key (PSK) (ASCII text) * ``4`` - PSK identity (ASCII text) It is mandatory for *write* and *delete* operations. diff --git a/applications/serial_lte_modem/doc/PPP_AT_commands.rst b/applications/serial_lte_modem/doc/PPP_AT_commands.rst index 8cc534995bbe..acc3eaeaa78d 100644 --- a/applications/serial_lte_modem/doc/PPP_AT_commands.rst +++ b/applications/serial_lte_modem/doc/PPP_AT_commands.rst @@ -46,20 +46,10 @@ Syntax * ``0`` - Stop PPP. * ``1`` - Start PPP. -Read command ------------- - -The read command allows you to get the status of PPP. +Unsolicited notification +~~~~~~~~~~~~~~~~~~~~~~~~ -Syntax -~~~~~~ - -:: - - AT#XPPP? - -Response syntax -~~~~~~~~~~~~~~~ +.. slm_ppp_status_notif_start :: @@ -71,6 +61,8 @@ Response syntax * The ```` parameter is an integer that indicates whether a peer is connected to PPP. It is ``1`` for connected or ``0`` for not connected. +.. slm_ppp_status_notif_end + Example ------- @@ -79,26 +71,59 @@ Example AT+CFUN=1 OK - // Wait for network registration. PPP is automatically started. - AT#XPPP? + // PPP is automatically started when the modem is registered to the network. #XPPP: 1,0 + // Stop PPP. + AT#XPPP=0 + OK - // Have the peer connect to SLM's PPP. The read command shows that a peer is connected. - AT#XPPP? - #XPPP: 1,1 + #XPPP: 0,0 + + // Start PPP. + AT#XPPP=1 OK + + #XPPP: 1,0 + + // Have the peer connect to SLM's PPP. + #XPPP: 1,1 + + // Peer disconnects. + #XPPP: 1,0 + + // SLM restarts PPP automatically when peer disconnects. + #XPPP: 0,0 + + #XPPP: 1,0 + AT+CFUN=4 OK - AT#XPPP? #XPPP: 0,0 - OK +Read command +------------ + +The read command allows you to get the status of PPP. + +Syntax +~~~~~~ + +:: + + AT#XPPP? + +Response syntax +~~~~~~~~~~~~~~~ + +.. include:: PPP_AT_commands.rst + :start-after: slm_ppp_status_notif_start + :end-before: slm_ppp_status_notif_end Testing on Linux ================ @@ -116,8 +141,7 @@ For the process described here, SLM's UARTs must be connected to the Linux host. 1. Get PPP running on SLM. To do this, start SLM and issue an ``AT+CFUN=1`` command. -#. Make sure that the network registration succeeds and that PPP is started successfully. - To do this, either look at SLM's logs, or issue an ``AT#XPPP?`` command, which returns ``#XPPP: 1,0`` when PPP has started successfully. +#. Wait for ``#XPPP: 1,0``, which is sent when the network registration succeeds and PPP has started successfully. #. Run the following command on the Linux host: .. code-block:: console diff --git a/applications/serial_lte_modem/doc/TCPUDP_AT_commands.rst b/applications/serial_lte_modem/doc/TCPUDP_AT_commands.rst index 84bd50cd0f02..c4505927dfdb 100644 --- a/applications/serial_lte_modem/doc/TCPUDP_AT_commands.rst +++ b/applications/serial_lte_modem/doc/TCPUDP_AT_commands.rst @@ -69,7 +69,7 @@ This is emitted when a new connection has been created to the server. * The ```` value is the IPv4 or IPv6 address of the peer. -.. tcpsvr_disconnect_notif_start +.. slm_tcpsvr_disconnect_notif_start :: @@ -80,7 +80,7 @@ This is emitted when the client has been disconnected. * The ```` value is an integer. It is either ``0`` when the client is disconnected normally, or an *-errno* code. -.. tcpsvr_disconnect_notif_end +.. slm_tcpsvr_disconnect_notif_end Example @@ -363,8 +363,8 @@ Response syntax ~~~~~~~~~~~~~~~ .. include:: TCPUDP_AT_commands.rst - :start-after: tcpsvr_disconnect_notif_start - :end-before: tcpsvr_disconnect_notif_end + :start-after: slm_tcpsvr_disconnect_notif_start + :end-before: slm_tcpsvr_disconnect_notif_end Examples ~~~~~~~~ diff --git a/applications/serial_lte_modem/doc/images/teraterm.svg b/applications/serial_lte_modem/doc/images/teraterm.svg deleted file mode 100644 index 0a0a36130c5d..000000000000 --- a/applications/serial_lte_modem/doc/images/teraterm.svg +++ /dev/null @@ -1,115 +0,0 @@ - - - - diff --git a/applications/serial_lte_modem/doc/images/termite.svg b/applications/serial_lte_modem/doc/images/termite.svg deleted file mode 100644 index b7e36fc7f266..000000000000 --- a/applications/serial_lte_modem/doc/images/termite.svg +++ /dev/null @@ -1,126 +0,0 @@ - - - - diff --git a/applications/serial_lte_modem/doc/nRF91_as_Zephyr_modem.rst b/applications/serial_lte_modem/doc/nRF91_as_Zephyr_modem.rst index 4e9ca74583f3..43f9b7a2e2f3 100644 --- a/applications/serial_lte_modem/doc/nRF91_as_Zephyr_modem.rst +++ b/applications/serial_lte_modem/doc/nRF91_as_Zephyr_modem.rst @@ -32,6 +32,10 @@ For that, Kconfig fragments and devicetree overlays must be added to the compila See the :ref:`slm_config_files` section for information on how to compile with additional configuration files and a description of some of the mentioned Kconfig fragments. +.. include:: CMUX_AT_commands.rst + :start-after: slm_cmux_baud_rate_note_start + :end-before: slm_cmux_baud_rate_note_end + nRF91 Series SiP running SLM ============================ @@ -96,7 +100,7 @@ Zephyr's cellular modem driver running on the controlling chip will take care of However, before flashing the SLM built with the Zephyr-compatible modem configuration, make sure that the nRF91 Series modem has been set to the desired system mode. For this, you will need a regular SLM running in the nRF91 Series SiP to be able to run AT commands manually. To set the modem to the desired system mode, issue an ``AT%XSYSTEMMODE`` command followed by an ``AT+CFUN=0`` command so that the modem saves the system mode to NVM. -For example, to enable only LTE-M, issue the following command: ``AT%XSYSTEMMODE=0,1,0,0`` +For example, to enable only LTE-M, issue the following command: ``AT%XSYSTEMMODE=1,0,0,0`` You need to do this because the modem's system mode is not automatically set at any point, so the one already configured will be used. Additionally, if the controlling chip is an external MCU: diff --git a/applications/serial_lte_modem/doc/slm_description.rst b/applications/serial_lte_modem/doc/slm_description.rst index 21301ee3df37..71c57cde121b 100644 --- a/applications/serial_lte_modem/doc/slm_description.rst +++ b/applications/serial_lte_modem/doc/slm_description.rst @@ -318,22 +318,25 @@ The following configuration files are provided: This disables most of the IP-based protocols available through AT commands (such as FTP and MQTT) as it is expected that the controlling chip's own IP stack is used instead. See :ref:`CONFIG_SLM_PPP ` and :ref:`SLM_AT_PPP` for more information. -* :file:`overlay-ppp-without-cmux.overlay` - Devicetree overlay file that configures the UART to be used by PPP. +* :file:`overlay-ppp-without-cmux.conf` - Kconfig fragment that configures the UART to be used by PPP. + This configuration file should be included when building SLM with PPP and without CMUX. + +* :file:`overlay-ppp-without-cmux.overlay` - Devicetree overlay that configures the UART to be used by PPP. This configuration file should be included when building SLM with PPP and without CMUX, in addition to :file:`overlay-ppp.conf`. It can be customized to fit your configuration (UART, baud rate, and so on). By default, it sets the baud rate of the PPP UART to 1 000 000. * :file:`overlay-zephyr-modem.conf`, :file:`overlay-zephyr-modem-external-mcu.conf`, :file:`overlay-zephyr-modem-nrf9160dk-nrf52840.conf`, :file:`overlay-external-mcu.overlay`, and :file:`overlay-zephyr-modem-nrf9160dk-nrf52840.overlay` - These configuration files are used when compiling SLM to turn an nRF91 Series SiP into a Zephyr-compatible standalone modem. - See :ref:`slm_as_zephyr_modem` for more information. + See :ref:`slm_as_zephyr_modem` for more information. * :file:`boards/nrf9160dk_nrf9160_ns.conf` - Configuration file specific for the nRF9160 DK. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9160dk_nrf9160_ns`` build target. + This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9160dk/nrf9160/ns`` build target. * :file:`boards/nrf9161dk_nrf9161_ns.conf` - Configuration file specific for the nRF9161 DK. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9161dk_nrf9161_ns`` build target. + This file is automatically merged with the :file:`prj.conf` file when you build for the ``nrf9161dk/nrf9161/ns`` build target. * :file:`boards/thingy91_nrf9160_ns.conf` - Configuration file specific for Thingy:91. - This file is automatically merged with the :file:`prj.conf` file when you build for the ``thingy91_nrf9160_ns`` build target. + This file is automatically merged with the :file:`prj.conf` file when you build for the ``thingy91/nrf9160/ns`` build target. .. _slm_native_tls: @@ -399,23 +402,14 @@ To connect to an nRF91 Series DK with a PC: Using the Cellular Monitor app in combination with the nRF Connect Serial Terminal shows how the modem responds to the different modem commands. You can then use this connection to send or receive AT commands over UART, and to see the log output of the development kit. - Alternatively, you can use a terminal emulator like `Termite`_, `Teraterm`_, or PuTTY to establish a terminal connection to the development kit, using the :ref:`default serial port connection settings `. + Instead of using nRF Connect Serial Terminal, you can use PuTTY to establish a terminal connection to the development kit, using the :ref:`default serial port connection settings `. .. note:: The default AT command terminator is a carriage return followed by a line feed (``\r\n``). nRF Connect Serial Terminal supports this format. If you want to use another terminal emulator, make sure that the configured AT command terminator corresponds to the line terminator of your terminal. - - When using `Termite`_ and `Teraterm`_, configure the AT command terminator as follows: - - .. figure:: images/termite.svg - :alt: Termite configuration for sending AT commands through UART - - .. figure:: images/teraterm.svg - :alt: Teraterm configuration for sending AT commands through UART - - When using PuTTY, you must set the :ref:`CONFIG_SLM_CR_TERMINATION ` SLM configuration option instead. + When using PuTTY, you must set the :ref:`CONFIG_SLM_CR_TERMINATION ` SLM configuration option. See :ref:`slm_config_options` for more details. .. slm_connecting_91dk_pc_instr_end diff --git a/applications/serial_lte_modem/doc/slm_extending.rst b/applications/serial_lte_modem/doc/slm_extending.rst index eef9431bc66b..5fb09243c278 100644 --- a/applications/serial_lte_modem/doc/slm_extending.rst +++ b/applications/serial_lte_modem/doc/slm_extending.rst @@ -7,46 +7,37 @@ Extending the application :local: :depth: 2 -You can extend the serial LTE modem application by adding your own AT commands and custom error handling. +The AT commands in the Serial LTE modem are implemented with the :ref:`at_cmd_custom_readme` library. +You can extend the Serial LTE modem application by adding your own AT commands. Adding AT commands ****************** -If you want to implement custom AT commands and add them to the serial LTE modem application, see the parser implementation of the provided proprietary AT commands for reference. -The source files can be found in the :file:`applications/serial_lte_modem/src/` folder. +If you want to implement a custom AT command in SLM, you will need to follow the instructions in the :ref:`at_cmd_custom_readme` library documentation. +Setting the AT command filter and callback with the :c:macro:`AT_CMD_CUSTOM` macro is enough for a custom AT command that does not require setup or teardown. -Complete the following steps to add a parser for your own AT commands: +As a preferred alternative to the :c:macro:`AT_CMD_CUSTOM` macro, SLM defines the :c:macro:`SLM_AT_CMD_CUSTOM` macro, which is a wrapper around the :c:macro:`AT_CMD_CUSTOM` macro. +The :c:macro:`SLM_AT_CMD_CUSTOM` macro pre-processes the AT command parameters for the AT command callback and sets the default ``OK`` response if the callback returns successfully. -1. Create a header file in :file:`applications/serial_lte_modem/src/`. - The file must expose the following functions: - - * ``*_init()`` - Initialize the parser. - * ``*_uninit()`` - Uninitialize the parser. - - See the files for existing AT command parsers for reference. -#. Implement your AT strings and handlers in a corresponding :file:`.c` file. - See the files for existing AT command parsers for reference. +If your custom AT command requires setup or teardown, you will need to perform the following steps: - Pay attention to the following requirements: - - * The names of new AT commands should start with ``AT#X``. - * Before entering idle state, the serial LTE modem application will call the uninit function. - Make sure that the uninit function exits successfully. - Otherwise, the application cannot enter idle state. -#. Edit :file:`applications/serial_lte_modem/src/slm_at_commands.c` and add calls to your functions: +1. Create a header file in :file:`applications/serial_lte_modem/src/`. + The file must expose the following function declarations: - a. In ``slm_at_init()``, add a call to your init function. - #. In ``slm_at_uninit()``, add a call to your uninit function. - #. Declare your command handler like those of other service modules. - #. In ``slm_at_cmd_list``, add the mapping of your AT command and its handler. + * ``*_init()`` - Your setup function for the custom AT command. + * ``*_uninit()`` - Your teardown function for the custom AT command. -If you discover any bugs in the :file:`main.c`, :file:`slm_at_host.h`, or :file:`slm_at_host.c` files, report them on the `DevZone`_. +#. Create a corresponding :file:`.c` file in :file:`applications/serial_lte_modem/src/`. + The file must implement the following functions: -Error handling -************** + * Your AT command callback, which is declared with the :c:macro:`AT_CMD_CUSTOM` macro. + * ``*_init()`` - Your setup function for the custom AT command. + * ``*_uninit()`` - Your teardown function for the custom AT command. + Make sure that the teardown function exits successfully. + It will be called before entering power saving states or shutting down. -The Serial LTE modem application returns error codes that are defined in :file:`zephyr/lib/libc/minimal/include/errno.h`. -See the comments in that file for information about a specific error. +#. Edit :file:`applications/serial_lte_modem/src/slm_at_commands.c` and make the following changes: -If an error occurs during TCP/IP processing, the socket is usually closed. -See the `POSIX Programmer's Manual`_ for information about the errors returned by each API. + a. Include your header file. + #. In the ``slm_at_init()`` function, add a call to your setup function. + #. In the ``slm_at_uninit()`` function, add a call to your teardown function. diff --git a/applications/serial_lte_modem/doc/slm_testing.rst b/applications/serial_lte_modem/doc/slm_testing.rst index ea7b1fef8d72..ef91220d37bd 100644 --- a/applications/serial_lte_modem/doc/slm_testing.rst +++ b/applications/serial_lte_modem/doc/slm_testing.rst @@ -477,7 +477,7 @@ DTLS client The DTLS client requires connection-based UDP to trigger the DTLS establishment. -Before completing this test, you must update the Pre-shared Key (PSK) and the PSK identity to be used for the TLS connection in the modem. +Before completing this test, you must update the pre-shared key (PSK) and the PSK identity to be used for the TLS connection in the modem. The credentials must use the security tag 16842756. To store the credentials in the modem, enter the following AT commands: diff --git a/applications/serial_lte_modem/overlay-cmux.conf b/applications/serial_lte_modem/overlay-cmux.conf index 52cade9574f5..900d9876b68e 100644 --- a/applications/serial_lte_modem/overlay-cmux.conf +++ b/applications/serial_lte_modem/overlay-cmux.conf @@ -10,8 +10,7 @@ CONFIG_SLM_CMUX=y CONFIG_MODEM_MODULES=y CONFIG_MODEM_CMUX=y CONFIG_MODEM_BACKEND_UART=y -# Allow large UART TXs to go through @115200. -CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=200 +CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=1000 # debug options #CONFIG_MODEM_CMUX_LOG_LEVEL_DBG=y diff --git a/applications/serial_lte_modem/overlay-native_tls.conf b/applications/serial_lte_modem/overlay-native_tls.conf index c8245dd9edd8..2a38e1615452 100644 --- a/applications/serial_lte_modem/overlay-native_tls.conf +++ b/applications/serial_lte_modem/overlay-native_tls.conf @@ -48,7 +48,7 @@ CONFIG_MBEDTLS_ECDSA_C=y CONFIG_PSA_WANT_ALG_ECDSA=y CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y # dep for DETERMINISTIC_ECDSA +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y # dep for DETERMINISTIC_ECDSA CONFIG_PSA_WANT_ALG_HMAC=y # dep for DETERMINISTIC_ECDSA # Enable ECDH CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED=y diff --git a/applications/serial_lte_modem/overlay-ppp-without-cmux.conf b/applications/serial_lte_modem/overlay-ppp-without-cmux.conf new file mode 100644 index 000000000000..e264503c0cdf --- /dev/null +++ b/applications/serial_lte_modem/overlay-ppp-without-cmux.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include this Kconfig fragment only if using PPP without CMUX. + +# Ensure that HW RX byte counting is enabled for the PPP UART. This especially matters at higher baud rates. +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 + +# Disable TFM logging as UART1 is needed by the non-secure application. +CONFIG_TFM_LOG_LEVEL_SILENCE=y diff --git a/applications/serial_lte_modem/overlay-ppp-without-cmux.overlay b/applications/serial_lte_modem/overlay-ppp-without-cmux.overlay index cf8a05986e09..f256f2c69746 100644 --- a/applications/serial_lte_modem/overlay-ppp-without-cmux.overlay +++ b/applications/serial_lte_modem/overlay-ppp-without-cmux.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -/* Include this overlay only if using PPP without CMUX. */ +/* Include this devicetree overlay only if using PPP without CMUX. */ / { chosen { diff --git a/applications/serial_lte_modem/overlay-ppp.conf b/applications/serial_lte_modem/overlay-ppp.conf index 1951831f8d0b..b7715c47c930 100644 --- a/applications/serial_lte_modem/overlay-ppp.conf +++ b/applications/serial_lte_modem/overlay-ppp.conf @@ -18,21 +18,13 @@ CONFIG_AT_CMD_CUSTOM=y CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=22528 -# PPP UART -CONFIG_UART_1_NRF_HW_ASYNC=y -CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1 - -# TF-M cannot have its own UART. -CONFIG_TFM_SECURE_UART_SHARE_INSTANCE=y - # Zephyr PPP support CONFIG_NET_NATIVE=y CONFIG_NET_L2_PPP=y CONFIG_MODEM_MODULES=y CONFIG_MODEM_PPP=y CONFIG_MODEM_BACKEND_UART=y -# Allow large UART TXs to go through @115200. -CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=200 +CONFIG_MODEM_BACKEND_UART_ASYNC_TRANSMIT_TIMEOUT_MS=1000 # L2 protocol CONFIG_NET_L2_PPP_MGMT=y @@ -60,6 +52,7 @@ CONFIG_NET_TC_RX_COUNT=0 # debug options #CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096 #CONFIG_NET_LOG=y +#CONFIG_NET_IF_LOG_LEVEL_DBG=y #CONFIG_NET_PKT_LOG_LEVEL_DBG=y #CONFIG_NET_L2_PPP_LOG_LEVEL_DBG=y #CONFIG_NET_MGMT_EVENT_LOG_LEVEL_DBG=y diff --git a/applications/serial_lte_modem/overlay-zephyr-modem-external-mcu.conf b/applications/serial_lte_modem/overlay-zephyr-modem-external-mcu.conf index 9322d0ddfcf7..10954a59986c 100644 --- a/applications/serial_lte_modem/overlay-zephyr-modem-external-mcu.conf +++ b/applications/serial_lte_modem/overlay-zephyr-modem-external-mcu.conf @@ -4,5 +4,9 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Make sure that this value is in accordance with your setup, updating it as needed. +# Ensure that HW RX byte counting is enabled. This especially matters at higher baud rates. +CONFIG_UART_2_NRF_HW_ASYNC=y +CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2 + +# Update this value so that it is in accordance with your setup. CONFIG_SLM_POWER_PIN=-1 diff --git a/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.conf b/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.conf index 9666340ec8ad..3a112c7c1b1d 100644 --- a/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.conf +++ b/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.conf @@ -4,5 +4,9 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +# Ensure that HW RX byte counting is enabled. This especially matters at higher baud rates. +CONFIG_UART_1_NRF_HW_ASYNC=y +CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2 + # nRF52 <=> nRF91 interface pin 4 (see https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/board_controller.html) CONFIG_SLM_POWER_PIN=22 diff --git a/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay b/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay index 249e680f23d5..45d7faa85b13 100644 --- a/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay +++ b/applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include / { chosen { diff --git a/applications/serial_lte_modem/prj.conf b/applications/serial_lte_modem/prj.conf index 3472bed68e84..4e5cb6a364a7 100644 --- a/applications/serial_lte_modem/prj.conf +++ b/applications/serial_lte_modem/prj.conf @@ -27,6 +27,7 @@ CONFIG_NET_NATIVE=n # Modem library CONFIG_NRF_MODEM_LIB=y +CONFIG_AT_CMD_CUSTOM=y # Align the max FD entry to NRF_MODEM_MAX_SOCKET_COUNT(8) CONFIG_POSIX_MAX_FDS=8 @@ -108,8 +109,6 @@ CONFIG_AT_MONITOR=y # CONFIG_SLM_CUSTOMER_VERSION="" CONFIG_SLM_EXTERNAL_XTAL=n -CONFIG_SLM_START_SLEEP=n -CONFIG_SLM_DATAMODE_URC=n # debug options #CONFIG_ASSERT=y diff --git a/applications/serial_lte_modem/sample.yaml b/applications/serial_lte_modem/sample.yaml index ed8b9ac49d72..6561e092e951 100644 --- a/applications/serial_lte_modem/sample.yaml +++ b/applications/serial_lte_modem/sample.yaml @@ -4,41 +4,44 @@ tests: applications.serial_lte_modem: build_only: true platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9131ek/nrf9131/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns tags: ci_build applications.serial_lte_modem.native_tls: build_only: true extra_args: EXTRA_CONF_FILE=overlay-native_tls.conf platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9131ek/nrf9131/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns tags: ci_build applications.serial_lte_modem.lwm2m_carrier: build_only: true extra_args: EXTRA_CONF_FILE=overlay-carrier.conf platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9131ek/nrf9131/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns tags: ci_build diff --git a/applications/serial_lte_modem/src/ftp_c/slm_at_ftp.c b/applications/serial_lte_modem/src/ftp_c/slm_at_ftp.c index c7d35fdaeb0d..2724be437631 100644 --- a/applications/serial_lte_modem/src/ftp_c/slm_at_ftp.c +++ b/applications/serial_lte_modem/src/ftp_c/slm_at_ftp.c @@ -23,87 +23,11 @@ LOG_MODULE_REGISTER(slm_ftp, CONFIG_SLM_LOG_LEVEL); #define FTP_PASSWORD_ANONYMOUS "anonymous@example.com" #define FTP_DEFAULT_PORT 21 -/**@brief Socketopt operations. */ -enum slm_ftp_operation { - /* FTP Session Management */ - FTP_OP_CLOSE, - FTP_OP_OPEN, - FTP_OP_STATUS, - FTP_OP_ASCII, - FTP_OP_BINARY, - FTP_OP_VERBOSE, - /* FTP Directory Operation */ - FTP_OP_PWD, - FTP_OP_LS, - FTP_OP_CD, - FTP_OP_MKDIR, - FTP_OP_RMDIR, - /* FTP File Operation */ - FTP_OP_RENAME, - FTP_OP_DELETE, - FTP_OP_GET, - FTP_OP_PUT, - FTP_OP_UPUT, - FTP_OP_MPUT, - /* count */ - FTP_OP_MAX -}; - -typedef int (*ftp_op_handler_t) (void); - -typedef struct ftp_op_list { - uint8_t op_code; - char *op_str; - ftp_op_handler_t handler; -} ftp_op_list_t; - static bool ftp_verbose_on; static char filepath[SLM_MAX_FILEPATH]; static int sz_filepath; static int (*ftp_data_mode_handler)(const uint8_t *data, int len, uint8_t flags); -/** forward declaration of cmd handlers **/ -static int do_ftp_close(void); -static int do_ftp_open(void); -static int do_ftp_status(void); -static int do_ftp_ascii(void); -static int do_ftp_binary(void); -static int do_ftp_verbose(void); - -static int do_ftp_pwd(void); -static int do_ftp_ls(void); -static int do_ftp_cd(void); -static int do_ftp_mkdir(void); -static int do_ftp_rmdir(void); - -static int do_ftp_rename(void); -static int do_ftp_delete(void); -static int do_ftp_get(void); -static int do_ftp_put(void); -static int do_ftp_uput(void); -static int do_ftp_mput(void); - -/**@brief SLM AT Command list type. */ -static ftp_op_list_t ftp_op_list[FTP_OP_MAX] = { - {FTP_OP_CLOSE, "close", do_ftp_close}, - {FTP_OP_OPEN, "open", do_ftp_open}, - {FTP_OP_STATUS, "status", do_ftp_status}, - {FTP_OP_ASCII, "ascii", do_ftp_ascii}, - {FTP_OP_BINARY, "binary", do_ftp_binary}, - {FTP_OP_VERBOSE, "verbose", do_ftp_verbose}, - {FTP_OP_PWD, "pwd", do_ftp_pwd}, - {FTP_OP_CD, "cd", do_ftp_cd}, - {FTP_OP_LS, "ls", do_ftp_ls}, - {FTP_OP_MKDIR, "mkdir", do_ftp_mkdir}, - {FTP_OP_RMDIR, "rmdir", do_ftp_rmdir}, - {FTP_OP_RENAME, "rename", do_ftp_rename}, - {FTP_OP_DELETE, "delete", do_ftp_delete}, - {FTP_OP_GET, "get", do_ftp_get}, - {FTP_OP_PUT, "put", do_ftp_put}, - {FTP_OP_UPUT, "uput", do_ftp_uput}, - {FTP_OP_MPUT, "mput", do_ftp_mput}, -}; - RING_BUF_DECLARE(ftp_data_buf, SLM_MAX_MESSAGE_SIZE); void ftp_ctrl_callback(const uint8_t *msg, uint16_t len) @@ -183,7 +107,9 @@ void ftp_data_callback(const uint8_t *msg, uint16_t len) /* AT#XFTP="open",,,[,[,]] */ /* similar to ftp://:@: */ -static int do_ftp_open(void) +SLM_AT_CMD_CUSTOM(xftp_open, "AT#XFTP=\"open\"", do_ftp_open); +static int do_ftp_open(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret = 0; char username[SLM_MAX_USERNAME] = ""; /* DO initialize, in case of login error */ @@ -194,31 +120,30 @@ static int do_ftp_open(void) int sz_hostname = sizeof(hostname); uint16_t port = FTP_DEFAULT_PORT; sec_tag_t sec_tag = INVALID_SEC_TAG; - int param_count = at_params_valid_count_get(&slm_at_param_list); /* Parse AT command */ - ret = util_string_get(&slm_at_param_list, 2, username, &sz_username); + ret = util_string_get(param_list, 2, username, &sz_username); if (ret || strlen(username) == 0) { strcpy(username, FTP_USER_ANONYMOUS); strcpy(password, FTP_PASSWORD_ANONYMOUS); } else { - ret = util_string_get(&slm_at_param_list, 3, password, &sz_password); + ret = util_string_get(param_list, 3, password, &sz_password); if (ret) { return -EINVAL; } } - ret = util_string_get(&slm_at_param_list, 4, hostname, &sz_hostname); + ret = util_string_get(param_list, 4, hostname, &sz_hostname); if (ret) { return ret; } if (param_count > 5) { - ret = at_params_unsigned_short_get(&slm_at_param_list, 5, &port); + ret = at_params_unsigned_short_get(param_list, 5, &port); if (ret) { return ret; } } if (param_count > 6) { - ret = at_params_unsigned_int_get(&slm_at_param_list, 6, &sec_tag); + ret = at_params_unsigned_int_get(param_list, 6, &sec_tag); if (ret) { return ret; } @@ -239,46 +164,46 @@ static int do_ftp_open(void) return 0; } -/* AT#XFTP="close" */ -static int do_ftp_close(void) +SLM_AT_CMD_CUSTOM(xftp_close, "AT#XFTP=\"close\"", do_ftp_close); +static int do_ftp_close(enum at_cmd_type, const struct at_param_list *, uint32_t) { int ret = ftp_close(); return (ret == FTP_CODE_221) ? 0 : -1; } -/* AT#XFTP="status" */ -static int do_ftp_status(void) +SLM_AT_CMD_CUSTOM(xftp_status, "AT#XFTP=\"status\"", do_ftp_status); +static int do_ftp_status(enum at_cmd_type, const struct at_param_list *, uint32_t) { int ret = ftp_status(); return (ret == FTP_CODE_211) ? 0 : -1; } -/* AT#XFTP="ascii" */ -static int do_ftp_ascii(void) +SLM_AT_CMD_CUSTOM(xftp_ascii, "AT#XFTP=\"ascii\"", do_ftp_ascii); +static int do_ftp_ascii(enum at_cmd_type, const struct at_param_list *, uint32_t) { int ret = ftp_type(FTP_TYPE_ASCII); return (ret == FTP_CODE_200) ? 0 : -1; } -/* AT#XFTP="binary" */ -static int do_ftp_binary(void) +SLM_AT_CMD_CUSTOM(xftp_binary, "AT#XFTP=\"binary\"", do_ftp_binary); +static int do_ftp_binary(enum at_cmd_type, const struct at_param_list *, uint32_t) { int ret = ftp_type(FTP_TYPE_BINARY); return (ret == FTP_CODE_200) ? 0 : -1; } -/* AT#XFTP="verbose","on|off" */ -static int do_ftp_verbose(void) +SLM_AT_CMD_CUSTOM(xftp_verbose, "AT#XFTP=\"verbose\"", do_ftp_verbose); +static int do_ftp_verbose(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret = 0; char vb_mode[4]; int sz_mode = 4; - ret = util_string_get(&slm_at_param_list, 2, vb_mode, &sz_mode); + ret = util_string_get(param_list, 2, vb_mode, &sz_mode); if (ret) { return ret; } @@ -296,8 +221,8 @@ static int do_ftp_verbose(void) return 0; } -/* AT#XFTP="pwd" */ -static int do_ftp_pwd(void) +SLM_AT_CMD_CUSTOM(xftp_pwd, "AT#XFTP=\"pwd\"", do_ftp_pwd); +static int do_ftp_pwd(enum at_cmd_type, const struct at_param_list *, uint32_t) { int ret = ftp_pwd(); @@ -305,15 +230,15 @@ static int do_ftp_pwd(void) } /* AT#XFTP="ls"[,[,]] */ -static int do_ftp_ls(void) +SLM_AT_CMD_CUSTOM(xftp_ls, "AT#XFTP=\"ls\"", do_ftp_ls); +static int do_ftp_ls(enum at_cmd_type, const struct at_param_list *param_list, uint32_t param_count) { int ret; char options[FTP_MAX_OPTION] = ""; int sz_options = FTP_MAX_OPTION; - int param_count = at_params_valid_count_get(&slm_at_param_list); if (param_count > 2) { - ret = util_string_get(&slm_at_param_list, 2, options, &sz_options); + ret = util_string_get(param_list, 2, options, &sz_options); if (ret) { return ret; } @@ -321,7 +246,7 @@ static int do_ftp_ls(void) memset(filepath, 0x00, SLM_MAX_FILEPATH); sz_filepath = SLM_MAX_FILEPATH; if (param_count > 3) { - ret = util_string_get(&slm_at_param_list, 3, filepath, &sz_filepath); + ret = util_string_get(param_list, 3, filepath, &sz_filepath); if (ret) { return ret; } @@ -337,13 +262,13 @@ static int do_ftp_ls(void) } } -/* AT#XFTP="cd", */ -static int do_ftp_cd(void) +SLM_AT_CMD_CUSTOM(xftp_cd, "AT#XFTP=\"cd\"", do_ftp_cd); +static int do_ftp_cd(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } @@ -352,13 +277,13 @@ static int do_ftp_cd(void) return (ret == FTP_CODE_250) ? 0 : -1; } -/* AT#XFTP="mkdir", */ -static int do_ftp_mkdir(void) +SLM_AT_CMD_CUSTOM(xftp_mkdir, "AT#XFTP=\"mkdir\"", do_ftp_mkdir); +static int do_ftp_mkdir(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } @@ -367,13 +292,13 @@ static int do_ftp_mkdir(void) return (ret == FTP_CODE_257) ? 0 : -1; } -/* AT#XFTP="rmdir", */ -static int do_ftp_rmdir(void) +SLM_AT_CMD_CUSTOM(xftp_rmdir, "AT#XFTP=\"rmdir\"", do_ftp_rmdir); +static int do_ftp_rmdir(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } @@ -382,19 +307,19 @@ static int do_ftp_rmdir(void) return (ret == FTP_CODE_250) ? 0 : -1; } -/* AT#XFTP="rename",, */ -static int do_ftp_rename(void) +SLM_AT_CMD_CUSTOM(xftp_rename, "AT#XFTP=\"rename\"", do_ftp_rename); +static int do_ftp_rename(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; char file_new[SLM_MAX_FILEPATH]; int sz_file_new = SLM_MAX_FILEPATH; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } - ret = util_string_get(&slm_at_param_list, 3, file_new, &sz_file_new); + ret = util_string_get(param_list, 3, file_new, &sz_file_new); if (ret) { return ret; } @@ -403,13 +328,13 @@ static int do_ftp_rename(void) return (ret == FTP_CODE_250) ? 0 : -1; } -/* AT#XFTP="delete", */ -static int do_ftp_delete(void) +SLM_AT_CMD_CUSTOM(xftp_delete, "AT#XFTP=\"delete\"", do_ftp_delete); +static int do_ftp_delete(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } @@ -418,13 +343,13 @@ static int do_ftp_delete(void) return (ret == FTP_CODE_250) ? 0 : -1; } -/* AT#XFTP="get", */ -static int do_ftp_get(void) +SLM_AT_CMD_CUSTOM(xftp_get, "AT#XFTP=\"get\"", do_ftp_get); +static int do_ftp_get(enum at_cmd_type, const struct at_param_list *param_list, uint32_t) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } @@ -475,18 +400,19 @@ static int ftp_put_handler(const uint8_t *data, int len, uint8_t flags) return (ret == FTP_CODE_226) ? 0 : -1; } -/* AT#XFTP="put",[,] */ -static int do_ftp_put(void) +SLM_AT_CMD_CUSTOM(xftp_put, "AT#XFTP=\"put\"", do_ftp_put); +static int do_ftp_put(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } - if (at_params_valid_count_get(&slm_at_param_list) == 3) { + if (param_count == 3) { /* enter data mode */ ret = enter_datamode(ftp_datamode_callback); if (ret) { @@ -498,7 +424,7 @@ static int do_ftp_put(void) int size = sizeof(data); int err; - err = util_string_get(&slm_at_param_list, 3, data, &size); + err = util_string_get(param_list, 3, data, &size); if (err) { return err; } @@ -527,12 +453,13 @@ static int ftp_uput_handler(const uint8_t *data, int len, uint8_t flags) return (ret == FTP_CODE_226) ? 0 : -1; } -/* AT#XFTP="uput"[,] */ -static int do_ftp_uput(void) +SLM_AT_CMD_CUSTOM(xftp_uput, "AT#XFTP=\"uput\"", do_ftp_uput); +static int do_ftp_uput(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret = -1; - if (at_params_valid_count_get(&slm_at_param_list) == 2) { + if (param_count == 2) { /* enter data mode */ ret = enter_datamode(ftp_datamode_callback); if (ret) { @@ -544,7 +471,7 @@ static int do_ftp_uput(void) int size = sizeof(data); int err; - err = util_string_get(&slm_at_param_list, 2, data, &size); + err = util_string_get(param_list, 2, data, &size); if (err) { return err; } @@ -569,18 +496,19 @@ static int ftp_mput_handler(const uint8_t *data, int len, uint8_t flags) return (ret == FTP_CODE_226) ? 0 : -1; } -/* AT#XFTP="mput",[,] */ -static int do_ftp_mput(void) +SLM_AT_CMD_CUSTOM(xftp_mput, "AT#XFTP=\"mput\"", do_ftp_mput); +static int do_ftp_mput(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret; sz_filepath = SLM_MAX_FILEPATH; - ret = util_string_get(&slm_at_param_list, 2, filepath, &sz_filepath); + ret = util_string_get(param_list, 2, filepath, &sz_filepath); if (ret) { return ret; } - if (at_params_valid_count_get(&slm_at_param_list) == 3) { + if (param_count == 3) { /* enter data mode */ ret = enter_datamode(ftp_datamode_callback); if (ret) { @@ -592,7 +520,7 @@ static int do_ftp_mput(void) int size = sizeof(data); int err; - err = util_string_get(&slm_at_param_list, 3, data, &size); + err = util_string_get(param_list, 3, data, &size); if (err) { return err; } @@ -603,32 +531,6 @@ static int do_ftp_mput(void) return ret; } -/**@brief API to handle FTP AT command - */ -int handle_at_ftp(enum at_cmd_type cmd_type) -{ - int ret; - char op_str[16]; - int size = 16; - - if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { - return -EINVAL; - } - ret = util_string_get(&slm_at_param_list, 1, op_str, &size); - if (ret) { - return ret; - } - ret = -EINVAL; - for (int i = 0; i < FTP_OP_MAX; i++) { - if (slm_util_casecmp(op_str, ftp_op_list[i].op_str)) { - ret = ftp_op_list[i].handler(); - break; - } - } - - return ret; -} - /**@brief API to initialize FTP AT commands handler */ int slm_at_ftp_init(void) diff --git a/applications/serial_lte_modem/src/ftp_c/slm_at_tftp.c b/applications/serial_lte_modem/src/ftp_c/slm_at_tftp.c index 1b31f3261c68..6aa3f2017d5d 100644 --- a/applications/serial_lte_modem/src/ftp_c/slm_at_tftp.c +++ b/applications/serial_lte_modem/src/ftp_c/slm_at_tftp.c @@ -50,8 +50,7 @@ static int do_tftp_get(int family, const char *server, uint16_t port, const char struct tftpc client = { .callback = tftp_callback }; - ret = util_resolve_host(0, server, port, family, - Z_LOG_OBJECT_PTR(slm_tftp), &client.server); + ret = util_resolve_host(0, server, port, family, &client.server); if (ret) { return -EAGAIN; } @@ -94,8 +93,7 @@ static int do_tftp_put(int family, const char *server, uint16_t port, const char .callback = tftp_callback }; - ret = util_resolve_host(0, server, port, family, - Z_LOG_OBJECT_PTR(slm_tftp), &client.server); + ret = util_resolve_host(0, server, port, family, &client.server); if (ret) { return -EAGAIN; } @@ -130,8 +128,9 @@ static int do_tftp_put(int family, const char *server, uint16_t port, const char return ret; } -/* Handles AT#XTFTP commands. */ -int handle_at_tftp(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtftp, "AT#XTFTP", handle_at_tftp); +static int handle_at_tftp(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; @@ -140,32 +139,31 @@ int handle_at_tftp(enum at_cmd_type cmd_type) char filepath[SLM_MAX_FILEPATH]; char mode[16]; /** "netascii", "octet", "mail" */ int size; - int param_count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } size = sizeof(url); - err = util_string_get(&slm_at_param_list, 2, url, &size); + err = util_string_get(param_list, 2, url, &size); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &port); + err = at_params_unsigned_short_get(param_list, 3, &port); if (err) { return err; } size = sizeof(filepath); - err = util_string_get(&slm_at_param_list, 4, filepath, &size); + err = util_string_get(param_list, 4, filepath, &size); if (err) { return err; } if (param_count > 5) { size = sizeof(mode); - err = util_string_get(&slm_at_param_list, 5, mode, &size); + err = util_string_get(param_list, 5, mode, &size); if (err) { return err; } @@ -186,7 +184,7 @@ int handle_at_tftp(enum at_cmd_type cmd_type) uint8_t data[SLM_MAX_PAYLOAD_SIZE + 1] = {0}; size = sizeof(data); - err = util_string_get(&slm_at_param_list, 6, data, &size); + err = util_string_get(param_list, 6, data, &size); if (err) { return err; } diff --git a/applications/serial_lte_modem/src/gnss/slm_at_gnss.c b/applications/serial_lte_modem/src/gnss/slm_at_gnss.c index 396a1edcc5c2..88d9564ed5bb 100644 --- a/applications/serial_lte_modem/src/gnss/slm_at_gnss.c +++ b/applications/serial_lte_modem/src/gnss/slm_at_gnss.c @@ -502,8 +502,8 @@ static void fix_rep_wk(struct k_work *work) /* GIS accuracy: http://wiki.gis.com/wiki/index.php/Decimal_degrees, use default .6lf */ rsp_send("\r\n#XGPS: %lf,%lf,%f,%f,%f,%f,\"%04u-%02u-%02u %02u:%02u:%02u\"\r\n", - pvt.latitude, pvt.longitude, pvt.altitude, - pvt.accuracy, pvt.speed, pvt.heading, + pvt.latitude, pvt.longitude, (double)pvt.altitude, + (double)pvt.accuracy, (double)pvt.speed, (double)pvt.heading, pvt.datetime.year, pvt.datetime.month, pvt.datetime.day, pvt.datetime.hour, pvt.datetime.minute, pvt.datetime.seconds); @@ -601,14 +601,15 @@ static void gnss_event_handler(int event) } } -/* Handles AT#XGPS commands. */ -int handle_at_gps(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xgps_set, "AT#XGPS=", handle_at_gps); +SLM_AT_CMD_CUSTOM(xgps_read, "AT#XGPS?", handle_at_gps); +static int handle_at_gps(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; uint16_t interval; uint16_t timeout; - uint32_t param_count; enum { OP_IDX = 1, @@ -619,8 +620,7 @@ int handle_at_gps(enum at_cmd_type cmd_type) }; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - param_count = at_params_valid_count_get(&slm_at_param_list); - err = at_params_unsigned_short_get(&slm_at_param_list, OP_IDX, &op); + err = at_params_unsigned_short_get(param_list, OP_IDX, &op); if (err) { return err; } @@ -631,7 +631,7 @@ int handle_at_gps(enum at_cmd_type cmd_type) } err = at_params_unsigned_short_get( - &slm_at_param_list, CLOUD_ASSISTANCE_IDX, &gnss_cloud_assistance); + param_list, CLOUD_ASSISTANCE_IDX, &gnss_cloud_assistance); if (err || gnss_cloud_assistance > 1) { return -EINVAL; } @@ -652,8 +652,7 @@ int handle_at_gps(enum at_cmd_type cmd_type) return -ENOTCONN; } - err = at_params_unsigned_short_get( - &slm_at_param_list, INTERVAL_IDX, &interval); + err = at_params_unsigned_short_get(param_list, INTERVAL_IDX, &interval); if (err || (interval > 1 && interval < 10)) { return -EINVAL; } @@ -687,7 +686,7 @@ int handle_at_gps(enum at_cmd_type cmd_type) timeout = 60; /* default value */ } else { err = at_params_unsigned_short_get( - &slm_at_param_list, TIMEOUT_IDX, &timeout); + param_list, TIMEOUT_IDX, &timeout); if (err || param_count != MAX_PARAM_COUNT) { return -EINVAL; } @@ -731,15 +730,16 @@ int handle_at_gps(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XGPSDEL commands. */ -int handle_at_gps_delete(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xgpsdel, "AT#XGPSDEL", handle_at_gps_delete); +static int handle_at_gps_delete(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint32_t mask; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_int_get(&slm_at_param_list, 1, &mask); + err = at_params_unsigned_int_get(param_list, 1, &mask); if (err || !mask || (mask & NRF_MODEM_GNSS_DELETE_TCXO_OFFSET)) { return -EINVAL; } diff --git a/applications/serial_lte_modem/src/gpio/slm_at_gpio.c b/applications/serial_lte_modem/src/gpio/slm_at_gpio.c index 51463e28d529..e8e78046d963 100644 --- a/applications/serial_lte_modem/src/gpio/slm_at_gpio.c +++ b/applications/serial_lte_modem/src/gpio/slm_at_gpio.c @@ -192,20 +192,21 @@ static int do_gpio_pin_operate(uint16_t op, gpio_pin_t pin, uint16_t value) return 0; } -/* Handles AT#XGPIOCFG commands. */ -int handle_at_gpio_configure(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xgpiocfg, "AT#XGPIOCFG", handle_at_gpio_configure); +static int handle_at_gpio_configure(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t) { int err = -EINVAL; uint16_t pin = 0xff, op = 0xff; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err < 0) { LOG_ERR("Fail to get op: %d", err); return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &pin); + err = at_params_unsigned_short_get(param_list, 2, &pin); if (err < 0) { LOG_ERR("Fail to get pin: %d", err); return err; @@ -223,15 +224,17 @@ int handle_at_gpio_configure(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XGPIO command. */ -int handle_at_gpio_operate(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xgpio_set, "AT#XGPIO=", handle_at_gpio_operate); +SLM_AT_CMD_CUSTOM(xgpio_read, "AT#XGPIO?", handle_at_gpio_operate); +static int handle_at_gpio_operate(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint16_t pin = 0xff, op = 0xff, value = 0xff; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err < 0) { LOG_ERR("Fail to get OP code: %d", err); return err; @@ -240,7 +243,7 @@ int handle_at_gpio_operate(enum at_cmd_type cmd_type) LOG_ERR("GPIO OP code is out of range: %d", op); return -EINVAL; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &pin); + err = at_params_unsigned_short_get(param_list, 2, &pin); if (err < 0) { LOG_ERR("Fail to get pin: %d", err); return err; @@ -250,7 +253,7 @@ int handle_at_gpio_operate(enum at_cmd_type cmd_type) return -EINVAL; } if (op == SLM_GPIO_OP_WRITE) { - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &value); + err = at_params_unsigned_short_get(param_list, 3, &value); if (err < 0) { LOG_ERR("Fail to get value: %d", err); return err; diff --git a/applications/serial_lte_modem/src/http_c/slm_at_httpc.c b/applications/serial_lte_modem/src/http_c/slm_at_httpc.c index f787bcfab9df..590439f9bb9c 100644 --- a/applications/serial_lte_modem/src/http_c/slm_at_httpc.c +++ b/applications/serial_lte_modem/src/http_c/slm_at_httpc.c @@ -304,8 +304,7 @@ static int do_http_connect(void) } /* Connect to HTTP server */ - ret = util_resolve_host(0, httpc.host, httpc.port, httpc.family, - Z_LOG_OBJECT_PTR(slm_httpc), &sa); + ret = util_resolve_host(0, httpc.host, httpc.port, httpc.family, &sa); if (ret) { goto exit_cli; } @@ -418,8 +417,9 @@ static int do_http_request(void) return err; } -/* Handles AT#XHTTPCCON commands. */ -int handle_at_httpc_connect(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xhttpccon, "AT#XHTTPCCON", handle_at_httpc_connect); +static int handle_at_httpc_connect(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err = -EINVAL; uint16_t op; @@ -427,31 +427,28 @@ int handle_at_httpc_connect(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } if (op == HTTPC_CONNECT || op == HTTPC_CONNECT6) { - err = util_string_get(&slm_at_param_list, 2, httpc.host, &host_sz); + err = util_string_get(param_list, 2, httpc.host, &host_sz); if (err) { return err; } - if (at_params_unsigned_short_get(&slm_at_param_list, 3, &httpc.port)) { + if (at_params_unsigned_short_get(param_list, 3, &httpc.port)) { return -EINVAL; } - const int param_count = at_params_valid_count_get(&slm_at_param_list); httpc.sec_tag = INVALID_SEC_TAG; if (param_count > 4) { - if (at_params_unsigned_int_get(&slm_at_param_list, 4, - &httpc.sec_tag)) { + if (at_params_unsigned_int_get(param_list, 4, &httpc.sec_tag)) { return -EINVAL; } } httpc.peer_verify = TLS_PEER_VERIFY_REQUIRED; if (param_count > 5) { - if (at_params_unsigned_int_get(&slm_at_param_list, 5, - &httpc.peer_verify) || + if (at_params_unsigned_int_get(param_list, 5, &httpc.peer_verify) || (httpc.peer_verify != TLS_PEER_VERIFY_NONE && httpc.peer_verify != TLS_PEER_VERIFY_OPTIONAL && httpc.peer_verify != TLS_PEER_VERIFY_REQUIRED)) { @@ -462,8 +459,7 @@ int handle_at_httpc_connect(enum at_cmd_type cmd_type) if (param_count > 6) { uint16_t hostname_verify; - if (at_params_unsigned_short_get(&slm_at_param_list, 6, - &hostname_verify) || + if (at_params_unsigned_short_get(param_list, 6, &hostname_verify) || (hostname_verify != 0 && hostname_verify != 1)) { return -EINVAL; } @@ -570,11 +566,11 @@ static int http_headers_preprocess(size_t size) return 0; } -/* Handles AT#XHTTPCREQ commands. */ -int handle_at_httpc_request(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xhttpcreq, "AT#XHTTPCREQ", handle_at_httpc_request); +static int handle_at_httpc_request(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err = -EINVAL; - int param_count; int size; size_t offset; @@ -588,7 +584,7 @@ int handle_at_httpc_request(enum at_cmd_type cmd_type) memset(slm_data_buf, 0, sizeof(slm_data_buf)); /* Get method string */ size = HTTPC_METHOD_LEN; - err = util_string_get(&slm_at_param_list, 1, slm_data_buf, &size); + err = util_string_get(param_list, 1, slm_data_buf, &size); if (err < 0) { LOG_ERR("Fail to get method string: %d", err); return err; @@ -597,19 +593,18 @@ int handle_at_httpc_request(enum at_cmd_type cmd_type) offset = size + 1; /* Get resource path string */ size = HTTPC_RES_LEN; - err = util_string_get(&slm_at_param_list, 2, slm_data_buf + offset, &size); + err = util_string_get(param_list, 2, slm_data_buf + offset, &size); if (err < 0) { LOG_ERR("Fail to get resource string: %d", err); return err; } httpc.resource = (char *)(slm_data_buf + offset); - param_count = at_params_valid_count_get(&slm_at_param_list); httpc.headers = NULL; if (param_count >= 4) { /* Get headers string */ offset += size + 1; size = HTTPC_HEADERS_LEN; - err = util_string_get(&slm_at_param_list, 3, slm_data_buf + offset, &size); + err = util_string_get(param_list, 3, slm_data_buf + offset, &size); if (err == 0 && size > 0) { httpc.headers = (char *)(slm_data_buf + offset); err = http_headers_preprocess(size); @@ -625,13 +620,12 @@ int handle_at_httpc_request(enum at_cmd_type cmd_type) /* Get content type string */ offset += size + 1; size = HTTPC_CONTEN_TYPE_LEN; - err = util_string_get(&slm_at_param_list, 4, slm_data_buf + offset, &size); + err = util_string_get(param_list, 4, slm_data_buf + offset, &size); if (err == 0 && size > 0) { httpc.content_type = (char *)(slm_data_buf + offset); } /* Get content length */ - err = at_params_unsigned_int_get( - &slm_at_param_list, 5, &httpc.content_length); + err = at_params_unsigned_int_get(param_list, 5, &httpc.content_length); if (err != 0) { return err; } @@ -639,7 +633,7 @@ int handle_at_httpc_request(enum at_cmd_type cmd_type) uint16_t tmp; /* Get chunked transfer flag */ - err = at_params_unsigned_short_get(&slm_at_param_list, 6, &tmp); + err = at_params_unsigned_short_get(param_list, 6, &tmp); if (err != 0) { return err; } diff --git a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.c b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.c index 5f9ee242872b..68436ff2c0c3 100644 --- a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.c +++ b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.c @@ -17,97 +17,10 @@ LOG_MODULE_REGISTER(slm_carrier, CONFIG_SLM_LOG_LEVEL); -/**@brief LwM2M Carrier operations. */ -enum slm_carrier_operation { - /* Carrier AppData Operation */ - CARRIER_OP_APPDATA_SET, - /* Carrier Device Operation */ - CARRIER_OP_DEVICE_BATTERY_LEVEL, - CARRIER_OP_DEVICE_BATTERY_STATUS, - CARRIER_OP_DEVICE_CURRENT, - CARRIER_OP_DEVICE_ERROR, - CARRIER_OP_DEVICE_MEM_TOTAL, - CARRIER_OP_DEVICE_MEM_FREE, - CARRIER_OP_DEVICE_POWER_SOURCES, - CARRIER_OP_DEVICE_TIMEZONE, - CARRIER_OP_DEVICE_TIME, - CARRIER_OP_DEVICE_UTC_OFFSET, - CARRIER_OP_DEVICE_UTC_TIME, - CARRIER_OP_DEVICE_VOLTAGE, - /* Carrier Event Log Operation */ - CARRIER_OP_EVENT_LOG_LOG_DATA, - /* Carrier Location Operation */ - CARRIER_OP_LOCATION_POSITION, - CARRIER_OP_LOCATION_VELOCITY, - /* Carrier Portfolio Operation */ - CARRIER_OP_PORTFOLIO, - /* Carrier Request Operation */ - CARRIER_OP_REQUEST_REBOOT, - CARRIER_OP_REQUEST_LINK_DOWN, - CARRIER_OP_REQUEST_LINK_UP, - /* Carrier Send Operation */ - CARRIER_OP_SEND, - /* Count */ - CARRIER_OP_MAX -}; - -struct carrier_op_list { - uint8_t op_code; - char *op_str; - int (*handler)(void); -}; /* Static variable to report the memory free resource. */ static int m_mem_free; -/** forward declaration of cmd handlers **/ -static int do_carrier_appdata_set(void); -static int do_carrier_device_battery_level(void); -static int do_carrier_device_battery_status(void); -static int do_carrier_device_current(void); -static int do_carrier_device_error(void); -static int do_carrier_device_mem_total(void); -static int do_carrier_device_mem_free(void); -static int do_carrier_device_power_sources(void); -static int do_carrier_device_timezone(void); -static int do_carrier_device_time(void); -static int do_carrier_device_utc_offset(void); -static int do_carrier_device_utc_time(void); -static int do_carrier_device_voltage(void); -static int do_carrier_event_log_log_data(void); -static int do_carrier_location_position(void); -static int do_carrier_location_velocity(void); -static int do_carrier_portfolio(void); -static int do_carrier_request_reboot(void); -static int do_carrier_request_link_down(void); -static int do_carrier_request_link_up(void); -static int do_carrier_send(void); - -/**@brief SLM Carrier AT Command list type. */ -static struct carrier_op_list op_list[CARRIER_OP_MAX] = { - {CARRIER_OP_APPDATA_SET, "app_data_set", do_carrier_appdata_set}, - {CARRIER_OP_DEVICE_BATTERY_LEVEL, "battery_level", do_carrier_device_battery_level}, - {CARRIER_OP_DEVICE_BATTERY_STATUS, "battery_status", do_carrier_device_battery_status}, - {CARRIER_OP_DEVICE_CURRENT, "current", do_carrier_device_current}, - {CARRIER_OP_DEVICE_ERROR, "error", do_carrier_device_error}, - {CARRIER_OP_DEVICE_MEM_TOTAL, "memory_total", do_carrier_device_mem_total}, - {CARRIER_OP_DEVICE_MEM_FREE, "memory_free", do_carrier_device_mem_free}, - {CARRIER_OP_DEVICE_POWER_SOURCES, "power_sources", do_carrier_device_power_sources}, - {CARRIER_OP_DEVICE_TIMEZONE, "timezone", do_carrier_device_timezone}, - {CARRIER_OP_DEVICE_TIME, "time", do_carrier_device_time}, - {CARRIER_OP_DEVICE_UTC_OFFSET, "utc_offset", do_carrier_device_utc_offset}, - {CARRIER_OP_DEVICE_UTC_TIME, "utc_time", do_carrier_device_utc_time}, - {CARRIER_OP_DEVICE_VOLTAGE, "voltage", do_carrier_device_voltage}, - {CARRIER_OP_EVENT_LOG_LOG_DATA, "log_data", do_carrier_event_log_log_data}, - {CARRIER_OP_LOCATION_POSITION, "position", do_carrier_location_position}, - {CARRIER_OP_LOCATION_VELOCITY, "velocity", do_carrier_location_velocity}, - {CARRIER_OP_PORTFOLIO, "portfolio", do_carrier_portfolio}, - {CARRIER_OP_REQUEST_REBOOT, "reboot", do_carrier_request_reboot}, - {CARRIER_OP_REQUEST_LINK_DOWN, "link_down", do_carrier_request_link_down}, - {CARRIER_OP_REQUEST_LINK_UP, "link_up", do_carrier_request_link_up}, - {CARRIER_OP_SEND, "send", do_carrier_send}, -}; - #define SLM_CARRIER_OP_STR_MAX (sizeof("battery_status") + 1) struct k_work_delayable reconnect_work; @@ -310,12 +223,12 @@ static int carrier_datamode_callback(uint8_t op, const uint8_t *data, int len, u } /* AT#XCARRIER="app_data_set"[,][,,] */ -static int do_carrier_appdata_set(void) +SLM_AT_CMD_CUSTOM(xcarrier_app_data_set, "AT#XCARRIER=\"app_data_set\"", do_carrier_appdata_set); +static int do_carrier_appdata_set(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret = 0; - uint32_t param_count = at_params_valid_count_get(&slm_at_param_list); - if (param_count == 2) { /* enter data mode */ ret = enter_datamode(carrier_datamode_callback); @@ -329,7 +242,7 @@ static int do_carrier_appdata_set(void) uint16_t path[3] = { LWM2M_CARRIER_OBJECT_APP_DATA_CONTAINER, 0, 0 }; uint8_t path_len = 3; - ret = util_string_get(&slm_at_param_list, 2, data, &size); + ret = util_string_get(param_list, 2, data, &size); if (ret) { return ret; } @@ -343,12 +256,12 @@ static int do_carrier_appdata_set(void) uint16_t inst_id; uint16_t res_inst_id; - ret = at_params_unsigned_short_get(&slm_at_param_list, param_count - 2, &inst_id); + ret = at_params_unsigned_short_get(param_list, param_count - 2, &inst_id); if (ret) { return ret; } - ret = at_params_unsigned_short_get(&slm_at_param_list, param_count - 1, + ret = at_params_unsigned_short_get(param_list, param_count - 1, &res_inst_id); if (ret) { return ret; @@ -361,7 +274,7 @@ static int do_carrier_appdata_set(void) if (param_count == 5) { size = CONFIG_SLM_CARRIER_APP_DATA_BUFFER_LEN; - ret = util_string_get(&slm_at_param_list, 2, buffer, &size); + ret = util_string_get(param_list, 2, buffer, &size); if (ret) { return ret; } @@ -376,12 +289,15 @@ static int do_carrier_appdata_set(void) } /* AT#XCARRIER="battery_level", */ -static int do_carrier_device_battery_level(void) +SLM_AT_CMD_CUSTOM(xcarrier_battery_level, "AT#XCARRIER=\"battery_level\"", + do_carrier_device_battery_level); +static int do_carrier_device_battery_level(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret; uint16_t battery_level; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &battery_level); + ret = at_params_unsigned_short_get(param_list, 2, &battery_level); if (ret) { return ret; } @@ -390,11 +306,14 @@ static int do_carrier_device_battery_level(void) } /* AT#XCARRIER="battery_status", */ -static int do_carrier_device_battery_status(void) +SLM_AT_CMD_CUSTOM(xcarrier_battery_status, "AT#XCARRIER=\"battery_status\"", + do_carrier_device_battery_status); +static int do_carrier_device_battery_status(enum at_cmd_type, + const struct at_param_list *param_list, uint32_t) { int ret, battery_status; - ret = at_params_int_get(&slm_at_param_list, 2, &battery_status); + ret = at_params_int_get(param_list, 2, &battery_status); if (ret) { return ret; } @@ -403,17 +322,19 @@ static int do_carrier_device_battery_status(void) } /* AT#XCARRIER="current",, */ -static int do_carrier_device_current(void) +SLM_AT_CMD_CUSTOM(xcarrier_current, "AT#XCARRIER=\"current\"", do_carrier_device_current); +static int do_carrier_device_current(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, current; uint16_t power_source; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &power_source); + ret = at_params_unsigned_short_get(param_list, 2, &power_source); if (ret) { return ret; } - ret = at_params_int_get(&slm_at_param_list, 3, ¤t); + ret = at_params_int_get(param_list, 3, ¤t); if (ret) { return ret; } @@ -422,19 +343,21 @@ static int do_carrier_device_current(void) } /* AT#XCARRIER="error","add|remove", */ -static int do_carrier_device_error(void) +SLM_AT_CMD_CUSTOM(xcarrie_error, "AT#XCARRIER=\"error\"", do_carrier_device_error); +static int do_carrier_device_error(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret; int32_t error_code; char operation[7]; int size = sizeof(operation); - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } - ret = at_params_int_get(&slm_at_param_list, 3, &error_code); + ret = at_params_int_get(param_list, 3, &error_code); if (ret) { return ret; } @@ -467,13 +390,15 @@ int lwm2m_carrier_memory_free_read(void) } /* AT#XCARRIER="memory_free","read|write"[,] */ -static int do_carrier_device_mem_free(void) +SLM_AT_CMD_CUSTOM(xcarrier_memory_free, "AT#XCARRIER=\"memory_free\"", do_carrier_device_mem_free); +static int do_carrier_device_mem_free(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, memory; char operation[6]; int size = sizeof(operation); - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } @@ -483,7 +408,7 @@ static int do_carrier_device_mem_free(void) rsp_send("\r\n#XCARRIER: %d\r\n", memory); } else if (slm_util_casecmp(operation, "write")) { - ret = at_params_int_get(&slm_at_param_list, 3, &memory); + ret = at_params_int_get(param_list, 3, &memory); if (ret) { return ret; } @@ -495,11 +420,14 @@ static int do_carrier_device_mem_free(void) } /* AT#XCARRIER="memory_total", */ -static int do_carrier_device_mem_total(void) +SLM_AT_CMD_CUSTOM(xcarrier_memory_total, "AT#XCARRIER=\"memory_total\"", + do_carrier_device_mem_total); +static int do_carrier_device_mem_total(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, memory_total; - ret = at_params_int_get(&slm_at_param_list, 2, &memory_total); + ret = at_params_int_get(param_list, 2, &memory_total); if (ret) { return ret; } @@ -508,20 +436,22 @@ static int do_carrier_device_mem_total(void) } /* AT#XCARRIER="power_sources"[,[[,...[,]]]] */ -static int do_carrier_device_power_sources(void) +SLM_AT_CMD_CUSTOM(xcarrier_power_sources, "AT#XCARRIER=\"power_sources\"", + do_carrier_device_power_sources); +static int do_carrier_device_power_sources(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret; - uint8_t sources[7], count; + uint8_t sources[7]; uint16_t source; - count = at_params_valid_count_get(&slm_at_param_list); - if (count - 2 > sizeof(sources)) { + if (param_count - 2 > sizeof(sources)) { LOG_DBG("AT#XCARRIER=\"power_sources\" failed: too many parameters"); return -EINVAL; } - for (int i = 2; i < count; i++) { - ret = at_params_unsigned_short_get(&slm_at_param_list, i, &source); + for (int i = 2; i < param_count; i++) { + ret = at_params_unsigned_short_get(param_list, i, &source); if (ret) { return ret; } @@ -529,17 +459,19 @@ static int do_carrier_device_power_sources(void) sources[i - 2] = (uint8_t)source; } - return lwm2m_carrier_avail_power_sources_set(sources, count - 2); + return lwm2m_carrier_avail_power_sources_set(sources, param_count - 2); } -/* AT#XCARRIER="timezone","read|write"[,] */ -static int do_carrier_device_timezone(void) +/* AT#XCARRIER="timezone", */ +SLM_AT_CMD_CUSTOM(xcarrier_timezone, "AT#XCARRIER=\"timezone\"", do_carrier_device_timezone); +static int do_carrier_device_timezone(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret; char operation[6]; size_t size = sizeof(operation); - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } @@ -561,7 +493,7 @@ static int do_carrier_device_timezone(void) size = sizeof(timezone); - ret = util_string_get(&slm_at_param_list, 3, timezone, &size); + ret = util_string_get(param_list, 3, timezone, &size); if (ret) { return ret; } @@ -585,7 +517,8 @@ static void print_utc_time(char *output, int32_t timestamp) } /* AT#XCARRIER="time" */ -static int do_carrier_device_time(void) +SLM_AT_CMD_CUSTOM(xcarrier_time, "AT#XCARRIER=\"time\"", do_carrier_device_time); +static int do_carrier_device_time(enum at_cmd_type, const struct at_param_list *, uint32_t) { int utc_time, utc_offset; const char *timezone = NULL; @@ -607,13 +540,16 @@ static int do_carrier_device_time(void) } /* AT#XCARRIER="utc_offset","read|write"[,] */ -static int do_carrier_device_utc_offset(void) +SLM_AT_CMD_CUSTOM(xcarrier_utc_offset, "AT#XCARRIER=\"utc_offset\"", + do_carrier_device_utc_offset); +static int do_carrier_device_utc_offset(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, utc_offset; char operation[6]; size_t size = sizeof(operation); - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } @@ -625,7 +561,7 @@ static int do_carrier_device_utc_offset(void) return 0; } else if (slm_util_casecmp(operation, "WRITE")) { - ret = at_params_int_get(&slm_at_param_list, 3, &utc_offset); + ret = at_params_int_get(param_list, 3, &utc_offset); if (ret) { return ret; } @@ -639,14 +575,16 @@ static int do_carrier_device_utc_offset(void) } /* AT#XCARRIER="utc_time","read|write"[,] */ -static int do_carrier_device_utc_time(void) +SLM_AT_CMD_CUSTOM(xcarrier_utc_time, "AT#XCARRIER=\"utc_time\"", do_carrier_device_utc_time); +static int do_carrier_device_utc_time(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, utc_time; char operation[6]; size_t size = sizeof(operation); char time_str[TIME_STR_SIZE]; - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } @@ -659,7 +597,7 @@ static int do_carrier_device_utc_time(void) return 0; } else if (slm_util_casecmp(operation, "WRITE")) { - ret = at_params_int_get(&slm_at_param_list, 3, &utc_time); + ret = at_params_int_get(param_list, 3, &utc_time); if (ret) { return ret; } @@ -673,17 +611,19 @@ static int do_carrier_device_utc_time(void) } /* AT#XCARRIER="voltage",, */ -static int do_carrier_device_voltage(void) +SLM_AT_CMD_CUSTOM(xcarrier_voltage, "AT#XCARRIER=\"voltage\"", do_carrier_device_voltage); +static int do_carrier_device_voltage(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret, voltage; uint16_t power_source; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &power_source); + ret = at_params_unsigned_short_get(param_list, 2, &power_source); if (ret) { return ret; } - ret = at_params_int_get(&slm_at_param_list, 3, &voltage); + ret = at_params_int_get(param_list, 3, &voltage); if (ret) { return ret; } @@ -692,12 +632,15 @@ static int do_carrier_device_voltage(void) } /* AT#XCARRIER="log_data", */ -static int do_carrier_event_log_log_data(void) +SLM_AT_CMD_CUSTOM(xcarrier_log_data, "AT#XCARRIER=\"log_data\"", + do_carrier_event_log_log_data); +static int do_carrier_event_log_log_data(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t) { char data[CONFIG_SLM_CARRIER_APP_DATA_BUFFER_LEN] = {0}; int size = CONFIG_SLM_CARRIER_APP_DATA_BUFFER_LEN; - int ret = util_string_get(&slm_at_param_list, 2, data, &size); + int ret = util_string_get(param_list, 2, data, &size); if (ret) { return ret; @@ -707,40 +650,42 @@ static int do_carrier_event_log_log_data(void) } /* AT#XCARRIER="position",,,,, */ -static int do_carrier_location_position(void) +SLM_AT_CMD_CUSTOM(xcarrier_position, "AT#XCARRIER=\"position\"", + do_carrier_location_position); +static int do_carrier_location_position(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - int ret, param_count; + int ret; double latitude, longitude; float altitude, uncertainty; uint32_t timestamp; - param_count = at_params_valid_count_get(&slm_at_param_list); if (param_count != 7) { LOG_DBG("AT#XCARRIER=\"position\" failed: invalid number of arguments"); return -EINVAL; } - ret = util_string_to_double_get(&slm_at_param_list, 2, &latitude); + ret = util_string_to_double_get(param_list, 2, &latitude); if (ret) { return ret; } - ret = util_string_to_double_get(&slm_at_param_list, 3, &longitude); + ret = util_string_to_double_get(param_list, 3, &longitude); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 4, &altitude); + ret = util_string_to_float_get(param_list, 4, &altitude); if (ret) { return ret; } - ret = at_params_unsigned_int_get(&slm_at_param_list, 5, ×tamp); + ret = at_params_unsigned_int_get(param_list, 5, ×tamp); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 6, &uncertainty); + ret = util_string_to_float_get(param_list, 6, &uncertainty); if (ret) { return ret; } @@ -749,38 +694,40 @@ static int do_carrier_location_position(void) } /* AT#XCARRIER="velocity",,,,, */ -static int do_carrier_location_velocity(void) +SLM_AT_CMD_CUSTOM(xcarrier_velocity, "AT#XCARRIER=\"velocity\"", + do_carrier_location_velocity); +static int do_carrier_location_velocity(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - int ret, param_count, heading; + int ret, heading; float speed_h, speed_v, uncertainty_h, uncertainty_v; - param_count = at_params_valid_count_get(&slm_at_param_list); if (param_count != 7) { LOG_DBG("AT#XCARRIER=\"velocity\" failed: invalid number of arguments"); return -EINVAL; } - ret = at_params_int_get(&slm_at_param_list, 2, &heading); + ret = at_params_int_get(param_list, 2, &heading); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 3, &speed_h); + ret = util_string_to_float_get(param_list, 3, &speed_h); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 4, &speed_v); + ret = util_string_to_float_get(param_list, 4, &speed_v); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 5, &uncertainty_h); + ret = util_string_to_float_get(param_list, 5, &uncertainty_h); if (ret) { return ret; } - ret = util_string_to_float_get(&slm_at_param_list, 6, &uncertainty_v); + ret = util_string_to_float_get(param_list, 6, &uncertainty_v); if (ret) { return ret; } @@ -789,27 +736,28 @@ static int do_carrier_location_velocity(void) } /* AT#XCARRIER="portfolio","create|read|write",[,[,]] */ -static int do_carrier_portfolio(void) +SLM_AT_CMD_CUSTOM(xcarrier_portfolio, "AT#XCARRIER=\"portfolio\"", do_carrier_portfolio); +static int do_carrier_portfolio(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - int ret, param_count; + int ret; uint16_t instance_id, identity_type; char operation[7], buffer[64]; size_t size = sizeof(operation); uint16_t buf_len = sizeof(buffer); - ret = util_string_get(&slm_at_param_list, 2, operation, &size); + ret = util_string_get(param_list, 2, operation, &size); if (ret) { return ret; } - ret = at_params_unsigned_short_get(&slm_at_param_list, 3, &instance_id); + ret = at_params_unsigned_short_get(param_list, 3, &instance_id); if (ret) { return ret; } - param_count = at_params_valid_count_get(&slm_at_param_list); if (param_count > 4) { - ret = at_params_unsigned_short_get(&slm_at_param_list, 4, &identity_type); + ret = at_params_unsigned_short_get(param_list, 4, &identity_type); if (ret) { return ret; } @@ -827,7 +775,7 @@ static int do_carrier_portfolio(void) } else if (slm_util_casecmp(operation, "WRITE") && (param_count > 4)) { size = sizeof(buffer); - ret = util_string_get(&slm_at_param_list, 5, buffer, &size); + ret = util_string_get(param_list, 5, buffer, &size); if (ret) { return ret; } @@ -843,30 +791,34 @@ static int do_carrier_portfolio(void) } /* AT#XCARRIER="reboot" */ -static int do_carrier_request_reboot(void) +SLM_AT_CMD_CUSTOM(xcarrier_reboot, "AT#XCARRIER=\"reboot\"", do_carrier_request_reboot); +static int do_carrier_request_reboot(enum at_cmd_type, const struct at_param_list *, uint32_t) { return lwm2m_carrier_request(LWM2M_CARRIER_REQUEST_REBOOT); } /* AT#XCARRIER="link_down" */ -static int do_carrier_request_link_down(void) +SLM_AT_CMD_CUSTOM(xcarrier_link_down, "AT#XCARRIER=\"link_down\"", + do_carrier_request_link_down); +static int do_carrier_request_link_down(enum at_cmd_type, const struct at_param_list *, uint32_t) { return lwm2m_carrier_request(LWM2M_CARRIER_REQUEST_LINK_DOWN); } /* AT#XCARRIER="link_up" */ -static int do_carrier_request_link_up(void) +SLM_AT_CMD_CUSTOM(xcarrier_link_up, "AT#XCARRIER=\"link_up\"", do_carrier_request_link_up); +static int do_carrier_request_link_up(enum at_cmd_type, const struct at_param_list *, uint32_t) { return lwm2m_carrier_request(LWM2M_CARRIER_REQUEST_LINK_UP); } /* AT#XCARRIER="send",,,[,] */ -static int do_carrier_send(void) +SLM_AT_CMD_CUSTOM(xcarrier_send, "AT#XCARRIER=\"send\"", do_carrier_send); +static int do_carrier_send(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret = 0; - uint32_t param_count = at_params_valid_count_get(&slm_at_param_list); - if (param_count != 5 && param_count != 6) { LOG_DBG("AT#XCARRIER=\"send\" failed: invalid number of arguments"); return -EINVAL; @@ -876,7 +828,7 @@ static int do_carrier_send(void) uint8_t path_len = 0; for (int i = 2; i < param_count; i++) { - ret = at_params_unsigned_short_get(&slm_at_param_list, i, &path[i - 2]); + ret = at_params_unsigned_short_get(param_list, i, &path[i - 2]); if (ret) { return ret; } @@ -887,33 +839,6 @@ static int do_carrier_send(void) return lwm2m_carrier_data_send(path, path_len); } -/** - * @brief API to handle AT#XCARRIER command. - */ -int handle_at_carrier(enum at_cmd_type cmd_type) -{ - int ret; - char op_str[SLM_CARRIER_OP_STR_MAX]; - int size = sizeof(op_str); - - if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { - return -EINVAL; - } - ret = util_string_get(&slm_at_param_list, 1, op_str, &size); - if (ret) { - return ret; - } - ret = -EINVAL; - for (int i = 0; i < CARRIER_OP_MAX; i++) { - if (slm_util_casecmp(op_str, op_list[i].op_str)) { - ret = op_list[i].handler(); - break; - } - } - - return ret; -} - int slm_at_carrier_init(void) { k_work_init_delayable(&reconnect_work, reconnect_wk); diff --git a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.h b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.h index d6fe5e3b2da7..52b3255f1ccb 100644 --- a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.h +++ b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier.h @@ -31,11 +31,6 @@ int slm_at_carrier_init(void); */ int slm_at_carrier_uninit(void); -/** - * @brief AT#XCARRIER command handler. - */ -int handle_at_carrier(enum at_cmd_type cmd_type); - /** @} */ #endif /* SLM_AT_CARRIER_ */ diff --git a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.c b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.c index e5277504130b..8b582f8c800e 100644 --- a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.c +++ b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.c @@ -14,152 +14,22 @@ LOG_MODULE_REGISTER(slm_carrier_cfg, CONFIG_SLM_LOG_LEVEL); -/**@brief LwM2M Carrier Configuration operations. */ -enum slm_carrier_cfg_operation { - /* Enable Automatic Startup */ - CARRIER_CFG_OP_AUTO_STARTUP, - /* General Custom Configuration */ - CARRIER_CFG_OP_CONFIG_ENABLE, - CARRIER_CFG_OP_CONFIG_APN, - CARRIER_CFG_OP_CONFIG_BOOTSTRAP_FROM_SMARTCARD, - CARRIER_CFG_OP_CONFIG_CARRIERS, - CARRIER_CFG_OP_CONFIG_COAP_CON_INTERVAL, - CARRIER_CFG_OP_CONFIG_FIRMWARE_DOWNLOAD_TIMEOUT, - CARRIER_CFG_OP_CONFIG_LGU_DEVICE_SERIAL_NO_TYPE, - CARRIER_CFG_OP_CONFIG_LGU_SERVICE_CODE, - CARRIER_CFG_OP_CONFIG_PDN_TYPE, - CARRIER_CFG_OP_CONFIG_QUEUE_MODE, - CARRIER_CFG_OP_CONFIG_SESSION_IDLE_TIMEOUT, - /* Device Custom Configuration */ - CARRIER_CFG_OP_DEVICE_ENABLE, - CARRIER_CFG_OP_DEVICE_DEVICE_TYPE, - CARRIER_CFG_OP_DEVICE_HW_VERSION, - CARRIER_CFG_OP_DEVICE_MANUFACTURER, - CARRIER_CFG_OP_DEVICE_MODEL_NUMBER, - CARRIER_CFG_OP_DEVICE_SW_VERSION, - /* Server Custom Configuration */ - CARRIER_CFG_OP_SERVER_ENABLE, - CARRIER_CFG_OP_SERVER_BINDING, - CARRIER_CFG_OP_SERVER_IS_BOOTSTRAP, - CARRIER_CFG_OP_SERVER_LIFETIME, - CARRIER_CFG_OP_SERVER_SEC_TAG, - CARRIER_CFG_OP_SERVER_URI, - /* Count */ - CARRIER_CFG_OP_MAX -}; - -/** forward declaration of configuration cmd handlers **/ -static int do_cfg_apn(void); -static int do_cfg_auto_startup(void); -static int do_cfg_bootstrap_from_smartcard(void); -static int do_cfg_carriers(void); -static int do_cfg_coap_con_interval(void); -static int do_cfg_firmware_download_timeout(void); -static int do_cfg_config_enable(void); -static int do_cfg_device_enable(void); -static int do_cfg_device_type(void); -static int do_cfg_hardware_version(void); -static int do_cfg_manufacturer(void); -static int do_cfg_model_number(void); -static int do_cfg_session_idle_timeout(void); -static int do_cfg_software_version(void); -static int do_cfg_device_serial_no_type(void); -static int do_cfg_service_code(void); -static int do_cfg_pdn_type(void); -static int do_cfg_queue_mode(void); -static int do_cfg_binding(void); -static int do_cfg_server_enable(void); -static int do_cfg_is_bootstrap(void); -static int do_cfg_lifetime(void); -static int do_cfg_sec_tag(void); -static int do_cfg_uri(void); - -struct carrier_cfg_op_list { - uint8_t op_code; - char *op_str; - int (*handler)(void); -}; - -/**@brief SLM Carrier Configuration AT Command list type. */ -static struct carrier_cfg_op_list cfg_op_list[CARRIER_CFG_OP_MAX] = { - {CARRIER_CFG_OP_AUTO_STARTUP, "auto_startup", do_cfg_auto_startup}, - {CARRIER_CFG_OP_CONFIG_APN, "apn", do_cfg_apn}, - {CARRIER_CFG_OP_CONFIG_BOOTSTRAP_FROM_SMARTCARD, "bootstrap_smartcard", - do_cfg_bootstrap_from_smartcard}, - {CARRIER_CFG_OP_CONFIG_CARRIERS, "carriers", do_cfg_carriers}, - {CARRIER_CFG_OP_CONFIG_COAP_CON_INTERVAL, "coap_con_interval", do_cfg_coap_con_interval}, - {CARRIER_CFG_OP_CONFIG_FIRMWARE_DOWNLOAD_TIMEOUT, "download_timeout", - do_cfg_firmware_download_timeout}, - {CARRIER_CFG_OP_CONFIG_ENABLE, "config_enable", do_cfg_config_enable}, - {CARRIER_CFG_OP_CONFIG_LGU_DEVICE_SERIAL_NO_TYPE, "device_serial_no_type", - do_cfg_device_serial_no_type}, - {CARRIER_CFG_OP_CONFIG_LGU_SERVICE_CODE, "service_code", do_cfg_service_code}, - {CARRIER_CFG_OP_CONFIG_PDN_TYPE, "pdn_type", do_cfg_pdn_type}, - {CARRIER_CFG_OP_CONFIG_QUEUE_MODE, "queue_mode", do_cfg_queue_mode}, - {CARRIER_CFG_OP_CONFIG_SESSION_IDLE_TIMEOUT, "session_idle_timeout", - do_cfg_session_idle_timeout}, - {CARRIER_CFG_OP_DEVICE_ENABLE, "device_enable", do_cfg_device_enable}, - {CARRIER_CFG_OP_DEVICE_DEVICE_TYPE, "device_type", do_cfg_device_type}, - {CARRIER_CFG_OP_DEVICE_HW_VERSION, "hardware_version", do_cfg_hardware_version}, - {CARRIER_CFG_OP_DEVICE_MANUFACTURER, "manufacturer", do_cfg_manufacturer}, - {CARRIER_CFG_OP_DEVICE_MODEL_NUMBER, "model_number", do_cfg_model_number}, - {CARRIER_CFG_OP_DEVICE_SW_VERSION, "software_version", do_cfg_software_version}, - {CARRIER_CFG_OP_SERVER_BINDING, "binding", do_cfg_binding}, - {CARRIER_CFG_OP_SERVER_ENABLE, "server_enable", do_cfg_server_enable}, - {CARRIER_CFG_OP_SERVER_IS_BOOTSTRAP, "is_bootstrap", do_cfg_is_bootstrap}, - {CARRIER_CFG_OP_SERVER_LIFETIME, "lifetime", do_cfg_lifetime}, - {CARRIER_CFG_OP_SERVER_SEC_TAG, "sec_tag", do_cfg_sec_tag}, - {CARRIER_CFG_OP_SERVER_URI, "uri", do_cfg_uri}, -}; - -#define SLM_CARRIER_CFG_OP_STR_MAX (sizeof("device_serial_no_type") + 1) - -/** - * @brief API to handle AT#XCARRIERCFG command. - */ -int handle_at_carrier_cfg(enum at_cmd_type cmd_type) -{ - int ret; - char op_str[SLM_CARRIER_CFG_OP_STR_MAX]; - int size = sizeof(op_str); - - if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { - return -EINVAL; - } - - ret = util_string_get(&slm_at_param_list, 1, op_str, &size); - if (ret) { - return ret; - } - - ret = -EINVAL; - for (int i = 0; i < CARRIER_CFG_OP_MAX; i++) { - if (slm_util_casecmp(op_str, cfg_op_list[i].op_str)) { - ret = cfg_op_list[i].handler(); - break; - } - } - - return ret; -} - /* AT#XCARRIERCFG="apn"[,] */ -static int do_cfg_apn(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_apn, "AT#XCARRIERCFG=\"apn\"", do_cfg_apn); +static int do_cfg_apn(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_apn_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } char apn[64]; int ret, size = sizeof(apn); - ret = util_string_get(&slm_at_param_list, 2, apn, &size); + ret = util_string_get(param_list, 2, apn, &size); if (ret) { return ret; } @@ -168,22 +38,21 @@ static int do_cfg_apn(void) } /* AT#XCARRIERCFG="auto_startup"[,<0|1>] */ -static int do_cfg_auto_startup(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_auto_startup, "AT#XCARRIERCFG=\"auto_startup\"", do_cfg_auto_startup); +static int do_cfg_auto_startup(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_auto_startup_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t auto_startup; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &auto_startup); + ret = at_params_unsigned_short_get(param_list, 2, &auto_startup); if (ret) { return ret; } @@ -197,22 +66,22 @@ static int do_cfg_auto_startup(void) } /* AT#XCARRIERCFG="bootstrap_smartcard"[,<0|1>] */ -static int do_cfg_bootstrap_from_smartcard(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_bootstrap_smartcard, "AT#XCARRIERCFG=\"bootstrap_smartcard\"", + do_cfg_bootstrap_from_smartcard); +static int do_cfg_bootstrap_from_smartcard(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_bootstrap_from_smartcard_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t enabled; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &enabled); + ret = at_params_unsigned_short_get(param_list, 2, &enabled); if (ret) { return ret; } @@ -257,31 +126,30 @@ static const char *carriers_enabled_str(void) } /* AT#XCARRIERCFG="carriers"[,"all"|[[,...[,]]]] */ -static int do_cfg_carriers(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_carriers, "AT#XCARRIERCFG=\"carriers\"", do_cfg_carriers); +static int do_cfg_carriers(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", carriers_enabled_str()); return 0; - } else if (count - 2 > ARRAY_SIZE(carriers_enabled_map)) { + } else if (param_count - 2 > ARRAY_SIZE(carriers_enabled_map)) { LOG_ERR("AT#XCARRIERCFG=\"carriers\" failed: too many parameters"); return -EINVAL; } uint32_t carriers_enabled = 0; int ret, size = sizeof("all"); - char buf[size]; + char size_buf[size]; - ret = util_string_get(&slm_at_param_list, 2, buf, &size); - if (!ret && slm_util_casecmp(buf, "all")) { + ret = util_string_get(param_list, 2, size_buf, &size); + if (!ret && slm_util_casecmp(size_buf, "all")) { carriers_enabled = UINT32_MAX; } else { - for (int i = 2; i < count; i++) { + for (int i = 2; i < param_count; i++) { uint16_t carrier; - ret = at_params_unsigned_short_get(&slm_at_param_list, i, &carrier); + ret = at_params_unsigned_short_get(param_list, i, &carrier); if (ret || (carrier >= ARRAY_SIZE(carriers_enabled_map))) { LOG_ERR("AT#XCARRIERCFG=\"carriers\" failed: illegal operator"); return -EINVAL; @@ -295,21 +163,21 @@ static int do_cfg_carriers(void) } /* AT#XCARRIERCFG="coap_con_interval"[,] */ -static int do_cfg_coap_con_interval(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_coap_con_interval, "AT#XCARRIERCFG=\"coap_con_interval\"", + do_cfg_coap_con_interval); +static int do_cfg_coap_con_interval(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_coap_con_interval_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret, coap_con_interval; - ret = at_params_int_get(&slm_at_param_list, 2, &coap_con_interval); + ret = at_params_int_get(param_list, 2, &coap_con_interval); if (ret) { return ret; } @@ -324,23 +192,24 @@ static int do_cfg_coap_con_interval(void) } /* AT#XCARRIERCFG="download_timeout"[,] */ -static int do_cfg_firmware_download_timeout(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_download_timeout, "AT#XCARRIERCFG=\"download_timeout\"", + do_cfg_firmware_download_timeout); +static int do_cfg_firmware_download_timeout(enum at_cmd_type, + const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %hu\r\n", lwm2m_settings_firmware_download_timeout_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t firmware_download_timeout; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &firmware_download_timeout); + ret = at_params_unsigned_short_get(param_list, 2, &firmware_download_timeout); if (ret) { return ret; } @@ -349,22 +218,22 @@ static int do_cfg_firmware_download_timeout(void) } /* AT#XCARRIERCFG="config_enable"[,<0|1>] */ -static int do_cfg_config_enable(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_config_enable, "AT#XCARRIERCFG=\"config_enable\"", + do_cfg_config_enable); +static int do_cfg_config_enable(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_enable_custom_config_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t enabled; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &enabled); + ret = at_params_unsigned_short_get(param_list, 2, &enabled); if (ret) { return ret; } @@ -378,23 +247,23 @@ static int do_cfg_config_enable(void) } /* AT#XCARRIERCFG="device_enable"[,<0|1>] */ -static int do_cfg_device_enable(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_device_enable, "AT#XCARRIERCFG=\"device_enable\"", + do_cfg_device_enable); +static int do_cfg_device_enable(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_enable_custom_device_config_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t enabled; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &enabled); + ret = at_params_unsigned_short_get(param_list, 2, &enabled); if (ret) { return ret; } @@ -408,15 +277,14 @@ static int do_cfg_device_enable(void) } /* AT#XCARRIERCFG="device_type"[,] */ -static int do_cfg_device_type(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_device_type, "AT#XCARRIERCFG=\"device_type\"", do_cfg_device_type); +static int do_cfg_device_type(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_device_type_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -424,7 +292,7 @@ static int do_cfg_device_type(void) char device_type[32]; int size = sizeof(device_type); - ret = util_string_get(&slm_at_param_list, 2, device_type, &size); + ret = util_string_get(param_list, 2, device_type, &size); if (ret) { return ret; } @@ -433,15 +301,15 @@ static int do_cfg_device_type(void) } /* AT#XCARRIERCFG="hardware_version"[,] */ -static int do_cfg_hardware_version(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_hardware_version, "AT#XCARRIERCFG=\"hardware_version\"", + do_cfg_hardware_version); +static int do_cfg_hardware_version(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_hardware_version_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -449,7 +317,7 @@ static int do_cfg_hardware_version(void) char hardware_version[32]; int size = sizeof(hardware_version); - ret = util_string_get(&slm_at_param_list, 2, hardware_version, &size); + ret = util_string_get(param_list, 2, hardware_version, &size); if (ret) { return ret; } @@ -458,15 +326,14 @@ static int do_cfg_hardware_version(void) } /* AT#XCARRIERCFG="manufacturer"[,] */ -static int do_cfg_manufacturer(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_manufacturer, "AT#XCARRIERCFG=\"manufacturer\"", do_cfg_manufacturer); +static int do_cfg_manufacturer(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_manufacturer_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -474,7 +341,7 @@ static int do_cfg_manufacturer(void) char manufacturer[32]; int size = sizeof(manufacturer); - ret = util_string_get(&slm_at_param_list, 2, manufacturer, &size); + ret = util_string_get(param_list, 2, manufacturer, &size); if (ret) { return ret; } @@ -483,15 +350,14 @@ static int do_cfg_manufacturer(void) } /* AT#XCARRIERCFG="model_number"[,] */ -static int do_cfg_model_number(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_model_number, "AT#XCARRIERCFG=\"model_number\"", do_cfg_model_number); +static int do_cfg_model_number(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_model_number_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -499,7 +365,7 @@ static int do_cfg_model_number(void) char model_number[32]; int size = sizeof(model_number); - ret = util_string_get(&slm_at_param_list, 2, model_number, &size); + ret = util_string_get(param_list, 2, model_number, &size); if (ret) { return ret; } @@ -508,15 +374,15 @@ static int do_cfg_model_number(void) } /* AT#XCARRIERCFG="software_version"[,] */ -static int do_cfg_software_version(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_software_version, "AT#XCARRIERCFG=\"software_version\"", + do_cfg_software_version); +static int do_cfg_software_version(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_software_version_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -524,7 +390,7 @@ static int do_cfg_software_version(void) char software_version[32]; int size = sizeof(software_version); - ret = util_string_get(&slm_at_param_list, 2, software_version, &size); + ret = util_string_get(param_list, 2, software_version, &size); if (ret) { return ret; } @@ -533,21 +399,21 @@ static int do_cfg_software_version(void) } /* AT#XCARRIERCFG="session_idle_timeout"[,] */ -static int do_cfg_session_idle_timeout(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_session_idle_timeout, "AT#XCARRIERCFG=\"session_idle_timeout\"", + do_cfg_session_idle_timeout); +static int do_cfg_session_idle_timeout(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_session_idle_timeout_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret, session_idle_timeout; - ret = at_params_int_get(&slm_at_param_list, 2, &session_idle_timeout); + ret = at_params_int_get(param_list, 2, &session_idle_timeout); if (ret) { return ret; } @@ -562,21 +428,21 @@ static int do_cfg_session_idle_timeout(void) } /* AT#XCARRIERCFG="device_serial_no_type"[,<0|1>] */ -static int do_cfg_device_serial_no_type(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_device_serial_no_type, "AT#XCARRIERCFG=\"device_serial_no_type\"", + do_cfg_device_serial_no_type); +static int do_cfg_device_serial_no_type(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_device_serial_no_type_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret, serial_no_type; - ret = at_params_int_get(&slm_at_param_list, 2, &serial_no_type); + ret = at_params_int_get(param_list, 2, &serial_no_type); if (ret) { return ret; } @@ -597,15 +463,14 @@ static int do_cfg_device_serial_no_type(void) } /* AT#XCARRIERCFG="service_code"[,] */ -static int do_cfg_service_code(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_service_code, "AT#XCARRIERCFG=\"service_code\"", do_cfg_service_code); +static int do_cfg_service_code(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_service_code_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -613,7 +478,7 @@ static int do_cfg_service_code(void) char service_code[5]; int size = sizeof(service_code); - ret = util_string_get(&slm_at_param_list, 2, service_code, &size); + ret = util_string_get(param_list, 2, service_code, &size); if (ret) { return ret; } @@ -622,22 +487,21 @@ static int do_cfg_service_code(void) } /* AT#XCARRIERCFG="pdn_type"[,] */ -static int do_cfg_pdn_type(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_pdn_type, "AT#XCARRIERCFG=\"pdn_type\"", do_cfg_pdn_type); +static int do_cfg_pdn_type(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_pdn_type_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t pdn_type; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &pdn_type); + ret = at_params_unsigned_short_get(param_list, 2, &pdn_type); if (ret) { return ret; } @@ -664,22 +528,21 @@ static int do_cfg_pdn_type(void) } /* AT#XCARRIERCFG="queue_mode"[,<0|1>] */ -static int do_cfg_queue_mode(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_queue_mode, "AT#XCARRIERCFG=\"queue_mode\"", do_cfg_queue_mode); +static int do_cfg_queue_mode(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_queue_mode_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t queue_mode; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &queue_mode); + ret = at_params_unsigned_short_get(param_list, 2, &queue_mode); if (ret) { return ret; } @@ -693,15 +556,14 @@ static int do_cfg_queue_mode(void) } /* AT#XCARRIERCFG="binding"[,] */ -static int do_cfg_binding(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_binding, "AT#XCARRIERCFG=\"binding\"", do_cfg_binding); +static int do_cfg_binding(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %c\r\n", lwm2m_settings_server_binding_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -709,7 +571,7 @@ static int do_cfg_binding(void) int size = sizeof("U"); char binding[size]; - ret = util_string_get(&slm_at_param_list, 2, binding, &size); + ret = util_string_get(param_list, 2, binding, &size); if (ret) { return ret; } @@ -723,23 +585,23 @@ static int do_cfg_binding(void) } /* AT#XCARRIERCFG="server_enable"[,<0|1>] */ -static int do_cfg_server_enable(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_server_enable, "AT#XCARRIERCFG=\"server_enable\"", + do_cfg_server_enable); +static int do_cfg_server_enable(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_enable_custom_server_config_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t enabled; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &enabled); + ret = at_params_unsigned_short_get(param_list, 2, &enabled); if (ret) { return ret; } @@ -753,22 +615,21 @@ static int do_cfg_server_enable(void) } /* AT#XCARRIERCFG="is_bootstrap"[,<0|1>] */ -static int do_cfg_is_bootstrap(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_is_bootstrap, "AT#XCARRIERCFG=\"is_bootstrap\"", do_cfg_is_bootstrap); +static int do_cfg_is_bootstrap(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_is_bootstrap_server_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint16_t is_bootstrap; - ret = at_params_unsigned_short_get(&slm_at_param_list, 2, &is_bootstrap); + ret = at_params_unsigned_short_get(param_list, 2, &is_bootstrap); if (ret) { return ret; } @@ -782,21 +643,20 @@ static int do_cfg_is_bootstrap(void) } /* AT#XCARRIERCFG="lifetime"[,] */ -static int do_cfg_lifetime(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_lifetime, "AT#XCARRIERCFG=\"lifetime\"", do_cfg_lifetime); +static int do_cfg_lifetime(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %d\r\n", lwm2m_settings_server_lifetime_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret, lifetime; - ret = at_params_int_get(&slm_at_param_list, 2, &lifetime); + ret = at_params_int_get(param_list, 2, &lifetime); if (ret) { return ret; } @@ -811,22 +671,21 @@ static int do_cfg_lifetime(void) } /* AT#XCARRIERCFG="sec_tag"[,] */ -static int do_cfg_sec_tag(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_sec_tag, "AT#XCARRIERCFG=\"sec_tag\"", do_cfg_sec_tag); +static int do_cfg_sec_tag(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %u\r\n", lwm2m_settings_server_sec_tag_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } int ret; uint32_t sec_tag; - ret = at_params_unsigned_int_get(&slm_at_param_list, 2, &sec_tag); + ret = at_params_unsigned_int_get(param_list, 2, &sec_tag); if (ret) { return ret; } @@ -835,15 +694,14 @@ static int do_cfg_sec_tag(void) } /* AT#XCARRIERCFG="uri"[,] */ -static int do_cfg_uri(void) +SLM_AT_CMD_CUSTOM(xcarriercfg_uri, "AT#XCARRIERCFG=\"uri\"", do_cfg_uri); +static int do_cfg_uri(enum at_cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { - uint32_t count; - - count = at_params_valid_count_get(&slm_at_param_list); - if (count == 2) { + if (param_count == 2) { rsp_send("\r\n#XCARRIERCFG: %s\r\n", lwm2m_settings_server_uri_get()); return 0; - } else if (count != 3) { + } else if (param_count != 3) { return -EINVAL; } @@ -851,7 +709,7 @@ static int do_cfg_uri(void) char server_uri[255]; int size = sizeof(server_uri); - ret = util_string_get(&slm_at_param_list, 2, server_uri, &size); + ret = util_string_get(param_list, 2, server_uri, &size); if (ret) { return ret; } diff --git a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.h b/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.h deleted file mode 100644 index bca70e7ffc16..000000000000 --- a/applications/serial_lte_modem/src/lwm2m_carrier/slm_at_carrier_cfg.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef SLM_AT_CARRIER_CFG_ -#define SLM_AT_CARRIER_CFG_ - -#include - -/**@file slm_at_carrier_cfg.h - * - * @brief Custom AT command to configure the LwM2M Carrier library. - * @{ - */ -/** - * @brief AT#XCARRIERCFG command handler. - */ -int handle_at_carrier_cfg(enum at_cmd_type cmd_type); - -/** @} */ - -#endif /* SLM_AT_CARRIER_CFG_ */ diff --git a/applications/serial_lte_modem/src/main.c b/applications/serial_lte_modem/src/main.c index bb6e846918f3..206090080892 100644 --- a/applications/serial_lte_modem/src/main.c +++ b/applications/serial_lte_modem/src/main.c @@ -39,7 +39,7 @@ static const struct device *gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0)); static struct gpio_callback gpio_cb; #else BUILD_ASSERT(!IS_ENABLED(CONFIG_SLM_START_SLEEP), - "START_SLEEP requires the POWER_PIN to be defined."); + "CONFIG_SLM_START_SLEEP requires CONFIG_SLM_POWER_PIN to be defined."); #endif static struct k_work_delayable indicate_work; diff --git a/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c b/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c index 7b22aa5bcbda..8e33de4d4966 100644 --- a/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c +++ b/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c @@ -304,8 +304,7 @@ static int broker_init(void) .sa_family = AF_UNSPEC }; - err = util_resolve_host(0, mqtt_broker_url, mqtt_broker_port, ctx.family, - Z_LOG_OBJECT_PTR(slm_mqtt), &sa); + err = util_resolve_host(0, mqtt_broker_url, mqtt_broker_port, ctx.family, &sa); if (err) { return -EAGAIN; } @@ -486,30 +485,30 @@ static int do_mqtt_subscribe(uint16_t op, return err; } -/* Handles AT#XMQTTCFG commands. */ -int handle_at_mqtt_config(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xmqttcfg, "AT#XMQTTCFG", handle_at_mqtt_config); +static int handle_at_mqtt_config(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t keep_alive = CONFIG_MQTT_KEEPALIVE; uint16_t clean_session = CONFIG_MQTT_CLEAN_SESSION; - uint32_t param_count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: size_t clientid_sz = sizeof(mqtt_clientid); - err = util_string_get(&slm_at_param_list, 1, mqtt_clientid, &clientid_sz); + err = util_string_get(param_list, 1, mqtt_clientid, &clientid_sz); if (err) { return err; } if (param_count > 2) { - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &keep_alive); + err = at_params_unsigned_short_get(param_list, 2, &keep_alive); if (err) { return err; } } if (param_count > 3) { - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &clean_session); + err = at_params_unsigned_short_get(param_list, 3, &clean_session); if (err) { return err; } @@ -535,15 +534,16 @@ int handle_at_mqtt_config(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XMQTTCON commands. */ -int handle_at_mqtt_connect(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xmqttcon, "AT#XMQTTCON", handle_at_mqtt_connect); +static int handle_at_mqtt_connect(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -552,33 +552,31 @@ int handle_at_mqtt_connect(enum at_cmd_type cmd_type) size_t password_sz = sizeof(mqtt_password); size_t url_sz = sizeof(mqtt_broker_url); - err = util_string_get(&slm_at_param_list, 2, mqtt_username, &username_sz); + err = util_string_get(param_list, 2, mqtt_username, &username_sz); if (err) { return err; } else { ctx.username.utf8 = mqtt_username; ctx.username.size = strlen(mqtt_username); } - err = util_string_get(&slm_at_param_list, 3, mqtt_password, &password_sz); + err = util_string_get(param_list, 3, mqtt_password, &password_sz); if (err) { return err; } else { ctx.password.utf8 = mqtt_password; ctx.password.size = strlen(mqtt_password); } - err = util_string_get(&slm_at_param_list, 4, mqtt_broker_url, &url_sz); + err = util_string_get(param_list, 4, mqtt_broker_url, &url_sz); if (err) { return err; } - err = at_params_unsigned_short_get( - &slm_at_param_list, 5, &mqtt_broker_port); + err = at_params_unsigned_short_get(param_list, 5, &mqtt_broker_port); if (err) { return err; } ctx.sec_tag = INVALID_SEC_TAG; - if (at_params_valid_count_get(&slm_at_param_list) > 6) { - err = at_params_unsigned_int_get( - &slm_at_param_list, 6, &ctx.sec_tag); + if (param_count > 6) { + err = at_params_unsigned_int_get(param_list, 6, &ctx.sec_tag); if (err) { return err; } @@ -642,8 +640,9 @@ static int mqtt_datamode_callback(uint8_t op, const uint8_t *data, int len, uint return ret; } -/* Handles AT#XMQTTPUB commands. */ -int handle_at_mqtt_publish(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xmqttpub, "AT#XMQTTPUB", handle_at_mqtt_publish); +static int handle_at_mqtt_publish(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; @@ -652,7 +651,6 @@ int handle_at_mqtt_publish(enum at_cmd_type cmd_type) size_t topic_sz = MQTT_MAX_TOPIC_LEN; uint8_t pub_msg[SLM_MAX_PAYLOAD_SIZE]; size_t msg_sz = sizeof(pub_msg); - uint16_t param_count = at_params_valid_count_get(&slm_at_param_list); if (!ctx.connected) { return -ENOTCONN; @@ -660,25 +658,25 @@ int handle_at_mqtt_publish(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = util_string_get(&slm_at_param_list, 1, pub_topic, &topic_sz); + err = util_string_get(param_list, 1, pub_topic, &topic_sz); if (err) { return err; } pub_msg[0] = '\0'; if (param_count > 2) { - err = util_string_get(&slm_at_param_list, 2, pub_msg, &msg_sz); + err = util_string_get(param_list, 2, pub_msg, &msg_sz); if (err) { return err; } } if (param_count > 3) { - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &qos); + err = at_params_unsigned_short_get(param_list, 3, &qos); if (err) { return err; } } if (param_count > 4) { - err = at_params_unsigned_short_get(&slm_at_param_list, 4, &retain); + err = at_params_unsigned_short_get(param_list, 4, &retain); if (err) { return err; } @@ -722,8 +720,9 @@ int handle_at_mqtt_publish(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XMQTTSUB commands. */ -int handle_at_mqtt_subscribe(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xmqttsub, "AT#XMQTTSUB", handle_at_mqtt_subscribe); +static int handle_at_mqtt_subscribe(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err = -EINVAL; uint16_t qos; @@ -736,12 +735,12 @@ int handle_at_mqtt_subscribe(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_valid_count_get(&slm_at_param_list) == 3) { - err = util_string_get(&slm_at_param_list, 1, topic, &topic_sz); + if (param_count == 3) { + err = util_string_get(param_list, 1, topic, &topic_sz); if (err < 0) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &qos); + err = at_params_unsigned_short_get(param_list, 2, &qos); if (err < 0) { return err; } @@ -763,8 +762,9 @@ int handle_at_mqtt_subscribe(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XMQTTUNSUB commands. */ -int handle_at_mqtt_unsubscribe(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xmqttunsub, "AT#XMQTTUNSUB", handle_at_mqtt_unsubscribe); +static int handle_at_mqtt_unsubscribe(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err = -EINVAL; char topic[MQTT_MAX_TOPIC_LEN]; @@ -776,9 +776,8 @@ int handle_at_mqtt_unsubscribe(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_valid_count_get(&slm_at_param_list) == 2) { - err = util_string_get(&slm_at_param_list, 1, - topic, &topic_sz); + if (param_count == 2) { + err = util_string_get(param_list, 1, topic, &topic_sz); if (err < 0) { return err; } diff --git a/applications/serial_lte_modem/src/nativetls/slm_at_cmng.c b/applications/serial_lte_modem/src/nativetls/slm_at_cmng.c index b1720054feb1..a5ab39c1db0b 100644 --- a/applications/serial_lte_modem/src/nativetls/slm_at_cmng.c +++ b/applications/serial_lte_modem/src/nativetls/slm_at_cmng.c @@ -18,33 +18,32 @@ enum slm_cmng_opcode { AT_CMNG_OP_DELETE = 3 }; -/* Handles AT#XCMNG command. */ -int handle_at_xcmng(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xcmng, "AT#XCMNG", handle_at_xcmng); +static int handle_at_xcmng(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op, type; nrf_sec_tag_t sec_tag; - const int param_count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_unsigned_short_get(&slm_at_param_list, 1, &op)) { + if (at_params_unsigned_short_get(param_list, 1, &op)) { return -EINVAL; } if (param_count > 2 && - at_params_unsigned_int_get(&slm_at_param_list, 2, &sec_tag)) { + at_params_unsigned_int_get(param_list, 2, &sec_tag)) { return -EINVAL; } - if ((param_count > 3 && - at_params_unsigned_short_get(&slm_at_param_list, 3, &type)) || - type > SLM_AT_CMNG_TYPE_PSK_ID) { + if (param_count > 3 && (at_params_unsigned_short_get(param_list, 3, &type) || + type > SLM_AT_CMNG_TYPE_PSK_ID)) { return -EINVAL; } if (op == AT_CMNG_OP_WRITE) { const char *at_param; size_t len; - if (at_params_string_ptr_get(&slm_at_param_list, 4, &at_param, &len)) { + if (at_params_string_ptr_get(param_list, 4, &at_param, &len)) { return -EINVAL; } err = slm_native_tls_store_credential(sec_tag, type, at_param, len); diff --git a/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.c b/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.c index 757704c0f9a4..89a78fe3eed4 100644 --- a/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.c +++ b/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.c @@ -19,9 +19,6 @@ LOG_MODULE_REGISTER(slm_nrfcloud, CONFIG_SLM_LOG_LEVEL); -#define SERVICE_INFO_GNSS \ - "{\"state\":{\"reported\":{\"device\": {\"serviceInfo\":{\"ui\":[\"GNSS\"]}}}}}" - #define MODEM_AT_RSP \ "{\"appId\":\"MODEM\", \"messageType\":\"RSP\", \"data\":\"%s\"}" @@ -104,10 +101,10 @@ static void ncell_meas_mon(const char *notify) char mcc[4] = {0}; char tac[9] = {0}; unsigned int ncells_count = 0; + struct at_param_list *list = NULL; nrfcloud_ncellmeas_done = false; - at_params_list_clear(&slm_at_param_list); - err = at_parser_params_from_str(notify, NULL, &slm_at_param_list); + err = slm_get_at_param_list(notify, &list); if (err == -E2BIG) { LOG_WRN("%%NCELLMEAS result notification truncated" " because its parameter count exceeds CONFIG_SLM_AT_MAX_PARAM."); @@ -116,7 +113,7 @@ static void ncell_meas_mon(const char *notify) } /* parse status, 0: success 1: fail */ - err = at_params_int_get(&slm_at_param_list, 1, &ncellmeas_status); + err = at_params_int_get(list, 1, &ncellmeas_status); if (err) { goto exit; } @@ -125,7 +122,7 @@ static void ncell_meas_mon(const char *notify) err = -EAGAIN; goto exit; } - param_count = at_params_valid_count_get(&slm_at_param_list); + param_count = at_params_valid_count_get(list); if (param_count < MAX_PARAM_CELL) { /* at least current cell */ LOG_ERR("Missing param in NCELLMEAS notification"); err = -EAGAIN; @@ -134,7 +131,7 @@ static void ncell_meas_mon(const char *notify) /* parse Cell ID */ size = sizeof(cid); - err = util_string_get(&slm_at_param_list, 2, cid, &size); + err = util_string_get(list, 2, cid, &size); if (err) { goto exit; } @@ -145,7 +142,7 @@ static void ncell_meas_mon(const char *notify) /* parse PLMN */ size = sizeof(plmn); - err = util_string_get(&slm_at_param_list, 3, plmn, &size); + err = util_string_get(list, 3, plmn, &size); if (err) { goto exit; } @@ -161,7 +158,7 @@ static void ncell_meas_mon(const char *notify) /* parse TAC */ size = sizeof(tac); - err = util_string_get(&slm_at_param_list, 4, tac, &size); + err = util_string_get(list, 4, tac, &size); if (err) { goto exit; } @@ -174,25 +171,24 @@ static void ncell_meas_mon(const char *notify) nrfcloud_cell_data.current_cell.timing_advance = NRF_CLOUD_LOCATION_CELL_OMIT_TIME_ADV; /* parse EARFCN */ - err = at_params_unsigned_int_get(&slm_at_param_list, 6, - &nrfcloud_cell_data.current_cell.earfcn); + err = at_params_unsigned_int_get(list, 6, &nrfcloud_cell_data.current_cell.earfcn); if (err) { goto exit; } /* parse PCI */ - err = at_params_unsigned_short_get(&slm_at_param_list, 7, - &nrfcloud_cell_data.current_cell.phys_cell_id); + err = at_params_unsigned_short_get(list, 7, + &nrfcloud_cell_data.current_cell.phys_cell_id); if (err) { goto exit; } /* parse RSRP and RSRQ */ - err = at_params_short_get(&slm_at_param_list, 8, &nrfcloud_cell_data.current_cell.rsrp); + err = at_params_short_get(list, 8, &nrfcloud_cell_data.current_cell.rsrp); if (err < 0) { goto exit; } - err = at_params_short_get(&slm_at_param_list, 9, &nrfcloud_cell_data.current_cell.rsrq); + err = at_params_short_get(list, 9, &nrfcloud_cell_data.current_cell.rsrq); if (err < 0) { goto exit; } @@ -204,27 +200,26 @@ static void ncell_meas_mon(const char *notify) const unsigned int offset = MAX_PARAM_CELL + i * MAX_PARAM_NCELL; /* parse n_earfcn */ - err = at_params_unsigned_int_get(&slm_at_param_list, offset, - &nrfcloud_ncells[i].earfcn); + err = at_params_unsigned_int_get(list, offset, &nrfcloud_ncells[i].earfcn); if (err < 0) { goto exit; } /* parse n_phys_cell_id */ - err = at_params_unsigned_short_get(&slm_at_param_list, offset + 1, + err = at_params_unsigned_short_get(list, offset + 1, &nrfcloud_ncells[i].phys_cell_id); if (err < 0) { goto exit; } /* parse n_rsrp */ - err = at_params_short_get(&slm_at_param_list, offset + 2, &nrfcloud_ncells[i].rsrp); + err = at_params_short_get(list, offset + 2, &nrfcloud_ncells[i].rsrp); if (err < 0) { goto exit; } /* parse n_rsrq */ - err = at_params_short_get(&slm_at_param_list, offset + 3, &nrfcloud_ncells[i].rsrq); + err = at_params_short_get(list, offset + 3, &nrfcloud_ncells[i].rsrq); if (err < 0) { goto exit; } @@ -300,23 +295,6 @@ static int do_cloud_send_msg(const char *message, int len) static void on_cloud_evt_ready(void) { - int err; - - if (slm_nrf_cloud_send_location) { - struct nrf_cloud_tx_data msg = { - .data.ptr = SERVICE_INFO_GNSS, - .data.len = strlen(SERVICE_INFO_GNSS), - .topic_type = NRF_CLOUD_TOPIC_STATE, - .qos = MQTT_QOS_0_AT_MOST_ONCE - }; - - /* Update nRF Cloud with GPS service info signifying GPS capabilities. */ - err = nrf_cloud_send(&msg); - if (err) { - LOG_WRN("Failed to send message to cloud, error: %d", err); - } - } - slm_nrf_cloud_ready = true; rsp_send("\r\n#XNRFCLOUD: %d,%d\r\n", slm_nrf_cloud_ready, slm_nrf_cloud_send_location); #if defined(CONFIG_NRF_CLOUD_LOCATION) @@ -570,8 +548,10 @@ static int nrf_cloud_datamode_callback(uint8_t op, const uint8_t *data, int len, return ret; } -/* Handles the AT#XNRFCLOUD commands. */ -int handle_at_nrf_cloud(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xnrfcloud_set, "AT#XNRFCLOUD=", handle_at_nrf_cloud); +SLM_AT_CMD_CUSTOM(xnrfcloud_read, "AT#XNRFCLOUD?", handle_at_nrf_cloud); +static int handle_at_nrf_cloud(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { enum slm_nrfcloud_operation { SLM_NRF_CLOUD_DISCONNECT, @@ -584,14 +564,13 @@ int handle_at_nrf_cloud(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err < 0) { return err; } if (op == SLM_NRF_CLOUD_CONNECT && !slm_nrf_cloud_ready) { - if (at_params_valid_count_get(&slm_at_param_list) > 2) { - err = at_params_unsigned_short_get(&slm_at_param_list, 2, - &send_location); + if (param_count > 2) { + err = at_params_unsigned_short_get(param_list, 2, &send_location); if (send_location != 0 && send_location != 1) { err = -EINVAL; } @@ -648,11 +627,11 @@ int handle_at_nrf_cloud(enum at_cmd_type cmd_type) #if defined(CONFIG_NRF_CLOUD_LOCATION) -/* Handles the AT#XNRFCLOUDPOS command. */ -int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xnrfcloudpos, "AT#XNRFCLOUDPOS", handle_at_nrf_cloud_pos); +static int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err; - const uint32_t param_count = at_params_valid_count_get(&slm_at_param_list); uint16_t cell_pos, wifi_pos; if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { @@ -674,12 +653,12 @@ int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type) return -EINVAL; } - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &cell_pos); + err = at_params_unsigned_short_get(param_list, 1, &cell_pos); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &wifi_pos); + err = at_params_unsigned_short_get(param_list, 2, &wifi_pos); if (err) { return err; } @@ -725,7 +704,7 @@ int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type) /* Parse the MAC address. */ len = sizeof(mac_addr_str); err = at_params_string_get( - &slm_at_param_list, param_idx, mac_addr_str, &len); + param_list, param_idx, mac_addr_str, &len); if (!err && (len != sizeof(mac_addr_str) || sscanf(mac_addr_str, WIFI_MAC_ADDR_TEMPLATE, &mac_addr[0], &mac_addr[1], &mac_addr[2], @@ -744,7 +723,7 @@ int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type) ap->mac_length = WIFI_MAC_ADDR_LEN; /* Parse the RSSI, if present. */ - if (!at_params_int_get(&slm_at_param_list, param_idx + 1, &rssi)) { + if (!at_params_int_get(param_list, param_idx + 1, &rssi)) { ++param_idx; const int rssi_min = -128; const int rssi_max = 0; diff --git a/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.h b/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.h index 78bbf78f942d..51eb08ceda1b 100644 --- a/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.h +++ b/applications/serial_lte_modem/src/nrfcloud/slm_at_nrfcloud.h @@ -23,16 +23,6 @@ extern bool slm_nrf_cloud_ready; /* Whether to send the device's location to nRF Cloud. */ extern bool slm_nrf_cloud_send_location; -/* Handles the AT#XNRFCLOUD commands. */ -int handle_at_nrf_cloud(enum at_cmd_type cmd_type); - -#if defined(CONFIG_NRF_CLOUD_LOCATION) - -/* Handles the AT#XNRFCLOUDPOS command. */ -int handle_at_nrf_cloud_pos(enum at_cmd_type cmd_type); - -#endif /* CONFIG_NRF_CLOUD_LOCATION */ - /** * @brief Initialize nRF Cloud AT command parser. * diff --git a/applications/serial_lte_modem/src/slm_at_commands.c b/applications/serial_lte_modem/src/slm_at_commands.c index e2083ce49372..cb8de61f1e5e 100644 --- a/applications/serial_lte_modem/src/slm_at_commands.c +++ b/applications/serial_lte_modem/src/slm_at_commands.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -57,9 +59,6 @@ #if defined(CONFIG_SLM_CARRIER) #include "slm_at_carrier.h" #endif -#if defined(CONFIG_LWM2M_CARRIER_SETTINGS) -#include "slm_at_carrier_cfg.h" -#endif #if defined(CONFIG_SLM_PPP) #include "slm_ppp.h" #endif @@ -106,12 +105,12 @@ int slm_power_off_modem(void) return slm_util_at_printf("AT+CFUN=0"); } -/* Handles AT#XSLMVER command. */ -static int handle_at_slmver(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xslmver, "AT#XSLMVER", handle_at_slmver); +static int handle_at_slmver(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { int ret = -EINVAL; - if (type == AT_CMD_TYPE_SET_COMMAND) { + if (cmd_type == AT_CMD_TYPE_SET_COMMAND) { char *libmodem = nrf_modem_build_version(); if (strlen(CONFIG_SLM_CUSTOMER_VERSION) > 0) { @@ -143,13 +142,14 @@ static void go_sleep_wk(struct k_work *) } } -/* Handles AT#XSLEEP commands. */ -static int handle_at_sleep(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xsleep, "AT#XSLEEP", handle_at_sleep); +static int handle_at_sleep(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret = -EINVAL; - if (type == AT_CMD_TYPE_SET_COMMAND) { - ret = at_params_unsigned_int_get(&slm_at_param_list, 1, &sleep.mode); + if (cmd_type == AT_CMD_TYPE_SET_COMMAND) { + ret = at_params_unsigned_int_get(param_list, 1, &sleep.mode); if (ret) { return -EINVAL; } @@ -158,7 +158,7 @@ static int handle_at_sleep(enum at_cmd_type type) } else { ret = -EINVAL; } - } else if (type == AT_CMD_TYPE_TEST_COMMAND) { + } else if (cmd_type == AT_CMD_TYPE_TEST_COMMAND) { rsp_send("\r\n#XSLEEP: (%d,%d)\r\n", SLEEP_MODE_DEEP, SLEEP_MODE_IDLE); ret = 0; } @@ -185,12 +185,13 @@ static void slm_shutdown(void) slm_enter_shutdown(); } -/* Handles AT#XSHUTDOWN command. */ -static int handle_at_shutdown(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xshutdown, "AT#XSHUTDOWN", handle_at_shutdown); +static int handle_at_shutdown(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { - if (type != AT_CMD_TYPE_SET_COMMAND) { + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { return -EINVAL; } + final_call(slm_shutdown); return 0; } @@ -203,20 +204,21 @@ FUNC_NORETURN void slm_reset(void) sys_reboot(SYS_REBOOT_COLD); } -/* Handles AT#XRESET command. */ -static int handle_at_reset(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xreset, "AT#XRESET", handle_at_reset); +static int handle_at_reset(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { - if (type != AT_CMD_TYPE_SET_COMMAND) { + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { return -EINVAL; } + final_call(slm_reset); return 0; } -/* Handles AT#XMODEMRESET command. */ -static int handle_at_modemreset(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xmodemreset, "AT#XMODEMRESET", handle_at_modemreset); +static int handle_at_modemreset(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { - if (type != AT_CMD_TYPE_SET_COMMAND) { + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { return -EINVAL; } @@ -255,12 +257,12 @@ static int handle_at_modemreset(enum at_cmd_type type) return 0; } -/* Handles AT#XUUID command. */ -static int handle_at_uuid(enum at_cmd_type type) +SLM_AT_CMD_CUSTOM(xuuid, "AT#XUUID", handle_at_uuid); +static int handle_at_uuid(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { int ret; - if (type != AT_CMD_TYPE_SET_COMMAND) { + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { return -EINVAL; } @@ -276,15 +278,16 @@ static int handle_at_uuid(enum at_cmd_type type) return ret; } -/* Handles AT#XDATACTRL commands. */ -static int handle_at_datactrl(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xdatactrl, "AT#XDATACTRL", handle_at_datactrl); +static int handle_at_datactrl(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int ret = 0; uint16_t time_limit, time_limit_min; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - ret = at_params_unsigned_short_get(&slm_at_param_list, 1, &time_limit); + ret = at_params_unsigned_short_get(param_list, 1, &time_limit); if (ret) { return ret; } @@ -311,256 +314,53 @@ static int handle_at_datactrl(enum at_cmd_type cmd_type) return ret; } -int handle_at_clac(enum at_cmd_type cmd_type); - -/* TCP proxy commands */ -int handle_at_tcp_server(enum at_cmd_type cmd_type); -int handle_at_tcp_client(enum at_cmd_type cmd_type); -int handle_at_tcp_send(enum at_cmd_type cmd_type); -int handle_at_tcp_hangup(enum at_cmd_type cmd_type); - -/* UDP proxy commands */ -int handle_at_udp_server(enum at_cmd_type cmd_type); -int handle_at_udp_client(enum at_cmd_type cmd_type); -int handle_at_udp_send(enum at_cmd_type cmd_type); - -/* Socket-type TCPIP commands */ -int handle_at_socket(enum at_cmd_type cmd_type); -int handle_at_secure_socket(enum at_cmd_type cmd_type); -int handle_at_socket_select(enum at_cmd_type cmd_type); -int handle_at_socketopt(enum at_cmd_type cmd_type); -int handle_at_secure_socketopt(enum at_cmd_type cmd_type); -int handle_at_bind(enum at_cmd_type cmd_type); -int handle_at_connect(enum at_cmd_type cmd_type); -int handle_at_listen(enum at_cmd_type cmd_type); -int handle_at_accept(enum at_cmd_type cmd_type); -int handle_at_send(enum at_cmd_type cmd_type); -int handle_at_recv(enum at_cmd_type cmd_type); -int handle_at_sendto(enum at_cmd_type cmd_type); -int handle_at_recvfrom(enum at_cmd_type cmd_type); -int handle_at_poll(enum at_cmd_type cmd_type); -int handle_at_getaddrinfo(enum at_cmd_type cmd_type); - -#if defined(CONFIG_SLM_NATIVE_TLS) -int handle_at_xcmng(enum at_cmd_type cmd_type); -#endif - -/* ICMP commands */ -int handle_at_icmp_ping(enum at_cmd_type cmd_type); - -#if defined(CONFIG_SLM_SMS) -/* SMS commands */ -int handle_at_sms(enum at_cmd_type cmd_type); -#endif - -/* FOTA commands */ -int handle_at_fota(enum at_cmd_type cmd_type); - -#if defined(CONFIG_SLM_GNSS) -int handle_at_gps(enum at_cmd_type cmd_type); -int handle_at_gps_delete(enum at_cmd_type cmd_type); -#endif - -#if defined(CONFIG_SLM_FTPC) -int handle_at_ftp(enum at_cmd_type cmd_type); -#endif -#if defined(CONFIG_SLM_TFTPC) -int handle_at_tftp(enum at_cmd_type cmd_type); -#endif - -#if defined(CONFIG_SLM_MQTTC) -int handle_at_mqtt_config(enum at_cmd_type cmd_type); -int handle_at_mqtt_connect(enum at_cmd_type cmd_type); -int handle_at_mqtt_publish(enum at_cmd_type cmd_type); -int handle_at_mqtt_subscribe(enum at_cmd_type cmd_type); -int handle_at_mqtt_unsubscribe(enum at_cmd_type cmd_type); -#endif - -#if defined(CONFIG_SLM_HTTPC) -int handle_at_httpc_connect(enum at_cmd_type cmd_type); -int handle_at_httpc_request(enum at_cmd_type cmd_type); -#endif - -#if defined(CONFIG_SLM_TWI) -int handle_at_twi_list(enum at_cmd_type cmd_type); -int handle_at_twi_write(enum at_cmd_type cmd_type); -int handle_at_twi_read(enum at_cmd_type cmd_type); -int handle_at_twi_write_read(enum at_cmd_type cmd_type); -#endif - -#if defined(CONFIG_SLM_GPIO) -int handle_at_gpio_configure(enum at_cmd_type cmd_type); -int handle_at_gpio_operate(enum at_cmd_type cmd_type); -#endif - -static struct slm_at_cmd { - const char *string; - slm_at_handler_t handler; -} slm_at_cmd_list[] = { - /* Generic commands */ - {"AT#XSLMVER", handle_at_slmver}, -#if POWER_PIN_IS_ENABLED - {"AT#XSLEEP", handle_at_sleep}, -#endif - {"AT#XSHUTDOWN", handle_at_shutdown}, - {"AT#XRESET", handle_at_reset}, - {"AT#XMODEMRESET", handle_at_modemreset}, - {"AT#XUUID", handle_at_uuid}, - {"AT#XCLAC", handle_at_clac}, - {"AT#XDATACTRL", handle_at_datactrl}, - - /* TCP proxy commands */ - {"AT#XTCPSVR", handle_at_tcp_server}, - {"AT#XTCPCLI", handle_at_tcp_client}, - {"AT#XTCPSEND", handle_at_tcp_send}, - {"AT#XTCPHANGUP", handle_at_tcp_hangup}, - - /* UDP proxy commands */ - {"AT#XUDPSVR", handle_at_udp_server}, - {"AT#XUDPCLI", handle_at_udp_client}, - {"AT#XUDPSEND", handle_at_udp_send}, - - /* Socket-type TCPIP commands */ - {"AT#XSOCKET", handle_at_socket}, - {"AT#XSSOCKET", handle_at_secure_socket}, - {"AT#XSOCKETSELECT", handle_at_socket_select}, - {"AT#XSOCKETOPT", handle_at_socketopt}, - {"AT#XSSOCKETOPT", handle_at_secure_socketopt}, - {"AT#XBIND", handle_at_bind}, - {"AT#XCONNECT", handle_at_connect}, - {"AT#XLISTEN", handle_at_listen}, - {"AT#XACCEPT", handle_at_accept}, - {"AT#XSEND", handle_at_send}, - {"AT#XRECV", handle_at_recv}, - {"AT#XSENDTO", handle_at_sendto}, - {"AT#XRECVFROM", handle_at_recvfrom}, - {"AT#XPOLL", handle_at_poll}, - {"AT#XGETADDRINFO", handle_at_getaddrinfo}, - -#if defined(CONFIG_SLM_NATIVE_TLS) - {"AT#XCMNG", handle_at_xcmng}, -#endif - /* ICMP commands */ - {"AT#XPING", handle_at_icmp_ping}, - -#if defined(CONFIG_SLM_SMS) - /* SMS commands */ - {"AT#XSMS", handle_at_sms}, -#endif - - /* FOTA commands */ - {"AT#XFOTA", handle_at_fota}, - -#if defined(CONFIG_SLM_NRF_CLOUD) - {"AT#XNRFCLOUD", handle_at_nrf_cloud}, -#if defined(CONFIG_NRF_CLOUD_LOCATION) - {"AT#XNRFCLOUDPOS", handle_at_nrf_cloud_pos}, -#endif -#endif - -#if defined(CONFIG_SLM_GNSS) - /* GNSS commands */ - {"AT#XGPS", handle_at_gps}, - {"AT#XGPSDEL", handle_at_gps_delete}, -#endif - -#if defined(CONFIG_SLM_FTPC) - /* FTP commands */ - {"AT#XFTP", handle_at_ftp}, -#endif -#if defined(CONFIG_SLM_TFTPC) - /* TFTP commands */ - {"AT#XTFTP", handle_at_tftp}, -#endif - -#if defined(CONFIG_SLM_MQTTC) - {"AT#XMQTTCFG", handle_at_mqtt_config}, - {"AT#XMQTTCON", handle_at_mqtt_connect}, - {"AT#XMQTTPUB", handle_at_mqtt_publish}, - {"AT#XMQTTSUB", handle_at_mqtt_subscribe}, - {"AT#XMQTTUNSUB", handle_at_mqtt_unsubscribe}, -#endif - -#if defined(CONFIG_SLM_HTTPC) - {"AT#XHTTPCCON", handle_at_httpc_connect}, - {"AT#XHTTPCREQ", handle_at_httpc_request}, -#endif - -#if defined(CONFIG_SLM_TWI) - {"AT#XTWILS", handle_at_twi_list}, - {"AT#XTWIW", handle_at_twi_write}, - {"AT#XTWIR", handle_at_twi_read}, - {"AT#XTWIWR", handle_at_twi_write_read}, -#endif - -#if defined(CONFIG_SLM_GPIO) - {"AT#XGPIOCFG", handle_at_gpio_configure}, - {"AT#XGPIO", handle_at_gpio_operate}, -#endif - -#if defined(CONFIG_SLM_CARRIER) - {"AT#XCARRIER", handle_at_carrier}, -#endif - -#if defined(CONFIG_LWM2M_CARRIER_SETTINGS) - {"AT#XCARRIERCFG", handle_at_carrier_cfg}, -#endif - -#if defined(CONFIG_SLM_PPP) - {"AT#XPPP", handle_at_ppp}, -#endif - -#if defined(CONFIG_SLM_CMUX) - {"AT#XCMUX", handle_at_cmux}, -#endif -}; - -/* Handles AT#XCLAC command. */ -int handle_at_clac(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xclac, "AT#XCLAC", handle_at_clac); +static int handle_at_clac(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { - int ret = -EINVAL; - - if (cmd_type == AT_CMD_TYPE_SET_COMMAND) { - int total = ARRAY_SIZE(slm_at_cmd_list); - - for (int i = 0; i < total; i++) { - rsp_send("%s\r\n", slm_at_cmd_list[i].string); - } - ret = 0; + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { + return -EINVAL; } - return ret; -} - -int slm_at_parse(const char *cmd_str, size_t cmd_name_len) -{ - int ret = UNKNOWN_AT_COMMAND_RET; - int total = ARRAY_SIZE(slm_at_cmd_list); - - for (int i = 0; i < total; i++) { - const struct slm_at_cmd *const at_cmd = &slm_at_cmd_list[i]; + /* Use AT_CMD_CUSTOM listing for extracting SLM AT commands. */ + extern struct nrf_modem_at_cmd_custom _nrf_modem_at_cmd_custom_list_start[]; + extern struct nrf_modem_at_cmd_custom _nrf_modem_at_cmd_custom_list_end[]; + size_t cmd_custom_count = _nrf_modem_at_cmd_custom_list_end - + _nrf_modem_at_cmd_custom_list_start; + size_t base_cmd_len[cmd_custom_count]; - /* For the match to happen the AT command names must be identical, - * which requires both names to have the same characters and the same length. - */ - if (!(!strncmp(cmd_str, at_cmd->string, cmd_name_len) - && at_cmd->string[cmd_name_len] == '\0')) { + memset(base_cmd_len, 0, cmd_custom_count * sizeof(size_t)); + rsp_send("\r\n"); + for (size_t i = 0; i < cmd_custom_count; i++) { + /* SLM at commands start with AT#X. */ + if (strncasecmp(_nrf_modem_at_cmd_custom_list_start[i].cmd, "AT#X", + strlen("AT#X"))) { continue; } + /* List commands without operations and list each command only once. */ + base_cmd_len[i] = strcspn(_nrf_modem_at_cmd_custom_list_start[i].cmd, "?="); + bool duplicate = false; + + for (size_t j = 0; j < i; j++) { + /* Compare length and command as we have AT commands such as + * AT#XSEND/AT#XSENDTO, AT#XFTP="whatever" + * and AT#XNRFCLOUD[=?]/AT#XNRFCLOUDPOS. + */ + if ((base_cmd_len[i] == base_cmd_len[j]) && + !strncasecmp(_nrf_modem_at_cmd_custom_list_start[i].cmd, + _nrf_modem_at_cmd_custom_list_start[j].cmd, + base_cmd_len[i])) { + duplicate = true; + break; + } + } - const enum at_cmd_type type = at_parser_cmd_type_get(cmd_str); - - at_params_list_clear(&slm_at_param_list); - ret = at_parser_params_from_str(cmd_str, NULL, &slm_at_param_list); - if (ret) { - LOG_ERR("Failed to parse AT command %d", ret); - return -EINVAL; + if (!duplicate) { + rsp_send("%.*s\r\n", base_cmd_len[i], + _nrf_modem_at_cmd_custom_list_start[i].cmd); } - ret = at_cmd->handler(type); - break; } - return ret; + return 0; } int slm_at_init(void) @@ -744,12 +544,6 @@ void slm_at_uninit(void) LOG_ERR("GPIO could not be uninit: %d", err); } #endif -#if defined(CONFIG_SLM_NRF52_DFU) - err = slm_at_dfu_uninit(); - if (err) { - LOG_ERR("DFU could not be uninitialized: %d", err); - } -#endif #if defined(CONFIG_SLM_CARRIER) err = slm_at_carrier_uninit(); if (err) { diff --git a/applications/serial_lte_modem/src/slm_at_fota.c b/applications/serial_lte_modem/src/slm_at_fota.c index ef183c61cc86..1df8a9a2939e 100644 --- a/applications/serial_lte_modem/src/slm_at_fota.c +++ b/applications/serial_lte_modem/src/slm_at_fota.c @@ -292,8 +292,9 @@ static void fota_dl_handler(const struct fota_download_evt *evt) } } -/* Handles AT#XFOTA commands. */ -int handle_at_fota(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xfota, "AT#XFOTA", handle_at_fota); +static int handle_at_fota(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; @@ -303,7 +304,7 @@ int handle_at_fota(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err < 0) { return err; } @@ -322,12 +323,12 @@ int handle_at_fota(enum at_cmd_type cmd_type) sec_tag_t sec_tag = INVALID_SEC_TAG; enum dfu_target_image_type type; - err = util_string_get(&slm_at_param_list, 2, uri, &size); + err = util_string_get(param_list, 2, uri, &size); if (err) { return err; } - if (at_params_valid_count_get(&slm_at_param_list) > 3) { - at_params_unsigned_int_get(&slm_at_param_list, 3, &sec_tag); + if (param_count > 3) { + at_params_unsigned_int_get(param_list, 3, &sec_tag); } if (op == SLM_FOTA_START_APP) { type = DFU_TARGET_IMAGE_TYPE_MCUBOOT; @@ -356,8 +357,8 @@ int handle_at_fota(enum at_cmd_type cmd_type) else { type = DFU_TARGET_IMAGE_TYPE_MODEM_DELTA; } - if (at_params_valid_count_get(&slm_at_param_list) > 4) { - at_params_unsigned_short_get(&slm_at_param_list, 4, &pdn_id); + if (param_count > 4) { + at_params_unsigned_short_get(param_list, 4, &pdn_id); err = do_fota_start(op, uri, sec_tag, pdn_id, type); } else { err = do_fota_start(op, uri, sec_tag, 0, type); diff --git a/applications/serial_lte_modem/src/slm_at_host.c b/applications/serial_lte_modem/src/slm_at_host.c index 00a035f03dfd..13ee950070ab 100644 --- a/applications/serial_lte_modem/src/slm_at_host.c +++ b/applications/serial_lte_modem/src/slm_at_host.c @@ -44,7 +44,7 @@ static int datamode_handler_result; uint16_t slm_datamode_time_limit; /* Send trigger by time in data mode */ K_MUTEX_DEFINE(mutex_mode); /* Protects the operation mode variables. */ -struct at_param_list slm_at_param_list; +static struct at_param_list at_host_param_list; uint8_t slm_at_buf[SLM_AT_MAX_CMD_LEN + 1]; uint8_t slm_data_buf[SLM_MAX_MESSAGE_SIZE]; @@ -429,19 +429,6 @@ static void format_final_result(char *buf, size_t buf_len, size_t buf_max_len) } } } - -static size_t cmd_name_toupper(char *cmd, size_t cmd_len) -{ - size_t i; - - /* Set/test command names are delimited by '=', read by '?'. */ - for (i = 0; i != cmd_len && cmd[i] != '=' && cmd[i] != '?'; ++i) { - - cmd[i] = toupper(cmd[i]); - } - return i; -} - static void restore_at_backend(void) { const int err = at_backend.start(); @@ -551,23 +538,11 @@ static void cmd_send(uint8_t *buf, size_t cmd_length, size_t buf_size) return; } - const size_t cmd_name_len = cmd_name_toupper(at_cmd, cmd_length); - - err = slm_at_parse(at_cmd, cmd_name_len); - if (err == SILENT_AT_COMMAND_RET) { - return; - } else if (err == 0) { - rsp_send_ok(); - return; - } else if (err != UNKNOWN_AT_COMMAND_RET) { - LOG_ERR("AT command error: %d (%s)", err, strerror(-err)); - rsp_send_error(); - return; - } - /* Send to modem, reserve space for CRLF in response buffer */ err = nrf_modem_at_cmd(buf + strlen(CRLF_STR), buf_size - strlen(CRLF_STR), "%s", at_cmd); - if (err < 0) { + if (err == -SILENT_AT_COMMAND_RET) { + return; + } else if (err < 0) { LOG_ERR("AT command failed: %d", err); rsp_send_error(); return; @@ -872,12 +847,48 @@ bool verify_datamode_control(uint16_t time_limit, uint16_t *min_time_limit) return true; } +int slm_get_at_param_list(const char *at_cmd, struct at_param_list **list) +{ + int err; + + *list = &at_host_param_list; + + err = at_parser_params_from_str(at_cmd, NULL, *list); + if (err) { + LOG_ERR("AT command parsing failed: %d", err); + } + + return err; +} + +int slm_at_cb_wrapper(char *buf, size_t len, char *at_cmd, slm_at_callback *cb) +{ + int err; + struct at_param_list *list = NULL; + + assert(cb); + + err = slm_get_at_param_list(at_cmd, &list); + if (err) { + return err; + } + err = cb(at_parser_cmd_type_get(at_cmd), list, at_params_valid_count_get(list)); + if (!err) { + err = at_cmd_custom_respond(buf, len, "OK\r\n"); + if (err) { + LOG_ERR("Failed to set OK response: %d", err); + } + } + + return err; +} + int slm_at_host_init(void) { int err; /* Initialize AT Parser */ - err = at_params_list_init(&slm_at_param_list, CONFIG_SLM_AT_MAX_PARAM); + err = at_params_list_init(&at_host_param_list, CONFIG_SLM_AT_MAX_PARAM); if (err) { LOG_ERR("Failed to init AT Parser: %d", err); return err; @@ -977,7 +988,7 @@ void slm_at_host_uninit(void) at_host_power_off(true); /* Un-initialize AT Parser */ - at_params_list_free(&slm_at_param_list); + at_params_list_free(&at_host_param_list); LOG_DBG("at_host uninit done"); } diff --git a/applications/serial_lte_modem/src/slm_at_host.h b/applications/serial_lte_modem/src/slm_at_host.h index 9b4cbc4e5708..e315455bf5d3 100644 --- a/applications/serial_lte_modem/src/slm_at_host.h +++ b/applications/serial_lte_modem/src/slm_at_host.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "slm_defines.h" @@ -26,7 +27,6 @@ #define SLM_DATAMODE_FLAGS_NONE 0 #define SLM_DATAMODE_FLAGS_MORE_DATA (1 << 0) -extern struct at_param_list slm_at_param_list; /* For AT parser. */ extern uint8_t slm_data_buf[SLM_MAX_MESSAGE_SIZE]; /* For socket data. */ extern uint8_t slm_at_buf[SLM_AT_MAX_CMD_LEN + 1]; /* AT command buffer. */ @@ -91,11 +91,6 @@ int slm_at_host_power_on(void); */ void slm_at_host_uninit(void); -/** - * @brief Runs the SLM-proprietary @c at_cmd if it is one. - */ -int slm_at_parse(const char *cmd_str, size_t cmd_name_len); - /** * @brief Send AT command response * @@ -151,6 +146,54 @@ bool in_datamode(void); * false If not in data mode. */ bool exit_datamode_handler(int result); + +/** + * @brief Get parameter list from AT command. + * + * @param at_cmd AT command. + * @param list Pointer to the parameter list. + * + * @retval 0 on success. Otherwise, a (negative) error code is returned. + */ +int slm_get_at_param_list(const char *at_cmd, struct at_param_list **list); + +/** @brief SLM AT command callback type. */ +typedef int slm_at_callback(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count); + +/** + * @brief Generic wrapper for a custom SLM AT command callback. + * + * This will call the AT command handler callback, which is declared with SLM_AT_CMD_CUSTOM. + * + * @param buf Response buffer. + * @param len Response buffer size. + * @param at_cmd AT command. + * @param cb AT command callback. + + * @retval 0 on success. + */ +int slm_at_cb_wrapper(char *buf, size_t len, char *at_cmd, slm_at_callback cb); + +/** + * @brief Define a wrapper for a SLM custom AT command callback. + * + * Wrapper will call the generic wrapper, which will call the actual AT command handler. + * + * @param entry The entry name. + * @param _filter The (partial) AT command on which the callback should trigger. + * @param _callback The AT command handler callback. + * + */ +#define SLM_AT_CMD_CUSTOM(entry, _filter, _callback) \ + static int _callback(enum at_cmd_type cmd_type, const struct at_param_list *list, \ + uint32_t); \ + static int _callback##_wrapper_##entry(char *buf, size_t len, char *at_cmd) \ + { \ + return slm_at_cb_wrapper(buf, len, at_cmd, _callback); \ + } \ + AT_CMD_CUSTOM(entry, _filter, _callback##_wrapper_##entry); + /** @} */ #endif /* SLM_AT_HOST_ */ diff --git a/applications/serial_lte_modem/src/slm_at_icmp.c b/applications/serial_lte_modem/src/slm_at_icmp.c index 4fccd203a877..caed9066064b 100644 --- a/applications/serial_lte_modem/src/slm_at_icmp.c +++ b/applications/serial_lte_modem/src/slm_at_icmp.c @@ -517,8 +517,9 @@ static int ping_test_handler(const char *target) return 0; } -/* Handles AT#XPING command. */ -int handle_at_icmp_ping(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xping, "AT#XPING", handle_at_icmp_ping); +static int handle_at_icmp_ping(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; char target[SLM_MAX_URL]; @@ -526,36 +527,35 @@ int handle_at_icmp_ping(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = util_string_get(&slm_at_param_list, 1, target, &size); + err = util_string_get(param_list, 1, target, &size); if (err < 0) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &ping_argv.len); + err = at_params_unsigned_short_get(param_list, 2, &ping_argv.len); if (err < 0) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &ping_argv.waitms); + err = at_params_unsigned_short_get(param_list, 3, &ping_argv.waitms); if (err < 0) { return err; } ping_argv.count = 1; /* default 1 */ - if (at_params_valid_count_get(&slm_at_param_list) > 4) { - err = at_params_unsigned_short_get(&slm_at_param_list, 4, &ping_argv.count); + if (param_count > 4) { + err = at_params_unsigned_short_get(param_list, 4, &ping_argv.count); if (err < 0) { return err; }; } ping_argv.interval = 1000; /* default 1s */ - if (at_params_valid_count_get(&slm_at_param_list) > 5) { - err = at_params_unsigned_short_get( - &slm_at_param_list, 5, &ping_argv.interval); + if (param_count > 5) { + err = at_params_unsigned_short_get(param_list, 5, &ping_argv.interval); if (err < 0) { return err; }; } ping_argv.pdn = 0; /* default 0 primary PDN */ - if (at_params_valid_count_get(&slm_at_param_list) > 6) { - err = at_params_unsigned_short_get(&slm_at_param_list, 6, &ping_argv.pdn); + if (param_count > 6) { + err = at_params_unsigned_short_get(param_list, 6, &ping_argv.pdn); if (err < 0) { return err; }; diff --git a/applications/serial_lte_modem/src/slm_at_sms.c b/applications/serial_lte_modem/src/slm_at_sms.c index bb73289ff4cd..9e2c40992b0b 100644 --- a/applications/serial_lte_modem/src/slm_at_sms.c +++ b/applications/serial_lte_modem/src/slm_at_sms.c @@ -171,16 +171,16 @@ static int do_sms_send(const char *number, const char *message) return err; } - -/* Handles AT#XSMS commands. */ -int handle_at_sms(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsms, "AT#XSMS", handle_at_sms); +static int handle_at_sms(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint16_t op; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -194,12 +194,12 @@ int handle_at_sms(enum at_cmd_type cmd_type) int size; size = SMS_MAX_ADDRESS_LEN_CHARS + 1; - err = util_string_get(&slm_at_param_list, 2, number, &size); + err = util_string_get(param_list, 2, number, &size); if (err) { return err; } size = MAX_CONCATENATED_MESSAGE * SMS_MAX_PAYLOAD_LEN_CHARS; - err = util_string_get(&slm_at_param_list, 3, message, &size); + err = util_string_get(param_list, 3, message, &size); if (err) { return err; } diff --git a/applications/serial_lte_modem/src/slm_at_socket.c b/applications/serial_lte_modem/src/slm_at_socket.c index 87d25228c96c..792cfcd493b4 100644 --- a/applications/serial_lte_modem/src/slm_at_socket.c +++ b/applications/serial_lte_modem/src/slm_at_socket.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -67,6 +68,8 @@ static struct slm_socket sock; /* forward declarations */ #define SOCKET_SEND_TMO_SEC 30 static int socket_poll(int sock_fd, int event, int timeout); +static int handle_at_sendto(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count); static int socket_ranking; @@ -624,7 +627,7 @@ static int do_connect(const char *url, uint16_t port) }; LOG_DBG("connect %s:%d", url, port); - ret = util_resolve_host(sock.cid, url, port, sock.family, Z_LOG_OBJECT_PTR(slm_sock), &sa); + ret = util_resolve_host(sock.cid, url, port, sock.family, &sa); if (ret) { return -EAGAIN; } @@ -817,7 +820,7 @@ static int do_sendto(const char *url, uint16_t port, const uint8_t *data, int da }; LOG_DBG("sendto %s:%d", url, port); - ret = util_resolve_host(sock.cid, url, port, sock.family, Z_LOG_OBJECT_PTR(slm_sock), &sa); + ret = util_resolve_host(sock.cid, url, port, sock.family, &sa); if (ret) { return -EAGAIN; } @@ -855,8 +858,7 @@ static int do_sendto_datamode(const uint8_t *data, int datalen) }; LOG_DBG("sendto %s:%d", udp_url, udp_port); - ret = util_resolve_host(sock.cid, udp_url, udp_port, sock.family, - Z_LOG_OBJECT_PTR(slm_sock), &sa); + ret = util_resolve_host(sock.cid, udp_url, udp_port, sock.family, &sa); if (ret) { return -EAGAIN; } @@ -1004,15 +1006,17 @@ static int socket_datamode_callback(uint8_t op, const uint8_t *data, int len, ui return ret; } -/* Handles AT#XSOCKET commands. */ -int handle_at_socket(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsocket_set, "AT#XSOCKET=", handle_at_socket); +SLM_AT_CMD_CUSTOM(xsocket_read, "AT#XSOCKET?", handle_at_socket); +static int handle_at_socket(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -1022,18 +1026,17 @@ int handle_at_socket(enum at_cmd_type cmd_type) return -EINVAL; } INIT_SOCKET(sock); - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &sock.type); + err = at_params_unsigned_short_get(param_list, 2, &sock.type); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &sock.role); + err = at_params_unsigned_short_get(param_list, 3, &sock.role); if (err) { return err; } sock.family = (op == AT_SOCKET_OPEN) ? AF_INET : AF_INET6; - if (at_params_valid_count_get(&slm_at_param_list) > 4) { - err = at_params_unsigned_short_get( - &slm_at_param_list, 4, &sock.cid); + if (param_count > 4) { + err = at_params_unsigned_short_get(param_list, 4, &sock.cid); if (err) { return err; } @@ -1071,15 +1074,17 @@ int handle_at_socket(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XSSOCKET commands. */ -int handle_at_secure_socket(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xssocket_set, "AT#XSSOCKET=", handle_at_secure_socket); +SLM_AT_CMD_CUSTOM(xssocket_read, "AT#XSSOCKET?", handle_at_secure_socket); +static int handle_at_secure_socket(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t param_count) { int err = -EINVAL; uint16_t op; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -1098,11 +1103,11 @@ int handle_at_secure_socket(enum at_cmd_type cmd_type) return -EINVAL; } INIT_SOCKET(sock); - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &sock.type); + err = at_params_unsigned_short_get(param_list, 2, &sock.type); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &sock.role); + err = at_params_unsigned_short_get(param_list, 3, &sock.role); if (err) { return err; } @@ -1114,21 +1119,19 @@ int handle_at_secure_socket(enum at_cmd_type cmd_type) return -EINVAL; } sock.sec_tag = INVALID_SEC_TAG; - err = at_params_unsigned_int_get(&slm_at_param_list, 4, &sock.sec_tag); + err = at_params_unsigned_int_get(param_list, 4, &sock.sec_tag); if (err) { return err; } - if (at_params_valid_count_get(&slm_at_param_list) > 5) { - err = at_params_unsigned_short_get(&slm_at_param_list, 5, - &peer_verify); + if (param_count > 5) { + err = at_params_unsigned_short_get(param_list, 5, &peer_verify); if (err) { return err; } } sock.family = (op == AT_SOCKET_OPEN) ? AF_INET : AF_INET6; - if (at_params_valid_count_get(&slm_at_param_list) > 6) { - err = at_params_unsigned_short_get( - &slm_at_param_list, 6, &sock.cid); + if (param_count > 6) { + err = at_params_unsigned_short_get(param_list, 6, &sock.cid); if (err) { return err; } @@ -1167,15 +1170,16 @@ int handle_at_secure_socket(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XSOCKETSELECT commands. */ -int handle_at_socket_select(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsocketselect, "AT#XSOCKETSELECT", handle_at_socket_select); +static int handle_at_socket_select(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t) { int err = 0; int fd; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_int_get(&slm_at_param_list, 1, &fd); + err = at_params_int_get(param_list, 1, &fd); if (err) { return err; } @@ -1211,11 +1215,11 @@ int handle_at_socket_select(enum at_cmd_type cmd_type) } return err; - } -/* Handles AT#XSOCKETOPT commands. */ -int handle_at_socketopt(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsocketopt, "AT#XSOCKETOPT", handle_at_socketopt); +static int handle_at_socketopt(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; @@ -1224,18 +1228,18 @@ int handle_at_socketopt(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &name); + err = at_params_unsigned_short_get(param_list, 2, &name); if (err) { return err; } if (op == AT_SOCKETOPT_SET) { /* some options don't require a value */ - if (at_params_valid_count_get(&slm_at_param_list) > 3) { - err = at_params_int_get(&slm_at_param_list, 3, &value); + if (param_count > 3) { + err = at_params_int_get(param_list, 3, &value); if (err) { return err; } @@ -1259,8 +1263,9 @@ int handle_at_socketopt(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XSSOCKETOPT commands. */ -int handle_at_secure_socketopt(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xssocketopt, "AT#XSSOCKETOPT", handle_at_secure_socketopt); +static int handle_at_secure_socketopt(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t) { int err = -EINVAL; uint16_t op; @@ -1273,11 +1278,11 @@ int handle_at_secure_socketopt(enum at_cmd_type cmd_type) LOG_ERR("Not secure socket"); return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &name); + err = at_params_unsigned_short_get(param_list, 2, &name); if (err) { return err; } @@ -1286,15 +1291,15 @@ int handle_at_secure_socketopt(enum at_cmd_type cmd_type) char value_str[SLM_MAX_URL] = {0}; int size = SLM_MAX_URL; - type = at_params_type_get(&slm_at_param_list, 3); + type = at_params_type_get(param_list, 3); if (type == AT_PARAM_TYPE_NUM_INT) { - err = at_params_int_get(&slm_at_param_list, 3, &value_int); + err = at_params_int_get(param_list, 3, &value_int); if (err) { return err; } err = sec_sockopt_set(name, &value_int, sizeof(value_int)); } else if (type == AT_PARAM_TYPE_STRING) { - err = util_string_get(&slm_at_param_list, 3, value_str, &size); + err = util_string_get(param_list, 3, value_str, &size); if (err) { return err; } @@ -1319,15 +1324,16 @@ int handle_at_secure_socketopt(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XBIND commands. */ -int handle_at_bind(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xbind, "AT#XBIND", handle_at_bind); +static int handle_at_bind(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint16_t port; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &port); + err = at_params_unsigned_short_get(param_list, 1, &port); if (err < 0) { return err; } @@ -1341,8 +1347,9 @@ int handle_at_bind(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XCONNECT commands. */ -int handle_at_connect(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xconnect, "AT#XCONNECT", handle_at_connect); +static int handle_at_connect(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; char url[SLM_MAX_URL] = {0}; @@ -1356,11 +1363,11 @@ int handle_at_connect(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = util_string_get(&slm_at_param_list, 1, url, &size); + err = util_string_get(param_list, 1, url, &size); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &port); + err = at_params_unsigned_short_get(param_list, 2, &port); if (err) { return err; } @@ -1374,8 +1381,8 @@ int handle_at_connect(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XLISTEN commands. */ -int handle_at_listen(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xlisten, "AT#XLISTEN", handle_at_listen); +static int handle_at_listen(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { int err = -EINVAL; @@ -1396,8 +1403,9 @@ int handle_at_listen(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XACCEPT command. */ -int handle_at_accept(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xaccept, "AT#XACCEPT", handle_at_accept); +static int handle_at_accept(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; int timeout; @@ -1409,7 +1417,7 @@ int handle_at_accept(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_int_get(&slm_at_param_list, 1, &timeout); + err = at_params_int_get(param_list, 1, &timeout); if (err) { return err; } @@ -1432,18 +1440,29 @@ int handle_at_accept(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XSEND command. */ -int handle_at_send(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsend, "AT#XSEND", handle_at_send); +static int handle_at_send(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { + const char *at_cmd; + size_t at_cmd_len; + + if (at_params_string_ptr_get(param_list, 0, &at_cmd, &at_cmd_len)) { + return -EINVAL; + } + if (!strncasecmp(at_cmd, "AT#XSENDTO", strlen("AT#XSENDTO"))) { + return handle_at_sendto(cmd_type, param_list, param_count); + } + int err = -EINVAL; char data[SLM_MAX_PAYLOAD_SIZE + 1] = {0}; int size; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_valid_count_get(&slm_at_param_list) > 1) { + if (param_count > 1) { size = sizeof(data); - err = util_string_get(&slm_at_param_list, 1, data, &size); + err = util_string_get(param_list, 1, data, &size); if (err) { return err; } @@ -1460,8 +1479,10 @@ int handle_at_send(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XRECV command. */ -int handle_at_recv(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xrecv_set, "AT#XRECV=", handle_at_recv); +SLM_AT_CMD_CUSTOM(xrecv_read, "AT#XRECV?", handle_at_recv); +static int handle_at_recv(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; int timeout; @@ -1469,12 +1490,12 @@ int handle_at_recv(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_int_get(&slm_at_param_list, 1, &timeout); + err = at_params_int_get(param_list, 1, &timeout); if (err) { return err; } - if (at_params_valid_count_get(&slm_at_param_list) > 2) { - err = at_params_int_get(&slm_at_param_list, 2, &flags); + if (param_count > 2) { + err = at_params_int_get(param_list, 2, &flags); if (err) { return err; } @@ -1489,28 +1510,30 @@ int handle_at_recv(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XSENDTO command. */ -int handle_at_sendto(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xsendto, "AT#XSENDTO", handle_at_sendto); +static int handle_at_sendto(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { + int err = -EINVAL; int size; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: size = sizeof(udp_url); - err = util_string_get(&slm_at_param_list, 1, udp_url, &size); + err = util_string_get(param_list, 1, udp_url, &size); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &udp_port); + err = at_params_unsigned_short_get(param_list, 2, &udp_port); if (err) { return err; } - if (at_params_valid_count_get(&slm_at_param_list) > 3) { + if (param_count > 3) { char data[SLM_MAX_PAYLOAD_SIZE + 1] = {0}; size = sizeof(data); - err = util_string_get(&slm_at_param_list, 3, data, &size); + err = util_string_get(param_list, 3, data, &size); if (err) { return err; } @@ -1528,8 +1551,9 @@ int handle_at_sendto(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XRECVFROM command. */ -int handle_at_recvfrom(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xrecvfrom, "AT#XRECVFROM", handle_at_recvfrom); +static int handle_at_recvfrom(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; int timeout; @@ -1537,12 +1561,12 @@ int handle_at_recvfrom(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_int_get(&slm_at_param_list, 1, &timeout); + err = at_params_int_get(param_list, 1, &timeout); if (err) { return err; } - if (at_params_valid_count_get(&slm_at_param_list) > 2) { - err = at_params_int_get(&slm_at_param_list, 2, &flags); + if (param_count > 2) { + err = at_params_int_get(param_list, 2, &flags); if (err) { return err; } @@ -1557,8 +1581,9 @@ int handle_at_recvfrom(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XGETADDRINFO command. */ -int handle_at_getaddrinfo(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xgetaddrinfo, "AT#XGETADDRINFO", handle_at_getaddrinfo); +static int handle_at_getaddrinfo(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; char hostname[NI_MAXHOST]; @@ -1570,7 +1595,7 @@ int handle_at_getaddrinfo(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = util_string_get(&slm_at_param_list, 1, host, &size); + err = util_string_get(param_list, 1, host, &size); if (err) { return err; } @@ -1615,20 +1640,20 @@ int handle_at_getaddrinfo(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XPOLL command. */ -int handle_at_poll(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xpoll, "AT#XPOLL", handle_at_poll); +static int handle_at_poll(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; int timeout, handle; - int count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_int_get(&slm_at_param_list, 1, &timeout); + err = at_params_int_get(param_list, 1, &timeout); if (err) { return err; } - if (count == 2) { + if (param_count == 2) { /* poll all opened socket */ for (int i = 0; i < SLM_MAX_SOCKET_COUNT; i++) { fds[i].fd = socks[i].fd; @@ -1640,8 +1665,8 @@ int handle_at_poll(enum at_cmd_type cmd_type) /* poll selected sockets */ for (int i = 0; i < SLM_MAX_SOCKET_COUNT; i++) { fds[i].fd = INVALID_SOCKET; - if (count > 2 + i) { - err = at_params_int_get(&slm_at_param_list, 2 + i, &handle); + if (param_count > 2 + i) { + err = at_params_int_get(param_list, 2 + i, &handle); if (err) { return err; } diff --git a/applications/serial_lte_modem/src/slm_at_tcp_proxy.c b/applications/serial_lte_modem/src/slm_at_tcp_proxy.c index 32b2b347bb38..f9075ba3df82 100644 --- a/applications/serial_lte_modem/src/slm_at_tcp_proxy.c +++ b/applications/serial_lte_modem/src/slm_at_tcp_proxy.c @@ -278,7 +278,7 @@ static int do_tcp_client_connect(const char *url, uint16_t port) } /* Connect to remote host */ - ret = util_resolve_host(0, url, port, proxy.family, Z_LOG_OBJECT_PTR(slm_tcp), &sa); + ret = util_resolve_host(0, url, port, proxy.family, &sa); if (ret) { goto exit_cli; } @@ -631,17 +631,17 @@ static void tcpcli_thread_func(void *p1, void *p2, void *p3) LOG_INF("TCP client thread terminated"); } -/* Handles AT#XTCPSVR commands. */ -int handle_at_tcp_server(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtcpsvr, "AT#XTCPSVR", handle_at_tcp_server); +static int handle_at_tcp_server(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; uint16_t port; - int param_count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -650,13 +650,13 @@ int handle_at_tcp_server(enum at_cmd_type cmd_type) LOG_ERR("Server is running."); return -EINVAL; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &port); + err = at_params_unsigned_short_get(param_list, 2, &port); if (err) { return err; } proxy.sec_tag = INVALID_SEC_TAG; if (param_count > 3) { - err = at_params_int_get(&slm_at_param_list, 3, &proxy.sec_tag); + err = at_params_int_get(param_list, 3, &proxy.sec_tag); if (err) { return err; } @@ -686,16 +686,16 @@ int handle_at_tcp_server(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTCPCLI commands. */ -int handle_at_tcp_client(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtcpcli, "AT#XTCPCLI", handle_at_tcp_client); +static int handle_at_tcp_client(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; - int param_count = at_params_valid_count_get(&slm_at_param_list); switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -708,22 +708,22 @@ int handle_at_tcp_client(enum at_cmd_type cmd_type) LOG_ERR("Client is connected."); return -EINVAL; } - err = util_string_get(&slm_at_param_list, 2, url, &size); + err = util_string_get(param_list, 2, url, &size); if (err) { return err; } - if (at_params_unsigned_short_get(&slm_at_param_list, 3, &port)) { + if (at_params_unsigned_short_get(param_list, 3, &port)) { return -EINVAL; } proxy.sec_tag = INVALID_SEC_TAG; if (param_count > 4) { - if (at_params_int_get(&slm_at_param_list, 4, &proxy.sec_tag)) { + if (at_params_int_get(param_list, 4, &proxy.sec_tag)) { return -EINVAL; } } proxy.peer_verify = TLS_PEER_VERIFY_REQUIRED; if (param_count > 5) { - if (at_params_int_get(&slm_at_param_list, 5, &proxy.peer_verify) || + if (at_params_int_get(param_list, 5, &proxy.peer_verify) || (proxy.peer_verify != TLS_PEER_VERIFY_NONE && proxy.peer_verify != TLS_PEER_VERIFY_OPTIONAL && proxy.peer_verify != TLS_PEER_VERIFY_REQUIRED)) { @@ -734,8 +734,7 @@ int handle_at_tcp_client(enum at_cmd_type cmd_type) if (param_count > 6) { uint16_t hostname_verify; - if (at_params_unsigned_short_get(&slm_at_param_list, 6, - &hostname_verify) || + if (at_params_unsigned_short_get(param_list, 6, &hostname_verify) || (hostname_verify != 0 && hostname_verify != 1)) { return -EINVAL; } @@ -767,8 +766,9 @@ int handle_at_tcp_client(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTCPSEND command. */ -int handle_at_tcp_send(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtcpsend, "AT#XTCPSEND", handle_at_tcp_send); +static int handle_at_tcp_send(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; char data[SLM_MAX_PAYLOAD_SIZE + 1] = {0}; @@ -776,9 +776,9 @@ int handle_at_tcp_send(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_valid_count_get(&slm_at_param_list) > 1) { + if (at_params_valid_count_get(param_list) > 1) { size = sizeof(data); - err = util_string_get(&slm_at_param_list, 1, data, &size); + err = util_string_get(param_list, 1, data, &size); if (err) { return err; } @@ -795,8 +795,9 @@ int handle_at_tcp_send(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTCPHANGUP commands. */ -int handle_at_tcp_hangup(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtcphangup, "AT#XTCPHANGUP", handle_at_tcp_hangup); +static int handle_at_tcp_hangup(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; int handle; @@ -806,7 +807,7 @@ int handle_at_tcp_hangup(enum at_cmd_type cmd_type) if (proxy.role != TCP_ROLE_SERVER || proxy.sock_peer == INVALID_SOCKET) { return -EINVAL; } - err = at_params_int_get(&slm_at_param_list, 1, &handle); + err = at_params_int_get(param_list, 1, &handle); if (err) { return err; } diff --git a/applications/serial_lte_modem/src/slm_at_udp_proxy.c b/applications/serial_lte_modem/src/slm_at_udp_proxy.c index e7a839a5159d..51d2af7c9493 100644 --- a/applications/serial_lte_modem/src/slm_at_udp_proxy.c +++ b/applications/serial_lte_modem/src/slm_at_udp_proxy.c @@ -228,7 +228,7 @@ static int do_udp_client_connect(const char *url, uint16_t port) } /* Connect to remote host */ - ret = util_resolve_host(0, url, port, proxy.family, Z_LOG_OBJECT_PTR(slm_udp), &sa); + ret = util_resolve_host(0, url, port, proxy.family, &sa); if (ret) { goto cli_exit; } @@ -504,8 +504,9 @@ static bool socket_is_in_use(void) return true; } -/* Handles AT#XUDPSVR commands. */ -int handle_at_udp_server(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xudpsvr, "AT#XUDPSVR", handle_at_udp_server); +static int handle_at_udp_server(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint16_t op; @@ -513,7 +514,7 @@ int handle_at_udp_server(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -521,7 +522,7 @@ int handle_at_udp_server(enum at_cmd_type cmd_type) if (socket_is_in_use()) { return -EINVAL; } - err = at_params_unsigned_short_get(&slm_at_param_list, 2, &port); + err = at_params_unsigned_short_get(param_list, 2, &port); if (err) { return err; } @@ -549,15 +550,16 @@ int handle_at_udp_server(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XUDPCLI commands. */ -int handle_at_udp_client(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xudpcli, "AT#XUDPCLI", handle_at_udp_client); +static int handle_at_udp_client(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t op; switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &op); + err = at_params_unsigned_short_get(param_list, 1, &op); if (err) { return err; } @@ -569,26 +571,25 @@ int handle_at_udp_client(enum at_cmd_type cmd_type) if (socket_is_in_use()) { return -EINVAL; } - err = util_string_get(&slm_at_param_list, 2, url, &size); + err = util_string_get(param_list, 2, url, &size); if (err) { return err; } - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &port); + err = at_params_unsigned_short_get(param_list, 3, &port); if (err) { return err; } proxy.sec_tag = INVALID_SEC_TAG; - const uint32_t param_count = at_params_valid_count_get(&slm_at_param_list); if (param_count > 4) { - if (at_params_int_get(&slm_at_param_list, 4, &proxy.sec_tag) + if (at_params_int_get(param_list, 4, &proxy.sec_tag) || proxy.sec_tag == INVALID_SEC_TAG || proxy.sec_tag < 0) { return -EINVAL; } } proxy.dtls_cid = INVALID_DTLS_CID; if (param_count > 5) { - if (at_params_int_get(&slm_at_param_list, 5, &proxy.dtls_cid) + if (at_params_int_get(param_list, 5, &proxy.dtls_cid) || !(proxy.dtls_cid == TLS_DTLS_CID_DISABLED || proxy.dtls_cid == TLS_DTLS_CID_SUPPORTED || proxy.dtls_cid == TLS_DTLS_CID_ENABLED)) { @@ -597,7 +598,7 @@ int handle_at_udp_client(enum at_cmd_type cmd_type) } proxy.peer_verify = TLS_PEER_VERIFY_REQUIRED; if (param_count > 6) { - if (at_params_int_get(&slm_at_param_list, 6, &proxy.peer_verify) || + if (at_params_int_get(param_list, 6, &proxy.peer_verify) || (proxy.peer_verify != TLS_PEER_VERIFY_NONE && proxy.peer_verify != TLS_PEER_VERIFY_OPTIONAL && proxy.peer_verify != TLS_PEER_VERIFY_REQUIRED)) { @@ -608,8 +609,7 @@ int handle_at_udp_client(enum at_cmd_type cmd_type) if (param_count > 7) { uint16_t hostname_verify; - if (at_params_unsigned_short_get(&slm_at_param_list, 7, - &hostname_verify) || + if (at_params_unsigned_short_get(param_list, 7, &hostname_verify) || (hostname_verify != 0 && hostname_verify != 1)) { return -EINVAL; } @@ -640,8 +640,9 @@ int handle_at_udp_client(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XUDPSEND command. */ -int handle_at_udp_send(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xudpsend, "AT#XUDPSEND", handle_at_udp_send); +static int handle_at_udp_send(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; char data[SLM_MAX_PAYLOAD_SIZE + 1] = {0}; @@ -653,9 +654,9 @@ int handle_at_udp_send(enum at_cmd_type cmd_type) LOG_ERR("Not connected yet"); return -ENOTCONN; } - if (at_params_valid_count_get(&slm_at_param_list) > 1) { + if (param_count > 1) { size = sizeof(data); - err = util_string_get(&slm_at_param_list, 1, data, &size); + err = util_string_get(param_list, 1, data, &size); if (err) { return err; } diff --git a/applications/serial_lte_modem/src/slm_cmux.c b/applications/serial_lte_modem/src/slm_cmux.c index 3387f2d70a14..3136e6954df3 100644 --- a/applications/serial_lte_modem/src/slm_cmux.c +++ b/applications/serial_lte_modem/src/slm_cmux.c @@ -258,11 +258,11 @@ static void cmux_starter(struct k_work *) } } -/* Handles AT#XCMUX commands. */ -int handle_at_cmux(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xcmux, "AT#XCMUX", handle_at_cmux); +static int handle_at_cmux(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { static struct k_work_delayable cmux_start_work; - const unsigned int param_count = at_params_valid_count_get(&slm_at_param_list); unsigned int at_dlci; int ret; @@ -279,7 +279,7 @@ int handle_at_cmux(enum at_cmd_type cmd_type) } if (param_count == 2) { - ret = at_params_unsigned_int_get(&slm_at_param_list, 1, &at_dlci); + ret = at_params_unsigned_int_get(param_list, 1, &at_dlci); if (ret || at_dlci < 1 || at_dlci > ARRAY_SIZE(cmux.dlcis)) { return -EINVAL; } @@ -295,7 +295,7 @@ int handle_at_cmux(enum at_cmd_type cmd_type) /* Just update the AT channel, first answering "OK" on the current DLCI. */ rsp_send_ok(); cmux.at_channel = at_channel; - return SILENT_AT_COMMAND_RET; + return -SILENT_AT_COMMAND_RET; } cmux.at_channel = at_channel; } diff --git a/applications/serial_lte_modem/src/slm_cmux.h b/applications/serial_lte_modem/src/slm_cmux.h index 0cefb47aa13b..d8223b9488c6 100644 --- a/applications/serial_lte_modem/src/slm_cmux.h +++ b/applications/serial_lte_modem/src/slm_cmux.h @@ -10,8 +10,6 @@ void slm_cmux_init(void); -int handle_at_cmux(enum at_cmd_type cmd_type); - #if defined(CONFIG_SLM_PPP) struct modem_pipe; struct modem_pipe *slm_cmux_reserve_ppp_channel(void); diff --git a/applications/serial_lte_modem/src/slm_defines.h b/applications/serial_lte_modem/src/slm_defines.h index ae0c6dc19528..8c28fa3efe31 100644 --- a/applications/serial_lte_modem/src/slm_defines.h +++ b/applications/serial_lte_modem/src/slm_defines.h @@ -16,10 +16,8 @@ #define INVALID_DTLS_CID -1 enum { - /* The command is not a known (or activated) SLM-proprietary AT command. */ - UNKNOWN_AT_COMMAND_RET = __ELASTERROR, /* The command ran successfully and doesn't want the automatic response to be sent. */ - SILENT_AT_COMMAND_RET, + SILENT_AT_COMMAND_RET = __ELASTERROR, }; /** The maximum allowed length of an AT command/response passed through the SLM */ diff --git a/applications/serial_lte_modem/src/slm_ppp.c b/applications/serial_lte_modem/src/slm_ppp.c index 4488acf52967..5244adc130ca 100644 --- a/applications/serial_lte_modem/src/slm_ppp.c +++ b/applications/serial_lte_modem/src/slm_ppp.c @@ -10,7 +10,6 @@ #if defined(CONFIG_SLM_CMUX) #include "slm_cmux.h" #endif -#include #include #include #include @@ -44,11 +43,39 @@ static struct k_thread ppp_data_passing_thread_id; static K_THREAD_STACK_DEFINE(ppp_data_passing_thread_stack, KB(2)); static void ppp_data_passing_thread(void*, void*, void*); -static struct k_work ppp_restart_work; -static struct k_work ppp_stop_work; +static void ppp_controller(struct k_work *work); +enum ppp_action { + PPP_START, + PPP_RESTART, + PPP_STOP +}; +struct ppp_work { + struct k_work work; + enum ppp_action action; +}; +static struct ppp_work ppp_start_work = { + .work = Z_WORK_INITIALIZER(ppp_controller), + .action = PPP_START +}; +static struct ppp_work ppp_restart_work = { + .work = Z_WORK_INITIALIZER(ppp_controller), + .action = PPP_RESTART +}; +static struct ppp_work ppp_stop_work = { + .work = Z_WORK_INITIALIZER(ppp_controller), + .action = PPP_STOP +}; static bool ppp_peer_connected; +enum ppp_states { + PPP_STATE_STOPPED, + PPP_STATE_STARTING, + PPP_STATE_RUNNING, + PPP_STATE_STOPPING +}; +static atomic_t ppp_state; + MODEM_PPP_DEFINE(ppp_module, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, sizeof(ppp_data_buf), sizeof(ppp_data_buf)); @@ -155,6 +182,13 @@ static bool configure_ppp_link_ip_addresses(struct ppp_context *ctx) return true; } +static void send_status_notification(void) +{ + const bool is_running = atomic_get(&ppp_state) == PPP_STATE_RUNNING; + + rsp_send("\r\n#XPPP: %u,%u\r\n", is_running, ppp_peer_connected); +} + static int ppp_start_failure(int ret) { close_ppp_sockets(); @@ -162,7 +196,7 @@ static int ppp_start_failure(int ret) return ret; } -static int ppp_start(void) +static int ppp_start_internal(void) { int ret; unsigned int mtu; @@ -223,25 +257,33 @@ static int ppp_start(void) bool slm_ppp_is_running(void) { - return net_if_is_carrier_ok(ppp_iface) - && ppp_fds[ZEPHYR_FD_IDX] >= 0 - && ppp_fds[MODEM_FD_IDX] >= 0; + return atomic_get(&ppp_state) != PPP_STATE_STOPPED; } -static void ppp_stop(void) +static void ppp_start(void) { - if (!slm_ppp_is_running()) { - return; + if (atomic_cas(&ppp_state, PPP_STATE_STOPPED, PPP_STATE_STARTING)) { + if (ppp_start_internal()) { + atomic_set(&ppp_state, PPP_STATE_STOPPED); + } else { + atomic_set(&ppp_state, PPP_STATE_RUNNING); + send_status_notification(); + } } +} + +static void ppp_stop_internal(void) +{ LOG_DBG("Stopping PPP..."); - /* First bring the carrier down so that slm_ppp_is_running() - * returns false right away. This is to prevent trying to stop PPP at the - * same time from multiple sources: the original one (e.g. "AT#XPPP=0") - * and the data passing thread. The latter attempts to stop PPP when it receives - * an error on some of the sockets, which happens when they are closed. + /* Bring the interface down before releasing pipes and carrier. + * This is needed for LCP to notify the remote endpoint that the link is going down. */ - net_if_carrier_off(ppp_iface); + const int ret = net_if_down(ppp_iface); + + if (ret) { + LOG_WRN("Failed to bring PPP interface down (%d).", ret); + } #if !defined(CONFIG_SLM_CMUX) modem_pipe_close(ppp_pipe); @@ -253,11 +295,7 @@ static void ppp_stop(void) slm_cmux_release_ppp_channel(); #endif - const int ret = net_if_down(ppp_iface); - - if (ret) { - LOG_WRN("Failed to bring PPP interface down (%d).", ret); - } + net_if_carrier_off(ppp_iface); close_ppp_sockets(); @@ -266,21 +304,26 @@ static void ppp_stop(void) LOG_INF("PPP stopped."); } +static void ppp_stop(void) +{ + if (atomic_cas(&ppp_state, PPP_STATE_RUNNING, PPP_STATE_STOPPING)) { + ppp_stop_internal(); + atomic_set(&ppp_state, PPP_STATE_STOPPED); + send_status_notification(); + } +} + /* Automatically starts/stops PPP when the default PDN connection goes up/down. */ static void pdp_ctx_event_handler(uint8_t cid, enum pdn_event event, int reason) { switch (event) { case PDN_EVENT_ACTIVATED: LOG_INF("Connection up. Starting PPP."); - k_work_submit_to_queue(&slm_work_q, &ppp_restart_work); + k_work_submit_to_queue(&slm_work_q, &ppp_restart_work.work); break; case PDN_EVENT_DEACTIVATED: - if (slm_ppp_is_running()) { - LOG_INF("Connection down. Stopping PPP."); - ppp_stop(); - } else { - LOG_DBG("Connection down."); - } + LOG_DBG("Connection down."); + ppp_stop(); break; default: LOG_DBG("Default PDN connection event %d received.", event); @@ -371,22 +414,27 @@ static int at_cfun_set_callback(char *buf, size_t len, char *at_cmd) return 0; } -static void ppp_restarter(struct k_work *) +static void ppp_controller(struct k_work *work) { - ppp_stop(); - - const int ret = ppp_start(); + struct ppp_work *const ppp_work = CONTAINER_OF(work, struct ppp_work, work); - if (ret) { - LOG_ERR("Failed to start PPP (%d).", ret); + switch (ppp_work->action) { + case PPP_START: + ppp_start(); + break; + case PPP_RESTART: + ppp_stop(); + ppp_start(); + break; + case PPP_STOP: + ppp_stop(); + break; + default: + LOG_ERR("Unknown PPP action: %d.", ppp_work->action); + break; } } -static void ppp_stopper(struct k_work *) -{ - ppp_stop(); -} - static void ppp_net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint32_t mgmt_event, struct net_if *iface) { @@ -394,6 +442,7 @@ static void ppp_net_mgmt_event_handler(struct net_mgmt_event_callback *cb, case NET_EVENT_PPP_PHASE_RUNNING: LOG_INF("Peer connected."); ppp_peer_connected = true; + send_status_notification(); break; case NET_EVENT_PPP_PHASE_DEAD: LOG_DBG("Peer not connected."); @@ -406,12 +455,13 @@ static void ppp_net_mgmt_event_handler(struct net_mgmt_event_callback *cb, if (!slm_ppp_is_running()) { break; } + send_status_notification(); /* For the peer to be able to successfully reconnect * (handshake issues observed with pppd and Windows dial-up), - * for some reason the Zephhyr PPP link needs to be restarted. + * for some reason the Zephyr PPP link needs to be restarted. */ LOG_INF("Peer disconnected. Restarting PPP..."); - k_work_submit_to_queue(&slm_work_q, &ppp_restart_work); + k_work_submit_to_queue(&slm_work_q, &ppp_restart_work.work); break; } } @@ -457,15 +507,13 @@ int slm_ppp_init(void) net_mgmt_add_event_callback(&ppp_net_mgmt_event_cb); } - k_work_init(&ppp_restart_work, ppp_restarter); - k_work_init(&ppp_stop_work, ppp_stopper); - LOG_DBG("PPP initialized."); return 0; } -/* Handles AT#XPPP commands. */ -int handle_at_ppp(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xppp, "AT#XPPP", handle_at_ppp); +static int handle_at_ppp(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int ret; unsigned int op; @@ -476,34 +524,28 @@ int handle_at_ppp(enum at_cmd_type cmd_type) }; if (cmd_type == AT_CMD_TYPE_READ_COMMAND) { - rsp_send("\r\n#XPPP: %u,%u\r\n", slm_ppp_is_running(), ppp_peer_connected); + send_status_notification(); return 0; } - if (cmd_type != AT_CMD_TYPE_SET_COMMAND - || at_params_valid_count_get(&slm_at_param_list) != 2) { + if (cmd_type != AT_CMD_TYPE_SET_COMMAND || param_count != 2) { return -EINVAL; } - ret = at_params_unsigned_int_get(&slm_at_param_list, 1, &op); + ret = at_params_unsigned_int_get(param_list, 1, &op); if (ret) { return ret; } else if (op >= OP_COUNT) { return -EINVAL; } - const bool is_running = slm_ppp_is_running(); - if ((!is_running && op == OP_STOP) || (is_running && op == OP_START)) { - return -EALREADY; - } + /* Send "OK" first in case stopping PPP results in the CMUX AT channel switching. */ + rsp_send_ok(); if (op == OP_START) { - ret = ppp_start(); + k_work_submit_to_queue(&slm_work_q, &ppp_start_work.work); } else { - /* Send "OK" first in case stopping PPP results in the CMUX AT channel switching. */ - rsp_send_ok(); - k_work_submit_to_queue(&slm_work_q, &ppp_stop_work); - ret = SILENT_AT_COMMAND_RET; + k_work_submit_to_queue(&slm_work_q, &ppp_stop_work.work); } - return ret; + return -SILENT_AT_COMMAND_RET; } static void ppp_data_passing_thread(void*, void*, void*) diff --git a/applications/serial_lte_modem/src/slm_ppp.h b/applications/serial_lte_modem/src/slm_ppp.h index 6b69265ca3db..67a1cb062591 100644 --- a/applications/serial_lte_modem/src/slm_ppp.h +++ b/applications/serial_lte_modem/src/slm_ppp.h @@ -17,6 +17,4 @@ int slm_ppp_init(void); bool slm_ppp_is_running(void); -int handle_at_ppp(enum at_cmd_type cmd_type); - #endif diff --git a/applications/serial_lte_modem/src/slm_util.c b/applications/serial_lte_modem/src/slm_util.c index 0ab412261283..245f37214e26 100644 --- a/applications/serial_lte_modem/src/slm_util.c +++ b/applications/serial_lte_modem/src/slm_util.c @@ -348,8 +348,7 @@ int util_str_to_int(const char *str_buf, int base, int *output) #define PORT_MAX_SIZE 5 /* 0xFFFF = 65535 */ #define PDN_ID_MAX_SIZE 2 /* 0..10 */ -int util_resolve_host(int cid, const char *host, uint16_t port, int family, - LOG_INSTANCE_PTR_DECLARE(log_inst), struct sockaddr *sa) +int util_resolve_host(int cid, const char *host, uint16_t port, int family, struct sockaddr *sa) { int err; char service[PORT_MAX_SIZE + PDN_ID_MAX_SIZE + 2]; @@ -384,7 +383,7 @@ int util_resolve_host(int cid, const char *host, uint16_t port, int family, } else { errstr = gai_strerror(err); } - LOG_INST_ERR(log_inst, "getaddrinfo() error (%d): %s", err, errstr); + LOG_ERR("getaddrinfo() error (%d): %s", err, errstr); } return err; } diff --git a/applications/serial_lte_modem/src/slm_util.h b/applications/serial_lte_modem/src/slm_util.h index 2f8faa5db0a0..d46fb5855b78 100644 --- a/applications/serial_lte_modem/src/slm_util.h +++ b/applications/serial_lte_modem/src/slm_util.h @@ -179,15 +179,13 @@ int util_str_to_int(const char *str, int base, int *output); * @param[in] host Name or IP address of remote host. * @param[in] port Service port of remote host. * @param[in] family Desired address family for the returned address. - * @param[in] log_inst The log instance of the module calling this function. * @param[out] sa The returned address. * * @retval 0 If the operation was successful. * Otherwise, an errno code or a dns_resolve_status enum value * (defined in `zephyr/net/dns_resolve.h`). */ -int util_resolve_host(int cid, const char *host, uint16_t port, int family, - Z_LOG_INSTANCE_STRUCT *log_inst, struct sockaddr *sa); +int util_resolve_host(int cid, const char *host, uint16_t port, int family, struct sockaddr *sa); /** @} */ #endif /* SLM_UTIL_ */ diff --git a/applications/serial_lte_modem/src/twi/slm_at_twi.c b/applications/serial_lte_modem/src/twi/slm_at_twi.c index d6a434f91853..9416c5db525e 100644 --- a/applications/serial_lte_modem/src/twi/slm_at_twi.c +++ b/applications/serial_lte_modem/src/twi/slm_at_twi.c @@ -142,8 +142,8 @@ static int do_twi_write_read(uint16_t index, uint16_t dev_addr, const uint8_t *t return ret; } -/* Handles AT#XTWILS command. */ -int handle_at_twi_list(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtwils, "AT#XTWILS", handle_at_twi_list); +static int handle_at_twi_list(enum at_cmd_type cmd_type, const struct at_param_list *, uint32_t) { int err = -EINVAL; @@ -160,8 +160,10 @@ int handle_at_twi_list(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTWIW commands. */ -int handle_at_twi_write(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtwiw_set, "AT#XTWIW=", handle_at_twi_write); +SLM_AT_CMD_CUSTOM(xtwiw_read, "AT#XTWIW?", handle_at_twi_write); +static int handle_at_twi_write(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t param_count) { int err = -EINVAL; uint16_t index, dev_addr; @@ -170,17 +172,17 @@ int handle_at_twi_write(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - if (at_params_valid_count_get(&slm_at_param_list) != 4) { + if (param_count != 4) { LOG_ERR("Wrong input parameters"); return -EINVAL; } - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &index); + err = at_params_unsigned_short_get(param_list, 1, &index); if (err < 0) { LOG_ERR("Fail to get twi index: %d", err); return err; } ascii_len = TWI_ADDR_LEN + 1; - err = util_string_get(&slm_at_param_list, 2, twi_addr_ascii, &ascii_len); + err = util_string_get(param_list, 2, twi_addr_ascii, &ascii_len); if (err < 0) { LOG_ERR("Fail to get device address"); return err; @@ -188,7 +190,7 @@ int handle_at_twi_write(enum at_cmd_type cmd_type) sscanf(twi_addr_ascii, "%hx", &dev_addr); LOG_DBG("dev_addr: %hx", dev_addr); ascii_len = sizeof(twi_data); - err = util_string_get(&slm_at_param_list, 3, twi_data, &ascii_len); + err = util_string_get(param_list, 3, twi_data, &ascii_len); if (err) { return err; } @@ -206,8 +208,9 @@ int handle_at_twi_write(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTWIR commands. */ -int handle_at_twi_read(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtwir, "AT#XTWIR", handle_at_twi_read); +static int handle_at_twi_read(enum at_cmd_type cmd_type, const struct at_param_list *param_list, + uint32_t) { int err = -EINVAL; uint16_t index, dev_addr, num_read; @@ -216,20 +219,20 @@ int handle_at_twi_read(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &index); + err = at_params_unsigned_short_get(param_list, 1, &index); if (err < 0) { LOG_ERR("Fail to get twi index: %d", err); return err; } ascii_len = TWI_ADDR_LEN + 1; - err = util_string_get(&slm_at_param_list, 2, twi_addr_ascii, &ascii_len); + err = util_string_get(param_list, 2, twi_addr_ascii, &ascii_len); if (err < 0) { LOG_ERR("Fail to get device address: %d", err); return err; } sscanf(twi_addr_ascii, "%hx", &dev_addr); LOG_DBG("dev_addr: %hx", dev_addr); - err = at_params_unsigned_short_get(&slm_at_param_list, 3, &num_read); + err = at_params_unsigned_short_get(param_list, 3, &num_read); if (err < 0) { LOG_ERR("Fail to get bytes to read: %d", err); return err; @@ -254,8 +257,9 @@ int handle_at_twi_read(enum at_cmd_type cmd_type) return err; } -/* Handles AT#XTWIWR commands. */ -int handle_at_twi_write_read(enum at_cmd_type cmd_type) +SLM_AT_CMD_CUSTOM(xtwiwr, "AT#XTWIWR", handle_at_twi_write_read); +static int handle_at_twi_write_read(enum at_cmd_type cmd_type, + const struct at_param_list *param_list, uint32_t) { int err = -EINVAL; uint16_t index, dev_addr, num_read; @@ -264,13 +268,13 @@ int handle_at_twi_write_read(enum at_cmd_type cmd_type) switch (cmd_type) { case AT_CMD_TYPE_SET_COMMAND: - err = at_params_unsigned_short_get(&slm_at_param_list, 1, &index); + err = at_params_unsigned_short_get(param_list, 1, &index); if (err < 0) { LOG_ERR("Fail to get twi index: %d", err); return err; } ascii_len = TWI_ADDR_LEN + 1; - err = util_string_get(&slm_at_param_list, 2, twi_addr_ascii, &ascii_len); + err = util_string_get(param_list, 2, twi_addr_ascii, &ascii_len); if (err < 0) { LOG_ERR("Fail to get device address"); return err; @@ -278,12 +282,12 @@ int handle_at_twi_write_read(enum at_cmd_type cmd_type) sscanf(twi_addr_ascii, "%hx", &dev_addr); LOG_DBG("dev_addr: %hx", dev_addr); ascii_len = sizeof(twi_data); - err = util_string_get(&slm_at_param_list, 3, twi_data, &ascii_len); + err = util_string_get(param_list, 3, twi_data, &ascii_len); if (err) { return err; } LOG_DBG("Data to write: %s", (char *)twi_data); - err = at_params_unsigned_short_get(&slm_at_param_list, 4, &num_read); + err = at_params_unsigned_short_get(param_list, 4, &num_read); if (err < 0) { LOG_ERR("Fail to get twi index: %d", err); return err; diff --git a/applications/zigbee_weather_station/CMakeLists.txt b/applications/zigbee_weather_station/CMakeLists.txt index d692e138c1a8..37341cc09b0f 100644 --- a/applications/zigbee_weather_station/CMakeLists.txt +++ b/applications/zigbee_weather_station/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.20.0) ################################################################################ # The application uses the configuration/ scheme for configuration files. -set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${BOARD}") +set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${NORMALIZED_BOARD_TARGET}") find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(ZigbeeWeatherStation) diff --git a/applications/zigbee_weather_station/README.rst b/applications/zigbee_weather_station/README.rst index 42a805452ac4..4773d618cf13 100644 --- a/applications/zigbee_weather_station/README.rst +++ b/applications/zigbee_weather_station/README.rst @@ -62,11 +62,11 @@ LED (LD1): Shows the overall state of the device and its connectivity. The following states are possible: - * ``release`` build type + * ``release`` configuration * Even flashing (red color, 500 ms on/500 ms off) - The device is in the Identify mode (after network commissioning). - * ``debug`` build type + * ``debug`` configuration * Constant light (blue) - The device is connected to a Zigbee network. * Even flashing (red color, 500 ms on/500 ms off) - The device is in the Identify mode (after network commissioning). @@ -91,7 +91,7 @@ Button (SW3): USB port: Used for getting logs from the device. - It is enabled only for the ``debug`` build type of the application. + It is enabled only for the ``debug`` configuration of the application. See the :ref:`zigbee_weather_station_app_select_build_type` section to learn how to select the debug configuration. Configuration @@ -131,22 +131,22 @@ CONFIG_WEATHER_CHECK_PERIOD_SECONDS - How often sensor data is read .. _zigbee_weather_station_app_build_types: -Zigbee weather station build types -================================== +Zigbee weather station configurations +===================================== The Zigbee weather station application does not use a single :file:`prj.conf` file. -Configuration files are provided for different build types, and they are located in the :file:`configuration/thingy53_nrf5340_cpuapp` directory. -Before you start testing the application, you can select one of the build types supported by the application. +The application includes different configurations, with files for each configuration located in the :file:`configuration/thingy53_nrf5340_cpuapp` directory. +Before you start testing, you can select one of the configurations using the :makevar:`FILE_SUFFIX` variable. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_file_suffixes` and :ref:`cmake_options` for more information. -The application supports the following build types: +The application supports the following configurations: -.. list-table:: Zigbee weather station build types +.. list-table:: Zigbee weather station configurations :widths: auto :header-rows: 1 - * - Build type + * - Configuration - File name - Supported board - Description @@ -159,10 +159,10 @@ The application supports the following build types: - All from `Requirements`_ - Release version of the application; can be used to enable only the necessary application functionalities to optimize its performance. -Logging in the debug build type -------------------------------- +Logging in the debug configuration +---------------------------------- -In the debug build type, the application also uses serial console over USB for logging. +In the debug configuration, the application also uses serial console over USB for logging. Besides initialization logs, the following sets of measurement-related data are logged after a measurements update: * Values measured by sensor. @@ -188,11 +188,11 @@ Building and running .. _zigbee_weather_station_app_select_build_type: -Selecting a build type -====================== +Selecting application configuration +=================================== Before you start testing the application, you can select one of the :ref:`zigbee_weather_station_app_build_types`. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a suffixed configuration. .. _zigbee_weather_station_app_testing: @@ -200,9 +200,9 @@ Testing ======= .. Note:: - * Part of the testing procedure assumes you are using the ``debug`` :ref:`build type `, as it provides more feedback with **LED (LD1)** and logs through the USB console. + * Part of the testing procedure assumes you are using the ``debug`` :ref:`configuration `, as it provides more feedback with **LED (LD1)** and logs through the USB console. - These steps related to the ``debug`` build type mention the ``debug`` build type and are not required if you are using the ``release`` build type. + These steps related to the ``debug`` configuration mention the ``debug`` configuration and are not required if you are using the ``release`` configuration. * The provided measurement data values depend on the Thingy:53 device's surrounding conditions. * If you want to capture packets with Wireshark, install `nRF Sniffer for 802.15.4`_ and `configure Wireshark for use with Zigbee `_. @@ -210,7 +210,7 @@ Testing After programming the application to your device, complete the following steps to test it: -1. ``debug`` build type: |connect_generic| +1. ``debug`` configuration: |connect_generic| The connection is needed for gathering logs from the Zigbee weather station application. #. Turn on the :ref:`Zigbee shell ` sample programmed as the network coordinator to one of the compatible development kits. See the :ref:`zigbee_shell_sample_testing` section of the sample to learn how to set it up as a coordinator. @@ -245,7 +245,7 @@ After programming the application to your device, complete the following steps t #. When the device joins the network, **LED (LD1)** lights up with a constant blue color. - Additionally, with the ``debug`` build type and console used for logging, output similar to the following appears: + Additionally, with the ``debug`` configuration and console used for logging, output similar to the following appears: .. code-block:: console diff --git a/applications/zigbee_weather_station/sample.yaml b/applications/zigbee_weather_station/sample.yaml index 0339ef80d57d..3cb33bf2cdb2 100644 --- a/applications/zigbee_weather_station/sample.yaml +++ b/applications/zigbee_weather_station/sample.yaml @@ -4,13 +4,13 @@ sample: tests: applications.zigbee_weather_station: build_only: true - platform_allow: thingy53_nrf5340_cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build extra_args: CONF_FILE=prj_release.conf integration_platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp applications.zigbee_weather_station.debug: build_only: true - platform_allow: thingy53_nrf5340_cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build debug extra_args: CONF_FILE=prj.conf diff --git a/boards/arm/nrf52810dmouse_nrf52810/Kconfig b/boards/arm/nrf52810dmouse_nrf52810/Kconfig deleted file mode 100644 index 556d729bfd42..000000000000 --- a/boards/arm/nrf52810dmouse_nrf52810/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52810DMOUSE_NRF52810 - -endif # BOARD_NRF52810DMOUSE_NRF52810 diff --git a/boards/arm/nrf52810dmouse_nrf52810/Kconfig.board b/boards/arm/nrf52810dmouse_nrf52810/Kconfig.board deleted file mode 100644 index 6bb2d4f6ebf5..000000000000 --- a/boards/arm/nrf52810dmouse_nrf52810/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52810DMOUSE_NRF52810 - bool "NRF52810 DMOUSE NRF52810" - depends on SOC_NRF52810_QFAA diff --git a/boards/arm/nrf52810dmouse_nrf52810/Kconfig.defconfig b/boards/arm/nrf52810dmouse_nrf52810/Kconfig.defconfig deleted file mode 100644 index d34951874b19..000000000000 --- a/boards/arm/nrf52810dmouse_nrf52810/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52810DMOUSE_NRF52810 - -config BOARD - default "nrf52810dmouse_nrf52810" - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52810DMOUSE_NRF52810 diff --git a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810_defconfig b/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810_defconfig deleted file mode 100644 index 8f6e05bf2b1f..000000000000 --- a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52810_QFAA=y -CONFIG_BOARD_NRF52810DMOUSE_NRF52810=y - -# Enable MPU -CONFIG_ARM_MPU=y - -CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52820dongle_nrf52820/Kconfig.board b/boards/arm/nrf52820dongle_nrf52820/Kconfig.board deleted file mode 100644 index 7a63815b7103..000000000000 --- a/boards/arm/nrf52820dongle_nrf52820/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52820DONGLE_NRF52820 - bool "NRF52820 DONGLE NRF52820" - depends on SOC_NRF52820_QDAA diff --git a/boards/arm/nrf52820dongle_nrf52820/Kconfig.defconfig b/boards/arm/nrf52820dongle_nrf52820/Kconfig.defconfig deleted file mode 100644 index 8e10bcd1b09a..000000000000 --- a/boards/arm/nrf52820dongle_nrf52820/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52820DONGLE_NRF52820 - -config BOARD - default "nrf52820dongle_nrf52820" - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52820DONGLE_NRF52820 diff --git a/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820_defconfig b/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820_defconfig deleted file mode 100644 index 9f8315c9e223..000000000000 --- a/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820_defconfig +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52820_QDAA=y -CONFIG_BOARD_NRF52820DONGLE_NRF52820=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable PINCTRL -CONFIG_PINCTRL=y - -# enable GPIO -CONFIG_GPIO=y diff --git a/boards/arm/nrf52833dongle_nrf52833/Kconfig.board b/boards/arm/nrf52833dongle_nrf52833/Kconfig.board deleted file mode 100644 index fa3c2f2075d8..000000000000 --- a/boards/arm/nrf52833dongle_nrf52833/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52833DONGLE_NRF52833 - bool "NRF52833 DONGLE NRF52833" - depends on SOC_NRF52833_QIAA diff --git a/boards/arm/nrf52833dongle_nrf52833/Kconfig.defconfig b/boards/arm/nrf52833dongle_nrf52833/Kconfig.defconfig deleted file mode 100644 index d6523e307c3e..000000000000 --- a/boards/arm/nrf52833dongle_nrf52833/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2020 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52833DONGLE_NRF52833 - -config BOARD - default "nrf52833dongle_nrf52833" - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52833DONGLE_NRF52833 diff --git a/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833_defconfig b/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833_defconfig deleted file mode 100644 index a09f67dfcacc..000000000000 --- a/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833_defconfig +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52833_QIAA=y -CONFIG_BOARD_NRF52833DONGLE_NRF52833=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable PINCTRL: -CONFIG_PINCTRL=y - -# enable GPIO -CONFIG_GPIO=y diff --git a/boards/arm/nrf52840gmouse_nrf52840/Kconfig.board b/boards/arm/nrf52840gmouse_nrf52840/Kconfig.board deleted file mode 100644 index 8d408567a2e9..000000000000 --- a/boards/arm/nrf52840gmouse_nrf52840/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2018 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52840GMOUSE_NRF52840 - bool "NRF52840 GMOUSE NRF52840" - depends on SOC_NRF52840_QIAA diff --git a/boards/arm/nrf52840gmouse_nrf52840/Kconfig.defconfig b/boards/arm/nrf52840gmouse_nrf52840/Kconfig.defconfig deleted file mode 100644 index 9a92481e0848..000000000000 --- a/boards/arm/nrf52840gmouse_nrf52840/Kconfig.defconfig +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) 2018 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52840GMOUSE_NRF52840 - -config BOARD - default "nrf52840gmouse_nrf52840" - -if USB - -config USB_NRFX - def_bool y - -config USB_DEVICE_STACK - def_bool y - -endif # USB - -if IEEE802154 - -config IEEE802154_NRF5 - def_bool n - -endif # IEEE802154 - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52840GMOUSE_NRF52840 diff --git a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840_defconfig b/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840_defconfig deleted file mode 100644 index a23f50abf328..000000000000 --- a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_NRF52840GMOUSE_NRF52840=y - -# Enable MPU -CONFIG_ARM_MPU=y - -CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52dmouse_nrf52832/Kconfig.board b/boards/arm/nrf52dmouse_nrf52832/Kconfig.board deleted file mode 100644 index c51d401c4d8a..000000000000 --- a/boards/arm/nrf52dmouse_nrf52832/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52DMOUSE_NRF52832 - bool "NRF52 DMOUSE NRF52832" - depends on SOC_NRF52832_QFAA diff --git a/boards/arm/nrf52dmouse_nrf52832/Kconfig.defconfig b/boards/arm/nrf52dmouse_nrf52832/Kconfig.defconfig deleted file mode 100644 index 37d25fb8a8f3..000000000000 --- a/boards/arm/nrf52dmouse_nrf52832/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52DMOUSE_NRF52832 - -config BOARD - default "nrf52dmouse_nrf52832" - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52DMOUSE_NRF52832 diff --git a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832_defconfig b/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832_defconfig deleted file mode 100644 index 8fc3ebab9c61..000000000000 --- a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52832_QFAA=y -CONFIG_BOARD_NRF52DMOUSE_NRF52832=y - -# Enable MPU -CONFIG_ARM_MPU=y - -CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52kbd_nrf52832/Kconfig.board b/boards/arm/nrf52kbd_nrf52832/Kconfig.board deleted file mode 100644 index 38db249873e4..000000000000 --- a/boards/arm/nrf52kbd_nrf52832/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BOARD_NRF52KBD_NRF52832 - bool "NRF52 KBD NRF52832" - depends on SOC_NRF52832_QFAA diff --git a/boards/arm/nrf52kbd_nrf52832/Kconfig.defconfig b/boards/arm/nrf52kbd_nrf52832/Kconfig.defconfig deleted file mode 100644 index 3da969310df4..000000000000 --- a/boards/arm/nrf52kbd_nrf52832/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2019 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if BOARD_NRF52KBD_NRF52832 - -config BOARD - default "nrf52kbd_nrf52832" - -config BT_CTLR - default BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_NRF52KBD_NRF52832 diff --git a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832_defconfig b/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832_defconfig deleted file mode 100644 index 2ace409e4834..000000000000 --- a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832_defconfig +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52832_QFAA=y -CONFIG_BOARD_NRF52KBD_NRF52832=y - -# Enable MPU -CONFIG_ARM_MPU=y - -CONFIG_PINCTRL=y diff --git a/boards/arm/nrf7002dk_nrf5340/CMakeLists.txt b/boards/arm/nrf7002dk_nrf5340/CMakeLists.txt deleted file mode 100644 index e1e7fab891c1..000000000000 --- a/boards/arm/nrf7002dk_nrf5340/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor ASA. -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if ((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS) - AND CONFIG_BOARD_ENABLE_CPUNET) -zephyr_library() -zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/arm/nrf7002dk_nrf5340/Kconfig b/boards/arm/nrf7002dk_nrf5340/Kconfig deleted file mode 100644 index 8130dc0f436f..000000000000 --- a/boards/arm/nrf7002dk_nrf5340/Kconfig +++ /dev/null @@ -1,85 +0,0 @@ -# nRF5340 DK board configuration - -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config IPM_NRFX - default IPM - -config MBOX_NRFX_IPC - default MBOX - -if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -config BOARD_ENABLE_DCDC_APP - bool "Enable Application MCU DCDC converter" - select SOC_DCDC_NRF53X_APP - default y - -config BOARD_ENABLE_DCDC_NET - bool "Enable Network MCU DCDC converter" - select SOC_DCDC_NRF53X_NET - default y - -config BOARD_ENABLE_DCDC_HV - bool "Enable High Voltage DCDC converter" - select SOC_DCDC_NRF53X_HV - default y - -choice BT_HCI_BUS_TYPE - default BT_HCI_IPC if BT -endchoice - -config HEAP_MEM_POOL_SIZE - default 4096 if BT_HCI_IPC - -config BT_HCI_VS - default y if BT - -config BOARD_ENABLE_CPUNET - bool "Enable nRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) - help - This option enables releasing the Network 'force off' signal, which - as a consequence will power up the Network MCU during system boot. - Additionally, the option allocates GPIO pins that will be used by UARTE - of the Network MCU. - Note: GPIO pin allocation can only be configured by the secure Application - MCU firmware, so when this option is used with the non-secure version of - the board, the application needs to take into consideration, that the - secure firmware image must already have configured GPIO allocation for the - Network MCU. - default y if (BT || NRF_802154_SER_HOST) - -config DOMAIN_CPUNET_BOARD - string - default "nrf7002dk_nrf5340_cpunet" if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - depends on BOARD_ENABLE_CPUNET - help - The board which will be used for CPUNET domain when creating a multi - image application where one or more images should be located on - another board. For example hci_ipc on the nRF5340_cpunet for - Bluetooth applications. - -endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -if BOARD_NRF7002DK_NRF5340_CPUNET - -# BT_CTLR depends on BT. When BT is enabled we should default to also -# enabling the controller. -config BT_CTLR - default y if BT - -config BT_ECC - default y if BT - -config DOMAIN_CPUAPP_BOARD - string - default "nrf7002dk_nrf5340_cpuapp" if BOARD_NRF7002DK_NRF5340_CPUNET - help - The board which will be used for CPUAPP domain when creating a multi - image application where one or more images should be located on - another board. - -endif # BOARD_NRF7002DK_NRF5340_CPUNET diff --git a/boards/arm/nrf7002dk_nrf5340/Kconfig.board b/boards/arm/nrf7002dk_nrf5340/Kconfig.board deleted file mode 100644 index 166e6f86ffaa..000000000000 --- a/boards/arm/nrf7002dk_nrf5340/Kconfig.board +++ /dev/null @@ -1,18 +0,0 @@ -# nRF5340 DK NRF5340 board configuration - -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if SOC_NRF5340_CPUAPP_QKAA - -config BOARD_NRF7002DK_NRF5340_CPUAPP - bool "nRF7002 DK nRF5340 Application MCU" - -config BOARD_NRF7002DK_NRF5340_CPUAPP_NS - bool "nRF7002 DK nRF5340 Application MCU non-secure" - -endif # SOC_NRF5340_CPUAPP_QKAA - -config BOARD_NRF7002DK_NRF5340_CPUNET - bool "nRF7002 DK NRF5340 Network MCU" - depends on SOC_NRF5340_CPUNET_QKAA diff --git a/boards/arm/nrf7002dk_nrf5340/Kconfig.defconfig b/boards/arm/nrf7002dk_nrf5340/Kconfig.defconfig deleted file mode 100644 index cc9a49eb675a..000000000000 --- a/boards/arm/nrf7002dk_nrf5340/Kconfig.defconfig +++ /dev/null @@ -1,80 +0,0 @@ -# nRF5340 DK nRF5340 board configuration - -# Copyright (c) 2022 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -config BOARD - default "nrf7002dk_nrf5340_cpuapp" if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# 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. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if BOARD_NRF7002DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -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) - -endif # BOARD_NRF7002DK_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -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)) - -endif # BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS - -config BOARD - default "nrf7002dk_nrf5340_cpunet" if BOARD_NRF7002DK_NRF5340_CPUNET - -config BOARD_NRF7002 - default y if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUNET diff --git a/boards/arm/nrf7002dk_nrf5340/board.cmake b/boards/arm/nrf7002dk_nrf5340/board.cmake deleted file mode 100644 index 86317357a0d8..000000000000 --- a/boards/arm/nrf7002dk_nrf5340/board.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS) -board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -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(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) -board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") -endif() - -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/CMakeLists.txt b/boards/arm/nrf7002dk_nrf7001_nrf5340/CMakeLists.txt deleted file mode 100644 index 26ece70d3a9b..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA. -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if ((CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS) - AND CONFIG_BOARD_ENABLE_CPUNET) -zephyr_library() -zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig deleted file mode 100644 index 64504951ed6f..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config IPM_NRFX - default IPM - -config MBOX_NRFX_IPC - default MBOX - -if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -config BOARD_ENABLE_DCDC_APP - bool "Enable Application MCU DCDC converter" - select SOC_DCDC_NRF53X_APP - default y - -config BOARD_ENABLE_DCDC_NET - bool "Enable Network MCU DCDC converter" - select SOC_DCDC_NRF53X_NET - default y - -config BOARD_ENABLE_DCDC_HV - bool "Enable High Voltage DCDC converter" - select SOC_DCDC_NRF53X_HV - default y - -choice BT_HCI_BUS_TYPE - default BT_HCI_IPC if BT -endchoice - -config HEAP_MEM_POOL_SIZE - default 4096 if BT_HCI_IPC - -config BT_HCI_VS - default y if BT - -config BOARD_ENABLE_CPUNET - bool "Enable nRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) - help - This option enables releasing the Network 'force off' signal, which - as a consequence will power up the Network MCU during system boot. - Additionally, the option allocates GPIO pins that will be used by UARTE - of the Network MCU. - Note: GPIO pin allocation can only be configured by the secure Application - MCU firmware, so when this option is used with the non-secure version of - the board, the application needs to take into consideration, that the - secure firmware image must already have configured GPIO allocation for the - Network MCU. - default y if (BT || NRF_802154_SER_HOST) - -config DOMAIN_CPUNET_BOARD - string - default "nrf7002dk_nrf7001_nrf5340_cpunet" if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - depends on BOARD_ENABLE_CPUNET - help - The board which will be used for CPUNET domain when creating a multi - image application where one or more images should be located on - another board. For example hci_ipc on the nRF5340_cpunet for - Bluetooth applications. - -endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -if BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET - -# BT_CTLR depends on BT. When BT is enabled we should default to also -# enabling the controller. -config BT_CTLR - default y if BT - -config BT_ECC - default y if BT - -config DOMAIN_CPUAPP_BOARD - string - default "nrf7002dk_nrf7001_nrf5340_cpuapp" if BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET - help - The board which will be used for CPUAPP domain when creating a multi - image application where one or more images should be located on - another board. - -endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.board b/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.board deleted file mode 100644 index 760a530f76bd..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.board +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if SOC_NRF5340_CPUAPP_QKAA - -config BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP - bool "nRF7002 DK (emulating nRF7001) nRF5340 Application MCU" - -config BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - bool "nRF7002 DK (emulating nRF7001) nRF5340 Application MCU non-secure" - -endif # SOC_NRF5340_CPUAPP_QKAA - -config BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET - bool "nRF7002 DK (emulating nRF7001) NRF5340 Network MCU" - depends on SOC_NRF5340_CPUNET_QKAA diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.defconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.defconfig deleted file mode 100644 index d20676bc610a..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/Kconfig.defconfig +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -config BOARD - default "nrf7002dk_nrf7001_nrf5340_cpuapp" if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - # Temporarily disable building Non-Secure images with TF-M support by - # default. - # default y if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - default n - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# 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. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -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) - -endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -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)) - -endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -endif # BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS - -config BOARD - default "nrf7002dk_nrf7001_nrf5340_cpunet" if BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET - -# Hidden (Internal use only) -config NRF70_2_4G_ONLY - bool - default y if BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/board.cmake b/boards/arm/nrf7002dk_nrf7001_nrf5340/board.cmake deleted file mode 100644 index d37c7332287c..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/board.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if(CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS) -board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -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(CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET) -board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") -endif() - -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi deleted file mode 100644 index f68ffe7c397f..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi +++ /dev/null @@ -1,127 +0,0 @@ -&pinctrl { - i2c1_default: i2c1_default { - group1 { - psels = , - ; - }; - }; - - i2c1_sleep: i2c1_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - uart0_default: uart0_default { - group1 { - psels = , - ; - }; - group2 { - psels = , - ; - bias-pull-up; - }; - }; - - uart0_sleep: uart0_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - - pwm0_default: pwm0_default { - group1 { - psels = ; - }; - }; - - pwm0_sleep: pwm0_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; - - qspi_default: qspi_default { - group1 { - psels = , - , - , - , - , - ; - }; - }; - - qspi_sleep: qspi_sleep { - group1 { - psels = , - , - , - , - , - ; - low-power-enable; - }; - }; - - uart1_default: uart1_default { - group1 { - psels = ; - }; - group2 { - psels = ; - bias-pull-up; - }; - }; - - uart1_sleep: uart1_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - spi3_default: spi3_default { - group1 { - psels = , - , - ; - }; - }; - - spi3_sleep: spi3_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - - spi4_default: spi4_default { - group1 { - psels = , - , - ; - }; - }; - - spi4_sleep: spi4_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - -}; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpunet_reset.c b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpunet_reset.c deleted file mode 100644 index d7dafaa04a2e..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpunet_reset.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include - -#include -#include - -LOG_MODULE_REGISTER(nrf7002dk_nrf7001_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); - -#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) -#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h> -#endif - -static void remoteproc_mgr_config(void) -{ -#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) && \ - (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) - /* Route Bluetooth Controller Debug Pins */ - DEBUG_SETUP(); -#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */ - -#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) - /* Retain nRF5340 Network MCU in Secure domain (bus - * accesses by Network MCU will have Secure attribute set). - */ - NRF_SPU->EXTDOMAIN[0].PERM = BIT(4); -#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ -} - -static int remoteproc_mgr_boot(void) -{ - - /* Secure domain may configure permissions for the Network MCU. */ - remoteproc_mgr_config(); - -#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) - /* - * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies - * building also a Non-Secure image. The Non-Secure image will, in - * this case do the remainder of actions to properly configure and - * boot the Network MCU. - */ - - /* Release the Network MCU, 'Release force off signal' */ - nrf_reset_network_force_off(NRF_RESET, false); - - LOG_DBG("Network MCU released."); -#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ - - return 0; -} - -SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp-pinctrl.dtsi b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp-pinctrl.dtsi deleted file mode 100644 index 950ccad422dc..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp-pinctrl.dtsi +++ /dev/null @@ -1,19 +0,0 @@ -&pinctrl { - spi2_default: spi2_default { - group1 { - psels = , - , - ; - }; - }; - - spi2_sleep: spi2_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - -}; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.dts b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.dts deleted file mode 100644 index e4ea8a7a0a96..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.dts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dts" -#include "nrf7002dk_nrf7001_nrf5340_cpuapp-pinctrl.dtsi" - -/ { - model = "Nordic NRF7002 DK (emulating NRF7001) NRF5340 Application"; - compatible = "nordic,nrf7002-dk-nrf5340-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; - zephyr,wifi = &nordic_wlan0; - }; - - nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { - status = "okay"; - compatible = "nordic,nrf700x-tx-power-ceiling"; - max-pwr-2g-dsss = <0x54>; - max-pwr-2g-mcs0 = <0x40>; - max-pwr-2g-mcs7 = <0x40>; - }; -}; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.yaml b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.yaml deleted file mode 100644 index 2bb18e991500..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk_nrf7001_nrf5340_cpuapp -name: NRF7002-DK-NRF7001-NRF5340-application-MCU -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 448 -flash: 1024 -supported: - - gpio - - i2c - - i2s - - pwm - - watchdog - - usb_cdc - - usb_device - - netif:openthread diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_defconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_defconfig deleted file mode 100644 index cd89d029ec19..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_defconfig +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# enable GPIO -CONFIG_GPIO=y - -# enable PINCTRL -CONFIG_PINCTRL=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.dts b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.dts deleted file mode 100644 index 1b2091b5c3c5..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.dts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dts" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,wifi = &nordic_wlan0; - }; - - nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { - status = "okay"; - compatible = "nordic,nrf700x-tx-power-ceiling"; - max-pwr-2g-dsss = <0x54>; - max-pwr-2g-mcs0 = <0x40>; - max-pwr-2g-mcs7 = <0x40>; - }; -}; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.yaml b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.yaml deleted file mode 100644 index 6f53f5352b4a..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns.yaml +++ /dev/null @@ -1,18 +0,0 @@ -identifier: nrf7002dk_nrf7001_nrf5340_cpuapp_ns -name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usb_cdc - - usb_device - - netif:openthread diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns_defconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns_defconfig deleted file mode 100644 index 7d2c1597a275..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpuapp_ns_defconfig +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP_NS=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# enable PINCTRL -CONFIG_PINCTRL=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet-pinctrl.dtsi b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet-pinctrl.dtsi deleted file mode 100644 index b597b9ff0e2f..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet-pinctrl.dtsi +++ /dev/null @@ -1,56 +0,0 @@ -&pinctrl { - uart0_default: uart0_default { - group1 { - psels = , - ; - }; - group2 { - psels = , - ; - bias-pull-up; - }; - }; - - uart0_sleep: uart0_sleep { - group1 { - psels = , - , - , - ; - low-power-enable; - }; - }; - - i2c0_default: i2c0_default { - group1 { - psels = , - ; - }; - }; - - i2c0_sleep: i2c0_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; - - spi0_default: spi0_default { - group1 { - psels = , - , - ; - }; - }; - - spi0_sleep: spi0_sleep { - group1 { - psels = , - , - ; - low-power-enable; - }; - }; - -}; diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts deleted file mode 100644 index 1b688cedf789..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.dts +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/dts-v1/; -#include -#include "nrf7002dk_nrf7001_nrf5340_cpunet-pinctrl.dtsi" - -/ { - model = "Nordic NRF7002 DK (emulating NRF7001) NRF5340 Network"; - compatible = "nordic,nrf7002-dk-nrf5340-cpunet"; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,uart-mcumgr = &uart0; - zephyr,bt-mon-uart = &uart0; - zephyr,bt-c2h-uart = &uart0; - zephyr,bt-hci-ipc = &ipc0; - nordic,802154-spinel-ipc = &ipc0; - zephyr,sram = &sram1; - zephyr,flash = &flash1; - zephyr,code-partition = &slot0_partition; - }; - - leds { - compatible = "gpio-leds"; - led0: led_0 { - gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; - label = "Green LED 0"; - }; - led1: led_1 { - gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; - label = "Green LED 1"; - }; - }; - - buttons { - compatible = "gpio-keys"; - button0: button_0 { - gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 1"; - }; - button1: button_1 { - gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; - label = "Push button 2"; - }; - }; - - arduino_header: connector { - compatible = "arduino-header-r3"; - #gpio-cells = <2>; - gpio-map-mask = <0xffffffff 0xffffffc0>; - gpio-map-pass-thru = <0 0x3f>; - gpio-map = <0 0 &gpio0 4 0>, /* A0 */ - <1 0 &gpio0 5 0>, /* A1 */ - <2 0 &gpio0 6 0>, /* A2 */ - <3 0 &gpio0 7 0>, /* A3 */ - <4 0 &gpio0 25 0>, /* A4 */ - <5 0 &gpio0 26 0>, /* A5 */ - <6 0 &gpio1 0 0>, /* D0 */ - <7 0 &gpio1 1 0>, /* D1 */ - <8 0 &gpio1 4 0>, /* D2 */ - <9 0 &gpio1 5 0>, /* D3 */ - <10 0 &gpio1 6 0>, /* D4 */ - <11 0 &gpio1 7 0>, /* D5 */ - <12 0 &gpio1 8 0>, /* D6 */ - <13 0 &gpio1 9 0>, /* D7 */ - <14 0 &gpio1 10 0>, /* D8 */ - <15 0 &gpio1 11 0>, /* D9 */ - <16 0 &gpio1 12 0>, /* D10 */ - <17 0 &gpio1 13 0>, /* D11 */ - <18 0 &gpio1 14 0>, /* D12 */ - <19 0 &gpio1 15 0>, /* D13 */ - <20 0 &gpio1 2 0>, /* D14 */ - <21 0 &gpio1 3 0>; /* D15 */ - }; - - nrf_radio_coex: nrf7001-coex { - status = "okay"; - compatible = "nordic,nrf700x-coex"; - req-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; - status0-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; - grant-gpios = <&gpio0 24 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; - swctrl1-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; - }; - - /* These aliases are provided for compatibility with samples */ - aliases { - led0 = &led0; - led1 = &led1; - sw0 = &button0; - sw1 = &button1; - bootloader-led0 = &led0; - }; -}; - -&gpiote { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&uart0 { - status = "okay"; - current-speed = <115200>; - pinctrl-0 = <&uart0_default>; - pinctrl-1 = <&uart0_sleep>; - pinctrl-names = "default", "sleep"; -}; - -arduino_serial: &uart0{}; - -arduino_i2c: &i2c0 { - compatible = "nordic,nrf-twim"; - /* Cannot be used together with uart0. */ - /* status = "okay"; */ - pinctrl-0 = <&i2c0_default>; - pinctrl-1 = <&i2c0_sleep>; - pinctrl-names = "default", "sleep"; -}; - -arduino_spi: &spi0 { - compatible = "nordic,nrf-spim"; - /* Cannot be used together with uart0. */ - /* status = "okay"; */ - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ - pinctrl-0 = <&spi0_default>; - pinctrl-1 = <&spi0_sleep>; - pinctrl-names = "default", "sleep"; -}; - -&flash1 { - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 0xc000>; - }; - slot0_partition: partition@c000 { - label = "image-0"; - reg = <0x0000C000 0x12000>; - }; - slot1_partition: partition@1e000 { - label = "image-1"; - reg = <0x0001E000 0x12000>; - }; - scratch_partition: partition@30000 { - label = "image-scratch"; - reg = <0x00030000 0xa000>; - }; - storage_partition: partition@3a000 { - label = "storage"; - reg = <0x0003a000 0x6000>; - }; - }; -}; - -/* Include shared RAM configuration file */ -#include "nrf5340_shared_sram_planning_conf.dts" diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.yaml b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.yaml deleted file mode 100644 index 6fd7f3cbd37a..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet.yaml +++ /dev/null @@ -1,13 +0,0 @@ -identifier: nrf7002dk_nrf7001_nrf5340_cpunet -name: NRF7002-DK-NRF7001-NRF5340-network-MCU -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 64 -flash: 256 -supported: - - gpio - - watchdog diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet_defconfig b/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet_defconfig deleted file mode 100644 index 0ddaaccfdeb2..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf7002dk_nrf7001_nrf5340_cpunet_defconfig +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUNET_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUNET=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# enable GPIO -CONFIG_GPIO=y - -# enable PINCTRL -CONFIG_PINCTRL=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/pre_dt_board.cmake b/boards/arm/nrf7002dk_nrf7001_nrf5340/pre_dt_board.cmake deleted file mode 100644 index 61b19b62c377..000000000000 --- a/boards/arm/nrf7002dk_nrf7001_nrf5340/pre_dt_board.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2023 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -# Suppress "unique_unit_address_if_enabled" to handle the following overlaps: -# - flash-controller@39000 & kmu@39000 -# - power@5000 & clock@5000 -# - /reserved-memory/image@20000000 & /reserved-memory/image_s@20000000 -list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/boards/arm/thingy91_nrf52840/Kconfig b/boards/arm/thingy91_nrf52840/Kconfig deleted file mode 100644 index c5eea61d8300..000000000000 --- a/boards/arm/thingy91_nrf52840/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -# Thingy:91 nRF52840 board configuration -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91_NRF52840 - -config BOARD_ENABLE_DCDC - bool "Enable DCDC mode" - select SOC_DCDC_NRF52X - default y - -endif # BOARD_THINGY91_NRF52840 diff --git a/boards/arm/thingy91_nrf52840/Kconfig.board b/boards/arm/thingy91_nrf52840/Kconfig.board deleted file mode 100644 index 50d871804815..000000000000 --- a/boards/arm/thingy91_nrf52840/Kconfig.board +++ /dev/null @@ -1,9 +0,0 @@ -# nRF52840 THINGY91 board configuration -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config BOARD_THINGY91_NRF52840 - bool "nRF52840 THINGY91" - depends on SOC_NRF52840_QIAA diff --git a/boards/arm/thingy91_nrf52840/Kconfig.defconfig b/boards/arm/thingy91_nrf52840/Kconfig.defconfig deleted file mode 100644 index 3ed78c3a45fe..000000000000 --- a/boards/arm/thingy91_nrf52840/Kconfig.defconfig +++ /dev/null @@ -1,25 +0,0 @@ -# nRF52840 THINGY91 board configuration -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91_NRF52840 - -config BOARD - default "thingy91_nrf52840" - -if USB - -config USB_NRFX - def_bool y - -config USB_DEVICE_STACK - def_bool y - -endif # USB - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_THINGY91_NRF52840 diff --git a/boards/arm/thingy91_nrf52840/board.cmake b/boards/arm/thingy91_nrf52840/board.cmake deleted file mode 100644 index e36ef1ee62d2..000000000000 --- a/boards/arm/thingy91_nrf52840/board.cmake +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2019 Nordic Semiconductor ASA. -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -board_runner_args(jlink "--device=nrf52" "--speed=4000") -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/thingy91_nrf52840/thingy91_nrf52840_defconfig b/boards/arm/thingy91_nrf52840/thingy91_nrf52840_defconfig deleted file mode 100644 index 3eca8278eebe..000000000000 --- a/boards/arm/thingy91_nrf52840/thingy91_nrf52840_defconfig +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_THINGY91_NRF52840=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable PINCTRL -CONFIG_PINCTRL=y - -# enable uart driver -CONFIG_SERIAL=y - -# Enable console -CONFIG_CONSOLE=y - -CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/boards/arm/thingy91_nrf9160/Kconfig b/boards/arm/thingy91_nrf9160/Kconfig deleted file mode 100644 index 99302b176c81..000000000000 --- a/boards/arm/thingy91_nrf9160/Kconfig +++ /dev/null @@ -1,23 +0,0 @@ -# Thingy:91 nRF9160 board configuration -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS - -config BOARD_INIT_PRIORITY - int "Initialization priority for board configuration" - default 80 - help - The Thingy:91 board contains an ADP5360 PMIC that needs to be configured to - set up the power domains on the board correctly. This happens during sys_init, - and the PMIC setup must happen before the sensors are initialized in order - to power them up in time. - -endif # BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS - -module=BOARD -module-dep=LOG -module-str=Log level for board -source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/boards/arm/thingy91_nrf9160/Kconfig.board b/boards/arm/thingy91_nrf9160/Kconfig.board deleted file mode 100644 index 6a2614f8b3a8..000000000000 --- a/boards/arm/thingy91_nrf9160/Kconfig.board +++ /dev/null @@ -1,57 +0,0 @@ -# Thingy:91 nRF9160 board configuration -# -# Copyright (c) 2019 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if SOC_NRF9160_SICA - -config BOARD_THINGY91_NRF9160 - bool "nRF9160 THINGY91" - -config BOARD_THINGY91_NRF9160_NS - bool "nRF9160 THINGY91 non-secure" - -if BOARD_THINGY91_NRF9160_NS - -choice - prompt "Pre-defined Thingy:91 partition layout" - default THINGY91_STATIC_PARTITIONS_SECURE_BOOT if SECURE_BOOT - default THINGY91_STATIC_PARTITIONS_LWM2M_CARRIER if LWM2M_CARRIER - default THINGY91_STATIC_PARTITIONS_FACTORY - -config THINGY91_STATIC_PARTITIONS_FACTORY - bool "Factory Thingy:91 partition layout" - help - The default Thingy:91 partition layout used in the factory firmware. This ensures - firmware updates are compatible with Thingy:91 when flashing firmware over USB or over - the air. - -config THINGY91_STATIC_PARTITIONS_SECURE_BOOT - bool "Secure boot Thingy:91 partition layout [EXPERIMENTAL]" - depends on SECURE_BOOT - select EXPERIMENTAL - help - Similar to the factory partition layout, but also has space for the Immutable Bootloader - and two MCUboot slots. A debugger is needed to flash Thingy:91 the first time. - This layout is still under development and should not be used in production. - -config THINGY91_STATIC_PARTITIONS_LWM2M_CARRIER - bool "LWM2M Carrier partition layout" - depends on LWM2M_CARRIER - help - Use a partition layout including a storage partition needed for the lwm2m carrier library. - -config THINGY91_NO_PREDEFINED_LAYOUT - bool "None [EXPERIMENTAL]" - select EXPERIMENTAL - help - Disable pre-defined static partition layout. This allows the application to use a dynamic - layout or define a custom static partition layout for the application. A debugger is - needed to flash Thingy:91 with a different partition layout. - -endchoice - -endif # BOARD_THINGY91_NRF9160_NS - -endif # SOC_NRF9160_SICA diff --git a/boards/arm/thingy91_nrf9160/Kconfig.defconfig b/boards/arm/thingy91_nrf9160/Kconfig.defconfig deleted file mode 100644 index bdc58846d231..000000000000 --- a/boards/arm/thingy91_nrf9160/Kconfig.defconfig +++ /dev/null @@ -1,65 +0,0 @@ -# Thingy:91 nRF9160 board configuration -# -# Copyright (c) 2018 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS - -config BOARD - default "thingy91_nrf9160" - -# Enable Zephyr power regulator ADP536x -config REGULATOR - default y - depends on !IS_BOOTLOADER_IMG - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_THINGY91_NRF9160_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# 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. - -if BOARD_THINGY91_NRF9160 && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_THINGY91_NRF9160 && TRUSTED_EXECUTION_SECURE - -if BOARD_THINGY91_NRF9160_NS - -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)) - -endif # BOARD_THINGY91_NRF9160_NS - -config BT_HCI_VS - default y if BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -endif # BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS diff --git a/boards/arm/thingy91_nrf9160/board.cmake b/boards/arm/thingy91_nrf9160/board.cmake deleted file mode 100644 index ae3d21a99f7a..000000000000 --- a/boards/arm/thingy91_nrf9160/board.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2019 Nordic Semiconductor ASA. -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -board_runner_args(nrfjprog "--softreset") -board_runner_args(jlink "--device=cortex-m33" "--speed=4000") -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/thingy91_nrf9160/pre_dt_board.cmake b/boards/arm/thingy91_nrf9160/pre_dt_board.cmake deleted file mode 100644 index c2e677a18bf3..000000000000 --- a/boards/arm/thingy91_nrf9160/pre_dt_board.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/boards/arm/thingy91x_nrf5340/CMakeLists.txt b/boards/arm/thingy91x_nrf5340/CMakeLists.txt deleted file mode 100644 index 660e27072c51..000000000000 --- a/boards/arm/thingy91x_nrf5340/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if (CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP OR CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS) -zephyr_library() -zephyr_library_sources_ifdef(CONFIG_BOARD_ENABLE_CPUNET nrf5340_cpunet_reset.c) -set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static.yml CACHE INTERNAL "") -endif() diff --git a/boards/arm/thingy91x_nrf5340/Kconfig b/boards/arm/thingy91x_nrf5340/Kconfig deleted file mode 100644 index 506493e9ca48..000000000000 --- a/boards/arm/thingy91x_nrf5340/Kconfig +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config BOARD_ENABLE_DCDC_APP - bool "Application MCU DCDC converter" - select SOC_DCDC_NRF53X_APP - default y - -config BOARD_ENABLE_DCDC_NET - bool "Network MCU DCDC converter" - select SOC_DCDC_NRF53X_NET - default y - -config BOARD_ENABLE_CPUNET - bool "Enable nRF53 Network MCU" - select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ - $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) - help - This option enables releasing the Network 'force off' signal, which - as a consequence will power up the Network MCU during system boot. - Additionally, the option allocates GPIO pins that will be used by UARTE - of the Network MCU. - Note: GPIO pin allocation can only be configured by the secure Application - MCU firmware, so when this option is used with the non-secure version of - the board, the application needs to take into consideration, that the - secure firmware image must already have configured GPIO allocation for the - Network MCU. - default y - -config DOMAIN_CPUNET_BOARD - string - default "thingy91x_nrf5340_cpunet" if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - depends on BOARD_ENABLE_CPUNET - help - The board which will be used for CPUNET domain when creating a multi - image application where one or more images should be located on - another board. For example hci_rpmsg on the nRF5340_cpunet for - Bluetooth applications. - -endif - -if BOARD_THINGY91X_NRF5340_CPUNET - -# BT_CTLR depends on BT. When BT is enabled we should default to also -# enabling the controller. -config BT_CTLR - default y if BT - -config BT_ECC - default y if BT - -config DOMAIN_CPUAPP_BOARD - string - default "thingy91x_nrf5340_cpuapp" if BOARD_THINGY91X_NRF5340_CPUNET - help - The board which will be used for CPUAPP domain when creating a multi - image application where one or more images should be located on - another board. - -endif # BOARD_THINGY91X_NRF5340_CPUNET diff --git a/boards/arm/thingy91x_nrf5340/Kconfig.board b/boards/arm/thingy91x_nrf5340/Kconfig.board deleted file mode 100644 index a99ba01cdf27..000000000000 --- a/boards/arm/thingy91x_nrf5340/Kconfig.board +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -config BOARD_THINGY91X_NRF5340_CPUAPP - bool "nRF5340_APP THINGY91X" - depends on SOC_NRF5340_CPUAPP_QKAA - -config BOARD_THINGY91X_NRF5340_CPUAPP_NS - bool "nRF5340_APP THINGY91X" - depends on SOC_NRF5340_CPUAPP_QKAA - -config BOARD_THINGY91X_NRF5340_CPUNET - bool "nRF5340_NET THINGY91X" - depends on SOC_NRF5340_CPUNET_QKAA diff --git a/boards/arm/thingy91x_nrf5340/Kconfig.defconfig b/boards/arm/thingy91x_nrf5340/Kconfig.defconfig deleted file mode 100644 index b3595d2ea0e1..000000000000 --- a/boards/arm/thingy91x_nrf5340/Kconfig.defconfig +++ /dev/null @@ -1,118 +0,0 @@ -# Thingy:91 X nRF5340 board configuration - -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config BOARD - default "thingy91x_nrf5340_cpuapp" if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_THINGY91X_NRF5340_CPUAPP_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# 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. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if BOARD_THINGY91X_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -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) - -endif # BOARD_THINGY91X_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE - -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)) - -choice BT_HCI_BUS_TYPE - default BT_HCI_IPC if BT -endchoice - -config HEAP_MEM_POOL_SIZE - default 4096 if BT_HCI_IPC - -endif # BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config BOARD - default "thingy91x_nrf5340_cpunet" if BOARD_THINGY91X_NRF5340_CPUNET - -config MBOX_NRFX_IPC - default MBOX - -if BOARD_THINGY91X_NRF5340_CPUNET - -config BT_CTLR - default y if BT - -endif # BOARD_THINGY91X_NRF5340_CPUNET - -config USE_SEGGER_RTT - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET - -config RTT_CONSOLE - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET - -if !IS_BOOTLOADER_IMG - -config SECURE_BOOT - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET - -config BOOTLOADER_MCUBOOT - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config NRF53_UPGRADE_NETWORK_CORE - default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config UPDATEABLE_IMAGE_NUMBER - default 2 if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS - -config SB_SIGNING_KEY_FILE - default "$(ZEPHYR_NRF_MODULE_DIR)/boards/arm/thingy91x_nrf5340/nsib_signing_key.pem" if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET - -endif # !IS_BOOTLOADER_IMG diff --git a/boards/arm/thingy91x_nrf5340/board.cmake b/boards/arm/thingy91x_nrf5340/board.cmake deleted file mode 100644 index d050affb3c4f..000000000000 --- a/boards/arm/thingy91x_nrf5340/board.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if(BOARD_THINGY91X_NRF5340_CPUAPP OR BOARD_THINGY91X_NRF5340_CPUAPP_NS) -board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -board_runner_args(nrfjprog "--nrf-family=NRF53") -endif() - -if(BOARD_THINGY91X_NRF5340_CPUNET) -board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") -board_runner_args(nrfjprog "--nrf-family=NRF53") -endif() - -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/thingy91x_nrf5340/nrf5340_cpunet_reset.c b/boards/arm/thingy91x_nrf5340/nrf5340_cpunet_reset.c deleted file mode 100644 index 76696edc0c20..000000000000 --- a/boards/arm/thingy91x_nrf5340/nrf5340_cpunet_reset.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include - -#include - -LOG_MODULE_REGISTER(thingy91x_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); - -#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) -#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h> -#endif - -static void remoteproc_mgr_config(void) -{ -#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) && \ - (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) - /* Route Bluetooth Controller Debug Pins */ - DEBUG_SETUP(); -#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */ - -#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) - /* Retain nRF5340 Network MCU in Secure domain (bus - * accesses by Network MCU will have Secure attribute set). - */ - NRF_SPU->EXTDOMAIN[0].PERM = BIT(4); -#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ -} - -static int remoteproc_mgr_boot(void) -{ - - /* Secure domain may configure permissions for the Network MCU. */ - remoteproc_mgr_config(); - -#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) - /* - * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies - * building also a Non-Secure image. The Non-Secure image will, in - * this case do the remainder of actions to properly configure and - * boot the Network MCU. - */ - - /* Release the Network MCU, 'Release force off signal' */ - NRF_RESET->NETWORK.FORCEOFF = RESET_NETWORK_FORCEOFF_FORCEOFF_Release; - - LOG_DBG("Network MCU released."); -#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ - - return 0; -} - -SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/thingy91x_nrf9151/CMakeLists.txt b/boards/arm/thingy91x_nrf9151/CMakeLists.txt deleted file mode 100644 index 70c0003d848b..000000000000 --- a/boards/arm/thingy91x_nrf9151/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Kconfig - nRF91 Thingy:91 X board configuration -# -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -zephyr_library() -if(CONFIG_BOARD_THINGY91X_NRF9151_NS) - # Use static partition layout to ensure the partition layout remains - # unchanged after DFU. This needs to be made globally available - # because it is used in other CMake files. - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_pm_static.yml CACHE INTERNAL "") -endif() diff --git a/boards/arm/thingy91x_nrf9151/Kconfig.board b/boards/arm/thingy91x_nrf9151/Kconfig.board deleted file mode 100644 index 00594d681fb1..000000000000 --- a/boards/arm/thingy91x_nrf9151/Kconfig.board +++ /dev/null @@ -1,14 +0,0 @@ -# Thingy:91 X nRF9151 board configuration -# -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if SOC_NRF9151_LACA - -config BOARD_THINGY91X_NRF9151 - bool "nRF9151 THINGY91X" - -config BOARD_THINGY91X_NRF9151_NS - bool "nRF9151 THINGY91X non-secure" - -endif # SOC_NRF9151_LACA diff --git a/boards/arm/thingy91x_nrf9151/Kconfig.defconfig b/boards/arm/thingy91x_nrf9151/Kconfig.defconfig deleted file mode 100644 index 6a2790ba4b2a..000000000000 --- a/boards/arm/thingy91x_nrf9151/Kconfig.defconfig +++ /dev/null @@ -1,125 +0,0 @@ -# Thingy:91 X nRF9151 board configuration -# -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -if BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS - -DT_COMPAT_NORDIC_NRF700X_SPI := nordic,nrf700x-spi -config NRF7002_ON_SPI - def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI)) - -config BOARD - default "thingy91x_nrf9151" - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_THINGY91X_NRF9151_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -config PM_PARTITION_SIZE_TFM_SRAM - hex - default 0xa000 - -endif # BUILD_WITH_TFM - -# 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. - -if BOARD_THINGY91X_NRF9151 && TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif # BOARD_THINGY91X_NRF9151 && TRUSTED_EXECUTION_SECURE - -if BOARD_THINGY91X_NRF9151_NS - -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)) - -endif # BOARD_THINGY91X_NRF9151_NS - -config BT_HCI_VS - default y if BT - -config HW_STACK_PROTECTION - default ARCH_HAS_STACK_PROTECTION - -# check if we are building for any bootloader -if !IS_BOOTLOADER_IMG - -config SECURE_BOOT - default y - -config BOOTLOADER_MCUBOOT - default y - -# Do not use these keys for own custom boards! -# These are meant as examples and therefore public. -# The documentation of the nRF Secure Immutable Bootloader and MCUBoot detail on how -# to set up your own keys. - -config SB_SIGNING_KEY_FILE - default "$(ZEPHYR_NRF_MODULE_DIR)/boards/arm/thingy91x_nrf9151/nsib_signing_key.pem" - -config I2C - default y - -config MODEM_ANTENNA - depends on NRF_MODEM_LIB - default y - -if MODEM_ANTENNA - -config MODEM_ANTENNA_AT_MIPIRFFEDEV - default "AT%XMIPIRFFEDEV=1,4,71,198,248" -config MODEM_ANTENNA_AT_MIPIRFFECTRL_INIT - default "AT%XMIPIRFFECTRL=1,0,1,28,248" -config MODEM_ANTENNA_AT_MIPIRFFECTRL_ON - default "AT%XMIPIRFFECTRL=1,1,1,28,56,13,0,0,8,8,715,4,4,770,12,12,829,11,11,863,130,130,892,1,1,939,129,129,978,26,26,1042,8,8,1118,4,4,1270,12,12,1386,14,14,1523,130,130,2200" -config MODEM_ANTENNA_AT_MIPIRFFECTRL_OFF - default "AT%XMIPIRFFECTRL=1,2,1,28,184" -config MODEM_ANTENNA_AT_MIPIRFFECTRL_PWROFF - default "AT%XMIPIRFFECTRL=1,3,1,28,184" -config MODEM_ANTENNA_AT_COEX0 - default "AT\%XCOEX0=1,1,1565,1586" - -endif # MODEM_ANTENNA - -# For on-board regulators -config REGULATOR - default y - -# nPM6001 must be initialized after it is powered from nPM1300 (REGULATOR_NPM1300_INIT_PRIORITY) -config MFD_NPM6001_INIT_PRIORITY - default 87 -config REGULATOR_NPM6001_INIT_PRIORITY - default 88 -config WIFI_INIT_PRIORITY - default 89 - -# GPIO hogs must be initialized after nPM1300 (GPIO_NPM1300_INIT_PRIORITY) -config GPIO_HOGS_INIT_PRIORITY - default 86 - -endif # !IS_BOOTLOADER_IMG -endif # BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS diff --git a/boards/arm/thingy91x_nrf9151/board.cmake b/boards/arm/thingy91x_nrf9151/board.cmake deleted file mode 100644 index 7608f76d2e93..000000000000 --- a/boards/arm/thingy91x_nrf9151/board.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -board_runner_args(nrfjprog "--nrf-family=NRF91") -board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/arm/thingy91x_nrf9151/pre_dt_board.cmake b/boards/arm/thingy91x_nrf9151/pre_dt_board.cmake deleted file mode 100644 index b78c7ea6eb0b..000000000000 --- a/boards/arm/thingy91x_nrf9151/pre_dt_board.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/boards/deprecated.cmake b/boards/deprecated.cmake index e6c5da056928..64a0de435154 100644 --- a/boards/deprecated.cmake +++ b/boards/deprecated.cmake @@ -16,3 +16,10 @@ set(nrf52840_pca20035_DEPRECATED thingy91_nrf52840) set(nrf9160_pca20035_DEPRECATED thingy91_nrf9160) set(nrf9160_pca20035ns_DEPRECATED thingy91_nrf9160_ns) set(thingy91_nrf9160ns_DEPRECATED thingy91_nrf9160_ns) + +set(nrf52810dmouse_nrf52810_DEPRECATED nrf52810dmouse/nrf52810) +set(nrf52820dongle_nrf52820_DEPRECATED nrf52820dongle/nrf52820) +set(nrf52833dongle_nrf52833_DEPRECATED nrf52833dongle/nrf52833) +set(nrf52840gmouse_nrf52840_DEPRECATED nrf52840gmouse/nrf52840) +set(nrf52dmouse_nrf52832_DEPRECATED nrf52dmouse/nrf52832) +set(nrf52kbd_nrf52832_DEPRECATED nrf52kbd/nrf52832) diff --git a/boards/nordic/nrf52810dmouse/Kconfig.defconfig b/boards/nordic/nrf52810dmouse/Kconfig.defconfig new file mode 100644 index 000000000000..2251139128e2 --- /dev/null +++ b/boards/nordic/nrf52810dmouse/Kconfig.defconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2019 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52810DMOUSE + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52810DMOUSE diff --git a/boards/nordic/nrf52810dmouse/Kconfig.nrf52810dmouse b/boards/nordic/nrf52810dmouse/Kconfig.nrf52810dmouse new file mode 100644 index 000000000000..f8aa76d6416c --- /dev/null +++ b/boards/nordic/nrf52810dmouse/Kconfig.nrf52810dmouse @@ -0,0 +1,5 @@ +# Copyright (c) 2019 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52810DMOUSE + select SOC_NRF52810_QFAA diff --git a/boards/arm/nrf52810dmouse_nrf52810/board.cmake b/boards/nordic/nrf52810dmouse/board.cmake similarity index 100% rename from boards/arm/nrf52810dmouse_nrf52810/board.cmake rename to boards/nordic/nrf52810dmouse/board.cmake diff --git a/boards/nordic/nrf52810dmouse/board.yml b/boards/nordic/nrf52810dmouse/board.yml new file mode 100644 index 000000000000..6c89782097b0 --- /dev/null +++ b/boards/nordic/nrf52810dmouse/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52810dmouse + vendor: nordic + socs: + - name: nrf52810 diff --git a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810-pinctrl.dtsi b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810-pinctrl.dtsi rename to boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810-pinctrl.dtsi diff --git a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810.dts b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810.dts similarity index 100% rename from boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810.dts rename to boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810.dts diff --git a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810.yaml b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810.yaml similarity index 81% rename from boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810.yaml rename to boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810.yaml index 6fd06b74f8dc..84707aa43240 100644 --- a/boards/arm/nrf52810dmouse_nrf52810/nrf52810dmouse_nrf52810.yaml +++ b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810.yaml @@ -1,4 +1,4 @@ -identifier: nrf52810dmouse_nrf52810 +identifier: nrf52810dmouse/nrf52810 name: nRF52810-DMouse-NRF52810 type: mcu arch: arm diff --git a/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810_defconfig b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810_defconfig new file mode 100644 index 000000000000..69e328438fde --- /dev/null +++ b/boards/nordic/nrf52810dmouse/nrf52810dmouse_nrf52810_defconfig @@ -0,0 +1,4 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52810dmouse_nrf52810/pre_dt_board.cmake b/boards/nordic/nrf52810dmouse/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52810dmouse_nrf52810/pre_dt_board.cmake rename to boards/nordic/nrf52810dmouse/pre_dt_board.cmake diff --git a/boards/arm/nrf52820dongle_nrf52820/CMakeLists.txt b/boards/nordic/nrf52820dongle/CMakeLists.txt similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/CMakeLists.txt rename to boards/nordic/nrf52820dongle/CMakeLists.txt diff --git a/boards/arm/nrf52820dongle_nrf52820/Kconfig b/boards/nordic/nrf52820dongle/Kconfig similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/Kconfig rename to boards/nordic/nrf52820dongle/Kconfig diff --git a/boards/nordic/nrf52820dongle/Kconfig.defconfig b/boards/nordic/nrf52820dongle/Kconfig.defconfig new file mode 100644 index 000000000000..5214f0a6a2b9 --- /dev/null +++ b/boards/nordic/nrf52820dongle/Kconfig.defconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2020 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52820DONGLE + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52820DONGLE diff --git a/boards/nordic/nrf52820dongle/Kconfig.nrf52820dongle b/boards/nordic/nrf52820dongle/Kconfig.nrf52820dongle new file mode 100644 index 000000000000..d609f8ec6514 --- /dev/null +++ b/boards/nordic/nrf52820dongle/Kconfig.nrf52820dongle @@ -0,0 +1,5 @@ +# Copyright (c) 2020 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52820DONGLE + select SOC_NRF52820_QDAA diff --git a/boards/arm/nrf52820dongle_nrf52820/board.c b/boards/nordic/nrf52820dongle/board.c similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/board.c rename to boards/nordic/nrf52820dongle/board.c diff --git a/boards/arm/nrf52820dongle_nrf52820/board.cmake b/boards/nordic/nrf52820dongle/board.cmake similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/board.cmake rename to boards/nordic/nrf52820dongle/board.cmake diff --git a/boards/nordic/nrf52820dongle/board.yml b/boards/nordic/nrf52820dongle/board.yml new file mode 100644 index 000000000000..031410ad539f --- /dev/null +++ b/boards/nordic/nrf52820dongle/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52820dongle + vendor: nordic + socs: + - name: nrf52820 diff --git a/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820.dts b/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820.dts similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820.dts rename to boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820.dts diff --git a/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820.yaml b/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820.yaml similarity index 82% rename from boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820.yaml rename to boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820.yaml index 86fa6945eaa4..fac4253e32de 100644 --- a/boards/arm/nrf52820dongle_nrf52820/nrf52820dongle_nrf52820.yaml +++ b/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820.yaml @@ -1,4 +1,4 @@ -identifier: nrf52820dongle_nrf52820 +identifier: nrf52820dongle/nrf52820 name: nRF52820-Dongle-NRF52820 type: mcu arch: arm diff --git a/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820_defconfig b/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820_defconfig new file mode 100644 index 000000000000..c35fdc20e78a --- /dev/null +++ b/boards/nordic/nrf52820dongle/nrf52820dongle_nrf52820_defconfig @@ -0,0 +1,8 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable PINCTRL +CONFIG_PINCTRL=y + +# enable GPIO +CONFIG_GPIO=y diff --git a/boards/arm/nrf52820dongle_nrf52820/pre_dt_board.cmake b/boards/nordic/nrf52820dongle/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52820dongle_nrf52820/pre_dt_board.cmake rename to boards/nordic/nrf52820dongle/pre_dt_board.cmake diff --git a/boards/arm/nrf52833dongle_nrf52833/CMakeLists.txt b/boards/nordic/nrf52833dongle/CMakeLists.txt similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/CMakeLists.txt rename to boards/nordic/nrf52833dongle/CMakeLists.txt diff --git a/boards/arm/nrf52833dongle_nrf52833/Kconfig b/boards/nordic/nrf52833dongle/Kconfig similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/Kconfig rename to boards/nordic/nrf52833dongle/Kconfig diff --git a/boards/nordic/nrf52833dongle/Kconfig.defconfig b/boards/nordic/nrf52833dongle/Kconfig.defconfig new file mode 100644 index 000000000000..80279a0fceab --- /dev/null +++ b/boards/nordic/nrf52833dongle/Kconfig.defconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2020 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52833DONGLE + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52833DONGLE diff --git a/boards/nordic/nrf52833dongle/Kconfig.nrf52833dongle b/boards/nordic/nrf52833dongle/Kconfig.nrf52833dongle new file mode 100644 index 000000000000..968ddddb1077 --- /dev/null +++ b/boards/nordic/nrf52833dongle/Kconfig.nrf52833dongle @@ -0,0 +1,5 @@ +# Copyright (c) 2020 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52833DONGLE + select SOC_NRF52833_QIAA diff --git a/boards/arm/nrf52833dongle_nrf52833/board.c b/boards/nordic/nrf52833dongle/board.c similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/board.c rename to boards/nordic/nrf52833dongle/board.c diff --git a/boards/arm/nrf52833dongle_nrf52833/board.cmake b/boards/nordic/nrf52833dongle/board.cmake similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/board.cmake rename to boards/nordic/nrf52833dongle/board.cmake diff --git a/boards/nordic/nrf52833dongle/board.yml b/boards/nordic/nrf52833dongle/board.yml new file mode 100644 index 000000000000..1463698a27b1 --- /dev/null +++ b/boards/nordic/nrf52833dongle/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52833dongle + vendor: nordic + socs: + - name: nrf52833 diff --git a/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.dts b/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.dts similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.dts rename to boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.dts diff --git a/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.yaml b/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.yaml similarity index 82% rename from boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.yaml rename to boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.yaml index 6d0f3468df5b..f5c3e229b3c7 100644 --- a/boards/arm/nrf52833dongle_nrf52833/nrf52833dongle_nrf52833.yaml +++ b/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833.yaml @@ -1,4 +1,4 @@ -identifier: nrf52833dongle_nrf52833 +identifier: nrf52833dongle/nrf52833 name: nRF52833-Dongle-NRF52833 type: mcu arch: arm diff --git a/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833_defconfig b/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833_defconfig new file mode 100644 index 000000000000..7d7249944199 --- /dev/null +++ b/boards/nordic/nrf52833dongle/nrf52833dongle_nrf52833_defconfig @@ -0,0 +1,8 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable PINCTRL: +CONFIG_PINCTRL=y + +# enable GPIO +CONFIG_GPIO=y diff --git a/boards/arm/nrf52833dongle_nrf52833/pre_dt_board.cmake b/boards/nordic/nrf52833dongle/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52833dongle_nrf52833/pre_dt_board.cmake rename to boards/nordic/nrf52833dongle/pre_dt_board.cmake diff --git a/boards/arm/nrf52840gmouse_nrf52840/Kconfig b/boards/nordic/nrf52840gmouse/Kconfig similarity index 100% rename from boards/arm/nrf52840gmouse_nrf52840/Kconfig rename to boards/nordic/nrf52840gmouse/Kconfig diff --git a/boards/nordic/nrf52840gmouse/Kconfig.defconfig b/boards/nordic/nrf52840gmouse/Kconfig.defconfig new file mode 100644 index 000000000000..92dc9bebdd55 --- /dev/null +++ b/boards/nordic/nrf52840gmouse/Kconfig.defconfig @@ -0,0 +1,22 @@ +# +# Copyright (c) 2018 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52840GMOUSE + +if IEEE802154 + +config IEEE802154_NRF5 + def_bool n + +endif # IEEE802154 + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52840GMOUSE diff --git a/boards/nordic/nrf52840gmouse/Kconfig.nrf52840gmouse b/boards/nordic/nrf52840gmouse/Kconfig.nrf52840gmouse new file mode 100644 index 000000000000..ac7d61cfe75b --- /dev/null +++ b/boards/nordic/nrf52840gmouse/Kconfig.nrf52840gmouse @@ -0,0 +1,5 @@ +# Copyright (c) 2018 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52840GMOUSE + select SOC_NRF52840_QIAA diff --git a/boards/arm/nrf52840gmouse_nrf52840/board.cmake b/boards/nordic/nrf52840gmouse/board.cmake similarity index 100% rename from boards/arm/nrf52840gmouse_nrf52840/board.cmake rename to boards/nordic/nrf52840gmouse/board.cmake diff --git a/boards/nordic/nrf52840gmouse/board.yml b/boards/nordic/nrf52840gmouse/board.yml new file mode 100644 index 000000000000..925f488dab03 --- /dev/null +++ b/boards/nordic/nrf52840gmouse/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52840gmouse + vendor: nordic + socs: + - name: nrf52840 diff --git a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840-pinctrl.dtsi b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840-pinctrl.dtsi rename to boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840-pinctrl.dtsi diff --git a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840.dts b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840.dts similarity index 100% rename from boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840.dts rename to boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840.dts diff --git a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840.yaml b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840.yaml similarity index 84% rename from boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840.yaml rename to boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840.yaml index 08011a52b10e..bd7aef53a221 100644 --- a/boards/arm/nrf52840gmouse_nrf52840/nrf52840gmouse_nrf52840.yaml +++ b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840.yaml @@ -1,4 +1,4 @@ -identifier: nrf52840gmouse_nrf52840 +identifier: nrf52840gmouse/nrf52840 name: nRF52840-GMouse-NRF52840 type: mcu arch: arm diff --git a/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840_defconfig b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840_defconfig new file mode 100644 index 000000000000..f9ec43c7c40b --- /dev/null +++ b/boards/nordic/nrf52840gmouse/nrf52840gmouse_nrf52840_defconfig @@ -0,0 +1,7 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable USB +CONFIG_USB_DEVICE_STACK=y + +CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52840gmouse_nrf52840/pre_dt_board.cmake b/boards/nordic/nrf52840gmouse/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52840gmouse_nrf52840/pre_dt_board.cmake rename to boards/nordic/nrf52840gmouse/pre_dt_board.cmake diff --git a/boards/arm/nrf52dmouse_nrf52832/Kconfig b/boards/nordic/nrf52dmouse/Kconfig similarity index 100% rename from boards/arm/nrf52dmouse_nrf52832/Kconfig rename to boards/nordic/nrf52dmouse/Kconfig diff --git a/boards/nordic/nrf52dmouse/Kconfig.defconfig b/boards/nordic/nrf52dmouse/Kconfig.defconfig new file mode 100644 index 000000000000..b4f411bf315c --- /dev/null +++ b/boards/nordic/nrf52dmouse/Kconfig.defconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2019 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52DMOUSE + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52DMOUSE diff --git a/boards/nordic/nrf52dmouse/Kconfig.nrf52dmouse b/boards/nordic/nrf52dmouse/Kconfig.nrf52dmouse new file mode 100644 index 000000000000..040375bc4b8c --- /dev/null +++ b/boards/nordic/nrf52dmouse/Kconfig.nrf52dmouse @@ -0,0 +1,5 @@ +# Copyright (c) 2019 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52DMOUSE + select SOC_NRF52832_QFAA diff --git a/boards/arm/nrf52dmouse_nrf52832/board.cmake b/boards/nordic/nrf52dmouse/board.cmake similarity index 100% rename from boards/arm/nrf52dmouse_nrf52832/board.cmake rename to boards/nordic/nrf52dmouse/board.cmake diff --git a/boards/nordic/nrf52dmouse/board.yml b/boards/nordic/nrf52dmouse/board.yml new file mode 100644 index 000000000000..bdf1c032b6df --- /dev/null +++ b/boards/nordic/nrf52dmouse/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52dmouse + vendor: nordic + socs: + - name: nrf52832 diff --git a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832-pinctrl.dtsi b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832-pinctrl.dtsi rename to boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832-pinctrl.dtsi diff --git a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832.dts b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832.dts similarity index 100% rename from boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832.dts rename to boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832.dts diff --git a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832.yaml b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832.yaml similarity index 82% rename from boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832.yaml rename to boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832.yaml index 3b61a95fb6a5..582330118450 100644 --- a/boards/arm/nrf52dmouse_nrf52832/nrf52dmouse_nrf52832.yaml +++ b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832.yaml @@ -1,4 +1,4 @@ -identifier: nrf52dmouse_nrf52832 +identifier: nrf52dmouse/nrf52832 name: nRF52-DMouse-NRF52832 type: mcu arch: arm diff --git a/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832_defconfig b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832_defconfig new file mode 100644 index 000000000000..69e328438fde --- /dev/null +++ b/boards/nordic/nrf52dmouse/nrf52dmouse_nrf52832_defconfig @@ -0,0 +1,4 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52dmouse_nrf52832/pre_dt_board.cmake b/boards/nordic/nrf52dmouse/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52dmouse_nrf52832/pre_dt_board.cmake rename to boards/nordic/nrf52dmouse/pre_dt_board.cmake diff --git a/boards/arm/nrf52kbd_nrf52832/Kconfig b/boards/nordic/nrf52kbd/Kconfig similarity index 100% rename from boards/arm/nrf52kbd_nrf52832/Kconfig rename to boards/nordic/nrf52kbd/Kconfig diff --git a/boards/nordic/nrf52kbd/Kconfig.defconfig b/boards/nordic/nrf52kbd/Kconfig.defconfig new file mode 100644 index 000000000000..e70306c6515d --- /dev/null +++ b/boards/nordic/nrf52kbd/Kconfig.defconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2019 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF52KBD + +config BT_CTLR + default BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_NRF52KBD diff --git a/boards/nordic/nrf52kbd/Kconfig.nrf52kbd b/boards/nordic/nrf52kbd/Kconfig.nrf52kbd new file mode 100644 index 000000000000..acfe4d315902 --- /dev/null +++ b/boards/nordic/nrf52kbd/Kconfig.nrf52kbd @@ -0,0 +1,5 @@ +# Copyright (c) 2019 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF52KBD + select SOC_NRF52832_QFAA diff --git a/boards/arm/nrf52kbd_nrf52832/board.cmake b/boards/nordic/nrf52kbd/board.cmake similarity index 100% rename from boards/arm/nrf52kbd_nrf52832/board.cmake rename to boards/nordic/nrf52kbd/board.cmake diff --git a/boards/nordic/nrf52kbd/board.yml b/boards/nordic/nrf52kbd/board.yml new file mode 100644 index 000000000000..4fee2480da8c --- /dev/null +++ b/boards/nordic/nrf52kbd/board.yml @@ -0,0 +1,5 @@ +board: + name: nrf52kbd + vendor: nordic + socs: + - name: nrf52832 diff --git a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832-pinctrl.dtsi b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832-pinctrl.dtsi rename to boards/nordic/nrf52kbd/nrf52kbd_nrf52832-pinctrl.dtsi diff --git a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832.dts b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832.dts similarity index 100% rename from boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832.dts rename to boards/nordic/nrf52kbd/nrf52kbd_nrf52832.dts diff --git a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832.yaml b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832.yaml similarity index 82% rename from boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832.yaml rename to boards/nordic/nrf52kbd/nrf52kbd_nrf52832.yaml index ccb38aa03bce..50ee2e880bba 100644 --- a/boards/arm/nrf52kbd_nrf52832/nrf52kbd_nrf52832.yaml +++ b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832.yaml @@ -1,4 +1,4 @@ -identifier: nrf52kbd_nrf52832 +identifier: nrf52kbd/nrf52832 name: nRF52-Kbd-NRF52832 type: mcu arch: arm diff --git a/boards/nordic/nrf52kbd/nrf52kbd_nrf52832_defconfig b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832_defconfig new file mode 100644 index 000000000000..69e328438fde --- /dev/null +++ b/boards/nordic/nrf52kbd/nrf52kbd_nrf52832_defconfig @@ -0,0 +1,4 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +CONFIG_PINCTRL=y diff --git a/boards/arm/nrf52kbd_nrf52832/pre_dt_board.cmake b/boards/nordic/nrf52kbd/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf52kbd_nrf52832/pre_dt_board.cmake rename to boards/nordic/nrf52kbd/pre_dt_board.cmake diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 000000000000..325ca1162bf3 --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA. +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if(CONFIG_BOARD_ENABLE_CPUNET) + if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) + elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS_NRF7001) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_nrf7001_reset.c) + endif() +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig new file mode 100644 index 000000000000..29ce79e43838 --- /dev/null +++ b/boards/nordic/nrf7002dk/Kconfig @@ -0,0 +1,89 @@ +# nRF5340 DK board configuration + +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config IPM_NRFX + default IPM + +config MBOX_NRFX_IPC + default MBOX + +if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS \ + || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config BOARD_ENABLE_DCDC_APP + bool "Enable Application MCU DCDC converter" + select SOC_DCDC_NRF53X_APP + default y + +config BOARD_ENABLE_DCDC_NET + bool "Enable Network MCU DCDC converter" + select SOC_DCDC_NRF53X_NET + default y + +config BOARD_ENABLE_DCDC_HV + bool "Enable High Voltage DCDC converter" + select SOC_DCDC_NRF53X_HV + default y + +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice + +config HEAP_MEM_POOL_SIZE + default 4096 if BT_HCI_IPC + +config BT_HCI_VS + default y if BT + +config BOARD_ENABLE_CPUNET + bool "Enable nRF53 Network MCU" + select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) + help + This option enables releasing the Network 'force off' signal, which + as a consequence will power up the Network MCU during system boot. + Additionally, the option allocates GPIO pins that will be used by UARTE + of the Network MCU. + Note: GPIO pin allocation can only be configured by the secure Application + MCU firmware, so when this option is used with the non-secure version of + the board, the application needs to take into consideration, that the + secure firmware image must already have configured GPIO allocation for the + Network MCU. + default y if (BT || NRF_802154_SER_HOST) + +config DOMAIN_CPUNET_BOARD + string + default "nrf7002dk/nrf5340/cpunet" if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS + default "nrf7002dk/nrf5340/cpunet/nrf7001" if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + depends on BOARD_ENABLE_CPUNET + help + The board which will be used for CPUNET domain when creating a multi + image application where one or more images should be located on + another board. For example hci_ipc on the nRF5340_cpunet for + Bluetooth applications. + +endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS +# || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BOARD_NRF7002DK_NRF5340_CPUNET || BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001 + +# BT_CTLR depends on BT. When BT is enabled we should default to also +# enabling the controller. +config BT_CTLR + default y if BT + +config BT_ECC + default y if BT + +config DOMAIN_CPUAPP_BOARD + string + default "nrf7002dk/nrf5340/cpuapp" if BOARD_NRF7002DK_NRF5340_CPUNET + default "nrf7002dk/nrf5340/cpuapp/nrf7001" if BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001 + help + The board which will be used for CPUAPP domain when creating a multi + image application where one or more images should be located on + another board. + +endif # BOARD_NRF7002DK_NRF5340_CPUNET || BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001 diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig new file mode 100644 index 000000000000..e8f2bb4b3cf4 --- /dev/null +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -0,0 +1,81 @@ +# nRF5340 DK nRF5340 board configuration + +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS \ + || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS + # Temporarily disable building Non-Secure images with TF-M support by + # default. + # default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + default n + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# 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. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && TRUSTED_EXECUTION_SECURE + +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) + +endif # (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && TRUSTED_EXECUTION_SECURE + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +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)) + +endif # BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS + +# Hidden (Internal use only) +config NRF70_2_4G_ONLY + bool + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS || BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001 diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk new file mode 100644 index 000000000000..670cb682f973 --- /dev/null +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_NRF7002DK + select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET \ + || BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001 + select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP \ + || BOARD_NRF7002DK_NRF5340_CPUAPP_NS \ + || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 \ + || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake new file mode 100644 index 000000000000..09f52c4933c7 --- /dev/null +++ b/boards/nordic/nrf7002dk/board.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS_NRF7001) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS + OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS_NRF7001) + board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") +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(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET_NRF7001) + board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml new file mode 100644 index 000000000000..336d914ceecf --- /dev/null +++ b/boards/nordic/nrf7002dk/board.yml @@ -0,0 +1,15 @@ +board: + name: nrf7002dk + vendor: nordic + socs: + - name: nrf5340 + variants: + - name: ns + cpucluster: cpuapp + # nRF7002 companion IC in nRF7001 emulation mode on nRF7002dk + - name: nrf7001 + cpucluster: cpuapp + variants: + - name: ns + - name: nrf7001 + cpucluster: cpunet diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common-pinctrl.dtsi rename to boards/nordic/nrf7002dk/nrf5340_cpuapp_common-pinctrl.dtsi diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts b/boards/nordic/nrf7002dk/nrf5340_cpuapp_common.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_common.dts rename to boards/nordic/nrf7002dk/nrf5340_cpuapp_common.dtsi diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts b/boards/nordic/nrf7002dk/nrf5340_cpuapp_nrf7001_common.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_common.dts rename to boards/nordic/nrf7002dk/nrf5340_cpuapp_nrf7001_common.dtsi diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_partition_conf.dts b/boards/nordic/nrf7002dk/nrf5340_cpuapp_nrf7001_partition_conf.dts similarity index 100% rename from boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_cpuapp_partition_conf.dts rename to boards/nordic/nrf7002dk/nrf5340_cpuapp_nrf7001_partition_conf.dts diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_partition_conf.dts b/boards/nordic/nrf7002dk/nrf5340_cpuapp_partition_conf.dts similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf5340_cpuapp_partition_conf.dts rename to boards/nordic/nrf7002dk/nrf5340_cpuapp_partition_conf.dts diff --git a/boards/nordic/nrf7002dk/nrf5340_cpunet_nrf7001_reset.c b/boards/nordic/nrf7002dk/nrf5340_cpunet_nrf7001_reset.c new file mode 100644 index 000000000000..32d093597aed --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf5340_cpunet_nrf7001_reset.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +LOG_MODULE_REGISTER(nrf7002dk_nrf5340_cpuapp_nrf7001, CONFIG_LOG_DEFAULT_LEVEL); + +#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) +#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h> +#endif + +static void remoteproc_mgr_config(void) +{ +#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) && \ + (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) + /* Route Bluetooth Controller Debug Pins */ + DEBUG_SETUP(); +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */ + +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) + /* Retain nRF5340 Network MCU in Secure domain (bus + * accesses by Network MCU will have Secure attribute set). + */ + NRF_SPU->EXTDOMAIN[0].PERM = BIT(4); +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ +} + +static int remoteproc_mgr_boot(void) +{ + + /* Secure domain may configure permissions for the Network MCU. */ + remoteproc_mgr_config(); + +#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) + /* + * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies + * building also a Non-Secure image. The Non-Secure image will, in + * this case do the remainder of actions to properly configure and + * boot the Network MCU. + */ + + /* Release the Network MCU, 'Release force off signal' */ + nrf_reset_network_force_off(NRF_RESET, false); + + LOG_DBG("Network MCU released."); +#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ + + return 0; +} + +SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_cpunet_reset.c b/boards/nordic/nrf7002dk/nrf5340_cpunet_reset.c similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf5340_cpunet_reset.c rename to boards/nordic/nrf7002dk/nrf5340_cpunet_reset.c diff --git a/boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_shared_sram_planning_conf.dts b/boards/nordic/nrf7002dk/nrf5340_nrf7001_shared_sram_planning_conf.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf7001_nrf5340/nrf5340_shared_sram_planning_conf.dts rename to boards/nordic/nrf7002dk/nrf5340_nrf7001_shared_sram_planning_conf.dtsi diff --git a/boards/arm/nrf7002dk_nrf5340/nrf5340_shared_sram_planning_conf.dts b/boards/nordic/nrf7002dk/nrf5340_shared_sram_planning_conf.dts similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf5340_shared_sram_planning_conf.dts rename to boards/nordic/nrf7002dk/nrf5340_shared_sram_planning_conf.dts diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts similarity index 96% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.dts rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts index 68053730b8c7..b61aa2a4a5fa 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts @@ -6,7 +6,7 @@ /dts-v1/; #include -#include "nrf5340_cpuapp_common.dts" +#include "nrf5340_cpuapp_common.dtsi" #include "nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi" / { diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.yaml similarity index 86% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.yaml rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.yaml index e1678d9b1e0d..d9f5e8d889aa 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.yaml +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.yaml @@ -1,4 +1,4 @@ -identifier: nrf7002dk_nrf5340_cpuapp +identifier: nrf7002dk/nrf5340/cpuapp name: NRF7002-DK-NRF5340-application-MCU type: mcu arch: arm diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig similarity index 77% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig index ceecf548ec57..31c4812463db 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.dts new file mode 100644 index 000000000000..1505d6181834 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.dts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_nrf7001_common.dtsi" +#include "nrf7002dk_nrf5340_cpuapp-pinctrl.dtsi" + +/ { + model = "Nordic NRF7002 DK (emulating NRF7001) NRF5340 Application"; + compatible = "nordic,nrf7002-dk-nrf5340-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; + zephyr,wifi = &nordic_wlan0; + }; + + nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { + status = "okay"; + compatible = "nordic,nrf700x-tx-power-ceiling"; + max-pwr-2g-dsss = <0x54>; + max-pwr-2g-mcs0 = <0x40>; + max-pwr-2g-mcs7 = <0x40>; + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.yaml new file mode 100644 index 000000000000..6c57c3064b72 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001 +name: NRF7002-DK-NRF7001-NRF5340-application-MCU +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 448 +flash: 1024 +supported: + - gpio + - i2c + - i2s + - pwm + - watchdog + - usb_cdc + - usb_device + - netif:openthread diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig new file mode 100644 index 000000000000..bc7bcbe657f0 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_defconfig @@ -0,0 +1,24 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# enable GPIO +CONFIG_GPIO=y + +# enable PINCTRL +CONFIG_PINCTRL=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 000000000000..9ab33f7e69f4 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_nrf7001_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,wifi = &nordic_wlan0; + }; + + nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { + status = "okay"; + compatible = "nordic,nrf700x-tx-power-ceiling"; + max-pwr-2g-dsss = <0x54>; + max-pwr-2g-mcs0 = <0x40>; + max-pwr-2g-mcs7 = <0x40>; + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 000000000000..1302d2be8ed0 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,18 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001_ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usb_cdc + - usb_device + - netif:openthread diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 000000000000..e37dfba0f6a7 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,27 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# enable PINCTRL +CONFIG_PINCTRL=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts similarity index 96% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.dts rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts index 8df0cc50531f..6b7662694153 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.dts +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -6,7 +6,7 @@ /dts-v1/; #include -#include "nrf5340_cpuapp_common.dts" +#include "nrf5340_cpuapp_common.dtsi" / { model = "Nordic NRF5340 DK NRF5340 Application"; diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml similarity index 85% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.yaml rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml index d0f59bd41e09..e6c1afd8546b 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns.yaml +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -1,4 +1,4 @@ -identifier: nrf7002dk_nrf5340_cpuapp_ns +identifier: nrf7002dk/nrf5340/cpuapp/ns name: NRF7002-DK-NRF5340-application-MCU-Non-Secure type: mcu arch: arm diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig similarity index 81% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns_defconfig rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig index 49489d26ed56..f3e5e3ab9cd9 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_ns_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet-pinctrl.dtsi b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet-pinctrl.dtsi similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet-pinctrl.dtsi rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet-pinctrl.dtsi diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.dts rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.dts diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.yaml similarity index 80% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.yaml rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.yaml index a88bd90e03ad..c048c452bce5 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet.yaml +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet.yaml @@ -1,4 +1,4 @@ -identifier: nrf7002dk_nrf5340_cpunet +identifier: nrf7002dk/nrf5340/cpunet name: NRF7002-DK-NRF5340-network-MCU type: mcu arch: arm diff --git a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig similarity index 75% rename from boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet_defconfig rename to boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig index a08a8c71b293..c7d468fb82d1 100644 --- a/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpunet_defconfig +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUNET_QKAA=y -CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.dts new file mode 100644 index 000000000000..21cf1efcb56a --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.dts @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/dts-v1/; +#include +#include "nrf7002dk_nrf5340_cpunet-pinctrl.dtsi" + +/ { + model = "Nordic NRF7002 DK (emulating NRF7001) NRF5340 Network"; + compatible = "nordic,nrf7002-dk-nrf5340-cpunet"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,uart-mcumgr = &uart0; + zephyr,bt-mon-uart = &uart0; + zephyr,bt-c2h-uart = &uart0; + zephyr,bt-hci-ipc = &ipc0; + nordic,802154-spinel-ipc = &ipc0; + zephyr,sram = &sram1; + zephyr,flash = &flash1; + zephyr,code-partition = &slot0_partition; + }; + + leds { + compatible = "gpio-leds"; + led0: led_0 { + gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + led1: led_1 { + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + }; + + buttons { + compatible = "gpio-keys"; + button0: button_0 { + gpios = <&gpio1 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 1"; + }; + button1: button_1 { + gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + label = "Push button 2"; + }; + }; + + arduino_header: connector { + compatible = "arduino-header-r3"; + #gpio-cells = <2>; + gpio-map-mask = <0xffffffff 0xffffffc0>; + gpio-map-pass-thru = <0 0x3f>; + gpio-map = <0 0 &gpio0 4 0>, /* A0 */ + <1 0 &gpio0 5 0>, /* A1 */ + <2 0 &gpio0 6 0>, /* A2 */ + <3 0 &gpio0 7 0>, /* A3 */ + <4 0 &gpio0 25 0>, /* A4 */ + <5 0 &gpio0 26 0>, /* A5 */ + <6 0 &gpio1 0 0>, /* D0 */ + <7 0 &gpio1 1 0>, /* D1 */ + <8 0 &gpio1 4 0>, /* D2 */ + <9 0 &gpio1 5 0>, /* D3 */ + <10 0 &gpio1 6 0>, /* D4 */ + <11 0 &gpio1 7 0>, /* D5 */ + <12 0 &gpio1 8 0>, /* D6 */ + <13 0 &gpio1 9 0>, /* D7 */ + <14 0 &gpio1 10 0>, /* D8 */ + <15 0 &gpio1 11 0>, /* D9 */ + <16 0 &gpio1 12 0>, /* D10 */ + <17 0 &gpio1 13 0>, /* D11 */ + <18 0 &gpio1 14 0>, /* D12 */ + <19 0 &gpio1 15 0>, /* D13 */ + <20 0 &gpio1 2 0>, /* D14 */ + <21 0 &gpio1 3 0>; /* D15 */ + }; + + nrf_radio_coex: nrf7001-coex { + status = "okay"; + compatible = "nordic,nrf700x-coex"; + req-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + status0-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; + grant-gpios = <&gpio0 24 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; + swctrl1-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led0; + led1 = &led1; + sw0 = &button0; + sw1 = &button1; + bootloader-led0 = &led0; + }; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; +}; + +arduino_serial: &uart0{}; + +arduino_i2c: &i2c0 { + compatible = "nordic,nrf-twim"; + /* Cannot be used together with uart0. */ + /* status = "okay"; */ + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; +}; + +arduino_spi: &spi0 { + compatible = "nordic,nrf-spim"; + /* Cannot be used together with uart0. */ + /* status = "okay"; */ + cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&flash1 { + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0xc000>; + }; + slot0_partition: partition@c000 { + label = "image-0"; + reg = <0x0000C000 0x12000>; + }; + slot1_partition: partition@1e000 { + label = "image-1"; + reg = <0x0001E000 0x12000>; + }; + scratch_partition: partition@30000 { + label = "image-scratch"; + reg = <0x00030000 0xa000>; + }; + storage_partition: partition@3a000 { + label = "storage"; + reg = <0x0003a000 0x6000>; + }; + }; +}; + +/* Include shared RAM configuration file */ +#include "nrf5340_nrf7001_shared_sram_planning_conf.dtsi" diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.yaml new file mode 100644 index 000000000000..aab6e826591e --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001.yaml @@ -0,0 +1,13 @@ +identifier: nrf7002dk/nrf5340/cpunet/nrf7001 +name: NRF7002-DK-NRF7001-NRF5340-network-MCU +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 64 +flash: 256 +supported: + - gpio + - watchdog diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001_defconfig new file mode 100644 index 000000000000..9d05078d7af7 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpunet_nrf7001_defconfig @@ -0,0 +1,21 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# enable GPIO +CONFIG_GPIO=y + +# enable PINCTRL +CONFIG_PINCTRL=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/arm/nrf7002dk_nrf5340/pre_dt_board.cmake b/boards/nordic/nrf7002dk/pre_dt_board.cmake similarity index 100% rename from boards/arm/nrf7002dk_nrf5340/pre_dt_board.cmake rename to boards/nordic/nrf7002dk/pre_dt_board.cmake diff --git a/boards/arm/thingy91_nrf9160/CMakeLists.txt b/boards/nordic/thingy91/CMakeLists.txt similarity index 100% rename from boards/arm/thingy91_nrf9160/CMakeLists.txt rename to boards/nordic/thingy91/CMakeLists.txt diff --git a/boards/nordic/thingy91/Kconfig b/boards/nordic/thingy91/Kconfig new file mode 100644 index 000000000000..35bdd0ecdaff --- /dev/null +++ b/boards/nordic/thingy91/Kconfig @@ -0,0 +1,73 @@ +# Thingy:91 nRF52840 board configuration +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if BOARD_THINGY91_NRF52840 + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + +endif # BOARD_THINGY91_NRF52840 + +if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS + +config BOARD_INIT_PRIORITY + int "Initialization priority for board configuration" + default 80 + help + The Thingy:91 board contains an ADP5360 PMIC that needs to be configured to + set up the power domains on the board correctly. This happens during sys_init, + and the PMIC setup must happen before the sensors are initialized in order + to power them up in time. + +if BOARD_THINGY91_NRF9160_NS + +choice + prompt "Pre-defined Thingy:91 partition layout" + default THINGY91_STATIC_PARTITIONS_SECURE_BOOT if SECURE_BOOT + default THINGY91_STATIC_PARTITIONS_LWM2M_CARRIER if LWM2M_CARRIER + default THINGY91_STATIC_PARTITIONS_FACTORY + +config THINGY91_STATIC_PARTITIONS_FACTORY + bool "Factory Thingy:91 partition layout" + help + The default Thingy:91 partition layout used in the factory firmware. This ensures + firmware updates are compatible with Thingy:91 when flashing firmware over USB or over + the air. + +config THINGY91_STATIC_PARTITIONS_SECURE_BOOT + bool "Secure boot Thingy:91 partition layout [EXPERIMENTAL]" + depends on SECURE_BOOT + select EXPERIMENTAL + help + Similar to the factory partition layout, but also has space for the Immutable Bootloader + and two MCUboot slots. A debugger is needed to flash Thingy:91 the first time. + This layout is still under development and should not be used in production. + +config THINGY91_STATIC_PARTITIONS_LWM2M_CARRIER + bool "LWM2M Carrier partition layout" + depends on LWM2M_CARRIER + help + Use a partition layout including a storage partition needed for the lwm2m carrier library. + +config THINGY91_NO_PREDEFINED_LAYOUT + bool "None [EXPERIMENTAL]" + select EXPERIMENTAL + help + Disable pre-defined static partition layout. This allows the application to use a dynamic + layout or define a custom static partition layout for the application. A debugger is + needed to flash Thingy:91 with a different partition layout. + +endchoice +endif # if BOARD_THINGY91_NRF9160_NS + +endif # BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS + +module=BOARD +module-dep=LOG +module-str=Log level for board +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/boards/nordic/thingy91/Kconfig.defconfig b/boards/nordic/thingy91/Kconfig.defconfig new file mode 100644 index 000000000000..725c6e08be7d --- /dev/null +++ b/boards/nordic/thingy91/Kconfig.defconfig @@ -0,0 +1,66 @@ +# nRF52840 THINGY91 board configuration +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if BOARD_THINGY91 + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +endif # BOARD_THINGY91 + +if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS + +# Enable Zephyr power regulator ADP536x +config REGULATOR + default y + depends on !IS_BOOTLOADER_IMG + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_THINGY91_NRF9160_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# 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. + +if BOARD_THINGY91_NRF9160 && TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_THINGY91_NRF9160 && TRUSTED_EXECUTION_SECURE + +if BOARD_THINGY91_NRF9160_NS + +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)) + +endif # BOARD_THINGY91_NRF9160_NS + +config BT_HCI_VS + default y if BT + +endif # BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS diff --git a/boards/nordic/thingy91/Kconfig.thingy91 b/boards/nordic/thingy91/Kconfig.thingy91 new file mode 100644 index 000000000000..30dd48afbd6a --- /dev/null +++ b/boards/nordic/thingy91/Kconfig.thingy91 @@ -0,0 +1,6 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_THINGY91 + select SOC_NRF52840_QIAA if BOARD_THINGY91_NRF52840 + select SOC_NRF9160_SICA if BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS diff --git a/boards/arm/thingy91_nrf9160/adp5360_init.c b/boards/nordic/thingy91/adp5360_init.c similarity index 100% rename from boards/arm/thingy91_nrf9160/adp5360_init.c rename to boards/nordic/thingy91/adp5360_init.c diff --git a/boards/nordic/thingy91/board.cmake b/boards/nordic/thingy91/board.cmake new file mode 100644 index 000000000000..153e624bf782 --- /dev/null +++ b/boards/nordic/thingy91/board.cmake @@ -0,0 +1,12 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA. +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if(CONFIG_BOARD_THINGY91_NRF9160 OR CONFIG_BOARD_THINGY91_NRF9160_NS) + board_runner_args(nrfjprog "--softreset") + board_runner_args(jlink "--device=cortex-m33" "--speed=4000") +elseif(CONFIG_BOARD_THINGY91_NRF52840) + board_runner_args(jlink "--device=nrf52" "--speed=4000") +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/thingy91/board.yml b/boards/nordic/thingy91/board.yml new file mode 100644 index 000000000000..be8762b60474 --- /dev/null +++ b/boards/nordic/thingy91/board.yml @@ -0,0 +1,8 @@ +board: + name: thingy91 + vendor: nordic + socs: + - name: nrf52840 + - name: nrf9160 + variants: + - name: ns diff --git a/boards/arm/thingy91_nrf9160/dts/bindings/nordic,thingy91-nrf52840-reset.yaml b/boards/nordic/thingy91/dts/bindings/nordic,thingy91-nrf52840-reset.yaml similarity index 86% rename from boards/arm/thingy91_nrf9160/dts/bindings/nordic,thingy91-nrf52840-reset.yaml rename to boards/nordic/thingy91/dts/bindings/nordic,thingy91-nrf52840-reset.yaml index d435e25a1257..a7eced0c4081 100644 --- a/boards/arm/thingy91_nrf9160/dts/bindings/nordic,thingy91-nrf52840-reset.yaml +++ b/boards/nordic/thingy91/dts/bindings/nordic,thingy91-nrf52840-reset.yaml @@ -1,5 +1,5 @@ # Copyright (c) 2021 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause description: GPIO used to reset nRF52840 on Thingy:91 diff --git a/boards/arm/thingy91_nrf9160/nrf52840_reset.c b/boards/nordic/thingy91/nrf52840_reset.c similarity index 96% rename from boards/arm/thingy91_nrf9160/nrf52840_reset.c rename to boards/nordic/thingy91/nrf52840_reset.c index 9432abfba957..3d59605b2b51 100644 --- a/boards/arm/thingy91_nrf9160/nrf52840_reset.c +++ b/boards/nordic/thingy91/nrf52840_reset.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2019 Nordic Semiconductor ASA. * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include diff --git a/boards/nordic/thingy91/pre_dt_board.cmake b/boards/nordic/thingy91/pre_dt_board.cmake new file mode 100644 index 000000000000..ac28a73830b5 --- /dev/null +++ b/boards/nordic/thingy91/pre_dt_board.cmake @@ -0,0 +1,4 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/boards/arm/thingy91_nrf52840/thingy91_nrf52840-pinctrl.dtsi b/boards/nordic/thingy91/thingy91_nrf52840-pinctrl.dtsi similarity index 100% rename from boards/arm/thingy91_nrf52840/thingy91_nrf52840-pinctrl.dtsi rename to boards/nordic/thingy91/thingy91_nrf52840-pinctrl.dtsi diff --git a/boards/arm/thingy91_nrf52840/thingy91_nrf52840.dts b/boards/nordic/thingy91/thingy91_nrf52840.dts similarity index 100% rename from boards/arm/thingy91_nrf52840/thingy91_nrf52840.dts rename to boards/nordic/thingy91/thingy91_nrf52840.dts diff --git a/boards/arm/thingy91_nrf52840/thingy91_nrf52840.yaml b/boards/nordic/thingy91/thingy91_nrf52840.yaml similarity index 86% rename from boards/arm/thingy91_nrf52840/thingy91_nrf52840.yaml rename to boards/nordic/thingy91/thingy91_nrf52840.yaml index d6b8e30582b6..5af224dff265 100644 --- a/boards/arm/thingy91_nrf52840/thingy91_nrf52840.yaml +++ b/boards/nordic/thingy91/thingy91_nrf52840.yaml @@ -1,4 +1,4 @@ -identifier: thingy91_nrf52840 +identifier: thingy91/nrf52840 name: Thingy91-NRF52840 type: mcu arch: arm diff --git a/boards/nordic/thingy91/thingy91_nrf52840_defconfig b/boards/nordic/thingy91/thingy91_nrf52840_defconfig new file mode 100644 index 000000000000..a21adb47660d --- /dev/null +++ b/boards/nordic/thingy91/thingy91_nrf52840_defconfig @@ -0,0 +1,16 @@ +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable PINCTRL +CONFIG_PINCTRL=y + +# enable uart driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y + +# Enable USB +CONFIG_USB_DEVICE_STACK=y + +CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160.dts b/boards/nordic/thingy91/thingy91_nrf9160.dts similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160.dts rename to boards/nordic/thingy91/thingy91_nrf9160.dts diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160.yaml b/boards/nordic/thingy91/thingy91_nrf9160.yaml similarity index 81% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160.yaml rename to boards/nordic/thingy91/thingy91_nrf9160.yaml index 1777e365e7d3..6013b4a193f5 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160.yaml +++ b/boards/nordic/thingy91/thingy91_nrf9160.yaml @@ -1,4 +1,4 @@ -identifier: thingy91_nrf9160 +identifier: thingy91/nrf9160 name: Thingy91-NRF9160 type: mcu arch: arm diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_common-pinctrl.dtsi b/boards/nordic/thingy91/thingy91_nrf9160_common-pinctrl.dtsi similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_common-pinctrl.dtsi rename to boards/nordic/thingy91/thingy91_nrf9160_common-pinctrl.dtsi diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_common.dts b/boards/nordic/thingy91/thingy91_nrf9160_common.dts similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_common.dts rename to boards/nordic/thingy91/thingy91_nrf9160_common.dts diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig b/boards/nordic/thingy91/thingy91_nrf9160_defconfig similarity index 78% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig rename to boards/nordic/thingy91/thingy91_nrf9160_defconfig index a00903ba4bae..3b7d46a3a753 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_defconfig +++ b/boards/nordic/thingy91/thingy91_nrf9160_defconfig @@ -1,7 +1,3 @@ -CONFIG_SOC_SERIES_NRF91X=y -CONFIG_SOC_NRF9160_SICA=y -CONFIG_BOARD_THINGY91_NRF9160=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.dts b/boards/nordic/thingy91/thingy91_nrf9160_ns.dts similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.dts rename to boards/nordic/thingy91/thingy91_nrf9160_ns.dts diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.yaml b/boards/nordic/thingy91/thingy91_nrf9160_ns.yaml similarity index 82% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.yaml rename to boards/nordic/thingy91/thingy91_nrf9160_ns.yaml index 912adc846969..0427131e1ac6 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.yaml +++ b/boards/nordic/thingy91/thingy91_nrf9160_ns.yaml @@ -1,4 +1,4 @@ -identifier: thingy91_nrf9160_ns +identifier: thingy91/nrf9160/ns name: THINGY91-nRF9160-Non-Secure type: mcu arch: arm diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig b/boards/nordic/thingy91/thingy91_nrf9160_ns_defconfig similarity index 83% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig rename to boards/nordic/thingy91/thingy91_nrf9160_ns_defconfig index ab3363ea925e..906dbdbd39d3 100644 --- a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig +++ b/boards/nordic/thingy91/thingy91_nrf9160_ns_defconfig @@ -1,7 +1,3 @@ -CONFIG_SOC_SERIES_NRF91X=y -CONFIG_SOC_NRF9160_SICA=y -CONFIG_BOARD_THINGY91_NRF9160_NS=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91_nrf9160/thingy91_nrf9160_partition_conf.dts b/boards/nordic/thingy91/thingy91_nrf9160_partition_conf.dts similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_nrf9160_partition_conf.dts rename to boards/nordic/thingy91/thingy91_nrf9160_partition_conf.dts diff --git a/boards/arm/thingy91_nrf9160/thingy91_pm_static.yml b/boards/nordic/thingy91/thingy91_pm_static.yml similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_pm_static.yml rename to boards/nordic/thingy91/thingy91_pm_static.yml diff --git a/boards/arm/thingy91_nrf9160/thingy91_pm_static_lwm2m_carrier.yml b/boards/nordic/thingy91/thingy91_pm_static_lwm2m_carrier.yml similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_pm_static_lwm2m_carrier.yml rename to boards/nordic/thingy91/thingy91_pm_static_lwm2m_carrier.yml diff --git a/boards/arm/thingy91_nrf9160/thingy91_pm_static_secure_boot.yml b/boards/nordic/thingy91/thingy91_pm_static_secure_boot.yml similarity index 100% rename from boards/arm/thingy91_nrf9160/thingy91_pm_static_secure_boot.yml rename to boards/nordic/thingy91/thingy91_pm_static_secure_boot.yml diff --git a/boards/nordic/thingy91x/CMakeLists.txt b/boards/nordic/thingy91x/CMakeLists.txt new file mode 100644 index 000000000000..68b6eabdc4ce --- /dev/null +++ b/boards/nordic/thingy91x/CMakeLists.txt @@ -0,0 +1,22 @@ +# Kconfig - nRF91 Thingy:91 X board configuration +# +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if(CONFIG_BOARD_THINGY91X_NRF9151 OR CONFIG_BOARD_THINGY91X_NRF9151_NS) + zephyr_library() + zephyr_library_sources_ifdef(CONFIG_WIFI_NRF700X nrf70_support.c) +endif() + +if(CONFIG_BOARD_THINGY91X_NRF9151_NS) + # Use static partition layout to ensure the partition layout remains + # unchanged after DFU. This needs to be made globally available + # because it is used in other CMake files. + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_pm_static.yml CACHE INTERNAL "") +endif() + +if(CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP OR CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS) + zephyr_library() + zephyr_library_sources_ifdef(CONFIG_BOARD_ENABLE_CPUNET nrf5340_cpunet_reset.c) + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static.yml CACHE INTERNAL "") +endif() diff --git a/boards/nordic/thingy91x/Kconfig b/boards/nordic/thingy91x/Kconfig new file mode 100644 index 000000000000..e9804d350b96 --- /dev/null +++ b/boards/nordic/thingy91x/Kconfig @@ -0,0 +1,67 @@ +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +module=BOARD +module-dep=LOG +module-str=Log level for board +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config BOARD_ENABLE_DCDC_APP + bool "Application MCU DCDC converter" + select SOC_DCDC_NRF53X_APP + default y + +config BOARD_ENABLE_DCDC_NET + bool "Network MCU DCDC converter" + select SOC_DCDC_NRF53X_NET + default y + +config BOARD_ENABLE_CPUNET + bool "Enable nRF53 Network MCU" + select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \ + $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER)) + help + This option enables releasing the Network 'force off' signal, which + as a consequence will power up the Network MCU during system boot. + Additionally, the option allocates GPIO pins that will be used by UARTE + of the Network MCU. + Note: GPIO pin allocation can only be configured by the secure Application + MCU firmware, so when this option is used with the non-secure version of + the board, the application needs to take into consideration, that the + secure firmware image must already have configured GPIO allocation for the + Network MCU. + default y + +config DOMAIN_CPUNET_BOARD + string + default "thingy91x/nrf5340/cpunet" + depends on BOARD_ENABLE_CPUNET + help + The board which will be used for CPUNET domain when creating a multi + image application where one or more images should be located on + another board. For example hci_rpmsg on the nRF5340_cpunet for + Bluetooth applications. + +endif + +if BOARD_THINGY91X_NRF5340_CPUNET + +# BT_CTLR depends on BT. When BT is enabled we should default to also +# enabling the controller. +config BT_CTLR + default y if BT + +config BT_ECC + default y if BT + +config DOMAIN_CPUAPP_BOARD + string + default "thingy91x/nrf5340/cpuapp" + help + The board which will be used for CPUAPP domain when creating a multi + image application where one or more images should be located on + another board. + +endif # BOARD_THINGY91X_NRF5340_CPUNET diff --git a/boards/nordic/thingy91x/Kconfig.defconfig b/boards/nordic/thingy91x/Kconfig.defconfig new file mode 100644 index 000000000000..7819c95b19ec --- /dev/null +++ b/boards/nordic/thingy91x/Kconfig.defconfig @@ -0,0 +1,7 @@ +# Thingy:91 X board configuration +# +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +rsource "Kconfig.defconfig.nrf9151" +rsource "Kconfig.defconfig.nrf5340" diff --git a/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 b/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 new file mode 100644 index 000000000000..6c548d9dd799 --- /dev/null +++ b/boards/nordic/thingy91x/Kconfig.defconfig.nrf5340 @@ -0,0 +1,112 @@ +# Thingy:91 X nRF5340 board configuration + +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_THINGY91X_NRF5340_CPUAPP_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# 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. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if BOARD_THINGY91X_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE + +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) + +endif # BOARD_THINGY91X_NRF5340_CPUAPP && TRUSTED_EXECUTION_SECURE + +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)) + +choice BT_HCI_BUS_TYPE + default BT_HCI_IPC if BT +endchoice + +config HEAP_MEM_POOL_SIZE + default 4096 if BT_HCI_IPC + +endif # BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config MBOX_NRFX_IPC + default MBOX + +if BOARD_THINGY91X_NRF5340_CPUNET + +config BT_CTLR + default y if BT + +endif # BOARD_THINGY91X_NRF5340_CPUNET + +config USE_SEGGER_RTT + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET + +config RTT_CONSOLE + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET + +if !IS_BOOTLOADER_IMG + +config SECURE_BOOT + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET + +config BOOTLOADER_MCUBOOT + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config NRF53_UPGRADE_NETWORK_CORE + default y if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config UPDATEABLE_IMAGE_NUMBER + default 2 if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS + +config SB_SIGNING_KEY_FILE + default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key_nrf5340.pem" if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS || BOARD_THINGY91X_NRF5340_CPUNET + +endif # !IS_BOOTLOADER_IMG diff --git a/boards/nordic/thingy91x/Kconfig.defconfig.nrf9151 b/boards/nordic/thingy91x/Kconfig.defconfig.nrf9151 new file mode 100644 index 000000000000..a10b24e3e8f5 --- /dev/null +++ b/boards/nordic/thingy91x/Kconfig.defconfig.nrf9151 @@ -0,0 +1,122 @@ +# Thingy:91 X nRF9151 board configuration +# +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS + +DT_COMPAT_NORDIC_NRF700X_SPI := nordic,nrf700x-spi +config NRF7002_ON_SPI + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI)) + +# By default, if we build for a Non-Secure version of the board, +# enable building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_THINGY91X_NRF9151_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +config PM_PARTITION_SIZE_TFM_SRAM + hex + default 0xa000 + +endif # BUILD_WITH_TFM + +# 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. + +if BOARD_THINGY91X && TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif # BOARD_THINGY91X && TRUSTED_EXECUTION_SECURE + +if BOARD_THINGY91X_NRF9151_NS + +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)) + +endif # BOARD_THINGY91X_NRF9151_NS + +config BT_HCI_VS + default y if BT + +config HW_STACK_PROTECTION + default ARCH_HAS_STACK_PROTECTION + +# check if we are building for any bootloader +if !IS_BOOTLOADER_IMG + +config SECURE_BOOT + default y + +config BOOTLOADER_MCUBOOT + default y + +# Do not use these keys for own custom boards! +# These are meant as examples and therefore public. +# The documentation of the nRF Secure Immutable Bootloader and MCUBoot detail on how +# to set up your own keys. + +config SB_SIGNING_KEY_FILE + default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key.pem" + +config I2C + default y + +config MODEM_ANTENNA + depends on NRF_MODEM_LIB + default y + +if MODEM_ANTENNA + +config MODEM_ANTENNA_AT_MIPIRFFEDEV + default "AT%XMIPIRFFEDEV=1,4,71,198,248" +config MODEM_ANTENNA_AT_MIPIRFFECTRL_INIT + default "AT%XMIPIRFFECTRL=1,0,1,28,248" +config MODEM_ANTENNA_AT_MIPIRFFECTRL_ON + default "AT%XMIPIRFFECTRL=1,1,1,28,56,13,0,0,8,8,715,4,4,770,12,12,829,11,11,863,130,130,892,1,1,939,129,129,978,26,26,1042,8,8,1118,4,4,1270,12,12,1386,14,14,1523,130,130,2200" +config MODEM_ANTENNA_AT_MIPIRFFECTRL_OFF + default "AT%XMIPIRFFECTRL=1,2,1,28,184" +config MODEM_ANTENNA_AT_MIPIRFFECTRL_PWROFF + default "AT%XMIPIRFFECTRL=1,3,1,28,184" +config MODEM_ANTENNA_AT_COEX0 + default "AT\%XCOEX0=1,1,1565,1586" + +endif # MODEM_ANTENNA + +# For on-board regulators +config REGULATOR + default y + +# nPM6001 must be initialized after it is powered from nPM1300 (REGULATOR_NPM1300_INIT_PRIORITY) +config MFD_NPM6001_INIT_PRIORITY + default 87 +config REGULATOR_NPM6001_INIT_PRIORITY + default 88 +config WIFI_INIT_PRIORITY + default 89 + +# GPIO hogs must be initialized after nPM1300 (GPIO_NPM1300_INIT_PRIORITY) +config GPIO_HOGS_INIT_PRIORITY + default 86 + +endif # !IS_BOOTLOADER_IMG +endif # BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS diff --git a/boards/nordic/thingy91x/Kconfig.thingy91x b/boards/nordic/thingy91x/Kconfig.thingy91x new file mode 100644 index 000000000000..b31ec5688557 --- /dev/null +++ b/boards/nordic/thingy91x/Kconfig.thingy91x @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +config BOARD_THINGY91X + select SOC_NRF9151_LACA if BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS + select SOC_NRF5340_CPUNET_QKAA if BOARD_THINGY91X_NRF5340_CPUNET + select SOC_NRF5340_CPUAPP_QKAA if BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS diff --git a/boards/nordic/thingy91x/board.cmake b/boards/nordic/thingy91x/board.cmake new file mode 100644 index 000000000000..8bfad3000868 --- /dev/null +++ b/boards/nordic/thingy91x/board.cmake @@ -0,0 +1,17 @@ +# Copyright (c) 2024 Nordic Semiconductor +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +if(CONFIG_BOARD_THINGY91X_NRF9151 OR CONFIG_BOARD_THINGY91X_NRF9151_NS) + board_runner_args(nrfjprog "--nrf-family=NRF91") + board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000") +elseif(BOARD_THINGY91X_NRF5340_CPUAPP OR BOARD_THINGY91X_NRF5340_CPUAPP_NS) + board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") + board_runner_args(nrfjprog "--nrf-family=NRF53") +elseif(BOARD_THINGY91X_NRF5340_CPUNET) + board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") + board_runner_args(nrfjprog "--nrf-family=NRF53") +endif() + +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/nordic/thingy91x/board.yml b/boards/nordic/thingy91x/board.yml new file mode 100644 index 000000000000..f870c3e82df5 --- /dev/null +++ b/boards/nordic/thingy91x/board.yml @@ -0,0 +1,11 @@ +board: + name: thingy91x + vendor: nordic + socs: + - name: nrf9151 + variants: + - name: ns + - name: nrf5340 + variants: + - name: ns + cpucluster: 'cpuapp' diff --git a/boards/arm/thingy91x_nrf9151/dts/thingy91x_wifi.dtsi b/boards/nordic/thingy91x/dts/thingy91x_wifi.dtsi similarity index 100% rename from boards/arm/thingy91x_nrf9151/dts/thingy91x_wifi.dtsi rename to boards/nordic/thingy91x/dts/thingy91x_wifi.dtsi diff --git a/boards/nordic/thingy91x/nrf5340_cpunet_reset.c b/boards/nordic/thingy91x/nrf5340_cpunet_reset.c new file mode 100644 index 000000000000..a79579f16e67 --- /dev/null +++ b/boards/nordic/thingy91x/nrf5340_cpunet_reset.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +LOG_MODULE_REGISTER(thingy91x_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); + +#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) +#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h> +#endif + +static void remoteproc_mgr_config(void) +{ +#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) && \ + (!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM)) + /* Route Bluetooth Controller Debug Pins */ + DEBUG_SETUP(); +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */ + +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) + /* Retain nRF5340 Network MCU in Secure domain (bus + * accesses by Network MCU will have Secure attribute set). + */ + NRF_SPU->EXTDOMAIN[0].PERM = BIT(4); +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ +} + +static int remoteproc_mgr_boot(void) +{ + + /* Secure domain may configure permissions for the Network MCU. */ + remoteproc_mgr_config(); + +#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) + /* + * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies + * building also a Non-Secure image. The Non-Secure image will, in + * this case do the remainder of actions to properly configure and + * boot the Network MCU. + */ + + /* Release the Network MCU, 'Release force off signal' */ + nrf_reset_network_force_off(NRF_RESET, false); + + LOG_DBG("Network MCU released."); +#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ + + return 0; +} + +SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/thingy91x_nrf5340/nrf5340_shared_sram_planning_conf.dts b/boards/nordic/thingy91x/nrf5340_shared_sram_planning_conf.dts similarity index 100% rename from boards/arm/thingy91x_nrf5340/nrf5340_shared_sram_planning_conf.dts rename to boards/nordic/thingy91x/nrf5340_shared_sram_planning_conf.dts diff --git a/boards/nordic/thingy91x/nrf70_support.c b/boards/nordic/thingy91x/nrf70_support.c new file mode 100644 index 000000000000..beac6f7f0610 --- /dev/null +++ b/boards/nordic/thingy91x/nrf70_support.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(thingy91x_board, CONFIG_BOARD_LOG_LEVEL); + +static const struct device *wifi_regulator = DEVICE_DT_GET(DT_NODELABEL(reg_wifi)); + +static const struct gpio_dt_spec ldsw_rf_fe_sr_en = { + .port = DEVICE_DT_GET(DT_PARENT(DT_NODELABEL(ldsw_rf_fe_sr_en))), + .pin = 1, + .dt_flags = GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN | GPIO_PULL_UP, +}; + +/* Enable the regulator and set the GPIO pin to enable the RF frontend */ +int nrf_wifi_if_zep_start_board(const struct device *dev) +{ + ARG_UNUSED(dev); + int ret; + + ret = regulator_enable(wifi_regulator); + if (ret) { + LOG_ERR("Cannot turn on regulator %s (%d)", wifi_regulator->name, ret); + return ret; + } + ret = regulator_set_mode(wifi_regulator, NPM6001_MODE_PWM); + if (ret) { + LOG_ERR("Cannot set mode for regulator %s (%d)", wifi_regulator->name, ret); + return ret; + } + + ret = gpio_pin_set_dt(&ldsw_rf_fe_sr_en, 1); + if (ret) { + LOG_ERR("Cannot set GPIO %s (%d)", ldsw_rf_fe_sr_en.port->name, ret); + return ret; + } + + /* Wait for the load switch to settle on operating voltage. */ + k_sleep(K_USEC(300)); + + return 0; +} + +/* Disable the regulator and set the GPIO pin to disable the RF frontend */ +int nrf_wifi_if_zep_stop_board(const struct device *dev) +{ + ARG_UNUSED(dev); + int ret; + + ret = regulator_disable(wifi_regulator); + if (ret) { + LOG_ERR("Cannot turn off regulator %s (%d)", wifi_regulator->name, ret); + return ret; + } + + ret = gpio_pin_set_dt(&ldsw_rf_fe_sr_en, 0); + if (ret) { + LOG_ERR("Cannot set GPIO %s (%d)", ldsw_rf_fe_sr_en.port->name, ret); + return ret; + } + + return 0; +} diff --git a/boards/arm/thingy91x_nrf9151/nsib_signing_key.pem b/boards/nordic/thingy91x/nsib_signing_key.pem similarity index 100% rename from boards/arm/thingy91x_nrf9151/nsib_signing_key.pem rename to boards/nordic/thingy91x/nsib_signing_key.pem diff --git a/boards/arm/thingy91x_nrf5340/nsib_signing_key.pem b/boards/nordic/thingy91x/nsib_signing_key_nrf5340.pem similarity index 100% rename from boards/arm/thingy91x_nrf5340/nsib_signing_key.pem rename to boards/nordic/thingy91x/nsib_signing_key_nrf5340.pem diff --git a/boards/arm/thingy91x_nrf5340/pre_dt_board.cmake b/boards/nordic/thingy91x/pre_dt_board.cmake similarity index 100% rename from boards/arm/thingy91x_nrf5340/pre_dt_board.cmake rename to boards/nordic/thingy91x/pre_dt_board.cmake diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp.dts b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.dts similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp.dts rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.dts diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp.yaml b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.yaml similarity index 86% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp.yaml rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.yaml index eb6cc2c5c38a..c560dcf9212b 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp.yaml +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp.yaml @@ -1,4 +1,4 @@ -identifier: thingy91x_nrf5340_cpuapp +identifier: thingy91x/nrf5340/cpuapp name: Thingy91X-NRF5340-application-MCU type: mcu arch: arm diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_common-pinctrl.dtsi b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_common-pinctrl.dtsi similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_common-pinctrl.dtsi rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_common-pinctrl.dtsi diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_common.dts b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_common.dts similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_common.dts rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_common.dts diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_defconfig b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_defconfig similarity index 83% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_defconfig rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_defconfig index de293e3cd30a..16cc84cc167c 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_defconfig +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns.dts b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns.dts similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns.dts rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns.dts diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns.yaml b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns.yaml similarity index 85% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns.yaml rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns.yaml index 12963b29c8ca..7a17f5bf4e36 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns.yaml +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns.yaml @@ -1,4 +1,4 @@ -identifier: thingy91x_nrf5340_cpuapp_ns +identifier: thingy91x/nrf5340/cpuapp/ns name: THINGY91X-NRF5340-application-MCU-Non-Secure type: mcu arch: arm diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns_defconfig b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns_defconfig similarity index 85% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns_defconfig rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns_defconfig index a93fca2361e3..7f62e5a32518 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpuapp_ns_defconfig +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpuapp_ns_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet.dts b/boards/nordic/thingy91x/thingy91x_nrf5340_cpunet.dts similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet.dts rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpunet.dts diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet.yaml b/boards/nordic/thingy91x/thingy91x_nrf5340_cpunet.yaml similarity index 80% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet.yaml rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpunet.yaml index eea461d5c62e..aa6fb410df5c 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet.yaml +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpunet.yaml @@ -1,4 +1,4 @@ -identifier: thingy91x_nrf5340_cpunet +identifier: thingy91x/nrf5340/cpunet name: Thingy91X-NRF5340-network-MCU type: mcu arch: arm diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet_defconfig b/boards/nordic/thingy91x/thingy91x_nrf5340_cpunet_defconfig similarity index 76% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet_defconfig rename to boards/nordic/thingy91x/thingy91x_nrf5340_cpunet_defconfig index df8286df3b50..6c518acc8b46 100644 --- a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_cpunet_defconfig +++ b/boards/nordic/thingy91x/thingy91x_nrf5340_cpunet_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUNET_QKAA=y -CONFIG_BOARD_THINGY91X_NRF5340_CPUNET=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_pm_static.yml b/boards/nordic/thingy91x/thingy91x_nrf5340_pm_static.yml similarity index 100% rename from boards/arm/thingy91x_nrf5340/thingy91x_nrf5340_pm_static.yml rename to boards/nordic/thingy91x/thingy91x_nrf5340_pm_static.yml diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151.dts b/boards/nordic/thingy91x/thingy91x_nrf9151.dts similarity index 100% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151.dts rename to boards/nordic/thingy91x/thingy91x_nrf9151.dts diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151.yaml b/boards/nordic/thingy91x/thingy91x_nrf9151.yaml similarity index 80% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151.yaml rename to boards/nordic/thingy91x/thingy91x_nrf9151.yaml index a1e24f353359..fc8824805952 100644 --- a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151.yaml +++ b/boards/nordic/thingy91x/thingy91x_nrf9151.yaml @@ -1,4 +1,4 @@ -identifier: thingy91x_nrf9151 +identifier: thingy91x/nrf9151 name: Thingy91X-NRF9151 type: mcu arch: arm diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_common-pinctrl.dtsi b/boards/nordic/thingy91x/thingy91x_nrf9151_common-pinctrl.dtsi similarity index 100% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_common-pinctrl.dtsi rename to boards/nordic/thingy91x/thingy91x_nrf9151_common-pinctrl.dtsi diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_common.dts b/boards/nordic/thingy91x/thingy91x_nrf9151_common.dts similarity index 91% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_common.dts rename to boards/nordic/thingy91x/thingy91x_nrf9151_common.dts index 4f8826233d27..8a2300930e10 100644 --- a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_common.dts +++ b/boards/nordic/thingy91x/thingy91x_nrf9151_common.dts @@ -88,6 +88,10 @@ &gpio0 { status = "okay"; + exp-board-power-enable { + gpio-hog; + gpios = <3 GPIO_ACTIVE_HIGH>; + }; }; /* PWM0 is intended for RGB LED control */ @@ -131,7 +135,8 @@ /* GPIO1 switches power to the short range RF front end */ ldsw_rf_fe_sr_en: GPIO1 { gpio-hog; - gpios = <1 GPIO_ACTIVE_HIGH>; + output-low; + gpios = <1 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN | GPIO_PULL_UP)>; }; power_switch: GPIO2 { gpio-hog; @@ -190,11 +195,20 @@ regulators { compatible = "nordic,npm6001-regulator"; + pmic_wifi_buck0: BUCK0 { + regulator-boot-off; + }; + pmic_wifi_buck1: BUCK1 { + regulator-boot-off; + }; + pmic_wifi_buck2: BUCK2 { + regulator-boot-off; + }; /* Dedicated 3.3 V regulator for nRF70 */ reg_wifi: BUCK3 { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - regulator-initial-mode = ; + regulator-initial-mode = ; regulator-boot-on; }; }; @@ -226,20 +240,19 @@ pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; - flash_ext: GD25LB256E@0 { + flash_ext: GD25LE255E@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <8000000>; size = <268435456>; has-dpd; t-enter-dpd = <3000>; - t-exit-dpd = <30000>; - sfdp-bfp = [e5 20 ea ff ff ff ff 0f 44 eb 08 6b 00 3b 00 bb - fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 - 10 d8 00 ff d5 31 b1 fe 82 e4 14 4c ec 60 06 33 - 7a 75 7a 75 04 bd d5 5c 29 06 74 00 08 50 00 01 - ]; - jedec-id = [c8 67 19]; + t-exit-dpd = <20000>; + sfdp-bfp = [e5 20 f3 ff ff ff ff 0f 44 eb 08 6b 08 3b 42 bb + fe ff ff ff ff ff 00 ff ff ff 42 eb 0c 20 0f 52 + 10 d8 00 ff d4 31 a5 fe 84 df 14 4f ec 62 16 33 + 7a 75 7a 75 04 b3 d5 5c 19 06 14 00 08 50 00 01]; + jedec-id = [c8 60 19]; }; nrf700x: nrf7000@1 { diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_defconfig b/boards/nordic/thingy91x/thingy91x_nrf9151_defconfig similarity index 82% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_defconfig rename to boards/nordic/thingy91x/thingy91x_nrf9151_defconfig index 241d76ad00f6..21490cc3be3b 100644 --- a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_defconfig +++ b/boards/nordic/thingy91x/thingy91x_nrf9151_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF91X=y -CONFIG_SOC_NRF9151_LACA=y -CONFIG_BOARD_THINGY91X_NRF9151=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns.dts b/boards/nordic/thingy91x/thingy91x_nrf9151_ns.dts similarity index 100% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns.dts rename to boards/nordic/thingy91x/thingy91x_nrf9151_ns.dts diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns.yaml b/boards/nordic/thingy91x/thingy91x_nrf9151_ns.yaml similarity index 79% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns.yaml rename to boards/nordic/thingy91x/thingy91x_nrf9151_ns.yaml index 50e6bfcf1d43..2fc93a0a691d 100644 --- a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns.yaml +++ b/boards/nordic/thingy91x/thingy91x_nrf9151_ns.yaml @@ -1,4 +1,4 @@ -identifier: thingy91x_nrf9151_ns +identifier: thingy91x/nrf9151/ns name: Thingy91X-nRF9151-Non-Secure type: mcu arch: arm diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns_defconfig b/boards/nordic/thingy91x/thingy91x_nrf9151_ns_defconfig similarity index 89% rename from boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns_defconfig rename to boards/nordic/thingy91x/thingy91x_nrf9151_ns_defconfig index c546c45c253c..59c887b3ba70 100644 --- a/boards/arm/thingy91x_nrf9151/thingy91x_nrf9151_ns_defconfig +++ b/boards/nordic/thingy91x/thingy91x_nrf9151_ns_defconfig @@ -1,10 +1,6 @@ # Copyright (c) 2024 Nordic Semiconductor # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -CONFIG_SOC_SERIES_NRF91X=y -CONFIG_SOC_NRF9151_LACA=y -CONFIG_BOARD_THINGY91X_NRF9151_NS=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/thingy91x_nrf9151/thingy91x_pm_static.yml b/boards/nordic/thingy91x/thingy91x_pm_static.yml similarity index 100% rename from boards/arm/thingy91x_nrf9151/thingy91x_pm_static.yml rename to boards/nordic/thingy91x/thingy91x_pm_static.yml diff --git a/boards/shields/coverage_support/Kconfig.shield b/boards/shields/coverage_support/Kconfig.shield new file mode 100644 index 000000000000..8d1b411b2485 --- /dev/null +++ b/boards/shields/coverage_support/Kconfig.shield @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +config SHIELD_COVERAGE_SUPPORT + def_bool $(shields_list_contains,coverage_support) diff --git a/boards/shields/coverage_support/coverage_support.conf b/boards/shields/coverage_support/coverage_support.conf new file mode 100644 index 000000000000..1164b4fc066c --- /dev/null +++ b/boards/shields/coverage_support/coverage_support.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/coverage_support.overlay b/boards/shields/coverage_support/coverage_support.overlay new file mode 100644 index 000000000000..33c2beb24569 --- /dev/null +++ b/boards/shields/coverage_support/coverage_support.overlay @@ -0,0 +1,4 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ diff --git a/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay b/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay index e5a5dd8beb06..ec8742e6afb5 100644 --- a/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay +++ b/boards/shields/nrf21540ek/nrf21540ek_fwd.overlay @@ -11,7 +11,7 @@ * a child image targeted for nRF5340 network core, which drives the nRF21540 Front-End Module. * The shield overlays could be provided to the build using the following command: * - * west build -p -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf21540ek_fwd -D_SHIELD=nrf21540ek + * west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf21540ek_fwd -D_SHIELD=nrf21540ek */ &gpio_fwd { nrf21540-gpio-if { diff --git a/boards/shields/nrf2220ek/Kconfig.shield b/boards/shields/nrf2220ek/Kconfig.shield new file mode 100644 index 000000000000..dcbdc96df814 --- /dev/null +++ b/boards/shields/nrf2220ek/Kconfig.shield @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SHIELD_NRF2220EK + def_bool $(shields_list_contains,nrf2220ek) diff --git a/boards/shields/nrf2220ek/boards/nrf5340dk_nrf5340_cpunet.overlay b/boards/shields/nrf2220ek/boards/nrf5340dk_nrf5340_cpunet.overlay new file mode 100644 index 000000000000..cd045fcde3b4 --- /dev/null +++ b/boards/shields/nrf2220ek/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -0,0 +1,9 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* On nrf5340_cpunet the uart0 conflicts with nrf_radio_fem_twi and must be disabled. */ +&uart0 { + status = "disabled"; +}; diff --git a/boards/shields/nrf2220ek/nrf2220ek.conf b/boards/shields/nrf2220ek/nrf2220ek.conf new file mode 100644 index 000000000000..761df9d22fc4 --- /dev/null +++ b/boards/shields/nrf2220ek/nrf2220ek.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_BANNER=n +CONFIG_EARLY_CONSOLE=n diff --git a/boards/shields/nrf2220ek/nrf2220ek.overlay b/boards/shields/nrf2220ek/nrf2220ek.overlay new file mode 100644 index 000000000000..398990f893f9 --- /dev/null +++ b/boards/shields/nrf2220ek/nrf2220ek.overlay @@ -0,0 +1,29 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Pin mapping suitable for use nRF2220-EK PCA63558 with + * Nordic Interposer Board A PCA64172 v0.2.0. + * The nRF2220-EK in SLOT 2 of PCA64172. + */ + +/ { + nrf_radio_fem: nrf2220_fem { + compatible = "nordic,nrf2220-fem"; + cs-gpios = <&arduino_header 14 GPIO_ACTIVE_HIGH>; /* D8 */ + md-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */ + twi-if = <&nrf_radio_fem_twi>; + }; +}; + +fem_twi: &arduino_i2c { + status = "okay"; + compatible = "nordic,nrf-twim"; + + nrf_radio_fem_twi: nrf2220_fem_twi@36 { + compatible = "nordic,nrf2220-fem-twi"; + status = "okay"; + reg = <0x36>; + }; +}; diff --git a/boards/shields/nrf2220ek/nrf2220ek_fwd.overlay b/boards/shields/nrf2220ek/nrf2220ek_fwd.overlay new file mode 100644 index 000000000000..d0c795432394 --- /dev/null +++ b/boards/shields/nrf2220ek/nrf2220ek_fwd.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* This file matches the contents of nrf2220ek.overlay and is intended to be applied to nRF5340 + * application core when nrf2220ek shield is provided to the network core's image build. + * + * For instance, consider an application targeted for nRF5340 application core that specifies + * a child image targeted for nRF5340 network core, which drives the nRF2220 Front-End Module. + * The shield overlays could be provided to the build using the following command: + * + * west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf2220ek_fwd -D_SHIELD=nrf2220ek + */ + +&gpio_fwd { + nrf2220-gpio-if { + gpios = <&arduino_header 14 0>, /* cs-gpios */ + <&arduino_header 13 0>; /* md-gpios */ + }; + nrf2220-twi-if { + gpios = <&gpio1 2 0>, /* TWIM_SDA */ + <&gpio1 3 0>; /* TWIM_SCL */ + }; +}; diff --git a/boards/shields/nrf2240ek/Kconfig.shield b/boards/shields/nrf2240ek/Kconfig.shield new file mode 100644 index 000000000000..c87767eae734 --- /dev/null +++ b/boards/shields/nrf2240ek/Kconfig.shield @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SHIELD_NRF2240EK + def_bool $(shields_list_contains,nrf2240ek) diff --git a/boards/shields/nrf2240ek/boards/nrf5340dk_nrf5340_cpunet.overlay b/boards/shields/nrf2240ek/boards/nrf5340dk_nrf5340_cpunet.overlay new file mode 100644 index 000000000000..cd045fcde3b4 --- /dev/null +++ b/boards/shields/nrf2240ek/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -0,0 +1,9 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* On nrf5340_cpunet the uart0 conflicts with nrf_radio_fem_twi and must be disabled. */ +&uart0 { + status = "disabled"; +}; diff --git a/boards/shields/nrf2240ek/nrf2240ek.conf b/boards/shields/nrf2240ek/nrf2240ek.conf new file mode 100644 index 000000000000..761df9d22fc4 --- /dev/null +++ b/boards/shields/nrf2240ek/nrf2240ek.conf @@ -0,0 +1,2 @@ +CONFIG_BOOT_BANNER=n +CONFIG_EARLY_CONSOLE=n diff --git a/boards/shields/nrf2240ek/nrf2240ek.overlay b/boards/shields/nrf2240ek/nrf2240ek.overlay new file mode 100644 index 000000000000..1908ef502567 --- /dev/null +++ b/boards/shields/nrf2240ek/nrf2240ek.overlay @@ -0,0 +1,30 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Pin mapping suitable for use nRF2240-EK PCA63564 with + * Nordic Interposer Board A PCA64172 v0.2.0. + * The nRF2240-EK in SLOT 2 of PCA64172. + */ + +/ { + nrf_radio_fem: nrf2240_fem { + compatible = "nordic,nrf2240-fem"; + cs-gpios = <&arduino_header 14 GPIO_ACTIVE_HIGH>; /* D8 */ + md-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */ + pwrmd-gpios = <&arduino_header 4 GPIO_ACTIVE_HIGH>; /* A4 */ + twi-if = <&nrf_radio_fem_twi>; + }; +}; + +fem_twi: &arduino_i2c { + status = "okay"; + compatible = "nordic,nrf-twim"; + + nrf_radio_fem_twi: nrf2240_fem_twi@30 { + compatible = "nordic,nrf2240-fem-twi"; + status = "okay"; + reg = <0x30>; + }; +}; diff --git a/boards/shields/nrf2240ek/nrf2240ek_fwd.overlay b/boards/shields/nrf2240ek/nrf2240ek_fwd.overlay new file mode 100644 index 000000000000..66085ef8b136 --- /dev/null +++ b/boards/shields/nrf2240ek/nrf2240ek_fwd.overlay @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* This file matches the contents of nrf2240ek.overlay and is intended to be applied to nRF5340 + * application core when nrf2240ek shield is provided to the network core's image build. + * + * For instance, consider an application targeted for nRF5340 application core that specifies + * a child image targeted for nRF5340 network core, which drives the nRF2240 Front-End Module. + * The shield overlays could be provided to the build using the following command: + * + * west build -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf2240ek_fwd -D_SHIELD=nrf2240ek + */ + +&gpio_fwd { + nrf2240-gpio-if { + gpios = <&arduino_header 14 0>, /* cs-gpios */ + <&arduino_header 13 0>, /* md-gpios */ + <&arduino_header 4 0>; /* pwrmd-gpios */ + }; + nrf2240-twi-if { + gpios = <&gpio1 2 0>, /* TWIM_SDA */ + <&gpio1 3 0>; /* TWIM_SCL */ + }; +}; diff --git a/boards/shields/nrf7002eb/Kconfig.shield b/boards/shields/nrf7002eb/Kconfig.shield index 591b97c87790..b668709e2e59 100644 --- a/boards/shields/nrf7002eb/Kconfig.shield +++ b/boards/shields/nrf7002eb/Kconfig.shield @@ -5,7 +5,3 @@ # config SHIELD_NRF7002EB def_bool $(shields_list_contains,nrf7002eb) - -config BOARD_NRF7002 - bool - default y if SHIELD_NRF7002EB diff --git a/boards/shields/nrf7002eb/boards/nrf52840dk_nrf52840.overlay b/boards/shields/nrf7002eb/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..2da9f87a2ad1 --- /dev/null +++ b/boards/shields/nrf7002eb/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002eb_coex.overlay" diff --git a/boards/shields/nrf7002eb/boards/nrf5340dk_nrf5340_cpuapp.overlay b/boards/shields/nrf7002eb/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..0beb03e965c7 --- /dev/null +++ b/boards/shields/nrf7002eb/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include "../nrf7002eb_coex.overlay" diff --git a/boards/shields/nrf7002eb/boards/thingy53_nrf5340_cpuapp.overlay b/boards/shields/nrf7002eb/boards/thingy53_nrf5340_cpuapp.overlay index 3a5e2771ff60..18b934a96ac9 100644 --- a/boards/shields/nrf7002eb/boards/thingy53_nrf5340_cpuapp.overlay +++ b/boards/shields/nrf7002eb/boards/thingy53_nrf5340_cpuapp.overlay @@ -3,6 +3,8 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ + #include "../nrf7002eb_coex.overlay" + /* The below overlays might not be explicitly required but still * kept here to warn of the conflicting pins that could hamper * functionality later diff --git a/boards/shields/nrf7002eb/nrf7002eb.overlay b/boards/shields/nrf7002eb/nrf7002eb.overlay index 8181584c0f24..6e72cec73a56 100644 --- a/boards/shields/nrf7002eb/nrf7002eb.overlay +++ b/boards/shields/nrf7002eb/nrf7002eb.overlay @@ -3,7 +3,6 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include "nrf7002eb_coex.overlay" / { nordic_wlan0: nordic_wlan0 { diff --git a/boards/shields/nrf7002ek/boards/nrf52840dk_nrf52840.overlay b/boards/shields/nrf7002ek/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..da54dfdde269 --- /dev/null +++ b/boards/shields/nrf7002ek/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_coex.overlay" diff --git a/boards/shields/nrf7002ek/boards/nrf5340dk_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek/boards/nrf5340dk_nrf5340_cpuapp.overlay index 66603a7e818c..06770a0bc229 100644 --- a/boards/shields/nrf7002ek/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/boards/shields/nrf7002ek/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -2,6 +2,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#include "../nrf7002ek_coex.overlay" /* This node by default forwards the UART1 pins to CPUNET, but as UART1 uses * same pins as bucken and iovdd-ctrl, we need these pins to be controlled by diff --git a/boards/shields/nrf7002ek/boards/thingy53_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek/boards/thingy53_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..da54dfdde269 --- /dev/null +++ b/boards/shields/nrf7002ek/boards/thingy53_nrf5340_cpuapp.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_coex.overlay" diff --git a/boards/shields/nrf7002ek/nrf7002ek.overlay b/boards/shields/nrf7002ek/nrf7002ek.overlay index e5e03e0ec76b..dc34d9245fdf 100644 --- a/boards/shields/nrf7002ek/nrf7002ek.overlay +++ b/boards/shields/nrf7002ek/nrf7002ek.overlay @@ -3,7 +3,6 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include "nrf7002ek_coex.overlay" / { nordic_wlan0: nordic_wlan0 { diff --git a/boards/shields/nrf7002ek_nrf7000/boards/nrf52840dk_nrf52840.overlay b/boards/shields/nrf7002ek_nrf7000/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..89219e71d3a8 --- /dev/null +++ b/boards/shields/nrf7002ek_nrf7000/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_nrf7000_coex.overlay" diff --git a/boards/shields/nrf7002ek_nrf7000/boards/nrf5340dk_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek_nrf7000/boards/nrf5340dk_nrf5340_cpuapp.overlay index 66603a7e818c..9d888bd42755 100644 --- a/boards/shields/nrf7002ek_nrf7000/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/boards/shields/nrf7002ek_nrf7000/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -2,6 +2,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ + #include "../nrf7002ek_nrf7000_coex.overlay" /* This node by default forwards the UART1 pins to CPUNET, but as UART1 uses * same pins as bucken and iovdd-ctrl, we need these pins to be controlled by diff --git a/boards/shields/nrf7002ek_nrf7000/boards/thingy53_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek_nrf7000/boards/thingy53_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..89219e71d3a8 --- /dev/null +++ b/boards/shields/nrf7002ek_nrf7000/boards/thingy53_nrf5340_cpuapp.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_nrf7000_coex.overlay" diff --git a/boards/shields/nrf7002ek_nrf7000/nrf7002ek_nrf7000.overlay b/boards/shields/nrf7002ek_nrf7000/nrf7002ek_nrf7000.overlay index feb9fd44d72a..6c900a684432 100644 --- a/boards/shields/nrf7002ek_nrf7000/nrf7002ek_nrf7000.overlay +++ b/boards/shields/nrf7002ek_nrf7000/nrf7002ek_nrf7000.overlay @@ -3,7 +3,6 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include "nrf7002ek_nrf7000_coex.overlay" / { nordic_wlan0: nordic_wlan0 { diff --git a/boards/shields/nrf7002ek_nrf7001/boards/nrf52840dk_nrf52840.overlay b/boards/shields/nrf7002ek_nrf7001/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..00d734c80d55 --- /dev/null +++ b/boards/shields/nrf7002ek_nrf7001/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_nrf7001_coex.overlay" diff --git a/boards/shields/nrf7002ek_nrf7001/boards/nrf5340dk_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek_nrf7001/boards/nrf5340dk_nrf5340_cpuapp.overlay index 66603a7e818c..eab245fc372b 100644 --- a/boards/shields/nrf7002ek_nrf7001/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/boards/shields/nrf7002ek_nrf7001/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -2,6 +2,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ + #include "../nrf7002ek_nrf7001_coex.overlay" /* This node by default forwards the UART1 pins to CPUNET, but as UART1 uses * same pins as bucken and iovdd-ctrl, we need these pins to be controlled by diff --git a/boards/shields/nrf7002ek_nrf7001/boards/thingy53_nrf5340_cpuapp.overlay b/boards/shields/nrf7002ek_nrf7001/boards/thingy53_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..00d734c80d55 --- /dev/null +++ b/boards/shields/nrf7002ek_nrf7001/boards/thingy53_nrf5340_cpuapp.overlay @@ -0,0 +1,5 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + #include "../nrf7002ek_nrf7001_coex.overlay" diff --git a/boards/shields/nrf7002ek_nrf7001/nrf7002ek_nrf7001.overlay b/boards/shields/nrf7002ek_nrf7001/nrf7002ek_nrf7001.overlay index 7d2810c79269..9722b22bc71b 100644 --- a/boards/shields/nrf7002ek_nrf7001/nrf7002ek_nrf7001.overlay +++ b/boards/shields/nrf7002ek_nrf7001/nrf7002ek_nrf7001.overlay @@ -3,7 +3,6 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include -#include "nrf7002ek_nrf7001_coex.overlay" / { nordic_wlan0: nordic_wlan0 { diff --git a/boards/shields/nrf700x_nrf54h20dk/Kconfig.shield b/boards/shields/nrf700x_nrf54h20dk/Kconfig.shield new file mode 100644 index 000000000000..ade9bd94584c --- /dev/null +++ b/boards/shields/nrf700x_nrf54h20dk/Kconfig.shield @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +DT_COMPAT_NORDIC_NRF700X_SPI := nordic,nrf700x-spi + +config SHIELD_NRF700X_NRF54H20DK + def_bool $(shields_list_contains,nrf700x_nrf54h20dk) + +config NRF7002_ON_SPI + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI)) + depends on SHIELD_NRF700X_NRF54H20DK diff --git a/boards/shields/nrf700x_nrf54h20dk/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/boards/shields/nrf700x_nrf54h20dk/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..6883a62376f0 --- /dev/null +++ b/boards/shields/nrf700x_nrf54h20dk/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SHELL_BACKEND_SERIAL=y +# nrf_security is WIP +CONFIG_WPA_SUPP_CRYPTO_NONE=y +CONFIG_TEST_RANDOM_GENERATOR=y + +# External flash access is WIP +CONFIG_WIFI_CREDENTIALS=n +CONFIG_FLASH=n +CONFIG_NVS=n +CONFIG_SETTINGS=n diff --git a/boards/shields/nrf700x_nrf54h20dk/nrf700x_nrf54h20dk.overlay b/boards/shields/nrf700x_nrf54h20dk/nrf700x_nrf54h20dk.overlay new file mode 100644 index 000000000000..b9ff2a5ae9db --- /dev/null +++ b/boards/shields/nrf700x_nrf54h20dk/nrf700x_nrf54h20dk.overlay @@ -0,0 +1,173 @@ +/* Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include + +/* Wi-Fi needs more flash (1M) and RAM (512K): + * + * To minimize the changes, only necessary nodes are added, so, delete + * any linked nodes. This was done here as it's applicable to most samples, + * if a sample needs anything extra, it can override this with a sample specific + * overlay. + */ + /delete-node/ &ipc0; + /delete-node/ &cpuppr_vpr; + /delete-node/ &mram1x; + /delete-node/ &cpurad_uicr; + +/ { + /delete-node/ ipc; + /delete-node/ reserved-memory; + + /* Shift offsets by 512K */ + soc { + mram1x: mram@e000000 { + compatible = "nordic,mram"; + erase-block-size = <4096>; + write-block-size = <16>; + reg = <0xe000000 DT_SIZE_K(2048)>; + cpuapp_rx_partitions: cpuapp-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-execute; + perm-secure; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_slot0_partition: partition@66000 { + reg = <0x66000 DT_SIZE_K(1024)>; + }; + }; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + perm-secure; + #address-cells = <1>; + #size-cells = <1>; + + storage_partition: partition@166000 { + reg = <0x166000 DT_SIZE_K(24)>; + }; + }; + }; + }; + + reserved-memory { + compatible = "reserved-memory"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + /* Shift offsets by 256K and remove IPC regions */ + cpuapp_ram0x_region: memory@2f000000 { + compatible = "nordic,owned-memory"; + reg = <0x2f000000 DT_SIZE_K(512)>; + status = "okay"; + perm-read; + perm-write; + perm-secure; + perm-execute; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2f000000 DT_SIZE_K(512)>; + + cpuapp_data: memory@0 { + reg = <0x0 DT_SIZE_K(512)>; + }; + }; + + /* Below sections are unchanged, duplicated as delete the entire node */ + shared_ram3x_region: memory@2fc12000{ + compatible = "nordic,owned-memory"; + reg = <0x2fc12000 DT_SIZE_K(4)>; + status = "okay"; + perm-read; + perm-write; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x2fc12000 0x2000>; + + cpuapp_dma_region: memory@e80 { + compatible = "zephyr,memory-region"; + reg = <0xe80 DT_SIZE_K(4)>; + status = "okay"; + #memory-region-cells = <0>; + zephyr,memory-region = "DMA_RAM3x_APP"; + }; + }; + + cpuapp_uicr_ext: memory@e1ff800 { + reg = <0xe1ff800 DT_SIZE_K(2)>; + }; + }; + + nordic_wlan0: nordic_wlan0 { + compatible = "nordic,wlan0"; + status = "okay"; + }; + + nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { + status = "okay"; + compatible = "nordic,nrf700x-tx-power-ceiling"; + max-pwr-2g-dsss = <0x54>; + max-pwr-2g-mcs0 = <0x40>; + max-pwr-2g-mcs7 = <0x40>; + max-pwr-5g-low-mcs0 = <0x34>; + max-pwr-5g-low-mcs7 = <0x34>; + max-pwr-5g-mid-mcs0 = <0x34>; + max-pwr-5g-mid-mcs7 = <0x34>; + max-pwr-5g-high-mcs0 = <0x30>; + max-pwr-5g-high-mcs7 = <0x30>; + }; + + chosen { + zephyr,wifi = &nordic_wlan0; + zephyr,bt-hci-ipc = ""; + }; +}; + +&pinctrl { + spi130_default: spi130_default { + group1 { + /* SCK has to be 0..3 and other signals can't use these pins */ + psels = , + , + ; + }; + }; + + spi130_sleep: spi130_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi130 { + status = "okay"; + cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&spi130_default>; + pinctrl-1 = <&spi130_sleep>; + pinctrl-names = "default", "sleep"; + memory-regions = <&cpuapp_dma_region>; + nrf700x: nrf7002@0 { + compatible = "nordic,nrf700x-spi"; + status = "okay"; + reg = <0>; + spi-max-frequency = ; + bucken-gpios = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + iovdd-ctrl-gpios = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + host-irq-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpio1 { + status = "okay"; +}; diff --git a/boards/shields/nrf700x_nrf54l15pdk/Kconfig.shield b/boards/shields/nrf700x_nrf54l15pdk/Kconfig.shield new file mode 100644 index 000000000000..c17218c689ba --- /dev/null +++ b/boards/shields/nrf700x_nrf54l15pdk/Kconfig.shield @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +DT_COMPAT_NORDIC_NRF700X_QSPI := nordic,nrf700x-qspi +DT_COMPAT_NORDIC_NRF700X_SPI := nordic,nrf700x-spi + +config SHIELD_NRF700X_NRF54L15PDK + def_bool $(shields_list_contains,nrf700x_nrf54l15pdk) + +config NRF7002_ON_QSPI + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_QSPI)) + depends on SHIELD_NRF700X_NRF54L15PDK + +config NRF7002_ON_SPI + def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI)) + depends on SHIELD_NRF700X_NRF54L15PDK diff --git a/boards/shields/nrf700x_nrf54l15pdk/nrf700x_nrf54l15pdk.overlay b/boards/shields/nrf700x_nrf54l15pdk/nrf700x_nrf54l15pdk.overlay new file mode 100644 index 000000000000..0b58e13b0c6c --- /dev/null +++ b/boards/shields/nrf700x_nrf54l15pdk/nrf700x_nrf54l15pdk.overlay @@ -0,0 +1,74 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +/ { + nordic_wlan0: nordic_wlan0 { + compatible = "nordic,wlan0"; + status = "okay"; + }; + + chosen { + zephyr,wifi = &nordic_wlan0; + }; + + nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node { + status = "okay"; + compatible = "nordic,nrf700x-tx-power-ceiling"; + max-pwr-2g-dsss = <0x54>; + max-pwr-2g-mcs0 = <0x40>; + max-pwr-2g-mcs7 = <0x40>; + max-pwr-5g-low-mcs0 = <0x34>; + max-pwr-5g-low-mcs7 = <0x34>; + max-pwr-5g-mid-mcs0 = <0x34>; + max-pwr-5g-mid-mcs7 = <0x34>; + max-pwr-5g-high-mcs0 = <0x30>; + max-pwr-5g-high-mcs7 = <0x30>; + }; +}; + +&pinctrl { + spi22_default: spi22_default { + group1 { + psels = , + , + ; + }; + }; + + spi22_sleep: spi22_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +/* With P1 only SPI20/21/22 are allowed and SPI20 uses same IRQ as UART20 */ +&spi22 { + status = "okay"; + cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&spi22_default>; + pinctrl-1 = <&spi22_sleep>; + pinctrl-names = "default", "sleep"; + nrf700x: nrf7002@0 { + compatible = "nordic,nrf700x-spi"; + status = "okay"; + reg = <0>; + spi-max-frequency = ; + bucken-gpios = <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + iovdd-ctrl-gpios = <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; + host-irq-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; +}; + + +&gpio1 { + status = "okay"; +}; diff --git a/cmake/commit.h.in b/cmake/commit.h.in new file mode 100644 index 000000000000..39a7e2f1abc2 --- /dev/null +++ b/cmake/commit.h.in @@ -0,0 +1,12 @@ +#ifndef _@COMMIT_TYPE@_COMMIT_H_ +#define _@COMMIT_TYPE@_COMMIT_H_ + +/* @templates@ values come from cmake/version.cmake + * BUILD_COMMIT related @template@ values will be 'git rev-parse', + * alternatively user defined BUILD_VERSION. + */ + +#define @COMMIT_TYPE@_COMMIT @@COMMIT_TYPE@_COMMIT@ +#define @COMMIT_TYPE@_COMMIT_STRING "@@COMMIT_TYPE@_COMMIT@" + +#endif /* _@COMMIT_TYPE@_COMMIT_H_ */ diff --git a/cmake/extensions.cmake b/cmake/extensions.cmake index a67cbe1fcab4..3fb35d0f7dac 100644 --- a/cmake/extensions.cmake +++ b/cmake/extensions.cmake @@ -65,7 +65,7 @@ macro(check_arguments_exclusive function prefix argument) endmacro() function(get_board_without_ns_suffix board_in board_out) - string(REGEX REPLACE "(_?ns)$" "" board_in_without_suffix ${board_in}) + string(REGEX REPLACE "((_|/)?ns)$" "" board_in_without_suffix ${board_in}) if(NOT "${board_in}" STREQUAL "${board_in_without_suffix}") if (NOT CONFIG_ARM_NONSECURE_FIRMWARE) message(FATAL_ERROR "${board_in} is not a valid name for a board without " @@ -101,12 +101,12 @@ endfunction() # Convenience macro to add configuration overlays to child image. macro(add_overlay_config image overlay_file) - add_overlay(${image} ${overlay_file} OVERLAY_CONFIG) + add_overlay(${image} ${overlay_file} EXTRA_CONF_FILE) endmacro() # Convenience macro to add device tree overlays to child image. macro(add_overlay_dts image overlay_file) - add_overlay(${image} ${overlay_file} DTC_OVERLAY_FILE) + add_overlay(${image} ${overlay_file} EXTRA_DTC_OVERLAY_FILE) endmacro() # Add a partition manager configuration file to the build. @@ -189,7 +189,7 @@ Please provide one of following: CONF_FILES") endif() set(single_args CONF_FILES PM DOMAIN) - set(zephyr_conf_single_args BOARD BOARD_REVISION BUILD DTS KCONF) + set(zephyr_conf_single_args BOARD BOARD_REVISION BUILD DTS KCONF SUFFIX) cmake_parse_arguments(PREPROCESS_ARGS "" "${single_args};${zephyr_conf_single_args}" "" ${ARGN}) # Remove any argument that is missing value to ensure proper behavior in situations like: @@ -199,18 +199,27 @@ Please provide one of following: CONF_FILES") list(REMOVE_ITEM ARGN ${PREPROCESS_ARGS_KEYWORDS_MISSING_VALUES}) endif() - cmake_parse_arguments(NCS_FILE "" "${single_args}" "" ${ARGN}) + cmake_parse_arguments(NCS_FILE "" "${single_args};BOARD" "" ${ARGN}) cmake_parse_arguments(ZEPHYR_FILE "" "${zephyr_conf_single_args}" "" ${ARGN}) if(ZEPHYR_FILE_KCONF) - if(ZEPHYR_FILE_BUILD AND EXISTS ${NCS_FILE_CONF_FILES}/prj_${ZEPHYR_FILE_BUILD}.conf) + if(ZEPHYR_FILE_SUFFIX AND EXISTS ${NCS_FILE_CONF_FILES}/prj_${ZEPHYR_FILE_SUFFIX}.conf) + set(${ZEPHYR_FILE_KCONF} ${NCS_FILE_CONF_FILES}/prj_${ZEPHYR_FILE_SUFFIX}.conf) + elseif(ZEPHYR_FILE_BUILD AND EXISTS ${NCS_FILE_CONF_FILES}/prj_${ZEPHYR_FILE_BUILD}.conf) set(${ZEPHYR_FILE_KCONF} ${NCS_FILE_CONF_FILES}/prj_${ZEPHYR_FILE_BUILD}.conf) elseif(NOT ZEPHYR_FILE_BUILD AND EXISTS ${NCS_FILE_CONF_FILES}/prj.conf) set(${ZEPHYR_FILE_KCONF} ${NCS_FILE_CONF_FILES}/prj.conf) endif() endif() - zephyr_file(CONF_FILES ${NCS_FILE_CONF_FILES}/boards ${NCS_FILE_UNPARSED_ARGUMENTS}) + set(additional_append) + + if(DEFINED PREPROCESS_ARGS_BOARD) + parse_board_components(PREPROCESS_ARGS_BOARD board_name board_revision board_qualifiers) + set(additional_append BOARD ${board_name} BOARD_REVISION ${board_revision} BOARD_QUALIFIERS ${board_qualifiers}) + endif() + + zephyr_file(CONF_FILES ${NCS_FILE_CONF_FILES}/boards ${additional_append} ${NCS_FILE_UNPARSED_ARGUMENTS}) if(ZEPHYR_FILE_KCONF) set(${ZEPHYR_FILE_KCONF} ${${ZEPHYR_FILE_KCONF}} PARENT_SCOPE) @@ -220,58 +229,105 @@ Please provide one of following: CONF_FILES") set(${ZEPHYR_FILE_DTS} ${${ZEPHYR_FILE_DTS}} PARENT_SCOPE) endif() - if(NOT DEFINED ZEPHYR_FILE_BOARD) + if(NOT DEFINED PREPROCESS_ARGS_BOARD) # Defaulting to system wide settings when BOARD is not given as argument - set(ZEPHYR_FILE_BOARD ${BOARD}) + set(board_combined ${BOARD}) + if(DEFINED BOARD_REVISION) - set(ZEPHYR_FILE_BOARD_REVISION ${BOARD_REVISION}) + set(board_combined ${board_combined}@${BOARD_REVISION}) endif() + + set(board_combined ${board_combined}${BOARD_QUALIFIERS}) + parse_board_components(board_combined board_name board_revision board_qualifiers) endif() if(NCS_FILE_PM) set(PM_FILE_PREFIX pm_static) - # Prepare search for pm_static_board@ver_build.yml - zephyr_build_string(filename - BOARD ${ZEPHYR_FILE_BOARD} - BOARD_REVISION ${ZEPHYR_FILE_BOARD_REVISION} - BUILD ${ZEPHYR_FILE_BUILD} - ) - set(filename_list ${PM_FILE_PREFIX}_${filename}) + if(DEFINED FILE_SUFFIX) + # Prepare search for pm_static_board@ver_suffix.yml + zephyr_build_string(filename + BOARD ${board_name} + BOARD_REVISION ${board_revision} + BOARD_QUALIFIERS ${board_qualifiers} + ) + set(filename_list ${PM_FILE_PREFIX}_${filename}) - # Prepare search for pm_static_board_build.yml - zephyr_build_string(filename - BOARD ${ZEPHYR_FILE_BOARD} - BUILD ${ZEPHYR_FILE_BUILD} - ) - list(APPEND filename_list ${PM_FILE_PREFIX}_${filename}) + # Prepare search for pm_static_board_suffix.yml + zephyr_build_string(filename + BOARD ${board_name} + BOARD_QUALIFIERS ${board_qualifiers} + ) + list(APPEND filename_list ${PM_FILE_PREFIX}_${filename}) - # Prepare search for pm_static_build.yml - # Note that BOARD argument is used to position suffix accordingly - zephyr_build_string(filename - BOARD ${ZEPHYR_FILE_BUILD} - ) - list(APPEND filename_list ${PM_FILE_PREFIX}_${filename}) + list(APPEND filename_list ${PM_FILE_PREFIX}) + else() + # Prepare search for pm_static_board@ver_build.yml + zephyr_build_string(filename + BOARD ${board_name} + BOARD_REVISION ${board_revision} + BOARD_QUALIFIERS ${board_qualifiers} + BUILD ${ZEPHYR_FILE_BUILD} + ) + set(filename_list ${PM_FILE_PREFIX}_${filename}) + + # Prepare search for pm_static_board_build.yml + zephyr_build_string(filename + BOARD ${board_name} + BOARD_QUALIFIERS ${board_qualifiers} + BUILD ${ZEPHYR_FILE_BUILD} + ) + list(APPEND filename_list ${PM_FILE_PREFIX}_${filename}) + + if(DEFINED ZEPHYR_FILE_BUILD) + # Prepare search for pm_static_build.yml + # Note that BOARD argument is used to position suffix accordingly + zephyr_build_string(filename + BOARD ${ZEPHYR_FILE_BUILD} + ) + list(APPEND filename_list ${PM_FILE_PREFIX}_${filename}) + endif() + + # Prepare search for pm_static.yml + list(APPEND filename_list ${PM_FILE_PREFIX}) + endif() - # Prepare search for pm_static.yml - list(APPEND filename_list ${PM_FILE_PREFIX}) list(REMOVE_DUPLICATES filename_list) foreach(filename ${filename_list}) if(DEFINED NCS_FILE_DOMAIN) - if(EXISTS ${NCS_FILE_CONF_FILES}/${filename}_${NCS_FILE_DOMAIN}.yml) - set(${NCS_FILE_PM} ${NCS_FILE_CONF_FILES}/${filename}_${NCS_FILE_DOMAIN}.yml PARENT_SCOPE) - break() + if(DEFINED FILE_SUFFIX) + set(filename_check ${NCS_FILE_CONF_FILES}/${filename}_${NCS_FILE_DOMAIN}.yml) + zephyr_file_suffix(filename_check SUFFIX ${FILE_SUFFIX}) + + if(EXISTS ${filename_check}) + set(${NCS_FILE_PM} ${filename_check} PARENT_SCOPE) + break() + endif() + + else() + if(EXISTS ${NCS_FILE_CONF_FILES}/${filename}_${NCS_FILE_DOMAIN}.yml) + set(${NCS_FILE_PM} ${NCS_FILE_CONF_FILES}/${filename}_${NCS_FILE_DOMAIN}.yml PARENT_SCOPE) + break() + endif() endif() endif() - if(EXISTS ${NCS_FILE_CONF_FILES}/${filename}.yml) - set(${NCS_FILE_PM} ${NCS_FILE_CONF_FILES}/${filename}.yml PARENT_SCOPE) - break() + if(DEFINED FILE_SUFFIX) + set(filename_check ${NCS_FILE_CONF_FILES}/${filename}.yml) + zephyr_file_suffix(filename_check SUFFIX ${FILE_SUFFIX}) + if(EXISTS ${filename_check}) + set(${NCS_FILE_PM} ${filename_check} PARENT_SCOPE) + break() + endif() + else() + if(EXISTS ${NCS_FILE_CONF_FILES}/${filename}.yml) + set(${NCS_FILE_PM} ${NCS_FILE_CONF_FILES}/${filename}.yml PARENT_SCOPE) + break() + endif() endif() endforeach() endif() - endfunction() # diff --git a/cmake/gen_commit_h.cmake b/cmake/gen_commit_h.cmake new file mode 100644 index 000000000000..7807b20b3a73 --- /dev/null +++ b/cmake/gen_commit_h.cmake @@ -0,0 +1,43 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Git QUIET) +if(GIT_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${COMMIT_PATH} + OUTPUT_VARIABLE ${COMMIT_TYPE}_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE stderr + RESULT_VARIABLE return_code + ) + + if(return_code) + message(STATUS "git rev-parse failed: ${stderr}") + elseif(NOT "${stderr}" STREQUAL "") + message(STATUS "git rev-parse warned: ${stderr}") + endif() + + # Limit to 12 characters + string(SUBSTRING "${${COMMIT_TYPE}_COMMIT}" 0 12 ${COMMIT_TYPE}_COMMIT) +endif() + +file(READ ${NRF_DIR}/cmake/commit.h.in commit_content) +string(CONFIGURE "${commit_content}" commit_content) +string(CONFIGURE "${commit_content}" commit_content) + +if(EXISTS ${OUT_FILE}) + file(READ ${OUT_FILE} current_contents) +else() + set(current_contents "") +endif() + +if(NOT "${current_contents}" STREQUAL "${commit_content}") + file(WRITE ${OUT_FILE} "${commit_content}") +endif() diff --git a/cmake/multi_image.cmake b/cmake/multi_image.cmake index 0bcfa52245bc..0d87df39ca94 100644 --- a/cmake/multi_image.cmake +++ b/cmake/multi_image.cmake @@ -96,7 +96,7 @@ else() endforeach() foreach(app_var_name ${application_vars}) - string(REPLACE "\"" "\\\"" app_var_value "${${app_var_name}}") + string(REPLACE "\"" "\\\"" app_var_value "$CACHE{${app_var_name}}") file( APPEND ${base_image_preload_file} @@ -234,7 +234,11 @@ function(add_child_image_from_source) elseif (NOT ACI_BOARD) # No BOARD is given as argument, this triggers automatic conversion of # *.ns board from parent image. - get_board_without_ns_suffix(${BOARD} ACI_BOARD) + if(DEFINED BOARD_REVISION) + get_board_without_ns_suffix(${BOARD}@${BOARD_REVISION}${BOARD_QUALIFIERS} ACI_BOARD) + else() + get_board_without_ns_suffix(${BOARD}${BOARD_QUALIFIERS} ACI_BOARD) + endif() endif() if (NOT ACI_DOMAIN AND DOMAIN) @@ -317,45 +321,70 @@ function(add_child_image_from_source) # files must be used instead of the child image default configs. # The append a child image default config, place the additional settings # in `child_image/.conf`. - set(ACI_CONF_DIR ${APPLICATION_CONFIG_DIR}/child_image) - set(ACI_NAME_CONF_DIR ${APPLICATION_CONFIG_DIR}/child_image/${ACI_NAME}) - if (NOT ${ACI_NAME}_CONF_FILE) - ncs_file(CONF_FILES ${ACI_NAME_CONF_DIR} - BOARD ${ACI_BOARD} - # Child image always uses the same revision as parent board. - BOARD_REVISION ${BOARD_REVISION} - KCONF ${ACI_NAME}_CONF_FILE - DTS ${ACI_NAME}_DTC_OVERLAY_FILE - BUILD ${CONF_FILE_BUILD_TYPE} - ) - # Place the result in the CMake cache and remove local scoped variable. - foreach(file CONF_FILE DTC_OVERLAY_FILE) - if(DEFINED ${ACI_NAME}_${file}) - set(${ACI_NAME}_${file} ${${ACI_NAME}_${file}} CACHE STRING - "Default ${ACI_NAME} configuration file" FORCE - ) - set(${ACI_NAME}_${file}) + zephyr_get(COMMON_CHILD_IMAGE_CONFIG_DIR) + string(CONFIGURE "${COMMON_CHILD_IMAGE_CONFIG_DIR}" COMMON_CHILD_IMAGE_CONFIG_DIR) + foreach(config_dir ${APPLICATION_CONFIG_DIR} ${COMMON_CHILD_IMAGE_CONFIG_DIR} ) + set(ACI_CONF_DIR ${config_dir}/child_image) + set(ACI_NAME_CONF_DIR ${config_dir}/child_image/${ACI_NAME}) + if (NOT ${ACI_NAME}_CONF_FILE) + if(DEFINED CONF_FILE_BUILD_TYPE AND DEFINED ${ACI_NAME}_FILE_SUFFIX) + message(WARNING "Cannot use BUILD_TYPE='${CONF_FILE_BUILD_TYPE}' together with ${ACI_NAME}_FILE_SUFFIX='${${ACI_NAME}_FILE_SUFFIX}'. " + "Ignoring BUILD_TYPE='${CONF_FILE_BUILD_TYPE}'" + ) + else() + set(LEGACY_BUILD_ARGUMENT BUILD ${CONF_FILE_BUILD_TYPE}) + endif() + ncs_file(CONF_FILES ${ACI_NAME_CONF_DIR} + BOARD ${ACI_BOARD} + # Child image always uses the same revision as parent board. + BOARD_REVISION ${BOARD_REVISION} + KCONF ${ACI_NAME}_CONF_FILE + DTS ${ACI_NAME}_DTC_OVERLAY_FILE + ${LEGACY_BUILD_ARGUMENT} + SUFFIX ${${ACI_NAME}_FILE_SUFFIX} + ) + # Place the result in the CMake cache and remove local scoped variable. + foreach(file CONF_FILE DTC_OVERLAY_FILE) + if(DEFINED ${ACI_NAME}_${file}) + set(${ACI_NAME}_${file} ${${ACI_NAME}_${file}} CACHE STRING + "Default ${ACI_NAME} configuration file" FORCE + ) + set(${ACI_NAME}_${file}) + endif() + endforeach() + + # Check for configuration fragment. The contents of these are appended + # to the project configuration, as opposed to the CONF_FILE which is used + # as the base configuration. + if(DEFINED ${ACI_NAME}_FILE_SUFFIX) + # Child/parent image does not support a prefix for the main application, therefore only + # use child image configuration with suffixes if specifically commanded with an argument + # targeting this child image + set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}.conf) + zephyr_file_suffix(child_image_conf_fragment SUFFIX ${${ACI_NAME}_FILE_SUFFIX}) + elseif(NOT "${CONF_FILE_BUILD_TYPE}" STREQUAL "") + set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}_${CONF_FILE_BUILD_TYPE}.conf) + else() + set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}.conf) + endif() + if (EXISTS ${child_image_conf_fragment}) + add_overlay_config(${ACI_NAME} ${child_image_conf_fragment}) endif() - endforeach() - - # Check for configuration fragment. The contents of these are appended - # to the project configuration, as opposed to the CONF_FILE which is used - # as the base configuration. - if(NOT "${CONF_FILE_BUILD_TYPE}" STREQUAL "") - set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}_${CONF_FILE_BUILD_TYPE}.conf) - else() - set(child_image_conf_fragment ${ACI_CONF_DIR}/${ACI_NAME}.conf) - endif() - if (EXISTS ${child_image_conf_fragment}) - add_overlay_config(${ACI_NAME} ${child_image_conf_fragment}) - endif() - # Check for overlay named .overlay. - set(child_image_dts_overlay ${ACI_CONF_DIR}/${ACI_NAME}.overlay) - if (EXISTS ${child_image_dts_overlay}) - add_overlay_dts(${ACI_NAME} ${child_image_dts_overlay}) + # Check for overlay named .overlay. + set(child_image_dts_overlay ${ACI_CONF_DIR}/${ACI_NAME}.overlay) + zephyr_file_suffix(child_image_dts_overlay SUFFIX ${${ACI_NAME}_FILE_SUFFIX}) + if (EXISTS ${child_image_dts_overlay}) + add_overlay_dts(${ACI_NAME} ${child_image_dts_overlay}) + endif() + + if(${ACI_NAME}_CONF_FILE OR ${ACI_NAME}_DTC_OVERLAY_FILE + OR EXISTS ${child_image_conf_fragment} OR EXISTS ${child_image_dts_overlay}) + # If anything is picked up directly from APPLICATION_CONFIG_DIR, then look no further. + break() + endif() endif() - endif() + endforeach() # Construct a list of variables that, when present in the root # image, should be passed on to all child images as well. list(APPEND @@ -397,6 +426,12 @@ function(add_child_image_from_source) endif() endforeach() + # Add FILE_SUFFIX to the preload file if it is set with the specific name of this image + file(APPEND + ${preload_file} + "set(FILE_SUFFIX \"${${ACI_NAME}_FILE_SUFFIX}\" CACHE INTERNAL \"NCS child image controlled\")\n" + ) + get_cmake_property(VARIABLES VARIABLES) get_cmake_property(VARIABLES_CACHED CACHE_VARIABLES) diff --git a/cmake/partition_manager.cmake b/cmake/partition_manager.cmake index a45650a2d353..0d231bcf4f97 100644 --- a/cmake/partition_manager.cmake +++ b/cmake/partition_manager.cmake @@ -26,15 +26,26 @@ endmacro() # Load static configuration if found. # Try user defined file first, then file found in configuration directory, # finally file from board directory. +if(SYSBUILD) + zephyr_get(PM_STATIC_YML_FILE SYSBUILD GLOBAL) +endif() + if(DEFINED PM_STATIC_YML_FILE) string(CONFIGURE "${PM_STATIC_YML_FILE}" user_def_pm_static) endif() -ncs_file(CONF_FILES ${APPLICATION_CONFIG_DIR} - PM conf_dir_pm_static - DOMAIN ${DOMAIN} - BUILD ${CONF_FILE_BUILD_TYPE} -) +zephyr_get(COMMON_CHILD_IMAGE_CONFIG_DIR) +string(CONFIGURE "${COMMON_CHILD_IMAGE_CONFIG_DIR}" COMMON_CHILD_IMAGE_CONFIG_DIR) +foreach(config_dir ${APPLICATION_CONFIG_DIR} ${COMMON_CHILD_IMAGE_CONFIG_DIR}) + ncs_file(CONF_FILES ${config_dir} + PM conf_dir_pm_static + DOMAIN ${DOMAIN} + BUILD ${CONF_FILE_BUILD_TYPE} + ) + if(EXISTS ${conf_dir_pm_static}) + break() + endif() +endforeach() ncs_file(CONF_FILES ${BOARD_DIR} PM board_dir_pm_static diff --git a/cmake/sysbuild/modules/ncs_sysbuild_extensions.cmake b/cmake/sysbuild/modules/ncs_sysbuild_extensions.cmake index 68c2f9987892..cf2f5fd27aa5 100644 --- a/cmake/sysbuild/modules/ncs_sysbuild_extensions.cmake +++ b/cmake/sysbuild/modules/ncs_sysbuild_extensions.cmake @@ -30,7 +30,7 @@ function(ExternalNcsVariantProject_Add) get_cmake_property(sysbuild_cache CACHE_VARIABLES) foreach(var_name ${sysbuild_cache}) - if("${var_name}" MATCHES "^(${}_.*)$") + if("${var_name}" MATCHES "^(${VBUILD_APPLICATION}_.*)$") string(LENGTH "${VBUILD_APPLICATION}" tmplen) string(SUBSTRING "${var_name}" ${tmplen} -1 tmp) set(${VBUILD_VARIANT}${tmp} "${${var_name}}" CACHE UNINITIALIZED "" FORCE) diff --git a/cmake/sysbuild/suit.cmake b/cmake/sysbuild/suit.cmake new file mode 100644 index 000000000000..e184f7cfe833 --- /dev/null +++ b/cmake/sysbuild/suit.cmake @@ -0,0 +1,282 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +include(${CMAKE_CURRENT_LIST_DIR}/suit_utilities.cmake) + +# Copy input template into destination directory. +# +# Usage: +# suit_copy_input_templates( ) +# +# Parameters: +# 'destination_template_directory' - destination directory +# 'source_template_path' - path to the source template +# 'output_variable' - variable to store new path to the copied template +function(suit_copy_input_template destination_template_directory source_template_path output_variable) + cmake_path(GET source_template_path FILENAME source_filename) + set(destination_template_path "${destination_template_directory}/${source_filename}") + if(NOT EXISTS ${source_template_path}) + message(SEND_ERROR "DFU: Could not find default SUIT template: '${source_template_path}'. Corrupted configuration?") + return() + endif() + if(NOT EXISTS ${destination_template_path}) + # copy default template and create digest + configure_file(${source_template_path} ${destination_template_path} COPYONLY) + file(SHA256 ${destination_template_path} checksum_variable) + file(WRITE "${destination_template_path}.digest" ${checksum_variable}) + endif() + if(NOT EXISTS "${destination_template_path}.digest") + # restore digest removed by user to discard warning about changes in the source template + file(SHA256 ${source_template_path} checksum_variable) + file(WRITE "${destination_template_path}.digest" ${checksum_variable}) + endif() + cmake_path(GET source_template_path FILENAME copied_filename) + set(${output_variable} "${destination_template_directory}/${copied_filename}" PARENT_SCOPE) +endfunction() + +# Check digests for template. +# +# Usage: +# suit_check_template_digest( ) +# +# Parameters: +# 'destination_template_directory' - destination directory +# 'template_path' - path to the source template +function(suit_check_template_digest destination_template_directory source_template_path) + suit_set_absolute_or_relative_path(${source_template_path} ${PROJECT_BINARY_DIR} source_template_path) + if(NOT EXISTS ${source_template_path}) + message(SEND_ERROR "DFU: Could not find default SUIT template: '${source_template_path}'. Corrupted configuration?") + return() + endif() + cmake_path(GET source_template_path FILENAME source_filename) + set(input_file "${destination_template_directory}/${source_filename}") + + file(SHA256 ${source_template_path} CHECKSUM_DEFAULT) + set(DIGEST_STORAGE "${input_file}.digest") + file(STRINGS ${DIGEST_STORAGE} CHECKSUM_STORED) + if(NOT ${CHECKSUM_DEFAULT} STREQUAL ${CHECKSUM_STORED}) + message(SEND_ERROR "DFU: Outdated input SUIT template detected - consider update.\n" + "Some changes has been done to the SUIT_ENVELOPE_DEFAULT_TEMPLATE which was used to create your ${input_file}.\n" + "Please review these changes and remove ${input_file}.digest file to bypass this error.\n" + ) + endif() +endfunction() + +# Create digest for input file. +# +# Usage: +# suit_create_digest( ) +# +# Parameters: +# 'input_file' - input file to calculate digest on +# 'output_file' - output file to store calculated digest +function(suit_create_digest input_file output_file) + file(SHA256 ${input_file} CHECKSUM_VARIABLE) + file(WRITE ${output_file} ${CHECKSUM_VARIABLE}) +endfunction() + +# Resolve passed absolute or relative path to real path. +# +# Usage: +# suit_set_absolute_or_relative_path( ) +# +# Parameters: +# 'path' - path to resolve +# 'relative_root' - root folder used in case of relative path +# 'output_variable' - variable to store results +function(suit_set_absolute_or_relative_path path relative_root output_variable) + if(NOT IS_ABSOLUTE ${path}) + file(REAL_PATH "${relative_root}/${path}" path) + endif() + set(${output_variable} "${path}" PARENT_SCOPE) +endfunction() + +# Sign an envelope using SIGN_SCRIPT. +# +# Usage: +# suit_sign_envelope( ) +# +# Parameters: +# 'input_file' - path to input unsigned envelope +# 'output_file' - path to output signed envelope +function(suit_sign_envelope input_file output_file) + cmake_path(GET ZEPHYR_NRF_MODULE_DIR PARENT_PATH NRF_DIR_PARENT) + sysbuild_get(CONFIG_SUIT_ENVELOPE_SIGN_SCRIPT IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_SIGN_SCRIPT KCONFIG) + suit_set_absolute_or_relative_path(${CONFIG_SUIT_ENVELOPE_SIGN_SCRIPT} ${NRF_DIR_PARENT} SIGN_SCRIPT) + if(NOT EXISTS ${SIGN_SCRIPT}) + message(SEND_ERROR "DFU: ${CONFIG_SUIT_ENVELOPE_SIGN_SCRIPT} does not exist. Corrupted configuration?") + return() + endif() + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${PYTHON_EXECUTABLE} ${SIGN_SCRIPT} + --input-file ${input_file} + --output-file ${output_file} + ) +endfunction() + +# Register SUIT post build commands. +# +# Usage: +# suit_register_post_build_commands() +# +function(suit_register_post_build_commands) + get_property( + post_build_commands + GLOBAL PROPERTY + SUIT_POST_BUILD_COMMANDS + ) + + foreach(image ${IMAGES}) + sysbuild_get(BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE) + sysbuild_get(BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG) + list(APPEND dependencies "${BINARY_DIR}/zephyr/${BINARY_FILE}.bin") + endforeach() + + add_custom_target( + create_suit_artifacts + ALL + ${post_build_commands} + DEPENDS + ${dependencies} + COMMAND_EXPAND_LISTS + COMMENT "Create SUIT artifacts" + ) +endfunction() + +# Create DFU package/main envelope. +# +# Usage: +# suit_create_package() +# +function(suit_create_package) + add_custom_target( + suit_prepare_output_folder + ALL + COMMAND ${CMAKE_COMMAND} -E make_directory ${SUIT_ROOT_DIRECTORY} + COMMENT + "Create DFU output directory" + ) + set(SUIT_OUTPUT_ARTIFACTS_ITEMS) + set(SUIT_OUTPUT_ARTIFACTS_TARGETS) + set(CORE_ARGS) + set(STORAGE_BOOT_ARGS) + + sysbuild_get(CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION KCONFIG) + suit_set_absolute_or_relative_path(${CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION} ${PROJECT_BINARY_DIR} INPUT_TEMPLATES_DIRECTORY) + sysbuild_get(ENVELOPE_SHALL_BE_SIGNED IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_SIGN KCONFIG) + if(NOT DEFINED ENVELOPE_SHALL_BE_SIGNED) + set(ENVELOPE_SHALL_BE_SIGNED FALSE) + endif() + + foreach(image ${IMAGES}) + sysbuild_get(INPUT_ENVELOPE_JINJA_FILE IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TEMPLATE KCONFIG) + sysbuild_get(target IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG) + sysbuild_get(BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE) + sysbuild_get(BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG) + suit_copy_input_template(${INPUT_TEMPLATES_DIRECTORY} "${INPUT_ENVELOPE_JINJA_FILE}" ENVELOPE_JINJA_FILE) + if(NOT DEFINED ENVELOPE_JINJA_FILE) + message(SEND_ERROR "DFU: Creation of SUIT artifacts failed.") + return() + endif() + suit_check_template_digest(${INPUT_TEMPLATES_DIRECTORY} "${INPUT_ENVELOPE_JINJA_FILE}") + set(BINARY_FILE "${BINARY_FILE}.bin") + + list(APPEND CORE_ARGS + --core ${target},${SUIT_ROOT_DIRECTORY}${target}.bin,${BINARY_DIR}/zephyr/edt.pickle + ) + + sysbuild_get(CONFIG_SUIT_ENVELOPE_ROOT_ARTIFACT_NAME IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_ROOT_ARTIFACT_NAME KCONFIG) + set(ENVELOPE_YAML_FILE ${SUIT_ROOT_DIRECTORY}${target}.yaml) + set(ENVELOPE_SUIT_FILE ${SUIT_ROOT_DIRECTORY}${target}.suit) + + suit_copy_artifact_to_output_directory(${target} ${BINARY_DIR}/zephyr/${BINARY_FILE}) + suit_render_template(${ENVELOPE_JINJA_FILE} ${ENVELOPE_YAML_FILE} "${CORE_ARGS}") + suit_create_envelope(${ENVELOPE_YAML_FILE} ${ENVELOPE_SUIT_FILE} ${ENVELOPE_SHALL_BE_SIGNED}) + list(APPEND STORAGE_BOOT_ARGS + --input-envelope ${ENVELOPE_SUIT_FILE} + ) + endforeach() + + sysbuild_get(INPUT_ROOT_ENVELOPE_JINJA_FILE IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE KCONFIG) + + # create root envelope if defined + if(DEFINED INPUT_ROOT_ENVELOPE_JINJA_FILE AND NOT INPUT_ROOT_ENVELOPE_JINJA_FILE STREQUAL "") + sysbuild_get(ROOT_NAME IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE_ROOT_ARTIFACT_NAME KCONFIG) + if(NOT DEFINED ROOT_NAME OR ROOT_NAME STREQUAL "") + set(ROOT_NAME "root") + endif() + suit_copy_input_template(${INPUT_TEMPLATES_DIRECTORY} "${INPUT_ROOT_ENVELOPE_JINJA_FILE}" ROOT_ENVELOPE_JINJA_FILE) + suit_check_template_digest(${INPUT_TEMPLATES_DIRECTORY} "${INPUT_ROOT_ENVELOPE_JINJA_FILE}") + set(ROOT_ENVELOPE_YAML_FILE ${SUIT_ROOT_DIRECTORY}${ROOT_NAME}.yaml) + set(ROOT_ENVELOPE_SUIT_FILE ${SUIT_ROOT_DIRECTORY}${ROOT_NAME}.suit) + suit_render_template(${ROOT_ENVELOPE_JINJA_FILE} ${ROOT_ENVELOPE_YAML_FILE} "${CORE_ARGS}") + suit_create_envelope(${ROOT_ENVELOPE_YAML_FILE} ${ROOT_ENVELOPE_SUIT_FILE} ${ENVELOPE_SHALL_BE_SIGNED}) + list(APPEND STORAGE_BOOT_ARGS + --input-envelope ${ROOT_ENVELOPE_SUIT_FILE} + ) + endif() + + sysbuild_get(DEFAULT_BINARY_DIR IMAGE ${DEFAULT_IMAGE} VAR APPLICATION_BINARY_DIR CACHE) + # create all storages in the DEFAULT_IMAGE output directory + list(APPEND STORAGE_BOOT_ARGS --storage-output-directory "${DEFAULT_BINARY_DIR}/zephyr" --zephyr-base ${ZEPHYR_BASE} ${CORE_ARGS}) + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${PYTHON_EXECUTABLE} + ${SUIT_GENERATOR_BUILD_SCRIPT} + storage + ${STORAGE_BOOT_ARGS} + ) + suit_setup_merge() + suit_register_post_build_commands() +endfunction() + +# Setup task to create final and merged artifact. +# +# Usage: +# suit_setup_merge() +# +function(suit_setup_merge) + sysbuild_get(BINARY_DIR IMAGE ${DEFAULT_IMAGE} VAR APPLICATION_BINARY_DIR CACHE) + foreach(image ${IMAGES}) + set(ARTIFACTS_TO_MERGE) + sysbuild_get(IMAGE_BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE) + sysbuild_get(IMAGE_BINARY_FILE IMAGE ${image} VAR CONFIG_KERNEL_BIN_NAME KCONFIG) + sysbuild_get(IMAGE_TARGET_NAME IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG) + + sysbuild_get(CONFIG_SUIT_ENVELOPE_OUTPUT_ARTIFACT IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_OUTPUT_ARTIFACT KCONFIG) + sysbuild_get(CONFIG_NRF_REGTOOL_GENERATE_UICR IMAGE ${image} VAR CONFIG_NRF_REGTOOL_GENERATE_UICR KCONFIG) + sysbuild_get(CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE KCONFIG) + + set(OUTPUT_HEX_FILE "${IMAGE_BINARY_DIR}/zephyr/${CONFIG_SUIT_ENVELOPE_OUTPUT_ARTIFACT}") + + list(APPEND ARTIFACTS_TO_MERGE ${BINARY_DIR}/zephyr/storage_${IMAGE_TARGET_NAME}.hex) + list(APPEND ARTIFACTS_TO_MERGE ${IMAGE_BINARY_DIR}/zephyr/${IMAGE_BINARY_FILE}.hex) + if(CONFIG_SUIT_ENVELOPE_OUTPUT_MPI_MERGE) + list(APPEND ARTIFACTS_TO_MERGE ${BINARY_DIR}/zephyr/suit_mpi_${IMAGE_TARGET_NAME}_merged.hex) + endif() + if(CONFIG_NRF_REGTOOL_GENERATE_UICR) + list(APPEND ARTIFACTS_TO_MERGE ${IMAGE_BINARY_DIR}/zephyr/uicr.hex) + endif() + + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/mergehex.py + --overlap replace + -o ${OUTPUT_HEX_FILE} + ${ARTIFACTS_TO_MERGE} + # fixme: uicr_merged is overwritten by new content, runners_yaml_props_target could be used to define + # what shall be flashed, but not sure where to set this! Remove --overlap if ready! + # example usage: set_property(TARGET runners_yaml_props_target PROPERTY hex_file ${merged_hex_file}) + COMMAND ${CMAKE_COMMAND} -E copy ${OUTPUT_HEX_FILE} ${IMAGE_BINARY_DIR}/zephyr/uicr_merged.hex + ) + endforeach() +endfunction() + +# Enable SUIT envelope generation only if DEFAULT_IMAGE has it enabled. +sysbuild_get(CONFIG_SUIT_ENVELOPE IMAGE ${DEFAULT_IMAGE} VAR CONFIG_SUIT_ENVELOPE KCONFIG) +if(CONFIG_SUIT_ENVELOPE) + suit_create_package() +endif() \ No newline at end of file diff --git a/cmake/sysbuild/suit_utilities.cmake b/cmake/sysbuild/suit_utilities.cmake new file mode 100644 index 000000000000..e7cb0af9cfed --- /dev/null +++ b/cmake/sysbuild/suit_utilities.cmake @@ -0,0 +1,81 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(SUIT_GENERATOR_BUILD_SCRIPT "${ZEPHYR_SUIT_GENERATOR_MODULE_DIR}/ncs/build.py") +set(SUIT_GENERATOR_CLI_SCRIPT "${ZEPHYR_SUIT_GENERATOR_MODULE_DIR}/suit_generator/cli.py") +set(SUIT_OUTPUT_ARTIFACTS_DIRECTORY "DFU") + +if(NOT DEFINED SUIT_ROOT_DIRECTORY) + set(SUIT_ROOT_DIRECTORY ${APPLICATION_BINARY_DIR}/${SUIT_OUTPUT_ARTIFACTS_DIRECTORY}/) +endif() + +# Copy artifact to the common SUIT output directory. +# +# Usage: +# suit_copy_artifact_to_output_directory( ) +# +# Parameters: +# 'target' - target name +# 'artifact' - path to artifact +function(suit_copy_artifact_to_output_directory target artifact) + cmake_path(GET artifact FILENAME artifact_filename) + cmake_path(GET artifact EXTENSION artifact_extension) + set(destination_name "${target}${artifact_extension}") + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${CMAKE_COMMAND} -E copy ${artifact} ${SUIT_ROOT_DIRECTORY}${target}.bin + ) +endfunction() + +# Render jinja templates using passed arguments. +# Function uses core_arguments which is list of folowing entries: +# --core ,, +# +# Usage: +# suit_render_template( ) +# +# Parameters: +# 'input_file' - path to input jinja template +# 'output_file' - path to output yaml file +# 'core_arguments' - list of arguments for registered cores +function(suit_render_template input_file output_file core_arguments) + set(TEMPLATE_ARGS) + list(APPEND TEMPLATE_ARGS + --template-suit ${input_file} + --output-suit ${output_file} + --zephyr-base ${ZEPHYR_BASE} + ) + list(APPEND TEMPLATE_ARGS ${core_arguments}) + list(APPEND TEMPLATE_ARGS --artifacts-folder "${SUIT_ROOT_DIRECTORY}") + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_BUILD_SCRIPT} + template + ${TEMPLATE_ARGS} + ) +endfunction() + +# Create binary envelope from input yaml file. +# +# Usage: +# suit_create_envelope( ) +# +# Parameters: +# 'input_file' - path to input yaml configuration +# 'output_file' - path to output binary suit envelope +# 'create_signature' - sign the envelope if set to true +function(suit_create_envelope input_file output_file create_signature) + set_property( + GLOBAL APPEND PROPERTY SUIT_POST_BUILD_COMMANDS + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} + create + --input-file ${input_file} + --output-file ${output_file} + ) + if (create_signature) + suit_sign_envelope(${output_file} ${output_file}) + endif() +endfunction() \ No newline at end of file diff --git a/cmake/version.cmake b/cmake/version.cmake index 5dab2f7be992..b854bc5a79a6 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,13 +1,5 @@ math(EXPR NCS_VERSION_CODE "(${NCS_VERSION_MAJOR} << 16) + (${NCS_VERSION_MINOR} << 8) + (${NCS_VERSION_PATCH})") - -# to_hex is made available by ${ZEPHYR_BASE}/cmake/hex.cmake -to_hex(${NCS_VERSION_CODE} NCS_VERSION_NUMBER) - -if(DEFINED BUILD_VERSION) - set(ncs_banner_version BUILD_VERSION) -else() - set(ncs_banner_version NCS_BUILD_VERSION) -endif() +math(EXPR NCS_VERSION_NUMBER ${NCS_VERSION_CODE} OUTPUT_FORMAT HEXADECIMAL) add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/include/generated/ncs_version.h @@ -23,10 +15,32 @@ add_custom_command( -DNCS_VERSION_MINOR=${NCS_VERSION_MINOR} -DNCS_PATCHLEVEL=${NCS_VERSION_PATCH} -DNCS_VERSION_STRING=${NCS_VERSION} - -DNCS_VERSION_CUSTOMIZATION="\#define;BANNER_VERSION;STRINGIFY\(${ncs_banner_version}\)" -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake DEPENDS ${NRF_DIR}/VERSION ${git_dependency} ) add_custom_target(ncs_version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/ncs_version.h) - add_dependencies(version_h ncs_version_h) + +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/include/generated/ncs_commit.h + COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE} -DNRF_DIR=${NRF_DIR} + -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/ncs_commit.h + -DCOMMIT_TYPE=NCS + -DCOMMIT_PATH=${NRF_DIR} + -P ${ZEPHYR_NRF_MODULE_DIR}/cmake/gen_commit_h.cmake + DEPENDS ${NRF_DIR}/VERSION ${NRF_DIR}/.git ${NRF_DIR}/.git/index +) +add_custom_target(ncs_commit_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/ncs_commit.h) +add_dependencies(version_h ncs_commit_h) + +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/include/generated/zephyr_commit.h + COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE} -DNRF_DIR=${NRF_DIR} + -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/zephyr_commit.h + -DCOMMIT_TYPE=ZEPHYR + -DCOMMIT_PATH=${ZEPHYR_BASE} + -P ${ZEPHYR_NRF_MODULE_DIR}/cmake/gen_commit_h.cmake + DEPENDS ${ZEPHYR_BASE}/VERSION ${ZEPHYR_BASE}/.git ${git_dependency} +) +add_custom_target(zephyr_commit_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr_commit.h) +add_dependencies(version_h zephyr_commit_h) diff --git a/cmake/version_app.cmake b/cmake/version_app.cmake new file mode 100644 index 000000000000..e2a2f7bd9ebd --- /dev/null +++ b/cmake/version_app.cmake @@ -0,0 +1,45 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if(${APP_VERSION_NUMBER}) + find_package(Git QUIET) + if(GIT_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --absolute-git-dir + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE app_git_dir + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE stderr + RESULT_VARIABLE return_code) + if(return_code) + message(WARNING "APP_VERSION: git rev-parse failed: ${stderr}") + else() + if(NOT "${stderr}" STREQUAL "") + message(WARNING "APP_VERSION: git rev-parse warned: ${stderr}") + else() + set(APP_GIT_INDEX ${app_git_dir}/index) + endif() + endif() + endif() + + if(DEFINED APP_GIT_INDEX) + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/include/generated/app_commit.h + COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE} -DNRF_DIR=${NRF_DIR} + -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/app_commit.h + -DCOMMIT_TYPE=APP + -DCOMMIT_PATH=${CMAKE_SOURCE_DIR} + -P ${ZEPHYR_NRF_MODULE_DIR}/cmake/gen_commit_h.cmake + DEPENDS ${CMAKE_SOURCE_DIR}/VERSION ${APP_GIT_INDEX} + ) + add_custom_target(app_commit_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/app_commit.h) + add_dependencies(version_h app_commit_h) + + # Add a compile definition so that the commit can be printed + zephyr_compile_definitions(NCS_APPLICATION_BOOT_BANNER_GIT_REPO) + endif() +endif() diff --git a/doc/_extensions/table_from_rows.py b/doc/_extensions/table_from_rows.py index 3599c50efe9a..72d750a47471 100644 --- a/doc/_extensions/table_from_rows.py +++ b/doc/_extensions/table_from_rows.py @@ -7,7 +7,7 @@ from docutils.utils.error_reporting import ErrorString from docutils.parsers.rst import directives from sphinx.util.docutils import SphinxDirective -from typing import Dict, Set +from typing import Dict, Set, List import os import yaml import re @@ -166,6 +166,10 @@ def _merge_rows(rows): for row in to_delete: rows.remove(row) + @staticmethod + def _normalize_boards(boards: List[str]) -> List[str]: + return [board.replace("/", "_") for board in boards] + @staticmethod def _find_shields(shields: Dict[str, Set[str]], sample_data: dict): """Associate all integration platforms for a sample with any shield used. @@ -227,11 +231,19 @@ def _rows_from_sample_yaml(self, path): data = yaml.safe_load(sample_yaml) if 'common' in data and 'integration_platforms' in data['common']: - boards.update(data['common']['integration_platforms']) + boards.update( + TableFromSampleYaml._normalize_boards( + data['common']['integration_platforms'] + ) + ) self._find_shields(shields, data['common']) for test in data['tests'].values(): if 'integration_platforms' in test: - boards.update(test['integration_platforms']) + boards.update( + TableFromSampleYaml._normalize_boards( + test['integration_platforms'] + ) + ) self._find_shields(shields, test) boards = list(filter( diff --git a/doc/_scripts/software_maturity/software_maturity_features.yaml b/doc/_scripts/software_maturity/software_maturity_features.yaml index 00ce3cd8905f..5db87baf649f 100644 --- a/doc/_scripts/software_maturity/software_maturity_features.yaml +++ b/doc/_scripts/software_maturity/software_maturity_features.yaml @@ -14,7 +14,7 @@ top_table: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 features: sidewalk: Sidewalk over BLE: SIDEWALK && SIDEWALK_LINK_MASK_BLE @@ -75,7 +75,7 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 Scan only (for location accuracy): rule: WIFI_NRF700X && !WPA_SUPP boards_and_shields: @@ -84,15 +84,15 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 Bluetooth LE Co-existence: - rule: WIFI_NRF700X && NRF700X_BT_COEX + rule: WIFI_NRF700X && NRF700X_SR_COEX boards_and_shields: - SHIELD_NRF7002EK - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 SoftAP Mode: rule: WIFI_NRF700X && NRF700X_AP_MODE && WPA_SUPP_AP boards_and_shields: @@ -101,7 +101,7 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 Monitor Mode: rule: WIFI_NRF700X && NRF700X_RAW_DATA_RX boards_and_shields: @@ -110,7 +110,7 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 TX injection Mode: rule: WIFI_NRF700X && NRF700X_RAW_DATA_TX boards_and_shields: @@ -119,7 +119,7 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 Promiscuous Mode: rule: WIFI_NRF700X && NRF700X_PROMISC_DATA_RX boards_and_shields: @@ -127,7 +127,7 @@ features: - SHIELD_NRF7002EK_NRF7001 - SHIELD_NRF7002EB - BOARD_NRF7002DK_NRF5340_CPUAPP - - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP + - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 trusted_firmware_m: Minimal Build: BUILD_WITH_TFM && TFM_PROFILE_TYPE_MINIMAL Full build: BUILD_WITH_TFM && TFM_PROFILE_TYPE_NOT_SET && NRF_SECURITY @@ -150,4 +150,4 @@ display_names: SHIELD_NRF7002EK_NRF7001: nRF7002 EK in nRF7001 emulation mode SHIELD_NRF7002EB: nRF7002 EB BOARD_NRF7002DK_NRF5340_CPUAPP: nRF7002 DK - BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP: nRF7002 DK in nRF7001 emulation mode + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001: nRF7002 DK in nRF7001 emulation mode diff --git a/doc/_scripts/software_maturity/software_maturity_scanner.py b/doc/_scripts/software_maturity/software_maturity_scanner.py index cd0bc4daa7d4..6d251d8052f6 100644 --- a/doc/_scripts/software_maturity/software_maturity_scanner.py +++ b/doc/_scripts/software_maturity/software_maturity_scanner.py @@ -159,7 +159,7 @@ NRF_SAMPLE_DIR = Path(__file__).absolute().parents[3] """Directory containing samples/ and applications/ subfolders.""" -BOARD_FILTER = lambda b: re.search(r"_nrf[0-9]+", b) and not b.startswith("nrf51") +BOARD_FILTER = lambda b: re.search(r"/nrf[0-9]+", b) and not b.startswith("nrf51") """Function to filter non-relevant boards.""" @@ -295,7 +295,7 @@ def find_all_socs(all_samples: List[str]) -> List[str]: # Only use nRF boards, but not nRF51 series all_boards = set(filter(BOARD_FILTER, all_boards)) - all_socs = {re.findall(r"_(nrf[0-9]+)", b)[-1] for b in all_boards} + all_socs = {b.split("/")[1] for b in all_boards} return list(sorted(all_socs)) diff --git a/doc/_utils/redirects.py b/doc/_utils/redirects.py index b9b22bc1a74e..a33c770319b3 100644 --- a/doc/_utils/redirects.py +++ b/doc/_utils/redirects.py @@ -58,8 +58,10 @@ ("app_dev/pin_control/index", "device_guides/pin_control"), ("ug_unity_testing", "test_and_optimize/testing_unity_cmock"), ("app_dev/testing_unity_cmock/index", "test_and_optimize/testing_unity_cmock"), + ("test_and_optimize/testing_unity_cmock", "test_and_optimize/test_framework/testing_unity_cmock"), ("ug_tfm", "security/tfm"), ("app_dev/tfm/index", "security/tfm"), + ("app_dev/ap_protect/index", "security/ap_protect"), ("app_build_system", "config_and_build/config_and_build_system"), ("app_dev/build_and_config_system/index", "config_and_build/config_and_build_system"), ("ug_radio_coex", "device_guides/wifi_coex"), @@ -215,12 +217,15 @@ ("working_with_nrf/nrf52/features","device_guides/working_with_nrf/nrf52/features"), ("ug_nrf52_gs","device_guides/working_with_nrf/nrf52/gs"), ("working_with_nrf/nrf52/gs","device_guides/working_with_nrf/nrf52/gs"), + ("device_guides/working_with_nrf/nrf52/gs", "gsg_guides/nrf52_gs"), ("ug_nrf5340","device_guides/working_with_nrf/nrf53/nrf5340"), ("working_with_nrf/nrf53/nrf5340","device_guides/working_with_nrf/nrf53/nrf5340"), + ("device_guides/working_with_nrf/nrf53/nrf5340_gs", "gsg_guides/nrf5340_gs"), ("ug_thingy53","device_guides/working_with_nrf/nrf53/thingy53"), ("working_with_nrf/nrf53/thingy53","device_guides/working_with_nrf/nrf53/thingy53"), ("ug_thingy53_gs","device_guides/working_with_nrf/nrf53/thingy53_gs"), ("working_with_nrf/nrf53/thingy53_gs","device_guides/working_with_nrf/nrf53/thingy53_gs"), + ("device_guides/working_with_nrf/nrf53/thingy53_gs", "gsg_guides/thingy53_gs"), ("ug_nrf7002_constrained","device_guides/working_with_nrf/nrf70/developing/constrained"), ("working_with_nrf/nrf70/developing/constrained","device_guides/working_with_nrf/nrf70/developing/constrained"), ("ug_nrf70_developing","device_guides/working_with_nrf/nrf70/developing/index"), @@ -233,6 +238,7 @@ ("working_with_nrf/nrf70/features","device_guides/working_with_nrf/nrf70/features"), ("ug_nrf7002_gs","device_guides/working_with_nrf/nrf70/gs"), ("working_with_nrf/nrf70/gs","device_guides/working_with_nrf/nrf70/gs"), + ("device_guides/working_with_nrf/nrf70/gs", "gsg_guides/nrf7002_gs"), ("device_guides/working_with_nrf/nrf70/developing/debugging","protocols/wifi/debugging"), ("device_guides/working_with_nrf/nrf70/developing/raw_tx_operation","protocols/wifi/raw_tx_operation"), ("protocols/wifi/raw_tx_operation","protocols/wifi/advanced_modes/raw_tx_operation"), @@ -245,12 +251,14 @@ ("working_with_nrf/nrf91/nrf9160","device_guides/working_with_nrf/nrf91/nrf9160"), ("ug_nrf9160_gs","device_guides/working_with_nrf/nrf91/nrf9160_gs"), ("working_with_nrf/nrf91/nrf9160_gs","device_guides/working_with_nrf/nrf91/nrf9160_gs"), + ("device_guides/working_with_nrf/nrf91/nrf9160_gs", "gsg_guides/nrf9160_gs"), ("ug_nrf91_features","device_guides/working_with_nrf/nrf91/nrf91_features"), ("working_with_nrf/nrf91/nrf91_features","device_guides/working_with_nrf/nrf91/nrf91_features"), ("ug_thingy91","device_guides/working_with_nrf/nrf91/thingy91"), ("working_with_nrf/nrf91/thingy91","device_guides/working_with_nrf/nrf91/thingy91"), ("ug_thingy91_gsg","device_guides/working_with_nrf/nrf91/thingy91_gsg"), ("working_with_nrf/nrf91/thingy91_gsg","device_guides/working_with_nrf/nrf91/thingy91_gsg"), + ("device_guides/working_with_nrf/nrf91/thingy91_gsg", "gsg_guides/thingy91_gsg"), ("known_issues","releases_and_maturity/known_issues"), ("libraries/networking/nrf_cloud_agps","libraries/networking/nrf_cloud_agnss"), ("applications/nrf5340_audio/README","applications/nrf5340_audio/index"), @@ -260,4 +268,17 @@ ("libraries/nrf_security/doc/driver_config", "libraries/security/nrf_security/doc/driver_config"), ("libraries/nrf_security/doc/drivers", "libraries/security/nrf_security/doc/drivers"), ("libraries/nrf_security/doc/mbed_tls_header", "libraries/security/nrf_security/doc/mbed_tls_header"), + ("libraries/bin/bt_ll_acs_nrf53/index", "nrfxlib/softdevice_controller/doc/isochronous_channels"), + ("libraries/others/fatal_error", "libraries/security/fatal_error"), + ("libraries/others/flash_patch", "libraries/security/bootloader/flash_patch"), + ("libraries/others/fprotect", "libraries/security/bootloader/fprotect"), + ("libraries/others/fw_info", "libraries/security/bootloader/fw_info"), + ("libraries/others/hw_unique_key", "libraries/security/hw_unique_key"), + ("libraries/others/identity_key", "libraries/security/identity_key"), + ("libraries/tfm/index", "libraries/security/tfm/index"), + ("libraries/tfm/tfm_ioctl_api", "libraries/security/tfm/tfm_ioctl_api"), + ("libraries/bootloader/bl_crypto", "libraries/security/bootloader/bl_crypto"), + ("libraries/bootloader/bl_storage", "libraries/security/bootloader/bl_storage"), + ("libraries/bootloader/bl_validation", "libraries/security/bootloader/bl_validation"), + ("libraries/bootloader/index", "libraries/security/bootloader/index"), ] diff --git a/doc/nrf/conf.py b/doc/nrf/conf.py index cdf3df7d0b1b..0e6b55d43df5 100644 --- a/doc/nrf/conf.py +++ b/doc/nrf/conf.py @@ -28,7 +28,7 @@ project = "nRF Connect SDK" copyright = "2019-2024, Nordic Semiconductor" author = "Nordic Semiconductor" -version = release = "2.6.0" +version = release = "2.6.99" sys.path.insert(0, str(ZEPHYR_BASE / "doc" / "_extensions")) sys.path.insert(0, str(NRF_BASE / "doc" / "_extensions")) diff --git a/doc/nrf/config_and_build/board_support/board_names.rst b/doc/nrf/config_and_build/board_support/board_names.rst index 19669d5f16ab..ec52f21f2065 100644 --- a/doc/nrf/config_and_build/board_support/board_names.rst +++ b/doc/nrf/config_and_build/board_support/board_names.rst @@ -19,8 +19,8 @@ The build target column uses several entries for multi-core hardware platforms: * For usage of Cortex-M Security Extensions (CMSE): - * Entries without ``*_ns`` (``cpuapp``) - When you choose this target, you build the application core firmware as a single execution environment that does not use CMSE (:ref:`Trusted Firmware-M (TF-M) `). - * Entries with ``*_ns`` (for example, ``cpuapp_ns``) - When you choose this target, you build the application with CMSE. + * Entries without ``*/ns`` (``cpuapp``) - When you choose this target, you build the application core firmware as a single execution environment that does not use CMSE (:ref:`Trusted Firmware-M (TF-M) `). + * Entries with ``*/ns`` (for example, ``cpuapp/ns``) - When you choose this target, you build the application with CMSE. The application core firmware is placed in Non-Secure Processing Environment (NSPE) and uses Secure Processing Environment (SPE) for security features. By default, the build system automatically includes :ref:`Trusted Firmware-M (TF-M) ` in SPE and merges it with NSPE. @@ -31,112 +31,125 @@ Read more about separation of processing environments on the :ref:`app_boards_sp Boards included in sdk-zephyr ***************************** -The following boards are defined in the :file:`zephyr/boards/arm/` folder. +The following boards are defined in the :file:`zephyr/boards/nordic/` folder. Also see the :ref:`zephyr:boards` section in the Zephyr documentation. +.. note:: + |thingy52_not_supported_note| + .. _table: +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ | Hardware platform | PCA number | Board name | Build target | +===================+============+===================================================================+=======================================+ -| nRF52 DK | PCA10040 | :ref:`nrf52dk_nrf52832 ` | ``nrf52dk_nrf52832`` | -| (nRF52832) | +-------------------------------------------------------------------+---------------------------------------+ -| | | :ref:`nrf52dk_nrf52810 ` | ``nrf52dk_nrf52810`` | -| | +-------------------------------------------------------------------+---------------------------------------+ -| | | :ref:`nrf52dk_nrf52805 ` | ``nrf52dk_nrf52805`` | -+-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF52833 DK | PCA10100 | :ref:`nrf52833dk_nrf52833 ` | ``nrf52833dk_nrf52833`` | -| | +-------------------------------------------------------------------+---------------------------------------+ -| | | :ref:`nrf52833dk_nrf52820 ` | ``nrf52833dk_nrf52820`` | +| nRF9161 DK | PCA10153 | :ref:`nrf9161dk ` | ``nrf9161dk/nrf9161`` | +| | | | | +| | | | ``nrf9161dk/nrf9161/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF52840 DK | PCA10056 | :ref:`nrf52840dk_nrf52840 ` | ``nrf52840dk_nrf52840`` | +| nRF9160 DK | PCA10090 | :ref:`nrf9160dk ` | ``nrf9160dk/nrf9160`` | +| | | | | +| | | | ``nrf9160dk/nrf9160/ns`` | | | +-------------------------------------------------------------------+---------------------------------------+ -| | | :ref:`nrf52840dk_nrf52811 ` | ``nrf52840dk_nrf52811`` | +| | | :ref:`nrf9160dk ` | ``nrf9160dk/nrf52840`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF52840 Dongle | PCA10059 | :ref:`nrf52840dongle_nrf52840 ` | ``nrf52840dongle_nrf52840`` | +| nRF9151 DK | PCA10171 | :ref:`nrf9151dk ` | ``nrf9151dk/nrf9151`` | +| | | | | +| | | | ``nrf9151dk/nrf9151/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| Thingy:52 | PCA20020 | :ref:`thingy52_nrf52832 ` | ``thingy52_nrf52832`` | +| nRF9131 EK | PCA10165 | :ref:`nrf9131ek ` | ``nrf9131ek/nrf9131`` | +| | | | | +| | | | ``nrf9131ek/nrf9131/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF21540 DK | PCA10112 | :ref:`nrf21540dk_nrf52840 ` | ``nrf21540dk_nrf52840`` | +| nRF54H20 DK | PCA10175 | :ref:`nrf54h20dk ` | ``nrf54h20dk/nrf54h20/cpuapp`` | +| | | | | +| | | | ``nrf54h20dk/nrf54h20/cpurad`` | +| | | | | +| | | | ``nrf54h20dk/nrf54h20/cpuppr`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF5340 DK | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpunet`` | +| nRF54L15 PDK | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk/nrf54l15/cpuapp`` | | | | | | -| | | | ``nrf5340dk_nrf5340_cpuapp`` | +| | | | ``nrf54l15pdk@0.3.0/nrf54l15/cpuapp`` | | | | | | -| | | | ``nrf5340dk_nrf5340_cpuapp_ns`` | +| | | | ``nrf54l15pdk/nrf54l15/cpuapp/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| Thingy:53 | PCA20053 | :ref:`thingy53_nrf5340 ` | ``thingy53_nrf5340_cpunet`` | +| nRF5340 DK | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpunet`` | | | | | | -| | | | ``thingy53_nrf5340_cpuapp`` | +| | | | ``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | | ``thingy53_nrf5340_cpuapp_ns`` | +| | | | ``nrf5340dk/nrf5340/cpuapp/ns`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF5340 Audio | PCA10121 | :ref:`nrf5340_audio_dk_nrf5340 ` | ``nrf5340_audio_dk_nrf5340_cpuapp`` | +| nRF5340 Audio | PCA10121 | :ref:`nrf5340_audio_dk ` | ``nrf5340_audio_dk/nrf5340/cpuapp`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF9160 DK | PCA10090 | :ref:`nrf9160dk_nrf9160 ` | ``nrf9160dk_nrf9160`` | +| Thingy:53 | PCA20053 | :ref:`thingy53 ` | ``thingy53/nrf5340/cpunet`` | +| | | | | +| | | | ``thingy53/nrf5340/cpuapp`` | | | | | | -| | | | ``nrf9160dk_nrf9160_ns`` | +| | | | ``thingy53/nrf5340/cpuapp/ns`` | ++-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ +| nRF52840 DK | PCA10056 | :ref:`nrf52840dk ` | ``nrf52840dk/nrf52840`` | | | +-------------------------------------------------------------------+---------------------------------------+ -| | | :ref:`nrf9160dk_nrf52840 ` | ``nrf9160dk_nrf52840`` | +| | | :ref:`nrf52840dk ` | ``nrf52840dk/nrf52811`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF9161 DK | PCA10153 | :ref:`nrf9161dk_nrf9161 ` | ``nrf9161dk_nrf9161`` | -| | | | | -| | | | ``nrf9161dk_nrf9161_ns`` | +| nRF52840 Dongle | PCA10059 | :ref:`nrf52840dongle ` | ``nrf52840dongle/nrf52840`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF9151 DK | PCA10171 | :ref:`nrf9151dk_nrf9151 ` | ``nrf9151dk_nrf9151`` | -| | | | | -| | | | ``nrf9151dk_nrf9151_ns`` | +| nRF52833 DK | PCA10100 | :ref:`nrf52833dk ` | ``nrf52833dk/nrf52833`` | +| | +-------------------------------------------------------------------+---------------------------------------+ +| | | :ref:`nrf52833dk ` | ``nrf52833dk/nrf52820`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ -| nRF9131 EK | PCA10165 | :ref:`nrf9131ek_nrf9131 ` | ``nrf9131ek_nrf9131`` | -| | | | | -| | | | ``nrf9131ek_nrf9131_ns`` | +| nRF52 DK | PCA10040 | :ref:`nrf52dk ` | ``nrf52dk/nrf52832`` | +| (nRF52832) | +-------------------------------------------------------------------+---------------------------------------+ +| | | :ref:`nrf52dk ` | ``nrf52dk/nrf52810`` | +| | +-------------------------------------------------------------------+---------------------------------------+ +| | | :ref:`nrf52dk ` | ``nrf52dk/nrf52805`` | ++-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ +| nRF21540 DK | PCA10112 | :ref:`nrf21540dk ` | ``nrf21540dk/nrf52840`` | +-------------------+------------+-------------------------------------------------------------------+---------------------------------------+ .. note:: In |NCS| releases before v1.6.1: - * The build target ``nrf9160dk_nrf9160_ns`` was named ``nrf9160dk_nrf9160ns``. - * The build target ``nrf5340dk_nrf5340_cpuapp_ns`` was named ``nrf5340dk_nrf5340_cpuappns``. + * The build target ``nrf9160dk/nrf9160/ns`` was named ``nrf9160dk_nrf9160ns``. + * The build target ``nrf5340dk/nrf5340/cpuapp/ns`` was named ``nrf5340dk_nrf5340_cpuappns``. .. _app_boards_names_nrf: Boards included in sdk-nrf ************************** -The following boards are defined in the :file:`nrf/boards/arm/` folder. +The following boards are defined in the :file:`nrf/boards/nordic/` folder. +-------------------+------------+----------------------------------------------------------+---------------------------------------+ | Hardware platform | PCA number | Board name | Build target | +===================+============+==========================================================+=======================================+ -| nRF Desktop | PCA20041 | :ref:`nrf52840gmouse_nrf52840 ` | ``nrf52840gmouse_nrf52840`` | +| nRF Desktop | PCA20041 | :ref:`nrf52840gmouse ` | ``nrf52840gmouse/nrf52840`` | | Gaming Mouse | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF Desktop | PCA20044 | :ref:`nrf52dmouse_nrf52832 ` | ``nrf52dmouse_nrf52832`` | +| nRF Desktop | PCA20044 | :ref:`nrf52dmouse ` | ``nrf52dmouse/nrf52832`` | | Mouse | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF Desktop | PCA20045 | :ref:`nrf52810dmouse_nrf52810 ` | ``nrf52810dmouse_nrf52810`` | +| nRF Desktop | PCA20045 | :ref:`nrf52810dmouse ` | ``nrf52810dmouse/nrf52810`` | | Mouse | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF Desktop | PCA20037 | :ref:`nrf52kbd_nrf52832 ` | ``nrf52kbd_nrf52832`` | +| nRF Desktop | PCA20037 | :ref:`nrf52kbd ` | ``nrf52kbd/nrf52832`` | | Keyboard | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF Desktop | PCA10111 | :ref:`nrf52833dongle_nrf52833 ` | ``nrf52833dongle_nrf52833`` | +| nRF Desktop | PCA10111 | :ref:`nrf52833dongle ` | ``nrf52833dongle/nrf52833`` | | Dongle | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF Desktop | PCA10114 | :ref:`nrf52820dongle_nrf52820 ` | ``nrf52820dongle_nrf52820`` | +| nRF Desktop | PCA10114 | :ref:`nrf52820dongle ` | ``nrf52820dongle/nrf52820`` | | Dongle | | | | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| Thingy:91 | PCA20035 | :ref:`thingy91_nrf9160 ` | ``thingy91_nrf9160`` | +| Thingy:91 | PCA20035 | :ref:`thingy91 ` | ``thingy91/nrf9160`` | | | | | | -| | | | ``thingy91_nrf9160_ns`` | +| | | | ``thingy91/nrf9160/ns`` | | | +----------------------------------------------------------+---------------------------------------+ -| | | :ref:`thingy91_nrf52840 ` | ``thingy91_nrf52840`` | +| | | :ref:`thingy91 ` | ``thingy91/nrf52840`` | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ -| nRF7002 DK | PCA10143 | :ref:`nrf7002dk_nrf5340 ` | ``nrf7002dk_nrf5340_cpunet`` | +| nRF7002 DK | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpunet`` | | | | | | -| | | | ``nrf7002dk_nrf5340_cpuapp`` | +| | | | ``nrf7002dk/nrf5340/cpuapp`` | | | | | | -| | | | ``nrf7002dk_nrf5340_cpuapp_ns`` | +| | | | ``nrf7002dk/nrf5340/cpuapp/ns`` | +-------------------+------------+----------------------------------------------------------+---------------------------------------+ .. _shield_names_nrf: diff --git a/doc/nrf/config_and_build/bootloaders/bootloader.rst b/doc/nrf/config_and_build/bootloaders/bootloader.rst index b3a1b5767152..96958815d37d 100644 --- a/doc/nrf/config_and_build/bootloaders/bootloader.rst +++ b/doc/nrf/config_and_build/bootloaders/bootloader.rst @@ -212,7 +212,7 @@ See the *Image Slots* section in the :doc:`MCUboot documentation ` with a Zephyr or |NCS| sample, enabl .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- -DCONFIG_BOOTLOADER_MCUBOOT=y + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- -DCONFIG_BOOTLOADER_MCUBOOT=y |how_to_configure| Like other child images, you can assign :ref:`image-specific configurations ` at build time to further customize the bootloader's functionality. @@ -265,7 +265,7 @@ We recommend you also set the associated configuration for a key type to ensure .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ -Dmcuboot_CONFIG_BOOT_SIGNATURE_KEY_FILE=\"../../priv-ecdsa256.pem\" \ -Dmcuboot_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y @@ -303,7 +303,7 @@ To use MCUboot as an upgradable bootloader to your application, complete the fol .. code-block:: - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_SECURE_BOOT=y \ -DCONFIG_BOOTLOADER_MCUBOOT=y @@ -314,11 +314,11 @@ To use MCUboot as an upgradable bootloader to your application, complete the fol .. code-block:: - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ -DCONFIG_SECURE_BOOT=y \ -Dmcuboot_CONF_FILE=prj_minimal.conf \ - -Dmcuboot_OVERLAY_CONFIG=external_crypto.conf + -Dmcuboot_EXTRA_CONF_FILE=external_crypto.conf See :ref:`ug_bootloader_config` for more information about using Kconfig fragments with bootloaders. @@ -348,7 +348,7 @@ Enable the :kconfig:option:`CONFIG_BUILD_S1_VARIANT` Kconfig option when buildin .. code-block:: - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_SECURE_BOOT=y \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ -DCONFIG_BUILD_S1_VARIANT=y diff --git a/doc/nrf/config_and_build/bootloaders/bootloader_config.rst b/doc/nrf/config_and_build/bootloaders/bootloader_config.rst index 6f91dd32b31b..6abd407b0fb0 100644 --- a/doc/nrf/config_and_build/bootloaders/bootloader_config.rst +++ b/doc/nrf/config_and_build/bootloaders/bootloader_config.rst @@ -26,7 +26,7 @@ For example, you can temporarily assign custom project configurations for both t .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -Db0_CONF_FILE=prj_immutable.conf \ -Dmcuboot_CONF_FILE=prj_upgradable.conf \ -DCONF_FILE=prj_app.conf @@ -48,20 +48,26 @@ For example, you can assign the :file:`my-custom-fragment.conf` fragment to the .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_SECURE_BOOT=y \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ - -Db0_OVERLAY_CONFIG=my-custom-fragment.conf + -Db0_EXTRA_CONF_FILE=my-custom-fragment.conf In the same way, you can replace ``b0`` with ``mcuboot`` to apply the :file:`my-custom-fragment.conf` fragment to the MCUboot image: .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -DCONFIG_SECURE_BOOT=y \ -DCONFIG_BOOTLOADER_MCUBOOT=y \ - -Dmcuboot_OVERLAY_CONFIG=my-custom-fragment.conf + -Dmcuboot_EXTRA_CONF_FILE=my-custom-fragment.conf You can use this method to apply Kconfig fragments to any child image in the build, as well as to set any Kconfig option that can be set from the command line. See :ref:`ug_multi_image_variables` for more information about customizing images using this method. + +Customizing partitions +********************** + +With the Partition Manager, you can further customize it if a dynamic partition map has been set. +For more information, see the :ref:`Configuration ` section of the :ref:`partition_manager` page. diff --git a/doc/nrf/config_and_build/bootloaders/index.rst b/doc/nrf/config_and_build/bootloaders/index.rst index a6949eab4766..74e345495f2a 100644 --- a/doc/nrf/config_and_build/bootloaders/index.rst +++ b/doc/nrf/config_and_build/bootloaders/index.rst @@ -33,7 +33,7 @@ You can find an overview of currently supported bootloaders in the table below: - Can be second-stage - Key type support - Public key revocation - - SMP updates + - SMP updates by the application - Downgrade protection - Versioning - Update methods (supported by |NCS|) diff --git a/doc/nrf/config_and_build/config_and_build_system.rst b/doc/nrf/config_and_build/config_and_build_system.rst index 3b91b8d06283..0a01afd10774 100644 --- a/doc/nrf/config_and_build/config_and_build_system.rst +++ b/doc/nrf/config_and_build/config_and_build_system.rst @@ -65,7 +65,7 @@ When you start building, a CMake build is executed in two stages: configuration Configuration phase =================== -During this phase, CMake executes build scripts from :file:`CMakeLists.txt` and gathers configuration from different sources, for example :ref:`app_build_additions_build_types`, to generate the final build scripts and create a model of the build for the specified build target. +During this phase, CMake executes build scripts from :file:`CMakeLists.txt` and gathers configuration from different sources, for example :ref:`app_build_file_suffixes`, to generate the final build scripts and create a model of the build for the specified build target. The result of this process is a :term:`build configuration`, a set of files that will drive the build process. For more information about this phase, see the respective sections on Zephyr's :ref:`zephyr:cmake-details` page, which describes in-depth the usage of CMake for Zephyr-based applications. @@ -150,6 +150,33 @@ Each child image is a separate application. For more information, see :ref:`ug_multi_image`. +.. _app_build_file_suffixes: + +Custom configurations +--------------------- + +Zephyr provides the :ref:`zephyr:application-file-suffixes` feature for applications that require a single code base with multiple configurations for different product or build variants (or both). +When you select a given file suffix for the :ref:`configuration phase `, the build system will use a specific set of files to create a specific build configuration for the application. +If it does not find files that match the provided suffix, the build system will fall back to the default files without suffix. + +The file suffix can be any string, but many applications and samples in the |NCS| use ``release``. +This suffix can be included in the :file:`prj.conf` file name (for example, :file:`prj_release.conf`), and also in file names for board configurations, child image Kconfig configurations, and others. +In this way, these files are made dependent on the given configuration and are only used when that build configuration is generated. +For example, if an application uses a custom :file:`nrf5340dk_nrf5340_cpuapp_release.overlay` overlay file, this file will be used together with the application's :file:`prj_release.conf` when you set :makevar:`FILE_SUFFIX` to ``release`` (``-DFILE_SUFFIX=release``). + +Many applications and samples in the |NCS| define even more detailed build configurations. +For example, the :ref:`Zigbee light switch ` sample features the ``fota`` configuration. +See the Configuration section of the given application or sample's documentation for information on if it includes any custom configurations. + +.. important:: + The file suffixes feature is replacing the :ref:`app_build_additions_build_types` that used the :makevar:`CONF_FILE` variable. + File suffixes are backward compatible with this variable, but the following software components are not compatible with file suffixes: + + * :ref:`Child image Kconfig configuration `. + Use the :makevar:`CONF_FILE` variable during the deprecation period of the build types. + +For information about how to provide file suffixes when building an application, see :ref:`cmake_options`. + .. _configuration_system_overview_build: Building phase @@ -193,10 +220,18 @@ For example, when building a sample that enables :kconfig:option:`CONFIG_BT_EXT_ To disable these warnings, disable the :kconfig:option:`CONFIG_WARN_EXPERIMENTAL` Kconfig option. .. _app_build_additions_build_types: +.. _gs_modifying_build_types: +.. _modifying_build_types: Custom build types ================== +.. important:: + The build types are deprecated and are being replaced by :ref:`suffix-based configurations ` and Zephyr's :ref:`zephyr:sysbuild`. + You can continue to use the build types feature until the transition is complete in the |NCS|. + It is still required for applications that use build types with :ref:`multiple images `. + Check the application and sample documentation pages for which variable to use. + A build type is a feature that defines the way in which the configuration files are to be handled. For example, selecting a build type lets you generate different build configurations for *release* and *debug* versions of the application. @@ -213,7 +248,16 @@ The most common build types are ``release`` and ``debug``, which correspond to C For example, nRF Desktop features a ``wwcb`` build type, while Matter weather station features the ``factory_data`` build type. See the application's Configuration section for information if it includes any build types. -For more information about how to invoke and create build types, see :ref:`modifying_build_types`. +The following software components can be made dependent on the build type: + +* The Partition Manager's :ref:`static configuration `. + When the build type has been inferred, the file :file:`pm_static_.yml` will have precedence over :file:`pm_static.yml`. +* The :ref:`child image Kconfig configuration `. + Certain child image configuration files located in the :file:`child_image/` directory can be defined per build type. + +The devicetree configuration is not affected by the build type. + +For more information about how to invoke build types, see :ref:`cmake_options`. .. _app_build_additions_multi_image: @@ -223,7 +267,7 @@ Multi-image builds The |NCS| build system extends Zephyr's with support for multi-image builds. You can find out more about these in the :ref:`ug_multi_image` section. -The |NCS| allows you to :ref:`create custom build type files ` instead of using a single :file:`prj.conf` file. +The |NCS| allows you to :ref:`build types ` instead of using a single :file:`prj.conf` file. Boilerplate CMake file ====================== @@ -234,7 +278,7 @@ The |NCS| provides an additional :file:`boilerplate.cmake` file that is automati find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) -This file checks if the selected board is supported and, when available, if the selected :ref:`build type ` is supported. +This file checks if the selected board is supported and, when available, if the selected :ref:`file suffix ` or :ref:`build type ` is supported. Partition Manager ================= diff --git a/doc/nrf/config_and_build/configuring_app/advanced_building.rst b/doc/nrf/config_and_build/configuring_app/advanced_building.rst index cb63c2b45b71..d702d8181493 100644 --- a/doc/nrf/config_and_build/configuring_app/advanced_building.rst +++ b/doc/nrf/config_and_build/configuring_app/advanced_building.rst @@ -22,85 +22,19 @@ For example, to turn off optimizations, select :kconfig:option:`CONFIG_NO_OPTIMI Compiler options not controlled by the Zephyr build system can be controlled through the :kconfig:option:`CONFIG_COMPILER_OPT` Kconfig option. -.. _gs_modifying_build_types: -.. _modifying_build_types: - -Configuring build types -*********************** - -When the ``CONF_FILE`` variable contains a single file and this file name follows the naming pattern :file:`prj_.conf`, then the build type will be inferred to be **. -The build type cannot be set explicitly. -The ** can be any string, but it is common to use ``release`` and ``debug``. - -For information about how to set variables, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. - -The following software components can be made dependent on the build type: - -* The Partition Manager's :ref:`static configuration `. - When the build type has been inferred, the file :file:`pm_static_.yml` will have precedence over :file:`pm_static.yml`. -* The :ref:`child image Kconfig configuration `. - Certain child image configuration files located in the :file:`child_image/` directory can be defined per build type. - -The devicetree configuration is not affected by the build type. - -.. note:: - For an example of an application that uses build types, see the :ref:`nrf_desktop` application (:ref:`nrf_desktop_requirements_build_types`) or the :ref:`nrf_machine_learning_app` application (:ref:`nrf_machine_learning_app_requirements_build_types`). - -.. tabs:: - - .. group-tab:: nRF Connect for VS Code - - To select the build type in the |nRFVSC|: - - 1. When `building an application `_ as described in the |nRFVSC| documentation, follow the steps for setting up the build configuration. - #. In the **Add Build Configuration** screen, select the desired :file:`.conf` file from the :guilabel:`Configuration` drop-down menu. - #. Fill in other configuration options, if applicable, and click :guilabel:`Build Configuration`. - - .. group-tab:: Command line - - To select the build type when building the application from command line, specify the build type by adding the following parameter to the ``west build`` command: - - .. parsed-literal:: - :class: highlight - - -- -DCONF_FILE=prj_\ *selected_build_type*\.conf - - For example, you can replace the *selected_build_type* variable to build the ``release`` firmware for ``nrf52840dk_nrf52840`` by running the following command in the project directory: - - .. parsed-literal:: - :class: highlight - - west build -b nrf52840dk_nrf52840 -d build_nrf52840dk_nrf52840 -- -DCONF_FILE=prj_release.conf - - The ``build_nrf52840dk_nrf52840`` parameter specifies the output directory for the build files. - -If the selected board does not support the selected build type, the build is interrupted. -For example, for the :ref:`nrf_machine_learning_app` application, if the ``nus`` build type is not supported by the selected board, the following notification appears: - -.. code-block:: console - - Configuration file for build type ``nus`` is missing. - Optional build parameters ************************* Here are some of the possible options you can use: -* Some applications contain configuration overlay files that enable specific features. - These can be added to the ``west build`` command as follows: - - .. parsed-literal:: - :class: highlight - - west build -b *build_target* -- -DOVERLAY_CONFIG="overlay-feature1.conf;overlay-feature2.conf" - - See :ref:`configuration_permanent_change` and Zephyr's :ref:`zephyr:west-building-cmake-args` for more information. +* You can provide :ref:`custom CMake options ` to the build command. * You can include the *directory_name* parameter to build from a directory other than the current directory. * You can use the *build_target@board_revision* parameter to get extra devicetree overlays with new features available for a board version. The *board_revision* is printed on the label of your DK, just below the PCA number. For example, if you run the west build command with an additional parameter ``@1.0.0`` for nRF9160 build target, it adds the external flash on the nRF9160 DK that was available since :ref:`board version v0.14.0 `. * You can :ref:`start menuconfig with the west command ` to configure your application. * You can :ref:`reuse an existing build directory ` for building another application for another board or build target by passing ``-p=auto`` to ``west build``. +* You can :ref:`run unit tests with the west command ` with the ``-t run`` parameter from the unit test directory. For more information on other optional build parameters, run the ``west build -h`` help text command. diff --git a/doc/nrf/config_and_build/configuring_app/cmake/index.rst b/doc/nrf/config_and_build/configuring_app/cmake/index.rst index f377ef2707bf..1a69d798eb08 100644 --- a/doc/nrf/config_and_build/configuring_app/cmake/index.rst +++ b/doc/nrf/config_and_build/configuring_app/cmake/index.rst @@ -44,6 +44,7 @@ See :ref:`zephyr:zephyr-app-cmakelists` in the Zephyr documentation for more inf This tutorial however differs from Zephyr and |NCS| project configurations, so use it only as reference. .. _cmake_options: +.. _building_overlay_files: Providing CMake options *********************** @@ -51,17 +52,133 @@ Providing CMake options You can provide additional options for building your application to the CMake process, which can be useful, for example, to switch between different build scenarios. These options are specified when CMake is run, thus not during the actual build, but when configuring the build. -For information about what variables can be set and how to add these variables in your project, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. +The |NCS| uses the same CMake build variables as Zephyr and they are compatible with both CMake and west. + +For the complete list of build variables in Zephyr and more information about them, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. +The following table lists the most common ones used in the |NCS|: + +.. list-table:: Build system variables in the |NCS| + :header-rows: 1 + + * - Variable + - Purpose + - CMake argument to use + * - Name of the Kconfig option + - Set the given Kconfig option to a specific value :ref:`for a single build `. + - ``-D=`` + * - :makevar:`EXTRA_CONF_FILE` + - Provide additional :ref:`Kconfig fragment files `. + - ``-DEXTRA_CONF_FILE=.conf`` + * - :makevar:`EXTRA_DTC_OVERLAY_FILE` + - Provide additional, custom :ref:`devicetree overlay files `. + - ``-DEXTRA_DTC_OVERLAY_FILE=.overlay`` + * - :makevar:`SHIELD` + - Select one of the supported :ref:`shields ` for building the firmware. + - ``-DSHIELD=`` + * - :makevar:`FILE_SUFFIX` + - | Select one of the available :ref:`suffixed configurations `, if the application or sample supports any. + | See :ref:`app_build_file_suffixes` for more information about their usage and limitations in the |NCS|. + | This variable is gradually replacing :makevar:`CONF_FILE`. + - ``-DFILE_SUFFIX=`` + * - :makevar:`CONF_FILE` + - | Select one of the available :ref:`build types `, if the application or sample supports any. + | This variable is deprecated and is being gradually replaced by :makevar:`FILE_SUFFIX`, but :ref:`still required for some applications `. + - ``-DCONF_FILE=prj_.conf`` + * - ``-S`` (west) or :makevar:`SNIPPET` (CMake) + - | Select one of the :ref:`zephyr:snippets` to add to the application firmware during the build. + | The west argument ``-S`` is more commonly used. + - | ``-S `` + | ``-DSNIPPET=`` + * - :makevar:`PM_STATIC_YML_FILE` + - | Select a :ref:`static configuration file ` for the Partition Manager script. + | For applications that *do not* use multiple images, the static configuration can be selected with :makevar:`FILE_SUFFIX` (see above). + - ``-DPM_STATIC_YML_FILE=pm_static_.yml`` + +You can use these parameters in both the |nRFVSC| and the command line. + +The build variables are applied one after another, based on the order you provide them. +This is how you can specify them: .. tabs:: .. group-tab:: nRF Connect for VS Code - If you work with the |nRFVSC|, you can specify project-specific CMake options when you add the :term:`build configuration` for a new |NCS| project. See `How to build an application`_ in the |nRFVSC| documentation. + You can specify the additional configuration variables when `setting up a build configuration `_: + + * :makevar:`FILE_SUFFIX` (and :makevar:`CONF_FILE`) - Select the configuration in the :guilabel:`Configuration` menu. + * :makevar:`EXTRA_CONF_FILE` - Add the Kconfig fragment file in the :guilabel:`Kconfig fragments` menu. + * :makevar:`EXTRA_DTC_OVERLAY_FILE` - Add the devicetree overlays in the :guilabel:`Devicetree overlays` menu. + * Other variables - Provide CMake arguments in the :guilabel:`Extra CMake arguments` field, preceded by ``--``. + + For example, to build the :ref:`location_sample` sample for the nRF9161 DK with the nRF7002 EK Wi-Fi support, select ``nrf9161dk/nrf9161/ns`` in the :guilabel:`Board` menu, :file:`overlay-nrf7002ek-wifi-scan-only.conf` in the :guilabel:`Kconfig fragments` menu, and provide ``-- -DSHIELD=nrf7002ek`` in the :guilabel:`Extra CMake arguments` field. .. group-tab:: Command line - If you work on the command line, pass the additional options to the ``west build`` command when :ref:`building`. - The options must be added after a ``--`` at the end of the command. - See :ref:`zephyr:west-building-cmake-args` for more information. + Pass the additional options to the ``west build`` command when :ref:`building`. + The CMake arguments must be added after a ``--`` at the end of the command. + + For example, to build the :ref:`location_sample` sample for the nRF9161 DK with the nRF7002 EK Wi-Fi support, the command would look like follows: + + .. code-block:: + + west build -p -b nrf9161dk/nrf9161/ns -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf + +See :ref:`configuration_permanent_change` and Zephyr's :ref:`zephyr:west-building-cmake-args` for more information. + +Examples of commands +-------------------- + +**Providing a CMake variable for build types** + + .. toggle:: + + .. tabs:: + + .. group-tab:: nRF Connect for VS Code + + To select the build type in the |nRFVSC|: + + 1. When `building an application `_ as described in the |nRFVSC| documentation, follow the steps for setting up the build configuration. + #. In the **Add Build Configuration** screen, select the desired :file:`.conf` file from the :guilabel:`Configuration` drop-down menu. + #. Fill in other configuration options, if applicable, and click :guilabel:`Build Configuration`. + + .. group-tab:: Command line + + To select the build type when building the application from command line, specify the build type by adding the following parameter to the ``west build`` command: + + .. parsed-literal:: + :class: highlight + + -- -DCONF_FILE=prj_\ *selected_build_type*\.conf + + For example, you can replace the *selected_build_type* variable to build the ``release`` firmware for ``nrf52840dk/nrf52840`` by running the following command in the project directory: + + .. parsed-literal:: + :class: highlight + + west build -b nrf52840dk/nrf52840 -d build_nrf52840dk_nrf52840 -- -DCONF_FILE=prj_release.conf + + The ``build_nrf52840dk_nrf52840`` parameter specifies the output directory for the build files. + .. + + .. + + If the selected board does not support the selected build type, the build is interrupted. + For example, for the :ref:`nrf_machine_learning_app` application, if the ``nus`` build type is not supported by the selected board, the following notification appears: + + .. code-block:: console + + Configuration file for build type ``nus`` is missing. + + .. + +.. _cmake_options_images: + +Providing CMake options for specific images +=========================================== + +You can prefix the build variable names with the image name if you want the variable to be applied only to a specific image: ``-D_=``. +For example, ``-DEXTRA_CONF_FILE=external_crypto.conf`` will be applied to the default image for which you are building (most often, the application image), while ``-Dmcuboot_EXTRA_CONF_FILE=external_crypto.conf`` will be applied to the MCUboot image. + +This feature is not available for setting Kconfig options. diff --git a/doc/nrf/config_and_build/configuring_app/hardware/index.rst b/doc/nrf/config_and_build/configuring_app/hardware/index.rst index 8f4ce6e2e492..a380b406a21b 100644 --- a/doc/nrf/config_and_build/configuring_app/hardware/index.rst +++ b/doc/nrf/config_and_build/configuring_app/hardware/index.rst @@ -10,6 +10,11 @@ Follow the steps in `How to create devicetree files`_ and use one of the followi * `Devicetree Visual Editor `_ * `Devicetree language support`_ +Like Kconfig fragment files, devicetree files can also be provided as overlays. +The devicetree overlay files are named the same as the build target and use the file extension :file:`.overlay`. +When they are placed in the :file:`boards` folder and the devicetree overlay file name matches the build target, the build system automatically selects and applies the overlay. +To select them manually, see :ref:`cmake_options`. + The following guides provide information about configuring specific aspects of hardware support related to devicetree. Read them together with Zephyr's :ref:`zephyr:hardware_support` and :ref:`zephyr:dt-guide` guides, and the official `Devicetree Specification`_. diff --git a/doc/nrf/config_and_build/configuring_app/hardware/use_gpio_pin_directly.rst b/doc/nrf/config_and_build/configuring_app/hardware/use_gpio_pin_directly.rst index 2f7c4500b8e1..69fea7e5fe32 100644 --- a/doc/nrf/config_and_build/configuring_app/hardware/use_gpio_pin_directly.rst +++ b/doc/nrf/config_and_build/configuring_app/hardware/use_gpio_pin_directly.rst @@ -103,8 +103,8 @@ To initialize the defined GPIO pin structures, use the ``GPIO_DT_SPEC_INST_GET_B #include static const struct gpio_dt_spec pin_dbg0 = - GPIO_DT_SPEC_GET_OR(DT_NODELABEL(user_dbg_pin), gpios, 0, {0}); + GPIO_DT_SPEC_GET_BY_IDX_OR(DT_NODELABEL(user_dbg_pin), gpios, 0, {0}); static const struct gpio_dt_spec pin_dbg1 = - GPIO_DT_SPEC_GET_OR(DT_NODELABEL(user_dbg_pin), gpios, 1, {0}); + GPIO_DT_SPEC_GET_BY_IDX_OR(DT_NODELABEL(user_dbg_pin), gpios, 1, {0}); The rest of the GPIO pin operations follow the same process in case of declaring a single pin. diff --git a/doc/nrf/config_and_build/configuring_app/index.rst b/doc/nrf/config_and_build/configuring_app/index.rst index dbd85fd87905..0171db9af99a 100644 --- a/doc/nrf/config_and_build/configuring_app/index.rst +++ b/doc/nrf/config_and_build/configuring_app/index.rst @@ -14,18 +14,14 @@ Configuring and building an application After you have :ref:`created an application `, you need to build it in order to be able to program it. Just as for creating the application, you can build the application using either the |nRFVSC| or the command line. -.. note:: - |application_sample_long_path_windows| - .. tabs:: .. group-tab:: nRF Connect for VS Code For instructions about building with the |nRFVSC|, see `How to build an application`_ in the extension documentation. - .. note:: - By default, the extension runs both stages of the CMake build (:ref:`configuration phase and building phase `). - If you want to only set up the build configuration without building it, make sure the :guilabel:`Build after generating configuration` is not selected. + By default, the extension runs both stages of the CMake build (:ref:`configuration phase and building phase `). + If you want to only set up the build configuration without building it, make sure the :guilabel:`Build after generating configuration` is not selected. If you want to build with custom options or scripts, read about `Binding custom tasks to actions`_ in the extension documentation. @@ -63,6 +59,9 @@ Just as for creating the application, you can build the application using either For more information on building using the command line, see :ref:`Building ` in the Zephyr documentation. +.. note:: + |application_sample_long_path_windows| + .. toctree:: :maxdepth: 1 :caption: Subpages: diff --git a/doc/nrf/config_and_build/configuring_app/kconfig/index.rst b/doc/nrf/config_and_build/configuring_app/kconfig/index.rst index e0e469ef2ea5..c68b148afd99 100644 --- a/doc/nrf/config_and_build/configuring_app/kconfig/index.rst +++ b/doc/nrf/config_and_build/configuring_app/kconfig/index.rst @@ -54,6 +54,14 @@ This means that this file is available when building the application until you c See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run menuconfig or guiconfig. To locate a specific configuration option, use the **Jump to** field. +.. _configuration_temporary_change_single_build: + +Temporary Kconfig changes for a single build +============================================ + +You can also apply temporary Kconfig changes to a single build by :ref:`providing the value of a chosen Kconfig option as a CMake option `. +The Kconfig option configuration will be available until you clean the build directory pristinely. + .. _configuration_permanent_change: Permanent Kconfig changes @@ -61,9 +69,14 @@ Permanent Kconfig changes To configure your application and maintain the configuration after you clean the build directory pristinely, you need to specify the configuration in one of the permanent configuration files. In most of the cases, this means editing the default :file:`prj.conf` file of the application, but you can also use an extra Kconfig fragment file. + +The Kconfig fragment files are configuration files used for building an application image with or without software support that is enabled by specific Kconfig options. In these files, you can specify different values for configuration options that are defined by a library or board, and you can add configuration options that are specific to your application. +Examples include whether to add networking support or which drivers are needed by the application. +Kconfig fragments are applied on top of the default :file:`prj.conf` file and use the :file:`.conf` file extension. +When they are board-specific, they are placed in the :file:`boards` folder, are named :file:`.conf`, and they are applied on top of the default Kconfig file for the specified board. -See :ref:`zephyr:setting_configuration_values` in the Zephyr documentation for information on how to change the configuration permanently. +See :ref:`zephyr:setting_configuration_values` in the Zephyr documentation for information on how to change the configuration permanently and :ref:`how the additional files are applied `. .. tip:: Reconfiguring through menuconfig only changes the specific setting and the invisible options that are calculated from it. diff --git a/doc/nrf/config_and_build/dfu/dfu_image_versions.rst b/doc/nrf/config_and_build/dfu/dfu_image_versions.rst index 8bf099681ef2..40b4c535631e 100644 --- a/doc/nrf/config_and_build/dfu/dfu_image_versions.rst +++ b/doc/nrf/config_and_build/dfu/dfu_image_versions.rst @@ -36,7 +36,11 @@ This option can refer to two different things: Configuring image version with MCUboot ************************************** -To assign a semantic version number to your application when you have opted for booting application directly by the MCUboot bootloader (that is, if you have opted for either :ref:`ug_bootloader_adding_immutable_mcuboot` or :ref:`ug_bootloader_adding_upgradable_mcuboot`), add the version string to the :kconfig:option:`CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION` option for the application: +To assign a semantic version number to your application when you have opted for booting application directly by the MCUboot bootloader (that is, if you have opted for either :ref:`ug_bootloader_adding_immutable_mcuboot` or :ref:`ug_bootloader_adding_upgradable_mcuboot`), it is recommended to use the :file:`VERSION` file that contains the version information for the application image. +Using a :file:`VERSION` file allows you to independently configure the version value for each build instance of the application. +See Zephyr's :ref:`zephyr:app-version-details` page for more information. + +Alternatively, you can also add the version string to the :kconfig:option:`CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION` Kconfig option for the application: .. code-block:: console diff --git a/doc/nrf/config_and_build/dfu/index.rst b/doc/nrf/config_and_build/dfu/index.rst index 51ad31f5a420..3cd35dae142d 100644 --- a/doc/nrf/config_and_build/dfu/index.rst +++ b/doc/nrf/config_and_build/dfu/index.rst @@ -4,26 +4,41 @@ Device Firmware Updates ####################### -.. contents:: - :local: - :depth: 2 - Device Firmware Update (DFU) is the procedure of upgrading the application firmware version on a device. -It is composed of two steps. -First a new firmware image is transferred to the chip, and then the :ref:`bootloader ` tests and boots the new firmware. +It consists of two primary steps: -You can transfer the updated images to the device in two ways: +1. Transferring the new firmware - a new firmware image is transferred to the device's chip. -* Wired, where updates are sent through a wired connection, like UART, or delivered by connecting a flash device. -* Over-the-air (OTA), where updates are sent through a wireless connection, like Bluetooth® Low Energy. +#. Testing and booting - the bootloader then tests and boots the new firmware. + +.. note:: + The choice of bootloader affects how firmware updates can be performed. + While bootloader features (such as out-of-the-box support) for various DFU methods may vary, it is recognized that: -The testing and booting process depends on the choice of bootloader. + * MCUboot and its supporting libraries and middleware are flexible and support various protocols and methods for firmware updates. + However, the extent of supported features, like USB-DFU class, may vary and should be confirmed with the latest MCUboot documentation or source code. + * The nRF Secure Immutable Bootloader (NSIB) allows for firmware updates but might not include comprehensive support for all types of firmware updates compared to MCUboot. + + This distinction is crucial for developing your firmware update strategy and selecting the appropriate bootloader for your device's needs. + +Regarding bootloader and application roles, the testing and booting process depends on the choice of bootloader and the application design. Generally, bootloaders support two types of updates: * Direct updates, with an in-place substitution of the image. - In this case, it is the bootloader that must transfer the update image. + In this case, the bootloader transfers the update image. * Background updates, where the updated image is obtained and stored by the application, but the update is completed by the bootloader after the device reboots. +In systems that use MCUboot, the application may be responsible for receiving update packages through Simple Management Protocol (SMP) and staging them for the bootloader. +The relation can be explained as follows: + +* The bootloader manages the final steps of the DFU process and has ability to receive, verify, and activate either new or already-received firmware images. +* The application manages firmware updates by receiving and staging new firmware or candidate images, especially when using SMP, and then prepares them for installation by the bootloader. + +With DFUs, you can transfer the updated images to the device in two ways: + +* Wired, where updates are sent through a wired connection, like UART, or delivered by connecting a flash device. +* Over-the-air (OTA), where updates are sent through a wireless connection, like Bluetooth® Low Energy. + Based on these criteria, the |NCS| offers support for the following DFU alternatives: * For sending updates to the receiving device: @@ -73,10 +88,15 @@ Based on these criteria, the |NCS| offers support for the following DFU alternat - Library in the |NCS| that provides functions for downloading a firmware file as an upgrade candidate to the DFU target. The library is often used by IoT libraries, such as the :ref:`lib_nrf_cloud` library. - OTA (LTE, Wi-Fi) -See the following pages for device-specific guides related to DFU: +For device-specific guides related to DFU, see the following pages: + +* :ref:`Developing with nRF52 Series ` - for how to do firmware over-the-air (FOTA) updates with nRF52 Series devices. + +* :ref:`Developing with nRF5340 DK ` - for how to do FOTA updates and serial recovery with the nRF5340 SoC. + + * :ref:`qspi_xip` - for external execute in place (XIP) for the nRF5340 SoC. -* :ref:`qspi_xip` - for the nRF5340 SoC -* :ref:`ug_nrf70_fw_patch_update` - for nRF70 Series devices +* :ref:`ug_nrf70_fw_patch_update` - for nRF70 Series devices. See the following user guides for an overview of topics related to general firmware updates with the |NCS|: diff --git a/doc/nrf/config_and_build/multi_image.rst b/doc/nrf/config_and_build/multi_image.rst index 01f6e23612c0..c36e61410dd3 100644 --- a/doc/nrf/config_and_build/multi_image.rst +++ b/doc/nrf/config_and_build/multi_image.rst @@ -230,7 +230,7 @@ With west, you can pass these configuration variables into CMake by using the `` .. code-block:: console - west build -b nrf52840dk_nrf52840 zephyr/samples/hello_world -- \ + west build -b nrf52840dk/nrf52840 zephyr/samples/hello_world -- \ -Dmcuboot_CONF_FILE=prj_a.conf \ -DCONF_FILE=app_prj.conf @@ -255,7 +255,7 @@ The following example adds an extra Kconfig fragment ``extrafragment.conf`` to ` .. parsed-literal:: :class: highlight - cmake -D\ *childimageone*\_OVERLAY_CONFIG=\ *extrafragment.conf*\ [...] + cmake -D\ *childimageone*\_EXTRA_CONF_FILE=\ *extrafragment.conf*\ [...] It is also possible to provide a custom configuration file as a replacement for the default Kconfig file for the child image. The following example uses the custom configuration file ``myfile.conf`` when building ``childimageone``: @@ -268,20 +268,20 @@ The following example uses the custom configuration file ``myfile.conf`` when bu If your application includes multiple child images, then you can combine all the above as follows: * Setting ``CONFIG_VARIABLEONE=val`` in the main application. -* Adding a Kconfig fragment ``extrafragment.conf`` to the ``childimageone`` child image, using ``-Dchildimageone_OVERLAY_CONFIG=extrafragment.conf``. +* Adding a Kconfig fragment ``extrafragment.conf`` to the ``childimageone`` child image, using ``-Dchildimageone_EXTRA_CONF_FILE=extrafragment.conf``. * Using ``myfile.conf`` as configuration for the ``quz`` child image, using ``-Dquz_CONF_FILE=myfile.conf``. .. parsed-literal:: :class: highlight - cmake -DCONFIG_VARIABLEONE=val -D\ *childimageone*\_OVERLAY_CONFIG=\ *extrafragment.conf*\ -Dquz_CONF_FILE=\ *myfile.conf*\ [...] + cmake -DCONFIG_VARIABLEONE=val -D\ *childimageone*\_EXTRA_CONF_FILE=\ *extrafragment.conf*\ -Dquz_CONF_FILE=\ *myfile.conf*\ [...] See :ref:`ug_bootloader` for more details. .. note:: The build system grabs the Kconfig fragment or configuration file specified in a CMake argument relative to that image's application directory. - For example, the build system uses ``nrf/samples/bootloader/my-fragment.conf`` when building with the ``-Db0_OVERLAY_CONFIG=my-fragment.conf`` option, whereas ``-DOVERLAY_CONFIG=my-fragment.conf`` grabs the fragment from the main application's directory, such as ``zephyr/samples/hello_world/my-fragment.conf``. + For example, the build system uses ``nrf/samples/bootloader/my-fragment.conf`` when building with the ``-Db0_EXTRA_CONF_FILE=my-fragment.conf`` option, whereas ``-DEXTRA_CONF_FILE=my-fragment.conf`` grabs the fragment from the main application's directory, such as ``zephyr/samples/hello_world/my-fragment.conf``. You can also merge multiple fragments into the overall configuration for an image by giving a list of Kconfig fragments as a string, separated using ``;``. The following example shows how to combine ``abc.conf``, Kconfig fragment of the ``childimageone`` child image, with the ``extrafragment.conf`` fragment: @@ -289,7 +289,7 @@ The following example shows how to combine ``abc.conf``, Kconfig fragment of the .. parsed-literal:: :class: highlight - cmake -D\ *childimageone*\_OVERLAY_CONFIG='\ *extrafragment.conf*\;\ *abc.conf*\' + cmake -D\ *childimageone*\_EXTRA_CONF_FILE='\ *extrafragment.conf*\;\ *abc.conf*\' When the build system finds the fragment, it outputs their merge during the CMake build output as follows: @@ -332,18 +332,18 @@ Permanent configuration changes to child images ----------------------------------------------- You can make a project automatically pass Kconfig configuration files, fragments, and devicetree overlays to child images by placing them under a predefined path. -For example, in the |NCS| applications and samples that use different :ref:`build types for configuration `, the :file:`child_image` folder in the application source directory is often used to apply :ref:`permanent configuration changes `. +For example, in the |NCS| applications and samples that use different :ref:`build types `, the :file:`child_image` folder in the application source directory is often used to apply :ref:`permanent configuration changes `. The listing below describes how to leverage this functionality, where ``ACI_NAME`` is the name of the child image to which the configuration will be applied. .. literalinclude:: ../../../cmake/multi_image.cmake :language: c :start-at: It is possible for a sample to use a custom set of Kconfig fragments for a - :end-before: set(ACI_CONF_DIR ${APPLICATION_CONFIG_DIR}/child_image) + :end-before: set(ACI_CONF_DIR ${config_dir}/child_image) -When you are :ref:`modifying_build_types` and the build type has been inferred, the child image Kconfig overlay file is searched at :file:`child_image/_.conf`. +When you are using :ref:`app_build_additions_build_types` and the configuration name has been inferred, the child image Kconfig overlay file is searched at :file:`child_image/_.conf`. Alternatively, the child image Kconfig configuration file can be introduced as :file:`child_image//prj.conf` and follow the same pattern as the parent Kconfig. -For example, :file:`child_image/mcuboot/prj_release.conf` can be used to define ``release`` build type for ``mcuboot`` child image. +For example, :file:`child_image/mcuboot/prj_release.conf` can be used to define the ``release`` build type for the ``mcuboot`` child image. Child image targets =================== diff --git a/doc/nrf/create_application.rst b/doc/nrf/create_application.rst index 70fb7b4043a9..2850672aa4f0 100644 --- a/doc/nrf/create_application.rst +++ b/doc/nrf/create_application.rst @@ -130,6 +130,7 @@ Use the following steps depending on the application placement: When the application is created, a VS Code prompt appears. #. Click :guilabel:`Open`. This opens the new application and adds it to the :guilabel:`Applications View` in the extension. + At this point, you have created a freestanding application. #. Add the :file:`west.yml` to create a west workspace around the application: a. In the :guilabel:`Welcome View`, click the :guilabel:`Manage SDKs` action. @@ -137,8 +138,8 @@ Use the following steps depending on the application placement: #. Click :guilabel:`Create west workspace`. #. Enter a location for the :file:`west.yml` file that matches the location provided in step 4. #. Select the SDK version for the west workspace. - The west workspace is initialized and the :guilabel:`Manage SDKs` action changes to :guilabel:`Open west manifest`. - #. In the :guilabel:`Applications View`, click the :guilabel:`Run West Update` button to update the workspace modules. + The west workspace is initialized and the :guilabel:`Manage SDKs` action changes to :guilabel:`Manage west workspace`. + #. Click :guilabel:`Manage west workspace` and select :guilabel:`West Update` button to update the workspace modules. You can now start :ref:`configuring and building ` the application. @@ -167,6 +168,9 @@ Use the following steps depending on the application placement: See the `extension documentation `_ for more information about creating freestanding applications in the extension. + .. note:: + You can transform your freestanding application into a workspace application at any moment by completing the step 7 under the Workspace application tab. + .. _creating_cmd: Creating application for use with command line diff --git a/doc/nrf/dev_model_and_contributions/adding_code.rst b/doc/nrf/dev_model_and_contributions/adding_code.rst index 5c17dc855ba0..846a6435f16a 100644 --- a/doc/nrf/dev_model_and_contributions/adding_code.rst +++ b/doc/nrf/dev_model_and_contributions/adding_code.rst @@ -162,7 +162,7 @@ This is demonstrated by the following code, that would be placed somewhere in yo - name: nrf repo-path: sdk-nrf remote: ncs - revision: v2.6.0 + revision: 2.6.1 import: true self: path: application @@ -189,7 +189,7 @@ For example: projects: - name: nrf remote: ncs - revision: v2.6.0 + revision: 2.6.1 import: true # Example for how to override a repository in the nRF Connect SDK with your own: - name: mcuboot diff --git a/doc/nrf/device_guides.rst b/doc/nrf/device_guides.rst index 37cad49119c2..3f0cac3e61ff 100644 --- a/doc/nrf/device_guides.rst +++ b/doc/nrf/device_guides.rst @@ -13,6 +13,7 @@ You can also find here guides that are strictly related to hardware features. device_guides/nrf91 device_guides/nrf70 + device_guides/nrf54l device_guides/nrf53 device_guides/nrf52 device_guides/pmic diff --git a/doc/nrf/device_guides/nrf52.rst b/doc/nrf/device_guides/nrf52.rst index 6e2cf3f20efd..c00239026f42 100644 --- a/doc/nrf/device_guides/nrf52.rst +++ b/doc/nrf/device_guides/nrf52.rst @@ -1,5 +1,6 @@ .. _ug_nrf52_group: .. _nrf52_supported_boards: +.. _nrf52_working: Working with nRF52 Series ######################### @@ -15,54 +16,53 @@ Zephyr and the |NCS| provide support and contain board definitions for developin - Documentation * - :ref:`zephyr:nrf52840dk_nrf52840` - PCA10056 - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:nrf52840dk_nrf52811` - PCA10056 - - ``nrf52840dk_nrf52811`` + - ``nrf52840dk/nrf52811`` - `Product Specification `_ * - :ref:`zephyr:nrf52833dk_nrf52833` - PCA10100 - - ``nrf52833dk_nrf52833`` + - ``nrf52833dk/nrf52833`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:nrf52833dk_nrf52820` - PCA10100 - - ``nrf52833dk_nrf52820`` + - ``nrf52833dk/nrf52820`` - `Product Specification `_ * - :ref:`zephyr:nrf52dk_nrf52832` - PCA10040 - - ``nrf52dk_nrf52832`` + - ``nrf52dk/nrf52832`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:nrf52dk_nrf52810` - PCA10040 - - ``nrf52dk_nrf52810`` + - ``nrf52dk/nrf52810`` - `Product Specification `_ * - :ref:`zephyr:nrf52dk_nrf52805` - PCA10040 - - ``nrf52dk_nrf52805`` + - ``nrf52dk/nrf52805`` - `Product Specification `_ * - :ref:`zephyr:nrf52840dongle_nrf52840` - PCA10059 - - ``nrf52840dongle_nrf52840`` + - ``nrf52840dongle/nrf52840`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:nrf21540dk_nrf52840` - PCA10112 - - ``nrf21540dk_nrf52840`` + - ``nrf21540dk/nrf52840`` - | `Product Specification `_ See also :ref:`ug_radio_fem_nrf21540ek` to learn how to use the RF front-end module (FEM) with the nRF52 Series devices. .. note:: - Despite being supported in :ref:`Zephyr `, the |NCS| does not support `Nordic Thingy:52`_. + |thingy52_not_supported_note| .. toctree:: :maxdepth: 2 :caption: Subpages: working_with_nrf/nrf52/features - working_with_nrf/nrf52/gs working_with_nrf/nrf52/developing diff --git a/doc/nrf/device_guides/nrf53.rst b/doc/nrf/device_guides/nrf53.rst index 0987060a1a02..71dba224eab2 100644 --- a/doc/nrf/device_guides/nrf53.rst +++ b/doc/nrf/device_guides/nrf53.rst @@ -1,4 +1,5 @@ .. _ug_nrf53: +.. _nrf53_working: Working with nRF53 Series ######################### @@ -10,29 +11,28 @@ Zephyr and the |NCS| provide support and contain board definitions for developin * - DK - PCA number - - Build target + - Build target/s - Documentation * - :ref:`zephyr:nrf5340dk_nrf5340` - PCA10095 - - ``nrf5340dk_nrf5340`` + - ``nrf5340dk/nrf5340/cpuapp``, ``nrf5340dk/nrf5340/cpuapp/ns``, ``nrf5340dk/nrf5340/cpunet`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:nrf5340_audio_dk_nrf5340` - PCA10121 - - ``nrf5340_audio_dk_nrf5340`` + - ``nrf5340_audio_dk/nrf5340/cpuapp``, ``nrf5340_audio_dk/nrf5340/cpuapp/ns``, ``nrf5340_audio_dk/nrf5340/cpunet`` - | `Hardware Specification `_ | :ref:`nrf53_audio_app` * - :ref:`zephyr:thingy53_nrf5340` - PCA20053 - - ``thingy53_nrf5340`` + - ``thingy53/nrf5340/cpuapp``, ``thingy53/nrf5340/cpuapp/ns``, ``thingy53/nrf5340/cpunet`` - `Hardware Specification `_ .. toctree:: :maxdepth: 2 :caption: Subpages: - working_with_nrf/nrf53/nrf5340_gs + working_with_nrf/nrf53/features_nrf53 working_with_nrf/nrf53/nrf5340 working_with_nrf/nrf53/qspi_xip_guide - working_with_nrf/nrf53/thingy53_gs working_with_nrf/nrf53/thingy53 diff --git a/doc/nrf/device_guides/nrf54l.rst b/doc/nrf/device_guides/nrf54l.rst new file mode 100644 index 000000000000..45013d916c26 --- /dev/null +++ b/doc/nrf/device_guides/nrf54l.rst @@ -0,0 +1,35 @@ +.. _ug_nrf54l: + +Working 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. + +Zephyr and the |NCS| provide support and contain board definitions for developing on the following nRF54L Series device: + +.. list-table:: + :header-rows: 1 + + * - DK + - PCA number + - Build target + - Documentation + * - :ref:`zephyr:nrf54l15pdk_nrf54l15` + - PCA10156 + - | ``nrf54l15pdk/nrf54l15/cpuapp`` for the PDK revision v0.2.1, AB0-ES7 (Engineering A). + | ``nrf54l15pdk@0.3.0/nrf54l15/cpuapp`` for the PDK revisions v0.3.0 and v0.7.0 (Engineering A). + - -- + +.. note:: + + The v0.2.1 revision of the nRF54L15 PDK has **Button 3** and **Button 4** connected to GPIO port 2 that do not support interrupts. + The workaround for this issue is enabled by default with the :kconfig:option:`CONFIG_DK_LIBRARY_BUTTON_NO_ISR` Kconfig option, but it increases the overall power consumption of the system. + +.. toctree:: + :maxdepth: 2 + :caption: Subpages: + + working_with_nrf/nrf54l/features + working_with_nrf/nrf54l/ug_nrf54l15_gs diff --git a/doc/nrf/device_guides/nrf70.rst b/doc/nrf/device_guides/nrf70.rst index ff918ef1971c..05cee7a496b1 100644 --- a/doc/nrf/device_guides/nrf70.rst +++ b/doc/nrf/device_guides/nrf70.rst @@ -16,46 +16,46 @@ Zephyr and the |NCS| provide support for developing networking applications with * - nRF7002 DK - Not applicable - PCA10143 - - ``nrf7002dk_nrf5340_cpuapp`` + - ``nrf7002dk/nrf5340/cpuapp`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - nRF7001 emulation on nRF7002 DK - Not applicable - PCA10143 - - ``nrf7002dk_nrf7001_nrf5340_cpuapp`` + - ``nrf7002dk/nrf5340/cpuapp/nrf7001`` - | `Product Specification `_ * - :ref:`zephyr:nrf5340dk_nrf5340` - nRF7002 EK - PCA10095 - - ``nrf5340dk_nrf5340_cpuapp`` + - ``nrf5340dk/nrf5340/cpuapp`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - :ref:`zephyr:nrf52840dk_nrf52840` - nRF7002 EK - PCA10056 - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - :ref:`zephyr:nrf9160dk_nrf9160` - nRF7002 EK - PCA10090 - - ``nrf9160dk_nrf9160_ns`` + - ``nrf9160dk/nrf9160/ns`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - :ref:`zephyr:nrf9161dk_nrf9161` - nRF7002 EK - PCA10153 - - ``nrf9161dk_nrf9161_ns`` + - ``nrf9161dk/nrf9161/ns`` - | `Product Specification `_ | `User Guide `_ * - :ref:`zephyr:thingy53_nrf5340` - nRF7002 EB - PCA20053 - - ``thingy53_nrf5340_cpuapp`` + - ``thingy53/nrf5340/cpuapp`` - | :ref:`Getting started ` | `User Guide `_ @@ -96,7 +96,4 @@ Applications can be developed on the nRF7002 DK (PCA10143), which includes the n :caption: Subpages: working_with_nrf/nrf70/features - working_with_nrf/nrf70/gs - working_with_nrf/nrf70/nrf7002ek_gs - working_with_nrf/nrf70/nrf7002eb_gs working_with_nrf/nrf70/developing/index diff --git a/doc/nrf/device_guides/nrf91.rst b/doc/nrf/device_guides/nrf91.rst index 41658a5097a4..3a3c06f04270 100644 --- a/doc/nrf/device_guides/nrf91.rst +++ b/doc/nrf/device_guides/nrf91.rst @@ -10,19 +10,19 @@ Zephyr and the |NCS| provide support for developing cellular applications using * - DK or Prototype platform - PCA number - - Build target + - Build target/s - Documentation - Product pages * - :ref:`zephyr:nrf9161dk_nrf9161` - PCA10153 - - ``nrf9161dk_nrf9161_ns`` + - ``nrf9161dk/nrf9161``, ``nrf9161dk/nrf9161/ns`` - | `Product Specification `_ | `User Guide `_ - | `nRF9161 DK product page`_ | `nRF9161 System in Package (SiP) `_ * - :ref:`zephyr:nrf9160dk_nrf9160` - PCA10090 - - ``nrf9160dk_nrf9160_ns`` + - ``nrf9160dk/nrf9160``, ``nrf9160dk/nrf9160/ns`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ @@ -30,7 +30,7 @@ Zephyr and the |NCS| provide support for developing cellular applications using | `nRF9160 System in Package (SiP) `_ * - Thingy91 - PCA20035 - - ``thingy91_nrf9160_ns`` + - ``thingy91/nrf9160``, ``thingy91/nrf9160/ns`` - | :ref:`Getting started ` | `User Guide `_ - | `Thingy\:91 product page`_ @@ -38,9 +38,6 @@ Zephyr and the |NCS| provide support for developing cellular applications using The nRF Connect SDK also offers :ref:`samples ` dedicated to these devices. -To get started with an nRF9161 DK, complete the steps in the Quick Start app in `nRF Connect for Desktop`_. -For more advanced topics related to the nRF9161 DK, see the :ref:`ug_nrf9161` documentation. - If you want to go through a hands-on online training to familiarize yourself with cellular IoT technologies and development of cellular applications, enroll in the `Cellular IoT Fundamentals course`_ in the `Nordic Developer Academy`_. .. toctree:: @@ -49,8 +46,6 @@ If you want to go through a hands-on online training to familiarize yourself wit working_with_nrf/nrf91/nrf91_features working_with_nrf/nrf91/nrf9161 - working_with_nrf/nrf91/nrf9160_gs working_with_nrf/nrf91/nrf9160 - working_with_nrf/nrf91/thingy91_gsg working_with_nrf/nrf91/thingy91 working_with_nrf/nrf91/nrf91_snippet diff --git a/doc/nrf/device_guides/pmic.rst b/doc/nrf/device_guides/pmic.rst index 78f9d5964fda..a05c455f40a8 100644 --- a/doc/nrf/device_guides/pmic.rst +++ b/doc/nrf/device_guides/pmic.rst @@ -10,5 +10,4 @@ The |NCS| provides support for development with the `nPM1300 Power Management IC :caption: Subpages: working_with_pmic/npm1300/features - working_with_pmic/npm1300/gs working_with_pmic/npm1300/developing diff --git a/doc/nrf/device_guides/wifi_coex.rst b/doc/nrf/device_guides/wifi_coex.rst index 50308e66c38b..9f0229341c51 100644 --- a/doc/nrf/device_guides/wifi_coex.rst +++ b/doc/nrf/device_guides/wifi_coex.rst @@ -59,7 +59,7 @@ The following are the common requirements to use coexistence based on the MPSL C 4. Ensure that the configuration of the ``nrf_radio_coex`` node appropriate for the selected implementation is present in the devicetree. When using one of the supported implementations, you must use the ``nrf_radio_coex`` name for the node. However, if you add a custom user implementation, you can also use a different name. - Some boards supported by the |NCS| (like :ref:`nrf7002dk_nrf5340 `) provide this node by default. + Some boards supported by the |NCS| (like :ref:`nrf7002dk `) provide this node by default. You can provide the node using either the devicetree source file of the target board or an overlay file. See :ref:`zephyr:dt-guide` for more information about the DTS data structure, and :ref:`zephyr:dt_vs_kconfig` for information about differences between DTS and Kconfig. 5. On the nRF5340 SoC, the GPIO pins required for the communication with the PTA must be handed over to the network core. diff --git a/doc/nrf/device_guides/working_with_fem.rst b/doc/nrf/device_guides/working_with_fem.rst index 641ce7aa5caf..71321b0d1427 100644 --- a/doc/nrf/device_guides/working_with_fem.rst +++ b/doc/nrf/device_guides/working_with_fem.rst @@ -628,7 +628,7 @@ 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 -Dmultiprotocol_rpmsg_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: diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst b/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst index 37b0433f053c..40a00b9da5c8 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf52/developing.rst @@ -20,6 +20,7 @@ To get started with your nRF52 Series DK, follow the steps in the :ref:`ug_nrf52 If you are not familiar with the |NCS| and its development environment, see :ref:`installation` and :ref:`configuration_and_build` documentation. .. _ug_nrf52_developing_ble_fota: + .. fota_upgrades_intro_start FOTA updates @@ -27,6 +28,7 @@ FOTA updates |fota_upgrades_def| You can also use FOTA updates to replace the application. +See the :ref:`app_dfu` page for general Device Firmware Update (DFU) information, such as supported methods for sending and receiving updates on the device. .. note:: For the possibility of introducing an upgradable bootloader, refer to :ref:`ug_bootloader_adding`. @@ -61,7 +63,7 @@ To enable support for FOTA updates, do the following: .. fota_upgrades_over_ble_mandatory_mcuboot_start * Use MCUboot as the upgradable bootloader (:kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT` must be enabled). - For more information, go to the :doc:`mcuboot:index-ncs` page. + For more information, go to the :ref:`ug_bootloader_adding` page. .. fota_upgrades_over_ble_mandatory_mcuboot_end @@ -189,7 +191,7 @@ In |NCS|, you can build and program the :zephyr:code-sample:`smp-svr` as any oth .. parsed-literal:: :class: highlight - west build -b *build_target* -- -DOVERLAY_CONFIG=overlay-bt.conf + west build -b *build_target* -- -DEXTRA_CONF_FILE=overlay-bt.conf west flash Make sure to indicate the :file:`overlay-bt.conf` overlay configuration for the Bluetooth transport like in the command example. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/features.rst b/doc/nrf/device_guides/working_with_nrf/nrf52/features.rst index 5a0f6b639b10..add020112b4f 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf52/features.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf52/features.rst @@ -71,7 +71,7 @@ See the :ref:`ug_bt_mesh` user guide for information about how to use the suppli Enhanced ShockBurst =================== -.. include:: ../../../protocols/esb/index.rst +.. include:: /protocols/esb/index.rst :start-after: esb_intro_start :end-before: esb_intro_end @@ -81,7 +81,7 @@ To start developing, check out the :ref:`esb_ptx` and :ref:`esb_prx` samples. Gazell ====== -.. include:: ../../../protocols/gazell/index.rst +.. include:: /protocols/gazell/index.rst :start-after: gz_intro_start :end-before: gz_intro_end @@ -91,7 +91,7 @@ To start developing, check out the :ref:`gazell_samples`. Matter ====== -.. include:: ../../../protocols/matter/index.rst +.. include:: /protocols/matter/index.rst :start-after: matter_intro_start :end-before: matter_intro_end @@ -126,7 +126,7 @@ The nrfx repository is included in the |NCS| as a module of the Zephyr repositor Thread ====== -.. include:: ../../../protocols/thread/index.rst +.. include:: /protocols/thread/index.rst :start-after: thread_intro_start :end-before: thread_intro_end @@ -136,7 +136,7 @@ To start developing, refer to the :ref:`openthread_samples`. Zigbee ====== -.. include:: ../../../protocols/zigbee/index.rst +.. include:: /protocols/zigbee/index.rst :start-after: zigbee_ug_intro_start :end-before: zigbee_ug_intro_end diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf52/gs.rst deleted file mode 100644 index dc0037fb64ee..000000000000 --- a/doc/nrf/device_guides/working_with_nrf/nrf52/gs.rst +++ /dev/null @@ -1,248 +0,0 @@ -.. _ug_nrf52_gs: - -Getting started with nRF52 Series -################################# - -.. contents:: - :local: - :depth: 2 - -This section gets you started with your nRF52 Series :term:`Development Kit (DK)` using the |NCS|. -It tells you how to install the :ref:`peripheral_uart` sample and perform a quick test of your DK. - -If you have already set up your nRF52 Series DK and want to learn more, see the following documentation: - -* :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. - -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:: ../nrf52/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 and test the functions. -If you connect to the sample now, you can go directly to Step 2 of :ref:`nrf52_gs_connecting`. - -.. _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, you can test the sample from Step 2 of :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. Connect the |DK| to the computer with a micro-USB cable and turn on the DK. - - **LED1** starts 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:: ../nrf52/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:: ../nrf52/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. Connect the |DK| to the computer with a micro-USB cable and turn on the DK. - - **LED1** starts 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:: ../nrf52/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:: ../nrf52/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:: ../nrf52/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/device_guides/working_with_nrf/nrf53/features_nrf53.rst b/doc/nrf/device_guides/working_with_nrf/nrf53/features_nrf53.rst new file mode 100644 index 000000000000..b70eec08beae --- /dev/null +++ b/doc/nrf/device_guides/working_with_nrf/nrf53/features_nrf53.rst @@ -0,0 +1,81 @@ +.. _features_nrf53: + +Features of nRF53 Series +######################## + +.. contents:: + :local: + :depth: 2 + +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. + +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. + +For the nRF5340 DK, see the following user guides: + +* :ref:`ug_nrf5340_gs` for getting started with the nRF5340 DK. +* :ref:`ug_nrf5340` for advanced topics specific to the nRF5340 DK. + +For the Nordic Thingy:53, see the following user guides: + +* :ref:`ug_thingy53_gs` for getting started with the Thingy:53. +* :ref:`ug_thingy53` for advanced topics specific to the Thingy:53. + +Dual-core architecture +********************** + +The nRF53 Series introduces a dual-core Arm Cortex-M33 architecture, consisting of the following cores: + +* An application core for high-performance application execution. +* A dedicated network core optimized for wireless communication efficiency. + +The dual-core architecture allows for concurrent execution of application logic and wireless communication tasks. +This ensures that the application processes do not interfere with network operations, enabling IoT with higher responsiveness and reliability. +With one core dedicated to application tasks and the other to connectivity, devices can benefit from optimized performance in both areas. + +The separation of application and network functionalities simplifies firmware updates, allowing modifications on one processor without affecting the other. + +This architecture is ideal for devices requiring significant data processing alongside continuous wireless connectivity. + +Inter-core communication +======================== + +Interprocessor Communication (IPC) allows for inter-core communication between the two cores. +Communication between the application core and the network core happens through a shared memory area. +The application core memory is mapped to the network core memory map. +This means that the network core can access and use the application core memory for shared memory communication. +IPC is used to indicate to the other core that there is new data available to pick up. +The actual data exchange is handled by Open Asymmetric Multi-Processing (OpenAMP). + +Enhanced security features +************************** + +In addition to a :ref:`secure bootloader chain ` (as in the nRF52 Series), the nRF53 Series incorporates the following within its dual-core architecture: + +* Arm TrustZone® for hardware-enforced isolation. +* CryptoCell-312 for encryption, decryption, and cryptographic operations. + +These elements provide a platform for secure execution environments and secure data handling. +In addition, the compartmentalization provided by the dual-core setup enables enhanced security measures, with critical operations and sensitive data isolated from general application processes. +Utilizing Arm TrustZone technology on the application processor can further secure devices against tampering and cyber threats. + +Supported protocols +******************* + +The nRF53 Series supports several protocols, including the following protocols: + +* Bluetooth Low Energy +* Thread and Zigbee (IEEE 802.15.4) + +See :ref:`ug_nrf5340_protocols` for more information on supported protocols and use cases for the nRF5340 DK in particular. + +Multiprotocol support +********************* + +The nRF53 Series supports simultaneous multiprotocol operation with Thread and Zigbee (IEEE 802.15.4), enabled by the dual-core setup. + +See :ref:`ug_nrf5340_protocols_multiprotocol` for more information on multiprotocol support for the nRF5340 DK in particular. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst b/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst index 9184f4908150..0b411f1b1502 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340.rst @@ -44,7 +44,7 @@ Network core The network core is an Arm Cortex-M33 processor with a reduced feature set, designed for ultra-low-power operation. Use this core for radio communication and for real-time processing tasks involving low-level radio protocol layers. -The build target for the network core in Zephyr is ``nrf5340dk_nrf5340_cpunet``. +The build target for the network core in Zephyr is ``nrf5340dk/nrf5340/cpunet``. .. _ug_nrf5340_intro_app_core: @@ -59,8 +59,8 @@ When the MCU boots, it always starts executing from the secure area. In Zephyr, the firmware of the application core is built using one of the following build targets: -* ``nrf5340dk_nrf5340_cpuapp`` for build targets with CMSE disabled. -* ``nrf5340dk_nrf5340_cpuapp_ns`` for build targets that have CMSE enabled and have the SPE firmware alongside the NSPE firmware. +* ``nrf5340dk/nrf5340/cpuapp`` for build targets with CMSE disabled. +* ``nrf5340dk/nrf5340/cpuapp/ns`` for build targets that have CMSE enabled and have the SPE firmware alongside the NSPE firmware. For information about CMSE and the difference between the two environments, see :ref:`app_boards_spe_nspe`. @@ -80,13 +80,6 @@ See also :ref:`tfm_hello_world` for a sample that demonstrates how to add TF-M t Inter-core communication ======================== -Communication between the application core and the network core happens through a shared memory area. -The application core memory is mapped to the network core memory map. -This means that the network core can access and use the application core memory for shared memory communication. - -Interprocessor Communication (IPC) is used to indicate to the other core that there is new data available to pick up. -The actual data exchange is handled by Open Asymmetric Multi-Processing (OpenAMP). - Zephyr includes the `OpenAMP`_ library, which provides a complete solution for exchanging messages between the cores. The IPC peripheral is presented to Zephyr as an Interprocessor Mailbox (IPM) device. The OpenAMP library uses the IPM SHIM layer, which in turn uses the IPC driver in `nrfx`_. @@ -145,6 +138,8 @@ The following table lists performance numbers that were measured under different | 128 MHz | External flash | Yes | 48 MHz | Quad | 36.4 | 8.85 | 13.9 | 966 | 911 | +-----------------+-----------------+--------+--------------+--------+-----------+--------------------+--------------------+--------------------------+--------------------------+ +.. _ug_nrf5340_protocols: + Protocols and use cases *********************** @@ -235,6 +230,7 @@ The sample implements the RPMsg transport using the `OpenAMP`_ library to commun For the application core, the |NCS| provides a series of samples for the :ref:`Thread `, :ref:`Zigbee `, and :ref:`Matter ` protocols. |multi_image| +.. _ug_nrf5340_protocols_multiprotocol: Multiprotocol (Thread or Zigbee in combination with Bluetooth LE) ================================================================= @@ -285,7 +281,7 @@ Direct use of the radio peripheral Samples that directly use the radio peripheral can run on the network core of the nRF5340. They do not require any functionality from the application core. -However, on nRF5340, the application core is responsible for starting the network core and connecting its GPIO pins (see :kconfig:option:`CONFIG_BOARD_ENABLE_CPUNET` and the code in :file:`zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340_cpunet_reset.c`). +However, on nRF5340, the application core is responsible for starting the network core and connecting its GPIO pins (see :kconfig:option:`CONFIG_BOARD_ENABLE_CPUNET` and the code in :file:`zephyr/boards/nordic/nrf5340dk/nrf5340_cpunet_reset.c`). Therefore, you must always program the application core, even if the firmware is supposed to run only on the network core. You can use the :ref:`nrf5340_empty_app_core` sample for this purpose. @@ -395,9 +391,9 @@ You can build and program separate images or combined images using the |nRFVSC|. Separate images --------------- -To build and program the application core, follow the instructions in `How to build an application`_ and use ``nrf5340dk_nrf5340_cpuapp`` or ``nrf5340dk_nrf5340_cpuapp_ns`` as the build target. +To build and program the application core, follow the instructions in `How to build an application`_ and use ``nrf5340dk/nrf5340/cpuapp`` or ``nrf5340dk/nrf5340/cpuapp/ns`` as the build target. -To build and program the network core, follow the instructions in `How to build an application`_ and use ``nrf5340dk_nrf5340_cpunet`` as the build target. +To build and program the network core, follow the instructions in `How to build an application`_ and use ``nrf5340dk/nrf5340/cpunet`` as the build target. .. _ug_nrf5340_VSC_multi_image: @@ -410,7 +406,7 @@ Complete the following steps to build and program a multi-image build to the nRF .. |sample_path_vsc| replace:: :file:`nrf/samples/bluetooth/peripheral_lbs` -.. |vsc_sample_board_target_line| replace:: select ``nrf5340dk_nrf5340_cpuapp`` or ``nrf5340dk_nrf5340_cpuapp_ns`` as the target board +.. |vsc_sample_board_target_line| replace:: select ``nrf5340dk/nrf5340/cpuapp`` or ``nrf5340dk/nrf5340/cpuapp/ns`` as the target board .. include:: ../../../includes/vsc_build_and_run.txt @@ -537,6 +533,8 @@ See the following instructions. Therefore, you must recover the network core first. Otherwise, if you recover the application core first and the network core last, the binary written to the application core is deleted and readback protection is enabled again after a reset. +.. _ug_nrf53_developing_ble_fota: + .. include:: ../nrf52/developing.rst :start-after: fota_upgrades_intro_start :end-before: fota_upgrades_intro_end diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples.rst index 773147437f66..c2aa0c0ba204 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_app_samples.rst @@ -29,6 +29,7 @@ The following |NCS| application has been developed and tested on the nRF54H20: * :ref:`nrf_machine_learning_app` * :ref:`nrf_desktop` * ``nrf_tbr_app`` +* ``suit_flash_companion`` Zephyr samples ************** diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_configuration.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_configuration.rst index 865c6ae438b6..3a992aefc004 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_configuration.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_configuration.rst @@ -2,19 +2,19 @@ .. _ug_nrf54h20_configuration: -Configuring the nRF54H20 PDK -############################ +Configuring the nRF54H20 DK +########################### .. contents:: :local: :depth: 2 -The nRF54H20 PDK uses both devicetree and Kconfig for its hardware and software configuration. +The nRF54H20 DK uses both devicetree and Kconfig for its hardware and software configuration. You can find the basics of both devicetree and Kconfig in Zephyr in the :ref:`zephyr:application` section of the Zephyr documentation. You can also read the :ref:`app_build_system` section describing the |NCS| additions to the Zephyr configuration system. -However, the multicore nature of the nRF54H20 PDK required some changes to the way devicetree files are organized. +However, the multicore nature of the nRF54H20 DK required some changes to the way devicetree files are organized. DTS file scheme *************** @@ -56,7 +56,7 @@ To see and test how to use overlays for changing nodes, see the *Lesson 3* of th Generated HEX files ******************* -When building an application for the nRF54H20 PDK, you are building all domain images at once. +When building an application for the nRF54H20 DK, you are building all domain images at once. During this process, the following :file:`zephyr.hex` images are built: * Application core application @@ -76,7 +76,7 @@ Additionally, the following user information configuration registers (UICR) cont Flashing both :file:`zephyr.hex` + :file:`uicr.hex` will result in the same configuration. All of the HEX files need to be flashed into the device. -For more information on building images for the nRF54H20 PDK, see :ref:`ug_nrf54h20_gs`. +For more information on building images for the nRF54H20 DK, see :ref:`ug_nrf54h20_gs`. For additional information on multi-image builds see :ref:`ug_multi_image`. Other revelant resources diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_debugging.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_debugging.rst index 5e03f9842769..b8f0d52ab523 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_debugging.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_debugging.rst @@ -9,7 +9,7 @@ nRF54H20 debugging :local: :depth: 2 -The main recommended tool for debugging in the |NCS| for the limited sampling of the nRF54H20 PDK is the `GNU Project Debugger`_ (GDB tool). +The main recommended tool for debugging in the |NCS| for the limited sampling of the nRF54H20 DK is the `GNU Project Debugger`_ (GDB tool). When working from the command line, you can use west with the GDB tool. For details, read the :ref:`Debugging with west debug ` section on the :ref:`zephyr:west-build-flash-debug` page in the Zephyr documentation. @@ -26,11 +26,11 @@ Set the following Kconfig options to ``y`` for the images running on the cores y * :kconfig:option:`CONFIG_DEBUG_THREAD_INFO` - This option adds additional information to the thread object so that the debugger can discover the threads. This will work for any debugger. -Debug build types -***************** +Debug configurations +******************** -Some applications and samples provide a specific build type that enables additional debug functionalities. -You can select build types when you are :ref:`configuring the build settings `. +Some applications and samples provide a specific configuration that enables additional debug functionalities. +You can select custom configurations when you are :ref:`configuring the build settings `. Debugging multiple cores ************************ @@ -73,11 +73,11 @@ To debug a specific core using ``JLinkExe`` do the following: You can use this command to run J-Link also on other Arm cores. You can find the ``SEGGER-ID`` as follows: - * Check the ``SEGGER ID`` printed on the label on the bottom side of the PDK. + * Check the ``SEGGER ID`` printed on the label on the bottom side of the DK. * Run the ``nrfjprog --ids`` command. - If just one PDK is connected to the machine, defining ``SEGGER-ID`` is not necessary. - If more than one PDK is connected to the machine and ``SEGGER-ID`` is undefined, a pop up window will appear where you can manually select the ID of the PDK you want to run J-Link on. + If just one DK is connected to the machine, defining ``SEGGER-ID`` is not necessary. + If more than one DK is connected to the machine and ``SEGGER-ID`` is undefined, a pop up window will appear where you can manually select the ID of the DK you want to run J-Link on. .. note:: PPR core debugging is not functional in the initial limited sampling. @@ -113,7 +113,7 @@ Logs are integrated into various modules and subsystems in the |NCS| and Zephyr. These logs are visible once you configure the logger for your application. You can also configure log level per logger module to, for example, get more information about a given subsystem. -See :ref:`ug_nrf54h20_logging` for details on how to enable and configure logs on the nRF54H20 PDK. +See :ref:`ug_nrf54h20_logging` for details on how to enable and configure logs on the nRF54H20 DK. Debugging stack overflows ************************* diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst index 045a3043125f..0a98fceb59c6 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_gs.rst @@ -2,17 +2,17 @@ .. _ug_nrf54h20_gs: -Getting started with the nRF54H20 PDK -##################################### +Getting started with the nRF54H20 DK +#################################### .. contents:: :local: :depth: 2 -This section gets you started with your nRF54H20 Preliminary Development Kit (PDK) using the |NCS|. +This section gets you started with your nRF54H20 Development Kit (DK) using the |NCS|. It tells you how to install the :ref:`multicore_hello_world` sample and perform a quick test of your DK. -If you have already set up your nRF54H20 PDK and want to learn more, see the following documentation: +If you have already set up your nRF54H20 DK and want to learn more, see the following documentation: * :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. * ``ug_nrf54`` documentation for more advanced topics related to the nRF54H20. @@ -29,7 +29,7 @@ Make sure you have all the required hardware and that your computer has one of t Hardware ======== -* nRF54H20 PDK +* nRF54H20 DK * USB-C cable Software @@ -50,14 +50,14 @@ You also need to install `Git`_ or `Git for Windows`_ (on Linux and Mac, or Wind Testing with the Blinky sample ****************************** -The nRF54H20 PDK comes preprogrammed with the :zephyr:code-sample:`blinky` sample. +The nRF54H20 DK comes preprogrammed with the :zephyr:code-sample:`blinky` sample. -Complete the following steps to test that the PDK works correctly: +Complete the following steps to test that the DK works correctly: -1. Connect the USB-C end of the USB-C cable to the **IMCU USB** port the nRF54H20 PDK. +1. Connect the USB-C end of the USB-C cable to the **IMCU USB** port the nRF54H20 DK. #. Connect the other end of the USB-C cable to your PC. -#. Move the **POWER** switch to **On** to turn the nRF54H20 PDK on. - The switch is located in the top left corner of the PDK PCB. +#. Move the **POWER** switch to **On** to turn the nRF54H20 DK on. + The switch is located in the top left corner of the DK PCB. **LED1** will turn on and start to blink. @@ -77,22 +77,22 @@ Programming the sample ********************** The :ref:`multicore_hello_world` sample is a multicore sample running on both the Application core (``cpuapp``) and the Peripheral Processor (PPR, ``cpuppr``). -It uses the ``nrf54h20pdk_nrf54h20_cpuapp`` build target. +It uses the ``nrf54h20dk/nrf54h20/cpuapp`` build target. -To build and program the sample to the nRF54H20 PDK, complete the following steps: +To build and program the sample to the nRF54H20 DK, complete the following steps: -1. Connect the nRF54H20 PDK to you computer using the IMCU USB port on the PDK. +1. Connect the nRF54H20 DK to you computer using the IMCU USB port on the DK. #. Navigate to the :file:`nrf/samples/multicore/hello_world` folder containing the sample. #. Build the sample for application and radio cores by running the following command:: - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpurad . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.multicore.hello_world.nrf54h20dk_cpuapp_cpurad . #. Alternatively, build the sample for the application and PPR cores by running the following command:: - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.multicore.hello_world.nrf54h20dk_cpuapp_cpuppr . #. Program the sample using nrfjprog. - If you have multiple Nordic Semiconductor devices, make sure that only the nRF54H20 PDK you want to program is connected. + If you have multiple Nordic Semiconductor devices, make sure that only the nRF54H20 DK you want to program is connected. .. code-block:: console @@ -105,20 +105,13 @@ The sample will be automatically built and programmed on both the Application co Reading the logs **************** -With the :ref:`multicore_hello_world` sample programmed, the nRF54H20 PDK outputs logs for the application core and the configured remote processor. +With the :ref:`multicore_hello_world` sample programmed, the nRF54H20 DK outputs logs for the application core and the configured remote processor. The logs are output over UART. -To read the logs from the :ref:`multicore_hello_world` sample programmed to the nRF54H20 PDK, complete the following steps: +To read the logs from the :ref:`multicore_hello_world` sample programmed to the nRF54H20 DK, complete the following steps: -1. Connect to the PDK with a terminal emulator (for example, `Serial Terminal from nRF Connect for Desktop`_) using the following settings: - - * Baud rate: 115200 - * 8 data bits - * 1 stop bit - * No parity - * HW flow control: None - -#. Press the **Reset** button on the PCB to reset the PDK. +1. Connect to the DK with a terminal emulator (for example, `nRF Connect Serial Terminal`_) using the :ref:`default serial port connection settings `. +#. Press the **Reset** button on the PCB to reset the DK. #. Observe the console output for both cores: * For the application core, the output should be as follows: @@ -126,8 +119,8 @@ To read the logs from the :ref:`multicore_hello_world` sample programmed to the .. code-block:: console *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 *** - Hello world from nrf54h20pdk_nrf54h20_cpuapp - Hello world from nrf54h20pdk_nrf54h20_cpuapp + Hello world from nrf54h20dk/nrf54h20/cpuapp + Hello world from nrf54h20dk/nrf54h20/cpuapp ... * For the remote core, e.g. PPR, the output should be as follows: @@ -135,8 +128,8 @@ To read the logs from the :ref:`multicore_hello_world` sample programmed to the .. code-block:: console *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 *** - Hello world from nrf54h20pdk_nrf54h20_cpuppr - Hello world from nrf54h20pdk_nrf54h20_cpuppr + Hello world from nrf54h20dk/nrf54h20/cpuppr + Hello world from nrf54h20dk/nrf54h20/cpuppr ... .. note:: @@ -147,7 +140,7 @@ See the :ref:`ug_nrf54h20_logging` page for more information. Next steps ********** -You are now all set to use the nRF54H20 PDK. +You are now all set to use the nRF54H20 DK. See the following links for where to go next: * :ref:`ug_nrf54h20_architecture` for information about the multicore System-on-Chip, such as the responsibilities of the cores and their interprocessor interactions, the memory mapping, and the boot sequence. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_logging.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_logging.rst index df39bb4b3339..0bf2410f2141 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_logging.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_logging.rst @@ -8,7 +8,7 @@ nRF54H20 logging :local: :depth: 2 -To read logs on the nRF54H20 PDK, you can use the following methods: +To read logs on the nRF54H20 DK, you can use the following methods: * A direct UART connection to a specific core. * Local domain logging with System Trace Macrocell (STM). diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_matter_thread.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_matter_thread.rst index 06192563d3c9..63ea82eb129c 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_matter_thread.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_matter_thread.rst @@ -9,14 +9,14 @@ Working with nRF54H20 and Matter and Thread :local: :depth: 2 -The nRF54H20 PDK supports the following Matter and Thread samples: +The nRF54H20 DK supports the following Matter and Thread samples: * :ref:`Matter door lock sample ` * :ref:`Matter template sample ` * :ref:`Thread CLI sample ` The Matter support is currently limited to Matter over Thread, and support for both Matter and Thread is currently :ref:`experimental `. -Read the following sections for more information about support in the nRF54H20 PDK and the platform design for the nRF54H20 SoC. +Read the following sections for more information about support in the nRF54H20 DK and the platform design for the nRF54H20 SoC. For more information about Matter and Thread in the |NCS|, read the documentation in the :ref:`ug_matter` and :ref:`ug_thread` protocol sections. @@ -121,16 +121,16 @@ For more information, see :ref:`ug_nrf54h20_architecture_cpu`. Refer to the :ref:`nrf54h20_platform_multi_figure` figure to see the architecture of the SoC. The Global Domain is not included. -Additional requirements on the nRF54H20 PDK -******************************************* +Additional requirements on the nRF54H20 DK +****************************************** -In addition to the standard requirements for the |NCS|, such as the :ref:`ug_matter_gs_tools_gn` for Matter, you need the following to run Matter-enabled or Thread-enabled applications on the nRF54H20 PDK: +In addition to the standard requirements for the |NCS|, such as the :ref:`ug_matter_gs_tools_gn` for Matter, you need the following to run Matter-enabled or Thread-enabled applications on the nRF54H20 DK: * For DFU - J-Link and a USB cable. * nrfjprog from the `nRF Command Line Tools`_. -Configuring Matter and Thread on the nRF54H20 PDK -************************************************* +Configuring Matter and Thread on the nRF54H20 DK +************************************************ Currently, only the configuration for Matter over Thread is supported for Matter. Follow the configuration steps on the :ref:`ug_matter_gs_testing` page to configure the Matter environment for the supported Matter samples. @@ -140,21 +140,21 @@ See the sample documentation for how to configure it. The Matter and Thread samples can work on the corresponding networks with standard devices of the same protocol. -Programming Matter and Thread samples on the nRF54H20 PDK -========================================================= +Programming Matter and Thread samples on the nRF54H20 DK +======================================================== -To program the compatible Matter or Thread samples on the nRF54H20 PDK, follow the :ref:`ug_nrf54h20_gs_sample` steps. +To program the compatible Matter or Thread samples on the nRF54H20 DK, follow the :ref:`ug_nrf54h20_gs_sample` steps. Read also programming guides prepared for specific Matter samples: :ref:`Matter door lock sample `, and :ref:`Matter template sample `. .. note:: :ref:`Testing using Bluetooth LE with Nordic UART Service ` on the :ref:`Matter door lock sample ` is disabled by default. -Logging for Matter and Thread samples on the nRF54H20 PDK -========================================================= +Logging for Matter and Thread samples on the nRF54H20 DK +======================================================== -To read logs for Matter samples on the nRF54H20 PDK, complete the following steps: +To read logs for Matter samples on the nRF54H20 DK, complete the following steps: -1. Connect to the nRF54H20 PDK using a USB cable. +1. Connect to the nRF54H20 DK using a USB cable. #. Select the first available port to read the logs from. For more information, see :ref:`ug_nrf54h20_logging`. @@ -168,7 +168,7 @@ Matter over Wi-Fi is currently supported on the :ref:`Matter door lock sample ` feature has been implemented on the nRF54H20 PDK and you can use it in the :ref:`Matter door lock sample `. +The :ref:`SUIT Device Firmware Upgrade ` feature has been implemented on the nRF54H20 DK and you can use it in the :ref:`Matter door lock sample `. In this solution, both Application and Radio Cores can be upgraded sequentially to the newest version using :ref:`SUIT hierarchical manifests `. The SUIT DFU feature uses :ref:`SUIT manifests ` that contain components and images of the firmware and are used by the Secure Domain to replace, verify and run the firmware. In the Matter Lock sample, we use the Simple Management Protocol (SMP) over Bluetooth LE transport to deliver the new firmware to the device's DFU partition and then the SUIT processor installs the image according to the instructions that are described in the manifest. @@ -217,7 +217,7 @@ To build the firmware with the SUIT DFU support, run the following command with .. parsed-literal:: :class: highlight - west build -b nrf54h20dk_nrf54h20_cpuapp -- -DCONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=*number* + west build -b nrf54h20dk/nrf54h20/cpuapp -- -DCONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=*number* You can perform a DFU using the nRF Connect Device Manager mobile application or the :ref:`Mcumgr command-line tool `. After building the sample you can find two SUIT envelopes created in the build directory and depending on the core type you can search for: @@ -227,11 +227,11 @@ After building the sample you can find two SUIT envelopes created in the build d To learn how to perform a DFU using the nRFConnect Device Manager mobile application read instructions in the ``suit smp transfer `` guide. -Performing DFU on nRF54H20 PDK using Mcumgr command-line tool -------------------------------------------------------------- +Performing DFU on nRF54H20 DK using Mcumgr command-line tool +------------------------------------------------------------ 1. Follow the instructions in the :ref:`Mcumgr command-line tool ` guide to install Mcumgr. - #. Press **Button 1** to enable Bluetooth LE SMP advertising on the nRF54H20 PDK. + #. Press **Button 1** to enable Bluetooth LE SMP advertising on the nRF54H20 DK. #. Run the following command to upgrade the Radio Core: .. parsed-literal:: @@ -242,7 +242,7 @@ Performing DFU on nRF54H20 PDK using Mcumgr command-line tool Where: * *hci number* is the Bluetooth LE device ID on your host device (by default it is ``0``). - * *peer name* is the Bluetooth LE name which is advertised by the nRF54H20 PDK (by default ``"Matter Lock"``). + * *peer name* is the Bluetooth LE name which is advertised by the nRF54H20 DK (by default ``"Matter Lock"``). * *path to multiprotocol_rpmsg_subimage.suit* is a path to the SUIT envelope that contains Radio Core image. For example: @@ -252,7 +252,7 @@ Performing DFU on nRF54H20 PDK using Mcumgr command-line tool mcumgr --conntype ble --hci 0 --connstring peer_name="MatterLock" image upload build/multiprotocol_rpmsg/zephyr/multiprotocol_rpmsg_subimage.suit -n 0 -w 1 - #. Press **Button 1** to enable Bluetooth LE SMP advertising on the nRF54H20 PDK again, because the previous operation disabled it after applying the image. + #. Press **Button 1** to enable Bluetooth LE SMP advertising on the nRF54H20 DK again, because the previous operation disabled it after applying the image. #. Run the same command as in Step 3 to upgrade the Application Core image, but this time provide a path to the ``app.suit`` file. For example: @@ -263,17 +263,17 @@ Performing DFU on nRF54H20 PDK using Mcumgr command-line tool mcumgr --conntype ble --hci 0 --connstring peer_name="MatterLock" image upload build/zephyr/app.suit -n 0 -w 1 -Implementing support for the nRF54H20 PDK -========================================= +Implementing support for the nRF54H20 DK +======================================== -If you want to implement support for the nRF54H20 PDK in your Matter-enabled or Thread-enabled application, read the :ref:`ug_nrf54h20_configuration` guide. +If you want to implement support for the nRF54H20 DK in your Matter-enabled or Thread-enabled application, read the :ref:`ug_nrf54h20_configuration` guide. .. _ug_nrf54h20_matter_thread_limitations: -Limitations for Matter and Thread on the nRF54H20 PDK -***************************************************** +Limitations for Matter and Thread on the nRF54H20 DK +**************************************************** -Matter and Thread support has the following limitations on the nRF54H20 PDK: +Matter and Thread support has the following limitations on the nRF54H20 DK: * DFU over Matter or Serial Link is not yet implemented. * The current implementation is not power-optimized. @@ -283,7 +283,7 @@ Matter and Thread support has the following limitations on the nRF54H20 PDK: * The factory reset functionality does not work properly. After clearing all NVM storage, the device can not reboot automatically and falls into a hard fault. - As a workaround, press the reset button on the nRF54H20 PDK board after performing a factory reset. + As a workaround, press the reset button on the nRF54H20 DK board after performing a factory reset. * Matter over Thread commissioning might be unstable due to the lack of true random generator support on nRF54H20. After each reboot or factory reset, the device will always have the same Bluetooth LE and IEEE 80215.4 addresses. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_nrf7002ek.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_nrf7002ek.rst index c533d8017e78..5cae530c9b10 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_nrf7002ek.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_nrf7002ek.rst @@ -2,64 +2,64 @@ .. _ug_nrf54h20_nrf7002ek: -Working with the nRF54H20 PDK and the nRF7002 EK -################################################ +Working with the nRF54H20 DK and the nRF7002 EK +############################################### .. contents:: :local: :depth: 2 The `nRF7002 EK`_ is an evaluation kit featuring the nRF7002 Wi-Fi® 6 companion IC. -The kit can be used to provide Wi-Fi connectivity to the nRF54H20 PDK. +The kit can be used to provide Wi-Fi connectivity to the nRF54H20 DK. .. figure:: images/nRF7002ek.png :alt: nRF7002 EK -Pin assignment for the nRF54H20 PDK GPIO -======================================== +Pin assignment for the nRF54H20 DK GPIO +======================================= -The interface connector of the nRF7002 EK can be connected to the nRF54H20 PDK GPIO as described in the following table: +The interface connector of the nRF7002 EK can be connected to the nRF54H20 DK GPIO as described in the following table: -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| nRF7002 EK signal | nRF54H20 PDK GPIO signal | EK connector and pin | Function | -+================================+==========================+======================+==================================+ -| BUCK_EN | **P0.08** | **P9.2** | Enable power to nRF7002 | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| IOVDDEN | **P0.09** | **P9.1** | Enable power to I/O interface | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| COEX STATUS0 | **P0.02** | **P9.3** | Coexistence status 0 | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| COEX REQUEST | **P0.03** | **P9.4** | Coexistence request from host | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| COEX GRANT | **P0.04** | **P9.5** | Coexistence grant to host | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SWITCH CONTROL0 | **P0.05** | **P9.6** | Switch control 0 | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SWITCH CONTROL1 / COEX STATUS1 | **P0.06** | **P9.7** | Switch control 1 / Coex status 1 | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| HOST IRQ | **P0.10** | **P9.8** | Interrupt request to host | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SPI CS | **P2.09** | **P10.3** | SPI Slave select | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SPI MOSI | **P2.07** | **P10.4** | SPI Slave IN | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SPI MISO | **P2.08** | **P10.5** | SPI Slave OUT | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| SPI CLK | **P2.00** | **P10.6** | SPI Clock | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| 5V | **P5.3** | **P7.5** | 5 V to nRF7002 EK | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| GND | **P5.1** | **P7.6** | GND | -+--------------------------------+--------------------------+----------------------+----------------------------------+ -| VDD | **P5.4** | **P7.1** | 1.8 V to nRF7002 EK | -+--------------------------------+--------------------------+----------------------+----------------------------------+ ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| nRF7002 EK signal | nRF54H20 DK GPIO signal | EK connector and pin | Function | ++================================+=========================+======================+==================================+ +| BUCK_EN | **P0.08** | **P9.2** | Enable power to nRF7002 | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| IOVDDEN | **P0.09** | **P9.1** | Enable power to I/O interface | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| COEX STATUS0 | **P0.02** | **P9.3** | Coexistence status 0 | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| COEX REQUEST | **P0.03** | **P9.4** | Coexistence request from host | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| COEX GRANT | **P0.04** | **P9.5** | Coexistence grant to host | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SWITCH CONTROL0 | **P0.05** | **P9.6** | Switch control 0 | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SWITCH CONTROL1 / COEX STATUS1 | **P0.06** | **P9.7** | Switch control 1 / Coex status 1 | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| HOST IRQ | **P0.10** | **P9.8** | Interrupt request to host | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SPI CS | **P2.09** | **P10.3** | SPI Slave select | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SPI MOSI | **P2.07** | **P10.4** | SPI Slave IN | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SPI MISO | **P2.08** | **P10.5** | SPI Slave OUT | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| SPI CLK | **P2.00** | **P10.6** | SPI Clock | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| 5V | **P5.3** | **P7.5** | 5 V to nRF7002 EK | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| GND | **P5.1** | **P7.6** | GND | ++--------------------------------+-------------------------+----------------------+----------------------------------+ +| VDD | **P5.4** | **P7.1** | 1.8 V to nRF7002 EK | ++--------------------------------+-------------------------+----------------------+----------------------------------+ These connectors are on the bottom side of the nRF7002 EK. -You can make the connections with a flyer wire between the headers **P2**, **P0**, and **P5** on nRF54H20 PDK and **P9**, **P10**, and **P7** on nRF7002 EK. +You can make the connections with a flyer wire between the headers **P2**, **P0**, and **P5** on nRF54H20 DK and **P9**, **P10**, and **P7** on nRF7002 EK. Supported samples ================= -The :ref:`wifi_shell_sample` sample provides support for the nRF54H20 PDK used with the nRF7002 EK. +The :ref:`wifi_shell_sample` sample provides support for the nRF54H20 DK used with the nRF7002 EK. For more information, visit its :ref:`documentation `. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_dfu.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_dfu.rst index 294357e70c7c..01f5dbb5640e 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_dfu.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_dfu.rst @@ -38,11 +38,11 @@ Requirements For this user guide, the following development kit is required: -+------------------------+----------+--------------------------------+------------------------------------+ -| **Hardware platforms** | **PCA** | **Board name** | **Build target** | -+========================+==========+================================+====================================+ -| nRF54H20 PDK | PCA10145 | ``nrf54h20dk_nrf54h20_cpuapp`` | ``nrf54h20dk_nrf54h20_cpuapp@soc1``| -+------------------------+----------+--------------------------------+------------------------------------+ ++------------------------+----------+--------------------------------+-------------------------------+ +| **Hardware platforms** | **PCA** | **Board name** | **Build target** | ++========================+==========+================================+===============================+ +| nRF54H20 DK | PCA10175 | ``nrf54h20dk`` | ``nrf54h20dk/nrf54h20/cpuapp``| ++------------------------+----------+--------------------------------+-------------------------------+ Software requirements --------------------- @@ -93,7 +93,7 @@ Let us assume that you would like to store the editable manifest templates in th .. code-block:: console - west build -d C:/ncs-lcs/work_dir/build/ -b nrf54h20dk_nrf54h20_cpuapp@soc1 -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="C:/my_templates" + west build -d C:/ncs-lcs/work_dir/build/ -b nrf54h20dk/nrf54h20/cpuapp -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="C:/my_templates" .. group-tab:: Linux @@ -101,7 +101,7 @@ Let us assume that you would like to store the editable manifest templates in th .. code-block:: console - west build -b nrf54h20dk_nrf54h20_cpuapp@soc1 -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="/home/my_user/my_templates" + west build -b nrf54h20dk/nrf54h20/cpuapp -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="/home/my_user/my_templates" The source of the manifest templates can be configured by setting the following Kconfig options: @@ -159,7 +159,7 @@ To build the described example with the provided manifest templates taken from y .. code-block:: console - west build -d C:/ncs-lcs/work_dir/build/ -b nrf54h20dk_nrf54h20_cpuapp@soc1 -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="c:/my_templates" -DCONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE="c:/my_default_templates/root.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_APP_TEMPLATE="c:/my_default_templates/app.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_HCI_RPMSG_SUBIMAGE_TEMPLATE="c:/my_default_templates/radio.yaml.jinja2" + west build -d C:/ncs-lcs/work_dir/build/ -b nrf54h20dk/nrf54h20/cpuapp -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="c:/my_templates" -DCONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE="c:/my_default_templates/root.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_APP_TEMPLATE="c:/my_default_templates/app.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_HCI_RPMSG_SUBIMAGE_TEMPLATE="c:/my_default_templates/radio.yaml.jinja2" .. group-tab:: Linux @@ -167,7 +167,7 @@ To build the described example with the provided manifest templates taken from y .. code-block:: console - west build -b nrf54h20dk_nrf54h20_cpuapp@soc1 -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="/home/my_user/my_templates" -DCONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE="/home/my_user/my_default_templates/root.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_APP_TEMPLATE="/home/my_user/my_default_templates/app.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_HCI_RPMSG_SUBIMAGE_TEMPLATE="/home/my_user/my_default_templates/radio.yaml.jinja2" + west build -b nrf54h20dk/nrf54h20/cpuapp -p -- -DCONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="/home/my_user/my_templates" -DCONFIG_SUIT_ENVELOPE_ROOT_TEMPLATE="/home/my_user/my_default_templates/root.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_APP_TEMPLATE="/home/my_user/my_default_templates/app.yaml.jinja2" -DCONFIG_SUIT_ENVELOPE_HCI_RPMSG_SUBIMAGE_TEMPLATE="/home/my_user/my_default_templates/radio.yaml.jinja2" Editable manifest copied into the sample directory (or in the directory configured using the :kconfig:option:`CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION` Kconfig option) can be modified to edit the contents of the envelopes and modify the DFU process. These files will not be overwritten by the build system during the next builds or in consecutive SDK releases. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_qsg.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_qsg.rst index f5202b46b980..c49715b2c3b8 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_qsg.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_customize_qsg.rst @@ -58,11 +58,11 @@ Requirements For this quick start guide, you need the following development kit: -+------------------------+----------+--------------------------------+------------------------------------+ -| **Hardware platforms** | **PCA** | **Board name** | **Build target** | -+========================+==========+================================+====================================+ -| nRF54H20 PDK | PCA10145 | ``nrf54h20dk_nrf54h20_cpuapp`` | ``nrf54h20dk_nrf54h20_cpuapp@soc1``| -+------------------------+----------+--------------------------------+------------------------------------+ ++------------------------+----------+--------------------------------+-------------------------------+ +| **Hardware platforms** | **PCA** | **Board name** | **Build target** | ++========================+==========+================================+===============================+ +| nRF54H20 DK | PCA10175 | ``nrf54h20dk`` | ``nrf54h20dk/nrf54h20/cpuapp``| ++------------------------+----------+--------------------------------+-------------------------------+ Software requirements ===================== @@ -82,7 +82,7 @@ Start by building the SUIT sample: .. code-block:: console - west build -b nrf54h20dk_nrf54h20_cpuapp@soc1 nrf/samples/suit/smp_transfer + west build -b nrf54h20dk/nrf54h20/cpuapp nrf/samples/suit/smp_transfer This command builds the SUIT sample for the nRF54H20 SoC. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst new file mode 100644 index 000000000000..465c6a8e65c2 --- /dev/null +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_external_memory.rst @@ -0,0 +1,139 @@ +:orphan: + +.. _ug_nrf54h20_suit_external_memory: + +Firmware upgrade with external memory +##################################### + +.. contents:: + :local: + :depth: 2 + +Storing firmware upgrade data in external memory poses a unique challenge on nRF54H20 DK, because the secure domain is unable to access the external memory by itself. +The application domain is used as a proxy for the secure domain to access the 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. + +The following terms are used in this guide: + +* External memory (extmem) service - IPC service allowing the secure domain to use the application domain as a proxy when accessing external memory. + +* Companion image - Application domain firmware implementing the extmem service and external memory driver. + The IPC service allows the secure domain to access the external memory. + +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 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 any fetched payload into any ``CACHE_POOL`` component. + +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. +Before any ``suit-directive-fetch`` directive is issued that accesses a payload stored on the external memory, a companion image that implements an external memory device driver must be booted. + +The companion image consists of two main parts: + +* Device driver adequate for the external memory device + +* 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`` and ``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. + +Enabling external flash support in SUIT DFU +******************************************* + +The :file:`nrf/samples/suit/smp_transfer` sample contains a premade configuration enabling the external memory in SUIT DFU. +To enable the external memory, you must apply the :file:`nrf/samples/suit/smp_transfer/overlay-extmem.conf` and :file:`nrf/samples/suit/smp_transfer/ext_flash_nrf54h20dk.overlay` overlays to the sample build or complete the following steps: + +1. Create a partition named ``companion_partition`` in the executable memory region that is accessible to the application domain by editing the devicetree (DTS) file: + + .. code-block:: devicetree + + &mram0 { + partitions { + companion_partition: partition@116000 { + label = "companion-image"; + reg = <0x116000 DT_SIZE_K(64)>; + }; + }; + }; + + The ``companion_partition`` is the region where the companion image will be executed. + Adjust the addresses accordingly to your application. + +#. Define a new DFU cache partition in the external memory in the DTS file: + + .. code-block:: devicetree + + mx66um1g: mx66um1g45g@0 { + ... + partitions { + dfu_cache_partition_1: partition@0 { + reg = <0x0 DT_SIZE_K(512)>; + }; + }; + }; + + Note the name of the partition. + The number at the end determines the ``CACHE_POOL`` ID, which will be used later in the SUIT manifest. + +#. Modify the application manifest file :file:`app_envelope.yaml.jinja2` by completing the following: + + a. Modify the ``CACHE_POOL`` identifier in the SUIT manifest: + + .. code-block:: console + + 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: + + .. code-block:: console + + suit-components: + ... + - - MEM + - {{ flash_companion_subimage['dt'].label2node['cpu'].unit_addr }} + - {{ get_absolute_address(flash_companion_subimage['dt'].chosen_nodes['zephyr,code-partition']) }} + - {{ flash_companion_subimage['dt'].chosen_nodes['zephyr,code-partition'].regs[0].size }} + + 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: + + .. code-block:: console + + suit-install: + - suit-directive-set-component-index: 3 + - suit-directive-invoke: + - suit-send-record-failure + + The companion image can be optionally upgraded and have its integrity checked. + +#. Enable the :kconfig:option:`CONFIG_SUIT_EXTERNAL_MEMORY_SUPPORT` Kconfig option, which enables the build of the reference companion image to be used as a child image of the application firmware. + It also enables other additional options that are required for the external memory DFU to work. + +Create custom companion images +****************************** + +Nordic Semiconductor provides a reference companion image in the :file:`samples/suit/flash_companion` file, which can serve as a base for developing a customized companion image. + +Limitations +*********** + +* The secure domain and companion image candidates must always be stored in MRAM. + Trying to store those candidates in external memory will result in failure during the installation process. + +* The companion image needs a dedicated area in the executable region of the MRAM that is assigned to the application domain. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_fetch.rst b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_fetch.rst new file mode 100644 index 000000000000..ed3c80028f41 --- /dev/null +++ b/doc/nrf/device_guides/working_with_nrf/nrf54h/ug_nrf54h20_suit_fetch.rst @@ -0,0 +1,155 @@ +:orphan: + +.. _ug_nrf54h20_suit_fetch: + +How to fetch payloads +##################### + +.. contents:: + :local: + :depth: 2 + +In the Software Updates for Internet of Things (SUIT), it is possible for a device to obtain a new firmware in two ways: + +1. The push model - where all necessary candidate images are integrated into the SUIT envelope, and uploaded to a device as a single unit. + +#. The fetch model - where the envelope contains 0 or not all necessary candidate images, and is performed by the application firmware. + The manifest contains logic that instructs the device to fetch other required candidate images through a user-defined mechanism during the envelope processing. + +This guide explains how to reconfigure an application that uses the push model to a fetch model-based upgrade. + +Differences and similarities between the push and fetch models +************************************************************** + +In both the push and fetch models, the candidate images are uploaded to the device in the background, which means that the firmware continues normal operation while the data is being transferred. + +The push model does not require the SUIT processor to be built into the application firmware. +The fetch model, on the other hand, requires the SUIT processor to be built into the application firmware in order to execute the ``suit-payload-fetch`` sequence. +You can enable this by using the :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` Kconfig option. + +In the push model, the envelope along with all necessary candidate images must be stored in a continuous memory region in the MCU's non-volatile storage. +In the fetch model, the envelope must still be stored in a continuous memory region in the MCU, but it does not occupy as much space because not all candidate images are integrated into it. +Some or all candidate images can be stored in separate memory regions from the envelope, or on a completely different storage device altogether. + +Reasons to use the fetch model +****************************** + +The fetch model has greater flexibility compared to the push model in the following areas: + +* Candidate images can be fetched conditionally. + For example, fetching up-to-date firmware can be completely skipped, which saves battery life and transfer costs. + +* Custom fetch source can be implemented. + Nordic Semiconductor provides a reference fetch source implementation which uses the SMP protocol over serial or Bluetooth® LE. + You have the option to implement any fetching mechanism needed for the application, such as fetching from an HTTP resource. + +* Candidate images can be stored in a different memory partition than the envelope itself. + The SUIT envelope itself must always be stored in non-volatile storage that is integrated into the MCU. + The fetched candidate images do not have restrictions on where they are placed and can be stored on an external memory chip. + +Migrating from push-based to fetch-based firmware upgrade +********************************************************* + +The ``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 use the fetch model, complete the following steps: + +1. Enable the following three Kconfig options: + + * :kconfig:option:`CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL` - This enables SUIT envelope processing in the application firmware. + The application firmware will execute the ``suit-payload-fetch`` sequence, if is already in the root manifest. + * :kconfig:option:`CONFIG_MGMT_SUITFU_GRP_SUIT_CAND_ENV_UPLOAD` and :kconfig:option:`CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH`. + These options enable Nordic Semiconductor's reference implementation of the SMP-based fetch source. + In this implementation, the SMP server (the device being updated) uses the SMP client (a computer or a mobile phone) as a proxy to fetch the required candidate images. + +#. Add the ``suit-payload-fetch`` sequence to the root manifest :file:`root_hierarchical_envelope.yaml.jinja2`: + + .. code-block:: console + + suit-payload-fetch: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: '#{{ app['name'] }}' + - suit-directive-fetch: + - suit-send-record-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 + + This instructs the SUIT processor to execute the ``suit-payload-fetch`` in the application manifest, which will be added in the next step. + +#. Modify the application manifest :file:`app_envelope.yaml.jinja2` by completing the following: + + a. Append the ``CACHE_POOL`` component: + + .. code-block:: console + + suit-components: + ... + - - CACHE_POOL + - 0 + + The ``CACHE_POOL`` component with identifier ``0`` is significant, as it is always available and occupies the free space in the DFU partition after the envelope. + It is possible to define additional ``CACHE_POOL`` partitions using devicetree. + + In this example, the ``CACHE_POOL`` component index is ``2``. + In the following steps the cache pool component is selected with ``suit-directive-set-component-index: 2``. + + #. Add the ``suit-payload-fetch`` sequence to the application manifest: + + .. code-block:: console + + 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 + + #. Modify the ``suit-install`` sequence to use an identical URI, (as in the ``suit-payload-fetch``), instead of the integrated one: + + The SUIT procedure attempts to use all fetch sources registered with :c:func:`suit_dfu_fetch_source_register` until one of them fetches the payload. + If no sources are able to fetch the payload, the update process ends with an error. + + The reference SMP fetch source implementation only recognizes URIs that start with ``file://``. + + #. Modify the ``suit-install`` sequence to use an identical URI, as in the ``suit-payload-fetch``, instead of the integrated one. + + .. code-block:: diff + + suit-install: + ... + - suit-directive-set-component-index: 1 + - suit-directive-override-parameters: + - suit-parameter-uri: '#{{ app['name'] }}' + + suit-parameter-uri: 'file://{{ app['binary'] }}' + - suit-directive-fetch: + - suit-send-record-failure + + When the secure domain firmware processes the ``suit-install`` sequence, this sequence of directives instructs the secure domain to search for a payload with a given URI in all cache partitions. + If no such payload is found, the update process ends with an error. + + + #. Remove the application binary from the integrated payloads: + + .. code-block:: diff + + - suit-integrated-payloads: + - '#{{ app['name'] }}': {{ app['binary'] }} + + suit-integrated-payloads: {} + + In the fetch model-based firmware upgrade, it is not necessary to integrate the payload into the envelope. + However, you may still choose to integrate certain payloads. + +Creating a custom fetch source +****************************** + +The reference fetch source (provided by Nordic Semiconductor's implementation) can be found in the :file:`subsys/mgmt/suitfu/src/suitfu_mgmt_suit_image_fetch.c` file. +This serves as a base for implementing custom fetch sources, such as fetching from an HTTP server. +The fetch source API can be found in the :file:`include/dfu/suit_dfu_fetch_source.h` file. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54l/features.rst b/doc/nrf/device_guides/working_with_nrf/nrf54l/features.rst new file mode 100644 index 000000000000..377046ba1190 --- /dev/null +++ b/doc/nrf/device_guides/working_with_nrf/nrf54l/features.rst @@ -0,0 +1,128 @@ +.. _nrf54l_features: + +Features of the nRF54L15 PDK +############################ + +.. contents:: + :local: + :depth: 2 + +The nRF54L15 PDK embeds an Arm® Cortex®-M33 processor with multiprotocol 2.4 GHz transceiver and supports Bluetooth® 5.4. + +For additional information, see the following documentation: + +* Zephyr page on the :ref:`zephyr:nrf54l15pdk_nrf54l15` +* :ref:`ug_nrf54l15_gs` +* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. + +Supported protocols +******************* + +The nRF54L15 PDK supports Bluetooth Low Energy (LE), proprietary protocols (including Enhanced ShockBurst), Matter, and Thread. + +Amazon Sidewalk +=============== + +Amazon Sidewalk is a shared network designed to provide a stable and reliable connection to your device. +Ring and Echo device can act as a gateway, meaning they can share a portion of internet bandwidth providing the connection and services to Sidewalk end devices. +Amazon Sidewalk for the nRF Connect SDK is based on two variants, one using Bluetooth® LE (more suited for home applications) and the other one using sub-GHz with the Semtech radio transceiver (for applications requiring longer range). + +To learn more about the Amazon Sidewalk solution, see the `Sidewalk documentation`_ page. + +Bluetooth Low Energy +==================== + +The Bluetooth LE radio is designed for very low-power operation. +When you develop a Bluetooth LE application, you must use the Bluetooth software stack. +This stack is split into two core components: the Bluetooth Host and the Bluetooth LE Controller. +The :ref:`ug_ble_controller` user guide contains more information about the two available Bluetooth LE Controllers, and instructions for switching between them. + +See the :ref:`zephyr:bluetooth` section of the Zephyr documentation for information on the Bluetooth Host and open source Bluetooth LE Controller. +The |NCS| contains :ref:`ble_samples` that can be run on the nRF54L15 PDK device. +In addition, you can run the :ref:`zephyr:bluetooth-samples` that are included from Zephyr. + +For available libraries, see :ref:`lib_bluetooth_services` (|NCS|) and :ref:`zephyr:bluetooth_api` (Zephyr). + +Enhanced ShockBurst +=================== + +.. include:: ../../../protocols/esb/index.rst + :start-after: esb_intro_start + :end-before: esb_intro_end + +See the :ref:`ug_esb` user guide for information about how to work with Enhanced ShockBurst. +To start developing, check out the :ref:`esb_ptx` and :ref:`esb_prx` samples. + +Matter +====== + +.. include:: ../../../protocols/matter/index.rst + :start-after: matter_intro_start + :end-before: matter_intro_end + +Matter in the |NCS| supports the *System-on-Chip, multiprotocol* platform design for the nRF54L15 SoC using Matter over Thread. +You can read more about other available platform designs for Matter on the :ref:`Matter platform design page`. +For more information about the multiprotocol feature, see :ref:`ug_multiprotocol_support`. + +See the :ref:`ug_matter` user guide for information about how to work with Matter applications. +To start developing, check the :ref:`matter_samples`. + +Thread +====== + +.. include:: ../../../protocols/thread/index.rst + :start-after: thread_intro_start + :end-before: thread_intro_end + +You can read more about other available platform designs for Thread on the :ref:`OpenThread architectures page`. +For more information about the multiprotocol feature, see :ref:`ug_multiprotocol_support`. + +To start developing, check out the :ref:`openthread_samples`. + +Near Field Communication +======================== + +Near Field Communication (NFC) is a technology for wireless transfer of small amounts of data between two devices that are in close proximity. +The range of NFC is typically less than 10 cm. + +Refer to the :ref:`ug_nfc` page for general information. +See the :ref:`nfc_samples` and :ref:`lib_nfc` for the samples and libraries that the |NCS| provides. + +MCUboot bootloader support +************************** + +The nRF54L15 PDK supports MCUboot as its bootloader, in the experimental phase. +This means the following: + + * Only software cryptography is supported. + * Single image pair is supported for dual-bank Device Firmware Update (DFU) targeted at the CPU application (the ``nrf54l15pdk_nrf54l51_cpuapp`` build target). + * MCUboot can be configured as a first-stage bootloader (second-stage bootloader functionality is not yet available). + * Serial recovery mode is also not yet supported. + +Supported DFU protocols +======================= + +The DFU process in the nRF54L15 PDK uses the MCUmgr protocol. +It can be used for performing updates over Bluetooth® Low Energy (LE) and serial connections. + +Testing the DFU solution +======================== + +You can evaluate the DFU functionality by running the :zephyr:code-sample:`smp-svr` sample for the ``nrf54l15pdk_nrf54l51_cpuapp`` build target, which is available for both Bluetooth LE and serial channels. +This allows you to build and test the DFU solutions that are facilitated through integration with child images and the partition manager. + +To compile the SMP server sample for testing secondary image slots on external SPI NOR flash, run the following command: + +.. code-block:: console + + west build -b nrf54l15pdk_nrf54l15_cpuapp -d build/smp_svr_54l_3 zephyr/samples/subsys/mgmt/mcumgr/smp_svr -T sample.mcumgr.smp_svr.bt.nrf54l15pdk.ext_flash + +.. note:: + + Make sure to use the correct build target depending on your PDK version: + + * For the PDK revision v0.2.1, AB0-ES7, use the ``nrf54l15pdk_nrf54l15_cpuapp`` build target. + * For the PDK revisions v0.3.0 and v0.7.0, use the ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` build target. + +This configuration sets up the secondary image slot on the serial flash memory installed on the nRF54L15 PDK. +It also enables the relevant SPI and the SPI NOR flash drivers. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15.jpg b/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15.jpg deleted file mode 100644 index 36b4401764bc..000000000000 Binary files a/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15.jpg and /dev/null differ diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15_multi.jpg b/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15_multi.jpg deleted file mode 100644 index 8f38a0936eae..000000000000 Binary files a/doc/nrf/device_guides/working_with_nrf/nrf54l/images/thread_platform_design_nrf54l15_multi.jpg and /dev/null differ diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_gs.rst index ba5cdbbd7381..bd11fef45d3e 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_gs.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_gs.rst @@ -1,5 +1,3 @@ -:orphan: - .. _ug_nrf54l15_gs: Getting started with the nRF54L15 PDK @@ -10,8 +8,9 @@ Getting started with the nRF54L15 PDK :depth: 2 This page will get you started with your nRF54L15 PDK using the |NCS|. -First, you will test if your PDK is working correctly by running the preflashed :zephyr:code-sample:`blinky` sample. -Once successfully completed, the instructions will guide you through how to configure, build, and program the :ref:`Hello World ` sample to the development kit, and how to read its logs. +First, you need to install the required software and prepare the environment. +Once completed, test if your PDK is working correctly by running the preflashed :zephyr:code-sample:`blinky` sample. +The instructions will then guide you through how to configure, build, and program the :ref:`Hello World ` sample to the development kit, and how to read its logs. .. _ug_nrf54l15_gs_requirements: @@ -24,6 +23,14 @@ Hardware ======== * nRF54L15 PDK + + .. note:: + + For commands, use the correct build target depending on your PDK version: + + * For the PDK revision v0.2.1, AB0-ES7 (Engineering A), use the ``nrf54l15pdk/nrf54l15/cpuapp`` build target. + * For the PDK revisions v0.3.0 and v0.7.0 (Engineering A), use the ``nrf54l15pdk@0.3.0/nrf54l15/cpuapp`` build target. + * USB-C cable Software @@ -36,361 +43,81 @@ On your computer, one of the following operating systems: * Ubuntu Linux |supported OS| - +Make sure to install the v2.6.0 of :ref:`the nRF Connect SDK and the nRF Connect SDK toolchain `. You also need to install `Git`_ or `Git for Windows`_ (on Linux and Mac, or Windows, respectively). +Downloading the code +******************** + +Once you have installed the software, you need to update the code separately to be able to work with the nRF54L15 PDK. + +Go to the :file:`ncs/v2.6.0/nrf` folder and run the following commands: + +.. parsed-literal:: + :class: highlight + + git fetch + git checkout 2.6.99-cs1 + west update + .. _ug_nrf54l15_gs_test_sample: Testing with the Blinky sample ****************************** -In the limited sampling release, the nRF54L15 PDK comes preprogrammed with the Blinky sample. +The nRF54L15 PDK comes preprogrammed with the Blinky sample. -Complete the following steps to test if the PDK works correctly: +Test if the PDK works correctly: 1. Connect the USB-C end of the USB-C cable to the **IMCU USB** port the nRF54L15 PDK. #. Connect the other end of the USB-C cable to your PC. #. Move the **POWER** switch to **On** to turn the nRF54L15 PDK on. -**LED2** will turn on and start to blink. +**LED1** will turn on and start to blink. If something does not work as expected, contact Nordic Semiconductor support. -.. _nrf54l15_gs_installing_software: - -Installing the required software -******************************** - -To start working with the nRF54L15 PDK, you need to install the limited sampling version of the |NCS|. -See the following instructions to install the required tools. - -.. _nrf54l15_install_commandline: - -Installing the nRF Command Line Tools -===================================== - -You need the nRF Command Line Tools specific to the limited sampling release of the |NCS|. - -To install the nRF Command Line Tools, you need to download and install the version corresponding to your system: - -* `10.22.3_cs3 64-bit Windows, executable`_ -* `10.22.3_cs3 macOS, zip archive`_ -* 64-bit Linux: - - * `10.22.3_cs3 x86 system, deb format`_ - * `10.22.3_cs3 x86 system, RPM`_ - * `10.22.3_cs3 x86 system, tar archive`_ - - * `10.22.3_cs3 ARM64 system, deb format`_ - * `10.22.3_cs3 ARM64 system, RPM`_ - * `10.22.3_cs3 ARM64 system, tar archive`_ - -* 32-bit Linux: - - * `10.22.3_cs3 ARMHF system, zip archive`_ - -Installing the toolchain -======================== - -You can install the toolchain for the limited sampling of the |NCS| by running an installation script. -Before installing it, however, you need to have been granted an access to the necessary GitHub repositories using an authenticated account that does not have a passphrase key for credentials. -The access is granted as part of the onboarding process for the limited sampling release. -Ensure that you additionally have Git and curl installed. - -.. tabs:: - - .. tab:: Windows - - Follow these steps: - - 1. Create on GitHub your `Personal Access Token (PAT)`_. - #. Open git bash. - #. Download and run the :file:`bootstrap-toolchain.sh` installation script file using the following command: - - .. parsed-literal:: - :class: highlight - - curl --proto '=https' --tlsv1.2 -sSf https://developer.nordicsemi.com/.pc-tools/scripts/bootstrap-toolchain.sh | NCS_TOOLCHAIN_VERSION=v2.4.99-cs3 sh - - Depending on your connection, this might take some time. - Use your GitHub username and Personal Access Token (PAT) when prompted to. - #. Run the following command in Git Bash: - - .. parsed-literal:: - :class: highlight - - c:/ncs-lcs/nrfutil.exe toolchain-manager launch --terminal --chdir "c:/ncs-lcs/work-dir" --ncs-version v2.4.99-cs3 - - This opens a new terminal window with the |NCS| toolchain environment, where west and other development tools are available. - Alternatively, you can run the following command:: - - c:/ncs-lcs/nrfutil.exe toolchain-manager env --as-script - - This gives all the necessary environmental variables you need to copy-paste and execute in the same terminal window to be able to run west directly there. - - .. caution:: - When working with the limited sampling release, you must always use the terminal window where the west environmental variables have been called. - - #. Install the `Serial Terminal from nRF Connect for Desktop`_. - - If you run into errors during the installation process, delete the :file:`.west` folder inside the :file:`C:\\ncs-lcs` directory, and start over. - - We recommend adding the nrfutil path to your environmental variables. - - - .. tab:: Linux - - Follow these steps: - - 1. Create on GitHub your `Personal Access Token (PAT)`_. - #. Open a terminal window. - #. Download and run the :file:`bootstrap-toolchain.sh` installation script file using the following command: - - .. parsed-literal:: - :class: highlight - - curl --proto '=https' --tlsv1.2 -sSf https://developer.nordicsemi.com/.pc-tools/scripts/bootstrap-toolchain.sh | NCS_TOOLCHAIN_VERSION=v2.4.99-cs3 sh - - Depending on your connection, this might take some time. - Use your GitHub username and Personal Access Token (PAT) when prompted to. - #. Run the following command in your terminal: - - .. parsed-literal:: - :class: highlight - - $HOME/ncs-lcs/nrfutil toolchain-manager launch --shell --chdir "$HOME/ncs-lcs/work-dir" --ncs-version v2.4.99-cs3 - - This makes west and other development tools in the |NCS| toolchain environment available in the same shell session. - - .. caution:: - When working with west in the limited sampling release version of |NCS|, you must always use this shell window. - - #. Install the `Serial Terminal from nRF Connect for Desktop`_. - - If you run into errors during the installation process, delete the :file:`.west` folder inside the :file:`ncs-lcs` directory, and start over. - - We recommend adding the nrfutil path to your environmental variables. - - .. tab:: macOS - - Follow these steps: - - 1. Create on GitHub your `Personal Access Token (PAT)`_. - #. Open a terminal window. - #. Install `Homebrew`_: - - .. code-block:: bash - - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - #. Use ``brew`` to install the required dependencies: - - .. code-block:: bash - - brew install cmake ninja gperf python3 ccache qemu dtc wget libmagic - - Ensure that these dependencies are installed with their versions as specified in the :ref:`Required tools table `. - To check the installed versions, run the following command: - - .. parsed-literal:: - :class: highlight - - brew list --versions - - #. Download and run the :file:`bootstrap-toolchain.sh` installation script file using the following command: - - .. parsed-literal:: - :class: highlight - - curl --proto '=https' --tlsv1.2 -sSf https://developer.nordicsemi.com/.pc-tools/scripts/bootstrap-toolchain.sh | NCS_TOOLCHAIN_VERSION=v2.4.99-cs3 sh - - Depending on your connection, this might take some time. - Use your GitHub username and Personal Access Token (PAT) when prompted to. +.. _ug_nrf54l15_gs_installing_software: - .. note:: - On macOS, the install directory is :file:`/opt/nordic/ncs`. - This means that creating the directory requires root access. - You will be prompted to grant the script admin rights for the creation of the folder on the first install. - The folder will be created with the necessary access rights to the user, so subsequent installs do not require root access. - - Do not run the toolchain-manager installation as root (for example, using `sudo`), as this would cause the directory to only grant access to root, meaning subsequent installations will also require root access. - If you run the script as root, to fix permissions delete the installation folder and run the script again as a non-root user. - - #. Run the following command in your terminal: - - .. parsed-literal:: - :class: highlight - - /Users/*yourusername*/ncs-lcs/nrfutil toolchain-manager launch --shell --chdir "/Users/*yourusername*/ncs-lcs/work-dir" --ncs-version v2.4.99-cs3 - - This makes west and other development tools in the |NCS| toolchain environment available in the same shell session. - - .. caution:: - When working with west in the limited sampling release version of |NCS|, you must always use this shell window. - - #. Run the following commands in your terminal to install the correct lxml dependency: - - .. parsed-literal:: - :class: highlight - - pip uninstall -y lxml - pip install lxml - - #. Install the `Serial Terminal from nRF Connect for Desktop`_. - - If you run into errors during the installation process, delete the :file:`.west` folder inside the :file:`ncs-lcs` directory, and start over. - - We recommend adding the nrfutil path to your environmental variables. - -.. _nrf5l15_install_ncs: - -Installing the |NCS| -==================== - -After you have installed nRF Command Line Tools and the toolchain, you need to install the |NCS|: - -1. In the terminal window opened during the toolchain installation, initialize west with the revision of the |NCS| from the limited sampling by running the following command: - - .. parsed-literal:: - :class: highlight - - west init -m https://github.com/nrfconnect/sdk-nrf-next --mr v2.4.99-cs3 - - A window pops up to ask you to select a credential helper. - You can use any of the options. - -#. Set up GitHub authentication: - - ``west update`` requires :ref:`west ` to fetch from private repositories on GitHub. - - There are two ways you can authenticate when accessing private repositories on GitHub: - - * Using SSH authentication, where your git remotes URLs use ``ssh://``. - * Using HTTPS authentication, where your git remotes URLs use ``https://``. - - GitHub has a comprehensive `documentation page on authentication methods`_. - - However, we suggest to choose your authentication method depending on your scenario: - - * If this is the first time you are setting up GitHub access, use HTTPS. - * If you already have a git credentials file, use HTTPS. - * If you already have an SSH key generated and uploaded to GitHub, use SSH. - * If you are still undecided, use HTTPS. - - .. tabs:: - - .. tab:: HTTPS authentication - - The `west manifest file`_ in the |NCS| uses ``https://`` URLs instead of ``ssh://``. - When using HTTPS, you may be prompted to type your GitHub username and password or multiple times. - This can be avoided by creating on GitHub a Personal Access Token (PAT) (needed for two-factor authentication) and using `Git Credential Manager`_ (included in the git installation) to store your credentials in git and handle GitHub authentication. - - 1. Store your credentials (your username and the PAT created before) on disk using the ``store`` command from the git credential helper. - - .. code-block:: shell - - git config --global credential.helper store - - #. Create a :file:`~/.git-credentials` (or :file:`%userprofile%\\.git-credentials` on Windows) and add this line to it:: - - https://:@github.com - - See the `git-credential-store`_ manual page for details. - - If you don't want to store any credentials on the file system, you can store them in memory temporarily using `git-credential-cache`_ instead. - - .. tab:: SSH authentication - - The `west manifest file`_ in the |NCS| uses ``https://`` URLs instead of ``ssh://``. - If you are already using `SSH-based authentication`_, you can reuse your SSH setup by adding the following to your :file:`~/.gitconfig` (or :file:`%userprofile%\\.gitconfig` on Windows): - - .. parsed-literal:: - :class: highlight - - [url "ssh://git@github.com"] - insteadOf = https://github.com - - This will rewrite the URLs on the fly so that Git uses ``ssh://`` for all network operations with GitHub. - - You achieve the same result also using Git Credential Manager: - - .. code-block:: shell - - git config --global credential.helper store - git config --global url."git@github.com:".insteadOf "https://github.com/" - - If your SSH key has no password, fetching should just work. If it does have a - password, you can avoid entering it manually every time using `ssh-agent`_. - - On GitHub, see `Connecting to GitHub with SSH`_ for details on configuration - and key creation. - -#. Enter the following command to clone the project repositories:: - - west update - - Depending on your connection, this might take some time. - -#. Export a :ref:`Zephyr CMake package `. - This allows CMake to automatically load the boilerplate code required for building |NCS| applications:: - - west zephyr-export - -Your directory structure now looks similar to this:: +Additional software +******************** - ncs-lcs/work-dir - |___ .west - |___ bootloader - |___ modules - |___ nrf - |___ nrfxlib - |___ zephyr - |___ ... +You will need a :ref:`terminal emulator ` to program the sample and read the logs. +The recommended emulators are `nRF Connect Serial Terminal`_ or the nRF Terminal (part of the `nRF Connect for Visual Studio Code`_ extension). -This is a simplified structure preview. -There are additional folders, and the structure might change over time. +To make sure the device sees the environment, all the commands related to the |NCS|, building, and flashing need to be run from the nRF Connect terminal. .. _ug_nrf54l15_gs_sample: Programming the Hello World! sample *********************************** -The :ref:`zephyr:hello_world_user` sample is a simple Zephyr sample. -It uses the ``nrf54l15dk_nrf54l15_cpuapp@soc1`` build target. +The :ref:`zephyr:hello_world_user` Zephyr sample uses the ``nrf54l15pdk/nrf54l15/cpuapp`` build target. To build and program the sample to the nRF54L15 PDK, complete the following steps: -1. Connect the nRF54L15 PDK to you computer using the IMCU USB port on the PDK. +1. Connect the nRF54L15 PDK to your computer using the IMCU USB port on the PDK. #. Navigate to the :file:`zephyr/samples/hello_world` folder containing the sample. -#. Build the sample by running the following command:: - - west build -b nrf54l15dk_nrf54l15_cpuapp@soc1 - -#. Program the sample using the standard |NCS| command. - If you have multiple Nordic Semiconductor devices, make sure that only the nRF54L15 PDK you want to program is connected. +#. Build the sample by running the following command: .. code-block:: console - west flash + west build -b nrf54l15pdk/nrf54l15/cpuapp - .. note:: +#. Program the sample by running the standard |NCS| command: - When programming the device, you might get an error similar to the following message:: - - ERROR: The operation attempted is unavailable due to readback protection in - ERROR: your device. Please use --recover to unlock the device. + .. code-block:: console - This error occurs when readback protection is enabled. - To disable the readback protection, you must *recover* your device. + west flash --erase - Enter the following command to recover the core:: + If you have multiple Nordic Semiconductor devices, make sure that only the nRF54L15 PDK is connected. - west flash --recover + .. note:: - The ``--recover`` command erases the flash memory and then writes a small binary into the recovered flash memory. - This binary prevents the readback protection from enabling itself again after a pin reset or power cycle. + When programming the device, you might get an error mentioning the readback protection of the device. + To get around the error, :ref:`program the device ` with the ``--recover`` parameter. -.. _nrf54l15_sample_reading_logs: +.. _ug_nrf54l15_sample_reading_logs: Reading the logs **************** @@ -399,49 +126,22 @@ With the :ref:`zephyr:hello_world_user` sample programmed, the nRF54L15 PDK outp To read the logs from the :ref:`zephyr:hello_world_user` sample programmed to the nRF54L15 PDK, complete the following steps: -1. Connect to the PDK with a terminal emulator (for example, `Serial Terminal from nRF Connect for Desktop`_) using the following settings: - - * Baud rate: 115200 - * 8 data bits - * 1 stop bit - * No parity - * HW flow control: None - +1. Connect to the PDK with a terminal emulator (for example, `nRF Connect Serial Terminal`_) using the :ref:`default serial port connection settings `. #. Press the **Reset** button on the PCB to reset the PDK. -#. Observe the console output (similar to the following): - - .. code-block:: console +#. Observe the console output: - *** Booting Zephyr OS build 06af494ba663 *** - Hello world! nrf54l15dk_nrf54l15_cpuapp@soc1 - -.. note:: - If no output is shown when using nRF Serial Terminal, select a different serial port in the terminal application. - -Install |nRFVSC| -**************** - -To open and compile projects in the |NCS| for the initial limited sampling of the nRF54L15, you can now install and use also the |nRFVSC|. - -.. _installing_vsc: - -|vsc_extension_description| -For installation and migration instructions, see `How to install the extension`_. + .. code-block:: console -.. note:: - After the installation of both Visual Studio Code and the |nRFVSC| extension, you have to manually point Visual Studio Code to the folder where nrfutil is installed. - To do so, manually set the ``nrf-connect.nrfutil.home`` option in the user settings of Visual Studio Code. - Usually, the location is :file:`${env:HOME}/.nrfutil` on macOS and Linux, or :file:`${env:USERPROFILE}/.nrfutil` on Windows. + *** Booting Zephyr OS build 06af494ba663 *** + Hello world! nrf54l15dk/nrf54l15/cpuapp -For other instructions related to the |nRFVSC|, see the `nRF Connect for Visual Studio Code`_ documentation site. + .. note:: + If no output is shown when using the nRF Serial Terminal, select a different serial port in the terminal application. Next steps ********** -You are now all set to use the nRF54L15 PDK. +You have now completed getting started with the nRF54L15 PDK. See the following links for where to go next: -* The `nRF54L15 PDK schematic and PCB 0.2.1`_ PDF document for the nRF54L15 PDK. -* The `nRF54L15 Objective Product Specification 0.5b`_ (OPS) PDF document. -* The `nRF54L15 prototype difference`_ PDF document, listing the major differences between the final and the prototype silicon provided in the initial limited sampling. -* The :ref:`introductory documentation ` for more information on the |NCS| and the development environment. +* :ref:`configuration_and_build` documentation to learn more about the |NCS| development environment. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_matter_thread.rst b/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_matter_thread.rst deleted file mode 100644 index 06b146372e20..000000000000 --- a/doc/nrf/device_guides/working_with_nrf/nrf54l/ug_nrf54l15_matter_thread.rst +++ /dev/null @@ -1,158 +0,0 @@ -:orphan: - -.. _ug_nrf54l15_matter_thread: - -Working with nRF54L15 and Matter and Thread -########################################### - -.. contents:: - :local: - :depth: 2 - -Starting with the ``v2.4.99-cs3`` limited customer sampling tag, the nRF54L15 PDK supports the following Matter and Thread samples: - -* :ref:`Matter template sample ` -* :ref:`Matter light bulb sample ` -* :ref:`Matter light switch sample ` -* :ref:`Matter window covering sample ` -* :ref:`Thread CLI sample ` -* :ref:`Thread coprocessor sample ` - -The Matter support is currently limited to Matter over Thread, and support for both Matter and Thread is currently :ref:`experimental `. -Read the following sections for more information about support in the nRF54L15 PDK and the platform design for the nRF54L15 SoC. - -For more information about Matter and Thread in the |NCS|, read the documentation in the :ref:`ug_matter` and :ref:`ug_thread` protocol sections. - -Platform designs for the nRF54L15 SoC -************************************* - -Matter in the |NCS| supports the *System-on-Chip, multiprotocol* platform design for the nRF54L15 SoC using Matter over Thread. -You can read more about other available platform designs for Matter on the :ref:`Matter platform design page`. - -Thread in the |NCS| supports the *System-on-Chip, single protocol* and *System-on-Chip, multiprotocol* platform designs for the nRF54L15 SoC. -You can read more about other available platform designs for Thread on the :ref:`OpenThread architectures page`. - -For more information about the multiprotocol feature, see :ref:`ug_multiprotocol_support`. - -System-on-Chip, single protocol -=============================== - -In this design, the OpenThread stack runs on single core of a single nRF54L15 SoC. - -This platform designs is suitable for the following development kit: - -.. TO DO: /includes/sample_board_rows.txt for nrf54l15dk_nrf54l15_cpuapp@soc1 to be added - -In this design the Application Core runs the OpenThread stack and the component that is related to the 802.15.4 IEEE Radio Driver. - - .. note:: - The PSA crypto API level 3 for storing security components is not yet implemented. - -The following figure demonstrates the architecture. - -.. _nrf54l15_platform_single_figure: - -.. figure:: images/thread_platform_design_nrf54l15.jpg - :alt: Multiprotocol Thread and Bluetooth LE architecture (nRF54L15) - - Single protocol Thread architecture on the nRF54L15 SoC - -System-on-Chip, multiprotocol -============================= - -In this design, the OpenThread stack and the Bluetooth® Low Energy (LE) stack run on single core of a single nRF54L15 SoC. - -This platform design is suitable for the following development kit: - -.. TO DO: /includes/sample_board_rows.txt for nrf54l15dk_nrf54l15_cpuapp@soc1 to be added - -In this design the Application Core runs the OpenThread stack, the component of the OpenThread stack that is related to the 802.15.4 IEEE Radio Driver, and a part of the Bluetooth LE Controller. -Device Firmware Update component (DFU) is available only in the Matter solution. - - .. note:: - The PSA crypto API level 3 for storing security components is not yet implemented. - -The following figure demonstrates the architecture. - -.. _nrf54l15_platform_multi_figure: - -.. figure:: images/thread_platform_design_nrf54l15_multi.jpg - :alt: Multiprotocol Thread and Bluetooth LE architecture (nRF54L15) - - Multiprotocol Thread and Bluetooth LE architecture on the nRF54L15 SoC - -Matter over Thread -================== - -In this design, the Matter stack, the OpenThread stack, and the Bluetooth LE stack run on single core of a single nRF54L15 SoC. - -This platform design is suitable for the following development kit: - -.. TO DO: /includes/sample_board_rows.txt for nrf54l15dk_nrf54l15_cpuapp@soc1 to be added - -In this design: - -* The Application Core runs the Matter stack, the OpenThread stack, the component of the OpenThread stack that is related to the 802.15.4 IEEE Radio Driver and a part of the Bluetooth LE Controller. - - .. note:: - The PSA crypto API level 3 for storing security components is not yet implemented on the Secure Domain. - -Refer to the :ref:`nrf54l15_platform_multi_figure` figure to see the architecture of the SoC. -The Global Domain is not included. - -Additional requirements on the nRF54L15 PDK -******************************************* - -In addition to the standard requirements for the |NCS|, such as the :ref:`ug_matter_gs_tools_gn` for Matter, you need the following to run Matter-enabled or Thread-enabled applications on the nRF54L15 PDK: - -* For DFU - J-Link and a USB cable. -* The compatible version of the nrfjprog tool, included in the :ref:`nRF Command Line Tools version specific to the limited customer sampling`. - -Configuring Matter and Thread on the nRF54L15 PDK -************************************************* - -Currently, only the configuration for Matter over Thread is supported for Matter. -Follow the configuration steps on the :ref:`ug_matter_gs_testing` page to configure the Matter environment for the supported Matter samples. - -Currently, only the :ref:`ot_cli_sample` sample is supported for Thread. -See the sample documentation for how to configure it. - -The Matter and Thread samples included in the limited customer sampling can work on the corresponding networks with standard devices of the same protocol. - -Programming Matter and Thread samples on the nRF54L15 PDK -========================================================= - -To program the compatible Matter or Thread samples on the nRF54L15 PDK, follow the :ref:`ug_nRF54l15_gs_sample` steps. -Read also programming guides prepared for specific Matter samples: - - * :ref:`Matter template sample ` - * :ref:`Matter light bulb sample ` - * :ref:`Matter light switch sample ` - * :ref:`Matter window covering sample ` - -Logging for Matter and Thread samples on the nRF54L15 PDK -========================================================= - -To read logs for Matter samples on the nRF54L15 PDK, complete the following steps: - -1. Connect to the nRF54L15 PDK using a USB cable. -#. Select the first available port to read the logs from. - -To read more about the logging see the :ref:`nrf54l15_sample_reading_logs` section. - -.. _ug_nRF54l15_matter_thread_limitations: - -Limitations for Matter and Thread on the nRF54L15 PDK -***************************************************** - -Matter and Thread support has the following limitations on the nRF54L15 PDK: - -* Button 4 does not work on nRF54L15 PDK. - Bluetooth LE advertising for Matter commissioning starts automatically after the reboot. -* PWM driver module is not implemented and LED dimming does not work. - All PWM functions are replaced by constant LED states (:ref:`Matter window covering sample ` and :ref:`Matter light bulb sample `). -* Matter samples requires the nRF54L15 PDK to be at least revision ES3. - NRF54L15 PDK in revision ES2, which has been delivered within the v2.4.99-cs2 release, does not work with Matter samples. -* DFU over Bluetooth LE, Matter, or Serial Link is not yet implemented. -* The current implementation is not power-optimized. -* The PSA crypto API level 3 for storing security components is not yet implemented on the Secure Domain. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/developing/fw_patches_ext_flash.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/developing/fw_patches_ext_flash.rst index 44f5321f4e9e..9e782cc21737 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/developing/fw_patches_ext_flash.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf70/developing/fw_patches_ext_flash.rst @@ -135,14 +135,14 @@ With west .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -S nrf70-fw-patch-ext-flash samples/wifi/shell -- -DSHIELD=nrf7002ek + west build -p -b nrf5340dk/nrf5340/cpuapp -S nrf70-fw-patch-ext-flash samples/wifi/shell -- -DSHIELD=nrf7002ek With CMake ^^^^^^^^^^ .. code-block:: console - cmake -GNinja -Bbuild -DBOARD=nrf5340dk_nrf5340_cpuapp -DSHIELD=nrf7002ek -DSNIPPET=nrf70-fw-patch-ext-flash samples/wifi/shell + cmake -GNinja -Bbuild -DBOARD=nrf5340dk/nrf5340/cpuapp -DSHIELD=nrf7002ek -DSNIPPET=nrf70-fw-patch-ext-flash samples/wifi/shell ninja -C build For example, to build the :ref:`wifi_shell_sample` sample for the nRF5340 DK with the :kconfig:option:`CONFIG_PARTITION_MANAGER_ENABLED` option enabled, run the following commands: @@ -152,14 +152,14 @@ With west .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp samples/wifi/shell -- -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y + west build -p -b nrf5340dk/nrf5340/cpuapp samples/wifi/shell -- -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y With CMake ^^^^^^^^^^ .. code-block:: console - cmake -GNinja -Bbuild -DBOARD=nrf5340dk_nrf5340_cpuapp -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y samples/wifi/shell + cmake -GNinja -Bbuild -DBOARD=nrf5340dk/nrf5340/cpuapp -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y samples/wifi/shell ninja -C build Programming diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/developing/nrf70_fw_patch_update.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/developing/nrf70_fw_patch_update.rst index 67d417b9a5c2..8637522ec562 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/developing/nrf70_fw_patch_update.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf70/developing/nrf70_fw_patch_update.rst @@ -181,13 +181,13 @@ For example, to build the sample with the DFU procedure for the nRF70 Series fir .. code-block:: console - west build -d nrf5340dk_nrf5340_cpuapp -d -- -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -DCONFIG_NRF_WIFI_FW_PATCH_DFU=y -DCONFIG_UPDATEABLE_IMAGE_NUMBER=3 -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 + west build -d nrf5340dk/nrf5340/cpuapp -d -- -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -DCONFIG_NRF_WIFI_FW_PATCH_DFU=y -DCONFIG_UPDATEABLE_IMAGE_NUMBER=3 -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 .. group-tab:: CMake .. code-block:: console - cmake -GNinja -Bbuild -DBOARD=nrf5340dk_nrf5340_cpuapp -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -DCONFIG_NRF_WIFI_FW_PATCH_DFU=y -DCONFIG_UPDATEABLE_IMAGE_NUMBER=3 -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 sample + cmake -GNinja -Bbuild -DBOARD=nrf5340dk/nrf5340/cpuapp -DSHIELD=nrf7002ek -DCONFIG_PARTITION_MANAGER_ENABLED=y -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -DCONFIG_NRF_WIFI_FW_PATCH_DFU=y -DCONFIG_UPDATEABLE_IMAGE_NUMBER=3 -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 sample ninja -C build .. group-tab:: nRF Connect for VS Code diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst deleted file mode 100644 index 6f51174a496c..000000000000 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/gs.rst +++ /dev/null @@ -1,348 +0,0 @@ -.. _nrf7002dk_nrf5340: -.. _ug_nrf7002_gs: - -Getting started with nRF7002 DK -############################### - -.. contents:: - :local: - :depth: 4 - -This page gets you started with your nRF7002 :term:`Development Kit (DK)` using the |NCS|. -It tells you how to install the :ref:`wifi_scan_sample` sample and perform a quick test of your DK. - -If you have already set up your nRF7002 DK and want to learn more, see the following documentation: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_nrf70_developing` documentation for more advanced topics related to the nRF70 Series. -* :ref:`ug_wifi` documentation for information related to Wi-Fi protocol and Wi-Fi modes of operation. - -If you want to go through an online training course to familiarize yourself with Wi-Fi® and the development of Wi-Fi applications, enroll in the `Wi-Fi Fundamentals course`_ in the `Nordic Developer Academy`_. - -Overview -******** - -The nRF7002 DK (PCA10143) is a single-board development kit for evaluation and development on the nRF7002, a Wi-Fi companion :term:`Integrated Circuit (IC)` to Nordic Semiconductor's nRF5340 System-on-Chip (SoC) host processor. - -The nRF7002 is an IEEE 802.11ax (Wi-Fi 6) compliant solution that implements the Wi-Fi physical layer and Medium Access Control (MAC) layer protocols. -It implements the nRF Wi-Fi driver software on the nRF5340 host processor communicating over the QSPI bus. - -The nRF5340 host is a dual-core SoC based on the Arm® Cortex®-M33 architecture. -It has the following features: - -* A full-featured Arm Cortex-M33F core with DSP instructions, FPU, and Armv8-M Security Extension, running at up to 128 MHz, referred to as the *application core*. -* A secondary Arm Cortex-M33 core, with a reduced feature set, running at a fixed 64 MHz, referred to as the *network core*. - -The ``nrf7002dk_nrf5340_cpuapp`` build target provides support for the application core on the nRF5340 SoC. -The ``nrf7002dk_nrf5340_cpunet`` build target provides support for the network core on the nRF5340 SoC. - -.. figure:: images/nRF70dk.png - :alt: nRF7002 DK - - nRF7002 DK - -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 -======== - -* nRF7002 DK: - The nRF7002 DK has two external oscillators. - - * The frequency of the slow clock is 32.768 kHz. - * The frequency of the main clock is 32 MHz. - -* Micro-USB 2.0 cable - -Supported features ------------------- - -The ``nrf7002dk_nrf5340_cpuapp`` board configuration supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| ADC | on-chip | adc | -+-----------+------------+----------------------+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| PWM | on-chip | pwm | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| RADIO | nrf7002 | Wi-Fi 6 (802.11ax) | -+-----------+------------+----------------------+ -| QSPI | on-chip | qspi | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| SPU | on-chip | system protection | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| USB | on-chip | usb | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -The ``nrf7002dk_nrf5340_cpunet`` board configuration supports the following hardware features: - -+-----------+------------+----------------------+ -| Interface | Controller | Driver/Component | -+===========+============+======================+ -| CLOCK | on-chip | clock_control | -+-----------+------------+----------------------+ -| FLASH | on-chip | flash | -+-----------+------------+----------------------+ -| GPIO | on-chip | gpio | -+-----------+------------+----------------------+ -| I2C(M) | on-chip | i2c | -+-----------+------------+----------------------+ -| MPU | on-chip | arch/arm | -+-----------+------------+----------------------+ -| NVIC | on-chip | arch/arm | -+-----------+------------+----------------------+ -| RADIO | on-chip | Bluetooth, | -| | | ieee802154 | -+-----------+------------+----------------------+ -| RTC | on-chip | system clock | -+-----------+------------+----------------------+ -| RTT | Segger | console | -+-----------+------------+----------------------+ -| QSPI | on-chip | qspi | -+-----------+------------+----------------------+ -| SPI(M/S) | on-chip | spi | -+-----------+------------+----------------------+ -| UARTE | on-chip | serial | -+-----------+------------+----------------------+ -| WDT | on-chip | watchdog | -+-----------+------------+----------------------+ - -Other hardware features are not supported by the |NCS| kernel. - -Connections and IOs -------------------- - -The connections and IOs supported by the development kit are listed in this section. - -LED -^^^ - -* LED1 (green) = P1.06 -* LED2 (green) = P1.07 - -Push buttons -^^^^^^^^^^^^ - -* BUTTON1 = SW1 = P1.08 -* BUTTON2 = SW2 = P1.09 -* BOOT = SW5 = boot/reset - -Wi-Fi control -^^^^^^^^^^^^^ - -* BUCKEN = P0.12 -* IOVDD CONTROL = P0.31 -* HOST IRQ = P0.23 -* COEX_REQ = P0.28 -* COEX_STATUS0 = P0.30 -* COEX_STATUS1 = P0.29 -* COEX_GRANT = P0.24 - -Security components -------------------- - -The following security components are available: - -* Implementation Defined Attribution Unit (`IDAU`_) on the application core. - - The IDAU is implemented with the System Protection Unit and is used to define secure and non-secure memory maps. - By default, the entire memory space (Flash, SRAM, and peripheral address space) is defined to be secure-accessible only. - -* Secure boot. - -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 - -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:`nrf70_gs_connecting`. - -On your mobile device, install the `nRF Connect for Mobile`_ application from the corresponding application store. - -.. _nrf70_gs_installing_sample: - - -Programming the sample -********************** - -You must program and run a precompiled version of the :ref:`wifi_scan_sample` sample on your development kit to test the functions. -Download the precompiled version of the sample from the nRF7002 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. - -To program the precompiled sample to your development kit, complete the following steps: - -1. Open the Programmer app. -#. Connect the nRF7002 DK to the computer with a micro-USB cable and turn on the DK. - - **LED5** starts blinking. - -#. Click **SELECT DEVICE** and select the DK from the drop-down list. - - .. figure:: ../nrf70/images/nRF7002_programmer_select_device.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. - -After you have programmed the sample to the DK, you can connect to it and test the functions. - -.. _nrf70_gs_connecting: - -Connecting to the sample -************************ - -You can connect to the sample on the nRF7002 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. - -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. - -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. - -Once the connection has been established, you can test the sample. - -.. _nrf70_gs_testing: - -Testing the sample -****************** - -You can test the :ref:`wifi_scan_sample` sample on your DK. -The test requires that you have :ref:`connected to the sample ` and have the connected terminal emulator open. - -After successful programming of the sample onto the nRF7002 DK, scan results output will be shown in the terminal emulator connected to the sample through CDC-UART. - -.. figure:: ../nrf70/images/nRF7002_scan_sample_output.png - :alt: Scan sample output - - Scan sample output - -Building and debugging -********************** - -The nRF5340 application core supports the Armv8-M Security Extension. -Applications built for the ``nrf7002dk_nrf5340_cpuapp`` board boot by default in the secure state. - -The nRF5340 network core does not support the Armv8-M Security Extension. -nRF5340 IDAU can configure bus accesses by the nRF5340 network core to have the secure attribute set. -This allows to build and run secure-only applications on the nRF5340 SoC. - -Building |NCS| applications with Arm TrustZone -============================================== - -Applications on nRF5340 can use Cortex-M Security Extensions (CMSE) and separate firmware for the application core between Secure Processing Environment (SPE) and Non-Secure Processing Environment (NSPE). -You can build SPE using either |NCS| or `Trusted Firmware M`_ (TF-M). -You must always build NSPE using |NCS|. - -For information about Cortex-M Security Extensions (CMSE) and the difference between the two environments, see :ref:`app_boards_spe_nspe`. - -.. note:: - By default, SPE for the nRF5340 application core is built using TF-M. - -Building the firmware with TF-M -------------------------------- - -If you want to use |NCS| to build the firmware image separated in SPE with TF-M and NSPE, complete the following steps: - -1. Build the |NCS| application for the application core using the ``nrf7002dk_nrf5340_cpuapp_ns`` build target. - - To invoke the building of TF-M, the |NCS| build system requires the Kconfig option :kconfig:option:`CONFIG_BUILD_WITH_TFM` to be enabled, which is set by default when building |NCS| as an application that supports both NSPE and SPE. - - The |NCS| build system performs the following steps automatically: - - a. Build the NSPE firmware image as a regular |NCS| application. - #. Build an SPE firmware image (with TF-M). - #. Merge the output image binaries. - #. Optionally, build a bootloader image (MCUboot). - - .. note:: - Depending on the TF-M configuration, an application DTS overlay can be required to adjust the NSPE image flash memory partition and SRAM starting address and sizes. - -#. Build the application firmware for the network core using the ``nrf7002dk_nrf5340_cpunet`` build target. - -Building application without CMSE -================================= - -Build the |NCS| application as described in :ref:`building`, using the ``nrf7002dk_nrf5340_cpuapp`` build target for the firmware running on the nRF5340 application core and the ``nrf7002dk_nrf5340_cpunet`` build target for the firmware running on the nRF5340 network core. - -Programming the firmware to the DK -================================== - -Follow the instructions in the :ref:`building` page to build and the :ref:`programming` page to program applications. - -.. note:: - To flash and debug applications on the nRF7002 DK, you must use the `nRF Command Line Tools`_ version 10.12.0 or above. - -Debugging -========= - -See the :ref:`testing` page for information about debugging. - -Next steps -********** - -You have now completed getting started with the nRF7002 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_nrf70_developing` documentation for more advanced topics related to the nRF70 Series. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002eb_gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002eb_gs.rst index fba6aaac5640..15a7ecf19df7 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002eb_gs.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002eb_gs.rst @@ -1,3 +1,5 @@ +:orphan: + .. _ug_nrf7002eb_gs: Getting started with nRF7002 EB diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002ek_gs.rst b/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002ek_gs.rst index 71476075be28..7c7ad7d24ba8 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002ek_gs.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf70/nrf7002ek_gs.rst @@ -1,3 +1,5 @@ +:orphan: + .. _ug_nrf7002ek_gs: Getting started with nRF7002 EK @@ -41,45 +43,54 @@ Pin assignment for Arduino interface connector The Arduino interface of the nRF7002 EK is compatible with the nRF52840 DK, the nRF5340 DK, and an nRF91 Series DK. The interface connectors are described in the following table: -+------------------+-----------------------+----------------------------------+ -| Arduino pin name | nRF7002 Signal | Function | -+==================+=======================+==================================+ -| D0 | IOVDD_EN | Enable power to I/O interface | -+------------------+-----------------------+----------------------------------+ -| D1 | BUCK_EN | Enable power to nRF7002 | -+------------------+-----------------------+----------------------------------+ -| D2 | COEX_STATUS0 | Coexistence status 0 | -+------------------+-----------------------+----------------------------------+ -| D3 | COEX_REQ | Coexistence request from host | -+------------------+-----------------------+----------------------------------+ -| D4 | COEX_GRANT | Coexistence grant to host | -+------------------+-----------------------+----------------------------------+ -| D5 | SW_CTRL0 | Switch control 0 | -+------------------+-----------------------+----------------------------------+ -| D6 | COEX_STATUS1 | Coexistence status 1 | -+------------------+-----------------------+----------------------------------+ -| D7 | HOST_IRQ | Interrupt request to host | -+------------------+-----------------------+----------------------------------+ -| D8 | DATA2 | QSPI data line 2 | -+------------------+-----------------------+----------------------------------+ -| D9 | DATA3 | QSPI data line 3 | -+------------------+-----------------------+----------------------------------+ -| D10 | SS | Slave select | -+------------------+-----------------------+----------------------------------+ -| D11 | MISO/DATA1 | QSPI/SPI Data line 1/ Slave Out | -+------------------+-----------------------+----------------------------------+ -| D12 | MOSI/DATA0 | QSPI/SPI Data line 0/ Slave In | -+------------------+-----------------------+----------------------------------+ -| D13 | CLK | QSPI/SPI Clock | -+------------------+-----------------------+----------------------------------+ -| GND | GND | Ground | -+------------------+-----------------------+----------------------------------+ -| AREF | N.C. | Not used | -+------------------+-----------------------+----------------------------------+ -| SDA | N.C. | Not used | -+------------------+-----------------------+----------------------------------+ -| SCL | N.C. | Not used | -+------------------+-----------------------+----------------------------------+ ++----------------------+-----------------------+----------------------------------+ +| Arduino pin name | nRF7002 Signal | Function | ++======================+=======================+==================================+ +| **D0** | IOVDD_EN | Enable power to I/O interface | ++----------------------+-----------------------+----------------------------------+ +| **D1** | BUCK_EN | Enable power to nRF7002 | ++----------------------+-----------------------+----------------------------------+ +| **D2** | COEX_STATUS0 | Coexistence status 0 | ++----------------------+-----------------------+----------------------------------+ +| **D3** | COEX_REQ | Coexistence request from host | ++----------------------+-----------------------+----------------------------------+ +| **D4** | COEX_GRANT | Coexistence grant to host | ++----------------------+-----------------------+----------------------------------+ +| **D5** | SW_CTRL0 | Switch control 0 | ++----------------------+-----------------------+----------------------------------+ +| **D6** | COEX_STATUS1 | Coexistence status 1 | ++----------------------+-----------------------+----------------------------------+ +| **D7** | HOST_IRQ | Interrupt request to host | ++----------------------+-----------------------+----------------------------------+ +| **D8** | DATA2 | QSPI data line 2 | ++----------------------+-----------------------+----------------------------------+ +| **D9** | DATA3 | QSPI data line 3 | ++----------------------+-----------------------+----------------------------------+ +| **D10** | SS | Slave select | ++----------------------+-----------------------+----------------------------------+ +| **D11** | MISO/DATA1 | QSPI/SPI Data line 1/ Slave Out | ++----------------------+-----------------------+----------------------------------+ +| **D12** | MOSI/DATA0 | QSPI/SPI Data line 0/ Slave In | ++----------------------+-----------------------+----------------------------------+ +| **D13** | CLK | QSPI/SPI Clock | ++----------------------+-----------------------+----------------------------------+ +| **GND** | GND | Ground | ++----------------------+-----------------------+----------------------------------+ +| **AREF** | N.C. | Not used | ++----------------------+-----------------------+----------------------------------+ +| **SDA** | N.C. | Not used | ++----------------------+-----------------------+----------------------------------+ +| **SCL** | N.C. | Not used | ++----------------------+-----------------------+----------------------------------+ + +.. note:: + ``UART1`` cannot be used and must be disabled on the nRF9160 DK, as ``UART1`` ``RXD`` and ``TXD`` conflict with pins **P0.00** and **P0.01** (Arduino pins **D0** and **D1**). + These correspond to the IOVDD-CTRL-GPIOS and BUCKEN-GPIOS signals in the nRF7002 EK, respectively. + + For an nRF7002 EK connected to an nRF9160 DK, you can find example overlays at the following paths: + + * :file:`sdk-nrf/boards/shields/nrf7002ek/boards/nrf9160dk_nrf9160_ns.overlay` + * :file:`sdk-nrf/samples/cellular/lwm2m_client/boards/nrf9160dk_with_nrf7002ek.overlay` Minimum requirements ******************** @@ -148,12 +159,12 @@ Alternatively, add the shield in the project's :file:`CMakeLists.txt` file, spec To build with the |nRFVSC|, specify ``-DSHIELD=nrf7002ek`` in the **Extra CMake arguments** field. See :ref:`cmake_options` for instructions on how to provide CMake options. -To build for the nRF7002 EK and the nRF7002 IC with nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the CMake ``SHIELD`` variable set to ``nrf7002ek``. +To build for the nRF7002 EK and the nRF7002 IC with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build target with the CMake ``SHIELD`` variable set to ``nrf7002ek``. For example, you can use the following command when building on the command line: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf7002ek + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek To build for the nRF7002 EK and the nRF7001 or nRF7000 ICs, you can use the corresponding shield name in the above command. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/programmer_select_device1.png b/doc/nrf/device_guides/working_with_nrf/nrf91/images/programmer_select_device1.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/programmer_select_device1.png rename to doc/nrf/device_guides/working_with_nrf/nrf91/images/programmer_select_device1.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160.rst b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160.rst index a027aba83688..56e8d602029d 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160.rst @@ -27,7 +27,7 @@ If you need to restore the original firmware at some point, download the nRF9160 To program the HEX file, use nrfjprog (which is part of the `nRF Command Line Tools`_). If you want to route some pins differently from what is done in the preprogrammed firmware, program the :ref:`zephyr:hello_world` sample instead of the preprogrammed firmware. -Build the sample (located under ``ncs/zephyr/samples/hello_world``) for the nrf9160dk_nrf52840 board. +Build the sample (located under ``ncs/zephyr/samples/hello_world``) for the nrf9160dk/nrf52840 board. To change the routing options, enable or disable the corresponding devicetree nodes for that board as needed. See :ref:`zephyr:nrf9160dk_board_controller_firmware` for detailed information. @@ -58,14 +58,14 @@ Make sure you are logged in to the `nRF Cloud`_ portal. 1. Click :guilabel:`Devices` under :guilabel:`Device Management` in the navigation pane on the left. - .. figure:: images/nrfcloud_devices.png + .. figure:: /gsg_guides/images/nrfcloud_devices.png :alt: nRF Cloud - Devices nRF Cloud - Devices #. Click :guilabel:`Add Devices`. - .. figure:: images/nrfcloud_add_devices.png + .. figure:: /gsg_guides/images/nrfcloud_add_devices.png :alt: nRF Cloud - Add Devices nRF Cloud - Add Devices @@ -74,7 +74,7 @@ Make sure you are logged in to the `nRF Cloud`_ portal. #. Click :guilabel:`LTE Device` in the **Select Device Type** pop-up. - .. figure:: images/nrfcloud_selectdevicetype.png + .. figure:: /gsg_guides/images/nrfcloud_selectdevicetype.png :alt: nRF Cloud - Select Device Type nRF Cloud - Select Device Type @@ -190,8 +190,8 @@ Make sure to select a suitable build target when building your application. In Zephyr, the firmware for the application core of :ref:`zephyr:nrf9160dk_nrf9160` is divided into two different build targets: -* ``nrf9160dk_nrf9160`` for build targets that have Cortex-M Security Extensions (CMSE) disabled. -* ``nrf9160dk_nrf9160_ns`` for build targets that have CMSE enabled and have the Secure Processing Environment (SPE) firmware alongside the Non-Secure Processing Environment (NSPE) firmware. +* ``nrf9160dk/nrf9160`` for build targets that have Cortex-M Security Extensions (CMSE) disabled. +* ``nrf9160dk/nrf9160/ns`` for build targets that have CMSE enabled and have the Secure Processing Environment (SPE) firmware alongside the Non-Secure Processing Environment (NSPE) firmware. For information about CMSE and the difference between the two environments, see :ref:`app_boards_spe_nspe`. @@ -372,7 +372,7 @@ Complete the following steps to build and program using the |nRFVSC|: .. |sample_path_vsc| replace:: :file:`ncs/nrf/applications/asset_tracker_v2` -.. |vsc_sample_board_target_line| replace:: you must use the build target ``nrf9160dk_nrf9160_ns`` when building the application code for the nRF9160 DK +.. |vsc_sample_board_target_line| replace:: you must use the build target ``nrf9160dk/nrf9160/ns`` when building the application code for the nRF9160 DK .. include:: ../../../includes/vsc_build_and_run.txt @@ -402,7 +402,7 @@ Building and programming on the command line .. |cmd_folder_path| replace:: on the nRF9160 DK -.. |cmd_build_target| replace:: ``nrf9160dk_nrf9160_ns`` when building the application code for the nRF9160 DK +.. |cmd_build_target| replace:: ``nrf9160dk/nrf9160/ns`` when building the application code for the nRF9160 DK .. include:: ../../../includes/cmd_build_and_run.txt @@ -466,7 +466,7 @@ To build without these features, specify the board revision when building your a To specify the board revision, append it to the board argument when building. The board revision is printed on the label of your DK, just below the PCA number. -For example, when building a non-secure application for nRF9160 DK v0.9.0, use ``nrf9160dk_nrf9106_ns@0.9.0`` as build target. +For example, when building a non-secure application for nRF9160 DK v0.9.0, use ``nrf9160dk@0.9.0/nrf9160/ns`` as build target. See :ref:`zephyr:application_board_version` and :ref:`zephyr:nrf9160dk_additional_hardware` for more information. @@ -541,7 +541,7 @@ If your application was built using the |NCS|, you must define partitions using The built-in partition definitions can be found in the :file:`nrf/subsys/partition_manager` folder, and the file names start with ``pm.yml``. The files which have ``external_flash`` as their region will have support for storing partitions in the external flash. You can also find the configuration option required to place the partition in the external flash region in those files. -For example, the :file:`pm.yml.pgps` file has an option (:kconfig:option:`CONFIG_PM_PARTITION_REGION_PGPS_EXTERNAL`) to place the PGPS partition in external flash: +For example, the :file:`pm.yml.pgps` file has an option (:kconfig:option:`CONFIG_PM_PARTITION_REGION_PGPS_EXTERNAL`) to place the P-GPS partition in external flash: .. code-block:: c diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9161.rst b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9161.rst index b3fc4b6f8986..8728a682fc45 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9161.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9161.rst @@ -111,8 +111,8 @@ Make sure to select a suitable build target when building your application. In Zephyr, the firmware for the application core of :ref:`zephyr:nrf9161dk_nrf9161` is divided into two different build targets: -* ``nrf9161dk_nrf9161`` for build targets that have Cortex-M Security Extensions (CMSE) disabled. -* ``nrf9161dk_nrf9161_ns`` for build targets that have CMSE enabled and have the Secure Processing Environment (SPE) firmware alongside the Non-Secure Processing Environment (NSPE) firmware. +* ``nrf9161dk/nrf9161`` for build targets that have Cortex-M Security Extensions (CMSE) disabled. +* ``nrf9161dk/nrf9161/ns`` for build targets that have CMSE enabled and have the Secure Processing Environment (SPE) firmware alongside the Non-Secure Processing Environment (NSPE) firmware. For information about CMSE and the difference between the two environments, see :ref:`app_boards_spe_nspe`. @@ -238,7 +238,7 @@ Complete the following steps to build and program using the |nRFVSC|: .. |sample_path_vsc| replace:: :file:`ncs/nrf/applications/asset_tracker_v2` -.. |vsc_sample_board_target_line| replace:: you must use the build target ``nrf9161dk_nrf9161_ns`` when building the application code for the nRF9161 DK +.. |vsc_sample_board_target_line| replace:: you must use the build target ``nrf9161dk/nrf9161/ns`` when building the application code for the nRF9161 DK .. include:: ../../../includes/vsc_build_and_run.txt @@ -266,7 +266,7 @@ Building and programming on the command line .. |cmd_folder_path| replace:: on the nRF9161 DK -.. |cmd_build_target| replace:: ``nrf9161dk_nrf9161_ns`` when building the application code for the nRF9161 DK +.. |cmd_build_target| replace:: ``nrf9161dk/nrf9161/ns`` when building the application code for the nRF9161 DK .. include:: ../../../includes/cmd_build_and_run.txt diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_features.rst b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_features.rst index 2452478c5dfc..1e17344e6aad 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_features.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_features.rst @@ -53,7 +53,7 @@ Application =========== The user application runs in NSPE. -Therefore, it must be built for the ``nrf9161dk_nrf9161_ns``, ``nrf9160dk_nrf9160_ns``, or ``thingy91_nrf9160_ns`` build target. +Therefore, it must be built for the ``nrf9161dk/nrf9161/ns``, ``nrf9160dk/nrf9160/ns``, or ``thingy91/nrf9160/ns`` build target. The application image might require other images to be present. Some samples include the :ref:`bootloader` sample (:kconfig:option:`CONFIG_SECURE_BOOT`) and :doc:`mcuboot:index-ncs` (:kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT`). @@ -70,8 +70,8 @@ The AT commands are documented in the `nRF91x1 AT Commands Reference Guide`_ an The firmware for the modem is available as a precompiled binary. You can download the firmware from the `nRF9161 product website (compatible downloads)`_ or `nRF9160 product website (compatible downloads)`_, depending on the SiP you are using. -The zip file contains the release notes, and both the full firmware and patches to upgrade from one version to another. -A delta patch can only upgrade the modem firmware from one specific version to another version (for example, v1.2.1 to v1.2.2). +The zip file contains the release notes, and both the full firmware and patches to update from one version to another. +A delta patch can only update the modem firmware from one specific version to another version (for example, v1.2.1 to v1.2.2). If you need to perform a major version update (for example, v1.2.x to v1.3.x), you need an external flash with a minimum size of 4 MB. Different versions of the LTE modem firmware are available, and these versions are certified for the mobile network operators having their own certification programs. @@ -85,13 +85,13 @@ See the `Mobile network operator certifications`_ for more information. .. _nrf91_update_modem_fw: .. _nrf9160_update_modem_fw: -Modem firmware upgrade -====================== +Modem firmware update +===================== There are two ways to update the modem firmware: -Full upgrade - You can use either a wired or a wireless connection to do a full upgrade of the modem firmware: +Full update + You can use either a wired or a wireless connection to do a full update of the modem firmware: * When using a wired connection, you can use either the `nRF Connect Programmer`_, which is part of `nRF Connect for Desktop`_, or the `nRF pynrfjprog`_ Python package. Both methods use the Simple Management Protocol (SMP) to provide an interface over UART, which enables the device to perform the update. @@ -102,16 +102,16 @@ Full upgrade * You can also use the nRF pynrfjprog Python package to perform the update, as long as a custom application image integrating the ``lib_fmfu_mgmt`` subsystem is included in the existing firmware of the device. See the :ref:`fmfu_smp_svr_sample` sample for an example on how to integrate the :ref:`subsystem ` in your custom application. - * When using a wireless connection, the upgrade is applied over-the-air (OTA). + * When using a wireless connection, the update is applied over-the-air (OTA). See :ref:`nrf91_fota` for more information. See :ref:`nrfxlib:nrf_modem_bootloader` for more information on the full firmware updates of modem using :ref:`nrfxlib:nrf_modem`. Delta patches - Delta patches are upgrades that contain only the difference from the last version. + Delta patches are updates that contain only the difference from the last version. See :ref:`nrfxlib:nrf_modem_delta_dfu` for more information on delta firmware updates of modem using :ref:`nrfxlib:nrf_modem`. When applying a delta patch, you must therefore ensure that this patch works with the current firmware version on your device. - Delta patches are applied as firmware over-the-air (FOTA) upgrades. + Delta patches are applied as firmware over-the-air (FOTA) updates. See :ref:`nrf91_fota` for more information. .. _nrf91_ug_band_lock: @@ -190,34 +190,34 @@ For more information on the implementation of a custom trace backend, see :ref:` .. _nrf91_fota: .. _nrf9160_fota: -FOTA upgrades -************* +FOTA updates +************ |fota_upgrades_def| -FOTA upgrades can be used to apply delta patches to the :ref:`lte_modem` firmware, full :ref:`lte_modem` firmware upgrades, and to replace the upgradable bootloader or the application. +FOTA updates can be used to apply delta patches to the :ref:`lte_modem` firmware, full :ref:`lte_modem` firmware updates, and to replace the upgradable bootloader or the application. .. note:: - Even though the Trusted Firmware-M and the application are two individually compiled components, they are treated as a single binary blob in the context of firmware upgrades. + Even though the Trusted Firmware-M and the application are two individually compiled components, they are treated as a single binary blob in the context of firmware updates. Any reference to the application in this section is meant to indicate the application including the Trusted Firmware-M. -To perform a FOTA upgrade, complete the following steps: +To perform a FOTA updates, complete the following steps: -1. Make sure that your application supports FOTA upgrades. +1. Make sure that your application supports FOTA updates. - To download and apply FOTA upgrades, your application must use the :ref:`lib_fota_download` library. - This library determines the type of upgrade by inspecting the header of the firmware and invokes the :ref:`lib_dfu_target` library to apply the firmware upgrade. - In its default configuration, the DFU target library is set to support all the types of FOTA upgrades except full modem firmware upgrades, but you can freely enable or disable the support for specific targets. + To download and apply FOTA updates, your application must use the :ref:`lib_fota_download` library. + This library determines the type of update by inspecting the header of the firmware and invokes the :ref:`lib_dfu_target` library to apply the firmware update. + In its default configuration, the DFU target library is set to support all the types of FOTA updates except full modem firmware updates, but you can freely enable or disable the support for specific targets. In addition, the following requirements apply: * To upgrade the application, you must use :doc:`mcuboot:index-ncs` as the upgradable bootloader (:kconfig:option:`CONFIG_BOOTLOADER_MCUBOOT` must be enabled). * If you want to upgrade the upgradable bootloader, you must use the :ref:`bootloader` (:kconfig:option:`CONFIG_SECURE_BOOT must be enabled`). - * If you want to upgrade the modem firmware through modem delta updates, you do not need to use MCUboot or the immutable bootloader, because the modem firmware upgrade is handled by the modem itself. - * If you want to perform a full modem firmware upgrade, an |external_flash_size| is required. + * If you want to update the modem firmware through modem delta updates, you do not need to use MCUboot or the immutable bootloader, because the modem firmware update is handled by the modem itself. + * If you want to perform a full modem firmware update, an |external_flash_size| is required. #. Create a binary file that contains the new image. .. note:: - This step does not apply for upgrades of the modem firmware. + This step does not apply for updates of the modem firmware. You can download delta patches and full binaries of the modem firmware from the `nRF9161 product website (compatible downloads)`_ or `nRF9160 product website (compatible downloads)`_, depending on the SiP you are using. |fota_upgrades_building| @@ -232,10 +232,10 @@ To perform a FOTA upgrade, complete the following steps: The full FOTA procedure depends on where the binary files are hosted for download. -FOTA upgrades using nRF Cloud -============================= +FOTA updates using nRF Cloud +============================ -FOTA upgrades can be managed through a comprehensive management portal on `nRF Cloud`_, either fully hosted on nRF Cloud or accessible from a customer cloud using the `nRF Cloud REST API`_. +FOTA updates can be managed through a comprehensive management portal on `nRF Cloud`_, either fully hosted on nRF Cloud or accessible from a customer cloud using the `nRF Cloud REST API`_. If you are using nRF Cloud, see the `nRF Cloud Getting Started FOTA documentation`_ for instructions. Currently, delta modem firmware FOTA files are available in nRF Cloud under :guilabel:`Firmware Updates` in the :guilabel:`Device Management` tab on the left. @@ -244,10 +244,10 @@ If you intend to obtain FOTA files from nRF Cloud, see the additional requiremen You can upload custom application binaries to nRF Cloud for application FOTA updates. After :ref:`nrf9160_gs_connecting_dk_to_cloud`, you can upload the files to your nRF Cloud account as a bundle after navigating to :guilabel:`Device Management` on the left and clicking :guilabel:`Firmware Updates`. -FOTA upgrades using other cloud services +FOTA updates using other cloud services ======================================== -FOTA upgrades can alternatively be hosted from a customer-developed cloud services such as solutions based on AWS and Azure. +FOTA updates can alternatively be hosted from a customer-developed cloud services such as solutions based on AWS and Azure. If you are uploading the files to an Amazon Web Services Simple Storage Service (AWS S3) bucket, see the :ref:`lib_aws_fota` documentation for instructions. Samples are provided in |NCS| for AWS (:ref:`aws_iot` sample) and Azure (:ref:`azure_iot_hub` sample). diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_snippet.rst b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_snippet.rst index 7d95b06bc514..03a771071256 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_snippet.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf91/nrf91_snippet.rst @@ -25,10 +25,10 @@ To change the partition size, the project needs to configure the :kconfig:option The following build targets have support for this snippet: -* ``nrf9151dk_nrf9151_ns`` -* ``nrf9161dk_nrf9161_ns`` -* ``nrf9160dk_nrf9160_ns`` -* ``nrf9131ek_nrf9131_ns`` +* ``nrf9151dk/nrf9151/ns`` +* ``nrf9161dk/nrf9161/ns`` +* ``nrf9160dk/nrf9160/ns`` +* ``nrf9131ek/nrf9131/ns`` To enable modem traces with the flash backend, use the following command: diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91.rst b/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91.rst index 3fb2846539d6..2a2bc525d36e 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91.rst +++ b/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91.rst @@ -265,7 +265,7 @@ Updating the firmware in the nRF52840 SoC In the Programmer navigation bar, :guilabel:`No devices available` changes to :guilabel:`SELECT DEVICE`. - .. figure:: ../nrf52/images/programmer_select_device1.png + .. figure:: images/programmer_select_device1.png :alt: Programmer - Select device Programmer - SELECT DEVICE @@ -525,17 +525,17 @@ The build targets of interest for Thingy:91 in |NCS| are as follows: +---------------+---------------------------------------------------+ |Component | Build target | +===============+===================================================+ -|nRF9160 SiP |``thingy91_nrf9160_ns`` | +|nRF9160 SiP |``thingy91/nrf9160/ns`` | +---------------+---------------------------------------------------+ -|nRF52840 SoC |``thingy91_nrf52840`` | +|nRF52840 SoC |``thingy91/nrf52840`` | +---------------+---------------------------------------------------+ -You must use the build target ``thingy91_nrf9160_ns`` when building the application code for the nRF9160 SiP and the build target ``thingy91_nrf52840`` when building the application code for the onboard nRF52840 SoC. +You must use the build target ``thingy91/nrf9160/ns`` when building the application code for the nRF9160 SiP and the build target ``thingy91/nrf52840`` when building the application code for the onboard nRF52840 SoC. .. note:: * In |NCS| releases before v1.3.0, these build targets were named ``nrf9160_pca20035``, ``nrf9160_pca20035ns``, and ``nrf52840_pca20035``. - * In |NCS| releases ranging from v1.3.0 to v1.6.1, the build target ``thingy91_nrf9160_ns`` was named ``thingy91_nrf9160ns``. + * In |NCS| releases ranging from v1.3.0 to v1.6.1, the build target ``thingy91/nrf9160/ns`` was named ``thingy91_nrf9160ns``. .. note:: @@ -581,7 +581,7 @@ Complete the following steps to build and program using the |nRFVSC|: .. |sample_path_vsc| replace:: :file:`ncs/nrf/applications/asset_tracker_v2` -.. |vsc_sample_board_target_line| replace:: you must use the build target ``thingy91_nrf9160_ns`` when building the application code for the nRF9160 SiP and the build target ``thingy91_nrf52840`` when building the application code for the onboard nRF52840 SoC +.. |vsc_sample_board_target_line| replace:: you must use the build target ``thingy91/nrf9160/ns`` when building the application code for the nRF9160 SiP and the build target ``thingy91/nrf52840`` when building the application code for the onboard nRF52840 SoC .. include:: ../../../includes/vsc_build_and_run.txt @@ -616,7 +616,7 @@ Building and programming on the command line .. |cmd_folder_path| replace:: on the nRF9160 SiP component and ``ncs/nrf/applications/connectivity_bridge`` when building the source code for the :ref:`connectivity_bridge` application on the nRF52840 SoC component -.. |cmd_build_target| replace:: ``thingy91_nrf9160_ns`` if building for the nRF9160 SiP component and ``thingy91_nrf52840`` if building for the nRF52840 SoC component +.. |cmd_build_target| replace:: ``thingy91/nrf9160/ns`` if building for the nRF9160 SiP component and ``thingy91/nrf52840`` if building for the nRF52840 SoC component .. include:: ../../../includes/cmd_build_and_run.txt diff --git a/doc/nrf/device_guides/working_with_pmic/npm1300/features.rst b/doc/nrf/device_guides/working_with_pmic/npm1300/features.rst index 51d7f9e60330..9a5fa52779bd 100644 --- a/doc/nrf/device_guides/working_with_pmic/npm1300/features.rst +++ b/doc/nrf/device_guides/working_with_pmic/npm1300/features.rst @@ -39,28 +39,28 @@ nPM1300 is supported by the following boards in the `Zephyr`_ open source projec * - nRF52 DK - nPM1300 EK - PCA10040 - - ``nrf52dk_nrf52832`` + - ``nrf52dk/nrf52832`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - nRF52840 DK - nPM1300 EK - PCA10056 - - ``nrf52840dk_nrf52840`` + - ``nrf52840dk/nrf52840`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - nRF5340 DK - nPM1300 EK - PCA10095 - - ``nrf5340dk_nrf5340_cpuapp`` + - ``nrf5340dk/nrf5340/cpuapp`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ * - nRF9160 DK - nPM1300 EK - PCA10090 - - ``nrf9160dk_nrf9160_ns`` + - ``nrf9160dk/nrf9160/ns`` - | `Product Specification `_ | :ref:`Getting started ` | `User Guide `_ diff --git a/doc/nrf/device_guides/working_with_pmic/npm1300/gs.rst b/doc/nrf/device_guides/working_with_pmic/npm1300/gs.rst index e3515e50b810..dc0aaf21a655 100644 --- a/doc/nrf/device_guides/working_with_pmic/npm1300/gs.rst +++ b/doc/nrf/device_guides/working_with_pmic/npm1300/gs.rst @@ -1,3 +1,5 @@ +:orphan: + .. _ug_npm1300_gs: Getting started with nPM1300 EK diff --git a/doc/nrf/external_comp/avsystem.rst b/doc/nrf/external_comp/avsystem.rst index 961d8496a4da..aa65dd9513da 100644 --- a/doc/nrf/external_comp/avsystem.rst +++ b/doc/nrf/external_comp/avsystem.rst @@ -176,7 +176,7 @@ Applications and samples The following application uses the AVSystem integration in |NCS|: -* :ref:`asset_tracker_v2` - The :ref:`asset_tracker_v2_cloud_module` is set to communicate with AVSystem's Coiote Device Management, with a runtime provisioned Pre-shared key (PSK) set by the ``CONFIG_LWM2M_INTEGRATION_PSK`` Kconfig option. +* :ref:`asset_tracker_v2` - The :ref:`asset_tracker_v2_cloud_module` is set to communicate with AVSystem's Coiote Device Management, with a runtime provisioned pre-shared key (PSK) set by the ``CONFIG_LWM2M_INTEGRATION_PSK`` Kconfig option. For more information, see :ref:`assettracker_v2_cloudmodule_lwm2m`. The following samples use the AVSystem integration in |NCS|: diff --git a/doc/nrf/external_comp/bt_fast_pair.rst b/doc/nrf/external_comp/bt_fast_pair.rst index 8aefde12dd9a..2b24e75f8a8c 100644 --- a/doc/nrf/external_comp/bt_fast_pair.rst +++ b/doc/nrf/external_comp/bt_fast_pair.rst @@ -177,7 +177,7 @@ Apart from the callback registration and enabling the Fast Pair subsystem, no ad Personalized Name extension =========================== -To support the Personalized Name extension, ensure that the :kconfig:option:`CONFIG_BT_FAST_PAIR_EXT_PN` Kconfig option is enabled in your project. +To support the Personalized Name extension, ensure that the :kconfig:option:`CONFIG_BT_FAST_PAIR_PN` Kconfig option is enabled in your project. This extension is enabled by default. .. rst-class:: numbered-step diff --git a/doc/nrf/external_comp/coremark.rst b/doc/nrf/external_comp/coremark.rst new file mode 100644 index 000000000000..fe16eefdf13b --- /dev/null +++ b/doc/nrf/external_comp/coremark.rst @@ -0,0 +1,92 @@ +.. _ug_coremark: + +CoreMark integration +#################### + +.. contents:: + :local: + :depth: 2 + +CoreMark® is a CPU benchmark provided by Embedded Microprocessor Benchmark Consortium (EEMBC) to verify SoCs performance. +You can use it to perform series of tests in each benchmark iteration. +The benchmark score is calculated based on the number of iterations per second the :term:`Device Under Test (DUT)` can perform. +Integrating CoreMark into the |NCS| allows users to easily verify SoCs performance. + +Integration prerequisites +************************* + +Before you start the |NCS| integration with CoreMark, make sure that the following prerequisites are completed: + +* :ref:`Installation of the nRF Connect SDK `. +* Setup of the supported :term:`Development Kit (DK)`. + +Solution architecture +********************* + +Adding the CoreMark repository to the |NCS| manifest automatically includes it in the repository as the |NCS| module. +You can find it under the :file:`modules/benchmark/coremark` path. +CoreMark needs a porting layer to run correctly on a SoC. +You can find the files of porting layer for devices supported in the |NCS| under the :file:`nrf/modules/coremark` path. + +CoreMark benchmark consists of continuously repeated iterations. +Each iteration, in turn, consists of the following workloads: + +* Linked list +* Matrix multiply +* State machine + +For detailed description of each of those workloads, see the `CoreMark GitHub`_ repository. + +Integration steps +***************** + +To integrate CoreMark into the |NCS|, configure CoreMark as described in the following section. + +Configuring CoreMark +==================== + +To include CoreMark in your build, complete the following steps: + +#. Add the following Kconfig options in your :file:`prj.conf` file: + + .. code-block:: console + + CONFIG_COREMARK=y + +#. Choose any of the following memory methods for dealing with the CoreMark data. + Make sure that you allocate enough memory, depending on the method you choose. + + * Memory method stack: + + .. code-block:: console + + COREMARK_MEMORY_METHOD_STACK=y + CONFIG_MAIN_STACK_SIZE=4096 + + * Memory method heap: + + .. code-block:: console + + CONFIG_COREMARK_MEMORY_METHOD_MALLOC=y + CONFIG_HEAP_MEM_POOL_SIZE=4096 + + * Memory method static: + + .. code-block:: console + + CONFIG_COREMARK_MEMORY_METHOD_STATIC=y + +To see an example, refer to the :ref:`coremark_configuration` section of the :ref:`coremark_sample` documentation. + +Submitting score +**************** + +You can see the submitted scores in the official `CoreMark `_ database. +If you want to submit your own score, follow steps in the `CoreMark GitHub`_ repository. + +Applications and samples +************************ + +The following sample demonstrates the CoreMark integration in the |NCS|: + +* :ref:`coremark_sample` - This sample is used to obtain the CoreMark score for boards supported in the |NCS|. diff --git a/doc/nrf/external_comp/memfault.rst b/doc/nrf/external_comp/memfault.rst index 78bd712658b9..b7f27afdb296 100644 --- a/doc/nrf/external_comp/memfault.rst +++ b/doc/nrf/external_comp/memfault.rst @@ -93,7 +93,7 @@ See the following example on how to set an overlay configuration for Memfault in .. code-block:: console - west build -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-memfault.conf + west build -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE=overlay-memfault.conf .. rst-class:: numbered-step diff --git a/doc/nrf/glossary.rst b/doc/nrf/glossary.rst index ba60424d7469..151bc824e1f5 100644 --- a/doc/nrf/glossary.rst +++ b/doc/nrf/glossary.rst @@ -103,8 +103,11 @@ Glossary Build type A build type is a feature that defines the way in which the configuration files are to be handled. - The |NCS| provides support for :ref:`app_build_additions_build_types`. - Selecting a specific build type can result in a different structure of the :term:`build configuration`. + The |NCS| provides support for handling :ref:`app_build_additions_build_types` + :ref:`Selecting a specific build type ` can result in a different structure of the :term:`build configuration`. + + .. note:: + Build types are deprecated and are being gradually replaced by Zephyr's :ref:`file suffixes ` and :ref:`zephyr:sysbuild`. Carrier-sense Multiple Access with Collision Avoidance (CSMA/CA) A network multiple access method in which carrier sensing is used, but nodes attempt to avoid collisions by beginning transmission only after the channel is sensed to be idle. @@ -879,6 +882,7 @@ Glossary UART Hardware Flow Control (UART HWFC) A handshaking mechanism used to prevent a buffer overflow in the receiver (in embedded computing use cases). In a serial connection, when the transmission baud rate is high enough for data to appear faster than it can be processed by the receiver, the communicating devices can synchronize with each other, using :term:`Request to Send (RTS)` and :term:`Clear to Send (CTS)` pins. + In the |NCS|, UART HWFC is usually not used when :ref:`testing applications `. Unicast addressing An addressing type that uses a one-to-one association between the destination address and the network endpoint. @@ -921,7 +925,7 @@ Glossary * M: Multiply and divide extension * C: Compressed extension (compressed instructions) - The nRF54H20 PDK uses several VPR cores: :term:`Fast Lightweight Processor (FLPR, pronounced “Flipper”)`, :term:`Peripheral Processor (PPR, pronounced “Pepper”)` and :term:`System Controller`. + The nRF54H20 DK uses several VPR cores: :term:`Fast Lightweight Processor (FLPR, pronounced “Flipper”)`, :term:`Peripheral Processor (PPR, pronounced “Pepper”)` and :term:`System Controller`. VPR Event Interface (VEVIF) A real-time peripheral that allows interaction with the VPR's interrupts and the PPI system in the domain where the VPR is instantiated. @@ -935,15 +939,15 @@ Glossary See :ref:`zephyr:west`. West manifest file - The main file describing the contents of a :term:`West` workspace, which is located in the :term:`West manifest repository`. + The main file describing the contents of a :term:`west ` workspace, which is located in the :term:`west manifest repository `. In the |NCS| and Zephyr, it is named :file:`west.yml`. West manifest repository - A :term:`repository ` that contains a :term:`West manifest file` and can be used to configure a west workspace. + A :term:`repository ` that contains a :term:`west manifest file ` and can be used to configure a west workspace. See :ref:`dm_repo_types`. West project - Any of the listed :term:`repositories ` inside a :term:`West manifest file`. + Any of the listed :term:`repositories ` inside a :term:`west manifest file `. Wi-Fi Protected Access® (WPA) A security protocol developed by Wi-Fi Alliance. diff --git a/doc/nrf/gsg_guides.rst b/doc/nrf/gsg_guides.rst new file mode 100644 index 000000000000..653c615a7753 --- /dev/null +++ b/doc/nrf/gsg_guides.rst @@ -0,0 +1,32 @@ +.. _gsg_guides: + +Getting started guides +###################### + +Use the guides in this section to familiarize yourself with the |NCS| tools and components for some of the devices supported by the SDK. + +.. 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. + +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 nRF9161 DK, complete the steps in the Quick Start app, available from `nRF Connect for Desktop`_. + * To get started with the nRF54L15 PDK, the installation of the |NCS| is required. + See :ref:`ug_nrf54l15_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. + +.. toctree:: + :maxdepth: 1 + :caption: Subpages: + + gsg_guides/nrf9160_gs + gsg_guides/thingy91_gsg + gsg_guides/nrf7002_gs + gsg_guides/nrf5340_gs + gsg_guides/thingy53_gs + gsg_guides/nrf52_gs diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_enablemcuboot.png b/doc/nrf/gsg_guides/images/cellularmonitor_enablemcuboot.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_enablemcuboot.png rename to doc/nrf/gsg_guides/images/cellularmonitor_enablemcuboot.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_iccid.png b/doc/nrf/gsg_guides/images/cellularmonitor_iccid.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_iccid.png rename to doc/nrf/gsg_guides/images/cellularmonitor_iccid.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_programdevice_thingy91.png b/doc/nrf/gsg_guides/images/cellularmonitor_programdevice_thingy91.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_programdevice_thingy91.png rename to doc/nrf/gsg_guides/images/cellularmonitor_programdevice_thingy91.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_selectassettracker.png b/doc/nrf/gsg_guides/images/cellularmonitor_selectassettracker.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_selectassettracker.png rename to doc/nrf/gsg_guides/images/cellularmonitor_selectassettracker.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_selectdevice_thingy91.png b/doc/nrf/gsg_guides/images/cellularmonitor_selectdevice_thingy91.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/cellularmonitor_selectdevice_thingy91.png rename to doc/nrf/gsg_guides/images/cellularmonitor_selectdevice_thingy91.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF7002_programmer_select_device.png b/doc/nrf/gsg_guides/images/nRF7002_programmer_select_device.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF7002_programmer_select_device.png rename to doc/nrf/gsg_guides/images/nRF7002_programmer_select_device.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF7002_scan_sample_output.png b/doc/nrf/gsg_guides/images/nRF7002_scan_sample_output.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF7002_scan_sample_output.png rename to doc/nrf/gsg_guides/images/nRF7002_scan_sample_output.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF70dk.png b/doc/nrf/gsg_guides/images/nRF70dk.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf70/images/nRF70dk.png rename to doc/nrf/gsg_guides/images/nRF70dk.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_client_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_client_ios.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_client_ios.png rename to doc/nrf/gsg_guides/images/nrf52_connect_client_ios.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_log.png b/doc/nrf/gsg_guides/images/nrf52_connect_log.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_log.png rename to doc/nrf/gsg_guides/images/nrf52_connect_log.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_log_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_log_ios.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_log_ios.png rename to doc/nrf/gsg_guides/images/nrf52_connect_log_ios.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_write_ios.png b/doc/nrf/gsg_guides/images/nrf52_connect_write_ios.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_connect_write_ios.png rename to doc/nrf/gsg_guides/images/nrf52_connect_write_ios.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_enable_cccds.png b/doc/nrf/gsg_guides/images/nrf52_enable_cccds.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf52/images/nrf52_enable_cccds.png rename to doc/nrf/gsg_guides/images/nrf52_enable_cccds.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_activating_sim.png b/doc/nrf/gsg_guides/images/nrfcloud_activating_sim.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_activating_sim.png rename to doc/nrf/gsg_guides/images/nrfcloud_activating_sim.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_add_devices.png b/doc/nrf/gsg_guides/images/nrfcloud_add_devices.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_add_devices.png rename to doc/nrf/gsg_guides/images/nrfcloud_add_devices.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_add_lte_device.png b/doc/nrf/gsg_guides/images/nrfcloud_add_lte_device.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_add_lte_device.png rename to doc/nrf/gsg_guides/images/nrfcloud_add_lte_device.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_addsim.png b/doc/nrf/gsg_guides/images/nrfcloud_addsim.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_addsim.png rename to doc/nrf/gsg_guides/images/nrfcloud_addsim.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_devices.png b/doc/nrf/gsg_guides/images/nrfcloud_devices.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_devices.png rename to doc/nrf/gsg_guides/images/nrfcloud_devices.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_selectdevicetype.png b/doc/nrf/gsg_guides/images/nrfcloud_selectdevicetype.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_selectdevicetype.png rename to doc/nrf/gsg_guides/images/nrfcloud_selectdevicetype.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_simcards.png b/doc/nrf/gsg_guides/images/nrfcloud_simcards.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/nrfcloud_simcards.png rename to doc/nrf/gsg_guides/images/nrfcloud_simcards.png diff --git a/doc/nrf/gsg_guides/images/programmer_select_device1.png b/doc/nrf/gsg_guides/images/programmer_select_device1.png new file mode 100644 index 000000000000..f64962467125 Binary files /dev/null and b/doc/nrf/gsg_guides/images/programmer_select_device1.png differ diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/programmer_thingy53_mcuboot_dfu.png b/doc/nrf/gsg_guides/images/programmer_thingy53_mcuboot_dfu.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/programmer_thingy53_mcuboot_dfu.png rename to doc/nrf/gsg_guides/images/programmer_thingy53_mcuboot_dfu.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_application_info.png b/doc/nrf/gsg_guides/images/thingy53_application_info.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_application_info.png rename to doc/nrf/gsg_guides/images/thingy53_application_info.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_nrf5340_dk.svg b/doc/nrf/gsg_guides/images/thingy53_nrf5340_dk.svg similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_nrf5340_dk.svg rename to doc/nrf/gsg_guides/images/thingy53_nrf5340_dk.svg diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_progress_wheel.png b/doc/nrf/gsg_guides/images/thingy53_progress_wheel.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_progress_wheel.png rename to doc/nrf/gsg_guides/images/thingy53_progress_wheel.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sample_list.png b/doc/nrf/gsg_guides/images/thingy53_sample_list.png similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sample_list.png rename to doc/nrf/gsg_guides/images/thingy53_sample_list.png diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sw1_sw2.svg b/doc/nrf/gsg_guides/images/thingy53_sw1_sw2.svg similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sw1_sw2.svg rename to doc/nrf/gsg_guides/images/thingy53_sw1_sw2.svg diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sw1_usb.svg b/doc/nrf/gsg_guides/images/thingy53_sw1_usb.svg similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf53/images/thingy53_sw1_usb.svg rename to doc/nrf/gsg_guides/images/thingy53_sw1_usb.svg diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/thingy91_insert_sim.svg b/doc/nrf/gsg_guides/images/thingy91_insert_sim.svg similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/thingy91_insert_sim.svg rename to doc/nrf/gsg_guides/images/thingy91_insert_sim.svg diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/images/thingy91_pwr_switch.svg b/doc/nrf/gsg_guides/images/thingy91_pwr_switch.svg similarity index 100% rename from doc/nrf/device_guides/working_with_nrf/nrf91/images/thingy91_pwr_switch.svg rename to doc/nrf/gsg_guides/images/thingy91_pwr_switch.svg diff --git a/doc/nrf/gsg_guides/nrf52_gs.rst b/doc/nrf/gsg_guides/nrf52_gs.rst new file mode 100644 index 000000000000..a15ddfe035e6 --- /dev/null +++ b/doc/nrf/gsg_guides/nrf52_gs.rst @@ -0,0 +1,236 @@ +.. _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/device_guides/working_with_nrf/nrf53/nrf5340_gs.rst b/doc/nrf/gsg_guides/nrf5340_gs.rst similarity index 80% rename from doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340_gs.rst rename to doc/nrf/gsg_guides/nrf5340_gs.rst index 395126cced4e..fb34aa9a3856 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf53/nrf5340_gs.rst +++ b/doc/nrf/gsg_guides/nrf5340_gs.rst @@ -7,14 +7,9 @@ Getting started with nRF5340 DK :local: :depth: 2 -This section gets you started with your nRF5340 :term:`Development Kit (DK)` using the |NCS|. +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 have already set up your nRF5340 DK and want to learn more, see the following documentation: - -* :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. - 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: @@ -72,23 +67,22 @@ The archive contains the HEX file used to program the sample to your DK. .. |DK| replace:: nRF5340 DK -.. include:: ../nrf52/gs.rst +.. 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 and test the functions. -If you connect to the sample now, you can go directly to Step 2 of :ref:`nrf5340_gs_connecting`. +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:: ../nrf52/gs.rst +.. include:: /gsg_guides/nrf52_gs.rst :start-after: uart_dk_connect_start :end-before: uart_dk_connect_end -Once the connection has been established, you can test the sample from Step 2 of :ref:`nrf5340_gs_testing`. +Once the connection has been established, continue to :ref:`nrf5340_gs_testing`. .. _nrf5340_gs_testing: @@ -98,7 +92,7 @@ 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:: ../nrf52/gs.rst +.. include:: /gsg_guides/nrf52_gs.rst :start-after: testing_dk_start :end-before: testing_dk_end diff --git a/doc/nrf/gsg_guides/nrf7002_gs.rst b/doc/nrf/gsg_guides/nrf7002_gs.rst new file mode 100644 index 000000000000..1db07af354e8 --- /dev/null +++ b/doc/nrf/gsg_guides/nrf7002_gs.rst @@ -0,0 +1,345 @@ +.. _nrf7002dk_nrf5340: +.. _ug_nrf7002_gs: + +Getting started with nRF7002 DK +############################### + +.. contents:: + :local: + :depth: 4 + +This guide lets you evaluate the |NCS|'s support for nRF7002 :term:`Development Kit (DK)` without the need of installing the SDK. +It tells you how to install the :ref:`wifi_scan_sample` sample and perform a quick test of your DK. + +If you want to go through an online training course to familiarize yourself with Wi-Fi® and the development of Wi-Fi applications, enroll in the `Wi-Fi Fundamentals course`_ in the `Nordic Developer Academy`_. + +Overview +******** + +The nRF7002 DK (PCA10143) is a single-board development kit for evaluation and development on the nRF7002, a Wi-Fi companion :term:`Integrated Circuit (IC)` to Nordic Semiconductor's nRF5340 System-on-Chip (SoC) host processor. +It is certified for the Wi-Fi Alliance® `certification program `_ in the Connectivity, Security, and Optimization categories. +See :ref:`ug_wifi_certification` for detailed information. + +The nRF7002 is an IEEE 802.11ax (Wi-Fi 6) compliant solution that implements the Wi-Fi physical layer and Medium Access Control (MAC) layer protocols. +It implements the nRF Wi-Fi driver software on the nRF5340 host processor communicating over the QSPI bus. + +The nRF5340 host is a dual-core SoC based on the Arm® Cortex®-M33 architecture. +It has the following features: + +* A full-featured Arm Cortex-M33F core with DSP instructions, FPU, and Armv8-M Security Extension, running at up to 128 MHz, referred to as the application core. +* A secondary Arm Cortex-M33 core, with a reduced feature set, running at a fixed 64 MHz, referred to as the network core. + +The ``nrf7002dk/nrf5340/cpuapp`` build target provides support for the application core on the nRF5340 SoC. +The ``nrf7002dk/nrf5340/cpunet`` build target provides support for the network core on the nRF5340 SoC. + +.. figure:: images/nRF70dk.png + :alt: nRF7002 DK + + nRF7002 DK + +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 +======== + +* nRF7002 DK: + The nRF7002 DK has two external oscillators. + + * The frequency of the slow clock is 32.768 kHz. + * The frequency of the main clock is 32 MHz. + +* Micro-USB 2.0 cable + +Supported features +------------------ + +The ``nrf7002dk/nrf5340/cpuapp`` board configuration supports the following hardware features: + ++-----------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+======================+ +| ADC | on-chip | adc | ++-----------+------------+----------------------+ +| CLOCK | on-chip | clock_control | ++-----------+------------+----------------------+ +| FLASH | on-chip | flash | ++-----------+------------+----------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+----------------------+ +| I2C(M) | on-chip | i2c | ++-----------+------------+----------------------+ +| MPU | on-chip | arch/arm | ++-----------+------------+----------------------+ +| NVIC | on-chip | arch/arm | ++-----------+------------+----------------------+ +| PWM | on-chip | pwm | ++-----------+------------+----------------------+ +| RTC | on-chip | system clock | ++-----------+------------+----------------------+ +| RTT | Segger | console | ++-----------+------------+----------------------+ +| RADIO | nrf7002 | Wi-Fi 6 (802.11ax) | ++-----------+------------+----------------------+ +| QSPI | on-chip | qspi | ++-----------+------------+----------------------+ +| SPI(M/S) | on-chip | spi | ++-----------+------------+----------------------+ +| SPU | on-chip | system protection | ++-----------+------------+----------------------+ +| UARTE | on-chip | serial | ++-----------+------------+----------------------+ +| USB | on-chip | usb | ++-----------+------------+----------------------+ +| WDT | on-chip | watchdog | ++-----------+------------+----------------------+ + +The ``nrf7002dk/nrf5340/cpunet`` board configuration supports the following hardware features: + ++-----------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+======================+ +| CLOCK | on-chip | clock_control | ++-----------+------------+----------------------+ +| FLASH | on-chip | flash | ++-----------+------------+----------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+----------------------+ +| I2C(M) | on-chip | i2c | ++-----------+------------+----------------------+ +| MPU | on-chip | arch/arm | ++-----------+------------+----------------------+ +| NVIC | on-chip | arch/arm | ++-----------+------------+----------------------+ +| RADIO | on-chip | Bluetooth, | +| | | ieee802154 | ++-----------+------------+----------------------+ +| RTC | on-chip | system clock | ++-----------+------------+----------------------+ +| RTT | Segger | console | ++-----------+------------+----------------------+ +| QSPI | on-chip | qspi | ++-----------+------------+----------------------+ +| SPI(M/S) | on-chip | spi | ++-----------+------------+----------------------+ +| UARTE | on-chip | serial | ++-----------+------------+----------------------+ +| WDT | on-chip | watchdog | ++-----------+------------+----------------------+ + +Other hardware features are not supported by the |NCS| kernel. + +Connections and IOs +------------------- + +The connections and IOs supported by the development kit are listed in this section. + +LED +^^^ + +* **LED 1** (green) = **P1.06** +* **LED 2** (green) = **P1.07** + +Push buttons +^^^^^^^^^^^^ + +* **Button 1** = **SW1** = **P1.08** +* **Button 2** = **SW2** = **P1.09** +* **BOOT** = **SW5** = boot/reset + +Wi-Fi control +^^^^^^^^^^^^^ + +* BUCKEN = **P0.12** +* IOVDD CONTROL = **P0.31** +* HOST IRQ = **P0.23** +* COEX_REQ = **P0.28** +* COEX_STATUS0 = **P0.30** +* COEX_STATUS1 = **P0.29** +* COEX_GRANT = **P0.24** + +Security components +------------------- + +The following security components are available: + +* Implementation Defined Attribution Unit (`IDAU`_) on the application core. + + The IDAU is implemented with the System Protection Unit and is used to define secure and non-secure memory maps. + By default, the entire memory space (Flash, SRAM, and peripheral address space) is defined to be secure-accessible only. + +* Secure boot. + +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 + +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:`nrf70_gs_connecting`. + +On your mobile device, install the `nRF Connect for Mobile`_ application from the corresponding application store. + +.. _nrf70_gs_installing_sample: + + +Programming the sample +********************** + +You must program and run a precompiled version of the :ref:`wifi_scan_sample` sample on your development kit to test the functions. +Download the precompiled version of the sample from the `nRF7002 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. + +To program the precompiled sample to your development kit, complete the following steps: + +1. Open the Programmer app. +#. Connect the nRF7002 DK to the computer with a micro-USB cable and turn on the DK. + + **LED 5** starts blinking. + +#. Click **SELECT DEVICE** and select the DK from the drop-down list. + + .. figure:: images/nRF7002_programmer_select_device.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. + +After you have programmed the sample to the DK, you can connect to it and test the functions. + +.. _nrf70_gs_connecting: + +Connecting to the sample +************************ + +You can connect to the sample on the nRF7002 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. + +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. + +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. + +Once the connection has been established, you can test the sample. + +.. _nrf70_gs_testing: + +Testing the sample +****************** + +You can test the :ref:`wifi_scan_sample` sample on your DK. +The test requires that you have :ref:`connected to the sample ` and have the connected terminal emulator open. + +After successful programming of the sample onto the nRF7002 DK, scan results output will be shown in the terminal emulator connected to the sample through CDC-UART. + +.. figure:: images/nRF7002_scan_sample_output.png + :alt: Scan sample output + + Scan sample output + +Building and debugging +********************** + +The nRF5340 application core supports the Armv8-M Security Extension. +Applications built for the ``nrf7002dk/nrf5340/cpuapp`` board boot by default in the secure state. + +The nRF5340 network core does not support the Armv8-M Security Extension. +nRF5340 IDAU can configure bus accesses by the nRF5340 network core to have the secure attribute set. +This allows to build and run secure-only applications on the nRF5340 SoC. + +Building |NCS| applications with Arm TrustZone +============================================== + +Applications on nRF5340 can use Cortex-M Security Extensions (CMSE) and separate firmware for the application core between Secure Processing Environment (SPE) and Non-Secure Processing Environment (NSPE). +You can build SPE using either |NCS| or `Trusted Firmware M`_ (TF-M). +You must always build NSPE using |NCS|. + +For information about Cortex-M Security Extensions (CMSE) and the difference between the two environments, see :ref:`app_boards_spe_nspe`. + +.. note:: + By default, SPE for the nRF5340 application core is built using TF-M. + +Building the firmware with TF-M +------------------------------- + +If you want to use |NCS| to build the firmware image separated in SPE with TF-M and NSPE, complete the following steps: + +1. Build the |NCS| application for the application core using the ``nrf7002dk/nrf5340/cpuapp/ns`` build target. + + To invoke the building of TF-M, the |NCS| build system requires the Kconfig option :kconfig:option:`CONFIG_BUILD_WITH_TFM` to be enabled, which is set by default when building |NCS| as an application that supports both NSPE and SPE. + + The |NCS| build system performs the following steps automatically: + + a. Build the NSPE firmware image as a regular |NCS| application. + #. Build an SPE firmware image (with TF-M). + #. Merge the output image binaries. + #. Optionally, build a bootloader image (MCUboot). + + .. note:: + Depending on the TF-M configuration, an application DTS overlay can be required to adjust the NSPE image flash memory partition and SRAM starting address and sizes. + +#. Build the application firmware for the network core using the ``nrf7002dk/nrf5340/cpunet`` build target. + +Building application without CMSE +================================= + +Build the |NCS| application as described in :ref:`building`, using the ``nrf7002dk/nrf5340/cpuapp`` build target for the firmware running on the nRF5340 application core and the ``nrf7002dk/nrf5340/cpunet`` build target for the firmware running on the nRF5340 network core. + +Programming the firmware to the DK +================================== + +Follow the instructions in the :ref:`building` page to build and the :ref:`programming` page to program applications. + +.. note:: + To flash and debug applications on the nRF7002 DK, you must use the `nRF Command Line Tools`_ version 10.12.0 or above. + +Debugging +========= + +See the :ref:`testing` page for information about debugging. + +Next steps +********** + +You have now completed getting started with the nRF7002 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_nrf70_developing` documentation for more advanced topics related to the nRF70 Series. +* :ref:`ug_wifi` documentation for information related to Wi-Fi protocol and Wi-Fi modes of operation. diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160_gs.rst b/doc/nrf/gsg_guides/nrf9160_gs.rst similarity index 95% rename from doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160_gs.rst rename to doc/nrf/gsg_guides/nrf9160_gs.rst index c00afa5a7b63..7d56d1ac3a27 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/nrf9160_gs.rst +++ b/doc/nrf/gsg_guides/nrf9160_gs.rst @@ -7,14 +7,9 @@ Getting started with nRF9160 DK :local: :depth: 2 -This section will get you started with your nRF9160 DK. +This guide lets you evaluate the |NCS|'s support for nRF9160 DK :term:`Development Kit (DK)` without the need of installing the SDK. You will update the firmware (both the modem firmware and the application firmware) and the nRF Cloud certificates of the DK, and conduct some initial tests. -If you have already set up your nRF9160 DK and want to learn more, see the following documentation: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_nrf9160` for more advanced topics related to the nRF9160 DK if you are already familiar with the |NCS|. - If you want to go through a hands-on online training to familiarize yourself with cellular IoT technologies and development of cellular applications, enroll in the `Cellular IoT Fundamentals course`_ in the `Nordic Developer Academy`_. .. _nrf9160_gs_requirements: diff --git a/doc/nrf/device_guides/working_with_nrf/nrf53/thingy53_gs.rst b/doc/nrf/gsg_guides/thingy53_gs.rst similarity index 92% rename from doc/nrf/device_guides/working_with_nrf/nrf53/thingy53_gs.rst rename to doc/nrf/gsg_guides/thingy53_gs.rst index 1fadd592c38b..95765e45f4fa 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf53/thingy53_gs.rst +++ b/doc/nrf/gsg_guides/thingy53_gs.rst @@ -7,14 +7,9 @@ Getting started with Thingy:53 :local: :depth: 2 -This guide helps you get started with the Nordic Thingy:53. +This guide lets you evaluate the |NCS|'s support for Nordic Thingy:53 without the need of installing the SDK. It tells you how to update the firmware on the nRF5340 :term:`System on Chip (SoC)` on the Nordic Thingy:53, and how to get started with machine learning with Edge Impulse. -If you have already set up your Nordic Thingy:53 and want to learn more, see the following documentation: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_thingy53` for more advanced topics related to the Nordic Thingy:53. - 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`_. .. _thingy53_gs_requirements: @@ -83,7 +78,7 @@ Complete these steps to update the firmware: A list of available samples appears. - .. figure:: images/thingy53_sample_list.png + .. figure:: /gsg_guides/images/thingy53_sample_list.png :alt: nRF Programmer - list of samples nRF Programmer - list of samples @@ -92,7 +87,7 @@ Complete these steps to update the firmware: Application info appears. - .. figure:: images/thingy53_application_info.png + .. figure:: /gsg_guides/images/thingy53_application_info.png :alt: nRF Programmer - Application Info nRF Programmer - Application Info @@ -109,7 +104,7 @@ Complete these steps to update the firmware: The transfer of the firmware image starts, and a progress wheel appears. - .. figure:: images/thingy53_progress_wheel.png + .. figure:: /gsg_guides/images/thingy53_progress_wheel.png :alt: nRF Programmer - progress wheel nRF Programmer - progress wheel @@ -142,7 +137,7 @@ Complete the following steps to update the firmware: #. Take off the top cover of the Nordic Thingy:53 so you can access the **SW2** button in Step 7. #. Plug the Nordic Thingy:53 into the computer using a USB-C cable. - .. figure:: images/thingy53_sw1_usb.svg + .. figure:: /gsg_guides/images/thingy53_sw1_usb.svg :alt: The Nordic Thingy:53 schematic - **SW1** and USB connector cover The Nordic Thingy:53 schematic - **SW1** and USB connector cover @@ -150,7 +145,7 @@ Complete the following steps to update the firmware: #. Open nRF Connect for Desktop and launch the Programmer app. #. Press **SW2** while moving the power switch **SW1** to the **ON** position. - .. figure:: images/thingy53_sw1_sw2.svg + .. figure:: /gsg_guides/images/thingy53_sw1_sw2.svg :alt: The Nordic Thingy:53 schematic - **SW1** and **SW2** The Nordic Thingy:53 schematic - **SW1** and **SW2** @@ -170,7 +165,7 @@ Complete the following steps to update the firmware: The **MCUboot DFU** window appears. - .. figure:: images/programmer_thingy53_mcuboot_dfu.png + .. figure:: /gsg_guides/images/programmer_thingy53_mcuboot_dfu.png :alt: Programmer - MCUboot DFU window Programmer - MCUboot DFU window @@ -214,7 +209,7 @@ Do no unplug or power off the devices during this process. a. Open the connector cover on the side of the Nordic Thingy:53. #. Use a JTAG cable to connect the Nordic Thingy:53 to the debug out port on a 10-pin external debug probe. - .. figure:: images/thingy53_nrf5340_dk.svg + .. figure:: /gsg_guides/images/thingy53_nrf5340_dk.svg :alt: Nordic Thingy:53 connected to the debug port on a 10-pin external debug probe Nordic Thingy:53 connected to the debug port on a 10-pin external debug probe @@ -225,7 +220,7 @@ Do no unplug or power off the devices during this process. In the Programmer app's navigation bar, :guilabel:`No devices available` changes to :guilabel:`SELECT DEVICE`. - .. figure:: ../nrf52/images/programmer_select_device1.png + .. figure:: images/programmer_select_device1.png :alt: Programmer - Select device Programmer - Select device diff --git a/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91_gsg.rst b/doc/nrf/gsg_guides/thingy91_gsg.rst similarity index 96% rename from doc/nrf/device_guides/working_with_nrf/nrf91/thingy91_gsg.rst rename to doc/nrf/gsg_guides/thingy91_gsg.rst index a30900d20790..ccb5d214b1e5 100644 --- a/doc/nrf/device_guides/working_with_nrf/nrf91/thingy91_gsg.rst +++ b/doc/nrf/gsg_guides/thingy91_gsg.rst @@ -8,14 +8,9 @@ Getting started with Thingy:91 :depth: 2 -This guide helps you get started with the Nordic Thingy:91. +This guide lets you evaluate the |NCS|'s support for Nordic Thingy:91 without the need of installing the SDK. It tells you how to update the Thingy:91 application and modem firmware and connect the Thingy:91 to `nRF Cloud`_. -If you have already set up your Thingy:91 and want to learn more, see the following documentation: - -* :ref:`installation` and :ref:`configuration_and_build` documentation to install the |NCS| and learn more about its development environment. -* :ref:`ug_thingy91` for more advanced topics related to the Thingy:91. - If you want to go through a hands-on online training to familiarize yourself with cellular IoT technologies and development of cellular applications, enroll in the `Cellular IoT Fundamentals course`_ in the `Nordic Developer Academy`_. Requirements for setting up the Thingy:91 diff --git a/doc/nrf/images/nrf5340_audio_application_topologies.png b/doc/nrf/images/nrf5340_audio_application_topologies.png index fd24b97ef318..002ee81e564d 100644 Binary files a/doc/nrf/images/nrf5340_audio_application_topologies.png and b/doc/nrf/images/nrf5340_audio_application_topologies.png differ diff --git a/doc/nrf/includes/boardname_tables/sample_boardnames.txt b/doc/nrf/includes/boardname_tables/sample_boardnames.txt index 0d8d4f4f2a64..d0e134008e47 100644 --- a/doc/nrf/includes/boardname_tables/sample_boardnames.txt +++ b/doc/nrf/includes/boardname_tables/sample_boardnames.txt @@ -7,13 +7,13 @@ Set used by Bluetooth LE Samples, NFC samples, and NUS shell transport sample. +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | |``nrf5340dk_nrf5340_cpuapp_ns`` | +| | | |``nrf5340dk/nrf5340/cpuapp/ns`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set1_end @@ -25,9 +25,9 @@ Set used by Bluetooth LE samples, Enhanced ShockBurst Transmitter/Receiver, and +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set2_end @@ -39,15 +39,15 @@ Set used by Bluetooth LE samples (Peripheral LBS) +---------------------------------+-----------+--------------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +=================================+===========+========================================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | |``nrf5340dk_nrf5340_cpuapp_ns`` | +| | | |``nrf5340dk/nrf5340/cpuapp/ns`` | +---------------------------------+-----------+--------------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 Dongle `|PCA10059 |:ref:`nrf52840dongle_nrf52840 `|``nrf52840dongle_nrf52840`` | +|:ref:`nRF52840 Dongle `|PCA10059 |:ref:`nrf52840dongle ` |``nrf52840dongle/nrf52840`` | +---------------------------------+-----------+--------------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 ` |``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +---------------------------------+-----------+--------------------------------------------------------+--------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +---------------------------------+-----------+--------------------------------------------------------+--------------------------------+ .. set3_end @@ -59,11 +59,11 @@ Set used by samples (Radio Test, MPSL Timeslot) +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpunet`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpunet`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set4_end @@ -76,7 +76,7 @@ LTE Sensor Gateway, LwM2M carrier, LwM2M Client, Simple MQTT, Secure Services S +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160_ns`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set5_end @@ -88,9 +88,9 @@ Set used by nRF9160 samples (Cloud Client, nRF Cloud A-GPS) and application (Ass +--------------------------------+-----------+------------------------------------------------+------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+==============================+ -|:ref:`Thingy:91 ` |PCA20035 |thingy91_nrf9160 |``thingy91_nrf9160_ns`` | +|:ref:`Thingy:91 ` |PCA20035 |thingy91 |``thingy91/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+------------------------------+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160_ns`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+------------------------------+ .. set6_end @@ -102,7 +102,7 @@ Set used by nRF9160 samples (Cloud Client, nRF Cloud A-GPS) and application (Ass +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set7_end @@ -114,9 +114,9 @@ Set used by Thread and Zigbee samples and application (nRF Desktop - DK) +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52833 DK ` |PCA10100 |:ref:`nrf52833dk_nrf52833 `|``nrf52833dk_nrf52833`` | +|:ref:`nRF52833 DK ` |PCA10100 |:ref:`nrf52833dk ` |``nrf52833dk/nrf52833`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set8_end @@ -128,11 +128,11 @@ Set used by samples (Application Event Manager, Profiler, PPI Trace) +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160_ns`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set9_end @@ -144,7 +144,7 @@ Set used by samples (BH1749: Ambient Light Sensor IC) +--------------------------------+-----------+------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+==================+===========================+ -|:ref:`Thingy:91 ` |PCA20035 |thingy91_nrf9160 |``thingy91_nrf9160_ns`` | +|:ref:`Thingy:91 ` |PCA20035 |thingy91 |``thingy91/nrf9160/ns`` | +--------------------------------+-----------+------------------+---------------------------+ .. set10_end @@ -156,7 +156,7 @@ Set used by application (nRF Desktop - Gaming Mouse) +-----------------------+-----------+-------------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +=======================+===========+=========================+===========================+ -|nRF52840 Gaming Mouse |PCA20041 |nrf52840gmouse_nrf52840 |``nrf52840gmouse_nrf52840``| +|nRF52840 Gaming Mouse |PCA20041 |nrf52840gmouse |``nrf52840gmouse/nrf52840``| +-----------------------+-----------+-------------------------+---------------------------+ .. set11_end @@ -169,9 +169,9 @@ Set used by application (nRF Desktop - Desktop Mouse) +-------------------------------------------------+-----------+------------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +=================================================+===========+========================+===========================+ -|nRF52832 Desktop Mouse |PCA20044 |nrf52dmouse_nrf52832 |``nrf52dmouse_nrf52832`` | +|nRF52832 Desktop Mouse |PCA20044 |nrf52dmouse |``nrf52dmouse/nrf52832`` | +-------------------------------------------------+-----------+------------------------+---------------------------+ -|nRF52810 Desktop Mouse |PCA20045 |nrf52810dmouse_nrf52810 |``nrf52810dmouse_nrf52810``| +|nRF52810 Desktop Mouse |PCA20045 |nrf52810dmouse |``nrf52810dmouse/nrf52810``| +-------------------------------------------------+-----------+------------------------+---------------------------+ @@ -184,7 +184,7 @@ Set used by application (nRF Desktop - Keyboard) +-------------------------------------------------+-----------+------------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +=================================================+===========+========================+===========================+ -|nRF52832 Desktop Keyboard |PCA20037 |nrf52kbd_nrf52832 |``nrf52kbd_nrf52832`` | +|nRF52832 Desktop Keyboard |PCA20037 |nrf52kbd |``nrf52kbd/nrf52832`` | +-------------------------------------------------+-----------+------------------------+---------------------------+ .. set13_end @@ -196,11 +196,11 @@ Set used by application (nRF Desktop - Dongles) +-------------------------------------------------+-----------+--------------------------------------------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +=================================================+===========+========================================================+===========================+ -|:ref:`nRF52840 Dongle ` |PCA10059 |:ref:`nrf52840dongle_nrf52840 `|``nrf52840dongle_nrf52840``| +|:ref:`nRF52840 Dongle ` |PCA10059 |:ref:`nrf52840dongle ` |``nrf52840dongle/nrf52840``| +-------------------------------------------------+-----------+--------------------------------------------------------+---------------------------+ -|nRF52833 Dongle |PCA10111 |nrf52833dongle_nrf52833 |``nrf52833dongle_nrf52833``| +|nRF52833 Dongle |PCA10111 |nrf52833dongle |``nrf52833dongle/nrf52833``| +-------------------------------------------------+-----------+--------------------------------------------------------+---------------------------+ -|nRF52820 Dongle |PCA10114 |nrf52820dongle_nrf52820 |``nrf52820dongle_nrf52820``| +|nRF52820 Dongle |PCA10114 |nrf52820dongle |``nrf52820dongle/nrf52820``| +-------------------------------------------------+-----------+--------------------------------------------------------+---------------------------+ .. set14_end @@ -212,9 +212,9 @@ Set used by nRF53 samples (Empty firmware for application core) +--------------------------------+-----------+-----------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+===============================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | |``nrf5340dk_nrf5340_cpuapp_ns`` | +| | | |``nrf5340dk/nrf5340/cpuapp/ns`` | +--------------------------------+-----------+-----------------------------------------------+--------------------------------+ .. set15_end @@ -226,15 +226,15 @@ Set used by sample (Immutable bootloader) +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160_ns`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | |``nrf5340dk_nrf5340_cpuapp_ns`` | +| | | |``nrf5340dk/nrf5340/cpuapp/ns`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set16_end @@ -246,7 +246,7 @@ Set used by samples (USB-UART bridge) and application (Connectivity bridge) +--------------------------------+-----------+------------------+---------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+==================+===========================+ -|:ref:`Thingy:91 ` |PCA20035 |thingy91_nrf52840 |``thingy91_nrf52840`` | +|:ref:`Thingy:91 ` |PCA20035 |thingy91 |``thingy91/nrf52840`` | +--------------------------------+-----------+------------------+---------------------------+ .. set17_end @@ -258,9 +258,9 @@ Set used by Tests (Crypto) +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160_ns`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160/ns`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set18_end @@ -272,9 +272,9 @@ Set used by sample (SPM) +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set19_end @@ -286,7 +286,7 @@ Set used by DTM sample +--------------------------------+-----------+------------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpunet`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpunet`` | +--------------------------------+-----------+------------------------------------------------+--------------------------------+ .. set20_end @@ -298,9 +298,9 @@ Set used by sample (nRF RPC Entropy) +--------------------------------+-----------+-----------------------------------------------+--------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+===============================================+================================+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | | | | | | -| | | |``nrf5340dk_nrf5340_cpunet`` | +| | | |``nrf5340dk/nrf5340/cpunet`` | +--------------------------------+-----------+-----------------------------------------------+--------------------------------+ @@ -313,13 +313,13 @@ Set used by samples (low power UART driver) +--------------------------------+-----------+------------------------------------------------+-------------------------------+ |Hardware platforms |PCA |Board name |Build target | +================================+===========+================================================+===============================+ -|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk_nrf9160 ` |``nrf9160dk_nrf9160`` | +|:ref:`nRF9160 DK ` |PCA10090 |:ref:`nrf9160dk ` |``nrf9160dk/nrf9160`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk_nrf52840 `|``nrf52840dk_nrf52840`` | +|:ref:`nRF52840 DK ` |PCA10056 |:ref:`nrf52840dk ` |``nrf52840dk/nrf52840`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk_nrf52832 ` |``nrf52dk_nrf52832`` | +|:ref:`nRF52 DK ` |PCA10040 |:ref:`nrf52dk ` |``nrf52dk/nrf52832`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ -|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk_nrf5340 ` |``nrf5340dk_nrf5340_cpuapp`` | +|:ref:`nRF5340 DK ` |PCA10095 |:ref:`nrf5340dk ` |``nrf5340dk/nrf5340/cpuapp`` | +--------------------------------+-----------+------------------------------------------------+-------------------------------+ .. set22_end diff --git a/doc/nrf/includes/sample_board_rows.txt b/doc/nrf/includes/sample_board_rows.txt index 15bc27259cfd..d2db212cd6dc 100644 --- a/doc/nrf/includes/sample_board_rows.txt +++ b/doc/nrf/includes/sample_board_rows.txt @@ -4,203 +4,203 @@ .. nrf52dk_nrf52832 -| :ref:`nRF52 DK ` | PCA10040 | :ref:`nrf52dk_nrf52832 ` | ``nrf52dk_nrf52832`` | +| :ref:`nRF52 DK ` | PCA10040 | :ref:`nrf52dk ` | ``nrf52dk/nrf52832`` | .. nrf52840dk_nrf52840 -| :ref:`nRF52840 DK ` | PCA10056 | :ref:`nrf52840dk_nrf52840 ` | ``nrf52840dk_nrf52840`` | +| :ref:`nRF52840 DK ` | PCA10056 | :ref:`nrf52840dk ` | ``nrf52840dk/nrf52840`` | .. nrf52840dongle_nrf52840 -| :ref:`nRF52840 Dongle ` | PCA10059 | :ref:`nrf52840dongle_nrf52840 ` | ``nrf52840dongle_nrf52840`` | +| :ref:`nRF52840 Dongle ` | PCA10059 | :ref:`nrf52840dongle ` | ``nrf52840dongle/nrf52840`` | .. nrf9160dk_nrf9160 -| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk_nrf9160 ` | ``nrf9160dk_nrf9160`` | +| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk ` | ``nrf9160dk/nrf9160`` | .. nrf9160dk_nrf9160_ns -| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk_nrf9160 ` | ``nrf9160dk_nrf9160_ns`` | +| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk ` | ``nrf9160dk/nrf9160/ns`` | .. nrf9160dk_nrf9160_and_ns -| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk_nrf9160 ` | ``nrf9160dk_nrf9160`` | -| | | | | -| | | | ``nrf9160dk_nrf9160_ns`` | +| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk ` | ``nrf9160dk/nrf9160`` | +| | | | | +| | | | ``nrf9160dk/nrf9160_ns`` | .. nrf9160dk_nrf52840 -| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk_nrf52840 ` | ``nrf9160dk_nrf52840`` | +| :ref:`nRF9160 DK ` | PCA10090 | :ref:`nrf9160dk ` | ``nrf9160dk/nrf52840`` | .. nrf9161dk_nrf9161 -| :ref:`nRF9161 DK ` | PCA10153 | :ref:`nrf9161dk_nrf9161 ` | ``nrf9161dk_nrf9161`` | +| :ref:`nRF9161 DK ` | PCA10153 | :ref:`nrf9161dk ` | ``nrf9161dk/nrf9161`` | .. nrf9161dk_nrf9161_ns -| :ref:`nRF9161 DK ` | PCA10153 | :ref:`nrf9161dk_nrf9161 ` | ``nrf9161dk_nrf9161_ns`` | +| :ref:`nRF9161 DK ` | PCA10153 | :ref:`nrf9161dk ` | ``nrf9161dk/nrf9161/ns`` | .. nrf9131ek_nrf9131 -| nRF9131 EK | PCA10165 | :ref:`nrf9131ek_nrf9131 ` | ``nrf9131ek_nrf9131`` | +| nRF9131 EK | PCA10165 | :ref:`nrf9131ek ` | ``nrf9131ek/nrf9131`` | .. nrf9131ek_nrf9131_ns -| nRF9131 EK | PCA10165 | :ref:`nrf9131ek_nrf9131 ` | ``nrf9131ek_nrf9131_ns`` | +| nRF9131 EK | PCA10165 | :ref:`nrf9131ek ` | ``nrf9131ek/nrf9131/ns`` | .. nrf9151dk_nrf9151 -| nRF9151 DK | PCA10171 | :ref:`nrf9151dk_nrf9151 ` | ``nrf9151dk_nrf9151`` | +| nRF9151 DK | PCA10171 | :ref:`nrf9151dk ` | ``nrf9151dk/nrf9151`` | .. nrf9151dk_nrf9151_ns -| nRF9151 DK | PCA10171 | :ref:`nrf9151dk_nrf9151 ` | ``nrf9151dk_nrf9151_ns`` | +| nRF9151 DK | PCA10171 | :ref:`nrf9151dk ` | ``nrf9151dk/nrf9151/ns`` | .. nrf5340dk_nrf5340_cpuapp -| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpuapp`` | +| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpuapp`` | .. nrf5340dk_nrf5340_cpuapp_ns -| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpuapp_ns`` | +| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpuapp/ns`` | .. nrf5340dk_nrf5340_cpunet -| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpunet`` | +| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpunet`` | .. nrf52833dk_nrf52833 -| :ref:`nRF52833 DK ` | PCA10100 | :ref:`nrf52833dk_nrf52833 ` | ``nrf52833dk_nrf52833`` | +| :ref:`nRF52833 DK ` | PCA10100 | :ref:`nrf52833dk ` | ``nrf52833dk/nrf52833`` | .. nrf52833dongle_nrf52833 -| nRF52833 Dongle | PCA10111 | nrf52833dongle_nrf52833 | ``nrf52833dongle_nrf52833`` | +| nRF52833 Dongle | PCA10111 | nrf52833dongle | ``nrf52833dongle/nrf52833`` | .. nrf52833dk_nrf52820 -| :ref:`nRF52833 DK (emulating nRF52820) ` | PCA10100 | :ref:`nrf52833dk_nrf52820 ` | ``nrf52833dk_nrf52820`` | +| :ref:`nRF52833 DK (emulating nRF52820) ` | PCA10100 | :ref:`nrf52833dk ` | ``nrf52833dk/nrf52820`` | .. nrf52820dongle_nrf52820 -| nRF52820 Dongle | PCA10114 | nrf52820dongle_nrf52820 | ``nrf52820dongle_nrf52820`` | +| nRF52820 Dongle | PCA10114 | nrf52820dongle | ``nrf52820dongle/nrf52820`` | .. thingy91_nrf9160 -| :ref:`Thingy:91 ` | PCA20035 | thingy91_nrf9160 | ``thingy91_nrf9160`` | +| :ref:`Thingy:91 ` | PCA20035 | thingy91 | ``thingy91/nrf9160`` | .. thingy91_nrf9160_ns -| :ref:`Thingy:91 ` | PCA20035 | thingy91_nrf9160 | ``thingy91_nrf9160_ns`` | +| :ref:`Thingy:91 ` | PCA20035 | thingy91 | ``thingy91/nrf9160/ns`` | .. nrf52dk_nrf52810 -| :ref:`nRF52 DK (emulating nRF52810) ` | PCA10040 | :ref:`nrf52dk_nrf52810 ` | ``nrf52dk_nrf52810`` | +| :ref:`nRF52 DK (emulating nRF52810) ` | PCA10040 | :ref:`nrf52dk ` | ``nrf52dk/nrf52810`` | .. nrf52dk_nrf52805 -| :ref:`nRF52 DK (emulating nRF52805) ` | PCA10040 | :ref:`nrf52dk_nrf52805 ` | ``nrf52dk_nrf52805`` | +| :ref:`nRF52 DK (emulating nRF52805) ` | PCA10040 | :ref:`nrf52dk ` | ``nrf52dk/nrf52805`` | .. nrf52kbd_nrf52832 -| nRF52832 Desktop Keyboard | PCA20037 | nrf52kbd_nrf52832 | ``nrf52kbd_nrf52832`` | +| nRF52832 Desktop Keyboard | PCA20037 | nrf52kbd | ``nrf52kbd/nrf52832`` | .. nrf52840dk_nrf52811 -| :ref:`nRF52840 DK (emulating nRF52811) ` | PCA10056 | :ref:`nrf52840dk_nrf52811 ` | ``nrf52840dk_nrf52811`` | +| :ref:`nRF52840 DK (emulating nRF52811) ` | PCA10056 | :ref:`nrf52840dk ` | ``nrf52840dk/nrf52811`` | .. nrf52840gmouse_nrf52840 -| nRF52840 Gaming Mouse | PCA20041 | nrf52840gmouse_nrf52840 | ``nrf52840gmouse_nrf52840`` | +| nRF52840 Gaming Mouse | PCA20041 | nrf52840gmouse | ``nrf52840gmouse/nrf52840`` | .. nrf52dmouse_nrf52832 -| nRF52832 Desktop Mouse | PCA20044 | nrf52dmouse_nrf52832 | ``nrf52dmouse_nrf52832`` | +| nRF52832 Desktop Mouse | PCA20044 | nrf52dmouse | ``nrf52dmouse/nrf52832`` | .. nrf52810dmouse_nrf52810 -| nRF52810 Desktop Mouse | PCA20045 | nrf52810dmouse_nrf52810 | ``nrf52810dmouse_nrf52810`` | +| nRF52810 Desktop Mouse | PCA20045 | nrf52810dmouse | ``nrf52810dmouse/nrf52810`` | .. thingy91_nrf52840 -| :ref:`Thingy:91 ` | PCA20035 | thingy91_nrf52840 | ``thingy91_nrf52840`` | +| :ref:`Thingy:91 ` | PCA20035 | thingy91 | ``thingy91/nrf52840`` | .. nrf5340dk_nrf5340_cpuapp_and_cpuapp_ns -| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpuapp`` | -| | | | | -| | | | ``nrf5340dk_nrf5340_cpuapp_ns`` | +| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpuapp`` | +| | | | | +| | | | ``nrf5340dk/nrf5340/cpuapp/ns`` | .. nrf5340dk_nrf5340_cpuapp_and_cpunet -| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk_nrf5340 ` | ``nrf5340dk_nrf5340_cpuapp`` | -| | | | | -| | | | ``nrf5340dk_nrf5340_cpunet`` | +| :ref:`nRF5340 DK ` | PCA10095 | :ref:`nrf5340dk ` | ``nrf5340dk/nrf5340/cpuapp`` | +| | | | | +| | | | ``nrf5340dk/nrf5340/cpunet`` | .. nrf5340_audio_dk_nrf5340 -| `nRF5340 Audio DK `_ | PCA10121 revision 1.0.0 or above | :ref:`nrf5340_audio_dk_nrf5340 ` | ``nrf5340_audio_dk_nrf5340_cpuapp`` | +| `nRF5340 Audio DK `_ | PCA10121 revision 1.0.0 or above | :ref:`nrf5340_audio_dk ` | ``nrf5340_audio_dk/nrf5340/cpuapp`` | .. nrf21540dk_nrf52840 -| :ref:`nRF21540 DK ` | PCA10112 | :ref:`nrf21540dk_nrf52840 ` | ``nrf21540dk_nrf52840`` | +| :ref:`nRF21540 DK ` | PCA10112 | :ref:`nrf21540dk ` | ``nrf21540dk/nrf52840`` | .. thingy52_nrf52832 -| Thingy:52 | PCA20020 | :ref:`thingy52_nrf52832 ` | ``thingy52_nrf52832`` | +| Thingy:52 | PCA20020 | :ref:`thingy52 ` | ``thingy52/nrf52832`` | .. thingy53_nrf5340_cpuapp -| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53_nrf5340 ` | ``thingy53_nrf5340_cpuapp`` | +| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53 ` | ``thingy53/nrf5340/cpuapp`` | .. thingy53_nrf5340_cpuapp_ns -| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53_nrf5340 ` | ``thingy53_nrf5340_cpuapp_ns`` | +| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53 ` | ``thingy53/nrf5340/cpuapp/ns`` | .. thingy53_nrf5340_cpuapp_and_cpuapp_ns -| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53_nrf5340 ` | ``thingy53_nrf5340_cpuapp`` | -| | | | | -| | | | ``thingy53_nrf5340_cpuapp_ns`` | +| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53 ` | ``thingy53/nrf5340/cpuapp`` | +| | | | | +| | | | ``thingy53/nrf5340/cpuapp/ns`` | .. thingy53_nrf5340_cpunet -| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53_nrf5340 ` | ``thingy53_nrf5340_cpunet`` | +| :ref:`Thingy:53 ` | PCA20053 | :ref:`thingy53 ` | ``thingy53/nrf5340/cpunet`` | .. nrf7002dk_nrf5340_cpuapp -| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk_nrf5340 ` | ``nrf7002dk_nrf5340_cpuapp`` | +| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpuapp`` | .. nrf7002dk_nrf5340_cpuapp_ns -| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk_nrf5340 ` | ``nrf7002dk_nrf5340_cpuapp_ns`` | +| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpuapp/ns`` | .. nrf7002dk_nrf5340_cpunet -| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk_nrf5340 ` | ``nrf7002dk_nrf5340_cpunet`` | +| :ref:`nRF7002 DK ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpunet`` | -.. nrf7002dk_nrf7001_nrf5340_cpuapp +.. nrf7002dk_nrf5340_cpuapp_nrf7001 -| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk_nrf7001_nrf5340 ` | ``nrf7002dk_nrf7001_nrf5340_cpuapp`` | +| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpuapp/nrf7001`` | -.. nrf7002dk_nrf7001_nrf5340_cpuapp_ns +.. nrf7002dk_nrf5340_cpuapp_nrf7001_ns -| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk_nrf7001_nrf5340 ` | ``nrf7002dk_nrf7001_nrf5340_cpuapp_ns`` | +| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpuapp/nrf7001/ns`` | -.. nrf7002dk_nrf7001_nrf5340_cpunet +.. nrf7002dk_nrf5340_cpunet_nrf7001 -| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk_nrf7001_nrf5340 ` | ``nrf7002dk_nrf7001_nrf5340_cpunet`` | +| :ref:`nRF7002 DK (emulating nRF7001) ` | PCA10143 | :ref:`nrf7002dk ` | ``nrf7002dk/nrf5340/cpunet/nrf7001`` | -.. nrf54h20pdk_nrf54h20_cpuapp +.. nrf54h20dk_nrf54h20_cpuapp -| :ref:`nRF54H20 PDK ` | PCA10145 | :ref:`nrf54h20pdk_nrf54h20_cpuapp ` | ``nrf54h20pdk_nrf54h20_cpuapp`` | +| :ref:`nRF54H20 DK ` | PCA10175 | :ref:`nrf54h20dk ` | ``nrf54h20dk/nrf54h20/cpuapp`` | -.. nrf54h20pdk_nrf54h20_cpurad +.. nrf54h20dk_nrf54h20_cpurad -| :ref:`nRF54H20 PDK ` | PCA10145 | :ref:`nrf54h20pdk_nrf54h20_cpurad ` | ``nrf54h20pdk_nrf54h20_cpurad`` | +| :ref:`nRF54H20 DK ` | PCA10175 | :ref:`nrf54h20dk ` | ``nrf54h20dk/nrf54h20/cpurad`` | -.. nrf54h20pdk_nrf54h20_cpuppr +.. nrf54h20dk_nrf54h20_cpuppr -| :ref:`nRF54H20 PDK ` | PCA10145 | :ref:`nrf54h20pdk_nrf54h20_cpuppr ` | ``nrf54h20pdk_nrf54h20_cpuppr`` | +| :ref:`nRF54H20 DK ` | PCA10175 | :ref:`nrf54h20dk ` | ``nrf54h20dk/nrf54h20/cpuppr`` | .. native_posix @@ -212,8 +212,12 @@ .. nrf54l15pdk_nrf54l15_cpuapp -| :ref:`nRF54L15 PDK ` | | ``nrf54l15pdk_nrf54l15_cpuapp`` | ``nrf54l15pdk_nrf54l15_cpuapp`` | +| :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk/nrf54l15/cpuapp`` | .. nrf54l15pdk_nrf54l15_cpuapp_ns -| :ref:`nRF54L15 PDK ` | | ``nrf54l15pdk_nrf54l15_cpuapp`` | ``nrf54l15pdk_nrf54l15_cpuapp_ns`` | +| :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk_nrf54l15 ` | ``nrf54l15pdk_nrf54l15_cpuapp_ns`` | + +.. nrf54l15pdk@0.3.0_nrf54l15_cpuapp + +| :ref:`nRF54L15 PDK ` | PCA10156 | :ref:`nrf54l15pdk ` | ``nrf54l15pdk@0.3.0/nrf54l15/cpuapp`` | diff --git a/doc/nrf/includes/sample_dtm_radio_test_fem.txt b/doc/nrf/includes/sample_dtm_radio_test_fem.txt index 5c5f5602d7ca..d5fecbb0d01a 100644 --- a/doc/nrf/includes/sample_dtm_radio_test_fem.txt +++ b/doc/nrf/includes/sample_dtm_radio_test_fem.txt @@ -11,7 +11,7 @@ For example, to build the sample from the command line for an nRF5340 DK with an .. code-block:: console - west build -b nrf5340dk_nrf5340_cpunet -- -DSHIELD=nrf21540ek + west build -b nrf5340dk/nrf5340/cpunet -- -DSHIELD=nrf21540ek For more details refer to the following documentation: diff --git a/doc/nrf/index.rst b/doc/nrf/index.rst index 73ac2e5d3fa8..774e712c823c 100644 --- a/doc/nrf/index.rst +++ b/doc/nrf/index.rst @@ -38,6 +38,7 @@ Varied reference designs :caption: Contents :hidden: + gsg_guides installation create_application config_and_build diff --git a/doc/nrf/installation.rst b/doc/nrf/installation.rst index 573019b650fc..9023374896d2 100644 --- a/doc/nrf/installation.rst +++ b/doc/nrf/installation.rst @@ -29,6 +29,6 @@ This repository is the manifest repository, because it contains the SDK's :ref:` :maxdepth: 2 :caption: Subpages: - installation/recommended_versions installation/install_ncs installation/updating + installation/recommended_versions diff --git a/doc/nrf/installation/install_ncs.rst b/doc/nrf/installation/install_ncs.rst index 3c5fbf63d855..59919acbebe2 100644 --- a/doc/nrf/installation/install_ncs.rst +++ b/doc/nrf/installation/install_ncs.rst @@ -25,7 +25,12 @@ Update operating system *********************** Before you start setting up the toolchain, install available updates for your operating system. -See :ref:`requirements` for information on the supported operating systems. + +.. 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: @@ -34,7 +39,7 @@ See :ref:`requirements` for information on the supported operating systems. Install prerequisites ********************* -Depending on your preferred development environment, install the required tools: +Depending on your preferred development environment, install the following required tools: .. tabs:: @@ -44,6 +49,7 @@ Depending on your preferred development environment, install the required tools: Download it from the `nRF Command Line Tools`_ 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. .. group-tab:: Command line @@ -59,6 +65,8 @@ Depending on your preferred development environment, install the required tools: .. note:: After downloading and installing the tools, add nrfjprog to the system :envvar:`PATH` in the environment variables. + * Linux users: `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: @@ -312,7 +320,7 @@ Set up the command-line build environment This step is only required when working on command line with freestanding applications. In addition to the steps mentioned above, if you want to build and program your application from the command line, you have to set up your command-line build environment by defining the required environment variables every time you open a new command-line or terminal window. -See :ref:`zephyr:important-build-vars` for more information about the various relevant environment variables. +See :ref:`zephyr:env_vars_important` in the Zephyr documentation for more information about the various relevant environment variables. Define the required environment variables as follows, depending on your operating system: @@ -364,7 +372,11 @@ It gives you more control over each of the required tools, but requires more fam To install the |NCS| system-wide, complete the following steps: -1. Follow steps 1 and 2 in Zephyr's :ref:`zephyr:getting_started` to update your operating system and install dependencies. +1. Follow the steps in the following sections of Zephyr's :ref:`zephyr:getting_started` to update your operating system and install dependencies: + + * :ref:`zephyr:host_setup` + * :ref:`zephyr:install-required-tools` + #. Install west. Expand the section below to see the commands. @@ -560,7 +572,7 @@ To install the |NCS| system-wide, complete the following steps: .. -#. Follow step 4 in Zephyr's :ref:`zephyr:getting_started` to install the Zephyr SDK. +#. Follow the steps in the "Install the Zephyr SDK" section in Zephyr's :ref:`zephyr:getting_started` to install the Zephyr SDK. #. Depending on your preferred development environment: * If you want to work with |VSC|, install the |nRFVSC| (the default IDE for the |NCS|). diff --git a/doc/nrf/installation/recommended_versions.rst b/doc/nrf/installation/recommended_versions.rst index d33085ea1b03..46e6f52f1f9a 100644 --- a/doc/nrf/installation/recommended_versions.rst +++ b/doc/nrf/installation/recommended_versions.rst @@ -1,18 +1,27 @@ .. _gs_recommended_versions: .. _requirements: -.. _gs_supported_OS: -.. _supported_OS: -Requirements -############ +Requirements reference +###################### .. contents:: :local: :depth: 2 +This page summarizes the requirements for installing and working with the |NCS|. +All of these requirements are installed when you :ref:`install the nRF Connect SDK `. + +.. _gs_supported_OS: +.. _supported_OS: + +Supported operating systems +*************************** + The |NCS| supports Microsoft Windows, Linux, and macOS for development. The following table shows the operating system versions that support the |NCS| tools: +.. os_table_start + .. list-table:: :header-rows: 1 @@ -57,6 +66,8 @@ The following table shows the operating system versions that support the |NCS| t - Tier 3 - Not supported +.. os_table_end + Tier definitions The table uses several tier definitions to categorize the level of operating system support: @@ -95,6 +106,7 @@ Zephyr features only available on Linux *************** The |NCS| :term:`toolchain` includes the Zephyr SDK and adds the necessary tools and modules to create |NCS| samples and applications on top of it. +The |NCS| toolchain is installed as one of the steps when :ref:`install_ncs`. .. note:: @@ -163,6 +175,8 @@ Other versions might also work, but are not verified. * - :ref:`west ` - :ncs-tool-version:`WEST_VERSION_LINUX` + Additionally, you need to install `nrf-udev`_ rules for accessing USB ports on Nordic Semiconductor devices and programming the firmware. + .. group-tab:: macOS .. list-table:: @@ -187,32 +201,35 @@ Other versions might also work, but are not verified. * - :ref:`west ` - :ncs-tool-version:`WEST_VERSION_DARWIN` -To check the list of installed packages and their versions, run the following command: +Checking tool versions + .. toggle:: -.. tabs:: + To check the list of installed packages and their versions, run the following command: - .. group-tab:: Windows + .. tabs:: - .. code-block:: console + .. group-tab:: Windows - choco list -lo + .. code-block:: console - .. group-tab:: Linux + choco list -lo - .. code-block:: console + Chocolatey is installed as part of the Zephyr SDK toolchain when you :ref:`install the nRF Connect SDK `. - apt list --installed + .. group-tab:: Linux - This command lists all packages installed on your system. - To list the version of a specific package, type its name and add ``--version``. + .. code-block:: console - .. group-tab:: macOS + apt list --installed - .. code-block:: console + This command lists all packages installed on your system. + To list the version of a specific package, type its name and add ``--version``. - brew list --versions + .. group-tab:: macOS + .. code-block:: console + brew list --versions .. _requirements_toolchain_python_deps: @@ -269,8 +286,8 @@ Building and running applications, samples, and tests Building documentation ---------------------- -Python documentation dependencies are listed in the following table. They can -all be installed using the ``doc/requirements.txt`` file using ``pip``. +Python documentation dependencies are listed in the following table. +They can all be installed using the ``doc/requirements.txt`` file using ``pip``. .. list-table:: :header-rows: 1 @@ -322,12 +339,15 @@ Among others, this package includes the following prerequisites for the |NCS|: * 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`. + .. _toolchain_management_tools: |NCS| toolchain management tools ******************************** Nordic Semiconductor provides proprietary |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`. |nRFVSC| ======== diff --git a/doc/nrf/integrations.rst b/doc/nrf/integrations.rst index 61a169d05dee..7ee011f6e4cd 100644 --- a/doc/nrf/integrations.rst +++ b/doc/nrf/integrations.rst @@ -22,3 +22,4 @@ The following user guides describe available integrations: external_comp/memfault external_comp/avsystem external_comp/nrf_cloud + external_comp/coremark diff --git a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/API_documentation.rst b/doc/nrf/libraries/bin/bt_ll_acs_nrf53/API_documentation.rst deleted file mode 100644 index 51243f097aee..000000000000 --- a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/API_documentation.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. _lib_bt_ll_acs_nrf53_api: - -API documentation -***************** - -.. contents:: - :local: - :depth: 2 - -| Header file: :file:`lib/bin/bt_ll_acs_nrf53/include/ble_hci_vsc.h` -| Source files: :file:`lib/bin/bt_ll_acs_nrf53/src/ble_hci_vsc.c` - -.. doxygengroup:: ble_hci_vsc_api - :project: nrf - :members: diff --git a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/CHANGELOG.rst b/doc/nrf/libraries/bin/bt_ll_acs_nrf53/CHANGELOG.rst deleted file mode 100644 index d2d33db74136..000000000000 --- a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/CHANGELOG.rst +++ /dev/null @@ -1,136 +0,0 @@ -.. _bt_ll_acs_nrf53_changelog: - -Changelog -######### - -.. contents:: - :local: - :depth: 2 - -Notable changes to this controller are documented in this file. - -Controller v18929 -***************** - -.. note:: - This controller is now :ref:`deprecated `. Before it is removed, make sure to transition to using :ref:`softdevice_controller`. - -The following changes have been introduced in the v18929 of the controller: - -Changes -======= - -* Fixed a bug where the right headset would disconnect when in bidirectional mode. - -Controller v17933 -***************** - -.. note:: - This controller is now :ref:`deprecated `. Before it is removed, make sure to transition to using :ref:`softdevice_controller`. - -The following changes have been introduced in the v17933 of the controller: - -Changes -======= - -* Improved the robustness for the CIS bidirectional four stream scenario (two sinks and two sources). -* Improved the stability for switching between the BIS and the CIS scenarios at runtime. -* Corrected the timestamps for BIS. -* Fixed the wrong Link Layer ID (LLID) from ISO empty packets. -* Corrected the disconnection reason for CIS. -* Pre-transmission offset (PTO) is not supported, but the sink will now accept ``PTO=0`` or ``PTO=1`` values and will not fail in either case. -* Optimized the CIS setup time. -* Bugfixes and stability improvements. - -Controller v3424 -**************** - -The following changes have been introduced in the v3424 of the controller: - -Changes -======= - -* Improved robustness of the timestamps (the SDU references) received together with the ISO data. -* Changed offset of the timestamps (the SDU references) received together with the ISO data to get correct presentation delay. -* Freed more pins for front-end module (FEM) control. -* Improved ACL and BIS coexistence on the same device. -* Fixed an issue where the peripheral did not always accept timing values from the same central. -* Fixed an issue where the PA sync skip parameter was not used. -* Fixed an issue where it was not possible to create BIG sync after terminating a pending BIG sync. - -Controller v3393 -**************** - -The following changes have been introduced in the v3393 of the controller: - -Changes -======= - -* Updated the controller code with major changes that improve performance on many levels. -* Fixed all failing EBQ tests for claiming the QDID. -* Fixed an issue where the timing of the TXEN FEM pin was wrong and would cause unwanted radio noise. -* Fixed timestamps that are returned when using the LE_READ_ISO_TX_SYNC HCI command. - - -Controller v3357 -**************** - -The following changes have been introduced in the v3357 of the controller: - -Changes -======= - -* Updated the controller to be able to read RSSI from the CIS ISO channel using the ``HCI_Read_RSSI`` HCI command. -* Fixed an issue where pins P0.28 to P0.31 cannot be allocated for controlling front-end modules (FEMs). -* Fixed an issue where the FEM control pins cannot work when the TX output power setting equals 0 dBm. - - -Controller v3349 -**************** - -The following changes have been introduced in the v3349 of the controller: - -Changes -======= - -* Fixed the Direct Test Mode (DTM), which was broken after version 3307. -* Fixed an issue where an update to the connection parameter could lead to a disconnection. -* Fixed an issue where the "stream stopped" and "disconnected" events would not be triggered. -* Fixed an issue where the controller would stop responding when a disconnection happened. - - -Controller v3330 -**************** - -The following changes have been introduced in the v3330 of the controller: - -Changes -======= - -* Fixed issue where resetting one headset caused the other to disconnect. - - -Controller v3322 -**************** - -The following changes have been introduced in the v3322 of the controller: - -Changes -======= - -* Improvements to support creating CIS connections in any order. -* Changes to accommodate BIS + ACL combinations. -* Basic support for interleaved broadcasts. - - -Known issues -************ - -See the :ref:`nRF5340 Audio application known issues ` for the list of known issues for the controller. - - -Limitations -*********** - -The controller is closely related to the nRF5340 Audio application. -See the :ref:`nRF5340 Audio application feature support table ` for the list of supported features and limitations. diff --git a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/index.rst b/doc/nrf/libraries/bin/bt_ll_acs_nrf53/index.rst deleted file mode 100644 index 7ce139330cc3..000000000000 --- a/doc/nrf/libraries/bin/bt_ll_acs_nrf53/index.rst +++ /dev/null @@ -1,101 +0,0 @@ -.. _lib_bt_ll_acs_nrf53_readme: - -LE Audio controller for nRF5340 -############################### - -.. warning:: - This LE Audio controller for nRF5340 is :ref:`deprecated `, no longer supported in |NCS| v2.6.0 and onwards, and will be removed in one of the future releases. - Use :ref:`SoftDevice Controller for LE Isochronous Channels ` instead. - -.. contents:: - :local: - :depth: 2 - -The LE Audio controller for nRF5340 is a link layer controller for the nRF5340 network core and is meant to be used with LE Audio applications. - -This controller is compatible with the HCI IPC driver provided by the |NCS| Bluetooth® :ref:`bt_hci_drivers` core. -When the communication between the application and the network core on a device is handled by the HCI IPC driver, this link layer controller can be used to handle time critical low level communication and the radio. - -.. le_audio_controller_qdid_start - -LE Audio controller for nRF5340 QDID - The LE Audio controller for nRF5340 associated with this version of the |NCS| comes with the QDID #181316. - -.. note:: - Because the LE Audio controller for nRF5340 has been :ref:`deprecated ` in the |NCS| v2.6.0, the software combination required for this QDID is no longer supported. - This controller will keep its QDID, but no further qualifications will be made. - -.. le_audio_controller_qdid_end - -Configuration -************* - -The controller can be enabled with the :Kconfig:option:`CONFIG_BT_LL_ACS_NRF53` set to ``y``. - -The number of Connected Isochronous Streams (CIS) you can use in a Connected Isochronous Group (CIG) and the number of Broadcast Isochronous Streams (BIS) you can use in a Broadcast Isochronous Group (BIG) are dependent on which configurations you use. -The most relevant configurations are bitrate and number of retransmissions. -See the `Capabilities for the LE Audio Controller Subsystem for nRF5340`_ document for matrix tables listing the supported CIS in a CIG and the supported BIS in a BIG. -These matrix tables are based on the Basic Audio Profile (BAP) tables. - -The controller has the following methods of configuration: - -* Standard Host-Controller Interface (HCI) commands -* Vendor-Specific commands (VSC) - -These are listed in :file:`ble_hci_vsc.h`. -See the :ref:`lib_bt_ll_acs_nrf53_api` for more information. - -Usage -***** - -This controller is provided as a HEX file and includes the LE Audio Controller Subsystem for nRF53. -Check the license file in the :file:`/bin` directory for usage conditions. - -The HEX file is to be used with the |NCS| version it is delivered with. -Other combinations are not tested and their behavior is undefined. - -When using the file, the controller is programmed to the network core of nRF5340. -Configurations and calls are handled through standard HCI and VSC. - -Samples using the library -************************* - -The :ref:`nrf53_audio_app` use the controller. - -Files -***** - -The network core for both gateway and headset versions of :ref:`nrf53_audio_app` is programmed with the precompiled Bluetooth Low Energy Controller binary file :file:`ble5-ctr-rpmsg_.hex`, where ** corresponds to the controller version, for example :file:`ble5-ctr-rpmsg_3216.hex`. -This file includes the LE Audio Controller Subsystem for nRF53. -If :ref:`DFU is enabled `, the subsystem's binary file will be generated in the :file:`build/zephyr/` directory and will be called :file:`net_core_app_signed.hex`. - -There are two other files in the :file:`/bin` directory: - -* :file:`ble5-ctr-rpmsg_shifted_.hex` which has been shifted to make space for MCUboot. -* :file:`ble5-ctr-rpmsg_shifted_min_.hex` which is the same as above, but made for minimum MCUboot. - -Also for these files, ** corresponds to the controller version. - -Limitations -*********** - -The controller is marked as :ref:`experimental `. - -This controller and the LE Audio Controller Subsystem for nRF5340 it includes has been tested and works in configurations used by the :ref:`nrf53_audio_app` (for example, 2 concurrent CIS, or BIS). -No other configurations than the ones used in the referenced application have been tested or documented for this library. - -When you :ref:`build an nRF5340 Audio application with the nRF21540 FEM support `, the LE Audio controller for nRF5340 does not support the +20 dBm setting. -This is because of a power class restriction in the controller's QDID. - -Dependencies -************ - -As the controller is provided precompiled in a binary format, there are no software dependencies. -In terms of hardware, this controller is only compatible with the nRF5340. - -.. toctree:: - :maxdepth: 1 - :caption: Subpages: - - API_documentation - CHANGELOG diff --git a/doc/nrf/libraries/bluetooth_services/adv_prov.rst b/doc/nrf/libraries/bluetooth_services/adv_prov.rst index 93fb294c0f5d..4aa78cf8356e 100644 --- a/doc/nrf/libraries/bluetooth_services/adv_prov.rst +++ b/doc/nrf/libraries/bluetooth_services/adv_prov.rst @@ -7,20 +7,20 @@ Bluetooth LE advertising providers :local: :depth: 2 -The Bluetooth LE advertising providers subsystem manages advertising data and scan response data. -The subsystem does not control Bluetooth LE advertising by itself. +The Bluetooth LE advertising providers library manages advertising data and scan response data. +It does not control Bluetooth LE advertising by itself. Overview ******** -The Bluetooth LE advertising providers subsystem acts as a middleware between data providers and a module that controls Bluetooth advertising. -The module that controls the Bluetooth advertising can use the subsystem's API to get advertising data and scan response data. -On the API call, the Bluetooth LE advertising providers subsystem gets data from providers and passes the data to the module that controls Bluetooth advertising. +The Bluetooth LE advertising providers library acts as a middleware between data providers and a module that controls Bluetooth advertising. +The module that controls the Bluetooth advertising can use the library's API to get advertising data and scan response data. +On the API call, the Bluetooth LE advertising providers library gets data from providers and passes the data to the module that controls Bluetooth advertising. Providers ========= -The subsystem gets both advertising data and scan response data from providers. +The library gets both advertising data and scan response data from providers. A provider manages a single element that is part of either advertising data or scan response data. The |NCS| provides a set of predefined data providers. @@ -42,7 +42,7 @@ Apart from filling the Bluetooth data structure, the provider can also perform a The error value of ``-ENOENT`` is used to inform that provider desists from providing data. In that case, the provider does not fill in the Bluetooth data structure. This error code is not forwarded to the module that controls Bluetooth LE advertising. - Other negative values denote provider-specific errors, which are forwarded directly to the module that controls Bluetooth LE advertising. + Other negative values denote provider-specific errors that are forwarded directly to the module that controls Bluetooth LE advertising. The provided Bluetooth data can depend on any of the following options: @@ -56,11 +56,11 @@ Examples of provider implementations can be found in the :file:`subsys/bluetooth Advertising control =================== -The Bluetooth LE advertising providers subsystem does not control Bluetooth LE advertising by itself. +The Bluetooth LE advertising providers library does not control Bluetooth LE advertising by itself. A separate module that controls Bluetooth advertising is mandatory. For example, :ref:`caf_ble_adv`, that is available in the |NCS|. An application can use this CAF module or implement an application-specific module that controls Bluetooth advertising. -The application then uses the Bluetooth LE advertising providers subsystem to manage advertising data and scan response data. +The application then uses the Bluetooth LE advertising providers library to manage advertising data and scan response data. Custom module ------------- @@ -79,7 +79,7 @@ See mentioned structures' documentation for detailed description of individual m Configuration ************* -Set :kconfig:option:`CONFIG_BT_ADV_PROV` to enable the Bluetooth LE advertising providers subsystem. +Set the :kconfig:option:`CONFIG_BT_ADV_PROV` Kconfig option to enable the Bluetooth LE advertising providers library. Predefined providers ==================== diff --git a/doc/nrf/libraries/bluetooth_services/gatt_pool.rst b/doc/nrf/libraries/bluetooth_services/gatt_pool.rst index 7fc8992aa4a4..365496b397a5 100644 --- a/doc/nrf/libraries/bluetooth_services/gatt_pool.rst +++ b/doc/nrf/libraries/bluetooth_services/gatt_pool.rst @@ -17,14 +17,14 @@ There are different types of attributes that can be registered to create a servi * CCC descriptor attribute, used for turning notifications for a characteristic on or off * Regular descriptor attribute, used for providing an additional description for a characteristic -The API of the GATT attribute pools module allows to register different types of GATT attributes listed above. +The API of the GATT attribute pools library allows to register different types of GATT attributes. After each registration, a part of the memory is reserved for each attribute. -You can also unregister unnecessary attributes using the module's API. +You can also unregister unnecessary attributes using the library's API. In this case, the previously reserved memory is released. This can be useful when you want to restructure your service by using the Service Changed feature that is supported by the Zephyr Bluetooth® stack (see, for example, the :ref:`hids_readme`). -Additionally, you can adjust the memory footprint of this module to your needs by changing the configuration options for the size of the module's memory pool. -If you are unsure about the proper values, print the module's statistics to see how the pool utilization level is affected by the chosen configuration. +Additionally, you can adjust the memory footprint of this library to your needs by changing the configuration options for the size of its memory pool. +If you are unsure about the proper values, print the statistics to see how the pool utilization level is affected by the chosen configuration. API documentation ***************** diff --git a/doc/nrf/libraries/bluetooth_services/mesh/light_ctrl_srv.rst b/doc/nrf/libraries/bluetooth_services/mesh/light_ctrl_srv.rst index a49b74d4dfe3..b69de777d266 100644 --- a/doc/nrf/libraries/bluetooth_services/mesh/light_ctrl_srv.rst +++ b/doc/nrf/libraries/bluetooth_services/mesh/light_ctrl_srv.rst @@ -19,7 +19,7 @@ The Light Lightness Control (LC) Server controls a single :ref:`bt_mesh_lightnes The state machine defines common behavior for a light fixture through three states, each with its own timing parameters and light levels. As input to its state machine, the Light LC Server listens for Sensor and OnOff messages. -In addition to the state machine, the Light LC Server may optionally use a regulator to control the ambient illuminance in the room. +In addition to the state machine, the Light LC Server may optionally use a regulator to control the ambient illuminance in the environment. The regulator requires illuminance sensor readings acting as feedback for its regulator loop. The Lightness Control Server is always disabled by default, and must be enabled by a :ref:`bt_mesh_light_ctrl_cli_readme`. @@ -86,10 +86,10 @@ Lightness state machine The Light LC Server's lightness state machine operates in the following states: Standby - There is no activity in the room, and the device's light are either off or dimmed. + There is no activity in the environment, and the lights are either off or dimmed. On - There is activity in the room, and the lights are on. + There is activity in the environment, and the lights are on. Prolong There is no activity detected. @@ -112,14 +112,17 @@ Timeout The state machine automatically moves into the next state. On - Toggled when a motion sensor is triggered or the On button is pressed on a light switch. + Toggled when the On button is pressed on a light switch. + +Occupancy On + Toggled when a motion sensor is triggered. Off Toggled when the Off button is pressed on a light switch. The On and Prolong states will start a timer as soon as the transition into the state is finished. When this timer expires, the state machine will automatically go into the next state. -If the On event is triggered while in the On state, the timer is reset, and the transition to the Prolong state is postponed. +If the On or Occupancy On event is triggered while in the On state, the timer is reset, and the transition to the Prolong state is postponed. .. figure:: images/bt_mesh_light_ctrl_states.svg :alt: Light Lightness Control Server state machine @@ -164,44 +167,50 @@ Target illuminance level External event triggers ----------------------- -While the Timeout event is controlled internally, the On and Off events are produced by external behavior. +While the Timeout event is controlled internally, the On, Occupancy On and Off events are produced by external behavior. On event ~~~~~~~~ -The On event lets the Light LC Server know that there is activity in the room. -It can be generated by light switches and sensors. +The On event can be generated by light switches. +Light switches can implement one of the following models to send On messages that turn the Light LC Server on: + +* The :ref:`bt_mesh_onoff_cli_readme` model, which should publish to the Light LC Server's extended Generic OnOff Server model. +* The :ref:`bt_mesh_light_ctrl_cli_readme` model, which should publish Light OnOff Set messages to the Light LC Server. -* Light switches can implement one of the following models to send On messages that turn the Light LC Server on: +.. _bt_mesh_light_ctrl_srv_occupancy_on_event: - * The :ref:`bt_mesh_onoff_cli_readme` model -- which should publish to the Light LC Server's extended Generic OnOff Server model. - * The :ref:`bt_mesh_light_ctrl_cli_readme` model -- which should publish Light OnOff Set messages to the Light LC Server. +Occupancy On event +~~~~~~~~~~~~~~~~~~ -* Occupancy sensors can also trigger the On event, depending on the current state and occupancy mode: +The Occupancy On event lets the Light LC Server know that there is activity in the sensor's proximity. +It can be generated by sensors. - * If the occupancy mode is enabled, sensor readings that indicate activity can trigger an On event at any time. - * If the occupancy mode is disabled, sensors cannot turn the lights on, but they will still prevent lights from turning off. +Occupancy sensors can trigger the Occupancy On event, depending on the current state and occupancy mode: -The following sensor types can also trigger the On event: +* If the occupancy mode is enabled, sensor readings that indicate activity can trigger an Occupancy On event at any time. +* If the occupancy mode is disabled, sensors cannot turn the lights on, but they will still prevent lights from turning off. + +The following sensor types can also trigger the Occupancy On event: Motion sensed - :c:var:`bt_mesh_sensor_motion_sensed` - Any sensor value higher than 0 triggers an On event in the Light LC Server state machine. - Messages with a value of 0 are ignored. + Any sensor value higher than ``0`` triggers an Occupancy On event in the Light LC Server state machine. + Messages with a value of ``0`` are ignored. People count - :c:var:`bt_mesh_sensor_people_count` - Any sensor value higher than ``0`` triggers an On event in the Light LC Server state machine. + Any sensor value higher than ``0`` triggers an Occupancy On event in the Light LC Server state machine. Messages with a value of ``0`` are ignored. Presence detected - :c:var:`bt_mesh_sensor_presence_detected` - Messages with a ``true`` value triggers an On event in the Light LC Server state machine. + Messages with a ``true`` value triggers an Occupancy On event in the Light LC Server state machine. Messages with a ``false`` value are ignored. Time since motion sensed - :c:var:`bt_mesh_sensor_time_since_motion_sensed` - When the sensor's *Time since motion sensed* value is lower than the Light LC Server's occupancy delay, the Light LC Server starts a timer that expires at the time equal to *Motion sensed* plus *occupancy delay*. - When this timer expires, an On event is generated. + When the sensor's :c:var:`bt_mesh_sensor_time_since_motion_sensed` value is lower than the Light LC Server's occupancy delay, the Light LC Server starts a timer that expires at the time equal to motion sensed plus occupancy delay. + When this timer expires, an Occupancy On event is generated. .. note:: - Only sensors reporting the *Time since motion sensed* type will be affected by the occupancy delay. + Only sensors reporting the :c:var:`bt_mesh_sensor_time_since_motion_sensed` sensor type will be affected by the occupancy delay. Other sensor triggers are always instantaneous. Off event diff --git a/doc/nrf/libraries/bluetooth_services/mesh/sensor_srv.rst b/doc/nrf/libraries/bluetooth_services/mesh/sensor_srv.rst index d4d2475bf320..0462e6c2b727 100644 --- a/doc/nrf/libraries/bluetooth_services/mesh/sensor_srv.rst +++ b/doc/nrf/libraries/bluetooth_services/mesh/sensor_srv.rst @@ -70,6 +70,8 @@ Extended models None. +.. _bt_mesh_sensor_srv_persistent_readme: + Persistent storage ================== diff --git a/doc/nrf/libraries/bluetooth_services/rpc.rst b/doc/nrf/libraries/bluetooth_services/rpc.rst index fd6f1c57eb9b..a21536b61ebe 100644 --- a/doc/nrf/libraries/bluetooth_services/rpc.rst +++ b/doc/nrf/libraries/bluetooth_services/rpc.rst @@ -7,71 +7,81 @@ Bluetooth Low Energy Remote Procedure Call :local: :depth: 2 -The |NCS| supports Bluetooth® Low Energy (LE) stack serialization. -The full Bluetooth LE stack can run on another device or CPU, such as the nRF5340 DK network core using the :ref:`nrfxlib:nrf_rpc`. +The Bluetooth® Low Energy Remote Procedure Call (RPC) solution is a set of libraries that allows using the Bluetooth Low Energy stack running entirely on a separate device or CPU. -Network core -************ +Overview +******** -The :ref:`ble_rpc_host` sample is designed specifically to enable the Bluetooth LE stack functionality on a remote MCU (for example, the nRF5340 network core) using the :ref:`nrfxlib:nrf_rpc`. -You can program this sample to the network core to run standard Bluetooth Low Energy samples on the nRF5340 DK. -You can use either the SoftDevice Controller or the Zephyr Bluetooth LE Controller for this sample. +The solution allows calling the Bluetooth Low Energy API on a different CPU or device. +This is accomplished by running a full Bluetooth Low Energy stack on one device and serializing the API from another device. +Use this solution when you do not want your firmware to include the Bluetooth stack, for example to offload the application CPU, save memory, or to be able to build your application in a different environment. -Application core -**************** +Implementation +============== -To use the Bluetooth LE stack through nRF RPC, an additional configuration is needed. -When building samples for the application core, enable the :kconfig:option:`CONFIG_BT_RPC_STACK` Kconfig option to run the Bluetooth LE stack on the network core. -This option builds :ref:`ble_rpc_host` automatically as a child image. -For more details, see :ref:`ug_nrf5340_building`. +The Bluetooth Low Energy RPC is a solution that consists of the following components: -Open a command prompt in the build folder of the application sample and enter the following command to build the application for the application core, with :ref:`ble_rpc_host` as child image: + * Bluetooth RPC Client and common software libraries that serialize the Bluetooth Host API and enable RPC communication. + These libraries need to be part of the user application. + * :ref:`ble_rpc_host` sample that includes the full configured Bluetooth Low Energy stack, Bluetooth RPC Host, and common libraries that enable communication with the Bluetooth RPC Client. + This software includes the :ref:`ug_ble_controller` and needs to run on a device or CPU that has the radio hardware peripheral, for example nRF5340 network core. + * Build system files that automate building a Bluetooth LE application in the RPC variant with the additional image containing the Bluetooth LE stack. -.. code-block:: console +You can add support for serializing Bluetooth-related custom APIs by implementing your own client and host procedures. +You can use the following files as examples: - west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC_STACK=y + * :file:`subsys/bluetooth/rpc/client/bt_rpc_conn_client.c` + * :file:`subsys/bluetooth/rpc/host/bt_rpc_conn_host.c` + +Supported backends +================== + +The library supports the following two Bluetooth Low Energy controllers: + + * :ref:`zephyr:bluetooth-ctlr-arch` + * :ref:`softdevice_controller` Requirements ************ -Some configuration options related to Bluetooth LE must be the same on the host (network core) and client (application core). -Set the following options in the same way for the :ref:`ble_rpc_host` and application core sample: - - * :kconfig:option:`CONFIG_BT_CENTRAL` - * :kconfig:option:`CONFIG_BT_PERIPHERAL` - * :kconfig:option:`CONFIG_BT_FILTER_ACCEPT_LIST` - * :kconfig:option:`CONFIG_BT_USER_PHY_UPDATE` - * :kconfig:option:`CONFIG_BT_USER_DATA_LEN_UPDATE` - * :kconfig:option:`CONFIG_BT_PRIVACY` - * :kconfig:option:`CONFIG_BT_SCAN_WITH_IDENTITY` - * :kconfig:option:`CONFIG_BT_REMOTE_VERSION` - * :kconfig:option:`CONFIG_BT_SMP` - * :kconfig:option:`CONFIG_BT_CONN` - * :kconfig:option:`CONFIG_BT_REMOTE_INFO` - * :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` - * :kconfig:option:`CONFIG_BT_SMP_APP_PAIRING_ACCEPT` - * :kconfig:option:`CONFIG_BT_EXT_ADV` - * :kconfig:option:`CONFIG_BT_OBSERVER` - * :kconfig:option:`CONFIG_BT_ECC` - * :kconfig:option:`CONFIG_BT_DEVICE_NAME_DYNAMIC` - * :kconfig:option:`CONFIG_BT_SMP_SC_PAIR_ONLY` - * :kconfig:option:`CONFIG_BT_PER_ADV` - * :kconfig:option:`CONFIG_BT_PER_ADV_SYNC` - * :kconfig:option:`CONFIG_BT_MAX_PAIRED` - * :kconfig:option:`CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` - * :kconfig:option:`CONFIG_BT_BROADCASTER` - * :kconfig:option:`CONFIG_BT_SETTINGS` - * :kconfig:option:`CONFIG_BT_GATT_CLIENT` - * :kconfig:option:`CONFIG_BT_RPC_INTERNAL_FUNCTIONS` - * :kconfig:option:`CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC` - * :kconfig:option:`CONFIG_BT_MAX_CONN` - * :kconfig:option:`CONFIG_BT_ID_MAX` - * :kconfig:option:`CONFIG_BT_EXT_ADV_MAX_ADV_SET` - * :kconfig:option:`CONFIG_BT_DEVICE_NAME_MAX` - * :kconfig:option:`CONFIG_BT_PER_ADV_SYNC_MAX` - * :kconfig:option:`CONFIG_BT_DEVICE_APPEARANCE` - * :kconfig:option:`CONFIG_BT_DEVICE_NAME` - * :kconfig:option:`CONFIG_CBKPROXY_OUT_SLOTS` on one core must be equal to :kconfig:option:`CONFIG_CBKPROXY_IN_SLOTS` on the other. +Some configuration options related to Bluetooth Low Energy must be the same on the host and client. +Set the following options in the same way for the :ref:`ble_rpc_host` and application core: + + * :kconfig:option:`CONFIG_BT_CENTRAL` + * :kconfig:option:`CONFIG_BT_PERIPHERAL` + * :kconfig:option:`CONFIG_BT_FILTER_ACCEPT_LIST` + * :kconfig:option:`CONFIG_BT_USER_PHY_UPDATE` + * :kconfig:option:`CONFIG_BT_USER_DATA_LEN_UPDATE` + * :kconfig:option:`CONFIG_BT_PRIVACY` + * :kconfig:option:`CONFIG_BT_SCAN_WITH_IDENTITY` + * :kconfig:option:`CONFIG_BT_REMOTE_VERSION` + * :kconfig:option:`CONFIG_BT_SMP` + * :kconfig:option:`CONFIG_BT_CONN` - hidden option that depends on :kconfig:option:`CONFIG_BT_CENTRAL` or :kconfig:option:`CONFIG_BT_PERIPHERAL`. + * :kconfig:option:`CONFIG_BT_REMOTE_INFO` + * :kconfig:option:`CONFIG_BT_FIXED_PASSKEY` + * :kconfig:option:`CONFIG_BT_SMP_APP_PAIRING_ACCEPT` + * :kconfig:option:`CONFIG_BT_EXT_ADV` + * :kconfig:option:`CONFIG_BT_OBSERVER` + * :kconfig:option:`CONFIG_BT_ECC` + * :kconfig:option:`CONFIG_BT_DEVICE_NAME_DYNAMIC` + * :kconfig:option:`CONFIG_BT_SMP_SC_PAIR_ONLY` + * :kconfig:option:`CONFIG_BT_PER_ADV` + * :kconfig:option:`CONFIG_BT_PER_ADV_SYNC` + * :kconfig:option:`CONFIG_BT_MAX_PAIRED` + * :kconfig:option:`CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` + * :kconfig:option:`CONFIG_BT_BROADCASTER` + * :kconfig:option:`CONFIG_BT_SETTINGS` + * :kconfig:option:`CONFIG_BT_GATT_CLIENT` + * :kconfig:option:`CONFIG_BT_RPC_INTERNAL_FUNCTIONS` + * :kconfig:option:`CONFIG_BT_DEVICE_APPEARANCE_DYNAMIC` + * :kconfig:option:`CONFIG_BT_MAX_CONN` + * :kconfig:option:`CONFIG_BT_ID_MAX` + * :kconfig:option:`CONFIG_BT_EXT_ADV_MAX_ADV_SET` + * :kconfig:option:`CONFIG_BT_DEVICE_NAME_MAX` + * :kconfig:option:`CONFIG_BT_PER_ADV_SYNC_MAX` + * :kconfig:option:`CONFIG_BT_DEVICE_APPEARANCE` + * :kconfig:option:`CONFIG_BT_DEVICE_NAME` + * :kconfig:option:`CONFIG_CBKPROXY_OUT_SLOTS` on one core must be equal to :kconfig:option:`CONFIG_CBKPROXY_IN_SLOTS` on the other. To keep all the above configuration options in sync, create an overlay file that is shared between the application and network core. Then, you can invoke build command like this: @@ -79,29 +89,93 @@ Then, you can invoke build command like this: .. parsed-literal:: :class: highlight - west build -b *board* -- -DOVERLAY_CONFIG=my_overlay_file.conf + west build -b *board* -- -DEXTRA_CONF_FILE=my_overlay_file.conf + +Configuration +************* + +Set the :kconfig:option:`CONFIG_BT_RPC_STACK` Kconfig option to enable the Bluetooth Low Energy RPC library. +Build the application using the following command: + +.. code-block:: console + + west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC_STACK=y + +Additionally, you can use the following options: + + * :kconfig:option:`CONFIG_BT_RPC` + * :kconfig:option:`CONFIG_BT_RPC_CLIENT` + * :kconfig:option:`CONFIG_BT_RPC_HOST` + * :kconfig:option:`CONFIG_BT_RPC_STACK` + * :kconfig:option:`CONFIG_BT_RPC_INITIALIZE_NRF_RPC` + * :kconfig:option:`CONFIG_BT_RPC_GATT_SRV_MAX` + * :kconfig:option:`CONFIG_BT_RPC_GATT_BUFFER_SIZE` + * :kconfig:option:`CONFIG_BT_RPC_INTERNAL_FUNCTIONS` + * :kconfig:option:`CONFIG_CBKPROXY_OUT_SLOTS` + * :kconfig:option:`CONFIG_CBKPROXY_IN_SLOTS` + +For more details, see the Kconfig option description. + +Samples using the library +************************* + +The following |NCS| sample and application use this library: + +* :ref:`ble_rpc_host` +* :ref:`ipc_radio` + +The :ref:`ble_rpc_host` sample exposes the Bluetooth LE stack functionality that runs on an MCU with radio (for example, the nRF5340 network core) to another CPU using the :ref:`nrfxlib:nrf_rpc`. +When building samples for the application core, enable the :kconfig:option:`CONFIG_BT_RPC_STACK` Kconfig option to run the Bluetooth LE stack on the network core. +This option builds :ref:`ble_rpc_host` automatically as a child image. +For more details, see :ref:`ug_nrf5340_building`. + +The :ref:`ipc_radio` application is an alternative to the :ref:`ble_rpc_host` sample. + +Limitations +*********** + +The library currently supports serialization of the following: + + * :ref:`zephyr:bt_gap` + * :ref:`zephyr:bluetooth_connection_mgmt` + * :ref:`zephyr:bt_gatt` + * :ref:`Bluetooth Cryptography ` + +The behavior of the Bluetooth implementation is almost the same as Zephyr's with the following exceptions: + + * The latency is longer because of the overhead for exchanging messages between cores. + The Bluetooth LE API is not strictly real-time by design, so the additional latency introduced by the IPC communication should be acceptable in most applications. + To reduce the latency, consider using a different transport backend for nRF RPC. + See :ref:`nrf_rpc_architecture` for details. + * Using advanced Bluetooth LE configurations, such as multiple simultaneous connections or advanced security features can be a limitation, because the child image (:ref:`ble_rpc_host` or :ref:`ipc_radio`) might require significantly more memory than the MCU it runs on has available. + Typically, network or radio cores are more memory-constrained than the application MCU. + * The :c:func:`bt_gatt_cancel` function is not implemented. + * The ``flags`` field of the :c:struct:`bt_gatt_subscribe_params` structure is atomic, so it cannot be correctly handled by the nRF RPC. + The library implements the following workaround for it: + + * All ``flags`` are sent to the network core when either the :c:func:`bt_gatt_subscribe` or :c:func:`bt_gatt_resubscribe` function is called. + This covers most of the cases, because the ``flags`` are normally set once before those functions calls. + * If you want to read or write the ``flags`` after the subscription, you have to call :c:func:`bt_rpc_gatt_subscribe_flag_set`, :c:func:`bt_rpc_gatt_subscribe_flag_clear`, or :c:func:`bt_rpc_gatt_subscribe_flag_get`. + +Dependencies +************ + +The library has the following dependencies: + + * :ref:`nrf_rpc` + * :ref:`bluetooth` .. _ble_rpc_api: API documentation ***************** -This library does not define a new API. -Instead, it uses Zephyr's Bluetooth API. -The |NCS| currently supports serialization of the following: - -* :ref:`zephyr:bt_gap` -* :ref:`zephyr:bluetooth_connection_mgmt` -* :ref:`zephyr:bt_gatt` -* :ref:`Bluetooth Cryptography ` - -The behavior of the implementation is almost the same as Zephyr's with the following exceptions: +This library does not define a new Bluetooth API except for ``flags`` modification. +Instead, it uses Zephyr's :ref:`zephyr:bluetooth_api`. -* The latency is longer because of the overhead for exchanging messages between cores. -* The :c:func:`bt_gatt_cancel` function is not implemented. -* The ``flags`` field of the :c:struct:`bt_gatt_subscribe_params` structure is atomic, so it cannot be correctly handled by the nRF RPC. - The library implements the following workaround for it: +| Header file: :file:`include/bluetooth/bt_rpc.h` +| Source files: :file:`subsys/bluetooth/rpc/` - * All ``flags`` are sent to the network core when either the :c:func:`bt_gatt_subscribe` or :c:func:`bt_gatt_resubscribe` function is called. - This covers most of the cases, because the ``flags`` are normally set once before those functions calls. - * If you want to read or write the ``flags`` after the subscription, you have to call :c:func:`bt_rpc_gatt_subscribe_flag_set`, :c:func:`bt_rpc_gatt_subscribe_flag_clear` or :c:func:`bt_rpc_gatt_subscribe_flag_get`. +.. doxygengroup:: bt_rpc + :project: nrf + :members: diff --git a/doc/nrf/libraries/bluetooth_services/scan.rst b/doc/nrf/libraries/bluetooth_services/scan.rst index 1d3d7ee9effe..ea082c5bc400 100644 --- a/doc/nrf/libraries/bluetooth_services/scan.rst +++ b/doc/nrf/libraries/bluetooth_services/scan.rst @@ -1,23 +1,23 @@ .. _lib_nrf_bt_scan_readme: .. _nrf_bt_scan_readme: -Scanning module -############### +Bluetooth LE scanning +##################### .. contents:: :local: :depth: 2 -The scanning module handles the Bluetooth® Low Energy scanning for your application. +This library handles the Bluetooth® Low Energy scanning for your application. Overview ******** -Use the scanning module to find advertising devices and establish connections with them. -The module can automatically establish connection after a filter match. +Use the library to find advertising devices and establish connections with them. +It can automatically establish connection after a filter match. It can also receive :ref:`directed advertising packets `. -The scanning module can work in one of the following modes: +The library can work in one of the following modes: * Simple mode - Works without filters. * Advanced mode - Allows using advanced filters. @@ -30,10 +30,10 @@ Use the :kconfig:option:`CONFIG_BT_SCAN` Kconfig option to enable the library in Blocklist ========= -Devices can be added to the blocklist, which means that the scanning module ignores these devices and does not generate any events for them. +Devices can be added to the blocklist, which means that the library ignores these devices and does not generate any events for them. Use the :kconfig:option:`CONFIG_BT_SCAN_BLOCKLIST` Kconfig option to enable the blocklist. -In the default configuration, the scanning module allows to add up to two devices to the blocklist. +In the default configuration, the library allows to add up to two devices to the blocklist. To increase the blocklist size, set the :kconfig:option:`CONFIG_BT_SCAN_BLOCKLIST_LEN` Kconfig option. Use the :c:func:`bt_scan_blocklist_device_add` function to add a new device to the blocklist. To remove all devices from the blocklist, use the :c:func:`bt_scan_blocklist_clear` function. @@ -43,7 +43,7 @@ To remove all devices from the blocklist, use the :c:func:`bt_scan_blocklist_cle Directed advertising ==================== -To receive directed advertising packets through the scanning module, enable one of the following Kconfig options in Zephyr: +To receive directed advertising packets through the library, enable one of the following Kconfig options in Zephyr: * :kconfig:option:`CONFIG_BT_PRIVACY` - Scan with changing addresses. * :kconfig:option:`CONFIG_BT_SCAN_WITH_IDENTITY` - Scan with a local identity address. @@ -51,7 +51,7 @@ To receive directed advertising packets through the scanning module, enable one It is recommended to enable the :kconfig:option:`CONFIG_BT_PRIVACY` Kconfig option to support directed advertising only between bonded peers. Use the :kconfig:option:`CONFIG_BT_SCAN_WITH_IDENTITY` Kconfig option only when the :kconfig:option:`CONFIG_BT_PRIVACY` Kconfig option is not available. -When the scanning module is set to the advanced mode and :ref:`filters ` are set, you can use the ``filter_no_match`` event to check if directed advertising packets have been received. +When the library is set to the advanced mode and :ref:`filters ` are set, you can use the ``filter_no_match`` event to check if directed advertising packets have been received. They will typically not match any filter as, by specification, they do not contain any advertising data. If there is no match, you can establish a connection without the need to disable or reconfigure the existing filters. @@ -66,17 +66,17 @@ The following code sample demonstrates the usage of the ``filter_no_match`` even Usage ***** -You can use the scanning module to execute actions described in the sections below. +You can use the library to execute actions described in the following sections. Initializing ============ -To initialize the module, call the :c:func:`bt_scan_init` function. +To initialize the library, call the :c:func:`bt_scan_init` function. You can also call the function without an initialization structure. When you pass the initialization structure as ``NULL``, the default static configuration is used. -This configuration is also used when you initialize the module with a structure that has ``NULL`` pointers set for scan and connection parameters. +This configuration is also used when you initialize the library with a structure that has ``NULL`` pointers set for scan and connection parameters. Scanning ======== @@ -91,7 +91,7 @@ Call the following functions to perform basic scanning activities: * :c:func:`bt_scan_stop` - Stop scanning manually. - Scanning stops automatically if the module established the connection. + Scanning stops automatically if the library established the connection. * :c:func:`bt_scan_start` - Resume scanning. @@ -156,11 +156,11 @@ This might result in a loop of the connection and disconnection events. To avoid that, enable the :kconfig:option:`CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER` Kconfig option that limits the number of the connection attempts. This filter automatically tracks the connected devices and counts all disconnection events for them. -If the number of disconnections is greater than or equal to the number of the allowed attempts, the scanning module ignores this device. +If the number of disconnections is greater than or equal to the number of the allowed attempts, the library ignores this device. -Filtered devices must be removed manually from the filter array through the :c:func:`bt_scan_conn_attempts_filter_clear` function. +You must remove the filtered devices manually from the filter array through the :c:func:`bt_scan_conn_attempts_filter_clear` function. Use this function before each scan starts, unless your application has different requirements. -If the filter array is full, the scanning module overwrites the oldest device with the new one. +If the filter array is full, the library overwrites the oldest device with the new one. In the default configuration, the filter allows to add two devices and limits the connection attempts to two. To increase the number of devices, set the :kconfig:option:`CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER_LEN` Kconfig option. diff --git a/doc/nrf/libraries/bluetooth_services/services/ams_client.rst b/doc/nrf/libraries/bluetooth_services/services/ams_client.rst index cf3b05223684..44ae160d58f2 100644 --- a/doc/nrf/libraries/bluetooth_services/services/ams_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/ams_client.rst @@ -7,8 +7,8 @@ Apple Media Service (AMS) Client :local: :depth: 2 -This module implements the Apple Media Service (AMS) client. -This client can be used as a Media Remote (MR) to interact with a Media Source (MS). +This library implements the Apple Media Service (AMS) client. +You can use this library as a Media Remote (MR) to interact with a Media Source (MS). The MS is typically an iOS device. For detailed information about the Apple Media Service, see `Apple Developer Documentation `_. diff --git a/doc/nrf/libraries/bluetooth_services/services/ancs_client.rst b/doc/nrf/libraries/bluetooth_services/services/ancs_client.rst index e331fb43b70b..a0e8dac244c0 100644 --- a/doc/nrf/libraries/bluetooth_services/services/ancs_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/ancs_client.rst @@ -7,7 +7,7 @@ Apple Notification Center Service (ANCS) Client :local: :depth: 2 -The ANCS Client module is used for implementation of the Apple Notification Center Service (ANCS) client. +The ANCS Client library is used for implementation of the Apple Notification Center Service (ANCS) client. .. note:: @@ -21,7 +21,7 @@ The ANCS client can be used as a Notification Consumer (NC) that receives data n The NP is typically an iOS device that is acting as a server. For detailed information about the Apple Notification Center Service, see `Apple Developer Documentation `_. -In this module, iOS notifications are received through the GATT notifications. +In this library, iOS notifications are received through the GATT notifications. .. note:: @@ -35,9 +35,9 @@ In this module, iOS notifications are received through the GATT notifications. Configuration ************* -Upon initializing the module, add different iOS notification attributes you want to receive for iOS notifications (see :c:func:`bt_ancs_register_attr`). +Upon initializing the library, add different iOS notification attributes you want to receive for iOS notifications (see :c:func:`bt_ancs_register_attr`). -Once a connection is established with a central device, the module needs a service discovery to discover the ANCS server handles. +Once a connection is established with a central device, the library needs a service discovery to discover the ANCS server handles. If this succeeds, the handles for the ANCS server must be assigned to an ANCS client instance using the :c:func:`bt_ancs_handles_assign` function. The application can now subscribe to iOS notifications with :c:func:`bt_ancs_subscribe_notification_source`. @@ -82,6 +82,7 @@ Use the following functions to perform activities related to notifications: Samples using the library ************************* + The :ref:`peripheral_ancs_client` sample uses this library. Dependencies diff --git a/doc/nrf/libraries/bluetooth_services/services/bas_client.rst b/doc/nrf/libraries/bluetooth_services/services/bas_client.rst index 4a2967071661..d7a67fcd92ab 100644 --- a/doc/nrf/libraries/bluetooth_services/services/bas_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/bas_client.rst @@ -7,9 +7,9 @@ GATT Battery Service (BAS) Client :local: :depth: 2 -The Battery Service Client can be used to retrieve information about the battery level from a device that provides a Battery Service Server. +You can use the Battery Service Client to retrieve information about the battery level from a device that provides a Battery Service Server. -The client supports a simple `Battery Service `_ with one characteristic. +The library supports a simple `Battery Service `_ with one characteristic. The Battery Level Characteristic holds the battery level in percentage units. @@ -47,7 +47,7 @@ Getting the last known value .. note:: The internally stored value is updated every time a notification or read response is received. - If no value is received from the server, the get function returns :c:macro:`BT_BAS_VAL_INVALID`. + If no value is received from the server, the ``get`` function returns :c:macro:`BT_BAS_VAL_INVALID`. .. _bas_client_readme_periodic: diff --git a/doc/nrf/libraries/bluetooth_services/services/bms.rst b/doc/nrf/libraries/bluetooth_services/services/bms.rst index 1ca4fbd4120c..2772a566644a 100644 --- a/doc/nrf/libraries/bluetooth_services/services/bms.rst +++ b/doc/nrf/libraries/bluetooth_services/services/bms.rst @@ -7,7 +7,7 @@ GATT Bond Management Service (BMS) :local: :depth: 2 -This module implements the Bond Management Service with the corresponding set of characteristics defined in the `Bond Management Service Specification`_. +This library implements the Bond Management Service with the corresponding set of characteristics defined in the `Bond Management Service Specification`_. You can configure the service to support your desired feature set of bond management operations. All the BMS features in the "LE transport only" mode are supported: @@ -16,7 +16,7 @@ All the BMS features in the "LE transport only" mode are supported: * Delete all bonds on the Server. * Delete all bonds on the Server except the one of the requesting device. -You can enable each feature when initializing the module. +You can enable each feature when initializing the library. Authorization ************* @@ -27,7 +27,7 @@ When required, the Client's request to execute a bond management operation must The Server compares the code with its local version and accepts the request only if the codes match. If you use at least one BMS feature that requires authorization, you need to provide a callback with comparison logic for the authorization codes. -You can set this callback when initializing the module. +You can set this callback when initializing the library. Deleting the bonds ****************** diff --git a/doc/nrf/libraries/bluetooth_services/services/cgms.rst b/doc/nrf/libraries/bluetooth_services/services/cgms.rst index 003f698de690..1cc419bf5f7a 100644 --- a/doc/nrf/libraries/bluetooth_services/services/cgms.rst +++ b/doc/nrf/libraries/bluetooth_services/services/cgms.rst @@ -10,7 +10,7 @@ GATT Continuous Glucose Monitoring Service (CGMS) Overview ******** -This module implements the Continuous Glucose Monitoring Service with the corresponding set of characteristics defined in the `Continuous Glucose Monitoring Service Specification`_. +This library implements the Continuous Glucose Monitoring Service with the corresponding set of characteristics defined in the `Continuous Glucose Monitoring Service Specification`_. Supported features ================== @@ -21,9 +21,9 @@ Configuration ************* Set the maximum number of glucose measurement records stored in the device using the :kconfig:option:`CONFIG_BT_CGMS_MAX_MEASUREMENT_RECORD` Kconfig option. -The value of should be large enough to hold all records generated in a session. +The value should be large enough to hold all records generated in a session. -Set the logging level of the CGMS module using the :kconfig:option:`CONFIG_BT_CGMS_LOG_LEVEL_CHOICE` Kconfig option. +Set the logging level of the CGMS library using the :kconfig:option:`CONFIG_BT_CGMS_LOG_LEVEL_CHOICE` Kconfig option. Usage ***** diff --git a/doc/nrf/libraries/bluetooth_services/services/cts_client.rst b/doc/nrf/libraries/bluetooth_services/services/cts_client.rst index 4c7adb436f11..fadbfdec99f5 100644 --- a/doc/nrf/libraries/bluetooth_services/services/cts_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/cts_client.rst @@ -7,7 +7,7 @@ GATT Current Time Service (CTS) Client :local: :depth: 2 -The CTS Client module can be used to retrieve the current time from a connected peer that is running the GATT server with the `Current Time Service `_. +You can use the CTS Client library to retrieve the current time from a connected peer that is running the GATT server with the `Current Time Service `_. The CTS Client is used in the :ref:`peripheral_cts_client` sample. diff --git a/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst b/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst index 80ad7d66dccb..d434987c32de 100644 --- a/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst +++ b/doc/nrf/libraries/bluetooth_services/services/dfu_smp.rst @@ -7,11 +7,11 @@ GATT DFU SMP Service Client :local: :depth: 2 -This module implements a Simple Management Protocol (SMP) Service Client that can be used in the context of Device Firmware Updates (DFU). +This library implements a Simple Management Protocol (SMP) Service Client that you can use in the context of Device Firmware Updates (DFU). SMP is a basic transfer encoding for use with the `mcumgr`_ management protocol. See `SMP over Bluetooth`_ for the service specification. -The SMP Client module can be used to interact with Zephyr's :zephyr:code-sample:`smp-svr`. +You can use the SMP Client library to interact with Zephyr's :zephyr:code-sample:`smp-svr`. The SMP Client implements only the service. It does not provide any functionality to process or interpret SMP commands and responses. diff --git a/doc/nrf/libraries/bluetooth_services/services/fast_pair.rst b/doc/nrf/libraries/bluetooth_services/services/fast_pair.rst index 90d289c8e7fc..0524e7fe3383 100644 --- a/doc/nrf/libraries/bluetooth_services/services/fast_pair.rst +++ b/doc/nrf/libraries/bluetooth_services/services/fast_pair.rst @@ -23,21 +23,21 @@ The implementation in the |NCS| follows these requirements. The Fast Pair service also contains additional GATT characteristics under the following conditions: * The Additional Data GATT characteristic is enabled when an extension requires it. - Currently, only the Personalized Name extension (:kconfig:option:`CONFIG_BT_FAST_PAIR_EXT_PN`) requires this characteristic. + Currently, only the Personalized Name extension (:kconfig:option:`CONFIG_BT_FAST_PAIR_PN`) requires this characteristic. Configuration ************* -Set the :kconfig:option:`CONFIG_BT_FAST_PAIR` Kconfig option to enable the module. +Set the :kconfig:option:`CONFIG_BT_FAST_PAIR` Kconfig option to enable the service. -The following Kconfig options are also available for this module: +The following Kconfig options are also available for this service: * :kconfig:option:`CONFIG_BT_FAST_PAIR_STORAGE_USER_RESET_ACTION` - The option enables user reset action that is executed together with the Fast Pair factory reset operation. See the :ref:`ug_bt_fast_pair_factory_reset_custom_user_reset_action` for more details. * :kconfig:option:`CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX` - The option configures maximum number of stored Account Keys. -* :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_TINYCRYPT`, :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_MBEDTLS`, and :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_OBERON` - These options are used to select the cryptographic backend for Fast Pair. +* :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_TINYCRYPT`, :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_MBEDTLS`, :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_OBERON`, and :kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_PSA` - These options are used to select the cryptographic backend for Fast Pair. The Oberon backend is used by default. - The Mbed TLS backend uses Mbed TLS crypto APIs, which are now considered legacy APIs. + The Mbed TLS backend uses Mbed TLS crypto APIs that are now considered legacy APIs. * :kconfig:option:`CONFIG_BT_FAST_PAIR_PN` - The option enables the `Fast Pair Personalized Name extension`_. * :kconfig:option:`CONFIG_BT_FAST_PAIR_STORAGE_PN_LEN_MAX` - The option specifies the maximum length of a stored Fast Pair Personalized Name. diff --git a/doc/nrf/libraries/bluetooth_services/services/gattp.rst b/doc/nrf/libraries/bluetooth_services/services/gattp.rst index f5c6d7eada9b..f490c682c369 100644 --- a/doc/nrf/libraries/bluetooth_services/services/gattp.rst +++ b/doc/nrf/libraries/bluetooth_services/services/gattp.rst @@ -7,7 +7,7 @@ Generic Attribute (GATT) Profile :local: :depth: 2 -The GATT Profile module can be used to receive service changed indications from a connected peer. +You can use the GATT Profile library to receive service changed indications from a connected peer. It is used in the :ref:`peripheral_ancs_client` sample. API documentation diff --git a/doc/nrf/libraries/bluetooth_services/services/hids.rst b/doc/nrf/libraries/bluetooth_services/services/hids.rst index 4c4b264bdc66..d805a1915b44 100644 --- a/doc/nrf/libraries/bluetooth_services/services/hids.rst +++ b/doc/nrf/libraries/bluetooth_services/services/hids.rst @@ -7,14 +7,14 @@ GATT Human Interface Device (HID) Service :local: :depth: 2 -This module implements the Human Interface Device Service with the corresponding set of characteristics. +This library implements the Human Interface Device Service (HIDS) with the corresponding set of characteristics. When initialized, it adds the HID Service and a set of characteristics, according to the `HID Service Specification`_ and the user requirements, to the Zephyr Bluetooth® stack database. If enabled, a notification of Input Report characteristics is sent when the application calls the corresponding :c:func:`bt_hids_inp_rep_send` function. You can register dedicated event handlers for most of the HIDS characteristics to be notified about changes in their values. -The HIDS module must be notified about the incoming connect and disconnect events using the dedicated API. +The HIDS library must be notified about the incoming connect and disconnect events using the dedicated API. This is done to synchronize the connection state of HIDS with the top module that uses it. .. note:: @@ -37,7 +37,7 @@ In such case, the Bluetooth stack automatically notifies connected peers about t Multiclient support ******************* -The HIDS module can handle multiple connected peers at the same time. +The HIDS library can handle multiple connected peers at the same time. The server allocates context data for each connected client. The context data is then used to store the values of HIDS characteristics. These values are unique for each connected peer. @@ -46,7 +46,7 @@ While sending notifications, you can also target a specific client by providing Report masking ************** -The HIDS module can consist of reports that are used to transmit differential data. +The HIDS library can consist of reports that are used to transmit differential data. One example of such a report type is a mouse report. In a mouse report, mouse movement data represents the position change along the X or Y axis and should only be interpreted once by the HID host. After receiving a notification from the HID device, the client should not be able to get any non-zero value from the differential data part of the report by using the GATT Read Request on its characteristic. diff --git a/doc/nrf/libraries/bluetooth_services/services/hogp.rst b/doc/nrf/libraries/bluetooth_services/services/hogp.rst index e53baae7355a..9e28b16d1b14 100644 --- a/doc/nrf/libraries/bluetooth_services/services/hogp.rst +++ b/doc/nrf/libraries/bluetooth_services/services/hogp.rst @@ -7,7 +7,7 @@ GATT Human Interface Device Service (HIDS) Client :local: :depth: 2 -The HIDS Client uses the :ref:`gatt_dm_readme` module to acquire all attribute handles that are required to interact with the HIDS server. +The HIDS Client uses the :ref:`gatt_dm_readme` to acquire all attribute handles that are required to interact with the HIDS server. Overview ******** @@ -30,7 +30,7 @@ Use the following Kconfig options to configure the library: Usage ***** -You can use the GATT HIDS Client module to interact with a connected HIDS server. +You can use the GATT HIDS Client library to interact with a connected HIDS server. Retrieving the HIDS Client readiness state ========================================== diff --git a/doc/nrf/libraries/bluetooth_services/services/latency.rst b/doc/nrf/libraries/bluetooth_services/services/latency.rst index ce82b8bf537e..adc0092b811b 100644 --- a/doc/nrf/libraries/bluetooth_services/services/latency.rst +++ b/doc/nrf/libraries/bluetooth_services/services/latency.rst @@ -8,7 +8,7 @@ GATT Latency Service :depth: 2 The GATT Latency Service is a custom service containing a single writable characteristic. -This characteristic can be used to calculate the round-trip time of a GATT Write operation. +You can use this characteristic to calculate the round-trip time of a GATT Write operation. Service UUID ************ diff --git a/doc/nrf/libraries/bluetooth_services/services/latency_client.rst b/doc/nrf/libraries/bluetooth_services/services/latency_client.rst index fc6fb3f9b9b7..673827dbc042 100644 --- a/doc/nrf/libraries/bluetooth_services/services/latency_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/latency_client.rst @@ -7,14 +7,14 @@ GATT Latency Client :local: :depth: 2 -The Latency Client can be used to interact with a connected peer that is running the Latency service with the :ref:`latency_readme`. +You can use the Latency Client to interact with a connected peer that is running the Latency service with the :ref:`latency_readme`. It writes data to the Latency characteristic and waits for a response to count the time spent of a GATT Write operation. Latency Characteristic ********************** To request latency data from the Latency Characteristic, use the :c:func:`bt_latency_request` function. -The request sending procedure is asynchronous, so the request data to be sent must remain valid until a dedicated callback notifies you that the Write Request has been completed. +The request sending procedure is asynchronous, so the request data to be sent must remain valid until a dedicated callback notifies you that the write request has been completed. API documentation ***************** diff --git a/doc/nrf/libraries/bluetooth_services/services/mds.rst b/doc/nrf/libraries/bluetooth_services/services/mds.rst index 79169a58f2a9..b181a74c11c4 100644 --- a/doc/nrf/libraries/bluetooth_services/services/mds.rst +++ b/doc/nrf/libraries/bluetooth_services/services/mds.rst @@ -34,7 +34,7 @@ Configuration Set the :kconfig:option:`CONFIG_BT_MDS` Kconfig option to enable the service. -The following configuration options are available for this module: +The following configuration options are available for this service: * :kconfig:option:`CONFIG_BT_MDS_MAX_URI_LENGTH` sets the maximum length of the URI to which diagnostic data should be forwarded. The URI contains the device ID. @@ -54,7 +54,7 @@ Implementation details The implementation uses :c:macro:`BT_GATT_SERVICE_DEFINE` to statically define and register the Memfault Diagnostic GATT service. The service automatically checks if there is data available to be sent with the interval defined by the :kconfig:option:`CONFIG_BT_MDS_DATA_POLL_INTERVAL` and sends it using the notification mechanism. No application input is required to send diagnostic data. -However, if you pass :c:struct:`bt_mds_cb` to the :c:func:`bt_mds_cb_register` function, the application needs to confirm that the connected client can access the diagnostic data every time the client performs a read or write operation on the service characteristic. +However, if you pass :c:struct:`bt_mds_cb` to the :c:func:`bt_mds_cb_register` function, the application needs to confirm that the connected client can access the diagnostic data every time the client performs a ``read`` or ``write`` operation on the service characteristic. Use the :c:func:`bt_mds_cb_register` function to register callbacks the service. diff --git a/doc/nrf/libraries/bluetooth_services/services/nus_client.rst b/doc/nrf/libraries/bluetooth_services/services/nus_client.rst index 02612f4e58dc..89979f73c45d 100644 --- a/doc/nrf/libraries/bluetooth_services/services/nus_client.rst +++ b/doc/nrf/libraries/bluetooth_services/services/nus_client.rst @@ -7,8 +7,8 @@ Nordic UART Service (NUS) Client :local: :depth: 2 -The Nordic UART Service Client module can be used to interact with a connected peer that is running the GATT server with the :ref:`nus_service_readme`. -The client uses the :ref:`gatt_dm_readme` module to acquire the attribute handles that are necessary to interact with the RX and TX Characteristics. +You can use the Nordic UART Service Client library to interact with a connected peer that is running the GATT server with the :ref:`nus_service_readme`. +The client uses the :ref:`gatt_dm_readme` library to acquire the attribute handles that are necessary to interact with the RX and TX Characteristics. The NUS Service Client is used in the :ref:`central_uart` sample. @@ -16,15 +16,15 @@ The NUS Service Client is used in the :ref:`central_uart` sample. RX Characteristic ***************** -To send data to the RX Characteristic, use the :c:func:`bt_nus_client_send` function of this module. -The sending procedure is asynchronous, so the data to be sent must remain valid until a dedicated callback notifies you that the Write Request has been completed. +To send data to the RX Characteristic, use the :c:func:`bt_nus_client_send` function of this library. +The sending procedure is asynchronous, so the data to be sent must remain valid until a dedicated callback notifies you that the write request has been completed. TX Characteristic ***************** To receive data coming from the TX Characteristic, enable notifications after the service discovery. After that, you can request to disable notifications again by returning the ``STOP`` value in the callback that is used to handle incoming data. -Another dedicated callback is triggered when your request has been completed, to inform you that you have unsubscribed successfully. +Another dedicated callback is triggered when your request has been completed, to inform that you have unsubscribed successfully. API documentation ***************** diff --git a/doc/nrf/libraries/bluetooth_services/services/rscs.rst b/doc/nrf/libraries/bluetooth_services/services/rscs.rst index d6d6f6ea874e..a55c73634f73 100644 --- a/doc/nrf/libraries/bluetooth_services/services/rscs.rst +++ b/doc/nrf/libraries/bluetooth_services/services/rscs.rst @@ -7,7 +7,7 @@ Running Speed and Cadence Service (RSCS) :local: :depth: 2 -This module implements the Running Speed and Cadence Service with the corresponding set of characteristics defined in the `Running Speed and Cadence Service Specification`_. +This library implements the Running Speed and Cadence Service with the corresponding set of characteristics defined in the `Running Speed and Cadence Service Specification`_. The RSCS is used in the :ref:`peripheral_rscs` sample. diff --git a/doc/nrf/libraries/bluetooth_services/services/wifi_prov.rst b/doc/nrf/libraries/bluetooth_services/services/wifi_prov.rst index b45d69f0806e..e6b3af4c5cf9 100644 --- a/doc/nrf/libraries/bluetooth_services/services/wifi_prov.rst +++ b/doc/nrf/libraries/bluetooth_services/services/wifi_prov.rst @@ -7,10 +7,10 @@ Wi-Fi Provisioning Service :local: :depth: 2 -This module implements a Bluetooth® GATT service for Wi-Fi® provisioning. -This library is to be used with the :ref:`wifi_provisioning` sample. +This library implements a Bluetooth® GATT service for Wi-Fi® provisioning. +It is to be used with the :ref:`wifi_provisioning` sample. The Wi-Fi Provisioning Service forms a complete reference solution, together with the mobile application. -You can find details in the documentation of the :ref:`wifi_provisioning` sample. +For details, see the :ref:`wifi_provisioning` sample documentation. Overview ******** @@ -146,7 +146,7 @@ The service uses four message types: * If the command is ``SET_CONFIG``, when the Wi-Fi status changes (for example, from disconnected to connected), the configurator receives a result message with the new status. Meanwhile, the Wi-Fi credentials are stored in the non-volatile memory of the device. -See all definitions in :file:`./common/proto`. +See all definitions in the :file:`.subsys/bluetooth/services/wifi_prov/proto/common.proto` file. Operations ========== diff --git a/doc/nrf/libraries/networking/aws_iot.rst b/doc/nrf/libraries/networking/aws_iot.rst index 6870e7a26198..38727284df13 100644 --- a/doc/nrf/libraries/networking/aws_iot.rst +++ b/doc/nrf/libraries/networking/aws_iot.rst @@ -188,9 +188,9 @@ There are multiple ways to generate and register these certificates: #. Take note of the certificate ARN, as it will be required later. #. Download the `Amazon Root CA 1`_ PEM file as :file:`ca-cert.pem`. - #. Provision the certificates and private key at runtime to the Mbed TLS stack. - This is achieved by placing the PEM files into a :file:`certs/` subdirectory and ensuring the :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` Kconfig option is enabled. - For more information, refer to the :ref:`aws_iot` sample as well as the :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FILE` Kconfig option. + #. Place the PEM files into the folder path specified by the :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER` option, default is :file:`/certs/`. + Ensure that the :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` option is set. + #. If the files are placed correctly, the :ref:`lib_mqtt_helper` library finds the certificates and provisions them to the Mbed TLS stack when connecting to AWS IoT. .. rst-class:: numbered-step diff --git a/doc/nrf/libraries/networking/azure_iot_hub.rst b/doc/nrf/libraries/networking/azure_iot_hub.rst index 9bc914fc4712..2e47635f396d 100644 --- a/doc/nrf/libraries/networking/azure_iot_hub.rst +++ b/doc/nrf/libraries/networking/azure_iot_hub.rst @@ -342,14 +342,6 @@ The following are the ways to generate and register device certificates: #. Provision the certificates and private key at runtime to the Mbed TLS stack. This is achieved by placing the PEM files into a :file:`certs/` subdirectory and ensuring the :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` Kconfig option is enabled. - The PEM files need to be converted to string format to be compiled into the firmware. - - To do this, enclose each line in the PEM file with double quotes and finish each line with a newline character, using the following command: - - .. code-block:: console - - sed -i'.org' 's/.*/"&\\n"/' - For more information, refer to the :ref:`azure_iot_hub` sample as well as the :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FILE` Kconfig option. .. rst-class:: numbered-step diff --git a/doc/nrf/libraries/networking/mqtt_helper.rst b/doc/nrf/libraries/networking/mqtt_helper.rst index 8ea77301c995..e4ac06000741 100644 --- a/doc/nrf/libraries/networking/mqtt_helper.rst +++ b/doc/nrf/libraries/networking/mqtt_helper.rst @@ -27,7 +27,7 @@ Additionally, configure the following options as per the needs of your applicati * :kconfig:option:`CONFIG_MQTT_HELPER_RX_TX_BUFFER_SIZE` * :kconfig:option:`CONFIG_MQTT_HELPER_PAYLOAD_BUFFER_LEN` * :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` -* :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FILE` +* :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER` API documentation ***************** diff --git a/doc/nrf/libraries/networking/nrf_cloud.rst b/doc/nrf/libraries/networking/nrf_cloud.rst index 61b7091c4852..6ad22b81405b 100644 --- a/doc/nrf/libraries/networking/nrf_cloud.rst +++ b/doc/nrf/libraries/networking/nrf_cloud.rst @@ -210,20 +210,6 @@ Sending sensor data ******************* The library offers two functions, :c:func:`nrf_cloud_sensor_data_send` and :c:func:`nrf_cloud_sensor_data_stream` (lowest QoS), for sending sensor data to the cloud. -To view sensor data on nRF Cloud, the device must first inform the cloud what types of sensor data to display. -The device passes this information by writing a ``ui`` field, containing an array of sensor types, into the ``serviceInfo`` field in the device's shadow. -The :c:func:`nrf_cloud_service_info_json_encode` function can be used to generate the proper JSON data to enable FOTA. -Additionally, the :c:func:`nrf_cloud_shadow_device_status_update` function can be used to generate the JSON data and perform the shadow update. - -Following are the supported UI types on nRF Cloud: - -* ``GNSS`` -* ``FLIP`` -* ``TEMP`` -* ``HUMIDITY`` -* ``AIR_PRESS`` -* ``RSRP`` - .. _lib_nrf_cloud_unlink: Removing the link between device and user diff --git a/doc/nrf/libraries/networking/nrf_provisioning.rst b/doc/nrf/libraries/networking/nrf_provisioning.rst index 122f0f25e7bb..7c6a209d1176 100644 --- a/doc/nrf/libraries/networking/nrf_provisioning.rst +++ b/doc/nrf/libraries/networking/nrf_provisioning.rst @@ -156,10 +156,11 @@ The feature is enabled by selecting :kconfig:option:`CONFIG_NRF_PROVISIONING_SHE uart:~$ nrf_provisioning nrf_provisioning - nRF Provisioning commands Subcommands: - init :Start the client - now :Do provisioning now - token :Get the attestation token - uuid :Get device UUID + init: Start the client + now: Do provisioning now + token: Get the attestation token + uuid: Get device UUID + interval: Set provisioning interval Dependencies ************ diff --git a/doc/nrf/libraries/networking/wifi_mgmt_ext.rst b/doc/nrf/libraries/networking/wifi_mgmt_ext.rst index b732f9010e42..39e9d94ff2e7 100644 --- a/doc/nrf/libraries/networking/wifi_mgmt_ext.rst +++ b/doc/nrf/libraries/networking/wifi_mgmt_ext.rst @@ -26,9 +26,10 @@ For development purposes, you can set static Wi-Fi credentials configuration usi * :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_SSID` - Wi-Fi SSID. * :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD` - Wi-Fi password. * :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_OPEN` - Wi-Fi network uses no password. -* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_PSK` - Wi-Fi network uses a password and PSK security (default). +* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_PSK` - Wi-Fi network uses a password and WPA2-PSK security (default). * :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_PSK_SHA256` - Wi-Fi network uses a password and PSK-256 security. * :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_SAE` - Wi-Fi network uses a password and SAE security. +* :kconfig:option:`CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_WPA_PSK` - Wi-Fi network uses a password and WPA-PSK security. Usage ***** diff --git a/doc/nrf/libraries/others/uart_async_adapter.rst b/doc/nrf/libraries/others/uart_async_adapter.rst new file mode 100644 index 000000000000..30d30f93afda --- /dev/null +++ b/doc/nrf/libraries/others/uart_async_adapter.rst @@ -0,0 +1,102 @@ +.. _lib_uart_async_adapter: + +UART async adapter +################## + +.. contents:: + :local: + :depth: 2 + +UART async adapter library works as an interface between interrupt-driven API of a UART device and software that is using the asynchronous API interface. + +.. note:: + The current implementation is :ref:`experimental `. + +Overview +******** + +Zephyr provides the following three different ways to access a UART peripheral: + +* Pooling API +* Interrupt-driven API +* Asynchronous API + +While most of the UART drivers provide all three APIs, some drivers still do not provide the asynchronous UART API. +An example of such a driver is USB CDC ACM. +The UART async adapter library is initialized with a UART device and communicates with it using the interrupt-driven API, providing an asynchronous API for the application. + +This removes the need to implement two ways of interfacing with UART devices in software. +When using the UART async adapter library, the software only needs to implement interaction with a UART device using the asynchronous API and just initialize the adapter for the ones that do not support it. + +Requirements +************ + +To use the library, you need to enable the :kconfig:option:`CONFIG_UART_ASYNC_API` and :kconfig:option:`CONFIG_UART_INTERRUPT_DRIVEN` Kconfig options. + +Configuration +************* + +Use the :kconfig:option:`CONFIG_UART_ASYNC_ADAPTER` Kconfig option to enable the library in the build system. + +Usage +***** + +See the following code snippet to learn how to use this library: + +.. code-block:: c + + #include + + ... + /* Get the UART device we want to use */ + static const struct device *uart = DEVICE_DT_GET([UART node identifier]); + + /* Create UART async adapter instance */ + UART_ASYNC_ADAPTER_INST_DEFINE(async_adapter); + + /* UART initialization (called before any UART usage) */ + static int uart_init(void) + { + if (!uart_test_async_api(uart)) { + /* Implement API adapter */ + uart_async_adapter_init(async_adapter, uart); + uart = async_adapter; + } + /* Continue initialization using asynchronous API on uart device */ + (...) + } + +.. note:: + When using the library in the way shown in the code snippet, it is totally transparent to the application. + +If the selected UART device provides the asynchronous API, the adapter is not initialized. +If the selected UART device does not provide the asynchronous API, the adapter is initialized to use such a device and a direct pointer to the device is replaced by the adapter. + +Samples using the library +************************* + +The following |NCS| sample use this library: + +* :ref:`peripheral_uart` + +Limitations +*********** + +Using this library adds code and performance overhead over direct usage of UART asynchronous API provided by the driver. +For UART drivers that only provide the interrupt-driven API, consider using it directly in the application. +The library allows using UART devices with different APIs with only one API in the application, speeding up the development process. + +Dependencies +************ + +This module may use :ref:`zephyr:logging_api`. + +API documentation +***************** + +| Header file: :file:`include/uart_async_adapter.h` +| Source files: :file:`subsys/uart_async_adapter/` + +.. doxygengroup:: uart_async_adapter + :project: nrf + :members: diff --git a/doc/nrf/libraries/bootloader/bl_crypto.rst b/doc/nrf/libraries/security/bootloader/bl_crypto.rst similarity index 100% rename from doc/nrf/libraries/bootloader/bl_crypto.rst rename to doc/nrf/libraries/security/bootloader/bl_crypto.rst diff --git a/doc/nrf/libraries/bootloader/bl_storage.rst b/doc/nrf/libraries/security/bootloader/bl_storage.rst similarity index 100% rename from doc/nrf/libraries/bootloader/bl_storage.rst rename to doc/nrf/libraries/security/bootloader/bl_storage.rst diff --git a/doc/nrf/libraries/bootloader/bl_validation.rst b/doc/nrf/libraries/security/bootloader/bl_validation.rst similarity index 100% rename from doc/nrf/libraries/bootloader/bl_validation.rst rename to doc/nrf/libraries/security/bootloader/bl_validation.rst diff --git a/doc/nrf/libraries/others/flash_patch.rst b/doc/nrf/libraries/security/bootloader/flash_patch.rst similarity index 100% rename from doc/nrf/libraries/others/flash_patch.rst rename to doc/nrf/libraries/security/bootloader/flash_patch.rst diff --git a/doc/nrf/libraries/others/fprotect.rst b/doc/nrf/libraries/security/bootloader/fprotect.rst similarity index 100% rename from doc/nrf/libraries/others/fprotect.rst rename to doc/nrf/libraries/security/bootloader/fprotect.rst diff --git a/doc/nrf/libraries/others/fw_info.rst b/doc/nrf/libraries/security/bootloader/fw_info.rst similarity index 100% rename from doc/nrf/libraries/others/fw_info.rst rename to doc/nrf/libraries/security/bootloader/fw_info.rst diff --git a/doc/nrf/libraries/bootloader/index.rst b/doc/nrf/libraries/security/bootloader/index.rst similarity index 100% rename from doc/nrf/libraries/bootloader/index.rst rename to doc/nrf/libraries/security/bootloader/index.rst diff --git a/doc/nrf/libraries/others/fatal_error.rst b/doc/nrf/libraries/security/fatal_error.rst similarity index 100% rename from doc/nrf/libraries/others/fatal_error.rst rename to doc/nrf/libraries/security/fatal_error.rst diff --git a/doc/nrf/libraries/others/hw_unique_key.rst b/doc/nrf/libraries/security/hw_unique_key.rst similarity index 100% rename from doc/nrf/libraries/others/hw_unique_key.rst rename to doc/nrf/libraries/security/hw_unique_key.rst diff --git a/doc/nrf/libraries/others/identity_key.rst b/doc/nrf/libraries/security/identity_key.rst similarity index 100% rename from doc/nrf/libraries/others/identity_key.rst rename to doc/nrf/libraries/security/identity_key.rst diff --git a/doc/nrf/libraries/security/index.rst b/doc/nrf/libraries/security/index.rst index 8930ee9ea5cf..0b7285b194cb 100644 --- a/doc/nrf/libraries/security/index.rst +++ b/doc/nrf/libraries/security/index.rst @@ -8,5 +8,7 @@ Security libraries :glob: :caption: Subpages: + bootloader/index nrf_security/index + tfm/index * diff --git a/doc/nrf/libraries/security/nrf_security/doc/driver_config.rst b/doc/nrf/libraries/security/nrf_security/doc/driver_config.rst index 14d9a81271b9..9dbbcbdc19e7 100644 --- a/doc/nrf/libraries/security/nrf_security/doc/driver_config.rst +++ b/doc/nrf/libraries/security/nrf_security/doc/driver_config.rst @@ -750,7 +750,6 @@ To enable password-authenticated key exchange (PAKE) support, set one or more of .. note:: * The provided support is experimental. - * Not supported with TF-M. Password-authenticated key exchange support =========================================== diff --git a/doc/nrf/libraries/security/nrf_security/doc/drivers.rst b/doc/nrf/libraries/security/nrf_security/doc/drivers.rst index b7036116e50e..42d9d59cc0cc 100644 --- a/doc/nrf/libraries/security/nrf_security/doc/drivers.rst +++ b/doc/nrf/libraries/security/nrf_security/doc/drivers.rst @@ -83,7 +83,7 @@ To enable the :ref:`nrf_oberon_readme` PSA driver, set the :kconfig:option:`CONF CRACEN driver ************* -The CRACEN driver provides hardware-accelerated cryptography using the CRACEN (Crypto Accelerator Engine) peripheral. +The CRACEN driver provides entropy and hardware-accelerated cryptography using the CRACEN (Crypto Accelerator Engine) peripheral. This driver is only available on nRF54L Series devices. Enabling the CRACEN driver @@ -93,6 +93,10 @@ The CRACEN driver can be enabled by setting the :kconfig:option:`CONFIG_PSA_CRYP The nrf_oberon driver may then be disabled by using the Kconfig option :kconfig:option:`CONFIG_PSA_CRYPTO_DRIVER_OBERON` (``CONFIG_PSA_CRYPTO_DRIVER_OBERON=n``). +.. note:: + On nRF54L Series devices, CRACEN is the only source of entropy. + Therefore, it is not possible to disable the :kconfig:option:`CONFIG_PSA_CRYPTO_DRIVER_CRACEN` option when the Zephyr entropy driver is enabled. + Legacy Mbed TLS *************** diff --git a/doc/nrf/libraries/tfm/index.rst b/doc/nrf/libraries/security/tfm/index.rst similarity index 100% rename from doc/nrf/libraries/tfm/index.rst rename to doc/nrf/libraries/security/tfm/index.rst diff --git a/doc/nrf/libraries/tfm/tfm_ioctl_api.rst b/doc/nrf/libraries/security/tfm/tfm_ioctl_api.rst similarity index 90% rename from doc/nrf/libraries/tfm/tfm_ioctl_api.rst rename to doc/nrf/libraries/security/tfm/tfm_ioctl_api.rst index 9f45289955ba..ad5bfc0151fb 100644 --- a/doc/nrf/libraries/tfm/tfm_ioctl_api.rst +++ b/doc/nrf/libraries/security/tfm/tfm_ioctl_api.rst @@ -22,7 +22,7 @@ Wrapper functions for these accesses are defined in :file:`tfm_ioctl_ns_api.c` a The supported platform services are defined by :c:struct:`tfm_platform_ioctl_core_reqest_types_t` in :file:`tfm_ioctl_core_api.h`. -.. literalinclude:: ../../../../../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/services/include/tfm_ioctl_core_api.h +.. literalinclude:: ../../../../../../modules/tee/tf-m/trusted-firmware-m/platform/ext/target/nordic_nrf/common/core/services/include/tfm_ioctl_core_api.h :language: c :start-at: /** @brief Supported request types. :end-before: /** @brief Argument list for each platform read service. diff --git a/doc/nrf/libraries/security/trusted_storage.rst b/doc/nrf/libraries/security/trusted_storage.rst index 47d426d480a9..de878a9732fb 100644 --- a/doc/nrf/libraries/security/trusted_storage.rst +++ b/doc/nrf/libraries/security/trusted_storage.rst @@ -97,7 +97,8 @@ Use the Kconfig option :kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND` to defin If this Kconfig option is set, the configuration defaults to the only currently available option :kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND_AEAD` to use an AEAD scheme for encryption and authentication of stored data. Use the Kconfig option :kconfig:option:`CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND` to define the backend that handles how the data are written to and from the non-volatile storage. -If this Kconfig option is set, the configuration defaults to the only currently available option :kconfig:option:`CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND_SETTINGS` to use Zephyr's settings subsystem. +If this Kconfig option is set, the configuration defaults to the :kconfig:option:`CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND_SETTINGS` option to use Zephyr's settings subsystem. +Alternatively, you can use a custom storage backend by setting the Kconfig option :kconfig:option:`CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND_CUSTOM`. The following options are used to configure the AEAD backend and its behavior: diff --git a/doc/nrf/libraries/zigbee/osif.rst b/doc/nrf/libraries/zigbee/osif.rst index 7164a70c08ad..f232187bddca 100644 --- a/doc/nrf/libraries/zigbee/osif.rst +++ b/doc/nrf/libraries/zigbee/osif.rst @@ -34,6 +34,10 @@ You can also configure the following OSIF-related Kconfig options: Use this option only for testing and debugging your application. * :kconfig:option:`CONFIG_ZIGBEE_HAVE_SERIAL` - Enables the UART serial abstract for the ZBOSS OSIF layer and allows to configure the serial glue layer. For more information, see the :ref:`zigbee_osif_zboss_osif_serial` section. + + .. note:: + Serial abstract must be enabled when using the precompiled ZBOSS libraries since they have dependencies on it. + * :kconfig:option:`CONFIG_ZIGBEE_USE_BUTTONS` - Enables the buttons abstract for the ZBOSS OSIF layer. You can use this option if you want to test ZBOSS examples directly in the |NCS|. * :kconfig:option:`CONFIG_ZIGBEE_USE_DIMMABLE_LED` - Dimmable LED (PWM) abstract for the ZBOSS OSIF layer. diff --git a/doc/nrf/links.txt b/doc/nrf/links.txt index 0f15e973a2c5..cc01d7aaeae0 100644 --- a/doc/nrf/links.txt +++ b/doc/nrf/links.txt @@ -40,12 +40,14 @@ .. _`Zephyr issue #27356`: https://github.com/zephyrproject-rtos/zephyr/issues/27356 .. _`Zephyr issue #38516`: https://github.com/zephyrproject-rtos/zephyr/issues/38516 .. _`Zephyr SDK`: https://github.com/zephyrproject-rtos/sdk-ng/releases -.. _`BSEC license`: https://www.bosch-sensortec.com/media/boschsensortec/downloads/software/bme688_development_software/2023_04/license_terms_bme688_bme680_bsec.pdf .. _`sdk-mcuboot`: https://github.com/nrfconnect/sdk-mcuboot .. _`MCUboot repository`: https://github.com/mcu-tools/mcuboot .. _`MCUboot Kconfig option`: https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/Kconfig#L370 +.. _`MCUboot Kconfig option documentation`: https://github.com/nrfconnect/sdk-nrf/blob/main/modules/mcuboot/boot/zephyr/Kconfig#L27C11-L27C12 +.. _`Kconfig search results`: https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#!CONFIG_PM_PARTITION_SIZE + .. _`sdk-mbedtls`: https://github.com/nrfconnect/sdk-mbedtls .. _`Arm Mbed TLS project`: https://github.com/ARMmbed/mbedtls @@ -65,7 +67,8 @@ .. _`Ethernet over RTT for Linux`: https://github.com/doki-nordic/experimental-eth-rtt-link/ -.. _`Memfault firmware SDK`: https://github.com/memfault/memfault-firmware-sdk +.. _`nrf-udev`: https://github.com/NordicSemiconductor/nrf-udev + .. _`Memfault entry in the manifest`: https://github.com/nrfconnect/sdk-nrf/blob/20f40501f69bc9bfd2b321704917da1769411936/west.yml#L170-L173 .. _`ANT entry in the manifest`: https://github.com/nrfconnect/sdk-nrf/blob/20f40501f69bc9bfd2b321704917da1769411936/west.yml#L182-L187 @@ -133,6 +136,8 @@ .. _`Testing with Apple Devices`: https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/darwin.md .. _`Matter factory data Kconfig options`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#!CHIP_FACTORY_DATA +.. _`CoreMark GitHub`: https://github.com/eembc/coremark + .. ### Matter links that need updated SHA per release .. _`other controller setups`: https://github.com/nrfconnect/sdk-connectedhomeip/tree/181b0cb/src/controller @@ -170,8 +175,6 @@ .. _`Azure SDK for Embedded C IoT client libraries`: https://github.com/nrfconnect/azure-sdk-for-c/blob/main/sdk/docs/iot/README.md -.. _`Memfault WebBluetooth Client source code`: https://github.com/memfault/web-ble-example/blob/main/mds.js - .. _`cJSON`: https://github.com/nrfconnect/sdk-cjson .. _`pc-ble-driver-py`: https://github.com/NordicSemiconductor/pc-ble-driver-py @@ -181,6 +184,13 @@ .. _`zcbor 0.8.0 release notes`: https://github.com/zephyrproject-rtos/zcbor/blob/0.8.0/RELEASE_NOTES.md .. _`zcbor 0.8.1 release notes`: https://github.com/zephyrproject-rtos/zcbor/blob/0.8.1/RELEASE_NOTES.md +.. _`nRF Asset Tracker Memfault integration for AWS IoT`: https://github.com/NordicSemiconductor/asset-tracker-cloud-memfault-aws-js +.. _`nRF Asset Tracker Memfault integration for Azure IoT Hub`: https://github.com/NordicSemiconductor/asset-tracker-cloud-memfault-azure-js + +.. _`Memfault firmware SDK`: https://github.com/memfault/memfault-firmware-sdk +.. _`Memfault WebBluetooth Client source code`: https://github.com/memfault/web-ble-example/blob/main/mds.js +.. _`Memfault-SDK`: https://github.com/memfault/memfault-firmware-sdk + .. ### Source: github.io .. _`TinyCBOR`: https://intel.github.io/tinycbor/current/ @@ -188,8 +198,6 @@ .. _`nRF Asset Tracker project`: https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v2.5.x/docs/project/Index.html .. _`Getting started guide for nRF Asset Tracker for AWS`: https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v2.5.x/docs/aws/GettingStarted/Index.html .. _`Getting started guide for nRF Asset Tracker for Azure`: https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v2.5.x/docs/azure/GettingStarted/Index.html -.. _`nRF Asset Tracker Memfault integration for AWS IoT`: https://github.com/NordicSemiconductor/asset-tracker-cloud-memfault-aws-js -.. _`nRF Asset Tracker Memfault integration for Azure IoT Hub`: https://github.com/NordicSemiconductor/asset-tracker-cloud-memfault-azure-js .. _`nRF Asset Tracker Memfault integration`: https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v2.5.x/docs/memfault/Index.html .. _`latest release notes for nRF Connect for Visual Studio Code`: https://nrfconnect.github.io/vscode-nrf-connect/release_notes/connect/2022.11.140.html @@ -233,6 +241,16 @@ .. _`PSA Cryptography API 1.0.1`: https://armmbed.github.io/mbed-crypto/1.0.1/html/index.html .. _`PSA functions for key management`: https://arm-software.github.io/psa-api/crypto/1.1/api/keys/management.html +.. _`Sidewalk documentation`: https://nrfconnect.github.io/sdk-sidewalk/ +.. _`Setting up the SDK for Amazon Sidewalk`: https://nrfconnect.github.io/sdk-sidewalk/setting_up_sidewalk_environment/setting_up_sdk.html + +.. _`Memfault WebBluetooth Client`: https://memfault.github.io/web-ble-example/ + +.. ### Source: githubusercontent.com + +.. _`raw XML`: https://raw.githubusercontent.com/OpenMobileAlliance/lwm2m-registry/prod/version_history/3300-1_0.xml +.. _`Amazon license`: https://raw.githubusercontent.com/nrfconnect/sdk-sidewalk/main/LICENSE.txt + .. ### Source: developer.nordicsemi.com .. _`nRF Connect SDK v1.4.0 documentation`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/nrf/index.html @@ -246,7 +264,9 @@ .. _`nRF Connect SDK latest documentation`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html .. _`known issues page on the main branch`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html +.. _`known issues for nRF Connect SDK v2.6.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-6-1 .. _`known issues for nRF Connect SDK v2.6.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-6-0 +.. _`known issues for nRF Connect SDK v2.5.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-5-3 .. _`known issues for nRF Connect SDK v2.5.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-5-2 .. _`known issues for nRF Connect SDK v2.5.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-5-1 .. _`known issues for nRF Connect SDK v2.5.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v2-5-0 @@ -279,7 +299,7 @@ .. _`known issues for nRF Connect SDK v1.4.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v1-4-1 .. _`known issues for nRF Connect SDK v1.4.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/known_issues.html?v=v1-4-0 -.. _`connecting to nRF Cloud`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/nrf_cloud.html#connecting +.. _`connecting to nRF Cloud`: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/networking/nrf_cloud.html#connecting .. _`API documentation`: .. _`external ZBOSS development guide and API documentation`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.3.0/zigbee_devguide.html @@ -325,96 +345,101 @@ .. _`ZB_BDB_FINDING_N_BINDING`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.3.0/group__zboss__bdb__comm__start.html#gga9c44bbce9f6f6b19b623837914959c02ad9bcb56a6668b6ba6f37edc73a796b58 .. _`zb_bdb_finding_binding_initiator()`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.3.0/group__zboss__bdb__comm__fb.html#gae6fd60a050559ef0aa3c3e5ec32bc515 -.. _`TF-M documentation`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/index.html -.. _`TF-M secure partition integration guide`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/integration_guide/services/tfm_secure_partition_addition.html -.. _`TF-M ITS`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/integration_guide/services/tfm_its_integration_guide.html - -.. _`nRF socket options`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_modem/doc/sockets.html#socket-options - -.. _`Repositories and revisions for v2.6.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.5.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.5.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.5.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/releases_and_maturity/repository_revisions.html -.. _`Repositories and revisions for v2.4.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.3/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.4.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.4.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.1/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.4.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.3.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.2.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/introduction.html#ncs-repository-revisions -.. _`Repositories and revisions for v2.1.4`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.4/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.1.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.3/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.1.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.1.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.1/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.1.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.0.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.0.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.1/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v2.0.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v1.9.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.2/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions for v1.9.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/introduction.html#repositories-and-revisions -.. _`Repositories and revisions`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/nrf/introduction.html#repositories-and-revisions - -.. _`Modem library changelog for v2.6.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.5.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.5.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.5.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.4.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.3/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.4.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.4.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.1/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.4.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.3.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.2.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.1.4`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.4/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.1.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.3/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.1.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.1.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.1/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.1.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.0.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.0.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.1/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v2.0.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v1.9.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.2/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v1.9.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog -.. _`Modem library changelog for v1.9.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog - -.. _`LwM2M carrier library changelog for v2.6.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.5.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.2/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.5.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.5.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.4.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.3/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.4.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.2/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.4.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.1/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.4.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.4.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.3.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.2.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.1.4`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.4/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.1.3`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.3/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.1.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.1.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.1/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.1.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.0.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.2/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.0.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.1/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v2.0.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v1.9.2`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.2/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v1.9.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog -.. _`LwM2M carrier library changelog for v1.9.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog - -.. _`Migration guide for nRF Connect SDK v2.6.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/migration/migration_guide_2.6.html -.. _`Migration guide for nRF Connect SDK v2.5.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/migration/migration_guide_2.5.html -.. _`Migration guide for nRF Connect SDK v2.0.0`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.html - -.. _`Matter weather station application from the v2.1.1`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.1/nrf/applications/matter_weather_station/README.html - -.. _`CONFIG_BT_CTLR_TX_PWR_MINUS`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#!CONFIG_BT_CTLR_TX_PWR_MINUS -.. _`CONFIG_BT_CTLR_TX_PWR_PLUS`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#!CONFIG_BT_CTLR_TX_PWR_PLUS - -.. _`Threads`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/threads/index.html#threads - -.. _`Network Traffic Generator`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/networking/api/zperf.html#zperf-network-traffic-generator - -.. _`Zephyr Logging`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html -.. _`Dictionary-based Logging`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html#dictionary-based-logging -.. _`Run-time Filtering`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/logging/index.html#run-time-filtering - -.. _`Capabilities for the LE Audio Controller Subsystem for nRF5340`: https://developer.nordicsemi.com/nRF_Connect_SDK/nrf5340_audio/bt_ll_acs_nrf53/bt_ll_acs_nrf53_capabilities.pdf +.. _`TF-M documentation`: https://docs.nordicsemi.com/bundle/ncs-latest/page/tfm/index.html +.. _`TF-M secure partition integration guide`: https://docs.nordicsemi.com/bundle/ncs-latest/page/tfm/integration_guide/services/tfm_secure_partition_addition.html +.. _`TF-M ITS`: https://docs.nordicsemi.com/bundle/ncs-latest/page/tfm/integration_guide/services/tfm_its_integration_guide.html + +.. _`nRF socket options`: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/nrf_modem/doc/sockets.html + +.. _`Repositories and revisions for v2.6.99-cs1`: https://docs.nordicsemi.com/bundle/ncs-2.6.99-cs1/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.6.1`: https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.6.0`: https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.5.3`: https://docs.nordicsemi.com/bundle/ncs-2.5.3/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.5.2`: https://docs.nordicsemi.com/bundle/ncs-2.5.2/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.5.1`: https://docs.nordicsemi.com/bundle/ncs-2.5.1/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.5.0`: https://docs.nordicsemi.com/bundle/ncs-2.5.0/page/nrf/releases_and_maturity/repository_revisions.html +.. _`Repositories and revisions for v2.4.3`: https://docs.nordicsemi.com/bundle/ncs-2.4.3/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.4.2`: https://docs.nordicsemi.com/bundle/ncs-2.4.2/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.4.1`: https://docs.nordicsemi.com/bundle/ncs-2.4.1/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.4.0`: https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.3.0`: https://docs.nordicsemi.com/bundle/ncs-2.3.0/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.2.0`: https://docs.nordicsemi.com/bundle/ncs-2.2.0/page/nrf/introduction.html#nrf_connect_sdk_repository_revisions +.. _`Repositories and revisions for v2.1.4`: https://docs.nordicsemi.com/bundle/ncs-2.1.4/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.1.3`: https://docs.nordicsemi.com/bundle/ncs-2.1.3/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.1.2`: https://docs.nordicsemi.com/bundle/ncs-2.1.2/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.1.1`: https://docs.nordicsemi.com/bundle/ncs-2.1.1/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.1.0`: https://docs.nordicsemi.com/bundle/ncs-2.1.0/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.0.2`: https://docs.nordicsemi.com/bundle/ncs-2.0.2/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.0.1`: https://docs.nordicsemi.com/bundle/ncs-2.0.1/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v2.0.0`: https://docs.nordicsemi.com/bundle/ncs-2.0.0/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v1.9.2`: https://docs.nordicsemi.com/bundle/ncs-1.9.2/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions for v1.9.1`: https://docs.nordicsemi.com/bundle/ncs-1.9.1/page/nrf/introduction.html#repositories_and_revisions +.. _`Repositories and revisions`: https://docs.nordicsemi.com/bundle/ncs-1.9.0/page/nrf/introduction.html#repositories_and_revisions + +.. _`Modem library changelog for v2.6.1`: https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog +.. _`Modem library changelog for v2.6.0`: https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.5.3`: https://docs.nordicsemi.com/bundle/ncs-2.5.3/page/nrfxlib/nrf_modem/doc/CHANGELOG.html#nrf-modem-changelog +.. _`Modem library changelog for v2.5.2`: https://docs.nordicsemi.com/bundle/ncs-2.5.2/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.5.1`: https://docs.nordicsemi.com/bundle/ncs-2.5.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.5.0`: https://docs.nordicsemi.com/bundle/ncs-2.5.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.4.3`: https://docs.nordicsemi.com/bundle/ncs-2.4.3/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.4.2`: https://docs.nordicsemi.com/bundle/ncs-2.4.2/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.4.1`: https://docs.nordicsemi.com/bundle/ncs-2.4.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.4.0`: https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.3.0`: https://docs.nordicsemi.com/bundle/ncs-2.3.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.2.0`: https://docs.nordicsemi.com/bundle/ncs-2.2.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.1.4`: https://docs.nordicsemi.com/bundle/ncs-2.1.4/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.1.3`: https://docs.nordicsemi.com/bundle/ncs-2.1.3/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.1.2`: https://docs.nordicsemi.com/bundle/ncs-2.1.2/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.1.1`: https://docs.nordicsemi.com/bundle/ncs-2.1.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.1.0`: https://docs.nordicsemi.com/bundle/ncs-2.1.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.0.2`: https://docs.nordicsemi.com/bundle/ncs-2.0.2/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.0.1`: https://docs.nordicsemi.com/bundle/ncs-2.0.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v2.0.0`: https://docs.nordicsemi.com/bundle/ncs-2.0.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v1.9.2`: https://docs.nordicsemi.com/bundle/ncs-1.9.2/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v1.9.1`: https://docs.nordicsemi.com/bundle/ncs-1.9.1/page/nrfxlib/nrf_modem/doc/CHANGELOG.html +.. _`Modem library changelog for v1.9.0`: https://docs.nordicsemi.com/bundle/ncs-1.9.0/page/nrfxlib/nrf_modem/doc/CHANGELOG.html + +.. _`LwM2M carrier library changelog for v2.6.1`: https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog +.. _`LwM2M carrier library changelog for v2.6.0`: https://docs.nordicsemi.com/bundle/ncs-2.6.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.5.3`: https://docs.nordicsemi.com/bundle/ncs-2.5.3/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html#liblwm2m-carrier-changelog +.. _`LwM2M carrier library changelog for v2.5.2`: https://docs.nordicsemi.com/bundle/ncs-2.5.2/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.5.1`: https://docs.nordicsemi.com/bundle/ncs-2.5.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.5.0`: https://docs.nordicsemi.com/bundle/ncs-2.5.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.4.3`: https://docs.nordicsemi.com/bundle/ncs-2.4.3/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.4.2`: https://docs.nordicsemi.com/bundle/ncs-2.4.2/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.4.1`: https://docs.nordicsemi.com/bundle/ncs-2.4.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.4.0`: https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.3.0`: https://docs.nordicsemi.com/bundle/ncs-2.3.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.2.0`: https://docs.nordicsemi.com/bundle/ncs-2.2.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.1.4`: https://docs.nordicsemi.com/bundle/ncs-2.1.4/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.1.3`: https://docs.nordicsemi.com/bundle/ncs-2.1.3/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.1.2`: https://docs.nordicsemi.com/bundle/ncs-2.1.2/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.1.1`: https://docs.nordicsemi.com/bundle/ncs-2.1.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.1.0`: https://docs.nordicsemi.com/bundle/ncs-2.1.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.0.2`: https://docs.nordicsemi.com/bundle/ncs-2.0.2/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.0.1`: https://docs.nordicsemi.com/bundle/ncs-2.0.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v2.0.0`: https://docs.nordicsemi.com/bundle/ncs-2.0.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v1.9.2`: https://docs.nordicsemi.com/bundle/ncs-1.9.2/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v1.9.1`: https://docs.nordicsemi.com/bundle/ncs-1.9.1/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html +.. _`LwM2M carrier library changelog for v1.9.0`: https://docs.nordicsemi.com/bundle/ncs-1.9.0/page/nrf/libraries/bin/lwm2m_carrier/CHANGELOG.html + +.. _`Migration guide for nRF Connect SDK v2.6.0`: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_2.6.html +.. _`Migration guide for nRF Connect SDK v2.5.0`: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_2.5.html +.. _`Migration guide for nRF Connect SDK v2.0.0`: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.html + +.. _`Matter weather station application from the v2.1.1`: https://docs.nordicsemi.com/bundle/ncs-2.1.1/page/nrf/applications/matter_weather_station/README.html + +.. _`CONFIG_BT_CTLR_TX_PWR_MINUS`: https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#!CONFIG_BT_CTLR_TX_PWR_MINUS +.. _`CONFIG_BT_CTLR_TX_PWR_PLUS`: https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#!CONFIG_BT_CTLR_TX_PWR_PLUS + +.. _`Threads`: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/kernel/services/threads/index.html + +.. _`Network Traffic Generator`: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/networking/api/zperf.html + +.. _`Zephyr Logging`: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/logging/index.html +.. _`Dictionary-based Logging`: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/logging/index.html#dictionary-based_logging +.. _`Run-time Filtering`: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/logging/index.html#runtime_filtering .. _`nRF9160: GPS with SUPL client library`: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.2.0/nrf/samples/nrf9160/gps/README.html @@ -453,6 +478,9 @@ .. _`nRF5340 DK Downloads`: https://www.nordicsemi.com/Products/Development-hardware/nRF5340-DK/Download?lang=en#infotabs .. _`nRF5340 DK product page`: https://www.nordicsemi.com/Products/Development-hardware/nRF5340-DK/ +.. _`nRF70 Series product page`: https://www.nordicsemi.com/Products/WiFi/Products#infotabs +.. _`nRF7002 DK Downloads`: https://www.nordicsemi.com/Products/Development-hardware/nRF7002-DK/Download?lang=en#infotabs +.. _`nRF7002 EB get started`: https://www.nordicsemi.com/Products/Development-hardware/nRF7002-Expansion-Board/Get-started?lang=en#infotabs .. _`Nordic Thingy:53`: .. _`Thingy:53 product page`: https://www.nordicsemi.com/thingy53 @@ -468,6 +496,7 @@ .. _`nPM1300 product website`: https://www.nordicsemi.com/products/npm1300 .. _`nPM1300 EK product page`: https://www.nordicsemi.com/Products/Development-hardware/nPM1300-EK +.. _`nPM1300 EK get started`: https://www.nordicsemi.com/Products/Development-hardware/nPM1300-EK/Get-started?lang=en#infotabs .. _`nRF Desktop reference design page`: https://www.nordicsemi.com/Products/Reference-designs/nRF-Desktop @@ -475,10 +504,6 @@ .. _`iBasis network coverage spreadsheet`: https://www.nordicsemi.com/-/media/Software-and-other-downloads/3rd-party/iBasis-simplified-coverage-map-for-web.pdf?la=en&hash=CA7DBF400243D8A7A7BDA94873B50E73C26B4FAC -.. _`Onomondo LTE-M coverage`: https://onomondo.com/product/coverage/lte-m-networks/ - -.. _`Onomondo NB-IoT coverage`: https://onomondo.com/product/coverage/nb-iot-networks/ - .. _`Contact Us`: https://www.nordicsemi.com/About-us/Contact-Us .. _`Nordic Semiconductor Wi-Fi products`: https://www.nordicsemi.com/Products/WiFi @@ -487,7 +512,6 @@ .. #### Source: www.nordicsemi.com/Events/ - .. _`nRF Connect SDK v2.6.0 webinar`: https://www.nordicsemi.com/Events/2024/Webinar-Exciting-new-features-in-nRF-Connect-SDK-v260 .. _`nRF Connect SDK v2.5.0 webinar`: https://www.nordicsemi.com/Events/2023/Webinar-Exciting-new-features-in-nRF-Connect-SDK-v250 .. _`nRF Connect SDK v2.4.0 webinar`: https://www.nordicsemi.com/Events/2023/Webinar-Exciting-new-features-in-nRF-Connect-SDK-v240 @@ -525,210 +549,217 @@ .. _`nRF Edge Impulse mobile app`: https://cm.nordicsemi.com/Products/Development-tools/nrf-edge-impulse +.. ### Source: infocenter.nordicsemi.com + +.. _`Nordic Semiconductor Infocenter`: https://infocenter.nordicsemi.com/index.jsp + .. ### Source: docs.nordicsemi.com .. _`Nordic Semiconductor TechDocs`: https://docs.nordicsemi.com .. _`nRF Connect Board Configurator`: https://docs.nordicsemi.com/bundle/nrf-connect-board-configurator/page/index.html +.. _`Serial Terminal from nRF Connect for Desktop`: https://docs.nordicsemi.com/bundle/nrf-connect-serial-terminal/page/index.html .. _`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 + .. _`Managing credentials`: https://docs.nordicsemi.com/bundle/nrf-connect-cellularmonitor/page/managing_credentials.html +.. _`nRF Connect Direct Test Mode`: https://docs.nordicsemi.com/bundle/nrf-connect-direct-test-mode/page/index.html + .. _`nRF Connect Programmer`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/index.html .. _`Programming the nRF52840 Dongle`: .. _`Programming a Development Kit`: https://docs.nordicsemi.com/bundle/nrf-connect-programmer/page/programming_dk.html -.. ### Source: infocenter.nordicsemi.com +.. _`nRF Sniffer for Bluetooth LE`: https://docs.nordicsemi.com/bundle/nrfutil/page/nrfutil-ble-sniffer/guides/overview.html -.. _`Nordic Semiconductor Infocenter`: https://infocenter.nordicsemi.com/index.jsp +.. _`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 + +.. _`Power Profiler Kit II (PPK2)`: https://docs.nordicsemi.com/bundle/ug_ppk2/page/UG/ppk/PPK_user_guide_Intro.html +.. _`Install the Power Profiler app`: https://docs.nordicsemi.com/bundle/ug_ppk2/page/UG/common/nrf_connect_app_installing.html +.. _`Using the Power Profiler app`: https://docs.nordicsemi.com/bundle/ug_ppk2/page/UG/ppk/PPK_user_guide_Running_the_software.html +.. _`nRF Connect Power Profiler`: https://docs.nordicsemi.com/bundle/nrf-connect-ppk/page/index.html -.. _`nRF pynrfjprog`: https://infocenter.nordicsemi.com/topic/ug_pynrfjprog/UG/pynrfjprog/pynrfjprog_lpage.html +.. _`sysbuild support`: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/build_overview.html#system-build-sysbuild -.. _`nRF9160 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf9160/nRF9160_html5_keyfeatures.html -.. _`nRF9160 GPS receiver specification`: https://infocenter.nordicsemi.com/topic/ps_nrf9160/gps.html -.. _`nRF9160 SiP pin configuration`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/sip_pin_configuration/sip_pin_configuration.html -.. _`Measuring current on nRF9160 DK`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/hw_measure_current.html +.. _`Electrical specification for nRF7002`: https://docs.nordicsemi.com/bundle/ps_nrf7002/page/chapters/elspec/doc/electrical_specification.html + +.. _`nRF pynrfjprog`: https://docs.nordicsemi.com/bundle/ug_pynrfjprog/page/UG/pynrfjprog/pynrfjprog_lpage.html -.. _`nRF9160 DK GPS`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/gps.html +.. _`nRF9160 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/nRF9160_html5_keyfeatures.html +.. _`nRF9160 GPS receiver specification`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/gps.html +.. _`nRF9160 SiP pin configuration`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/sip_pin_configuration/sip_pin_configuration.html +.. _`Measuring current on nRF9160 DK`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/hw_measure_current.html -.. _`nWP044 - Best practices for cellular IoT development`: https://infocenter.nordicsemi.com/topic/nwp_044/WP/nwp_044/lte_technology.html -.. _`Security protocol for cellular IoT`: https://infocenter.nordicsemi.com/topic/nwp_044/WP/nwp_044/security_protocols.html +.. _`nRF9160 DK GPS`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/gps.html -.. _`nRF9160 DK Hardware`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/intro.html -.. _`nRF9160 DK board control section in the nRF9160 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/board_controller.html -.. _`External memory section in the nRF9160 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/external_memory.html -.. _`Device programming section in the nRF9160 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/mcu_device_programming.html -.. _`VDD supply rail section in the nRF9160 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/power_sources_vdd.html +.. _`nWP044 - Best practices for cellular IoT development`: https://docs.nordicsemi.com/bundle/nwp_044/page/WP/nwp_044/lte_technology.html +.. _`Security protocol for cellular IoT`: https://docs.nordicsemi.com/bundle/nwp_044/page/WP/nwp_044/security_protocols.html -.. _`nRF9161 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf9161/nRF9161_html5_keyfeatures.html -.. _`nRF9161 GPS receiver specification`: https://infocenter.nordicsemi.com/topic/ps_nrf9161/gps.html +.. _`nRF9160 DK Hardware`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/intro.html +.. _`nRF9160 DK board control section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/board_controller.html +.. _`External memory section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/external_memory.html +.. _`Device programming section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/mcu_device_programming.html +.. _`VDD supply rail section in the nRF9160 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/power_sources_vdd.html -.. _`nRF9161 DK Hardware`: https://infocenter.nordicsemi.com/topic/ug_nrf9161_dk/UG/nrf91_DK/intro.html -.. _`Measuring current on nRF9161 DK`: https://infocenter.nordicsemi.com/topic/ug_nrf9161_dk/UG/nrf91_DK/measuring_current/hw_measure_current.html +.. _`nRF9161 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf9161/page/nRF9161_html5_keyfeatures.html +.. _`nRF9161 GPS receiver specification`: https://docs.nordicsemi.com/bundle/ps_nrf9161/page/gps.html + +.. _`nRF9161 DK Hardware`: https://docs.nordicsemi.com/bundle/ug_nrf9161_dk/page/UG/nrf91_DK/intro.html +.. _`Measuring current on nRF9161 DK`: https://docs.nordicsemi.com/bundle/ug_nrf9161_dk/page/UG/nrf91_DK/measuring_current/hw_measure_current.html .. _`AT Commands Reference Guide`: -.. _`nRF9160 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/intro_nrf9160.html +.. _`nRF9160 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/intro_nrf9160.html .. _`band lock section in the AT Commands reference document`: -.. _`band lock section in the nRF9160 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/xbandlock.html +.. _`band lock section in the nRF9160 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mob_termination_ctrl_status/xbandlock.html .. _`system mode section in the AT Commands reference document`: -.. _`system mode section in the nRF9160 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/xsystemmode.html -.. _`Credential storage management %CMNG`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/security/cmng.html -.. _`Packet Domain AT commands`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/packet_domain/packet_domain.html -.. _`3GPP Release 14 features AT command`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/rel14feat_read.html -.. _`AT+CNEC set command`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mobile_termination_errors/cnec_set.html -.. _`AT+CGEREP set command`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/packet_domain/cgerep_set.html -.. _`AT%CONEVAL`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/coneval.html +.. _`system mode section in the nRF9160 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mob_termination_ctrl_status/xsystemmode.html +.. _`Credential storage management %CMNG`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/security/cmng.html +.. _`Packet Domain AT commands`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/packet_domain/packet_domain.html +.. _`3GPP Release 14 features AT command`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/nw_service/rel14feat.html +.. _`AT+CNEC set command`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mobile_termination_errors/cnec_set.html +.. _`AT+CGEREP set command`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/packet_domain/cgerep_set.html +.. _`AT%CONEVAL`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mob_termination_ctrl_status/coneval_set.html .. _`Modem trace AT command documentation`: -.. _`modem trace activation %XMODEMTRACE`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/xmodemtrace.html -.. _`Battery voltage low level %XVBATLOWLVL`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/xvbatlowlvl.html -.. _`Power saving mode setting`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/cpsms.html -.. _`Release Assistance Indication (RAI)`: https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xrai.html - -.. _`nRF91x1 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/intro_nrf91x1.html -.. _`band lock section in the nRF91x1 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/mob_termination_ctrl_status/xbandlock.html -.. _`system mode section in the nRF91x1 AT Commands Reference Guide`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/mob_termination_ctrl_status/xsystemmode.html -.. _`nRF91x1 battery voltage low level %XVBATLOWLVL`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/mob_termination_ctrl_status/xvbatlowlvl.html -.. _`nRF91x1 credential storage management %CMNG`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/security/cmng.html -.. _`nRF91x1 AT+CGEREP set command`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/packet_domain/cgerep_set.html -.. _`nRF91x1 packet Domain AT commands`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/packet_domain/packet_domain.html -.. _`nRF91x1 AT+CNEC set command`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/mobile_termination_errors/cnec_set.html -.. _`nRF91x1 Power saving mode setting`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/nw_service/cpsms.html -.. _`nRF91x1 modem trace activation %XMODEMTRACE`: https://infocenter.nordicsemi.com/topic/ref_at_commands_nrf91x1/REF/at_commands/mob_termination_ctrl_status/xmodemtrace.html - -.. _`nRF5340 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf5340/keyfeatures_html5.html -.. _`nRF5340 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf5340_dk/UG/dk/intro.html -.. _`Execute in place page in the nRF5340 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf5340/qspi.html#execute_in_place +.. _`modem trace activation %XMODEMTRACE`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mob_termination_ctrl_status/xmodemtrace_set.html +.. _`Battery voltage low level %XVBATLOWLVL`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/mob_termination_ctrl_status/xvbatlowlvl.html +.. _`Power saving mode setting`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/nw_service/cpsms.html +.. _`Release Assistance Indication (RAI)`: https://docs.nordicsemi.com/bundle/ref_at_commands/page/REF/at_commands/nw_service/xrai.html + +.. _`nRF91x1 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/intro_nrf91x1.html +.. _`band lock section in the nRF91x1 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/mob_termination_ctrl_status/xbandlock.html +.. _`system mode section in the nRF91x1 AT Commands Reference Guide`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/mob_termination_ctrl_status/xsystemmode.html +.. _`nRF91x1 battery voltage low level %XVBATLOWLVL`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/mob_termination_ctrl_status/xvbatlvl.html +.. _`nRF91x1 credential storage management %CMNG`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/security/cmng.html +.. _`nRF91x1 AT+CGEREP set command`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/packet_domain/cgerep.html +.. _`nRF91x1 packet Domain AT commands`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/packet_domain/packet_domain.html +.. _`nRF91x1 AT+CNEC set command`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/mobile_termination_errors/cnec_set.html +.. _`nRF91x1 Power saving mode setting`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/nw_service/cpsms.html +.. _`nRF91x1 modem trace activation %XMODEMTRACE`: https://docs.nordicsemi.com/bundle/ref_at_commands_nrf91x1/page/REF/at_commands/mob_termination_ctrl_status/xmodemtrace.html + +.. _`nRF53 Series`: https://docs.nordicsemi.com/category/nrf-53-series + +.. _`nRF5340 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/keyfeatures_html5.html +.. _`nRF5340 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf5340_dk/page/UG/dk/intro.html +.. _`Execute in place page in the nRF5340 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/qspi.html#d1789e363 .. _`nRF5340 DK Compatibility Matrix`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf5340/page/COMP/nrf5340/nrf5340_comp_matrix.html -.. _`nRF5340 Audio DK Hardware`: https://infocenter.nordicsemi.com/topic/ug_nrf5340_audio/UG/nrf5340_audio/intro.html -.. _`Requirements for external flash memory DFU`: https://infocenter.nordicsemi.com/topic/ug_nrf5340_audio/UG/nrf5340_audio/hw_external_memory.html +.. _`nRF5340 Audio DK Hardware`: https://docs.nordicsemi.com/bundle/ug_nrf5340_audio/page/UG/nrf5340_audio/intro.html +.. _`Requirements for external flash memory DFU`: https://docs.nordicsemi.com/bundle/ug_nrf5340_audio/page/UG/nrf5340_audio/hw_external_memory.html -.. _`RESETREAS`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf5340%2Fchapters%2Freset%2Fdoc%2Freset.html&cp=4_0_0_3_9_10_0&anchor=register.RESETREAS +.. _`RESETREAS`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/reset/doc/reset.html#ariaid-title13 -.. _`nRF52840 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52840/keyfeatures_html5.html -.. _`System OFF mode`: https://infocenter.nordicsemi.com/topic/ps_nrf52840/power.html?cp=5_0_0_4_2_2#unique_220399309 -.. _`nRF52840 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/intro.html -.. _`nRF52840 Dongle User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf52840_dongle/UG/nrf52840_Dongle/intro.html +.. _`nRF52840 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf52840/page/keyfeatures_html5.html +.. _`System OFF mode`: https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#ariaid-title10 +.. _`nRF52840 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf52840_dk/page/UG/dk/intro.html +.. _`nRF52840 Dongle User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf52840_dongle/page/UG/nrf52840_Dongle/intro.html .. _`nRF52840 DK Compatibility Matrix`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf52840/page/COMP/nrf52840/nrf52840_comp_matrix.html -.. _`nRF52833 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52833/keyfeatures_html5.html -.. _`nRF52833 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf52833_dk/UG/dk/intro.html +.. _`nRF52833 Product Specification`: https://docs.nordicsemi.com/bundle?labelkey=nrf52833&labelkey=product-specification +.. _`nRF52833 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf52833_dk/page/UG/dk/intro.html -.. _`nRF52 Series`: https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52.html -.. _`nRF52832 Product Specification`: https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52832_ps.html -.. _`nRF52832 Temperature Sensor Electrical Specification`: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/temp.html?cp=4_2_0_26_1_0#unique_339758917 +.. _`nRF52 Series`: https://docs.nordicsemi.com/category/nrf-52-series +.. _`nRF52832 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf52832/page/nrf52832_ps.html +.. _`nRF52832 Temperature Sensor Electrical Specification`: https://docs.nordicsemi.com/bundle/ps_nrf52832/page/temp.html#d949e9367 -.. _`nRF52 DK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/intro.html +.. _`nRF52 DK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf52832_dk/page/UG/dk/intro.html -.. _`nRF52820 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52820/keyfeatures_html5.html +.. _`nRF52820 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf52820/page/keyfeatures_html5.html -.. _`nRF52811 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52811/keyfeatures_html5.html +.. _`nRF52811 Product Specification`: https://docs.nordicsemi.com/bundle?labelkey=nrf52811&labelkey=product-specification -.. _`nRF52810 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52810/keyfeatures_html5.html +.. _`nRF52810 Product Specification`: https://docs.nordicsemi.com/bundle?labelkey=nrf52810&labelkey=product-specification -.. _`nRF52805 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf52805/keyfeatures_html5.html +.. _`nRF52805 Product Specification`: https://docs.nordicsemi.com/bundle?labelkey=nrf52805&labelkey=product-specification -.. _`nRF21540`: https://infocenter.nordicsemi.com/topic/struct_fem/struct/nrf21540.html -.. _`nRF21540 Product Specification`: https://infocenter.nordicsemi.com/topic/struct_fem/struct/nrf21540_ps.html +.. _`nRF21540`: https://docs.nordicsemi.com/bundle/ug_nrf21540_dk/page/UG/nrf21540_DK/intro.html +.. _`nRF21540 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf21540/page/keyfeatures_html5.html -.. _`nRF7001 Product Specification`: https://infocenter.nordicsemi.com/topic/ps_nrf7001/keyfeatures_html5.html +.. _`nRF7001 Product Specification`: https://docs.nordicsemi.com/bundle/ps_nrf7001/page/keyfeatures_html5.html .. _`nRF7002 Product Specification`: -.. _`Product specification for nRF70 Series devices`: https://infocenter.nordicsemi.com/topic/ps_nrf7002/keyfeatures_html5.html -.. _`nRF7002 DK Hardware`: https://infocenter.nordicsemi.com/topic/ug_nrf7002_dk/UG/nrf7002_DK/intro.html +.. _`Product specification for nRF70 Series devices`: https://docs.nordicsemi.com/bundle/ps_nrf7002/page/keyfeatures_html5.html +.. _`nRF7002 DK Hardware`: https://docs.nordicsemi.com/bundle/ug_nrf7002_dk/page/UG/nrf7002_DK/intro.html .. _`nRF70 Series hardware documentation`: -.. _`nRF70 Series`: https://infocenter.nordicsemi.com/topic/struct_nrf70/struct/nrf70.html -.. _`nRF70 Series product page`: https://www.nordicsemi.com/Products/WiFi/Products#infotabs -.. _`Measuring current`: https://infocenter.nordicsemi.com/topic/ug_nrf7002_dk/UG/nrf7002_DK/hw_measure_current.html +.. _`nRF70 Series`: https://docs.nordicsemi.com/category/nrf-70-series -.. _`Guidelines and application notes for nRF70 Series devices`: https://infocenter.nordicsemi.com/topic/struct_nrf70/struct/nrf70_guidelines.html +.. _`Measuring current`: https://docs.nordicsemi.com/bundle/ug_nrf7002_dk/page/UG/nrf7002_DK/hw_measure_current.html -.. _`nRF70 Series power states`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf7002%2Fchapters%2Ffunctional%2Fdoc%2Fpower_states.html&cp=3_0_0_4_0 +.. _`Guidelines and application notes for nRF70 Series devices`: https://docs.nordicsemi.com/category/nrf-70-series -.. _`nRF7002 EK User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf7002_ek/UG/nrf7002_EK/intro.html -.. _`nRF7002 EB User Guide`: https://infocenter.nordicsemi.com/topic/ug_nrf7002_eb/UG/nrf7002_EB/intro.html +.. _`nRF70 Series power states`: https://docs.nordicsemi.com/bundle/ps_nrf7002/page/chapters/functional/doc/power_states.html -.. _`Programming SoCs with nrfjprog`: https://infocenter.nordicsemi.com/topic/ug_nrf_cltools/UG/cltools/nrf_nrfjprogexe.html +.. _`nRF7002 EK User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf7002_ek/page/UG/nrf7002_EK/intro.html +.. _`nRF7002 EB User Guide`: https://docs.nordicsemi.com/bundle/ug_nrf7002_eb/page/UG/nrf7002_EB/intro.html +.. _`nRF7002 EK`: https://docs.nordicsemi.com/bundle/ug_nrf7002_ek/page/UG/nrf7002_EK/intro.html -.. _`Nordic Thingy:53 Hardware`: https://infocenter.nordicsemi.com/topic/ug_thingy53/UG/thingy53/intro/frontpage.html -.. _`Nordic Thingy:53 Regulatory notices`: https://infocenter.nordicsemi.com/topic/ug_thingy53/UG/thingy53/regulatory/regulatory_notices.html +.. _`Programming SoCs with nrfjprog`: https://docs.nordicsemi.com/bundle/ug_nrf_cltools/page/UG/cltools/nrf_nrfjprogexe.html -.. _`Nordic Thingy:91 User Guide`: https://infocenter.nordicsemi.com/topic/ug_thingy91/UG/thingy91/intro/frontpage.html +.. _`Nordic Thingy:53 Hardware`: https://docs.nordicsemi.com/bundle/ug_thingy53/page/UG/thingy53/intro/frontpage.html +.. _`Nordic Thingy:53 Regulatory notices`: https://docs.nordicsemi.com/bundle/ug_thingy53/page/UG/thingy53/regulatory/regulatory_notices.html -.. _`Programming application and modem firmware on Thingy:91`: https://infocenter.nordicsemi.com/topic/ug_thingy91_gsg/UG/thingy91_gsg/updating_fw.html +.. _`Nordic Thingy:91 User Guide`: https://docs.nordicsemi.com/bundle/ug_thingy91/page/UG/thingy91/intro/frontpage.html -.. _`Measuring Current on Thingy:91`: https://infocenter.nordicsemi.com/topic/ug_thingy91/UG/thingy91/hw_description/hw_power_current_measurement.html +.. _`Measuring Current on Thingy:91`: https://docs.nordicsemi.com/bundle/ug_thingy91/page/UG/thingy91/hw_description/hw_power_current_measurement.html -.. _`nPM1300`: https://infocenter.nordicsemi.com/topic/struct_pmic/struct/npm1300.html -.. _`nPM1300 EK User Guide`: https://infocenter.nordicsemi.com/topic/ug_npm1300_ek/UG/nPM1300_EK/intro.html +.. _`nPM1300`: https://docs.nordicsemi.com/category/npm1300-category +.. _`nPM1300 EK User Guide`: https://docs.nordicsemi.com/bundle/ug_npm1300_ek/page/UG/nPM1300_EK/intro.html -.. _`AP-Protect for nRF9161`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9161%2Fdif.html&anchor=ariaid-title3 -.. _`Debugger access protection for nRF9160`: https://infocenter.nordicsemi.com/topic/ps_nrf9160/dif.html#debugger_access -.. _`AP-Protect for nRF5340`: https://infocenter.nordicsemi.com/topic/ps_nrf5340/debugandtrace.html#access_port_protection -.. _`AP-Protect for nRF52840`: https://infocenter.nordicsemi.com/topic/ps_nrf52840/dif.html#concept_udr_mns_1s +.. _`AP-Protect for nRF9161`: https://docs.nordicsemi.com/bundle/ps_nrf9161/page/dif.html#ariaid-title3 +.. _`Debugger access protection for nRF9160`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/dif.html#ariaid-title2 +.. _`AP-Protect for nRF5340`: https://docs.nordicsemi.com/bundle/ps_nrf5340/page/debugandtrace.html#ariaid-title9 +.. _`AP-Protect for nRF52840`: https://docs.nordicsemi.com/bundle/ps_nrf52840/page/dif.html#ariaid-title3 .. _`AP-Protect for nRF52833`: https://infocenter.nordicsemi.com/topic/ps_nrf52833/dif.html#concept_udr_mns_1s -.. _`AP-Protect for nRF52832`: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/dif.html#concept_udr_mns_1s -.. _`AP-Protect for nRF52820`: https://infocenter.nordicsemi.com/topic/ps_nrf52820/dif.html#concept_udr_mns_1s +.. _`AP-Protect for nRF52832`: https://docs.nordicsemi.com/bundle/ps_nrf52832/page/dif.html#d913e149 +.. _`AP-Protect for nRF52820`: https://docs.nordicsemi.com/bundle/ps_nrf52820/page/dif.html#ariaid-title3 .. _`AP-Protect for nRF52811`: https://infocenter.nordicsemi.com/topic/ps_nrf52811/dif.html#concept_udr_mns_1s .. _`AP-Protect for nRF52810`: https://infocenter.nordicsemi.com/topic/ps_nrf52810/dif.html#concept_udr_mns_1s .. _`AP-Protect for nRF52805`: https://infocenter.nordicsemi.com/topic/ps_nrf52805/dif.html#concept_udr_mns_1s -.. _`Mobile network operator certifications`: https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_operator_certifications.html -.. _`Modem firmware compatibility matrix`: https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_modem_fw.html +.. _`Mobile network operator certifications`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf9160/page/COMP/nrf9160/nrf9160_operator_certifications.html +.. _`Modem firmware compatibility matrix`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf9160/page/COMP/nrf9160/nrf9160_modem_fw.html -.. _`Electrical specification of nRF9160`: https://infocenter.nordicsemi.com/topic/ps_nrf9160/_tmp/alta.nRF9160/autodita/CURRENT/parameters.frontpage.html# +.. _`Electrical specification of nRF9160`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/_tmp/alta.nRF9160/autodita/APPLICATION.CURRENT/parameters.frontpage.html -.. _`nAN34`: https://infocenter.nordicsemi.com/pdf/nan_34.pdf +.. _`nAN34`: https://docs.nordicsemi.com/bundle/Application-Notes/resource/nan_34.pdf -.. _`nRF Util`: https://infocenter.nordicsemi.com/topic/ug_nrfutils/UG/nrfutils/nrfutil_intro.html -.. _`Installing nRF Util for nRF5 SDK`: https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_installing.html -.. _`DFU over Zigbee`: https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_dfu_zigbee.html -.. _`Generating DFU packages`: https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_pkg.html -.. _`DFU over a serial USB connection`: https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_dfu_serial_usb.html +.. _`nRF Util`: https://docs.nordicsemi.com/bundle/nrfutil/page/README.html +.. _`Installing nRF Util for nRF5 SDK`: https://docs.nordicsemi.com/bundle/nrfutil/page/guides-nrf5sdk/installing.html +.. _`DFU over Zigbee`: https://docs.nordicsemi.com/bundle/nrfutil/page/guides-nrf5sdk/dfu_performing.html#dfu-over-zigbee +.. _`Generating DFU packages`: https://docs.nordicsemi.com/bundle/nrfutil/page/guides-nrf5sdk/dfu_generating_packages.html +.. _`DFU over a serial USB connection`: https://docs.nordicsemi.com/bundle/nrfutil/page/guides-nrf5sdk/dfu_performing.html#dfu-over-a-serial-usb-connection -.. _`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://infocenter.nordicsemi.com/topic/ug_sniffer_802154/UG/sniffer_802154/configuring_sniffer_802154_zigbee.html - -.. _`Power Profiler Kit II (PPK2)`: https://infocenter.nordicsemi.com/topic/ug_ppk2/UG/ppk/PPK_user_guide_Intro.html -.. _`Install the Power Profiler app`: https://infocenter.nordicsemi.com/topic/ug_ppk2/UG/common/nrf_connect_app_installing.html -.. _`Using the Power Profiler app`: https://infocenter.nordicsemi.com/topic/ug_ppk2/UG/ppk/PPK_user_guide_Running_the_software.html -.. _`anomaly 19`: https://infocenter.nordicsemi.com/topic/errata_nRF5340_EngA/ERR/nRF5340/EngineeringA/latest/anomaly_340_19.html +.. _`anomaly 19`: https://docs.nordicsemi.com/bundle/errata_nRF5340_EngA/page/ERR/nRF5340/EngineeringA/latest/anomaly_340_19.html .. _`nRF5 SDK Bootloader`: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader.html .. _`nRF5 Bootloader DFU Mode`: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader.html#lib_bootloader_dfu_mode -.. _`System Protection Unit`: https://infocenter.nordicsemi.com/topic/ps_nrf9160/spu.html - -.. _`nRF9160 Hardware Verification Guidelines - UART interface`: https://infocenter.nordicsemi.com/topic/nwp_034/WP/nwp_034/nwp_034_uart_if.html -.. _`nRF9160 Antenna and RF Interface Guidelines`: https://infocenter.nordicsemi.com/topic/nwp_033/WP/nwp_033/nwp_033_intro.html -.. _`GPS interface and antenna`: https://infocenter.nordicsemi.com/topic/nwp_033/WP/nwp_033/nwp_033_gps.html +.. _`System Protection Unit`: https://docs.nordicsemi.com/bundle/ps_nrf9160/page/spu.html -.. _`nRF9160 SiP revisions and variants`: https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_ic_revision_overview.html - -.. _`SWD Select`: https://infocenter.nordicsemi.com/topic/ug_thingy91/UG/thingy91/hw_description/programming_debugging_interface.html - -.. _`access port protection mechanism`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fdif.html&anchor=concept_udr_mns_1s - -.. _`Electrical specification for nRF7002`: https://docs.nordicsemi.com/bundle/ps_nrf7002/page/chapters/elspec/doc/electrical_specification.html +.. _`nRF9160 Hardware Verification Guidelines - UART interface`: https://docs.nordicsemi.com/bundle/nwp_034/page/WP/nwp_034/uart_if.html +.. _`nRF9160 Antenna and RF Interface Guidelines`: https://docs.nordicsemi.com/bundle/nwp_033/page/WP/nwp_033/nwp_033_intro.html +.. _`GPS interface and antenna`: https://docs.nordicsemi.com/bundle/nwp_033/page/WP/nwp_033/nwp_033_gps.html -.. _`Wi-Fi Alliance Certification for nRF70 Series`: https://infocenter.nordicsemi.com/pdf/nwp_045.pdf +.. _`nRF9160 SiP revisions and variants`: https://docs.nordicsemi.com/bundle/comp_matrix_nrf9160/page/COMP/nrf9160/nrf9160_ic_revision_overview.html -.. _`Errata 254`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52840_Rev3%2FERR%2FnRF52840%2FRev3%2Flatest%2Fconfig_840_254.html +.. _`SWD Select`: https://docs.nordicsemi.com/bundle/ug_thingy91/page/UG/thingy91/hw_description/programming_debugging_interface.html -.. _`Errata 255`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52833_Rev2%2FERR%2FnRF52833%2FRev2%2Flatest%2Fconfig_833_255.html +.. _`access port protection mechanism`: https://docs.nordicsemi.com/bundle/ps_nrf52840/page/dif.html#ariaid-title3 -.. _`Errata 256`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52820_Rev3%2FERR%2FnRF52820%2FRev3%2Flatest%2Fconfig_820_256.html +.. _`Wi-Fi Alliance Certification for nRF70 Series`: https://docs.nordicsemi.com/bundle/nwp_045/page/WP/nwp_045/intro.html -.. _`Errata 257`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52811_Rev2%2FERR%2FnRF52811%2FRev2%2Flatest%2Fconfig_811_257.html - -.. _`Errata 117`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF5340_Rev1%2FERR%2FnRF5340%2FRev1%2Flatest%2Fanomaly_340_117.html - -.. _`Unauthorized Thread Network Key Update (SA-2023-234) vulnerability`: https://infocenter.nordicsemi.com/pdf/SA-2023-234-v1_1.pdf +.. _`Errata 254`: https://docs.nordicsemi.com/bundle/errata_nRF52840_Rev3/page/ERR/nRF52840/Rev3/latest/config_840_254.html +.. _`Errata 255`: https://docs.nordicsemi.com/bundle/errata_nRF52833_Rev2/page/ERR/nRF52833/Rev2/latest/config_833_255.html +.. _`Errata 256`: https://docs.nordicsemi.com/bundle/errata_nRF52820_Rev3/page/ERR/nRF52820/Rev3/latest/config_820_256.html +.. _`Errata 257`: https://docs.nordicsemi.com/bundle/errata_nRF52811_Rev2/page/ERR/nRF52811/Rev2/latest/config_811_257.html +.. _`Errata 117`: https://docs.nordicsemi.com/bundle/errata_nRF5340_Rev1/page/ERR/nRF5340/Rev1/latest/anomaly_340_117.html +.. _`Unauthorized Thread Network Key Update (SA-2023-234) vulnerability`: https://docs.nordicsemi.com/bundle/SA/resource/SA-2023-234-v1_1.pdf .. ### Source: academy.nordicsemi.com @@ -738,11 +769,13 @@ .. _`nRF Connect SDK Fundamentals course`: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/ .. _`Installing nRF Connect SDK and VS Code`: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-1-nrf-connect-sdk-introduction/topic/exercise-1-1/ +.. _`nRF Connect SDK Intermediate course`: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/ +.. _`Lesson 2 - Debugging and troubleshooting`: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/ + .. _`Cellular IoT Fundamentals course`: https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/ .. _`Power saving techniques`: https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-1-cellular-fundamentals/topic/lesson-1-power-saving-techniques/ .. _`Bluetooth LE Fundamentals course`: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/ .. _`Wi-Fi Fundamentals course`: https://academy.nordicsemi.com/courses/wi-fi-fundamentals/ -.. _`nRF Connect SDK Intermediate course`: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/ .. ### Source: devzone.nordicsemi.com @@ -778,6 +811,8 @@ .. _`Bluetooth 5.4 DevZone blog`: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/whats-new-in-bluetooth-v5-4-an-overview +.. _`Certifying a cellular IoT device`: https://blog.nordicsemi.com/getconnected/certifying-a-cellular-iot-device/ + .. ### Source: www.segger.com .. _`J-Link Software and Documentation Pack`: https://www.segger.com/downloads/jlink @@ -842,7 +877,7 @@ .. _`OMA LwM2M Object and Resource Registry`: https://technical.openmobilealliance.org/OMNA/LwM2M/LwM2MRegistry.html -.. ### Source: wikipedia +.. ### Source: en.wikipedia.org .. _`GNSS`: https://en.wikipedia.org/wiki/Satellite_navigation .. _`GPS`: https://en.wikipedia.org/wiki/Global_Positioning_System @@ -976,10 +1011,6 @@ .. _`Matter Simple Setup for Thread Overview`: https://developer.amazon.com/docs/frustration-free-setup/matter-simple-setup-for-thread-overview.html .. _`Amazon Alexa integration with Matter`: https://developer.amazon.com/en-US/docs/alexa/smarthome/matter-support.html -.. ### Source: *.amazontrust.com - -.. _`Amazon Root CA 1`: https://www.amazontrust.com/repository/AmazonRootCA1.pem - .. ### Source: openthread.io .. _`OpenThread.io`: https://openthread.io/ @@ -1067,7 +1098,7 @@ .. _`Nordic Semi Thingy:53 page`: https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/nordic-semi-thingy53 .. _`Nordic Semi nRF5340 DK page`: https://docs.edgeimpulse.com/docs/nordic-semi-nrf5340-dk -.. ### Source: memfault.com +.. ### Source: *.memfault.com .. _`Memfault`: https://memfault.com/ @@ -1082,20 +1113,17 @@ .. _`Memfault: Collecting Device Metrics`: https://docs.memfault.com/docs/embedded/metrics-api .. _`Memfault: Error Tracking with Trace Events`: https://docs.memfault.com/docs/embedded/trace-events/ .. _`Memfault Demo CLI`: https://docs.memfault.com/docs/mcu/demo-cli/ -.. _`Memfault Diagnostic GATT Service`: https://memfault.notion.site/Memfault-Diagnostic-GATT-Service-MDS-ffd5a430062649cd9bf6edbf64e2563b -.. _`Memfault WebBluetooth Client`: https://memfault.github.io/web-ble-example/ -.. _`Memfault WebBluetooth Client source code`: https://github.com/memfault/web-ble-example/blob/main/mds.js + .. _`Memfault Dashboards`: https://app.memfault.com .. _`Memfault debugging`: https://docs.memfault.com/docs/platform/introduction#debugging .. _`Memfault OTA`: https://docs.memfault.com/docs/platform/introduction#ota .. _`Memfault monitoring`: https://docs.memfault.com/docs/platform/introduction#metrics .. _`Memfault introduction`: https://docs.memfault.com/docs/platform/introduction -.. _`Memfault-SDK`: https://github.com/memfault/memfault-firmware-sdk + .. _`Memfault MCU Guide`: https://docs.memfault.com/docs/mcu/introduction .. _`Memfault: Reboot tracking`: https://docs.memfault.com/docs/mcu/reboot-reason-tracking .. _`Memfault: Coredumps`: https://docs.memfault.com/docs/mcu/coredumps - .. ### Source: *.nrfcloud.com .. _`nRF Cloud`: @@ -1103,33 +1131,33 @@ .. _`Provision Devices`: http://nrfcloud.com/#/provision-devices .. _`nRF Cloud documentation`: -.. _`nRF Connect for Cloud documentation`: https://docs.nrfcloud.com/ -.. _`nRF Cloud Device Messages`: https://docs.nrfcloud.com/Devices/MessagesAndAlerts/DeviceMessages.html -.. _`nRF Cloud Device ID`: https://docs.nrfcloud.com/Devices/Properties/DeviceId.html -.. _`nRF Cloud Device Shadows`: https://docs.nrfcloud.com/Devices/Properties/Shadows.html -.. _`nRF Cloud Security`: https://docs.nrfcloud.com/Devices/Security/Security.html -.. _`nRF Cloud Auto-onboarding`: https://docs.nrfcloud.com/Devices/Associations/Provisioning.html#auto-onboarding +.. _`nRF Connect for Cloud documentation`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/index.html +.. _`nRF Cloud Device Messages`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/MessagesAndAlerts/DeviceMessages.html +.. _`nRF Cloud Device ID`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Properties/DeviceId.html +.. _`nRF Cloud Device Shadows`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Properties/Shadows.html +.. _`nRF Cloud Security`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Security/Security.html +.. _`nRF Cloud Auto-onboarding`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Associations/Provisioning.html#auto-onboarding .. _`nRF Cloud device claiming`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/ProvisioningService/ClaimingDevices/ClaimingDeviceOwnershipPortal.html -.. _`nRF Cloud Preconnect Provisioning`: https://docs.nrfcloud.com/Devices/Associations/Provisioning.html#preconnect-provisioning -.. _`nRF Cloud Just-In-Time-Provisioning`: https://docs.nrfcloud.com/Devices/Associations/Provisioning.html#just-in-time-provisioning +.. _`nRF Cloud Preconnect Provisioning`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Associations/Provisioning.html#preconnect-provisioning +.. _`nRF Cloud Just-In-Time-Provisioning`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Associations/Provisioning.html#just-in-time-provisioning .. _`nRF Cloud Onboarding`: -.. _`nRF Cloud Provisioning`: https://docs.nrfcloud.com/Devices/Associations/Provisioning.html -.. _`nRF Cloud FOTA`: https://docs.nrfcloud.com/Devices/FirmwareUpdate/FOTAOverview.html -.. _`nRF Cloud MQTT FOTA`: https://docs.nrfcloud.com/Devices/FirmwareUpdate/FOTAOverview.html#mqtt-job-execution-notifications -.. _`nRF Cloud Getting Started FOTA documentation`: https://docs.nrfcloud.com/Devices/FirmwareUpdate/FOTATutorial.html -.. _`Securely generating credentials`: https://docs.nrfcloud.com/Devices/Security/Credentials.html -.. _`nRF Cloud provisioning configuration`: https://docs.nrfcloud.com/SecurityServices/ProvisioningService/ProvisioningConfiguration/ProvisioningConfigurationPortal.html -.. _`nRF Cloud Provisioning Service`: https://docs.nrfcloud.com/SecurityServices/ProvisioningService/ProvisioningOverview.html -.. _`nRF Cloud Verifying device authenticity`: https://docs.nrfcloud.com/SecurityServices/IdentityService/VerifyAttestationToken.html -.. _`nRF Cloud Generating attestation tokens`: https://docs.nrfcloud.com/SecurityServices/IdentityService/VerifyAttestationToken.html#generating-attestation-tokens +.. _`nRF Cloud Provisioning`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Associations/Provisioning.html +.. _`nRF Cloud FOTA`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/FirmwareUpdate/FOTAOverview.html +.. _`nRF Cloud MQTT FOTA`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/FirmwareUpdate/FOTAOverview.html#mqtt-job-execution-notifications +.. _`nRF Cloud Getting Started FOTA documentation`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/FirmwareUpdate/FOTATutorial.html +.. _`Securely generating credentials`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/Devices/Security/Credentials.html +.. _`nRF Cloud provisioning configuration`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/ProvisioningService/ProvisioningConfiguration/ProvisioningConfigurationPortal.html +.. _`nRF Cloud Provisioning Service`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/ProvisioningService/ProvisioningOverview.html +.. _`nRF Cloud Verifying device authenticity`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/IdentityService/VerifyAttestationToken.html +.. _`nRF Cloud Generating attestation tokens`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/SecurityServices/IdentityService/VerifyAttestationToken.html#generating-attestation-tokens .. _`nRF Cloud REST API`: -.. _`nRF Connect for Cloud REST API`: https://docs.nrfcloud.com/APIs/REST/RESTOverview.html -.. _`nRF Cloud REST API key`: https://docs.nrfcloud.com/APIs/REST/RESTOverview.html#api-key -.. _`nRF Cloud Location Services documentation`: https://docs.nrfcloud.com/LocationServices/LSOverview.html -.. _`nRF Cloud MQTT API`: https://docs.nrfcloud.com/APIs/MQTT/MQTTOverview.html -.. _`nRF Cloud MQTT Topics`: https://docs.nrfcloud.com/APIs/MQTT/Topics.html +.. _`nRF Connect for Cloud REST API`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/APIs/REST/RESTOverview.html +.. _`nRF Cloud REST API key`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/APIs/REST/RESTOverview.html#api-key +.. _`nRF Cloud Location Services documentation`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/LocationServices/LSOverview.html +.. _`nRF Cloud MQTT API`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/APIs/MQTT/MQTTOverview.html +.. _`nRF Cloud MQTT Topics`: https://docs.nordicsemi.com/bundle/nrf-cloud/page/APIs/MQTT/Topics.html .. _`nRF Cloud REST API (v1)`: https://api.nrfcloud.com/v1 .. _`nRF Cloud Patch Device State`: @@ -1151,13 +1179,13 @@ .. _`Zigbee Cluster Library specification`: https://zigbeealliance.org/wp-content/uploads/2019/12/07-5123-06-zigbee-cluster-library-specification.pdf .. _`Matter Resource Kit`: -.. _`CSA Matter Resource Kit`: https://groups.csa-iot.org/wg/all-users/home/matter-resource-kit +.. _`CSA Matter Resource Kit`: https://community.csa-iot.org/page/matter-resource-kit .. _`Connectivity Standards Alliance Certification Policy`: https://csa-iot.org/wp-content/uploads/2021/12/07-4842-14-ptsc-certification-policy.pdf .. _`CSA's Testing Providers`: https://csa-iot.org/certification/testing-providers/ .. _`CSA's Certification Team`: https://csa-iot.org/contact-us/ .. _`Connectivity Standards Alliance members`: https://csa-iot.org/members/ .. _`Join CSA`: https://csa-iot.org/become-member/ -.. _`CSA Member Resources page`: https://groups.csa-iot.org/wg/all-users/home/member-resources +.. _`PICS Tool`: https://picstool.csa-iot.org/ .. _`Matter Attestation Form`: https://groups.csa-iot.org/wg/members-all/document/folder/2255 .. _`Matter Attestation of Security template`: https://groups.csa-iot.org/wg/members-all/document/27432 .. _`Connectivity Standards Alliance Certification Web Tool`: https://zigbeecertifiedproducts.knack.com/zigbee-certified#home/ @@ -1261,6 +1289,9 @@ .. _`Wi-Fi Certification`: https://www.wi-fi.org/certification .. _`QuickTrack Test Tool User Manual`: https://www.wi-fi.org/file-member/quicktrack-test-tool-user-manual .. _`QuickTrack Test Tool Platform Integration Guide`: https://www.wi-fi.org/file-member/quicktrack-test-tool-platform-integration-guide-v12 +.. _`QuickTrack New Product Application Training`: https://www.wi-fi.org/system/files/members/QuickTrack_New_Product_Application_Training_v1.2.pdf +.. _`QuickTrack Member Conformance Test Laboratory Setup`: https://www.wi-fi.org/system/files/members/QuickTrack_Member_Conformance_Test_Laboratory_Setup_v1.0.pdf +.. _`Wi-Fi_CERTIFIED_Derivative_Certifications_Overview`: https://www.wi-fi.org/system/files/Wi-Fi_CERTIFIED_Derivative_Certifications_Overview_v3.3.pdf .. _`Platform Intel Ax210 Integration Guide`: https://www.wi-fi.org/file-member/quicktrack-test-tool-platform-intel-ax210-station-integration-guide .. ### Source: avsystem.com & avsystem.cloud @@ -1279,34 +1310,51 @@ .. _`mosquitto.org server CA`: https://test.mosquitto.org/ssl/mosquitto.org.crt .. _`test.mosquitto.org`: https://test.mosquitto.org -.. ### visualstudio.com +.. ### Source: visualstudio.com .. _`nRF Connect for VS Code Extension Pack`: https://marketplace.visualstudio.com/items?itemName=nordic-semiconductor.nrf-connect-extension-pack .. _`VSMQTT`: https://marketplace.visualstudio.com/items?itemName=rpdswtk.vsmqtt .. _`Visual Studio Code download page`: https://code.visualstudio.com/download -.. ### python.org +.. ### Source: python.org .. _`Python virtual environments`: https://docs.python.org/3/library/venv.html .. _`Windows Python Path`: https://docs.python.org/3/using/windows.html#finding-the-python-executable .. _`Python's Path.glob`: https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob -.. ### youtube.com +.. ### Source: youtube.com .. _`Developing Matter 1.0 products with nRF Connect SDK`: https://www.youtube.com/watch?v=9Ar13rMxGIk .. _`Accelerate cellular product development`: https://youtu.be/b1YW1J4aUps .. _`How nRF9160 enables cellular IoT asset tracking`: https://webinars.nordicsemi.com/how-nrf9160-enables-cellular-iot-4 +.. ### Source: onomondo.com + +.. _`Onomondo LTE-M coverage`: https://onomondo.com/product/coverage/lte-m-networks/ +.. _`Onomondo NB-IoT coverage`: https://onomondo.com/product/coverage/nb-iot-networks/ +.. _`Onomondo SoftSIM integration with the nRF91 Series`: https://help.onomondo.com/en/how-to-integrate-the-onomondo-softsim-with-the-nrf9160-from-nordic-semiconductor + +.. ### Source: bosch-sensortec.com + +.. _`BME680`: https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme680/ +.. _`Bosch BSEC`: https://www.bosch-sensortec.com/software-tools/software/bsec/ +.. _`BSEC license`: https://www.bosch-sensortec.com/media/boschsensortec/downloads/software/bme688_development_software/2023_04/license_terms_bme688_bme680_bsec.pdf + +.. ### Source: wireshark.org + +.. _`Wireshark`: https://www.wireshark.org +.. _`Wireshark with Lua`: https://wiki.wireshark.org/Lua +.. _`Wireshark Unix Build setup`: https://www.wireshark.org/docs/wsdg_html_chunked/ChapterSetup.html#ChSetupUNIX + .. ### Source: other (2 links or less from the same URL) -.. _`MQTT getting started`: https://mqtt.org/getting-started/ +.. _`Amazon Root CA 1`: https://www.amazontrust.com/repository/AmazonRootCA1.pem .. _`Memfault Diagnostic GATT Service`: https://memfault.notion.site/Memfault-Diagnostic-GATT-Service-MDS-ffd5a430062649cd9bf6edbf64e2563b -.. _`iBasis IoT network coverage`: https://ibasis.com/solutions/iot-connectivity/network-coverage/ +.. _`MQTT getting started`: https://mqtt.org/getting-started/ -.. _`BME680`: https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme680/ -.. _`Bosch BSEC`: https://www.bosch-sensortec.com/software-tools/software/bsec/ +.. _`iBasis IoT network coverage`: https://ibasis.com/solutions/iot-connectivity/network-coverage/ .. _`ADXL362`: https://www.analog.com/en/products/adxl362.html#product-overview .. _`ADXL372`: https://www.analog.com/en/products/adxl372.html#product-overview @@ -1334,7 +1382,6 @@ .. _`Azure Portal`: https://portal.azure.com/ - .. _`Verizon's Thingspace`: https://thingspace.verizon.com .. _`Verizon's Get certified program`: https://opendevelopment.verizonwireless.com/get-certified @@ -1359,7 +1406,6 @@ .. _`POSIX Programmer's Manual`: https://man7.org/linux/man-pages/dir_section_3.html .. _`LwM2M`: https://omaspecworks.org/what-is-oma-specworks/iot/lightweight-m2m-lwm2m/ .. _`IPSO objects`: https://omaspecworks.org/develop-with-oma-specworks/ipso-smart-objects/ -.. _`raw XML`: https://raw.githubusercontent.com/OpenMobileAlliance/lwm2m-registry/prod/version_history/3300-1_0.xml .. _`DLPTest.com`: https://dlptest.com/ftp-test/ @@ -1382,15 +1428,12 @@ .. _`BH1749NUC-E`: https://fscdn.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1749nuc-e.pdf - - .. _`CMock`: https://www.throwtheswitch.org/cmock .. _`Unity`: https://www.throwtheswitch.org/unity .. _`NMEA`: https://www.gpsworld.com/what-exactly-is-gps-nmea-data/ .. _`Baltimore CyberTrust Root certificate`: https://cacerts.digicert.com/BaltimoreCyberTrustRoot.crt.pem - .. _`DigiCert Global Root G2`: https://cacerts.digicert.com/DigiCertGlobalRootG2.crt.pem .. _`SKY66112-11 page`: https://www.skyworksinc.com/en/Products/Front-end-Modules/SKY66112-11 @@ -1420,10 +1463,6 @@ .. _`dfu-util tool`: http://dfu-util.sourceforge.net/ -.. _`Termite`: https://www.compuphase.com/software_termite.htm - -.. _`Teraterm`: https://teratermproject.github.io/index-en.html - .. _`GNU Project Debugger`: https://www.sourceware.org/gdb/ .. _`SIGMA`: https://link.springer.com/chapter/10.1007/978-3-540-45146-4_24 @@ -1434,18 +1473,6 @@ .. _`Samsung SmartThings integration with Matter`: https://support.smartthings.com/hc/en-us/articles/11219700390804-SmartThings-x-Matter-Integration- -.. _`Wireshark`: https://www.wireshark.org - -.. _`Wireshark with Lua`: https://wiki.wireshark.org/Lua - -.. _`Wireshark Unix Build setup`: https://www.wireshark.org/docs/wsdg_html_chunked/ChapterSetup.html#ChSetupUNIX - -.. _`Amazon license`: https://raw.githubusercontent.com/nrfconnect/sdk-sidewalk/main/LICENSE.txt - -.. _`Sidewalk documentation`: https://nrfconnect.github.io/sdk-sidewalk/ - -.. _`Setting up the SDK for Amazon Sidewalk`: https://nrfconnect.github.io/sdk-sidewalk/setting_up_sidewalk_environment/setting_up_sdk.html - .. _`Community Best Practice for Copyright Notice`: https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/ .. _`HTTPie`: https://httpie.io/ @@ -1454,9 +1481,7 @@ .. _`Mobile IoT deployment map`: https://www.gsma.com/iot/deployment-map/ -.. _`Onomondo SoftSIM integration with the nRF91 Series`: https://help.onomondo.com/en/how-to-integrate-the-onomondo-softsim-with-the-nrf9160-from-nordic-semiconductor - -.. _`Certifying a cellular IoT device`: https://blog.nordicsemi.com/getconnected/certifying-a-cellular-iot-device/ +.. _`CoreMark®`: https://www.eembc.org/coremark/ .. ### Temp: nRF54H and nRF54L related links, repositories, and documents @@ -1471,12 +1496,6 @@ .. _`Introduction to nRF54H20`: https://res.developer.nordicsemi.com/res/nrf54H20/intro/Introduction%20to%20nRF54H20%20v1_0_1.pdf .. _`nRF54H20 prototype difference`: https://res.developer.nordicsemi.com/res/nrf54H20/other/nRF54H20_proto_diff.pdf -.. _`nRF54L15 PDK schematic and PCB 0.2`: https://res.developer.nordicsemi.com/res/nRF54L15/schematics/pca10156_schematic_and_pcb.pdf -.. _`nRF54L15 PDK schematic and PCB 0.2.1`: https://res.developer.nordicsemi.com/res/nRF54L15/schematics/pca10156_schematic_and_pcb_0.2.1_2023_09_28.pdf - -.. _`nRF54L15 Objective Product Specification 0.5b`: https://res.developer.nordicsemi.com/res/nRF54L15/OPS/nRF54L15_OPS_v0.5b_Confidential.pdf -.. _`nRF54L15 prototype difference`: https://res.developer.nordicsemi.com/res/nRF54L15/protodiff/nRF54L15_prototype_differences_v1.0_nwp_051.pdf - .. _`BICR register's PDF file`: https://res.developer.nordicsemi.com/res/nrf54H20/BICR/nRF54H20_BICR_0_11_0.pdf .. _`nRF Command Line Tools 10.22.1`: https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download @@ -1493,8 +1512,6 @@ .. _`Homebrew`: https://brew.sh/ .. _`sdk-find-my-next repository`: https://github.com/nrfconnect/sdk-find-my-next -.. _`Serial Terminal from nRF Connect for Desktop`: https://infocenter.nordicsemi.com/topic/ug_serial_terminal/UG/serial_terminal/intro.html - .. _`10.23.3_ec 64-bit Windows, executable`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nRF-Command-Line-Tools-10.23.3-x64.exe .. _`10.23.3_ec x86 system, deb format`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools_10.23.3_amd64.deb @@ -1509,21 +1526,5 @@ .. _`10.23.3_ec macOS, zip archive`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3-osx.zip - -.. _`10.22.3_cs3 64-bit Windows, executable`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nRF-Command-Line-Tools-10.23.3-x64.exe -.. _`10.22.3_cs3 macOS, zip archive`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3-osx.zip - -.. _`10.22.3_cs3 x86 system, deb format`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools_10.23.3_amd64.deb -.. _`10.22.3_cs3 x86 system, RPM`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3-1.x86_64.rpm -.. _`10.22.3_cs3 x86 system, tar archive`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3_Linux-amd64.tar.gz -.. _`10.22.3_cs3 ARM64 system, deb format`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools_10.23.3_arm64.deb -.. _`10.22.3_cs3 ARM64 system, RPM`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3-1.arm64.rpm -.. _`10.22.3_cs3 ARM64 system, tar archive`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3_Linux-arm64.tar.gz - -.. _`10.22.3_cs3 ARMHF system, zip archive`: https://res.developer.nordicsemi.com/res/nrf-command-line-tools-10.23.3/nrf-command-line-tools-10.23.3-armhf-linux.zip - -.. _`nRF Sniffer for Bluetooth LE`: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_ble%2FUG%2Fsniffer_ble%2Fintro.html .. _`Git for Windows`: https://git-scm.com/download/win .. _`nRF Terminal documentation`: https://nrfconnect.github.io/vscode-nrf-connect/terminal/nrfterminal.html - -.. _`nRF7002 EK`: https://infocenter.nordicsemi.com/topic/ug_nrf7002_ek/UG/nrf7002_EK/intro.html diff --git a/doc/nrf/protocols/bt/ble/index.rst b/doc/nrf/protocols/bt/ble/index.rst index 445c6d1f10d8..84536d92ed55 100644 --- a/doc/nrf/protocols/bt/ble/index.rst +++ b/doc/nrf/protocols/bt/ble/index.rst @@ -52,7 +52,7 @@ It is developed by the Zephyr community and provided as open source. To use Zephyr's Bluetooth LE Controller in your application, include a :ref:`Controller-only build ` of the Bluetooth LE stack. Zephyr's Bluetooth LE Controller supports most of the standard Bluetooth LE features. -See the :ref:`Zephyr documentation ` for a detailed list of supported features. +See the :ref:`Zephyr documentation ` for a detailed list of supported features. Usage in samples diff --git a/doc/nrf/protocols/bt/bt_mesh/concepts.rst b/doc/nrf/protocols/bt/bt_mesh/concepts.rst index c8c09224bd92..e4c9d26e0585 100644 --- a/doc/nrf/protocols/bt/bt_mesh/concepts.rst +++ b/doc/nrf/protocols/bt/bt_mesh/concepts.rst @@ -266,7 +266,7 @@ The Bluetooth Mesh profile specification defines a range of out-of-band authenti * Blinking of lights * Output and input of passphrases -* Static authentication against a pre-shared key +* Static authentication against a pre-shared key (PSK) To secure the provisioning procedure, elliptic curve Diffie-Helman (ECDH) public key cryptography is used. After a device has been provisioned, it is part of the network and all its messages are considered authenticated. diff --git a/doc/nrf/protocols/bt/bt_mesh/configuring.rst b/doc/nrf/protocols/bt/bt_mesh/configuring.rst index 4d4f50c64790..7eaf6d10a514 100644 --- a/doc/nrf/protocols/bt/bt_mesh/configuring.rst +++ b/doc/nrf/protocols/bt/bt_mesh/configuring.rst @@ -190,15 +190,60 @@ In a worst case scenario, the store time can be up to several minutes. This can for example happen when storing a large size replay protection list. It is recommended to configure the settings subsystem's internal caches to improve the performance. -* The Settings NVS name cache reduces the number of search loops of internal parameter identifiers, keeping them in memory. +NVS lookup cache reduces the number of search loops within NVS' application table. - * :kconfig:option:`CONFIG_SETTINGS_NVS_NAME_CACHE`. +* :kconfig:option:`CONFIG_NVS_LOOKUP_CACHE`. -* The size of the Settings NVS name cache is recommended to be set to the maximum number of devices the configured device communicates with. - For example, if a device communicates with 255 other devices, it is worth setting the cache to minimum 255. +The Settings NVS name cache reduces the number of search loops of internal parameter identifiers, keeping them in memory. - * :kconfig:option:`CONFIG_SETTINGS_NVS_NAME_CACHE_SIZE`. +* :kconfig:option:`CONFIG_SETTINGS_NVS_NAME_CACHE`. -* NVS lookup cache reduces the number of search loops within NVS' application table. +The size of the Settings NVS name cache, :kconfig:option:`CONFIG_SETTINGS_NVS_NAME_CACHE_SIZE`, is recommended to be at least equal to the number of settings entries the device is expected to store. - * :kconfig:option:`CONFIG_NVS_LOOKUP_CACHE`. +The Bluetooth Mesh stack stores the following data persistently: + +* Network information (primary address and device key) +* Configuration parameters (supported features, default TTL, network transmit and relay retransmit parameters) +* IV index +* Sequence number +* Heartbeat publication information +* Application key(s) (the amount of entries is controlled by :kconfig:option:`CONFIG_BT_MESH_APP_KEY_COUNT`) +* Network key(s) (the amount of entries is controlled by :kconfig:option:`CONFIG_BT_MESH_SUBNET_COUNT`) +* Label UUIDs for virtual addressing (the amount of entries is controlled by :kconfig:option:`CONFIG_BT_MESH_LABEL_COUNT`) +* RPL entries (the RPL size is controlled by :kconfig:option:`CONFIG_BT_MESH_CRPL`) + +The following data is stored for each model by the Bluetooth Mesh stack: + +* Model subscription state +* Model publication state +* Bound application key(s) +* Subscription list for group addresses +* Subscription list for virtual addresses +* Label UUIDs the model is subscribed to +* Model-specific data + +Model data stored persistently can be found under the ``Persistent storage`` section of the corresponding model documentation. + +Using the :ref:`bluetooth_mesh_sensor_server` sample as an example, configured according to the sample's :ref:`configuration guide `, results in the following list of possible entries (entries mentioned above are not included unless specifying the amount of entries): + +* 32 RPL entries - since the default Networked Lighting Control (NLC) configuration is used (:kconfig:option:`CONFIG_BT_MESH_NLC_PERF_DEFAULT` is set), the RPL size is 32. +* Application keys - three keys are used. +* Bound application keys - each of the three Sensor Server and Sensor Setup Server models has one bound application key. +* Network keys - only one key is used. +* Model subscriptions - each of the three Sensor Server and Sensor Setup Server models subscribes to a group address. +* Model publication information - each of the three Sensor Server models publishes to a group address. +* Virtual addressing is not used. +* :ref:`Sensor Server model data ` - each of the three Sensor Server models stores the following data: + + * Minimum interval + * Delta thresholds + * Fast period divisor + * Fast cadence range + +* The following values are stored in the sample: + + * Temperature range + * Presence motion threshold + * Ambient light level gain + +Adding up all entries, it is worth setting the cache size to minimum 71. diff --git a/doc/nrf/protocols/bt/bt_mesh/dfu_over_ble.rst b/doc/nrf/protocols/bt/bt_mesh/dfu_over_ble.rst index f14f3b410fc2..bed840b0a03e 100644 --- a/doc/nrf/protocols/bt/bt_mesh/dfu_over_ble.rst +++ b/doc/nrf/protocols/bt/bt_mesh/dfu_over_ble.rst @@ -15,8 +15,8 @@ See `Discovering Bluetooth Mesh devices in nRF Connect Device Manager`_ for more Point-to point DFU over Bluetooth Low Energy in Bluetooth Mesh samples ********************************************************************** -The :ref:`bluetooth_mesh_light` sample enables support for point-to-point DFU over Bluetooth Low Energy for nRF52 Series development kits. -See the sample documentation for more details. +The :ref:`bluetooth_mesh_light`, :ref:`ble_mesh_dfu_target` and :ref:`ble_mesh_dfu_distributor` samples enable support for point-to-point DFU over Bluetooth Low Energy for nRF52 Series development kits. +See the sample documentation for each of the above mentioned samples for more details. Point-to-point DFU over Bluetooth Low Energy is supported by default, out-of-the-box, for all samples and applications compatible with :ref:`zephyr:thingy53_nrf5340`. See :ref:`thingy53_app_update` for more information about updating firmware image on :ref:`zephyr:thingy53_nrf5340`. diff --git a/doc/nrf/protocols/bt/bt_mesh/dfu_over_bt_mesh.rst b/doc/nrf/protocols/bt/bt_mesh/dfu_over_bt_mesh.rst index 69951f154fe7..487c05bedb15 100644 --- a/doc/nrf/protocols/bt/bt_mesh/dfu_over_bt_mesh.rst +++ b/doc/nrf/protocols/bt/bt_mesh/dfu_over_bt_mesh.rst @@ -55,7 +55,7 @@ Optionally, you can provide firmware ID, metadata and Unique Resource Identifier For example, to allocate a slot for the :ref:`ble_mesh_dfu_target` sample with image size of 241236 bytes, with firmware ID set to ``0200000000000000``, and metadata generated as described in :ref:`bluetooth_mesh_dfu_eval_md` section below, type the following command:: - mesh models dfu slot add 241236 0200000000000000 020000000100000094cf24017c26f3710100 + mesh models dfu slot add 241236 0200000000000000 020000000000000094cf24017c26f3710100 When the slot is added, the shell will print the slot ID. Take note of this ID as it will then be needed to start the DFU transfer:: @@ -201,18 +201,19 @@ The file is placed in the :file:`dfu_application.zip` archive in the build folde Additionally, the metadata string required by the ``mesh models dfu slot add`` command will be printed in the command line window when the application is built:: Bluetooth Mesh Composition metadata generated: - Encoded metadata: 020000000100000094cf24017c26f3710100 + Encoded metadata: 020000000000000094cf24017c26f3710100 Full metadata written to: APPLICATION_FOLDER\build\zephyr\dfu_application.zip .. note:: - Currently this script only supports applications that contain a single composition data structure, meaning that applications containing multiple composition data structures must rely on manual generation of the metadata string(s). - It is also required that the composition data is declared with the const-qualifier. + It is required that the Composition Data is declared with the ``const`` qualifier. + If the application contains more than one Composition Data structure (for example, when the structure to be used is picked at runtime), the script will not print any encoded metadata. + In this case, use the JSON file to find the encoded metadata matching the Composition Data to be used by the device after the update. Additionally, the script is hardcoded to produce a metadata string where the firmware is targeted for the application core. A separate west command can be utilized to print the metadata to the console, given that it is already generated by the build system. This gives the user easy access to this information, without having to enter the ``.json`` file in the build folder or to rebuild the application:: - west build -t ble-mesh-dfu-metadata + west build -t ble_mesh_dfu_metadata For this particular example, the following output is generated: @@ -248,7 +249,7 @@ For this particular example, the following output is generated: ] }, "composition_hash": "0x71f3267c", - "encoded_metadata": "020000000100000094cf24017c26f3710100" + "encoded_metadata": "020000000000000094cf24017c26f3710100" } Manual metadata generation @@ -305,4 +306,4 @@ The output of the command will be the following:: Composition data hash: 0x71f3267c Elements: 1 User data length: 0 - Encoded metadata: 020000000100000094cf24017c26f3710100 + Encoded metadata: 020000000000000094cf24017c26f3710100 diff --git a/doc/nrf/protocols/bt/index.rst b/doc/nrf/protocols/bt/index.rst index e2442ca01d45..c69fba4669fd 100644 --- a/doc/nrf/protocols/bt/index.rst +++ b/doc/nrf/protocols/bt/index.rst @@ -5,6 +5,8 @@ Bluetooth The following section contains descriptions of Bluetooth® LE Controller and Bluetooth Mesh, including the guidelines on how to qualify a product that uses these subsystems. +To enable Bluetooth LE in your application, you can use the standard HCI-based architecture, where the Bluetooth Host libraries (:ref:`zephyr:bluetooth`) are included in your application or run Bluetooth API functions as remote procedure calls using :ref:`ble_rpc`. + .. toctree:: :maxdepth: 1 :caption: Subpages: diff --git a/doc/nrf/protocols/esb/index.rst b/doc/nrf/protocols/esb/index.rst index 4fe6a61cbcf3..f091763422fa 100644 --- a/doc/nrf/protocols/esb/index.rst +++ b/doc/nrf/protocols/esb/index.rst @@ -61,13 +61,13 @@ ESB requires exclusive access to all fixed and configured resources for the :ref - NRF_TIMER2 - configurable * - DPPI/PPI channels - - 6 channels + - 6 channels (7 channels for nRF53 and nRF54 Series devices) - automatically allocated * - Event generator unit - - NRF_EGU0 events 6 - 7 + - NRF_EGU0 events 6 - 7 (event 8 for nRF54 Series devices) - fixed * - Software interrupt - - 0 + - NRF_SWI0 (unused in nRF54 Series devices) - fixed .. note:: @@ -317,6 +317,14 @@ If the ESB connection is established only between nRF52 and/or nRF53 Series devi When the value of the ``use_fast_ramp_up`` parameter is ``true``, fast ramp-up is enabled, resulting in reduced ramp-up delay of 40 µs. +Furthermore, for the nRF54H20 SoC, you can activate fast switching using the :kconfig:option:`CONFIG_ESB_FAST_SWITCHING` Kconfig option and enable the ramp-up by setting the ``use_fast_ramp_up`` parameter to ``true``. +The fast switching option enables direct switching between RX to TX and TX to RX radio states without entering the ``DISABLED`` state. +For the PTX node, this switching occurs after transmitting a packet and before waiting for acknowledgment (TX -> RX). +For the PRX node, this switching occurs after receiving a packet and before transmitting an acknowledgment (RX -> TX). +Enabling this feature can improve the responsiveness and efficiency of the radio communication system by reducing latency. + +Enabling the :kconfig:option:`CONFIG_ESB_FAST_CHANNEL_SWITCHING` Kconfig for the nRF54H20 SoC allows radio channel switching in RX radio state without transitioning to the ``DISABLED`` state. + .. _esb_never_disable_tx: Experimental feature: Never disable transmission stage diff --git a/doc/nrf/protocols/matter/end_product/certification.rst b/doc/nrf/protocols/matter/end_product/certification.rst index bae12cb1aae0..c6046f1bf078 100644 --- a/doc/nrf/protocols/matter/end_product/certification.rst +++ b/doc/nrf/protocols/matter/end_product/certification.rst @@ -99,7 +99,7 @@ Application =========== Once you have obtained the test report for your Matter component, you can apply for the certification to CSA. -You can do this online from the `CSA Member Resources page`_ using the different Certification and Testing tools to submit the required documentation. +You can do this online from the `CSA Matter Resource Kit`_ using the different Certification and Testing tools to submit the required documentation. Application requirements ------------------------ @@ -129,7 +129,7 @@ Certification document templates from Nordic Semiconductor PICS ++++ -You can generate the PICS in the XML format using CSA's PICS Tool, available from `CSA Member Resources page`_. +You can generate the PICS in the XML format using the `PICS Tool`_, which is provided by CSA. Dependent Transport Attestation +++++++++++++++++++++++++++++++ diff --git a/doc/nrf/protocols/matter/end_product/index.rst b/doc/nrf/protocols/matter/end_product/index.rst index 35c90bcb9bec..61c67eabeb69 100644 --- a/doc/nrf/protocols/matter/end_product/index.rst +++ b/doc/nrf/protocols/matter/end_product/index.rst @@ -19,7 +19,7 @@ Watch the following video for an overview of the Matter end product development The pages that follow deal with the preparation of the device for market launch, starting with :ref:`ug_matter_device_prerequisites` and the reference to the :ref:`ug_matter_device_factory_provisioning` guide. -Finally, we discuss topics related to Matter certification (:ref:`ug_matter_device_attestation`, :ref:`ug_matter_device_dcl`, :ref:`ug_matter_device_certification`, :ref:`ug_matter_ecosystems_certification`, and :ref:`ug_matter_device_configuring_cd`) and :ref:`ug_matter_device_bootloader`. +Finally, we discuss topics related to Matter certification (:ref:`ug_matter_device_attestation`, :ref:`ug_matter_device_dcl`, :ref:`ug_matter_device_certification`, :ref:`ug_matter_ecosystems_certification`, :ref:`ug_matter_device_configuring_cd`, and :ref:`ug_matter_test_event_triggers`) and :ref:`ug_matter_device_bootloader`. .. toctree:: :maxdepth: 1 @@ -36,3 +36,4 @@ Finally, we discuss topics related to Matter certification (:ref:`ug_matter_devi configuring_cd versioning last_fabric_removal_delegate + test_event_triggers diff --git a/doc/nrf/protocols/matter/end_product/security.rst b/doc/nrf/protocols/matter/end_product/security.rst index 5fe5348d8fb4..84988a7d831a 100644 --- a/doc/nrf/protocols/matter/end_product/security.rst +++ b/doc/nrf/protocols/matter/end_product/security.rst @@ -60,13 +60,17 @@ The HUK library is supported for both the nRF52840 and nRF5340 platforms, but fo * For the nRF5340 platform, the HUK is generated at first boot and stored in the Key Management Unit (KMU). No changes to the existing partition layout are needed for products in the field. -* For the nRF52840 platform, AEAD keys are derived with a SHA-256 hash (:kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND_AEAD_KEY_HASH_UID`). +* For the nRF52840 and nRF54L15 platforms, AEAD keys are derived with a SHA-256 hash (:kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND_AEAD_KEY_HASH_UID`). This approach is less secure than using the library for key derivation as it will only provide integrity of sensitive material. It is also possible to implement a custom AEAD keys generation method when the :kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND_AEAD_KEY_CUSTOM` Kconfig option is selected. Using the HUK library with nRF52840 SoC is possible, but it requires employing the :ref:`bootloader` that would generate the AEAD key at first boot and store it in the dedicated HUK partition that can be accessed only by the CryptoCell peripheral. Note that adding another partition in the FLASH layout implies breaking the firmware backward compatibility with already deployed devices. + .. note:: + Using the HUK library with the nRF54L15 SoC is not possible yet. + This means that you need to use AEAD keys derived with a SHA-256 hash. + You can find an overview of the Trusted Storage layer configuration supported for each |NCS| Matter-enabled platform in the :ref:`matter_platforms_security_support` section. .. _matter_platforms_security_support: @@ -109,10 +113,22 @@ This is a reference configuration that can be modified in the production firmwar - Yes - --- - --- + * - nRF54L15 SoC + - Thread + - PSA + - CRACEN + Oberon [2]_ + - Yes + - Trusted Storage backend + - SHA-256 hash + .. [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. +.. [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. + See the :ref:`nrf_security_drivers` documentation for more information. + Securing production devices *************************** diff --git a/doc/nrf/protocols/matter/end_product/test_event_triggers.rst b/doc/nrf/protocols/matter/end_product/test_event_triggers.rst new file mode 100644 index 000000000000..c5f5386b2d3e --- /dev/null +++ b/doc/nrf/protocols/matter/end_product/test_event_triggers.rst @@ -0,0 +1,283 @@ +.. _ug_matter_test_event_triggers: + +Matter test event triggers +########################## + +.. contents:: + :local: + :depth: 2 + +Matter test event triggers are a set of software commands designed to initiate specific test scenarios. +You can activate these commands using the Matter Controller, which serves as the interface for executing them. +To activate a command, you need to enter the pre-defined activation codes that correspond to the desired test event. +All test event triggers are based on the ``generaldiagnostics`` Matter cluster, and utilize the ``test-event-trigger`` command to function. +This mechanism can be used during the Matter certification process to simulate common and specific device scenarios, and during software verification events to validate the correct operation of Matter-compliant devices. +To learn how to use the test event triggers functionality during the Matter certification process, see the :ref:`matter_test_event_triggers_matter_certification` section. + +You can utilize the test event triggers predefined in the :ref:`matter_test_event_triggers_default_test_event_triggers` section to streamline your testing process. +If the predefined options do not meet your requirements, you can also define your own event triggers. +To learn how to create custom event triggers, refer to the :ref:`matter_test_event_triggers_custom_triggers` section of the documentation. + +Requirements +************ + +The :ref:`CHIP Tool application ` is required to send ``test-event-trigger`` commands to the general diagnostics cluster. +Ensure that it is installed before initiating Matter testing events. + +Your device needs to includes the general diagnostics cluster within its Matter data model database to perform Matter testing events. +For guidance on configuring the general diagnostics cluster on your device, refer to the instructions provided on the :ref:`ug_matter_gs_adding_cluster` page. + +Activation of test event codes requires the provisioning of an enable key. +To ensure secure operation, the enable key must be specific for each device. +You can find instructions on how to establish the enable key for your device in the :ref:`matter_test_event_triggers_setting_enable_key` section. + +.. _matter_test_event_triggers_default_test_event_triggers: + +Default test event triggers +*************************** + +You can use the pre-defined common test event triggers in your application. +To disable them, set the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS` Kconfig option to ``n``. + +The following table lists the available triggers and their activation codes: + +.. list-table:: Default test event triggers + :widths: auto + :header-rows: 1 + + * - Name + - Requirements + - Description + - Activation code [range] + - Value description + * - Factory reset + - None + - Perform a factory reset of the device with a delay. + - `0xF000000000000000` - `0xF00000000000FFFF` + - The range of `0x0000` - `0xFFFF` represents the delay in ms to wait until the factory reset occurs. + The maximum time delay is UINT32_MAX ms. + The value is provided in HEX format. + * - Reboot + - None + - Reboot the device. + - `0xF000000000000000` - `0xF00000000000FFFF` + - The range of `0x0000` - `0xFFFF` represents the delay in ms to wait until the reboot occurs. + The maximum time delay is UINT32_MAX ms. + The value is provided in HEX format. + * - OTA query + - :kconfig:option:`CONFIG_CHIP_OTA_REQUESTOR` = ``y`` + - Trigger an OTA firmware update. + - `0x002a000000000100` - `0x01000000000001FF` + - The range of `0x00` - `0xFF` is the fabric index value. + The maximum fabric index value depends on the current device's settings. + * - Door lock jammed + - :kconfig:option:`CONFIG_CHIP_DEVICE_PRODUCT_ID` = ``32774`` + - Simulate the jammed lock state. + - `0x3277400000000000` + - This activation code does not contain any value. + +.. _matter_test_event_triggers_setting_enable_key: + +Setting the enable key +********************** + +The enable key can be provided either by utilizing the factory data, or directly in the application code. + +Using factory data +================== + +You can not set the enable key to a specific value using factory data unless the :kconfig:option:`CONFIG_CHIP_FACTORY_DATA` Kconfig option is set to ``y``. +If it is not set, the default value ``00112233445566778899AABBCCDDEEFF`` will be used. +For secure operation, you need to ensure that the enable key is unique for all of your devices. + +To specify the enable key through the build system, enable the :kconfig:option:`CONFIG_CHIP_FACTORY_DATA_BUILD` Kconfig option by setting it to ``y``. +Then, set the :kconfig:option:`CONFIG_CHIP_DEVICE_ENABLE_KEY` Kconfig option to a 32-byte hexadecimal string value. + +If :kconfig:option:`CONFIG_CHIP_FACTORY_DATA_BUILD` is set to ``n``, you can follow the :doc:`matter:nrfconnect_factory_data_configuration` guide in the Matter documentation to generate the factory data set with the specific enable key value. + +If you do not use the |NCS| Matter common module, you need to read the enable key value manually from the factory data set and provide it to the ``TestEventTrigger`` class. + +For example: + +.. code-block:: c++ + + /* Prepare the factory data provider */ + static chip::DeviceLayer::FactoryDataProvider sFactoryDataProvider; + sFactoryDataProvider.Init(); + + /* Prepare the buffer for enable key data */ + uint8_t enableKeyData[chip::TestEventTriggerDelegate::kEnableKeyLength] = {}; + MutableByteSpan enableKey(enableKeyData); + + /* Load the enable key value from the factory data */ + sFactoryDataProvider.GetEnableKey(enableKey); + + /* Call SetEnableKey method to load the read value to the TestEventTrigger class. */ + Nrf::Matter::TestEventTrigger::Instance().SetEnableKey(enableKey); + +Directly in the code +==================== + +Use the SetEnableKey method of the ``TestEventTrigger`` class to set up the enable key. + +For example: + +.. code-block:: c++ + + /* Prepare Buffer for Test Event Trigger data which contains your "enable key" */ + uint8_t enableKeyData[chip::TestEventTriggerDelegate::kEnableKeyLength] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, + 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, + 0xcc, 0xdd, 0xee, 0xff + }; + + /* Call SetEnableKey method to load the prepared value to the TestEventTrigger class. */ + Nrf::Matter::TestEventTrigger::Instance().SetEnableKey(ByteSpan {enableKeyData}); + +.. _matter_test_event_triggers_matter_certification: + +Using in Matter certification +***************************** + +When you provide the enable key using factory data, you can utilize the event trigger feature during the Matter certification process. +This is because, when done this way, you can turn off the event trigger functionality by disabling access to the ``generaldiagnostics`` cluster without altering the code that has already been certified. + +Once the certification process is complete, you must deactivate the test event trigger functionality by generating new factory data with a modified enable key value. +This is done by setting the :kconfig:option:`CONFIG_CHIP_DEVICE_ENABLE_KEY` Kconfig option to a value consisting solely of zeros. + +For instance, to generate factory data with disabled event trigger functionality, set the :kconfig:option:`CONFIG_CHIP_DEVICE_ENABLE_KEY` Kconfig option to the value ``0x00000000000000000000000000000000``. +After generating it, flash the :file:`factory_data.hex` file onto the device. + +.. _matter_test_event_triggers_custom_triggers: + +Custom test event triggers +************************** + +You can define and register custom test event triggers to initiate specific actions on your device. + +An activation code is 64 bits in length, and consist of two components: the event trigger ID and the event trigger value. + +* The event trigger ID is 32 bits long and uniquely identifies the trigger. + It is supplied as the first 32 bits of the activation code. +* The event trigger value is specific to a given trigger. + It is supplied as the last 32 bits of the activation code. + +This means that the activation code has the pattern ``0xIIIIIIIIVVVVVVVV``, where ``I`` represents the ID part and ``V`` represents the value part. + +For example the ``0x1000000000001234`` activation code stands for a trigger ID equal to ``0x1000000000000000`` and a specific value of ``0x1234``. + +A new event trigger consists of two fields: ``Mask``, and ``Callback``. + +* The ``Mask`` field is 32 bits long and specifies a mask for the trigger's value. +* The ``Callback`` field is a callback function that will be invoked when the device receives a corresponding activation code. + +The maximum number of event triggers that can be registered is configurable. +To adjust this limit, set the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX` Kconfig option to the desired value. + +To register a new test event trigger, follow these steps: + +1. Create a function that will be executed when the device receives a valid enable key and activation code. + + This function must return a ``CHIP_ERROR`` code and accept a ``Nrf::Matter::TestEventTrigger::TriggerValue`` as its argument. + You can utilize the provided argument within this function as needed. + + Use ``CHIP_ERROR`` codes to communicate appropriate responses to the Matter Controller. + For instance, you might return ``CHIP_ERROR_INVALID_ARGUMENT`` to indicate that the user has provided an incorrect value argument. + + .. note:: + + The callback method is not thread-safe. + Ensure that all operations within it are executed in a thread-safe manner. + To perform operations within the Matter stack context, use the ``chip::DeviceLayer::SystemLayer().ScheduleLambda`` method. + For operations in the application context, use the ``Nrf::PostTask`` function. + + Here is an example of how to create a callback function: + + .. code-block:: c++ + + CHIP_ERROR MyFunctionCallback(Nrf::Matter::TestEventTrigger::TriggerValue value) + { + /* Define the required behavior of the device here. */ + + return CHIP_NO_ERROR; + } + +#. Register the new event trigger. + + Use the following example as a guide to register a new event: + + .. code-block:: c++ + + /* Create a new event */ + Nrf::Matter::TestEventTrigger::EventTrigger myEventTrigger; + + /* Assign all fields */ + uint64_t myTriggerID = /* Set the trigger ID */ + myEventTrigger.Mask = /* Fill the value mask filed */; + myEventTrigger.Callback = MyFunctionCallback; + + /* Register the new event */ + CHIP_ERROR err = Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTrigger(myTriggerID, myEventTrigger); + + /* Remember to check the CHIP_ERROR return code */ + + If the returning `CHIP_ERROR` code is equal to `CHIP_ERROR_NO_MEMORY`, you need to increase the :kconfig:option:`NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX` kconfig option to the higher value. + + Here's an example to handle the ``0xF000F00000001234`` activation code, where 1234 is the event trigger value field: + + .. code-block:: c++ + + Nrf::Matter::TestEventTrigger::EventTrigger myEventTrigger; + uint64_t myTriggerID = 0xF000F0000000; + myEventTrigger.Mask = 0xFFFF; + myEventTrigger.Callback = MyFunctionCallback; + + CHIP_ERROR err = Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTrigger(myTriggerID, myEventTrigger); + +Register an existing test event trigger handler +*********************************************** + +The Matter SDK has some test event trigger handlers implemented. +All of them inherit the `TestEventTriggerHandler` class, and are implemented in various places in the Matter SDK. + +The events declared in existing test event triggers can have a different semantic than described in the :ref:`matter_test_event_triggers_custom_triggers` section. + +Use the following example as a guide to register an existing event trigger handler: + +.. code-block:: c++ + + /* Create the Trigger Handler object */ + static TestEventTriggerHandler existingTriggerHandler; + CHIP_ERROR err = Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTriggerHandler(&existingTriggerHandler); + + /* Remember to check the CHIP_ERROR return code */ + +If the returning ``CHIP_ERROR`` code is equal to ``CHIP_ERROR_NO_MEMORY``, you need to increase the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX_TRIGGERS_DELEGATES` kconfig option to the higher value. + +For example, you can register and use the ``OTATestEventTriggerHandler`` handler and trigger pre-defined Matter OTA DFU behaviors using the following code: + +.. code-block:: c++ + + /* Create the Trigger Handler object */ + static chip::OTATestEventTriggerHandler otaTestEventTrigger; + ReturnErrorOnFailure(Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTriggerHandler(&otaTestEventTrigger)); + +Usage +***** + +The Matter test event triggers feature is enabled by default for all Matter samples. +To disable it, set the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS` kconfig option to ``n``. + +To trigger a specific event on the device, run the following command: + +.. code-block:: console + + ./chip-tool generaldiagnostics test-event-trigger hex: 0 + +Replace the ``enable key`` value with your device's enable key, and the ``activation code`` and ``node id`` values with the values for the event you want to trigger. + +The following is an example of the Reboot activation code with a 5 ms delay for Matter Template device which has a ``node id`` set to ``1``, using the default enable key: + +.. code-block:: console + + ./chip-tool generaldiagnostics test-event-trigger hex:00112233445566778899AABBCCDDEEFF 0xF000000100000005 1 0 diff --git a/doc/nrf/protocols/matter/getting_started/adding_clusters.rst b/doc/nrf/protocols/matter/getting_started/adding_clusters.rst index 2a51d2ef3c6b..c19a04d6b899 100644 --- a/doc/nrf/protocols/matter/getting_started/adding_clusters.rst +++ b/doc/nrf/protocols/matter/getting_started/adding_clusters.rst @@ -351,7 +351,7 @@ To check if the sensor device is working, complete the following steps: .. include:: ../../../../../samples/matter/template/README.rst :start-after: matter_template_sample_testing_start - :end-before: #. Press **Button 1** + :end-before: #. Keep the **Button 1** #. Activate the sensor by running the following command on the On/off cluster with the correct *node_ID* assigned during commissioning: diff --git a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst index df44f38d1d4e..a7ae4b8c5cb8 100644 --- a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst +++ b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst @@ -172,3 +172,32 @@ Read Client functionality The Read Client functionality is used for reading attributes from another device in the Matter network. This functionality is disabled by default for Matter samples in the |NCS|, except for ones that need to read attributes from the bound devices, such as the :ref:`matter_light_switch_sample` and :ref:`matter_thermostat_sample` samples, and the :ref:`matter_bridge_app` application. Enable the feature if your device needs to be able to access attributes from a different device within the Matter network using, for example, bindings. + +Persistent storage +================== + +The persistent storage module allows for the application data and configuration to survive a device reboot. +|NCS| Matter applications use one generic Persistent Storage API that can be enabled by the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_PERSISTENT_STORAGE` Kconfig option. +This API consists of methods with ``Secure`` and ``NonSecure`` prefixes, which handle secure (ARM Platform Security Architecture Persistent Storage) and non-secure (raw Zephyr settings) storage operations, respectively. + +You can learn more details about the Persistent Storage API from the :file:`ncs/nrf/samples/matter/common/src/persistent_storage/persistent_storage.h` header file. + +The interface is implemented by two available backends. +Both can be used simultaneously by controlling the following Kconfig options: + +* :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND` - Activates the implementation that takes advantage of the raw :ref:`Zephyr settings`. + This backend implements ``NonSecure`` methods of the Persistent Storage API and returns ``PSErrorCode::NotSupported`` for ``Secure`` methods. +* :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND` - Activates the module based on the ARM PSA Protected Storage API implementation from the :ref:`trusted_storage_readme` |NCS| library. + This backend implements ``Secure`` methods of the Persistent Storage API and returns ``PSErrorCode::NotSupported`` for ``NonSecure`` methods. + +Both backends allow you to control the maximum length of a string-type key under which an asset can be stored. +You can do this using the :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_STORAGE_MAX_KEY_LEN` Kconfig option. + +If both backends are activated at the same time (:kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND` and :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND` enabled) all methods of the generic interface are supported. + +Similarly to the non-secure backend, the secure backend leverages the Zephyr Settings to interface with the FLASH memory. + +Additionally, in case of the secure storage backend, the following Kconfig options control the storage limits: + +* :kconfig:option:`CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_MAX_ENTRY_NUMBER` - Defines the maximum number or assets that can be stored in the secure storage. +* :kconfig:option:`CONFIG_TRUSTED_STORAGE_BACKEND_AEAD_MAX_DATA_SIZE` - Defines the maximum length of the secret that is stored. diff --git a/doc/nrf/protocols/matter/getting_started/ecosystem_compatibility_testing.rst b/doc/nrf/protocols/matter/getting_started/ecosystem_compatibility_testing.rst index 4a216be38c6f..aaaf6cc3f107 100644 --- a/doc/nrf/protocols/matter/getting_started/ecosystem_compatibility_testing.rst +++ b/doc/nrf/protocols/matter/getting_started/ecosystem_compatibility_testing.rst @@ -19,7 +19,7 @@ Prerequisites At the very least, you need the following pieces of hardware to set up and test the interoperability scenario from the tutorial: -* Matter over Thread development kit: 1x nRF52840 DK or 1x nRF5340 DK +* Matter over Thread development kit: 1x nRF52840 DK, 1x nRF5340 DK, or 1x nRF54L15 PDK * Matter over Wi-Fi development kit: 1x nRF7002 DK * Devices from at least one of commercial ecosystems compatible with the official Matter implementation, for example: diff --git a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst index 11cd059b9b84..0d380ab503bd 100644 --- a/doc/nrf/protocols/matter/getting_started/hw_requirements.rst +++ b/doc/nrf/protocols/matter/getting_started/hw_requirements.rst @@ -19,6 +19,7 @@ Currently the following SoCs from Nordic Semiconductor are supported for use wit * :ref:`nRF5340 ` (Matter over Thread and Matter over Wi-Fi through the ``nrf7002ek`` shield) * :ref:`nRF5340 + nRF7002 ` (Matter over Thread and Matter over Wi-Fi) * :ref:`nRF52840 ` (Matter over Thread) +* :ref:`nRF54L15 ` (Matter over Thread) Front-End Modules ================= @@ -90,7 +91,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF5340 DK - The following table lists memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk_nrf5340_cpuapp `). + The following table lists memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk/nrf5340/cpuapp `). +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | @@ -142,7 +143,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF7002 DK - The following table lists memory requirements for samples running on the :ref:`nRF7002 DK ` (:ref:`nrf7002dk_nrf5340_cpuapp `). + The following table lists memory requirements for samples running on the :ref:`nRF7002 DK ` (:ref:`nrf7002dk `). +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | @@ -176,6 +177,38 @@ Values are provided in kilobytes (KB). | :ref:`Thermostat ` (Release) | 48 | 786 | 4 | 32 | 870 | 258 | +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + .. tab:: nRF54L15 PDK + + The following table lists memory requirements for samples running on the :ref:`nRF54L15 PDK ` (:ref:`nrf54l15pdk_nrf54l15 `). + + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | Sample | MCUboot ROM | Application ROM | Factory data | Settings | Total ROM | Total RAM (incl. static HEAP) | + +===================================================================+===============+===================+================+============+=============+=================================+ + | :ref:`Light Bulb ` (Debug) | 28 | 761 | 4 | 32 | 825 | 175 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Bulb ` (Release) | 28 | 654 | 4 | 32 | 718 | 167 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Debug) | 28 | 726 | 4 | 32 | 790 | 166 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Light Switch ` (Release) | 28 | 620 | 4 | 32 | 684 | 157 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Debug) | 28 | 679 | 4 | 32 | 743 | 164 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (Release) | 28 | 581 | 4 | 32 | 645 | 156 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (LTO Debug) | 28 | 612 | 4 | 32 | 676 | 165 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Template ` (LTO Release) | 28 | 553 | 4 | 32 | 617 | 156 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Debug) | 28 | 726 | 4 | 32 | 790 | 164 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Thermostat ` (Release) | 28 | 616 | 4 | 32 | 680 | 157 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Debug) | 28 | 708 | 4 | 32 | 772 | 166 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + | :ref:`Window Covering ` (Release) | 28 | 606 | 4 | 32 | 670 | 165 | + +-------------------------------------------------------------------+---------------+-------------------+----------------+------------+-------------+---------------------------------+ + .. .. note:: @@ -235,7 +268,7 @@ For more information about configuration of memory layouts in Matter, see :ref:` .. tab:: nRF5340 DK - The following memory map is valid for Matter applications running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk_nrf5340_cpuapp `). + The following memory map is valid for Matter applications running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk/nrf5340/cpuapp `). Application core flash (size: 0x100000 = 1024kB) +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ @@ -457,7 +490,7 @@ For more information about configuration of memory layouts in Matter, see :ref:` .. tab:: nRF7002 DK - The following memory map is valid for Matter applications running on the :ref:`nRF7002 DK ` (:ref:`nrf7002dk_nrf5340 `). + The following memory map is valid for Matter applications running on the :ref:`nRF7002 DK ` (:ref:`nrf7002dk `). Application core flash (size: 0x100000 = 1024kB) +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ @@ -529,6 +562,31 @@ For more information about configuration of memory layouts in Matter, see :ref:` | OTP Memory (otp) | 0kB (0x0) | 764B (0x2fc) |- |- |- | +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+ + .. tab:: nRF54L15 PDK + + The following memory map is valid for Matter applications running on the :ref:`nRF54L15 PDK ` (:ref:`nrf54l15pdk_nrf54l15 `). + + Application core flash (size: 0x17D000 = 1524kB) + + +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ + | Partition | Offset | Size | Partition elements | Element offset | Element size | + +=========================================+=====================+===================+=====================+=================+===================+ + | Application | 0kB (0x0) | 1488kB (0x164000) |- |- |- | + +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ + | Factory data (factory_data) | 988kB (0x174000) | 4kB (0x1000) |- |- |- | + +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ + | Non-volatile storage (settings_storage) | 992kB (0x175000) | 32kB (0x8000) |- |- |- | + +-----------------------------------------+---------------------+-------------------+---------------------+-----------------+-------------------+ + + Application core SRAM primary (size: 0x40000 = 256kB) + SRAM is located at the address ``0x20000000`` in the memory address space of the application. + + +-----------------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+ + | Partition | Offset | Size | Partition elements | Element offset | Element size | + +===============================================+=====================+===================+=====================+=================+=================+ + | Static RAM (sram_primary) | 0kB (0x0) | 256kB (0x40000) |- |- |- | + +-----------------------------------------------+---------------------+-------------------+---------------------+-----------------+-----------------+ + .. You can generate :ref:`Partition Manager's ASCII representation ` of these tables by running the following command for your respective **: @@ -537,8 +595,12 @@ You can generate :ref:`Partition Manager's ASCII representation -t partition_manager_report -For example, for the ``nrf7002dk_nrf5340_cpuapp`` build target, the command is as follows: +For example, for the ``nrf7002dk/nrf5340/cpuapp`` build target, the command is as follows: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -t partition_manager_report + west build -b nrf7002dk/nrf5340/cpuapp -t partition_manager_report + +.. note:: + + Partition Manager report generation is not available on the :ref:`nRF54L15 PDK ` (:ref:`nrf54l15pdk_nrf54l15 `). diff --git a/doc/nrf/protocols/matter/getting_started/transmission_power.rst b/doc/nrf/protocols/matter/getting_started/transmission_power.rst index 4f13b10a271c..dd6f0a05b29a 100644 --- a/doc/nrf/protocols/matter/getting_started/transmission_power.rst +++ b/doc/nrf/protocols/matter/getting_started/transmission_power.rst @@ -22,45 +22,53 @@ The following table lists the default TX power values. +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ | Sample | Board name | Output power for Thread (dBm; range from -40 to 20) | Output power for Bluetooth® LE (dBm; range from -40 to 3 or 8) | +==============================================================+==========================+======================================================+=================================================================+ -| :ref:`Light Bulb (FTD) ` | nrf52840dk_nrf52840 | 8 | 0 | +| :ref:`Light Bulb (FTD) ` | nrf52840dk | 8 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf5340dk_nrf5340 | 3 | 0 | +| | nrf5340dk | 3 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf7002dk_nrf5340 | 3 | 0 | +| | nrf7002dk | 3 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf21540dk_nrf52840 | 20 | 0 | +| | nrf21540dk | 20 | 0 | +| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ +| | nrf54l15pdk | 0 | 0 | +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| :ref:`Light Switch (SED) ` | nrf52840dk_nrf52840 | 0 | 0 | +| :ref:`Light Switch (SED) ` | nrf52840dk | 0 | 0 | +| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ +| | nrf5340dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf5340dk_nrf5340 | 0 | 0 | +| | nrf7002dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf7002dk_nrf5340 | 0 | 0 | +| | nrf21540dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf21540dk_nrf52840 | 0 | 0 | +| | nrf54l15pdk | 0 | 0 | +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| :ref:`Lock (SED) ` | nrf52840dk_nrf52840 | 0 | 0 | +| :ref:`Lock (SED) ` | nrf52840dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf5340dk_nrf5340 | 0 | 0 | +| | nrf5340dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf7002dk_nrf5340 | 0 | 0 | +| | nrf7002dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf21540dk_nrf52840 | 0 | 0 | +| | nrf21540dk | 0 | 0 | +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| :ref:`Template (MTD) ` | nrf52840dk_nrf52840 | 8 | 0 | +| :ref:`Template (MTD) ` | nrf52840dk | 8 | 0 | +| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ +| | nrf5340dk | 3 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf5340dk_nrf5340 | 3 | 0 | +| | nrf7002dk | 3 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf7002dk_nrf5340 | 3 | 0 | +| | nrf21540dk | 20 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf21540dk_nrf52840 | 20 | 0 | +| | nrf54l15pdk | 0 | 0 | +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| :ref:`Widow Covering (SSED) ` | nrf52840dk_nrf52840 | 0 | 0 | +| :ref:`Widow Covering (SSED) ` | nrf52840dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf5340dk_nrf5340 | 0 | 0 | +| | nrf5340dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf7002dk_nrf5340 | 0 | 0 | +| | nrf7002dk | 0 | 0 | | +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ -| | nrf21540dk_nrf52840 | 0 | 0 | +| | nrf21540dk | 0 | 0 | +| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ +| | nrf54l15pdk | 0 | 0 | +--------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+ .. _ug_matter_gs_transmission_power_thread: @@ -76,13 +84,15 @@ The maximum value of 20 dBm is only recommended for devices that are using :ref: +--------------------------+-----------------------------------------------------------------------------+ | Board name | Min - max TX power (dBm) | +==========================+=============================================================================+ -| nrf52840dk_nrf52840 | -40 to +8 | +| nrf52840dk | -40 to +8 | ++--------------------------+-----------------------------------------------------------------------------+ +| nrf5340dk | -40 to +3 | +--------------------------+-----------------------------------------------------------------------------+ -| nrf5340dk_nrf5340 | -40 to +3 | +| nrf7002dk | -40 to +3 | +--------------------------+-----------------------------------------------------------------------------+ -| nrf7002dk_nrf5340 | -40 to +3 | +| nrf21540dk | -40 to +20 (:ref:`more information `) | +--------------------------+-----------------------------------------------------------------------------+ -| nrf21540dk_nrf52840 | -40 to +20 (:ref:`more information `) | +| nrf54l15pdk_nrf54l15 | -8 to +8 | +--------------------------+-----------------------------------------------------------------------------+ You can provide the desired value also as a CMake argument when building the sample. @@ -92,18 +102,18 @@ You can provide the desired value also as a CMake argument when building the sam .. group-tab:: nRF Connect for VS Code To build a Matter sample with a custom Thread TX power in the nRF Connect for VS Code IDE, add the :kconfig:option:`CONFIG_OPENTHREAD_DEFAULT_TX_POWER` Kconfig option variable and the dBm value to the :term:`build configuration`'s :guilabel:`Extra CMake arguments` and rebuild the build configuration. - For example, if you want to build for the ``nrf52840dk_nrf52840`` build target with the default Thread TX power equal to 2 dBm, add ``-DCONFIG_OPENTHREAD_DEFAULT_TX_POWER=2``. + For example, if you want to build for the ``nrf52840dk/nrf52840`` build target with the default Thread TX power equal to 2 dBm, add ``-DCONFIG_OPENTHREAD_DEFAULT_TX_POWER=2``. See `nRF Connect for VS Code extension pack `_ documentation for more information. .. group-tab:: Command line To build a Matter sample with a custom Thread TX power from the command line, add the :kconfig:option:`CONFIG_OPENTHREAD_DEFAULT_TX_POWER` Kconfig option variable and the dBm value to the build command. - For example, if you want to build for the ``nrf52840dk_nrf52840`` build target with the default Thread TX power equal to 2 dBm, run the following command: + For example, if you want to build for the ``nrf52840dk/nrf52840`` build target with the default Thread TX power equal to 2 dBm, run the following command: .. code-block:: console - west build -b nrf52840dk_nrf52840 -- -DCONFIG_OPENTHREAD_DEFAULT_TX_POWER=2 + west build -b nrf52840dk/nrf52840 -- -DCONFIG_OPENTHREAD_DEFAULT_TX_POWER=2 .. @@ -124,13 +134,15 @@ The following table lists the minimum and maximum output power values in dBm for +--------------------------+-----------------------------------------------------------------------------------------------------------------+ | Board name | Min - max TX power (dBm) | +==========================+=================================================================================================================+ -| nrf52840dk_nrf52840 | -40 to +8 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_8`) | +| nrf52840dk | -40 to +8 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_8`) | ++--------------------------+-----------------------------------------------------------------------------------------------------------------+ +| nrf5340dk | -40 to +3 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_3`) | +--------------------------+-----------------------------------------------------------------------------------------------------------------+ -| nrf5340dk_nrf5340 | -40 to +3 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_3`) | +| nrf7002dk | -40 to +3 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_3`) | +--------------------------+-----------------------------------------------------------------------------------------------------------------+ -| nrf7002dk_nrf5340 | -40 to +3 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_3`) | +| nrf54l15pdk | -40 to +8 (:kconfig:option:`CONFIG_BT_CTLR_TX_PWR_MINUS_40` to :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_PLUS_3`) | +--------------------------+-----------------------------------------------------------------------------------------------------------------+ -| nrf21540dk_nrf52840 | :ref:`Handled automatically by the FEM driver ` | +| nrf21540dk | :ref:`Handled automatically by the FEM driver ` | +--------------------------+-----------------------------------------------------------------------------------------------------------------+ For multicore boards, the configuration must be applied to the network core image. @@ -145,8 +157,8 @@ You can do this by either editing the :file:`prj.conf` file or building the samp The parameter name varies depending on the devices you are building for. For example: - * If you want to build for Thread devices for the ``nrf5340dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dmultiprotocol_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. - * If you want to build for Wi-Fi® devices for the ``nrf7002dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. + * If you want to build for Thread devices for the ``nrf5340dk/nrf5340/cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dmultiprotocol_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. + * If you want to build for Wi-Fi® devices for the ``nrf7002dk/nrf5340/cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, add ``-Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y`` as the CMake argument. See `nRF Connect for VS Code extension pack `_ documentation for more information. @@ -157,17 +169,17 @@ You can do this by either editing the :file:`prj.conf` file or building the samp The parameter name varies depending on the devices you are building for. For example: - * If you want to build for Thread devices for the ``nrf5340dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, run the following command: + * If you want to build for Thread devices for the ``nrf5340dk/nrf5340/cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, run the following command: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -Dmultiprotocol_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y + west build -b nrf5340dk/nrf5340/cpuapp -- -Dmultiprotocol_rpmsg_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y - * If you want to build for Wi-Fi® devices for the ``nrf7002dk_nrf5340_cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, run the following command: + * If you want to build for Wi-Fi® devices for the ``nrf7002dk/nrf5340/cpuapp`` build target with a Bluetooth LE TX power equal to 3 dBm, run the following command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y + west build -b nrf7002dk/nrf5340/cpuapp -- -Dhci_ipc_CONFIG_BT_CTLR_TX_PWR_PLUS_3=y .. diff --git a/doc/nrf/protocols/matter/index.rst b/doc/nrf/protocols/matter/index.rst index 5b66647e026d..a53cc16c8eb2 100644 --- a/doc/nrf/protocols/matter/index.rst +++ b/doc/nrf/protocols/matter/index.rst @@ -20,7 +20,9 @@ The |NCS| allows you to develop applications with different versions of Matter, +--------------------------+-----------------------------------------------------+------------------------+ | nRF Connect SDK version | Matter specification version | `Matter SDK version`_ | +==========================+=====================================================+========================+ -| |release| | :ref:`1.2.0 ` | 1.2.0.1 | +| v2.6.99 (latest) | :ref:`1.2.0 ` | 1.2.0.1 | ++--------------------------+ | | +| |release| | | | +--------------------------+-----------------------------------------------------+------------------------+ | v2.5.2 | :ref:`1.1.0 ` | 1.1.0.1 | +--------------------------+ | | diff --git a/doc/nrf/protocols/matter/overview/dev_model.rst b/doc/nrf/protocols/matter/overview/dev_model.rst index 1da5a0858ab8..c54a0d2cf8d9 100644 --- a/doc/nrf/protocols/matter/overview/dev_model.rst +++ b/doc/nrf/protocols/matter/overview/dev_model.rst @@ -34,23 +34,25 @@ For more information about Matter architecture and Matter in the |NCS|, read :re Supported Matter versions in the |NCS| ====================================== -The following table lists Matter versions supported in the |NCS|, with a brief overview of changes and the release date. - -+-----------------+----------------------------------------------------------------------------------------------------------+---------------------+ -| Matter version | Overview of changes | Release date | -+=================+==========================================================================================================+=====================+ -| 1.2.0 | - Introduced support for the ICD Management cluster. | October 23, 2023 | -| | - Added the Product Appearance attribute in the Basic Information cluster. | | -| | - Added nine new :ref:`device types `: | | -| | Refrigerator, Room Air Conditioner, Dishwasher, Laundry Washer, Robotic Vacuum Cleaner, | | -| | Smoke CO Alarm, Air Quality Sensor, Air Purifier, and Fan. | | -+-----------------+----------------------------------------------------------------------------------------------------------+---------------------+ -| 1.1.0 | - Improved Intermittently Connected Device (ICD) support: | May 18, 2023 | -| | more :ref:`ug_matter_configuring_optional_persistent_subscriptions`. | | -| | - Enhancements and bug fixes for Matter Specification, Certification Test Plan, and the Matter SDK. | | -+-----------------+----------------------------------------------------------------------------------------------------------+---------------------+ -| 1.0.0 | Initial version of the Matter specification. | November 2, 2022 | -+-----------------+----------------------------------------------------------------------------------------------------------+---------------------+ +The following table lists Matter versions supported in the |NCS|, with a brief overview of changes. +The table also lists the release date for that Matter specification version, and the version of the |NCS| that added support for it. + ++-----------------+----------------------------------------------------------------------------------------------------------+-----------------------+------------------+ +| | | Specification | |NCS| version | +| Matter version | Overview of changes | release date | | ++=================+==========================================================================================================+=======================+==================+ +| 1.2.0 | - Introduced support for the ICD Management cluster. | October 23, 2023 | v2.6.0 | +| | - Added the Product Appearance attribute in the Basic Information cluster. | | | +| | - Added nine new :ref:`device types `: | | | +| | Refrigerator, Room Air Conditioner, Dishwasher, Laundry Washer, Robotic Vacuum Cleaner, | | | +| | Smoke CO Alarm, Air Quality Sensor, Air Purifier, and Fan. | | | ++-----------------+----------------------------------------------------------------------------------------------------------+-----------------------+------------------+ +| 1.1.0 | - Improved Intermittently Connected Device (ICD) support: | May 18, 2023 | v2.4.0 | +| | more :ref:`ug_matter_configuring_optional_persistent_subscriptions`. | | | +| | - Enhancements and bug fixes for Matter Specification, Certification Test Plan, and the Matter SDK. | | | ++-----------------+----------------------------------------------------------------------------------------------------------+-----------------------+------------------+ +| 1.0.0 | Initial version of the Matter specification. | October 4, 2022 | v2.1.2 | ++-----------------+----------------------------------------------------------------------------------------------------------+-----------------------+------------------+ .. _ug_matter_overview_dev_model_ecosystems: diff --git a/doc/nrf/protocols/matter/overview/integration.rst b/doc/nrf/protocols/matter/overview/integration.rst index ca50d1ce8da4..8275d824d546 100644 --- a/doc/nrf/protocols/matter/overview/integration.rst +++ b/doc/nrf/protocols/matter/overview/integration.rst @@ -56,17 +56,17 @@ This platform design is suitable for the following development kits: .. table-from-rows:: /includes/sample_board_rows.txt :header: heading - :rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp_and_cpuapp_ns + :rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp_and_cpuapp_ns, nrf54l15pdk_nrf54l15_cpuapp The design differences between the supported SoCs are the following: -* On the nRF5340 SoC, the network core runs both the Bluetooth LE Controller and the 802.15.4 IEEE Radio Driver. -* On the nRF52840 SoC, all components are located on the application core. +* On the nRF5340, SoC the network core runs both the Bluetooth LE Controller and the 802.15.4 IEEE Radio Driver. +* On the nRF52840 and nRF54L15 SoCs, all components are located on the application core. .. figure:: ../../thread/overview/images/thread_platform_design_multi.svg - :alt: Multiprotocol Thread and Bluetooth LE architecture (nRF52) + :alt: Multiprotocol Thread and Bluetooth LE architecture (nRF52, nRF54L) - Multiprotocol Thread and Bluetooth LE architecture on nRF52 Series devices + Multiprotocol Thread and Bluetooth LE architecture on nRF52 Series and nRF54L Series devices .. figure:: ../../thread/overview/images/thread_platform_design_nRF53_multi.svg :alt: Multiprotocol Thread and Bluetooth LE architecture (nRF53) @@ -88,8 +88,8 @@ This platform design is suitable for the following development kits: For this design, the Wi-Fi driver on the application core communicates with the external nRF7002 Wi-Fi 6 Companion IC over QSPI or SPI: -* For the ``nrf5340dk_nrf5340_cpuapp``, nRF7002 support is added using ``nrf7002ek`` shield connected through SPI. -* For the ``nrf7002dk_nrf5340_cpuapp``, nRF7002 is connected with the nRF5340 SoC through QSPI. +* For the ``nrf5340dk/nrf5340/cpuapp``, nRF7002 support is added using ``nrf7002ek`` shield connected through SPI. +* For the ``nrf7002dk/nrf5340/cpuapp``, nRF7002 is connected with the nRF5340 SoC through QSPI. .. figure:: images/matter_platform_design_nRF53_wifi.svg :alt: Multiprotocol Wi-Fi and Bluetooth LE architecture (nRF53 with the nRF7002 Wi-Fi 6 Companion IC) @@ -115,7 +115,7 @@ This platform design is suitable for the following development kits: :header: heading :rows: nrf5340dk_nrf5340_cpuapp -This design is only available for the ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield. +This design is only available for the ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield. The Wi-Fi driver on the application core communicates through SPI with the external nRF7002 EK shield, which works as the Wi-Fi 6 Companion IC. .. figure:: images/matter_platform_design_nRF53_wifi_switching.svg diff --git a/doc/nrf/protocols/thread/certification.rst b/doc/nrf/protocols/thread/certification.rst index 0ec18cd0a6e6..84db3af2240f 100644 --- a/doc/nrf/protocols/thread/certification.rst +++ b/doc/nrf/protocols/thread/certification.rst @@ -73,7 +73,7 @@ Complete the following steps to prepare for the certification tests: .. code-block:: cd ncs/nrf/samples/openthread/cli/ - west build -b nrf52840dk_nrf52840 -S ci -S multiprotocol -- -DCONFIG_OPENTHREAD_LIBRARY=y + west build -b nrf52840dk/nrf52840 -S ci -S multiprotocol -- -DCONFIG_OPENTHREAD_LIBRARY=y * If building using Visual Studio Code, you must first `create and build the application `_ using the CLI sample. Add the following lines to the **Additional CMake arguments** text field: diff --git a/doc/nrf/protocols/thread/configuring.rst b/doc/nrf/protocols/thread/configuring.rst index f95311baea0d..931cdb97d905 100644 --- a/doc/nrf/protocols/thread/configuring.rst +++ b/doc/nrf/protocols/thread/configuring.rst @@ -66,7 +66,7 @@ Using pre-built variants can be useful for certification purposes. * :kconfig:option:`CONFIG_OPENTHREAD_LIBRARY` - This option enables OpenThread to use pre-built libraries. - You must select one of the :ref:`thread_ug_feature_sets` by enabling :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER`, :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD`, or :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD`. + You must select one of the :ref:`thread_ug_feature_sets` by enabling :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER`, :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD`, :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD`, or :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_RCP`. This disables building OpenThread from source files and links pre-built libraries instead. @@ -260,11 +260,11 @@ Minimal Thread Device (MTD) Trusted Firmware-M support options ================================== -To configure your Thread application on the nRF5340 DK to run with Trusted Firmware-M, use the ``nrf5340dk_nrf5340_cpuapp_ns`` build target and enable the following Kconfig options: +To configure your Thread application on the nRF5340 DK to run with Trusted Firmware-M, use the ``nrf5340dk/nrf5340/cpuapp/ns`` build target and enable the following Kconfig options: * :kconfig:option:`CONFIG_BUILD_WITH_TFM` * :kconfig:option:`CONFIG_OPENTHREAD_CRYPTO_PSA` -In the |NCS|, these options are enabled by default for the :ref:`application core ` of the :ref:`openthread_samples` that can be programmed with the ``nrf5340dk_nrf5340_cpuapp_ns`` build target. +In the |NCS|, these options are enabled by default for the :ref:`application core ` of the :ref:`openthread_samples` that can be programmed with the ``nrf5340dk/nrf5340/cpuapp/ns`` build target. For more Trusted Firmware-M documentation, see :ref:`ug_tfm` and the official `TF-M documentation`_. diff --git a/doc/nrf/protocols/thread/overview/ot_memory.rst b/doc/nrf/protocols/thread/overview/ot_memory.rst index 7231e16ae741..e335974ac239 100644 --- a/doc/nrf/protocols/thread/overview/ot_memory.rst +++ b/doc/nrf/protocols/thread/overview/ot_memory.rst @@ -41,7 +41,7 @@ See :ref:`thread_device_types` for more information on device types, and :ref:`t nRF5340 DK RAM and flash memory requirements ********************************************* -The following tables present memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk_nrf5340 `) with the software cryptography support provided by the :ref:`nrfxlib:nrf_oberon_readme` module. +The following tables present memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk `) with the software cryptography support provided by the :ref:`nrfxlib:nrf_oberon_readme` module. .. table:: nRF5340 single protocol Thread 1.3 memory requirements diff --git a/doc/nrf/protocols/thread/overview/power_consumption.rst b/doc/nrf/protocols/thread/overview/power_consumption.rst index b94a4f7f0998..38d830fbc775 100644 --- a/doc/nrf/protocols/thread/overview/power_consumption.rst +++ b/doc/nrf/protocols/thread/overview/power_consumption.rst @@ -16,7 +16,7 @@ Measurements methodology The measurement setup consists of: -* An nrf52840dk_nrf52840 board used as a Thread leader. +* An nrf52840dk board used as a Thread leader. * A DUT board used as a Thread child. * A `Power Profiler Kit II (PPK2)`_ attached to the DUT according to the instructions in its Quick start guide. @@ -25,7 +25,7 @@ The leader board is flashed with the regular :ref:`Thread CLI sample ` firmware. In the build command below, replace ``build-target`` with the build target name of the DUT. @@ -60,7 +60,7 @@ The following tables show the power consumption measured with the configuration .. table:: Configuration +--------------------------+---------------------+--------------------------+ - | Parameter | nrf52840dk_nrf52840 | nrf5340dk_nrf5340_cpuapp | + | Parameter | nrf52840dk/nrf52840 | nrf5340dk/nrf5340/cpuapp | +==========================+=====================+==========================+ | Board revision | v3.0.1 | v2.0.1 | +--------------------------+---------------------+--------------------------+ @@ -74,7 +74,7 @@ The following tables show the power consumption measured with the configuration .. table:: Power consumption +-------------------------------+-----------------------+----------------------------+ - | Parameter | nrf52840dk_nrf52840 | nrf5340dk_nrf5340_cpuapp | + | Parameter | nrf52840dk/nrf52840 | nrf5340dk/nrf5340/cpuapp | +===============================+=======================+============================+ | Total charge per minute [μC] | 1136.00 | 1203.00 | +-------------------------------+-----------------------+----------------------------+ @@ -89,7 +89,7 @@ The following tables show the power consumption measured with the configuration .. table:: Configuration +--------------------------------+---------------------+--------------------------+ - | Parameter | nrf52840dk_nrf52840 | nrf5340dk_nrf5340_cpuapp | + | Parameter | nrf52840dk/nrf52840 | nrf5340dk/nrf5340/cpuapp | +================================+=====================+==========================+ | Board revision | v3.0.1 | v2.0.1 | +--------------------------------+---------------------+--------------------------+ @@ -109,7 +109,7 @@ The following tables show the power consumption measured with the configuration .. table:: Power consumption +---------------------------------+-----------------------+----------------------------+ - | Parameter | nrf52840dk_nrf52840 | nrf5340dk_nrf5340_cpuapp | + | Parameter | nrf52840dk/nrf52840 | nrf5340dk/nrf5340/cpuapp | +=================================+=======================+============================+ | Total charge per minute [μC] | 1042.20 | 1148.60 | +---------------------------------+-----------------------+----------------------------+ diff --git a/doc/nrf/protocols/thread/prebuilt_libs.rst b/doc/nrf/protocols/thread/prebuilt_libs.rst index 4ab745332470..2c6a14e2eda7 100644 --- a/doc/nrf/protocols/thread/prebuilt_libs.rst +++ b/doc/nrf/protocols/thread/prebuilt_libs.rst @@ -27,6 +27,7 @@ The |NCS| provides the following feature sets: * :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER` - Enable the complete set of OpenThread features for the Thread Specification. * :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD` - Enable optimized OpenThread features for FTD. * :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD` - Enable optimized OpenThread features for MTD. +* :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_RCP` - Enable optimized feature set for RCP. * :kconfig:option:`CONFIG_OPENTHREAD_USER_CUSTOM_LIBRARY` - Create a custom feature set for compilation when :ref:`building OpenThread libraries from source `. This option is the default. If you use pre-built libraries, you must choose a different feature set. @@ -48,147 +49,176 @@ For more information about Thread 1.2 features, see the `Thread 1.2 Base Feature - Master - FTD - MTD + - RCP - Custom * - BORDER_AGENT - - - - + - * - BORDER_ROUTER - - - - + - * - CHILD_SUPERVISION - ✔ - ✔ - ✔ - + - * - COAP - ✔ - ✔ - ✔ - + - * - COAPS - ✔ - - - + - * - COMMISSIONER - ✔ - - - + - * - DIAGNOSTIC - ✔ - - - + - * - DNS_CLIENT - ✔ - ✔ - ✔ - + - * - DHCP6_SERVER - ✔ - - - + - * - DHCP6_CLIENT - ✔ - - - + - * - ECDSA - ✔ - ✔ - ✔ - + - * - IP6_FRAGM - ✔ - ✔ - ✔ - + - * - JAM_DETECTION - ✔ - - - + - * - JOINER - ✔ - - - + - * - LINK_RAW - ✔ - - - + - * - MAC_FILTER - ✔ - - - + - * - MTD_NETDIAG - ✔ - - - + - * - SERVICE - ✔ - - - + - * - SLAAC - ✔ - ✔ - ✔ - + - * - SNTP_CLIENT - ✔ - - - + - * - SRP_CLIENT - ✔ - ✔ - ✔ - + - * - UDP_FORWARD - ✔ - - - + - * - BACKBONE_ROUTER (Thread 1.2) - - - - + - * - CSL_RECEIVER (Thread 1.2) - ✔ - - ✔ + - ✔ - * - DUA (Thread 1.2) - ✔ - ✔ - ✔ - + - * - LINK_METRICS_INITIATOR (Thread 1.2) - ✔ - - + - ✔ - * - LINK_METRICS_SUBJECT (Thread 1.2) - ✔ - ✔ - + - ✔ - * - MLR (Thread 1.2) - ✔ - ✔ - ✔ - + - For the full list of configuration options that were used during compilation, including their default values, see the :file:`openthread_lib_configuration.txt` file within each library folder in the nrfxlib repository. The library folders are inside :file:`openthread/lib`. @@ -248,7 +278,7 @@ Use the following command: .. parsed-literal:: :class: highlight - west build -b nrf52840dk_nrf52840 -t install_openthread_libraries -- -DOPENTHREAD_BUILD_OUTPUT_STRIPPED=y + west build -b nrf52840dk/nrf52840 -t install_openthread_libraries -- -DOPENTHREAD_BUILD_OUTPUT_STRIPPED=y This command builds two versions of the libraries, with and without debug symbols, and installs only the version without debug symbols. |board_note_for_updating_libs| @@ -267,7 +297,7 @@ Use the following command: .. parsed-literal:: :class: highlight - west build -b nrf52840dk_nrf52840 -t install_openthread_libraries + west build -b nrf52840dk/nrf52840 -t install_openthread_libraries |board_note_for_updating_libs| diff --git a/doc/nrf/protocols/thread/tools.rst b/doc/nrf/protocols/thread/tools.rst index b236a1b203f2..496d6c0a509e 100644 --- a/doc/nrf/protocols/thread/tools.rst +++ b/doc/nrf/protocols/thread/tools.rst @@ -87,13 +87,13 @@ To program the nRF device with the RCP application, complete the following steps .. code-block:: console - west build -p always -b nrf52840dongle_nrf52840 nrf/samples/openthread/coprocessor/ + west build -p always -b nrf52840dongle/nrf52840 nrf/samples/openthread/coprocessor/ .. tab:: nRF52840 Development Kit (UART transport) .. code-block:: console - west build -p always -b nrf52840dk_nrf52840 nrf/samples/openthread/coprocessor/ + west build -p always -b nrf52840dk/nrf52840 nrf/samples/openthread/coprocessor/ #. Depending on the hardware platform, complete the following steps: diff --git a/doc/nrf/protocols/wifi/debugging.rst b/doc/nrf/protocols/wifi/debugging.rst index 068f66eda16c..c44411516a87 100644 --- a/doc/nrf/protocols/wifi/debugging.rst +++ b/doc/nrf/protocols/wifi/debugging.rst @@ -28,14 +28,14 @@ With west .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -S nrf70-debug samples/wifi/shell + west build -p -b nrf7002dk/nrf5340/cpuapp -S nrf70-debug samples/wifi/shell With CMake ---------- .. code-block:: console - cmake -GNinja -Bbuild -DBOARD=nrf7002dk_nrf5340_cpuapp -DSNIPPET=nrf70-debug samples/wifi/shell + cmake -GNinja -Bbuild -DBOARD=nrf7002dk/nrf5340/cpuapp -DSNIPPET=nrf70-debug samples/wifi/shell ninja -C build Statistics diff --git a/doc/nrf/protocols/wifi/index.rst b/doc/nrf/protocols/wifi/index.rst index 70443ed293f0..354aab9a51a2 100644 --- a/doc/nrf/protocols/wifi/index.rst +++ b/doc/nrf/protocols/wifi/index.rst @@ -29,6 +29,7 @@ If you want to go through an online training course to familiarize yourself with :caption: Subpages: wifi.rst + wifi_certification station_mode/index scan_mode/index sap_mode/index diff --git a/doc/nrf/protocols/wifi/station_mode/powersave.rst b/doc/nrf/protocols/wifi/station_mode/powersave.rst index e57b861d2293..e168329aa395 100644 --- a/doc/nrf/protocols/wifi/station_mode/powersave.rst +++ b/doc/nrf/protocols/wifi/station_mode/powersave.rst @@ -104,7 +104,7 @@ You must keep the following in mind while choosing the inactivity timer: .. note:: - The inactivity timer can be configured using the ``NET_REQUEST_WIFI_PS_TIMEOUT`` network management API. + The inactivity timer can be configured using the ``NET_REQUEST_WIFI_PS`` network management API. The nRF70 Series device consumes less power in Power Save mode, that is, when the inactivity timer value is ``0``, in low traffic scenarios. However, the downlink throughput is significantly lower in this mode. diff --git a/doc/nrf/protocols/wifi/wifi.rst b/doc/nrf/protocols/wifi/wifi.rst index 52deaa783dfc..ae67d1634450 100644 --- a/doc/nrf/protocols/wifi/wifi.rst +++ b/doc/nrf/protocols/wifi/wifi.rst @@ -1,8 +1,8 @@ +.. _ug_wifi_overview: + Wi-Fi overview ############## -.. _ug_wifi_overview: - .. contents:: :local: :depth: 2 @@ -139,16 +139,3 @@ The range of supported rates is vast, ranging from 86 Mbps for a single antenna Wi-Fi has traditionally been single user (SU) based, which means that during any particular on-air packet transmission, the communication is between two users (excluding broadcast/multicast scenarios where the same information is delivered to multiple users). With the advent of Wi-Fi 6 (and to some extent Wi-Fi 5), multiuser (MU) support has been introduced. Through both MIMO and Orthogonal Frequency Division Multiple Access (OFDMA) techniques (and even a combination of both), it is now possible to send unique information to multiple users in the same on-air packet transmission, both in the downlink and uplink direction. - -.. _ug_wifi_certification: - -Wi-Fi certification -******************* - -The Wi-Fi Alliance offers full `certification program `_ that validates the interoperability of a Wi-Fi end product with other Wi-Fi Certified equipment. -The program offers three different paths of certification to Contributor-level `members of the Wi-Fi Alliance `_. -Implementer-level members can take advantage of the program by implementing Wi-Fi modules that have been previously certified by a Contributor-level member, for example one of the `Nordic third-party modules`_. - -For details about the Wi-Fi certification program and the available paths for the nRF70 Series, read the `Wi-Fi Alliance Certification for nRF70 Series`_ document. - -For instructions on how to specifically use the QuickTrack certification path, see the :ref:`wifi_wfa_qt_app_sample` page. diff --git a/doc/nrf/protocols/wifi/wifi_certification.rst b/doc/nrf/protocols/wifi/wifi_certification.rst new file mode 100644 index 000000000000..9cd202e012e5 --- /dev/null +++ b/doc/nrf/protocols/wifi/wifi_certification.rst @@ -0,0 +1,47 @@ +.. _ug_wifi_certification: + +Wi-Fi certification +################### + +.. contents:: + :local: + :depth: 2 + +The Wi-Fi Alliance® offers a full `certification program `_ that validates the interoperability of a Wi-Fi® end product with other Wi-Fi certified equipment. +The program offers three different paths of certification to Contributor-level `members of the Wi-Fi Alliance `_. +Implementer-level members can take advantage of the program by implementing Wi-Fi modules that have been previously certified by a Contributor-level member, for example, one of the `Nordic third-party modules`_. + +Qualified Solution +****************** + +Nordic Semiconductor supports programs and paths to create Qualified Solutions that you can use to accelerate the Wi-Fi certification of their end products. +As a solution provider, it creates Qualified Solutions and Qualified Solution Variants for its product evaluation platforms based on the nRF70 Series devices and the |NCS|. +This enables you to use the QuickTrack Wi-Fi certification process. + +Wi-Fi certification paths +************************* + +An end product based on an nRF70 Series device can achieve Wi-Fi certification through the QuickTrack or Derivative paths. +The QuickTrack certification path is applicable for all end products designed from either the Nordic Semiconductor Qualified Solutions or Qualified Solution Variant evaluation platforms, where limited modifications are allowed. +Derivative certification is applicable for end products based on third-party Wi-Fi CERTIFIED™ modules containing an nRF70 Series IC without any modification. + +For details about the Wi-Fi certification program and the available paths for the nRF70 Series, read the `Wi-Fi Alliance Certification for nRF70 Series`_ document. + +For instructions on how to specifically use the QuickTrack certification path, see the :ref:`wifi_wfa_qt_app_sample` page. + +Recertification process after end product software upgrade +********************************************************** + +When your Wi-Fi CERTIFIED end product receives an update with new software corresponding to a newer |NCS| release, you must initiate the Wi-Fi CERTIFIED end product variant process. +The certification process is controlled by the Wi-Fi Alliance. + +Under the QuickTrack certification path, the recertification process involves rerunning the QuickTrack Wi-Fi certification testing on the end product with the updated software and basing it on the Qualified Solution or variant from Nordic Semiconductor corresponding to that version of the |NCS| software. + +Under the Derivative certification path, the recertification process does not involve any additional certification testing on the end product. +You need to reapply for the new derivative certification, basing it on the new qualified product variant as required. + +See the following links for more information on the certification process: + +* `QuickTrack New Product Application Training`_ +* `QuickTrack Member Conformance Test Laboratory Setup`_ +* `Wi-Fi_CERTIFIED_Derivative_Certifications_Overview`_ diff --git a/doc/nrf/protocols/zigbee/configuring_zboss_traces.rst b/doc/nrf/protocols/zigbee/configuring_zboss_traces.rst index ae4280744531..73ce313567e3 100644 --- a/doc/nrf/protocols/zigbee/configuring_zboss_traces.rst +++ b/doc/nrf/protocols/zigbee/configuring_zboss_traces.rst @@ -11,7 +11,7 @@ The :ref:`nrfxlib:zboss` (ZBOSS stack) comes included in the |NCS| in a set of p To help with that, the ZBOSS stack can be configured to print trace logs that allow you to trace the stack behavior. This page describes how to enable and configure ZBOSS trace logs. -Trace logs are printed in binary form and require access to stack source files to be decoded into log messages. +Trace logs are printed in binary form and require access to stack source files to be decoded into log messages. Enabling trace logs can help with the debugging process even if you cannot decode them (due to lack of access to stack source files). This is because of the information they can provide about the stack behavior whenever an issue is found or reproduced. diff --git a/doc/nrf/protocols/zigbee/memory.rst b/doc/nrf/protocols/zigbee/memory.rst index 261430e256c7..106e22b43e47 100644 --- a/doc/nrf/protocols/zigbee/memory.rst +++ b/doc/nrf/protocols/zigbee/memory.rst @@ -33,7 +33,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF52840 - The following table lists memory requirements for samples running on the :ref:`nRF52840 DK ` (:ref:`nrf52840dk_nrf52840 `). + The following table lists memory requirements for samples running on the :ref:`nRF52840 DK ` (:ref:`nrf52840dk `). +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ | Sample | ROM, ZBOSS stack + App | ROM, MCUboot bootloader | ROM, ZBOSS non-volatile memory | ROM, ZBOSS product config | Total ROM | RAM, ZBOSS stack + App | Total RAM | @@ -63,7 +63,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF52833 - The following table lists memory requirements for samples running on the :ref:`nRF52833 DK ` (:ref:`nrf52833dk_nrf52833 `). + The following table lists memory requirements for samples running on the :ref:`nRF52833 DK ` (:ref:`nrf52833dk `). +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ | Sample | ROM, ZBOSS stack + App | ROM, MCUboot bootloader | ROM, ZBOSS non-volatile memory | ROM, ZBOSS product config | Total ROM | RAM, ZBOSS stack + App | Total RAM | @@ -93,7 +93,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF5340 - The following table lists memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk_nrf5340_cpuapp `). + The following table lists memory requirements for samples running on the :ref:`nRF5340 DK ` (:ref:`nrf5340dk `). +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ | Sample | ROM, ZBOSS stack + App | ROM, MCUboot bootloader | ROM, ZBOSS non-volatile memory | ROM, ZBOSS product config | Total ROM | RAM, ZBOSS stack + App | Total RAM | @@ -123,7 +123,7 @@ Values are provided in kilobytes (KB). .. tab:: nRF21540 - The following table lists memory requirements for samples running on the :ref:`nR21540 DK ` (:ref:`nrf21540dk_nrf52840 `). + The following table lists memory requirements for samples running on the :ref:`nR21540 DK ` (:ref:`nrf21540dk `). +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ | Sample | ROM, ZBOSS stack + App | ROM, MCUboot bootloader | ROM, ZBOSS non-volatile memory | ROM, ZBOSS product config | Total ROM | RAM, ZBOSS stack + App | Total RAM | diff --git a/doc/nrf/releases_and_maturity.rst b/doc/nrf/releases_and_maturity.rst index 24219e5ceb73..83505d50be46 100644 --- a/doc/nrf/releases_and_maturity.rst +++ b/doc/nrf/releases_and_maturity.rst @@ -26,3 +26,4 @@ If an issue is found in a release after it has taken place, those issues are lis releases_and_maturity/migration_guides releases_and_maturity/repository_revisions releases_and_maturity/software_maturity + releases_and_maturity/known_issues diff --git a/doc/nrf/releases_and_maturity/known_issues.rst b/doc/nrf/releases_and_maturity/known_issues.rst index f3a0745b84bb..0c59a48102f8 100644 --- a/doc/nrf/releases_and_maturity/known_issues.rst +++ b/doc/nrf/releases_and_maturity/known_issues.rst @@ -1,5 +1,3 @@ -:orphan: - .. _known_issues: Known issues @@ -24,7 +22,7 @@ A known issue can list one or both of the following entries: Sometimes, they are discovered later and added over time. .. version-filter:: - :default: v2-6-0 + :default: v2-6-1 :container: dl/dt :tags: [("wontfix", "Won't fix")] @@ -62,7 +60,7 @@ The issues in this section are related to :ref:`protocols`. Amazon Sidewalk =============== -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 KRKNWK-18465: BUS fault on FSK during the FACTORY_RESET call The Bluetooth LE link is deinitialized. @@ -73,7 +71,7 @@ KRKNWK-18465: BUS fault on FSK during the FACTORY_RESET call **Workaround:** Perform a factory reset as the error is recoverable. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 KRKNWK-18511: Advertising fails to start (``err -12``) upon registration The Sidewalk end device is trying to restart advertising, for example, on time sync lost. @@ -82,33 +80,33 @@ KRKNWK-18511: Advertising fails to start (``err -12``) upon registration **Workaround:** The issue fixes upon automatic restart of the Bluetooth LE advertising. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17860: QSPI assert occurs when performing DFU in the Sidewalk application mode The DFU must be performed only in the DFU mode. The DFU Bluetooth service can be used in the Sidewalk mode, however, using it leads to assertion failure, resulting in a Zephyr fatal error. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17800: After reconnecting to the network, the end device cannot find the route to its host After the device disconnects from Sidewalk servers, the sensor monitoring app over Bluetooth LE shows an error ``-38 (SID_ERROR_NO_ROUTE_AVAILABLE)``. **Workaround:** The device needs to be reset manually. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17750: Error occurs when sending multiple messages in a short period of time When sending multiple Sidewalk messages in a short period of time, the internal queues might become full, showing misleading error messages, such as ``-12 (SID_ERROR_INCOMPATIBLE_PARAMS)``. **Workaround:** The message must be resent after the protocol empties the queues. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17244: CMake warnings when building the Sidewalk samples CMake warnings (``No SOURCES given to Zephyr library``) show up in the build log of a Sidewalk application. The application builds successfully, but the error might obfuscate other important warnings. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17374: Sporadic Zephyr fatal error after disconnecting on FSK After disconnecting on FSK, Zephyr fatal error occurs due to assertion in the semaphore module. @@ -116,20 +114,20 @@ KRKNWK-17374: Sporadic Zephyr fatal error after disconnecting on FSK The device resets automatically in the release mode, however, in the debug mode it needs to be reset manually. Currently, this issue occurs for Sidewalk v1.14 libraries, and it will be fixed in a future version. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17035: Sensor monitor uplink messages are lost when the notification period is longer than 30 seconds If the notification period is set to longer than 30 seconds, sensor monitor uplink messages are lost. **Workaround:** The notification period is set to 15 seconds by default. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-14583: Bus fault after flash, before the :file:`Nordic_MFG.hex` data flash For sub-GHz samples, when the :file:`Nordic_MFG.hex` file is missing, the device throws a hard fault during initializing the Sidewalk stack. Proper error handling will be implemented, but the temporary solution is to write a manufacturing hexadecimal code to the device and reset it. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-14299: NRPA MAC address cannot be set in Zephyr The non-resolvable private address (NRPA) cannot be set in the connectable mode for Bluetooth LE. @@ -251,14 +249,14 @@ Bluetooth Mesh The issues in this section are related to the :ref:`ug_bt_mesh` protocol. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 NCSDK-21625: Advertisements of Bluetooth Mesh GATT services are not stopped by :c:func:`bt_mesh_suspend` and not resumed by :c:func:`bt_mesh_resume` Functions :c:func:`bt_mesh_suspend` and :c:func:`bt_mesh_resume` do not work together with functions :c:func:`bt_disable` and :c:func:`bt_enable`. **Workaround:** To disable node identity advertisement, use ``bt_mesh_subnet_node_id_set`` instead. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 NCSDK-23087: Unsolicited Time Status messages rewrite periodic publishing TTL to zero forever The Time models specification mandates publishing unsolicited Time Status messages with TTL field value set to ``0``. @@ -266,13 +264,13 @@ NCSDK-23087: Unsolicited Time Status messages rewrite periodic publishing TTL to **Workaround:** Configure the initial TTL value after an unsolicited Time Status message is sent. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 NCSDK-23220: The Heartbeat Publication Status message may be malformed after provisioning After provisioning and obtaining the Composition Data, reading the Heartbeat Publication and the Heartbeat Publication Status will contain garbage in the NetKeyIndex field. The reason for this is that the field was not initially cleared. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 NCSDK-23308: Setting storage causes the device to reboot in the event of a clean operation For non-secure builds, whenever a flash erase while setting storage happens, it causes the device to reboot. @@ -306,12 +304,12 @@ NCSDK-16579: Advertising Node Identity and Network ID might not work with the ex **Workaround:** Do not enable the :kconfig:option:`CONFIG_BT_MESH_ADV_EXT_GATT_SEPARATE` option. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 NCSDK-21780: Sensor types with floating point representation lose precision Sensor types with floating point representation lose precision when converted to ``sensor_value`` in the sensor API callbacks. -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 NCSDK-14399: Legacy advertiser can occasionally do more message retransmissions than requested When using the legacy advertiser, the stack sleeps for at least 50 ms after starting advertising a message, which might result in more messages to be advertised than requested. @@ -352,20 +350,68 @@ Matter The issues in this section are related to the :ref:`ug_matter` protocol. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 + +KRKNWK-18916: Issues related to the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START` Kconfig option + When the Kconfig option is selected, there are two issues: + + * An assert may occur after removing the last fabric because the OpenThread interface is still active despite the Thread stack being disabled. + * The device cannot be commissioned to the Matter network because the device's IEEE 802.15.4 Extended address is the same as the one saved in the SRP server. + + **Workaround:** Add the following lines to the :file:`fabric_table_delegate` file: + + * After Line 54 (After the ``DoFactoryReset()`` function) to provide a workaround for potential assert: + + .. code-block:: C++ + + chip::DeviceLayer::ThreadStackMgrImpl().LockThreadStack(); + otIp6SetEnabled(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(), false); + chip::DeviceLayer::ThreadStackMgrImpl().UnlockThreadStack(); + + * After Line 56 (After the ``ErasePersistentInfo()`` function) to generate the new IEEE 802.15.4 Extended address and set it to avoid duplication: + + .. code-block:: C++ + + otExtAddress newOtAddr = {}; + chip::Crypto::DRBG_get_bytes(reinterpret_cast(&newOtAddr), sizeof(newOtAddr)); + otLinkSetExtendedAddress(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(), &newOtAddr); + + .. note:: + + For |NCS| versions v2.5.3, v2.5.2, v2.5.1, and v2.5.0, the :file:`fabric_table_delegate.h` file is located in the :file:`samples/matter/common/src/` directory, whereas for |NCS| versions v2.6.1 and v2.6.0, the file is located in the :file:`samples/matter/common/src/app` directory. + +.. rst-class:: v2-6-1 v2-6-0 + +KRKNWK-18673: Bridged Light Bulb device type reports a failure when reading or writing specific ``onoff`` cluster attributes + The Bridge has defined ZAP clusters properly for a bridged Light Bulb, but handling of specific ``onoff`` cluster attributes has not been implemented. + + **Workaround:** Manually cherry-pick and apply the commit with the fix to ``sdk-nrf`` (commit hash: ``79f3a901dd0787df9327640cb3bb889ccb023005``). + +.. rst-class:: v2-6-1 v2-6-0 + +KRKNWK-18769: :ref:`matter_bridge_app` application does not print the hyperlink for displaying the setup QR code in the log. + This happens, because the log module that displays this log entry has been disabled. + + **Workaround:** Remove the following line from the :file:`src/chip_project_config.h` header file: + + .. code-block:: C + + #define CHIP_CONFIG_LOG_MODULE_AppServer_PROGRESS 0 + +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-18556: While creating multiple subscriptions, the persistent subscriptions resumption feature works only for the first created subscriptions This happens when multiple subscriptions are created by multiple Matter controllers. The persistent subscriptions feature will be replaced by the Check In protocol from the Intermittently Connected Devices (ICD) Cluster. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-18316: When the :kconfig:option:`CONFIG_PRINTK_SYNC` Kconfig option is enabled in a Matter over Thread application, the IEEE 802.15.4 radio driver may calculate invalid IEEE 802.15.4 radio frame timestamps This is caused by the implementation of synchronous ``printk`` in Zephyr using ``spinlock`` synchronization primitive, which can block Real Time Clock interrupts that are needed by the radio driver to calculate precise timestamps. **Workaround:** If it is enabled, disable the :kconfig:option:`CONFIG_PRINTK_SYNC` Kconfig option in your application. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-18495: The Color Control server's ``RemainingTime`` attribute change may be reported every 100 ms, even though the color temperature value handled by the Color Control server is not modified This can result in the Thread network being spammed with unnecessary network traffic when controlling the brightness or color of the :ref:`matter_light_bulb_sample` sample. @@ -380,7 +426,7 @@ KRKNWK-18371: The GlobalSceneControl attribute from the OnOff cluster does not c **Workaround:** Manually cherry-pick and apply the commit with the fix to ``sdk-connectedhomeip`` (commit hash: ``836390ed636ca36126dbcbe763d0f127626cba8d``). -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-18315: SPAKE2+ Verifier is not regenerated when using non-default passcode When building factory data with a non-default passcode, the SPAKE2+ Verifier is not generated based on the selected passcode value, but uses the default passcode value (``20202021``). @@ -404,7 +450,7 @@ KRKNWK-18221: Memory leak in the deferred attribute persister **Workaround:** Manually cherry-pick and apply the commit with the fix to ``sdk-connectedhomeip`` (commit hash: ``e79b0cf44c86ce35dabcf69b50903ac706c67465``). -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-17360: Groupcast communication does not work for multiple endpoints that are part of the same group on a single Matter node The Matter core implementation handles commands status in a wrong way for those targeted to a group. @@ -425,7 +471,7 @@ KRKNWK-17864: When using Wi-Fi® low power mode, the communication with the devi **Workaround:** Disable Wi-Fi low power mode for your application by setting :kconfig:option:`CONFIG_NRF_WIFI_LOW_POWER` to ``n`` in the application :file:`prj.conf`. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17925: The nRF Toolbox application for iOS devices cannot control :ref:`matter_lock_sample` using NUS The nRF Toolbox application sends one additional character in all NUS commands, so they are not correctly parsed by the :ref:`matter_lock_sample`. @@ -433,7 +479,7 @@ KRKNWK-17925: The nRF Toolbox application for iOS devices cannot control :ref:`m **Workaround:** Use nRF Toolbox for iOS versions other than 5.0.9 or any version of nRF Toolbox for Android. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-17914: The links to Kconfig options from :file:`Kconfig.features` do not work in the |NCS| documentation The links to all Kconfig options defined in the :file:`modules/lib/matter/config/nrfconnect/Kconfig.features` file do not work in the documentation. @@ -703,7 +749,7 @@ Thread The issues in this section are related to the :ref:`ug_thread` protocol. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 KRKNWK-18612: nRF5340 sometimes fails to send a Child Update Response to an SSED child After performing an MLE Child Update Request by an SSED child, an nRF5340 parent sometimes does not respond with a Child Update Response. @@ -876,7 +922,15 @@ Zigbee The issues in this section are related to the :ref:`ug_zigbee` protocol. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 + +NCSIDB-1213: Subsequent Zigbee FOTA updates fail + Once a Zigbee FOTA update is interrupted for any reason, the subsequent updates will fail until a device reboot. + This is because :ref:`lib_dfu_target` resources are not freed. + + **Workaround:** Manually cherry-pick and apply commit with fix from ``main`` (commit hash: ``cef8a4b0e5afaed08627bcccbe2ac7b4b600978f``). + +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-18572: Bus fault when resetting the Zigbee light switch sample Usage of :kconfig:option:`CONFIG_RAM_POWER_DOWN_LIBRARY` leads to a bus fault at reset. @@ -890,26 +944,26 @@ KRKNWK-16705: Router device is not fully operational in the distributed network **Workaround:** Add a call to the :c:func:`zb_enable_distributed` function in your application after setting Zigbee Router role for the device. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-14024: Fatal error when the network coordinator factory resets in the Identify mode A fatal error occurs when the :ref:`Zigbee network coordinator ` triggers factory reset in the Identify mode. **Workaround:** Modify your application, so that the factory reset is requested only after the Identify mode ends. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-12937: Activation of Sleepy End Device must be done at the very first commissioning procedure for Zigbee light switch sample After programming the :ref:`Zigbee light switch ` sample and its first commissioning, Zigbee End Device joins the Zigbee network as a normal End Device. Pressing **Button 3** does not switch the device to the Sleepy End Device configuration. **Workaround:** Keep **Button 3** pressed during the first commissioning procedure. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-12615: Get Group Membership Command returns all groups the node is assigned to Get Group Membership Command returns all groups the node is assigned to regardless of the destination endpoint. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 KRKNWK-12115: Simultaneous commissioning of many devices can cause the Coordinator device to assert The Zigbee Coordinator device can assert when multiple devices are being commissioned simultaneously. @@ -943,7 +997,7 @@ KRKNWK-12115: Simultaneous commissioning of many devices can cause the Coordinat #. To increase the scheduler queue size, replace ``XYZ`` next to ``ZB_CONFIG_SCHEDULER_Q_SIZE`` with the value of your choice, ranging from ``48U`` to ``256U``. #. To increase the buffer pool size, replace ``XYZ`` next to ``ZB_CONFIG_IOBUF_POOL_SIZE`` with the value of your choice, ranging from ``48U`` to ``127U``. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 KRKNWK-11826: Zigbee Router does not accept new child devices if the maximum number of children is reached Once the maximum number of children devices on a Zigbee Router is reached and one of them leaves the network, the Zigbee Router does not update the flags inside beacon frames to indicate that it cannot accept new devices. @@ -963,7 +1017,7 @@ KRKNWK-12522: Incorrect Read Attributes Response on reading multiple attributes When reading multiple attributes at once and the first one is not supported, the Read Attributes Response contains two records for the first supported attribute. The first one record has the Status field filled with Unsupported Attribute whereas the second record contains actual data. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 KRKNWK-12017: Zigbee End Device does not recover from broken rejoin procedure If the Device Announcement packet is not acknowledged by the End Device's parent, joiner logic is stopped and the device does not recover. @@ -1062,7 +1116,7 @@ KRKNWK-11602: Zigbee device becomes not operable after receiving malformed packe Given these two options, we recommend to upgrade your |NCS| version to the latest available one. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 KRKNWK-7723: OTA upgrade process restarting after client reset After the reset of OTA Upgrade Client, the client will start the OTA upgrade process from the beginning instead of continuing the previous process. @@ -1351,7 +1405,7 @@ Serial LTE Modem The issues in this section are related to the :ref:`serial_lte_modem` application. -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 NCSDK-20457: Modem traces captured through UART are corrupted if RTT logs are simultaneously captured When capturing modem traces through UART with `Cellular Monitor`_ app and simultaneously capturing RTT logs, for example, with J-Link RTT Viewer, the modem trace misses packets, and captured packets might have incorrect information. @@ -1371,7 +1425,7 @@ NCSDK-20457: Modem traces captured through UART are corrupted if RTT logs are si This increases the overall power consumption even when Serial LTE Modem is in sleep mode. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 NCSDK-24135: Serial LTE Modem (SLM) attempts to use UART hardware flow control even though Connectivity bridge does not support it With Thingy:91, Connectivity bridge in the nRF52840 SoC terminates the USB traffic and sends the traffic through UART to SLM in the nRF9160 SiP. @@ -1440,7 +1494,7 @@ NCSDK-23704: Too small heap size on nRF5340 DK **Workaround:** Manually cherry-pick and apply commit with fix from ``main`` (commit hash: ``be97ae3074c38b7987d5183b1c09995cf19d61e8``). -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 NCSDK-25928: :ref:`nrf_desktop_hid_state` keeps sending empty HID reports to lower priority subscriber after higher priority subscriber connects After a higher priority subscriber connects, the :ref:`nrf_desktop_hid_state` sends empty HID reports to a lower priority subscriber to report release of all pressed buttons. @@ -1449,7 +1503,7 @@ NCSDK-25928: :ref:`nrf_desktop_hid_state` keeps sending empty HID reports to low **Workaround:** Manually cherry-pick and apply the commit with the fix from the ``main`` branch (commit hash: ``a87407fc29514b68a7bdaea5554f7b755466a77b``). -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 NCSDK-8304: HID configurator issues for peripherals connected over Bluetooth LE to Linux host Using :ref:`nrf_desktop_config_channel_script` for peripherals connected to host directly over Bluetooth LE might result in receiving improper HID feature report ID. @@ -1594,14 +1648,14 @@ nRF5340 Audio The issues in this section are related to the :ref:`nrf53_audio_app` application. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 OCT-2070: Detection issues with USB-C to USB-C connection Using USB-C to USB-C when connecting an nRF5340 Audio DK to PC is not correctly detected on some Windows systems. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 OCT-2154: USB audio interface does not work correctly on macOS The audio stream is intermittent on the headset side after connecting the gateway to a Mac computer and starting the audio stream. @@ -1609,14 +1663,14 @@ OCT-2154: USB audio interface does not work correctly on macOS **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 OCT-2172: The headset volume is not stored persistently This means the volume will fall back to default level after a reset. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 OCT-2325: Difficult to remove a failed DFU image If a problematic DFU image is deployed, causing the image-swap at boot to fail, the device may appear bricked with no obvious way of recovery. @@ -1630,7 +1684,7 @@ OCT-2347: Stream reestablishment issues in CIS **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 OCT-2401: The HW codec has a variable (0-20 uS) audio interface (I2S) lock variability This will cause a static offset of the stream, which will cause an undesired extra L-R sync difference. @@ -1652,7 +1706,7 @@ OCT-2472: Headset fault upon gateway reset in the bidirectional stream mode **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 OCT-2501: Charging over seven hours results in error Since the nRF5340 Audio DK uses a large battery, the nPM1100 can go into error when charging time surpasses 7 hours. @@ -1663,14 +1717,14 @@ OCT-2501: Charging over seven hours results in error **Workaround:** To start the charging again, turn the nRF5340 Audio DK off and then on again. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCT-2539: Presentation delay may not work as expected under some configurations The data is not presented at the correct time. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCT-2551: GPIO pin forwarding to the network core is not done for the **RGB2** LED pins This means that the **RGB2** LED does not reflect the controller status. @@ -1684,7 +1738,7 @@ OCT-2558: Endpoint in BIS headset not set correctly **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCT-2569: BIS headset stuck if toggling gateway power quickly BIS headset may enter an unwanted state if gateway power is toggled quickly or if headset is moved out of radio range. @@ -1693,7 +1747,7 @@ OCT-2569: BIS headset stuck if toggling gateway power quickly **Workaround:** Reset BIS headset -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCT-2585: Initial L-R sync may lock with an offset The left and right headset may lock as intended, but there will be a small static time offset between the two headsets. @@ -1711,14 +1765,14 @@ OCT-2587: A CIS gateway will try to connect to a BIS gateway **Workaround:** Use different :kconfig:option:`CONFIG_BT_DEVICE_NAME` for BIS and CIS. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2712: Gateway cannot properly handle a connected headset if it continues to advertise The gateway will try to connect to a headset that is already connected. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2713: Gateway can only read one PAC record from each headset Some headsets might have several PAC records containing different supported configurations. @@ -1726,42 +1780,42 @@ OCT-2713: Gateway can only read one PAC record from each headset **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2715: There can be a state mismatch between streaming and media control in certain scenarios For example, if a stream is in the playing state but media control is in the pause state, it might not be possible to play or pause. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCT-2725: Data can be overwritten when publishing configurations too fast on :ref:`zephyr:zbus` When, for example, setting up a bidirectional stream, the configurations for sink and source might be received too fast, resulting in one of the configurations being lost. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2765: BIS headset stack overflow if gateway is periodically reset A BIS headset might get stack overflow if the BIS source is reset several times with short intervals. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2766: BIS headset might get into an infinite loop If a BIS headset is paused, the BIS broadcaster is reset, and if the headset is unpaused, it will end up in an infinite loop. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCT-2767: Potential infinite loop for the re-established BIS stream If the stream is lost and re-established on a broadcast sink, an infinite loop might be triggered. **Affected platforms:** nRF5340 Audio DK -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 OCT-2897: Interleaved packing issue Using interleaved packing on the controller may cause the left headset to disconnect. @@ -1785,17 +1839,17 @@ OCX-152: OCX-146: 40 ms ACL interval may cause TWS to be unstable **Workaround:** Use an alternative ACL connection interval. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCX-153: Cannot create BIG sync after terminate pending BIG sync If a pending BIG sync is canceled by sending the LE Broadcast Isochronous Group Sync Established command, it is impossible for the host to create a new BIG sync afterwards. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 OCX-155: Larger timestamps than intended The timestamps/Service Data Unit references (SDU refs), may occasionally be larger than intended and then duplicated in the next interval. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 OCX-156: PTO is not supported The controller does not support Pre-Transmission Offset. @@ -1813,13 +1867,13 @@ OCX-157: OCX-140: Interleaved broadcasts streaming issues OCX-168: Issues with reestablishing streams Syncing of broadcast receivers takes longer than in version 3310, especially for high retransmit (RTN) values. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCX-178: Transport latency does not affect flush timeout Setting transport latency higher than 10 ms and higher retransmission time setting do not have an effect on the flush timeout setting. The flush timeout is always 1. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCX-183: Feature request control procedure initiated when controller is in progress of creating CIS and CIS is not yet established The controller might send a feature request to the remote device during CIS creating procedure even if the CIS has not been established. @@ -1832,7 +1886,7 @@ OCX-184: If 0 dBm TX power is selected, the FEM/PA TX/RX pins do not toggle corr **Workaround:** Set max TX power larger than 0 dBm. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 OCX-188/OCX-227: The controller reserves some pins (0.28 - 0.31), which may collide with FEM/PA features FEM feature cannot work properly on GPIO pins from **P0.28** to **P0.31**. @@ -1845,28 +1899,28 @@ OCX-189: When inputting -40 dBm to HCI_OPCODE_VS_SET_CONN_TX_PWR (0x3F6), the ac The TX power for a connection cannot be less than -20 dBm. Controller still output -20 dBm if the setting is -40 dBm. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCX-208: There is a chance that the scan report only shows legacy-ADV without ADV-EXT This might happen if a broadcast sink is moved in and out of radio range from the broadcast source or if the broadcast source is being rapidly reset. It will cause a broadcast sink to not be able to finish PA sync. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCX-217: The controller can get unresponsive when a broadcast sink tries to sync to some broadcast sources This is only an issue if a broadcast sink tries to sync to certain broadcast sources made by other vendors. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCX-218: The BIG info is not sent from the controller when a broadcast sink tries to sync to some broadcast sources This is only an issue if a broadcast sink tries to sync to certain broadcast sources made by other vendors. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 OCX-223: The controller asserts on the CIS gateway if two paused headsets reset If a CIS headset pair is reset simultaneously a few times while remaining paused, the controller on the gateway might get unresponsive. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 OCX-238: The controller rejects CIS Requests with the same ``CIG_ID`` as a currently configured CIG This will affect the use of the controller in use cases in which it acts as both CIS Central and CIS Peripheral. @@ -1925,7 +1979,7 @@ NCSDK-18263: |NCS| samples may fail to boot on Thingy:53 Bluetooth samples ================= -.. rst-class: v2-6-0 +.. rst-class: v2-6-1 v2-6-0 NCSDK-26424: Directed advertising in the :ref:`peripheral_hids_mouse` sample does not start after disconnecting from a bonded peer When the sample disconnects from a peer, after successful pairing and subscription to reports, it cannot re-connect because directed advertising does not start. @@ -1946,7 +2000,7 @@ NCSDK-18112: :ref:`bluetooth_central_dfu_smp` sample cannot do discovery on the **Workaround:** Enable the legacy LLCP mechanism (:kconfig:option:`CONFIG_BT_LL_SW_LLCP_LEGACY`). -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 v0-4-0 v0-3-0 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 v0-4-0 v0-3-0 NCSDK-19942: HID samples do not work with Android 13 Bluetooth samples and applications that are set up for the HIDS use case and have the Bluetooth Privacy feature enabled (:kconfig:option:`CONFIG_BT_PRIVACY`) disconnect after a short period or enter a connection-disconnection loop when you try to connect to them from a device that is running Android 13. @@ -2127,14 +2181,14 @@ Antenna switching does not work on targets ``nrf5340dk_nrf5340_cpuapp`` and ``nr Bluetooth Mesh samples ====================== -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 NCSDK-26388: Compilation of Mesh Light sample can create an image without MCUboot This can happen when compiled with the point-to-point DFU overlay and ``--sysbuild`` option. **Workaround:** To get a correct image with MCUboot, do not use the ``--sysbuild`` option. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 NCSDK-26403: Point-to-point DFU procedure :guilabel:`Test and Confirm` with erasing application area does not succeed in the Device Manager app on IOs for the Mesh Light sample After uploading the image and resetting the device, the mobile application cannot receive a confirmation back and the whole procedure fails. @@ -2154,24 +2208,24 @@ NCSDK-21590: :ref:`bluetooth_mesh_sensor_client` sample does not compile for nRF Cellular samples ================ -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 IRIS-8456: Wi-Fi builds of the :ref:`nrf_cloud_multi_service` sample crash and reboot This happens if no Wi-Fi APs are visible for more than a few minutes. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 IRIS-8465: CoAP builds of the :ref:`nrf_cloud_multi_service` sample stall if connectivity is lost If PDN detaches for too long while the sample is connected, the sample cannot reconnect to nRF Cloud after PDN returns. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 IRIS-7398: The :ref:`nrf_cloud_multi_service` sample does not support using the MCUboot secondary partition in external flash fails on the nRF9161 DK The sample can be built for the nRF9161 DK with the :file:`overlay_mcuboot_ext_flash.conf` overlay enabled, but the resultant application will not boot. **Affected platforms:** nRF9161 -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 IRIS-7381: :ref:`nrf_cloud_rest_cell_pos_sample` sample might attempt to take a neighbor cell measurement when a measurement is already in progress If cell information changes during a neighbor cell measurement, the sample will attempt to start a new measurement, resulting in warning and error log messages. @@ -2218,7 +2272,7 @@ NCSDK-11033: Dial-up usage not working Matter samples ============== The issues in this section are related to :ref:`matter_samples`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 KRKNWK-18242: Thermostat sample does support the AUTO system mode AUTO system mode is supported in a thermostat device but it is not reflected in the data model and the feature map indicates that AUTO system mode is not supported. @@ -2493,7 +2547,7 @@ NCSIDB-925: Event subscribers in the :ref:`app_event_manager` may overlap when u Modem libraries =============== -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 CIA-857: LTE Link Controller spurious events When using the :ref:`lte_lc_readme` library, a memory comparison is done between padded structs that may result in comparing bytes that have undefined initialization values. @@ -2512,14 +2566,14 @@ NCSDK-15512: Modem traces retrieval incompatible with TF-M Libraries for networking ======================== -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 NCSDK-26534: When :ref:`lib_lwm2m_client_utils` is used for downloading FOTA updates, ongoing updates cannot be cancelled by writing an empty URI This happens when downloading FOTA updates using LwM2M. **Workaround:** Apply the fix from `sdk-nrf PR #14474 `_. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 CIA-351: Connectivity issues with :ref:`lib_azure_iot_hub` If a ``device-bound`` message is sent to the device while it is in the LTE Power Saving Mode (PSM), the TCP connection will most likely be terminated by the server. @@ -2542,7 +2596,7 @@ NCSDK-23315: The :ref:`bt_le_adv_prov_readme` has an incorrect range and default **Workaround:** Manually cherry-pick and apply the commit with the fix from the ``main`` branch (commit hash: ``a8b668e82837295962348e9e681125c2ae11bb4e``). -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 NCSDK-23682: The Fast Pair Seeker might be unable to bond again after losing the bonding information multiple times If the :kconfig:option:`CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` Kconfig option is disabled on the Fast Pair Provider side, the Fast Pair Seeker that uses the RPA address to connect with the Provider might be unable to bond again after losing the bonding information multiple times. @@ -2584,7 +2638,7 @@ The time returned by :ref:`lib_date_time` library becomes incorrect after one we The time returned by :ref:`lib_date_time` library becomes incorrect after one week elapses. This is due to an issue with clock_gettime() API. - **Affected platforms:** nRF9160 + **Affected platforms:** nRF9160, nRF52840 Subsystems ********** @@ -2596,7 +2650,7 @@ Build system The issues in this section are related to :ref:`app_build_system`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 NCSDK-20567: When building an application for MCUboot, the build system does not check whether the compiled application is too big for being an update image In this case the update cannot be applied, because the swap algorithm requires some free space in the secondary slot (even if the image fits inside the slot). @@ -2727,7 +2781,7 @@ Bootloader The issues in this section are related to :ref:`app_bootloaders`. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 NCSDK-24203: If fault injection hardening (FIH) is enabled, a bug is observed in the :c:func:`boot_image_check_hook` function Due to this, multicore applications cannot be booted for nRF5340 MCUboot builds with simultaneous multimage update enabled. @@ -2746,7 +2800,7 @@ NCSDK-23761: MCUboot fails to boot when both the :kconfig:option:`CONFIG_MCUBOOT **Workaround:** To fix the issue, disable either the :kconfig:option:`CONFIG_MCUBOOT_HW_DOWNGRADE_PREVENTION` or :kconfig:option:`CONFIG_BOOT_FIH_PROFILE_LOW` Kconfig option in MCUboot. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 SHEL-1352: Incorrect base address used in the OTP TX trim coefficients Incorrect base address used for TX trim coefficients in the One-Time Programmable (OTP) memory results in transmit power deviating by +/- 2 dB from the target value. @@ -2801,7 +2855,7 @@ The combination of nRF Secure Immutable Bootloader and MCUboot fails to upgrade .. rst-class:: v1-4-2 v1-4-1 v1-4-0 NRF91-989: Unable to bootstrap after changing SIMs - In some cases, swapping the SIM card might trigger the bootstrap Pre-Shared Key to be deleted from the device. + In some cases, swapping the SIM card might trigger the bootstrap pre-shared key (PSK) to be deleted from the device. This can prevent future bootstraps from succeeding. **Affected platforms:** nRF9160 @@ -2811,7 +2865,7 @@ DFU and FOTA The issues in this section are related to :ref:`app_dfu`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 NCSDK-21790: Errors during DFU when using nRF Connect for mobile app MCUmgr is incorrectly reporting an error when DFU is performed using the nRF Connect for mobile app. @@ -2819,7 +2873,7 @@ NCSDK-21790: Errors during DFU when using nRF Connect for mobile app **Affected platforms:** nRF5340 -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 NCSDK-21379: Single slot network core updates on nRF5340 does not work properly Currently, a bug in the MCUboot code causes network core updates to not be applied when using the nRF5340 in a single slot configuration. @@ -2856,7 +2910,7 @@ NCSDK-18422: Serial recovery fails to write to slots in QSPI NCSDK-18108: ``s1`` variant image configuration mismatch If an image with an ``s1`` variant is configured and the ``s0`` image configuration is changed using menuconfig, these changes will not be reflected in the ``s1`` configuration, which can lead to a differing build configuration or the build does not upgrade. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 NCSDK-11308: Powering off device immediately after serial recovery of the nRF53 network core firmware results in broken firmware The network core will not be able to boot if the device is powered off too soon after completing a serial recovery update procedure of the network core firmware. @@ -2893,7 +2947,7 @@ Jobs not received after reset **Workaround:** Delete the stalled in progress job from AWS IoT. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 NCSDK-24305: fota_download library sends FOTA_DOWNLOAD_EVT_FINISHED when unable to connect The :ref:`lib_download_client` library does not resume a download if the device cannot connect to a target server. @@ -2973,7 +3027,7 @@ MCUboot The issues in this section are related to :ref:`MCUboot `. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 NCSIDB-1194: MCUboot not properly disabling UARTE instances Increased power consumption may be observed (400 µA). @@ -3003,7 +3057,7 @@ Crypto The issues in this section are related to :ref:`nrfxlib:crypto`. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 NSCDK-26412: Updating to TF-M 2.0 using Mbed TLS 3.5.2 introduced a regression in resolving legacy crypto configurations from ``PSA_WANT_ALG_XXXX`` configurations Wi-Fi samples enabling OpenThread are affected by this bug as well as possible use cases with a dependency on some legacy features while using PSA crypto APIs. @@ -3027,7 +3081,7 @@ NCSDK-22091: Selecting both :kconfig:option:`NORDIC_SECURITY_BACKEND` and :kconf **Workaround:** Manually define ``PSA_CORE_BUILTIN`` in the file :file:`nrf_security/configs/legacy_crypto_config.h.template`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 NCSDK-22593: Selecting :kconfig:option:`CONFIG_PSA_WANT_ALG_CCM` without :kconfig:option:`CONFIG_MBEDTLS_AES_C` causes a build failure Selecting :kconfig:option:`CONFIG_PSA_WANT_ALG_CCM` without :kconfig:option:`CONFIG_MBEDTLS_AES_C` results in a build failure due to unsatisfied dependencies in :file:`check_config.h`. @@ -3190,7 +3244,7 @@ Modem library The issues in this section are related to :ref:`nrfxlib:nrf_modem`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 NCSDK-10106: Elevated current consumption when using applications without :ref:`nrfxlib:nrf_modem` on nRF9160 When running applications that do not enable :ref:`nrfxlib:nrf_modem` on nRF9160 with build code B1A, current consumption will stay at 3 mA when in sleep. @@ -3237,25 +3291,25 @@ Multiprotocol Service Layer (MPSL) The issues in this section are related to :ref:`nrfxlib:mpsl`. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 DRGN-18247: Assertion with :c:enumerator:`MPSL_CLOCK_HF_LATENCY_BEST` When setting the ramp-up time of the high-frequency crystal oscillator with :c:enumerator:`MPSL_CLOCK_HF_LATENCY_BEST`, an assert in MPSL occurs. **Workaround:** Use :c:enumerator:`MPSL_CLOCK_HF_LATENCY_TYPICAL` instead of :c:enumerator:`MPSL_CLOCK_HF_LATENCY_BEST` when setting the time it takes for the HFCLK to ramp up. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 DRGN-15979: :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION` must be set when :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC` is set MPSL requires RC clock calibration to be enabled when the RC clock is used as the Low Frequency clock source. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 DRGN-14153: Radio Notification power performance penalty The Radio Notification feature has a power performance penalty proportional to the notification distance. This means an additional average current consumption of about 600 µA for the duration of the radio notification. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 KRKNWK-8842: MPSL does not support nRF21540 revision 1 or older The nRF21540 revision 1 or older is not supported by MPSL. @@ -3336,12 +3390,12 @@ DRGN-11059: Front-end module API not implemented for SoftDevice Controller The issues in this section are related to :ref:`nrfxlib:nrf_802154`. In addition to the known issues listed here, see also :ref:`802.15.4 Radio driver limitations ` for permanent limitations. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 KRKNWK-18589: Timestamps for delayed operations triggering very shortly after a sleep request may be very inaccurate It was observed that the nRF 802.15.4 Radio Driver reported a too big timestamp by approximately ``UINT32_MAX``. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 v1-3-2 v1-3-1 v1-3-0 v1-2-1 v1-2-0 v1-1-0 v1-0-0 KRKNWK-18545: The device may enter a livelock state if AES encryption is done in a thread This can happen when the nRF 802.15.4 Radio Driver's multiprotocol feature is used together with Bluetooth LE (SoftDevice Controller). @@ -3407,12 +3461,20 @@ SoftDevice Controller The issues in this section are related to :ref:`nrfxlib:softdevice_controller`. In addition to the known issues listed here, see also :ref:`softdevice_controller_limitations` for permanent limitations. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 + +DRGN-21619: The controller might assert if the CIS peripheral stops receiving packets from the CIS central + This only occurs when the window widening reaches at least half of the ISO interval in magnitude. + Assuming worst case clock accuracies on both the central and the peripheral, this could occur with a supervision timeout of 2.4, 3.7, or 4.9 seconds, corresponding to an ISO interval of 5, 7.5, or 10 milliseconds, respectively. + + **Workaround:** Set the supervision timeout to a value lower than those mentioned above. + +.. rst-class:: v2-6-1 v2-6-0 DRGN-21605: Value read by HCI ISO Read TX Timestamp is off by 40 µs The HCI command ``Iso Read Tx Tmestamp`` returns the last assigned sync reference for the ISO TX path and the value might be off by 40 µs. -.. rst-class:: v2-6-0 +.. rst-class:: v2-6-1 v2-6-0 DRGN-21293: The LE Read ISO TX Sync command is implemented according to the raised errata ES-23138 In ES-23138, the return parameter ``TX_Time_Stamp`` is used as the SDU synchronization reference of the SDU previously scheduled for transmission. @@ -3420,34 +3482,34 @@ DRGN-21293: The LE Read ISO TX Sync command is implemented according to the rais When the CIG or BIG is configured with an ``ISO_Interval`` that equals the ``SDU_Interval``, there is no difference between the CIG or BIG reference anchor point and the SDU synchronization reference. If several SDUs are transmitted during each ``ISO_Interval``, meaning that it is larger than the ``SDU_Interval``, our implementation of the LE Read ISO TX Sync command returns a unique SDU synchronization reference for each SDU. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 DRGN-20444: The HCI LE Create Connection command and the HCI LE Extended Create Connection command overwrite scan parameters This happens when the HCI LE Create Connection command or the HCI LE Extended Create Connection command is called after the scan parameters are set. **Workaround:** Set the scan parameters with the HCI LE Set Scan Parameters command or the HCI LE Set Extended Scan Parameters command again. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 DRGN-20762: LE Set Periodic Advertising Subevent Data could fail unexpectedly if interrupted The LE Set Periodic Advertising Subevent Data command could fail when providing data at the same time as an ``AUX_SYNC_SUBEVENT_IND`` was sent. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 DRGN-20815: A packet might not be received when sent at the instant of a Channel Map Update This could happen when the controller is acting as slave, while the master is sending a Channel Map Update. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 DRGN-20432: LE Set Periodic Advertising Response Data command can assert if host behaves incorrectly This could happen if the LE Set Periodic Advertising Response Data command was issued more than once without fetching the Command Complete Event. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 DRGN-20832: The controller would assert during cooperative active scanning or when running a cooperative initiator This could happen when the controller was about to send a scan request or connect indication. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 v1-4-2 v1-4-1 v1-4-0 DRGN-20862: The nRF5340 DK consumed too much current while scanning This could happen if the controller was running with TX power higher than 0 dB. @@ -3467,7 +3529,7 @@ DRGN-21253: Rare assert on the scanner DRGN-21020: The continuous extended scanner sometimes stops generating advertising reports This can happen when the controller is running an extended cooperative scanner together with other activities, such as advertising or connection, while receiving data in an extended advertising event that uses ``AUX_CHAIN_IND``. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 DRGN-20956: Rare assert when terminating the Periodic Sync with Responses. In rare cases, when a Periodic Sync with Responses is being is being terminated while it is waiting for a sync to a Periodic Advertiser with Responses, the controller can assert. @@ -3520,7 +3582,7 @@ DRGN-17562: One of the LE Transmit Power Reporting Events might not be reported When multiple LE Transmit Power Reporting Events are generated at the same time for the same PHY, one of these events will be missed. This will occur only when there are simultaneous remote and local power level changes on the same PHY. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 v2-4-3 v2-4-2 v2-4-1 v2-4-0 v2-3-0 v2-2-0 DRGN-19039: Multirole advertiser not seen by peer in some cases This can happen when the controller attempts to reschedule the advertising events due to scheduling conflicts with the scanner or initiator and both of the following apply: @@ -3623,7 +3685,7 @@ DRGN-18655: Wrongly set the address if calling :c:func:`bt_ctlr_set_public_addr` DRGN-18568: Using :kconfig:option:`CONFIG_MPSL_FEM` Kconfig option lowers the value of radio output power The actual value is lower than the default one in case the :kconfig:option:`CONFIG_BT_CTLR_TX_PWR_ANTENNA` or :kconfig:option:`CONFIG_BT_CTLR_TX_PWR` Kconfig options are used together with the :kconfig:option:`CONFIG_MPSL_FEM` Kconfig option. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 DRGN-16013: Initiating connections over extended advertising is not supported when external radio coexistence and FEM support are enabled The initiator can assert when initiating a connection to an extended advertiser when both external radio coexistence and FEM are enabled. @@ -4123,7 +4185,7 @@ Trusted Firmware-M (TF-M) The issues in this section are related to the TF-M implementation in the |NCS|. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 CIA-1182: TF-M flash partition overflow When building for Thingy:91 and enabling debug optimizations (or enabling Debug build in the VS code extension), the TF-M flash partition will overflow. @@ -4183,7 +4245,7 @@ NRFJPROG-454: TF-M might fail to reset when using nrfjprog version 10.22.x on nR nrfjprog -f nrf91 --debugreset -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 NCSDK-18321: TF-M PSA architecture tests do not build with CMake v3.25.x The :ref:`tfm_psa_test` fails to build with CMake version 3.25.x with missing header files. @@ -4286,12 +4348,12 @@ NCSDK-12483: Missing debug symbols **Workaround:** Add the text ``zephyr_link_libraries(-Wl,--undefined=my_missing_debug_symbol)`` in the application's :file:`CMakeLists.txt` file. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 NCSDK-12342: Potential SecureFault exception while accessing protected storage When accessing protected storage, a SecureFault exception is sometimes triggered and execution halts. -.. rst-class:: v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 +.. rst-class:: v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 NCSDK-11195: Build errors when enabling :kconfig:option:`CONFIG_BUILD_WITH_TFM` option Enabling the :kconfig:option:`CONFIG_BUILD_WITH_TFM` Kconfig option in SES project configuration or using ``west -t menuconfig`` results in build errors. @@ -4363,7 +4425,7 @@ NCSDK-20104: MCUboot configuration can prevent application from being able to ru **Workaround:** Enable :kconfig:option:`CONFIG_MCUBOOT_CLEANUP_ARM_CORE`` in MCUboot configuration. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 LwM2M engine blocks all composite operations Due to a bug in LwM2M engine, all composite operations get a return code of ``4.01 - Unauthorized``. @@ -4371,7 +4433,7 @@ LwM2M engine blocks all composite operations **Workaround:** To fix the error, cherry-pick commits from the upstream `Zephyr PR #64016 `_. -.. rst-class:: v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 +.. rst-class:: v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 v1-5-2 v1-5-1 v1-5-0 LwM2M object's resource instance buffers may overlap If the LwM2M object statically allocates storage for more than one resource instance of the string type, these buffers will overlap. @@ -4501,7 +4563,7 @@ KRKNWK-16503: OTA DFU using the iOS Home app (over UARP) does not work on the nR **Workaround:** Manually cherry-pick and apply commit from the main branch (commit hash: ``09874a36edf21ced7d3c9356de07df6f0ff3d457``). -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 KRKNWK-13010: Dropping from Thread to Bluetooth LE takes too long Dropping from Thread to Bluetooth LE, after a Thread Border Router is powered off, takes much longer for FTD accessories than estimated in TCT030 test case. @@ -4538,14 +4600,14 @@ NCSDK-13947: Net core downgrade prevention does not work on nRF5340 KRKNWK-13607: Stateless switch application crashes upon factory reset When running Thread test suit on the stateless switch application, the CI crashes upon factory reset. -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 KRKNWK-13249: Unexpected assertion in HAP Bluetooth Peripheral Manager When Bluetooth LE layer emits callback with a connect or disconnect event, one of its parameters is an underlying Bluetooth LE connection object. On rare occasions, this connection object is no longer valid by the time it is processed in HomeKit, and this results in assertion. There is no proven workaround yet. -.. rst-class:: wontfix v2-6-0 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 +.. rst-class:: wontfix v2-6-1 v2-6-0 v2-5-3 v2-5-2 v2-5-1 v2-5-0 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 v1-8-0 v1-7-1 v1-7-0 v1-6-1 v1-6-0 KRKNWK-11729: Stateless switch event characteristic value not handled according to specification in Bluetooth LE mode The stateless programmable switch application does not handle the value of the stateless switch event characteristic in the Bluetooth LE mode according to the specification. diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.rst index a70e4ccbabe4..d58b1e5db81a 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_1.x_to_2.x.rst @@ -1,5 +1,3 @@ -:orphan: - .. _ncs_2.0.0_migration: Migration notes for |NCS| v2.0.0 diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_2.5.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_2.5.rst index c2606503e56f..c39e317410a0 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_2.5.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_2.5.rst @@ -1,5 +1,3 @@ -:orphan: - .. _migration_2.5: Migration guide for |NCS| v2.5.0 diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_2.6.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_2.6.rst index 60cf7d9d2625..b3303ae12371 100644 --- a/doc/nrf/releases_and_maturity/migration/migration_guide_2.6.rst +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_2.6.rst @@ -1,5 +1,3 @@ -:orphan: - .. _migration_2.6: Migration guide for |NCS| v2.6.0 @@ -799,10 +797,10 @@ nRF5340 Audio applications .. toggle:: - * The :ref:`nrf53_audio_app` have changed the default controller from the :ref:`lib_bt_ll_acs_nrf53_readme` to Nordic Semiconductor's standard :ref:`ug_ble_controller_softdevice` (:ref:`softdevice_controller_iso`). + * The :ref:`nrf53_audio_app` have changed the default controller from the LE Audio controller for nRF5340 library to Nordic Semiconductor's standard :ref:`ug_ble_controller_softdevice` (:ref:`softdevice_controller_iso`). :ref:`ug_ble_controller_softdevice` is included and built automatically. - For |NCS| 2.6.0, tests have been run and issues documented as before for the previously used :ref:`lib_bt_ll_acs_nrf53_readme`. - However, :ref:`lib_bt_ll_acs_nrf53_readme` is marked as deprecated, it will be removed soon, and there will be no new features or fixes to this controller. + For |NCS| 2.6.0, tests have been run and issues documented as before for the previously used LE Audio controller for nRF5340 library. + However, the LE Audio controller for nRF5340 library is marked as deprecated, it will be removed soon, and there will be no new features or fixes to this controller. Make sure to remove references to LE Audio controller for nRF5340 from your application and transition to the new controller. There should be no negative impact on performance of the nRF5340 Audio applications with the :ref:`ug_ble_controller_softdevice`. This change enables the use of standard |NCS| tools and procedures for building, configuring and DFU. diff --git a/doc/nrf/releases_and_maturity/migration/migration_guide_2.7.rst b/doc/nrf/releases_and_maturity/migration/migration_guide_2.7.rst new file mode 100644 index 000000000000..51806e7c7183 --- /dev/null +++ b/doc/nrf/releases_and_maturity/migration/migration_guide_2.7.rst @@ -0,0 +1,115 @@ +.. _migration_2.7: + +Migration guide for |NCS| v2.7.0 (Working draft) +################################################ + +.. contents:: + :local: + :depth: 3 + +This document describes the changes required or recommended when migrating your application from |NCS| v2.6.0 to |NCS| v2.7.0. + +.. HOWTO + + Add changes in the following format: + + Component (for example, application, sample or libraries) + ********************************************************* + + .. toggle:: + + * Change1 and description + * Change2 and description + +.. _migration_2.7_required: + +Required changes +**************** + +The following changes are mandatory to make your application work in the same way as in previous releases. + +Samples and applications +======================== + +This section describes the changes related to samples and applications. + +* For applications using the :ref:`lib_mqtt_helper` library: + + * The ``CONFIG_MQTT_HELPER_CERTIFICATES_FILE`` is now replaced by :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER`. + The new option is a folder path where the certificates are stored. + The folder path must be relative to the root of the project. + + If you are using the :ref:`lib_mqtt_helper` library, you must update the Kconfig option to use the new option. + + * When using the :kconfig:option:`CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES` Kconfig option, the certificate files must be in standard PEM format. + This means that the PEM files must not be converted to string format anymore. + +Serial LTE Modem (SLM) +---------------------- + +.. toggle:: + + * The AT command parsing has been updated to utilize the :ref:`at_cmd_custom_readme` library. + If you have introduced custom AT commands to the SLM, you need to update the command parsing to use the new library. + See the :ref:`slm_extending` page for more information. + +Peripheral samples +------------------ + +* :ref:`radio_test` sample: + + * The CLI command ``fem tx_power_control `` replaces ``fem tx_gain `` . + This change applies to the sample built with the :ref:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC ` set to ``n``. + +Libraries +========= + +This section describes the changes related to libraries. + +FEM abstraction layer +--------------------- + +.. toggle:: + + * For applications using :ref:`fem_al_lib`: + The function :c:func:`fem_tx_power_control_set` replaces the function :c:func:`fem_tx_gain_set`. + The function :c:func:`fem_default_tx_output_power_get` replaces the function :c:func:`fem_default_tx_gain_get`. + +.. _migration_2.7_recommended: + +Recommended changes +******************* + +The following changes are recommended for your application to work optimally after the migration. + +Samples and applications +======================== + +* For applications using build types (without child images): + + * The :makevar:`CONF_FILE` used for :ref:`app_build_additions_build_types` is now deprecated and is being replaced with the :makevar:`FILE_SUFFIX` variable, inherited from Zephyr. + You can read more about it in :ref:`app_build_file_suffixes`, :ref:`cmake_options`, and the :ref:`related Zephyr documentation `. + + If your application uses build types, it is recommended to update the :file:`sample.yaml` to use the new variable instead of :makevar:`CONF_FILE`. + + .. note:: + The :ref:`child image Kconfig configuration ` are not yet compatible with :makevar:`FILE_SUFFIX`. + Read more about this in the note in :ref:`app_build_file_suffixes`. + +Matter +------ + +.. toggle:: + + * For the Matter samples and applications: + + * All Partition Manager configuration files (:file:`pm_static` files) have been removed from the :file:`configuration` directory. + Instead, a :file:`pm_static_` file has been created for each target board and placed in the samples' directories. + Setting the ``PM_STATIC_YML_FILE`` argument in the :file:`CMakeLists.txt` file has been removed, as it is no longer needed. + +Libraries +========= + +This section describes the changes related to libraries. + +|no_changes_yet_note| diff --git a/doc/nrf/releases_and_maturity/migration_guides.rst b/doc/nrf/releases_and_maturity/migration_guides.rst index 16de9b679400..4db6483105e6 100644 --- a/doc/nrf/releases_and_maturity/migration_guides.rst +++ b/doc/nrf/releases_and_maturity/migration_guides.rst @@ -5,6 +5,10 @@ Migration guides The |NCS| provides migration guides for all major and minor releases, in order to assist user's transition from the previous release. -* `Migration guide for nRF Connect SDK v2.6.0`_ -* `Migration guide for nRF Connect SDK v2.5.0`_ -* `Migration guide for nRF Connect SDK v2.0.0`_ +.. toctree:: + :maxdepth: 1 + :glob: + :reversed: + :caption: Subpages: + + migration/* diff --git a/doc/nrf/releases_and_maturity/release_notes.rst b/doc/nrf/releases_and_maturity/release_notes.rst index c398388d6563..7e4dc6ae6162 100644 --- a/doc/nrf/releases_and_maturity/release_notes.rst +++ b/doc/nrf/releases_and_maturity/release_notes.rst @@ -10,8 +10,9 @@ This page is included only in the latest documentation, because it might contain .. note:: A "99" at the end of the version number of this documentation indicates continuous updates on the main branch since the previous major.minor release. - When looking at this latest documentation, be aware of the following aspect: + When looking at this latest documentation, be aware of the following aspects: + * Changes between releases are tracked on the :ref:`ncs_release_notes_changelog` page, but the main branch might contain additional changes that are not listed on that page. * The release note pages that are available in the latest documentation might differ slightly from the release notes that were included in the respective |NCS| release at its release date. Therefore, to see the official version of the release notes for a specific |NCS| release, switch to the documentation for the corresponding |NCS| version using the selector in the upper right-hand corner. @@ -19,7 +20,11 @@ This page is included only in the latest documentation, because it might contain :maxdepth: 1 :caption: Subpages: + releases/release-notes-changelog + releases/release-notes-2.6.99-cs1 + releases/release-notes-2.6.1 releases/release-notes-2.6.0 + releases/release-notes-2.5.3 releases/release-notes-2.5.2 releases/release-notes-2.5.1 releases/release-notes-2.5.0 diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst index 5584d29c2f36..24d0049c7094 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-1.5.0.rst @@ -869,7 +869,7 @@ The following list summarizes the most important changes inherited from upstream * Added :ref:`zephyr:nrf-ieee802154-rpmsg-sample`. * Added :zephyr:code-sample:`tagoio-http-post`. * Added Civetweb WebSocket Server sample. - * :zephyr:code-sample:`led-ws2812`: Updated to force SPIM on nRF52 DK. + * :zephyr:code-sample:`led-strip`: Updated to force SPIM on nRF52 DK. * :zephyr:code-sample:`cfb-custom-fonts`: Added support for ssd1306fb. * :zephyr:code-sample:`gsm-modem`: Added suspend/resume shell commands. * :zephyr:code-sample:`updatehub-fota`: Added support for Bluetooth LE IPSP, 802.15.4, modem, and Wi-Fi. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst index 3d7f6e31579b..3c2123144a52 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst @@ -390,7 +390,7 @@ nRF5340 Audio For more information on the options, see all options prefixed with ``CONFIG_BLE_ACL_PER_ADV_INT_`` and ``CONFIG_BLE_ACL_EXT_ADV_INT_``. * Updated: - * LE Audio controller for the network core has been moved to the standalone :ref:`lib_bt_ll_acs_nrf53_readme` library. + * LE Audio controller for the network core has been moved to the standalone LE Audio controller for nRF5340 library. * :ref:`zephyr:zbus` is now implemented for handling events from buttons and LE Audio. * The supervision timeout has been reduced to reduce reconnection times for CIS. * The application documentation with a note about missing support for the |nRFVSC|. @@ -663,7 +663,7 @@ This section provides detailed lists of changes by :ref:`library `. Binary libraries ---------------- -* Added the standalone :ref:`lib_bt_ll_acs_nrf53_readme` library, originally a part of the :ref:`nrf53_audio_app` application. +* Added the standalone LE Audio controller for nRF5340 library, originally a part of the :ref:`nrf53_audio_app` application. * :ref:`liblwm2m_carrier_readme` library: * Updated to v3.2.0. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst index a20c8da11554..1fc0bd7f0ef1 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.0.rst @@ -414,7 +414,7 @@ nRF5340 Audio * Renderer - This module handles rendering, such as volume up and down. * Content Control - This module handles content control, such as play and pause. -* Added back the QDID number for the :ref:`lib_bt_ll_acs_nrf53_readme` to the documentation. +* Added back the QDID number for the LE Audio controller for nRF5340 to the documentation. * Updated the :ref:`application documentation ` by splitting it into several pages. nRF Machine Learning (Edge Impulse) @@ -838,7 +838,7 @@ Debug libraries Binary libraries ---------------- -* :ref:`lib_bt_ll_acs_nrf53_readme` library: +* LE Audio controller for nRF5340 library: * Added a limitation about the lack of support for the +20 dBm setting when :ref:`building the nRF5340 Audio application with the nRF21540 FEM support `. @@ -931,7 +931,7 @@ Modem libraries * Updated: - * The functions :c:func:`lte_lc_rai_req` and :c:func:`lte_lc_rai_param_set` and the Kconfig option :kconfig:option:`CONFIG_LTE_RAI_REQ_VALUE` are now deprecated. + * The functions ``lte_lc_rai_req`` and ``lte_lc_rai_param_set`` and the Kconfig option ``CONFIG_LTE_RAI_REQ_VALUE`` are now deprecated. The application uses the Kconfig option :kconfig:option:`CONFIG_LTE_RAI_REQ` and ``SO_RAI_*`` socket options instead. * The CE level enum names for :c:enum:`lte_lc_ce_level` to not include the number of repetitions. * The default network mode from :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M` to :kconfig:option:`CONFIG_LTE_NETWORK_MODE_LTE_M_GPS`. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst new file mode 100644 index 000000000000..b082219bcffd --- /dev/null +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.5.3.rst @@ -0,0 +1,140 @@ +.. _ncs_release_notes_253: + +|NCS| v2.5.3 Release Notes +########################## + +.. contents:: + :local: + :depth: 2 + +|NCS| delivers reference software and supporting libraries for developing low-power wireless applications with Nordic Semiconductor products in the nRF52, nRF53, nRF70, and nRF91 Series. +The SDK includes open source projects (TF-M, MCUboot, OpenThread, Matter, and the Zephyr RTOS), which are continuously integrated and redistributed with the SDK. + +Release notes might refer to "experimental" support for features, which indicates that the feature is incomplete in functionality or verification, and can be expected to change in future releases. +To learn more, see :ref:`software_maturity`. + +Highlights +********** + +This patch release adds changes on top of the :ref:`nRF Connect SDK v2.5.0 `, :ref:`nRF Connect SDK v2.5.1 `, and :ref:`nRF Connect SDK v2.5.2 `. +The changes affect Matter, Wi-Fi®, Bluetooth®, and Zephyr. + +See :ref:`ncs_release_notes_253_changelog` for the complete list of changes. + +Release tag +*********** + +The release tag for the |NCS| manifest repository (|ncs_repo|) is **v2.5.3**. +Check the :file:`west.yml` file for the corresponding tags in the project repositories. + +To use this release, check out the tag in the manifest repository and run ``west update``. +See :ref:`cloning_the_repositories` and :ref:`gs_updating_repos_examples` for more information. + +For information on the included repositories and revisions, see `Repositories and revisions for v2.5.3`_. + +IDE and tool support +******************** + +`nRF Connect for Visual Studio Code extension `_ is the recommended IDE for |NCS| v2.5.3. +See the :ref:`installation` section for more information about supported operating systems and toolchain. + +Supported modem firmware +************************ + +See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. + +Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. +See :ref:`nrf9160_gs_updating_fw_modem` for instructions. + +Modem-related libraries and versions +==================================== + +.. list-table:: Modem-related libraries and versions + :widths: 15 10 + :header-rows: 1 + + * - Library name + - Version information + * - Modem library + - `Changelog `_ + * - LwM2M carrier library + - `Changelog `_ + +Known issues +************ + +Known issues are only tracked for the latest official release. +See `known issues for nRF Connect SDK v2.5.3`_ for the list of issues valid for the latest release. + +.. _ncs_release_notes_253_changelog: + +Changelog +********* + +The following sections provide detailed lists of changes by component. + +Protocols +========= + +This section provides detailed lists of changes by :ref:`protocol `. + +Bluetooth +--------- + +Fixed an issue where the Bluetooth host running on the nRF5340 application core might deadlock on disconnection (DRGN-21390). + +Wi-Fi +----- + +* Added: + + * Build-time disconnection timeout configuration. + * The following fixes and improvements: + + * Wi-Fi stuck in an awake state. + * Frequent Wi-Fi disconnections in a congested environment and low RSSI. + * HTTPS upload and download performance issues. + * MQTT disconnection in a congested environment and low RSSI. + * Selecting the best RSSI access point. + * Rate adaptation enhancements to improve range in 2.4 GHz band. + + To accommodate all fixes and improvements, there is a one kB increase in the stack usage of the WPA supplicant and the user must increase the stack sizes appropriately in their applications. + +* Updated the WPA supplicant to reserve libc heap memory rather than using leftover RAM. + This does not affect the overall memory used, but now the RAM footprint as reported by the build will show higher usage. + +Matter +------ + +* Updated: + + * The default Message Reliability Protocol (MRP) retry intervals for Thread devices to two seconds to reduce the number of spurious retransmissions in Thread networks. + * Increased the number of available packet buffers in the Matter stack to avoid packet allocation issues. + +Samples +======= + +This section provides detailed lists of changes by :ref:`sample `. + +Matter samples +-------------- + +* :ref:`matter_lock_sample` sample: + + * Added support for emulation of the nRF7001 Wi-Fi companion IC on the nRF7002 DK. + + +Zephyr +====== + +The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``a768a05e6205e415564226543cee67559d15b736``. +It also contains some |NCS| specific additions and commits cherry-picked from the upstream Zephyr repository including the following one: + +* Fixed the GPIO configuration that is used in the ``pinctrl`` driver for the QSPI IO3 line. + Due to these incorrect settings, the QSPI NOR flash driver could not initialize successfully for a flash chip configured to work in non-Quad (2 I/O) mode. + +For a complete list of |NCS| specific commits and cherry-picked commits since v2.5.0, run the following command: + +.. code-block:: none + + git log --oneline manifest-rev ^v3.4.99-ncs1 diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst index 8d10787d1785..1e693e836a63 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.0.rst @@ -515,8 +515,8 @@ nRF5340 Audio applications * Updated: - * :ref:`lib_bt_ll_acs_nrf53_readme` from v3424 to v18929. - * The default controller has been changed from the :ref:`lib_bt_ll_acs_nrf53_readme` to the :ref:`ug_ble_controller_softdevice`. + * LE Audio controller for nRF5340 from v3424 to v18929. + * The default controller has been changed from the LE Audio controller for nRF5340 library to the :ref:`ug_ble_controller_softdevice`. See the :ref:`nRF5340 Audio applications ` section in the :ref:`migration_2.6` for information about how this affects your application. * Sending of the ISO data, which is now done in a single file :file:`bt_le_audio_tx`. * Application structure, which is now split into four separate, generic applications with separate :file:`main.c` files. diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst new file mode 100644 index 000000000000..5a7ae15db664 --- /dev/null +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.1.rst @@ -0,0 +1,156 @@ +.. _ncs_release_notes_261: + +|NCS| v2.6.1 Release Notes +########################## + +.. contents:: + :local: + :depth: 2 + +|NCS| delivers reference software and supporting libraries for developing low-power wireless applications with Nordic Semiconductor products in the nRF52, nRF53, nRF70, and nRF91 Series. +The SDK includes open source projects (TF-M, MCUboot, OpenThread, Matter, and the Zephyr RTOS), which are continuously integrated and redistributed with the SDK. + +Release notes might refer to "experimental" support for features, which indicates that the feature is incomplete in functionality or verification, and can be expected to change in future releases. +To learn more, see :ref:`software_maturity`. + +Highlights +********** + +This patch release adds changes on top of the :ref:`nRF Connect SDK v2.6.0 `. +The changes affect Matter, Wi-Fi®, Thread, and Zephyr. + +See :ref:`ncs_release_notes_261_changelog` for the complete list of changes. + +Release tag +*********** + +The release tag for the |NCS| manifest repository (|ncs_repo|) is **v2.6.1**. +Check the :file:`west.yml` file for the corresponding tags in the project repositories. + +To use this release, check out the tag in the manifest repository and run ``west update``. +See :ref:`cloning_the_repositories` and :ref:`gs_updating_repos_examples` for more information. + +For information on the included repositories and revisions, see `Repositories and revisions for v2.6.1`_. + +IDE and tool support +******************** + +`nRF Connect extension for Visual Studio Code `_ is the recommended IDE for |NCS| v2.6.1. +See the :ref:`installation` section for more information about supported operating systems and toolchain. + +Supported modem firmware +************************ + +See `Modem firmware compatibility matrix`_ for an overview of which modem firmware versions have been tested with this version of the |NCS|. + +Use the latest version of the nRF Programmer app of `nRF Connect for Desktop`_ to update the modem firmware. +See :ref:`nrf9160_gs_updating_fw_modem` for instructions. + +Modem-related libraries and versions +==================================== + +.. list-table:: Modem-related libraries and versions + :widths: 15 10 + :header-rows: 1 + + * - Library name + - Version information + * - Modem library + - `Changelog `_ + * - LwM2M carrier library + - `Changelog `_ + +Known issues +************ + +Known issues are only tracked for the latest official release. +See `known issues for nRF Connect SDK v2.6.1`_ for the list of issues valid for the latest release. + +.. _ncs_release_notes_261_changelog: + +Changelog +********* + +The following sections provide detailed lists of changes by component. + +Protocols +========= + +This section provides detailed lists of changes by :ref:`protocol `. + +Matter +------ + +* Updated: + + * The default Message Reliability Protocol (MRP) retry intervals for Thread devices to two seconds to reduce the number of spurious retransmissions in Thread networks. + * Increased the number of available packet buffers in the Matter stack to avoid packet allocation issues. + +Wi-Fi +----- + +* Added: + + * Build-time disconnection timeout configuration. + * BSSID as a parameter for the Wi-Fi ``connect`` command. + * Auto-security mode with a fresh key management type to enhance connection time. + * The following fixes and improvements: + + * Wi-Fi stuck in an awake state. + * Frequent Wi-Fi disconnections in a congested environment and low RSSI. + * HTTPS upload and download performance issues. + * MQTT disconnection in a congested environment and low RSSI. + * Selecting the best RSSI access point. + * Rate adaptation enhancements to improve range in the 2.4 GHz band. + * Radio test - Error in setting ``reg_domain``. + + To accommodate all fixes and improvements, there is a 1 kB increase in the stack usage of the WPA supplicant. + Users must increase the stack sizes appropriately in their applications. + +Thread +------ + +* Fixed ``otPlatCryptoPbkdf2GenerateKey`` API implementation to allow a fallback to legacy Mbed TLS implementation instead of returning ``OT_ERROR_NOT_CAPABLE``. + +Applications +============ + +This section provides detailed lists of changes by :ref:`application `. + +Matter Bridge +------------- + +* Added: + + * The :ref:`CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES ` Kconfig option to set the maximum number of scanned Bluetooth LE devices. + * The :ref:`CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS ` Kconfig option to set the scan timeout. + +* Fixed an issue where the recovery mechanism for Bluetooth LE connections might not work correctly. + +Samples +======= + +This section provides detailed lists of changes by :ref:`sample `. + +Wi-Fi samples +------------- + +* :ref:`wifi_shell_sample` sample: + + * Modified ``connect`` command to provide better control over connection parameters. + * Added ``Auto-Security-Personal`` mode to the ``connect`` command. + +Zephyr +====== + +The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``23cf38934c0f68861e403b22bc3dd0ce6efbfa39``. +It also contains some |NCS| specific additions and commits cherry-picked from the upstream Zephyr repository, including the following one: + +* Fixed the GPIO configuration that is used in the ``pinctrl`` driver for the QSPI IO3 line. + Due to these incorrect settings, the QSPI NOR flash driver could not initialize successfully for a flash chip configured to work in non-Quad (2 I/O) mode. + +For a complete list of |NCS| specific commits and cherry-picked commits since v2.6.0, run the following command: + +.. code-block:: none + + git log --oneline manifest-rev ^v3.5.99-ncs1 diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.6.99-cs1.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.99-cs1.rst new file mode 100644 index 000000000000..bb8d4546a1a2 --- /dev/null +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.6.99-cs1.rst @@ -0,0 +1,279 @@ +.. _ncs_release_notes_2699_cs1: + +|NCS| v2.6.99-cs1 Release Notes +############################### + +.. contents:: + :local: + :depth: 3 + +|NCS| v2.6.99-cs1 is a **customer sampling** release, tailored exclusively for participants in the nRF54L15 customer sampling program. +Do not use this release of |NCS| if you are not participating in the program. + +The release is not part of the regular release cycle and is specifically designed to support early adopters working with the nRF54L15 device. +It is intended to provide early access to the latest developments for nRF54L15, enabling participants to experiment with new features and provide feedback. + +The scope of this release is intentionally narrow, concentrating solely on the nRF54L15 device. +You can use the latest stable release of |NCS| to work with other boards. + +All functionality related to nRF54L15 is considered experimental. + +Changelog +********* + +The following sections provide detailed lists of changes by component. + +Peripherals support +=================== + +* Added experimental support for the following peripherals on the nRF54L15 PDK: + + * GPIO + * SPIM + * UART + * TWIM + * SAADC + * WDT + * GRTC + * QDEC + * I2S + * PWM + +Working with nRF54L Series +========================== + +* Added: + + * The :ref:`ug_nrf54l15_gs` page. + * The :ref:`nrf54l_features` page. + +Protocols +========= + +This section provides detailed lists of changes by :ref:`protocol `. +See `Samples`_ for lists of changes for the protocol-related samples. + +Amazon Sidewalk +--------------- + +* Added support for the :ref:`nRF54L15 PDK ` in the following configurations: + + * Bluetooth® LE only + * DFU over Bluetooth LE + +Enhanced ShockBurst (ESB) +------------------------- + +* Added support for the :ref:`nRF54L15 PDK ` board. + +Applications +============ + +This section provides detailed lists of changes by :ref:`application `. + +nRF Desktop +----------- + +* Added: + + * Support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0``. + The PDK can act as a sample mouse or keyboard. + It supports the Bluetooth LE HID data transport and uses SoftDevice Link Layer with Low Latency Packet Mode (LLPM) enabled. + The PDK uses MCUboot bootloader built in the direct-xip mode (``MCUBOOT+XIP``) and supports firmware updates using the :ref:`nrf_desktop_dfu`. + * The ``nrfdesktop-wheel-qdec`` DT alias support to :ref:`nrf_desktop_wheel`. + You must use the alias to specify the QDEC instance used for scroll wheel, if your board supports multiple QDEC instances (for example ``nrf54l15pdk_nrf54l15_cpuapp``). + You need not define the alias if your board supports only one QDEC instance, because in that case, the wheel module can rely on the ``qdec`` DT label provided by the board. + +Samples +======= + +This section provides detailed lists of changes by :ref:`sample `. + +Bluetooth samples +----------------- + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following Bluetooth samples: + + * :ref:`peripheral_lbs` sample + * :ref:`bluetooth_central_hids` sample + * :ref:`peripheral_hids_mouse` sample + * :ref:`peripheral_hids_keyboard` sample + * :ref:`central_and_peripheral_hrs` sample + * :ref:`direct_test_mode` sample + * :ref:`central_uart` sample + * :ref:`peripheral_uart` sample + +Cryptography samples +-------------------- + +* Added support for the :ref:`nRF54L15 PDK ` in all cryptography samples: + + * Samples :ref:`crypto_persistent_key` and :ref:`crypto_tls` support the nRF54L15 PDK with the ``nrf54l15pdk_nrf54l15_cpuapp`` build target. + * All other crypto samples support the nRF54L15 PDK with both ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp_ns`` build targets. + +ESB samples +----------- + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following ESB samples: + + * :ref:`esb_prx` sample + * :ref:`esb_ptx` sample + +Matter samples +-------------- + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following Matter samples: + + * :ref:`matter_template_sample` sample + * :ref:`matter_light_bulb_sample` sample + * :ref:`matter_light_switch_sample` sample + * :ref:`matter_thermostat_sample` sample + * :ref:`matter_window_covering_sample` sample + + DFU support for the nRF54L15 PDK is available only for the ``release`` build target. + +NFC samples +----------- + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following NFC samples: + + * :ref:`record_launch_app` sample + * :ref:`record_text` sample + * :ref:`nfc_shell` sample + * :ref:`nrf-nfc-system-off-sample` sample + * :ref:`nfc_tnep_tag` sample + * :ref:`writable_ndef_msg` sample + +Peripheral samples +------------------ + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following peripheral samples: + + * :ref:`radio_test` sample + * :ref:`802154_phy_test` sample + +Thread samples +-------------- + +* Added support for the :ref:`nRF54L15 PDK ` with build targets ``nrf54l15pdk_nrf54l15_cpuapp`` and ``nrf54l15pdk_nrf54l15_cpuapp@0.3.0`` in the following Thread samples: + + * :ref:`ot_cli_sample` sample + * :ref:`ot_coprocessor_sample` sample + +Trusted Firmware-M (TF-M) samples +--------------------------------- + +* :ref:`tfm_hello_world` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +Other samples +------------- + +* Added the :ref:`coremark_sample` sample that demonstrates how to measure a performance of the supported SoCs by running the Embedded Microprocessor Benchmark Consortium (EEMBC) CoreMark benchmark. + Included support for the :ref:`nRF54L15 PDK `. + +Libraries +========= + +This section provides detailed lists of changes by :ref:`library `. + + +Security libraries +------------------ + +* :ref:`nrf_security` library: + + * Added support for PSA crypto on the :ref:`nRF54L15 PDK `. + Enabled the PSA crypto support with a CRACEN driver as the backend by setting the Kconfig option :kconfig:option:`CONFIG_NRF_SECURITY`. + +MCUboot +======= + +The MCUboot fork in |NCS| (``sdk-mcuboot``) contains all commits from the upstream MCUboot repository up to and including ``a4eda30f5b0cfd0cf15512be9dcd559239dbfc91``, with some |NCS| specific additions. + +The code for integrating MCUboot into |NCS| is located in the :file:`ncs/nrf/modules/mcuboot` folder. + +The following list summarizes both the main changes inherited from upstream MCUboot and the main changes applied to the |NCS| specific additions: + +* Added experimental support for MCUboot-based DFU on the nRF54L15 PDK. + +Zephyr +====== + +.. NOTE TO MAINTAINERS: All the Zephyr commits in the below git commands must be handled specially after each upmerge and each nRF Connect SDK release. + +The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``0051731a41fa2c9057f360dc9b819e47b2484be5``, with some |NCS| specific additions. + +For the list of upstream Zephyr commits (not including cherry-picked commits) incorporated into nRF Connect SDK since the most recent release, run the following command from the :file:`ncs/zephyr` repository (after running ``west update``): + +.. code-block:: none + + git log --oneline 0051731a41 ^23cf38934c + +For the list of |NCS| specific commits, including commits cherry-picked from upstream, run: + +.. code-block:: none + + git log --oneline manifest-rev ^0051731a41 + +The current |NCS| main branch is based on revision ``0051731a41`` of Zephyr. + +.. note:: + For possible breaking changes and changes between the latest Zephyr release and the current Zephyr version, refer to the :ref:`Zephyr release notes `. + +Zephyr samples +-------------- + +* Added support for the :ref:`nRF54L15 PDK ` in the following Zephyr samples: + + * :zephyr:code-sample:`blinky` + * :ref:`zephyr:hello_world` + * :zephyr:code-sample:`settings` + * :ref:`zephyr:bluetooth-observer-sample` + * :ref:`zephyr:nrf-system-off-sample` + * :ref:`zephyr:peripheral_hr` + * :ref:`zephyr:bluetooth_central_hr` + * :zephyr:code-sample:`smp-svr` + +Current nRF54L15 PDK Limitations +================================ + +General +------- + +* The v0.2.1 revision of the nRF54L15 PDK has Button 3 and Button 4 connected to GPIO port 2 that does not support interrupts. + An example of software workaround for this issue is implemented in the :ref:`dk_buttons_and_leds_readme` library. + The workaround is enabled by default with the :kconfig:option:`CONFIG_DK_LIBRARY_BUTTON_NO_ISR` Kconfig option, but it increases the overall power consumption of the system. + +Amazon Sidewalk +--------------- + +* LoRa/FSK is not supported. +* After a successful image transfer, the DFU image swap for the Hello World application takes almost 80 seconds. +* After an auto-connect, the first sent message contains corrupted data. + A workaround for this issue is to disable the auto-connect or set up the connection manually before sending the uplink message. + +Matter +------ + +* The Device Firmware Update (DFU) is available only for the internal RAM memory space and for the ``release`` build configuration. +* External flash memory is not supported. +* A crash might occur when the Matter thread and Openthread thread are using PSA API concurrently. + Such crash might be observed during the commissioning process to the next Matter fabric when the device is already connected to a Matter fabric. + +Thread +------ + +* Link Metrics is not supported. +* Thread commissioning fails since EC J-PAKE is not supported. + +Documentation +============= + +* Added: + + * The :ref:`ug_nrf54l` section. + * The :ref:`ug_coremark` page. + +* Updated the table listing the :ref:`boards included in sdk-zephyr ` with the nRF54L15 PDK board. 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 2bff411ce8a1..1e6bfd45e70e 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -1,5 +1,3 @@ -:orphan: - .. _ncs_release_notes_changelog: Changelog for |NCS| v2.6.99 @@ -37,31 +35,53 @@ IDE and tool support |no_changes_yet_note| +Build and configuration system +============================== + +* Added documentation about the :ref:`file suffix feature from Zephyr ` with a related information in the :ref:`migration guide `. + Working with nRF91 Series ========================= -|no_changes_yet_note| +* Moved :ref:`ug_nrf9160_gs` and :ref:`ug_thingy91_gsg` to the :ref:`gsg_guides` section. Working with nRF70 Series ========================= -|no_changes_yet_note| +* Moved :ref:`ug_nrf7002_gs` to the :ref:`gsg_guides` section. + +Working with nRF54L Series +========================== + +* Added the :ref:`ug_nrf54l15_gs` page. +* Changed the default value for the Kconfig option :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_ACCURACY` from 500 to 250 if :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC` is used. + +Working with nRF53 Series +========================= + +* Moved :ref:`ug_nrf5340_gs` to the :ref:`gsg_guides` section. Working with nRF52 Series ========================= -|no_changes_yet_note| +* Moved :ref:`ug_nrf52_gs` to the :ref:`gsg_guides` section. Working with nRF53 Series ========================= -|no_changes_yet_note| +* Added the :ref:`features_nrf53` page. +* Changed the default value for the Kconfig option :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_ACCURACY` from 500 to 250 if :kconfig:option:`CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC` is used. Working with RF front-end modules ================================= |no_changes_yet_note| +Security +======== + +* Added information about the default Kconfig option setting for :ref:`enabling access port protection mechanism in the nRF Connect SDK`. + Protocols ========= @@ -76,12 +96,23 @@ Bluetooth® LE Bluetooth Mesh -------------- -|no_changes_yet_note| +* Updated: + + * The Kconfig option :kconfig:option:`CONFIG_BT_MESH_DFU_METADATA_ON_BUILD` to no longer depend on the Kconfig option :kconfig:option:`CONFIG_BT_MESH_DFU_METADATA`. + * The Kconfig option :kconfig:option:`CONFIG_BT_MESH_DFU_CLI` to no longer enable the Kconfig option :kconfig:option:`CONFIG_BT_MESH_DFU_METADATA_ON_BUILD` by default. + The Kconfig option :kconfig:option:`CONFIG_BT_MESH_DFU_METADATA_ON_BUILD` can still be manually enabled. + * The JSON file, added to :file:`dfu_application.zip` during the automatic DFU metadata generation, to now contain a field for the ``core_type`` used when encoding the metadata. Matter ------ -|no_changes_yet_note| +* Added: + + * Support for merging the generated factory data HEX file with the firmware HEX file by using the devicetree configuration, when Partition Manager is not enabled in the project. + * Support for the unified Persistent Storage API, including the implementation of the PSA Persistent Storage. + +* Updated default MRP retry intervals for Thread devices to two seconds to reduce the number of spurious retransmissions in Thread networks. +* Increased the number of available packet buffers in the Matter stack to avoid packet allocation issues. Matter fork +++++++++++ @@ -90,17 +121,25 @@ The Matter fork in the |NCS| (``sdk-connectedhomeip``) contains all commits from The following list summarizes the most important changes inherited from the upstream Matter: +* Updated: + + * The scripts for factory data generation and related :doc:`matter:nrfconnect_factory_data_configuration` documentation page. + Now, you can use a single script to generate both JSON and HEX files that include the factory data. + Previously, you would have to do that in two steps using two separate scripts. + The older method is still supported for backward compatibility. + |no_changes_yet_note| Thread ------ -|no_changes_yet_note| +* Initial experimental support for nRF54L15 for the Thread CLI and Co-processor samples. +* Added new :ref:`feature set ` option :kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_RCP`. Zigbee ------ -|no_changes_yet_note| +* Fixed an issue with Zigbee FOTA updates failing after a previous attempt was interrupted. Gazell ------ @@ -110,7 +149,9 @@ Gazell Enhanced ShockBurst (ESB) ------------------------- -|no_changes_yet_note| +* Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. +* Added fast switching between radio states for the nRF54H20 SoC. +* Added fast radio channel switching for the nRF54H20 SoC. nRF IEEE 802.15.4 radio driver ------------------------------ @@ -130,27 +171,64 @@ This section provides detailed lists of changes by :ref:`application ` Kconfig option for the nRF Desktop peripherals with :ref:`nrf_desktop_dfu`. + The option mitigates HID report rate drops during DFU image transfer through the nRF Desktop dongle. + The output report is also enabled for the ``nrf52kbd_nrf52832`` build target in the debug configuration to maintain consistency with the release configuration. + * Replaced the :kconfig:option:`CONFIG_BT_L2CAP_TX_BUF_COUNT` Kconfig option with :kconfig:option:`CONFIG_BT_ATT_TX_COUNT` in nRF Desktop dongle configurations. + This update is needed to align with the new approach introduced in ``sdk-zephyr`` by commit ``a05a47573a11ba8a78dadc5d3229659f24ddd32f``. + * The :ref:`nrf_desktop_hid_forward` no longer uses a separate HID report queue for a HID peripheral connected over Bluetooth LE. + The module relies only on the HID report queue of a HID subscriber. + This is done to simplify implementation, reduce memory consumption and speed up retrieving enqueued HID reports. + You can modify the enqueued HID report limit through the :ref:`CONFIG_DESKTOP_HID_FORWARD_MAX_ENQUEUED_REPORTS ` Kconfig option. Thingy:53: Matter weather station --------------------------------- @@ -160,7 +238,16 @@ Thingy:53: Matter weather station Matter Bridge ------------- -|no_changes_yet_note| +* Added: + + The :ref:`CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES ` Kconfig option to set the maximum number of scanned Bluetooth LE devices. + The :ref:`CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS ` Kconfig option to set the scan timeout. + +* Updated the implementation of the persistent storage to leverage ``NonSecure``-prefixed methods from the common Persistent Storage module. +* Changed data structure of information stored in the persistent storage to use less settings keys. + The new structure uses approximately 40% of the memory used by the old structure, and provides a new field to store user-specific data. + + Backward compatibility is kept by using an internal dedicated method that automatically detects the older data format and performs data migration to the new representation. IPC radio firmware ------------------ @@ -175,28 +262,212 @@ This section provides detailed lists of changes by :ref:`sample `. Bluetooth samples ----------------- -|no_changes_yet_note| +* Added the :ref:`bluetooth_iso_combined_bis_cis` sample showcasing forwarding isochronous data from CIS to BIS. +* Added the :ref:`bluetooth_isochronous_time_synchronization` sample showcasing time-synchronized processing of isochronous data. + +* :ref:`fast_pair_input_device` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`peripheral_lbs` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`bluetooth_central_hids` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`peripheral_hids_mouse` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`peripheral_hids_keyboard` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`central_and_peripheral_hrs` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`direct_test_mode` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`peripheral_uart` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`central_uart` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` and :ref:`nRF54L15 PDK ` boards. + +* :ref:`central_bas` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`bluetooth_central_hr_coded` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`multiple_adv_sets` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_ams_client` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_ancs_client` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_bms` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_cgms` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_cts_client` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_gatt_dm` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_hr_coded` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_nfc_pairing` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_rscs` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`peripheral_status` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`shell_bt_nus` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. Bluetooth Mesh samples ---------------------- -|no_changes_yet_note| +* :ref:`bluetooth_mesh_sensor_client` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bluetooth_mesh_sensor_server` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Updated: + + * Actions of buttons 1 and 2. + They are swapped to align with the elements order. + * Log messages to be more informative. + +* :ref:`bluetooth_ble_peripheral_lbs_coex` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bt_mesh_chat` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bluetooth_mesh_light_switch` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bluetooth_mesh_silvair_enocean` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bluetooth_mesh_light_dim` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`bluetooth_mesh_light` sample: + + * Added: + + * Support for the :ref:`nRF54L15 PDK ` board. + * Support for DFU over Bluetooth Low Energy for the :ref:`nRF54L15 PDK ` board. + +* :ref:`ble_mesh_dfu_target` sample: + + * Added + + * A note on how to compile the sample with new Composition Data. + * Point-to-point DFU support with overlay file :file:`overlay-ptp_dfu.conf`. + +* :ref:`bluetooth_mesh_light_lc` sample: + + * Added a section about the :ref:`occupancy mode `. Cellular samples ---------------- -|no_changes_yet_note| +* :ref:`ciphersuites` sample: + + * Updated the :file:`.pem` certificate for example.com. + +* :ref:`location_sample` sample: + + * Removed ESP8266 Wi-Fi DTC and Kconfig overlay files. + +* :ref:`modem_shell_application` sample: + + * Added support for sending location data details into nRF Cloud with ``--cloud_details`` command-line option in the ``location`` command. + * Removed ESP8266 Wi-Fi DTC and Kconfig overlay files. + +* :ref:`nrf_cloud_rest_cell_pos_sample` sample: + + * Removed: + + * The button press interface for enabling the device location card on the nRF Cloud website. + The card is now automatically displayed. + + * Added: + + * The :ref:`CONFIG_REST_CELL_SEND_DEVICE_STATUS ` Kconfig option to control sending device status on initial connection. + +* :ref:`modem_shell_application` sample: + + * Removed sending GNSS UI service info to nRF Cloud; this is no longer required by the cloud. + +* :ref:`nrf_cloud_multi_service` sample: + + * Fixed: + + * An issue that prevented network connectivity when using Wi-Fi scanning with the nRF91xx. + + * Added: + + * The ability to control the state of the test counter using the config section in the device shadow. Cryptography samples -------------------- -|no_changes_yet_note| +* Added :ref:`crypto_spake2p` sample. Debug samples ------------- |no_changes_yet_note| +DECT samples +------------ + +* Added the :ref:`nrf_modem_dect_phy_hello` sample. + + Edge Impulse samples -------------------- @@ -220,22 +491,91 @@ Keys samples Matter samples -------------- -|no_changes_yet_note| +* Removed: + + * The :file:`configuration` directory which contained the Partition Manager configuration file. + It has been replaced replace with :file:`pm_static_` Partition Manager configuration files for all required target boards in the samples' directories. + * The :file:`prj_no_dfu.conf` file. + * Support for the ``no_dfu`` build type for the nRF5350 DK, the nRF52840 DK, and the nRF7002 DK. + +* Added: + + * Test event triggers to all Matter samples and enabled them by default. + By utilizing the test event triggers, you can simulate various operational conditions and responses in your Matter device without the need for external setup. + + To get started with using test event triggers in your Matter samples and to understand the capabilities of this feature, refer to the :ref:`ug_matter_test_event_triggers` page. + + * Support for the nRF54L15 PDK with the ``nrf54l15pdk_nrf54l15_cpuapp`` build target to the following Matter samples: + + * :ref:`matter_template_sample` sample. + * :ref:`matter_light_bulb_sample` sample. + * :ref:`matter_light_switch_sample` sample. + * :ref:`matter_thermostat_sample` sample. + * :ref:`matter_window_covering_sample` sample. + + DFU support for the nRF54L15 PDK is available only for the ``release`` build target. + +* :ref:`matter_lock_sample` sample: + + * Added support for emulation of the nRF7001 Wi-Fi companion IC on the nRF7002 DK. Multicore samples ----------------- -|no_changes_yet_note| +* :ref:`ipc_service_sample` sample: + + * Removed support for the `OpenAMP`_ library backend on the :ref:`zephyr:nrf54h20dk_nrf54h20` board. Networking samples ------------------ -|no_changes_yet_note| +* Updated: + + * The networking samples to support import of certificates in valid PEM formats. + +* :ref:`http_server` sample: + + * Added: + + * ``DNS_SD_REGISTER_TCP_SERVICE`` so that mDNS services can locate and address the server using its hostname. + * Support for the :ref:`native simulator ` board. + + * Updated: + + * Set the value of the :kconfig:option:`CONFIG_POSIX_MAX_FDS` Kconfig option to ``25`` to get the Transport Layer Security (TLS) working. + * Set the default value of the :ref:`CONFIG_HTTP_SERVER_SAMPLE_CLIENTS_MAX ` Kconfig option to ``1``. NFC samples ----------- -|no_changes_yet_note| +* :ref:`record_launch_app` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`record_text` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`nfc_shell` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`nrf-nfc-system-off-sample` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + +* :ref:`nfc_tnep_tag` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`writable_ndef_msg` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. nRF5340 samples --------------- @@ -245,7 +585,21 @@ nRF5340 samples Peripheral samples ------------------ -|no_changes_yet_note| +* :ref:`radio_test` sample: + + * Updated: + + * The CLI command ``fem tx_power_control `` replaces ``fem tx_gain `` . + This change applies to the sample built with the :ref:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC ` set to ``n``. + + * Added: + + * Support for the :ref:`nRF54L15 PDK ` board. + * Support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. + +* :ref:`802154_phy_test` sample: + + * Added support for the :ref:`nRF54L15 PDK ` board. PMIC samples ------------ @@ -265,7 +619,10 @@ Trusted Firmware-M (TF-M) samples Thread samples -------------- -|no_changes_yet_note| +* Initial experimental support for nRF54L15 for the Thread CLI and Co-processor samples. +* :ref:`ot_coprocessor_sample` sample: + + * Changed the default :ref:`feature set ` from Master to RCP. Sensor samples -------------- @@ -280,12 +637,17 @@ Zigbee samples Wi-Fi samples ------------- -|no_changes_yet_note| +* :ref:`wifi_shell_sample` sample: + + * Modified ``connect`` command to provide better control over connection parameters. + * Added ``Auto-Security-Personal`` mode to the ``connect`` command. + * Added support for the ``WPA-PSK`` security mode to the ``wifi_mgmt_ext`` library. Other samples ------------- -|no_changes_yet_note| +* Added the :ref:`coremark_sample` sample that demonstrates how to easily measure a performance of the supported SoCs by running the Embedded Microprocessor Benchmark Consortium (EEMBC) CoreMark benchmark. + Included support for the nRF52840 DK, nRF5340 DK, and nRF54L15 PDK. Drivers ======= @@ -295,7 +657,7 @@ This section provides detailed lists of changes by :ref:`driver `. Wi-Fi drivers ------------- -|no_changes_yet_note| +* Removed support for setting RTS threshold through ``wifi_util`` command. Libraries ========= @@ -305,12 +667,25 @@ This section provides detailed lists of changes by :ref:`library `. Binary libraries ---------------- -|no_changes_yet_note| +.. _lib_bt_ll_acs_nrf53_readme: + +* Removed the LE Audio controller for nRF5340 library, which was deprecated in the :ref:`v2.6.0 release `. + As mentioned in the :ref:`migration_2.6`, make sure to transition to Nordic Semiconductor's standard :ref:`ug_ble_controller_softdevice` (:ref:`softdevice_controller_iso`). Bluetooth libraries and services -------------------------------- -|no_changes_yet_note| +* :ref:`bt_mesh` library: + + * Updated the :ref:`bt_mesh_light_ctrl_srv_readme` model documentation to explicitly mention the Occupany On event. + +* :ref:`bt_enocean_readme` library: + + * Fixed an issue where the sensor data of a certain length was incorrectly parsed as switch commissioning. + +* :ref:`bt_fast_pair_readme` library: + + * Added experimental support for a new cryptographical backend that relies on the PSA crypto APIs (:kconfig:option:`CONFIG_BT_FAST_PAIR_CRYPTO_PSA`). Bootloader libraries -------------------- @@ -330,12 +705,80 @@ DFU libraries Modem libraries --------------- -|no_changes_yet_note| +* :ref:`nrf_modem_lib_readme`: + + * Fixed an issue with the CFUN hooks when the Modem library is initialized during ``SYS_INIT`` at kernel level and makes calls to the :ref:`nrf_modem_at` interface before the application level initialization is done. + +* :ref:`lib_location` library: + + * Added: + + * Convenience function to get :c:struct:`location_data_details` from the :c:struct:`location_event_data`. + * Location data details for event :c:enum:`LOCATION_EVT_RESULT_UNKNOWN`. + +* :ref:`lte_lc_readme` library: + + * Removed ``AT%XRAI`` related deprecated functions ``lte_lc_rai_param_set()`` and ``lte_lc_rai_req()``, and Kconfig option :kconfig:option:`CONFIG_LTE_RAI_REQ_VALUE`. + The application uses the Kconfig option :kconfig:option:`CONFIG_LTE_RAI_REQ` and ``SO_RAI`` socket option instead. Libraries for networking ------------------------ -|no_changes_yet_note| +* :ref:`lib_wifi_credentials` library: + + * Added: + + * Function :c:func:`wifi_credentials_delete_all` to delete all stored Wi-Fi credentials. + * Function :c:func:`wifi_credentials_is_empty` to check if the Wi-Fi credentials storage is empty. + * New parameter ``channel`` to the structure :c:struct:`wifi_credentials_header` to store the channel information of the Wi-Fi network. + +* :ref:`lib_nrf_cloud` library: + + * Added: + + * Support for Wi-Fi anchor names in the :c:struct:`nrf_cloud_location_result` structure. + * The :kconfig:option:`CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST` Kconfig option to enable including Wi-Fi anchor names in the location callback. + * The :kconfig:option:`CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST_BUFFER_SIZE` Kconfig option to control the buffer size used for the anchor names. + * The :kconfig:option:`CONFIG_NRF_CLOUD_LOCATION_PARSE_ANCHORS` Kconfig option to control if anchor names are parsed. + * The :c:func:`nrf_cloud_obj_bool_get` function to get a boolean value from an object. + + * Updated: + + * Improved FOTA job status reporting. + * Deprecated :kconfig:option:`CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_UI` and its related UI Kconfig options. + * Deprecated the :c:struct:`nrf_cloud_svc_info_ui` structure contained in the :c:struct:`nrf_cloud_svc_info` structure. + nRF Cloud no longer uses the UI section in the shadow. + +* :ref:`lib_mqtt_helper` library: + + * Changed the library to read certificates as standard PEM format. Previously the certificates had to be manually converted to string format before compiling the application. + * Replaced the ``CONFIG_MQTT_HELPER_CERTIFICATES_FILE`` Kconfig option with :kconfig:option:`CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER`. The new option specifies the folder where the certificates are stored. + +* :ref:`lib_nrf_provisioning` library: + + * Added the :c:func:`nrf_provisioning_set_interval` function to set the interval between provisioning attempts. + +* :ref:`lib_nrf_cloud_coap` library: + + * Updated to request proprietary PSM mode for ``SOC_NRF9151_LACA`` and ``SOC_NRF9131_LACA`` in addition to ``SOC_NRF9161_LACA``. + + * Added the :c:func:`nrf_cloud_coap_shadow_desired_update` function to allow devices to reject invalid shadow deltas. + +* :ref:`lib_lwm2m_client_utils` library: + + * The following initialization functions have been deprecated as these modules are now initialized automatically on boot: + + * :c:func:`lwm2m_init_location` + * :c:func:`lwm2m_init_device` + * :c:func:`lwm2m_init_cellular_connectivity_object` + * :c:func:`lwm2m_init_connmon` + + * :c:func:`lwm2m_init_firmware` is deprecated in favour of :c:func:`lwm2m_init_firmware_cb` that allows application to set a callback to receive FOTA events. + * Fixed an issue where the Location Area Code was not updated when the Connection Monitor object version 1.3 was enabled. + +* :ref:`lib_nrf_cloud_pgps` library: + + * Fixed a NULL pointer issue that could occur when there are some valid predictions in flash but not the one required at the current time. Libraries for NFC ----------------- @@ -345,12 +788,19 @@ Libraries for NFC Security libraries ------------------ -|no_changes_yet_note| +* :ref:`trusted_storage_readme` library: + + * Added the Kconfig option :kconfig:option:`CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND_CUSTOM` that enables use of custom storage backend. Other libraries --------------- -|no_changes_yet_note| +* Added the :ref:`lib_uart_async_adapter` library. + +* :ref:`app_event_manager`: + + * Added the :kconfig:option:`CONFIG_APP_EVENT_MANAGER_REBOOT_ON_EVENT_ALLOC_FAIL` Kconfig option. + The option allows to select between system reboot or kernel panic on event allocation failure for default event allocator. Common Application Framework (CAF) ---------------------------------- @@ -382,7 +832,7 @@ This section provides detailed lists of changes by :ref:`script `. MCUboot ======= -The MCUboot fork in |NCS| (``sdk-mcuboot``) contains all commits from the upstream MCUboot repository up to and including ``11ecbf639d826c084973beed709a63d51d9b684e``, with some |NCS| specific additions. +The MCUboot fork in |NCS| (``sdk-mcuboot``) contains all commits from the upstream MCUboot repository up to and including ``a4eda30f5b0cfd0cf15512be9dcd559239dbfc91``, with some |NCS| specific additions. The code for integrating MCUboot into |NCS| is located in the :file:`ncs/nrf/modules/mcuboot` folder. @@ -395,21 +845,21 @@ Zephyr .. NOTE TO MAINTAINERS: All the Zephyr commits in the below git commands must be handled specially after each upmerge and each nRF Connect SDK release. -The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``23cf38934c0f68861e403b22bc3dd0ce6efbfa39``, with some |NCS| specific additions. +The Zephyr fork in |NCS| (``sdk-zephyr``) contains all commits from the upstream Zephyr repository up to and including ``0051731a41fa2c9057f360dc9b819e47b2484be5``, with some |NCS| specific additions. For the list of upstream Zephyr commits (not including cherry-picked commits) incorporated into nRF Connect SDK since the most recent release, run the following command from the :file:`ncs/zephyr` repository (after running ``west update``): .. code-block:: none - git log --oneline 23cf38934c ^a768a05e62 + git log --oneline 0051731a41 ^23cf38934c For the list of |NCS| specific commits, including commits cherry-picked from upstream, run: .. code-block:: none - git log --oneline manifest-rev ^23cf38934c + git log --oneline manifest-rev ^0051731a41 -The current |NCS| main branch is based on revision ``23cf38934c`` of Zephyr. +The current |NCS| main branch is based on revision ``0051731a41`` of Zephyr. .. note:: For possible breaking changes and changes between the latest Zephyr release and the current Zephyr version, refer to the :ref:`Zephyr release notes `. @@ -427,7 +877,7 @@ zcbor Trusted Firmware-M ================== -|no_changes_yet_note| +* Support PSA PAKE APIs from the PSA Crypto API specification 1.2. cJSON ===== @@ -437,4 +887,25 @@ cJSON Documentation ============= -|no_changes_yet_note| +* Added: + + * The :ref:`test_framework` section for gathering information about unit tests, with a new page about :ref:`running_unit_tests`. + * List of :ref:`debugging_tools` on the :ref:`debugging` page. + * Recommendation for the use of a :file:`VERSION` file for :ref:`ug_fw_update_image_versions_mcuboot` in the :ref:`ug_fw_update_image_versions` user guide. + * The :ref:`ug_coremark` page. + +* Updated: + + * The :ref:`cmake_options` section on the :ref:`configuring_cmake` page with the list of most common CMake options and more information about how to provide them. + * The table listing the :ref:`boards included in sdk-zephyr ` with the nRF54L15 PDK and nRF54H20 DK boards. + + * The :ref:`ug_wifi_overview` page by separating the information about Wi-Fi certification into its own :ref:`ug_wifi_certification` page under :ref:`ug_wifi`. + * The :ref:`ug_bt_mesh_configuring` page with an example of possible entries in the Settings NVS name cache. + * The :ref:`lib_security` page to include all security-related libraries. + * The trusted storage support table in the :ref:`trusted_storage_in_ncs` section by adding nRF52833 and replacing nRF9160 with nRF91 Series. + + * Reworked the :ref:`ble_rpc` page to be more informative and aligned with the library template. + +* Fixed: + + * Replaced the occurrences of the outdated :makevar:`OVERLAY_CONFIG` with the currently used :makevar:`EXTRA_CONF_FILE`. diff --git a/doc/nrf/releases_and_maturity/software_maturity.rst b/doc/nrf/releases_and_maturity/software_maturity.rst index ba117446f3b2..500a6649cbf4 100644 --- a/doc/nrf/releases_and_maturity/software_maturity.rst +++ b/doc/nrf/releases_and_maturity/software_maturity.rst @@ -171,6 +171,7 @@ Protocol support The following table indicates the software maturity levels of the support for each :ref:`protocol `: .. sml-table:: top_level + :insert-values: [("Bluetooth","nRF54L15","Experimental"), ("Bluetooth Mesh","nRF54L15","-"), ("Matter","nRF54L15","Experimental"), ("Sidewalk","nRF54L15","Experimental"), ("Thread","nRF54L15","Experimental")] Amazon Sidewalk features support ******************************** diff --git a/doc/nrf/samples.rst b/doc/nrf/samples.rst index 529acff37601..356661fdefc5 100644 --- a/doc/nrf/samples.rst +++ b/doc/nrf/samples.rst @@ -43,6 +43,7 @@ If you want to list samples available for one or more specific boards, `use the samples/nrf5340 samples/peripheral samples/pmic + samples/sdfw samples/sensor samples/tfm samples/thread diff --git a/doc/nrf/samples/other.rst b/doc/nrf/samples/other.rst index 1a5c500128bd..37baab622fd4 100644 --- a/doc/nrf/samples/other.rst +++ b/doc/nrf/samples/other.rst @@ -11,3 +11,4 @@ Other samples ../../../samples/*/README ../../../samples/ipc/*/README ../../../samples/mpsl/*/README + ../../../samples/benchmarks/*/README diff --git a/doc/nrf/samples/sdfw.rst b/doc/nrf/samples/sdfw.rst new file mode 100644 index 000000000000..b9379b044871 --- /dev/null +++ b/doc/nrf/samples/sdfw.rst @@ -0,0 +1,11 @@ +.. _sdfw_samples: + +SDFW samples +############ + +.. toctree:: + :maxdepth: 1 + :caption: Subpages + :glob: + + ../../../samples/sdfw/*/README diff --git a/doc/nrf/samples/wifi_zephyr.rst b/doc/nrf/samples/wifi_zephyr.rst index 5845a792fbcd..f5505ce46632 100644 --- a/doc/nrf/samples/wifi_zephyr.rst +++ b/doc/nrf/samples/wifi_zephyr.rst @@ -51,18 +51,18 @@ See :ref:`building` for other building scenarios, :ref:`programming` for program An overlay file, ``overlay-nrf700x.conf`` 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`` build target. +To build Zephyr samples for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-nrf700x.conf + west build -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-nrf700x.conf -To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. +To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build 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 -DOVERLAY_CONFIG=overlay-nrf700x.conf + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf700x.conf For additional details about running a sample, refer to the respective sample in Zephyr’s Samples and Demos documentation. diff --git a/doc/nrf/security/ap_protect.rst b/doc/nrf/security/ap_protect.rst index 1b2bf6f43bba..5394f64050a0 100644 --- a/doc/nrf/security/ap_protect.rst +++ b/doc/nrf/security/ap_protect.rst @@ -141,8 +141,10 @@ Based on the available implementation types, you can configure the access port p The MDK will close the debug AHB-AP, but not lock it, so the AHB-AP can be reopened by the firmware. Reopening the AHB-AP should be preceded by a handshake operation over UART, CTRL-AP Mailboxes, or some other communication channel. - Hardware and software - * - Open - - :kconfig:option:`CONFIG_NRF_APPROTECT_USE_UICR` (:kconfig:option:`CONFIG_NRF_SECURE_APPROTECT_USE_UICR` for Secure AP-Protect) + * - Open (default) + - | :kconfig:option:`CONFIG_NRF_APPROTECT_USE_UICR` (:kconfig:option:`CONFIG_NRF_SECURE_APPROTECT_USE_UICR` for Secure AP-Protect) + | + | This option is set to ``y`` by default in the |NCS|. - In this state, AP-Protect follows the UICR register. If the UICR is open, meaning ``UICR.APPROTECT`` has the value ``Disabled``, the AP-Protect will be disabled. (The exact value, placement, the enumeration name, and format varies between nRF Series families.) - Hardware; hardware and software @@ -171,6 +173,7 @@ Enabling AP-Protect with :kconfig:option:`CONFIG_NRF_APPROTECT_USE_UICR` ======================================================================== Setting the :kconfig:option:`CONFIG_NRF_APPROTECT_USE_UICR` Kconfig option to ``y`` and compiling the firmware makes the AP-Protect disabled by default. +This is the default setting in the |NCS|. You can start debugging the firmware without additional steps needed. diff --git a/doc/nrf/security/security.rst b/doc/nrf/security/security.rst index 303675f74a52..d5e5800a832e 100644 --- a/doc/nrf/security/security.rst +++ b/doc/nrf/security/security.rst @@ -74,13 +74,13 @@ The table below gives an overview of the trusted storage support for the product - Integrity - Authenticity - Isolation - * - nRF52840 - - Trusted storage library - - Partial [1]_ + * - nRF91 Series with TF-M + - TF-M secure storage service - Yes - Yes - - No - * - nRF5340 without TF-M + - Yes + - Yes + * - nRF91 Series without TF-M - Trusted storage library - Partial [1]_ - Yes @@ -92,22 +92,30 @@ The table below gives an overview of the trusted storage support for the product - Yes - Yes - Yes - * - nRF9160 without TF-M + * - nRF5340 without TF-M - Trusted storage library - Partial [1]_ - Yes - Yes - No - * - nRF9160 with TF-M - - TF-M secure storage service + * - nRF52840 + - Trusted storage library + - Partial [1]_ - Yes - Yes + - No + * - nRF52833 + - Trusted storage library + - Partial [2]_ - Yes - Yes + - No .. [1] On systems without the isolation feature, the confidentiality is limited to protection of data at rest in a non-volatile internal or external memory. This partial confidentiality is based on a CPU-inaccessible master key used for data encryption. When the data is decrypted for usage, there is no mechanism providing access control and protecting its visibility. Use of a TrustZone-enabled system provides stronger protection, and is recommended if available. +.. [2] The use of Hardware Unique Key (HUK) to provide the AEAD key is not available on nRF52833 devices. + The trusted storage library offers the use of SHA-256 to generate the key, which does not provide guarantees of security beyond the integrity check of the encrypted data. The trusted storage library addresses two of the PSA Certified Level 2 and Level 3 optional security functional requirements (SFRs): diff --git a/doc/nrf/security/tfm.rst b/doc/nrf/security/tfm.rst index bf76e1f4a19f..d344413b7f5b 100644 --- a/doc/nrf/security/tfm.rst +++ b/doc/nrf/security/tfm.rst @@ -29,7 +29,7 @@ The TF-M implementation in |NCS| is currently demonstrated in the following samp - All :ref:`cryptography samples ` in this SDK - A series of :ref:`TF-M integration samples ` available in Zephyr - The :ref:`https_client` sample for nRF91 Series devices in this SDK -- The :ref:`openthread_samples` that support the ``nrf5340dk_nrf5340_cpuapp_ns`` build target in this SDK +- The :ref:`openthread_samples` that support the ``nrf5340dk/nrf5340/cpuapp/ns`` build target in this SDK Building ******** @@ -43,7 +43,7 @@ To add TF-M to your build, enable the :kconfig:option:`CONFIG_BUILD_WITH_TFM` co If you use menuconfig to enable :kconfig:option:`CONFIG_BUILD_WITH_TFM`, you must also enable its dependencies. By default, TF-M is configured to build the :ref:`minimal version `. -To use the full TF-M, you must disable the :kconfig:option:`CONFIG_TFM_MINIMAL` option. +To use the full TF-M, you must disable the :kconfig:option:`CONFIG_TFM_PROFILE_TYPE_MINIMAL` option. You must build TF-M using a non-secure build target. The following platforms are currently supported: @@ -52,7 +52,7 @@ The following platforms are currently supported: * nRF91 Series TF-M uses UART1 for logging from the secure application. -To disable logging, enable the :kconfig:option:`TFM_LOG_LEVEL_SILENCE` option. +To disable logging, enable the :kconfig:option:`CONFIG_TFM_LOG_LEVEL_SILENCE` option. When building TF-M with logging enabled, UART1 must be disabled in the non-secure application, otherwise the non-secure application will fail to run. The recommended way to do this is to copy the .overlay file from the :ref:`tfm_hello_world` sample. @@ -62,7 +62,7 @@ Enabling secure services When using the :ref:`nrf_security`, if :kconfig:option:`CONFIG_BUILD_WITH_TFM` is enabled together with :kconfig:option:`CONFIG_NORDIC_SECURITY_BACKEND`, the TF-M secure image will enable the use of the hardware acceleration of Arm CryptoCell. In such case, the Kconfig configurations in the Nordic Security Backend control the features enabled through TF-M. -You can configure what crypto modules to include in TF-M by using the ``TFM_CRYPTO_`` Kconfig options found in file :file:`zephyr/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules`. +You can configure what crypto modules to include in TF-M by using the ``CONFIG_TFM_CRYPTO_*`` Kconfig options found in file :file:`zephyr/modules/trusted-firmware-m/Kconfig.tfm.crypto_modules`. TF-M utilizes :ref:`hardware unique keys ` when the PSA Crypto key derivation APIs are used, and ``psa_key_derivation_setup`` is called with the algorithm ``TFM_CRYPTO_ALG_HUK_DERIVATION``. For more information about the PSA cryptography and the API, see `PSA Cryptography API 1.0.1`_. diff --git a/doc/nrf/shortcuts.txt b/doc/nrf/shortcuts.txt index 458c7e6d9905..30d9e664cf79 100644 --- a/doc/nrf/shortcuts.txt +++ b/doc/nrf/shortcuts.txt @@ -1,8 +1,8 @@ .. |NCS| replace:: nRF Connect SDK -.. |release| replace:: v2.6.0 -.. |release_tt| replace:: ``v2.6.0`` -.. |release_number_tt| replace:: ``2.6.0`` +.. |release| replace:: v2.6.1 +.. |release_tt| replace:: ``v2.6.1`` +.. |release_number_tt| replace:: ``2.6.1`` .. ### Config shortcuts @@ -203,3 +203,5 @@ The generated :file:`.inc` file is then included in the code, where it is provisioned to the modem. .. |build_target| replace:: Replace the *build_target* with the build target of the nRF91 Series device you are using (see the Requirements section). + +.. |thingy52_not_supported_note| replace:: Despite being supported in :ref:`Zephyr `, the |NCS| does not support `Nordic Thingy:52`_. diff --git a/doc/nrf/test_and_optimize.rst b/doc/nrf/test_and_optimize.rst index 37dc630a4960..f35a90fec8b5 100644 --- a/doc/nrf/test_and_optimize.rst +++ b/doc/nrf/test_and_optimize.rst @@ -163,5 +163,5 @@ This includes a multilevel logging system that can be enabled and configured ind test_and_optimize/debugging test_and_optimize/logging - test_and_optimize/testing_unity_cmock + test_and_optimize/test_framework/index test_and_optimize/optimizing/index diff --git a/doc/nrf/test_and_optimize/debugging.rst b/doc/nrf/test_and_optimize/debugging.rst index 8b4f59b64828..b7ca22a65a97 100644 --- a/doc/nrf/test_and_optimize/debugging.rst +++ b/doc/nrf/test_and_optimize/debugging.rst @@ -8,57 +8,25 @@ Debugging an application :local: :depth: 2 -To debug an application, set up the debug session as described in the `How to debug an application`_ section in the |nRFVSC| documentation. -nRF Debug is the default debugger for |nRFVSC|. - -If you use a multi-core SoC, for example from the nRF53 Series, and you only wish to debug the application core firmware, a single debug session is sufficient. -To debug the firmware running on the network core, you need to set up two separate debug sessions: one for the network core and one for the application core. -When debugging the network core, the application core debug session runs in the background and you can debug both cores if needed. - -Complete the following steps to start debugging the network core: - -1. Set up sessions for the application core and network core as mentioned in the `How to debug applications for a multi-core System on Chip`_ section in the |nRFVSC| documentation. -#. Select the appropriate CPU for debugging in each session, corresponding to the application core and the network core of your SoC, respectively. -#. Once both sessions are established, execute the code on the application core. - - The startup code releases the ``NETWORK.FORCEOFF`` signal to start the network core and allocates the necessary GPIO pins for it. -#. Start code execution on the network core in the other debug session. - -If you want to reset the network core while debugging, make sure to first reset the application core and execute the code. - -For more information about debugging in the |nRFVSC|, for example testing and debugging with custom options, see the `Debugging overview`_ and other guides in the debugging section of the extension documentation. - -.. _debugging_spe_nspe: - -Debugging secure and non-secure firmware -**************************************** - -When using a build target with :ref:`CMSE enabled ` (``_ns``), by default you can only debug firmware in the non-secure environment of the application core firmware. +The main recommended tool for debugging in the |NCS| is `nRF Debug `_ of the |nRFVSC|. +The tool uses `Microsoft's debug adaptor`_ and integrates custom debugging features specific for the |NCS|. -To debug firmware running in the secure environment, you need to build Trusted Firmware-M with debug symbols enabled and load the symbols during the debugging session. -To build Trusted Firmware-M with debug symbols, set the :kconfig:option:`CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO` Kconfig option. +.. tabs:: -nRF Debug in the |nRFVSC| automatically loads the Trusted Firmware-M debug symbols. + .. group-tab:: nRF Connect for Visual Studio Code -Enabling non-halting debugging with Cortex-M Debug Monitor -********************************************************** + Use nRF Debug after adding the required Kconfig options to the :file:`prj.conf` file. + For details, see the `How to debug an application`_ section in the |nRFVSC| documentation. -The debugging process can run in two modes. -The halt-mode debugging stops the CPU when a debug request occurs. -The monitor-mode debugging lets a CPU debug parts of an application while crucial functions continue. -Unlike halt-mode, the monitor-mode is useful for scenarios like PWM motor control or Bluetooth, where halting the entire application is risky. -The CPU takes debug interrupts, running a monitor code for J-Link communication and user-defined functions. - -Use the following steps to enable monitor-mode debugging in the |NCS|: + Read also the `Debugging overview`_ and other guides in the debugging section of the extension documentation for more information about debugging in the |nRFVSC|, for example testing and debugging with custom options. -1. In the application configuration file, set the Kconfig options :kconfig:option:`CONFIG_CORTEX_M_DEBUG_MONITOR_HOOK` and :kconfig:option:`CONFIG_SEGGER_DEBUGMON`. -2. Attach the debugger to the application. -3. Depending on debugger you are using, enable monitor-mode debugging: + .. group-tab:: Command line - * For nRF Debug in |nRFVSC|, enter ``-exec monitor exec SetMonModeDebug=1`` in the debug console. - * For debugging using Ozone, enter ``Exec.Command("SetMonModeDebug = 1");`` in the console. + Use west with nRF Debug. + For details, see the :ref:`Debugging with west debug ` section on the :ref:`zephyr:west-build-flash-debug` page in the Zephyr documentation. -For more information about monitor-mode debugging, see Zephyr's :ref:`zephyr:debugmon` documentation and SEGGER's `Monitor-mode Debugging `_ documentation. +.. note:: + For hands-on tutorials on debugging and troubleshooting applications in the |NCS|, see `Lesson 2 - Debugging and troubleshooting`_ in the `nRF Connect SDK Intermediate course`_ in the Nordic Developer Academy. Debug configuration ******************* @@ -73,11 +41,11 @@ You can also set these options to ``y`` manually. There are many more Kconfig options for debugging that are specific to different modules. For details, see the respective documentation pages of the modules. -Debug build types -================= +Debug suffixes and build types +============================== -Some applications and samples provide a specific build type that enables additional debug functionalities. -You can select build types when you are :ref:`configuring the build settings `. +Some applications and samples provide a specific configuration that enables additional debug functionalities, either as :ref:`file suffixes ` or :ref:`app_build_additions_build_types`. +You can select custom configurations when you are :ref:`configuring the build settings `. Debug logging ============= @@ -115,15 +83,92 @@ Read the Stack Overflows section on the :ref:`zephyr:fatal` page in the Zephyr d You can also use a separate module to make sure that the stack sizes used by your application are big enough to avoid stack overflows. One of such modules is for example Zephyr's :ref:`zephyr:thread_analyzer`. -Debug tools -*********** +Debugging multi-core SoCs +************************* -The main recommended tool for debugging in the |NCS| is `nRF Debug `_ of the |nRFVSC|. -The tool uses `Microsoft's debug adaptor`_ and integrates custom debugging features specific for the |NCS|. +If you use a multi-core SoC, for example from the nRF53 Series, and you only wish to debug the application core firmware, a single debug session is sufficient. +To debug the firmware running on the network core, you need to set up two separate debug sessions: one for the network core and one for the application core. +When debugging the network core, the application core debug session runs in the background and you can debug both cores if needed. + +Complete the following steps to start debugging the network core: + +1. Set up sessions for the application core and network core as mentioned in the `How to debug applications for a multi-core System on Chip`_ section in the |nRFVSC| documentation. +#. Select the appropriate CPU for debugging in each session, corresponding to the application core and the network core of your SoC, respectively. +#. Once both sessions are established, execute the code on the application core. + + The startup code releases the ``NETWORK.FORCEOFF`` signal to start the network core and allocates the necessary GPIO pins for it. +#. Start code execution on the network core in the other debug session. + +If you want to reset the network core while debugging, make sure to first reset the application core and execute the code. -* When working with the |nRFVSC|, use nRF Debug after adding the required Kconfig options to the :file:`prj.conf` file. -* If you are working from the command line, you can use west with nRF Debug. - For details, read the :ref:`Debugging with west debug ` section on the :ref:`zephyr:west-build-flash-debug` page in the Zephyr documentation. +.. _debugging_spe_nspe: + +Debugging secure and non-secure firmware +**************************************** + +When using a :ref:`build target ` with :ref:`CMSE enabled ` (``_ns``), by default you can only debug firmware in the non-secure environment of the application core firmware. + +To debug firmware running in the secure environment, you need to build Trusted Firmware-M with debug symbols enabled and load the symbols during the debugging session. +To build Trusted Firmware-M with debug symbols, set the :kconfig:option:`CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO` Kconfig option. + +nRF Debug in the |nRFVSC| automatically loads the Trusted Firmware-M debug symbols. + +Enabling non-halting debugging with Cortex-M Debug Monitor +********************************************************** + +The debugging process can run in two modes. +The halt-mode debugging stops the CPU when a debug request occurs. +The monitor-mode debugging lets a CPU debug parts of an application while crucial functions continue. +Unlike halt-mode, the monitor-mode is useful for scenarios like PWM motor control or Bluetooth, where halting the entire application is risky. +The CPU takes debug interrupts, running a monitor code for J-Link communication and user-defined functions. + +Use the following steps to enable monitor-mode debugging in the |NCS|: + +1. In the application configuration file, set the Kconfig options :kconfig:option:`CONFIG_CORTEX_M_DEBUG_MONITOR_HOOK` and :kconfig:option:`CONFIG_SEGGER_DEBUGMON`. +2. Attach the debugger to the application. +3. Depending on debugger you are using, enable monitor-mode debugging: + + * For nRF Debug in the |nRFVSC|, enter ``-exec monitor exec SetMonModeDebug=1`` in the debug console. + * For debugging using Ozone, enter ``Exec.Command("SetMonModeDebug = 1");`` in the console. + +For more information about monitor-mode debugging, see Zephyr's :ref:`zephyr:debugmon` documentation and SEGGER's `Monitor-mode Debugging `_ documentation. -A useful tool for debugging the communication over Bluetooth and mesh networking protocols, such as :ref:`ug_thread` or :ref:`ug_zigbee`, is the `nRF Sniffer for 802.15.4`_. -The nRF Sniffer allows you to look into data exchanged over-the-air between devices. +.. _debugging_tools: + +Debugging tools +*************** + +In addition to nRF Debug, you can use several other standalone tools to debug the |NCS| applications. + +The following debugging tools are most commonly used in different areas of the |NCS|: + +.. list-table:: Most common debugging tools in the |NCS| + :header-rows: 1 + + * - Tool + - Purpose + - Area + * - `nRF Connect Bluetooth Low Energy`_ + - Configure and test Bluetooth Low Energy devices. Available from `nRF Connect for Desktop`_. + - :ref:`ug_bt` + * - `Cellular Monitor`_ + - Capture and analyze modem traces to evaluate communication and view network parameters. Available from `nRF Connect for Desktop`_. + - :ref:`ug_lte` + * - `nRF Connect Direct Test Mode`_ + - Perform RF PHY checks of Bluetooth Low Energy devices using a GUI for the Bluetooth-specified Direct Test Mode. Available from `nRF Connect for Desktop`_. + - :ref:`ug_bt` + * - `nRF Connect Power Profiler`_ + - Measure the real-time power consumption of your designs. Available from `nRF Connect for Desktop`_. + - :ref:`ug_bt`, :ref:`ug_lte`, :ref:`ug_matter`, :ref:`ug_thread`, :ref:`ug_wifi`, :ref:`ug_zigbee` + * - `Online Power Profiler (OPP)`_ + - Calculate the current consumption online. + - :ref:`ug_bt`, :ref:`ug_lte`, :ref:`ug_wifi` + * - `nRF Sniffer for 802.15.4`_ + - Debug the communication over networking protocols by look into data exchanged over-the-air between devices. + - :ref:`ug_bt_mesh`, :ref:`ug_matter`, :ref:`ug_thread`, :ref:`ug_zigbee` + * - `nRF Sniffer for Bluetooth LE`_ + - Debug Bluetooth packets that are sent between a selected Bluetooth Low Energy device and the device it is communicating with, even when the connection is encrypted. Available from `nRF Util`_. + - :ref:`ug_bt`, :ref:`ug_matter` + * - `nRF Thread Topology Monitor`_ + - Visualize Thread mesh network topology in real time. + - :ref:`ug_thread` diff --git a/doc/nrf/test_and_optimize/optimizing/power_general.rst b/doc/nrf/test_and_optimize/optimizing/power_general.rst index 3881553750f8..a6aa3f3f121c 100644 --- a/doc/nrf/test_and_optimize/optimizing/power_general.rst +++ b/doc/nrf/test_and_optimize/optimizing/power_general.rst @@ -42,7 +42,7 @@ Disable serial logging Current measurements on devices that have the |NCS| samples or applications programmed with the default configuration, might show elevated current values, when compared to the expected current values from Nordic ultra-low power SoCs. It is because most of the samples and applications in the |NCS| are configured to perform logging over serial port (associated with UART(E) peripheral) by default. -As an example, the image below shows the power measurement output on Power Profiler Kit II for an nRF9160 DK with the :zephyr:code-sample:`blinky` sample compiled for the ``nrf9160dk_nrf9160_ns`` build target without modifications in the sample configuration. +As an example, the image below shows the power measurement output on Power Profiler Kit II for an nRF9160 DK with the :zephyr:code-sample:`blinky` sample compiled for the ``nrf9160dk/nrf9160/ns`` build target without modifications in the sample configuration. .. figure:: images/app_power_opt_blinky_serial_on.png :width: 100 % @@ -61,9 +61,9 @@ To disable serial output, you must change the project configuration associated w See :ref:`ug_nrf5340` and :ref:`ug_multi_image`. 1. Set the project configuration :kconfig:option:`CONFIG_SERIAL` to ``n`` irrespective of whether you are building the sample for the :ref:`SPE-only ` build targets or build targets with :ref:`NSPE `. -#. For the build target with NSPE (for example, ``nrf9160dk_nrf9160_ns``), ensure that serial logging is also disabled in Trusted Firmware-M by setting :kconfig:option:`CONFIG_TFM_LOG_LEVEL_SILENCE` to ``y``. +#. For the build target with NSPE (for example, ``nrf9160dk/nrf9160/ns``), ensure that serial logging is also disabled in Trusted Firmware-M by setting :kconfig:option:`CONFIG_TFM_LOG_LEVEL_SILENCE` to ``y``. -The output on Power Profiler Kit II shows the power consumption on an nRF9160 DK with the sample compiled for the ``nrf9160dk_nrf9160_ns`` build target with ``CONFIG_SERIAL=n``. +The output on Power Profiler Kit II shows the power consumption on an nRF9160 DK with the sample compiled for the ``nrf9160dk/nrf9160/ns`` build target with ``CONFIG_SERIAL=n``. .. figure:: images/app_power_opt_blink_serial_off.png :width: 100 % @@ -75,7 +75,7 @@ The average current reduces to 6 µA, which implies 9.5 years of battery life on For a similar configuration, see the :ref:`udp` sample, which transmits UDP packets to an LTE network using an nRF91 Series DK. You can use the sample to characterize the current consumption of the nRF91 Series SiP. -It is optimized for low power operation on the ``nrf9160dk_nrf9160_ns`` or ``nrf9161dk_nrf9161_ns`` build target without any modifications. +It is optimized for low power operation on the ``nrf9160dk/nrf9160/ns`` or ``nrf9161dk/nrf9161/ns`` build target without any modifications. Verify idle current due to other peripherals ============================================ diff --git a/doc/nrf/test_and_optimize/test_framework/index.rst b/doc/nrf/test_and_optimize/test_framework/index.rst new file mode 100644 index 000000000000..74b25a46a1eb --- /dev/null +++ b/doc/nrf/test_and_optimize/test_framework/index.rst @@ -0,0 +1,21 @@ +.. _test_framework: + +Test framework +############## + +The |NCS| provides support for writing tests using the following methods: + +* Zephyr's native :ref:`zephyr:test-framework` (Ztest). + This framework has features specific to the Zephyr RTOS, such as test scaffolding and setup or teardown functions. + Ztest in the |NCS| by :ref:`crypto_test`, which you can check as reference. +* The |NCS|'s framework based on Unity and CMock. + Read :ref:`ug_unity_testing` for more information. + +You can run these tests using either west or Twister, as described in :ref:`running_unit_tests`. + +.. toctree:: + :maxdepth: 2 + :caption: Subpages: + + testing_unity_cmock + running_unit_tests diff --git a/doc/nrf/test_and_optimize/test_framework/running_unit_tests.rst b/doc/nrf/test_and_optimize/test_framework/running_unit_tests.rst new file mode 100644 index 000000000000..88cadea0e276 --- /dev/null +++ b/doc/nrf/test_and_optimize/test_framework/running_unit_tests.rst @@ -0,0 +1,97 @@ +.. _running_unit_tests: + +Running unit tests +################## + +Both Zephyr and the |NCS| support running unit tests using the following methods: + +* :ref:`Twister ` - A test runner tool that is part of Zephyr, used for automating the execution of test cases. + It can be used for both continuous integration and local testing, and it supports running tests on multiple platforms, including actual hardware devices, emulated platforms, and simulated environments. + It can also be used to generate code coverage reports. +* :ref:`zephyr:west` - Which lets you build and run one specific unit test. + This feature of west uses Twister under the hood. + +In either case, to run the unit test, you must navigate to the test directory that includes the :file:`testcase.yaml` file. +This file includes information about available tests, their parameters, hardware requirements or dependencies, platform subsets, among others. +For more information about these files, read the Test Cases section in :ref:`Zephyr's documentation about Twister `. + +Because Twister is part of Zephyr, you need to provide the ```` to Zephyr SDK repository that was included in your |NCS| installation (in the step :ref:`cloning_the_repositories`). + +To generate the test project and run the unit tests, locate the directory with the :file:`testcase.yaml` file and run the following command: + +.. tabs:: + + .. group-tab:: Twister (Windows) + + .. code-block:: console + + /scripts/twister -T . + + This command will generate the test project and run it for :ref:`zephyr:native_sim` and ``qemu_cortex_m3`` boards. + If you want to specify a build target, use the ``-p `` parameter. + For example, to run the unit test on ``qemu_cortex_m3``, use the following command: + + .. code-block:: console + + /scripts/twister -T . -p qemu_cortex_m3 + + .. group-tab:: Twister (Linux) + + .. code-block:: console + + /scripts/twister -T . + + This command will generate the test project and run it for :ref:`zephyr:native_sim` and ``qemu_cortex_m3`` boards. + If you want to specify a build target, use the ``-p `` parameter. + For example, to run the unit test on ``qemu_cortex_m3``, use the following command: + + .. code-block:: console + + /scripts/twister -T . -p qemu_cortex_m3 + + .. group-tab:: west + + .. code-block:: console + + west build -b -t run + + The ``-t run`` parameter tells west to run the default test target. + For example, to run the unit test on :ref:`zephyr:native_sim` board, use the following command: + + .. code-block:: console + + west build -b native_sim -t run + +.. _running_unit_tests_example_nrf9160: + +Example: Running the unit tests on the nRF9160 DK +************************************************* + +The :ref:`asset_tracker_v2` application provides :ref:`asset_tracker_unit_test` for several of its modules. +To run the unit test for the :ref:`asset_tracker_v2_debug_module`, complete the following steps: + +1. |connect_kit| + Take note of the serial port where you receive logs from the DK (this will be ``serial_port`` in the following command). +#. Navigate to :file:`asset_tracker_v2/tests/debug_module`, where the :file:`testcase.yaml` is located. + If you check this file, it includes ``nrf9160dk/nrf9160/ns`` in the ``platform_allow:`` entry. +#. Enter the following command to execute the unit tests on nRF9160 DK: + + .. tabs:: + + .. group-tab:: Twister (Windows) + + .. code-block:: console + + /scripts/twister -T . -p nrf9160dk/nrf9160/ns --device-testing --device-serial + + .. group-tab:: Twister (Linux) + + .. code-block:: console + + /scripts/twister -T . -p nrf9160dk/nrf9160/ns --device-testing --device-serial + + .. group-tab:: west + + .. code-block:: console + + west build -b nrf9160dk/nrf9160/ns -t run diff --git a/doc/nrf/test_and_optimize/test_framework/testing_unity_cmock.rst b/doc/nrf/test_and_optimize/test_framework/testing_unity_cmock.rst new file mode 100644 index 000000000000..d81d44314255 --- /dev/null +++ b/doc/nrf/test_and_optimize/test_framework/testing_unity_cmock.rst @@ -0,0 +1,49 @@ +.. _ug_unity_testing: + +Writing tests with Unity and CMock +################################## + +.. contents:: + :local: + :depth: 2 + +The |NCS| provides support for writing tests using Unity and CMock. +`Unity`_ is a C unit test framework. +`CMock`_ is a framework for generating mocks based on a header API. +Support for CMock is integrated into Unity. + +CMake automatically generates the required test runner file and the mock files. +The test can be executed on the :ref:`zephyr:native_sim` board. +For more information, see :ref:`running_unit_tests`. + +Setting up a unit test +********************** + +An example for a unit test can be found in :file:`tests/unity/example_test`. +The file `tests/unity/example_test/CMakeLists.txt`_ shows how to set up the generation of the test runner file and mocks. + +To run the unit test, enable the Unity module (:kconfig:option:`CONFIG_UNITY`) and the module under test. +The module under test and all dependencies are enabled and compiled into the binary, even the mocked modules. + +The linker replaces all calls to the mocked API with a mock implementation using the wrapping feature. +For example, :code:`-Wl,--wrap=foo` replaces every call to :code:`foo()` with a call to :code:`__cmock_foo()`. +Because of that, all mock functions are prefixed with :code:`__cmock` (for example, :code:`__cmock_foo_Expect()` instead of :code:`foo_Expect()`). + +To specify the APIs that should be mocked in a given test, edit :file:`CMakeLists.txt` to call :code:`cmock_handle` with the header file and, optionally, the relative path to the header as arguments. +The relative path is needed if a file is included as, for example, :code:`#include `. +In this case, the relative path is ``zephyr/bluetooth``. + +Add a line similar to the following in :file:`CMakeLists.txt` to generate the mock files: + +.. code-block:: + + cmock_handle(${ZEPHYR_BASE}/include/bluetooth/gatt.h zephyr/bluetooth) + +The test runner file must be generated from the file that contains the tests. +Unity treats all functions that are prefixed with ``test_`` as tests. + +Add a line similar to the following in :file:`CMakeLists.txt` to generate the test runner file: + +.. code-block:: + + test_runner_generate(src/example_test.c) diff --git a/doc/nrf/test_and_optimize/testing_unity_cmock.rst b/doc/nrf/test_and_optimize/testing_unity_cmock.rst deleted file mode 100644 index e82dfbffbcd9..000000000000 --- a/doc/nrf/test_and_optimize/testing_unity_cmock.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. _ug_unity_testing: - -Testing with Unity and CMock -############################ - -.. contents:: - :local: - :depth: 2 - -The |NCS| provides support for writing unit tests using Unity and CMock. -`Unity`_ is a C unit test framework. -`CMock`_ is a framework for generating mocks based on a header API. -Support for CMock is integrated into Unity. - -CMake automatically generates the required test runner file and the mock files. -The test can be executed on the :ref:`zephyr:native_posix` board. - -Setting up a unit test -********************** - -An example for a unit test can be found in :file:`tests/unity/example_test`. -The file `tests/unity/example_test/CMakeLists.txt`_ shows how to set up the generation of the test runner file and mocks. - -To run the unit test, enable the Unity module (:kconfig:option:`CONFIG_UNITY`) and the module under test. -The module under test and all dependencies are enabled and compiled into the binary, even the mocked modules. - -The linker replaces all calls to the mocked API with a mock implementation using the wrapping feature. -For example, :code:`-Wl,--wrap=foo` replaces every call to :code:`foo()` with a call to :code:`__cmock_foo()`. -Because of that, all mock functions are prefixed with :code:`__cmock` (for example, :code:`__cmock_foo_Expect()` instead of :code:`foo_Expect()`). - -To specify the APIs that should be mocked in a given test, edit :file:`CMakeLists.txt` to call :code:`cmock_handle` with the header file and, optionally, the relative path to the header as arguments. -The relative path is needed if a file is included as, for example, :code:`#include `. -In this case, the relative path is ``bluetooth``. - -Add a line similar to the following in :file:`CMakeLists.txt` to generate the mocks:: - - cmock_handle(${ZEPHYR_BASE}/include/bluetooth/gatt.h bluetooth) - -The test runner file must be generated from the file that contains the tests. -Unity treats all functions that are prefixed with ``test_`` as tests. - -Add a line similar to the following in :file:`CMakeLists.txt` to generate the test runner file:: - - test_runner_generate(src/example_test.c) - -Running the test -**************** - -Enter the following command to generate the test project (including the test runner file and the mocks) and run it:: - - west build -b native_posix -t run diff --git a/doc/nrfxlib/conf.py b/doc/nrfxlib/conf.py index 24677261ec2d..7540448e8506 100644 --- a/doc/nrfxlib/conf.py +++ b/doc/nrfxlib/conf.py @@ -26,7 +26,7 @@ project = "nrfxlib" copyright = "2019-2024, Nordic Semiconductor" author = "Nordic Semiconductor" -version = release = "2.6.0" +version = release = "2.6.99" sys.path.insert(0, str(ZEPHYR_BASE / "doc" / "_extensions")) sys.path.insert(0, str(NRF_BASE / "doc" / "_extensions")) diff --git a/doc/requirements.txt b/doc/requirements.txt index 06c80190f9e2..673c0bb89c4c 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -8,6 +8,7 @@ # Extension | NCS | Kconfig | Matter | MCUboot | nrfx | nrfxlib | TF-M | Zephyr | azure-storage-blob # | X | | | | | | | | breathe # | X | | | | | X | | X | +doxmlparser # | | | | | | | | X | m2r2 # | | | | | X | | | | PyYAML # | X | | | | | | | X | pykwalify # | | | | | | | | X | diff --git a/doc/versions.json b/doc/versions.json index 6e200c42220e..a56c8224e6f1 100644 --- a/doc/versions.json +++ b/doc/versions.json @@ -1,5 +1,9 @@ [ + "2.6.99", + "2.6.99-cs1", + "2.6.1", "2.6.0", + "2.5.3", "2.5.2", "2.5.1", "2.5.0", diff --git a/doc/zephyr/conf.py b/doc/zephyr/conf.py index ea875159d19a..6d6533f8b1e3 100644 --- a/doc/zephyr/conf.py +++ b/doc/zephyr/conf.py @@ -34,10 +34,12 @@ sys.path.insert(0, str(NRF_BASE / "doc" / "_extensions")) +extensions.remove("sphinx_sitemap") extensions = ["sphinx.ext.intersphinx"] + extensions # Options for HTML output ------------------------------------------------------ +html_additional_pages = {} html_theme = "sphinx_ncs_theme" html_theme_path = [] html_favicon = None diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index 8d8825da943c..c2eccf55ba7e 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -14,4 +14,5 @@ endif() add_subdirectory(hw_cc3xx) add_subdirectory(entropy) add_subdirectory(serial) +add_subdirectory(flash) add_subdirectory_ifdef(CONFIG_WIFI wifi) diff --git a/drivers/Kconfig b/drivers/Kconfig index f9c59391b052..bf7a9e626ec8 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -13,6 +13,7 @@ rsource "net/Kconfig" rsource "sensor/Kconfig" rsource "serial/Kconfig" rsource "wifi/Kconfig" +rsource "flash/Kconfig" if MPSL && !MPSL_FEM_ONLY rsource "mpsl/Kconfig" diff --git a/drivers/flash/CMakeLists.txt b/drivers/flash/CMakeLists.txt new file mode 100644 index 000000000000..db62b6103a07 --- /dev/null +++ b/drivers/flash/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +add_subdirectory_ifdef(CONFIG_FLASH_RPC flash_rpc) diff --git a/drivers/flash/Kconfig b/drivers/flash/Kconfig new file mode 100644 index 000000000000..58c8a04fb738 --- /dev/null +++ b/drivers/flash/Kconfig @@ -0,0 +1,62 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config FLASH_RPC + bool "Flash over RPC [EXPERIMENTAL]" + select NRF_RPC + select NRF_RPC_CBOR + select FLASH + + help + Enables a seralized flash API of a device's flash over RPC + +if FLASH_RPC + +choice + prompt "Flash RPC role selection" + default FLASH_RPC_HOST if SOC_NRF5340_CPUNET + default FLASH_RPC_CONTROLLER + +config FLASH_RPC_CONTROLLER + bool "Flash RPC Controller" + help + Flash RPC API will use the nRF RPC library to access the flash of a host + on the remote core. All the buffers transferred under read/write flash + API calls needs to be accessible for the remote host. + +config FLASH_RPC_HOST + bool "Flash RPC Host" + help + Flash RPC API will expose the flash of a host to a client on the remote core. +endchoice + +if FLASH_RPC_CONTROLLER + +config FLASH_RPC_DRIVER_INIT_PRIORITY + int "Flash RPC Driver Init Priority" + default 52 + help + Device driver initialization priority for Remote Core Flash driver over RPC + must be higher than remote core boot priority. +endif + +config FLASH_RPC_SYS_INIT_PRIORITY + int "Init priority" + default 48 if FLASH_RPC_HOST + default 51 + help + Device driver initialization priority. + +config FLASH_RPC_SYS_INIT + bool "Enable at sys init" + help + SYS_INIT nrf_rpc + +module = FLASH_RPC +module-str = Flash over nRF RPC +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif # FLASH_RPC diff --git a/drivers/flash/flash_rpc/CMakeLists.txt b/drivers/flash/flash_rpc/CMakeLists.txt new file mode 100644 index 000000000000..0562129ff753 --- /dev/null +++ b/drivers/flash/flash_rpc/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +zephyr_library() +zephyr_library_sources_ifdef(CONFIG_FLASH_RPC_SYS_INIT flash_rpc_common.c) +zephyr_library_sources_ifdef(CONFIG_FLASH_RPC_HOST flash_rpc_host.c) +zephyr_library_sources_ifdef(CONFIG_FLASH_RPC_CONTROLLER flash_rpc_controller.c) diff --git a/drivers/flash/flash_rpc/flash_rpc_common.c b/drivers/flash/flash_rpc/flash_rpc_common.c new file mode 100644 index 000000000000..d52e6316bdb8 --- /dev/null +++ b/drivers/flash/flash_rpc/flash_rpc_common.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(FLASH_RPC, CONFIG_FLASH_RPC_LOG_LEVEL); + +static void err_handler(const struct nrf_rpc_err_report *report) +{ + LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details.", + report->code); + k_oops(); +} + +static int serialization_init(void) +{ + int err; + + err = nrf_rpc_init(err_handler); + if (err) { + LOG_ERR("Initializing nRF RPC failed: %d", err); + return -EINVAL; + } + + return 0; +} + +SYS_INIT(serialization_init, POST_KERNEL, CONFIG_FLASH_RPC_SYS_INIT_PRIORITY); diff --git a/drivers/flash/flash_rpc/flash_rpc_controller.c b/drivers/flash/flash_rpc/flash_rpc_controller.c new file mode 100644 index 000000000000..105e6e9d1f03 --- /dev/null +++ b/drivers/flash/flash_rpc/flash_rpc_controller.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#ifndef CONFIG_FLASH_RPC_SYS_INIT +LOG_MODULE_REGISTER(FLASH_RPC, CONFIG_FLASH_RPC_LOG_LEVEL); +#else +LOG_MODULE_DECLARE(FLASH_RPC, CONFIG_FLASH_RPC_LOG_LEVEL); +#endif + +#define CBOR_BUF_FLASH_MSG_SIZE (sizeof(void *) + sizeof(size_t) + sizeof(off_t) + 32) + +NRF_RPC_IPC_TRANSPORT(flash_rpc_api_tr, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "flash_rpc_api_ept"); +NRF_RPC_GROUP_DEFINE(flash_rpc_api, "flash_rpc_api", &flash_rpc_api_tr, NULL, NULL, NULL); + +#if DT_NODE_HAS_STATUS(DT_INST(0, nordic_rpc_flash_controller), okay) +#define DT_DRV_COMPAT nordic_rpc_flash_controller +#else +#error "Node is not available" +#endif + +#define FLASH_RPC_CONTROLLER_NODE DT_INST(0, nordic_rpc_flash_controller) +#define FLASH_RPC_NODE DT_INST_CHILD(0, flash_rpc_0) +#define FLASH_RPC_FLASH_SIZE DT_REG_SIZE(FLASH_RPC_NODE) +#define FLASH_RPC_ERASE_UNIT DT_PROP(FLASH_RPC_NODE, erase_block_size) +#define FLASH_RPC_PROG_UNIT DT_PROP(FLASH_RPC_NODE, write_block_size) +#define FLASH_RPC_FLASH_SIZE DT_REG_SIZE(FLASH_RPC_NODE) + +#define FLASH_RPC_PAGE_COUNT (FLASH_RPC_FLASH_SIZE/FLASH_RPC_ERASE_UNIT) + +static const struct flash_parameters flash_rpc_parameters = { + .write_block_size = FLASH_RPC_PROG_UNIT, + .erase_value = 0xff, +}; + +static void flash_rpc_get_rsp(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, + void *handler_data) +{ + int *result = (int *)handler_data; + + if (!zcbor_int32_decode(ctx->zs, result)) { + LOG_ERR("Unable to decode result"); + *result = -EINVAL; + } +} + +static bool encode_flash_msg(struct nrf_rpc_cbor_ctx *ctx, off_t *offset, void *ptr, size_t *len) +{ + NRF_RPC_CBOR_ALLOC(&flash_rpc_api, *ctx, CBOR_BUF_FLASH_MSG_SIZE); + + if (!zcbor_uint32_put(ctx->zs, (uint32_t)*offset)) { + return false; + } + if (!zcbor_uint32_put(ctx->zs, (uint32_t)ptr)) { + return false; + } + if (!zcbor_uint32_put(ctx->zs, (uint32_t)*len)) { + return false; + } + + return true; +} + +#ifndef CONFIG_FLASH_RPC_SYS_INIT +static void err_handler(const struct nrf_rpc_err_report *report) +{ + LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details.", + report->code); + k_oops(); +} +#endif + +int flash_rpc_init(const struct device *dev) +{ + int err; + int result; + struct nrf_rpc_cbor_ctx ctx; + const struct rpc_flash_config *dev_config = dev->config; + + ARG_UNUSED(dev_config); + +#ifndef CONFIG_FLASH_RPC_SYS_INIT + err = nrf_rpc_init(err_handler); + if (err) { + LOG_ERR("Initializing nRF RPC failed: %d", err); + return -EINVAL; + } +#endif + + NRF_RPC_CBOR_ALLOC(&flash_rpc_api, ctx, CBOR_BUF_FLASH_MSG_SIZE); + + err = nrf_rpc_cbor_cmd(&flash_rpc_api, RPC_COMMAND_FLASH_INIT, &ctx, + flash_rpc_get_rsp, &result); + if (err != 0) { + LOG_ERR("Could not send RPC command: %d", err); + return err; + } + + return result; +} + +int flash_rpc_read(const struct device *dev, off_t offset, void *buffer, size_t len) +{ + ARG_UNUSED(dev); + int err; + int result; + struct nrf_rpc_cbor_ctx ctx; + + if (len == 0) { + return 0; + } + + if (buffer == NULL) { + return -EINVAL; + } + + if (!encode_flash_msg(&ctx, &offset, buffer, &len)) { + LOG_ERR("Could not encode flash_rpc message"); + return -EMSGSIZE; + } + + LOG_DBG("buffer_ptr: %p offset: 0x%"PRIu32", size: %"PRIx32, buffer, (uint32_t)offset, len); + + err = nrf_rpc_cbor_cmd(&flash_rpc_api, RPC_COMMAND_FLASH_READ, &ctx, + flash_rpc_get_rsp, &result); + if (err) { + LOG_ERR("Failed to send RPC read command: %d", err); + return -EIO; + } + + return result; +} + +int flash_rpc_write(const struct device *dev, off_t offset, const void *data, size_t len) +{ + ARG_UNUSED(dev); + int err; + int result; + struct nrf_rpc_cbor_ctx ctx; + + if (len == 0) { + return 0; + } + + if (data == NULL) { + return -EINVAL; + } + + if (!encode_flash_msg(&ctx, &offset, (void *)data, &len)) { + return -EMSGSIZE; + } + + err = nrf_rpc_cbor_cmd(&flash_rpc_api, RPC_COMMAND_FLASH_WRITE, &ctx, + flash_rpc_get_rsp, &result); + + LOG_DBG("data_ptr: %p offset: 0x%"PRIu32", size: %"PRIx32, data, (uint32_t)offset, len); + if (err) { + LOG_ERR("Failed to send RPC write command: %d", err); + return -EIO; + } + + return result; +} + +int flash_rpc_erase(const struct device *dev, off_t offset, size_t size) +{ + ARG_UNUSED(dev); + int err; + int result; + + struct nrf_rpc_cbor_ctx ctx; + + if (!encode_flash_msg(&ctx, &offset, NULL, &size)) { + return -EMSGSIZE; + } + + err = nrf_rpc_cbor_cmd(&flash_rpc_api, RPC_COMMAND_FLASH_ERASE, &ctx, + flash_rpc_get_rsp, &result); + if (err) { + LOG_ERR("Failed to send command: %d", err); + return -EIO; + } + + return result; +} + +static const struct flash_parameters *flash_rpc_get_parameters(const struct device *dev) +{ + ARG_UNUSED(dev); + + return &flash_rpc_parameters; +} + +#ifdef CONFIG_FLASH_PAGE_LAYOUT +static const struct flash_pages_layout flash_rpc_pages_layout = { + .pages_count = FLASH_RPC_PAGE_COUNT, + .pages_size = FLASH_RPC_ERASE_UNIT, +}; + +static void flash_rpc_page_layout(const struct device *dev, + const struct flash_pages_layout **layout, + size_t *layout_size) +{ + *layout = &flash_rpc_pages_layout; + *layout_size = 1; +} +#endif + +static const struct flash_driver_api flash_driver_rpc_api = { + .read = flash_rpc_read, + .write = flash_rpc_write, + .erase = flash_rpc_erase, + .get_parameters = flash_rpc_get_parameters, +#ifdef CONFIG_FLASH_PAGE_LAYOUT + .page_layout = flash_rpc_page_layout, +#endif +}; + +DEVICE_DT_INST_DEFINE(0, flash_rpc_init, NULL, NULL, NULL, POST_KERNEL, + CONFIG_FLASH_RPC_DRIVER_INIT_PRIORITY, &flash_driver_rpc_api); diff --git a/drivers/flash/flash_rpc/flash_rpc_host.c b/drivers/flash/flash_rpc/flash_rpc_host.c new file mode 100644 index 000000000000..2c1288abb338 --- /dev/null +++ b/drivers/flash/flash_rpc/flash_rpc_host.c @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + + +LOG_MODULE_DECLARE(FLASH_RPC, CONFIG_FLASH_RPC_LOG_LEVEL); + +#define CBOR_BUF_FLASH_MSG_SIZE (sizeof(void *) + sizeof(size_t) + sizeof(off_t)) + +NRF_RPC_IPC_TRANSPORT(flash_rpc_api_tr, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "flash_rpc_api_ept"); +NRF_RPC_GROUP_DEFINE(flash_rpc_api, "flash_rpc_api", &flash_rpc_api_tr, NULL, NULL, NULL); + +static const struct device *const flash_controller = + DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_flash_controller)); + +static bool decode_flash_msg(struct nrf_rpc_cbor_ctx *ctx, off_t *offset, void **ptr, size_t *len) +{ + uint32_t ptr_addr; + + if (!zcbor_uint32_decode(ctx->zs, (uint32_t *)offset)) { + return false; + } + if (!zcbor_uint32_decode(ctx->zs, &ptr_addr)) { + return false; + } + *ptr = (void *)ptr_addr; + if (!zcbor_uint32_decode(ctx->zs, (uint32_t *)len)) { + return false; + } + + return true; +} + +static void rsp_error_code_send(const struct nrf_rpc_group *group, int err_code) +{ + struct nrf_rpc_cbor_ctx ctx; + + NRF_RPC_CBOR_ALLOC(group, ctx, sizeof(int)); + + zcbor_int32_put(ctx.zs, err_code); + + nrf_rpc_cbor_rsp_no_err(group, &ctx); +} + +static void flash_rpc_init_handler(const struct nrf_rpc_group *group, + struct nrf_rpc_cbor_ctx *ctx, void *handler_data) +{ + ARG_UNUSED(handler_data); + nrf_rpc_cbor_decoding_done(group, ctx); + + if (!device_is_ready(flash_controller)) { + LOG_DBG("Flash RPC init failed"); + rsp_error_code_send(group, -ENODEV); + return; + } + + rsp_error_code_send(group, 0); +} + +static void flash_read_handler(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, + void *handler_data) +{ + int err; + size_t len; + off_t offset; + void *buffer = NULL; + + if (!decode_flash_msg(ctx, &offset, &buffer, &len)) { + LOG_ERR("Unable to decode flash_rpc message"); + err = -EBADMSG; + goto error_exit; + } + + LOG_DBG("buffer_ptr: %p offset: 0x%"PRIu32", size: %"PRIx32, buffer, (uint32_t)offset, len); + err = flash_read(flash_controller, offset, buffer, len); + +error_exit: + nrf_rpc_cbor_decoding_done(group, ctx); + rsp_error_code_send(group, err); +} + +static void flash_write_handler(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, + void *handler_data) +{ + int err; + off_t offset; + size_t len; + const void *data = NULL; + + if (!decode_flash_msg(ctx, &offset, (void *)&data, &len)) { + err = -EBADMSG; + goto error_exit; + } + + LOG_DBG("data_ptr: %p offset: 0x%"PRIu32", size: %"PRIx32, data, (uint32_t)offset, len); + err = flash_write(flash_controller, offset, data, len); + +error_exit: + nrf_rpc_cbor_decoding_done(group, ctx); + rsp_error_code_send(group, err); +} + +static void flash_erase_handler(const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, + void *handler_data) +{ + int err; + size_t size; + off_t offset; + void *buffer = NULL; + + if (!decode_flash_msg(ctx, &offset, &buffer, &size)) { + err = -EBADMSG; + goto error_exit; + } + + LOG_DBG("Offset: 0x%"PRIu32", size: %"PRIx32, (uint32_t)offset, size); + err = flash_erase(flash_controller, offset, size); + +error_exit: + nrf_rpc_cbor_decoding_done(group, ctx); + rsp_error_code_send(group, err); +} + +NRF_RPC_CBOR_CMD_DECODER(flash_rpc_api, flash_init, RPC_COMMAND_FLASH_INIT, + flash_rpc_init_handler, NULL); + +NRF_RPC_CBOR_CMD_DECODER(flash_rpc_api, flash_read, + RPC_COMMAND_FLASH_READ, flash_read_handler, + NULL); + +NRF_RPC_CBOR_CMD_DECODER(flash_rpc_api, flash_write, + RPC_COMMAND_FLASH_WRITE, flash_write_handler, + NULL); + +NRF_RPC_CBOR_CMD_DECODER(flash_rpc_api, flash_erase, + RPC_COMMAND_FLASH_ERASE, flash_erase_handler, + NULL); diff --git a/drivers/mpsl/flash_sync/Kconfig b/drivers/mpsl/flash_sync/Kconfig index 1ce73ac98077..87062c6a6822 100644 --- a/drivers/mpsl/flash_sync/Kconfig +++ b/drivers/mpsl/flash_sync/Kconfig @@ -4,7 +4,7 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if SOC_FLASH_NRF +if SOC_FLASH_NRF || SOC_FLASH_NRF_RRAM choice SOC_FLASH_NRF_RADIO_SYNC_CHOICE prompt "Nordic nRFx flash driver synchronization" diff --git a/drivers/sensor/bme68x_iaq/bme68x_iaq.c b/drivers/sensor/bme68x_iaq/bme68x_iaq.c index 2bbc5e07d35d..8affb5d6e11f 100644 --- a/drivers/sensor/bme68x_iaq/bme68x_iaq.c +++ b/drivers/sensor/bme68x_iaq/bme68x_iaq.c @@ -212,12 +212,12 @@ static void output_ready(const struct device *dev, const bsec_output_t *outputs, case BSEC_OUTPUT_CO2_EQUIVALENT: data->latest.co2 = (float) outputs[i].signal; data->latest.co2_accuracy = (enum bme68x_accuracy) outputs[i].accuracy; - LOG_DBG("CO2: %.2f ppm", data->latest.co2); + LOG_DBG("CO2: %.2f ppm", (double)data->latest.co2); break; case BSEC_OUTPUT_BREATH_VOC_EQUIVALENT: data->latest.voc = (float) outputs[i].signal; data->latest.voc_accuracy = (enum bme68x_accuracy) outputs[i].accuracy; - LOG_DBG("VOC: %.2f ppm", data->latest.voc); + LOG_DBG("VOC: %.2f ppm", (double)data->latest.voc); break; case BSEC_OUTPUT_STABILIZATION_STATUS: data->latest.gas_stabilizasion_status = (bool)(outputs[i].signal != 0.0f); @@ -229,15 +229,15 @@ static void output_ready(const struct device *dev, const bsec_output_t *outputs, break; case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE: data->latest.temperature = (float) outputs[i].signal; - LOG_DBG("Temp: %.2f C", data->latest.temperature); + LOG_DBG("Temp: %.2f C", (double)data->latest.temperature); break; case BSEC_OUTPUT_RAW_PRESSURE: data->latest.pressure = (float) outputs[i].signal; - LOG_DBG("Press: %.2f Pa", data->latest.pressure); + LOG_DBG("Press: %.2f Pa", (double)data->latest.pressure); break; case BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY: data->latest.humidity = (float) outputs[i].signal; - LOG_DBG("Hum: %.2f %%", data->latest.humidity); + LOG_DBG("Hum: %.2f %%", (double)data->latest.humidity); break; default: LOG_WRN("unknown bsec output id: %d", outputs[i].sensor_id); @@ -262,7 +262,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings, inputs[i].sensor_id = BSEC_INPUT_HEATSOURCE; inputs[i].signal = temp_offset; inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Temp offset: %.2f", inputs[i].signal); + LOG_DBG("Temp offset: %.2f", (double)inputs[i].signal); i++; /* append temperature input */ @@ -275,7 +275,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings, } inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Temp: %.2f", inputs[i].signal); + LOG_DBG("Temp: %.2f", (double)inputs[i].signal); i++; } if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_HUMIDITY)) { @@ -288,21 +288,21 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings, } inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Hum: %.2f", inputs[i].signal); + LOG_DBG("Hum: %.2f", (double)inputs[i].signal); i++; } if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_PRESSURE)) { inputs[i].sensor_id = BSEC_INPUT_PRESSURE; inputs[i].signal = data->pressure; inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Press: %.2f", inputs[i].signal); + LOG_DBG("Press: %.2f", (double)inputs[i].signal); i++; } if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_GASRESISTOR)) { inputs[i].sensor_id = BSEC_INPUT_GASRESISTOR; inputs[i].signal = data->gas_resistance; inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Gas: %.2f", inputs[i].signal); + LOG_DBG("Gas: %.2f", (double)inputs[i].signal); i++; } if (BSEC_INPUT_PRESENT(sensor_settings, BSEC_INPUT_PROFILE_PART)) { @@ -313,7 +313,7 @@ static size_t sensor_data_to_bsec_inputs(bsec_bme_settings_t sensor_settings, inputs[i].signal = data->gas_index; } inputs[i].time_stamp = timestamp_ns; - LOG_DBG("Profile: %.2f", inputs[i].signal); + LOG_DBG("Profile: %.2f", (double)inputs[i].signal); i++; } return i; diff --git a/drivers/wifi/nrf700x/CMakeLists.txt b/drivers/wifi/nrf700x/CMakeLists.txt index df595ef944ee..b1a758c5a1b5 100644 --- a/drivers/wifi/nrf700x/CMakeLists.txt +++ b/drivers/wifi/nrf700x/CMakeLists.txt @@ -129,11 +129,15 @@ if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP) zephyr_code_relocate(FILES src/fw_load.c LOCATION EXTFLASH_RODATA NOCOPY) endif() +zephyr_compile_definitions_ifdef(CONFIG_NRF700X_ON_QSPI # These are XIP related anomalies and aren't applicable for nRF7002 and cause # throughput issues. -zephyr_compile_definitions_ifdef(CONFIG_NRF700X_ON_QSPI -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 +# nRF70 QSPI doesn't use 192MHz clock and most samples use 128MHz, this can cause anomaly 159 +# but as its rare and not seen in most cases, we can disable it. +# Alternative is 128MHz CPU should be disabled that impacts Wi-Fi performance. + -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 ) # RPU FW patch binaries based on the selected configuration @@ -143,6 +147,8 @@ elseif(CONFIG_NRF700X_RADIO_TEST) set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/radio_test/nrf70.bin) elseif(CONFIG_NRF700X_SCAN_ONLY) set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/scan_only/nrf70.bin) +elseif (CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES) + set(NRF70_PATCH ${OS_AGNOSTIC_BASE}/fw_bins/system_with_raw/nrf70.bin) else() # Error message(FATAL_ERROR "Unsupported nRF70 patch configuration") @@ -176,10 +182,11 @@ if(CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE) ) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/zephyr/nrf70.hex COMMAND ${Python3_EXECUTABLE} - -c 'import sys\; import intelhex\; intelhex.bin2hex(sys.argv[1], sys.argv[2], int(sys.argv[3])) ' + -c "import sys; import intelhex; intelhex.bin2hex(sys.argv[1], sys.argv[2], int(sys.argv[3])) " ${NRF70_PATCH} ${CMAKE_BINARY_DIR}/zephyr/nrf70.hex $ + VERBATIM ) # Delegate merging WiFi FW patch to mcuboot because we need to merge signed hex instead of raw nrf70.hex. if(NOT CONFIG_NRF_WIFI_FW_PATCH_DFU) diff --git a/drivers/wifi/nrf700x/Kconfig b/drivers/wifi/nrf700x/Kconfig index 98ee18e6f360..de43e308d012 100644 --- a/drivers/wifi/nrf700x/Kconfig +++ b/drivers/wifi/nrf700x/Kconfig @@ -31,8 +31,9 @@ config WIFI_NRF700X_BUS_LOG_LEVEL choice NRF700X_OPER_MODES bool "nRF700x operating modes" - default NRF700X_SYSTEM_MODE if WPA_SUPP + default NRF700X_SYSTEM_MODE if WPA_SUPP && !(NRF700X_RAW_DATA_TX || NRF700X_RAW_DATA_RX || NRF700X_PROMISC_DATA_RX) default NRF700X_SCAN_ONLY if !WPA_SUPP + default NRF700X_SYSTEM_WITH_RAW_MODES help Select the operating mode of the nRF700x driver @@ -52,9 +53,15 @@ config NRF700X_SCAN_ONLY config NRF700X_RADIO_TEST bool "Radio test mode of the nRF700x driver" +config NRF700X_SYSTEM_WITH_RAW_MODES + bool "Enable nRF700X system mode with raw modes" + depends on WPA_SUPP + help + Select this option to enable system mode of the nRF700x driver with raw modes + endchoice -if NRF700X_SYSTEM_MODE +if NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES config NRF700X_STA_MODE bool "Enable nRF700X STA mode" @@ -69,27 +76,24 @@ config NRF700X_AP_MODE config NRF700X_P2P_MODE bool "Enable P2P support in driver" - -endif # NRF700X_SYSTEM_MODE - -config NRF700X_DATA_TX - bool "Enable TX data path in the driver" - default y if NRF700X_SYSTEM_MODE +endif # NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES config NRF700X_RAW_DATA_TX bool "Enable RAW TX data path in the driver" select EXPERIMENTAL - depends on NRF700X_SYSTEM_MODE config NRF700X_RAW_DATA_RX bool "Enable RAW RX sniffer operation in the driver" select EXPERIMENTAL - depends on NRF700X_SYSTEM_MODE config NRF700X_PROMISC_DATA_RX bool "Enable promiscuous RX sniffer operation in the driver" select EXPERIMENTAL - depends on NRF700X_SYSTEM_MODE + select NET_PROMISCUOUS_MODE + +config NRF700X_DATA_TX + bool "Enable TX data path in the driver" + default y if NRF700X_SYSTEM_MODE || NRF700X_SYSTEM_WITH_RAW_MODES config NRF_WIFI_IF_AUTO_START bool "Enable Wi-Fi interface auto start on boot" @@ -237,8 +241,13 @@ config NRF700X_ON_SPI def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI)) select SPI + +config NRF700X_SR_COEX + bool "Enable Wi-Fi and SR coexistence support" + def_bool $(dt_nodelabel_enabled,nrf_radio_coex) + # RF switch based coexistence -config NRF700X_RADIO_COEX +config NRF700X_SR_COEX_RF_SWITCH def_bool $(dt_nodelabel_has_prop,nrf_radio_coex,btrf-switch-gpios) config NRF700X_WORKQ_STACK_SIZE @@ -257,10 +266,6 @@ config NRF700X_UTIL depends on SHELL bool "Enable Utility shell in nRF700x driver" -config NRF700X_SR_COEX - bool "Enable Wi-Fi and SR coexistence support" - default y if SOC_NRF5340_CPUAPP_QKAA - config NRF700X_QSPI_LOW_POWER bool "Enable low power mode in QSPI" default y if NRF_WIFI_LOW_POWER @@ -301,17 +306,17 @@ config NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_HE range 0 10 config NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_DSSS - int "DSSS Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band" + int "DSSS Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band" default 0 range 0 10 config NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HT - int "HT/VHT Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band" + int "HT/VHT Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band" default 0 range 0 10 config NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HE - int "HE Transmit power backoff (in dB) for lower edge of 2.4 GHz frequency band" + int "HE Transmit power backoff (in dB) for upper edge of 2.4 GHz frequency band" default 0 range 0 10 @@ -570,6 +575,9 @@ config WIFI_NRF700X_SCAN_TIMEOUT_S int "Scan timeout in seconds" default 30 +menu "nRF Wi-Fi operation band(s)" + visible if !NRF70_2_4G_ONLY + config NRF_WIFI_2G_BAND bool "Set operation band to 2.4GHz" default y if NRF70_2_4G_ONLY @@ -588,6 +596,7 @@ config NRF_WIFI_OP_BAND 1 - 2.4GHz 2 - 5GHz 3 - All ( 2.4GHz and 5GHz ) +endmenu config NRF_WIFI_IFACE_MTU int "MTU for Wi-Fi interface" @@ -612,3 +621,11 @@ config WIFI_NRF700X_SCAN_DISABLE_DFS_CHANNELS config NET_INTERFACE_NAME_LEN # nordic_wlanN default 15 + +config NRF_WIFI_AP_DEAD_DETECT_TIMEOUT + int "Access point dead detection timeout in seconds" + range 1 30 + default 20 + help + The number of seconds after which AP is declared dead if no beacons + are received from the AP. Used to detect AP silently going down e.g., power off. diff --git a/drivers/wifi/nrf700x/inc/coex.h b/drivers/wifi/nrf700x/inc/coex.h index 1ef5aead0d82..13f3b2e0786b 100644 --- a/drivers/wifi/nrf700x/inc/coex.h +++ b/drivers/wifi/nrf700x/inc/coex.h @@ -38,7 +38,7 @@ enum nrf_wifi_pta_wlan_op_band { int nrf_wifi_coex_config_pta(enum nrf_wifi_pta_wlan_op_band wlan_band, bool separate_antennas, bool is_sr_protocol_ble); -#if defined(CONFIG_NRF700X_RADIO_COEX) || defined(__DOXYGEN__) +#if defined(CONFIG_NRF700X_SR_COEX_RF_SWITCH) || defined(__DOXYGEN__) /** * @function nrf_wifi_config_sr_switch(bool separate_antennas) * @@ -52,7 +52,7 @@ int nrf_wifi_coex_config_pta(enum nrf_wifi_pta_wlan_op_band wlan_band, bool sepa * Returns non-zero upon unsuccessful configuration. */ int nrf_wifi_config_sr_switch(bool separate_antennas); -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ /** * @function nrf_wifi_coex_config_non_pta(bool separate_antennas) diff --git a/drivers/wifi/nrf700x/inc/fmac_main.h b/drivers/wifi/nrf700x/inc/fmac_main.h index 6e2a2210e940..b567a6b5ef4d 100644 --- a/drivers/wifi/nrf700x/inc/fmac_main.h +++ b/drivers/wifi/nrf700x/inc/fmac_main.h @@ -81,6 +81,9 @@ struct nrf_wifi_vif_ctx_zep { unsigned long rssi_record_timestamp_us; signed short rssi; #endif /* CONFIG_NRF700X_STA_MODE */ +#ifdef CONFIG_NRF700X_AP_MODE + int inactive_time_sec; +#endif /* CONFIG_NRF700X_AP_MODE */ }; struct nrf_wifi_vif_ctx_map { diff --git a/drivers/wifi/nrf700x/inc/wifi_mgmt.h b/drivers/wifi/nrf700x/inc/wifi_mgmt.h index cc2ca88117c5..9e8424d43a05 100644 --- a/drivers/wifi/nrf700x/inc/wifi_mgmt.h +++ b/drivers/wifi/nrf700x/inc/wifi_mgmt.h @@ -55,7 +55,7 @@ void nrf_wifi_event_proc_get_power_save_info(void *vif_ctx, struct nrf_wifi_umac_event_power_save_info *ps_info, unsigned int event_len); -#ifdef CONFIG_NRF700X_SYSTEM_MODE +#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, struct wifi_mode_info *mode); #endif @@ -70,4 +70,6 @@ int nrf_wifi_filter(const struct device *dev, struct wifi_filter_info *filter); #endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */ +int nrf_wifi_set_rts_threshold(const struct device *dev, + unsigned int rts_threshold); #endif /* __ZEPHYR_WIFI_MGMT_H__ */ diff --git a/drivers/wifi/nrf700x/inc/wpa_supp_if.h b/drivers/wifi/nrf700x/inc/wpa_supp_if.h index ce211be20b0f..698dcf0b5acd 100644 --- a/drivers/wifi/nrf700x/inc/wpa_supp_if.h +++ b/drivers/wifi/nrf700x/inc/wpa_supp_if.h @@ -137,5 +137,6 @@ int nrf_wifi_supp_register_mgmt_frame(void *if_priv, int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, unsigned int total_flags, unsigned int flags_or, unsigned int flags_and); +int nrf_wifi_wpa_supp_sta_get_inact_sec(void *if_priv, const u8 *addr); #endif /* CONFIG_NRF700X_AP_MODE */ #endif /* __ZEPHYR_WPA_SUPP_IF_H__ */ diff --git a/drivers/wifi/nrf700x/src/coex.c b/drivers/wifi/nrf700x/src/coex.c index a4191969d407..16292f72cfca 100644 --- a/drivers/wifi/nrf700x/src/coex.c +++ b/drivers/wifi/nrf700x/src/coex.c @@ -40,11 +40,11 @@ static struct nrf_wifi_ctx_zep *rpu_ctx = &rpu_drv_priv_zep.rpu_ctx_zep; /* copied from uccp530_77_registers.h of UCCP toolkit */ #define ABS_PMB_WLAN_MAC_CTRL_PULSED_SOFTWARE_RESET 0xA5009A00UL -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH #define NRF_RADIO_COEX_NODE DT_NODELABEL(nrf_radio_coex) static const struct gpio_dt_spec sr_rf_switch_spec = GPIO_DT_SPEC_GET(NRF_RADIO_COEX_NODE, btrf_switch_gpios); -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ /* PTA registers configuration of Coexistence Hardware */ /* Separate antenna configuration, WLAN in 2.4GHz. For BLE protocol. */ @@ -229,7 +229,7 @@ int nrf_wifi_coex_config_pta(enum nrf_wifi_pta_wlan_op_band wlan_band, bool sepa return 0; } -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH int nrf_wifi_config_sr_switch(bool separate_antennas) { int ret; @@ -255,7 +255,7 @@ int nrf_wifi_config_sr_switch(bool separate_antennas) return 0; } -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ int nrf_wifi_coex_hw_reset(void) { diff --git a/drivers/wifi/nrf700x/src/fmac_main.c b/drivers/wifi/nrf700x/src/fmac_main.c index 6a2a6d0bfa02..8f50bb74ef66 100644 --- a/drivers/wifi/nrf700x/src/fmac_main.c +++ b/drivers/wifi/nrf700x/src/fmac_main.c @@ -27,6 +27,7 @@ #ifndef CONFIG_NRF700X_RADIO_TEST #ifdef CONFIG_NRF700X_STA_MODE +#include #include #include #include @@ -306,6 +307,7 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; struct nrf_wifi_fmac_reg_info reg_domain_info = {0}; struct wifi_reg_chan_info *chan_info = NULL; @@ -333,12 +335,38 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do goto err; } + fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; + if (!fmac_dev_ctx) { + LOG_ERR("%s: fmac_dev_ctx is NULL", __func__); + goto err; + } + if (reg_domain->oper == WIFI_MGMT_SET) { +#ifndef CONFIG_NRF700X_RADIO_TEST +#ifdef CONFIG_NRF700X_STA_MODE + /* Need to check if WPA supplicant is initialized or not. + * Must be checked when CONFIG_WPA_SUPP is enabled. + * Not applicable for RADIO_TEST or when CONFIG_WPA_SUPP is not enabled. + */ + /* It is possbile that during supplicant initialization driver may + * get the command. lock will try to ensure that supplicant + * initialization is complete. + */ + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + if ((!vif_ctx_zep->supp_drv_if_ctx) || + (!wifi_nm_get_instance_iface(vif_ctx_zep->zep_net_if_ctx))) { + LOG_ERR("%s: WPA supplicant initialization not complete yet", __func__); + k_mutex_unlock(&vif_ctx_zep->vif_lock); + goto err; + } + k_mutex_unlock(&vif_ctx_zep->vif_lock); +#endif /* CONFIG_NRF700X_STA_MODE */ +#endif /* !CONFIG_NRF700X_RADIO_TEST */ memcpy(reg_domain_info.alpha2, reg_domain->country_code, WIFI_COUNTRY_CODE_LEN); reg_domain_info.force = reg_domain->force; - status = nrf_wifi_fmac_set_reg(rpu_ctx_zep->rpu_ctx, ®_domain_info); + status = nrf_wifi_fmac_set_reg(fmac_dev_ctx, ®_domain_info); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: Failed to set regulatory domain", __func__); goto err; @@ -350,7 +378,7 @@ int nrf_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain *reg_do goto err; } - status = nrf_wifi_fmac_get_reg(rpu_ctx_zep->rpu_ctx, ®_domain_info); + status = nrf_wifi_fmac_get_reg(fmac_dev_ctx, ®_domain_info); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: Failed to get regulatory domain", __func__); goto err; @@ -786,8 +814,9 @@ static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = { .set_twt = nrf_wifi_set_twt, .reg_domain = nrf_wifi_reg_domain, .get_power_save_config = nrf_wifi_get_power_save_config, + .set_rts_threshold = nrf_wifi_set_rts_threshold, #endif /* CONFIG_NRF700X_STA_MODE */ -#ifdef CONFIG_NRF700X_SYSTEM_MODE +#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES .mode = nrf_wifi_mode, #endif #if defined(CONFIG_NRF700X_RAW_DATA_TX) || defined(CONFIG_NRF700X_RAW_DATA_RX) @@ -847,6 +876,7 @@ static const struct zep_wpa_supp_dev_ops wpa_supp_ops = { .sta_remove = nrf_wifi_wpa_supp_sta_remove, .register_mgmt_frame = nrf_wifi_supp_register_mgmt_frame, .sta_set_flags = nrf_wifi_wpa_supp_sta_set_flags, + .get_inact_sec = nrf_wifi_wpa_supp_sta_get_inact_sec, #endif /* CONFIG_NRF700X_AP_MODE */ }; #endif /* CONFIG_NRF700X_STA_MODE */ diff --git a/drivers/wifi/nrf700x/src/net_if.c b/drivers/wifi/nrf700x/src/net_if.c index fff1491a0908..c0ab485297bf 100644 --- a/drivers/wifi/nrf700x/src/net_if.c +++ b/drivers/wifi/nrf700x/src/net_if.c @@ -518,6 +518,20 @@ void nrf_wifi_if_init_zep(struct net_if *iface) return; } +/* Board-specific Wi-Fi startup code to run before the Wi-Fi device is started */ +__weak int nrf_wifi_if_zep_start_board(const struct device *dev) +{ + ARG_UNUSED(dev); + return 0; +} + +/* Board-specific Wi-Fi shutdown code to run after the Wi-Fi device is stopped */ +__weak int nrf_wifi_if_zep_stop_board(const struct device *dev) +{ + ARG_UNUSED(dev); + return 0; +} + int nrf_wifi_if_start_zep(const struct device *dev) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; @@ -543,6 +557,13 @@ int nrf_wifi_if_start_zep(const struct device *dev) goto out; } + ret = nrf_wifi_if_zep_start_board(dev); + if (ret) { + LOG_ERR("nrf_wifi_if_zep_start_board failed with error: %d", + ret); + goto out; + } + vif_ctx_zep = dev->data; if (!vif_ctx_zep) { @@ -768,6 +789,12 @@ int nrf_wifi_if_stop_zep(const struct device *dev) ret = 0; unlock: k_mutex_unlock(&vif_ctx_zep->vif_lock); + + ret = nrf_wifi_if_zep_stop_board(dev); + if (ret) { + LOG_ERR("nrf_wifi_if_zep_stop_board failed with error: %d", + ret); + } out: return ret; } @@ -857,21 +884,7 @@ int nrf_wifi_if_set_config_zep(const struct device *dev, goto out; } - rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; - if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { - LOG_DBG("%s: rpu_ctx_zep or rpu_ctx is NULL", - __func__); - goto unlock; - } - - fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; - def_dev_ctx = wifi_dev_priv(fmac_dev_ctx); - if (!def_dev_ctx) { - LOG_ERR("%s: def_dev_ctx is NULL", - __func__); - goto unlock; - } - + /* Commands without FMAC interaction */ if (type == ETHERNET_CONFIG_TYPE_MAC_ADDRESS) { if (!net_eth_is_addr_valid((struct net_eth_addr *)&config->mac_address)) { LOG_ERR("%s: Invalid MAC address", @@ -886,9 +899,27 @@ int nrf_wifi_if_set_config_zep(const struct device *dev, vif_ctx_zep->mac_addr.addr, sizeof(vif_ctx_zep->mac_addr.addr), NET_LINK_ETHERNET); + ret = 0; + goto unlock; + } + + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep || !rpu_ctx_zep->rpu_ctx) { + LOG_DBG("%s: rpu_ctx_zep or rpu_ctx is NULL", + __func__); + goto unlock; + } + + fmac_dev_ctx = rpu_ctx_zep->rpu_ctx; + def_dev_ctx = wifi_dev_priv(fmac_dev_ctx); + if (!def_dev_ctx) { + LOG_ERR("%s: def_dev_ctx is NULL", + __func__); + goto unlock; } + #ifdef CONFIG_NRF700X_RAW_DATA_TX - else if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) { + if (type == ETHERNET_CONFIG_TYPE_TXINJECTION_MODE) { unsigned char mode; if (def_dev_ctx->vif_ctx[vif_ctx_zep->vif_idx]->txinjection_mode == @@ -1037,6 +1068,8 @@ int nrf_wifi_stats_get(const struct device *dev, struct net_stats_wifi *zstats) zstats->broadcast.tx = stats.fw.umac.interface_data_stats.tx_broadcast_pkt_count; zstats->multicast.rx = stats.fw.umac.interface_data_stats.rx_multicast_pkt_count; zstats->multicast.tx = stats.fw.umac.interface_data_stats.tx_multicast_pkt_count; + zstats->unicast.rx = stats.fw.umac.interface_data_stats.rx_unicast_pkt_count; + zstats->unicast.tx = stats.fw.umac.interface_data_stats.tx_unicast_pkt_count; #ifdef CONFIG_NRF700X_RAW_DATA_TX def_dev_ctx = wifi_dev_priv(rpu_ctx_zep->rpu_ctx); diff --git a/drivers/wifi/nrf700x/src/qspi/inc/rpu_hw_if.h b/drivers/wifi/nrf700x/src/qspi/inc/rpu_hw_if.h index 7177ad299f5a..e3135639a6a9 100644 --- a/drivers/wifi/nrf700x/src/qspi/inc/rpu_hw_if.h +++ b/drivers/wifi/nrf700x/src/qspi/inc/rpu_hw_if.h @@ -53,7 +53,7 @@ int rpu_init(void); int rpu_enable(void); int rpu_disable(void); -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH int sr_ant_switch(unsigned int ant_switch); -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ #endif /* __RPU_HW_IF_H_ */ diff --git a/drivers/wifi/nrf700x/src/qspi/src/qspi_if.c b/drivers/wifi/nrf700x/src/qspi/src/qspi_if.c index ebee1e94de8e..841bfa01dfbe 100644 --- a/drivers/wifi/nrf700x/src/qspi/src/qspi_if.c +++ b/drivers/wifi/nrf700x/src/qspi/src/qspi_if.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -58,11 +59,11 @@ BUILD_ASSERT(INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16), * PCLK192M frequency"), but after that operation is complete, the default * divider needs to be restored to avoid increased current consumption. */ -/* Use divider /2 for HFCLK192M. */ -#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_2 +/* To prevent anomaly 159, use only divider /1 for HFCLK192M. */ +#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1 #if (INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 4)) -/* For requested SCK >= 24 MHz, use HFCLK192M / 2 / (2*2) = 24 MHz */ -#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV2 +/* For requested SCK >= 24 MHz, use HFCLK192M / 1 / (2*4) = 24 MHz */ +#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV4 #else /* For requested SCK < 24 MHz, calculate the configuration value. */ #define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ / 2, \ @@ -300,6 +301,12 @@ static inline int qspi_get_zephyr_ret_code(nrfx_err_t res) return -EINVAL; case NRFX_ERROR_INVALID_STATE: return -ECANCELED; +#if NRF53_ERRATA_159_ENABLE_WORKAROUND + case NRFX_ERROR_FORBIDDEN: + LOG_ERR("nRF5340 anomaly 159 conditions detected"); + LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation"); + return -ECANCELED; +#endif case NRFX_ERROR_BUSY: case NRFX_ERROR_TIMEOUT: default: diff --git a/drivers/wifi/nrf700x/src/qspi/src/rpu_hw_if.c b/drivers/wifi/nrf700x/src/qspi/src/rpu_hw_if.c index 2b9ec91027c7..219e09de40c4 100644 --- a/drivers/wifi/nrf700x/src/qspi/src/rpu_hw_if.c +++ b/drivers/wifi/nrf700x/src/qspi/src/rpu_hw_if.c @@ -35,11 +35,11 @@ GPIO_DT_SPEC_GET(NRF7002_NODE, iovdd_ctrl_gpios); static const struct gpio_dt_spec bucken_spec = GPIO_DT_SPEC_GET(NRF7002_NODE, bucken_gpios); -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH #define NRF_RADIO_COEX_NODE DT_NODELABEL(nrf_radio_coex) static const struct gpio_dt_spec sr_rf_switch_spec = GPIO_DT_SPEC_GET(NRF_RADIO_COEX_NODE, btrf_switch_gpios); -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ char blk_name[][15] = { "SysBus", "ExtSysBus", "PBus", "PKTRAM", "GRAM", "LMAC_ROM", "LMAC_RET_RAM", "LMAC_SRC_RAM", @@ -178,7 +178,7 @@ int rpu_irq_remove(struct gpio_callback *irq_callback_data) static int sr_gpio_config(void) { -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH int ret; if (!device_is_ready(sr_rf_switch_spec.port)) { @@ -194,12 +194,12 @@ static int sr_gpio_config(void) return ret; #else return 0; -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ } static int sr_gpio_remove(void) { -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH int ret; ret = gpio_pin_configure_dt(&sr_rf_switch_spec, GPIO_DISCONNECTED); @@ -286,12 +286,13 @@ static int rpu_pwron(void) } /* Settling time for iovdd nRF7002 DK/EK - switch (TCK106AG): ~600us */ k_msleep(1); -#ifdef CONFIG_SHIELD_NRF7002EB - /* For nRF7002 Expansion board, we need a total wait time after bucken assertion - * to be 6ms (1ms + 1ms + 4ms). - */ - k_msleep(4); -#endif /* SHIELD_NRF7002EB */ + + if (IS_ENABLED(CONFIG_SHIELD_NRF7002EB) || IS_ENABLED(CONFIG_SHIELD_NRF700X_NRF54L15PDK)) { + /* For nRF7002 Expansion board, we need a total wait time after bucken assertion + * to be 6ms (1ms + 1ms + 4ms). + */ + k_msleep(4); + } LOG_DBG("Bucken = %d, IOVDD = %d", gpio_pin_get_dt(&bucken_spec), gpio_pin_get_dt(&iovdd_ctrl_spec)); @@ -318,7 +319,7 @@ static int rpu_pwroff(void) return ret; } -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH int sr_ant_switch(unsigned int ant_switch) { int ret; @@ -331,7 +332,7 @@ int sr_ant_switch(unsigned int ant_switch) return ret; } -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ int rpu_read(unsigned int addr, void *data, int len) { diff --git a/drivers/wifi/nrf700x/src/wifi_mgmt.c b/drivers/wifi/nrf700x/src/wifi_mgmt.c index 23f0a533c3d3..99a1cde00586 100644 --- a/drivers/wifi/nrf700x/src/wifi_mgmt.c +++ b/drivers/wifi/nrf700x/src/wifi_mgmt.c @@ -732,7 +732,7 @@ void nrf_wifi_event_proc_twt_sleep_zep(void *vif_ctx, k_mutex_unlock(&vif_ctx_zep->vif_lock); } -#ifdef CONFIG_NRF700X_SYSTEM_MODE +#ifdef CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES int nrf_wifi_mode(const struct device *dev, struct wifi_mode_info *mode) { @@ -823,7 +823,7 @@ int nrf_wifi_mode(const struct device *dev, k_mutex_unlock(&vif_ctx_zep->vif_lock); return ret; } -#endif /* CONFIG_NRF700X_SYSTEM_MODE */ +#endif /* CONFIG_NRF700X_SYSTEM_WITH_RAW_MODES */ #if defined(CONFIG_NRF700X_RAW_DATA_TX) || defined(CONFIG_NRF700X_RAW_DATA_RX) int nrf_wifi_channel(const struct device *dev, @@ -948,3 +948,68 @@ int nrf_wifi_filter(const struct device *dev, return ret; } #endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */ + +int nrf_wifi_set_rts_threshold(const struct device *dev, + unsigned int rts_threshold) +{ + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + struct nrf_wifi_umac_set_wiphy_info wiphy_info; + int ret = -1; + + if (!dev) { + LOG_ERR("%s: dev is NULL", __func__); + return ret; + } + + vif_ctx_zep = dev->data; + + if (!vif_ctx_zep) { + LOG_ERR("%s: vif_ctx_zep is NULL", __func__); + return ret; + } + + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + + if (!rpu_ctx_zep) { + LOG_ERR("%s: rpu_ctx_zep is NULL", __func__); + return ret; + } + + + if (!rpu_ctx_zep->rpu_ctx) { + LOG_ERR("%s: RPU context not initialized", __func__); + return ret; + } + + if ((int)rts_threshold < -1) { + /* 0 or any positive value is passed to f/w. + * For RTS off, -1 is passed to f/w. + * All other negative values considered as invalid. + */ + LOG_ERR("%s: Invalid threshold value : %d", __func__, (int)rts_threshold); + return ret; + } + + memset(&wiphy_info, 0, sizeof(struct nrf_wifi_umac_set_wiphy_info)); + + wiphy_info.rts_threshold = (int)rts_threshold; + + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + + status = nrf_wifi_fmac_set_wiphy_params(rpu_ctx_zep->rpu_ctx, + vif_ctx_zep->vif_idx, + &wiphy_info); + + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: Configuring rts threshold failed\n", __func__); + goto out; + } + + ret = 0; +out: + k_mutex_unlock(&vif_ctx_zep->vif_lock); + + return ret; +} diff --git a/drivers/wifi/nrf700x/src/wifi_mgmt_scan.c b/drivers/wifi/nrf700x/src/wifi_mgmt_scan.c index d5476c9b068a..689144489d37 100644 --- a/drivers/wifi/nrf700x/src/wifi_mgmt_scan.c +++ b/drivers/wifi/nrf700x/src/wifi_mgmt_scan.c @@ -137,10 +137,31 @@ int nrf_wifi_disp_scan_zep(const struct device *dev, struct wifi_scan_params *pa } scan_info->scan_params.bands = params->bands; - scan_info->scan_params.dwell_time_active = params->dwell_time_active; - scan_info->scan_params.dwell_time_passive = params->dwell_time_passive; - vif_ctx_zep->max_bss_cnt = params->max_bss_cnt; + if (params->dwell_time_active < 0) { + LOG_ERR("%s: Invalid dwell_time_active %d", __func__, + params->dwell_time_active); + goto out; + } else { + scan_info->scan_params.dwell_time_active = params->dwell_time_active; + } + + if (params->dwell_time_passive < 0) { + LOG_ERR("%s: Invalid dwell_time_passive %d", __func__, + params->dwell_time_passive); + goto out; + } else { + scan_info->scan_params.dwell_time_passive = params->dwell_time_passive; + } + + if ((params->max_bss_cnt < 0) || + (params->max_bss_cnt > WIFI_MGMT_SCAN_MAX_BSS_CNT)) { + LOG_ERR("%s: Invalid max_bss_cnt %d", __func__, + params->max_bss_cnt); + goto out; + } else { + vif_ctx_zep->max_bss_cnt = params->max_bss_cnt; + } for (i = 0; i < NRF_WIFI_SCAN_MAX_NUM_SSIDS; i++) { if (!(params->ssids[i]) || !strlen(params->ssids[i])) { diff --git a/drivers/wifi/nrf700x/src/wifi_util.c b/drivers/wifi/nrf700x/src/wifi_util.c index cee09ba60795..9a3e21e5e7f5 100644 --- a/drivers/wifi/nrf700x/src/wifi_util.c +++ b/drivers/wifi/nrf700x/src/wifi_util.c @@ -178,41 +178,6 @@ static int nrf_wifi_util_set_he_ltf_gi(const struct shell *shell, return 0; } - -static int nrf_wifi_util_set_rts_threshold(const struct shell *shell, - size_t argc, - const char *argv[]) -{ - enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; - char *ptr = NULL; - unsigned long val = 0; - struct nrf_wifi_umac_set_wiphy_info wiphy_info; - - memset(&wiphy_info, 0, sizeof(struct nrf_wifi_umac_set_wiphy_info)); - - val = strtoul(argv[1], &ptr, 10); - - if (ctx->conf_params.rts_threshold != val) { - - wiphy_info.rts_threshold = val; - - status = nrf_wifi_fmac_set_wiphy_params(ctx->rpu_ctx, - 0, - &wiphy_info); - - if (status != NRF_WIFI_STATUS_SUCCESS) { - shell_fprintf(shell, - SHELL_ERROR, - "Programming threshold failed\n"); - return -ENOEXEC; - } - - ctx->conf_params.rts_threshold = val; - } - - return 0; -} - #ifdef CONFIG_NRF700X_STA_MODE static int nrf_wifi_util_set_uapsd_queue(const struct shell *shell, size_t argc, @@ -283,11 +248,6 @@ static int nrf_wifi_util_show_cfg(const struct shell *shell, "set_he_ltf_gi = %d\n", conf_params->set_he_ltf_gi); - shell_fprintf(shell, - SHELL_INFO, - "rts_threshold = %d\n", - conf_params->rts_threshold); - shell_fprintf(shell, SHELL_INFO, "uapsd_queue = %d\n", @@ -825,7 +785,9 @@ static int nrf_wifi_util_dump_rpu_stats(const struct shell *shell, "scan_complete: %u\n" "scan_abort_req: %u\n" "scan_abort_complete: %u\n" - "internal_buf_pool_null: %u\n\n", + "internal_buf_pool_null: %u\n" + "rpu_hw_lockup_count: %u\n" + "rpu_hw_lockup_recovery_done: %u\n\n", lmac->reset_cmd_cnt, lmac->reset_complete_event_cnt, lmac->unable_gen_event, @@ -860,7 +822,9 @@ static int nrf_wifi_util_dump_rpu_stats(const struct shell *shell, lmac->scan_complete, lmac->scan_abort_req, lmac->scan_abort_complete, - lmac->internal_buf_pool_null); + lmac->internal_buf_pool_null, + lmac->rpu_hw_lockup_count, + lmac->rpu_hw_lockup_recovery_done); } if (stats_type == RPU_STATS_TYPE_PHY || stats_type == RPU_STATS_TYPE_ALL) { @@ -912,12 +876,6 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_set_he_ltf_gi, 2, 0), - SHELL_CMD_ARG(rts_threshold, - NULL, - " - Value > 0", - nrf_wifi_util_set_rts_threshold, - 2, - 0), #ifdef CONFIG_NRF700X_STA_MODE SHELL_CMD_ARG(uapsd_queue, NULL, diff --git a/drivers/wifi/nrf700x/src/wpa_supp_if.c b/drivers/wifi/nrf700x/src/wpa_supp_if.c index 24a0e2074d5e..2b0ebfa2ea25 100644 --- a/drivers/wifi/nrf700x/src/wpa_supp_if.c +++ b/drivers/wifi/nrf700x/src/wpa_supp_if.c @@ -383,7 +383,7 @@ void nrf_wifi_wpa_supp_event_proc_deauth(void *if_priv, mgmt = (const struct ieee80211_mgmt *)frame; if (frame_len < 24 + sizeof(mgmt->u.deauth)) { - LOG_ERR("%s: Association response frame too short", __func__); + LOG_ERR("%s: Deauthentication frame too short", __func__); return; } @@ -419,7 +419,7 @@ void nrf_wifi_wpa_supp_event_proc_disassoc(void *if_priv, mgmt = (const struct ieee80211_mgmt *)frame; if (frame_len < 24 + sizeof(mgmt->u.disassoc)) { - LOG_ERR("%s: Association response frame too short", __func__); + LOG_ERR("%s: Disassociation frame too short", __func__); return; } @@ -457,11 +457,16 @@ void *nrf_wifi_wpa_supp_dev_init(void *supp_drv_if_ctx, const char *iface_name, return NULL; } + /* Needed to make sure that during initialization, commands like setting regdomain + * does not access it. + */ + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); vif_ctx_zep->supp_drv_if_ctx = supp_drv_if_ctx; memcpy(&vif_ctx_zep->supp_callbk_fns, supp_callbk_fns, sizeof(vif_ctx_zep->supp_callbk_fns)); + k_mutex_unlock(&vif_ctx_zep->vif_lock); return vif_ctx_zep; } @@ -516,6 +521,12 @@ int nrf_wifi_wpa_supp_scan2(void *if_priv, struct wpa_driver_scan_params *params scan_info = k_calloc(sizeof(*scan_info) + (num_freqs * sizeof(unsigned int)), sizeof(char)); + if (!scan_info) { + LOG_ERR("%s: Unable to allocate memory for scan info", __func__); + ret = -ENOMEM; + goto out; + } + memset(scan_info, 0x0, sizeof(*scan_info)); if (params->freqs) { @@ -604,7 +615,7 @@ int nrf_wifi_wpa_supp_scan_abort(void *if_priv) status = nrf_wifi_fmac_abort_scan(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx); if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: Scan trigger failed", __func__); + LOG_ERR("%s: nrf_wifi_fmac_abort_scan failed", __func__); goto out; } @@ -696,7 +707,7 @@ int nrf_wifi_wpa_supp_deauthenticate(void *if_priv, const char *addr, unsigned s status = nrf_wifi_fmac_deauth(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &deauth_info); if (status != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: nrf_wifi_fmac_scan_res_get failed", __func__); + LOG_ERR("%s: nrf_wifi_fmac_deauth failed", __func__); goto out; } @@ -1209,17 +1220,23 @@ void nrf_wifi_wpa_supp_event_proc_get_sta(void *if_priv, if (!if_priv || !info) { LOG_ERR("%s: Invalid params", __func__); - k_sem_give(&wait_for_event_sem); - return; + goto out; } + vif_ctx_zep = if_priv; - signal_info = vif_ctx_zep->signal_info; + if (!vif_ctx_zep) { + LOG_ERR("%s: vif_ctx_zep is NULL", __func__); + goto out; + } +#ifdef CONFIG_NRF700X_AP_MODE + vif_ctx_zep->inactive_time_sec = info->sta_info.inactive_time; +#endif /* CONFIG_NRF700X_AP_MODE */ + signal_info = vif_ctx_zep->signal_info; /* Semaphore timedout */ if (!signal_info) { - LOG_DBG("%s: Get station Semaphore timedout", __func__); - return; + goto out; } if (info->sta_info.valid_fields & NRF_WIFI_STA_INFO_SIGNAL_VALID) { @@ -1247,6 +1264,7 @@ void nrf_wifi_wpa_supp_event_proc_get_sta(void *if_priv, signal_info->current_txrate = info->sta_info.tx_bitrate.bitrate * 100; } } +out: k_sem_give(&wait_for_event_sem); } @@ -1859,13 +1877,13 @@ int nrf_wifi_supp_get_conn_info(void *if_priv, struct wpa_conn_info *info) vif_ctx_zep->conn_info = info; ret = nrf_wifi_fmac_get_conn_info(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx); if (ret != NRF_WIFI_STATUS_SUCCESS) { - LOG_ERR("%s: Failed to get beacon info", __func__); + LOG_ERR("%s: nrf_wifi_fmac_get_conn_info failed", __func__); goto out; } sem_ret = k_sem_take(&wait_for_event_sem, K_MSEC(RPU_RESP_EVENT_TIMEOUT)); if (sem_ret) { - LOG_ERR("%s: Failed to get station info, ret = %d", __func__, sem_ret); + LOG_ERR("%s: Timeout: failed to get connection info, ret = %d", __func__, sem_ret); ret = NRF_WIFI_STATUS_FAIL; goto out; } @@ -2277,6 +2295,32 @@ static int nrf_wifi_set_bss(struct nrf_wifi_vif_ctx_zep *vif_ctx_zep, return ret; } + +static enum nrf_wifi_chan_width wpa_supp_chan_width_to_nrf(enum hostapd_hw_mode mode, + int bandwidth, int cfreq1, int cfreq2) +{ + switch (bandwidth) { + case 20: + if (mode == HOSTAPD_MODE_IEEE80211B) { + return NRF_WIFI_CHAN_WIDTH_20_NOHT; + } else { + return NRF_WIFI_CHAN_WIDTH_20; + }; + case 40: + return NRF_WIFI_CHAN_WIDTH_40; + case 80: + if (cfreq2) { + return NRF_WIFI_CHAN_WIDTH_80P80; + } else { + return NRF_WIFI_CHAN_WIDTH_80; + } + case 160: + return NRF_WIFI_CHAN_WIDTH_160; + }; + + return NRF_WIFI_CHAN_WIDTH_20; +} + int nrf_wifi_wpa_supp_start_ap(void *if_priv, struct wpa_driver_ap_params *params) { struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; @@ -2284,6 +2328,7 @@ int nrf_wifi_wpa_supp_start_ap(void *if_priv, struct wpa_driver_ap_params *param int ret = -1; struct nrf_wifi_umac_start_ap_info start_ap_info = {0}; enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + int ch_width = 0; if (!if_priv || !params) { LOG_ERR("%s: Invalid params", __func__); @@ -2321,8 +2366,11 @@ int nrf_wifi_wpa_supp_start_ap(void *if_priv, struct wpa_driver_ap_params *param } } + ch_width = wpa_supp_chan_width_to_nrf(params->freq->mode, params->freq->bandwidth, + params->freq->center_freq1, params->freq->center_freq2); + start_ap_info.freq_params.frequency = params->freq->freq; - start_ap_info.freq_params.channel_width = params->freq->bandwidth; + start_ap_info.freq_params.channel_width = ch_width; start_ap_info.freq_params.center_frequency1 = params->freq->center_freq1; start_ap_info.freq_params.center_frequency2 = params->freq->center_freq2; start_ap_info.freq_params.channel_type = params->freq->ht_enabled ? NRF_WIFI_CHAN_HT20 : @@ -2704,4 +2752,50 @@ int nrf_wifi_wpa_supp_sta_set_flags(void *if_priv, const u8 *addr, k_mutex_unlock(&vif_ctx_zep->vif_lock); return ret; } + +int nrf_wifi_wpa_supp_sta_get_inact_sec(void *if_priv, const u8 *addr) +{ + struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL; + struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; + enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + int ret = -1, sem_ret; + int inactive_time_sec = -1; + + if (!if_priv || !addr) { + LOG_ERR("%s: Invalid params", __func__); + return ret; + } + + vif_ctx_zep = if_priv; + rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep) { + LOG_DBG("%s: rpu_ctx_zep is NULL", __func__); + return ret; + } + + k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); + if (!rpu_ctx_zep->rpu_ctx) { + LOG_DBG("%s: RPU context not initialized", __func__); + goto out; + } + + status = nrf_wifi_fmac_get_station(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, + (unsigned char *) addr); + if (status != NRF_WIFI_STATUS_SUCCESS) { + LOG_ERR("%s: nrf_wifi_fmac_get_station failed", __func__); + goto out; + } + + sem_ret = k_sem_take(&wait_for_event_sem, K_MSEC(RPU_RESP_EVENT_TIMEOUT)); + if (sem_ret) { + LOG_ERR("%s: Timed out to get station info, ret = %d", __func__, sem_ret); + ret = NRF_WIFI_STATUS_FAIL; + goto out; + } + + inactive_time_sec = vif_ctx_zep->inactive_time_sec; +out: + k_mutex_unlock(&vif_ctx_zep->vif_lock); + return inactive_time_sec; +} #endif /* CONFIG_NRF700X_AP_MODE */ diff --git a/dts/arm/nordic/nrf54l15_cpuapp_ns.dtsi b/dts/arm/nordic/nrf54l15_cpuapp_ns.dtsi new file mode 100644 index 000000000000..4447a5ed48f1 --- /dev/null +++ b/dts/arm/nordic/nrf54l15_cpuapp_ns.dtsi @@ -0,0 +1,91 @@ + /* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu: cpu@0 { + clock-frequency = ; + device_type = "cpu"; + compatible = "arm,cortex-m33f"; + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + itm: itm@e0000000 { + compatible = "arm,armv8m-itm"; + reg = <0xe0000000 0x1000>; + swo-ref-frequency = ; + }; + }; + }; + + clocks { + lfxo: lfxo { + compatible = "nordic,nrf-lfxo"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + + hfxo: hfxo { + compatible = "nordic,nrf-hfxo"; + #clock-cells = <0>; + clock-frequency = ; + }; + }; + + soc { + ficr: ficr@ffc000 { + compatible = "nordic,nrf-ficr"; + reg = <0xffc000 0x1000>; + #nordic,ficr-cells = <1>; + }; + + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; + + peripheral@40000000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x40000000 0x10000000>; + + /* Common nRF54L15 peripheral description */ + #include "nrf54l15_cpuapp_peripherals_ns.dtsi" + }; + }; +}; + +&nvic { + arm,num-irq-priority-bits = <3>; +}; + +&rram_controller { + rram0: rram@0 { + /* + * "1524 KB non-volatile memory (RRAM) and 256 KB RAM" + * -- Product Specification + * NB: 1524 = 1.5 * 1024 - 12 + */ + reg = <0x0 DT_SIZE_K(1524)>; + }; +}; + +/* Disable by default to use GRTC */ +&systick { + status = "disabled"; +}; + +/* Disable so that TF-M can use this UART */ +&uart30 { + status = "disabled"; +}; diff --git a/dts/arm/nordic/nrf54l15_cpuapp_peripherals_ns.dtsi b/dts/arm/nordic/nrf54l15_cpuapp_peripherals_ns.dtsi new file mode 100644 index 000000000000..f728da207bbc --- /dev/null +++ b/dts/arm/nordic/nrf54l15_cpuapp_peripherals_ns.dtsi @@ -0,0 +1,415 @@ + /* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +dppic00: dppic@42000 { + compatible = "nordic,nrf-dppic"; + reg = <0x42000 0x808>; + status = "disabled"; +}; + +spi00: spi@4a000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4a000 0x1000>; + interrupts = <74 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +uart00: uart@4a000 { + compatible = "nordic,nrf-uarte"; + reg = <0x4a000 0x1000>; + interrupts = <74 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +gpio2: gpio@50400 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x50400 0x300>; + #gpio-cells = <2>; + ngpios = <11>; + status = "disabled"; + port = <2>; +}; + +timer00: timer@55000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x55000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <85 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +dppic10: dppic@82000 { + compatible = "nordic,nrf-dppic"; + reg = <0x82000 0x808>; + status = "disabled"; +}; + +timer10: timer@85000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0x85000 0x1000>; + cc-num = <8>; + max-bit-width = <32>; + interrupts = <133 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +egu10: egu@87000 { + compatible = "nordic,nrf-egu"; + reg = <0x87000 0x1000>; + interrupts = <135 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +radio: radio@8a000 { + compatible = "nordic,nrf-radio"; + reg = <0x8a000 0x1000>; + interrupts = <138 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + dfe-supported; + ieee802154-supported; + ble-2mbps-supported; + ble-coded-phy-supported; + + ieee802154: ieee802154 { + compatible = "nordic,nrf-ieee802154"; + status = "disabled"; + }; +}; + +dppic20: dppic@c2000 { + compatible = "nordic,nrf-dppic"; + reg = <0xc2000 0x808>; + status = "disabled"; +}; + +i2c20: i2c@c6000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + clock-frequency = ; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +spi20: spi@c6000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +uart20: uart@c6000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc6000 0x1000>; + interrupts = <198 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +i2c21: i2c@c7000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + clock-frequency = ; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +spi21: spi@c7000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +uart21: uart@c7000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc7000 0x1000>; + interrupts = <199 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +i2c22: i2c@c8000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + clock-frequency = ; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +spi22: spi@c8000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +uart22: uart@c8000 { + compatible = "nordic,nrf-uarte"; + reg = <0xc8000 0x1000>; + interrupts = <200 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +egu20: egu@c9000 { + compatible = "nordic,nrf-egu"; + reg = <0xc9000 0x1000>; + interrupts = <201 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +timer20: timer@ca000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xca000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <202 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +timer21: timer@cb000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcb000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <203 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +timer22: timer@cc000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcc000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <204 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +timer23: timer@cd000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xcd000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <205 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +timer24: timer@ce000 { + compatible = "nordic,nrf-timer"; + status = "disabled"; + reg = <0xce000 0x1000>; + cc-num = <6>; + max-bit-width = <32>; + interrupts = <206 NRF_DEFAULT_IRQ_PRIORITY>; + prescaler = <0>; +}; + +adc: adc@d5000 { + compatible = "nordic,nrf-saadc"; + reg = <0xd5000 0x1000>; + interrupts = <213 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + #io-channel-cells = <1>; +}; + +nfct: nfct@d6000 { + compatible = "nordic,nrf-nfct"; + reg = <0xd6000 0x1000>; + interrupts = <214 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +temp: temp@d7000 { + compatible = "nordic,nrf-temp"; + reg = <0xd7000 0x1000>; + interrupts = <215 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +gpio1: gpio@d8200 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0xd8200 0x300>; + #gpio-cells = <2>; + ngpios = <16>; + status = "disabled"; + port = <1>; + gpiote-instance = <&gpiote20>; +}; + +gpiote20: gpiote@da000 { + compatible = "nordic,nrf-gpiote"; + reg = <0xda000 0x1000>; + /* nrfx assigns irq 218 to non-secure, and 219 to secure */ + interrupts = <218 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + instance = <20>; +}; + +i2s20: i2s@dd000 { + compatible = "nordic,nrf-i2s"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xdd000 0x1000>; + interrupts = <221 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +qdec20: qdec@e0000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe0000 0x1000>; + interrupts = <224 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +qdec21: qdec@e1000 { + compatible = "nordic,nrf-qdec"; + reg = <0xe1000 0x1000>; + interrupts = <225 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +grtc: grtc@e2000 { + compatible = "nordic,nrf-grtc"; + reg = <0xe2000 0x1000>; + cc-num = <12>; + owned-channels = <0 1 2 3 4 5 6 7 8 9 10 11>; + child-owned-channels = <7 8 9 10 11>; + /* nrfx assignes IRQ 227 to ns and 228 to s */ + /* 229 is used by mpsl */ + interrupts = <227 NRF_DEFAULT_IRQ_PRIORITY>, + <229 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +dppic30: dppic@102000 { + compatible = "nordic,nrf-dppic"; + reg = <0x102000 0x808>; + status = "disabled"; +}; + +i2c30: i2c@104000 { + compatible = "nordic,nrf-twim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + clock-frequency = ; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +spi30: spi@104000 { + /* + * This spi node can be either SPIM or SPIS, + * for the user to pick: + * compatible = "nordic,nrf-spim" or + * "nordic,nrf-spis". + */ + compatible = "nordic,nrf-spim"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + max-frequency = ; + easydma-maxcnt-bits = <16>; + status = "disabled"; +}; + +uart30: uart@104000 { + compatible = "nordic,nrf-uarte"; + reg = <0x104000 0x1000>; + interrupts = <260 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +wdt31: watchdog@109000 { + compatible = "nordic,nrf-wdt"; + reg = <0x109000 0x620>; + interrupts = <265 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; + +gpio0: gpio@10a000 { + compatible = "nordic,nrf-gpio"; + gpio-controller; + reg = <0x10a000 0x300>; + #gpio-cells = <2>; + ngpios = <5>; + status = "disabled"; + port = <0>; + gpiote-instance = <&gpiote30>; +}; + +gpiote30: gpiote@10c000 { + compatible = "nordic,nrf-gpiote"; + reg = <0x10c000 0x1000>; + /* nrfx assigns IRQ 268 to non-secure, and 269 to secure */ + interrupts = <268 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; + instance = <30>; +}; + +clock: clock@10e000 { + compatible = "nordic,nrf-clock"; + reg = <0x10e000 0x1000>; + interrupts = <270 NRF_DEFAULT_IRQ_PRIORITY>; + status = "disabled"; +}; diff --git a/dts/bindings/radio_fem/nordic,nrf2220-fem-twi.yaml b/dts/bindings/radio_fem/nordic,nrf2220-fem-twi.yaml new file mode 100644 index 000000000000..fbcc90ef27b9 --- /dev/null +++ b/dts/bindings/radio_fem/nordic,nrf2220-fem-twi.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: | + This is a TWI device interface to the nRF2220 Radio Front-End module + +compatible: "nordic,nrf2220-fem-twi" + +include: [i2c-device.yaml, nordic-nrf22xx-fem-twi-init-reg.yaml] diff --git a/dts/bindings/radio_fem/nordic,nrf2220-fem.yaml b/dts/bindings/radio_fem/nordic,nrf2220-fem.yaml new file mode 100644 index 000000000000..74d995db6f0c --- /dev/null +++ b/dts/bindings/radio_fem/nordic,nrf2220-fem.yaml @@ -0,0 +1,88 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: | + This is a representation of the nRF2220 Radio Front-End module. + + See the "nordic,nrf2220-fem-twi" binding to configure the TWI (I2C) + interface. The TWI interface should be configured as a child node + of the TWI (I2C) bus you have connected to the FEM. Then you "connect" + the FEM and TWI configurations using the twi-if property. + + Here is an example nRF2220 configuration with a TWI interface + selected, using the TWIM0 peripheral found on several nRF5 SoCs: + + &i2c0 { + status = "okay"; + + my_twi_if: nrf2220_fem_twi@36 { + compatible = "nordic,nrf2220-fem-twi"; + status = "okay"; + reg = <0x36>; + }; + }; + + nrf_radio_fem: nrf2220_fem { + compatible = "nordic,nrf2220-fem"; + cs-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + md-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + twi-if = <&my_twi_if>; + output-power-dbm = <10>; + bypass-gain-db = <-1>; + /* ... other nRF2220 properties go here ... */ + }; + + &radio { + fem = <&nrf_radio_fem>; + }; + + In the above example, the nRF2220 is configured for use with: + + - CS on P1.7 (from 'cs-gpios') + - MD on P1.11 (from 'md-gpios') + - TWI/I2C communication via TWIM0 (the bus, or parent node, of the 'my_twi_if' node) + - Output power of 10dBm when using power amplifier + - Bypass attenuation used for calculations of 1dB + + You must perform any additional required TWI/I2C pin configuration + (nRF2220 CLK and DATA pins) within the TWIM bus node + ('i2c0' in the above example). See your TWI/I2C node's binding for + details on these pin mux properties. You can use any TWI/I2C node + available in your SoC's devicetree. + +compatible: "nordic,nrf2220-fem" + +include: base.yaml + +properties: + cs-gpios: + type: phandle-array + required: true + description: + GPIO of the SoC controlling the CS pin of the nRF2220 family member device. + + md-gpios: + type: phandle-array + required: true + description: | + GPIO of the SoC controlling the MD pin of the nRF2220 family member device. + + output-power-dbm: + type: int + default: 10 + description: | + Output power in dBm at FEM output, when the FEM is in Transmit state + (power amplifier is used). + + bypass-gain-db: + type: int + default: -1 + description: | + Gain of the Front End Module's bypass in dB. This parameter is usually negative + to express attenuation. + + twi-if: + type: phandle + description: | + Reference to the TWI/I2C bus interface. + This must be present to support TWI control of the FEM. diff --git a/dts/bindings/radio_fem/nordic,nrf2240-fem-twi.yaml b/dts/bindings/radio_fem/nordic,nrf2240-fem-twi.yaml new file mode 100644 index 000000000000..6fadca711f20 --- /dev/null +++ b/dts/bindings/radio_fem/nordic,nrf2240-fem-twi.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: | + This is a TWI device interface to the nRF2240 Radio Front-End module + +compatible: "nordic,nrf2240-fem-twi" + +include: [i2c-device.yaml, nordic-nrf22xx-fem-twi-init-reg.yaml] diff --git a/dts/bindings/radio_fem/nordic,nrf2240-fem.yaml b/dts/bindings/radio_fem/nordic,nrf2240-fem.yaml new file mode 100644 index 000000000000..1f5bde21bb88 --- /dev/null +++ b/dts/bindings/radio_fem/nordic,nrf2240-fem.yaml @@ -0,0 +1,101 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: | + This is a representation of the nRF2240 Radio Front-End module. + + See the "nordic,nrf2240-fem-twi" binding to configure the TWI (I2C) + interface. The TWI interface should be configured as a child node + of the TWI (I2C) bus you have connected to the FEM. Then you "connect" + the FEM and TWI configurations using the twi-if property. + + Here is an example nRF2240 configuration with a TWI interface + selected, using the TWIM0 peripheral found on several nRF5 SoCs: + + &i2c0 { + status = "okay"; + + my_twi_if: nrf2240_fem_twi@30 { + compatible = "nordic,nrf2240-fem-twi"; + status = "okay"; + reg = <0x30>; + }; + }; + + nrf_radio_fem: nrf2240_fem { + compatible = "nordic,nrf2240-fem"; + cs-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + md-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + twi-if = <&my_twi_if>; + output-power-dbm = <10>; + bypass-gain-db = <-1>; + /* ... other nRF2240 properties go here ... */ + }; + + &radio { + fem = <&nrf_radio_fem>; + }; + + In the above example, the nRF2240 is configured for use with: + + - CS on P1.7 (from 'cs-gpios') + - MD on P1.11 (from 'md-gpios') + - TWI/I2C communication via TWIM0 (the bus, or parent node, of the 'my_twi_if' node) + - Output power of 10dBm when using power amplifier + - Bypass attenuation used for calculations of 1dB + + You must perform any additional required TWI/I2C pin configuration + (nRF2240 CLK and DATA pins) within the TWIM bus node + ('i2c0' in the above example). See your TWI/I2C node's binding for + details on these pin mux properties. You can use any TWI/I2C node + available in your SoC's devicetree. + +compatible: "nordic,nrf2240-fem" + +include: base.yaml + +properties: + cs-gpios: + type: phandle-array + required: true + description: + GPIO of the SoC controlling the CS pin of the nRF2240 family member device. + + md-gpios: + type: phandle-array + required: true + description: | + GPIO of the SoC controlling the MD pin of the nRF2240 family member device. + + pwrmd-gpios: + type: phandle-array + description: | + GPIO of the SoC connected to the PWRMD pin of the nRF2240 family member device. + + output-power-dbm: + type: int + default: 7 + description: | + Output power in dBm at FEM output, when the FEM is in Transmit state + (power amplifier is used). + + output-power-alt-dbm: + type: int + default: 20 + description: | + Alternative output power in dBm at FEM output, when the FEM is in Transmit state + (power amplifier is used). This property must be provided if the property + `pwrmd-gpios` is provided. Otherwise it is ignored. + + bypass-gain-db: + type: int + default: -1 + description: | + Gain of the Front End Module's bypass in dB. This parameter is usually negative + to express attenuation. + + twi-if: + type: phandle + description: | + Reference to the TWI/I2C bus interface. + This must be present to support TWI control of the FEM. diff --git a/dts/bindings/radio_fem/nordic-nrf22xx-fem-twi-init-reg.yaml b/dts/bindings/radio_fem/nordic-nrf22xx-fem-twi-init-reg.yaml new file mode 100644 index 000000000000..a68701b15cc6 --- /dev/null +++ b/dts/bindings/radio_fem/nordic-nrf22xx-fem-twi-init-reg.yaml @@ -0,0 +1,30 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +description: | + This is an abstract device that represents TWI registers of nRF22xx Front-End Module + to be written at boot-time. + + Here is an example configuration for nRF2240 Front-End Module TWI interface that defines + initialization registers: + + nrf_radio_fem_twi: fem_twi@30 { + /* Other properties related to this node go here, including "compatible" and "reg". */ + status = "okay"; + init-regs = <0x11 0xaa>, <0x22 0xbb>, <0x33 0xcc>; + }; + + The above configuration will cause the registers of given nRF22xx device with internal addresses + 0x11, 0x22 and 0x33 to be written with values 0xAA, 0xBB and 0xCC respectively. + + The property is optional. If it is not specified, no TWI registers to be written at boot-time + are provided to the Front-End Module driver. + +include: base.yaml + +properties: + init-regs: + type: array + description: + Array that contains pairs of internal offsets of nRF22xx registers to be written at + boot-time and the values of these registers. diff --git a/ext/curl/CMakeLists.txt b/ext/curl/CMakeLists.txt index 342f3e4bd546..47a8bc5462b8 100644 --- a/ext/curl/CMakeLists.txt +++ b/ext/curl/CMakeLists.txt @@ -11,7 +11,6 @@ target_include_directories(curl INTERFACE include/curl) zephyr_library() zephyr_library_include_directories(lib) -zephyr_library_link_libraries(posix_subsys) zephyr_library_link_libraries(curl) add_subdirectory_ifdef(CONFIG_NRF_CURL_LIB lib) diff --git a/ext/curl/lib/curl_addrinfo.h b/ext/curl/lib/curl_addrinfo.h index 45e35128ca60..a0cade614e1b 100644 --- a/ext/curl/lib/curl_addrinfo.h +++ b/ext/curl/lib/curl_addrinfo.h @@ -40,17 +40,6 @@ # include #endif -#if defined(CONFIG_NRF_CURL_INTEGRATION) -/* zephyr is not having this? normally in netdb.h */ - struct hostent { - char *h_name; - char **h_aliases; - int h_addrtype; - int h_length; - char **h_addr_list; - }; -#endif - /* * Curl_addrinfo is our internal struct definition that we use to allow * consistent internal handling of this data. We use this even when the diff --git a/ext/freebsd-getopt/CMakeLists.txt b/ext/freebsd-getopt/CMakeLists.txt index 60ffe6c76231..c8bc0a532c0b 100644 --- a/ext/freebsd-getopt/CMakeLists.txt +++ b/ext/freebsd-getopt/CMakeLists.txt @@ -8,7 +8,6 @@ zephyr_include_directories(.) zephyr_library() -zephyr_library_link_libraries(posix_subsys) zephyr_library_sources( getopt.c diff --git a/ext/iperf3/CMakeLists.txt b/ext/iperf3/CMakeLists.txt index 5b17b3dd4567..69c47e1e35ba 100644 --- a/ext/iperf3/CMakeLists.txt +++ b/ext/iperf3/CMakeLists.txt @@ -11,7 +11,6 @@ zephyr_interface_library_named(iperf3) target_include_directories(iperf3 INTERFACE .) zephyr_library() -zephyr_library_link_libraries(posix_subsys) zephyr_library_sources( dscp.c diff --git a/ext/iperf3/Kconfig b/ext/iperf3/Kconfig index 3d3d3e2da01a..224388edd1c7 100644 --- a/ext/iperf3/Kconfig +++ b/ext/iperf3/Kconfig @@ -38,6 +38,12 @@ config NRF_IPERF3_CLIENT_TEST_START_TIME help Time in seconds from control socket creation to actual data transfer start. +config NRF_IPERF3_CLIENT_TEST_ENDING_TIMEOUT + int "Test ending timeout" + default 480 + help + Time in seconds to wait in TEST_END state. + # The name of this option is mandated by zephyr_interface_library_named cmake directive. config APP_LINK_WITH_IPERF3 bool "Link 'app' with IPERF3" diff --git a/ext/iperf3/iperf.h b/ext/iperf3/iperf.h index d4a9f68d5d29..56593b0ab6d6 100644 --- a/ext/iperf3/iperf.h +++ b/ext/iperf3/iperf.h @@ -267,6 +267,7 @@ struct iperf_test struct sockaddr remote_addr; char *resp_std_out_buff; int resp_std_out_buff_len; + int i_errno; #endif TAILQ_HEAD(xbind_addrhead, xbind_entry) xbind_addrs; /* all -X opts */ @@ -328,6 +329,9 @@ struct iperf_test int max_fd; fd_set read_set; /* set of read sockets */ fd_set write_set; /* set of write sockets */ +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) + fd_set err_set; +#endif /* Interval related members */ int omitting; diff --git a/ext/iperf3/iperf_api.c b/ext/iperf3/iperf_api.c index 865b492a69ac..8a56ecc81f8d 100644 --- a/ext/iperf3/iperf_api.c +++ b/ext/iperf3/iperf_api.c @@ -711,7 +711,7 @@ struct protocol *get_protocol(struct iperf_test *test, int prot_id) } if (prot == NULL) - i_errno = IEPROTOCOL; + test->i_errno = IEPROTOCOL; return prot; } @@ -729,7 +729,7 @@ int set_protocol(struct iperf_test *test, int prot_id) } } - i_errno = IEPROTOCOL; + test->i_errno = IEPROTOCOL; return -1; } @@ -1042,14 +1042,14 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case 'p': portno = atoi(optarg); if (portno < 1 || portno > 65535) { - i_errno = IEBADPORT; + test->i_errno = IEBADPORT; return -1; } test->server_port = portno; break; case 'f': if (!optarg) { - i_errno = IEBADFORMAT; + test->i_errno = IEBADFORMAT; return -1; } test->settings->unit_format = *optarg; @@ -1063,7 +1063,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->unit_format == 'T') { break; } else { - i_errno = IEBADFORMAT; + test->i_errno = IEBADFORMAT; return -1; } break; @@ -1075,7 +1075,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) if ((test->stats_interval < MIN_INTERVAL || test->stats_interval > MAX_INTERVAL) && test->stats_interval != 0) { - i_errno = IEINTERVAL; + test->i_errno = IEINTERVAL; return -1; } break; @@ -1105,14 +1105,14 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) #endif case 's': if (test->role == 'c') { - i_errno = IESERVCLIENT; + test->i_errno = IESERVCLIENT; return -1; } iperf_set_test_role(test, 's'); break; case 'c': if (test->role == 's') { - i_errno = IESERVCLIENT; + test->i_errno = IESERVCLIENT; return -1; } iperf_set_test_role(test, 'c'); @@ -1128,7 +1128,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) client_flag = 1; break; #else /* HAVE_SCTP_H */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif /* HAVE_SCTP_H */ @@ -1137,7 +1137,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->num_ostreams = unit_atoi(optarg); client_flag = 1; #else /* linux */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif /* linux */ case 'b': @@ -1148,7 +1148,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->burst = atoi(slash); if (test->settings->burst <= 0 || test->settings->burst > MAX_BURST) { - i_errno = IEBURST; + test->i_errno = IEBURST; return -1; } } @@ -1169,7 +1169,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) MIN_INTERVAL || test->settings->bitrate_limit_interval > MAX_INTERVAL)) { - i_errno = IETOTALINTERVAL; + test->i_errno = IETOTALINTERVAL; return -1; } } @@ -1179,7 +1179,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case 't': test->duration = atoi(optarg); if (test->duration > MAX_TIME) { - i_errno = IEDURATION; + test->i_errno = IEDURATION; return -1; } duration_flag = 1; @@ -1200,14 +1200,14 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case 'P': test->num_streams = atoi(optarg); if (test->num_streams > MAX_STREAMS) { - i_errno = IENUMSTREAMS; + test->i_errno = IENUMSTREAMS; return -1; } client_flag = 1; break; case 'R': if (test->bidirectional) { - i_errno = IEREVERSEBIDIR; + test->i_errno = IEREVERSEBIDIR; return -1; } iperf_set_test_reverse(test, 1); @@ -1219,7 +1219,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case OPT_BIDIRECTIONAL: #endif if (test->reverse) { - i_errno = IEREVERSEBIDIR; + test->i_errno = IEREVERSEBIDIR; return -1; } iperf_set_test_bidirectional(test, 1); @@ -1231,7 +1231,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) // to avoid possible integer overflows. farg = unit_atof(optarg); if (farg > (double)MAX_TCP_BUFFER) { - i_errno = IEBUFSIZE; + test->i_errno = IEBUFSIZE; return -1; } test->settings->socket_bufsize = (int)farg; @@ -1243,7 +1243,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case OPT_CLIENT_PORT: portno = atoi(optarg); if (portno < 1 || portno > 65535) { - i_errno = IEBADPORT; + test->i_errno = IEBADPORT; return -1; } test->bind_port = portno; @@ -1251,7 +1251,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case 'M': test->settings->mss = atoi(optarg); if (test->settings->mss > MAX_MSS) { - i_errno = IEMSS; + test->i_errno = IEMSS; return -1; } client_flag = 1; @@ -1270,7 +1270,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->tos = strtol(optarg, &endptr, 0); if (endptr == optarg || test->settings->tos < 0 || test->settings->tos > 255) { - i_errno = IEBADTOS; + test->i_errno = IEBADTOS; return -1; } client_flag = 1; @@ -1278,7 +1278,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case OPT_DSCP: test->settings->tos = parse_qos(optarg); if (test->settings->tos < 0) { - i_errno = IEBADTOS; + test->i_errno = IEBADTOS; return -1; } client_flag = 1; @@ -1292,12 +1292,12 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->flowlabel = strtol(optarg, &endptr, 0); if (endptr == optarg || test->settings->flowlabel < 1 || test->settings->flowlabel > 0xfffff) { - i_errno = IESETFLOW; + test->i_errno = IESETFLOW; return -1; } client_flag = 1; #else /* HAVE_FLOWLABEL */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif /* HAVE_FLOWLABEL */ break; @@ -1305,20 +1305,20 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) xbe = (struct xbind_entry *)malloc( sizeof(struct xbind_entry)); if (!xbe) { - i_errno = IESETSCTPBINDX; + test->i_errno = IESETSCTPBINDX; return -1; } memset(xbe, 0, sizeof(*xbe)); xbe->name = strdup(optarg); if (!xbe->name) { - i_errno = IESETSCTPBINDX; + test->i_errno = IESETSCTPBINDX; return -1; } TAILQ_INSERT_TAIL(&test->xbind_addrs, xbe, link); break; case 'Z': if (!has_sendfile()) { - i_errno = IENOSENDFILE; + test->i_errno = IENOSENDFILE; return -1; } test->zerocopy = 1; @@ -1340,7 +1340,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) case 'O': test->omit = atoi(optarg); if (test->omit < 0 || test->omit > 60) { - i_errno = IEOMIT; + test->i_errno = IEOMIT; return -1; } client_flag = 1; @@ -1353,7 +1353,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->affinity = strtol(optarg, &endptr, 0); if (endptr == optarg || test->affinity < 0 || test->affinity > 1024) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } comma = strchr(optarg, ','); @@ -1361,13 +1361,13 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->server_affinity = atoi(comma + 1); if (test->server_affinity < 0 || test->server_affinity > 1024) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } client_flag = 1; } #else /* HAVE_CPU_AFFINITY */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif /* HAVE_CPU_AFFINITY */ break; @@ -1380,7 +1380,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->congestion = strdup(optarg); client_flag = 1; #else /* HAVE_TCP_CONGESTION */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif /* HAVE_TCP_CONGESTION */ break; @@ -1398,7 +1398,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->pdn_id_str = strdup(optarg); if (test->pdn_id_str == NULL) { printk("strdup failed for setting the PDN ID %s\n", optarg); - i_errno = IENOMEMORY; + test->i_errno = IENOMEMORY; return -1; } } @@ -1428,7 +1428,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->fqrate = 0; client_flag = 1; #else /* HAVE_SO_MAX_PACING_RATE */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif break; @@ -1437,7 +1437,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) test->settings->fqrate = unit_atof_rate(optarg); client_flag = 1; #else /* HAVE_SO_MAX_PACING_RATE */ - i_errno = IEUNIMP; + test->i_errno = IEUNIMP; return -1; #endif break; @@ -1490,23 +1490,23 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) /* Check flag / role compatibility. */ if (test->role == 'c' && server_flag) { - i_errno = IESERVERONLY; + test->i_errno = IESERVERONLY; return -1; } if (test->role == 's' && client_flag) { - i_errno = IECLIENTONLY; + test->i_errno = IECLIENTONLY; return -1; } #if defined(HAVE_SSL) if (test->role == 's' && (client_username || client_rsa_public_key)) { - i_errno = IECLIENTONLY; + test->i_errno = IECLIENTONLY; return -1; } else if (test->role == 'c' && (client_username || client_rsa_public_key) && !(client_username && client_rsa_public_key)) { - i_errno = IESETCLIENTAUTH; + test->i_errno = IESETCLIENTAUTH; return -1; } else if (test->role == 'c' && (client_username && client_rsa_public_key)) { @@ -1516,11 +1516,11 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) if ((client_password = getenv("IPERF3_PASSWORD")) != NULL) client_password = strdup(client_password); else if (iperf_getpass(&client_password, &s, stdin) < 0) { - i_errno = IESETCLIENTAUTH; + test->i_errno = IESETCLIENTAUTH; return -1; } if (test_load_pubkey_from_file(client_rsa_public_key) < 0) { - i_errno = IESETCLIENTAUTH; + test->i_errno = IESETCLIENTAUTH; return -1; } @@ -1534,18 +1534,18 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) if (test->role == 'c' && (server_rsa_private_key || test->server_authorized_users)) { - i_errno = IESERVERONLY; + test->i_errno = IESERVERONLY; return -1; } else if (test->role == 's' && (server_rsa_private_key || test->server_authorized_users) && !(server_rsa_private_key && test->server_authorized_users)) { - i_errno = IESETSERVERAUTH; + test->i_errno = IESETSERVERAUTH; return -1; } else if (test->role == 's' && server_rsa_private_key) { test->server_rsa_private_key = load_privkey_from_file(server_rsa_private_key); if (test->server_rsa_private_key == NULL) { - i_errno = IESETSERVERAUTH; + test->i_errno = IESETSERVERAUTH; return -1; } free(server_rsa_private_key); @@ -1563,13 +1563,13 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) } if ((test->protocol->id != Pudp && blksize <= 0) || blksize > MAX_BLOCKSIZE) { - i_errno = IEBLOCKSIZE; + test->i_errno = IEBLOCKSIZE; return -1; } if (test->protocol->id == Pudp && (blksize > 0 && (blksize < MIN_UDP_BLOCKSIZE || blksize > MAX_UDP_BLOCKSIZE))) { - i_errno = IEUDPBLOCKSIZE; + test->i_errno = IEUDPBLOCKSIZE; return -1; } test->settings->blksize = blksize; @@ -1590,7 +1590,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) if ((duration_flag && test->settings->bytes != 0) || (duration_flag && test->settings->blocks != 0) || (test->settings->bytes != 0 && test->settings->blocks != 0)) { - i_errno = IEENDCONDITIONS; + test->i_errno = IEENDCONDITIONS; return -1; } @@ -1601,7 +1601,7 @@ int iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) optind = 0; if ((test->role != 'c') && (test->role != 's')) { - i_errno = IENOROLE; + test->i_errno = IENOROLE; return -1; } @@ -1663,7 +1663,7 @@ int iperf_open_logfile(struct iperf_test *test) #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) test->outfile = fopen(test->logfile, "a+"); if (test->outfile == NULL) { - i_errno = IELOGFILE; + test->i_errno = IELOGFILE; return -1; } #endif @@ -1676,69 +1676,41 @@ int iperf_set_send_state(struct iperf_test *test, signed char state) test->state = state; #if defined(CONFIG_NRF_IPERF3_INTEGRATION) - fd_set flush_read_set; - struct iperf_stream *sp; - int ret = 0; - int i = 0; - - do { - if (test->mode == RECEIVER) { - int ret; - struct timeval timeout = { .tv_sec = 1, .tv_usec = 0 }; /* timeout immediately */ - + struct timeval tout = {.tv_sec = CONFIG_NRF_IPERF3_RESULTS_WAIT_TIME, .tv_usec = 0}; + struct iperf_time start_time; + struct iperf_time now; + struct iperf_time temp_time; - /* Read data to avoid deadlock and enable sending: ignore errors */ - /* - FD_ZERO(&flush_read_set); - SLIST_FOREACH(sp, &test->streams, streams) { - FD_SET(sp->socket, &flush_read_set); - }*/ - memcpy(&flush_read_set, &test->read_set, sizeof(fd_set)); + iperf_time_now(&start_time); - ret = select(test->max_fd + 1, &flush_read_set, NULL, NULL, &timeout); + do { + ret = Nwrite(test->ctrl_sck, (char *)&state, sizeof(state), Ptcp); + if (ret < 0) { + test->i_errno = IESENDMESSAGE; if (test->debug) { - iperf_printf(test, "iperf_set_send_state: select return %d\n", ret); - - SLIST_FOREACH(sp, &test->streams, streams) { - iperf_printf(test, "iperf_set_send_state before recv: stream [%d]: socket: %d read: %d\n", - i, - sp->socket, - (int)FD_ISSET(sp->socket, &flush_read_set)); - i++; - } + iperf_printf(test, + "iperf_set_send_state failed of sending state: %d, ret: %d\n", + state, ret); } - - if (ret > 0) { - if (iperf_recv(test, &flush_read_set) < 0) { - if (test->debug) { - iperf_printf(test, "iperf_set_send_state: iperf_recv flushing failed, ignored\n"); - } - } + ret = -1; + break; + } else if (ret > 0) { + if (test->debug) { + iperf_printf(test, "iperf_set_send_state succesfully sent the state: %d\n", + state); } + ret = 0; + break; } - - ret = Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp); - if (ret < 0) { - i_errno = IESENDMESSAGE; - if (test->debug) - iperf_printf(test, "iperf_set_send_state failed of sending state: %d, ret: %d\n", state, ret); - + iperf_time_now(&now); + iperf_time_diff(&start_time, &now, &temp_time); + if (iperf_time_in_secs(&temp_time) > tout.tv_sec) { + test->i_errno = IESENDMESSAGE; + iperf_printf(test, "iperf_set_send_state: timeout to send the state\n"); ret = -1; - break; - } - else if (ret > 0) { - if (test->debug) - iperf_printf(test, "iperf_set_send_state succesfully sent the state: %d\n", state); - - ret = 0; - break; - } - else { - if (test->debug) - iperf_printf(test, "iperf_set_send_state: Nwrite returned 0, retrying for state: %d\n", state); + break; } - } while (1); return ret; @@ -1746,7 +1718,7 @@ int iperf_set_send_state(struct iperf_test *test, signed char state) if (Nwrite(test->ctrl_sck, (char *)&state, sizeof(state), Ptcp) < 0) { if (test->debug) iperf_printf(test, "iperf_set_send_state failed of sending char: %c\n", state); - i_errno = IESENDMESSAGE; + test->i_errno = IESENDMESSAGE; return -1; } return 0; @@ -1853,7 +1825,7 @@ int iperf_send(struct iperf_test *test, fd_set *write_setP) if ((r = sp->snd(sp)) < 0) { if (r == NET_SOFTERROR) break; - i_errno = IESTREAMWRITE; + test->i_errno = IESTREAMWRITE; return r; } streams_active = 1; @@ -1899,7 +1871,7 @@ int iperf_recv(struct iperf_test *test, fd_set *read_setP) { if ((r = sp->rcv(sp)) < 0) { - i_errno = IESTREAMREAD; + test->i_errno = IESTREAMREAD; return r; } test->bytes_received += r; @@ -1923,7 +1895,7 @@ int iperf_init_test(struct iperf_test *test) /* Init each stream. */ if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } SLIST_FOREACH(sp, &test->streams, streams) @@ -1956,7 +1928,7 @@ int iperf_create_send_timers(struct iperf_test *test) TimerClientData cd; if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } SLIST_FOREACH(sp, &test->streams, streams) @@ -1968,7 +1940,7 @@ int iperf_create_send_timers(struct iperf_test *test) tmr_create(NULL, send_timer_proc, cd, test->settings->pacing_timer, 1); if (sp->send_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -2035,11 +2007,11 @@ int iperf_exchange_parameters(struct iperf_test *test) if (test_is_authorized(test) < 0) { if (iperf_set_send_state(test, SERVER_ERROR) != 0) return -1; - i_errno = IEAUTHTEST; - err = htonl(i_errno); + test->i_errno = IEAUTHTEST; + err = htonl(test->i_errno); if (Nwrite(test->ctrl_sck, (char *)&err, sizeof(err), Ptcp) < 0) { - i_errno = IECTRLWRITE; + test->i_errno = IECTRLWRITE; return -1; } return -1; @@ -2049,16 +2021,16 @@ int iperf_exchange_parameters(struct iperf_test *test) if ((s = test->protocol->listen(test)) < 0) { if (iperf_set_send_state(test, SERVER_ERROR) != 0) return -1; - err = htonl(i_errno); + err = htonl(test->i_errno); if (Nwrite(test->ctrl_sck, (char *)&err, sizeof(err), Ptcp) < 0) { - i_errno = IECTRLWRITE; + test->i_errno = IECTRLWRITE; return -1; } err = htonl(errno); if (Nwrite(test->ctrl_sck, (char *)&err, sizeof(err), Ptcp) < 0) { - i_errno = IECTRLWRITE; + test->i_errno = IECTRLWRITE; return -1; } return -1; @@ -2111,7 +2083,7 @@ static int send_parameters(struct iperf_test *test) j = cJSON_CreateObject(); if (j == NULL) { - i_errno = IESENDPARAMS; + test->i_errno = IESENDPARAMS; r = -1; } else { if (test->protocol->id == Ptcp) @@ -2198,7 +2170,7 @@ static int send_parameters(struct iperf_test *test) if (rc) { cJSON_Delete(j); - i_errno = IESENDPARAMS; + test->i_errno = IESENDPARAMS; return -1; } @@ -2215,7 +2187,7 @@ static int send_parameters(struct iperf_test *test) } if (JSON_write(test->ctrl_sck, j) < 0) { - i_errno = IESENDPARAMS; + test->i_errno = IESENDPARAMS; r = -1; } cJSON_Delete(j); @@ -2233,7 +2205,7 @@ static int get_parameters(struct iperf_test *test) j = JSON_read(test->ctrl_sck); if (j == NULL) { - i_errno = IERECVPARAMS; + test->i_errno = IERECVPARAMS; r = -1; } else { if (test->debug) { @@ -2344,7 +2316,7 @@ static int send_results(struct iperf_test *test) j = cJSON_CreateObject(); if (j == NULL) { - i_errno = IEPACKAGERESULTS; + test->i_errno = IEPACKAGERESULTS; r = -1; } else { cJSON_AddNumberToObject(j, "cpu_util_total", test->cpu_util[0]); @@ -2398,7 +2370,7 @@ static int send_results(struct iperf_test *test) j_streams = cJSON_CreateArray(); if (j_streams == NULL) { - i_errno = IEPACKAGERESULTS; + test->i_errno = IEPACKAGERESULTS; r = -1; } else { cJSON_AddItemToObject(j, "streams", j_streams); @@ -2406,7 +2378,7 @@ static int send_results(struct iperf_test *test) { j_stream = cJSON_CreateObject(); if (j_stream == NULL) { - i_errno = IEPACKAGERESULTS; + test->i_errno = IEPACKAGERESULTS; r = -1; } else { cJSON_AddItemToArray(j_streams, @@ -2467,20 +2439,20 @@ static int send_results(struct iperf_test *test) /* non blocking mode client when sending results, due to several jamning problems */ if (test->role == 's') { if (r == 0 && JSON_write(test->ctrl_sck, j) < 0) { - i_errno = IESENDRESULTS; + test->i_errno = IESENDRESULTS; r = -1; } } else { if (r == 0 && JSON_write_nonblock(test, j) < 0) { - i_errno = IESENDRESULTS; + test->i_errno = IESENDRESULTS; r = -1; } } #else if (r == 0 && JSON_write(test->ctrl_sck, j) < 0) { - i_errno = IESENDRESULTS; + test->i_errno = IESENDRESULTS; r = -1; } #endif @@ -2529,7 +2501,7 @@ static int get_results(struct iperf_test *test) j = JSON_read(test->ctrl_sck); #endif if (j == NULL) { - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; if (test->debug) { iperf_printf(test, "get_results: IERECVRESULTS 1\n"); } @@ -2543,7 +2515,7 @@ static int get_results(struct iperf_test *test) if (j_cpu_util_total == NULL || j_cpu_util_user == NULL || j_cpu_util_system == NULL || j_sender_has_retransmits == NULL) { - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; r = -1; if (test->debug) { iperf_printf(test, "get_results: IERECVRESULTS 2\n"); @@ -2575,7 +2547,7 @@ static int get_results(struct iperf_test *test) if (test->debug) { iperf_printf(test, "get_results: IERECVRESULTS 3\n"); } - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; r = -1; } else { n = cJSON_GetArraySize(j_streams); @@ -2583,7 +2555,7 @@ static int get_results(struct iperf_test *test) j_stream = cJSON_GetArrayItem(j_streams, i); if (j_stream == NULL) { - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; if (test->debug) { iperf_printf(test, "get_results: IERECVRESULTS 4\n"); } @@ -2617,7 +2589,7 @@ static int get_results(struct iperf_test *test) j_jitter == NULL || j_errors == NULL || j_packets == NULL) { - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; if (test->debug) { iperf_printf(test, "get_results: IERECVRESULTS 5\n"); } @@ -2643,7 +2615,7 @@ static int get_results(struct iperf_test *test) if (sp->id == sid) break; if (sp == NULL) { - i_errno = + test->i_errno = IESTREAMID; r = -1; } else { @@ -2749,142 +2721,130 @@ static int get_results(struct iperf_test *test) /*************************************************************/ #if defined (CONFIG_NRF_IPERF3_NONBLOCKING_CLIENT_CHANGES) -static int -JSON_write_nonblock(struct iperf_test *test, cJSON *json) +static int JSON_write_nonblock(struct iperf_test *test, cJSON *json) { - /* Seems that select is not returning as expected in case when other end initiated the close. - It is not returning write set as would be expected and then next send() would tell that direction is closed. */ + /* Seems that select is not returning as expected in case when other end initiated the + close. It is not returning write set as would be expected and then next send() would tell + that direction is closed. */ struct iperf_time start_time; struct iperf_time now; struct iperf_time temp_time; - uint32_t hsize, nsize; - char *str; - int r = -1; - - struct iperf_stream *sp; - - bool size_sent = false; + uint32_t hsize, nsize; + char *str; + int r = -1; + bool size_sent = false; - fd_set read_set; - fd_set write_set; + fd_set read_set; + fd_set write_set; - str = cJSON_PrintUnformatted(json); - if (str == NULL) - { - if (test->debug) + str = cJSON_PrintUnformatted(json); + if (str == NULL) { + if (test->debug) { iperf_printf(test, "JSON_write_nonblock: cJSON_PrintUnformatted failed\n"); + } goto exit; - } - else - { - hsize = strlen(str); - nsize = htonl(hsize); - } + } else { + hsize = strlen(str); + nsize = htonl(hsize); + } - /* wait for max 10 sec */ - struct timeval tout = { .tv_sec = CONFIG_NRF_IPERF3_RESULTS_WAIT_TIME, .tv_usec = 0 }; - int err; - //bool wait_for_send = false; + /* wait for max 10 sec */ + struct timeval tout = {.tv_sec = CONFIG_NRF_IPERF3_RESULTS_WAIT_TIME, .tv_usec = 0}; + int err; + // bool wait_for_send = false; - iperf_time_now(&start_time); //store starting time + iperf_time_now(&start_time); // store starting time - do { - int ret = 0; - int sel_ret = 0; - err = 0; + do { + int ret = 0; + int sel_ret = 0; + err = 0; - FD_ZERO(&write_set); - FD_SET(test->ctrl_sck, &write_set); + FD_ZERO(&write_set); + FD_SET(test->ctrl_sck, &write_set); - FD_ZERO(&read_set); - SLIST_FOREACH(sp, &test->streams, streams) { - FD_SET(sp->socket, &read_set); - } + FD_ZERO(&read_set); iperf_time_now(&now); iperf_time_diff(&start_time, &now, &temp_time); if (iperf_time_in_secs(&temp_time) > tout.tv_sec) { - i_errno = IESENDRESULTS; - if (test->debug) - iperf_printf(test, "JSON_write_nonblock: breaking the select send loop due to timeout\n"); + test->i_errno = IESENDRESULTS; + if (test->debug) { + iperf_printf(test, "JSON_write_nonblock: breaking the select send " + "loop due to timeout\n"); + } break; } -#if defined (CONFIG_POSIX_API) - if ((sel_ret = select(test->max_fd + 1, &read_set, &write_set, NULL, &tout)) > 0) +#if defined(CONFIG_POSIX_API) + if ((sel_ret = select(test->max_fd + 1, &read_set, &write_set, NULL, &tout)) > 0) #else - if ((sel_ret = zsock_select(test->max_fd + 1, &read_set, &write_set, NULL, &tout)) > 0) + if ((sel_ret = zsock_select(test->max_fd + 1, &read_set, &write_set, NULL, &tout)) > + 0) #endif - { - /* ignore errors from other than control socket reads */ - (void)iperf_recv(test, &read_set); - - if (FD_ISSET(test->ctrl_sck, &write_set)) - { - //set_errno(0); + { + if (FD_ISSET(test->ctrl_sck, &write_set)) { + // set_errno(0); - if (!size_sent) - { -#if defined (CONFIG_POSIX_API) - if ((ret = write(test->ctrl_sck, &nsize, sizeof(nsize))) >= sizeof(nsize)) + if (!size_sent) { +#if defined(CONFIG_POSIX_API) + if ((ret = write(test->ctrl_sck, &nsize, sizeof(nsize))) >= + sizeof(nsize)) #else - if ((ret = send(test->ctrl_sck, &nsize, sizeof(nsize), 0)) >= sizeof(nsize)) + if ((ret = send(test->ctrl_sck, &nsize, sizeof(nsize), + 0)) >= sizeof(nsize)) #endif - { - size_sent = true; - } - } - else - { -#if defined (CONFIG_POSIX_API) - if ((ret = write(test->ctrl_sck, str, hsize)) >= hsize) + { + size_sent = true; + } + } else { +#if defined(CONFIG_POSIX_API) + if ((ret = write(test->ctrl_sck, str, hsize)) >= hsize) #else - if ((ret = send(test->ctrl_sck, str, hsize, 0)) >= hsize) + if ((ret = send(test->ctrl_sck, str, hsize, 0)) >= hsize) #endif - { - /* sent successfully */ - r = 0; - break; - } - } - } - } - /* timeout or error */ - else if (sel_ret <= 0) - { - if (sel_ret < 0) { //seems that select is timeoutting before the set time limit (i.e. = =0)? thus, let it timeout and don't care - i_errno = IESENDRESULTS; - if (test->debug) - iperf_printf(test, "JSON_write_nonblock: IERECVRESULTS %d\n", ret); - break; + { + /* sent successfully */ + r = 0; + break; + } + } } - else { - /* Data might be still coming from server, read it to avoid deadlock due to buffering. - ignore errors */ - if (test->debug) - iperf_printf(test, "JSON_write_nonblock: iperf_recv from select timeout\n"); - - (void)iperf_recv(test, &read_set); + } + /* timeout or error */ + else if (sel_ret <= 0) { + if (sel_ret < 0) { // seems that select is timeoutting before the set time + // limit (i.e. = =0)? thus, let it timeout and don't care + test->i_errno = IESENDRESULTS; + if (test->debug) { + iperf_printf(test, + "JSON_write_nonblock: IERECVRESULTS %d\n", + sel_ret); + } + break; + } else { + if (test->debug) { + iperf_printf(test, "JSON_write_nonblock: iperf_recv from " + "select timeout\n"); + } } - } - } while (1); + } + } while (1); exit: - if (str) - { - free(str); - } + if (str) { + free(str); + } - if (r < 0) - { - i_errno = IESENDRESULTS; - } + if (r < 0) { + test->i_errno = IESENDRESULTS; + } - return r; + return r; } -#endif //CONFIG_NRF_IPERF3_INTEGRATION +#endif // CONFIG_NRF_IPERF3_INTEGRATION /*************************************************************/ static int JSON_write(int fd, cJSON *json) @@ -2962,12 +2922,9 @@ static cJSON { /* Seems that select is not returning as expected in case when other end initiated the close. It is not returning read set as would be expected and then next recv() would tell that direction is closed. */ - struct iperf_time start_time; - struct iperf_time now; - struct iperf_time temp_time; - - struct iperf_stream *sp; - + struct iperf_time start_time; + struct iperf_time now; + struct iperf_time temp_time; fd_set read_set; uint32_t hsize = 0, nsize; @@ -2987,18 +2944,16 @@ static cJSON FD_ZERO(&read_set); FD_SET(test->ctrl_sck, &read_set); - SLIST_FOREACH(sp, &test->streams, streams) { - FD_SET(sp->socket, &read_set); - } - iperf_time_now(&now); - iperf_time_diff(&start_time, &now, &temp_time); - if (iperf_time_in_secs(&temp_time) > tout.tv_sec) { - i_errno = IERECVRESULTS; - if (test->debug) - iperf_printf(test, "JSON_read_nonblock: breaking the select recv loop due to timeout\n"); - break; - } + + iperf_time_now(&now); + iperf_time_diff(&start_time, &now, &temp_time); + if (iperf_time_in_secs(&temp_time) > tout.tv_sec) { + test->i_errno = IERECVRESULTS; + if (test->debug) + iperf_printf(test, "JSON_read_nonblock: breaking the select recv loop due to timeout\n"); + break; + } #if defined (CONFIG_POSIX_API) if ((ret = select(test->max_fd + 1, &read_set, NULL, NULL, &tout)) > 0) @@ -3027,10 +2982,10 @@ static cJSON str = (char *) calloc(sizeof(char), hsize + 1); /* +1 for trailing null */ if (str == NULL) { iperf_printf( - test, + test, "ERROR: No memory for parsing json results of len %d\n", hsize); - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; break; } else { if (test->debug) { @@ -3042,7 +2997,7 @@ static cJSON } } else if (rc < 0) { iperf_printf(test, "ERROR: Cannot read json length, err %d\n", rc); - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; break; } } @@ -3073,7 +3028,7 @@ static cJSON } iperf_printf(test, "\n"); } - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; break; } } else { @@ -3082,13 +3037,13 @@ static cJSON "WARNING: Size of data read does not correspond" "to offered length, rc: %d hsize: %d\n", rc, hsize); - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; break; } } else if (rc < 0) { iperf_printf(test, "read() failed: rc %d, errno %d", rc, errno); - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; break; } } @@ -3096,24 +3051,16 @@ static cJSON //next: FD_CLR(test->ctrl_sck, &read_set); - - /* ignore errors from other than control socket reads */ - (void)iperf_recv(test, &read_set); } /* timeout or error */ else if (ret <= 0) { if (ret != 0) { //seems that select is timeoutting before the set time limit (i.e. = =0)? thus, let it timeout and don't care - i_errno = IERECVRESULTS; + test->i_errno = IERECVRESULTS; if (test->debug) iperf_printf(test, "JSON_read_nonblock: IERECVRESULTS %d\n", ret); break; } - else { - /* Data might be still coming from server, read it to avoid deadlock due to buffering. - ignore errors */ - (void)iperf_recv(test, &read_set); - } } } while (!json); @@ -3369,7 +3316,11 @@ int iperf_defaults(struct iperf_test *testp) testp->settings->mss = 0; testp->settings->bytes = 0; testp->settings->blocks = 0; +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) + testp->settings->connect_timeout = CONFIG_NRF_IPERF3_CLIENT_TEST_START_TIME * 1000; +#else testp->settings->connect_timeout = -1; +#endif memset(testp->cookie, 0, COOKIE_SIZE); #if defined(CONFIG_NRF_IPERF3_INTEGRATION) @@ -5269,7 +5220,7 @@ static void print_interval_results(struct iperf_test *test, } unit_snprintf(ubuf, UNIT_LEN, (double)(irp->bytes_transferred), 'A'); - if (irp->interval_duration > 0.0) { + if ((double)irp->interval_duration > 0.0) { bandwidth = (double)irp->bytes_transferred / (double)irp->interval_duration; } else { @@ -5450,7 +5401,7 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, sp = (struct iperf_stream *)malloc(sizeof(struct iperf_stream)); if (!sp) { - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; return NULL; } @@ -5463,7 +5414,7 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, sizeof(struct iperf_stream_result)); if (!sp->result) { free(sp); - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; return NULL; } @@ -5474,7 +5425,7 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, sp->buffer = (char *)malloc(test->settings->blksize); if (sp->buffer == NULL) { iperf_printf(test, "iperf_new_stream: no memory for buffer\n"); - i_errno = IENOMEMORY; + test->i_errno = IENOMEMORY; free(sp->result); free(sp); return NULL; @@ -5483,19 +5434,19 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, /* Create and randomize the buffer */ sp->buffer_fd = mkstemp(template); if (sp->buffer_fd == -1) { - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; free(sp->result); free(sp); return NULL; } if (unlink(template) < 0) { - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; free(sp->result); free(sp); return NULL; } if (ftruncate(sp->buffer_fd, test->settings->blksize) < 0) { - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; free(sp->result); free(sp); return NULL; @@ -5504,7 +5455,7 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, PROT_READ | PROT_WRITE, MAP_PRIVATE, sp->buffer_fd, 0); if (sp->buffer == MAP_FAILED) { - i_errno = IECREATESTREAM; + test->i_errno = IECREATESTREAM; free(sp->result); free(sp); return NULL; @@ -5523,7 +5474,7 @@ struct iperf_stream *iperf_new_stream(struct iperf_test *test, int s, sender ? O_RDONLY : (O_WRONLY | O_CREAT | O_TRUNC), S_IRUSR | S_IWUSR); if (sp->diskfile_fd == -1) { - i_errno = IEFILE; + test->i_errno = IEFILE; #if defined(CONFIG_NRF_IPERF3_INTEGRATION) free(sp->buffer); #else @@ -5592,7 +5543,7 @@ int iperf_init_stream(struct iperf_stream *sp, struct iperf_test *test) /* Not available, mocked one used instead */ if (nrf_iperf3_mock_getsockname(test, sp->socket, (struct sockaddr *)&sp->local_addr, &len) < 0) { - i_errno = IEINITSTREAM; + test->i_errno = IEINITSTREAM; return -1; } len = sizeof(struct sockaddr_storage); @@ -5600,17 +5551,17 @@ int iperf_init_stream(struct iperf_stream *sp, struct iperf_test *test) /* Not available, mocked one used instead */ if (nrf_iperf3_mock_getpeername(test, sp->socket, (struct sockaddr *)&sp->remote_addr, &len) < 0) { - i_errno = IEINITSTREAM; + test->i_errno = IEINITSTREAM; return -1; } #else if (getsockname(sp->socket, (struct sockaddr *) &sp->local_addr, &len) < 0) { - i_errno = IEINITSTREAM; + test->i_errno = IEINITSTREAM; return -1; } len = sizeof(struct sockaddr_storage); if (getpeername(sp->socket, (struct sockaddr *) &sp->remote_addr, &len) < 0) { - i_errno = IEINITSTREAM; + test->i_errno = IEINITSTREAM; return -1; } #endif @@ -5629,11 +5580,11 @@ int iperf_init_stream(struct iperf_stream *sp, struct iperf_test *test) #ifdef IPV6_TCLASS if (setsockopt(sp->socket, IPPROTO_IPV6, IPV6_TCLASS, &opt, sizeof(opt)) < 0) { - i_errno = IESETCOS; + test->i_errno = IESETCOS; return -1; } #else - i_errno = IESETCOS; + test->i_errno = IESETCOS; return -1; #endif } else { @@ -5641,7 +5592,7 @@ int iperf_init_stream(struct iperf_stream *sp, struct iperf_test *test) if (setsockopt(sp->socket, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)) < 0) { #endif - i_errno = IESETTOS; + test->i_errno = IESETTOS; return -1; #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) } @@ -5793,8 +5744,8 @@ void iperf_got_sigend(struct iperf_test *test) (void)Nwrite(test->ctrl_sck, (char *)&test->state, sizeof(signed char), Ptcp); } - i_errno = (test->role == 'c') ? IECLIENTTERM : IESERVERTERM; - iperf_errexit(test, "interrupt - %s", iperf_strerror(i_errno)); + test->i_errno = (test->role == 'c') ? IECLIENTTERM : IESERVERTERM; + iperf_errexit(test, "interrupt - %s", iperf_strerror(test->i_errno)); } /* Try to write a PID file if requested, return -1 on an error. */ @@ -5934,7 +5885,7 @@ int iperf_setaffinity(struct iperf_test *test, int affinity) CPU_ZERO(&cpu_set); CPU_SET(affinity, &cpu_set); if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; @@ -5943,7 +5894,7 @@ int iperf_setaffinity(struct iperf_test *test, int affinity) if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &test->cpumask) != 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } @@ -5952,7 +5903,7 @@ int iperf_setaffinity(struct iperf_test *test, int affinity) if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &cpumask) != 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; @@ -5961,12 +5912,12 @@ int iperf_setaffinity(struct iperf_test *test, int affinity) DWORD_PTR processAffinityMask = 1 << affinity; if (SetProcessAffinityMask(process, processAffinityMask) == 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; #else /* neither HAVE_SCHED_SETAFFINITY nor HAVE_CPUSET_SETAFFINITY nor HAVE_SETPROCESSAFFINITYMASK */ - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; #endif /* neither HAVE_SCHED_SETAFFINITY nor HAVE_CPUSET_SETAFFINITY nor HAVE_SETPROCESSAFFINITYMASK */ } @@ -5981,14 +5932,14 @@ int iperf_clearaffinity(struct iperf_test *test) for (i = 0; i < CPU_SETSIZE; ++i) CPU_SET(i, &cpu_set); if (sched_setaffinity(0, sizeof(cpu_set_t), &cpu_set) != 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; #elif defined(HAVE_CPUSET_SETAFFINITY) if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &test->cpumask) != 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; @@ -6000,12 +5951,12 @@ int iperf_clearaffinity(struct iperf_test *test) if (GetProcessAffinityMask(process, &processAffinityMask, &lpSystemAffinityMask) == 0 || SetProcessAffinityMask(process, lpSystemAffinityMask) == 0) { - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; } return 0; #else /* neither HAVE_SCHED_SETAFFINITY nor HAVE_CPUSET_SETAFFINITY nor HAVE_SETPROCESSAFFINITYMASK */ - i_errno = IEAFFINITY; + test->i_errno = IEAFFINITY; return -1; #endif /* neither HAVE_SCHED_SETAFFINITY nor HAVE_CPUSET_SETAFFINITY nor HAVE_SETPROCESSAFFINITYMASK */ } diff --git a/ext/iperf3/iperf_api.h b/ext/iperf3/iperf_api.h index 92b0ed55245e..4079906e217d 100644 --- a/ext/iperf3/iperf_api.h +++ b/ext/iperf3/iperf_api.h @@ -467,6 +467,8 @@ enum { IENOMEMORY = 302, // no dynamic memory from heap IETESTSTARTTIMEOUT = 303, // testing start timeout IEKILL = 304, // not an error but testing was killed + IETESTENDTIMEOUT = 305, // testing end timeout + IESELECTERRORFDS = 306, // one of the errorfds for select() failing #endif }; diff --git a/ext/iperf3/iperf_client_api.c b/ext/iperf3/iperf_client_api.c index cbfa1e7075ed..47fe0a1cc02d 100644 --- a/ext/iperf3/iperf_client_api.c +++ b/ext/iperf3/iperf_client_api.c @@ -81,7 +81,7 @@ iperf_create_streams(struct iperf_test *test, int sender) saved_errno = errno; close(s); errno = saved_errno; - i_errno = IESETCONGESTION; + test->i_errno = IESETCONGESTION; return -1; } } @@ -92,7 +92,7 @@ iperf_create_streams(struct iperf_test *test, int sender) saved_errno = errno; close(s); errno = saved_errno; - i_errno = IESETCONGESTION; + test->i_errno = IESETCONGESTION; return -1; } test->congestion_used = strdup(ca); @@ -107,7 +107,9 @@ iperf_create_streams(struct iperf_test *test, int sender) FD_SET(s, &test->write_set); else FD_SET(s, &test->read_set); - if (s > test->max_fd) test->max_fd = s; + + FD_SET(s, &test->err_set); + if (s > test->max_fd) test->max_fd = s; sp = iperf_new_stream(test, s, sender); if (!sp) @@ -128,6 +130,12 @@ test_timer_proc(TimerClientData client_data, struct iperf_time *nowP) test->timer = NULL; test->done = 1; + + iperf_printf(test, "%s", report_bw_separator); + iperf_printf(test, + "Test duration %d seconds elapsed - testing done. Exchanging the results next.\n", + test->duration); + iperf_printf(test, "%s", report_bw_separator); } static void @@ -159,7 +167,7 @@ create_client_timers(struct iperf_test * test) TimerClientData cd; if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } cd.p = test; @@ -168,21 +176,21 @@ create_client_timers(struct iperf_test * test) test->done = 0; test->timer = tmr_create(&now, test_timer_proc, cd, ( test->duration + test->omit ) * SEC_TO_US, 0); if (test->timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } if (test->stats_interval != 0) { test->stats_timer = tmr_create(&now, client_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1); if (test->stats_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } if (test->reporter_interval != 0) { test->reporter_timer = tmr_create(&now, client_reporter_timer_proc, cd, test->reporter_interval * SEC_TO_US, 1); if (test->reporter_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -218,14 +226,14 @@ create_client_omit_timer(struct iperf_test * test) test->omitting = 0; } else { if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } test->omitting = 1; cd.p = test; test->omit_timer = tmr_create(&now, client_omit_timer_proc, cd, test->omit * SEC_TO_US, 0); if (test->omit_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -244,10 +252,10 @@ iperf_handle_message_client(struct iperf_test *test) /*!!! Why is this read() and not Nread()? */ if ((rval = read(test->ctrl_sck, (char*) &test->state, sizeof(signed char))) <= 0) { if (rval == 0) { - i_errno = IECTRLCLOSE; + test->i_errno = IECTRLCLOSE; return -1; } else { - i_errno = IERECVMESSAGE; + test->i_errno = IERECVMESSAGE; return -1; } } @@ -324,7 +332,7 @@ iperf_handle_message_client(struct iperf_test *test) case IPERF_DONE: break; case SERVER_TERMINATE: - i_errno = IESERVERTERM; + test->i_errno = IESERVERTERM; /* * Temporarily be in DISPLAY_RESULTS phase so we can get @@ -339,22 +347,22 @@ iperf_handle_message_client(struct iperf_test *test) test->state = oldstate; return -1; case ACCESS_DENIED: - i_errno = IEACCESSDENIED; + test->i_errno = IEACCESSDENIED; return -1; case SERVER_ERROR: if (Nread(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) { - i_errno = IECTRLREAD; + test->i_errno = IECTRLREAD; return -1; } - i_errno = ntohl(err); + test->i_errno = ntohl(err); if (Nread(test->ctrl_sck, (char*) &err, sizeof(err), Ptcp) < 0) { - i_errno = IECTRLREAD; + test->i_errno = IECTRLREAD; return -1; } errno = ntohl(err); return -1; default: - i_errno = IEMESSAGE; + test->i_errno = IEMESSAGE; return -1; } @@ -377,12 +385,12 @@ iperf_connect(struct iperf_test *test) // Create the control channel using an ephemeral port test->ctrl_sck = netdial(test, test->settings->domain, Ptcp, test->bind_address, 0, test->server_hostname, test->server_port, test->settings->connect_timeout); if (test->ctrl_sck < 0) { - i_errno = IECONNECT; + test->i_errno = IECONNECT; return -1; } if (Nwrite(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) < 0) { - i_errno = IESENDCOOKIE; + test->i_errno = IESENDCOOKIE; return -1; } @@ -480,6 +488,8 @@ iperf_client_end(struct iperf_test *test) int retval = 0; /* closing control socket when DONE failed */ #endif + iperf_printf(test, "iperf3 testing is ending.\n"); + /* Close all stream sockets */ SLIST_FOREACH(sp, &test->streams, streams) { close(sp->socket); @@ -498,8 +508,9 @@ iperf_client_end(struct iperf_test *test) } /* Close control socket */ - if (test->ctrl_sck) + if (test->ctrl_sck) { close(test->ctrl_sck); + } return retval; } @@ -510,16 +521,18 @@ iperf_run_client(struct iperf_test * test) { int startup; int result = 0; - fd_set read_set, write_set; + fd_set read_set, write_set, err_set; struct iperf_time now; struct timeval* timeout = NULL; #if !defined (CONFIG_NRF_IPERF3_NONBLOCKING_CLIENT_CHANGES) struct iperf_stream *sp; #endif #if defined(CONFIG_NRF_IPERF3_INTEGRATION) - struct iperf_time connected_time; + struct iperf_time test_end_started_time; + struct iperf_time connected_time; /* wait testing start for max xx sec */ struct timeval test_start_tout = { .tv_sec = CONFIG_NRF_IPERF3_CLIENT_TEST_START_TIME, .tv_usec = 0 }; + struct timeval test_end_tout = { .tv_sec = CONFIG_NRF_IPERF3_CLIENT_TEST_ENDING_TIMEOUT, .tv_usec = 0 }; #endif if (test->logfile) @@ -562,46 +575,66 @@ iperf_run_client(struct iperf_test * test) startup = 1; while (test->state != IPERF_DONE) { + memcpy(&read_set, &test->read_set, sizeof(fd_set)); + memcpy(&write_set, &test->write_set, sizeof(fd_set)); #if defined(CONFIG_NRF_IPERF3_INTEGRATION) - if (test->kill_signal != NULL) { - int set, res; + memcpy(&err_set, &test->err_set, sizeof(fd_set)); + if (test->state == TEST_END || test->state == EXCHANGE_RESULTS || + test->state == DISPLAY_RESULTS || test->state == IPERF_DONE) { + struct iperf_time now; + struct iperf_time temp_time; + + /* We don't want to hang in TEST_END & later states more than a configured time. */ + iperf_time_now(&now); + iperf_time_diff(&test_end_started_time, &now, &temp_time); + + if (iperf_time_in_secs(&temp_time) > test_end_tout.tv_sec) { + test->i_errno = IETESTENDTIMEOUT; + iperf_printf(test, + "iperf_run_client (1): timeout to wait to test end, config " + "timeout value %d secs\n", + (uint32_t)test_end_tout.tv_sec); + goto cleanup_and_fail; + } + } - k_poll_signal_check(test->kill_signal, &set, &res); - if (set) { - k_poll_signal_reset(test->kill_signal); - iperf_printf(test, - "Kill signal received - exiting\n"); - i_errno = IEKILL; - goto cleanup_and_fail; - } + if (test->kill_signal != NULL) { + int set, res; + k_poll_signal_check(test->kill_signal, &set, &res); + if (set) { + k_poll_signal_reset(test->kill_signal); + iperf_printf(test, "Kill signal received (state %d) - exiting\n", test->state); + test->i_errno = IEKILL; + goto cleanup_and_fail; } + } #endif - memcpy(&read_set, &test->read_set, sizeof(fd_set)); - memcpy(&write_set, &test->write_set, sizeof(fd_set)); - iperf_time_now(&now); - timeout = tmr_timeout(&now); - result = select(test->max_fd + 1, &read_set, &write_set, NULL, timeout); + iperf_time_now(&now); + timeout = tmr_timeout(&now); + result = select(test->max_fd + 1, &read_set, &write_set, &err_set, timeout); #if defined(CONFIG_NRF_IPERF3_INTEGRATION) if (!test->state) { - /* ctrl socket connected but test not yet started: */ - struct iperf_time now; - struct iperf_time temp_time; - - iperf_time_now(&now); - iperf_time_diff(&connected_time, &now, &temp_time); - if (iperf_time_in_secs(&temp_time) > test_start_tout.tv_sec) { - i_errno = IETESTSTARTTIMEOUT; - if (test->debug) - iperf_printf(test, "iperf_run_client: timeout to wait to actual test start, config timeout value %d\n", (uint32_t)test_start_tout.tv_sec); - - goto cleanup_and_fail; - } + /* ctrl socket connected but test not yet started: */ + struct iperf_time now; + struct iperf_time temp_time; + + iperf_time_now(&now); + iperf_time_diff(&connected_time, &now, &temp_time); + if (iperf_time_in_secs(&temp_time) > test_start_tout.tv_sec) { + test->i_errno = IETESTSTARTTIMEOUT; + if (test->debug) { + iperf_printf(test, + "iperf_run_client: timeout to wait to actual test start, " + "config timeout value %d secs\n", + (uint32_t)test_start_tout.tv_sec); + } + goto cleanup_and_fail; + } } - #endif if (result < 0 && errno != EINTR) { - i_errno = IESELECT; + test->i_errno = IESELECT; if (test->debug) { iperf_printf(test, "iperf_run_client: select failed: %d\n", result); } @@ -616,28 +649,46 @@ iperf_run_client(struct iperf_test * test) } goto cleanup_and_fail; } - FD_CLR(test->ctrl_sck, &read_set); + FD_CLR(test->ctrl_sck, &read_set); } - } + +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) + /* Handle failures */ + if (FD_ISSET(test->ctrl_sck, &err_set)) { + iperf_printf(test, + "client: select(): control socket (%d) is having error condition " + "(state %d).\n", + test->ctrl_sck, test->state); + test->i_errno = IESELECTERRORFDS; + goto cleanup_and_fail; + } +#endif + } #if defined(CONFIG_NRF_IPERF3_INTEGRATION)//added due to early test jamn where rx buffer was full between modem and app - if (test->state == TEST_START || - test->state == PARAM_EXCHANGE || - test->state == CREATE_STREAMS /* || - test->state == SERVER_TERMINATE || - test->state == CLIENT_TERMINATE || */) { - if (iperf_recv(test, &read_set) < 0) - goto cleanup_and_fail; - } else if (test->state == EXCHANGE_RESULTS) { - int retval = iperf_recv(test, &read_set); - if (retval < 0) { - /* let's ignore errors from stream/testing sockets */ - if (test->debug) - iperf_printf(test, "iperf_recv for stream socket in EXCHANGE_RESULTS failed %d but ignored\n", retval); - } - } else + if (test->state == TEST_START || + test->state == PARAM_EXCHANGE || + test->state == CREATE_STREAMS /* || + test->state == SERVER_TERMINATE || + test->state == CLIENT_TERMINATE || */) { + if (iperf_recv(test, &read_set) < 0) { + goto cleanup_and_fail; + } + } else if (test->state == EXCHANGE_RESULTS || test->state == DISPLAY_RESULTS || + test->state == IPERF_DONE) { + int retval = iperf_recv(test, &read_set); + if (retval < 0) { + /* let's ignore errors from stream/testing sockets */ + if (test->debug) { + iperf_printf(test, + "iperf_recv for stream socket in EXCHANGE_RESULTS " + "failed %d but ignored\n", + retval); + } + } + } else #endif - if (test->state == TEST_RUNNING) { + if (test->state == TEST_RUNNING) { /* Is this our first time really running? */ if (startup) { @@ -685,9 +736,9 @@ iperf_run_client(struct iperf_test * test) } } - /* Run the timers. */ - iperf_time_now(&now); - tmr_run(&now); + /* Run the timers. */ + iperf_time_now(&now); + tmr_run(&now); /* Is the test done yet? */ if ((!test->omitting) && @@ -706,8 +757,8 @@ iperf_run_client(struct iperf_test * test) /* Yes, done! Send TEST_END. */ test->done = 1; if (test->debug) { - iperf_printf(test, "iperf_run_client: Yes, done! Send TEST_END\n"); - } + iperf_printf(test, "iperf_run_client: Yes, testing done! Send TEST_END\n"); + } #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) cpu_util(test->cpu_util); #endif @@ -718,23 +769,80 @@ iperf_run_client(struct iperf_test * test) iperf_printf(test, "iperf_run_client: TEST_END SENDING FAILED\n"); } goto cleanup_and_fail; - } + } +#if defined(CONFIG_NRF_IPERF3_NONBLOCKING_CLIENT_CHANGES) + if (true) { + struct iperf_stream *spp; + + /* Read one more time before closing */ + (void)iperf_recv(test, &read_set); + + /* Eliminate all possible data transfer from modem by closing the socket */ + iperf_printf(test, "Testing done: closing data sockets.\n"); + + /* Close all data sockets */ + SLIST_FOREACH(spp, &test->streams, streams) + { + close(spp->socket); + FD_CLR(spp->socket, &test->read_set); + FD_CLR(spp->socket, &test->write_set); + FD_CLR(spp->socket, &test->err_set); + FD_CLR(spp->socket, &read_set); + FD_CLR(spp->socket, &write_set); + FD_CLR(spp->socket, &err_set); + } + } +#endif + +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) + iperf_time_now(&test_end_started_time); +#endif } } /* test->state == TEST_RUNNING */ - // If we're in reverse mode, continue draining the data + // If we're in reverse or bidirectional mode, continue draining the data // connection(s) even if test is over. This prevents a // deadlock where the server side fills up its pipe(s) // and gets blocked, so it can't receive state changes // from the client side. - else if (test->mode == RECEIVER && test->state == TEST_END) { - if (iperf_recv(test, &read_set) < 0) { - if (test->debug) { - iperf_printf(test, "iperf_run_client: RECEIVER TEST_END iperf_recv failed\n"); - } - goto cleanup_and_fail; - } +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) + else if (test->state == TEST_END) { + struct iperf_time now; + struct iperf_time temp_time; + + if (test->mode == BIDIRECTIONAL || test->mode == RECEIVER) { + if (iperf_recv(test, &read_set) < 0) { + if (test->debug) { + iperf_printf(test, + "iperf_run_client: RECEIVER/BIDIRECTIONAL " + "TEST_END iperf_recv failed\n"); + } + goto cleanup_and_fail; + } + } + + /* We don't want to hang in TEST_END more than a configured time*/ + iperf_time_now(&now); + iperf_time_diff(&test_end_started_time, &now, &temp_time); + if (iperf_time_in_secs(&temp_time) > test_end_tout.tv_sec) { + test->i_errno = IETESTENDTIMEOUT; + iperf_printf(test, + "iperf_run_client (2): timeout to wait to test end, config " + "timeout value %d secs\n", + (uint32_t)test_end_tout.tv_sec); + goto cleanup_and_fail; + } } - } +#else + else if (test->mode == RECEIVER && test->state == TEST_END) { + if (iperf_recv(test, &read_set) < 0) { + if (test->debug) { + iperf_printf(test, "iperf_run_client: RECEIVER TEST_END iperf_recv failed\n"); + } + goto cleanup_and_fail; + } + } +#endif + } if (test->json_output) { if (iperf_json_finish(test) < 0) diff --git a/ext/iperf3/iperf_error.c b/ext/iperf3/iperf_error.c index e58cd475c246..de63b98a2a9f 100644 --- a/ext/iperf3/iperf_error.c +++ b/ext/iperf3/iperf_error.c @@ -161,8 +161,7 @@ iperf_errexit(struct iperf_test *test, const char *format, ...) int i_errno; -char * -iperf_strerror(int int_errno) +char *iperf_strerror(int int_errno) { static char errstr[256]; int len, perr, herr; @@ -263,9 +262,15 @@ iperf_strerror(int int_errno) case IETESTSTARTTIMEOUT: snprintf(errstr, len, "timeout for waiting actual test to be started"); break; + case IETESTENDTIMEOUT: + snprintf(errstr, len, "timeout for waiting actual test to be ended"); + break; case IEKILL: snprintf(errstr, len, "kill signal received - aborting"); break; + case IESELECTERRORFDS: + snprintf(errstr, len, "select() is informing that one of the testing sockets are having error condition"); + break; #endif case IEINITTEST: snprintf(errstr, len, "test initialization failed"); diff --git a/ext/iperf3/iperf_main.c b/ext/iperf3/iperf_main.c index be37290f6cee..0ca00a3a62b2 100644 --- a/ext/iperf3/iperf_main.c +++ b/ext/iperf3/iperf_main.c @@ -130,7 +130,7 @@ iperf_main(int argc, char **argv) } else { - iperf_err(test, "parameter error - %s", iperf_strerror(i_errno)); + iperf_err(test, "parameter error - %s", iperf_strerror(test->i_errno)); fprintf(stderr, "\n"); nrf_iperf3_usage(); retval = -1; @@ -139,7 +139,7 @@ iperf_main(int argc, char **argv) } if (retval == 0 && run(test) < 0) { - iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); + iperf_errexit(test, "error - %s", iperf_strerror(test->i_errno)); retval = -1; } @@ -163,14 +163,14 @@ iperf_main(int argc, char **argv) iperf_defaults(test); /* sets defaults */ if (iperf_parse_arguments(test, argc, argv) < 0) { - iperf_err(test, "parameter error - %s", iperf_strerror(i_errno)); + iperf_err(test, "parameter error - %s", iperf_strerror(test->i_errno)); fprintf(stderr, "\n"); usage_long(stdout); exit(1); } if (run(test) < 0) - iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); + iperf_errexit(test, "error - %s", iperf_strerror(test->i_errno)); iperf_free_test(test); @@ -223,14 +223,14 @@ run(struct iperf_test *test) int rc; rc = daemon(0, 0); if (rc < 0) { - i_errno = IEDAEMON; - iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); + test->i_errno = IEDAEMON; + iperf_errexit(test, "error - %s", iperf_strerror(test->i_errno)); return -1; } } if (iperf_create_pidfile(test) < 0) { - i_errno = IEPIDFILE; - iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); + test->i_errno = IEPIDFILE; + iperf_errexit(test, "error - %s", iperf_strerror(test->i_errno)); return -1; } #endif @@ -238,7 +238,7 @@ run(struct iperf_test *test) int rc; rc = iperf_run_server(test); if (rc < 0) { - iperf_err(test, "error - %s", iperf_strerror(i_errno)); + iperf_err(test, "error - %s", iperf_strerror(test->i_errno)); if (rc < -1) { iperf_errexit(test, "exiting"); return -1; @@ -247,7 +247,7 @@ run(struct iperf_test *test) iperf_reset_test(test); if (iperf_get_test_one_off(test)) { /* Authentication failure doesn't count for 1-off test */ - if (rc < 0 && i_errno == IEAUTHTEST) { + if (rc < 0 && test->i_errno == IEAUTHTEST) { continue; } break; @@ -259,7 +259,7 @@ run(struct iperf_test *test) break; case 'c': if (iperf_run_client(test) < 0) { - iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); + iperf_errexit(test, "error - %s", iperf_strerror(test->i_errno)); return -1; } break; diff --git a/ext/iperf3/iperf_server_api.c b/ext/iperf3/iperf_server_api.c index 1ac60ee1e9bc..66325fcdd5c6 100644 --- a/ext/iperf3/iperf_server_api.c +++ b/ext/iperf3/iperf_server_api.c @@ -83,7 +83,7 @@ iperf_server_listen(struct iperf_test *test) test->settings->domain = AF_INET; goto retry; } else { - i_errno = IELISTEN; + test->i_errno = IELISTEN; return -1; } } @@ -135,7 +135,7 @@ iperf_accept(struct iperf_test *test) } if ((s = accept(test->listener, (struct sockaddr *)&addr, &len)) < 0) { - i_errno = IEACCEPT; + test->i_errno = IEACCEPT; return -1; } #ifdef SO_RCVTIMEO @@ -154,7 +154,7 @@ iperf_accept(struct iperf_test *test) len = sizeof(addr); if ((s = accept(test->listener, (struct sockaddr *) &addr, &len)) < 0) { - i_errno = IEACCEPT; + test->i_errno = IEACCEPT; return -1; } #endif @@ -162,7 +162,7 @@ iperf_accept(struct iperf_test *test) /* Server free, accept new client */ test->ctrl_sck = s; if (Nread(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) < 0) { - i_errno = IERECVCOOKIE; + test->i_errno = IERECVCOOKIE; return -1; } FD_SET(test->ctrl_sck, &test->read_set); @@ -183,7 +183,7 @@ iperf_accept(struct iperf_test *test) * Just send ACCESS_DENIED. */ if (Nwrite(s, (char*) &rbuf, sizeof(rbuf), Ptcp) < 0) { - i_errno = IESENDMESSAGE; + test->i_errno = IESENDMESSAGE; return -1; } close(s); @@ -211,11 +211,11 @@ iperf_handle_message_server(struct iperf_test *test) if ((rval = Nread(test->ctrl_sck, (char*) &test->state, sizeof(signed char), Ptcp)) <= 0) { if (rval == 0) { iperf_err(test, "the client has unexpectedly closed the connection"); - i_errno = IECTRLCLOSE; + test->i_errno = IECTRLCLOSE; test->state = IPERF_DONE; return 0; } else { - i_errno = IERECVMESSAGE; + test->i_errno = IERECVMESSAGE; return -1; } } @@ -247,7 +247,7 @@ iperf_handle_message_server(struct iperf_test *test) case IPERF_DONE: break; case CLIENT_TERMINATE: - i_errno = IECLIENTTERM; + test->i_errno = IECLIENTTERM; // Temporarily be in DISPLAY_RESULTS phase so we can get // ending summary statistics. @@ -269,7 +269,7 @@ iperf_handle_message_server(struct iperf_test *test) test->state = IPERF_DONE; break; default: - i_errno = IEMESSAGE; + test->i_errno = IEMESSAGE; return -1; } @@ -328,7 +328,7 @@ create_server_timers(struct iperf_test * test) int grace_period = max_rtt * state_transitions; if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } cd.p = test; @@ -337,7 +337,7 @@ create_server_timers(struct iperf_test * test) test->done = 0; test->timer = tmr_create(&now, server_timer_proc, cd, (test->duration + test->omit + grace_period) * SEC_TO_US, 0); if (test->timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -346,14 +346,14 @@ create_server_timers(struct iperf_test * test) if (test->stats_interval != 0) { test->stats_timer = tmr_create(&now, server_stats_timer_proc, cd, test->stats_interval * SEC_TO_US, 1); if (test->stats_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } if (test->reporter_interval != 0) { test->reporter_timer = tmr_create(&now, server_reporter_timer_proc, cd, test->reporter_interval * SEC_TO_US, 1); if (test->reporter_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -389,14 +389,14 @@ create_server_omit_timer(struct iperf_test * test) test->omitting = 0; } else { if (iperf_time_now(&now) < 0) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } test->omitting = 1; cd.p = test; test->omit_timer = tmr_create(&now, server_omit_timer_proc, cd, test->omit * SEC_TO_US, 0); if (test->omit_timer == NULL) { - i_errno = IEINITTEST; + test->i_errno = IEINITTEST; return -1; } } @@ -513,7 +513,7 @@ iperf_run_server(struct iperf_test *test) k_poll_signal_reset(test->kill_signal); iperf_printf(test, "Kill signal received - exiting\n"); cleanup_server(test); - i_errno = IEKILL; + test->i_errno = IEKILL; return -2; } } @@ -522,7 +522,7 @@ iperf_run_server(struct iperf_test *test) // Check if average transfer rate was exceeded (condition set in the callback routines) if (test->bitrate_limit_exceeded) { cleanup_server(test); - i_errno = IETOTALRATE; + test->i_errno = IETOTALRATE; return -1; } @@ -535,7 +535,7 @@ iperf_run_server(struct iperf_test *test) if (result < 0 && errno != EINTR) { cleanup_server(test); - i_errno = IESELECT; + test->i_errno = IESELECT; return -1; } if (result > 0) { @@ -599,7 +599,7 @@ iperf_run_server(struct iperf_test *test) close(s); cleanup_server(test); errno = saved_errno; - i_errno = IESETCONGESTION; + test->i_errno = IESETCONGESTION; return -1; } } @@ -612,7 +612,7 @@ iperf_run_server(struct iperf_test *test) close(s); cleanup_server(test); errno = saved_errno; - i_errno = IESETCONGESTION; + test->i_errno = IESETCONGESTION; return -1; } test->congestion_used = strdup(ca); @@ -679,7 +679,7 @@ iperf_run_server(struct iperf_test *test) test->listener = 0; if ((s = netannounce(test, test->settings->domain, Ptcp, test->bind_address, test->server_port)) < 0) { cleanup_server(test); - i_errno = IELISTEN; + test->i_errno = IELISTEN; return -1; } test->listener = s; @@ -695,7 +695,7 @@ iperf_run_server(struct iperf_test *test) iperf_err(test, "Client total requested throughput rate of %" PRIu64 " bps exceeded %" PRIu64 " bps limit", total_requested_rate, test->settings->bitrate_limit); cleanup_server(test); - i_errno = IETOTALRATE; + test->i_errno = IETOTALRATE; return -1; } diff --git a/ext/iperf3/iperf_tcp.c b/ext/iperf3/iperf_tcp.c index 37ef5b19447a..a1dca552e2be 100644 --- a/ext/iperf3/iperf_tcp.c +++ b/ext/iperf3/iperf_tcp.c @@ -168,18 +168,18 @@ iperf_tcp_accept(struct iperf_test * test) #endif len = sizeof(addr); if ((s = accept(test->listener, (struct sockaddr *) &addr, &len)) < 0) { - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } if (Nread(s, cookie, COOKIE_SIZE, Ptcp) < 0) { - i_errno = IERECVCOOKIE; + test->i_errno = IERECVCOOKIE; return -1; } if (strcmp(test->cookie, cookie) != 0) { if (Nwrite(s, (char*) &rbuf, sizeof(rbuf), Ptcp) < 0) { - i_errno = IESENDMESSAGE; + test->i_errno = IESENDMESSAGE; return -1; } close(s); @@ -251,13 +251,13 @@ iperf_tcp_listen(struct iperf_test *test) hints.ai_flags = AI_PASSIVE; if ((gerror = getaddrinfo(test->bind_address, portstr, &hints, &res)) != 0) { - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } if ((s = socket(res->ai_family, SOCK_STREAM, 0)) < 0) { freeaddrinfo(res); - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } @@ -267,7 +267,7 @@ iperf_tcp_listen(struct iperf_test *test) int ret = iperf_util_socket_pdn_id_set(s, test->pdn_id_str); if (ret != 0) { iperf_printf(test, "iperf_tcp_listen: cannot bind socket with PDN ID %s\n", test->pdn_id_str); - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } } @@ -279,7 +279,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IESETNODELAY; + test->i_errno = IESETNODELAY; return -1; } } @@ -292,7 +292,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IESETMSS; + test->i_errno = IESETMSS; return -1; #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) /* not supported */ } @@ -306,7 +306,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) /* not supported */ } @@ -317,7 +317,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } #endif @@ -353,7 +353,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IEREUSEADDR; + test->i_errno = IEREUSEADDR; return -1; } @@ -375,7 +375,7 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IEV6ONLY; + test->i_errno = IEV6ONLY; return -1; } } @@ -386,14 +386,14 @@ iperf_tcp_listen(struct iperf_test *test) close(s); freeaddrinfo(res); errno = saved_errno; - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } freeaddrinfo(res); if (listen(s, INT_MAX) < 0) { - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } @@ -407,14 +407,14 @@ iperf_tcp_listen(struct iperf_test *test) saved_errno = errno; close(s); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { printf("SNDBUF is %u, expecting %u\n", sndbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > sndbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } #endif @@ -426,14 +426,14 @@ iperf_tcp_listen(struct iperf_test *test) saved_errno = errno; close(s); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { printf("RCVBUF is %u, expecting %u\n", rcvbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > rcvbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } @@ -476,7 +476,7 @@ iperf_tcp_connect(struct iperf_test *test) hints.ai_family = test->settings->domain; hints.ai_socktype = SOCK_STREAM; if ((gerror = getaddrinfo(test->bind_address, NULL, &hints, &local_res)) != 0) { - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } } @@ -498,7 +498,7 @@ iperf_tcp_connect(struct iperf_test *test) if ((gerror = getaddrinfo(test->server_hostname, portstr, &hints, &server_res)) != 0) { if (test->bind_address) freeaddrinfo(local_res); - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } #if defined(CONFIG_NRF_IPERF3_INTEGRATION) //wildcard not supported @@ -509,7 +509,7 @@ iperf_tcp_connect(struct iperf_test *test) if (test->bind_address) freeaddrinfo(local_res); freeaddrinfo(server_res); - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } @@ -519,7 +519,7 @@ iperf_tcp_connect(struct iperf_test *test) int ret = iperf_util_socket_pdn_id_set(s, test->pdn_id_str); if (ret != 0) { iperf_printf(test, "iperf_tcp_connect: cannot bind socket with PDN ID %s\n", test->pdn_id_str); - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } } @@ -540,7 +540,7 @@ iperf_tcp_connect(struct iperf_test *test) freeaddrinfo(local_res); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } freeaddrinfo(local_res); @@ -572,7 +572,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IEPROTOCOL; + test->i_errno = IEPROTOCOL; return -1; } @@ -581,7 +581,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } } @@ -594,7 +594,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETNODELAY; + test->i_errno = IESETNODELAY; return -1; } } @@ -606,7 +606,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETMSS; + test->i_errno = IESETMSS; return -1; #if !defined(CONFIG_NRF_IPERF3_INTEGRATION) /* not supported */ } @@ -619,7 +619,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } @@ -628,7 +628,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } #else @@ -646,14 +646,14 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { printf("SNDBUF is %u, expecting %u\n", sndbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > sndbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } #endif @@ -666,14 +666,14 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { printf("RCVBUF is %u, expecting %u\n", rcvbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > rcvbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } #endif @@ -691,7 +691,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETFLOW; + test->i_errno = IESETFLOW; return -1; } else { struct sockaddr_in6* sa6P = (struct sockaddr_in6*) server_res->ai_addr; @@ -711,7 +711,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETFLOW; + test->i_errno = IESETFLOW; return -1; } sa6P->sin6_flowinfo = freq->flr_label; @@ -722,7 +722,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESETFLOW; + test->i_errno = IESETFLOW; return -1; } } @@ -760,7 +760,7 @@ iperf_tcp_connect(struct iperf_test *test) close(s); freeaddrinfo(server_res); errno = saved_errno; - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } @@ -771,7 +771,7 @@ iperf_tcp_connect(struct iperf_test *test) saved_errno = errno; close(s); errno = saved_errno; - i_errno = IESENDCOOKIE; + test->i_errno = IESENDCOOKIE; return -1; } diff --git a/ext/iperf3/iperf_udp.c b/ext/iperf3/iperf_udp.c index fa8d35726c3e..5f2d5bf5b568 100644 --- a/ext/iperf3/iperf_udp.c +++ b/ext/iperf3/iperf_udp.c @@ -80,8 +80,164 @@ iperf_udp_recv(struct iperf_stream *sp) double transit = 0, d = 0; struct iperf_time sent_time, arrival_time, temp_time; - r = Nread(sp->socket, sp->buffer, size, Pudp); +#if defined(CONFIG_NRF_IPERF3_INTEGRATION) +#define MAX_READ_COUNT 20 /* in case of very small buffers, \ + * let's not stuck here more than count + */ + int count = 0; + int q; + int total_received = 0; + + /* In embedded world, especially for bi-dir transfer, + * we need to read more from rcv buffer to avoid deadlocks. + */ + do { + q = Nread(sp->socket, sp->buffer, size, Pudp); + if (q <= 0) { + break; + } + + total_received += q; + count++; + + /* Only count bytes received while we're in the correct state. */ + if (sp->test->state == TEST_RUNNING) { + /* + * For jitter computation below, it's important to know if this + * packet is the first packet received. + */ + if (sp->result->bytes_received == 0) { + first_packet = 1; + } + + sp->result->bytes_received += q; + sp->result->bytes_received_this_interval += q; + + /* Dig the various counters out of the incoming UDP packet */ + if (sp->test->udp_counters_64bit) { + memcpy(&sec, sp->buffer, sizeof(sec)); + memcpy(&usec, sp->buffer + 4, sizeof(usec)); + memcpy(&pcount, sp->buffer + 8, sizeof(pcount)); + sec = ntohl(sec); + usec = ntohl(usec); + pcount = ntohll(pcount); + sent_time.secs = sec; + sent_time.usecs = usec; + } else { + uint32_t pc; + + memcpy(&sec, sp->buffer, sizeof(sec)); + memcpy(&usec, sp->buffer + 4, sizeof(usec)); + memcpy(&pc, sp->buffer + 8, sizeof(pc)); + sec = ntohl(sec); + usec = ntohl(usec); + pcount = ntohl(pc); + sent_time.secs = sec; + sent_time.usecs = usec; + } + + if (sp->test->debug) { + iperf_printf(sp->test, "pcount %d packet_count %d\n", (uint32_t)pcount, + sp->packet_count); + } + + /* + * Try to handle out of order packets. The way we do this + * uses a constant amount of storage but might not be + * correct in all cases. In particular we seem to have the + * assumption that packets can't be duplicated in the network, + * because duplicate packets will possibly cause some problems here. + * + * First figure out if the sequence numbers are going forward. + * Note that pcount is the sequence number read from the packet, + * and sp->packet_count is the highest sequence number seen so + * far (so we're expecting to see the packet with sequence number + * sp->packet_count + 1 arrive next). + */ + if (pcount >= sp->packet_count + 1) { + + /* Forward, but is there a gap in sequence numbers? */ + if (pcount > sp->packet_count + 1) { + /* There's a gap so count that as a loss. */ + sp->cnt_error += (pcount - 1) - sp->packet_count; + } + /* Update the highest sequence number seen so far. */ + sp->packet_count = pcount; + } else { + + /* + * Sequence number went backward (or was stationary?!?). + * This counts as an out-of-order packet. + */ + sp->outoforder_packets++; + + /* + * If we have lost packets, then the fact that we are now + * seeing an out-of-order packet offsets a prior sequence + * number gap that was counted as a loss. So we can take + * away a loss. + */ + if (sp->cnt_error > 0) { + sp->cnt_error--; + } + + /* Log the out-of-order packet */ + + /* 64bit varaiable printing not working */ + if (sp->test->debug) { + iperf_printf(sp->test, + "OUT OF ORDER - incoming packet sequence %d but " + "expected sequence %d on stream %d", + (uint32_t)pcount, sp->packet_count + 1, + sp->socket); + } + } + + /* + * jitter measurement + * + * This computation is based on RFC 1889 (specifically + * sections 6.3.1 and A.8). + * + * Note that synchronized clocks are not required since + * the source packet delta times are known. Also this + * computation does not require knowing the round-trip + * time. + */ + iperf_time_now(&arrival_time); + + iperf_time_diff(&arrival_time, &sent_time, &temp_time); + transit = iperf_time_in_secs(&temp_time); + + /* Hack to handle the first packet by initializing prev_transit. */ + if (first_packet) { + sp->prev_transit = transit; + } + + d = transit - sp->prev_transit; + if (d < 0) { + d = -d; + } + + sp->prev_transit = transit; + sp->jitter += (d - sp->jitter) / 16.0; + } else { + if (sp->test->debug) { + iperf_printf(sp->test, + "UDP Early/Late receive, state = %d, count: %d\n", + sp->test->state, q); + } + } + + } while (q > 0 && count < MAX_READ_COUNT); + if (q < 0) { + r = q; + } else { + r = total_received; + } +#else + r = Nread(sp->socket, sp->buffer, size, Pudp); /* * If we got an error in the read, or if we didn't read anything * because the underlying read(2) got a EAGAIN, then skip packet @@ -111,11 +267,7 @@ iperf_udp_recv(struct iperf_stream *sp) memcpy(&pcount, sp->buffer+8, sizeof(pcount)); sec = ntohl(sec); usec = ntohl(usec); -#if defined(CONFIG_NRF_IPERF3_INTEGRATION) - pcount = ntohll(pcount); -#else pcount = be64toh(pcount); -#endif sent_time.secs = sec; sent_time.usecs = usec; } @@ -131,14 +283,9 @@ iperf_udp_recv(struct iperf_stream *sp) sent_time.usecs = usec; } -#if defined(CONFIG_NRF_IPERF3_INTEGRATION) - /* ....because 64bit printing ain't working */ - if (sp->test->debug) - iperf_printf(sp->test, "pcount %d packet_count %d\n", (uint32_t)pcount, sp->packet_count); -#else if (sp->test->debug) fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); -#endif + /* * Try to handle out of order packets. The way we do this * uses a constant amount of storage but might not be @@ -163,7 +310,7 @@ iperf_udp_recv(struct iperf_stream *sp) sp->packet_count = pcount; } else { - /* + /* * Sequence number went backward (or was stationary?!?). * This counts as an out-of-order packet. */ @@ -177,17 +324,12 @@ iperf_udp_recv(struct iperf_stream *sp) */ if (sp->cnt_error > 0) sp->cnt_error--; - + /* Log the out-of-order packet */ - -#if !defined(CONFIG_NRF_IPERF3_INTEGRATION) - if (sp->test->debug) - fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count + 1, sp->socket); -#else + /* 64bit varaiable printing not working */ - if (sp->test->debug) + if (sp->test->debug) iperf_printf(sp->test, "OUT OF ORDER - incoming packet sequence %d but expected sequence %d on stream %d", (uint32_t)pcount, sp->packet_count + 1, sp->socket); -#endif } /* @@ -216,12 +358,8 @@ iperf_udp_recv(struct iperf_stream *sp) sp->prev_transit = transit; sp->jitter += (d - sp->jitter) / 16.0; } -#if defined(CONFIG_NRF_IPERF3_INTEGRATION) - else { - if (sp->test->debug) - iperf_printf(sp->test, "UDP Early/Late receive, state = %d, count: %d\n", sp->test->state, r); - } -#endif +#endif /* CONFIG_NRF_IPERF3_INTEGRATION */ + return r; } @@ -253,11 +391,11 @@ iperf_udp_send(struct iperf_stream *sp) #else pcount = htobe64(sp->packet_count); #endif - + memcpy(sp->buffer, &sec, sizeof(sec)); memcpy(sp->buffer+4, &usec, sizeof(usec)); memcpy(sp->buffer+8, &pcount, sizeof(pcount)); - + } else { @@ -266,13 +404,12 @@ iperf_udp_send(struct iperf_stream *sp) sec = htonl(before.secs); usec = htonl(before.usecs); pcount = htonl(sp->packet_count); - + memcpy(sp->buffer, &sec, sizeof(sec)); memcpy(sp->buffer+4, &usec, sizeof(usec)); memcpy(sp->buffer+8, &pcount, sizeof(pcount)); - - } + } r = Nwrite(sp->socket, sp->buffer, size, Pudp); if (r < 0) @@ -322,28 +459,28 @@ iperf_udp_buffercheck(struct iperf_test *test, int s) */ int opt; socklen_t optlen; - + if ((opt = test->settings->socket_bufsize)) { if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) { - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)) < 0) { - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } } /* Read back and verify the sender socket buffer size */ optlen = sizeof(sndbuf_actual); if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_actual, &optlen) < 0) { - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { iperf_printf(test, "SNDBUF is %u, expecting %u\n", sndbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > sndbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } if (test->settings->blksize > sndbuf_actual) { @@ -360,14 +497,14 @@ iperf_udp_buffercheck(struct iperf_test *test, int s) /* Read back and verify the receiver socket buffer size */ optlen = sizeof(rcvbuf_actual); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, &rcvbuf_actual, &optlen) < 0) { - i_errno = IESETBUF; + test->i_errno = IESETBUF; return -1; } if (test->debug) { iperf_printf(test, "RCVBUF is %u, expecting %u\n", rcvbuf_actual, test->settings->socket_bufsize); } if (test->settings->socket_bufsize && test->settings->socket_bufsize > rcvbuf_actual) { - i_errno = IESETBUF2; + test->i_errno = IESETBUF2; return -1; } if (test->settings->blksize > rcvbuf_actual) { @@ -418,12 +555,12 @@ iperf_udp_accept(struct iperf_test *test) */ len = sizeof(sa_peer); if ((sz = recvfrom(test->prot_listener, &buf, sizeof(buf), 0, (struct sockaddr *) &sa_peer, &len)) < 0) { - i_errno = IESTREAMACCEPT; + test->i_errno = IESTREAMACCEPT; return -1; } if (connect(s, (struct sockaddr *) &sa_peer, len) < 0) { - i_errno = IESTREAMACCEPT; + test->i_errno = IESTREAMACCEPT; return -1; } @@ -447,7 +584,7 @@ iperf_udp_accept(struct iperf_test *test) return rc; } } - + #if defined(HAVE_SO_MAX_PACING_RATE) /* If socket pacing is specified, try it. */ if (test->settings->fqrate) { @@ -479,7 +616,7 @@ iperf_udp_accept(struct iperf_test *test) */ test->prot_listener = netannounce(test, test->settings->domain, Pudp, test->bind_address, test->server_port); if (test->prot_listener < 0) { - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } @@ -492,8 +629,8 @@ iperf_udp_accept(struct iperf_test *test) if (write(s, &buf, sizeof(buf)) < 0) { #else if (send(s, &buf, sizeof(buf), 0) < 0) { -#endif - i_errno = IESTREAMWRITE; +#endif + test->i_errno = IESTREAMWRITE; return -1; } @@ -514,7 +651,7 @@ iperf_udp_listen(struct iperf_test *test) int s; if ((s = netannounce(test, test->settings->domain, Pudp, test->bind_address, test->server_port)) < 0) { - i_errno = IESTREAMLISTEN; + test->i_errno = IESTREAMLISTEN; return -1; } @@ -534,14 +671,11 @@ int iperf_udp_connect(struct iperf_test *test) { int s, buf, sz; -#ifdef SO_RCVTIMEO - struct timeval tv; -#endif int rc; /* Create and bind our local socket. */ if ((s = netdial(test, test->settings->domain, Pudp, test->bind_address, test->bind_port, test->server_hostname, test->server_port, -1)) < 0) { - i_errno = IESTREAMCONNECT; + test->i_errno = IESTREAMCONNECT; return -1; } @@ -565,7 +699,7 @@ iperf_udp_connect(struct iperf_test *test) return rc; } } - + #if defined(HAVE_SO_MAX_PACING_RATE) /* If socket pacing is available and not disabled, try it. */ if (test->settings->fqrate) { @@ -593,14 +727,29 @@ iperf_udp_connect(struct iperf_test *test) } #if defined(CONFIG_NRF_IPERF3_INTEGRATION) -#ifdef SO_RCVTIMEO + struct timeval tv; + /* 30 sec timeout for a case when there is a network problem. */ tv.tv_sec = 30; tv.tv_usec = 0; +#ifdef SO_RCVTIMEO if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)&tv, sizeof(struct timeval)) < 0) { - warning(test, "Unable to set socket SO_RCVTIMEO"); + warning(test, "Unable to set socket SO_RCVTIMEO"); } #endif +#ifdef SO_SNDTIMEO + if (setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, + (struct timeval *)&tv, sizeof(struct timeval)) < 0) { + warning(test, "Unable to set socket SO_SNDTIMEO"); + } +#endif + + int val = 1; + size_t len = sizeof(val); + + if (setsockopt(s, IPPROTO_ALL, SO_SILENCE_ALL, &val, len) < 0) { + iperf_printf(test, "Unable to set socket SO_SILENCE_ALL: %d\n", s); + } #endif /* @@ -609,8 +758,8 @@ iperf_udp_connect(struct iperf_test *test) */ buf = 123456789; /* this can be pretty much anything */ if (write(s, &buf, sizeof(buf)) < 0) { - // XXX: Should this be changed to IESTREAMCONNECT? - i_errno = IESTREAMWRITE; + // XXX: Should this be changed to IESTREAMCONNECT? + test->i_errno = IESTREAMWRITE; return -1; } @@ -618,7 +767,7 @@ iperf_udp_connect(struct iperf_test *test) * Wait until the server replies back to us. */ if ((sz = recv(s, &buf, sizeof(buf), 0)) < 0) { - i_errno = IESTREAMREAD; + test->i_errno = IESTREAMREAD; return -1; } diff --git a/ext/iperf3/net.c b/ext/iperf3/net.c index f58f74aa476b..963e88fcb678 100644 --- a/ext/iperf3/net.c +++ b/ext/iperf3/net.c @@ -100,7 +100,6 @@ timeout_connect(int s, const struct sockaddr *name, socklen_t namelen, if ((ret = getsockopt(s, SOL_SOCKET, SO_ERROR, &optval, &optlen)) == 0) { errno = optval; - printf("timeout_connect() getsockopt error %d\n", ret); ret = optval == 0 ? 0 : -1; } } else if (ret == 0) { diff --git a/ext/oberon/psa/core/include/mbedtls/check_config.h b/ext/oberon/psa/core/include/mbedtls/check_config.h deleted file mode 100644 index 04e43e39d7d8..000000000000 --- a/ext/oberon/psa/core/include/mbedtls/check_config.h +++ /dev/null @@ -1,1102 +0,0 @@ -/** - * \file check_config.h - * - * \brief Consistency checks for configuration options - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_CHECK_CONFIG_H -#define MBEDTLS_CHECK_CONFIG_H - -/* - * We assume CHAR_BIT is 8 in many places. In practice, this is true on our - * target platforms, so not an issue, but let's just be extra sure. - */ -#include -#if CHAR_BIT != 8 -#error "mbed TLS requires a platform with 8-bit chars" -#endif - -#include - -#if defined(_WIN32) -#if !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_C is required on Windows" -#endif - -/* Fix the config here. Not convenient to put an #ifdef _WIN32 in mbedtls_config.h as - * it would confuse config.py. */ -#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif - -#if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_VSNPRINTF_ALT -#endif -#endif /* _WIN32 */ - -#if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_NET_C) -#error "The NET module is not available for mbed OS - please use the network functions provided by Mbed OS" -#endif - -#if defined(MBEDTLS_DEPRECATED_WARNING) && \ - !defined(__GNUC__) && !defined(__clang__) -#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" -#endif - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) -#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" -#endif - -#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_AESNI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) -#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) -#error "MBEDTLS_DHM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CMAC_C) && \ - ( !defined(MBEDTLS_CIPHER_C ) || ( !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) ) ) -#error "MBEDTLS_CMAC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_NIST_KW_C) && \ - ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) -#error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) -#error "MBEDTLS_ECDH_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDSA_C) && \ - ( !defined(MBEDTLS_ECP_C) || \ - !( defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) || \ - defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) ) || \ - !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_ASN1_WRITE_C) ) -#error "MBEDTLS_ECDSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECJPAKE_C) && \ - ( !defined(MBEDTLS_ECP_C) || \ - !( defined(MBEDTLS_MD_C) || defined(MBEDTLS_PSA_CRYPTO_C) ) ) -#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RESTARTABLE) && \ - ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ - defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ - defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ - defined(MBEDTLS_ECDSA_SIGN_ALT) || \ - defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ - defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ - defined(MBEDTLS_ECP_INTERNAL_ALT) || \ - defined(MBEDTLS_ECP_ALT) ) -#error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" -#endif - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) -#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ - !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) -#error "MBEDTLS_ECP_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) -#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS12_C) && !defined(MBEDTLS_CIPHER_C) -#error "MBEDTLS_PKCS12_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS5_C) && \ - ( !( defined(MBEDTLS_MD_C) || defined(MBEDTLS_PSA_CRYPTO_C) ) || \ - !defined(MBEDTLS_CIPHER_C) ) -#error "MBEDTLS_PKCS5_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS12_C) && \ - !( defined(MBEDTLS_MD_C) || defined(MBEDTLS_PSA_CRYPTO_C) ) -#error "MBEDTLS_PKCS12_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS1_V21) && \ - !( defined(MBEDTLS_MD_C) || defined(MBEDTLS_PSA_CRYPTO_C) ) -#error "MBEDTLS_PKCS1_V21 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ - !defined(MBEDTLS_SHA256_C)) -#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" -#endif -#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ - defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ - && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) -#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" -#endif - -#if defined(__has_feature) -#if __has_feature(memory_sanitizer) -#define MBEDTLS_HAS_MEMSAN -#endif -#endif -#if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) && !defined(MBEDTLS_HAS_MEMSAN) -#error "MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN requires building with MemorySanitizer" -#endif -#undef MBEDTLS_HAS_MEMSAN - -#if defined(MBEDTLS_CCM_C) && ( \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) -#error "MBEDTLS_CCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CCM_C) && !defined(MBEDTLS_CIPHER_C) -#error "MBEDTLS_CCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_GCM_C) && ( \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) -#error "MBEDTLS_GCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_GCM_C) && !defined(MBEDTLS_CIPHER_C) -#error "MBEDTLS_GCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_CHACHA20_C) -#error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CHACHAPOLY_C) && !defined(MBEDTLS_POLY1305_C) -#error "MBEDTLS_CHACHAPOLY_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NO_FALLBACK) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NO_FALLBACK defined, but no alternative implementation enabled" -#endif - -#if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HKDF_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) -#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ - !defined(MBEDTLS_ECDH_C) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ - ( !defined(MBEDTLS_ECJPAKE_C) || \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) -#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" -#endif - -/* Use of EC J-PAKE in TLS requires SHA-256. - * This will be taken from MD if it is present, or from PSA if MD is absent. - * Note: ECJPAKE_C depends on MD_C || PSA_CRYPTO_C. */ -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ - !( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA256_C) ) && \ - !( !defined(MBEDTLS_MD_C) && defined(PSA_WANT_ALG_SHA_256) ) -#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ - !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \ - ( !defined(MBEDTLS_SHA256_C) && \ - !defined(MBEDTLS_SHA512_C) && \ - !defined(MBEDTLS_SHA1_C) ) -#error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C" -#endif - -#if defined(MBEDTLS_MD_C) && !( \ - defined(MBEDTLS_MD5_C) || \ - defined(MBEDTLS_RIPEMD160_C) || \ - defined(MBEDTLS_SHA1_C) || \ - defined(MBEDTLS_SHA224_C) || \ - defined(MBEDTLS_SHA256_C) || \ - defined(MBEDTLS_SHA384_C) || \ - defined(MBEDTLS_SHA512_C) ) -#error "MBEDTLS_MD_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_LMS_C) && \ - ! ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256) ) -#error "MBEDTLS_LMS_C requires MBEDTLS_PSA_CRYPTO_C and PSA_WANT_ALG_SHA_256" -#endif - -#if defined(MBEDTLS_LMS_PRIVATE) && \ - ( !defined(MBEDTLS_LMS_C) ) -#error "MBEDTLS_LMS_PRIVATE requires MBEDTLS_LMS_C" -#endif - -#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) -#error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) -#error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_C) && \ - !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) -#error "MBEDTLS_PK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ - defined(MBEDTLS_PLATFORM_EXIT_ALT) ) -#error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_SETBUF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SETBUF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SETBUF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SETBUF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SETBUF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_SETBUF) ||\ - defined(MBEDTLS_PLATFORM_SETBUF_ALT) ) -#error "MBEDTLS_PLATFORM_SETBUF_MACRO and MBEDTLS_PLATFORM_STD_SETBUF/MBEDTLS_PLATFORM_SETBUF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ - defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_FREE) -#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_CALLOC) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) -#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ - defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ - defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_VSNPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_VSNPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_VSNPRINTF) ||\ - defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_VSNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_VSNPRINTF/MBEDTLS_PLATFORM_VSNPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ - !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ - !defined(MBEDTLS_PLATFORM_EXIT_ALT) -#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ - ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ - !defined(MBEDTLS_PLATFORM_PRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) -#error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ - !defined(MBEDTLS_ENTROPY_NV_SEED) -#error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_C) && \ - !( ( ( defined(MBEDTLS_CTR_DRBG_C) || defined(MBEDTLS_HMAC_DRBG_C) ) && \ - defined(MBEDTLS_ENTROPY_C) ) || \ - defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) ) -#error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites (missing RNG)" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_C) && !defined(MBEDTLS_CIPHER_C ) -#error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \ - ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \ - defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) ) -#error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_PSA_CRYPTO_SE_C is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_PSA_CRYPTO_SE_C is deprecated and will be removed in a future version of Mbed TLS" -#endif -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ - ! defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ - !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ - defined(MBEDTLS_ENTROPY_NV_SEED) ) -#error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ - !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) -#error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources" -#endif - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ - defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) -#error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG" -#endif - -#if defined(MBEDTLS_PSA_ITS_FILE_C) && \ - !defined(MBEDTLS_FS_IO) -#error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) ) -#error "MBEDTLS_RSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" -#endif - -#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) -#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SHA384_C) && !defined(MBEDTLS_SHA512_C) -#error "MBEDTLS_SHA384_C defined without MBEDTLS_SHA512_C" -#endif - -#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) && \ - defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY) -#error "Must only define one of MBEDTLS_SHA512_USE_A64_CRYPTO_*" -#endif - -#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT) || \ - defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY) -#if !defined(MBEDTLS_SHA512_C) -#error "MBEDTLS_SHA512_USE_A64_CRYPTO_* defined without MBEDTLS_SHA512_C" -#endif -#if defined(MBEDTLS_SHA512_ALT) || defined(MBEDTLS_SHA512_PROCESS_ALT) -#error "MBEDTLS_SHA512_*ALT can't be used with MBEDTLS_SHA512_USE_A64_CRYPTO_*" -#endif -/* - * Best performance comes from most recent compilers, with intrinsics and -O3. - * Must compile with -march=armv8.2-a+sha3, but we can't detect armv8.2-a, and - * can't always detect __ARM_FEATURE_SHA512 (notably clang 7-12). - * - * GCC < 8 won't work at all (lacks the sha512 instructions) - * GCC >= 8 uses intrinsics, sets __ARM_FEATURE_SHA512 - * - * Clang < 7 won't work at all (lacks the sha512 instructions) - * Clang 7-12 don't have intrinsics (but we work around that with inline - * assembler) or __ARM_FEATURE_SHA512 - * Clang == 13.0.0 same as clang 12 (only seen on macOS) - * Clang >= 13.0.1 has __ARM_FEATURE_SHA512 and intrinsics - */ -#if defined(__aarch64__) && !defined(__ARM_FEATURE_SHA512) - /* Test Clang first, as it defines __GNUC__ */ -# if defined(__clang__) -# if __clang_major__ < 7 -# error "A more recent Clang is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*" -# elif __clang_major__ < 13 || \ - (__clang_major__ == 13 && __clang_minor__ == 0 && __clang_patchlevel__ == 0) - /* We implement the intrinsics with inline assembler, so don't error */ -# else -# error "Must use minimum -march=armv8.2-a+sha3 for MBEDTLS_SHA512_USE_A64_CRYPTO_*" -# endif -# elif defined(__GNUC__) -# if __GNUC__ < 8 -# error "A more recent GCC is required for MBEDTLS_SHA512_USE_A64_CRYPTO_*" -# else -# error "Must use minimum -march=armv8.2-a+sha3 for MBEDTLS_SHA512_USE_A64_CRYPTO_*" -# endif -# else -# error "Only GCC and Clang supported for MBEDTLS_SHA512_USE_A64_CRYPTO_*" -# endif -#endif - -#endif /* MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT || MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY */ - -#if defined(MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY) && !defined(__aarch64__) -#error "MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY defined on non-Aarch64 system" -#endif - -#if defined(MBEDTLS_SHA224_C) && !defined(MBEDTLS_SHA256_C) -#error "MBEDTLS_SHA224_C defined without MBEDTLS_SHA256_C" -#endif - -#if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA224_C) -#error "MBEDTLS_SHA256_C defined without MBEDTLS_SHA224_C" -#endif - -#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) && \ - defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY) -#error "Must only define one of MBEDTLS_SHA256_USE_A64_CRYPTO_*" -#endif - -#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) || \ - defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY) -#if !defined(MBEDTLS_SHA256_C) -#error "MBEDTLS_SHA256_USE_A64_CRYPTO_* defined without MBEDTLS_SHA256_C" -#endif -#if defined(MBEDTLS_SHA256_ALT) || defined(MBEDTLS_SHA256_PROCESS_ALT) -#error "MBEDTLS_SHA256_*ALT can't be used with MBEDTLS_SHA256_USE_A64_CRYPTO_*" -#endif -#if defined(__aarch64__) && !defined(__ARM_FEATURE_CRYPTO) -#error "Must use minimum -march=armv8-a+crypto for MBEDTLS_SHA256_USE_A64_CRYPTO_*" -#endif -#endif - -#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY) && \ - !defined(__aarch64__) && !defined(_M_ARM64) -#error "MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY defined on non-Aarch64 system" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_USE_PSA_CRYPTO) && \ - !( defined(MBEDTLS_SHA1_C) || defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA512_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" -#endif - -/* TLS 1.3 requires separate HKDF parts from PSA */ -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \ - !( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_HKDF_EXTRACT) && defined(PSA_WANT_ALG_HKDF_EXPAND) ) -#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites" -#endif - -/* TLS 1.3 requires at least one ciphersuite, so at least SHA-256 or SHA-384 */ -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) -/* We always need at least one of the hashes via PSA (for use with HKDF) */ -#if !( defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA_384) ) -#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites" -#endif /* !(PSA_WANT_ALG_SHA_256 || PSA_WANT_ALG_SHA_384) */ -#if !defined(MBEDTLS_USE_PSA_CRYPTO) -/* When USE_PSA_CRYPTO is not defined, we also need SHA-256 or SHA-384 via the - * legacy interface, including via the MD layer, for the parts of the code - * that are shared with TLS 1.2 (running handshake hash). */ -#if !defined(MBEDTLS_MD_C) || \ - !( defined(MBEDTLS_SHA256_C) || defined(MBEDTLS_SHA384_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_3 defined, but not all prerequisites" -#endif /* !MBEDTLS_MD_C || !(MBEDTLS_SHA256_C || MBEDTLS_SHA384_C) */ -#endif /* !MBEDTLS_USE_PSA_CRYPTO */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_3 */ - -#if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED) -#if !( defined(MBEDTLS_ECDH_C) && defined(MBEDTLS_X509_CRT_PARSE_C) && \ - ( defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_PKCS1_V21) ) ) -#error "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED defined, but not all prerequisites" -#endif -#endif - -#if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) -#if !( defined(MBEDTLS_ECDH_C) ) -#error "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED defined, but not all prerequisites" -#endif -#endif - -/* - * The current implementation of TLS 1.3 requires MBEDTLS_SSL_KEEP_PEER_CERTIFICATE. - */ -#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) -#error "MBEDTLS_SSL_PROTO_TLS1_3 defined without MBEDTLS_SSL_KEEP_PEER_CERTIFICATE" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) -#error "One or more versions of the TLS protocol are enabled " \ - "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" -#endif - -#if defined(MBEDTLS_SSL_EARLY_DATA) && \ - ( !defined(MBEDTLS_SSL_SESSION_TICKETS) || \ - ( !defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) && \ - !defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) ) ) -#error "MBEDTLS_SSL_EARLY_DATA defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_SRV_C) && \ - ( !defined(MBEDTLS_SSL_MAX_EARLY_DATA_SIZE) || \ - ( MBEDTLS_SSL_MAX_EARLY_DATA_SIZE < 0 ) || \ - ( MBEDTLS_SSL_MAX_EARLY_DATA_SIZE > UINT32_MAX ) ) -#error "MBEDTLS_SSL_MAX_EARLY_DATA_SIZE MUST be defined and in range(0..UINT32_MAX)" -#endif - -#if defined(MBEDTLS_SSL_PROTO_DTLS) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ - ( !defined(MBEDTLS_MD_C) && !defined(MBEDTLS_USE_PSA_CRYPTO) ) ) -#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && \ - !( defined(MBEDTLS_SSL_PROTO_TLS1_2) || defined(MBEDTLS_SSL_PROTO_TLS1_3) ) -#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" -#endif - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) -#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ - !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) -#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \ - MBEDTLS_SSL_CID_IN_LEN_MAX > 255 -#error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \ - MBEDTLS_SSL_CID_OUT_LEN_MAX > 255 -#error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT) && \ - !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) -#error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT) && MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT != 0 -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT is deprecated and will be removed in a future version of Mbed TLS" -#endif -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT && MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT != 0 */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TICKET_C) && ( !defined(MBEDTLS_CIPHER_C) && \ - !defined(MBEDTLS_USE_PSA_CRYPTO) ) -#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TICKET_C) && \ - !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) ) -#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH) && \ - MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH >= 256 -#error "MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH must be less than 256" -#endif - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ - !defined(MBEDTLS_X509_CRT_PARSE_C) -#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_THREADING_PTHREAD) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_ALT) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_C defined, single threading implementation required" -#endif -#undef MBEDTLS_THREADING_IMPL - -#if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) -#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_PK_PARSE_C) || \ - ( !defined(MBEDTLS_MD_C) && !defined(MBEDTLS_USE_PSA_CRYPTO) ) ) -#error "MBEDTLS_X509_USE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ - !defined(MBEDTLS_PK_PARSE_C) || \ - ( !defined(MBEDTLS_MD_C) && !defined(MBEDTLS_USE_PSA_CRYPTO) ) ) -#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) -#error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" -#endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ - -#if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ - defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" -#endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ - -#if defined(MBEDTLS_SSL_DTLS_SRTP) && ( !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_SRTP defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) && ( !defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) ) -#error "MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) && !( defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) ) -#error "MBEDTLS_SSL_CONTEXT_SERIALIZATION defined, but not all prerequisites" -#endif - -/* Reject attempts to enable options that have been removed and that could - * cause a build to succeed but with features removed. */ - -#if defined(MBEDTLS_HAVEGE_C) //no-check-names -#error "MBEDTLS_HAVEGE_C was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/2599" -#endif - -#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) //no-check-names -#error "MBEDTLS_SSL_HW_RECORD_ACCEL was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4031" -#endif - -#if defined(MBEDTLS_SSL_PROTO_SSL3) //no-check-names -#error "MBEDTLS_SSL_PROTO_SSL3 (SSL v3.0 support) was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4031" -#endif - -#if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) //no-check-names -#error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO (SSL v2 ClientHello support) was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4031" -#endif - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) //no-check-names -#error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT (compatibility with the buggy implementation of truncated HMAC in Mbed TLS up to 2.7) was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4031" -#endif - -#if defined(MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES) //no-check-names -#error "MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES was removed in Mbed TLS 3.0. See the ChangeLog entry if you really need SHA-1-signed certificates." -#endif - -#if defined(MBEDTLS_ZLIB_SUPPORT) //no-check-names -#error "MBEDTLS_ZLIB_SUPPORT was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4031" -#endif - -#if defined(MBEDTLS_CHECK_PARAMS) //no-check-names -#error "MBEDTLS_CHECK_PARAMS was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4313" -#endif - -#if defined(MBEDTLS_SSL_CID_PADDING_GRANULARITY) //no-check-names -#error "MBEDTLS_SSL_CID_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4335" -#endif - -#if defined(MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY) //no-check-names -#error "MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4335" -#endif - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) //no-check-names -#error "MBEDTLS_SSL_TRUNCATED_HMAC was removed in Mbed TLS 3.0. See https://github.com/Mbed-TLS/mbedtls/issues/4341" -#endif - -#if defined(MBEDTLS_PKCS7_C) && ( ( !defined(MBEDTLS_ASN1_PARSE_C) ) || \ - ( !defined(MBEDTLS_OID_C) ) || ( !defined(MBEDTLS_PK_PARSE_C) ) || \ - ( !defined(MBEDTLS_X509_CRT_PARSE_C) ) ||\ - ( !defined(MBEDTLS_X509_CRL_PARSE_C) ) || ( !defined(MBEDTLS_BIGNUM_C) ) || \ - ( !defined(MBEDTLS_MD_C) ) ) -#error "MBEDTLS_PKCS7_C is defined, but not all prerequisites" -#endif - -/* - * Avoid warning from -pedantic. This is a convenient place for this - * workaround since this is included by every single file before the - * #if defined(MBEDTLS_xxx_C) that results in empty translation units. - */ -typedef int mbedtls_iso_c_forbids_empty_translation_units; - -#endif /* MBEDTLS_CHECK_CONFIG_H */ diff --git a/ext/oberon/psa/core/include/mbedtls/config_psa.h b/ext/oberon/psa/core/include/mbedtls/config_psa.h deleted file mode 100644 index 6d465241e61a..000000000000 --- a/ext/oberon/psa/core/include/mbedtls/config_psa.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * \file mbedtls/config_psa.h - * \brief PSA crypto configuration options (set of defines) - * - * This set of compile-time options takes settings defined in - * include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses - * those definitions to define symbols used in the library code. - * - * Users and integrators should not edit this file, please edit - * include/mbedtls/mbedtls_config.h for MBEDTLS_XXX settings or - * include/psa/crypto_config.h for PSA_WANT_XXX settings. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef MBEDTLS_CONFIG_PSA_H -#define MBEDTLS_CONFIG_PSA_H - -#include "psa/crypto_legacy.h" - -#include "psa/crypto_adjust_config_synonyms.h" - -#if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - -/* Require built-in implementations based on PSA requirements */ - -/* We need this to have a complete list of requirements - * before we deduce what built-ins are required. */ -#include "psa/crypto_adjust_config_key_pair_types.h" - -#endif /* MBEDTLS_PSA_CRYPTO_CONFIG */ - -#include "psa/crypto_adjust_auto_enabled.h" - -#include "psa/crypto_driver_config.h" - -#endif /* MBEDTLS_CONFIG_PSA_H */ diff --git a/ext/oberon/psa/core/include/mbedtls/legacy_or_psa.h b/ext/oberon/psa/core/include/mbedtls/legacy_or_psa.h deleted file mode 100644 index e9bdb77833c6..000000000000 --- a/ext/oberon/psa/core/include/mbedtls/legacy_or_psa.h +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Macros to express dependencies for code and tests that may use either the - * legacy API or PSA in various builds. This whole header file is currently - * for internal use only and both the header file and the macros it defines - * may change or be removed without notice. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Note: applications that are targeting a specific configuration do not need - * to use these macros; instead they should directly use the functions they - * know are available in their configuration. - * - * Note: code that is purely based on PSA Crypto (psa_xxx() functions) - * does not need to use these macros; instead it should use the relevant - * PSA_WANT_xxx macros. - * - * Note: code that is purely based on the legacy crypto APIs (mbedtls_xxx()) - * does not need to use these macros; instead it should use the relevant - * MBEDTLS_xxx macros. - * - * These macros are for code that wants to use and will do so - * using or PSA depending on , where: - * - will generally be an algorithm (SHA-256, ECDH) but may - * also be a key type (AES, RSA, EC) or domain parameters (elliptic curve); - * - will be either: - * - low-level module API (aes.h, sha256.h), or - * - an abstraction layer (md.h, cipher.h); - * - will be either: - * - depending on what's available in the build: - * legacy API used if available, PSA otherwise - * (this is done to ensure backwards compatibility); or - * - depending on whether MBEDTLS_USE_PSA_CRYPTO is defined. - * - * Examples: - * - TLS 1.2 will compute hashes using either mbedtls_md_xxx() (and - * mbedtls_sha256_xxx()) or psa_aead_xxx() depending on whether - * MBEDTLS_USE_PSA_CRYPTO is defined; - * - RSA PKCS#1 v2.1 will compute hashes (for padding) using either - * `mbedtls_md()` if it's available, or `psa_hash_compute()` otherwise; - * - PEM decoding of PEM-encrypted keys will compute MD5 hashes using either - * `mbedtls_md5_xxx()` if it's available, or `psa_hash_xxx()` otherwise. - * - * Note: the macros are essential to express test dependencies. Inside code, - * we could instead just use the equivalent pre-processor condition, but - * that's not possible in test dependencies where we need a single macro. - * Hopefully, using these macros in code will also help with consistency. - * - * The naming scheme for these macros is: - * MBEDTLS_HAS_feature_VIA_legacy_OR_PSA(_condition) - * where: - * - feature is expressed the same way as in PSA_WANT_xxx macros, for example: - * KEY_TYPE_AES, ALG_SHA_256, ECC_SECP_R1_256; - * - legacy is either LOWLEVEL or the name of the layer: MD, CIPHER; - * - condition is omitted if it's based on availability, else it's - * BASED_ON_USE_PSA. - * - * Coming back to the examples above: - * - TLS 1.2 will determine if it can use SHA-256 using - * MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA - * for the purposes of negotiation, and in test dependencies; - * - RSA PKCS#1 v2.1 tests that used SHA-256 will depend on - * MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA - * - PEM decoding code and its associated tests will depend on - * MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA - * - * Note: every time it's possible to use, say SHA-256, via the MD API, then - * it's also possible to use it via the low-level API. So, code that wants to - * use SHA-256 via both APIs only needs to depend on the MD macro. Also, it - * just so happens that all the code choosing which API to use based on - * MBEDTLS_USE_PSA_CRYPTO (X.509, TLS 1.2/shared), always uses the abstraction - * layer (sometimes in addition to the low-level API), so we don't need the - * MBEDTLS_HAS_feature_VIA_LOWLEVEL_OR_PSA_BASED_ON_USE_PSA macros. - * (PK, while obeying MBEDTLS_USE_PSA_CRYPTO, doesn't compute hashes itself, - * even less makes use of ciphers.) - * - * Note: the macros MBEDTLS_HAS_feature_VIA_LOWLEVEL_OR_PSA are the minimal - * condition for being able to use at all. As such, they should be - * used for guarding data about , such as OIDs or size. For example, - * OID values related to SHA-256 are only useful when SHA-256 can be used at - * least in some way. - */ - -#ifndef MBEDTLS_OR_PSA_HELPERS_H -#define MBEDTLS_OR_PSA_HELPERS_H - -#include "mbedtls/build_info.h" -#if defined(MBEDTLS_PSA_CRYPTO_C) -#include "psa/crypto.h" -#endif /* MBEDTLS_PSA_CRYPTO_C */ - -/* - * Hashes - */ - -/* Hashes using low-level or PSA based on availability */ -#if defined(MBEDTLS_MD5_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5)) -#define MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_RIPEMD160_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160)) -#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_SHA1_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1)) -#define MBEDTLS_HAS_ALG_SHA_1_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_SHA224_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224)) -#define MBEDTLS_HAS_ALG_SHA_224_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_SHA256_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256)) -#define MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_SHA384_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384)) -#define MBEDTLS_HAS_ALG_SHA_384_VIA_LOWLEVEL_OR_PSA -#endif -#if defined(MBEDTLS_SHA512_C) || \ - (defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512)) -#define MBEDTLS_HAS_ALG_SHA_512_VIA_LOWLEVEL_OR_PSA -#endif - -/* Hashes using MD or PSA based on availability */ -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_MD5_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5)) -#define MBEDTLS_HAS_ALG_MD5_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_RIPEMD160_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160)) -#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA1_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1)) -#define MBEDTLS_HAS_ALG_SHA_1_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA224_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224)) -#define MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA256_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256)) -#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA384_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384)) -#define MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA -#endif -#if (defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA512_C)) || \ - (!defined(MBEDTLS_MD_C) && \ - defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512)) -#define MBEDTLS_HAS_ALG_SHA_512_VIA_MD_OR_PSA -#endif - -/* Hashes using MD or PSA based on MBEDTLS_USE_PSA_CRYPTO */ -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_MD5_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_MD5)) -#define MBEDTLS_HAS_ALG_MD5_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_RIPEMD160_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_RIPEMD160)) -#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA1_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_1)) -#define MBEDTLS_HAS_ALG_SHA_1_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA224_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_224)) -#define MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA256_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_256)) -#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA384_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_384)) -#define MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif -#if (!defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA512_C)) || \ - (defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_512)) -#define MBEDTLS_HAS_ALG_SHA_512_VIA_MD_OR_PSA_BASED_ON_USE_PSA -#endif - -#endif /* MBEDTLS_OR_PSA_HELPERS_H */ diff --git a/ext/oberon/psa/core/include/mbedtls/mbedtls_config.h b/ext/oberon/psa/core/include/mbedtls/mbedtls_config.h deleted file mode 100644 index d122b21fb1bf..000000000000 --- a/ext/oberon/psa/core/include/mbedtls/mbedtls_config.h +++ /dev/null @@ -1,4138 +0,0 @@ -/** - * \file mbedtls_config.h - * - * \brief Configuration options (set of defines) - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -/* - * Note: do not change configurations in this file; mbedtls_config.h is only - * provided for legacy dependencies and might be removed in future versions - * of this PSA Crypto implementation. - */ - -//#define PSA_USE_KEY_DOMAIN_PARAMETERS 1 /* !!OM */ -#define MBEDTLS_TEST_PSA_SKIP_IF_SMALL_RSA_KEY 1 /* !!OM */ - -/** - * This is an optional version symbol that enables compatibility handling of - * config files. - * - * It is equal to the #MBEDTLS_VERSION_NUMBER of the Mbed TLS version that - * introduced the config format we want to be compatible with. - */ -//#define MBEDTLS_CONFIG_VERSION 0x03000000 - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/aesni.h - * library/aria.c - * library/bn_mul.h - * library/constant_time.c - * library/padlock.h - * - * Required by: - * MBEDTLS_AESCE_C - * MBEDTLS_AESNI_C (on some platforms) - * MBEDTLS_PADLOCK_C - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_NO_UDBL_DIVISION - * - * The platform lacks support for double-width integer division (64-bit - * division on a 32-bit platform, 128-bit division on a 64-bit platform). - * - * Used in: - * include/mbedtls/bignum.h - * library/bignum.c - * - * The bignum code uses double-width division to speed up some operations. - * Double-width division is often implemented in software that needs to - * be linked with the program. The presence of a double-width integer - * type is usually detected automatically through preprocessor macros, - * but the automatic detection cannot know whether the code needs to - * and can be linked with an implementation of division for that type. - * By default division is assumed to be usable if the type is present. - * Uncomment this option to prevent the use of double-width division. - * - * Note that division for the native integer type is always required. - * Furthermore, a 64-bit type is always required even on a 32-bit - * platform, but it need not support multiplication or division. In some - * cases it is also desirable to disable some double-width operations. For - * example, if double-width division is implemented in software, disabling - * it can reduce code size in some embedded targets. - */ -//#define MBEDTLS_NO_UDBL_DIVISION - -/** - * \def MBEDTLS_NO_64BIT_MULTIPLICATION - * - * The platform lacks support for 32x32 -> 64-bit multiplication. - * - * Used in: - * library/poly1305.c - * - * Some parts of the library may use multiplication of two unsigned 32-bit - * operands with a 64-bit result in order to speed up computations. On some - * platforms, this is not available in hardware and has to be implemented in - * software, usually in a library provided by the toolchain. - * - * Sometimes it is not desirable to have to link to that library. This option - * removes the dependency of that library on platforms that lack a hardware - * 64-bit multiplier by embedding a software implementation in Mbed TLS. - * - * Note that depending on the compiler, this may decrease performance compared - * to using the library function provided by the toolchain. - */ -//#define MBEDTLS_NO_64BIT_MULTIPLICATION - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -//#define MBEDTLS_HAVE_SSE2 - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, - * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and - * MBEDTLS_PLATFORM_STD_TIME. - * - * Comment if your system does not support time functions. - * - * \note If MBEDTLS_TIMING_C is set - to enable the semi-portable timing - * interface - timing.c will include time.h on suitable platforms - * regardless of the setting of MBEDTLS_HAVE_TIME, unless - * MBEDTLS_TIMING_ALT is used. See timing.c for more information. - */ -#define MBEDTLS_HAVE_TIME - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h, time(), and an implementation for - * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necessarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - * - * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that - * behaves similarly to the gmtime_r() function from the C standard. Refer to - * the documentation for mbedtls_platform_gmtime_r() for more information. - * - * \note It is possible to configure an implementation for - * mbedtls_platform_gmtime_r() at compile-time by using the macro - * MBEDTLS_PLATFORM_GMTIME_R_ALT. - */ -#define MBEDTLS_HAVE_TIME_DATE - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default Mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling #MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling #MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * An overview of how the value of mbedtls_calloc is determined: - * - * - if !MBEDTLS_PLATFORM_MEMORY - * - mbedtls_calloc = calloc - * - if MBEDTLS_PLATFORM_MEMORY - * - if (MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO): - * - mbedtls_calloc = MBEDTLS_PLATFORM_CALLOC_MACRO - * - if !(MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO): - * - Dynamic setup via mbedtls_platform_set_calloc_free is now possible with a default value MBEDTLS_PLATFORM_STD_CALLOC. - * - How is MBEDTLS_PLATFORM_STD_CALLOC handled? - * - if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS: - * - MBEDTLS_PLATFORM_STD_CALLOC is not set to anything; - * - MBEDTLS_PLATFORM_STD_MEM_HDR can be included if present; - * - if !MBEDTLS_PLATFORM_NO_STD_FUNCTIONS: - * - if MBEDTLS_PLATFORM_STD_CALLOC is present: - * - User-defined MBEDTLS_PLATFORM_STD_CALLOC is respected; - * - if !MBEDTLS_PLATFORM_STD_CALLOC: - * - MBEDTLS_PLATFORM_STD_CALLOC = calloc - * - * - At this point the presence of MBEDTLS_PLATFORM_STD_CALLOC is checked. - * - if !MBEDTLS_PLATFORM_STD_CALLOC - * - MBEDTLS_PLATFORM_STD_CALLOC = uninitialized_calloc - * - * - mbedtls_calloc = MBEDTLS_PLATFORM_STD_CALLOC. - * - * Defining MBEDTLS_PLATFORM_CALLOC_MACRO and #MBEDTLS_PLATFORM_STD_CALLOC at the same time is not possible. - * MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO must both be defined or undefined at the same time. - * #MBEDTLS_PLATFORM_STD_CALLOC and #MBEDTLS_PLATFORM_STD_FREE do not have to be defined at the same time, as, if they are used, - * dynamic setup of these functions is possible. See the tree above to see how are they handled in all cases. - * An uninitialized #MBEDTLS_PLATFORM_STD_CALLOC always fails, returning a null pointer. - * An uninitialized #MBEDTLS_PLATFORM_STD_FREE does not do anything. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -//#define MBEDTLS_PLATFORM_MEMORY - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let Mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, Mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -//#define MBEDTLS_PLATFORM_SETBUF_ALT -//#define MBEDTLS_PLATFORM_EXIT_ALT -//#define MBEDTLS_PLATFORM_TIME_ALT -//#define MBEDTLS_PLATFORM_FPRINTF_ALT -//#define MBEDTLS_PLATFORM_PRINTF_ALT -//#define MBEDTLS_PLATFORM_SNPRINTF_ALT -//#define MBEDTLS_PLATFORM_VSNPRINTF_ALT -//#define MBEDTLS_PLATFORM_NV_SEED_ALT -//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT -//#define MBEDTLS_PLATFORM_MS_TIME_ALT - -/** - * Uncomment the macro to let Mbed TLS use your alternate implementation of - * mbedtls_platform_gmtime_r(). This replaces the default implementation in - * platform_util.c. - * - * gmtime() is not a thread-safe function as defined in the C standard. The - * library will try to use safer implementations of this function, such as - * gmtime_r() when available. However, if Mbed TLS cannot identify the target - * system, the implementation of mbedtls_platform_gmtime_r() will default to - * using the standard gmtime(). In this case, calls from the library to - * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex - * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the - * library are also guarded with this mutex to avoid race conditions. However, - * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will - * unconditionally use the implementation for mbedtls_platform_gmtime_r() - * supplied at compile time. - */ -//#define MBEDTLS_PLATFORM_GMTIME_R_ALT - -/** - * Uncomment the macro to let Mbed TLS use your alternate implementation of - * mbedtls_platform_zeroize(), to wipe sensitive data in memory. This replaces - * the default implementation in platform_util.c. - * - * By default, the library uses a system function such as memset_s() - * (optional feature of C11), explicit_bzero() (BSD and compatible), or - * SecureZeroMemory (Windows). If no such function is detected, the library - * falls back to a plain C implementation. Compilers are technically - * permitted to optimize this implementation out, meaning that the memory is - * not actually wiped. The library tries to prevent that, but the C language - * makes it impossible to guarantee that the memory will always be wiped. - * - * If your platform provides a guaranteed method to wipe memory which - * `platform_util.c` does not detect, define this macro to the name of - * a function that takes two arguments, a `void *` pointer and a length, - * and wipes that many bytes starting at the specified address. For example, - * if your platform has explicit_bzero() but `platform_util.c` does not - * detect its presence, define `MBEDTLS_PLATFORM_ZEROIZE_ALT` to be - * `explicit_bzero` to use that function as mbedtls_platform_zeroize(). - */ -//#define MBEDTLS_PLATFORM_ZEROIZE_ALT - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions and features so that they generate a warning if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_WARNING - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions and features so that they generate an error if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * Uncomment to get errors on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_REMOVED - -/** \} name SECTION: System support */ - -/** - * \name SECTION: Mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -//#define MBEDTLS_TIMING_ALT - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let Mbed TLS use your - * alternate core implementation of a symmetric crypto, an arithmetic or hash - * module (e.g. platform specific assembly optimized implementations). Keep - * in mind that the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, Mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base - * function declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - * - * \warning MD5, DES and SHA-1 are considered weak and their - * use constitutes a security risk. If possible, we recommend - * avoiding dependencies on them, and considering stronger message - * digests and ciphers instead. - * - */ -//#define MBEDTLS_AES_ALT -//#define MBEDTLS_ARIA_ALT -//#define MBEDTLS_CAMELLIA_ALT -//#define MBEDTLS_CCM_ALT -//#define MBEDTLS_CHACHA20_ALT -//#define MBEDTLS_CHACHAPOLY_ALT -//#define MBEDTLS_CMAC_ALT -//#define MBEDTLS_DES_ALT -//#define MBEDTLS_DHM_ALT -//#define MBEDTLS_ECJPAKE_ALT -//#define MBEDTLS_GCM_ALT -//#define MBEDTLS_NIST_KW_ALT -//#define MBEDTLS_MD5_ALT -//#define MBEDTLS_POLY1305_ALT -//#define MBEDTLS_RIPEMD160_ALT -//#define MBEDTLS_RSA_ALT -//#define MBEDTLS_SHA1_ALT -//#define MBEDTLS_SHA256_ALT -//#define MBEDTLS_SHA512_ALT - -/* - * When replacing the elliptic curve module, please consider, that it is - * implemented with two .c files: - * - ecp.c - * - ecp_curves.c - * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT - * macros as described above. The only difference is that you have to make sure - * that you provide functionality for both .c files. - */ -//#define MBEDTLS_ECP_ALT - -/** - * \def MBEDTLS_SHA256_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let Mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from Mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, Mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * \note If you use the AES_xxx_ALT macros, then it is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - * - * \warning MD5, DES and SHA-1 are considered weak and their use - * constitutes a security risk. If possible, we recommend avoiding - * dependencies on them, and considering stronger message digests - * and ciphers instead. - * - * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are - * enabled, then the deterministic ECDH signature functions pass the - * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore - * alternative implementations should use the RNG only for generating - * the ephemeral key and nothing else. If this is not possible, then - * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative - * implementation should be provided for mbedtls_ecdsa_sign_det_ext(). - * - */ -//#define MBEDTLS_MD5_PROCESS_ALT -//#define MBEDTLS_RIPEMD160_PROCESS_ALT -//#define MBEDTLS_SHA1_PROCESS_ALT -//#define MBEDTLS_SHA256_PROCESS_ALT -//#define MBEDTLS_SHA512_PROCESS_ALT -//#define MBEDTLS_DES_SETKEY_ALT -//#define MBEDTLS_DES_CRYPT_ECB_ALT -//#define MBEDTLS_DES3_CRYPT_ECB_ALT -//#define MBEDTLS_AES_SETKEY_ENC_ALT -//#define MBEDTLS_AES_SETKEY_DEC_ALT -//#define MBEDTLS_AES_ENCRYPT_ALT -//#define MBEDTLS_AES_DECRYPT_ALT -//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT -//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT -//#define MBEDTLS_ECDSA_VERIFY_ALT -//#define MBEDTLS_ECDSA_SIGN_ALT -//#define MBEDTLS_ECDSA_GENKEY_ALT - -/** - * \def MBEDTLS_ECP_INTERNAL_ALT - * - * Expose a part of the internal interface of the Elliptic Curve Point module. - * - * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let Mbed TLS use your - * alternative core implementation of elliptic curve arithmetic. Keep in mind - * that function prototypes should remain the same. - * - * This partially replaces one function. The header file from Mbed TLS is still - * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation - * is still present and it is used for group structures not supported by the - * alternative. - * - * The original implementation can in addition be removed by setting the - * MBEDTLS_ECP_NO_FALLBACK option, in which case any function for which the - * corresponding MBEDTLS_ECP__FUNCTION_NAME__ALT macro is defined will not be - * able to fallback to curves not supported by the alternative implementation. - * - * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT - * and implementing the following functions: - * unsigned char mbedtls_internal_ecp_grp_capable( - * const mbedtls_ecp_group *grp ) - * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) - * void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ) - * The mbedtls_internal_ecp_grp_capable function should return 1 if the - * replacement functions implement arithmetic for the given group and 0 - * otherwise. - * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are - * called before and after each point operation and provide an opportunity to - * implement optimized set up and tear down instructions. - * - * Example: In case you set MBEDTLS_ECP_INTERNAL_ALT and - * MBEDTLS_ECP_DOUBLE_JAC_ALT, Mbed TLS will still provide the ecp_double_jac() - * function, but will use your mbedtls_internal_ecp_double_jac() if the group - * for the operation is supported by your implementation (i.e. your - * mbedtls_internal_ecp_grp_capable() function returns 1 for this group). If the - * group is not supported by your implementation, then the original Mbed TLS - * implementation of ecp_double_jac() is used instead, unless this fallback - * behaviour is disabled by setting MBEDTLS_ECP_NO_FALLBACK (in which case - * ecp_double_jac() will return MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE). - * - * The function prototypes and the definition of mbedtls_ecp_group and - * mbedtls_ecp_point will not change based on MBEDTLS_ECP_INTERNAL_ALT, so your - * implementation of mbedtls_internal_ecp__function_name__ must be compatible - * with their definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -/* Required for all the functions in this section */ -//#define MBEDTLS_ECP_INTERNAL_ALT -/* Turn off software fallback for curves not supported in hardware */ -//#define MBEDTLS_ECP_NO_FALLBACK -/* Support for Weierstrass curves with Jacobi representation */ -//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT -//#define MBEDTLS_ECP_ADD_MIXED_ALT -//#define MBEDTLS_ECP_DOUBLE_JAC_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT -/* Support for curves with Montgomery arithmetic */ -//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT -//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT -//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let Mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in library/entropy_poll.h, and accept NULL as first - * argument. - * - * Uncomment to use your own hardware entropy collector. - */ -//#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Use precomputed AES tables stored in ROM. - * - * Uncomment this macro to use precomputed AES tables stored in ROM. - * Comment this macro to generate AES tables in RAM at runtime. - * - * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb - * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the - * initialization time before the first AES operation can be performed. - * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c - * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded - * performance if ROM access is slower than RAM access. - * - * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. - */ -//#define MBEDTLS_AES_ROM_TABLES - -/** - * \def MBEDTLS_AES_FEWER_TABLES - * - * Use less ROM/RAM for AES tables. - * - * Uncommenting this macro omits 75% of the AES tables from - * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) - * by computing their values on the fly during operations - * (the tables are entry-wise rotations of one another). - * - * Tradeoff: Uncommenting this reduces the RAM / ROM footprint - * by ~6kb but at the cost of more arithmetic operations during - * runtime. Specifically, one has to compare 4 accesses within - * different tables to 4 accesses with additional arithmetic - * operations within the same table. The performance gain/loss - * depends on the system and memory details. - * - * This option is independent of \c MBEDTLS_AES_ROM_TABLES. - */ -//#define MBEDTLS_AES_FEWER_TABLES - -/** - * \def MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH - * - * Use only 128-bit keys in AES operations to save ROM. - * - * Uncomment this macro to remove support for AES operations that use 192- - * or 256-bit keys. - * - * Uncommenting this macro reduces the size of AES code by ~300 bytes - * on v8-M/Thumb2. - * - * Module: library/aes.c - * - * Requires: MBEDTLS_AES_C - */ -//#define MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH - -/* - * Disable plain C implementation for AES. - * - * When the plain C implementation is enabled, and an implementation using a - * special CPU feature (such as MBEDTLS_AESCE_C) is also enabled, runtime - * detection will be used to select between them. - * - * If only one implementation is present, runtime detection will not be used. - * This configuration will crash at runtime if running on a CPU without the - * necessary features. It will not build unless at least one of MBEDTLS_AESCE_C - * and/or MBEDTLS_AESNI_C is enabled & present in the build. - */ -//#define MBEDTLS_AES_USE_HARDWARE_ONLY - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -//#define MBEDTLS_CAMELLIA_SMALL_MEMORY - -/** - * \def MBEDTLS_CHECK_RETURN_WARNING - * - * If this macro is defined, emit a compile-time warning if application code - * calls a function without checking its return value, but the return value - * should generally be checked in portable applications. - * - * This is only supported on platforms where #MBEDTLS_CHECK_RETURN is - * implemented. Otherwise this option has no effect. - * - * Uncomment to get warnings on using fallible functions without checking - * their return value. - * - * \note This feature is a work in progress. - * Warnings will be added to more functions in the future. - * - * \note A few functions are considered critical, and ignoring the return - * value of these functions will trigger a warning even if this - * macro is not defined. To completely disable return value check - * warnings, define #MBEDTLS_CHECK_RETURN with an empty expansion. - */ -//#define MBEDTLS_CHECK_RETURN_WARNING - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CBC - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -//#define MBEDTLS_CIPHER_MODE_CFB /* !!OM */ - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CTR - -/** - * \def MBEDTLS_CIPHER_MODE_OFB - * - * Enable Output Feedback mode (OFB) for symmetric ciphers. - */ -//#define MBEDTLS_CIPHER_MODE_OFB /* !!OM */ - -/** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ -//#define MBEDTLS_CIPHER_MODE_XTS /* !!OM */ - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * To enable the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -//#define MBEDTLS_CIPHER_NULL_CIPHER - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -#define MBEDTLS_CIPHER_PADDING_PKCS7 -#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define MBEDTLS_CIPHER_PADDING_ZEROS - -/** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - * - * Uncomment this macro to use a 128-bit key in the CTR_DRBG module. - * Without this, CTR_DRBG uses a 256-bit key - * unless \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is set. - */ -//#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - -/** - * Enable the verified implementations of ECDH primitives from Project Everest - * (currently only Curve25519). This feature changes the layout of ECDH - * contexts and therefore is a compatibility break for applications that access - * fields of a mbedtls_ecdh_context structure directly. See also - * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h. - */ -//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -/* Short Weierstrass curves (supporting ECP, ECDH, ECDSA) */ -//#define MBEDTLS_ECP_DP_SECP192R1_ENABLED /* !!OM */ -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_DP_SECP384R1_ENABLED -//#define MBEDTLS_ECP_DP_SECP521R1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_SECP192K1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_SECP224K1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_SECP256K1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_BP256R1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_BP384R1_ENABLED /* !!OM */ -//#define MBEDTLS_ECP_DP_BP512R1_ENABLED /* !!OM */ -/* Montgomery curves (supporting ECP) */ -#define MBEDTLS_ECP_DP_CURVE25519_ENABLED -//#define MBEDTLS_ECP_DP_CURVE448_ENABLED /* !!OM */ - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#define MBEDTLS_ECP_NIST_OPTIM - -/** - * \def MBEDTLS_ECP_RESTARTABLE - * - * Enable "non-blocking" ECC operations that can return early and be resumed. - * - * This allows various functions to pause by returning - * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module, - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in - * order to further progress and eventually complete their operation. This is - * controlled through mbedtls_ecp_set_max_ops() which limits the maximum - * number of ECC operations a function may perform before pausing; see - * mbedtls_ecp_set_max_ops() for more information. - * - * This is useful in non-threaded environments if you want to avoid blocking - * for too long on ECC (and, hence, X.509 or SSL/TLS) operations. - * - * This option: - * - Adds xxx_restartable() variants of existing operations in the - * following modules, with corresponding restart context types: - * - ECP (for Short Weierstrass curves only): scalar multiplication (mul), - * linear combination (muladd); - * - ECDSA: signature generation & verification; - * - PK: signature generation & verification; - * - X509: certificate chain verification. - * - Adds mbedtls_ecdh_enable_restart() in the ECDH module. - * - Changes the behaviour of TLS 1.2 clients (not servers) when using the - * ECDHE-ECDSA key exchange (not other key exchanges) to make all ECC - * computations restartable: - * - ECDH operations from the key exchange, only for Short Weierstrass - * curves, only when MBEDTLS_USE_PSA_CRYPTO is not enabled. - * - verification of the server's key exchange signature; - * - verification of the server's certificate chain; - * - generation of the client's signature if client authentication is used, - * with an ECC key/certificate. - * - * \note In the cases above, the usual SSL/TLS functions, such as - * mbedtls_ssl_handshake(), can now return - * MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS. - * - * \note When this option and MBEDTLS_USE_PSA_CRYPTO are both enabled, - * restartable operations in PK, X.509 and TLS (see above) are not - * using PSA. On the other hand, ECDH computations in TLS are using - * PSA, and are not restartable. These are temporary limitations that - * should be lifted in the future. - * - * \note This option only works with the default software implementation of - * elliptic curve functionality. It is incompatible with - * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT. - * - * Requires: MBEDTLS_ECP_C - * - * Uncomment this macro to enable restartable ECC computations. - */ -//#define MBEDTLS_ECP_RESTARTABLE - -/** - * Uncomment to enable using new bignum code in the ECC modules. - * - * \warning This is currently experimental, incomplete and therefore should not - * be used in production. - */ -//#define MBEDTLS_ECP_WITH_MPI_UINT - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C, MBEDTLS_ECDSA_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -//#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED /* !!OM */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -//#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED /* !!OM */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) - * MBEDTLS_RSA_C - * MBEDTLS_PKCS1_V15 - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) - * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDSA) - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) - * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDSA) - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) - * MBEDTLS_RSA_C - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_JPAKE) - * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver) - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * \warning If SHA-256 is provided only by a PSA driver, you must call - * psa_crypto_init() before the first hanshake (even if - * MBEDTLS_USE_PSA_CRYPTO is disabled). - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_PK_PARSE_EC_COMPRESSED - * - * Enable the support for parsing public keys of type Short Weierstrass - * (MBEDTLS_ECP_DP_SECP_XXX and MBEDTLS_ECP_DP_BP_XXX) which are using the - * compressed point format. This parsing is done through ECP module's functions. - * - * \note As explained in the description of MBEDTLS_ECP_PF_COMPRESSED (in ecp.h) - * the only unsupported curves are MBEDTLS_ECP_DP_SECP224R1 and - * MBEDTLS_ECP_DP_SECP224K1. - */ -//#define MBEDTLS_PK_PARSE_EC_COMPRESSED /* !!OM */ - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -//#define MBEDTLS_GENPRIME /* !!OM */ - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -#define MBEDTLS_FS_IO - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources in mbedtls_entropy_init(). - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -//#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -//#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_ENTROPY_NV_SEED - * - * Enable the non-volatile (NV) seed file-based entropy source. - * (Also enables the NV seed read/write functions in the platform layer) - * - * This is crucial (if not required) on systems that do not have a - * cryptographic entropy source (in hardware or kernel) available. - * - * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C - * - * \note The read/write functions that are used by the entropy source are - * determined in the platform layer, and can be modified at runtime and/or - * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. - * - * \note If you use the default implementation functions that read a seedfile - * with regular fopen(), please make sure you make a seedfile with the - * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at - * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from - * and written to or you will get an entropy source error! The default - * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE - * bytes from the file. - * - * \note The entropy collector will write to the seed file before entropy is - * given to an external source, to update it. - */ -//#define MBEDTLS_ENTROPY_NV_SEED - -/* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER - * - * Enable key identifiers that encode a key owner identifier. - * - * The owner of a key is identified by a value of type ::mbedtls_key_owner_id_t - * which is currently hard-coded to be int32_t. - * - * Note that this option is meant for internal use only and may be removed - * without notice. - */ -//#define MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -//#define MBEDTLS_MEMORY_DEBUG - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() and backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -//#define MBEDTLS_MEMORY_BACKTRACE - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -#define MBEDTLS_PKCS1_V15 - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * \warning If using a hash that is only provided by PSA drivers, you must - * call psa_crypto_init() before doing any PKCS#1 v2.1 operation. - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -#define MBEDTLS_PKCS1_V21 - -/** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS - * - * Enable support for platform built-in keys. If you enable this feature, - * you must implement the function mbedtls_psa_platform_get_builtin_key(). - * See the documentation of that function for more information. - * - * Built-in keys are typically derived from a hardware unique key or - * stored in a secure element. - * - * Requires: MBEDTLS_PSA_CRYPTO_C. - * - * \warning This interface is experimental and may change or be removed - * without notice. - */ -//#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS - -/** \def MBEDTLS_PSA_CRYPTO_CLIENT - * - * Enable support for PSA crypto client. - * - * \note This option allows to include the code necessary for a PSA - * crypto client when the PSA crypto implementation is not included in - * the library (MBEDTLS_PSA_CRYPTO_C disabled). The code included is the - * code to set and get PSA key attributes. - * The development of PSA drivers partially relying on the library to - * fulfill the hardware gaps is another possible usage of this option. - * - * \warning This interface is experimental and may change or be removed - * without notice. - */ -#define MBEDTLS_PSA_CRYPTO_CLIENT /* !!OM */ - -/** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG - * - * Make the PSA Crypto module use an external random generator provided - * by a driver, instead of Mbed TLS's entropy and DRBG modules. - * - * \note This random generator must deliver random numbers with cryptographic - * quality and high performance. It must supply unpredictable numbers - * with a uniform distribution. The implementation of this function - * is responsible for ensuring that the random generator is seeded - * with sufficient entropy. If you have a hardware TRNG which is slow - * or delivers non-uniform output, declare it as an entropy source - * with mbedtls_entropy_add_source() instead of enabling this option. - * - * If you enable this option, you must configure the type - * ::mbedtls_psa_external_random_context_t in psa/crypto_platform.h - * and define a function called mbedtls_psa_external_get_random() - * with the following prototype: - * ``` - * psa_status_t mbedtls_psa_external_get_random( - * mbedtls_psa_external_random_context_t *context, - * uint8_t *output, size_t output_size, size_t *output_length); - * ); - * ``` - * The \c context value is initialized to 0 before the first call. - * The function must fill the \c output buffer with \c output_size bytes - * of random data and set \c *output_length to \c output_size. - * - * Requires: MBEDTLS_PSA_CRYPTO_C - * - * \warning If you enable this option, code that uses the PSA cryptography - * interface will not use any of the entropy sources set up for - * the entropy module, nor the NV seed that MBEDTLS_ENTROPY_NV_SEED - * enables. - * - * \note This option is experimental and may be removed without notice. - */ -//#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG - -/** - * \def MBEDTLS_PSA_CRYPTO_SPM - * - * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure - * Partition Manager) integration which separates the code into two parts: a - * NSPE (Non-Secure Process Environment) and an SPE (Secure Process - * Environment). - * - * If you enable this option, your build environment must include a header - * file `"crypto_spe.h"` (either in the `psa` subdirectory of the Mbed TLS - * header files, or in another directory on the compiler's include search - * path). Alternatively, your platform may customize the header - * `psa/crypto_platform.h`, in which case it can skip or replace the - * inclusion of `"crypto_spe.h"`. - * - * Module: library/psa_crypto.c - * Requires: MBEDTLS_PSA_CRYPTO_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SPM - -/** - * Uncomment to enable p256-m. This is an alternative implementation of - * key generation, ECDH and (randomized) ECDSA on the curve SECP256R1. - * Compared to the default implementation: - * - * - p256-m has a much smaller code size and RAM footprint. - * - p256-m is only available via the PSA API. This includes the pk module - * when #MBEDTLS_USE_PSA_CRYPTO is enabled. - * - p256-m does not support deterministic ECDSA, EC-JPAKE, custom protocols - * over the core arithmetic, or deterministic derivation of keys. - * - * We recommend enabling this option if your application uses the PSA API - * and the only elliptic curve support it needs is ECDH and ECDSA over - * SECP256R1. - * - * If you enable this option, you do not need to enable any ECC-related - * MBEDTLS_xxx option. You do need to separately request support for the - * cryptographic mechanisms through the PSA API: - * - #MBEDTLS_PSA_CRYPTO_C and #MBEDTLS_PSA_CRYPTO_CONFIG for PSA-based - * configuration; - * - #MBEDTLS_USE_PSA_CRYPTO if you want to use p256-m from PK, X.509 or TLS; - * - #PSA_WANT_ECC_SECP_R1_256; - * - #PSA_WANT_ALG_ECDH and/or #PSA_WANT_ALG_ECDSA as needed; - * - #PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY, #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC, - * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT, - * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT and/or - * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE as needed. - * - * \note To benefit from the smaller code size of p256-m, make sure that you - * do not enable any ECC-related option not supported by p256-m: this - * would cause the built-in ECC implementation to be built as well, in - * order to provide the required option. - * Make sure #PSA_WANT_ALG_DETERMINISTIC_ECDSA, #PSA_WANT_ALG_JPAKE and - * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE, and curves other than - * SECP256R1 are disabled as they are not supported by this driver. - * Also, avoid defining #MBEDTLS_PK_PARSE_EC_COMPRESSED or - * #MBEDTLS_PK_PARSE_EC_EXTENDED as those currently require a subset of - * the built-in ECC implementation, see docs/driver-only-builds.md. - */ -//#define MBEDTLS_PSA_P256M_DRIVER_ENABLED - -/** - * \def MBEDTLS_PSA_INJECT_ENTROPY - * - * Enable support for entropy injection at first boot. This feature is - * required on systems that do not have a built-in entropy source (TRNG). - * This feature is currently not supported on systems that have a built-in - * entropy source. - * - * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED - * - */ -//#define MBEDTLS_PSA_INJECT_ENTROPY - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem - * for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -//#define MBEDTLS_RSA_NO_CRT - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -#define MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -//#define MBEDTLS_SHA256_SMALLER - -/** - * \def MBEDTLS_SHA512_SMALLER - * - * Enable an implementation of SHA-512 that has lower ROM footprint but also - * lower performance. - * - * Uncomment to enable the smaller implementation of SHA512. - */ -//#define MBEDTLS_SHA512_SMALLER - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, Mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_DTLS_CONNECTION_ID - * - * Enable support for the DTLS Connection ID (CID) extension, - * which allows to identify DTLS connections across changes - * in the underlying transport. The CID functionality is described - * in RFC 9146. - * - * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`, - * mbedtls_ssl_get_own_cid()`, `mbedtls_ssl_get_peer_cid()` and - * `mbedtls_ssl_conf_cid()`. See the corresponding documentation for - * more information. - * - * The maximum lengths of outgoing and incoming CIDs can be configured - * through the options - * - MBEDTLS_SSL_CID_OUT_LEN_MAX - * - MBEDTLS_SSL_CID_IN_LEN_MAX. - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Uncomment to enable the Connection ID extension. - */ -#define MBEDTLS_SSL_DTLS_CONNECTION_ID - - -/** - * \def MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT - * - * Defines whether RFC 9146 (default) or the legacy version - * (version draft-ietf-tls-dtls-connection-id-05, - * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05) - * is used. - * - * Set the value to 0 for the standard version, and - * 1 for the legacy draft version. - * - * \deprecated Support for the legacy version of the DTLS - * Connection ID feature is deprecated. Please - * switch to the standardized version defined - * in RFC 9146 enabled by utilizing - * MBEDTLS_SSL_DTLS_CONNECTION_ID without use - * of MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT. - * - * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID - */ -#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT 0 - -/** - * \def MBEDTLS_SSL_ASYNC_PRIVATE - * - * Enable asynchronous external private key operations in SSL. This allows - * you to configure an SSL connection to call an external cryptographic - * module to perform private key operations instead of performing the - * operation inside the library. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - */ -//#define MBEDTLS_SSL_ASYNC_PRIVATE - -/** - * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION - * - * Enable serialization of the TLS context structures, through use of the - * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load(). - * - * This pair of functions allows one side of a connection to serialize the - * context associated with the connection, then free or re-use that context - * while the serialized state is persisted elsewhere, and finally deserialize - * that state to a live context for resuming read/write operations on the - * connection. From a protocol perspective, the state of the connection is - * unaffected, in particular this is entirely transparent to the peer. - * - * Note: this is distinct from TLS session resumption, which is part of the - * protocol and fully visible by the peer. TLS session resumption enables - * establishing new connections associated to a saved session with shorter, - * lighter handshakes, while context serialization is a local optimization in - * handling a single, potentially long-lived connection. - * - * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are - * saved after the handshake to allow for more efficient serialization, so if - * you don't need this feature you'll save RAM by disabling it. - * - * Requires: MBEDTLS_GCM_C or MBEDTLS_CCM_C or MBEDTLS_CHACHAPOLY_C - * - * Comment to disable the context serialization APIs. - */ -#define MBEDTLS_SSL_CONTEXT_SERIALIZATION - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -//#define MBEDTLS_SSL_DEBUG_ALL - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for RFC 7627: Session Hash and Extended Master Secret - * Extension. - * - * This was introduced as "the proper fix" to the Triple Handshake family of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET - -/** - * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - * - * This option controls the availability of the API mbedtls_ssl_get_peer_cert() - * giving access to the peer's certificate after completion of the handshake. - * - * Unless you need mbedtls_ssl_peer_cert() in your application, it is - * recommended to disable this option for reduced RAM usage. - * - * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still - * defined, but always returns \c NULL. - * - * \note This option has no influence on the protection against the - * triple handshake attack. Even if it is disabled, Mbed TLS will - * still ensure that certificates do not change during renegotiation, - * for example by keeping a hash of the peer's certificate. - * - * \note This option is required if MBEDTLS_SSL_PROTO_TLS1_3 is set. - * - * Comment this macro to disable storing the peer's certificate - * after the handshake. - */ -#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Enable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -#define MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_RECORD_SIZE_LIMIT - * - * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 only). - * - * \warning This extension is currently in development and must NOT be used except - * for testing purposes. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_3 - * - * Uncomment this macro to enable support for the record_size_limit extension - */ -//#define MBEDTLS_SSL_RECORD_SIZE_LIMIT - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: Without MBEDTLS_USE_PSA_CRYPTO: MBEDTLS_MD_C and - * (MBEDTLS_SHA256_C or MBEDTLS_SHA384_C or - * SHA-256 or SHA-512 provided by a PSA driver) - * With MBEDTLS_USE_PSA_CRYPTO: - * PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384 - * - * \warning If building with MBEDTLS_USE_PSA_CRYPTO, or if the hash(es) used - * are only provided by PSA drivers, you must call psa_crypto_init() before - * doing any TLS operations. - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#define MBEDTLS_SSL_PROTO_TLS1_2 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_3 - * - * Enable support for TLS 1.3. - * - * \note See docs/architecture/tls13-support.md for a description of the TLS - * 1.3 support that this option enables. - * - * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - * Requires: MBEDTLS_PSA_CRYPTO_C - * - * \note TLS 1.3 uses PSA crypto for cryptographic operations that are - * directly performed by TLS 1.3 code. As a consequence, you must - * call psa_crypto_init() before the first TLS 1.3 handshake. - * - * \note Cryptographic operations performed indirectly via another module - * (X.509, PK) or by code shared with TLS 1.2 (record protection, - * running handshake hash) only use PSA crypto if - * #MBEDTLS_USE_PSA_CRYPTO is enabled. - * - * Uncomment this macro to enable the support for TLS 1.3. - */ -//#define MBEDTLS_SSL_PROTO_TLS1_3 - -/** - * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE - * - * Enable TLS 1.3 middlebox compatibility mode. - * - * As specified in Section D.4 of RFC 8446, TLS 1.3 offers a compatibility - * mode to make a TLS 1.3 connection more likely to pass through middle boxes - * expecting TLS 1.2 traffic. - * - * Turning on the compatibility mode comes at the cost of a few added bytes - * on the wire, but it doesn't affect compatibility with TLS 1.3 implementations - * that don't use it. Therefore, unless transmission bandwidth is critical and - * you know that middlebox compatibility issues won't occur, it is therefore - * recommended to set this option. - * - * Comment to disable compatibility mode for TLS 1.3. If - * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any - * effect on the build. - * - */ -//#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE - -/** - * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED - * - * Enable TLS 1.3 PSK key exchange mode. - * - * Comment to disable support for the PSK key exchange mode in TLS 1.3. If - * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any - * effect on the build. - * - */ -#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED - -/** - * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED - * - * Enable TLS 1.3 ephemeral key exchange mode. - * - * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH - * MBEDTLS_X509_CRT_PARSE_C - * and at least one of: - * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDSA) - * MBEDTLS_PKCS1_V21 - * - * Comment to disable support for the ephemeral key exchange mode in TLS 1.3. - * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any - * effect on the build. - * - */ -#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED - -/** - * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED - * - * Enable TLS 1.3 PSK ephemeral key exchange mode. - * - * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH - * - * Comment to disable support for the PSK ephemeral key exchange mode in - * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not - * have any effect on the build. - * - */ -#define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED - -/** - * \def MBEDTLS_SSL_EARLY_DATA - * - * Enable support for RFC 8446 TLS 1.3 early data. - * - * Requires: MBEDTLS_SSL_SESSION_TICKETS and either - * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or - * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED - * - * Comment this to disable support for early data. If MBEDTLS_SSL_PROTO_TLS1_3 - * is not enabled, this option does not have any effect on the build. - * - * This feature is experimental, not completed and thus not ready for - * production. - * - * \note The maximum amount of early data can be set with - * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE. - * - */ -//#define MBEDTLS_SSL_EARLY_DATA - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#define MBEDTLS_SSL_PROTO_DTLS - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -#define MBEDTLS_SSL_ALPN - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can be a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY - -/** - * \def MBEDTLS_SSL_DTLS_SRTP - * - * Enable support for negotiation of DTLS-SRTP (RFC 5764) - * through the use_srtp extension. - * - * \note This feature provides the minimum functionality required - * to negotiate the use of DTLS-SRTP and to allow the derivation of - * the associated SRTP packet protection key material. - * In particular, the SRTP packet protection itself, as well as the - * demultiplexing of RTP and DTLS packets at the datagram layer - * (see Section 5 of RFC 5764), are not handled by this feature. - * Instead, after successful completion of a handshake negotiating - * the use of DTLS-SRTP, the extended key exporter API - * mbedtls_ssl_conf_export_keys_cb() should be used to implement - * the key exporter described in Section 4.2 of RFC 5764 and RFC 5705 - * (this is implemented in the SSL example programs). - * The resulting key should then be passed to an SRTP stack. - * - * Setting this option enables the runtime API - * mbedtls_ssl_conf_dtls_srtp_protection_profiles() - * through which the supported DTLS-SRTP protection - * profiles can be configured. You must call this API at - * runtime if you wish to negotiate the use of DTLS-SRTP. - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Uncomment this to enable support for use_srtp extension. - */ -//#define MBEDTLS_SSL_DTLS_SRTP - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintenance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#define MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - * - * When this option is enabled, the SSL buffer will be resized automatically - * based on the negotiated maximum fragment length in each direction. - * - * Requires: MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - */ -//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - -/** - * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - * - * Enable testing of the constant-flow nature of some sensitive functions with - * clang's MemorySanitizer. This causes some existing tests to also test - * this non-functional property of the code under test. - * - * This setting requires compiling with clang -fsanitize=memory. The test - * suites can then be run normally. - * - * \warning This macro is only used for extended testing; it is not considered - * part of the library's API, so it may change or disappear at any time. - * - * Uncomment to enable testing of the constant-flow nature of selected code. - */ -//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - -/** - * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND - * - * Enable testing of the constant-flow nature of some sensitive functions with - * valgrind's memcheck tool. This causes some existing tests to also test - * this non-functional property of the code under test. - * - * This setting requires valgrind headers for building, and is only useful for - * testing if the tests suites are run with valgrind's memcheck. This can be - * done for an individual test suite with 'valgrind ./test_suite_xxx', or when - * using CMake, this can be done for all test suites with 'make memcheck'. - * - * \warning This macro is only used for extended testing; it is not considered - * part of the library's API, so it may change or disappear at any time. - * - * Uncomment to enable testing of the constant-flow nature of selected code. - */ -//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND - -/** - * \def MBEDTLS_TEST_HOOKS - * - * Enable features for invasive testing such as introspection functions and - * hooks for fault injection. This enables additional unit tests. - * - * Merely enabling this feature should not change the behavior of the product. - * It only adds new code, and new branching points where the default behavior - * is the same as when this feature is disabled. - * However, this feature increases the attack surface: there is an added - * risk of vulnerabilities, and more gadgets that can make exploits easier. - * Therefore this feature must never be enabled in production. - * - * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more - * information. - * - * Uncomment to enable invasive tests. - */ -//#define MBEDTLS_TEST_HOOKS - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -//#define MBEDTLS_THREADING_ALT - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -//#define MBEDTLS_THREADING_PTHREAD - -/** - * \def MBEDTLS_USE_PSA_CRYPTO - * - * Make the X.509 and TLS libraries use PSA for cryptographic operations as - * much as possible, and enable new APIs for using keys handled by PSA Crypto. - * - * \note Development of this option is currently in progress, and parts of Mbed - * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts - * will still continue to work as usual, so enabling this option should not - * break backwards compatibility. - * - * \warning If you enable this option, you need to call `psa_crypto_init()` - * before calling any function from the SSL/TLS, X.509 or PK modules, except - * for the various mbedtls_xxx_init() functions which can be called at any time. - * - * \note An important and desirable effect of this option is that it allows - * PK, X.509 and TLS to take advantage of PSA drivers. For example, enabling - * this option is what allows use of drivers for ECDSA, ECDH and EC J-PAKE in - * those modules. However, note that even with this option disabled, some code - * in PK, X.509, TLS or the crypto library might still use PSA drivers, if it - * can determine it's safe to do so; currently that's the case for hashes. - * - * \note See docs/use-psa-crypto.md for a complete description this option. - * - * Requires: MBEDTLS_PSA_CRYPTO_C. - * - * Uncomment this to enable internal use of PSA Crypto and new associated APIs. - */ -#define MBEDTLS_USE_PSA_CRYPTO /* !!OM */ - -/** - * \def MBEDTLS_PSA_CRYPTO_CONFIG - * - * This setting allows support for cryptographic mechanisms through the PSA - * API to be configured separately from support through the mbedtls API. - * - * When this option is disabled, the PSA API exposes the cryptographic - * mechanisms that can be implemented on top of the `mbedtls_xxx` API - * configured with `MBEDTLS_XXX` symbols. - * - * When this option is enabled, the PSA API exposes the cryptographic - * mechanisms requested by the `PSA_WANT_XXX` symbols defined in - * include/psa/crypto_config.h. The corresponding `MBEDTLS_XXX` settings are - * automatically enabled if required (i.e. if no PSA driver provides the - * mechanism). You may still freely enable additional `MBEDTLS_XXX` symbols - * in mbedtls_config.h. - * - * If the symbol #MBEDTLS_PSA_CRYPTO_CONFIG_FILE is defined, it specifies - * an alternative header to include instead of include/psa/crypto_config.h. - * - * \warning This option is experimental, in that the set of `PSA_WANT_XXX` - * symbols is not completely finalized yet, and the configuration - * tooling is not ideally adapted to having two separate configuration - * files. - * Future minor releases of Mbed TLS may make minor changes to those - * symbols, but we will endeavor to provide a transition path. - * Nonetheless, this option is considered mature enough to use in - * production, as long as you accept that you may need to make - * minor changes to psa/crypto_config.h when upgrading Mbed TLS. - */ -#define MBEDTLS_PSA_CRYPTO_CONFIG /* !!OM */ - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -#define MBEDTLS_VERSION_FEATURES - -/** - * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - * - * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()` - * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure - * the set of trusted certificates through a callback instead of a linked - * list. - * - * This is useful for example in environments where a large number of trusted - * certificates is present and storing them in a linked list isn't efficient - * enough, or when the set of trusted certificates changes frequently. - * - * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and - * `mbedtls_ssl_conf_ca_cb()` for more information. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Uncomment to enable trusted certificate callbacks. - */ -//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - -/** - * \def MBEDTLS_X509_REMOVE_INFO - * - * Disable mbedtls_x509_*_info() and related APIs. - * - * Uncomment to omit mbedtls_x509_*_info(), as well as mbedtls_debug_print_crt() - * and other functions/constants only used by these functions, thus reducing - * the code footprint by several KB. - */ -//#define MBEDTLS_X509_REMOVE_INFO - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#define MBEDTLS_X509_RSASSA_PSS_SUPPORT -/** \} name SECTION: Mbed TLS feature support */ - -/** - * \name SECTION: Mbed TLS modules - * - * This section enables or disables entire modules in Mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64 or x86-32. - * - * \note AESNI is only supported with certain compilers and target options: - * - Visual Studio 2013: supported. - * - GCC, x86-64, target not explicitly supporting AESNI: - * requires MBEDTLS_HAVE_ASM. - * - GCC, x86-32, target not explicitly supporting AESNI: - * not supported. - * - GCC, x86-64 or x86-32, target supporting AESNI: supported. - * For this assembly-less implementation, you must currently compile - * `library/aesni.c` and `library/aes.c` with machine options to enable - * SSE2 and AESNI instructions: `gcc -msse2 -maes -mpclmul` or - * `clang -maes -mpclmul`. - * - Non-x86 targets: this option is silently ignored. - * - Other compilers: this option is silently ignored. - * - * \note - * Above, "GCC" includes compatible compilers such as Clang. - * The limitations on target support are likely to be relaxed in the future. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM (on some platforms, see note) - * - * This modules adds support for the AES-NI instructions on x86. - */ -#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AESCE_C - * - * Enable AES cryptographic extension support on 64-bit Arm. - * - * Module: library/aesce.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_AES_C - * - * \warning Runtime detection only works on Linux. For non-Linux operating - * system, Armv8-A Cryptographic Extensions must be supported by - * the CPU when this option is enabled. - * - * \note Minimum compiler versions for this feature are Clang 4.0, - * armclang 6.6, GCC 6.0 or MSVC 2019 version 16.11.2. - * - * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for - * armclang <= 6.9 - * - * This module adds support for the AES Armv8-A Cryptographic Extensions on Aarch64 systems. - */ -#define MBEDTLS_AESCE_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/cipher.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * library/bignum_core.c - * library/bignum_mod.c - * library/bignum_mod_raw.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/rsa_alt_helpers.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -//#define MBEDTLS_CAMELLIA_C /* !!OM */ - -/** - * \def MBEDTLS_ARIA_C - * - * Enable the ARIA block cipher. - * - * Module: library/aria.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * - * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 - */ -//#define MBEDTLS_ARIA_C /* !!OM */ - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or - * MBEDTLS_ARIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#define MBEDTLS_CCM_C - -/** - * \def MBEDTLS_CHACHA20_C - * - * Enable the ChaCha20 stream cipher. - * - * Module: library/chacha20.c - */ -#define MBEDTLS_CHACHA20_C - -/** - * \def MBEDTLS_CHACHAPOLY_C - * - * Enable the ChaCha20-Poly1305 AEAD algorithm. - * - * Module: library/chachapoly.c - * - * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C - */ -#define MBEDTLS_CHACHAPOLY_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ccm.c - * library/cmac.c - * library/gcm.c - * library/nist_kw.c - * library/pkcs12.c - * library/pkcs5.c - * library/psa_crypto_aead.c - * library/psa_crypto_mac.c - * library/ssl_ciphersuites.c - * library/ssl_msg.c - * library/ssl_ticket.c (unless MBEDTLS_USE_PSA_CRYPTO is enabled) - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CMAC_C - * - * Enable the CMAC (Cipher-based Message Authentication Code) mode for block - * ciphers. - * - * \note When #MBEDTLS_CMAC_ALT is active, meaning that the underlying - * implementation of the CMAC algorithm is provided by an alternate - * implementation, that alternate implementation may opt to not support - * AES-192 or 3DES as underlying block ciphers for the CMAC operation. - * - * Module: library/cmac.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_DES_C - * - */ -#define MBEDTLS_CMAC_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-based random generator. - * The CTR_DRBG generator uses AES-256 by default. - * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above. - * - * \note AES-128 will be used if \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is set. - * - * \note To achieve a 256-bit security strength with CTR_DRBG, - * you must use AES-256 *and* use sufficient entropy. - * See ctr_drbg.h for more details. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES random number generator. - */ -#define MBEDTLS_CTR_DRBG_C - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_msg.c - * library/ssl_tls.c - * library/ssl_tls12_*.c - * library/ssl_tls13_*.c - * - * This module provides debugging functions. - */ -#define MBEDTLS_DEBUG_C - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/cipher.c - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - * - * \warning DES/3DES are considered weak ciphers and their use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -//#define MBEDTLS_DES_C /* !!OM */ - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -//#define MBEDTLS_DHM_C /* !!OM */ - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/psa_crypto.c - * library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#define MBEDTLS_ECDH_C - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C, - * and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a - * short Weierstrass curve. - */ -#define MBEDTLS_ECDSA_C - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \note EC J-PAKE support is based on the Thread v1.0.0 specification. - * It has not been reviewed for compliance with newer standards such as - * Thread v1.1 or RFC 8236. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C and either MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C - * - * \warning If using a hash that is only provided by PSA drivers, you must - * call psa_crypto_init() before doing any EC J-PAKE operations. - */ -#define MBEDTLS_ECJPAKE_C - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#define MBEDTLS_ECP_C - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM). - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or - * MBEDTLS_ARIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -#define MBEDTLS_GCM_C - -/** - * \def MBEDTLS_HKDF_C - * - * Enable the HKDF algorithm (RFC 5869). - * - * Module: library/hkdf.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the Hashed Message Authentication Code - * (HMAC)-based key derivation function (HKDF). - */ -#define MBEDTLS_HKDF_C - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number generator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_LMS_C - * - * Enable the LMS stateful-hash asymmetric signature algorithm. - * - * Module: library/lms.c - * Caller: - * - * Requires: MBEDTLS_PSA_CRYPTO_C - * - * Uncomment to enable the LMS verification algorithm and public key operations. - */ -//#define MBEDTLS_LMS_C /* !!OM */ - -/** - * \def MBEDTLS_LMS_PRIVATE - * - * Enable LMS private-key operations and signing code. Functions enabled by this - * option are experimental, and should not be used in production. - * - * Requires: MBEDTLS_LMS_C - * - * Uncomment to enable the LMS signature algorithm and private key operations. - */ -//#define MBEDTLS_LMS_PRIVATE - -/** - * \def MBEDTLS_NIST_KW_C - * - * Enable the Key Wrapping mode for 128-bit block ciphers, - * as defined in NIST SP 800-38F. Only KW and KWP modes - * are supported. At the moment, only AES is approved by NIST. - * - * Module: library/nist_kw.c - * - * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C - */ -#define MBEDTLS_NIST_KW_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic layer for message digest (hashing) and HMAC. - * - * Requires: one of: MBEDTLS_MD5_C, MBEDTLS_RIPEMD160_C, MBEDTLS_SHA1_C, - * MBEDTLS_SHA224_C, MBEDTLS_SHA256_C, MBEDTLS_SHA384_C, - * MBEDTLS_SHA512_C, or MBEDTLS_PSA_CRYPTO_C with at least - * one hash. - * Module: library/md.c - * Caller: library/constant_time.c - * library/ecdsa.c - * library/ecjpake.c - * library/hkdf.c - * library/hmac_drbg.c - * library/pk.c - * library/pkcs5.c - * library/pkcs12.c - * library/psa_crypto_ecp.c - * library/psa_crypto_rsa.c - * library/rsa.c - * library/ssl_cookie.c - * library/ssl_msg.c - * library/ssl_tls.c - * library/x509.c - * library/x509_crt.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/md5.c - * Caller: library/md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for TLS 1.2 depending on the handshake parameters. - * Further, it is used for checking MD5-signed certificates, and for PBKDF1 - * when decrypting PEM-encoded encrypted keys. - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD5_C /* !!OM */ - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within Mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -#define MBEDTLS_NET_C - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * optionally MBEDTLS_MD5_C, or PSA Crypto with MD5 (see below) - * - * \warning When parsing password-protected files, if MD5 is provided only by - * a PSA driver, you must call psa_crypto_init() before the first file. - * - * This modules adds support for decoding / parsing PEM files. - */ -//#define MBEDTLS_PEM_PARSE_C /* !!OM */ - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -//#define MBEDTLS_PEM_WRITE_C /* !!OM */ - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymmetric) key layer. - * - * Module: library/pk.c - * Caller: library/psa_crypto_rsa.c - * library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * library/x509.c - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymmetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymmetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_CIPHER_C - * Auto-enables: MBEDTLS_MD_C - * - * \warning If using a hash that is only provided by PSA drivers, you must - * call psa_crypto_init() before doing any PKCS5 operations. - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS7_C - * - * Enable PKCS #7 core for using PKCS #7-formatted signatures. - * RFC Link - https://tools.ietf.org/html/rfc2315 - * - * Module: library/pkcs7.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C, - * MBEDTLS_X509_CRT_PARSE_C MBEDTLS_X509_CRL_PARSE_C, - * MBEDTLS_BIGNUM_C, MBEDTLS_MD_C - * - * This module is required for the PKCS #7 parsing modules. - */ -//#define MBEDTLS_PKCS7_C - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C and either - * MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C. - * - * \warning If using a hash that is only provided by PSA drivers, you must - * call psa_crypto_init() before doing any PKCS12 operations. - * - * This module enables PKCS#12 functions. - */ -#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other modules rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_POLY1305_C - * - * Enable the Poly1305 MAC algorithm. - * - * Module: library/poly1305.c - * Caller: library/chachapoly.c - */ -#define MBEDTLS_POLY1305_C - -/** - * \def MBEDTLS_PSA_CRYPTO_C - * - * Enable the Platform Security Architecture cryptography API. - * - * Module: library/psa_crypto.c - * - * Requires: MBEDTLS_CIPHER_C, - * either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C, - * or MBEDTLS_HMAC_DRBG_C and MBEDTLS_ENTROPY_C, - * or MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG. - * - */ -#define MBEDTLS_PSA_CRYPTO_C - -/** - * \def MBEDTLS_PSA_CRYPTO_SE_C - * - * Enable dynamic secure element support in the Platform Security Architecture - * cryptography API. - * - * \deprecated This feature is deprecated. Please switch to the PSA driver - * interface. - * - * Module: library/psa_crypto_se.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SE_C - -/** - * \def MBEDTLS_PSA_CRYPTO_STORAGE_C - * - * Enable the Platform Security Architecture persistent key storage. - * - * Module: library/psa_crypto_storage.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, - * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of - * the PSA ITS interface - */ -#define MBEDTLS_PSA_CRYPTO_STORAGE_C - -/** - * \def MBEDTLS_PSA_ITS_FILE_C - * - * Enable the emulation of the Platform Security Architecture - * Internal Trusted Storage (PSA ITS) over files. - * - * Module: library/psa_its_file.c - * - * Requires: MBEDTLS_FS_IO - */ -#define MBEDTLS_PSA_ITS_FILE_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -//#define MBEDTLS_RIPEMD160_C /* !!OM */ - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * library/rsa_alt_helpers.c - * Caller: library/pk.c - * library/psa_crypto.c - * library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -#define MBEDTLS_RSA_C - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/sha1.c - * Caller: library/md.c - * library/psa_crypto_hash.c - * - * This module is required for TLS 1.2 depending on the handshake parameters, - * and for SHA1-signed certificates. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA224_C - * - * Enable the SHA-224 cryptographic hash algorithm. - * - * Module: library/sha256.c - * Caller: library/md.c - * library/ssl_cookie.c - * - * This module adds support for SHA-224. - */ -#define MBEDTLS_SHA224_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-256 cryptographic hash algorithm. - * - * Module: library/sha256.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * This module adds support for SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT - * - * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms - * with the ARMv8 cryptographic extensions if they are available at runtime. - * If not, the library will fall back to the C implementation. - * - * \note If MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT is defined when building - * for a non-Aarch64 build it will be silently ignored. - * - * \note Minimum compiler versions for this feature are Clang 4.0, - * armclang 6.6 or GCC 6.0. - * - * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for - * armclang <= 6.9 - * - * \warning MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the - * same time as MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY. - * - * Requires: MBEDTLS_SHA256_C. - * - * Module: library/sha256.c - * - * Uncomment to have the library check for the A64 SHA-256 crypto extensions - * and use them if available. - */ -//#define MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT - -/** - * \def MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY - * - * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash algorithms - * with the ARMv8 cryptographic extensions, which must be available at runtime - * or else an illegal instruction fault will occur. - * - * \note This allows builds with a smaller code size than with - * MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT - * - * \note Minimum compiler versions for this feature are Clang 4.0, - * armclang 6.6 or GCC 6.0. - * - * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for - * armclang <= 6.9 - * - * \warning MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY cannot be defined at the same - * time as MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT. - * - * Requires: MBEDTLS_SHA256_C. - * - * Module: library/sha256.c - * - * Uncomment to have the library use the A64 SHA-256 crypto extensions - * unconditionally. - */ -//#define MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY - -/** - * \def MBEDTLS_SHA384_C - * - * Enable the SHA-384 cryptographic hash algorithm. - * - * Module: library/sha512.c - * Caller: library/md.c - * library/psa_crypto_hash.c - * library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * Comment to disable SHA-384 - */ -#define MBEDTLS_SHA384_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable SHA-512 cryptographic hash algorithms. - * - * Module: library/sha512.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_tls.c - * library/ssl_cookie.c - * - * This module adds support for SHA-512. - */ -#define MBEDTLS_SHA512_C - -/** - * \def MBEDTLS_SHA3_C - * - * Enable the SHA3 cryptographic hash algorithm. - * - * Module: library/sha3.c - * - * This module adds support for SHA3. - */ -//#define MBEDTLS_SHA3_C /* !!OM */ - -/** - * \def MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT - * - * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms - * with the ARMv8 cryptographic extensions if they are available at runtime. - * If not, the library will fall back to the C implementation. - * - * \note If MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT is defined when building - * for a non-Aarch64 build it will be silently ignored. - * - * \note Minimum compiler versions for this feature are Clang 7.0, - * armclang 6.9 or GCC 8.0. - * - * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for - * armclang 6.9 - * - * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the - * same time as MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY. - * - * Requires: MBEDTLS_SHA512_C. - * - * Module: library/sha512.c - * - * Uncomment to have the library check for the A64 SHA-512 crypto extensions - * and use them if available. - */ -//#define MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT - -/** - * \def MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY - * - * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash algorithms - * with the ARMv8 cryptographic extensions, which must be available at runtime - * or else an illegal instruction fault will occur. - * - * \note This allows builds with a smaller code size than with - * MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT - * - * \note Minimum compiler versions for this feature are Clang 7.0, - * armclang 6.9 or GCC 8.0. - * - * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for - * armclang 6.9 - * - * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY cannot be defined at the same - * time as MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT. - * - * Requires: MBEDTLS_SHA512_C. - * - * Module: library/sha512.c - * - * Uncomment to have the library use the A64 SHA-512 crypto extensions - * unconditionally. - */ -//#define MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) && - * (MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C) - */ -#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl*_client.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#define MBEDTLS_SSL_CLI_C - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl*_server.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#define MBEDTLS_SSL_SRV_C - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl*_client.c - * library/ssl*_server.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#define MBEDTLS_SSL_TLS_C - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default Mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. See also our Knowledge Base article about threading: - * https://mbed-tls.readthedocs.io/en/latest/kb/development/thread-safety-and-multi-threading - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within Mbed TLS - */ -//#define MBEDTLS_THREADING_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * \note The timing module will include time.h on suitable platforms - * regardless of the setting of MBEDTLS_HAVE_TIME, unless - * MBEDTLS_TIMING_ALT is used. See timing.c for more information. - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://mbed-tls.readthedocs.io/en/latest/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/timing.c - */ -#define MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C, - * (MBEDTLS_MD_C or MBEDTLS_USE_PSA_CRYPTO) - * - * \warning If building with MBEDTLS_USE_PSA_CRYPTO, you must call - * psa_crypto_init() before doing any X.509 operation. - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/x509_crt.c - * Caller: library/ssl_tls.c - * library/ssl*_client.c - * library/ssl*_server.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#define MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#define MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_PARSE_C, - * (MBEDTLS_MD_C or MBEDTLS_USE_PSA_CRYPTO) - * - * \warning If building with MBEDTLS_USE_PSA_CRYPTO, you must call - * psa_crypto_init() before doing any X.509 create operation. - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#define MBEDTLS_X509_CSR_WRITE_C - -/** \} name SECTION: Mbed TLS modules */ - -/** - * \name SECTION: General configuration options - * - * This section contains Mbed TLS build settings that are not associated - * with a particular module. - * - * \{ - */ - -/** - * \def MBEDTLS_CONFIG_FILE - * - * If defined, this is a header which will be included instead of - * `"mbedtls/mbedtls_config.h"`. - * This header file specifies the compile-time configuration of Mbed TLS. - * Unlike other configuration options, this one must be defined on the - * compiler command line: a definition in `mbedtls_config.h` would have - * no effect. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_CONFIG_FILE "mbedtls/mbedtls_config.h" - -/** - * \def MBEDTLS_USER_CONFIG_FILE - * - * If defined, this is a header which will be included after - * `"mbedtls/mbedtls_config.h"` or #MBEDTLS_CONFIG_FILE. - * This allows you to modify the default configuration, including the ability - * to undefine options that are enabled by default. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_USER_CONFIG_FILE "/dev/null" - -/** - * \def MBEDTLS_PSA_CRYPTO_CONFIG_FILE - * - * If defined, this is a header which will be included instead of - * `"psa/crypto_config.h"`. - * This header file specifies which cryptographic mechanisms are available - * through the PSA API when #MBEDTLS_PSA_CRYPTO_CONFIG is enabled, and - * is not used when #MBEDTLS_PSA_CRYPTO_CONFIG is disabled. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "psa/crypto_config.h" - -/** - * \def MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE - * - * If defined, this is a header which will be included after - * `"psa/crypto_config.h"` or #MBEDTLS_PSA_CRYPTO_CONFIG_FILE. - * This allows you to modify the default configuration, including the ability - * to undefine options that are enabled by default. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE "/dev/null" - -/** - * \def MBEDTLS_PSA_CRYPTO_PLATFORM_FILE - * - * If defined, this is a header which will be included instead of - * `"psa/crypto_platform.h"`. This file should declare the same identifiers - * as the one in Mbed TLS, but with definitions adapted to the platform on - * which the library code will run. - * - * \note The required content of this header can vary from one version of - * Mbed TLS to the next. Integrators who provide an alternative file - * should review the changes in the original file whenever they - * upgrade Mbed TLS. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_PSA_CRYPTO_PLATFORM_FILE "psa/crypto_platform_alt.h" - -/** - * \def MBEDTLS_PSA_CRYPTO_STRUCT_FILE - * - * If defined, this is a header which will be included instead of - * `"psa/crypto_struct.h"`. This file should declare the same identifiers - * as the one in Mbed TLS, but with definitions adapted to the environment - * in which the library code will run. The typical use for this feature - * is to provide alternative type definitions on the client side in - * client-server integrations of PSA crypto, where operation structures - * contain handles instead of cryptographic data. - * - * \note The required content of this header can vary from one version of - * Mbed TLS to the next. Integrators who provide an alternative file - * should review the changes in the original file whenever they - * upgrade Mbed TLS. - * - * This macro is expanded after an \#include directive. This is a popular but - * non-standard feature of the C language, so this feature is only available - * with compilers that perform macro expansion on an \#include line. - * - * The value of this symbol is typically a path in double quotes, either - * absolute or relative to a directory on the include search path. - */ -//#define MBEDTLS_PSA_CRYPTO_STRUCT_FILE "psa/crypto_struct_alt.h" - -/** \} name SECTION: General configuration options */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * \{ - */ -/* The Doxygen documentation here is used when a user comments out a - * setting and runs doxygen themselves. On the other hand, when we typeset - * the full documentation including disabled settings, the documentation - * in specific modules' header files is used if present. When editing this - * file, make sure that each option is documented in exactly one place, - * plus optionally a same-line Doxygen comment here if there is a Doxygen - * comment in the specific module. */ - -/* MPI / BIGNUM options */ -//#define MBEDTLS_MPI_WINDOW_SIZE 2 /**< Maximum window size used. */ -//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ - -/* CTR_DRBG options */ -//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ -//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* HMAC_DRBG options */ -//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* ECP options */ -//#define MBEDTLS_ECP_WINDOW_SIZE 4 /**< Maximum window size used */ -//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */ - -/* Entropy options */ -//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ -//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ - -/* Memory buffer allocator options */ -//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ - -/* Platform options */ -//#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ - -/** \def MBEDTLS_PLATFORM_STD_CALLOC - * - * Default allocator to use, can be undefined. - * It must initialize the allocated buffer memory to zeroes. - * The size of the buffer is the product of the two parameters. - * The calloc function returns either a null pointer or a pointer to the allocated space. - * If the product is 0, the function may either return NULL or a valid pointer to an array of size 0 which is a valid input to the deallocation function. - * An uninitialized #MBEDTLS_PLATFORM_STD_CALLOC always fails, returning a null pointer. - * See the description of #MBEDTLS_PLATFORM_MEMORY for more details. - * The corresponding deallocation function is #MBEDTLS_PLATFORM_STD_FREE. - */ -//#define MBEDTLS_PLATFORM_STD_CALLOC calloc - -/** \def MBEDTLS_PLATFORM_STD_FREE - * - * Default free to use, can be undefined. - * NULL is a valid parameter, and the function must do nothing. - * A non-null parameter will always be a pointer previously returned by #MBEDTLS_PLATFORM_STD_CALLOC and not yet freed. - * An uninitialized #MBEDTLS_PLATFORM_STD_FREE does not do anything. - * See the description of #MBEDTLS_PLATFORM_MEMORY for more details (same principles as for MBEDTLS_PLATFORM_STD_CALLOC apply). - */ -//#define MBEDTLS_PLATFORM_STD_FREE free -//#define MBEDTLS_PLATFORM_STD_SETBUF setbuf /**< Default setbuf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */ - -/* To use the following function macros, MBEDTLS_PLATFORM_C must be enabled. */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined. See MBEDTLS_PLATFORM_STD_CALLOC for requirements. */ -//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined. See MBEDTLS_PLATFORM_STD_FREE for requirements. */ -//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_SETBUF_MACRO setbuf /**< Default setbuf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO vsnprintf /**< Default vsnprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO int64_t //#define MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO int64_t /**< Default milliseconds time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled. It must be signed, and at least 64 bits. If it is changed from the default, MBEDTLS_PRINTF_MS_TIME must be updated to match.*/ -//#define MBEDTLS_PRINTF_MS_TIME PRId64 /**< Default fmt for printf. That's avoid compiler warning if mbedtls_ms_time_t is redefined */ - -/** \def MBEDTLS_CHECK_RETURN - * - * This macro is used at the beginning of the declaration of a function - * to indicate that its return value should be checked. It should - * instruct the compiler to emit a warning or an error if the function - * is called without checking its return value. - * - * There is a default implementation for popular compilers in platform_util.h. - * You can override the default implementation by defining your own here. - * - * If the implementation here is empty, this will effectively disable the - * checking of functions' return values. - */ -//#define MBEDTLS_CHECK_RETURN __attribute__((__warn_unused_result__)) - -/** \def MBEDTLS_IGNORE_RETURN - * - * This macro requires one argument, which should be a C function call. - * If that function call would cause a #MBEDTLS_CHECK_RETURN warning, this - * warning is suppressed. - */ -//#define MBEDTLS_IGNORE_RETURN( result ) ((void) !(result)) - -/* PSA options */ -/** - * Use HMAC_DRBG with the specified hash algorithm for HMAC_DRBG for the - * PSA crypto subsystem. - * - * If this option is unset: - * - If CTR_DRBG is available, the PSA subsystem uses it rather than HMAC_DRBG. - * - Otherwise, the PSA subsystem uses HMAC_DRBG with either - * #MBEDTLS_MD_SHA512 or #MBEDTLS_MD_SHA256 based on availability and - * on unspecified heuristics. - */ -//#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA256 - -/** \def MBEDTLS_PSA_KEY_SLOT_COUNT - * Restrict the PSA library to supporting a maximum amount of simultaneously - * loaded keys. A loaded key is a key stored by the PSA Crypto core as a - * volatile key, or a persistent key which is loaded temporarily by the - * library as part of a crypto operation in flight. - * - * If this option is unset, the library will fall back to a default value of - * 32 keys. - */ -//#define MBEDTLS_PSA_KEY_SLOT_COUNT 32 - -/* RSA OPTIONS */ -//#define MBEDTLS_RSA_GEN_KEY_MIN_BITS 1024 /**< Minimum RSA key size that can be generated in bits (Minimum possible value is 128 bits) */ - -/* SSL Cache options */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ - -/* SSL options */ - -/** \def MBEDTLS_SSL_IN_CONTENT_LEN - * - * Maximum length (in bytes) of incoming plaintext fragments. - * - * This determines the size of the incoming TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * \note When using a value less than the default of 16KB on the client, it is - * recommended to use the Maximum Fragment Length (MFL) extension to - * inform the server about this limitation. On the server, there - * is no supported, standardized way of informing the client about - * restriction on the maximum size of incoming messages, and unless - * the limitation has been communicated by other means, it is recommended - * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN - * while keeping the default value of 16KB for the incoming buffer. - * - * Uncomment to set the maximum plaintext size of the incoming I/O buffer. - */ -//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_CID_IN_LEN_MAX - * - * The maximum length of CIDs used for incoming DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX - * - * The maximum length of CIDs used for outgoing DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY - * - * This option controls the use of record plaintext padding - * in TLS 1.3 and when using the Connection ID extension in DTLS 1.2. - * - * The padding will always be chosen so that the length of the - * padded plaintext is a multiple of the value of this option. - * - * Note: A value of \c 1 means that no padding will be used - * for outgoing records. - * - * Note: On systems lacking division instructions, - * a power of two should be preferred. - */ -//#define MBEDTLS_SSL_CID_TLS1_3_PADDING_GRANULARITY 16 - -/** \def MBEDTLS_SSL_OUT_CONTENT_LEN - * - * Maximum length (in bytes) of outgoing plaintext fragments. - * - * This determines the size of the outgoing TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * It is possible to save RAM by setting a smaller outward buffer, while keeping - * the default inward 16384 byte buffer to conform to the TLS specification. - * - * The minimum required outward buffer size is determined by the handshake - * protocol's usage. Handshaking will fail if the outward buffer is too small. - * The specific size requirement depends on the configured ciphers and any - * certificate data which is sent during the handshake. - * - * Uncomment to set the maximum plaintext size of the outgoing I/O buffer. - */ -//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING - * - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - * - * This should be at least 9/8 * MBEDTLS_SSL_IN_CONTENT_LEN - * to account for a reassembled handshake message of maximum size, - * together with its reassembly bitmap. - * - * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default) - * should be sufficient for all practical situations as it allows - * to reassembly a large handshake message (such as a certificate) - * while buffering multiple smaller handshake messages. - * - */ -//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 - -//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 or 384 bits) */ -//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - -/** - * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE - * - * The default maximum amount of 0-RTT data. See the documentation of - * \c mbedtls_ssl_tls13_conf_max_early_data_size() for more information. - * - * It must be positive and smaller than UINT32_MAX. - * - * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not - * have any impact on the build. - * - * This feature is experimental, not completed and thus not ready for - * production. - * - */ -//#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE 1024 - -/** - * \def MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE - * - * Maximum time difference in milliseconds tolerated between the age of a - * ticket from the server and client point of view. - * From the client point of view, the age of a ticket is the time difference - * between the time when the client proposes to the server to use the ticket - * (time of writing of the Pre-Shared Key Extension including the ticket) and - * the time the client received the ticket from the server. - * From the server point of view, the age of a ticket is the time difference - * between the time when the server receives a proposition from the client - * to use the ticket and the time when the ticket was created by the server. - * The server age is expected to be always greater than the client one and - * MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE defines the - * maximum difference tolerated for the server to accept the ticket. - * This is not used in TLS 1.2. - * - */ -#define MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE 6000 - -/** - * \def MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH - * - * Size in bytes of a ticket nonce. This is not used in TLS 1.2. - * - * This must be less than 256. - */ -#define MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH 32 - -/** - * \def MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS - * - * Default number of NewSessionTicket messages to be sent by a TLS 1.3 server - * after handshake completion. This is not used in TLS 1.2 and relevant only if - * the MBEDTLS_SSL_SESSION_TICKETS option is enabled. - * - */ -#define MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS 1 - -/* X509 options */ -//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ -//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ - -/** \} name SECTION: Module configuration options */ diff --git a/ext/oberon/psa/core/include/mbedtls/psa_util.h b/ext/oberon/psa/core/include/mbedtls/psa_util.h deleted file mode 100644 index e398c1e34a7c..000000000000 --- a/ext/oberon/psa/core/include/mbedtls/psa_util.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * \file psa_util.h - * - * \brief Utility functions for the use of the PSA Crypto library. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef MBEDTLS_PSA_UTIL_H -#define MBEDTLS_PSA_UTIL_H -#include "mbedtls/private_access.h" - -#include "mbedtls/build_info.h" - -#if defined(MBEDTLS_PSA_CRYPTO_C) - -/* Expose whatever RNG the PSA subsystem uses to applications using the - * mbedtls_xxx API. The declarations and definitions here need to be - * consistent with the implementation in library/psa_crypto_random_impl.h. - * See that file for implementation documentation. */ - - -/* The type of a `f_rng` random generator function that many library functions - * take. - * - * This type name is not part of the Mbed TLS stable API. It may be renamed - * or moved without warning. - */ -typedef int mbedtls_f_rng_t(void *p_rng, unsigned char *output, size_t output_size); - -#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) - -/** The random generator function for the PSA subsystem. - * - * This function is suitable as the `f_rng` random generator function - * parameter of many `mbedtls_xxx` functions. Use #MBEDTLS_PSA_RANDOM_STATE - * to obtain the \p p_rng parameter. - * - * The implementation of this function depends on the configuration of the - * library. - * - * \note Depending on the configuration, this may be a function or - * a pointer to a function. - * - * \note This function may only be used if the PSA crypto subsystem is active. - * This means that you must call psa_crypto_init() before any call to - * this function, and you must not call this function after calling - * mbedtls_psa_crypto_free(). - * - * \param p_rng The random generator context. This must be - * #MBEDTLS_PSA_RANDOM_STATE. No other state is - * supported. - * \param output The buffer to fill. It must have room for - * \c output_size bytes. - * \param output_size The number of bytes to write to \p output. - * This function may fail if \p output_size is too - * large. It is guaranteed to accept any output size - * requested by Mbed TLS library functions. The - * maximum request size depends on the library - * configuration. - * - * \return \c 0 on success. - * \return An `MBEDTLS_ERR_ENTROPY_xxx`, - * `MBEDTLS_ERR_PLATFORM_xxx, - * `MBEDTLS_ERR_CTR_DRBG_xxx` or - * `MBEDTLS_ERR_HMAC_DRBG_xxx` on error. - */ -int mbedtls_psa_get_random(void *p_rng, - unsigned char *output, - size_t output_size); - -/** The random generator state for the PSA subsystem. - * - * This macro expands to an expression which is suitable as the `p_rng` - * random generator state parameter of many `mbedtls_xxx` functions. - * It must be used in combination with the random generator function - * mbedtls_psa_get_random(). - * - * The implementation of this macro depends on the configuration of the - * library. Do not make any assumption on its nature. - */ -#define MBEDTLS_PSA_RANDOM_STATE NULL - -#else /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */ - -#if defined(MBEDTLS_CTR_DRBG_C) -int mbedtls_psa_get_random( void *p_rng, - unsigned char *output, - size_t output_size ); -#include "mbedtls/ctr_drbg.h" -typedef mbedtls_ctr_drbg_context mbedtls_psa_drbg_context_t; -//static mbedtls_f_rng_t *const mbedtls_psa_get_random = mbedtls_ctr_drbg_random; /* !!OM */ -#elif defined(MBEDTLS_HMAC_DRBG_C) -int mbedtls_psa_get_random( void *p_rng, - unsigned char *output, - size_t output_size ); -#include "mbedtls/hmac_drbg.h" -typedef mbedtls_hmac_drbg_context mbedtls_psa_drbg_context_t; -//static mbedtls_f_rng_t *const mbedtls_psa_get_random = mbedtls_hmac_drbg_random; /* !!OM */ -#endif -extern mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state; - -#define MBEDTLS_PSA_RANDOM_STATE mbedtls_psa_random_state - -#endif /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */ - -#endif /* MBEDTLS_PSA_CRYPTO_C */ -#endif /* MBEDTLS_PSA_UTIL_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto.h b/ext/oberon/psa/core/include/psa/crypto.h deleted file mode 100644 index f06fff3644f7..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto.h +++ /dev/null @@ -1,4697 +0,0 @@ -/** - * \file psa/crypto.h - * \brief Platform Security Architecture cryptography module - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_H -#define PSA_CRYPTO_H - -#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE) -#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE -#else -#include "crypto_platform.h" -#endif - -#include - -#ifdef __DOXYGEN_ONLY__ -/* This __DOXYGEN_ONLY__ block contains mock definitions for things that - * must be defined in the crypto_platform.h header. These mock definitions - * are present in this file as a convenience to generate pretty-printed - * documentation that includes those definitions. */ - -/** \defgroup platform Implementation-specific definitions - * @{ - */ - -/**@}*/ -#endif /* __DOXYGEN_ONLY__ */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* The file "crypto_types.h" declares types that encode errors, - * algorithms, key types, policies, etc. */ -#include "crypto_types.h" - -/** \defgroup version API version - * @{ - */ - -/** - * The major version of this implementation of the PSA Crypto API - */ -#define PSA_CRYPTO_API_VERSION_MAJOR 1 - -/** - * The minor version of this implementation of the PSA Crypto API - */ -#define PSA_CRYPTO_API_VERSION_MINOR 1 - -/**@}*/ - -/* The file "crypto_values.h" declares macros to build and analyze values - * of integral types defined in "crypto_types.h". */ -#include "crypto_values.h" - -/** \defgroup initialization Library initialization - * @{ - */ - -/** - * \brief Library initialization. - * - * Applications must call this function before calling any other - * function in this module. - * - * Applications may call this function more than once. Once a call - * succeeds, subsequent calls are guaranteed to succeed. - * - * If the application calls other functions before calling psa_crypto_init(), - * the behavior is undefined. Implementations are encouraged to either perform - * the operation as if the library had been initialized or to return - * #PSA_ERROR_BAD_STATE or some other applicable error. In particular, - * implementations should not return a success status if the lack of - * initialization may have security implications, for example due to improper - * seeding of the random number generator. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - */ -psa_status_t psa_crypto_init(void); - -/**@}*/ - -/** \addtogroup attributes - * @{ - */ - -/** \def PSA_KEY_ATTRIBUTES_INIT - * - * This macro returns a suitable initializer for a key attribute structure - * of type #psa_key_attributes_t. - */ - -/** Return an initial value for a key attributes structure. - */ -static psa_key_attributes_t psa_key_attributes_init(void); - -/** Declare a key as persistent and set its key identifier. - * - * If the attribute structure currently declares the key as volatile (which - * is the default content of an attribute structure), this function sets - * the lifetime attribute to #PSA_KEY_LIFETIME_PERSISTENT. - * - * This function does not access storage, it merely stores the given - * value in the structure. - * The persistent key will be written to storage when the attribute - * structure is passed to a key creation function such as - * psa_import_key(), psa_generate_key(), - * psa_key_derivation_output_key() or psa_copy_key(). - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param key The persistent identifier for the key. - */ -static void psa_set_key_id(psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t key); - -#ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER -/** Set the owner identifier of a key. - * - * When key identifiers encode key owner identifiers, psa_set_key_id() does - * not allow to define in key attributes the owner of volatile keys as - * psa_set_key_id() enforces the key to be persistent. - * - * This function allows to set in key attributes the owner identifier of a - * key. It is intended to be used for volatile keys. For persistent keys, - * it is recommended to use the PSA Cryptography API psa_set_key_id() to define - * the owner of a key. - * - * \param[out] attributes The attribute structure to write to. - * \param owner The key owner identifier. - */ -static void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes, - mbedtls_key_owner_id_t owner); -#endif - -/** Set the location of a persistent key. - * - * To make a key persistent, you must give it a persistent key identifier - * with psa_set_key_id(). By default, a key that has a persistent identifier - * is stored in the default storage area identifier by - * #PSA_KEY_LIFETIME_PERSISTENT. Call this function to choose a storage - * area, or to explicitly declare the key as volatile. - * - * This function does not access storage, it merely stores the given - * value in the structure. - * The persistent key will be written to storage when the attribute - * structure is passed to a key creation function such as - * psa_import_key(), psa_generate_key(), - * psa_key_derivation_output_key() or psa_copy_key(). - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param lifetime The lifetime for the key. - * If this is #PSA_KEY_LIFETIME_VOLATILE, the - * key will be volatile, and the key identifier - * attribute is reset to 0. - */ -static void psa_set_key_lifetime(psa_key_attributes_t *attributes, - psa_key_lifetime_t lifetime); - -/** Retrieve the key identifier from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The persistent identifier stored in the attribute structure. - * This value is unspecified if the attribute structure declares - * the key as volatile. - */ -static mbedtls_svc_key_id_t psa_get_key_id( - const psa_key_attributes_t *attributes); - -/** Retrieve the lifetime from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The lifetime value stored in the attribute structure. - */ -static psa_key_lifetime_t psa_get_key_lifetime( - const psa_key_attributes_t *attributes); - -/** Declare usage flags for a key. - * - * Usage flags are part of a key's usage policy. They encode what - * kind of operations are permitted on the key. For more details, - * refer to the documentation of the type #psa_key_usage_t. - * - * This function overwrites any usage flags - * previously set in \p attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param usage_flags The usage flags to write. - */ -static void psa_set_key_usage_flags(psa_key_attributes_t *attributes, - psa_key_usage_t usage_flags); - -/** Retrieve the usage flags from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The usage flags stored in the attribute structure. - */ -static psa_key_usage_t psa_get_key_usage_flags( - const psa_key_attributes_t *attributes); - -/** Declare the permitted algorithm policy for a key. - * - * The permitted algorithm policy of a key encodes which algorithm or - * algorithms are permitted to be used with this key. The following - * algorithm policies are supported: - * - 0 does not allow any cryptographic operation with the key. The key - * may be used for non-cryptographic actions such as exporting (if - * permitted by the usage flags). - * - An algorithm value permits this particular algorithm. - * - An algorithm wildcard built from #PSA_ALG_ANY_HASH allows the specified - * signature scheme with any hash algorithm. - * - An algorithm built from #PSA_ALG_AT_LEAST_THIS_LENGTH_MAC allows - * any MAC algorithm from the same base class (e.g. CMAC) which - * generates/verifies a MAC length greater than or equal to the length - * encoded in the wildcard algorithm. - * - An algorithm built from #PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG - * allows any AEAD algorithm from the same base class (e.g. CCM) which - * generates/verifies a tag length greater than or equal to the length - * encoded in the wildcard algorithm. - * - * This function overwrites any algorithm policy - * previously set in \p attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param alg The permitted algorithm policy to write. - */ -static void psa_set_key_algorithm(psa_key_attributes_t *attributes, - psa_algorithm_t alg); - - -/** Retrieve the algorithm policy from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The algorithm stored in the attribute structure. - */ -static psa_algorithm_t psa_get_key_algorithm( - const psa_key_attributes_t *attributes); - -/** Declare the type of a key. - * - * This function overwrites any key type - * previously set in \p attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param type The key type to write. - * If this is 0, the key type in \p attributes - * becomes unspecified. - */ -static void psa_set_key_type(psa_key_attributes_t *attributes, - psa_key_type_t type); - - -/** Declare the size of a key. - * - * This function overwrites any key size previously set in \p attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate each of its arguments exactly once. - * - * \param[out] attributes The attribute structure to write to. - * \param bits The key size in bits. - * If this is 0, the key size in \p attributes - * becomes unspecified. Keys of size 0 are - * not supported. - */ -static void psa_set_key_bits(psa_key_attributes_t *attributes, - size_t bits); - -/** Retrieve the key type from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The key type stored in the attribute structure. - */ -static psa_key_type_t psa_get_key_type(const psa_key_attributes_t *attributes); - -/** Retrieve the key size from key attributes. - * - * This function may be declared as `static` (i.e. without external - * linkage). This function may be provided as a function-like macro, - * but in this case it must evaluate its argument exactly once. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The key size stored in the attribute structure, in bits. - */ -static size_t psa_get_key_bits(const psa_key_attributes_t *attributes); - -/** Retrieve the attributes of a key. - * - * This function first resets the attribute structure as with - * psa_reset_key_attributes(). It then copies the attributes of - * the given key into the given attribute structure. - * - * \note This function may allocate memory or other resources. - * Once you have called this function on an attribute structure, - * you must call psa_reset_key_attributes() to free these resources. - * - * \param[in] key Identifier of the key to query. - * \param[in,out] attributes On success, the attributes of the key. - * On failure, equivalent to a - * freshly-initialized structure. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_get_key_attributes(mbedtls_svc_key_id_t key, - psa_key_attributes_t *attributes); - -/** Reset a key attribute structure to a freshly initialized state. - * - * You must initialize the attribute structure as described in the - * documentation of the type #psa_key_attributes_t before calling this - * function. Once the structure has been initialized, you may call this - * function at any time. - * - * This function frees any auxiliary resources that the structure - * may contain. - * - * \param[in,out] attributes The attribute structure to reset. - */ -void psa_reset_key_attributes(psa_key_attributes_t *attributes); - -/**@}*/ - -/** \defgroup key_management Key management - * @{ - */ - -/** Remove non-essential copies of key material from memory. - * - * If the key identifier designates a volatile key, this functions does not do - * anything and returns successfully. - * - * If the key identifier designates a persistent key, then this function will - * free all resources associated with the key in volatile memory. The key - * data in persistent storage is not affected and the key can still be used. - * - * \param key Identifier of the key to purge. - * - * \retval #PSA_SUCCESS - * The key material will have been removed from memory if it is not - * currently required. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not a valid key identifier. - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_purge_key(mbedtls_svc_key_id_t key); - -/** Make a copy of a key. - * - * Copy key material from one location to another. - * - * This function is primarily useful to copy a key from one location - * to another, since it populates a key using the material from - * another key which may have a different lifetime. - * - * This function may be used to share a key with a different party, - * subject to implementation-defined restrictions on key sharing. - * - * The policy on the source key must have the usage flag - * #PSA_KEY_USAGE_COPY set. - * This flag is sufficient to permit the copy if the key has the lifetime - * #PSA_KEY_LIFETIME_VOLATILE or #PSA_KEY_LIFETIME_PERSISTENT. - * Some secure elements do not provide a way to copy a key without - * making it extractable from the secure element. If a key is located - * in such a secure element, then the key must have both usage flags - * #PSA_KEY_USAGE_COPY and #PSA_KEY_USAGE_EXPORT in order to make - * a copy of the key outside the secure element. - * - * The resulting key may only be used in a way that conforms to - * both the policy of the original key and the policy specified in - * the \p attributes parameter: - * - The usage flags on the resulting key are the bitwise-and of the - * usage flags on the source policy and the usage flags in \p attributes. - * - If both allow the same algorithm or wildcard-based - * algorithm policy, the resulting key has the same algorithm policy. - * - If either of the policies allows an algorithm and the other policy - * allows a wildcard-based algorithm policy that includes this algorithm, - * the resulting key allows the same algorithm. - * - If the policies do not allow any algorithm in common, this function - * fails with the status #PSA_ERROR_INVALID_ARGUMENT. - * - * The effect of this function on implementation-defined attributes is - * implementation-defined. - * - * \param source_key The key to copy. It must allow the usage - * #PSA_KEY_USAGE_COPY. If a private or secret key is - * being copied outside of a secure element it must - * also allow #PSA_KEY_USAGE_EXPORT. - * \param[in] attributes The attributes for the new key. - * They are used as follows: - * - The key type and size may be 0. If either is - * nonzero, it must match the corresponding - * attribute of the source key. - * - The key location (the lifetime and, for - * persistent keys, the key identifier) is - * used directly. - * - The policy constraints (usage flags and - * algorithm policy) are combined from - * the source key and \p attributes so that - * both sets of restrictions apply, as - * described in the documentation of this function. - * \param[out] target_key On success, an identifier for the newly created - * key. For persistent keys, this is the key - * identifier defined in \p attributes. - * \c 0 on failure. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE - * \p source_key is invalid. - * \retval #PSA_ERROR_ALREADY_EXISTS - * This is an attempt to create a persistent key, and there is - * already a persistent key with the given identifier. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The lifetime or identifier in \p attributes are invalid, or - * the policy constraints on the source and specified in - * \p attributes are incompatible, or - * \p attributes specifies a key type or key size - * which does not match the attributes of the source key. - * \retval #PSA_ERROR_NOT_PERMITTED - * The source key does not have the #PSA_KEY_USAGE_COPY usage flag, or - * the source key is not exportable and its lifetime does not - * allow copying it to the target's lifetime. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_copy_key(mbedtls_svc_key_id_t source_key, - const psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t *target_key); - - -/** - * \brief Destroy a key. - * - * This function destroys a key from both volatile - * memory and, if applicable, non-volatile storage. Implementations shall - * make a best effort to ensure that the key material cannot be recovered. - * - * This function also erases any metadata such as policies and frees - * resources associated with the key. - * - * If a key is currently in use in a multipart operation, then destroying the - * key will cause the multipart operation to fail. - * - * \param key Identifier of the key to erase. If this is \c 0, do nothing and - * return #PSA_SUCCESS. - * - * \retval #PSA_SUCCESS - * \p key was a valid identifier and the key material that it - * referred to has been erased. Alternatively, \p key is \c 0. - * \retval #PSA_ERROR_NOT_PERMITTED - * The key cannot be erased because it is - * read-only, either due to a policy or due to physical restrictions. - * \retval #PSA_ERROR_INVALID_HANDLE - * \p key is not a valid identifier nor \c 0. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE - * There was a failure in communication with the cryptoprocessor. - * The key material may still be present in the cryptoprocessor. - * \retval #PSA_ERROR_DATA_INVALID - * This error is typically a result of either storage corruption on a - * cleartext storage backend, or an attempt to read data that was - * written by an incompatible version of the library. - * \retval #PSA_ERROR_STORAGE_FAILURE - * The storage is corrupted. Implementations shall make a best effort - * to erase key material even in this stage, however applications - * should be aware that it may be impossible to guarantee that the - * key material is not recoverable in such cases. - * \retval #PSA_ERROR_CORRUPTION_DETECTED - * An unexpected condition which is not a storage corruption or - * a communication failure occurred. The cryptoprocessor may have - * been compromised. - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_destroy_key(mbedtls_svc_key_id_t key); - -/**@}*/ - -/** \defgroup import_export Key import and export - * @{ - */ - -/** - * \brief Import a key in binary format. - * - * This function supports any output from psa_export_key(). Refer to the - * documentation of psa_export_public_key() for the format of public keys - * and to the documentation of psa_export_key() for the format for - * other key types. - * - * The key data determines the key size. The attributes may optionally - * specify a key size; in this case it must match the size determined - * from the key data. A key size of 0 in \p attributes indicates that - * the key size is solely determined by the key data. - * - * Implementations must reject an attempt to import a key of size 0. - * - * This specification supports a single format for each key type. - * Implementations may support other formats as long as the standard - * format is supported. Implementations that support other formats - * should ensure that the formats are clearly unambiguous so as to - * minimize the risk that an invalid input is accidentally interpreted - * according to a different format. - * - * \param[in] attributes The attributes for the new key. - * The key size is always determined from the - * \p data buffer. - * If the key size in \p attributes is nonzero, - * it must be equal to the size from \p data. - * \param[out] key On success, an identifier to the newly created key. - * For persistent keys, this is the key identifier - * defined in \p attributes. - * \c 0 on failure. - * \param[in] data Buffer containing the key data. The content of this - * buffer is interpreted according to the type declared - * in \p attributes. - * All implementations must support at least the format - * described in the documentation - * of psa_export_key() or psa_export_public_key() for - * the chosen type. Implementations may allow other - * formats, but should be conservative: implementations - * should err on the side of rejecting content if it - * may be erroneous (e.g. wrong type or truncated data). - * \param data_length Size of the \p data buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * If the key is persistent, the key material and the key's metadata - * have been saved to persistent storage. - * \retval #PSA_ERROR_ALREADY_EXISTS - * This is an attempt to create a persistent key, and there is - * already a persistent key with the given identifier. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The key type or key size is not supported, either by the - * implementation in general or in this particular persistent location. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key attributes, as a whole, are invalid, or - * the key data is not correctly formatted, or - * the size in \p attributes is nonzero and does not match the size - * of the key data. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_import_key(const psa_key_attributes_t *attributes, - const uint8_t *data, - size_t data_length, - mbedtls_svc_key_id_t *key); - - - -/** - * \brief Export a key in binary format. - * - * The output of this function can be passed to psa_import_key() to - * create an equivalent object. - * - * If the implementation of psa_import_key() supports other formats - * beyond the format specified here, the output from psa_export_key() - * must use the representation specified here, not the original - * representation. - * - * For standard key types, the output format is as follows: - * - * - For symmetric keys (including MAC keys), the format is the - * raw bytes of the key. - * - For DES, the key data consists of 8 bytes. The parity bits must be - * correct. - * - For Triple-DES, the format is the concatenation of the - * two or three DES keys. - * - For RSA key pairs (#PSA_KEY_TYPE_RSA_KEY_PAIR), the format - * is the non-encrypted DER encoding of the representation defined by - * PKCS\#1 (RFC 8017) as `RSAPrivateKey`, version 0. - * ``` - * RSAPrivateKey ::= SEQUENCE { - * version INTEGER, -- must be 0 - * modulus INTEGER, -- n - * publicExponent INTEGER, -- e - * privateExponent INTEGER, -- d - * prime1 INTEGER, -- p - * prime2 INTEGER, -- q - * exponent1 INTEGER, -- d mod (p-1) - * exponent2 INTEGER, -- d mod (q-1) - * coefficient INTEGER, -- (inverse of q) mod p - * } - * ``` - * - For elliptic curve key pairs (key types for which - * #PSA_KEY_TYPE_IS_ECC_KEY_PAIR is true), the format is - * a representation of the private value as a `ceiling(m/8)`-byte string - * where `m` is the bit size associated with the curve, i.e. the bit size - * of the order of the curve's coordinate field. This byte string is - * in little-endian order for Montgomery curves (curve types - * `PSA_ECC_FAMILY_CURVEXXX`), and in big-endian order for Weierstrass - * curves (curve types `PSA_ECC_FAMILY_SECTXXX`, `PSA_ECC_FAMILY_SECPXXX` - * and `PSA_ECC_FAMILY_BRAINPOOL_PXXX`). - * For Weierstrass curves, this is the content of the `privateKey` field of - * the `ECPrivateKey` format defined by RFC 5915. For Montgomery curves, - * the format is defined by RFC 7748, and output is masked according to §5. - * For twisted Edwards curves, the private key is as defined by RFC 8032 - * (a 32-byte string for Edwards25519, a 57-byte string for Edwards448). - * - For Diffie-Hellman key exchange key pairs (key types for which - * #PSA_KEY_TYPE_IS_DH_KEY_PAIR is true), the - * format is the representation of the private key `x` as a big-endian byte - * string. The length of the byte string is the private key size in bytes - * (leading zeroes are not stripped). - * - For public keys (key types for which #PSA_KEY_TYPE_IS_PUBLIC_KEY is - * true), the format is the same as for psa_export_public_key(). - * - * The policy on the key must have the usage flag #PSA_KEY_USAGE_EXPORT set. - * - * \param key Identifier of the key to export. It must allow the - * usage #PSA_KEY_USAGE_EXPORT, unless it is a public - * key. - * \param[out] data Buffer where the key data is to be written. - * \param data_size Size of the \p data buffer in bytes. - * \param[out] data_length On success, the number of bytes - * that make up the key data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_EXPORT flag. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p data buffer is too small. You can determine a - * sufficient buffer size by calling - * #PSA_EXPORT_KEY_OUTPUT_SIZE(\c type, \c bits) - * where \c type is the key type - * and \c bits is the key size in bits. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_export_key(mbedtls_svc_key_id_t key, - uint8_t *data, - size_t data_size, - size_t *data_length); - -/** - * \brief Export a public key or the public part of a key pair in binary format. - * - * The output of this function can be passed to psa_import_key() to - * create an object that is equivalent to the public key. - * - * This specification supports a single format for each key type. - * Implementations may support other formats as long as the standard - * format is supported. Implementations that support other formats - * should ensure that the formats are clearly unambiguous so as to - * minimize the risk that an invalid input is accidentally interpreted - * according to a different format. - * - * For standard key types, the output format is as follows: - * - For RSA public keys (#PSA_KEY_TYPE_RSA_PUBLIC_KEY), the DER encoding of - * the representation defined by RFC 3279 §2.3.1 as `RSAPublicKey`. - * ``` - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER } -- e - * ``` - * - For elliptic curve keys on a twisted Edwards curve (key types for which - * #PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY is true and #PSA_KEY_TYPE_ECC_GET_FAMILY - * returns #PSA_ECC_FAMILY_TWISTED_EDWARDS), the public key is as defined - * by RFC 8032 - * (a 32-byte string for Edwards25519, a 57-byte string for Edwards448). - * - For other elliptic curve public keys (key types for which - * #PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY is true), the format is the uncompressed - * representation defined by SEC1 §2.3.3 as the content of an ECPoint. - * Let `m` be the bit size associated with the curve, i.e. the bit size of - * `q` for a curve over `F_q`. The representation consists of: - * - The byte 0x04; - * - `x_P` as a `ceiling(m/8)`-byte string, big-endian; - * - `y_P` as a `ceiling(m/8)`-byte string, big-endian. - * - For Diffie-Hellman key exchange public keys (key types for which - * #PSA_KEY_TYPE_IS_DH_PUBLIC_KEY is true), - * the format is the representation of the public key `y = g^x mod p` as a - * big-endian byte string. The length of the byte string is the length of the - * base prime `p` in bytes. - * - * Exporting a public key object or the public part of a key pair is - * always permitted, regardless of the key's usage flags. - * - * \param key Identifier of the key to export. - * \param[out] data Buffer where the key data is to be written. - * \param data_size Size of the \p data buffer in bytes. - * \param[out] data_length On success, the number of bytes - * that make up the key data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key is neither a public key nor a key pair. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p data buffer is too small. You can determine a - * sufficient buffer size by calling - * #PSA_EXPORT_KEY_OUTPUT_SIZE(#PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(\c type), \c bits) - * where \c type is the key type - * and \c bits is the key size in bits. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_export_public_key(mbedtls_svc_key_id_t key, - uint8_t *data, - size_t data_size, - size_t *data_length); - - - -/**@}*/ - -/** \defgroup hash Message digests - * @{ - */ - -/** Calculate the hash (digest) of a message. - * - * \note To verify the hash of a message against an - * expected value, use psa_hash_compare() instead. - * - * \param alg The hash algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_HASH(\p alg) is true). - * \param[in] input Buffer containing the message to hash. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] hash Buffer where the hash is to be written. - * \param hash_size Size of the \p hash buffer in bytes. - * \param[out] hash_length On success, the number of bytes - * that make up the hash value. This is always - * #PSA_HASH_LENGTH(\p alg). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a hash algorithm. - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p hash_size is too small - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_compute(psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *hash, - size_t hash_size, - size_t *hash_length); - -/** Calculate the hash (digest) of a message and compare it with a - * reference value. - * - * \param alg The hash algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_HASH(\p alg) is true). - * \param[in] input Buffer containing the message to hash. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] hash Buffer containing the expected hash value. - * \param hash_length Size of the \p hash buffer in bytes. - * - * \retval #PSA_SUCCESS - * The expected hash is identical to the actual hash of the input. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The hash of the message was calculated successfully, but it - * differs from the expected hash. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a hash algorithm. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p input_length or \p hash_length do not match the hash size for \p alg - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_compare(psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *hash, - size_t hash_length); - -/** The type of the state data structure for multipart hash operations. - * - * Before calling any function on a hash operation object, the application must - * initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_hash_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_hash_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_HASH_OPERATION_INIT, - * for example: - * \code - * psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_hash_operation_init() - * to the structure, for example: - * \code - * psa_hash_operation_t operation; - * operation = psa_hash_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_hash_operation_s psa_hash_operation_t; - -/** \def PSA_HASH_OPERATION_INIT - * - * This macro returns a suitable initializer for a hash operation object - * of type #psa_hash_operation_t. - */ - -/** Return an initial value for a hash operation object. - */ -static psa_hash_operation_t psa_hash_operation_init(void); - -/** Set up a multipart hash operation. - * - * The sequence of operations to calculate a hash (message digest) - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_hash_operation_t, e.g. #PSA_HASH_OPERATION_INIT. - * -# Call psa_hash_setup() to specify the algorithm. - * -# Call psa_hash_update() zero, one or more times, passing a fragment - * of the message each time. The hash that is calculated is the hash - * of the concatenation of these messages in order. - * -# To calculate the hash, call psa_hash_finish(). - * To compare the hash with an expected value, call psa_hash_verify(). - * - * If an error occurs at any step after a call to psa_hash_setup(), the - * operation will need to be reset by a call to psa_hash_abort(). The - * application may call psa_hash_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_hash_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A successful call to psa_hash_finish() or psa_hash_verify(). - * - A call to psa_hash_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_hash_operation_t and not yet in use. - * \param alg The hash algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_HASH(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not a supported hash algorithm. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p alg is not a hash algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_setup(psa_hash_operation_t *operation, - psa_algorithm_t alg); - -/** Add a message fragment to a multipart hash operation. - * - * The application must call psa_hash_setup() before calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_hash_abort(). - * - * \param[in,out] operation Active hash operation. - * \param[in] input Buffer containing the message fragment to hash. - * \param input_length Size of the \p input buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_update(psa_hash_operation_t *operation, - const uint8_t *input, - size_t input_length); - -/** Finish the calculation of the hash of a message. - * - * The application must call psa_hash_setup() before calling this function. - * This function calculates the hash of the message formed by concatenating - * the inputs passed to preceding calls to psa_hash_update(). - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_hash_abort(). - * - * \warning Applications should not call this function if they expect - * a specific value for the hash. Call psa_hash_verify() instead. - * Beware that comparing integrity or authenticity data such as - * hash values with a function such as \c memcmp is risky - * because the time taken by the comparison may leak information - * about the hashed data which could allow an attacker to guess - * a valid hash and thereby bypass security controls. - * - * \param[in,out] operation Active hash operation. - * \param[out] hash Buffer where the hash is to be written. - * \param hash_size Size of the \p hash buffer in bytes. - * \param[out] hash_length On success, the number of bytes - * that make up the hash value. This is always - * #PSA_HASH_LENGTH(\c alg) where \c alg is the - * hash algorithm that is calculated. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p hash buffer is too small. You can determine a - * sufficient buffer size by calling #PSA_HASH_LENGTH(\c alg) - * where \c alg is the hash algorithm that is calculated. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_finish(psa_hash_operation_t *operation, - uint8_t *hash, - size_t hash_size, - size_t *hash_length); - -/** Finish the calculation of the hash of a message and compare it with - * an expected value. - * - * The application must call psa_hash_setup() before calling this function. - * This function calculates the hash of the message formed by concatenating - * the inputs passed to preceding calls to psa_hash_update(). It then - * compares the calculated hash with the expected hash passed as a - * parameter to this function. - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_hash_abort(). - * - * \note Implementations shall make the best effort to ensure that the - * comparison between the actual hash and the expected hash is performed - * in constant time. - * - * \param[in,out] operation Active hash operation. - * \param[in] hash Buffer containing the expected hash value. - * \param hash_length Size of the \p hash buffer in bytes. - * - * \retval #PSA_SUCCESS - * The expected hash is identical to the actual hash of the message. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The hash of the message was calculated successfully, but it - * differs from the expected hash. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_verify(psa_hash_operation_t *operation, - const uint8_t *hash, - size_t hash_length); - -/** Abort a hash operation. - * - * Aborting an operation frees all associated resources except for the - * \p operation structure itself. Once aborted, the operation object - * can be reused for another operation by calling - * psa_hash_setup() again. - * - * You may call this function any time after the operation object has - * been initialized by one of the methods described in #psa_hash_operation_t. - * - * In particular, calling psa_hash_abort() after the operation has been - * terminated by a call to psa_hash_abort(), psa_hash_finish() or - * psa_hash_verify() is safe and has no effect. - * - * \param[in,out] operation Initialized hash operation. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_abort(psa_hash_operation_t *operation); - -/** Clone a hash operation. - * - * This function copies the state of an ongoing hash operation to - * a new operation object. In other words, this function is equivalent - * to calling psa_hash_setup() on \p target_operation with the same - * algorithm that \p source_operation was set up for, then - * psa_hash_update() on \p target_operation with the same input that - * that was passed to \p source_operation. After this function returns, the - * two objects are independent, i.e. subsequent calls involving one of - * the objects do not affect the other object. - * - * \param[in] source_operation The active hash operation to clone. - * \param[in,out] target_operation The operation object to set up. - * It must be initialized but not active. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The \p source_operation state is not valid (it must be active), or - * the \p target_operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_hash_clone(const psa_hash_operation_t *source_operation, - psa_hash_operation_t *target_operation); - -/**@}*/ - -/** \defgroup MAC Message authentication codes - * @{ - */ - -/** Calculate the MAC (message authentication code) of a message. - * - * \note To verify the MAC of a message against an - * expected value, use psa_mac_verify() instead. - * Beware that comparing integrity or authenticity data such as - * MAC values with a function such as \c memcmp is risky - * because the time taken by the comparison may leak information - * about the MAC value which could allow an attacker to guess - * a valid MAC and thereby bypass security controls. - * - * \param key Identifier of the key to use for the operation. It - * must allow the usage PSA_KEY_USAGE_SIGN_MESSAGE. - * \param alg The MAC algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_MAC(\p alg) is true). - * \param[in] input Buffer containing the input message. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] mac Buffer where the MAC value is to be written. - * \param mac_size Size of the \p mac buffer in bytes. - * \param[out] mac_length On success, the number of bytes - * that make up the MAC value. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a MAC algorithm. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p mac_size is too small - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE - * The key could not be retrieved from storage. - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_compute(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *mac, - size_t mac_size, - size_t *mac_length); - -/** Calculate the MAC of a message and compare it with a reference value. - * - * \param key Identifier of the key to use for the operation. It - * must allow the usage PSA_KEY_USAGE_VERIFY_MESSAGE. - * \param alg The MAC algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_MAC(\p alg) is true). - * \param[in] input Buffer containing the input message. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] mac Buffer containing the expected MAC value. - * \param mac_length Size of the \p mac buffer in bytes. - * - * \retval #PSA_SUCCESS - * The expected MAC is identical to the actual MAC of the input. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The MAC of the message was calculated successfully, but it - * differs from the expected value. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a MAC algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE - * The key could not be retrieved from storage. - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_verify(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *mac, - size_t mac_length); - -/** The type of the state data structure for multipart MAC operations. - * - * Before calling any function on a MAC operation object, the application must - * initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_mac_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_mac_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_MAC_OPERATION_INIT, - * for example: - * \code - * psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_mac_operation_init() - * to the structure, for example: - * \code - * psa_mac_operation_t operation; - * operation = psa_mac_operation_init(); - * \endcode - * - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_mac_operation_s psa_mac_operation_t; - -/** \def PSA_MAC_OPERATION_INIT - * - * This macro returns a suitable initializer for a MAC operation object of type - * #psa_mac_operation_t. - */ - -/** Return an initial value for a MAC operation object. - */ -static psa_mac_operation_t psa_mac_operation_init(void); - -/** Set up a multipart MAC calculation operation. - * - * This function sets up the calculation of the MAC - * (message authentication code) of a byte string. - * To verify the MAC of a message against an - * expected value, use psa_mac_verify_setup() instead. - * - * The sequence of operations to calculate a MAC is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_mac_operation_t, e.g. #PSA_MAC_OPERATION_INIT. - * -# Call psa_mac_sign_setup() to specify the algorithm and key. - * -# Call psa_mac_update() zero, one or more times, passing a fragment - * of the message each time. The MAC that is calculated is the MAC - * of the concatenation of these messages in order. - * -# At the end of the message, call psa_mac_sign_finish() to finish - * calculating the MAC value and retrieve it. - * - * If an error occurs at any step after a call to psa_mac_sign_setup(), the - * operation will need to be reset by a call to psa_mac_abort(). The - * application may call psa_mac_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_mac_sign_setup(), the application must - * eventually terminate the operation through one of the following methods: - * - A successful call to psa_mac_sign_finish(). - * - A call to psa_mac_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_mac_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. It - * must remain valid until the operation terminates. - * It must allow the usage PSA_KEY_USAGE_SIGN_MESSAGE. - * \param alg The MAC algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_MAC(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a MAC algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE - * The key could not be retrieved from storage. - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_sign_setup(psa_mac_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Set up a multipart MAC verification operation. - * - * This function sets up the verification of the MAC - * (message authentication code) of a byte string against an expected value. - * - * The sequence of operations to verify a MAC is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_mac_operation_t, e.g. #PSA_MAC_OPERATION_INIT. - * -# Call psa_mac_verify_setup() to specify the algorithm and key. - * -# Call psa_mac_update() zero, one or more times, passing a fragment - * of the message each time. The MAC that is calculated is the MAC - * of the concatenation of these messages in order. - * -# At the end of the message, call psa_mac_verify_finish() to finish - * calculating the actual MAC of the message and verify it against - * the expected value. - * - * If an error occurs at any step after a call to psa_mac_verify_setup(), the - * operation will need to be reset by a call to psa_mac_abort(). The - * application may call psa_mac_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_mac_verify_setup(), the application must - * eventually terminate the operation through one of the following methods: - * - A successful call to psa_mac_verify_finish(). - * - A call to psa_mac_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_mac_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. It - * must remain valid until the operation terminates. - * It must allow the usage - * PSA_KEY_USAGE_VERIFY_MESSAGE. - * \param alg The MAC algorithm to compute (\c PSA_ALG_XXX value - * such that #PSA_ALG_IS_MAC(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c key is not compatible with \c alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \c alg is not supported or is not a MAC algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE - * The key could not be retrieved from storage. - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_verify_setup(psa_mac_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Add a message fragment to a multipart MAC operation. - * - * The application must call psa_mac_sign_setup() or psa_mac_verify_setup() - * before calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_mac_abort(). - * - * \param[in,out] operation Active MAC operation. - * \param[in] input Buffer containing the message fragment to add to - * the MAC calculation. - * \param input_length Size of the \p input buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_update(psa_mac_operation_t *operation, - const uint8_t *input, - size_t input_length); - -/** Finish the calculation of the MAC of a message. - * - * The application must call psa_mac_sign_setup() before calling this function. - * This function calculates the MAC of the message formed by concatenating - * the inputs passed to preceding calls to psa_mac_update(). - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_mac_abort(). - * - * \warning Applications should not call this function if they expect - * a specific value for the MAC. Call psa_mac_verify_finish() instead. - * Beware that comparing integrity or authenticity data such as - * MAC values with a function such as \c memcmp is risky - * because the time taken by the comparison may leak information - * about the MAC value which could allow an attacker to guess - * a valid MAC and thereby bypass security controls. - * - * \param[in,out] operation Active MAC operation. - * \param[out] mac Buffer where the MAC value is to be written. - * \param mac_size Size of the \p mac buffer in bytes. - * \param[out] mac_length On success, the number of bytes - * that make up the MAC value. This is always - * #PSA_MAC_LENGTH(\c key_type, \c key_bits, \c alg) - * where \c key_type and \c key_bits are the type and - * bit-size respectively of the key and \c alg is the - * MAC algorithm that is calculated. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p mac buffer is too small. You can determine a - * sufficient buffer size by calling PSA_MAC_LENGTH(). - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active mac sign - * operation), or the library has not been previously initialized - * by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation, - uint8_t *mac, - size_t mac_size, - size_t *mac_length); - -/** Finish the calculation of the MAC of a message and compare it with - * an expected value. - * - * The application must call psa_mac_verify_setup() before calling this function. - * This function calculates the MAC of the message formed by concatenating - * the inputs passed to preceding calls to psa_mac_update(). It then - * compares the calculated MAC with the expected MAC passed as a - * parameter to this function. - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_mac_abort(). - * - * \note Implementations shall make the best effort to ensure that the - * comparison between the actual MAC and the expected MAC is performed - * in constant time. - * - * \param[in,out] operation Active MAC operation. - * \param[in] mac Buffer containing the expected MAC value. - * \param mac_length Size of the \p mac buffer in bytes. - * - * \retval #PSA_SUCCESS - * The expected MAC is identical to the actual MAC of the message. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The MAC of the message was calculated successfully, but it - * differs from the expected MAC. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active mac verify - * operation), or the library has not been previously initialized - * by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation, - const uint8_t *mac, - size_t mac_length); - -/** Abort a MAC operation. - * - * Aborting an operation frees all associated resources except for the - * \p operation structure itself. Once aborted, the operation object - * can be reused for another operation by calling - * psa_mac_sign_setup() or psa_mac_verify_setup() again. - * - * You may call this function any time after the operation object has - * been initialized by one of the methods described in #psa_mac_operation_t. - * - * In particular, calling psa_mac_abort() after the operation has been - * terminated by a call to psa_mac_abort(), psa_mac_sign_finish() or - * psa_mac_verify_finish() is safe and has no effect. - * - * \param[in,out] operation Initialized MAC operation. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_mac_abort(psa_mac_operation_t *operation); - -/**@}*/ - -/** \defgroup cipher Symmetric ciphers - * @{ - */ - -/** Encrypt a message using a symmetric cipher. - * - * This function encrypts a message with a random IV (initialization - * vector). Use the multipart operation interface with a - * #psa_cipher_operation_t object to provide other forms of IV. - * - * \param key Identifier of the key to use for the operation. - * It must allow the usage #PSA_KEY_USAGE_ENCRYPT. - * \param alg The cipher algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \param[in] input Buffer containing the message to encrypt. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] output Buffer where the output is to be written. - * The output contains the IV followed by - * the ciphertext proper. - * \param output_size Size of the \p output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a cipher algorithm. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** Decrypt a message using a symmetric cipher. - * - * This function decrypts a message encrypted with a symmetric cipher. - * - * \param key Identifier of the key to use for the operation. - * It must remain valid until the operation - * terminates. It must allow the usage - * #PSA_KEY_USAGE_DECRYPT. - * \param alg The cipher algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \param[in] input Buffer containing the message to decrypt. - * This consists of the IV followed by the - * ciphertext proper. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] output Buffer where the plaintext is to be written. - * \param output_size Size of the \p output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a cipher algorithm. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** The type of the state data structure for multipart cipher operations. - * - * Before calling any function on a cipher operation object, the application - * must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_cipher_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_cipher_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_CIPHER_OPERATION_INIT, - * for example: - * \code - * psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_cipher_operation_init() - * to the structure, for example: - * \code - * psa_cipher_operation_t operation; - * operation = psa_cipher_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_cipher_operation_s psa_cipher_operation_t; - -/** \def PSA_CIPHER_OPERATION_INIT - * - * This macro returns a suitable initializer for a cipher operation object of - * type #psa_cipher_operation_t. - */ - -/** Return an initial value for a cipher operation object. - */ -static psa_cipher_operation_t psa_cipher_operation_init(void); - -/** Set the key for a multipart symmetric encryption operation. - * - * The sequence of operations to encrypt a message with a symmetric cipher - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_cipher_operation_t, e.g. - * #PSA_CIPHER_OPERATION_INIT. - * -# Call psa_cipher_encrypt_setup() to specify the algorithm and key. - * -# Call either psa_cipher_generate_iv() or psa_cipher_set_iv() to - * generate or set the IV (initialization vector). You should use - * psa_cipher_generate_iv() unless the protocol you are implementing - * requires a specific IV value. - * -# Call psa_cipher_update() zero, one or more times, passing a fragment - * of the message each time. - * -# Call psa_cipher_finish(). - * - * If an error occurs at any step after a call to psa_cipher_encrypt_setup(), - * the operation will need to be reset by a call to psa_cipher_abort(). The - * application may call psa_cipher_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_cipher_encrypt_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A successful call to psa_cipher_finish(). - * - A call to psa_cipher_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_cipher_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. - * It must remain valid until the operation - * terminates. It must allow the usage - * #PSA_KEY_USAGE_ENCRYPT. - * \param alg The cipher algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a cipher algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_encrypt_setup(psa_cipher_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Set the key for a multipart symmetric decryption operation. - * - * The sequence of operations to decrypt a message with a symmetric cipher - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_cipher_operation_t, e.g. - * #PSA_CIPHER_OPERATION_INIT. - * -# Call psa_cipher_decrypt_setup() to specify the algorithm and key. - * -# Call psa_cipher_set_iv() with the IV (initialization vector) for the - * decryption. If the IV is prepended to the ciphertext, you can call - * psa_cipher_update() on a buffer containing the IV followed by the - * beginning of the message. - * -# Call psa_cipher_update() zero, one or more times, passing a fragment - * of the message each time. - * -# Call psa_cipher_finish(). - * - * If an error occurs at any step after a call to psa_cipher_decrypt_setup(), - * the operation will need to be reset by a call to psa_cipher_abort(). The - * application may call psa_cipher_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_cipher_decrypt_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A successful call to psa_cipher_finish(). - * - A call to psa_cipher_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_cipher_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. - * It must remain valid until the operation - * terminates. It must allow the usage - * #PSA_KEY_USAGE_DECRYPT. - * \param alg The cipher algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not a cipher algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_decrypt_setup(psa_cipher_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Generate an IV for a symmetric encryption operation. - * - * This function generates a random IV (initialization vector), nonce - * or initial counter value for the encryption operation as appropriate - * for the chosen algorithm, key type and key size. - * - * The application must call psa_cipher_encrypt_setup() before - * calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_cipher_abort(). - * - * \param[in,out] operation Active cipher operation. - * \param[out] iv Buffer where the generated IV is to be written. - * \param iv_size Size of the \p iv buffer in bytes. - * \param[out] iv_length On success, the number of bytes of the - * generated IV. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p iv buffer is too small. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, with no IV set), - * or the library has not been previously initialized - * by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation, - uint8_t *iv, - size_t iv_size, - size_t *iv_length); - -/** Set the IV for a symmetric encryption or decryption operation. - * - * This function sets the IV (initialization vector), nonce - * or initial counter value for the encryption or decryption operation. - * - * The application must call psa_cipher_encrypt_setup() before - * calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_cipher_abort(). - * - * \note When encrypting, applications should use psa_cipher_generate_iv() - * instead of this function, unless implementing a protocol that requires - * a non-random IV. - * - * \param[in,out] operation Active cipher operation. - * \param[in] iv Buffer containing the IV to use. - * \param iv_length Size of the IV in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The size of \p iv is not acceptable for the chosen algorithm, - * or the chosen algorithm does not use an IV. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active cipher - * encrypt operation, with no IV set), or the library has not been - * previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation, - const uint8_t *iv, - size_t iv_length); - -/** Encrypt or decrypt a message fragment in an active cipher operation. - * - * Before calling this function, you must: - * 1. Call either psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup(). - * The choice of setup function determines whether this function - * encrypts or decrypts its input. - * 2. If the algorithm requires an IV, call psa_cipher_generate_iv() - * (recommended when encrypting) or psa_cipher_set_iv(). - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_cipher_abort(). - * - * \param[in,out] operation Active cipher operation. - * \param[in] input Buffer containing the message fragment to - * encrypt or decrypt. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] output Buffer where the output is to be written. - * \param output_size Size of the \p output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, with an IV set - * if required for the algorithm), or the library has not been - * previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_update(psa_cipher_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** Finish encrypting or decrypting a message in a cipher operation. - * - * The application must call psa_cipher_encrypt_setup() or - * psa_cipher_decrypt_setup() before calling this function. The choice - * of setup function determines whether this function encrypts or - * decrypts its input. - * - * This function finishes the encryption or decryption of the message - * formed by concatenating the inputs passed to preceding calls to - * psa_cipher_update(). - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_cipher_abort(). - * - * \param[in,out] operation Active cipher operation. - * \param[out] output Buffer where the output is to be written. - * \param output_size Size of the \p output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The total input size passed to this operation is not valid for - * this particular algorithm. For example, the algorithm is a based - * on block cipher and requires a whole number of blocks, but the - * total input size is not a multiple of the block size. - * \retval #PSA_ERROR_INVALID_PADDING - * This is a decryption operation for an algorithm that includes - * padding, and the ciphertext does not contain valid padding. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, with an IV set - * if required for the algorithm), or the library has not been - * previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** Abort a cipher operation. - * - * Aborting an operation frees all associated resources except for the - * \p operation structure itself. Once aborted, the operation object - * can be reused for another operation by calling - * psa_cipher_encrypt_setup() or psa_cipher_decrypt_setup() again. - * - * You may call this function any time after the operation object has - * been initialized as described in #psa_cipher_operation_t. - * - * In particular, calling psa_cipher_abort() after the operation has been - * terminated by a call to psa_cipher_abort() or psa_cipher_finish() - * is safe and has no effect. - * - * \param[in,out] operation Initialized cipher operation. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_cipher_abort(psa_cipher_operation_t *operation); - -/**@}*/ - -/** \defgroup aead Authenticated encryption with associated data (AEAD) - * @{ - */ - -/** Process an authenticated encryption operation. - * - * \param key Identifier of the key to use for the - * operation. It must allow the usage - * #PSA_KEY_USAGE_ENCRYPT. - * \param alg The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * \param[in] nonce Nonce or IV to use. - * \param nonce_length Size of the \p nonce buffer in bytes. - * \param[in] additional_data Additional data that will be authenticated - * but not encrypted. - * \param additional_data_length Size of \p additional_data in bytes. - * \param[in] plaintext Data that will be authenticated and - * encrypted. - * \param plaintext_length Size of \p plaintext in bytes. - * \param[out] ciphertext Output buffer for the authenticated and - * encrypted data. The additional data is not - * part of this output. For algorithms where the - * encrypted data and the authentication tag - * are defined as separate outputs, the - * authentication tag is appended to the - * encrypted data. - * \param ciphertext_size Size of the \p ciphertext buffer in bytes. - * This must be appropriate for the selected - * algorithm and key: - * - A sufficient output size is - * #PSA_AEAD_ENCRYPT_OUTPUT_SIZE(\c key_type, - * \p alg, \p plaintext_length) where - * \c key_type is the type of \p key. - * - #PSA_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(\p - * plaintext_length) evaluates to the maximum - * ciphertext size of any supported AEAD - * encryption. - * \param[out] ciphertext_length On success, the size of the output - * in the \p ciphertext buffer. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not an AEAD algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p ciphertext_size is too small. - * #PSA_AEAD_ENCRYPT_OUTPUT_SIZE(\c key_type, \p alg, - * \p plaintext_length) or - * #PSA_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(\p plaintext_length) can be used to - * determine the required buffer size. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *plaintext, - size_t plaintext_length, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length); - -/** Process an authenticated decryption operation. - * - * \param key Identifier of the key to use for the - * operation. It must allow the usage - * #PSA_KEY_USAGE_DECRYPT. - * \param alg The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * \param[in] nonce Nonce or IV to use. - * \param nonce_length Size of the \p nonce buffer in bytes. - * \param[in] additional_data Additional data that has been authenticated - * but not encrypted. - * \param additional_data_length Size of \p additional_data in bytes. - * \param[in] ciphertext Data that has been authenticated and - * encrypted. For algorithms where the - * encrypted data and the authentication tag - * are defined as separate inputs, the buffer - * must contain the encrypted data followed - * by the authentication tag. - * \param ciphertext_length Size of \p ciphertext in bytes. - * \param[out] plaintext Output buffer for the decrypted data. - * \param plaintext_size Size of the \p plaintext buffer in bytes. - * This must be appropriate for the selected - * algorithm and key: - * - A sufficient output size is - * #PSA_AEAD_DECRYPT_OUTPUT_SIZE(\c key_type, - * \p alg, \p ciphertext_length) where - * \c key_type is the type of \p key. - * - #PSA_AEAD_DECRYPT_OUTPUT_MAX_SIZE(\p - * ciphertext_length) evaluates to the maximum - * plaintext size of any supported AEAD - * decryption. - * \param[out] plaintext_length On success, the size of the output - * in the \p plaintext buffer. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The ciphertext is not authentic. - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not an AEAD algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p plaintext_size is too small. - * #PSA_AEAD_DECRYPT_OUTPUT_SIZE(\c key_type, \p alg, - * \p ciphertext_length) or - * #PSA_AEAD_DECRYPT_OUTPUT_MAX_SIZE(\p ciphertext_length) can be used - * to determine the required buffer size. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *ciphertext, - size_t ciphertext_length, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length); - -/** The type of the state data structure for multipart AEAD operations. - * - * Before calling any function on an AEAD operation object, the application - * must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_aead_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_aead_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_AEAD_OPERATION_INIT, - * for example: - * \code - * psa_aead_operation_t operation = PSA_AEAD_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_aead_operation_init() - * to the structure, for example: - * \code - * psa_aead_operation_t operation; - * operation = psa_aead_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_aead_operation_s psa_aead_operation_t; - -/** \def PSA_AEAD_OPERATION_INIT - * - * This macro returns a suitable initializer for an AEAD operation object of - * type #psa_aead_operation_t. - */ - -/** Return an initial value for an AEAD operation object. - */ -static psa_aead_operation_t psa_aead_operation_init(void); - -/** Set the key for a multipart authenticated encryption operation. - * - * The sequence of operations to encrypt a message with authentication - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_aead_operation_t, e.g. - * #PSA_AEAD_OPERATION_INIT. - * -# Call psa_aead_encrypt_setup() to specify the algorithm and key. - * -# If needed, call psa_aead_set_lengths() to specify the length of the - * inputs to the subsequent calls to psa_aead_update_ad() and - * psa_aead_update(). See the documentation of psa_aead_set_lengths() - * for details. - * -# Call either psa_aead_generate_nonce() or psa_aead_set_nonce() to - * generate or set the nonce. You should use - * psa_aead_generate_nonce() unless the protocol you are implementing - * requires a specific nonce value. - * -# Call psa_aead_update_ad() zero, one or more times, passing a fragment - * of the non-encrypted additional authenticated data each time. - * -# Call psa_aead_update() zero, one or more times, passing a fragment - * of the message to encrypt each time. - * -# Call psa_aead_finish(). - * - * If an error occurs at any step after a call to psa_aead_encrypt_setup(), - * the operation will need to be reset by a call to psa_aead_abort(). The - * application may call psa_aead_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_aead_encrypt_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A successful call to psa_aead_finish(). - * - A call to psa_aead_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_aead_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. - * It must remain valid until the operation - * terminates. It must allow the usage - * #PSA_KEY_USAGE_ENCRYPT. - * \param alg The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not an AEAD algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_encrypt_setup(psa_aead_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Set the key for a multipart authenticated decryption operation. - * - * The sequence of operations to decrypt a message with authentication - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_aead_operation_t, e.g. - * #PSA_AEAD_OPERATION_INIT. - * -# Call psa_aead_decrypt_setup() to specify the algorithm and key. - * -# If needed, call psa_aead_set_lengths() to specify the length of the - * inputs to the subsequent calls to psa_aead_update_ad() and - * psa_aead_update(). See the documentation of psa_aead_set_lengths() - * for details. - * -# Call psa_aead_set_nonce() with the nonce for the decryption. - * -# Call psa_aead_update_ad() zero, one or more times, passing a fragment - * of the non-encrypted additional authenticated data each time. - * -# Call psa_aead_update() zero, one or more times, passing a fragment - * of the ciphertext to decrypt each time. - * -# Call psa_aead_verify(). - * - * If an error occurs at any step after a call to psa_aead_decrypt_setup(), - * the operation will need to be reset by a call to psa_aead_abort(). The - * application may call psa_aead_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_aead_decrypt_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A successful call to psa_aead_verify(). - * - A call to psa_aead_abort(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized as per the documentation for - * #psa_aead_operation_t and not yet in use. - * \param key Identifier of the key to use for the operation. - * It must remain valid until the operation - * terminates. It must allow the usage - * #PSA_KEY_USAGE_DECRYPT. - * \param alg The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not compatible with \p alg. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not supported or is not an AEAD algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or the - * library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_decrypt_setup(psa_aead_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg); - -/** Generate a random nonce for an authenticated encryption operation. - * - * This function generates a random nonce for the authenticated encryption - * operation with an appropriate size for the chosen algorithm, key type - * and key size. - * - * The application must call psa_aead_encrypt_setup() before - * calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \param[in,out] operation Active AEAD operation. - * \param[out] nonce Buffer where the generated nonce is to be - * written. - * \param nonce_size Size of the \p nonce buffer in bytes. - * \param[out] nonce_length On success, the number of bytes of the - * generated nonce. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p nonce buffer is too small. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active aead encrypt - * operation, with no nonce set), or the library has not been - * previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_generate_nonce(psa_aead_operation_t *operation, - uint8_t *nonce, - size_t nonce_size, - size_t *nonce_length); - -/** Set the nonce for an authenticated encryption or decryption operation. - * - * This function sets the nonce for the authenticated - * encryption or decryption operation. - * - * The application must call psa_aead_encrypt_setup() or - * psa_aead_decrypt_setup() before calling this function. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \note When encrypting, applications should use psa_aead_generate_nonce() - * instead of this function, unless implementing a protocol that requires - * a non-random IV. - * - * \param[in,out] operation Active AEAD operation. - * \param[in] nonce Buffer containing the nonce to use. - * \param nonce_length Size of the nonce in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The size of \p nonce is not acceptable for the chosen algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, with no nonce - * set), or the library has not been previously initialized - * by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_set_nonce(psa_aead_operation_t *operation, - const uint8_t *nonce, - size_t nonce_length); - -/** Declare the lengths of the message and additional data for AEAD. - * - * The application must call this function before calling - * psa_aead_update_ad() or psa_aead_update() if the algorithm for - * the operation requires it. If the algorithm does not require it, - * calling this function is optional, but if this function is called - * then the implementation must enforce the lengths. - * - * You may call this function before or after setting the nonce with - * psa_aead_set_nonce() or psa_aead_generate_nonce(). - * - * - For #PSA_ALG_CCM, calling this function is required. - * - For the other AEAD algorithms defined in this specification, calling - * this function is not required. - * - For vendor-defined algorithm, refer to the vendor documentation. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \param[in,out] operation Active AEAD operation. - * \param ad_length Size of the non-encrypted additional - * authenticated data in bytes. - * \param plaintext_length Size of the plaintext to encrypt in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * At least one of the lengths is not acceptable for the chosen - * algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, and - * psa_aead_update_ad() and psa_aead_update() must not have been - * called yet), or the library has not been previously initialized - * by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_set_lengths(psa_aead_operation_t *operation, - size_t ad_length, - size_t plaintext_length); - -/** Pass additional data to an active AEAD operation. - * - * Additional data is authenticated, but not encrypted. - * - * You may call this function multiple times to pass successive fragments - * of the additional data. You may not call this function after passing - * data to encrypt or decrypt with psa_aead_update(). - * - * Before calling this function, you must: - * 1. Call either psa_aead_encrypt_setup() or psa_aead_decrypt_setup(). - * 2. Set the nonce with psa_aead_generate_nonce() or psa_aead_set_nonce(). - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \warning When decrypting, until psa_aead_verify() has returned #PSA_SUCCESS, - * there is no guarantee that the input is valid. Therefore, until - * you have called psa_aead_verify() and it has returned #PSA_SUCCESS, - * treat the input as untrusted and prepare to undo any action that - * depends on the input if psa_aead_verify() returns an error status. - * - * \param[in,out] operation Active AEAD operation. - * \param[in] input Buffer containing the fragment of - * additional data. - * \param input_length Size of the \p input buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The total input length overflows the additional data length that - * was previously specified with psa_aead_set_lengths(). - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, have a nonce - * set, have lengths set if required by the algorithm, and - * psa_aead_update() must not have been called yet), or the library - * has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_update_ad(psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length); - -/** Encrypt or decrypt a message fragment in an active AEAD operation. - * - * Before calling this function, you must: - * 1. Call either psa_aead_encrypt_setup() or psa_aead_decrypt_setup(). - * The choice of setup function determines whether this function - * encrypts or decrypts its input. - * 2. Set the nonce with psa_aead_generate_nonce() or psa_aead_set_nonce(). - * 3. Call psa_aead_update_ad() to pass all the additional data. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \warning When decrypting, until psa_aead_verify() has returned #PSA_SUCCESS, - * there is no guarantee that the input is valid. Therefore, until - * you have called psa_aead_verify() and it has returned #PSA_SUCCESS: - * - Do not use the output in any way other than storing it in a - * confidential location. If you take any action that depends - * on the tentative decrypted data, this action will need to be - * undone if the input turns out not to be valid. Furthermore, - * if an adversary can observe that this action took place - * (for example through timing), they may be able to use this - * fact as an oracle to decrypt any message encrypted with the - * same key. - * - In particular, do not copy the output anywhere but to a - * memory or storage space that you have exclusive access to. - * - * This function does not require the input to be aligned to any - * particular block boundary. If the implementation can only process - * a whole block at a time, it must consume all the input provided, but - * it may delay the end of the corresponding output until a subsequent - * call to psa_aead_update(), psa_aead_finish() or psa_aead_verify() - * provides sufficient input. The amount of data that can be delayed - * in this way is bounded by #PSA_AEAD_UPDATE_OUTPUT_SIZE. - * - * \param[in,out] operation Active AEAD operation. - * \param[in] input Buffer containing the message fragment to - * encrypt or decrypt. - * \param input_length Size of the \p input buffer in bytes. - * \param[out] output Buffer where the output is to be written. - * \param output_size Size of the \p output buffer in bytes. - * This must be appropriate for the selected - * algorithm and key: - * - A sufficient output size is - * #PSA_AEAD_UPDATE_OUTPUT_SIZE(\c key_type, - * \c alg, \p input_length) where - * \c key_type is the type of key and \c alg is - * the algorithm that were used to set up the - * operation. - * - #PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(\p - * input_length) evaluates to the maximum - * output size of any supported AEAD - * algorithm. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. - * #PSA_AEAD_UPDATE_OUTPUT_SIZE(\c key_type, \c alg, \p input_length) or - * #PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(\p input_length) can be used to - * determine the required buffer size. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The total length of input to psa_aead_update_ad() so far is - * less than the additional data length that was previously - * specified with psa_aead_set_lengths(), or - * the total input length overflows the plaintext length that - * was previously specified with psa_aead_set_lengths(). - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, have a nonce - * set, and have lengths set if required by the algorithm), or the - * library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_update(psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** Finish encrypting a message in an AEAD operation. - * - * The operation must have been set up with psa_aead_encrypt_setup(). - * - * This function finishes the authentication of the additional data - * formed by concatenating the inputs passed to preceding calls to - * psa_aead_update_ad() with the plaintext formed by concatenating the - * inputs passed to preceding calls to psa_aead_update(). - * - * This function has two output buffers: - * - \p ciphertext contains trailing ciphertext that was buffered from - * preceding calls to psa_aead_update(). - * - \p tag contains the authentication tag. - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \param[in,out] operation Active AEAD operation. - * \param[out] ciphertext Buffer where the last part of the ciphertext - * is to be written. - * \param ciphertext_size Size of the \p ciphertext buffer in bytes. - * This must be appropriate for the selected - * algorithm and key: - * - A sufficient output size is - * #PSA_AEAD_FINISH_OUTPUT_SIZE(\c key_type, - * \c alg) where \c key_type is the type of key - * and \c alg is the algorithm that were used to - * set up the operation. - * - #PSA_AEAD_FINISH_OUTPUT_MAX_SIZE evaluates to - * the maximum output size of any supported AEAD - * algorithm. - * \param[out] ciphertext_length On success, the number of bytes of - * returned ciphertext. - * \param[out] tag Buffer where the authentication tag is - * to be written. - * \param tag_size Size of the \p tag buffer in bytes. - * This must be appropriate for the selected - * algorithm and key: - * - The exact tag size is #PSA_AEAD_TAG_LENGTH(\c - * key_type, \c key_bits, \c alg) where - * \c key_type and \c key_bits are the type and - * bit-size of the key, and \c alg is the - * algorithm that were used in the call to - * psa_aead_encrypt_setup(). - * - #PSA_AEAD_TAG_MAX_SIZE evaluates to the - * maximum tag size of any supported AEAD - * algorithm. - * \param[out] tag_length On success, the number of bytes - * that make up the returned tag. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p ciphertext or \p tag buffer is too small. - * #PSA_AEAD_FINISH_OUTPUT_SIZE(\c key_type, \c alg) or - * #PSA_AEAD_FINISH_OUTPUT_MAX_SIZE can be used to determine the - * required \p ciphertext buffer size. #PSA_AEAD_TAG_LENGTH(\c key_type, - * \c key_bits, \c alg) or #PSA_AEAD_TAG_MAX_SIZE can be used to - * determine the required \p tag buffer size. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The total length of input to psa_aead_update_ad() so far is - * less than the additional data length that was previously - * specified with psa_aead_set_lengths(), or - * the total length of input to psa_aead_update() so far is - * less than the plaintext length that was previously - * specified with psa_aead_set_lengths(). - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active encryption - * operation with a nonce set), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_finish(psa_aead_operation_t *operation, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length, - uint8_t *tag, - size_t tag_size, - size_t *tag_length); - -/** Finish authenticating and decrypting a message in an AEAD operation. - * - * The operation must have been set up with psa_aead_decrypt_setup(). - * - * This function finishes the authenticated decryption of the message - * components: - * - * - The additional data consisting of the concatenation of the inputs - * passed to preceding calls to psa_aead_update_ad(). - * - The ciphertext consisting of the concatenation of the inputs passed to - * preceding calls to psa_aead_update(). - * - The tag passed to this function call. - * - * If the authentication tag is correct, this function outputs any remaining - * plaintext and reports success. If the authentication tag is not correct, - * this function returns #PSA_ERROR_INVALID_SIGNATURE. - * - * When this function returns successfully, the operation becomes inactive. - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_aead_abort(). - * - * \note Implementations shall make the best effort to ensure that the - * comparison between the actual tag and the expected tag is performed - * in constant time. - * - * \param[in,out] operation Active AEAD operation. - * \param[out] plaintext Buffer where the last part of the plaintext - * is to be written. This is the remaining data - * from previous calls to psa_aead_update() - * that could not be processed until the end - * of the input. - * \param plaintext_size Size of the \p plaintext buffer in bytes. - * This must be appropriate for the selected algorithm and key: - * - A sufficient output size is - * #PSA_AEAD_VERIFY_OUTPUT_SIZE(\c key_type, - * \c alg) where \c key_type is the type of key - * and \c alg is the algorithm that were used to - * set up the operation. - * - #PSA_AEAD_VERIFY_OUTPUT_MAX_SIZE evaluates to - * the maximum output size of any supported AEAD - * algorithm. - * \param[out] plaintext_length On success, the number of bytes of - * returned plaintext. - * \param[in] tag Buffer containing the authentication tag. - * \param tag_length Size of the \p tag buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculations were successful, but the authentication tag is - * not correct. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p plaintext buffer is too small. - * #PSA_AEAD_VERIFY_OUTPUT_SIZE(\c key_type, \c alg) or - * #PSA_AEAD_VERIFY_OUTPUT_MAX_SIZE can be used to determine the - * required buffer size. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The total length of input to psa_aead_update_ad() so far is - * less than the additional data length that was previously - * specified with psa_aead_set_lengths(), or - * the total length of input to psa_aead_update() so far is - * less than the plaintext length that was previously - * specified with psa_aead_set_lengths(). - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be an active decryption - * operation with a nonce set), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_verify(psa_aead_operation_t *operation, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length, - const uint8_t *tag, - size_t tag_length); - -/** Abort an AEAD operation. - * - * Aborting an operation frees all associated resources except for the - * \p operation structure itself. Once aborted, the operation object - * can be reused for another operation by calling - * psa_aead_encrypt_setup() or psa_aead_decrypt_setup() again. - * - * You may call this function any time after the operation object has - * been initialized as described in #psa_aead_operation_t. - * - * In particular, calling psa_aead_abort() after the operation has been - * terminated by a call to psa_aead_abort(), psa_aead_finish() or - * psa_aead_verify() is safe and has no effect. - * - * \param[in,out] operation Initialized AEAD operation. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_aead_abort(psa_aead_operation_t *operation); - -/**@}*/ - -/** \defgroup asymmetric Asymmetric cryptography - * @{ - */ - -/** - * \brief Sign a message with a private key. For hash-and-sign algorithms, - * this includes the hashing step. - * - * \note To perform a multi-part hash-and-sign signature algorithm, first use - * a multi-part hash operation and then pass the resulting hash to - * psa_sign_hash(). PSA_ALG_GET_HASH(\p alg) can be used to determine the - * hash algorithm to use. - * - * \param[in] key Identifier of the key to use for the operation. - * It must be an asymmetric key pair. The key must - * allow the usage #PSA_KEY_USAGE_SIGN_MESSAGE. - * \param[in] alg An asymmetric signature algorithm (PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_MESSAGE(\p alg) - * is true), that is compatible with the type of - * \p key. - * \param[in] input The input message to sign. - * \param[in] input_length Size of the \p input buffer in bytes. - * \param[out] signature Buffer where the signature is to be written. - * \param[in] signature_size Size of the \p signature buffer in bytes. This - * must be appropriate for the selected - * algorithm and key: - * - The required signature size is - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and - * bit-size respectively of key. - * - #PSA_SIGNATURE_MAX_SIZE evaluates to the - * maximum signature size of any supported - * signature algorithm. - * \param[out] signature_length On success, the number of bytes that make up - * the returned signature value. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_SIGN_MESSAGE flag, - * or it does not permit the requested algorithm. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p signature buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of \p key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_sign_message(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length); - -/** \brief Verify the signature of a message with a public key, using - * a hash-and-sign verification algorithm. - * - * \note To perform a multi-part hash-and-sign signature verification - * algorithm, first use a multi-part hash operation to hash the message - * and then pass the resulting hash to psa_verify_hash(). - * PSA_ALG_GET_HASH(\p alg) can be used to determine the hash algorithm - * to use. - * - * \param[in] key Identifier of the key to use for the operation. - * It must be a public key or an asymmetric key - * pair. The key must allow the usage - * #PSA_KEY_USAGE_VERIFY_MESSAGE. - * \param[in] alg An asymmetric signature algorithm (PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_MESSAGE(\p alg) - * is true), that is compatible with the type of - * \p key. - * \param[in] input The message whose signature is to be verified. - * \param[in] input_length Size of the \p input buffer in bytes. - * \param[out] signature Buffer containing the signature to verify. - * \param[in] signature_length Size of the \p signature buffer in bytes. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_SIGN_MESSAGE flag, - * or it does not permit the requested algorithm. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculation was performed successfully, but the passed signature - * is not a valid signature. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_verify_message(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *signature, - size_t signature_length); - -/** - * \brief Sign a hash or short message with a private key. - * - * Note that to perform a hash-and-sign signature algorithm, you must - * first calculate the hash by calling psa_hash_setup(), psa_hash_update() - * and psa_hash_finish(), or alternatively by calling psa_hash_compute(). - * Then pass the resulting hash as the \p hash - * parameter to this function. You can use #PSA_ALG_SIGN_GET_HASH(\p alg) - * to determine the hash algorithm to use. - * - * \param key Identifier of the key to use for the operation. - * It must be an asymmetric key pair. The key must - * allow the usage #PSA_KEY_USAGE_SIGN_HASH. - * \param alg A signature algorithm (PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_HASH(\p alg) - * is true), that is compatible with - * the type of \p key. - * \param[in] hash The hash or message to sign. - * \param hash_length Size of the \p hash buffer in bytes. - * \param[out] signature Buffer where the signature is to be written. - * \param signature_size Size of the \p signature buffer in bytes. - * \param[out] signature_length On success, the number of bytes - * that make up the returned signature value. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p signature buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of \p key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_sign_hash(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *hash, - size_t hash_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length); - -/** - * \brief Verify the signature of a hash or short message using a public key. - * - * Note that to perform a hash-and-sign signature algorithm, you must - * first calculate the hash by calling psa_hash_setup(), psa_hash_update() - * and psa_hash_finish(), or alternatively by calling psa_hash_compute(). - * Then pass the resulting hash as the \p hash - * parameter to this function. You can use #PSA_ALG_SIGN_GET_HASH(\p alg) - * to determine the hash algorithm to use. - * - * \param key Identifier of the key to use for the operation. It - * must be a public key or an asymmetric key pair. The - * key must allow the usage - * #PSA_KEY_USAGE_VERIFY_HASH. - * \param alg A signature algorithm (PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_HASH(\p alg) - * is true), that is compatible with - * the type of \p key. - * \param[in] hash The hash or message whose signature is to be - * verified. - * \param hash_length Size of the \p hash buffer in bytes. - * \param[in] signature Buffer containing the signature to verify. - * \param signature_length Size of the \p signature buffer in bytes. - * - * \retval #PSA_SUCCESS - * The signature is valid. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculation was performed successfully, but the passed - * signature is not a valid signature. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_verify_hash(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *hash, - size_t hash_length, - const uint8_t *signature, - size_t signature_length); - -/** - * \brief Encrypt a short message with a public key. - * - * \param key Identifier of the key to use for the operation. - * It must be a public key or an asymmetric key - * pair. It must allow the usage - * #PSA_KEY_USAGE_ENCRYPT. - * \param alg An asymmetric encryption algorithm that is - * compatible with the type of \p key. - * \param[in] input The message to encrypt. - * \param input_length Size of the \p input buffer in bytes. - * \param[in] salt A salt or label, if supported by the - * encryption algorithm. - * If the algorithm does not support a - * salt, pass \c NULL. - * If the algorithm supports an optional - * salt and you do not want to pass a salt, - * pass \c NULL. - * - * - For #PSA_ALG_RSA_PKCS1V15_CRYPT, no salt is - * supported. - * \param salt_length Size of the \p salt buffer in bytes. - * If \p salt is \c NULL, pass 0. - * \param[out] output Buffer where the encrypted message is to - * be written. - * \param output_size Size of the \p output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of \p key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_asymmetric_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** - * \brief Decrypt a short message with a private key. - * - * \param key Identifier of the key to use for the operation. - * It must be an asymmetric key pair. It must - * allow the usage #PSA_KEY_USAGE_DECRYPT. - * \param alg An asymmetric encryption algorithm that is - * compatible with the type of \p key. - * \param[in] input The message to decrypt. - * \param input_length Size of the \p input buffer in bytes. - * \param[in] salt A salt or label, if supported by the - * encryption algorithm. - * If the algorithm does not support a - * salt, pass \c NULL. - * If the algorithm supports an optional - * salt and you do not want to pass a salt, - * pass \c NULL. - * - * - For #PSA_ALG_RSA_PKCS1V15_CRYPT, no salt is - * supported. - * \param salt_length Size of the \p salt buffer in bytes. - * If \p salt is \c NULL, pass 0. - * \param[out] output Buffer where the decrypted message is to - * be written. - * \param output_size Size of the \c output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of \p key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_INVALID_PADDING \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_asymmetric_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/**@}*/ - -/** \defgroup key_derivation Key derivation and pseudorandom generation - * @{ - */ - -/** The type of the state data structure for key derivation operations. - * - * Before calling any function on a key derivation operation object, the - * application must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_key_derivation_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_key_derivation_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_KEY_DERIVATION_OPERATION_INIT, - * for example: - * \code - * psa_key_derivation_operation_t operation = PSA_KEY_DERIVATION_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_key_derivation_operation_init() - * to the structure, for example: - * \code - * psa_key_derivation_operation_t operation; - * operation = psa_key_derivation_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. - */ -typedef struct psa_key_derivation_s psa_key_derivation_operation_t; - -/** \def PSA_KEY_DERIVATION_OPERATION_INIT - * - * This macro returns a suitable initializer for a key derivation operation - * object of type #psa_key_derivation_operation_t. - */ - -/** Return an initial value for a key derivation operation object. - */ -static psa_key_derivation_operation_t psa_key_derivation_operation_init(void); - -/** Set up a key derivation operation. - * - * A key derivation algorithm takes some inputs and uses them to generate - * a byte stream in a deterministic way. - * This byte stream can be used to produce keys and other - * cryptographic material. - * - * To derive a key: - * -# Start with an initialized object of type #psa_key_derivation_operation_t. - * -# Call psa_key_derivation_setup() to select the algorithm. - * -# Provide the inputs for the key derivation by calling - * psa_key_derivation_input_bytes() or psa_key_derivation_input_key() - * as appropriate. Which inputs are needed, in what order, and whether - * they may be keys and if so of what type depends on the algorithm. - * -# Optionally set the operation's maximum capacity with - * psa_key_derivation_set_capacity(). You may do this before, in the middle - * of or after providing inputs. For some algorithms, this step is mandatory - * because the output depends on the maximum capacity. - * -# To derive a key, call psa_key_derivation_output_key(). - * To derive a byte string for a different purpose, call - * psa_key_derivation_output_bytes(). - * Successive calls to these functions use successive output bytes - * calculated by the key derivation algorithm. - * -# Clean up the key derivation operation object with - * psa_key_derivation_abort(). - * - * If this function returns an error, the key derivation operation object is - * not changed. - * - * If an error occurs at any step after a call to psa_key_derivation_setup(), - * the operation will need to be reset by a call to psa_key_derivation_abort(). - * - * Implementations must reject an attempt to derive a key of size 0. - * - * \param[in,out] operation The key derivation operation object - * to set up. It must - * have been initialized but not set up yet. - * \param alg The key derivation algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_KEY_DERIVATION(\p alg) is true). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c alg is not a key derivation algorithm. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \c alg is not supported or is not a key derivation algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be inactive), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_setup( - psa_key_derivation_operation_t *operation, - psa_algorithm_t alg); - -/** Retrieve the current capacity of a key derivation operation. - * - * The capacity of a key derivation is the maximum number of bytes that it can - * return. When you get *N* bytes of output from a key derivation operation, - * this reduces its capacity by *N*. - * - * \param[in] operation The operation to query. - * \param[out] capacity On success, the capacity of the operation. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_get_capacity( - const psa_key_derivation_operation_t *operation, - size_t *capacity); - -/** Set the maximum capacity of a key derivation operation. - * - * The capacity of a key derivation operation is the maximum number of bytes - * that the key derivation operation can return from this point onwards. - * - * \param[in,out] operation The key derivation operation object to modify. - * \param capacity The new capacity of the operation. - * It must be less or equal to the operation's - * current capacity. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p capacity is larger than the operation's current capacity. - * In this case, the operation object remains valid and its capacity - * remains unchanged. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active), or the - * library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_set_capacity( - psa_key_derivation_operation_t *operation, - size_t capacity); - -/** Use the maximum possible capacity for a key derivation operation. - * - * Use this value as the capacity argument when setting up a key derivation - * to indicate that the operation should have the maximum possible capacity. - * The value of the maximum possible capacity depends on the key derivation - * algorithm. - */ -#define PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ((size_t) (-1)) - -/** Provide an input for key derivation or key agreement. - * - * Which inputs are required and in what order depends on the algorithm. - * Refer to the documentation of each key derivation or key agreement - * algorithm for information. - * - * This function passes direct inputs, which is usually correct for - * non-secret inputs. To pass a secret input, which should be in a key - * object, call psa_key_derivation_input_key() instead of this function. - * Refer to the documentation of individual step types - * (`PSA_KEY_DERIVATION_INPUT_xxx` values of type ::psa_key_derivation_step_t) - * for more information. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to use. - * It must have been set up with - * psa_key_derivation_setup() and must not - * have produced any output yet. - * \param step Which step the input data is for. - * \param[in] data Input data to use. - * \param data_length Size of the \p data buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c step is not compatible with the operation's algorithm, or - * \c step does not allow direct inputs. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid for this input \p step, or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_input_bytes( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - const uint8_t *data, - size_t data_length); - -/** Provide a numeric input for key derivation or key agreement. - * - * Which inputs are required and in what order depends on the algorithm. - * However, when an algorithm requires a particular order, numeric inputs - * usually come first as they tend to be configuration parameters. - * Refer to the documentation of each key derivation or key agreement - * algorithm for information. - * - * This function is used for inputs which are fixed-size non-negative - * integers. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to use. - * It must have been set up with - * psa_key_derivation_setup() and must not - * have produced any output yet. - * \param step Which step the input data is for. - * \param[in] value The value of the numeric input. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c step is not compatible with the operation's algorithm, or - * \c step does not allow numeric inputs. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid for this input \p step, or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_input_integer( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - uint64_t value); - -/** Provide an input for key derivation in the form of a key. - * - * Which inputs are required and in what order depends on the algorithm. - * Refer to the documentation of each key derivation or key agreement - * algorithm for information. - * - * This function obtains input from a key object, which is usually correct for - * secret inputs or for non-secret personalization strings kept in the key - * store. To pass a non-secret parameter which is not in the key store, - * call psa_key_derivation_input_bytes() instead of this function. - * Refer to the documentation of individual step types - * (`PSA_KEY_DERIVATION_INPUT_xxx` values of type ::psa_key_derivation_step_t) - * for more information. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to use. - * It must have been set up with - * psa_key_derivation_setup() and must not - * have produced any output yet. - * \param step Which step the input data is for. - * \param key Identifier of the key. It must have an - * appropriate type for step and must allow the - * usage #PSA_KEY_USAGE_DERIVE or - * #PSA_KEY_USAGE_VERIFY_DERIVATION (see note) - * and the algorithm used by the operation. - * - * \note Once all inputs steps are completed, the operations will allow: - * - psa_key_derivation_output_bytes() if each input was either a direct input - * or a key with #PSA_KEY_USAGE_DERIVE set; - * - psa_key_derivation_output_key() if the input for step - * #PSA_KEY_DERIVATION_INPUT_SECRET or #PSA_KEY_DERIVATION_INPUT_PASSWORD - * was from a key slot with #PSA_KEY_USAGE_DERIVE and each other input was - * either a direct input or a key with #PSA_KEY_USAGE_DERIVE set; - * - psa_key_derivation_verify_bytes() if each input was either a direct input - * or a key with #PSA_KEY_USAGE_VERIFY_DERIVATION set; - * - psa_key_derivation_verify_key() under the same conditions as - * psa_key_derivation_verify_bytes(). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The key allows neither #PSA_KEY_USAGE_DERIVE nor - * #PSA_KEY_USAGE_VERIFY_DERIVATION, or it doesn't allow this - * algorithm. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c step is not compatible with the operation's algorithm, or - * \c step does not allow key inputs of the given type - * or does not allow key inputs at all. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid for this input \p step, or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_input_key( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - mbedtls_svc_key_id_t key); - -/** Perform a key agreement and use the shared secret as input to a key - * derivation. - * - * A key agreement algorithm takes two inputs: a private key \p private_key - * a public key \p peer_key. - * The result of this function is passed as input to a key derivation. - * The output of this key derivation can be extracted by reading from the - * resulting operation to produce keys and other cryptographic material. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to use. - * It must have been set up with - * psa_key_derivation_setup() with a - * key agreement and derivation algorithm - * \c alg (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_KEY_AGREEMENT(\c alg) is true - * and #PSA_ALG_IS_RAW_KEY_AGREEMENT(\c alg) - * is false). - * The operation must be ready for an - * input of the type given by \p step. - * \param step Which step the input data is for. - * \param private_key Identifier of the private key to use. It must - * allow the usage #PSA_KEY_USAGE_DERIVE. - * \param[in] peer_key Public key of the peer. The peer key must be in the - * same format that psa_import_key() accepts for the - * public key type corresponding to the type of - * private_key. That is, this function performs the - * equivalent of - * #psa_import_key(..., - * `peer_key`, `peer_key_length`) where - * with key attributes indicating the public key - * type corresponding to the type of `private_key`. - * For example, for EC keys, this means that peer_key - * is interpreted as a point on the curve that the - * private key is on. The standard formats for public - * keys are documented in the documentation of - * psa_export_public_key(). - * \param peer_key_length Size of \p peer_key in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c private_key is not compatible with \c alg, - * or \p peer_key is not valid for \c alg or not compatible with - * \c private_key, or \c step does not allow an input resulting - * from a key agreement. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \c alg is not supported or is not a key derivation algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid for this key agreement \p step, - * or the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_key_agreement( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - mbedtls_svc_key_id_t private_key, - const uint8_t *peer_key, - size_t peer_key_length); - -/** Read some data from a key derivation operation. - * - * This function calculates output bytes from a key derivation algorithm and - * return those bytes. - * If you view the key derivation's output as a stream of bytes, this - * function destructively reads the requested number of bytes from the - * stream. - * The operation's capacity decreases by the number of bytes read. - * - * If this function returns an error status other than - * #PSA_ERROR_INSUFFICIENT_DATA, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to read from. - * \param[out] output Buffer where the output will be written. - * \param output_length Number of bytes to output. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * One of the inputs was a key whose policy didn't allow - * #PSA_KEY_USAGE_DERIVE. - * \retval #PSA_ERROR_INSUFFICIENT_DATA - * The operation's capacity was less than - * \p output_length bytes. Note that in this case, - * no output is written to the output buffer. - * The operation's capacity is set to 0, thus - * subsequent calls to this function will not - * succeed, even with a smaller output buffer. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active and completed - * all required input steps), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_output_bytes( - psa_key_derivation_operation_t *operation, - uint8_t *output, - size_t output_length); - -/** Derive a key from an ongoing key derivation operation. - * - * This function calculates output bytes from a key derivation algorithm - * and uses those bytes to generate a key deterministically. - * The key's location, usage policy, type and size are taken from - * \p attributes. - * - * If you view the key derivation's output as a stream of bytes, this - * function destructively reads as many bytes as required from the - * stream. - * The operation's capacity decreases by the number of bytes read. - * - * If this function returns an error status other than - * #PSA_ERROR_INSUFFICIENT_DATA, the operation enters an error - * state and must be aborted by calling psa_key_derivation_abort(). - * - * How much output is produced and consumed from the operation, and how - * the key is derived, depends on the key type and on the key size - * (denoted \c bits below): - * - * - For key types for which the key is an arbitrary sequence of bytes - * of a given size, this function is functionally equivalent to - * calling #psa_key_derivation_output_bytes - * and passing the resulting output to #psa_import_key. - * However, this function has a security benefit: - * if the implementation provides an isolation boundary then - * the key material is not exposed outside the isolation boundary. - * As a consequence, for these key types, this function always consumes - * exactly (\c bits / 8) bytes from the operation. - * The following key types defined in this specification follow this scheme: - * - * - #PSA_KEY_TYPE_AES; - * - #PSA_KEY_TYPE_ARIA; - * - #PSA_KEY_TYPE_CAMELLIA; - * - #PSA_KEY_TYPE_DERIVE; - * - #PSA_KEY_TYPE_HMAC; - * - #PSA_KEY_TYPE_PASSWORD_HASH. - * - * - For ECC keys on a Montgomery elliptic curve - * (#PSA_KEY_TYPE_ECC_KEY_PAIR(\c curve) where \c curve designates a - * Montgomery curve), this function always draws a byte string whose - * length is determined by the curve, and sets the mandatory bits - * accordingly. That is: - * - * - Curve25519 (#PSA_ECC_FAMILY_MONTGOMERY, 255 bits): draw a 32-byte - * string and process it as specified in RFC 7748 §5. - * - Curve448 (#PSA_ECC_FAMILY_MONTGOMERY, 448 bits): draw a 56-byte - * string and process it as specified in RFC 7748 §5. - * - * - For key types for which the key is represented by a single sequence of - * \c bits bits with constraints as to which bit sequences are acceptable, - * this function draws a byte string of length (\c bits / 8) bytes rounded - * up to the nearest whole number of bytes. If the resulting byte string - * is acceptable, it becomes the key, otherwise the drawn bytes are discarded. - * This process is repeated until an acceptable byte string is drawn. - * The byte string drawn from the operation is interpreted as specified - * for the output produced by psa_export_key(). - * The following key types defined in this specification follow this scheme: - * - * - #PSA_KEY_TYPE_DES. - * Force-set the parity bits, but discard forbidden weak keys. - * For 2-key and 3-key triple-DES, the three keys are generated - * successively (for example, for 3-key triple-DES, - * if the first 8 bytes specify a weak key and the next 8 bytes do not, - * discard the first 8 bytes, use the next 8 bytes as the first key, - * and continue reading output from the operation to derive the other - * two keys). - * - Finite-field Diffie-Hellman keys (#PSA_KEY_TYPE_DH_KEY_PAIR(\c group) - * where \c group designates any Diffie-Hellman group) and - * ECC keys on a Weierstrass elliptic curve - * (#PSA_KEY_TYPE_ECC_KEY_PAIR(\c curve) where \c curve designates a - * Weierstrass curve). - * For these key types, interpret the byte string as integer - * in big-endian order. Discard it if it is not in the range - * [0, *N* - 2] where *N* is the boundary of the private key domain - * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA, - * or the order of the curve's base point for ECC). - * Add 1 to the resulting integer and use this as the private key *x*. - * This method allows compliance to NIST standards, specifically - * the methods titled "key-pair generation by testing candidates" - * in NIST SP 800-56A §5.6.1.1.4 for Diffie-Hellman, - * in FIPS 186-4 §B.1.2 for DSA, and - * in NIST SP 800-56A §5.6.1.2.2 or - * FIPS 186-4 §B.4.2 for elliptic curve keys. - * - * - For other key types, including #PSA_KEY_TYPE_RSA_KEY_PAIR, - * the way in which the operation output is consumed is - * implementation-defined. - * - * In all cases, the data that is read is discarded from the operation. - * The operation's capacity is decreased by the number of bytes read. - * - * For algorithms that take an input step #PSA_KEY_DERIVATION_INPUT_SECRET, - * the input to that step must be provided with psa_key_derivation_input_key(). - * Future versions of this specification may include additional restrictions - * on the derived key based on the attributes and strength of the secret key. - * - * \param[in] attributes The attributes for the new key. - * If the key type to be created is - * #PSA_KEY_TYPE_PASSWORD_HASH then the algorithm in - * the policy must be the same as in the current - * operation. - * \param[in,out] operation The key derivation operation object to read from. - * \param[out] key On success, an identifier for the newly created - * key. For persistent keys, this is the key - * identifier defined in \p attributes. - * \c 0 on failure. - * - * \retval #PSA_SUCCESS - * Success. - * If the key is persistent, the key material and the key's metadata - * have been saved to persistent storage. - * \retval #PSA_ERROR_ALREADY_EXISTS - * This is an attempt to create a persistent key, and there is - * already a persistent key with the given identifier. - * \retval #PSA_ERROR_INSUFFICIENT_DATA - * There was not enough data to create the desired key. - * Note that in this case, no output is written to the output buffer. - * The operation's capacity is set to 0, thus subsequent calls to - * this function will not succeed, even with a smaller output buffer. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The key type or key size is not supported, either by the - * implementation in general or in this particular location. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The provided key attributes are not valid for the operation. - * \retval #PSA_ERROR_NOT_PERMITTED - * The #PSA_KEY_DERIVATION_INPUT_SECRET or - * #PSA_KEY_DERIVATION_INPUT_PASSWORD input was not provided through a - * key; or one of the inputs was a key whose policy didn't allow - * #PSA_KEY_USAGE_DERIVE. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active and completed - * all required input steps), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_output_key( - const psa_key_attributes_t *attributes, - psa_key_derivation_operation_t *operation, - mbedtls_svc_key_id_t *key); - -/** Compare output data from a key derivation operation to an expected value. - * - * This function calculates output bytes from a key derivation algorithm and - * compares those bytes to an expected value in constant time. - * If you view the key derivation's output as a stream of bytes, this - * function destructively reads the expected number of bytes from the - * stream before comparing them. - * The operation's capacity decreases by the number of bytes read. - * - * This is functionally equivalent to the following code: - * \code - * psa_key_derivation_output_bytes(operation, tmp, output_length); - * if (memcmp(output, tmp, output_length) != 0) - * return PSA_ERROR_INVALID_SIGNATURE; - * \endcode - * except (1) it works even if the key's policy does not allow outputting the - * bytes, and (2) the comparison will be done in constant time. - * - * If this function returns an error status other than - * #PSA_ERROR_INSUFFICIENT_DATA or #PSA_ERROR_INVALID_SIGNATURE, - * the operation enters an error state and must be aborted by calling - * psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to read from. - * \param[in] expected_output Buffer containing the expected derivation output. - * \param output_length Length of the expected output; this is also the - * number of bytes that will be read. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The output was read successfully, but it differs from the expected - * output. - * \retval #PSA_ERROR_NOT_PERMITTED - * One of the inputs was a key whose policy didn't allow - * #PSA_KEY_USAGE_VERIFY_DERIVATION. - * \retval #PSA_ERROR_INSUFFICIENT_DATA - * The operation's capacity was less than - * \p output_length bytes. Note that in this case, - * the operation's capacity is set to 0, thus - * subsequent calls to this function will not - * succeed, even with a smaller expected output. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active and completed - * all required input steps), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_verify_bytes( - psa_key_derivation_operation_t *operation, - const uint8_t *expected_output, - size_t output_length); - -/** Compare output data from a key derivation operation to an expected value - * stored in a key object. - * - * This function calculates output bytes from a key derivation algorithm and - * compares those bytes to an expected value, provided as key of type - * #PSA_KEY_TYPE_PASSWORD_HASH. - * If you view the key derivation's output as a stream of bytes, this - * function destructively reads the number of bytes corresponding to the - * length of the expected value from the stream before comparing them. - * The operation's capacity decreases by the number of bytes read. - * - * This is functionally equivalent to exporting the key and calling - * psa_key_derivation_verify_bytes() on the result, except that it - * works even if the key cannot be exported. - * - * If this function returns an error status other than - * #PSA_ERROR_INSUFFICIENT_DATA or #PSA_ERROR_INVALID_SIGNATURE, - * the operation enters an error state and must be aborted by calling - * psa_key_derivation_abort(). - * - * \param[in,out] operation The key derivation operation object to read from. - * \param[in] expected A key of type #PSA_KEY_TYPE_PASSWORD_HASH - * containing the expected output. Its policy must - * include the #PSA_KEY_USAGE_VERIFY_DERIVATION flag - * and the permitted algorithm must match the - * operation. The value of this key was likely - * computed by a previous call to - * psa_key_derivation_output_key(). - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The output was read successfully, but if differs from the expected - * output. - * \retval #PSA_ERROR_INVALID_HANDLE - * The key passed as the expected value does not exist. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key passed as the expected value has an invalid type. - * \retval #PSA_ERROR_NOT_PERMITTED - * The key passed as the expected value does not allow this usage or - * this algorithm; or one of the inputs was a key whose policy didn't - * allow #PSA_KEY_USAGE_VERIFY_DERIVATION. - * \retval #PSA_ERROR_INSUFFICIENT_DATA - * The operation's capacity was less than - * the length of the expected value. In this case, - * the operation's capacity is set to 0, thus - * subsequent calls to this function will not - * succeed, even with a smaller expected output. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active and completed - * all required input steps), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_verify_key( - psa_key_derivation_operation_t *operation, - mbedtls_svc_key_id_t expected); - -/** Abort a key derivation operation. - * - * Aborting an operation frees all associated resources except for the \c - * operation structure itself. Once aborted, the operation object can be reused - * for another operation by calling psa_key_derivation_setup() again. - * - * This function may be called at any time after the operation - * object has been initialized as described in #psa_key_derivation_operation_t. - * - * In particular, it is valid to call psa_key_derivation_abort() twice, or to - * call psa_key_derivation_abort() on an operation that has not been set up. - * - * \param[in,out] operation The operation to abort. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_key_derivation_abort( - psa_key_derivation_operation_t *operation); - -/** Perform a key agreement and return the raw shared secret. - * - * \warning The raw result of a key agreement algorithm such as finite-field - * Diffie-Hellman or elliptic curve Diffie-Hellman has biases and should - * not be used directly as key material. It should instead be passed as - * input to a key derivation algorithm. To chain a key agreement with - * a key derivation, use psa_key_derivation_key_agreement() and other - * functions from the key derivation interface. - * - * \param alg The key agreement algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_RAW_KEY_AGREEMENT(\p alg) - * is true). - * \param private_key Identifier of the private key to use. It must - * allow the usage #PSA_KEY_USAGE_DERIVE. - * \param[in] peer_key Public key of the peer. It must be - * in the same format that psa_import_key() - * accepts. The standard formats for public - * keys are documented in the documentation - * of psa_export_public_key(). - * \param peer_key_length Size of \p peer_key in bytes. - * \param[out] output Buffer where the decrypted message is to - * be written. - * \param output_size Size of the \c output buffer in bytes. - * \param[out] output_length On success, the number of bytes - * that make up the returned output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p alg is not a key agreement algorithm, or - * \p private_key is not compatible with \p alg, - * or \p peer_key is not valid for \p alg or not compatible with - * \p private_key. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p output_size is too small - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not a supported key agreement algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_raw_key_agreement(psa_algorithm_t alg, - mbedtls_svc_key_id_t private_key, - const uint8_t *peer_key, - size_t peer_key_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/**@}*/ - -/** \defgroup random Random generation - * @{ - */ - -/** - * \brief Generate random bytes. - * - * \warning This function **can** fail! Callers MUST check the return status - * and MUST NOT use the content of the output buffer if the return - * status is not #PSA_SUCCESS. - * - * \note To generate a key, use psa_generate_key() instead. - * - * \param[out] output Output buffer for the generated data. - * \param output_size Number of bytes to generate and output. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_generate_random(uint8_t *output, - size_t output_size); - -/** - * \brief Generate a key or key pair. - * - * The key is generated randomly. - * Its location, usage policy, type and size are taken from \p attributes. - * - * Implementations must reject an attempt to generate a key of size 0. - * - * The following type-specific considerations apply: - * - For RSA keys (#PSA_KEY_TYPE_RSA_KEY_PAIR), - * the public exponent is 65537. - * The modulus is a product of two probabilistic primes - * between 2^{n-1} and 2^n where n is the bit size specified in the - * attributes. - * - * \param[in] attributes The attributes for the new key. - * \param[out] key On success, an identifier for the newly created - * key. For persistent keys, this is the key - * identifier defined in \p attributes. - * \c 0 on failure. - * - * \retval #PSA_SUCCESS - * Success. - * If the key is persistent, the key material and the key's metadata - * have been saved to persistent storage. - * \retval #PSA_ERROR_ALREADY_EXISTS - * This is an attempt to create a persistent key, and there is - * already a persistent key with the given identifier. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_generate_key(const psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t *key); - -/**@}*/ - -/** \defgroup interruptible_hash Interruptible sign/verify hash - * @{ - */ - -/** The type of the state data structure for interruptible hash - * signing operations. - * - * Before calling any function on a sign hash operation object, the - * application must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_sign_hash_interruptible_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_sign_hash_interruptible_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer - * #PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT, for example: - * \code - * psa_sign_hash_interruptible_operation_t operation = - * PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT; - * \endcode - * - Assign the result of the function - * psa_sign_hash_interruptible_operation_init() to the structure, for - * example: - * \code - * psa_sign_hash_interruptible_operation_t operation; - * operation = psa_sign_hash_interruptible_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_sign_hash_interruptible_operation_s psa_sign_hash_interruptible_operation_t; - -/** The type of the state data structure for interruptible hash - * verification operations. - * - * Before calling any function on a sign hash operation object, the - * application must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_verify_hash_interruptible_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_verify_hash_interruptible_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer - * #PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT, for example: - * \code - * psa_verify_hash_interruptible_operation_t operation = - * PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT; - * \endcode - * - Assign the result of the function - * psa_verify_hash_interruptible_operation_init() to the structure, for - * example: - * \code - * psa_verify_hash_interruptible_operation_t operation; - * operation = psa_verify_hash_interruptible_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_verify_hash_interruptible_operation_s psa_verify_hash_interruptible_operation_t; - -/** - * \brief Set the maximum number of ops allowed to be - * executed by an interruptible function in a - * single call. - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note The time taken to execute a single op is - * implementation specific and depends on - * software, hardware, the algorithm, key type and - * curve chosen. Even within a single operation, - * successive ops can take differing amounts of - * time. The only guarantee is that lower values - * for \p max_ops means functions will block for a - * lesser maximum amount of time. The functions - * \c psa_sign_interruptible_get_num_ops() and - * \c psa_verify_interruptible_get_num_ops() are - * provided to help with tuning this value. - * - * \note This value defaults to - * #PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED, which - * means the whole operation will be done in one - * go, regardless of the number of ops required. - * - * \note If more ops are needed to complete a - * computation, #PSA_OPERATION_INCOMPLETE will be - * returned by the function performing the - * computation. It is then the caller's - * responsibility to either call again with the - * same operation context until it returns 0 or an - * error code; or to call the relevant abort - * function if the answer is no longer required. - * - * \note The interpretation of \p max_ops is also - * implementation defined. On a hard real time - * system, this can indicate a hard deadline, as a - * real-time system needs a guarantee of not - * spending more than X time, however care must be - * taken in such an implementation to avoid the - * situation whereby calls just return, not being - * able to do any actual work within the allotted - * time. On a non-real-time system, the - * implementation can be more relaxed, but again - * whether this number should be interpreted as as - * hard or soft limit or even whether a less than - * or equals as regards to ops executed in a - * single call is implementation defined. - * - * \note For keys in local storage when no accelerator - * driver applies, please see also the - * documentation for \c mbedtls_ecp_set_max_ops(), - * which is the internal implementation in these - * cases. - * - * \warning With implementations that interpret this number - * as a hard limit, setting this number too small - * may result in an infinite loop, whereby each - * call results in immediate return with no ops - * done (as there is not enough time to execute - * any), and thus no result will ever be achieved. - * - * \note This only applies to functions whose - * documentation mentions they may return - * #PSA_OPERATION_INCOMPLETE. - * - * \param max_ops The maximum number of ops to be executed in a - * single call. This can be a number from 0 to - * #PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED, where 0 - * is the least amount of work done per call. - */ -void psa_interruptible_set_max_ops(uint32_t max_ops); - -/** - * \brief Get the maximum number of ops allowed to be - * executed by an interruptible function in a - * single call. This will return the last - * value set by - * \c psa_interruptible_set_max_ops() or - * #PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED if - * that function has never been called. - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \return Maximum number of ops allowed to be - * executed by an interruptible function in a - * single call. - */ -uint32_t psa_interruptible_get_max_ops(void); - -/** - * \brief Get the number of ops that a hash signing - * operation has taken so far. If the operation - * has completed, then this will represent the - * number of ops required for the entire - * operation. After initialization or calling - * \c psa_sign_hash_interruptible_abort() on - * the operation, a value of 0 will be returned. - * - * \note This interface is guaranteed re-entrant and - * thus may be called from driver code. - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * This is a helper provided to help you tune the - * value passed to \c - * psa_interruptible_set_max_ops(). - * - * \param operation The \c psa_sign_hash_interruptible_operation_t - * to use. This must be initialized first. - * - * \return Number of ops that the operation has taken so - * far. - */ -uint32_t psa_sign_hash_get_num_ops( - const psa_sign_hash_interruptible_operation_t *operation); - -/** - * \brief Get the number of ops that a hash verification - * operation has taken so far. If the operation - * has completed, then this will represent the - * number of ops required for the entire - * operation. After initialization or calling \c - * psa_verify_hash_interruptible_abort() on the - * operation, a value of 0 will be returned. - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * This is a helper provided to help you tune the - * value passed to \c - * psa_interruptible_set_max_ops(). - * - * \param operation The \c - * psa_verify_hash_interruptible_operation_t to - * use. This must be initialized first. - * - * \return Number of ops that the operation has taken so - * far. - */ -uint32_t psa_verify_hash_get_num_ops( - const psa_verify_hash_interruptible_operation_t *operation); - -/** - * \brief Start signing a hash or short message with a - * private key, in an interruptible manner. - * - * \see \c psa_sign_hash_complete() - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note This function combined with \c - * psa_sign_hash_complete() is equivalent to - * \c psa_sign_hash() but - * \c psa_sign_hash_complete() can return early and - * resume according to the limit set with \c - * psa_interruptible_set_max_ops() to reduce the - * maximum time spent in a function call. - * - * \note Users should call \c psa_sign_hash_complete() - * repeatedly on the same context after a - * successful call to this function until \c - * psa_sign_hash_complete() either returns 0 or an - * error. \c psa_sign_hash_complete() will return - * #PSA_OPERATION_INCOMPLETE if there is more work - * to do. Alternatively users can call - * \c psa_sign_hash_abort() at any point if they no - * longer want the result. - * - * \note If this function returns an error status, the - * operation enters an error state and must be - * aborted by calling \c psa_sign_hash_abort(). - * - * \param[in, out] operation The \c psa_sign_hash_interruptible_operation_t - * to use. This must be initialized first. - * - * \param key Identifier of the key to use for the operation. - * It must be an asymmetric key pair. The key must - * allow the usage #PSA_KEY_USAGE_SIGN_HASH. - * \param alg A signature algorithm (\c PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_HASH(\p alg) - * is true), that is compatible with - * the type of \p key. - * \param[in] hash The hash or message to sign. - * \param hash_length Size of the \p hash buffer in bytes. - * - * \retval #PSA_SUCCESS - * The operation started successfully - call \c psa_sign_hash_complete() - * with the same context to complete the operation - * - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_SIGN_HASH flag, or it does - * not permit the requested algorithm. - * \retval #PSA_ERROR_BAD_STATE - * An operation has previously been started on this context, and is - * still in progress. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_sign_hash_start( - psa_sign_hash_interruptible_operation_t *operation, - mbedtls_svc_key_id_t key, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length); - -/** - * \brief Continue and eventually complete the action of - * signing a hash or short message with a private - * key, in an interruptible manner. - * - * \see \c psa_sign_hash_start() - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note This function combined with \c - * psa_sign_hash_start() is equivalent to - * \c psa_sign_hash() but this function can return - * early and resume according to the limit set with - * \c psa_interruptible_set_max_ops() to reduce the - * maximum time spent in a function call. - * - * \note Users should call this function on the same - * operation object repeatedly until it either - * returns 0 or an error. This function will return - * #PSA_OPERATION_INCOMPLETE if there is more work - * to do. Alternatively users can call - * \c psa_sign_hash_abort() at any point if they no - * longer want the result. - * - * \note When this function returns successfully, the - * operation becomes inactive. If this function - * returns an error status, the operation enters an - * error state and must be aborted by calling - * \c psa_sign_hash_abort(). - * - * \param[in, out] operation The \c psa_sign_hash_interruptible_operation_t - * to use. This must be initialized first, and have - * had \c psa_sign_hash_start() called with it - * first. - * - * \param[out] signature Buffer where the signature is to be written. - * \param signature_size Size of the \p signature buffer in bytes. This - * must be appropriate for the selected - * algorithm and key: - * - The required signature size is - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c - * key_bits, \c alg) where \c key_type and \c - * key_bits are the type and bit-size - * respectively of key. - * - #PSA_SIGNATURE_MAX_SIZE evaluates to the - * maximum signature size of any supported - * signature algorithm. - * \param[out] signature_length On success, the number of bytes that make up - * the returned signature value. - * - * \retval #PSA_SUCCESS - * Operation completed successfully - * - * \retval #PSA_OPERATION_INCOMPLETE - * Operation was interrupted due to the setting of \c - * psa_interruptible_set_max_ops(). There is still work to be done. - * Call this function again with the same operation object. - * - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p signature buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \c alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of \c key. - * - * \retval #PSA_ERROR_BAD_STATE - * An operation was not previously started on this context via - * \c psa_sign_hash_start(). - * - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has either not been previously initialized by - * psa_crypto_init() or you did not previously call - * psa_sign_hash_start() with this operation object. It is - * implementation-dependent whether a failure to initialize results in - * this error code. - */ -psa_status_t psa_sign_hash_complete( - psa_sign_hash_interruptible_operation_t *operation, - uint8_t *signature, size_t signature_size, - size_t *signature_length); - -/** - * \brief Abort a sign hash operation. - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note This function is the only function that clears - * the number of ops completed as part of the - * operation. Please ensure you copy this value via - * \c psa_sign_hash_get_num_ops() if required - * before calling. - * - * \note Aborting an operation frees all associated - * resources except for the \p operation structure - * itself. Once aborted, the operation object can - * be reused for another operation by calling \c - * psa_sign_hash_start() again. - * - * \note You may call this function any time after the - * operation object has been initialized. In - * particular, calling \c psa_sign_hash_abort() - * after the operation has already been terminated - * by a call to \c psa_sign_hash_abort() or - * psa_sign_hash_complete() is safe. - * - * \param[in,out] operation Initialized sign hash operation. - * - * \retval #PSA_SUCCESS - * The operation was aborted successfully. - * - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_sign_hash_abort( - psa_sign_hash_interruptible_operation_t *operation); - -/** - * \brief Start reading and verifying a hash or short - * message, in an interruptible manner. - * - * \see \c psa_verify_hash_complete() - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note This function combined with \c - * psa_verify_hash_complete() is equivalent to - * \c psa_verify_hash() but \c - * psa_verify_hash_complete() can return early and - * resume according to the limit set with \c - * psa_interruptible_set_max_ops() to reduce the - * maximum time spent in a function. - * - * \note Users should call \c psa_verify_hash_complete() - * repeatedly on the same operation object after a - * successful call to this function until \c - * psa_verify_hash_complete() either returns 0 or - * an error. \c psa_verify_hash_complete() will - * return #PSA_OPERATION_INCOMPLETE if there is - * more work to do. Alternatively users can call - * \c psa_verify_hash_abort() at any point if they - * no longer want the result. - * - * \note If this function returns an error status, the - * operation enters an error state and must be - * aborted by calling \c psa_verify_hash_abort(). - * - * \param[in, out] operation The \c psa_verify_hash_interruptible_operation_t - * to use. This must be initialized first. - * - * \param key Identifier of the key to use for the operation. - * The key must allow the usage - * #PSA_KEY_USAGE_VERIFY_HASH. - * \param alg A signature algorithm (\c PSA_ALG_XXX - * value such that #PSA_ALG_IS_SIGN_HASH(\p alg) - * is true), that is compatible with - * the type of \p key. - * \param[in] hash The hash whose signature is to be verified. - * \param hash_length Size of the \p hash buffer in bytes. - * \param[in] signature Buffer containing the signature to verify. - * \param signature_length Size of the \p signature buffer in bytes. - * - * \retval #PSA_SUCCESS - * The operation started successfully - please call \c - * psa_verify_hash_complete() with the same context to complete the - * operation. - * - * \retval #PSA_ERROR_BAD_STATE - * Another operation has already been started on this context, and is - * still in progress. - * - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_VERIFY_HASH flag, or it does - * not permit the requested algorithm. - * - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_verify_hash_start( - psa_verify_hash_interruptible_operation_t *operation, - mbedtls_svc_key_id_t key, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - -/** - * \brief Continue and eventually complete the action of - * reading and verifying a hash or short message - * signed with a private key, in an interruptible - * manner. - * - * \see \c psa_verify_hash_start() - * - * \warning This is a beta API, and thus subject to change - * at any point. It is not bound by the usual - * interface stability promises. - * - * \note This function combined with \c - * psa_verify_hash_start() is equivalent to - * \c psa_verify_hash() but this function can - * return early and resume according to the limit - * set with \c psa_interruptible_set_max_ops() to - * reduce the maximum time spent in a function - * call. - * - * \note Users should call this function on the same - * operation object repeatedly until it either - * returns 0 or an error. This function will return - * #PSA_OPERATION_INCOMPLETE if there is more work - * to do. Alternatively users can call - * \c psa_verify_hash_abort() at any point if they - * no longer want the result. - * - * \note When this function returns successfully, the - * operation becomes inactive. If this function - * returns an error status, the operation enters an - * error state and must be aborted by calling - * \c psa_verify_hash_abort(). - * - * \param[in, out] operation The \c psa_verify_hash_interruptible_operation_t - * to use. This must be initialized first, and have - * had \c psa_verify_hash_start() called with it - * first. - * - * \retval #PSA_SUCCESS - * Operation completed successfully, and the passed signature is valid. - * - * \retval #PSA_OPERATION_INCOMPLETE - * Operation was interrupted due to the setting of \c - * psa_interruptible_set_max_ops(). There is still work to be done. - * Call this function again with the same operation object. - * - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculation was performed successfully, but the passed - * signature is not a valid signature. - * \retval #PSA_ERROR_BAD_STATE - * An operation was not previously started on this context via - * \c psa_verify_hash_start(). - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has either not been previously initialized by - * psa_crypto_init() or you did not previously call - * psa_verify_hash_start() on this object. It is - * implementation-dependent whether a failure to initialize results in - * this error code. - */ -psa_status_t psa_verify_hash_complete( - psa_verify_hash_interruptible_operation_t *operation); - -/** - * \brief Abort a verify hash operation. - * - * \warning This is a beta API, and thus subject to change at - * any point. It is not bound by the usual interface - * stability promises. - * - * \note This function is the only function that clears the - * number of ops completed as part of the operation. - * Please ensure you copy this value via - * \c psa_verify_hash_get_num_ops() if required - * before calling. - * - * \note Aborting an operation frees all associated - * resources except for the operation structure - * itself. Once aborted, the operation object can be - * reused for another operation by calling \c - * psa_verify_hash_start() again. - * - * \note You may call this function any time after the - * operation object has been initialized. - * In particular, calling \c psa_verify_hash_abort() - * after the operation has already been terminated by - * a call to \c psa_verify_hash_abort() or - * psa_verify_hash_complete() is safe. - * - * \param[in,out] operation Initialized verify hash operation. - * - * \retval #PSA_SUCCESS - * The operation was aborted successfully. - * - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_verify_hash_abort( - psa_verify_hash_interruptible_operation_t *operation); - - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -/* The file "crypto_sizes.h" contains definitions for size calculation - * macros whose definitions are implementation-specific. */ -#include "crypto_sizes.h" - -/* The file "crypto_struct.h" contains definitions for - * implementation-specific structs that are declared above. */ -#if defined(MBEDTLS_PSA_CRYPTO_STRUCT_FILE) -#include MBEDTLS_PSA_CRYPTO_STRUCT_FILE -#else -#include "crypto_struct.h" -#endif - -/* The file "crypto_extra.h" contains vendor-specific definitions. This - * can include vendor-defined algorithms, extra functions, etc. */ -#include "crypto_extra.h" - -#endif /* PSA_CRYPTO_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_adjust_auto_enabled.h b/ext/oberon/psa/core/include/psa/crypto_adjust_auto_enabled.h deleted file mode 100644 index 5e18298c65c4..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_adjust_auto_enabled.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * \file psa/crypto_adjust_auto_enabled.h - * \brief Adjust PSA configuration: enable always-on features - * - * Always enable certain features which require a negligible amount of code - * to implement, to avoid some edge cases in the configuration combinatorics. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_ADJUST_AUTO_ENABLED_H -#define PSA_CRYPTO_ADJUST_AUTO_ENABLED_H - -#define PSA_WANT_KEY_TYPE_DERIVE 1 -#define PSA_WANT_KEY_TYPE_PASSWORD 1 -#define PSA_WANT_KEY_TYPE_PASSWORD_HASH 1 -#define PSA_WANT_KEY_TYPE_RAW_DATA 1 - -#endif /* PSA_CRYPTO_ADJUST_AUTO_ENABLED_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_adjust_config_key_pair_types.h b/ext/oberon/psa/core/include/psa/crypto_adjust_config_key_pair_types.h deleted file mode 100644 index ff8ea21b344f..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_adjust_config_key_pair_types.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * \file psa/crypto_adjust_config_key_pair_types.h - * \brief Adjust PSA configuration for key pair types. - * - * See docs/proposed/psa-conditional-inclusion-c.md. - * - Support non-basic operations in a keypair type implicitly enables basic - * support for that keypair type. - * - Support for a keypair type implicitly enables the corresponding public - * key type. - * - Basic support for a keypair type implicilty enables import/export support - * for that keypair type. Warning: this is implementation-specific (mainly - * for the benefit of testing) and may change in the future! - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H -#define PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H - -/***************************************************************** - * ANYTHING -> BASIC - ****************************************************************/ - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT) || \ - defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT) || \ - defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) || \ - defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT) || \ - defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT) || \ - defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) || \ - defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT) || \ - defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT) || \ - defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE) || \ - defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT) || \ - defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT) || \ - defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_GENERATE) || \ - defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_BASIC 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_IMPORT) || \ - defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_EXPORT) || \ - defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_GENERATE) || \ - defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_BASIC 1 -#endif - -/***************************************************************** - * BASIC -> corresponding PUBLIC - ****************************************************************/ - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY 1 -#endif - -#if defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_SRP_PUBLIC_KEY 1 -#endif - -#endif /* PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_adjust_config_synonyms.h b/ext/oberon/psa/core/include/psa/crypto_adjust_config_synonyms.h deleted file mode 100644 index 5142ef0aef74..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_adjust_config_synonyms.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * \file psa/crypto_adjust_config_synonyms.h - * \brief Adjust PSA configuration: enable quasi-synonyms - * - * When two features require almost the same code, we automatically enable - * both when either one is requested, to reduce the combinatorics of - * possible configurations. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H -#define PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H - -/****************************************************************/ -/* De facto synonyms */ -/****************************************************************/ - -#if defined(PSA_WANT_ALG_ECDSA_ANY) && !defined(PSA_WANT_ALG_ECDSA) -#define PSA_WANT_ALG_ECDSA PSA_WANT_ALG_ECDSA_ANY -#elif !defined(PSA_WANT_ALG_ECDSA_ANY) && defined(PSA_WANT_ALG_ECDSA) -#define PSA_WANT_ALG_ECDSA_ANY PSA_WANT_ALG_ECDSA -#endif - -#if defined(PSA_WANT_ALG_CCM_STAR_NO_TAG) && !defined(PSA_WANT_ALG_CCM) -#define PSA_WANT_ALG_CCM PSA_WANT_ALG_CCM_STAR_NO_TAG -#elif !defined(PSA_WANT_ALG_CCM_STAR_NO_TAG) && defined(PSA_WANT_ALG_CCM) -#define PSA_WANT_ALG_CCM_STAR_NO_TAG PSA_WANT_ALG_CCM -#endif - -#if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) -#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW -#elif !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) -#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW PSA_WANT_ALG_RSA_PKCS1V15_SIGN -#endif - -#if defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && !defined(PSA_WANT_ALG_RSA_PSS) -#define PSA_WANT_ALG_RSA_PSS PSA_WANT_ALG_RSA_PSS_ANY_SALT -#elif !defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && defined(PSA_WANT_ALG_RSA_PSS) -#define PSA_WANT_ALG_RSA_PSS_ANY_SALT PSA_WANT_ALG_RSA_PSS -#endif - -#endif /* PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_compat.h b/ext/oberon/psa/core/include/psa/crypto_compat.h deleted file mode 100644 index 70fa14e872f7..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_compat.h +++ /dev/null @@ -1,165 +0,0 @@ -/** - * \file psa/crypto_compat.h - * - * \brief PSA cryptography module: Backward compatibility aliases - * - * This header declares alternative names for macro and functions. - * New application code should not use these names. - * These names may be removed in a future version of Mbed TLS. - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_COMPAT_H -#define PSA_CRYPTO_COMPAT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * To support both openless APIs and psa_open_key() temporarily, define - * psa_key_handle_t to be equal to mbedtls_svc_key_id_t. Do not mark the - * type and its utility macros and functions deprecated yet. This will be done - * in a subsequent phase. - */ -typedef mbedtls_svc_key_id_t psa_key_handle_t; - -#define PSA_KEY_HANDLE_INIT MBEDTLS_SVC_KEY_ID_INIT - -/** Check whether a handle is null. - * - * \param handle Handle - * - * \return Non-zero if the handle is null, zero otherwise. - */ -static inline int psa_key_handle_is_null(psa_key_handle_t handle) -{ - return mbedtls_svc_key_id_is_null(handle); -} - -/** Open a handle to an existing persistent key. - * - * Open a handle to a persistent key. A key is persistent if it was created - * with a lifetime other than #PSA_KEY_LIFETIME_VOLATILE. A persistent key - * always has a nonzero key identifier, set with psa_set_key_id() when - * creating the key. Implementations may provide additional pre-provisioned - * keys that can be opened with psa_open_key(). Such keys have an application - * key identifier in the vendor range, as documented in the description of - * #psa_key_id_t. - * - * The application must eventually close the handle with psa_close_key() or - * psa_destroy_key() to release associated resources. If the application dies - * without calling one of these functions, the implementation should perform - * the equivalent of a call to psa_close_key(). - * - * Some implementations permit an application to open the same key multiple - * times. If this is successful, each call to psa_open_key() will return a - * different key handle. - * - * \note This API is not part of the PSA Cryptography API Release 1.0.0 - * specification. It was defined in the 1.0 Beta 3 version of the - * specification but was removed in the 1.0.0 released version. This API is - * kept for the time being to not break applications relying on it. It is not - * deprecated yet but will be in the near future. - * - * \note Applications that rely on opening a key multiple times will not be - * portable to implementations that only permit a single key handle to be - * opened. See also :ref:\`key-handles\`. - * - * - * \param key The persistent identifier of the key. - * \param[out] handle On success, a handle to the key. - * - * \retval #PSA_SUCCESS - * Success. The application can now use the value of `*handle` - * to access the key. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY - * The implementation does not have sufficient resources to open the - * key. This can be due to reaching an implementation limit on the - * number of open keys, the number of open key handles, or available - * memory. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * There is no persistent key with key identifier \p key. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p key is not a valid persistent key identifier. - * \retval #PSA_ERROR_NOT_PERMITTED - * The specified key exists, but the application does not have the - * permission to access it. Note that this specification does not - * define any way to create such a key, but it may be possible - * through implementation-specific means. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_open_key(mbedtls_svc_key_id_t key, - psa_key_handle_t *handle); - -/** Close a key handle. - * - * If the handle designates a volatile key, this will destroy the key material - * and free all associated resources, just like psa_destroy_key(). - * - * If this is the last open handle to a persistent key, then closing the handle - * will free all resources associated with the key in volatile memory. The key - * data in persistent storage is not affected and can be opened again later - * with a call to psa_open_key(). - * - * Closing the key handle makes the handle invalid, and the key handle - * must not be used again by the application. - * - * \note This API is not part of the PSA Cryptography API Release 1.0.0 - * specification. It was defined in the 1.0 Beta 3 version of the - * specification but was removed in the 1.0.0 released version. This API is - * kept for the time being to not break applications relying on it. It is not - * deprecated yet but will be in the near future. - * - * \note If the key handle was used to set up an active - * :ref:\`multipart operation \`, then closing the - * key handle can cause the multipart operation to fail. Applications should - * maintain the key handle until after the multipart operation has finished. - * - * \param handle The key handle to close. - * If this is \c 0, do nothing and return \c PSA_SUCCESS. - * - * \retval #PSA_SUCCESS - * \p handle was a valid handle or \c 0. It is now closed. - * \retval #PSA_ERROR_INVALID_HANDLE - * \p handle is not a valid handle nor \c 0. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_close_key(psa_key_handle_t handle); - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_COMPAT_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_config.h b/ext/oberon/psa/core/include/psa/crypto_config.h deleted file mode 100644 index cd78393d248e..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_config.h +++ /dev/null @@ -1,152 +0,0 @@ -/** - * \file psa/crypto_config.h - * \brief PSA crypto configuration options (set of defines) - * - */ -/** - * To enable a cryptographic mechanism, uncomment the definition of - * the corresponding \c PSA_WANT_xxx preprocessor symbol. - * To disable a cryptographic mechanism, comment out the definition of - * the corresponding \c PSA_WANT_xxx preprocessor symbol. - * The names of cryptographic mechanisms correspond to values - * defined in psa/crypto_values.h, with the prefix \c PSA_WANT_ instead - * of \c PSA_. - * - * Note that many cryptographic mechanisms involve two symbols: one for - * the key type (\c PSA_WANT_KEY_TYPE_xxx) and one for the algorithm - * (\c PSA_WANT_ALG_xxx). Mechanisms with additional parameters may involve - * additional symbols. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef PSA_CRYPTO_CONFIG_H -#define PSA_CRYPTO_CONFIG_H - -#define PSA_WANT_ALG_CBC_NO_PADDING 1 -#define PSA_WANT_ALG_CBC_PKCS7 1 -#define PSA_WANT_ALG_CCM 1 -#define PSA_WANT_ALG_CCM_STAR_NO_TAG 1 -#define PSA_WANT_ALG_CHACHA20_POLY1305 1 -#define PSA_WANT_ALG_CMAC 1 -#define PSA_WANT_ALG_CTR 1 -#define PSA_WANT_ALG_DETERMINISTIC_ECDSA 1 -#define PSA_WANT_ALG_ECB_NO_PADDING 1 -#define PSA_WANT_ALG_ECDH 1 -#define PSA_WANT_ALG_ECDSA 1 -#define PSA_WANT_ALG_GCM 1 -#define PSA_WANT_ALG_HKDF 1 -#define PSA_WANT_ALG_HKDF_EXTRACT 1 -#define PSA_WANT_ALG_HKDF_EXPAND 1 -#define PSA_WANT_ALG_HMAC 1 -#define PSA_WANT_ALG_JPAKE 1 -#define PSA_WANT_ALG_PBKDF2_HMAC 1 -#define PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 1 -#define PSA_WANT_ALG_PURE_EDDSA 1 -#define PSA_WANT_ALG_ED25519PH 1 -#define PSA_WANT_ALG_ED448PH 1 -#define PSA_WANT_ALG_RSA_OAEP 1 -#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT 1 -#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN 1 -#define PSA_WANT_ALG_RSA_PSS 1 -#define PSA_WANT_ALG_SHA_1 1 -#define PSA_WANT_ALG_SHA_224 1 -#define PSA_WANT_ALG_SHA_256 1 -#define PSA_WANT_ALG_SHA_384 1 -#define PSA_WANT_ALG_SHA_512 1 -#define PSA_WANT_ALG_SHA3_224 1 -#define PSA_WANT_ALG_SHA3_256 1 -#define PSA_WANT_ALG_SHA3_384 1 -#define PSA_WANT_ALG_SHA3_512 1 -#define PSA_WANT_ALG_SHAKE256_512 1 -#define PSA_WANT_ALG_SPAKE2P 1 -#define PSA_WANT_ALG_SRP_6 1 -#define PSA_WANT_ALG_STREAM_CIPHER 1 -#define PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS 1 -#define PSA_WANT_ALG_TLS12_PRF 1 -#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1 -#define PSA_WANT_ALG_SP800_108_COUNTER_HMAC 1 -#define PSA_WANT_ALG_SP800_108_COUNTER_CMAC 1 - -#define PSA_WANT_ECC_MONTGOMERY_255 1 -#define PSA_WANT_ECC_MONTGOMERY_448 1 -#define PSA_WANT_ECC_TWISTED_EDWARDS_255 1 -#define PSA_WANT_ECC_TWISTED_EDWARDS_448 1 -#define PSA_WANT_ECC_SECP_R1_224 1 -#define PSA_WANT_ECC_SECP_R1_256 1 -#define PSA_WANT_ECC_SECP_R1_384 1 -#define PSA_WANT_ECC_SECP_R1_521 1 - -#define PSA_WANT_KEY_TYPE_DERIVE 1 -#define PSA_WANT_KEY_TYPE_PASSWORD 1 -#define PSA_WANT_KEY_TYPE_PASSWORD_HASH 1 -#define PSA_WANT_KEY_TYPE_HMAC 1 -#define PSA_WANT_KEY_TYPE_AES 1 -#define PSA_WANT_KEY_TYPE_CHACHA20 1 -//#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR 1 /* Deprecated */ -#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1 -#define PSA_WANT_KEY_TYPE_RAW_DATA 1 -//#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR 1 /* Deprecated */ -#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1 - -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1 -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1 -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT 1 -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1 -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE 1 - -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1 -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT 1 -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT 1 - -// Additional AES key size option -#define PSA_WANT_AES_KEY_SIZE_128 1 -#define PSA_WANT_AES_KEY_SIZE_192 1 -#define PSA_WANT_AES_KEY_SIZE_256 1 - -// Additional RSA key size option -#define PSA_WANT_RSA_KEY_SIZE_1024 1 -#define PSA_WANT_RSA_KEY_SIZE_1536 1 -#define PSA_WANT_RSA_KEY_SIZE_2048 1 -#define PSA_WANT_RSA_KEY_SIZE_3072 1 -#define PSA_WANT_RSA_KEY_SIZE_4096 1 -#define PSA_WANT_RSA_KEY_SIZE_6144 1 -#define PSA_WANT_RSA_KEY_SIZE_8192 1 - -// Additional configuration option -#define PSA_WANT_GENERATE_RANDOM 1 - -// Moved from mbedtls_config.h -#define MBEDTLS_PSA_KEY_SLOT_COUNT 16 - - -/* Driver usage configuration */ - -//#define PSA_USE_CTR_DRBG_DRIVER 1 -#define PSA_USE_HMAC_DRBG_DRIVER 1 - -/* Hardware driver demonstration */ -#define PSA_USE_DEMO_ENTROPY_DRIVER 1 -//#define PSA_USE_DEMO_HARDWARE_DRIVER 1 -#define PSA_USE_DEMO_OPAQUE_DRIVER 1 - - -#endif /* PSA_CRYPTO_CONFIG_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_driver_common.h b/ext/oberon/psa/core/include/psa/crypto_driver_common.h deleted file mode 100644 index 26363c6b2f3e..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_driver_common.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * \file psa/crypto_driver_common.h - * \brief Definitions for all PSA crypto drivers - * - * This file contains common definitions shared by all PSA crypto drivers. - * Do not include it directly: instead, include the header file(s) for - * the type(s) of driver that you are implementing. For example, if - * you are writing a dynamically registered driver for a secure element, - * include `psa/crypto_se_driver.h`. - * - * This file is part of the PSA Crypto Driver Model, containing functions for - * driver developers to implement to enable hardware to be called in a - * standardized way by a PSA Cryptographic API implementation. The functions - * comprising the driver model, which driver authors implement, are not - * intended to be called by application developers. - */ - -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PSA_CRYPTO_DRIVER_COMMON_H -#define PSA_CRYPTO_DRIVER_COMMON_H - -#include -#include - -/* Include type definitions (psa_status_t, psa_algorithm_t, - * psa_key_type_t, etc.) and macros to build and analyze values - * of these types. */ -#include "crypto_types.h" -#include "crypto_values.h" -/* Include size definitions which are used to size some arrays in operation - * structures. */ -#include - -/** For encrypt-decrypt functions, whether the operation is an encryption - * or a decryption. */ -typedef enum { - PSA_CRYPTO_DRIVER_DECRYPT, - PSA_CRYPTO_DRIVER_ENCRYPT -} psa_encrypt_or_decrypt_t; - -#endif /* PSA_CRYPTO_DRIVER_COMMON_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_driver_config.h b/ext/oberon/psa/core/include/psa/crypto_driver_config.h deleted file mode 100644 index 88f9ba659c85..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_driver_config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Oberon microsystems AG, Switzerland - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_DRIVER_CONFIG_H -#define PSA_CRYPTO_DRIVER_CONFIG_H - - -#if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE) -#include MBEDTLS_PSA_CRYPTO_CONFIG_FILE -#else -#include "psa/crypto_config.h" -#endif - -#if defined(PSA_USE_DEMO_ENTROPY_DRIVER) || \ - defined(PSA_USE_DEMO_HARDWARE_DRIVER) || \ - defined(PSA_USE_DEMO_OPAQUE_DRIVER) -#include "demo_driver_config.h" -#endif - -#endif /* PSA_CRYPTO_DRIVER_CONFIG_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_extra.h b/ext/oberon/psa/core/include/psa/crypto_extra.h deleted file mode 100644 index 3c6ae192e97b..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_extra.h +++ /dev/null @@ -1,2131 +0,0 @@ -/** - * \file psa/crypto_extra.h - * - * \brief PSA cryptography module: Mbed TLS vendor extensions - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. - * - * This file is reserved for vendor-specific definitions. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_EXTRA_H -#define PSA_CRYPTO_EXTRA_H -#include "mbedtls/private_access.h" - -#include "crypto_types.h" -#include "crypto_compat.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* UID for secure storage seed */ -#define PSA_CRYPTO_ITS_RANDOM_SEED_UID 0xFFFFFF52 - -/* See mbedtls_config.h for definition */ -#if !defined(MBEDTLS_PSA_KEY_SLOT_COUNT) -#define MBEDTLS_PSA_KEY_SLOT_COUNT 32 -#endif - -/** \addtogroup attributes - * @{ - */ - -/** \brief Declare the enrollment algorithm for a key. - * - * An operation on a key may indifferently use the algorithm set with - * psa_set_key_algorithm() or with this function. - * - * \param[out] attributes The attribute structure to write to. - * \param alg2 A second algorithm that the key may be used - * for, in addition to the algorithm set with - * psa_set_key_algorithm(). - * - * \warning Setting an enrollment algorithm is not recommended, because - * using the same key with different algorithms can allow some - * attacks based on arithmetic relations between different - * computations made with the same key, or can escalate harmless - * side channels into exploitable ones. Use this function only - * if it is necessary to support a protocol for which it has been - * verified that the usage of the key with multiple algorithms - * is safe. - */ -static inline void psa_set_key_enrollment_algorithm( - psa_key_attributes_t *attributes, - psa_algorithm_t alg2) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2) = alg2; -} - -/** Retrieve the enrollment algorithm policy from key attributes. - * - * \param[in] attributes The key attribute structure to query. - * - * \return The enrollment algorithm stored in the attribute structure. - */ -static inline psa_algorithm_t psa_get_key_enrollment_algorithm( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2); -} - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) - -/** Retrieve the slot number where a key is stored. - * - * A slot number is only defined for keys that are stored in a secure - * element. - * - * This information is only useful if the secure element is not entirely - * managed through the PSA Cryptography API. It is up to the secure - * element driver to decide how PSA slot numbers map to any other interface - * that the secure element may have. - * - * \param[in] attributes The key attribute structure to query. - * \param[out] slot_number On success, the slot number containing the key. - * - * \retval #PSA_SUCCESS - * The key is located in a secure element, and \p *slot_number - * indicates the slot number that contains it. - * \retval #PSA_ERROR_NOT_PERMITTED - * The caller is not permitted to query the slot number. - * Mbed TLS currently does not return this error. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key is not located in a secure element. - */ -psa_status_t psa_get_key_slot_number( - const psa_key_attributes_t *attributes, - psa_key_slot_number_t *slot_number); - -/** Choose the slot number where a key is stored. - * - * This function declares a slot number in the specified attribute - * structure. - * - * A slot number is only meaningful for keys that are stored in a secure - * element. It is up to the secure element driver to decide how PSA slot - * numbers map to any other interface that the secure element may have. - * - * \note Setting a slot number in key attributes for a key creation can - * cause the following errors when creating the key: - * - #PSA_ERROR_NOT_SUPPORTED if the selected secure element does - * not support choosing a specific slot number. - * - #PSA_ERROR_NOT_PERMITTED if the caller is not permitted to - * choose slot numbers in general or to choose this specific slot. - * - #PSA_ERROR_INVALID_ARGUMENT if the chosen slot number is not - * valid in general or not valid for this specific key. - * - #PSA_ERROR_ALREADY_EXISTS if there is already a key in the - * selected slot. - * - * \param[out] attributes The attribute structure to write to. - * \param slot_number The slot number to set. - */ -static inline void psa_set_key_slot_number( - psa_key_attributes_t *attributes, - psa_key_slot_number_t slot_number) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(flags) |= MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER; - attributes->MBEDTLS_PRIVATE(slot_number) = slot_number; -} - -/** Remove the slot number attribute from a key attribute structure. - * - * This function undoes the action of psa_set_key_slot_number(). - * - * \param[out] attributes The attribute structure to write to. - */ -static inline void psa_clear_key_slot_number( - psa_key_attributes_t *attributes) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(flags) &= - ~MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER; -} - -/** Register a key that is already present in a secure element. - * - * The key must be located in a secure element designated by the - * lifetime field in \p attributes, in the slot set with - * psa_set_key_slot_number() in the attribute structure. - * This function makes the key available through the key identifier - * specified in \p attributes. - * - * \param[in] attributes The attributes of the existing key. - * - * \retval #PSA_SUCCESS - * The key was successfully registered. - * Note that depending on the design of the driver, this may or may - * not guarantee that a key actually exists in the designated slot - * and is compatible with the specified attributes. - * \retval #PSA_ERROR_ALREADY_EXISTS - * There is already a key with the identifier specified in - * \p attributes. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The secure element driver for the specified lifetime does not - * support registering a key. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The identifier in \p attributes is invalid, namely the identifier is - * not in the user range, or - * \p attributes specifies a lifetime which is not located - * in a secure element, or no slot number is specified in \p attributes, - * or the specified slot number is not valid. - * \retval #PSA_ERROR_NOT_PERMITTED - * The caller is not authorized to register the specified key slot. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t mbedtls_psa_register_se_key( - const psa_key_attributes_t *attributes); - -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ - -/**@}*/ - -/** - * \brief Library deinitialization. - * - * This function clears all data associated with the PSA layer, - * including the whole key store. - * - * This is an Mbed TLS extension. - */ -void mbedtls_psa_crypto_free(void); - -/** \brief Statistics about - * resource consumption related to the PSA keystore. - * - * \note The content of this structure is not part of the stable API and ABI - * of Mbed TLS and may change arbitrarily from version to version. - */ -typedef struct mbedtls_psa_stats_s { - /** Number of slots containing key material for a volatile key. */ - size_t MBEDTLS_PRIVATE(volatile_slots); - /** Number of slots containing key material for a key which is in - * internal persistent storage. */ - size_t MBEDTLS_PRIVATE(persistent_slots); - /** Number of slots containing a reference to a key in a - * secure element. */ - size_t MBEDTLS_PRIVATE(external_slots); - /** Number of slots which are occupied, but do not contain - * key material yet. */ - size_t MBEDTLS_PRIVATE(half_filled_slots); - /** Number of slots that contain cache data. */ - size_t MBEDTLS_PRIVATE(cache_slots); - /** Number of slots that are not used for anything. */ - size_t MBEDTLS_PRIVATE(empty_slots); - /** Number of slots that are locked. */ - size_t MBEDTLS_PRIVATE(locked_slots); - /** Largest key id value among open keys in internal persistent storage. */ - psa_key_id_t MBEDTLS_PRIVATE(max_open_internal_key_id); - /** Largest key id value among open keys in secure elements. */ - psa_key_id_t MBEDTLS_PRIVATE(max_open_external_key_id); -} mbedtls_psa_stats_t; - -/** \brief Get statistics about - * resource consumption related to the PSA keystore. - * - * \note When Mbed TLS is built as part of a service, with isolation - * between the application and the keystore, the service may or - * may not expose this function. - */ -void mbedtls_psa_get_stats(mbedtls_psa_stats_t *stats); - -/** - * \brief Inject an initial entropy seed for the random generator into - * secure storage. - * - * This function injects data to be used as a seed for the random generator - * used by the PSA Crypto implementation. On devices that lack a trusted - * entropy source (preferably a hardware random number generator), - * the Mbed PSA Crypto implementation uses this value to seed its - * random generator. - * - * On devices without a trusted entropy source, this function must be - * called exactly once in the lifetime of the device. On devices with - * a trusted entropy source, calling this function is optional. - * In all cases, this function may only be called before calling any - * other function in the PSA Crypto API, including psa_crypto_init(). - * - * When this function returns successfully, it populates a file in - * persistent storage. Once the file has been created, this function - * can no longer succeed. - * - * If any error occurs, this function does not change the system state. - * You can call this function again after correcting the reason for the - * error if possible. - * - * \warning This function **can** fail! Callers MUST check the return status. - * - * \warning If you use this function, you should use it as part of a - * factory provisioning process. The value of the injected seed - * is critical to the security of the device. It must be - * *secret*, *unpredictable* and (statistically) *unique per device*. - * You should be generate it randomly using a cryptographically - * secure random generator seeded from trusted entropy sources. - * You should transmit it securely to the device and ensure - * that its value is not leaked or stored anywhere beyond the - * needs of transmitting it from the point of generation to - * the call of this function, and erase all copies of the value - * once this function returns. - * - * This is an Mbed TLS extension. - * - * \note This function is only available on the following platforms: - * * If the compile-time option MBEDTLS_PSA_INJECT_ENTROPY is enabled. - * Note that you must provide compatible implementations of - * mbedtls_nv_seed_read and mbedtls_nv_seed_write. - * * In a client-server integration of PSA Cryptography, on the client side, - * if the server supports this feature. - * \param[in] seed Buffer containing the seed value to inject. - * \param[in] seed_size Size of the \p seed buffer. - * The size of the seed in bytes must be greater - * or equal to both #MBEDTLS_ENTROPY_BLOCK_SIZE - * and the value of \c MBEDTLS_ENTROPY_MIN_PLATFORM - * in `library/entropy_poll.h` in the Mbed TLS source - * code. - * It must be less or equal to - * #MBEDTLS_ENTROPY_MAX_SEED_SIZE. - * - * \retval #PSA_SUCCESS - * The seed value was injected successfully. The random generator - * of the PSA Crypto implementation is now ready for use. - * You may now call psa_crypto_init() and use the PSA Crypto - * implementation. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p seed_size is out of range. - * \retval #PSA_ERROR_STORAGE_FAILURE - * There was a failure reading or writing from storage. - * \retval #PSA_ERROR_NOT_PERMITTED - * The library has already been initialized. It is no longer - * possible to call this function. - */ -psa_status_t mbedtls_psa_inject_entropy(const uint8_t *seed, - size_t seed_size); - -/** \addtogroup crypto_types - * @{ - */ - -/** DSA public key. - * - * The import and export format is the - * representation of the public key `y = g^x mod p` as a big-endian byte - * string. The length of the byte string is the length of the base prime `p` - * in bytes. - */ -#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t) 0x4002) - -/** DSA key pair (private and public key). - * - * The import and export format is the - * representation of the private key `x` as a big-endian byte string. The - * length of the byte string is the private key size in bytes (leading zeroes - * are not stripped). - * - * Deterministic DSA key derivation with psa_generate_derived_key follows - * FIPS 186-4 §B.1.2: interpret the byte string as integer - * in big-endian order. Discard it if it is not in the range - * [0, *N* - 2] where *N* is the boundary of the private key domain - * (the prime *p* for Diffie-Hellman, the subprime *q* for DSA, - * or the order of the curve's base point for ECC). - * Add 1 to the resulting integer and use this as the private key *x*. - * - */ -#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t) 0x7002) - -/** Whether a key type is a DSA key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_DSA(type) \ - (PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) == PSA_KEY_TYPE_DSA_PUBLIC_KEY) - -#define PSA_ALG_DSA_BASE ((psa_algorithm_t) 0x06000400) -/** DSA signature with hashing. - * - * This is the signature scheme defined by FIPS 186-4, - * with a random per-message secret number (*k*). - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding DSA signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_DSA(hash_alg) \ - (PSA_ALG_DSA_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_DETERMINISTIC_DSA_BASE ((psa_algorithm_t) 0x06000500) -#define PSA_ALG_DSA_DETERMINISTIC_FLAG PSA_ALG_ECDSA_DETERMINISTIC_FLAG -/** Deterministic DSA signature with hashing. - * - * This is the deterministic variant defined by RFC 6979 of - * the signature scheme defined by FIPS 186-4. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding DSA signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_DETERMINISTIC_DSA(hash_alg) \ - (PSA_ALG_DETERMINISTIC_DSA_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_IS_DSA(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK & ~PSA_ALG_DSA_DETERMINISTIC_FLAG) == \ - PSA_ALG_DSA_BASE) -#define PSA_ALG_DSA_IS_DETERMINISTIC(alg) \ - (((alg) & PSA_ALG_DSA_DETERMINISTIC_FLAG) != 0) -#define PSA_ALG_IS_DETERMINISTIC_DSA(alg) \ - (PSA_ALG_IS_DSA(alg) && PSA_ALG_DSA_IS_DETERMINISTIC(alg)) -#define PSA_ALG_IS_RANDOMIZED_DSA(alg) \ - (PSA_ALG_IS_DSA(alg) && !PSA_ALG_DSA_IS_DETERMINISTIC(alg)) - - -/* We need to expand the sample definition of this macro from - * the API definition. */ -#undef PSA_ALG_IS_VENDOR_HASH_AND_SIGN -#define PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg) \ - PSA_ALG_IS_DSA(alg) - -/**@}*/ - -/** \addtogroup attributes - * @{ - */ - -/** Custom Diffie-Hellman group. - * - * For keys of type #PSA_KEY_TYPE_DH_PUBLIC_KEY(#PSA_DH_FAMILY_CUSTOM) or - * #PSA_KEY_TYPE_DH_KEY_PAIR(#PSA_DH_FAMILY_CUSTOM), the group data comes - * from domain parameters set by psa_set_key_domain_parameters(). - */ -#define PSA_DH_FAMILY_CUSTOM ((psa_dh_family_t) 0x7e) - -/** - * \brief Set domain parameters for a key. - * - * Some key types require additional domain parameters in addition to - * the key type identifier and the key size. Use this function instead - * of psa_set_key_type() when you need to specify domain parameters. - * - * The format for the required domain parameters varies based on the key type. - * - * - For RSA keys (#PSA_KEY_TYPE_RSA_PUBLIC_KEY or #PSA_KEY_TYPE_RSA_KEY_PAIR), - * the domain parameter data consists of the public exponent, - * represented as a big-endian integer with no leading zeros. - * This information is used when generating an RSA key pair. - * When importing a key, the public exponent is read from the imported - * key data and the exponent recorded in the attribute structure is ignored. - * As an exception, the public exponent 65537 is represented by an empty - * byte string. - * - For DSA keys (#PSA_KEY_TYPE_DSA_PUBLIC_KEY or #PSA_KEY_TYPE_DSA_KEY_PAIR), - * the `Dss-Params` format as defined by RFC 3279 §2.3.2. - * ``` - * Dss-Params ::= SEQUENCE { - * p INTEGER, - * q INTEGER, - * g INTEGER - * } - * ``` - * - For Diffie-Hellman key exchange keys - * (#PSA_KEY_TYPE_DH_PUBLIC_KEY(#PSA_DH_FAMILY_CUSTOM) or - * #PSA_KEY_TYPE_DH_KEY_PAIR(#PSA_DH_FAMILY_CUSTOM)), the - * `DomainParameters` format as defined by RFC 3279 §2.3.3. - * ``` - * DomainParameters ::= SEQUENCE { - * p INTEGER, -- odd prime, p=jq +1 - * g INTEGER, -- generator, g - * q INTEGER, -- factor of p-1 - * j INTEGER OPTIONAL, -- subgroup factor - * validationParams ValidationParams OPTIONAL - * } - * ValidationParams ::= SEQUENCE { - * seed BIT STRING, - * pgenCounter INTEGER - * } - * ``` - * - * \note This function may allocate memory or other resources. - * Once you have called this function on an attribute structure, - * you must call psa_reset_key_attributes() to free these resources. - * - * \note This is an experimental extension to the interface. It may change - * in future versions of the library. - * - * \param[in,out] attributes Attribute structure where the specified domain - * parameters will be stored. - * If this function fails, the content of - * \p attributes is not modified. - * \param type Key type (a \c PSA_KEY_TYPE_XXX value). - * \param[in] data Buffer containing the key domain parameters. - * The content of this buffer is interpreted - * according to \p type as described above. - * \param data_length Size of the \p data buffer in bytes. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - */ -psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes, - psa_key_type_t type, - const uint8_t *data, - size_t data_length); - -/** - * \brief Get domain parameters for a key. - * - * Get the domain parameters for a key with this function, if any. The format - * of the domain parameters written to \p data is specified in the - * documentation for psa_set_key_domain_parameters(). - * - * \note This is an experimental extension to the interface. It may change - * in future versions of the library. - * - * \param[in] attributes The key attribute structure to query. - * \param[out] data On success, the key domain parameters. - * \param data_size Size of the \p data buffer in bytes. - * The buffer is guaranteed to be large - * enough if its size in bytes is at least - * the value given by - * PSA_KEY_DOMAIN_PARAMETERS_SIZE(). - * \param[out] data_length On success, the number of bytes - * that make up the key domain parameters data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL \emptydescription - */ -psa_status_t psa_get_key_domain_parameters( - const psa_key_attributes_t *attributes, - uint8_t *data, - size_t data_size, - size_t *data_length); - -/** Safe output buffer size for psa_get_key_domain_parameters(). - * - * This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * \warning This function may call its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \note This is an experimental extension to the interface. It may change - * in future versions of the library. - * - * \param key_type A supported key type. - * \param key_bits The size of the key in bits. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_get_key_domain_parameters() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not supported - * by the implementation, this macro shall return either a - * sensible size or 0. - * If the parameters are not valid, the - * return value is unspecified. - */ -#define PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) \ - (PSA_KEY_TYPE_IS_RSA(key_type) ? sizeof(int) : \ - PSA_KEY_TYPE_IS_DH(key_type) ? PSA_DH_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \ - PSA_KEY_TYPE_IS_DSA(key_type) ? PSA_DSA_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \ - 0) -#define PSA_DH_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) \ - (4 + (PSA_BITS_TO_BYTES(key_bits) + 5) * 3 /*without optional parts*/) -#define PSA_DSA_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) \ - (4 + (PSA_BITS_TO_BYTES(key_bits) + 5) * 2 /*p, g*/ + 34 /*q*/) - -/**@}*/ - -/** \defgroup psa_tls_helpers TLS helper functions - * @{ - */ -#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) -#include - -/** Convert an ECC curve identifier from the Mbed TLS encoding to PSA. - * - * \note This function is provided solely for the convenience of - * Mbed TLS and may be removed at any time without notice. - * - * \param grpid An Mbed TLS elliptic curve identifier - * (`MBEDTLS_ECP_DP_xxx`). - * \param[out] bits On success, the bit size of the curve. - * - * \return The corresponding PSA elliptic curve identifier - * (`PSA_ECC_FAMILY_xxx`). - * \return \c 0 on failure (\p grpid is not recognized). - */ -psa_ecc_family_t mbedtls_ecc_group_to_psa(mbedtls_ecp_group_id grpid, - size_t *bits); - -/** Convert an ECC curve identifier from the PSA encoding to Mbed TLS. - * - * \note This function is provided solely for the convenience of - * Mbed TLS and may be removed at any time without notice. - * - * \param curve A PSA elliptic curve identifier - * (`PSA_ECC_FAMILY_xxx`). - * \param bits The bit-length of a private key on \p curve. - * \param bits_is_sloppy If true, \p bits may be the bit-length rounded up - * to the nearest multiple of 8. This allows the caller - * to infer the exact curve from the length of a key - * which is supplied as a byte string. - * - * \return The corresponding Mbed TLS elliptic curve identifier - * (`MBEDTLS_ECP_DP_xxx`). - * \return #MBEDTLS_ECP_DP_NONE if \c curve is not recognized. - * \return #MBEDTLS_ECP_DP_NONE if \p bits is not - * correct for \p curve. - */ -mbedtls_ecp_group_id mbedtls_ecc_group_of_psa(psa_ecc_family_t curve, - size_t bits, - int bits_is_sloppy); -#endif /* PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY */ - -/**@}*/ - -/** \defgroup psa_external_rng External random generator - * @{ - */ - -#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) -/** External random generator function, implemented by the platform. - * - * When the compile-time option #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is enabled, - * this function replaces Mbed TLS's entropy and DRBG modules for all - * random generation triggered via PSA crypto interfaces. - * - * \note This random generator must deliver random numbers with cryptographic - * quality and high performance. It must supply unpredictable numbers - * with a uniform distribution. The implementation of this function - * is responsible for ensuring that the random generator is seeded - * with sufficient entropy. If you have a hardware TRNG which is slow - * or delivers non-uniform output, declare it as an entropy source - * with mbedtls_entropy_add_source() instead of enabling this option. - * - * \param[in,out] context Pointer to the random generator context. - * This is all-bits-zero on the first call - * and preserved between successive calls. - * \param[out] output Output buffer. On success, this buffer - * contains random data with a uniform - * distribution. - * \param output_size The size of the \p output buffer in bytes. - * \param[out] output_length On success, set this value to \p output_size. - * - * \retval #PSA_SUCCESS - * Success. The output buffer contains \p output_size bytes of - * cryptographic-quality random data, and \c *output_length is - * set to \p output_size. - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY - * The random generator requires extra entropy and there is no - * way to obtain entropy under current environment conditions. - * This error should not happen under normal circumstances since - * this function is responsible for obtaining as much entropy as - * it needs. However implementations of this function may return - * #PSA_ERROR_INSUFFICIENT_ENTROPY if there is no way to obtain - * entropy without blocking indefinitely. - * \retval #PSA_ERROR_HARDWARE_FAILURE - * A failure of the random generator hardware that isn't covered - * by #PSA_ERROR_INSUFFICIENT_ENTROPY. - */ -psa_status_t mbedtls_psa_external_get_random( - mbedtls_psa_external_random_context_t *context, - uint8_t *output, size_t output_size, size_t *output_length); -#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ - -/**@}*/ - -/** \defgroup psa_builtin_keys Built-in keys - * @{ - */ - -/** The minimum value for a key identifier that is built into the - * implementation. - * - * The range of key identifiers from #MBEDTLS_PSA_KEY_ID_BUILTIN_MIN - * to #MBEDTLS_PSA_KEY_ID_BUILTIN_MAX within the range from - * #PSA_KEY_ID_VENDOR_MIN and #PSA_KEY_ID_VENDOR_MAX and must not intersect - * with any other set of implementation-chosen key identifiers. - * - * This value is part of the library's ABI since changing it would invalidate - * the values of built-in key identifiers in applications. - */ -#define MBEDTLS_PSA_KEY_ID_BUILTIN_MIN ((psa_key_id_t) 0x7fff0000) - -/** The maximum value for a key identifier that is built into the - * implementation. - * - * See #MBEDTLS_PSA_KEY_ID_BUILTIN_MIN for more information. - */ -#define MBEDTLS_PSA_KEY_ID_BUILTIN_MAX ((psa_key_id_t) 0x7fffefff) - -/** A slot number identifying a key in a driver. - * - * Values of this type are used to identify built-in keys. - */ -typedef uint64_t psa_drv_slot_number_t; - -#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) -/** Test whether a key identifier belongs to the builtin key range. - * - * \param key_id Key identifier to test. - * - * \retval 1 - * The key identifier is a builtin key identifier. - * \retval 0 - * The key identifier is not a builtin key identifier. - */ -static inline int psa_key_id_is_builtin(psa_key_id_t key_id) -{ - return (key_id >= MBEDTLS_PSA_KEY_ID_BUILTIN_MIN) && - (key_id <= MBEDTLS_PSA_KEY_ID_BUILTIN_MAX); -} - -/** Platform function to obtain the location and slot number of a built-in key. - * - * An application-specific implementation of this function must be provided if - * #MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS is enabled. This would typically be provided - * as part of a platform's system image. - * - * #MBEDTLS_SVC_KEY_ID_GET_KEY_ID(\p key_id) needs to be in the range from - * #MBEDTLS_PSA_KEY_ID_BUILTIN_MIN to #MBEDTLS_PSA_KEY_ID_BUILTIN_MAX. - * - * In a multi-application configuration - * (\c MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER is defined), - * this function should check that #MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(\p key_id) - * is allowed to use the given key. - * - * \param key_id The key ID for which to retrieve the - * location and slot attributes. - * \param[out] lifetime On success, the lifetime associated with the key - * corresponding to \p key_id. Lifetime is a - * combination of which driver contains the key, - * and with what persistence level the key is - * intended to be used. If the platform - * implementation does not contain specific - * information about the intended key persistence - * level, the persistence level may be reported as - * #PSA_KEY_PERSISTENCE_DEFAULT. - * \param[out] slot_number On success, the slot number known to the driver - * registered at the lifetime location reported - * through \p lifetime which corresponds to the - * requested built-in key. - * - * \retval #PSA_SUCCESS - * The requested key identifier designates a built-in key. - * In a multi-application configuration, the requested owner - * is allowed to access it. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * The requested key identifier is not a built-in key which is known - * to this function. If a key exists in the key storage with this - * identifier, the data from the storage will be used. - * \return (any other error) - * Any other error is propagated to the function that requested the key. - * Common errors include: - * - #PSA_ERROR_NOT_PERMITTED: the key exists but the requested owner - * is not allowed to access it. - */ -psa_status_t mbedtls_psa_platform_get_builtin_key( - mbedtls_svc_key_id_t key_id, - psa_key_lifetime_t *lifetime, - psa_drv_slot_number_t *slot_number); -#endif /* MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ - -/** @} */ - -/** \addtogroup crypto_types - * @{ - */ - -#define PSA_KEY_TYPE_SPAKE2P_KEY_PAIR_BASE ((psa_key_type_t) 0x7400) -#define PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4400) -#define PSA_KEY_TYPE_SPAKE2P_CURVE_MASK ((psa_key_type_t) 0x00ff) - - /** SPAKE2+ key pair. Both the prover and verifier key. - * - * The size of a SPAKE2+ key is the size associated with the elliptic curve - * group. See the documentation of each elliptic curve family for details. - * To construct a SPAKE2+ key pair, it must be output from a key derivation - * operation. - * The corresponding public key can be exported using psa_export_public_key(). - * See also #PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY(). - * - * \param curve A value of type psa_ecc_family_t that identifies the elliptic - * curve family to be used. - */ -#define PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(curve) \ - ((psa_key_type_t) (PSA_KEY_TYPE_SPAKE2P_KEY_PAIR_BASE | (curve))) - - /** SPAKE2+ public key. The verifier key. - * - * The size of an SPAKE2+ public key is the same as the corresponding private - * key. See #PSA_KEY_TYPE_SPAKE2P_KEY_PAIR() and the documentation of each - * elliptic curve family for details. - * To construct a SPAKE2+ public key, it must be imported. - * - * \param curve A value of type psa_ecc_family_t that identifies the elliptic - * curve family to be used. - */ -#define PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY(curve) \ - ((psa_key_type_t) (PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY_BASE | (curve))) - - /** Whether a key type is a SPAKE2+ key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_SPAKE2P(type) \ - ((PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) & \ - ~PSA_KEY_TYPE_SPAKE2P_CURVE_MASK) == \ - PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY_BASE) - /** Whether a key type is a SPAKE2+ key pair. */ -#define PSA_KEY_TYPE_IS_SPAKE2P_KEY_PAIR(type) \ - (((type) & ~PSA_KEY_TYPE_SPAKE2P_CURVE_MASK) == \ - PSA_KEY_TYPE_SPAKE2P_KEY_PAIR_BASE) - /** Whether a key type is a SPAKE2+ public key. */ -#define PSA_KEY_TYPE_IS_SPAKE2P_PUBLIC_KEY(type) \ - (((type) & ~PSA_KEY_TYPE_SPAKE2P_CURVE_MASK) == \ - PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY_BASE) - /** Extract the curve from a SPAKE2+ key type. */ -#define PSA_KEY_TYPE_SPAKE2P_GET_FAMILY(type) \ - ((psa_ecc_family_t) (PSA_KEY_TYPE_IS_SPAKE2P(type) ? \ - ((type) & PSA_KEY_TYPE_SPAKE2P_CURVE_MASK) : \ - 0)) - -#define PSA_KEY_TYPE_SRP_KEY_PAIR_BASE ((psa_key_type_t) 0x7700) -#define PSA_KEY_TYPE_SRP_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4700) -#define PSA_KEY_TYPE_SRP_GROUP_MASK ((psa_key_type_t) 0x00ff) - - /** SRP key pair. Both the client and server key. - * - * The size of a SRP key is the size associated with the Diffie-Hellman - * group. See the documentation of each Diffie-Hellman group for details. - * To construct a SRP key pair, the password hash must be imported. - * The corresponding public key (password verifier) can be exported using - * psa_export_public_key(). See also #PSA_KEY_TYPE_SRP_PUBLIC_KEY(). - * - * \param group A value of type ::psa_dh_family_t that identifies the - * Diffie-Hellman group to be used. - */ -#define PSA_KEY_TYPE_SRP_KEY_PAIR(group) \ - ((psa_key_type_t) (PSA_KEY_TYPE_SRP_KEY_PAIR_BASE | (group))) - - /** SRP public key. The server key (password verifier). - * - * The size of an SRP public key is the same as the corresponding private - * key. See #PSA_KEY_TYPE_SRP_KEY_PAIR() and the documentation of each - * Diffie-Hellman group for details. - * To construct a SRP public key, it must be imported. The key size - * in attributes must not be zero. - * - * \param group A value of type ::psa_dh_family_t that identifies the - * Diffie-Hellman group to be used. - */ -#define PSA_KEY_TYPE_SRP_PUBLIC_KEY(group) \ - ((psa_key_type_t) (PSA_KEY_TYPE_SRP_PUBLIC_KEY_BASE | (group))) - - /** Whether a key type is a SRP key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_SRP(type) \ - ((PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) & \ - ~PSA_KEY_TYPE_SRP_GROUP_MASK) == \ - PSA_KEY_TYPE_SRP_PUBLIC_KEY_BASE) - /** Whether a key type is a SRP key pair. */ -#define PSA_KEY_TYPE_IS_SRP_KEY_PAIR(type) \ - (((type) & ~PSA_KEY_TYPE_SRP_GROUP_MASK) == \ - PSA_KEY_TYPE_SRP_KEY_PAIR_BASE) - /** Whether a key type is a SRP public key. */ -#define PSA_KEY_TYPE_IS_SRP_PUBLIC_KEY(type) \ - (((type) & ~PSA_KEY_TYPE_SRP_GROUP_MASK) == \ - PSA_KEY_TYPE_SRP_PUBLIC_KEY_BASE) - /** Extract the curve from a SRP key type. */ -#define PSA_KEY_TYPE_SRP_GET_FAMILY(type) \ - ((psa_ecc_family_t) (PSA_KEY_TYPE_IS_SRP(type) ? \ - ((type) & PSA_KEY_TYPE_SRP_GROUP_MASK) : \ - 0)) - -#define PSA_ALG_CATEGORY_PAKE ((psa_algorithm_t) 0x0a000000) - -/** Whether the specified algorithm is a password-authenticated key exchange. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a password-authenticated key exchange (PAKE) - * algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_PAKE(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_PAKE) - -/** The Password-authenticated key exchange by juggling (J-PAKE) algorithm. - * - * This is J-PAKE as defined by RFC 8236, instantiated with the following - * parameters: - * - * - The group can be either an elliptic curve or defined over a finite field. - * - Schnorr NIZK proof as defined by RFC 8235 and using the same group as the - * J-PAKE algorithm. - * - A cryptographic hash function. - * - * To select these parameters and set up the cipher suite, call these functions - * in any order: - * - * \code - * psa_pake_cs_set_algorithm(cipher_suite, PSA_ALG_JPAKE(hash)); - * psa_pake_cs_set_primitive(cipher_suite, - * PSA_PAKE_PRIMITIVE(type, family, bits)); - * \endcode - * - * For more information on how to set a specific curve or field, refer to the - * documentation of the individual \c PSA_PAKE_PRIMITIVE_TYPE_XXX constants. - * - * After initializing a J-PAKE operation, call - * - * \code - * psa_pake_setup(operation, key, cipher_suite); - * psa_pake_set_user(operation, ...); - * psa_pake_set_peer(operation, ...); - * \endcode - * - * The password is provided as a key. This can be the password text itself, - * in an agreed character encoding, or some value derived from the password - * as required by a higher level protocol. - * - * (The implementation converts the key material to a number as described in - * Section 2.3.8 of _SEC 1: Elliptic Curve Cryptography_ - * (https://www.secg.org/sec1-v2.pdf), before reducing it modulo \c q. Here - * \c q is order of the group defined by the primitive set in the cipher suite. - * The \c psa_pake_setup() function returns an error if the result of the - * reduction is 0.) - * - * The key exchange flow for J-PAKE is as follows: - * -# To get the first round data that needs to be sent to the peer, call - * \code - * // Get g1 - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Get the ZKP public key for x1 - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Get the ZKP proof for x1 - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * // Get g2 - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Get the ZKP public key for x2 - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Get the ZKP proof for x2 - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * \endcode - * -# To provide the first round data received from the peer to the operation, - * call - * \code - * // Set g3 - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Set the ZKP public key for x3 - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Set the ZKP proof for x3 - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * // Set g4 - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Set the ZKP public key for x4 - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Set the ZKP proof for x4 - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * \endcode - * -# To get the second round data that needs to be sent to the peer, call - * \code - * // Get A - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Get ZKP public key for x2*s - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Get ZKP proof for x2*s - * psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * \endcode - * -# To provide the second round data received from the peer to the operation, - * call - * \code - * // Set B - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // Set ZKP public key for x4*s - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); - * // Set ZKP proof for x4*s - * psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); - * \endcode - * -# To access the shared secret call - * \code - * // Get Ka=Kb=K - * psa_pake_get_shared_key() - * \endcode - * - * For more information consult the documentation of the individual - * \c PSA_PAKE_STEP_XXX constants. - * - * At this point there is a cryptographic guarantee that only the authenticated - * party who used the same password is able to compute the key. But there is no - * guarantee that the peer is the party it claims to be and was able to do so. - * - * That is, the authentication is only implicit (the peer is not authenticated - * at this point, and no action should be taken that assume that they are - like - * for example accessing restricted files). - * - * To make the authentication explicit there are various methods, see Section 5 - * of RFC 8236 for two examples. - * - */ -#define PSA_ALG_JPAKE_BASE ((psa_algorithm_t) 0x0a000100) -#define PSA_ALG_JPAKE(hash_alg) (PSA_ALG_JPAKE_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_IS_JPAKE(alg) (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_JPAKE_BASE) - - /** The SPAKE2+ algorithm. - * - * SPAKE2+ is the augmented password-authenticated key exchange protocol, - * defined by RFC9383. SPAKE2+ includes confirmation of the shared secret - * key that results from the key exchange. - * SPAKE2+ is required by Matter Specification, Version 1.2, as MATTER_PAKE. - * Matter uses an earlier draft of the SPAKE2+ protocol: "SPAKE2+, an - * Augmented PAKE (Draft 02)". - * Although the operation of the PAKE is similar for both of these variants, - * they have different key schedules for the derivation of the shared secret. - * - * When setting up a PAKE cipher suite to use the SPAKE2+ protocol defined - * in RFC9383: - * - For cipher-suites that use HMAC for key confirmation, use the - * PSA_ALG_SPAKE2P_HMAC() algorithm, parameterized by the required hash - * algorithm. - * - For cipher-suites that use CMAC-AES-128 for key confirmation, use the - * PSA_ALG_SPAKE2P_CMAC() algorithm, parameterized by the required hash - * algorithm. - * - Use a PAKE primitive for the required elliptic curve. - * - * For example, the following code creates a cipher suite to select SPAKE2+ - * using edwards25519 with the SHA-256 hash function: - * - * \code - * psa_pake_cipher_suite_t cipher_suite = PSA_PAKE_CIPHER_SUITE_INIT; - * psa_pake_cs_set_algorithm(cipher_suite, PSA_ALG_SPAKE2P_HMAC(PSA_ALG_SHA_256)); - * psa_pake_cs_set_primitive(&cipher_suite, - * PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, - * PSA_ECC_FAMILY_TWISTED_EDWARDS, 255)); - * \endcode - * - * When setting up a PAKE cipher suite to use the SPAKE2+ protocol used by - * Matter: - * - Use the PSA_ALG_SPAKE2P_MATTER algorithm. - * - Use the PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, - * PSA_ECC_FAMILY_SECP_R1, 256) - * PAKE primitive. - * - * The following code creates a cipher suite to select the Matter variant of - * SPAKE2+: - * - * \code - * psa_pake_cipher_suite_t cipher_suite = PSA_PAKE_CIPHER_SUITE_INIT; - * psa_pake_cs_set_algorithm(&cipher_suite, PSA_ALG_SPAKE2P_MATTER); - * psa_pake_cs_set_primitive(&cipher_suite, - * PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, - * PSA_ECC_FAMILY_SECP_R1, 256)); - * \endcode - * - * After initializing a SPAKE2+ operation, call - * - * \code - * psa_pake_setup(operation, password, cipher_suite); - * psa_pake_set_role(operation, ...); - * \endcode - * - * The password provided to the client side must be of type - * #PSA_KEY_TYPE_SPAKE2P_KEY_PAIR. - * The password provided to the server side must be of type - * #PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY. - * - * The role set by \c psa_pake_set_role() must be either - * \c PSA_PAKE_ROLE_CLIENT or \c PSA_PAKE_ROLE_SERVER. - * - * Then provide any additional, optional parameters: - * - * \code - * psa_pake_set_user(operation, ...); - * psa_pake_set_peer(operation, ...); - * psa_pake_set_context(operation, ...); - * \endcode - * - * - * The key exchange flow for a SPAKE2+ client is as follows: - * \code - * // send shareP - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // receive shareV - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // receive confirmV - * psa_pake_input(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // send confirmP - * psa_pake_output(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // get K_shared - * psa_pake_get_shared_key(operation, ...); - * \endcode - * - * The key exchange flow for a SPAKE2+ server is as follows: - * \code - * // receive shareP - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // send shareV - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // send confirmV - * psa_pake_output(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // receive confirmP - * psa_pake_input(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // get K_shared - * psa_pake_get_shared_key(operation, ...); - * \endcode - * - * The shared secret that is produced by SPAKE2+ is pseudorandom. Although - * it can be used directly as an encryption key, it is recommended to use - * the shared secret as an input to a key derivation operation to produce - * additional cryptographic keys. - */ -#define PSA_ALG_IS_SPAKE2P_HMAC_BASE ((psa_algorithm_t) 0x0a000400) -#define PSA_ALG_SPAKE2P_HMAC(hash_alg) (PSA_ALG_IS_SPAKE2P_HMAC_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_IS_SPAKE2P_CMAC_BASE ((psa_algorithm_t) 0x0a000500) -#define PSA_ALG_SPAKE2P_CMAC(hash_alg) (PSA_ALG_IS_SPAKE2P_CMAC_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_SPAKE2P_MATTER ((psa_algorithm_t) 0x0A000609) -#define PSA_ALG_IS_SPAKE2P(alg) (((alg) & ~0x000003ff) == PSA_ALG_IS_SPAKE2P_HMAC_BASE) -#define PSA_ALG_IS_SPAKE2P_HMAC(alg) (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_IS_SPAKE2P_HMAC_BASE) -#define PSA_ALG_IS_SPAKE2P_CMAC(alg) (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_IS_SPAKE2P_CMAC_BASE) - - /** The Secure Remote Passwort key exchange (SRP) algorithm. - * - * This is SRP-6 as defined by RFC 2945 and RFC 5054, instantiated with the - * following parameters: - * - * - The group is defined over a finite field using a secure prime. - * - A cryptographic hash function. - * - * To select these parameters and set up the cipher suite, call these functions: - * - * \code - * psa_pake_cipher_suite_t cipher_suite = PSA_PAKE_CIPHER_SUITE_INIT; - * psa_pake_cs_set_algorithm(cipher_suite, PSA_ALG_SRP_6(hash)); - * psa_pake_cs_set_primitive(&cipher_suite, - * PSA_PAKE_PRIMITIVE(type, family, bits)); - * \endcode - * - * After initializing a SRP operation, call: - * - * \code - * psa_pake_setup(operation, password, cipher_suite); - * psa_pake_set_role(operation, ...); - * psa_pake_set_user(operation, ...); - * \endcode - * - * The password provided to the client side must be of type - * #PSA_KEY_TYPE_SRP_KEY_PAIR. - * The password provided to the server side must be of type - * #PSA_KEY_TYPE_SRP_PUBLIC_KEY. - * - * The role set by \c psa_pake_set_role() must be either - * \c PSA_PAKE_ROLE_CLIENT or \c PSA_PAKE_ROLE_SERVER. - * - * For the SRP client key exchange call the following functions in any order: - * \code - * // get salt - * psa_pake_input(operation, #PSA_PAKE_STEP_SALT, ...); - * // get server key - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // write client key - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * \endcode - * - * For the SRP server key exchange call the following functions in any order: - * \code - * // get salt - * psa_pake_input(operation, #PSA_PAKE_STEP_SALT, ...); - * // get client key - * psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * // write server key - * psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); - * \endcode - * - * For the client proof phase call the following functions in this order: - * \code - * // send M1 - * psa_pake_input(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // receive M2 - * psa_pake_output(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // Get secret - * psa_pake_get_shared_key() - * \endcode - * - * For the server proof phase call the following functions in this order: - * \code - * // receive M1 - * psa_pake_output(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // send M2 - * psa_pake_input(operation, #PSA_PAKE_STEP_CONFIRM, ...); - * // Get secret - * psa_pake_get_shared_key() - * \endcode - * - * The shared secret that is produced by SRP is pseudorandom. Although - * it can be used directly as an encryption key, it is recommended to use - * the shared secret as an input to a key derivation operation to produce - * additional cryptographic keys. - */ -#define PSA_ALG_SRP_6_BASE ((psa_algorithm_t) 0x0a000300) -#define PSA_ALG_SRP_6(hash_alg) (PSA_ALG_SRP_6_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_IS_SRP_6(alg) (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_SRP_6_BASE) - -/** @} */ - -/** \defgroup pake Password-authenticated key exchange (PAKE) - * - * This is a proposed PAKE interface for the PSA Crypto API. It is not part of - * the official PSA Crypto API yet. - * - * \note The content of this section is not part of the stable API and ABI - * of Mbed TLS and may change arbitrarily from version to version. - * Same holds for the corresponding macros #PSA_ALG_CATEGORY_PAKE and - * #PSA_ALG_JPAKE. - * @{ - */ - -/** A value to indicate no role in a PAKE algorithm. - * This value can be used in a call to psa_pake_set_role() for symmetric PAKE - * algorithms which do not assign roles. - */ -#define PSA_PAKE_ROLE_NONE ((psa_pake_role_t) 0x00) - -/** The first peer in a balanced PAKE. - * - * Although balanced PAKE algorithms are symmetric, some of them need an - * ordering of peers for the transcript calculations. If the algorithm does not - * need this, both #PSA_PAKE_ROLE_FIRST and #PSA_PAKE_ROLE_SECOND are - * accepted. - */ -#define PSA_PAKE_ROLE_FIRST ((psa_pake_role_t) 0x01) - -/** The second peer in a balanced PAKE. - * - * Although balanced PAKE algorithms are symmetric, some of them need an - * ordering of peers for the transcript calculations. If the algorithm does not - * need this, either #PSA_PAKE_ROLE_FIRST or #PSA_PAKE_ROLE_SECOND are - * accepted. - */ -#define PSA_PAKE_ROLE_SECOND ((psa_pake_role_t) 0x02) - -/** The client in an augmented PAKE. - * - * Augmented PAKE algorithms need to differentiate between client and server. - */ -#define PSA_PAKE_ROLE_CLIENT ((psa_pake_role_t) 0x11) - -/** The server in an augmented PAKE. - * - * Augmented PAKE algorithms need to differentiate between client and server. - */ -#define PSA_PAKE_ROLE_SERVER ((psa_pake_role_t) 0x12) - -/** The PAKE primitive type indicating the use of elliptic curves. - * - * The values of the \c family and \c bits fields of the cipher suite identify a - * specific elliptic curve, using the same mapping that is used for ECC - * (::psa_ecc_family_t) keys. - * - * (Here \c family means the value returned by PSA_PAKE_PRIMITIVE_GET_FAMILY() and - * \c bits means the value returned by PSA_PAKE_PRIMITIVE_GET_BITS().) - * - * Input and output during the operation can involve group elements and scalar - * values: - * -# The format for group elements is the same as for public keys on the - * specific curve would be. For more information, consult the documentation of - * psa_export_public_key(). - * -# The format for scalars is the same as for private keys on the specific - * curve would be. For more information, consult the documentation of - * psa_export_key(). - */ -#define PSA_PAKE_PRIMITIVE_TYPE_ECC ((psa_pake_primitive_type_t) 0x01) - -/** The PAKE primitive type indicating the use of Diffie-Hellman groups. - * - * The values of the \c family and \c bits fields of the cipher suite identify - * a specific Diffie-Hellman group, using the same mapping that is used for - * Diffie-Hellman (::psa_dh_family_t) keys. - * - * (Here \c family means the value returned by PSA_PAKE_PRIMITIVE_GET_FAMILY() and - * \c bits means the value returned by PSA_PAKE_PRIMITIVE_GET_BITS().) - * - * Input and output during the operation can involve group elements and scalar - * values: - * -# The format for group elements is the same as for public keys on the - * specific group would be. For more information, consult the documentation of - * psa_export_public_key(). - * -# The format for scalars is the same as for private keys on the specific - * group would be. For more information, consult the documentation of - * psa_export_key(). - */ -#define PSA_PAKE_PRIMITIVE_TYPE_DH ((psa_pake_primitive_type_t) 0x02) - -/** Construct a PAKE primitive from type, family and bit-size. - * - * \param pake_type The type of the primitive - * (value of type ::psa_pake_primitive_type_t). - * \param pake_family The family of the primitive - * (the type and interpretation of this parameter depends - * on \p pake_type, for more information consult the - * documentation of individual ::psa_pake_primitive_type_t - * constants). - * \param pake_bits The bit-size of the primitive - * (Value of type \c size_t. The interpretation - * of this parameter depends on \p pake_family, for more - * information consult the documentation of individual - * ::psa_pake_primitive_type_t constants). - * - * \return The constructed primitive value of type ::psa_pake_primitive_t. - * Return 0 if the requested primitive can't be encoded as - * ::psa_pake_primitive_t. - */ -#define PSA_PAKE_PRIMITIVE(pake_type, pake_family, pake_bits) \ - (((pake_bits & 0xFFFF) != pake_bits) ? 0 : \ - ((psa_pake_primitive_t) (((pake_type) << 24 | \ - (pake_family) << 16) | (pake_bits)))) - -#define PSA_PAKE_PRIMITIVE_GET_BITS(pake_primitive) \ - ((size_t)(pake_primitive & 0xFFFF)) - -#define PSA_PAKE_PRIMITIVE_GET_FAMILY(pake_primitive) \ - ((psa_pake_family_t)((pake_primitive >> 16) & 0xFF)) - -#define PSA_PAKE_PRIMITIVE_GET_TYPE(pake_primitive) \ - ((psa_pake_primitive_type_t)((pake_primitive >> 24) & 0xFF)) - -/** A key confirmation value that indicates a confirmed key in a PAKE cipher - * suite. - * - * This key confirmation value will result in the PAKE algorithm exchanging - * data to verify that the shared key is identical for both parties. This is - * the default key confirmation value in an initialized PAKE cipher suite - * object. - * Some algorithms do not include confirmation of the shared key. - */ -#define PSA_PAKE_CONFIRMED_KEY 0 - -/** A key confirmation value that indicates an unconfirmed key in a PAKE cipher - * suite. - * - * This key confirmation value will result in the PAKE algorithm terminating - * prior to confirming that the resulting shared key is identical for both - * parties. - * Some algorithms do not support returning an unconfirmed shared key. - */ -#define PSA_PAKE_UNCONFIRMED_KEY 1 - - /** The key share being sent to or received from the peer. - * - * The format for both input and output at this step is the same as for public - * keys on the group determined by the primitive (::psa_pake_primitive_t) would - * be. - * - * For more information on the format, consult the documentation of - * psa_export_public_key(). - * - * For information regarding how the group is determined, consult the - * documentation #PSA_PAKE_PRIMITIVE. - */ -#define PSA_PAKE_STEP_KEY_SHARE ((psa_pake_step_t) 0x01) - -/** A Schnorr NIZKP public key. - * - * This is the ephemeral public key in the Schnorr Non-Interactive - * Zero-Knowledge Proof (the value denoted by the letter 'V' in RFC 8235). - * - * The format for both input and output at this step is the same as for public - * keys on the group determined by the primitive (::psa_pake_primitive_t) would - * be. - * - * For more information on the format, consult the documentation of - * psa_export_public_key(). - * - * For information regarding how the group is determined, consult the - * documentation #PSA_PAKE_PRIMITIVE. - */ -#define PSA_PAKE_STEP_ZK_PUBLIC ((psa_pake_step_t) 0x02) - -/** A Schnorr NIZKP proof. - * - * This is the proof in the Schnorr Non-Interactive Zero-Knowledge Proof (the - * value denoted by the letter 'r' in RFC 8235). - * - * Both for input and output, the value at this step is an integer less than - * the order of the group selected in the cipher suite. The format depends on - * the group as well: - * - * - For Montgomery curves, the encoding is little endian. - * - For everything else the encoding is big endian (see Section 2.3.8 of - * _SEC 1: Elliptic Curve Cryptography_ at https://www.secg.org/sec1-v2.pdf). - * - * In both cases leading zeroes are allowed as long as the length in bytes does - * not exceed the byte length of the group order. - * - * For information regarding how the group is determined, consult the - * documentation #PSA_PAKE_PRIMITIVE. - */ -#define PSA_PAKE_STEP_ZK_PROOF ((psa_pake_step_t) 0x03) - -/** The key confirmation value. - * - * This value is used during the key confirmation phase of a PAKE protocol. - * The format of the value depends on the algorithm and cipher suite: - * - * For SPAKE2+ algorithms, the format for both input and output at this step is - * the same as the output of the MAC algorithm specified in the cipher suite. - * - * For PSA_ALG_SRP_6, the format for both input and output at this step is - * the same as the output of the Hash algorithm specified. - */ -#define PSA_PAKE_STEP_CONFIRM ((psa_pake_step_t)0x04) - -/** The salt. - * - * The format for both input and output at this step is plain binary data. - */ -#define PSA_PAKE_STEP_SALT ((psa_pake_step_t)0x05) - -/** Retrieve the PAKE algorithm from a PAKE cipher suite. - * - * \param[in] cipher_suite The cipher suite structure to query. - * - * \return The PAKE algorithm stored in the cipher suite structure. - */ -static psa_algorithm_t psa_pake_cs_get_algorithm( - const psa_pake_cipher_suite_t *cipher_suite); - -/** Declare the PAKE algorithm for the cipher suite. - * - * This function overwrites any PAKE algorithm - * previously set in \p cipher_suite. - * - * \param[out] cipher_suite The cipher suite structure to write to. - * \param algorithm The PAKE algorithm to write. - * (`PSA_ALG_XXX` values of type ::psa_algorithm_t - * such that #PSA_ALG_IS_PAKE(\c alg) is true.) - * If this is 0, the PAKE algorithm in - * \p cipher_suite becomes unspecified. - */ -static void psa_pake_cs_set_algorithm(psa_pake_cipher_suite_t *cipher_suite, - psa_algorithm_t algorithm); - -/** Retrieve the primitive from a PAKE cipher suite. - * - * \param[in] cipher_suite The cipher suite structure to query. - * - * \return The primitive stored in the cipher suite structure. - */ -static psa_pake_primitive_t psa_pake_cs_get_primitive( - const psa_pake_cipher_suite_t *cipher_suite); - -/** Declare the primitive for a PAKE cipher suite. - * - * This function overwrites any primitive previously set in \p cipher_suite. - * - * \param[out] cipher_suite The cipher suite structure to write to. - * \param primitive The primitive to write. If this is 0, the - * primitive type in \p cipher_suite becomes - * unspecified. - */ -static void psa_pake_cs_set_primitive(psa_pake_cipher_suite_t *cipher_suite, - psa_pake_primitive_t primitive); - -/** The type of the state data structure for PAKE operations. - * - * Before calling any function on a PAKE operation object, the application - * must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_pake_operation_t operation; - * memset(&operation, 0, sizeof(operation)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_pake_operation_t operation = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_PAKE_OPERATION_INIT, - * for example: - * \code - * psa_pake_operation_t operation = PSA_PAKE_OPERATION_INIT; - * \endcode - * - Assign the result of the function psa_pake_operation_init() - * to the structure, for example: - * \code - * psa_pake_operation_t operation; - * operation = psa_pake_operation_init(); - * \endcode - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. */ -typedef struct psa_pake_operation_s psa_pake_operation_t; - -/** Return an initial value for a PAKE operation object. - */ -static psa_pake_operation_t psa_pake_operation_init(void); - -/** Set the session information for a password-authenticated key exchange. - * - * The sequence of operations to set up a password-authenticated key exchange - * is as follows: - * -# Allocate an operation object which will be passed to all the functions - * listed here. - * -# Initialize the operation object with one of the methods described in the - * documentation for #psa_pake_operation_t, e.g. - * #PSA_PAKE_OPERATION_INIT. - * -# Call psa_pake_setup() to specify the password key and the cipher suite. - * -# Call \c psa_pake_set_xxx() functions on the operation to complete the - * setup. The exact sequence of \c psa_pake_set_xxx() functions that needs - * to be called depends on the algorithm in use. - * - * Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` - * values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) - * for more information. - * - * A typical sequence of calls to perform a password-authenticated key - * exchange: - * -# Call psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...) to get the - * key share that needs to be sent to the peer. - * -# Call psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...) to provide - * the key share that was received from the peer. - * -# Depending on the algorithm additional calls to psa_pake_output() and - * psa_pake_input() might be necessary. - * -# Call psa_pake_get_shared_key() for accessing the shared secret. - * - * Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` - * values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) - * for more information. - * - * If an error occurs at any step after a call to psa_pake_setup(), - * the operation will need to be reset by a call to psa_pake_abort(). The - * application may call psa_pake_abort() at any time after the operation - * has been initialized. - * - * After a successful call to psa_pake_setup(), the application must - * eventually terminate the operation. The following events terminate an - * operation: - * - A call to psa_pake_abort(). - * - A successful call to psa_pake_get_shared_key(). - * - * \param[in,out] operation The operation object to set up. It must have - * been initialized but not set up yet. - * \param[in] password_key Identifier of the key holding the password or - * a value derived from the password. It must - * remain valid until the operation terminates. - * The valid key types depend on the PAKE algorithm, - * and participant role. - * \param[in] cipher_suite The cipher suite to use. (A cipher suite fully - * characterizes a PAKE algorithm and determines - * the algorithm as well.) - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_HANDLE - * \p password_key is not a valid key identifier. - * \retval #PSA_ERROR_NOT_PERMITTED - * The key does not have the #PSA_KEY_USAGE_DERIVE flag, or it does not - * permit the \p operation's algorithm. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The algorithm in \p cipher_suite is not a PAKE algorithm or encodes - * an invalid hash algorithm, or the PAKE primitive in \p cipher_suite - * is not compatible with the PAKE algorithm, or the key confirmation - * value in \p cipher_suite is not compatible with the PAKE algorithm - * and primitive, or the \p password_key is not compatible with - * \p cipher_suite. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The algorithm in \p cipher_suite is not a supported PAKE algorithm, - * or the PAKE primitive in \p cipher_suite is not supported or not - * compatible with the PAKE algorithm, or the key confirmation value - * in \p cipher_suite is not supported or not compatible with the PAKE - * algorithm and primitive, or the key type or key size of - * \p password_key is not supported with \p cipher_suite. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid, or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_setup(psa_pake_operation_t *operation, - mbedtls_svc_key_id_t password_key, - const psa_pake_cipher_suite_t *cipher_suite); - -/** Set the application role for a password-authenticated key exchange. -* -* Not all PAKE algorithms need to differentiate the communicating entities. -* It is optional to call this function for PAKEs that don't require a role -* to be specified. For such PAKEs the application role parameter is ignored, -* or #PSA_PAKE_ROLE_NONE can be passed as \c role. -* -* Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` -* values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) -* for more information. -* -* \param[in,out] operation The operation object to specify the -* application's role for. It must have been set up -* by psa_pake_setup() and not yet in use (neither -* psa_pake_output() nor psa_pake_input() has been -* called yet). It must be an operation for which -* the application's role hasn't been specified -* (psa_pake_set_role() hasn't been called yet). -* \param role A value of type ::psa_pake_role_t indicating the -* application's role in the PAKE algorithm -* that is being set up. For more information see -* the documentation of \c PSA_PAKE_ROLE_XXX -* constants. -* -* \retval #PSA_SUCCESS -* Success. -* \retval #PSA_ERROR_INVALID_ARGUMENT -* The \p role is not a valid PAKE role in the \p operation’s algorithm. -* \retval #PSA_ERROR_NOT_SUPPORTED -* The \p role for this algorithm is not supported or is not valid. -* \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription -* \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription -* \retval #PSA_ERROR_BAD_STATE -* The operation state is not valid, or -* the library has not been previously initialized by psa_crypto_init(). -* It is implementation-dependent whether a failure to initialize -* results in this error code. -*/ -psa_status_t psa_pake_set_role(psa_pake_operation_t *operation, - psa_pake_role_t role); - -/** Set the user ID for a password-authenticated key exchange. - * - * Call this function to set the user ID. For PAKE algorithms that associate a - * user identifier with each side of the session you need to call - * psa_pake_set_peer() as well. For PAKE algorithms that associate a single - * user identifier with the session, call psa_pake_set_user() only. - * - * Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` - * values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) - * for more information. - * - * \param[in,out] operation The operation object to set the user ID for. It - * must have been set up by psa_pake_setup() and - * not yet in use (neither psa_pake_output() nor - * psa_pake_input() has been called yet). It must - * be on operation for which the user ID hasn't - * been set (psa_pake_set_user() hasn't been - * called yet). - * \param[in] user_id The user ID to authenticate with. - * \param user_id_len Size of the \p user_id buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p user_id is not valid for the \p operation's algorithm and cipher - * suite. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The value of \p user_id is not supported by the implementation. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid, or - * the library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_set_user(psa_pake_operation_t *operation, - const uint8_t *user_id, - size_t user_id_len); - -/** Set the peer ID for a password-authenticated key exchange. - * - * Call this function in addition to psa_pake_set_user() for PAKE algorithms - * that associate a user identifier with each side of the session. For PAKE - * algorithms that associate a single user identifier with the session, call - * psa_pake_set_user() only. - * - * Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` - * values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) - * for more information. - * - * \param[in,out] operation The operation object to set the peer ID for. It - * must have been set up by psa_pake_setup() and - * not yet in use (neither psa_pake_output() nor - * psa_pake_input() has been called yet). It must - * be on operation for which the peer ID hasn't - * been set (psa_pake_set_peer() hasn't been - * called yet). - * \param[in] peer_id The peer's ID to authenticate. - * \param peer_id_len Size of the \p peer_id buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p peer_id is not valid for the \p operation's algorithm and cipher - * suite. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The algorithm doesn't associate a second identity with the session. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * Calling psa_pake_set_peer() is invalid with the \p operation's - * algorithm, the operation state is not valid, or the library has not - * been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_set_peer(psa_pake_operation_t *operation, - const uint8_t *peer_id, - size_t peer_id_len); - -/** Set the context data for a password-authenticated key exchange. - * - * Call this function for PAKE algorithms that accept additional context data - * as part of the protocol setup. - * - * Refer to the documentation of individual PAKE algorithm types (`PSA_ALG_XXX` - * values of type ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) - * for more information. - * - * \param[in,out] operation The operation object to set the context for. It - * must have been set up by psa_pake_setup() and - * not yet in use (neither psa_pake_output() nor - * psa_pake_input() has been called yet). It must - * be on operation for which the context hasn't - * been set (psa_pake_set_context() hasn't been - * called yet). - * \param[in] context The context. - * \param context_len Size of the \p context buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The \p context is not valid for the operation’s algorithm and cipher suite. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The \p context is not supported by the implementation. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * Calling psa_pake_set_context() is invalid with the \p operation's - * algorithm, the operation state is not valid, or the library has not - * been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_set_context(psa_pake_operation_t *operation, - const uint8_t *context, - size_t context_len); - -/** Get output for a step of a password-authenticated key exchange. - * - * Depending on the algorithm being executed, you might need to call this - * function several times or you might not need to call this at all. - * - * The exact sequence of calls to perform a password-authenticated key - * exchange depends on the algorithm in use. Refer to the documentation of - * individual PAKE algorithm types (`PSA_ALG_XXX` values of type - * ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) for more - * information. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_pake_abort(). - * - * \param[in,out] operation Active PAKE operation. - * \param step The step of the algorithm for which the output - * is requested. - * \param[out] output Buffer where the output is to be written in the - * format appropriate for this \p step. Refer to - * the documentation of the individual - * \c PSA_PAKE_STEP_XXX constants for more - * information. - * \param output_size Size of the \p output buffer in bytes. This must - * be at least #PSA_PAKE_OUTPUT_SIZE(\c alg, \c - * primitive, \p output_step) where \c alg and - * \p primitive are the PAKE algorithm and primitive - * in the operation's cipher suite, and \p step is - * the output step. - * - * \param[out] output_length On success, the number of bytes of the returned - * output. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p output buffer is too small. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p step is not compatible with the operation's algorithm. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p step is not supported with the operation's algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, and fully set - * up, and this call must conform to the algorithm's requirements - * for ordering of input and output steps), or the library has not - * been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_output(psa_pake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/** Provide input for a step of a password-authenticated key exchange. - * - * Depending on the algorithm being executed, you might need to call this - * function several times or you might not need to call this at all. - * - * The exact sequence of calls to perform a password-authenticated key - * exchange depends on the algorithm in use. Refer to the documentation of - * individual PAKE algorithm types (`PSA_ALG_XXX` values of type - * ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) for more - * information. - * - * If this function returns an error status, the operation enters an error - * state and must be aborted by calling psa_pake_abort(). - * - * \param[in,out] operation Active PAKE operation. - * \param step The step for which the input is provided. - * \param[in] input Buffer containing the input in the format - * appropriate for this \p step. Refer to the - * documentation of the individual - * \c PSA_PAKE_STEP_XXX constants for more - * information. - * \param input_length Size of the \p input buffer in bytes. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The verification fails for a #PSA_PAKE_STEP_ZK_PROOF input step. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p step is not compatible with the operation's algorithm, or - * \p input_length is not compatible with the \p operation’s algorithm, - * or the \p input is not valid for the \p operation's algorithm, - * cipher suite or \p step. - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p step is not supported with the operation's algorithm, or - * \p step p is not supported with the \p operation's algorithm, or the - * \p input is not supported for the \p operation's algorithm, cipher - * suite or \p step. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The operation state is not valid (it must be active, and fully set - * up, and this call must conform to the algorithm's requirements - * for ordering of input and output steps), or the library has not - * been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_input(psa_pake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, - size_t input_length); - -/** Get shared secret from a PAKE. - * - * This is the final call in a PAKE operation, which retrieves the shared - * secret as a key. It is recommended that this key is used as an input to a - * key derivation operation to produce additional cryptographic keys. For - * some PAKE algorithms, the shared secret is also suitable for use as a key - * in cryptographic operations such as encryption. Refer to the documentation - * of individual PAKE algorithm types (`PSA_ALG_XXX` values of type - * ::psa_algorithm_t such that #PSA_ALG_IS_PAKE(\c alg) is true) for more - * information. - * - * Depending on the key confirmation requested in the cipher suite, - * psa_pake_get_shared_key() must be called either before or after the - * key-confirmation output and input steps for the PAKE algorithm. The key - * confirmation affects the guarantees that can be made about the shared key: - * - * Unconfirmed key - * If the cipher suite used to set up the operation requested an unconfirmed - * key, the application must call psa_pake_get_shared_key() after the - * key-exchange output and input steps are completed. The PAKE algorithm - * provides a cryptographic guarantee that only a peer who used the same - * password, and identity inputs, is able to compute the same key. However, - * there is no guarantee that the peer is the participant it claims to be, - * and was able to compute the same key. - * Since the peer is not authenticated, no action should be taken that assumes - * that the peer is who it claims to be. For example, do not access restricted - * files on the peer’s behalf until an explicit authentication has succeeded. - * Note: - * Some PAKE algorithms do not enable the output of the shared secret until it - * has been confirmed. - * - * Confirmed key - * If the cipher suite used to set up the operation requested a confirmed key, - * the application must call psa_pake_get_shared_key() after the key-exchange - * and key-confirmation output and input steps are completed. - * Following key confirmation, the PAKE algorithm provides a cryptographic - * guarantee that the peer used the same password and identity inputs, and has - * computed the identical shared secret key. - * Since the peer is not authenticated, no action should be taken that assumes - * that the peer is who it claims to be. For example, do not access restricted - * files on the peer’s behalf until an explicit authentication has succeeded. - * Note: - * Some PAKE algorithms do not include any key-confirmation steps. - * - * The exact sequence of calls to perform a password-authenticated key - * exchange depends on the algorithm in use. - * - * When this function returns successfully, \p operation becomes inactive. - * If this function returns an error status, both \p operation - * and \c key_derivation operations enter an error state and must be aborted - * by calling psa_pake_abort(). - * - * \param[in,out] operation Active PAKE operation. - * \param[in] attributes The attributes for the new key. - * \param[out] key On success, an identifier for the newly created - * key. #PSA_KEY_ID_NULL on failure. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_NOT_PERMITTED - * The implementation does not permit creating a key with the - * specified attributes due to some implementation-specific policy. - * \retval #PSA_ERROR_ALREADY_EXISTS - * This is an attempt to create a persistent key, and there is - * already a persistent key with the given identifier. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key type is not valid for output from this operation’s - * algorithm, or the key size is nonzero, or the key lifetime is - * invalid, the key identifier is not valid for the key lifetime, - * or the key usage flags include invalid values, or the key’s - * permitted-usage algorithm is invalid, or the key attributes, - * as a whole, are invalid. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The key attributes, as a whole, are not supported for creation - * from a PAKE secret, either by the implementation in general or - * in the specified storage location. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The PAKE operation state is not valid (it must be ready to return - * the shared secret), or the library has not been previously - * initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_get_shared_key(psa_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t *key); - -/** Abort a PAKE operation. - * - * Aborting an operation frees all associated resources except for the \c - * operation structure itself. Once aborted, the operation object can be reused - * for another operation by calling psa_pake_setup() again. - * - * This function may be called at any time after the operation - * object has been initialized as described in #psa_pake_operation_t. - * - * In particular, calling psa_pake_abort() after the operation has been - * terminated by a call to psa_pake_abort() or psa_pake_get_shared_key() - * is safe and has no effect. - * - * \param[in,out] operation The operation to abort. - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_BAD_STATE - * The library has not been previously initialized by psa_crypto_init(). - * It is implementation-dependent whether a failure to initialize - * results in this error code. - */ -psa_status_t psa_pake_abort(psa_pake_operation_t *operation); - -/**@}*/ - -/** A sufficient output buffer size for psa_pake_output(). - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_pake_output() will not fail due to an insufficient output buffer - * size. The actual size of the output might be smaller in any given call. - * - * See also #PSA_PAKE_OUTPUT_MAX_SIZE - * - * \param alg A PAKE algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_PAKE(\p alg) is true). - * \param primitive A primitive of type ::psa_pake_primitive_t that is - * compatible with algorithm \p alg. - * \param output_step A value of type ::psa_pake_step_t that is valid for the - * algorithm \p alg. - * \return A sufficient output buffer size for the specified - * PAKE algorithm, primitive, and output step. If the - * PAKE algorithm, primitive, or output step is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_PAKE_OUTPUT_SIZE(alg, primitive, output_step) \ - (output_step == PSA_PAKE_STEP_KEY_SHARE ? \ - PSA_PAKE_PRIMITIVE_GET_TYPE(primitive) == PSA_PAKE_PRIMITIVE_TYPE_DH ? \ - PSA_BITS_TO_BYTES(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - output_step == PSA_PAKE_STEP_ZK_PUBLIC ? \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - output_step == PSA_PAKE_STEP_ZK_PROOF ? \ - PSA_BITS_TO_BYTES(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - output_step == PSA_PAKE_STEP_CONFIRM ? \ - PSA_ALG_IS_SPAKE2P_CMAC(alg) ? \ - PSA_MAC_LENGTH(PSA_KEY_TYPE_AES, 128, PSA_ALG_CMAC) : \ - PSA_HASH_LENGTH(alg) : \ - 0u) - -/** A sufficient input buffer size for psa_pake_input(). - * - * The value returned by this macro is guaranteed to be large enough for any - * valid input to psa_pake_input() in an operation with the specified - * parameters. - * - * See also #PSA_PAKE_INPUT_MAX_SIZE - * - * \param alg A PAKE algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_PAKE(\p alg) is true). - * \param primitive A primitive of type ::psa_pake_primitive_t that is - * compatible with algorithm \p alg. - * \param input_step A value of type ::psa_pake_step_t that is valid for the - * algorithm \p alg. - * \return A sufficient input buffer size for the specified - * input, cipher suite and algorithm. If the cipher suite, - * the input type or PAKE algorithm is not recognized, or - * the parameters are incompatible, return 0. - */ -#define PSA_PAKE_INPUT_SIZE(alg, primitive, input_step) \ - (input_step == PSA_PAKE_STEP_KEY_SHARE ? \ - PSA_PAKE_PRIMITIVE_GET_TYPE(primitive) == PSA_PAKE_PRIMITIVE_TYPE_DH ? \ - PSA_BITS_TO_BYTES(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - input_step == PSA_PAKE_STEP_ZK_PUBLIC ? \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - input_step == PSA_PAKE_STEP_ZK_PROOF ? \ - PSA_BITS_TO_BYTES(PSA_PAKE_PRIMITIVE_GET_BITS(primitive)) : \ - input_step == PSA_PAKE_STEP_CONFIRM ? \ - PSA_ALG_IS_SPAKE2P_CMAC(alg) ? \ - PSA_MAC_LENGTH(PSA_KEY_TYPE_AES, 128, PSA_ALG_CMAC) : \ - PSA_HASH_LENGTH(alg) : \ - input_step == PSA_PAKE_STEP_SALT ? \ - 64u : \ - 0u) - -/** Output buffer size for psa_pake_output() for any of the supported PAKE - * algorithm and primitive suites and output step. - * - * This macro must expand to a compile-time constant integer. - * - * The value of this macro must be at least as large as the largest value - * returned by PSA_PAKE_OUTPUT_SIZE() - * - * See also #PSA_PAKE_OUTPUT_SIZE(\p alg, \p primitive, \p output_step). - */ -#ifdef PSA_WANT_ALG_SRP_6 -#define PSA_PAKE_OUTPUT_MAX_SIZE PSA_BITS_TO_BYTES(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#else -#define PSA_PAKE_OUTPUT_MAX_SIZE PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif - -/** Input buffer size for psa_pake_input() for any of the supported PAKE - * algorithm and primitive suites and input step. - * - * This macro must expand to a compile-time constant integer. - * - * The value of this macro must be at least as large as the largest value - * returned by PSA_PAKE_INPUT_SIZE() - * - * See also #PSA_PAKE_INPUT_SIZE(\p alg, \p primitive, \p output_step). - */ -#ifdef PSA_WANT_ALG_SRP_6 -#define PSA_PAKE_INPUT_MAX_SIZE PSA_BITS_TO_BYTES(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#else -#define PSA_PAKE_INPUT_MAX_SIZE PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif - -static inline psa_algorithm_t psa_pake_cs_get_algorithm( - const psa_pake_cipher_suite_t *cipher_suite) -{ - return cipher_suite->algorithm; -} - -static inline void psa_pake_cs_set_algorithm( - psa_pake_cipher_suite_t *cipher_suite, - psa_algorithm_t algorithm) -{ - if (!PSA_ALG_IS_PAKE(algorithm)) { - cipher_suite->algorithm = 0; - } else { - cipher_suite->algorithm = algorithm; - } -} - -static inline psa_pake_primitive_t psa_pake_cs_get_primitive( - const psa_pake_cipher_suite_t *cipher_suite) -{ - return cipher_suite->primitive; -} - -static inline void psa_pake_cs_set_primitive( - psa_pake_cipher_suite_t *cipher_suite, - psa_pake_primitive_t primitive) -{ - cipher_suite->primitive = primitive; -} - -static inline uint32_t psa_pake_cs_get_key_confirmation( - const psa_pake_cipher_suite_t* cipher_suite) -{ - return cipher_suite->key_confirmation; -} - -static inline void psa_pake_cs_set_key_confirmation( - psa_pake_cipher_suite_t* cipher_suite, - uint32_t key_confirmation) -{ - cipher_suite->key_confirmation = key_confirmation; -} - - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_EXTRA_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_legacy.h b/ext/oberon/psa/core/include/psa/crypto_legacy.h deleted file mode 100644 index 4a39b3dbf688..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_legacy.h +++ /dev/null @@ -1,100 +0,0 @@ -/** - * \file psa/crypto_legacy.h - * - * \brief Add temporary suppport for deprecated symbols before they are - * removed from the library. - * - * PSA_WANT_KEY_TYPE_xxx_KEY_PAIR and MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR - * symbols are deprecated. - * New symols add a suffix to that base name in order to clearly state what is - * the expected use for the key (use, import, export, generate, derive). - * Here we define some backward compatibility support for uses stil using - * the legacy symbols. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_PSA_CRYPTO_LEGACY_H -#define MBEDTLS_PSA_CRYPTO_LEGACY_H - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) //no-check-names -#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE) -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE 1 -#endif -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) //no-check-names -#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT) -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT 1 -#endif -#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT) -#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT 1 -#endif -//#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) /* !!OM */ -//#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE 1 -//#endif -#endif - -#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) //no-check-names -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE -#endif -#endif - -#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) //no-check-names -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT -#endif -#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE) -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE -#endif -#endif - -#endif /* MBEDTLS_PSA_CRYPTO_LEGACY_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_platform.h b/ext/oberon/psa/core/include/psa/crypto_platform.h deleted file mode 100644 index e2fc84c04cf4..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_platform.h +++ /dev/null @@ -1,114 +0,0 @@ -/** - * \file psa/crypto_platform.h - * - * \brief PSA cryptography module: Mbed TLS platform definitions - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. - * - * This file contains platform-dependent type definitions. - * - * In implementations with isolation between the application and the - * cryptography module, implementers should take care to ensure that - * the definitions that are exposed to applications match what the - * module implements. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_PLATFORM_H -#define PSA_CRYPTO_PLATFORM_H -#include "mbedtls/private_access.h" - -/* - * Include the build-time configuration information file. Here, we do not - * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which - * is basically just an alias to it. This is to ease the maintenance of the - * PSA cryptography repository which has a different build system and - * configuration. - */ -#include "psa/build_info.h" - -/* PSA requires several types which C99 provides in stdint.h. */ -#include - -#if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) - -/* Building for the PSA Crypto service on a PSA platform, a key owner is a PSA - * partition identifier. - * - * The function psa_its_identifier_of_slot() in psa_crypto_storage.c that - * translates a key identifier to a key storage file name assumes that - * mbedtls_key_owner_id_t is a 32-bit integer. This function thus needs - * reworking if mbedtls_key_owner_id_t is not defined as a 32-bit integer - * here anymore. - */ -typedef int32_t mbedtls_key_owner_id_t; - -/** Compare two key owner identifiers. - * - * \param id1 First key owner identifier. - * \param id2 Second key owner identifier. - * - * \return Non-zero if the two key owner identifiers are equal, zero otherwise. - */ -static inline int mbedtls_key_owner_id_equal(mbedtls_key_owner_id_t id1, - mbedtls_key_owner_id_t id2) -{ - return id1 == id2; -} - -#endif /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */ - -/* - * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is being built for SPM - * (Secure Partition Manager) integration which separates the code into two - * parts: NSPE (Non-Secure Processing Environment) and SPE (Secure Processing - * Environment). When building for the SPE, an additional header file should be - * included. - */ -#if defined(MBEDTLS_PSA_CRYPTO_SPM) -#define PSA_CRYPTO_SECURE 1 -#include "crypto_spe.h" -#endif // MBEDTLS_PSA_CRYPTO_SPM - -#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) -/** The type of the context passed to mbedtls_psa_external_get_random(). - * - * Mbed TLS initializes the context to all-bits-zero before calling - * mbedtls_psa_external_get_random() for the first time. - * - * The definition of this type in the Mbed TLS source code is for - * demonstration purposes. Implementers of mbedtls_psa_external_get_random() - * are expected to replace it with a custom definition. - */ -typedef struct { - uintptr_t MBEDTLS_PRIVATE(opaque)[2]; -} mbedtls_psa_external_random_context_t; -#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ - -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) -/** The type of the client handle used in context structures - * - * When a client view of the multipart context structures is required, - * this handle is used to keep a mapping with the service side of the - * context which contains the actual data. - */ -typedef uint32_t mbedtls_psa_client_handle_t; -#endif - -#endif /* PSA_CRYPTO_PLATFORM_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_se_driver.h b/ext/oberon/psa/core/include/psa/crypto_se_driver.h deleted file mode 100644 index f39e2294cd2c..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_se_driver.h +++ /dev/null @@ -1,1395 +0,0 @@ -/** - * \file psa/crypto_se_driver.h - * \brief PSA external cryptoprocessor driver module - * - * This header declares types and function signatures for cryptography - * drivers that access key material via opaque references. - * This is meant for cryptoprocessors that have a separate key storage from the - * space in which the PSA Crypto implementation runs, typically secure - * elements (SEs). - * - * This file is part of the PSA Crypto Driver HAL (hardware abstraction layer), - * containing functions for driver developers to implement to enable hardware - * to be called in a standardized way by a PSA Cryptography API - * implementation. The functions comprising the driver HAL, which driver - * authors implement, are not intended to be called by application developers. - */ - -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PSA_CRYPTO_SE_DRIVER_H -#define PSA_CRYPTO_SE_DRIVER_H -#include "mbedtls/private_access.h" - -#include "crypto_driver_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** \defgroup se_init Secure element driver initialization - */ -/**@{*/ - -/** \brief Driver context structure - * - * Driver functions receive a pointer to this structure. - * Each registered driver has one instance of this structure. - * - * Implementations must include the fields specified here and - * may include other fields. - */ -typedef struct { - /** A read-only pointer to the driver's persistent data. - * - * Drivers typically use this persistent data to keep track of - * which slot numbers are available. This is only a guideline: - * drivers may use the persistent data for any purpose, keeping - * in mind the restrictions on when the persistent data is saved - * to storage: the persistent data is only saved after calling - * certain functions that receive a writable pointer to the - * persistent data. - * - * The core allocates a memory buffer for the persistent data. - * The pointer is guaranteed to be suitably aligned for any data type, - * like a pointer returned by `malloc` (but the core can use any - * method to allocate the buffer, not necessarily `malloc`). - * - * The size of this buffer is in the \c persistent_data_size field of - * this structure. - * - * Before the driver is initialized for the first time, the content of - * the persistent data is all-bits-zero. After a driver upgrade, if the - * size of the persistent data has increased, the original data is padded - * on the right with zeros; if the size has decreased, the original data - * is truncated to the new size. - * - * This pointer is to read-only data. Only a few driver functions are - * allowed to modify the persistent data. These functions receive a - * writable pointer. These functions are: - * - psa_drv_se_t::p_init - * - psa_drv_se_key_management_t::p_allocate - * - psa_drv_se_key_management_t::p_destroy - * - * The PSA Cryptography core saves the persistent data from one - * session to the next. It does this before returning from API functions - * that call a driver method that is allowed to modify the persistent - * data, specifically: - * - psa_crypto_init() causes a call to psa_drv_se_t::p_init, and may call - * psa_drv_se_key_management_t::p_destroy to complete an action - * that was interrupted by a power failure. - * - Key creation functions cause a call to - * psa_drv_se_key_management_t::p_allocate, and may cause a call to - * psa_drv_se_key_management_t::p_destroy in case an error occurs. - * - psa_destroy_key() causes a call to - * psa_drv_se_key_management_t::p_destroy. - */ - const void *const MBEDTLS_PRIVATE(persistent_data); - - /** The size of \c persistent_data in bytes. - * - * This is always equal to the value of the `persistent_data_size` field - * of the ::psa_drv_se_t structure when the driver is registered. - */ - const size_t MBEDTLS_PRIVATE(persistent_data_size); - - /** Driver transient data. - * - * The core initializes this value to 0 and does not read or modify it - * afterwards. The driver may store whatever it wants in this field. - */ - uintptr_t MBEDTLS_PRIVATE(transient_data); -} psa_drv_se_context_t; - -/** \brief A driver initialization function. - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] persistent_data A pointer to the persistent data - * that allows writing. - * \param location The location value for which this driver - * is registered. The driver will be invoked - * for all keys whose lifetime is in this - * location. - * - * \retval #PSA_SUCCESS - * The driver is operational. - * The core will update the persistent data in storage. - * \return - * Any other return value prevents the driver from being used in - * this session. - * The core will NOT update the persistent data in storage. - */ -typedef psa_status_t (*psa_drv_se_init_t)(psa_drv_se_context_t *drv_context, - void *persistent_data, - psa_key_location_t location); - -#if defined(__DOXYGEN_ONLY__) || !defined(MBEDTLS_PSA_CRYPTO_SE_C) -/* Mbed TLS with secure element support enabled defines this type in - * crypto_types.h because it is also visible to applications through an - * implementation-specific extension. - * For the PSA Cryptography specification, this type is only visible - * via crypto_se_driver.h. */ -/** An internal designation of a key slot between the core part of the - * PSA Crypto implementation and the driver. The meaning of this value - * is driver-dependent. */ -typedef uint64_t psa_key_slot_number_t; -#endif /* __DOXYGEN_ONLY__ || !MBEDTLS_PSA_CRYPTO_SE_C */ - -/**@}*/ - -/** \defgroup se_mac Secure Element Message Authentication Codes - * Generation and authentication of Message Authentication Codes (MACs) using - * a secure element can be done either as a single function call (via the - * `psa_drv_se_mac_generate_t` or `psa_drv_se_mac_verify_t` functions), or in - * parts using the following sequence: - * - `psa_drv_se_mac_setup_t` - * - `psa_drv_se_mac_update_t` - * - `psa_drv_se_mac_update_t` - * - ... - * - `psa_drv_se_mac_finish_t` or `psa_drv_se_mac_finish_verify_t` - * - * If a previously started secure element MAC operation needs to be terminated, - * it should be done so by the `psa_drv_se_mac_abort_t`. Failure to do so may - * result in allocated resources not being freed or in other undefined - * behavior. - */ -/**@{*/ -/** \brief A function that starts a secure element MAC operation for a PSA - * Crypto Driver implementation - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] op_context A structure that will contain the - * hardware-specific MAC context - * \param[in] key_slot The slot of the key to be used for the - * operation - * \param[in] algorithm The algorithm to be used to underly the MAC - * operation - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_mac_setup_t)(psa_drv_se_context_t *drv_context, - void *op_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t algorithm); - -/** \brief A function that continues a previously started secure element MAC - * operation - * - * \param[in,out] op_context A hardware-specific structure for the - * previously-established MAC operation to be - * updated - * \param[in] p_input A buffer containing the message to be appended - * to the MAC operation - * \param[in] input_length The size in bytes of the input message buffer - */ -typedef psa_status_t (*psa_drv_se_mac_update_t)(void *op_context, - const uint8_t *p_input, - size_t input_length); - -/** \brief a function that completes a previously started secure element MAC - * operation by returning the resulting MAC. - * - * \param[in,out] op_context A hardware-specific structure for the - * previously started MAC operation to be - * finished - * \param[out] p_mac A buffer where the generated MAC will be - * placed - * \param[in] mac_size The size in bytes of the buffer that has been - * allocated for the `output` buffer - * \param[out] p_mac_length After completion, will contain the number of - * bytes placed in the `p_mac` buffer - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_mac_finish_t)(void *op_context, - uint8_t *p_mac, - size_t mac_size, - size_t *p_mac_length); - -/** \brief A function that completes a previously started secure element MAC - * operation by comparing the resulting MAC against a provided value - * - * \param[in,out] op_context A hardware-specific structure for the previously - * started MAC operation to be finished - * \param[in] p_mac The MAC value against which the resulting MAC - * will be compared against - * \param[in] mac_length The size in bytes of the value stored in `p_mac` - * - * \retval #PSA_SUCCESS - * The operation completed successfully and the MACs matched each - * other - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The operation completed successfully, but the calculated MAC did - * not match the provided MAC - */ -typedef psa_status_t (*psa_drv_se_mac_finish_verify_t)(void *op_context, - const uint8_t *p_mac, - size_t mac_length); - -/** \brief A function that aborts a previous started secure element MAC - * operation - * - * \param[in,out] op_context A hardware-specific structure for the previously - * started MAC operation to be aborted - */ -typedef psa_status_t (*psa_drv_se_mac_abort_t)(void *op_context); - -/** \brief A function that performs a secure element MAC operation in one - * command and returns the calculated MAC - * - * \param[in,out] drv_context The driver context structure. - * \param[in] p_input A buffer containing the message to be MACed - * \param[in] input_length The size in bytes of `p_input` - * \param[in] key_slot The slot of the key to be used - * \param[in] alg The algorithm to be used to underlie the MAC - * operation - * \param[out] p_mac A buffer where the generated MAC will be - * placed - * \param[in] mac_size The size in bytes of the `p_mac` buffer - * \param[out] p_mac_length After completion, will contain the number of - * bytes placed in the `output` buffer - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_mac_generate_t)(psa_drv_se_context_t *drv_context, - const uint8_t *p_input, - size_t input_length, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - uint8_t *p_mac, - size_t mac_size, - size_t *p_mac_length); - -/** \brief A function that performs a secure element MAC operation in one - * command and compares the resulting MAC against a provided value - * - * \param[in,out] drv_context The driver context structure. - * \param[in] p_input A buffer containing the message to be MACed - * \param[in] input_length The size in bytes of `input` - * \param[in] key_slot The slot of the key to be used - * \param[in] alg The algorithm to be used to underlie the MAC - * operation - * \param[in] p_mac The MAC value against which the resulting MAC will - * be compared against - * \param[in] mac_length The size in bytes of `mac` - * - * \retval #PSA_SUCCESS - * The operation completed successfully and the MACs matched each - * other - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The operation completed successfully, but the calculated MAC did - * not match the provided MAC - */ -typedef psa_status_t (*psa_drv_se_mac_verify_t)(psa_drv_se_context_t *drv_context, - const uint8_t *p_input, - size_t input_length, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_mac, - size_t mac_length); - -/** \brief A struct containing all of the function pointers needed to - * perform secure element MAC operations - * - * PSA Crypto API implementations should populate the table as appropriate - * upon startup. - * - * If one of the functions is not implemented (such as - * `psa_drv_se_mac_generate_t`), it should be set to NULL. - * - * Driver implementers should ensure that they implement all of the functions - * that make sense for their hardware, and that they provide a full solution - * (for example, if they support `p_setup`, they should also support - * `p_update` and at least one of `p_finish` or `p_finish_verify`). - * - */ -typedef struct { - /**The size in bytes of the hardware-specific secure element MAC context - * structure - */ - size_t MBEDTLS_PRIVATE(context_size); - /** Function that performs a MAC setup operation - */ - psa_drv_se_mac_setup_t MBEDTLS_PRIVATE(p_setup); - /** Function that performs a MAC update operation - */ - psa_drv_se_mac_update_t MBEDTLS_PRIVATE(p_update); - /** Function that completes a MAC operation - */ - psa_drv_se_mac_finish_t MBEDTLS_PRIVATE(p_finish); - /** Function that completes a MAC operation with a verify check - */ - psa_drv_se_mac_finish_verify_t MBEDTLS_PRIVATE(p_finish_verify); - /** Function that aborts a previously started MAC operation - */ - psa_drv_se_mac_abort_t MBEDTLS_PRIVATE(p_abort); - /** Function that performs a MAC operation in one call - */ - psa_drv_se_mac_generate_t MBEDTLS_PRIVATE(p_mac); - /** Function that performs a MAC and verify operation in one call - */ - psa_drv_se_mac_verify_t MBEDTLS_PRIVATE(p_mac_verify); -} psa_drv_se_mac_t; -/**@}*/ - -/** \defgroup se_cipher Secure Element Symmetric Ciphers - * - * Encryption and Decryption using secure element keys in block modes other - * than ECB must be done in multiple parts, using the following flow: - * - `psa_drv_se_cipher_setup_t` - * - `psa_drv_se_cipher_set_iv_t` (optional depending upon block mode) - * - `psa_drv_se_cipher_update_t` - * - `psa_drv_se_cipher_update_t` - * - ... - * - `psa_drv_se_cipher_finish_t` - * - * If a previously started secure element Cipher operation needs to be - * terminated, it should be done so by the `psa_drv_se_cipher_abort_t`. Failure - * to do so may result in allocated resources not being freed or in other - * undefined behavior. - * - * In situations where a PSA Cryptographic API implementation is using a block - * mode not-supported by the underlying hardware or driver, it can construct - * the block mode itself, while calling the `psa_drv_se_cipher_ecb_t` function - * for the cipher operations. - */ -/**@{*/ - -/** \brief A function that provides the cipher setup function for a - * secure element driver - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] op_context A structure that will contain the - * hardware-specific cipher context. - * \param[in] key_slot The slot of the key to be used for the - * operation - * \param[in] algorithm The algorithm to be used in the cipher - * operation - * \param[in] direction Indicates whether the operation is an encrypt - * or decrypt - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - */ -typedef psa_status_t (*psa_drv_se_cipher_setup_t)(psa_drv_se_context_t *drv_context, - void *op_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t algorithm, - psa_encrypt_or_decrypt_t direction); - -/** \brief A function that sets the initialization vector (if - * necessary) for a secure element cipher operation - * - * Rationale: The `psa_se_cipher_*` operation in the PSA Cryptographic API has - * two IV functions: one to set the IV, and one to generate it internally. The - * generate function is not necessary for the drivers to implement as the PSA - * Crypto implementation can do the generation using its RNG features. - * - * \param[in,out] op_context A structure that contains the previously set up - * hardware-specific cipher context - * \param[in] p_iv A buffer containing the initialization vector - * \param[in] iv_length The size (in bytes) of the `p_iv` buffer - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_cipher_set_iv_t)(void *op_context, - const uint8_t *p_iv, - size_t iv_length); - -/** \brief A function that continues a previously started secure element cipher - * operation - * - * \param[in,out] op_context A hardware-specific structure for the - * previously started cipher operation - * \param[in] p_input A buffer containing the data to be - * encrypted/decrypted - * \param[in] input_size The size in bytes of the buffer pointed to - * by `p_input` - * \param[out] p_output The caller-allocated buffer where the - * output will be placed - * \param[in] output_size The allocated size in bytes of the - * `p_output` buffer - * \param[out] p_output_length After completion, will contain the number - * of bytes placed in the `p_output` buffer - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_cipher_update_t)(void *op_context, - const uint8_t *p_input, - size_t input_size, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); - -/** \brief A function that completes a previously started secure element cipher - * operation - * - * \param[in,out] op_context A hardware-specific structure for the - * previously started cipher operation - * \param[out] p_output The caller-allocated buffer where the output - * will be placed - * \param[in] output_size The allocated size in bytes of the `p_output` - * buffer - * \param[out] p_output_length After completion, will contain the number of - * bytes placed in the `p_output` buffer - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_cipher_finish_t)(void *op_context, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); - -/** \brief A function that aborts a previously started secure element cipher - * operation - * - * \param[in,out] op_context A hardware-specific structure for the - * previously started cipher operation - */ -typedef psa_status_t (*psa_drv_se_cipher_abort_t)(void *op_context); - -/** \brief A function that performs the ECB block mode for secure element - * cipher operations - * - * Note: this function should only be used with implementations that do not - * provide a needed higher-level operation. - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot The slot of the key to be used for the operation - * \param[in] algorithm The algorithm to be used in the cipher operation - * \param[in] direction Indicates whether the operation is an encrypt or - * decrypt - * \param[in] p_input A buffer containing the data to be - * encrypted/decrypted - * \param[in] input_size The size in bytes of the buffer pointed to by - * `p_input` - * \param[out] p_output The caller-allocated buffer where the output - * will be placed - * \param[in] output_size The allocated size in bytes of the `p_output` - * buffer - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - */ -typedef psa_status_t (*psa_drv_se_cipher_ecb_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t algorithm, - psa_encrypt_or_decrypt_t direction, - const uint8_t *p_input, - size_t input_size, - uint8_t *p_output, - size_t output_size); - -/** - * \brief A struct containing all of the function pointers needed to implement - * cipher operations using secure elements. - * - * PSA Crypto API implementations should populate instances of the table as - * appropriate upon startup or at build time. - * - * If one of the functions is not implemented (such as - * `psa_drv_se_cipher_ecb_t`), it should be set to NULL. - */ -typedef struct { - /** The size in bytes of the hardware-specific secure element cipher - * context structure - */ - size_t MBEDTLS_PRIVATE(context_size); - /** Function that performs a cipher setup operation */ - psa_drv_se_cipher_setup_t MBEDTLS_PRIVATE(p_setup); - /** Function that sets a cipher IV (if necessary) */ - psa_drv_se_cipher_set_iv_t MBEDTLS_PRIVATE(p_set_iv); - /** Function that performs a cipher update operation */ - psa_drv_se_cipher_update_t MBEDTLS_PRIVATE(p_update); - /** Function that completes a cipher operation */ - psa_drv_se_cipher_finish_t MBEDTLS_PRIVATE(p_finish); - /** Function that aborts a cipher operation */ - psa_drv_se_cipher_abort_t MBEDTLS_PRIVATE(p_abort); - /** Function that performs ECB mode for a cipher operation - * (Danger: ECB mode should not be used directly by clients of the PSA - * Crypto Client API) - */ - psa_drv_se_cipher_ecb_t MBEDTLS_PRIVATE(p_ecb); -} psa_drv_se_cipher_t; - -/**@}*/ - -/** \defgroup se_asymmetric Secure Element Asymmetric Cryptography - * - * Since the amount of data that can (or should) be encrypted or signed using - * asymmetric keys is limited by the key size, asymmetric key operations using - * keys in a secure element must be done in single function calls. - */ -/**@{*/ - -/** - * \brief A function that signs a hash or short message with a private key in - * a secure element - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Key slot of an asymmetric key pair - * \param[in] alg A signature algorithm that is compatible - * with the type of `key` - * \param[in] p_hash The hash to sign - * \param[in] hash_length Size of the `p_hash` buffer in bytes - * \param[out] p_signature Buffer where the signature is to be written - * \param[in] signature_size Size of the `p_signature` buffer in bytes - * \param[out] p_signature_length On success, the number of bytes - * that make up the returned signature value - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_asymmetric_sign_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - uint8_t *p_signature, - size_t signature_size, - size_t *p_signature_length); - -/** - * \brief A function that verifies the signature a hash or short message using - * an asymmetric public key in a secure element - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Key slot of a public key or an asymmetric key - * pair - * \param[in] alg A signature algorithm that is compatible with - * the type of `key` - * \param[in] p_hash The hash whose signature is to be verified - * \param[in] hash_length Size of the `p_hash` buffer in bytes - * \param[in] p_signature Buffer containing the signature to verify - * \param[in] signature_length Size of the `p_signature` buffer in bytes - * - * \retval #PSA_SUCCESS - * The signature is valid. - */ -typedef psa_status_t (*psa_drv_se_asymmetric_verify_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_hash, - size_t hash_length, - const uint8_t *p_signature, - size_t signature_length); - -/** - * \brief A function that encrypts a short message with an asymmetric public - * key in a secure element - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Key slot of a public key or an asymmetric key - * pair - * \param[in] alg An asymmetric encryption algorithm that is - * compatible with the type of `key` - * \param[in] p_input The message to encrypt - * \param[in] input_length Size of the `p_input` buffer in bytes - * \param[in] p_salt A salt or label, if supported by the - * encryption algorithm - * If the algorithm does not support a - * salt, pass `NULL`. - * If the algorithm supports an optional - * salt and you do not want to pass a salt, - * pass `NULL`. - * For #PSA_ALG_RSA_PKCS1V15_CRYPT, no salt is - * supported. - * \param[in] salt_length Size of the `p_salt` buffer in bytes - * If `p_salt` is `NULL`, pass 0. - * \param[out] p_output Buffer where the encrypted message is to - * be written - * \param[in] output_size Size of the `p_output` buffer in bytes - * \param[out] p_output_length On success, the number of bytes that make up - * the returned output - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_asymmetric_encrypt_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); - -/** - * \brief A function that decrypts a short message with an asymmetric private - * key in a secure element. - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Key slot of an asymmetric key pair - * \param[in] alg An asymmetric encryption algorithm that is - * compatible with the type of `key` - * \param[in] p_input The message to decrypt - * \param[in] input_length Size of the `p_input` buffer in bytes - * \param[in] p_salt A salt or label, if supported by the - * encryption algorithm - * If the algorithm does not support a - * salt, pass `NULL`. - * If the algorithm supports an optional - * salt and you do not want to pass a salt, - * pass `NULL`. - * For #PSA_ALG_RSA_PKCS1V15_CRYPT, no salt is - * supported. - * \param[in] salt_length Size of the `p_salt` buffer in bytes - * If `p_salt` is `NULL`, pass 0. - * \param[out] p_output Buffer where the decrypted message is to - * be written - * \param[in] output_size Size of the `p_output` buffer in bytes - * \param[out] p_output_length On success, the number of bytes - * that make up the returned output - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_asymmetric_decrypt_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t alg, - const uint8_t *p_input, - size_t input_length, - const uint8_t *p_salt, - size_t salt_length, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); - -/** - * \brief A struct containing all of the function pointers needed to implement - * asymmetric cryptographic operations using secure elements. - * - * PSA Crypto API implementations should populate instances of the table as - * appropriate upon startup or at build time. - * - * If one of the functions is not implemented, it should be set to NULL. - */ -typedef struct { - /** Function that performs an asymmetric sign operation */ - psa_drv_se_asymmetric_sign_t MBEDTLS_PRIVATE(p_sign); - /** Function that performs an asymmetric verify operation */ - psa_drv_se_asymmetric_verify_t MBEDTLS_PRIVATE(p_verify); - /** Function that performs an asymmetric encrypt operation */ - psa_drv_se_asymmetric_encrypt_t MBEDTLS_PRIVATE(p_encrypt); - /** Function that performs an asymmetric decrypt operation */ - psa_drv_se_asymmetric_decrypt_t MBEDTLS_PRIVATE(p_decrypt); -} psa_drv_se_asymmetric_t; - -/**@}*/ - -/** \defgroup se_aead Secure Element Authenticated Encryption with Additional Data - * Authenticated Encryption with Additional Data (AEAD) operations with secure - * elements must be done in one function call. While this creates a burden for - * implementers as there must be sufficient space in memory for the entire - * message, it prevents decrypted data from being made available before the - * authentication operation is complete and the data is known to be authentic. - */ -/**@{*/ - -/** \brief A function that performs a secure element authenticated encryption - * operation - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Slot containing the key to use. - * \param[in] algorithm The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(`alg`) is true) - * \param[in] p_nonce Nonce or IV to use - * \param[in] nonce_length Size of the `p_nonce` buffer in bytes - * \param[in] p_additional_data Additional data that will be - * authenticated but not encrypted - * \param[in] additional_data_length Size of `p_additional_data` in bytes - * \param[in] p_plaintext Data that will be authenticated and - * encrypted - * \param[in] plaintext_length Size of `p_plaintext` in bytes - * \param[out] p_ciphertext Output buffer for the authenticated and - * encrypted data. The additional data is - * not part of this output. For algorithms - * where the encrypted data and the - * authentication tag are defined as - * separate outputs, the authentication - * tag is appended to the encrypted data. - * \param[in] ciphertext_size Size of the `p_ciphertext` buffer in - * bytes - * \param[out] p_ciphertext_length On success, the size of the output in - * the `p_ciphertext` buffer - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_aead_encrypt_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t algorithm, - const uint8_t *p_nonce, - size_t nonce_length, - const uint8_t *p_additional_data, - size_t additional_data_length, - const uint8_t *p_plaintext, - size_t plaintext_length, - uint8_t *p_ciphertext, - size_t ciphertext_size, - size_t *p_ciphertext_length); - -/** A function that performs a secure element authenticated decryption operation - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key_slot Slot containing the key to use - * \param[in] algorithm The AEAD algorithm to compute - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(`alg`) is true) - * \param[in] p_nonce Nonce or IV to use - * \param[in] nonce_length Size of the `p_nonce` buffer in bytes - * \param[in] p_additional_data Additional data that has been - * authenticated but not encrypted - * \param[in] additional_data_length Size of `p_additional_data` in bytes - * \param[in] p_ciphertext Data that has been authenticated and - * encrypted. - * For algorithms where the encrypted data - * and the authentication tag are defined - * as separate inputs, the buffer must - * contain the encrypted data followed by - * the authentication tag. - * \param[in] ciphertext_length Size of `p_ciphertext` in bytes - * \param[out] p_plaintext Output buffer for the decrypted data - * \param[in] plaintext_size Size of the `p_plaintext` buffer in - * bytes - * \param[out] p_plaintext_length On success, the size of the output in - * the `p_plaintext` buffer - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_aead_decrypt_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - psa_algorithm_t algorithm, - const uint8_t *p_nonce, - size_t nonce_length, - const uint8_t *p_additional_data, - size_t additional_data_length, - const uint8_t *p_ciphertext, - size_t ciphertext_length, - uint8_t *p_plaintext, - size_t plaintext_size, - size_t *p_plaintext_length); - -/** - * \brief A struct containing all of the function pointers needed to implement - * secure element Authenticated Encryption with Additional Data operations - * - * PSA Crypto API implementations should populate instances of the table as - * appropriate upon startup. - * - * If one of the functions is not implemented, it should be set to NULL. - */ -typedef struct { - /** Function that performs the AEAD encrypt operation */ - psa_drv_se_aead_encrypt_t MBEDTLS_PRIVATE(p_encrypt); - /** Function that performs the AEAD decrypt operation */ - psa_drv_se_aead_decrypt_t MBEDTLS_PRIVATE(p_decrypt); -} psa_drv_se_aead_t; -/**@}*/ - -/** \defgroup se_key_management Secure Element Key Management - * Currently, key management is limited to importing keys in the clear, - * destroying keys, and exporting keys in the clear. - * Whether a key may be exported is determined by the key policies in place - * on the key slot. - */ -/**@{*/ - -/** An enumeration indicating how a key is created. - */ -typedef enum { - PSA_KEY_CREATION_IMPORT, /**< During psa_import_key() */ - PSA_KEY_CREATION_GENERATE, /**< During psa_generate_key() */ - PSA_KEY_CREATION_DERIVE, /**< During psa_key_derivation_output_key() */ - PSA_KEY_CREATION_COPY, /**< During psa_copy_key() */ - -#ifndef __DOXYGEN_ONLY__ - /** A key is being registered with mbedtls_psa_register_se_key(). - * - * The core only passes this value to - * psa_drv_se_key_management_t::p_validate_slot_number, not to - * psa_drv_se_key_management_t::p_allocate. The call to - * `p_validate_slot_number` is not followed by any other call to the - * driver: the key is considered successfully registered if the call to - * `p_validate_slot_number` succeeds, or if `p_validate_slot_number` is - * null. - * - * With this creation method, the driver must return #PSA_SUCCESS if - * the given attributes are compatible with the existing key in the slot, - * and #PSA_ERROR_DOES_NOT_EXIST if the driver can determine that there - * is no key with the specified slot number. - * - * This is an Mbed TLS extension. - */ - PSA_KEY_CREATION_REGISTER, -#endif -} psa_key_creation_method_t; - -/** \brief A function that allocates a slot for a key. - * - * To create a key in a specific slot in a secure element, the core - * first calls this function to determine a valid slot number, - * then calls a function to create the key material in that slot. - * In nominal conditions (that is, if no error occurs), - * the effect of a call to a key creation function in the PSA Cryptography - * API with a lifetime that places the key in a secure element is the - * following: - * -# The core calls psa_drv_se_key_management_t::p_allocate - * (or in some implementations - * psa_drv_se_key_management_t::p_validate_slot_number). The driver - * selects (or validates) a suitable slot number given the key attributes - * and the state of the secure element. - * -# The core calls a key creation function in the driver. - * - * The key creation functions in the PSA Cryptography API are: - * - psa_import_key(), which causes - * a call to `p_allocate` with \p method = #PSA_KEY_CREATION_IMPORT - * then a call to psa_drv_se_key_management_t::p_import. - * - psa_generate_key(), which causes - * a call to `p_allocate` with \p method = #PSA_KEY_CREATION_GENERATE - * then a call to psa_drv_se_key_management_t::p_import. - * - psa_key_derivation_output_key(), which causes - * a call to `p_allocate` with \p method = #PSA_KEY_CREATION_DERIVE - * then a call to psa_drv_se_key_derivation_t::p_derive. - * - psa_copy_key(), which causes - * a call to `p_allocate` with \p method = #PSA_KEY_CREATION_COPY - * then a call to psa_drv_se_key_management_t::p_export. - * - * In case of errors, other behaviors are possible. - * - If the PSA Cryptography subsystem dies after the first step, - * for example because the device has lost power abruptly, - * the second step may never happen, or may happen after a reset - * and re-initialization. Alternatively, after a reset and - * re-initialization, the core may call - * psa_drv_se_key_management_t::p_destroy on the slot number that - * was allocated (or validated) instead of calling a key creation function. - * - If an error occurs, the core may call - * psa_drv_se_key_management_t::p_destroy on the slot number that - * was allocated (or validated) instead of calling a key creation function. - * - * Errors and system resets also have an impact on the driver's persistent - * data. If a reset happens before the overall key creation process is - * completed (before or after the second step above), it is unspecified - * whether the persistent data after the reset is identical to what it - * was before or after the call to `p_allocate` (or `p_validate_slot_number`). - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] persistent_data A pointer to the persistent data - * that allows writing. - * \param[in] attributes Attributes of the key. - * \param method The way in which the key is being created. - * \param[out] key_slot Slot where the key will be stored. - * This must be a valid slot for a key of the - * chosen type. It must be unoccupied. - * - * \retval #PSA_SUCCESS - * Success. - * The core will record \c *key_slot as the key slot where the key - * is stored and will update the persistent data in storage. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - */ -typedef psa_status_t (*psa_drv_se_allocate_key_t)( - psa_drv_se_context_t *drv_context, - void *persistent_data, - const psa_key_attributes_t *attributes, - psa_key_creation_method_t method, - psa_key_slot_number_t *key_slot); - -/** \brief A function that determines whether a slot number is valid - * for a key. - * - * To create a key in a specific slot in a secure element, the core - * first calls this function to validate the choice of slot number, - * then calls a function to create the key material in that slot. - * See the documentation of #psa_drv_se_allocate_key_t for more details. - * - * As of the PSA Cryptography API specification version 1.0, there is no way - * for applications to trigger a call to this function. However some - * implementations offer the capability to create or declare a key in - * a specific slot via implementation-specific means, generally for the - * sake of initial device provisioning or onboarding. Such a mechanism may - * be added to a future version of the PSA Cryptography API specification. - * - * This function may update the driver's persistent data through - * \p persistent_data. The core will save the updated persistent data at the - * end of the key creation process. See the description of - * ::psa_drv_se_allocate_key_t for more information. - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] persistent_data A pointer to the persistent data - * that allows writing. - * \param[in] attributes Attributes of the key. - * \param method The way in which the key is being created. - * \param[in] key_slot Slot where the key is to be stored. - * - * \retval #PSA_SUCCESS - * The given slot number is valid for a key with the given - * attributes. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The given slot number is not valid for a key with the - * given attributes. This includes the case where the slot - * number is not valid at all. - * \retval #PSA_ERROR_ALREADY_EXISTS - * There is already a key with the specified slot number. - * Drivers may choose to return this error from the key - * creation function instead. - */ -typedef psa_status_t (*psa_drv_se_validate_slot_number_t)( - psa_drv_se_context_t *drv_context, - void *persistent_data, - const psa_key_attributes_t *attributes, - psa_key_creation_method_t method, - psa_key_slot_number_t key_slot); - -/** \brief A function that imports a key into a secure element in binary format - * - * This function can support any output from psa_export_key(). Refer to the - * documentation of psa_export_key() for the format for each key type. - * - * \param[in,out] drv_context The driver context structure. - * \param key_slot Slot where the key will be stored. - * This must be a valid slot for a key of the - * chosen type. It must be unoccupied. - * \param[in] attributes The key attributes, including the lifetime, - * the key type and the usage policy. - * Drivers should not access the key size stored - * in the attributes: it may not match the - * data passed in \p data. - * Drivers can call psa_get_key_lifetime(), - * psa_get_key_type(), - * psa_get_key_usage_flags() and - * psa_get_key_algorithm() to access this - * information. - * \param[in] data Buffer containing the key data. - * \param[in] data_length Size of the \p data buffer in bytes. - * \param[out] bits On success, the key size in bits. The driver - * must determine this value after parsing the - * key according to the key type. - * This value is not used if the function fails. - * - * \retval #PSA_SUCCESS - * Success. - */ -typedef psa_status_t (*psa_drv_se_import_key_t)( - psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - const psa_key_attributes_t *attributes, - const uint8_t *data, - size_t data_length, - size_t *bits); - -/** - * \brief A function that destroys a secure element key and restore the slot to - * its default state - * - * This function destroys the content of the key from a secure element. - * Implementations shall make a best effort to ensure that any previous content - * of the slot is unrecoverable. - * - * This function returns the specified slot to its default state. - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] persistent_data A pointer to the persistent data - * that allows writing. - * \param key_slot The key slot to erase. - * - * \retval #PSA_SUCCESS - * The slot's content, if any, has been erased. - */ -typedef psa_status_t (*psa_drv_se_destroy_key_t)( - psa_drv_se_context_t *drv_context, - void *persistent_data, - psa_key_slot_number_t key_slot); - -/** - * \brief A function that exports a secure element key in binary format - * - * The output of this function can be passed to psa_import_key() to - * create an equivalent object. - * - * If a key is created with `psa_import_key()` and then exported with - * this function, it is not guaranteed that the resulting data is - * identical: the implementation may choose a different representation - * of the same key if the format permits it. - * - * This function should generate output in the same format that - * `psa_export_key()` does. Refer to the - * documentation of `psa_export_key()` for the format for each key type. - * - * \param[in,out] drv_context The driver context structure. - * \param[in] key Slot whose content is to be exported. This must - * be an occupied key slot. - * \param[out] p_data Buffer where the key data is to be written. - * \param[in] data_size Size of the `p_data` buffer in bytes. - * \param[out] p_data_length On success, the number of bytes - * that make up the key data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_DOES_NOT_EXIST \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - */ -typedef psa_status_t (*psa_drv_se_export_key_t)(psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key, - uint8_t *p_data, - size_t data_size, - size_t *p_data_length); - -/** - * \brief A function that generates a symmetric or asymmetric key on a secure - * element - * - * If the key type \c type recorded in \p attributes - * is asymmetric (#PSA_KEY_TYPE_IS_ASYMMETRIC(\c type) = 1), - * the driver may export the public key at the time of generation, - * in the format documented for psa_export_public_key() by writing it - * to the \p pubkey buffer. - * This is optional, intended for secure elements that output the - * public key at generation time and that cannot export the public key - * later. Drivers that do not need this feature should leave - * \p *pubkey_length set to 0 and should - * implement the psa_drv_key_management_t::p_export_public function. - * Some implementations do not support this feature, in which case - * \p pubkey is \c NULL and \p pubkey_size is 0. - * - * \param[in,out] drv_context The driver context structure. - * \param key_slot Slot where the key will be stored. - * This must be a valid slot for a key of the - * chosen type. It must be unoccupied. - * \param[in] attributes The key attributes, including the lifetime, - * the key type and size, and the usage policy. - * Drivers can call psa_get_key_lifetime(), - * psa_get_key_type(), psa_get_key_bits(), - * psa_get_key_usage_flags() and - * psa_get_key_algorithm() to access this - * information. - * \param[out] pubkey A buffer where the driver can write the - * public key, when generating an asymmetric - * key pair. - * This is \c NULL when generating a symmetric - * key or if the core does not support - * exporting the public key at generation time. - * \param pubkey_size The size of the `pubkey` buffer in bytes. - * This is 0 when generating a symmetric - * key or if the core does not support - * exporting the public key at generation time. - * \param[out] pubkey_length On entry, this is always 0. - * On success, the number of bytes written to - * \p pubkey. If this is 0 or unchanged on return, - * the core will not read the \p pubkey buffer, - * and will instead call the driver's - * psa_drv_key_management_t::p_export_public - * function to export the public key when needed. - */ -typedef psa_status_t (*psa_drv_se_generate_key_t)( - psa_drv_se_context_t *drv_context, - psa_key_slot_number_t key_slot, - const psa_key_attributes_t *attributes, - uint8_t *pubkey, size_t pubkey_size, size_t *pubkey_length); - -/** - * \brief A struct containing all of the function pointers needed to for secure - * element key management - * - * PSA Crypto API implementations should populate instances of the table as - * appropriate upon startup or at build time. - * - * If one of the functions is not implemented, it should be set to NULL. - */ -typedef struct { - /** Function that allocates a slot for a key. */ - psa_drv_se_allocate_key_t MBEDTLS_PRIVATE(p_allocate); - /** Function that checks the validity of a slot for a key. */ - psa_drv_se_validate_slot_number_t MBEDTLS_PRIVATE(p_validate_slot_number); - /** Function that performs a key import operation */ - psa_drv_se_import_key_t MBEDTLS_PRIVATE(p_import); - /** Function that performs a generation */ - psa_drv_se_generate_key_t MBEDTLS_PRIVATE(p_generate); - /** Function that performs a key destroy operation */ - psa_drv_se_destroy_key_t MBEDTLS_PRIVATE(p_destroy); - /** Function that performs a key export operation */ - psa_drv_se_export_key_t MBEDTLS_PRIVATE(p_export); - /** Function that performs a public key export operation */ - psa_drv_se_export_key_t MBEDTLS_PRIVATE(p_export_public); -} psa_drv_se_key_management_t; - -/**@}*/ - -/** \defgroup driver_derivation Secure Element Key Derivation and Agreement - * Key derivation is the process of generating new key material using an - * existing key and additional parameters, iterating through a basic - * cryptographic function, such as a hash. - * Key agreement is a part of cryptographic protocols that allows two parties - * to agree on the same key value, but starting from different original key - * material. - * The flows are similar, and the PSA Crypto Driver Model uses the same functions - * for both of the flows. - * - * There are two different final functions for the flows, - * `psa_drv_se_key_derivation_derive` and `psa_drv_se_key_derivation_export`. - * `psa_drv_se_key_derivation_derive` is used when the key material should be - * placed in a slot on the hardware and not exposed to the caller. - * `psa_drv_se_key_derivation_export` is used when the key material should be - * returned to the PSA Cryptographic API implementation. - * - * Different key derivation algorithms require a different number of inputs. - * Instead of having an API that takes as input variable length arrays, which - * can be problematic to manage on embedded platforms, the inputs are passed - * to the driver via a function, `psa_drv_se_key_derivation_collateral`, that - * is called multiple times with different `collateral_id`s. Thus, for a key - * derivation algorithm that required 3 parameter inputs, the flow would look - * something like: - * ~~~~~~~~~~~~~{.c} - * psa_drv_se_key_derivation_setup(kdf_algorithm, source_key, dest_key_size_bytes); - * psa_drv_se_key_derivation_collateral(kdf_algorithm_collateral_id_0, - * p_collateral_0, - * collateral_0_size); - * psa_drv_se_key_derivation_collateral(kdf_algorithm_collateral_id_1, - * p_collateral_1, - * collateral_1_size); - * psa_drv_se_key_derivation_collateral(kdf_algorithm_collateral_id_2, - * p_collateral_2, - * collateral_2_size); - * psa_drv_se_key_derivation_derive(); - * ~~~~~~~~~~~~~ - * - * key agreement example: - * ~~~~~~~~~~~~~{.c} - * psa_drv_se_key_derivation_setup(alg, source_key. dest_key_size_bytes); - * psa_drv_se_key_derivation_collateral(DHE_PUBKEY, p_pubkey, pubkey_size); - * psa_drv_se_key_derivation_export(p_session_key, - * session_key_size, - * &session_key_length); - * ~~~~~~~~~~~~~ - */ -/**@{*/ - -/** \brief A function that Sets up a secure element key derivation operation by - * specifying the algorithm and the source key sot - * - * \param[in,out] drv_context The driver context structure. - * \param[in,out] op_context A hardware-specific structure containing any - * context information for the implementation - * \param[in] kdf_alg The algorithm to be used for the key derivation - * \param[in] source_key The key to be used as the source material for - * the key derivation - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_key_derivation_setup_t)(psa_drv_se_context_t *drv_context, - void *op_context, - psa_algorithm_t kdf_alg, - psa_key_slot_number_t source_key); - -/** \brief A function that provides collateral (parameters) needed for a secure - * element key derivation or key agreement operation - * - * Since many key derivation algorithms require multiple parameters, it is - * expected that this function may be called multiple times for the same - * operation, each with a different algorithm-specific `collateral_id` - * - * \param[in,out] op_context A hardware-specific structure containing any - * context information for the implementation - * \param[in] collateral_id An ID for the collateral being provided - * \param[in] p_collateral A buffer containing the collateral data - * \param[in] collateral_size The size in bytes of the collateral - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_key_derivation_collateral_t)(void *op_context, - uint32_t collateral_id, - const uint8_t *p_collateral, - size_t collateral_size); - -/** \brief A function that performs the final secure element key derivation - * step and place the generated key material in a slot - * - * \param[in,out] op_context A hardware-specific structure containing any - * context information for the implementation - * \param[in] dest_key The slot where the generated key material - * should be placed - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_key_derivation_derive_t)(void *op_context, - psa_key_slot_number_t dest_key); - -/** \brief A function that performs the final step of a secure element key - * agreement and place the generated key material in a buffer - * - * \param[out] p_output Buffer in which to place the generated key - * material - * \param[in] output_size The size in bytes of `p_output` - * \param[out] p_output_length Upon success, contains the number of bytes of - * key material placed in `p_output` - * - * \retval #PSA_SUCCESS \emptydescription - */ -typedef psa_status_t (*psa_drv_se_key_derivation_export_t)(void *op_context, - uint8_t *p_output, - size_t output_size, - size_t *p_output_length); - -/** - * \brief A struct containing all of the function pointers needed to for secure - * element key derivation and agreement - * - * PSA Crypto API implementations should populate instances of the table as - * appropriate upon startup. - * - * If one of the functions is not implemented, it should be set to NULL. - */ -typedef struct { - /** The driver-specific size of the key derivation context */ - size_t MBEDTLS_PRIVATE(context_size); - /** Function that performs a key derivation setup */ - psa_drv_se_key_derivation_setup_t MBEDTLS_PRIVATE(p_setup); - /** Function that sets key derivation collateral */ - psa_drv_se_key_derivation_collateral_t MBEDTLS_PRIVATE(p_collateral); - /** Function that performs a final key derivation step */ - psa_drv_se_key_derivation_derive_t MBEDTLS_PRIVATE(p_derive); - /** Function that performs a final key derivation or agreement and - * exports the key */ - psa_drv_se_key_derivation_export_t MBEDTLS_PRIVATE(p_export); -} psa_drv_se_key_derivation_t; - -/**@}*/ - -/** \defgroup se_registration Secure element driver registration - */ -/**@{*/ - -/** A structure containing pointers to all the entry points of a - * secure element driver. - * - * Future versions of this specification may add extra substructures at - * the end of this structure. - */ -typedef struct { - /** The version of the driver HAL that this driver implements. - * This is a protection against loading driver binaries built against - * a different version of this specification. - * Use #PSA_DRV_SE_HAL_VERSION. - */ - uint32_t MBEDTLS_PRIVATE(hal_version); - - /** The size of the driver's persistent data in bytes. - * - * This can be 0 if the driver does not need persistent data. - * - * See the documentation of psa_drv_se_context_t::persistent_data - * for more information about why and how a driver can use - * persistent data. - */ - size_t MBEDTLS_PRIVATE(persistent_data_size); - - /** The driver initialization function. - * - * This function is called once during the initialization of the - * PSA Cryptography subsystem, before any other function of the - * driver is called. If this function returns a failure status, - * the driver will be unusable, at least until the next system reset. - * - * If this field is \c NULL, it is equivalent to a function that does - * nothing and returns #PSA_SUCCESS. - */ - psa_drv_se_init_t MBEDTLS_PRIVATE(p_init); - - const psa_drv_se_key_management_t *MBEDTLS_PRIVATE(key_management); - const psa_drv_se_mac_t *MBEDTLS_PRIVATE(mac); - const psa_drv_se_cipher_t *MBEDTLS_PRIVATE(cipher); - const psa_drv_se_aead_t *MBEDTLS_PRIVATE(aead); - const psa_drv_se_asymmetric_t *MBEDTLS_PRIVATE(asymmetric); - const psa_drv_se_key_derivation_t *MBEDTLS_PRIVATE(derivation); -} psa_drv_se_t; - -/** The current version of the secure element driver HAL. - */ -/* 0.0.0 patchlevel 5 */ -#define PSA_DRV_SE_HAL_VERSION 0x00000005 - -/** Register an external cryptoprocessor (secure element) driver. - * - * This function is only intended to be used by driver code, not by - * application code. In implementations with separation between the - * PSA cryptography module and applications, this function should - * only be available to callers that run in the same memory space as - * the cryptography module, and should not be exposed to applications - * running in a different memory space. - * - * This function may be called before psa_crypto_init(). It is - * implementation-defined whether this function may be called - * after psa_crypto_init(). - * - * \note Implementations store metadata about keys including the lifetime - * value, which contains the driver's location indicator. Therefore, - * from one instantiation of the PSA Cryptography - * library to the next one, if there is a key in storage with a certain - * lifetime value, you must always register the same driver (or an - * updated version that communicates with the same secure element) - * with the same location value. - * - * \param location The location value through which this driver will - * be exposed to applications. - * This driver will be used for all keys such that - * `location == #PSA_KEY_LIFETIME_GET_LOCATION( lifetime )`. - * The value #PSA_KEY_LOCATION_LOCAL_STORAGE is reserved - * and may not be used for drivers. Implementations - * may reserve other values. - * \param[in] methods The method table of the driver. This structure must - * remain valid for as long as the cryptography - * module keeps running. It is typically a global - * constant. - * - * \return #PSA_SUCCESS - * The driver was successfully registered. Applications can now - * use \p location to access keys through the methods passed to - * this function. - * \return #PSA_ERROR_BAD_STATE - * This function was called after the initialization of the - * cryptography module, and this implementation does not support - * driver registration at this stage. - * \return #PSA_ERROR_ALREADY_EXISTS - * There is already a registered driver for this value of \p location. - * \return #PSA_ERROR_INVALID_ARGUMENT - * \p location is a reserved value. - * \return #PSA_ERROR_NOT_SUPPORTED - * `methods->hal_version` is not supported by this implementation. - * \return #PSA_ERROR_INSUFFICIENT_MEMORY - * \return #PSA_ERROR_NOT_PERMITTED - * \return #PSA_ERROR_STORAGE_FAILURE - * \return #PSA_ERROR_DATA_CORRUPT - */ -psa_status_t psa_register_se_driver( - psa_key_location_t location, - const psa_drv_se_t *methods); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_SE_DRIVER_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_sizes.h b/ext/oberon/psa/core/include/psa/crypto_sizes.h deleted file mode 100644 index 7021cc286171..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_sizes.h +++ /dev/null @@ -1,1387 +0,0 @@ -/** - * \file psa/crypto_sizes.h - * - * \brief PSA cryptography module: Mbed TLS buffer size macros - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. - * - * This file contains the definitions of macros that are useful to - * compute buffer sizes. The signatures and semantics of these macros - * are standardized, but the definitions are not, because they depend on - * the available algorithms and, in some cases, on permitted tolerances - * on buffer sizes. - * - * In implementations with isolation between the application and the - * cryptography module, implementers should take care to ensure that - * the definitions that are exposed to applications match what the - * module implements. - * - * Macros that compute sizes whose values do not depend on the - * implementation are in crypto.h. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef PSA_CRYPTO_SIZES_H -#define PSA_CRYPTO_SIZES_H - -/* - * Include the build-time configuration information file. Here, we do not - * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which - * is basically just an alias to it. This is to ease the maintenance of the - * PSA cryptography repository which has a different build system and - * configuration. - */ -#include "psa/build_info.h" - -#define PSA_BITS_TO_BYTES(bits) (((bits) + 7u) / 8u) -#define PSA_BYTES_TO_BITS(bytes) ((bytes) * 8u) -#define PSA_MAX_OF_THREE(a, b, c) ((a) <= (b) ? (b) <= (c) ? \ - (c) : (b) : (a) <= (c) ? (c) : (a)) - -#define PSA_ROUND_UP_TO_MULTIPLE(block_size, length) \ - (((length) + (block_size) - 1) / (block_size) * (block_size)) - -/** The size of the output of psa_hash_finish(), in bytes. - * - * This is also the hash size that psa_hash_verify() expects. - * - * \param alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p alg) is true), or an HMAC algorithm - * (#PSA_ALG_HMAC(\c hash_alg) where \c hash_alg is a - * hash algorithm). - * - * \return The hash size for the specified hash algorithm. - * If the hash algorithm is not recognized, return 0. - */ -#define PSA_HASH_LENGTH(alg) \ - ( \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 16u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 20u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 20u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 28u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 32u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 48u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 28u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 32u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_224 ? 28u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_256 ? 32u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_384 ? 48u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_512 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHAKE256_512 ? 64u : /*!!OM*/ \ - 0u) - -/** The input block size of a hash algorithm, in bytes. - * - * Hash algorithms process their input data in blocks. Hash operations will - * retain any partial blocks until they have enough input to fill the block or - * until the operation is finished. - * This affects the output from psa_hash_suspend(). - * - * \param alg A hash algorithm (\c PSA_ALG_XXX value such that - * PSA_ALG_IS_HASH(\p alg) is true). - * - * \return The block size in bytes for the specified hash algorithm. - * If the hash algorithm is not recognized, return 0. - * An implementation can return either 0 or the correct size for a - * hash algorithm that it recognizes, but does not support. - */ -#define PSA_HASH_BLOCK_LENGTH(alg) \ - ( \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 64u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 128u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 128u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 128u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 128u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_224 ? 144u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_256 ? 136u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_384 ? 104u : \ - PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_512 ? 72u : \ - 0u) - -/** \def PSA_HASH_MAX_SIZE - * - * Maximum size of a hash. - * - * This macro expands to a compile-time constant integer. This value - * is the maximum size of a hash in bytes. - */ -/* Note: for HMAC-SHA-3, the block size is 144 bytes for HMAC-SHA3-224, - * 136 bytes for HMAC-SHA3-256, 104 bytes for SHA3-384, 72 bytes for - * HMAC-SHA3-512. */ -/* Note: PSA_HASH_MAX_SIZE should be kept in sync with MBEDTLS_MD_MAX_SIZE, - * see the note on MBEDTLS_MD_MAX_SIZE for details. */ -#if defined(PSA_WANT_ALG_SHA3_224) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 144u -#elif defined(PSA_WANT_ALG_SHA3_256) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 136u -#elif defined(PSA_WANT_ALG_SHA_512) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 128u -#elif defined(PSA_WANT_ALG_SHA_384) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 128u -#elif defined(PSA_WANT_ALG_SHA3_384) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 104u -#elif defined(PSA_WANT_ALG_SHA3_512) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 72u -#elif defined(PSA_WANT_ALG_SHA_256) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 64u -#elif defined(PSA_WANT_ALG_SHA_224) -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 64u -#else /* SHA-1 or smaller */ -#define PSA_HMAC_MAX_HASH_BLOCK_SIZE 64u -#endif - -#if defined(PSA_WANT_ALG_SHA_512) || defined(PSA_WANT_ALG_SHA3_512) -#define PSA_HASH_MAX_SIZE 64u -#elif defined(PSA_WANT_ALG_SHA_384) || defined(PSA_WANT_ALG_SHA3_384) -#define PSA_HASH_MAX_SIZE 48u -#elif defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA3_256) -#define PSA_HASH_MAX_SIZE 32u -#elif defined(PSA_WANT_ALG_SHA_224) || defined(PSA_WANT_ALG_SHA3_224) -#define PSA_HASH_MAX_SIZE 28u -#else /* SHA-1 or smaller */ -#define PSA_HASH_MAX_SIZE 20u -#endif - -/** \def PSA_MAC_MAX_SIZE - * - * Maximum size of a MAC. - * - * This macro expands to a compile-time constant integer. This value - * is the maximum size of a MAC in bytes. - */ -/* All non-HMAC MACs have a maximum size that's smaller than the - * minimum possible value of PSA_HASH_MAX_SIZE in this implementation. */ -/* Note that the encoding of truncated MAC algorithms limits this value - * to 64 bytes. - */ -#define PSA_MAC_MAX_SIZE PSA_HASH_MAX_SIZE - -/** The length of a tag for an AEAD algorithm, in bytes. - * - * This macro can be used to allocate a buffer of sufficient size to store the - * tag output from psa_aead_finish(). - * - * See also #PSA_AEAD_TAG_MAX_SIZE. - * - * \param key_type The type of the AEAD key. - * \param key_bits The size of the AEAD key in bits. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \return The tag length for the specified algorithm and key. - * If the AEAD algorithm does not have an identified - * tag that can be distinguished from the rest of - * the ciphertext, return 0. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \ - PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \ - ((void) (key_bits), 0u)) - -/** The maximum tag size for all supported AEAD algorithms, in bytes. - * - * See also #PSA_AEAD_TAG_LENGTH(\p key_type, \p key_bits, \p alg). - */ -#define PSA_AEAD_TAG_MAX_SIZE 16u - -/* The maximum size of an RSA key on this implementation, in bits. - * This is a vendor-specific macro. - * - * Mbed TLS does not set a hard limit on the size of RSA keys: any key - * whose parameters fit in a bignum is accepted. However large keys can - * induce a large memory usage and long computation times. Unlike other - * auxiliary macros in this file and in crypto.h, which reflect how the - * library is configured, this macro defines how the library is - * configured. This implementation refuses to import or generate an - * RSA key whose size is larger than the value defined here. - * - * Note that an implementation may set different size limits for different - * operations, and does not need to accept all key sizes up to the limit. */ -#if defined(PSA_WANT_RSA_KEY_SIZE_8192) /*!!OM*/ -#define PSA_VENDOR_RSA_MAX_KEY_BITS 8192u -#elif defined(PSA_WANT_RSA_KEY_SIZE_6144) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 6144u -#elif defined(PSA_WANT_RSA_KEY_SIZE_4096) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 4096u -#elif defined(PSA_WANT_RSA_KEY_SIZE_3072) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 3072u -#elif defined(PSA_WANT_RSA_KEY_SIZE_2048) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 2048u -#elif defined(PSA_WANT_RSA_KEY_SIZE_1536) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 1536u -#elif defined(PSA_WANT_RSA_KEY_SIZE_1024) -#define PSA_VENDOR_RSA_MAX_KEY_BITS 1024u -#else -#define PSA_VENDOR_RSA_MAX_KEY_BITS 1u -#endif - -/* The minimum size of an RSA key on this implementation, in bits. - * This is a vendor-specific macro. - * - * Limits RSA key generation to a minimum due to avoid accidental misuse. - * This value cannot be less than 128 bits. - */ -#if defined(MBEDTLS_RSA_GEN_KEY_MIN_BITS) -#define PSA_VENDOR_RSA_GENERATE_MIN_KEY_BITS MBEDTLS_RSA_GEN_KEY_MIN_BITS -#else -#define PSA_VENDOR_RSA_GENERATE_MIN_KEY_BITS 1024u -#endif - -/* The maximum size of an DH key on this implementation, in bits. - * - * Note that an implementation may set different size limits for different - * operations, and does not need to accept all key sizes up to the limit. */ -#define PSA_VENDOR_FFDH_MAX_KEY_BITS 8192u - -/* The maximum size of an ECC key on this implementation, in bits. - * This is a vendor-specific macro. */ -#ifndef PSA_VENDOR_ECC_MAX_CURVE_BITS -#if defined(PSA_WANT_ECC_SECP_R1_521) /*!!OM*/ -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 521u -#elif defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 512u -#elif defined(PSA_WANT_ECC_MONTGOMERY_448) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 448u -#elif defined(PSA_WANT_ECC_TWISTED_EDWARDS_448) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 448u -#elif defined(PSA_WANT_ECC_SECP_R1_384) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 384u -#elif defined(PSA_WANT_ECC_BRAINPOOL_P_R1_384) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 384u -#elif defined(PSA_WANT_ECC_SECP_R1_256) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 256u -#elif defined(PSA_WANT_ECC_SECP_K1_256) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 256u -#elif defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 256u -#elif defined(PSA_WANT_ECC_MONTGOMERY_255) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 255u -#elif defined(PSA_WANT_ECC_TWISTED_EDWARDS_255) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 255u -#elif defined(PSA_WANT_ECC_SECP_R1_224) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 224u -#elif defined(PSA_WANT_ECC_SECP_K1_224) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 224u -#elif defined(PSA_WANT_ECC_SECP_R1_192) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 192u -#elif defined(PSA_WANT_ECC_SECP_K1_192) -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 192u -#else -#define PSA_VENDOR_ECC_MAX_CURVE_BITS 0u -#endif -#endif - -/** This macro returns the maximum supported length of the PSK for the - * TLS-1.2 PSK-to-MS key derivation - * (#PSA_ALG_TLS12_PSK_TO_MS(\c hash_alg)). - * - * The maximum supported length does not depend on the chosen hash algorithm. - * - * Quoting RFC 4279, Sect 5.3: - * TLS implementations supporting these ciphersuites MUST support - * arbitrary PSK identities up to 128 octets in length, and arbitrary - * PSKs up to 64 octets in length. Supporting longer identities and - * keys is RECOMMENDED. - * - * Therefore, no implementation should define a value smaller than 64 - * for #PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE. - */ -#define PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE 128u - -/* The expected size of input passed to psa_tls12_ecjpake_to_pms_input, - * which is expected to work with P-256 curve only. */ -#define PSA_TLS12_ECJPAKE_TO_PMS_INPUT_SIZE 65u - -/* The size of a serialized K.X coordinate to be used in - * psa_tls12_ecjpake_to_pms_input. This function only accepts the P-256 - * curve. */ -#define PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE 32u - -/* The maximum number of iterations for PBKDF2 on this implementation, in bits. - * This is a vendor-specific macro. This can be configured if necessary */ -#define PSA_VENDOR_PBKDF2_MAX_ITERATIONS 0xffffffffU - -/** The maximum size of a block cipher. */ -#define PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE 16u - -/** The size of the output of psa_mac_sign_finish(), in bytes. - * - * This is also the MAC size that psa_mac_verify_finish() expects. - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type The type of the MAC key. - * \param key_bits The size of the MAC key in bits. - * \param alg A MAC algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_MAC(\p alg) is true). - * - * \return The MAC size for the specified algorithm with - * the specified key parameters. - * \return 0 if the MAC algorithm is not recognized. - * \return Either 0 or the correct size for a MAC algorithm that - * the implementation recognizes, but does not support. - * \return Unspecified if the key parameters are not consistent - * with the algorithm. - */ -#define PSA_MAC_LENGTH(key_type, key_bits, alg) \ - ((alg) & PSA_ALG_MAC_TRUNCATION_MASK ? PSA_MAC_TRUNCATED_LENGTH(alg) : \ - PSA_ALG_IS_HMAC(alg) ? PSA_HASH_LENGTH(PSA_ALG_HMAC_GET_HASH(alg)) : \ - PSA_ALG_IS_BLOCK_CIPHER_MAC(alg) ? PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \ - ((void) (key_type), (void) (key_bits), 0u)) - -/** The maximum size of the output of psa_aead_encrypt(), in bytes. - * - * If the size of the ciphertext buffer is at least this large, it is - * guaranteed that psa_aead_encrypt() will not fail due to an - * insufficient buffer size. Depending on the algorithm, the actual size of - * the ciphertext may be smaller. - * - * See also #PSA_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(\p plaintext_length). - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is - * compatible with algorithm \p alg. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * \param plaintext_length Size of the plaintext in bytes. - * - * \return The AEAD ciphertext size for the specified - * algorithm. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \ - (plaintext_length) + PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \ - 0u) - -/** A sufficient output buffer size for psa_aead_encrypt(), for any of the - * supported key types and AEAD algorithms. - * - * If the size of the ciphertext buffer is at least this large, it is guaranteed - * that psa_aead_encrypt() will not fail due to an insufficient buffer size. - * - * \note This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * See also #PSA_AEAD_ENCRYPT_OUTPUT_SIZE(\p key_type, \p alg, - * \p plaintext_length). - * - * \param plaintext_length Size of the plaintext in bytes. - * - * \return A sufficient output buffer size for any of the - * supported key types and AEAD algorithms. - * - */ -#define PSA_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(plaintext_length) \ - ((plaintext_length) + PSA_AEAD_TAG_MAX_SIZE) - - -/** The maximum size of the output of psa_aead_decrypt(), in bytes. - * - * If the size of the plaintext buffer is at least this large, it is - * guaranteed that psa_aead_decrypt() will not fail due to an - * insufficient buffer size. Depending on the algorithm, the actual size of - * the plaintext may be smaller. - * - * See also #PSA_AEAD_DECRYPT_OUTPUT_MAX_SIZE(\p ciphertext_length). - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is - * compatible with algorithm \p alg. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * \param ciphertext_length Size of the plaintext in bytes. - * - * \return The AEAD ciphertext size for the specified - * algorithm. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_AEAD_DECRYPT_OUTPUT_SIZE(key_type, alg, ciphertext_length) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \ - (ciphertext_length) > PSA_ALG_AEAD_GET_TAG_LENGTH(alg) ? \ - (ciphertext_length) - PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \ - 0u) - -/** A sufficient output buffer size for psa_aead_decrypt(), for any of the - * supported key types and AEAD algorithms. - * - * If the size of the plaintext buffer is at least this large, it is guaranteed - * that psa_aead_decrypt() will not fail due to an insufficient buffer size. - * - * \note This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * See also #PSA_AEAD_DECRYPT_OUTPUT_SIZE(\p key_type, \p alg, - * \p ciphertext_length). - * - * \param ciphertext_length Size of the ciphertext in bytes. - * - * \return A sufficient output buffer size for any of the - * supported key types and AEAD algorithms. - * - */ -#define PSA_AEAD_DECRYPT_OUTPUT_MAX_SIZE(ciphertext_length) \ - (ciphertext_length) - -/** The default nonce size for an AEAD algorithm, in bytes. - * - * This macro can be used to allocate a buffer of sufficient size to - * store the nonce output from #psa_aead_generate_nonce(). - * - * See also #PSA_AEAD_NONCE_MAX_SIZE. - * - * \note This is not the maximum size of nonce supported as input to - * #psa_aead_set_nonce(), #psa_aead_encrypt() or #psa_aead_decrypt(), - * just the default size that is generated by #psa_aead_generate_nonce(). - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is compatible with - * algorithm \p alg. - * - * \param alg An AEAD algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \return The default nonce size for the specified key type and algorithm. - * If the key type or AEAD algorithm is not recognized, - * or the parameters are incompatible, return 0. - */ -#define PSA_AEAD_NONCE_LENGTH(key_type, alg) \ - (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) == 16 ? \ - MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_CCM) ? 13u : \ - MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_GCM) ? 12u : \ - 0u : \ - (key_type) == PSA_KEY_TYPE_CHACHA20 && \ - MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_CHACHA20_POLY1305) ? 12u : \ - 0u) - -/** The maximum default nonce size among all supported pairs of key types and - * AEAD algorithms, in bytes. - * - * This is equal to or greater than any value that #PSA_AEAD_NONCE_LENGTH() - * may return. - * - * \note This is not the maximum size of nonce supported as input to - * #psa_aead_set_nonce(), #psa_aead_encrypt() or #psa_aead_decrypt(), - * just the largest size that may be generated by - * #psa_aead_generate_nonce(). - */ -#define PSA_AEAD_NONCE_MAX_SIZE 13u - -/** A sufficient output buffer size for psa_aead_update(). - * - * If the size of the output buffer is at least this large, it is - * guaranteed that psa_aead_update() will not fail due to an - * insufficient buffer size. The actual size of the output may be smaller - * in any given call. - * - * See also #PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(\p input_length). - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is - * compatible with algorithm \p alg. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * \param input_length Size of the input in bytes. - * - * \return A sufficient output buffer size for the specified - * algorithm. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -/* For all the AEAD modes defined in this specification, it is possible - * to emit output without delay. However, hardware may not always be - * capable of this. So for modes based on a block cipher, allow the - * implementation to delay the output until it has a full block. */ -#define PSA_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \ - PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \ - PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type), (input_length)) : \ - (input_length) : \ - 0u) - -/** A sufficient output buffer size for psa_aead_update(), for any of the - * supported key types and AEAD algorithms. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_aead_update() will not fail due to an insufficient buffer size. - * - * See also #PSA_AEAD_UPDATE_OUTPUT_SIZE(\p key_type, \p alg, \p input_length). - * - * \param input_length Size of the input in bytes. - */ -#define PSA_AEAD_UPDATE_OUTPUT_MAX_SIZE(input_length) \ - (PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE, (input_length))) - -/** A sufficient ciphertext buffer size for psa_aead_finish(). - * - * If the size of the ciphertext buffer is at least this large, it is - * guaranteed that psa_aead_finish() will not fail due to an - * insufficient ciphertext buffer size. The actual size of the output may - * be smaller in any given call. - * - * See also #PSA_AEAD_FINISH_OUTPUT_MAX_SIZE. - * - * \param key_type A symmetric key type that is - compatible with algorithm \p alg. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \return A sufficient ciphertext buffer size for the - * specified algorithm. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_AEAD_FINISH_OUTPUT_SIZE(key_type, alg) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \ - PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \ - PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \ - 0u) - -/** A sufficient ciphertext buffer size for psa_aead_finish(), for any of the - * supported key types and AEAD algorithms. - * - * See also #PSA_AEAD_FINISH_OUTPUT_SIZE(\p key_type, \p alg). - */ -#define PSA_AEAD_FINISH_OUTPUT_MAX_SIZE (PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE) - -/** A sufficient plaintext buffer size for psa_aead_verify(). - * - * If the size of the plaintext buffer is at least this large, it is - * guaranteed that psa_aead_verify() will not fail due to an - * insufficient plaintext buffer size. The actual size of the output may - * be smaller in any given call. - * - * See also #PSA_AEAD_VERIFY_OUTPUT_MAX_SIZE. - * - * \param key_type A symmetric key type that is - * compatible with algorithm \p alg. - * \param alg An AEAD algorithm - * (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p alg) is true). - * - * \return A sufficient plaintext buffer size for the - * specified algorithm. - * If the key type or AEAD algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_AEAD_VERIFY_OUTPUT_SIZE(key_type, alg) \ - (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \ - PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \ - PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \ - 0u) - -/** A sufficient plaintext buffer size for psa_aead_verify(), for any of the - * supported key types and AEAD algorithms. - * - * See also #PSA_AEAD_VERIFY_OUTPUT_SIZE(\p key_type, \p alg). - */ -#define PSA_AEAD_VERIFY_OUTPUT_MAX_SIZE (PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE) - -#define PSA_RSA_MINIMUM_PADDING_SIZE(alg) \ - (PSA_ALG_IS_RSA_OAEP(alg) ? \ - 2u * PSA_HASH_LENGTH(PSA_ALG_RSA_OAEP_GET_HASH(alg)) + 1u : \ - 11u /*PKCS#1v1.5*/) - -/** - * \brief ECDSA signature size for a given curve bit size - * - * \param curve_bits Curve size in bits. - * \return Signature size in bytes. - * - * \note This macro returns a compile-time constant if its argument is one. - */ -#define PSA_ECDSA_SIGNATURE_SIZE(curve_bits) \ - (PSA_BITS_TO_BYTES(curve_bits) * 2u) - -/** Sufficient signature buffer size for psa_sign_hash(). - * - * This macro returns a sufficient buffer size for a signature using a key - * of the specified type and size, with the specified algorithm. - * Note that the actual size of the signature may be smaller - * (some algorithms produce a variable-size signature). - * - * \warning This function may call its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type An asymmetric key type (this may indifferently be a - * key pair type or a public key type). - * \param key_bits The size of the key in bits. - * \param alg The signature algorithm. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_sign_hash() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not supported, - * return either a sensible size or 0. - * If the parameters are not valid, the - * return value is unspecified. - */ -#define PSA_SIGN_OUTPUT_SIZE(key_type, key_bits, alg) \ - (PSA_KEY_TYPE_IS_RSA(key_type) ? ((void) alg, PSA_BITS_TO_BYTES(key_bits)) : \ - PSA_KEY_TYPE_IS_ECC(key_type) ? PSA_ECDSA_SIGNATURE_SIZE(key_bits) : \ - ((void) alg, 0u)) - -#define PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE \ - PSA_ECDSA_SIGNATURE_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) - -/** \def PSA_SIGNATURE_MAX_SIZE - * - * Maximum size of an asymmetric signature. - * - * This macro expands to a compile-time constant integer. This value - * is the maximum size of a signature in bytes. - */ -#define PSA_SIGNATURE_MAX_SIZE 1 - -#if (defined(PSA_WANT_ALG_ECDSA) || defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)) && \ - (PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE > PSA_SIGNATURE_MAX_SIZE) -#undef PSA_SIGNATURE_MAX_SIZE -#define PSA_SIGNATURE_MAX_SIZE PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE -#endif -#if (defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) || defined(PSA_WANT_ALG_RSA_PSS)) && \ - (PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS) > PSA_SIGNATURE_MAX_SIZE) -#undef PSA_SIGNATURE_MAX_SIZE -#define PSA_SIGNATURE_MAX_SIZE PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS) -#endif - -/** Sufficient output buffer size for psa_asymmetric_encrypt(). - * - * This macro returns a sufficient buffer size for a ciphertext produced using - * a key of the specified type and size, with the specified algorithm. - * Note that the actual size of the ciphertext may be smaller, depending - * on the algorithm. - * - * \warning This function may call its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type An asymmetric key type (this may indifferently be a - * key pair type or a public key type). - * \param key_bits The size of the key in bits. - * \param alg The asymmetric encryption algorithm. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_asymmetric_encrypt() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not supported, - * return either a sensible size or 0. - * If the parameters are not valid, the - * return value is unspecified. - */ -#define PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE(key_type, key_bits, alg) \ - (PSA_KEY_TYPE_IS_RSA(key_type) ? \ - ((void) alg, PSA_BITS_TO_BYTES(key_bits)) : \ - 0u) - -/** A sufficient output buffer size for psa_asymmetric_encrypt(), for any - * supported asymmetric encryption. - * - * See also #PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE(\p key_type, \p key_bits, \p alg). - */ -/* This macro assumes that RSA is the only supported asymmetric encryption. */ -#define PSA_ASYMMETRIC_ENCRYPT_OUTPUT_MAX_SIZE \ - (PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS)) - -/** Sufficient output buffer size for psa_asymmetric_decrypt(). - * - * This macro returns a sufficient buffer size for a plaintext produced using - * a key of the specified type and size, with the specified algorithm. - * Note that the actual size of the plaintext may be smaller, depending - * on the algorithm. - * - * \warning This function may call its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type An asymmetric key type (this may indifferently be a - * key pair type or a public key type). - * \param key_bits The size of the key in bits. - * \param alg The asymmetric encryption algorithm. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_asymmetric_decrypt() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not supported, - * return either a sensible size or 0. - * If the parameters are not valid, the - * return value is unspecified. - */ -#define PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE(key_type, key_bits, alg) \ - (PSA_KEY_TYPE_IS_RSA(key_type) ? \ - PSA_BITS_TO_BYTES(key_bits) - PSA_RSA_MINIMUM_PADDING_SIZE(alg) : \ - 0u) - -/** A sufficient output buffer size for psa_asymmetric_decrypt(), for any - * supported asymmetric decryption. - * - * This macro assumes that RSA is the only supported asymmetric encryption. - * - * See also #PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE(\p key_type, \p key_bits, \p alg). - */ -#define PSA_ASYMMETRIC_DECRYPT_OUTPUT_MAX_SIZE \ - (PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS)) - -/* Maximum size of the ASN.1 encoding of an INTEGER with the specified - * number of bits. - * - * This definition assumes that bits <= 2^19 - 9 so that the length field - * is at most 3 bytes. The length of the encoding is the length of the - * bit string padded to a whole number of bytes plus: - * - 1 type byte; - * - 1 to 3 length bytes; - * - 0 to 1 bytes of leading 0 due to the sign bit. - */ -#define PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE(bits) \ - ((bits) / 8u + 5u) - -/* Maximum size of the export encoding of an RSA public key. - * Assumes that the public exponent is less than 2^32. - * - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER } -- e - * - * - 4 bytes of SEQUENCE overhead; - * - n : INTEGER; - * - 7 bytes for the public exponent. - */ -#define PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE(key_bits) + 11u) - -/* Maximum size of the export encoding of an RSA key pair. - * Assumes that the public exponent is less than 2^32 and that the size - * difference between the two primes is at most 1 bit. - * - * RSAPrivateKey ::= SEQUENCE { - * version Version, -- 0 - * modulus INTEGER, -- N-bit - * publicExponent INTEGER, -- 32-bit - * privateExponent INTEGER, -- N-bit - * prime1 INTEGER, -- N/2-bit - * prime2 INTEGER, -- N/2-bit - * exponent1 INTEGER, -- N/2-bit - * exponent2 INTEGER, -- N/2-bit - * coefficient INTEGER, -- N/2-bit - * } - * - * - 4 bytes of SEQUENCE overhead; - * - 3 bytes of version; - * - 7 half-size INTEGERs plus 2 full-size INTEGERs, - * overapproximated as 9 half-size INTEGERS; - * - 7 bytes for the public exponent. - */ -#define PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(key_bits) \ - (9u * PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE((key_bits) / 2u + 1u) + 14u) - -/* Maximum size of the export encoding of a DSA public key. - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING } -- contains DSAPublicKey - * AlgorithmIdentifier ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters Dss-Params } -- SEQUENCE of 3 INTEGERs - * DSAPublicKey ::= INTEGER -- public key, Y - * - * - 3 * 4 bytes of SEQUENCE overhead; - * - 1 + 1 + 7 bytes of algorithm (DSA OID); - * - 4 bytes of BIT STRING overhead; - * - 3 full-size INTEGERs (p, g, y); - * - 1 + 1 + 32 bytes for 1 sub-size INTEGER (q <= 256 bits). - */ -#define PSA_KEY_EXPORT_DSA_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE(key_bits) * 3u + 59u) - -/* Maximum size of the export encoding of a DSA key pair. - * - * DSAPrivateKey ::= SEQUENCE { - * version Version, -- 0 - * prime INTEGER, -- p - * subprime INTEGER, -- q - * generator INTEGER, -- g - * public INTEGER, -- y - * private INTEGER, -- x - * } - * - * - 4 bytes of SEQUENCE overhead; - * - 3 bytes of version; - * - 3 full-size INTEGERs (p, g, y); - * - 2 * (1 + 1 + 32) bytes for 2 sub-size INTEGERs (q, x <= 256 bits). - */ -#define PSA_KEY_EXPORT_DSA_KEY_PAIR_MAX_SIZE(key_bits) \ - (PSA_KEY_EXPORT_ASN1_INTEGER_MAX_SIZE(key_bits) * 3u + 75u) - -/* Maximum size of the export encoding of an ECC public key. - * - * The representation of an ECC public key is: - * - The byte 0x04; - * - `x_P` as a `ceiling(m/8)`-byte string, big-endian; - * - `y_P` as a `ceiling(m/8)`-byte string, big-endian; - * - where m is the bit size associated with the curve. - * - * - 1 byte + 2 * point size. - */ -#define PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (2u * PSA_BITS_TO_BYTES(key_bits) + 1u) - -/* Maximum size of the export encoding of an ECC key pair. - * - * An ECC key pair is represented by the secret value. - */ -#define PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(key_bits) \ - (PSA_BITS_TO_BYTES(key_bits)) - -/* Maximum size of the export encoding of an DH key pair. - * - * An DH key pair is represented by the secret value. - */ -#define PSA_KEY_EXPORT_FFDH_KEY_PAIR_MAX_SIZE(key_bits) \ - (PSA_BITS_TO_BYTES(key_bits)) - -/* Maximum size of the export encoding of an DH public key. - */ -#define PSA_KEY_EXPORT_FFDH_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (PSA_BITS_TO_BYTES(key_bits)) - -/* Maximum size of the export encoding of an SPAKE2+ public key. - * - * An SPAKE2+ public key is represented by the secret values w0 and L. - */ -#define PSA_KEY_EXPORT_SPAKE2P_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (3u * PSA_BITS_TO_BYTES(key_bits) + 1u) - -/* Maximum size of the export encoding of an SPAKE2+ key pair. - * - * An SPAKE2+ key pair is represented by the secret values w0 and w1. - */ -#define PSA_KEY_EXPORT_SPAKE2P_KEY_PAIR_MAX_SIZE(key_bits) \ - (2u * PSA_BITS_TO_BYTES(key_bits)) - -/* Maximum size of the export encoding of an SRP public key. - * - * An SRP public key is represented by the password verifier. - */ -#define PSA_KEY_EXPORT_SRP_PUBLIC_KEY_MAX_SIZE(key_bits) \ - (PSA_BITS_TO_BYTES(key_bits)) - -/* Maximum size of the export encoding of an SRP key pair. - * - * An SRP key pair is represented by the password hash. - */ -#define PSA_KEY_EXPORT_SRP_KEY_PAIR_MAX_SIZE(key_bits) \ - (PSA_HASH_MAX_SIZE) - -/** Sufficient output buffer size for psa_export_key() or - * psa_export_public_key(). - * - * This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * The following code illustrates how to allocate enough memory to export - * a key by querying the key type and size at runtime. - * \code{c} - * psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - * psa_status_t status; - * status = psa_get_key_attributes(key, &attributes); - * if (status != PSA_SUCCESS) handle_error(...); - * psa_key_type_t key_type = psa_get_key_type(&attributes); - * size_t key_bits = psa_get_key_bits(&attributes); - * size_t buffer_size = PSA_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits); - * psa_reset_key_attributes(&attributes); - * uint8_t *buffer = malloc(buffer_size); - * if (buffer == NULL) handle_error(...); - * size_t buffer_length; - * status = psa_export_key(key, buffer, buffer_size, &buffer_length); - * if (status != PSA_SUCCESS) handle_error(...); - * \endcode - * - * \param key_type A supported key type. - * \param key_bits The size of the key in bits. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_export_key() or psa_export_public_key() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not supported, - * return either a sensible size or 0. - * If the parameters are not valid, the return value is unspecified. - */ -#define PSA_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits) \ - (PSA_KEY_TYPE_IS_UNSTRUCTURED(key_type) ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_IS_DH(key_type) ? PSA_BITS_TO_BYTES(key_bits) : \ - (key_type) == PSA_KEY_TYPE_RSA_KEY_PAIR ? PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(key_bits) : \ - (key_type) == PSA_KEY_TYPE_RSA_PUBLIC_KEY ? PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(key_bits) : \ - (key_type) == PSA_KEY_TYPE_DSA_KEY_PAIR ? PSA_KEY_EXPORT_DSA_KEY_PAIR_MAX_SIZE(key_bits) : \ - (key_type) == PSA_KEY_TYPE_DSA_PUBLIC_KEY ? PSA_KEY_EXPORT_DSA_PUBLIC_KEY_MAX_SIZE(key_bits) : \ - PSA_KEY_TYPE_IS_SPAKE2P_KEY_PAIR(key_type) ? 2u * PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_IS_SPAKE2P_PUBLIC_KEY(key_type) ? 3u * PSA_BITS_TO_BYTES(key_bits) + 1u : \ - PSA_KEY_TYPE_IS_SRP_KEY_PAIR(key_type) ? PSA_HASH_MAX_SIZE : \ - PSA_KEY_TYPE_IS_SRP_PUBLIC_KEY(key_type) ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_ECC_GET_FAMILY(key_type) == PSA_ECC_FAMILY_TWISTED_EDWARDS ? PSA_BITS_TO_BYTES(key_bits + 1u) : /*!!OM-PCI-27*/ \ - PSA_KEY_TYPE_ECC_GET_FAMILY(key_type) == PSA_ECC_FAMILY_MONTGOMERY ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type) ? PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(key_bits) : \ - PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(key_type) ? PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(key_bits) : \ - 0u) - -/** Sufficient output buffer size for psa_export_public_key(). - * - * This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * The following code illustrates how to allocate enough memory to export - * a public key by querying the key type and size at runtime. - * \code{c} - * psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - * psa_status_t status; - * status = psa_get_key_attributes(key, &attributes); - * if (status != PSA_SUCCESS) handle_error(...); - * psa_key_type_t key_type = psa_get_key_type(&attributes); - * size_t key_bits = psa_get_key_bits(&attributes); - * size_t buffer_size = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type, key_bits); - * psa_reset_key_attributes(&attributes); - * uint8_t *buffer = malloc(buffer_size); - * if (buffer == NULL) handle_error(...); - * size_t buffer_length; - * status = psa_export_public_key(key, buffer, buffer_size, &buffer_length); - * if (status != PSA_SUCCESS) handle_error(...); - * \endcode - * - * \param key_type A public key or key pair key type. - * \param key_bits The size of the key in bits. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_export_public_key() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that is not - * supported, return either a sensible size or 0. - * If the parameters are not valid, - * the return value is unspecified. - * - * If the parameters are valid and supported, - * return the same result as - * #PSA_EXPORT_KEY_OUTPUT_SIZE( - * \p #PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(\p key_type), - * \p key_bits). - */ -#define PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(key_type, key_bits) \ - (PSA_KEY_TYPE_IS_RSA(key_type) ? PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(key_bits) : \ - PSA_KEY_TYPE_IS_DH(key_type) ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_IS_SPAKE2P(key_type) ? 3u * PSA_BITS_TO_BYTES(key_bits) + 1u : \ - PSA_KEY_TYPE_IS_SRP(key_type) ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_ECC_GET_FAMILY(key_type) == PSA_ECC_FAMILY_TWISTED_EDWARDS ? PSA_BITS_TO_BYTES(key_bits + 1) : \ - PSA_KEY_TYPE_ECC_GET_FAMILY(key_type) == PSA_ECC_FAMILY_MONTGOMERY ? PSA_BITS_TO_BYTES(key_bits) : \ - PSA_KEY_TYPE_IS_ECC(key_type) ? PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(key_bits) : \ - 0u) - -/** Sufficient buffer size for exporting any asymmetric key pair. - * - * This macro expands to a compile-time constant integer. This value is - * a sufficient buffer size when calling psa_export_key() to export any - * asymmetric key pair, regardless of the exact key type and key size. - * - * See also #PSA_EXPORT_KEY_OUTPUT_SIZE(\p key_type, \p key_bits). - */ -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE 1 - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) && \ - (PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) > \ - PSA_EXPORT_KEY_PAIR_MAX_SIZE) -#undef PSA_EXPORT_KEY_PAIR_MAX_SIZE -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \ - PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) && \ - (PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) > \ - PSA_EXPORT_KEY_PAIR_MAX_SIZE) -#undef PSA_EXPORT_KEY_PAIR_MAX_SIZE -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \ - PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC) && \ - (PSA_KEY_EXPORT_FFDH_KEY_PAIR_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) > \ - PSA_EXPORT_KEY_PAIR_MAX_SIZE) -#undef PSA_EXPORT_KEY_PAIR_MAX_SIZE -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \ - PSA_KEY_EXPORT_FFDH_KEY_PAIR_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_BASIC) && \ - (PSA_KEY_EXPORT_SPAKE2P_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) > \ - PSA_EXPORT_KEY_PAIR_MAX_SIZE) -#undef PSA_EXPORT_KEY_PAIR_MAX_SIZE -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \ - PSA_KEY_EXPORT_SPAKE2P_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_BASIC) && \ - (PSA_KEY_EXPORT_SRP_KEY_PAIR_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) > \ - PSA_EXPORT_KEY_PAIR_MAX_SIZE) -#undef PSA_EXPORT_KEY_PAIR_MAX_SIZE -#define PSA_EXPORT_KEY_PAIR_MAX_SIZE \ - PSA_KEY_EXPORT_SRP_KEY_PAIR_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#endif - -/** Sufficient buffer size for exporting any asymmetric public key. - * - * This macro expands to a compile-time constant integer. This value is - * a sufficient buffer size when calling psa_export_key() or - * psa_export_public_key() to export any asymmetric public key, - * regardless of the exact key type and key size. - * - * See also #PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(\p key_type, \p key_bits). - */ -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE 1 - -#if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) && \ - (PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) > \ - PSA_EXPORT_PUBLIC_KEY_MAX_SIZE) -#undef PSA_EXPORT_PUBLIC_KEY_MAX_SIZE -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) && \ - (PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) > \ - PSA_EXPORT_PUBLIC_KEY_MAX_SIZE) -#undef PSA_EXPORT_PUBLIC_KEY_MAX_SIZE -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE \ - PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY) && \ - (PSA_KEY_EXPORT_FFDH_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) > \ - PSA_EXPORT_PUBLIC_KEY_MAX_SIZE) -#undef PSA_EXPORT_PUBLIC_KEY_MAX_SIZE -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE \ - PSA_KEY_EXPORT_FFDH_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY) && \ - (PSA_KEY_EXPORT_SPAKE2P_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) > \ - PSA_EXPORT_PUBLIC_KEY_MAX_SIZE) -#undef PSA_EXPORT_PUBLIC_KEY_MAX_SIZE -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE \ - PSA_KEY_EXPORT_SPAKE2P_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif -#if defined(PSA_WANT_KEY_TYPE_SRP_PUBLIC_KEY) && \ - (PSA_KEY_EXPORT_SRP_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) > \ - PSA_EXPORT_PUBLIC_KEY_MAX_SIZE) -#undef PSA_EXPORT_PUBLIC_KEY_MAX_SIZE -#define PSA_EXPORT_PUBLIC_KEY_MAX_SIZE \ - PSA_KEY_EXPORT_SRP_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#endif - -/** Sufficient output buffer size for psa_raw_key_agreement(). - * - * This macro returns a compile-time constant if its arguments are - * compile-time constants. - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * See also #PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE. - * - * \param key_type A supported key type. - * \param key_bits The size of the key in bits. - * - * \return If the parameters are valid and supported, return - * a buffer size in bytes that guarantees that - * psa_raw_key_agreement() will not fail with - * #PSA_ERROR_BUFFER_TOO_SMALL. - * If the parameters are a valid combination that - * is not supported, return either a sensible size or 0. - * If the parameters are not valid, - * the return value is unspecified. - */ -#define PSA_RAW_KEY_AGREEMENT_OUTPUT_SIZE(key_type, key_bits) \ - ((PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type) || \ - PSA_KEY_TYPE_IS_DH_KEY_PAIR(key_type)) ? PSA_BITS_TO_BYTES(key_bits) : 0u) - -/** Maximum size of the output from psa_raw_key_agreement(). - * - * This macro expands to a compile-time constant integer. This value is the - * maximum size of the output any raw key agreement algorithm, in bytes. - * - * See also #PSA_RAW_KEY_AGREEMENT_OUTPUT_SIZE(\p key_type, \p key_bits). - */ -#define PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE 1 - -#if defined(PSA_WANT_ALG_ECDH) && \ - (PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS) > PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE) -#undef PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE -#define PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS) -#endif -#if defined(PSA_WANT_ALG_FFDH) && \ - (PSA_BITS_TO_BYTES(PSA_VENDOR_FFDH_MAX_KEY_BITS) > PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE) -#undef PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE -#define PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE PSA_BITS_TO_BYTES(PSA_VENDOR_FFDH_MAX_KEY_BITS) -#endif - -/** The default IV size for a cipher algorithm, in bytes. - * - * The IV that is generated as part of a call to #psa_cipher_encrypt() is always - * the default IV length for the algorithm. - * - * This macro can be used to allocate a buffer of sufficient size to - * store the IV output from #psa_cipher_generate_iv() when using - * a multi-part cipher operation. - * - * See also #PSA_CIPHER_IV_MAX_SIZE. - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is compatible with algorithm \p alg. - * - * \param alg A cipher algorithm (\c PSA_ALG_XXX value such that #PSA_ALG_IS_CIPHER(\p alg) is true). - * - * \return The default IV size for the specified key type and algorithm. - * If the algorithm does not use an IV, return 0. - * If the key type or cipher algorithm is not recognized, - * or the parameters are incompatible, return 0. - */ -#define PSA_CIPHER_IV_LENGTH(key_type, alg) \ - (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) > 1 && \ - ((alg) == PSA_ALG_CTR || \ - (alg) == PSA_ALG_CFB || \ - (alg) == PSA_ALG_OFB || \ - (alg) == PSA_ALG_XTS || \ - (alg) == PSA_ALG_CBC_NO_PADDING || \ - (alg) == PSA_ALG_CBC_PKCS7) ? PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \ - (key_type) == PSA_KEY_TYPE_CHACHA20 && \ - (alg) == PSA_ALG_STREAM_CIPHER ? 12u : \ - (alg) == PSA_ALG_CCM_STAR_NO_TAG ? 13u : \ - 0u) - -/** The maximum IV size for all supported cipher algorithms, in bytes. - * - * See also #PSA_CIPHER_IV_LENGTH(). - */ -#define PSA_CIPHER_IV_MAX_SIZE 16u - -/** The maximum size of the output of psa_cipher_encrypt(), in bytes. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_encrypt() will not fail due to an insufficient buffer size. - * Depending on the algorithm, the actual size of the output might be smaller. - * - * See also #PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(\p input_length). - * - * \warning This macro may evaluate its arguments multiple times or - * zero times, so you should not pass arguments that contain - * side effects. - * - * \param key_type A symmetric key type that is compatible with algorithm - * alg. - * \param alg A cipher algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \param input_length Size of the input in bytes. - * - * \return A sufficient output size for the specified key type and - * algorithm. If the key type or cipher algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length) \ - (alg == PSA_ALG_CBC_PKCS7 ? \ - (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) != 0 ? \ - PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type), \ - (input_length) + 1u) + \ - PSA_CIPHER_IV_LENGTH((key_type), (alg)) : 0u) : \ - (PSA_ALG_IS_CIPHER(alg) ? \ - (input_length) + PSA_CIPHER_IV_LENGTH((key_type), (alg)) : \ - 0u)) - -/** A sufficient output buffer size for psa_cipher_encrypt(), for any of the - * supported key types and cipher algorithms. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_encrypt() will not fail due to an insufficient buffer size. - * - * See also #PSA_CIPHER_ENCRYPT_OUTPUT_SIZE(\p key_type, \p alg, \p input_length). - * - * \param input_length Size of the input in bytes. - * - */ -#define PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(input_length) \ - (PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE, \ - (input_length) + 1u) + \ - PSA_CIPHER_IV_MAX_SIZE) - -/** The maximum size of the output of psa_cipher_decrypt(), in bytes. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_decrypt() will not fail due to an insufficient buffer size. - * Depending on the algorithm, the actual size of the output might be smaller. - * - * See also #PSA_CIPHER_DECRYPT_OUTPUT_MAX_SIZE(\p input_length). - * - * \param key_type A symmetric key type that is compatible with algorithm - * alg. - * \param alg A cipher algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \param input_length Size of the input in bytes. - * - * \return A sufficient output size for the specified key type and - * algorithm. If the key type or cipher algorithm is not - * recognized, or the parameters are incompatible, - * return 0. - */ -#define PSA_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length) \ - (PSA_ALG_IS_CIPHER(alg) && \ - ((key_type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC ? \ - (input_length) : \ - 0u) - -/** A sufficient output buffer size for psa_cipher_decrypt(), for any of the - * supported key types and cipher algorithms. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_decrypt() will not fail due to an insufficient buffer size. - * - * See also #PSA_CIPHER_DECRYPT_OUTPUT_SIZE(\p key_type, \p alg, \p input_length). - * - * \param input_length Size of the input in bytes. - */ -#define PSA_CIPHER_DECRYPT_OUTPUT_MAX_SIZE(input_length) \ - (input_length) - -/** A sufficient output buffer size for psa_cipher_update(). - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_update() will not fail due to an insufficient buffer size. - * The actual size of the output might be smaller in any given call. - * - * See also #PSA_CIPHER_UPDATE_OUTPUT_MAX_SIZE(\p input_length). - * - * \param key_type A symmetric key type that is compatible with algorithm - * alg. - * \param alg A cipher algorithm (PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \param input_length Size of the input in bytes. - * - * \return A sufficient output size for the specified key type and - * algorithm. If the key type or cipher algorithm is not - * recognized, or the parameters are incompatible, return 0. - */ -#define PSA_CIPHER_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) \ - (PSA_ALG_IS_CIPHER(alg) ? \ - (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) != 0 ? \ - (((alg) == PSA_ALG_CBC_PKCS7 || \ - (alg) == PSA_ALG_CBC_NO_PADDING || \ - (alg) == PSA_ALG_ECB_NO_PADDING) ? \ - PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type), \ - input_length) : \ - (input_length)) : 0u) : \ - 0u) - -/** A sufficient output buffer size for psa_cipher_update(), for any of the - * supported key types and cipher algorithms. - * - * If the size of the output buffer is at least this large, it is guaranteed - * that psa_cipher_update() will not fail due to an insufficient buffer size. - * - * See also #PSA_CIPHER_UPDATE_OUTPUT_SIZE(\p key_type, \p alg, \p input_length). - * - * \param input_length Size of the input in bytes. - */ -#define PSA_CIPHER_UPDATE_OUTPUT_MAX_SIZE(input_length) \ - (PSA_ROUND_UP_TO_MULTIPLE(PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE, input_length)) - -/** A sufficient ciphertext buffer size for psa_cipher_finish(). - * - * If the size of the ciphertext buffer is at least this large, it is - * guaranteed that psa_cipher_finish() will not fail due to an insufficient - * ciphertext buffer size. The actual size of the output might be smaller in - * any given call. - * - * See also #PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE(). - * - * \param key_type A symmetric key type that is compatible with algorithm - * alg. - * \param alg A cipher algorithm (PSA_ALG_XXX value such that - * #PSA_ALG_IS_CIPHER(\p alg) is true). - * \return A sufficient output size for the specified key type and - * algorithm. If the key type or cipher algorithm is not - * recognized, or the parameters are incompatible, return 0. - */ -#define PSA_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) \ - (PSA_ALG_IS_CIPHER(alg) ? \ - (alg == PSA_ALG_CBC_PKCS7 ? \ - PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \ - 0u) : \ - 0u) - -/** A sufficient ciphertext buffer size for psa_cipher_finish(), for any of the - * supported key types and cipher algorithms. - * - * See also #PSA_CIPHER_FINISH_OUTPUT_SIZE(\p key_type, \p alg). - */ -#define PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE \ - (PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE) - -#endif /* PSA_CRYPTO_SIZES_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_struct.h b/ext/oberon/psa/core/include/psa/crypto_struct.h deleted file mode 100644 index 6d6fde68390f..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_struct.h +++ /dev/null @@ -1,585 +0,0 @@ -/** - * \file psa/crypto_struct.h - * - * \brief PSA cryptography module: Mbed TLS structured type implementations - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. - * - * This file contains the definitions of some data structures with - * implementation-specific definitions. - * - * In implementations with isolation between the application and the - * cryptography module, it is expected that the front-end and the back-end - * would have different versions of this file. - * - *

Design notes about multipart operation structures

- * - * For multipart operations without driver delegation support, each multipart - * operation structure contains a `psa_algorithm_t alg` field which indicates - * which specific algorithm the structure is for. When the structure is not in - * use, `alg` is 0. Most of the structure consists of a union which is - * discriminated by `alg`. - * - * For multipart operations with driver delegation support, each multipart - * operation structure contains an `unsigned int id` field indicating which - * driver got assigned to do the operation. When the structure is not in use, - * 'id' is 0. The structure contains also a driver context which is the union - * of the contexts of all drivers able to handle the type of multipart - * operation. - * - * Note that when `alg` or `id` is 0, the content of other fields is undefined. - * In particular, it is not guaranteed that a freshly-initialized structure - * is all-zero: we initialize structures to something like `{0, 0}`, which - * is only guaranteed to initializes the first member of the union; - * GCC and Clang initialize the whole structure to 0 (at the time of writing), - * but MSVC and CompCert don't. - * - * In Mbed TLS, multipart operation structures live independently from - * the key. This allows Mbed TLS to free the key objects when destroying - * a key slot. If a multipart operation needs to remember the key after - * the setup function returns, the operation structure needs to contain a - * copy of the key. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef PSA_CRYPTO_STRUCT_H -#define PSA_CRYPTO_STRUCT_H -#include "mbedtls/private_access.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Include the Mbed TLS configuration file, the way Mbed TLS does it - * in each of its header files. */ -#include "mbedtls/build_info.h" - -/* Include the context definition for the compiled-in drivers for the primitive - * algorithms. */ -#include "psa/crypto_driver_contexts_primitives.h" - -struct psa_hash_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_driver_wrappers.h. - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. the driver context is not active, in use). */ - unsigned int MBEDTLS_PRIVATE(id); - psa_driver_hash_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -#define PSA_HASH_OPERATION_INIT {} -static inline struct psa_hash_operation_s psa_hash_operation_init(void) -{ - const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT; - return v; -} - -struct psa_cipher_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - unsigned int MBEDTLS_PRIVATE(iv_required) : 1; - unsigned int MBEDTLS_PRIVATE(iv_set) : 1; - - uint8_t MBEDTLS_PRIVATE(default_iv_length); - - psa_driver_cipher_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -#define PSA_CIPHER_OPERATION_INIT {} -static inline struct psa_cipher_operation_s psa_cipher_operation_init(void) -{ - const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT; - return v; -} - -/* Include the context definition for the compiled-in drivers for the composite - * algorithms. */ -#include "psa/crypto_driver_contexts_composites.h" - -struct psa_mac_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - uint8_t MBEDTLS_PRIVATE(mac_size); - unsigned int MBEDTLS_PRIVATE(is_sign) : 1; - psa_driver_mac_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -#define PSA_MAC_OPERATION_INIT {} -static inline struct psa_mac_operation_s psa_mac_operation_init(void) -{ - const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT; - return v; -} - -struct psa_aead_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - psa_algorithm_t MBEDTLS_PRIVATE(alg); - psa_key_type_t MBEDTLS_PRIVATE(key_type); - - size_t MBEDTLS_PRIVATE(ad_remaining); - size_t MBEDTLS_PRIVATE(body_remaining); - - unsigned int MBEDTLS_PRIVATE(nonce_set) : 1; - unsigned int MBEDTLS_PRIVATE(lengths_set) : 1; - unsigned int MBEDTLS_PRIVATE(ad_started) : 1; - unsigned int MBEDTLS_PRIVATE(body_started) : 1; - unsigned int MBEDTLS_PRIVATE(is_encrypt) : 1; - - psa_driver_aead_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -#define PSA_AEAD_OPERATION_INIT {} -static inline struct psa_aead_operation_s psa_aead_operation_init(void) -{ - const struct psa_aead_operation_s v = PSA_AEAD_OPERATION_INIT; - return v; -} - -/* Include the context definition for the compiled-in drivers for the key - * derivation algorithms. */ -#include "psa/crypto_driver_contexts_key_derivation.h" - -struct psa_key_derivation_s { /*!!OM*/ -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - psa_algorithm_t MBEDTLS_PRIVATE(alg); - unsigned int MBEDTLS_PRIVATE(can_output_key) : 1; - unsigned int MBEDTLS_PRIVATE(no_output) : 1; - unsigned int MBEDTLS_PRIVATE(no_verify) : 1; - unsigned int MBEDTLS_PRIVATE(cost_set) : 1; - unsigned int MBEDTLS_PRIVATE(salt_set) : 1; - unsigned int MBEDTLS_PRIVATE(secret_set) : 1; - unsigned int MBEDTLS_PRIVATE(seed_set) : 1; - unsigned int MBEDTLS_PRIVATE(label_set) : 1; - unsigned int MBEDTLS_PRIVATE(context_set) : 1; - unsigned int MBEDTLS_PRIVATE(passw_set) : 1; - unsigned int MBEDTLS_PRIVATE(info_set) : 1; - unsigned int MBEDTLS_PRIVATE(no_input) : 1; - size_t MBEDTLS_PRIVATE(capacity); - - psa_driver_key_derivation_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -#define PSA_KEY_DERIVATION_OPERATION_INIT {} -static inline struct psa_key_derivation_s psa_key_derivation_operation_init( - void) -{ - const struct psa_key_derivation_s v = PSA_KEY_DERIVATION_OPERATION_INIT; - return v; -} - -struct psa_key_policy_s { - psa_key_usage_t MBEDTLS_PRIVATE(usage); - psa_algorithm_t MBEDTLS_PRIVATE(alg); - psa_algorithm_t MBEDTLS_PRIVATE(alg2); -}; -typedef struct psa_key_policy_s psa_key_policy_t; - -#define PSA_KEY_POLICY_INIT { 0, 0, 0 } -static inline struct psa_key_policy_s psa_key_policy_init(void) -{ - const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT; - return v; -} - -/* The type used internally for key sizes. - * Public interfaces use size_t, but internally we use a smaller type. */ -typedef uint16_t psa_key_bits_t; -/* The maximum value of the type used to represent bit-sizes. - * This is used to mark an invalid key size. */ -#define PSA_KEY_BITS_TOO_LARGE ((psa_key_bits_t) -1) -/* The maximum size of a key in bits. - * Currently defined as the maximum that can be represented, rounded down - * to a whole number of bytes. - * This is an uncast value so that it can be used in preprocessor - * conditionals. */ -#define PSA_MAX_KEY_BITS 0xfff8 - -/** A mask of flags that can be stored in key attributes. - * - * This type is also used internally to store flags in slots. Internal - * flags are defined in library/psa_crypto_core.h. Internal flags may have - * the same value as external flags if they are properly handled during - * key creation and in psa_get_key_attributes. - */ -typedef uint16_t psa_key_attributes_flag_t; - -#define MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER \ - ((psa_key_attributes_flag_t) 0x0001) - -/* A mask of key attribute flags used externally only. - * Only meant for internal checks inside the library. */ -#define MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY ( \ - MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER | \ - 0) - -/* A mask of key attribute flags used both internally and externally. - * Currently there aren't any. */ -#define MBEDTLS_PSA_KA_MASK_DUAL_USE ( \ - 0) - -typedef struct { - psa_key_type_t MBEDTLS_PRIVATE(type); - psa_key_bits_t MBEDTLS_PRIVATE(bits); - psa_key_lifetime_t MBEDTLS_PRIVATE(lifetime); - mbedtls_svc_key_id_t MBEDTLS_PRIVATE(id); - psa_key_policy_t MBEDTLS_PRIVATE(policy); - psa_key_attributes_flag_t MBEDTLS_PRIVATE(flags); -} psa_core_key_attributes_t; - -#define PSA_CORE_KEY_ATTRIBUTES_INIT { PSA_KEY_TYPE_NONE, 0, \ - PSA_KEY_LIFETIME_VOLATILE, \ - MBEDTLS_SVC_KEY_ID_INIT, \ - PSA_KEY_POLICY_INIT, 0 } - -struct psa_key_attributes_s { - psa_core_key_attributes_t MBEDTLS_PRIVATE(core); -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) - psa_key_slot_number_t MBEDTLS_PRIVATE(slot_number); -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ - void *MBEDTLS_PRIVATE(domain_parameters); - size_t MBEDTLS_PRIVATE(domain_parameters_size); -#endif /* PSA_USE_KEY_DOMAIN_PARAMETERS */ -}; - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ -#define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT, 0, NULL, 0 } -#else -#define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT, 0 } -#endif /* PSA_USE_KEY_DOMAIN_PARAMETERS */ -#else -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ -#define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT, NULL, 0 } -#else -#define PSA_KEY_ATTRIBUTES_INIT { PSA_CORE_KEY_ATTRIBUTES_INIT } -#endif /* PSA_USE_KEY_DOMAIN_PARAMETERS */ -#endif - -static inline struct psa_key_attributes_s psa_key_attributes_init(void) -{ - const struct psa_key_attributes_s v = PSA_KEY_ATTRIBUTES_INIT; - return v; -} - -static inline void psa_set_key_id(psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t key) -{ - psa_key_lifetime_t lifetime = attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime); - - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id) = key; - - if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) { - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime) = - PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( - PSA_KEY_LIFETIME_PERSISTENT, - PSA_KEY_LIFETIME_GET_LOCATION(lifetime)); - } -} - -static inline mbedtls_svc_key_id_t psa_get_key_id( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id); -} - -#ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER -static inline void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes, - mbedtls_key_owner_id_t owner) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(owner) = owner; -} -#endif - -static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes, - psa_key_lifetime_t lifetime) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime) = lifetime; - if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) { -#ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(key_id) = 0; -#else - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(id) = 0; -#endif - } -} - -static inline psa_key_lifetime_t psa_get_key_lifetime( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(lifetime); -} - -static inline void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags) -{ - if (*usage_flags & PSA_KEY_USAGE_SIGN_HASH) { - *usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE; - } - - if (*usage_flags & PSA_KEY_USAGE_VERIFY_HASH) { - *usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE; - } -} - -static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes, - psa_key_usage_t usage_flags) -{ - psa_extend_key_usage_flags(&usage_flags); - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(usage) = usage_flags; -} - -static inline psa_key_usage_t psa_get_key_usage_flags( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(usage); -} - -static inline void psa_set_key_algorithm(psa_key_attributes_t *attributes, - psa_algorithm_t alg) -{ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg) = alg; -} - -static inline psa_algorithm_t psa_get_key_algorithm( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg); -} - -/* This function is declared in crypto_extra.h, which comes after this - * header file, but we need the function here, so repeat the declaration. */ -psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes, - psa_key_type_t type, - const uint8_t *data, - size_t data_length); - -static inline void psa_set_key_type(psa_key_attributes_t *attributes, - psa_key_type_t type) -{ -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ - if (attributes->MBEDTLS_PRIVATE(domain_parameters) == NULL){ -#endif - /* Common case: quick path */ - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(type) = type; -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ - } else { - /* Call the bigger function to free the old domain parameters. - * Ignore any errors which may arise due to type requiring - * non-default domain parameters, since this function can't - * report errors. */ - (void) psa_set_key_domain_parameters(attributes, type, NULL, 0); - } -#endif -} - -static inline psa_key_type_t psa_get_key_type( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(type); -} - -static inline void psa_set_key_bits(psa_key_attributes_t *attributes, - size_t bits) -{ - if (bits > PSA_MAX_KEY_BITS) { - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(bits) = PSA_KEY_BITS_TOO_LARGE; - } else { - attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(bits) = (psa_key_bits_t) bits; - } -} - -static inline size_t psa_get_key_bits( - const psa_key_attributes_t *attributes) -{ - return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(bits); -} - -struct psa_pake_cipher_suite_s { - psa_algorithm_t algorithm; - psa_pake_primitive_t primitive; - uint32_t key_confirmation; -}; - -#define PSA_PAKE_CIPHER_SUITE_INIT {PSA_ALG_NONE, 0, 0} -static inline struct psa_pake_cipher_suite_s psa_pake_cipher_suite_init(void) -{ - const struct psa_pake_cipher_suite_s v = PSA_PAKE_CIPHER_SUITE_INIT; - return v; -} - -struct psa_pake_operation_s { /*!!OM*/ -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - psa_algorithm_t MBEDTLS_PRIVATE(alg); - unsigned int MBEDTLS_PRIVATE(user_set) : 1; - unsigned int MBEDTLS_PRIVATE(peer_set) : 1; - unsigned int MBEDTLS_PRIVATE(role_set) : 1; - unsigned int MBEDTLS_PRIVATE(context_set) : 1; - unsigned int MBEDTLS_PRIVATE(is_second) : 1; - unsigned int MBEDTLS_PRIVATE(started) : 1; - unsigned int MBEDTLS_PRIVATE(done) : 1; - unsigned int MBEDTLS_PRIVATE(sequence); - - uint32_t secret_size; - psa_driver_pake_context_t MBEDTLS_PRIVATE(ctx); -#endif -}; - -/* This only zeroes out the first byte in the union, the rest is unspecified. */ -#define PSA_PAKE_OPERATION_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } } -static inline struct psa_pake_operation_s psa_pake_operation_init(void) -{ - const struct psa_pake_operation_s v = PSA_PAKE_OPERATION_INIT; - return v; -} - -/** - * \brief The context for PSA interruptible hash signing. - */ -struct psa_sign_hash_interruptible_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - psa_driver_sign_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx); - - unsigned int MBEDTLS_PRIVATE(error_occurred) : 1; - - uint32_t MBEDTLS_PRIVATE(num_ops); -#endif -}; - -#define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, 0, 0, 0 } - -static inline struct psa_sign_hash_interruptible_operation_s -psa_sign_hash_interruptible_operation_init(void) -{ - const struct psa_sign_hash_interruptible_operation_s v = - PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT; - - return v; -} - -/** - * \brief The context for PSA interruptible hash verification. - */ -struct psa_verify_hash_interruptible_operation_s { -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C) - mbedtls_psa_client_handle_t handle; -#else - /** Unique ID indicating which driver got assigned to do the - * operation. Since driver contexts are driver-specific, swapping - * drivers halfway through the operation is not supported. - * ID values are auto-generated in psa_crypto_driver_wrappers.h - * ID value zero means the context is not valid or not assigned to - * any driver (i.e. none of the driver contexts are active). */ - unsigned int MBEDTLS_PRIVATE(id); - - psa_driver_verify_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx); - - unsigned int MBEDTLS_PRIVATE(error_occurred) : 1; - - uint32_t MBEDTLS_PRIVATE(num_ops); -#endif -}; - -#define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT {} - -static inline struct psa_verify_hash_interruptible_operation_s -psa_verify_hash_interruptible_operation_init(void) -{ - const struct psa_verify_hash_interruptible_operation_s v = - PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT; - - return v; -} - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_STRUCT_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_types.h b/ext/oberon/psa/core/include/psa/crypto_types.h deleted file mode 100644 index c39c2aa230c2..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_types.h +++ /dev/null @@ -1,512 +0,0 @@ -/** - * \file psa/crypto_types.h - * - * \brief PSA cryptography module: type aliases. - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. Drivers must include the appropriate driver - * header file. - * - * This file contains portable definitions of integral types for properties - * of cryptographic keys, designations of cryptographic algorithms, and - * error codes returned by the library. - * - * This header file does not declare any function. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_TYPES_H -#define PSA_CRYPTO_TYPES_H - -/* Make sure the Mbed TLS configuration is visible. */ -#include "mbedtls/build_info.h" -/* Define the MBEDTLS_PRIVATE macro. */ -#include "mbedtls/private_access.h" - -#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE) -#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE -#else -#include "crypto_platform.h" -#endif - -#include - -/** \defgroup error Error codes - * @{ - */ - -/** - * \brief Function return status. - * - * This is either #PSA_SUCCESS (which is zero), indicating success, - * or a small negative value indicating that an error occurred. Errors are - * encoded as one of the \c PSA_ERROR_xxx values defined here. */ -/* If #PSA_SUCCESS is already defined, it means that #psa_status_t - * is also defined in an external header, so prevent its multiple - * definition. - */ -#ifndef PSA_SUCCESS -typedef int32_t psa_status_t; -#endif - -/**@}*/ - -/** \defgroup crypto_types Key and algorithm types - * @{ - */ - -/** \brief Encoding of a key type. - * - * Values of this type are generally constructed by macros called - * `PSA_KEY_TYPE_xxx`. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint16_t psa_key_type_t; - -/** The type of PSA elliptic curve family identifiers. - * - * Values of this type are generally constructed by macros called - * `PSA_ECC_FAMILY_xxx`. - * - * The curve identifier is required to create an ECC key using the - * PSA_KEY_TYPE_ECC_KEY_PAIR() or PSA_KEY_TYPE_ECC_PUBLIC_KEY() - * macros. - * - * Values defined by this standard will never be in the range 0x80-0xff. - * Vendors who define additional families must use an encoding in this range. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint8_t psa_ecc_family_t; - -/** The type of PSA Diffie-Hellman group family identifiers. - * - * Values of this type are generally constructed by macros called - * `PSA_DH_FAMILY_xxx`. - * - * The group identifier is required to create a Diffie-Hellman key using the - * PSA_KEY_TYPE_DH_KEY_PAIR() or PSA_KEY_TYPE_DH_PUBLIC_KEY() - * macros. - * - * Values defined by this standard will never be in the range 0x80-0xff. - * Vendors who define additional families must use an encoding in this range. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint8_t psa_dh_family_t; - -/** \brief Encoding of a cryptographic algorithm. - * - * Values of this type are generally constructed by macros called - * `PSA_ALG_xxx`. - * - * For algorithms that can be applied to multiple key types, this type - * does not encode the key type. For example, for symmetric ciphers - * based on a block cipher, #psa_algorithm_t encodes the block cipher - * mode and the padding mode while the block cipher itself is encoded - * via #psa_key_type_t. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint32_t psa_algorithm_t; - -/**@}*/ - -/** \defgroup key_lifetimes Key lifetimes - * @{ - */ - -/** Encoding of key lifetimes. - * - * The lifetime of a key indicates where it is stored and what system actions - * may create and destroy it. - * - * Lifetime values have the following structure: - * - Bits 0-7 (#PSA_KEY_LIFETIME_GET_PERSISTENCE(\c lifetime)): - * persistence level. This value indicates what device management - * actions can cause it to be destroyed. In particular, it indicates - * whether the key is _volatile_ or _persistent_. - * See ::psa_key_persistence_t for more information. - * - Bits 8-31 (#PSA_KEY_LIFETIME_GET_LOCATION(\c lifetime)): - * location indicator. This value indicates which part of the system - * has access to the key material and can perform operations using the key. - * See ::psa_key_location_t for more information. - * - * Volatile keys are automatically destroyed when the application instance - * terminates or on a power reset of the device. Persistent keys are - * preserved until the application explicitly destroys them or until an - * integration-specific device management event occurs (for example, - * a factory reset). - * - * Persistent keys have a key identifier of type #mbedtls_svc_key_id_t. - * This identifier remains valid throughout the lifetime of the key, - * even if the application instance that created the key terminates. - * The application can call psa_open_key() to open a persistent key that - * it created previously. - * - * The default lifetime of a key is #PSA_KEY_LIFETIME_VOLATILE. The lifetime - * #PSA_KEY_LIFETIME_PERSISTENT is supported if persistent storage is - * available. Other lifetime values may be supported depending on the - * library configuration. - * - * Values of this type are generally constructed by macros called - * `PSA_KEY_LIFETIME_xxx`. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint32_t psa_key_lifetime_t; - -/** Encoding of key persistence levels. - * - * What distinguishes different persistence levels is what device management - * events may cause keys to be destroyed. _Volatile_ keys are destroyed - * by a power reset. Persistent keys may be destroyed by events such as - * a transfer of ownership or a factory reset. What management events - * actually affect persistent keys at different levels is outside the - * scope of the PSA Cryptography specification. - * - * The PSA Cryptography specification defines the following values of - * persistence levels: - * - \c 0 = #PSA_KEY_PERSISTENCE_VOLATILE: volatile key. - * A volatile key is automatically destroyed by the implementation when - * the application instance terminates. In particular, a volatile key - * is automatically destroyed on a power reset of the device. - * - \c 1 = #PSA_KEY_PERSISTENCE_DEFAULT: - * persistent key with a default lifetime. - * - \c 2-254: currently not supported by Mbed TLS. - * - \c 255 = #PSA_KEY_PERSISTENCE_READ_ONLY: - * read-only or write-once key. - * A key with this persistence level cannot be destroyed. - * Mbed TLS does not currently offer a way to create such keys, but - * integrations of Mbed TLS can use it for built-in keys that the - * application cannot modify (for example, a hardware unique key (HUK)). - * - * \note Key persistence levels are 8-bit values. Key management - * interfaces operate on lifetimes (type ::psa_key_lifetime_t) which - * encode the persistence as the lower 8 bits of a 32-bit value. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint8_t psa_key_persistence_t; - -/** Encoding of key location indicators. - * - * If an integration of Mbed TLS can make calls to external - * cryptoprocessors such as secure elements, the location of a key - * indicates which secure element performs the operations on the key. - * Depending on the design of the secure element, the key - * material may be stored either in the secure element, or - * in wrapped (encrypted) form alongside the key metadata in the - * primary local storage. - * - * The PSA Cryptography API specification defines the following values of - * location indicators: - * - \c 0: primary local storage. - * This location is always available. - * The primary local storage is typically the same storage area that - * contains the key metadata. - * - \c 1: primary secure element. - * Integrations of Mbed TLS should support this value if there is a secure - * element attached to the operating environment. - * As a guideline, secure elements may provide higher resistance against - * side channel and physical attacks than the primary local storage, but may - * have restrictions on supported key types, sizes, policies and operations - * and may have different performance characteristics. - * - \c 2-0x7fffff: other locations defined by a PSA specification. - * The PSA Cryptography API does not currently assign any meaning to these - * locations, but future versions of that specification or other PSA - * specifications may do so. - * - \c 0x800000-0xffffff: vendor-defined locations. - * No PSA specification will assign a meaning to locations in this range. - * - * \note Key location indicators are 24-bit values. Key management - * interfaces operate on lifetimes (type ::psa_key_lifetime_t) which - * encode the location as the upper 24 bits of a 32-bit value. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint32_t psa_key_location_t; - -/** Encoding of identifiers of persistent keys. - * - * - Applications may freely choose key identifiers in the range - * #PSA_KEY_ID_USER_MIN to #PSA_KEY_ID_USER_MAX. - * - The implementation may define additional key identifiers in the range - * #PSA_KEY_ID_VENDOR_MIN to #PSA_KEY_ID_VENDOR_MAX. - * - 0 is reserved as an invalid key identifier. - * - Key identifiers outside these ranges are reserved for future use. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to how values are allocated must require careful - * consideration to allow backward compatibility. - */ -typedef uint32_t psa_key_id_t; - -/** Encoding of key identifiers as seen inside the PSA Crypto implementation. - * - * When PSA Crypto is built as a library inside an application, this type - * is identical to #psa_key_id_t. When PSA Crypto is built as a service - * that can store keys on behalf of multiple clients, this type - * encodes the #psa_key_id_t value seen by each client application as - * well as extra information that identifies the client that owns - * the key. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) -typedef psa_key_id_t mbedtls_svc_key_id_t; - -#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */ -/* Implementation-specific: The Mbed TLS library can be built as - * part of a multi-client service that exposes the PSA Cryptography API in each - * client and encodes the client identity in the key identifier argument of - * functions such as psa_open_key(). - */ -typedef struct { - psa_key_id_t MBEDTLS_PRIVATE(key_id); - mbedtls_key_owner_id_t MBEDTLS_PRIVATE(owner); -} mbedtls_svc_key_id_t; - -#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */ - -/**@}*/ - -/** \defgroup policy Key policies - * @{ - */ - -/** \brief Encoding of permitted usage on a key. - * - * Values of this type are generally constructed as bitwise-ors of macros - * called `PSA_KEY_USAGE_xxx`. - * - * \note Values of this type are encoded in the persistent key store. - * Any changes to existing values will require bumping the storage - * format version and providing a translation when reading the old - * format. - */ -typedef uint32_t psa_key_usage_t; - -/**@}*/ - -/** \defgroup attributes Key attributes - * @{ - */ - -/** The type of a structure containing key attributes. - * - * This is an opaque structure that can represent the metadata of a key - * object. Metadata that can be stored in attributes includes: - * - The location of the key in storage, indicated by its key identifier - * and its lifetime. - * - The key's policy, comprising usage flags and a specification of - * the permitted algorithm(s). - * - Information about the key itself: the key type and its size. - * - Additional implementation-defined attributes. - * - * The actual key material is not considered an attribute of a key. - * Key attributes do not contain information that is generally considered - * highly confidential. - * - * An attribute structure works like a simple data structure where each function - * `psa_set_key_xxx` sets a field and the corresponding function - * `psa_get_key_xxx` retrieves the value of the corresponding field. - * However, a future version of the library may report values that are - * equivalent to the original one, but have a different encoding. Invalid - * values may be mapped to different, also invalid values. - * - * An attribute structure may contain references to auxiliary resources, - * for example pointers to allocated memory or indirect references to - * pre-calculated values. In order to free such resources, the application - * must call psa_reset_key_attributes(). As an exception, calling - * psa_reset_key_attributes() on an attribute structure is optional if - * the structure has only been modified by the following functions - * since it was initialized or last reset with psa_reset_key_attributes(): - * - psa_set_key_id() - * - psa_set_key_lifetime() - * - psa_set_key_type() - * - psa_set_key_bits() - * - psa_set_key_usage_flags() - * - psa_set_key_algorithm() - * - * Before calling any function on a key attribute structure, the application - * must initialize it by any of the following means: - * - Set the structure to all-bits-zero, for example: - * \code - * psa_key_attributes_t attributes; - * memset(&attributes, 0, sizeof(attributes)); - * \endcode - * - Initialize the structure to logical zero values, for example: - * \code - * psa_key_attributes_t attributes = {0}; - * \endcode - * - Initialize the structure to the initializer #PSA_KEY_ATTRIBUTES_INIT, - * for example: - * \code - * psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - * \endcode - * - Assign the result of the function psa_key_attributes_init() - * to the structure, for example: - * \code - * psa_key_attributes_t attributes; - * attributes = psa_key_attributes_init(); - * \endcode - * - * A freshly initialized attribute structure contains the following - * values: - * - * - lifetime: #PSA_KEY_LIFETIME_VOLATILE. - * - key identifier: 0 (which is not a valid key identifier). - * - type: \c 0 (meaning that the type is unspecified). - * - key size: \c 0 (meaning that the size is unspecified). - * - usage flags: \c 0 (which allows no usage except exporting a public key). - * - algorithm: \c 0 (which allows no cryptographic usage, but allows - * exporting). - * - * A typical sequence to create a key is as follows: - * -# Create and initialize an attribute structure. - * -# If the key is persistent, call psa_set_key_id(). - * Also call psa_set_key_lifetime() to place the key in a non-default - * location. - * -# Set the key policy with psa_set_key_usage_flags() and - * psa_set_key_algorithm(). - * -# Set the key type with psa_set_key_type(). - * Skip this step if copying an existing key with psa_copy_key(). - * -# When generating a random key with psa_generate_key() or deriving a key - * with psa_key_derivation_output_key(), set the desired key size with - * psa_set_key_bits(). - * -# Call a key creation function: psa_import_key(), psa_generate_key(), - * psa_key_derivation_output_key() or psa_copy_key(). This function reads - * the attribute structure, creates a key with these attributes, and - * outputs a key identifier to the newly created key. - * -# The attribute structure is now no longer necessary. - * You may call psa_reset_key_attributes(), although this is optional - * with the workflow presented here because the attributes currently - * defined in this specification do not require any additional resources - * beyond the structure itself. - * - * A typical sequence to query a key's attributes is as follows: - * -# Call psa_get_key_attributes(). - * -# Call `psa_get_key_xxx` functions to retrieve the attribute(s) that - * you are interested in. - * -# Call psa_reset_key_attributes() to free any resources that may be - * used by the attribute structure. - * - * Once a key has been created, it is impossible to change its attributes. - */ -typedef struct psa_key_attributes_s psa_key_attributes_t; - - -#ifndef __DOXYGEN_ONLY__ -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -/* Mbed TLS defines this type in crypto_types.h because it is also - * visible to applications through an implementation-specific extension. - * For the PSA Cryptography specification, this type is only visible - * via crypto_se_driver.h. */ -typedef uint64_t psa_key_slot_number_t; -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ -#endif /* !__DOXYGEN_ONLY__ */ - -/**@}*/ - -/** \defgroup derivation Key derivation - * @{ - */ - -/** \brief Encoding of the step of a key derivation. - * - * Values of this type are generally constructed by macros called - * `PSA_KEY_DERIVATION_INPUT_xxx`. - */ -typedef uint16_t psa_key_derivation_step_t; - -/**@}*/ - -/** The type of the data structure for PAKE cipher suites. - * - * This is an implementation-defined \c struct. Applications should not - * make any assumptions about the content of this structure. - * Implementation details can change in future versions without notice. - */ -typedef struct psa_pake_cipher_suite_s psa_pake_cipher_suite_t; - -/** Encoding of the type of the PAKE's primitive. -* -* Values defined by this standard will never be in the range 0x80-0xff. -* Vendors who define additional types must use an encoding in this range. -* -* For more information see the documentation of individual -* \c PSA_PAKE_PRIMITIVE_TYPE_XXX constants. -*/ -typedef uint8_t psa_pake_primitive_type_t; - -/** \brief Encoding of the family of the primitive associated with the PAKE. -* -* For more information see the documentation of individual -* \c PSA_PAKE_PRIMITIVE_TYPE_XXX constants. -*/ -typedef uint8_t psa_pake_family_t; - -/** \brief Encoding of the primitive associated with the PAKE. -* -* For more information see the documentation of the #PSA_PAKE_PRIMITIVE macro. -*/ -typedef uint32_t psa_pake_primitive_t; - -/** \brief Encoding of the application role of PAKE - * - * Encodes the application's role in the algorithm being executed. For more - * information see the documentation of individual \c PSA_PAKE_ROLE_XXX - * constants. - */ -typedef uint8_t psa_pake_role_t; - -/** Encoding of input and output indicators for PAKE. - * - * Some PAKE algorithms need to exchange more data than just a single key share. - * This type is for encoding additional input and output data for such - * algorithms. - */ -typedef uint8_t psa_pake_step_t; - -#endif /* PSA_CRYPTO_TYPES_H */ diff --git a/ext/oberon/psa/core/include/psa/crypto_values.h b/ext/oberon/psa/core/include/psa/crypto_values.h deleted file mode 100644 index ce7d4c48ec68..000000000000 --- a/ext/oberon/psa/core/include/psa/crypto_values.h +++ /dev/null @@ -1,2906 +0,0 @@ -/** - * \file psa/crypto_values.h - * - * \brief PSA cryptography module: macros to build and analyze integer values. - * - * \note This file may not be included directly. Applications must - * include psa/crypto.h. Drivers must include the appropriate driver - * header file. - * - * This file contains portable definitions of macros to build and analyze - * values of integral types that encode properties of cryptographic keys, - * designations of cryptographic algorithms, and error codes returned by - * the library. - * - * Note that many of the constants defined in this file are embedded in - * the persistent key store, as part of key metadata (including usage - * policies). As a consequence, they must not be changed (unless the storage - * format version changes). - * - * This header file only defines preprocessor macros. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#ifndef PSA_CRYPTO_VALUES_H -#define PSA_CRYPTO_VALUES_H -#include "mbedtls/private_access.h" - -/** \defgroup error Error codes - * @{ - */ - -/* PSA error codes */ - -/* Error codes are standardized across PSA domains (framework, crypto, storage, - * etc.). Do not change the values in this section or even the expansions - * of each macro: it must be possible to `#include` both this header - * and some other PSA component's headers in the same C source, - * which will lead to duplicate definitions of the `PSA_SUCCESS` and - * `PSA_ERROR_xxx` macros, which is ok if and only if the macros expand - * to the same sequence of tokens. - * - * If you must add a new - * value, check with the Arm PSA framework group to pick one that other - * domains aren't already using. */ - -/* Tell uncrustify not to touch the constant definitions, otherwise - * it might change the spacing to something that is not PSA-compliant - * (e.g. adding a space after casts). - * - * *INDENT-OFF* - */ - -/** The action was completed successfully. */ -#define PSA_SUCCESS ((psa_status_t)0) - -/** An error occurred that does not correspond to any defined - * failure cause. - * - * Implementations may use this error code if none of the other standard - * error codes are applicable. */ -#define PSA_ERROR_GENERIC_ERROR ((psa_status_t)-132) - -/** The requested operation or a parameter is not supported - * by this implementation. - * - * Implementations should return this error code when an enumeration - * parameter such as a key type, algorithm, etc. is not recognized. - * If a combination of parameters is recognized and identified as - * not valid, return #PSA_ERROR_INVALID_ARGUMENT instead. */ -#define PSA_ERROR_NOT_SUPPORTED ((psa_status_t)-134) - -/** The requested action is denied by a policy. - * - * Implementations should return this error code when the parameters - * are recognized as valid and supported, and a policy explicitly - * denies the requested operation. - * - * If a subset of the parameters of a function call identify a - * forbidden operation, and another subset of the parameters are - * not valid or not supported, it is unspecified whether the function - * returns #PSA_ERROR_NOT_PERMITTED, #PSA_ERROR_NOT_SUPPORTED or - * #PSA_ERROR_INVALID_ARGUMENT. */ -#define PSA_ERROR_NOT_PERMITTED ((psa_status_t)-133) - -/** An output buffer is too small. - * - * Applications can call the \c PSA_xxx_SIZE macro listed in the function - * description to determine a sufficient buffer size. - * - * Implementations should preferably return this error code only - * in cases when performing the operation with a larger output - * buffer would succeed. However implementations may return this - * error if a function has invalid or unsupported parameters in addition - * to the parameters that determine the necessary output buffer size. */ -#define PSA_ERROR_BUFFER_TOO_SMALL ((psa_status_t)-138) - -/** Asking for an item that already exists - * - * Implementations should return this error, when attempting - * to write an item (like a key) that already exists. */ -#define PSA_ERROR_ALREADY_EXISTS ((psa_status_t)-139) - -/** Asking for an item that doesn't exist - * - * Implementations should return this error, if a requested item (like - * a key) does not exist. */ -#define PSA_ERROR_DOES_NOT_EXIST ((psa_status_t)-140) - -/** The requested action cannot be performed in the current state. - * - * Multipart operations return this error when one of the - * functions is called out of sequence. Refer to the function - * descriptions for permitted sequencing of functions. - * - * Implementations shall not return this error code to indicate - * that a key either exists or not, - * but shall instead return #PSA_ERROR_ALREADY_EXISTS or #PSA_ERROR_DOES_NOT_EXIST - * as applicable. - * - * Implementations shall not return this error code to indicate that a - * key identifier is invalid, but shall return #PSA_ERROR_INVALID_HANDLE - * instead. */ -#define PSA_ERROR_BAD_STATE ((psa_status_t)-137) - -/** The parameters passed to the function are invalid. - * - * Implementations may return this error any time a parameter or - * combination of parameters are recognized as invalid. - * - * Implementations shall not return this error code to indicate that a - * key identifier is invalid, but shall return #PSA_ERROR_INVALID_HANDLE - * instead. - */ -#define PSA_ERROR_INVALID_ARGUMENT ((psa_status_t)-135) - -/** There is not enough runtime memory. - * - * If the action is carried out across multiple security realms, this - * error can refer to available memory in any of the security realms. */ -#define PSA_ERROR_INSUFFICIENT_MEMORY ((psa_status_t)-141) - -/** There is not enough persistent storage. - * - * Functions that modify the key storage return this error code if - * there is insufficient storage space on the host media. In addition, - * many functions that do not otherwise access storage may return this - * error code if the implementation requires a mandatory log entry for - * the requested action and the log storage space is full. */ -#define PSA_ERROR_INSUFFICIENT_STORAGE ((psa_status_t)-142) - -/** There was a communication failure inside the implementation. - * - * This can indicate a communication failure between the application - * and an external cryptoprocessor or between the cryptoprocessor and - * an external volatile or persistent memory. A communication failure - * may be transient or permanent depending on the cause. - * - * \warning If a function returns this error, it is undetermined - * whether the requested action has completed or not. Implementations - * should return #PSA_SUCCESS on successful completion whenever - * possible, however functions may return #PSA_ERROR_COMMUNICATION_FAILURE - * if the requested action was completed successfully in an external - * cryptoprocessor but there was a breakdown of communication before - * the cryptoprocessor could report the status to the application. - */ -#define PSA_ERROR_COMMUNICATION_FAILURE ((psa_status_t)-145) - -/** There was a storage failure that may have led to data loss. - * - * This error indicates that some persistent storage is corrupted. - * It should not be used for a corruption of volatile memory - * (use #PSA_ERROR_CORRUPTION_DETECTED), for a communication error - * between the cryptoprocessor and its external storage (use - * #PSA_ERROR_COMMUNICATION_FAILURE), or when the storage is - * in a valid state but is full (use #PSA_ERROR_INSUFFICIENT_STORAGE). - * - * Note that a storage failure does not indicate that any data that was - * previously read is invalid. However this previously read data may no - * longer be readable from storage. - * - * When a storage failure occurs, it is no longer possible to ensure - * the global integrity of the keystore. Depending on the global - * integrity guarantees offered by the implementation, access to other - * data may or may not fail even if the data is still readable but - * its integrity cannot be guaranteed. - * - * Implementations should only use this error code to report a - * permanent storage corruption. However application writers should - * keep in mind that transient errors while reading the storage may be - * reported using this error code. */ -#define PSA_ERROR_STORAGE_FAILURE ((psa_status_t)-146) - -/** A hardware failure was detected. - * - * A hardware failure may be transient or permanent depending on the - * cause. */ -#define PSA_ERROR_HARDWARE_FAILURE ((psa_status_t)-147) - -/** A tampering attempt was detected. - * - * If an application receives this error code, there is no guarantee - * that previously accessed or computed data was correct and remains - * confidential. Applications should not perform any security function - * and should enter a safe failure state. - * - * Implementations may return this error code if they detect an invalid - * state that cannot happen during normal operation and that indicates - * that the implementation's security guarantees no longer hold. Depending - * on the implementation architecture and on its security and safety goals, - * the implementation may forcibly terminate the application. - * - * This error code is intended as a last resort when a security breach - * is detected and it is unsure whether the keystore data is still - * protected. Implementations shall only return this error code - * to report an alarm from a tampering detector, to indicate that - * the confidentiality of stored data can no longer be guaranteed, - * or to indicate that the integrity of previously returned data is now - * considered compromised. Implementations shall not use this error code - * to indicate a hardware failure that merely makes it impossible to - * perform the requested operation (use #PSA_ERROR_COMMUNICATION_FAILURE, - * #PSA_ERROR_STORAGE_FAILURE, #PSA_ERROR_HARDWARE_FAILURE, - * #PSA_ERROR_INSUFFICIENT_ENTROPY or other applicable error code - * instead). - * - * This error indicates an attack against the application. Implementations - * shall not return this error code as a consequence of the behavior of - * the application itself. */ -#define PSA_ERROR_CORRUPTION_DETECTED ((psa_status_t)-151) - -/** There is not enough entropy to generate random data needed - * for the requested action. - * - * This error indicates a failure of a hardware random generator. - * Application writers should note that this error can be returned not - * only by functions whose purpose is to generate random data, such - * as key, IV or nonce generation, but also by functions that execute - * an algorithm with a randomized result, as well as functions that - * use randomization of intermediate computations as a countermeasure - * to certain attacks. - * - * Implementations should avoid returning this error after psa_crypto_init() - * has succeeded. Implementations should generate sufficient - * entropy during initialization and subsequently use a cryptographically - * secure pseudorandom generator (PRNG). However implementations may return - * this error at any time if a policy requires the PRNG to be reseeded - * during normal operation. */ -#define PSA_ERROR_INSUFFICIENT_ENTROPY ((psa_status_t)-148) - -/** The signature, MAC or hash is incorrect. - * - * Verification functions return this error if the verification - * calculations completed successfully, and the value to be verified - * was determined to be incorrect. - * - * If the value to verify has an invalid size, implementations may return - * either #PSA_ERROR_INVALID_ARGUMENT or #PSA_ERROR_INVALID_SIGNATURE. */ -#define PSA_ERROR_INVALID_SIGNATURE ((psa_status_t)-149) - -/** The decrypted padding is incorrect. - * - * \warning In some protocols, when decrypting data, it is essential that - * the behavior of the application does not depend on whether the padding - * is correct, down to precise timing. Applications should prefer - * protocols that use authenticated encryption rather than plain - * encryption. If the application must perform a decryption of - * unauthenticated data, the application writer should take care not - * to reveal whether the padding is invalid. - * - * Implementations should strive to make valid and invalid padding - * as close as possible to indistinguishable to an external observer. - * In particular, the timing of a decryption operation should not - * depend on the validity of the padding. */ -#define PSA_ERROR_INVALID_PADDING ((psa_status_t)-150) - -/** Return this error when there's insufficient data when attempting - * to read from a resource. */ -#define PSA_ERROR_INSUFFICIENT_DATA ((psa_status_t)-143) - -/** The key identifier is not valid. See also :ref:\`key-handles\`. - */ -#define PSA_ERROR_INVALID_HANDLE ((psa_status_t)-136) - -/** Stored data has been corrupted. - * - * This error indicates that some persistent storage has suffered corruption. - * It does not indicate the following situations, which have specific error - * codes: - * - * - A corruption of volatile memory - use #PSA_ERROR_CORRUPTION_DETECTED. - * - A communication error between the cryptoprocessor and its external - * storage - use #PSA_ERROR_COMMUNICATION_FAILURE. - * - When the storage is in a valid state but is full - use - * #PSA_ERROR_INSUFFICIENT_STORAGE. - * - When the storage fails for other reasons - use - * #PSA_ERROR_STORAGE_FAILURE. - * - When the stored data is not valid - use #PSA_ERROR_DATA_INVALID. - * - * \note A storage corruption does not indicate that any data that was - * previously read is invalid. However this previously read data might no - * longer be readable from storage. - * - * When a storage failure occurs, it is no longer possible to ensure the - * global integrity of the keystore. - */ -#define PSA_ERROR_DATA_CORRUPT ((psa_status_t)-152) - -/** Data read from storage is not valid for the implementation. - * - * This error indicates that some data read from storage does not have a valid - * format. It does not indicate the following situations, which have specific - * error codes: - * - * - When the storage or stored data is corrupted - use #PSA_ERROR_DATA_CORRUPT - * - When the storage fails for other reasons - use #PSA_ERROR_STORAGE_FAILURE - * - An invalid argument to the API - use #PSA_ERROR_INVALID_ARGUMENT - * - * This error is typically a result of either storage corruption on a - * cleartext storage backend, or an attempt to read data that was - * written by an incompatible version of the library. - */ -#define PSA_ERROR_DATA_INVALID ((psa_status_t)-153) - -/** The function that returns this status is defined as interruptible and - * still has work to do, thus the user should call the function again with the - * same operation context until it either returns #PSA_SUCCESS or any other - * error. This is not an error per se, more a notification of status. - */ -#define PSA_OPERATION_INCOMPLETE ((psa_status_t)-248) - -/* *INDENT-ON* */ - -/**@}*/ - -/** \defgroup crypto_types Key and algorithm types - * @{ - */ - -/* Note that key type values, including ECC family and DH group values, are - * embedded in the persistent key store, as part of key metadata. As a - * consequence, they must not be changed (unless the storage format version - * changes). - */ - -/** An invalid key type value. - * - * Zero is not the encoding of any key type. - */ -#define PSA_KEY_TYPE_NONE ((psa_key_type_t) 0x0000) - -/** Vendor-defined key type flag. - * - * Key types defined by this standard will never have the - * #PSA_KEY_TYPE_VENDOR_FLAG bit set. Vendors who define additional key types - * must use an encoding with the #PSA_KEY_TYPE_VENDOR_FLAG bit set and should - * respect the bitwise structure used by standard encodings whenever practical. - */ -#define PSA_KEY_TYPE_VENDOR_FLAG ((psa_key_type_t) 0x8000) - -#define PSA_KEY_TYPE_CATEGORY_MASK ((psa_key_type_t) 0x7000) -#define PSA_KEY_TYPE_CATEGORY_RAW ((psa_key_type_t) 0x1000) -#define PSA_KEY_TYPE_CATEGORY_SYMMETRIC ((psa_key_type_t) 0x2000) -#define PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ((psa_key_type_t) 0x4000) -#define PSA_KEY_TYPE_CATEGORY_KEY_PAIR ((psa_key_type_t) 0x7000) - -#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ((psa_key_type_t) 0x3000) - -/** Whether a key type is vendor-defined. - * - * See also #PSA_KEY_TYPE_VENDOR_FLAG. - */ -#define PSA_KEY_TYPE_IS_VENDOR_DEFINED(type) \ - (((type) & PSA_KEY_TYPE_VENDOR_FLAG) != 0) - -/** Whether a key type is an unstructured array of bytes. - * - * This encompasses both symmetric keys and non-key data. - */ -#define PSA_KEY_TYPE_IS_UNSTRUCTURED(type) \ - (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_RAW || \ - ((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC) - -/** Whether a key type is asymmetric: either a key pair or a public key. */ -#define PSA_KEY_TYPE_IS_ASYMMETRIC(type) \ - (((type) & PSA_KEY_TYPE_CATEGORY_MASK \ - & ~PSA_KEY_TYPE_CATEGORY_FLAG_PAIR) == \ - PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY) -/** Whether a key type is the public part of a key pair. */ -#define PSA_KEY_TYPE_IS_PUBLIC_KEY(type) \ - (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY) -/** Whether a key type is a key pair containing a private part and a public - * part. */ -#define PSA_KEY_TYPE_IS_KEY_PAIR(type) \ - (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_KEY_PAIR) -/** The key pair type corresponding to a public key type. - * - * You may also pass a key pair type as \p type, it will be left unchanged. - * - * \param type A public key type or key pair type. - * - * \return The corresponding key pair type. - * If \p type is not a public key or a key pair, - * the return value is undefined. - */ -#define PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY(type) \ - ((type) | PSA_KEY_TYPE_CATEGORY_FLAG_PAIR) -/** The public key type corresponding to a key pair type. - * - * You may also pass a key pair type as \p type, it will be left unchanged. - * - * \param type A public key type or key pair type. - * - * \return The corresponding public key type. - * If \p type is not a public key or a key pair, - * the return value is undefined. - */ -#define PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) \ - ((type) & ~PSA_KEY_TYPE_CATEGORY_FLAG_PAIR) - -/** Raw data. - * - * A "key" of this type cannot be used for any cryptographic operation. - * Applications may use this type to store arbitrary data in the keystore. */ -#define PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t) 0x1001) - -/** HMAC key. - * - * The key policy determines which underlying hash algorithm the key can be - * used for. - * - * HMAC keys should generally have the same size as the underlying hash. - * This size can be calculated with #PSA_HASH_LENGTH(\c alg) where - * \c alg is the HMAC algorithm or the underlying hash algorithm. */ -#define PSA_KEY_TYPE_HMAC ((psa_key_type_t) 0x1100) - -/** A secret for key derivation. - * - * This key type is for high-entropy secrets only. For low-entropy secrets, - * #PSA_KEY_TYPE_PASSWORD should be used instead. - * - * These keys can be used as the #PSA_KEY_DERIVATION_INPUT_SECRET or - * #PSA_KEY_DERIVATION_INPUT_PASSWORD input of key derivation algorithms. - * - * The key policy determines which key derivation algorithm the key - * can be used for. - */ -#define PSA_KEY_TYPE_DERIVE ((psa_key_type_t) 0x1200) - -/** A low-entropy secret for password hashing or key derivation. - * - * This key type is suitable for passwords and passphrases which are typically - * intended to be memorizable by humans, and have a low entropy relative to - * their size. It can be used for randomly generated or derived keys with - * maximum or near-maximum entropy, but #PSA_KEY_TYPE_DERIVE is more suitable - * for such keys. It is not suitable for passwords with extremely low entropy, - * such as numerical PINs. - * - * These keys can be used as the #PSA_KEY_DERIVATION_INPUT_PASSWORD input of - * key derivation algorithms. Algorithms that accept such an input were - * designed to accept low-entropy secret and are known as password hashing or - * key stretching algorithms. - * - * These keys cannot be used as the #PSA_KEY_DERIVATION_INPUT_SECRET input of - * key derivation algorithms, as the algorithms that take such an input expect - * it to be high-entropy. - * - * The key policy determines which key derivation algorithm the key can be - * used for, among the permissible subset defined above. - */ -#define PSA_KEY_TYPE_PASSWORD ((psa_key_type_t) 0x1203) - -/** A secret value that can be used to verify a password hash. - * - * The key policy determines which key derivation algorithm the key - * can be used for, among the same permissible subset as for - * #PSA_KEY_TYPE_PASSWORD. - */ -#define PSA_KEY_TYPE_PASSWORD_HASH ((psa_key_type_t) 0x1205) - -/** A secret value that can be used in when computing a password hash. - * - * The key policy determines which key derivation algorithm the key - * can be used for, among the subset of algorithms that can use pepper. - */ -#define PSA_KEY_TYPE_PEPPER ((psa_key_type_t) 0x1206) - -/** Key for a cipher, AEAD or MAC algorithm based on the AES block cipher. - * - * The size of the key can be 16 bytes (AES-128), 24 bytes (AES-192) or - * 32 bytes (AES-256). - */ -#define PSA_KEY_TYPE_AES ((psa_key_type_t) 0x2400) - -/** Key for a cipher, AEAD or MAC algorithm based on the - * ARIA block cipher. */ -#define PSA_KEY_TYPE_ARIA ((psa_key_type_t) 0x2406) - -/** Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES). - * - * The size of the key can be 64 bits (single DES), 128 bits (2-key 3DES) or - * 192 bits (3-key 3DES). - * - * Note that single DES and 2-key 3DES are weak and strongly - * deprecated and should only be used to decrypt legacy data. 3-key 3DES - * is weak and deprecated and should only be used in legacy protocols. - */ -#define PSA_KEY_TYPE_DES ((psa_key_type_t) 0x2301) - -/** Key for a cipher, AEAD or MAC algorithm based on the - * Camellia block cipher. */ -#define PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t) 0x2403) - -/** Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm. - * - * ChaCha20 and the ChaCha20_Poly1305 construction are defined in RFC 7539. - * - * \note For ChaCha20 and ChaCha20_Poly1305, Mbed TLS only supports - * 12-byte nonces. - * - * \note For ChaCha20, the initial counter value is 0. To encrypt or decrypt - * with the initial counter value 1, you can process and discard a - * 64-byte block before the real data. - */ -#define PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t) 0x2004) - -/** RSA public key. - * - * The size of an RSA key is the bit size of the modulus. - */ -#define PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t) 0x4001) -/** RSA key pair (private and public key). - * - * The size of an RSA key is the bit size of the modulus. - */ -#define PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t) 0x7001) -/** Whether a key type is an RSA key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_RSA(type) \ - (PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) == PSA_KEY_TYPE_RSA_PUBLIC_KEY) - -#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4100) -#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t) 0x7100) -#define PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t) 0x00ff) -/** Elliptic curve key pair. - * - * The size of an elliptic curve key is the bit size associated with the curve, - * i.e. the bit size of *q* for a curve over a field *Fq*. - * See the documentation of `PSA_ECC_FAMILY_xxx` curve families for details. - * - * \param curve A value of type ::psa_ecc_family_t that - * identifies the ECC curve to be used. - */ -#define PSA_KEY_TYPE_ECC_KEY_PAIR(curve) \ - (PSA_KEY_TYPE_ECC_KEY_PAIR_BASE | (curve)) -/** Elliptic curve public key. - * - * The size of an elliptic curve public key is the same as the corresponding - * private key (see #PSA_KEY_TYPE_ECC_KEY_PAIR and the documentation of - * `PSA_ECC_FAMILY_xxx` curve families). - * - * \param curve A value of type ::psa_ecc_family_t that - * identifies the ECC curve to be used. - */ -#define PSA_KEY_TYPE_ECC_PUBLIC_KEY(curve) \ - (PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE | (curve)) - -/** Whether a key type is an elliptic curve key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_ECC(type) \ - ((PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) & \ - ~PSA_KEY_TYPE_ECC_CURVE_MASK) == PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE) -/** Whether a key type is an elliptic curve key pair. */ -#define PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type) \ - (((type) & ~PSA_KEY_TYPE_ECC_CURVE_MASK) == \ - PSA_KEY_TYPE_ECC_KEY_PAIR_BASE) -/** Whether a key type is an elliptic curve public key. */ -#define PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(type) \ - (((type) & ~PSA_KEY_TYPE_ECC_CURVE_MASK) == \ - PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE) - -/** Extract the curve from an elliptic curve key type. */ -#define PSA_KEY_TYPE_ECC_GET_FAMILY(type) \ - ((psa_ecc_family_t) (PSA_KEY_TYPE_IS_ECC(type) ? \ - ((type) & PSA_KEY_TYPE_ECC_CURVE_MASK) : \ - 0)) - -/** Check if the curve of given family is Weierstrass elliptic curve. */ -#define PSA_ECC_FAMILY_IS_WEIERSTRASS(family) ((family & 0xc0) == 0) - -/** SEC Koblitz curves over prime fields. - * - * This family comprises the following curves: - * secp192k1, secp224k1, secp256k1. - * They are defined in _Standards for Efficient Cryptography_, - * _SEC 2: Recommended Elliptic Curve Domain Parameters_. - * https://www.secg.org/sec2-v2.pdf - */ -#define PSA_ECC_FAMILY_SECP_K1 ((psa_ecc_family_t) 0x17) - -/** SEC random curves over prime fields. - * - * This family comprises the following curves: - * secp192k1, secp224r1, secp256r1, secp384r1, secp521r1. - * They are defined in _Standards for Efficient Cryptography_, - * _SEC 2: Recommended Elliptic Curve Domain Parameters_. - * https://www.secg.org/sec2-v2.pdf - */ -#define PSA_ECC_FAMILY_SECP_R1 ((psa_ecc_family_t) 0x12) -/* SECP160R2 (SEC2 v1, obsolete) */ -#define PSA_ECC_FAMILY_SECP_R2 ((psa_ecc_family_t) 0x1b) - -/** SEC Koblitz curves over binary fields. - * - * This family comprises the following curves: - * sect163k1, sect233k1, sect239k1, sect283k1, sect409k1, sect571k1. - * They are defined in _Standards for Efficient Cryptography_, - * _SEC 2: Recommended Elliptic Curve Domain Parameters_. - * https://www.secg.org/sec2-v2.pdf - */ -#define PSA_ECC_FAMILY_SECT_K1 ((psa_ecc_family_t) 0x27) - -/** SEC random curves over binary fields. - * - * This family comprises the following curves: - * sect163r1, sect233r1, sect283r1, sect409r1, sect571r1. - * They are defined in _Standards for Efficient Cryptography_, - * _SEC 2: Recommended Elliptic Curve Domain Parameters_. - * https://www.secg.org/sec2-v2.pdf - */ -#define PSA_ECC_FAMILY_SECT_R1 ((psa_ecc_family_t) 0x22) - -/** SEC additional random curves over binary fields. - * - * This family comprises the following curve: - * sect163r2. - * It is defined in _Standards for Efficient Cryptography_, - * _SEC 2: Recommended Elliptic Curve Domain Parameters_. - * https://www.secg.org/sec2-v2.pdf - */ -#define PSA_ECC_FAMILY_SECT_R2 ((psa_ecc_family_t) 0x2b) - -/** Brainpool P random curves. - * - * This family comprises the following curves: - * brainpoolP160r1, brainpoolP192r1, brainpoolP224r1, brainpoolP256r1, - * brainpoolP320r1, brainpoolP384r1, brainpoolP512r1. - * It is defined in RFC 5639. - */ -#define PSA_ECC_FAMILY_BRAINPOOL_P_R1 ((psa_ecc_family_t) 0x30) - -/** Curve25519 and Curve448. - * - * This family comprises the following Montgomery curves: - * - 255-bit: Bernstein et al., - * _Curve25519: new Diffie-Hellman speed records_, LNCS 3958, 2006. - * The algorithm #PSA_ALG_ECDH performs X25519 when used with this curve. - * - 448-bit: Hamburg, - * _Ed448-Goldilocks, a new elliptic curve_, NIST ECC Workshop, 2015. - * The algorithm #PSA_ALG_ECDH performs X448 when used with this curve. - */ -#define PSA_ECC_FAMILY_MONTGOMERY ((psa_ecc_family_t) 0x41) - -/** The twisted Edwards curves Ed25519 and Ed448. - * - * These curves are suitable for EdDSA (#PSA_ALG_PURE_EDDSA for both curves, - * #PSA_ALG_ED25519PH for the 255-bit curve, - * #PSA_ALG_ED448PH for the 448-bit curve). - * - * This family comprises the following twisted Edwards curves: - * - 255-bit: Edwards25519, the twisted Edwards curve birationally equivalent - * to Curve25519. - * Bernstein et al., _Twisted Edwards curves_, Africacrypt 2008. - * - 448-bit: Edwards448, the twisted Edwards curve birationally equivalent - * to Curve448. - * Hamburg, _Ed448-Goldilocks, a new elliptic curve_, NIST ECC Workshop, 2015. - */ -#define PSA_ECC_FAMILY_TWISTED_EDWARDS ((psa_ecc_family_t) 0x42) - -#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4200) -#define PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t) 0x7200) -#define PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t) 0x00ff) -/** Diffie-Hellman key pair. - * - * \param group A value of type ::psa_dh_family_t that identifies the - * Diffie-Hellman group to be used. - */ -#define PSA_KEY_TYPE_DH_KEY_PAIR(group) \ - (PSA_KEY_TYPE_DH_KEY_PAIR_BASE | (group)) -/** Diffie-Hellman public key. - * - * \param group A value of type ::psa_dh_family_t that identifies the - * Diffie-Hellman group to be used. - */ -#define PSA_KEY_TYPE_DH_PUBLIC_KEY(group) \ - (PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE | (group)) - -/** Whether a key type is a Diffie-Hellman key (pair or public-only). */ -#define PSA_KEY_TYPE_IS_DH(type) \ - ((PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) & \ - ~PSA_KEY_TYPE_DH_GROUP_MASK) == PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE) -/** Whether a key type is a Diffie-Hellman key pair. */ -#define PSA_KEY_TYPE_IS_DH_KEY_PAIR(type) \ - (((type) & ~PSA_KEY_TYPE_DH_GROUP_MASK) == \ - PSA_KEY_TYPE_DH_KEY_PAIR_BASE) -/** Whether a key type is a Diffie-Hellman public key. */ -#define PSA_KEY_TYPE_IS_DH_PUBLIC_KEY(type) \ - (((type) & ~PSA_KEY_TYPE_DH_GROUP_MASK) == \ - PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE) - -/** Extract the group from a Diffie-Hellman key type. */ -#define PSA_KEY_TYPE_DH_GET_FAMILY(type) \ - ((psa_dh_family_t) (PSA_KEY_TYPE_IS_DH(type) ? \ - ((type) & PSA_KEY_TYPE_DH_GROUP_MASK) : \ - 0)) - -/** Diffie-Hellman groups defined in RFC 7919 Appendix A. - * - * This family includes groups with the following key sizes (in bits): - * 2048, 3072, 4096, 6144, 8192. A given implementation may support - * all of these sizes or only a subset. - */ -#define PSA_DH_FAMILY_RFC7919 ((psa_dh_family_t) 0x03) - -/** Diffie-Hellman groups defined in RFC 3526. - * - * This family includes groups with the following key sizes (in bits): - * 1536, 2048, 3072, 4096, 6144, 8192. A given implementation may support - * all of these sizes or only a subset. - */ -#define PSA_DH_FAMILY_RFC3526 ((psa_dh_family_t) 0x05) /*!!OM*/ - -#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT(type) \ - (((type) >> 8) & 7) -/** The block size of a block cipher. - * - * \param type A cipher key type (value of type #psa_key_type_t). - * - * \return The block size for a block cipher, or 1 for a stream cipher. - * The return value is undefined if \p type is not a supported - * cipher key type. - * - * \note It is possible to build stream cipher algorithms on top of a block - * cipher, for example CTR mode (#PSA_ALG_CTR). - * This macro only takes the key type into account, so it cannot be - * used to determine the size of the data that #psa_cipher_update() - * might buffer for future processing in general. - * - * \note This macro returns a compile-time constant if its argument is one. - * - * \warning This macro may evaluate its argument multiple times. - */ -#define PSA_BLOCK_CIPHER_BLOCK_LENGTH(type) \ - (((type) & PSA_KEY_TYPE_CATEGORY_MASK) == PSA_KEY_TYPE_CATEGORY_SYMMETRIC ? \ - 1u << PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT(type) : \ - 0u) - -/* Note that algorithm values are embedded in the persistent key store, - * as part of key metadata. As a consequence, they must not be changed - * (unless the storage format version changes). - */ - -/** Vendor-defined algorithm flag. - * - * Algorithms defined by this standard will never have the #PSA_ALG_VENDOR_FLAG - * bit set. Vendors who define additional algorithms must use an encoding with - * the #PSA_ALG_VENDOR_FLAG bit set and should respect the bitwise structure - * used by standard encodings whenever practical. - */ -#define PSA_ALG_VENDOR_FLAG ((psa_algorithm_t) 0x80000000) - -#define PSA_ALG_CATEGORY_MASK ((psa_algorithm_t) 0x7f000000) -#define PSA_ALG_CATEGORY_HASH ((psa_algorithm_t) 0x02000000) -#define PSA_ALG_CATEGORY_MAC ((psa_algorithm_t) 0x03000000) -#define PSA_ALG_CATEGORY_CIPHER ((psa_algorithm_t) 0x04000000) -#define PSA_ALG_CATEGORY_AEAD ((psa_algorithm_t) 0x05000000) -#define PSA_ALG_CATEGORY_SIGN ((psa_algorithm_t) 0x06000000) -#define PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION ((psa_algorithm_t) 0x07000000) -#define PSA_ALG_CATEGORY_KEY_DERIVATION ((psa_algorithm_t) 0x08000000) -#define PSA_ALG_CATEGORY_KEY_AGREEMENT ((psa_algorithm_t) 0x09000000) - -/** Whether an algorithm is vendor-defined. - * - * See also #PSA_ALG_VENDOR_FLAG. - */ -#define PSA_ALG_IS_VENDOR_DEFINED(alg) \ - (((alg) & PSA_ALG_VENDOR_FLAG) != 0) - -/** Whether the specified algorithm is a hash algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a hash algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_HASH(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_HASH) - -/** Whether the specified algorithm is a MAC algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a MAC algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_MAC(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_MAC) - -/** Whether the specified algorithm is a symmetric cipher algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a symmetric cipher algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_CIPHER(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_CIPHER) - -/** Whether the specified algorithm is an authenticated encryption - * with associated data (AEAD) algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is an AEAD algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_AEAD(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_AEAD) - -/** Whether the specified algorithm is an asymmetric signature algorithm, - * also known as public-key signature algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is an asymmetric signature algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_SIGN(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_SIGN) - -/** Whether the specified algorithm is an asymmetric encryption algorithm, - * also known as public-key encryption algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is an asymmetric encryption algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_ASYMMETRIC_ENCRYPTION(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION) - -/** Whether the specified algorithm is a key agreement algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a key agreement algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_KEY_AGREEMENT(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_KEY_AGREEMENT) - -/** Whether the specified algorithm is a key derivation algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a key derivation algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_KEY_DERIVATION(alg) \ - (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_KEY_DERIVATION) - -/** Whether the specified algorithm is a key stretching / password hashing - * algorithm. - * - * A key stretching / password hashing algorithm is a key derivation algorithm - * that is suitable for use with a low-entropy secret such as a password. - * Equivalently, it's a key derivation algorithm that uses a - * #PSA_KEY_DERIVATION_INPUT_PASSWORD input step. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a key stretching / password hashing algorithm, 0 - * otherwise. This macro may return either 0 or 1 if \p alg is not a - * supported algorithm identifier. - */ -#define PSA_ALG_IS_KEY_DERIVATION_STRETCHING(alg) \ - (PSA_ALG_IS_KEY_DERIVATION(alg) && \ - (alg) & PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG) - -/** An invalid algorithm identifier value. */ -/* *INDENT-OFF* (https://github.com/ARM-software/psa-arch-tests/issues/337) */ -#define PSA_ALG_NONE ((psa_algorithm_t)0) -/* *INDENT-ON* */ - -#define PSA_ALG_HASH_MASK ((psa_algorithm_t) 0x000000ff) -/** MD5 */ -#define PSA_ALG_MD5 ((psa_algorithm_t) 0x02000003) -/** PSA_ALG_RIPEMD160 */ -#define PSA_ALG_RIPEMD160 ((psa_algorithm_t) 0x02000004) -/** SHA1 */ -#define PSA_ALG_SHA_1 ((psa_algorithm_t) 0x02000005) -/** SHA2-224 */ -#define PSA_ALG_SHA_224 ((psa_algorithm_t) 0x02000008) -/** SHA2-256 */ -#define PSA_ALG_SHA_256 ((psa_algorithm_t) 0x02000009) -/** SHA2-384 */ -#define PSA_ALG_SHA_384 ((psa_algorithm_t) 0x0200000a) -/** SHA2-512 */ -#define PSA_ALG_SHA_512 ((psa_algorithm_t) 0x0200000b) -/** SHA2-512/224 */ -#define PSA_ALG_SHA_512_224 ((psa_algorithm_t) 0x0200000c) -/** SHA2-512/256 */ -#define PSA_ALG_SHA_512_256 ((psa_algorithm_t) 0x0200000d) -/** SHA3-224 */ -#define PSA_ALG_SHA3_224 ((psa_algorithm_t) 0x02000010) -/** SHA3-256 */ -#define PSA_ALG_SHA3_256 ((psa_algorithm_t) 0x02000011) -/** SHA3-384 */ -#define PSA_ALG_SHA3_384 ((psa_algorithm_t) 0x02000012) -/** SHA3-512 */ -#define PSA_ALG_SHA3_512 ((psa_algorithm_t) 0x02000013) -/** The first 512 bits (64 bytes) of the SHAKE256 output. - * - * This is the prehashing for Ed448ph (see #PSA_ALG_ED448PH). For other - * scenarios where a hash function based on SHA3/SHAKE is desired, SHA3-512 - * has the same output size and a (theoretically) higher security strength. - */ -#define PSA_ALG_SHAKE256_512 ((psa_algorithm_t) 0x02000015) - -/** In a hash-and-sign algorithm policy, allow any hash algorithm. - * - * This value may be used to form the algorithm usage field of a policy - * for a signature algorithm that is parametrized by a hash. The key - * may then be used to perform operations using the same signature - * algorithm parametrized with any supported hash. - * - * That is, suppose that `PSA_xxx_SIGNATURE` is one of the following macros: - * - #PSA_ALG_RSA_PKCS1V15_SIGN, #PSA_ALG_RSA_PSS, #PSA_ALG_RSA_PSS_ANY_SALT, - * - #PSA_ALG_ECDSA, #PSA_ALG_DETERMINISTIC_ECDSA. - * Then you may create and use a key as follows: - * - Set the key usage field using #PSA_ALG_ANY_HASH, for example: - * ``` - * psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH); // or VERIFY - * psa_set_key_algorithm(&attributes, PSA_xxx_SIGNATURE(PSA_ALG_ANY_HASH)); - * ``` - * - Import or generate key material. - * - Call psa_sign_hash() or psa_verify_hash(), passing - * an algorithm built from `PSA_xxx_SIGNATURE` and a specific hash. Each - * call to sign or verify a message may use a different hash. - * ``` - * psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_256), ...); - * psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_512), ...); - * psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA3_256), ...); - * ``` - * - * This value may not be used to build other algorithms that are - * parametrized over a hash. For any valid use of this macro to build - * an algorithm \c alg, #PSA_ALG_IS_HASH_AND_SIGN(\c alg) is true. - * - * This value may not be used to build an algorithm specification to - * perform an operation. It is only valid to build policies. - */ -#define PSA_ALG_ANY_HASH ((psa_algorithm_t) 0x020000ff) - -#define PSA_ALG_MAC_SUBCATEGORY_MASK ((psa_algorithm_t) 0x00c00000) -#define PSA_ALG_HMAC_BASE ((psa_algorithm_t) 0x03800000) -/** Macro to build an HMAC algorithm. - * - * For example, #PSA_ALG_HMAC(#PSA_ALG_SHA_256) is HMAC-SHA-256. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding HMAC algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_HMAC(hash_alg) \ - (PSA_ALG_HMAC_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -#define PSA_ALG_HMAC_GET_HASH(hmac_alg) \ - (PSA_ALG_CATEGORY_HASH | ((hmac_alg) & PSA_ALG_HASH_MASK)) - -/** Whether the specified algorithm is an HMAC algorithm. - * - * HMAC is a family of MAC algorithms that are based on a hash function. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is an HMAC algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_HMAC(alg) \ - (((alg) & (PSA_ALG_CATEGORY_MASK | PSA_ALG_MAC_SUBCATEGORY_MASK)) == \ - PSA_ALG_HMAC_BASE) - -/* In the encoding of a MAC algorithm, the bits corresponding to - * PSA_ALG_MAC_TRUNCATION_MASK encode the length to which the MAC is - * truncated. As an exception, the value 0 means the untruncated algorithm, - * whatever its length is. The length is encoded in 6 bits, so it can - * reach up to 63; the largest MAC is 64 bytes so its trivial truncation - * to full length is correctly encoded as 0 and any non-trivial truncation - * is correctly encoded as a value between 1 and 63. */ -#define PSA_ALG_MAC_TRUNCATION_MASK ((psa_algorithm_t) 0x003f0000) -#define PSA_MAC_TRUNCATION_OFFSET 16 - -/* In the encoding of a MAC algorithm, the bit corresponding to - * #PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm - * is a wildcard algorithm. A key with such wildcard algorithm as permitted - * algorithm policy can be used with any algorithm corresponding to the - * same base class and having a (potentially truncated) MAC length greater or - * equal than the one encoded in #PSA_ALG_MAC_TRUNCATION_MASK. */ -#define PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000) - -/** Macro to build a truncated MAC algorithm. - * - * A truncated MAC algorithm is identical to the corresponding MAC - * algorithm except that the MAC value for the truncated algorithm - * consists of only the first \p mac_length bytes of the MAC value - * for the untruncated algorithm. - * - * \note This macro may allow constructing algorithm identifiers that - * are not valid, either because the specified length is larger - * than the untruncated MAC or because the specified length is - * smaller than permitted by the implementation. - * - * \note It is implementation-defined whether a truncated MAC that - * is truncated to the same length as the MAC of the untruncated - * algorithm is considered identical to the untruncated algorithm - * for policy comparison purposes. - * - * \param mac_alg A MAC algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg) - * is true). This may be a truncated or untruncated - * MAC algorithm. - * \param mac_length Desired length of the truncated MAC in bytes. - * This must be at most the full length of the MAC - * and must be at least an implementation-specified - * minimum. The implementation-specified minimum - * shall not be zero. - * - * \return The corresponding MAC algorithm with the specified - * length. - * \return Unspecified if \p mac_alg is not a supported - * MAC algorithm or if \p mac_length is too small or - * too large for the specified MAC algorithm. - */ -#define PSA_ALG_TRUNCATED_MAC(mac_alg, mac_length) \ - (((mac_alg) & ~(PSA_ALG_MAC_TRUNCATION_MASK | \ - PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG)) | \ - ((mac_length) << PSA_MAC_TRUNCATION_OFFSET & PSA_ALG_MAC_TRUNCATION_MASK)) - -/** Macro to build the base MAC algorithm corresponding to a truncated - * MAC algorithm. - * - * \param mac_alg A MAC algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg) - * is true). This may be a truncated or untruncated - * MAC algorithm. - * - * \return The corresponding base MAC algorithm. - * \return Unspecified if \p mac_alg is not a supported - * MAC algorithm. - */ -#define PSA_ALG_FULL_LENGTH_MAC(mac_alg) \ - ((mac_alg) & ~(PSA_ALG_MAC_TRUNCATION_MASK | \ - PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG)) - -/** Length to which a MAC algorithm is truncated. - * - * \param mac_alg A MAC algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg) - * is true). - * - * \return Length of the truncated MAC in bytes. - * \return 0 if \p mac_alg is a non-truncated MAC algorithm. - * \return Unspecified if \p mac_alg is not a supported - * MAC algorithm. - */ -#define PSA_MAC_TRUNCATED_LENGTH(mac_alg) \ - (((mac_alg) & PSA_ALG_MAC_TRUNCATION_MASK) >> PSA_MAC_TRUNCATION_OFFSET) - -/** Macro to build a MAC minimum-MAC-length wildcard algorithm. - * - * A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms - * sharing the same base algorithm, and where the (potentially truncated) MAC - * length of the specific algorithm is equal to or larger then the wildcard - * algorithm's minimum MAC length. - * - * \note When setting the minimum required MAC length to less than the - * smallest MAC length allowed by the base algorithm, this effectively - * becomes an 'any-MAC-length-allowed' policy for that base algorithm. - * - * \param mac_alg A MAC algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg) - * is true). - * \param min_mac_length Desired minimum length of the message authentication - * code in bytes. This must be at most the untruncated - * length of the MAC and must be at least 1. - * - * \return The corresponding MAC wildcard algorithm with the - * specified minimum length. - * \return Unspecified if \p mac_alg is not a supported MAC - * algorithm or if \p min_mac_length is less than 1 or - * too large for the specified MAC algorithm. - */ -#define PSA_ALG_AT_LEAST_THIS_LENGTH_MAC(mac_alg, min_mac_length) \ - (PSA_ALG_TRUNCATED_MAC(mac_alg, min_mac_length) | \ - PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) - -#define PSA_ALG_CIPHER_MAC_BASE ((psa_algorithm_t) 0x03c00000) -/** The CBC-MAC construction over a block cipher - * - * \warning CBC-MAC is insecure in many cases. - * A more secure mode, such as #PSA_ALG_CMAC, is recommended. - */ -#define PSA_ALG_CBC_MAC ((psa_algorithm_t) 0x03c00100) -/** The CMAC construction over a block cipher */ -#define PSA_ALG_CMAC ((psa_algorithm_t) 0x03c00200) - -/** Whether the specified algorithm is a MAC algorithm based on a block cipher. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a MAC algorithm based on a block cipher, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_BLOCK_CIPHER_MAC(alg) \ - (((alg) & (PSA_ALG_CATEGORY_MASK | PSA_ALG_MAC_SUBCATEGORY_MASK)) == \ - PSA_ALG_CIPHER_MAC_BASE) - -#define PSA_ALG_CIPHER_STREAM_FLAG ((psa_algorithm_t) 0x00800000) -#define PSA_ALG_CIPHER_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000) - -/** Whether the specified algorithm is a stream cipher. - * - * A stream cipher is a symmetric cipher that encrypts or decrypts messages - * by applying a bitwise-xor with a stream of bytes that is generated - * from a key. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a stream cipher algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier or if it is not a symmetric cipher algorithm. - */ -#define PSA_ALG_IS_STREAM_CIPHER(alg) \ - (((alg) & (PSA_ALG_CATEGORY_MASK | PSA_ALG_CIPHER_STREAM_FLAG)) == \ - (PSA_ALG_CATEGORY_CIPHER | PSA_ALG_CIPHER_STREAM_FLAG)) - -/** The stream cipher mode of a stream cipher algorithm. - * - * The underlying stream cipher is determined by the key type. - * - To use ChaCha20, use a key type of #PSA_KEY_TYPE_CHACHA20. - */ -#define PSA_ALG_STREAM_CIPHER ((psa_algorithm_t) 0x04800100) - -/** The CTR stream cipher mode. - * - * CTR is a stream cipher which is built from a block cipher. - * The underlying block cipher is determined by the key type. - * For example, to use AES-128-CTR, use this algorithm with - * a key of type #PSA_KEY_TYPE_AES and a length of 128 bits (16 bytes). - */ -#define PSA_ALG_CTR ((psa_algorithm_t) 0x04c01000) - -/** The CFB stream cipher mode. - * - * The underlying block cipher is determined by the key type. - */ -#define PSA_ALG_CFB ((psa_algorithm_t) 0x04c01100) - -/** The OFB stream cipher mode. - * - * The underlying block cipher is determined by the key type. - */ -#define PSA_ALG_OFB ((psa_algorithm_t) 0x04c01200) - -/** The XTS cipher mode. - * - * XTS is a cipher mode which is built from a block cipher. It requires at - * least one full block of input, but beyond this minimum the input - * does not need to be a whole number of blocks. - */ -#define PSA_ALG_XTS ((psa_algorithm_t) 0x0440ff00) - -/** The Electronic Code Book (ECB) mode of a block cipher, with no padding. - * - * \warning ECB mode does not protect the confidentiality of the encrypted data - * except in extremely narrow circumstances. It is recommended that applications - * only use ECB if they need to construct an operating mode that the - * implementation does not provide. Implementations are encouraged to provide - * the modes that applications need in preference to supporting direct access - * to ECB. - * - * The underlying block cipher is determined by the key type. - * - * This symmetric cipher mode can only be used with messages whose lengths are a - * multiple of the block size of the chosen block cipher. - * - * ECB mode does not accept an initialization vector (IV). When using a - * multi-part cipher operation with this algorithm, psa_cipher_generate_iv() - * and psa_cipher_set_iv() must not be called. - */ -#define PSA_ALG_ECB_NO_PADDING ((psa_algorithm_t) 0x04404400) - -/** The CBC block cipher chaining mode, with no padding. - * - * The underlying block cipher is determined by the key type. - * - * This symmetric cipher mode can only be used with messages whose lengths - * are whole number of blocks for the chosen block cipher. - */ -#define PSA_ALG_CBC_NO_PADDING ((psa_algorithm_t) 0x04404000) - -/** The CBC block cipher chaining mode with PKCS#7 padding. - * - * The underlying block cipher is determined by the key type. - * - * This is the padding method defined by PKCS#7 (RFC 2315) §10.3. - */ -#define PSA_ALG_CBC_PKCS7 ((psa_algorithm_t) 0x04404100) - -#define PSA_ALG_AEAD_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000) - -/** Whether the specified algorithm is an AEAD mode on a block cipher. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is an AEAD algorithm which is an AEAD mode based on - * a block cipher, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) \ - (((alg) & (PSA_ALG_CATEGORY_MASK | PSA_ALG_AEAD_FROM_BLOCK_FLAG)) == \ - (PSA_ALG_CATEGORY_AEAD | PSA_ALG_AEAD_FROM_BLOCK_FLAG)) - -/** The CCM authenticated encryption algorithm. - * - * The underlying block cipher is determined by the key type. - */ -#define PSA_ALG_CCM ((psa_algorithm_t) 0x05500100) - -/** The CCM* cipher mode without authentication. - * - * This is CCM* as specified in IEEE 802.15.4 §7, with a tag length of 0. - * For CCM* with a nonzero tag length, use the AEAD algorithm #PSA_ALG_CCM. - * - * The underlying block cipher is determined by the key type. - * - * Currently only 13-byte long IV's are supported. - */ -#define PSA_ALG_CCM_STAR_NO_TAG ((psa_algorithm_t) 0x04c01300) - -/** The GCM authenticated encryption algorithm. - * - * The underlying block cipher is determined by the key type. - */ -#define PSA_ALG_GCM ((psa_algorithm_t) 0x05500200) - -/** The Chacha20-Poly1305 AEAD algorithm. - * - * The ChaCha20_Poly1305 construction is defined in RFC 7539. - * - * Implementations must support 12-byte nonces, may support 8-byte nonces, - * and should reject other sizes. - * - * Implementations must support 16-byte tags and should reject other sizes. - */ -#define PSA_ALG_CHACHA20_POLY1305 ((psa_algorithm_t) 0x05100500) - -/* In the encoding of an AEAD algorithm, the bits corresponding to - * PSA_ALG_AEAD_TAG_LENGTH_MASK encode the length of the AEAD tag. - * The constants for default lengths follow this encoding. - */ -#define PSA_ALG_AEAD_TAG_LENGTH_MASK ((psa_algorithm_t) 0x003f0000) -#define PSA_AEAD_TAG_LENGTH_OFFSET 16 - -/* In the encoding of an AEAD algorithm, the bit corresponding to - * #PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm - * is a wildcard algorithm. A key with such wildcard algorithm as permitted - * algorithm policy can be used with any algorithm corresponding to the - * same base class and having a tag length greater than or equal to the one - * encoded in #PSA_ALG_AEAD_TAG_LENGTH_MASK. */ -#define PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000) - -/** Macro to build a shortened AEAD algorithm. - * - * A shortened AEAD algorithm is similar to the corresponding AEAD - * algorithm, but has an authentication tag that consists of fewer bytes. - * Depending on the algorithm, the tag length may affect the calculation - * of the ciphertext. - * - * \param aead_alg An AEAD algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_AEAD(\p aead_alg) - * is true). - * \param tag_length Desired length of the authentication tag in bytes. - * - * \return The corresponding AEAD algorithm with the specified - * length. - * \return Unspecified if \p aead_alg is not a supported - * AEAD algorithm or if \p tag_length is not valid - * for the specified AEAD algorithm. - */ -#define PSA_ALG_AEAD_WITH_SHORTENED_TAG(aead_alg, tag_length) \ - (((aead_alg) & ~(PSA_ALG_AEAD_TAG_LENGTH_MASK | \ - PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG)) | \ - ((tag_length) << PSA_AEAD_TAG_LENGTH_OFFSET & \ - PSA_ALG_AEAD_TAG_LENGTH_MASK)) - -/** Retrieve the tag length of a specified AEAD algorithm - * - * \param aead_alg An AEAD algorithm identifier (value of type - * #psa_algorithm_t such that #PSA_ALG_IS_AEAD(\p aead_alg) - * is true). - * - * \return The tag length specified by the input algorithm. - * \return Unspecified if \p aead_alg is not a supported - * AEAD algorithm. - */ -#define PSA_ALG_AEAD_GET_TAG_LENGTH(aead_alg) \ - (((aead_alg) & PSA_ALG_AEAD_TAG_LENGTH_MASK) >> \ - PSA_AEAD_TAG_LENGTH_OFFSET) - -/** Calculate the corresponding AEAD algorithm with the default tag length. - * - * \param aead_alg An AEAD algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_AEAD(\p aead_alg) is true). - * - * \return The corresponding AEAD algorithm with the default - * tag length for that algorithm. - */ -#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG(aead_alg) \ - ( \ - PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg, PSA_ALG_CCM) \ - PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg, PSA_ALG_GCM) \ - PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg, PSA_ALG_CHACHA20_POLY1305) \ - 0) -#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg, ref) \ - PSA_ALG_AEAD_WITH_SHORTENED_TAG(aead_alg, 0) == \ - PSA_ALG_AEAD_WITH_SHORTENED_TAG(ref, 0) ? \ - ref : - -/** Macro to build an AEAD minimum-tag-length wildcard algorithm. - * - * A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms - * sharing the same base algorithm, and where the tag length of the specific - * algorithm is equal to or larger then the minimum tag length specified by the - * wildcard algorithm. - * - * \note When setting the minimum required tag length to less than the - * smallest tag length allowed by the base algorithm, this effectively - * becomes an 'any-tag-length-allowed' policy for that base algorithm. - * - * \param aead_alg An AEAD algorithm identifier (value of type - * #psa_algorithm_t such that - * #PSA_ALG_IS_AEAD(\p aead_alg) is true). - * \param min_tag_length Desired minimum length of the authentication tag in - * bytes. This must be at least 1 and at most the largest - * allowed tag length of the algorithm. - * - * \return The corresponding AEAD wildcard algorithm with the - * specified minimum length. - * \return Unspecified if \p aead_alg is not a supported - * AEAD algorithm or if \p min_tag_length is less than 1 - * or too large for the specified AEAD algorithm. - */ -#define PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG(aead_alg, min_tag_length) \ - (PSA_ALG_AEAD_WITH_SHORTENED_TAG(aead_alg, min_tag_length) | \ - PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) - -#define PSA_ALG_RSA_PKCS1V15_SIGN_BASE ((psa_algorithm_t) 0x06000200) -/** RSA PKCS#1 v1.5 signature with hashing. - * - * This is the signature scheme defined by RFC 8017 - * (PKCS#1: RSA Cryptography Specifications) under the name - * RSASSA-PKCS1-v1_5. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding RSA PKCS#1 v1.5 signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_RSA_PKCS1V15_SIGN(hash_alg) \ - (PSA_ALG_RSA_PKCS1V15_SIGN_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -/** Raw PKCS#1 v1.5 signature. - * - * The input to this algorithm is the DigestInfo structure used by - * RFC 8017 (PKCS#1: RSA Cryptography Specifications), §9.2 - * steps 3–6. - */ -#define PSA_ALG_RSA_PKCS1V15_SIGN_RAW PSA_ALG_RSA_PKCS1V15_SIGN_BASE -#define PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PKCS1V15_SIGN_BASE) - -#define PSA_ALG_RSA_PSS_BASE ((psa_algorithm_t) 0x06000300) -#define PSA_ALG_RSA_PSS_ANY_SALT_BASE ((psa_algorithm_t) 0x06001300) -/** RSA PSS signature with hashing. - * - * This is the signature scheme defined by RFC 8017 - * (PKCS#1: RSA Cryptography Specifications) under the name - * RSASSA-PSS, with the message generation function MGF1, and with - * a salt length equal to the length of the hash, or the largest - * possible salt length for the algorithm and key size if that is - * smaller than the hash length. The specified hash algorithm is - * used to hash the input message, to create the salted hash, and - * for the mask generation. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding RSA PSS signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_RSA_PSS(hash_alg) \ - (PSA_ALG_RSA_PSS_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -/** RSA PSS signature with hashing with relaxed verification. - * - * This algorithm has the same behavior as #PSA_ALG_RSA_PSS when signing, - * but allows an arbitrary salt length (including \c 0) when verifying a - * signature. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding RSA PSS signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_RSA_PSS_ANY_SALT(hash_alg) \ - (PSA_ALG_RSA_PSS_ANY_SALT_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -/** Whether the specified algorithm is RSA PSS with standard salt. - * - * \param alg An algorithm value or an algorithm policy wildcard. - * - * \return 1 if \p alg is of the form - * #PSA_ALG_RSA_PSS(\c hash_alg), - * where \c hash_alg is a hash algorithm or - * #PSA_ALG_ANY_HASH. 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not - * a supported algorithm identifier or policy. - */ -#define PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_BASE) - -/** Whether the specified algorithm is RSA PSS with any salt. - * - * \param alg An algorithm value or an algorithm policy wildcard. - * - * \return 1 if \p alg is of the form - * #PSA_ALG_RSA_PSS_ANY_SALT_BASE(\c hash_alg), - * where \c hash_alg is a hash algorithm or - * #PSA_ALG_ANY_HASH. 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not - * a supported algorithm identifier or policy. - */ -#define PSA_ALG_IS_RSA_PSS_ANY_SALT(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_ANY_SALT_BASE) - -/** Whether the specified algorithm is RSA PSS. - * - * This includes any of the RSA PSS algorithm variants, regardless of the - * constraints on salt length. - * - * \param alg An algorithm value or an algorithm policy wildcard. - * - * \return 1 if \p alg is of the form - * #PSA_ALG_RSA_PSS(\c hash_alg) or - * #PSA_ALG_RSA_PSS_ANY_SALT_BASE(\c hash_alg), - * where \c hash_alg is a hash algorithm or - * #PSA_ALG_ANY_HASH. 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not - * a supported algorithm identifier or policy. - */ -#define PSA_ALG_IS_RSA_PSS(alg) \ - (PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg) || \ - PSA_ALG_IS_RSA_PSS_ANY_SALT(alg)) - -#define PSA_ALG_ECDSA_BASE ((psa_algorithm_t) 0x06000600) -/** ECDSA signature with hashing. - * - * This is the ECDSA signature scheme defined by ANSI X9.62, - * with a random per-message secret number (*k*). - * - * The representation of the signature as a byte string consists of - * the concatenation of the signature values *r* and *s*. Each of - * *r* and *s* is encoded as an *N*-octet string, where *N* is the length - * of the base point of the curve in octets. Each value is represented - * in big-endian order (most significant octet first). - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding ECDSA signature algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_ECDSA(hash_alg) \ - (PSA_ALG_ECDSA_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -/** ECDSA signature without hashing. - * - * This is the same signature scheme as #PSA_ALG_ECDSA(), but - * without specifying a hash algorithm. This algorithm may only be - * used to sign or verify a sequence of bytes that should be an - * already-calculated hash. Note that the input is padded with - * zeros on the left or truncated on the left as required to fit - * the curve size. - */ -#define PSA_ALG_ECDSA_ANY PSA_ALG_ECDSA_BASE -#define PSA_ALG_DETERMINISTIC_ECDSA_BASE ((psa_algorithm_t) 0x06000700) -/** Deterministic ECDSA signature with hashing. - * - * This is the deterministic ECDSA signature scheme defined by RFC 6979. - * - * The representation of a signature is the same as with #PSA_ALG_ECDSA(). - * - * Note that when this algorithm is used for verification, signatures - * made with randomized ECDSA (#PSA_ALG_ECDSA(\p hash_alg)) with the - * same private key are accepted. In other words, - * #PSA_ALG_DETERMINISTIC_ECDSA(\p hash_alg) differs from - * #PSA_ALG_ECDSA(\p hash_alg) only for signature, not for verification. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * This includes #PSA_ALG_ANY_HASH - * when specifying the algorithm in a usage policy. - * - * \return The corresponding deterministic ECDSA signature - * algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_DETERMINISTIC_ECDSA(hash_alg) \ - (PSA_ALG_DETERMINISTIC_ECDSA_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_ECDSA_DETERMINISTIC_FLAG ((psa_algorithm_t) 0x00000100) -#define PSA_ALG_IS_ECDSA(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK & ~PSA_ALG_ECDSA_DETERMINISTIC_FLAG) == \ - PSA_ALG_ECDSA_BASE) -#define PSA_ALG_ECDSA_IS_DETERMINISTIC(alg) \ - (((alg) & PSA_ALG_ECDSA_DETERMINISTIC_FLAG) != 0) -#define PSA_ALG_IS_DETERMINISTIC_ECDSA(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_DETERMINISTIC_ECDSA_BASE) /* !!OM */ -#define PSA_ALG_IS_RANDOMIZED_ECDSA(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_ECDSA_BASE) /* !!OM */ - -/** Edwards-curve digital signature algorithm without prehashing (PureEdDSA), - * using standard parameters. - * - * Contexts are not supported in the current version of this specification - * because there is no suitable signature interface that can take the - * context as a parameter. A future version of this specification may add - * suitable functions and extend this algorithm to support contexts. - * - * PureEdDSA requires an elliptic curve key on a twisted Edwards curve. - * In this specification, the following curves are supported: - * - #PSA_ECC_FAMILY_TWISTED_EDWARDS, 255-bit: Ed25519 as specified - * in RFC 8032. - * The curve is Edwards25519. - * The hash function used internally is SHA-512. - * - #PSA_ECC_FAMILY_TWISTED_EDWARDS, 448-bit: Ed448 as specified - * in RFC 8032. - * The curve is Edwards448. - * The hash function used internally is the first 114 bytes of the - * SHAKE256 output. - * - * This algorithm can be used with psa_sign_message() and - * psa_verify_message(). Since there is no prehashing, it cannot be used - * with psa_sign_hash() or psa_verify_hash(). - * - * The signature format is the concatenation of R and S as defined by - * RFC 8032 §5.1.6 and §5.2.6 (a 64-byte string for Ed25519, a 114-byte - * string for Ed448). - */ -#define PSA_ALG_PURE_EDDSA ((psa_algorithm_t) 0x06000800) - -#define PSA_ALG_HASH_EDDSA_BASE ((psa_algorithm_t) 0x06000900) -#define PSA_ALG_IS_HASH_EDDSA(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HASH_EDDSA_BASE) - -/** Edwards-curve digital signature algorithm with prehashing (HashEdDSA), - * using SHA-512 and the Edwards25519 curve. - * - * See #PSA_ALG_PURE_EDDSA regarding context support and the signature format. - * - * This algorithm is Ed25519 as specified in RFC 8032. - * The curve is Edwards25519. - * The prehash is SHA-512. - * The hash function used internally is SHA-512. - * - * This is a hash-and-sign algorithm: to calculate a signature, - * you can either: - * - call psa_sign_message() on the message; - * - or calculate the SHA-512 hash of the message - * with psa_hash_compute() - * or with a multi-part hash operation started with psa_hash_setup(), - * using the hash algorithm #PSA_ALG_SHA_512, - * then sign the calculated hash with psa_sign_hash(). - * Verifying a signature is similar, using psa_verify_message() or - * psa_verify_hash() instead of the signature function. - */ -#define PSA_ALG_ED25519PH \ - (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHA_512 & PSA_ALG_HASH_MASK)) - -/** Edwards-curve digital signature algorithm with prehashing (HashEdDSA), - * using SHAKE256 and the Edwards448 curve. - * - * See #PSA_ALG_PURE_EDDSA regarding context support and the signature format. - * - * This algorithm is Ed448 as specified in RFC 8032. - * The curve is Edwards448. - * The prehash is the first 64 bytes of the SHAKE256 output. - * The hash function used internally is the first 114 bytes of the - * SHAKE256 output. - * - * This is a hash-and-sign algorithm: to calculate a signature, - * you can either: - * - call psa_sign_message() on the message; - * - or calculate the first 64 bytes of the SHAKE256 output of the message - * with psa_hash_compute() - * or with a multi-part hash operation started with psa_hash_setup(), - * using the hash algorithm #PSA_ALG_SHAKE256_512, - * then sign the calculated hash with psa_sign_hash(). - * Verifying a signature is similar, using psa_verify_message() or - * psa_verify_hash() instead of the signature function. - */ -#define PSA_ALG_ED448PH \ - (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHAKE256_512 & PSA_ALG_HASH_MASK)) - -/* Default definition, to be overridden if the library is extended with - * more hash-and-sign algorithms that we want to keep out of this header - * file. */ -#define PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg) 0 - -/** Whether the specified algorithm is a signature algorithm that can be used - * with psa_sign_hash() and psa_verify_hash(). - * - * This encompasses all strict hash-and-sign algorithms categorized by - * PSA_ALG_IS_HASH_AND_SIGN(), as well as algorithms that follow the - * paradigm more loosely: - * - #PSA_ALG_RSA_PKCS1V15_SIGN_RAW (expects its input to be an encoded hash) - * - #PSA_ALG_ECDSA_ANY (doesn't specify what kind of hash the input is) - * - * \param alg An algorithm identifier (value of type psa_algorithm_t). - * - * \return 1 if alg is a signature algorithm that can be used to sign a - * hash. 0 if alg is a signature algorithm that can only be used - * to sign a message. 0 if alg is not a signature algorithm. - * This macro can return either 0 or 1 if alg is not a - * supported algorithm identifier. - */ -#define PSA_ALG_IS_SIGN_HASH(alg) \ - (PSA_ALG_IS_RSA_PSS(alg) || PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || \ - PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_HASH_EDDSA(alg) || \ - PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg)) - -/** Whether the specified algorithm is a signature algorithm that can be used - * with psa_sign_message() and psa_verify_message(). - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if alg is a signature algorithm that can be used to sign a - * message. 0 if \p alg is a signature algorithm that can only be used - * to sign an already-calculated hash. 0 if \p alg is not a signature - * algorithm. This macro can return either 0 or 1 if \p alg is not a - * supported algorithm identifier. - */ -#define PSA_ALG_IS_SIGN_MESSAGE(alg) \ - (PSA_ALG_IS_SIGN_HASH(alg) || (alg) == PSA_ALG_PURE_EDDSA) - -/** Whether the specified algorithm is a hash-and-sign algorithm. - * - * Hash-and-sign algorithms are asymmetric (public-key) signature algorithms - * structured in two parts: first the calculation of a hash in a way that - * does not depend on the key, then the calculation of a signature from the - * hash value and the key. Hash-and-sign algorithms encode the hash - * used for the hashing step, and you can call #PSA_ALG_SIGN_GET_HASH - * to extract this algorithm. - * - * Thus, for a hash-and-sign algorithm, - * `psa_sign_message(key, alg, input, ...)` is equivalent to - * ``` - * psa_hash_compute(PSA_ALG_SIGN_GET_HASH(alg), input, ..., hash, ...); - * psa_sign_hash(key, alg, hash, ..., signature, ...); - * ``` - * Most usefully, separating the hash from the signature allows the hash - * to be calculated in multiple steps with psa_hash_setup(), psa_hash_update() - * and psa_hash_finish(). Likewise psa_verify_message() is equivalent to - * calculating the hash and then calling psa_verify_hash(). - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a hash-and-sign algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_HASH_AND_SIGN(alg) \ - (PSA_ALG_IS_SIGN_HASH(alg) && \ - ((alg) & PSA_ALG_HASH_MASK) != 0) - -/** Get the hash used by a hash-and-sign signature algorithm. - * - * A hash-and-sign algorithm is a signature algorithm which is - * composed of two phases: first a hashing phase which does not use - * the key and produces a hash of the input message, then a signing - * phase which only uses the hash and the key and not the message - * itself. - * - * \param alg A signature algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_SIGN(\p alg) is true). - * - * \return The underlying hash algorithm if \p alg is a hash-and-sign - * algorithm. - * \return 0 if \p alg is a signature algorithm that does not - * follow the hash-and-sign structure. - * \return Unspecified if \p alg is not a signature algorithm or - * if it is not supported by the implementation. - */ -#define PSA_ALG_SIGN_GET_HASH(alg) \ - (PSA_ALG_IS_HASH_AND_SIGN(alg) ? \ - ((alg) & PSA_ALG_HASH_MASK) | PSA_ALG_CATEGORY_HASH : \ - 0) - -/** RSA PKCS#1 v1.5 encryption. - */ -#define PSA_ALG_RSA_PKCS1V15_CRYPT ((psa_algorithm_t) 0x07000200) - -#define PSA_ALG_RSA_OAEP_BASE ((psa_algorithm_t) 0x07000300) -/** RSA OAEP encryption. - * - * This is the encryption scheme defined by RFC 8017 - * (PKCS#1: RSA Cryptography Specifications) under the name - * RSAES-OAEP, with the message generation function MGF1. - * - * \param hash_alg The hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true) to use - * for MGF1. - * - * \return The corresponding RSA OAEP encryption algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_RSA_OAEP(hash_alg) \ - (PSA_ALG_RSA_OAEP_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -#define PSA_ALG_IS_RSA_OAEP(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_OAEP_BASE) -#define PSA_ALG_RSA_OAEP_GET_HASH(alg) \ - (PSA_ALG_IS_RSA_OAEP(alg) ? \ - ((alg) & PSA_ALG_HASH_MASK) | PSA_ALG_CATEGORY_HASH : \ - 0) - -#define PSA_ALG_HKDF_BASE ((psa_algorithm_t) 0x08000100) -/** Macro to build an HKDF algorithm. - * - * For example, `PSA_ALG_HKDF(PSA_ALG_SHA_256)` is HKDF using HMAC-SHA-256. - * - * This key derivation algorithm uses the following inputs: - * - #PSA_KEY_DERIVATION_INPUT_SALT is the salt used in the "extract" step. - * It is optional; if omitted, the derivation uses an empty salt. - * - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret key used in the "extract" step. - * - #PSA_KEY_DERIVATION_INPUT_INFO is the info string used in the "expand" step. - * You must pass #PSA_KEY_DERIVATION_INPUT_SALT before #PSA_KEY_DERIVATION_INPUT_SECRET. - * You may pass #PSA_KEY_DERIVATION_INPUT_INFO at any time after setup and before - * starting to generate output. - * - * \warning HKDF processes the salt as follows: first hash it with hash_alg - * if the salt is longer than the block size of the hash algorithm; then - * pad with null bytes up to the block size. As a result, it is possible - * for distinct salt inputs to result in the same outputs. To ensure - * unique outputs, it is recommended to use a fixed length for salt values. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding HKDF algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_HKDF(hash_alg) \ - (PSA_ALG_HKDF_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -/** Whether the specified algorithm is an HKDF algorithm. - * - * HKDF is a family of key derivation algorithms that are based on a hash - * function and the HMAC construction. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is an HKDF algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_HKDF(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_BASE) -#define PSA_ALG_HKDF_GET_HASH(hkdf_alg) \ - (PSA_ALG_CATEGORY_HASH | ((hkdf_alg) & PSA_ALG_HASH_MASK)) - -#define PSA_ALG_HKDF_EXTRACT_BASE ((psa_algorithm_t) 0x08000400) -/** Macro to build an HKDF-Extract algorithm. - * - * For example, `PSA_ALG_HKDF_EXTRACT(PSA_ALG_SHA_256)` is - * HKDF-Extract using HMAC-SHA-256. - * - * This key derivation algorithm uses the following inputs: - * - PSA_KEY_DERIVATION_INPUT_SALT is the salt. - * - PSA_KEY_DERIVATION_INPUT_SECRET is the input keying material used in the - * "extract" step. - * The inputs are mandatory and must be passed in the order above. - * Each input may only be passed once. - * - * \warning HKDF-Extract is not meant to be used on its own. PSA_ALG_HKDF - * should be used instead if possible. PSA_ALG_HKDF_EXTRACT is provided - * as a separate algorithm for the sake of protocols that use it as a - * building block. It may also be a slight performance optimization - * in applications that use HKDF with the same salt and key but many - * different info strings. - * - * \warning HKDF processes the salt as follows: first hash it with hash_alg - * if the salt is longer than the block size of the hash algorithm; then - * pad with null bytes up to the block size. As a result, it is possible - * for distinct salt inputs to result in the same outputs. To ensure - * unique outputs, it is recommended to use a fixed length for salt values. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding HKDF-Extract algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_HKDF_EXTRACT(hash_alg) \ - (PSA_ALG_HKDF_EXTRACT_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -/** Whether the specified algorithm is an HKDF-Extract algorithm. - * - * HKDF-Extract is a family of key derivation algorithms that are based - * on a hash function and the HMAC construction. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is an HKDF-Extract algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_HKDF_EXTRACT(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_EXTRACT_BASE) - -#define PSA_ALG_HKDF_EXPAND_BASE ((psa_algorithm_t) 0x08000500) -/** Macro to build an HKDF-Expand algorithm. - * - * For example, `PSA_ALG_HKDF_EXPAND(PSA_ALG_SHA_256)` is - * HKDF-Expand using HMAC-SHA-256. - * - * This key derivation algorithm uses the following inputs: - * - PSA_KEY_DERIVATION_INPUT_SECRET is the pseudorandom key (PRK). - * - PSA_KEY_DERIVATION_INPUT_INFO is the info string. - * - * The inputs are mandatory and must be passed in the order above. - * Each input may only be passed once. - * - * \warning HKDF-Expand is not meant to be used on its own. `PSA_ALG_HKDF` - * should be used instead if possible. `PSA_ALG_HKDF_EXPAND` is provided as - * a separate algorithm for the sake of protocols that use it as a building - * block. It may also be a slight performance optimization in applications - * that use HKDF with the same salt and key but many different info strings. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding HKDF-Expand algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_HKDF_EXPAND(hash_alg) \ - (PSA_ALG_HKDF_EXPAND_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) -/** Whether the specified algorithm is an HKDF-Expand algorithm. - * - * HKDF-Expand is a family of key derivation algorithms that are based - * on a hash function and the HMAC construction. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is an HKDF-Expand algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_HKDF_EXPAND(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_EXPAND_BASE) - -/** Whether the specified algorithm is an HKDF or HKDF-Extract or - * HKDF-Expand algorithm. - * - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is any HKDF type algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_ANY_HKDF(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_BASE || \ - ((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_EXTRACT_BASE || \ - ((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_HKDF_EXPAND_BASE) - -#define PSA_ALG_TLS12_PRF_BASE ((psa_algorithm_t) 0x08000200) -/** Macro to build a TLS-1.2 PRF algorithm. - * - * TLS 1.2 uses a custom pseudorandom function (PRF) for key schedule, - * specified in Section 5 of RFC 5246. It is based on HMAC and can be - * used with either SHA-256 or SHA-384. - * - * This key derivation algorithm uses the following inputs, which must be - * passed in the order given here: - * - #PSA_KEY_DERIVATION_INPUT_SEED is the seed. - * - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret key. - * - #PSA_KEY_DERIVATION_INPUT_LABEL is the label. - * - * For the application to TLS-1.2 key expansion, the seed is the - * concatenation of ServerHello.Random + ClientHello.Random, - * and the label is "key expansion". - * - * For example, `PSA_ALG_TLS12_PRF(PSA_ALG_SHA_256)` represents the - * TLS 1.2 PRF using HMAC-SHA-256. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding TLS-1.2 PRF algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_TLS12_PRF(hash_alg) \ - (PSA_ALG_TLS12_PRF_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -/** Whether the specified algorithm is a TLS-1.2 PRF algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is a TLS-1.2 PRF algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_TLS12_PRF(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_TLS12_PRF_BASE) -#define PSA_ALG_TLS12_PRF_GET_HASH(hkdf_alg) \ - (PSA_ALG_CATEGORY_HASH | ((hkdf_alg) & PSA_ALG_HASH_MASK)) - -#define PSA_ALG_TLS12_PSK_TO_MS_BASE ((psa_algorithm_t) 0x08000300) -/** Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm. - * - * In a pure-PSK handshake in TLS 1.2, the master secret is derived - * from the PreSharedKey (PSK) through the application of padding - * (RFC 4279, Section 2) and the TLS-1.2 PRF (RFC 5246, Section 5). - * The latter is based on HMAC and can be used with either SHA-256 - * or SHA-384. - * - * This key derivation algorithm uses the following inputs, which must be - * passed in the order given here: - * - #PSA_KEY_DERIVATION_INPUT_SEED is the seed. - * - #PSA_KEY_DERIVATION_INPUT_OTHER_SECRET is the other secret for the - * computation of the premaster secret. This input is optional; - * if omitted, it defaults to a string of null bytes with the same length - * as the secret (PSK) input. - * - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret key. - * - #PSA_KEY_DERIVATION_INPUT_LABEL is the label. - * - * For the application to TLS-1.2, the seed (which is - * forwarded to the TLS-1.2 PRF) is the concatenation of the - * ClientHello.Random + ServerHello.Random, - * the label is "master secret" or "extended master secret" and - * the other secret depends on the key exchange specified in the cipher suite: - * - for a plain PSK cipher suite (RFC 4279, Section 2), omit - * PSA_KEY_DERIVATION_INPUT_OTHER_SECRET - * - for a DHE-PSK (RFC 4279, Section 3) or ECDHE-PSK cipher suite - * (RFC 5489, Section 2), the other secret should be the output of the - * PSA_ALG_FFDH or PSA_ALG_ECDH key agreement performed with the peer. - * The recommended way to pass this input is to use a key derivation - * algorithm constructed as - * PSA_ALG_KEY_AGREEMENT(ka_alg, PSA_ALG_TLS12_PSK_TO_MS(hash_alg)) - * and to call psa_key_derivation_key_agreement(). Alternatively, - * this input may be an output of `psa_raw_key_agreement()` passed with - * psa_key_derivation_input_bytes(), or an equivalent input passed with - * psa_key_derivation_input_bytes() or psa_key_derivation_input_key(). - * - for a RSA-PSK cipher suite (RFC 4279, Section 4), the other secret - * should be the 48-byte client challenge (the PreMasterSecret of - * (RFC 5246, Section 7.4.7.1)) concatenation of the TLS version and - * a 46-byte random string chosen by the client. On the server, this is - * typically an output of psa_asymmetric_decrypt() using - * PSA_ALG_RSA_PKCS1V15_CRYPT, passed to the key derivation operation - * with `psa_key_derivation_input_bytes()`. - * - * For example, `PSA_ALG_TLS12_PSK_TO_MS(PSA_ALG_SHA_256)` represents the - * TLS-1.2 PSK to MasterSecret derivation PRF using HMAC-SHA-256. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding TLS-1.2 PSK to MS algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_TLS12_PSK_TO_MS(hash_alg) \ - (PSA_ALG_TLS12_PSK_TO_MS_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -/** Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is a TLS-1.2 PSK to MS algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_TLS12_PSK_TO_MS(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_TLS12_PSK_TO_MS_BASE) -#define PSA_ALG_TLS12_PSK_TO_MS_GET_HASH(hkdf_alg) \ - (PSA_ALG_CATEGORY_HASH | ((hkdf_alg) & PSA_ALG_HASH_MASK)) - -/* The TLS 1.2 ECJPAKE-to-PMS KDF. It takes the shared secret K (an EC point - * in case of EC J-PAKE) and calculates SHA256(K.X) that the rest of TLS 1.2 - * will use to derive the session secret, as defined by step 2 of - * https://datatracker.ietf.org/doc/html/draft-cragie-tls-ecjpake-01#section-8.7. - * Uses PSA_ALG_SHA_256. - * This function takes a single input: - * #PSA_KEY_DERIVATION_INPUT_SECRET is the shared secret K from EC J-PAKE. - * The only supported curve is secp256r1 (the 256-bit curve in - * #PSA_ECC_FAMILY_SECP_R1), so the input must be exactly 65 bytes. - * The output has to be read as a single chunk of 32 bytes, defined as - * PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE. - */ -#define PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t) 0x08000609) - -/* This flag indicates whether the key derivation algorithm is suitable for - * use on low-entropy secrets such as password - these algorithms are also - * known as key stretching or password hashing schemes. These are also the - * algorithms that accepts inputs of type #PSA_KEY_DERIVATION_INPUT_PASSWORD. - * - * Those algorithms cannot be combined with a key agreement algorithm. - */ -#define PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG ((psa_algorithm_t) 0x00800000) - -#define PSA_ALG_PBKDF2_HMAC_BASE ((psa_algorithm_t) 0x08800100) -/** Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm. - * - * PBKDF2 is defined by PKCS#5, republished as RFC 8018 (section 5.2). - * This macro specifies the PBKDF2 algorithm constructed using a PRF based on - * HMAC with the specified hash. - * For example, `PSA_ALG_PBKDF2_HMAC(PSA_ALG_SHA_256)` specifies PBKDF2 - * using the PRF HMAC-SHA-256. - * - * This key derivation algorithm uses the following inputs, which must be - * provided in the following order: - * - #PSA_KEY_DERIVATION_INPUT_COST is the iteration count. - * This input step must be used exactly once. - * - #PSA_KEY_DERIVATION_INPUT_SALT is the salt. - * This input step must be used one or more times; if used several times, the - * inputs will be concatenated. This can be used to build the final salt - * from multiple sources, both public and secret (also known as pepper). - * - #PSA_KEY_DERIVATION_INPUT_PASSWORD is the password to be hashed. - * This input step must be used exactly once. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding PBKDF2-HMAC-XXX algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_PBKDF2_HMAC(hash_alg) \ - (PSA_ALG_PBKDF2_HMAC_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - -/** Whether the specified algorithm is a PBKDF2-HMAC algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is a PBKDF2-HMAC algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_PBKDF2_HMAC(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_PBKDF2_HMAC_BASE) -#define PSA_ALG_PBKDF2_HMAC_GET_HASH(pbkdf2_alg) \ - (PSA_ALG_CATEGORY_HASH | ((pbkdf2_alg) & PSA_ALG_HASH_MASK)) - -/** The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm. - * - * PBKDF2 is defined by PKCS#5, republished as RFC 8018 (section 5.2). - * This macro specifies the PBKDF2 algorithm constructed using the - * AES-CMAC-PRF-128 PRF specified by RFC 4615. - * - * This key derivation algorithm uses the same inputs as - * #PSA_ALG_PBKDF2_HMAC() with the same constraints. - */ -#define PSA_ALG_PBKDF2_AES_CMAC_PRF_128 ((psa_algorithm_t) 0x08800200) - -#define PSA_ALG_IS_PBKDF2(kdf_alg) \ - (PSA_ALG_IS_PBKDF2_HMAC(kdf_alg) || \ - ((kdf_alg) == PSA_ALG_PBKDF2_AES_CMAC_PRF_128)) - - -#define PSA_ALG_SP800_108_COUNTER_HMAC_BASE ((psa_algorithm_t) 0x08000700) - /** Macro to build a NIST SP 800-108 conformant, counter-mode KDF algorithm based on HMAC. - * - * For example, PSA_ALG_SP800_108_COUNTER_HMAC(PSA_ALG_SHA_256) is counter-mode KDF using HMAC-SHA-256. - * - * This is an HMAC-based, counter mode key derivation function, using the construction recommended - * specified by SP800-108, §4.1. - * - * This key derivation algorithm uses the following inputs: - * - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret input keying material, K_in. - * - #PSA_KEY_DERIVATION_INPUT_LABEL is the label. - * It is optional; if omitted, the label is a zero-length string. If provided, it must not contain any null bytes. - * - #PSA_KEY_DERIVATION_INPUT_CONTEXT is the context. - * It is optional; if omitted, the context is a zero-length string. - * Each input can only be passed once. Inputs must be passed in the order above. - * - * This algorithm uses the output length as part of the derivation process. In the derivation this value is L, - * the required output size in bits. After setup, the initial capacity of the key derivation operation is - * 2^29 - 1 bytes (0x1fffffff). The capacity can be set to a lower value by calling psa_key_derivation_set_capacity(). - * When the first output is requested, the value of L is calculated as L = 8 * cap, where cap is the value of - * psa_key_derivation_get_capacity(). - * Subsequent calls to psa_key_derivation_set_capacity() are not permitted for this algorithm. - * - * The derivation is constructed as described in SP800-108 §4.1, with the iteration counter i and - * output length L encoded as big-endian, 32-bit values. The resulting output stream - * K_1 || K_2 || K_3 || ... is computed as: - * - * K_i = HMAC( K_in, [i]4 || label || 0x00 || context || [L]4 ), for i = 1, 2, 3, ... - * Where [x]n is the big-endian, n-byte encoding of the integer x. - * - * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that - * #PSA_ALG_IS_HASH(\p hash_alg) is true). - * - * \return The corresponding counter-mode KDF algorithm. - * \return Unspecified if \p hash_alg is not a supported - * hash algorithm. - */ -#define PSA_ALG_SP800_108_COUNTER_HMAC(hash_alg) \ - (PSA_ALG_SP800_108_COUNTER_HMAC_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - - /** Whether the specified algorithm is a key derivation algorithm constructed - * using #PSA_ALG_SP800_108_COUNTER_HMAC(\p hash_alg). - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a key derivation algorithm constructed using #PSA_ALG_SP800_108_COUNTER_HMAC(), - * 0 otherwise. This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_SP800_108_COUNTER_HMAC(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_SP800_108_COUNTER_HMAC_BASE) - - /** Macro to build a NIST SP 800-108 conformant, counter-mode KDF algorithm based on CMAC. - * - * This is a CMAC-based, counter mode key derivation function, using the construction recommended - * specified by SP800-108, §4.1. - * - * This key derivation algorithm uses the following inputs: - * - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret input keying material, K_in. - * This must be a block-cipher key that is compatible with the CMAC algorithm, - * and must be input using psa_key_derivation_input_key(). See also #PSA_ALG_CMAC. - * - #PSA_KEY_DERIVATION_INPUT_LABEL is the label. - * It is optional; if omitted, the label is a zero-length string. If provided, it must not contain any null bytes. - * - #PSA_KEY_DERIVATION_INPUT_CONTEXT is the context. - * It is optional; if omitted, the context is a zero-length string. - * Each input can only be passed once. Inputs must be passed in the order above. - * - * This algorithm uses the output length as part of the derivation process. In the derivation this value is L, - * the required output size in bits. After setup, the initial capacity of the key derivation operation is - * 2^29 - 1 bytes (0x1fffffff). The capacity can be set to a lower value by calling psa_key_derivation_set_capacity(). - * When the first output is requested, the value of L is calculated as L = 8 * cap, where cap is the value of - * psa_key_derivation_get_capacity(). - * Subsequent calls to psa_key_derivation_set_capacity() are not permitted for this algorithm. - * - * The derivation is constructed as described in SP800-108 §4.1, , with the following details: - * - The iteration counter i and output length L are encoded as big-endian, 32-bit values. - * - The mitigation to make the CMAC-based construction robust is implemented. - * - * The resulting output stream K_1 || K_2 || K_3 || ... is computed as: - * - * K_0 = CMAC( K_in, label || 0x00 || context || [L]4 ) - * K_i = CMAC( K_in, [i]4 || label || 0x00 || context || [L]4 || K_0), for i = 1, 2, 3, ... - * Where [x]n is the big-endian, n-byte encoding of the integer x. - * - * \return The corresponding counter-mode KDF algorithm. - */ -#define PSA_ALG_SP800_108_COUNTER_CMAC ((psa_algorithm_t) 0x08000800) - -#define PSA_ALG_SRP_PASSWORD_HASH_BASE ((psa_algorithm_t) 0x08800300) - /** The SRP password to password-hash KDF. - * It takes the password p, the salt s, and the user id u. - * It calculates the password hash h as - * h = H(salt || H(u || ":" || p)) - * where H is the given hash algorithm. - * - * This key derivation algorithm uses the following inputs, which must be - * provided in the following order: - * - #PSA_KEY_DERIVATION_INPUT_INFO is the user id. - * - #PSA_KEY_DERIVATION_INPUT_PASSWORD is the password. - * - #PSA_KEY_DERIVATION_INPUT_SALT is the salt. - * The output has to be read as a key of type PSA_KEY_TYPE_SRP_KEY_PAIR. - */ -#define PSA_ALG_SRP_PASSWORD_HASH(hash_alg) \ - (PSA_ALG_SRP_PASSWORD_HASH_BASE | ((hash_alg) & PSA_ALG_HASH_MASK)) - - /** Whether the specified algorithm is a key derivation algorithm constructed - * using #PSA_ALG_SRP_PASSWORD_HASH(\p hash_alg). - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a key derivation algorithm constructed using #PSA_ALG_SRP_PASSWORD_HASH(), - * 0 otherwise. This macro may return either 0 or 1 if \c alg is not a supported - * key derivation algorithm identifier. - */ -#define PSA_ALG_IS_SRP_PASSWORD_HASH(alg) \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_SRP_PASSWORD_HASH_BASE) - -#define PSA_ALG_KEY_DERIVATION_MASK ((psa_algorithm_t) 0xfe00ffff) -#define PSA_ALG_KEY_AGREEMENT_MASK ((psa_algorithm_t) 0xffff0000) - -/** Macro to build a combined algorithm that chains a key agreement with - * a key derivation. - * - * \param ka_alg A key agreement algorithm (\c PSA_ALG_XXX value such - * that #PSA_ALG_IS_KEY_AGREEMENT(\p ka_alg) is true). - * \param kdf_alg A key derivation algorithm (\c PSA_ALG_XXX value such - * that #PSA_ALG_IS_KEY_DERIVATION(\p kdf_alg) is true). - * - * \return The corresponding key agreement and derivation - * algorithm. - * \return Unspecified if \p ka_alg is not a supported - * key agreement algorithm or \p kdf_alg is not a - * supported key derivation algorithm. - */ -#define PSA_ALG_KEY_AGREEMENT(ka_alg, kdf_alg) \ - ((ka_alg) | (kdf_alg)) - -#define PSA_ALG_KEY_AGREEMENT_GET_KDF(alg) \ - (((alg) & PSA_ALG_KEY_DERIVATION_MASK) | PSA_ALG_CATEGORY_KEY_DERIVATION) - -#define PSA_ALG_KEY_AGREEMENT_GET_BASE(alg) \ - (((alg) & PSA_ALG_KEY_AGREEMENT_MASK) | PSA_ALG_CATEGORY_KEY_AGREEMENT) - -/** Whether the specified algorithm is a raw key agreement algorithm. - * - * A raw key agreement algorithm is one that does not specify - * a key derivation function. - * Usually, raw key agreement algorithms are constructed directly with - * a \c PSA_ALG_xxx macro while non-raw key agreement algorithms are - * constructed with #PSA_ALG_KEY_AGREEMENT(). - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \p alg is a raw key agreement algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \p alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_RAW_KEY_AGREEMENT(alg) \ - (PSA_ALG_IS_KEY_AGREEMENT(alg) && \ - PSA_ALG_KEY_AGREEMENT_GET_KDF(alg) == PSA_ALG_CATEGORY_KEY_DERIVATION) - -#define PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT(alg) \ - ((PSA_ALG_IS_KEY_DERIVATION(alg) || PSA_ALG_IS_KEY_AGREEMENT(alg))) - -/** The finite-field Diffie-Hellman (DH) key agreement algorithm. - * - * The shared secret produced by key agreement is - * `g^{ab}` in big-endian format. - * It is `ceiling(m / 8)` bytes long where `m` is the size of the prime `p` - * in bits. - */ -#define PSA_ALG_FFDH ((psa_algorithm_t) 0x09010000) - -/** Whether the specified algorithm is a finite field Diffie-Hellman algorithm. - * - * This includes the raw finite field Diffie-Hellman algorithm as well as - * finite-field Diffie-Hellman followed by any supporter key derivation - * algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is a finite field Diffie-Hellman algorithm, 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key agreement algorithm identifier. - */ -#define PSA_ALG_IS_FFDH(alg) \ - (PSA_ALG_KEY_AGREEMENT_GET_BASE(alg) == PSA_ALG_FFDH) - -/** The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm. - * - * The shared secret produced by key agreement is the x-coordinate of - * the shared secret point. It is always `ceiling(m / 8)` bytes long where - * `m` is the bit size associated with the curve, i.e. the bit size of the - * order of the curve's coordinate field. When `m` is not a multiple of 8, - * the byte containing the most significant bit of the shared secret - * is padded with zero bits. The byte order is either little-endian - * or big-endian depending on the curve type. - * - * - For Montgomery curves (curve types `PSA_ECC_FAMILY_CURVEXXX`), - * the shared secret is the x-coordinate of `d_A Q_B = d_B Q_A` - * in little-endian byte order. - * The bit size is 448 for Curve448 and 255 for Curve25519. - * - For Weierstrass curves over prime fields (curve types - * `PSA_ECC_FAMILY_SECPXXX` and `PSA_ECC_FAMILY_BRAINPOOL_PXXX`), - * the shared secret is the x-coordinate of `d_A Q_B = d_B Q_A` - * in big-endian byte order. - * The bit size is `m = ceiling(log_2(p))` for the field `F_p`. - * - For Weierstrass curves over binary fields (curve types - * `PSA_ECC_FAMILY_SECTXXX`), - * the shared secret is the x-coordinate of `d_A Q_B = d_B Q_A` - * in big-endian byte order. - * The bit size is `m` for the field `F_{2^m}`. - */ -#define PSA_ALG_ECDH ((psa_algorithm_t) 0x09020000) - -/** Whether the specified algorithm is an elliptic curve Diffie-Hellman - * algorithm. - * - * This includes the raw elliptic curve Diffie-Hellman algorithm as well as - * elliptic curve Diffie-Hellman followed by any supporter key derivation - * algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is an elliptic curve Diffie-Hellman algorithm, - * 0 otherwise. - * This macro may return either 0 or 1 if \c alg is not a supported - * key agreement algorithm identifier. - */ -#define PSA_ALG_IS_ECDH(alg) \ - (PSA_ALG_KEY_AGREEMENT_GET_BASE(alg) == PSA_ALG_ECDH) - -/** Whether the specified algorithm encoding is a wildcard. - * - * Wildcard values may only be used to set the usage algorithm field in - * a policy, not to perform an operation. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return 1 if \c alg is a wildcard algorithm encoding. - * \return 0 if \c alg is a non-wildcard algorithm encoding (suitable for - * an operation). - * \return This macro may return either 0 or 1 if \c alg is not a supported - * algorithm identifier. - */ -#define PSA_ALG_IS_WILDCARD(alg) \ - (PSA_ALG_IS_HASH_AND_SIGN(alg) ? \ - PSA_ALG_SIGN_GET_HASH(alg) == PSA_ALG_ANY_HASH : \ - PSA_ALG_IS_MAC(alg) ? \ - (alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0 : \ - PSA_ALG_IS_AEAD(alg) ? \ - (alg & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0 : \ - (alg) == PSA_ALG_ANY_HASH) - -/** Get the hash used by a composite algorithm. - * - * \param alg An algorithm identifier (value of type #psa_algorithm_t). - * - * \return The underlying hash algorithm if alg is a composite algorithm that - * uses a hash algorithm. - * - * \return \c 0 if alg is not a composite algorithm that uses a hash. - */ -#define PSA_ALG_GET_HASH(alg) \ - (((alg) & 0x000000ff) == 0 ? ((psa_algorithm_t) 0) : 0x02000000 | ((alg) & 0x000000ff)) - -/**@}*/ - -/** \defgroup key_lifetimes Key lifetimes - * @{ - */ - -/* Note that location and persistence level values are embedded in the - * persistent key store, as part of key metadata. As a consequence, they - * must not be changed (unless the storage format version changes). - */ - -/** The default lifetime for volatile keys. - * - * A volatile key only exists as long as the identifier to it is not destroyed. - * The key material is guaranteed to be erased on a power reset. - * - * A key with this lifetime is typically stored in the RAM area of the - * PSA Crypto subsystem. However this is an implementation choice. - * If an implementation stores data about the key in a non-volatile memory, - * it must release all the resources associated with the key and erase the - * key material if the calling application terminates. - */ -#define PSA_KEY_LIFETIME_VOLATILE ((psa_key_lifetime_t) 0x00000000) - -/** The default lifetime for persistent keys. - * - * A persistent key remains in storage until it is explicitly destroyed or - * until the corresponding storage area is wiped. This specification does - * not define any mechanism to wipe a storage area, but integrations may - * provide their own mechanism (for example to perform a factory reset, - * to prepare for device refurbishment, or to uninstall an application). - * - * This lifetime value is the default storage area for the calling - * application. Integrations of Mbed TLS may support other persistent lifetimes. - * See ::psa_key_lifetime_t for more information. - */ -#define PSA_KEY_LIFETIME_PERSISTENT ((psa_key_lifetime_t) 0x00000001) - -/** The persistence level of volatile keys. - * - * See ::psa_key_persistence_t for more information. - */ -#define PSA_KEY_PERSISTENCE_VOLATILE ((psa_key_persistence_t) 0x00) - -/** The default persistence level for persistent keys. - * - * See ::psa_key_persistence_t for more information. - */ -#define PSA_KEY_PERSISTENCE_DEFAULT ((psa_key_persistence_t) 0x01) - -/** A persistence level indicating that a key is never destroyed. - * - * See ::psa_key_persistence_t for more information. - */ -#define PSA_KEY_PERSISTENCE_READ_ONLY ((psa_key_persistence_t) 0xff) - -#define PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) \ - ((psa_key_persistence_t) ((lifetime) & 0x000000ff)) - -#define PSA_KEY_LIFETIME_GET_LOCATION(lifetime) \ - ((psa_key_location_t) ((lifetime) >> 8)) - -/** Whether a key lifetime indicates that the key is volatile. - * - * A volatile key is automatically destroyed by the implementation when - * the application instance terminates. In particular, a volatile key - * is automatically destroyed on a power reset of the device. - * - * A key that is not volatile is persistent. Persistent keys are - * preserved until the application explicitly destroys them or until an - * implementation-specific device management event occurs (for example, - * a factory reset). - * - * \param lifetime The lifetime value to query (value of type - * ::psa_key_lifetime_t). - * - * \return \c 1 if the key is volatile, otherwise \c 0. - */ -#define PSA_KEY_LIFETIME_IS_VOLATILE(lifetime) \ - (PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == \ - PSA_KEY_PERSISTENCE_VOLATILE) - -/** Whether a key lifetime indicates that the key is read-only. - * - * Read-only keys cannot be created or destroyed through the PSA Crypto API. - * They must be created through platform-specific means that bypass the API. - * - * Some platforms may offer ways to destroy read-only keys. For example, - * consider a platform with multiple levels of privilege, where a - * low-privilege application can use a key but is not allowed to destroy - * it, and the platform exposes the key to the application with a read-only - * lifetime. High-privilege code can destroy the key even though the - * application sees the key as read-only. - * - * \param lifetime The lifetime value to query (value of type - * ::psa_key_lifetime_t). - * - * \return \c 1 if the key is read-only, otherwise \c 0. - */ -#define PSA_KEY_LIFETIME_IS_READ_ONLY(lifetime) \ - (PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == \ - PSA_KEY_PERSISTENCE_READ_ONLY) - -/** Construct a lifetime from a persistence level and a location. - * - * \param persistence The persistence level - * (value of type ::psa_key_persistence_t). - * \param location The location indicator - * (value of type ::psa_key_location_t). - * - * \return The constructed lifetime value. - */ -#define PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location) \ - ((location) << 8 | (persistence)) - -/** The local storage area for persistent keys. - * - * This storage area is available on all systems that can store persistent - * keys without delegating the storage to a third-party cryptoprocessor. - * - * See ::psa_key_location_t for more information. - */ -#define PSA_KEY_LOCATION_LOCAL_STORAGE ((psa_key_location_t) 0x000000) - -#define PSA_KEY_LOCATION_VENDOR_FLAG ((psa_key_location_t) 0x800000) - -/* Note that key identifier values are embedded in the - * persistent key store, as part of key metadata. As a consequence, they - * must not be changed (unless the storage format version changes). - */ - -/** The null key identifier. - */ -/* *INDENT-OFF* (https://github.com/ARM-software/psa-arch-tests/issues/337) */ -#define PSA_KEY_ID_NULL ((psa_key_id_t)0) -/* *INDENT-ON* */ -/** The minimum value for a key identifier chosen by the application. - */ -#define PSA_KEY_ID_USER_MIN ((psa_key_id_t) 0x00000001) -/** The maximum value for a key identifier chosen by the application. - */ -#define PSA_KEY_ID_USER_MAX ((psa_key_id_t) 0x3fffffff) -/** The minimum value for a key identifier chosen by the implementation. - */ -#define PSA_KEY_ID_VENDOR_MIN ((psa_key_id_t) 0x40000000) -/** The maximum value for a key identifier chosen by the implementation. - */ -#define PSA_KEY_ID_VENDOR_MAX ((psa_key_id_t) 0x7fffffff) - - -#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) - -#define MBEDTLS_SVC_KEY_ID_INIT ((psa_key_id_t) 0) -#define MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id) (id) -#define MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(id) (0) - -/** Utility to initialize a key identifier at runtime. - * - * \param unused Unused parameter. - * \param key_id Identifier of the key. - */ -static inline mbedtls_svc_key_id_t mbedtls_svc_key_id_make( - unsigned int unused, psa_key_id_t key_id) -{ - (void) unused; - - return key_id; -} - -/** Compare two key identifiers. - * - * \param id1 First key identifier. - * \param id2 Second key identifier. - * - * \return Non-zero if the two key identifier are equal, zero otherwise. - */ -static inline int mbedtls_svc_key_id_equal(mbedtls_svc_key_id_t id1, - mbedtls_svc_key_id_t id2) -{ - return id1 == id2; -} - -/** Check whether a key identifier is null. - * - * \param key Key identifier. - * - * \return Non-zero if the key identifier is null, zero otherwise. - */ -static inline int mbedtls_svc_key_id_is_null(mbedtls_svc_key_id_t key) -{ - return key == 0; -} - -#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */ - -#define MBEDTLS_SVC_KEY_ID_INIT ((mbedtls_svc_key_id_t){ 0, 0 }) -#define MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id) ((id).MBEDTLS_PRIVATE(key_id)) -#define MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(id) ((id).MBEDTLS_PRIVATE(owner)) - -/** Utility to initialize a key identifier at runtime. - * - * \param owner_id Identifier of the key owner. - * \param key_id Identifier of the key. - */ -static inline mbedtls_svc_key_id_t mbedtls_svc_key_id_make( - mbedtls_key_owner_id_t owner_id, psa_key_id_t key_id) -{ - return (mbedtls_svc_key_id_t){ .MBEDTLS_PRIVATE(key_id) = key_id, - .MBEDTLS_PRIVATE(owner) = owner_id }; -} - -/** Compare two key identifiers. - * - * \param id1 First key identifier. - * \param id2 Second key identifier. - * - * \return Non-zero if the two key identifier are equal, zero otherwise. - */ -static inline int mbedtls_svc_key_id_equal(mbedtls_svc_key_id_t id1, - mbedtls_svc_key_id_t id2) -{ - return (id1.MBEDTLS_PRIVATE(key_id) == id2.MBEDTLS_PRIVATE(key_id)) && - mbedtls_key_owner_id_equal(id1.MBEDTLS_PRIVATE(owner), id2.MBEDTLS_PRIVATE(owner)); -} - -/** Check whether a key identifier is null. - * - * \param key Key identifier. - * - * \return Non-zero if the key identifier is null, zero otherwise. - */ -static inline int mbedtls_svc_key_id_is_null(mbedtls_svc_key_id_t key) -{ - return key.MBEDTLS_PRIVATE(key_id) == 0; -} - -#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */ - -/**@}*/ - -/** \defgroup policy Key policies - * @{ - */ - -/* Note that key usage flags are embedded in the - * persistent key store, as part of key metadata. As a consequence, they - * must not be changed (unless the storage format version changes). - */ - -/** Whether the key may be exported. - * - * A public key or the public part of a key pair may always be exported - * regardless of the value of this permission flag. - * - * If a key does not have export permission, implementations shall not - * allow the key to be exported in plain form from the cryptoprocessor, - * whether through psa_export_key() or through a proprietary interface. - * The key may however be exportable in a wrapped form, i.e. in a form - * where it is encrypted by another key. - */ -#define PSA_KEY_USAGE_EXPORT ((psa_key_usage_t) 0x00000001) - -/** Whether the key may be copied. - * - * This flag allows the use of psa_copy_key() to make a copy of the key - * with the same policy or a more restrictive policy. - * - * For lifetimes for which the key is located in a secure element which - * enforce the non-exportability of keys, copying a key outside the secure - * element also requires the usage flag #PSA_KEY_USAGE_EXPORT. - * Copying the key inside the secure element is permitted with just - * #PSA_KEY_USAGE_COPY if the secure element supports it. - * For keys with the lifetime #PSA_KEY_LIFETIME_VOLATILE or - * #PSA_KEY_LIFETIME_PERSISTENT, the usage flag #PSA_KEY_USAGE_COPY - * is sufficient to permit the copy. - */ -#define PSA_KEY_USAGE_COPY ((psa_key_usage_t) 0x00000002) - -/** Whether the key may be used to encrypt a message. - * - * This flag allows the key to be used for a symmetric encryption operation, - * for an AEAD encryption-and-authentication operation, - * or for an asymmetric encryption operation, - * if otherwise permitted by the key's type and policy. - * - * For a key pair, this concerns the public key. - */ -#define PSA_KEY_USAGE_ENCRYPT ((psa_key_usage_t) 0x00000100) - -/** Whether the key may be used to decrypt a message. - * - * This flag allows the key to be used for a symmetric decryption operation, - * for an AEAD decryption-and-verification operation, - * or for an asymmetric decryption operation, - * if otherwise permitted by the key's type and policy. - * - * For a key pair, this concerns the private key. - */ -#define PSA_KEY_USAGE_DECRYPT ((psa_key_usage_t) 0x00000200) - -/** Whether the key may be used to sign a message. - * - * This flag allows the key to be used for a MAC calculation operation or for - * an asymmetric message signature operation, if otherwise permitted by the - * key’s type and policy. - * - * For a key pair, this concerns the private key. - */ -#define PSA_KEY_USAGE_SIGN_MESSAGE ((psa_key_usage_t) 0x00000400) - -/** Whether the key may be used to verify a message. - * - * This flag allows the key to be used for a MAC verification operation or for - * an asymmetric message signature verification operation, if otherwise - * permitted by the key’s type and policy. - * - * For a key pair, this concerns the public key. - */ -#define PSA_KEY_USAGE_VERIFY_MESSAGE ((psa_key_usage_t) 0x00000800) - -/** Whether the key may be used to sign a message. - * - * This flag allows the key to be used for a MAC calculation operation - * or for an asymmetric signature operation, - * if otherwise permitted by the key's type and policy. - * - * For a key pair, this concerns the private key. - */ -#define PSA_KEY_USAGE_SIGN_HASH ((psa_key_usage_t) 0x00001000) - -/** Whether the key may be used to verify a message signature. - * - * This flag allows the key to be used for a MAC verification operation - * or for an asymmetric signature verification operation, - * if otherwise permitted by the key's type and policy. - * - * For a key pair, this concerns the public key. - */ -#define PSA_KEY_USAGE_VERIFY_HASH ((psa_key_usage_t) 0x00002000) - -/** Whether the key may be used to derive other keys or produce a password - * hash. - * - * This flag allows the key to be used for a key derivation operation or for - * a key agreement operation, if otherwise permitted by the key's type and - * policy. - * - * If this flag is present on all keys used in calls to - * psa_key_derivation_input_key() for a key derivation operation, then it - * permits calling psa_key_derivation_output_bytes() or - * psa_key_derivation_output_key() at the end of the operation. - */ -#define PSA_KEY_USAGE_DERIVE ((psa_key_usage_t) 0x00004000) - -/** Whether the key may be used to verify the result of a key derivation, - * including password hashing. - * - * This flag allows the key to be used: - * - * This flag allows the key to be used in a key derivation operation, if - * otherwise permitted by the key's type and policy. - * - * If this flag is present on all keys used in calls to - * psa_key_derivation_input_key() for a key derivation operation, then it - * permits calling psa_key_derivation_verify_bytes() or - * psa_key_derivation_verify_key() at the end of the operation. - */ -#define PSA_KEY_USAGE_VERIFY_DERIVATION ((psa_key_usage_t) 0x00008000) - -/**@}*/ - -/** \defgroup derivation Key derivation - * @{ - */ - -/* Key input steps are not embedded in the persistent storage, so you can - * change them if needed: it's only an ABI change. */ - -/** A secret input for key derivation. - * - * This should be a key of type #PSA_KEY_TYPE_DERIVE - * (passed to psa_key_derivation_input_key()) - * or the shared secret resulting from a key agreement - * (obtained via psa_key_derivation_key_agreement()). - * - * The secret can also be a direct input (passed to - * key_derivation_input_bytes()). In this case, the derivation operation - * may not be used to derive keys: the operation will only allow - * psa_key_derivation_output_bytes(), - * psa_key_derivation_verify_bytes(), or - * psa_key_derivation_verify_key(), but not - * psa_key_derivation_output_key(). - */ -#define PSA_KEY_DERIVATION_INPUT_SECRET ((psa_key_derivation_step_t) 0x0101) - -/** A low-entropy secret input for password hashing / key stretching. - * - * This is usually a key of type #PSA_KEY_TYPE_PASSWORD (passed to - * psa_key_derivation_input_key()) or a direct input (passed to - * psa_key_derivation_input_bytes()) that is a password or passphrase. It can - * also be high-entropy secret such as a key of type #PSA_KEY_TYPE_DERIVE or - * the shared secret resulting from a key agreement. - * - * The secret can also be a direct input (passed to - * key_derivation_input_bytes()). In this case, the derivation operation - * may not be used to derive keys: the operation will only allow - * psa_key_derivation_output_bytes(), - * psa_key_derivation_verify_bytes(), or - * psa_key_derivation_verify_key(), but not - * psa_key_derivation_output_key(). - */ -#define PSA_KEY_DERIVATION_INPUT_PASSWORD ((psa_key_derivation_step_t) 0x0102) - -/** A high-entropy additional secret input for key derivation. - * - * This is typically the shared secret resulting from a key agreement obtained - * via `psa_key_derivation_key_agreement()`. It may alternatively be a key of - * type `PSA_KEY_TYPE_DERIVE` passed to `psa_key_derivation_input_key()`, or - * a direct input passed to `psa_key_derivation_input_bytes()`. - */ -#define PSA_KEY_DERIVATION_INPUT_OTHER_SECRET \ - ((psa_key_derivation_step_t) 0x0103) - -/** A label for key derivation. - * - * This should be a direct input. - * It can also be a key of type #PSA_KEY_TYPE_RAW_DATA. - */ -#define PSA_KEY_DERIVATION_INPUT_LABEL ((psa_key_derivation_step_t) 0x0201) - -/** A salt for key derivation. - * - * This should be a direct input. - * It can also be a key of type #PSA_KEY_TYPE_RAW_DATA or - * #PSA_KEY_TYPE_PEPPER. - */ -#define PSA_KEY_DERIVATION_INPUT_SALT ((psa_key_derivation_step_t) 0x0202) - -/** An information string for key derivation. - * - * This should be a direct input. - * It can also be a key of type #PSA_KEY_TYPE_RAW_DATA. - */ -#define PSA_KEY_DERIVATION_INPUT_INFO ((psa_key_derivation_step_t) 0x0203) - -/** A seed for key derivation. - * - * This should be a direct input. - * It can also be a key of type #PSA_KEY_TYPE_RAW_DATA. - */ -#define PSA_KEY_DERIVATION_INPUT_SEED ((psa_key_derivation_step_t) 0x0204) - -/** A cost parameter for password hashing / key stretching. - * - * This must be a direct input, passed to psa_key_derivation_input_integer(). - */ -#define PSA_KEY_DERIVATION_INPUT_COST ((psa_key_derivation_step_t) 0x0205) - -/** A context for key derivation. - * - * This should be a direct input. - * It can also be a key of type #PSA_KEY_TYPE_RAW_DATA. - */ -#define PSA_KEY_DERIVATION_INPUT_CONTEXT ((psa_key_derivation_step_t) 0x0206) - -/**@}*/ - -/** \defgroup helper_macros Helper macros - * @{ - */ - -/* Helper macros */ - -/** Check if two AEAD algorithm identifiers refer to the same AEAD algorithm - * regardless of the tag length they encode. - * - * \param aead_alg_1 An AEAD algorithm identifier. - * \param aead_alg_2 An AEAD algorithm identifier. - * - * \return 1 if both identifiers refer to the same AEAD algorithm, - * 0 otherwise. - * Unspecified if neither \p aead_alg_1 nor \p aead_alg_2 are - * a supported AEAD algorithm. - */ -#define MBEDTLS_PSA_ALG_AEAD_EQUAL(aead_alg_1, aead_alg_2) \ - (!(((aead_alg_1) ^ (aead_alg_2)) & \ - ~(PSA_ALG_AEAD_TAG_LENGTH_MASK | PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG))) - -/**@}*/ - -/**@}*/ - -/** \defgroup interruptible Interruptible operations - * @{ - */ - -/** Maximum value for use with \c psa_interruptible_set_max_ops() to determine - * the maximum number of ops allowed to be executed by an interruptible - * function in a single call. - */ -#define PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED UINT32_MAX - -/**@}*/ - -#endif /* PSA_CRYPTO_VALUES_H */ diff --git a/ext/oberon/psa/core/library/alignment.h b/ext/oberon/psa/core/library/alignment.h deleted file mode 100644 index ab15986e5176..000000000000 --- a/ext/oberon/psa/core/library/alignment.h +++ /dev/null @@ -1,521 +0,0 @@ -/** - * \file alignment.h - * - * \brief Utility code for dealing with unaligned memory accesses - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_LIBRARY_ALIGNMENT_H -#define MBEDTLS_LIBRARY_ALIGNMENT_H - -#include -#include -#include - -/* - * Define MBEDTLS_EFFICIENT_UNALIGNED_ACCESS for architectures where unaligned memory - * accesses are known to be efficient. - * - * All functions defined here will behave correctly regardless, but might be less - * efficient when this is not defined. - */ -#if defined(__ARM_FEATURE_UNALIGNED) \ - || defined(__i386__) || defined(__amd64__) || defined(__x86_64__) -/* - * __ARM_FEATURE_UNALIGNED is defined where appropriate by armcc, gcc 7, clang 9 - * (and later versions) for Arm v7 and later; all x86 platforms should have - * efficient unaligned access. - */ -#define MBEDTLS_EFFICIENT_UNALIGNED_ACCESS -#endif - -/** - * Read the unsigned 16 bits integer from the given address, which need not - * be aligned. - * - * \param p pointer to 2 bytes of data - * \return Data at the given address - */ -inline uint16_t mbedtls_get_unaligned_uint16(const void *p) -{ - uint16_t r; - memcpy(&r, p, sizeof(r)); - return r; -} - -/** - * Write the unsigned 16 bits integer to the given address, which need not - * be aligned. - * - * \param p pointer to 2 bytes of data - * \param x data to write - */ -inline void mbedtls_put_unaligned_uint16(void *p, uint16_t x) -{ - memcpy(p, &x, sizeof(x)); -} - -/** - * Read the unsigned 32 bits integer from the given address, which need not - * be aligned. - * - * \param p pointer to 4 bytes of data - * \return Data at the given address - */ -inline uint32_t mbedtls_get_unaligned_uint32(const void *p) -{ - uint32_t r; - memcpy(&r, p, sizeof(r)); - return r; -} - -/** - * Write the unsigned 32 bits integer to the given address, which need not - * be aligned. - * - * \param p pointer to 4 bytes of data - * \param x data to write - */ -inline void mbedtls_put_unaligned_uint32(void *p, uint32_t x) -{ - memcpy(p, &x, sizeof(x)); -} - -/** - * Read the unsigned 64 bits integer from the given address, which need not - * be aligned. - * - * \param p pointer to 8 bytes of data - * \return Data at the given address - */ -inline uint64_t mbedtls_get_unaligned_uint64(const void *p) -{ - uint64_t r; - memcpy(&r, p, sizeof(r)); - return r; -} - -/** - * Write the unsigned 64 bits integer to the given address, which need not - * be aligned. - * - * \param p pointer to 8 bytes of data - * \param x data to write - */ -inline void mbedtls_put_unaligned_uint64(void *p, uint64_t x) -{ - memcpy(p, &x, sizeof(x)); -} - -/** Byte Reading Macros - * - * Given a multi-byte integer \p x, MBEDTLS_BYTE_n retrieves the n-th - * byte from x, where byte 0 is the least significant byte. - */ -#define MBEDTLS_BYTE_0(x) ((uint8_t) ((x) & 0xff)) -#define MBEDTLS_BYTE_1(x) ((uint8_t) (((x) >> 8) & 0xff)) -#define MBEDTLS_BYTE_2(x) ((uint8_t) (((x) >> 16) & 0xff)) -#define MBEDTLS_BYTE_3(x) ((uint8_t) (((x) >> 24) & 0xff)) -#define MBEDTLS_BYTE_4(x) ((uint8_t) (((x) >> 32) & 0xff)) -#define MBEDTLS_BYTE_5(x) ((uint8_t) (((x) >> 40) & 0xff)) -#define MBEDTLS_BYTE_6(x) ((uint8_t) (((x) >> 48) & 0xff)) -#define MBEDTLS_BYTE_7(x) ((uint8_t) (((x) >> 56) & 0xff)) - -/* - * Detect GCC built-in byteswap routines - */ -#if defined(__GNUC__) && defined(__GNUC_PREREQ) -#if __GNUC_PREREQ(4, 8) -#define MBEDTLS_BSWAP16 __builtin_bswap16 -#endif /* __GNUC_PREREQ(4,8) */ -#if __GNUC_PREREQ(4, 3) -#define MBEDTLS_BSWAP32 __builtin_bswap32 -#define MBEDTLS_BSWAP64 __builtin_bswap64 -#endif /* __GNUC_PREREQ(4,3) */ -#endif /* defined(__GNUC__) && defined(__GNUC_PREREQ) */ - -/* - * Detect Clang built-in byteswap routines - */ -#if defined(__clang__) && defined(__has_builtin) -#if __has_builtin(__builtin_bswap16) && !defined(MBEDTLS_BSWAP16) -#define MBEDTLS_BSWAP16 __builtin_bswap16 -#endif /* __has_builtin(__builtin_bswap16) */ -#if __has_builtin(__builtin_bswap32) && !defined(MBEDTLS_BSWAP32) -#define MBEDTLS_BSWAP32 __builtin_bswap32 -#endif /* __has_builtin(__builtin_bswap32) */ -#if __has_builtin(__builtin_bswap64) && !defined(MBEDTLS_BSWAP64) -#define MBEDTLS_BSWAP64 __builtin_bswap64 -#endif /* __has_builtin(__builtin_bswap64) */ -#endif /* defined(__clang__) && defined(__has_builtin) */ - -/* - * Detect MSVC built-in byteswap routines - */ -#if defined(_MSC_VER) -#if !defined(MBEDTLS_BSWAP16) -#define MBEDTLS_BSWAP16 _byteswap_ushort -#endif -#if !defined(MBEDTLS_BSWAP32) -#define MBEDTLS_BSWAP32 _byteswap_ulong -#endif -#if !defined(MBEDTLS_BSWAP64) -#define MBEDTLS_BSWAP64 _byteswap_uint64 -#endif -#endif /* defined(_MSC_VER) */ - -/* Detect armcc built-in byteswap routine */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 410000) && !defined(MBEDTLS_BSWAP32) -#if defined(__ARM_ACLE) /* ARM Compiler 6 - earlier versions don't need a header */ -#include -#endif -#define MBEDTLS_BSWAP32 __rev -#endif - -/* - * Where compiler built-ins are not present, fall back to C code that the - * compiler may be able to detect and transform into the relevant bswap or - * similar instruction. - */ -#if !defined(MBEDTLS_BSWAP16) -static inline uint16_t mbedtls_bswap16(uint16_t x) -{ - return - (x & 0x00ff) << 8 | - (x & 0xff00) >> 8; -} -#define MBEDTLS_BSWAP16 mbedtls_bswap16 -#endif /* !defined(MBEDTLS_BSWAP16) */ - -#if !defined(MBEDTLS_BSWAP32) -static inline uint32_t mbedtls_bswap32(uint32_t x) -{ - return - (x & 0x000000ff) << 24 | - (x & 0x0000ff00) << 8 | - (x & 0x00ff0000) >> 8 | - (x & 0xff000000) >> 24; -} -#define MBEDTLS_BSWAP32 mbedtls_bswap32 -#endif /* !defined(MBEDTLS_BSWAP32) */ - -#if !defined(MBEDTLS_BSWAP64) -static inline uint64_t mbedtls_bswap64(uint64_t x) -{ - return - (x & 0x00000000000000ffULL) << 56 | - (x & 0x000000000000ff00ULL) << 40 | - (x & 0x0000000000ff0000ULL) << 24 | - (x & 0x00000000ff000000ULL) << 8 | - (x & 0x000000ff00000000ULL) >> 8 | - (x & 0x0000ff0000000000ULL) >> 24 | - (x & 0x00ff000000000000ULL) >> 40 | - (x & 0xff00000000000000ULL) >> 56; -} -#define MBEDTLS_BSWAP64 mbedtls_bswap64 -#endif /* !defined(MBEDTLS_BSWAP64) */ - -#if !defined(__BYTE_ORDER__) -static const uint16_t mbedtls_byte_order_detector = { 0x100 }; -#define MBEDTLS_IS_BIG_ENDIAN (*((unsigned char *) (&mbedtls_byte_order_detector)) == 0x01) -#else -#define MBEDTLS_IS_BIG_ENDIAN ((__BYTE_ORDER__) == (__ORDER_BIG_ENDIAN__)) -#endif /* !defined(__BYTE_ORDER__) */ - -/** - * Get the unsigned 32 bits integer corresponding to four bytes in - * big-endian order (MSB first). - * - * \param data Base address of the memory to get the four bytes from. - * \param offset Offset from \p data of the first and most significant - * byte of the four bytes to build the 32 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT32_BE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? mbedtls_get_unaligned_uint32((data) + (offset)) \ - : MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \ - ) - -/** - * Put in memory a 32 bits unsigned integer in big-endian order. - * - * \param n 32 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 32 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the most significant - * byte of the 32 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT32_BE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint32((data) + (offset), (uint32_t) (n)); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \ - } \ - } - -/** - * Get the unsigned 32 bits integer corresponding to four bytes in - * little-endian order (LSB first). - * - * \param data Base address of the memory to get the four bytes from. - * \param offset Offset from \p data of the first and least significant - * byte of the four bytes to build the 32 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT32_LE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? MBEDTLS_BSWAP32(mbedtls_get_unaligned_uint32((data) + (offset))) \ - : mbedtls_get_unaligned_uint32((data) + (offset)) \ - ) - - -/** - * Put in memory a 32 bits unsigned integer in little-endian order. - * - * \param n 32 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 32 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the least significant - * byte of the 32 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT32_LE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint32((data) + (offset), MBEDTLS_BSWAP32((uint32_t) (n))); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint32((data) + (offset), ((uint32_t) (n))); \ - } \ - } - -/** - * Get the unsigned 16 bits integer corresponding to two bytes in - * little-endian order (LSB first). - * - * \param data Base address of the memory to get the two bytes from. - * \param offset Offset from \p data of the first and least significant - * byte of the two bytes to build the 16 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT16_LE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? MBEDTLS_BSWAP16(mbedtls_get_unaligned_uint16((data) + (offset))) \ - : mbedtls_get_unaligned_uint16((data) + (offset)) \ - ) - -/** - * Put in memory a 16 bits unsigned integer in little-endian order. - * - * \param n 16 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 16 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the least significant - * byte of the 16 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT16_LE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint16((data) + (offset), MBEDTLS_BSWAP16((uint16_t) (n))); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint16((data) + (offset), (uint16_t) (n)); \ - } \ - } - -/** - * Get the unsigned 16 bits integer corresponding to two bytes in - * big-endian order (MSB first). - * - * \param data Base address of the memory to get the two bytes from. - * \param offset Offset from \p data of the first and most significant - * byte of the two bytes to build the 16 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT16_BE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? mbedtls_get_unaligned_uint16((data) + (offset)) \ - : MBEDTLS_BSWAP16(mbedtls_get_unaligned_uint16((data) + (offset))) \ - ) - -/** - * Put in memory a 16 bits unsigned integer in big-endian order. - * - * \param n 16 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 16 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the most significant - * byte of the 16 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT16_BE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint16((data) + (offset), (uint16_t) (n)); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint16((data) + (offset), MBEDTLS_BSWAP16((uint16_t) (n))); \ - } \ - } - -/** - * Get the unsigned 24 bits integer corresponding to three bytes in - * big-endian order (MSB first). - * - * \param data Base address of the memory to get the three bytes from. - * \param offset Offset from \p data of the first and most significant - * byte of the three bytes to build the 24 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT24_BE(data, offset) \ - ( \ - ((uint32_t) (data)[(offset)] << 16) \ - | ((uint32_t) (data)[(offset) + 1] << 8) \ - | ((uint32_t) (data)[(offset) + 2]) \ - ) - -/** - * Put in memory a 24 bits unsigned integer in big-endian order. - * - * \param n 24 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 24 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the most significant - * byte of the 24 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT24_BE(n, data, offset) \ - { \ - (data)[(offset)] = MBEDTLS_BYTE_2(n); \ - (data)[(offset) + 1] = MBEDTLS_BYTE_1(n); \ - (data)[(offset) + 2] = MBEDTLS_BYTE_0(n); \ - } - -/** - * Get the unsigned 24 bits integer corresponding to three bytes in - * little-endian order (LSB first). - * - * \param data Base address of the memory to get the three bytes from. - * \param offset Offset from \p data of the first and least significant - * byte of the three bytes to build the 24 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT24_LE(data, offset) \ - ( \ - ((uint32_t) (data)[(offset)]) \ - | ((uint32_t) (data)[(offset) + 1] << 8) \ - | ((uint32_t) (data)[(offset) + 2] << 16) \ - ) - -/** - * Put in memory a 24 bits unsigned integer in little-endian order. - * - * \param n 24 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 24 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the least significant - * byte of the 24 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT24_LE(n, data, offset) \ - { \ - (data)[(offset)] = MBEDTLS_BYTE_0(n); \ - (data)[(offset) + 1] = MBEDTLS_BYTE_1(n); \ - (data)[(offset) + 2] = MBEDTLS_BYTE_2(n); \ - } - -/** - * Get the unsigned 64 bits integer corresponding to eight bytes in - * big-endian order (MSB first). - * - * \param data Base address of the memory to get the eight bytes from. - * \param offset Offset from \p data of the first and most significant - * byte of the eight bytes to build the 64 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT64_BE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? mbedtls_get_unaligned_uint64((data) + (offset)) \ - : MBEDTLS_BSWAP64(mbedtls_get_unaligned_uint64((data) + (offset))) \ - ) - -/** - * Put in memory a 64 bits unsigned integer in big-endian order. - * - * \param n 64 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 64 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the most significant - * byte of the 64 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT64_BE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint64((data) + (offset), (uint64_t) (n)); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint64((data) + (offset), MBEDTLS_BSWAP64((uint64_t) (n))); \ - } \ - } - -/** - * Get the unsigned 64 bits integer corresponding to eight bytes in - * little-endian order (LSB first). - * - * \param data Base address of the memory to get the eight bytes from. - * \param offset Offset from \p data of the first and least significant - * byte of the eight bytes to build the 64 bits unsigned - * integer from. - */ -#define MBEDTLS_GET_UINT64_LE(data, offset) \ - ((MBEDTLS_IS_BIG_ENDIAN) \ - ? MBEDTLS_BSWAP64(mbedtls_get_unaligned_uint64((data) + (offset))) \ - : mbedtls_get_unaligned_uint64((data) + (offset)) \ - ) - -/** - * Put in memory a 64 bits unsigned integer in little-endian order. - * - * \param n 64 bits unsigned integer to put in memory. - * \param data Base address of the memory where to put the 64 - * bits unsigned integer in. - * \param offset Offset from \p data where to put the least significant - * byte of the 64 bits unsigned integer \p n. - */ -#define MBEDTLS_PUT_UINT64_LE(n, data, offset) \ - { \ - if (MBEDTLS_IS_BIG_ENDIAN) \ - { \ - mbedtls_put_unaligned_uint64((data) + (offset), MBEDTLS_BSWAP64((uint64_t) (n))); \ - } \ - else \ - { \ - mbedtls_put_unaligned_uint64((data) + (offset), (uint64_t) (n)); \ - } \ - } - -#endif /* MBEDTLS_LIBRARY_ALIGNMENT_H */ diff --git a/ext/oberon/psa/core/library/bignum_mod.h b/ext/oberon/psa/core/library/bignum_mod.h deleted file mode 100644 index 39e8fd218bea..000000000000 --- a/ext/oberon/psa/core/library/bignum_mod.h +++ /dev/null @@ -1,464 +0,0 @@ -/** - * Modular bignum functions - * - * This module implements operations on integers modulo some fixed modulus. - * - * The functions in this module obey the following conventions unless - * explicitly indicated otherwise: - * - * - **Modulus parameters**: the modulus is passed as a pointer to a structure - * of type #mbedtls_mpi_mod_modulus. The structure must be set up with an - * array of limbs storing the bignum value of the modulus. The modulus must - * be odd and is assumed to have no leading zeroes. The modulus is usually - * named \c N and is usually input-only. Functions which take a parameter - * of type \c const #mbedtls_mpi_mod_modulus* must not modify its value. - * - **Bignum parameters**: Bignums are passed as pointers to an array of - * limbs or to a #mbedtls_mpi_mod_residue structure. A limb has the type - * #mbedtls_mpi_uint. Residues must be initialized before use, and must be - * associated with the modulus \c N. Unless otherwise specified: - * - Bignum parameters called \c A, \c B, ... are inputs and are not - * modified by the function. Functions which take a parameter of - * type \c const #mbedtls_mpi_mod_residue* must not modify its value. - * - Bignum parameters called \c X, \c Y, ... are outputs or input-output. - * The initial bignum value of output-only parameters is ignored, but - * they must be set up and associated with the modulus \c N. Some - * functions (typically constant-flow) require that the limbs in an - * output residue are initialized. - * - Bignum parameters called \c p are inputs used to set up a modulus or - * residue. These must be pointers to an array of limbs. - * - \c T is a temporary storage area. The initial content of such a - * parameter is ignored and the final content is unspecified. - * - Some functions use different names, such as \c r for the residue. - * - **Bignum sizes**: bignum sizes are always expressed in limbs. Both - * #mbedtls_mpi_mod_modulus and #mbedtls_mpi_mod_residue have a \c limbs - * member storing its size. All bignum parameters must have the same - * number of limbs as the modulus. All bignum sizes must be at least 1 and - * must be significantly less than #SIZE_MAX. The behavior if a size is 0 is - * undefined. - * - **Bignum representation**: the representation of inputs and outputs is - * specified by the \c int_rep field of the modulus. - * - **Parameter ordering**: for bignum parameters, outputs come before inputs. - * The modulus is passed after residues. Temporaries come last. - * - **Aliasing**: in general, output bignums may be aliased to one or more - * inputs. Modulus values may not be aliased to any other parameter. Outputs - * may not be aliased to one another. Temporaries may not be aliased to any - * other parameter. - * - **Overlap**: apart from aliasing of residue pointers (where two residue - * arguments are equal pointers), overlap is not supported and may result - * in undefined behavior. - * - **Error handling**: functions generally check compatibility of input - * sizes. Most functions will not check that input values are in canonical - * form (i.e. that \c A < \c N), this is only checked during setup of a - * residue structure. - * - **Modular representatives**: all functions expect inputs to be in the - * range [0, \c N - 1] and guarantee outputs in the range [0, \c N - 1]. - * Residues are set up with an associated modulus, and operations are only - * guaranteed to work if the modulus is associated with all residue - * parameters. If a residue is passed with a modulus other than the one it - * is associated with, then it may be out of range. If an input is out of - * range, outputs are fully unspecified, though bignum values out of range - * should not cause buffer overflows (beware that this is not extensively - * tested). - */ - -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_BIGNUM_MOD_H -#define MBEDTLS_BIGNUM_MOD_H - -#include "common.h" - -#if defined(MBEDTLS_BIGNUM_C) -#include "mbedtls/bignum.h" -#endif - -/** How residues associated with a modulus are represented. - * - * This also determines which fields of the modulus structure are valid and - * what their contents are (see #mbedtls_mpi_mod_modulus). - */ -typedef enum { - /** Representation not chosen (makes the modulus structure invalid). */ - MBEDTLS_MPI_MOD_REP_INVALID = 0, - /* Skip 1 as it is slightly easier to accidentally pass to functions. */ - /** Montgomery representation. */ - MBEDTLS_MPI_MOD_REP_MONTGOMERY = 2, - /* Optimised reduction available. This indicates a coordinate modulus (P) - * and one or more of the following have been configured: - * - A nist curve (MBEDTLS_ECP_DP_SECPXXXR1_ENABLED) & MBEDTLS_ECP_NIST_OPTIM. - * - A Kobliz Curve. - * - A Fast Reduction Curve CURVE25519 or CURVE448. */ - MBEDTLS_MPI_MOD_REP_OPT_RED, -} mbedtls_mpi_mod_rep_selector; - -/* Make mbedtls_mpi_mod_rep_selector and mbedtls_mpi_mod_ext_rep disjoint to - * make it easier to catch when they are accidentally swapped. */ -typedef enum { - MBEDTLS_MPI_MOD_EXT_REP_INVALID = 0, - MBEDTLS_MPI_MOD_EXT_REP_LE = 8, - MBEDTLS_MPI_MOD_EXT_REP_BE -} mbedtls_mpi_mod_ext_rep; - -typedef struct { - mbedtls_mpi_uint *p; - size_t limbs; -} mbedtls_mpi_mod_residue; - -typedef struct { - mbedtls_mpi_uint const *rr; /* The residue for 2^{2*n*biL} mod N */ - mbedtls_mpi_uint mm; /* Montgomery const for -N^{-1} mod 2^{ciL} */ -} mbedtls_mpi_mont_struct; - -typedef int (*mbedtls_mpi_modp_fn)(mbedtls_mpi_uint *X, size_t X_limbs); - -typedef struct { - mbedtls_mpi_modp_fn modp; /* The optimised reduction function pointer */ -} mbedtls_mpi_opt_red_struct; - -typedef struct { - const mbedtls_mpi_uint *p; - size_t limbs; // number of limbs - size_t bits; // bitlen of p - mbedtls_mpi_mod_rep_selector int_rep; // selector to signal the active member of the union - union rep { - /* if int_rep == #MBEDTLS_MPI_MOD_REP_MONTGOMERY */ - mbedtls_mpi_mont_struct mont; - /* if int_rep == #MBEDTLS_MPI_MOD_REP_OPT_RED */ - mbedtls_mpi_opt_red_struct ored; - } rep; -} mbedtls_mpi_mod_modulus; - -/** Setup a residue structure. - * - * The residue will be set up with the buffer \p p and modulus \p N. - * - * The memory pointed to by \p p will be used by the resulting residue structure. - * The value at the pointed-to memory will be the initial value of \p r and must - * hold a value that is less than the modulus. This value will be used as-is - * and interpreted according to the value of the `N->int_rep` field. - * - * The modulus \p N will be the modulus associated with \p r. The residue \p r - * should only be used in operations where the modulus is \p N. - * - * \param[out] r The address of the residue to setup. - * \param[in] N The address of the modulus related to \p r. - * \param[in] p The address of the limb array containing the value of \p r. - * The memory pointed to by \p p will be used by \p r and must - * not be modified in any way until after - * mbedtls_mpi_mod_residue_release() is called. The data - * pointed to by \p p must be less than the modulus (the value - * pointed to by `N->p`) and already in the representation - * indicated by `N->int_rep`. - * \param p_limbs The number of limbs of \p p. Must be the same as the number - * of limbs in the modulus \p N. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p p_limbs is less than the - * limbs in \p N or if \p p is not less than \p N. - */ -int mbedtls_mpi_mod_residue_setup(mbedtls_mpi_mod_residue *r, - const mbedtls_mpi_mod_modulus *N, - mbedtls_mpi_uint *p, - size_t p_limbs); - -/** Unbind elements of a residue structure. - * - * This function removes the reference to the limb array that was passed to - * mbedtls_mpi_mod_residue_setup() to make it safe to free or use again. - * - * This function invalidates \p r and it must not be used until after - * mbedtls_mpi_mod_residue_setup() is called on it again. - * - * \param[out] r The address of residue to release. - */ -void mbedtls_mpi_mod_residue_release(mbedtls_mpi_mod_residue *r); - -/** Initialize a modulus structure. - * - * \param[out] N The address of the modulus structure to initialize. - */ -void mbedtls_mpi_mod_modulus_init(mbedtls_mpi_mod_modulus *N); - -/** Setup a modulus structure. - * - * \param[out] N The address of the modulus structure to populate. - * \param[in] p The address of the limb array storing the value of \p N. - * The memory pointed to by \p p will be used by \p N and must - * not be modified in any way until after - * mbedtls_mpi_mod_modulus_free() is called. - * \param p_limbs The number of limbs of \p p. - * - * \return \c 0 if successful. - */ -int mbedtls_mpi_mod_modulus_setup(mbedtls_mpi_mod_modulus *N, - const mbedtls_mpi_uint *p, - size_t p_limbs); - -/** Setup an optimised-reduction compatible modulus structure. - * - * \param[out] N The address of the modulus structure to populate. - * \param[in] p The address of the limb array storing the value of \p N. - * The memory pointed to by \p p will be used by \p N and must - * not be modified in any way until after - * mbedtls_mpi_mod_modulus_free() is called. - * \param p_limbs The number of limbs of \p p. - * \param modp A pointer to the optimised reduction function to use. \p p. - * - * \return \c 0 if successful. - */ -int mbedtls_mpi_mod_optred_modulus_setup(mbedtls_mpi_mod_modulus *N, - const mbedtls_mpi_uint *p, - size_t p_limbs, - mbedtls_mpi_modp_fn modp); - -/** Free elements of a modulus structure. - * - * This function frees any memory allocated by mbedtls_mpi_mod_modulus_setup(). - * - * \warning This function does not free the limb array passed to - * mbedtls_mpi_mod_modulus_setup() only removes the reference to it, - * making it safe to free or to use it again. - * - * \param[in,out] N The address of the modulus structure to free. - */ -void mbedtls_mpi_mod_modulus_free(mbedtls_mpi_mod_modulus *N); - -/** \brief Multiply two residues, returning the residue modulo the specified - * modulus. - * - * \note Currently handles the case when `N->int_rep` is - * MBEDTLS_MPI_MOD_REP_MONTGOMERY. - * - * The size of the operation is determined by \p N. \p A, \p B and \p X must - * all be associated with the modulus \p N and must all have the same number - * of limbs as \p N. - * - * \p X may be aliased to \p A or \p B, or even both, but may not overlap - * either otherwise. They may not alias \p N (since they must be in canonical - * form, they cannot == \p N). - * - * \param[out] X The address of the result MPI. Must have the same - * number of limbs as \p N. - * On successful completion, \p X contains the result of - * the multiplication `A * B * R^-1` mod N where - * `R = 2^(biL * N->limbs)`. - * \param[in] A The address of the first MPI. - * \param[in] B The address of the second MPI. - * \param[in] N The address of the modulus. Used to perform a modulo - * operation on the result of the multiplication. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if all the parameters do not - * have the same number of limbs or \p N is invalid. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_mpi_mod_mul(mbedtls_mpi_mod_residue *X, - const mbedtls_mpi_mod_residue *A, - const mbedtls_mpi_mod_residue *B, - const mbedtls_mpi_mod_modulus *N); - -/** - * \brief Perform a fixed-size modular subtraction. - * - * Calculate `A - B modulo N`. - * - * \p A, \p B and \p X must all have the same number of limbs as \p N. - * - * \p X may be aliased to \p A or \p B, or even both, but may not overlap - * either otherwise. - * - * \note This function does not check that \p A or \p B are in canonical - * form (that is, are < \p N) - that will have been done by - * mbedtls_mpi_mod_residue_setup(). - * - * \param[out] X The address of the result MPI. Must be initialized. - * Must have the same number of limbs as the modulus \p N. - * \param[in] A The address of the first MPI. - * \param[in] B The address of the second MPI. - * \param[in] N The address of the modulus. Used to perform a modulo - * operation on the result of the subtraction. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the given MPIs do not - * have the correct number of limbs. - */ -int mbedtls_mpi_mod_sub(mbedtls_mpi_mod_residue *X, - const mbedtls_mpi_mod_residue *A, - const mbedtls_mpi_mod_residue *B, - const mbedtls_mpi_mod_modulus *N); - -/** - * \brief Perform modular inversion of an MPI with respect to a modulus \p N. - * - * \p A and \p X must be associated with the modulus \p N and will therefore - * have the same number of limbs as \p N. - * - * \p X may be aliased to \p A. - * - * \warning Currently only supports prime moduli, but does not check for them. - * - * \param[out] X The modular inverse of \p A with respect to \p N. - * \param[in] A The number to calculate the modular inverse of. - * Must not be 0. - * \param[in] N The modulus to use. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p A and \p N do not - * have the same number of limbs. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p A is zero. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if couldn't allocate enough - * memory (needed for conversion to and from Mongtomery form - * when not in Montgomery form already, and for temporary use - * by the inversion calculation itself). - */ - -int mbedtls_mpi_mod_inv(mbedtls_mpi_mod_residue *X, - const mbedtls_mpi_mod_residue *A, - const mbedtls_mpi_mod_modulus *N); -/** - * \brief Perform a fixed-size modular addition. - * - * Calculate `A + B modulo N`. - * - * \p A, \p B and \p X must all be associated with the modulus \p N and must - * all have the same number of limbs as \p N. - * - * \p X may be aliased to \p A or \p B, or even both, but may not overlap - * either otherwise. - * - * \note This function does not check that \p A or \p B are in canonical - * form (that is, are < \p N) - that will have been done by - * mbedtls_mpi_mod_residue_setup(). - * - * \param[out] X The address of the result residue. Must be initialized. - * Must have the same number of limbs as the modulus \p N. - * \param[in] A The address of the first input residue. - * \param[in] B The address of the second input residue. - * \param[in] N The address of the modulus. Used to perform a modulo - * operation on the result of the addition. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the given MPIs do not - * have the correct number of limbs. - */ -int mbedtls_mpi_mod_add(mbedtls_mpi_mod_residue *X, - const mbedtls_mpi_mod_residue *A, - const mbedtls_mpi_mod_residue *B, - const mbedtls_mpi_mod_modulus *N); - -/** Generate a random number uniformly in a range. - * - * This function generates a random number between \p min inclusive and - * \p N exclusive. - * - * The procedure complies with RFC 6979 §3.3 (deterministic ECDSA) - * when the RNG is a suitably parametrized instance of HMAC_DRBG - * and \p min is \c 1. - * - * \note There are `N - min` possible outputs. The lower bound - * \p min can be reached, but the upper bound \p N cannot. - * - * \param X The destination residue. - * \param min The minimum value to return. It must be strictly smaller - * than \b N. - * \param N The modulus. - * This is the upper bound of the output range, exclusive. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if the implementation was - * unable to find a suitable value within a limited number - * of attempts. This has a negligible probability if \p N - * is significantly larger than \p min, which is the case - * for all usual cryptographic applications. - */ -int mbedtls_mpi_mod_random(mbedtls_mpi_mod_residue *X, - mbedtls_mpi_uint min, - const mbedtls_mpi_mod_modulus *N, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng); - -/** Read a residue from a byte buffer. - * - * The residue will be automatically converted to the internal representation - * based on the value of the `N->int_rep` field. - * - * The modulus \p N will be the modulus associated with \p r. The residue \p r - * should only be used in operations where the modulus is \p N or a modulus - * equivalent to \p N (in the sense that all their fields or memory pointed by - * their fields hold the same value). - * - * \param[out] r The address of the residue. It must have exactly the same - * number of limbs as the modulus \p N. - * \param[in] N The address of the modulus. - * \param[in] buf The input buffer to import from. - * \param buflen The length in bytes of \p buf. - * \param ext_rep The endianness of the number in the input buffer. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p r isn't - * large enough to hold the value in \p buf. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p ext_rep - * is invalid or the value in the buffer is not less than \p N. - */ -int mbedtls_mpi_mod_read(mbedtls_mpi_mod_residue *r, - const mbedtls_mpi_mod_modulus *N, - const unsigned char *buf, - size_t buflen, - mbedtls_mpi_mod_ext_rep ext_rep); - -/** Write a residue into a byte buffer. - * - * The modulus \p N must be the modulus associated with \p r (see - * mbedtls_mpi_mod_residue_setup() and mbedtls_mpi_mod_read()). - * - * The residue will be automatically converted from the internal representation - * based on the value of `N->int_rep` field. - * - * \warning If the buffer is smaller than `N->bits`, the number of - * leading zeroes is leaked through timing. If \p r is - * secret, the caller must ensure that \p buflen is at least - * (`N->bits`+7)/8. - * - * \param[in] r The address of the residue. It must have the same number of - * limbs as the modulus \p N. (\p r is an input parameter, but - * its value will be modified during execution and restored - * before the function returns.) - * \param[in] N The address of the modulus associated with \p r. - * \param[out] buf The output buffer to export to. - * \param buflen The length in bytes of \p buf. - * \param ext_rep The endianness in which the number should be written into - * the output buffer. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn't - * large enough to hold the value of \p r (without leading - * zeroes). - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p ext_rep is invalid. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if couldn't allocate enough - * memory for conversion. Can occur only for moduli with - * MBEDTLS_MPI_MOD_REP_MONTGOMERY. - */ -int mbedtls_mpi_mod_write(const mbedtls_mpi_mod_residue *r, - const mbedtls_mpi_mod_modulus *N, - unsigned char *buf, - size_t buflen, - mbedtls_mpi_mod_ext_rep ext_rep); - -#endif /* MBEDTLS_BIGNUM_MOD_H */ diff --git a/ext/oberon/psa/core/library/check_crypto_config.h b/ext/oberon/psa/core/library/check_crypto_config.h deleted file mode 100644 index bec3df07fc02..000000000000 --- a/ext/oberon/psa/core/library/check_crypto_config.h +++ /dev/null @@ -1,217 +0,0 @@ -/** - * \file check_crypto_config.h - * - * \brief Consistency checks for PSA configuration options - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * It is recommended to include this file from your crypto_config.h - * in order to catch dependency issues early. - */ - -#ifndef MBEDTLS_CHECK_CRYPTO_CONFIG_H -#define MBEDTLS_CHECK_CRYPTO_CONFIG_H - -#if defined(PSA_WANT_ALG_CBC_NO_PADDING) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CBC_NO_PADDING defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CBC_PKCS7) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CBC_PKCS7 defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CCM) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CCM defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CCM_STAR_NO_TAG) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CCM_STAR_NO_TAG defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CMAC) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CMAC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CTR) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_CTR defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_ECB_NO_PADDING) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_ECB_NO_PADDING defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_GCM) && \ - !(defined(PSA_WANT_KEY_TYPE_AES)) -#error "PSA_WANT_ALG_GCM defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_STREAM_CIPHER) && \ - !(defined(PSA_WANT_KEY_TYPE_CHACHA20)) -#error "PSA_WANT_ALG_STREAM_CIPHER defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA) && \ - !((defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)) && \ - defined(PSA_WANT_ALG_HMAC)) -#error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_ECDSA) && \ - !(defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)) -#error "PSA_WANT_ALG_ECDSA defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_PURE_EDDSA) && \ - !(defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)) && \ - !(defined(PSA_WANT_ECC_TWISTED_EDWARDS_255) || \ - defined(PSA_WANT_ECC_TWISTED_EDWARDS_448)) -#error "PSA_WANT_ALG_ECDSA defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_ECDH) && \ - !(defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)) -#error "PSA_WANT_ALG_ECDH defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_RSA_PKCS1V15_CRYPT) && \ - !(defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)) -#error "PSA_WANT_ALG_RSA_PKCS1V15_CRYPT defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) && \ - !(defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)) -#error "PSA_WANT_ALG_RSA_PKCS1V15_SIGN defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_RSA_OAEP) && \ - !(defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)) -#error "PSA_WANT_ALG_RSA_OAEP defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_RSA_PSS) && \ - !(defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) || \ - defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)) -#error "PSA_WANT_ALG_RSA_PSS defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) && \ - !defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) -#error "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_CMAC) && \ - !defined(PSA_WANT_ALG_ECB_NO_PADDING) -#error "PSA_WANT_ALG_CMAC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_HKDF) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_HKDF defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_HKDF_EXTRACT) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_HKDF_EXTRACT defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_HKDF_EXPAND) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_HKDF_EXPAND defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_TLS12_PRF) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_TLS12_PRF defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_TLS12_PSK_TO_MS) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_TLS12_PSK_TO_MS defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_PBKDF2_HMAC) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_PBKDF2_HMAC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) && \ - !(defined(PSA_WANT_ALG_CMAC) && \ - defined(PSA_WANT_AES_KEY_SIZE_128)) -#error "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_SP800_108_COUNTER_HMAC) && \ - !defined(PSA_WANT_ALG_HMAC) -#error "PSA_WANT_ALG_SP800_108_COUNTER_HMAC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_ALG_SP800_108_COUNTER_CMAC) && \ - !defined(PSA_WANT_ALG_CMAC) -#error "PSA_WANT_ALG_SP800_108_COUNTER_CMAC defined, but not all prerequisites" -#endif - -#if defined(PSA_WANT_KEY_TYPE_AES) && \ - !(defined(PSA_WANT_AES_KEY_SIZE_128) || \ - defined(PSA_WANT_AES_KEY_SIZE_192) || \ - defined(PSA_WANT_AES_KEY_SIZE_256)) -#error "PSA_WANT_KEY_TYPE_AES defined, but no AES key size" -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) && \ - !(defined(PSA_WANT_RSA_KEY_SIZE_1024) || \ - defined(PSA_WANT_RSA_KEY_SIZE_1536) || \ - defined(PSA_WANT_RSA_KEY_SIZE_2048) || \ - defined(PSA_WANT_RSA_KEY_SIZE_3072) || \ - defined(PSA_WANT_RSA_KEY_SIZE_4096) || \ - defined(PSA_WANT_RSA_KEY_SIZE_6144) || \ - defined(PSA_WANT_RSA_KEY_SIZE_8192)) -#error "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC defined, but no RSA key size" -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) && \ - !(defined(PSA_WANT_RSA_KEY_SIZE_1024) || \ - defined(PSA_WANT_RSA_KEY_SIZE_1536) || \ - defined(PSA_WANT_RSA_KEY_SIZE_2048) || \ - defined(PSA_WANT_RSA_KEY_SIZE_3072) || \ - defined(PSA_WANT_RSA_KEY_SIZE_4096) || \ - defined(PSA_WANT_RSA_KEY_SIZE_6144) || \ - defined(PSA_WANT_RSA_KEY_SIZE_8192)) -#error "PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY defined, but no RSA key size" -#endif - -#if defined(PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS) && \ - !defined(PSA_WANT_ALG_SHA_256) -#error "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS defined, but not all prerequisites" -#endif - -#endif /* MBEDTLS_CHECK_CRYPTO_CONFIG_H */ diff --git a/ext/oberon/psa/core/library/common.h b/ext/oberon/psa/core/library/common.h deleted file mode 100644 index 3c472c685daf..000000000000 --- a/ext/oberon/psa/core/library/common.h +++ /dev/null @@ -1,337 +0,0 @@ -/** - * \file common.h - * - * \brief Utility macros for internal use in the library - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_LIBRARY_COMMON_H -#define MBEDTLS_LIBRARY_COMMON_H - -#include "mbedtls/build_info.h" -#include "alignment.h" - -#include -#include -#include -#include - -#if defined(__ARM_NEON) -#include -#endif /* __ARM_NEON */ - -/** Helper to define a function as static except when building invasive tests. - * - * If a function is only used inside its own source file and should be - * declared `static` to allow the compiler to optimize for code size, - * but that function has unit tests, define it with - * ``` - * MBEDTLS_STATIC_TESTABLE int mbedtls_foo(...) { ... } - * ``` - * and declare it in a header in the `library/` directory with - * ``` - * #if defined(MBEDTLS_TEST_HOOKS) - * int mbedtls_foo(...); - * #endif - * ``` - */ -#if defined(MBEDTLS_TEST_HOOKS) -#define MBEDTLS_STATIC_TESTABLE -#else -#define MBEDTLS_STATIC_TESTABLE static -#endif - -#if defined(MBEDTLS_TEST_HOOKS) -extern void (*mbedtls_test_hook_test_fail)(const char *test, int line, const char *file); -#define MBEDTLS_TEST_HOOK_TEST_ASSERT(TEST) \ - do { \ - if ((!(TEST)) && ((*mbedtls_test_hook_test_fail) != NULL)) \ - { \ - (*mbedtls_test_hook_test_fail)( #TEST, __LINE__, __FILE__); \ - } \ - } while (0) -#else -#define MBEDTLS_TEST_HOOK_TEST_ASSERT(TEST) -#endif /* defined(MBEDTLS_TEST_HOOKS) */ - -/** \def ARRAY_LENGTH - * Return the number of elements of a static or stack array. - * - * \param array A value of array (not pointer) type. - * - * \return The number of elements of the array. - */ -/* A correct implementation of ARRAY_LENGTH, but which silently gives - * a nonsensical result if called with a pointer rather than an array. */ -#define ARRAY_LENGTH_UNSAFE(array) \ - (sizeof(array) / sizeof(*(array))) - -#if defined(__GNUC__) -/* Test if arg and &(arg)[0] have the same type. This is true if arg is - * an array but not if it's a pointer. */ -#define IS_ARRAY_NOT_POINTER(arg) \ - (!__builtin_types_compatible_p(__typeof__(arg), \ - __typeof__(&(arg)[0]))) -/* A compile-time constant with the value 0. If `const_expr` is not a - * compile-time constant with a nonzero value, cause a compile-time error. */ -#define STATIC_ASSERT_EXPR(const_expr) \ - (0 && sizeof(struct { unsigned int STATIC_ASSERT : 1 - 2 * !(const_expr); })) - -/* Return the scalar value `value` (possibly promoted). This is a compile-time - * constant if `value` is. `condition` must be a compile-time constant. - * If `condition` is false, arrange to cause a compile-time error. */ -#define STATIC_ASSERT_THEN_RETURN(condition, value) \ - (STATIC_ASSERT_EXPR(condition) ? 0 : (value)) - -#define ARRAY_LENGTH(array) \ - (STATIC_ASSERT_THEN_RETURN(IS_ARRAY_NOT_POINTER(array), \ - ARRAY_LENGTH_UNSAFE(array))) - -#else -/* If we aren't sure the compiler supports our non-standard tricks, - * fall back to the unsafe implementation. */ -#define ARRAY_LENGTH(array) ARRAY_LENGTH_UNSAFE(array) -#endif -/** Allow library to access its structs' private members. - * - * Although structs defined in header files are publicly available, - * their members are private and should not be accessed by the user. - */ -#define MBEDTLS_ALLOW_PRIVATE_ACCESS - -/** - * \brief Securely zeroize a buffer then free it. - * - * Similar to making consecutive calls to - * \c mbedtls_platform_zeroize() and \c mbedtls_free(), but has - * code size savings, and potential for optimisation in the future. - * - * Guaranteed to be a no-op if \p buf is \c NULL and \p len is 0. - * - * \param buf Buffer to be zeroized then freed. - * \param len Length of the buffer in bytes - */ -void mbedtls_zeroize_and_free(void *buf, size_t len); - -/** Return an offset into a buffer. - * - * This is just the addition of an offset to a pointer, except that this - * function also accepts an offset of 0 into a buffer whose pointer is null. - * (`p + n` has undefined behavior when `p` is null, even when `n == 0`. - * A null pointer is a valid buffer pointer when the size is 0, for example - * as the result of `malloc(0)` on some platforms.) - * - * \param p Pointer to a buffer of at least n bytes. - * This may be \p NULL if \p n is zero. - * \param n An offset in bytes. - * \return Pointer to offset \p n in the buffer \p p. - * Note that this is only a valid pointer if the size of the - * buffer is at least \p n + 1. - */ -static inline unsigned char *mbedtls_buffer_offset( - unsigned char *p, size_t n) -{ - return p == NULL ? NULL : p + n; -} - -/** Return an offset into a read-only buffer. - * - * Similar to mbedtls_buffer_offset(), but for const pointers. - * - * \param p Pointer to a buffer of at least n bytes. - * This may be \p NULL if \p n is zero. - * \param n An offset in bytes. - * \return Pointer to offset \p n in the buffer \p p. - * Note that this is only a valid pointer if the size of the - * buffer is at least \p n + 1. - */ -static inline const unsigned char *mbedtls_buffer_offset_const( - const unsigned char *p, size_t n) -{ - return p == NULL ? NULL : p + n; -} - -/** - * Perform a fast block XOR operation, such that - * r[i] = a[i] ^ b[i] where 0 <= i < n - * - * \param r Pointer to result (buffer of at least \p n bytes). \p r - * may be equal to either \p a or \p b, but behaviour when - * it overlaps in other ways is undefined. - * \param a Pointer to input (buffer of at least \p n bytes) - * \param b Pointer to input (buffer of at least \p n bytes) - * \param n Number of bytes to process. - */ -inline void mbedtls_xor(unsigned char *r, const unsigned char *a, const unsigned char *b, size_t n) -{ - size_t i = 0; -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) -#if defined(__ARM_NEON) - for (; (i + 16) <= n; i += 16) { - uint8x16_t v1 = vld1q_u8(a + i); - uint8x16_t v2 = vld1q_u8(b + i); - uint8x16_t x = veorq_u8(v1, v2); - vst1q_u8(r + i, x); - } -#elif defined(__amd64__) || defined(__x86_64__) || defined(__aarch64__) - /* This codepath probably only makes sense on architectures with 64-bit registers */ - for (; (i + 8) <= n; i += 8) { - uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); - mbedtls_put_unaligned_uint64(r + i, x); - } -#else - for (; (i + 4) <= n; i += 4) { - uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i); - mbedtls_put_unaligned_uint32(r + i, x); - } -#endif -#endif - for (; i < n; i++) { - r[i] = a[i] ^ b[i]; - } -} - -/** - * Perform a fast block XOR operation, such that - * r[i] = a[i] ^ b[i] where 0 <= i < n - * - * In some situations, this can perform better than mbedtls_xor (e.g., it's about 5% - * better in AES-CBC). - * - * \param r Pointer to result (buffer of at least \p n bytes). \p r - * may be equal to either \p a or \p b, but behaviour when - * it overlaps in other ways is undefined. - * \param a Pointer to input (buffer of at least \p n bytes) - * \param b Pointer to input (buffer of at least \p n bytes) - * \param n Number of bytes to process. - */ -static inline void mbedtls_xor_no_simd(unsigned char *r, - const unsigned char *a, - const unsigned char *b, - size_t n) -{ - size_t i = 0; -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) -#if defined(__amd64__) || defined(__x86_64__) || defined(__aarch64__) - /* This codepath probably only makes sense on architectures with 64-bit registers */ - for (; (i + 8) <= n; i += 8) { - uint64_t x = mbedtls_get_unaligned_uint64(a + i) ^ mbedtls_get_unaligned_uint64(b + i); - mbedtls_put_unaligned_uint64(r + i, x); - } -#else - for (; (i + 4) <= n; i += 4) { - uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i); - mbedtls_put_unaligned_uint32(r + i, x); - } -#endif -#endif - for (; i < n; i++) { - r[i] = a[i] ^ b[i]; - } -} - -/* Fix MSVC C99 compatible issue - * MSVC support __func__ from visual studio 2015( 1900 ) - * Use MSVC predefine macro to avoid name check fail. - */ -#if (defined(_MSC_VER) && (_MSC_VER <= 1900)) -#define /*no-check-names*/ __func__ __FUNCTION__ -#endif - -/* Define `asm` for compilers which don't define it. */ -/* *INDENT-OFF* */ -#ifndef asm -#if defined(__IAR_SYSTEMS_ICC__) -#define asm __asm -#else -#define asm __asm__ -#endif -#endif -/* *INDENT-ON* */ - -/* - * Define the constraint used for read-only pointer operands to aarch64 asm. - * - * This is normally the usual "r", but for aarch64_32 (aka ILP32, - * as found in watchos), "p" is required to avoid warnings from clang. - * - * Note that clang does not recognise '+p' or '=p', and armclang - * does not recognise 'p' at all. Therefore, to update a pointer from - * aarch64 assembly, it is necessary to use something like: - * - * uintptr_t uptr = (uintptr_t) ptr; - * asm( "ldr x4, [%x0], #8" ... : "+r" (uptr) : : ) - * ptr = (void*) uptr; - * - * Note that the "x" in "%x0" is neccessary; writing "%0" will cause warnings. - */ -#if defined(__aarch64__) && defined(MBEDTLS_HAVE_ASM) -#if UINTPTR_MAX == 0xfffffffful -/* ILP32: Specify the pointer operand slightly differently, as per #7787. */ -#define MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT "p" -#elif UINTPTR_MAX == 0xfffffffffffffffful -/* Normal case (64-bit pointers): use "r" as the constraint for pointer operands to asm */ -#define MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT "r" -#else -#error "Unrecognised pointer size for aarch64" -#endif -#endif - -/* Always provide a static assert macro, so it can be used unconditionally. - * It will expand to nothing on some systems. - * Can be used outside functions (but don't add a trailing ';' in that case: - * the semicolon is included here to avoid triggering -Wextra-semi when - * MBEDTLS_STATIC_ASSERT() expands to nothing). - * Can't use the C11-style `defined(static_assert)` on FreeBSD, since it - * defines static_assert even with -std=c99, but then complains about it. - */ -#if defined(static_assert) && !defined(__FreeBSD__) -#define MBEDTLS_STATIC_ASSERT(expr, msg) static_assert(expr, msg); -#else -#define MBEDTLS_STATIC_ASSERT(expr, msg) -#endif - -/* Define compiler branch hints */ -#if defined(__has_builtin) -#if __has_builtin(__builtin_expect) -#define MBEDTLS_LIKELY(x) __builtin_expect(!!(x), 1) -#define MBEDTLS_UNLIKELY(x) __builtin_expect(!!(x), 0) -#endif -#endif -#if !defined(MBEDTLS_LIKELY) -#define MBEDTLS_LIKELY(x) x -#define MBEDTLS_UNLIKELY(x) x -#endif - -#if defined(__GNUC__) && !defined(__ARMCC_VERSION) && !defined(__clang__) \ - && !defined(__llvm__) && !defined(__INTEL_COMPILER) -/* Defined if the compiler really is gcc and not clang, etc */ -#define MBEDTLS_COMPILER_IS_GCC -#endif - -/* For gcc -Os, override with -O2 for a given function. - * - * This will not affect behaviour for other optimisation settings, e.g. -O0. - */ -#if defined(MBEDTLS_COMPILER_IS_GCC) && defined(__OPTIMIZE_SIZE__) -#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE __attribute__((optimize("-O2"))) -#else -#define MBEDTLS_OPTIMIZE_FOR_PERFORMANCE -#endif - -#endif /* MBEDTLS_LIBRARY_COMMON_H */ diff --git a/ext/oberon/psa/core/library/constant_time.c b/ext/oberon/psa/core/library/constant_time.c deleted file mode 100644 index 8b41aed19a99..000000000000 --- a/ext/oberon/psa/core/library/constant_time.c +++ /dev/null @@ -1,273 +0,0 @@ -/** - * Constant-time functions - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * The following functions are implemented without using comparison operators, as those - * might be translated to branches by some compilers on some platforms. - */ - -#include -#include - -#include "common.h" -#include "constant_time_internal.h" -#include "mbedtls/constant_time.h" -#include "mbedtls/error.h" -#include "mbedtls/platform_util.h" - -#include - -#if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC) -#include "psa/crypto.h" -/* Define a local translating function to save code size by not using too many - * arguments in each translating place. */ -static int local_err_translation(psa_status_t status) -{ - return psa_status_to_mbedtls(status, psa_to_ssl_errors, - ARRAY_LENGTH(psa_to_ssl_errors), - psa_generic_status_to_mbedtls); -} -#define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status) -#endif - -#if !defined(MBEDTLS_CT_ASM) -/* - * Define an object with the value zero, such that the compiler cannot prove that it - * has the value zero (because it is volatile, it "may be modified in ways unknown to - * the implementation"). - */ -volatile mbedtls_ct_uint_t mbedtls_ct_zero = 0; -#endif - -/* - * Define MBEDTLS_EFFICIENT_UNALIGNED_VOLATILE_ACCESS where assembly is present to - * perform fast unaligned access to volatile data. - * - * This is needed because mbedtls_get_unaligned_uintXX etc don't support volatile - * memory accesses. - * - * Some of these definitions could be moved into alignment.h but for now they are - * only used here. - */ -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) && \ - ((defined(MBEDTLS_CT_ARM_ASM) && (UINTPTR_MAX == 0xfffffffful)) || \ - defined(MBEDTLS_CT_AARCH64_ASM)) -/* We check pointer sizes to avoid issues with them not matching register size requirements */ -#define MBEDTLS_EFFICIENT_UNALIGNED_VOLATILE_ACCESS - -static inline uint32_t mbedtls_get_unaligned_volatile_uint32(volatile const unsigned char *p) -{ - /* This is UB, even where it's safe: - * return *((volatile uint32_t*)p); - * so instead the same thing is expressed in assembly below. - */ - uint32_t r; -#if defined(MBEDTLS_CT_ARM_ASM) - asm volatile ("ldr %0, [%1]" : "=r" (r) : "r" (p) :); -#elif defined(MBEDTLS_CT_AARCH64_ASM) - asm volatile ("ldr %w0, [%1]" : "=r" (r) : MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT(p) :); -#else -#error "No assembly defined for mbedtls_get_unaligned_volatile_uint32" -#endif - return r; -} -#endif /* defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) && - (defined(MBEDTLS_CT_ARM_ASM) || defined(MBEDTLS_CT_AARCH64_ASM)) */ - -int mbedtls_ct_memcmp(const void *a, - const void *b, - size_t n) -{ - size_t i = 0; - /* - * `A` and `B` are cast to volatile to ensure that the compiler - * generates code that always fully reads both buffers. - * Otherwise it could generate a test to exit early if `diff` has all - * bits set early in the loop. - */ - volatile const unsigned char *A = (volatile const unsigned char *) a; - volatile const unsigned char *B = (volatile const unsigned char *) b; - uint32_t diff = 0; - -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_VOLATILE_ACCESS) - for (; (i + 4) <= n; i += 4) { - uint32_t x = mbedtls_get_unaligned_volatile_uint32(A + i); - uint32_t y = mbedtls_get_unaligned_volatile_uint32(B + i); - diff |= x ^ y; - } -#endif - - for (; i < n; i++) { - /* Read volatile data in order before computing diff. - * This avoids IAR compiler warning: - * 'the order of volatile accesses is undefined ..' */ - unsigned char x = A[i], y = B[i]; - diff |= x ^ y; - } - - -#if (INT_MAX < INT32_MAX) - /* We don't support int smaller than 32-bits, but if someone tried to build - * with this configuration, there is a risk that, for differing data, the - * only bits set in diff are in the top 16-bits, and would be lost by a - * simple cast from uint32 to int. - * This would have significant security implications, so protect against it. */ -#error "mbedtls_ct_memcmp() requires minimum 32-bit ints" -#else - /* The bit-twiddling ensures that when we cast uint32_t to int, we are casting - * a value that is in the range 0..INT_MAX - a value larger than this would - * result in implementation defined behaviour. - * - * This ensures that the value returned by the function is non-zero iff - * diff is non-zero. - */ - return (int) ((diff & 0xffff) | (diff >> 16)); -#endif -} - -#if defined(MBEDTLS_NIST_KW_C) - -int mbedtls_ct_memcmp_partial(const void *a, - const void *b, - size_t n, - size_t skip_head, - size_t skip_tail) -{ - unsigned int diff = 0; - - volatile const unsigned char *A = (volatile const unsigned char *) a; - volatile const unsigned char *B = (volatile const unsigned char *) b; - - size_t valid_end = n - skip_tail; - - for (size_t i = 0; i < n; i++) { - unsigned char x = A[i], y = B[i]; - unsigned int d = x ^ y; - mbedtls_ct_condition_t valid = mbedtls_ct_bool_and(mbedtls_ct_uint_ge(i, skip_head), - mbedtls_ct_uint_lt(i, valid_end)); - diff |= mbedtls_ct_uint_if_else_0(valid, d); - } - - /* Since we go byte-by-byte, the only bits set will be in the bottom 8 bits, so the - * cast from uint to int is safe. */ - return (int) diff; -} - -#endif - -#if defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT) - -void mbedtls_ct_memmove_left(void *start, size_t total, size_t offset) -{ - volatile unsigned char *buf = start; - for (size_t i = 0; i < total; i++) { - mbedtls_ct_condition_t no_op = mbedtls_ct_uint_gt(total - offset, i); - /* The first `total - offset` passes are a no-op. The last - * `offset` passes shift the data one byte to the left and - * zero out the last byte. */ - for (size_t n = 0; n < total - 1; n++) { - unsigned char current = buf[n]; - unsigned char next = buf[n+1]; - buf[n] = mbedtls_ct_uint_if(no_op, current, next); - } - buf[total-1] = mbedtls_ct_uint_if_else_0(no_op, buf[total-1]); - } -} - -#endif /* MBEDTLS_PKCS1_V15 && MBEDTLS_RSA_C && ! MBEDTLS_RSA_ALT */ - -void mbedtls_ct_memcpy_if(mbedtls_ct_condition_t condition, - unsigned char *dest, - const unsigned char *src1, - const unsigned char *src2, - size_t len) -{ -#if defined(MBEDTLS_CT_SIZE_64) - const uint64_t mask = (uint64_t) condition; - const uint64_t not_mask = (uint64_t) ~mbedtls_ct_compiler_opaque(condition); -#else - const uint32_t mask = (uint32_t) condition; - const uint32_t not_mask = (uint32_t) ~mbedtls_ct_compiler_opaque(condition); -#endif - - /* If src2 is NULL, setup src2 so that we read from the destination address. - * - * This means that if src2 == NULL && condition is false, the result will be a - * no-op because we read from dest and write the same data back into dest. - */ - if (src2 == NULL) { - src2 = dest; - } - - /* dest[i] = c1 == c2 ? src[i] : dest[i] */ - size_t i = 0; -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) -#if defined(MBEDTLS_CT_SIZE_64) - for (; (i + 8) <= len; i += 8) { - uint64_t a = mbedtls_get_unaligned_uint64(src1 + i) & mask; - uint64_t b = mbedtls_get_unaligned_uint64(src2 + i) & not_mask; - mbedtls_put_unaligned_uint64(dest + i, a | b); - } -#else - for (; (i + 4) <= len; i += 4) { - uint32_t a = mbedtls_get_unaligned_uint32(src1 + i) & mask; - uint32_t b = mbedtls_get_unaligned_uint32(src2 + i) & not_mask; - mbedtls_put_unaligned_uint32(dest + i, a | b); - } -#endif /* defined(MBEDTLS_CT_SIZE_64) */ -#endif /* MBEDTLS_EFFICIENT_UNALIGNED_ACCESS */ - for (; i < len; i++) { - dest[i] = (src1[i] & mask) | (src2[i] & not_mask); - } -} - -void mbedtls_ct_memcpy_offset(unsigned char *dest, - const unsigned char *src, - size_t offset, - size_t offset_min, - size_t offset_max, - size_t len) -{ - size_t offsetval; - - for (offsetval = offset_min; offsetval <= offset_max; offsetval++) { - mbedtls_ct_memcpy_if(mbedtls_ct_uint_eq(offsetval, offset), dest, src + offsetval, NULL, - len); - } -} - -#if defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT) - -void mbedtls_ct_zeroize_if(mbedtls_ct_condition_t condition, void *buf, size_t len) -{ - uint32_t mask = (uint32_t) ~condition; - uint8_t *p = (uint8_t *) buf; - size_t i = 0; -#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) - for (; (i + 4) <= len; i += 4) { - mbedtls_put_unaligned_uint32((void *) (p + i), - mbedtls_get_unaligned_uint32((void *) (p + i)) & mask); - } -#endif - for (; i < len; i++) { - p[i] = p[i] & mask; - } -} - -#endif /* defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT) */ diff --git a/ext/oberon/psa/core/library/constant_time_impl.h b/ext/oberon/psa/core/library/constant_time_impl.h deleted file mode 100644 index 7759ac384005..000000000000 --- a/ext/oberon/psa/core/library/constant_time_impl.h +++ /dev/null @@ -1,566 +0,0 @@ -/** - * Constant-time functions - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_CONSTANT_TIME_IMPL_H -#define MBEDTLS_CONSTANT_TIME_IMPL_H - -#include - -#include "common.h" - -#if defined(MBEDTLS_BIGNUM_C) -#include "mbedtls/bignum.h" -#endif - -/* - * To improve readability of constant_time_internal.h, the static inline - * definitions are here, and constant_time_internal.h has only the declarations. - * - * This results in duplicate declarations of the form: - * static inline void f(); // from constant_time_internal.h - * static inline void f() { ... } // from constant_time_impl.h - * when constant_time_internal.h is included. - * - * This appears to behave as if the declaration-without-definition was not present - * (except for warnings if gcc -Wredundant-decls or similar is used). - * - * Disable -Wredundant-decls so that gcc does not warn about this. This is re-enabled - * at the bottom of this file. - */ -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wredundant-decls" -#endif - -/* Disable asm under Memsan because it confuses Memsan and generates false errors. - * - * We also disable under Valgrind by default, because it's more useful - * for Valgrind to test the plain C implementation. MBEDTLS_TEST_CONSTANT_FLOW_ASM //no-check-names - * may be set to permit building asm under Valgrind. - */ -#if defined(MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN) || \ - (defined(MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND) && !defined(MBEDTLS_TEST_CONSTANT_FLOW_ASM)) //no-check-names -#define MBEDTLS_CT_NO_ASM -#elif defined(__has_feature) -#if __has_feature(memory_sanitizer) -#define MBEDTLS_CT_NO_ASM -#endif -#endif - -/* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */ -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && (!defined(__ARMCC_VERSION) || \ - __ARMCC_VERSION >= 6000000) && !defined(MBEDTLS_CT_NO_ASM) -#define MBEDTLS_CT_ASM -#if (defined(__arm__) || defined(__thumb__) || defined(__thumb2__)) -#define MBEDTLS_CT_ARM_ASM -#elif defined(__aarch64__) -#define MBEDTLS_CT_AARCH64_ASM -#elif defined(__amd64__) || defined(__x86_64__) -#define MBEDTLS_CT_X86_64_ASM -#elif defined(__i386__) -#define MBEDTLS_CT_X86_ASM -#endif -#endif - -#define MBEDTLS_CT_SIZE (sizeof(mbedtls_ct_uint_t) * 8) - - -/* ============================================================================ - * Core const-time primitives - */ - -/* Ensure that the compiler cannot know the value of x (i.e., cannot optimise - * based on its value) after this function is called. - * - * If we are not using assembly, this will be fairly inefficient, so its use - * should be minimised. - */ - -#if !defined(MBEDTLS_CT_ASM) -extern volatile mbedtls_ct_uint_t mbedtls_ct_zero; -#endif - -/** - * \brief Ensure that a value cannot be known at compile time. - * - * \param x The value to hide from the compiler. - * \return The same value that was passed in, such that the compiler - * cannot prove its value (even for calls of the form - * x = mbedtls_ct_compiler_opaque(1), x will be unknown). - * - * \note This is mainly used in constructing mbedtls_ct_condition_t - * values and performing operations over them, to ensure that - * there is no way for the compiler to ever know anything about - * the value of an mbedtls_ct_condition_t. - */ -static inline mbedtls_ct_uint_t mbedtls_ct_compiler_opaque(mbedtls_ct_uint_t x) -{ -#if defined(MBEDTLS_CT_ASM) - asm volatile ("" : [x] "+r" (x) :); - return x; -#else - return x ^ mbedtls_ct_zero; -#endif -} - -/* - * Selecting unified syntax is needed for gcc, and harmless on clang. - * - * This is needed because on Thumb 1, condition flags are always set, so - * e.g. "negs" is supported but "neg" is not (on Thumb 2, both exist). - * - * Under Thumb 1 unified syntax, only the "negs" form is accepted, and - * under divided syntax, only the "neg" form is accepted. clang only - * supports unified syntax. - * - * On Thumb 2 and Arm, both compilers are happy with the "s" suffix, - * although we don't actually care about setting the flags. - * - * For gcc, restore divided syntax afterwards - otherwise old versions of gcc - * seem to apply unified syntax globally, which breaks other asm code. - */ -#if !defined(__clang__) -#define RESTORE_ASM_SYNTAX ".syntax divided \n\t" -#else -#define RESTORE_ASM_SYNTAX -#endif - -/* Convert a number into a condition in constant time. */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool(mbedtls_ct_uint_t x) -{ - /* - * Define mask-generation code that, as far as possible, will not use branches or conditional instructions. - * - * For some platforms / type sizes, we define assembly to assure this. - * - * Otherwise, we define a plain C fallback which (in May 2023) does not get optimised into - * conditional instructions or branches by trunk clang, gcc, or MSVC v19. - */ -#if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - mbedtls_ct_uint_t s; - asm volatile ("neg %x[s], %x[x] \n\t" - "orr %x[x], %x[s], %x[x] \n\t" - "asr %x[x], %x[x], 63 \n\t" - : - [s] "=&r" (s), - [x] "+&r" (x) - : - : - ); - return (mbedtls_ct_condition_t) x; -#elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) - uint32_t s; - asm volatile (".syntax unified \n\t" - "negs %[s], %[x] \n\t" - "orrs %[x], %[x], %[s] \n\t" - "asrs %[x], %[x], #31 \n\t" - RESTORE_ASM_SYNTAX - : - [s] "=&l" (s), - [x] "+&l" (x) - : - : - "cc" /* clobbers flag bits */ - ); - return (mbedtls_ct_condition_t) x; -#elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - uint64_t s; - asm volatile ("mov %[x], %[s] \n\t" - "neg %[s] \n\t" - "or %[x], %[s] \n\t" - "sar $63, %[s] \n\t" - : - [s] "=&a" (s) - : - [x] "D" (x) - : - ); - return (mbedtls_ct_condition_t) s; -#elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) - uint32_t s; - asm volatile ("mov %[x], %[s] \n\t" - "neg %[s] \n\t" - "or %[s], %[x] \n\t" - "sar $31, %[x] \n\t" - : - [s] "=&c" (s), - [x] "+&a" (x) - : - : - ); - return (mbedtls_ct_condition_t) x; -#else - const mbedtls_ct_uint_t xo = mbedtls_ct_compiler_opaque(x); -#if defined(_MSC_VER) - /* MSVC has a warning about unary minus on unsigned, but this is - * well-defined and precisely what we want to do here */ -#pragma warning( push ) -#pragma warning( disable : 4146 ) -#endif - // y is negative (i.e., top bit set) iff x is non-zero - mbedtls_ct_int_t y = (-xo) | -(xo >> 1); - - // extract only the sign bit of y so that y == 1 (if x is non-zero) or 0 (if x is zero) - y = (((mbedtls_ct_uint_t) y) >> (MBEDTLS_CT_SIZE - 1)); - - // -y has all bits set (if x is non-zero), or all bits clear (if x is zero) - return (mbedtls_ct_condition_t) (-y); -#if defined(_MSC_VER) -#pragma warning( pop ) -#endif -#endif -} - -static inline mbedtls_ct_uint_t mbedtls_ct_if(mbedtls_ct_condition_t condition, - mbedtls_ct_uint_t if1, - mbedtls_ct_uint_t if0) -{ -#if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - asm volatile ("and %x[if1], %x[if1], %x[condition] \n\t" - "mvn %x[condition], %x[condition] \n\t" - "and %x[condition], %x[condition], %x[if0] \n\t" - "orr %x[condition], %x[if1], %x[condition]" - : - [condition] "+&r" (condition), - [if1] "+&r" (if1) - : - [if0] "r" (if0) - : - ); - return (mbedtls_ct_uint_t) condition; -#elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) - asm volatile (".syntax unified \n\t" - "ands %[if1], %[if1], %[condition] \n\t" - "mvns %[condition], %[condition] \n\t" - "ands %[condition], %[condition], %[if0] \n\t" - "orrs %[condition], %[if1], %[condition] \n\t" - RESTORE_ASM_SYNTAX - : - [condition] "+&l" (condition), - [if1] "+&l" (if1) - : - [if0] "l" (if0) - : - "cc" - ); - return (mbedtls_ct_uint_t) condition; -#elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - asm volatile ("and %[condition], %[if1] \n\t" - "not %[condition] \n\t" - "and %[condition], %[if0] \n\t" - "or %[if1], %[if0] \n\t" - : - [condition] "+&D" (condition), - [if1] "+&S" (if1), - [if0] "+&a" (if0) - : - : - ); - return if0; -#elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) - asm volatile ("and %[condition], %[if1] \n\t" - "not %[condition] \n\t" - "and %[if0], %[condition] \n\t" - "or %[condition], %[if1] \n\t" - : - [condition] "+&c" (condition), - [if1] "+&a" (if1) - : - [if0] "b" (if0) - : - ); - return if1; -#else - mbedtls_ct_condition_t not_cond = - (mbedtls_ct_condition_t) (~mbedtls_ct_compiler_opaque(condition)); - return (mbedtls_ct_uint_t) ((condition & if1) | (not_cond & if0)); -#endif -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y) -{ -#if defined(MBEDTLS_CT_AARCH64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - uint64_t s1; - asm volatile ("eor %x[s1], %x[y], %x[x] \n\t" - "sub %x[x], %x[x], %x[y] \n\t" - "bic %x[x], %x[x], %x[s1] \n\t" - "and %x[s1], %x[s1], %x[y] \n\t" - "orr %x[s1], %x[x], %x[s1] \n\t" - "asr %x[x], %x[s1], 63" - : - [s1] "=&r" (s1), - [x] "+&r" (x) - : - [y] "r" (y) - : - ); - return (mbedtls_ct_condition_t) x; -#elif defined(MBEDTLS_CT_ARM_ASM) && defined(MBEDTLS_CT_SIZE_32) - uint32_t s1; - asm volatile ( - ".syntax unified \n\t" -#if defined(__thumb__) && !defined(__thumb2__) - "movs %[s1], %[x] \n\t" - "eors %[s1], %[s1], %[y] \n\t" -#else - "eors %[s1], %[x], %[y] \n\t" -#endif - "subs %[x], %[x], %[y] \n\t" - "bics %[x], %[x], %[s1] \n\t" - "ands %[y], %[s1], %[y] \n\t" - "orrs %[x], %[x], %[y] \n\t" - "asrs %[x], %[x], #31 \n\t" - RESTORE_ASM_SYNTAX - : - [s1] "=&l" (s1), - [x] "+&l" (x), - [y] "+&l" (y) - : - : - "cc" - ); - return (mbedtls_ct_condition_t) x; -#elif defined(MBEDTLS_CT_X86_64_ASM) && (defined(MBEDTLS_CT_SIZE_32) || defined(MBEDTLS_CT_SIZE_64)) - uint64_t s; - asm volatile ("mov %[x], %[s] \n\t" - "xor %[y], %[s] \n\t" - "sub %[y], %[x] \n\t" - "and %[s], %[y] \n\t" - "not %[s] \n\t" - "and %[s], %[x] \n\t" - "or %[y], %[x] \n\t" - "sar $63, %[x] \n\t" - : - [s] "=&a" (s), - [x] "+&D" (x), - [y] "+&S" (y) - : - : - ); - return (mbedtls_ct_condition_t) x; -#elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32) - uint32_t s; - asm volatile ("mov %[x], %[s] \n\t" - "xor %[y], %[s] \n\t" - "sub %[y], %[x] \n\t" - "and %[s], %[y] \n\t" - "not %[s] \n\t" - "and %[s], %[x] \n\t" - "or %[y], %[x] \n\t" - "sar $31, %[x] \n\t" - : - [s] "=&b" (s), - [x] "+&a" (x), - [y] "+&c" (y) - : - : - ); - return (mbedtls_ct_condition_t) x; -#else - /* Ensure that the compiler cannot optimise the following operations over x and y, - * even if it knows the value of x and y. - */ - const mbedtls_ct_uint_t xo = mbedtls_ct_compiler_opaque(x); - const mbedtls_ct_uint_t yo = mbedtls_ct_compiler_opaque(y); - /* - * Check if the most significant bits (MSB) of the operands are different. - * cond is true iff the MSBs differ. - */ - mbedtls_ct_condition_t cond = mbedtls_ct_bool((xo ^ yo) >> (MBEDTLS_CT_SIZE - 1)); - - /* - * If the MSB are the same then the difference x-y will be negative (and - * have its MSB set to 1 during conversion to unsigned) if and only if x> (MBEDTLS_CT_SIZE - 1); - - // Convert to a condition (i.e., all bits set iff non-zero) - return mbedtls_ct_bool(ret); -#endif -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_ne(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y) -{ - /* diff = 0 if x == y, non-zero otherwise */ - const mbedtls_ct_uint_t diff = mbedtls_ct_compiler_opaque(x) ^ mbedtls_ct_compiler_opaque(y); - - /* all ones if x != y, 0 otherwise */ - return mbedtls_ct_bool(diff); -} - -static inline unsigned char mbedtls_ct_uchar_in_range_if(unsigned char low, - unsigned char high, - unsigned char c, - unsigned char t) -{ - const unsigned char co = (unsigned char) mbedtls_ct_compiler_opaque(c); - const unsigned char to = (unsigned char) mbedtls_ct_compiler_opaque(t); - - /* low_mask is: 0 if low <= c, 0x...ff if low > c */ - unsigned low_mask = ((unsigned) co - low) >> 8; - /* high_mask is: 0 if c <= high, 0x...ff if c > high */ - unsigned high_mask = ((unsigned) high - co) >> 8; - - return (unsigned char) (~(low_mask | high_mask)) & to; -} - -/* ============================================================================ - * Everything below here is trivial wrapper functions - */ - -static inline size_t mbedtls_ct_size_if(mbedtls_ct_condition_t condition, - size_t if1, - size_t if0) -{ - return (size_t) mbedtls_ct_if(condition, (mbedtls_ct_uint_t) if1, (mbedtls_ct_uint_t) if0); -} - -static inline unsigned mbedtls_ct_uint_if(mbedtls_ct_condition_t condition, - unsigned if1, - unsigned if0) -{ - return (unsigned) mbedtls_ct_if(condition, (mbedtls_ct_uint_t) if1, (mbedtls_ct_uint_t) if0); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_if(mbedtls_ct_condition_t condition, - mbedtls_ct_condition_t if1, - mbedtls_ct_condition_t if0) -{ - return (mbedtls_ct_condition_t) mbedtls_ct_if(condition, (mbedtls_ct_uint_t) if1, - (mbedtls_ct_uint_t) if0); -} - -#if defined(MBEDTLS_BIGNUM_C) - -static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if(mbedtls_ct_condition_t condition, - mbedtls_mpi_uint if1, - mbedtls_mpi_uint if0) -{ - return (mbedtls_mpi_uint) mbedtls_ct_if(condition, - (mbedtls_ct_uint_t) if1, - (mbedtls_ct_uint_t) if0); -} - -#endif - -static inline size_t mbedtls_ct_size_if_else_0(mbedtls_ct_condition_t condition, size_t if1) -{ - return (size_t) (condition & if1); -} - -static inline unsigned mbedtls_ct_uint_if_else_0(mbedtls_ct_condition_t condition, unsigned if1) -{ - return (unsigned) (condition & if1); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_if_else_0(mbedtls_ct_condition_t condition, - mbedtls_ct_condition_t if1) -{ - return (mbedtls_ct_condition_t) (condition & if1); -} - -#if defined(MBEDTLS_BIGNUM_C) - -static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if_else_0(mbedtls_ct_condition_t condition, - mbedtls_mpi_uint if1) -{ - return (mbedtls_mpi_uint) (condition & if1); -} - -#endif /* MBEDTLS_BIGNUM_C */ - -static inline int mbedtls_ct_error_if(mbedtls_ct_condition_t condition, int if1, int if0) -{ - /* Coverting int -> uint -> int here is safe, because we require if1 and if0 to be - * in the range -32767..0, and we require 32-bit int and uint types. - * - * This means that (0 <= -if0 < INT_MAX), so negating if0 is safe, and similarly for - * converting back to int. - */ - return -((int) mbedtls_ct_if(condition, (mbedtls_ct_uint_t) (-if1), - (mbedtls_ct_uint_t) (-if0))); -} - -static inline int mbedtls_ct_error_if_else_0(mbedtls_ct_condition_t condition, int if1) -{ - return -((int) (condition & (-if1))); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_eq(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y) -{ - return ~mbedtls_ct_uint_ne(x, y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_gt(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y) -{ - return mbedtls_ct_uint_lt(y, x); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_ge(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y) -{ - return ~mbedtls_ct_uint_lt(x, y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_uint_le(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y) -{ - return ~mbedtls_ct_uint_gt(x, y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_ne(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y) -{ - return (mbedtls_ct_condition_t) (x ^ y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_and(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y) -{ - return (mbedtls_ct_condition_t) (x & y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_or(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y) -{ - return (mbedtls_ct_condition_t) (x | y); -} - -static inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x) -{ - return (mbedtls_ct_condition_t) (~x); -} - -#ifdef __GNUC__ -/* Restore warnings for -Wredundant-decls on gcc */ - #pragma GCC diagnostic pop -#endif - -#endif /* MBEDTLS_CONSTANT_TIME_IMPL_H */ diff --git a/ext/oberon/psa/core/library/constant_time_internal.h b/ext/oberon/psa/core/library/constant_time_internal.h deleted file mode 100644 index cc26edcd1e4b..000000000000 --- a/ext/oberon/psa/core/library/constant_time_internal.h +++ /dev/null @@ -1,591 +0,0 @@ -/** - * Constant-time functions - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_CONSTANT_TIME_INTERNAL_H -#define MBEDTLS_CONSTANT_TIME_INTERNAL_H - -#include -#include - -#include "common.h" - -#if defined(MBEDTLS_BIGNUM_C) -#include "mbedtls/bignum.h" -#endif - -/* The constant-time interface provides various operations that are likely - * to result in constant-time code that does not branch or use conditional - * instructions for secret data (for secret pointers, this also applies to - * the data pointed to). - * - * It has three main parts: - * - * - boolean operations - * These are all named mbedtls_ct__. - * They operate over and return mbedtls_ct_condition_t. - * All arguments are considered secret. - * example: bool x = y | z => x = mbedtls_ct_bool_or(y, z) - * example: bool x = y == z => x = mbedtls_ct_uint_eq(y, z) - * - * - conditional data selection - * These are all named mbedtls_ct__if and mbedtls_ct__if_else_0 - * All arguments are considered secret. - * example: size_t a = x ? b : c => a = mbedtls_ct_size_if(x, b, c) - * example: unsigned a = x ? b : 0 => a = mbedtls_ct_uint_if_else_0(x, b) - * - * - block memory operations - * Only some arguments are considered secret, as documented for each - * function. - * example: if (x) memcpy(...) => mbedtls_ct_memcpy_if(x, ...) - * - * mbedtls_ct_condition_t must be treated as opaque and only created and - * manipulated via the functions in this header. The compiler should never - * be able to prove anything about its value at compile-time. - * - * mbedtls_ct_uint_t is an unsigned integer type over which constant time - * operations may be performed via the functions in this header. It is as big - * as the larger of size_t and mbedtls_mpi_uint, i.e. it is safe to cast - * to/from "unsigned int", "size_t", and "mbedtls_mpi_uint" (and any other - * not-larger integer types). - * - * For Arm (32-bit, 64-bit and Thumb), x86 and x86-64, assembly implementations - * are used to ensure that the generated code is constant time. For other - * architectures, it uses a plain C fallback designed to yield constant-time code - * (this has been observed to be constant-time on latest gcc, clang and MSVC - * as of May 2023). - * - * For readability, the static inline definitions are separated out into - * constant_time_impl.h. - */ - -#if (SIZE_MAX > 0xffffffffffffffffULL) -/* Pointer size > 64-bit */ -typedef size_t mbedtls_ct_condition_t; -typedef size_t mbedtls_ct_uint_t; -typedef ptrdiff_t mbedtls_ct_int_t; -#define MBEDTLS_CT_TRUE ((mbedtls_ct_condition_t) mbedtls_ct_compiler_opaque(SIZE_MAX)) -#elif (SIZE_MAX > 0xffffffff) || defined(MBEDTLS_HAVE_INT64) -/* 32-bit < pointer size <= 64-bit, or 64-bit MPI */ -typedef uint64_t mbedtls_ct_condition_t; -typedef uint64_t mbedtls_ct_uint_t; -typedef int64_t mbedtls_ct_int_t; -#define MBEDTLS_CT_SIZE_64 -#define MBEDTLS_CT_TRUE ((mbedtls_ct_condition_t) mbedtls_ct_compiler_opaque(UINT64_MAX)) -#else -/* Pointer size <= 32-bit, and no 64-bit MPIs */ -typedef uint32_t mbedtls_ct_condition_t; -typedef uint32_t mbedtls_ct_uint_t; -typedef int32_t mbedtls_ct_int_t; -#define MBEDTLS_CT_SIZE_32 -#define MBEDTLS_CT_TRUE ((mbedtls_ct_condition_t) mbedtls_ct_compiler_opaque(UINT32_MAX)) -#endif -#define MBEDTLS_CT_FALSE ((mbedtls_ct_condition_t) mbedtls_ct_compiler_opaque(0)) - -/* ============================================================================ - * Boolean operations - */ - -/** Convert a number into a mbedtls_ct_condition_t. - * - * \param x Number to convert. - * - * \return MBEDTLS_CT_TRUE if \p x != 0, or MBEDTLS_CT_FALSE if \p x == 0 - * - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool(mbedtls_ct_uint_t x); - -/** Boolean "not equal" operation. - * - * Functionally equivalent to: - * - * \p x != \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x != \p y, otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_ne(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y); - -/** Boolean "equals" operation. - * - * Functionally equivalent to: - * - * \p x == \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x == \p y, otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_eq(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y); - -/** Boolean "less than" operation. - * - * Functionally equivalent to: - * - * \p x < \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x < \p y, otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbedtls_ct_uint_t y); - -/** Boolean "greater than" operation. - * - * Functionally equivalent to: - * - * \p x > \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x > \p y, otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_gt(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y); - -/** Boolean "greater or equal" operation. - * - * Functionally equivalent to: - * - * \p x >= \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x >= \p y, - * otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_ge(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y); - -/** Boolean "less than or equal" operation. - * - * Functionally equivalent to: - * - * \p x <= \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x <= \p y, - * otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_uint_le(mbedtls_ct_uint_t x, - mbedtls_ct_uint_t y); - -/** Boolean not-equals operation. - * - * Functionally equivalent to: - * - * \p x != \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \note This is more efficient than mbedtls_ct_uint_ne if both arguments are - * mbedtls_ct_condition_t. - * - * \return MBEDTLS_CT_TRUE if \p x != \p y, - * otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_ne(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y); - -/** Boolean "and" operation. - * - * Functionally equivalent to: - * - * \p x && \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x && \p y, - * otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_and(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y); - -/** Boolean "or" operation. - * - * Functionally equivalent to: - * - * \p x || \p y - * - * \param x The first value to analyze. - * \param y The second value to analyze. - * - * \return MBEDTLS_CT_TRUE if \p x || \p y, - * otherwise MBEDTLS_CT_FALSE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_or(mbedtls_ct_condition_t x, - mbedtls_ct_condition_t y); - -/** Boolean "not" operation. - * - * Functionally equivalent to: - * - * ! \p x - * - * \param x The value to invert - * - * \return MBEDTLS_CT_FALSE if \p x, otherwise MBEDTLS_CT_TRUE. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_not(mbedtls_ct_condition_t x); - - -/* ============================================================================ - * Data selection operations - */ - -/** Choose between two size_t values. - * - * Functionally equivalent to: - * - * condition ? if1 : if0. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * \param if0 Value to use if \p condition == MBEDTLS_CT_FALSE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise \c if0. - */ -static inline size_t mbedtls_ct_size_if(mbedtls_ct_condition_t condition, - size_t if1, - size_t if0); - -/** Choose between two unsigned values. - * - * Functionally equivalent to: - * - * condition ? if1 : if0. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * \param if0 Value to use if \p condition == MBEDTLS_CT_FALSE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise \c if0. - */ -static inline unsigned mbedtls_ct_uint_if(mbedtls_ct_condition_t condition, - unsigned if1, - unsigned if0); - -/** Choose between two mbedtls_ct_condition_t values. - * - * Functionally equivalent to: - * - * condition ? if1 : if0. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * \param if0 Value to use if \p condition == MBEDTLS_CT_FALSE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise \c if0. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_if(mbedtls_ct_condition_t condition, - mbedtls_ct_condition_t if1, - mbedtls_ct_condition_t if0); - -#if defined(MBEDTLS_BIGNUM_C) - -/** Choose between two mbedtls_mpi_uint values. - * - * Functionally equivalent to: - * - * condition ? if1 : if0. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * \param if0 Value to use if \p condition == MBEDTLS_CT_FALSE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise \c if0. - */ -static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if(mbedtls_ct_condition_t condition, \ - mbedtls_mpi_uint if1, \ - mbedtls_mpi_uint if0); - -#endif - -/** Choose between an unsigned value and 0. - * - * Functionally equivalent to: - * - * condition ? if1 : 0. - * - * Functionally equivalent to mbedtls_ct_uint_if(condition, if1, 0) but - * results in smaller code size. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise 0. - */ -static inline unsigned mbedtls_ct_uint_if_else_0(mbedtls_ct_condition_t condition, unsigned if1); - -/** Choose between an mbedtls_ct_condition_t and 0. - * - * Functionally equivalent to: - * - * condition ? if1 : 0. - * - * Functionally equivalent to mbedtls_ct_bool_if(condition, if1, 0) but - * results in smaller code size. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise 0. - */ -static inline mbedtls_ct_condition_t mbedtls_ct_bool_if_else_0(mbedtls_ct_condition_t condition, - mbedtls_ct_condition_t if1); - -/** Choose between a size_t value and 0. - * - * Functionally equivalent to: - * - * condition ? if1 : 0. - * - * Functionally equivalent to mbedtls_ct_size_if(condition, if1, 0) but - * results in smaller code size. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise 0. - */ -static inline size_t mbedtls_ct_size_if_else_0(mbedtls_ct_condition_t condition, size_t if1); - -#if defined(MBEDTLS_BIGNUM_C) - -/** Choose between an mbedtls_mpi_uint value and 0. - * - * Functionally equivalent to: - * - * condition ? if1 : 0. - * - * Functionally equivalent to mbedtls_ct_mpi_uint_if(condition, if1, 0) but - * results in smaller code size. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise 0. - */ -static inline mbedtls_mpi_uint mbedtls_ct_mpi_uint_if_else_0(mbedtls_ct_condition_t condition, - mbedtls_mpi_uint if1); - -#endif - -/** Constant-flow char selection - * - * \param low Secret. Bottom of range - * \param high Secret. Top of range - * \param c Secret. Value to compare to range - * \param t Secret. Value to return, if in range - * - * \return \p t if \p low <= \p c <= \p high, 0 otherwise. - */ -static inline unsigned char mbedtls_ct_uchar_in_range_if(unsigned char low, - unsigned char high, - unsigned char c, - unsigned char t); - -/** Choose between two error values. The values must be in the range [-32767..0]. - * - * Functionally equivalent to: - * - * condition ? if1 : if0. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * \param if0 Value to use if \p condition == MBEDTLS_CT_FALSE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise \c if0. - */ -static inline int mbedtls_ct_error_if(mbedtls_ct_condition_t condition, int if1, int if0); - -/** Choose between an error value and 0. The error value must be in the range [-32767..0]. - * - * Functionally equivalent to: - * - * condition ? if1 : 0. - * - * Functionally equivalent to mbedtls_ct_error_if(condition, if1, 0) but - * results in smaller code size. - * - * \param condition Condition to test. - * \param if1 Value to use if \p condition == MBEDTLS_CT_TRUE. - * - * \return \c if1 if \p condition == MBEDTLS_CT_TRUE, otherwise 0. - */ -static inline int mbedtls_ct_error_if_else_0(mbedtls_ct_condition_t condition, int if1); - -/* ============================================================================ - * Block memory operations - */ - -#if defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT) - -/** Conditionally set a block of memory to zero. - * - * Regardless of the condition, every byte will be read once and written to - * once. - * - * \param condition Secret. Condition to test. - * \param buf Secret. Pointer to the start of the buffer. - * \param len Number of bytes to set to zero. - * - * \warning Unlike mbedtls_platform_zeroize, this does not have the same guarantees - * about not being optimised away if the memory is never read again. - */ -void mbedtls_ct_zeroize_if(mbedtls_ct_condition_t condition, void *buf, size_t len); - -/** Shift some data towards the left inside a buffer. - * - * Functionally equivalent to: - * - * memmove(start, start + offset, total - offset); - * memset(start + (total - offset), 0, offset); - * - * Timing independence comes at the expense of performance. - * - * \param start Secret. Pointer to the start of the buffer. - * \param total Total size of the buffer. - * \param offset Secret. Offset from which to copy \p total - \p offset bytes. - */ -void mbedtls_ct_memmove_left(void *start, - size_t total, - size_t offset); - -#endif /* defined(MBEDTLS_PKCS1_V15) && defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_RSA_ALT) */ - -/** Conditional memcpy. - * - * Functionally equivalent to: - * - * if (condition) { - * memcpy(dest, src1, len); - * } else { - * if (src2 != NULL) - * memcpy(dest, src2, len); - * } - * - * It will always read len bytes from src1. - * If src2 != NULL, it will always read len bytes from src2. - * If src2 == NULL, it will instead read len bytes from dest (as if src2 == dest). - * - * \param condition The condition - * \param dest Secret. Destination pointer. - * \param src1 Secret. Pointer to copy from (if \p condition == MBEDTLS_CT_TRUE). - * This may be equal to \p dest, but may not overlap in other ways. - * \param src2 Secret (contents only - may branch to determine if this parameter is NULL). - * Pointer to copy from (if \p condition == MBEDTLS_CT_FALSE and \p src2 is not NULL). May be NULL. - * This may be equal to \p dest, but may not overlap it in other ways. It may overlap with \p src1. - * \param len Number of bytes to copy. - */ -void mbedtls_ct_memcpy_if(mbedtls_ct_condition_t condition, - unsigned char *dest, - const unsigned char *src1, - const unsigned char *src2, - size_t len - ); - -/** Copy data from a secret position. - * - * Functionally equivalent to: - * - * memcpy(dst, src + offset, len) - * - * This function copies \p len bytes from \p src + \p offset to - * \p dst, with a code flow and memory access pattern that does not depend on - * \p offset, but only on \p offset_min, \p offset_max and \p len. - * - * \note This function reads from \p dest, but the value that - * is read does not influence the result and this - * function's behavior is well-defined regardless of the - * contents of the buffers. This may result in false - * positives from static or dynamic analyzers, especially - * if \p dest is not initialized. - * - * \param dest Secret. The destination buffer. This must point to a writable - * buffer of at least \p len bytes. - * \param src Secret. The base of the source buffer. This must point to a - * readable buffer of at least \p offset_max + \p len - * bytes. Shouldn't overlap with \p dest - * \param offset Secret. The offset in the source buffer from which to copy. - * This must be no less than \p offset_min and no greater - * than \p offset_max. - * \param offset_min The minimal value of \p offset. - * \param offset_max The maximal value of \p offset. - * \param len The number of bytes to copy. - */ -void mbedtls_ct_memcpy_offset(unsigned char *dest, - const unsigned char *src, - size_t offset, - size_t offset_min, - size_t offset_max, - size_t len); - -/* Documented in include/mbedtls/constant_time.h. a and b are secret. - - int mbedtls_ct_memcmp(const void *a, - const void *b, - size_t n); - */ - -#if defined(MBEDTLS_NIST_KW_C) - -/** Constant-time buffer comparison without branches. - * - * Similar to mbedtls_ct_memcmp, except that the result only depends on part of - * the input data - differences in the head or tail are ignored. Functionally equivalent to: - * - * memcmp(a + skip_head, b + skip_head, size - skip_head - skip_tail) - * - * Time taken depends on \p n, but not on \p skip_head or \p skip_tail . - * - * Behaviour is undefined if ( \p skip_head + \p skip_tail) > \p n. - * - * \param a Secret. Pointer to the first buffer, containing at least \p n bytes. May not be NULL. - * \param b Secret. Pointer to the second buffer, containing at least \p n bytes. May not be NULL. - * \param n The number of bytes to examine (total size of the buffers). - * \param skip_head Secret. The number of bytes to treat as non-significant at the start of the buffer. - * These bytes will still be read. - * \param skip_tail Secret. The number of bytes to treat as non-significant at the end of the buffer. - * These bytes will still be read. - * - * \return Zero if the contents of the two buffers are the same, otherwise non-zero. - */ -int mbedtls_ct_memcmp_partial(const void *a, - const void *b, - size_t n, - size_t skip_head, - size_t skip_tail); - -#endif - -/* Include the implementation of static inline functions above. */ -#include "constant_time_impl.h" - -#endif /* MBEDTLS_CONSTANT_TIME_INTERNAL_H */ diff --git a/ext/oberon/psa/core/library/entropy_poll.h b/ext/oberon/psa/core/library/entropy_poll.h deleted file mode 100644 index be4943cce47d..000000000000 --- a/ext/oberon/psa/core/library/entropy_poll.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * \file entropy_poll.h - * - * \brief Platform-specific and custom entropy polling functions - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MBEDTLS_ENTROPY_POLL_H -#define MBEDTLS_ENTROPY_POLL_H - -#include "mbedtls/build_info.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Default thresholds for built-in sources, in bytes - */ -#define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ -#if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE) -#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ -#endif - -#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) -/** - * \brief Platform-specific entropy poll callback - */ -int mbedtls_platform_entropy_poll(void *data, - unsigned char *output, size_t len, size_t *olen); -#endif - -#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) -/** - * \brief Entropy poll callback for a hardware source - * - * \warning This is not provided by Mbed TLS! - * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in mbedtls_config.h. - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_hardware_poll(void *data, - unsigned char *output, size_t len, size_t *olen); -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -/** - * \brief Entropy poll callback for a non-volatile seed file - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_nv_seed_poll(void *data, - unsigned char *output, size_t len, size_t *olen); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* entropy_poll.h */ diff --git a/ext/oberon/psa/core/library/md_psa.h b/ext/oberon/psa/core/library/md_psa.h deleted file mode 100644 index 8e00bb1492c2..000000000000 --- a/ext/oberon/psa/core/library/md_psa.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Translation between MD and PSA identifiers (algorithms, errors). - * - * Note: this internal module will go away when everything becomes based on - * PSA Crypto; it is a helper for the transition period. - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MBEDTLS_MD_PSA_H -#define MBEDTLS_MD_PSA_H - -#include "common.h" - -#include "mbedtls/md.h" -#include "psa/crypto.h" - -/** - * \brief This function returns the PSA algorithm identifier - * associated with the given digest type. - * - * \param md_type The type of digest to search for. Must not be NONE. - * - * \warning If \p md_type is \c MBEDTLS_MD_NONE, this function will - * not return \c PSA_ALG_NONE, but an invalid algorithm. - * - * \warning This function does not check if the algorithm is - * supported, it always returns the corresponding identifier. - * - * \return The PSA algorithm identifier associated with \p md_type, - * regardless of whether it is supported or not. - */ -static inline psa_algorithm_t mbedtls_md_psa_alg_from_type(mbedtls_md_type_t md_type) -{ - return PSA_ALG_CATEGORY_HASH | (psa_algorithm_t) md_type; -} - -/** - * \brief This function returns the given digest type - * associated with the PSA algorithm identifier. - * - * \param psa_alg The PSA algorithm identifier to search for. - * - * \warning This function does not check if the algorithm is - * supported, it always returns the corresponding identifier. - * - * \return The MD type associated with \p psa_alg, - * regardless of whether it is supported or not. - */ -static inline mbedtls_md_type_t mbedtls_md_type_from_psa_alg(psa_algorithm_t psa_alg) -{ - return (mbedtls_md_type_t) (psa_alg & PSA_ALG_HASH_MASK); -} - -/** Convert PSA status to MD error code. - * - * \param status PSA status. - * - * \return The corresponding MD error code, - */ -int mbedtls_md_error_from_psa(psa_status_t status); - -#endif /* MBEDTLS_MD_PSA_H */ diff --git a/ext/oberon/psa/core/library/platform.c b/ext/oberon/psa/core/library/platform.c deleted file mode 100644 index b15b7b29adc3..000000000000 --- a/ext/oberon/psa/core/library/platform.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Platform abstraction layer - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common.h" - -#if defined(MBEDTLS_PLATFORM_C) - -#include "mbedtls/platform.h" -#include "mbedtls/platform_util.h" -#include "mbedtls/error.h" - -/* The compile time configuration of memory allocation via the macros - * MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO takes precedence over the runtime - * configuration via mbedtls_platform_set_calloc_free(). So, omit everything - * related to the latter if MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO are defined. */ -#if defined(MBEDTLS_PLATFORM_MEMORY) && \ - !(defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && \ - defined(MBEDTLS_PLATFORM_FREE_MACRO)) - -#if !defined(MBEDTLS_PLATFORM_STD_CALLOC) -static void *platform_calloc_uninit(size_t n, size_t size) -{ - ((void) n); - ((void) size); - return NULL; -} - -#define MBEDTLS_PLATFORM_STD_CALLOC platform_calloc_uninit -#endif /* !MBEDTLS_PLATFORM_STD_CALLOC */ - -#if !defined(MBEDTLS_PLATFORM_STD_FREE) -static void platform_free_uninit(void *ptr) -{ - ((void) ptr); -} - -#define MBEDTLS_PLATFORM_STD_FREE platform_free_uninit -#endif /* !MBEDTLS_PLATFORM_STD_FREE */ - -static void * (*mbedtls_calloc_func)(size_t, size_t) = MBEDTLS_PLATFORM_STD_CALLOC; -static void (*mbedtls_free_func)(void *) = MBEDTLS_PLATFORM_STD_FREE; - -void *mbedtls_calloc(size_t nmemb, size_t size) -{ - return (*mbedtls_calloc_func)(nmemb, size); -} - -void mbedtls_free(void *ptr) -{ - (*mbedtls_free_func)(ptr); -} - -int mbedtls_platform_set_calloc_free(void *(*calloc_func)(size_t, size_t), - void (*free_func)(void *)) -{ - mbedtls_calloc_func = calloc_func; - mbedtls_free_func = free_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_MEMORY && - !( defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && - defined(MBEDTLS_PLATFORM_FREE_MACRO) ) */ - -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF) -#include -int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...) -{ - int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; - va_list argp; - - va_start(argp, fmt); - ret = mbedtls_vsnprintf(s, n, fmt, argp); - va_end(argp); - - return ret; -} -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_snprintf_uninit(char *s, size_t n, - const char *format, ...) -{ - ((void) s); - ((void) n); - ((void) format); - return 0; -} - -#define MBEDTLS_PLATFORM_STD_SNPRINTF platform_snprintf_uninit -#endif /* !MBEDTLS_PLATFORM_STD_SNPRINTF */ - -int (*mbedtls_snprintf)(char *s, size_t n, - const char *format, - ...) = MBEDTLS_PLATFORM_STD_SNPRINTF; - -int mbedtls_platform_set_snprintf(int (*snprintf_func)(char *s, size_t n, - const char *format, - ...)) -{ - mbedtls_snprintf = snprintf_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ - -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF) -#include -int mbedtls_platform_win32_vsnprintf(char *s, size_t n, const char *fmt, va_list arg) -{ - int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; - - /* Avoid calling the invalid parameter handler by checking ourselves */ - if (s == NULL || n == 0 || fmt == NULL) { - return -1; - } - -#if defined(_TRUNCATE) - ret = vsnprintf_s(s, n, _TRUNCATE, fmt, arg); -#else - ret = vsnprintf(s, n, fmt, arg); - if (ret < 0 || (size_t) ret == n) { - s[n-1] = '\0'; - ret = -1; - } -#endif - - return ret; -} -#endif - -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_VSNPRINTF) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_vsnprintf_uninit(char *s, size_t n, - const char *format, va_list arg) -{ - ((void) s); - ((void) n); - ((void) format); - ((void) arg); - return -1; -} - -#define MBEDTLS_PLATFORM_STD_VSNPRINTF platform_vsnprintf_uninit -#endif /* !MBEDTLS_PLATFORM_STD_VSNPRINTF */ - -int (*mbedtls_vsnprintf)(char *s, size_t n, - const char *format, - va_list arg) = MBEDTLS_PLATFORM_STD_VSNPRINTF; - -int mbedtls_platform_set_vsnprintf(int (*vsnprintf_func)(char *s, size_t n, - const char *format, - va_list arg)) -{ - mbedtls_vsnprintf = vsnprintf_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_VSNPRINTF_ALT */ - -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_PRINTF) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_printf_uninit(const char *format, ...) -{ - ((void) format); - return 0; -} - -#define MBEDTLS_PLATFORM_STD_PRINTF platform_printf_uninit -#endif /* !MBEDTLS_PLATFORM_STD_PRINTF */ - -int (*mbedtls_printf)(const char *, ...) = MBEDTLS_PLATFORM_STD_PRINTF; - -int mbedtls_platform_set_printf(int (*printf_func)(const char *, ...)) -{ - mbedtls_printf = printf_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ - -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_fprintf_uninit(FILE *stream, const char *format, ...) -{ - ((void) stream); - ((void) format); - return 0; -} - -#define MBEDTLS_PLATFORM_STD_FPRINTF platform_fprintf_uninit -#endif /* !MBEDTLS_PLATFORM_STD_FPRINTF */ - -int (*mbedtls_fprintf)(FILE *, const char *, ...) = - MBEDTLS_PLATFORM_STD_FPRINTF; - -int mbedtls_platform_set_fprintf(int (*fprintf_func)(FILE *, const char *, ...)) -{ - mbedtls_fprintf = fprintf_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ - -#if defined(MBEDTLS_PLATFORM_SETBUF_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_SETBUF) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static void platform_setbuf_uninit(FILE *stream, char *buf) -{ - ((void) stream); - ((void) buf); -} - -#define MBEDTLS_PLATFORM_STD_SETBUF platform_setbuf_uninit -#endif /* !MBEDTLS_PLATFORM_STD_SETBUF */ -void (*mbedtls_setbuf)(FILE *stream, char *buf) = MBEDTLS_PLATFORM_STD_SETBUF; - -int mbedtls_platform_set_setbuf(void (*setbuf_func)(FILE *stream, char *buf)) -{ - mbedtls_setbuf = setbuf_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_SETBUF_ALT */ - -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_EXIT) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static void platform_exit_uninit(int status) -{ - ((void) status); -} - -#define MBEDTLS_PLATFORM_STD_EXIT platform_exit_uninit -#endif /* !MBEDTLS_PLATFORM_STD_EXIT */ - -void (*mbedtls_exit)(int status) = MBEDTLS_PLATFORM_STD_EXIT; - -int mbedtls_platform_set_exit(void (*exit_func)(int status)) -{ - mbedtls_exit = exit_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_EXIT_ALT */ - -#if defined(MBEDTLS_HAVE_TIME) - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_TIME) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static mbedtls_time_t platform_time_uninit(mbedtls_time_t *timer) -{ - ((void) timer); - return 0; -} - -#define MBEDTLS_PLATFORM_STD_TIME platform_time_uninit -#endif /* !MBEDTLS_PLATFORM_STD_TIME */ - -mbedtls_time_t (*mbedtls_time)(mbedtls_time_t *timer) = MBEDTLS_PLATFORM_STD_TIME; - -int mbedtls_platform_set_time(mbedtls_time_t (*time_func)(mbedtls_time_t *timer)) -{ - mbedtls_time = time_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_TIME_ALT */ - -#endif /* MBEDTLS_HAVE_TIME */ - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) -/* Default implementations for the platform independent seed functions use - * standard libc file functions to read from and write to a pre-defined filename - */ -int mbedtls_platform_std_nv_seed_read(unsigned char *buf, size_t buf_len) -{ - FILE *file; - size_t n; - - if ((file = fopen(MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "rb")) == NULL) { - return -1; - } - - /* Ensure no stdio buffering of secrets, as such buffers cannot be wiped. */ - mbedtls_setbuf(file, NULL); - - if ((n = fread(buf, 1, buf_len, file)) != buf_len) { - fclose(file); - mbedtls_platform_zeroize(buf, buf_len); - return -1; - } - - fclose(file); - return (int) n; -} - -int mbedtls_platform_std_nv_seed_write(unsigned char *buf, size_t buf_len) -{ - FILE *file; - size_t n; - - if ((file = fopen(MBEDTLS_PLATFORM_STD_NV_SEED_FILE, "w")) == NULL) { - return -1; - } - - /* Ensure no stdio buffering of secrets, as such buffers cannot be wiped. */ - mbedtls_setbuf(file, NULL); - - if ((n = fwrite(buf, 1, buf_len, file)) != buf_len) { - fclose(file); - return -1; - } - - fclose(file); - return (int) n; -} -#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_nv_seed_read_uninit(unsigned char *buf, size_t buf_len) -{ - ((void) buf); - ((void) buf_len); - return -1; -} - -#define MBEDTLS_PLATFORM_STD_NV_SEED_READ platform_nv_seed_read_uninit -#endif /* !MBEDTLS_PLATFORM_STD_NV_SEED_READ */ - -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) -/* - * Make dummy function to prevent NULL pointer dereferences - */ -static int platform_nv_seed_write_uninit(unsigned char *buf, size_t buf_len) -{ - ((void) buf); - ((void) buf_len); - return -1; -} - -#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE platform_nv_seed_write_uninit -#endif /* !MBEDTLS_PLATFORM_STD_NV_SEED_WRITE */ - -int (*mbedtls_nv_seed_read)(unsigned char *buf, size_t buf_len) = - MBEDTLS_PLATFORM_STD_NV_SEED_READ; -int (*mbedtls_nv_seed_write)(unsigned char *buf, size_t buf_len) = - MBEDTLS_PLATFORM_STD_NV_SEED_WRITE; - -int mbedtls_platform_set_nv_seed( - int (*nv_seed_read_func)(unsigned char *buf, size_t buf_len), - int (*nv_seed_write_func)(unsigned char *buf, size_t buf_len)) -{ - mbedtls_nv_seed_read = nv_seed_read_func; - mbedtls_nv_seed_write = nv_seed_write_func; - return 0; -} -#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ -#endif /* MBEDTLS_ENTROPY_NV_SEED */ - -#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) -/* - * Placeholder platform setup that does nothing by default - */ -int mbedtls_platform_setup(mbedtls_platform_context *ctx) -{ - (void) ctx; - - return 0; -} - -/* - * Placeholder platform teardown that does nothing by default - */ -void mbedtls_platform_teardown(mbedtls_platform_context *ctx) -{ - (void) ctx; -} -#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -#endif /* MBEDTLS_PLATFORM_C */ diff --git a/ext/oberon/psa/core/library/platform_util.c b/ext/oberon/psa/core/library/platform_util.c deleted file mode 100644 index 09216edfbca8..000000000000 --- a/ext/oberon/psa/core/library/platform_util.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Common and shared functions used by multiple modules in the Mbed TLS - * library. - * - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Ensure gmtime_r is available even with -std=c99; must be defined before - * mbedtls_config.h, which pulls in glibc's features.h. Harmless on other platforms - * except OpenBSD, where it stops us accessing explicit_bzero. - */ -#if !defined(_POSIX_C_SOURCE) && !defined(__OpenBSD__) -#define _POSIX_C_SOURCE 200112L -#endif - -#if !defined(_GNU_SOURCE) -/* Clang requires this to get support for explicit_bzero */ -#define _GNU_SOURCE -#endif - -#include "common.h" - -#include "mbedtls/platform_util.h" -#include "mbedtls/platform.h" -#include "mbedtls/threading.h" - -#include - -#ifndef __STDC_WANT_LIB_EXT1__ -#define __STDC_WANT_LIB_EXT1__ 1 /* Ask for the C11 gmtime_s() and memset_s() if available */ -#endif -#include - -#if defined(_WIN32) -#include -#endif - -// Detect platforms known to support explicit_bzero() -#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25) -#define MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO 1 -#elif (defined(__FreeBSD__) && (__FreeBSD_version >= 1100037)) || defined(__OpenBSD__) -#define MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO 1 -#endif - -#if !defined(MBEDTLS_PLATFORM_ZEROIZE_ALT) - -#undef HAVE_MEMORY_SANITIZER -#if defined(__has_feature) -#if __has_feature(memory_sanitizer) -#include -#define HAVE_MEMORY_SANITIZER -#endif -#endif - -/* - * Where possible, we try to detect the presence of a platform-provided - * secure memset, such as explicit_bzero(), that is safe against being optimized - * out, and use that. - * - * For other platforms, we provide an implementation that aims not to be - * optimized out by the compiler. - * - * This implementation for mbedtls_platform_zeroize() was inspired from Colin - * Percival's blog article at: - * - * http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html - * - * It uses a volatile function pointer to the standard memset(). Because the - * pointer is volatile the compiler expects it to change at - * any time and will not optimize out the call that could potentially perform - * other operations on the input buffer instead of just setting it to 0. - * Nevertheless, as pointed out by davidtgoldblatt on Hacker News - * (refer to http://www.daemonology.net/blog/2014-09-05-erratum.html for - * details), optimizations of the following form are still possible: - * - * if (memset_func != memset) - * memset_func(buf, 0, len); - * - * Note that it is extremely difficult to guarantee that - * the memset() call will not be optimized out by aggressive compilers - * in a portable way. For this reason, Mbed TLS also provides the configuration - * option MBEDTLS_PLATFORM_ZEROIZE_ALT, which allows users to configure - * mbedtls_platform_zeroize() to use a suitable implementation for their - * platform and needs. - */ -#if !defined(MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO) && !(defined(__STDC_LIB_EXT1__) && \ - !defined(__IAR_SYSTEMS_ICC__)) \ - && !defined(_WIN32) -static void *(*const volatile memset_func)(void *, int, size_t) = memset; -#endif - -void mbedtls_platform_zeroize(void *buf, size_t len) -{ - MBEDTLS_INTERNAL_VALIDATE(len == 0 || buf != NULL); - - if (len > 0) { -#if defined(MBEDTLS_PLATFORM_HAS_EXPLICIT_BZERO) - explicit_bzero(buf, len); -#if defined(HAVE_MEMORY_SANITIZER) - /* You'd think that Msan would recognize explicit_bzero() as - * equivalent to bzero(), but it actually doesn't on several - * platforms, including Linux (Ubuntu 20.04). - * https://github.com/google/sanitizers/issues/1507 - * https://github.com/openssh/openssh-portable/commit/74433a19bb6f4cef607680fa4d1d7d81ca3826aa - */ - __msan_unpoison(buf, len); -#endif -#elif defined(__STDC_LIB_EXT1__) && !defined(__IAR_SYSTEMS_ICC__) - memset_s(buf, len, 0, len); -#elif defined(_WIN32) - SecureZeroMemory(buf, len); -#else - memset_func(buf, 0, len); -#endif - -#if defined(__GNUC__) - /* For clang and recent gcc, pretend that we have some assembly that reads the - * zero'd memory as an additional protection against being optimised away. */ -#if defined(__clang__) || (__GNUC__ >= 10) -#if defined(__clang__) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wvla" -#elif defined(MBEDTLS_COMPILER_IS_GCC) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wvla" -#endif - asm volatile ("" : : "m" (*(char (*)[len]) buf) :); -#if defined(__clang__) -#pragma clang diagnostic pop -#elif defined(MBEDTLS_COMPILER_IS_GCC) -#pragma GCC diagnostic pop -#endif -#endif -#endif - } -} -#endif /* MBEDTLS_PLATFORM_ZEROIZE_ALT */ - -void mbedtls_zeroize_and_free(void *buf, size_t len) -{ - if (buf != NULL) { - mbedtls_platform_zeroize(buf, len); - } - - mbedtls_free(buf); -} - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) -#include -#if !defined(_WIN32) && (defined(unix) || \ - defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \ - defined(__MACH__))) -#include -#endif /* !_WIN32 && (unix || __unix || __unix__ || - * (__APPLE__ && __MACH__)) */ - -#if !((defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || \ - (defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \ - _POSIX_THREAD_SAFE_FUNCTIONS >= 200112L)) -/* - * This is a convenience shorthand macro to avoid checking the long - * preprocessor conditions above. Ideally, we could expose this macro in - * platform_util.h and simply use it in platform_util.c, threading.c and - * threading.h. However, this macro is not part of the Mbed TLS public API, so - * we keep it private by only defining it in this file - */ -#if !(defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)) || \ - (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) -#define PLATFORM_UTIL_USE_GMTIME -#endif - -#endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \ - ( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \ - _POSIX_THREAD_SAFE_FUNCTIONS >= 200112L ) ) */ - -struct tm *mbedtls_platform_gmtime_r(const mbedtls_time_t *tt, - struct tm *tm_buf) -{ -#if defined(_WIN32) && !defined(PLATFORM_UTIL_USE_GMTIME) -#if defined(__STDC_LIB_EXT1__) - return (gmtime_s(tt, tm_buf) == 0) ? NULL : tm_buf; -#else - /* MSVC and mingw64 argument order and return value are inconsistent with the C11 standard */ - return (gmtime_s(tm_buf, tt) == 0) ? tm_buf : NULL; -#endif -#elif !defined(PLATFORM_UTIL_USE_GMTIME) - return gmtime_r(tt, tm_buf); -#else - struct tm *lt; - -#if defined(MBEDTLS_THREADING_C) - if (mbedtls_mutex_lock(&mbedtls_threading_gmtime_mutex) != 0) { - return NULL; - } -#endif /* MBEDTLS_THREADING_C */ - - lt = gmtime(tt); - - if (lt != NULL) { - memcpy(tm_buf, lt, sizeof(struct tm)); - } - -#if defined(MBEDTLS_THREADING_C) - if (mbedtls_mutex_unlock(&mbedtls_threading_gmtime_mutex) != 0) { - return NULL; - } -#endif /* MBEDTLS_THREADING_C */ - - return (lt == NULL) ? NULL : tm_buf; -#endif /* _WIN32 && !EFIX64 && !EFI32 */ -} -#endif /* MBEDTLS_HAVE_TIME_DATE && MBEDTLS_PLATFORM_GMTIME_R_ALT */ - -#if defined(MBEDTLS_TEST_HOOKS) -void (*mbedtls_test_hook_test_fail)(const char *, int, const char *); -#endif /* MBEDTLS_TEST_HOOKS */ - -/* - * Provide external definitions of some inline functions so that the compiler - * has the option to not inline them - */ -extern inline void mbedtls_xor(unsigned char *r, - const unsigned char *a, - const unsigned char *b, - size_t n); - -extern inline uint16_t mbedtls_get_unaligned_uint16(const void *p); - -extern inline void mbedtls_put_unaligned_uint16(void *p, uint16_t x); - -extern inline uint32_t mbedtls_get_unaligned_uint32(const void *p); - -extern inline void mbedtls_put_unaligned_uint32(void *p, uint32_t x); - -extern inline uint64_t mbedtls_get_unaligned_uint64(const void *p); - -extern inline void mbedtls_put_unaligned_uint64(void *p, uint64_t x); - -#if defined(MBEDTLS_HAVE_TIME) && !defined(MBEDTLS_PLATFORM_MS_TIME_ALT) - -#include -#if !defined(_WIN32) && \ - (defined(unix) || defined(__unix) || defined(__unix__) || \ - (defined(__APPLE__) && defined(__MACH__))) -#include -#endif /* !_WIN32 && (unix || __unix || __unix__ || (__APPLE__ && __MACH__)) */ -#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 199309L) -mbedtls_ms_time_t mbedtls_ms_time(void) -{ - int ret; - struct timespec tv; - mbedtls_ms_time_t current_ms; - -#if defined(__linux__) - ret = clock_gettime(CLOCK_BOOTTIME, &tv); -#else - ret = clock_gettime(CLOCK_MONOTONIC, &tv); -#endif - if (ret) { - return time(NULL) * 1000; - } - - current_ms = tv.tv_sec; - - return current_ms*1000 + tv.tv_nsec / 1000000; -} -#elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || \ - defined(__MINGW32__) || defined(_WIN64) -#include -mbedtls_ms_time_t mbedtls_ms_time(void) -{ - FILETIME ct; - mbedtls_ms_time_t current_ms; - - GetSystemTimeAsFileTime(&ct); - current_ms = ((mbedtls_ms_time_t) ct.dwLowDateTime + - ((mbedtls_ms_time_t) (ct.dwHighDateTime) << 32LL))/10000; - return current_ms; -} -#else -#error "No mbedtls_ms_time available" -#endif -#endif /* MBEDTLS_HAVE_TIME && !MBEDTLS_PLATFORM_MS_TIME_ALT */ diff --git a/ext/oberon/psa/core/library/psa_crypto.c b/ext/oberon/psa/core/library/psa_crypto.c deleted file mode 100644 index 7f0f6ae9eb5c..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto.c +++ /dev/null @@ -1,5279 +0,0 @@ -/* - * PSA crypto layer on top of Mbed TLS crypto - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#include "common.h" -#include "psa_crypto_core_common.h" - -#if defined(MBEDTLS_PSA_CRYPTO_C) - -#if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -#include "check_crypto_config.h" -#endif - -#include "psa/crypto.h" -#include "psa/crypto_values.h" -#include "psa_crypto_core.h" -#include "psa_crypto_driver_wrappers.h" -#include "psa_crypto_driver_wrappers_no_static.h" -#include "psa_crypto_slot_management.h" -/* Include internal declarations that are useful for implementing persistently - * stored keys. */ -#include "psa_crypto_storage.h" - -#include "psa_crypto_random_impl.h" - -#include -#include -#include "mbedtls/platform.h" -#include "mbedtls/constant_time.h" -#include "mbedtls/cipher.h" // mbedtls_operation_t - - -#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) -#include "tfm_builtin_key_loader.h" -#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */ - -/****************************************************************/ -/* Global data, support functions and library management */ -/****************************************************************/ - -static int key_type_is_raw_bytes(psa_key_type_t type) -{ - return PSA_KEY_TYPE_IS_UNSTRUCTURED(type); -} - -/* Values for psa_global_data_t::rng_state */ -#define RNG_NOT_INITIALIZED 0 -#define RNG_INITIALIZED 1 -#define RNG_SEEDED 2 - -typedef struct { - uint8_t initialized; - uint8_t drivers_initialized; - psa_driver_random_context_t rng; -} psa_global_data_t; - -static psa_global_data_t global_data; - -#ifdef MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG -void* const mbedtls_psa_random_state = NULL; /* !!OM - used by some tests */ -#else -mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state = NULL; /* !!OM - used by some tests */ -#endif - -#define GUARD_MODULE_INITIALIZED \ - if (global_data.initialized == 0) \ - return PSA_ERROR_BAD_STATE; - -int psa_can_do_hash(psa_algorithm_t hash_alg) -{ - (void) hash_alg; - return global_data.drivers_initialized; -} - -/** - * \brief For output buffers which contain "tags" - * (outputs that may be checked for validity like - * hashes, MACs and signatures), fill the unused - * part of the output buffer (the whole buffer on - * error, the trailing part on success) with - * something that isn't a valid tag (barring an - * attack on the tag and deliberately-crafted - * input), in case the caller doesn't check the - * return status properly. - * - * \param output_buffer Pointer to buffer to wipe. May not be NULL - * unless \p output_buffer_size is zero. - * \param status Status of function called to generate - * output_buffer originally - * \param output_buffer_size Size of output buffer. If zero, \p output_buffer - * could be NULL. - * \param output_buffer_length Length of data written to output_buffer, must be - * less than \p output_buffer_size - */ -static void psa_wipe_tag_output_buffer(uint8_t *output_buffer, psa_status_t status, - size_t output_buffer_size, size_t output_buffer_length) -{ - size_t offset = 0; - - if (output_buffer_size == 0) { - /* If output_buffer_size is 0 then we have nothing to do. We must not - call memset because output_buffer may be NULL in this case */ - return; - } - - if (status == PSA_SUCCESS) { - offset = output_buffer_length; - } - - memset(output_buffer + offset, '!', output_buffer_size - offset); -} - - -/****************************************************************/ -/* Key management */ -/****************************************************************/ - -psa_status_t psa_validate_unstructured_key_bit_size(psa_key_type_t type, - size_t bits) -{ - /* Check that the bit size is acceptable for the key type */ - switch (type) { - case PSA_KEY_TYPE_RAW_DATA: - case PSA_KEY_TYPE_HMAC: - case PSA_KEY_TYPE_DERIVE: - case PSA_KEY_TYPE_PASSWORD: - case PSA_KEY_TYPE_PASSWORD_HASH: - case PSA_KEY_TYPE_PEPPER: - break; -#if defined(PSA_WANT_KEY_TYPE_AES) - case PSA_KEY_TYPE_AES: - if (bits != 128 && bits != 192 && bits != 256) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif -#if defined(PSA_WANT_KEY_TYPE_ARIA) - case PSA_KEY_TYPE_ARIA: - if (bits != 128 && bits != 192 && bits != 256) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif -#if defined(PSA_WANT_KEY_TYPE_CAMELLIA) - case PSA_KEY_TYPE_CAMELLIA: - if (bits != 128 && bits != 192 && bits != 256) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif -#if defined(PSA_WANT_KEY_TYPE_DES) - case PSA_KEY_TYPE_DES: - if (bits != 64 && bits != 128 && bits != 192) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif -#if defined(PSA_WANT_KEY_TYPE_CHACHA20) - case PSA_KEY_TYPE_CHACHA20: - if (bits != 256) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (bits % 8 != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -/** Check whether a given key type is valid for use with a given MAC algorithm - * - * Upon successful return of this function, the behavior of #PSA_MAC_LENGTH - * when called with the validated \p algorithm and \p key_type is well-defined. - * - * \param[in] algorithm The specific MAC algorithm (can be wildcard). - * \param[in] key_type The key type of the key to be used with the - * \p algorithm. - * - * \retval #PSA_SUCCESS - * The \p key_type is valid for use with the \p algorithm - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The \p key_type is not valid for use with the \p algorithm - */ -MBEDTLS_STATIC_TESTABLE psa_status_t psa_mac_key_can_do( - psa_algorithm_t algorithm, - psa_key_type_t key_type) -{ - if (PSA_ALG_IS_HMAC(algorithm)) { - if (key_type == PSA_KEY_TYPE_HMAC) { - return PSA_SUCCESS; - } - } - - if (PSA_ALG_IS_BLOCK_CIPHER_MAC(algorithm)) { - /* Check that we're calling PSA_BLOCK_CIPHER_BLOCK_LENGTH with a cipher - * key. */ - if ((key_type & PSA_KEY_TYPE_CATEGORY_MASK) == - PSA_KEY_TYPE_CATEGORY_SYMMETRIC) { - /* PSA_BLOCK_CIPHER_BLOCK_LENGTH returns 1 for stream ciphers and - * the block length (larger than 1) for block ciphers. */ - if (PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) > 1) { - return PSA_SUCCESS; - } - } - } - - return PSA_ERROR_INVALID_ARGUMENT; -} - -psa_status_t psa_allocate_buffer_to_slot(psa_key_slot_t *slot, - size_t buffer_length) -{ - if (slot->key.data != NULL) { - return PSA_ERROR_ALREADY_EXISTS; - } - - slot->key.data = mbedtls_calloc(1, buffer_length); - if (slot->key.data == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - - slot->key.bytes = buffer_length; - return PSA_SUCCESS; -} - -psa_status_t psa_copy_key_material_into_slot(psa_key_slot_t *slot, - const uint8_t *data, - size_t data_length) -{ - psa_status_t status = psa_allocate_buffer_to_slot(slot, - data_length); - if (status != PSA_SUCCESS) { - return status; - } - - memcpy(slot->key.data, data, data_length); - return PSA_SUCCESS; -} - -psa_status_t psa_import_key_into_slot( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key_buffer, size_t key_buffer_size, - size_t *key_buffer_length, size_t *bits) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_type_t type = attributes->core.type; - - /* zero-length keys are never supported. */ - if (data_length == 0) { - return PSA_ERROR_NOT_SUPPORTED; - } - - if (key_type_is_raw_bytes(type)) { - *bits = PSA_BYTES_TO_BITS(data_length); - - status = psa_validate_unstructured_key_bit_size(attributes->core.type, - *bits); - if (status != PSA_SUCCESS) { - return status; - } - - /* Copy the key material. */ - memcpy(key_buffer, data, data_length); - *key_buffer_length = data_length; - (void) key_buffer_size; - - return PSA_SUCCESS; - } - - return PSA_ERROR_NOT_SUPPORTED; -} - -/** Calculate the intersection of two algorithm usage policies. - * - * Return 0 (which allows no operation) on incompatibility. - */ -static psa_algorithm_t psa_key_policy_algorithm_intersection( - psa_key_type_t key_type, - psa_algorithm_t alg1, - psa_algorithm_t alg2) -{ - /* Common case: both sides actually specify the same policy. */ - if (alg1 == alg2) { - return alg1; - } - /* If the policies are from the same hash-and-sign family, check - * if one is a wildcard. If so the other has the specific algorithm. */ - if (PSA_ALG_IS_SIGN_HASH(alg1) && - PSA_ALG_IS_SIGN_HASH(alg2) && - (alg1 & ~PSA_ALG_HASH_MASK) == (alg2 & ~PSA_ALG_HASH_MASK)) { - if (PSA_ALG_SIGN_GET_HASH(alg1) == PSA_ALG_ANY_HASH) { - return alg2; - } - if (PSA_ALG_SIGN_GET_HASH(alg2) == PSA_ALG_ANY_HASH) { - return alg1; - } - } - /* If the policies are from the same AEAD family, check whether - * one of them is a minimum-tag-length wildcard. Calculate the most - * restrictive tag length. */ - if (PSA_ALG_IS_AEAD(alg1) && PSA_ALG_IS_AEAD(alg2) && - (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg1, 0) == - PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg2, 0))) { - size_t alg1_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg1); - size_t alg2_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg2); - size_t restricted_len = alg1_len > alg2_len ? alg1_len : alg2_len; - - /* If both are wildcards, return most restrictive wildcard */ - if (((alg1 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0) && - ((alg2 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0)) { - return PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG( - alg1, restricted_len); - } - /* If only one is a wildcard, return specific algorithm if compatible. */ - if (((alg1 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0) && - (alg1_len <= alg2_len)) { - return alg2; - } - if (((alg2 & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0) && - (alg2_len <= alg1_len)) { - return alg1; - } - } - /* If the policies are from the same MAC family, check whether one - * of them is a minimum-MAC-length policy. Calculate the most - * restrictive tag length. */ - if (PSA_ALG_IS_MAC(alg1) && PSA_ALG_IS_MAC(alg2) && - (PSA_ALG_FULL_LENGTH_MAC(alg1) == - PSA_ALG_FULL_LENGTH_MAC(alg2))) { - /* Validate the combination of key type and algorithm. Since the base - * algorithm of alg1 and alg2 are the same, we only need this once. */ - if (PSA_SUCCESS != psa_mac_key_can_do(alg1, key_type)) { - return 0; - } - - /* Get the (exact or at-least) output lengths for both sides of the - * requested intersection. None of the currently supported algorithms - * have an output length dependent on the actual key size, so setting it - * to a bogus value of 0 is currently OK. - * - * Note that for at-least-this-length wildcard algorithms, the output - * length is set to the shortest allowed length, which allows us to - * calculate the most restrictive tag length for the intersection. */ - size_t alg1_len = PSA_MAC_LENGTH(key_type, 0, alg1); - size_t alg2_len = PSA_MAC_LENGTH(key_type, 0, alg2); - size_t restricted_len = alg1_len > alg2_len ? alg1_len : alg2_len; - - /* If both are wildcards, return most restrictive wildcard */ - if (((alg1 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) && - ((alg2 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0)) { - return PSA_ALG_AT_LEAST_THIS_LENGTH_MAC(alg1, restricted_len); - } - - /* If only one is an at-least-this-length policy, the intersection would - * be the other (fixed-length) policy as long as said fixed length is - * equal to or larger than the shortest allowed length. */ - if ((alg1 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) { - return (alg1_len <= alg2_len) ? alg2 : 0; - } - if ((alg2 & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) { - return (alg2_len <= alg1_len) ? alg1 : 0; - } - - /* If none of them are wildcards, check whether they define the same tag - * length. This is still possible here when one is default-length and - * the other specific-length. Ensure to always return the - * specific-length version for the intersection. */ - if (alg1_len == alg2_len) { - return PSA_ALG_TRUNCATED_MAC(alg1, alg1_len); - } - } - /* If the policies are incompatible, allow nothing. */ - return 0; -} - -static int psa_key_algorithm_permits(psa_key_type_t key_type, - psa_algorithm_t policy_alg, - psa_algorithm_t requested_alg) -{ - /* Common case: the policy only allows requested_alg. */ - if (requested_alg == policy_alg) { - return 1; - } - /* If policy_alg is a hash-and-sign with a wildcard for the hash, - * and requested_alg is the same hash-and-sign family with any hash, - * then requested_alg is compliant with policy_alg. */ - if (PSA_ALG_IS_SIGN_HASH(requested_alg) && - PSA_ALG_SIGN_GET_HASH(policy_alg) == PSA_ALG_ANY_HASH) { - return (policy_alg & ~PSA_ALG_HASH_MASK) == - (requested_alg & ~PSA_ALG_HASH_MASK); - } - /* If policy_alg is a wildcard AEAD algorithm of the same base as - * the requested algorithm, check the requested tag length to be - * equal-length or longer than the wildcard-specified length. */ - if (PSA_ALG_IS_AEAD(policy_alg) && - PSA_ALG_IS_AEAD(requested_alg) && - (PSA_ALG_AEAD_WITH_SHORTENED_TAG(policy_alg, 0) == - PSA_ALG_AEAD_WITH_SHORTENED_TAG(requested_alg, 0)) && - ((policy_alg & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) != 0)) { - return PSA_ALG_AEAD_GET_TAG_LENGTH(policy_alg) <= - PSA_ALG_AEAD_GET_TAG_LENGTH(requested_alg); - } - /* If policy_alg is a MAC algorithm of the same base as the requested - * algorithm, check whether their MAC lengths are compatible. */ - if (PSA_ALG_IS_MAC(policy_alg) && - PSA_ALG_IS_MAC(requested_alg) && - (PSA_ALG_FULL_LENGTH_MAC(policy_alg) == - PSA_ALG_FULL_LENGTH_MAC(requested_alg))) { - /* Validate the combination of key type and algorithm. Since the policy - * and requested algorithms are the same, we only need this once. */ - if (PSA_SUCCESS != psa_mac_key_can_do(policy_alg, key_type)) { - return 0; - } - - /* Get both the requested output length for the algorithm which is to be - * verified, and the default output length for the base algorithm. - * Note that none of the currently supported algorithms have an output - * length dependent on actual key size, so setting it to a bogus value - * of 0 is currently OK. */ - size_t requested_output_length = PSA_MAC_LENGTH( - key_type, 0, requested_alg); - size_t default_output_length = PSA_MAC_LENGTH( - key_type, 0, - PSA_ALG_FULL_LENGTH_MAC(requested_alg)); - - /* If the policy is default-length, only allow an algorithm with - * a declared exact-length matching the default. */ - if (PSA_MAC_TRUNCATED_LENGTH(policy_alg) == 0) { - return requested_output_length == default_output_length; - } - - /* If the requested algorithm is default-length, allow it if the policy - * length exactly matches the default length. */ - if (PSA_MAC_TRUNCATED_LENGTH(requested_alg) == 0 && - PSA_MAC_TRUNCATED_LENGTH(policy_alg) == default_output_length) { - return 1; - } - - /* If policy_alg is an at-least-this-length wildcard MAC algorithm, - * check for the requested MAC length to be equal to or longer than the - * minimum allowed length. */ - if ((policy_alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) != 0) { - return PSA_MAC_TRUNCATED_LENGTH(policy_alg) <= - requested_output_length; - } - } - /* If policy_alg is a generic key agreement operation, then using it for - * a key derivation with that key agreement should also be allowed. This - * behaviour is expected to be defined in a future specification version. */ - if (PSA_ALG_IS_RAW_KEY_AGREEMENT(policy_alg) && - PSA_ALG_IS_KEY_AGREEMENT(requested_alg)) { - return PSA_ALG_KEY_AGREEMENT_GET_BASE(requested_alg) == - policy_alg; - } - /* If it isn't explicitly permitted, it's forbidden. */ - return 0; -} - -/** Test whether a policy permits an algorithm. - * - * The caller must test usage flags separately. - * - * \note This function requires providing the key type for which the policy is - * being validated, since some algorithm policy definitions (e.g. MAC) - * have different properties depending on what kind of cipher it is - * combined with. - * - * \retval PSA_SUCCESS When \p alg is a specific algorithm - * allowed by the \p policy. - * \retval PSA_ERROR_INVALID_ARGUMENT When \p alg is not a specific algorithm - * \retval PSA_ERROR_NOT_PERMITTED When \p alg is a specific algorithm, but - * the \p policy does not allow it. - */ -static psa_status_t psa_key_policy_permits(const psa_key_policy_t *policy, - psa_key_type_t key_type, - psa_algorithm_t alg) -{ - /* '0' is not a valid algorithm */ - if (alg == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - /* A requested algorithm cannot be a wildcard. */ - if (PSA_ALG_IS_WILDCARD(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (psa_key_algorithm_permits(key_type, policy->alg, alg) || - psa_key_algorithm_permits(key_type, policy->alg2, alg)) { - return PSA_SUCCESS; - } else { - return PSA_ERROR_NOT_PERMITTED; - } -} - -/** Restrict a key policy based on a constraint. - * - * \note This function requires providing the key type for which the policy is - * being restricted, since some algorithm policy definitions (e.g. MAC) - * have different properties depending on what kind of cipher it is - * combined with. - * - * \param[in] key_type The key type for which to restrict the policy - * \param[in,out] policy The policy to restrict. - * \param[in] constraint The policy constraint to apply. - * - * \retval #PSA_SUCCESS - * \c *policy contains the intersection of the original value of - * \c *policy and \c *constraint. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \c key_type, \c *policy and \c *constraint are incompatible. - * \c *policy is unchanged. - */ -static psa_status_t psa_restrict_key_policy( - psa_key_type_t key_type, - psa_key_policy_t *policy, - const psa_key_policy_t *constraint) -{ - psa_algorithm_t intersection_alg = - psa_key_policy_algorithm_intersection(key_type, policy->alg, - constraint->alg); - psa_algorithm_t intersection_alg2 = - psa_key_policy_algorithm_intersection(key_type, policy->alg2, - constraint->alg2); - if (intersection_alg == 0 && policy->alg != 0 && constraint->alg != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - if (intersection_alg2 == 0 && policy->alg2 != 0 && constraint->alg2 != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - policy->usage &= constraint->usage; - policy->alg = intersection_alg; - policy->alg2 = intersection_alg2; - return PSA_SUCCESS; -} - -/** Get the description of a key given its identifier and policy constraints - * and lock it. - * - * The key must have allow all the usage flags set in \p usage. If \p alg is - * nonzero, the key must allow operations with this algorithm. If \p alg is - * zero, the algorithm is not checked. - * - * In case of a persistent key, the function loads the description of the key - * into a key slot if not already done. - * - * On success, the returned key slot is locked. It is the responsibility of - * the caller to unlock the key slot when it does not access it anymore. - */ -static psa_status_t psa_get_and_lock_key_slot_with_policy( - mbedtls_svc_key_id_t key, - psa_key_slot_t **p_slot, - psa_key_usage_t usage, - psa_algorithm_t alg) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - - status = psa_get_and_lock_key_slot(key, p_slot); - if (status != PSA_SUCCESS) { - return status; - } - slot = *p_slot; - - /* Enforce that usage policy for the key slot contains all the flags - * required by the usage parameter. There is one exception: public - * keys can always be exported, so we treat public key objects as - * if they had the export flag. */ - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(slot->attr.type)) { - usage &= ~PSA_KEY_USAGE_EXPORT; - } - - if ((slot->attr.policy.usage & usage) != usage) { - status = PSA_ERROR_NOT_PERMITTED; - goto error; - } - - /* Enforce that the usage policy permits the requested algorithm. */ - if (alg != 0) { - status = psa_key_policy_permits(&slot->attr.policy, - slot->attr.type, - alg); - if (status != PSA_SUCCESS) { - goto error; - } - } - - return PSA_SUCCESS; - -error: - *p_slot = NULL; - psa_unlock_key_slot(slot); - - return status; -} - -/** Get a key slot containing a transparent key and lock it. - * - * A transparent key is a key for which the key material is directly - * available, as opposed to a key in a secure element and/or to be used - * by a secure element. - * - * This is a temporary function that may be used instead of - * psa_get_and_lock_key_slot_with_policy() when there is no opaque key support - * for a cryptographic operation. - * - * On success, the returned key slot is locked. It is the responsibility of the - * caller to unlock the key slot when it does not access it anymore. - */ -static psa_status_t psa_get_and_lock_transparent_key_slot_with_policy( - mbedtls_svc_key_id_t key, - psa_key_slot_t **p_slot, - psa_key_usage_t usage, - psa_algorithm_t alg) -{ - psa_status_t status = psa_get_and_lock_key_slot_with_policy(key, p_slot, - usage, alg); - if (status != PSA_SUCCESS) { - return status; - } - - if (psa_key_lifetime_is_external((*p_slot)->attr.lifetime) -#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) - && PSA_KEY_LIFETIME_GET_LOCATION((*p_slot)->attr.lifetime) != TFM_BUILTIN_KEY_LOADER_KEY_LOCATION -#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */ - ) { - psa_unlock_key_slot(*p_slot); - *p_slot = NULL; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t psa_remove_key_data_from_memory(psa_key_slot_t *slot) -{ - if (slot->key.data != NULL) { - mbedtls_zeroize_and_free(slot->key.data, slot->key.bytes); - } - - slot->key.data = NULL; - slot->key.bytes = 0; - - return PSA_SUCCESS; -} - -/** Completely wipe a slot in memory, including its policy. - * Persistent storage is not affected. */ -psa_status_t psa_wipe_key_slot(psa_key_slot_t *slot) -{ - psa_status_t status = psa_remove_key_data_from_memory(slot); - - /* - * As the return error code may not be handled in case of multiple errors, - * do our best to report an unexpected lock counter. Assert with - * MBEDTLS_TEST_HOOK_TEST_ASSERT that the lock counter is equal to one: - * if the MBEDTLS_TEST_HOOKS configuration option is enabled and the - * function is called as part of the execution of a test suite, the - * execution of the test suite is stopped in error if the assertion fails. - */ - if (slot->lock_count != 1) { - MBEDTLS_TEST_HOOK_TEST_ASSERT(slot->lock_count == 1); - status = PSA_ERROR_CORRUPTION_DETECTED; - } - - /* Multipart operations may still be using the key. This is safe - * because all multipart operation objects are independent from - * the key slot: if they need to access the key after the setup - * phase, they have a copy of the key. Note that this means that - * key material can linger until all operations are completed. */ - /* At this point, key material and other type-specific content has - * been wiped. Clear remaining metadata. We can call memset and not - * zeroize because the metadata is not particularly sensitive. */ - memset(slot, 0, sizeof(*slot)); - return status; -} - -psa_status_t psa_destroy_key(mbedtls_svc_key_id_t key) -{ - psa_key_slot_t *slot; - psa_status_t status; /* status of the last operation */ - psa_status_t overall_status = PSA_SUCCESS; - - if (mbedtls_svc_key_id_is_null(key)) { - return PSA_SUCCESS; - } - - /* - * Get the description of the key in a key slot. In case of a persistent - * key, this will load the key description from persistent memory if not - * done yet. We cannot avoid this loading as without it we don't know if - * the key is operated by an SE or not and this information is needed by - * the current implementation. - */ - status = psa_get_and_lock_key_slot(key, &slot); - if (status != PSA_SUCCESS) { - return status; - } - - /* - * If the key slot containing the key description is under access by the - * library (apart from the present access), the key cannot be destroyed - * yet. For the time being, just return in error. Eventually (to be - * implemented), the key should be destroyed when all accesses have - * stopped. - */ - if (slot->lock_count > 1) { - psa_unlock_key_slot(slot); - return PSA_ERROR_GENERIC_ERROR; - } - - if (PSA_KEY_LIFETIME_IS_READ_ONLY(slot->attr.lifetime)) { - /* Refuse the destruction of a read-only key (which may or may not work - * if we attempt it, depending on whether the key is merely read-only - * by policy or actually physically read-only). - * Just do the best we can, which is to wipe the copy in memory - * (done in this function's cleanup code). */ - overall_status = PSA_ERROR_NOT_PERMITTED; - goto exit; - } - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) - if (!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) { - status = psa_destroy_persistent_key(slot->attr.id); - if (overall_status == PSA_SUCCESS) { - overall_status = status; - } - - /* TODO: other slots may have a copy of the same key. We should - * invalidate them. - * https://github.com/ARMmbed/mbed-crypto/issues/214 - */ - } -#endif /* defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) */ - -exit: - status = psa_wipe_key_slot(slot); - /* Prioritize CORRUPTION_DETECTED from wiping over a storage error */ - if (status != PSA_SUCCESS) { - overall_status = status; - } - return overall_status; -} - - -/** Retrieve all the publicly-accessible attributes of a key. - */ -psa_status_t psa_get_key_attributes(mbedtls_svc_key_id_t key, - psa_key_attributes_t *attributes) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - - psa_reset_key_attributes(attributes); - - status = psa_get_and_lock_key_slot_with_policy(key, &slot, 0, 0); - if (status != PSA_SUCCESS) { - return status; - } - - attributes->core = slot->attr; - attributes->core.flags &= (MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY | - MBEDTLS_PSA_KA_MASK_DUAL_USE); - - if (status != PSA_SUCCESS) { - psa_reset_key_attributes(attributes); - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -static psa_status_t psa_export_key_buffer_internal(const uint8_t *key_buffer, - size_t key_buffer_size, - uint8_t *data, - size_t data_size, - size_t *data_length) -{ - if (key_buffer_size > data_size) { - return PSA_ERROR_BUFFER_TOO_SMALL; - } - memcpy(data, key_buffer, key_buffer_size); - memset(data + key_buffer_size, 0, - data_size - key_buffer_size); - *data_length = key_buffer_size; - return PSA_SUCCESS; -} - -psa_status_t psa_export_key_internal( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length) -{ - psa_key_type_t type = attributes->core.type; - - if (key_type_is_raw_bytes(type) || - PSA_KEY_TYPE_IS_RSA(type) || - PSA_KEY_TYPE_IS_ECC(type) || - PSA_KEY_TYPE_IS_SPAKE2P(type) || - PSA_KEY_TYPE_IS_SRP(type)) { - return psa_export_key_buffer_internal( - key_buffer, key_buffer_size, - data, data_size, data_length); - } else { - /* This shouldn't happen in the reference implementation, but - it is valid for a special-purpose implementation to omit - support for exporting certain key types. */ - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t psa_export_key(mbedtls_svc_key_id_t key, - uint8_t *data, - size_t data_size, - size_t *data_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - /* Reject a zero-length output buffer now, since this can never be a - * valid key representation. This way we know that data must be a valid - * pointer and we can do things like memset(data, ..., data_size). */ - if (data_size == 0) { - return PSA_ERROR_BUFFER_TOO_SMALL; - } - - /* Set the key to empty now, so that even when there are errors, we always - * set data_length to a value between 0 and data_size. On error, setting - * the key to empty is a good choice because an empty key representation is - * unlikely to be accepted anywhere. */ - *data_length = 0; - - /* Export requires the EXPORT flag. There is an exception for public keys, - * which don't require any flag, but - * psa_get_and_lock_key_slot_with_policy() takes care of this. - */ - status = psa_get_and_lock_key_slot_with_policy(key, &slot, - PSA_KEY_USAGE_EXPORT, 0); - if (status != PSA_SUCCESS) { - return status; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - status = psa_driver_wrapper_export_key(&attributes, - slot->key.data, slot->key.bytes, - data, data_size, data_length); - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_export_public_key_internal( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - uint8_t *data, - size_t data_size, - size_t *data_length) -{ - psa_key_type_t type = attributes->core.type; - - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) && - (PSA_KEY_TYPE_IS_RSA(type) || PSA_KEY_TYPE_IS_ECC(type) || - PSA_KEY_TYPE_IS_DH(type) || PSA_KEY_TYPE_IS_SPAKE2P(type) || - PSA_KEY_TYPE_IS_SRP(type))) { - /* Exporting public -> public */ - return psa_export_key_buffer_internal( - key_buffer, key_buffer_size, - data, data_size, data_length); - } else if (PSA_KEY_TYPE_IS_RSA(type)) { - /* We don't know how to convert a private RSA key to public. */ - return PSA_ERROR_NOT_SUPPORTED; - } else if (PSA_KEY_TYPE_IS_ECC(type)) { - /* We don't know how to convert a private ECC key to public */ - return PSA_ERROR_NOT_SUPPORTED; - } else if (PSA_KEY_TYPE_IS_DH(type)) { - return PSA_ERROR_NOT_SUPPORTED; - } else { - (void) key_buffer; - (void) key_buffer_size; - (void) data; - (void) data_size; - (void) data_length; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t psa_export_public_key(mbedtls_svc_key_id_t key, - uint8_t *data, - size_t data_size, - size_t *data_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - /* Reject a zero-length output buffer now, since this can never be a - * valid key representation. This way we know that data must be a valid - * pointer and we can do things like memset(data, ..., data_size). */ - if (data_size == 0) { - return PSA_ERROR_BUFFER_TOO_SMALL; - } - - /* Set the key to empty now, so that even when there are errors, we always - * set data_length to a value between 0 and data_size. On error, setting - * the key to empty is a good choice because an empty key representation is - * unlikely to be accepted anywhere. */ - *data_length = 0; - - /* Exporting a public key doesn't require a usage flag. */ - status = psa_get_and_lock_key_slot_with_policy(key, &slot, 0, 0); - if (status != PSA_SUCCESS) { - return status; - } - - if (!PSA_KEY_TYPE_IS_ASYMMETRIC(slot->attr.type)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - status = psa_driver_wrapper_export_public_key( - &attributes, slot->key.data, slot->key.bytes, - data, data_size, data_length); - -exit: - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -MBEDTLS_STATIC_ASSERT( - (MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY & MBEDTLS_PSA_KA_MASK_DUAL_USE) == 0, - "One or more key attribute flag is listed as both external-only and dual-use") -MBEDTLS_STATIC_ASSERT( - (PSA_KA_MASK_INTERNAL_ONLY & MBEDTLS_PSA_KA_MASK_DUAL_USE) == 0, - "One or more key attribute flag is listed as both internal-only and dual-use") -MBEDTLS_STATIC_ASSERT( - (PSA_KA_MASK_INTERNAL_ONLY & MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY) == 0, - "One or more key attribute flag is listed as both internal-only and external-only") - -/** Validate that a key policy is internally well-formed. - * - * This function only rejects invalid policies. It does not validate the - * consistency of the policy with respect to other attributes of the key - * such as the key type. - */ -static psa_status_t psa_validate_key_policy(const psa_key_policy_t *policy) -{ - if ((policy->usage & ~(PSA_KEY_USAGE_EXPORT | - PSA_KEY_USAGE_COPY | - PSA_KEY_USAGE_ENCRYPT | - PSA_KEY_USAGE_DECRYPT | - PSA_KEY_USAGE_SIGN_MESSAGE | - PSA_KEY_USAGE_VERIFY_MESSAGE | - PSA_KEY_USAGE_SIGN_HASH | - PSA_KEY_USAGE_VERIFY_HASH | - PSA_KEY_USAGE_VERIFY_DERIVATION | - PSA_KEY_USAGE_DERIVE)) != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -/** Validate the internal consistency of key attributes. - * - * This function only rejects invalid attribute values. If does not - * validate the consistency of the attributes with any key data that may - * be involved in the creation of the key. - * - * Call this function early in the key creation process. - * - * \param[in] attributes Key attributes for the new key. - * \param[out] p_drv On any return, the driver for the key, if any. - * NULL for a transparent key. - * - */ -static psa_status_t psa_validate_key_attributes( - const psa_key_attributes_t *attributes, - psa_se_drv_table_entry_t **p_drv) -{ - psa_status_t status = PSA_ERROR_INVALID_ARGUMENT; - psa_key_lifetime_t lifetime = psa_get_key_lifetime(attributes); - mbedtls_svc_key_id_t key = psa_get_key_id(attributes); - - status = psa_validate_key_location(lifetime, p_drv); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_validate_key_persistence(lifetime); - if (status != PSA_SUCCESS) { - return status; - } - - if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) { - if (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key) != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } else { - if (!psa_is_valid_key_id(psa_get_key_id(attributes), 0)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - - status = psa_validate_key_policy(&attributes->core.policy); - if (status != PSA_SUCCESS) { - return status; - } - - /* Refuse to create overly large keys. - * Note that this doesn't trigger on import if the attributes don't - * explicitly specify a size (so psa_get_key_bits returns 0), so - * psa_import_key() needs its own checks. */ - if (psa_get_key_bits(attributes) > PSA_MAX_KEY_BITS) { - return PSA_ERROR_NOT_SUPPORTED; - } - - /* Reject invalid flags. These should not be reachable through the API. */ - if (attributes->core.flags & ~(MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY | - MBEDTLS_PSA_KA_MASK_DUAL_USE)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -/** Prepare a key slot to receive key material. - * - * This function allocates a key slot and sets its metadata. - * - * If this function fails, call psa_fail_key_creation(). - * - * This function is intended to be used as follows: - * -# Call psa_start_key_creation() to allocate a key slot, prepare - * it with the specified attributes, and in case of a volatile key assign it - * a volatile key identifier. - * -# Populate the slot with the key material. - * -# Call psa_finish_key_creation() to finalize the creation of the slot. - * In case of failure at any step, stop the sequence and call - * psa_fail_key_creation(). - * - * On success, the key slot is locked. It is the responsibility of the caller - * to unlock the key slot when it does not access it anymore. - * - * \param method An identification of the calling function. - * \param[in] attributes Key attributes for the new key. - * \param[out] p_slot On success, a pointer to the prepared slot. - * \param[out] p_drv On any return, the driver for the key, if any. - * NULL for a transparent key. - * - * \retval #PSA_SUCCESS - * The key slot is ready to receive key material. - * \return If this function fails, the key slot is an invalid state. - * You must call psa_fail_key_creation() to wipe and free the slot. - */ -static psa_status_t psa_start_key_creation( - psa_key_creation_method_t method, - const psa_key_attributes_t *attributes, - psa_key_slot_t **p_slot, - psa_se_drv_table_entry_t **p_drv) -{ - psa_status_t status; - psa_key_id_t volatile_key_id; - psa_key_slot_t *slot; - - (void) method; - *p_drv = NULL; - - status = psa_validate_key_attributes(attributes, p_drv); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_get_empty_key_slot(&volatile_key_id, p_slot); - if (status != PSA_SUCCESS) { - return status; - } - slot = *p_slot; - - /* We're storing the declared bit-size of the key. It's up to each - * creation mechanism to verify that this information is correct. - * It's automatically correct for mechanisms that use the bit-size as - * an input (generate, device) but not for those where the bit-size - * is optional (import, copy). In case of a volatile key, assign it the - * volatile key identifier associated to the slot returned to contain its - * definition. */ - - slot->attr = attributes->core; - if (PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) { -#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) - slot->attr.id = volatile_key_id; -#else - slot->attr.id.key_id = volatile_key_id; -#endif - } - - /* Erase external-only flags from the internal copy. To access - * external-only flags, query `attributes`. Thanks to the check - * in psa_validate_key_attributes(), this leaves the dual-use - * flags and any internal flag that psa_get_empty_key_slot() - * may have set. */ - slot->attr.flags &= ~MBEDTLS_PSA_KA_MASK_EXTERNAL_ONLY; - - return PSA_SUCCESS; -} - -/** Finalize the creation of a key once its key material has been set. - * - * This entails writing the key to persistent storage. - * - * If this function fails, call psa_fail_key_creation(). - * See the documentation of psa_start_key_creation() for the intended use - * of this function. - * - * If the finalization succeeds, the function unlocks the key slot (it was - * locked by psa_start_key_creation()) and the key slot cannot be accessed - * anymore as part of the key creation process. - * - * \param[in,out] slot Pointer to the slot with key material. - * \param[in] driver The secure element driver for the key, - * or NULL for a transparent key. - * \param[out] key On success, identifier of the key. Note that the - * key identifier is also stored in the key slot. - * - * \retval #PSA_SUCCESS - * The key was successfully created. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_ALREADY_EXISTS \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * - * \return If this function fails, the key slot is an invalid state. - * You must call psa_fail_key_creation() to wipe and free the slot. - */ -static psa_status_t psa_finish_key_creation( - psa_key_slot_t *slot, - psa_se_drv_table_entry_t *driver, - mbedtls_svc_key_id_t *key) -{ - psa_status_t status = PSA_SUCCESS; - (void) slot; - (void) driver; - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) - if (!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) { - /* Key material is saved in export representation in the slot, so - * just pass the slot buffer for storage. */ - status = psa_save_persistent_key(&slot->attr, - slot->key.data, - slot->key.bytes); - } -#endif /* defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) */ - - if (status == PSA_SUCCESS) { - *key = slot->attr.id; - status = psa_unlock_key_slot(slot); - if (status != PSA_SUCCESS) { - *key = MBEDTLS_SVC_KEY_ID_INIT; - } - } - - return status; -} - -/** Abort the creation of a key. - * - * You may call this function after calling psa_start_key_creation(), - * or after psa_finish_key_creation() fails. In other circumstances, this - * function may not clean up persistent storage. - * See the documentation of psa_start_key_creation() for the intended use - * of this function. - * - * \param[in,out] slot Pointer to the slot with key material. - * \param[in] driver The secure element driver for the key, - * or NULL for a transparent key. - */ -static void psa_fail_key_creation(psa_key_slot_t *slot, - psa_se_drv_table_entry_t *driver) -{ - (void) driver; - - if (slot == NULL) { - return; - } - - psa_wipe_key_slot(slot); -} - -/** Validate optional attributes during key creation. - * - * Some key attributes are optional during key creation. If they are - * specified in the attributes structure, check that they are consistent - * with the data in the slot. - * - * This function should be called near the end of key creation, after - * the slot in memory is fully populated but before saving persistent data. - */ -static psa_status_t psa_validate_optional_attributes( - const psa_key_slot_t *slot, - const psa_key_attributes_t *attributes) -{ - if (attributes->core.type != 0) { - if (attributes->core.type != slot->attr.type) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ - if (attributes->domain_parameters_size != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } -#endif /* PSA_USE_KEY_DOMAIN_PARAMETERS */ - - if (attributes->core.bits != 0) { - if (attributes->core.bits != slot->attr.bits) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - - return PSA_SUCCESS; -} - -psa_status_t psa_import_key(const psa_key_attributes_t *attributes, - const uint8_t *data, - size_t data_length, - mbedtls_svc_key_id_t *key) -{ - psa_status_t status; - psa_key_slot_t *slot = NULL; - psa_se_drv_table_entry_t *driver = NULL; - size_t bits; - size_t storage_size = data_length; - - *key = MBEDTLS_SVC_KEY_ID_INIT; - - /* Reject zero-length symmetric keys (including raw data key objects). - * This also rejects any key which might be encoded as an empty string, - * which is never valid. */ - if (data_length == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - /* Ensure that the bytes-to-bits conversion cannot overflow. */ - if (data_length > SIZE_MAX / 8) { - return PSA_ERROR_NOT_SUPPORTED; - } - - status = psa_start_key_creation(PSA_KEY_CREATION_IMPORT, attributes, - &slot, &driver); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* In the case of a transparent key or an opaque key stored in local - * storage ( thus not in the case of importing a key in a secure element - * with storage ( MBEDTLS_PSA_CRYPTO_SE_C ) ),we have to allocate a - * buffer to hold the imported key material. */ - if (slot->key.data == NULL) { - if (psa_key_lifetime_is_external(attributes->core.lifetime)) { - status = psa_driver_wrapper_get_key_buffer_size_from_key_data( - attributes, data, data_length, &storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - } - status = psa_allocate_buffer_to_slot(slot, storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - } - - bits = slot->attr.bits; - status = psa_driver_wrapper_import_key(attributes, - data, data_length, - slot->key.data, - slot->key.bytes, - &slot->key.bytes, &bits); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (slot->attr.bits == 0) { - slot->attr.bits = (psa_key_bits_t) bits; - } else if (bits != slot->attr.bits) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - /* Enforce a size limit, and in particular ensure that the bit - * size fits in its representation type.*/ - if (bits > PSA_MAX_KEY_BITS) { - status = PSA_ERROR_NOT_SUPPORTED; - goto exit; - } - status = psa_validate_optional_attributes(slot, attributes); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_finish_key_creation(slot, driver, key); -exit: - if (status != PSA_SUCCESS) { - psa_fail_key_creation(slot, driver); - } - - return status; -} - -psa_status_t psa_copy_key(mbedtls_svc_key_id_t source_key, - const psa_key_attributes_t *specified_attributes, - mbedtls_svc_key_id_t *target_key) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *source_slot = NULL; - psa_key_slot_t *target_slot = NULL; - psa_key_attributes_t actual_attributes = *specified_attributes; - psa_se_drv_table_entry_t *driver = NULL; - size_t storage_size = 0; - - *target_key = MBEDTLS_SVC_KEY_ID_INIT; - - status = psa_get_and_lock_key_slot_with_policy( - source_key, &source_slot, PSA_KEY_USAGE_COPY, 0); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_validate_optional_attributes(source_slot, - specified_attributes); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* The target key type and number of bits have been validated by - * psa_validate_optional_attributes() to be either equal to zero or - * equal to the ones of the source key. So it is safe to inherit - * them from the source key now." - * */ - actual_attributes.core.bits = source_slot->attr.bits; - actual_attributes.core.type = source_slot->attr.type; - - - status = psa_restrict_key_policy(source_slot->attr.type, - &actual_attributes.core.policy, - &source_slot->attr.policy); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_start_key_creation(PSA_KEY_CREATION_COPY, &actual_attributes, - &target_slot, &driver); - if (status != PSA_SUCCESS) { - goto exit; - } - if (PSA_KEY_LIFETIME_GET_LOCATION(target_slot->attr.lifetime) != - PSA_KEY_LIFETIME_GET_LOCATION(source_slot->attr.lifetime)) { - /* - * If the source and target keys are stored in different locations, - * the source key would need to be exported as plaintext and re-imported - * in the other location. This has security implications which have not - * been fully mapped. For now, this can be achieved through - * appropriate API invocations from the application, if needed. - * */ - status = PSA_ERROR_NOT_SUPPORTED; - goto exit; - } - /* - * When the source and target keys are within the same location, - * - For transparent keys it is a blind copy without any driver invocation, - * - For opaque keys this translates to an invocation of the drivers' - * copy_key entry point through the dispatch layer. - * */ - if (psa_key_lifetime_is_external(actual_attributes.core.lifetime)) { - status = psa_driver_wrapper_get_key_buffer_size(&actual_attributes, - &storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_allocate_buffer_to_slot(target_slot, storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_driver_wrapper_copy_key(&actual_attributes, - source_slot->key.data, - source_slot->key.bytes, - target_slot->key.data, - target_slot->key.bytes, - &target_slot->key.bytes); - if (status != PSA_SUCCESS) { - goto exit; - } - } else { - status = psa_copy_key_material_into_slot(target_slot, - source_slot->key.data, - source_slot->key.bytes); - if (status != PSA_SUCCESS) { - goto exit; - } - } - status = psa_finish_key_creation(target_slot, driver, target_key); -exit: - if (status != PSA_SUCCESS) { - psa_fail_key_creation(target_slot, driver); - } - - unlock_status = psa_unlock_key_slot(source_slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - - - -/****************************************************************/ -/* Message digests */ -/****************************************************************/ - -psa_status_t psa_hash_abort(psa_hash_operation_t *operation) -{ - /* Aborting a non-active operation is allowed */ - if (operation->id == 0) { - return PSA_SUCCESS; - } - - psa_status_t status = psa_driver_wrapper_hash_abort(operation); - operation->id = 0; - - return status; -} - -psa_status_t psa_hash_setup(psa_hash_operation_t *operation, - psa_algorithm_t alg) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - /* A context must be freshly initialized before it can be set up. */ - if (operation->id != 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (!PSA_ALG_IS_HASH(alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - /* Ensure all of the context is zeroized, since PSA_HASH_OPERATION_INIT only - * directly zeroes the int-sized dummy member of the context union. */ - memset(&operation->ctx, 0, sizeof(operation->ctx)); - - status = psa_driver_wrapper_hash_setup(operation, alg); - -exit: - if (status != PSA_SUCCESS) { - psa_hash_abort(operation); - } - - return status; -} - -psa_status_t psa_hash_update(psa_hash_operation_t *operation, - const uint8_t *input, - size_t input_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - /* Don't require hash implementations to behave correctly on a - * zero-length input, which may have an invalid pointer. */ - if (input_length == 0) { - return PSA_SUCCESS; - } - - status = psa_driver_wrapper_hash_update(operation, input, input_length); - -exit: - if (status != PSA_SUCCESS) { - psa_hash_abort(operation); - } - - return status; -} - -psa_status_t psa_hash_finish(psa_hash_operation_t *operation, - uint8_t *hash, - size_t hash_size, - size_t *hash_length) -{ - *hash_length = 0; - if (operation->id == 0) { - return PSA_ERROR_BAD_STATE; - } - - psa_status_t status = psa_driver_wrapper_hash_finish( - operation, hash, hash_size, hash_length); - psa_hash_abort(operation); - return status; -} - -psa_status_t psa_hash_verify(psa_hash_operation_t *operation, - const uint8_t *hash, - size_t hash_length) -{ - uint8_t actual_hash[PSA_HASH_MAX_SIZE]; - size_t actual_hash_length; - psa_status_t status = psa_hash_finish( - operation, - actual_hash, sizeof(actual_hash), - &actual_hash_length); - - if (status != PSA_SUCCESS) { - goto exit; - } - - if (actual_hash_length != hash_length) { - status = PSA_ERROR_INVALID_SIGNATURE; - goto exit; - } - - if (mbedtls_ct_memcmp(hash, actual_hash, actual_hash_length) != 0) { - status = PSA_ERROR_INVALID_SIGNATURE; - } - -exit: - mbedtls_platform_zeroize(actual_hash, sizeof(actual_hash)); - if (status != PSA_SUCCESS) { - psa_hash_abort(operation); - } - - return status; -} - -psa_status_t psa_hash_compute(psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *hash, size_t hash_size, - size_t *hash_length) -{ - *hash_length = 0; - if (!PSA_ALG_IS_HASH(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return psa_driver_wrapper_hash_compute(alg, input, input_length, - hash, hash_size, hash_length); -} - -psa_status_t psa_hash_compare(psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *hash, size_t hash_length) -{ - uint8_t actual_hash[PSA_HASH_MAX_SIZE]; - size_t actual_hash_length; - - if (!PSA_ALG_IS_HASH(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - psa_status_t status = psa_driver_wrapper_hash_compute( - alg, input, input_length, - actual_hash, sizeof(actual_hash), - &actual_hash_length); - if (status != PSA_SUCCESS) { - goto exit; - } - if (actual_hash_length != hash_length) { - status = PSA_ERROR_INVALID_SIGNATURE; - goto exit; - } - if (mbedtls_ct_memcmp(hash, actual_hash, actual_hash_length) != 0) { - status = PSA_ERROR_INVALID_SIGNATURE; - } - -exit: - mbedtls_platform_zeroize(actual_hash, sizeof(actual_hash)); - return status; -} - -psa_status_t psa_hash_clone(const psa_hash_operation_t *source_operation, - psa_hash_operation_t *target_operation) -{ - if (source_operation->id == 0 || - target_operation->id != 0) { - return PSA_ERROR_BAD_STATE; - } - - psa_status_t status = psa_driver_wrapper_hash_clone(source_operation, - target_operation); - if (status != PSA_SUCCESS) { - psa_hash_abort(target_operation); - } - - return status; -} - - -/****************************************************************/ -/* MAC */ -/****************************************************************/ - -psa_status_t psa_mac_abort(psa_mac_operation_t *operation) -{ - /* Aborting a non-active operation is allowed */ - if (operation->id == 0) { - return PSA_SUCCESS; - } - - psa_status_t status = psa_driver_wrapper_mac_abort(operation); - operation->mac_size = 0; - operation->is_sign = 0; - operation->id = 0; - - return status; -} - -static psa_status_t psa_mac_finalize_alg_and_key_validation( - psa_algorithm_t alg, - const psa_key_attributes_t *attributes, - uint8_t *mac_size) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_type_t key_type = psa_get_key_type(attributes); - size_t key_bits = psa_get_key_bits(attributes); - - if (!PSA_ALG_IS_MAC(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - /* Validate the combination of key type and algorithm */ - status = psa_mac_key_can_do(alg, key_type); - if (status != PSA_SUCCESS) { - return status; - } - - /* Get the output length for the algorithm and key combination */ - *mac_size = PSA_MAC_LENGTH(key_type, key_bits, alg); - - if (*mac_size < 4) { - /* A very short MAC is too short for security since it can be - * brute-forced. Ancient protocols with 32-bit MACs do exist, - * so we make this our minimum, even though 32 bits is still - * too small for security. */ - return PSA_ERROR_NOT_SUPPORTED; - } - - if (*mac_size > PSA_MAC_LENGTH(key_type, key_bits, - PSA_ALG_FULL_LENGTH_MAC(alg))) { - /* It's impossible to "truncate" to a larger length than the full length - * of the algorithm. */ - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (*mac_size > PSA_MAC_MAX_SIZE) { - /* PSA_MAC_LENGTH returns the correct length even for a MAC algorithm - * that is disabled in the compile-time configuration. The result can - * therefore be larger than PSA_MAC_MAX_SIZE, which does take the - * configuration into account. In this case, force a return of - * PSA_ERROR_NOT_SUPPORTED here. Otherwise psa_mac_verify(), or - * psa_mac_compute(mac_size=PSA_MAC_MAX_SIZE), would return - * PSA_ERROR_BUFFER_TOO_SMALL for an unsupported algorithm whose MAC size - * is larger than PSA_MAC_MAX_SIZE, which is misleading and which breaks - * systematically generated tests. */ - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -static psa_status_t psa_mac_setup(psa_mac_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - int is_sign) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_key_attributes_t attributes; - - /* A context must be freshly initialized before it can be set up. */ - if (operation->id != 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_get_and_lock_key_slot_with_policy( - key, - &slot, - is_sign ? PSA_KEY_USAGE_SIGN_MESSAGE : PSA_KEY_USAGE_VERIFY_MESSAGE, - alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_mac_finalize_alg_and_key_validation(alg, &attributes, - &operation->mac_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - operation->is_sign = is_sign; - /* Dispatch the MAC setup call with validated input */ - if (is_sign) { - status = psa_driver_wrapper_mac_sign_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } else { - status = psa_driver_wrapper_mac_verify_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } - -exit: - if (status != PSA_SUCCESS) { - psa_mac_abort(operation); - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_mac_sign_setup(psa_mac_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_mac_setup(operation, key, alg, 1); -} - -psa_status_t psa_mac_verify_setup(psa_mac_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_mac_setup(operation, key, alg, 0); -} - -psa_status_t psa_mac_update(psa_mac_operation_t *operation, - const uint8_t *input, - size_t input_length) -{ - if (operation->id == 0) { - return PSA_ERROR_BAD_STATE; - } - - /* Don't require hash implementations to behave correctly on a - * zero-length input, which may have an invalid pointer. */ - if (input_length == 0) { - return PSA_SUCCESS; - } - - psa_status_t status = psa_driver_wrapper_mac_update(operation, - input, input_length); - if (status != PSA_SUCCESS) { - psa_mac_abort(operation); - } - - return status; -} - -psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation, - uint8_t *mac, - size_t mac_size, - size_t *mac_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t abort_status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (!operation->is_sign) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - /* Sanity check. This will guarantee that mac_size != 0 (and so mac != NULL) - * once all the error checks are done. */ - if (operation->mac_size == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (mac_size < operation->mac_size) { - status = PSA_ERROR_BUFFER_TOO_SMALL; - goto exit; - } - - status = psa_driver_wrapper_mac_sign_finish(operation, - mac, operation->mac_size, - mac_length); - -exit: - /* In case of success, set the potential excess room in the output buffer - * to an invalid value, to avoid potentially leaking a longer MAC. - * In case of error, set the output length and content to a safe default, - * such that in case the caller misses an error check, the output would be - * an unachievable MAC. - */ - if (status != PSA_SUCCESS) { - *mac_length = mac_size; - operation->mac_size = 0; - } - - psa_wipe_tag_output_buffer(mac, status, mac_size, *mac_length); - - abort_status = psa_mac_abort(operation); - - return status == PSA_SUCCESS ? abort_status : status; -} - -psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation, - const uint8_t *mac, - size_t mac_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t abort_status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->is_sign) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->mac_size != mac_length) { - status = PSA_ERROR_INVALID_SIGNATURE; - goto exit; - } - - status = psa_driver_wrapper_mac_verify_finish(operation, - mac, mac_length); - -exit: - abort_status = psa_mac_abort(operation); - - return status == PSA_SUCCESS ? abort_status : status; -} - -static psa_status_t psa_mac_compute_internal(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *mac, - size_t mac_size, - size_t *mac_length, - int is_sign) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - uint8_t operation_mac_size = 0; - psa_key_attributes_t attributes; - - status = psa_get_and_lock_key_slot_with_policy( - key, - &slot, - is_sign ? PSA_KEY_USAGE_SIGN_MESSAGE : PSA_KEY_USAGE_VERIFY_MESSAGE, - alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_mac_finalize_alg_and_key_validation(alg, &attributes, - &operation_mac_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (mac_size < operation_mac_size) { - status = PSA_ERROR_BUFFER_TOO_SMALL; - goto exit; - } - - status = psa_driver_wrapper_mac_compute( - &attributes, - slot->key.data, slot->key.bytes, - alg, - input, input_length, - mac, operation_mac_size, mac_length); - -exit: - /* In case of success, set the potential excess room in the output buffer - * to an invalid value, to avoid potentially leaking a longer MAC. - * In case of error, set the output length and content to a safe default, - * such that in case the caller misses an error check, the output would be - * an unachievable MAC. - */ - if (status != PSA_SUCCESS) { - *mac_length = mac_size; - operation_mac_size = 0; - } - - psa_wipe_tag_output_buffer(mac, status, mac_size, *mac_length); - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_mac_compute(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *mac, - size_t mac_size, - size_t *mac_length) -{ - return psa_mac_compute_internal(key, alg, - input, input_length, - mac, mac_size, mac_length, 1); -} - -psa_status_t psa_mac_verify(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *mac, - size_t mac_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - uint8_t actual_mac[PSA_MAC_MAX_SIZE]; - size_t actual_mac_length; - - status = psa_mac_compute_internal(key, alg, - input, input_length, - actual_mac, sizeof(actual_mac), - &actual_mac_length, 0); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (mac_length != actual_mac_length) { - status = PSA_ERROR_INVALID_SIGNATURE; - goto exit; - } - if (mbedtls_ct_memcmp(mac, actual_mac, actual_mac_length) != 0) { - status = PSA_ERROR_INVALID_SIGNATURE; - goto exit; - } - -exit: - mbedtls_platform_zeroize(actual_mac, sizeof(actual_mac)); - - return status; -} - -/****************************************************************/ -/* Asymmetric cryptography */ -/****************************************************************/ - -static psa_status_t psa_sign_verify_check_alg(int input_is_message, - psa_algorithm_t alg) -{ - if (input_is_message) { - if (!PSA_ALG_IS_SIGN_MESSAGE(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (PSA_ALG_IS_SIGN_HASH(alg)) { - if (!PSA_ALG_IS_HASH(PSA_ALG_SIGN_GET_HASH(alg))) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - } else { - if (!PSA_ALG_IS_SIGN_HASH(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - - return PSA_SUCCESS; -} - -static psa_status_t psa_sign_internal(mbedtls_svc_key_id_t key, - int input_is_message, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - *signature_length = 0; - - status = psa_sign_verify_check_alg(input_is_message, alg); - if (status != PSA_SUCCESS) { - return status; - } - - /* Immediately reject a zero-length signature buffer. This guarantees - * that signature must be a valid pointer. (On the other hand, the input - * buffer can in principle be empty since it doesn't actually have - * to be a hash.) */ - if (signature_size == 0) { - return PSA_ERROR_BUFFER_TOO_SMALL; - } - - status = psa_get_and_lock_key_slot_with_policy( - key, &slot, - input_is_message ? PSA_KEY_USAGE_SIGN_MESSAGE : - PSA_KEY_USAGE_SIGN_HASH, - alg); - - if (status != PSA_SUCCESS) { - goto exit; - } - - if (!PSA_KEY_TYPE_IS_KEY_PAIR(slot->attr.type)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - if (input_is_message) { - status = psa_driver_wrapper_sign_message( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, - signature, signature_size, signature_length); - } else { - - status = psa_driver_wrapper_sign_hash( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, - signature, signature_size, signature_length); - } - - -exit: - psa_wipe_tag_output_buffer(signature, status, signature_size, - *signature_length); - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -static psa_status_t psa_verify_internal(mbedtls_svc_key_id_t key, - int input_is_message, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *signature, - size_t signature_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - status = psa_sign_verify_check_alg(input_is_message, alg); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_get_and_lock_key_slot_with_policy( - key, &slot, - input_is_message ? PSA_KEY_USAGE_VERIFY_MESSAGE : - PSA_KEY_USAGE_VERIFY_HASH, - alg); - - if (status != PSA_SUCCESS) { - return status; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - if (input_is_message) { - status = psa_driver_wrapper_verify_message( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, - signature, signature_length); - } else { - status = psa_driver_wrapper_verify_hash( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, - signature, signature_length); - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; - -} - -psa_status_t psa_sign_message_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (PSA_ALG_IS_SIGN_HASH(alg)) { - size_t hash_length; - uint8_t hash[PSA_HASH_MAX_SIZE]; - - status = psa_driver_wrapper_hash_compute( - PSA_ALG_SIGN_GET_HASH(alg), - input, input_length, - hash, sizeof(hash), &hash_length); - - if (status != PSA_SUCCESS) { - return status; - } - - return psa_driver_wrapper_sign_hash( - attributes, key_buffer, key_buffer_size, - alg, hash, hash_length, - signature, signature_size, signature_length); - } - - return PSA_ERROR_NOT_SUPPORTED; -} - -psa_status_t psa_sign_message(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length) -{ - return psa_sign_internal( - key, 1, alg, input, input_length, - signature, signature_size, signature_length); -} - -psa_status_t psa_verify_message_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *signature, - size_t signature_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (PSA_ALG_IS_SIGN_HASH(alg)) { - size_t hash_length; - uint8_t hash[PSA_HASH_MAX_SIZE]; - - status = psa_driver_wrapper_hash_compute( - PSA_ALG_SIGN_GET_HASH(alg), - input, input_length, - hash, sizeof(hash), &hash_length); - - if (status != PSA_SUCCESS) { - return status; - } - - return psa_driver_wrapper_verify_hash( - attributes, key_buffer, key_buffer_size, - alg, hash, hash_length, - signature, signature_length); - } - - return PSA_ERROR_NOT_SUPPORTED; -} - -psa_status_t psa_verify_message(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *signature, - size_t signature_length) -{ - return psa_verify_internal( - key, 1, alg, input, input_length, - signature, signature_length); -} - -psa_status_t psa_sign_hash(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *hash, - size_t hash_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length) -{ - return psa_sign_internal( - key, 0, alg, hash, hash_length, - signature, signature_size, signature_length); -} - -psa_status_t psa_verify_hash(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *hash, - size_t hash_length, - const uint8_t *signature, - size_t signature_length) -{ - return psa_verify_internal( - key, 0, alg, hash, hash_length, - signature, signature_length); -} - -psa_status_t psa_asymmetric_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - (void) input; - (void) input_length; - (void) salt; - (void) output; - (void) output_size; - - *output_length = 0; - - if (!PSA_ALG_IS_RSA_OAEP(alg) && salt_length != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_get_and_lock_transparent_key_slot_with_policy( - key, &slot, PSA_KEY_USAGE_ENCRYPT, alg); - if (status != PSA_SUCCESS) { - return status; - } - if (!(PSA_KEY_TYPE_IS_PUBLIC_KEY(slot->attr.type) || - PSA_KEY_TYPE_IS_KEY_PAIR(slot->attr.type))) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_driver_wrapper_asymmetric_encrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, salt, salt_length, - output, output_size, output_length); -exit: - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_asymmetric_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - (void) input; - (void) input_length; - (void) salt; - (void) output; - (void) output_size; - - *output_length = 0; - - if (!PSA_ALG_IS_RSA_OAEP(alg) && salt_length != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_get_and_lock_transparent_key_slot_with_policy( - key, &slot, PSA_KEY_USAGE_DECRYPT, alg); - if (status != PSA_SUCCESS) { - return status; - } - if (!PSA_KEY_TYPE_IS_KEY_PAIR(slot->attr.type)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_driver_wrapper_asymmetric_decrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, salt, salt_length, - output, output_size, output_length); - -exit: - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -/****************************************************************/ -/* Asymmetric interruptible cryptography */ -/****************************************************************/ - -psa_status_t psa_sign_hash_start( - psa_sign_hash_interruptible_operation_t *operation, - mbedtls_svc_key_id_t key, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length) -{ - (void)operation; - (void)key; - (void)alg; - (void)hash; - (void)hash_length; - return PSA_ERROR_NOT_SUPPORTED; -} - -psa_status_t psa_sign_hash_abort( - psa_sign_hash_interruptible_operation_t *operation) -{ - (void)operation; - return PSA_SUCCESS; -} - -psa_status_t psa_verify_hash_start( - psa_verify_hash_interruptible_operation_t *operation, - mbedtls_svc_key_id_t key, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length) -{ - (void)operation; - (void)key; - (void)alg; - (void)hash; - (void)hash_length; - (void)signature; - (void)signature_length; - return PSA_ERROR_NOT_SUPPORTED; -} - -psa_status_t psa_verify_hash_abort( - psa_verify_hash_interruptible_operation_t *operation) -{ - (void)operation; - return PSA_SUCCESS; -} - -/****************************************************************/ -/* Symmetric cryptography */ -/****************************************************************/ - -static psa_status_t psa_cipher_setup(psa_cipher_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - mbedtls_operation_t cipher_operation) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_key_usage_t usage = (cipher_operation == MBEDTLS_ENCRYPT ? - PSA_KEY_USAGE_ENCRYPT : - PSA_KEY_USAGE_DECRYPT); - psa_key_attributes_t attributes; - - /* A context must be freshly initialized before it can be set up. */ - if (operation->id != 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (!PSA_ALG_IS_CIPHER(alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_get_and_lock_key_slot_with_policy(key, &slot, usage, alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* Initialize the operation struct members, except for id. The id member - * is used to indicate to psa_cipher_abort that there are resources to free, - * so we only set it (in the driver wrapper) after resources have been - * allocated/initialized. */ - operation->iv_set = 0; - if (alg == PSA_ALG_ECB_NO_PADDING) { - operation->iv_required = 0; - } else { - operation->iv_required = 1; - } - operation->default_iv_length = PSA_CIPHER_IV_LENGTH(slot->attr.type, alg); - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - /* Try doing the operation through a driver before using software fallback. */ - if (cipher_operation == MBEDTLS_ENCRYPT) { - status = psa_driver_wrapper_cipher_encrypt_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } else { - status = psa_driver_wrapper_cipher_decrypt_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } - -exit: - if (status != PSA_SUCCESS) { - psa_cipher_abort(operation); - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_cipher_encrypt_setup(psa_cipher_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_cipher_setup(operation, key, alg, MBEDTLS_ENCRYPT); -} - -psa_status_t psa_cipher_decrypt_setup(psa_cipher_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_cipher_setup(operation, key, alg, MBEDTLS_DECRYPT); -} - -psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation, - uint8_t *iv, - size_t iv_size, - size_t *iv_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - uint8_t local_iv[PSA_CIPHER_IV_MAX_SIZE]; - size_t default_iv_length = 0; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->iv_set || !operation->iv_required) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - default_iv_length = operation->default_iv_length; - if (iv_size < default_iv_length) { - status = PSA_ERROR_BUFFER_TOO_SMALL; - goto exit; - } - - if (default_iv_length > PSA_CIPHER_IV_MAX_SIZE) { - status = PSA_ERROR_GENERIC_ERROR; - goto exit; - } - - status = psa_generate_random(local_iv, default_iv_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_driver_wrapper_cipher_set_iv(operation, - local_iv, default_iv_length); - -exit: - if (status == PSA_SUCCESS) { - memcpy(iv, local_iv, default_iv_length); - *iv_length = default_iv_length; - operation->iv_set = 1; - } else { - *iv_length = 0; - psa_cipher_abort(operation); - } - - return status; -} - -psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation, - const uint8_t *iv, - size_t iv_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->iv_set || !operation->iv_required) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (iv_length > PSA_CIPHER_IV_MAX_SIZE) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_driver_wrapper_cipher_set_iv(operation, - iv, - iv_length); - -exit: - if (status == PSA_SUCCESS) { - operation->iv_set = 1; - } else { - psa_cipher_abort(operation); - } - return status; -} - -psa_status_t psa_cipher_update(psa_cipher_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->iv_required && !operation->iv_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_cipher_update(operation, - input, - input_length, - output, - output_size, - output_length); - -exit: - if (status != PSA_SUCCESS) { - psa_cipher_abort(operation); - } - - return status; -} - -psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_GENERIC_ERROR; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->iv_required && !operation->iv_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_cipher_finish(operation, - output, - output_size, - output_length); - -exit: - if (status == PSA_SUCCESS) { - return psa_cipher_abort(operation); - } else { - *output_length = 0; - (void) psa_cipher_abort(operation); - - return status; - } -} - -psa_status_t psa_cipher_abort(psa_cipher_operation_t *operation) -{ - if (operation->id == 0) { - /* The object has (apparently) been initialized but it is not (yet) - * in use. It's ok to call abort on such an object, and there's - * nothing to do. */ - return PSA_SUCCESS; - } - - psa_driver_wrapper_cipher_abort(operation); - - operation->id = 0; - operation->iv_set = 0; - operation->iv_required = 0; - - return PSA_SUCCESS; -} - -psa_status_t psa_cipher_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - uint8_t local_iv[PSA_CIPHER_IV_MAX_SIZE]; - size_t default_iv_length = 0; - psa_key_attributes_t attributes; - - if (!PSA_ALG_IS_CIPHER(alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_get_and_lock_key_slot_with_policy(key, &slot, - PSA_KEY_USAGE_ENCRYPT, - alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - default_iv_length = PSA_CIPHER_IV_LENGTH(slot->attr.type, alg); - if (default_iv_length > PSA_CIPHER_IV_MAX_SIZE) { - status = PSA_ERROR_GENERIC_ERROR; - goto exit; - } - - if (default_iv_length > 0) { - if (output_size < default_iv_length) { - status = PSA_ERROR_BUFFER_TOO_SMALL; - goto exit; - } - - status = psa_generate_random(local_iv, default_iv_length); - if (status != PSA_SUCCESS) { - goto exit; - } - } - - status = psa_driver_wrapper_cipher_encrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, local_iv, default_iv_length, input, input_length, - psa_crypto_buffer_offset(output, default_iv_length), - output_size - default_iv_length, output_length); - -exit: - unlock_status = psa_unlock_key_slot(slot); - if (status == PSA_SUCCESS) { - status = unlock_status; - } - - if (status == PSA_SUCCESS) { - if (default_iv_length > 0) { - memcpy(output, local_iv, default_iv_length); - } - *output_length += default_iv_length; - } else { - *output_length = 0; - } - - return status; -} - -psa_status_t psa_cipher_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_key_attributes_t attributes; - - if (!PSA_ALG_IS_CIPHER(alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_get_and_lock_key_slot_with_policy(key, &slot, - PSA_KEY_USAGE_DECRYPT, - alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - if (alg == PSA_ALG_CCM_STAR_NO_TAG && - input_length < PSA_BLOCK_CIPHER_BLOCK_LENGTH(slot->attr.type)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } else if (input_length < PSA_CIPHER_IV_LENGTH(slot->attr.type, alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_driver_wrapper_cipher_decrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, input, input_length, - output, output_size, output_length); - -exit: - unlock_status = psa_unlock_key_slot(slot); - if (status == PSA_SUCCESS) { - status = unlock_status; - } - - if (status != PSA_SUCCESS) { - *output_length = 0; - } - - return status; -} - - -/****************************************************************/ -/* AEAD */ -/****************************************************************/ - -/* Helper function to get the base algorithm from its variants. */ -static psa_algorithm_t psa_aead_get_base_algorithm(psa_algorithm_t alg) -{ - return PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG(alg); -} - -/* Helper function to perform common nonce length checks. */ -static psa_status_t psa_aead_check_nonce_length(psa_algorithm_t alg, - size_t nonce_length) -{ - psa_algorithm_t base_alg = psa_aead_get_base_algorithm(alg); - - switch (base_alg) { -#if defined(PSA_WANT_ALG_GCM) - case PSA_ALG_GCM: - /* Not checking max nonce size here as GCM spec allows almost - * arbitrarily large nonces. Please note that we do not generally - * recommend the usage of nonces of greater length than - * PSA_AEAD_NONCE_MAX_SIZE, as large nonces are hashed to a shorter - * size, which can then lead to collisions if you encrypt a very - * large number of messages.*/ - if (nonce_length != 0) { - return PSA_SUCCESS; - } - break; -#endif /* PSA_WANT_ALG_GCM */ -#if defined(PSA_WANT_ALG_CCM) - case PSA_ALG_CCM: - if (nonce_length >= 7 && nonce_length <= 13) { - return PSA_SUCCESS; - } - break; -#endif /* PSA_WANT_ALG_CCM */ -#if defined(PSA_WANT_ALG_CHACHA20_POLY1305) - case PSA_ALG_CHACHA20_POLY1305: - if (nonce_length == 12) { - return PSA_SUCCESS; - } else if (nonce_length == 8) { - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */ - default: - (void) nonce_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_ERROR_INVALID_ARGUMENT; -} - -static psa_status_t psa_aead_check_algorithm(psa_algorithm_t alg) -{ - if (!PSA_ALG_IS_AEAD(alg) || PSA_ALG_IS_WILDCARD(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -psa_status_t psa_aead_encrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *plaintext, - size_t plaintext_length, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - - *ciphertext_length = 0; - - status = psa_aead_check_algorithm(alg); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_get_and_lock_key_slot_with_policy( - key, &slot, PSA_KEY_USAGE_ENCRYPT, alg); - if (status != PSA_SUCCESS) { - return status; - } - - psa_key_attributes_t attributes = { - .core = slot->attr - }; - - status = psa_aead_check_nonce_length(alg, nonce_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_driver_wrapper_aead_encrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, - nonce, nonce_length, - additional_data, additional_data_length, - plaintext, plaintext_length, - ciphertext, ciphertext_size, ciphertext_length); - - if (status != PSA_SUCCESS && ciphertext_size != 0) { - memset(ciphertext, 0, ciphertext_size); - } - -exit: - psa_unlock_key_slot(slot); - - return status; -} - -psa_status_t psa_aead_decrypt(mbedtls_svc_key_id_t key, - psa_algorithm_t alg, - const uint8_t *nonce, - size_t nonce_length, - const uint8_t *additional_data, - size_t additional_data_length, - const uint8_t *ciphertext, - size_t ciphertext_length, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - psa_key_attributes_t attributes; - - *plaintext_length = 0; - - status = psa_aead_check_algorithm(alg); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_get_and_lock_key_slot_with_policy( - key, &slot, PSA_KEY_USAGE_DECRYPT, alg); - if (status != PSA_SUCCESS) { - return status; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_aead_check_nonce_length(alg, nonce_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_driver_wrapper_aead_decrypt( - &attributes, slot->key.data, slot->key.bytes, - alg, - nonce, nonce_length, - additional_data, additional_data_length, - ciphertext, ciphertext_length, - plaintext, plaintext_size, plaintext_length); - - if (status != PSA_SUCCESS && plaintext_size != 0) { - memset(plaintext, 0, plaintext_size); - } - -exit: - psa_unlock_key_slot(slot); - - return status; -} - -static psa_status_t psa_validate_tag_length(psa_algorithm_t alg) -{ - const uint8_t tag_len = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); - - switch (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0)) { -#if defined(PSA_WANT_ALG_CCM) - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - /* CCM allows the following tag lengths: 4, 6, 8, 10, 12, 14, 16.*/ - if (tag_len < 4 || tag_len > 16 || tag_len % 2) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif /* PSA_WANT_ALG_CCM */ - -#if defined(PSA_WANT_ALG_GCM) - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - /* GCM allows the following tag lengths: 4, 8, 12, 13, 14, 15, 16. */ - if (tag_len != 4 && tag_len != 8 && (tag_len < 12 || tag_len > 16)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif /* PSA_WANT_ALG_GCM */ - -#if defined(PSA_WANT_ALG_CHACHA20_POLY1305) - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - /* We only support the default tag length. */ - if (tag_len != 16) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */ - - default: - (void) tag_len; - return PSA_ERROR_NOT_SUPPORTED; - } - return PSA_SUCCESS; -} - -/* Set the key for a multipart authenticated operation. */ -static psa_status_t psa_aead_setup(psa_aead_operation_t *operation, - int is_encrypt, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_key_usage_t key_usage = 0; - psa_key_attributes_t attributes; - - status = psa_aead_check_algorithm(alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (operation->id != 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->nonce_set || operation->lengths_set || - operation->ad_started || operation->body_started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (is_encrypt) { - key_usage = PSA_KEY_USAGE_ENCRYPT; - } else { - key_usage = PSA_KEY_USAGE_DECRYPT; - } - - status = psa_get_and_lock_key_slot_with_policy(key, &slot, key_usage, - alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - if ((status = psa_validate_tag_length(alg)) != PSA_SUCCESS) { - goto exit; - } - - if (is_encrypt) { - status = psa_driver_wrapper_aead_encrypt_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } else { - status = psa_driver_wrapper_aead_decrypt_setup(operation, - &attributes, - slot->key.data, - slot->key.bytes, - alg); - } - if (status != PSA_SUCCESS) { - goto exit; - } - - operation->key_type = psa_get_key_type(&attributes); - -exit: - unlock_status = psa_unlock_key_slot(slot); - - if (status == PSA_SUCCESS) { - status = unlock_status; - operation->alg = psa_aead_get_base_algorithm(alg); - operation->is_encrypt = is_encrypt; - } else { - psa_aead_abort(operation); - } - - return status; -} - -/* Set the key for a multipart authenticated encryption operation. */ -psa_status_t psa_aead_encrypt_setup(psa_aead_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_aead_setup(operation, 1, key, alg); -} - -/* Set the key for a multipart authenticated decryption operation. */ -psa_status_t psa_aead_decrypt_setup(psa_aead_operation_t *operation, - mbedtls_svc_key_id_t key, - psa_algorithm_t alg) -{ - return psa_aead_setup(operation, 0, key, alg); -} - -/* Generate a random nonce / IV for multipart AEAD operation */ -psa_status_t psa_aead_generate_nonce(psa_aead_operation_t *operation, - uint8_t *nonce, - size_t nonce_size, - size_t *nonce_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - uint8_t local_nonce[PSA_AEAD_NONCE_MAX_SIZE]; - size_t required_nonce_size = 0; - - *nonce_length = 0; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->nonce_set || !operation->is_encrypt) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - /* For CCM, this size may not be correct according to the PSA - * specification. The PSA Crypto 1.0.1 specification states: - * - * CCM encodes the plaintext length pLen in L octets, with L the smallest - * integer >= 2 where pLen < 2^(8L). The nonce length is then 15 - L bytes. - * - * However this restriction that L has to be the smallest integer is not - * applied in practice, and it is not implementable here since the - * plaintext length may or may not be known at this time. */ - required_nonce_size = PSA_AEAD_NONCE_LENGTH(operation->key_type, - operation->alg); - if (nonce_size < required_nonce_size) { - status = PSA_ERROR_BUFFER_TOO_SMALL; - goto exit; - } - - status = psa_generate_random(local_nonce, required_nonce_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_aead_set_nonce(operation, local_nonce, required_nonce_size); - -exit: - if (status == PSA_SUCCESS) { - memcpy(nonce, local_nonce, required_nonce_size); - *nonce_length = required_nonce_size; - } else { - psa_aead_abort(operation); - } - - return status; -} - -/* Set the nonce for a multipart authenticated encryption or decryption - operation.*/ -psa_status_t psa_aead_set_nonce(psa_aead_operation_t *operation, - const uint8_t *nonce, - size_t nonce_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->nonce_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_aead_check_nonce_length(operation->alg, nonce_length); - if (status != PSA_SUCCESS) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - status = psa_driver_wrapper_aead_set_nonce(operation, nonce, - nonce_length); - -exit: - if (status == PSA_SUCCESS) { - operation->nonce_set = 1; - } else { - psa_aead_abort(operation); - } - - return status; -} - -/* Declare the lengths of the message and additional data for multipart AEAD. */ -psa_status_t psa_aead_set_lengths(psa_aead_operation_t *operation, - size_t ad_length, - size_t plaintext_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->lengths_set || operation->ad_started || - operation->body_started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - switch (operation->alg) { -#if defined(PSA_WANT_ALG_GCM) - case PSA_ALG_GCM: - /* Lengths can only be too large for GCM if size_t is bigger than 32 - * bits. Without the guard this code will generate warnings on 32bit - * builds. */ -#if SIZE_MAX > UINT32_MAX - if (((uint64_t) ad_length) >> 61 != 0 || - ((uint64_t) plaintext_length) > 0xFFFFFFFE0ull) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } -#endif - break; -#endif /* PSA_WANT_ALG_GCM */ -#if defined(PSA_WANT_ALG_CCM) - case PSA_ALG_CCM: - if (ad_length > 0xFF00) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - break; -#endif /* PSA_WANT_ALG_CCM */ -#if defined(PSA_WANT_ALG_CHACHA20_POLY1305) - case PSA_ALG_CHACHA20_POLY1305: - /* No length restrictions for ChaChaPoly. */ - break; -#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */ - default: - break; - } - - status = psa_driver_wrapper_aead_set_lengths(operation, ad_length, - plaintext_length); - -exit: - if (status == PSA_SUCCESS) { - operation->ad_remaining = ad_length; - operation->body_remaining = plaintext_length; - operation->lengths_set = 1; - } else { - psa_aead_abort(operation); - } - - return status; -} - -/* Pass additional data to an active multipart AEAD operation. */ -psa_status_t psa_aead_update_ad(psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (!operation->nonce_set || operation->body_started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->lengths_set) { - if (operation->ad_remaining < input_length) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - operation->ad_remaining -= input_length; - } -#if defined(PSA_WANT_ALG_CCM) - else if (operation->alg == PSA_ALG_CCM) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } -#endif /* PSA_WANT_ALG_CCM */ - - status = psa_driver_wrapper_aead_update_ad(operation, input, - input_length); - -exit: - if (status == PSA_SUCCESS) { - operation->ad_started = 1; - } else { - psa_aead_abort(operation); - } - - return status; -} - -/* Encrypt or decrypt a message fragment in an active multipart AEAD - operation.*/ -psa_status_t psa_aead_update(psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - *output_length = 0; - - if (operation->id == 0) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (!operation->nonce_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - if (operation->lengths_set) { - /* Additional data length was supplied, but not all the additional - data was supplied.*/ - if (operation->ad_remaining != 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - /* Too much data provided. */ - if (operation->body_remaining < input_length) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - operation->body_remaining -= input_length; - } -#if defined(PSA_WANT_ALG_CCM) - else if (operation->alg == PSA_ALG_CCM) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } -#endif /* PSA_WANT_ALG_CCM */ - - status = psa_driver_wrapper_aead_update(operation, input, input_length, - output, output_size, - output_length); - -exit: - if (status == PSA_SUCCESS) { - operation->body_started = 1; - } else { - psa_aead_abort(operation); - } - - return status; -} - -static psa_status_t psa_aead_final_checks(const psa_aead_operation_t *operation) -{ - if (operation->id == 0 || !operation->nonce_set) { - return PSA_ERROR_BAD_STATE; - } - - if (operation->lengths_set && (operation->ad_remaining != 0 || - operation->body_remaining != 0)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -/* Finish encrypting a message in a multipart AEAD operation. */ -psa_status_t psa_aead_finish(psa_aead_operation_t *operation, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length, - uint8_t *tag, - size_t tag_size, - size_t *tag_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - *ciphertext_length = 0; - *tag_length = tag_size; - - status = psa_aead_final_checks(operation); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (!operation->is_encrypt) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_aead_finish(operation, ciphertext, - ciphertext_size, - ciphertext_length, - tag, tag_size, tag_length); - -exit: - - - /* In case the operation fails and the user fails to check for failure or - * the zero tag size, make sure the tag is set to something implausible. - * Even if the operation succeeds, make sure we clear the rest of the - * buffer to prevent potential leakage of anything previously placed in - * the same buffer.*/ - psa_wipe_tag_output_buffer(tag, status, tag_size, *tag_length); - - psa_aead_abort(operation); - - return status; -} - -/* Finish authenticating and decrypting a message in a multipart AEAD - operation.*/ -psa_status_t psa_aead_verify(psa_aead_operation_t *operation, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length, - const uint8_t *tag, - size_t tag_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - *plaintext_length = 0; - - status = psa_aead_final_checks(operation); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (operation->is_encrypt) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_aead_verify(operation, plaintext, - plaintext_size, - plaintext_length, - tag, tag_length); - -exit: - psa_aead_abort(operation); - - return status; -} - -/* Abort an AEAD operation. */ -psa_status_t psa_aead_abort(psa_aead_operation_t *operation) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->id == 0) { - /* The object has (apparently) been initialized but it is not (yet) - * in use. It's ok to call abort on such an object, and there's - * nothing to do. */ - return PSA_SUCCESS; - } - - status = psa_driver_wrapper_aead_abort(operation); - - memset(operation, 0, sizeof(*operation)); - - return status; -} - -/****************************************************************/ -/* Generators */ -/****************************************************************/ - -#define HKDF_STATE_INIT 0 /* no input yet */ -#define HKDF_STATE_STARTED 1 /* got salt */ -#define HKDF_STATE_KEYED 2 /* got key */ -#define HKDF_STATE_OUTPUT 3 /* output started */ - -psa_status_t psa_key_derivation_abort(psa_key_derivation_operation_t *operation) -{ - psa_status_t status = PSA_SUCCESS; - if (operation->alg != 0) { - status = psa_driver_wrapper_key_derivation_abort(operation); - } - mbedtls_platform_zeroize(operation, sizeof(*operation)); - return status; -} - -psa_status_t psa_key_derivation_get_capacity(const psa_key_derivation_operation_t *operation, - size_t *capacity) -{ - if (operation->alg == 0) { - /* This is a blank key derivation operation. */ - return PSA_ERROR_BAD_STATE; - } - - *capacity = operation->capacity; - return PSA_SUCCESS; -} - -psa_status_t psa_key_derivation_set_capacity(psa_key_derivation_operation_t *operation, - size_t capacity) -{ - if (operation->alg == 0) { - return PSA_ERROR_BAD_STATE; - } - if (capacity > operation->capacity) { - return PSA_ERROR_INVALID_ARGUMENT; - } - operation->capacity = capacity; - return psa_driver_wrapper_key_derivation_set_capacity(operation, capacity); -} - -#define PSA_KEY_DERIVATION_OUTPUT -1 // used as step below - -static psa_status_t psa_key_derivation_check_state( - psa_key_derivation_operation_t *operation, - int step) -{ - psa_algorithm_t alg = operation->alg; - if (alg == 0) return PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_KEY_AGREEMENT(alg)) alg = PSA_ALG_KEY_AGREEMENT_GET_KDF(alg); - if (step != PSA_KEY_DERIVATION_OUTPUT && operation->no_input) return PSA_ERROR_BAD_STATE; - -#ifdef PSA_WANT_ALG_HKDF - if (PSA_ALG_IS_HKDF(alg)) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SALT: - if (operation->salt_set || operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->salt_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_INFO: - if (operation->info_set) return PSA_ERROR_BAD_STATE; - operation->info_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->secret_set || !operation->info_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_HKDF */ - -#ifdef PSA_WANT_ALG_HKDF_EXTRACT - if (PSA_ALG_IS_HKDF_EXTRACT(alg)) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SALT: - if (operation->salt_set) return PSA_ERROR_BAD_STATE; - operation->salt_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (operation->secret_set || !operation->salt_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_HKDF_EXTRACT */ - -#ifdef PSA_WANT_ALG_HKDF_EXPAND - if (PSA_ALG_IS_HKDF_EXPAND(alg)) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_INFO: - if (operation->info_set || !operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->info_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->info_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_HKDF_EXPAND */ - -#if defined(PSA_WANT_ALG_TLS12_PRF) || defined(PSA_WANT_ALG_TLS12_PSK_TO_MS) - if (PSA_ALG_IS_TLS12_PRF(alg) || PSA_ALG_IS_TLS12_PSK_TO_MS(alg)) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SEED: - if (operation->seed_set) return PSA_ERROR_BAD_STATE; - operation->seed_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_OTHER_SECRET: - if (PSA_ALG_IS_TLS12_PRF(alg)) return PSA_ERROR_INVALID_ARGUMENT; - if (!operation->seed_set || operation->secret_set || operation->passw_set) return PSA_ERROR_BAD_STATE; - operation->passw_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (!operation->seed_set || operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_LABEL: - if (!operation->secret_set || operation->label_set) return PSA_ERROR_BAD_STATE; - operation->label_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->label_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_TLS12_PRF || PSA_WANT_ALG_TLS12_PSK_TO_MS */ - -#if defined(PSA_WANT_ALG_PBKDF2_HMAC) || defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) -#if defined(PSA_WANT_ALG_PBKDF2_HMAC) && defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) - if (PSA_ALG_IS_PBKDF2_HMAC(alg) || alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128) { -#elif defined(PSA_WANT_ALG_PBKDF2_HMAC) - if (PSA_ALG_IS_PBKDF2_HMAC(alg)) { -#elif defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) - if (alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128) { -#endif - switch (step) { - case PSA_KEY_DERIVATION_INPUT_COST: - if (operation->cost_set) return PSA_ERROR_BAD_STATE; - operation->cost_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_SALT: - if (!operation->cost_set || operation->passw_set) return PSA_ERROR_BAD_STATE; - operation->salt_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_PASSWORD: - if (!operation->salt_set || operation->passw_set) return PSA_ERROR_BAD_STATE; - operation->passw_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->passw_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_PBKDF2_HMAC || PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 */ - -#ifdef PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS - if (alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS */ - -#ifdef PSA_WANT_ALG_SRP_PASSWORD_HASH - if (PSA_ALG_IS_SRP_PASSWORD_HASH(alg)) { - switch (step) { - case PSA_KEY_DERIVATION_INPUT_INFO: - if (operation->info_set) return PSA_ERROR_BAD_STATE; - operation->info_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_PASSWORD: - if (!operation->info_set || operation->passw_set) return PSA_ERROR_BAD_STATE; - operation->passw_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_SALT: - if (!operation->passw_set || operation->salt_set) return PSA_ERROR_BAD_STATE; - operation->salt_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->salt_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_SRP_PASSWORD_HASH */ - -#if defined(PSA_WANT_ALG_SP800_108_COUNTER_HMAC) || defined(PSA_WANT_ALG_SP800_108_COUNTER_CMAC) -#if defined(PSA_WANT_ALG_SP800_108_COUNTER_HMAC) && defined(PSA_WANT_ALG_SP800_108_COUNTER_CMAC) - if (PSA_ALG_IS_SP800_108_COUNTER_HMAC(alg) || alg == PSA_ALG_SP800_108_COUNTER_CMAC) { -#elif defined(PSA_WANT_ALG_SP800_108_COUNTER_HMAC) - if (PSA_ALG_IS_SP800_108_COUNTER_HMAC(alg)) { -#elif defined(PSA_WANT_ALG_SP800_108_COUNTER_CMAC) - if (alg == PSA_ALG_SP800_108_COUNTER_CMAC) { -#endif - switch (step) { - case PSA_KEY_DERIVATION_INPUT_SECRET: - if (operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->secret_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_LABEL: - if (!operation->secret_set || operation->label_set || operation->context_set) return PSA_ERROR_BAD_STATE; - operation->label_set = 1; - break; - case PSA_KEY_DERIVATION_INPUT_CONTEXT: - if (!operation->secret_set || operation->context_set) return PSA_ERROR_BAD_STATE; - operation->context_set = 1; - break; - case PSA_KEY_DERIVATION_OUTPUT: - if (!operation->secret_set) return PSA_ERROR_BAD_STATE; - operation->no_input = 1; - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - } else -#endif /* PSA_WANT_ALG_SP800_108_COUNTER_HMAC || PSA_WANT_ALG_SP800_108_COUNTER_CMAC */ - - { - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t psa_key_derivation_output_bytes_internal( - psa_key_derivation_operation_t *operation, - uint8_t *output, - size_t output_length) -{ - psa_status_t status; - - if (output_length <= operation->capacity && operation->capacity > 0) { - status = psa_driver_wrapper_key_derivation_output_bytes(operation, output, output_length); - operation->capacity -= output_length; - if (status == PSA_SUCCESS) return PSA_SUCCESS; - psa_key_derivation_abort(operation); - } else { - // Not enough capacity: - // We have to return PSA_ERROR_INSUFFICIENT_DATA and enter a special - // error state where the operation is cleaned up but the object is - // still active and further calls to output_bytes() continue to - // return PSA_ERROR_INSUFFICIENT_DATA. - psa_driver_wrapper_key_derivation_abort(operation); // clear inner context - operation->capacity = 0; - status = PSA_ERROR_INSUFFICIENT_DATA; - } - - memset(output, '!', output_length); - return status; -} - -psa_status_t psa_key_derivation_output_bytes( - psa_key_derivation_operation_t *operation, - uint8_t *output, - size_t output_length) -{ - psa_status_t status; - - status = psa_key_derivation_check_state(operation, PSA_KEY_DERIVATION_OUTPUT); - if (status != PSA_SUCCESS) return status; - - if (operation->no_output) { - return PSA_ERROR_NOT_PERMITTED; - } - - return psa_key_derivation_output_bytes_internal(operation, output, output_length); -} - -static psa_status_t psa_generate_derived_key_internal( - psa_key_slot_t *slot, - size_t bits, - psa_key_derivation_operation_t *operation) -{ - uint8_t *data = NULL; - size_t bytes = PSA_BITS_TO_BYTES(bits); - size_t storage_size = bytes; - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_attributes_t attributes; - psa_key_type_t type = slot->attr.type; - int calculate_key = 0; - - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (key_type_is_raw_bytes(type)) { - if (bits % 8 != 0) return PSA_ERROR_INVALID_ARGUMENT; -#ifdef PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE - } else if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) { - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)) { - bytes = PSA_BITS_TO_BYTES(bits + 1); // ED needs an extra bit - } - calculate_key = 1; -#endif /* PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE */ -#ifdef PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE - } else if (PSA_KEY_TYPE_IS_SPAKE2P_KEY_PAIR(type)) { - storage_size = bytes * 2u; // w0 : w1 - bytes = storage_size + 16u; // w0s : w1s - calculate_key = 1; -#endif /* PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE */ -#ifdef PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_DERIVE - } else if (PSA_KEY_TYPE_IS_SRP_KEY_PAIR(type)) { - if (!PSA_ALG_IS_SRP_PASSWORD_HASH(operation->alg)) return PSA_ERROR_INVALID_ARGUMENT; - storage_size = bytes = PSA_HASH_LENGTH(operation->alg); -#endif /* PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_DERIVE */ - } else { - (void)calculate_key; - return PSA_ERROR_NOT_SUPPORTED; - } - - data = mbedtls_calloc(1, bytes); - if (data == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - slot->attr.bits = (psa_key_bits_t) bits; - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - if (psa_key_lifetime_is_external(attributes.core.lifetime)) { - status = psa_driver_wrapper_get_key_buffer_size(&attributes, - &storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - } - status = psa_allocate_buffer_to_slot(slot, storage_size); - if (status != PSA_SUCCESS) { - goto exit; - } - - do { - status = psa_key_derivation_output_bytes_internal(operation, data, bytes); - if (status != PSA_SUCCESS) goto exit; - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE) || defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE) - if (calculate_key) { - status = psa_driver_wrapper_derive_key( - &attributes, - data, bytes, - slot->key.data, slot->key.bytes, &slot->key.bytes); - - } else -#endif /* PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE || PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE */ - { - status = psa_driver_wrapper_import_key( - &attributes, - data, bytes, - slot->key.data, slot->key.bytes, &slot->key.bytes, - &bits); - if (bits != slot->attr.bits) { - status = PSA_ERROR_INVALID_ARGUMENT; - } - } - } while (status == PSA_ERROR_INSUFFICIENT_DATA); - -exit: - mbedtls_zeroize_and_free(data, bytes); - return status; -} - -psa_status_t psa_key_derivation_output_key(const psa_key_attributes_t *attributes, - psa_key_derivation_operation_t *operation, - mbedtls_svc_key_id_t *key) -{ - psa_status_t status; - psa_key_slot_t *slot = NULL; - psa_se_drv_table_entry_t *driver = NULL; - - *key = MBEDTLS_SVC_KEY_ID_INIT; - - /* Reject any attempt to create a zero-length key so that we don't - * risk tripping up later, e.g. on a malloc(0) that returns NULL. */ - if (psa_get_key_bits(attributes) == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_key_derivation_check_state(operation, PSA_KEY_DERIVATION_OUTPUT); - if (status != PSA_SUCCESS) return status; - - if (operation->no_output || !operation->can_output_key) { - return PSA_ERROR_NOT_PERMITTED; - } - - status = psa_start_key_creation(PSA_KEY_CREATION_DERIVE, attributes, - &slot, &driver); - if (status == PSA_SUCCESS) { - status = psa_generate_derived_key_internal(slot, - attributes->core.bits, - operation); - } - if (status == PSA_SUCCESS) { - status = psa_finish_key_creation(slot, driver, key); - } - if (status != PSA_SUCCESS) { - psa_fail_key_creation(slot, driver); - } - - return status; -} - -psa_status_t psa_key_derivation_verify_bytes( - psa_key_derivation_operation_t *operation, - const uint8_t *expected_output, - size_t output_length) -{ - psa_status_t status = PSA_SUCCESS; - uint8_t buffer[256]; - size_t length; - int diff = 0; - - status = psa_key_derivation_check_state(operation, PSA_KEY_DERIVATION_OUTPUT); - if (status != PSA_SUCCESS) goto exit; - - if (operation->no_verify) { - status = PSA_ERROR_NOT_PERMITTED; - goto exit; - } - - length = sizeof buffer; - while (output_length) { - if (output_length < length) length = output_length; - status = psa_key_derivation_output_bytes_internal(operation, buffer, length); - if (status != PSA_SUCCESS) return status; - diff |= mbedtls_ct_memcmp(buffer, expected_output, length); - expected_output += length; - output_length -= length; - } - if (diff) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; - -exit: - psa_key_derivation_abort(operation); - return status; -} - -psa_status_t psa_key_derivation_verify_key( - psa_key_derivation_operation_t *operation, - mbedtls_svc_key_id_t expected) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - - status = psa_get_and_lock_transparent_key_slot_with_policy( - expected, &slot, PSA_KEY_USAGE_VERIFY_DERIVATION, operation->alg); - if (status != PSA_SUCCESS) goto exit; - - if (slot->attr.type != PSA_KEY_TYPE_PASSWORD_HASH) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - if (operation->no_verify) { - status = PSA_ERROR_NOT_PERMITTED; - goto exit; - } - - status = psa_key_derivation_verify_bytes( - operation, slot->key.data, slot->key.bytes); - - unlock_status = psa_unlock_key_slot(slot); - return (status == PSA_SUCCESS) ? unlock_status : status; - -exit: - psa_unlock_key_slot(slot); - psa_key_derivation_abort(operation); - return status; -} - - -/****************************************************************/ -/* Key derivation */ -/****************************************************************/ - -psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation, psa_algorithm_t alg) -{ - psa_status_t status; - psa_algorithm_t kdf_alg = alg; - - if (operation->alg != 0) { - return PSA_ERROR_BAD_STATE; - } - - if (PSA_ALG_IS_RAW_KEY_AGREEMENT(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } else if (PSA_ALG_IS_KEY_AGREEMENT(alg)) { - kdf_alg = PSA_ALG_KEY_AGREEMENT_GET_KDF(alg); - } else if (!PSA_ALG_IS_KEY_DERIVATION(alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - -#if defined(PSA_WANT_ALG_TLS12_PRF) || defined(PSA_WANT_ALG_TLS12_PSK_TO_MS) - if (PSA_ALG_IS_TLS12_PRF(kdf_alg) || PSA_ALG_IS_TLS12_PSK_TO_MS(kdf_alg)) { - psa_algorithm_t hash_alg = PSA_ALG_HKDF_GET_HASH(kdf_alg); - if (hash_alg != PSA_ALG_SHA_256 && hash_alg != PSA_ALG_SHA_384) return PSA_ERROR_NOT_SUPPORTED; - } -#endif - - status = psa_driver_wrapper_key_derivation_setup(operation, kdf_alg); - if (status) return status; - - operation->alg = alg; - if (PSA_ALG_IS_HKDF(kdf_alg) || PSA_ALG_IS_HKDF_EXPAND(kdf_alg)) { - operation->capacity = 255 * PSA_HASH_LENGTH(kdf_alg); - } else if (PSA_ALG_IS_HKDF_EXTRACT(kdf_alg) || PSA_ALG_IS_SRP_PASSWORD_HASH(kdf_alg)) { - operation->capacity = PSA_HASH_LENGTH(kdf_alg); - } else if (kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS) { - operation->capacity = PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE; - } else if (PSA_ALG_IS_SP800_108_COUNTER_HMAC(kdf_alg) || kdf_alg == PSA_ALG_SP800_108_COUNTER_CMAC) { - operation->capacity = 0x1fffffff; - } else { - operation->capacity = PSA_KEY_DERIVATION_UNLIMITED_CAPACITY; - } - - return PSA_SUCCESS; -} - -/** Check whether the given key type is acceptable for the given - * input step of a key derivation. - * - * Secret inputs must have the type #PSA_KEY_TYPE_DERIVE. - * Non-secret inputs must have the type #PSA_KEY_TYPE_RAW_DATA. - * Both secret and non-secret inputs can alternatively have the type - * #PSA_KEY_TYPE_NONE, which is never the type of a key object, meaning - * that the input was passed as a buffer rather than via a key object. - */ -static int psa_key_derivation_check_input_type( - psa_key_derivation_step_t step, - psa_key_type_t key_type) -{ - switch (step) { - case PSA_KEY_DERIVATION_INPUT_PASSWORD: - if (key_type == PSA_KEY_TYPE_PASSWORD) { - return PSA_SUCCESS; - } - // fall through - case PSA_KEY_DERIVATION_INPUT_SECRET: - case PSA_KEY_DERIVATION_INPUT_OTHER_SECRET: - if (key_type == PSA_KEY_TYPE_DERIVE) { - return PSA_SUCCESS; - } - if (key_type == PSA_KEY_TYPE_NONE) { - return PSA_SUCCESS; - } - break; - case PSA_KEY_DERIVATION_INPUT_SALT: - if (key_type == PSA_KEY_TYPE_PEPPER) { - return PSA_SUCCESS; - } - // fall through - case PSA_KEY_DERIVATION_INPUT_LABEL: - case PSA_KEY_DERIVATION_INPUT_INFO: - case PSA_KEY_DERIVATION_INPUT_SEED: - case PSA_KEY_DERIVATION_INPUT_COST: - case PSA_KEY_DERIVATION_INPUT_CONTEXT: - if (key_type == PSA_KEY_TYPE_RAW_DATA) { - return PSA_SUCCESS; - } - if (key_type == PSA_KEY_TYPE_NONE) { - return PSA_SUCCESS; - } - break; - } - return PSA_ERROR_INVALID_ARGUMENT; -} - -static psa_status_t psa_key_derivation_input_internal( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - psa_key_type_t key_type, - const uint8_t *data, - size_t data_length) -{ - psa_status_t status; - status = psa_key_derivation_check_state(operation, step); - if (status != PSA_SUCCESS) goto exit; - - status = psa_key_derivation_check_input_type(step, key_type); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_driver_wrapper_key_derivation_input_bytes(operation, step, data, data_length); - if (status != PSA_SUCCESS) goto exit; - - return PSA_SUCCESS; - -exit: - psa_key_derivation_abort(operation); - return status; -} - -psa_status_t psa_key_derivation_input_bytes( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - const uint8_t *data, - size_t data_length) -{ - return psa_key_derivation_input_internal(operation, step, - PSA_KEY_TYPE_NONE, - data, data_length); -} - -psa_status_t psa_key_derivation_input_integer( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - uint64_t value) -{ - psa_status_t status; - status = psa_key_derivation_check_state(operation, step); - if (status != PSA_SUCCESS) goto exit; - - status = psa_key_derivation_check_input_type(step, PSA_KEY_TYPE_NONE); - if (status != PSA_SUCCESS) goto exit; - - if (PSA_ALG_IS_PBKDF2(operation->alg)) { - if (value == 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - if (value > PSA_VENDOR_PBKDF2_MAX_ITERATIONS) { - status = PSA_ERROR_NOT_SUPPORTED; - goto exit; - } - } - - status = psa_driver_wrapper_key_derivation_input_integer(operation, step, value); - if (status != PSA_SUCCESS) goto exit; - - return PSA_SUCCESS; - -exit: - psa_key_derivation_abort(operation); - return status; -} - -psa_status_t psa_key_derivation_input_key( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - mbedtls_svc_key_id_t key) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - - status = psa_get_and_lock_transparent_key_slot_with_policy( - key, &slot, 0, operation->alg); - if (status != PSA_SUCCESS) goto exit; - - /* check usage, PSA_KEY_USAGE_DERIVE or PSA_KEY_USAGE_VERIFY_DERIVATION */ - if ((slot->attr.policy.usage & PSA_KEY_USAGE_DERIVE) != 0) { - if ((slot->attr.policy.usage & PSA_KEY_USAGE_VERIFY_DERIVATION) == 0) { - operation->no_verify = 1; - } - } else { - operation->no_output = 1; - if ((slot->attr.policy.usage & PSA_KEY_USAGE_VERIFY_DERIVATION) == 0) { - status = PSA_ERROR_NOT_PERMITTED; - goto exit; - } - } - - /* Passing a key object as a SECRET or PASSWORD input unlocks the - * permission to output to a key object. */ - if (step == PSA_KEY_DERIVATION_INPUT_SECRET || - step == PSA_KEY_DERIVATION_INPUT_PASSWORD) { - operation->can_output_key = 1; - } - - status = psa_key_derivation_input_internal(operation, - step, slot->attr.type, - slot->key.data, - slot->key.bytes); - -exit: - unlock_status = psa_unlock_key_slot(slot); - - if (status == PSA_SUCCESS) { - status = unlock_status; - } else { - psa_key_derivation_abort(operation); - } - - return status; -} - - -/****************************************************************/ -/* Key agreement */ -/****************************************************************/ - -#define PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE (PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)) - -/* Note that if this function fails, you must call psa_key_derivation_abort() - * to potentially free embedded data structures and wipe confidential data. - */ -static psa_status_t psa_key_agreement_internal(psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - psa_key_slot_t *private_key, - const uint8_t *peer_key, - size_t peer_key_length) -{ - psa_status_t status; - uint8_t shared_secret[PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE]; - size_t shared_secret_length = 0; - psa_algorithm_t ka_alg = PSA_ALG_KEY_AGREEMENT_GET_BASE(operation->alg); - - /* Step 1: run the secret agreement algorithm to generate the shared - * secret. */ - psa_key_attributes_t attributes = { - .core = private_key->attr - }; - - status = psa_driver_wrapper_key_agreement( - &attributes, private_key->key.data, private_key->key.bytes, - ka_alg, - peer_key, peer_key_length, - shared_secret, sizeof(shared_secret), &shared_secret_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* Step 2: set up the key derivation to generate key material from - * the shared secret. A shared secret is permitted wherever a key - * of type DERIVE is permitted. */ - status = psa_key_derivation_input_internal(operation, step, - PSA_KEY_TYPE_DERIVE, - shared_secret, - shared_secret_length); -exit: - mbedtls_platform_zeroize(shared_secret, shared_secret_length); - return status; -} - -psa_status_t psa_key_derivation_key_agreement(psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - mbedtls_svc_key_id_t private_key, - const uint8_t *peer_key, - size_t peer_key_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot; - - if (!PSA_ALG_IS_KEY_AGREEMENT(operation->alg)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - status = psa_get_and_lock_transparent_key_slot_with_policy( - private_key, &slot, PSA_KEY_USAGE_DERIVE, operation->alg); - if (status != PSA_SUCCESS) { - return status; - } - status = psa_key_agreement_internal(operation, step, - slot, - peer_key, peer_key_length); - if (status != PSA_SUCCESS) { - psa_key_derivation_abort(operation); - } else { - /* If a private key has been added as SECRET, we allow the derived - * key material to be used as a key in PSA Crypto. */ - if (step == PSA_KEY_DERIVATION_INPUT_SECRET) { - operation->can_output_key = 1; - } - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - -psa_status_t psa_raw_key_agreement(psa_algorithm_t alg, - mbedtls_svc_key_id_t private_key, - const uint8_t *peer_key, - size_t peer_key_length, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_key_attributes_t attributes; - - if (!PSA_ALG_IS_KEY_AGREEMENT(alg)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - status = psa_get_and_lock_transparent_key_slot_with_policy( - private_key, &slot, PSA_KEY_USAGE_DERIVE, alg); - if (status != PSA_SUCCESS) { - goto exit; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_driver_wrapper_key_agreement( - &attributes, slot->key.data, slot->key.bytes, - alg, - peer_key, peer_key_length, - output, output_size, output_length); - -exit: - if (status != PSA_SUCCESS) { - /* If an error happens and is not handled properly, the output - * may be used as a key to protect sensitive data. Arrange for such - * a key to be random, which is likely to result in decryption or - * verification errors. This is better than filling the buffer with - * some constant data such as zeros, which would result in the data - * being protected with a reproducible, easily knowable key. - */ - psa_generate_random(output, output_size); - *output_length = output_size; - } - - unlock_status = psa_unlock_key_slot(slot); - - return (status == PSA_SUCCESS) ? unlock_status : status; -} - - -/****************************************************************/ -/* PAKE */ -/****************************************************************/ - -psa_status_t psa_pake_setup(psa_pake_operation_t *operation, - mbedtls_svc_key_id_t password_key, - const psa_pake_cipher_suite_t *cipher_suite) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED; - psa_algorithm_t alg = psa_pake_cs_get_algorithm(cipher_suite); - psa_pake_primitive_t primitive = psa_pake_cs_get_primitive(cipher_suite); - psa_pake_primitive_t ptype = PSA_PAKE_PRIMITIVE_GET_TYPE(primitive); - psa_ecc_family_t family = PSA_PAKE_PRIMITIVE_GET_FAMILY(primitive); - size_t bits = PSA_PAKE_PRIMITIVE_GET_BITS(primitive); - psa_key_attributes_t attributes; - psa_key_slot_t *slot = NULL; - psa_key_type_t ktype; - - if (operation->alg) { - return PSA_ERROR_BAD_STATE; - } - - if (!PSA_ALG_IS_PAKE(alg) || - (ptype != PSA_PAKE_PRIMITIVE_TYPE_ECC && ptype != PSA_PAKE_PRIMITIVE_TYPE_DH)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_get_and_lock_key_slot_with_policy( - password_key, &slot, PSA_KEY_USAGE_DERIVE, alg); - if (status != PSA_SUCCESS) goto exit; - ktype = slot->attr.type; - - if (PSA_ALG_IS_JPAKE(alg)) { - if ((ktype != PSA_KEY_TYPE_PASSWORD && ktype != PSA_KEY_TYPE_PASSWORD_HASH) || - psa_pake_cs_get_key_confirmation(cipher_suite) != PSA_PAKE_UNCONFIRMED_KEY) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - if (ptype == PSA_PAKE_PRIMITIVE_TYPE_ECC) { - operation->secret_size = PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(bits); - } else if (ptype == PSA_PAKE_PRIMITIVE_TYPE_DH) { - operation->secret_size = PSA_BITS_TO_BYTES(bits); - } else { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else { - if (PSA_ALG_IS_SPAKE2P(alg)) { - if (!PSA_KEY_TYPE_IS_SPAKE2P(ktype) || ptype != PSA_PAKE_PRIMITIVE_TYPE_ECC || - family != PSA_KEY_TYPE_SPAKE2P_GET_FAMILY(ktype)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else if (PSA_ALG_IS_SRP_6(alg)) { - if (!PSA_KEY_TYPE_IS_SRP(ktype) || ptype != PSA_PAKE_PRIMITIVE_TYPE_DH || - family != PSA_KEY_TYPE_SRP_GET_FAMILY(ktype)) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else { - status = PSA_ERROR_NOT_SUPPORTED; - goto exit; - } - if (psa_pake_cs_get_key_confirmation(cipher_suite) != PSA_PAKE_CONFIRMED_KEY || - bits != slot->attr.bits) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - - operation->secret_size = PSA_HASH_LENGTH(alg); - if (alg == PSA_ALG_SPAKE2P_MATTER) operation->secret_size >>= 1; - } - - attributes = (psa_key_attributes_t) { - .core = slot->attr - }; - - status = psa_driver_wrapper_pake_setup( - operation, &attributes, - slot->key.data, slot->key.bytes, - cipher_suite); - - operation->alg = alg; - operation->started = 0; - operation->sequence = 0; - -exit: - unlock_status = psa_unlock_key_slot(slot); - - if (status == PSA_SUCCESS) { - status = unlock_status; - } else { - psa_pake_abort(operation); - } - - return status; -} - -psa_status_t psa_pake_set_role(psa_pake_operation_t *operation, - psa_pake_role_t role) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0 || operation->role_set || operation->started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - -#ifdef PSA_WANT_ALG_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - if (role > PSA_PAKE_ROLE_SECOND) return PSA_ERROR_INVALID_ARGUMENT; - } else -#endif -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || \ - defined(PSA_WANT_ALG_SPAKE2P_MATTER) || defined(PSA_WANT_ALG_SRP_6) - if (PSA_ALG_IS_SPAKE2P(operation->alg) || PSA_ALG_IS_SRP_6(operation->alg)) { - if (role == PSA_PAKE_ROLE_SERVER) operation->is_second = 1; - else if (role != PSA_PAKE_ROLE_CLIENT) return PSA_ERROR_INVALID_ARGUMENT; - } else -#endif - { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_driver_wrapper_pake_set_role(operation, role); - if (status != PSA_SUCCESS) goto exit; - - operation->role_set = 1; - return PSA_SUCCESS; - -exit: - psa_pake_abort(operation); - return status; -} - -psa_status_t psa_pake_set_user(psa_pake_operation_t *operation, - const uint8_t *user_id, - size_t user_id_len) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0 || operation->user_set || operation->started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - -#ifdef PSA_WANT_ALG_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - if (user_id == NULL || user_id_len == 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - if (!operation->role_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - if (user_id == NULL && user_id_len != 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif -#ifdef PSA_WANT_ALG_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - if (!operation->role_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - if (user_id == NULL || user_id_len == 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif - { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_driver_wrapper_pake_set_user(operation, user_id, user_id_len); - if (status != PSA_SUCCESS) goto exit; - - operation->user_set = 1; - return PSA_SUCCESS; - -exit: - psa_pake_abort(operation); - return status; -} - -psa_status_t psa_pake_set_peer(psa_pake_operation_t *operation, - const uint8_t *peer_id, - size_t peer_id_len) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0 || operation->peer_set || operation->started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - -#ifdef PSA_WANT_ALG_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - if (!operation->user_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - if (peer_id == NULL || peer_id_len == 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - if (!operation->role_set) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - if (peer_id == NULL && peer_id_len != 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif - { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_pake_set_peer(operation, peer_id, peer_id_len); - if (status != PSA_SUCCESS) goto exit; - - operation->peer_set = 1; - return PSA_SUCCESS; - -exit: - psa_pake_abort(operation); - return status; -} - -psa_status_t psa_pake_set_context(psa_pake_operation_t *operation, - const uint8_t *context, - size_t context_len) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0 || operation->context_set || !operation->role_set || operation->started) { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - if (context == NULL && context_len != 0) { - status = PSA_ERROR_INVALID_ARGUMENT; - goto exit; - } - } else -#endif - { - status = PSA_ERROR_BAD_STATE; - goto exit; - } - - status = psa_driver_wrapper_pake_set_context(operation, context, context_len); - if (status != PSA_SUCCESS) goto exit; - - operation->context_set = 1; - return PSA_SUCCESS; - -exit: - psa_pake_abort(operation); - return status; -} - - -#ifdef PSA_WANT_ALG_JPAKE -/* JPAKE sequence numbers: - * first second - * 0- 2: output SHARE,PUBLIC,PROOF input SHARE,PUBLIC,PROOF - * 3- 5: output SHARE,PUBLIC,PROOF input SHARE,PUBLIC,PROOF - * 6- 8: input SHARE,PUBLIC,PROOF output SHARE,PUBLIC,PROOF - * 9-11: input SHARE,PUBLIC,PROOF output SHARE,PUBLIC,PROOF - * 12-14: output SHARE,PUBLIC,PROOF input SHARE,PUBLIC,PROOF - * 15-17: input SHARE,PUBLIC,PROOF output SHARE,PUBLIC,PROOF - */ - -static psa_status_t psa_check_jpake_sequence(psa_pake_operation_t *operation, - psa_pake_step_t step, - unsigned int first) -{ - if (step != PSA_PAKE_STEP_KEY_SHARE && step != PSA_PAKE_STEP_ZK_PUBLIC && step != PSA_PAKE_STEP_ZK_PROOF) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - switch (operation->sequence / 3) { - case 0: - case 1: - case 4: - if (!first) return PSA_ERROR_BAD_STATE; - break; - case 2: - case 3: - case 5: - if (first) return PSA_ERROR_BAD_STATE; - break; - default: - return PSA_ERROR_BAD_STATE; - } - - switch (operation->sequence % 3) { - case 0: - if (step != PSA_PAKE_STEP_KEY_SHARE) return PSA_ERROR_BAD_STATE; - break; - case 1: - if (step != PSA_PAKE_STEP_ZK_PUBLIC) return PSA_ERROR_BAD_STATE; - break; - case 2: - if (step != PSA_PAKE_STEP_ZK_PROOF) return PSA_ERROR_BAD_STATE; - break; - } - - if (operation->sequence == 17) operation->done = 1; - - return PSA_SUCCESS; -} -#endif - -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) -/* SPAKE2+ sequence numbers: - * prover (client) verifier (server) - * 0: output shareP input shareP - * 1: input shareV output shareV - * 2: input confirmV output confirmV - * 3: output confirmP input confirmP - */ - -static psa_status_t psa_check_spake2p_sequence(psa_pake_operation_t *operation, - psa_pake_step_t step, - unsigned int first) -{ - if (step != PSA_PAKE_STEP_KEY_SHARE && step != PSA_PAKE_STEP_CONFIRM) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - switch (operation->sequence) { - case 0: // shareP - if (!first || step != PSA_PAKE_STEP_KEY_SHARE) return PSA_ERROR_BAD_STATE; - break; - case 1: // shareV - if (first || step != PSA_PAKE_STEP_KEY_SHARE) return PSA_ERROR_BAD_STATE; - break; - case 2: // confirmV - if (first || step != PSA_PAKE_STEP_CONFIRM) return PSA_ERROR_BAD_STATE; - break; - case 3: // confirmP - if (!first || step != PSA_PAKE_STEP_CONFIRM) return PSA_ERROR_BAD_STATE; - operation->done = 1; - break; - default: - return PSA_ERROR_BAD_STATE; - } - - return PSA_SUCCESS; -} -#endif - -#ifdef PSA_WANT_ALG_SRP_6 -/* SRP sequence numbers: - * (salt and share can be used in any order) - * client server - * ~1: input salt input salt - * ~2: output client share input client share - * ~4: input server share output server share - * 7: output proof1 input proof1 - * 15: input proof2 output proof2 - */ - -static psa_status_t psa_check_srp_sequence(psa_pake_operation_t *operation, - psa_pake_step_t step, - unsigned int first) -{ - switch (step) { - case PSA_PAKE_STEP_SALT: - if (operation->sequence & 1) return PSA_ERROR_BAD_STATE; - break; - case PSA_PAKE_STEP_KEY_SHARE: - if (first) { - if (operation->sequence & 2) return PSA_ERROR_BAD_STATE; - operation->sequence += 1; - } else { - if (operation->sequence & 4) return PSA_ERROR_BAD_STATE; - operation->sequence += 3; - } - break; - case PSA_PAKE_STEP_CONFIRM: - if (first) { - if (operation->sequence != 7) return PSA_ERROR_BAD_STATE; - operation->sequence += 7; - } else { - if (operation->sequence != 15) return PSA_ERROR_BAD_STATE; - operation->done = 1; - } - break; - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} -#endif - -psa_status_t psa_pake_output(psa_pake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, - size_t output_size, - size_t *output_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0) { - return PSA_ERROR_BAD_STATE; - } - -#ifdef PSA_WANT_ALG_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - if (!operation->peer_set) return PSA_ERROR_BAD_STATE; - if (operation->sequence == 0 || operation->sequence == 12) operation->is_second = 0; - status = psa_check_jpake_sequence(operation, step, 1 - operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - if (!operation->role_set) return PSA_ERROR_BAD_STATE; - status = psa_check_spake2p_sequence(operation, step, 1 - operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif -#ifdef PSA_WANT_ALG_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - if (!operation->role_set || !operation->user_set) return PSA_ERROR_BAD_STATE; - if (step == PSA_PAKE_STEP_SALT) return PSA_ERROR_INVALID_ARGUMENT; - status = psa_check_srp_sequence(operation, step, 1 - operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif - { - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->started = 1; - operation->sequence++; - - status = psa_driver_wrapper_pake_output( - operation, step, - output, output_size, output_length); - - if (status != PSA_SUCCESS) { - psa_pake_abort(operation); - } - - return status; -} - -psa_status_t psa_pake_input(psa_pake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, - size_t input_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0) { - return PSA_ERROR_BAD_STATE; - } - - if (input == NULL || input_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - -#ifdef PSA_WANT_ALG_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - if (!operation->peer_set) return PSA_ERROR_BAD_STATE; - if (operation->sequence == 0 || operation->sequence == 12) operation->is_second = 1; - status = psa_check_jpake_sequence(operation, step, operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif -#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) || defined(PSA_WANT_ALG_SPAKE2P_CMAC) || defined(PSA_WANT_ALG_SPAKE2P_MATTER) - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - if (!operation->role_set) return PSA_ERROR_BAD_STATE; - status = psa_check_spake2p_sequence(operation, step, operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif -#ifdef PSA_WANT_ALG_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - if (!operation->role_set || !operation->user_set) return PSA_ERROR_BAD_STATE; - status = psa_check_srp_sequence(operation, step, operation->is_second); - if (status != PSA_SUCCESS) return status; - } else -#endif - { - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->started = 1; - operation->sequence++; - - status = psa_driver_wrapper_pake_input( - operation, step, - input, input_length); - - if (status != PSA_SUCCESS) { - psa_pake_abort(operation); - } - - return status; -} - -psa_status_t psa_pake_get_shared_key(psa_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t *key) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_slot_t *slot = NULL; - psa_se_drv_table_entry_t *driver = NULL; - psa_key_type_t type; - size_t storage_size; - - if (operation->alg == 0 || operation->done == 0) { - return PSA_ERROR_BAD_STATE; - } - - if (psa_get_key_bits(attributes) != 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - type = psa_get_key_type(attributes); - if (type != PSA_KEY_TYPE_DERIVE && type != PSA_KEY_TYPE_HMAC) { - if (PSA_ALG_IS_SPAKE2P(operation->alg) || PSA_ALG_IS_SRP_6(operation->alg)) { - // the SPAKE2+ and SRP secret can be used directly for symmetric crypto - if ((type & PSA_KEY_TYPE_CATEGORY_MASK) != PSA_KEY_TYPE_CATEGORY_SYMMETRIC) { - return PSA_ERROR_INVALID_ARGUMENT; - } - } else { - return PSA_ERROR_INVALID_ARGUMENT; - } - } - - status = psa_start_key_creation( - PSA_KEY_CREATION_DERIVE, attributes, &slot, &driver); - if (status != PSA_SUCCESS) goto exit; - - storage_size = operation->secret_size; - if (psa_key_lifetime_is_external(attributes->core.lifetime)) { - status = psa_driver_wrapper_get_key_buffer_size(attributes, &storage_size); - if (status != PSA_SUCCESS) goto exit; - } - status = psa_allocate_buffer_to_slot(slot, storage_size); - if (status != PSA_SUCCESS) goto exit; - - status = psa_driver_wrapper_pake_get_shared_key( - operation, attributes, - slot->key.data, slot->key.bytes, &slot->key.bytes); - if (status == PSA_SUCCESS) { - status = psa_finish_key_creation(slot, driver, key); - } - -exit: - if (status != PSA_SUCCESS) { - psa_fail_key_creation(slot, driver); - *key = MBEDTLS_SVC_KEY_ID_INIT; - } - - psa_pake_abort(operation); - return status; -} - -psa_status_t psa_pake_abort(psa_pake_operation_t *operation) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (operation->alg == 0) { - return PSA_SUCCESS; - } - - status = psa_driver_wrapper_pake_abort(operation); - - memset(operation, 0, sizeof(*operation)); - - return status; -} - - -/****************************************************************/ -/* Random generation */ -/****************************************************************/ - -psa_status_t psa_generate_random(uint8_t *output, - size_t output_size) -{ - GUARD_MODULE_INITIALIZED; - return psa_driver_wrapper_get_random( - &global_data.rng, - output, output_size); -} - -/* Wrapper function allowing the classic API to use the PSA RNG. - * - * `mbedtls_psa_get_random(MBEDTLS_PSA_RANDOM_STATE, ...)` calls - * `psa_generate_random(...)`. The state parameter is ignored since the - * PSA API doesn't support passing an explicit state. - * - * In the non-external case, psa_generate_random() calls an - * `mbedtls_xxx_drbg_random` function which has exactly the same signature - * and semantics as mbedtls_psa_get_random(). As an optimization, - * instead of doing this back-and-forth between the PSA API and the - * classic API, psa_crypto_random_impl.h defines `mbedtls_psa_get_random` - * as a constant function pointer to `mbedtls_xxx_drbg_random`. - */ -int mbedtls_psa_get_random(void *p_rng, - unsigned char *output, - size_t output_size) -{ - /* This function takes a pointer to the RNG state because that's what - * classic mbedtls functions using an RNG expect. The PSA RNG manages - * its own state internally and doesn't let the caller access that state. - * So we just ignore the state parameter, and in practice we'll pass - * NULL. */ - (void) p_rng; - psa_status_t status = psa_generate_random(output, output_size); - if (status == PSA_SUCCESS) { - return 0; - } else { - return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; - } -} - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) -#include "entropy_poll.h" - -psa_status_t mbedtls_psa_inject_entropy(const uint8_t *seed, - size_t seed_size) -{ - if (global_data.initialized) { - return PSA_ERROR_NOT_PERMITTED; - } - - if (((seed_size < MBEDTLS_ENTROPY_MIN_PLATFORM) || - (seed_size < MBEDTLS_ENTROPY_BLOCK_SIZE)) || - (seed_size > MBEDTLS_ENTROPY_MAX_SEED_SIZE)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return mbedtls_psa_storage_inject_entropy(seed, seed_size); -} -#endif /* MBEDTLS_PSA_INJECT_ENTROPY */ - -/** Validate the key type and size for key generation - * - * \param type The key type - * \param bits The number of bits of the key - * - * \retval #PSA_SUCCESS - * The key type and size are valid. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The size in bits of the key is not valid. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The type and/or the size in bits of the key or the combination of - * the two is not supported. - */ -static psa_status_t psa_validate_key_type_and_size_for_key_generation( - psa_key_type_t type, size_t bits) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - if (key_type_is_raw_bytes(type)) { - status = psa_validate_unstructured_key_bit_size(type, bits); - if (status != PSA_SUCCESS) { - return status; - } - } else -#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) - if (PSA_KEY_TYPE_IS_RSA(type) && PSA_KEY_TYPE_IS_KEY_PAIR(type)) { - if (bits > PSA_VENDOR_RSA_MAX_KEY_BITS) { - return PSA_ERROR_NOT_SUPPORTED; - } - if (bits < PSA_VENDOR_RSA_GENERATE_MIN_KEY_BITS) { - return PSA_ERROR_NOT_SUPPORTED; - } - - /* Accept only byte-aligned keys, for the same reasons as - * in psa_import_rsa_key(). */ - if (bits % 8 != 0) { - return PSA_ERROR_NOT_SUPPORTED; - } - } else -#endif /* defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) */ - -#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) - if (PSA_KEY_TYPE_IS_ECC(type) && PSA_KEY_TYPE_IS_KEY_PAIR(type)) { - /* To avoid empty block, return successfully here. */ - return PSA_SUCCESS; - } else -#endif /* defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) */ - { - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t psa_generate_key_internal( - const psa_key_attributes_t *attributes, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_type_t type = attributes->core.type; - -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) - if ((attributes->domain_parameters == NULL) && - (attributes->domain_parameters_size != 0)) { - return PSA_ERROR_INVALID_ARGUMENT; - } -#endif - - if (key_type_is_raw_bytes(type)) { - status = psa_generate_random(key_buffer, key_buffer_size); - if (status != PSA_SUCCESS) { - return status; - } - } else { - (void) key_buffer_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t psa_generate_key(const psa_key_attributes_t *attributes, - mbedtls_svc_key_id_t *key) -{ - psa_status_t status; - psa_key_slot_t *slot = NULL; - psa_se_drv_table_entry_t *driver = NULL; - size_t key_buffer_size; - - *key = MBEDTLS_SVC_KEY_ID_INIT; - - /* Reject any attempt to create a zero-length key so that we don't - * risk tripping up later, e.g. on a malloc(0) that returns NULL. */ - if (psa_get_key_bits(attributes) == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - /* Reject any attempt to create a public key. */ - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(attributes->core.type)) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - status = psa_start_key_creation(PSA_KEY_CREATION_GENERATE, attributes, - &slot, &driver); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* In the case of a transparent key or an opaque key stored in local - * storage ( thus not in the case of generating a key in a secure element - * with storage ( MBEDTLS_PSA_CRYPTO_SE_C ) ),we have to allocate a - * buffer to hold the generated key material. */ - if (slot->key.data == NULL) { - if (PSA_KEY_LIFETIME_GET_LOCATION(attributes->core.lifetime) == - PSA_KEY_LOCATION_LOCAL_STORAGE) { - status = psa_validate_key_type_and_size_for_key_generation( - attributes->core.type, attributes->core.bits); - if (status != PSA_SUCCESS) { - goto exit; - } - - key_buffer_size = PSA_EXPORT_KEY_OUTPUT_SIZE( - attributes->core.type, - attributes->core.bits); - } else { - status = psa_driver_wrapper_get_key_buffer_size( - attributes, &key_buffer_size); - if (status != PSA_SUCCESS) { - goto exit; - } - } - - status = psa_allocate_buffer_to_slot(slot, key_buffer_size); - if (status != PSA_SUCCESS) { - goto exit; - } - } - - status = psa_driver_wrapper_generate_key(attributes, - slot->key.data, slot->key.bytes, &slot->key.bytes); - - if (status != PSA_SUCCESS) { - psa_remove_key_data_from_memory(slot); - } - -exit: - if (status == PSA_SUCCESS) { - status = psa_finish_key_creation(slot, driver, key); - } - if (status != PSA_SUCCESS) { - psa_fail_key_creation(slot, driver); - } - - return status; -} - -/****************************************************************/ -/* Module setup */ -/****************************************************************/ - -psa_status_t mbedtls_psa_crypto_configure_entropy_sources( - void (* entropy_init)(mbedtls_entropy_context *ctx), - void (* entropy_free)(mbedtls_entropy_context *ctx)) -{ - (void)entropy_init; - (void)entropy_free; - return PSA_SUCCESS; -} - -void mbedtls_psa_crypto_free(void) -{ - psa_wipe_all_key_slots(); - psa_driver_wrapper_free_random(&global_data.rng); - /* Wipe all remaining data, including configuration. - * In particular, this sets all state indicator to the value - * indicating "uninitialized". */ - mbedtls_platform_zeroize(&global_data, sizeof(global_data)); - - /* Terminate drivers */ - psa_driver_wrapper_free(); -} - -#if defined(PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS) -/** Recover a transaction that was interrupted by a power failure. - * - * This function is called during initialization, before psa_crypto_init() - * returns. If this function returns a failure status, the initialization - * fails. - */ -static psa_status_t psa_crypto_recover_transaction( - const psa_crypto_transaction_t *transaction) -{ - switch (transaction->unknown.type) { - case PSA_CRYPTO_TRANSACTION_CREATE_KEY: - case PSA_CRYPTO_TRANSACTION_DESTROY_KEY: - /* TODO - fall through to the failure case until this - * is implemented. - * https://github.com/ARMmbed/mbed-crypto/issues/218 - */ - default: - /* We found an unsupported transaction in the storage. - * We don't know what state the storage is in. Give up. */ - return PSA_ERROR_DATA_INVALID; - } -} -#endif /* PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS */ - -psa_status_t psa_crypto_init(void) -{ - psa_status_t status; - - /* Double initialization is explicitly allowed. */ - if (global_data.initialized != 0) { - return PSA_SUCCESS; - } - - /* Init drivers */ - status = psa_driver_wrapper_init(); - if (status != PSA_SUCCESS) { - goto exit; - } - global_data.drivers_initialized = 1; - - /* Initialize and seed the random generator. */ - status = psa_driver_wrapper_init_random(&global_data.rng); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_initialize_key_slots(); - if (status != PSA_SUCCESS) { - goto exit; - } - -#if defined(PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS) - status = psa_crypto_load_transaction(); - if (status == PSA_SUCCESS) { - status = psa_crypto_recover_transaction(&psa_crypto_transaction); - if (status != PSA_SUCCESS) { - goto exit; - } - status = psa_crypto_stop_transaction(); - } else if (status == PSA_ERROR_DOES_NOT_EXIST) { - /* There's no transaction to complete. It's all good. */ - status = PSA_SUCCESS; - } -#endif /* PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS */ - - /* All done. */ - global_data.initialized = 1; - -exit: - if (status != PSA_SUCCESS) { - mbedtls_psa_crypto_free(); - } - return status; -} - -#endif /* MBEDTLS_PSA_CRYPTO_C */ diff --git a/ext/oberon/psa/core/library/psa_crypto_client.c b/ext/oberon/psa/core/library/psa_crypto_client.c deleted file mode 100644 index 4bbc8beed645..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_client.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * PSA crypto client code - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * NOTICE: This file has been modified by Oberon microsystems AG. - */ - -#include "common.h" -#include "psa/crypto.h" - -#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) - -#include -#include "mbedtls/platform.h" - -void psa_reset_key_attributes(psa_key_attributes_t *attributes) -{ -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ - mbedtls_free(attributes->domain_parameters); -#endif - memset(attributes, 0, sizeof(*attributes)); -} - -#if defined(PSA_USE_KEY_DOMAIN_PARAMETERS) /* !!OM */ -psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes, - psa_key_type_t type, - const uint8_t *data, - size_t data_length) -{ - uint8_t *copy = NULL; - - if (data_length != 0) { - copy = mbedtls_calloc(1, data_length); - if (copy == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(copy, data, data_length); - } - /* After this point, this function is guaranteed to succeed, so it - * can start modifying `*attributes`. */ - - if (attributes->domain_parameters != NULL) { - mbedtls_free(attributes->domain_parameters); - attributes->domain_parameters = NULL; - attributes->domain_parameters_size = 0; - } - - attributes->domain_parameters = copy; - attributes->domain_parameters_size = data_length; - attributes->core.type = type; - return PSA_SUCCESS; -} - -psa_status_t psa_get_key_domain_parameters( - const psa_key_attributes_t *attributes, - uint8_t *data, size_t data_size, size_t *data_length) -{ - if (attributes->domain_parameters_size > data_size) { - return PSA_ERROR_BUFFER_TOO_SMALL; - } - *data_length = attributes->domain_parameters_size; - if (attributes->domain_parameters_size != 0) { - memcpy(data, attributes->domain_parameters, - attributes->domain_parameters_size); - } - return PSA_SUCCESS; -} -#endif /* PSA_USE_KEY_DOMAIN_PARAMETERS */ -#endif /* MBEDTLS_PSA_CRYPTO_CLIENT */ diff --git a/ext/oberon/psa/core/library/psa_crypto_core.h b/ext/oberon/psa/core/library/psa_crypto_core.h deleted file mode 100644 index 722f33319048..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_core.h +++ /dev/null @@ -1,582 +0,0 @@ -/* - * PSA crypto core internal interfaces - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_CORE_H -#define PSA_CRYPTO_CORE_H - -#include "mbedtls/build_info.h" - -#include "psa/crypto.h" -#include "psa/crypto_se_driver.h" - -/** - * Tell if PSA is ready for this hash. - * - * \note For now, only checks the state of the driver subsystem, - * not the algorithm. Might do more in the future. - * - * \param hash_alg The hash algorithm (ignored for now). - * - * \return 1 if the driver subsytem is ready, 0 otherwise. - */ -int psa_can_do_hash(psa_algorithm_t hash_alg); - -/** The data structure representing a key slot, containing key material - * and metadata for one key. - */ -typedef struct { - psa_core_key_attributes_t attr; - - /* - * Number of locks on the key slot held by the library. - * - * This counter is incremented by one each time a library function - * retrieves through one of the dedicated internal API a pointer to the - * key slot. - * - * This counter is decremented by one each time a library function stops - * accessing the key slot and states it by calling the - * psa_unlock_key_slot() API. - * - * This counter is used to prevent resetting the key slot while the library - * may access it. For example, such control is needed in the following - * scenarios: - * . In case of key slot starvation, all key slots contain the description - * of a key, and the library asks for the description of a persistent - * key not present in the key slots, the key slots currently accessed by - * the library cannot be reclaimed to free a key slot to load the - * persistent key. - * . In case of a multi-threaded application where one thread asks to close - * or purge or destroy a key while it is in used by the library through - * another thread. - */ - size_t lock_count; - - /* Dynamically allocated key data buffer. - * Format as specified in psa_export_key(). */ - struct key_data { - uint8_t *data; - size_t bytes; - } key; -} psa_key_slot_t; - -/* A mask of key attribute flags used only internally. - * Currently there aren't any. */ -#define PSA_KA_MASK_INTERNAL_ONLY ( \ - 0) - -/** Test whether a key slot is occupied. - * - * A key slot is occupied iff the key type is nonzero. This works because - * no valid key can have 0 as its key type. - * - * \param[in] slot The key slot to test. - * - * \return 1 if the slot is occupied, 0 otherwise. - */ -static inline int psa_is_key_slot_occupied(const psa_key_slot_t *slot) -{ - return slot->attr.type != 0; -} - -/** Test whether a key slot is locked. - * - * A key slot is locked iff its lock counter is strictly greater than 0. - * - * \param[in] slot The key slot to test. - * - * \return 1 if the slot is locked, 0 otherwise. - */ -static inline int psa_is_key_slot_locked(const psa_key_slot_t *slot) -{ - return slot->lock_count > 0; -} - -/** Retrieve flags from psa_key_slot_t::attr::core::flags. - * - * \param[in] slot The key slot to query. - * \param mask The mask of bits to extract. - * - * \return The key attribute flags in the given slot, - * bitwise-anded with \p mask. - */ -static inline uint16_t psa_key_slot_get_flags(const psa_key_slot_t *slot, - uint16_t mask) -{ - return slot->attr.flags & mask; -} - -/** Set flags in psa_key_slot_t::attr::core::flags. - * - * \param[in,out] slot The key slot to modify. - * \param mask The mask of bits to modify. - * \param value The new value of the selected bits. - */ -static inline void psa_key_slot_set_flags(psa_key_slot_t *slot, - uint16_t mask, - uint16_t value) -{ - slot->attr.flags = ((~mask & slot->attr.flags) | - (mask & value)); -} - -/** Turn on flags in psa_key_slot_t::attr::core::flags. - * - * \param[in,out] slot The key slot to modify. - * \param mask The mask of bits to set. - */ -static inline void psa_key_slot_set_bits_in_flags(psa_key_slot_t *slot, - uint16_t mask) -{ - slot->attr.flags |= mask; -} - -/** Turn off flags in psa_key_slot_t::attr::core::flags. - * - * \param[in,out] slot The key slot to modify. - * \param mask The mask of bits to clear. - */ -static inline void psa_key_slot_clear_bits(psa_key_slot_t *slot, - uint16_t mask) -{ - slot->attr.flags &= ~mask; -} - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -/** Get the SE slot number of a key from the key slot storing its description. - * - * \param[in] slot The key slot to query. This must be a key slot storing - * the description of a key of a dynamically registered - * secure element, otherwise the behaviour is undefined. - */ -static inline psa_key_slot_number_t psa_key_slot_get_slot_number( - const psa_key_slot_t *slot) -{ - return *((psa_key_slot_number_t *) (slot->key.data)); -} -#endif - -/** Completely wipe a slot in memory, including its policy. - * - * Persistent storage is not affected. - * - * \param[in,out] slot The key slot to wipe. - * - * \retval #PSA_SUCCESS - * Success. This includes the case of a key slot that was - * already fully wiped. - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - */ -psa_status_t psa_wipe_key_slot(psa_key_slot_t *slot); - -/** Try to allocate a buffer to an empty key slot. - * - * \param[in,out] slot Key slot to attach buffer to. - * \param[in] buffer_length Requested size of the buffer. - * - * \retval #PSA_SUCCESS - * The buffer has been successfully allocated. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY - * Not enough memory was available for allocation. - * \retval #PSA_ERROR_ALREADY_EXISTS - * Trying to allocate a buffer to a non-empty key slot. - */ -psa_status_t psa_allocate_buffer_to_slot(psa_key_slot_t *slot, - size_t buffer_length); - -/** Wipe key data from a slot. Preserves metadata such as the policy. */ -psa_status_t psa_remove_key_data_from_memory(psa_key_slot_t *slot); - -/** Copy key data (in export format) into an empty key slot. - * - * This function assumes that the slot does not contain - * any key material yet. On failure, the slot content is unchanged. - * - * \param[in,out] slot Key slot to copy the key into. - * \param[in] data Buffer containing the key material. - * \param data_length Size of the key buffer. - * - * \retval #PSA_SUCCESS - * The key has been copied successfully. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY - * Not enough memory was available for allocation of the - * copy buffer. - * \retval #PSA_ERROR_ALREADY_EXISTS - * There was other key material already present in the slot. - */ -psa_status_t psa_copy_key_material_into_slot(psa_key_slot_t *slot, - const uint8_t *data, - size_t data_length); - -/** Convert an Mbed TLS error code to a PSA error code - * - * \note This function is provided solely for the convenience of - * Mbed TLS and may be removed at any time without notice. - * - * \param ret An Mbed TLS-thrown error code - * - * \return The corresponding PSA error code - */ -psa_status_t mbedtls_to_psa_error(int ret); - -/** Import a key in binary format. - * - * \note The signature of this function is that of a PSA driver - * import_key entry point. This function behaves as an import_key - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \param[in] attributes The attributes for the key to import. - * \param[in] data The buffer containing the key data in import - * format. - * \param[in] data_length Size of the \p data buffer in bytes. - * \param[out] key_buffer The buffer to contain the key data in output - * format upon successful return. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. This - * size is greater or equal to \p data_length. - * \param[out] key_buffer_length The length of the data written in \p - * key_buffer in bytes. - * \param[out] bits The key size in number of bits. - * - * \retval #PSA_SUCCESS The key was imported successfully. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The key data is not correctly formatted. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - */ -psa_status_t psa_import_key_into_slot( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key_buffer, size_t key_buffer_size, - size_t *key_buffer_length, size_t *bits); - -/** Export a key in binary format - * - * \note The signature of this function is that of a PSA driver export_key - * entry point. This function behaves as an export_key entry point as - * defined in the PSA driver interface specification. - * - * \param[in] attributes The attributes for the key to export. - * \param[in] key_buffer Material or context of the key to export. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[out] data Buffer where the key data is to be written. - * \param[in] data_size Size of the \p data buffer in bytes. - * \param[out] data_length On success, the number of bytes written in - * \p data - * - * \retval #PSA_SUCCESS The key was exported successfully. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - */ -psa_status_t psa_export_key_internal( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length); - -/** Export a public key or the public part of a key pair in binary format. - * - * \note The signature of this function is that of a PSA driver - * export_public_key entry point. This function behaves as an - * export_public_key entry point as defined in the PSA driver interface - * specification. - * - * \param[in] attributes The attributes for the key to export. - * \param[in] key_buffer Material or context of the key to export. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[out] data Buffer where the key data is to be written. - * \param[in] data_size Size of the \p data buffer in bytes. - * \param[out] data_length On success, the number of bytes written in - * \p data - * - * \retval #PSA_SUCCESS The public key was exported successfully. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - */ -psa_status_t psa_export_public_key_internal( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length); - -/** - * \brief Generate a key. - * - * \note The signature of the function is that of a PSA driver generate_key - * entry point. - * - * \param[in] attributes The attributes for the key to generate. - * \param[out] key_buffer Buffer where the key data is to be written. - * \param[in] key_buffer_size Size of \p key_buffer in bytes. - * \param[out] key_buffer_length On success, the number of bytes written in - * \p key_buffer. - * - * \retval #PSA_SUCCESS - * The key was generated successfully. - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED - * Key size in bits or type not supported. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of \p key_buffer is too small. - */ -psa_status_t psa_generate_key_internal(const psa_key_attributes_t *attributes, - uint8_t *key_buffer, - size_t key_buffer_size, - size_t *key_buffer_length); - -/** Sign a message with a private key. For hash-and-sign algorithms, - * this includes the hashing step. - * - * \note The signature of this function is that of a PSA driver - * sign_message entry point. This function behaves as a sign_message - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \note This function will call the driver for psa_sign_hash - * and go through driver dispatch again. - * - * \param[in] attributes The attributes of the key to use for the - * operation. - * \param[in] key_buffer The buffer containing the key context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[in] alg A signature algorithm that is compatible with - * the type of the key. - * \param[in] input The input message to sign. - * \param[in] input_length Size of the \p input buffer in bytes. - * \param[out] signature Buffer where the signature is to be written. - * \param[in] signature_size Size of the \p signature buffer in bytes. - * \param[out] signature_length On success, the number of bytes - * that make up the returned signature value. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p signature buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of the key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - */ -psa_status_t psa_sign_message_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *input, size_t input_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -/** Verify the signature of a message with a public key, using - * a hash-and-sign verification algorithm. - * - * \note The signature of this function is that of a PSA driver - * verify_message entry point. This function behaves as a verify_message - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \note This function will call the driver for psa_verify_hash - * and go through driver dispatch again. - * - * \param[in] attributes The attributes of the key to use for the - * operation. - * \param[in] key_buffer The buffer containing the key context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[in] alg A signature algorithm that is compatible with - * the type of the key. - * \param[in] input The message whose signature is to be verified. - * \param[in] input_length Size of the \p input buffer in bytes. - * \param[in] signature Buffer containing the signature to verify. - * \param[in] signature_length Size of the \p signature buffer in bytes. - * - * \retval #PSA_SUCCESS - * The signature is valid. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculation was performed successfully, but the passed - * signature is not a valid signature. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - */ -psa_status_t psa_verify_message_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *input, size_t input_length, - const uint8_t *signature, size_t signature_length); - -/** Sign an already-calculated hash with a private key. - * - * \note The signature of this function is that of a PSA driver - * sign_hash entry point. This function behaves as a sign_hash - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \param[in] attributes The attributes of the key to use for the - * operation. - * \param[in] key_buffer The buffer containing the key context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[in] alg A signature algorithm that is compatible with - * the type of the key. - * \param[in] hash The hash or message to sign. - * \param[in] hash_length Size of the \p hash buffer in bytes. - * \param[out] signature Buffer where the signature is to be written. - * \param[in] signature_size Size of the \p signature buffer in bytes. - * \param[out] signature_length On success, the number of bytes - * that make up the returned signature value. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * The size of the \p signature buffer is too small. You can - * determine a sufficient buffer size by calling - * #PSA_SIGN_OUTPUT_SIZE(\c key_type, \c key_bits, \p alg) - * where \c key_type and \c key_bits are the type and bit-size - * respectively of the key. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_ENTROPY \emptydescription - */ -psa_status_t psa_sign_hash_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -/** - * \brief Verify the signature a hash or short message using a public key. - * - * \note The signature of this function is that of a PSA driver - * verify_hash entry point. This function behaves as a verify_hash - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \param[in] attributes The attributes of the key to use for the - * operation. - * \param[in] key_buffer The buffer containing the key context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in bytes. - * \param[in] alg A signature algorithm that is compatible with - * the type of the key. - * \param[in] hash The hash or message whose signature is to be - * verified. - * \param[in] hash_length Size of the \p hash buffer in bytes. - * \param[in] signature Buffer containing the signature to verify. - * \param[in] signature_length Size of the \p signature buffer in bytes. - * - * \retval #PSA_SUCCESS - * The signature is valid. - * \retval #PSA_ERROR_INVALID_SIGNATURE - * The calculation was performed successfully, but the passed - * signature is not a valid signature. - * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - */ -psa_status_t psa_verify_hash_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - -/** - * \brief Validate the key bit size for unstructured keys. - * - * \note Check that the bit size is acceptable for a given key type for - * unstructured keys. - * - * \param[in] type The key type - * \param[in] bits The number of bits of the key - * - * \retval #PSA_SUCCESS - * The key type and size are valid. - * \retval #PSA_ERROR_INVALID_ARGUMENT - * The size in bits of the key is not valid. - * \retval #PSA_ERROR_NOT_SUPPORTED - * The type and/or the size in bits of the key or the combination of - * the two is not supported. - */ -psa_status_t psa_validate_unstructured_key_bit_size(psa_key_type_t type, - size_t bits); - -/** Perform a key agreement and return the raw shared secret, using - built-in raw key agreement functions. - * - * \note The signature of this function is that of a PSA driver - * key_agreement entry point. This function behaves as a key_agreement - * entry point as defined in the PSA driver interface specification for - * transparent drivers. - * - * \param[in] attributes The attributes of the key to use for the - * operation. - * \param[in] key_buffer The buffer containing the private key - * context. - * \param[in] key_buffer_size Size of the \p key_buffer buffer in - * bytes. - * \param[in] alg A key agreement algorithm that is - * compatible with the type of the key. - * \param[in] peer_key The buffer containing the key context - * of the peer's public key. - * \param[in] peer_key_length Size of the \p peer_key buffer in - * bytes. - * \param[out] shared_secret The buffer to which the shared secret - * is to be written. - * \param[in] shared_secret_size Size of the \p shared_secret buffer in - * bytes. - * \param[out] shared_secret_length On success, the number of bytes that make - * up the returned shared secret. - * \retval #PSA_SUCCESS - * Success. Shared secret successfully calculated. - * \retval #PSA_ERROR_INVALID_HANDLE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT - * \p alg is not a key agreement algorithm, or - * \p private_key is not compatible with \p alg, - * or \p peer_key is not valid for \p alg or not compatible with - * \p private_key. - * \retval #PSA_ERROR_BUFFER_TOO_SMALL - * \p shared_secret_size is too small - * \retval #PSA_ERROR_NOT_SUPPORTED - * \p alg is not a supported key agreement algorithm. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_COMMUNICATION_FAILURE \emptydescription - * \retval #PSA_ERROR_HARDWARE_FAILURE \emptydescription - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_BAD_STATE \emptydescription - */ -psa_status_t psa_key_agreement_raw_builtin( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *peer_key, - size_t peer_key_length, - uint8_t *shared_secret, - size_t shared_secret_size, - size_t *shared_secret_length); - -#endif /* PSA_CRYPTO_CORE_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_core_common.h b/ext/oberon/psa/core/library/psa_crypto_core_common.h deleted file mode 100644 index dd72ab162902..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_core_common.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * \file psa_crypto_core_common.h - * - * \brief Utility macros for internal use in the PSA cryptography core. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_CORE_COMMON_H -#define PSA_CRYPTO_CORE_COMMON_H - -/** Return an offset into a buffer. - * - * This is just the addition of an offset to a pointer, except that this - * function also accepts an offset of 0 into a buffer whose pointer is null. - * (`p + n` has undefined behavior when `p` is null, even when `n == 0`. - * A null pointer is a valid buffer pointer when the size is 0, for example - * as the result of `malloc(0)` on some platforms.) - * - * \param p Pointer to a buffer of at least n bytes. - * This may be \p NULL if \p n is zero. - * \param n An offset in bytes. - * \return Pointer to offset \p n in the buffer \p p. - * Note that this is only a valid pointer if the size of the - * buffer is at least \p n + 1. - */ -static inline unsigned char *psa_crypto_buffer_offset( - unsigned char *p, size_t n) -{ - return p == NULL ? NULL : p + n; -} - -/** Return an offset into a read-only buffer. - * - * Similar to mbedtls_buffer_offset(), but for const pointers. - * - * \param p Pointer to a buffer of at least n bytes. - * This may be \p NULL if \p n is zero. - * \param n An offset in bytes. - * \return Pointer to offset \p n in the buffer \p p. - * Note that this is only a valid pointer if the size of the - * buffer is at least \p n + 1. - */ -static inline const unsigned char *psa_crypto_buffer_offset_const( - const unsigned char *p, size_t n) -{ - return p == NULL ? NULL : p + n; -} - -#endif /* PSA_CRYPTO_CORE_COMMON_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_driver_wrappers.h b/ext/oberon/psa/core/library/psa_crypto_driver_wrappers.h deleted file mode 100644 index 12bf0fc5bf19..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_driver_wrappers.h +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Function signatures for functionality that can be provided by - * cryptographic accelerators. - */ -/* Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_DRIVER_WRAPPERS_H -#define PSA_CRYPTO_DRIVER_WRAPPERS_H - -#include "psa/crypto.h" -#include "psa/crypto_driver_common.h" - -/* - * Initialization and termination functions - */ -psa_status_t psa_driver_wrapper_init(void); -void psa_driver_wrapper_free(void); - -/* - * Signature functions - */ -psa_status_t psa_driver_wrapper_sign_message( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *signature, - size_t signature_size, - size_t *signature_length); - -psa_status_t psa_driver_wrapper_verify_message( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *signature, - size_t signature_length); - -psa_status_t psa_driver_wrapper_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -psa_status_t psa_driver_wrapper_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - -/* - * Interruptible Signature functions - */ - -uint32_t psa_driver_wrapper_sign_hash_get_num_ops( - psa_sign_hash_interruptible_operation_t *operation); - -uint32_t psa_driver_wrapper_verify_hash_get_num_ops( - psa_verify_hash_interruptible_operation_t *operation); - -psa_status_t psa_driver_wrapper_sign_hash_start( - psa_sign_hash_interruptible_operation_t *operation, - const psa_key_attributes_t *attributes, const uint8_t *key_buffer, - size_t key_buffer_size, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length); - -psa_status_t psa_driver_wrapper_sign_hash_complete( - psa_sign_hash_interruptible_operation_t *operation, - uint8_t *signature, size_t signature_size, - size_t *signature_length); - -psa_status_t psa_driver_wrapper_sign_hash_abort( - psa_sign_hash_interruptible_operation_t *operation); - -psa_status_t psa_driver_wrapper_verify_hash_start( - psa_verify_hash_interruptible_operation_t *operation, - const psa_key_attributes_t *attributes, const uint8_t *key_buffer, - size_t key_buffer_size, psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - -psa_status_t psa_driver_wrapper_verify_hash_complete( - psa_verify_hash_interruptible_operation_t *operation); - -psa_status_t psa_driver_wrapper_verify_hash_abort( - psa_verify_hash_interruptible_operation_t *operation); - -/* - * Key handling functions - */ - -psa_status_t psa_driver_wrapper_import_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key_buffer, size_t key_buffer_size, - size_t *key_buffer_length, size_t *bits); - -psa_status_t psa_driver_wrapper_export_key( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length); - -psa_status_t psa_driver_wrapper_export_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length); - -psa_status_t psa_driver_wrapper_get_key_buffer_size( - const psa_key_attributes_t *attributes, - size_t *key_buffer_size); - -psa_status_t psa_driver_wrapper_get_key_buffer_size_from_key_data( - const psa_key_attributes_t *attributes, - const uint8_t *data, - size_t data_length, - size_t *key_buffer_size); - -psa_status_t psa_driver_wrapper_generate_key( - const psa_key_attributes_t *attributes, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length); - -psa_status_t psa_driver_wrapper_get_builtin_key( - psa_drv_slot_number_t slot_number, - psa_key_attributes_t *attributes, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length); - -psa_status_t psa_driver_wrapper_copy_key( - psa_key_attributes_t *attributes, - const uint8_t *source_key, size_t source_key_length, - uint8_t *target_key_buffer, size_t target_key_buffer_size, - size_t *target_key_buffer_length); - -psa_status_t psa_driver_wrapper_derive_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length); - -/* - * Cipher functions - */ -psa_status_t psa_driver_wrapper_cipher_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *iv, - size_t iv_length, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_cipher_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_cipher_encrypt_setup( - psa_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_cipher_decrypt_setup( - psa_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_cipher_set_iv( - psa_cipher_operation_t *operation, - const uint8_t *iv, - size_t iv_length); - -psa_status_t psa_driver_wrapper_cipher_update( - psa_cipher_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_cipher_finish( - psa_cipher_operation_t *operation, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_cipher_abort( - psa_cipher_operation_t *operation); - -/* - * Hashing functions - */ -psa_status_t psa_driver_wrapper_hash_compute( - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *hash, - size_t hash_size, - size_t *hash_length); - -psa_status_t psa_driver_wrapper_hash_setup( - psa_hash_operation_t *operation, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_hash_clone( - const psa_hash_operation_t *source_operation, - psa_hash_operation_t *target_operation); - -psa_status_t psa_driver_wrapper_hash_update( - psa_hash_operation_t *operation, - const uint8_t *input, - size_t input_length); - -psa_status_t psa_driver_wrapper_hash_finish( - psa_hash_operation_t *operation, - uint8_t *hash, - size_t hash_size, - size_t *hash_length); - -psa_status_t psa_driver_wrapper_hash_abort( - psa_hash_operation_t *operation); - -/* - * AEAD functions - */ - -psa_status_t psa_driver_wrapper_aead_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *plaintext, size_t plaintext_length, - uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length); - -psa_status_t psa_driver_wrapper_aead_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *ciphertext, size_t ciphertext_length, - uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length); - -psa_status_t psa_driver_wrapper_aead_encrypt_setup( - psa_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_aead_decrypt_setup( - psa_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_aead_set_nonce( - psa_aead_operation_t *operation, - const uint8_t *nonce, - size_t nonce_length); - -psa_status_t psa_driver_wrapper_aead_set_lengths( - psa_aead_operation_t *operation, - size_t ad_length, - size_t plaintext_length); - -psa_status_t psa_driver_wrapper_aead_update_ad( - psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length); - -psa_status_t psa_driver_wrapper_aead_update( - psa_aead_operation_t *operation, - const uint8_t *input, - size_t input_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_aead_finish( - psa_aead_operation_t *operation, - uint8_t *ciphertext, - size_t ciphertext_size, - size_t *ciphertext_length, - uint8_t *tag, - size_t tag_size, - size_t *tag_length); - -psa_status_t psa_driver_wrapper_aead_verify( - psa_aead_operation_t *operation, - uint8_t *plaintext, - size_t plaintext_size, - size_t *plaintext_length, - const uint8_t *tag, - size_t tag_length); - -psa_status_t psa_driver_wrapper_aead_abort( - psa_aead_operation_t *operation); - -/* - * MAC functions - */ -psa_status_t psa_driver_wrapper_mac_compute( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - uint8_t *mac, - size_t mac_size, - size_t *mac_length); - -psa_status_t psa_driver_wrapper_mac_sign_setup( - psa_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_mac_verify_setup( - psa_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_mac_update( - psa_mac_operation_t *operation, - const uint8_t *input, - size_t input_length); - -psa_status_t psa_driver_wrapper_mac_sign_finish( - psa_mac_operation_t *operation, - uint8_t *mac, - size_t mac_size, - size_t *mac_length); - -psa_status_t psa_driver_wrapper_mac_verify_finish( - psa_mac_operation_t *operation, - const uint8_t *mac, - size_t mac_length); - -psa_status_t psa_driver_wrapper_mac_abort( - psa_mac_operation_t *operation); - -/* - * Asymmetric cryptography - */ -psa_status_t psa_driver_wrapper_asymmetric_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_asymmetric_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, - size_t input_length, - const uint8_t *salt, - size_t salt_length, - uint8_t *output, - size_t output_size, - size_t *output_length); - -/* - * Raw Key Agreement - */ -psa_status_t psa_driver_wrapper_key_agreement( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, - size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *peer_key, - size_t peer_key_length, - uint8_t *shared_secret, - size_t shared_secret_size, - size_t *shared_secret_length); - -/* - * KDF functions - */ -psa_status_t psa_driver_wrapper_key_derivation_setup( - psa_key_derivation_operation_t *operation, - psa_algorithm_t alg); - -psa_status_t psa_driver_wrapper_key_derivation_set_capacity( - psa_key_derivation_operation_t *operation, - size_t capacity); - -psa_status_t psa_driver_wrapper_key_derivation_input_bytes( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - const uint8_t *data, size_t data_length); - -psa_status_t psa_driver_wrapper_key_derivation_input_integer( - psa_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - uint64_t value); - -psa_status_t psa_driver_wrapper_key_derivation_output_bytes( - psa_key_derivation_operation_t *operation, - uint8_t *output, size_t output_length); - -psa_status_t psa_driver_wrapper_key_derivation_abort( - psa_key_derivation_operation_t *operation); - -/* - * PAKE functions. - */ -psa_status_t psa_driver_wrapper_pake_setup( - psa_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite); - -psa_status_t psa_driver_wrapper_pake_set_role( - psa_pake_operation_t *operation, - psa_pake_role_t role); - -psa_status_t psa_driver_wrapper_pake_set_user( - psa_pake_operation_t *operation, - const uint8_t *user_id, size_t user_id_length); - -psa_status_t psa_driver_wrapper_pake_set_peer( - psa_pake_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_length); - -psa_status_t psa_driver_wrapper_pake_set_context( - psa_pake_operation_t *operation, - const uint8_t *context, size_t context_length); - -psa_status_t psa_driver_wrapper_pake_output( - psa_pake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, - size_t output_size, - size_t *output_length); - -psa_status_t psa_driver_wrapper_pake_input( - psa_pake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, - size_t input_length); - -psa_status_t psa_driver_wrapper_pake_get_shared_key( - psa_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length); - -psa_status_t psa_driver_wrapper_pake_abort( - psa_pake_operation_t *operation); - -/* - * Random - */ -psa_status_t psa_driver_wrapper_get_entropy( - uint32_t flags, - size_t *estimate_bits, - uint8_t *output, - size_t output_size); - -psa_status_t psa_driver_wrapper_init_random( - psa_driver_random_context_t *context); - -psa_status_t psa_driver_wrapper_get_random( - psa_driver_random_context_t *context, - uint8_t *output, - size_t output_size); - -psa_status_t psa_driver_wrapper_free_random( - psa_driver_random_context_t *context); - -#endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_driver_wrappers_no_static.h b/ext/oberon/psa/core/library/psa_crypto_driver_wrappers_no_static.h deleted file mode 100644 index 4985403cd2ca..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_driver_wrappers_no_static.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Function signatures for functionality that can be provided by - * cryptographic accelerators. - */ -/* Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_DRIVER_WRAPPERS_NO_STATIC_H -#define PSA_CRYPTO_DRIVER_WRAPPERS_NO_STATIC_H - -#include "psa/crypto.h" -#include "psa/crypto_driver_common.h" - -psa_status_t psa_driver_wrapper_export_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - uint8_t *data, size_t data_size, size_t *data_length); - -psa_status_t psa_driver_wrapper_get_key_buffer_size( - const psa_key_attributes_t *attributes, - size_t *key_buffer_size); - -psa_status_t psa_driver_wrapper_get_builtin_key( - psa_drv_slot_number_t slot_number, - psa_key_attributes_t *attributes, - uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length); - -#endif /* PSA_CRYPTO_DRIVER_WRAPPERS_NO_STATIC_H */ - -/* End of automatically generated file. */ diff --git a/ext/oberon/psa/core/library/psa_crypto_invasive.h b/ext/oberon/psa/core/library/psa_crypto_invasive.h deleted file mode 100644 index a900dd8ff748..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_invasive.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \file psa_crypto_invasive.h - * - * \brief PSA cryptography module: invasive interfaces for test only. - * - * The interfaces in this file are intended for testing purposes only. - * They MUST NOT be made available to clients over IPC in integrations - * with isolation, and they SHOULD NOT be made available in library - * integrations except when building the library for testing. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_INVASIVE_H -#define PSA_CRYPTO_INVASIVE_H - -#include "mbedtls/build_info.h" - -#include "psa/crypto.h" -#include "common.h" - -#include "mbedtls/entropy.h" - -#if !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) -/** \brief Configure entropy sources. - * - * This function may only be called before a call to psa_crypto_init(), - * or after a call to mbedtls_psa_crypto_free() and before any - * subsequent call to psa_crypto_init(). - * - * This function is only intended for test purposes. The functionality - * it provides is also useful for system integrators, but - * system integrators should configure entropy drivers instead of - * breaking through to the Mbed TLS API. - * - * \param entropy_init Function to initialize the entropy context - * and set up the desired entropy sources. - * It is called by psa_crypto_init(). - * By default this is mbedtls_entropy_init(). - * This function cannot report failures directly. - * To indicate a failure, set the entropy context - * to a state where mbedtls_entropy_func() will - * return an error. - * \param entropy_free Function to free the entropy context - * and associated resources. - * It is called by mbedtls_psa_crypto_free(). - * By default this is mbedtls_entropy_free(). - * - * \retval #PSA_SUCCESS - * Success. - * \retval #PSA_ERROR_NOT_PERMITTED - * The caller does not have the permission to configure - * entropy sources. - * \retval #PSA_ERROR_BAD_STATE - * The library has already been initialized. - */ -psa_status_t mbedtls_psa_crypto_configure_entropy_sources( - void (* entropy_init)(mbedtls_entropy_context *ctx), - void (* entropy_free)(mbedtls_entropy_context *ctx)); -#endif /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */ - -#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C) -psa_status_t psa_mac_key_can_do( - psa_algorithm_t algorithm, - psa_key_type_t key_type); -#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_PSA_CRYPTO_C */ - -#endif /* PSA_CRYPTO_INVASIVE_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_its.h b/ext/oberon/psa/core/library/psa_crypto_its.h deleted file mode 100644 index 3ceee49bea94..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_its.h +++ /dev/null @@ -1,143 +0,0 @@ -/** \file psa_crypto_its.h - * \brief Interface of trusted storage that crypto is built on. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_ITS_H -#define PSA_CRYPTO_ITS_H - -#include -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** \brief Flags used when creating a data entry - */ -typedef uint32_t psa_storage_create_flags_t; - -/** \brief A type for UIDs used for identifying data - */ -typedef uint64_t psa_storage_uid_t; - -#define PSA_STORAGE_FLAG_NONE 0 /**< No flags to pass */ -#define PSA_STORAGE_FLAG_WRITE_ONCE (1 << 0) /**< The data associated with the uid will not be able to be modified or deleted. Intended to be used to set bits in `psa_storage_create_flags_t`*/ - -/** - * \brief A container for metadata associated with a specific uid - */ -struct psa_storage_info_t { - uint32_t size; /**< The size of the data associated with a uid **/ - psa_storage_create_flags_t flags; /**< The flags set when the uid was created **/ -}; - -/** Flag indicating that \ref psa_storage_create and \ref psa_storage_set_extended are supported */ -#define PSA_STORAGE_SUPPORT_SET_EXTENDED (1 << 0) - -#define PSA_ITS_API_VERSION_MAJOR 1 /**< The major version number of the PSA ITS API. It will be incremented on significant updates that may include breaking changes */ -#define PSA_ITS_API_VERSION_MINOR 1 /**< The minor version number of the PSA ITS API. It will be incremented in small updates that are unlikely to include breaking changes */ - -/** - * \brief create a new or modify an existing uid/value pair - * - * \param[in] uid the identifier for the data - * \param[in] data_length The size in bytes of the data in `p_data` - * \param[in] p_data A buffer containing the data - * \param[in] create_flags The flags that the data will be stored with - * - * \return A status indicating the success/failure of the operation - * - * \retval #PSA_SUCCESS The operation completed successfully - * \retval #PSA_ERROR_NOT_PERMITTED The operation failed because the provided `uid` value was already created with PSA_STORAGE_FLAG_WRITE_ONCE - * \retval #PSA_ERROR_NOT_SUPPORTED The operation failed because one or more of the flags provided in `create_flags` is not supported or is not valid - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE The operation failed because there was insufficient space on the storage medium - * \retval #PSA_ERROR_STORAGE_FAILURE The operation failed because the physical storage has failed (Fatal error) - * \retval #PSA_ERROR_INVALID_ARGUMENT The operation failed because one of the provided pointers(`p_data`) - * is invalid, for example is `NULL` or references memory the caller cannot access - */ -psa_status_t psa_its_set(psa_storage_uid_t uid, - uint32_t data_length, - const void *p_data, - psa_storage_create_flags_t create_flags); - -/** - * \brief Retrieve the value associated with a provided uid - * - * \param[in] uid The uid value - * \param[in] data_offset The starting offset of the data requested - * \param[in] data_length the amount of data requested (and the minimum allocated size of the `p_data` buffer) - * \param[out] p_data The buffer where the data will be placed upon successful completion - * \param[out] p_data_length The amount of data returned in the p_data buffer - * - * - * \return A status indicating the success/failure of the operation - * - * \retval #PSA_SUCCESS The operation completed successfully - * \retval #PSA_ERROR_DOES_NOT_EXIST The operation failed because the provided `uid` value was not found in the storage - * \retval #PSA_ERROR_STORAGE_FAILURE The operation failed because the physical storage has failed (Fatal error) - * \retval #PSA_ERROR_DATA_CORRUPT The operation failed because stored data has been corrupted - * \retval #PSA_ERROR_INVALID_ARGUMENT The operation failed because one of the provided pointers(`p_data`, `p_data_length`) - * is invalid. For example is `NULL` or references memory the caller cannot access. - * In addition, this can also happen if an invalid offset was provided. - */ -psa_status_t psa_its_get(psa_storage_uid_t uid, - uint32_t data_offset, - uint32_t data_length, - void *p_data, - size_t *p_data_length); - -/** - * \brief Retrieve the metadata about the provided uid - * - * \param[in] uid The uid value - * \param[out] p_info A pointer to the `psa_storage_info_t` struct that will be populated with the metadata - * - * \return A status indicating the success/failure of the operation - * - * \retval #PSA_SUCCESS The operation completed successfully - * \retval #PSA_ERROR_DOES_NOT_EXIST The operation failed because the provided uid value was not found in the storage - * \retval #PSA_ERROR_DATA_CORRUPT The operation failed because stored data has been corrupted - * \retval #PSA_ERROR_INVALID_ARGUMENT The operation failed because one of the provided pointers(`p_info`) - * is invalid, for example is `NULL` or references memory the caller cannot access - */ -psa_status_t psa_its_get_info(psa_storage_uid_t uid, - struct psa_storage_info_t *p_info); - -/** - * \brief Remove the provided key and its associated data from the storage - * - * \param[in] uid The uid value - * - * \return A status indicating the success/failure of the operation - * - * \retval #PSA_SUCCESS The operation completed successfully - * \retval #PSA_ERROR_DOES_NOT_EXIST The operation failed because the provided key value was not found in the storage - * \retval #PSA_ERROR_NOT_PERMITTED The operation failed because the provided key value was created with PSA_STORAGE_FLAG_WRITE_ONCE - * \retval #PSA_ERROR_STORAGE_FAILURE The operation failed because the physical storage has failed (Fatal error) - */ -psa_status_t psa_its_remove(psa_storage_uid_t uid); - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_ITS_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_random_impl.h b/ext/oberon/psa/core/library/psa_crypto_random_impl.h deleted file mode 100644 index c4021ceb1eac..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_random_impl.h +++ /dev/null @@ -1,204 +0,0 @@ -/** \file psa_crypto_random_impl.h - * - * \brief PSA crypto random generator implementation abstraction. - * - * The definitions here need to be consistent with the declarations - * in include/psa_util_internal.h. This file contains some redundant - * declarations to increase the chance that a compiler will detect - * inconsistencies if one file is changed without updating the other, - * but not all potential inconsistencies can be enforced, so make sure - * to check the public declarations and contracts in - * include/psa_util_internal.h if you modify this file. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_RANDOM_IMPL_H -#define PSA_CRYPTO_RANDOM_IMPL_H - -#include "psa_util_internal.h" - -#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) - -#include -#include // only for error codes -#include - -typedef mbedtls_psa_external_random_context_t mbedtls_psa_random_context_t; - -/* Trivial wrapper around psa_generate_random(). */ -int mbedtls_psa_get_random(void *p_rng, - unsigned char *output, - size_t output_size); - -/* The PSA RNG API doesn't need any externally maintained state. */ -#define MBEDTLS_PSA_RANDOM_STATE NULL - -#else /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ - -/* Choose a DRBG based on configuration and availability */ -#if defined(MBEDTLS_PSA_HMAC_DRBG_MD_TYPE) - -#include "mbedtls/hmac_drbg.h" - -#elif defined(MBEDTLS_CTR_DRBG_C) - -#include "mbedtls/ctr_drbg.h" - -#elif defined(MBEDTLS_HMAC_DRBG_C) - -#include "mbedtls/hmac_drbg.h" -#if defined(MBEDTLS_MD_CAN_SHA512) && defined(MBEDTLS_MD_CAN_SHA256) -#include -#if SIZE_MAX > 0xffffffff -/* Looks like a 64-bit system, so prefer SHA-512. */ -#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA512 -#else -/* Looks like a 32-bit system, so prefer SHA-256. */ -#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA256 -#endif -#elif defined(MBEDTLS_MD_CAN_SHA512) -#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA512 -#elif defined(MBEDTLS_MD_CAN_SHA256) -#define MBEDTLS_PSA_HMAC_DRBG_MD_TYPE MBEDTLS_MD_SHA256 -#else -#error "No hash algorithm available for HMAC_DBRG." -#endif - -#else -#error "No DRBG module available for the psa_crypto module." -#endif - -#include "mbedtls/entropy.h" - -/** Initialize the PSA DRBG. - * - * \param p_rng Pointer to the Mbed TLS DRBG state. - */ -static inline void mbedtls_psa_drbg_init(mbedtls_psa_drbg_context_t *p_rng) -{ -#if defined(MBEDTLS_CTR_DRBG_C) - mbedtls_ctr_drbg_init(p_rng); -#elif defined(MBEDTLS_HMAC_DRBG_C) - mbedtls_hmac_drbg_init(p_rng); -#endif -} - -/** Deinitialize the PSA DRBG. - * - * \param p_rng Pointer to the Mbed TLS DRBG state. - */ -static inline void mbedtls_psa_drbg_free(mbedtls_psa_drbg_context_t *p_rng) -{ -#if defined(MBEDTLS_CTR_DRBG_C) - mbedtls_ctr_drbg_free(p_rng); -#elif defined(MBEDTLS_HMAC_DRBG_C) - mbedtls_hmac_drbg_free(p_rng); -#endif -} - -/** The type of the PSA random generator context. - * - * The random generator context is composed of an entropy context and - * a DRBG context. - */ -typedef struct { - void (* entropy_init)(mbedtls_entropy_context *ctx); - void (* entropy_free)(mbedtls_entropy_context *ctx); - mbedtls_entropy_context entropy; - mbedtls_psa_drbg_context_t drbg; -} mbedtls_psa_random_context_t; - -/* Defined in include/psa_util_internal.h so that it's visible to - * application code. The declaration here is redundant, but included - * as a safety net to make it more likely that a future change that - * accidentally causes the implementation to diverge from the interface - * will be noticed. */ -/* Do not include the declaration under MSVC because it doesn't accept it - * ("error C2370: 'mbedtls_psa_get_random' : redefinition; different storage class"). - * Observed with Visual Studio 2013. A known bug apparently: - * https://stackoverflow.com/questions/8146541/duplicate-external-static-declarations-not-allowed-in-visual-studio - */ -#if !defined(_MSC_VER) -//static mbedtls_f_rng_t *const mbedtls_psa_get_random; /* !!OM */ -#endif - -/** The maximum number of bytes that mbedtls_psa_get_random() is expected to - * return. - */ -#if defined(MBEDTLS_CTR_DRBG_C) -#define MBEDTLS_PSA_RANDOM_MAX_REQUEST MBEDTLS_CTR_DRBG_MAX_REQUEST -#elif defined(MBEDTLS_HMAC_DRBG_C) -#define MBEDTLS_PSA_RANDOM_MAX_REQUEST MBEDTLS_HMAC_DRBG_MAX_REQUEST -#endif - -/** A pointer to the PSA DRBG state. - * - * This variable is only intended to be used through the macro - * #MBEDTLS_PSA_RANDOM_STATE. - */ -/* psa_crypto.c sets this variable to a pointer to the DRBG state in the - * global PSA crypto state. */ -/* The type `mbedtls_psa_drbg_context_t` is defined in - * include/psa_util_internal.h so that `mbedtls_psa_random_state` can be - * declared there and be visible to application code. */ -extern mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state; - -/** A pointer to the PSA DRBG state. - * - * This macro expands to an expression that is suitable as the \c p_rng - * parameter to pass to mbedtls_psa_get_random(). - * - * This macro exists in all configurations where the psa_crypto module is - * enabled. Its expansion depends on the configuration. - */ -#define MBEDTLS_PSA_RANDOM_STATE mbedtls_psa_random_state - -/** Seed the PSA DRBG. - * - * \param entropy An entropy context to read the seed from. - * \param custom The personalization string. - * This can be \c NULL, in which case the personalization - * string is empty regardless of the value of \p len. - * \param len The length of the personalization string. - * - * \return \c 0 on success. - * \return An Mbed TLS error code (\c MBEDTLS_ERR_xxx) on failure. - */ -static inline int mbedtls_psa_drbg_seed( - mbedtls_entropy_context *entropy, - const unsigned char *custom, size_t len) -{ -#if defined(MBEDTLS_CTR_DRBG_C) - return mbedtls_ctr_drbg_seed(MBEDTLS_PSA_RANDOM_STATE, - mbedtls_entropy_func, - entropy, - custom, len); -#elif defined(MBEDTLS_HMAC_DRBG_C) - const mbedtls_md_info_t *md_info = - mbedtls_md_info_from_type(MBEDTLS_PSA_HMAC_DRBG_MD_TYPE); - return mbedtls_hmac_drbg_seed(MBEDTLS_PSA_RANDOM_STATE, - md_info, - mbedtls_entropy_func, - entropy, - custom, len); -#endif -} - -#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ - -#endif /* PSA_CRYPTO_RANDOM_IMPL_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_se.h b/ext/oberon/psa/core/library/psa_crypto_se.h deleted file mode 100644 index a1e5e0922561..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_se.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * PSA crypto support for secure element drivers - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_SE_H -#define PSA_CRYPTO_SE_H - -#include "mbedtls/build_info.h" - -#include "psa/crypto.h" -#include "psa/crypto_se_driver.h" - -/** The maximum location value that this implementation supports - * for a secure element. - * - * This is not a characteristic that each PSA implementation has, but a - * limitation of the current implementation due to the constraints imposed - * by storage. See #PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE. - * - * The minimum location value for a secure element is 1, like on any - * PSA implementation (0 means a transparent key). - */ -#define PSA_MAX_SE_LOCATION 255 - -/** The base of the range of ITS file identifiers for secure element - * driver persistent data. - * - * We use a slice of the implementation reserved range 0xffff0000..0xffffffff, - * specifically the range 0xfffffe00..0xfffffeff. The length of this range - * drives the value of #PSA_MAX_SE_LOCATION. The identifier 0xfffffe00 is - * actually not used since it corresponds to #PSA_KEY_LOCATION_LOCAL_STORAGE - * which doesn't have a driver. - */ -#define PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE ((psa_key_id_t) 0xfffffe00) - -/** The maximum number of registered secure element driver locations. */ -#define PSA_MAX_SE_DRIVERS 4 - -/** Unregister all secure element drivers. - * - * \warning Do not call this function while the library is in the initialized - * state. This function is only intended to be called at the end - * of mbedtls_psa_crypto_free(). - */ -void psa_unregister_all_se_drivers(void); - -/** Initialize all secure element drivers. - * - * Called from psa_crypto_init(). - */ -psa_status_t psa_init_all_se_drivers(void); - -/** A structure that describes a registered secure element driver. - * - * A secure element driver table entry contains a pointer to the - * driver's method table as well as the driver context structure. - */ -typedef struct psa_se_drv_table_entry_s psa_se_drv_table_entry_t; - -/** Return the secure element driver information for a lifetime value. - * - * \param lifetime The lifetime value to query. - * \param[out] p_methods On output, if there is a driver, - * \c *methods points to its method table. - * Otherwise \c *methods is \c NULL. - * \param[out] p_drv_context On output, if there is a driver, - * \c *drv_context points to its context - * structure. - * Otherwise \c *drv_context is \c NULL. - * - * \retval 1 - * \p lifetime corresponds to a registered driver. - * \retval 0 - * \p lifetime does not correspond to a registered driver. - */ -int psa_get_se_driver(psa_key_lifetime_t lifetime, - const psa_drv_se_t **p_methods, - psa_drv_se_context_t **p_drv_context); - -/** Return the secure element driver table entry for a lifetime value. - * - * \param lifetime The lifetime value to query. - * - * \return The driver table entry for \p lifetime, or - * \p NULL if \p lifetime does not correspond to a registered driver. - */ -psa_se_drv_table_entry_t *psa_get_se_driver_entry( - psa_key_lifetime_t lifetime); - -/** Return the method table for a secure element driver. - * - * \param[in] driver The driver table entry to access, or \c NULL. - * - * \return The driver's method table. - * \c NULL if \p driver is \c NULL. - */ -const psa_drv_se_t *psa_get_se_driver_methods( - const psa_se_drv_table_entry_t *driver); - -/** Return the context of a secure element driver. - * - * \param[in] driver The driver table entry to access, or \c NULL. - * - * \return A pointer to the driver context. - * \c NULL if \p driver is \c NULL. - */ -psa_drv_se_context_t *psa_get_se_driver_context( - psa_se_drv_table_entry_t *driver); - -/** Find a free slot for a key that is to be created. - * - * This function calls the relevant method in the driver to find a suitable - * slot for a key with the given attributes. - * - * \param[in] attributes Metadata about the key that is about to be created. - * \param[in] driver The driver table entry to query. - * \param[out] slot_number On success, a slot number that is free in this - * secure element. - */ -psa_status_t psa_find_se_slot_for_key( - const psa_key_attributes_t *attributes, - psa_key_creation_method_t method, - psa_se_drv_table_entry_t *driver, - psa_key_slot_number_t *slot_number); - -/** Destroy a key in a secure element. - * - * This function calls the relevant driver method to destroy a key - * and updates the driver's persistent data. - */ -psa_status_t psa_destroy_se_key(psa_se_drv_table_entry_t *driver, - psa_key_slot_number_t slot_number); - -/** Load the persistent data of a secure element driver. - * - * \param driver The driver table entry containing the persistent - * data to load from storage. - * - * \return #PSA_SUCCESS - * \return #PSA_ERROR_NOT_SUPPORTED - * \return #PSA_ERROR_DOES_NOT_EXIST - * \return #PSA_ERROR_STORAGE_FAILURE - * \return #PSA_ERROR_DATA_CORRUPT - * \return #PSA_ERROR_INVALID_ARGUMENT - */ -psa_status_t psa_load_se_persistent_data( - const psa_se_drv_table_entry_t *driver); - -/** Save the persistent data of a secure element driver. - * - * \param[in] driver The driver table entry containing the persistent - * data to save to storage. - * - * \return #PSA_SUCCESS - * \return #PSA_ERROR_NOT_SUPPORTED - * \return #PSA_ERROR_NOT_PERMITTED - * \return #PSA_ERROR_NOT_SUPPORTED - * \return #PSA_ERROR_INSUFFICIENT_STORAGE - * \return #PSA_ERROR_STORAGE_FAILURE - * \return #PSA_ERROR_INVALID_ARGUMENT - */ -psa_status_t psa_save_se_persistent_data( - const psa_se_drv_table_entry_t *driver); - -/** Destroy the persistent data of a secure element driver. - * - * This is currently only used for testing. - * - * \param[in] location The location identifier for the driver whose - * persistent data is to be erased. - */ -psa_status_t psa_destroy_se_persistent_data(psa_key_location_t location); - - -/** The storage representation of a key whose data is in a secure element. - */ -typedef struct { - uint8_t slot_number[sizeof(psa_key_slot_number_t)]; -} psa_se_key_data_storage_t; - -#endif /* PSA_CRYPTO_SE_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_slot_management.c b/ext/oberon/psa/core/library/psa_crypto_slot_management.c deleted file mode 100644 index 92646c07c8eb..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_slot_management.c +++ /dev/null @@ -1,571 +0,0 @@ -/* - * PSA crypto layer on top of Mbed TLS crypto - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common.h" - -#if defined(MBEDTLS_PSA_CRYPTO_C) - -#include "psa/crypto.h" - -#include "psa_crypto_core.h" -#include "psa_crypto_driver_wrappers_no_static.h" -#include "psa_crypto_slot_management.h" -#include "psa_crypto_storage.h" -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -#include "psa_crypto_se.h" -#endif - -#include -#include -#include "mbedtls/platform.h" - -typedef struct { - psa_key_slot_t key_slots[MBEDTLS_PSA_KEY_SLOT_COUNT]; - uint8_t key_slots_initialized; -} psa_global_data_t; - -static psa_global_data_t global_data; - -int psa_is_valid_key_id(mbedtls_svc_key_id_t key, int vendor_ok) -{ - psa_key_id_t key_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key); - - if ((PSA_KEY_ID_USER_MIN <= key_id) && - (key_id <= PSA_KEY_ID_USER_MAX)) { - return 1; - } - - if (vendor_ok && - (PSA_KEY_ID_VENDOR_MIN <= key_id) && - (key_id <= PSA_KEY_ID_VENDOR_MAX)) { - return 1; - } - - return 0; -} - -/** Get the description in memory of a key given its identifier and lock it. - * - * The descriptions of volatile keys and loaded persistent keys are - * stored in key slots. This function returns a pointer to the key slot - * containing the description of a key given its identifier. - * - * The function searches the key slots containing the description of the key - * with \p key identifier. The function does only read accesses to the key - * slots. The function does not load any persistent key thus does not access - * any storage. - * - * For volatile key identifiers, only one key slot is queried as a volatile - * key with identifier key_id can only be stored in slot of index - * ( key_id - #PSA_KEY_ID_VOLATILE_MIN ). - * - * On success, the function locks the key slot. It is the responsibility of - * the caller to unlock the key slot when it does not access it anymore. - * - * \param key Key identifier to query. - * \param[out] p_slot On success, `*p_slot` contains a pointer to the - * key slot containing the description of the key - * identified by \p key. - * - * \retval #PSA_SUCCESS - * The pointer to the key slot containing the description of the key - * identified by \p key was returned. - * \retval #PSA_ERROR_INVALID_HANDLE - * \p key is not a valid key identifier. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * There is no key with key identifier \p key in the key slots. - */ -static psa_status_t psa_get_and_lock_key_slot_in_memory( - mbedtls_svc_key_id_t key, psa_key_slot_t **p_slot) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_id_t key_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key); - size_t slot_idx; - psa_key_slot_t *slot = NULL; - - if (psa_key_id_is_volatile(key_id)) { - slot = &global_data.key_slots[key_id - PSA_KEY_ID_VOLATILE_MIN]; - - /* - * Check if both the PSA key identifier key_id and the owner - * identifier of key match those of the key slot. - * - * Note that, if the key slot is not occupied, its PSA key identifier - * is equal to zero. This is an invalid value for a PSA key identifier - * and thus cannot be equal to the valid PSA key identifier key_id. - */ - status = mbedtls_svc_key_id_equal(key, slot->attr.id) ? - PSA_SUCCESS : PSA_ERROR_DOES_NOT_EXIST; - } else { - if (!psa_is_valid_key_id(key, 1)) { - return PSA_ERROR_INVALID_HANDLE; - } - - for (slot_idx = 0; slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT; slot_idx++) { - slot = &global_data.key_slots[slot_idx]; - if (mbedtls_svc_key_id_equal(key, slot->attr.id)) { - break; - } - } - status = (slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT) ? - PSA_SUCCESS : PSA_ERROR_DOES_NOT_EXIST; - } - - if (status == PSA_SUCCESS) { - status = psa_lock_key_slot(slot); - if (status == PSA_SUCCESS) { - *p_slot = slot; - } - } - - return status; -} - -psa_status_t psa_initialize_key_slots(void) -{ - /* Nothing to do: program startup and psa_wipe_all_key_slots() both - * guarantee that the key slots are initialized to all-zero, which - * means that all the key slots are in a valid, empty state. */ - global_data.key_slots_initialized = 1; - return PSA_SUCCESS; -} - -void psa_wipe_all_key_slots(void) -{ - size_t slot_idx; - - for (slot_idx = 0; slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT; slot_idx++) { - psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; - slot->lock_count = 1; - (void) psa_wipe_key_slot(slot); - } - global_data.key_slots_initialized = 0; -} - -psa_status_t psa_get_empty_key_slot(psa_key_id_t *volatile_key_id, - psa_key_slot_t **p_slot) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - size_t slot_idx; - psa_key_slot_t *selected_slot, *unlocked_persistent_key_slot; - - if (!global_data.key_slots_initialized) { - status = PSA_ERROR_BAD_STATE; - goto error; - } - - selected_slot = unlocked_persistent_key_slot = NULL; - for (slot_idx = 0; slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT; slot_idx++) { - psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; - if (!psa_is_key_slot_occupied(slot)) { - selected_slot = slot; - break; - } - - if ((unlocked_persistent_key_slot == NULL) && - (!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) && - (!psa_is_key_slot_locked(slot))) { - unlocked_persistent_key_slot = slot; - } - } - - /* - * If there is no unused key slot and there is at least one unlocked key - * slot containing the description of a persistent key, recycle the first - * such key slot we encountered. If we later need to operate on the - * persistent key we are evicting now, we will reload its description from - * storage. - */ - if ((selected_slot == NULL) && - (unlocked_persistent_key_slot != NULL)) { - selected_slot = unlocked_persistent_key_slot; - selected_slot->lock_count = 1; - psa_wipe_key_slot(selected_slot); - } - - if (selected_slot != NULL) { - status = psa_lock_key_slot(selected_slot); - if (status != PSA_SUCCESS) { - goto error; - } - - *volatile_key_id = PSA_KEY_ID_VOLATILE_MIN + - ((psa_key_id_t) (selected_slot - global_data.key_slots)); - *p_slot = selected_slot; - - return PSA_SUCCESS; - } - status = PSA_ERROR_INSUFFICIENT_MEMORY; - -error: - *p_slot = NULL; - *volatile_key_id = 0; - - return status; -} - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) -static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot) -{ - psa_status_t status = PSA_SUCCESS; - uint8_t *key_data = NULL; - size_t key_data_length = 0; - - status = psa_load_persistent_key(&slot->attr, - &key_data, &key_data_length); - if (status != PSA_SUCCESS) { - goto exit; - } - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) - /* Special handling is required for loading keys associated with a - * dynamically registered SE interface. */ - const psa_drv_se_t *drv; - psa_drv_se_context_t *drv_context; - if (psa_get_se_driver(slot->attr.lifetime, &drv, &drv_context)) { - psa_se_key_data_storage_t *data; - - if (key_data_length != sizeof(*data)) { - status = PSA_ERROR_DATA_INVALID; - goto exit; - } - data = (psa_se_key_data_storage_t *) key_data; - status = psa_copy_key_material_into_slot( - slot, data->slot_number, sizeof(data->slot_number)); - goto exit; - } -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ - - status = psa_copy_key_material_into_slot(slot, key_data, key_data_length); - -exit: - psa_free_persistent_key_data(key_data, key_data_length); - return status; -} -#endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C */ - -#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) - -static psa_status_t psa_load_builtin_key_into_slot(psa_key_slot_t *slot) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_key_lifetime_t lifetime = PSA_KEY_LIFETIME_VOLATILE; - psa_drv_slot_number_t slot_number = 0; - size_t key_buffer_size = 0; - size_t key_buffer_length = 0; - - if (!psa_key_id_is_builtin( - MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id))) { - return PSA_ERROR_DOES_NOT_EXIST; - } - - /* Check the platform function to see whether this key actually exists */ - status = mbedtls_psa_platform_get_builtin_key( - slot->attr.id, &lifetime, &slot_number); - if (status != PSA_SUCCESS) { - return status; - } - - /* Set required key attributes to ensure get_builtin_key can retrieve the - * full attributes. */ - psa_set_key_id(&attributes, slot->attr.id); - psa_set_key_lifetime(&attributes, lifetime); - - /* Get the full key attributes from the driver in order to be able to - * calculate the required buffer size. */ - status = psa_driver_wrapper_get_builtin_key( - slot_number, &attributes, - NULL, 0, NULL); - if (status != PSA_ERROR_BUFFER_TOO_SMALL) { - /* Builtin keys cannot be defined by the attributes alone */ - if (status == PSA_SUCCESS) { - status = PSA_ERROR_CORRUPTION_DETECTED; - } - return status; - } - - /* If the key should exist according to the platform, then ask the driver - * what its expected size is. */ - status = psa_driver_wrapper_get_key_buffer_size(&attributes, - &key_buffer_size); - if (status != PSA_SUCCESS) { - return status; - } - - /* Allocate a buffer of the required size and load the builtin key directly - * into the (now properly sized) slot buffer. */ - status = psa_allocate_buffer_to_slot(slot, key_buffer_size); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_driver_wrapper_get_builtin_key( - slot_number, &attributes, - slot->key.data, slot->key.bytes, &key_buffer_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - /* Copy actual key length and core attributes into the slot on success */ - slot->key.bytes = key_buffer_length; - slot->attr = attributes.core; - -exit: - if (status != PSA_SUCCESS) { - psa_remove_key_data_from_memory(slot); - } - return status; -} -#endif /* MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ - -psa_status_t psa_get_and_lock_key_slot(mbedtls_svc_key_id_t key, - psa_key_slot_t **p_slot) -{ - psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; - - *p_slot = NULL; - if (!global_data.key_slots_initialized) { - return PSA_ERROR_BAD_STATE; - } - - /* - * On success, the pointer to the slot is passed directly to the caller - * thus no need to unlock the key slot here. - */ - status = psa_get_and_lock_key_slot_in_memory(key, p_slot); - if (status != PSA_ERROR_DOES_NOT_EXIST) { - return status; - } - - /* Loading keys from storage requires support for such a mechanism */ -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) || \ - defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) - psa_key_id_t volatile_key_id; - - status = psa_get_empty_key_slot(&volatile_key_id, p_slot); - if (status != PSA_SUCCESS) { - return status; - } - - (*p_slot)->attr.id = key; - (*p_slot)->attr.lifetime = PSA_KEY_LIFETIME_PERSISTENT; - - status = PSA_ERROR_DOES_NOT_EXIST; -#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) - /* Load keys in the 'builtin' range through their own interface */ - status = psa_load_builtin_key_into_slot(*p_slot); -#endif /* MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) - if (status == PSA_ERROR_DOES_NOT_EXIST) { - status = psa_load_persistent_key_into_slot(*p_slot); - } -#endif /* defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) */ - - if (status != PSA_SUCCESS) { - psa_wipe_key_slot(*p_slot); - if (status == PSA_ERROR_DOES_NOT_EXIST) { - status = PSA_ERROR_INVALID_HANDLE; - } - } else { - /* Add implicit usage flags. */ - psa_extend_key_usage_flags(&(*p_slot)->attr.policy.usage); - } - - return status; -#else /* MBEDTLS_PSA_CRYPTO_STORAGE_C || MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ - return PSA_ERROR_INVALID_HANDLE; -#endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C || MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ -} - -psa_status_t psa_unlock_key_slot(psa_key_slot_t *slot) -{ - if (slot == NULL) { - return PSA_SUCCESS; - } - - if (slot->lock_count > 0) { - slot->lock_count--; - return PSA_SUCCESS; - } - - /* - * As the return error code may not be handled in case of multiple errors, - * do our best to report if the lock counter is equal to zero. Assert with - * MBEDTLS_TEST_HOOK_TEST_ASSERT that the lock counter is strictly greater - * than zero: if the MBEDTLS_TEST_HOOKS configuration option is enabled and - * the function is called as part of the execution of a test suite, the - * execution of the test suite is stopped in error if the assertion fails. - */ - MBEDTLS_TEST_HOOK_TEST_ASSERT(slot->lock_count > 0); - return PSA_ERROR_CORRUPTION_DETECTED; -} - -psa_status_t psa_validate_key_location(psa_key_lifetime_t lifetime, - psa_se_drv_table_entry_t **p_drv) -{ - if (psa_key_lifetime_is_external(lifetime)) { -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) - /* Check whether a driver is registered against this lifetime */ - psa_se_drv_table_entry_t *driver = psa_get_se_driver_entry(lifetime); - if (driver != NULL) { - if (p_drv != NULL) { - *p_drv = driver; - } - return PSA_SUCCESS; - } -#else /* MBEDTLS_PSA_CRYPTO_SE_C */ - (void) p_drv; -#endif /* MBEDTLS_PSA_CRYPTO_SE_C */ - - /* Key location for external keys gets checked by the wrapper */ - return PSA_SUCCESS; - } else { - /* Local/internal keys are always valid */ - return PSA_SUCCESS; - } -} - -psa_status_t psa_validate_key_persistence(psa_key_lifetime_t lifetime) -{ - if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) { - /* Volatile keys are always supported */ - return PSA_SUCCESS; - } else { - /* Persistent keys require storage support */ -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) - if (PSA_KEY_LIFETIME_IS_READ_ONLY(lifetime)) { - return PSA_ERROR_INVALID_ARGUMENT; - } else { - return PSA_SUCCESS; - } -#else /* MBEDTLS_PSA_CRYPTO_STORAGE_C */ - return PSA_ERROR_NOT_SUPPORTED; -#endif /* !MBEDTLS_PSA_CRYPTO_STORAGE_C */ - } -} - -psa_status_t psa_open_key(mbedtls_svc_key_id_t key, psa_key_handle_t *handle) -{ -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) || \ - defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS) - psa_status_t status; - psa_key_slot_t *slot; - - status = psa_get_and_lock_key_slot(key, &slot); - if (status != PSA_SUCCESS) { - *handle = PSA_KEY_HANDLE_INIT; - if (status == PSA_ERROR_INVALID_HANDLE) { - status = PSA_ERROR_DOES_NOT_EXIST; - } - - return status; - } - - *handle = key; - - return psa_unlock_key_slot(slot); - -#else /* MBEDTLS_PSA_CRYPTO_STORAGE_C || MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ - (void) key; - *handle = PSA_KEY_HANDLE_INIT; - return PSA_ERROR_NOT_SUPPORTED; -#endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C || MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS */ -} - -psa_status_t psa_close_key(psa_key_handle_t handle) -{ - psa_status_t status; - psa_key_slot_t *slot; - - if (psa_key_handle_is_null(handle)) { - return PSA_SUCCESS; - } - - status = psa_get_and_lock_key_slot_in_memory(handle, &slot); - if (status != PSA_SUCCESS) { - if (status == PSA_ERROR_DOES_NOT_EXIST) { - status = PSA_ERROR_INVALID_HANDLE; - } - - return status; - } - if (slot->lock_count <= 1) { - return psa_wipe_key_slot(slot); - } else { - return psa_unlock_key_slot(slot); - } -} - -psa_status_t psa_purge_key(mbedtls_svc_key_id_t key) -{ - psa_status_t status; - psa_key_slot_t *slot; - - status = psa_get_and_lock_key_slot_in_memory(key, &slot); - if (status != PSA_SUCCESS) { - return status; - } - - if ((!PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) && - (slot->lock_count <= 1)) { - return psa_wipe_key_slot(slot); - } else { - return psa_unlock_key_slot(slot); - } -} - -void mbedtls_psa_get_stats(mbedtls_psa_stats_t *stats) -{ - size_t slot_idx; - - memset(stats, 0, sizeof(*stats)); - - for (slot_idx = 0; slot_idx < MBEDTLS_PSA_KEY_SLOT_COUNT; slot_idx++) { - const psa_key_slot_t *slot = &global_data.key_slots[slot_idx]; - if (psa_is_key_slot_locked(slot)) { - ++stats->locked_slots; - } - if (!psa_is_key_slot_occupied(slot)) { - ++stats->empty_slots; - continue; - } - if (PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) { - ++stats->volatile_slots; - } else { - psa_key_id_t id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id); - ++stats->persistent_slots; - if (id > stats->max_open_internal_key_id) { - stats->max_open_internal_key_id = id; - } - } - if (PSA_KEY_LIFETIME_GET_LOCATION(slot->attr.lifetime) != - PSA_KEY_LOCATION_LOCAL_STORAGE) { - psa_key_id_t id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(slot->attr.id); - ++stats->external_slots; - if (id > stats->max_open_external_key_id) { - stats->max_open_external_key_id = id; - } - } - } -} - -#endif /* MBEDTLS_PSA_CRYPTO_C */ diff --git a/ext/oberon/psa/core/library/psa_crypto_slot_management.h b/ext/oberon/psa/core/library/psa_crypto_slot_management.h deleted file mode 100644 index c8366abeb834..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_slot_management.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * PSA crypto layer on top of Mbed TLS crypto - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_SLOT_MANAGEMENT_H -#define PSA_CRYPTO_SLOT_MANAGEMENT_H - -#include "psa/crypto.h" -#include "psa_crypto_core.h" -#include "psa_crypto_se.h" - -/** Range of volatile key identifiers. - * - * The last #MBEDTLS_PSA_KEY_SLOT_COUNT identifiers of the implementation - * range of key identifiers are reserved for volatile key identifiers. - * A volatile key identifier is equal to #PSA_KEY_ID_VOLATILE_MIN plus the - * index of the key slot containing the volatile key definition. - */ - -/** The minimum value for a volatile key identifier. - */ -#define PSA_KEY_ID_VOLATILE_MIN (PSA_KEY_ID_VENDOR_MAX - \ - MBEDTLS_PSA_KEY_SLOT_COUNT + 1) - -/** The maximum value for a volatile key identifier. - */ -#define PSA_KEY_ID_VOLATILE_MAX PSA_KEY_ID_VENDOR_MAX - -/** Test whether a key identifier is a volatile key identifier. - * - * \param key_id Key identifier to test. - * - * \retval 1 - * The key identifier is a volatile key identifier. - * \retval 0 - * The key identifier is not a volatile key identifier. - */ -static inline int psa_key_id_is_volatile(psa_key_id_t key_id) -{ - return (key_id >= PSA_KEY_ID_VOLATILE_MIN) && - (key_id <= PSA_KEY_ID_VOLATILE_MAX); -} - -/** Get the description of a key given its identifier and lock it. - * - * The descriptions of volatile keys and loaded persistent keys are stored in - * key slots. This function returns a pointer to the key slot containing the - * description of a key given its identifier. - * - * In case of a persistent key, the function loads the description of the key - * into a key slot if not already done. - * - * On success, the returned key slot is locked. It is the responsibility of - * the caller to unlock the key slot when it does not access it anymore. - * - * \param key Key identifier to query. - * \param[out] p_slot On success, `*p_slot` contains a pointer to the - * key slot containing the description of the key - * identified by \p key. - * - * \retval #PSA_SUCCESS - * \p *p_slot contains a pointer to the key slot containing the - * description of the key identified by \p key. - * The key slot counter has been incremented. - * \retval #PSA_ERROR_BAD_STATE - * The library has not been initialized. - * \retval #PSA_ERROR_INVALID_HANDLE - * \p key is not a valid key identifier. - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY - * \p key is a persistent key identifier. The implementation does not - * have sufficient resources to load the persistent key. This can be - * due to a lack of empty key slot, or available memory. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * There is no key with key identifier \p key. - * \retval #PSA_ERROR_CORRUPTION_DETECTED \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - */ -psa_status_t psa_get_and_lock_key_slot(mbedtls_svc_key_id_t key, - psa_key_slot_t **p_slot); - -/** Initialize the key slot structures. - * - * \retval #PSA_SUCCESS - * Currently this function always succeeds. - */ -psa_status_t psa_initialize_key_slots(void); - -/** Delete all data from key slots in memory. - * - * This does not affect persistent storage. */ -void psa_wipe_all_key_slots(void); - -/** Find a free key slot. - * - * This function returns a key slot that is available for use and is in its - * ground state (all-bits-zero). On success, the key slot is locked. It is - * the responsibility of the caller to unlock the key slot when it does not - * access it anymore. - * - * \param[out] volatile_key_id On success, volatile key identifier - * associated to the returned slot. - * \param[out] p_slot On success, a pointer to the slot. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_BAD_STATE \emptydescription - */ -psa_status_t psa_get_empty_key_slot(psa_key_id_t *volatile_key_id, - psa_key_slot_t **p_slot); - -/** Lock a key slot. - * - * This function increments the key slot lock counter by one. - * - * \param[in] slot The key slot. - * - * \retval #PSA_SUCCESS - The key slot lock counter was incremented. - * \retval #PSA_ERROR_CORRUPTION_DETECTED - * The lock counter already reached its maximum value and was not - * increased. - */ -static inline psa_status_t psa_lock_key_slot(psa_key_slot_t *slot) -{ - if (slot->lock_count >= SIZE_MAX) { - return PSA_ERROR_CORRUPTION_DETECTED; - } - - slot->lock_count++; - - return PSA_SUCCESS; -} - -/** Unlock a key slot. - * - * This function decrements the key slot lock counter by one. - * - * \note To ease the handling of errors in retrieving a key slot - * a NULL input pointer is valid, and the function returns - * successfully without doing anything in that case. - * - * \param[in] slot The key slot. - * \retval #PSA_SUCCESS - * \p slot is NULL or the key slot lock counter has been - * decremented successfully. - * \retval #PSA_ERROR_CORRUPTION_DETECTED - * The lock counter was equal to 0. - * - */ -psa_status_t psa_unlock_key_slot(psa_key_slot_t *slot); - -/** Test whether a lifetime designates a key in an external cryptoprocessor. - * - * \param lifetime The lifetime to test. - * - * \retval 1 - * The lifetime designates an external key. There should be a - * registered driver for this lifetime, otherwise the key cannot - * be created or manipulated. - * \retval 0 - * The lifetime designates a key that is volatile or in internal - * storage. - */ -static inline int psa_key_lifetime_is_external(psa_key_lifetime_t lifetime) -{ - return PSA_KEY_LIFETIME_GET_LOCATION(lifetime) - != PSA_KEY_LOCATION_LOCAL_STORAGE; -} - -/** Validate a key's location. - * - * This function checks whether the key's attributes point to a location that - * is known to the PSA Core, and returns the driver function table if the key - * is to be found in an external location. - * - * \param[in] lifetime The key lifetime attribute. - * \param[out] p_drv On success, when a key is located in external - * storage, returns a pointer to the driver table - * associated with the key's storage location. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - */ -psa_status_t psa_validate_key_location(psa_key_lifetime_t lifetime, - psa_se_drv_table_entry_t **p_drv); - -/** Validate the persistence of a key. - * - * \param[in] lifetime The key lifetime attribute. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_NOT_SUPPORTED The key is persistent but persistent keys - * are not supported. - */ -psa_status_t psa_validate_key_persistence(psa_key_lifetime_t lifetime); - -/** Validate a key identifier. - * - * \param[in] key The key identifier. - * \param[in] vendor_ok Non-zero to indicate that key identifiers in the - * vendor range are allowed, volatile key identifiers - * excepted \c 0 otherwise. - * - * \retval <> 0 if the key identifier is valid, 0 otherwise. - */ -int psa_is_valid_key_id(mbedtls_svc_key_id_t key, int vendor_ok); - -#endif /* PSA_CRYPTO_SLOT_MANAGEMENT_H */ diff --git a/ext/oberon/psa/core/library/psa_crypto_storage.c b/ext/oberon/psa/core/library/psa_crypto_storage.c deleted file mode 100644 index 574d4b05ed84..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_storage.c +++ /dev/null @@ -1,493 +0,0 @@ -/* - * PSA persistent key storage - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common.h" - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) - -#include -#include - -#include "psa/crypto.h" -#include "psa_crypto_storage.h" -#include "mbedtls/platform_util.h" - -#if defined(MBEDTLS_PSA_ITS_FILE_C) -#include "psa_crypto_its.h" -#else /* Native ITS implementation */ -#include "psa/error.h" -#include "psa/internal_trusted_storage.h" -#endif - -#include "mbedtls/platform.h" - - - -/****************************************************************/ -/* Key storage */ -/****************************************************************/ - -/* Determine a file name (ITS file identifier) for the given key identifier. - * The file name must be distinct from any file that is used for a purpose - * other than storing a key. Currently, the only such file is the random seed - * file whose name is PSA_CRYPTO_ITS_RANDOM_SEED_UID and whose value is - * 0xFFFFFF52. */ -static psa_storage_uid_t psa_its_identifier_of_slot(mbedtls_svc_key_id_t key) -{ -#if defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER) - /* Encode the owner in the upper 32 bits. This means that if - * owner values are nonzero (as they are on a PSA platform), - * no key file will ever have a value less than 0x100000000, so - * the whole range 0..0xffffffff is available for non-key files. */ - uint32_t unsigned_owner_id = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(key); - return ((uint64_t) unsigned_owner_id << 32) | - MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key); -#else - /* Use the key id directly as a file name. - * psa_is_key_id_valid() in psa_crypto_slot_management.c - * is responsible for ensuring that key identifiers do not have a - * value that is reserved for non-key files. */ - return key; -#endif -} - -/** - * \brief Load persistent data for the given key slot number. - * - * This function reads data from a storage backend and returns the data in a - * buffer. - * - * \param key Persistent identifier of the key to be loaded. This - * should be an occupied storage location. - * \param[out] data Buffer where the data is to be written. - * \param data_size Size of the \c data buffer in bytes. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DOES_NOT_EXIST \emptydescription - */ -static psa_status_t psa_crypto_storage_load( - const mbedtls_svc_key_id_t key, uint8_t *data, size_t data_size) -{ - psa_status_t status; - psa_storage_uid_t data_identifier = psa_its_identifier_of_slot(key); - struct psa_storage_info_t data_identifier_info; - size_t data_length = 0; - - status = psa_its_get_info(data_identifier, &data_identifier_info); - if (status != PSA_SUCCESS) { - return status; - } - - status = psa_its_get(data_identifier, 0, (uint32_t) data_size, data, &data_length); - if (data_size != data_length) { - return PSA_ERROR_DATA_INVALID; - } - - return status; -} - -int psa_is_key_present_in_storage(const mbedtls_svc_key_id_t key) -{ - psa_status_t ret; - psa_storage_uid_t data_identifier = psa_its_identifier_of_slot(key); - struct psa_storage_info_t data_identifier_info; - - ret = psa_its_get_info(data_identifier, &data_identifier_info); - - if (ret == PSA_ERROR_DOES_NOT_EXIST) { - return 0; - } - return 1; -} - -/** - * \brief Store persistent data for the given key slot number. - * - * This function stores the given data buffer to a persistent storage. - * - * \param key Persistent identifier of the key to be stored. This - * should be an unoccupied storage location. - * \param[in] data Buffer containing the data to be stored. - * \param data_length The number of bytes - * that make up the data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_ALREADY_EXISTS \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - */ -static psa_status_t psa_crypto_storage_store(const mbedtls_svc_key_id_t key, - const uint8_t *data, - size_t data_length) -{ - psa_status_t status; - psa_storage_uid_t data_identifier = psa_its_identifier_of_slot(key); - struct psa_storage_info_t data_identifier_info; - - if (psa_is_key_present_in_storage(key) == 1) { - return PSA_ERROR_ALREADY_EXISTS; - } - - status = psa_its_set(data_identifier, (uint32_t) data_length, data, 0); - if (status != PSA_SUCCESS) { - return PSA_ERROR_DATA_INVALID; - } - - status = psa_its_get_info(data_identifier, &data_identifier_info); - if (status != PSA_SUCCESS) { - goto exit; - } - - if (data_identifier_info.size != data_length) { - status = PSA_ERROR_DATA_INVALID; - goto exit; - } - -exit: - if (status != PSA_SUCCESS) { - /* Remove the file in case we managed to create it but something - * went wrong. It's ok if the file doesn't exist. If the file exists - * but the removal fails, we're already reporting an error so there's - * nothing else we can do. */ - (void) psa_its_remove(data_identifier); - } - return status; -} - -psa_status_t psa_destroy_persistent_key(const mbedtls_svc_key_id_t key) -{ - psa_status_t ret; - psa_storage_uid_t data_identifier = psa_its_identifier_of_slot(key); - struct psa_storage_info_t data_identifier_info; - - ret = psa_its_get_info(data_identifier, &data_identifier_info); - if (ret == PSA_ERROR_DOES_NOT_EXIST) { - return PSA_SUCCESS; - } - - if (psa_its_remove(data_identifier) != PSA_SUCCESS) { - return PSA_ERROR_DATA_INVALID; - } - - ret = psa_its_get_info(data_identifier, &data_identifier_info); - if (ret != PSA_ERROR_DOES_NOT_EXIST) { - return PSA_ERROR_DATA_INVALID; - } - - return PSA_SUCCESS; -} - -/** - * \brief Get data length for given key slot number. - * - * \param key Persistent identifier whose stored data length - * is to be obtained. - * \param[out] data_length The number of bytes that make up the data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DOES_NOT_EXIST \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - */ -static psa_status_t psa_crypto_storage_get_data_length( - const mbedtls_svc_key_id_t key, - size_t *data_length) -{ - psa_status_t status; - psa_storage_uid_t data_identifier = psa_its_identifier_of_slot(key); - struct psa_storage_info_t data_identifier_info; - - status = psa_its_get_info(data_identifier, &data_identifier_info); - if (status != PSA_SUCCESS) { - return status; - } - - *data_length = (size_t) data_identifier_info.size; - - return PSA_SUCCESS; -} - -/** - * Persistent key storage magic header. - */ -#define PSA_KEY_STORAGE_MAGIC_HEADER "PSA\0KEY" -#define PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH (sizeof(PSA_KEY_STORAGE_MAGIC_HEADER)) - -typedef struct { - uint8_t magic[PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH]; - uint8_t version[4]; - uint8_t lifetime[sizeof(psa_key_lifetime_t)]; - uint8_t type[2]; - uint8_t bits[2]; - uint8_t policy[sizeof(psa_key_policy_t)]; - uint8_t data_len[4]; - uint8_t key_data[]; -} psa_persistent_key_storage_format; - -void psa_format_key_data_for_storage(const uint8_t *data, - const size_t data_length, - const psa_core_key_attributes_t *attr, - uint8_t *storage_data) -{ - psa_persistent_key_storage_format *storage_format = - (psa_persistent_key_storage_format *) storage_data; - - memcpy(storage_format->magic, PSA_KEY_STORAGE_MAGIC_HEADER, - PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH); - MBEDTLS_PUT_UINT32_LE(0, storage_format->version, 0); - MBEDTLS_PUT_UINT32_LE(attr->lifetime, storage_format->lifetime, 0); - MBEDTLS_PUT_UINT16_LE((uint16_t) attr->type, storage_format->type, 0); - MBEDTLS_PUT_UINT16_LE((uint16_t) attr->bits, storage_format->bits, 0); - MBEDTLS_PUT_UINT32_LE(attr->policy.usage, storage_format->policy, 0); - MBEDTLS_PUT_UINT32_LE(attr->policy.alg, storage_format->policy, sizeof(uint32_t)); - MBEDTLS_PUT_UINT32_LE(attr->policy.alg2, storage_format->policy, 2 * sizeof(uint32_t)); - MBEDTLS_PUT_UINT32_LE(data_length, storage_format->data_len, 0); - memcpy(storage_format->key_data, data, data_length); -} - -static psa_status_t check_magic_header(const uint8_t *data) -{ - if (memcmp(data, PSA_KEY_STORAGE_MAGIC_HEADER, - PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH) != 0) { - return PSA_ERROR_DATA_INVALID; - } - return PSA_SUCCESS; -} - -psa_status_t psa_parse_key_data_from_storage(const uint8_t *storage_data, - size_t storage_data_length, - uint8_t **key_data, - size_t *key_data_length, - psa_core_key_attributes_t *attr) -{ - psa_status_t status; - const psa_persistent_key_storage_format *storage_format = - (const psa_persistent_key_storage_format *) storage_data; - uint32_t version; - - if (storage_data_length < sizeof(*storage_format)) { - return PSA_ERROR_DATA_INVALID; - } - - status = check_magic_header(storage_data); - if (status != PSA_SUCCESS) { - return status; - } - - version = MBEDTLS_GET_UINT32_LE(storage_format->version, 0); - if (version != 0) { - return PSA_ERROR_DATA_INVALID; - } - - *key_data_length = MBEDTLS_GET_UINT32_LE(storage_format->data_len, 0); - if (*key_data_length > (storage_data_length - sizeof(*storage_format)) || - *key_data_length > PSA_CRYPTO_MAX_STORAGE_SIZE) { - return PSA_ERROR_DATA_INVALID; - } - - if (*key_data_length == 0) { - *key_data = NULL; - } else { - *key_data = mbedtls_calloc(1, *key_data_length); - if (*key_data == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(*key_data, storage_format->key_data, *key_data_length); - } - - attr->lifetime = MBEDTLS_GET_UINT32_LE(storage_format->lifetime, 0); - attr->type = MBEDTLS_GET_UINT16_LE(storage_format->type, 0); - attr->bits = MBEDTLS_GET_UINT16_LE(storage_format->bits, 0); - attr->policy.usage = MBEDTLS_GET_UINT32_LE(storage_format->policy, 0); - attr->policy.alg = MBEDTLS_GET_UINT32_LE(storage_format->policy, sizeof(uint32_t)); - attr->policy.alg2 = MBEDTLS_GET_UINT32_LE(storage_format->policy, 2 * sizeof(uint32_t)); - - return PSA_SUCCESS; -} - -psa_status_t psa_save_persistent_key(const psa_core_key_attributes_t *attr, - const uint8_t *data, - const size_t data_length) -{ - size_t storage_data_length; - uint8_t *storage_data; - psa_status_t status; - - /* All keys saved to persistent storage always have a key context */ - if (data == NULL || data_length == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (data_length > PSA_CRYPTO_MAX_STORAGE_SIZE) { - return PSA_ERROR_INSUFFICIENT_STORAGE; - } - storage_data_length = data_length + sizeof(psa_persistent_key_storage_format); - - storage_data = mbedtls_calloc(1, storage_data_length); - if (storage_data == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - - psa_format_key_data_for_storage(data, data_length, attr, storage_data); - - status = psa_crypto_storage_store(attr->id, - storage_data, storage_data_length); - - mbedtls_zeroize_and_free(storage_data, storage_data_length); - - return status; -} - -void psa_free_persistent_key_data(uint8_t *key_data, size_t key_data_length) -{ - mbedtls_zeroize_and_free(key_data, key_data_length); -} - -psa_status_t psa_load_persistent_key(psa_core_key_attributes_t *attr, - uint8_t **data, - size_t *data_length) -{ - psa_status_t status = PSA_SUCCESS; - uint8_t *loaded_data; - size_t storage_data_length = 0; - mbedtls_svc_key_id_t key = attr->id; - - status = psa_crypto_storage_get_data_length(key, &storage_data_length); - if (status != PSA_SUCCESS) { - return status; - } - - loaded_data = mbedtls_calloc(1, storage_data_length); - - if (loaded_data == NULL) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - - status = psa_crypto_storage_load(key, loaded_data, storage_data_length); - if (status != PSA_SUCCESS) { - goto exit; - } - - status = psa_parse_key_data_from_storage(loaded_data, storage_data_length, - data, data_length, attr); - - /* All keys saved to persistent storage always have a key context */ - if (status == PSA_SUCCESS && - (*data == NULL || *data_length == 0)) { - status = PSA_ERROR_STORAGE_FAILURE; - } - -exit: - mbedtls_zeroize_and_free(loaded_data, storage_data_length); - return status; -} - - - -/****************************************************************/ -/* Transactions */ -/****************************************************************/ - -#if defined(PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS) - -psa_crypto_transaction_t psa_crypto_transaction; - -psa_status_t psa_crypto_save_transaction(void) -{ - struct psa_storage_info_t p_info; - psa_status_t status; - status = psa_its_get_info(PSA_CRYPTO_ITS_TRANSACTION_UID, &p_info); - if (status == PSA_SUCCESS) { - /* This shouldn't happen: we're trying to start a transaction while - * there is still a transaction that hasn't been replayed. */ - return PSA_ERROR_CORRUPTION_DETECTED; - } else if (status != PSA_ERROR_DOES_NOT_EXIST) { - return status; - } - return psa_its_set(PSA_CRYPTO_ITS_TRANSACTION_UID, - sizeof(psa_crypto_transaction), - &psa_crypto_transaction, - 0); -} - -psa_status_t psa_crypto_load_transaction(void) -{ - psa_status_t status; - size_t length; - status = psa_its_get(PSA_CRYPTO_ITS_TRANSACTION_UID, 0, - sizeof(psa_crypto_transaction), - &psa_crypto_transaction, &length); - if (status != PSA_SUCCESS) { - return status; - } - if (length != sizeof(psa_crypto_transaction)) { - return PSA_ERROR_DATA_INVALID; - } - return PSA_SUCCESS; -} - -psa_status_t psa_crypto_stop_transaction(void) -{ - psa_status_t status = psa_its_remove(PSA_CRYPTO_ITS_TRANSACTION_UID); - /* Whether or not updating the storage succeeded, the transaction is - * finished now. It's too late to go back, so zero out the in-memory - * data. */ - memset(&psa_crypto_transaction, 0, sizeof(psa_crypto_transaction)); - return status; -} - -#endif /* PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS */ - - - -/****************************************************************/ -/* Random generator state */ -/****************************************************************/ - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) -psa_status_t mbedtls_psa_storage_inject_entropy(const unsigned char *seed, - size_t seed_size) -{ - psa_status_t status; - struct psa_storage_info_t p_info; - - status = psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID, &p_info); - - if (PSA_ERROR_DOES_NOT_EXIST == status) { /* No seed exists */ - status = psa_its_set(PSA_CRYPTO_ITS_RANDOM_SEED_UID, seed_size, seed, 0); - } else if (PSA_SUCCESS == status) { - /* You should not be here. Seed needs to be injected only once */ - status = PSA_ERROR_NOT_PERMITTED; - } - return status; -} -#endif /* MBEDTLS_PSA_INJECT_ENTROPY */ - - - -/****************************************************************/ -/* The end */ -/****************************************************************/ - -#endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C */ diff --git a/ext/oberon/psa/core/library/psa_crypto_storage.h b/ext/oberon/psa/core/library/psa_crypto_storage.h deleted file mode 100644 index 37ca46e283b7..000000000000 --- a/ext/oberon/psa/core/library/psa_crypto_storage.h +++ /dev/null @@ -1,396 +0,0 @@ -/** - * \file psa_crypto_storage.h - * - * \brief PSA cryptography module: Mbed TLS key storage - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PSA_CRYPTO_STORAGE_H -#define PSA_CRYPTO_STORAGE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "psa/crypto.h" -#include "psa/crypto_se_driver.h" - -#include -#include - -/* Limit the maximum key size in storage. This should have no effect - * since the key size is limited in memory. */ -#define PSA_CRYPTO_MAX_STORAGE_SIZE (PSA_BITS_TO_BYTES(PSA_MAX_KEY_BITS)) -/* Sanity check: a file size must fit in 32 bits. Allow a generous - * 64kB of metadata. */ -#if PSA_CRYPTO_MAX_STORAGE_SIZE > 0xffff0000 -#error "PSA_CRYPTO_MAX_STORAGE_SIZE > 0xffff0000" -#endif - -/** The maximum permitted persistent slot number. - * - * In Mbed Crypto 0.1.0b: - * - Using the file backend, all key ids are ok except 0. - * - Using the ITS backend, all key ids are ok except 0xFFFFFF52 - * (#PSA_CRYPTO_ITS_RANDOM_SEED_UID) for which the file contains the - * device's random seed (if this feature is enabled). - * - Only key ids from 1 to #MBEDTLS_PSA_KEY_SLOT_COUNT are actually used. - * - * Since we need to preserve the random seed, avoid using that key slot. - * Reserve a whole range of key slots just in case something else comes up. - * - * This limitation will probably become moot when we implement client - * separation for key storage. - */ -#define PSA_MAX_PERSISTENT_KEY_IDENTIFIER PSA_KEY_ID_VENDOR_MAX - -/** - * \brief Checks if persistent data is stored for the given key slot number - * - * This function checks if any key data or metadata exists for the key slot in - * the persistent storage. - * - * \param key Persistent identifier to check. - * - * \retval 0 - * No persistent data present for slot number - * \retval 1 - * Persistent data present for slot number - */ -int psa_is_key_present_in_storage(const mbedtls_svc_key_id_t key); - -/** - * \brief Format key data and metadata and save to a location for given key - * slot. - * - * This function formats the key data and metadata and saves it to a - * persistent storage backend. The storage location corresponding to the - * key slot must be empty, otherwise this function will fail. This function - * should be called after loading the key into an internal slot to ensure the - * persistent key is not saved into a storage location corresponding to an - * already occupied non-persistent key, as well as ensuring the key data is - * validated. - * - * Note: This function will only succeed for key buffers which are not - * empty. If passed a NULL pointer or zero-length, the function will fail - * with #PSA_ERROR_INVALID_ARGUMENT. - * - * \param[in] attr The attributes of the key to save. - * The key identifier field in the attributes - * determines the key's location. - * \param[in] data Buffer containing the key data. - * \param data_length The number of bytes that make up the key data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INVALID_ARGUMENT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_ALREADY_EXISTS \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - */ -psa_status_t psa_save_persistent_key(const psa_core_key_attributes_t *attr, - const uint8_t *data, - const size_t data_length); - -/** - * \brief Parses key data and metadata and load persistent key for given - * key slot number. - * - * This function reads from a storage backend, parses the key data and - * metadata and writes them to the appropriate output parameters. - * - * Note: This function allocates a buffer and returns a pointer to it through - * the data parameter. On successful return, the pointer is guaranteed to be - * valid and the buffer contains at least one byte of data. - * psa_free_persistent_key_data() must be called on the data buffer - * afterwards to zeroize and free this buffer. - * - * \param[in,out] attr On input, the key identifier field identifies - * the key to load. Other fields are ignored. - * On success, the attribute structure contains - * the key metadata that was loaded from storage. - * \param[out] data Pointer to an allocated key data buffer on return. - * \param[out] data_length The number of bytes that make up the key data. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_DOES_NOT_EXIST \emptydescription - */ -psa_status_t psa_load_persistent_key(psa_core_key_attributes_t *attr, - uint8_t **data, - size_t *data_length); - -/** - * \brief Remove persistent data for the given key slot number. - * - * \param key Persistent identifier of the key to remove - * from persistent storage. - * - * \retval #PSA_SUCCESS - * The key was successfully removed, - * or the key did not exist. - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - */ -psa_status_t psa_destroy_persistent_key(const mbedtls_svc_key_id_t key); - -/** - * \brief Free the temporary buffer allocated by psa_load_persistent_key(). - * - * This function must be called at some point after psa_load_persistent_key() - * to zeroize and free the memory allocated to the buffer in that function. - * - * \param key_data Buffer for the key data. - * \param key_data_length Size of the key data buffer. - * - */ -void psa_free_persistent_key_data(uint8_t *key_data, size_t key_data_length); - -/** - * \brief Formats key data and metadata for persistent storage - * - * \param[in] data Buffer containing the key data. - * \param data_length Length of the key data buffer. - * \param[in] attr The core attributes of the key. - * \param[out] storage_data Output buffer for the formatted data. - * - */ -void psa_format_key_data_for_storage(const uint8_t *data, - const size_t data_length, - const psa_core_key_attributes_t *attr, - uint8_t *storage_data); - -/** - * \brief Parses persistent storage data into key data and metadata - * - * \param[in] storage_data Buffer for the storage data. - * \param storage_data_length Length of the storage data buffer - * \param[out] key_data On output, pointer to a newly allocated buffer - * containing the key data. This must be freed - * using psa_free_persistent_key_data() - * \param[out] key_data_length Length of the key data buffer - * \param[out] attr On success, the attribute structure is filled - * with the loaded key metadata. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - */ -psa_status_t psa_parse_key_data_from_storage(const uint8_t *storage_data, - size_t storage_data_length, - uint8_t **key_data, - size_t *key_data_length, - psa_core_key_attributes_t *attr); - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) -/** This symbol is defined if transaction support is required. */ -#define PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS 1 -#endif - -#if defined(PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS) - -/** The type of transaction that is in progress. - */ -/* This is an integer type rather than an enum for two reasons: to support - * unknown values when loading a transaction file, and to ensure that the - * type has a known size. - */ -typedef uint16_t psa_crypto_transaction_type_t; - -/** No transaction is in progress. - * - * This has the value 0, so zero-initialization sets a transaction's type to - * this value. - */ -#define PSA_CRYPTO_TRANSACTION_NONE ((psa_crypto_transaction_type_t) 0x0000) - -/** A key creation transaction. - * - * This is only used for keys in an external cryptoprocessor (secure element). - * Keys in RAM or in internal storage are created atomically in storage - * (simple file creation), so they do not need a transaction mechanism. - */ -#define PSA_CRYPTO_TRANSACTION_CREATE_KEY ((psa_crypto_transaction_type_t) 0x0001) - -/** A key destruction transaction. - * - * This is only used for keys in an external cryptoprocessor (secure element). - * Keys in RAM or in internal storage are destroyed atomically in storage - * (simple file deletion), so they do not need a transaction mechanism. - */ -#define PSA_CRYPTO_TRANSACTION_DESTROY_KEY ((psa_crypto_transaction_type_t) 0x0002) - -/** Transaction data. - * - * This type is designed to be serialized by writing the memory representation - * and reading it back on the same device. - * - * \note The transaction mechanism is designed for a single active transaction - * at a time. The transaction object is #psa_crypto_transaction. - * - * \note If an API call starts a transaction, it must complete this transaction - * before returning to the application. - * - * The lifetime of a transaction is the following (note that only one - * transaction may be active at a time): - * - * -# Call psa_crypto_prepare_transaction() to initialize the transaction - * object in memory and declare the type of transaction that is starting. - * -# Fill in the type-specific fields of #psa_crypto_transaction. - * -# Call psa_crypto_save_transaction() to start the transaction. This - * saves the transaction data to internal storage. - * -# Perform the work of the transaction by modifying files, contacting - * external entities, or whatever needs doing. Note that the transaction - * may be interrupted by a power failure, so you need to have a way - * recover from interruptions either by undoing what has been done - * so far or by resuming where you left off. - * -# If there are intermediate stages in the transaction, update - * the fields of #psa_crypto_transaction and call - * psa_crypto_save_transaction() again when each stage is reached. - * -# When the transaction is over, call psa_crypto_stop_transaction() to - * remove the transaction data in storage and in memory. - * - * If the system crashes while a transaction is in progress, psa_crypto_init() - * calls psa_crypto_load_transaction() and takes care of completing or - * rewinding the transaction. This is done in psa_crypto_recover_transaction() - * in psa_crypto.c. If you add a new type of transaction, be - * sure to add code for it in psa_crypto_recover_transaction(). - */ -typedef union { - /* Each element of this union must have the following properties - * to facilitate serialization and deserialization: - * - * - The element is a struct. - * - The first field of the struct is `psa_crypto_transaction_type_t type`. - * - Elements of the struct are arranged such a way that there is - * no padding. - */ - struct psa_crypto_transaction_unknown_s { - psa_crypto_transaction_type_t type; - uint16_t unused1; - uint32_t unused2; - uint64_t unused3; - uint64_t unused4; - } unknown; - /* ::type is #PSA_CRYPTO_TRANSACTION_CREATE_KEY or - * #PSA_CRYPTO_TRANSACTION_DESTROY_KEY. */ - struct psa_crypto_transaction_key_s { - psa_crypto_transaction_type_t type; - uint16_t unused1; - psa_key_lifetime_t lifetime; - psa_key_slot_number_t slot; - mbedtls_svc_key_id_t id; - } key; -} psa_crypto_transaction_t; - -/** The single active transaction. - */ -extern psa_crypto_transaction_t psa_crypto_transaction; - -/** Prepare for a transaction. - * - * There must not be an ongoing transaction. - * - * \param type The type of transaction to start. - */ -static inline void psa_crypto_prepare_transaction( - psa_crypto_transaction_type_t type) -{ - psa_crypto_transaction.unknown.type = type; -} - -/** Save the transaction data to storage. - * - * You may call this function multiple times during a transaction to - * atomically update the transaction state. - * - * \retval #PSA_SUCCESS \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - */ -psa_status_t psa_crypto_save_transaction(void); - -/** Load the transaction data from storage, if any. - * - * This function is meant to be called from psa_crypto_init() to recover - * in case a transaction was interrupted by a system crash. - * - * \retval #PSA_SUCCESS - * The data about the ongoing transaction has been loaded to - * #psa_crypto_transaction. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * There is no ongoing transaction. - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_DATA_INVALID \emptydescription - * \retval #PSA_ERROR_DATA_CORRUPT \emptydescription - */ -psa_status_t psa_crypto_load_transaction(void); - -/** Indicate that the current transaction is finished. - * - * Call this function at the very end of transaction processing. - * This function does not "commit" or "abort" the transaction: the storage - * subsystem has no concept of "commit" and "abort", just saving and - * removing the transaction information in storage. - * - * This function erases the transaction data in storage (if any) and - * resets the transaction data in memory. - * - * \retval #PSA_SUCCESS - * There was transaction data in storage. - * \retval #PSA_ERROR_DOES_NOT_EXIST - * There was no transaction data in storage. - * \retval #PSA_ERROR_STORAGE_FAILURE - * It was impossible to determine whether there was transaction data - * in storage, or the transaction data could not be erased. - */ -psa_status_t psa_crypto_stop_transaction(void); - -/** The ITS file identifier for the transaction data. - * - * 0xffffffNN = special file; 0x74 = 't' for transaction. - */ -#define PSA_CRYPTO_ITS_TRANSACTION_UID ((psa_key_id_t) 0xffffff74) - -#endif /* PSA_CRYPTO_STORAGE_HAS_TRANSACTIONS */ - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) -/** Backend side of mbedtls_psa_inject_entropy(). - * - * This function stores the supplied data into the entropy seed file. - * - * \retval #PSA_SUCCESS - * Success - * \retval #PSA_ERROR_STORAGE_FAILURE \emptydescription - * \retval #PSA_ERROR_INSUFFICIENT_STORAGE \emptydescription - * \retval #PSA_ERROR_NOT_PERMITTED - * The entropy seed file already exists. - */ -psa_status_t mbedtls_psa_storage_inject_entropy(const unsigned char *seed, - size_t seed_size); -#endif /* MBEDTLS_PSA_INJECT_ENTROPY */ - -#ifdef __cplusplus -} -#endif - -#endif /* PSA_CRYPTO_STORAGE_H */ diff --git a/ext/oberon/psa/core/library/psa_its_file.c b/ext/oberon/psa/core/library/psa_its_file.c deleted file mode 100644 index 97486165e26e..000000000000 --- a/ext/oberon/psa/core/library/psa_its_file.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * PSA ITS simulator over stdio files. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common.h" - -#if defined(MBEDTLS_PSA_ITS_FILE_C) - -#include "mbedtls/platform.h" - -#if defined(_WIN32) -#include -#endif - -#include "psa_crypto_its.h" - -#include -#include -#include -#include - -#if !defined(PSA_ITS_STORAGE_PREFIX) -#define PSA_ITS_STORAGE_PREFIX "" -#endif - -#define PSA_ITS_STORAGE_FILENAME_PATTERN "%08x%08x" -#define PSA_ITS_STORAGE_SUFFIX ".psa_its" -#define PSA_ITS_STORAGE_FILENAME_LENGTH \ - (sizeof(PSA_ITS_STORAGE_PREFIX) - 1 + /*prefix without terminating 0*/ \ - 16 + /*UID (64-bit number in hex)*/ \ - sizeof(PSA_ITS_STORAGE_SUFFIX) - 1 + /*suffix without terminating 0*/ \ - 1 /*terminating null byte*/) -#define PSA_ITS_STORAGE_TEMP \ - PSA_ITS_STORAGE_PREFIX "tempfile" PSA_ITS_STORAGE_SUFFIX - -/* The maximum value of psa_storage_info_t.size */ -#define PSA_ITS_MAX_SIZE 0xffffffff - -#define PSA_ITS_MAGIC_STRING "PSA\0ITS\0" -#define PSA_ITS_MAGIC_LENGTH 8 - -/* As rename fails on Windows if the new filepath already exists, - * use MoveFileExA with the MOVEFILE_REPLACE_EXISTING flag instead. - * Returns 0 on success, nonzero on failure. */ -#if defined(_WIN32) -#define rename_replace_existing(oldpath, newpath) \ - (!MoveFileExA(oldpath, newpath, MOVEFILE_REPLACE_EXISTING)) -#else -#define rename_replace_existing(oldpath, newpath) rename(oldpath, newpath) -#endif - -typedef struct { - uint8_t magic[PSA_ITS_MAGIC_LENGTH]; - uint8_t size[sizeof(uint32_t)]; - uint8_t flags[sizeof(psa_storage_create_flags_t)]; -} psa_its_file_header_t; - -static void psa_its_fill_filename(psa_storage_uid_t uid, char *filename) -{ - /* Break up the UID into two 32-bit pieces so as not to rely on - * long long support in snprintf. */ - mbedtls_snprintf(filename, PSA_ITS_STORAGE_FILENAME_LENGTH, - "%s" PSA_ITS_STORAGE_FILENAME_PATTERN "%s", - PSA_ITS_STORAGE_PREFIX, - (unsigned) (uid >> 32), - (unsigned) (uid & 0xffffffff), - PSA_ITS_STORAGE_SUFFIX); -} - -static psa_status_t psa_its_read_file(psa_storage_uid_t uid, - struct psa_storage_info_t *p_info, - FILE **p_stream) -{ - char filename[PSA_ITS_STORAGE_FILENAME_LENGTH]; - psa_its_file_header_t header; - size_t n; - - *p_stream = NULL; - psa_its_fill_filename(uid, filename); - *p_stream = fopen(filename, "rb"); - if (*p_stream == NULL) { - return PSA_ERROR_DOES_NOT_EXIST; - } - - /* Ensure no stdio buffering of secrets, as such buffers cannot be wiped. */ - mbedtls_setbuf(*p_stream, NULL); - - n = fread(&header, 1, sizeof(header), *p_stream); - if (n != sizeof(header)) { - return PSA_ERROR_DATA_CORRUPT; - } - if (memcmp(header.magic, PSA_ITS_MAGIC_STRING, - PSA_ITS_MAGIC_LENGTH) != 0) { - return PSA_ERROR_DATA_CORRUPT; - } - - p_info->size = (header.size[0] | - header.size[1] << 8 | - header.size[2] << 16 | - header.size[3] << 24); - p_info->flags = (header.flags[0] | - header.flags[1] << 8 | - header.flags[2] << 16 | - header.flags[3] << 24); - return PSA_SUCCESS; -} - -psa_status_t psa_its_get_info(psa_storage_uid_t uid, - struct psa_storage_info_t *p_info) -{ - psa_status_t status; - FILE *stream = NULL; - status = psa_its_read_file(uid, p_info, &stream); - if (stream != NULL) { - fclose(stream); - } - return status; -} - -psa_status_t psa_its_get(psa_storage_uid_t uid, - uint32_t data_offset, - uint32_t data_length, - void *p_data, - size_t *p_data_length) -{ - psa_status_t status; - FILE *stream = NULL; - size_t n; - struct psa_storage_info_t info; - - status = psa_its_read_file(uid, &info, &stream); - if (status != PSA_SUCCESS) { - goto exit; - } - status = PSA_ERROR_INVALID_ARGUMENT; - if (data_offset + data_length < data_offset) { - goto exit; - } -#if SIZE_MAX < 0xffffffff - if (data_offset + data_length > SIZE_MAX) { - goto exit; - } -#endif - if (data_offset + data_length > info.size) { - goto exit; - } - - status = PSA_ERROR_STORAGE_FAILURE; -#if LONG_MAX < 0xffffffff - while (data_offset > LONG_MAX) { - if (fseek(stream, LONG_MAX, SEEK_CUR) != 0) { - goto exit; - } - data_offset -= LONG_MAX; - } -#endif - if (fseek(stream, data_offset, SEEK_CUR) != 0) { - goto exit; - } - n = fread(p_data, 1, data_length, stream); - if (n != data_length) { - goto exit; - } - status = PSA_SUCCESS; - if (p_data_length != NULL) { - *p_data_length = n; - } - -exit: - if (stream != NULL) { - fclose(stream); - } - return status; -} - -psa_status_t psa_its_set(psa_storage_uid_t uid, - uint32_t data_length, - const void *p_data, - psa_storage_create_flags_t create_flags) -{ - if (uid == 0) { - return PSA_ERROR_INVALID_HANDLE; - } - - psa_status_t status = PSA_ERROR_STORAGE_FAILURE; - char filename[PSA_ITS_STORAGE_FILENAME_LENGTH]; - FILE *stream = NULL; - psa_its_file_header_t header; - size_t n; - - memcpy(header.magic, PSA_ITS_MAGIC_STRING, PSA_ITS_MAGIC_LENGTH); - MBEDTLS_PUT_UINT32_LE(data_length, header.size, 0); - MBEDTLS_PUT_UINT32_LE(create_flags, header.flags, 0); - - psa_its_fill_filename(uid, filename); - stream = fopen(PSA_ITS_STORAGE_TEMP, "wb"); - - if (stream == NULL) { - goto exit; - } - - /* Ensure no stdio buffering of secrets, as such buffers cannot be wiped. */ - mbedtls_setbuf(stream, NULL); - - status = PSA_ERROR_INSUFFICIENT_STORAGE; - n = fwrite(&header, 1, sizeof(header), stream); - if (n != sizeof(header)) { - goto exit; - } - if (data_length != 0) { - n = fwrite(p_data, 1, data_length, stream); - if (n != data_length) { - goto exit; - } - } - status = PSA_SUCCESS; - -exit: - if (stream != NULL) { - int ret = fclose(stream); - if (status == PSA_SUCCESS && ret != 0) { - status = PSA_ERROR_INSUFFICIENT_STORAGE; - } - } - if (status == PSA_SUCCESS) { - if (rename_replace_existing(PSA_ITS_STORAGE_TEMP, filename) != 0) { - status = PSA_ERROR_STORAGE_FAILURE; - } - } - /* The temporary file may still exist, but only in failure cases where - * we're already reporting an error. So there's nothing we can do on - * failure. If the function succeeded, and in some error cases, the - * temporary file doesn't exist and so remove() is expected to fail. - * Thus we just ignore the return status of remove(). */ - (void) remove(PSA_ITS_STORAGE_TEMP); - return status; -} - -psa_status_t psa_its_remove(psa_storage_uid_t uid) -{ - char filename[PSA_ITS_STORAGE_FILENAME_LENGTH]; - FILE *stream; - psa_its_fill_filename(uid, filename); - stream = fopen(filename, "rb"); - if (stream == NULL) { - return PSA_ERROR_DOES_NOT_EXIST; - } - fclose(stream); - if (remove(filename) != 0) { - return PSA_ERROR_STORAGE_FAILURE; - } - return PSA_SUCCESS; -} - -#endif /* MBEDTLS_PSA_ITS_FILE_C */ diff --git a/ext/oberon/psa/core/library/psa_util_internal.h b/ext/oberon/psa/core/library/psa_util_internal.h deleted file mode 100644 index 4a36dbf88ea0..000000000000 --- a/ext/oberon/psa/core/library/psa_util_internal.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * \file psa_util_internal.h - * - * \brief Internal utility functions for use of PSA Crypto. - */ -/* - * Copyright The Mbed TLS Contributors - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBEDTLS_PSA_UTIL_INTERNAL_H -#define MBEDTLS_PSA_UTIL_INTERNAL_H - -/* Include the public header so that users only need one include. */ -#include "mbedtls/psa_util.h" - -#include "psa/crypto.h" - -#if defined(MBEDTLS_PSA_CRYPTO_C) - -/************************************************************************* - * FFDH - ************************************************************************/ - -#define MBEDTLS_PSA_MAX_FFDH_PUBKEY_LENGTH \ - PSA_KEY_EXPORT_FFDH_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_FFDH_MAX_KEY_BITS) - -/************************************************************************* - * ECC - ************************************************************************/ - -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH \ - PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) - -#define MBEDTLS_PSA_MAX_EC_KEY_PAIR_LENGTH \ - PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) - -/************************************************************************* - * Error translation - ************************************************************************/ - -typedef struct { - /* Error codes used by PSA crypto are in -255..-128, fitting in 16 bits. */ - int16_t psa_status; - /* Error codes used by Mbed TLS are in one of the ranges - * -127..-1 (low-level) or -32767..-4096 (high-level with a low-level - * code optionally added), fitting in 16 bits. */ - int16_t mbedtls_error; -} mbedtls_error_pair_t; - -#if defined(MBEDTLS_MD_LIGHT) -extern const mbedtls_error_pair_t psa_to_md_errors[4]; -#endif - -#if defined(MBEDTLS_LMS_C) -extern const mbedtls_error_pair_t psa_to_lms_errors[3]; -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) -extern const mbedtls_error_pair_t psa_to_ssl_errors[7]; -#endif - -#if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) || \ - defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) -extern const mbedtls_error_pair_t psa_to_pk_rsa_errors[8]; -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) -extern const mbedtls_error_pair_t psa_to_pk_ecdsa_errors[7]; -#endif - -/* Generic fallback function for error translation, - * when the received state was not module-specific. */ -int psa_generic_status_to_mbedtls(psa_status_t status); - -/* This function iterates over provided local error translations, - * and if no match was found - calls the fallback error translation function. */ -int psa_status_to_mbedtls(psa_status_t status, - const mbedtls_error_pair_t *local_translations, - size_t local_errors_num, - int (*fallback_f)(psa_status_t)); - -/* The second out of three-stage error handling functions of the pk module, - * acts as a fallback after RSA / ECDSA error translation, and if no match - * is found, it itself calls psa_generic_status_to_mbedtls. */ -int psa_pk_status_to_mbedtls(psa_status_t status); - -/* Utility macro to shorten the defines of error translator in modules. */ -#define PSA_TO_MBEDTLS_ERR_LIST(status, error_list, fallback_f) \ - psa_status_to_mbedtls(status, error_list, \ - sizeof(error_list)/sizeof(error_list[0]), \ - fallback_f) - -#endif /* MBEDTLS_PSA_CRYPTO_C */ -#endif /* MBEDTLS_PSA_UTIL_INTERNAL_H */ diff --git a/ext/oberon/psa/drivers/oberon_aead.c b/ext/oberon/psa/drivers/oberon_aead.c deleted file mode 100644 index fd563e2c3442..000000000000 --- a/ext/oberon/psa/drivers/oberon_aead.c +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_aead.h" - -#ifdef PSA_NEED_OBERON_CCM_AES -#include "ocrypto_aes_ccm.h" -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES -#include "ocrypto_aes_gcm.h" -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 -#include "ocrypto_chacha20_poly1305.h" -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - - -static psa_status_t oberon_aead_setup( - oberon_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, uint8_t decrypt) -{ - size_t tag_length; - psa_algorithm_t short_alg; -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - ocrypto_chacha20_poly1305_ctx *cp_ctx; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - - short_alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0); - tag_length = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); - - switch (psa_get_key_type(attributes)) { - case PSA_KEY_TYPE_AES: - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - switch (short_alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_aes_ccm_ctx), "oberon_aead_operation_t.ctx too small"); - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - ocrypto_aes_ccm_init((ocrypto_aes_ccm_ctx*)&operation->ctx, key, key_length, NULL, 0, 0, 0, 0); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_aes_gcm_ctx), "oberon_aead_operation_t.ctx too small"); - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - ocrypto_aes_gcm_init((ocrypto_aes_gcm_ctx*)&operation->ctx, key, key_length, NULL); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_chacha20_poly1305_ctx), "oberon_aead_operation_t.ctx too small"); - case PSA_KEY_TYPE_CHACHA20: - if (alg == PSA_ALG_CHACHA20_POLY1305) { - if (key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - cp_ctx = (ocrypto_chacha20_poly1305_ctx *)&operation->ctx; - memcpy(cp_ctx->enc_ctx.cipher, key, key_length); - } else { - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)key; - (void)key_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->decrypt = decrypt; - operation->alg = short_alg; - operation->tag_length = (uint8_t)tag_length; - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_encrypt_setup( - oberon_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg) -{ - return oberon_aead_setup(operation, attributes, key, key_length, alg, 0); -} - -psa_status_t oberon_aead_decrypt_setup( - oberon_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg) -{ - return oberon_aead_setup(operation, attributes, key, key_length, alg, 1); -} - -psa_status_t oberon_aead_set_lengths( - oberon_aead_operation_t *operation, - size_t ad_length, - size_t plaintext_length) -{ - operation->ad_length = ad_length; - operation->pt_length = plaintext_length; - operation->length_set = 1; - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_set_nonce( - oberon_aead_operation_t *operation, - const uint8_t *nonce, size_t nonce_length) -{ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - ocrypto_chacha20_poly1305_ctx *cp_ctx; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - if (nonce_length < 7 || nonce_length > 13) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_ccm_init((ocrypto_aes_ccm_ctx*)&operation->ctx, - NULL, 0, nonce, nonce_length, - operation->tag_length, operation->pt_length, operation->ad_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - if (nonce_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_gcm_init_iv((ocrypto_aes_gcm_ctx*)&operation->ctx, nonce, nonce_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - if (nonce_length != 8 && nonce_length != 12) return PSA_ERROR_INVALID_ARGUMENT; - // key in ctx->enc_ctx.cipher - cp_ctx = (ocrypto_chacha20_poly1305_ctx *)&operation->ctx; - ocrypto_chacha20_poly1305_init(cp_ctx, nonce, nonce_length, cp_ctx->enc_ctx.cipher); - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)nonce; - (void)nonce_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_update_ad( - oberon_aead_operation_t *operation, - const uint8_t *input, size_t input_length) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - ocrypto_aes_ccm_update_aad((ocrypto_aes_ccm_ctx*)&operation->ctx, input, input_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - ocrypto_aes_gcm_update_aad((ocrypto_aes_gcm_ctx*)&operation->ctx, input, input_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - ocrypto_chacha20_poly1305_update_aad((ocrypto_chacha20_poly1305_ctx*)&operation->ctx, input, input_length); - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)input; - (void)input_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - if (operation->length_set) { - operation->ad_length -= input_length; - } - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_update( - oberon_aead_operation_t *operation, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - if (operation->decrypt) { - ocrypto_aes_ccm_update_dec((ocrypto_aes_ccm_ctx*)&operation->ctx, output, input, input_length); - } else { - ocrypto_aes_ccm_update_enc((ocrypto_aes_ccm_ctx*)&operation->ctx, output, input, input_length); - } - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - if (operation->decrypt) { - ocrypto_aes_gcm_update_dec((ocrypto_aes_gcm_ctx*)&operation->ctx, output, input, input_length); - } else { - ocrypto_aes_gcm_update_enc((ocrypto_aes_gcm_ctx*)&operation->ctx, output, input, input_length); - } - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - if (operation->decrypt) { - ocrypto_chacha20_poly1305_update_dec((ocrypto_chacha20_poly1305_ctx*)&operation->ctx, output, input, input_length); - } else { - ocrypto_chacha20_poly1305_update_enc((ocrypto_chacha20_poly1305_ctx*)&operation->ctx, output, input, input_length); - } - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)input; - (void)output; - return PSA_ERROR_NOT_SUPPORTED; - } - - if (operation->length_set) { - operation->pt_length -= input_length; - } - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_finish( - oberon_aead_operation_t *operation, - uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length, - uint8_t *tag, size_t tag_size, size_t *tag_length) -{ - if (tag_size < operation->tag_length) return PSA_ERROR_BUFFER_TOO_SMALL; - if (operation->length_set && - (operation->pt_length != 0 || operation->ad_length != 0)) return PSA_ERROR_INVALID_ARGUMENT; - (void)ciphertext; - (void)ciphertext_size; - *ciphertext_length = 0; - *tag_length = operation->tag_length; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - ocrypto_aes_ccm_final_enc((ocrypto_aes_ccm_ctx*)&operation->ctx, tag, operation->tag_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - ocrypto_aes_gcm_final_enc((ocrypto_aes_gcm_ctx*)&operation->ctx, tag, operation->tag_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - ocrypto_chacha20_poly1305_final_enc((ocrypto_chacha20_poly1305_ctx*)&operation->ctx, tag); - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)tag; - return PSA_ERROR_NOT_SUPPORTED; - } - - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_verify( - oberon_aead_operation_t *operation, - uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length, - const uint8_t *tag, size_t tag_length) -{ - int res; - if (tag_length != operation->tag_length) return PSA_ERROR_INVALID_SIGNATURE; - if (operation->length_set && - (operation->pt_length != 0 || operation->ad_length != 0)) return PSA_ERROR_INVALID_ARGUMENT; - (void)plaintext; - (void)plaintext_size; - *plaintext_length = 0; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - res = ocrypto_aes_ccm_final_dec((ocrypto_aes_ccm_ctx*)&operation->ctx, tag, operation->tag_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - res = ocrypto_aes_gcm_final_dec((ocrypto_aes_gcm_ctx*)&operation->ctx, tag, operation->tag_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0): - res = ocrypto_chacha20_poly1305_final_dec((ocrypto_chacha20_poly1305_ctx*)&operation->ctx, tag); - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)tag; - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_SIGNATURE; - - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_abort( - oberon_aead_operation_t *operation) -{ - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - - -typedef union { -#ifdef PSA_NEED_OBERON_CCM_AES - ocrypto_aes_ccm_ctx ccm; -#endif -#ifdef PSA_NEED_OBERON_GCM_AES - ocrypto_aes_gcm_ctx gcm; -#endif -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - ocrypto_chacha20_poly1305_ctx cp; -#endif - int dummy; -} ocrypto_context; - -psa_status_t oberon_aead_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *plaintext, size_t plaintext_length, - uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length) -{ - ocrypto_context ctx; - size_t tag_length = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); - size_t length = plaintext_length + tag_length; - if (length < tag_length || ciphertext_size < length) return PSA_ERROR_BUFFER_TOO_SMALL; - *ciphertext_length = length; - - switch (psa_get_key_type(attributes)) { - case PSA_KEY_TYPE_AES: - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - switch (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0)) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - if (tag_length < 4 || tag_length > 16 || (tag_length & 1)) return PSA_ERROR_INVALID_ARGUMENT; - if (nonce_length < 7 || nonce_length > 13) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_ccm_init(&ctx.ccm, - key, key_length, nonce, nonce_length, - tag_length, plaintext_length, additional_data_length); - if (additional_data_length) { - ocrypto_aes_ccm_update_aad(&ctx.ccm, additional_data, additional_data_length); - } - ocrypto_aes_ccm_update_enc(&ctx.ccm, ciphertext, plaintext, plaintext_length); - ocrypto_aes_ccm_final_enc(&ctx.ccm, ciphertext + plaintext_length, tag_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - if (tag_length < 4 || tag_length > 16 || nonce_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_gcm_init(&ctx.gcm, key, key_length, NULL); - ocrypto_aes_gcm_init_iv(&ctx.gcm, nonce, nonce_length); - if (additional_data_length) { - ocrypto_aes_gcm_update_aad(&ctx.gcm, additional_data, additional_data_length); - } - ocrypto_aes_gcm_update_enc(&ctx.gcm, ciphertext, plaintext, plaintext_length); - ocrypto_aes_gcm_final_enc(&ctx.gcm, ciphertext + plaintext_length, tag_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_KEY_TYPE_CHACHA20: - if (alg == PSA_ALG_CHACHA20_POLY1305) { - if (key_length != 32 || (nonce_length != 8 && nonce_length != 12)) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_chacha20_poly1305_init(&ctx.cp, nonce, nonce_length, key); - if (additional_data_length) { - ocrypto_chacha20_poly1305_update_aad(&ctx.cp, additional_data, additional_data_length); - } - ocrypto_chacha20_poly1305_update_enc(&ctx.cp, ciphertext, plaintext, plaintext_length); - ocrypto_chacha20_poly1305_final_enc(&ctx.cp, ciphertext + plaintext_length); - } else { - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)key; - (void)key_length; - (void)nonce; - (void)nonce_length; - (void)additional_data; - (void)additional_data_length; - (void)plaintext; - (void)ciphertext; - (void)ctx; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_aead_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *ciphertext, size_t ciphertext_length, - uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length) -{ - ocrypto_context ctx; - int res; - size_t tag_length = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); - size_t pt_length = ciphertext_length - tag_length; - if (ciphertext_length < tag_length) return PSA_ERROR_INVALID_ARGUMENT; - if (plaintext_size < pt_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *plaintext_length = pt_length; - - switch (psa_get_key_type(attributes)) { - case PSA_KEY_TYPE_AES: - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - switch (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0)) { -#ifdef PSA_NEED_OBERON_CCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0): - if (tag_length < 4 || tag_length > 16 || (tag_length & 1)) return PSA_ERROR_INVALID_ARGUMENT; - if (nonce_length < 7 || nonce_length > 13) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_ccm_init(&ctx.ccm, - key, key_length, nonce, nonce_length, - tag_length, pt_length, additional_data_length); - if (additional_data_length) { - ocrypto_aes_ccm_update_aad(&ctx.ccm, additional_data, additional_data_length); - } - ocrypto_aes_ccm_update_dec(&ctx.ccm, plaintext, ciphertext, pt_length); - res = ocrypto_aes_ccm_final_dec(&ctx.ccm, ciphertext + pt_length, tag_length); - break; -#endif /* PSA_NEED_OBERON_CCM_AES */ -#ifdef PSA_NEED_OBERON_GCM_AES - case PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0): - if (tag_length < 4 || tag_length > 16 || nonce_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_gcm_init(&ctx.gcm, key, key_length, NULL); - ocrypto_aes_gcm_init_iv(&ctx.gcm, nonce, nonce_length); - if (additional_data_length) { - ocrypto_aes_gcm_update_aad(&ctx.gcm, additional_data, additional_data_length); - } - ocrypto_aes_gcm_update_dec(&ctx.gcm, plaintext, ciphertext, pt_length); - res = ocrypto_aes_gcm_final_dec(&ctx.gcm, ciphertext + pt_length, tag_length); - break; -#endif /* PSA_NEED_OBERON_GCM_AES */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#ifdef PSA_NEED_OBERON_CHACHA20_POLY1305 - case PSA_KEY_TYPE_CHACHA20: - if (alg == PSA_ALG_CHACHA20_POLY1305) { - if (key_length != 32 || (nonce_length != 8 && nonce_length != 12)) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_chacha20_poly1305_init(&ctx.cp, nonce, nonce_length, key); - if (additional_data_length) { - ocrypto_chacha20_poly1305_update_aad(&ctx.cp, additional_data, additional_data_length); - } - ocrypto_chacha20_poly1305_update_dec(&ctx.cp, plaintext, ciphertext, pt_length); - res = ocrypto_chacha20_poly1305_final_dec(&ctx.cp, ciphertext + pt_length); - } else { - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - default: - (void)key; - (void)key_length; - (void)nonce; - (void)nonce_length; - (void)additional_data; - (void)additional_data_length; - (void)ciphertext; - (void)plaintext; - (void)ctx; - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_SIGNATURE; - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_aead.h b/ext/oberon/psa/drivers/oberon_aead.h deleted file mode 100644 index 212df40383b9..000000000000 --- a/ext/oberon/psa/drivers/oberon_aead.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_AEAD_H -#define OBERON_AEAD_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - struct { -#if defined(PSA_NEED_OBERON_GCM_AES) - uint32_t a[77]; -#elif defined(PSA_NEED_OBERON_CCM_AES) - uint32_t a[73]; -#else /* PSA_NEED_OBERON_CHACHA20_POLY1305 */ - uint32_t a[51]; -#endif - size_t s[2]; - } ctx; - size_t ad_length; - size_t pt_length; - psa_algorithm_t alg; - uint8_t decrypt; - uint8_t length_set; - uint8_t tag_length; -} oberon_aead_operation_t; - - -psa_status_t oberon_aead_encrypt_setup( - oberon_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg); - -psa_status_t oberon_aead_decrypt_setup( - oberon_aead_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg); - -psa_status_t oberon_aead_set_lengths( - oberon_aead_operation_t *operation, - size_t ad_length, - size_t plaintext_length); - -psa_status_t oberon_aead_set_nonce( - oberon_aead_operation_t *operation, - const uint8_t *nonce, size_t nonce_length); - -psa_status_t oberon_aead_update_ad( - oberon_aead_operation_t *operation, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_aead_update( - oberon_aead_operation_t *operation, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_aead_finish( - oberon_aead_operation_t *operation, - uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length, - uint8_t *tag, size_t tag_size, size_t *tag_length); - -psa_status_t oberon_aead_verify( - oberon_aead_operation_t *operation, - uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length, - const uint8_t *tag, size_t tag_length); - -psa_status_t oberon_aead_abort( - oberon_aead_operation_t *operation); - - -psa_status_t oberon_aead_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *plaintext, size_t plaintext_length, - uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length); - -psa_status_t oberon_aead_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *nonce, size_t nonce_length, - const uint8_t *additional_data, size_t additional_data_length, - const uint8_t *ciphertext, size_t ciphertext_length, - uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.c b/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.c deleted file mode 100644 index 734f35be8a22..000000000000 --- a/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include "psa/crypto.h" -#include "oberon_asymmetric_encrypt.h" - -#ifdef PSA_NEED_OBERON_RSA_ANY_CRYPT -#include "oberon_rsa.h" -#endif - - -psa_status_t oberon_asymmetric_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_RSA_ANY_CRYPT - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_rsa_encrypt( - attributes, key, key_length, - alg, - input, input_length, - salt, salt_length, - output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_RSA_ANY_CRYPT */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)salt; - (void)salt_length; - (void)output; - (void)output_size; - (void)output_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_asymmetric_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_RSA_ANY_CRYPT - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_rsa_decrypt( - attributes, key, key_length, - alg, - input, input_length, - salt, salt_length, - output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_RSA_ANY_CRYPT */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)salt; - (void)salt_length; - (void)output; - (void)output_size; - (void)output_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.h b/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.h deleted file mode 100644 index df91c717c1e6..000000000000 --- a/ext/oberon/psa/drivers/oberon_asymmetric_encrypt.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_ASYMMETRIC_ENCRYPT_H -#define OBERON_ASYMMETRIC_ENCRYPT_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - - psa_status_t oberon_asymmetric_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length); - - psa_status_t oberon_asymmetric_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_asymmetric_signature.c b/ext/oberon/psa/drivers/oberon_asymmetric_signature.c deleted file mode 100644 index 47a9ef1dfbe3..000000000000 --- a/ext/oberon/psa/drivers/oberon_asymmetric_signature.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include "psa/crypto.h" -#include "oberon_asymmetric_signature.h" - -#include "oberon_ecdsa.h" -#include "oberon_rsa.h" - - -psa_status_t oberon_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_ECDSA_SIGN - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_ecdsa_sign_hash( - attributes, key, key_length, - alg, - hash, hash_length, - signature, signature_size, signature_length); - } else -#endif /* PSA_NEED_OBERON_ECDSA_SIGN */ - -#ifdef PSA_NEED_OBERON_RSA_ANY_SIGN - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_rsa_sign_hash( - attributes, key, key_length, - alg, - hash, hash_length, - signature, signature_size, signature_length); - } else -#endif /* PSA_NEED_OBERON_RSA_ANY_SIGN */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)hash; - (void)hash_length; - (void)signature; - (void)signature_size; - (void)signature_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_sign_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *signature, size_t signature_size, size_t *signature_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_ECDSA_SIGN - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_ecdsa_sign_message( - attributes, key, key_length, - alg, - input, input_length, - signature, signature_size, signature_length); - } else -#endif /* PSA_NEED_OBERON_ECDSA_SIGN */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)signature; - (void)signature_size; - (void)signature_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_ECDSA_VERIFY - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_ecdsa_verify_hash( - attributes, key, key_length, - alg, - hash, hash_length, - signature, signature_length); - } else -#endif /* PSA_NEED_OBERON_ECDSA_VERIFY */ - -#ifdef PSA_NEED_OBERON_RSA_ANY_VERIFY - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_rsa_verify_hash( - attributes, key, key_length, - alg, - hash, hash_length, - signature, signature_length); - } else -#endif /* PSA_NEED_OBERON_RSA_ANY_VERIFY */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)hash; - (void)hash_length; - (void)signature; - (void)signature_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_verify_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *signature, size_t signature_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_ECDSA_VERIFY - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_ecdsa_verify_message( - attributes, key, key_length, - alg, - input, input_length, - signature, signature_length); - } else -#endif /* PSA_NEED_OBERON_ECDSA_VERIFY */ - - { - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)signature; - (void)signature_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_asymmetric_signature.h b/ext/oberon/psa/drivers/oberon_asymmetric_signature.h deleted file mode 100644 index 8857d5d40ab1..000000000000 --- a/ext/oberon/psa/drivers/oberon_asymmetric_signature.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_ASYMMETRIC_SIGNATURE_H -#define OBERON_ASYMMETRIC_SIGNATURE_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_sign_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -psa_status_t oberon_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -psa_status_t oberon_verify_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *signature, size_t signature_length); - -psa_status_t oberon_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_cipher.c b/ext/oberon/psa/drivers/oberon_cipher.c deleted file mode 100644 index aa7366836a2b..000000000000 --- a/ext/oberon/psa/drivers/oberon_cipher.c +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_cipher.h" - -#if defined(PSA_NEED_OBERON_CTR_AES) || defined(PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES) -#include "ocrypto_aes_ctr.h" -#endif -#if defined(PSA_NEED_OBERON_CBC_PKCS7_AES) || defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) || defined(PSA_NEED_OBERON_ECB_NO_PADDING_AES) -#include "ocrypto_aes_cbc_pkcs.h" -#endif -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 -#include "ocrypto_chacha20.h" -#endif - - -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES -static void oberon_aes_ccm_star_set_iv( - ocrypto_aes_ctr_ctx *ctx, - const uint8_t iv[13]) -{ - uint8_t counter[16]; - counter[0] = 1; // 2 bytes counter - memcpy(&counter[1], iv, 13); - counter[14] = 0; - counter[15] = 1; // initial count - ocrypto_aes_ctr_init(ctx, NULL, 0, counter); -} -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ - - -static psa_status_t oberon_cipher_setup( - oberon_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, uint8_t decrypt) -{ -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_chacha20_ctx), "oberon_cipher_operation_t.ctx too small"); - if (alg == PSA_ALG_STREAM_CIPHER && psa_get_key_type(attributes) == PSA_KEY_TYPE_CHACHA20) { - if (key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_chacha20_init((ocrypto_chacha20_ctx*)operation->ctx, NULL, 0, key, 0); - operation->decrypt = decrypt; - operation->alg = alg; - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 */ - - if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - - switch (alg) { -#if defined(PSA_NEED_OBERON_CTR_AES) || defined(PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES) - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_aes_ctr_ctx), "oberon_cipher_operation_t.ctx too small"); -#ifdef PSA_NEED_OBERON_CTR_AES - case PSA_ALG_CTR: -#endif /* PSA_NEED_OBERON_CTR_AES */ -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES - case PSA_ALG_CCM_STAR_NO_TAG: -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ - ocrypto_aes_ctr_init((ocrypto_aes_ctr_ctx*)operation->ctx, key, key_length, NULL); - break; -#endif /* PSA_NEED_OBERON_CTR_AES || PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_aes_cbc_pkcs_ctx), "oberon_cipher_operation_t.ctx too small"); - case PSA_ALG_CBC_PKCS7: - ocrypto_aes_cbc_pkcs_init((ocrypto_aes_cbc_pkcs_ctx*)operation->ctx, key, key_length, NULL, decrypt); - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#if defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) || defined(PSA_NEED_OBERON_ECB_NO_PADDING_AES) - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_aes_cbc_pkcs_ctx), "oberon_cipher_operation_t.ctx too small"); -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ -#ifdef PSA_NEED_OBERON_ECB_NO_PADDING_AES - case PSA_ALG_ECB_NO_PADDING: -#endif /* PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - ocrypto_aes_cbc_pkcs_init((ocrypto_aes_cbc_pkcs_ctx*)operation->ctx, key, key_length, NULL, decrypt * 2); - break; -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES || PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - default: - (void)key; - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->decrypt = decrypt; - operation->alg = alg; - return PSA_SUCCESS; -} - -psa_status_t oberon_cipher_encrypt_setup( - oberon_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg) -{ - return oberon_cipher_setup(operation, attributes, key, key_length, alg, 0); -} - -psa_status_t oberon_cipher_decrypt_setup( - oberon_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg) -{ - return oberon_cipher_setup(operation, attributes, key, key_length, alg, 1); -} - -psa_status_t oberon_cipher_set_iv( - oberon_cipher_operation_t *operation, - const uint8_t *iv, size_t iv_length) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - case PSA_ALG_STREAM_CIPHER: - if (iv_length != 12) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_chacha20_init((ocrypto_chacha20_ctx*)operation->ctx, iv, 12, NULL, 0); - break; -#endif /* PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 */ -#ifdef PSA_NEED_OBERON_CTR_AES - case PSA_ALG_CTR: - if (iv_length != 16) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_ctr_init((ocrypto_aes_ctr_ctx*)operation->ctx, NULL, 0, iv); - break; -#endif /* PSA_NEED_OBERON_CTR_AES */ -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES - case PSA_ALG_CCM_STAR_NO_TAG: - if (iv_length != 13) return PSA_ERROR_INVALID_ARGUMENT; - oberon_aes_ccm_star_set_iv((ocrypto_aes_ctr_ctx*)operation->ctx, iv); - break; -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ -#if defined(PSA_NEED_OBERON_CBC_PKCS7_AES) || defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - case PSA_ALG_CBC_PKCS7: -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ - if (iv_length != 16) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_aes_cbc_pkcs_init((ocrypto_aes_cbc_pkcs_ctx*)operation->ctx, NULL, 0, iv, 0); - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES || PSA_NEED_OBERON_CBC_NO_PADDING_AES */ - default: - (void)iv; - (void)iv_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_cipher_update( - oberon_cipher_operation_t *operation, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - size_t out_len; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - case PSA_ALG_STREAM_CIPHER: - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_chacha20_update((ocrypto_chacha20_ctx*)operation->ctx, output, input, input_length); - *output_length = input_length; - break; -#endif /* PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 */ -#if defined(PSA_NEED_OBERON_CTR_AES) || defined(PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES) -#ifdef PSA_NEED_OBERON_CTR_AES - case PSA_ALG_CTR: -#endif /* PSA_NEED_OBERON_CTR_AES */ -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES - case PSA_ALG_CCM_STAR_NO_TAG: -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_aes_ctr_update((ocrypto_aes_ctr_ctx*)operation->ctx, output, input, input_length); - *output_length = input_length; - break; -#endif /* PSA_NEED_OBERON_CTR_AES || PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ -#if defined(PSA_NEED_OBERON_CBC_PKCS7_AES) || defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) || defined(PSA_NEED_OBERON_ECB_NO_PADDING_AES) -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - case PSA_ALG_CBC_PKCS7: -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ -#ifdef PSA_NEED_OBERON_ECB_NO_PADDING_AES - case PSA_ALG_ECB_NO_PADDING: -#endif /* PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - out_len = ocrypto_aes_cbc_pkcs_output_size((ocrypto_aes_cbc_pkcs_ctx*)operation->ctx, input_length); - if (output_size < out_len) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_aes_cbc_pkcs_update((ocrypto_aes_cbc_pkcs_ctx*)operation->ctx, output, input, input_length); - *output_length = out_len; - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES || PSA_NEED_OBERON_CBC_NO_PADDING_AES || PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - default: - (void)input; - (void)input_length; - (void)output; - (void)output_size; - (void)output_length; - (void)out_len; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_cipher_finish( - oberon_cipher_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res; - *output_length = 0; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - case PSA_ALG_CBC_PKCS7: - if (output_size < 16) return PSA_ERROR_BUFFER_TOO_SMALL; - if (operation->decrypt) { - if (ocrypto_aes_cbc_pkcs_output_size((ocrypto_aes_cbc_pkcs_ctx *)operation->ctx, 1) == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - res = ocrypto_aes_cbc_pkcs_final_dec((ocrypto_aes_cbc_pkcs_ctx *)operation->ctx, output, output_length); - if (res) return PSA_ERROR_INVALID_PADDING; - } else { - ocrypto_aes_cbc_pkcs_final_enc((ocrypto_aes_cbc_pkcs_ctx *)operation->ctx, output); - *output_length = 16; - } - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#if defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) || defined(PSA_NEED_OBERON_ECB_NO_PADDING_AES) -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ -#ifdef PSA_NEED_OBERON_ECB_NO_PADDING_AES - case PSA_ALG_ECB_NO_PADDING: -#endif /* PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - if (ocrypto_aes_cbc_pkcs_output_size((ocrypto_aes_cbc_pkcs_ctx *)operation->ctx, 15) > 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES || PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - default: - (void)output; - (void)output_size; - (void)res; - break; // nothing to do - } - - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - -psa_status_t oberon_cipher_abort( - oberon_cipher_operation_t *operation) -{ - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - - -typedef union { -#if defined(PSA_NEED_OBERON_CTR_AES) || defined(PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES) - ocrypto_aes_ctr_ctx ctr; -#endif -#if defined(PSA_NEED_OBERON_CBC_PKCS7_AES) || defined(PSA_NEED_OBERON_CBC_NO_PADDING_AES) || defined(PSA_NEED_OBERON_ECB_NO_PADDING_AES) - ocrypto_aes_cbc_pkcs_ctx cbc; -#endif -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - ocrypto_chacha20_ctx ch; -#endif - int dummy; -} ocrypto_context; - -psa_status_t oberon_cipher_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *iv, size_t iv_length, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - ocrypto_context ctx; - size_t out_len; - -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - if (alg == PSA_ALG_STREAM_CIPHER && psa_get_key_type(attributes) == PSA_KEY_TYPE_CHACHA20) { - if (key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - if (iv_length != 12) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_chacha20_init(&ctx.ch, iv, iv_length, key, 0); - ocrypto_chacha20_update(&ctx.ch, output, input, input_length); - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 */ - - if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - - switch (alg) { -#ifdef PSA_NEED_OBERON_CTR_AES - case PSA_ALG_CTR: - if (iv_length != 16) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_aes_ctr_init(&ctx.ctr, key, key_length, iv); - ocrypto_aes_ctr_update(&ctx.ctr, output, input, input_length); - break; -#endif /* PSA_NEED_OBERON_CTR_AES */ -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES - case PSA_ALG_CCM_STAR_NO_TAG: - if (iv_length != 13) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_aes_ctr_init(&ctx.ctr, key, key_length, NULL); - oberon_aes_ccm_star_set_iv(&ctx.ctr, iv); - ocrypto_aes_ctr_update(&ctx.ctr, output, input, input_length); - break; -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - case PSA_ALG_CBC_PKCS7: - if (iv_length != 16) return PSA_ERROR_INVALID_ARGUMENT; - out_len = (input_length + 16) & ~15; // next multiple of block size - if (output_size < out_len) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = out_len; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, iv, 0); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input, input_length); - ocrypto_aes_cbc_pkcs_final_enc(&ctx.cbc, output + (input_length & ~15)); - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: - if (iv_length != 16) return PSA_ERROR_INVALID_ARGUMENT; - if ((input_length & 15) != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, iv, 0); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input, input_length); - break; -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ -#ifdef PSA_NEED_OBERON_ECB_NO_PADDING_AES - case PSA_ALG_ECB_NO_PADDING: - if (iv_length != 0) return PSA_ERROR_INVALID_ARGUMENT; - if ((input_length & 15) != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, NULL, 0); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input, input_length); - break; -#endif /* PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - default: - (void)key; - (void)iv; - (void)iv_length; - (void)input; - (void)input_length; - (void)output; - (void)output_size; - (void)output_length; - (void)ctx; - (void)out_len; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_cipher_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - ocrypto_context ctx; - int res; - -#ifdef PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 - if (alg == PSA_ALG_STREAM_CIPHER && psa_get_key_type(attributes) == PSA_KEY_TYPE_CHACHA20) { - if (input_length < 12) return PSA_ERROR_INVALID_ARGUMENT; - if (key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length - 12) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length - 12; - ocrypto_chacha20_init(&ctx.ch, input, 12, key, 0); - ocrypto_chacha20_update(&ctx.ch, output, input + 12, input_length - 12); - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_STREAM_CIPHER_CHACHA20 */ - - if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - - switch (alg) { -#ifdef PSA_NEED_OBERON_CTR_AES - case PSA_ALG_CTR: - if (input_length < 16) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length - 16) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length - 16; - ocrypto_aes_ctr_init(&ctx.ctr, key, key_length, input); - ocrypto_aes_ctr_update(&ctx.ctr, output, input + 16, input_length - 16); - break; -#endif /* PSA_NEED_OBERON_CTR_AES */ -#ifdef PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES - case PSA_ALG_CCM_STAR_NO_TAG: - if (input_length < 13) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length - 13) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length - 13; - ocrypto_aes_ctr_init(&ctx.ctr, key, key_length, NULL); - oberon_aes_ccm_star_set_iv(&ctx.ctr, input); - ocrypto_aes_ctr_update(&ctx.ctr, output, input + 13, input_length - 13); - break; -#endif /* PSA_NEED_OBERON_CCM_STAR_NO_TAG_AES */ -#ifdef PSA_NEED_OBERON_CBC_PKCS7_AES - case PSA_ALG_CBC_PKCS7: - if (input_length < 32 || (input_length & 15) != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length - 16) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, input, 1); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input + 16, input_length - 16); - res = ocrypto_aes_cbc_pkcs_final_dec(&ctx.cbc, output + input_length - 32, output_length); - if (res) return PSA_ERROR_INVALID_PADDING; - *output_length += input_length - 32; - break; -#endif /* PSA_NEED_OBERON_CBC_PKCS7_AES */ -#ifdef PSA_NEED_OBERON_CBC_NO_PADDING_AES - case PSA_ALG_CBC_NO_PADDING: - if (input_length < 16 || (input_length & 15) != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length - 16) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length - 16; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, input, 2); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input + 16, input_length - 16); - break; -#endif /* PSA_NEED_OBERON_CBC_NO_PADDING_AES */ -#ifdef PSA_NEED_OBERON_ECB_NO_PADDING_AES - case PSA_ALG_ECB_NO_PADDING: - if ((input_length & 15) != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = input_length; - ocrypto_aes_cbc_pkcs_init(&ctx.cbc, key, key_length, NULL, 2); - ocrypto_aes_cbc_pkcs_update(&ctx.cbc, output, input, input_length); - break; -#endif /* PSA_NEED_OBERON_ECB_NO_PADDING_AES */ - default: - (void)key; - (void)input; - (void)input_length; - (void)output; - (void)output_size; - (void)output_length; - (void)ctx; - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_cipher.h b/ext/oberon/psa/drivers/oberon_cipher.h deleted file mode 100644 index 70245248e8f0..000000000000 --- a/ext/oberon/psa/drivers/oberon_cipher.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_CIPHER_H -#define OBERON_CIPHER_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - uint32_t ctx[70]; - psa_algorithm_t alg; - uint8_t decrypt; -} oberon_cipher_operation_t; - - -psa_status_t oberon_cipher_encrypt_setup( - oberon_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg); - -psa_status_t oberon_cipher_decrypt_setup( - oberon_cipher_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg); - -psa_status_t oberon_cipher_set_iv( - oberon_cipher_operation_t *operation, - const uint8_t *iv, size_t iv_length); - -psa_status_t oberon_cipher_update( - oberon_cipher_operation_t *operation, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_cipher_finish( - oberon_cipher_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_cipher_abort( - oberon_cipher_operation_t *operation); - - -psa_status_t oberon_cipher_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *iv, size_t iv_length, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_cipher_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *output, size_t output_size, size_t *output_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_ctr_drbg.c b/ext/oberon/psa/drivers/oberon_ctr_drbg.c deleted file mode 100644 index b0b706b4e49d..000000000000 --- a/ext/oberon/psa/drivers/oberon_ctr_drbg.c +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_ctr_drbg.h" -#include "psa_crypto_driver_wrappers.h" - - -/* CTR-DRBG implementation based on NIST.SP.800-90Ar1 */ - - -#define ENTROPY_FACTOR 1 // fraction of entropy in entropy data -#define RESEED_INTERVAL 10000 - -#define KEY_LEN PSA_BITS_TO_BYTES(256) -#define BLOCK_LEN PSA_BLOCK_CIPHER_BLOCK_LENGTH(PSA_KEY_TYPE_AES) -#define SEED_LEN (KEY_LEN + BLOCK_LEN) // NIST.SP.800-90Ar1:Table 3 -#define MAX_BITS_PER_REQUEST (1 << 19) // NIST.SP.800-90Ar1:Table 3 -#define MAX_ENTROPY_BLOCKS ((SEED_LEN * ENTROPY_FACTOR + BLOCK_LEN - 1) / BLOCK_LEN) - - -// get entropy from entropy driver -static psa_status_t get_entropy( - uint8_t data[SEED_LEN], - size_t entropy_bits) -{ -#if ENTROPY_FACTOR == 1 - // Use entropy input without derivation function. - psa_status_t status; - size_t estimate_bits; - - // get SEED_LEN full entropy bits - status = psa_driver_wrapper_get_entropy(0, &estimate_bits, data, SEED_LEN); - if (status) return status; - if (estimate_bits < entropy_bits) return PSA_ERROR_INSUFFICIENT_ENTROPY; - - return PSA_SUCCESS; -#else /* ENTROPY_FACTOR > 1 */ - // Use entropy input with block cipher derivation function. - // We use a CMAC instead of the CBC-MAC with explicit length input specified in NIST.SP.800-90Ar1. - union { - struct { - psa_mac_operation_t mac_op; - uint8_t input[MAX_ENTROPY_BLOCKS * BLOCK_LEN]; // we have to store the whole entropy input here - }; - psa_cipher_operation_t cipher_op; - } u; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - uint8_t key[KEY_LEN]; - uint8_t temp[(SEED_LEN + BLOCK_LEN - 1) / BLOCK_LEN * BLOCK_LEN]; - uint8_t iv[BLOCK_LEN]; - psa_status_t status; - size_t in_length, ret_length, temp_length, data_length, len; - size_t estimate_bits, total_bits; - unsigned i; - - // get entropy - total_bits = 0; - in_length = 0; - do { - status = psa_driver_wrapper_get_entropy(0, &estimate_bits, u.input + in_length, BLOCK_LEN); - if (status) return status; - total_bits += estimate_bits; - in_length += BLOCK_LEN; - if (in_length >= MAX_ENTROPY_BLOCKS * BLOCK_LEN) return PSA_ERROR_INSUFFICIENT_ENTROPY; - } while (total_bits < entropy_bits); - - // get key - psa_set_key_type(&attr, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attr, PSA_BYTES_TO_BITS(KEY_LEN)); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_MESSAGE); - for (i = 0; i < KEY_LEN; i++) key[i] = (uint8_t)i; - ret_length = SEED_LEN; - memset(iv, 0, sizeof iv); - - // get temp - i = 0; - for (temp_length = 0; temp_length < SEED_LEN; temp_length += BLOCK_LEN) { - memset(&u.mac_op, 0, sizeof u.mac_op); - status = psa_driver_wrapper_mac_sign_setup(&u.mac_op, &attr, key, sizeof key, PSA_ALG_CMAC); - if (status) return status; - iv[0] = i; - status = psa_driver_wrapper_mac_update(&u.mac_op, iv, BLOCK_LEN); // IV - if (status) return status; - status = psa_driver_wrapper_mac_update(&u.mac_op, u.input, in_length); // input - if (status) return status; - status = psa_driver_wrapper_mac_sign_finish(&u.mac_op, temp + temp_length, BLOCK_LEN, &len); - if (status) return status; - i++; - } - - // set key - memset(&u.cipher_op, 0, sizeof u.cipher_op); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_ENCRYPT); - status = psa_driver_wrapper_cipher_encrypt_setup( - &u.cipher_op, - &attr, temp, KEY_LEN, - PSA_ALG_ECB_NO_PADDING); - if (status) return status; - - // set X - memcpy(iv, temp + KEY_LEN, BLOCK_LEN); - - // get output - data_length = SEED_LEN; - for (;;) { - status = psa_driver_wrapper_cipher_update( - &u.cipher_op, - iv, BLOCK_LEN, - iv, BLOCK_LEN, &len); - if (status) return status; - - if (data_length <= BLOCK_LEN) { - memcpy(data, iv, data_length); - return PSA_SUCCESS; - } - - memcpy(data, iv, BLOCK_LEN); - data += BLOCK_LEN; - data_length -= BLOCK_LEN; - } -#endif /* ENTROPY_FACTOR */ -} - -// AES-CTR based encrypt function -static psa_status_t ctr_drbg_cipher( - oberon_ctr_drbg_context_t *context, - const uint8_t *input, // may be NULL - uint8_t *cipher, size_t cipher_length) -{ - uint8_t block[BLOCK_LEN]; - size_t length; - psa_status_t status; - - while (cipher_length >= BLOCK_LEN) { - // increment counter part of v - context->counter_part++; - - // generate a cipher block - status = psa_driver_wrapper_cipher_update( - &context->aes_op, - context->v, BLOCK_LEN, - input ? block : cipher, BLOCK_LEN, &length); - if (status) return status; - - // combine cipher with input - if (input) { - oberon_xor(cipher, block, input, BLOCK_LEN); - } - - cipher += BLOCK_LEN; - cipher_length -= BLOCK_LEN; - } - - if (cipher_length) { - // increment counter part of v - context->counter_part++; - - // generate a cipher block - status = psa_driver_wrapper_cipher_update( - &context->aes_op, - context->v, BLOCK_LEN, - block, BLOCK_LEN, &length); - if (status) return status; - - if (input) { - oberon_xor(cipher, block, input, cipher_length); - } else { - memcpy(cipher, block, cipher_length); - } - } - - return PSA_SUCCESS; -} - -// reset the generator state from seed -static psa_status_t ctr_drbg_reset( - oberon_ctr_drbg_context_t *context, - const uint8_t seed[SEED_LEN]) -{ - psa_status_t status; - psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attributes, PSA_BYTES_TO_BITS(KEY_LEN)); - psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_ENCRYPT); - - // reset cipher in case it was not properly cleaned up before - psa_driver_wrapper_cipher_abort(&context->aes_op); - - // restart generator with new key - status = psa_driver_wrapper_cipher_encrypt_setup( - &context->aes_op, - &attributes, seed, KEY_LEN, - PSA_ALG_ECB_NO_PADDING); - if (status) return status; - - // set new v - memcpy(context->v, seed + KEY_LEN, BLOCK_LEN); - - return PSA_SUCCESS; -} - -// update the generator state -static psa_status_t ctr_drbg_update( - oberon_ctr_drbg_context_t *context, - const uint8_t input[SEED_LEN]) // may be NULL -{ - uint8_t temp[SEED_LEN]; - psa_status_t status; - - // get random data from state and combine with input - status = ctr_drbg_cipher(context, input, temp, SEED_LEN); - if (status) return status; - - // update key and counter - return ctr_drbg_reset(context, temp); -} - -// instantiate the generator state -psa_status_t oberon_ctr_drbg_init( - oberon_ctr_drbg_context_t *context) -{ - uint8_t data[SEED_LEN]; - psa_status_t status; - -#ifdef OBERON_USE_MUTEX - oberon_mutex_init(&context->mutex); -#endif - - // initialize generator state with key = 0 and v = 0 - memset(data, 0, sizeof data); - status = ctr_drbg_reset(context, data); - if (status) return status; - - // initial seeding - status = get_entropy(data, PSA_BYTES_TO_BITS(SEED_LEN)); - if (status) return status; - status = ctr_drbg_update(context, data); - if (status) return status; - - context->reseed_counter = 1; - return PSA_SUCCESS; -} - -// generate random bytes -psa_status_t oberon_ctr_drbg_get_random( - oberon_ctr_drbg_context_t *context, - uint8_t *output, - size_t output_size) -{ - uint8_t seed[SEED_LEN]; - psa_status_t status; - -#ifdef OBERON_USE_MUTEX - if (oberon_mutex_lock(&context->mutex)) { - return PSA_ERROR_GENERIC_ERROR; - } -#endif - - if (context->reseed_counter == 0) return PSA_ERROR_BAD_STATE; - if (output_size > PSA_BITS_TO_BYTES(MAX_BITS_PER_REQUEST)) return PSA_ERROR_INVALID_ARGUMENT; - - // reseed generator if necessary - if (context->reseed_counter > RESEED_INTERVAL) { - // get new seed - status = get_entropy(seed, PSA_BYTES_TO_BITS(KEY_LEN)); - if (status) return status; - // update generator state with new seed - status = ctr_drbg_update(context, seed); - if (status) return status; - context->reseed_counter = 1; - } - - // generate output - status = ctr_drbg_cipher(context, NULL, output, output_size); - if (status) return status; - - // update generator state for backtracking resistance - status = ctr_drbg_update(context, NULL); - if (status) return status; - - context->reseed_counter++; - -#ifdef OBERON_USE_MUTEX - if (oberon_mutex_unlock(&context->mutex)) { - return PSA_ERROR_GENERIC_ERROR; - } -#endif - - return PSA_SUCCESS; -} - -// cleanup the generator state -psa_status_t oberon_ctr_drbg_free( - oberon_ctr_drbg_context_t *context) -{ - psa_driver_wrapper_cipher_abort(&context->aes_op); -#ifdef OBERON_USE_MUTEX - oberon_mutex_free(&context->mutex); -#endif - memset(context, 0, sizeof *context); - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_ctr_drbg.h b/ext/oberon/psa/drivers/oberon_ctr_drbg.h deleted file mode 100644 index 3d1c587004f8..000000000000 --- a/ext/oberon/psa/drivers/oberon_ctr_drbg.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_CTR_DRBG_H -#define OBERON_CTR_DRBG_H - -#include -#include "oberon_helpers.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - psa_cipher_operation_t aes_op; - union { - uint8_t v[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE]; - uint32_t counter_part; - }; - uint32_t reseed_counter; -#ifdef OBERON_USE_MUTEX - oberon_mutex_type mutex; -#endif -} oberon_ctr_drbg_context_t; - - -psa_status_t oberon_ctr_drbg_init( - oberon_ctr_drbg_context_t *context); - -psa_status_t oberon_ctr_drbg_get_random( - oberon_ctr_drbg_context_t *context, - uint8_t *output, - size_t output_size); - -psa_status_t oberon_ctr_drbg_free( - oberon_ctr_drbg_context_t *context); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_ec_keys.c b/ext/oberon/psa/drivers/oberon_ec_keys.c deleted file mode 100644 index b225b467dc66..000000000000 --- a/ext/oberon/psa/drivers/oberon_ec_keys.c +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_ec_keys.h" -#include "oberon_helpers.h" - -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224) -#include "ocrypto_ecdh_p224.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256) -#include "ocrypto_ecdh_p256.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384) -#include "ocrypto_ecdh_p384.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521) -#include "ocrypto_ecdh_p521.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255) -#include "ocrypto_curve25519.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448) -#include "ocrypto_curve448.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255) -#include "ocrypto_ed25519.h" -#endif -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448) -#include "ocrypto_ed448.h" -#endif - - -psa_status_t oberon_export_ec_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length) -{ - int res; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { - if (key_length > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(data, key, key_length); - *data_length = key_length; - return PSA_SUCCESS; - } - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (data_size < key_length * 2 + 1) return PSA_ERROR_BUFFER_TOO_SMALL; - *data_length = key_length * 2 + 1; - data[0] = 0x04; - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 - case 224: - res = ocrypto_ecdh_p224_public_key(&data[1], key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 - case 256: - res = ocrypto_ecdh_p256_public_key(&data[1], key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 - case 384: - res = ocrypto_ecdh_p384_public_key(&data[1], key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 - case 521: - res = ocrypto_ecdh_p521_public_key(&data[1], key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY): - if (data_size < key_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *data_length = key_length; - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 - case 255: - ocrypto_curve25519_scalarmult_base(data, key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 - case 448: - ocrypto_curve448_scalarmult_base(data, key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - if (data_size < key_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *data_length = key_length; - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 - case 255: - ocrypto_ed25519_public_key(data, key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 - case 448: - ocrypto_ed448_public_key(data, key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS */ - default: - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY) -static void oberon_set_forced_bits(uint8_t *key, size_t bits) -{ - switch (bits) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255) - case 255: - key[0] = (uint8_t)(key[0] & 0xF8); - key[31] = (uint8_t)((key[31] & 0x7F) | 0x40); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448) - case 448: - key[0] = (uint8_t)(key[0] & 0xFC); - key[55] = (uint8_t)(key[55] | 0x80); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 */ - } -} -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY || - PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY */ - -psa_status_t oberon_import_ec_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *key_bits) -{ - int res; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (bits == 0) { - bits = PSA_BYTES_TO_BITS(data_length); -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 - if (bits == 528) bits = 521; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 */ - } - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 - case 224: - if (data_length != 28) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 28)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p224_secret_key_check(data); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 - case 256: - if (data_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 32)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_secret_key_check(data); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 - case 384: - if (data_length != 48) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 48)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p384_secret_key_check(data); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 - case 521: - if (data_length != 66) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 66)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p521_secret_key_check(data); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; // out of range - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1): - if (bits == 0) { - if ((data_length & 1) == 0) return PSA_ERROR_INVALID_ARGUMENT; - bits = PSA_BYTES_TO_BITS(data_length >> 1); -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 - if (bits == 528) bits = 521; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 */ - } - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 - case 224: - if (data_length != 57 || data[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p224_public_key_check(&data[1]); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 - case 256: - if (data_length != 65 || data[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_public_key_check(&data[1]); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 - case 384: - if (data_length != 97 || data[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p384_public_key_check(&data[1]); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 - case 521: - if (data_length != 133 || data[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p521_public_key_check(&data[1]); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; // point not on curve - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_SECP */ - -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY) -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY): -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_MONTGOMERY): -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY */ - if (bits == 0) { - switch (data_length) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255) - case 32: bits = 255; break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448) - case 56: bits = 448; break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - } - if (data_length != PSA_BITS_TO_BYTES(bits)) return PSA_ERROR_INVALID_ARGUMENT; - switch (bits) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255) - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448) - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY */ - -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS) -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS): -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS */ - if (bits == 0) { - switch (data_length) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255) - case 32: bits = 255; break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448) - case 57: bits = 448; break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - } - if (data_length != PSA_BITS_TO_BYTES(bits + 1)) return PSA_ERROR_INVALID_ARGUMENT; - switch (bits) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255) - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448) || \ - defined(PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448) - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS || - PSA_NEED_OBERON_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS */ - - default: - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } - - if (*key_bits != 0 && *key_bits != bits) return PSA_ERROR_INVALID_ARGUMENT; - if (key_size < data_length) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(key, data, data_length); -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY) - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY)) { - oberon_set_forced_bits(key, bits); - } -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY */ - *key_length = data_length; - *key_bits = bits; - return PSA_SUCCESS; -} - -psa_status_t oberon_generate_ec_key( - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length) -{ - int res; - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - size_t length = PSA_BITS_TO_BYTES(bits); - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (key_size < length) return PSA_ERROR_BUFFER_TOO_SMALL; - do { - do { - status = psa_generate_random(key, length); - if (status) return status; - } while (oberon_ct_compare_zero(key, length) == 0); - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 - case 224: - res = ocrypto_ecdh_p224_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 - case 256: - res = ocrypto_ecdh_p256_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 - case 384: - res = ocrypto_ecdh_p384_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 - case 521: - res = ocrypto_ecdh_p521_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - } while (res); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY): - if (key_size < length) return PSA_ERROR_BUFFER_TOO_SMALL; - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - status = psa_generate_random(key, length); - if (status) return status; - oberon_set_forced_bits(key, bits); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - length = PSA_BITS_TO_BYTES(bits + 1); // ED needs an extra bit - if (key_size < length) return PSA_ERROR_BUFFER_TOO_SMALL; - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 */ - default: return PSA_ERROR_NOT_SUPPORTED; - } - status = psa_generate_random(key, length); - if (status) return status; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS */ - - default: - (void)key; - (void)res; - (void)status; - return PSA_ERROR_NOT_SUPPORTED; - } - - *key_length = length; - return PSA_SUCCESS; -} - -psa_status_t oberon_derive_ec_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length) -{ - int res; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP - uint32_t c; - size_t i; -#endif - - if (key_size < input_length) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(key, input, input_length); - *key_length = input_length; - - // check and preprocess key data - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - - // increment key data - c = 1; i = input_length; - do { - c += key[--i]; - key[i] = (uint8_t)c; - c >>= 8; - } while (i > 0); - - switch (bits) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 - case 224: - res = ocrypto_ecdh_p224_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 - case 256: - res = ocrypto_ecdh_p256_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 - case 384: - res = ocrypto_ecdh_p384_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 - case 521: - key[0] &= 0x01; // truncate to 521 bits - res = ocrypto_ecdh_p521_secret_key_check(key); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 */ - default: - return PSA_ERROR_INVALID_ARGUMENT; - } - // repeat if input out of range - if (res || !oberon_ct_compare_zero(key, input_length)) return PSA_ERROR_INSUFFICIENT_DATA; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY): - switch (bits) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255) - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448) - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 */ - default: return PSA_ERROR_INVALID_ARGUMENT; - } - oberon_set_forced_bits(key, bits); - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - switch (bits) { -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255) - case 255: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 */ -#if defined(PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448) - case 448: break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 */ - default: return PSA_ERROR_INVALID_ARGUMENT; - } - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS */ - - default: - (void)res; - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_ec_keys.h b/ext/oberon/psa/drivers/oberon_ec_keys.h deleted file mode 100644 index 046930897c11..000000000000 --- a/ext/oberon/psa/drivers/oberon_ec_keys.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_EC_KEYS_H -#define OBERON_EC_KEYS_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_export_ec_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length); - -psa_status_t oberon_import_ec_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *bits); - -psa_status_t oberon_generate_ec_key( - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length); - -psa_status_t oberon_derive_ec_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_ecdh.c b/ext/oberon/psa/drivers/oberon_ecdh.c deleted file mode 100644 index 249efc7af7a4..000000000000 --- a/ext/oberon/psa/drivers/oberon_ecdh.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include "psa/crypto.h" -#include "oberon_ecdh.h" - -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_224 -#include "ocrypto_ecdh_p224.h" -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_256 -#include "ocrypto_ecdh_p256.h" -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_384 -#include "ocrypto_ecdh_p384.h" -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_521 -#include "ocrypto_ecdh_p521.h" -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_521 */ -#ifdef PSA_NEED_OBERON_ECDH_MONTGOMERY_255 -#include "ocrypto_curve25519.h" -#endif /* PSA_NEED_OBERON_ECDH_MONTGOMERY_255 */ -#ifdef PSA_NEED_OBERON_ECDH_MONTGOMERY_448 -#include "ocrypto_curve448.h" -#endif /* PSA_NEED_OBERON_ECDH_MONTGOMERY_448 */ - - -psa_status_t oberon_ecdh( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *peer_key, size_t peer_key_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res = 0; - size_t bits = psa_get_key_bits(attributes); - if (alg != PSA_ALG_ECDH) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != PSA_BITS_TO_BYTES(bits)) return PSA_ERROR_INVALID_ARGUMENT; - if (output_size < key_length) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = key_length; - - switch (psa_get_key_type(attributes)) { -#if defined(PSA_NEED_OBERON_ECDH_SECP_R1_224) || defined(PSA_NEED_OBERON_ECDH_SECP_R1_256) || \ - defined(PSA_NEED_OBERON_ECDH_SECP_R1_384) || defined(PSA_NEED_OBERON_ECDH_SECP_R1_521) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (peer_key_length != key_length * 2 + 1) return PSA_ERROR_INVALID_ARGUMENT; - if (peer_key[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - switch (bits) { -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_224 - case 224: - res = ocrypto_ecdh_p224_common_secret(output, key, &peer_key[1]); - break; -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_256 - case 256: - res = ocrypto_ecdh_p256_common_secret(output, key, &peer_key[1]); - break; -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_384 - case 384: - res = ocrypto_ecdh_p384_common_secret(output, key, &peer_key[1]); - break; -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_ECDH_SECP_R1_521 - case 521: - res = ocrypto_ecdh_p521_common_secret(output, key, &peer_key[1]); - break; -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_521 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; - break; -#endif /* PSA_NEED_OBERON_ECDH_SECP_R1_224 || PSA_NEED_OBERON_ECDH_SECP_R1_256 || - PSA_NEED_OBERON_ECDH_SECP_R1_384 || PSA_NEED_OBERON_ECDH_SECP_R1_521 */ -#if defined(PSA_NEED_OBERON_ECDH_MONTGOMERY_255) || defined(PSA_NEED_OBERON_ECDH_MONTGOMERY_448) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_MONTGOMERY): - if (peer_key_length != key_length) return PSA_ERROR_INVALID_ARGUMENT; - switch (bits) { -#ifdef PSA_NEED_OBERON_ECDH_MONTGOMERY_255 - case 255: - ocrypto_curve25519_scalarmult(output, key, peer_key); - break; -#endif /* PSA_NEED_OBERON_ECDH_MONTGOMERY_255 */ -#ifdef PSA_NEED_OBERON_ECDH_MONTGOMERY_448 - case 448: - ocrypto_curve448_scalarmult(output, key, peer_key); - break; -#endif /* PSA_NEED_OBERON_ECDH_MONTGOMERY_448 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - break; -#endif /* PSA_NEED_OBERON_ECDH_MONTGOMERY_255 || PSA_NEED_OBERON_ECDH_MONTGOMERY_448 */ - default: - (void)key; - (void)key_length; - (void)peer_key; - (void)peer_key_length; - (void)output; - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_ecdh.h b/ext/oberon/psa/drivers/oberon_ecdh.h deleted file mode 100644 index 0cf19f2a9bd1..000000000000 --- a/ext/oberon/psa/drivers/oberon_ecdh.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_ECDH_H -#define OBERON_ECDH_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_ecdh( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *peer_key, size_t peer_key_length, - uint8_t *output, size_t output_size, size_t *output_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_ecdsa.c b/ext/oberon/psa/drivers/oberon_ecdsa.c deleted file mode 100644 index 55dc36a035cc..000000000000 --- a/ext/oberon/psa/drivers/oberon_ecdsa.c +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_ecdsa.h" -#include "psa_crypto_driver_wrappers.h" - -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_224 -#include "ocrypto_ecdsa_p224.h" -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_256 -#include "ocrypto_ecdsa_p256.h" -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_384 -#include "ocrypto_ecdsa_p384.h" -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_521 -#include "ocrypto_ecdsa_p521.h" -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_521 */ -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 -#include "ocrypto_ed25519.h" -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 */ -#ifdef PSA_NEED_OBERON_ED25519PH -#include "ocrypto_ed25519ph.h" -#endif /* PSA_NEED_OBERON_ED25519PH */ -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 -#include "ocrypto_ed448.h" -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 */ -#ifdef PSA_NEED_OBERON_ED448PH -#include "ocrypto_ed448ph.h" -#endif /* PSA_NEED_OBERON_ED448PH */ - - -#ifdef PSA_NEED_OBERON_ECDSA_SIGN -static int ecdsa_sign_hash( - const uint8_t *key, size_t key_length, - const uint8_t *hash, - const uint8_t *ek, - uint8_t *signature) -{ - int res; - - switch (key_length) { -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_224 - case PSA_BITS_TO_BYTES(224): - res = ocrypto_ecdsa_p224_sign_hash(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_256 - case PSA_BITS_TO_BYTES(256): - res = ocrypto_ecdsa_p256_sign_hash(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_384 - case PSA_BITS_TO_BYTES(384): - res = ocrypto_ecdsa_p384_sign_hash(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_521 - case PSA_BITS_TO_BYTES(521): - res = ocrypto_ecdsa_p521_sign_hash(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_521 */ - default: - (void)key; - (void)hash; - (void)ek; - (void)signature; - res = 1; - } - - return res; -} -#endif /* PSA_NEED_OBERON_ECDSA_SIGN */ - -#ifdef PSA_NEED_OBERON_ECDSA_DETERMINISTIC -/* hmac = HMAC_key(v || tag || sk || ext_hash) */ -static psa_status_t deterministic_ecdsa_hmac( - psa_algorithm_t hmac_alg, - const psa_key_attributes_t *attr, - const uint8_t *key, const uint8_t *v, size_t hash_len, - uint8_t tag, - const uint8_t *sk, const uint8_t *hash, size_t key_len, - uint8_t *hmac) -{ - psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; - psa_status_t status; - size_t length; - - status = psa_driver_wrapper_mac_sign_setup( - &operation, - attr, key, hash_len, - hmac_alg); - if (status) goto exit; - - status = psa_driver_wrapper_mac_update(&operation, v, hash_len); - if (status) goto exit; - - if (tag != 0xFF) { - status = psa_driver_wrapper_mac_update(&operation, &tag, 1); - if (status) goto exit; - } - - if (sk) { - status = psa_driver_wrapper_mac_update(&operation, sk, key_len); - if (status) goto exit; - } - - if (hash) { - status = psa_driver_wrapper_mac_update(&operation, hash, key_len); - if (status) goto exit; - } - - return psa_driver_wrapper_mac_sign_finish(&operation, hmac, hash_len, &length); - -exit: - psa_driver_wrapper_mac_abort(&operation); - return status; -} - -static psa_status_t deterministic_ecdsa_sign_hash( - psa_algorithm_t hash_alg, - const uint8_t *hash, // size: key_length - const uint8_t *key, size_t key_length, - uint8_t *ek, // size: key_length - uint8_t *signature) -{ - size_t hash_length = PSA_HASH_LENGTH(hash_alg); - uint8_t K[PSA_HASH_MAX_SIZE]; - uint8_t V[PSA_HASH_MAX_SIZE]; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - psa_algorithm_t hmac_alg = PSA_ALG_HMAC(hash_alg); - psa_status_t status; - size_t len; - int res; - - if (hash_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - - // calculate deterministic session key - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_HASH); - psa_set_key_algorithm(&attr, hmac_alg); - psa_set_key_type(&attr, PSA_KEY_TYPE_HMAC); - psa_set_key_bits(&attr, PSA_BYTES_TO_BITS(hash_length)); - - memset(V, 0x01, hash_length); // set all V bytes to 0x01 // b - memset(K, 0x00, hash_length); // set all K bytes to 0x00 // c - - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0x00, key, hash, key_length, K); // d - if (status) return status; - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0xFF, NULL, NULL, 0, V); // e - if (status) return status; - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0x01, key, hash, key_length, K); // f - if (status) return status; - - while (1) { - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0xFF, NULL, NULL, 0, V); // g, h3 - if (status) return status; - for (len = 0; len < key_length; len += hash_length) { - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0xFF, NULL, NULL, 0, V); // h2 - if (status) return status; - memcpy(ek + len, V, key_length - len < hash_length ? key_length - len : hash_length); // T = T || V - } - - res = ecdsa_sign_hash(key, key_length, hash, ek, signature); - if (res > 0) return PSA_ERROR_NOT_SUPPORTED; - if (res == 0) break; // 0 < T < prime - - // T out of range: retry - status = deterministic_ecdsa_hmac(hmac_alg, &attr, K, V, hash_length, 0x00, NULL, NULL, 0, K); // h3 - if (status) return status; - } - - return PSA_SUCCESS; -} -#endif /* PSA_NEED_OBERON_ECDSA_DETERMINISTIC */ - -psa_status_t oberon_ecdsa_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length) -{ - int res; - psa_status_t status; - uint8_t ek[PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)]; -#if defined(PSA_NEED_OBERON_ECDSA_RANDOMIZED) || defined(PSA_NEED_OBERON_ECDSA_DETERMINISTIC) - uint8_t ext_hash[PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)]; - size_t bits = psa_get_key_bits(attributes); -#endif - - switch (psa_get_key_type(attributes)) { -#if defined(PSA_NEED_OBERON_ECDSA_RANDOMIZED) || defined(PSA_NEED_OBERON_ECDSA_DETERMINISTIC) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (hash_length == 0 || key_length != PSA_BITS_TO_BYTES(bits)) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < key_length * 2) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = key_length * 2; - - if (hash_length < key_length) { - if (key_length > sizeof ext_hash) return PSA_ERROR_INSUFFICIENT_MEMORY; - // add most significant zero bits - memset(ext_hash, 0, key_length - hash_length); - memcpy(ext_hash + key_length - hash_length, hash, hash_length); - hash = ext_hash; - } - -#ifdef PSA_NEED_OBERON_ECDSA_RANDOMIZED - if (PSA_ALG_IS_RANDOMIZED_ECDSA(alg)) { - do { - status = psa_generate_random(ek, key_length); // ephemeral key - if (status != PSA_SUCCESS) return status; - res = ecdsa_sign_hash(key, key_length, hash, ek, signature); - if (res > 0) return PSA_ERROR_NOT_SUPPORTED; - } while (res != 0); - } else -#endif /* PSA_NEED_OBERON_ECDSA_RANDOMIZED */ -#ifdef PSA_NEED_OBERON_ECDSA_DETERMINISTIC - if (PSA_ALG_IS_DETERMINISTIC_ECDSA(alg)) { - psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg); - return deterministic_ecdsa_sign_hash(hash_alg, hash, key, key_length, ek, signature); - } else -#endif /* PSA_NEED_OBERON_ECDSA_DETERMINISTIC */ - { - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; - } - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_ECDSA_RANDOMIZED || PSA_NEED_OBERON_ECDSA_DETERMINISTIC */ - -#if defined(PSA_NEED_OBERON_ED25519PH) || defined(PSA_NEED_OBERON_ED448PH) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - switch (psa_get_key_bits(attributes)) { -#ifdef PSA_NEED_OBERON_ED25519PH - case 255: - if (hash_length != ocrypto_ed25519ph_HASH_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (key_length != ocrypto_ed25519ph_SECRET_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < ocrypto_ed25519ph_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = ocrypto_ed25519ph_BYTES; - ocrypto_ed25519ph_public_key(ek, key); // calculate public key - ocrypto_ed25519ph_sign(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ED25519PH */ -#ifdef PSA_NEED_OBERON_ED448PH - case 448: - if (hash_length != ocrypto_ed448ph_HASH_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (key_length != ocrypto_ed448ph_SECRET_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < ocrypto_ed448ph_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = ocrypto_ed448ph_BYTES; - ocrypto_ed448ph_public_key(ek, key); // calculate public key - ocrypto_ed448ph_sign(signature, hash, key, ek); - break; -#endif /* PSA_NEED_OBERON_ED448PH */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_ED25519PH || PSA_NEED_OBERON_ED448PH */ - - default: - (void)key; - (void)alg; - (void)signature; - (void)ek; - (void)status; - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_ecdsa_sign_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *signature, size_t signature_size, size_t *signature_length) -{ -#if defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448) - uint8_t pub_key[57]; -#elif defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255) - uint8_t pub_key[32]; -#endif - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#if defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255) || defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - // EDDSA is only available in sign_message - switch (psa_get_key_bits(attributes)) { -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 - case 255: - if (key_length != ocrypto_ed25519_SECRET_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < ocrypto_ed25519_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = ocrypto_ed25519_BYTES; - ocrypto_ed25519_public_key(pub_key, key); // calculate public key - ocrypto_ed25519_sign(signature, input, input_length, key, pub_key); - break; -#endif -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 - case 448: - if (key_length != ocrypto_ed448_SECRET_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < ocrypto_ed448_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = ocrypto_ed448_BYTES; - ocrypto_ed448_public_key(pub_key, key); // calculate public key - ocrypto_ed448_sign(signature, input, input_length, key, pub_key); - break; -#endif - default: - return PSA_ERROR_NOT_SUPPORTED; - } - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 || PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 */ - default: - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)signature; - (void)signature_size; - (void)signature_length; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_ecdsa_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length) -{ - int res; - uint8_t key_buf[2 * PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)]; -#if defined(PSA_NEED_OBERON_ECDSA_RANDOMIZED) || defined(PSA_NEED_OBERON_ECDSA_DETERMINISTIC) - uint8_t ext_hash[PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)]; - const uint8_t *pub_key; - size_t bits = psa_get_key_bits(attributes); - size_t length = PSA_BITS_TO_BYTES(bits); -#endif - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#if defined(PSA_NEED_OBERON_ECDSA_RANDOMIZED) || defined(PSA_NEED_OBERON_ECDSA_DETERMINISTIC) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1): - if (hash_length == 0) return PSA_ERROR_INVALID_ARGUMENT; - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - if (key_length != length) return PSA_ERROR_INVALID_ARGUMENT; - pub_key = key_buf; - } else { - if (key_length != length * 2 + 1 || key[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - pub_key = &key[1]; - } - - if (hash_length < length) { - if (length > sizeof ext_hash) return PSA_ERROR_INSUFFICIENT_MEMORY; - memset(ext_hash, 0, length - hash_length); - memcpy(ext_hash + length - hash_length, hash, hash_length); - hash = ext_hash; - } - - if (PSA_ALG_IS_ECDSA(alg)) { - if (signature_length != 2 * length) return PSA_ERROR_INVALID_SIGNATURE; - switch (length) { -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_224 - case PSA_BITS_TO_BYTES(224): - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - ocrypto_ecdsa_p224_public_key(key_buf, key); - } - res = ocrypto_ecdsa_p224_verify_hash(signature, hash, pub_key); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_224 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_256 - case PSA_BITS_TO_BYTES(256): - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - ocrypto_ecdsa_p256_public_key(key_buf, key); - } - res = ocrypto_ecdsa_p256_verify_hash(signature, hash, pub_key); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_256 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_384 - case PSA_BITS_TO_BYTES(384): - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - ocrypto_ecdsa_p384_public_key(key_buf, key); - } - res = ocrypto_ecdsa_p384_verify_hash(signature, hash, pub_key); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_384 */ -#ifdef PSA_NEED_OBERON_ECDSA_SECP_R1_521 - case PSA_BITS_TO_BYTES(521): - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - ocrypto_ecdsa_p521_public_key(key_buf, key); - } - res = ocrypto_ecdsa_p521_verify_hash(signature, hash, pub_key); - break; -#endif /* PSA_NEED_OBERON_ECDSA_SECP_R1_521 */ - default: - (void)signature; - return PSA_ERROR_NOT_SUPPORTED; - } - } else { - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; - } - if (res != 0) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_ECDSA_RANDOMIZED || PSA_NEED_OBERON_ECDSA_DETERMINISTIC */ - -#if defined(PSA_NEED_OBERON_ED25519PH) || defined(PSA_NEED_OBERON_ED448PH) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS): - switch (psa_get_key_bits(attributes)) { -#ifdef PSA_NEED_OBERON_ED25519PH - case 255: - if (key_length != ocrypto_ed25519ph_PUBLIC_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (hash_length != ocrypto_ed25519ph_HASH_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_length != ocrypto_ed25519ph_BYTES) return PSA_ERROR_INVALID_SIGNATURE; - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)) { - ocrypto_ed25519ph_public_key(key_buf, key); - key = key_buf; - } - res = ocrypto_ed25519ph_verify(signature, hash, key); - break; -#endif /* PSA_NEED_OBERON_ED25519PH */ -#ifdef PSA_NEED_OBERON_ED448PH - case 448: - if (key_length != ocrypto_ed448ph_PUBLIC_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (hash_length != ocrypto_ed448ph_HASH_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_length != ocrypto_ed448ph_BYTES) return PSA_ERROR_INVALID_SIGNATURE; - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)) { - ocrypto_ed448ph_public_key(key_buf, key); - key = key_buf; - } - res = ocrypto_ed448ph_verify(signature, hash, key); - break; -#endif /* PSA_NEED_OBERON_ED448PH */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_ED25519PH || PSA_NEED_OBERON_ED448PH */ - - default: - (void)key; - (void)key_length; - (void)alg; - (void)hash; - (void)hash_length; - (void)signature; - (void)signature_length; - (void)res; - (void)key_buf; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_ecdsa_verify_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *signature, size_t signature_length) -{ - int res; -#if defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448) - uint8_t pub_key[57]; -#elif defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255) - uint8_t pub_key[32]; -#endif - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#if defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255) || defined(PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448) - case PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS): - case PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS): - // EDDSA is only available in verify_message - switch (psa_get_key_bits(attributes)) { -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 - case 255: - if (key_length != ocrypto_ed25519_PUBLIC_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_length != ocrypto_ed25519_BYTES) return PSA_ERROR_INVALID_SIGNATURE; - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)) { - ocrypto_ed25519_public_key(pub_key, key); - key = pub_key; - } - res = ocrypto_ed25519_verify(signature, input, input_length, key); - break; -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 */ -#ifdef PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 - case 448: - if (key_length != ocrypto_ed448_PUBLIC_KEY_BYTES) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_length != ocrypto_ed448_BYTES) return PSA_ERROR_INVALID_SIGNATURE; - if (type == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_TWISTED_EDWARDS)) { - ocrypto_ed448_public_key(pub_key, key); - key = pub_key; - } - res = ocrypto_ed448_verify(signature, input, input_length, key); - break; -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 */ - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_255 || PSA_NEED_OBERON_PURE_EDDSA_TWISTED_EDWARDS_448 */ - default: - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)signature; - (void)signature_length; - (void)res; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_ecdsa.h b/ext/oberon/psa/drivers/oberon_ecdsa.h deleted file mode 100644 index 59884baab957..000000000000 --- a/ext/oberon/psa/drivers/oberon_ecdsa.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_ECDSA_H -#define OBERON_ECDSA_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_ecdsa_sign_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -psa_status_t oberon_ecdsa_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - -psa_status_t oberon_ecdsa_verify_message( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *signature, size_t signature_length); - -psa_status_t oberon_ecdsa_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_hash.c b/ext/oberon/psa/drivers/oberon_hash.c deleted file mode 100644 index e5b1eb9a1abe..000000000000 --- a/ext/oberon/psa/drivers/oberon_hash.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_hash.h" - -#ifdef PSA_NEED_OBERON_SHA_1 -#include "ocrypto_sha1.h" -#endif -#ifdef PSA_NEED_OBERON_SHA_224 -#include "ocrypto_sha224.h" -#endif -#ifdef PSA_NEED_OBERON_SHA_256 -#include "ocrypto_sha256.h" -#endif -#ifdef PSA_NEED_OBERON_SHA_384 -#include "ocrypto_sha384.h" -#endif -#ifdef PSA_NEED_OBERON_SHA_512 -#include "ocrypto_sha512.h" -#endif -#ifdef PSA_NEED_OBERON_SHA3 -#include "ocrypto_sha3.h" -#endif -#ifdef PSA_NEED_OBERON_SHAKE -#include "ocrypto_shake.h" -#endif - - -psa_status_t oberon_hash_setup( - oberon_hash_operation_t *operation, - psa_algorithm_t alg) -{ - switch (alg) { -#ifdef PSA_NEED_OBERON_SHA_1 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha1_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA_1: - ocrypto_sha1_init((ocrypto_sha1_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_224 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha224_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA_224: - ocrypto_sha224_init((ocrypto_sha224_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_256 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha256_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA_256: - ocrypto_sha256_init((ocrypto_sha256_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_384 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha384_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA_384: - ocrypto_sha384_init((ocrypto_sha384_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_512 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha512_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA_512: - ocrypto_sha512_init((ocrypto_sha512_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3 - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_sha3_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHA3_224: - case PSA_ALG_SHA3_256: - case PSA_ALG_SHA3_384: - case PSA_ALG_SHA3_512: - ocrypto_sha3_init((ocrypto_sha3_ctx*)operation->ctx); - break; -#endif -#ifdef PSA_NEED_OBERON_SHAKE - _Static_assert(sizeof operation->ctx >= sizeof(ocrypto_shake_ctx), "oberon_hash_operation_t.ctx too small"); - case PSA_ALG_SHAKE256_512: - ocrypto_shake_init((ocrypto_shake_ctx*)operation->ctx); - break; -#endif - default: - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->alg = alg; - return PSA_SUCCESS; -} - -psa_status_t oberon_hash_clone( - const oberon_hash_operation_t *source_operation, - oberon_hash_operation_t *target_operation) -{ - memcpy(target_operation, source_operation, sizeof *target_operation); - return PSA_SUCCESS; -} - -psa_status_t oberon_hash_update( - oberon_hash_operation_t *operation, - const uint8_t *input, size_t input_length) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_SHA_1 - case PSA_ALG_SHA_1: - ocrypto_sha1_update((ocrypto_sha1_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_224 - case PSA_ALG_SHA_224: - ocrypto_sha224_update((ocrypto_sha224_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_256 - case PSA_ALG_SHA_256: - ocrypto_sha256_update((ocrypto_sha256_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_384 - case PSA_ALG_SHA_384: - ocrypto_sha384_update((ocrypto_sha384_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_512 - case PSA_ALG_SHA_512: - ocrypto_sha512_update((ocrypto_sha512_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_224 - case PSA_ALG_SHA3_224: - ocrypto_sha3_224_update((ocrypto_sha3_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_256 - case PSA_ALG_SHA3_256: - ocrypto_sha3_256_update((ocrypto_sha3_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_384 - case PSA_ALG_SHA3_384: - ocrypto_sha3_384_update((ocrypto_sha3_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_512 - case PSA_ALG_SHA3_512: - ocrypto_sha3_512_update((ocrypto_sha3_ctx*)operation->ctx, input, input_length); - break; -#endif -#ifdef PSA_NEED_OBERON_SHAKE256_512 - case PSA_ALG_SHAKE256_512: - ocrypto_shake256_update((ocrypto_shake_ctx*)operation->ctx, input, input_length); - break; -#endif - default: - (void)input; - (void)input_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_hash_finish( - oberon_hash_operation_t *operation, - uint8_t *hash, size_t hash_size, size_t *hash_length) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_SHA_1 - case PSA_ALG_SHA_1: - if (hash_size < ocrypto_sha1_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha1_final((ocrypto_sha1_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha1_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_224 - case PSA_ALG_SHA_224: - if (hash_size < ocrypto_sha224_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha224_final((ocrypto_sha224_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha224_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_256 - case PSA_ALG_SHA_256: - if (hash_size < ocrypto_sha256_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha256_final((ocrypto_sha256_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha256_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_384 - case PSA_ALG_SHA_384: - if (hash_size < ocrypto_sha384_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha384_final((ocrypto_sha384_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha384_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_512 - case PSA_ALG_SHA_512: - if (hash_size < ocrypto_sha512_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha512_final((ocrypto_sha512_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha512_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_224 - case PSA_ALG_SHA3_224: - if (hash_size < ocrypto_sha3_224_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_224_final((ocrypto_sha3_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha3_224_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_256 - case PSA_ALG_SHA3_256: - if (hash_size < ocrypto_sha3_256_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_256_final((ocrypto_sha3_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha3_256_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_384 - case PSA_ALG_SHA3_384: - if (hash_size < ocrypto_sha3_384_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_384_final((ocrypto_sha3_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha3_384_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_512 - case PSA_ALG_SHA3_512: - if (hash_size < ocrypto_sha3_512_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_512_final((ocrypto_sha3_ctx*)operation->ctx, hash); - *hash_length = ocrypto_sha3_512_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHAKE256_512 - case PSA_ALG_SHAKE256_512: - if (hash_size < PSA_BITS_TO_BYTES(512)) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_shake256_final((ocrypto_shake_ctx*)operation->ctx, hash, PSA_BITS_TO_BYTES(512)); - *hash_length = PSA_BITS_TO_BYTES(512); - break; -#endif - default: - (void)hash; - (void)hash_size; - (void)hash_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - -psa_status_t oberon_hash_abort( - oberon_hash_operation_t *operation) -{ - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - - -psa_status_t oberon_hash_compute( - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *hash, size_t hash_size, size_t *hash_length) -{ - switch (alg) { -#ifdef PSA_NEED_OBERON_SHA_1 - case PSA_ALG_SHA_1: - if (hash_size < ocrypto_sha1_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha1(hash, input, input_length); - *hash_length = ocrypto_sha1_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_224 - case PSA_ALG_SHA_224: - if (hash_size < ocrypto_sha224_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha224(hash, input, input_length); - *hash_length = ocrypto_sha224_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_256 - case PSA_ALG_SHA_256: - if (hash_size < ocrypto_sha256_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha256(hash, input, input_length); - *hash_length = ocrypto_sha256_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_384 - case PSA_ALG_SHA_384: - if (hash_size < ocrypto_sha384_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha384(hash, input, input_length); - *hash_length = ocrypto_sha384_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA_512 - case PSA_ALG_SHA_512: - if (hash_size < ocrypto_sha512_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha512(hash, input, input_length); - *hash_length = ocrypto_sha512_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_224 - case PSA_ALG_SHA3_224: - if (hash_size < ocrypto_sha3_224_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_224(hash, input, input_length); - *hash_length = ocrypto_sha3_224_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_256 - case PSA_ALG_SHA3_256: - if (hash_size < ocrypto_sha3_256_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_256(hash, input, input_length); - *hash_length = ocrypto_sha3_256_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_384 - case PSA_ALG_SHA3_384: - if (hash_size < ocrypto_sha3_384_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_384(hash, input, input_length); - *hash_length = ocrypto_sha3_384_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHA3_512 - case PSA_ALG_SHA3_512: - if (hash_size < ocrypto_sha3_512_BYTES) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_sha3_512(hash, input, input_length); - *hash_length = ocrypto_sha3_512_BYTES; - break; -#endif -#ifdef PSA_NEED_OBERON_SHAKE256_512 - case PSA_ALG_SHAKE256_512: - if (hash_size < PSA_BITS_TO_BYTES(512)) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_shake256(hash, PSA_BITS_TO_BYTES(512), input, input_length); - *hash_length = PSA_BITS_TO_BYTES(512); - break; -#endif - default: - (void)input; - (void)input_length; - (void)hash; - (void)hash_size; - (void)hash_length; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_hash.h b/ext/oberon/psa/drivers/oberon_hash.h deleted file mode 100644 index a618a258a36f..000000000000 --- a/ext/oberon/psa/drivers/oberon_hash.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_HASH_H -#define OBERON_HASH_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - uint64_t ctx[52]; - psa_algorithm_t alg; -} oberon_hash_operation_t; - - -psa_status_t oberon_hash_setup( - oberon_hash_operation_t *operation, - psa_algorithm_t alg); - -psa_status_t oberon_hash_clone( - const oberon_hash_operation_t *source_operation, - oberon_hash_operation_t *target_operation); - -psa_status_t oberon_hash_update( - oberon_hash_operation_t *operation, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_hash_finish( - oberon_hash_operation_t *operation, - uint8_t *hash, size_t hash_size, size_t *hash_length); - -psa_status_t oberon_hash_abort( - oberon_hash_operation_t *operation); - - -psa_status_t oberon_hash_compute( - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *hash, size_t hash_size, size_t *hash_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_helpers.c b/ext/oberon/psa/drivers/oberon_helpers.c deleted file mode 100644 index 601a1b4f71f7..000000000000 --- a/ext/oberon/psa/drivers/oberon_helpers.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - - -#include "oberon_helpers.h" - - -int oberon_ct_compare(const void *x, const void *y, size_t length) -{ - const uint8_t *px = (const uint8_t*)x; - const uint8_t *py = (const uint8_t*)y; - int diff = 0; - do { - diff |= (int)(*px++ ^ *py++); - } while (--length); - return diff; -} - -int oberon_ct_compare_zero(const void *x, size_t length) -{ - const uint8_t *px = (const uint8_t*)x; - int diff = 0; - do { - diff |= (int)(*px++); - } while (--length); - return diff; -} - -void oberon_xor(void *r, const void *x, const void *y, size_t length) -{ - const uint8_t *px = (const uint8_t*)x; - const uint8_t *py = (const uint8_t*)y; - uint8_t *pr = (uint8_t*)r; - do { - *pr++ = (uint8_t)(*px++ ^ *py++); - } while (--length); -} diff --git a/ext/oberon/psa/drivers/oberon_helpers.h b/ext/oberon/psa/drivers/oberon_helpers.h deleted file mode 100644 index 874999b95139..000000000000 --- a/ext/oberon/psa/drivers/oberon_helpers.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - -#ifndef OBERON_HELPERS_H -#define OBERON_HELPERS_H - -#include "psa/crypto.h" - -/** - * Variable length constant time comparison. - * - * @param x Memory region to compare with @p y. - * @param y Memory region to compare with @p x. - * @param length Number of bytes to compare, @p length > 0. - * - * @returns Zero if @p x and @p y are equal, non-zero otherwise. - */ -int oberon_ct_compare(const void *x, const void *y, size_t length); - -/** - * Variable length constant time compare to zero. - * - * @param x Memory region that will be compared. - * @param length Number of bytes to compare, @p length > 0. - * - * @returns Zero if @p x is all zeroes, non-zero otherwise. - */ -int oberon_ct_compare_zero(const void *x, size_t length); - -/** - * Variable length bitwise xor. - * - * @param[out] r Memory region to store the result. - * @param x Memory region containing the first argument. - * @param y Memory region containing the second argument. - * @param length Number of bytes in both arguments, @p length > 0. - * - * @remark @p r may be same as @p x or @p y. - */ -void oberon_xor(void *r, const void *x, const void *y, size_t length); - - -/**@name Synchronization primitives for randomness drivers. -* -* This group of functions is used to protect the global state of the -* randomness drivers from being accessed simultaneously by multiple threads. -*/ -/**@{*/ -/** -* Define this preprocessor symbol if synchronization is necessary. -*/ -//#define OBERON_USE_MUTEX - -/** -* The mutex state type. -*/ -//struct oberon_mutex_type; - -/** -* Mutex initialization. -* -* The mutex state @p mutex is initialized by this function. -* -* @param[out] mutex Mutex state. -*/ -//void oberon_mutex_init(struct oberon_mutex_type *mutex); - -/** -* Mutex lock. -* -* The mutex state @p mutex is locked by this function. -* -* @param mutex Mutex state. -* @returns Zero if the function succeeds, non-zero otherwise. -*/ -//int oberon_mutex_lock(struct oberon_mutex_type *mutex); - -/** -* Mutex unlock. -* -* The mutex state @p mutex is unlocked by this function. -* -* @param mutex Mutex state. -* @returns Zero if the function succeeds, non-zero otherwise. -*/ -//int oberon_mutex_unlock(struct oberon_mutex_type *mutex); - -/** -* Mutex unlock. -* -* The mutex state @p mutex is freed by this function. -* -* @param mutex Mutex state. -*/ -//void oberon_mutex_free(struct oberon_mutex_type *mutex); -/**@}*/ - - -#ifdef MBEDTLS_THREADING_C - -#include "mbedtls/threading.h" - -#define OBERON_USE_MUTEX 1 -#define oberon_mutex_type mbedtls_threading_mutex_t -#define oberon_mutex_init(mutex) mbedtls_mutex_init(mutex) -#define oberon_mutex_lock(mutex) mbedtls_mutex_lock(mutex) -#define oberon_mutex_unlock(mutex) mbedtls_mutex_unlock(mutex) -#define oberon_mutex_free(mutex) mbedtls_mutex_free(mutex) - -#endif /* MBEDTLS_THREADING_C */ - - -/** - * Generate random bytes. - * - * @param[out] output Output buffer for the generated data. - * @param size Number of bytes to generate and output. - * - * @retval #PSA_SUCCESS - * @retval #PSA_ERROR_NOT_SUPPORTED - * @retval #PSA_ERROR_INSUFFICIENT_ENTROPY - * @retval #PSA_ERROR_INSUFFICIENT_MEMORY - * @retval #PSA_ERROR_COMMUNICATION_FAILURE - * @retval #PSA_ERROR_HARDWARE_FAILURE - * @retval #PSA_ERROR_CORRUPTION_DETECTED - * @retval #PSA_ERROR_BAD_STATE - */ -//psa_status_t oberon_generate_random(uint8_t *output, size_t size); -#define oberon_generate_random(output, size) psa_generate_random(output, size) - - -#endif diff --git a/ext/oberon/psa/drivers/oberon_hmac_drbg.c b/ext/oberon/psa/drivers/oberon_hmac_drbg.c deleted file mode 100644 index 3ace60ecefc4..000000000000 --- a/ext/oberon/psa/drivers/oberon_hmac_drbg.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_hmac_drbg.h" -#include "psa_crypto_driver_wrappers.h" - - -/* HMAC-DRBG implementation based on NIST.SP.800-90Ar1 */ - - -#define ENTROPY_FACTOR 4 // fraction of entropy in entropy data -#define RESEED_INTERVAL 10000 - -#define KEY_LEN PSA_HASH_LENGTH(OBERON_HMAC_DRBG_HASH_ALG) -#define BLOCK_LEN PSA_HASH_LENGTH(OBERON_HMAC_DRBG_HASH_ALG) -#define MAX_ENTROPY_BITS (PSA_BYTES_TO_BITS(BLOCK_LEN) * 3 / 2) -#define MAX_ENTROPY_DATA ((PSA_BITS_TO_BYTES(MAX_ENTROPY_BITS) * ENTROPY_FACTOR + BLOCK_LEN - 1) / BLOCK_LEN * BLOCK_LEN) -#define MAX_BITS_PER_REQUEST (1 << 19) // NIST.SP.800-90Ar1:Table 2 - - -// output = HMAC(k, v || tag || data) -static psa_status_t hmac_drbg_hmac( - oberon_hmac_drbg_context_t *context, - uint8_t tag, // 0xFF = no tag - const uint8_t *data, size_t data_length, // may be NULL - uint8_t output[BLOCK_LEN]) -{ - psa_status_t status; - size_t len; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - psa_set_key_type(&attr, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attr, PSA_BYTES_TO_BITS(KEY_LEN)); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_MESSAGE); - - status = psa_driver_wrapper_mac_sign_setup( - &context->hmac_op, - &attr, context->k, BLOCK_LEN, - PSA_ALG_HMAC(OBERON_HMAC_DRBG_HASH_ALG)); - if (status) goto exit; - - status = psa_driver_wrapper_mac_update(&context->hmac_op, context->v, BLOCK_LEN); - if (status) goto exit; - - if (tag != 0xFF) { - status = psa_driver_wrapper_mac_update(&context->hmac_op, &tag, 1); - if (status) goto exit; - } - - if (data) { - status = psa_driver_wrapper_mac_update(&context->hmac_op, data, data_length); - if (status) goto exit; - } - - status = psa_driver_wrapper_mac_sign_finish(&context->hmac_op, output, BLOCK_LEN, &len); - -exit: - psa_driver_wrapper_mac_abort(&context->hmac_op); - return status; -} - -// update the generator state -static psa_status_t hmac_drbg_update( - oberon_hmac_drbg_context_t *context, - const uint8_t *data, size_t data_length) // may be NULL -{ - psa_status_t status; - - status = hmac_drbg_hmac(context, 0x00, data, data_length, context->k); - if (status) return status; - - status = hmac_drbg_hmac(context, 0xFF, NULL, 0, context->v); - if (status) return status; - - if (data) { - status = hmac_drbg_hmac(context, 0x01, data, data_length, context->k); - if (status) return status; - - status = hmac_drbg_hmac(context, 0xFF, NULL, 0, context->v); - if (status) return status; - } - - return PSA_SUCCESS; -} - -// update the generator state with new entropy -static psa_status_t hmac_drbg_entropy_update( - oberon_hmac_drbg_context_t *context, - size_t entropy_bits) -{ - psa_status_t status; - uint8_t seed[MAX_ENTROPY_DATA]; - size_t estimate_bits, total_bits, seed_length; - - // get entropy - total_bits = 0; - seed_length = 0; - do { - status = psa_driver_wrapper_get_entropy(0, &estimate_bits, seed + seed_length, BLOCK_LEN); - if (status) return status; - total_bits += estimate_bits; - seed_length += BLOCK_LEN; - if (seed_length >= sizeof seed) return PSA_ERROR_INSUFFICIENT_ENTROPY; - } while (total_bits < entropy_bits); - - // update state - return hmac_drbg_update(context, seed, seed_length); -} - -// instantiate the generator state -psa_status_t oberon_hmac_drbg_init( - oberon_hmac_drbg_context_t *context) -{ - psa_status_t status; - -#ifdef OBERON_USE_MUTEX - oberon_mutex_init(&context->mutex); -#endif - - // initialize generator state with k = 0 and v = 0 - memset(context->k, 0, sizeof context->k); // 0x00 .. 0x00 - memset(context->v, 1, sizeof context->v); // 0x01 .. 0x01 - - // initial seeding - status = hmac_drbg_entropy_update(context, MAX_ENTROPY_BITS); - if (status) return status; - - context->reseed_counter = 1; - return PSA_SUCCESS; -} - -// generate random bytes -psa_status_t oberon_hmac_drbg_get_random( - oberon_hmac_drbg_context_t *context, - uint8_t *output, - size_t output_size) -{ - psa_status_t status; - -#ifdef OBERON_USE_MUTEX - if (oberon_mutex_lock(&context->mutex)) { - return PSA_ERROR_GENERIC_ERROR; - } -#endif - - if (context->reseed_counter == 0) return PSA_ERROR_BAD_STATE; - if (output_size > PSA_BITS_TO_BYTES(MAX_BITS_PER_REQUEST)) return PSA_ERROR_INVALID_ARGUMENT; - - // reseed generator if necessary - if (context->reseed_counter > RESEED_INTERVAL) { - status = hmac_drbg_entropy_update(context, PSA_BYTES_TO_BITS(KEY_LEN)); - if (status) return status; - context->reseed_counter = 1; - } - - // generate output - for (;;) { - // generate a MAC block - status = hmac_drbg_hmac(context, 0xFF, NULL, 0, context->v); - if (status) return status; - if (output_size <= BLOCK_LEN) { - memcpy(output, context->v, output_size); - break; - } - memcpy(output, context->v, BLOCK_LEN); - output += BLOCK_LEN; - output_size -= BLOCK_LEN; - } - - // update generator state for backtracking resistance - status = hmac_drbg_update(context, NULL, 0); - if (status) return status; - - context->reseed_counter++; - -#ifdef OBERON_USE_MUTEX - if (oberon_mutex_unlock(&context->mutex)) { - return PSA_ERROR_GENERIC_ERROR; - } -#endif - - return PSA_SUCCESS; -} - -// cleanup the generator state -psa_status_t oberon_hmac_drbg_free( - oberon_hmac_drbg_context_t *context) -{ - psa_driver_wrapper_mac_abort(&context->hmac_op); -#ifdef OBERON_USE_MUTEX - oberon_mutex_free(&context->mutex); -#endif - memset(context, 0, sizeof *context); - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_hmac_drbg.h b/ext/oberon/psa/drivers/oberon_hmac_drbg.h deleted file mode 100644 index 72068dcd56ff..000000000000 --- a/ext/oberon/psa/drivers/oberon_hmac_drbg.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_HMAC_DRBG_H -#define OBERON_HMAC_DRBG_H - -#include -#include "oberon_helpers.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if !defined(OBERON_HMAC_DRBG_HASH_ALG) -#define OBERON_HMAC_DRBG_HASH_ALG PSA_ALG_SHA_256 -#endif - - -typedef struct { - psa_mac_operation_t hmac_op; - uint8_t k[PSA_HASH_LENGTH(OBERON_HMAC_DRBG_HASH_ALG)]; - uint8_t v[PSA_HASH_LENGTH(OBERON_HMAC_DRBG_HASH_ALG)]; - uint32_t reseed_counter; -#ifdef OBERON_USE_MUTEX - oberon_mutex_type mutex; -#endif -} oberon_hmac_drbg_context_t; - - -psa_status_t oberon_hmac_drbg_init( - oberon_hmac_drbg_context_t *context); - -psa_status_t oberon_hmac_drbg_get_random( - oberon_hmac_drbg_context_t *context, - uint8_t *output, - size_t output_size); - -psa_status_t oberon_hmac_drbg_free( - oberon_hmac_drbg_context_t *context); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_jpake.c b/ext/oberon/psa/drivers/oberon_jpake.c deleted file mode 100644 index 84ec46f333d0..000000000000 --- a/ext/oberon/psa/drivers/oberon_jpake.c +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_jpake.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - -#include "ocrypto_ecjpake_p256.h" - -#define P256_KEY_SIZE 32 -#define P256_POINT_SIZE 64 - - -// P256 generator in big-endian for hash calculation -static const uint8_t base[P256_POINT_SIZE] = { - 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, 0x63, 0xA4, 0x40, 0xF2, - 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96, - 0x4F, 0xE3, 0x42, 0xE2, 0xFE, 0x1A, 0x7F, 0x9B, 0x8E, 0xE7, 0xEB, 0x4A, 0x7C, 0x0F, 0x9E, 0x16, - 0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31, 0x5E, 0xCE, 0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51, 0xF5}; - - -static psa_status_t oberon_update_hash_with_prefix( - psa_hash_operation_t *hash_op, - const uint8_t *data, size_t data_len, - uint8_t type) -{ - psa_status_t status; - uint8_t prefix[5]; - size_t hash_len = data_len; - size_t prefix_len = 4; - - if (type) { - prefix[4] = type; // add point type - hash_len++; - prefix_len++; - } - prefix[0] = 0; - prefix[1] = 0; - prefix[2] = (uint8_t)(hash_len >> 8); - prefix[3] = (uint8_t)hash_len; - status = psa_driver_wrapper_hash_update(hash_op, prefix, prefix_len); - if (status != PSA_SUCCESS) return status; - return psa_driver_wrapper_hash_update(hash_op, data, data_len); -} - -static psa_status_t oberon_get_zkp_hash( - psa_algorithm_t hash_alg, - const uint8_t X[P256_POINT_SIZE], - const uint8_t V[P256_POINT_SIZE], - const uint8_t G[P256_POINT_SIZE], - const uint8_t *id, size_t id_len, - uint8_t *hash, size_t hash_size, size_t *hash_length) -{ - psa_status_t status; - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - status = psa_driver_wrapper_hash_setup(&hash_op, hash_alg); - if (status != PSA_SUCCESS) goto exit; - status = oberon_update_hash_with_prefix(&hash_op, G ? G : base, P256_POINT_SIZE, 0x04); - if (status != PSA_SUCCESS) goto exit; - status = oberon_update_hash_with_prefix(&hash_op, V, P256_POINT_SIZE, 0x04); - if (status != PSA_SUCCESS) goto exit; - status = oberon_update_hash_with_prefix(&hash_op, X, P256_POINT_SIZE, 0x04); - if (status != PSA_SUCCESS) goto exit; - status = oberon_update_hash_with_prefix(&hash_op, id, id_len, 0); - if (status != PSA_SUCCESS) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, hash, hash_size, hash_length); - if (status != PSA_SUCCESS) goto exit; - return PSA_SUCCESS; -exit: - psa_driver_wrapper_hash_abort(&hash_op); - return status; -} - -static psa_status_t oberon_write_key_share( - oberon_jpake_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res; - psa_status_t status; - uint8_t generator[P256_POINT_SIZE]; - uint8_t v[P256_KEY_SIZE]; // ZKP secret key - int idx = op->wr_idx; // key index - uint8_t *gen = NULL; - uint8_t h[PSA_HASH_MAX_SIZE]; - size_t h_len; - - if (idx == 2) { // second round - // generator - res = ocrypto_ecjpake_get_generator(generator, op->P[0], op->P[1], op->X[0]); - gen = generator; - // calculated secret key - res |= ocrypto_ecjpake_process_shared_secret(op->x[2], op->x[1], op->secret); - res |= ocrypto_ecjpake_get_public_key(op->X[2], gen, op->x[2]); - if (res) return PSA_ERROR_INVALID_ARGUMENT; // we do not have a valid generator - } else { // first round - // random secret key - do { - status = psa_generate_random(op->x[idx], sizeof op->x[idx]); - if (status != PSA_SUCCESS) return status; - } while (ocrypto_ecjpake_get_public_key(op->X[idx], NULL, op->x[idx])); - } - - // ZKP secret - do { - status = psa_generate_random(v, sizeof v); - if (status != PSA_SUCCESS) return status; - } while (ocrypto_ecjpake_get_public_key(op->V, gen, v)); - status = oberon_get_zkp_hash(op->hash_alg, op->X[idx], op->V, gen, op->user_id, op->user_id_length, h, sizeof h, &h_len); - if (status != PSA_SUCCESS) return status; - res = ocrypto_ecjpake_zkp_sign(op->r, op->x[idx], v, h, h_len); - if (res) return PSA_ERROR_INVALID_ARGUMENT; - - if (sizeof op->X[idx] >= output_size) return PSA_ERROR_BUFFER_TOO_SMALL; - output[0] = 0x04; - memcpy(&output[1], op->X[idx], sizeof op->X[idx]); - *output_length = sizeof op->X[idx] + 1; - - return PSA_SUCCESS; -} - -static psa_status_t oberon_write_zk_public( - oberon_jpake_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - if (sizeof op->V >= output_size) return PSA_ERROR_BUFFER_TOO_SMALL; - output[0] = 0x04; - memcpy(&output[1], op->V, sizeof op->V); - *output_length = sizeof op->V + 1; - - return PSA_SUCCESS; -} - -static psa_status_t oberon_write_zk_proof( - oberon_jpake_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - if (sizeof op->r > output_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(output, op->r, sizeof op->r); - *output_length = sizeof op->r; - - op->wr_idx++; - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_key_share( - oberon_jpake_operation_t *op, - const uint8_t *input, size_t input_length) -{ - int idx = op->rd_idx; // key index - - if (input_length != sizeof op->P[idx] + 1 || input[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - memcpy(op->P[idx], &input[1], sizeof op->P[idx]); - - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_zk_public( - oberon_jpake_operation_t *op, - const uint8_t *input, size_t input_length) -{ - if (input_length != sizeof op->V + 1 || input[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - memcpy(op->V, &input[1], sizeof op->V); - - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_zk_proof( - oberon_jpake_operation_t *op, - const uint8_t *input, size_t input_length) -{ - psa_status_t status; - int res = 0; - uint8_t generator[P256_POINT_SIZE]; - int idx = op->rd_idx; // key index - uint8_t *rp = op->r; - uint8_t *gen = NULL; - uint8_t h[PSA_HASH_MAX_SIZE]; - size_t h_len; - - if (input_length > sizeof op->r) return PSA_ERROR_INVALID_SIGNATURE; - if (input_length < sizeof op->r) { - memset(rp, 0, sizeof op->r - input_length); - rp += sizeof op->r - input_length; - } - memcpy(rp, input, input_length); - - if (idx == 2) { // second round - res |= ocrypto_ecjpake_get_generator(generator, op->X[0], op->X[1], op->P[0]); - gen = generator; - } - - status = oberon_get_zkp_hash(op->hash_alg, op->P[idx], op->V, gen, op->peer_id, op->peer_id_length, h, sizeof h, &h_len); - if (status != PSA_SUCCESS) return status; - res |= ocrypto_ecjpake_zkp_verify(gen, op->P[idx], op->V, op->r, h, h_len); - if (res) return PSA_ERROR_INVALID_SIGNATURE; - - op->rd_idx++; - return PSA_SUCCESS; -} - - -psa_status_t oberon_jpake_setup( - oberon_jpake_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite) -{ - (void)attributes; - - if (psa_pake_cs_get_primitive(cipher_suite) != - PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, PSA_ECC_FAMILY_SECP_R1, 256)) { - return PSA_ERROR_NOT_SUPPORTED; - } - operation->hash_alg = PSA_ALG_GET_HASH(psa_pake_cs_get_algorithm(cipher_suite)); - if (operation->hash_alg != PSA_ALG_SHA_256) return PSA_ERROR_NOT_SUPPORTED; - - operation->rd_idx = 0; - operation->wr_idx = 0; - - // store reduced password - ocrypto_ecjpake_read_shared_secret(operation->secret, password, password_length); - - if (oberon_ct_compare_zero(operation->secret, sizeof operation->secret) == 0) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_jpake_set_user( - oberon_jpake_operation_t *operation, - const uint8_t *user_id, size_t user_id_len) -{ - if (user_id_len > sizeof operation->user_id) return PSA_ERROR_NOT_SUPPORTED; - memcpy(operation->user_id, user_id, user_id_len); - operation->user_id_length = (uint8_t)user_id_len; - - return PSA_SUCCESS; -} - -psa_status_t oberon_jpake_set_peer( - oberon_jpake_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len) -{ - if (peer_id_len == operation->user_id_length) { - if (memcmp(peer_id, operation->user_id, peer_id_len) == 0) { - // user and peer ids must not be equal - return PSA_ERROR_INVALID_ARGUMENT; - } - } - - if (peer_id_len > sizeof operation->peer_id) return PSA_ERROR_NOT_SUPPORTED; - memcpy(operation->peer_id, peer_id, peer_id_len); - operation->peer_id_length = (uint8_t)peer_id_len; - - return PSA_SUCCESS; -} - -psa_status_t oberon_jpake_output( - oberon_jpake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length) -{ - switch (step) { - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_write_key_share( - operation, - output, output_size, output_length); - case PSA_PAKE_STEP_ZK_PUBLIC: - return oberon_write_zk_public( - operation, - output, output_size, output_length); - case PSA_PAKE_STEP_ZK_PROOF: - return oberon_write_zk_proof( - operation, - output, output_size, output_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_jpake_input( - oberon_jpake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length) -{ - switch (step) { - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_read_key_share( - operation, - input, input_length); - case PSA_PAKE_STEP_ZK_PUBLIC: - return oberon_read_zk_public( - operation, - input, input_length); - case PSA_PAKE_STEP_ZK_PROOF: - return oberon_read_zk_proof( - operation, - input, input_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_jpake_get_shared_key( - oberon_jpake_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res; - - if (output_size < 65) return PSA_ERROR_BUFFER_TOO_SMALL; - output[0] = 0x04; // curve point - - // get PMSK - res = ocrypto_ecjpake_get_premaster_secret_key(&output[1], - operation->P[2], operation->P[1], - operation->x[2], operation->x[1]); - if (res) return PSA_ERROR_INVALID_ARGUMENT; - - *output_length = 65; - return PSA_SUCCESS; -} - -psa_status_t oberon_jpake_abort( - oberon_jpake_operation_t *operation) -{ - (void)operation; - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_jpake.h b/ext/oberon/psa/drivers/oberon_jpake.h deleted file mode 100644 index 0274f545df87..000000000000 --- a/ext/oberon/psa/drivers/oberon_jpake.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_JPAKE_H -#define OBERON_JPAKE_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - psa_algorithm_t hash_alg; - uint8_t secret[32]; - uint8_t user_id[16]; - uint8_t peer_id[16]; - uint8_t user_id_length; - uint8_t peer_id_length; - uint8_t rd_idx; - uint8_t wr_idx; - uint8_t x[3][32]; // secret keys - uint8_t X[3][64]; // public keys - uint8_t P[3][64]; // peer keys - uint8_t V[64]; // ZKP public key - uint8_t r[32]; // ZKP signature -} oberon_jpake_operation_t; - - -psa_status_t oberon_jpake_setup( - oberon_jpake_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite); - -psa_status_t oberon_jpake_set_user( - oberon_jpake_operation_t *operation, - const uint8_t *user_id, size_t user_id_len); - -psa_status_t oberon_jpake_set_peer( - oberon_jpake_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len); - -psa_status_t oberon_jpake_output( - oberon_jpake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_jpake_input( - oberon_jpake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_jpake_get_shared_key( - oberon_jpake_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_jpake_abort( - oberon_jpake_operation_t *operation); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_key_agreement.c b/ext/oberon/psa/drivers/oberon_key_agreement.c deleted file mode 100644 index 848b26acbee4..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_agreement.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include "psa/crypto.h" -#include "oberon_key_agreement.h" - -#ifdef PSA_NEED_OBERON_ECDH -#include "oberon_ecdh.h" -#endif /* PSA_NEED_OBERON_ECDH */ - - -psa_status_t oberon_key_agreement( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *peer_key, size_t peer_key_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_ECDH - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_ecdh( - attributes, key, key_length, - alg, - peer_key, peer_key_length, - output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_ECDH */ - - { - (void)type; - (void)key; - (void)key_length; - (void)alg; - (void)peer_key; - (void)peer_key_length; - (void)output; - (void)output_size; - (void)output_length; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_key_agreement.h b/ext/oberon/psa/drivers/oberon_key_agreement.h deleted file mode 100644 index 47bfd3ab0995..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_agreement.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_KEY_AGREEMENT_H -#define OBERON_KEY_AGREEMENT_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_key_agreement( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *peer_key, size_t peer_key_length, - uint8_t *output, size_t output_size, size_t *output_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_key_derivation.c b/ext/oberon/psa/drivers/oberon_key_derivation.c deleted file mode 100644 index f22ea33b0176..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_derivation.c +++ /dev/null @@ -1,707 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_key_derivation.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) -static const uint8_t zero[PSA_HASH_MAX_SIZE] = { 0 }; -#endif - - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) || \ - defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) -static psa_status_t oberon_setup_mac( - oberon_key_derivation_operation_t *operation, - const uint8_t *key, size_t key_length) -{ - psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_set_key_type(&attributes, operation->key_type); - psa_set_key_bits(&attributes, PSA_BYTES_TO_BITS(key_length)); - psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_MESSAGE); - - memset(&operation->mac_op, 0, sizeof operation->mac_op); - return psa_driver_wrapper_mac_sign_setup( - &operation->mac_op, - &attributes, key, key_length, - operation->mac_alg); -} -#endif - -#if defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) || \ - defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) -static psa_status_t oberon_mac_update_num( - oberon_key_derivation_operation_t *operation, - uint32_t num) -{ - uint8_t idx[4]; - - idx[0] = (uint8_t)(num >> 24); - idx[1] = (uint8_t)(num >> 16); - idx[2] = (uint8_t)(num >> 8); - idx[3] = (uint8_t)(num); - return psa_driver_wrapper_mac_update(&operation->mac_op, idx, 4); -} -#endif - - -#ifdef PSA_NEED_OBERON_PBKDF2_HMAC -static psa_status_t oberon_hash_key( - oberon_key_derivation_operation_t *operation, - const uint8_t *data, size_t data_length) -{ - psa_status_t status; - size_t length; - - memset(&operation->hash_op, 0, sizeof operation->hash_op); - status = psa_driver_wrapper_hash_setup(&operation->hash_op, PSA_ALG_GET_HASH(operation->mac_alg)); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, data, data_length); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&operation->hash_op, operation->key, operation->block_length, &length); - -exit: - psa_driver_wrapper_hash_abort(&operation->hash_op); - return status; -} -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC */ - - -psa_status_t oberon_key_derivation_setup( - oberon_key_derivation_operation_t *operation, - psa_algorithm_t alg) -{ -#ifdef PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 - if (alg == PSA_ALG_PBKDF2_AES_CMAC_PRF_128) { - operation->block_length = PSA_BLOCK_CIPHER_BLOCK_LENGTH(PSA_KEY_TYPE_AES); - operation->mac_alg = PSA_ALG_CMAC; - operation->key_type = PSA_KEY_TYPE_AES; - operation->alg = OBERON_PBKDF2_CMAC_ALG; - } else -#endif /* PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ - -#ifdef PSA_NEED_OBERON_SP800_108_COUNTER_CMAC - if (alg == PSA_ALG_SP800_108_COUNTER_CMAC) { - operation->block_length = PSA_BLOCK_CIPHER_BLOCK_LENGTH(PSA_KEY_TYPE_AES); - operation->mac_alg = PSA_ALG_CMAC; - operation->key_type = PSA_KEY_TYPE_AES; - operation->alg = OBERON_SP800_108_COUNTER_ALG; - operation->info[0] = 0u; // separator - operation->info_length = 1; - operation->count = 0xFFFFFFF8; - } else -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_CMAC */ - -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - if (PSA_ALG_IS_SRP_PASSWORD_HASH(alg)) { - operation->alg = OBERON_SRP_PASSWORD_HASH_ALG; - operation->mac_alg = PSA_ALG_HKDF_GET_HASH(alg); - } else -#endif /* PSA_NEED_OBERON_SRP_PASSWORD_HASH */ - - { - // all olthers are HMAC based - psa_algorithm_t hash = PSA_ALG_HKDF_GET_HASH(alg); - unsigned hash_length = PSA_HASH_LENGTH(hash); - if (hash_length == 0) return PSA_ERROR_NOT_SUPPORTED; - operation->block_length = (uint8_t)hash_length; - operation->mac_alg = PSA_ALG_HMAC(hash); - operation->key_type = PSA_KEY_TYPE_HMAC; - -#ifdef PSA_NEED_OBERON_HKDF - if (PSA_ALG_IS_HKDF(alg)) { - operation->info_length = 0; - operation->alg = OBERON_HKDF_ALG; - } else -#endif /* PSA_NEED_OBERON_HKDF */ - -#ifdef PSA_NEED_OBERON_HKDF_EXTRACT - if (PSA_ALG_IS_HKDF_EXTRACT(alg)) { - operation->info_length = 0; - operation->alg = OBERON_HKDF_EXTRACT_ALG; - } else -#endif /* PSA_NEED_OBERON_HKDF_EXTRACT */ - -#ifdef PSA_NEED_OBERON_HKDF_EXPAND - if (PSA_ALG_IS_HKDF_EXPAND(alg)) { - psa_algorithm_t hash = PSA_ALG_HKDF_GET_HASH(alg); - unsigned hash_length = PSA_HASH_LENGTH(hash); - if (hash_length == 0) return PSA_ERROR_NOT_SUPPORTED; - operation->info_length = 0; - operation->alg = OBERON_HKDF_EXPAND_ALG; - } else -#endif /* PSA_NEED_OBERON_HKDF_EXPAND */ - -#ifdef PSA_NEED_OBERON_TLS12_PRF - if (PSA_ALG_IS_TLS12_PRF(alg)) { - operation->alg = OBERON_TLS12_PRF_ALG; - } else -#endif /* PSA_NEED_OBERON_TLS12_PRF */ - -#ifdef PSA_NEED_OBERON_TLS12_PSK_TO_MS - if (PSA_ALG_IS_TLS12_PSK_TO_MS(alg)) { - operation->alg = OBERON_TLS12_PSK_TO_MS_ALG; - operation->count = 0; - } else -#endif /* PSA_NEED_OBERON_TLS12_PSK_TO_MS */ - -#ifdef PSA_NEED_OBERON_PBKDF2_HMAC - if (PSA_ALG_IS_PBKDF2_HMAC(alg)) { - operation->alg = OBERON_PBKDF2_HMAC_ALG; - } else -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC */ - -#ifdef PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS - if (alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS) { - operation->alg = OBERON_ECJPAKE_TO_PMS_ALG; - } else -#endif /* PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS */ - -#ifdef PSA_NEED_OBERON_SP800_108_COUNTER_HMAC - if (PSA_ALG_IS_SP800_108_COUNTER_HMAC(alg)) { - operation->alg = OBERON_SP800_108_COUNTER_ALG; - operation->info[0] = 0u; // separator - operation->info_length = 1; - operation->count = 0xFFFFFFF8; - } else -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_HMAC */ - - { - (void)alg; - return PSA_ERROR_NOT_SUPPORTED; - } - } - - operation->salt_length = 0; - operation->data_length = 0; - operation->index = 1; - return PSA_SUCCESS; -} - -psa_status_t oberon_key_derivation_set_capacity( - oberon_key_derivation_operation_t *operation, - size_t capacity) -{ -#if defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - if (operation->alg == OBERON_SP800_108_COUNTER_ALG) { - operation->count = (uint32_t)(capacity * 8); // L in bits - } -#endif - (void)operation; - (void)capacity; - return PSA_SUCCESS; -} - -psa_status_t oberon_key_derivation_input_bytes( - oberon_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - const uint8_t *data, size_t data_length) -{ - psa_status_t status; - size_t i, length; - - switch (step) { - - case PSA_KEY_DERIVATION_INPUT_SALT: - if (data_length) { - if (operation->alg == OBERON_HKDF_ALG || operation->alg == OBERON_HKDF_EXTRACT_ALG) { -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) - status = oberon_setup_mac(operation, data, data_length); - if (status) goto exit; - operation->salt_length = (uint16_t)data_length; -#endif /* PSA_NEED_OBERON_HKDF || PSA_NEED_OBERON_HKDF_EXTRACT */ -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - } else if (operation->alg == OBERON_SRP_PASSWORD_HASH_ALG) { - status = psa_driver_wrapper_hash_finish(&operation->hash_op, operation->data, sizeof operation->data, &length); - if (status) goto exit; - status = psa_driver_wrapper_hash_setup(&operation->hash_op, PSA_ALG_GET_HASH(operation->mac_alg)); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, data, data_length); // salt - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, operation->data, length); // H(u, ":", pw) - if (status) goto exit; -#endif /* PSA_NEED_OBERON_SRP_PASSWORD_HASH */ - } else { -#if defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) - length = operation->salt_length + data_length; - if (length < data_length || length > sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->info + operation->salt_length, data, data_length); - operation->salt_length = (uint16_t)length; -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC || PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ - } - } - return PSA_SUCCESS; - -#if defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) - case PSA_KEY_DERIVATION_INPUT_OTHER_SECRET: - if (data_length) { - if (data_length > sizeof operation->key - PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE - 4) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->key + 2, data, data_length); - } - operation->key_length = (uint16_t)data_length; - operation->count = 1; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_TLS12_PSK_TO_MS */ - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) || \ - defined(PSA_NEED_OBERON_HKDF_EXPAND) || defined(PSA_NEED_OBERON_TLS12_PRF) || \ - defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) || defined(PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS) || \ - defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - case PSA_KEY_DERIVATION_INPUT_SECRET: - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_HKDF_EXPAND - case OBERON_HKDF_EXPAND_ALG: - // skip extract phase - if (data_length != operation->block_length) return PSA_ERROR_INVALID_ARGUMENT; - memcpy(operation->key, data, data_length); - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_HKDF_EXPAND */ -#ifdef PSA_NEED_OBERON_TLS12_PRF - case OBERON_TLS12_PRF_ALG: - if (data_length > sizeof operation->key) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->key, data, data_length); - operation->key_length = (uint16_t)data_length; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_TLS12_PRF */ -#ifdef PSA_NEED_OBERON_TLS12_PSK_TO_MS - case OBERON_TLS12_PSK_TO_MS_ALG: - if (data_length > PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE) return PSA_ERROR_INVALID_ARGUMENT; - length = operation->key_length; // other secret length - if (operation->count == 0) { - // plain PSK: set other secret to data_length zeroes - memset(operation->key + 2, 0, data_length); - length = data_length; - } - operation->key[0] = (uint8_t)(length >> 8); - operation->key[1] = (uint8_t)length; - operation->key[length + 2] = (uint8_t)(data_length >> 8); - operation->key[length + 3] = (uint8_t)data_length; - memcpy(operation->key + length + 4, data, data_length); - operation->key_length = (uint16_t)(length + data_length + 4); // total secret length - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_TLS12_PSK_TO_MS */ -#ifdef PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS - case OBERON_ECJPAKE_TO_PMS_ALG: - if (data_length != PSA_TLS12_ECJPAKE_TO_PMS_INPUT_SIZE || data[0] != 0x04) { - return PSA_ERROR_INVALID_ARGUMENT; // P256 point - } - memcpy(operation->key, &data[1], 32); // input.x - operation->key_length = (uint16_t)32; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS */ -#if defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - case OBERON_SP800_108_COUNTER_ALG: - if (data_length > sizeof operation->key) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->key, data, data_length); - operation->key_length = (uint16_t)data_length; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_HMAC || PSA_NEED_OBERON_SP800_108_COUNTER_CMAC */ - default: -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) - if (operation->salt_length == 0) { - // set zero salt - status = oberon_setup_mac(operation, zero, operation->block_length); - if (status) goto exit; - } - // add secret - status = psa_driver_wrapper_mac_update(&operation->mac_op, data, data_length); - if (status) goto exit; - // HKDF extract - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, - operation->key, operation->block_length, &length); - if (status) goto exit; -#endif /* PSA_NEED_OBERON_HKDF || PSA_NEED_OBERON_HKDF_EXTRACT */ - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_HKDF || PSA_NEED_OBERON_HKDF_EXTRACT || PSA_NEED_OBERON_HKDF_EXPAND || PSA_NEED_OBERON_TLS12 */ - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) || defined(PSA_NEED_OBERON_HKDF_EXPAND) || \ - defined(PSA_NEED_OBERON_SRP_PASSWORD_HASH) - case PSA_KEY_DERIVATION_INPUT_INFO: -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - if (operation->alg == OBERON_SRP_PASSWORD_HASH_ALG) { - status = psa_driver_wrapper_hash_setup(&operation->hash_op, PSA_ALG_GET_HASH(operation->mac_alg)); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, data, data_length); // user id - if (status) goto exit; - return PSA_SUCCESS; - } else -#endif - { - if (data_length > sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->info, data, data_length); - operation->info_length = (uint16_t)data_length; - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_HKDF || PSA_NEED_OBERON_HKDF_EXTRACT || PSA_NEED_OBERON_HKDF_EXPAND || - PSA_NEED_OBERON_SRP_PASSWORD_HASH */ - -#if defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) || \ - defined(PSA_NEED_OBERON_SRP_PASSWORD_HASH) - case PSA_KEY_DERIVATION_INPUT_PASSWORD: - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_PBKDF2_HMAC - case OBERON_PBKDF2_HMAC_ALG: - if (data_length > PSA_HASH_BLOCK_LENGTH(operation->mac_alg)) { - // key = H(password) - status = oberon_hash_key(operation, data, data_length); - if (status) return status; // no cleanup needed - operation->key_length = (uint16_t)operation->block_length; - } else { - memcpy(operation->key, data, data_length); - operation->key_length = (uint16_t)data_length; - } - break; -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC */ -#ifdef PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 - case OBERON_PBKDF2_CMAC_ALG: - if (data_length == 16) { - memcpy(operation->key, data, 16); - } else { - // key = mac(zero, password) - status = oberon_setup_mac(operation, zero, 16); // zero key - if (status) goto exit; - status = psa_driver_wrapper_mac_update(&operation->mac_op, data, data_length); - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, operation->key, 16, &length); - if (status) goto exit; - } - operation->key_length = 16; - break; -#endif /* PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - case OBERON_SRP_PASSWORD_HASH_ALG: - status = psa_driver_wrapper_hash_update(&operation->hash_op, (const uint8_t *)":", 1); // ":" - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, data, data_length); // pw - if (status) goto exit; - break; -#endif /* PSA_NEED_OBERON_SRP_PASSWORD_HASH */ - default: - break; - } - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC || PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 || PSA_NEED_OBERON_SRP_PASSWORD_HASH */ - -#if defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) - case PSA_KEY_DERIVATION_INPUT_SEED: - if (data_length > sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->info, data, data_length); - operation->info_length = (uint16_t)data_length; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_TLS12_PRF || PSA_NEED_OBERON_TLS12_PSK_TO_MS */ - -#if defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) || \ - defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - case PSA_KEY_DERIVATION_INPUT_LABEL: -#if defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - if (operation->alg == OBERON_SP800_108_COUNTER_ALG) { - for (i = 0; i < data_length; i++) { - if (data[i] == 0) return PSA_ERROR_INVALID_ARGUMENT; - } - // store label - if (data_length >= sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->info, data, data_length); - operation->info[data_length] = 0u; // separator - operation->info_length = (uint8_t)data_length + 1; - return PSA_SUCCESS; - } else -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_HMAC || PSA_NEED_OBERON_SP800_108_COUNTER_CMAC */ - { -#if defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) - // TLS12 - // seed = label || seed - length = operation->info_length + data_length; - if (length < data_length || length > sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memmove(operation->info + data_length, operation->info, operation->info_length); - memcpy(operation->info, data, data_length); - operation->info_length = (uint16_t)length; -#endif /* PSA_NEED_OBERON_TLS12_PRF || PSA_NEED_OBERON_TLS12_PSK_TO_MS */ - return PSA_SUCCESS; - } -#endif /* PSA_NEED_OBERON_TLS12_PRF || PSA_NEED_OBERON_TLS12_PSK_TO_MS || PSA_NEED_OBERON_SP800_108_COUNTER */ - -#if defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - case PSA_KEY_DERIVATION_INPUT_CONTEXT: - // insert context - length = operation->info_length + data_length; - if (length < data_length || length > sizeof operation->info) return PSA_ERROR_INSUFFICIENT_MEMORY; - memcpy(operation->info + operation->info_length, data, data_length); - operation->info_length = (uint16_t)length; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_HMAC || PSA_NEED_OBERON_SP800_108_COUNTER_CMAC */ - - default: - (void)data; - (void)data_length; - (void)status; - (void)length; - (void)i; - return PSA_ERROR_INVALID_ARGUMENT; - } - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) || \ - defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) || defined(PSA_NEED_OBERON_SRP_PASSWORD_HASH) -exit: -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - if (operation->alg == OBERON_PBKDF2_HMAC_ALG) { - psa_driver_wrapper_hash_abort(&operation->hash_op); - } else -#endif - { - psa_driver_wrapper_mac_abort(&operation->mac_op); - } - return status; -#endif -} - -psa_status_t oberon_key_derivation_input_integer( - oberon_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - uint64_t value) -{ - switch (step) { -#if defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) - case PSA_KEY_DERIVATION_INPUT_COST: - operation->count = (uint32_t)value; - return PSA_SUCCESS; -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC || PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ - default: - (void)operation; - (void)value; - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_key_derivation_output_bytes( - oberon_key_derivation_operation_t *operation, - uint8_t *output, size_t output_length) -{ - psa_status_t status; - size_t block_length = operation->block_length; - size_t data_length = operation->data_length; - size_t i, length; - uint8_t u[PSA_HASH_MAX_SIZE]; - uint8_t idx; - - if (output_length == 0) return PSA_SUCCESS; - - if (data_length) { - if (data_length >= output_length) { - memcpy(output, operation->data + block_length - data_length, output_length); - operation->data_length = (uint8_t)(data_length - output_length); - return PSA_SUCCESS; - } else { - memcpy(output, operation->data + block_length - data_length, data_length); - output += data_length; - output_length -= data_length; - } - } - -#ifdef PSA_NEED_OBERON_SP800_108_COUNTER_CMAC - if (operation->alg == OBERON_SP800_108_COUNTER_ALG && operation->key_type == PSA_KEY_TYPE_AES) { - // setup K0 - // key - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - // label + context - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->info_length); - if (status) goto exit; - // L - status = oberon_mac_update_num(operation, operation->count); - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, u, block_length, &length); - if (status) goto exit; - } -#endif - - // KDF expand - for (;;) { - switch (operation->alg) { - -#ifdef PSA_NEED_OBERON_HKDF_EXTRACT - case OBERON_HKDF_EXTRACT_ALG: - // skip expand phase - memcpy(operation->data, operation->key, block_length); - break; -#endif /* PSA_NEED_OBERON_HKDF_EXTRACT */ - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXPAND) - case OBERON_HKDF_ALG: - case OBERON_HKDF_EXPAND_ALG: - status = oberon_setup_mac(operation, operation->key, block_length); // prk - if (status) goto exit; - // T(i-1) - if (operation->index > 1) { - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->data, block_length); - if (status) goto exit; - } - // info - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->info_length); - if (status) goto exit; - // i - idx = (uint8_t)operation->index; - status = psa_driver_wrapper_mac_update(&operation->mac_op, &idx, 1); - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, operation->data, block_length, &length); - if (status) goto exit; - break; -#endif /* PSA_NEED_OBERON_HKDF || PSA_NEED_OBERON_HKDF_EXPAND */ - -#if defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) - case OBERON_TLS12_PRF_ALG: - case OBERON_TLS12_PSK_TO_MS_ALG: - // A(i) = HMAC(A(i-1)) - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - if (operation->index == 1) { - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->info_length); // A(0) - } else { - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->a, block_length); // A(i) - } - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, operation->a, block_length, &length); - if (status) goto exit; - // P_hash() = HMAC(A(i) || seed) - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->a, block_length); // A(i) - if (status) goto exit; - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->info_length); // seed - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, operation->data, block_length, &length); - if (status) goto exit; - break; -#endif /* PSA_NEED_OBERON_TLS12_PRF || PSA_NEED_OBERON_TLS12_PSK_TO_MS */ - -#if defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) -#ifdef PSA_NEED_OBERON_PBKDF2_HMAC - case OBERON_PBKDF2_HMAC_ALG: -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC */ -#ifdef PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 - case OBERON_PBKDF2_CMAC_ALG: -#endif /* PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ - // U1 = mac(password, salt || int32be(i)) - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->salt_length); - if (status) goto exit; - status = oberon_mac_update_num(operation, operation->index); - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, u, block_length, &length); - if (status) goto exit; - memcpy(operation->data, u, block_length); - for (i = 1; i < operation->count; i++) { - // Ui = mac(password, Ui-1) - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - status = psa_driver_wrapper_mac_update(&operation->mac_op, u, block_length); - if (status) goto exit; - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, u, block_length, &length); - if (status) goto exit; - // Ti ^= Ui - oberon_xor(operation->data, operation->data, u, block_length); - } - break; -#endif /* PSA_NEED_OBERON_PBKDF2_HMAC || PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128 */ - -#ifdef PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS - case OBERON_ECJPAKE_TO_PMS_ALG: - if (output_length != PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE) return PSA_ERROR_INVALID_ARGUMENT; - return psa_driver_wrapper_hash_compute(PSA_ALG_SHA_256, operation->key, 32, output, output_length, &length); -#endif /* PSA_NEED_OBERON_TLS12_ECJPAKE_TO_PMS */ - -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - case OBERON_SRP_PASSWORD_HASH_ALG: - status = psa_driver_wrapper_hash_finish(&operation->hash_op, output, output_length, &length); - if (status != PSA_SUCCESS) psa_driver_wrapper_hash_abort(&operation->hash_op); - if (output_length != length) return PSA_ERROR_INVALID_ARGUMENT; - return status; -#endif - -#if defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) - case OBERON_SP800_108_COUNTER_ALG: - // key - status = oberon_setup_mac(operation, operation->key, operation->key_length); - if (status) goto exit; - // i - status = oberon_mac_update_num(operation, operation->index); - if (status) goto exit; - // label + context - status = psa_driver_wrapper_mac_update(&operation->mac_op, operation->info, operation->info_length); - if (status) goto exit; - // L - status = oberon_mac_update_num(operation, operation->count); - if (status) goto exit; -#ifdef PSA_NEED_OBERON_SP800_108_COUNTER_CMAC - if (operation->key_type == PSA_KEY_TYPE_AES) { - // K0 - status = psa_driver_wrapper_mac_update(&operation->mac_op, u, block_length); - if (status) goto exit; - } -#endif - // output - status = psa_driver_wrapper_mac_sign_finish(&operation->mac_op, operation->data, block_length, &length); - if (status) goto exit; - break; -#endif /* PSA_NEED_OBERON_SP800_108_COUNTER_HMAC || PSA_NEED_OBERON_SP800_108_COUNTER_CMAC */ - - default: - (void)i; - (void)u; - (void)idx; - (void)length; - (void)status; - return PSA_ERROR_BAD_STATE; - } - operation->index++; - if (output_length > block_length) { - memcpy(output, operation->data, block_length); - output += block_length; - output_length -= block_length; - } else { - memcpy(output, operation->data, output_length); - operation->data_length = (uint8_t)(block_length - output_length); - return PSA_SUCCESS; - } - } - -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXPAND) || \ - defined(PSA_NEED_OBERON_PBKDF2_HMAC) || defined(PSA_NEED_OBERON_PBKDF2_AES_CMAC_PRF_128) || \ - defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) || \ - defined(PSA_NEED_OBERON_SP800_108_COUNTER_HMAC) || defined(PSA_NEED_OBERON_SP800_108_COUNTER_CMAC) -exit: - psa_driver_wrapper_mac_abort(&operation->mac_op); - return status; -#endif -} - -psa_status_t oberon_key_derivation_abort( - oberon_key_derivation_operation_t *operation ) -{ - switch (operation->alg) { -#if defined(PSA_NEED_OBERON_HKDF) || defined(PSA_NEED_OBERON_HKDF_EXTRACT) - case OBERON_HKDF_ALG: - case OBERON_HKDF_EXTRACT_ALG: - return psa_driver_wrapper_mac_abort(&operation->mac_op); -#endif -#ifdef PSA_NEED_OBERON_SRP_PASSWORD_HASH - case OBERON_SRP_PASSWORD_HASH_ALG: - return psa_driver_wrapper_hash_abort(&operation->hash_op); -#endif - default: - return PSA_SUCCESS; - } -} diff --git a/ext/oberon/psa/drivers/oberon_key_derivation.h b/ext/oberon/psa/drivers/oberon_key_derivation.h deleted file mode 100644 index 0890936fbbac..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_derivation.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_KEY_DERIVATION_H -#define OBERON_KEY_DERIVATION_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -#define OBERON_KDF_MAX_INFO_BYTES 256 -#define OBERON_TLS12_PRF_MAX_KEY_BYTES 516 - - -typedef enum { - OBERON_HKDF_ALG = 1, - OBERON_HKDF_EXTRACT_ALG = 2, - OBERON_HKDF_EXPAND_ALG = 3, - OBERON_PBKDF2_HMAC_ALG = 4, - OBERON_PBKDF2_CMAC_ALG = 5, - OBERON_TLS12_PRF_ALG = 6, - OBERON_TLS12_PSK_TO_MS_ALG = 7, - OBERON_ECJPAKE_TO_PMS_ALG = 8, - OBERON_SP800_108_COUNTER_ALG = 9, - OBERON_SRP_PASSWORD_HASH_ALG = 10, -} oberon_kdf_alg; - -typedef struct { - union { - psa_mac_operation_t mac_op; - psa_hash_operation_t hash_op; - }; - uint8_t data[PSA_HASH_MAX_SIZE]; - uint8_t info[OBERON_KDF_MAX_INFO_BYTES]; -#if defined(PSA_NEED_OBERON_TLS12_PRF) || defined(PSA_NEED_OBERON_TLS12_PSK_TO_MS) - uint8_t key[OBERON_TLS12_PRF_MAX_KEY_BYTES]; - uint8_t a[PSA_HASH_MAX_SIZE]; -#else - uint8_t key[PSA_HMAC_MAX_HASH_BLOCK_SIZE]; -#endif - psa_algorithm_t mac_alg; - psa_key_type_t key_type; - uint8_t data_length; - uint8_t block_length; - uint16_t salt_length; - uint16_t info_length; - uint16_t key_length; - uint32_t index; - uint32_t count; - oberon_kdf_alg alg; -} oberon_key_derivation_operation_t; - - -psa_status_t oberon_key_derivation_setup( - oberon_key_derivation_operation_t *operation, - psa_algorithm_t alg); - -psa_status_t oberon_key_derivation_set_capacity( - oberon_key_derivation_operation_t *operation, - size_t capacity); - -psa_status_t oberon_key_derivation_input_bytes( - oberon_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - const uint8_t *data, size_t data_length); - -psa_status_t oberon_key_derivation_input_integer( - oberon_key_derivation_operation_t *operation, - psa_key_derivation_step_t step, - uint64_t value); - -psa_status_t oberon_key_derivation_output_bytes( - oberon_key_derivation_operation_t *operation, - uint8_t *output, size_t output_length); - -psa_status_t oberon_key_derivation_abort( - oberon_key_derivation_operation_t *operation ); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_key_management.c b/ext/oberon/psa/drivers/oberon_key_management.c deleted file mode 100644 index 7845af623fa3..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_management.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include "psa/crypto.h" -#include "oberon_key_management.h" -#include "oberon_ec_keys.h" -#include "oberon_rsa.h" -#include "oberon_spake2p.h" -#include "oberon_srp.h" - - -psa_status_t oberon_export_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_export_ec_public_key( - attributes, key, key_length, - data, data_size, data_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_RSA_KEY_PAIR_EXPORT - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_export_rsa_public_key( - attributes, key, key_length, - data, data_size, data_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_RSA_KEY_PAIR_EXPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT - if (PSA_KEY_TYPE_IS_SPAKE2P(type)) { - return oberon_export_spake2p_public_key( - attributes, key, key_length, - data, data_size, data_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT - if (PSA_KEY_TYPE_IS_SRP(type)) { - return oberon_export_srp_public_key( - attributes, key, key_length, - data, data_size, data_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT */ - - { - (void)key; - (void)key_length; - (void)data; - (void)data_size; - (void)data_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_import_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *key_bits) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT - if (PSA_KEY_TYPE_IS_ECC(type)) { - return oberon_import_ec_key( - attributes, data, data_length, - key, key_size, key_length, key_bits); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_IMPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_RSA_KEY_PAIR_IMPORT - if (PSA_KEY_TYPE_IS_RSA(type)) { - return oberon_import_rsa_key( - attributes, data, data_length, - key, key_size, key_length, key_bits); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_RSA_KEY_PAIR_IMPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT - if (PSA_KEY_TYPE_IS_SPAKE2P(type)) { - return oberon_import_spake2p_key( - attributes, data, data_length, - key, key_size, key_length, key_bits); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT - if (PSA_KEY_TYPE_IS_SRP(type)) { - return oberon_import_srp_key( - attributes, data, data_length, - key, key_size, key_length, key_bits); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT */ - - { - (void)data; - (void)data_length; - (void)key; - (void)key_size; - (void)key_length; - (void)key_bits; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_generate_key( - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE - if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) { - return oberon_generate_ec_key( - attributes, - key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_GENERATE */ - - { - (void)key; - (void)key_size; - (void)key_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_derive_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length) -{ - psa_key_type_t type = psa_get_key_type(attributes); - -#ifdef PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE - if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) { - return oberon_derive_ec_key( - attributes, input, input_length, - key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_DERIVE */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE - if (PSA_KEY_TYPE_IS_SPAKE2P_KEY_PAIR(type)) { - return oberon_derive_spake2p_key( - attributes, input, input_length, - key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE */ - - { - (void)input; - (void)input_length; - (void)key; - (void)key_size; - (void)key_length; - (void)type; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_key_management.h b/ext/oberon/psa/drivers/oberon_key_management.h deleted file mode 100644 index 75c7444de881..000000000000 --- a/ext/oberon/psa/drivers/oberon_key_management.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_KEY_MANAGEMENT_H -#define OBERON_KEY_MANAGEMENT_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -psa_status_t oberon_export_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length); - -psa_status_t oberon_import_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *bits); - -psa_status_t oberon_generate_key( - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length); - -psa_status_t oberon_derive_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_mac.c b/ext/oberon/psa/drivers/oberon_mac.c deleted file mode 100644 index 74e18f5d3f97..000000000000 --- a/ext/oberon/psa/drivers/oberon_mac.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_mac.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - - -#define AES_BLOCK_LEN PSA_BLOCK_CIPHER_BLOCK_LENGTH(PSA_KEY_TYPE_AES) - - -#ifdef PSA_NEED_OBERON_HMAC -static psa_status_t oberon_hmac_setup( - oberon_hmac_operation_t *operation, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg) -{ - psa_status_t status; - size_t i, length; - psa_algorithm_t hash_alg = PSA_ALG_HMAC_GET_HASH(alg); - size_t hash_len = PSA_HASH_LENGTH(hash_alg); - size_t block_size = PSA_HASH_BLOCK_LENGTH(alg); - - if (key_length > block_size) { - // replace key by H(key) stored in k - status = psa_driver_wrapper_hash_setup(&operation->hash_op, hash_alg); - if (status) return status; - status = psa_driver_wrapper_hash_update(&operation->hash_op, key, key_length); - if (status) return status; - status = psa_driver_wrapper_hash_finish(&operation->hash_op, operation->k, hash_len, &length); - if (status) return status; - key = operation->k; - key_length = hash_len; - } - - status = psa_driver_wrapper_hash_setup(&operation->hash_op, hash_alg); - if (status) return status; - - // k = key ^ ipad - for (i = 0; i < key_length; i++) operation->k[i] = (uint8_t)(key[i] ^ 0x36); - for (; i < block_size; i++) operation->k[i] = 0x36; - status = psa_driver_wrapper_hash_update(&operation->hash_op, operation->k, block_size); // key ^ ipad - if (status) return status; - - operation->hash_alg = PSA_ALG_HMAC_GET_HASH(alg); - operation->block_size = (uint8_t)block_size; - return PSA_SUCCESS; -} - -static psa_status_t oberon_hmac_update( - oberon_hmac_operation_t *operation, - const uint8_t *input, size_t input_len) -{ - return psa_driver_wrapper_hash_update(&operation->hash_op, input, input_len); -} - -static psa_status_t oberon_hmac_finish( - oberon_hmac_operation_t *operation, - uint8_t *mac, size_t mac_size, size_t *mac_length) -{ - psa_status_t status; - size_t i, hash_length; - - // H(K ^ ipad, in, num) - status = psa_driver_wrapper_hash_finish(&operation->hash_op, operation->hash, sizeof operation->hash, &hash_length); - if (status) goto exit; - - // k = key ^ opad = (key ^ ipad) ^ (ipad ^ opad) = k ^ (ipad ^ opad) - for (i = 0; i < operation->block_size; i++) operation->k[i] = (uint8_t)(operation->k[i] ^ (0x36 ^ 0x5c)); - - status = psa_driver_wrapper_hash_setup(&operation->hash_op, operation->hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, operation->k, operation->block_size); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&operation->hash_op, operation->hash, hash_length); - if (status) goto exit; - if (mac_size == hash_length) { - return psa_driver_wrapper_hash_finish(&operation->hash_op, mac, mac_size, mac_length); - } else { // truncated mac - status = psa_driver_wrapper_hash_finish(&operation->hash_op, operation->hash, sizeof operation->hash, &hash_length); - if (status) goto exit; - memcpy(mac, operation->hash, mac_size); - *mac_length = mac_size; - } - -exit: - psa_driver_wrapper_hash_abort(&operation->hash_op); - return status; -} - -static psa_status_t oberon_hmac_compute( - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *mac, size_t mac_size, size_t *mac_length) -{ - oberon_hmac_operation_t operation = {{0}, 0, {0}, {0}, 0}; - psa_status_t status; - - status = oberon_hmac_setup(&operation, key, key_length, alg); - if (status) goto exit; - status = oberon_hmac_update(&operation, input, input_length); - if (status) goto exit; - return oberon_hmac_finish(&operation, mac, mac_size, mac_length); - -exit: - psa_driver_wrapper_hash_abort(&operation.hash_op); - return status; -} -#endif /* PSA_NEED_OBERON_HMAC */ - - -#ifdef PSA_NEED_OBERON_CMAC -// GF(2^128) multiply by x -// big-endian bit encoding (b127 in bit 7 of first byte, b0 in bit 0 of last byte) -static void gf128_multiply_x(uint8_t r[AES_BLOCK_LEN]) -{ - int i; - uint32_t c; - - c = r[0] >> 7; // msb - c = c * 0x87; // field reduction - for (i = 15; i >= 0; i--) { - c = ((uint32_t)r[i] << 1) ^ c; - r[i] = (uint8_t)c; - c >>= 8; - } -} - -static psa_status_t oberon_cmac_setup( - oberon_cmac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length) -{ - psa_status_t status; - size_t length; - - operation->length = 0; - - status = psa_driver_wrapper_cipher_encrypt_setup( - &operation->aes_op, - attributes, key, key_length, - PSA_ALG_ECB_NO_PADDING); - if (status) goto exit; - - // subkey generation - status = psa_driver_wrapper_cipher_update( - &operation->aes_op, - operation->block, AES_BLOCK_LEN, - operation->k, AES_BLOCK_LEN, &length); - if (status) goto exit; - - gf128_multiply_x(operation->k); // get k1 - - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_cipher_abort(&operation->aes_op); - return status; -} - -static psa_status_t oberon_cmac_update( - oberon_cmac_operation_t *operation, - const uint8_t *input, size_t input_length) -{ - psa_status_t status; - size_t length, free; - - if (!input_length) return PSA_SUCCESS; - - if (operation->length) { - free = AES_BLOCK_LEN - operation->length; - if (input_length <= free) { - oberon_xor( - operation->block + operation->length, - operation->block + operation->length, - input, input_length); - operation->length += input_length; - return PSA_SUCCESS; - } else { - if (free) { - oberon_xor( - operation->block + operation->length, - operation->block + operation->length, - input, free); - input += free; - input_length -= free; - } - status = psa_driver_wrapper_cipher_update( - &operation->aes_op, - operation->block, AES_BLOCK_LEN, - operation->block, AES_BLOCK_LEN, &length); - if (status) goto exit; - } - } - - while (input_length > AES_BLOCK_LEN) { - oberon_xor( - operation->block, - operation->block, - input, AES_BLOCK_LEN); - status = psa_driver_wrapper_cipher_update( - &operation->aes_op, - operation->block, AES_BLOCK_LEN, - operation->block, AES_BLOCK_LEN, &length); - if (status) goto exit; - input += AES_BLOCK_LEN; - input_length -= AES_BLOCK_LEN; - } - /* 0 < msg_len <= AES_BLOCK_LEN */ - - oberon_xor( - operation->block, - operation->block, - input, input_length); - operation->length = input_length; - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_cipher_abort(&operation->aes_op); - return status; -} - -static psa_status_t oberon_cmac_finish( - oberon_cmac_operation_t *operation, - uint8_t *mac, size_t mac_size, size_t *mac_length) -{ - psa_status_t status; - size_t length; - - // handle last block - if (operation->length == AES_BLOCK_LEN) { - // full block - oberon_xor(operation->block, operation->block, operation->k, AES_BLOCK_LEN); // use k1 - } else { - // partial or empty block - operation->block[operation->length] ^= 0x80; // padding pattern - gf128_multiply_x(operation->k); // k1 -> k2 - oberon_xor(operation->block, operation->block, operation->k, AES_BLOCK_LEN); // use k2 - } - - status = psa_driver_wrapper_cipher_update( - &operation->aes_op, - operation->block, AES_BLOCK_LEN, - operation->block, AES_BLOCK_LEN, &length); - if (status) goto exit; - - memcpy(mac, operation->block, mac_size); - *mac_length = mac_size; - -exit: - psa_driver_wrapper_cipher_abort(&operation->aes_op); - return status; -} - -static psa_status_t oberon_cmac_compute( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - const uint8_t *input, size_t input_length, - uint8_t *mac, size_t mac_size, size_t *mac_length) -{ - oberon_cmac_operation_t operation = {{0}, {0}, {0}, 0}; - psa_status_t status; - - status = oberon_cmac_setup(&operation, attributes, key, key_length); - if (status) goto exit; - status = oberon_cmac_update(&operation, input, input_length); - if (status) goto exit; - return oberon_cmac_finish(&operation, mac, mac_size, mac_length); - -exit: - psa_driver_wrapper_cipher_abort(&operation.aes_op); - return status; -} -#endif /* PSA_NEED_OBERON_CMAC */ - - -psa_status_t oberon_mac_sign_setup( - oberon_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg ) -{ -#ifdef PSA_NEED_OBERON_HMAC - if (PSA_ALG_IS_HMAC(alg)) { - memset(&operation->hmac, 0, sizeof operation->hmac); - operation->alg = OBERON_HMAC_ALG; - return oberon_hmac_setup( - &operation->hmac, - key, key_length, - alg); - } else -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - if (PSA_ALG_FULL_LENGTH_MAC(alg) == PSA_ALG_CMAC) { - if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - memset(&operation->cmac, 0, sizeof operation->cmac); - operation->alg = OBERON_CMAC_ALG; - return oberon_cmac_setup( - &operation->cmac, - attributes, key, key_length); - } else -#endif /* PSA_NEED_OBERON_CMAC */ - { - (void)operation; - (void)attributes; - (void)key; - (void)key_length; - (void)alg; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_mac_verify_setup( - oberon_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg ) -{ - return oberon_mac_sign_setup(operation, attributes, key, key_length, alg); -} - -psa_status_t oberon_mac_update( - oberon_mac_operation_t *operation, - const uint8_t *input, size_t input_length ) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_HMAC - case OBERON_HMAC_ALG: - return oberon_hmac_update( - &operation->hmac, - input, input_length); -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - case OBERON_CMAC_ALG: - return oberon_cmac_update( - &operation->cmac, - input, input_length); -#endif /* PSA_NEED_OBERON_CMAC */ - default: - (void)input; - (void)input_length; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_mac_sign_finish( - oberon_mac_operation_t *operation, - uint8_t *mac, size_t mac_size, size_t *mac_length ) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_HMAC - case OBERON_HMAC_ALG: - return oberon_hmac_finish( - &operation->hmac, - mac, mac_size, mac_length); -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - case OBERON_CMAC_ALG: - return oberon_cmac_finish( - &operation->cmac, - mac, mac_size, mac_length); -#endif /* PSA_NEED_OBERON_CMAC */ - default: - (void)mac; - (void)mac_size; - (void)mac_length; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_mac_verify_finish( - oberon_mac_operation_t *operation, - const uint8_t *mac, size_t mac_length) -{ - psa_status_t status; - uint8_t temp_mac[PSA_HASH_MAX_SIZE]; - size_t mac_len; - - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_HMAC - case OBERON_HMAC_ALG: - status = oberon_hmac_finish( - &operation->hmac, - temp_mac, mac_length, &mac_len); - break; -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - case OBERON_CMAC_ALG: - status = oberon_cmac_finish( - &operation->cmac, - temp_mac, mac_length, &mac_len); - break; -#endif /* PSA_NEED_OBERON_CMAC */ - default: - (void)mac_len; - return PSA_ERROR_BAD_STATE; - } - if (status != PSA_SUCCESS) return status; - if (oberon_ct_compare(mac, temp_mac, mac_length)) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; -} - -psa_status_t oberon_mac_abort( - oberon_mac_operation_t *operation ) -{ - switch (operation->alg) { -#ifdef PSA_NEED_OBERON_HMAC - case OBERON_HMAC_ALG: - psa_driver_wrapper_hash_abort(&operation->hmac.hash_op); - break; -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - case OBERON_CMAC_ALG: - psa_driver_wrapper_cipher_abort(&operation->cmac.aes_op); - break; -#endif /* PSA_NEED_OBERON_CMAC */ - default: - return PSA_SUCCESS; - } - memset(operation, 0, sizeof *operation); - return PSA_SUCCESS; -} - - -psa_status_t oberon_mac_compute( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *mac, size_t mac_size, size_t *mac_length ) -{ -#ifdef PSA_NEED_OBERON_HMAC - if (PSA_ALG_IS_HMAC(alg)) { - return oberon_hmac_compute( - key, key_length, - alg, - input, input_length, - mac, mac_size, mac_length); - } else -#endif /* PSA_NEED_OBERON_HMAC */ -#ifdef PSA_NEED_OBERON_CMAC - if (PSA_ALG_FULL_LENGTH_MAC(alg) == PSA_ALG_CMAC) { - if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 16 && key_length != 24 && key_length != 32) return PSA_ERROR_INVALID_ARGUMENT; - return oberon_cmac_compute( - attributes, key, key_length, - input, input_length, - mac, mac_size, mac_length); - } else -#endif /* PSA_NEED_OBERON_CMAC */ - { - (void)attributes; - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)mac; - (void)mac_size; - (void)mac_length; - return PSA_ERROR_NOT_SUPPORTED; - } -} diff --git a/ext/oberon/psa/drivers/oberon_mac.h b/ext/oberon/psa/drivers/oberon_mac.h deleted file mode 100644 index 0c59ec5ab147..000000000000 --- a/ext/oberon/psa/drivers/oberon_mac.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_MAC_H -#define OBERON_MAC_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - OBERON_HMAC_ALG = 1, - OBERON_CMAC_ALG = 2, - OBERON_CBC_MAC_ALG = 3, -} oberon_mac_alg; - -typedef struct { - psa_hash_operation_t hash_op; - psa_algorithm_t hash_alg; - uint8_t hash[PSA_HASH_MAX_SIZE]; - uint8_t k[PSA_HMAC_MAX_HASH_BLOCK_SIZE]; - uint8_t block_size; -} oberon_hmac_operation_t; - -typedef struct { - psa_cipher_operation_t aes_op; - uint8_t block[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE]; - uint8_t k[PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE]; - size_t length; -} oberon_cmac_operation_t; - -typedef struct { - union { -#ifdef PSA_NEED_OBERON_HMAC - oberon_hmac_operation_t hmac; -#endif -#ifdef PSA_NEED_OBERON_CMAC - oberon_cmac_operation_t cmac; -#endif - int dummy; - }; - oberon_mac_alg alg; -} oberon_mac_operation_t; - - -psa_status_t oberon_mac_sign_setup( - oberon_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg ); - -psa_status_t oberon_mac_verify_setup( - oberon_mac_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg ); - -psa_status_t oberon_mac_update( - oberon_mac_operation_t *operation, - const uint8_t *input, size_t input_length ); - -psa_status_t oberon_mac_sign_finish( - oberon_mac_operation_t *operation, - uint8_t *mac, size_t mac_size, size_t *mac_length ); - -psa_status_t oberon_mac_verify_finish( - oberon_mac_operation_t *operation, - const uint8_t *mac, size_t mac_length ); - -psa_status_t oberon_mac_abort( - oberon_mac_operation_t *operation ); - - -psa_status_t oberon_mac_compute( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - uint8_t *mac, size_t mac_size, size_t *mac_length ); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_pake.c b/ext/oberon/psa/drivers/oberon_pake.c deleted file mode 100644 index dbbd259fe568..000000000000 --- a/ext/oberon/psa/drivers/oberon_pake.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_pake.h" - - -psa_status_t oberon_pake_setup( - oberon_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite) -{ - operation->alg = psa_pake_cs_get_algorithm(cipher_suite); - -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_setup( - &operation->ctx.oberon_jpake_ctx, - attributes, password, password_length, - cipher_suite); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_setup( - &operation->ctx.oberon_spake2p_ctx, - attributes, password, password_length, - cipher_suite); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_setup( - &operation->ctx.oberon_srp_ctx, - attributes, password, password_length, - cipher_suite); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)attributes; - (void)password; - (void)password_length; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_pake_set_role( - oberon_pake_operation_t *operation, - psa_pake_role_t role) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return PSA_SUCCESS; - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_set_role( - &operation->ctx.oberon_spake2p_ctx, role); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_set_role( - &operation->ctx.oberon_srp_ctx, role); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - (void)role; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_set_user( - oberon_pake_operation_t *operation, - const uint8_t *user_id, size_t user_id_len) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_set_user( - &operation->ctx.oberon_jpake_ctx, user_id, user_id_len); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_set_user( - &operation->ctx.oberon_spake2p_ctx, user_id, user_id_len); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_set_user( - &operation->ctx.oberon_srp_ctx, user_id, user_id_len); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - (void)user_id; - (void)user_id_len; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_set_peer( - oberon_pake_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_set_peer( - &operation->ctx.oberon_jpake_ctx, peer_id, peer_id_len); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_set_peer( - &operation->ctx.oberon_spake2p_ctx, peer_id, peer_id_len); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ - { - (void)operation; - (void)peer_id; - (void)peer_id_len; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_set_context( - oberon_pake_operation_t *operation, - const uint8_t *context, size_t context_len) -{ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_set_context( - &operation->ctx.oberon_spake2p_ctx, context, context_len); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ - { - (void)operation; - (void)context; - (void)context_len; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_output( - oberon_pake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_output( - &operation->ctx.oberon_jpake_ctx, step, output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_output( - &operation->ctx.oberon_spake2p_ctx, step, output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_output( - &operation->ctx.oberon_srp_ctx, step, output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - (void)step; - (void)output; - (void)output_size; - (void)output_length; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_input( - oberon_pake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_input( - &operation->ctx.oberon_jpake_ctx, step, input, input_length); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_input( - &operation->ctx.oberon_spake2p_ctx, step, input, input_length); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_input( - &operation->ctx.oberon_srp_ctx, step, input, input_length); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - (void)step; - (void)input; - (void)input_length; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_get_shared_key( - oberon_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_get_shared_key( - &operation->ctx.oberon_jpake_ctx, key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_get_shared_key( - &operation->ctx.oberon_spake2p_ctx, key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_get_shared_key( - &operation->ctx.oberon_srp_ctx, key, key_size, key_length); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - (void)attributes; - (void)key; - (void)key_size; - (void)key_length; - return PSA_ERROR_BAD_STATE; - } -} - -psa_status_t oberon_pake_abort( - oberon_pake_operation_t *operation) -{ -#ifdef PSA_NEED_OBERON_JPAKE - if (PSA_ALG_IS_JPAKE(operation->alg)) { - return oberon_jpake_abort( - &operation->ctx.oberon_jpake_ctx); - } else -#endif /* PSA_NEED_OBERON_JPAKE */ -#ifdef PSA_NEED_OBERON_SPAKE2P - if (PSA_ALG_IS_SPAKE2P(operation->alg)) { - return oberon_spake2p_abort( - &operation->ctx.oberon_spake2p_ctx); - } else -#endif /* PSA_NEED_OBERON_SPAKE2P */ -#ifdef PSA_NEED_OBERON_SRP_6 - if (PSA_ALG_IS_SRP_6(operation->alg)) { - return oberon_srp_abort( - &operation->ctx.oberon_srp_ctx); - } else -#endif /* PSA_NEED_OBERON_SRP_6 */ - { - (void)operation; - return PSA_ERROR_BAD_STATE; - } -} diff --git a/ext/oberon/psa/drivers/oberon_pake.h b/ext/oberon/psa/drivers/oberon_pake.h deleted file mode 100644 index ded1acb8cc4a..000000000000 --- a/ext/oberon/psa/drivers/oberon_pake.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_PAKE_H -#define OBERON_PAKE_H - -#include - -#ifdef PSA_NEED_OBERON_JPAKE -#include "oberon_jpake.h" -#endif -#ifdef PSA_NEED_OBERON_SPAKE2P -#include "oberon_spake2p.h" -#endif -#ifdef PSA_NEED_OBERON_SRP_6 -#include "oberon_srp.h" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - psa_algorithm_t alg; - union { - unsigned dummy; /* Make sure this union is always non-empty */ -#ifdef PSA_NEED_OBERON_JPAKE - oberon_jpake_operation_t oberon_jpake_ctx; -#endif -#ifdef PSA_NEED_OBERON_SPAKE2P - oberon_spake2p_operation_t oberon_spake2p_ctx; -#endif -#ifdef PSA_NEED_OBERON_SRP_6 - oberon_srp_operation_t oberon_srp_ctx; -#endif - } ctx; -} oberon_pake_operation_t; - - -psa_status_t oberon_pake_setup( - oberon_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite); - -psa_status_t oberon_pake_set_role( - oberon_pake_operation_t *operation, - psa_pake_role_t role); - -psa_status_t oberon_pake_set_user( - oberon_pake_operation_t *operation, - const uint8_t *user_id, size_t user_id_len); - -psa_status_t oberon_pake_set_peer( - oberon_pake_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len); - -psa_status_t oberon_pake_set_context( - oberon_pake_operation_t *operation, - const uint8_t *context, size_t context_len); - -psa_status_t oberon_pake_output( - oberon_pake_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_pake_input( - oberon_pake_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_pake_get_shared_key( - oberon_pake_operation_t *operation, - const psa_key_attributes_t *attributes, - uint8_t *key, size_t key_size, size_t *key_length); - -psa_status_t oberon_pake_abort( - oberon_pake_operation_t *operation); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_rsa.c b/ext/oberon/psa/drivers/oberon_rsa.c deleted file mode 100644 index d43cba28dbd6..000000000000 --- a/ext/oberon/psa/drivers/oberon_rsa.c +++ /dev/null @@ -1,1096 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. - -#include - -#include "psa/crypto.h" -#include "oberon_rsa.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - -#include "ocrypto_rsa_primitives.h" - - -#define SEQ_TAG 0x30 -#define INT_TAG 0x02 -#define BIT_TAG 0x03 - - -typedef struct { - uint16_t index; - uint16_t length; - uint16_t bits; -} integer_info_t; - -typedef struct { - uint32_t e; - integer_info_t n; - integer_info_t p; - integer_info_t q; - integer_info_t dp; - integer_info_t dq; - integer_info_t qi; - psa_key_type_t type; - size_t start, length; // public part - size_t data_size; -} key_info_t; - - -static const uint8_t RSA_ALGORITHM_IDENTIFIER[] = { - 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00}; - - -static psa_status_t oberon_parse_length( - const uint8_t *data, size_t data_length, - size_t *index, size_t *length) -{ - size_t len, idx = *index; - if (idx >= data_length) return PSA_ERROR_INVALID_ARGUMENT; - len = data[idx++]; - if (len == 0x81) { - if (idx >= data_length) return PSA_ERROR_INVALID_ARGUMENT; - len = data[idx++]; - } else if (len == 0x82) { - if (idx >= data_length - 1) return PSA_ERROR_INVALID_ARGUMENT; - len = data[idx++]; - len = len * 256 + data[idx++]; - } else if (len >= 0x80) { - return PSA_ERROR_INVALID_ARGUMENT; - } - - if (idx + len > data_length) return PSA_ERROR_INVALID_ARGUMENT; - *index = idx; - *length = len; - return PSA_SUCCESS; -} - -static psa_status_t oberon_parse_integer( - integer_info_t *info, - const uint8_t *data, size_t length, - size_t *index, - uint32_t *value) // may be NULL -{ - psa_status_t status; - size_t idx = *index; - size_t len, bits, i; - uint8_t first; - uint32_t val; - - if (idx >= length) return PSA_ERROR_INVALID_ARGUMENT; - if (data[idx++] != INT_TAG) return PSA_ERROR_INVALID_ARGUMENT; - status = oberon_parse_length(data, length, &idx, &len); - if (status) return status; - if (len == 0) return PSA_ERROR_INVALID_ARGUMENT; - info->index = (uint16_t)idx; - info->length = (uint16_t)len; - *index = idx + len; - - first = data[idx++]; - if (first >= 0x80) return PSA_ERROR_INVALID_ARGUMENT; // negative - if (len >= 2 && first == 0) { // leading zero byte - len--; - first = data[idx++]; - if (first == 0) return PSA_ERROR_INVALID_ARGUMENT; - } - - if (value) { - if (len >= 4) return PSA_ERROR_INVALID_ARGUMENT; - val = first; - for (i = 1; i < len; i++) { - val = val * 256 + data[idx++]; - } - *value = val; - } - - bits = PSA_BYTES_TO_BITS(len); - while (bits > 0 && (first & 0x80) == 0) { // leading zero bits - bits--; - first <<= 1; - } - info->bits = (uint16_t)bits; - - return PSA_SUCCESS; -} - -static psa_status_t oberon_parse_rsa_key( - key_info_t *info, - const uint8_t *key, size_t key_length) -{ - psa_status_t status; - size_t index = 0; - size_t seq_len, seq_end; - uint32_t value; - size_t i; - - // sequence - if (key_length < 20) return PSA_ERROR_INVALID_ARGUMENT; - if (key[index++] != SEQ_TAG) return PSA_ERROR_INVALID_ARGUMENT; - status = oberon_parse_length(key, key_length, &index, &seq_len); - if (status) return status; - seq_end = index + seq_len; - - if (info->type == PSA_KEY_TYPE_RSA_KEY_PAIR) { - // version - status = oberon_parse_integer(&info->n, key, key_length, &index, &value); - if (status) return status; - if (value != 0) return PSA_ERROR_INVALID_ARGUMENT; // wrong version - - info->start = index; - } else { - if (key[index] == SEQ_TAG) { // skip AlgorithmIdentifier prefix - index++; - status = oberon_parse_length(key, key_length, &index, &seq_len); - if (status) return status; - if (seq_len != sizeof RSA_ALGORITHM_IDENTIFIER) return PSA_ERROR_INVALID_ARGUMENT; - for (i = 0; i < sizeof RSA_ALGORITHM_IDENTIFIER; i++) { - if (key[index++] != RSA_ALGORITHM_IDENTIFIER[i]) return PSA_ERROR_INVALID_ARGUMENT; - } - if (key[index++] != BIT_TAG) return PSA_ERROR_INVALID_ARGUMENT; - status = oberon_parse_length(key, key_length, &index, &seq_len); - if (status) return status; - if (index + seq_len != seq_end) return PSA_ERROR_INVALID_ARGUMENT; - if (key[index++] != 0) return PSA_ERROR_INVALID_ARGUMENT; - if (key[index++] != SEQ_TAG) return PSA_ERROR_INVALID_ARGUMENT; - status = oberon_parse_length(key, key_length, &index, &seq_len); - if (status) return status; - if (index + seq_len != seq_end) return PSA_ERROR_INVALID_ARGUMENT; - } - } - - // n - status = oberon_parse_integer(&info->n, key, key_length, &index, NULL); - if (status) return status; - - // e - status = oberon_parse_integer(&info->p, key, key_length, &index, &info->e); - if (status) return status; - - if (info->type == PSA_KEY_TYPE_RSA_KEY_PAIR) { - info->length = index - info->start; - - // d - status = oberon_parse_integer(&info->p, key, key_length, &index, NULL); - if (status) return status; - if (info->p.bits > info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - - // p - status = oberon_parse_integer(&info->p, key, key_length, &index, NULL); - if (status) return status; - if (info->p.bits * 2 != info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - - // q - status = oberon_parse_integer(&info->q, key, key_length, &index, NULL); - if (status) return status; - if (info->q.bits * 2 != info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - - // d mod (p-1) - status = oberon_parse_integer(&info->dp, key, key_length, &index, NULL); - if (status) return status; - if (info->dp.bits * 2 > info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - - // d mod (q-1) - status = oberon_parse_integer(&info->dq, key, key_length, &index, NULL); - if (status) return status; - if (info->dq.bits * 2 > info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - - // q^-1 mod p - status = oberon_parse_integer(&info->qi, key, key_length, &index, NULL); - if (status) return status; - if (info->qi.bits * 2 > info->n.bits) return PSA_ERROR_INVALID_ARGUMENT; - } - - if (index != seq_end) return PSA_ERROR_INVALID_ARGUMENT; - info->data_size = index; - return PSA_SUCCESS; -} - - -psa_status_t oberon_export_rsa_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length) -{ - psa_status_t status; - key_info_t key_info; - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { - case PSA_KEY_TYPE_RSA_PUBLIC_KEY: - if (key_length > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(data, key, key_length); - *data_length = key_length; - return PSA_SUCCESS; - case PSA_KEY_TYPE_RSA_KEY_PAIR: - // extract public key (n & e) from secret key - key_info.type = type; - status = oberon_parse_rsa_key(&key_info, key, key_length); - if (status) return status; - if (key_info.length >= 256) { - if (key_info.length + 4 > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - data[0] = SEQ_TAG; - data[1] = 0x82; - data[2] = (uint8_t)(key_info.length >> 8); - data[3] = (uint8_t)key_info.length; - memcpy(&data[4], &key[key_info.start], key_info.length); - *data_length = key_info.length + 4; - } else { - if (key_info.length + 3 > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - data[0] = SEQ_TAG; - data[1] = 0x81; - data[2] = (uint8_t)key_info.length; - memcpy(&data[3], &key[key_info.start], key_info.length); - *data_length = key_info.length + 3; - } - return PSA_SUCCESS; - default: - return PSA_ERROR_NOT_SUPPORTED; - } -} - -psa_status_t oberon_import_rsa_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *key_bits) -{ - psa_status_t status; - key_info_t key_info; - psa_key_type_t type = psa_get_key_type(attributes); - - if (!PSA_KEY_TYPE_IS_RSA(type)) return PSA_ERROR_NOT_SUPPORTED; - - key_info.type = type; - status = oberon_parse_rsa_key(&key_info, data, data_length); - if (status) return status; - - if (key_info.data_size > key_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(key, data, key_info.data_size); - *key_length = key_info.data_size; - *key_bits = key_info.n.bits; - - return PSA_SUCCESS; -} - - -// constant time zero test -// 0x00 -> 1, 0x01..0xFF -> 0 -#define IS_ZERO(x) (((uint32_t)(x) - 1) >> 31) - - -#ifdef PSA_NEED_OBERON_RSA_PSS -static const uint8_t zero[8] = {0}; -#endif - -#if defined(PSA_NEED_OBERON_RSA_PSS) || defined(PSA_NEED_OBERON_RSA_OAEP) -// mask generation function and xor -// data ^= MGF(in, data_len) -static psa_status_t oberon_apply_mgf( - psa_hash_operation_t *hash_op, - psa_algorithm_t hash_alg, - const uint8_t *in, size_t in_len, - uint8_t *data, size_t data_len) -{ - psa_status_t status; - uint8_t counter[4] = {0, 0, 0, 0}; - uint8_t mask[PSA_HASH_MAX_SIZE]; - size_t block_len, length; - size_t hash_len = PSA_HASH_LENGTH(hash_alg); - - while (data_len > 0) { - status = psa_driver_wrapper_hash_setup(hash_op, hash_alg); - if (status) return status; - status = psa_driver_wrapper_hash_update(hash_op, in, in_len); - if (status) return status; - status = psa_driver_wrapper_hash_update(hash_op, counter, sizeof counter); - if (status) return status; - status = psa_driver_wrapper_hash_finish(hash_op, mask, hash_len, &length); - if (status) return status; - block_len = hash_len; - if (block_len > data_len) block_len = data_len; - oberon_xor(data, data, mask, block_len); - data += block_len; - data_len -= block_len; - counter[3]++; - } - - return PSA_SUCCESS; -} -#endif /* PSA_NEED_OBERON_RSA_PSS || PSA_NEED_OBERON_RSA_OAEP */ - -// PSS padding - -#ifdef PSA_NEED_OBERON_RSA_PSS -static psa_status_t emsa_pss_encode( - psa_algorithm_t hash_alg, - const uint8_t *hash, size_t hash_len, - uint8_t *em, size_t em_len) -{ - psa_status_t status; - size_t db_len = em_len - hash_len - 1; - uint8_t *h = &em[db_len]; // em = db : hash : 0xbc - uint8_t *salt; - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - size_t salt_len, length; - - // salt length = max length <= hash length - salt_len = hash_len; - if (salt_len >= db_len) salt_len = db_len - 1; - memset(em, 0, db_len); // db - salt = &em[db_len - salt_len]; // db = 0..0 : 1 : salt - - // salt - status = psa_generate_random(salt, salt_len); - if (status) return status; - - status = psa_driver_wrapper_hash_setup(&hash_op, hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, zero, 8); // 8 zero bytes - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, hash, hash_len); // mHash - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, salt, salt_len); // salt - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, h, hash_len, &length); // H - if (status) goto exit; - - em[db_len - salt_len - 1] = 1; - status = oberon_apply_mgf(&hash_op, hash_alg, h, hash_len, em, db_len); // db^mgf(H) - if (status) goto exit; - em[em_len - 1] = 0xBC; - em[0] &= 0x7F; // truncate to key_bits - 1 - - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_hash_abort(&hash_op); - return status; -} - -static psa_status_t emsa_pss_verify( - psa_algorithm_t hash_alg, - const uint8_t *hash, size_t hash_len, - size_t salt_len, - uint8_t *em, size_t em_len) -{ - psa_status_t status; - size_t db_len = em_len - hash_len - 1; - uint8_t *h = &em[db_len]; // em = db : H : 0xbc - uint8_t h1[PSA_HASH_MAX_SIZE]; - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - size_t z, length; - int diff; - - // verify signature - diff = (int)(em[em_len - 1] ^ 0xBC); // check em[last] == 0xBC - diff |= (int)(em[0] & 0x80); // check (em[0] & 0x80) == 0 - - status = oberon_apply_mgf(&hash_op, hash_alg, h, hash_len, em, db_len); // db^mgf(H) - if (status) goto exit; - em[0] &= 0x7F; // truncate to key_bits - 1 - - if (salt_len == 0) { - // get salt length from input - for (z = 0; z < db_len - 1 && em[z] == 0; z++); - salt_len = db_len - 1 - z; - } else { - // reduce salt length if needed - if (salt_len >= db_len) salt_len = db_len - 1; - z = db_len - salt_len - 1; - } - - if (z > 0) { - diff |= oberon_ct_compare_zero(em, z); - } - diff |= (int)(em[z] ^ 1); // check em[db_len - s_len - 1] == 1 - - status = psa_driver_wrapper_hash_setup(&hash_op, hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, zero, 8); // 8 zero bytes - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, hash, hash_len); // mHash - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, &em[db_len - salt_len], salt_len); // salt - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, h1, hash_len, &length); // H - if (status) goto exit; - - diff |= oberon_ct_compare(h1, h, hash_len); // H == H' - if (diff) return PSA_ERROR_INVALID_SIGNATURE; - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_hash_abort(&hash_op); - return status; -} -#endif /* PSA_NEED_OBERON_RSA_PSS */ - -// OAEP padding - -#ifdef PSA_NEED_OBERON_RSA_OAEP -static psa_status_t eme_oaep_encode( - psa_algorithm_t hash_alg, - const uint8_t *m, size_t m_len, - const uint8_t *label, size_t label_len, - uint8_t *em, size_t em_len) -{ - size_t hash_len = PSA_HASH_LENGTH(hash_alg); - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - psa_status_t status; - size_t length; - - uint8_t *seed = &em[1]; - uint8_t *db = &em[1 + hash_len]; - size_t db_len = em_len - 1 - hash_len; - - if (m_len > em_len - 2 * hash_len - 2) return PSA_ERROR_INVALID_ARGUMENT; - - status = psa_generate_random(seed, hash_len); - if (status) return status; - - // db = lhash : {0} : 1 : m - memset(em, 0, em_len); - status = psa_driver_wrapper_hash_setup(&hash_op, hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, label, label_len); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, db, hash_len, &length); // lhash - if (status) goto exit; - em[em_len - 1 - m_len] = 1; // 1 - memcpy(&em[em_len - m_len], m, m_len); // m - - // em = 0 : seed^mgf : db^mgf - status = oberon_apply_mgf(&hash_op, hash_alg, seed, hash_len, db, db_len); // db ^= mgf(seed) - if (status) goto exit; - status = oberon_apply_mgf(&hash_op, hash_alg, db, db_len, seed, hash_len); // seed ^= mgf(db) - if (status) goto exit; - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_hash_abort(&hash_op); - return status; -} - -static psa_status_t eme_oaep_decode( - psa_algorithm_t hash_alg, - uint8_t *em, size_t em_len, - const uint8_t *label, size_t label_len, - uint8_t *m, size_t m_size, size_t *m_len) -{ - size_t hash_len = PSA_HASH_LENGTH(hash_alg); - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - psa_status_t status; - size_t i, inc, length; - int diff; - - uint8_t *seed = &em[1]; - uint8_t *db = &em[1 + hash_len]; - size_t db_len = em_len - 1 - hash_len; - - if (em_len < 2 * hash_len + 2) return PSA_ERROR_INVALID_ARGUMENT; - diff = (int)em[0]; // check em[0] == 0 - - status = oberon_apply_mgf(&hash_op, hash_alg, db, db_len, seed, hash_len); // seed ^= mgf(db) - if (status) goto exit; - status = oberon_apply_mgf(&hash_op, hash_alg, seed, hash_len, db, db_len); // db ^= mgf(seed) - if (status) goto exit; - - status = psa_driver_wrapper_hash_setup(&hash_op, hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, label, label_len); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, seed, hash_len, &length); // lhash - if (status) goto exit; - diff |= oberon_ct_compare(seed, db, hash_len); // lhash == lhash' ? - - // db = lhash' : {0} : 1 : m - length = db_len - hash_len - 1; - inc = 1; - for (i = hash_len; i < db_len - 1; i++) { - inc &= IS_ZERO(db[i]); - length -= inc; - } - diff |= (int)(db[db_len - length - 1] ^ 1); // check db[i] == 1 - if (diff) return PSA_ERROR_INVALID_PADDING; - - if (length > m_size) return PSA_ERROR_BUFFER_TOO_SMALL; - *m_len = length; - memcpy(m, db + db_len - length, length); - return PSA_SUCCESS; - -exit: - psa_driver_wrapper_hash_abort(&hash_op); - return status; -} -#endif /* PSA_NEED_OBERON_RSA_OAEP */ - - -// PKCS#1 v1.5 padding - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_SIGN - -// PKCS#1 v1.5 hash digest -#ifdef PSA_WANT_ALG_SHA_1 -static const uint8_t DIGEST_INFO_SHA1[] = { - 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, - 0x1a, 0x05, 0x00, 0x04, 0x14}; -#endif -#ifdef PSA_WANT_ALG_SHA_224 -static const uint8_t DIGEST_INFO_SHA224[] = { - 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}; -#endif -#ifdef PSA_WANT_ALG_SHA_256 -static const uint8_t DIGEST_INFO_SHA256[] = { - 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}; -#endif -#ifdef PSA_WANT_ALG_SHA_384 -static const uint8_t DIGEST_INFO_SHA384[] = { - 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}; -#endif -#ifdef PSA_WANT_ALG_SHA_512 -static const uint8_t DIGEST_INFO_SHA512[] = { - 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}; -#endif -#ifdef PSA_WANT_ALG_SHA3_224 -static const uint8_t DIGEST_INFO_SHA3_224[] = { - 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x07, 0x05, 0x00, 0x04, 0x1c}; -#endif -#ifdef PSA_WANT_ALG_SHA3_256 -static const uint8_t DIGEST_INFO_SHA3_256[] = { - 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x08, 0x05, 0x00, 0x04, 0x20}; -#endif -#ifdef PSA_WANT_ALG_SHA3_384 -static const uint8_t DIGEST_INFO_SHA3_384[] = { - 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x09, 0x05, 0x00, 0x04, 0x30}; -#endif -#ifdef PSA_WANT_ALG_SHA3_512 -static const uint8_t DIGEST_INFO_SHA3_512[] = { - 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, - 0x65, 0x03, 0x04, 0x02, 0x0A, 0x05, 0x00, 0x04, 0x40}; -#endif - -static psa_status_t emsa_pkcs1_v15_get_digest( - psa_algorithm_t hash_alg, - const uint8_t **digest, size_t *d_len) -{ - switch (hash_alg) { -#ifdef PSA_WANT_ALG_SHA_1 - case PSA_ALG_SHA_1: - *digest = DIGEST_INFO_SHA1; - *d_len = sizeof DIGEST_INFO_SHA1; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA_224 - case PSA_ALG_SHA_224: - *digest = DIGEST_INFO_SHA224; - *d_len = sizeof DIGEST_INFO_SHA224; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA_256 - case PSA_ALG_SHA_256: - *digest = DIGEST_INFO_SHA256; - *d_len = sizeof DIGEST_INFO_SHA256; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA_384 - case PSA_ALG_SHA_384: - *digest = DIGEST_INFO_SHA384; - *d_len = sizeof DIGEST_INFO_SHA384; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA_512 - case PSA_ALG_SHA_512: - *digest = DIGEST_INFO_SHA512; - *d_len = sizeof DIGEST_INFO_SHA512; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA3_224 - case PSA_ALG_SHA3_224: - *digest = DIGEST_INFO_SHA3_224; - *d_len = sizeof DIGEST_INFO_SHA3_224; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA3_256 - case PSA_ALG_SHA3_256: - *digest = DIGEST_INFO_SHA3_256; - *d_len = sizeof DIGEST_INFO_SHA3_256; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA3_384 - case PSA_ALG_SHA3_384: - *digest = DIGEST_INFO_SHA3_384; - *d_len = sizeof DIGEST_INFO_SHA3_384; - return PSA_SUCCESS; -#endif -#ifdef PSA_WANT_ALG_SHA3_512 - case PSA_ALG_SHA3_512: - *digest = DIGEST_INFO_SHA3_512; - *d_len = sizeof DIGEST_INFO_SHA3_512; - return PSA_SUCCESS; -#endif - default: - (void)digest; - (void)d_len; - return PSA_ERROR_NOT_SUPPORTED; - } -} - -static psa_status_t emsa_pkcs1_v15_encode( - psa_algorithm_t hash_alg, - const uint8_t *input, size_t input_len, - uint8_t *em, size_t em_len) -{ - psa_status_t status; - size_t n, d_len = 0, t_len; - const uint8_t *digest = NULL; - - if (hash_alg != PSA_ALG_NONE) { - status = emsa_pkcs1_v15_get_digest(hash_alg, &digest, &d_len); - if (status) return status; - } - - t_len = d_len + input_len; - if (em_len < t_len + 11) return PSA_ERROR_INVALID_ARGUMENT; - n = em_len - t_len; - em[0] = 0; - em[1] = 1; - memset(&em[2], 0xFF, n - 3); - em[n - 1] = 0; - if (d_len) memcpy(&em[n], digest, d_len); - memcpy(&em[n + d_len], input, input_len); - - return PSA_SUCCESS; -} - -static psa_status_t emsa_pkcs1_v15_verify( - psa_algorithm_t hash_alg, - const uint8_t *hash, size_t hash_len, - uint8_t *em, size_t em_len) -{ - psa_status_t status; - size_t i, n, d_len = 0, t_len; - const uint8_t *digest = NULL; - int diff; - - if (hash_alg != PSA_ALG_NONE) { - status = emsa_pkcs1_v15_get_digest(hash_alg, &digest, &d_len); - if (status) return status; - } - - t_len = d_len + hash_len; - if (em_len < t_len + 11) return PSA_ERROR_INVALID_SIGNATURE; - n = em_len - t_len; - - diff = (int)em[0]; // check em[0] == 0 - diff |= (int)(em[1] ^ 1); // check em[1] == 1 - for (i = 2; i < n - 1; i++) diff |= (int)(em[i] ^ 0xFF); // check em[i] == 0xFF - diff |= (int)em[n - 1]; // check em[n-1] == 0 - if (d_len) diff |= oberon_ct_compare(&em[n], digest, d_len); - diff |= oberon_ct_compare(&em[n + d_len], hash, hash_len); - if (diff) return PSA_ERROR_INVALID_SIGNATURE; - - return PSA_SUCCESS; -} -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_SIGN */ - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT -static psa_status_t eme_pkcs1_v15_encode( - const uint8_t *m, size_t m_len, - uint8_t *em, size_t em_len) -{ - psa_status_t status; - uint32_t seed; - size_t i; - - if (em_len < m_len + 11) return PSA_ERROR_INVALID_ARGUMENT; - - // generate non-zero random bytes - status = psa_generate_random(em, em_len - m_len - 1); - if (status) return status; - seed = (em[0] << 16) + (em[1] << 8); - for (i = 2; i < em_len - m_len - 1; i++) { - seed ^= em[i]; // 0 .. 0xFFFFFF - seed *= 255; // 0 .. 0xFEFFFF01 - em[i] = (uint8_t)((seed >> 24) + 1); // 1 .. 255 - seed &= 0xFFFFFF; - } - - // em = 0 : 2 : {rnd} : 0 : m - em[0] = 0; - em[1] = 2; - em[em_len - m_len - 1] = 0; - memcpy(&em[em_len - m_len], m, m_len); - - return PSA_SUCCESS; -} - -static psa_status_t eme_pkcs1_v15_decode( - const uint8_t *em, size_t em_len, - uint8_t *m, size_t m_size, size_t *m_len) -{ - size_t i, inc, length; - int diff; - - // em = 0 : 2 : {rnd} : 0 : m - diff = (int)em[0]; // check em[0] == 0 - diff |= (int)(em[1] ^ 2); // check em[1] == 2 - for (i = 2; i < 10; i++) { - diff |= IS_ZERO(em[i]); // check em[i] != 0 - } - length = 0; - inc = 0; - for (i = 10; i < em_len - 1; i++) { - inc |= IS_ZERO(em[i]); - length += inc; - } - diff |= (int)(em[em_len - length - 1]); // check em[i] == 0 - if (diff) return PSA_ERROR_INVALID_PADDING; - - if (length > m_size) return PSA_ERROR_BUFFER_TOO_SMALL; - *m_len = length; - memcpy(m, &em[em_len - length], length); - - return PSA_SUCCESS; -} -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT */ - - -#if PSA_MAX_RSA_KEY_BITS > 0 -static psa_status_t rsa_key_setup( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - ocrypto_rsa_crt_key *crt_key, - ocrypto_rsa_pub_key *pub_key, - uint32_t *key_mem) -{ - int res = 0; - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - key_info_t key_info; - - key_info.type = psa_get_key_type(attributes); - status = oberon_parse_rsa_key(&key_info, key, key_length); - if (status) return status; - - switch (bits) { -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_1024 - case 1024: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_1536 - case 1536: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_2048 - case 2048: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_3072 - case 3072: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_4096 - case 4096: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_6144 - case 6144: -#endif -#ifdef PSA_NEED_OBERON_RSA_KEY_SIZE_8192 - case 8192: -#endif - if (crt_key) { - res = ocrypto_rsa_init_crt_key( - crt_key, key_mem, - key + key_info.p.index, key_info.p.length, - key + key_info.q.index, key_info.q.length, - key + key_info.dp.index, key_info.dp.length, - key + key_info.dq.index, key_info.dq.length, - key + key_info.qi.index, key_info.qi.length); - } - if (pub_key) { - res = ocrypto_rsa_init_pub_key( - pub_key, key_mem, - key + key_info.n.index, key_info.n.length, - key_info.e); - } - break; - default: - return PSA_ERROR_NOT_SUPPORTED; - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; - return PSA_SUCCESS; -} -#endif - -psa_status_t oberon_rsa_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length) -{ - int res; - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - size_t key_size = PSA_BITS_TO_BYTES(bits); -#if PSA_MAX_RSA_KEY_BITS > 0 - ocrypto_rsa_crt_key crt_key; - uint32_t key_mem[OCRYPTO_RSA_CRT_KEY_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint32_t mem[OCRYPTO_RSA_CRT_MEM_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint8_t *em = (uint8_t*)mem; -#endif - - if (type != PSA_KEY_TYPE_RSA_KEY_PAIR) return PSA_ERROR_NOT_SUPPORTED; - psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg); - if (hash_alg != 0 && hash_length != PSA_HASH_LENGTH(hash_alg)) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_size < key_size) return PSA_ERROR_BUFFER_TOO_SMALL; - *signature_length = key_size; - - // Get secret key - -#if PSA_MAX_RSA_KEY_BITS > 0 - status = rsa_key_setup(attributes, key, key_length, &crt_key, NULL, key_mem); - if (status) return status; -#endif - - // Apply padding - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_SIGN - if (PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg)) { - status = emsa_pkcs1_v15_encode(hash_alg, hash, hash_length, em, key_size); - if (status) return status; - } else -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_SIGN */ -#ifdef PSA_NEED_OBERON_RSA_PSS - if (PSA_ALG_IS_RSA_PSS(alg)) { - status = emsa_pss_encode(hash_alg, hash, hash_length, em, key_size); - if (status) return status; - } else -#endif /* PSA_NEED_OBERON_RSA_PSS */ - { - (void)key; - (void)key_length; - (void)signature; - (void)hash; - (void)res; - (void)status; - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; // ??? - } - - // RSA decryption primitive - -#if PSA_MAX_RSA_KEY_BITS > 0 - res = ocrypto_rsa_crt_exp(signature, key_size, em, key_size, &crt_key, mem); - if (res) return PSA_ERROR_INVALID_ARGUMENT; -#endif - - return PSA_SUCCESS; -} - -psa_status_t oberon_rsa_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length) -{ - int res; - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - size_t key_size = PSA_BITS_TO_BYTES(bits); -#if PSA_MAX_RSA_KEY_BITS > 0 - ocrypto_rsa_pub_key pub_key; - uint32_t key_mem[OCRYPTO_RSA_PUB_KEY_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint32_t mem[OCRYPTO_RSA_PUB_MEM_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint8_t *em = (uint8_t*)mem; -#endif - - if (!PSA_KEY_TYPE_IS_RSA(type)) return PSA_ERROR_NOT_SUPPORTED; - psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg); - if (hash_alg != 0 && hash_length != PSA_HASH_LENGTH(hash_alg)) return PSA_ERROR_INVALID_ARGUMENT; - if (signature_length != key_size) return PSA_ERROR_INVALID_SIGNATURE; - - // Get public key - -#if PSA_MAX_RSA_KEY_BITS > 0 - status = rsa_key_setup(attributes, key, key_length, NULL, &pub_key, key_mem); - if (status) return status; - - // RSA encryption primitive - - res = ocrypto_rsa_pub_exp(em, key_size, signature, key_size, &pub_key, mem); - if (res != 0) return PSA_ERROR_INVALID_SIGNATURE; -#endif - - // Check padding - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_SIGN - if (PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg)) { - return emsa_pkcs1_v15_verify(hash_alg, hash, hash_length, em, key_size); - } else -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_SIGN */ -#ifdef PSA_NEED_OBERON_RSA_PSS - if (PSA_ALG_IS_RSA_PSS(alg)) { - if (PSA_ALG_IS_RSA_PSS_ANY_SALT(alg)) { - return emsa_pss_verify(hash_alg, hash, hash_length, 0, em, key_size); - } else { - return emsa_pss_verify(hash_alg, hash, hash_length, hash_length, em, key_size); - } - } else -#endif /* PSA_NEED_OBERON_RSA_PSS */ - { - (void)key; - (void)key_length; - (void)signature; - (void)hash; - (void)res; - (void)status; - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; // ??? - } -} - -psa_status_t oberon_rsa_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - size_t key_size = PSA_BITS_TO_BYTES(bits); -#if PSA_MAX_RSA_KEY_BITS > 0 - ocrypto_rsa_pub_key pub_key; - uint32_t key_mem[OCRYPTO_RSA_PUB_KEY_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint32_t mem[OCRYPTO_RSA_PUB_MEM_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint8_t *em = (uint8_t*)mem; -#endif - - if (!PSA_KEY_TYPE_IS_RSA(type)) return PSA_ERROR_NOT_SUPPORTED; - if (output_size < key_size) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = key_size; - - // Get public key - -#if PSA_MAX_RSA_KEY_BITS > 0 - status = rsa_key_setup(attributes, key, key_length, NULL, &pub_key, key_mem); - if (status) return status; -#endif - - // Apply padding - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT - if (alg == PSA_ALG_RSA_PKCS1V15_CRYPT) { - status = eme_pkcs1_v15_encode(input, input_length, em, key_size); - if (status) return status; - } else -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT */ -#ifdef PSA_NEED_OBERON_RSA_OAEP - if (PSA_ALG_IS_RSA_OAEP(alg)) { - psa_algorithm_t hash_alg = PSA_ALG_RSA_OAEP_GET_HASH(alg); - status = eme_oaep_encode(hash_alg, input, input_length, salt, salt_length, em, key_size); - if (status) return status; - } else -#endif /* PSA_NEED_OBERON_RSA_OAEP */ - { - (void)key; - (void)key_length; - (void)alg; - (void)input; - (void)input_length; - (void)salt; - (void)salt_length; - (void)output; - (void)status; - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; // ??? - } - - // RSA encryption primitive - -#if PSA_MAX_RSA_KEY_BITS > 0 - ocrypto_rsa_pub_exp(output, key_size, em, key_size, &pub_key, mem); -#endif - - return PSA_SUCCESS; -} - -psa_status_t oberon_rsa_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res; - psa_status_t status; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - size_t key_size = PSA_BITS_TO_BYTES(bits); -#if PSA_MAX_RSA_KEY_BITS > 0 - ocrypto_rsa_crt_key crt_key; - uint32_t key_mem[OCRYPTO_RSA_CRT_KEY_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint32_t mem[OCRYPTO_RSA_CRT_MEM_SIZE(PSA_MAX_RSA_KEY_BITS)]; - uint8_t *em = (uint8_t*)mem; -#endif - - if (type != PSA_KEY_TYPE_RSA_KEY_PAIR) return PSA_ERROR_NOT_SUPPORTED; - - if (input_length != key_size) return PSA_ERROR_INVALID_ARGUMENT; - - - // Get secret key - -#if PSA_MAX_RSA_KEY_BITS > 0 - status = rsa_key_setup(attributes, key, key_length, &crt_key, NULL, key_mem); - if (status) return status; - - // RSA decryption primitive - - res = ocrypto_rsa_crt_exp(em, key_size, input, key_size, &crt_key, mem); - if (res) return PSA_ERROR_INVALID_ARGUMENT; -#endif - - // Check padding - -#ifdef PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT - if (alg == PSA_ALG_RSA_PKCS1V15_CRYPT) { - return eme_pkcs1_v15_decode(em, key_size, output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_RSA_PKCS1V15_CRYPT */ -#ifdef PSA_NEED_OBERON_RSA_OAEP - if (PSA_ALG_IS_RSA_OAEP(alg)) { - psa_algorithm_t hash_alg = PSA_ALG_RSA_OAEP_GET_HASH(alg); - return eme_oaep_decode(hash_alg, em, key_size, salt, salt_length, output, output_size, output_length); - } else -#endif /* PSA_NEED_OBERON_RSA_OAEP */ - { - (void)alg; - (void)key; - (void)key_length; - (void)input; - (void)salt; - (void)salt_length; - (void)output; - (void)output_size; - (void)output_length; - (void)res; - (void)status; - return PSA_ERROR_INVALID_ARGUMENT; // PSA_ERROR_NOT_SUPPORTED; // ??? - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_rsa.h b/ext/oberon/psa/drivers/oberon_rsa.h deleted file mode 100644 index 489466975b1d..000000000000 --- a/ext/oberon/psa/drivers/oberon_rsa.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. - -#ifndef OBERON_RSA_SIGNATURES_H -#define OBERON_RSA_SIGNATURES_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - - psa_status_t oberon_export_rsa_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length); - - psa_status_t oberon_import_rsa_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *bits); - - - psa_status_t oberon_rsa_sign_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - uint8_t *signature, size_t signature_size, size_t *signature_length); - - psa_status_t oberon_rsa_verify_hash( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - psa_algorithm_t alg, - const uint8_t *hash, size_t hash_length, - const uint8_t *signature, size_t signature_length); - - - psa_status_t oberon_rsa_encrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length); - - psa_status_t oberon_rsa_decrypt( - const psa_key_attributes_t *attributes, - const uint8_t *key_buffer, size_t key_buffer_size, - psa_algorithm_t alg, - const uint8_t *input, size_t input_length, - const uint8_t *salt, size_t salt_length, - uint8_t *output, size_t output_size, size_t *output_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_spake2p.c b/ext/oberon/psa/drivers/oberon_spake2p.c deleted file mode 100644 index 4d4ff39e680d..000000000000 --- a/ext/oberon/psa/drivers/oberon_spake2p.c +++ /dev/null @@ -1,589 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. -// Different from the draft spec, the setup function has parameters, in order to -// enable an implementation without memory allocation in the driver. - -#include - -#include "psa/crypto.h" -#include "oberon_spake2p.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - -#include "ocrypto_ecdh_p256.h" -#include "ocrypto_spake2p_p256.h" - - -#define P256_KEY_SIZE 32 -#define P256_POINT_SIZE 65 - - -// predefined 'random elements' -static const uint8_t M[P256_POINT_SIZE] = {0x04, - 0x88, 0x6e, 0x2f, 0x97, 0xac, 0xe4, 0x6e, 0x55, 0xba, 0x9d, 0xd7, 0x24, 0x25, 0x79, 0xf2, 0x99, - 0x3b, 0x64, 0xe1, 0x6e, 0xf3, 0xdc, 0xab, 0x95, 0xaf, 0xd4, 0x97, 0x33, 0x3d, 0x8f, 0xa1, 0x2f, - 0x5f, 0xf3, 0x55, 0x16, 0x3e, 0x43, 0xce, 0x22, 0x4e, 0x0b, 0x0e, 0x65, 0xff, 0x02, 0xac, 0x8e, - 0x5c, 0x7b, 0xe0, 0x94, 0x19, 0xc7, 0x85, 0xe0, 0xca, 0x54, 0x7d, 0x55, 0xa1, 0x2e, 0x2d, 0x20}; -static const uint8_t N[P256_POINT_SIZE] = {0x04, - 0xd8, 0xbb, 0xd6, 0xc6, 0x39, 0xc6, 0x29, 0x37, 0xb0, 0x4d, 0x99, 0x7f, 0x38, 0xc3, 0x77, 0x07, - 0x19, 0xc6, 0x29, 0xd7, 0x01, 0x4d, 0x49, 0xa2, 0x4b, 0x4f, 0x98, 0xba, 0xa1, 0x29, 0x2b, 0x49, - 0x07, 0xd6, 0x0a, 0xa6, 0xbf, 0xad, 0xe4, 0x50, 0x08, 0xa6, 0x36, 0x33, 0x7f, 0x51, 0x68, 0xc6, - 0x4d, 0x9b, 0xd3, 0x60, 0x34, 0x80, 0x8c, 0xd5, 0x64, 0x49, 0x0b, 0x1e, 0x65, 0x6e, 0xdb, 0xe7}; - - -static psa_status_t oberon_update_hash_with_prefix( - psa_hash_operation_t *hash_op, - const uint8_t *data, size_t data_len) -{ - psa_status_t status; - uint8_t len[8]; - - memset(len, 0, sizeof len); - len[0] = (uint8_t)data_len; - len[1] = (uint8_t)(data_len >> 8); - status = psa_driver_wrapper_hash_update(hash_op, len, sizeof len); - if (status != PSA_SUCCESS) goto exit; - status = psa_driver_wrapper_hash_update(hash_op, data, data_len); - if (status != PSA_SUCCESS) goto exit; - return PSA_SUCCESS; -exit: - psa_driver_wrapper_hash_abort(hash_op); - return status; -} - -static psa_status_t oberon_update_ids(oberon_spake2p_operation_t *op) -{ - psa_status_t status; - - // add idProver to TT - status = oberon_update_hash_with_prefix(&op->hash_op, op->prover, op->prover_len); - if (status != PSA_SUCCESS) return status; - // add idVerifier to TT - status = oberon_update_hash_with_prefix(&op->hash_op, op->verifier, op->verifier_len); - if (status != PSA_SUCCESS) return status; - // add M to TT - status = oberon_update_hash_with_prefix(&op->hash_op, M, sizeof M); - if (status != PSA_SUCCESS) return status; - // add N to TT - return oberon_update_hash_with_prefix(&op->hash_op, N, sizeof N); -} - -static psa_status_t oberon_write_key_share( - oberon_spake2p_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - int res; - psa_status_t status; - const uint8_t *mn; - - // random secret key - status = psa_generate_random(op->XY, 40); - if (status != PSA_SUCCESS) return status; - ocrypto_spake2p_p256_reduce(op->xy, op->XY, 40); - - mn = op->role == PSA_PAKE_ROLE_CLIENT ? M : N; - res = ocrypto_spake2p_p256_get_key_share(op->XY, op->w0, op->xy, mn); - if (res) return PSA_ERROR_INVALID_ARGUMENT; - - if (output_size < P256_POINT_SIZE) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(output, op->XY, P256_POINT_SIZE); - *output_length = P256_POINT_SIZE; - - if (op->role == PSA_PAKE_ROLE_CLIENT) { - // add ids, M, and N to TT - status = oberon_update_ids(op); - if (status != PSA_SUCCESS) return status; - } - - // add share to TT - return oberon_update_hash_with_prefix(&op->hash_op, op->XY, P256_POINT_SIZE); -} - -static psa_status_t oberon_read_key_share( - oberon_spake2p_operation_t *op, - const uint8_t *input, size_t input_length) -{ - psa_status_t status; - - if (input_length != P256_POINT_SIZE || input[0] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - memcpy(op->YX, input, P256_POINT_SIZE); - - if (op->role == PSA_PAKE_ROLE_SERVER) { - // add ids, M, and N to TT - status = oberon_update_ids(op); - if (status != PSA_SUCCESS) return status; - } - - // add share to TT - return oberon_update_hash_with_prefix(&op->hash_op, op->YX, P256_POINT_SIZE); -} - -static psa_status_t oberon_get_confirmation_keys( - oberon_spake2p_operation_t *op, - uint8_t *KconfP, uint8_t *KconfV) -{ - psa_status_t status; - psa_algorithm_t hkdf_alg = PSA_ALG_HKDF(PSA_ALG_GET_HASH(op->alg)); - psa_key_derivation_operation_t kdf_op = PSA_KEY_DERIVATION_OPERATION_INIT; - uint8_t Z[P256_POINT_SIZE]; - uint8_t V[P256_POINT_SIZE]; - size_t hash_len, conf_len = 0, shared_len = 0, mac_len = 0; - - // add Z, V, and w0 to TT - if (op->role == PSA_PAKE_ROLE_CLIENT) { - ocrypto_spake2p_p256_get_ZV(Z, V, op->w0, &op->w1L[1], op->xy, op->YX, N, NULL); - } else { - ocrypto_spake2p_p256_get_ZV(Z, V, op->w0, NULL, op->xy, op->YX, M, op->w1L); - } - status = oberon_update_hash_with_prefix(&op->hash_op, Z, P256_POINT_SIZE); - if (status) return status; - status = oberon_update_hash_with_prefix(&op->hash_op, V, P256_POINT_SIZE); - if (status) return status; - status = oberon_update_hash_with_prefix(&op->hash_op, op->w0, P256_KEY_SIZE); - if (status) return status; - - // get K_main - status = psa_driver_wrapper_hash_finish(&op->hash_op, V, sizeof V, &hash_len); - if (status) { - psa_driver_wrapper_hash_abort(&op->hash_op); - return status; - } - - // get K_shared -#ifdef PSA_NEED_OBERON_SPAKE2P_MATTER - if (op->alg == PSA_ALG_SPAKE2P_MATTER) { - // Spake2+ draft version 2 - conf_len = hash_len >> 1; // K_confirm is hash_len / 2 - shared_len = hash_len >> 1; // shared key size is hash_len / 2 - mac_len = hash_len; // mac size is hash_len - memcpy(op->shared, V + conf_len, shared_len); - } else -#endif - { -#if defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) || defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) - shared_len = hash_len; -#if defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) && defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) - if (PSA_ALG_IS_SPAKE2P_CMAC(op->alg)) { -#endif -#ifdef PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256 - mac_len = PSA_MAC_LENGTH(PSA_KEY_TYPE_AES, 128, PSA_ALG_CMAC); -#endif -#if defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) && defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) - } else { -#endif -#ifdef PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256 - mac_len = hash_len; -#endif -#if defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) && defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) - } -#endif - conf_len = mac_len; - status = psa_driver_wrapper_key_derivation_setup(&kdf_op, hkdf_alg); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_input_bytes(&kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (uint8_t *)"SharedKey", 9); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_input_bytes(&kdf_op, PSA_KEY_DERIVATION_INPUT_SECRET, V, hash_len); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_output_bytes(&kdf_op, op->shared, shared_len); - if (status) goto exit; - psa_key_derivation_abort(&kdf_op); -#endif /* PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256 || PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256 */ - } - - op->conf_len = (uint8_t)conf_len; - op->shared_len = (uint8_t)shared_len; - op->mac_len = (uint8_t)mac_len; - - // get K_confirmP & K_confirmV - status = psa_driver_wrapper_key_derivation_setup(&kdf_op, hkdf_alg); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_input_bytes(&kdf_op, PSA_KEY_DERIVATION_INPUT_INFO, (uint8_t *)"ConfirmationKeys", 16); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_input_bytes(&kdf_op, PSA_KEY_DERIVATION_INPUT_SECRET, V, conf_len); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_output_bytes(&kdf_op, KconfP, conf_len); - if (status) goto exit; - status = psa_driver_wrapper_key_derivation_output_bytes(&kdf_op, KconfV, conf_len); - -exit: - psa_driver_wrapper_key_derivation_abort(&kdf_op); - memset(Z, 0, sizeof Z); - memset(V, 0, sizeof V); - return status; -} - -static psa_status_t oberon_get_confirmation( - oberon_spake2p_operation_t *op, - const uint8_t *kconf, - const uint8_t *share, - uint8_t *conf) -{ - size_t length; - psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_algorithm_t mac_alg = 0; - -#if defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) && \ - (defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) || defined(PSA_NEED_OBERON_SPAKE2P_MATTER)) - if (PSA_ALG_IS_SPAKE2P_CMAC(op->alg)) { -#endif -#ifdef PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256 - mac_alg = PSA_ALG_CMAC; - psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); -#endif -#if defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) && \ - (defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) || defined(PSA_NEED_OBERON_SPAKE2P_MATTER)) - } else { -#endif -#if defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) || defined(PSA_NEED_OBERON_SPAKE2P_MATTER) - mac_alg = PSA_ALG_HMAC(PSA_ALG_GET_HASH(op->alg)); - psa_set_key_type(&attributes, PSA_KEY_TYPE_HMAC); -#endif -#if defined(PSA_NEED_OBERON_SPAKE2P_CMAC_SECP_R1_256) && \ - (defined(PSA_NEED_OBERON_SPAKE2P_HMAC_SECP_R1_256) || defined(PSA_NEED_OBERON_SPAKE2P_MATTER)) - } -#endif - - psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_MESSAGE); - psa_set_key_algorithm(&attributes, mac_alg); - - return psa_driver_wrapper_mac_compute( - &attributes, kconf, op->conf_len, - mac_alg, - share, P256_POINT_SIZE, - conf, op->mac_len, &length); -} - -static psa_status_t oberon_write_confirm( - oberon_spake2p_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_status_t status; - - if (op->role == PSA_PAKE_ROLE_SERVER) { - status = oberon_get_confirmation_keys(op, op->KconfVP, op->KconfPV); - if (status) return status; - } - - if (output_size < op->mac_len) return PSA_ERROR_BUFFER_TOO_SMALL; - status = oberon_get_confirmation(op, op->KconfPV, op->YX, output); - if (status) return status; - *output_length = op->mac_len; - - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_confirm( - oberon_spake2p_operation_t *op, - const uint8_t *input, size_t input_length) -{ - psa_status_t status; - uint8_t conf[PSA_HASH_MAX_SIZE]; - - if (op->role == PSA_PAKE_ROLE_CLIENT) { - status = oberon_get_confirmation_keys(op, op->KconfPV, op->KconfVP); - if (status) return status; - } - - status = oberon_get_confirmation(op, op->KconfVP, op->XY, conf); - if (status) return status; - - if (input_length != op->mac_len) return PSA_ERROR_INVALID_SIGNATURE; - if (oberon_ct_compare(input, conf, op->mac_len)) return PSA_ERROR_INVALID_SIGNATURE; - - return PSA_SUCCESS; -} - - -psa_status_t oberon_spake2p_setup( - oberon_spake2p_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite) -{ - (void)attributes; - - if (psa_pake_cs_get_primitive(cipher_suite) != - PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, PSA_ECC_FAMILY_SECP_R1, 256) || - psa_pake_cs_get_key_confirmation(cipher_suite) != PSA_PAKE_CONFIRMED_KEY) { - return PSA_ERROR_NOT_SUPPORTED; - } - - if (password_length == 2 * P256_KEY_SIZE) { - // password = w0:w1 - memcpy(operation->w0, password, P256_KEY_SIZE); - password += P256_KEY_SIZE; - operation->w1L[0] = 0; // w1L is 0x00:w1 - ocrypto_spake2p_p256_reduce(&operation->w1L[1], password, P256_KEY_SIZE); - } else if (password_length == P256_KEY_SIZE + P256_POINT_SIZE) { - // password = w0:L - memcpy(operation->w0, password, P256_KEY_SIZE); - password += P256_KEY_SIZE; - memcpy(operation->w1L, password, P256_POINT_SIZE); // w1L is L = 0x04:x:y - } else { - return PSA_ERROR_INVALID_ARGUMENT; - } - - // prepare TT calculation - operation->alg = psa_pake_cs_get_algorithm(cipher_suite); - return psa_driver_wrapper_hash_setup(&operation->hash_op, PSA_ALG_GET_HASH(operation->alg)); -} - -psa_status_t oberon_spake2p_set_role( - oberon_spake2p_operation_t *operation, - psa_pake_role_t role) -{ - if (role == PSA_PAKE_ROLE_CLIENT) { - if (operation->w1L[0] == 0x04) return PSA_ERROR_INVALID_ARGUMENT; - } else { - if (operation->w1L[0] != 0x04) { // secret key -> public key - operation->w1L[0] = 0x04; - ocrypto_ecdh_p256_public_key(&operation->w1L[1], &operation->w1L[1]); - } - } - operation->role = role; - return PSA_SUCCESS; -} - -psa_status_t oberon_spake2p_set_user( - oberon_spake2p_operation_t *operation, - const uint8_t *user_id, size_t user_id_len) -{ - if (operation->role == PSA_PAKE_ROLE_CLIENT) { - // prover = user; verifier = peer - if (user_id_len > sizeof operation->prover) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(operation->prover, user_id, user_id_len); - operation->prover_len = (uint8_t)user_id_len; - } else { /* role == PSA_PAKE_ROLE_SERVER */ - // prover = peer; verifier = user - if (user_id_len > sizeof operation->verifier) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(operation->verifier, user_id, user_id_len); - operation->verifier_len = (uint8_t)user_id_len; - } - return PSA_SUCCESS; -} - -psa_status_t oberon_spake2p_set_peer( - oberon_spake2p_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len) -{ - if (operation->role == PSA_PAKE_ROLE_CLIENT) { - // prover = user; verifier = peer - if (peer_id_len > sizeof operation->verifier) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(operation->verifier, peer_id, peer_id_len); - operation->verifier_len = (uint8_t)peer_id_len; - } else { /* role == PSA_PAKE_ROLE_SERVER */ - // prover = peer; verifier = user - if (peer_id_len > sizeof operation->prover) { - return PSA_ERROR_INSUFFICIENT_MEMORY; - } - memcpy(operation->prover, peer_id, peer_id_len); - operation->prover_len = (uint8_t)peer_id_len; - } - return PSA_SUCCESS; -} - -psa_status_t oberon_spake2p_set_context( - oberon_spake2p_operation_t *operation, - const uint8_t *context, size_t context_len) -{ - if (context_len == 0) return PSA_SUCCESS; - - // add context to TT - return oberon_update_hash_with_prefix( - &operation->hash_op, - context, context_len); -} - -psa_status_t oberon_spake2p_output( - oberon_spake2p_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length) -{ - switch (step) { - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_write_key_share( - operation, - output, output_size, output_length); - case PSA_PAKE_STEP_CONFIRM: - return oberon_write_confirm( - operation, - output, output_size, output_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_spake2p_input( - oberon_spake2p_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length) -{ - switch (step) { - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_read_key_share( - operation, - input, input_length); - case PSA_PAKE_STEP_CONFIRM: - return oberon_read_confirm( - operation, - input, input_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_spake2p_get_shared_key( - oberon_spake2p_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length) -{ - size_t shared_len = operation->shared_len; - if (output_size < shared_len) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(output, operation->shared, shared_len); - *output_length = shared_len; - return PSA_SUCCESS; -} - -psa_status_t oberon_spake2p_abort( - oberon_spake2p_operation_t *operation) -{ - return psa_driver_wrapper_hash_abort(&operation->hash_op); -} - - -// key management - -psa_status_t oberon_derive_spake2p_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length) -{ - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 - case PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (bits != 256) return PSA_ERROR_NOT_SUPPORTED; - if (input_length != 80) return PSA_ERROR_INVALID_ARGUMENT; - if (key_size < 64) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_spake2p_p256_reduce(key, input, 40); // w0s -> w0 - if (!oberon_ct_compare_zero(key, 32)) return PSA_ERROR_INVALID_ARGUMENT; - ocrypto_spake2p_p256_reduce(key + 32, input + 40, 40); // w1s -> w1 - if (!oberon_ct_compare_zero(key + 32, 32)) return PSA_ERROR_INVALID_ARGUMENT; - *key_length = 64; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 */ - - default: - (void)input; - (void)input_length; - (void)key; - (void)key_size; - (void)key_length; - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} - -psa_status_t oberon_import_spake2p_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *key_bits) -{ - int res; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 - case PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (data_length != 64) return PSA_ERROR_NOT_SUPPORTED; - if (bits != 0 && (bits != 256)) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 32)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_secret_key_check(data); - if (res) return PSA_ERROR_INVALID_ARGUMENT; // out of range - if (!oberon_ct_compare_zero(data + 32, 32)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_secret_key_check(data + 32); - if (res) return PSA_ERROR_INVALID_ARGUMENT; // out of range - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 - case PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1): - if (data_length != 32 + 65) return PSA_ERROR_NOT_SUPPORTED; - if (bits != 0 && (bits != 256)) return PSA_ERROR_INVALID_ARGUMENT; - if (!oberon_ct_compare_zero(data, 32)) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_secret_key_check(data); - if (res) return PSA_ERROR_INVALID_ARGUMENT; // out of range - if (data[32] != 0x04) return PSA_ERROR_INVALID_ARGUMENT; - res = ocrypto_ecdh_p256_public_key_check(&data[33]); - if (res) return PSA_ERROR_INVALID_ARGUMENT; // point not on curve - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 */ - - default: - (void)res; - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - if (key_size < data_length) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(key, data, data_length); - *key_length = data_length; - *key_bits = 256; - return PSA_SUCCESS; -} - -psa_status_t oberon_export_spake2p_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length) -{ - int res; - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { - if (key_length > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(data, key, key_length); - *data_length = key_length; - return PSA_SUCCESS; - } - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 - case PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): - if (bits != 256) return PSA_ERROR_NOT_SUPPORTED; - if (key_length != 64) return PSA_ERROR_INVALID_ARGUMENT; - if (data_size < 32 + 65) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(data, key, 32); // w0 - data[32] = 0x04; - res = ocrypto_ecdh_p256_public_key(&data[33], &key[32]); // w1 -> L - if (res) return PSA_ERROR_INVALID_ARGUMENT; - *data_length = 32 + 65; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 */ - default: - (void)res; - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_spake2p.h b/ext/oberon/psa/drivers/oberon_spake2p.h deleted file mode 100644 index 916123500257..000000000000 --- a/ext/oberon/psa/drivers/oberon_spake2p.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. -// Different from the draft spec, the setup function has parameters, in order to -// enable an implementation without memory allocation in the driver. - -#ifndef OBERON_SPAKE2P_H -#define OBERON_SPAKE2P_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - psa_hash_operation_t hash_op; // TT - psa_algorithm_t alg; - uint8_t w0[32]; - uint8_t w1L[65]; - uint8_t xy[32]; - uint8_t XY[65]; - uint8_t YX[65]; - uint8_t shared[PSA_HASH_MAX_SIZE]; - uint8_t KconfPV[PSA_HASH_MAX_SIZE]; - uint8_t KconfVP[PSA_HASH_MAX_SIZE]; - uint8_t prover[32]; - uint8_t verifier[32]; - uint8_t prover_len; - uint8_t verifier_len; - uint8_t shared_len; - uint8_t conf_len; - uint8_t mac_len; - psa_pake_role_t role; -} oberon_spake2p_operation_t; - - -psa_status_t oberon_spake2p_setup( - oberon_spake2p_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite); - -psa_status_t oberon_spake2p_set_role( - oberon_spake2p_operation_t *operation, - psa_pake_role_t role); - -psa_status_t oberon_spake2p_set_user( - oberon_spake2p_operation_t *operation, - const uint8_t *user_id, size_t user_id_len); - -psa_status_t oberon_spake2p_set_peer( - oberon_spake2p_operation_t *operation, - const uint8_t *peer_id, size_t peer_id_len); - -psa_status_t oberon_spake2p_set_context( - oberon_spake2p_operation_t *operation, - const uint8_t *context, size_t context_len); - -psa_status_t oberon_spake2p_output( - oberon_spake2p_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_spake2p_input( - oberon_spake2p_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_spake2p_get_shared_key( - oberon_spake2p_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_spake2p_abort( - oberon_spake2p_operation_t *operation); - - -psa_status_t oberon_derive_spake2p_key( - const psa_key_attributes_t *attributes, - const uint8_t *input, size_t input_length, - uint8_t *key, size_t key_size, size_t *key_length); - -psa_status_t oberon_import_spake2p_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *bits); - -psa_status_t oberon_export_spake2p_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ext/oberon/psa/drivers/oberon_srp.c b/ext/oberon/psa/drivers/oberon_srp.c deleted file mode 100644 index b6a7dffcea62..000000000000 --- a/ext/oberon/psa/drivers/oberon_srp.c +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file implements functions from the Arm PSA Crypto Driver API. -// Different from the draft spec, the setup function has parameters, in order to -// enable an implementation without memory allocation in the driver. - -#include - -#include "psa/crypto.h" -#include "oberon_srp.h" -#include "oberon_helpers.h" -#include "psa_crypto_driver_wrappers.h" - -#include "ocrypto_srp.h" - -#define SRP_FIELD_BITS 3072 -#define SRP_FIELD_SIZE PSA_BITS_TO_BYTES(SRP_FIELD_BITS) - - -static const uint8_t oberon_P3072[SRP_FIELD_SIZE] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, - 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, - 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, - 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, - 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, - 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, - 0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, 0xAE, 0x9F, 0x24, 0x11, 0x7C, 0x4B, 0x1F, 0xE6, - 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, 0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, - 0x98, 0xDA, 0x48, 0x36, 0x1C, 0x55, 0xD3, 0x9A, 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, - 0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, 0x1C, 0x62, 0xF3, 0x56, 0x20, 0x85, 0x52, 0xBB, - 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, 0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, - 0xF1, 0x74, 0x6C, 0x08, 0xCA, 0x18, 0x21, 0x7C, 0x32, 0x90, 0x5E, 0x46, 0x2E, 0x36, 0xCE, 0x3B, - 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, - 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, - 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, - 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAA, 0xC4, 0x2D, 0xAD, 0x33, 0x17, 0x0D, 0x04, 0x50, 0x7A, 0x33, - 0xA8, 0x55, 0x21, 0xAB, 0xDF, 0x1C, 0xBA, 0x64, 0xEC, 0xFB, 0x85, 0x04, 0x58, 0xDB, 0xEF, 0x0A, - 0x8A, 0xEA, 0x71, 0x57, 0x5D, 0x06, 0x0C, 0x7D, 0xB3, 0x97, 0x0F, 0x85, 0xA6, 0xE1, 0xE4, 0xC7, - 0xAB, 0xF5, 0xAE, 0x8C, 0xDB, 0x09, 0x33, 0xD7, 0x1E, 0x8C, 0x94, 0xE0, 0x4A, 0x25, 0x61, 0x9D, - 0xCE, 0xE3, 0xD2, 0x26, 0x1A, 0xD2, 0xEE, 0x6B, 0xF1, 0x2F, 0xFA, 0x06, 0xD9, 0x8A, 0x08, 0x64, - 0xD8, 0x76, 0x02, 0x73, 0x3E, 0xC8, 0x6A, 0x64, 0x52, 0x1F, 0x2B, 0x18, 0x17, 0x7B, 0x20, 0x0C, - 0xBB, 0xE1, 0x17, 0x57, 0x7A, 0x61, 0x5D, 0x6C, 0x77, 0x09, 0x88, 0xC0, 0xBA, 0xD9, 0x46, 0xE2, - 0x08, 0xE2, 0x4F, 0xA0, 0x74, 0xE5, 0xAB, 0x31, 0x43, 0xDB, 0x5B, 0xFC, 0xE0, 0xFD, 0x10, 0x8E, - 0x4B, 0x82, 0xD1, 0x20, 0xA9, 0x3A, 0xD2, 0xCA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; -static const uint8_t oberon_G3072[] = {5}; - - -// hash of number with removed leading zeroes -static psa_status_t oberon_srp_hash_add_stripped(psa_hash_operation_t *op, const uint8_t *data, uint32_t dlen) -{ - while(dlen > 0 && *data == 0) { // skip leading zero bytes - data++; - dlen--; - } - return psa_driver_wrapper_hash_update(op, data, dlen); -} - -static psa_status_t oberon_get_multiplier(oberon_srp_operation_t *op, psa_hash_operation_t *hash_op, uint8_t *k) -{ - psa_status_t status; - size_t length; - - // k = H(p | pad(g)) - memset(k, 0, SRP_FIELD_SIZE); - status = psa_driver_wrapper_hash_setup(hash_op, op->hash_alg); - if (status) return status; - status = psa_driver_wrapper_hash_update(hash_op, oberon_P3072, sizeof oberon_P3072); - if (status) return status; - status = psa_driver_wrapper_hash_update(hash_op, k, SRP_FIELD_SIZE - sizeof oberon_G3072); - if (status) return status; - status = psa_driver_wrapper_hash_update(hash_op, oberon_G3072, sizeof oberon_G3072); - if (status) return status; - return psa_driver_wrapper_hash_finish(hash_op, k + SRP_FIELD_SIZE - op->hash_len, op->hash_len, &length); -} - -static psa_status_t oberon_get_proof(oberon_srp_operation_t *op) -{ - psa_status_t status; - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - uint8_t s[SRP_FIELD_SIZE]; - size_t hash_len; - int res; - - // u = H(pad(A) | pad(B)); - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->A, SRP_FIELD_SIZE); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->B, SRP_FIELD_SIZE); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->m1, sizeof op->m1, &hash_len); - if (status) goto exit; - - if (op->role == PSA_PAKE_ROLE_CLIENT) { - // k = 0 | H(p | pad(g)) - status = oberon_get_multiplier(op, &hash_op, s); - if (status) goto exit; - // X = B - (k * g^pw), S = X^a * X^u^pw - res = ocrypto_srp_client_premaster_secret(s, op->ab, op->B, s, op->m1, op->password, hash_len); - } else { - // S = (A * v^u) ^ b - res = ocrypto_srp_server_premaster_secret(s, op->A, op->ab, op->m1, hash_len, op->password); - } - if (res) return PSA_ERROR_INVALID_ARGUMENT; - - // session key k = H(s) - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = oberon_srp_hash_add_stripped(&hash_op, s, SRP_FIELD_SIZE); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->k, sizeof op->k, &hash_len); - if (status) goto exit; - - // H(p) - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, oberon_P3072, sizeof oberon_P3072); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->m1, sizeof op->m1, &hash_len); - if (status) goto exit; - - // H(g) - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, oberon_G3072, sizeof oberon_G3072); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->m2, sizeof op->m2, &hash_len); - if (status) goto exit; - - // H(p) ^ H(g) - oberon_xor(op->m2, op->m2, op->m1, hash_len); - - // m1 = H(H(p) ^ H(g) | H(user) | salt | A | B | k) - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->m2, hash_len); // H(p) ^ H(g) - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->user, hash_len); // H(user) - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->salt, op->salt_len); - if (status) goto exit; - status = oberon_srp_hash_add_stripped(&hash_op, op->A, SRP_FIELD_SIZE); - if (status) goto exit; - status = oberon_srp_hash_add_stripped(&hash_op, op->B, SRP_FIELD_SIZE); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->k, hash_len); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->m1, sizeof op->m1, &hash_len); - if (status) goto exit; - - // m2 = H(A | m1 | k) - status = psa_driver_wrapper_hash_setup(&hash_op, op->hash_alg); - if (status) goto exit; - status = oberon_srp_hash_add_stripped(&hash_op, op->A, SRP_FIELD_SIZE); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->m1, hash_len); - if (status) goto exit; - status = psa_driver_wrapper_hash_update(&hash_op, op->k, hash_len); - if (status) goto exit; - status = psa_driver_wrapper_hash_finish(&hash_op, op->m2, sizeof op->m2, &hash_len); - if (status) goto exit; - - return PSA_SUCCESS; -exit: - psa_hash_abort(&hash_op); - memset(s, 0, sizeof s); - return status; -} - -static psa_status_t oberon_write_key_share( - oberon_srp_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_status_t status; - psa_hash_operation_t hash_op = PSA_HASH_OPERATION_INIT; - - // random secret key - status = psa_generate_random(op->ab, sizeof op->ab); - if (status != PSA_SUCCESS) return status; - - if (output_size < SRP_FIELD_SIZE) return PSA_ERROR_BUFFER_TOO_SMALL; - *output_length = SRP_FIELD_SIZE; - if (op->role == PSA_PAKE_ROLE_CLIENT) { - // A = g^a - ocrypto_srp_client_public_key(op->A, op->ab, sizeof op->ab); - memcpy(output, op->A, SRP_FIELD_SIZE); - } else { - // k = H(p | g) - status = oberon_get_multiplier(op, &hash_op, op->B); - if (status) return status; - // B = k*v + g^b - ocrypto_srp_server_public_key(op->B, op->ab, op->B, op->password); - memcpy(output, op->B, SRP_FIELD_SIZE); - } - - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_key_share( - oberon_srp_operation_t *op, - const uint8_t *input, size_t input_length) -{ - if (input_length != SRP_FIELD_SIZE) return PSA_ERROR_INVALID_ARGUMENT; - if (op->role == PSA_PAKE_ROLE_CLIENT) { - memcpy(op->B, input, SRP_FIELD_SIZE); - } else { - memcpy(op->A, input, SRP_FIELD_SIZE); - } - - return PSA_SUCCESS; -} - -static psa_status_t oberon_write_confirm( - oberon_srp_operation_t *op, - uint8_t *output, size_t output_size, size_t *output_length) -{ - psa_status_t status; - - if (output_size < op->hash_len) return PSA_ERROR_BUFFER_TOO_SMALL; - if (op->role == PSA_PAKE_ROLE_CLIENT) { - status = oberon_get_proof(op); - if (status) return status; - memcpy(output, op->m1, op->hash_len); - } else { - memcpy(output, op->m2, op->hash_len); - } - *output_length = op->hash_len; - - return PSA_SUCCESS; -} - -static psa_status_t oberon_read_confirm( - oberon_srp_operation_t *op, - const uint8_t *input, size_t input_length) -{ - psa_status_t status; - - if (input_length != op->hash_len) return PSA_ERROR_INVALID_SIGNATURE; - if (op->role == PSA_PAKE_ROLE_SERVER) { - status = oberon_get_proof(op); - if (status) return status; - if (oberon_ct_compare(input, op->m1, op->hash_len)) return PSA_ERROR_INVALID_SIGNATURE; - } else { - if (oberon_ct_compare(input, op->m2, op->hash_len)) return PSA_ERROR_INVALID_SIGNATURE; - } - - return PSA_SUCCESS; -} - - -psa_status_t oberon_srp_setup( - oberon_srp_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite) -{ - (void)attributes; - - if (psa_pake_cs_get_primitive(cipher_suite) != - PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_DH, PSA_DH_FAMILY_RFC3526, SRP_FIELD_BITS) || - psa_pake_cs_get_key_confirmation(cipher_suite) != PSA_PAKE_CONFIRMED_KEY) { - return PSA_ERROR_NOT_SUPPORTED; - } - - operation->hash_alg = PSA_ALG_GET_HASH(psa_pake_cs_get_algorithm(cipher_suite)); - operation->hash_len = PSA_HASH_LENGTH(operation->hash_alg); - - if (password_length != operation->hash_len && password_length != SRP_FIELD_SIZE) return PSA_ERROR_INVALID_ARGUMENT; - memcpy(operation->password, password, password_length); - operation->pw_len = (uint16_t)password_length; - - return PSA_SUCCESS; -} - -psa_status_t oberon_srp_set_role( - oberon_srp_operation_t *operation, - psa_pake_role_t role) -{ - if (role == PSA_PAKE_ROLE_CLIENT) { - if (operation->pw_len != operation->hash_len) return PSA_ERROR_INVALID_ARGUMENT; - } else { - if (operation->pw_len != SRP_FIELD_SIZE) { - ocrypto_srp_client_public_key(operation->password, operation->password, operation->pw_len); - } - } - operation->role = role; - return PSA_SUCCESS; -} - -psa_status_t oberon_srp_set_user( - oberon_srp_operation_t *operation, - const uint8_t *user_id, size_t user_id_len) -{ - size_t length; - - // store H(user) - return psa_driver_wrapper_hash_compute(operation->hash_alg, - user_id, user_id_len, - operation->user, sizeof operation->user, &length); -} - -psa_status_t oberon_srp_output( - oberon_srp_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length) -{ - switch (step) { - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_write_key_share( - operation, - output, output_size, output_length); - case PSA_PAKE_STEP_CONFIRM: - return oberon_write_confirm( - operation, - output, output_size, output_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_srp_input( - oberon_srp_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length) -{ - switch (step) { - case PSA_PAKE_STEP_SALT: - if (input_length > sizeof operation->salt) return PSA_ERROR_NOT_SUPPORTED; - memcpy(operation->salt, input, input_length); - operation->salt_len = (uint8_t)input_length; - return PSA_SUCCESS; - case PSA_PAKE_STEP_KEY_SHARE: - return oberon_read_key_share( - operation, - input, input_length); - case PSA_PAKE_STEP_CONFIRM: - return oberon_read_confirm( - operation, - input, input_length); - default: - return PSA_ERROR_INVALID_ARGUMENT; - } -} - -psa_status_t oberon_srp_get_shared_key( - oberon_srp_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length) -{ - if (output_size < operation->hash_len) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(output, operation->k, operation->hash_len); - *output_length = operation->hash_len; - return PSA_SUCCESS; -} - -psa_status_t oberon_srp_abort( - oberon_srp_operation_t *operation) -{ - (void)operation; - return PSA_SUCCESS; -} - - -// key management - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 -// constant-time big endian byte stream compare less than -static int less_than(const uint8_t *a, const uint8_t *b, size_t len) -{ - int i, c = 0; - for (i = len - 1; i >= 0; i--) { - c = (c + (int)a[i] - (int)b[i]) >> 8; - } - return c; -} -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 */ - -psa_status_t oberon_import_srp_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *key_bits) -{ - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 - case PSA_KEY_TYPE_SRP_KEY_PAIR(PSA_DH_FAMILY_RFC3526): - if (bits != SRP_FIELD_BITS) return PSA_ERROR_NOT_SUPPORTED; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 */ - -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 - case PSA_KEY_TYPE_SRP_PUBLIC_KEY(PSA_DH_FAMILY_RFC3526): - if (data_length != SRP_FIELD_SIZE) return PSA_ERROR_NOT_SUPPORTED; - if (bits != 0 && (bits != SRP_FIELD_BITS)) return PSA_ERROR_INVALID_ARGUMENT; - // check key < P - if (!less_than(data, oberon_P3072, SRP_FIELD_SIZE)) return PSA_ERROR_INVALID_ARGUMENT; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 */ - - default: - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - // check key > 0 - if (oberon_ct_compare_zero(data, data_length) == 0) return PSA_ERROR_INVALID_ARGUMENT; - if (key_size < data_length) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(key, data, data_length); - *key_length = data_length; - *key_bits = SRP_FIELD_BITS; - return PSA_SUCCESS; -} - -psa_status_t oberon_export_srp_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length) -{ - size_t bits = psa_get_key_bits(attributes); - psa_key_type_t type = psa_get_key_type(attributes); - - if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) { - if (key_length > data_size) return PSA_ERROR_BUFFER_TOO_SMALL; - memcpy(data, key, key_length); - *data_length = key_length; - return PSA_SUCCESS; - } - - switch (type) { -#ifdef PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 - case PSA_KEY_TYPE_SRP_KEY_PAIR(PSA_DH_FAMILY_RFC3526): - if (bits != SRP_FIELD_BITS) return PSA_ERROR_NOT_SUPPORTED; - if (data_size < SRP_FIELD_SIZE) return PSA_ERROR_BUFFER_TOO_SMALL; - ocrypto_srp_client_public_key(data, key, key_length); // hash -> verifier - *data_length = SRP_FIELD_SIZE; - break; -#endif /* PSA_NEED_OBERON_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 */ - default: - (void)bits; - return PSA_ERROR_NOT_SUPPORTED; - } - - return PSA_SUCCESS; -} diff --git a/ext/oberon/psa/drivers/oberon_srp.h b/ext/oberon/psa/drivers/oberon_srp.h deleted file mode 100644 index eaf931bc18f0..000000000000 --- a/ext/oberon/psa/drivers/oberon_srp.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2016 - 2024 Nordic Semiconductor ASA - * Copyright (c) since 2020 Oberon microsystems AG - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -// -// This file is based on the Arm PSA Crypto Driver API. -// Different from the draft spec, the setup function has parameters, in order to -// enable an implementation without memory allocation in the driver. - -#ifndef OBERON_SRP_H -#define OBERON_SRP_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct { - psa_algorithm_t hash_alg; - size_t hash_len; - uint8_t password[384]; - uint8_t ab[32]; - uint8_t A[384]; - uint8_t B[384]; - uint8_t m1[PSA_HASH_MAX_SIZE]; - uint8_t m2[PSA_HASH_MAX_SIZE]; - uint8_t k[PSA_HASH_MAX_SIZE]; - uint8_t user[PSA_HASH_MAX_SIZE]; - uint8_t salt[64]; - uint8_t salt_len; - uint16_t pw_len; - psa_pake_role_t role; -} oberon_srp_operation_t; - - -psa_status_t oberon_srp_setup( - oberon_srp_operation_t *operation, - const psa_key_attributes_t *attributes, - const uint8_t *password, size_t password_length, - const psa_pake_cipher_suite_t *cipher_suite); - -psa_status_t oberon_srp_set_role( - oberon_srp_operation_t *operation, - psa_pake_role_t role); - -psa_status_t oberon_srp_set_user( - oberon_srp_operation_t *operation, - const uint8_t *user_id, size_t user_id_len); - -psa_status_t oberon_srp_output( - oberon_srp_operation_t *operation, - psa_pake_step_t step, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_srp_input( - oberon_srp_operation_t *operation, - psa_pake_step_t step, - const uint8_t *input, size_t input_length); - -psa_status_t oberon_srp_get_shared_key( - oberon_srp_operation_t *operation, - uint8_t *output, size_t output_size, size_t *output_length); - -psa_status_t oberon_srp_abort( - oberon_srp_operation_t *operation); - - -psa_status_t oberon_import_srp_key( - const psa_key_attributes_t *attributes, - const uint8_t *data, size_t data_length, - uint8_t *key, size_t key_size, size_t *key_length, - size_t *bits); - -psa_status_t oberon_export_srp_public_key( - const psa_key_attributes_t *attributes, - const uint8_t *key, size_t key_length, - uint8_t *data, size_t data_size, size_t *data_length); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/bluetooth/bt_rpc.h b/include/bluetooth/bt_rpc.h new file mode 100644 index 000000000000..1770530a6194 --- /dev/null +++ b/include/bluetooth/bt_rpc.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef BT_RPC_H_ +#define BT_RPC_H_ + +#include + +/** + * @file + * @defgroup bt_rpc RPC bluetooth API additions + * @{ + * @brief API additions for the bluetooth over RPC. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief Set flag in the @a flags field of the bt_gatt_subscribe_params structure. + * + * This function must be used instead of atomic_set_bit() if you are using + * BLE API over RPC. + * + * @param params Subscribe parameters. + * @param flags_bit Index of bit to set. + * + * @return Previos flag value (retrived non-atomically) in case of success or negative value + * in case of error. + */ +int bt_rpc_gatt_subscribe_flag_set(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); + +/** @brief Clear flag in the @a flags field of the bt_gatt_subscribe_params structure. + * + * This function must be used instead of atomic_clear_bit() if you are using + * BLE API over RPC. + * + * @param params Subscribe parameters. + * @param flags_bit Index of bit to clear. + * + * @return Previos flag value (retrived non-atomically) in case of success or negative value + * in case of error. + */ +int bt_rpc_gatt_subscribe_flag_clear(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); + +/** @brief Get flag value from the @a flags field of the bt_gatt_subscribe_params structure. + * + * This function must be used instead of atomic_test_bit() if you are using + * BLE API over RPC. + * + * @param params Subscribe parameters. + * @param flags_bit Index of bit to test. + * + * @return Flag value in case of success or negative value in case of error. + */ +int bt_rpc_gatt_subscribe_flag_get(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#endif /* BT_RPC_H_ */ diff --git a/include/bluetooth/nrf/host_extensions.h b/include/bluetooth/nrf/host_extensions.h index 8f83b1113f78..20436c9a1a28 100644 --- a/include/bluetooth/nrf/host_extensions.h +++ b/include/bluetooth/nrf/host_extensions.h @@ -107,6 +107,15 @@ struct bt_conn_set_pcr_params { */ int bt_conn_set_power_control_request_params(struct bt_conn_set_pcr_params *params); +/** @brief Reduce the priority of the initiator when following AUX packets. + * + * @param reduce Set to true to reduce the priority. Set to false to restore the default priority. + * + * @return Zero on success or (negative) error code on failure. + * @retval -ENOBUFS HCI command buffer is not available. + */ +int bt_nrf_host_extension_reduce_initator_aux_channel_priority(bool reduce); + /** * @} */ diff --git a/include/dfu/dfu_target_suit.h b/include/dfu/dfu_target_suit.h new file mode 100644 index 000000000000..2c53bcae17e9 --- /dev/null +++ b/include/dfu/dfu_target_suit.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file dfu_target_suit.h + * + * @defgroup dfu_target_suit SUIT DFU Target + * @{ + * @brief DFU Target for upgrades performed by SUIT + */ + +#ifndef DFU_TARGET_SUIT_H__ +#define DFU_TARGET_SUIT_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Set buffer to use for flash write operations. + * + * @retval Non-negative value if successful, negative errno otherwise. + */ +int dfu_target_suit_set_buf(uint8_t *buf, size_t len); + +/** + * @brief See if data in buf indicates SUIT style upgrade. + * + * 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. + * + * @param[in] file_size Size of the current file being downloaded. + * @param[in] img_num Image pair index. + * @param[in] cb Callback for signaling events(unused). + * + * @retval 0 If successful, negative errno otherwise. + */ +int dfu_target_suit_init(size_t file_size, int img_num, dfu_target_callback_t cb); + +/** + * @brief Get offset of firmware + * + * @param[out] offset Returns the offset of the firmware upgrade. + * + * @return 0 if success, otherwise negative value if unable to get the offset + */ +int dfu_target_suit_offset_get(size_t *offset); + +/** + * @brief Write firmware data. + * + * @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. + */ +int dfu_target_suit_write(const void *const buf, size_t len); + +/** + * @brief Deinitialize resources and finalize firmware upgrade if successful. + + * @param[in] successful Indicate whether the firmware was successfully recived. + * + * @return 0 on success, negative errno otherwise. + */ +int dfu_target_suit_done(bool successful); + +/** + * @brief Schedule update and reset the device. + * + * This call requests images update and immediately starts it + * by resetting the device. + * + * @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. + **/ +int dfu_target_suit_schedule_update(int img_num); + +/** + * @brief Release resources and erase the download area. + * + * Cancels any ongoing updates. + * + * @return 0 on success, negative errno otherwise. + */ +int dfu_target_suit_reset(void); + + +#ifdef __cplusplus +} +#endif + +#endif /* DFU_TARGET_SUIT_H__ */ + +/**@} */ diff --git a/include/dfu/suit_dfu.h b/include/dfu/suit_dfu.h new file mode 100644 index 000000000000..1683f3416ae3 --- /dev/null +++ b/include/dfu/suit_dfu.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_DFU_H__ +#define SUIT_DFU_H__ + +/** + * @brief Module providing tools to the Local domain Core allowing to orchestrate the SUIT DFU. + */ + +/** + * The following steps are required by the application to perform Device Firmware Update: + * + * (1) Call @ref suit_dfu_initialize to initialize the SUIT DFU module before any + * other SUIT functionalities are used. This function only has to be called once. + * This function must be called with at least APPLICATION init level (calling it + * in POST_KERNEL or earlier init level causes undefined behavior). + * (2) Optional: If the SUIT manifest may require fetching of additional data in the + * suit-payload-fetch sequence, fetch sources should be registered using + * suit_fetch_source_register + * (3) Store the SUIT candidate envelope in the non-volatile memory area defined as + * dfu_partition in the device tree. + * (4) Optional, not supported yet: Store other needed data/detached payloads + * in dfu cache partitions. + * DFU cache pool 0 is not available at this stage (it is part of dfu_partition + * not occupied by the SUIT candidate envelope). + * (5) When storing the SUIT candidate envelope is finished, call + * @ref suit_dfu_candidate_envelope_stored + * (6) Call @ref suit_dfu_candidate_preprocess. If any fetch sources were registered + * in step (2) they might be used by this function to fetch additional data. + * (7) Call @ref suit_dfu_update_start. This will start the firmware update by + * resetting the device and passing control over the update to the Secure Domain. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the SUIT DFU before it can be used. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_dfu_initialize(void); + +/** + * @brief Purge all the SUIT DFU partitions and perform cleanup. + * Call this if the update needs to be interrupted after suit_dfu_initialize is called. + * This will invalidate any written data. To start the update again, SUIT DFU must + * be reinitialized with suit_dfu_envelope_size_update. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_dfu_cleanup(void); + +/** + * @brief Inform the SUIT module that the candidate envelope upload has ended. + * + * After this stage no modifications to the candidate are allowed (unless the API user + * performs cleanup with @ref suit_dfu_cleanup and restarts the update process). + * However, modifications to DFU cache partitions are still allowed. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_dfu_candidate_envelope_stored(void); + +/** + * @brief Process all the information stored in the envelope, but do not start the update yet. + * This function runs the SUIT processor on the envelope. If any fetch sources were + * registered using suit_fetch_source_register they might be used + * by the SUIT processor to pull any missing images. Also, cache partitions might be + * modified. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_dfu_candidate_preprocess(void); + +/** + * @brief Start the update. + * This will trigger a reset and pass the control to the Secure Domain in order to perform + * firmware update based on the installed envelope and other data stored in the SUIT DFU + * cache as a result of earlier operations. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_dfu_update_start(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_DFU_H__ */ diff --git a/include/dfu/suit_dfu_fetch_source.h b/include/dfu/suit_dfu_fetch_source.h new file mode 100644 index 000000000000..4ab935d3c929 --- /dev/null +++ b/include/dfu/suit_dfu_fetch_source.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_DFU_FETCH_SOURCE_H__ +#define SUIT_DFU_FETCH_SOURCE_H__ + +#if CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The fetch source manager allows for registration of multiple data sources to be used by + * the SUIT processor. + * The SUIT proccessor iterates over the registered fetch sources, calling respective + * suit_dfu_fetch_source_request_fn. + */ + +/** + * @brief Fetch source callback function. + * Fetch source callbacks are registered via suit_dfu_fetch_source_register. + * Multiple such callbacks can be registered. The callbacks are called from inside + * the SUIT processor until one of them succeeds. + * Iteration will be broken if one of registered fetch sources starts to call + * @ref suit_dfu_fetch_source_write_fetched_data or @ref suit_dfu_fetch_source_seek. + * + * The role of the callback is to fetch data from the provided URI and pass it to SUIT + * via @ref suit_dfu_fetch_source_write_fetched_data - the data does not have to be passed + * all at once, @ref suit_dfu_fetch_source_write_fetched_data can be called multiple times + * as new chunks of data arrive. + * If the data needs to be written at some offset (e.g. if the chunks arrive out of order) + * @ref suit_dfu_fetch_source_seek can be used to move the write pointer to the given offset. + * + * It is up to the implementer of this callback how the URI is resolved and how + * the data is fetched. + * If the function fails to fetch the data from the given URI it must return a negative + * error code. + * + * @param[in] uri URI from which the data should be fetched. Fetch source interprets it. + * In case if fetch source is unable to retrieve requested resource, i.e. due to + * unsupported protocol, it shall just fail, avoiding any prior call to + * @ref suit_dfu_fetch_source_write_fetched_data or + * @ref suit_dfu_fetch_source_seek + * + * @param[in] uri_length Length of the uri, in bytes + * + * @param[in] session_id Session ID used by the fetch source manager. It shall be passed without + * modification to calls to @ref suit_dfu_fetch_source_write_fetched_data + * and @ref suit_dfu_fetch_source_seek made by this function, + * + * + * @return 0 on success - if fetching from the URI is possible and writing the data succeeded + * Negative error code otherwise (URI not found or other error). + */ +typedef int (*suit_dfu_fetch_source_request_fn)(const uint8_t *uri, size_t uri_length, + uint32_t session_id); + +/** + * @brief Register fetch source + * + * @param[in] request_fn Fetch source callback function. The suit processor will + * iterate over registered callback functions when fetching from an URI is needed. + * Attention! Order of execution of callback functions is not guaranteed! + * + * + * @return 0 on success, negative error code otherwise + */ +int suit_dfu_fetch_source_register(suit_dfu_fetch_source_request_fn request_fn); + +/** + * @brief Passes the fetched data to the SUIT processor. + * This function shall only be called from inside a suit_dfu_fetch_source_request_fn + * callback. + * + * @param[in] session_id Session id, the same which was passed to the session_id parameter of the + * suit_dfu_fetch_source_request_fn callback. + * @param[in] data Pointer to the data to write. + * @param[in] len Length the data to write. + + * @return 0 on success, negative error code otherwise. + */ +int suit_dfu_fetch_source_write_fetched_data(uint32_t session_id, const uint8_t *data, size_t len); + +/** + * @brief Move the internal write pointer inside the SUIT processor to the given offset. + * This function shall only be called from inside a suit_dfu_fetch_source_request_fn + * callback. + * + * @param[in] session_id Session id, the same which was passed to the session_id parameter of the + * suit_dfu_fetch_source_request_fn callback. + * @param[in] offset The offset to which the write pointer shall be used. + + * @return 0 on success, negative error code otherwise. + */ +int suit_dfu_fetch_source_seek(uint32_t session_id, size_t offset); + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR */ + +#endif /* SUIT_DFU_FETCH_SOURCE_H__ */ diff --git a/include/drivers/flash/flash_rpc.h b/include/drivers/flash/flash_rpc.h new file mode 100644 index 000000000000..32a49d9beab7 --- /dev/null +++ b/include/drivers/flash/flash_rpc.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef FLASH_RPC_H_ +#define FLASH_RPC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum flash_rpc_command { + RPC_COMMAND_FLASH_INIT = 0x01, + RPC_COMMAND_FLASH_READ = 0x02, + RPC_COMMAND_FLASH_WRITE = 0x03, + RPC_COMMAND_FLASH_ERASE = 0x04, +}; + +#ifdef __cplusplus +} +#endif + +#endif /* FLASH_RPC_H_*/ diff --git a/include/esb.h b/include/esb.h index c252fa4aa67c..430420cf8b43 100644 --- a/include/esb.h +++ b/include/esb.h @@ -122,6 +122,11 @@ enum esb_bitrate { /** 2 Mb radio mode using @e Bluetooth low energy radio parameters. */ ESB_BITRATE_2MBPS_BLE = NRF_RADIO_MODE_BLE_2MBIT, #endif /* defined(RADIO_MODE_MODE_Ble_2Mbit) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + /** 4 Mb radio mode. */ + ESB_BITRATE_4MBPS = NRF_RADIO_MODE_NRF_4MBIT_H_0_5, +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ }; /** @brief Enhanced ShockBurst CRC modes. */ @@ -133,34 +138,126 @@ enum esb_crc { /** @brief Enhanced ShockBurst radio transmission power modes. */ enum esb_tx_power { -#if defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) - /** 4 dBm radio transmit power. */ - ESB_TX_POWER_4DBM = NRF_RADIO_TXPOWER_POS4DBM, -#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) */ - -#if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) - /** 3 dBm radio transmit power. */ - ESB_TX_POWER_3DBM = NRF_RADIO_TXPOWER_POS3DBM, -#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) */ - +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) || defined(DOXYGEN) + /** +10 dBm radio transmit power. */ + ESB_TX_POWER_10DBM = RADIO_TXPOWER_TXPOWER_Pos10dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) || defined(DOXYGEN) + /** +9 dBm radio transmit power. */ + ESB_TX_POWER_9DBM = RADIO_TXPOWER_TXPOWER_Pos9dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) || defined(DOXYGEN) + /** +8 dBm radio transmit power. */ + ESB_TX_POWER_8DBM = RADIO_TXPOWER_TXPOWER_Pos8dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) || defined(DOXYGEN) + /** +7 dBm radio transmit power. */ + ESB_TX_POWER_7DBM = RADIO_TXPOWER_TXPOWER_Pos7dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) || defined(DOXYGEN) + /** +6 dBm radio transmit power. */ + ESB_TX_POWER_6DBM = RADIO_TXPOWER_TXPOWER_Pos6dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) || defined(DOXYGEN) + /** +5 dBm radio transmit power. */ + ESB_TX_POWER_5DBM = RADIO_TXPOWER_TXPOWER_Pos5dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) || defined(DOXYGEN) + /** +4 dBm radio transmit power. */ + ESB_TX_POWER_4DBM = RADIO_TXPOWER_TXPOWER_Pos4dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) || defined(DOXYGEN) + /** +3 dBm radio transmit power. */ + ESB_TX_POWER_3DBM = RADIO_TXPOWER_TXPOWER_Pos3dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) || defined(DOXYGEN) + /** +2 dBm radio transmit power. */ + ESB_TX_POWER_2DBM = RADIO_TXPOWER_TXPOWER_Pos2dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) || defined(DOXYGEN) + /** +1 dBm radio transmit power. */ + ESB_TX_POWER_1DBM = RADIO_TXPOWER_TXPOWER_Pos1dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_0dBm) || defined(DOXYGEN) /** 0 dBm radio transmit power. */ - ESB_TX_POWER_0DBM = NRF_RADIO_TXPOWER_0DBM, + ESB_TX_POWER_0DBM = RADIO_TXPOWER_TXPOWER_0dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg1dBm) || defined(DOXYGEN) + /** -1 dBm radio transmit power. */ + ESB_TX_POWER_NEG1DBM = RADIO_TXPOWER_TXPOWER_Neg1dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg2dBm) || defined(DOXYGEN) + /** -2 dBm radio transmit power. */ + ESB_TX_POWER_NEG2DBM = RADIO_TXPOWER_TXPOWER_Neg2dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg3dBm) || defined(DOXYGEN) + /** -3 dBm radio transmit power. */ + ESB_TX_POWER_NEG3DBM = RADIO_TXPOWER_TXPOWER_Neg3dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg4dBm) || defined(DOXYGEN) /** -4 dBm radio transmit power. */ - ESB_TX_POWER_NEG4DBM = NRF_RADIO_TXPOWER_NEG4DBM, + ESB_TX_POWER_NEG4DBM = RADIO_TXPOWER_TXPOWER_Neg4dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) || defined(DOXYGEN) + /** -5 dBm radio transmit power. */ + ESB_TX_POWER_NEG5DBM = RADIO_TXPOWER_TXPOWER_Neg5dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) || defined(DOXYGEN) + /** -6 dBm radio transmit power. */ + ESB_TX_POWER_NEG6DBM = RADIO_TXPOWER_TXPOWER_Neg6dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) || defined(DOXYGEN) + /** -7 dBm radio transmit power. */ + ESB_TX_POWER_NEG7DBM = RADIO_TXPOWER_TXPOWER_Neg7dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg8dBm) || defined(DOXYGEN) /** -8 dBm radio transmit power. */ - ESB_TX_POWER_NEG8DBM = NRF_RADIO_TXPOWER_NEG8DBM, + ESB_TX_POWER_NEG8DBM = RADIO_TXPOWER_TXPOWER_Neg8dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) || defined(DOXYGEN) + /** -9 dBm radio transmit power. */ + ESB_TX_POWER_NEG9DBM = RADIO_TXPOWER_TXPOWER_Neg9dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) || defined(DOXYGEN) + /** -10 dBm radio transmit power. */ + ESB_TX_POWER_NEG10DBM = RADIO_TXPOWER_TXPOWER_Neg10dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg12dBm) || defined(DOXYGEN) /** -12 dBm radio transmit power. */ - ESB_TX_POWER_NEG12DBM = NRF_RADIO_TXPOWER_NEG12DBM, + ESB_TX_POWER_NEG12DBM = RADIO_TXPOWER_TXPOWER_Neg12dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) || defined(DOXYGEN) + /** -14 dBm radio transmit power. */ + ESB_TX_POWER_NEG14DBM = RADIO_TXPOWER_TXPOWER_Neg14dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg16dBm) || defined(DOXYGEN) /** -16 dBm radio transmit power. */ - ESB_TX_POWER_NEG16DBM = NRF_RADIO_TXPOWER_NEG16DBM, + ESB_TX_POWER_NEG16DBM = RADIO_TXPOWER_TXPOWER_Neg16dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg20dBm) || defined(DOXYGEN) /** -20 dBm radio transmit power. */ - ESB_TX_POWER_NEG20DBM = NRF_RADIO_TXPOWER_NEG20DBM, + ESB_TX_POWER_NEG20DBM = RADIO_TXPOWER_TXPOWER_Neg20dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) || defined(DOXYGEN) + /** -26 dBm radio transmit power. */ + ESB_TX_POWER_NEG26DBM = RADIO_TXPOWER_TXPOWER_Neg26dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) || defined(DOXYGEN) /** -30 dBm radio transmit power. */ - ESB_TX_POWER_NEG30DBM = NRF_RADIO_TXPOWER_NEG30DBM, + ESB_TX_POWER_NEG30DBM = RADIO_TXPOWER_TXPOWER_Neg30dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) || defined(DOXYGEN) /** -40 dBm radio transmit power. */ -#if defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) - ESB_TX_POWER_NEG40DBM = NRF_RADIO_TXPOWER_NEG40DBM -#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) */ + ESB_TX_POWER_NEG40DBM = RADIO_TXPOWER_TXPOWER_Neg40dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) || defined(DOXYGEN) + /** -46 dBm radio transmit power. */ + ESB_TX_POWER_NEG46DBM = RADIO_TXPOWER_TXPOWER_Neg46dBm, +#endif +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) || defined(DOXYGEN) + /** -70 dBm radio transmit power. */ + ESB_TX_POWER_NEG70DBM = RADIO_TXPOWER_TXPOWER_Neg70dBm, +#endif }; /** @brief Enhanced ShockBurst transmission modes. */ diff --git a/include/fem_al/fem_al.h b/include/fem_al/fem_al.h index e61b45b233a5..503902976d4d 100644 --- a/include/fem_al/fem_al.h +++ b/include/fem_al/fem_al.h @@ -34,6 +34,12 @@ enum fem_antenna { FEM_ANTENNA_2 }; +/**@brief Type holding Tx power control to be applied to front-end module. + * + * @note The value stored in this type is specific to the FEM type in use. + */ +typedef uint8_t fem_tx_power_control; + /**@brief Initialize the front-end module. * * @param[in] timer_instance Pointer to a 1-us resolution timer instance. @@ -68,17 +74,18 @@ int fem_power_up(void); */ int fem_power_down(void); -/**@brief Configure Tx gain of the front-end module in arbitrary units. +/**@brief Configure Tx power control of the front-end module. * - * @param[in] gain Tx gain in arbitrary units specific for used front-end module implementation. + * @param[in] tx_power_control Tx power control specific to the front-end module implementation. * For nRF21540 GPIO/SPI, this is a register value. * For nRF21540 GPIO, this is MODE pin value. - * Check your front-end module product specification for gain value range. + * Check your front-end module product specification for Tx power control value + * range. * * @retval 0 If the operation was successful. * Otherwise, a (negative) error code is returned. */ -int fem_tx_gain_set(uint32_t gain); +int fem_tx_power_control_set(fem_tx_power_control tx_power_control); /**@brief Get the default radio ramp-up time for reception or transmission with a given data rate * and modulation. @@ -145,11 +152,11 @@ uint32_t fem_radio_tx_ramp_up_delay_get(bool fast, nrf_radio_mode_t mode); */ uint32_t fem_radio_rx_ramp_up_delay_get(bool fast, nrf_radio_mode_t mode); -/**@brief Set the front-end module gain and returns output power to be set on the radio peripheral - * to get requested output power. +/**@brief Set the front-end module Tx power control and returns output power + * to be set on the radio peripheral to get requested output power. * * This function calculates power value for RADIO peripheral register and - * sets front-end module gain value. + * sets front-end module Tx power control value. * * @note If the exact value of @p power cannot be achieved, this function attempts to use less * power to not exceed the limits. @@ -204,11 +211,11 @@ static inline int8_t fem_tx_output_power_max_get(uint16_t freq_mhz) return fem_tx_output_power_check(INT8_MAX, freq_mhz, true); } -/**@brief Get the front-end module default Tx gain. +/**@brief Get the front-end module default Tx output power. * - * @return The front-end module default Tx gain value. + * @return The front-end module default Tx output power value. */ -uint32_t fem_default_tx_gain_get(void); +int8_t fem_default_tx_output_power_get(void); /**@brief Apply the workaround for the Errata 254, 255, 256, 257 when appropriate. * diff --git a/include/hw_unique_key.h b/include/hw_unique_key.h index 6c269326916e..c2aefe0e09da 100644 --- a/include/hw_unique_key.h +++ b/include/hw_unique_key.h @@ -12,8 +12,11 @@ * @defgroup hw_unique_key Hardware Unique Key (HUK) loading * @{ * - * @brief API for loading the Hardware Unique Key (HUK) in the CryptoCell - * KDR registers. + * @brief API for loading the Hardware Unique Key (HUK). + * + * The library supports loading the HUK: + * - To CryptoCell KDR registers. + * - To Cracen SEED registers. */ #ifdef __cplusplus @@ -27,7 +30,7 @@ extern "C" { #endif #include -#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_kmu) +#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_kmu) || defined(CONFIG_CRACEN_HW_PRESENT) #define HUK_HAS_KMU #endif #if defined(CONFIG_HAS_HW_NRF_CC310) @@ -41,8 +44,10 @@ extern "C" { #define HUK_SIZE_WORDS 4 #elif defined(HUK_HAS_CC312) #define HUK_SIZE_WORDS 8 +#elif defined(CONFIG_CRACEN_HW_PRESENT) +#define HUK_SIZE_WORDS 12 #else -#error "This library requires CryptoCell to be available." +#error "This library requires CryptoCell or Cracen to be available." #endif #define HUK_SIZE_BYTES (HUK_SIZE_WORDS * 4) @@ -132,7 +137,8 @@ bool hw_unique_key_are_any_written(void); int hw_unique_key_load_kdr(void); /** - * @brief Derive a key from the specified HUK, using the nrf_cc3xx_platform API + * @brief Derive a key from the specified HUK, using the nrf_cc3xx_platform API on CryptoCell. + * Cracen PSA driver APIs on Cracen. * * See nrf_cc3xx_platform_kmu_shadow_key_derive() for more info. * diff --git a/include/modem/location.h b/include/modem/location.h index 643aaa6f7bd5..b996f06b240a 100644 --- a/include/modem/location.h +++ b/include/modem/location.h @@ -230,8 +230,10 @@ struct location_data_details { */ uint32_t elapsed_time_method; +#if defined(CONFIG_LOCATION_METHOD_GNSS) /** Location details for GNSS. */ struct location_data_details_gnss gnss; +#endif #if defined(CONFIG_LOCATION_METHOD_CELLULAR) /** Location details for cellular. */ struct location_data_details_cellular cellular; @@ -267,6 +269,12 @@ struct location_data_error { struct location_data_details details; }; +/** Information for an unknown location result. */ +struct location_data_unknown { + /** Data details at the time of an unknown location result. */ + struct location_data_details details; +}; + /** Location fallback information. */ struct location_data_fallback { /** New location method that is tried next. */ @@ -312,9 +320,13 @@ struct location_event_data { * Used with events @ref LOCATION_EVT_TIMEOUT and @ref LOCATION_EVT_ERROR. */ struct location_data_error error; -#endif -#if defined(CONFIG_LOCATION_DATA_DETAILS) + /** + * Relevant location data when an unknown result occurs. + * Used with event @ref LOCATION_EVT_RESULT_UNKNOWN. + */ + struct location_data_unknown unknown; + /** * Relevant location data when a fallback to another method occurs * due to a timeout or an error. @@ -693,6 +705,21 @@ void location_config_defaults_set( */ const char *location_method_str(enum location_method method); +/** + * @brief Get location data details from the location event data. + * + * @details The @ref location_data_details structure is located in a different place in the + * @ref location_event_data structure depending on the event ID. This is a helper function + * to provide the @ref location_data_details structure. + * + * @param[in] event_data Event data. + * + * @return Location data details. NULL if there is no @ref location_data_details structure + * for the provided event. + */ +const struct location_data_details *location_details_get( + const struct location_event_data *event_data); + /** * @brief Feed in A-GNSS data to be processed by library. * diff --git a/include/modem/lte_lc.h b/include/modem/lte_lc.h index 62fccbfb8f7f..1199ab5abacd 100644 --- a/include/modem/lte_lc.h +++ b/include/modem/lte_lc.h @@ -1576,42 +1576,6 @@ int lte_lc_edrx_req(bool enable); */ int lte_lc_edrx_get(struct lte_lc_edrx_cfg *edrx_cfg); -/** - * Set the RAI value to be used. - * - * RAI can be subsequently enabled using lte_lc_rai_req(). - * - * For reference see 3GPP 24.301 Ch. 9.9.4.25. - * - * @deprecated Use @kconfig{CONFIG_LTE_RAI_REQ} and socket option ``SO_RAI`` instead. - * - * @note This feature is only supported by modem firmware versions < 2.0.0. - * - * @param[in] value RAI value as a null-terminated string. - * - * @retval 0 if successful. - * @retval -EINVAL if an input parameter was invalid. - */ -__deprecated int lte_lc_rai_param_set(const char *value); - -/** - * Request modem to enable or disable use of RAI. - * - * Used RAI value can be set using @kconfig{CONFIG_LTE_RAI_REQ_VALUE} or by calling - * lte_lc_rai_param_set(). - * - * @deprecated Use @kconfig{CONFIG_LTE_RAI_REQ} and socket option ``SO_RAI`` instead. - * - * @note This feature is only supported by modem firmware versions < 2.0.0. - * - * @param[in] enable @c true to enable RAI, @c false to disable RAI. - * - * @retval 0 if successful. - * @retval -EFAULT if AT command failed. - * @retval -EOPNOTSUPP if RAI is not supported in the current system mode. - */ -__deprecated int lte_lc_rai_req(bool enable); - /** * Get the current network registration status. * diff --git a/include/modem/modem_info.h b/include/modem/modem_info.h index 2cf63c3a3502..c5fea21053cc 100644 --- a/include/modem/modem_info.h +++ b/include/modem/modem_info.h @@ -35,10 +35,10 @@ extern "C" { #define RSRP_OFFSET_VAL 140 /** RSRQ offset value. */ -#define RSRQ_OFFSET_VAL 19.5 +#define RSRQ_OFFSET_VAL 19.5f /** RSRQ scale value. */ -#define RSRQ_SCALE_VAL 0.5 +#define RSRQ_SCALE_VAL 0.5f /** Modem firmware version string can be up to 40 characters long. */ #define MODEM_INFO_FWVER_SIZE 41 diff --git a/include/net/download_client.h b/include/net/download_client.h index 1a8b811ee95e..f5f8c4204589 100644 --- a/include/net/download_client.h +++ b/include/net/download_client.h @@ -53,6 +53,7 @@ enum download_client_evt_id { * - EPROTONOSUPPORT: Protocol is not supported * - EINVAL: Invalid configuration * - EAFNOSUPPORT: Unsupported address family (IPv4/IPv6) + * - EHOSTUNREACH: Failed to resolve the target address * * In case of errors on the socket during send() or recv() (ECONNRESET), * returning zero from the callback will let the library attempt diff --git a/include/net/lwm2m_client_utils.h b/include/net/lwm2m_client_utils.h index b101e80362a5..b48dda0fea31 100644 --- a/include/net/lwm2m_client_utils.h +++ b/include/net/lwm2m_client_utils.h @@ -117,11 +117,6 @@ bool lwm2m_security_needs_bootstrap(void); #endif #if defined(CONFIG_LWM2M_CLIENT_UTILS_DEVICE_OBJ_SUPPORT) -/** - * @brief Initialize Device object - */ -int lwm2m_init_device(void); - /** * @brief Reboot handler for a device object * @@ -136,15 +131,6 @@ int lwm2m_init_device(void); int lwm2m_device_reboot_cb(uint16_t obj_inst_id, uint8_t *args, uint16_t args_len); #endif -#if defined(CONFIG_LWM2M_CLIENT_UTILS_LOCATION_OBJ_SUPPORT) -/** - * @brief Initialize Location object - */ -int lwm2m_init_location(void); -#endif - -#if defined(CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT) - /** Firmware update callback events. */ enum lwm2m_fota_event_id { /** Download process started */ @@ -252,13 +238,6 @@ typedef int (*lwm2m_firmware_event_cb_t)(struct lwm2m_fota_event *event); */ void *firmware_read_cb(uint16_t obj_inst_id, size_t *data_len); -/** - * @brief Initialize Firmware update utils library - * - * @return Zero if success, negative error code otherwise. - */ -int lwm2m_init_firmware(void); - /** * @brief Initialize Firmware update utils library with callback * @@ -274,21 +253,8 @@ int lwm2m_init_firmware_cb(lwm2m_firmware_event_cb_t cb); * @return Zero if success, negative error code otherwise. */ int lwm2m_init_image(void); -#endif -#if defined(CONFIG_LWM2M_CLIENT_UTILS_CONN_MON_OBJ_SUPPORT) -/** - * @brief Initialize Connectivity Monitoring object. Called in SYS_INIT. - * - * @return Zero if success, negative error code otherwise. - */ -int lwm2m_init_connmon(void); -#endif - -#if defined(CONFIG_LWM2M_CLIENT_UTILS_CELL_CONN_OBJ_SUPPORT) #define LWM2M_OBJECT_CELLULAR_CONNECTIVITY_ID 10 -int lwm2m_init_cellular_connectivity_object(void); -#endif enum lwm2m_rai_mode { LWM2M_RAI_MODE_DISABLED = 0, @@ -411,6 +377,18 @@ int lwm2m_adv_firmware_create_inst(const char *component, #define LWM2M_ADV_FOTA_LINKED_INSTANCES_ID 16 #define LWM2M_ADV_FOTA_CONFLICTING_INSTANCES_ID 17 +/********** DEPRECATED FUNCTIONS *************/ +/** @deprecated */ +__deprecated static inline int lwm2m_init_firmware(void) {return lwm2m_init_firmware_cb(NULL); } +/** @deprecated */ +__deprecated static inline int lwm2m_init_device(void) {return 0; } +/** @deprecated */ +__deprecated static inline int lwm2m_init_cellular_connectivity_object(void) {return 0; } +/** @deprecated */ +__deprecated static inline int lwm2m_init_connmon(void) {return 0; } +/** @deprecated */ +__deprecated static inline int lwm2m_init_location(void) {return 0; } + #ifdef __cplusplus } #endif diff --git a/include/net/nrf_cloud.h b/include/net/nrf_cloud.h index 6913cc04a78d..035edd7d6cab 100644 --- a/include/net/nrf_cloud.h +++ b/include/net/nrf_cloud.h @@ -439,7 +439,7 @@ struct nrf_cloud_svc_info_fota { uint8_t _rsvd:4; }; -/** @brief Controls which values are added to the UI array in the "serviceInfo" shadow section */ +/** @brief DEPRECATED - No longer used by nRF Cloud */ struct nrf_cloud_svc_info_ui { /* Items with UI support on nRF Cloud */ /** Temperature */ @@ -504,7 +504,8 @@ struct nrf_cloud_modem_info { 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; - /** Specify UI components to enable, set to NULL to remove the UI entry */ + + /** DEPRECATED - nRF Cloud no longer requires the device to set UI values in the shadow */ struct nrf_cloud_svc_info_ui *ui; }; @@ -534,10 +535,10 @@ enum nrf_cloud_gnss_type { /** @brief PVT data */ struct nrf_cloud_gnss_pvt { - /** Longitude in degrees; required. */ - double lon; /** Latitude in degrees; required. */ double lat; + /** Longitude in degrees; required. */ + double lon; /** Position accuracy (2D 1-sigma) in meters; required. */ float accuracy; diff --git a/include/net/nrf_cloud_coap.h b/include/net/nrf_cloud_coap.h index 9efe1773dd98..70de86ea6e47 100644 --- a/include/net/nrf_cloud_coap.h +++ b/include/net/nrf_cloud_coap.h @@ -26,6 +26,17 @@ extern "C" { /** * @defgroup nrf_cloud_coap nRF CoAP API + * + * @brief The functions in this library can return either positive or negative return values. + * + * @details Negative values are standard device-side errors defined in errno.h. These indicate + * a failure to send the request to the cloud for various reasons, such as the device + * is not connected to the cloud or the request contains invalid parameters. + * + * Positive values are cloud-side errors (CoAP result codes). These indicate the + * cloud received the request but rejected it. This can occur either because of the + * request itself or because of a cloud-side error. See the specific result code for + * details. These are defined in zephyr/net/coap.h. * @{ */ @@ -44,7 +55,10 @@ int nrf_cloud_coap_init(void); * * @param app_ver Version to report to the shadow; can be NULL. * - * @return 0 if authorized successfully, otherwise, a negative error number. + * @return 0 if authorized successfully, otherwise, an error number. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_connect(const char * const app_ver); @@ -105,7 +119,8 @@ int nrf_cloud_coap_disconnect(void); * request type. * @retval -ENOBUFS will be returned, and an error message printed, if there is not enough * buffer space to store retrieved A-GNSS data. - * @retval 0 If successful. + * @return 0 If successful. Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_agnss_data_get(struct nrf_cloud_rest_agnss_request const *const request, struct nrf_cloud_rest_agnss_result *result); @@ -120,8 +135,10 @@ int nrf_cloud_coap_agnss_data_get(struct nrf_cloud_rest_agnss_request const *con * @param[in,out] file_location Structure that will contain the host and path to * the prediction file. * - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_pgps_url_get(struct nrf_cloud_rest_pgps_request const *const request, struct nrf_cloud_pgps_result *file_location); @@ -140,8 +157,10 @@ int nrf_cloud_coap_pgps_url_get(struct nrf_cloud_rest_pgps_request const *const * @param[in] ts_ms Timestamp the data was measured, or NRF_CLOUD_NO_TIMESTAMP. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. * - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_sensor_send(const char *app_id, double value, int64_t ts_ms, bool confirmable); @@ -160,8 +179,10 @@ int nrf_cloud_coap_sensor_send(const char *app_id, double value, int64_t ts_ms, * @param[in] ts_ms Timestamp the data was measured, or NRF_CLOUD_NO_TIMESTAMP. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. * - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_message_send(const char *app_id, const char *message, bool json, int64_t ts_ms, bool confirmable); @@ -178,8 +199,10 @@ int nrf_cloud_coap_message_send(const char *app_id, const char *message, bool js * to be sent to the bulk topic. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. * - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_json_message_send(const char *message, bool bulk, bool confirmable); @@ -193,8 +216,10 @@ int nrf_cloud_coap_json_message_send(const char *message, bool bulk, bool confir * location, usually as determined by the GNSS unit. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. * - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_location_send(const struct nrf_cloud_gnss_data * const gnss, bool confirmable); @@ -206,8 +231,10 @@ int nrf_cloud_coap_location_send(const struct nrf_cloud_gnss_data * const gnss, * @param[in] request Data to be provided in API call. * @param[in,out] result Location information. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_location_get(struct nrf_cloud_rest_location_request const *const request, struct nrf_cloud_location_result *const result); @@ -220,8 +247,10 @@ int nrf_cloud_coap_location_get(struct nrf_cloud_rest_location_request const *co * @ref nrf_cloud_coap_fota_job_free to free the memory * allocated by this function. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_fota_job_get(struct nrf_cloud_fota_job_info *const job); @@ -241,8 +270,10 @@ void nrf_cloud_coap_fota_job_free(struct nrf_cloud_fota_job_info *const job); * @param[in] details Null-terminated string containing details of the * job, such as an error description. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_fota_job_update(const char *const job_id, const enum nrf_cloud_fota_status status, const char * const details); @@ -258,28 +289,50 @@ int nrf_cloud_coap_fota_job_update(const char *const job_id, * @param[in] delta True to request only changes in the shadow, if any; otherwise, * all of desired part. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_shadow_get(char *buf, size_t buf_len, bool delta); /** - * @brief Update the device's "state" in the shadow via the UpdateDeviceState endpoint. + * @brief Update the device's "reported state" in the shadow through the state/update CoAP resource. + * This is used both to report the current state of the device as well as to accept settings + * changes received in a shadow delta. * * @param[in] shadow_json Null-terminated JSON string to be written to the device's shadow. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_shadow_state_update(const char * const shadow_json); /** - * @brief Update the device status in the shadow. + * @brief Update the device's "desired state" in the shadow through the state/desired CoAP resource. + * Normally, this is only used to silence a shadow delta that is incompatible with the device, + * by overwriting the invalid desired values with the reported values. + * + * @param[in] shadow_json Null-terminated JSON string to be written to the device's shadow. + * + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. + */ +int nrf_cloud_coap_shadow_desired_update(const char * const shadow_json); + +/** + * @brief Update the device status in the shadow's reported state section. * * @param[in] dev_status Device status to be encoded. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_shadow_device_status_update(const struct nrf_cloud_device_status *const dev_status); @@ -289,8 +342,10 @@ int nrf_cloud_coap_shadow_device_status_update(const struct nrf_cloud_device_sta * * @param[in] svc_inf Service info items to be updated in the shadow. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_shadow_service_info_update(const struct nrf_cloud_svc_info * const svc_inf); @@ -319,8 +374,10 @@ int nrf_cloud_coap_shadow_delta_process(const struct nrf_cloud_data *in_data, * @param[in] buf buffer with binary string. * @param[in] buf_len length of buf in bytes. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. - * @retval 0 If successful. - * Otherwise, a (negative) error code is returned. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_bytes_send(uint8_t *buf, size_t buf_len, bool confirmable); @@ -336,8 +393,10 @@ int nrf_cloud_coap_bytes_send(uint8_t *buf, size_t buf_len, bool confirmable); * NRF_CLOUD_ENC_SRC_NONE. * @param[in] confirmable Select whether to use a CON or NON CoAP transfer. * - * @return 0 if the request succeeded, a positive value indicating a CoAP result code, - * or a negative error number. + * @return 0 If successful, nonzero if failed. + * Negative values are device-side errors defined in errno.h. + * Positive values are cloud-side errors (CoAP result codes) + * defined in zephyr/net/coap.h. */ int nrf_cloud_coap_obj_send(struct nrf_cloud_obj *const obj, bool confirmable); diff --git a/include/net/nrf_cloud_codec.h b/include/net/nrf_cloud_codec.h index 6b6f3f1e1744..2c45062fee2e 100644 --- a/include/net/nrf_cloud_codec.h +++ b/include/net/nrf_cloud_codec.h @@ -260,6 +260,23 @@ int nrf_cloud_obj_num_get(const struct nrf_cloud_obj *const obj, const char *con int nrf_cloud_obj_str_get(const struct nrf_cloud_obj *const obj, const char *const key, char **str); +/** + * @brief Get the boolean value associated with the provided key. + * + * @param[in] obj Object containing the key and value. + * @param[in] key Key. + * @param[out] val Boolean value associated with the provided key. + * + * @retval -EINVAL Invalid parameter. + * @retval -ENODEV Object does not contain the provided key. + * @retval -ENOENT Object is not initialized. + * @retval -ENOTSUP Action not supported for the object's type. + * @retval -ENOMSG Value associated with the key is not a boolean. + * @retval 0 Success; boolean found. + */ +int nrf_cloud_obj_bool_get(const struct nrf_cloud_obj *const obj, const char *const key, + bool *val); + /** * @brief Get and detach the object associated with the provided key. * diff --git a/include/net/nrf_cloud_location.h b/include/net/nrf_cloud_location.h index 41671c10e060..9b9dfccb8cc7 100644 --- a/include/net/nrf_cloud_location.h +++ b/include/net/nrf_cloud_location.h @@ -12,6 +12,7 @@ */ #include +#include #include #include #include @@ -32,6 +33,9 @@ extern "C" { /** Minimum number of access points required by nRF Cloud */ #define NRF_CLOUD_LOCATION_WIFI_AP_CNT_MIN 2 +/** Maximum string length of an anchor name */ +#define NRF_CLOUD_LOCATION_ANCHOR_NAME_MAX 32 + /** @brief Location request type */ enum nrf_cloud_location_type { LOCATION_TYPE_SINGLE_CELL, @@ -41,6 +45,18 @@ enum nrf_cloud_location_type { LOCATION_TYPE__INVALID }; +/** @brief Anchor name list node, to be used with sys_slist_t APIs */ +struct nrf_cloud_anchor_list_node { + sys_snode_t node; + char name[]; +}; + +/** Minimum size of the anchor buffer required to hold one maximum length anchor name. + * Multiply this value by your desired number anchor names to obtain your buffer size. + */ +#define NRF_CLOUD_ANCHOR_LIST_BUF_MIN_SZ (sizeof(struct nrf_cloud_anchor_list_node) + \ + NRF_CLOUD_LOCATION_ANCHOR_NAME_MAX + 1) + /** @brief Location request result */ struct nrf_cloud_location_result { /** The service used to fulfill the location request */ @@ -55,6 +71,26 @@ struct nrf_cloud_location_result { uint32_t unc; /** Error value received from nRF Cloud. NRF_CLOUD_ERROR_NONE on success. */ enum nrf_cloud_error err; + + /** The number of anchors received */ + uint32_t anchor_cnt; + + /** List of received anchor names contained as @ref nrf_cloud_anchor_list_node. + * If all anchor names cannot fit in the list, the number of items in the list + * will be less than @ref anchor_cnt. + */ + sys_slist_t anchor_list; + + /** User provided buffer to contain the @ref anchor_list. + * @kconfig{CONFIG_NRF_CLOUD_LOCATION_PARSE_ANCHORS} must be enabled for anchor data + * to be parsed. + * This buffer must point to valid memory or be set to NULL. + * A valid buffer should have a size of at least @ref NRF_CLOUD_ANCHOR_LIST_BUF_MIN_SZ. + */ + char *anchor_buf; + + /** Size of provided buffer */ + size_t anchor_buf_sz; }; /** @brief Location request config */ @@ -109,6 +145,9 @@ typedef void (*nrf_cloud_location_response_t)(const struct nrf_cloud_location_re * which is do_reply = true, hi_conf = false, and fallback = true. * @param cb Callback function to receive parsed location result. Only used when * config->do_reply is true or config is NULL. + * If @kconfig{CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST} is enabled, the application + * should not access the anchor list data after exiting the callback as it may + * become invalid. * If cb is NULL, JSON result will be sent to the cloud event handler as * an NRF_CLOUD_EVT_RX_DATA_LOCATION event. * @retval 0 Request sent successfully. diff --git a/include/net/nrf_provisioning.h b/include/net/nrf_provisioning.h index c4a8538862fc..aaca80cb0b85 100644 --- a/include/net/nrf_provisioning.h +++ b/include/net/nrf_provisioning.h @@ -106,6 +106,13 @@ int nrf_provisioning_init(struct nrf_provisioning_mm_change *mmode, */ int nrf_provisioning_trigger_manually(void); +/** + * @brief Set provisioning interval. + * + * @param interval Provisioning interval in seconds. + */ +void nrf_provisioning_set_interval(int interval); + /** @} */ #ifdef __cplusplus diff --git a/include/net/wifi_credentials.h b/include/net/wifi_credentials.h index 9d287737dc68..76a12aae2ec5 100644 --- a/include/net/wifi_credentials.h +++ b/include/net/wifi_credentials.h @@ -51,6 +51,7 @@ struct wifi_credentials_header { size_t ssid_len; uint8_t bssid[WIFI_MAC_ADDR_LEN]; uint32_t flags; + uint8_t channel; }; /** @@ -94,6 +95,7 @@ struct wifi_credentials_enterprise { * @param[in] password_buf_len length of password_buf * @param[out] password_len length of password * @param[out] flags flags + * @param[out] channel channel * * @return 0 Success. * @return -ENOENT No network with this SSID was found. @@ -109,7 +111,8 @@ int wifi_credentials_get_by_ssid_personal( char *password_buf, size_t password_buf_len, size_t *password_len, - uint32_t *flags + uint32_t *flags, + uint8_t *channel ); /** @@ -123,6 +126,7 @@ int wifi_credentials_get_by_ssid_personal( * @param[in] password password * @param[in] password_len length of password * @param[in] flags flags + * @param[in] channel Channel * * @return 0 Success. Credentials are stored in persistent storage. * @return -EINVAL A required buffer was NULL or security type is not supported. @@ -137,7 +141,8 @@ int wifi_credentials_set_personal( size_t bssid_len, const char *password, size_t password_len, - uint32_t flags + uint32_t flags, + uint8_t channel ); /** @@ -178,6 +183,23 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal */ int wifi_credentials_delete_by_ssid(const char *ssid, size_t ssid_len); +/** + * @brief Check if credentials storage is empty. + * + * @return true if credential storage is empty, otherwise false + */ +bool wifi_credentials_is_empty(void); + +/** + * @brief Deletes all stored Wi-Fi credentials. + * + * This function deletes all Wi-Fi credentials that have been stored in the system. + * It is typically used when you want to clear all saved networks. + * + * @return 0 on successful, otherwise a negative error code + */ +int wifi_credentials_delete_all(void); + /** * @brief Callback type for wifi_credentials_for_each_ssid. * @param[in] cb_arg arguments for the callback function. Appropriate cb_arg is diff --git a/include/nrf_rpc/nrf_rpc_ipc.h b/include/nrf_rpc/nrf_rpc_ipc.h index 918822ad991d..c7fc25cdec0e 100644 --- a/include/nrf_rpc/nrf_rpc_ipc.h +++ b/include/nrf_rpc/nrf_rpc_ipc.h @@ -41,6 +41,9 @@ struct nrf_rpc_ipc_endpoint { /** IPC Service endpoint bond event. */ struct k_event ept_bond; + + /** The absolute value for binding timeout, started when bonding procedure is initialized */ + k_timeout_t timeout; }; /** @brief nRF RPC IPC Service transport instance. */ @@ -56,8 +59,8 @@ struct nrf_rpc_ipc { /** User context. */ void *context; - /** Indicates if transport is already initialized. */ - bool used; + /** Current transport state. */ + uint8_t state; }; /** @brief Extern nRF RPC IPC Service transport declaration. diff --git a/include/sdfw/sdfw_services/echo_service.h b/include/sdfw/sdfw_services/echo_service.h new file mode 100644 index 000000000000..0fe6aafc5ec2 --- /dev/null +++ b/include/sdfw/sdfw_services/echo_service.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_ECHO_SERVICE_H__ +#define SSF_ECHO_SERVICE_H__ + +#include + +#include + +/** .. include_startingpoint_echo_header_rst */ +/** + * @brief Echo back a c string. + * + * @param[in] str_in c string to be echoed back. + * @param[out] str_out Local buffer for copying the echoed c string into. + * @param[in] str_out_size Size of local buffer. + * + * @return 0 on success, otherwise a negative errno. + */ +int ssf_echo(char *str_in, char *str_out, size_t str_out_size); +/** .. include_endpoint_echo_header_rst */ + +#endif /* SSF_ECHO_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/extmem_remote.h b/include/sdfw/sdfw_services/extmem_remote.h new file mode 100644 index 000000000000..10eecdaa5229 --- /dev/null +++ b/include/sdfw/sdfw_services/extmem_remote.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef EXTMEM_REMOTE_H__ +#define EXTMEM_REMOTE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define EXTMEM_RESULT_SUCCESS 0 /**< The operation completed successfully. */ +#define EXTMEM_RESULT_REMOTE_ERROR 2 /**< The remote failed to execute the operation. */ + +/** @brief Initialize external memory service. + * + * @details Initialize the external memory service state. + * + * @retval 0 if successful. + * @retval -EIO if service could not be initialized. + */ +int extmem_remote_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_REMOTE_H__ */ diff --git a/include/sdfw/sdfw_services/prng_service.h b/include/sdfw/sdfw_services/prng_service.h new file mode 100644 index 000000000000..96abf73fde48 --- /dev/null +++ b/include/sdfw/sdfw_services/prng_service.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_PRNG_SERVICE_H__ +#define SSF_PRNG_SERVICE_H__ + +#include +#include + +/** + * @brief Function to generate random numbers. + * + * @param[in] buffer Pointer to a buffer for the generated data. + * @param[in] length Length of the buffer for generated data. + * + * @return 0 on success, otherwise a non-zero return code. + */ +int ssf_prng_get_random(uint8_t *buffer, size_t length); + +#endif /* SSF_PRNG_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/reset_evt_service.h b/include/sdfw/sdfw_services/reset_evt_service.h new file mode 100644 index 000000000000..cc002f76e6ba --- /dev/null +++ b/include/sdfw/sdfw_services/reset_evt_service.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_RESET_EVT_SERVICE_H__ +#define SSF_RESET_EVT_SERVICE_H__ + +#include + +#include +#include + +/** Error code in response from server if it failed to register or deregister + * the requested subscription. + */ +#define SSF_RESET_EVT_ERROR_SUB 1 + +/** + * @brief User callback invoked by client of reset event service for incoming notifications. + * + * @param[in] domains Bitfield of domains that will be reset. + * @param[in] delay_ms Delay in milliseconds until the reset occurs. + * @param[in] user_data Pointer to user data context + * + * @return 0 on success, otherwise a negative error code. Note that a non-0 value only results + * in an error being logged. + */ +typedef int (*ssf_reset_evt_callback)(uint32_t domains, uint32_t delay_ms, void *user_data); + +/** + * @brief Subscribe to reset event notifications. + * + * @param[in] callback Callback to be invoked for incoming notifications. + * @param[in] context User context given to the callback on incoming events. + * + * @return 0 on success + * -SSF_EINVAL if already subscribed to the service + * -SSF_EFAULT if response from server is not 0 + */ +int ssf_reset_evt_subscribe(ssf_reset_evt_callback callback, void *context); + +/** + * @brief Unsubscribe from all reset event service notifications. + * + * @return 0 on success + * -SSF_EINVAL if callback is NULL + * -SSF_EFAULT if response from server is not 0 + */ +int ssf_reset_evt_unsubscribe(void); + +/** + * @brief Notify all subscribed clients about an incoming reset. + * Note that this is a server side function. + * + * @param[in] domains Bitfield of domains that will be reset. + * @param[in] delay_ms Delay in milliseconds before the incoming reset. + * + * @return Value returned by `ssf_server_notif` + */ +int ssf_reset_evt_notify(uint32_t domains, uint32_t delay_ms); + +#endif /* SSF_RESET_EVT_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/sdfw_update_service.h b/include/sdfw/sdfw_services/sdfw_update_service.h new file mode 100644 index 000000000000..e192addfb982 --- /dev/null +++ b/include/sdfw/sdfw_services/sdfw_update_service.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_SDFW_UPDATE_SERVICE_H__ +#define SSF_SDFW_UPDATE_SERVICE_H__ + +#include + +#include + +/* Error code in response from server if an error occurred when performing the request. */ +#define SSF_SDFW_UPDATE_FAILED 0x3dfc0001 + +/** + * @brief Trigger an SDFW update request by pointing to an SDFW update blob. + * + * @param[in] blob_addr Start address of the SDFW update blob. + * + * @return Return value from `ssf_client_send_request`. + */ +int ssf_sdfw_update(uintptr_t blob_addr); + +#endif /* SSF_SDFW_UPDATE_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/ssf_client.h b/include/sdfw/sdfw_services/ssf_client.h new file mode 100644 index 000000000000..5849ac14a626 --- /dev/null +++ b/include/sdfw/sdfw_services/ssf_client.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_CLIENT_H__ +#define SSF_CLIENT_H__ + +#include +#include + +#include + +/** + * @brief Structure to hold a raw request or response. + */ +struct ssf_client_raw_data { + uint8_t *data; + size_t len; +}; + +/** + * @brief SSF request encode function prototype. Function of this type are + * typically generated from cddl with zcbor. + */ +typedef int (*request_encoder)(uint8_t *payload, size_t payload_len, void *input, + size_t *payload_len_out); + +/** + * @brief SSF response decode function prototype. Function of this type are + * typically generated from cddl with zcbor. + */ +typedef int (*response_decoder)(const uint8_t *payload, size_t payload_len, void *result, + size_t *payload_len_out); + +/** + * @brief SSF service definition (client). + */ +struct ssf_client_srvc { + /* Service ID (unique) */ + uint16_t id; + /* Client's version number */ + uint16_t version; + /* Request encoder */ + request_encoder req_encode; + /* Response decoder */ + response_decoder rsp_decode; + /* Request buffer size */ + size_t req_buf_size; +}; + +/** + * @brief Define a read-only service definition object. + * + * @param _name Name of service definition object. + * @param[in] _srvc_name Short uppercase service name. Must match the service_name variable used + * when specifying the service with the Kconfig.template.service template. + * @param[in] _req_encode Function of type @ref request_encoder. Used when encoding requests. + * @param[in] _rsp_decode Function of type @ref response_decoder. Used when decoding responses. + */ +#define SSF_CLIENT_SERVICE_DEFINE(_name, _srvc_name, _req_encode, _rsp_decode) \ + static const struct ssf_client_srvc _name = { \ + .id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \ + .version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \ + .req_encode = (request_encoder)_req_encode, \ + .rsp_decode = (response_decoder)_rsp_decode, \ + .req_buf_size = (CONFIG_SSF_##_srvc_name##_SERVICE_BUFFER_SIZE) \ + } + +/** + * @brief Initialize SDFW Service Framework. This will initialize underlying transport + * and wait for remote domains to establish connection. + * + * @return 0 on success + * -SSF_EINVAL if transport failed to initialize. + */ +int ssf_client_init(void); + +/** + * @brief Send a request and wait for a response. + * + * @note The req structure is encoded with the service definition's req_encode function + * before it is passed to the underlying transport. The response is decoded with + * the service definition's rsp_decode function. + * + * @param[in] srvc A pointer to a service definition object. + * @param[in] req A pointer to the (zcbor) structure holding the request to be sent. + * @param[out] decoded_rsp A pointer to a (zcbor) structure, allocated by the caller, that + * the response will be decoded into. + * @param[out] rsp_pkt Holds the address of the response packet upon return. Used + * with @ref ssf_client_decode_done to free the response packet. + * This is only necessary if the response contains a CBOR bstr or tstr. + * If the response does not contain a CBOR bstr or tstr, set this to NULL + * to have the function free the response before returning. + * + * @return 0 on success + * -SSF_EINVAL if parameters are invalid. + * -SSF_EBUSY if transport is not initialized. + * -SSF_EPROTO if encode or decode fails. Either on client or server side. + * -SSF_ENOMEM if allocation of transport layer buffer fails. + * -SSF_EIO if sending with underlying transport fails. + * -SSF_EMSGSIZE if message is too long. + * -SSF_EPERM if mismatching domain id on server side. + * -SSF_ENOTSUP if service version number on client and server side does not match. + * -SSF_EPROTONOSUPPORT if the service is not found on server side. + */ +int ssf_client_send_request(const struct ssf_client_srvc *srvc, void *req, void *decoded_rsp, + const uint8_t **rsp_pkt); + +/** + * @brief Send a raw byte string request and wait for a response. + * + * @param[in] srvc A pointer to a service definition object. + * @param[in] raw_req Raw request data to be sent. + * @param[out] raw_rsp Buffer to copy the raw response into and size of the buffer. + * + * @return 0 on success + * -SSF_EINVAL if parameters are invalid. + * -SSF_EBUSY if transport is not initialized. + * -SSF_EPROTO if zcbor encode or decode fails. Either on client or server side. + * -SSF_ENOMEM if allocation of transport layer buffer fails. + * -SSF_EIO if sending with underlying transport fails. + * -SSF_EMSGSIZE if message is too long. + * -SSF_EPERM if mismatching domain id on server side. + * -SSF_ENOTSUP if service version number on client and server side does not match. + * -SSF_EPROTONOSUPPORT if the service is not found on server side. + */ +int ssf_client_send_raw_request(const struct ssf_client_srvc *srvc, + struct ssf_client_raw_data raw_req, + struct ssf_client_raw_data *raw_rsp); + +/** + * @brief Free transport layer response buffer when decoding of response is finished. + * + * @note When decoding CBOR bstr and tstr with zcbor, the zcbor structure will hold + * a pointer into the response buffer and length of the string. Therefore, make + * sure to not call @ref ssf_client_decode_done before the bstr/tstr have been + * processed or copied elsewhere. + * + * @param[in] rsp_pkt A pointer to the response packet to free. + */ +void ssf_client_decode_done(const uint8_t *rsp_pkt); + +#endif /* SSF_CLIENT_H__ */ diff --git a/include/sdfw/sdfw_services/ssf_client_notif.h b/include/sdfw/sdfw_services/ssf_client_notif.h new file mode 100644 index 000000000000..511391e49d9c --- /dev/null +++ b/include/sdfw/sdfw_services/ssf_client_notif.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_CLIENT_NOTIF_H__ +#define SSF_CLIENT_NOTIF_H__ + +#include +#include +#include + +#include + +/** + * @brief SSF notification decode function prototype. + * Functions of this type are typically generated from cddl with zcbor. + */ +typedef int (*ssf_notif_decoder)(const uint8_t *payload, size_t payload_len, void *result, + size_t *payload_len_out); + +/** + * @brief Structure to hold an incoming notification. + * Decode with @ref ssf_client_notif_decode. + */ +struct ssf_notification { + /* Notification data start */ + const uint8_t *data; + /* Length of notification data */ + size_t data_len; + /* + * Start of received packet. For releasing underlying buffer + * with ssf_client_transport_decoding_done. + */ + const uint8_t *pkt; + /* Notification packet decoder */ + ssf_notif_decoder notif_decode; +}; + +/** + * @brief SSF notification handler prototype. + * + * @param[in] notif A pointer to the incoming notification. + * @param[in] context Optional user context. + * + * @return 0 on success, otherwise a negative errno. + */ +typedef int (*ssf_notif_handler)(struct ssf_notification *notif, void *context); + +/** + * @brief SSF notification listener. + */ +struct ssf_client_notif_listener { + /* Service ID */ + uint16_t id; + /* Client's version number for the service */ + uint16_t version; + /* Packet decoder for notification */ + ssf_notif_decoder notif_decode; + /* Handler for notification */ + ssf_notif_handler handler; + /* Optional user context */ + void *context; + /* Is listener registered */ + bool is_registered; +}; + +/** + * @brief Define a notification listener, that is used for invoking the correct handler + * function when receiving notifications from the server. + * The listener must be registered with @ref ssf_client_notif_register + * before notifications can be received. + * + * @param _name Name of the notification listener. + * @param[in] _srvc_name Short uppercase service name. Must match the service_name variable used + * when specifying the service with the Kconfig.template.service template. + * @param[in] _notif_decode Function of type @ref ssf_notif_decoder. Used when decoding + * notifications. + * @param[in] _handler Function of type @ref ssf_notif_handler. Invoked when receiving a + * notification with the associated service id. + */ +#define SSF_CLIENT_NOTIF_LISTENER_DEFINE(_name, _srvc_name, _notif_decode, _handler) \ + static int _handler(struct ssf_notification *notif, void *context); \ + static struct ssf_client_notif_listener _name = { \ + .id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \ + .version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \ + .notif_decode = (ssf_notif_decoder)_notif_decode, \ + .handler = _handler, \ + .is_registered = false \ + } + +/** + * @brief Decode a received notification. + * + * @param[in] notif A pointer to the incoming notification. + * @param[out] decoded_notif A pointer to a (zcbor) structure, allocated by the caller, + * to be populated by the associated listener's decode function. + * + * @return 0 on success, + * -SSF_EINVAL if parameters are invalid. + * -SSF_EPROTO if decode function fails or is missing. + */ +int ssf_client_notif_decode(const struct ssf_notification *notif, void *decoded_notif); + +/** + * @brief Must be invoked from @ref ssf_notif_handler to free transport layer buffer when + * the request have been decoded and can be freed. + * + * @param[in] notif A pointer to the incoming notification. + */ +void ssf_client_notif_decode_done(struct ssf_notification *notif); + +/** + * @brief Register a listener. Enables the listener's handler to be called + * when receiving notifications from server with associated service id. + * + * @param[in] listener The listener to register. + * @param[in] context Optional user context passed to handler function when a notification + * is received. + * + * @return 0 on success, + * -SSF_EINVAL if parameters are invalid. + * -SSF_EALREADY if the listener is already registered. + * -SSF_ENOBUFS if max number of listeners have already been registered. + */ +int ssf_client_notif_register(struct ssf_client_notif_listener *listener, void *context); + +/** + * @brief De-register a listener. Stops the listener's handler from being called + * when receiving notifications from server with associated service id. + * + * @param[in] listener The listener to de-register. + * + * @return 0 on success, + * -SSF_EINVAL if parameters are invalid. + * -SSF_ENXIO if the listener is not already registered. + */ +int ssf_client_notif_deregister(struct ssf_client_notif_listener *listener); + +#endif /* SSF_CLIENT_NOTIF_H__ */ diff --git a/include/sdfw/sdfw_services/ssf_errno.h b/include/sdfw/sdfw_services/ssf_errno.h new file mode 100644 index 000000000000..393edadff3b6 --- /dev/null +++ b/include/sdfw/sdfw_services/ssf_errno.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_ERRNO_H__ +#define SSF_ERRNO_H__ + +#define SSF_EPERM 1 +#define SSF_EIO 5 +#define SSF_ENXIO 6 +#define SSF_EAGAIN 11 +#define SSF_ENOMEM 12 +#define SSF_EFAULT 14 +#define SSF_EBUSY 16 +#define SSF_EINVAL 22 +#define SSF_ENODATA 61 +#define SSF_EPROTO 71 +#define SSF_EBADMSG 77 +#define SSF_ENOBUFS 105 +#define SSF_EADDRINUSE 112 +#define SSF_ETIMEDOUT 116 +#define SSF_EALREADY 120 +#define SSF_EMSGSIZE 122 +#define SSF_EPROTONOSUPPORT 123 +#define SSF_ENOTSUP 134 + +#endif /* SSF_ERRNO_H__ */ diff --git a/include/sdfw/sdfw_services/suit_service.h b/include/sdfw/sdfw_services/suit_service.h new file mode 100644 index 000000000000..c8291acdacdf --- /dev/null +++ b/include/sdfw/sdfw_services/suit_service.h @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_SERVICE_H__ +#define SUIT_SERVICE_H__ + +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int suit_ssf_err_t; + +/** Container for manifest class id and manifest role for ssfipc. */ +typedef struct { + suit_manifest_role_t role; + suit_uuid_t vendor_id; + suit_manifest_class_id_t class_id; + suit_downgrade_prevention_policy_t downgrade_prevention_policy; + suit_independent_updateability_policy_t independent_updateability_policy; + suit_signature_verification_policy_t signature_verification_policy; +} suit_ssf_manifest_class_info_t; + +#define SUIT_SSF_MISSING_COMPONENT 1 /**< The component in question was not found. */ +#define SUIT_SSF_FAIL_CONDITION 2 /**< The test failed (i.e. digest comparison). */ +#define SUIT_SSF_ERR_MANIFESTCLASSID 3 /**< Invalid or unsupported manifest class id */ + +/** @brief Check if the installed component digest matches. + * @details The purpose of this function is to check if the specific component is installed in + * the system. + * The function checks the input digest against the value stored inside the manifest(s) + * that were used to boot the system. + * If the input component boundaries differ from the one that is installed, the function + * will return false, even if the overlapping binary contents matches. + * This behaviour is mandatory, so an attacker cannot check each byte of the memory + * against the dictionary of the known hashes and read back the whole memory. + * + * @param[in] component_id Pointer to the structure with the component ID. + * @param[in] alg_id ID of an algorithm that was used to calculate the digest. + * @param[in] digest The digest to check. + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_UNSUPPORTED if specified digest type is not supported. + * @retval SUIT_SSF_FAIL_CONDITION if the digest does not match. + * @retval SUIT_SSF_MISSING_COMPONENT if the digest of the specified memory is unknown. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_check_installed_component_digest(suit_plat_mreg_t *component_id, int alg_id, + suit_plat_mreg_t *digest); + +/** @brief Trigger the system update procedure. + * + * @details This function is going to reboot the system. + * There are no means to pause or abort the upgrade after this function is called. + * + * @note The envelope must contain at least authentication wrapper and the SUIT manifest. + * + * @param[in] regions List of update candidate memory regions (envelope, caches). + * By convention, the first region holds the SUIT envelope. + * @param[in] len Length of the memory regions list. + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_NOMEM if update candidate has too many regions. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if device managing SUIT storage is not initialized. + * @retval SUIT_PLAT_ERR_IO if failed to save the update candidate info. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_trigger_update(suit_plat_mreg_t *regions, size_t len); + +/** @brief Read the information about the manifest, that was used to boot the system. + * + * @details In the SUIT-based system, the firmware is identified by its digest. + * There is no semantic version attached to the firmware. + * This function allows to inform an application about the current revision and digest + * of the manifest. + * This data may be forwarded to the tools that would like to read the device state. + * + * @param[in] manifest_class_id Manifest class ID. + * @param[out] seq_num Pointer to the memory to store the current root manifest sequence number + * value. + * @param[out] version Manifest semantic version. + * @param[out] status Digest verification status + * @param[out] alg_id ID of an algorithm that was used to calculate the digest. + * @param[out] digest Pointer to the memory to store the digest of the current root manifest + * value. + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_SIZE if the manifest version output buffer is too small. + * @retval SUIT_PLAT_ERR_NOMEM if the manifest digest output buffer is too small. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if device manging SUIT storage is not initialized. + * @retval SUIT_PLAT_ERR_BUSY if SUIT decoder is currently busy. + * @retval SUIT_PLAT_ERR_NOT_FOUND if SUIT storage does not contain a valid manifest with + * the specified class ID. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_get_installed_manifest_info(suit_manifest_class_id_t *manifest_class_id, + unsigned int *seq_num, suit_semver_raw_t *version, + suit_digest_status_t *status, int *alg_id, + suit_plat_mreg_t *digest); + +/** @brief Check validity and read information about the update candidate. + * + * @details In the SUIT-based system, the firmware is identified by its digest. + * This function allows to inform an application about the revision and digest + * of the update candidate. + * + * @param[out] manifest_class_id Manifest class ID. + * @param[out] seq_num Pointer to the memory to store the current root manifest sequence number + * value. + * @param[out] version Manifest semantic version. + * @param[out] alg_id ID of an algorithm that was used to calculate the digest. + * @param[out] digest Pointer to the memory to store the digest of the current root manifest + * value. + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_SIZE if the manifest version output buffer is too small. + * @retval SUIT_PLAT_ERR_NOMEM if the manifest digest or class ID is invalid. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if device manging SUIT storage is not initialized. + * @retval SUIT_PLAT_ERR_BUSY if SUIT decoder is currently busy. + * @retval SUIT_PLAT_ERR_NOT_FOUND if SUIT storage does not contain information about the update + * candidate. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_get_install_candidate_info(suit_manifest_class_id_t *manifest_class_id, + unsigned int *seq_num, suit_semver_raw_t *version, + int *alg_id, suit_plat_mreg_t *digest); + +/** @brief Get an array of supported manifest roles. + * + * @param[out] roles Array of structures containing manifest roles. + * @param[in,out] size As input - maximal amount of elements an array can hold, + * as output - amount of stored elements. + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_SIZE if the input array is too small to store all information. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_get_supported_manifest_roles(suit_manifest_role_t *roles, size_t *size); + +/** @brief Get class info (class id, vendor ID, role) for a given, supported manifest role. + * Prior to calling this function, @ref suit_get_supported_manifest_roles should be + * called to get the supported roles. + * + * @param[in] role Manifest role. + * @param[out] class_info Manifest class info (class id, role). + * + * @retval SUIT_PLAT_SUCCESS if successful. + * @retval SUIT_PLAT_ERR_INVAL if input parameters are invalid. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if the data received from SDFW is malformed. + * @retval SUIT_PLAT_ERR_NOT_FOUND if the given role is not supported. + * @retval SUIT_PLAT_ERR_IPC in case of SSF protocol error. + */ +suit_ssf_err_t suit_get_supported_manifest_info(suit_manifest_role_t role, + suit_ssf_manifest_class_info_t *class_info); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_SERVICE_H__ */ diff --git a/include/tfm/tfm_builtin_key_ids.h b/include/tfm/tfm_builtin_key_ids.h index a054ea4a2f4c..58555cf5bb04 100644 --- a/include/tfm/tfm_builtin_key_ids.h +++ b/include/tfm/tfm_builtin_key_ids.h @@ -7,6 +7,16 @@ #ifndef __TFM_BUILTIN_KEY_IDS_H__ #define __TFM_BUILTIN_KEY_IDS_H__ +#ifdef CONFIG_PSA_CRYPTO_DRIVER_CRACEN + +#include +#define TFM_BUILTIN_KEY_LOADER_KEY_LOCATION PSA_KEY_LOCATION_CRACEN +enum tfm_builtin_key_id_t { + TFM_BUILTIN_KEY_ID_HUK = CRACEN_BUILTIN_MKEK_ID, + TFM_BUILTIN_KEY_ID_IAK = CRACEN_BUILTIN_IDENTITY_KEY_ID, +}; + +#else /** * \brief The PSA driver location for TF-M builtin keys. Arbitrary within the * ranges documented at @@ -29,5 +39,6 @@ enum tfm_builtin_key_id_t { /* Platform specific keys here */ TFM_BUILTIN_KEY_ID_MAX = 0x7FFF817Bu, }; +#endif /* CONFIG_PSA_CRYPTO_DRIVER_CRACEN */ #endif /* __TFM_BUILTIN_KEY_IDS_H__ */ diff --git a/samples/bluetooth/peripheral_uart/src/uart_async_adapter.h b/include/uart_async_adapter.h similarity index 87% rename from samples/bluetooth/peripheral_uart/src/uart_async_adapter.h rename to include/uart_async_adapter.h index 8bba7df4908d..0937e6b00fc7 100644 --- a/samples/bluetooth/peripheral_uart/src/uart_async_adapter.h +++ b/include/uart_async_adapter.h @@ -3,27 +3,31 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#ifndef __UART_ASYNC_ADAPTER_H +#define __UART_ASYNC_ADAPTER_H /** @file * @brief UART asynchronous API adapter */ +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /** - * @brief UART asynchronous API universal adapter - * @defgroup uart_async_adapter UART ASYNC adapter + * @defgroup uart_async_adapter UART async adapter * @{ + * @brief UART asynchronous API universal adapter * * This module acts as an adapter between UART interrupt and async interface. * - * @note The UART ASYNC API adapter implementation is experimental. + * @note The UART async API adapter implementation is experimental. * It means it is not guaranteed to work in any corner situation. */ -#include -#include -#include - - /** * @brief UART asynch adapter data structure * @@ -42,7 +46,7 @@ struct uart_async_adapter_data { struct k_spinlock lock; /** Data used for output transmission */ - struct { + struct uart_async_adapter_data_rx { /** The original buffer pointer set when data transfer was requested */ const uint8_t *buf; /** Current buffer position */ @@ -56,7 +60,7 @@ struct uart_async_adapter_data { } tx; /** Data used for input transmission */ - struct { + struct uart_async_adapter_data_tx { /** Base buffer pointer used now for data reception */ uint8_t *buf; /** Current position to write data into */ @@ -79,7 +83,7 @@ struct uart_async_adapter_data { }; /** - * @brief Driver API for ASYNC adapter + * @brief Driver API for async adapter * * The API of the UART async adapter uses standard UART API structure. */ @@ -88,7 +92,7 @@ extern const struct uart_driver_api uart_async_adapter_driver_api; /** * @brief The name of the data instance connected with created device instance * - * @name _dev_name The name of the created device instance + * @param _dev_name The name of the created device instance */ #define UART_ASYNC_ADAPTER_INST_DATA_NAME(_dev_name) _CONCAT(uart_async_adapter_data_, _dev_name) @@ -99,7 +103,7 @@ extern const struct uart_driver_api uart_async_adapter_driver_api; /** * @brief The macro that creates and instance of the UART async adapter * - * @name _dev The name of the created device instance + * @param _dev The name of the created device instance */ #define UART_ASYNC_ADAPTER_INST_DEFINE(_dev) \ static struct uart_async_adapter_data UART_ASYNC_ADAPTER_INST_DATA_NAME(_dev); \ @@ -124,3 +128,9 @@ extern const struct uart_driver_api uart_async_adapter_driver_api; void uart_async_adapter_init(const struct device *dev, const struct device *target); /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __UART_ASYNC_ADAPTER_H */ diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt new file mode 100644 index 000000000000..af84108810ef --- /dev/null +++ b/kernel/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if(CONFIG_NCS_BOOT_BANNER) + zephyr_sources(banner.c) +endif() diff --git a/kernel/Kconfig b/kernel/Kconfig new file mode 100644 index 000000000000..9427f96250b3 --- /dev/null +++ b/kernel/Kconfig @@ -0,0 +1,35 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "General Kernel Options" + +menuconfig NCS_BOOT_BANNER + bool "NCS boot banner" + depends on BOOT_BANNER + default y + help + This option provided an enhanced boot banner output that can include application name + and version (if set), NCS version and underlying zephyr version. + +if NCS_BOOT_BANNER + +config NCS_APPLICATION_BOOT_BANNER_STRING + string "Boot banner string" if "$(APP_VERSION_EXTENDED_STRING)" != "" + default "My Application" if "$(APP_VERSION_EXTENDED_STRING)" != "" + help + Use this option to set the application boot banner. + +config NCS_NCS_BOOT_BANNER_STRING + string + default "nRF Connect SDK" + +config NCS_ZEPHYR_BOOT_BANNER_STRING + string + default "Zephyr OS" + +endif # NCS_BOOT_BANNER + +endmenu diff --git a/kernel/banner.c b/kernel/banner.c new file mode 100644 index 000000000000..4903d323a681 --- /dev/null +++ b/kernel/banner.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#if defined(CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING) +#include +#if defined(NCS_APPLICATION_BOOT_BANNER_GIT_REPO) +#include +#endif +#endif + +#if defined(CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING) +#define NCS_PREFIX "Using " +#else +#define NCS_PREFIX "Booting " +#endif + +void boot_banner(void) +{ +#if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) + printk("*** Delaying boot by " STRINGIFY(CONFIG_BOOT_DELAY) "ms... ***\n"); + k_busy_wait(CONFIG_BOOT_DELAY * USEC_PER_MSEC); +#endif + +#if defined(CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING) + printk("*** Booting " CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING " v" + APP_VERSION_STRING +#if defined(NCS_APPLICATION_BOOT_BANNER_GIT_REPO) + "-" APP_COMMIT_STRING +#else + " - unknown commit" +#endif + " ***\n"); +#endif + +#if defined(CONFIG_NCS_NCS_BOOT_BANNER_STRING) + printk("*** " NCS_PREFIX CONFIG_NCS_NCS_BOOT_BANNER_STRING " v" + NCS_VERSION_STRING "-" NCS_COMMIT_STRING " ***\n"); +#endif + +#if defined(CONFIG_NCS_ZEPHYR_BOOT_BANNER_STRING) + printk("*** Using " CONFIG_NCS_ZEPHYR_BOOT_BANNER_STRING " v" + KERNEL_VERSION_STRING "-" ZEPHYR_COMMIT_STRING " ***\n"); +#endif +} diff --git a/lib/bin/CMakeLists.txt b/lib/bin/CMakeLists.txt index de7c0b1eadbe..47e980ddcc75 100644 --- a/lib/bin/CMakeLists.txt +++ b/lib/bin/CMakeLists.txt @@ -5,4 +5,3 @@ # add_subdirectory_ifdef(CONFIG_LWM2M_CARRIER lwm2m_carrier) -add_subdirectory_ifdef(CONFIG_BT_LL_ACS_NRF53 bt_ll_acs_nrf53) diff --git a/lib/bin/Kconfig b/lib/bin/Kconfig index 21f5bee738fa..ce31a99c91ab 100644 --- a/lib/bin/Kconfig +++ b/lib/bin/Kconfig @@ -7,6 +7,5 @@ menu "Binary libraries" rsource "lwm2m_carrier/Kconfig" -rsource "bt_ll_acs_nrf53/Kconfig" endmenu diff --git a/lib/bin/bt_ll_acs_nrf53/CMakeLists.txt b/lib/bin/bt_ll_acs_nrf53/CMakeLists.txt deleted file mode 100644 index 64240a47d2a8..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_library_sources(src/ble_hci_vsc.c) -zephyr_include_directories(include) diff --git a/lib/bin/bt_ll_acs_nrf53/Kconfig b/lib/bin/bt_ll_acs_nrf53/Kconfig deleted file mode 100644 index c39185638977..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/Kconfig +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -config BT_LL_ACS_NRF53 - bool "LE Audio Controller Subsystem for nRF53" - select DEPRECATED - depends on (SOC_NRF5340_CPUAPP || SOC_NRF5340_CPUNET) - default n - help - Use LE Audio Controller Subsystem Link Layer binary. Only for nRF53 NET core. - - This binary has been deprecated and should not be used. - -#----------------------------------------------------------------------------# -menu "Log levels" - -module = BLE_HCI_VSC -module-str = ble-hci-vsc -source "subsys/logging/Kconfig.template.log_config" - -endmenu # Log levels diff --git a/lib/bin/bt_ll_acs_nrf53/bin/LICENSE b/lib/bin/bt_ll_acs_nrf53/bin/LICENSE deleted file mode 100644 index 4f70c19c47f1..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/bin/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -Copyright (c) 2021, PACKETCRAFT, INC. - -All rights reserved. - -Redistribution and use in binary forms, without modification, are permitted provided that the following -conditions are met: - -1. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA nRF53 chip -product or a software update for such product, must reproduce the above copyright notice, this list of -conditions and the following disclaimer in the documentation and/or other materials provided with the -distribution. - -2. Neither the name of Packetcraft, Inc. nor Nordic Semiconductor ASA nor the names of its -contributors may be used to endorse or promote products derived from this software without specific -prior written permission. - -3. This software, with or without modification, must only be used with a Nordic Semiconductor ASA -nRF53 chip. - -4. The software provided in binary form under this license must not be reverse engineered, decompiled, -modified and/or disassembled. - -5. THIS SOFTWARE IS PROVIDED BY PACKETCRAFT INC. AND NORDIC SEMICONDUCTOR ASA "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL PACKETCRAFT, INC., NORDIC SEMICONDUCTOR ASA OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_18929.hex b/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_18929.hex deleted file mode 100644 index 786577408252..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_18929.hex +++ /dev/null @@ -1,13272 +0,0 @@ -:020000040100F9 -:100000000000012179C402014DC402012DC4020186 -:100010004DC402014DC402014DC402014DC4020190 -:100020004DC402014DC402014DC402014DC4020180 -:100030004DC402014DC402014DC402014DC4020170 -:100040004DC402014DC402014DC402014DC4020160 -:100050004DC402014DBF02014DC402014DC4020155 -:100060002DD502014DC4020181BC02014DC4020123 -:10007000ADC102014DC402014DC402014DC40201D3 -:100080004DC40201F9BF0201BDBE0201FDC1020162 -:100090004DC402014DC4020105C002014DC402015C -:1000A000BDC10201CDC102014DC402014DC4020116 -:1000B0004DC402014DC40201000000000000000018 -:1000C0000000000000000000000000000000000030 -:1000D0000000000000000000000000000000000020 -:1000E0000000000000000000000000000000000010 -:1000F0000000000000000000000000000000000000 -:10010000002070470388F7B5A3F57C4306460C46EC -:10011000032B4DD8DFE803F00212204391F90000D1 -:1001200000F0B0FA04460120318824F0C3F818B179 -:1001300000F8054924F06AF801203AE0CB788A7883 -:10014000207802EB0322497892B22DF053F808B1DF -:100150000024E8E71224E6E7CA798B79497903EBB2 -:1001600002232279E07802EB0122A178657801EB85 -:1001700000212078E77A00EB0520A57A9BB205EBF9 -:100180000725ADB20195657A247A92B204EB052475 -:10019000A4B2009489B280B22EF08EFAD7E7087824 -:1001A0002DF012F90028D5D060782DF029F9CEE78E -:1001B000002003B0F0BD00002DE9F047A84D86B047 -:1001C00028462CF0D1FC4FF49673A64EEB803046B7 -:1001D00025F082FE402206F10C0102202CF0D8FC12 -:1001E000402206F13E0101202CF0D2FC402206F113 -:1001F000450106202CF0CCFC1022ADF8042008228A -:100200000B238DF80620202233714FF49C63ADF848 -:1002100008208022042740F20D11B383F38CADF83F -:100220000C20B27B1C338DF80E208DF81220ADF817 -:10023000143096F8242096F82330ADF810101344AB -:1002400096F82A200DEB0701134496F82B20052081 -:1002500013448DF816308DF80A702AF0DDFD80B257 -:100260002AF0A8FE2AF0C8FF2BF0DCF800F066F9AF -:100270002AF0B0FE80462AF0B3FE0446284629F054 -:10028000D5FF22464146384603F078FD08EB0009C9 -:10029000A4EB000A054652464946384603F082F868 -:1002A0000544AAEB000209EB0001384603F07CF993 -:1002B0004719304625F042FE96F82250B844E41B18 -:1002C00035B12146404625F081FF05468044241A79 -:1002D0002146404625F035FF241A80442146054436 -:1002E000404625F044FF241A80448146214640467A -:1002F00025F061FF241A804482462146404625F0BD -:1003000048FF3D44211A0746404425F07FFF002462 -:100310004D4455443D44054429F08EFF02F04AFD0A -:1003200000F048FC02F0D8FB01F0EEFA02F0F0FC1D -:1003300001F0B0F801F0CEF801F03EFD2CF0A6FF80 -:1003400002F0B2F802F048FA01F0DAFD01F09CFE8A -:1003500003F0ECFC44482AF037FF2AF061FC25F05A -:10036000E9FE25F049FF25F039FF25F0F9FE25F0DB -:100370003CFF25F054FF25F059FF25F0E4FE25F061 -:100380003DFF25F048FF25F00DFF25F0FBFE25F091 -:10039000F0FE25F052FF25F010FF25F0FCFE25F0C1 -:1003A00013FF25F03AFF31482AF00EFF25F0CCFD6F -:1003B0002F482AF009FFB28DF18C2AF041F825F080 -:1003C000DDF825F0E7F925F095F925F007F925F096 -:1003D000F1F925F065F925F0F3F825F0CBF925F0D2 -:1003E0006BFA25F0DBF825F0A5F925F007F925F0E3 -:1003F00079F925F051FA25F03BFA25F031F925F08D -:100400000FF925F01DF925F03BF925F011FA1948EF -:100410002AF0DAFE25F0E0F925F0FCFB164825F07D -:10042000A7F828462AF0C6FD01A80194ADF80840B7 -:1004300025F006FF042168462CF05EFD684628F092 -:10044000EBFE012200214FF4003025F0A9FF0B48FC -:100450002AF0E2FE2AF0ECFE204606B0BDE8F08766 -:10046000880100219801002141AC0201E95F0201ED -:100470006DA40201A95E0201050100010101000154 -:10048000014B1878704700BF00000720014B19701E -:10049000704700BF00000720012070470122014B78 -:1004A0005A6070470020014138B5C40034342046FA -:1004B00030F05CFF054618B12246002130F08DFF78 -:1004C000284638BD2FF016BF70B50E46CAB1541E6F -:1004D000A0B22AF09FFD054698B12246711C30F06B -:1004E00055FF3378022B0ED0052B05D0012B08D1F8 -:1004F00000212A46084602E02A46032100202AF06D -:100500000BF8002070BD2A460121F7E7C30703D589 -:10051000024B58682FF0A0BD704700BF2802002191 -:1005200048F29C63C360044B436003F5547303605B -:1005300020238360704700BF048007201FB56846F2 -:10054000FFF7EEFF0298FFF7AFFF044C2060029820 -:10055000FFF7AAFF606004B010BD00BF28020021B1 -:1005600030B5294B8BB004AC93E80300002284E83B -:100570000300264906202BF057FC25482BF070FC81 -:1005800006A8FFF7CDFF204630F0CEFB099B21489F -:10059000214C436130F0AAFB22462049204830F02C -:1005A00071FB226893680BB102F10C0304201D4A11 -:1005B000069990601062012051601B49BDF82040EF -:1005C0000D684968156091611849079D886102208E -:1005D00053619481D362D5619484CA620022886297 -:1005E000134808620092134830F00CFA124B134A79 -:1005F0000293134B0F4901934FF0FF3311480093BF -:100600002FF0FEFD0BB030BD3C2403010D050001B1 -:100610004424030100000021E40100211C24030103 -:1006200026240301C402002128020021F80200212F -:10063000C824030130020021C50400012E24030157 -:10064000C9040001E8010021022907B5184603F199 -:10065000FF3310D1042100F8011C012108480A448D -:1006600001910092D0E909122FF02AFD03B05DF844 -:1006700004EB29F0D1BE01290CBF02210521EAE7D4 -:10068000E8010021024B83F87B000020704700BF87 -:10069000405100212CF046BA2DE9F8431C46D0F811 -:1006A0002C90C56807460E46904629F085FE99F8BD -:1006B0000D302C44022B04440DD0032B0DD0012B04 -:1006C00000D12834306C3D690319AB4208D9356438 -:1006D0000020BDE8F8831834F4E704F5A874F1E7C6 -:1006E0007B682D1A63B14146986829F06BFE8542FC -:1006F00028BF0546AC4203D9336C2B443364E7E78B -:10070000281B4FF47A75044B1B689C886C43A042ED -:1007100028BF2046DDE700BF345300211FB5012369 -:100720008DF80430002301A8CDE902332CF078F9CC -:1007300005B05DF804FB1FB5002301A8CDE9013326 -:1007400003932CF06DF905B05DF804FB2DE9F84337 -:1007500004468846C66A2CF0AFFC05460146A068F0 -:1007600006F1980729F02EFE78B9A368DFF890907B -:10077000C9F8843029F020FE2844A060D9F88410FC -:10078000284629F01FFEC6F8D800D6F8A4300BB1D1 -:1007900020469847394600232046A268FFF77CFF91 -:1007A000074618B9BDE8F84329F0D4BD144DA36835 -:1007B0004046C5F884302CF08FF8124B05F18800C4 -:1007C000C5F88830104BC5F89470C5F88C30A36814 -:1007D000C5F890302CF01CF9002385F88030D6F84D -:1007E0009C304BB1FFF79AFF96F8CA10D6F89800E4 -:1007F000BDE8F8432CF064B9FFF79DFFF4E700BFB4 -:1008000064060021C50A0001A90800012DE9F8438A -:1008100080460C4629F0A8FD064618B10126304650 -:10082000BDE8F8832CF048FC1D4D8146D5F88410B6 -:1008300029F0C8FD236C03442364C5F8849029F093 -:10084000BBFD4A46034621464046FFF725FF0746C3 -:100850000028E3D0636A53B10246494640469847B0 -:1008600028B10122D8F82C3083F8C820D7E7D5F872 -:10087000848029F0A1FD4044C5E9240709482CF0F3 -:10088000C7F8002385F88030636833B1FFF746FF6F -:10089000272120682CF014F9C1E7FFF74CFFF7E798 -:1008A00064060021EC0600212DE9F04F87B09A463E -:1008B0009DF8403003910293934607462CF0FCFBD1 -:1008C000DFF8F491C9F8000029F03EFDDDE90231BE -:1008D000C46A8046D4F8C450ADB194F8C820012A47 -:1008E00011D1CDE900A30A465B463946D4F8B800D9 -:1008F000A847012804D10023C4F8B83084F8C830D0 -:1009000007B0BDE8F08F6D4A6D4D92F88060701CA5 -:1009100082F8800076B1022E00F08680AC8C2CF03C -:10092000CBFBD9F80030C01A844240F2B580A88CC5 -:10093000A884E5E707B3FB1E012B40F2B680042F25 -:1009400068D06FD833460126032F5DD032461E464D -:10095000EB690133EB613346164643B117F0FB0FE9 -:1009600046D0404604F19801FFF750FF0646002E9E -:10097000D4D029F0FFFCD1E784F8CC1084F8CD3036 -:100980003A46C4E934BAD4F8980004F1E00304F11B -:10099000800102F01BFB002834D04046D4F8A83078 -:1009A000D4F89810984700287DD06E8C2CF084FBEA -:1009B000D9F80030C01A86421DD9688C94F8C93025 -:1009C0006884ADF81030D4F89C300593FFF7A6FE8C -:1009D000012104A82CF056F8D4F8AC301BB14046E5 -:1009E000D4F8981098472B6801332B60002F95D0CE -:1009F0002CF096F8B5E72CF05FFBD9F80030C01A60 -:100A000080B2DBE70127EEE7AA680132AA60002B7B -:100A1000A7D1ACE7334601266A6801326A60002B31 -:100A2000E6D1A4E7012293E76FB1FB1E012B1ED98B -:100A3000042F4FF000034FF0010629D022D9EA69B4 -:100A40000132EA6189E73A46D4F8A00004F1E003F4 -:100A500004F1800102F0BAFA28B14046D4F8B4306B -:100A6000D4F8A01098472B6901332B61C0E7D4F864 -:100A7000B430002140469847042F4FF001034FF057 -:100A8000000605D0032FDAD1AA690132AA61BEE7B8 -:100A90006A6901326A61C2E72CF00EFBD9F80030B6 -:100AA000C01A80B244E7012796E7042F4FF00103F4 -:100AB0007FF44AAFB0E700BFDC05002164060021E7 -:100AC000280300212DE9F84381462CF0F5FA364E33 -:100AD000306029F039FCC56A0746D5F8C03083B1CB -:100AE00095F8C820012A0CD14946D5F8B800984796 -:100AF000012804D10023C5F8B83085F8C830BDE816 -:100B0000F8832A4B2A4C93F8808008F10102B8F14F -:100B1000010F83F880202CD1B9F1000F3FD1384666 -:100B2000D5F8B030D5F89C10984790B1B4F8208033 -:100B30002CF0C2FA3368C01A804524D9238C238450 -:100B4000FFF7F9FD2721D5F8A0002BF0DFFF4FF0CC -:100B50000008E3680133E360B8F1000F09D02BF01F -:100B6000DFFF384605F19801FFF750FE08B129F084 -:100B700001FCE58C2CF0A0FA3368C01A854208D934 -:100B8000E08CE084BBE72CF097FA3368C31A9BB281 -:100B9000D5E72CF091FA3368C01A80B2F1E7E36927 -:100BA0000133E361E3E700BFDC05002164060021B7 -:100BB0002803002108B50220054A064902F034F94D -:100BC000BDE8084028220021034830F006BC00BFE1 -:100BD000950600014D0700012803002130B50446A9 -:100BE000044D0FCD0FC40FCD0FC495E8030084E86A -:100BF000030030BD280300211FB5002301A8CDE963 -:100C0000013303932BF00CFF05B05DF804FB1FB517 -:100C100001238DF80430002301A8CDE902332BF025 -:100C2000FFFE05B05DF804FB70B50546C66A0846D0 -:100C30002BF052FE114C124B04F18800C4F888309E -:100C4000104BC4F88C30D6F8B430C4F89430AB688C -:100C5000C4F890302BF0DCFE002384F88030D6F806 -:100C6000983043B1FFF7D3FFBDE8704040F2011167 -:100C700005482BF025BFFFF7BFFFF5E7640600210D -:100C8000791000013D14000150030021F8B505461C -:100C9000134EC76A08462BF01FFE124C336804F14E -:100CA0008800C4F88830104BC4F88C30D7F8A030D6 -:100CB000C4F89430AB68C4F890302BF0A9FE002340 -:100CC00084F88030336843B1FFF7A1FFBDE8F840F6 -:100CD00040F2011105482BF0F3BEFFF78DFFF5E759 -:100CE000B805002164060021F10C000188040021F0 -:100CF0002DE9F04F85B08B469DF838100292039194 -:100D00009A4606462CF0D8F9DFF89482DFF89492E0 -:100D1000C8F8000029F018FB99F880200746C56A3A -:100D2000A14C039982B1032A00F0BC80258C2CF0E1 -:100D3000C3F9D8F80030C01A854240F22981208CCE -:100D4000208405B0BDE8F08F012E00F08A800AD91A -:100D5000F31E012B76D9042E00F09A8000F2A080B9 -:100D60001346012278E0032385F8BEB04FF0010B53 -:100D700089F88030029B85F8BF10C5E9303A8B496D -:100D8000D5F8983085F8C8B09847002838D0029038 -:100D900028462BF0A1FD029B09F188005344C9F8B5 -:100DA00090302BF035FEB4F81C902CF085F9D8F873 -:100DB0000030C01A81451CD9A08BA083FFF71CFF0F -:100DC00040F2011179482BF07BFED5F89C30384673 -:100DD00076499847B0FA80F35B09226801322260B5 -:100DE000002BA3D016F0FB0F00F0A98029F0C2FA67 -:100DF0009CE72CF061F9D8F80030C01A80B2DCE72B -:100E000095F8BC3005F1980033B1694B1B68BBB154 -:100E1000594698470346E0E795F8CA30012B0AD1B6 -:100E2000644A1568002DD8D00146604A3846CDF88E -:100E300000A0A847EEE73846D5F89C305B499847B4 -:100E40005B46CAE71146D5F89C3002929847042EBB -:100E50004FF00103029A1DD0032E13D011461A46FB -:100E600006E01146D5F89C30029298473146029A26 -:100E7000A3690133A36113460A46002BB2D1002AAD -:100E8000B4D153E7A1680131A160002BAED1F6E7E0 -:100E900013460122616801316160002B4FD1EEE7FA -:100EA0000121E5E7D5F89830AEB1F21E012A57D9F5 -:100EB000324600219847D5F89C30002138469847A3 -:100EC000042E4FF000034FF001025DD056D9A16906 -:100ED0000131A161D1E7324685F8C86085F8BF10BD -:100EE00085F8BEB031499847064690B328462BF0A6 -:100EF000F3FC564409F18800C9F890602BF088FD96 -:100F0000A68B2CF0D9F8D8F80030C01A864219D92F -:100F1000A08BA083FFF770FE40F2011123482BF055 -:100F2000CFFD3846D5F89C3020499847B0FA80F07C -:100F30004009E3680133E36000283FF4F7AE2BF08B -:100F4000EFFD53E72CF0B8F8D8F80030C01A80B2A3 -:100F5000DFE73846D5F89C30144998470120E8E788 -:100F6000324600219847D5F89C30002138469847F2 -:100F7000042E4FF001034FF0000205D0032EA6D13E -:100F800061690131616180E721690131216184E793 -:100F90002CF092F8D8F80030C01A80B2D0E600BF2A -:100FA000DC050021640600218C0500218804002155 -:100FB000B0050021B4050021012370B50546C66ABD -:100FC000A0B0104C7C22314601A884F8803030F06B -:100FD000DDF9B36F01A802932BF07EFC0A4B04F1FC -:100FE00088001B68C4F88830AB68C4F890302BF0D8 -:100FF0000FFDFFF701FE022106F1AC002BF018FDFA -:1010000020B070BD64060021B805002170B5164BF4 -:1010100093F880506A1C012D83F8802015D1134C61 -:10102000E1B9A68D2CF048F8114D2B68C01A864204 -:101030000ED9A08DA085FFF7DFFD40F201110D480C -:101040002BF064FDE3680133E3600025284670BDA2 -:101050002CF032F82B68C01A80B2EBE7A36A013398 -:10106000A36229F087F9F1E7640600215404002106 -:10107000DC0500215003002170B504462CF01CF85B -:101080000B4D286029F060F921460A4CFFF7BEFF9E -:10109000668E2CF011F82B68C01A864202D9608E39 -:1010A000608670BD2CF008F82B68C01A80B2F7E794 -:1010B000DC050021540400212DE9F74FDFF87C9274 -:1010C0000E4699F880408046022CDDF830A09DF84D -:1010D0003410C56A00F0C480032C00F03981002C64 -:1010E00040F09E81964F06B3F31E012B40F29A8189 -:1010F000042E00F0AA8000F2B18023460124032EC2 -:1011000000F0968022461C46BB6A0133BB62234630 -:101110001446002B00F0928016F0FB0F01D12BF04B -:10112000FFFC29F027F901248BE0C5E92F3A85F867 -:10113000BA10D5F89C30834985F8B9209847044601 -:10114000002862D0D5F89830002B5ED00123B7F884 -:101150002EB089F880302BF0AFFF7B4E3368C01A79 -:1011600083454CD9FB8DFB8595F8B030ADF8003048 -:10117000D5F898300193FFF74AFD012168462BF01E -:1011800081FCD5F8A03013B140466E499847002C39 -:101190004CD1D5F8A830002B40D04046694998473B -:1011A000044600283AD0032389F880302BF0B8FC9D -:1011B00028462BF091FB54446448C9F890402BF02A -:1011C00027FCBE8D2BF078FF5F4C2368C01A864247 -:1011D0001ED9B88DB885FFF70FFD40F201115948AF -:1011E0002BF06EFC4046D5F8AC3056499847B0FA23 -:1011F00080F464093B6801333B6014B38FE72BF044 -:101200005BFF3368C31A9BB2ADE72BF089FCB8E7EC -:101210002BF052FF2368C01A80B2DBE7D5F8AC3060 -:1012200013B14046474998470124E3E70024E1E72A -:10123000BA680132BA60002B7FF473AF002C7FF4E0 -:1012400070AF204603B0BDE8F08F234601247A68D2 -:1012500001327A60002B7FF462AFEFE7012253E79F -:101260000324374F89F880406EB1F31E012B51D90A -:10127000042E4FF000034FF001045BD054D9BA6A3A -:101280000132BA6245E7C5E92F3A85F8BA10D5F8B8 -:10129000A4302C4985F8B9209847D5F8A8308BB3ED -:1012A000404628499847044660B328462BF014FB73 -:1012B000544409F18800C9F890402BF0A9FBBE8D79 -:1012C0002BF0FAFE204C2368C01A864214D9B88D40 -:1012D000B885FFF791FC40F201111A482BF0F0FBA2 -:1012E0004046D5F8AC3017499847B0FA80F4640905 -:1012F0003B6901333B6180E72BF0DEFE2368C01AB7 -:1013000080B2E5E7D5F8AC3013B140460D499847B7 -:101310000124EDE7D5F8A43000219847042E4FF0C2 -:1013200001034FF0000405D0032EA8D1BA690132A1 -:10133000BA6180E77A6901327A618BE7640600213D -:101340005404002150030021DC050021EC0600219B -:10135000D5F8A830364FC6B1F21E012A4ED9002169 -:101360009847D5F8AC3013B1002140469847042E79 -:101370004FF000034FF001044ED080D8032E7FF4CD -:101380007EAF7A6A01327A6255E72A499847044665 -:1013900060B328462BF0A0FA544409F18800C9F83C -:1013A00090402BF035FBBE8D2BF086FE224C23683F -:1013B000C01A864214D9B88DB885FFF71DFC40F2DB -:1013C00001111C482BF07CFB4046D5F8AC30194984 -:1013D0009847B0FA80F46409FB690133FB610CE7BC -:1013E0002BF06AFE2368C01A80B2E5E7D5F8AC306E -:1013F00013B140460F4998470124EDE70021984773 -:10140000D5F8AC3013B1002140469847042E4FF078 -:1014100001034FF00004B1D13A6A01323A6219E790 -:1014200000240EE7042E4FF001037FF468AE0EE7B0 -:101430005404002150030021DC0500212DE9F34173 -:101440000E461746984604462BF036FE0F4D286090 -:1014500028F07AFF9DF8203021460D4C3246CDE928 -:1014600000833B46FFF728FE268E2BF025FE2B68D7 -:10147000C01A864204D9208E208602B0BDE8F081D1 -:101480002BF01AFE2B68C01A80B2F5E7DC050021AC -:101490005404002108B500220620054901F0C4FCCF -:1014A000BDE808403422002102482FF096BF00BF5B -:1014B000290C00015404002130B50446044D0FCD21 -:1014C0000FC40FCD0FC40FCD0FC42B68236030BDE8 -:1014D0005404002108B500220920074901F0A4FCAA -:1014E00000220F20054901F09FFCBDE8084024229E -:1014F000002103482FF071BF8D0C0001B90F0001CE -:101500008C05002130B50446034D0FCD0FC40FCD1F -:101510000FC42B68236030BD8C05002170B50546D3 -:10152000C66A08462BF0D8F90E4CD6F8B43004F150 -:101530008800C4F89430AB68C4F890302BF068FA97 -:10154000002384F88030D6F8983043B1FFF75FFB72 -:10155000BDE8704040F2011103482BF0B1BAFFF72B -:101560004BFBF5E764060021500300212BF0DABAAB -:101570001FB5002301A8CDE9013303932BF050FAE6 -:1015800005B05DF804FB00002DE9F04F85B0804602 -:101590000E469346994628F0E7FE074668B93E4C4A -:1015A000D8F82CA094F8823094F88150032B06D1FF -:1015B00018B184F8823084F88150012754E0022D5C -:1015C00092BF2A46033DEAB202F125018AF80110D2 -:1015D000F17E551C41FA02F20133D2074FF00100AF -:1015E000DBB2EDB2E2D584F8823084F88150B9F1F3 -:1015F000000F04D11BF0FB0F01D12BF091FA5046E4 -:101600002BF06AF9B9F1000F04D0D8F80830C4F80B -:10161000903009E073685BB32BF04EFD054628F06F -:10162000C5FE2844C4F89000002384F88030F36895 -:101630001BB14046D4F89010984718482BF0E8F9B1 -:10164000736833B301238DF80430002301A8CDE97A -:1016500002332BF0E5F9337E0121ADF80430336815 -:1016600001A802932BF0E4F9384605B0BDE8F08FED -:10167000327E9AF80E109AF80C0028F0ECF8054625 -:1016800028F094FE284428F055F9D4F8903003440B -:10169000BDE7FFF76DFFDEE764060021EC060021E1 -:1016A0000F4B104A10B5C16AC3F888200E4A91F852 -:1016B000B240C3F88C200422C3F89420002283F89F -:1016C000814083F8802083F8822098310123FFF73E -:1016D0005BFF18B1BDE8104028F03CBE10BD00BF54 -:1016E000640600212D180001ED1600012DE9F347D5 -:1016F000994605462BF0E0FCDFF82481494CC8F8F8 -:10170000000028F021FE484AC66A92F88030074659 -:10171000591C012B82F8801068D106F1980A002D1F -:101720004BD1C6F8B4902A46D6F89C0006F1B8030F -:1017300006F1800101F04AFC814668B33846D6F8CC -:10174000A830D6F89C10984730B3B4F81A902BF014 -:10175000B3FCD8F80030C01A814516D9608B60837D -:10176000FFF706FF96F8B1300121ADF80030D6F84A -:10177000A030684601932BF085F9D6F8AC30ABB1B8 -:101780003846D6F89C10984710E02BF095FCD8F816 -:101790000030C01A80B2E2E7002351461A463846AC -:1017A000FFF7F2FE0546B9F1000FE6D16368013399 -:1017B0006360DDB12BF0B4F910E000232A465146F6 -:1017C000FFF7E2FE042D1ED001D8032D09D0636976 -:1017D0000133636150B115F0FB0FEBD028F0CAFD67 -:1017E00004E0E3680133E3600028F7D1A58B2BF018 -:1017F00063FCD8F80030C01A85420AD9A08BA083B8 -:1018000002B0BDE8F087A3680133A3600028D1D1FE -:10181000ECE72BF051FCD8F80030C01A80B2EEE7AC -:10182000DC050021BC050021640600212DE9FF41F3 -:1018300007462BF041FC314E314C306028F084FDDE -:101840002FB163690133636128F094FD0CE02D4BE7 -:10185000D0F82C8093F8805008F198016A1C83F826 -:1018600080206DB1022D39D0E58B2BF025FC33683B -:10187000C01A85423BD9E08BE08304B0BDE8F0811B -:10188000D8F89C3023B3278B2BF016FC3368C01A92 -:10189000874217D9208B01238DF804300023208341 -:1018A00001A8CDE902332BF0BBF82421D8F89C0025 -:1018B0002BF02CF9236801332360002DD4D02BF0BA -:1018C0002FF9C1E72BF0F8FB3368C01A80B2E2E7CA -:1018D0002B462A46FFF758FE0546EBE73B463A46BD -:1018E000FFF752FE2369054601332361E5E72BF03C -:1018F000E3FB3368C01A80B2BEE700BFDC050021FD -:10190000BC0500216406002108B50320054A0649EC -:1019100001F08AFABDE808402022002103482FF098 -:101920005CBD00BF6D150001A1160001BC050021C2 -:1019300030B50446034D0FCD0FC495E80F0084E881 -:101940000F0030BDBC0500211FB501238DF8043008 -:10195000002301A8CDE902332BF062F805B05DF851 -:1019600004FB1FB5002301A8CDE9013303932BF03D -:1019700057F805B05DF804FBF8B5204E204BC46A5B -:10198000C6F888301F4B0F46C6F88C300423C6F8C3 -:10199000943000230546A6F8803028F0E5FC014687 -:1019A00050BBD4F8D4300BB12846984738462AF0BB -:1019B00093FFAB681448C6F89030002386F8803057 -:1019C0002BF026F8D4F8A83013B9D4F8643183B1D9 -:1019D000FFF7BAFFAB68B4F8A020C4F868310AB1C9 -:1019E000C4F86C3104F198000221BDE8F8402BF0F6 -:1019F0001FB8FFF7B6FFEDE7F8BD00BF6406002192 -:101A0000191C00010D1A0001EC0600212DE9F74F09 -:101A10008B46019307462BF04FFBDFF878815E4D34 -:101A2000C8F8000028F090FC5C4AC46A92F8806014 -:101A30008146711C012E019B82F8801040F0848049 -:101A4000012F04F1980A03D00BD9FB1E012B2AD8D1 -:101A500094F87C21002A66D000214846D4F8CC3086 -:101A600010E0C4F8DC3084F85FB19DF8303094F8B1 -:101A70007CB184F8D930BBF1000F05D0D4F8CC305C -:101A8000D4F8F81098470EE094F85D3104EB830326 -:101A9000D3F8F810E1B1D4F8CC309847C0B1404B3E -:101AA0001B687BB900260023032F84F87C3147D0C4 -:101AB000042F56D0002F58D16B6801336B60002E75 -:101AC00042D05AE05A465146484698470646EAE709 -:101AD000D4F8A8100029E6D04846D4F8CC3098476E -:101AE0000028E0D0EE8B2BF0E7FAD8F80030C01ACF -:101AF000864211D9E88BE883FFF733FF022104F116 -:101B0000AC002AF0BFFFD4F8D030002BCAD0484632 -:101B1000D4F8A8109847C5E72BF0CEFAD8F80030D3 -:101B2000C01A80B2E7E794F85D3104EB8303D3F881 -:101B3000F830002BB7D01B4B1B68002BC3D1B1E78B -:101B4000EB680133EB60D6B92C8C2BF0B5FAD8F8E2 -:101B50000030C01A844215D9288C288403B0BDE80F -:101B6000F08FAB680133AB60A9E7AB690133AB61C0 -:101B7000002EE9D017F0FB0F01D12AF0D1FF28F099 -:101B8000F9FBE1E72BF098FAD8F80030C01A80B2E0 -:101B9000E3E700BFDC050021E00500216406002129 -:101BA0000806002104060021F8B5CB6B06460C465A -:101BB0000BB90120F8BD0121984705460028F8D04F -:101BC000F06A2AF089FE1148114ED0F89030883022 -:101BD0002B44104D83602AF01BFFAF8B2BF06CFA67 -:101BE0003368C01A87420AD9A88BA883FFF7B9FEC9 -:101BF00004F1240002212AF01BFF0020DAE72BF079 -:101C00005BFA3368C01A80B2EFE700BF64060021B8 -:101C1000DC050021E00500212DE9F04704462BF00A -:101C20004BFA424F424D386028F08EFB82462CB171 -:101C3000AB690133AB6128F09DFB20E0DFF8F48055 -:101C4000C66A98F8804006F19809022C44D0032C0B -:101C50005AD0A4B9D6F8A8301BBB96F85D3106EB74 -:101C60008306D6F8F830ABB1334B1B6813B1494645 -:101C7000984704462B6801332B60002C52D16C8CA2 -:101C80002BF01AFA3B68C01A844245D9688C6884E4 -:101C9000BDE8F0870323494688F88030FFF784FFCA -:101CA000E7E7012388F88030B5F81C802BF004FAB0 -:101CB0003B68C01A804509D9A88BA883FFF744FE6A -:101CC0002421D6F8A8002AF021FFD3E72BF0F4F95D -:101CD0003B68C01A80B2F0E7032388F880300E22F8 -:101CE00096F8D910707BD6F8DC4027F0B4FD963416 -:101CF000044449465046C8F89040FFF755FF2B6909 -:101D0000044601332B61B8E74946FFF74DFF6B6985 -:101D1000044601336B61B0E72BF0CEF93B68C01A83 -:101D200080B2B4E72AF0FCFE85E700BFDC050021A5 -:101D3000E0050021640600210C060021F8B51A4CCC -:101D40001A4BC66AC4F88830194B0F46C4F88C3059 -:101D50000423C4F8943000230546A4F8803028F00A -:101D600003FB0146F8B9D6F8D4300BB128469847A2 -:101D700038462AF0B1FDAB680E48C4F89030002315 -:101D800084F880302AF044FED6F8A83043B1FFF73B -:101D9000DBFD06F198000221BDE8F8402AF048BEBC -:101DA000FFF7DFFDF5E7F8BD64060021191C00010F -:101DB0000D1A0001EC06002108B500220720074992 -:101DC00001F032F800220820054901F02DF8BDE8A5 -:101DD00008402422002103482FF0FFBA3D1D0001D6 -:101DE00079190001E005002130B50446034D0FCDFF -:101DF0000FC40FCD0FC42B68236030BDE005002158 -:101E00002AF090BE2DE9F0410F46984605462BF08A -:101E100053F9224C224E94F880303060013384F81C -:101E2000803028F091FA0023C26AD4F89C10C2F8DE -:101E3000A48082F8A870C4F89C30D2F8A0302A465A -:101E4000984728F091FA18B12AF06AFE28F092FA21 -:101E5000032D144C10D0042D12D0ADB923680133DA -:101E60002360258B2BF028F93368C01A85420FD9DF -:101E7000208B2083BDE8F081A3680133A360F0E7E5 -:101E8000636801336360ECE7236901332361E8E7AA -:101E90002BF012F93368C01A80B2EAE76406002119 -:101EA000DC0500211006002170B50446C66A08460C -:101EB0002AF012FD104D114B05F18800C5F88C3049 -:101EC000A368C5F89030D6F89830C5F894302AF059 -:101ED0009FFD0023204685F88030D6F89C30984737 -:101EE00028F042FA30B128F02FFA18B1BDE870405E -:101EF00028F040BA70BD00BF64060021051E000135 -:101F000008B50C20054A064900F08EFFBDE80840E0 -:101F10001C22002103482FF060BA00BF011E0001FF -:101F2000A91E0001100600212DE9FF411A4E0D46A1 -:101F3000A6F898100221C6F89C00044601A8CDE935 -:101F400002239DF828708DF804102AF069FD96F898 -:101F5000803003B137B12946204604B0BDE8F041D6 -:101F60002AF0AEBD0D4E0E4FB6F814802BF0A4F83B -:101F70003B68C01A804508D9B38A29462046B382F7 -:101F800004B0BDE8F0412AF0C1BD2BF095F83B68E4 -:101F9000C31A9BB2F1E700BF6406002110060021BE -:101FA000DC05002170B50C460546074E2AF0B8FD49 -:101FB0002046C6F890502AF08FFC06F18800BDE854 -:101FC00070402AF025BD00BF640600212AF0AABD9A -:101FD00070B504462BF070F8144A154D92F8803015 -:101FE0002860013382F8803028F0AEF9C36A2146B8 -:101FF000104CD3F89C309847E3680133E36028F035 -:10200000B3F918B12AF08CFD28F0B4F9668B2BF0E7 -:1020100053F82B68C01A864202D9608B608370BD6A -:102020002BF04AF82B68C01A80B2F7E7640600214B -:10203000DC0500211006002170B50446C66A08467A -:102040002AF04AFC0E4D0F4B05F18800C5F8883088 -:10205000A368C5F890302AF0DBFC0023204685F801 -:102060008030D6F89830984728F07EF930B128F0C3 -:102070006BF918B1BDE8704028F07CB970BD00BFA5 -:1020800064060021D11F000108B50D20054A06494C -:1020900000F0CAFEBDE808401C22002103482FF0D2 -:1020A0009CB900BFCD1F000139200001100600219E -:1020B0002DE9FF4104460D4693B1022102928DF8AD -:1020C000041001A803932AF0ABFC134B93F8803063 -:1020D0004BB92946204604B0BDE8F0412AF0A8BC1F -:1020E000CDE90133EDE70D4E0D4FB6F816802AF01D -:1020F000E3FF3B68C01A804508D9F38A2946204689 -:10210000F38204B0BDE8F0412AF0BCBC2AF0D4FF51 -:102110003B68C31A9BB2F1E7640600211006002158 -:10212000DC05002130B50446034D0FCD0FC495E802 -:10213000070084E8070030BD100600211FB5012309 -:102140008DF80430002301A8CDE902332AF068FCA1 -:1021500005B05DF804FB00002DE9F04104460D4692 -:1021600028F0F2F8C36A1B780A2B0BD1124B93F8B4 -:1021700080303BB9FFF7E2FF29462046BDE8F04139 -:102180002AF056BC0D4E0E4FB6F816802AF094FF7A -:102190003B68C01A804509D9F38AF382FFF7CEFF66 -:1021A00029462046BDE8F0412AF06CBC2AF084FFA5 -:1021B0003B68C31A9BB2F0E7640600212C0600219D -:1021C000DC05002170B50C4E04460D46C6F89C0097 -:1021D000A6F8981028F0B8F8C36A1B780B2B0AD120 -:1021E00096F880303BB9FFF7A9FF29462046BDE8A5 -:1021F00070402AF065BC70BD6406002130B504460D -:10220000034D0FCD0FC495E8070084E8070030BDEB -:102210002C06002170B50D4604462AF083FC094BBC -:10222000D3F89C1039B100222046C3F89C2002222A -:10223000D5F8B43098472046D5F8AC30BDE87040AA -:10224000184700BF640600212DE9F04105460C4601 -:10225000C76A28F089F80646E0B920462AF03CFB18 -:102260000D4C0E4B04F18800C4F888300C4BC4F8B8 -:102270008C30AB68C4F890300423C4F894302AF052 -:10228000C7FBD7F8A03084F880601BB12846BDE8B2 -:10229000F0411847BDE8F08164060021A522000145 -:1022A000792300012DE9F04385B005462AF004FFAB -:1022B0002E4F2F4E386028F047F8D0F82C90294642 -:1022C000D9F8B03080469847D6F89C10294C0029A0 -:1022D0003AD055BBA58A2AF0EFFE3B68C01A85426A -:1022E0001DD9A08A0023A08201A8CDE90133039360 -:1022F0002AF096FBB6F89810D6F89C002AF006FC57 -:10230000E3680133E360658B2AF0D6FE3B68C01AB0 -:10231000854213D9608B608305B0BDE8F0832AF055 -:10232000CBFE3B68C01A80B2DCE700230222C6F86D -:102330009C304046D9F8B430984708E02AF0BCFEFB -:102340003B68C01A80B2E6E70DB92AF0E9FB96F8BF -:10235000803023B928F00EF8012386F88030002D54 -:10236000CED0236901332361CDE700BFDC05002116 -:10237000640600212C0600212DE9F3470F4605468F -:102380002AF09AFEDFF81481C8F8000027F0DCFF7D -:102390000023C66A9DF8282086F8B870404F8DF853 -:1023A0000730D7F89C1086F8B920C7F89C302A4629 -:1023B000D6F8B4300446984727F0D6FF8146002867 -:1023C00037D04FF0010927F0CFFF40EA0900C0B233 -:1023D00080B1062D06D80123AB4013F0510F01D078 -:1023E0002AF09EFB97F8803023B927F0C3FF012322 -:1023F00087F880309DF8073023B929462046D6F863 -:10240000A8309847032D274C35D0042D37D0002D08 -:1024100039D1236801332360258B2AF04DFED8F88B -:102420000030C01A854232D9208B208302B0BDE82B -:10243000F0872046D6F898300DF10701984782467C -:102440000028BED02AF06CFBD6F89C300DF10701B5 -:1024500020469847E06A2AF03FFAD7F890005044A7 -:10246000C7F8900007F188002AF0D2FA2046D6F883 -:10247000A4309847A7E7A3680133A360CCE763685B -:1024800001336360C8E7236901332361C4E72AF09D -:1024900013FED8F80030C01A80B2C6E7DC05002170 -:1024A000640600212C06002108B50A20054A0649C9 -:1024B00000F0BAFCBDE808401C22002103482EF0C1 -:1024C0008CBF00BF15220001492200012C0600210B -:1024D00070B50D4604462AF025FB094BD3F89C1035 -:1024E00039B100222046C3F89C200222D5F8B4302E -:1024F00098472046D5F8AC30BDE87040184700BF7B -:102500006406002101232DE9F041C76A054687F8DA -:10251000B83083680846C7F8C0300F4C0E462AF022 -:10252000DBF90E4B04F18800C4F888300C4BC4F87A -:102530008C30D7F8C030C4F89030D7F8C830C4F821 -:1025400094302AF065FA0023284684F88030D6F8C3 -:10255000A030BDE8F041184764060021E5260001DF -:10256000C52500012DE9F04106460C46904627F0AE -:10257000FBFE074618B101273846BDE8F081414609 -:1025800030462368984705460028F4D02AF0C8FA58 -:10259000A36A0B482B44A362B360C0F89030236B4E -:1025A0008830C3602AF034FA636841463046984761 -:1025B000F06A2AF091F93046E3689847DCE700BFFB -:1025C000640600212DE9F04385B00F469846044685 -:1025D0002AF072FD404E306027F0B6FEC56A9DF8C5 -:1025E000303085F8C47014F0FB07814685F8C5309B -:1025F00007D1C5F8C08001A8CDE9017703972AF07B -:102600000FFA95F8B830012B06D12FB9D5F8C030A4 -:1026100085F8B870C5F8BC304FF000082F4FD5F8DA -:10262000B430D7F89C1022464846C7F89C8098479B -:1026300004F0FD03012B8DF804800ED1484601AA59 -:1026400005F19801FFF78EFF9DF80430804623B90D -:1026500021464846D5F8A830984727F085FE40EA3D -:102660000800C0B280B1062C06D80123A34013F0A5 -:10267000510F01D02AF054FA97F8803023B927F08F -:1026800079FE012387F88030032C154D11D0042CDE -:1026900013D0B4B92B6801332B602C8B2AF00CFDBE -:1026A0003368C01A844210D9288B288305B0BDE84E -:1026B000F083AB680133AB60EFE76B6801336B60AD -:1026C000EBE72B6901332B61E7E72AF0F5FC336870 -:1026D000C01A80B2E9E700BFDC05002164060021D2 -:1026E0002C0600212DE9F74305462AF0E5FC374F7B -:1026F0004FF00009386027F027FE0446C66A2946D5 -:10270000D6F8B030984720460DF1070206F198013F -:102710008DF80790FFF726FF804655BB27F024FE73 -:1027200040EA0800C0B258B12AF0FAF9284B93F8F1 -:1027300080302BB927F01EFE0122254B83F8802024 -:102740009DF8073023B929462046D6F8A830984787 -:10275000204C8DBBE3680133E360658B2AF0ACFC51 -:102760003B68C01A85422BD9608B608303B0BDE8FB -:10277000F083012D12D10028E2D0DFF85480D8F880 -:102780009C1031B102222046D6F8B430C8F89C9093 -:1027900098472AF0C5F998F88030CAE7DFF830800A -:1027A000D8F89C100029F6D002222046D6F8B43082 -:1027B000C8F89C909847EEE7236901332361CCE782 -:1027C0002AF07AFC3B68C01A80B2CEE7DC05002113 -:1027D000640600212C06002108B50B20054A064995 -:1027E00000F022FBBDE808401C22002103482EF027 -:1027F000F4BD00BFD1240001052500012C060021F5 -:102800001FB501238DF80430002301A8CDE9023360 -:102810002AF006F905B05DF804FB00002DE9F0414F -:1028200004460D4627F090FDC36A1B78042B0BD19C -:10283000124B93F880303BB9FFF7E2FF2946204660 -:10284000BDE8F0412AF0F4B80D4E0E4FB6F81680F0 -:102850002AF032FC3B68C01A804509D9F38AF3821A -:10286000FFF7CEFF29462046BDE8F0412AF00AB91D -:102870002AF022FC3B68C31A9BB2F0E764060021F1 -:1028800048060021DC05002170B50C4E04460D46BB -:10289000C6F89C00A6F8981027F056FDC36A1B786E -:1028A000052B0AD196F880303BB9FFF7A9FF2946DE -:1028B0002046BDE870402AF003B970BD64060021CF -:1028C00030B50446034D0FCD0FC495E8070084E8EA -:1028D000070030BD4806002170B50D4604462AF0B9 -:1028E00021F9094BD3F89C1039B100222046C3F8D6 -:1028F0009C200222D5F8A43098472046D5F89C3079 -:10290000BDE87040184700BF6406002170B5054659 -:1029100008460E4C0E4629F0DFFF0D4B04F18800EF -:10292000C4F888300B4BC4F88C30AB68C4F89030D6 -:102930000423C4F894302AF06BF80023284684F866 -:102940008030D6F89830BDE8704018476406002102 -:102950000D2A00015929000170B50C4605462AF0E0 -:10296000ABFB274E306027F0EFFC9DF81030C26AB9 -:1029700082F8A930234B82F8A84093F8801011B94F -:10298000012183F880100024D3F89C10C3F89C40E8 -:10299000D2F8A4302A46984727F0E6FC50B1062D1D -:1029A00006D80123AB4013F0510F01D02AF0B8F83C -:1029B00027F0E0FC032D144C0FD0042D11D0A5B945 -:1029C000236801332360258B2AF076FB3368C01A15 -:1029D00085420ED9208B208370BDA3680133A3608C -:1029E000F1E7636801336360EDE723690133236135 -:1029F000E9E72AF061FB3368C01A80B2EBE700BF59 -:102A0000DC05002164060021480600212DE9F04381 -:102A100085B005462AF050FB2C4EDFF8B4803060BC -:102A200027F092FCD0F82C902946D9F8A030074620 -:102A30009847D8F89C10274C00293CD065BBA58A44 -:102A40002AF03AFB3368C01A85421FD9A08A0123B5 -:102A50008DF804300023A08201A8CDE9023329F0CB -:102A6000DFFFB8F89810D8F89C002AF04FF8E36818 -:102A70000133E360658B2AF01FFB3368C01A85427F -:102A800013D9608B608305B0BDE8F0832AF014FB96 -:102A90003368C01A80B2DAE700230222C8F89C30FB -:102AA0003846D9F8A430984708E02AF005FB336887 -:102AB000C01A80B2E6E70DB92AF032F827F05AFCC6 -:102AC000002DD4D0236901332361D3E7DC05002135 -:102AD000640600214806002108B50420054A06497D -:102AE00000F0A2F9BDE808401C22002103482EF0A6 -:102AF00074BC00BFD92800010D290001480600213F -:102B000070B50D4604462AF00DF8094BD3F89C1019 -:102B100039B100222046C3F89C200222D5F8A83003 -:102B200098472046D5F8A030BDE87040184700BF50 -:102B3000640600212DE9F0410546C76A08460F4C9E -:102B40000E4629F0C9FE0E4B04F18800C4F8883007 -:102B50000C4BC4F88C30AB68C4F89030D7F8983080 -:102B6000C4F8943029F054FF0023284684F88030BC -:102B7000D6F89C30BDE8F041184700BF640600213C -:102B8000412C0001892B0001F8B50C461F46054673 -:102B90002AF092FA274E306027F0D6FBC26A9DF8E1 -:102BA000183082F8B040244C82F8B13094F880306C -:102BB00023B90123C2F8AC7084F880300023D4F824 -:102BC0009C10C4F89C30D2F8A8302A46984727F0C9 -:102BD000CBFB50B1062D06D80123AB4013F0510FAB -:102BE00001D029F09DFF27F0C5FB032D134C0FD01A -:102BF000042D11D0A5B9236801332360258B2AF059 -:102C00005BFA3368C01A85420ED9208B2083F8BD49 -:102C1000A3680133A360F1E7636801336360EDE704 -:102C2000236901332361E9E72AF046FA3368C01AC1 -:102C300080B2EBE7DC050021640600214806002194 -:102C40002DE9F04385B080462AF036FA2D4D2E4E00 -:102C5000286027F079FBD0F82C904146D9F8A430B1 -:102C600007462A4C9847B8F1000F29D1D6F89C3076 -:102C70000BB3A78A2AF020FA2B68C01A874214D90E -:102C8000A08A01238DF804300023A08201A8CDE999 -:102C9000023329F0C5FEB6F89810D6F89C0029F04A -:102CA00035FFE3680133E3601AE02AF005FA2B6888 -:102CB000C01A80B2E5E729F033FF27F05BFBF0E7AD -:102CC000D6F89C1039B100230222C6F89C30384651 -:102CD000D9F8A830984727F04DFB236901332361C9 -:102CE000668B2AF0E9F92B68C01A864204D9608BFA -:102CF000608305B0BDE8F0832AF0DEF92B68C01AC6 -:102D000080B2F5E7DC0500216406002148060021B9 -:102D100008B50520054A064900F086F8BDE80840D8 -:102D20001C22002103482EF058BB00BF012B0001DC -:102D3000352B000148060021C16A034B0A7853F87D -:102D4000323003B11847704764060021C16A044B52 -:102D50000A7803EBC2035B6803B11847704700BFF2 -:102D60006406002129F0E8BE29F0B4BD08B529F0B9 -:102D7000B1FDBDE80840002029F0D8BE08B529F013 -:102D80009BFD002029F0D0FEBDE80840012029F07D -:102D9000CDBE08B529F090FDBDE80840002029F01F -:102DA000C3BE08B529F088FDBDE80840012029F020 -:102DB000BBBE000073B5134C134D144E29F074FDC7 -:102DC000224629460120124B009627F0FFFA2246A0 -:102DD000294602200F4B009627F0F8FA0E4B2246A8 -:102DE000009300210D4B032027F0F0FA01200C493D -:102DF00027F0FAFAA02200210A4802B0BDE870408C -:102E00002EF0EBBA4D2D0001392D0001692D000186 -:102E1000A32D0001932D00016D2D00017D2D0001DA -:102E2000652D000164060021034B43F8301003EBCD -:102E3000C0035A60704700BF640600212DE9FF41BE -:102E4000D3E90086044617461D461078002C3ED074 -:102E500010B34FEA162C0CF0C00CBCF1400F1BD184 -:102E6000404669B1314600F0C1FD38B12B463A46C3 -:102E70004046314600F02AFD002846D0012008E0F7 -:102E8000314600F0A5FC0028F8D1214AD38B01334C -:102E9000D38304B0BDE8F0814246334600F0BCFD68 -:102EA0000238C0B20128E9D80DF10F030093387839 -:102EB000D5E9002300F03EFC10B19DF80F3023B996 -:102EC0000224134A138B013313832046E1E720B118 -:102ED000330A03F0C003402BD0D04246334600F003 -:102EE0009BFD02380128C9D80DF10F0300933878F3 -:102EF000D5E9002300F01EFC18B19DF80F30002B1F -:102F0000BCD1034A138B013313830220C1E700BFF6 -:102F1000040700212DE9F041884617461E46044665 -:102F200058B152EA06030E4D0AD100F0CFFF012836 -:102F300006D10446EB880133EB802046BDE8F081E2 -:102F40003A463346404600F03FFF20B9AB880224A2 -:102F50000133AB80F1E7EB880133EB80EDE700BF95 -:102F60000407002137B5DDE9065410B9002003B08D -:102F700030BDCAB1230A03F0C003402B14D129B1DC -:102F8000284621460AAB08AA00F0FAFCDDE90A232C -:102F90002846CDE9002321469DF8202000F050FC72 -:102FA000003818BF0120E2E79DF82000DDE90A2380 -:102FB00000F043FD0238C0B20128D7D8024A0220EF -:102FC000538B01335383D2E7040700212DE9F04FDF -:102FD00090F800800D8808F00F0845FA08F515F004 -:102FE000010581460F4692461C466E4E87B006D1BB -:102FF000338801333380284607B0BDE8F08F4FF4A3 -:10300000C07B72884BFA08FB01321BF0010B43783E -:10301000728001D00125EEE703F03F03637484F86A -:10302000108010F8025B27F093FEC5F38015E5745D -:10303000A574C4E90201C4E900017868514604F1AD -:10304000080304F11302C0F38010FFF7F7FE012814 -:10305000054602D0022839D05D46D4E90223D7F8CC -:1030600004C094F813E01CF0040B0ED0D7E9041050 -:10307000834208BF8A4203D1CCF3C00CE64527D077 -:103080004FF0020B3089013030817888714640FA68 -:1030900008F000F00100FFF73DFF584523D2D7F8B4 -:1030A00004C01CF0040F1CD0D7E90413A068E26828 -:1030B0009A4208BF884204D1E37CCCF3C00C63453C -:1030C0000CD0338901333381012D1AD1002592E7C9 -:1030D00070894FF0010B01307081D6E7738901339D -:1030E000738101250DE07888E17C40FA08F000F05A -:1030F0000100D4E90223FFF70DFF0128F1D90228CE -:10310000E2D04FF0010BB8F1050F257584F815B02A -:1031100080D80BFA08F818F02A0F3FF47BAF484626 -:1031200010F8085B27F014FED4E902238146CDE9AC -:1031300004237868E37CED09CDE9009188462A46AE -:1031400051460293C0F30010FFF70CFF01283FF433 -:1031500061AF0228BAD07B68DA077FF55BAFD7E9A9 -:103160000212424508BF494503D1C3F34002AA42B7 -:1031700013D0B2890132B281002DA7D04FEA1828AE -:1031800008F0C008B8F14008A0D19B069ED5338C4A -:103190000133338484F815802DE7F3890133F381FB -:1031A00038E700BF040700212DE9F04F8146924621 -:1031B000027C08880E46104110F001001C46714D3B -:1031C00089B005D12B8801332B8009B0BDE8F08F81 -:1031D0004FF00108D9E900016B88C4E9020101330D -:1031E0006B80C4E9000199F8123008FA02F8E37420 -:1031F000A37470687388514608EA030800F0040B52 -:1032000004F1080304F11302C0F38010FFF716FE67 -:10321000012807465FFA88F809D0022841D1BBF19E -:10322000000F01D00020D0E7B8F1000FFAD1D4E9A7 -:10323000022394F813C0BBF1000F39D0D6E9041073 -:10324000834208BF8A4204D17068C0F3C00084453D -:1032500029D002212889013028810791B8F100087E -:1032600018BF4FF0010861464046FFF753FE079B29 -:10327000984232D2BBF1000F3BD0D4E90202D6E92A -:1032800004139A4208BF884205D17368E27CC3F3F5 -:10329000C0039A420FD02B8901332B81012F0ED10D -:1032A000C0E70027C3E76889012101306881D4E7BE -:1032B000CDF81CB0D2E701276B8901336B814FF049 -:1032C000010B781E47424741277584F815B099F8DD -:1032D00011309F0714D4012077E74046D4E9022338 -:1032E000E17CFFF717FE012808D00228D6D000287D -:1032F000E5D1012F38BF0127FFB2E0E70746DEE73F -:10330000D4E9021299F81380CDE90412D9E9023701 -:10331000E27C706802925146424600930197C0F3E6 -:1033200000100793FFF71EFE01283FF44EAF02285E -:103330003FF478AF7268D107CDD5D6E90201079B7B -:10334000B94208BF984203D1C2F34003434514D0A9 -:10335000AB890133AB81B8F1000F3FF463AF3F0A93 -:1033600007F0C007403F7FF45DAF93067FF55AAF8B -:103370002B8C01332B846775ADE7EB890133EB812F -:10338000A9E700BF04070021054B03F1240253F80D -:10339000041B934240F8041BF9D11B88038070473B -:1033A000040700212DE9F04100240C4BDFF83080A8 -:1033B000054608460E4617461C7088F8004027F060 -:1033C00023FE084B186000EB0513991BB9428EBF12 -:1033D000204688F8005088B2BDE8F0812A07002115 -:1033E0002B0700212C070021F0B500240D499DF882 -:1033F00014C00D780C490968A54201D80020F0BD21 -:103400000E7A864208D1D1E900769E4208BF9742E3 -:1034100002D14E7A664502D001341031ECE701202A -:10342000EDE700BF2A0700212C070021014B187887 -:10343000704700BF2B0700210022014B1A70704714 -:103440002A07002130B50B490B4D09782C78A14291 -:103450000DD90A49096801EB041108720120C1E97C -:1034600000239DF80C3001344B722C7030BD0020CD -:10347000FCE700BF2B0700212A0700212C070021B1 -:103480002DE9F0411B4C8446276800253C46DFF8B7 -:1034900068E09DF818809EF80010EEB2B14201D8A5 -:1034A000002021E0267A664520D1D4E900069E421C -:1034B00008BF90421AD1667A464517D1012901F119 -:1034C000FF300ED985420CD001F18051013907EB54 -:1034D00001110B7A2372D1E90023C4E900234B7A4E -:1034E00063728EF800000120BDE8F08101351034D0 -:1034F000D3E700BF2C0700212A070021F0B50C49B3 -:1035000043EA00430D780B490C680021C8B285429C -:1035100001D800200AE02046D0E908769E4208BF84 -:10352000974201F1010104F14804EFD1F0BD00BF61 -:10353000340700215C07002130B585B00C460546F4 -:103540001022002168462DF048FF6A46230A2846CB -:103550008DF800401146240C8DF801308DF80240A2 -:1035600029F00EFC9DF802309DF801001B0443EA8F -:1035700000239DF80000184305B030BD13B50421A9 -:1035800004460DEB010029F0B7FC01992046C1F378 -:10359000150141F480010191FFF7CEFF019940EA46 -:1035A0000160090A02B010BD2DE9F04100240D4B65 -:1035B000DFF83480054608460E4617461C7088F82A -:1035C000004027F021FD4821084B186001FB05034E -:1035D000991BB9428EBF204688F8005088B2BDE8DA -:1035E000F08100BF34070021350700215C0700216E -:1035F000014B1860704700BF30070021014B18785D -:10360000704700BF350700210022014B1A70704738 -:1036100034070021F8B507461D46FFF76FFF164631 -:10362000044680B92E4A2F4913780978994201D867 -:103630000020F8BD48202C490C6800FB03440133EE -:103640001370002CF4D0224645EA0745069BC4E9D6 -:10365000086503F1100153F8040B8B4242F8040B88 -:10366000F9D1012304F10F0284F84030631E13F8EE -:10367000011F71B3002384F8403004F110000246AA -:10368000079B03F1100153F8045B8B4242F8045B83 -:10369000F9D1012384F84130034604F1200213F8E4 -:1036A000011BC9B1002384F8413000230022C4E982 -:1036B0000A23C4E90C23C4E90E230023A4F84230F2 -:1036C00094F841301BB9FFF759FFC4E90C01012000 -:1036D000AFE79A42CBD1D0E79A42E0D1E5E700BF0D -:1036E00034070021350700215C07002138B5FFF7BA -:1036F00005FF78B1084D2C78012C08D9482202FB2F -:1037000004F30649483B096819442DF03FFE0120A7 -:10371000013C2C7038BD00BF340700215C0700213C -:1037200008B5FFF7EBFE20B19DF8083080F8433074 -:10373000012008BD08B5FFF7E1FE20B190F8432055 -:103740000120029B1A7008BD10B5029CFFF7D6FE3F -:1037500040B1D0E90A2352EA030116BF012000203C -:10376000C4E9002310BD10B5029CFFF7C7FE40B1AD -:10377000D0E90C2352EA030116BF01200020C4E95E -:10378000002310BD08B5FFF7B9FE28B1029BD3E9AD -:103790000023C0E90C23012008BD10B5FFF7AEFEE1 -:1037A000044698B190F8403083B990F8423033B96C -:1037B000FFF7E4FE0123C4E90A0184F84230029BCA -:1037C000D4E90A01C3E90001012010BD0020FCE793 -:1037D000F7B50026174C94F800C0174C25683446FE -:1037E000F7B2BC450CD8ECB1144C2468D4B1D3E981 -:1037F0000067CDE9006713780122A047002411E09B -:1038000095F8407097B9D5E90A748C4208BF874291 -:103810000BD10124E98C01F001011170296AAA8CF5 -:10382000C3E90012204603B0F0BD0124013648353B -:10383000D6E700BF340700215C07002130070021D4 -:103840002DE9F347DDE90A679146804632463B465B -:1038500048460D46FFF752FEC8B190F84140B4B952 -:10386000D0E90E23AB4208BF424512D00A4BD3F831 -:1038700000A0BAF1000F06D04B462246404629462A -:10388000CDE90067D047204602B0BDE8F0870024AC -:10389000F9E70124F7E700BF3007002138B50546F6 -:1038A0001046DDE904230C46FFF728FE50B190F8DE -:1038B000413043B9D0E90E23A34208BFAA420CBF4E -:1038C0000120002038BD0020FCE700002DE9F74F63 -:1038D0000E4605461F464FF000084FF0480B010EFC -:1038E00041EA0621DFF888A021F07F41214B5FFAF1 -:1038F00088F41B78A3420DD81F4A2049137801EBA6 -:10390000C30041F83350013303F0030346601370E2 -:10391000002026E0DAF800300BFB043494F84090E5 -:10392000B9F1000F20D1D4E90A03B34208BFA8427D -:103930000ED02046CDE90012FFF7FEFDDDE90012B2 -:1039400025F07F4383420FD1C4E90A5684F84290A0 -:103950000120E38C03F001031370226AA38CC7E9F2 -:10396000002303B0BDE8F08F08F10108BEE700BFF7 -:103970005C07002134070021580700213807002187 -:1039800070B50E461146D3E9002305460878FFF7C7 -:10399000B5FD0446C0B190F84130ABB9D0E90E2373 -:1039A000B34208BFAA420DD0290E41EA062121F0F8 -:1039B0007F411030FFF7C0FD25F07F43834203D1E4 -:1039C000C4E90E5601200CE0064A0749137801EBC2 -:1039D000C30041F8335046600020013303F0030375 -:1039E000137070BD5807002138070021042330B53B -:1039F000084AD2E900548C4208BF854202F108020D -:103A000005D0013B13F0FF03F3D1012030BD0020AE -:103A1000FCE700BF3807002108B5FFF76FFD48B18C -:103A2000D0E90A23134306D190F84030002B14BF8D -:103A30000120022008BD0320FCE708B5FFF75EFD6A -:103A400048B1D0E90C23134306D190F84130002B44 -:103A500014BF0120022008BD0320FCE72DE9F0413E -:103A600000254FF04808124E124F3378ECB2A342B3 -:103A700001D8BDE8F0813B6808FB043494F841307C -:103A80002BB904F11000FFF779FDC4E90C0194F89B -:103A900040303BB994F8423023B12046FFF76EFD29 -:103AA000C4E90A01012384F844301D44DDE700BF66 -:103AB000340700215C0700212DE9F0471746002557 -:103AC0004FF0480ADFF85C80DFF85C9043EA00467C -:103AD00098F80030ECB2A34201D8BDE8F087D9F8DD -:103AE00000300AFB0434D4E90823B34208BFBA42C9 -:103AF00016D194F841302BB904F11000FFF73EFDC8 -:103B0000C4E90C0194F840303BB994F8423023B139 -:103B10002046FFF733FDC4E90A01012384F844304D -:103B20000135D5E7340700215C07002108B5FFF710 -:103B3000E5FC034620B1002290F8440083F84420BD -:103B400008BD08B5FFF7DAFC003818BF012008BD32 -:103B50001FB5002301A8CDE90133039328F060FFCE -:103B600005B05DF804FB000030B5144B144D85B072 -:103B7000C5F88830134B0C46C5F88C30836808466E -:103B8000C5F89030D1F89830C5F8943028F0A4FEEC -:103B900005F1880028F03CFF03238DF80430002352 -:103BA00001A8CDE9023328F03BFFB4F8A410D4F803 -:103BB000A00028F085FF05B030BD00BF453C0001E6 -:103BC00064060021C93B00017FB504460E4626F07D -:103BD000BBFB38B3C56A214685F8A66014F0FB0626 -:103BE000D5F89C3010D1984778B1032301A8CDE9CE -:103BF00002668DF8043028F013FFB5F8A410D5F84C -:103C0000A00028F083FF04E0984728F089FF26F001 -:103C1000B1FB032C0A4B07D0042C09D064B91A68F5 -:103C200001321A6004B070BD9A6801329A60F9E7F7 -:103C30005A6801325A60F5E71A6901321A61F1E7F0 -:103C400060070021F7B5054626F07EFB1D4F0646AE -:103C5000C46A25BB28F064FF29463046D4F8983062 -:103C6000984718B3184DB4F8A220D5F890302046E4 -:103C70001344C5F8903028F02FFE05F1880028F095 -:103C8000C7FEFFF765FFB4F8A0300121ADF80030A2 -:103C9000D4F89C306846019328F0CAFE09E028F069 -:103CA0003FFF29463046D4F89830984726F062FB0B -:103CB00025B9FB680133FB6003B0F0BD3B690133FC -:103CC0003B61F9E7600700216406002137B50C4627 -:103CD0000F4D104BC5F888300F4BC5F88C308368FA -:103CE0000846C5F8903028F0F7FD05F1880028F067 -:103CF0008FFEFFF72DFFB4F8A0300121ADF80030A2 -:103D0000D4F89C306846019328F092FE03B030BD91 -:103D100064060021453C0001C93B000108B528F0BC -:103D200001FFBDE8084026F025BB000010B5094C96 -:103D3000002022460849FFF777F82246012007496C -:103D4000FFF772F8BDE810401C22002104482DF056 -:103D500044BB00BF1D3D0001CD3C0001693B00019B -:103D60006007002130B50446034D0FCD0FC495E820 -:103D7000070084E8070030BD600700212DE9F0410D -:103D800000240D4BDFF834801C700D4B05460846AF -:103D90000E4617461C7088F8004027F035F9094B8D -:103DA000186000EBC503991BB9428EBF204688F806 -:103DB000005088B2BDE8F0817D0700217E07002118 -:103DC0007C0700218007002130B50B4943EA0043FE -:103DD0000A480968047801EBC404A14201D100201B -:103DE00030BDD1E90050984208BF954201F1080169 -:103DF000F3D10120F4E700BF800700217D070021F7 -:103E0000014B1878704700BF7E0700210023024A4B -:103E10001370024A137070477D0700217C07002150 -:103E200070B5064615461C46FFF7CEFF80B9094B14 -:103E3000094A197812788A420BD9084A44EA06449A -:103E4000126802EBC10042F8315001314460197030 -:103E5000012070BD7D0700217E0700218007002121 -:103E600043EA00431148F0B50468DFF844C0254632 -:103E70009CF8001004EBC10E754501D1002014E040 -:103E80002846D0E900769E4208BF974205F1080512 -:103E9000F2D1012905D904EBC10454E90223C0E998 -:103EA0000023012001398CF80010F0BD80070021AB -:103EB0007D0700210122014B1A7070477C07002109 -:103EC0000022014B1A7070477C070021014B1878C3 -:103ED000704700BF7C07002137B5044625F050FA33 -:103EE0000022144B9C42144B0CBFDA701A7194F8E8 -:103EF000423003F0FD03012B01D125F051FA204699 -:103F00000CF082FC04F1280528460DF1070127F08A -:103F1000A1F840B9303420460DF1070127F09AF896 -:103F200020B903B030BD27F07DF8EDE727F07AF82F -:103F3000F1E700BF580D00212050002138B5164C84 -:103F4000164B174A1D6804F13C0392E8030083E80E -:103F5000030004F1480029790CF087FD012026F0C8 -:103F60007DF925F005FA01230E4DEB7094F84230EF -:103F700003F0FD03012B01D125F00AFA0CF066FCD9 -:103F800000200123687184F85832A4F85632BDE845 -:103F9000384025F094B900BF580D0021540D002180 -:103FA000F850002120500021054BDB7833B101236C -:103FB000044880F899309C3026F06ABD704700BFF5 -:103FC00020500021580D0021002025F078B90C2048 -:103FD00025F075B908B5012026F056F9BDE808406E -:103FE0000148FFF779BF00BF580D002108B5012037 -:103FF00026F04AF90348FFF76FFFBDE808400020AC -:1040000025F05DB9580D0021FFF7E4BF034B1A6896 -:10401000034B5068916803C3704700BF540D0021E3 -:10402000F850002108B5084B08481B68197990F82A -:1040300088308B4202D048300CF017FDBDE80840B4 -:10404000002025F03CB900BF540D0021580D00217F -:1040500010B50446012026F017F9A37B03F0FD03F9 -:10406000012B01D125F09CF9D4F8D00120B126F024 -:10407000D9FF0023C4F8D031D4F8D80120B126F0FC -:10408000D1FF0023C4F8D831034AD378013BD37061 -:10409000BDE8104025F074B92050002110B5044649 -:1040A000012026F0F1F8E36833B10B480B4A201ADF -:1040B000C010504380B2984794F870330BB125F08C -:1040C0007FF925F05DF9D4F85C0308B126F0AAFF6A -:1040D0000023237010BD00BFD01D00214DF833E137 -:1040E00038B50C4605461222002120462DF075F900 -:1040F000204695F8D83300F8023BD5E9F82326F09E -:104100002DFE95F8D9330E4A637095F8203423724A -:10411000D5F8E431A3FB0232DB0F43EA42036381AB -:1041200095F8E831237395F8F832637395F8F9320E -:10413000A37395F8FA32E37395F8FB32237438BD14 -:10414000E3361A0038B50446012026F087F8A37B31 -:1041500003F0FD03012B01D125F01AF900232046BD -:104160006370A370A4F8003184F83C300CF0A6FF13 -:10417000054620B920460DF0BFF8054640B1284657 -:1041800025F0F4F92046BDE8384003210DF090BA3F -:10419000074AD3780133D37025F0EAF80123284683 -:1041A00084F86830A4F86630BDE8384025F0DEB900 -:1041B00020500021002025F0D9B9000030B4027C45 -:1041C0000121022A18BF00220C4C817065789542AB -:1041D0000AD190F8002122B900F5827030BC26F097 -:1041E00057BC00F52E70F9E701FA02F2217821EAB6 -:1041F00002022270032130BC0DF05ABAB80F002120 -:10420000002025F0B3B9000010B5094C6378012BEC -:1042100004D9BDE810400C2025F0A8B904F16000D5 -:1042200027F017F904F17000BDE8104027F011B92C -:1042300048140021034B5B7813B10C2025F096B98C -:10424000704700BF48140021024B587800B10C2081 -:1042500025F08CB94814002108B5FFF7F9FE044B8E -:104260005B7823B1BDE80840002025F07FB908BD88 -:104270004814002138B51E4B01201C6825F0EEFFC4 -:1042800023790BB125F094F823791A4D2B72D4E9D8 -:104290000223C5E90423E379AB72A3796B72637DD2 -:1042A0002B760DF095FDD8B12862237980F8703314 -:1042B000A37980F87133E37980F87233D4E902236B -:1042C000C0E9DE230A22238AA0F86833638A5343B5 -:1042D000C0F86C330B23437263798371237DC37100 -:1042E000286A0DF0B5FABDE8384025F041B800BFA6 -:1042F0001C370021C0360021034B5A78012A04BF25 -:1043000000225A70704700BFC0360021084B186A5F -:1043100090F85B230AB9012202715B78012B03D16B -:10432000C370303026F0B4BB05210DF0DBB900BFFF -:10433000C036002130B5104C87B06378012B07D10F -:104340000025206AC3700571303026F0A1FB65702E -:10435000206A01A9FFF7C4FE236A0849084A591ACE -:10436000C91051433E2093F8213401AA89B225F0A7 -:1043700033F907B030BD00BFC0360021D01D002189 -:104380004DF833E130B52F4C87B06378206A012BAC -:1043900004BF00236370FFF781FE256A2B7983B188 -:1043A0001222002101A82DF018F82749274B691A7D -:1043B000C9105943442095F8213401AA89B225F047 -:1043C0000BF9256A95F85B33BBB1217A11F0010135 -:1043D00015D1122201A82DF000F81B491B4B691AB8 -:1043E000C91059431A2095F8213401AA89B225F041 -:1043F000F3F80022236A83F85B2307B030BD18204E -:1044000026F008FE01460028F3D040F20B1343804B -:10441000D4E90423C0E90223A37AC371637A8371C8 -:10442000237A0371236A9A794271B3F86823D3F827 -:104430006C3302824382237E4375054B187B26F042 -:10444000FAFDD6E7C0360021D01D00214DF833E13A -:10445000685000212DE9F043564B85B01D680DF0E2 -:10446000B7FC0446002800F0A180012025F0F6FEEC -:10447000002184F8701395F820304F4F84F8713381 -:1044800095F821304D4E84F87233D5E90A23C4E9FA -:10449000DE2395F82330384684F820344FF47A73BD -:1044A000C4F86C330C233461A4F868136372A91D3B -:1044B00018F0B8FB40F2E242BB885343C4F8E43141 -:1044C00095F8203084F8D83395F8213084F8D93322 -:1044D000DB07D5E90A01C4E9F8011CD50B0A03F092 -:1044E000C003403B17D14FF000084FF000098DF892 -:1044F00007300DF1070202ABCDE90289FFF7E6F9BB -:1045000048B19DF8073043F0020384F8D933DDE960 -:104510000223C4E9F82395F83230306984F8213455 -:104520006B6BC4F8F43295F8383084F8F83295F8AB -:10453000393084F8F93295F83A3084F8FA3295F83F -:104540003B3084F8FB320DF083F994F821348BB1C1 -:104550001B4B6A6B1B68E3641A4B1B6823651A4B81 -:104560001B68C4F80831E36D9A67184B1B680BB1E0 -:104570002046984724F0FCFEAB88288BB3806B8BD9 -:104580007080F380AB8B33812B8E738195F8223052 -:104590003373EB8BF3816B6B7361AB6BB3610DF0BA -:1045A0003BFA05B0BDE8F04306F044B805B0BDE8FD -:1045B000F08300BF1C37002120370021E83600219E -:1045C000CC070021C4070021C0070021D00700212B -:1045D00070470000012310B5064C2069C3703030CD -:1045E00026F056FA21693E20BDE8104091F82124BA -:1045F0000DF070BCE8360021034B18690123303000 -:1046000000F82D3C26F044BAE8360021044B186926 -:10461000C378012B04BF0023C370FFF73FBD00BF69 -:10462000E836002110B5437A04460B2B86B010D132 -:1046300001A9FFF755FD0C490C4B611AC9105943EC -:10464000002094F8213401AA89B224F0C5FF06B0F5 -:1046500010BD0C2BFBD1014690F82124002006B0A0 -:10466000BDE810400DF036BCD01D00214DF833E1FF -:104670000123303000F82E3C26F00ABAFFF70EBDB9 -:10468000012310B504468370303026F001FA04F59A -:10469000727026F0DEFE0548201A054CC0106043FB -:1046A000BDE8104080B224F0C9BF00BFD01D00217A -:1046B0004DF833E1F8B50579C388012D1AD0022DE4 -:1046C00021D0B5B94FF48562534313490688CC18FD -:1046D000B4F830224088921B82420ADCD4E98A670F -:1046E00003F56473C4E9E467C81824F0A1FE84F8F4 -:1046F0002052F8BD4FF48562074802FB03030022F5 -:1047000083F88822F5E74FF48562034802FB030330 -:10471000002283F8F022ECE7D01D002108B524F038 -:104720002FFE0022054B5A70054B93F821301BB128 -:10473000BDE8084024F034BE08BD00BF2050002171 -:104740004051002108B5012025F088FD24F010FE1D -:104750000122074B5A70074B93F821300BB124F01C -:1047600017FE0DF0F1FCBDE80840002024F098BDD4 -:10477000205000214051002108B5012025F06EFD98 -:1047800024F0F6FD0122064B5A70064B93F82130B7 -:104790000BB124F0FDFDBDE808400DF0D5BC00BF15 -:1047A0002050002140510021054B5B7833B101239B -:1047B000044880F829302C3026F06AB9704700BFD1 -:1047C0002050002168370021002024F069BD0C2012 -:1047D00024F066BD2DE9F041634B8AB05B78002B75 -:1047E00000F0BE80614D95F82860002E00F08C80AE -:1047F000D5F8FC80B8F1000F00F08180012205F5AA -:104800008C7305F1E0014046FEF7E0FB06466820A8 -:1048100026F000FC0446002800F09E8000F1080706 -:10482000384608F1020118F0C8FB384618F01CFCA5 -:1048300000B196B9204626F0F5FB042026F0EAFBED -:10484000014630B14FF441734380494B187B26F049 -:10485000F2FB012025F018FD51E00023A370D5F8EC -:10486000E031A36395F82B3184F83C3095F82A2188 -:104870009A4207D1D5E94861D5E94602914208BF7D -:10488000864203D043F0020384F83C300020D5E98F -:1048900048230021C4E91223C4E9140195F82B012F -:1048A00095F82A11884207D1D5E94870D5E94661C3 -:1048B000884208BFB74203D0D5E94601C4E91401D4 -:1048C00094F83C0014F076FC0028B3D1294B214623 -:1048D000D3E91C23C4E9162395F82A3084F8410053 -:1048E00084F83D300123E387FF2384F860304FF6DE -:1048F000FF73A4F862301E4B187B26F09CFB0AB0B5 -:10490000BDE8F041FFF70ABF1A4C0DF057FD257CBA -:10491000012D9ED13146232268462CF05EFD43F6E0 -:104920000543ADF802303C238DF80430A37C0DF133 -:104930000A008DF80930FF238DF823304FF6FF73FE -:10494000ADF82430D4E906238DF8085026F006FA95 -:10495000684624F09DFC7CE7002E3FF46EAFCEE766 -:104960000AB0BDE8F08100BF205000216837002167 -:10497000685000214051002108B5012025F084FC39 -:10498000FFF7CCFE0DF01AFDBDE80840002024F032 -:1049900087BC08B5012025F077FCFFF7BFFEBDE816 -:1049A00008400DF00BBD000010B50446012025F0B5 -:1049B0006BFC074B1868201A064CC010604304308B -:1049C000C0B225F0ABFABDE8104024F0D9BC00BF5E -:1049D000C0390021D53FF54F10B50446D0F8E80A9C -:1049E00028B1043826F01EFB0023C4F8E83AD4F8B6 -:1049F0002C0928B1043826F015FB0023C4F82C3903 -:104A000094F83B300BB124F0CBFC024A9378013B85 -:104A1000937010BD2050002138B504461F4D012071 -:104A200025F01CFC2A682046137A84F8D43300232E -:104A300084F8D53384F8D63384F85C3884F85E384B -:104A40005168C4F8D8330EF0B7FE014640B1607823 -:104A500024F002FE2046BDE8384004210EF062BD7D -:104A60000F4A93780133937094F83B300BB124F0E4 -:104A70008FFC2B68596851B14FF47A72636A0A3916 -:104A8000B3FBF2F304F57170C91A26F0DCFC607810 -:104A90000021BDE8384024F0DFBD00BFC839002147 -:104AA0002050002138B504461C4D012025F0D6FBCE -:104AB0002A682046137A84F8D433002384F8D53347 -:104AC00084F8D63384F85C3884F85E385168C4F8CA -:104AD000D8330EF071FE014640B1607824F0BCFD81 -:104AE0002046BDE8384004210EF01CBD2B685B68F1 -:104AF00093B14FF47A71626A4B4302F59C520832CB -:104B0000B3FBF2F3013B534304F57170B3FBF1F1D6 -:104B1000BDE8384026F097BC38BD00BFC839002139 -:104B200070B5134D00F571760446304626F091FCC1 -:104B30002B685B687BB14FF47A71626A4B4302F574 -:104B40009C520832B3FBF2F3013B53433046B3FBB4 -:104B5000F1F126F078FC00212B6860781B7A84F84C -:104B6000D51384F8D433BDE8704024F075BD00BF80 -:104B7000C839002110B5044600F5717026F069FCB3 -:104B8000002384F8D633012384F85E3810BD002159 -:104B9000407824F061BD0C21407824F05DBD000018 -:104BA000F0B590F85C3804469FB0002B39D100F581 -:104BB000717026F04EFC2046FFF70EFF012025F015 -:104BC00063FB94F8D42394F8D53322B1934224BFE5 -:104BD000432284F8D623002294F8D613607824F078 -:104BE0007EFB238C03F01D031D2B18D1FF234FF6F2 -:104BF000FF7200200021CDE908323C230022CDE9DC -:104C00000401CDE90632CDE90201D4E90C0194F8A2 -:104C10003A30CDE900010121607801F05FFC1FB05E -:104C2000F0BDD0F82C697C4F002E7ED000F64813E2 -:104C300000F5116101223046FEF7C8F9002800F0A6 -:104C4000D780682026F0E6F90546002800F0D080DD -:104C50006378314603800023837012A818F084F92A -:104C6000311805F1080018F0A8F9D4F82C39002BF8 -:104C700000F0898094F85BC904F5156185F83CC0A3 -:104C800094F85A39634508D151E90203D4F85069C0 -:104C90004A689A4208BF864203D04CF0020C85F85D -:104CA0003CC0D1E90023C5E9122300220023C5E955 -:104CB000142394F85B2994F85A399A4208D151E99F -:104CC0000203D4F850694A689A4208BF864203D06A -:104CD00051E90223C5E91423012385F83E30D4F8B5 -:104CE0005838387BAB634D4B2946D3E91C23C5E9C3 -:104CF000162394F85D3885F83D30012385F83F3060 -:104D000094F8D53385F8403094F8543885F841301C -:104D1000FF2385F860304FF6FF73A5F8623026F068 -:104D20008AF92046FFF758FE79E7D0F8E86A002EA6 -:104D300087D031460AA818F017F9311812A818F0D0 -:104D40003CF9002311939DF8283004F511618DF88A -:104D5000403003238DF84130DDE91223CDE90C23E7 -:104D60009DF82A300CA88DF84230DDE91423CDE9F6 -:104D70000E239DF82B3001228DF8433004F5326369 -:104D8000FEF712FA5AE794F833CB04F5326185F84E -:104D90003CC094F8323B634508D1D1E90262D4F8B3 -:104DA000200B4B689A4208BF864203D04CF0020C9D -:104DB00085F83CC0D1E90223C5E912230022002373 -:104DC000C5E9142394F8332B94F8323B9A4208D166 -:104DD000D1E90262D4F8200B4B689A4208BF8642A0 -:104DE00003D0D1E90023C5E9142394F84D3A74E7C0 -:104DF0006378311F26F8043C082306F8023C03239D -:104E000006F8013C387B26F016F901201FB0BDE8FA -:104E1000F04025F039BA00BF685000214051002110 -:104E200010B50446FFF7D8FD012025F02DFA607873 -:104E30000021BDE8104024F00FBC10B50446FFF778 -:104E4000CBFD012025F020FA2046BDE810400DF0F2 -:104E50002FBC3C2380F8D633012380F85E3870479E -:104E600000221346F0B5D0E90076C3F12005A3F186 -:104E7000200427FA03F106FA05F5294326FA04F47B -:104E80002143C90744BF81180B7203F1010348BFD6 -:104E90000132252BE9D180F82D20F0BD70B50446F4 -:104EA0000025012025F0DAF984F84E530BF09CFB25 -:104EB000A4F8905184F8B7532546354BC4F88C01BB -:104EC000D3E90E23E5E9DA23284624F0B1FA0123D9 -:104ED00084F89633D4F88C3183EA1343A4F89833DA -:104EE00094F8DD3BEBB194F8B713B4F89031594026 -:104EF00028460DF007FD94F8DD3B84F84D0320466D -:104F000093B1244B1B687BB19847054678B1204686 -:104F100003210EF07FFD29466078BDE8704024F043 -:104F2000D2BBB4F89011E3E70EF0B4FDEDE7012336 -:104F300084F88931A378012B13D194F8C52B0AB9D1 -:104F400084F89231D4F82C66B4F8525824F06DF9F4 -:104F50003246294625F00EFF0123A4F83E0684F8C8 -:104F6000C63B94F854335BB1D4F82C66B4F852586D -:104F700024F05BF93246294625F0FCFEA4F85603DE -:104F80006078002124F09FFBBDE8704024F0F0B968 -:104F900020500021840700210021407824F093BB99 -:104FA0000C21407824F08FBBF8B583780446012BA0 -:104FB00011D190F88951012D0DD1D0F82C76B0F88F -:104FC000526824F032F93A46314625F0D3FE84F88F -:104FD000C65BA4F83E06012384F84E33002394F800 -:104FE000DD2B84F8893184F892316AB1D4F8240534 -:104FF0000F22A0F8003F47F6FF73FF21A0F8023F01 -:1050000000F604702CF0E9F904F5CA70BDE8F84028 -:1050100025F03EBD10B590F888310446012B04D12F -:10502000FFF7C2FF2046FFF7BFFC2046BDE8104057 -:10503000FFF7A0BD10B590F888310446012B04D1CC -:10504000FFF7B2FF2046FFF7AFFC2046BDE8104057 -:105050000DF02EBB10B50446FFF7A6FC60780021CA -:10506000BDE8104024F02FBB90F85030012B12D037 -:10507000094B1B68D3E90223C0E9E823C0E91623E2 -:10508000B0F890310633A0F86030082380F8523031 -:10509000012380F850307047BC390021D0F8D03B54 -:1050A0000BB1407818477047D0F8D43B0BB140782B -:1050B0001847704790F82031012B0ED0D0F8A83354 -:1050C000C0F82431B0F8AC33A0F82831B0F8B433CC -:1050D000A0F82A31092380F8223170470023C0F854 -:1050E0002031C0F82431C0F82831704768220021EF -:1050F0002CF073B95030FFF7F9BF2B2307B58DF8AB -:1051000003008DF804006846ADF800108DF80230F9 -:105110008DF8051024F0BCF803B05DF804FB2D23D6 -:1051200007B5ADF800008DF804006846ADF8023010 -:105130008DF8051024F0ACF803B05DF804FB08B559 -:10514000012025F08BF8BDE8084024F011B90000DB -:105150002DE9F04FDFF840810446D8F800608FB0A9 -:1051600006F1080529460FF0EFFD294600252046E7 -:105170000FF052FEAA46B37DAB4243D9002794F804 -:10518000562004F1570305F101090BE0D4F89430DF -:1051900053BB94F89C30C4F894B0ED1A84F89D5039 -:1051A00022E00137BA421FD913F8011B4945F8D153 -:1051B00020460EF0E5FE96F84030F18E0293D6E9D7 -:1051C0000E23CDE900230A46F16A83460EF07EFFE6 -:1051D000D4F89030002BD9D1E368C4F890B06B4379 -:1051E00084F89C50C4F8983094F85630BB4207D1EC -:1051F00094F834305A1C0E3384F8342044F823A039 -:105200004D46B8E7D8F80010204608310FF01AFDD7 -:10521000216F04F1600026F016F92C23A5782022D6 -:10522000002106A8ADF81630ADF814502CF0D5F8D2 -:10523000E36A1A4A0793238B04F138015BBAADF88D -:105240002030638B8DF81950ADF82230A38850348C -:10525000ADF8243054F8403CA3FB0232DB0F43EAA4 -:1052600042030022ADF82630134651F8040B40B13A -:1052700040880EAD5A1C05EB430323F80E0CD3B245 -:1052800001228C42F1D10AB18DF8283005A823F013 -:10529000FFFF0FB0BDE8F08FD8390021E3361A00C8 -:1052A00090F8BA3080F85430704710B504468AB090 -:1052B00081780020FFF721FF0021202202A82CF096 -:1052C0008CF82C228DF806204422A37801A8ADF892 -:1052D00004308DF807208DF808208DF8093023F070 -:1052E000D7FF20460FF056FA0AB0BDE8104024F070 -:1052F00047B8082380F8543070473D2380F8543075 -:10530000704710B50446012024F0BEFF236D13B191 -:10531000002283F88A226378032B06D194F8543054 -:10532000A0784BB11946FFF7FAFE20460FF032FA8B -:10533000BDE8104024F024B801461846FFF7DDFE12 -:10534000F3E7F8B5054610F0DDFA044648B1284603 -:10535000042110F0A5FA21462846BDE8F84010F0D7 -:1053600039BA012024F07AFF2C6DCCB1012384F8E6 -:105370008931A378012B13D194F8C52B0AB984F88D -:105380009231D4F82C76B4F8526823F04EFF3A46A6 -:10539000314625F0EFFC0123A4F83E0684F8C63B15 -:1053A0002846022110F092FABDE8F84023F0E0BF51 -:1053B000F0B5044685B007200FF028F9064630B353 -:1053C000144B03A91868258C0390304619F080F916 -:1053D000114F0635ADB2D7E90E230095304419F0D0 -:1053E0008AF90622314620460FF017F994F8A030CA -:1053F000A4F8A85043F0010384F8A030D7E90E23A5 -:10540000C4E92C23236D13B1002283F8B82005B022 -:10541000F0BD00BFEC2403012050002173B5044609 -:1054200003200FF0F3F80646E0B1124B01A95868CB -:10543000258C0190304619F04BF90635ADB22A465D -:1054400094F8BA10304419F068F906223146204623 -:105450000FF0E3F894F8A030A4F8B85043F002033A -:1054600084F8A0300321204602B0BDE8704010F05F -:105470002DBA00BFEC24030110B50446C43025F05A -:1054800007FB2046BDE81040032110F01FBA10B5FD -:105490000446012024F0F8FE20460FF07BF923F0AB -:1054A0006FFF6378022B04D12046BDE8104010F056 -:1054B000E3B910BD164A30B514684FF49562C3883D -:1054C00085B002FB0344062203890546ADF804308B -:1054D000ADF80A30C37F01A88DF80C308DF8062096 -:1054E0008DF807108DF8081023F0D2FE94F82E34B2 -:1054F00063B12989B4F8360410F0EEFB054628B9EB -:1055000004F5866023F0C4FE84F82E5405B030BD47 -:10551000B43A00212DE9F0438BB0044615460E46FF -:105520002422002101A82BF058FF27238DF80230F8 -:1055300040F2E243B4F8E82294F8EB1294F8EA72ED -:1055400002FB01FE02FB07F003FB0EFE94F8D8926B -:1055500003FB00F8D4F8E432B9F1010F0CBF5B197A -:10556000EB1A734405932369D4F8E0020393B4F86B -:10557000D432B4F808C0ADF8183094F8EC3208BF53 -:1055800040198DF81A3094F8F43218BF281A8DF8A3 -:105590001B3094F8F53208BF40448DF81C30A37AD4 -:1055A00018BF4044ADF800C08DF803600CBF0490F4 -:1055B0000490ADF806C08DF8046002958DF81D705A -:1055C0008DF81E10ADF824208BB9B4F83021012BD2 -:1055D0000CBFB4F83031B4F82C316846ADF8202057 -:1055E000ADF8223023F054FE0BB0BDE8F083B4F8E0 -:1055F0002C21ECE738B5054604200C4625F00AFDC1 -:10560000014650B12B89C47003800F238370034B74 -:10561000187BBDE8384025F00EBD38BD685000212C -:1056200038B5054604200C4625F0F4FC014650B17F -:10563000EB88C470038001238370034B187BBDE8A3 -:10564000384025F0F8BC38BD68500021014B9B7CE8 -:10565000C3777047283A0021024B1B681B79C37738 -:10566000704700BFE03900213E23C377704708230D -:10567000C37770472223C37770470D23C3777047E2 -:10568000014B5B7CC3777047283A00213D23C377E9 -:105690007047000010B50446C07A10F097FB4FF435 -:1056A00095611B4BE2881B6801FB0233C27D01320E -:1056B000C275A27A22BB94F8D412032993F856201B -:1056C00021D1013A18BF01228A1A1A4492F95022B4 -:1056D0007E2A1AD193F81504B8B10E4A58181268E8 -:1056E000032992F9282080F84F2208BF83F853221B -:1056F000D3F834335B0702D5012384F8CB3210BDD5 -:1057000094F8D512D9E70122DEE784F83A21F6E7CA -:10571000B43A0021DC4D002138B590F847500446DA -:105720000022C17F4DB1222906D180F847201121E6 -:10573000BDE83840FFF7EEBE0C25204684F8472030 -:105740000022FFF7E7FE204610F04CFEE37F442BDB -:1057500007D1162329462046E377BDE83840FFF7F6 -:10576000A9BE38BD38B50446C08813F0A7F9054670 -:1057700098B9082025F04EFC014668B1E388038003 -:1057800041F2017343802389C380E37F0371044B9B -:10579000187B25F050FCA57638BD0123A376FBE7E6 -:1057A00068500021F8B504460121C688008915F02B -:1057B0009FFD0221208915F09BFDE07A10F006FB89 -:1057C000054604F52E7025F044FE01236376E37F41 -:1057D0003E2B0CD100276776EB7D2046013BEB7515 -:1057E00010F000FE3A462046E17FFFF793FE144B8F -:1057F0001B6893F83520134B1C680023934219D281 -:10580000E188B14217D1657EADB9A17E99B108207A -:1058100025F000FC014668B1E388038041F2017382 -:1058200043802389C380E37F0371074B187B25F0F6 -:1058300002FCA576F8BD013304F56274DEE700BF13 -:10584000DC4D0021E4390021685000218378012BD0 -:1058500008BF4376704770B5054604200C46CE7FDE -:1058600013F0D0FE014648B122230370E37A43705F -:10587000237BC6708370284613F09AFE2146284683 -:10588000BDE8704010F0ADBE034B9B7CCB7701238D -:1058900080F87F33704700BF283A00210846052171 -:1058A000FFF7A8BEFFF7D7BF012380F87F3370470B -:1058B0002DE9F34705460C46C87A10F087FAB5F88B -:1058C0000432B5F80672DA1DB5F80832B5F85E1480 -:1058D000C3EB470302FB0133A4F848300023A4F8CC -:1058E0004A30064610F03AFBB4F84830B5F80612D4 -:1058F000B5F80A225B1A5343EF6900285FD140F2E2 -:10590000E242DFF8289102FB0377D9F80010DFF8B4 -:105910002081731A9B1008FB03F313F0FF0302D0DE -:105920003269002A47D03A46032340F2E247D9F8C9 -:105930000010B08A711A891008FB01F10A31009336 -:10594000784305F11403C9B224F00CFBD4E9042315 -:105950009B1A326913440344B3F5FA7F38BF4FF4FE -:10596000FA73E36440F2E243B5F80A1294F8EC22C9 -:105970005943304BD4F8F0021B68DB8E00FB123326 -:105980000B44E26C9A4249D202B0BDE8F087013282 -:10599000D2B2981AC7D40CFB001090F804E0BEF104 -:1059A000000FF4D00369406B03EB000A24F004FD00 -:1059B00050443061B7E701224FF09C0CE9E740F218 -:1059C000E24909FB0377B4F84A20B6F814800132A3 -:1059D00092B202FB08F8A4F84A20726A394609FB21 -:1059E0000828404624F0EEFC0028ECD0394640461A -:1059F00024F0E8FCD4E904239B1A0344B3F5FA7FAE -:105A000003D84FF4FA70E064ACE73946404624F01E -:105A1000D9FCD4E904239B1A1844F4E7521AE2642F -:105A2000B4F848200132A4F84820AAE7DC39002164 -:105A3000976FF996DC4D00217FB50546C87A0C4674 -:105A400010F0C4F9C37D0646F3B9837D002B00F046 -:105A5000F0804179C1B940F2E242838A5343804ADF -:105A60001068804A301A801050437F4A0A30CDE9CE -:105A70000112F268C0B200921A4624F0BDF9002863 -:105A800000F0D7800123737121462846FFF710FFED -:105A90002146304610F018FB744BC5F83C34744B6B -:105AA000C5F84034734B1B681B88E380D5F8483237 -:105AB000C4F8E830B5F88232A4F8C8320AF094FD90 -:105AC000D5E98623C4F8E400204610F04BFA2420E0 -:105AD00013F098FD0146002800F0A1801F230370F9 -:105AE000E37A4370237B837094F8D432022B03D083 -:105AF000032B14BF01230423CB7094F8D532022B5F -:105B000003D0032B14BF012304230B71B4F8DA3242 -:105B100028464B7194F8D832B4F8DA22DB03C2F38A -:105B20000B029BB213431B128B71B4F8DC32CB71A6 -:105B3000B4F8DC32C3F303230B72D4F8E0324B72B7 -:105B4000D4F8E0321B0A8B72B4F8E23203F00F0390 -:105B5000CB72D4F8E4320B73D4F8E4321B0A4B73E3 -:105B6000B4F8E63203F00F038B73B4F83031CB7323 -:105B7000B4F830311B0A0B74B4F82C314B74B4F800 -:105B80002C311B0A8B7494F8EC32012BCB740CBFB4 -:105B9000002394F8F0320B7594F8EC32012B0CBF13 -:105BA000002394F8F1324B7594F8EC32012B0CBFC2 -:105BB000002394F8F2328B7594F8F43294F8F522BD -:105BC00003F00F0343EA0213CB7594F8EA320B7625 -:105BD00094F8EB324B76B4F8E8328B76B4F8E832CE -:105BE0001B0ACB76E36C0B77E36C1B0A4B77B4F89C -:105BF0004E308B77E36CCB77E36C1B0A81F8203057 -:105C0000B4F84E3081F82130B4F8483081F82230B1 -:105C1000B4F848301B0A81F8233013F0C9FC012383 -:105C20002146284684F8473004B0BDE8704010F0A3 -:105C3000D8BC2046FFF721FD042025F0EBF90146F2 -:105C400008B904B070BDE388038044F60133438093 -:105C5000094B187B04B0BDE8704025F0ECB900BFDB -:105C6000DC390021976FF996717E010125650101EC -:105C700081650101B03A002168500021002310B570 -:105C80000C46084681F84730FFF7FAFC204612F030 -:105C9000FFF82046BDE810400221FFF7ABBC000032 -:105CA00070B50546C87A0C4610F090F8384B064699 -:105CB000D3E904329A4205D3C378FBB1204611F0F0 -:105CC000FFFF1DE001220D21284601F097F9214632 -:105CD000284610F090FC0023204684F84730FFF758 -:105CE000CCFC2146304610F082FA204612F0D0F863 -:105CF00002212046BDE87040FFF77CBC11F046FF52 -:105D0000204610F091F9337923B9224629463046CE -:105D100012F04EF80023102084F8473013F072FC84 -:105D2000014670B321230370D4F8E4304370D4F8F3 -:105D3000E4301B0A8370B4F8E630C37094F8E7309F -:105D40000371E36C4371E36C1B0A8371B4F84E304A -:105D5000C3716369037263691B0A4372E38A8372C6 -:105D60002369C37223691B0A0373638A4373B4F8FC -:105D700048308373B4F848301B0AC373284613F0C5 -:105D800017FC2146284610F036FC0121B1E700BF80 -:105D9000283A002170B50646C87A0C4610F016F86D -:105DA00005462146304610F026FC2046FFF762FCEF -:105DB0002146284610F01BFA204612F069F82046CA -:105DC000BDE870400221FFF715BC10B50C4610F07D -:105DD00012FC204612F05CF82046BDE8104002217B -:105DE000FFF708BC10B50C4610F005FC204612F079 -:105DF0004FF844232046E3770221BDE81040FFF727 -:105E0000F9BB40F67C42838C10B5043B9BB29342B5 -:105E1000044601D9122010BD037E1F2BFAD8037946 -:105E2000012BF7D8C388B3F5805FF3D20389B3F5AC -:105E3000805FEFD2C368B3F5801FEBD20369B3F57F -:105E4000801FE7D240F6FB73828A9A42E2D8C28A68 -:105E50009A42DFD881784B1E012B01D90429D9D170 -:105E6000E078431E012B01D90428D3D122F094FFFE -:105E70000028CFD094F82230013B1E2BCAD894F8CA -:105E80002330013B1E2BC5D894F82030102BC1D8ED -:105E900094F82130102BBDD8D4E90A329A42B9D3F4 -:105EA0000020B8E71FB528220389ADF80620ADF819 -:105EB0000430ADF80A30C37AC2888DF80C30037B09 -:105EC000044601A8ADF808208DF80D3023F0E0F964 -:105ED00018B91A21208921F0F5FB04B010BD00008B -:105EE00070B50D4E054600F5FA700C4625F0B1FA76 -:105EF00033681979102903D100222046FFF70AFBE5 -:105F0000336828460122197901F078F82046BDE867 -:105F1000704010F067BA00BFB03A00212DE9F74F8A -:105F2000064600F5FA70894625F093FA092013F029 -:105F300069FB044620B3214BD3E90E57BD42B3F8A9 -:105F4000408024D093F812A093F813B0336A0193E1 -:105F500024F032FA019B1844854203D8356A24F0B4 -:105F60002BFA0544BBF1040F02D0BAF1040F00D1A3 -:105F70009635AF420BD201221121304601F03EF896 -:105F80004946304603B0BDE8F04F10F02ABB20234D -:105F900023702B0A6570A3702D0C3B0A277184F8BF -:105FA00007803F0C4FEA182821463046E5706371A0 -:105FB000A77184F8088013F0FBFAE1E7283A002182 -:105FC0002DE9F74F814F06463B690C46C1F8E43096 -:105FD0003B8CA1F84830D0F84832C1F8E830B0F82E -:105FE0008232C87AA1F8C8327B69CB64BB694B6145 -:105FF000FB690B610FF0EAFE0546214610F085F8BB -:106000002146284610F060F8EB78ABBBBB69204610 -:10601000EB60B4F8E832AB82D6E986230FF0A2FF3A -:10602000284612F037F820460FF0FEFFB4F848205B -:10603000B6F80632D01AB0F5004F0CDA40F2E2475B -:10604000B6F8CA11521AB6F80A1292B24A43E16C73 -:1060500007FB021222662F79BFB922463146284635 -:10606000AF7012F02DF9A4F84A700121204603B058 -:10607000BDE8F04FFFF7BEBA2046D6E986230FF001 -:1060800071FF204612F0A4F8CDE7B6F8CA21B5F8A2 -:1060900074E09B1A9BB2034440F2E240B6F80A2235 -:1060A000AF6F03FB0222D6F8D031A98A00FB02337E -:1060B00000221FFA82FCBEF1000F53D101FB0CF845 -:1060C00000FB0878984502F10102F2D92846A4F8AD -:1060D0004AC010F09EF801280746C6D9284610F09D -:1060E000A7F801468246284610F0D4F8022F13D1B3 -:1060F0009AF8EC32012B38D0DAF8F022DAF81430C2 -:106100001344DAF810209B1AD0E90412521A934271 -:1061100034BF00230123AB70AB78012B39D1284663 -:1061200010F086F801468146284610F0B3F80022A8 -:106130008346022F1BD140F2E240D6F8D011236EE5 -:106140000B44B6F80A1200FB0133A3EB0801A8EBDD -:106150000308DAF8F0328A1A4344C9F80821CBF868 -:10616000083182E70CFB0118AAE70023D3E7D9F82E -:10617000083149461A442846019210F08BF85946D6 -:106180008146284610F086F8013F8346019AFFB207 -:10619000CFE72146284610F09DF84FF0000806464C -:1061A0000146022F07D1D4E904239B1AA3EB08036D -:1061B000C6F8F83259E7284610F08CF8D0F8F832D3 -:1061C000013F01469844FFB2EBE700BF283A0021A7 -:1061D0000B4670B5264C01F1640204F130062546E9 -:1061E00003CDB542106051602C4602F10802F6D191 -:1061F000286810601F4A517C1973917C022903D0D2 -:10620000042914BF0121032183F8D412D17C02296F -:1062100003D0042914BF0121032183F8D512117D75 -:10622000108E83F8D812D18AA3F8F402A3F8DA12F8 -:10623000118B508EA3F8DC12D169A3F8EA02C3F8DF -:10624000E012116AC3F8E412918CA3F82C11D18CDE -:10625000A3F8301192F8281083F8EC12D16A928ECC -:10626000C3F8F012A3F8E822C3F8081170BD00BF0C -:10627000383A0021283A002138B5044615480D4621 -:10628000FFF7BFFD48B101221E21204600F0B6FEF7 -:106290002846BDE838400FF0C3BC0F4BDB6ADB0774 -:1062A00002D401221A21F0E729462046FFF790FF89 -:1062B0002846FFF7F7FD40F27121084B04F5FA700C -:1062C0001B8B4B434FF47A71B3FBF1F1BDE83840BF -:1062D00025F0B9B8383A002120500021DC500021C7 -:1062E000034B08465B7CCB770221FFF783B900BFE5 -:1062F000283A002170B5054601F164000C46FFF70D -:1063000080FD48B101221E21284600F077FE20467C -:10631000BDE870400FF084BC124BDB6ADB0702D48F -:1063200001221A21F0E7104E307C0FF04FFD30B9FA -:10633000307C0FF007FD10B901224321E4E720462D -:10634000FFF7B0FD40F27121084B05F5FA701B8B89 -:10635000BDE870404B434FF47A71B3FBF1F125F087 -:1063600072B800BF20500021283A0021DC500021E3 -:10637000F8B5054618200F4614461E4613F042F99C -:10638000014660B307702388FF22437023881B0AED -:1063900083706388C37063881B0A0371A388437189 -:1063A000A3881B0A8371E388C371E38846721B0AC2 -:1063B0000372B5F806328372B5F806321B0AC3724F -:1063C00000F10E031A3003F8022C03F8012C0233FB -:1063D0009842F8D12846BDE8F84013F0E9B8F8BD76 -:1063E00038B5044609200D4613F00CF90146002883 -:1063F0003FD0057094F82203B4F84823B4F84C3326 -:1064000018B1D4F83003000520D440F64800824289 -:1064100028BF0246834228BF0346B4F846034870AB -:10642000B4F84603CA70000A120A88700A71B4F8F8 -:106430004A2320464A71B4F84A23CB71120A1B0A38 -:106440008A710B72BDE8384013F0B2B894F8550069 -:10645000032804D1B2F5296F38BF4FF4296294F8AC -:1064600054000328D9D1B3F5296F38BF4FF42963FD -:10647000D3E738BD70B5054602200E4613F0C2F8CA -:10648000044648B3067023F08BFF1428034617D93F -:106490001E2817D9322817D94B2817D9642817D99D -:1064A000962817D9FA288CBF0023012395F8F20308 -:1064B0002146034463702846BDE8704013F078B865 -:1064C0000723F3E70623F1E70523EFE70423EDE7CE -:1064D0000323EBE70223E9E770BD00002DE9F0415B -:1064E0008CB005468846144600211F2203A81F468B -:1064F0009DF860602AF071FF05238DF80A309DF841 -:106500006830ADF808508DF82B30BDF86C308DF840 -:106510000B608DF80C60ADF80E508DF810808DF882 -:106520001170ADF82C3064B1238CADF81830638C49 -:10653000ADF81A30A38CADF81C3094F82B308DF8E0 -:106540001E300DF11200DDE9122324F007FCDDE915 -:1065500014230DF1250024F001FCDDE916230DF1D3 -:106560001F0024F0FBFB02A822F092FE8EB90A4B1A -:106570009B6A5B040DD52123ADF802309DF8643091 -:106580006846ADF80050ADF804508DF8063022F0A2 -:106590007FFE0CB0BDE8F08120500021044B1A684A -:1065A00000F56573043207CA83E80700704700BF2F -:1065B000B03A00210A4BB0F806225B8B10B59B1A4B -:1065C00047F6FE729BB29342044602D9492112F06B -:1065D000A7FA044A04F5687307CA83E8070010BDE8 -:1065E000283A0021383A00211FB5154B154A1B687F -:1065F0008DF80310C31ADB1053430022CDE90122AA -:10660000ADF80C2007229BB2ADF800308DF80220C7 -:106610008DF80410ADF8063059B9B0F8A433ADF8D0 -:106620000830B0F8A633ADF80A30B0F8A833ADF8AA -:106630000C30684622F02CFE05B05DF804FB00BF6C -:10664000B43A0021BDCAE28C034B1B68D3E9022394 -:10665000C0E9F223704700BFB03A002110B50446EC -:10666000082012F0CFFF014640B3B4F80432B4F86A -:106670005E04DA1DB4F8063202FB0033A4F8D0330E -:1066800001230B70D4F8C83320464B70D4F8C833BC -:106690001B0A8B70B4F8CA33CB7094F8CB330B71F0 -:1066A000D4F8CC334B71B4F8D0338B71B4F8D03309 -:1066B0001B0ACB71BDE8104012F07ABF10BD00007C -:1066C00030B404460D4B00F572750FCB85E80F0012 -:1066D000B4F80622B4F8D0339B1A47F6FE729BB288 -:1066E000934203D8D4F8CC33034304D1204630BCC2 -:1066F000492112F015BA30BC704700BF383A00216A -:1067000038B50546092012F07DFF0446B8B1AB78D4 -:106710000B4A002B0CBF08230E2300F8013B094B4A -:10672000D3E90A1323F48263DB040A40DB0C24F070 -:1067300000FB21462846BDE8384012F039BF38BD7D -:106740002FCF87F72050002138B50546092012F0D9 -:1067500059FF0446C0B1092300F8013B0B4BB5F8C3 -:106760003013D3E90A23120C1204114323F4826379 -:10677000074ADB040A40DB0C24F0DBFA21462846FA -:10678000BDE8384012F014BF38BD00BF20500021D2 -:106790002FCF87F7F8B5044641F6EF30314F324A34 -:1067A000D2E9043202EA000103EA0705C4E9CA514A -:1067B0002E4DD5E90A1632400126194039401040C5 -:1067C000C4E9CC10C3F34021C3F3802384F85930CB -:1067D000A37884F8226384F8581033BB94F84533C7 -:1067E0001BBB100621D5A36859031ED5082024F031 -:1067F00011FC0146C8B11E4B1E4A1B68E31ADB1090 -:106800005343038046F6014343801B4B1B6893F8B8 -:10681000443006715A1FD2B2922A28BF9623837140 -:106820004371164B187B24F006FCD4F8343304F281 -:1068300004409A0711D5D4F8183423F07F4323F08D -:10684000FF03B3F5803F08D1AB691B0405D5BDE854 -:10685000F8404FF47A7124F0F6BDBDE8F84024F01A -:10686000F8BD00BF2FCF87F7283A00212050002124 -:10687000B43A0021BDCAE28CDC4D002168500021F1 -:1068800090F81A2303464AB9012280F81A23044AD1 -:1068900092E80300C3F81C03A3F82013704700BF5D -:1068A000383A00211FB5114B114A1B68C31ADB107F -:1068B00053430922ADF8022000229BB2ADF800300C -:1068C000ADF8063090F81C338DF804208DF80830B0 -:1068D000B0F81E33ADF80A30B0F820336846ADF892 -:1068E0000C3022F0D5FC05B05DF804FBB43A002171 -:1068F000BDCAE28C10B50446022012F083FE0146A8 -:1069000040B102230370237C43702046BDE8104051 -:1069100012F04EBE10BD00001FB5027C0446FF2AD7 -:106920002AD0184B8DF80C201B68C31A1648DB10B0 -:10693000434398B20623ADF8063000238DF80830A3 -:10694000D4F88833ADF80400DB0744BF16238DF874 -:106950000C300E4BADF80A001B687BB1984768B14C -:1069600001AB03CB1B88C4F83004A4F838340123EE -:10697000C4F8341484F82E3404B010BD01A822F0F9 -:1069800087FCF9E7B43A0021BDCAE28C783A0021CD -:10699000034B1B7C0374012380F87F33704700BFD7 -:1069A000283A0021024B1B681B790374704700BF13 -:1069B000B03A00213E2303747047222303747047CA -:1069C000302303747047FF23037470472823037434 -:1069D00070471E23037470473D2303747047000003 -:1069E00030B5054D00F56B740FCD0FC495E803006D -:1069F00084E8030030BD00BF383A00212DE9FF4193 -:106A00002C4D04462B8AADF804306B8AADF8063065 -:106A1000AB8AADF80830EB8AADF80A300023ADF848 -:106A20000C30ADF80E308368DA0638D40DF1040866 -:106A3000404611F0E3FC90BB04F56B7605F11007BE -:106A40000FCF0FC697E80300A36886E803009B06F4 -:106A500028D42B8AB4F894239A4205D8B4F8962304 -:106A60009A4228BFA4F894336B8AB4F894239A42CC -:106A700005D8B4F896239A4228BFA4F89633AB8A77 -:106A8000B4F89823934228BF1346B4F89A23A4F885 -:106A90009833EB8A934238BF1346A4F89A3304B074 -:106AA000BDE8F08104F5657498E8070084E8070004 -:106AB000F5E700BF283A0021044B1A6800F565731A -:106AC000043207CA83E80700704700BFB03A0021CC -:106AD000B0F896330F21072B8CBF0823042300F551 -:106AE0006572FFF745BC0000034B10211A680123B3 -:106AF0000432FFF73DBC00BFB03A002170B5B0F8DA -:106B0000B01388B0ADF80810B0F8B2132E4BADF842 -:106B10000A1000211D682D4B451BED105D43B0F898 -:106B2000AC23B0F8AE3304469A42ADB2ADF80420BF -:106B3000ADF80630ADF80C10ADF80E100AD090F894 -:106B4000B4232AB91E21284620F068FF08B070BD82 -:106B50009342F7D301A811F051FC0028F2D1B4F808 -:106B6000AC33B4F80A22B4F8AE639342B4F8B0037D -:106B7000B4F8B2130BD19E4209D1B4F80422824278 -:106B800005D10A224A43B4F88242A24216D010220A -:106B9000ADF81A000DEB0200ADF81050ADF8122060 -:106BA000ADF81450ADF81630ADF81860ADF81C1003 -:106BB00022F06EFB0028C9D11A21C4E7284601A99A -:106BC00020F0F6FEC2E700BFB43A0021BDCAE28C55 -:106BD000084B10B51B6800F246319A88DB88A0F894 -:106BE0004A23A0F84C33044612F0FBFBA4F85E03E2 -:106BF00010BD00BFB03A00211421FFF7F1BB1521F1 -:106C0000FFF7EEBB1FB5134B134A1B688DF803103B -:106C1000C31ADB10534312229BB2ADF80030ADF81B -:106C20000430B0F852338DF80220ADF80630B0F8D9 -:106C30005433ADF80830B0F84E33ADF80A30B0F840 -:106C400050336846ADF80C3022F022FB05B05DF8F9 -:106C500004FB00BFB43A0021BDCAE28C2DE9F84321 -:106C60003A4B0446998A1A296ED9188A1A286BD980 -:106C7000DA8AB2F5A47F67D35B8AB3F5A47F63D3C6 -:106C800094F82293B4F84E73B4F85053B4F852C346 -:106C9000B4F85463B4F848E3B4F84C83B9F1000F86 -:106CA00004D0D4F8309319F4006F07D140F64809A6 -:106CB000CE4528BFCE46C84528BFC846B4F84A933B -:106CC000484528BF4846B4F84693A4F852034945BE -:106CD00028BF4946434528BF4346724528BF7246F0 -:106CE00094F855E0A4F84E13BEF1030FA4F8543302 -:106CF000A4F8502306D1B2F5296F38BF4FF42962AA -:106D0000A4F8502394F85420032A06D1B3F5296F30 -:106D100038BF4FF42963A4F85433604509D1B94210 -:106D200007D1B4F85433B34203D1B4F85033AB4273 -:106D300003D000212046FFF765FF204604F24E31C4 -:106D400012F04FFBA4F86003BDE8F883283A002155 -:106D500010B50446032012F055FC014658B1192322 -:106D600003700B4B1A68127942701B685B79837051 -:106D7000204612F01DFCD4F88833204623F020036F -:106D8000C4F888336E21BDE8104011F0C9BE00BFC1 -:106D9000B03A0021094B1A7C5B7CD10748BF80F8D0 -:106DA0006633910748BF80F8673352074FF06E0192 -:106DB00048BF80F8683311F0B3BE00BF283A002105 -:106DC000F8B504460B2012F01DFC0146E8B105465B -:106DD00029230020134E05F8013B326802449379C1 -:106DE00057791B0143EA87031779D2793B43043073 -:106DF00043EA8213242805F8013BEED1336820468C -:106E000093F828308B7212F0D3FBD4F888332046E5 -:106E100023F40073C4F888336E21BDE8F84011F004 -:106E20007FBE00BFB03A002138B5837804462BB14D -:106E30002046BDE838406E2111F072BE90F845330F -:106E4000002BF5D026F038F9D4F8F01123F0BAFA77 -:106E5000D4F8F43198421ED323460F4904F124009C -:106E600011F8012B043302F0030583F8C55102F039 -:106E70000C0583F8C65102F0300522F03F0283F87A -:106E8000C75183F8C8218342EAD1044B5B7E03F0EB -:106E9000030384F8ED3138BD383A0021283A002147 -:106EA00038B58378044653B16E21D0F8883323F483 -:106EB0008073C0F88833BDE8384011F031BE04203B -:106EC00012F0A0FB144D014668B1282303702B6813 -:106ED0001B7943702B685B7983702B689B79C37037 -:106EE000204612F065FB2B681A7984F845235B79FC -:106EF0000A4A5343C4F8F43126F0DEF8D4F8F431EA -:106F00006E21C01AD4F88833C4F8F00123F48073DA -:106F10002046C4F88833CEE7B03A0021400D030084 -:106F200070470000024B1B681B7980F8F0337047F4 -:106F3000B03A002190F8F03323B1012B0CD01D2181 -:106F4000FFF798BA084B90F9F22393F940309A4230 -:106F5000F5DA80F8F233F2E7034B90F9F22393F974 -:106F600040309A42EBDDF4E7205000211E21FFF76C -:106F700081BA000010B50446054B187CA37884F84C -:106F80003803012B03D112F06DFFA4F8C80110BD26 -:106F9000283A00211FB50D4B0D4A1B688DF80810CB -:106FA000C31ADB1053432E229BB2ADF80430ADF868 -:106FB0000A3090F8383301A8ADF806208DF80C306F -:106FC00022F066F905B05DF804FB00BFB43A002179 -:106FD000BDCAE28C10B50446022012F013FB014634 -:106FE00048B107230370044B1B7A43702046BDE869 -:106FF000104012F0DDBA10BD283A002138B5044621 -:107000000D4602BBD0F8302302F00403520704D52A -:1070100090F82233003B18BF012394F85224012A30 -:1070200008BF44258BB1032012F0ECFA0146A8B149 -:10703000112303700A4B1B7A857043702046BDE80C -:10704000384012F0B5BA0123E7E7022012F0DAFA6D -:10705000014618B10D2345700370EFE738BD00BF3E -:10706000283A002110B590F819330446FBB90123E2 -:1070700080F81933062012F0C5FA0146E8B10C2356 -:1070800003700E4B1A68127942701A681288827067 -:107090001A681288120AC2701B685A8802715B88CB -:1070A0001B0A43712046BDE8104012F081BA00224D -:1070B000BDE810402421FFF7A1BF10BDDC4D002129 -:1070C00010B583780446012B0AD0BDE81040D0F8F3 -:1070D00088336E2123F48073C0F8883311F020BD0B -:1070E000144A117C01290BD8537C042B08D9927CBB -:1070F000501FC0B2912803D8962B01D8934206D9CD -:107100002046BDE8104001221E21FFF777BF0A4844 -:1071100084F8451343434243C4F8E831C4F8EC21F2 -:1071200019B125F0C9FFC4F8F00125F0C5FFC4F876 -:10713000E40110BD283A0021400D0300C268034657 -:1071400091000CD5D3F8882300F57870D20703D5C9 -:10715000B3F8821224F077B9282124F06BB9704774 -:10716000C3689B0003D500F5787024F072B97047AE -:10717000702111F0D5BC012380F8983270470000CF -:107180000023F0B500F51977044685B080F89832F1 -:10719000384624F0FFF878B9204612F036F9064652 -:1071A00038460DF1070123F055FF054630B9094B6C -:1071B0000421187B23F0DAFF05B0F0BD294602A8B0 -:1071C00016F079FE2B463146204602AA12F052F9FB -:1071D000E6E700BF6850002110B5044600F51B70BB -:1071E00024F0D8F828B12046BDE810403E2111F027 -:1071F00097BC10BD012380F897327047002380F8B8 -:1072000097327047024B1B6803B11847704700BFA5 -:10721000AC3A0021024B1B6803B11847704700BF0E -:10722000983A0021024B1B6803B11847704700BF12 -:107230008C3A0021D0F88823110506D522F400628B -:10724000017CC0F88823FFF7CFB97047B0F89833B6 -:107250002DE9F043A0F8A6330126B0F89A33B0F830 -:107260009473A0F8A83340F2E243B0F89683B0F8E4 -:107270006093044680F8A06390F8B40385B0584347 -:107280005F4303FB08F822F0ABFD114A0346156883 -:107290001048651BED10684303AACDE900923946FA -:1072A0004246C0B222F0F6FD30B97221204611F0FC -:1072B00037FC05B0BDE8F083039B074A84F8C8613A -:1072C000A3FB0232DB0F43EA4203A4F8A433F0E746 -:1072D000B43A0021BDCAE28CE3361A00143023F020 -:1072E00003BC00002DE9F04F87B004460E469046DF -:1072F0001F4611F01BF9054670B90925314628468D -:1073000042463B4609F08BFB0221204613F006FC67 -:10731000284607B0BDE8F08F40F2E242DFF8F8B04F -:10732000DFF8F8C0DBF80000DFF8F4A0281AC0107E -:10733000CDF808C00AFB00F00DF1140CCDF804C024 -:10734000A18BE38BB5F860C35343CDF800C04A432B -:10735000C0B2002122F050FD20B9284611F0E6F914 -:107360000D25CBE7059B2F49DBF80020A3FB01315E -:10737000DB0F43EA4103A4F8623000236370A3707B -:10738000A4F800319DF84030AD1A84F86A309DF8B9 -:107390004430ED1084F86B304FF495630AFB05F52B -:1073A000A4F86050ADB203FB0525FF2385F8A03497 -:1073B0004FF6FF730120A5F8A234C5E9C48785F80C -:1073C000186304F11C0922F049FF42463B46494636 -:1073D0002046009613F026F9054618B1012022F048 -:1073E00053FF8BE742463B4649462046009613F042 -:1073F0009BFA05460028F1D194F86A3003F0FD03AA -:10740000012B01D121F0C4FF074A13790133137115 -:1074100021F0AEFF7CE700BFB43A0021818E01016C -:10742000BDCAE28CE3361A002050002110B5044694 -:10743000012022F029FF94F86A3003F0FD03012BAC -:1074400001D121F0ADFFD4F8D00120B123F0EAFD45 -:107450000023C4F8D031044A1379013B1371BDE80D -:10746000104021F08DBF00BF20500021F8B5044628 -:10747000682023F0CFFD0546002858D04FF49562D0 -:107480000021B4F8603000F1080653433D4A04F18E -:10749000280712681A4491703B4ADB10534303805B -:1074A00043F6017343800FCF0FC60FCF0FC697E887 -:1074B0000F0086E80F0094F86830012B42D1D4E920 -:1074C000886394F82B2294F82A128A4205D1D4E9D1 -:1074D0008670834208BFBE4232D042F002078A4221 -:1074E00005D1D4E986129A4208BFB14247D0D4E907 -:1074F000860185F83C70C5E91263D4E91623C5E915 -:10750000162394F86930C5E9140185F83D3094F8E4 -:107510006C30294685F83E30FF2385F860304FF601 -:10752000FF73A5F86230194B187B23F084FD2046C9 -:10753000FFF77CFF0123227C9340154A5372F8BD6C -:107540001746CCE794F8C32394F8C213D4E9EE634A -:107550008A4205D1D4E9EC70834208BFBE420CD008 -:1075600042F002078A4205D1D4E9EC129A4208BFE0 -:10757000B14204D0D4E9EC01BBE71746F2E70020A2 -:107580000021B6E7B43A0021BDCAE28C6850002160 -:10759000303D00212DE9F74F4FF4856BB0F86EA315 -:1075A000DFF8809206460BFB0A9B9BF82134002BE8 -:1075B00014BF2B20232012F025F80446002800F0E9 -:1075C0002E81B6F804829BF8213408F10708012BBC -:1075D000BBF8FC71DBF8F8511FFA88F810D1DBF822 -:1075E0002434987C43060BD0DBF8E43101372B447C -:1075F0009BF8F952BFB2454340F2E24000FB15351B -:10760000B6F806123046414489B211F04FFCB6F884 -:10761000603383460344019322F0CEFE019B29464A -:1076200003441846019322F0CDFE019B002800F090 -:10763000D2801846294622F0C5FE4FF4856303FB2D -:107640000A93D3F8E421B0FBF2F301339BB202FBBF -:1076500003501F44594622F0B5FE734BBFB2984207 -:1076600000F2CA80714BA0FB0303C3F34F00002359 -:1076700019464FF4856505FB0A9595F821249B036F -:10768000002A14BF2A221C222270B6F86C2343EA77 -:1076900041336270B6F86C230343120A1B12E07088 -:1076A0002371A270D5F8E421614BA2FB0321D20F14 -:1076B00042EA41026271D5F8E421A2FB0323C3F33D -:1076C000D713A37195F8E811D5E9E43242EA4112E3 -:1076D000190AE3712172190C1B0E6172E272A37216 -:1076E0006B6E23736B6E1B0A6373B5F86630A373FE -:1076F00095F86730E373AB6E2374AB6E1B0A63744B -:10770000B5F86A30E7743F0AA3742775B6F80632F5 -:1077100043446375B6F8063298444FEA282884F843 -:107720001680B5F8FC31E375B5F8FC311B0A2376F9 -:1077300095F8DA3395F8D87347EA031711F066FB2A -:107740007FB247EA4017677695F8203404F11B00B2 -:10775000022B03D0032B14BF012304234FF48565B0 -:1077600005FB0A95A376D5E9FA2323F0F7FAB6F8D4 -:10777000063284F82130B6F806321B0A84F822302B -:1077800095F8213403B3D5F8F43284F82330D5F8D2 -:10779000F4321B0A84F82430B5F8F63284F8253028 -:1077A00095F8F73284F8263095F8F83284F82730C7 -:1077B00095F8F93284F8283095F8FA3284F82930AF -:1077C00095F8FB3284F82A302146304603B0BDE8F4 -:1077D000F04F11F0EDBE1946284622F0F3FD4FF4AC -:1077E000856303FB0A93D3F8E421B0FBF2F398B26C -:1077F00002FB1050FF1A2DE7B0F5161F0D4A28BFE7 -:10780000A0F51610A0FB02124FF0030101FB0020AF -:107810002CBF012300230121C0F38F2029E703B0EF -:10782000BDE8F08FD01D0021C3BF0300121111115C -:10783000E3361A009E36D0692DE9F84F064690F8D7 -:107840006E030AF04BFF90F8DD3B0546002B14BF9A -:107850002B20232011F0D6FE0446002800F03481AE -:10786000B6F8048295F8DD3B08F10708012BB5F85E -:1078700090A1D5F89C711FFA88F80ED195F8B7330E -:1078800059060AD0D5F850030AF1010A3844D5F850 -:10789000B0731FFA8AFA07FB1307B6F806123046D0 -:1078A000414489B211F002FBB6F860B381468344CB -:1078B00022F082FD83443946584622F083FD002899 -:1078C00000F0DF803946584622F07CFDD5F8502381 -:1078D000B0FBF2F301339BB202FB03700AEB030728 -:1078E000494622F06FFD794BBFB2984200F2D78033 -:1078F000774BA0FB0303C3F34F000023194695F811 -:10790000DD2B9B03002A14BF2A221C222270B6F80A -:107910006C2343EA41336270B6F86C230343120AC6 -:107920001B122371A270E070D5F85023694BA2FBA3 -:107930000321D20F42EA41026271D5F85023A2FB23 -:107940000323C3F3D713A371D5E9DA9A11F05EFAD2 -:107950004FEA192384F8079023724AEA401A4FEA43 -:1079600019434FEA1969637284F80A9084F80BA0EE -:10797000D5F8CC312373D5F8CC311B0A6373B5F835 -:10798000CE31A37395F8CF31E373D5F8D03123749A -:10799000D5F8D0311B0A6374B5F8D231E7743F0AC9 -:1079A000A3742775B6F8063243446375B6F80632F9 -:1079B00098444FEA282884F81680B5F89031E3758A -:1079C000B5F890311B0A237695F83930DA0702D5DD -:1079D0002F79012F09D0022B74D16F693F0A07F06C -:1079E000C007A7F140035F425F4195F9428011F063 -:1079F0000DFA400140EA071748EA0707677695F84D -:107A0000D43104F11B00022B03D0032B14BF01233C -:107A10000423A376D5E9042323F0A0F9B6F80632AF -:107A200084F82130B6F806321B0A84F8223095F823 -:107A3000DD3B03B3D5F8A83384F82330D5F8A83359 -:107A40001B0A84F82430B5F8AA3384F8253095F859 -:107A5000AB3384F8263095F8AC3384F8273095F8AA -:107A6000AD3384F8283095F8B43384F8293095F88C -:107A7000B53384F82A3021463046BDE8F84F11F07E -:107A800097BD3846594622F09DFCD5F85023B0FBEF -:107A9000F2F398B202FB1070AAEB030720E7B0F5EF -:107AA000161F0D4A28BFA0F51610A0FB02124FF0BA -:107AB000030101FB00202CBF012300230121C0F39F -:107AC0008F201CE7002790E7BDE8F88FC3BF0300B5 -:107AD00012111111E3361A009E36D069054B1B684E -:107AE0009A8880F86A231A89DB88A0F86C23A0F8AA -:107AF0006E337047B03A002190F869235AB90122D9 -:107B000080F86923D0F888236E2122F04002C0F863 -:107B1000882311F005B8704770B5534C0546D4E979 -:107B20000C2394F8291094F8280009F015FE002879 -:107B300040F0998095F87033002B00F08D804B4B0E -:107B40009A6AD0054CBF03230123110594F82B201A -:107B500048BF43F0040332EA03037DD1531E012BD7 -:107B600001D9042A78D194F840308BB10F2B73D807 -:107B700094F8411005296FD994F84220531EDBB2C6 -:107B8000FD2B69D8914267D994F84330012B63D912 -:107B9000402023F03FFA0146002857D04FF4867367 -:107BA0004380238A821D8380314B03F1100053F8F8 -:107BB000046B834242F8046BF9D11B8813802D4B70 -:107BC0002D4A1B68EB1ADB1053430B83A38C4B83AA -:107BD000B5F806328B83E38CCB8394F8283081F898 -:107BE000203094F8293081F8213094F82A3081F837 -:107BF000223094F82B30022B03D0042B14BF012326 -:107C0000032381F82330D4E90C23C1E90A23238F0D -:107C10000B86E36B4B6394F8403081F8383094F86E -:107C2000413081F8393094F8423081F83A3094F894 -:107C3000433081F83B30237AA3F12A025342534167 -:107C400081F832300D4B187B23F0F5F92846BDE85A -:107C500070406E2110F064BF237A2A2BF6D128469B -:107C6000FFF7B8F9F2E770BD283A00212050002153 -:107C70003A3A0021B43A0021BDCAE28C6850002192 -:107C800090F80A3363B190F80933B0F80823012B58 -:107C900014BF002300F20623A0F8A620C0F8A830E5 -:107CA000002380F80A33012380F8A43070470023B2 -:107CB00080F8A430704790F80A3363B190F8093324 -:107CC000B0F80823012B14BF002300F20623A0F80C -:107CD000A620C0F8A830002380F80A33012380F8DA -:107CE000A5307047002380F8A530704710B50446D2 -:107CF000114B03F1100203CA1A8BC4F8C102A4F895 -:107D0000CA22D3F81A20C4F8C512C4F8A922D3F89D -:107D10001E20D3F8223004F2BD200421C4F8AD2285 -:107D2000C4F8B93225F0E8F804F2B1200821BDE822 -:107D3000104025F0E1B800BF283A0021064B00F2C0 -:107D400099201B681A1D143352F8041B9A4240F8FC -:107D5000041BF9D1704700BFB03A00210623037419 -:107D60007047000070B5044600F18C0500F2A922AE -:107D7000294600F2992025F003F8D4F8B932A27808 -:107D8000C4F89C30D4F8BD32B2FA82F2C4F8A03004 -:107D900000230020002184F8B5300B4B52091B68EA -:107DA000C4E9B401C4E9B60184F8B42053B1074969 -:107DB00028460968611A064CC9106143BDE8704045 -:107DC000C9B2184770BD00BF743A0021B43A00210F -:107DD000BDCAE28C482110F0A3BE10B504460D20A8 -:107DE00011F010FC014698B10346042203F8012B60 -:107DF000D4F8B122C0F80120D4F8B5225A60D4F8E2 -:107E0000BD32C0F809302046BDE8104011F0D0BBAB -:107E100010BD10B50446012011F0F4FB014630B14D -:107E2000052303702046BDE8104011F0C1BB10BD12 -:107E300010B50446012011F0E5FB014630B10623E0 -:107E400003702046BDE8104011F0B2BB10BD10B564 -:107E50000446012011F0D6FB014630B10A2303701D -:107E60002046BDE8104011F0A3BB10BD10B504467C -:107E7000012011F0C7FB014630B10B2303702046EF -:107E8000BDE8104011F094BB10BD10B504460120B0 -:107E900011F0B8FB014630B1122303702046BDE853 -:107EA000104011F085BB10BD10B50446012011F043 -:107EB000A9FB014630B1132303702046BDE81040F2 -:107EC00011F076BB10BD00001FB5104B104A1B68A7 -:107ED000C31ADB1053430D229BB2ADF80030ADF84E -:107EE0000430B0F8CA32ADF80220ADF80E30D0F848 -:107EF000C132CDF80630D0F8C5326846CDF80A3028 -:107F000021F0C6F905B05DF804FB00BFB43A0021CA -:107F1000BDCAE28C1FB5104B104A1B688DF80710C4 -:107F2000C31ADB1053430022CDF809208DF80D2031 -:107F30000B229BB2ADF80430ADF80A3090F8A530B2 -:107F400001A88DF806208DF808108DF80C3021F06E -:107F50009FF905B05DF804FBB43A0021BDCAE28C7C -:107F600007B50C22ADF802200022094B8DF8042041 -:107F70001B68C31A0748DB10434368469BB2ADF841 -:107F80000030ADF8063021F083F903B05DF804FB52 -:107F9000B43A0021BDCAE28C07B51122094BADF8F5 -:107FA00002201B68C31A0848DB10434368469BB293 -:107FB000ADF80030ADF8043021F06AF903B05DF897 -:107FC00004FB00BFB43A0021BDCAE28CD0F8F41221 -:107FD00000F53E7023F037BA38B5124B04461B68E3 -:107FE00000F2992103F10E0203F11E0052F8045B26 -:107FF000824241F8045BF9D15A6804F2B920C4F80E -:10800000C1229A680421C4F8C5229B89A4F8CA3207 -:1080100024F072FF04F2A9200821BDE8384024F0C2 -:108020006BBF00BFB03A0021034610B5054C04F108 -:10803000100203CAA269C3F8B102C3F8B512C3F8AB -:10804000BD2210BD283A002110B50446172011F0BA -:10805000D9FA014610B30346032203F8012BD4F8E2 -:10806000C122C0F80120D4F8C5225A60B4F8CA323F -:108070004372B4F8CA321B0A8372D4F8A932C0F82A -:108080000B30D4F8AD32C0F80F30D4F8B932C0F8A4 -:1080900013302046BDE8104011F08ABA10BD000030 -:1080A0002DE9F041464B86B01C6810F03FFA0546BA -:1080B000A8B9D4E90623092094F8201008F0AFFCF1 -:1080C000042022F0A7FF014630B140F20333438081 -:1080D0003C4B187B22F0AFFF06B0BDE8F08140F2C8 -:1080E000E242DFF8E480394ED8F80000384F281A11 -:1080F000C010A188E3887843029605AE0196B5F8D2 -:108100006063534300964A43C0B2002121F074FEDD -:1081100040B9284610F00AFBD4E906230D2094F854 -:108120002010CBE7D8F800302A4EEB1ADB107B4347 -:10813000D4E904010127A6F88030274A059BDFF81F -:108140009C80A3FB0232DB0F43EA4203A6F8823095 -:1081500006F13C0383E80300012022F07FF821F0C0 -:1081600007F996F8423088F8047003F0FD03BB422B -:1081700001D121F00DF986F85872A6F85672D4E9AB -:10818000062394F82010201D12F024F9002228461E -:10819000134911F039FCD4E90623C5E9C42394F846 -:1081A000203085F81833FF2385F8A0344FF6FF738D -:1081B000A5F8A23412F0ECF988F805708CE700BF3E -:1081C000540D002168500021B43A0021818E010134 -:1081D000BDCAE28CD03A0021E3361A0020500021BB -:1081E000183B0021054B1B7933B10123044880F86B -:1081F00099309C3022F04CBC704700BF20500021C9 -:10820000D03A0021F8B53C4B1B79002B70D0682088 -:1082100022F000FF0546002862D04FF4956200214D -:10822000364C00F10806B4F8803004F14807534397 -:10823000334A12681A449170324ADB105343038068 -:1082400043F6017343800FCF0FC60FCF0FC697E8D9 -:108250000F0086E80F0094F8C33185F83C3094F89D -:10826000C2219A4207D1D4E96E61D4E96C029142ED -:1082700008BF864203D043F0020385F83C30D4E9BE -:108280006E23C5E9122300220023C5E9142394F8C4 -:10829000C32194F8C2319A4207D1D4E96E02D4E9DD -:1082A0006C139A4208BF884203D0D4E96C23C5E915 -:1082B0001423D4E91E23C5E9162394F885302946F2 -:1082C00085F83D30012385F83E30FF2385F8603086 -:1082D0004FF6FF73A5F862300B4B187B22F0ABFE14 -:1082E000012021F0D1FFBDE8F8400448FBF7F4BDC0 -:1082F000BDE8F840FFF776BF20500021D03A0021BA -:10830000B43A0021BDCAE28C6850002113B54FF485 -:108310009560124C124BB4F880201B684D2100FB75 -:10832000023010F0FDFB012021F0AEFF2046FBF7EC -:10833000D3FD00230093ADF80430082368468DF880 -:10834000023020F0A5FFD4E95823D4F854110220BC -:10835000C1F3C00108F063FB02B010BDD03A0021A8 -:10836000B43A00214FF4956010B5094B094C1B68D5 -:10837000B4F880204C2100FB023010F0D1FB01202A -:1083800021F082FF2046BDE81040FBF7A5BD00BFED -:10839000B43A0021D03A0021044B0C201968D1E9ED -:1083A000062391F8201008F03ABB00BF540D0021BD -:1083B000002307B5ADF8003040F60843ADF80230B1 -:1083C0000C236846ADF8043020F062FF03B05DF87E -:1083D00004FB0123837090F800311BB900F5827013 -:1083E00022F056BB00F52E70FAE70000F7B50646FE -:1083F00000241A4D1A4FAB7A2341DA0713D56B7A52 -:108400002341DB070FD44FF49562164B53F8243009 -:10841000B3F8603053433A68D018D35C012B02D1D3 -:108420004D2110F07DFB0134032CE4D13046FEF7E2 -:10843000FDFF3378032B0FD000230093ADF80430F9 -:10844000082368468DF8023020F022FFD5E900238A -:108450000220297A08F0E3FA03B0F0BD303D002194 -:10846000B43A002190250301044B0C201968D1E98E -:10847000062391F8201008F0D2BA00BF540D002155 -:10848000002307B5ADF8003040F60843ADF80230E0 -:108490000C236846ADF8043020F0FAFE03B05DF816 -:1084A00004FB0000074B1B681A7980F862235A7995 -:1084B00080F863239A7980F864231B8980F8573009 -:1084C000704700BFB03A0021024B1B8AA0F8D83396 -:1084D000704700BF283A002170B51D4C054694F93D -:1084E0001030267C002B04DB94F91130627C002BC9 -:1084F00002DA4A21284602E0238A23B96E21BDE828 -:10850000704010F00DBBB0F80612638A5B1A47F694 -:10851000FE719BB28B4201D94921F0E7022E04D9AA -:10852000042EE6D1022A02D804E0022A01D9042A44 -:10853000DFD11EB108F0F8F80642DAD0667C1EB131 -:1085400008F0F2F80642D4D02069C5F8DA0370BD0D -:10855000283A002170B580F8D81380F8D923044652 -:1085600003200E46154611F04DF8014640B1162382 -:108570004670037085702046BDE8704011F018B851 -:1085800070BD70B5044603200E46154611F03AF84A -:10859000014640B117234670037085702046BDE840 -:1085A000704011F005B870BD2DE9F0470446052074 -:1085B0000F46164611F026F80546002853D004F55C -:1085C0001B7A504684F8DA7384F8DB6322F0D3FE1A -:1085D000DFF89890D9F80030B3F8268000FB08F84F -:1085E000204610F012FF0146404620F04CFE0628BF -:1085F00030D9504622F0BFFED9F80030B3F82680BB -:1086000000FB08F8204610F000FF0146404620F02D -:108610003AFEB4F8043257EA06021844B4F85E345D -:1086200000FB03F39BB217D0B4F806221344A4F85E -:10863000DC3318236F702B70AE70B4F8DC3329462E -:10864000EB70B4F8DC3320461B0A2B71BDE8F04711 -:1086500010F0AEBF0720DCE76E212046A4F8DC2333 -:1086600010F05EFAE5E7BDE8F08700BFDC4D0021C1 -:108670001FB50F4B0F4A1B688DF80710C31ADB108C -:10868000534300228DF8092016229BB2ADF8043026 -:10869000ADF80A30B0F8543001A88DF806208DF8F6 -:1086A0000810ADF80C3020F0F3FD05B05DF804FBC8 -:1086B000B43A0021BDCAE28CF8B5446A0546B4F864 -:1086C00098209AB1042022F0A5FC014600284ED043 -:1086D000304B9C420CBF40F2023340F203334380E4 -:1086E0002D4B187BBDE8F84022F0A5BC2B4E337C07 -:1086F0007BB194F84130D9070BD59B07327404D471 -:10870000D6E90823A01C22F029FBD6E90823C4E9F6 -:108710005623A36BE28FAB60A38F934213D040F23A -:1087200071235A43D4F8A811EB680B4493420AD240 -:10873000284622F09BF830B1A16BA86821F042FED8 -:10874000C4F8A80113E0002394F89B1194F8D10019 -:10875000C4F8A83108F054F9A68FE28F84F8D1004C -:10876000964205D1284621F067FFAB68A363F8BDA8 -:1087700040F271277E4307FB0267AB683A463344F9 -:1087800031462846A36322F071F80028D4D1A36BA8 -:10879000AB60F2E7580D0021685000212050002105 -:1087A0007FB5C46AD4F89C00002846D094F8F03015 -:1087B0000BB1062B45D194F8F40000283DD0D4E944 -:1087C0003823224822F0CAFA214D94F8F23085F875 -:1087D0005332D4E93823C5E9242395F841309A0768 -:1087E00017D5D4E92223CDE9022302ABD4F8846063 -:1087F00094F8F3000093D4E93A23FAF7B4FFF0B900 -:10880000C6F340061348DDE9022322F0A7FA85F8F3 -:1088100052621149A1F5147014F01AFB0F4BDB6979 -:108820005B0110D595F8583213B1013B85F85832E9 -:1088300095F85802B0FA80F0400904B070BD0126E6 -:10884000E0E70020F9E70120F7E700BF600D002115 -:10885000580D00215A0D0021A80F002120500021A1 -:1088600070B5C46A94F8F030022B01D9062B53D1AD -:108870002E4B2F4A1B68527A9B7B9A424CD294F81B -:10888000CA0022F0C7FB0546002845D0D4F898302E -:1088900094F8CC2083F8272094F8F32094F8F23051 -:1088A0009A423AD1D4E93A31D4E93802914208BF28 -:1088B000834214BF01230023D4F898201D4E82F870 -:1088C0002830D4F89830D4F8D02083F82920D4F870 -:1088D000D030D4F898201B0A82F82A30D4F8983087 -:1088E000B4F8D22083F82B2094F8D320D4F8983011 -:1088F00083F82C2094F8F510D4F8982079B1002151 -:108900000D4822F092FB4FF48071307B22F02EFC58 -:1089100008F0BEF9C4F8985070BD0123CCE70748B1 -:1089200022F083FB4FF40071EFE700BFDC4D002124 -:10893000F850002168500021800D0021880D002191 -:10894000C36AD3F8A000003818BF012070470000A8 -:1089500070B54D4D00297DD0C46A94F8F030042BD9 -:1089600058D1D5E92402D4E938139A4208BF884285 -:1089700050D1464B464A1B68527A9B7B9A4249D259 -:108980002D2022F047FB0646002843D0D4F8A03023 -:1089900094F8CC2083F827200023D4E93A1294F8E5 -:1089A000F2009A4208BF814207D0D4E938309042A1 -:1089B00008BF8B4214BF01230023D4F8A02000215C -:1089C00082F82830D4F89830D4F8D020314883F891 -:1089D0002920D4F8D030D4F898201B0A82F82A3005 -:1089E000D4F89830B4F8D22083F82B20D4F89830FB -:1089F00094F8D32083F82C20D4F8A02022F015FB83 -:108A0000254B4FF48071187B22F0B0FB08F040F941 -:108A1000C4F8A06095F859320133DBB2012B85F818 -:108A2000593209D9B5F856325B0808BF0123A5F8B9 -:108A30005632002385F85932002385F85A3220F047 -:108A4000F4FBB5F85632013B03400133002085F8B2 -:108A5000583270BD95F85A320133DBB2012B85F8DC -:108A60005A320DD9B5F856325B009BB2B3F5807F10 -:108A700088BF4FF48073A5F85632002385F85A3228 -:108A8000002385F85932DAE7580D0021DC4D00212A -:108A9000F8500021800D002168500021C37CF0B502 -:108AA0001370847C9C4207D1D0E90275D0E9006440 -:108AB000A54208BFB74202D043F002031370D0E9C9 -:108AC0000223C1E90023F0BD90F86A3010B50133EC -:108AD000DBB2012B044680F86A300DD9B0F866305D -:108AE0005B009BB2B3F5807F88BF4FF48073A0F822 -:108AF0006630002380F86A30002384F8693020F063 -:108B000094FBB4F86630013B0340013384F86830CD -:108B100010BD00002DE9F84F044690F80EA4D0F8DF -:108B200010344C4FDFF83081DFF83091BAF1000F8C -:108B300001D1BDE8F88F1D465A7815F8026B2C2A32 -:108B40001BD0322A7BD0282A11D194F8203284F805 -:108B5000226284F8212253B96378012B07D1294678 -:108B600084F8203204F5087014F0A0F80544F643A8 -:108B700056442B465FFA86FAD8E794F88832002BE1 -:108B8000F5D16378012BF2D13246294604F52270E3 -:108B900014F0A8F8BB690544180294F8963248BF4F -:108BA000022203F1FF3358BF04221E2B43D8D4F80E -:108BB000B032A3F5807343453DD8B4F89432934264 -:108BC00039D3B3F5486F36D894F89732013B1E2B52 -:108BD00031D8B4F8B432B3F5805F2CD2B4F8AA32ED -:108BE000013B9BB2FA2B26D894F8C032032B22D833 -:108BF000D9F82020D10501D4022B1CD0120501D4B4 -:108C0000032B18D094F8D032012B14D894F8983252 -:108C1000013B062B0FD894F8A832013B0E2B0AD843 -:108C200094F8A0320F2B06D842F6014384F88A62EA -:108C3000A4F888329BE7002384F8883297E7084B32 -:108C4000D3F800B0BBF1000F91D02B46314620463F -:108C5000D8478CE720500021FFFE0F00685000210C -:108C6000D8070021F8B583780446002B0CBF1E23DB -:108C70004FF4967385880F465D43164621F090FBAE -:108C80006378012BA3780CBF32214FF4FA71002BCB -:108C90000CBF1E234FF496730144581907F084FC4F -:108CA0002D1A3D60A378002B0CBF1E234FF4967342 -:108CB00003EB40003060F8BD2DE9F0414368057CCE -:108CC0000446022DC0F80C31D0F8307118BF0025D1 -:108CD00000F5827621F070FBE37800F2CC4007F1DA -:108CE0009808C4F81001DBB90323294A117801352B -:108CF000EDB2032D08BF002541FA05F0C0071FD5CE -:108D0000244B557053F82540D4F8307104F5827621 -:108D100007F1980898F83310787807F071FE7870AA -:108D2000002120896389C8F8401083420DD1304664 -:108D300021F082FCB36863600023E370BDE8F0813A -:108D4000013B13F0FF03D2D1E4E7114FBA782A4177 -:108D5000D3070AD4304621F06FFCB3686360012367 -:108D6000AB40BD781D43BD70E6E740F27122B368A9 -:108D700002FB00334FF00042B3603046636021F0E5 -:108D800075FDB36862689B1AC8F84030D4E700BF2D -:108D9000B80F00214C250301084BDB695B010BD5A3 -:108DA00090F8683013B1013B80F8683090F86800A3 -:108DB000B0FA80F040097047012070472050002130 -:108DC0002DE9F3411E46DDE908451B0A03F0C00307 -:108DD000402B0746904626D1DDE90A23CDE9002342 -:108DE0009DF830204046314602F0FD02FAF756FD6C -:108DF00090B17B7B03F0FD03012B07D103232B7084 -:108E00000B4BD3E90823C4E9002309E002232B70AC -:108E1000084BD3E90C23F6E7FE232B70C4E9008648 -:108E200002B0BDE8F081437B012BE8D00023EEE7E0 -:108E300020500021685000212DE9F04F0D4690F898 -:108E40003C108DB08346DDE9166792469DF8609030 -:108E50001B9C21B1002108460DB0BDE8F08F2422F3 -:108E60002046079128F0B9FA9DF96430A580637413 -:108E7000FF23E3737F232374724B0799DB6A03F4A8 -:108E800000789BF81030002B65D0022B66D09AF842 -:108E90000030DA1F012A73D89BF8A230DB0768D5AF -:108EA00032463B4684F80690E01D079121F056FFBC -:108EB0000799DBF89C30A08823620023A3839BF8EA -:108EC000A1309BF8A22003F003030343500000F0FD -:108ED00004000343A3809BF8DC30B8F1000F01D0FD -:108EE0009BF8A213012B47D0022B47D101290CBFBD -:108EF00004230323A373150744BF9BF8BC30E3731B -:108F0000500644BF9BF8BD302374910644BFBBF8A4 -:108F1000E4306382930702D49BF86934CBB10DF13E -:108F2000270301930AAB58460093CDE90267DBE9BA -:108F30002C23CDF81090FFF743FFDDE90A2304F15D -:108F4000150021F00BFF9DF82730237500238BF8C7 -:108F5000693401217FE70123637398E7B8F1000FBB -:108F600003D09BF80532012B01D00323F4E704233F -:108F7000F2E7FF23A3719CE70223BBE70123B9E7D4 -:108F80009AF804A0AAF1060A5FFA8AFABAF11F0F4A -:108F90003FF660AF1A9A02F1080845F01002A2806D -:108FA000062B3FF658AF01A252F823F0C98F0001FB -:108FB000D18F00010F900001578E00012D9000010C -:108FC000578E00012790000145F01305A5801EE093 -:108FD00045F015054046A58021F0BAFE4FF0000A85 -:108FE0000B460DF1270101910AA90246009158464E -:108FF000CDE90267CDF81090FFF7E2FEDDE90A2324 -:1090000004F1150021F0AAFE9DF8273023753246A1 -:109010003B4684F80690E01D21F0A0FEC4F82080B5 -:10902000A4F81CA095E745F01205CFE7064B45F0E4 -:1090300012051B78002B08BF45F0010545F0080517 -:10904000C4E700BF20500021880700212DE9F0412E -:1090500005780646012D0C46174686B01CD1C81D62 -:1090600091F8068021F074FE0B46B6F8BA1002465D -:109070000291E17B04A8019121790091414607F01A -:109080000CFDDDE90423054807F021FD20B93D7002 -:10909000284606B0BDE8F0810025F9E75814002104 -:1090A000F0B513780646012B0C46154687B023D140 -:1090B0008B885B0615D4C81D8F7921F049FE0B46BD -:1090C000B6F8BA1002460291E17B04A80191217919 -:1090D0000091394607F0E1FCDDE90423074807F079 -:1090E00053FD02234FF480712B70054B187B07B0A2 -:1090F000BDE8F04022F03AB807B0F0BD58140021A6 -:109100006850002190F82430012B05D090F82134CC -:109110005BB1437EFF2B08D1022380F82430034B40 -:109120004FF48071187B22F021B8704768500021FD -:1091300090F8693010B50133DBB2012B044680F89A -:10914000693009D9B0F866305B0808BF0123A0F880 -:109150006630002380F86930002384F86A3020F0FC -:1091600064F8B4F86630013B0340013384F868309A -:1091700010BDF8B5446A054694F868641746012E98 -:1091800002D000263046F8BD002384F86834D4E9C4 -:10919000B003184421F016F9B842F2D2EB6A04F594 -:1091A0002E70C3F8B80004F53A71F8F7B7F9E9E79B -:1091B0002DE9F0474FF0000892B0446AC66A0746AE -:1091C00008A8894613F0D0FE9DF82030BF4D072B2C -:1091D00085F8018004F1A00040F03F8184F8A2806E -:1091E00009F102020DF11E0113F0ACFC94F8A1305C -:1091F00073BB9DF81E10CB0601F0010000F1BC808E -:1092000020B901236B7012B0BDE8F0879DF82030C3 -:10921000F96A8DF8403094F8A23080318DF84130F1 -:10922000D4E92A23CDE90C239DF822300CA88DF82F -:109230004230D4E92C23CDE90E239DF823300122BE -:109240008DF8433006F1E003F9F7AEFF0028D8D0DF -:109250000123DFF87CA29F4D8AF800302B78012B88 -:1092600059D19DF81E3003F00903092B53D1002278 -:109270000023CDE90A239DF8203006F1E0088DF89F -:10928000403094F8A2308DF81F208DF841309DF8C1 -:109290002230D4E92A018DF84230CDE90C01D4E91D -:1092A0002C019DF82330CDE90E01F96A8DF8433089 -:1092B000803143460CA8F9F777FF40460DF11F02B5 -:1092C0000AA9FFF7EBFB2B7A012B94F8BC307AD17B -:1092D0009DF81F00009300F00100DDE90A23FAF772 -:1092E00083F800288FD00023296A8AF80030DDE94E -:1092F0000A23C1E9F8239DF81F3081F8D93394F887 -:10930000BC3081F8D833D4E92A23C1E9FA239DF887 -:10931000223081F8DA339DF81E8018F0100868D0EA -:109320000023FB6004F1D6073846D4F8C41013F0CC -:1093300063FC96F8F12096F8CD100232707BD6F8D7 -:10934000D48020F088FA394608EB0003D6F8D42000 -:10935000204608F065F894F80031002B40F0B28008 -:109360002B78012B7FF44FAF9AF80020002A7FF46E -:109370004AAF8AF8003046E7C8B1012385F82830A3 -:10938000D4E92A23C5E906239DF8223085F829303F -:1093900011F0020111D0012385F82A30D4E92C23E1 -:1093A000C5E908239DF8233085F82B3050E70022CB -:1093B00000232885C5E90623EAE700220023698502 -:1093C000C5E9082344E76A7A9A427FF41CAF9DF806 -:1093D0001F30AA7A03F001039A427FF414AFD5E953 -:1093E0000402DDE90A139A4208BF88427FF40BAFFA -:1093F00079E7002300220CA9CDE90C2306F1E00057 -:109400000AAA04F118058DF82880FFF747FBCDE97B -:10941000049596F9CC30414603939DF828302046B8 -:109420000293DDE90C23CDE9002308AAFFF704FD30 -:1094300000283FF4E8AE04F13C06324629462046B7 -:1094400084F82680FFF702FE00283FF4DCAE3246A7 -:1094500029462046FFF724FED5E600230022414698 -:10946000CDE90C2330228DF8288004F1180727F06D -:10947000B4FF0AAA0CA906F1E000FFF70FFBCDE943 -:10948000049796F9CC30414603939DF82830204646 -:109490000293DDE90C23CDE9002308AAFFF7CCFCF9 -:1094A00000283FF4B0AE04F13C052A463946204678 -:1094B00084F82680FFF7CAFD00283FF4A4AE2A46B0 -:1094C0003946C6E720F046FF9DE600BF8807002129 -:1094D000B8070021C03600212DE9F041814C456AD2 -:1094E000C66A88B0074604F10C00884613F03CFDBC -:1094F00004F10A0108EB000205F1A00013F022FBC1 -:109500000123227BE072072A63727FD195F8A120A4 -:1095100095F8A210002A5BD194F828205AB9A27AB3 -:10952000D20708D584F82830D5E92A23C4E90623D0 -:10953000A37B84F8293094F82A3063B9A37A9B0777 -:1095400009D5012384F82A30D5E92C23C4E908235E -:10955000E37B84F82B3094F82830012BD4E90623E0 -:10956000C5E92A2394F8293008BF41F00101A3730B -:1095700094F82A3008BF85F8A210012B02BF95F895 -:10958000A23043F0020385F8A230D4E90823C5E9EC -:109590002C2394F82B30E37307238DF8183095F8BB -:1095A000A230F96A8DF81930D5E92A23CDE90223D2 -:1095B000D5E92C23CDE90423E3890022ADF81A3044 -:1095C000803106F1C80302A8F9F7EEFD50B10BE0B7 -:1095D000A37A21F0340123F03402D807A27285F86F -:1095E000A210D9D4012363706378012B01D1002725 -:1095F0005FE095F8A17017F0020749D0D6F898708F -:10960000002F45D096F8DC3013B901236370EEE7E4 -:1096100095F8A230D907F8D52846FFF7BDFB0128F9 -:10962000074635D1D6E9322305F1800021F096FBBB -:1096300096F8DA3085F8D330D6E93223C5E91C2311 -:109640006B7B9A071ED595F8A2309B0735D5D5E9D7 -:109650002C23CDE902231B0A03F0C003402B94F80E -:109660000F8007D102AB96F8DB000093D6E93423D4 -:10967000FAF788F8DDE9022305F17A0021F06EFBA4 -:1096800085F8D28005F1D00105F1780013F0E0FBF8 -:1096900095F8A13084F82C300023E38595F8A230AA -:1096A0005B0003F00403A5F8443096F9B93085F85F -:1096B0005130384608B0BDE8F081D6E92223D6F80B -:1096C0008480CDE9022302AB96F8DB000093D6E953 -:1096D0003423FAF748F810B9C8F34008CAE7B84687 -:1096E000C8E700BF880700212DE9F0478F4F86B0FB -:1096F0003B7B072B40F0138100220023CDE904239C -:109700000023C66A8A4D446A0DF10F0204A906F1CE -:10971000C8008DF80F30FFF7C1F995F80090B9F146 -:10972000010F00F08A804FF0000994F8A2309A06E9 -:1097300005D5D4F8C81004F1E00013F073FA95F8D9 -:109740000080B8F1010F40F0C380DFF8E8A19AF87B -:109750000030002B40F0BC8094F8A2309B0640F112 -:10976000B7806B78002B40F0B3802D6A04F1A00E17 -:1097700005F57C7CBEE80F00ACE80F00BEE80F00EA -:10978000ACE80F009EE80F008CE80F002846FFF7BA -:10979000C1F940F2E242B4F8FC30A5F8E031A5F896 -:1097A000FE31B4F8E4305343C5F8E43194F8F020C6 -:1097B00085F8E82194F8DC20012A00F08C80022A48 -:1097C00008BF4FF00308B5F86823B9F1010F02FB99 -:1097D00003F385F82084C5F8EC3112D1DDE90423C8 -:1097E000C5E9F8239DF80F3085F8D93394F8BC30DB -:1097F00085F8D833D4E92A23C5E9FA23BB7B85F859 -:10980000DA3396F8B02096F8BA10707BD6F8C070AC -:1098100020F021F895F821343844002B5ED10090D7 -:10982000D6F8C030204604F1E00204F1D60108F079 -:109830003FF800238AF801304AE0DFF8F88098F812 -:109840000030002B6ED16A7A94F8BC309A420FD166 -:109850009DF80F30AA7A03F001039A4208D1D5E9A6 -:109860000402DDE904139A4208BF88423FF45BAF6B -:10987000012388F80030BB7A19077FF554AF13F045 -:10988000210F3FF450AF2A7A94F8BC30012A0DD151 -:109890009DF80F00009300F00100DDE90423F9F7C3 -:1098A000A3FDA8B1002388F800303EE76A7A9A4207 -:1098B0000ED19DF80F30AA7A03F001039A4207D126 -:1098C000D5E90402DDE904139A4208BF8842E9D0D1 -:1098D00006B0BDE8F0874FF0020874E70022164B8F -:1098E0001B68EB64154B1B682B65154B1B68C5F893 -:1098F0000831D5F824341A61124B1F6847B1009023 -:10990000D6F8C030204604F1E00204F1D601B84791 -:109910000D4B1B68002B8CD02846984789E7012304 -:109920007B70D5E7012B7FF4FEAEA4E7880700210A -:10993000C0360021B8070021CC070021C407002150 -:10994000C0070021C8070021D00700212DE9F04100 -:1099500006460F46446A86B031B92046FFF7B4F890 -:10996000002006B0BDE8F081344DD0F82C802046B0 -:10997000FFF7DEFB394605F10C0013F0F5FA05F1AF -:109980000A013A1804F1A00013F0DCF8012194F860 -:109990006934E8726972FBB994F8A1305BB194F84C -:1099A000A230AA7A23F0260322F02602AA7284F8B3 -:1099B000A23084F8691494F8A23003F00702072A51 -:1099C0000AD123F0260384F8A2300123AA7A84F86E -:1099D000693422F02602AA722B7BF16A8DF81030CE -:1099E00094F8A23068468DF81130D4E92A23CDE9E5 -:1099F0000023D4E92C23CDE90223EB890022ADF822 -:109A00001230803108F1C803F9F7CEFB10B90123F9 -:109A10006B70A5E794F8A1309B07F8D1D4E91C023C -:109A2000D8E932139A4208BF8842F0D1B4F84430E2 -:109A300003F0170343F00803EB8591E78807002143 -:109A4000F0B5374C0D4694F801C085B0BCF1000F5D -:109A500002D0002005B0F0BD0029FAD0637AC76AB1 -:109A6000012B466A3FD1E27A237C0232154496F8F4 -:109A7000A020013B9B1A6560237284F809C0237BF8 -:109A8000072BE6D1002396F869240193A37A002AD4 -:109A90003ED196F8A12042B123F03403A37296F888 -:109AA000A23023F0340386F8A230A37ADA0618D560 -:109AB000D6F8C41002A813F09FF89DF80E30022BC0 -:109AC000C7D806F031FE9DF80E301841C307C0D547 -:109AD0009DF8083007F1B4027B7001A902A8FFF7D6 -:109AE000C1F80198B6E704F10C0013F03DFA054403 -:109AF0002A4604F10A0106F1A00013F023F8237CA2 -:109B000096F8A020013B05449B1A65602372B6E7D6 -:109B100023F02603A37296F8A23023F02603C2E7AF -:109B2000880700212DE9F043554E8BB07578002D44 -:109B300040F0A380446A94F83C7061B9012F04D1CD -:109B4000A38B43F04003A38339E084F86450284694 -:109B50000BB0BDE8F083022FF9D0D0F82C80002F95 -:109B600069D196F82C30002284F8A130002308A98E -:109B7000CDE9082308F1C8000DF11F028DF81F7010 -:109B8000FEF78CFF94F8A1309A0736D504F140090E -:109B9000B4F84410CDE9047994F951302046039388 -:109BA0009DF81F300293DDE90823CDE9002306F17B -:109BB0000C02FFF741F950B984F8640000252046F3 -:109BC00004F13C0204F11801FFF76AFABFE7B4F8A8 -:109BD000443004F1640723F008033A46494620461E -:109BE000A4F84430A4F85C502566FFF72FFA20B1A2 -:109BF0003A4649462046FFF753FA002304F1180776 -:109C00000597049398F9B930204603939DF81F30C7 -:109C1000F18D0293DDE90823CDE90023194AFFF70E -:109C20000BF90028CAD03946204604F13C02FFF760 -:109C30000DFA0028C2D0144BA08E1B68327A1B8C00 -:109C400017461B1A9BB29342FFF47AAFD4F89C30AC -:109C50007168184498F9B95027F098FBA38E84F8DE -:109C600029501F4494F8BD30012584F82830B37A78 -:109C7000A786DB063FF56BAFA1E7002567E700BFCE -:109C80008807002194070021DC4D00217FB5C46ABC -:109C9000D4F89C30002B41D094F8F0300BB1062B57 -:109CA0003CD194F8F430002B38D0D4E93823456AFD -:109CB00005F1800021F052F894F8F23085F8D330A5 -:109CC000D4E93823C5E91C236B7B9B0718D5D4E95D -:109CD0002223CDE9022302ABD4F8846094F8F30088 -:109CE0000093D4E93A23F9F73EFDA8B9C6F340063C -:109CF00005F17A00DDE9022321F030F885F8D26021 -:109D000005F1D00105F1780013F0A2F8284604B05F -:109D1000BDE87040FFF740B80126E9E7002004B035 -:109D200070BD000037B5044668460D4613F01CF9B7 -:109D30009DF80030054A072B137005D029462046B0 -:109D4000FFF7A4FF03B030BD0020FBE78807002128 -:109D5000FEF7F6BD2DE9F0410E46446A8CB00029AD -:109D600048D0C56A08A813F0FFF895F8F030042B26 -:109D700039D1D4E91C02D5E938139A4208BF884288 -:109D800031D1002300224FF00008CDE90A230AA9AF -:109D90000DF11F0205F1E00004F118078DF81F8096 -:109DA000FEF77CFECDE9046795F9CC30414603937C -:109DB0009DF81F3020460293DDE90A23CDE90023F8 -:109DC00008AAFFF739F870B104F13C052A46394674 -:109DD000204684F82680FFF739F920B12A46394613 -:109DE0002046FFF75DF92046FFF7A2F900200CB0EE -:109DF000BDE8F0812046FEF767FEF7E730B4406A21 -:109E00000368027C23F07F43022A23F0FF0318BF7C -:109E1000002290F80041BBB190F801310133DBB270 -:109E200080F801311CB1012B03D830BC7047002BE6 -:109E3000FBD001230C4993400A7822EA03020A70FE -:109E400030BC032107F034BC0121074D9140AA78B2 -:109E500080F8003222EA0102AA70C0F8F031002C2A -:109E6000E3D130BCFEF728BFB80F00210122436ABE -:109E7000DA70FFF7C3BF000010B4406A0123027C10 -:109E80000D49022A18BF00229340DB4302685BB2EF -:109E900022F07F4222F0FF0232B10A7813400B70A9 -:109EA00010BC032107F004BC8C7880F8002123400B -:109EB0008B7010BCFEF700BFB80F00212DE9F04FEA -:109EC000446A8046E37885B043B1002305212046EB -:109ED000E37005B0BDE8F04F07F004BCA2785AB1BA -:109EE00020460321A37007F011FC04F5727005B041 -:109EF000BDE8F04F21F0ADBA63799BB9237AB4F88D -:109F0000FE11002B14BF07220622062A0CBF0522D1 -:109F10000622B4F8E0315B1A934203D103212046B4 -:109F200007F0E0FB0022564B22725978002940F0DE -:109F300081800125B4F8FC31B4F8E061514FF61A84 -:109F4000E71B514BFF105F43504BB6B293F87A308A -:109F5000B3B1D4F8E40100FB06F994F8E8010FF07E -:109F600081FF0146484606F01FFBD8F80830B4F8D8 -:109F7000E011009382B2D4F8E431F8B21FF0B5FBDF -:109F8000DFF80C91BFB2B4F8E0314FF0000AADF841 -:109F900008306823ADF80A50ADF80E7004F5087B60 -:109FA00003FB0AF21BF802202AB102A88DF80CA0CC -:109FB000FAF780FB68230AF1010ABAF1030FEFD127 -:109FC000B4F8E031D4F8E4012E442B44B6B2A4F83E -:109FD000E03100FB06FA94F8E8010FF043FF014678 -:109FE000504606F0E1FAD4F8E421D4F8F831B4F898 -:109FF000E01102FB06331B1AC8F80830D4F8F03120 -:10A00000C8F814200344C8F80C30D4F8F43103EB3A -:10A010004000C4F8000104F5647008F073FC494680 -:10A0200084F86100404620F05BFB0028ABD005B00F -:10A03000BDE8F08F5868B4F8E011C4F8F801A4F84E -:10A04000FC1104F57270D4F86C135A7021F0FBF90E -:10A05000D4F8EC31002B3FF46CAF4FF47A72D4F8A3 -:10A060006C535543AB4202D2B4F8685362E7D4F85C -:10A07000E431002B3FF45DAFB5FBF3F5ADB259E72A -:10A08000B8070021D01D00214DF833E140510021D7 -:10A09000990D01010122436A1A72FFF70FBF0000F8 -:10A0A0002DE9F04F446AC66A94F8213481460F4680 -:10A0B000904687B084F82C201BB1D4F82434727BEE -:10A0C0005A75002F00F0C9814FF0000A3B78914D7E -:10A0D00097F801B003F00F03BA1C86F8BCA005F195 -:10A0E0000A0104F57C700193009212F02BFD009A96 -:10A0F000019B02446A6094F8F0230BF1FF3BABEB49 -:10A10000020B052B85F808B000F01281072B2AD12D -:10A1100094F82134012B0CD186F8CA30D4F82434B9 -:10A12000B4F8E0211A829A7CDA74D9F82C2052789B -:10A130001A756379784F93BB0123784A3B70137E7D -:10A14000B3B194F8F21348070FD594F809140B41F2 -:10A1500013F0010F0CD0136A01220221204683F86C -:10A160005B2307F0BFFA0020CDE013F0100FF1E7FA -:10A170004FF001090421204684F8059007F0B2FA57 -:10A180004946204607F0C2FA654B1B784B4501BF94 -:10A19000D4F8E431B4F868235343C4F8EC3194F8AC -:10A1A0002134002B51D06379002B4ED00121D4F8FB -:10A1B00024044FF00009D0E9003C827C914001EA80 -:10A1C000030E0CEAE1725EEA020200F09F806FEA81 -:10A1D000010E90F86D2023EA01030CEAEE71C0E94C -:10A1E0000031A0F8582000F17001A0F86290C06D15 -:10A1F00027F0CCF8D4F824044A4B00F1160100F102 -:10A200005802D3F800A0C6F8B0104B46B0F86E0163 -:10A21000D04740F2E241D4F82434A6F8AC00DA6D1D -:10A22000C6F8B820B3F86220A6F8B4209A7C13448C -:10A2300093F8703194F8FB225A4394F8FA324B4366 -:10A240007D2101FB0233C6F8A4307B7853B996F820 -:10A25000C830012B06D1B8F1000F03D1D6F8C420C5 -:10A260007B707A602046FEF755FC94F88832012B0B -:10A2700020D194F89212D6F8C43000290CBF1E21C8 -:10A280004FF49671B4F89022702001FB0233C4F8A9 -:10A290008C3220F0BFFE074660B1234B04F52271DB -:10A2A00040F8083B682227F071F8204B3946187BAC -:10A2B00020F0C1FEE379AA7A93B1110710D594F882 -:10A2C0002134B4F80A1423B1D4F824349B7C03F06D -:10A2D0007F0303F5807334F813308B423FF443AFB0 -:10A2E00000230393D3060DD5D4F8141404A812F058 -:10A2F00083FC9DF8103006F1A002737003A904A836 -:10A30000FEF7B0FC039807B0BDE8F08FC6F8A49044 -:10A310009BE700BF88070021B8070021C036002155 -:10A32000E8360021D4070021000011036850002105 -:10A3300086F8CAA094F82134002B3FF414AF4FF0F4 -:10A340000109D4F82424937CD2E9021209FA03F318 -:10A35000194002EAE3730B433FF405AF682020F095 -:10A3600059FE054600283FF4FEAE3D4B3946A4EBAE -:10A3700003083C4B4FEAE80803FB08F81FFA88F88B -:10A38000A0F8008080F802A004A812F0EDFD3918B2 -:10A39000354F05F1080012F010FED5E904C1D7E9E8 -:10A3A0000C23994208BF944553D1D5E902239DF867 -:10A3B00012004FF0000A43EA004E003818BF012097 -:10A3C0004FF0000BC4F80024C4F804E49DF813E037 -:10A3D00041EA0E41C4E9FEC1C5E914ABC5E9122347 -:10A3E00085F83C000EF0E6FE824690BBD4F824349B -:10A3F00024225B7D85F83E3096F8BF10707BD6F83E -:10A40000C4B01FF028FA194B5844D3E90423C5E916 -:10A4100016234FF48073A5F84030FF232946A86324 -:10A4200085F86030387B85F83D9085F83FA0A5F829 -:10A43000628020F000FE86F8BC90D4F824145246C6 -:10A4400016315046C6F8B01013F0AEFBA6F8AC00BB -:10A4500089E6284620F0E6FD85E6384653E700BF4A -:10A46000D01D00214DF833E168500021F850002143 -:10A470002DE9F347446A074694F8216401256EB13B -:10A48000D4F824349A7C9540D3E902232A4003EA85 -:10A49000E57552EA050314BF01250025002900F0E7 -:10A4A00094806846FE6A12F05FFD9DF80030072B2D -:10A4B00023D16378012B1ED1D4F86C1304F572708C -:10A4C00020F0C1FFE379B3B1564B9B7A1A0712D53E -:10A4D00094F82134B4F80A2423B1D4F824349B7CB2 -:10A4E00003F07F0304EB4303B3F80012914204D05E -:10A4F0000DB1A3F80022637923B90025284602B0E4 -:10A50000BDE8F087002DF8D094F82450022DF4D047 -:10A51000DFF8108195BB1422294604F1100098F849 -:10A520000A90D7F82CA07F6A26F057FF3E4B3F4A8F -:10A53000FB1ADB10534319F0400FA3821CBF97F89E -:10A540000D34A3759AF8BE3019F0040FE3750CBFF3 -:10A55000FF2397F809342376BB6AE361B7F8E0314B -:10A56000238497F82134DBB1D7F824349B7C84F81A -:10A5700022306378012B0FD184F824302C4B608B70 -:10A580001B6898F808201B8C15461B1A9BB2934237 -:10A5900008D20223002563762046FEF7B3FDADE71F -:10A5A000FF23E4E7A36AD8F80410184496F9BE60C4 -:10A5B00026F0ECFE638BE6751D4498F80A3065833F -:10A5C000DB064FF0010599D4E6E794F82430012B1F -:10A5D00002D16378012B01D0002E8ED0002D8CD0BB -:10A5E0001422002104F1100026F0F7FE0E4B0F4A52 -:10A5F000E31ADB105343A38247F67F73E382FF2302 -:10A600002376D4F82434002E9B7C204684F8223014 -:10A61000B4F8E031238414BFFF2302236376FEF7EE -:10A6200071FD6AE788070021D01D00214DF833E154 -:10A63000DC4D00210022014B5A707047B807002101 -:10A64000C36AD3F8A00018B1A1F10C0358425841D5 -:10A65000704700000C4B70B55B6815467BB1222932 -:10A660000DD10126094C84F828601FF073FE237871 -:10A670009A0605D52B789B0602D584F82A6070BD12 -:10A68000002384F82A30FAE7B00C00216837002153 -:10A6900010B5C46A0A4694F8C83094F8C910032B60 -:10A6A00003D0052B09D0002010BD94F8CC30002B2E -:10A6B000F9D0BDE81040FFF7C3BFFFF7CBFFD4F8D8 -:10A6C000B430034A03F5B073C2F8E031EBE700BFE2 -:10A6D0006837002110B5C46A94F8C830032B2AD11A -:10A6E00094F8CC303BB394F8C910FFF7A9FF10B32E -:10A6F000114B93F87830F3B1202020F08BFC024608 -:10A70000C8B1D4E93001C2E9060194F8CB30137422 -:10A71000D4E92E01C2E9020194F8CA3000210748A9 -:10A72000137020F082FCBDE81040054B4FF48061AF -:10A73000187B20F01BBD10BD405100217439002151 -:10A740006850002108B51EF070FDC0F3001300F042 -:10A750000F00184408BD00002DE9F04FDFF8A8B144 -:10A760000546BBF8282085B082B1042020F052FCB9 -:10A770000146002800F08C8040F204434B80634B7C -:10A78000187B05B0BDE8F04F20F055BC604F614C20 -:10A79000F97BD0F82CA094F86A3000297BD0012BEB -:10A7A00079D1D7E90889FA735B4E4B464246304669 -:10A7B00020F0D4FA3368C6F8E431B388A6F8E8315B -:10A7C000CAE92289237C042B01D0012B12D1DAF8AB -:10A7D000843003F04403442B0CD102AB0093A07CE3 -:10A7E000D4E90623F8F7B0FF20B1DDE902234B4896 -:10A7F00020F0B4FA237C042B14D0012B12D094F84F -:10A8000048307BB1002394F8472084F8483002F1A7 -:10A8100008038AF8B0304249931D40488BF8013054 -:10A8200026F0B4FD94F869307BB1002394F86820D9 -:10A8300084F8693002F108038AF8B1303949931D70 -:10A8400039488BF8E53126F0A1FD002128461FF09C -:10A8500095F8237C012B36D002D9023B022B17D866 -:10A8600040F27126FB699B0105D5FFF76BFFAB68D2 -:10A8700006FB0033AB60D4E90212914219D1AB68F8 -:10A8800028461944A96000211FF02AFF0028E9D0BA -:10A8900005B0BDE8F08F9A0794D502AB0093A07C79 -:10A8A000D4E90623F8F75FFF00288BD0DDE90289A1 -:10A8B0007AE728461FF0DAFF0028E9D1AB68E268A2 -:10A8C0001344AB60CEE7D5F8088027682368002BD7 -:10A8D0003FF44BAFD4E90212284620F055F8064663 -:10A8E00018B9AB68E2681344AB604146A8681FF032 -:10A8F00069FDE3680344BB422CBF0020381A206086 -:10A90000002EE3D0C4E700BF683700216850002163 -:10A9100020500021405100216A370021703700216A -:10A9200068510021895100215439002170B5446AD1 -:10A93000D4F8D833D3B194F8C53BBBB1D4F8180AD6 -:10A940001FF040FD0546D4F88C3894F89E1893F813 -:10A95000B020187B1EF07FFF29462046D4F8D8335C -:10A9600094F8C42BBDE8704012F0CEBC70BD00005E -:10A970002DE9F041446A01290D46D4F8C06B00D19D -:10A980000EB3204B04F24D471B6804F5C568DB8A03 -:10A990001E4494F8C43B84F8413ABDB92046A4F85B -:10A9A000325607F05BFF2B4642463946204613F0ED -:10A9B0003FF8D4F82C36A4F8D80AC4F8E43AB4F82E -:10A9C0003236A4F8E03A3046BDE8F081B4F83256A9 -:10A9D000B4F85238AB4202D9204607F03FFF0023BB -:10A9E00042463946204613F0C1F8D4F82C36A4F874 -:10A9F000FC0A2B44C4F8083BB4F832365B1BA4F8BD -:10AA0000043BE0E7DC4D0021F8B5446A074694F8C2 -:10AA10004D33D4F8486384F8C931002965D194F8DE -:10AA2000DD3BA4F81E1513B9204607F041FF94F84A -:10AA3000B850012D16D0002594F8DD3B002B49D0ED -:10AA40002046D4F8E43B984715B1012384F8B83088 -:10AA5000D4F81835C4F86C32B4F81E35A4F868324E -:10AA60003046F8BDD4F8BC20BB68D31AB3F5167FC6 -:10AA7000B4F8C4200CD240F2E24194F8C77001FB54 -:10AA80000233D4E93E10C91940F10000C4E93E1078 -:10AA90002A498B4213D8002184F8C210A1F1EE316B -:10AAA000A3FB01014908A4F8C01022B140F2E24121 -:10AAB0004A439A42BFD2FF2384F8B830BCE7012151 -:10AAC00084F8C2101E49A3FB0101032000FB0311FF -:10AAD000890AE8E70123204604F2145204F2D14126 -:10AAE00013F066F9A4F86002AEE794F8C033B4F846 -:10AAF0001E5523B194F8C233013B84F8C233B4F835 -:10AB00001435AB4202D894F8C23313B1204607F093 -:10AB1000CFFE0123204604F2145204F2D14113F077 -:10AB200025F8D4F81835A4F884022B44C4F89032E0 -:10AB3000B4F81E355B1BA4F88C3291E7C37F070085 -:10AB40009E36D069F8B5446A01290D46D4F8C06B29 -:10AB500000D1F6B11E4B04F28F471B68DB8A1E44FE -:10AB600094F8C43B84F8413AADB92046A4F846575E -:10AB700007F074FE2A463946204612F0C3FFD4F887 -:10AB80004037A4F8EC0AC4F8F83AB4F84637A4F809 -:10AB9000F43A3046F8BDB4F84657B4F85038AB42F2 -:10ABA00002D9204607F05AFE00233946204604F217 -:10ABB0003C7212F0DBFFD4F84037A4F8FC0A2B44B7 -:10ABC000C4F8083BB4F846375B1BA4F8043BE0E745 -:10ABD000DC4D00212DE9F0431C4CD0F82C800546BB -:10ABE00087B020460F4612F0BFF994F80090B9F1F3 -:10ABF000030F29D123790C2B26D1154EB91C3046D1 -:10AC000012F0CCF9D6E9000100222378CDE9000149 -:10AC1000D6E902018DF81030A378CDE902018DF854 -:10AC20001230E96AE37868468DF81330803108F114 -:10AC3000E00305928DF81190F8F7B6FA003818BFC6 -:10AC4000012007B0BDE8F0830020FAE7DC0700210F -:10AC5000E807002130B4446A94F84330A3B1C06AD5 -:10AC600090F8F31090F8F250D0E93A238D4205D1D4 -:10AC7000D0E93850984208BF954201D041F0020116 -:10AC8000607830BC1EF008BD30BC704730B4446AF8 -:10AC900094F84330A3B1C06A90F8CB1090F8CA5032 -:10ACA000D0E930238D4205D1D0E92E50984208BF1B -:10ACB000954201D041F00201607830BC1EF0ECBC3E -:10ACC00030BC7047F0B5464D97B0446A07462846F9 -:10ACD0000E4612F049F931180AA812F06EF92B78D5 -:10ACE000052B02D0002017B0F0BD3E4B5B68002B57 -:10ACF000F8D02B79222BF5D10AA812F0B5F900284B -:10AD0000F0D0DDE90A012B7800228DF820300323F2 -:10AD10008DF82130AB78CDE90401DDE90C018DF827 -:10AD20002230CDE90601EB78F96A8DF823308031C5 -:10AD300004F5326304A80992F8F736FA0028D2D055 -:10AD400004F52E67D7E9102304F2994020F006F8A5 -:10AD500094F8323B06F1080084F8CB3BED781FF005 -:10AD6000F7FF94F83930CDE902019B0732D50B0A81 -:10AD700003F0C003402B0AD11B4BC3E91C0102ABFB -:10AD800094F8330B0093D7E91223F8F7FBFCDDE9C5 -:10AD9000022304F293401FF0E1FF84F8CA5B04F63B -:10ADA000C83104F28F4012F053F8012540F201132C -:10ADB000242294F8191B94F84D0A84F85458A4F8E6 -:10ADC0005C38D4F81C6B1EF046FD0644C4F8586885 -:10ADD000284688E700200021034BC3E91C01D6E781 -:10ADE000DC070021B00C00214051002138B5C26AB7 -:10ADF00092F8C840032C03D0052C0BD0002038BD9E -:10AE000092F8CC30002BF9D0BDE8384092F8C91048 -:10AE1000FFF716BC0B4C456A204612F0A5F82378C4 -:10AE2000052BEBD1084B5B68002BE7D02379222B55 -:10AE3000E4D1012385F85C38002385F854381FF0ED -:10AE400089FADBE7DC070021B00C002110B4C46AEA -:10AE500094F8C820032A03D0052A08D010BC7047F4 -:10AE600094F8CC30002BF9D010BCFFF70FBF426A2A -:10AE700092F8E43313F0200304D0074B5B78003BD7 -:10AE800018BF012382F85D38D4F8B43003F5B073ED -:10AE9000C2F85838E2E700BFDC0700212DE9F8438B -:10AEA00004460025682700F1500600F55A7807FB94 -:10AEB00005F316F80390B9F1010F1FD1F5B9B4F8F5 -:10AEC0006020B4F890319A4218D1D4E91623404654 -:10AED000C4E9DA231EF0ACFA4946204613F012FE0C -:10AEE000D4E9DA03D4E9E812934208BF8842C4E9FE -:10AEF000200303D02946204613F004FE0135032D1C -:10AF0000D5D1BDE8F88300002DE9F043446A054639 -:10AF100094F8C53BC66A85B003BB94F8C73B23B918 -:10AF200094F8D533013384F8D533D4F85C3813F072 -:10AF3000FF1F09D194F8D43383B194F8D5239A42F2 -:10AF40000CD3432384F8D633012384F85E380421DC -:10AF5000204605B0BDE8F04308F0E4BAF37B13B92E -:10AF6000A34B93F87930B373238C13F0100368D19B -:10AF700094F83C76BFB184F83C3694F83D26D4F87A -:10AF80002C0604F5C86126F001FA94F83D36A4F8C1 -:10AF90002836A4F85238B4F83E36A4F8403094F875 -:10AFA0003B3784F834360022204604F5797112F0DC -:10AFB0009FFC86F8B0005FB194F8C53B43B9D4F864 -:10AFC000D8332BB1204607F051FD012384F8C53B4F -:10AFD00094F89261012E0FD194F8893163B1D4F8BD -:10AFE000D8334BB194F8C53B33B9204684F892313D -:10AFF00007F03CFD84F8C56BD4F8C43B23F07F43D5 -:10B0000023F0FF03B3F5803F06D1B4F83E36A4F831 -:10B010004030002384F8C63B002128461EF0AEFCD9 -:10B02000238C03F01D031D2B40F0B680D5F808805B -:10B03000E76AE36A002B40F093803C2384F8D63320 -:10B0400085E76B4FE27897F86A30002A75D0012BBC -:10B0500073D1D4E902890023C4E90489E37004F2BE -:10B06000E6374B46424638461FF078FED4F8E633C2 -:10B07000C4F82834B4F8EA33A4F82C34C6E9228999 -:10B08000238C5A0718D5D6F8843003F04403442B98 -:10B0900012D102AB94F83A000093D4E90C23F8F7EC -:10B0A00053FB48B1DDE9022304F57B701FF056FE27 -:10B0B000DDE90223C4E9062394F83C360BB30023F0 -:10B0C000D6F8981084F83C360B7803F00F03062B63 -:10B0D00017D8012202FA03F313F0450F11D094F8A8 -:10B0E0003D36083386F8B03094F83D3606334B7061 -:10B0F000D6F8980094F83D2604F23E61083026F018 -:10B1000045F994F85037002B86D0002384F8503747 -:10B1100094F85137D6F8A020083386F8B13094F867 -:10B12000513704F2527106335370D6F8A00094F8E8 -:10B130005127083026F02AF96EE79907A0D502AB0F -:10B1400094F83A000093D4E90C23F8F70CFB00289C -:10B1500096D0DDE90289C4E90489C7E91C897EE744 -:10B160002846D4E909121FF00FFC064618B9AB684F -:10B17000A26A1344AB604146A8681FF023F9A36A92 -:10B180000344BB422CBF0020381AE062002E3FF47B -:10B1900050AF05B0BDE8F08394F8C53BEE6813B13D -:10B1A000D4F81C3A1E4494F8C73BC3B9114B646AE7 -:10B1B000DB699B0107D5FFF7C5FA40F27122AB6846 -:10B1C00002FB0033AB607100A1424FF0004238BF78 -:10B1D0002146284605B0BDE8F0431FF047BB0023D9 -:10B1E000284684F8C73B05B0BDE8F0431FF024BAF9 -:10B1F00040510021205000210122436A83F8C72BCF -:10B20000FFF782BEF8B5446AC66A94F8D533D4F81D -:10B210005C280133DBB212F0FF1F054684F8D533FA -:10B2200007D194F8D423A2B1934212D3432384F8D4 -:10B23000D633012384F85E38002304F5066084F8D1 -:10B24000C53B1FF025FC2046BDE8F840042108F06E -:10B2500069B9F37B13B93B4B93F87930B37394F826 -:10B260003C3633B3002794F83D2604F5C861D4F882 -:10B270002C0684F83C7626F089F894F83D363A4658 -:10B28000A4F82836A4F85238B4F83E362046A4F87C -:10B29000403094F83B3704F5797184F8343612F075 -:10B2A00027FBD4F8D83384F8400913B984F8C53B98 -:10B2B000F8BD94F85037C3B1002394F8512784F8AF -:10B2C0005037D4F8400704F2547126F05FF894F830 -:10B2D0005137A4F83C37A4F85038B4F85237A4F8E2 -:10B2E000403094F84F3884F8483794F8C63B94F8C7 -:10B2F0003A00012B01BFB4F83E36A4F840300023D9 -:10B3000084F8C63BD4E90C23F8F710FC98B100236D -:10B310002046A4F8323604F5C56204F24D4112F01D -:10B3200087FBD4F82C36A6F89800C6F8A430B4F8F9 -:10B330005238A6F8A03029462046BDE8F84007F06C -:10B340001BBB00BF4051002173B5446A054694F809 -:10B350004E3333B10321204602B0BDE8704008F0FF -:10B3600059BBC26A244ED37B0BB996F879309373DC -:10B3700094F8283593B1002394F8292584F82835CA -:10B38000D4F8180504F22C5126F000F894F8293569 -:10B39000A4F81435B4F82A35A4F8563396F87A3060 -:10B3A0004BB1AB68B4F89011607800930022D4F8E8 -:10B3B00050331EF09AF9D4F8503304F55A766B6185 -:10B3C000AB68D4F8502320461344AB60B4F89031F6 -:10B3D0000133A4F89031FFF761FDB4F890113046C5 -:10B3E00007F090FA002184F84D0328461FF078F901 -:10B3F0000028E5D002B070BD40510021FFF7A4BF86 -:10B40000F7B505460F46144622B909F02BF9044654 -:10B41000002844D095F83433224EA3B1224B1A6849 -:10B420008AB1D5E9080395F818C0A0FB0C010CFB04 -:10B430000311336905F52E7C634503D07378181822 -:10B4400041F10001904795F83423D5F89800002A7F -:10B4500014BF04210021AB88D5F88C2002330244AC -:10B46000F0681944024433692046009789B2F6F720 -:10B470005BFD337895F834209A420FD90E3355F896 -:10B4800023405CB123784BB194F8B13004F17800DB -:10B4900086F8AE301EF037F884F8B100012003B012 -:10B4A000F0BD00BFF8070021A03A002108B51FF049 -:10B4B00069FD044A5378013B5370BDE808401FF012 -:10B4C0006DBD00BFDC50002108B51FF05BFD044AD4 -:10B4D000537801335370BDE808401FF05FBD00BFD3 -:10B4E000DC5000212DE9F04F0F461646446A85B026 -:10B4F00062B98D4B5A7901325A711A78134493F814 -:10B50000A820013283F8A820A4F886606378022B73 -:10B5100015D01EF01FFFBEB99DF80430032B13D1C8 -:10B52000814B5A6982B99DF8052094F8A210914286 -:10B530000AD084F8A2205F6105B0BDE8F08F022E2A -:10B5400008D876B11EF006FF002FF5D0384609F076 -:10B55000B2F8F1E7062E04D13146204609F0D2FCBC -:10B56000F0E7714DAB795BB9012316F0FB0FAB71BE -:10B5700001BFD4F89820D4F89C319B1AC4E9223337 -:10B58000394601A813F0D1F8002E40F022819DF831 -:10B590000630EB719DF805302B729DF80430032BBB -:10B5A0004DD14FF000092B7894F834209A4203D9FA -:10B5B000002E5DD0042E63D0E37F4FF0000A012BF4 -:10B5C0004FF0FF3B40F0CB802879617E0BF1010BFF -:10B5D00088429ED82046544909F0F7F900285AD0ED -:10B5E00029780E3154F821100029F3D02879617E92 -:10B5F000884280F092804FF001084B4BD5F810A0A4 -:10B6000093E8030002908DF80C10204602A909F07F -:10B61000DCF900287ED09DF808100E3154F8211076 -:10B6200041B1207E94F81BE09DF80CC00EFB00F0A9 -:10B63000844534DB08F101085FFA88F8E5E7012B5F -:10B6400003D19DF80730002BABD006212A786B7808 -:10B6500001FB02330B4455F82320002AA1D195F8B1 -:10B660000390B9F1000F9CD145F823704F469AE73B -:10B670000E3354F8233094F8A02183F864209BE71C -:10B680000E3354F8233094F8A02183F86420DA6C48 -:10B690000132DA6490E7E9790029A7D139E7B031BE -:10B6A0002961E868E168214B01FB0801E9609969BB -:10B6B000CA030CD44FF0060E95F800C069780EFB53 -:10B6C0000C11714455F8211000297FF47DAFBBF1B6 -:10B6D000000F0DD0BAF1000F0AD0D4F89810D4F8AA -:10B6E0008C204FF001090A4410445146F6F75AFCE9 -:10B6F0009DF80430032B3FF40CAF3A4649462046F0 -:10B70000FFF77EFE00283FF404AF002E7FF414AF55 -:10B71000374601E704F52E71C2E74FF00108C0E794 -:10B72000E97900292FD1F4E6F80700212050002103 -:10B73000B0312961E868216B2E4B01FB0801E960FB -:10B740009969CB03C3D44FF0060E95F800C0697811 -:10B750000EFB0C11714455F821100029B7D0287840 -:10B7600094F834100BF1010B8842BFF4D2AE20469E -:10B77000214909F0EDF80028D2D029780E3154F88B -:10B7800021100029F3D0287894F8341088421DD273 -:10B790004FF00108184BD5F810A093E80300029071 -:10B7A0008DF80C10204602A909F0D2F858B19DF886 -:10B7B00008100E3154F821100029B9D108F1010800 -:10B7C0005FFA88F8EEE704F52E71B2E74FF0010852 -:10B7D000B0E7032E7FF4E5AED4F89830D4F88C00AF -:10B7E0004FF001091844D5E903311844F6F7DAFBA4 -:10B7F000D9E600BF20500021F807002138B5446A7F -:10B800006378022B03D0BDE838401EF0A3BD274B60 -:10B81000B0221846002125F0E0FD94F89C20034654 -:10B820000270E27F012A29D194F83420E568012AC8 -:10B83000C5601BD9D4F89400A0B100F1B001196122 -:10B8400020B96A43DA60627E012A12D80122DA71D5 -:10B85000FF221A72002220461146FFF7D1FD002870 -:10B86000D1D038BDD4F89010B031E8E7627E012A1B -:10B8700016D9D4F89020B0321A61E7E7627E012A27 -:10B8800004D9D4F89020B0321A6107E094F834203B -:10B89000012A03D9D4F89420002AF4D1226BDA606B -:10B8A0001A69002AD2D104F52E72E5E7F8070021C3 -:10B8B0002DE9F04F05460026D0F824A0A3B0DAF811 -:10B8C0008C30DAF828400593DAF82030DFF88892D7 -:10B8D00009930AF1380B9AF83420B24230D89AF81A -:10B8E00001309E4E022B2ED00721504609F00AFB54 -:10B8F0000AF160001FF0ADFD706918B108F0DBFEC1 -:10B900000023736123B0BDE8F08FD8F8001041B177 -:10B910005BF8260080B1FAB208F0D0FE0023C8F828 -:10B920000030013708F104089AF81820BA42ECD820 -:10B93000013609F11809CEE7084608F0BCFEF0E729 -:10B94000C8460027F0E7716900296CD09AF83433B3 -:10B95000002B46D0824B1F68002F42D0DAE9083016 -:10B960009AF818C0A3FB0C320CFB0022CDE91C3264 -:10B970001CABCAF820330AF53F70B847074680BBB6 -:10B98000706908F098FE06215046776109F0BAFA0E -:10B99000059B099A23441C460023CDE91033CDE9C9 -:10B9A0001233CDE914339AF8183053430A930AF14D -:10B9B0003803CDE9073300231E4605939AF8343047 -:10B9C000059A9A42C0F09E80664BDB6A002B00F01D -:10B9D000EB80002E00F0E880304613AA10A99847AB -:10B9E000E2E09AF8A030CBB972699378012B15D8B0 -:10B9F00002F102026CD00AF1A8010AF1B00012F0C3 -:10BA0000A2FEBAF8A830BAF820209B1A1F0405D469 -:10BA10009AF8A03043F001038AF8A030706908F06A -:10BA20004AFE0023736173792BB1DAF870100AF1C2 -:10BA300060001FF008FDDAE92236F61ADAE908326A -:10BA4000013342F10002CAE90832DAF81030DAF8BC -:10BA50008C201E441A44CAF88C206B61BAF88410FA -:10BA6000304604F0A1FDBAF88630DAF89820184480 -:10BA7000DAF88C3013441B1A4000AB60CAF890010E -:10BA8000504608F09FFB9AF8A030D3B1D90710D5E3 -:10BA9000BAF82020BAF8A810013292B2914208D127 -:10BAA00023F001038AF8A0305046DAE92C2308F08D -:10BAB000B3FB9AF8A0309A0703D50421504609F049 -:10BAC00021FA002128461EF00BFE0028B6D05FE7C1 -:10BAD0000AF1B8010AF1BA0012F052FEBAF8B83011 -:10BAE000BAF820209B1A180404D49AF8A03043F026 -:10BAF000020391E71E23042150468AF8BA3009F068 -:10BB000001FA8BE7089B53F8045B0893FDB100230F -:10BB100005F1100B06939DF818709AF81830BB4287 -:10BB200022D822AA02EB460232F83C1C730071B103 -:10BB300095F86810002940F01E8295F82C10012914 -:10BB400000F019826B88013622F8483CF6B2059B5A -:10BB50000133059332E700BF10080021F8070021E8 -:10BB6000843A0021685000213946284608F0ADFD8E -:10BB70000A9B8046FA184FF0000343F10003CDE919 -:10BB80000E230EABC5F8183120B3B44B1B680BB3B2 -:10BB9000014605F1F4009847E0B9404608F08BFDF6 -:10BBA0000621504609F0AEF9002637469AF834309F -:10BBB0009E42C0F0E681AA4B93F84730002B3FF439 -:10BBC000A1AEDAF820109AF8020023B0BDE8F04FD9 -:10BBD0000FF004BD6B6893F81E90B9F1000F40F0B0 -:10BBE0007B81B8F1000F00F09C80414685F86C70B5 -:10BBF0000DA812F09AFD1822494616A825F0EDFB73 -:10BC00006B880E9AADF858309DF83730A8F10A07C6 -:10BC1000ADF85C30ADF8663095F82C311894ADF87D -:10BC200064202BB1012B2DD038461FF0FBF926E004 -:10BC30009DF83430012B16BF4FF481738DF85B30C3 -:10BC4000ADF85A309DF8343016A985F82C313846B5 -:10BC500012F0E7FD08F10201BDF86620384425F036 -:10BC6000A2FB3946584610F06FFA40B105F12008A2 -:10BC700040460DF133011FF0EDF9074650B9069B20 -:10BC8000013347E79DF83430012B18BF03238DF8AB -:10BC90005A30D7E795F8683069886BB13A46C9B22F -:10BCA00005F130001FF0C1F995F83830013385F8FF -:10BCB0003830FFF7FBFBDBE705F12C093B46484634 -:10BCC0000E9A10F013F840B395F82C30E3B1012B25 -:10BCD000CED1484610F02FF807460028C8D0394684 -:10BCE0001CA812F056FD5F4BBDF87E20DB68219941 -:10BCF0000B93688F2346DDF82CC0E04738461FF0D1 -:10BD000091F9FFF7E1FBE4E722AB03EB460232F8DF -:10BD10003C3C013322F83C3CAAE738461FF082F94C -:10BD2000A6E7012385F82A309DF818309AF81820E4 -:10BD300001339342A3D14146584610F005FA00283A -:10BD40004FD005F12008404616A91FF083F9074699 -:10BD5000002894D095F8683069886BB13A46C9B22A -:10BD600005F130001FF061F995F83830013385F89E -:10BD70003830FFF79BFBE6E705F12C093B464846C8 -:10BD80000E9A0FF0B3FF40B395F82C30E3B1012BBE -:10BD9000D9D148460FF0CFFF07460028D3D0394607 -:10BDA0001CA812F0F6FC2F4BBDF87E20DB68219911 -:10BDB0000B93688F2346DDF82CC0E04738461FF010 -:10BDC00031F9FFF781FBE4E722AB03EB460232F8DF -:10BDD0003C3C013322F83C3CB5E738461FF022F9E1 -:10BDE000B1E71F4B9B699B037FF549AF1E4B059A3B -:10BDF000134493F8A830002B7FF441AF08F032FCD5 -:10BE0000814600283FF43BAF6B881422ADF85830D0 -:10BE10004FF481734146A0F10A0717A8ADF85A30D4 -:10BE200025F0DBFA0E9B3846ADF86430022316A9E4 -:10BE30008DF86830189412F0F4FC95F86830ABB1C6 -:10BE40004A46A97805F130001FF0EFF895F8383030 -:10BE5000013385F83830FFF729FB10E7843A0021D9 -:10BE600020500021904A0021F807002105F12C09FB -:10BE70003B4648460E9A69880FF038FF00283FF489 -:10BE8000D3AE95F82C30F3B1012B7FF4F8AE4846D1 -:10BE90000FF051FF074600283FF4F1AE39461CA8C9 -:10BEA00012F077FC5F4BBDF87E20DB6821990B9385 -:10BEB000688F2346DDF82CC0E04738461FF0B2F803 -:10BEC000FFF702FBE3E722AB03EB460232F83C3C10 -:10BED000013322F83C3CD2E6B8F1000F3FF4CFAE7C -:10BEE00095F82C3023B1012B19D095F868304BB35D -:10BEF000BAF806306A88CDE9014398F8013058460F -:10BF0000009305F13001434610F094F922AB03EBA6 -:10BF1000460333F83C2C104423F83C0C12E0BAF8EA -:10BF200006306A88CDE9014398F8013058460093FD -:10BF300005F13001434610F07DF9284608F0A8FBD2 -:10BF4000074618B9404608F0B6FB98E639461CA8E3 -:10BF500012F01FFC334BBDF87E20DB6821990B9358 -:10BF600068882346DDF82CC0E04738461FF05AF8B1 -:10BF7000FFF7AAFAE1E7002288336B4423F83C2C50 -:10BF8000E5E5079B53F8044B07936CB194F86830D0 -:10BF900053B194F86930002B3ED104F15808204683 -:10BFA00008F076FB054608B90136FFE529461CA8CE -:10BFB00012F0EFFB9AF81E30012B25D194F86A306D -:10BFC0006BB1219A937851781B0403EB012311780C -:10BFD000D2780B4403EB0263E36684F86A70E26E86 -:10BFE000531CE36694F870300192BAF806209DF86D -:10BFF0007E102198009242460FF0ACFF28461FF0B9 -:10C0000011F8FFF761FACAE79AF8183094F86C2033 -:10C01000099901FB0322E5E7A4F8687084F86A70C7 -:10C02000E766C1E7904A002110B50446B02200211E -:10C03000034825F0D2F92046BDE81040FFF738BC90 -:10C04000F807002113B590F8343313B1184B1B686F -:10C050005BBB184BDA69019253780233ADF80030BC -:10C0600090F8A23011789B0003F01C0321F01C0112 -:10C070000B431370019A137823F02003137090F888 -:10C08000343353B10C4B1C683CB1D0E90831027E0B -:10C09000A3FB020302FB0131A047002301211A4642 -:10C0A0006846F6F705F802B010BD044AD3E700BFB2 -:10C0B000883A0021C8080021A43A0021A8080021DC -:10C0C0002DE9F047234F04463B7897F801C003F170 -:10C0D0000E0250F82250902043431820FA781E4E4A -:10C0E0000CEB020100FB01331E44F36873B3736968 -:10C0F000002B14BF4FF003084FF0020894F83433BC -:10C100009BB1164B1B6883B1D4E9080194F818A0C1 -:10C1100094F81AE0A0FB0A090AFB019110EB0C004D -:10C1200041F10001E2FB0E019847D7E90523D4F85D -:10C13000CC1030460A444146F5F7BAFF05F17800C5 -:10C140001DF0E1F985F8B100BDE8F0874FF0010876 -:10C15000D4E700BFC8080021E8080021A43A002164 -:10C160002DE9F3479025182316464D4303FB02554E -:10C17000DFF8A48000EB810908EB050A07460C46AE -:10C1800052463146D9F8380008F02EF900283AD046 -:10C190003B7E224DB34217D9BB7E6BB1D9F8380034 -:10C1A000711C0DF10702C9B208301EF062FF38B1F0 -:10C1B00090F90C30002B03DA2A19937B0133937327 -:10C1C0002A19137A01331372902118224C4302FB6F -:10C1D00006444444616897F8A2300A789B0022F034 -:10C1E0001C0203F01C0313430B70EA69636832B14D -:10C1F0001A7842F020021A7002B0BDE8F0871A786F -:10C2000022F02002F7E7064BCAF80C00CAF8043007 -:10C21000022328F80530EFE7E8080021C8080021CC -:10C22000CE080021012973B5456A04D102B0BDE8EA -:10C2300070401EF08FB81A4C95F8343022789A422C -:10C24000F4D22146284608F083FB40B9E369002B6D -:10C25000ECD0284602B0BDE87040FFF7F3BED4E949 -:10C26000000100908DF804102846694608F070FB24 -:10C2700078B19DF800300E3355F82330B0332A6B77 -:10C28000A3616369284613446361FFF719FF02B095 -:10C2900070BDE369002BF2D005F52E73EFE700BF08 -:10C2A000C8080021012973B5456A04D102B0BDE870 -:10C2B00070401EF04FB8194C6B7E22799A42F5D22D -:10C2C0002146284608F081FB40B9E369002BEDD0F8 -:10C2D000284602B0BDE87040FFF7B4BED4E90001C3 -:10C2E00000908DF804102846694608F06EFB78B17E -:10C2F0009DF800300E3355F82330B033EA68A3615F -:10C300006369284613446361FFF7DAFE02B070BD2B -:10C31000E369002BF2D005F52E73EFE7C808002182 -:10C320002DE9F743674D446A20220021284625F075 -:10C3300054F8E37F012B70D194F83430012B64D989 -:10C34000E36BB033AB61E3680DF1020120466B6132 -:10C3500008F06BF99DF80230E861012B08BF94F8F2 -:10C36000A2304FF0000604BF013384F8A230003839 -:10C370004FF0010318BF01208DF8043094F8A2306B -:10C380008DF8060001A950488DF805308DF807603A -:10C3900012F09EF9204632463146FFF7E1FE204674 -:10C3A000FFF78EFE94F83430B3425AD8A37E002BA8 -:10C3B00040F0848094F85C1029B90123204684F869 -:10C3C0005C3009F007FAE969E1B1D4E90836257E65 -:10C3D0003E4AA3FB053005FB0600C2E9003094F895 -:10C3E0003433C4F81C236BB1394B1D6855B14E78FA -:10C3F0003848B21C24F0CAFF374A04F53F7093193D -:10C40000911EA84703B0BDE8F083637E012B01D9DC -:10C41000A36B96E704F52E7394E7637E012B04D992 -:10C42000A36BB033AB61236B8EE794F83430012BF0 -:10C4300001D9E36BF5E704F52E73F3E756EA07033A -:10C4400004D041462046FAB2FFF78AFE0137227E29 -:10C45000BA42F3D8E77E637E5743BB4205DC013620 -:10C46000A0E700275FFA86F8F1E74FF00008DF1B2E -:10C470005FFA86F9B845F2D0227E4946424420460A -:10C48000D2B2FFF76DFE08F10108F3E7394680F8F4 -:10C490000D9058F826004F1C0DF103020830FFB232 -:10C4A0001EF0E7FD0028F1D13946013694F834300A -:10C4B000B3427FF67FAF04F13808EAE70026314641 -:10C4C000B146F3E7C8080021CE080021480C00213E -:10C4D000883A0021A8080021AA0800212DE9F04F80 -:10C4E00006460125446A87B004F138074FF000087A -:10C4F000DFF8349294F83430984518D3204608F089 -:10C50000CFF9204608F0A2F86378012B22D094F8E6 -:10C51000A0309B0704D504F154001EF03BFFC8B1C6 -:10C520000421204607B0BDE8F04F09F0B9B919F869 -:10C53000011B49B157F8280080F82050A37E33B181 -:10C5400099F8052008F00EF808F10108D2E707F085 -:10C55000C8FFF9E7D4E90832013342F10002C4E927 -:10C5600008322269B36820461344B360726107F051 -:10C5700029FE94F8A03063B994F8A130D80747D5C4 -:10C58000022123F0010384F8A130204609F088F944 -:10C590001DE0D9071BD5228CB4F8A810013292B245 -:10C5A000914214D123F0010384F8A0302046D4E94D -:10C5B0002C2307F031FE216D29B1D4E92C23C1E9E8 -:10C5C0003A2381F8B85094F8A030002BD4D0002141 -:10C5D00030461EF085F8002888D04FF0000904F19D -:10C5E0003808C246CB4694F83430994522D25AF8DE -:10C5F000045B95F8683043B195F86930002B3CD165 -:10C60000A77F67BB237EBB420AD809F10109EAE78D -:10C610009A07DCD523F00203032184F8A130B4E7A4 -:10C62000226A95F8701002FB03736888E2880FF0A5 -:10C6300047FD80B9236D2BBBA37F012B6CD03B4BF7 -:10C6400093F84730002B6BD0216AA07807B0BDE883 -:10C65000F04F0EF0C3BF0EF0FBFC0137D2E7EB6EDC -:10C6600095F870105A1CEA666888E2880FF028FD79 -:10C670000028DFD00EF0ECFCC7E7A5F868B0C5F8DD -:10C680006CB0C2E7B268C3F8BC20207ED4E90825AC -:10C69000A2FB002100FB0511C3E93E21CCE758F8BD -:10C6A000046B337FE3B10FF04DFD06F1140A05462C -:10C6B00058B318220021684624F08FFE738829465B -:10C6C000ADF80030736850469A880FF06DFC80B268 -:10C6D000ADF80E0050B12A466946304607F0BCFD61 -:10C6E000013794F834309F42D9D3A8E728461EF08A -:10C6F00099FCF5E71EF096FC1EF044FC99F800301A -:10C70000013389F800301EF049FC694650461EF09E -:10C71000A1FC0028EED1E3E70027DFF81490E0E762 -:10C7200007B0BDE8F08F00BFD008002120500021E5 -:10C73000DC50002110B5044620220021034824F0DB -:10C740004CFE2046BDE81040FFF7C8BEC8080021D7 -:10C7500010B590F8F7200346012A19D090F8EE2082 -:10C7600090F8F510514011F0010132D1B3F82C418D -:10C7700090F8F80004340132A042D2B20ADDD3E9C5 -:10C780000C04013044F10004C3E90C0483F8EE20EA -:10C7900000201DE010B993F8F31059B91049096849 -:10C7A00031B1D3E90C10013140F10000C3E90C10A4 -:10C7B000012006E0D3E90C14013144F10004C3E97F -:10C7C0000C1483F8EE20D3F820310BB101225A70FB -:10C7D00010BDD0F854230132C0F85423D8E700BF6D -:10C7E000A03A0021002310B580F8F23080F80E3115 -:10C7F00004460FF0BFF920B194F8FD32013384F8FC -:10C80000FD3210BD38B590F8462090F8F43004465B -:10C81000534013F001050CD090F80E31013280F82E -:10C82000462043B1FFF7DEFFD4F814310BB10122EB -:10C830001A70284638BD90F8FD32013380F8FD3279 -:10C84000F2E790F80D310BB9837F0BB10FF0B2B95D -:10C85000704700000023F0B5046F89B084F8F13010 -:10C8600084F8F23094F8D832D4F81471012B0CBF4C -:10C870000223002384F8ED3094F8463084F8EF303A -:10C88000584B9B6903F0805CDB0008D494F81C31A2 -:10C890002BB994F8283113B9012384F8F03051EA08 -:10C8A00002004FF000031BD0657F02AE012D19D1AD -:10C8B00084F8ED3084F8EF3004F1ED014A4884F853 -:10C8C000F15012F01BF8494B93E8030086E803008F -:10C8D00030462946F5F740FCBDF8080084F80F51B2 -:10C8E00009B0F0BD84F80F31BCF1000F11D094F8FD -:10C8F0001C31012B0BD1FB78BA780133934208D15C -:10C9000094F828312BB9012384F8F03001E0002B92 -:10C91000F6D0314620460FF0F5F80546002842D003 -:10C92000039A537884F8F230012384F80E31137897 -:10C9300003F0F303137094F8EE10890001F0040182 -:10C940000B435BB2137094F8EF10C90001F00801BB -:10C950000B43137094F8F010090101F010010B4320 -:10C96000137094F8F110890101F040010B4313702A -:10C970001F4B1B682BB194F8942112B1D4E90A0122 -:10C98000984730462946F5F7E7FB039B227F587806 -:10C9900094F8EC3202309A42A2D1D4F844330133F5 -:10C9A000C4F844339CE794F8D83284F8F200012BA1 -:10C9B00008BF022504F1ED010B4884F8ED5011F099 -:10C9C0009DFF6B46094A92E8030083E8030018467E -:10C9D0000121F5F7C1FB0123BDF8000084F86433A1 -:10C9E0007EE700BF20500021500C0021F4240301F9 -:10C9F000A43A002170B590F80C6104460D4626B9A2 -:10CA000019B108460FF030F9354604F5907009F079 -:10CA100083FDA0B9D4F82031B4F8E8229968A67A49 -:10CA2000D878891AD4E9B832002E18BF1346228963 -:10CA300003FB00112846BDE870400FF019B970BD26 -:10CA40000023D0F82021037780F8613080F8FD3290 -:10CA500080F8FE3202B11371D0F814311BB10022FC -:10CA60001A719B785BB9012343770023A0F8F0305B -:10CA7000A0F8F63080F8F83080F8F330704742774D -:10CA8000F3E770B500F590750446284609F044FDBB -:10CA9000002858D1D4F820315A78EAB10120DA7848 -:10CAA00099180244C876DA7094F8FE22024484F899 -:10CAB000FE229A7803F11B010F2A28BF0F22C3F12F -:10CAC000FF2303F57F03E5335818904237D32846F8 -:10CAD000BDE8704009F068BC9A79597901328A4200 -:10CAE000E7D1D97818795E18327B9042E1D194F879 -:10CAF000EE20013284F8EE20D4E90C20013240F11E -:10CB00000000C4E90C2001221144F276D970B4F877 -:10CB1000701384F86E231144A4F87013D4F8301302 -:10CB20001144C4F8301394F8FE12114484F8FE1234 -:10CB300094F8D8120029BCD184F88223B9E711F8FF -:10CB4000010B0028C0D170BD38B504460FF07EF847 -:10CB5000054688B10A4B1B682BB194F8952112B198 -:10CB6000D4E90C019847B4F82C112846BDE83840A8 -:10CB7000063189B2F5F726BBBDE838401DF0EABBA7 -:10CB8000A03A0021F0B5C37D054699B02BB109F05C -:10CB90004FFB40F2E24604460CB919B0F0BD94F8E0 -:10CBA000F412A9B194F8EA22A88A571E4743D5F88F -:10CBB0000CC0286B94F8EC32604406FB0700009030 -:10CBC00002A809F049F902A904F58A7009F0DAFB14 -:10CBD00094F8F51299B1AF8A286B94F8EC3206FB01 -:10CBE0001700D4F8E47294F8EB22384400900DA8B2 -:10CBF00009F032F90DA904F5907009F0C3FB204645 -:10CC0000FFF71EFF2146284609F044FB0446C3E710 -:10CC1000F8B500F590770446384609F07DFC002809 -:10CC200041D1D4F820311A46CAB998786FF01A0C5D -:10CC30000F2803F11B0528BF0F202A464FF0010ED5 -:10CC4000ACEB030C0CEB020188420DD80CEB050396 -:10CC5000984224D83846BDE8F84009F0A5BB917940 -:10CC600001319171D26ADFE71178B1B99E795979B2 -:10CC70008E4212D182F800E094F8EE10013184F86F -:10CC8000EE10D4E90C16013146F10006C4E90C1689 -:10CC9000D9780131D97084F86EE30132D2E715F802 -:10CCA000013B002BD2D1F8BD2DE9F04700F58A7782 -:10CCB0000446384609F030FC002849D1D4F8145114 -:10CCC0002B46C3B96FF01A0805F11B06B2464FF0A8 -:10CCD0000109A8EB0508AB7808EB0A020F2B28BF67 -:10CCE0000F2393420CD83344B3422DD13846BDE8CC -:10CCF000F04709F059BB9A7901329A71DB6AE0E793 -:10CD00001AF8013B002BE6D1AA796B799A42E2D15D -:10CD100094F846302046013384F846300AF8019CE6 -:10CD20000EF01BFF28B12046FFF75CFD20460EF0F9 -:10CD300041FFEB780133EB70D4E90A32013342F161 -:10CD40000002C4E90A32C6E716F8012B002ACBD14B -:10CD5000BDE8F087F8B500F58A760446304609F05C -:10CD6000DBFB002865D194F8F130002B61D1D4F8B9 -:10CD700014512B78F3B10121EB78EA180B44D176EA -:10CD8000EB70D4E90A325B1842F10002C4E90A32BE -:10CD9000AB7805F11B020F2B28BF0F23C5F1FF2530 -:10CDA00005F57F05E535A9188B4238D8304609F0DE -:10CDB000FBFA38E0D4F83C330133C4F83C33AB79A8 -:10CDC0006A790133934224D1EB7829792B441A7B79 -:10CDD00091421ED10127DF7694F8463020463B442D -:10CDE00084F846300EF0B9FE18B12046FFF7FAFC81 -:10CDF000A777D4E90A32013342F10002C4E90A32CA -:10CE0000EB780133EB70D4F840330133C4F840338E -:10CE1000BEE7D4F848330133C4F84833B8E712F812 -:10CE2000011B0029BFD1304609F076FB08B1012370 -:10CE30006377F8BD2DE9F04F456A81462C6FAA78DB -:10CE40008846D4F8087194F8F03099B0002A40F080 -:10CE50008580002B61D0637F002B5ED0237F5A1C1E -:10CE600094F8EC329A4202DA9B1A03FB07772146C8 -:10CE7000284609F00FFA0446002800F0D380B0F8E5 -:10CE80004A30002B40F0CE8090F84730002B40F025 -:10CE9000C98090F8F412B9B190F8EA2290F8EC3217 -:10CEA000A88A561ED5F80CC04643286B604440F251 -:10CEB000E24C0CFB0600009002A808F0CDFF02A98E -:10CEC00004F58A7009F05EFA94F8F512A9B140F2FF -:10CED000E24CAE8A286B94F8EC320CFB1600D4F8C6 -:10CEE000E46294F8EB22304400900DA808F0B4FFFF -:10CEF0000DA904F5907009F045FA2046FFF7A0FD52 -:10CF0000012388F8003004F59C73C9F82C302C6795 -:10CF100094F8E03084F839311CE0B4F84A30002B42 -:10CF2000A5D194F84730002BA1D1237F94F8EC22AF -:10CF30000133DBB29A42237702D10123237696E7AD -:10CF400094F8F63013B1012384F8F03094F8E1300E -:10CF500084F83931384619B0BDE8F08FD4F8F0A222 -:10CF600094F8E16013B10123237606E0B4F84A3067 -:10CF70008BB12146284609F0DFF9284609F049F926 -:10CF8000012815D1284609F0BAF900284AD1574698 -:10CF900084F83961DEE7237F94F8EC220133DBB2B9 -:10CFA0009A422377DFD094F8F630002BE5D0DAE709 -:10CFB0002146284609F06EF983462846BBF1000F4A -:10CFC00006D109F09CF968BB012388F80030C1E75D -:10CFD00009F095F9064628BBBBF84A30002BF3D080 -:10CFE0005946284609F0A8F9284609F02EF928677D -:10CFF00090F8E130044680F8393100F59C73C9F8A7 -:10D000002C3001232B762146284609F043F930B114 -:10D01000834504D0D4F8083104461E44F3E7AAEB54 -:10D02000060797E70123284688F8003009F076F9CB -:10D0300000278FE70023F0B5456A99B02C6F2B7657 -:10D0400094F8F412B1B194F8EA22A88A561EEF6857 -:10D050004643286B94F8EC32384440F2E24707FB31 -:10D060000600009002A808F0F7FE02A904F58A70F5 -:10D0700009F088F994F8F512A9B140F2E247D4F822 -:10D08000E462286B94F8EC323044AE8A94F8EB22D8 -:10D0900007FB160000900DA808F0DEFE0DA904F5B0 -:10D0A000907009F06FF92046FFF7CAFC00210122B9 -:10D0B0002846FFF7CFFB1DF057F910B92046FFF7C0 -:10D0C00043FD19B0F0BD406A10B501220021046F84 -:10D0D000FFF7C0FB1DF048F920B92046BDE810401D -:10D0E000FFF732BD10BD436A10B51C6F04F1A800F4 -:10D0F0001CF009FA84F8E10010BDF0B50B78064683 -:10D1000099B0F3B1456AAF78012F1AD12846296F3B -:10D1100009F0C0F80446B8B9284609F096F800F5B9 -:10D120009C732F76F362286790F8E130027F80F8D5 -:10D13000393190F8EC329A4203D800213046FFF79B -:10D14000D2FF002019B0F0BD2B7E002B36D190F815 -:10D15000F412B9B190F8EA2290F8EC32A88A571E7E -:10D16000D5F80CC04743286B604440F2E24C0CFBFE -:10D170000700009002A808F06FFE02A904F58A706B -:10D1800009F000F994F8F512A9B140F2E24CAF8A27 -:10D19000286B94F8EC320CFB1700D4F8E47294F886 -:10D1A000EB22384400900DA808F056FE0DA904F5B6 -:10D1B000907009F0E7F82046FFF742FC04F59C73F5 -:10D1C000F3622B7E2C6723B994F8E03084F8393170 -:10D1D000B7E794F8E130227F84F8393194F8EC32E3 -:10D1E000A9E770472DE9F04F456A064689B0284601 -:10D1F00009F01EF84FF000080446DFF854923CB9DD -:10D20000EB7D002B4FD102236B7009B0BDE8F08F8E -:10D2100094F8D8327BB994F86E2322B1204684F872 -:10D220006E3309F0A3FA94F8103123B1204684F844 -:10D23000108109F037FB4FF49563E7885F43854B16 -:10D24000D3F800B0637E0BEB070A012B06D01BF866 -:10D2500007301BB199F80030012B15D1204609F099 -:10D26000C1F899F8003043B9E17E99B11622E3760E -:10D27000E27700212046F8F71DF984F819802B7811 -:10D2800013B1EB7D013BEB752146284609F002F80E -:10D290000446B4E71BF80730002BEAD19AF81020B7 -:10D2A000A370E277E5E7284608F0CFFF0446DFF8F1 -:10D2B000A881DFF8A891002C40F0C180284608F032 -:10D2C000C4FF6B7E012B0DD16C76B368EA69134401 -:10D2D000B36000F59C73EC61F362286790F8E0306E -:10D2E00080F83931DFF86C91DFF8748140F2E24167 -:10D2F0006B6AAA8A284601FB02336B6208F098FF2A -:10D300004FF4956A0446E388D9F80070B4F84A20CF -:10D310000AFB0377002A40F03B81E18904F1A80B66 -:10D32000013189B20123E18158461CF09FF884F84D -:10D33000390184F8E00058461CF0E5F894F81833F9 -:10D3400084F8E100002B40F00F8194F8D432032BD5 -:10D3500040F01C8194F84621013A18BF01229B1A23 -:10D360003B4493F8503284F83A3194F8D832012B88 -:10D3700020D194F86033EBB10EF0E4FE8346C8B1DF -:10D380000146B4F8302104F556700EF00DFE00236E -:10D39000ADF816008DF80B301DF0F4FD98F8003054 -:10D3A000013B88F800301DF0F9FD5A46204602A9DD -:10D3B0000EF010FB2146284608F06CFF04460028BA -:10D3C000A1D197F885332846A3F10B02534253416C -:10D3D000337608F03AFF6A6AD0E904310A44D21A77 -:10D3E000B260EA680746134440F2E2425B1AF36017 -:10D3F000AB8A21465343304673611DF071F9002812 -:10D4000040F0CA80706AFFF7BDFBB7F84A305BB9DD -:10D41000FB8938460133FB81FFF746FC3846FFF7AE -:10D42000F7FBFB89013BFB813946284608F032FFB8 -:10D4300007460028E9D1284608F0FAFE56E7B4F876 -:10D440004A307BB12146284608F024FF044632E7E3 -:10D45000000D0021B43A0021B05000219C3A002177 -:10D46000DC5000215A4B2046D3F800A0B4F806B097 -:10D47000FFF71AFC2046FFF7CBFB94F8D83283B9AC -:10D4800094F86E2322B1204684F86E3309F06EF9C9 -:10D4900094F810312BB10023204684F8103109F0A4 -:10D4A00001FA94F8CA7294F86130002F3ED16BB340 -:10D4B000B4F8C81204F52E701DF0C5FF012384F8DE -:10D4C000CA3298F801305BB16E212046F8F7A8F80F -:10D4D00020460AF0DDFC394620466269F8F71AF862 -:10D4E00094F8CB3293B1D9F800707FB1A37AD3B955 -:10D4F00094F8D41201224FF49560364B00FB0BA038 -:10D500001B6893F9283000920022B84794F8FC3247 -:10D51000ABB1E08809F006F8002893D0042120463A -:10D52000F8F77EF88EE794F8D512E3E7002BEDD0FC -:10D53000B4F8C81204F52E701DF085FFE6E7E38904 -:10D54000062BE6D16E212046F8F76AF820460AF04D -:10D550009FFC2046F8F788F805212046F8F74AF89E -:10D56000EB7D012BD5D150E6D4F8E0B26B6AD4F84C -:10D570001C239B1A5B45FFF4E8AE204609F0C6F871 -:10D58000D4F81C335B44C4F81C33EFE70122E6E611 -:10D59000013AA4F84A200DE7284608F056FE28670D -:10D5A00000F59C70F062284608F04FFE0A4B286791 -:10D5B00000F59C70F06293F84730002B3FF425AEE5 -:10D5C0002146287A09B0BDE8F04F0EF007B800BF39 -:10D5D000B43A0021DC4D00212050002110B5044652 -:10D5E000406AFFF7CFFA2046BDE81040FFF7FABDCA -:10D5F000436A1B6FD3F8143113B11A7901321A71CF -:10D600007047000070B50E464FF49561436A1546A9 -:10D610001C6F454BE2881B6801FB0233D4F81421D0 -:10D620000AB100211170D4F8202122B11179013101 -:10D630001171002151700022032DA4F80C21A27752 -:10D6400084F86E231BD0C26A042D92F8B82084F8A7 -:10D65000EC200FD0022D12D130460EF005FB2046F3 -:10D66000FFF778FB2046FFF70CFA2046BDE8704034 -:10D67000FFF7E7B8D4F84C230132C4F84C23D3F8B1 -:10D68000182422F07F4222F0FF02B2F5803F0BD136 -:10D6900094F9EC10D3F84824521AC3F8482493F8AC -:10D6A0004524013283F84524042D09D8DFE805F02C -:10D6B000032D08202D00012384F8FC3284F861300A -:10D6C000314604F1F30011F038F9062D21D194F818 -:10D6D000F53094F8EE205340DB071AD42946204653 -:10D6E000F7F788FF30460EF0BFFA1CF033FEB6E7BE -:10D6F0000023A4F80C31D4F850330133C4F850336C -:10D7000031462046FFF776F9A9E70023A4F80C314B -:10D71000F6E72046FFF71CF884F80C012046FFF7D7 -:10D7200071F884F80D01EBE7B43A002103220023DD -:10D7300080F8A320D0F82021A0F8A030037780F84B -:10D74000FD3280F8FE3202B11371D0F814311BB1F2 -:10D7500000221A719B785BB9012343770023A0F85C -:10D76000F030A0F8F63080F8F83080F8F3307047E9 -:10D770004277F3E770B500F590750446284608F047 -:10D78000CBFE00285ED1D4F820315A78EAB10120CE -:10D79000DA7899180244C876DA7094F8FE220244C6 -:10D7A00084F8FE229A7803F11B010F2A28BF0F226A -:10D7B000C3F1FF2303F57F03E533581890423DD3AF -:10D7C0002846BDE8704008F0EFBD9A7959790132DA -:10D7D0008A42E7D1D97818795E18327B01329042BB -:10D7E000E0D1D4E90C20013240F10000C4E90C2062 -:10D7F00001221144F276D97094F8EE1084F86E2369 -:10D80000114484F8EE10D4F850131144C4F85013A6 -:10D81000B4F870131144A4F87013D4F83013114401 -:10D82000C4F8301394F8FE12114484F8FE1294F8F0 -:10D83000D8120029B6D184F88223B3E711F8010B7E -:10D840000028BAD170BD000038B504460EF0FEF9CC -:10D85000054688B10A4B1B682BB194F8952112B18B -:10D86000D4E90C019847B4F82C112846BDE838409B -:10D87000063189B2F4F7A6BCBDE838401CF06ABD99 -:10D88000A03A0021F0B5C37D054699B02BB108F050 -:10D89000CFFC40F2E24604460CB919B0F0BD94F852 -:10D8A000F51299B1AF8A686A94F8EC3206FB17005A -:10D8B000D4F8E47294F8EB223844009002A808F0FF -:10D8C000CBFA02A904F58A7008F05CFD94F8F41212 -:10D8D000A9B194F8EA22A88A571E4743D5F80CC08C -:10D8E000686A94F8EC32604406FB070000900DA8CB -:10D8F00008F0B2FA0DA904F5907008F043FD204637 -:10D90000FFF714FF2146284608F0C4FC0446C3E78D -:10D91000F8B500F590770446384608F0FDFD00287C -:10D9200046D1D4F820311A46CAB998786FF01A0C4B -:10D930000F2803F11B0528BF0F202A464FF0010EC8 -:10D94000ACEB030C0CEB020188420DD80CEB050389 -:10D95000984229D83846BDE8F84008F025BD9179AD -:10D9600001319171D26ADFE71178D9B99E7959797D -:10D970008E4217D182F800E0D4E90C16013146F14D -:10D980000006C4E90C16D9780131D97094F8EE106C -:10D9900084F86EE3013184F8EE10D4F830130131CD -:10D9A000C4F830130132CDE715F8013B002BCDD17F -:10D9B000F8BD2DE9F04700F58A770446384608F0AF -:10D9C000ABFD002849D1D4F814512B46C3B96FF0F0 -:10D9D0001A0805F11B06B2464FF00109A8EB05082D -:10D9E000AB7808EB0A020F2B28BF0F2393420CD809 -:10D9F0003344B3422DD13846BDE8F04708F0D4BCDB -:10DA00009A7901329A71DB6AE0E71AF8013B002B40 -:10DA1000E6D1AA796B799A42E2D10AF8019C94F88E -:10DA200046302046013384F846300EF096F828B18F -:10DA30002046FEF7D7FE20460EF0BCF8EB78013307 -:10DA4000EB70D4E90A32013342F10002C4E90A3230 -:10DA5000C6E716F8012B002ACBD1BDE8F087F8B550 -:10DA600000F58A760446304608F056FD002865D158 -:10DA700094F80F31002B61D1D4F814512B78F3B105 -:10DA80000121EA78AB18D976D4E90A31013341F1A2 -:10DA900000010132C4E90A31EA70AB7805F11B02DA -:10DAA0000F2B28BF0F23C5F1FF2505F57F05E535B1 -:10DAB000A9188B4238D8304608F076FC38E0D4F804 -:10DAC0003C330133C4F83C33AB796A790133934278 -:10DAD00024D1EA782979A818037B99421ED101271D -:10DAE00094F846303A44013384F84630D4E90A3198 -:10DAF000013341F10001C4E90A31C776EA70D4F874 -:10DB0000403320463B44C4F840330EF026F800284A -:10DB1000C3D02046FEF766FEA777BEE7D4F84833A9 -:10DB20000133C4F84833B8E712F8011B0029BFD10C -:10DB3000304608F0F1FC08B101236377F8BD2DE908 -:10DB4000F04F456A83462C6FAA7894F8A3908A46D2 -:10DB500094F8F630D4F8F0829BB009F0FB09002A63 -:10DB600040F08C80267F0136F6B22677ABB994F868 -:10DB7000F0300BB1637F83B9B4F84A306BB994F8D5 -:10DB8000EC32B34209D094F8E13084F8393108F12D -:10DB9000FF360223C4F80032E3E02746D4F8F83217 -:10DBA00003933946284608F075FB074678B928469E -:10DBB00008F04BFB0123286700F59C70CBF82C0084 -:10DBC00028468AF8003008F0A9FB0026C9E0B7F81B -:10DBD0004A30002BE5D197F8F512B1B140F2E24E90 -:10DBE000B5F814C0686A97F8EC320EFB1C00D7F841 -:10DBF000E4C297F8EB226044009004A808F02CF9E6 -:10DC000004A907F58A7008F0BDFB97F8F412C9B1B2 -:10DC100097F8EA22A88A02F1FF3CD5F80CE00CFB49 -:10DC200000FC686A97F8EC32704440F2E24E0EFB5A -:10DC30000C0000900FA808F00FF90FA907F59070DD -:10DC400008F0A0FB039B3846013E08FB1636FFF7A1 -:10DC50006DFD01238AF80030D4F8F831C7F8F831A7 -:10DC600007F59C73CBF82C302F6797F8E03087F8D6 -:10DC70003931B9F1000F74D1013E8AE7D4F8086157 -:10DC800094F8E17013B994F8F03013B101232376BE -:10DC900006E0B4F84A30B3B12146284608F04CFB00 -:10DCA000284608F0B6FA012816D1284608F027FBC6 -:10DCB00000287FF47CAF84F83971B9F1000F3FF48C -:10DCC00066AF46464DE0237F94F8EC220133DBB289 -:10DCD0009A422377E4D1D9E72146284608F0DAFAB8 -:10DCE0000746284647B908F00AFB00287FF45FAFD3 -:10DCF00001238AF80030BCE708F001FB00287FF41C -:10DD000056AFB7F84A20002AF2D039460390284689 -:10DD100008F012FB284608F08BFA286790F8E120FB -:10DD2000039B80F8392100F59C72CBF82C2001224E -:10DD300006469A462A763146284608F0ABFA30B1B4 -:10DD4000874204D0D6F8083106469A44F3E7B9F181 -:10DD5000000F04D1022308F1FF38C4F80032A8EB09 -:10DD60000A0630461BB0BDE8F08F70472DE9F04F32 -:10DD7000456A06468BB0284608F067FA90F8A0304E -:10DD8000044673B1B5F87420D0F89C30A5F87C2017 -:10DD90000269AB67134442699B1A6B62002380F8E7 -:10DDA000A030DFF8D8B2DFF8D8924FF49563B4F81A -:10DDB0000680DBF800A003FB08F894F8D8320AEBE1 -:10DDC000080783B994F86E2322B1204684F86E3395 -:10DDD00008F0CCFC94F810312BB10023204684F8D5 -:10DDE000103108F05FFD637E012B06D01AF8083071 -:10DDF0001BB199F80030012B17D1204608F0F2FA38 -:10DE000099F8003053B9E27E002A00F0AA80162269 -:10DE1000E376E27700212046F7F74CFB0023637698 -:10DE20002B7813B1EB7D013BEB752146284608F0BA -:10DE300031FA04460028B8D1EB7D002B00F01A819E -:10DE4000284608F002FA4FF495690446DFF834A238 -:10DE5000002C40F08E80284608F0F7F96B7E012BED -:10DE600007D100F59C73F362286790F8E03080F8E2 -:10DE70003931B5F87480B5F87C30A8EB03081FFA87 -:10DE800088F8B5F87430B5F814A00133A5F87430EB -:10DE900040F2E24303FB0AFA08F101081FFA88F88E -:10DEA000B5F87E100AFB08F002F07EFB814628469A -:10DEB00008F0BEF904464FEA5A030393002C40F0E1 -:10DEC000E780284608F0C1F940F2E243AA8A416996 -:10DED0005A436B6A824613446B62A3EB09030B44FB -:10DEE00001695B1AD0F8F01272612A6F49444FEA57 -:10DEF0004900B360F160C2F800026A7E012A04D1D1 -:10DF0000EA696C761344B360EC6197F88533304668 -:10DF1000A3F10B02534253415B4933761CF0E0FB03 -:10DF2000002840F04281706AFFF7ACFCBAF84A3032 -:10DF30007BB9BAF80E3050460133AAF80E30FFF71D -:10DF400038FD5046FFF7E4FCBAF80E30013BAAF862 -:10DF50000E305146284608F09DF982460028E5D14A -:10DF60008FE71AF80830002B7FF454AF3B7CE3773F -:10DF700050E7E388DBF8007009FB0377B4F84A3018 -:10DF80002BB12146284608F085F9044660E7204673 -:10DF9000FFF70FFD2046FFF7BBFC94F8D83283B99A -:10DFA00094F86E2322B1204684F86E3308F0DEFB2D -:10DFB00094F810312BB10023204684F8103108F07A -:10DFC00071FC94F8CA2294F8A130002A38D13BB3EE -:10DFD000B4F8C81204F52E701DF035FA012384F848 -:10DFE000CA3294F8CB3293B1284BD3F80080B8F101 -:10DFF000000F0CD0A37A03BB94F8D4120122DAF8F4 -:10E000000030384693F9283000920022C0470021A2 -:10E0100020466269F7F77EFA6E212046F7F700FB8B -:10E0200094F8FC32ABB1E08808F07CFA0028A8D064 -:10E0300004212046F7F7F4FAA3E794F8D512DDE7B8 -:10E04000002BEDD0B4F8C81204F52E701DF0FBF9CA -:10E05000E6E7E389062BE6D16E212046F7F7E0FAE2 -:10E060002046F7F701FB05212046F7F7C3FAEB7DC1 -:10E07000012BD8D10BB0BDE8F08F00BFB43A00211E -:10E08000000D0021DC4D0021615F01019C3A00215F -:10E090004FF49562E388DBF8007002FB0377B4F875 -:10E0A0004A20002A7DD1E18904F1A80A013189B210 -:10E0B0000123E18150461BF0D9F984F8390184F835 -:10E0C000E00050461BF01FFA94F8183384F8E10082 -:10E0D000002B4DD194F8D532032B5AD194F8462118 -:10E0E000013A18BF01229B1A3B4493F8503284F83E -:10E0F0003A3194F8D832012B1FD194F86033E3B150 -:10E100000EF020F88246C0B10146B4F8302104F583 -:10E1100056700DF049FF0023ADF81E008DF8133046 -:10E120001CF030FF274A1378013B13701CF036FFB8 -:10E130005246204604A90DF04DFC94F8EC32022B17 -:10E140002BD81CF039F9952825D91CF035F9039BFB -:10E15000181A484506D805212046F7F74BFAEB7DFB -:10E16000012B87D02146284608F094F80446A5E6FE -:10E17000D4F8E4A2B368D4F81C239B1A5345A9D35E -:10E18000204608F0C3FAD4F81C335344C4F81C33B7 -:10E19000F0E70122A7E79620D9E7D4F8F0324B4503 -:10E1A000D8E7013AA4F84A20DCE7074B93F8473058 -:10E1B000002B3FF45FAF0021287A0BB0BDE8F04F91 -:10E1C0000DF00CBADC5000212050002110B504469F -:10E1D000406AFFF757FB2046BDE81040FFF7C6BD79 -:10E1E000436A1B6FD3F8143113B11A7901321A71D3 -:10E1F00070470000F8B50E464FF495611546476A22 -:10E20000574B3C6F1B68E28884F8A35001FB023334 -:10E21000D4F8202122B111790131117100215170FE -:10E22000D4F81411002201B10A70032DA4F80C21B6 -:10E23000A27784F86E2310D0C26A022D92F8C4200F -:10E2400084F8EC2009D130460DF00EFD2046FFF792 -:10E2500006FC2046FFF78EFA6DE0D3F8182422F072 -:10E260007F4222F0FF02B2F5803F0BD194F9EC100F -:10E27000D3F84824521AC3F8482493F845240132AD -:10E2800083F8452494F8A02025F0040313432CD1EF -:10E29000227FD4F8F012D4F8F43101FB1233C4F821 -:10E2A0009C30012384F8A030FDB984F8FC320123AE -:10E2B00084F8A130002384F8A230314604F1F30041 -:10E2C00010F03BFB062D3FD194F8F53094F8EE208A -:10E2D0005340DB0738D429462046F7F78BF9304600 -:10E2E0000DF0C2FC1CF036F8B0E7042DE5D801A310 -:10E2F00053F825F0AFE2000141E30001BBE2000169 -:10E3000041E3000109E30001D4F84C330133C4F8C0 -:10E310004C330023A4F80C3131462046FEF76AFB4B -:10E320002046FFF79CFB2046FFF724FA01222946EE -:10E330003846FEF78FFA2046BDE8F840FEF781BA6E -:10E340000023A4F80C317EE72046FEF701FA84F89A -:10E350000C012046FEF756FA84F80D01DCE700BFF9 -:10E36000B43A00210023F0B5456A99B02C6F2B76A2 -:10E3700094F8F512A9B140F2E247D4F8E462686A71 -:10E3800094F8EC323044AE8A94F8EB2207FB160086 -:10E39000009002A807F060FD02A904F58A7007F05A -:10E3A000F1FF94F8F412B1B194F8EA22A88A561E4B -:10E3B0004643686AED6894F8EC32284440F2E2453E -:10E3C00005FB060000900DA807F046FD0DA904F519 -:10E3D000907007F0D7FF2046FFF7A8F9FFF734FA4F -:10E3E00019B0F0BD436A186FFFF72EBA436A10B533 -:10E3F0001C6F04F1A8001BF086F884F8E10010BD42 -:10E40000F0B50B78064699B0F3B1456AAF78012FA5 -:10E410001AD12846296F07F03DFF0446B8B92846AF -:10E4200007F006FF00F59C732F76F362286790F8DB -:10E43000E130027F80F8393190F8EC329A4203D80B -:10E4400000213046FFF7D2FF002019B0F0BD2B7E2F -:10E45000002B36D190F8F512A9B140F2E24CAF8A08 -:10E4600090F8EC3290F8EB22686A0CFB1700D4F8B5 -:10E47000E4723844009002A807F0EEFC02A904F50B -:10E480008A7007F07FFF94F8F412B9B194F8EA2289 -:10E49000A88A571ED5F80CC04743686A94F8EC3236 -:10E4A000604440F2E24C0CFB070000900DA807F01E -:10E4B000D3FC0DA904F5907007F064FF2046FFF728 -:10E4C00035F904F59C73F3622B7E2C6723B994F81D -:10E4D000E03084F83931B7E794F8E130227F84F8EE -:10E4E000393194F8EC32A9E770B590F85C12044623 -:10E4F000A9B9284B1B6893B11B6983B1264A1068E0 -:10E50000264A201AC010504380B2984708B1002014 -:10E5100070BDB4F84603BDE870400BF061B994F8E3 -:10E52000552294F85E02504010F00103EFD1B4F888 -:10E53000460394F86152061DB54203DD013284F8AA -:10E540005522E4E71DB301390229F7D8144D6B7841 -:10E55000002BDCD00BF044F90028D8D06B78013BBD -:10E560006B70104B1B6863B194F8A5304BB194F8F5 -:10E57000A73033B9D4E9B632013342F10002C4E91D -:10E58000B63294F85532013384F85532C0E7284644 -:10E59000F7E700BFB83A0021B43A0021BDCAE28CC7 -:10E5A000B4500021A03A0021002310B580F8593260 -:10E5B00004460BF097F878B1084B1B6863B194F8E8 -:10E5C000A4304BB194F8A73033B9D4E9B432013355 -:10E5D00042F10002C4E9B43210BD00BFA43A0021E8 -:10E5E00010B590F8562290F85D32534013F00104B4 -:10E5F00011D090F85932013280F856226BB190F860 -:10E600005432032B05D190F87E3213B1013B80F8D0 -:10E610007E32FFF7C9FF204610BD80F87F32FAE74F -:10E620000BF088B870B504460E468AB031B990F840 -:10E630005F321BB990F85702104350D0FF23204699 -:10E6400084F854320DF1070204A90AF0F1FF94F89E -:10E650007F320546002B69D1002867D09DF807302E -:10E66000002B3ED1A268910702F0020303D5A378E4 -:10E670005A1E53425341DBB2059984F857328DF844 -:10E6800007304B7884F859320B7803F0030384F891 -:10E69000543243BB444B1B682BB39B681BB3434AA8 -:10E6A0001068434A201AC010504380B29847059B17 -:10E6B0001878404BC0F340101B68861C3BB194F89F -:10E6C000A42022B194F8A72042B3012A2AD004A89A -:10E6D0002946F4F7A3F8059B5878304480B20AB075 -:10E6E00070BD0123C7E70B7803F0E3030B7094F8C8 -:10E6F0005522920002F0040213435BB20B7094F8AF -:10E700005622D20002F0080213430B7094F85722ED -:10E71000120102F0100213430B70C8E7D4E9B401F0 -:10E720009847D4E70021B4F80602F9E72EB3003D7C -:10E7300018BF0125002384F85752012584F8593267 -:10E7400004F515711C4884F854520FF06BFB1B4AFA -:10E7500002AB92E8030083E8030018462946F4F769 -:10E760005DF894F87F32BDF80800B3FA83F35B09D3 -:10E7700084F8803284F87F52B1E794F85C32002B41 -:10E78000D5D1094B1B68002BD1D0DB68002BCED034 -:10E79000064A1068064A201AC010504380B29847B3 -:10E7A0000028C4D130469AE7B83A0021B43A002193 -:10E7B000BDCAE28CA43A0021540C0021FC240301C0 -:10E7C00070B504461E4608461546FAB1194BB4F812 -:10E7D00006121A68184BA21AD2105A4392B20BF0C2 -:10E7E0000BF806B3154B1B683BB194F8A52022B17A -:10E7F00094F8A7206AB1012A0FD0B4F8461328462E -:10E80000BDE87040063189B2F4F73EB84BB10D4611 -:10E81000E8E7D4E9B6019847EFE70021B4F806022B -:10E82000F9E729B10D462846BDE870400AF0E0BF7F -:10E8300070BD00BFB43A0021BDCAE28CA03A0021ED -:10E840002DE9F843836806465B070F46144625D436 -:10E850001EF032FC81461BF0AFFD40F2E2458046DF -:10E86000B369B6F80A0245435BB1394698681BF0B4 -:10E87000A9FDA84205D8B369394698681BF0A2FDE6 -:10E880000546394648461BF09DFD963444440444F1 -:10E89000AC4294BF00200120BDE8F8830020FBE7D4 -:10E8A0004378032B11D190F87F332BB190F880037C -:10E8B000003818BF0120704790F876333BB1D0F88C -:10E8C0006C02B0FA80F040097047002070470120C8 -:10E8D0007047000070B5446A2046FFF7E1FF18B1A9 -:10E8E000BDE870401BF036BD224B1B684BB19B69E5 -:10E8F0003BB1214A1068214A201AC010504380B20F -:10E900009847002101221E4B84F85F12198084F879 -:10E91000611284F85C22204659809980D980FFF7E3 -:10E9200081FE1BF021FD064610BBB4F846030AF039 -:10E9300057FF05460028D3D0124B1B683BB194F813 -:10E94000A52022B194F8A72052B1012A0CD0B4F826 -:10E9500046132846BDE87040063189B2F3F794BFEC -:10E96000D4E9B6019847F2E73146B4F80602F9E770 -:10E9700070BD00BFB83A0021B43A0021BDCAE28C94 -:10E98000580C0021A03A0021436A93F87F222AB153 -:10E9900093F8802212B1002283F87F227047000092 -:10E9A0002DE9F04F446A064694F89432C76A4E4DFA -:10E9B00085B0002B78D12B88002B75D0237CB4F840 -:10E9C00082123E2B08BF082304F5217008BF237470 -:10E9D0001CF039FD454B9B69D80503F4807112D4B6 -:10E9E000D4F8182422F07F4222F0FF02B2F5803FD3 -:10E9F00009D103F400430B4305D04FF47A7104F2BC -:10EA000004401CF020FD012384F8943297F8A830CC -:10EA100084F80C3294F81A34012B0BD194F80D328F -:10EA200013B1802384F80C3294F81934002B49D0A8 -:10EA3000012B54D0D4F83C343BB12D4A10682D4AF8 -:10EA4000201AC010504380B2984794F894226B78F3 -:10EA5000134319D194F89632013BDBB284F8963215 -:10EA600093B904201CF0D6FA014668B1204B214A24 -:10EA70001B68E31ADB105343038044F201734380A5 -:10EA80001D4B187B1CF0D7FA2046FFF709FF002822 -:10EA900036D020464C210AF043F804F5217005B029 -:10EAA000BDE8F04F1CF0D5BC6B78002BAED0B4F8AD -:10EAB000821204F521701CF0C6FCB4F80632A4F8EA -:10EAC0000832A3E7D4F8203494F90C229B1AC4F836 -:10EAD000203494F81E34013384F81E34AAE7074B1F -:10EAE00020461B689847A5E7580C002120500021BC -:10EAF000B43A0021BDCAE28C68500021803A00215E -:10EB0000954BDFF858921B68002B00F00C81E888C9 -:10EB10006A88A988003A014418BF0122204689B2B8 -:10EB20009847054660B1B4F80632411E0344A4F884 -:10EB3000063294F84532204659F8233089B2984776 -:10EB400094F8C8317BB30C200AF05CFD804650B3CA -:10EB50000023B4F80422B4F85E04D11DB4F80622F0 -:10EB600084F8C83101FB0022A4F8AA237C4A184685 -:10EB700011687C4A611AC91051430093B268C9B246 -:10EB80001BF0F0F9784B04F56871A0FB0330DB0F44 -:10EB900043EA4003A4F8A23340460FF06DF9414622 -:10EBA00020460AF005FD94F8F4332BB3B4F806229E -:10EBB000B4F8FA339A421FD394F87633E3B90420B9 -:10EBC0001CF028FA014668B1654B664A1B68E31AD7 -:10EBD000DB105343038046F601534380634B187B9D -:10EBE0001CF029FAB4F8F633002B00F09E80B4F83C -:10EBF00006221344A4F8FA3394F8693363B100236E -:10EC000084F8693394F86A33002B40F09180584BB4 -:10EC10001B680BB120469847B3680293FB7B0BB986 -:10EC200097F8A930BB733B7B032B0AD1FB68514992 -:10EC300003F0FF138B420CBF2246621E92F8533240 -:10EC4000BB704FF0030A40F2E24CB4F80A8201357F -:10EC5000ADB208FB05F20CFB02F2B4F806320299E1 -:10EC600001339BB21144A4F80632B160726194F88A -:10EC700085B3BBF10B0F5DD100223276B4F8AA2325 -:10EC80009A423FD1B4F8A633B4F80422B4F8A2E310 -:10EC9000A4F80432E369B4F8A4130CFB0E33E36167 -:10ECA00018F0030318BF0123A4F80A120CFB01F1AA -:10ECB000B4F8A803616200EB8000400008EB980103 -:10ECC00080B21944B4F882B20144A4F8820204F577 -:10ECD000217003921CF0B7FBB4F80A32039A434543 -:10ECE00007D1B4F80432934203D1B4F882325B45C1 -:10ECF00005D0D4F8883343F40063C4F88833012383 -:10ED000084F87E3394F845320021204659F82330A8 -:10ED100098471949787030461BF0E2FC002892D0E1 -:10ED200005B0BDE8F08F1D460AE784F8F43363E7C9 -:10ED3000124B6DE701229345327621D1B4F8D023EE -:10ED40009A42DFD1D4E9F2232046C4E9862309F0B0 -:10ED500092FD84F87EB3D5E7083A00210C3A0021F1 -:10ED6000B43A0021BDCAE28CE3361A006850002193 -:10ED7000943A002103000100698D0101903A0021BD -:10ED8000BBF10F0FBED1B4F8DC239A42BAD194F88C -:10ED90005430022B03D0032B14BF0123042394F817 -:10EDA0005580B8F1020F06D0B8F1030F14BF4FF031 -:10EDB00001084FF0040894F8DA13A9B3994233D04C -:10EDC00002294FF0010360D0042955D0194684F878 -:10EDD0005430CB1A234493F95002D4F888337E2858 -:10EDE00043F400430A4684F84A00C4F888331BD130 -:10EDF000274B22441B68032993F9283084F84A30B2 -:10EE000082F84F32D4F8342308BF84F853325207C3 -:10EE10000AD5204AD2F800B0BBF1000F04D001227D -:10EE2000204600920022D84794F8DB337BB143455B -:10EE30000DD0022B03D0042B14BF0123032384F82D -:10EE40005530D4F8883343F40043C4F888330123A1 -:10EE500004F24E3184F87E3320460AF0C2FA04F2FE -:10EE60004631A4F8600320460AF0BBFAB4F86033D8 -:10EE7000A4F85E03236245E794F856300321013B72 -:10EE800018BF012384F854A0A3E784F85410A0E726 -:10EE9000DC4D00219C3A0021436A93F87F222AB17D -:10EEA00093F8802212B1002283F87F225B7823B18D -:10EEB0000022024B1A80FFF773BD7047580C0021E7 -:10EEC00051B90122436A83F8802393F859321BB168 -:10EED000024A938801339380704700BF580C002189 -:10EEE0002DE9F14F446A814694F87E330F46164669 -:10EEF00084F80D22ABB1002384F87E3394F8853377 -:10EF0000012B0AD1574B1A683AB1574B57481B6827 -:10EF1000E31ADB10584380B290476E21204609F077 -:10EF2000FFFD022E05D1384601B0BDE8F04F0AF0D2 -:10EF30005FBC2046FFF7B4FC054618B906F0FD0398 -:10EF4000012B02D11BF006FAEDE7C6B94FF480722F -:10EF5000474B1A80394604F517700EF0BDFF062E98 -:10EF600017F800B02DD194F85E3294F85522534032 -:10EF7000DB0726D44821204609F0D2FDE2E7042E23 -:10EF8000E8D13B4A13780133DBB2012B1370D9D897 -:10EF90008046D4E90232DB0843EA427383F001027F -:10EFA00002F001025FFA82FA3146204682F0010245 -:10EFB000FFF738FBE0B11BF0D7F9B0FA80F56D0927 -:10EFC00030E094F861321BB1294AD3880133D380F1 -:10EFD0002046FFF789FA80462046FFF701FBB4F888 -:10EFE00060238246D9F808102046FFF729FC10B1AB -:10EFF0001BF0B0F916E086BB94F85C32032B2CD1E1 -:10F00000BBF1050F29D194F87633012B25D194F863 -:10F0100085330D2B21D1204611F0E6FCE8B11BF021 -:10F0200099F93546124A20465388BAF1000F18BFA5 -:10F0300001335380FFF7F4FA94F85C324246032B15 -:10F0400008BF0023394608BF84F8803320462B468A -:10F0500001B0BDE8F04FFFF7B3BBBAF1000F98D095 -:10F0600001229FE7EC4D0021B43A0021BDCAE28C99 -:10F07000580C0021B0F806222DE9F8430446B0F8F8 -:10F08000CA51B0F80A92B0F80482B0F8827240F225 -:10F09000E240013292B2531B9BB209FB03F343439C -:10F0A000D4F8D001A4F8CA211844C4F8D001B4F8A7 -:10F0B000AA03A84218BFC4F8D431B4F8A433A4F802 -:10F0C0000A32B4F8A633A4F80432B4F8A83303EB38 -:10F0D00083035B00A4F8823209BB40F2E243B4F838 -:10F0E000A26394F8A0535E435D43B4F8C81170194D -:10F0F00001F05AFAD4F8D031C4F8CC513344C4F8F2 -:10F10000D031E3691E44236A361A03442362D4F8DB -:10F11000E030E6611D4405EB4005C4F8E05019F00D -:10F12000030118BF012109EB99030B44B4F88212C3 -:10F1300004F5217019441CF086F9B4F80A324B45E5 -:10F1400007D1B4F80432434503D1B4F88232BB424C -:10F1500005D0D4F8883343F40063C4F8883301231E -:10F1600084F87E33002384F8D831BDE8F8834378EF -:10F17000032B11D190F87F332BB190F88003003826 -:10F1800018BF0120704790F876333BB1D0F86C027D -:10F19000B0FA80F0400970470020704701207047A6 -:10F1A00070B5446A2046FFF7E2FF18B1BDE8704031 -:10F1B0001BF0D0B81C4B1B684BB19B693BB11B4A81 -:10F1C00010681B4A201AC010504380B2984700258F -:10F1D000184BB4F84603A4F8DA5184F8DC51C4F8AB -:10F1E000E0511D805D800AF0FBFA06460028DDD064 -:10F1F000114B1B683BB194F8A52022B194F8A720CD -:10F2000052B1012A0CD0B4F846133046BDE8704024 -:10F21000063189B2F3F738BBD4E9B6019847F2E773 -:10F220002946B4F80602F9E7B83A0021B43A0021B9 -:10F23000BDCAE28C600C0021A03A0021704700009A -:10F240002DE9F74F446A064694F8D931C76A83B36B -:10F250001DF032FF05460146B068B4F80A821BF083 -:10F26000B1F818B340F2E2432946B06803FB08F84E -:10F270001BF0A8F8804519D22946B0681BF0A2F807 -:10F28000414619F0FDFFB4F806321B1AA4F8063205 -:10F2900094F8453253B994F80F3294F80E22434350 -:10F2A0009A42D9B279D3521A84F80E22002384F8F4 -:10F2B000D93197F8B03084F80C3294F81A34012B15 -:10F2C0000BD194F80D3213B1802384F80C3294F8EA -:10F2D0001934002B73D0012B7ED094F8DB317BB135 -:10F2E000D4F8E031C4F8D031B4F806320133A4F8D0 -:10F2F000CA31002384F89532C4F8CC31C4F8D43133 -:10F3000094F8942294F8DC31002A6AD113B994F865 -:10F31000DA313BB3237CB4F882123E2B08BF0823BA -:10F3200004F5217008BF23741CF08DF8314B9B69E4 -:10F33000DD0503F4807112D4D4F8182422F07F4242 -:10F3400022F0FF02B2F5803F09D103F400430B43E2 -:10F3500005D04FF47A7104F204401CF074F80123D4 -:10F3600084F89432D4F83C343BB1234A1068234AE1 -:10F37000201AC010504380B298472046FFF7F7FE8E -:10F3800000283FD020464C2109F0CAFB04F521702B -:10F3900003B0BDE8F04F1CF05CB89B1A2532521A3E -:10F3A000252BD2B280D94DF668514B435B0D03EB50 -:10F3B000C30103EB8103134484F80E3276E7D4F8DB -:10F3C000203494F90C229B1AC4F8203494F81E348B -:10F3D000013384F81E3480E7094B20461B689847A8 -:10F3E0007BE7002BBED0B4F8821204F521701CF02C -:10F3F0002AF8B7E720500021B43A0021BDCAE28CB8 -:10F40000803A0021B84B1B684BB1DB693BB1B74A6E -:10F410001068B74A201AC010504380B29847B4F819 -:10F420008233B3F5807F06D101234021204684F842 -:10F43000823309F075FB94F8693363B1002384F8D3 -:10F44000693394F86A33002B40F08381A94B1B6821 -:10F450000BB12046984794F885330B2B0DD12046ED -:10F4600011F049F948B1B4F80622B4F8AA339A4227 -:10F4700003D101212046FFF7FDFD94F84533002B11 -:10F4800049D0D4F8F031002B45D0D4F8E411B0685D -:10F490001AF098FFD4F8E83198423CD9D4F8F0112A -:10F4A000B0681AF08FFFD4F8EC31984230D2B368CC -:10F4B0002A20C4F8E4311BF0ADFD014640B38B4B6C -:10F4C0008B4A1B68DFF830E2E31ADB1053430380FA -:10F4D00046F601330022438000F1040CC2F12005FE -:10F4E000DEE90E38A2F12000D34008FA05F528FA2B -:10F4F00000F02B430343D80754BF032300230132FA -:10F50000252A0CF8013BE9D17C4B187B1BF093FDBD -:10F510000023C4F8F03194F8F4332BB3B4F8FA2391 -:10F52000B4F806329A421FD894F87633E3B904202F -:10F530001BF070FD014668B16C4B6D4A1B68E31A05 -:10F54000DB105343038046F6015343806B4B187B1B -:10F550001BF071FDB4F8F633002B00F0FC80B4F81A -:10F5600006221344A4F8FA33B4F80682B4F8CA3178 -:10F5700008F10108A8EB0308614B1FFA88F81D6821 -:10F58000002D40F0EB80B4F8049294F8D9319BBB85 -:10F59000E368D90030D5B4F804326BB394F88834FA -:10F5A00053BB94F8D8313BB394F8DC3123B304F562 -:10F5B0001B701BF0EFFEF8B16378032B1CD094F89E -:10F5C0008533FF2B00F0F3800B2B40F0D9802046D1 -:10F5D00011F091F8002800F0D380B4F8AA33B4F801 -:10F5E00006229B1A9DB209F10102954200F3DF80C9 -:10F5F000012B13DD023DADB285B1B4F8063294F8AB -:10F6000045222B44A4F806323E4B691EA8442046EE -:10F6100053F8223089B21FFA88F898474FF003094F -:10F6200040F2E24BB4F8063208F101080133A4F8C5 -:10F630000632B4F80A321FFA88F808FB03F3D4F84C -:10F64000D401B4F8C8110BFB030000F0ADFFB4F80F -:10F650000A5282461AF0B0FE08FB05F50BFB05F5D1 -:10F6600095284FEA550B40F2A4801AF0A5FEABEBAB -:10F67000000050457FF686AED4F8D0312B44A3EB82 -:10F680000A03B360D4F8CC31756103F59B7353441E -:10F69000F360D4F8CC0100EB4A00C7F8980094F866 -:10F6A00085530B2D40F087800023B4F80622337673 -:10F6B000B4F8AA33511C994202D1022184F8951260 -:10F6C0009A4203D100212046FFF7D4FC94F845224A -:10F6D0000C4B002153F8223020469847787094F85C -:10F6E0009532022B2BD00FE0B83A0021B43A00211A -:10F6F000BDCAE28C943A00212050002168500021BC -:10F70000083A00210C3A0021B4F80632B4F8CA21B4 -:10F7100001339B1A4FF47A7240F2E240D9B2B4F846 -:10F7200082325343B4F80A224243B3FBF2F34A1C39 -:10F73000DBB29A4240F0D780012384F895323046FC -:10F740006B491AF0CDFF00283FF46AAF03B0BDE863 -:10F75000F08F684B7BE684F8F43305E7664B0122B3 -:10F7600019885B882046194489B2A847B4F80492E6 -:10F77000B4F85E34054603FB09091FFA89F904E76A -:10F7800094F88533B4F80622012B06D194F87C3323 -:10F79000012B02D1B4F8D03323E740F60173B4F85B -:10F7A000841399427FF43AAFB4F8DC3319E74D463D -:10F7B00022E796205BE701239D4233760FD1B4F810 -:10F7C0000622B4F8D0339A4280D1D4E9F2232046FD -:10F7D000C4E9862309F04FF884F87E5376E70F2DAD -:10F7E0007FF474AFB4F80622B4F8DC339A427FF4A5 -:10F7F0006DAF94F85430022B03D0032B14BF0123B8 -:10F80000042394F85550022D03D0032D14BF012575 -:10F81000042594F8DB13A9B3994233D002294FF0A1 -:10F8200001035DD0042952D0194684F85430CB1A14 -:10F83000234493F95002D4F888337E2843F40043DC -:10F840000A4684F84A00C4F888331BD12B4B224463 -:10F850001B68032993F9283084F84A3082F84F3224 -:10F86000D4F8342308BF84F8533252070AD5244A07 -:10F87000D2F800A0BAF1000F04D001222046009275 -:10F880000022D04794F8DA337BB1AB420DD0022B83 -:10F8900003D0042B14BF0123032384F85530D4F87C -:10F8A000883343F40043C4F88833012304F24E3113 -:10F8B00084F87E33204609F094FD04F24631A4F822 -:10F8C0006003204609F08DFDA4F85E03FEE694F87F -:10F8D00056300321013B18BF012384F85490A6E75A -:10F8E00084F85410A3E79942FFF429AF022324E7D8 -:10F8F000698D0101903A0021600C0021DC4D00214E -:10F900009C3A00210023426AA2F8DA3182F8DC3105 -:10F91000C2F8E031024A13805380FFF791BC00BF68 -:10F92000600C002151B90122436A83F8802393F8C7 -:10F9300059321BB1024A138801331380704700BF4C -:10F94000600C00212DE9F047446A0F4694F87E339D -:10F95000164684F80D22ABB1002384F87E3394F868 -:10F960008533012B0AD16E4B1B683BB16D4A106881 -:10F970006D4A201AC010504380B298476E2120462D -:10F9800009F0CEF8022E04D13846BDE8F04709F060 -:10F990002FBF2046FFF7EBFB054618B906F0FD0325 -:10F9A000012B02D11AF0D6FCEEE794F8DB3163B9F3 -:10F9B00026B1A368180308D4042E06D1D4F8F43075 -:10F9C000C4F8E031012384F8DB31394604F51770BF -:10F9D0000EF082FA17F80090002E4FD1012384F820 -:10F9E000DA6184F8DC3194F861321BB14F4A5388F4 -:10F9F0000133538094F882334BB994F85C32032B73 -:10FA000005D0A3689A0544BF012384F883332046B8 -:10FA1000FEF76AFD80462046FEF7E2FD94F8D831F5 -:10FA20001BB910B1012384F8D8319EBB94F85C3225 -:10FA3000032B2FD1B9F1060F2CD194F87633012B7B -:10FA400028D194F885330D2B24D1204611F0EAF902 -:10FA500000B31AF07FFC35462046FEF7E1FD94F82E -:10FA60005C324246032B04BF002384F880333946BE -:10FA70002B462046BDE8F047FEF7A2BE042E13D168 -:10FA800094F8DA310133DBB2012B84F8DA3189D80A -:10FA90004FF00008012231462046FEF7C3FD8146A3 -:10FAA00080B91AF057FCD7E7062E9CD194F85E3245 -:10FAB00094F855225340D90795D44821204609F09F -:10FAC0002FF86FE7B4F88233B3F5807F09D1A368CC -:10FAD0009B0506D594F85432032B04BF002384F809 -:10FAE00083331AF041FC0028B6D1042E05D094F8D7 -:10FAF0005F3213B994F8575285B1494694F85400CF -:10FB0000D4F8F45019F094FEB4F860232946024466 -:10FB10002046FEF795FEB0FA80F56D09EDB29BE741 -:10FB2000EC4D0021B43A0021BDCAE28C600C0021EA -:10FB30002DE9F84F174E054696F898301BB3164A34 -:10FB4000002714684FF4956240F2E249B6F880301D -:10FB5000DFF848B002FB0344D4F81C8004F1140A17 -:10FB6000594650461AF0BCFD013760B9B4F8063268 -:10FB7000B4F80A220133A4F80632BBB2534309FB9E -:10FB80000383E361ECE728466E62BDE8F84FF8F7BF -:10FB900093BD00BFD03A0021B43A0021698D010124 -:10FBA0002DE9F04FC46A0F4694F8F40087B000289E -:10FBB00000F08B80D4F89C00002800F08680D4F8F8 -:10FBC000D430564DDFF8588103930830D4E93823F8 -:10FBD000D8F800A0B5F880B094F8F1901BF0BEF80A -:10FBE00094F8F23085F8533295F841309A0740F195 -:10FBF0008B8094F8F030012B6AD1384610F8086BEE -:10FC00001BF0A6F80B0A03F0C003402BCDE904015A -:10FC10004FEAD61673D104ABC5E91E0194F8F30080 -:10FC20000093D4E93A23F3F7ADFDDDE90423D4F8DA -:10FC30009C0002301BF092F885F852624FF49563F5 -:10FC400003FB0BAA3749D4F89C000DF001F9039B84 -:10FC5000D8F8001003EBC909AAEB0101324BC91017 -:10FC600040F2E24659430023BAF80A0209F5E56971 -:10FC70004A4670430093C9B21AF074F92B4BBAF894 -:10FC80000A12A0FB0332DB0F43EA4203B3FBF1F29B -:10FC900001FB1233D4F89C204E439375D4F89C207A -:10FCA000C3F30724D475A5F87030B0FBF6F306FB58 -:10FCB00013004844CAF81C0095F85102012828D1C5 -:10FCC0003B789B0625D585F8850007B0BDE8F08F09 -:10FCD000D4E92223CDE9042304ABD4F8846094F85A -:10FCE000F3000093D4E93A23F3F73DFD28B1DDE9B1 -:10FCF00004230126C5E91E2397E7C6F34006002228 -:10FD00000023C5E91E2390E700220023C5E91E2336 -:10FD100094E70023012085F88530D6E7D03A00210A -:10FD2000B43A0021203D0021BDCAE28CE3361A001E -:10FD3000012208B5034B83F898201AF00BFB002032 -:10FD400008BD00BFD03A00212DE9F0410446D0F8AB -:10FD5000305100F582771AF02FFB636E628BC4F886 -:10FD60000C31238B00F2CC409342C4F8100113D025 -:10FD700040F271235A43D5F8D810084490420BD270 -:10FD800038461AF073FD38B1616ED4F80C011AF0E0 -:10FD900019FBC5F8D80012E0002395F8CB1068785D -:10FDA000C5F8D83000F02CFE6870268B628B964226 -:10FDB00007D138461AF040FCD4F80C316366BDE830 -:10FDC000F08140F2712808FB06F608FB0268D4F8BF -:10FDD0000C31424633443146384663661AF046FDDC -:10FDE0000028D1D1636EC4F80C31F0E7406A036893 -:10FDF00090F8002123F07F4323F0FF036BB190F8CC -:10FE000001310133DBB280F8013112B1012B01D88D -:10FE100070472BB103210AF081BE0AB9FFF794BFE6 -:10FE20007047406A036823F07F4323F0FF0313B158 -:10FE300003210AF073BE80F80031FFF785BF000090 -:10FE40002DE9F047436A06465A7822B393F80051E9 -:10FE50000DBB134A40F2E24814684FF49562B3F8C0 -:10FE60006030DFF840A002FB0344E76904F11409A5 -:10FE7000514648461AF034FC013560B9B4F80632F0 -:10FE8000B4F80A220133A4F80632ABB2534308FB9C -:10FE90000373E361ECE73046BDE8F047FFF7A6BF28 -:10FEA000B43A0021698D01012DE9F047436A054606 -:10FEB0005A7812B3134A002614684FF4956240F240 -:10FEC000E248B3F86030DFF840A002FB0344E76982 -:10FED00004F11409514648461AF002FC013660B993 -:10FEE000B4F80632B4F80A220133A4F80632B3B2E9 -:10FEF000534308FB0373E361ECE72846BDE8F04792 -:10FF0000FFF78FBFB43A0021698D0101012208B5C6 -:10FF1000436A5A701AF01EFA002008BD2DE9F04F0E -:10FF2000C46A456A94F8F120DFF8749187B0884676 -:10FF3000607B94F8CD100232D9F800A0B5F860B01B -:10FF4000D4F8D46019F087FC039094F8F4000028EA -:10FF500000F08280D4F89C0000287DD0D4E93823BA -:10FF600008301AF0FBFE94F8F23085F8D33095F89B -:10FF70006B309B0740F18F8094F8F030012B6ED1ED -:10FF8000404610F8087B1AF0E3FECDE90401C5E90C -:10FF90001601090A01F0C00140294FEAD71707D11D -:10FFA00004AB94F8F3000093D4E93A23F3F7EAFBA7 -:10FFB000DDE90423D4F89C0002301AF0CFFE85F866 -:10FFC000D2704FF4956303FB0BAA364B05F1D001B9 -:10FFD0009B6A0027C3F3803385F8D130D4F89C00A6 -:10FFE0000CF036FF40F2E24C039BD9F8001006F506 -:10FFF000DB661E44AAEB01012B4BC9105943B5F82F -:020000040101F8 -:1000000062003B4600973246C9B20CFB00F019F083 -:10001000A9FF2649A0FB0113C90F41EA4301D4F807 -:100020009C3030449975D4F89C30C1F30722DA75BE -:10003000A5F85010CAF81C00012095F8D130012B0A -:1000400004BF98F80070C7F3401785F86970237BE8 -:1000500085F8680085F86C3007B0BDE8F08FD4E90A -:100060002223CDE9042304ABD4F8847094F8F30080 -:100070000093D4E93A23F3F776FB28B1DDE90423B2 -:100080000127C5E9162393E700220023C7F34007A1 -:10009000C5E916238CE700220023C5E9162390E763 -:1000A000B43A002120500021BDCAE28CE3361A0088 -:1000B00037B5044668460D460CF056FF9DF80030F3 -:1000C000072B05D029462046FFF728FF03B030BD97 -:1000D0000020FBE7F0B587B0C46A456A064602A86F -:1000E0000F460CF041FF9DF80830072B36D1002356 -:1000F000BA1C85F8A2300DF1070105F1A0000CF043 -:1001000021FD9DF80730DB0628D5D5F8C41004A8DA -:100110000CF072FD9DF81630012B1AD0022B1FD067 -:100120000023F36094F8F12094F8CD100232607B44 -:10013000D4F8D46019F08FFBD4F8D420331804A974 -:10014000284601F06DF995F800313BB11AF002F93B -:1001500004E0064B9B6A13F4807FE1D107B0F0BD49 -:10016000024B9B6A13F4006FF7E700BF2050002199 -:100170002DE9F0478EB0446AC56A074604A80E46CA -:100180000CF0F2FE0DF10F01321804F1A0000CF09A -:10019000D9FC94F8A130D90704D4002630460EB01B -:1001A000BDE8F0879DF80F6016F00106F5D09DF8C8 -:1001B0001030F96A8DF8303094F8A23080318DF823 -:1001C0003130D4E92A23CDE908239DF8123008A85C -:1001D0008DF83230D4E92C23CDE90A239DF8133071 -:1001E00000228DF8333005F1C803F2F7DDFF002857 -:1001F000D3D095F8DC30002BCFD0D5F89830002B39 -:10020000CBD04FF49562DFF85CA1B4F86030DAF837 -:10021000007095F8BA1002FB03779DF81420687BF4 -:100220000232D5F8C09019F016FBE97B804609F13F -:100230009609287B09B995F8BA10242219F00BFB0E -:10024000D5E93223C1448144D5F8980008301AF02A -:1002500085FD95F8DA3084F8D33094F86B309A073E -:100260007AD59DF80F309B075AD5D4E92C131A0A7A -:1002700002F0C002402ACDE906139DF8138009D18F -:10028000C4E9161306AB95F8DB000093D5E93423D7 -:10029000F3F778FADDE90623D5F8980002301AF072 -:1002A0005DFD84F8D28004F1D00104F178000CF0F7 -:1002B000CFFD6B7B40F2E248032B0CBF03220222EE -:1002C000DAF80010284B791AC9105943002308FBAB -:1002D0000299B7F80A024A4608FB00F00093C9B237 -:1002E00019F040FE214BB7F80A22A0FB0331DB0FC7 -:1002F00043EA4103B3FBF2F108FB02F802FB1133BE -:10030000A4F88E30B0FBF8F308FB13004844F86102 -:100310002B7B84F86C304FF48073A4F868303DE791 -:10032000D5E92223CDE9062306ABD5F8848095F8DC -:10033000DB000093D5E93423F3F715FA28B1DDE9A2 -:100340000623B046C4E91623A4E700220023C8F31D -:100350004008C4E916239DE700220023C4E91623C0 -:10036000A1E700BFB43A0021BDCAE28CE3361A000F -:10037000F0B505460E468BB079B3446AC76A02A849 -:100380000CF0F2FD0DF10701321804F1A0000CF0A1 -:10039000D9FB9DF80830E96A8DF8203094F8A23036 -:1003A00080318DF82130D4E92A23CDE904239DF84A -:1003B0000A3004A88DF82230D4E92C23CDE9062395 -:1003C0009DF80B3001228DF8233007F1C803F2F7B6 -:1003D000EBFE0123637019F0BDFF00200BB0F0BDF0 -:1003E000314B2DE97043D3E9024618695D682F4B04 -:1003F00068B94FF000084FF00009C3E90E8924B135 -:100400009A6BFDB942F030029A63BDE87083002C0C -:100410003ED00FF28C09D9E90089C3E90E89002D7D -:10042000EDD0D3E90E2142F0005242F08C029A63E3 -:100430001F4A126892F82220012A84BF41F4E07119 -:10044000D963DCE742F0706141F0700199631849AB -:10045000096891F82240012C82BF42F0F85242F024 -:1004600070029A631EB19A6B42F440029A630028AC -:10047000CBD0D3E90E21012C42F47F1242F440622A -:10048000C2D941F40F7141F00301C3E90E21BCE769 -:100490004FF003084FF00009BFE700BFAFF3008043 -:1004A000033300C000000000B00C002168500021A0 -:1004B000DC4D00210B4BD3E90801CA0542BF5A6C41 -:1004C00042F400725A648A0642BF5A6C42F04002FB -:1004D0005A6410F0704F1EBF5A6C42F001025A6409 -:1004E000704700BF6850002173B583781D4AFF2B09 -:1004F00004461D4E106025D056F8233003B19847AE -:100500001A4D2B78E3B11A4B5B7ACBB9F3F77EFC2B -:100510000124F3F779F81AF06BFB18F009FF154E78 -:1005200056F8243003B198470134142CF8D1002335 -:1005300001932B70012301A88DF8063018F0A8FE56 -:1005400002B070BDC37813B90122084B1A7001259F -:1005500056F825300BB1204698470135142DF7D1B8 -:10056000CEE700BF540D0021B00C0021000D00218A -:1005700020500021040D0021024B53F8203003B11C -:1005800018477047780C0021002307B58DF8030049 -:100590008DF804006846ADF800308DF8023018F090 -:1005A00077FE03B05DF804FB0D4BDA6902F00063DF -:1005B000120113D541F2C702A0FB0110A1FB0213E7 -:1005C00002FB003046F6F963C918064B40F1010101 -:1005D0001B6893F82900103008447047184670478C -:1005E00020500021DC4D002108B518F01EFE094BFB -:1005F00020F07C42C00E1B5C42EA0363D2074BBF73 -:10060000054A064A064807484CBF1A401A4010439C -:1006100008BD00BF24250301F1FD7EFFCEF7FBFDE1 -:10062000310804020E02810008B5FFF7DDFF064A1B -:1006300020F4FF03C00E105C43EAC03020F00070CD -:1006400040F4000008BD00BF04250301094970B54E -:1006500000220D46084C2378934204D85A1C22707D -:1006600045F8230070BD51F8046B8642FAD0013280 -:10067000F2E700BF680C0021640C00212DE9F8436B -:10068000002705460E463C460D4BDFF83880C3E98F -:100690000E01DFF8349099F80030BB4202D82046B2 -:1006A000BDE8F88328463146D8F800302CB9984781 -:1006B0000446013708F10408EDE79847F9E700BF61 -:1006C00020500021680C0021640C002190F90030BA -:1006D00090F901201A4490F9023090F90300134474 -:1006E000184440F3870070470379032BC1540EBFB1 -:1006F00000230133DBB20371437901334371704747 -:10070000022805D0032808D0431E5842584170479C -:10071000044B986AC0F300207047024B986AC0F3FC -:10072000C020704720500021054B9B6ADA054CBF62 -:10073000032001201B0548BF40F00400704700BFA4 -:1007400020500021C0780EF00DB9000070B588B0BF -:1007500005460C460146684616460CF005FC9DF819 -:100760000430063BDBB21F2B01D9002042E09DF88C -:10077000002005F10801062AF7D801A050F822F060 -:100780009D070101A3070101F90701016B070101A1 -:10079000FD0701016B070101010801010022A2729E -:1007A00002E00123A37200236160237295F82730D1 -:1007B000012263722846134902ABF2F707FC0028B6 -:1007C000D3D0DDE904239DF81B109DF81A00884260 -:1007D00005D1DDE90250984208BF954201D041F0B1 -:1007E000020104F10C00E1721AF0B8FA01209DF840 -:1007F0001D30337008B070BD0322D0E70422CEE76D -:100800000222CCE7A80E002138B504460025D0F816 -:100810006801C4F8685108B11AF004FCD4F87001FA -:10082000C4F8705118B1BDE838401AF0FBBB38BDB0 -:10083000C20707D4830707D410F0040F0CBF25208C -:100840002720704725207047262070477FB55E4CD3 -:100850002C22002104F19C0020F0BFFD04F1D00304 -:100860004FF4C0720021184620F0B7FD574BC4F872 -:10087000C800C4E92E33564BC4F8C040C4F8B430A5 -:10088000022384F8D030534B534D197A0846FFF7B2 -:10089000CFFF95F8303084F8D10084F8D2304F483B -:1008A0004F4B5722C4E9350340F20113A4F8DC3062 -:1008B00094F84230A4F85021DE0748BFA4F8522132 -:1008C0009A0748BF20234FF02D0648BFC4F8543183 -:1008D000444B3046C4F87831434B84F89B11C4F83C -:1008E0007C31424B84F89A61C4F88031404BC4F8A3 -:1008F00084311AF08FFB94F84030C4F86801012B62 -:1009000004D130461AF086FBC4F8700194F84130E7 -:10091000DB0750D5D5E90823D4F85411C4E9562390 -:1009200041F00201C4F85411D4F8543143F00102EB -:10093000C4F8542195F831201AB143F05103C4F89A -:10094000543194F84030012B4FF0000339D1CDE9F8 -:100950000233032384F850320C2384F85432D4F841 -:1009600054316946C3F34003224884F85232D4E933 -:100970005623CDE900230CF099FA0E23C4F86C41FC -:1009800084F89931002584F8515219F015FD40F290 -:100990007122E38F00F2CC405343C4F8A8001648FC -:1009A000C4F8AC30A4F8985019F046FED4F8A4303E -:1009B000A36304B070BD114BD3E90C23C4E95623E3 -:1009C000B2E7C4F86C31DDE7580D0021B9860001AB -:1009D00003000101F850002120500021D6BE898E6D -:1009E00055555500A187000161880001418900012A -:1009F000518900015A0D0021F40D00216850002199 -:100A000059B10130C0B2282828BF2520A0F1250304 -:100A100041FA03F3DB07F4D5704725207047F0B5A2 -:100A20008BB004460F4616460021232268461D4619 -:100A300020F0D3FC05238DF80230FF238DF82330FE -:100A40004FF6FF733246ADF824300DF10A002B4605 -:100A50008DF803408DF804408DF809701AF07EF986 -:100A6000684618F015FC0BB0F0BD38B504460D46CD -:100A70004822002120F0B1FC84F8405038BD10B568 -:100A80009DF8084001F0030104F0070443EA8443A1 -:100A900043EA0143C0E9002310BD10B5BDF8104082 -:100AA000C3F3080343EA04539DF80C4001F003012B -:100AB00004F00F0443EA04439DF8084004F01F04C7 -:100AC00043EAC42343EA4123C0E9002310BDF0B543 -:100AD000014690F84000002838D00F4600254FF01E -:100AE000010ED1F844C00EFA05F414EA0C0FE8B276 -:100AF0003ED0D7E90064A34208BFB24238D191F892 -:100B0000424084423ED0072D08BF00204FF0010E26 -:100B10001CBF0130C0B2A04208D00EFA00F616EA9F -:100B20000C0F14D10EFA05F52CEA050CF4B1013CBA -:100B3000E4B2012000FA04F545EA0C054D6401EB2E -:100B4000C40581F8424041F834206B60F0BD0728AD -:100B500001EBC00601EBC505D6E90067C5E90067F2 -:100B60000CBF0026461C05463046D4E70724E0E7C4 -:100B70000135082D07F10807B5D10123002081F8C0 -:100B80004130E3E70120E1E790F8401030B591B142 -:100B900090F84210456C79B10139C9B201248C40FA -:100BA00080F842102C4300EBC1014464C1E90023EA -:100BB000002380F8413030BD0721EFE730B504460F -:100BC00085B0C57A0C301AF0C3F80B46A17A0246FC -:100BD000009129460E4D02A8FFF751FFDDE90223DF -:100BE00005F14800FFF773FF78B9DDE9022305F14D -:100BF0004800FFF7C9FF95F82430012B05D14FF4C9 -:100C000000332046236018F043FB05B030BD00BF21 -:100C1000580D00214FF418720021014820F0DDBB6F -:100C2000580D002108B50C4A0C4B9A600C4B0D4A2C -:100C30009A600D4B0D4A1A620D4A5A62FFF7EAFF9D -:100C40000C4B1B681B79072B81BF0B4A136A43F0BF -:100C50008003136208BD00BF7D0C0101040D00215B -:100C6000B00C002145070101780C0021C90C0101DD -:100C7000090D0101DC4D00216850002108B5EFF796 -:100C800099FFFFF7C7FFBDE8084018F08BBD0000D3 -:100C900008B51AF077F9044A537A01335372BDE864 -:100CA00008401AF07BB900BFF850002108B51AF0CF -:100CB00069F9044A537A013B5372BDE808401AF0BF -:100CC0006DB900BFF850002130B50E4D89B02846EF -:100CD0000DF102011AF0BEF9044608B909B030BDA1 -:100CE0000DF1030201A9FFF731FD28B1FF2301A88F -:100CF0008DF81630FFF762FF20461AF093F9FFF7E0 -:100D0000D5FFE4E7800D002130B5144D89B02846A9 -:100D10000DF102011AF09EF9044608B909B030BD80 -:100D20000DF1030201A9FFF711FD88B101238DF830 -:100D30001630A368CDF81730A389ADF81B309DF8A5 -:100D4000033013B1FF238DF8163001A8FFF736FFEB -:100D500020461AF067F9FFF7A9FFD8E7880D0021B0 -:100D6000034B93F82400003818BF0120704700BFE0 -:100D7000580D0021034B53F820301878003818BF65 -:100D8000012070474C250301024B1878431E58423E -:100D900058417047C036002130B5CB6A04461B78F5 -:100DA0000846092B25D142F210754A6AD2F8E4317F -:100DB000D2F8D0236A43B2EB430F1AD3616AD1F859 -:100DC000E421D1F8D0136943B1EB420F12D30A49A1 -:100DD000A3FB0135A2FB0121DB0FD20F43EA450340 -:100DE00042EA4102B2EB930F03D3B3EB920F38BF49 -:100DF000204630BD2046FCE7E3361A002DE9F041DD -:100E0000C6780546022E83783D4C20D162780132A7 -:100E10006270721E012A22D9A3F1FF0043424341AE -:100E20002A88FF2A1DD0E3B923781341D90705D5B5 -:100E3000344B314653F822000DF0B2FDEB78013B04 -:100E4000052B5AD8DFE803F01D3C4459594C052EB8 -:100E500003D0062E08BF0126DBE70226D9E70123CF -:100E6000DEE70027DFF89C8023783B41DB0704D5D1 -:100E7000314658F827000DF093FD0137032FF3D1C9 -:100E8000DCE70023297920486172C91A18BF0121C3 -:100E90006370FFF7EAFD1D481AF0DBFA1C481AF0F0 -:100EA000D8FAA968EB68A165E36531B317481AF071 -:100EB000CAFAE16D09B3BDE8F04115481AF0C3BAAA -:100EC00012481AF0C6FABDE8F04111481AF0C1BA4A -:100ED000637893B9E36D83B9BDE8F04118F066BB60 -:100EE000637A022B03D101210748FFF7BEFDA16DF4 -:100EF00006481AF0A8FAE16DDDE7BDE8F08100BF11 -:100F0000481400214C25030158140021A814002185 -:100F1000B8140021024B1860C0780DF057BD00BF17 -:100F20001C370021024B1860C0780DF069BD00BF6E -:100F30001C370021F0F7CEBA2DE9F04389B018F044 -:100F40006BFA002800F08B8000242646464FDFF81D -:100F50001C813B782341DB0715D558F8245095F8C0 -:100F60006430022B05D105F1400018F02BFB85F809 -:100F7000646095F83C30022B05D105F1180018F09B -:100F800021FB85F83C600134032CE2D14FF00008CE -:100F9000374C4FF48565A1464646364F05FB08930E -:100FA00093F82430022B50D1A379002B49D104F1BE -:100FB000100018F00CFB94F88A32002B41D094F802 -:100FC00089322C2B3DD13222A4EB0903DB107B4369 -:100FD0009BB2ADF80430ADF8083094F8963201A811 -:100FE0008DF80A3094F89732ADF806208DF80B3062 -:100FF000B4F89432ADF80C3094F898328DF80E3085 -:1010000094F8A0328DF80F3094F8A8328DF8103093 -:10101000B4F8AA32ADF81230D4F8B0320593B4F86F -:10102000B432ADF8183094F8C0328DF81A3094F814 -:10103000D0328DF81B3094F8D1328DF81C3018F076 -:1010400027F905FB089383F8246008F10108B8F13B -:10105000060F04F58564A1D109B0BDE8F08309B09D -:10106000BDE8F043FFF730BEB80F00214C25030167 -:10107000D01D00214DF833E10E4B70B51860837818 -:101080000446FF2B0C4D09D00388C1784FF48560CE -:1010900000FB0350BDE870400DF0CCBC0026284694 -:1010A000E17801360DF0C6FC062E05F58565F6D112 -:1010B00070BD00BF1C370021D01D00212DE9FF416C -:1010C000044600F5827700F59C75302200213846F1 -:1010D00020F083F900214FF4C072284620F07DF9FA -:1010E000754B764EC4F82031754BC4F83051C4E9C5 -:1010F0004934D4F81C31307A03F47F42714B724D7D -:101100001343C4F81C31022384F83831FFF790FBF5 -:1011100095F8303084F8390184F83A316B486C4BDB -:10112000D722C4E94F03237C4220022B14BF40F294 -:10113000011340F20333A4F84431A37BA4F8B8218F -:10114000D90748BFA4F8BA219A0748BFD4F8BC31E0 -:1011500084F8020244BF43F02003C4F8BC31337A60 -:1011600084F803325B4BC4F8E0315B4BC4F8E431E4 -:101170005A4BC4F8F4315A4BC4F8F831594BC4F8FF -:10118000FC3119F047FFC4F8D001002852D0564B6B -:10119000C4F8E831637BDB074ED5D5E90823D4F8E2 -:1011A000BC11C4E9702341F00201C4F8BC11D4F8A9 -:1011B000BC3143F00102C4F8BC2195F831201AB1CA -:1011C00043F05103C4F8BC31237B012B4FF00003E3 -:1011D00038D1CDE90233032384F8D0300C2384F8CE -:1011E000D430D4F8BC316946C3F3400384F8D2301C -:1011F00004F17A00D4E97023CDE900230BF056FE08 -:1012000004F17803C4F8D4310E2384F80132374B4B -:10121000C4F8EC31237B012B17D1272019F0FAFEFB -:101220000546C4F8D80180B9D4F8D00119F0FAFE07 -:10123000C4F8D0511F2036E02D4BD3E90C23C4E96C -:101240007023B4E7C4F8D431E1E719F0B5F840F2FF -:1012500071226389267C5343C4F814310023022E83 -:1012600018BF1E460125DFF88C806370A37098F8C4 -:10127000003000F2CC40B540C4F810016DB2ABB9FB -:10128000384619F0D9F9D4F80C3188F80160636058 -:1012900098F802302B43002088F8023098F800308C -:1012A0001D4388F8005004B0BDE8F08198F8023082 -:1012B00023EA0503EFE700BFFD9D0001F850002180 -:1012C0006D9E00010300010120500021D6BE898ED1 -:1012D00055555500259D0001B19100017391000104 -:1012E0000D100001B9100001519D0001559D000134 -:1012F00068500021B80F002138B53022044600F5AF -:101300003A75002100F52E7020F067F84FF4C07296 -:101310000021284620F061F8022384F8D03201230E -:1013200084F8D232344B8021C4E9B5330623334AE2 -:1013300084F8E83292F83030314884F8EA32314BA0 -:10134000C4F8E452C4E9BB03A37BA4F86813DD0727 -:1013500048BFA4F86A13990748BFD4F86C33C4F89F -:10136000DC4244BF43F02003C4F86C33002384F80C -:10137000A033254BC4F88433244BC4F88833637BF3 -:10138000DB0733D5D2E90801D4F86C33C4E9DC01BA -:1013900043F00203C4F86C33D4F86C3392F8312074 -:1013A00043F00101C4F86C131AB143F05103C4F8BF -:1013B0006C33237B0020012B09BF04F17803002349 -:1013C000C4F880330E2314BFC4F8803384F89833F4 -:1013D0000F4B6070C4F88C330E4BA070C4F8903380 -:1013E0000D4B84F80001C4F8943338BD0B4BD3E99E -:1013F0000C01C4E9DC01CFE7799E000120500021F7 -:10140000D6BE898E55555500D9940001E996000144 -:101410004D990001419A0001259B0001685000216F -:10142000F8B5044688790D460130C0B21746FFF77B -:1014300067F900284AD02B7884F8E93294F8A23072 -:101440005B0644BF94F8BD3084F8EA32AB79012BD7 -:101450003DD0022B14BF0123032384F8F53284F816 -:10146000F432AB78AE88002B0CBF1E234FF496737A -:101470005E4318F095FF6B78012BAB780CBF3221DF -:101480004FF4FA71002B0CBF1E234FF496730144E6 -:10149000F018FFF789F8AB78361A002B0CBF1E2323 -:1014A0004FF4967304F52E7503EB4000374400218A -:1014B000C4F89C03C4F8C072284618F05FFA18F00C -:1014C0007BFFB04205D9012384F86834F8BD0223BC -:1014D000C3E70021284619F003F90028F6D00123BC -:1014E00084F80031F2E7000070B58022002119482D -:1014F0001FF073FF0024184D184E55F8043B53B1EC -:101500004FF48E62002118461FF067FF56F8242022 -:101510000474C0F89C200134032CEED10122104B3E -:1015200010491A730868104B496803C3094B40F20D -:1015300007511A700D4AA3F86610127B83F86C20CD -:1015400083F87C2040F20762A3F876200022084B43 -:101550001A7070BD481400214C250301A81D0021FC -:101560002050002144250301D0140021685000219F -:10157000B80F002108B5094A094BDA61094B0A4A3C -:10158000DA610A4B0A4A1A620A4B0B4A1A60FFF7E1 -:10159000ABFF4FF48E62094B5A8208BDC1150101A1 -:1015A000040D0021B00C0021FD0D0101780C00217B -:1015B000390F0101E44D0021750D01016850002132 -:1015C00008B5EFF7F7FAEFF765FFBDE80840FFF75A -:1015D0008BBF00002DE9F04104460D460026DFF8E0 -:1015E0004080104F19F010FD3B6801361B8C032E14 -:1015F00048F8040B1844F5D10026DFF82C8019F0C8 -:1016000003FD3B6801361B8C062E48F8040B18447A -:10161000F5D1001BA84288BF0020BDE8F08100BFC3 -:10162000A81D0021DC4D0021B41D002170B50B4B1D -:101630005C7C44B90A4E0B4D33782341DB0704D45C -:101640000134032CF8D1012006E055F82430587BF2 -:1016500017F0BEFE0028F3D170BD00BF205000215E -:10166000481400214C2503010123034A83401078CC -:1016700018431070704700BF481400210123034A2B -:101680008340107820EA030010707047481400214E -:1016900010B5064C54F820001C8804815C884481F5 -:1016A0001B7941730373827310BD00BF4C25030186 -:1016B00038B5044604200D4619F0ACFC014668B16B -:1016C00054B1237C0B8007238B70054BCD70187BA6 -:1016D000BDE8384019F0AFBCFF23F3E738BD00BFC9 -:1016E0006850002138B5054604200C4619F092FCDC -:1016F000014640B16B7AC4708370034B187BBDE820 -:10170000384019F098BC38BD6850002138B50446FF -:1017100004200D4619F07EFC014670B10748084BC5 -:10172000241AE4105C430D238B70064B0C80CD70A3 -:10173000187BBDE8384019F07EBC38BDD01D0021B3 -:101740004DF833E168500021024B1878B0FA80F070 -:1017500040097047C0360021F0B500250C4C2678B2 -:101760006EB194F8D863864209D194F8D9638E4259 -:1017700005D1D4E9F8769E4208BF974206D00135DC -:10178000062D04F58564EAD10020F0BD0120FCE7B8 -:10179000D01D00210022094BDA62094B094ADA62A6 -:1017A000094A0A4B1A600A4B1B681B79082B81BF38 -:1017B000084A136A43F4005313627047040D002172 -:1017C000B00C0021150F0101890D01011C500021F1 -:1017D000DC4D0021685000210022084B1A63084AA2 -:1017E000084B1A63084B1B681B79092B81BF074AFA -:1017F000136A43F000731362704700BF040D0021A9 -:10180000250F0101B00C0021DC4D002168500021A2 -:10181000094B0A4A5A630A4A0A4B5A630A4B1B6825 -:101820001B79082B094B82BF1A6A42F400521A62D4 -:101830004FF48562DA827047040D0021350F0101F3 -:1018400079100101B00C0021DC4D0021685000210D -:10185000302238B50021044600F1600510441FF025 -:10186000BCFD4FF4C072002128461FF0B6FD0123D5 -:1018700084F8483084F84A30094B0020E364094B6F -:10188000E565C4E91434092384F86030064BA07080 -:10189000C4F8F830054B84F85B03C4F8FC3038BD5D -:1018A000BD9E000195A00001A1A0000171A400014E -:1018B0002DE9F84FDFF858911546D9F820409B469E -:1018C000D2E90223C4E9E423012304F5647806463F -:1018D00084F8BE3340460F4617F0AAFD6B694046B8 -:1018E00083EA1343A4F8C033B4F8E01101F00AF816 -:1018F00084F8610096F8A2305B0644BF96F8BD30CC -:1019000084F862306B696366AB69A366BB79012BAF -:1019100076D0022B14BF0123032384F86D3084F8A2 -:101920006C304FF41611AA78EE78002A0CBF1E22F4 -:101930004FF496724E432B8802FB036606EB0B03B3 -:10194000C4F8F831B4F8E031A4F8FC31287C08F090 -:1019500089FAAB780746002B0CBF1E204FF4967017 -:1019600039463044FEF720FEAB78361A002B0CBF08 -:101970001E234FF49673B6F5967F03EB4000C4F830 -:101980000001C4F8F40140D35E44A66301220021A3 -:1019900094F86D0017F05FFF0026D4F8E431DFF80B -:1019A00074B004F1300AE063C4F8F001636459468E -:1019B000504618F095FE013620BBB4F8E0114046C1 -:1019C000013189B2A4F8E01100F09CFFD4F8E431B1 -:1019D000B5B25D4384F8610039462846FEF7E4FD60 -:1019E000D4F8F831D4F8F0211D44D4F8F4312D1A8C -:1019F000024403EB4003A563E263C4F80031D6E779 -:101A000002238AE7012389F80130BDE8F88F00BF7F -:101A1000C0360021990D0101B34B2DE9F04F1E682E -:101A20004FF49563DFF8C4A203FB0066DAF81040B8 -:101A300087B004F13003049396F87033012B40F023 -:101A40002B81A3710A22B6F87433A94F5343C4F80B -:101A50006C33B6F8723304F5647BA4F868333B7CCE -:101A6000584684F8E831D7E90223C4E9E423012386 -:101A700084F8BE33F3F7F4F97B69FD7883EA134207 -:101A80006366BB69A4F8C023A36694F82034BAF84F -:101A9000061084F86D3084F86C30BB783046002B2B -:101AA0004FF416130CBF4FF01E094FF496795D43A7 -:101AB000B7F8008007F0FAF9B6F806120544304688 -:101AC00007F0F4F947F6FE73BAF806C0B6F8062236 -:101AD00009FB0858ACEB020189B299428146BD8BE3 -:101AE000D4F8E401B6F80A3200F2E68040F2E242AD -:101AF0005943336A02FB0133B3FBF0F3494603FB5E -:101B00001080ED1AADB218F05DFC94F8213403900A -:101B1000012BA4F8E05140F0E1800022D4F82434F5 -:101B20001A61D4F82434997C6940584600F0EAFEE2 -:101B30003A7C704B062A98BF33F812709AF80C2042 -:101B400088BFDF89062A94BF33F81220DA8984F827 -:101B50006100059218F024FCBAF80E1047F6FE7AE0 -:101B60006D1AADB2554588BF0025D4F8E411804602 -:101B700001FB05F301933B18194601980293FEF708 -:101B800013FD5A49054608894989059A401A80B2C9 -:101B9000504588BF0020B6F80A1240F2E24648439A -:101BA00008EB02017043FEF7FFFC059A013717446A -:101BB0004744394682462818FEF7F6FC4C4B00F1A4 -:101BC00010029B780398002B0CBF1E234FF49673D2 -:101BD00003EB42034844C4F80031C4F8F431B4F8CC -:101BE000E031C4F8F801801AA4F8FC31A4F8FE3101 -:101BF000A0630021049817F0C1FE4FF00009E36BC9 -:101C00004D46C4F8F03194F82134012B05BF94F807 -:101C1000F93294F8F8220023534304BFD4F8E421A6 -:101C200006FB13234E4603933349049818F058FDDE -:101C3000002840F0AB8094F82134002B5ED1B4F83A -:101C4000E0115846013189B2A4F8E01100F05AFEC3 -:101C50000136D4F8E431B6B203FB06F8DDE9013110 -:101C600084F8610003EB0800FEF79EFC39465044FF -:101C7000FEF79AFCD4F8F83110309844A8EB000332 -:101C8000A363D4F8F0310344E363D4F8F43103EBF5 -:101C90004000C4F80001C7E7032B7FF4D3AE012353 -:101CA00040F6FF71E37104F21E2204F5007323F87D -:101CB000021B9A42FBD1C5E640F2E241A2EB0C02C4 -:101CC00092B25A43336A01FB0233B3FBF0F30133A0 -:101CD0001D44494603FB0080ADB214E7002B7FF49E -:101CE00020AF294621E700BFB43A0021E8360021A1 -:101CF0002037002180250301990D0101D4F8242407 -:101D00000135937CADB20133DBB2937494F8F812D1 -:101D100003F07F03994207D19074B4F8E03109F1E0 -:101D200001090133A4F8E03194F8F982039A05FB24 -:101D300008F302FB09F840F2E24202FB0388DDE906 -:101D4000013103EB0800FEF72FFC39465044FEF743 -:101D50002BFCD4F8F8311030A8EB00084344A363FF -:101D6000D4F8F0310344E363D4F8F43103EB4000DA -:101D7000D4F82434C4F80001997CB4F8E031584612 -:101D8000594000F0BFFD84F861004DE707B0BDE8A1 -:101D9000F08F00BF00234FF48562184610B5054947 -:101DA00002FB03F4645C0CB10130C0B20133062BBA -:101DB000F6D110BDD01D002105289FBF4FF48563CB -:101DC0005843024B185C88BF00207047D01D00218B -:101DD0002DE9F0414FF485630025DFF8BC8003FB5B -:101DE00005F616F8087006EB0804002F4ED14FF4E4 -:101DF0008562394620461FF0F0FA01232370274BF5 -:101E000053F82530A362264B1B7B84F8D43306F5A8 -:101E1000737323F8085003EB080240F20D4353801C -:101E200040F20113A4F86C301E4B06F500769B7D42 -:101E3000464484F8203440F6FF7301370F2F26F80C -:101E4000023BFAD14FF48563002103FB0588164B52 -:101E5000A8F858131B6888F85A131B790C2B12D951 -:101E6000124B53F8250070B14FF44C72C8F824049B -:101E70001FF0B3FA0E4AD8F8243452F82520DA6558 -:101E8000012283F860202046BDE8F0810135062D4F -:101E9000A5D10024F7E700BFD01D0021B41D00210B -:101EA00068500021B4500021DC4D0021043700218E -:101EB000BC0F0021052807D84FF48562044B02FBB4 -:101EC0000030D0E9E401704700200021704700BFD6 -:101ED000D01D002170B588B00C460646154600217D -:101EE0001E2268461FF079FA26238DF80230214B16 -:101EF0008DF804605A889B88ADF80620ADF808304C -:101F00001D4B1E4AE31ADB105343ADF80A30B4F8F8 -:101F1000D8331B4AADF80C3094F820348DF81430C7 -:101F2000D4F8E431A3FB0232DB0F43EA4203ADF8FD -:101F3000163094F8E8318DF818300DB194F8F85255 -:101F400094F8F9320DF10E008DF81A3094F8FA3247 -:101F50008DF819508DF81B3094F8FB328DF81C3039 -:101F6000D4E9F82318F0FAFE684617F091F908B0A2 -:101F700070BD00BFE8360021D01D00214DF833E1CF -:101F8000E3361A0010B54FF48564CA43054B02F0DE -:101F9000010204FB0030827112B9C1F34001C1712A -:101FA00010BD00BFD01D002105280DD84FF485625B -:101FB000064B02FB0030D0F8E431A0F86813594317 -:101FC000C0F8EC110120704700207047D01D00219F -:101FD000F0B500260027164D89B028460DF10701FF -:101FE00019F038F8044608B909B0F0BD4FF4A81349 -:101FF000D4E906C0D4E90212904208BF8C4502938E -:10200000237CCDE904C0CDE906678DF80C3002D100 -:102010002078984205D0CDE9061243F002038DF8EE -:102020000C3002A817F034F9204618F0FBFFD4E773 -:1020300074390021C0780CF015BD0000044B93F8F2 -:10204000143230EA030301D10AF060BB704700BFCD -:10205000683700212DE9F04F04460D46002000218D -:10206000DFF8A4B01F4602F0FD0385B0012B164631 -:10207000DDE90E89CBE91C01DDF840A08BF86A3060 -:102080003AD122494A7C002A36D0AB70D1E90823E4 -:10209000CAE900230023CB73B30711D502AB009329 -:1020A00042464B463846F1F75EFB48B10123AB7020 -:1020B000DDE90223CAE90023CBE91C238BF86A601F -:1020C000DAE90023C4E92223AB782BB1D4F88430B9 -:1020D00043F00203C4F88430D4F88420C4E924898E -:1020E00042F00103C4F884301FB142F00902C4F881 -:1020F000842005B0BDE8F08F0023AB70044BD3E91A -:102100000C23CAE90023C7E74051002120500021D9 -:102110006850002113B50446069B10460093DDE984 -:102120000423F1F73AFB074B93F83120D4F88430BD -:102130002AB143F04003C4F8843002B010BD23F04C -:102140004003F8E72050002100232DE9F0418B4F98 -:102150008AB004938DF81430BB6A894D5C042E7CE0 -:1021600006D5042E01D0012E02D801238DF811309E -:102170002C22844C0021A0181FF02FF904F16003D9 -:102180004FF4C072184600211FF027F97E4B02223F -:10219000C4E91233032384F8603097F83030A06527 -:1021A00084F8623079487A4B84F844200122C4E9EB -:1021B000190340F20113964284F84620A4F86C30CB -:1021C00010D0042E0ED095F82130D90744BF082234 -:1021D000A4F8E2209A0742BFB4F8E23043F02003AB -:1021E000A4F8E23095F8203084F81331BB695B0421 -:1021F00009D517F01AF80323B0FBF3F303EB4303FD -:10220000C01A84F812012B7C042B77D8DFE803F086 -:102210000379878C820000238DF810302823A4F8DE -:10222000E03006AB5B48029304A9D5E90623CDE96B -:102230000023AB7C6A7CFFF70DFF00220023CDE971 -:10224000082308AB0293697CD5E906235148CDE900 -:102250000023AA7CFFF75EFF2B7C4F4E012B67D03B -:10226000042B65D04D4B30460093DDE906230AF080 -:1022700003FE00238DF81400064485F848304148D9 -:1022800004A90AF0E5FD2B7C361B022B84F81061B3 -:10229000C4F8F84001D9042B69D1414A13F0FD0874 -:1022A000C4F8FC203F4AC4F808213F4AC4F80C2176 -:1022B00060D104233D4F8DF8103095F8683004A9A3 -:1022C000063338468DF814300AF0C2FD384B3E18FC -:1022D00030460093DDE906230AF0F6FD0644F61BBE -:1022E00085F86980C4F8007184F8116100213148D3 -:1022F000218517F043FB2F4818F09EF90AB0BDE87E -:10230000F081002340F6A662C5E902322A4A84F829 -:1023100012312A6001238DF8103020237FE7062335 -:102320008DF8103008237AE702238DF8103078E713 -:10233000DDE9087057EA000CD5E906231CBF034607 -:102340003A46A97C18BF0121CDE90023DDE9062327 -:1023500011488DF813100AF09EFDD4F8E4308DF882 -:10236000140043F004030644C4F8E43087E7002374 -:10237000C4F8FC300023C4F80031B7E72050002136 -:10238000405100216837002159A70001D6BE898E2F -:1023900055555500C83700216A3700216851002182 -:1023A0004437002191A60001D5A600014C39002137 -:1023B0008951002194370021008813000022024B2C -:1023C000C3F8FC20704700BF683700214FF4067245 -:1023D000002101481FF001B868370021054B064A6B -:1023E0001A61064B064A1A61064B074A9A62FFF7C2 -:1023F000EDBF00BF040D00210D240101B00C002130 -:1024000035200101780C0021D11F010108B5EFF73B -:102410007BFAFFF7DBFFBDE8084017F0EDB90138A4 -:10242000032807D8DFE800F0040204020220704706 -:102430000120704700207047030203F00F3300F0C3 -:10244000F0300343180100F0333003F0CC3318436D -:10245000830003F0553300F0AA301843C0097047D9 -:1024600040F6E8335843094BA0F53E501B6820382E -:10247000034493F88821012A06D1D3F89C0121B1A5 -:10248000D3F8A0310B60704700207047C03900219D -:102490002DE9F04705460E460024134FDFF84C8027 -:1024A000DFF84C903B685FFA84FA1B7B534502D8F7 -:1024B0000020BDE8F0875046D8F800309847012842 -:1024C0000ED1102018F0A6FD014658B10E23C0E928 -:1024D0000256A0F800A0438099F80C0018F0ABFD5C -:1024E0000134DFE70C20E4E7DC4D0021E84D00215A -:1024F0006850002113B5094C20460DF1030118F076 -:10250000A9FD019018B9FFF763FD02B010BD01A845 -:1025100016F0BEFE019818F085FDEDE7B4390021F4 -:1025200038B505460C4616F080FE2A46214618F0BE -:1025300021FC80B238BD00002DE9F047099F80469C -:102540000C4691469A469DF82050042A1FD8DFE891 -:1025500002F00317032050000B7AC3B940F27260F7 -:10256000524A098812682944128A824228BF0246C8 -:10257000914205DD0726238023723046BDE8F087AF -:1025800098F80260002E40F08F80002D3BD112267B -:10259000F3E78378012B75D14D752FB12A46394663 -:1025A00004F118001EF0F2FE29463846FFF7B8FF86 -:1025B0000123E08284F813A1237508F50664204600 -:1025C00018F09EFA08B90026D7E798F8C53B63B122 -:1025D00008F52165284618F093FA0028F3D098F8FA -:1025E000C53B13B1284618F053FA204618F050FAAC -:1025F000E9E78378002BCAD0002DC8D10B88002BC7 -:10260000C5D0294646E0B9F1040FB6D801A353F866 -:1026100029F000BF29260101472601015B2601019F -:10262000852601010326010137B1238860682A4607 -:10263000394618441EF0AAFE002321884E4629443C -:102640002180237299E727B12A46394660681EF037 -:102650009DFE0023258023728FE737B120886368B1 -:102660002A46394618441EF091FE238829462B44F9 -:1026700023803846FFF754FF0123A8F8400084F870 -:102680000CA0E8E727B12A46394660681EF07EFEB6 -:10269000A9B221803846FFF743FF0123A8F8400084 -:1026A00084F80CA023728EE70C2666E7DC4D00212F -:1026B000002310B5037090F8DD3B0446012B03D1D5 -:1026C000054B1B6803B1984704F5717018F0C1FE03 -:1026D000BDE8104016F054BEC43900210146002266 -:1026E00030B50A4B1B681C7B094B1B68944201D810 -:1026F000002030BD5D7818468D4202D11D78002D36 -:10270000F7D1013203F6E833F0E700BFDC4D0021DA -:10271000C039002138B583780446FF2B1AD00078E1 -:10272000FFF7DCFFA8B10D4BE1781C60BDE8384035 -:102730000CF0E8B9E0B2FFF7D1FF28B14FF49C727A -:10274000002150301EF049FE01342B681B7B9C4257 -:10275000F0D338BD0024024DF7E700BFBC3900219B -:10276000DC4D0021134B2DE9F041186083780446BD -:10277000FF2B18D00078FFF7B1FF90B1E178BDE8EA -:10278000F0410CF08DB908FB05F33A68D018D35C22 -:1027900013B1E1780CF084F9013533681B7BAB424F -:1027A000F1D8BDE8F081002540F6E838024E034F2D -:1027B000F3E700BFC8390021DC4D0021C0390021FA -:1027C00008B5FFF78BFF30B140F20113B0F8880174 -:1027D000C31A5842584108BD134B2DE9F041186007 -:1027E00083780446FF2B18D00078FFF777FF90B16D -:1027F000E178BDE8F0410CF06BB908FB05F33A68ED -:10280000D018D35C13B1E1780CF062F9013533686C -:102810001B7BAB42F1D8BDE8F081002540F6E838DB -:10282000024E034FF3E700BFCC390021DC4D0021FD -:10283000C039002110B50C46FFF750FF50B180F8A9 -:10284000DC4B008C10F0100003D00020024B83F80A -:10285000144210BD4220FCE768370021F8B5044659 -:102860004DF66856114D07F043FA94F8C43B84F8CE -:10287000DC03034406FB03F2520D02EBC20102EB40 -:1028800081029B1ADBB2C3F12000D5E90E27A3F128 -:10289000200184F8C43B07FA00F022FA03F3034353 -:1028A00027FA01F10B43DB07DDD5F8BD20500021ED -:1028B000F8B504464DF66856114D07F019FA94F82C -:1028C0004D3384F84C03034406FB03F2520D02EB34 -:1028D000C20102EB81029B1ADBB2C3F12000D5E9F1 -:1028E0000E27A3F1200184F84D3307FA00F022FAF5 -:1028F00003F3034327FA01F10B43DB07DDD5F8BDF2 -:1029000020500021028E70B5044682EA0100FFF7D4 -:1029100093FD00EB0010104480B2FFF78DFD00EB3B -:102920000010104480B2FFF787FD4DF6685300EBAE -:10293000001011184A4091B24B43D4E900265B0DB8 -:1029400003EBC30003EB8003CB1A9BB2C3F120055A -:10295000A3F12000DA4006FA05F526FA00F02A4332 -:102960000243D20757BF94F82D00D8B2484304EB76 -:10297000104058BF007A70BDF8B504460D46D0F837 -:102980006C6817F019FDB0F5967F2CD917F014FD7F -:102990001F4F3B689A8AA36C9A422CBFB618F61850 -:1029A00006441C48B04228BF304616F0C3FF94F8D6 -:1029B00034360646D3B994F84C10284616F0DEFF9C -:1029C000D4F8E023D4F86838AB608AB93B6828466D -:1029D000D98AA26A314417F049FFC0B9AB68A26A2C -:1029E0001344AB60F2E74FF49670D1E70021E4E7BF -:1029F0003B682846D98AD4F8E023314417F0C4FF55 -:102A000028B9AB68D4F8E0231344AB60F0E7F8BD15 -:102A1000DC4D0021D47E250038B590F834360446CC -:102A20000D46F3B990F84C10284616F0A7FF94F81D -:102A30003E2082B142F21073616A01FB02330A4AFE -:102A4000934228BF1346D4F86C289A422CBFC4F88E -:102A5000E023C4F8E03329462046BDE83840FFF7BC -:102A60008BBF0021E0E700BFD47E250070B500F5E4 -:102A70002165044600F524663022002128461EF018 -:102A8000ACFC4FF4C072002130461EF0A6FC0123BE -:102A900084F8283A84F82A3A234B94F84500C4F87D -:102AA0002C3AC4F8303A04F65203C4F8383A0723F3 -:102AB00084F8403A94F8C43BC4F83C6A84F8413A3C -:102AC00094F93C30C4F8344A7F2B08BF174B04F20A -:102AD0004D4208BF93F93030294684F8423A144BEE -:102AE000C4F8443A134BC4F8483A94F83F3084F899 -:102AF0004C3A84F84D3AFFF792FC0F4B84F84E0A9B -:102B0000C4F8143B002384F84F0AA4F83236204658 -:102B1000C4F8DC2AC4F8E83AC4F80C3BC4F8002B2B -:102B2000BDE87040FFF778BF05B2000120500021DA -:102B3000D6BE898E5555550071A9000140F6E83280 -:102B4000044B00211B681B7B5A43034B18681EF083 -:102B500044BC00BFDC4D0021C039002108B5134A38 -:102B6000134B14491A62144B144A15481A62154A39 -:102B70009162154A9A63FDF769FD144B144A1A6075 -:102B8000144B1B68187908280BD9134B0C28D3E970 -:102B9000082142F4805286BF41F48071C3E90821C4 -:102BA0001A62BDE80840FFF7C9BF00BFDD2B010175 -:102BB000040D0021F5240101B00C0021652701015D -:102BC00091240101780C00211527010118500021E2 -:102BD00035280101DC4D00216850002108B5EEF7D1 -:102BE00093FEEFF7E9F8BDE80840FFF7A7BF000044 -:102BF0002DE9F04105460C4618F006FA40F6E83299 -:102C00000027184B184E18603368DFF860801B7B74 -:102C100002FB030033681B7BBB4210D80027DFF8A0 -:102C2000508033681B7BBB4212D8401BA0429BBF25 -:102C300040F6E8320F4B00201A82BDE8F08118F010 -:102C4000E3F9336848F8040B1B8A01371844E1E7BD -:102C500018F0DAF9336848F8040B1B8A0137184476 -:102C6000DFE700BFC0390021DC4D0021843900219D -:102C70009C3900216850002110B50C4678B10878C5 -:102C8000FFF72CFD60B1038C03F01D031D2B09D150 -:102C90006388013B9BB2802B34BF0020122010BD03 -:102CA0004220FCE70020FAE708B5FFF717FD70B3F4 -:102CB00090F830366BB390F8443753B3038C03F07D -:102CC0001202022A02D1B0F8502812B390F839202B -:102CD00002F0FD02012A01D10279E2B103F01102F2 -:102CE000112A03D1B0F852281F2A14D803F0050383 -:102CF000052B06D1B0F85238F02B34BF002012203B -:102D000008BD012B09D1B0F85238F62BF5E7422067 -:102D1000F6E70C20F4E71220F2E70020F0E708B510 -:102D2000FFF7DCFC003818BF012008BD10B5C0B2A9 -:102D30000C46FFF7D3FC30B190F93C001AF0E6FAEC -:102D40002070002010BD4220FCE700000023F0B5F9 -:102D50001A4640F6E8370A4D0A4E2968097B99421F -:102D600001D8D0B2F0BD07FB03F1346804EB010CCD -:102D7000615C19B19CF80110815401320133ECE718 -:102D8000DC4D0021C039002170B50D46FFF7A6FCCF -:102D90000446D8B1038CDA0701D58378C3B9284635 -:102DA00017F0D6FF01F44043B3F5404F06460D46F9 -:102DB00001D00B040ED418F0E5F80123C4E9026534 -:102DC0002371E37018F0EAF8002070BD4220FCE7A0 -:102DD0000C20FAE71220F8E7F0B506460D46002071 -:102DE000002192F839C02A4F0CF0FD03012B144644 -:102DF000C7E91C0185B087F86A3040D11279002AF2 -:102E00003DD0B370D4E90223C4E904230023E37066 -:102E10001CF0020F14D002AB009394F83A00D4E9EE -:102E20000C23F0F7A0FC58B10123B37094F83910CB -:102E3000DDE90223C4E90423C7E91C2387F86A10EB -:102E4000D4E90423C5E92223B3782BB1D5F8843023 -:102E500043F00203C5F88430D5F8841041F0010333 -:102E6000C5F88430D4E90C23C5E9242394F83A301A -:102E70001BB141F00901C5F8841005B0F0BD002375 -:102E8000B370044BD3E90C23C4E90423C0E700BFAB -:102E900040510021685000212DE9F04306461446B8 -:102EA00092F83A000D46F070D2E90C23C4E90623EB -:102EB000164985B091F8311021B394F8391089077B -:102EC0001AD54FF000084FF0000902AF0097CDE986 -:102ED0000289F0F739FC30B9D4E90C2394F83A00B0 -:102EE0000097F0F75AFCDDE9022352EA03011EBF06 -:102EF0000121F170C4E90623D5F8843043F0400382 -:102F0000C5F8843005B0BDE8F08300BF2050002133 -:102F10002DE9F84380460D46FFF7E0FB0446002804 -:102F20006BD10646DFF8CC91D9F800301A7B724B92 -:102F30001B68964203D307263046BDE8F8831C463B -:102F4000277803F6E833002F55D140F6E8323946AA -:102F500020461EF042FA012384F801802370D9F83C -:102F60000020927C84F830369A4238BF1A4684F8A2 -:102F7000443784F81C35614B84F84C201B7B604A35 -:102F800084F8D0334FF4A16352F82620A4F8C88304 -:102F9000C4F82C26C4F840275A4AA4F8CA3352F879 -:102FA0002620C4F8182516F0E3F9A678002E40F084 -:102FB0009E80B7B1238CDB0613D594F83D2604F22E -:102FC0003E61A4F85228D4F82C061EF0DFF994F8DC -:102FD0005127D4F84007A4F8502804F252711EF08B -:102FE000D5F92B88D80621D4D90708D5B4F850389C -:102FF00053B11226A0E701369BE70127D5E79A07D0 -:10300000F4D5B4F85238F3E7B4F85228022194F812 -:103010003F0016F020FC40F27122AB6800F51C5016 -:1030200053431030834220D2452685E7B4F8522816 -:10303000002F55D0238CDB0652D41F2AD9D8B4F8E0 -:1030400050381F2BD5D8D4F82C1684F83D2604F21E -:103050003E601EF09BF9B4F85028D4F8401784F86D -:10306000512704F252701EF091F994F889212B88AF -:10307000012A02D113F03B0FBBD140F271216A68E3 -:103080002384AB684A434B436262A3622B7B84F880 -:1030900038306B7B84F83930AB7B84F83A30286960 -:1030A00017F056FEC4E90C012B7D84F83B306B7D94 -:1030B00084F83C30AB7D84F83D30EB7D84F83E30C5 -:1030C0002B7E84F83F306B7E84F84230AB7E84F8F0 -:1030D0004330EB7E84F844302B7F84F845302BE777 -:1030E0001F2A86D8B4F850381F2BBED981E70C268A -:1030F00022E700BFDC4D0021C039002168500021CB -:10310000843900219C39002108B5FFF7E7FA10B196 -:10311000D0E9DA0108BD00200021FBE7F0B585B059 -:103120000D46FFF7DBFA044600283AD090F88931C3 -:10313000012B38D01F4B00271B689E8A836C9E4250 -:1031400038BF1E461C4BB6B21B6843B398470246B5 -:1031500094F83F00022303970127CDE90173B4F8E7 -:10316000143500210093334616F08BFB40F2E24108 -:103170006B884B43834218D3208C10F03B0016D150 -:103180002A884A43C4E9D623AB8884F86273A4F83A -:10319000603384F8DD0BC4F8E40B05B0F0BD3A46AB -:1031A000D6E74220F9E70C20F7E74520F5E71220A3 -:1031B000F3E700BFDC4D0021803900212DE9F04FFD -:1031C00085B0884615461E46FFF788FA0446002853 -:1031D00000F0D08090F862331BB90C2005B0BDE838 -:1031E000F08FA8F10303012B06D90DB91220F5E7E2 -:1031F00090F88931002BF0D1DFF87C91D9F80030BC -:10320000B3F814B0A36C9B4538BF9B4694F8893142 -:103210001FFA8BFB23B3D4F850A3584B1A680AB19A -:103220009047024618F0FD014FF0020394F83F006A -:10323000AFB218D1CDE9023101230193B4F81435AE -:103240003B449BB200935B4616F01BFB504521D8D4 -:10325000B8F1040FCAD8DFE808F00D1F0D2D4700A4 -:10326000D4F85CA3D9E70021CDE902310123CDE9EF -:103270000073E8E794F81C35002BB7D1D9F800109B -:10328000B4F81425098A2A448A4205DDA4F81435C5 -:1032900084F81C354520A1E794F88831002B9CD197 -:1032A000002DA3D0B8F1040F19D8DFE808F032449C -:1032B0004B5A2A0094F88881B8F1010F51D12A465F -:1032C000314684F8295504F22C501EF05FF8394637 -:1032D0003046FFF725F984F82885A4F82A0501234C -:1032E000002084F8203579E794F88831002B3FF4EA -:1032F0007DAF002D7FF47AAFB4F81435002B3FF486 -:1033000075AF39463046FFF70BF90123A4F8560391 -:103310000EE0B4F81435D4F818052A46184431469E -:103320001EF034F8B4F814351F440023A4F81475C3 -:1033300084F81C35D3E72A463146D4F818051EF028 -:1033400025F8F2E7B4F81435D4F818052A461844DD -:1033500031461EF01BF8B4F814353B44A4F814357C -:10336000CFE72A463146D4F818051EF00FF8A4F826 -:103370001475C6E7422031E7DC4D00218039002179 -:103380008A07F8B506460D46C1F3400708D5234B1A -:10339000DB6ADB0604D41121BDE8F84016F093B9CE -:1033A0003046FFF79BF9044610B942213046F3E757 -:1033B00090F862334BB115F0010502D090F81C353E -:1033C0001BB1238C03F03B030BB10C21EEE704206F -:1033D00084F8547317F01EFE014648B10A23837027 -:1033E000C5F10203C3700E4B0680187B17F023FE55 -:1033F00094F8DD3B012B10D1042017F00BFE0146A1 -:1034000058B10E23C5F105058370054B0680C570C4 -:10341000187BBDE8F84017F00EBEF8BD2050002123 -:103420006850002170B50646FFF758F9044678B198 -:1034300085787DB990F88931012B0BD0D0F8D83B35 -:103440000BB1304698472046FFF732F9284670BD49 -:103450004225FBE70C25F9E70022F8B5134D144E81 -:103460002B68197B3368914208D8002440F6E8376E -:103470002B681B7BA3420CD80020F8BD987890B92C -:1034800003F6E833A3F65F20007801280BD0013261 -:10349000E9E707FB04F33268D018D35C0BB1FFF700 -:1034A00007F90134E4E70C20E7E700BFDC4D002119 -:1034B000C039002138B50D46FFF710F9044630B188 -:1034C00017F060FDA56417F069FD002038BD4220AB -:1034D000FCE738B50D46FFF701F9044658B16B1EFD -:1034E000DBB2FA2B09D817F04DFD84F84C5017F0D9 -:1034F00055FD002038BD4220FCE71220FAE770B5E8 -:103500000E461546FFF7EAF8044648B117F03AFDB3 -:1035100084F89F6884F84F5A17F040FD002070BD72 -:103520004220FCE738B5054604200C4617F072FD32 -:10353000014650B16B78C470038008238370034B3D -:10354000187BBDE8384017F076BD38BD68500021C3 -:1035500070B500F52165044600F52466302200218F -:1035600028461DF03AFF4FF4C072002130461DF08E -:1035700034FF022384F8283A012384F82A3A3B4B8B -:1035800094F84500C4F82C3AC4F8303A04F50563C1 -:10359000C4F8383A072384F8403A94F8C43BC4F896 -:1035A0003C6A84F8413A94F93C30C4F8344A7F2BA1 -:1035B00004BF2F4B93F9303084F8423A2D4BC4F8B6 -:1035C000443A2D4BC4F8483A94F83F3084F84C3ACA -:1035D00084F84D3AFEF723FF0823228C84F84E0A24 -:1035E00084F84F0A5007C4F8C03A07D4910705D5AC -:1035F00094F83B20D20748BFA4F8C23A002304F253 -:103600004D411A462046A4F83236C4F8DC1A0AF0B6 -:103610000FFAA4F8D80A122017F0FCFCF0B1174BEF -:103620000430C4F80C3B164BC4F8E80AC4F8103B4D -:103630000023A4F8463704F28F43C4F8F03AC4F8E4 -:10364000003B104A94F8C43B29462046C4F8142B8A -:1036500084F8413ABDE87040FFF7DEB91F2304212A -:10366000204684F8D633FFF75DFFE1E705B200019D -:1036700020500021D6BE898E55555500D5AB00018E -:1036800055AC000145AB000170B500F5216504465D -:1036900000F524663022002128461DF09EFE4FF4DE -:1036A000C072002130461DF098FE022384F8283AAB -:1036B000012384F82A3A3B4B94F84500C4F82C3A8D -:1036C000C4F8303A04F65203C4F8383A072384F8B1 -:1036D000403A94F8C43BC4F83C6A84F8413A94F9FF -:1036E0003C30C4F8344A7F2B04BF2F4B93F9303061 -:1036F00084F8423A2D4BC4F8443A2D4BC4F8483A6A -:1037000094F83F3084F84C3A84F84D3AFEF787FE3F -:103710002023228C84F84E0A84F84F0A5007C4F8FC -:10372000C03A07D4D10705D594F83B20920748BF8B -:10373000A4F8C23A002304F24D41A4F832362046E0 -:10374000C4F8DC1A04F5C5620AF072F9D4F82C3614 -:10375000A4F8D80AC4F8E43AB4F852382820A4F8F7 -:10376000E03A17F057FCA8B1124B0430C4F8E80A4D -:10377000C4F80C3B04F28F41C4F8F01A2046002232 -:103780000AF012FA2946A4F8EC0A2046BDE8704077 -:10379000FFF742B91F230421204684F8D633FFF7F0 -:1037A000C1FEE7E705B2000120500021D6BE898E98 -:1037B00055555500C5AC0001F8B500F50666044640 -:1037C00000F5096730220D46304600211DF005FE48 -:1037D0004FF4C072002138461DF0FFFD0122032383 -:1037E00084F87A28804A94F93C10C4F87C287F4AEF -:1037F00084F87838C4F8802884F890387C4A7D4B67 -:103800007F2993F97B3008BF92F93010C4F88C7887 -:103810008B42A8BF0B4684F89238774B94F844004B -:10382000C4F89438754BC4F88448C4F8983894F8B0 -:103830003D3084F89C3884F89D38FEF7F0FD28234D -:10384000C4F81039238C84F89E085F0784F89F0819 -:1038500000F18D80980706D594F83B10C90744BF46 -:103860000821A4F81219DB0709D594F83B309F070B -:1038700005D5B4F8123943F02003A4F8123994F8AE -:10388000383084F843395E4BC4F8343993695804AE -:1038900003F4804272D515F0C8FC00F0030084F8F0 -:1038A0004209238C04F5797713F0100269D003F0F4 -:1038B0001D031D2B0DD1002384F84239636240F6AD -:1038C000A6634FF47A72A3624E4B1B685B68534346 -:1038D000E362394620460AF0B7F9238C84F84009A0 -:1038E000D906C4F828791CD59A071AD0282017F0D1 -:1038F00091FB002876D0444B0430C4F83839434B50 -:10390000C4F82C09C4F83C39238C9B0709D504F270 -:103910002647394620460AF00DFAC4F8307984F873 -:1039200041092046FEF79AFFD4F8D8332BB1002185 -:10393000204694F8C42B09F0E7FC0021304616F02D -:103940001DF8304B1B685B6803B319F0B5FB0746E5 -:1039500016F032FD4FF47A723844C4F8680800213A -:1039600030466A4316F082FF98B9122029E0D4F855 -:10397000143943F00403C4F8143980E784F8422969 -:103980008FE73946204609F0B3FFA6E7304616F028 -:1039900053FED4F8D803A0B1258C05F00305012D02 -:1039A00014D0022D0ED0002DDFD12046FFF75EF897 -:1039B000012384F8C53B3046D4F86818F6F7B6FF03 -:1039C0000020F8BD2046FFF7C3FDF1E7104B1B6850 -:1039D00093F82230002BC8D02046FFF755FE84F81C -:1039E000C55BE8E71F20ECE709AF0001F9B1000172 -:1039F0002050002140510021D6BE898E55555500DA -:103A00002DA90001C8390021EDAD00014DAE000126 -:103A1000DC4D002138B5054604200C4617F0FAFAB3 -:103A2000014650B16B78C47003800A238370034B46 -:103A3000187BBDE8384017F0FEBA38BD6850002149 -:103A400000220D4B9A620D4B0D4A9A620D4B0E4AA5 -:103A50001A600E4B1B68187908280CD90C4B0B28E0 -:103A6000D3E9082142F4005201D81A62704741F0AC -:103A70001001C3E908217047040D0021B00C00219A -:103A8000D9270101E84D0021C1270101DC4D0021AA -:103A9000685000212DE9F04F00F5CA75044689B041 -:103AA00000F5E4763022002128461DF096FC4FF404 -:103AB000C072002130461DF090FC012384F8AC3127 -:103AC00084F8AE316F4BC4F8C061C4F8B0316E4BAE -:103AD0000026C4E96D3404F21453C4F8BC3106F076 -:103AE00007F9082384F8C83194F84D3384F84C035F -:103AF00084F8C93194F93C30DFF890B17F2B04BFD2 -:103B0000634B93F9303084F8CA31D4F88C31C4F85F -:103B1000CC3106F0E7F894F83F30C4F8D00184F8CF -:103B2000D43194F8450084F8D531FEF778FC594B30 -:103B300084F8D601C4F89C3204F2D14384F8D7014A -:103B4000C4F86432C4F8883231462846A4F81E65A9 -:103B500015F014FFD4F85833A26C0493DBF800304E -:103B6000D4F85C939B8A934238BF13464A4A1FFAA3 -:103B700083FA1268002A7AD09047024601274FF054 -:103B80000208B4F8141553460091CDE901780021DC -:103B900094F83F000396059215F073FEDBF80010D1 -:103BA000059A898B88420CD9B4F8141553460091B4 -:103BB000CDE90286002194F83F00019715F061FEDF -:103BC0000146D4F8A0218A4238BF0A464945C4F8C4 -:103BD000A0214ED8DFF8C480314FD8F80030E61A63 -:103BE000F610304B7E43029307ABCDE90023049AD5 -:103BF00004368A4238BF0A464B460121F0B216F01D -:103C0000FBF8002839D0079BD4F8186AC4F8503361 -:103C1000C4F8A83116B919F04FFA06460023D8F8AF -:103C200000103246611AC910794304310093D4F868 -:103C30005003C9B216F096F90027636A984208BF8C -:103C400040080644C4F89C610021284616F048FD4F -:103C50000137A0B9B4F89031D4F850230133A4F857 -:103C60009031BBB202FB0363C4F89C31ECE73246EF -:103C700084E7452009B0BDE8F08F4320FAE7002033 -:103C8000F8E700BF49B30001FDB30001DC4D00219E -:103C90002050002109AA000180390021C0390021EB -:103CA000D53FF54F6124010170B504460D46FEF77E -:103CB00015FD78B190F8DC3B35EA03030AD143786F -:103CC000A34207D1D0E90C23BDE8704090F83A0038 -:103CD00008F034BD70BD2DE9F74307460E46914606 -:103CE0001D46FEF7FBFCDDF82880044600283FD087 -:103CF000038CDA061DD425B19B073DD4B0F85038AB -:103D0000C3BB4B4632462046CDE9005804F5C56199 -:103D1000FEF712FC032E08D8DFE806F002050205C4 -:103D2000B4F852381D44A4F85258D8B103B0BDE8D5 -:103D3000F083032E20D11F2D1ED880F83D56B8F1F8 -:103D4000000F05D02A46414600F23E601DF01EFBE2 -:103D5000A378012B08BF84F83036012384F83C3661 -:103D600084F8343638460121FFF79EFF0020DDE756 -:103D70004220DBE70C20D9E71220D7E72DE9F743F3 -:103D800007460E4691461D46FEF7A8FCDDF8288042 -:103D90000446002848D0042E48D0038C9A0701D44A -:103DA000002D43D1DB0620D41DB9032E05D00C20F5 -:103DB00018E0B4F85238002BF9D14B463246204671 -:103DC000CDE9005804F23C71FEF7B6FB032E08D88B -:103DD000DFE806F002050205B4F850381D44A4F8E7 -:103DE0005058D8B103B0BDE8F083032E1ED11F2D6B -:103DF0001CD884F85157B8F1000F05D02A46414627 -:103E000004F252701DF0C2FAA378012B08BF84F8A7 -:103E10004437012384F8503784F848373846022164 -:103E2000FFF742FF0020DDE74220DBE71220D9E761 -:103E300008B517F0A7F8044A137801331370BDE8EA -:103E4000084017F0ABB800BFDC500021002238B5A5 -:103E50000E4B04461B6893F839500D4B1868954279 -:103E600001D800230DE00346197800F5547051B9CC -:103E70004FF4547218461DF0B0FA01220346027046 -:103E80008470184638BD0132E9E700BFDC4D0021DF -:103E9000D03900210146002230B50C4B1B6893F845 -:103EA00039500B4B1B68954201D8002030BD187863 -:103EB00038B1D878012804D11C6D14B164788C42D3 -:103EC000F4D0013203F55473EDE700BFDC4D00215F -:103ED000D03900210146002230B50A4B1B6893F807 -:103EE0003940094B1B68944201D8002030BD1D7831 -:103EF000184615B19D788D42F8D0013203F5547300 -:103F0000F1E700BFDC4D0021D039002130B50D4B69 -:103F100000221B680C4993F839404FF4856303FB7A -:103F200000110A4B1B68944201D8002030BD1D7857 -:103F3000184615B11D6D8D42F8D0013203F554734A -:103F4000F1E700BFDC4D0021D01D0021D039002158 -:103F50000022094B1B6893F83910084B1B689142EB -:103F600001D800207047187810B158780128F9D08E -:103F7000013203F55473F2E7DC4D0021D039002102 -:103F800070B500251C4E0446336893F83A001B4B6D -:103F90001A68A84201D8002327E01346197802F5D1 -:103FA000987239BB4FF4987218461DF016FA012228 -:103FB00002703168034691F8222091F83510446070 -:103FC0000A442A44428094F83420511CC9B24170FA -:103FD000E578FF205DB983F82C007F2083F864002A -:103FE0000E3284F8341044F82230184670BD83F83D -:103FF0002400F5E70135CCE7DC4D0021D439002160 -:104000000146002230B50A4B1B6893F83A40094B31 -:104010001B68944201D8002030BD1D78184615B1A8 -:104020005D888D42F8D0013203F59873F1E700BF47 -:10403000DC4D0021D439002130B50A4B4FF498747F -:104040001B6893F83A20084B1968002318469A42D7 -:1040500000D830BD04FB03F54D5D0DB90130C0B291 -:104060000133F4E7DC4D0021D439002101EB810359 -:10407000C3EBC30303F0010103F12A028B0743EAF8 -:10408000C27343EA417343EA017343EAC16310B563 -:1040900043EA8163C2F34004C2F3801143EA4463FC -:1040A00043EA016343EAC453C2F3401143EA415374 -:1040B000C2F3001143EA0153C2F3C00143EA814352 -:1040C000C2F3800243EA4243584010BD2DE9F0415B -:1040D000044663680846DB786178012B0CBF0D232A -:1040E0000C2384F8B0301746FFF7C0FFDDE9062344 -:1040F000C4E91E23012384F8A63080EA1043054654 -:10410000A4F8A830060C04F178009DF8208015F082 -:104110008FF96378C4F8B45043EA0723C4F8B83081 -:10412000254B84F8BD8093F8303084F8BC8084F847 -:10413000B2300023A4F8BE30636893F83423CAB3C6 -:104140001E4AC4F80C21D3F83513C4F80411D3F86F -:10415000391394F80701C4F8081194F8041194F87D -:104160000621694084F8041194F80511724081EA2F -:10417000152180EA156504F1F40084F80511014663 -:1041800084F8062184F8075103F59E7203F5A6739F -:1041900052F8045B9A4241F8045BF9D140F20123E2 -:1041A000A4F81C31064B1B6823B1A1780122BDE89D -:1041B000F0411847BDE8F0812050002101010102C3 -:1041C000743A0021F8B50446002500F1380794F848 -:1041D0003430218CAB4212D80123002204F5207028 -:1041E00015F044F9E37884F8B902012B0CBFA36BF6 -:1041F000D4F8903093F8B13084F8F930F8BD57F81E -:10420000046B3EB10123002206F1780015F02EF96F -:1042100086F8B1000135DAE72DE9F041044616468B -:104220001D46002700F1380894F83430BB4208D806 -:10423000204632462B46BDE8F041E0E9A02315F0C8 -:10424000F7B858F8040B28B132462B46E0E91E2394 -:1042500015F0EEF80137E7E72DE9F04F87B0064695 -:104260008846154607F0A4FB0446D8B9284616F040 -:10427000D9FE5B4B9B6A6BB196F8682052B901205E -:10428000B8F80020ADF81000ADF80E200DF10E01C9 -:1042900004AA9847FFF7CCFD072007B0BDE8F04F10 -:1042A000FCF772B900234373D6F8049099F81C20E8 -:1042B000027398F80320B8F80E709A4214BF0C22CB -:1042C0000822B9F804102A4407818172C37205607C -:1042D0004260002F40F0828004A910308DF81070E9 -:1042E0008DF811708DF812708DF813700AF0F0F9D6 -:1042F0000123A073E773E3725CE0A17A5F1BBFB296 -:104300008F4228BF0F4699F81E103D44ADB20029D8 -:104310005AD15B1B18BF0123E17A4FF00D0A8DF8CB -:1043200010304FF000038DF811308DF812300AFB79 -:1043300001F30DF1100B03F11000594620440192D6 -:1043400000938DF813700AF0C3F9009B254A2344AB -:1043500098737068E37A90F818C0D0E9081EA1FB42 -:104360000C010CFB0E11C018C6F814B1D2F800B045 -:1043700041F10001CDE90401019ABBF1000F25D004 -:104380000AFB03F101F1170310312344214406F124 -:10439000F4000092D847009AC0B1E37A0AFB034ABE -:1043A00004238AF80F30E37A3A440133E372238915 -:1043B000AB42A2D8224698F8001006F1080007B0D8 -:1043C000BDE8F04F16F031BE0223A5E70D21E37AD8 -:1043D00001FB03434FF00001D973E4E71D46E6E714 -:1043E00068500021883A00212DE9F34743681546BB -:1043F0009A7E80460E4600F1080722B3197E4FF0E0 -:104400000009B6FBF1F44FF0010A4C4304F0FF043D -:104410005FFA89F6314638460DF1070216F029FE9B -:1044200018B9002002B0BDE8F087D8F8041090F960 -:104430000C208B7E63439342F3DB1DD10A7E9B1AD3 -:104440000373012343734FF0000838460DF1070250 -:104450005FFA88F116F00DFE04460028E1D02089AD -:10446000002835D0A17A14F00EFF86420ED3361AFA -:10447000F6B208F10108E8E7437B23B90B7E80F828 -:104480000DA0D21A027309F10109C1E794F80AC01C -:1044900023890CFB06F29342EBD90D219B1A63454D -:1044A000A8BF63464E43A019817B2B816368298096 -:1044B0001344EB60002306F11001214469606B6135 -:1044C000C37B63B11736344403202B826C61A9E7A8 -:1044D000A37B1034E8602B8001206C60A2E70220EF -:1044E000A0E7F7B506460F4600F1080537B12846A4 -:1044F0000DF1070116F0B7FD044608B903B0F0BD91 -:10450000A17A208914F0BFFEE37A874223BFC2B2AA -:104510009B18BA1ADB1928BFD7B2A27A2CBFDBB21C -:10452000DBB2E37202FB03F3228938BF0027934218 -:10453000DCDB0DF10701284616F08CFD206816F033 -:1045400071FD204607F03EFAFFF772FC96F8243022 -:10455000002BCBD196F86830002BC7D1337C0133C8 -:104560003374C3E72DE9F347002581468A46174691 -:104570002E4600F10808BAF1000F08D0711B404622 -:104580000DF10702C9B216F074FD044610B902B06D -:10459000BDE8F087A17A208914F075FEE37A8245A0 -:1045A0002ABFC0B253441B18A27A2CBFDBB2DBB2C5 -:1045B000E37202FB03F322892ABFAAEB000A4FF041 -:1045C000000A5FFA8AFA9342D5DBBE420ED20DF1A1 -:1045D0000701404616F03EFD206816F023FD2046F8 -:1045E00007F0F0F9FFF724FC0135EDB299F824301B -:1045F0000136F6B2002BBED199F86830002BBAD143 -:1046000099F81030013389F81030B4E708B50B3051 -:1046100016F06EFC00B1083008BD62F07F0201F8B0 -:10462000042C5430083916F063BE406D18B103797C -:104630000830DB090B70704708B5543016F04AFE9D -:1046400018B1BDE8084016F079BC08BD426D42B112 -:10465000137903F07F03013BDBB213710BB9FFF752 -:10466000EBBF704708B5084B5B780BB9002008BD5D -:10467000064B1B68988D0C3080B216F0CBFC0028DE -:10468000F4D00A30F3E700BFDC500021DC4D0021FC -:1046900007B5034690F8680030B10DF1070103F14A -:1046A000300016F0D7FC03E093F82C20012AF4D94F -:1046B00003B05DF804FB0A3816F0B4BC13460830AA -:1046C000A1F10A02194616F0B0BC37B500F1080492 -:1046D0000D4620460DF1070116F0C5FC48B19DF8C6 -:1046E0000730AB4207D120460DF1070116F0B2FCAE -:1046F0000A3003B030BD0020FBE707B508300DF1EC -:10470000070116F0A7FC00B10A3003B05DF804FB06 -:10471000002337B5037043680446DB7893B1012B5F -:104720000CD100F10805284616F034FE38B31434D5 -:1047300020460DF1070116F08DFC28BB03B030BDFB -:10474000FFF7B9FF2046FFF7D8FF0028F8D1104D3A -:104750002046FFF79DFF40B9636804F11000997F80 -:1047600003B0BDE8304007F0DBBB16F05BFC16F091 -:1047700009FC6B7801336B7016F010FCE8E701213F -:104780002046FFF7AEFECEE716F04CFCD0E700BFA8 -:10479000DC500021F8B500250646044606F8385BD3 -:1047A00094F83430E178AB4208D8012905D104F1FE -:1047B0005405284616F0EEFD80B1F8BD56F8047B8E -:1047C00047B149B1012902D1788806F091FD3846F8 -:1047D000FFF79EFF0135E3E70221F5E72046FFF7EB -:1047E0002BFFE6E70346B0F8680048B9064A12789E -:1047F00042B10122D866A3F8682083F87010704790 -:104800000C20704707207047DC500021B0F868305A -:104810005BB9012280F87010A0F8682080F86A2047 -:104820008365C3650366184670470C20704790F88F -:1048300068200B462AB1583007C883E807000020DB -:1048400070470C207047000070B50C46054616F006 -:10485000DBFB4FF498720D4E0D4B1860336893F8E4 -:104860003A3002FB030016F0CFFB4FF45472094BB1 -:104870001860336893F8393002FB0300401BA042F4 -:104880009BBF054B054A0020DA6170BDDC4D00215D -:10489000D4390021D0390021685000213001500363 -:1048A0000023F0B500F1380290F83470184687B054 -:1048B000CDE90033CDE90233CDE904339F4208D876 -:1048C0000F4B9B6A1BB110B1694603AA984707B00A -:1048D000F0BD52F8041B81B191F824406CB90E7CF4 -:1048E0005EB1B1F802C006AD05EB4005013025F818 -:1048F00018CC25F80C6C0C74C0B20133DEE700BF95 -:104900006850002130B58DB00546144610230A4684 -:104910000C48694618F058FA684604A904230A4A64 -:1049200018F052FA102328460DEB030208A918F0DC -:104930004BFA04232146054A08A818F045FA0DB0A1 -:1049400030BD00BF58250301682503016C25030114 -:1049500030B50B790133DBB20B71047EC57E05FBEC -:1049600004F2934224DA4A780132D2B2944202D954 -:104970004A70012030BD00248A78013D0132D2B254 -:10498000AA424C7001DA8A70F3E78C70827E002AAA -:10499000EFD1447E9C42ECD80A710B780133DBB234 -:1049A0000B7090F83400984294BF00200120E1E79A -:1049B000CA78013C01324C70CA70427E9A42D8D803 -:1049C00000234B70CB700B71E7E70B78F0B5013328 -:1049D000DBB20B7090F834209A422DD800240B796A -:1049E0000C700133DBB20B71067EC77E4A7807FB81 -:1049F00006FC01326345457ED2B216DC964201D9EF -:104A00004A7006E08A784C700132D2B2974205D9DA -:104A10008A70AB422CBF0020012005E08C70807EA4 -:104A20000028F6D1AB42F4D3F0BD9642E8D8CA785C -:104A30004C700132CA70ECE70120F5E708B5FFF7CA -:104A400065FA18B1036D0BB10023036508BD0000C2 -:104A50002DE9F041164B044618608378FF2B1AD1DC -:104A600000254FF45478134E134F0DE008FB05F367 -:104A70003A68D018D35C33B1C37823B98378E1782E -:104A800023800AF06FF80135336893F839309D427E -:104A9000ECD3BDE8F081C378032BE1D00078FFF7B9 -:104AA00019FA0028F5D0E178BDE8F0410AF05AB8CB -:104AB000D8390021DC4D0021D03900212DE9F843FF -:104AC0000446FFF745FA064618B10C263046BDE805 -:104AD000F8832078FFF7FEF90028F6D16588062DC7 -:104AE00000F282804FF485636B43424F07EB03096A -:104AF000FB5C002B78D02846FFF708FA08B1112696 -:104B0000E4E799F88A32002BDFD094F8188099F8FE -:104B100096324345F3D3B8F1060F01D90D26D5E7F8 -:104B2000FFF78AFA8045F9D86FF0180004F11903ED -:104B30009846217E001BC21891424BD84FF48563E2 -:104B400003FB0577227997F8D1329A4250D1207829 -:104B5000FFF77CF905460028E0D00A2294F800907F -:104B6000254B80F80290FB600765637D414680F825 -:104B70005530E38A57305343C0F81930227E00F88D -:104B8000012C1CF003FC237905F1740285F8343301 -:104B900004F11501631D53F8040B8B4242F8040B1A -:104BA000F9D1164F04203B7BA5F8649085F86C3052 -:104BB00040F21153A5F8663016F02CFA0146002891 -:104BC00084D02378038040F211134380387B16F0A1 -:104BD00032FA7BE713F8012B42B1062A8FD899F8F5 -:104BE00096C29445A7D28AE742266FE712266DE760 -:104BF00025266BE7D01D00213D4A010168500021A8 -:104C000010B50446FFF766F928B921464220BDE8F1 -:104C10001040F0F772BAC37813B121460C20F6E7C2 -:104C2000042016F0F7F9014648B140F21123438001 -:104C3000034B0480187BBDE8104016F0FCB910BD92 -:104C4000685000212DE9F04100F1C40704460D46EB -:104C500000F1F806D0F890803022002138461CF090 -:104C6000BCFB4FF4C072002130461CF0B6FB4FF481 -:104C70008073A4F8DC30012384F8DE302E4B7C22D4 -:104C8000C4F8E0302D4B3046C4E93934C4F8F06044 -:104C900008F1B0011CF07AFBE87B6E6907214643FE -:104CA00095F8380014F0C4FD254B2269C4F89431FE -:104CB000244B3044C4F898316B68C4E93400C4F81C -:104CC0008C309B1AC4F88830AB7A0025002B0CBFBF -:104CD0001E234FF49673A4F88630B4F88410284647 -:104CE000FBF762FCB4F88630D4F898201844D4F866 -:104CF0008C3013441B1AC4F8CC3023694000C4F82C -:104D00009001C4F8D8302046FFF75CFA00213846FD -:104D100015F0E6FC70B9D4E90832013342F1000223 -:104D2000C4E908322269D4F88C3015441344C4F81D -:104D30008C30D2E7BDE8F081B1B8000129C0000194 -:104D4000FDB70001E5B4000170B500264B8C0D469F -:104D500083808B8D0446C3804B6AC0F87832CB8D3C -:104D6000A0F87C320A7C0276CB7B437691F8203027 -:104D7000C3760B7E837691F848308377D1E91001B2 -:104D800033461CF035F96A69C4E90801E969A87B72 -:104D900091423BD341439639E677A162FF2384F8E1 -:104DA000A23095F8383084F8C03095F8493084F84E -:104DB0003433D3B104F23D300246D5F84A3005F120 -:104DC0006201C4F83533D5F84E30C4F8393305F1F3 -:104DD000520353F8046B8B4242F8046BF9D104F58B -:104DE0009E7204F17401FFF78DFD40F2E242AB893F -:104DF000002053432361EB69E3606B692363AB6A73 -:104E0000A36005F02FF8A4F8840070BD012342438D -:104E1000963AE377A262C1E70C2370B50D4680F89D -:104E2000B83204460021686AFFF720F9D5E90C235F -:104E30000125C4F8BC0280EA1040C4E9A023A4F80C -:104E4000B00284F8AE5204F5207014F0F1FAB4F810 -:104E50007C321B02C4F8C03294F8C03084F8C532EA -:104E600094F83433002B46D040F20123A4F81633D3 -:104E7000D4F8353304F53F70C4F80C33D4F8393323 -:104E800094F80C23C4F81033D4F8BC3284F81553CA -:104E90005A4084F80C2394F80D2304F5A67182EA95 -:104EA000132284F80D2394F80E2382EA134284F827 -:104EB0000E2394F80F2382EA1363024684F80F331B -:104EC00004F59E7353F8045B8B4242F8045BF9D1FE -:104ED00040F20123A4F82433074B1B685BB1074A57 -:104EE00011680122611A064C09116143BDE8704046 -:104EF0000831C9B2184770BD743A0021D039002179 -:104F00001D52138C38B5054604200C4616F082F865 -:104F1000014650B1AB78C470038011238370034BFA -:104F2000187BBDE8384016F086B838BD68500021BF -:104F30004FF4987210B50B4C0021236893F83A3067 -:104F40005A43094B18681CF048FA4FF4547223680E -:104F50000021BDE8104093F839305A43034B1868DC -:104F60001CF03BBADC4D0021D4390021D03900219E -:104F700008B5094A094B5A64094A0A4B5A64FFF7B3 -:104F8000D7FF094B1B681B790A2B81BF074A136A9D -:104F900043F00043136208BDB14F0101040D00212D -:104FA000514A0101B00C0021DC4D00216850002164 -:104FB000FFF7BEBF10B5037EBBB18168A9B1427EC9 -:104FC000846AB2FBF3F2C37ED21A837E5A4303692A -:104FD000807F012809BF081902FB0330C01803FBBA -:104FE00002001CBF611A401810BD41F28830FBE777 -:104FF00000220C4B1B6893F839000B4B1B68904246 -:1050000001D800207047197841B1D978012902BF31 -:1050100093F8A11041F0010183F8A110013203F5CA -:105020005473ECE7DC4D0021D03900214FF4547368 -:105030000A385843084BA0F5D4601B6803445A78DB -:10504000012A06D1D3F8CC0021B1D3F8D0300B60BF -:1050500070470020704700BFD0390021FFF768BFBC -:1050600010B5FDF73BFB00220A4B1B6893F8391083 -:10507000094B1B68914207D9DC78012C05D11C6DC6 -:10508000844202D100221A6510BD013203F5547327 -:10509000F0E700BFDC4D0021D039002108B5FDF755 -:1050A0001DFBBDE80840B830F0F720B838B5FDF773 -:1050B00015FB384B04461B681879FEF70BFF90F878 -:1050C0003433002B61D0392384F8BA30D0F835332B -:1050D00004F58572C4F80231D0F8393300F24D314D -:1050E000C4F8063100F23D3353F8045B8B4242F8BA -:1050F000045BF9D1012384F8B8300369264AA3FB85 -:105100000232DB0F43EA4203A4F8C43090F8343093 -:1051100084F8C630437E84F8C730017E84F8C81016 -:10512000036BC4F8CC30837E84F8D030C368C4F8F5 -:10513000D430C37E84F8D8308388A4F8DA30D0F82D -:105140007832C4F8DC308368C4F8E030C388A4F84F -:10515000E430B0F87C32A4F8E630D0E9A023C4E90A -:105160003A2390F8C03084F8F030D0E90835A3FB3A -:10517000013201FB0521C4E93E31837F84F800310F -:1051800090F8343384F8013138BD212384F8BA30E3 -:10519000B0E700BFBC390021E3361A0070B5044601 -:1051A000FBF742FAC4F8780204F09CFD0D23000AD4 -:1051B0000021A4F87C0284F8B832D4F87802FEF713 -:1051C00055FF0125364EC4F8BC0280EA1040D6E9EE -:1051D0000E23A4F8B002C4E9A02384F8AE5204F56B -:1051E000207014F025F9B4F87C321B02C4F8C032E8 -:1051F00096F8303084F8BA3294F8C03084F8C4326B -:105200000023A4F8C63294F83433002B46D040F281 -:105210000123A4F81633D4F8353304F53F70C4F8ED -:105220000C33D4F8393394F80C23C4F81033D4F881 -:10523000BC3284F814535A4084F80C2394F80D239C -:1052400004F5A67182EA132284F80D2394F80E2344 -:1052500082EA134284F80E2394F80F2382EA136340 -:10526000024684F80F3304F59E7353F8045B8B42B7 -:1052700042F8045BF9D140F20123A4F82433094B2E -:105280001B685BB1084A11680122611A074C0911B9 -:105290006143BDE870400831C9B2184770BD00BF16 -:1052A00020500021743A0021D03900211D52138C66 -:1052B0000228034609D003280FD0002A14BF042374 -:1052C000002358180A30C0007047002A14BF042079 -:1052D000002008440B3080007047002A14BF0420CF -:1052E00000200844800100F53470704738B504464A -:1052F00090F834230D46017990F8C000FFF7D8FFED -:10530000E17F00F196020129637E07BFE2606A43F4 -:1053100022635A430CBF2263E260226B013B53437A -:10532000E168013D01FB0533184438BD83782DE960 -:10533000F041FF2B04461ED00078FEF7CBFDC0B134 -:10534000E178BDE8F04109F023BC08FB05F33A68B9 -:10535000D018D35C3BB1C378012B04D18378E178BA -:10536000238009F015FC0135336893F839309D42EC -:10537000EBD3BDE8F08100254FF45478014E024F85 -:10538000F2E700BFDC4D0021D039002108B50D4AFD -:105390000D4B0E481A640E4B0E4A1A640E4A0F4B00 -:1053A000DA61FBF753F9FFF7C3FD06F065F90C4B23 -:1053B0001B681B790A2B81BF0A4A136A43F080439A -:1053C000136208BD5D500101040D0021F14F010180 -:1053D000B00C00212D530101E1B60101780C002130 -:1053E000DC4D0021685000212DE9FF4D814E84786D -:1053F0003368054693F83A30A34201D20D2096E077 -:10540000FEF71AFE8442F9D82878FEF763FD0028DB -:1054100040F0EC806878FEF73DFD012800F0E88060 -:105420002878FEF713FD04460028E7D033682A7B6E -:1054300093F830306878934228BF13462B73FDF7FA -:105440004DF90123E370EB7B0646A377AB7BE37753 -:10545000687B0BF0A8FF022803D0042814BF0120AA -:10546000032084F8C0002B7C84F834338BB10821EE -:1054700004F2353004F23D3717F03EFD1021384676 -:1054800017F03AFD384604F59E7205F11101FFF759 -:1054900039FA288940F2E241FB28034628BFFB2362 -:1054A0006A68A380B2FBF1F34B439A42E080A260AA -:1054B000236108D00123A377D328034628BFD32331 -:1054C0002833A38002E0A37F012BF5D0A18813F03D -:1054D000DAFEC0B220762B7B0133DBB25843E37691 -:1054E000A37EC2B262762BB3101A43435BB223771A -:1054F00001236377A376A9782046FFF7F7FE002300 -:10550000A376FF23A0622377A9782046FFF7EEFE5B -:10551000A0622046FFF74EFD4FF47A726B89E0627D -:1055200053438342204608D2FFF734F9112004B0D8 -:10553000BDE8F08D4FF0FF33D9E7FFF72FFE3EB106 -:105540002D4B9B695A025CBF96F8423A84F8BA32F6 -:10555000A188E08813F097FE082843D92046FFF77A -:1055600019F91220E3E72046FEF70AFD68B3D8E9EF -:105570000EABB4F87C2294F8C030CDE900AB0293B6 -:10558000D4F87812FEF7A2FD1EBB0137AB78BB4200 -:10559000E9D84EB1194B2665C6F8D03B184BC6F872 -:1055A000D43B184BC6F8D83B042015F033FD014618 -:1055B0000028BCD02B7803804FF488734380124BB3 -:1055C000187B15F038FD0020B1E72046FFF7E2F820 -:1055D00014E7D8F818305B0244BF96F8423A84F8D2 -:1055E000BA32D2E70027DFF81080CFE70C209EE721 -:1055F00042209CE7DC4D002120500021AD500101EC -:105600009D50010161500101685000212DE9F043D6 -:1056100085B084780546FEF70FFD844201D90D2040 -:105620000BE02878FEF756FC002840F0AD80687843 -:10563000FEF730FC012803D1122005B0BDE8F0834D -:105640002878FEF703FC04460028E8D00123C37045 -:1056500095F82230837795F82130C37795F82000AC -:105660000BF0A1FE022803D0042814BF0120032060 -:1056700084F8C00095F8263084F834338BB10821C3 -:1056800004F2353004F23D3617F036FC1021304676 -:1056900017F032FC304604F59E7205F10801FFF761 -:1056A00031F940F2E242EB8BA380AB8BE3806B6875 -:1056B000A3602B8B5343236195F82320227695F822 -:1056C0002400E07695F82530A376A97E617602FB6A -:1056D000101191FBF2F25A4384F85E20002B39D06E -:1056E0004B435BB22377A9782046FFF7FFFDA0620A -:1056F0002046FFF75FFCE0622046FFF74FFDA188E0 -:10570000E08813F0C0FD082896D800261F4FAB781C -:10571000B34222D86878FCF7E1FF48B11C4B206502 -:10572000C0F8D03B1B4BC0F8D43B1B4BC0F8D83B58 -:10573000042015F06FFC014600283FF47EAF2B7863 -:1057400003804FF488734380144B187B15F073FC6F -:10575000002072E74FF0FF33C4E72046FEF710FC4D -:1057600070B1D7E90E89B4F87C2294F8C030CDE945 -:1057700000890293D4F87812FEF7A8FC0136C6E738 -:105780002046FFF707F84AE70C2056E72050002193 -:10579000AD5001019D50010161500101685000218F -:1057A00010B50C46FEF796FB78B1C378012B0ED1ED -:1057B0004378012B0BD190F8A13080F8BA4043F028 -:1057C000020380F8A130002010BD4220FCE70C202D -:1057D000FAE7000030B504468BB00D4624220021C4 -:1057E00001A81BF0FAFD2922A3788DF80220ADF85C -:1057F00000308DF803508DF804508DF8053025B138 -:10580000684613F045FD0BB030BDA36A194A0293F8 -:10581000E36A3834039394F888308DF8103014F824 -:105820001F3C8DF8113014F8203C8DF8123014F81C -:105830001E3C8DF8133014F81D3C8DF8143034F8EC -:10584000343CADF8163054F8283CA3FB0232DB0F91 -:1058500043EA4203ADF8183014F8043C07AA8DF867 -:105860001A30AB42CCD954F8041B0135498822F8D0 -:10587000021BF6E7E3361A0007B52A228378ADF853 -:105880000220ADF800308DF8043090F8BA30684648 -:105890008DF8053013F0FCFC03B05DF804FB00004C -:1058A00038B5054604200C4615F0B4FB014650B14E -:1058B000AB78C470038010238370034B187BBDE862 -:1058C000384015F0B8BB38BD6850002138B5036DBD -:1058D00004460D4693B1062015F09CFB014668B1C5 -:1058E000236D5B78C57003800E238370A3780371EA -:1058F000034B187BBDE8384015F09DBB38BD00BF99 -:10590000685000212DE9F04F044600F1C407D0F89B -:10591000389087B000F1F8083022002138461BF09B -:105920005CFD4FF4C072002140461BF056FD236D14 -:10593000DFF844A2D3F8A05114F03EFD4FF4807379 -:10594000A4F8DC30012384F8DE308C4B09F1B0017F -:10595000C4F8E0308A4B0646C4E939347C2240461C -:10596000C4F8F0801BF012FD637FDFF81892002B63 -:1059700000F08D80844B4FF454711B68B3F8328073 -:10598000DAF80030E31A1B1109FB03F35FFA83FB1B -:105990000023DAB2934536D835440026454494F8BE -:1059A00034102046FFF7A2FCA0622046FFF702FB5E -:1059B000E37F94F81980012B236BE0621FBF03FB88 -:1059C00008F394F83400E36003FB00F84FF007019C -:1059D00094F8C00008BF03FB08F813F029FF637EAA -:1059E0004044082BC4E9340023D9A37EE27E002B77 -:1059F00040D1012A40F2BA80013A637EE276227EEB -:105A00009B1A6376CBE701FB03F2DAF8000000EBA8 -:105A1000020C825C5AB1DCF8D0200593049214F099 -:105A2000CBFC4FF45471049A059B9044804401339D -:105A3000AFE705EB000814F0BFFCA36840449842B0 -:105A4000D3D2524BE17F524AC4F89031514B0129D5 -:105A500018BF1346DAF80010C4F89431601A001128 -:105A600009FB00F0236D10F0FF00D3F89C8179D181 -:105A7000002632E0207E637E02FB00F18B42B8DD1F -:105A80001B1ADBB29942637689D1A67687E794F830 -:105A900034102046FFF72AFCE37F256B012B637E41 -:105AA000A06203FB05F51CBF94F83430E5604FF0AD -:105AB000070194F8C00018BF5D4313F0B9FE054418 -:105AC000C4E93455BDE70133DBB2C21AD0D46A430E -:105AD0008E188A5C002AF6D0C43600252E4A236927 -:105AE0000292D4F8D0200C30009229461A46C4F80D -:105AF000D8300195C0B214F07FF9B8B346B9224A44 -:105B0000236D1268D3F8A011558E03F5CA766D1A6D -:105B10000323DAF800100093611A091109FB01F15F -:105B20000C3133464246D4F8D000C9B214F01AFA08 -:105B300005444544C4F8CC502046FEF743FB002101 -:105B4000384614F0CDFDA8B9D4E90832013342F14A -:105B50000002C4E90832D4F8CC3022691344C4F8F6 -:105B6000CC30E9E701234FF45475AEE70D2007B0C0 -:105B7000BDE8F08F0020FAE7D0390021DDC4000134 -:105B800035C700011D52138CDC4D002121C30001DB -:105B900025C20001A5C200012D5001010022F8B567 -:105BA0001C4E0446336893F835701B4B186895B249 -:105BB000AF4201D800232BE003461978013200F5EB -:105BC00062700029F3D14FF4627218461BF005FC95 -:105BD0000122034602703268104992F822202A44BA -:105BE00092B20281097B80F85C10A3F8BC2244F2D7 -:105BF0000F7245F20120A3F8BE22FF22A3F856003F -:105C000083F8C41283F8042383F80823A279DA7294 -:105C10001846F8BDDC4D0021E43900216850002110 -:105C200000230370704700000146002230B50A4B84 -:105C30001B6893F83540094B1B68944201D800203B -:105C400030BD1D8918468D4202D11D78002DF7D137 -:105C5000013203F56273F0E7DC4D0021E4390021E5 -:105C600070B5002204460B4B1B6893F835500A4B65 -:105C70001B68954201D8002070BD1E7818462EB1D1 -:105C8000DE7AA64202D11E7B8E42F5D0013203F5A8 -:105C90006273EEE7DC4D0021E4390021002210B5EB -:105CA0000B4B1B6893F835100A4B1B68914201D8C7 -:105CB000002010BD1C782CB193F8CA4214B1DC88C6 -:105CC000844203D0013203F56273EFE70120F0E76D -:105CD000DC4D0021E4390021002230B50D4B1B685A -:105CE00093F835400C4B1B68944201D8002030BD1E -:105CF0001D898D4207D01D782DB193F8CA5215B178 -:105D0000DD88854203D0013203F56273ECE70120A0 -:105D1000EDE700BFDC4D0021E439002108B5FFF7B5 -:105D200083FF03780BB1C08808BD4FF6FF70FBE717 -:105D300008B5FFF779FF20B190F84700003818BF89 -:105D4000012008BD2DE9F04100220546144B1B68D7 -:105D500093F83410134B1B6897B2B94201D8002452 -:105D60001BE01C4613F89C6B0132002EF4D14FF05F -:105D700001089C22314620461BF02FFB1822314699 -:105D800084F80080A571278104F158001BF025FBE1 -:105D900013F0EEFA404614F061FA2046BDE8F081B7 -:105DA000DC4D0021DC39002108B50023A0F87C304F -:105DB00080F88030C3700371C375038013F0E0FA7C -:105DC000BDE80840012014F05FBA0000014600223F -:105DD00030B5094B1B6893F83440084B1B6894425C -:105DE00001D8002030BD1D78184615B19D798D422F -:105DF000F8D001329C33F2E7DC4D0021DC39002180 -:105E000070B50C46054615F0FFF84FF462720D4E62 -:105E10000D4B1860336893F8353002FB030015F022 -:105E2000F3F89C22094B1860336893F8343002FB76 -:105E30000300401BA0429BBF054B064A00209A610D -:105E400070BD00BFDC4D0021E4390021DC390021A8 -:105E50006850002188039C0030B500244271039AE9 -:105E600001290480C470047181708471826002D140 -:105E70000373C47630BDB3FBF1F20F2901FB12337B -:105E800028BF0F2113440373C47600F10C03C0F143 -:105E9000FF2000F57F00D5B2F530C2189142E9D954 -:105EA0001A782A4403F8012FDC73F6E78378012B74 -:105EB00005D190F8FC02431E58425841704700201B -:105EC0007047000030B50A4B4FF462741B6893F8BA -:105ED0003520084B1968002318469A4200D830BD77 -:105EE00004FB03F54D5D0DB90130C0B20133F4E799 -:105EF000DC4D0021E43900212DE9F0410025064662 -:105F00002C464FF00A08077DAF4202D82046BDE874 -:105F1000F08108FB05F3B2693078D15CFFF7A0FE91 -:105F200008B10134E4B20135EEE72DE9F041002576 -:105F300006462C464FF00E08C77CAF4202D82046DA -:105F4000BDE8F08108FB05F372693078D15CFFF79A -:105F500087FE08B10134E4B20135EEE7C07D704739 -:105F60000846704738B50546E5E92A230446284621 -:105F700013F05EFA0123D4F8E42084F8D63082EAE4 -:105F80001242E189A4F8D8202846002213F06EFAC4 -:105F900084F8E000284613F0B6FA002384F8E10004 -:105FA000237738BD2DE9F04707460026DFF86C80DF -:105FB000DFF86C90DFF86CA0D8F8003093F835303B -:105FC000B34201D8BDE8F0874FF462737343D9F848 -:105FD0000020D418E188B9421ED1D35CE3B14FF45C -:105FE00095622546DAF8003002FB0733D3E98623B1 -:105FF000E5E92A23284613F01BFA01230022E18950 -:10600000284613F033FA84F8390184F8E000284672 -:1060100013F079FA84F8E1000136CDE7DC4D002178 -:10602000E4390021B43A0021254A70B515684FF4CF -:1060300095620446C38800F5BE7602FB03553146DF -:1060400005F2A92205F2992016F09AFED5F8B93288 -:10605000C4F88C31D5F8BD3294F88C21C4F8903155 -:10606000D4F8E4305A4084F88C2194F88D2182EAE7 -:10607000132284F88D2194F88E2182EA134284F849 -:106080008E2194F88F2182EA136384F88F310123E3 -:10609000A27A84F8A531B2FA82F20A4B52091B683F -:1060A00084F8A42113B13046217A984795F8A4309A -:1060B00084F8943195F8A53084F8953170BD00BF0F -:1060C000B43A0021743A002100F1580200F1700343 -:1060D00052F8040B38B1884202D101204870704751 -:1060E0009A42F5D10020704700F1580200F1700388 -:1060F00052F8040B40B1884203D1002301204B70B9 -:1061000070479A42F4D10020704770B5C46E0546BE -:106110000E462CBB00F1580353F8042B22B9012082 -:10612000163445F8246070BD31691269914214D962 -:1061300004F11700052C4FEA8000A0F10401C4BF50 -:106140006C217020C4F105024FEA82022944C8BFC5 -:10615000002228441BF027F9E1E70134062CDBD1AB -:106160000020E0E7C36E10B573B900F1580252F891 -:10617000044B8C4203D024B9163340F8231001207D -:1061800003E00133062BF2D1002010BD10B500232F -:10619000044600F1580252F8040BA0B1884213D112 -:1061A00003F116008000C3F10502052B00F1040184 -:1061B0004FEA82022144C8BF002220441BF0F3F8BA -:1061C00000230120E36610BD0133062BE3D100203C -:1061D000F9E700F15803703053F8042B1AB15278E4 -:1061E0001AB98342F8D1012070470020704738B5B2 -:1061F0000446FFF7EEFF50B98B7A20461BB9BDE885 -:106200003840FFF771BFBDE83840FFF7BFBF00203F -:1062100038BD00F1580200F17003002052F8041B51 -:1062200019B1497809B10130C0B29A42F6D170472C -:1062300000F1580200F1700352F8040B20B14178CC -:1062400011B99A42F8D10846704700F1580200F19E -:10625000700352F8040B38B1417811B1B0F84A100C -:1062600011B19A42F5D10020704738B50446FFF7C6 -:10627000B0FF68B904F15803703453F8042B22B10D -:1062800055781DB18B1A5842584138BDA342F4D1FC -:106290000020FAE710B50446FFF79BFF034658B904 -:1062A00004F15802144654F8040B30B1884203F14B -:1062B00001030CD1052B01DD002010BD52F8230095 -:1062C0000028FAD041780029F7D10133F2E7062BF4 -:1062D000E9D1F1E738B50446FFF77BFF68B904F16F -:1062E0005802703452F8043B2BB18B4206D05D78D3 -:1062F000002D18BF1846A242F4D1002038BD00F18D -:10630000580200F1700352F8041B29B1487808B113 -:10631000087E10B19A42F6D101207047002110B5D5 -:1063200000F15803703053F8042B22B1547804B1B3 -:1063300011768342F7D110BD70B50024012500F11C -:106340005802703052F8043B43B15E7826B18B425C -:1063500000D00CB101241D769042F3D170BD10B570 -:106360000446302014F0C4FD58B100230246C36235 -:10637000234604F12C0153F8044B8B4242F8044BA2 -:10638000F9D110BD10B504460846FFF7E8FF30B15B -:10639000237A2BB9C4E9000001200133237210BD18 -:1063A0006268D0626060F7E710B50446007A58B1C1 -:1063B0002068C36A236014F0C1FD237A013BDBB27D -:1063C000237203B96360012010BD38B5037A044617 -:1063D0000BB1056805B938BD2046FFF7E5FFED6A4A -:1063E000F8E70000F7B50446C07AFFF7EFFC002697 -:1063F000002200230546C4E90A23C4E90C23012135 -:106400002089E68184F8466084F8FC6284F8CA62D8 -:1064100004F06EFF0221208904F06AFF04F58A70FF -:10642000FFF7D3FF04F59070FFF7CFFF04F52E7050 -:10643000C4F8ED60A4F8F160C4F8F360A4F8F76064 -:1064400015F007F804F1500015F003F8214628462E -:10645000FFF70BFF01280BD1AB786876012B1BBF30 -:1064600094F8EC22D4F8F032D4F808315343EB61BD -:10647000A37A264E012B25D10023214628462370DE -:10648000FFF7B5FE2846FFF7A4FE10B12846FFF738 -:106490008BFC204605F0B2FB33781BB1052120466A -:1064A000EFF7A8F804F5567528460DF1070114F02A -:1064B000D1FD38BB94F8D81204F55A7005F030FDC0 -:1064C00003B0F0BD21462846FFF791FE2846FFF7AE -:1064D00080FE88B100276B796F76012BEF702F71EA -:1064E0000AD10B4B18680B4B281A801058430A30FE -:1064F000C0B213F013FD6F713378012BC9D10023A3 -:106500002370BFE714F08EFDCEE700BF000D002121 -:10651000DC390021976FF996007AB0FA80F04009D3 -:106520007047000038B5154B1C684FF4956303FBAA -:106530000044B4F82C04FFF777FB034610B900259C -:10654000284638BD0579012DF9D194F87F2352B141 -:10655000002384F87F3394F88033002BEFD004219C -:10656000EFF75EF8ECE794F876231AB1D4F86C22D2 -:10657000002AE4D104211846F2E700BFB43A002112 -:1065800070B5054600240D4B1B6893F835600C4B25 -:106590001A68A3B29E4202D80021084670BD117845 -:1065A000012907D1D388AB4204D11046FFF77EFC06 -:1065B0000028F2D1013402F56272EAE7DC4D0021D5 -:1065C000E439002108B5FFF72FFB40B10378012B18 -:1065D00005D1FFF76BFC003818BF012008BD002073 -:1065E000FCE7C2680B46920004D5282103F1500055 -:1065F00014F020BF7047C3689B0003D501F1500021 -:1066000014F027BF70470000022816D0032817D0C7 -:10661000012821D10E32D200022902F196021DD0AA -:1066200003291FD0012902D10E3302EBC302144B00 -:106630001B68D88E9630104470470F329200EBE7FB -:10664000104804328069C0024BBF1201920102F56A -:10665000E77202F53472DFE70022DDE70F3302EB69 -:106660008302E4E7074904338969C9024BBF02EB9F -:10667000031202EB831202F5E77202F53472D6E7D9 -:10668000DC4D0021205000212DE9F0410024054679 -:1066900026464FF00A08077DA74202D83046BDE8DB -:1066A000F08108FB04F3AA692878D15CFFF7D8FAD7 -:1066B00090F82C3190F8302190F8D51290F8D4024F -:1066C000FFF7A2FF01340644E6E700004FF46272D0 -:1066D00010B50B4C0021236893F835305A43094B11 -:1066E00018681AF07AFE9C2223680021BDE8104049 -:1066F00093F834305A43044B18681AF06EBE00BF4A -:10670000DC4D0021E4390021DC39002110B5837A09 -:106710000446FBB9B0F8DA2294F8D8322BB9D4F891 -:10672000283313B9A36AC4F82833D4F8283320894E -:10673000591CC4F8281394F8201305F0C1FC0A4A28 -:10674000127852B914F06EFCD4F82833013BC4F827 -:10675000283310BDB0F8DC22DEE70028F4D0BDE815 -:10676000104004F075BC00BFDC5000212DE9F04161 -:106770000026038988B00446314600F55A70ADF80A -:106780000030ADF8046005F0DFFC0546002875D147 -:10679000414B9B699B0366D5A37A012B74D194F876 -:1067A000A130002B5FD105F081FC064600285AD0AD -:1067B00014F0E8FB394A53780133537014F0EEFBC0 -:1067C000A37AD4F80053002B63D1D4F8E0321D44EF -:1067D00023891422ADF808304FF481730021C4F8E6 -:1067E000005303A8ADF80A301AF0F7FD236B02A995 -:1067F000ADF81430022330468DF81830049508F0B7 -:1068000010F83346226B218904F5427005F06EFAC8 -:1068100010B9304614F006FC94F80833012B04D16B -:106820001F4B2021187B14F0A1FCBDF8043001257A -:106830000133ADF8043016E033464046226B21891F -:1068400005F054FA10B9304614F0ECFB0125BDF800 -:1068500004300133ADF80430384602A914F0FAFBD5 -:1068600006460028E8D10E4BDB6A23B11DB169460C -:10687000012001AA984708B0BDE8F081354604F52B -:106880005E7704F54278E7E7002BECD194F86130AD -:1068900087E7D4F8E4329AE720500021DC50002149 -:1068A00068500021F0B5038989B0ADF800300023AD -:1068B0000446ADF8043005F0F9FB294F05460028E1 -:1068C00041D014F05FFB274A53780133537014F022 -:1068D00065FBA37AD4F80063002B3DD1D4F8E032F5 -:1068E0001E4423891422ADF808304FF4817300212F -:1068F000C4F8006303A8ADF80A301AF06EFD236BEC -:1069000002A9ADF81430022328468DF818300496F9 -:1069100007F087FF2B46226B218904F5427005F0B2 -:10692000E5F910B9284614F07DFB94F80833012BE3 -:1069300003D12021387B14F019FC0125BDF8043067 -:106940000133ADF80430FB6A23B11DB16946012063 -:1069500001AA984709B0F0BDD4F8E432C0E700BFFF -:1069600068500021DC5000212DE9F843D0F8343381 -:1069700004469E073CD54F4B9B691D0438D54E4AB3 -:106980004E4B156800221B68DFF8348193F83510F0 -:10699000D8F800304B4FC31ADB107B4391422AD901 -:1069A000E88898422ED1287860B395F8CA0248B397 -:1069B000AB7A012B21D195F8D42294F855309A4224 -:1069C00019D094F84534D4F8481404F24C49B1FB7A -:1069D000F3F14942484649B2F9F786FE0023C4F86C -:1069E000483484F84534AB7A83B195F8D4620FE02B -:1069F000002384F81A34BDE8F883002BE1D195F820 -:106A0000D522DAE7013205F56275C7E795F8D56258 -:106A1000032E34D195F8463103F0FD03581E43424E -:106A200043411E4494F85134F6B2032B29D8002573 -:106A300094F82A349D4202DA5B429D42DBDC94F8F2 -:106A40008533162BD7D0D4F88C335B02D3D40620F1 -:106A500014F0E0FA014670B1D8F800300571E31A7D -:106A6000DB107B43038042F601034380164B4671E3 -:106A7000187B14F0E0FA002384F85134BBE70023BC -:106A8000CFE74846F9F722FE94F91C54854207DA0D -:106A9000A31993F83D33D90702D42D1A6DB2C7E775 -:106AA00094F91D548542C2DDA31993F83D339A072A -:106AB000BDD4F2E720500021E4390021DC4D002153 -:106AC000B43A0021BDCAE28C68500021F8B5002418 -:106AD0009C270C4D0C4E2B6893F83420E3B29A425D -:106AE00000D8F8BD7B433268D018D35C1BB1C37D9E -:106AF0001BB9FFF759F90134EDE7283013F0C8FF4F -:106B0000F9E700BFDC4D0021DC390021837810B5A6 -:106B1000FF2B04460AD00088FFF786F850B1064BD9 -:106B2000E1781C60BDE8104008F04AB8BDE81040AC -:106B3000FFF7CCBF10BD00BFE0390021022803D011 -:106B4000042814BF012003207047531E434301FB58 -:106B500000010133C9B2DBB2B1FBF3F203FB121146 -:106B6000C9B2D0B209B10130C0B2704770B50D469C -:106B700042F21074194642F21173654303FB00F6AA -:106B8000B6FBF5F405FB146606B1013442435A43E3 -:106B9000B2FBF5F005FB102202B1013004EB8404D6 -:106BA000204412F070FB023070BD00002DE9F04768 -:106BB0001378164603730B7B0D4680F8D6324B7B59 -:106BC000044680F8D73240F2E24391F80EE080F8B4 -:106BD000D8E24A6841F288309A428A6898BF4B608E -:106BE0009A4298BF8B60D1E901C161450A4628BF2E -:106BF0006246904238BF1046BB4BB6F80280A0FBFD -:106C00000337DB0F43EA470340F2E2479BB25F439F -:106C1000B84288BF0133A4F8E832B079B388B34FE3 -:106C2000BEF1000F0FD140F2E249B4F8E8E209FBEF -:106C30000EFEB2FBFEFA0EFB1A22002A00F058816B -:106C4000012284F8D822C4E9B8C1B8F1000F61D19B -:106C5000424667E03B6893F8380040F2E2494FF45F -:106C60007A7884F8EA02B4F8E812688A3B6809FB8B -:106C700001F108FB00F093F838A012F001FB824507 -:106C800025D23B6893F83820B4F8300184F8EB2221 -:106C900040BB84F8F402B4F82C0178BB84F8F50208 -:106CA00094F8EA72317A757A94F8F40294F8F5322D -:106CB000BA4228BF3A46A94238BF2946984238BF4F -:106CC0001846FFF742FF84F8EC02BDE8F087B4F8FD -:106CD000E812688A09FB01F108FB00F012F0D0FA13 -:106CE000C2B2D1E7B4F8DA52B5FBF0F1CBB241430E -:106CF000A942B8BF013384F8F432CCE7B4F8DC52CF -:106D0000B5FBF0F1CBB24143A942B8BF013384F8DF -:106D1000F532C5E73A6808F10501D28D8A42A8BF6D -:106D20000A4692B2A4F83021002B00F0AA803A68FB -:106D3000591DD28D8A42A8BF0A4692B2A4F82C21CE -:106D4000A4F8DC32A4F8DA820AF02DFBFFF7F6FE95 -:106D500084F8D402F0790AF026FBFFF7EFFE40F248 -:106D6000E2494FF47A7884F8D502B4F8E812288A18 -:106D70003B6809FB01F108FB00F093F838A012F022 -:106D80007FFA82457FD23B6893F8380040F2E249AF -:106D90004FF47A7884F8EA02B4F8E812688A3B681B -:106DA00009FB01F108FB00F093F838A012F068FA33 -:106DB000824573D23B6893F8382084F8EB22B6F80A -:106DC0000280B4F8DAE2B8F1000F72D03B68D98DD6 -:106DD0000EF105039942A8BF1946C9B2B388B4F8A9 -:106DE000DC023BB13B6800F1050CDB8D6345A8BFBD -:106DF0006346DBB2BEF1000F5DD184F8F4E20028F7 -:106E000066D184F8F50294F8EAC2717A337A624561 -:106E100094F8F4A294F8F50238BF6246994238BF5C -:106E20001946504538BF5046FFF78FFE40F2E24307 -:106E3000B4F8E89284F8EC0203FB09F942465346A1 -:106E400069684846FFF792FEB288804694F8F532AA -:106E50004846A968FFF78AFE72882AB13B68DA8D36 -:106E6000424528BF424692B2B388A4F830212BB1E4 -:106E70003B68DB8D834228BF03469BB2A4F82C31CC -:106E800023E71A465AE7B4F8E812288A09FB01F109 -:106E900008FB00F012F0F4F9C0B277E7B4F8E8129A -:106EA000688A09FB01F108FB00F012F0E9F9C2B2AF -:106EB00083E7414692E7BEFBF1F909FB01F15FFA76 -:106EC00089FC8E45C8BF0CF1010C84F8F4C296E72A -:106ED000B0FBF3FC0CFB03F35FFA8CF19842C8BFE4 -:106EE000013184F8F5128EE7E3361A00DC4D0021FB -:106EF0003A68C4E9B8C1D28DA4F8DC3242451146E3 -:106F000028BF41469A4228BF1A46A4F83011A4F877 -:106F10002C21A4F8DA820AF046FAFFF70FFE84F873 -:106F2000D402F0790AF03FFAFFF708FE4FF47A78BE -:106F300084F8D502B4F8E812288A3B6809FB01F10D -:106F400008FB00F093F838A012F09AF98245FFF49C -:106F500081AEB4F8E812288A09FB01F108FB00F0C1 -:106F600012F08EF9C0B278E62DE9F0470646194BCB -:106F700000271B684FF09C0A5D8E13F01DFADFF8A6 -:106F800058800544D8F80030F41A144BA4105C4320 -:106F9000E4B2FBB29C420ED8F46813F00DFA40F252 -:106FA000E242B38A204453435B1B98428CBF0020CB -:106FB0000120BDE8F087D8F800300AFB07331A79C2 -:106FC00032B1D3F8349013F0F7F909EB0503C51883 -:106FD0000137DEE7DC4D0021DC390021976FF9969F -:106FE0002DE9F84F06460C464FF000084FF00E0A08 -:106FF000E27C2078424563691FD8677C1978012FAD -:1070000040F08A80FEF72CFE4FF00E0B054690F8FC -:10701000EC32D0F8F0225343C0E90433F360B0F807 -:10702000E832B382E37CBB424BD8637C3046B3701A -:10703000FFF79AFFB075BDE8F88F0AFB08F2995C7C -:10704000FEF70EFE014605463046FFF78BF8637CDF -:10705000012B29D10027B94612E00AFB07F3626928 -:107060002078D15CFEF7FCFD90F82C3190F83021AF -:1070700090F8D51290F8D402FFF7C6FA0137814490 -:10708000E37C9F42E9D395F82C3195F8302195F8AF -:10709000D51295F8D402C5F8F092FFF7B5FAC5F805 -:1070A000080108F10108A3E795F82C3195F8302183 -:1070B00095F8D51295F8D402FFF7A6FAC5F8F002B4 -:1070C000EDE70BFB07F362692078D15CFEF7C8FDA2 -:1070D0004FF000088146C2460BFB08F36269207836 -:1070E000D15CFEF7BDFD90F82C3190F8302190F87E -:1070F000D51290F8D402FFF787FA08F10108474546 -:107100008244E9D12B690137A3EB0A03C9F8103097 -:107110002B69C9F8143085E7FEF7A2FD0027054664 -:107120004FF00E0AE37CBB4205D82B69F360B5F83B -:10713000E832B38279E70AFB07F362692078D15C11 -:10714000FEF78EFDB9468046E37C4B4504D82B699B -:107150000137C8F81430E5E70AFB09F362692078C3 -:10716000D15CFEF77DFDD8F8103090F8EC22D0F815 -:10717000F01209F1010901FB0233C8F81030E3E70E -:1071800038B54B680446C0F8E0328B681546C0F845 -:10719000E4320B7B80F8EA324B7B80F8EB32CB8910 -:1071A000A0F8E8320B7C80F8D6324B7C80F8D732DE -:1071B0008B7C80F8D83213780373537880F8EC32E4 -:1071C0005388A0F8DA329388A0F8DC32907A0AF07B -:1071D000EAF8FFF7B3FC84F8D402E87A0AF0E3F89F -:1071E000FFF7ACFC84F8D5022B7B84F8F4326B7B80 -:1071F00084F8F532F9F7F8F94FF495610A4BE28813 -:107200001B68C4F8E40001FB0233D3F84822B3F84A -:107210008232C4F8E820A4F8C832EB88A4F83031F0 -:107220002B89A4F82C3138BDB43A00212DE9F04166 -:1072300000244FF462780E4E0E4F336893F83530C9 -:10724000A34201D8BDE8F08108FB04F33A68D518E1 -:10725000D35C53B105F1FC0014F09CF828B9E87A2E -:10726000FEF7B4FD283013F03FFC0134E5E700BF22 -:10727000DC4D0021E439002170B500250A4E336849 -:10728000ACB293F82230A34201D8002070BD204652 -:1072900001F09EFB30B1204601F0BEFB10B9204644 -:1072A000FEF780FE0135EAE7DC4D002108B5EBF77B -:1072B00093FAEBF7F9F8FFF709FABDE8084012F086 -:1072C00029BA00002DE9F84FDFF89080824698F83F -:1072D0000130002B40D00025214C2A462F4626465F -:1072E0004FF0010904F11A0B31788D4214D38FB39A -:1072F00092B389B3062013F08DFE014660B3F38983 -:10730000038042F20143438073888380154B187BCE -:10731000BDE8F84F13F08FBE9BF80010A9B9E189C2 -:10732000514511D104208BF8009013F073FE0146F3 -:1073300040B162880B4B028040F20F224280187BE2 -:1073400013F079FE012200E00127013502340BF130 -:10735000010BC9E788F80170BDE8F88FB050002133 -:10736000E8390021685000212DE9F84F05460C4608 -:1073700000274FF00A08237DBB4217D84FF00A09B7 -:10738000677BAE6D012F6BD196F8EC32D6F8F02208 -:107390005343C6E90433EB60B6F8E832AB82237D91 -:1073A000BB4232D8002640F2E247F4E008FB07F384 -:1073B000A2692078D15CFEF753FC014606462846B8 -:1073C000FEF7D0FE637B012B12D12046FFF75CF95C -:1073D00096F82C31C6F8F00296F8302196F8D512BE -:1073E00096F8D402FFF710F9C6F808010137C2E792 -:1073F00096F82C3196F8302196F8D51296F8D402EA -:10740000FFF702F9C6F8F002EEE709FB07F3A269FD -:107410002078D15CFEF724FC4FF000088246C3467A -:1074200009FB08F3A2692078D15CFEF719FC90F8FB -:107430002C3190F8302190F8D51290F8D402FFF753 -:10744000E3F808F1010847458344E9D1336901377E -:10745000A3EB0B03CAF810303369CAF814309EE767 -:1074600033461946002091F8EC72D1F8F02202FB65 -:10747000070005F15807BC4600225CF804EB013216 -:10748000714517D1163255F822100029EBD1002290 -:1074900018613169596157F8040B013283420CD1EC -:1074A000163255F82230002BDBD1B6F8E832E9600D -:1074B000AB8277E7052AE0D1E9E7052AEBD1F4E7CB -:1074C00009FB06F3A2692078D15CFEF7C9FB4FF4F3 -:1074D0007A7390F8D8C2228ABCF1010F03FB02F242 -:1074E00090F8EA82D0F8E032D0F814E0B0F8E81270 -:1074F00036D17344D21A07FB01F39A423BD3B2FB55 -:10750000F3F2D3B2434528BF434680F8EA329B46A4 -:107510004FF47A73628ABCF1010F03FB02F207FB9E -:1075200001F190F8EBA2D0F8E48226D1C644A2EB98 -:107530000E028A4203D3B2FBF1F15FFA81FCE2450D -:10754000524628BF624680F8EB22BBF1000F1FD1E4 -:10755000637B2846AB70FFF707FDA875BDE8F88F81 -:107560001A4407FB01F3A2EB0E029A4203D3B2FBCB -:10757000F3F3DBB2C6E70123C4E74244A2EB0E0EED -:107580008E4502D3BEFBF1F1D7E74FF0010CD6E7F1 -:10759000002ADDD00136237D9E4291D30027B846D4 -:1075A000237D9F4204D3B8F1000F7FF4E9AECFE70B -:1075B00009FB07F3A2692078D15C9A46FEF750FBDD -:1075C0000646A36990F8EBE290F8EA22534493F858 -:1075D00009C0197A90F8F40296F8F532724528BF7E -:1075E0007246614538BF6146984238BF1846FFF77A -:1075F000ACFA96F8EC32013783421CBF4FF0010819 -:1076000086F8EC02CCE700002DE9F84F044600783C -:107610000F46FEF7DBFB054640B92078FEF792FBEC -:10762000054618B907263046BDE8F88FEB7D0BB14B -:107630000C26F8E7884B5B78012BF9D06E78002E8A -:10764000F6D12046FEF758FC844B8046D3F800C0A4 -:107650004FF00A0E334694F81490994529DCB8F19E -:10766000000F71D1FEF72EFC814500F2F380C24677 -:107670004FF00A0B237D43452CD821462846FFF7BF -:1076800073FE4FF001084FF00A09434695F8168043 -:10769000B8F1000F54D000274FF00A08237D9F4215 -:1076A000C0F0C680AA7D002A00F0CC8085F880302A -:1076B000B9E7A2699CF830A00EFB0322107A517A38 -:1076C000504528BF5046514528BF5146107251724F -:1076D0000133C2E72846FEF761FA814680F80AA026 -:1076E000A26921460BFB0822FFF760FAB9F80830BF -:1076F00027F8183008F10108BCE737F81A00FEF740 -:1077000093FAA26909FB0A22137A1BB14FF0010810 -:10771000013B1372537A1BB14FF00108013B5372C6 -:107720002146FFF743FA21462846FFF71DFEAB7DB1 -:10773000002BAAD10AF1010A237D5345DDD8A4E725 -:10774000012BA8D1C246F7E7FEF7BCFBA9EB08085E -:1077500080453FF767AF4FF00009CB46237D4B458F -:1077600011D821462846FFF7FFFD4FF001084FF0E2 -:107770000A09434695F81680B8F1000F8BD1012B0A -:1077800089D1C24650E00A2303FB09FAA269207896 -:1077900012F80A10FEF764FA8046E0B190F804335C -:1077A000A269FF2B524403D05388002B3FF440AF13 -:1077B00098F80833FF2B03D09388002B3FF438AFA1 -:1077C00021464046FFF7F2F9B8F8083027F819309B -:1077D00009F10109C2E72846FEF7E0F980F80AB08E -:1077E000A269804621465244ECE737F81A00FEF7BA -:1077F0001BFAA26909FB0A22137A1BB14FF0010898 -:10780000013B1372537A1BB14FF00108013B5372D5 -:107810002146FFF7CBF921462846FFF7A5FDAB7DB2 -:10782000002BA6D10AF1010A237D5345DDD8A0E73C -:1078300008FB07F3A2692078D15CFEF711FA90F8F3 -:10784000EA320BB91126EEE690F8EB32002BF9D0B4 -:10785000013723E70926E6E6B0500021DC4D002180 -:107860002DE9F0470746FEF7B1FA0546002844D057 -:107870000022DFF88C80DFF88C90D8F8003093F885 -:107880003510D9F80030914211D82846FEF766FB32 -:107890000446A8B906464FF4627AD8F8003093F847 -:1078A0003530B34218D82846FEF77EFA09E018783A -:1078B00001280DD1D87AB8420AD1987A012803D18B -:1078C0000C242046BDE8F08793F847000128F7D044 -:1078D000013203F56273D6E70AFB06F3D9F80020FC -:1078E000D018D35C012B06D1C37ABB4203D1837A73 -:1078F0000BB9FEF795F90136CFE70224E1E700BFA7 -:10790000DC4D0021E43900212DE9F84F04460078D0 -:107910008846FEF75BFA28B1C37D002B5BD1207847 -:10792000FFF79EFF2078FEF70DFA064610B90720F4 -:10793000BDE8F88F2046FEF7F8FAE77C054618BB4D -:10794000FEF7C0FA874248D8A9464FF00E0AE37CFA -:10795000AB4208D830462146FFF742FBE37C0020CB -:1079600086F88030E4E73046FEF718F9074680F8DD -:107970000A90626921460AFB0522FFF701FC3B8958 -:1079800028F815300135E2E73D1AFEF79BFA8542EB -:10799000CDDC00274FF00E09BA46E37CBB42D9D9B3 -:1079A00009FB07FB6369207813F80B10FEF758F901 -:1079B000054648B1626921465A44FFF7E1FB2B892D -:1079C00028F817300137E8E73046FEF7E7F80546B4 -:1079D00080F80AA0EEE70C20AAE70920A8E700003B -:1079E00008B51E4A1E4B1F48DA631F4B1F4ADA6355 -:1079F0001F4B204A1A60F8F729FE1F4B1F4A1A60D6 -:107A00001F4B204A1A61204A5A61204A9A61204A33 -:107A1000DA61204B204A9A61204ADA61FEF756FE6D -:107A200011F078FE03F028FE1D4B1E4A1A601E4B13 -:107A30001E4A1A601E4B1F4A1A601F4B1F4A1A60CB -:107A40001F4A204B1A60204B1B681B790A2B81BFF1 -:107A50001E4A136A43F08053136208BDAD720101E0 -:107A6000040D002179720101B00C00210D6B0101A0 -:107A7000EC4D0021A55F01011C3A0021696901015B -:107A8000780C00212D720101CDAC01012DAC01015A -:107A9000E1B60101C04B0021A1F2010101F1010198 -:107AA000143A0021C5650101203A0021C572010187 -:107AB000783A00219D5C0101703A00211D5D0101B1 -:107AC000315D0101183A0021DC4D00216850002190 -:107AD0002DE9F047DFF8A880044698F801300D46FC -:107AE000012B46D000264FF0010AB146B44220D8FF -:107AF0000123002288F80130224B10461E461C70DC -:107B000003F11A01944203F1020326D1062013F077 -:107B100081FA014658B1F389038042F20143438060 -:107B200073888380184B187B13F085FA0020BDE81A -:107B3000F0872B6833F81600FEF776F80746D0B1C9 -:107B4000FEF7B4F9012818D0F87AFEF73FF90136AC -:107B500087F8199080F801A0C8E72F6837F81270ED -:107B60001F806F6837F8127001329F8101F8010B96 -:107B7000C8E70C20DBE70220D9E70B20D7E700BFDE -:107B8000B0500021E8390021685000212DE9F04172 -:107B90000546FEF74DFB3D4B0446B0F8068000F568 -:107BA0009C7730220021286705F128001E6819F013 -:107BB00014FC4FF4C0720021384619F00EFC0A2361 -:107BC00084F8383194F8E03040F2011284F8393109 -:107BD0002F4B1B6893F82830A4F8482184F83A31D9 -:107BE000D4F8E430C4F83C31D4F8E830C4F840317B -:107BF000B4F8D432A4F84431264B9B69DB025DBF54 -:107C00004FF4956303FB086393F85620A4F84621CC -:107C10005CBF84F8462193F857301F4A58BF84F858 -:107C2000473140F20123A4F8963104F12803C4F847 -:107C30009C3104F13003C4F8A031EB686A64AB6393 -:107C40004FF48073A5F840300123144A85F8423080 -:107C5000C5E91225124A6F65C4F8D021114AC4F84B -:107C6000D421114AC4F8D821104AC4F8DC21104AA2 -:107C7000C4F8E0210F4AC4F8E4210F4AC4F8E8210F -:107C80000E4AC4F8EC21EB70BDE8F081B43A002153 -:107C9000DC4D002120500021E5D10001DDD500019F -:107CA00035CE0001FBD0000135D00001C7D0000166 -:107CB000E7D00001E3D10001F1D5000105D60001B4 -:107CC000304B70B54FF4C0720446C688002100F5F1 -:107CD0009C701D6819F081FB0A2384F8383194F8F0 -:107CE000E03040F2011284F83931274B1B6893F8D9 -:107CF0002830A4F8482184F83A31D4F8E430C4F8A4 -:107D00003C31D4F8E830C4F84031B4F8D432A4F8A7 -:107D100044311E4B9B69DB025DBF4FF4956303FB4F -:107D2000065393F85620A4F846215EBF84F84621F6 -:107D300093F8573084F8473140F20123A4F8963184 -:107D400004F12803C4F89C3104F13003C4F8A031D5 -:107D50000F4BC4F8D0310F4BC4F8D4310E4BC4F8DC -:107D6000D8310E4BC4F8DC310D4BC4F8E0310D4B6B -:107D7000C4F8E4310C4BC4F8E8310C4BC4F8EC31D6 -:107D800070BD00BFB43A0021DC4D0021205000211D -:107D900035CE0001FBD0000135D00001C7D0000175 -:107DA000E7D00001E3D10001F1D5000105D60001C3 -:107DB0002DE9F743B2F84830B1F806529046AB428D -:107DC0000446CA69B1F80AC200F1280942D8B1F8DC -:107DD0000462B1F85E74073606FB0757BEB240F284 -:107DE000E247808AA8F84860761B0CFB06F61D4B1C -:107DF00007FB06251E681C4BA61BB6105E4303231B -:107E00000A3600932A4601F114037843F1B212F0C6 -:107E1000A9F8B0F5FA7F38BF4FF4FA70C8F84C00F3 -:107E200040F2E241D8F84C2048461544D8E90423F2 -:107E3000D21AE368256313446363A38A15444B4352 -:107E40006562E363094912F04BFC0123237103B01F -:107E5000BDE8F0835E1B40F2E2450CFB06F605FB35 -:107E60000625DDE7DC390021976FF996615F010196 -:107E70009C235843054BA0F5C3601B680344187945 -:107E800018B1586A09B1DB680B607047DC39002112 -:107E90001A4A70B5002315461178994207D9068908 -:107EA00032F8024FA6420AD101222B449A760024CE -:107EB000134BA14205D80022124B5A7070BD0133FA -:107EC000EBE713F8012BB2B9062013F0A3F8014633 -:107ED0000028F3D005EB4403DB8905EB4404038061 -:107EE00042F2014343806388BDE870408380064BC3 -:107EF000187B13F0A0B80134DBE700BFE83900219C -:107F0000023A0021B05000216850002108B5EAF77C -:107F100063FCEAF7C9FABDE80840FEF7D7BB0000EA -:107F200008B5184A184BDA63184B194ADA63194B2B -:107F3000194A1A60194B1A4A1A601A4B1A4A5A619E -:107F40001A4A9A611A4ADA611A4B1B4A9A611B4A09 -:107F5000DA61FEF7BBFB03F08FFB194B194A1A607D -:107F6000194B1A4A1A601A4A1A4B1A601A4B1B68A4 -:107F70001B790A2B81BF194A136A43F0005313621D -:107F800008BD00BF0D7F0101040D0021B00C0021D0 -:107F90000D6B0101EC4D0021A55F01011C3A002190 -:107FA00069690101780C0021CDAC01012DAC010102 -:107FB000E1B60101E84B002141F4010101F10101A9 -:107FC000143A0021C5650101783A00219D5C010148 -:107FD0001D5D0101703A0021DC4D00216850002137 -:107FE00070B50E46FDF720FE0546F8B18478FCB961 -:107FF000C378022B1CD04FF495610E4BC2881B68CE -:1080000001FB023393B19B7893B1062013F002F881 -:10801000014648B1EB880671038042F20163438058 -:10802000054B187B13F007F8204670BD0224FBE7D0 -:108030000C24F9E7B43A00216850002138B5FDF767 -:10804000F3FD0546F0B18478F4B9C378022B1BD058 -:108050004FF495610D4BC2881B6801FB02338BB155 -:108060009B788BB1042012F0D5FF014640B1EB881C -:10807000038042F201534380054B187B12F0DBFF73 -:10808000204638BD0224FBE70C24F9E7B43A00216E -:10809000685000212DE9F0410546FEF7C9F83F4B35 -:1080A0000446B0F8068000F59C773022002128674E -:1080B00005F128001E6819F090F94FF4C0720021F4 -:1080C000384619F08AF90B2384F8383194F8E030F7 -:1080D000B4F8D42284F83931314B52BA1B6893F882 -:1080E0002830A4F8442184F83A31D4F8E43040F23E -:1080F0000112C4F83C31D4F8E830A4F84821C4F89F -:108100004031284B9B69DB025DBF4FF4956303FB55 -:10811000086393F85620A4F846215CBF84F84621F2 -:1081200093F85730204A58BF84F8473140F2012372 -:10813000A4F8963104F12803C4F89C3104F130030B -:10814000C4F8A031D4F8F0326A646B63EB68174A64 -:10815000AB634FF48073A5F840300123C5E91225C5 -:10816000134A85F842306F65C4F8D021114AC4F82B -:10817000D421114AC4F8D821104AC4F8DC21104A8D -:10818000C4F8E0210F4AC4F8E4210F4AC4F8E821FA -:108190000E4AC4F8EC21EB70BDE8F081B43A00213E -:1081A000DC4D0021205000216DDD0001CDE10001FA -:1081B0003FDB000101E4000165E30001E5E30001AC -:1081C000EDE300016BDD0001E1E10001F5E10001FB -:1081D000304B70B54FF4C0720446C688002100F5DC -:1081E0009C701D6819F0F9F80B2384F8383194F865 -:1081F000E030B4F8D42284F83931274B52BA1B68E6 -:1082000093F82830A4F8442184F83A31D4F8E430C3 -:1082100040F20112C4F83C31D4F8E830A4F8482107 -:10822000C4F840311D4B9B69DB025DBF4FF4956381 -:1082300003FB065393F85620A4F846215EBF84F84A -:10824000462193F8573084F8473140F20123A4F8CF -:10825000963104F12803C4F89C3104F13003C4F8CA -:10826000A0310F4BC4F8D0310E4BC4F8D4310E4BB3 -:10827000C4F8D8310D4BC4F8DC310D4BC4F8E031F3 -:108280000C4BC4F8E4310C4BC4F8E8310B4BC4F888 -:10829000EC3170BDB43A0021DC4D002120500021AA -:1082A0003FDB000101E4000165E30001E5E30001BB -:1082B000EDE300016BDD0001E1E10001F5E100010A -:1082C0002DE9F74F044616460F4600F1280BFDF73F -:1082D000AFFF40F2E24AD7F8D0310546306EB7F82A -:1082E0000A2203440AFB0233B7F8C811A367A4F8B3 -:1082F0007E10F8F759F9626BA16F02EB4009A28A70 -:108300000B1A0AFB02F22363E2634FEA4008D6E944 -:1083100004329B1A0B4408F10108C4F834906362DC -:1083200006F1A80AC5F800825846194912F0D8F992 -:10833000024620B10123237103B0BDE8F08FE98923 -:108340000123013189B2E981504611F08FF885F897 -:108350003901504611F0D7F886F8E100EA89A38A7E -:10836000B7F8C811534340F2E24253431846019311 -:10837000F8F71AF9A26F019B13441B1A236309EB48 -:10838000000308EB40006363C5F80002CCE700BFC0 -:10839000615F010110B5044612F0F4FD034B5878FB -:1083A00004445C70BDE8104012F0F8BDB4500021E8 -:1083B000F8B50E46054612F027FE4FF495670C4BB4 -:1083C00018600C4B1B6893F8224007FB0404611BE8 -:1083D000B14201D90020F8BD2046711A00F0C0FF5B -:1083E0000028F7D0044B0444DF81601BF3E700BF93 -:1083F000B43A0021DC4D00216850002102884188F8 -:1084000010B58A4222D840F67A448B1F9BB2A34211 -:108410001CD8063A92B2A24218D88388B3F5FA7FE4 -:1084200014D240F6C41201339BB24B43534342F281 -:108430001072C0884243934208D240F676430A380D -:1084400080B298428CBF1220002010BD1220FCE7A1 -:108450004FF495620D4B15391B68C9B20E2902FB0A -:10846000003310D80A4A525CFF2A0CD093F88513C7 -:108470000120914208D0D3F88C339040184214BFA9 -:108480000120002070470020704700BFB43A00214F -:10849000702503014FF495635843054B1B681A1868 -:1084A000185C18B1D2F88803C0F38000704700BF91 -:1084B000B43A00214FF49562054B1B6802FB003073 -:1084C000D0F8883343F00403C0F88833704700BF06 -:1084D000B43A00214FF49562074B1B6802FB00334E -:1084E00093F80A2332B901200A8883F80A03A3F813 -:1084F0000823704700207047B43A002130B54FF48C -:10850000956409499DF80C50096804FB0010D0E9F6 -:10851000024125B122430B43C0E9022330BD24EAC6 -:10852000020221EA0303F7E7B43A00212DE9F047FC -:1085300000273D46DFF8D891DFF8D881D9F8003020 -:1085400093F82200D8F80030A3F59566A84201D828 -:108550000020D8E007F59562B15CDC19002940F0F5 -:10856000D4804FF49562204618F037FF0123DFF8DE -:10857000A8A12370DAE90623C4E90223DAE90A2371 -:10858000C4E9CC23C4E9CA2344F20172A4F88A22C4 -:1085900045F20112A4F8E62345F201325F4BA4F83C -:1085A000EA221B7B45F2014284F8903284F8EC33D6 -:1085B00084F8F03284F8043384F8103446F601135A -:1085C000574EA4F80A347388A4F8FE22A4F84A335C -:1085D000D9F80030B288DB8CADB2FB2B28BFFB236F -:1085E000A4F846339B0103F57473A4F848331B23A6 -:1085F000A4F84E334B4BA4F84C23C4F850334FF43B -:10860000A473A4F88852A4F8E453A4F8E852A4F898 -:10861000FC52A4F80854A4F8543340F2011304F2B5 -:108620004E31A4F85430204600F0DBFE04F246310F -:10863000A4F86003204600F0D4FEB37DB28A84F82B -:108640006433062384F896329AF84030A4F85E0327 -:1086500084F8F233F37DA4F8622384F87033338B0B -:10866000A4F87233738BA4F8743340F20223A4F895 -:108670006633022384F868332B4B1B681BB11B68DD -:108680000BB128469847D4F834230023910721D50D -:10869000DAF8182012041DD5012284F81A24D9F81A -:1086A000002084F8193492F8421084F81C1492F8CF -:1086B0004320C4F8203484F81D24042284F81E3496 -:1086C00084F82A2484F82934C4F8483484F84534DA -:1086D00084F851340125F269B38CC4F85424326A09 -:1086E000A4F85C34C4F85824A4F85E5410F040FE9A -:1086F0009AF8003028462B448AF8003011F0AEFD7D -:10870000D8F800003844BDE8F087174601351DE76A -:10871000DC4D0021B43A0021205000216850002196 -:10872000B450002148011B00B83A0021F7B50446B7 -:1087300001F0C3F8FFF72EFE204601F02BF82B4E78 -:1087400004F5197738460DF1070112F083FC054650 -:1087500000283CD104F5217012F07BFE04F57870FE -:1087600012F077FE04F5397012F073FE04F53E70D6 -:1087700012F06FFE04F2044012F06BFE04F28C4023 -:1087800012F067FE1A4B1B481D681B4B651BED1052 -:1087900045431B68ADB21BB15B680BB128469847D7 -:1087A000164B1B680BB1284698470023D4F80004E9 -:1087B000237008B112F036FC10F0E2FD104A0120DF -:1087C0001378013B137011F05FFD03B0F0BD9DF80D -:1087D0000730FF2B06D012F0D5FB3378013333700E -:1087E00012F0DCFB284612F01DFCABE7B450002170 -:1087F000B43A0021BDCAE28CB83A0021203A0021E7 -:108800002050002170B590F80F22034601FB022290 -:1088100090F80E120A4491B2242909D94DF66852F3 -:108820004A43520D02EBC20002EB8002891A89B260 -:10883000C1F12005D3E98626A1F12004CA4006FA39 -:1088400005F52A4326FA04F42243C8B2D20783F876 -:108850000E020AD493F810228A4203D8122A07D9AA -:10886000801AC0B2184490F8200270BD801AC0B2BD -:108870008242FBD9F6E700221346F0B5D0E98676AE -:10888000C3F12005A3F1200427FA03F106FA05F548 -:10889000294326FA04F42143C90744BF811881F80B -:1088A000203203F1010348BF0132252BE8D180F8C3 -:1088B0001022F0BD37B501460446684605F0FBFAC4 -:1088C0002E4ABDF80030116891F822209A4209D84A -:1088D000204612F0A7FB2A4B01215B68BDF800007F -:1088E00098470AE04FF495625343264A1268D51818 -:1088F000D35C23B9204612F095FB03B030BD6B78F2 -:10890000032BE5D0204A9DF8023012680AB9032BE8 -:10891000DED0032BBDF8042000D062B3C98C914295 -:1089200007D2002BD4D1002AD2D1012385F881327D -:10893000CEE712F027FB154A1378013B137012F0B3 -:108940002DFB95F8983273B9284600F05EFD23465A -:1089500001466A46284600F08DFD094B0421187B2C -:1089600012F004FCC9E722469DF8001005F51970C5 -:1089700012F05BFBC1E7002BD7D0A9E7DC4D00214B -:1089800068500021B43A0021B83A0021B4500021C7 -:1089900070B54FF495660B4B0B4D1B6893F8224056 -:1089A000013C06FB04F32A68D018D35C2BB9631E84 -:1089B0000CB9204670BD1C46F3E700F05DFF0028AF -:1089C000F5D0F7E7DC4D0021B43A0021FFF7E2BC17 -:1089D0004FF49562024B50431B68185C704700BF10 -:1089E000B43A0021024B1B6803B118471846704780 -:1089F000143A0021034B1B6803B118474FF6FF7070 -:108A0000704700BF703A0021024B1B6803B1184742 -:108A100018467047183A00214FF49562024B1B68C4 -:108A200002FB003398787047B43A00214FF4956206 -:108A3000034B1B6802FB003393F90C02704700BF25 -:108A4000B43A00214FF49562034B1B6802FB0033DC -:108A500093F94A00704700BFB43A00214FF4956281 -:108A6000034B1B6802FB0033D3E98601704700BF4C -:108A7000B43A00214FF49562034B1B6802FB0033AC -:108A8000D3E9CC01704700BFB43A00214FF495629E -:108A9000034B1B6802FB003393F85400704700BF80 -:108AA000B43A00214FF49562034B1B6802FB00337C -:108AB00093F85500704700BFB43A00214FF4956217 -:108AC000064B1B6802FB003090F88533132B1ABF4E -:108AD000D0F88C03C0F3C04001207047B43A0021A5 -:108AE0004FF495635843002310B5054C22680244A7 -:108AF0001A4492F86623CA540133032BF6D110BDF1 -:108B0000B43A00214FF49562044B1B6802FB00331A -:108B10005B7C194214BF012000207047B43A002149 -:108B200038B5044604200D4612F074FA014678B1B7 -:108B3000084B1868084B241AE4105C4301238B701F -:108B4000064B0C80CD70187BBDE8384012F073BA2C -:108B500038BD00BFB43A0021BDCAE28C6850002184 -:108B60002DE9F7434FF00008224FCDF804803B6811 -:108B7000214E93F8224012F005FA4FF49563651EDA -:108B80005C433368A4F59564234401AA197821B1A4 -:108B900093F87C1283F87C82A954013D691CA3F5EB -:108BA0009563F3D14FF4956812F0F8F93B68DFF85C -:108BB0004C9093F8224001AF013CE15D21B1D9F81E -:108BC00004300BB1A0B29847356808FB045595F8FE -:108BD000983243B105F51B7012F0DCFB18B13E2151 -:108BE0002846FFF79DFF631E14B903B0BDE8F0836C -:108BF0001C46E2E7DC4D0021B43A00216850002118 -:108C00002DE9FF410023464E464FDFF81C81ADF8A9 -:108C100006300DF1060000F007FE044630BB434F5E -:108C20003B6893F8225012F0ADF94FF49560336829 -:108C3000013D03F27D2302AE00FB05F2995CA955CC -:108C4000013D9C54F8D212F0A9F93B68384D93F8D5 -:108C50002240013C315D19B1AB680BB1A0B298471D -:108C6000631E002C5AD104B0BDE8F0814FF4956228 -:108C7000BDF8063053433268D518D35C2BB900F0E9 -:108C8000B7FD0120FFF786FBC3E7214602A805F0E8 -:108C900023F995F8A530F3B1264B1B687BB121462B -:108CA00005F18C00984750B9204600F0A1FD012045 -:108CB000FFF770FB48212846FFF732FFA9E7D5F8F8 -:108CC000F41205F53E7012F0BEFBD5F8E01205F582 -:108CD000397012F0B8FB9DF80830022B09D893B117 -:108CE00095F89732002BDFD12146284600F0ACFDE5 -:108CF0008FE7032B07D1D8F8003013B1214628465F -:108D000098472046BBE73B68002BFAD05B69002BF5 -:108D1000F7D02146BDF8060098477AE71C4699E748 -:108D2000B43A0021B83A0021243A0021DC4D002158 -:108D300068500021843A00210246B2F80432B2F8A9 -:108D40000A220433534303EBA30213F0030318BFB7 -:108D5000012313448B42084605D20A2903D9C81AB5 -:108D60000A2838BF0A207047F8B58B7E0746012BCA -:108D70000D4608D1CB6A1B78043B012B03D8446A0B -:108D8000637813B92F463846F8BD4E6A94F8953289 -:108D900096F895229A42F5D842F2107C40F2E240D1 -:108DA000D6F88C22B6F80A120CFB02F24143B2EB61 -:108DB000410FE7D3002BE6D1D4F88C32B4F80A2265 -:108DC0000CFB03F34243B3EB420FDCD396F885333D -:108DD000FF2BD7D194F88533FF2BD4D106F51B7028 -:108DE00012F0D8FA0028CDD004F51B7012F0D2FA98 -:108DF0000028C8D0B6F80A32B4F80A22B2EB930FB2 -:108E0000C0D3B3EB920FBDD2BDE7000008B511F09F -:108E1000C7FA142813D91E2813D9322813D94B287E -:108E200013D9642813D9962813D9FA288CBF0020A7 -:108E30000120094B93F840301844C0B208BD072008 -:108E4000F7E70620F5E70520F3E70420F1E7032024 -:108E5000EFE70220EDE700BF2050002110B50446E7 -:108E6000FFF7D4FF40B220B9012C14BF00204320EB -:108E700010BD072801D1002CF7E70020F8E700001B -:108E80004FF495635843084B1A681318105C48B1A7 -:108E900093F84820042A04D1D86919B11B6A0B60E1 -:108EA00070470020704700BFB43A002130B5837886 -:108EB000B0F80A52A3B947F6FE73B0F80642C0698B -:108EC0000A1B92B29A4240F2E24303D86A4303FB80 -:108ED000020030BD611A8AB26A4302FB1300F8E750 -:108EE00047F6FE74B0F8CA314A1CD21A92B2A242B6 -:108EF000D0F8D00103D840F2E2436A43E7E7C94320 -:108F00000B449BB240F2E2426B43E6E74FF49562BA -:108F1000044B1B6802FB0033D3F8403403B11847FD -:108F200018467047B43A0021114B10B59A6AD10522 -:108F30004CBF03230123120548BF43F004035A002A -:108F400002F008021A434FF07F33C0F8393301238F -:108F500000F5147100F515701A4214BF7E247F24A9 -:108F600001F8014B5B008842DBB2F5D110BD00BFB8 -:108F70002050002113B504460DF107010DF1060044 -:108F800014F08EF99DF90630A34207DA9DF90730F7 -:108F9000A342D4BF0220002002B010BD0120FBE795 -:108FA000294B2DE9F0471C684FF4956303FB0044FF -:108FB000D4F8503286B00846059394F94A6014F00C -:108FC000A5F90422014684F84A00054604F5147008 -:108FD00018F003FA6378022B11D1AE420FD0D4F807 -:108FE00034335B070BD5194B1F6847B10023AA1B0D -:108FF00094F854102046009352B22B46B84794F888 -:109000001734EBB10027DFF848A00DF1140818F968 -:10901000016BAE4211D0DAF80090B9F1000F0CD01C -:109020002846FFF7A7FF0022AE1B76B2CDE9010666 -:10903000114620460095FBB2C8470137042FE6D100 -:1090400006B0BDE8F08700BFB43A00219C3A002189 -:109050007C3A00212DE9FF41244B15461C684FF452 -:10906000956303FB004494F94A800AB994F854507C -:10907000084614F04BF9A0EB08077FB2064697B3F9 -:1090800094F85430AB4217D1637884F84A00022B2D -:1090900012D1804510D0D4F834335B070CD5144B73 -:1090A000D3F80080B8F1000F06D000233A460093B1 -:1090B000294603462046C047254485F84F6294F868 -:1090C000173483B10B4B1D686DB194F94A0094F8C5 -:1090D0005480FFF74FFF0022CDE9010743461146B8 -:1090E00020460096A84704B0BDE8F081B43A0021BC -:1090F0009C3A00217C3A00212DE9F84305460E46B2 -:109100000027DFF89C90DFF89C80D9F80030BCB2D3 -:1091100093F82230A34201D8002013E02046FFF745 -:1091200057FC08B32046FFF777FCF8B91E4B1B68C5 -:109130000BB12046984716212046FFF789F90128F0 -:1091400002D10C20BDE8F883102011F063FF014626 -:109150000028F6D041F20163C0E902564380134B68 -:109160000480187B11F067FF0137CEE7D8E90023B0 -:10917000B34208BFAA42F7D00D4B1C684FF4956369 -:1091800003FB0744D4F834331B0606D594F8453363 -:109190001BB113F091FFC4F8F001C8E90056E3E7F2 -:1091A000DC4D002158000021EC4D002168500021C9 -:1091B000B43A00211049F0B5C969002908DA002441 -:1091C0000E49096891F822500D490968A54201D855 -:1091D0000020F0BD0E784EB1D1E9C4769E4208BFA2 -:1091E000974203D191F81863864203D0013401F508 -:1091F0009561EBE70120ECE720500021DC4D0021D8 -:10920000B43A0021030203F00F3300F0F0300343BF -:10921000180100F0333003F0CC331843830003F01F -:10922000553300F0AA301843C0097047B0F8461211 -:109230000246B0F80602F8B54840FFF7E3FF00EB3E -:109240000010084480B2FFF7DDFF00EB0010084477 -:1092500080B2FFF7D7FF4DF6685300EB00100844CB -:10926000414089B24B435B0D03EBC30003EB80032A -:10927000CB1A9EB2C6F12005D8B2A6F12004D2E9DD -:109280008637F34007FA05F52B4327FA04F4234306 -:10929000DB0782F80E025FBF92F81002414302EB37 -:1092A000114292F82002F8BD064A074B5A60074B5C -:1092B0001B681B79082B81BF054A136A43F480435E -:1092C000136270472D9201010C3A0021DC4D002100 -:1092D0006850002108B511F055FE044A1378013397 -:1092E0001370BDE8084011F059BE00BFB450002112 -:1092F000022808D0032809D00E31C8009042A8BF28 -:10930000104680B270470F318800F7E78901B2F547 -:10931000296F38BF4FF4296201F57470EEE738B554 -:1093200083780446DBB183685B0518D5B0F8043256 -:10933000ABB113F0C1FE40F2E243B4F80A52014669 -:10934000E0695D4311F03EF8854208D2012304F143 -:10935000140084F8D931BDE8384011F099BB38BD0C -:1093600000232DE9F04705460E4682469946154AE8 -:10937000154F13603A68DFF85480D48C144A1A34BD -:109380005443C8E90033640D0234E4003B6893F8A9 -:1093900023304B4503D8AAEB0500BDE8F0875046C3 -:1093A00011F032FE00EB040AAAEB0503B3420146BA -:1093B00005D8404611F07CFF09F10109E6E70020DD -:1093C000EBE700BFC83A0021DC4D0021BC3A002188 -:1093D000692F010080F865137047002380F865331A -:1093E000704738B5CA880C460546898890F85400FD -:1093F000FFF77EFF62880346218895F85500FFF746 -:1094000077FF1844963080B238BD014690F854205A -:1094100090F86503B1F8543350B1012A06D0022AFE -:1094200008D100F00102C2F10202D2B2400717D403 -:10943000022A10D0032A13D06F2B18D9503BDB100F -:10944000043B98B21B2838BF1B20B1F85233984216 -:1094500028BF184670473B2B09D92C3B9B10EFE7E0 -:10946000B3F5747F03D3A3F534739B11E8E70020B1 -:10947000E8E700002DE9F04F9846938889B006464A -:1094800048480F461446029311F024FF0546F0B1F8 -:1094900000F108030193A38808F104029F4228BF4A -:1094A0001F46039787730027BB468381C77382607B -:1094B000029B9B451BD306F51B70019A217811F086 -:1094C000B4FD304609B0BDE8F04FFFF728BF404675 -:1094D00011F0A8FD344B208801215B689847FFF705 -:1094E000F9FE072009B0BDE8F04FF7F74DB8029B31 -:1094F000DDF80CA0A3EB0B039BB29A4528BF9A465C -:1095000000205FFA87F808F101030199DB0003F1FD -:1095100002098944A178CDE90600A4F804A009B3A2 -:10952000012925D006A94846CDE904238DF81DA0C0 -:1095300004F078FC02211D4B05EBC8081B6888F875 -:10954000101019469C46DDE90423E9B9002388F888 -:1095500011300123A3700BEB0A031FFA83FB524463 -:109560000137A5E702208DF8180086F88112D9E7A7 -:109570008DF8181096F881120129D3D102218DF8A7 -:1095800018104FF00001F0E7019904330B4406F185 -:109590008C0049460492E047049A0028D6D0042360 -:1095A000D5E700BFBC3A002168500021883A00216D -:1095B00070B590F87E320446013380F87E320B7825 -:1095C0000A461B2B0CBF032502250C4B4D1B1E68A6 -:1095D00026B16B788C300B442946B0472A4604F5F7 -:1095E0001B70FF2111F021FD054B0421187B11F0A8 -:1095F000BDFD2046BDE87040FFF791BE883A0021CE -:109600006850002137B50546063011F003FD0446C9 -:1096100058B10023CDE90033032369468DF80030AB -:109620008DF8055004F0FEFB0444204603B030BD25 -:10963000F0B500F51B7585B00F4628460DF1070102 -:10964000164611F010FD0446002849D0284611F0B6 -:10965000ADFE9DF807300546FF2B34D0A079E379A5 -:10966000024603FB00FCA18804EBC30E6044884261 -:1096700003F101039EF808004FEAC303388003F1A9 -:109680000200204478602068C8BFA1EB0C0260444F -:10969000F8609EF80900C8BF92B23A8178B138826A -:1096A0000320043323447B615DB102EB0C05A94226 -:1096B000D4BF00250125EDB2357005B0F0BD022004 -:1096C000F2E70125F7E7B0FA80F5214602A804F099 -:1096D00003FC63786D0903443B8001207C60EBE769 -:1096E0000546E9E737B500F51B7420460DF1070183 -:1096F00011F0B9FCB8B19DF80720FF2A07D0C17955 -:1097000083794D1C01FB033381888B4209DB074BB6 -:109710000DF107011860064B20461A7011F09AFCF3 -:1097200000E0C571012003B030BD00BFC83A002180 -:10973000C43A002170B5134E0546306800B3124B91 -:109740001B78FF2B19D0044654F80809043811F08F -:1097500069FC21460D4811F0ABFDFFF7BBFD95F804 -:109760007C32013385F87C3200233360084B0121C1 -:10977000BDE87040187B11F0F9BC11F053FCF3E721 -:1097800070BD00BFC83A0021C43A0021BC3A002194 -:1097900068500021F7B50025104F00F51B763046C4 -:1097A0000DF1070111F056FC044610B9284603B02C -:1097B000F0BD9DF80730FF2B0DD054F80809013596 -:1097C000043811F02FFC2146384611F071FDEDB23E -:1097D000FFF780FDE3E711F025FCE0E7BC3A00214C -:1097E0000C3008B580B211F015FC00B1023008BD94 -:1097F000023811F017BC000008B5134600F8021C2F -:10980000090A00F8011C821ED9B2054811F00DFCAE -:10981000044B0221187BBDE8084011F0A7BC00BF33 -:10982000BC5000216850002113B504460DF107011A -:10983000044811F00FFC18B19DF807300230238066 -:1098400002B010BDBC50002110B50446084B094AB7 -:109850001B68C31ADB10534300F51D708A1ED9B272 -:1098600011F0E3FB94F87D32013384F87D3210BDB2 -:10987000B43A0021BDCAE28C1FB500F51D700DF190 -:10988000070111F0E7FB0446A0B183789DF807209B -:1098900003F00303ADF80820C278012BADF80C20CB -:1098A00002D0022B18BF0323204602A98DF80A30EC -:1098B00004F0A8FA204604B010BD73B5002400F5EA -:1098C0001D7528460DF1070111F0C4FBE6B2013405 -:1098D00010B9304602B070BD11F0A4FBF1E70000F2 -:1098E0004FF49561028803464A430B49096888187A -:1098F0008A5C82B1094A1360B3F86220A0F8A224FE -:1099000093F8602080F8A024D97883780BB905F00B -:10991000A3B905F06BBA7047B43A0021B03A002100 -:109920002DE9F04100244FF495680E4E0E4F336838 -:1099300093F82230A34201D8BDE8F08108FB04F37C -:109940003A68D518D35C53B105F51B7011F022FDB0 -:1099500028B9AB781BB93D21284605F07DF90134C3 -:10996000E5E700BFDC4D0021B43A002108B5E9F776 -:10997000CFF9E9F7B1F810F02BFA00F099FBBDE848 -:1099800008400FF0D5BE000010B503780446B3B10F -:1099900082780B4804F0A8FCA37818B11E2808D0E0 -:1099A0000D2100E00C2120462BB9BDE8104005F048 -:1099B00053B90E21F7E7BDE8104005F017BA10BD06 -:1099C000283A0021837870B5FF2B044605D0BDE806 -:1099D00070400B4B1860FFF783BF0023094D084E02 -:1099E00003802B68228893F822309A4200D370BDFE -:1099F00020463460FFF774FF238801332380F0E7AB -:109A0000B03A0021DC4D00212DE9F3470446002740 -:109A10000D4600F14809002116461430302217F097 -:109A2000DCFC4FF4C0720021484617F0D6FC47F228 -:109A3000305184F80E72D5E90623C4E98623A4F8D0 -:109A4000067295F82A304FF0FF0884F80F322B8CFD -:109A50002046A4F80A326B8C4FF0020AA4F80432B4 -:109A6000AB8CC4F8F41203EB83035B00A4F88232DE -:109A7000FFF762F984F885836B69C4F8E002C4F8E3 -:109A800048322B692046C4F84C32FEF7F4FE2B69AD -:109A9000204683EA1342A4F84622042284F8482090 -:109AA000424A126892F82820E36484F84A206B69DD -:109AB0000125236540F2011384F856A0A4F8543020 -:109AC000FFF732FA84F8548204F24E31204684F8CB -:109AD000A650FFF786FC40F2E248A4F8600304F2C7 -:109AE00046312046FFF77DFCB4F86033304A2362EC -:109AF000B4F80A32226308FB03F36362A3622D4BBE -:109B00002D4AC4F8E0302D4BC4E90D24C4F8E430EC -:109B10002B4BA4F85E03C4F8E8302A4BC4F84090FD -:109B2000A58584F82E50C4F8EC30002E3BD094F874 -:109B300056102422B94208BF514694F85400D6F872 -:109B40009C510FF088FE10228146514694F8550032 -:109B50000FF081FE94F855309635032B0CBF03228D -:109B60005246194B4D441968184B611A0544C910E7 -:109B700008FB02555943B4F80A023B462A4608FB43 -:109B800000F00097C9B210F0EDF9114BA0FB0332C1 -:109B9000DB0F43EA420386F8E7342844C3F3072384 -:109BA00086F8E834E06102B0BDE8F087DC4D0021C2 -:109BB000A1E90001D5E8000199EE000189E9000161 -:109BC000C1EE0001E1EE0001B43A0021BDCAE28C11 -:109BD000E3361A000D4B10B51A68002192F83D309B -:109BE000044680F8453292F83E2080F8552080F8EF -:109BF0005420074A52F82330984784F8490004F16A -:109C00001400BDE8104010F06FBF00BFB03A002153 -:109C10000C3A002108B5204A204B21485A60214BBC -:109C2000214A5A60214B224A5A60224A9A60224AAB -:109C30001A60224B224ADA60224A5A62224B234A95 -:109C40001A60234B234A1A60F6F700FD00F030FA41 -:109C5000214B1B681979062907D9204A0729D2E91F -:109C6000083003D143F00E03136208BD082902D166 -:109C700043F02E03F8E7092902D143F48033F7E7D4 -:109C80000B29174988BF40F0800041EA03018CBFCF -:109C9000C2E908101162E8E76D990101040D002185 -:109CA000F9900101B00C0021C5990101780C002147 -:109CB000018C010121990101618B0101C04B00213F -:109CC000A1FF0101C9F70101243A0021899901018D -:109CD0000C3A002105880101DC4D0021685000216B -:109CE0002E00010508B50FF0A0FA20F07F4008BD56 -:109CF00008B50FF09AFA00F00702C0F3012305320D -:109D00001344C0F30040184408BD00004FF49561AF -:109D1000028803464A430549096888188A5C22B1CB -:109D2000034AD978136005F061B87047B43A00214E -:109D3000B03A0021F0B58BB00446FEF7F7FBD4E94A -:109D40001267054688B3C0E9C46794F83C300B211C -:109D500080F81833234B1C600123837094F8603023 -:109D600080F8A034B4F86230A0F8A23405F03EF8D0 -:109D70006FF47F42236E23F47F43934230D101205E -:109D800010F082FA94F83F3053B30021164B20783C -:109D90001A6894F84030AA1A144DD2106A4392B24D -:109DA0000BB0BDE8F0400FF09ABAB4F86230012170 -:109DB000099394F86030CDE90067CDE907030923E2 -:109DC0000693D4E91623CDE90423D4E91423CDE97D -:109DD000022394F83C3004F10802ECF77FFBC7E75C -:109DE0000BB0F0BDB03A0021B43A0021BDCAE28CFC -:109DF00010B50378044683B18278084804F074FAF9 -:109E000018B11E2807D00D2100E00C212046BDE826 -:109E1000104004F0EBBF0E21F8E710BD283A0021F6 -:109E2000837870B5FF2B044605D0BDE870400B4B1E -:109E30001860FFF76BBF0023094D084E03802B68A5 -:109E4000228893F822309A4200D370BD20463460B5 -:109E5000FFF75CFF238801332380F0E7B03A00214D -:109E6000DC4D002110B5044610F09AFA072C28BFEB -:109E70000724034B33F81430184480B210BD00BFE0 -:109E8000802503012DE9F84F7F4F00F1140830229F -:109E900000213D6800F148090446404617F09DFA4C -:109EA0004FF4C0720021484617F097FA95F84130F8 -:109EB000002B00F0E58095F83E30032B14BF0226FE -:109EC00003264FF0010A2B8EA4F8CAA11E4495F870 -:109ED0003D304FF0FF0B84F84532D5E90823C4E943 -:109EE000862395F83230B6B284F80F322B8DA4F861 -:109EF0000A3295F83300FFF7B5FF47F230516B8D0A -:109F0000A4F8C801A4F80432AB8D204603EB830308 -:109F100003FA0AF3A4F88232C4F8F412FEF70CFF35 -:109F2000062284F885B3EB69C4F8E002C4F848322D -:109F300095F82E30298D334402FB013303EB930156 -:109F400013F0030318BF534604F52170194411F0B0 -:109F50007AFA2046FEF78FFCAB69204683EA13426B -:109F6000A4F84622052284F84820484A126892F84C -:109F70002820E36484F84A20EB6923653B6893F862 -:109F80003E3084F8553084F85430FEF7CDFF84F825 -:109F9000A6A084F854B204F24E312046FFF721FA0D -:109FA00004F24631A4F860032046FFF71AFA40F2A3 -:109FB000E24BA4F85E0395F82E500BFB06F60BFB64 -:109FC00005F5B4F8C8117019F6F7EEFA3B689B6B0B -:109FD000C4F840901E442E4BC4E9735623632D4BA6 -:109FE00005EB4005C4E90D34B4F80A3205F2263712 -:109FF0000BFB03F3A362284B5544C4F8E430274B12 -:10A00000361AC4F8E830264BA4F82CA0C4F8EC307B -:10A01000244B84F82EA0DFF89090DFF890A0E66142 -:10A020002762C4F8E050C4F8F03094F845320021BB -:10A03000204659F823309847514684F84900404655 -:10A0400010F04EFBF0B9B4F80662B4F8C81101364E -:10A05000B3B2B4F80A62A4F806325E4340F2E243B7 -:10A060005E433046F6F7A0FAD4F8D0311E44361AD3 -:10A070003B1805EB4000E6612362C4F8E000D4E73A -:10A0800001261EE7BDE8F88FB03A0021DC4D002123 -:10A0900041F2000105F90001A1F100013DF20001CA -:10A0A00025F9000145F900010C3A0021698D0101F3 -:10A0B0004FF49562044B00211B6893F822305A43F9 -:10A0C000024B186817F089B9DC4D0021B43A002121 -:10A0D00008B5224A224B5A60224B234A1A605A681A -:10A0E0000AB9224A5A60224B224A5A60224A1A600E -:10A0F000224B234ADA60234A5A62234B1A680AB970 -:10A10000224A1A60224B234A23481A60F6F79EFA25 -:10A11000FFF7CEFF214B1B681979062907D9204A82 -:10A120000729D2E9083003D143F00E03136208BDBA -:10A13000082902D143F02E03F8E7092902D143F49C -:10A140008033F7E70B29174988BF40F0800041EAC8 -:10A1500003018CBFC2E908101162E8E7A9A101015F -:10A16000040D0021B00C0021359D0101219E01014B -:10A17000780C0021018C0101618B0101E84B002169 -:10A18000A9030201C9F70101243A0021F19D01014F -:10A190000C3A002105880101F9900101DC4D0021F4 -:10A1A000685000212E00010508B5E8F7B1FD0FF059 -:10A1B0000FFEFFF77DFFBDE808400FF0B9BA0000C1 -:10A1C00070B5037804460E4633B38278134804F022 -:10A1D0008BF8054638B9A378B3B10C212046BDE809 -:10A1E000704004F003BE3146A2780C4804F01EFA19 -:10A1F0000028F0D01E2DA37801D01E280AD10E21F0 -:10A200002046002BEBD101E00C212046BDE8704038 -:10A2100004F022BD0D21F3E770BD00BF283A0021F4 -:10A2200008B5FFF7F7FC0E4B0E4A1A600E4A5A604B -:10A230000E4B0F4A1A600F4B0F4A1A600F4B104A11 -:10A240001A60104A136A43F0010111620E4909684D -:10A250000979062984BF43F01103136208BD00BFCA -:10A26000C04B002169080201590D0201243A002166 -:10A27000C1A10101A43A002131CB0201A03A002181 -:10A2800035CB020168500021DC4D002170B5037808 -:10A2900004460E46D3B182780D4804F025F80546F1 -:10A2A00028B90C212046BDE8704004F09FBD31461E -:10A2B000A278074804F0BAF90028F2D01E2D01D088 -:10A2C0001E2801D10E21EDE70D21EBE770BD00BF87 -:10A2D000283A00210F4B104A1A60104A5A60104B5E -:10A2E0001A680AB90F4A1A600F4B104A1A60104BCD -:10A2F000104A1A60104A136A43F0010111620F49B3 -:10A3000009680979062984BF43F011031362FFF736 -:10A31000DFBE00BFE84B0021CD0B0201590D020149 -:10A32000243A00218DA20101A43A002131CB02017F -:10A33000A03A002135CB020168500021DC4D0021FC -:10A340004FF49562034B1B6802FB0033D3F8F40211 -:10A35000704700BFB43A002138B51B4B0D461C684E -:10A360004FF4956303FB00442046FEF7E5FCB4F888 -:10A370005E24B4F80A32854202FB03F3B4F80422E7 -:10A3800002FB033340F2E24202FB03F34FF47A7222 -:10A3900005FB02F215D0934213D894F8A530C4F807 -:10A3A000F452C4F8E00253B1294604F53E7011F0AE -:10A3B0004AF8D4F8E01204F5397011F044F801209D -:10A3C00000E0002038BD00BFB43A0021C07804F09E -:10A3D0004DBE00002DE9F047624C064604F1D00561 -:10A3E0008A46914600212C2204F19C00984616F0E2 -:10A3F000F4FF4FF4C0720021284616F0EEFF012250 -:10A400000223594F84F8B620C4F8C850574A584D13 -:10A41000387AC4E92E2284F8B43084F8D030F6F7C4 -:10A4200007FA95F83030534A84F8D230524B84F80A -:10A43000D100C4E9352340F20113A4F8DC30032332 -:10A4400094F84220A4F850310AB1A4F852312D20DA -:10A450003B7A84F89A0184F89B31484BC4F87831F0 -:10A4600010F0D8FD464BC4F86801C4F88031F6F707 -:10A47000BBF8A065FFF736FC012384F86E30B4F812 -:10A480008230E065A4F86830B388A4F86A30F388B5 -:10A49000A4F86C30D5E90E23C4E91823FFF728FC93 -:10A4A00084F87200FEF7B2FC052384F850322223B0 -:10A4B00084F85432AB6A84F87300C3F3803384F8B1 -:10A4C000513294F84130DB0746D5D5E90823C4E979 -:10A4D0005623D4F8543143F00203C4F85431D4F86D -:10A4E000543143F00102C4F8542195F831201AB1D7 -:10A4F00043F05103C4F85431D4F85401D4E95667F9 -:10A50000C0F3400384F8523294F84230C4E9126731 -:10A5100093B90AF00101C4E91498C4E9589884F881 -:10A52000531219B140F00800C4F85401D4F8543162 -:10A5300043F00403C4F854311249A1F5147002F039 -:10A5400087FC1149204402F0CFFC2423C4F86C415D -:10A5500084F89931BDE8F0870C4BD3E90C23C4E9AA -:10A560005623BCE7D03A0021F850002131FB00010E -:10A5700020500021D6BE898E55555500A1FB000103 -:10A5800031FD0001203D0021183B002168500021D1 -:10A5900010B50FF011FF40F271220A4C00F2CC40CE -:10A5A000E38FC4F8A8005343C4F8AC30002304F18F -:10A5B0009C00A4F8983010F03FF8D4F8A430A363BE -:10A5C00010BD00BFD03A00214FF41872002101489D -:10A5D00016F003BFD03A0021034B044ADA60044B63 -:10A5E000044ADA60FFF7F0BF040D0021F9A501016C -:10A5F000B00C0021CDA30101FFF7E6BF034B93F898 -:10A600002400003818BF0120704700BFD03A002155 -:10A61000034B53F820301878003818BF01207047DA -:10A62000902503012DE9F843044600F59C760F467A -:10A6300091460021302200F582701D4616F0CDFEB5 -:10A640004FF4C0720021304616F0C7FE032384F891 -:10A650001C31012384F81E31604BDFF88481C4E98A -:10A6600048330223C4F830615E4E84F8383198F8DC -:10A670000800C4F82841F6F7DBF896F830305A495C -:10A6800084F83A31594B84F83901C4E94F13237CDB -:10A690004220022B14BF40F2011340F20333A4F80E -:10A6A0004431832394F86A20A4F8B831D20748BF14 -:10A6B000A4F8BA3198F8083084F8020284F803321A -:10A6C0004B4BC4F8E0314B4BC4F8E43110F0A2FC22 -:10A6D000C4F8D00100287FD0474B04F12808C4F803 -:10A6E000E831F5F781FFA063FFF7FCFA012384F856 -:10A6F0004E30B4F86230E063A4F84830BB88A4F868 -:10A700004A30FB88A4F84C30D6E90E23C4E9102364 -:10A71000FFF7EEFA84F85200FEF778FB052384F881 -:10A72000D030222384F8D43094F86B3084F853006E -:10A73000DB074BD5D6E90823C4E97023D4F8BC3134 -:10A7400043F00203C4F8BC31D4F8BC3143F0010239 -:10A75000C4F8BC2196F831201AB143F05103C4F873 -:10A76000BC31D4F8BC11D4E97067C1F3400384F85C -:10A77000D23094F86A30C4E90A67A3B99DF8200082 -:10A78000C4E90C9500F00100C4E9729584F8D30087 -:10A7900018B141F00801C4F8BC11D4F8BC3143F041 -:10A7A0000403C4F8BC3104F1780504F1D001284653 -:10A7B00002F04EFB4146284402F096FB2423002081 -:10A7C000C4F8D45184F80132BDE8F8830B4BD3E9C7 -:10A7D0000C23C4E97023B7E71F20F5E741FE000111 -:10A7E000F850002120500021D6BE898E55555500C5 -:10A7F000B1000101D50001010DFF000168500021E9 -:10A8000010B504460FF0D8FD40F27122638B00F2C0 -:10A81000CC405343C4F814310023C4F810016370D2 -:10A82000A37004F582700FF007FFD4F80C31636653 -:10A8300010BD00002DE9F743C77804467A1E012AAF -:10A84000837847D9A3F1FF056B426B412288324DD3 -:10A85000FF2A41D0002B3FD1AB7A1341D80705D551 -:10A860002E4B394653F8220004F01CFCE378012BF0 -:10A870004FD100242A4B294F1E68AB7A2341DA07B7 -:10A880003AD40134032CF8D100244FF495676C724C -:10A89000D6E90223C5E90023B379DFF88090DFF819 -:10A8A00084802B72AB7A2341DB070FD559F82460E3 -:10A8B000D8F80030B6F86000002207FB003006F13F -:10A8C0002801FFF7A1F83046FFF79AFF0134032C67 -:10A8D000E8D11EE00123B9E70026DFF84080AB7A1B -:10A8E0003341D90704D5394658F8260004F0DAFB7D -:10A8F0000136032EF3D1B9E77379B1790193337936 -:10A9000057F824000093D6E90223ECF7EBFC00286B -:10A91000B7D003B0BDE8F083303D0021902503019E -:10A92000540D0021B43A00212DE9F8434FF4C077CB -:10A93000044600F53A780021164600F52E703022C4 -:10A940001D4616F04AFD00213A46404616F045FDE8 -:10A95000022384F8D0320123354A84F8D232C4E984 -:10A96000B522062284F8A033324B3348C4F884332E -:10A97000002384F8E82290F83020DFF8C0C084F883 -:10A98000EA222F4AC4F88833C4E9BBC294F86A208B -:10A9900094F86B30D10748BFA4F86A73D907C4F89C -:10A9A000E482C4F8DC42A4F868733AD5D0E9088997 -:10A9B000D4F86C13C4E9DC8941F00201C4F86C13CB -:10A9C000D4F86C1341F00103C4F86C3390F83130C3 -:10A9D0001BB141F05101C4F86C138AB99DF82030C5 -:10A9E000C4E9DE65DB0742BFD4F86C3343F00803EB -:10A9F000C4F86C33D4F86C3343F00403C4F86C33FC -:10AA000004F17803C4F880332423002084F89833B9 -:10AA10000C4B6070C4F88C33A07084F80001BDE862 -:10AA2000F883094BD3E90C89C4E9DC89C8E700BF86 -:10AA3000A9FE00017101010120500021D6BE898EBE -:10AA400055555500710301016850002138B50D4B73 -:10AA500010220021184616F0C0FC012200240A49E9 -:10AA60000A4D0A73827255F8043B33B14FF48E627B -:10AA70000021184616F0B1FC04740134032CF2D105 -:10AA800038BD00BF303D002120500021902503013A -:10AA900008B5084A084BDA60084B094A5A62094B64 -:10AAA000094A1A60FFF7D2FF4FF48E62074B9A8271 -:10AAB00008BD00BFD1AA0101040D0021B00C002186 -:10AAC00035A80101E04D002111A6010168500021C7 -:10AAD000FFF7BCBF0123034A8340907A184390726A -:10AAE000704700BF303D00210123034A8340907A24 -:10AAF00020EA030090727047303D0021064B53F866 -:10AB0000203009B108689861106851681C3303C38C -:10AB100090681860704700BF9025030138B504465F -:10AB200004200D4610F076FA014668B154B1237C3A -:10AB30000B8009238B70054BCD70187BBDE8384026 -:10AB400010F079BAFF23F3E738BD00BF6850002149 -:10AB500030B590F83943036B3CB1032A81BF0C68D0 -:10AB6000C0F82443002480F8394390F83853012D6D -:10AB70001BD0022D46D1837AA3B9B0F8DC42032A58 -:10AB80001CD80023A24203F1010121D1D0F82423D3 -:10AB90009A421DD1C0F82413D0F82C330133C0F8E9 -:10ABA0002C3329E0B0F8DA42E9E7032AB0F82C4167 -:10ABB00023D99B009BB29C4228BF1C46012D0B68E9 -:10ABC0000ED0022DDED0BDB922B9E5E70024F5E7AD -:10ABD000C0F82413D0F834330133C0F834330BE019 -:10ABE000D0F824239A4209D1D0F82C330132013312 -:10ABF000C0F82C33C0F8242330BD00230133C0F843 -:10AC00002433E7E7032AE1D8022DDDD9F4E7000079 -:10AC100010B5044610F0B6F9034B587804445C7044 -:10AC2000BDE8104010F0BAB9DC5000210023F0B5A7 -:10AC300018461C46224A87B01268CDE9003392F8C4 -:10AC40003570204ACDE90233CDE9043312689F42C2 -:10AC500008D81D4B9B6A1BB110B1694603AA9847DF -:10AC600007B0F0BD1178A1B192F8181389B992F824 -:10AC7000046192F8D81286B179B906AD05EB4005AA -:10AC800025F80C6C168925F8186C82F8041101302F -:10AC9000C0B2013302F56272D9E70129F9D192F805 -:10ACA0006453002DF5D006A901EB400121F80C5C9E -:10ACB000158921F8185C82F8044182F86443E6E7BC -:10ACC000DC4D0021E43900216850002100232DE9EA -:10ACD000F04FB74F99B0DFF8DC82ADF8163006A917 -:10ACE0000DF1160000F0E4FF0546D8B900252C460A -:10ACF000CDE90955CDE90B55CDE90D55AE4FDFF83E -:10AD0000B4A23B6893F83530AB4200F24481AB4BC0 -:10AD1000DB6A23B11CB1204609AA0CA9984719B0D7 -:10AD2000BDE8F08FBDF81600FAF77EFF0378044601 -:10AD30001BB9284600F098FFD1E7294607A803F081 -:10AD4000FCFD3B689BB1294604F5BE70984738B9B5 -:10AD5000284600F089FF06212046EAF74BFCBEE7B3 -:10AD6000D4E90C32013342F10002C4E90C32294625 -:10AD700009A803F0E2FD94F8D81204F55A7A0029E4 -:10AD800040F0A08018220CA816F027FBBDF8163062 -:10AD90009DF81C60ADF8303001238DF833306B78AE -:10ADA000ADF83430069B0E936B78ADF83E30A6B10B -:10ADB000012EBED1A37A002B76D1B4F8DC32B4F8E0 -:10ADC0002C219A4273D10123284684F8103100F0D7 -:10ADD0004BFF002384F86F3381E794F86F333BB166 -:10ADE000012B5BD0284600F03FFF84F86F6376E7C5 -:10ADF00002238DF832309DF83230A5F10C0613F0A5 -:10AE0000FD0F08BFB4F87033304604BF0133A4F817 -:10AE10007033B4F870330CA9ADF83C3003F001FD89 -:10AE200094F819338146012B05F1020505D1294615 -:10AE300020469DF82120FFF78BFE29469DF8212012 -:10AE400006EB090016F0AFFA314612A803F0A1FC98 -:10AE5000149B13B1069BC4F800333146504601F0F1 -:10AE600073F900283FF442AF04F5427904F55E76A9 -:10AE700030460DF1150110F0EDF8054600283FF4BD -:10AE80002EAF226B2B4648462189013A00F02EFF57 -:10AE90000028EDD1284610F0C5F8E7E703238DF828 -:10AEA000323084F86F63A6E7B4F8DA3287E794F8B3 -:10AEB0006F33003B18BF01238DF83230012384F833 -:10AEC0006F3398E79DF81C30022B7FF432AFA37AE2 -:10AED000002B39D1B4F8DC3222890293069B04F5A9 -:10AEE000437901939DF829304946009350462B46FB -:10AEF00001F0A0F994F81433184494F8193384F845 -:10AF00001403012B23D194F81433002B3FF411AF19 -:10AF10000CA9484610F09EF80646014612A803F018 -:10AF200038FC9DF8562006F10C012046FFF710FE74 -:10AF3000304610F077F80120FFF76AFE94F81433DA -:10AF4000013B84F81433DEE7B4F8DA32C4E794F84E -:10AF50000833012B7FF4EDAE04F5427A94F81433F4 -:10AF6000002B3FF4E6AE504600F0E5FE8146014678 -:10AF700012A803F00EFC149BBDF856201799B4F8E4 -:10AF80001603D8F80C60B047484610F04BF8012083 -:10AF9000FFF73EFEE2E74FF46273094A6B43126823 -:10AFA000D61896F8081369B101291FD00135A8E613 -:10AFB000843A0021904A0021DC4D00216850002194 -:10AFC000E4390021D35C002BF0D096F81423002A3A -:10AFD000ECD0308918AB03EB4403013423F8300C78 -:10AFE00023F83C2CE4B286F81413DFE7D35C002B83 -:10AFF000DCD096F8CA32002BD8D006F5427B5846F2 -:10B0000000F099FE80460028D0D0414612A803F0F7 -:10B01000C0FB149BBDF856201799B6F81603DAF852 -:10B020000CC0E04740460FF0FDFF0120FFF7F0FDA8 -:10B03000E5E700BF70B50E4604460FF0E5FF011BC3 -:10B04000711A054600F086FC08B12844001B70BD4B -:10B05000F0B587B001460546684603F09AFB464BBB -:10B06000BDF80E201B689B8D93420AD228460FF034 -:10B07000D9FF424B5B681BB30121BDF80000984724 -:10B080001EE03F4F3B78002BF0D09DF80310BDF839 -:10B090000430002914BF04210021043B5B1A9BB239 -:10B0A0009A42E3D1BDF80000FAF7BEFD044600283D -:10B0B0003CD00089FBF786FA20B928460FF0B2FF92 -:10B0C00007B0F0BDB4F83031002BCFD0A37A94F89C -:10B0D000F4221A43CAD094F8F5220AB9012BC5D03C -:10B0E000ABB9B4F8DA32BDF80E209A42BED894F863 -:10B0F000D8327BB90FF046FF3B78013B3B700FF035 -:10B100004DFF2A466946204600F064FCD8E7B4F8B3 -:10B11000DC32E8E72A46002104F556700FF085FF7F -:10B1200094F86033013384F86033C9E7BDF8000058 -:10B13000F8F766FF06460028BFD04368BDF80E202A -:10B14000DB889A4292D80FF01DFF3B78013B3B70A1 -:10B150000FF024FF73682A469B7F23B96946304667 -:10B16000F9F77AF8ACE7214606F114000FF05DFF1D -:10B17000337F01333377A3E7DC4D00216850002192 -:10B18000DC500021F8B500241D4D1E4E2B6893F8AD -:10B190003530A3420AD800244FF498771A4E2B6812 -:10B1A00093F83A30A34215D8002012E04FF46273AE -:10B1B00063433268D018D35C0BB90134E6E790F8EA -:10B1C0000833002BF9D100F5427000F0B4FD0028DF -:10B1D000F3D0F8BD07FB04F33268D018D35C0BB989 -:10B1E0000134DCE74368DB78002BF9D190F82C3090 -:10B1F000002BF5D1F9F74CFA0028F1D0E9E700BFB0 -:10B20000DC4D0021E4390021D4390021FFF700BDD5 -:10B210002DE9F0410546884617461E46FAF704FD1B -:10B22000044640B3C07AFAF7D1FDA37A2BB994F85B -:10B23000F4223AB90C20BDE8F081012B02D194F838 -:10B24000F522F6E794F86423002AF3D083B994F842 -:10B25000F432E28940F2E241013A5343A8F8003067 -:10B26000828A036B002001FB12333B603060E2E70F -:10B2700094F8F532EDE72846F8F7C2FE034660B3CE -:10B280004568EA78012AD5D1A87F18B1012811D0E4 -:10B290001120D0E7D5E908432343CBD0D5F8CC30F3 -:10B2A00029692A7E013C5B1A54435343A8F80040A5 -:10B2B0003B60DBE793F82030002BBBD02B6A2A7E63 -:10B2C000013B53432969A8F80030D5F8CC3020461B -:10B2D0005B1A53433B603460ADE70220ABE7437831 -:10B2E000023BDBB2FD2B34BF122000207047000070 -:10B2F00070B58AB006460D46FAF796FC044628B3A8 -:10B3000015F0FC0F59D1002D57D015F0010307D0CF -:10B3100090F80423FF2A03D10C2528460AB070BDFB -:10B3200015F002054DD094F80823FF2AF4D0002B25 -:10B3300048D123896846ADF8003004F54273049380 -:10B3400000F0B8FDFF2384F808334DE03046F8F7ED -:10B3500057FE044698B3EA0703D590F82430FF2B34 -:10B36000DAD0AB0703D594F82C30FF2BD4D0638808 -:10B37000ADF800306368DD786DB994F82C30FF2BA0 -:10B38000CAD004F12C036846049300F093FDFF2318 -:10B3900084F82C30C1E794F82430FF2BBCD0134E36 -:10B3A00004F12403684604933360002500F024FD73 -:10B3B000FF23356084F82430AFE71225ADE702257E -:10B3C000ABE78BB12389094EADF80030684604F530 -:10B3D00041730493336000F00FFD00233360FF23BB -:10B3E00084F80433002DA4D1002596E7984B002162 -:10B3F00070B506460D46FAF717FC0446E0B1C07A70 -:10B40000FAF7E4FC94F8F42203460AB9A27AE2B10E -:10B4100094F8F52212B9A27A012A16D0022D16D874 -:10B420001B6B0020C4F81C330123C4F8280384F8E4 -:10B43000205384F8183370BD3046F8F7E1FD40B171 -:10B440002946BDE87040F9F7CDB91120F3E7122085 -:10B45000F1E70220EFE738B505460C46FAF7E4FBC2 -:10B4600080B1231E18BF012380F83933012380F8EF -:10B470001933002380F83843C0E9CB33C0F83433A4 -:10B48000184638BD2846F8F7BBFD20B12146BDE877 -:10B490003840F9F7BBB90220F3E738B505460C464A -:10B4A000FAF7C2FB0346A0B1B0F81823D2B190F866 -:10B4B000190350B10020D3F82C232260D3F8302395 -:10B4C000D3F834336260A36038BDC4E90000A060E3 -:10B4D000FAE72846F8F794FD30B12146BDE8384038 -:10B4E000F9F7A5B90C20EFE70220EDE738B50546DE -:10B4F0000C46FAF799FB0346C0B1B0F818230AB31B -:10B5000090F819235AB1D0F82C232260D0F83023B8 -:10B510006260D0F83423A260002280F8192393F8E7 -:10B52000180310B1002083F8180338BD2846F8F737 -:10B5300067FD054640B12146F9F779F9012385F801 -:10B540006930F2E70C20F0E70220EEE738B5054657 -:10B550000C46FAF769FB58B100F54F7300F55670C9 -:10B5600053F8042B834244F8042BF9D1002038BD52 -:10B570002846F8F745FD034660B14268D07848B9DF -:10B5800003F13C02583352F8041B9A4244F8041B5E -:10B59000F9D1ECE70220EAE770B506460D46FAF766 -:10B5A00043FB20B190F9EC3000202B7070BD304689 -:10B5B000F8F726FD034640B14268D07818B993F9F0 -:10B5C00064302B70F2E77F23EEE70220EEE7000005 -:10B5D000014B83F847007047205000211FB53123ED -:10B5E000ADF804008DF8080001A8ADF8063003910D -:10B5F0000DF04EFE05B05DF804FB00002DE9F047AC -:10B600001B4F05463B680E46B3F82C80FAF70CFB3F -:10B610000446D8B1C07AFAF7D9FBD0F8249004F5E3 -:10B6200041742378012B21D13B68988D083080B27A -:10B630000FF0F0FCD0B10F4B42469C6800F10C01BA -:10B640004B462846A446BDE8F04760472846F8F731 -:10B65000D7FC58B1436800F12404D3F8CC90B3F878 -:10B6600006804E4504BF1A699144DAE7BDE8F087C9 -:10B67000DC4D0021904A0021F8220021014815F0FC -:10B68000ACBE00BFA04A0021F0B406461846114BDC -:10B69000BDF810701B682BB15B88B34202D1F0BCBF -:10B6A0000FF0C0BC14250C4B1C6805FB0435C5E924 -:10B6B00003120C220134B4FBF2F102FB11441C60B2 -:10B6C000064B68612E812F838021F0BC187B0FF020 -:10B6D0004DBD00BF984B0021A04A002168500021B9 -:10B6E0002DE9F04114274FF481781D4D86B0D5E93E -:10B6F00000349C4202D106B0BDE8F08107FB04543F -:10B7000023891422002101A86669ADF80030ADF844 -:10B71000028015F062FE2269238B0C3E0292E268E1 -:10B7200069463046ADF80430ADF80C20ADF80E3067 -:10B7300003F077F83046FFF78BFC00226B68029924 -:10B7400007FB0353BDF800005A61FFF757FF0C22B7 -:10B750006B680133B3FBF2F102FB11336B60C6E798 -:10B76000A04A00212DE9F0418F7805460C46164687 -:10B7700027B1012F1DD00020BDE8F08103691A78A0 -:10B78000FF2A2AD1CA78FF2AF5D0DFF85480C8F8FA -:10B79000003000F031FBE3782A69FF2BC8F8007015 -:10B7A0001370E8D0324621462846BDE8F04100F04B -:10B7B000D1BA03691B78FF2B0FD1CB78FF2BDAD0DE -:10B7C00000F078FBE3782A69FF2B1370D3D0214671 -:10B7D0002846BDE8F04100F01BBB0C20CCE700BFC1 -:10B7E000984B0021F0B505468BB028220021684611 -:10B7F00015F0F3FDEB78023BDBB2FC2B75D92B790E -:10B80000032B72D12B7C002B6FD12888FAF70CFA0E -:10B810000446002845D0837A012B05D1C378012B3B -:10B8200002D10C200BB0F0BDE07AFAF7CFFA426AF1 -:10B830004FF495602F4BE188A77A1B6800FB01331A -:10B84000D4E9B860012F18BF30460190A06A218961 -:10B850000130ADF800100290A97820698DF802102F -:10B86000039069B10129DCD1D3E9C401224BCDE9B0 -:10B870000601D3E90C0104F54274CDE908010AE0A0 -:10B880001D4904F54174D1E90C01CDE90601D3E964 -:10B89000C401CDE90801049429466846FFF762FF18 -:10B8A000C0E72888F8F7ACFB08B3436841881E7EE0 -:10B8B000ADF800101969AC780191196AD3F8CC2061 -:10B8C000013171430291996A8DF80240039134B1BC -:10B8D000012CA6D1DB78002BA3D12C3003E0DB7840 -:10B8E000012B9ED124300490D6E712209AE7022043 -:10B8F00098E700BFB43A002168500021034B1A8B2F -:10B9000002701B8B1B0A437002207047DC50002121 -:10B91000014B188300207047DC50002108B50FF060 -:10B9200031FB044A137801331370BDE808400FF06F -:10B9300035BB00BFDC50002108B50FF023FB044AE3 -:10B940005378013B5370BDE808400FF027BB00BFA0 -:10B95000DC5000212DE9F843002406460F46054639 -:10B96000DFF84080104AC8E90044DFF840901460D6 -:10B97000D9F8003093F82A30A34202D8A81BBDE8BA -:10B98000F88328460FF040FB00F18005AB1BBB425B -:10B99000014604D840460FF08BFC0134E8E7002054 -:10B9A000EDE700BF9C4B0021A44B0021DC4D0021A2 -:10B9B00008B503480FF08EFC00B1083008BD00BF89 -:10B9C0009C4B0021A0F1080101480FF071BC00BFA1 -:10B9D0009C4B00212DE9F04FCB8989B007460D46DD -:10B9E0001646B0F830810293FFF7E2FF0446D0B963 -:10B9F00030460FF017FB414B9B6A63B197F8182351 -:10BA00004AB901202A88ADF81800ADF816200DF1CA -:10BA1000160106AA9847FFF781FF072009B0BDE885 -:10BA2000F04FF4F7B1BDEB890660984528BF984602 -:10BA30000381002380F80A80C372EA78CDF804807D -:10BA40009A4214BF0C220822984606EB020B1E46AF -:10BA5000C0F804B0029BDDF80490A3EB080189B2A2 -:10BA600097F8D832894528BF8946002B39D1019BE8 -:10BA70008B422CBF002101210D22F3B2534303F16D -:10BA8000100A03930023A2448DF81810504606A90B -:10BA9000A5F80E90CDF819308DF81D9002F02EFF0C -:10BAA0004FF00202039BE1188A7315490A68944615 -:10BAB000CAB900210D22F3B202FB0343C844D97373 -:10BAC000029B1FFA88F84345CB4406F10106C1D812 -:10BAD0002246297807F1FC0009B0BDE8F04F0FF0CD -:10BAE000A4BA0221C8E717335A465146234407F542 -:10BAF000BE70E0470028DCD00421DBE7685000215D -:10BB0000883A002173B50C46FC300DF107010FF0A7 -:10BB1000AAFAF0B1867AC37A028903FB06F13546A8 -:10BB20000E449642C4BF521A95B20D225343C61812 -:10BB3000B27B2581228003F11002024462604268D8 -:10BB40000A44E260F27B32B117331844606103208B -:10BB5000228202B070BD0220FBE707B5FC300DF178 -:10BB600007010FF080FA003818BF012003B05DF81C -:10BB700004FB000013B500F1FC0420460DF10701A1 -:10BB80000FF071FA78B1C27A837A511C02FB033349 -:10BB90000289934209DB064B0DF10701186020462C -:10BBA0000FF058FA012002B010BDC172FAE700BFD1 -:10BBB000A44B002170B50F4E04463568C5B1286806 -:10BBC0000FF030FA2846FFF7FDFEFFF7A7FE94F8C6 -:10BBD00004314021013384F80431012384F86433B3 -:10BBE00000233360044BBDE87040187B0FF0BEBAF1 -:10BBF00070BD00BFA44B0021685000210023F7B5A1 -:10BC0000044690F8045180F8643380F8043100F160 -:10BC1000FC0738460DF107010FF01CFA064640B943 -:10BC2000094B5B681BB115B129462089984703B0C1 -:10BC3000F0BD30680FF0F6F901353046FFF7C2FE6F -:10BC4000EDB2FFF76BFEE4E76850002108B5054B45 -:10BC50001B68988D103080B20FF0DCF900B10C3009 -:10BC600008BD00BFDC4D00210C380FF0DBB900002F -:10BC700008B51346B0B10A0A00F8041C00F8032CFA -:10BC80000A0C090E00F8022C00F8011C021FD9B2A0 -:10BC900005480FF0CAF9054B2021187BBDE8084084 -:10BCA0000FF064BA08BD00BFE450002168500021C5 -:10BCB00037B504460D460C480DF107010FF0CAF9DF -:10BCC00078B1837842781B0403EB022302780430B6 -:10BCD000134410F8012C03EB02632B609DF807302E -:10BCE000238003B030BD00BFE4500021F0B504460E -:10BCF00087B00F46684619461E4602F04AFD257871 -:10BD00002DB1012D0FD00025284607B0F0BD3246D9 -:10BD1000F9B2201D0FF089F9237B0125013323732C -:10BD2000FFF70AFEF0E73246F9B2201D0FF07DF969 -:10BD3000FFF702FEE8E7037807B5012B07D80DF1FE -:10BD4000070104300FF086F903B05DF804FB002012 -:10BD5000FAE700002DE9F0430669044633780D4602 -:10BD6000012B17468FB008D0013BDBB2FE2B34BF4E -:10BD7000122000200FB0BDE8F0831D4BB0F80090FA -:10BD8000D3F80080A6F80290B8F1000F2ED0382228 -:10BD90000021684615F021FBA368694601932B79C1 -:10BDA00048468DF80830EB88ADF80A302B89ADF89D -:10BDB0000C302B7C8DF810306B690593E36806938B -:10BDC0000C4B0793D4E90623CDE90823D4E90823D3 -:10BDD000CDE90A23C04728B120883946FFF70EFC79 -:10BDE0000020C7E7FF230D203370C3E71220C1E70F -:10BDF000904A002189B6010103691A78012A04D109 -:10BE0000024A00215268588810477047904A002122 -:10BE10002DE9F047056906462C780F46012C8EB0B7 -:10BE200005D0FF2C41D0002C3BD0122435E04FF040 -:10BE300000081F4BB0F800A0D3F80090C5E90188B6 -:10BE4000A5F80EA0B9F1000FEFD0382241466846A0 -:10BE500015F0C3FAB368694601933B7950468DF8F3 -:10BE60000830FB888DF80040ADF80A303B89ADF80A -:10BE70000C303B7C8DF810307B690593F36806939A -:10BE8000D6E90623CDE90823D6E90823CDE90A231C -:10BE9000C84750B9FF230D242B7020460EB0BDE8D3 -:10BEA000F087C5E901442C73F7E70024F5E700BFEC -:10BEB000904A002137B50469217889B9164D0434B8 -:10BEC00020460DF107010FF0C5F858B10FF0AAF8A0 -:10BED0000FF058F86B7801336B700FF05FF8EFE7F5 -:10BEE000012901D003B030BD0C4BE0895B68984755 -:10BEF000094D043420460DF107010FF0ABF800287E -:10BF0000F0D00FF08FF80FF03DF86B7801336B70C5 -:10BF10000FF044F8EEE700BFDC500021904A00210A -:10BF200037B5044671B900F1100528460DF1070137 -:10BF30000FF090F818B90023E38003B030BD0FF084 -:10BF400071F8F2E700680028F5D00FF06BF80023D5 -:10BF50002360F0E7F0B55C1E012CBDF81460069D6F -:10BF600013D884784778240404EB07240778C07832 -:10BF70003C4404EB0060012B09D0022B11D01BB90B -:10BF800059B1936801339360F0BD0020F3E70329B2 -:10BF9000F7D9B142F5D8A842F3D113680133136041 -:10BFA000F2E7B142EDD1F6E72DE9F04F0026054664 -:10BFB0001446B2468BB0CDE9026601F108081CB9FF -:10BFC00050460BB0BDE8F08F28460DF107010FF089 -:10BFD0004AF807460028F3D0014604A802F0D9FB2E -:10BFE0009DF81330002B14BF0C2108210F446989E0 -:10BFF000002942D0BDF81E3002265B1AADF81E3073 -:10C0000001230F448DF80830BDF81E309A19944270 -:10C0100037DB01228DF809209DF808208DF80A30C1 -:10C0200002B903924FF00002DBB228466A810DF19B -:10C030000701E41A0FF00EF883462B7AA41B013B8C -:10C040002B722B7BA4B201332B73404602A902F062 -:10C0500029FC9DF80A90804440464A46394615F02E -:10C0600095F9C844BBF1000F02D058460EF0DAFF34 -:10C070004E4456445FFA86FAA1E705268DF808106B -:10C08000C2E7B4429CDD4FF00003A41B8DF80930D9 -:10C090009DF80830E4B28DF80A4003B903934FF0DD -:10C0A000000B214469815C46CFE70000034B1B680D -:10C0B000988D103080B20EF0ADBF00BFDC4D002176 -:10C0C0002DE9F04186B00646884614461D46FFF726 -:10C0D000EDFF074620B3B8F1010F25D0B8F1020FEC -:10C0E00029D000240223ADF80230002369463846E7 -:10C0F000ADF80060ADF80440ADF80C30ADF80E407E -:10C100008DF8103002F08DFB54B13A182B0A3D54D3 -:10C1100053702B0C93702B0ED37004239C420ED8BB -:10C12000384606B0BDE8F0810DF07FF8B0FBF4F2C0 -:10C1300002FB1404A4B2042C38BF0424D2E7D35465 -:10C140000133EBE7FFF7B2BF2DE9F04100F1100832 -:10C150008EB004460F4640460DF107010EF083FFF6 -:10C160000646002F4AD0394602A802F012FB9DF87D -:10C170000A50032D40D8DFE805F00328021A0125F4 -:10C1800036B10DF1070140460EF064FF0EF04AFF94 -:10C19000BDF816303A462383002340469DF8081028 -:10C1A000A3760EF042FF28460EB0BDE8F0810125CF -:10C1B0006EB9BDF80C303A46238340469DF808100E -:10C1C0000EF033FF0123A376EDE70025F0E73146BB -:10C1D00008A802F0DEFA238B0D98BDF80C20184455 -:10C1E000079915F0D3F838460EF01CFF238BBDF8E5 -:10C1F0000C20134423832DB90025D4E70028FBD05D -:10C200000123A376314608A802F0C3FA02238DF871 -:10C210002230238B3046ADF82430ADF82E30A37E8B -:10C2200008A98DF8303002F0FCFA002301252383A1 -:10C23000A376B8E72DE9F04F8DB0CDE90121BDF827 -:10C2400060200446039282799DF8587052B100250F -:10C250008571006830B10EF0E5FE256028460DB00E -:10C26000BDE8F08F0025A946CDE904559E1C002F9E -:10C27000F4D0314604A802F02BFB9DF81020804634 -:10C28000064422B99DF81230033B8DF8123094F821 -:10C2900007B0BBF1000F0AD0BBF1010F206859D0E5 -:10C2A00000284ED00EF0BEFEC4F8009049E0FFF723 -:10C2B000FDFE20600028DAD0FFF73EFB0C239DF83E -:10C2C00010A0A380236803F10C00BAF1000F33D152 -:10C2D0009DF812200399DDF814B08A42C4F810B01A -:10C2E0003CD91422514607A8039315F076F8228909 -:10C2F000019B511CADF824204FF48172ADF81A2037 -:10C300000222ADF81830179B8DF82820A3EB0B0202 -:10C31000039B2181184606A90892013502F081FA93 -:10C3200022689DF8041002980EF07FFEEDB2C4F86A -:10C3300000A084F807A091E718460EF073FEC4F839 -:10C3400000B09DF81230FF1AA7EB08071E4407F053 -:10C35000FF078CE7012A42D1A388184431469DF893 -:10C36000122015F013F8A3889DF812A056449A44A1 -:10C370009DF811301FFA8AFAA4F804A0002B3DD0D2 -:10C380001422002107A815F028F8019BAAF10C0A35 -:10C39000ADF8183023891FFA8AFA5A1CADF82430F8 -:10C3A0004FF481732281ADF81A30179A236906A9D8 -:10C3B000D31A20680893ADF81CA0ADF826A002F0AF -:10C3C00030FA029822689DF804100EF02EFE9DF8B7 -:10C3D00012000135EDB2C4F800903F1A07E00EF0EC -:10C3E00021FE9DF81230C4F800901E44FF1AA7EBFE -:10C3F000080707F0FF0784F8079038E70123E37187 -:10C400002CE70000014B024A1A617047C04B002123 -:10C41000B50F0201B2F5706FF8B505460E46144629 -:10C4200033D2052A33D84FF4856363431B4AD118AE -:10C43000D35C63B34B78012B29D1194B1B6893F85C -:10C440002230834225D94FF49563164A434311683D -:10C45000CA18CB5CEBB1D2F8303300279B011AD558 -:10C4600092F82233BBB10A200EF0D4FD014658B138 -:10C4700042F2012343800C4B05808780C4800681F3 -:10C48000187B0EF0D8FD3846F8BD1220FCE742209C -:10C49000FAE70220F8E71A20F6E700BFD01D0021D6 -:10C4A000DC4D0021B43A002168500021F8B51E4B44 -:10C4B00004461B680E4693F822301546834201D885 -:10C4C0000220F8BD1046F6F709F930B390F88971EB -:10C4D000012F24D14FF49563144A63431168CA189D -:10C4E000CB5C002BECD0D2F830339B0119D592F8FD -:10C4F0002233B3B10A200EF08DFD01460028E0D0B2 -:10C5000042F2012343800A4B04808780C580068164 -:10C51000187B0EF090FD0020D3E74220D1E70C20DD -:10C52000CFE71A20CDE700BFDC4D0021B43A00214F -:10C530006850002130B50C4C246894F822408442A5 -:10C540000FD94FF495646043084C25682C18285C7B -:10C5500038B1002084F87013A4F87223A4F874335F -:10C5600030BD0220FCE700BFDC4D0021B43A0021C1 -:10C57000074B084A1A60084B084A1A60084B094AD8 -:10C580001A60094B094A1A60094B0A4A1A60704737 -:10C59000943A002195750001903A00213978000104 -:10C5A000AC3A0021DD7A0001983A0021F97A0001C5 -:10C5B0008C3A0021197B0001034B04481B7B037359 -:10C5C000034B19680EF036BF68500021A84B0021BC -:10C5D00010510021C3780146022B70B517D0032BF0 -:10C5E00007D0012B2CD1E7F739FABDE87040FFF7EF -:10C5F000E3BFD0E9022352EA030003D1BDE8704053 -:10C60000E7F72CBA4879BDE87040E7F755BA0179E9 -:10C61000421D00F10803D0E90445204661B12946D6 -:10C62000E7F754F90EF0AEFC064A1379013B13719B -:10C63000BDE870400EF0B2BC2946E7F7A1F9F1E77A -:10C6400070BD00BF105100212DE9F84FDDE90A67E8 -:10C65000154C8246894690461D460EF093FC94F890 -:10C6600004B00EF09BFCBBF1030F1BD818200EF09A -:10C67000D1FC0146B0B140F20623C0E90267438015 -:10C680000A4B80F804804571C0E904A9187B0EF0BC -:10C69000D2FC0EF077FC237901332371BDE8F84F0B -:10C6A0000EF07CBCBDE8F88F1051002168500021CD -:10C6B000014B1860FFF780BF1051002108B50D4AEB -:10C6C0000D4B00219A610D48102214F086FE0C4B90 -:10C6D0000C481B681B79072B81BF0B4A136A43F078 -:10C6E00040031362E6F784FF4FF48372034BDA8052 -:10C6F00008BD00BFD5C50101B00C0021A84B002129 -:10C70000DC4D002149C6010168500021182008B500 -:10C710000EF080FC014670B140F2063343800023E6 -:10C72000002243710023C0E90223034B187BBDE8BC -:10C7300008400EF080BC08BD6850002170B5064668 -:10C74000182015461C460EF065FC014658B140F213 -:10C750000633C0E902544380034B4671187BBDE8A1 -:10C7600070400EF068BC70BD6850002108B5C9B2B9 -:10C7700010F0C2FB012008BD10B58AB00446262285 -:10C780000021684614F029FE14238DF802300C4B6A -:10C79000204693F8223004F12002002B14BF00231E -:10C7A00012238DF804300DF1050350F8041B90425C -:10C7B00043F8041BF9D168460CF06AFD0AB010BDBD -:10C7C00018510021024B4FF40061187B0EF0CEBCD3 -:10C7D0006850002110B500F11F0300F10F029A42CA -:10C7E00000D110BD01781C7800F8014B03F8011945 -:10C7F000F5E701F1200301388B4200D1704713F8AF -:10C80000012D00F8012FF7E700B589B02021684617 -:10C8100010F072FB054813F09DF8684613F0A0F87D -:10C82000FFF7D0FF09B05DF804FB00BF6DC7010141 -:10C8300000B589B001466846FFF7DBFF054813F0F5 -:10C8400089F8684613F08CF8FFF7BCFF09B05DF873 -:10C8500004FB00BF6DC7010110B513F093F8044647 -:10C8600018B9FFF7AFFF204610BD0120FCE738B52F -:10C8700004460D4613F0E2F82046FFF7ABFF04F143 -:10C880002000FFF7A7FF2846BDE83840FFF7A2BF0A -:10C8900070B5A2B0FFF7E0FF58B36846164910AE76 -:10C8A000FFF7E5FF46220021304614F096FD1323E2 -:10C8B0006A468DF842300DF1450508AB144603CCAD -:10C8C0009C4228606960224605F10805F6D10DF109 -:10C8D00065041A4603CAB24220606160134604F13F -:10C8E0000804F6D130460CF0D3FC0022024B83F84A -:10C8F000202022B070BD00BF1851002130B5044681 -:10C900000D4699B0014608A8FFF773FF04F1200116 -:10C9100010A8FFF76EFF29466846FFF76AFF074831 -:10C9200013F018F8694608A813F0E8F8044B4FF420 -:10C930008051187B0EF01AFC19B030BD6DC7010193 -:10C940006850002110B513F025F9044638B9054B9D -:10C950004FF48051187B0EF009FC204610BD0120D9 -:10C96000FCE700BF6850002110B5044613F02CF915 -:10C970002046BDE81040FFF72DBF000010B50E4C5B -:10C9800088B094F822304BB92022FF21684614F079 -:10C9900024FD6846FFF7F0FE08B010BDFFF7D2FF98 -:10C9A0000028F9D06846FFF7DFFF6846FFF7E4FE8E -:10C9B000002384F82030EFE71851002130B50446F9 -:10C9C00091B00D4601466846FFF713FF04F12001C0 -:10C9D00008A8FFF70EFF684613F046F810F0FF04B2 -:10C9E00006D12DB1044B4FF48051187B0EF0BEFBE5 -:10C9F000204611B030BD00BF6850002110B5094875 -:10CA000090F8204064B9012380F8203090F821305C -:10CA10001BB1FFF70DFF204610BDFFF7F5FEFAE74B -:10CA20000C24F8E7185100212DE9F041114D06467C -:10CA300095F820800F46B8F1000F18D195F82340E3 -:10CA4000B4FA84F14909FFF7B9FF85F8220028B943 -:10CA5000002C18BF12242046BDE8F081012339467E -:10CA6000304685F820304446FFF748FFF3E70C24B2 -:10CA7000F1E700BF18510021F0B599B06A4616469B -:10CA8000144B03F12005144618685968083303C491 -:10CA9000AB422246F7D108AA15460F4B03F14007D7 -:10CAA000144618685968083303C4BB422246F7D1BC -:10CAB0000A4B93F820405CB901223146284683F89E -:10CAC000222083F82020FFF719FF204619B0F0BD7F -:10CAD0000C24FAE79C250301BD2503011851002110 -:10CAE000024B83F823000020704700BF185100213B -:10CAF000074B084ADA62084A1A63084A136A43F085 -:10CB0000006313620022064B83F82320704700BFA6 -:10CB1000780C002191C801017DC9010168500021F4 -:10CB200018510021034B044A1A61044B044A1A604D -:10CB3000704700BFE84B00211D150201A83A0021F3 -:10CB4000D9160201F8B500230B701378164603F0CE -:10CB50003F029B090546027043706AB9741C2A782B -:10CB6000A11B8A4244DB531C5B1ADBB22C62AB77FD -:10CB70001C44A01BC0B2F8BD7778B41C0F7083783A -:10CB8000F90743EA0703837006D520460EF0E0F864 -:10CB9000C5E9020106F10804BA0705D520460EF0E2 -:10CBA000D7F8C5E9040106347B0706D514F8013B24 -:10CBB00003F01F029B092A766B7638070AD5627844 -:10CBC00014F8023B03EB0223C3F30B02C3F303335A -:10CBD0006A832B77F90644BF6C620334BA0644BFFC -:10CBE000AC6212347B0644BF14F8013B6B77B6E7A6 -:10CBF00000232B62AB77BCE70B7803F03F03037095 -:10CC00000B78C3F3801343700B78DB0983708A7849 -:10CC10004B7803EB0223C3F30C02C3F3423382804D -:10CC2000837170474A780B7830B503EB0223C3F366 -:10CC30000C020280C3F34032C3F380338270C370AE -:10CC4000CA788B7803EB022383804B798A791B02A5 -:10CC500012049B182CBF012200220C791B19CC79DD -:10CC600042F1000524060A7A1B1942EB050202F084 -:10CC70001F04C0E9023452090274CB7A8A7A1B0479 -:10CC800003EB02234A7A13440A7B03EB02634361FA -:10CC90008A7B4B7B03EB0223CA7B03EB024383615A -:10CCA0004A7C0B7C03EB0223838330BD4B788A786C -:10CCB0001B0212049B182CBF0122002210B50C7815 -:10CCC0001B1942F10004CA7812069B180A7942EB3C -:10CCD0000402C0E902328A794B7903EB0223038212 -:10CCE000072010BDF0B58B784C781B0403EB0423B0 -:10CCF0000C782344CC78C3F30D0503EB0464C3F331 -:10CD000080338372C4F3CB33E40E05818381847353 -:10CD10008B794C791B0403EB04230C792344CC79E5 -:10CD200003F01F0503EB0464C3F342130374C4F35D -:10CD30001323240FC573436104768B7A4C7A1B044A -:10CD400003EB04230C7A2344CC7AC3F3130503EBDF -:10CD50000464C3F3035380F82030230EC561438479 -:10CD6000CB7B8C7B1B0403EB04234C7B23440C7C8C -:10CD700003EB04634362CB7C8C7C1B0403EB042336 -:10CD80004C7C23440C7D03EB0464C3F313038362E4 -:10CD9000230D83858C7D4B7D03EB04230024C38509 -:10CDA0000B7E4D7E1B022D045B192CBF01252546F1 -:10CDB000CE7D9B198E7E45F1000536069B19CE7EF1 -:10CDC00045F1000535441B1905F01F06C0E90C3676 -:10CDD0006D0980F838504B7F8E7F1B0236049B19FB -:10CDE0002CBF012626460F7F0135DB19CF7F46F188 -:10CDF00000063F06DB1991F8207046F100063E441C -:10CE00001B1906F07F07222A4FEAD616C0E9103711 -:10CE100080F8486080F8385016D9012380F84930EE -:10CE2000D1F82130523040F8083CD1F8253040F894 -:10CE3000043C01F12903393153F8042B8B4240F8AB -:10CE4000042BF9D13820F0BD80F849402020FAE7C2 -:10CE50008B784A789B0143EA42120B781343CA78D5 -:10CE600043EAC2130A7943EA02231BB20370C3F3F5 -:10CE7000072343700220704770B50546049EF47F77 -:10CE80000DF06CFF06343146F27FE4B2A81D14F0B9 -:10CE90007DFA204670BD10B504460DF05FFFDDE958 -:10CEA0000223A01D0DF05AFF0C2010BD38B5D1E9AA -:10CEB00000230C4605460DF051FFD4E90223A81DBE -:10CEC0000DF04CFF0C2038BDFFF7D6BF38B5D1E9C7 -:10CED00000230C4605460DF041FFD4E90223A81DAE -:10CEE0000DF03CFF0C2038BD38B50C460546FFF769 -:10CEF000EDFF2169228C295421692B18090A5970E8 -:10CF0000618A22209970E17CD97061691971616927 -:10CF1000090A5971E18A997194F82610D971218D05 -:10CF20001972218D9A72090A120A5972DA72628C88 -:10CF30001A73628C120A5A73A28C9A73A28C120A08 -:10CF4000DA73A2691A74A269120A5A74628B9A740B -:10CF5000E27EDA74E2691A7594F82B1094F82A20AC -:10CF600042EA41125A7538BD0B784A7803F00F0136 -:10CF70000170C3F340114170C3F38011DB09C3702A -:10CF80001346054A817012681279082A98BF03F087 -:10CF90003F03037102207047DC4D002138B5044681 -:10CFA00008460D460DF0D4FEC4E90001A81D0DF0A1 -:10CFB000CFFEC4E902010C2038BD38B5054608464D -:10CFC0000C460DF0C5FEC5E90001A01D0DF0C0FE28 -:10CFD000C5E90201A37B627B1B0403EB0223227BD6 -:10CFE00022201344E27B03EB02632B61627C237CEF -:10CFF00003EB0223A27C03EB02436B61E37C85F825 -:10D000002630627D237D03EB02232B85E27DA37D09 -:10D0100003EB02232B84627E237E03EB02236B84CB -:10D02000E27EA37E03EB0223AB84637FA27F1B021D -:10D0300012049B182CBF01220022217F5B1842F1B1 -:10D040000001E27F12069B1894F8202042EB0102B7 -:10D05000C5E9063294F8213003F01F025B0985F818 -:10D060002A2085F82B3038BD10B590F82630028C78 -:10D07000082B22D840F67A41931F9BB28B428CBF7B -:10D0800000230123018D914288BF002340F67641A1 -:10D09000828C0A3A92B28A4288BF0023D0E90642C3 -:10D0A00012F0E0010BD122430BD090F82A20053A70 -:10D0B0000B2A94BF1846002010BD0023E2E700238E -:10D0C000F3E70B46F1E708230B7028234B70836DC1 -:10D0D0008B70836D1B0ACB70B0F85A300B7190F8CF -:10D0E0005B304B71C36D8B71B0F86030CB71B0F8B1 -:10D0F000603009201B0A0B72704709230B70322322 -:10D100004B70D0F824318B70D0F824311B0ACB70CF -:10D11000B0F826310B7190F827314B7190F8283117 -:10D120008B7190F82931CB7190F82A310B7290F8FD -:10D130002B310A204B727047034670B590F8BA2025 -:10D1400093F8F040901C01320A702C224A70B3F818 -:10D15000C020013C8A70B3F8C020B3F8C450C2F3B9 -:10D160000D0242EAC53293F8C650E4B242EAC56203 -:10D1700093F8C250C0B2AD0305F480452A431212A1 -:10D18000CA70B3F8C420C2F347020A71B3F8C020D2 -:10D19000B3F8C450C2F30D0242EAC53293F8C65048 -:10D1A00042EAC562C2F307624A7193F8C85093F825 -:10D1B000C72042EA45128A7193F8D020D3F8CC50A8 -:10D1C000120793F8C86042EA052293F8C75045EA6F -:10D1D00046152A43120ACA7193F8CD200A7293F8B1 -:10D1E000D020D3F8CC50120742EA0522120E4A7220 -:10D1F000D3F8D4208A7293F8D520CA72B3F8DA2013 -:10D2000093F8D850120642EA0552D3F8D4502A4374 -:10D21000120C0A73B3F8DA2093F8D850120642EAD7 -:10D220000552D3F8D4502A43120E4A7300228A734F -:10D23000D3F8DC20CA73D3F8DC20120A0A74B3F8DE -:10D24000DE204A7493F8DF208A74D3F8E020CA7491 -:10D2500093F8E1200A75B3F8E450D3F8E02042EAED -:10D260000552120C4A75B3F8E450D3F8E02042EAB4 -:10D270000552120E8A75B3F8E620CA75B3F8E62097 -:10D2800012120A76D3F8E8204A76D3F8E820120A78 -:10D290008A76B3F8EA20CA7693F8EB200A77D3F8B7 -:10D2A000EC2042EA44124A77D3F8F8208A77D3F880 -:10D2B000F820120ACA77B3F8FA2081F8202093F8F0 -:10D2C000FB2081F82120D3F8FC2093F8004102F0E4 -:10D2D0007F0242EAC41281F8222093F8012192B120 -:10D2E000D3F802212B3141F8082CD3F8062141F85C -:10D2F000042C03F5857203F58D7352F8044B9A42A2 -:10D3000041F8044BF9D170BD2DE9F0410D46984626 -:10D31000074616460DF044F8174B32288CBF002004 -:10D3200001209D421CD800221449A5FB0151C1F3E4 -:10D330004F0146EA801646EAC21688F8006097F860 -:10D340003F30022B16D0032B14BF0023022388F892 -:10D35000011041EA4331091288F80210BDE8F0815A -:10D3600007490122A5FB0114032101FB0541C1F37B -:10D370008F21DEE70123EAE7C3BF03001211111179 -:10D380009E36D0692DE9F04F87B005930023924671 -:10D39000109A03911371129B044603330493129B5A -:10D3A0009DF84C801D1D9A4B9DF850609B69D901DA -:10D3B00003F0807B00F17E82B8F1040F40F08082A0 -:10D3C000002E14BF4FF003084FF001080CB9A3461C -:10D3D00081E24FF0000B238C9A0600F17482039BCC -:10D3E00013F0010740F0E5801AF0010F04D094F823 -:10D3F000D733DB0740F1DE80039B980706D41AF091 -:10D40000020F10D094F8D73399070CD447F00207D5 -:10D4100005F10609002C00F0E480D4E90623284633 -:10D420000DF09CFC4D46039B1A070AD41AF0080F16 -:10D430001AD094F8D7331B0703D5AEB194F8543300 -:10D4400093B147F00807002E00F0D380B4F85633AC -:10D450002A4602F8023B94F84210C3F30B0343EA56 -:10D4600001331B126B701546129BEA1AC2F58073CA -:10D4700001330193039B13F0200107D11AF020031D -:10D4800008D094F8D733980600F1B680C2F1EF03C4 -:10D49000019301231AF040091DD0B8F1030F02D007 -:10D4A000B8F1060F0AD1B4F8609319F040090DD114 -:10D4B000B8F1030F0FD0B8F1060F0CD0B4F82090DC -:10D4C00019F0400902D1B8F1070F04D14FF001095A -:10D4D000019A013A0192BBF1000F019A18BF002294 -:10D4E0000192119A002A00F08980119912884989C5 -:10D4F0001AF0100FA2EB010292B2029209D0119A17 -:10D50000127B32B9019994F84C20914228BF114600 -:10D510000191039A12F0100610D11AF0100270D087 -:10D52000DDE901128A4209D8B8F1030F0AD194F853 -:10D53000C223012A06D094F8C0631EB12E4647F0DC -:10D5400010070335002B00F0C58094F8DD2BD4F8CC -:10D550009CA1012A47F020070AD194F8B7134A0684 -:10D560001FBFD4F850239244D4F8B02302FB11AA71 -:10D570005046D4F8181A03930CF024FFB0F5967FA8 -:10D58000039B40D95046D4F8181A0CF01BFF214ACF -:10D59000904243D9B0F5161F039B24BF00231846C1 -:10D5A0001D4AA0FB0212032101FB0020C0F38F20C3 -:10D5B0003AE04CB1D4E9042328460DF0CFFB129B8E -:10D5C000012703F10A0517E7129B03F10A090CF082 -:10D5D000BBFE436A2846D3E9FE230DF0BFFB4D4650 -:10D5E0000AE70CF0B1FE436A03F58063D3E9002338 -:10D5F00015E7B4F840302BE70B464BE7119A02923F -:10D6000087E716469EE7D4F850239244B0E700BF60 -:10D6100020500021C3BF03009E36D069AF4BA0FB52 -:10D6200003300023C0F34F00287040EA433000125B -:10D630006870D4F85023AA4BA2FB0321D20F42EA10 -:10D640004102AA70D4F85023A2FB0323C3F3D713DB -:10D65000EB70D4E9DAA303F01F0BFBF7D7FB4FEA1B -:10D660001A2385F804A06B714BEA401B4FEA1A435A -:10D670004FEA1A6AAB7185F807A085F808B0D4F8AC -:10D68000CC316B72D4F8CC311B0AAB72B4F8CE310A -:10D69000EB7294F8CF312B73D4F8D0316B73D4F88C -:10D6A000D0311B0AAB73B4F8D231EB7394F8DD3B85 -:10D6B000012B40F0878094F8B7335B0600F082803E -:10D6C000B4F8903101332B74B4F8903101331B124C -:10D6D0006B741235B9F1000F07D094F992080FF06E -:10D6E00015FE47F0400705F8010BB8F1030F0BD00A -:10D6F000B8F1060F08D0B8F1010F40F0D68094F8C9 -:10D70000DD3B002B00F0D1804FF00009A2464946D6 -:10D71000744AB9F1020F02D1B8F1010F17D19AF88A -:10D7200050B0BBF1010F12D1049B9AF85200EB1AD2 -:10D730000230C3F14003C0B2DBB2984207D8294699 -:10D7400052F82930204698475946664A054409F15F -:10D750000109B9F1030F0AF1680ADAD157EA0103A6 -:10D76000049B08BF1D46129BA5EB0309029B83B3D4 -:10D77000DDE901128A4228BF0A46C9F580730133E8 -:10D78000934228BF1346119A11995289DBB21A4469 -:10D790004A81049A1298AD1A6A1C1344109A1371A4 -:10D7A0001146FFF755FB059B45EA8315129B9D70BB -:10D7B000DF70B8F1060F15D8DFE808F00D194153F6 -:10D7C00014417300B4F890312B74B4F890311B0AF3 -:10D7D0007EE7029BDDE7002384F8D773C4F8C03BE3 -:10D7E000C4F8D8635FFA89F007B0BDE8F08F002372 -:10D7F000C4F8C03B002EF5D0109B94F84E1A1A794D -:10D8000094F84C0A02320CF08EF8374B1B689A8A57 -:10D81000A36C9A422CBF8018C018344B984228BF82 -:10D820001846C4F8C00B0CF085F83346014694F84E -:10D83000C42BC4F8C00B2046FFF766FDD2E7002CCE -:10D84000D0D00023C4F8C03B002ECBD094F84F1AA0 -:10D8500094F84C0A09B994F8191B109B1A790232F2 -:10D86000D1E70023C4F84833002EBBD0109B94F8B6 -:10D870004E1A1A7994F84C0A02320CF054F81A4BEA -:10D880001B689A8AA36C9A422CBF8118C118174B47 -:10D8900094F84D23994228BF19463346C4F84813DB -:10D8A000C9E70023C4F848339CE7049B002F08BF56 -:10D8B0001D4658E7B8F1040F3FF482AD4FF0010B5D -:10D8C000002C7FF488ADB8F1020F3FF488ADB8F1B9 -:10D8D000050F3FF484AD00278EE500BF1211111132 -:10D8E000E3361A0000260301DC4D0021D47E25001A -:10D8F00000232DE9F04788B0CDF8193007238DF8C3 -:10D900001830038C064603F007030F46904600F5D7 -:10D910000969062B00F28680DFE803F0047C7C8432 -:10D920004C7C7C00B0F85238002B07BF1A461D46CD -:10D9300008221025154390F83D20012A14BF002429 -:10D94000402408BF44F00104002B0CBF40230023F7 -:10D950001C4390F88931012B04D190F8C63B002B71 -:10D9600008BF1825E8064ED445F001050DF1180A48 -:10D97000EB0632464946504648BF04F0BF04F5F76F -:10D980002BFA324649465046F5F786FA0022338C88 -:10D99000CDE90328CDE9012786F8D7232946224679 -:10D9A0003046CDF800A003F00303FFF7EBFC08B00E -:10D9B000BDE8F087B0F85238002B07BF1A461D4665 -:10D9C00008221025154390F83D20012A0ABF0224A1 -:10D9D0000024402208BF44F0010418BF0022002B9D -:10D9E0000CBF4023002314431C4390F88931012BC2 -:10D9F00004D190F8C63B002B08BF1825E90602D4D5 -:10DA000045F00305B2E7094B9B699A04AED504F0D3 -:10DA1000FE04ABE790F83D301825012B0CBF4024E5 -:10DA20000024A3E700242546A0E700BF20500021E2 -:10DA30002DE9F04F9946002389B0CDF8193007231E -:10DA40008DF81830038C054603F007038846174607 -:10DA500000F5246A062B4FD8DFE803F00751514E3A -:10DA600019044C0040240B2626E090F8D74390F888 -:10DA7000893104F00104C4F15104012BE4B204D152 -:10DA800090F8C63B0BB944F02004082614E090F847 -:10DA9000D74390F8893114F0020F04F001040CBF51 -:10DAA0000A260826C4F15104012BE4B204D190F8EF -:10DAB000C63B0BB944F020040DF1180B2A46514621 -:10DAC0005846F5F789F92A4651465846F5F7E4F9DC -:10DAD00001222B8CCDE90282314622462846CDE92F -:10DAE00000B7CDF8109003F00303FFF74BFC09B02B -:10DAF000BDE8F08F4824B6E700242646DCE7402442 -:10DB00000926D9E700232DE9F04389B0CDF8193073 -:10DB1000072304468DF81830134B00F524699B69E0 -:10DB200006AD1B050E46174649460246284654BF19 -:10DB30004FF001084FF00908F5F74EF92246494623 -:10DB40002846F5F7A9F90223CDE9026304F23C73F4 -:10DB5000CDE9005350220023414620460497FFF7A9 -:10DB600011FC09B0BDE8F0832050002130B50C460F -:10DB70000725002189B0CDF819108DF818502BB960 -:10DB8000018C11F0020F14BF00210821049304231B -:10DB9000CDE9024306AB0192009310220023FFF768 -:10DBA000F1FB09B030BD000000232DE9F04788B03B -:10DBB0000F469046054606938DF81C3000B30823A7 -:10DBC00000F5246600F6C8340246314680F8C83BAA -:10DBD0002046F5F701F92A4631462046F5F75CF96B -:10DBE0000523CDE90273002303211A462846CDE917 -:10DBF0000043CDF81080FFF7C5FB08B0BDE8F08703 -:10DC0000DFF83CA0DAF80030BBB1DFF83890D9F883 -:10DC1000003093B10CF098FB08230446466AC16AB1 -:10DC200032468DF8183006A8DAF8003098473246A8 -:10DC3000D9F80030E16A06A8984706ACD0E700BFE3 -:10DC4000BC4B0021B84B00212DE9F74305460024C9 -:10DC500000F5096702460E46684601F1020839469A -:10DC600000948DF80440F5F7B7F82A46394668461F -:10DC7000F5F712F92B8C03F00703032B05D0052BC6 -:10DC80004ED0022B50D106234BE08DF80040D5E951 -:10DC9000042340460DF062F89DF8003006F10807B5 -:10DCA000012B0CD1D5F81439384643F00403C5F8DC -:10DCB0001439D5E906230DF051F806F10E079DF849 -:10DCC0000090B9F1060F31D8012303FA09F313F0DC -:10DCD00045040BD095F83D4644B11F2C22463846EA -:10DCE00028BF1F2205F23E6113F050FB104B9B6AC8 -:10DCF0005B0405D5B9F1010F9CBF01238DF80130FC -:10DD0000A7EB08000444694630468DF80440FFF74D -:10DD10009FF89DF804000230C0B203B0BDE8F08364 -:10DD200001238DF80030B2E70223FAE70024DDE793 -:10DD300020500021002337B5ADF801308DF80330B5 -:10DD400004238DF8003090F839300446022B0D463C -:10DD500025D003F0FD03012B01D18DF8023094F89A -:10DD600051376946063328468DF80430FFF770F8BE -:10DD7000D4E90423054428460CF0F0FF94F8512719 -:10DD80003AB11F2A28BF1F2204F25271A81D13F0B6 -:10DD9000FDFA9DF804000230C0B203B030BD436903 -:10DDA0001B0A03F0C003402BD9D10123D5E70000A3 -:10DDB000F0B51F460023072490F8C06389B09E4247 -:10DDC00014BF04261E468DF818400D4CB0F8605361 -:10DDD000E46A05F04005640804F0080434432C4369 -:10DDE0000325019206AACDE902150092194604976F -:10DDF00044F01002CDF81930FFF7C4FA09B0F0BDB5 -:10DE0000205000218A780B8843EA02331BB203704A -:10DE1000C3F3072343708B8883708B881B0AC370FE -:10DE2000042070474A790B7843EA02234A7892002B -:10DE300002F0040213438A78D20002F0080213436E -:10DE4000CA78120102F0100213430A79520102F05B -:10DE5000200213431BB20370C3F3072343700B79F3 -:10DE600043B1CB798A7903F01F0343EA82138370AD -:10DE70000320704702207047002303700B78437023 -:10DE80004B8883704B881B0AC3708B8803718B8807 -:10DE90001B0A4371CB888371CB881B0AC3710B8922 -:10DEA00003720B891B0A43724B8983724B891B0ACD -:10DEB000C3720C2070474A780B7803EB0223C3F33C -:10DEC0000B02C3F3013302808370CA788B7803EBB3 -:10DED00002238380042070470B7810B503F00304FD -:10DEE0004A780470C3F380044470C3F3C0048470A0 -:10DEF000C3F30014C3F34013C470037142713BB108 -:10DF00008B7803F01F029B09C2718371032010BD3F -:10DF10000220FCE74B780370CA788B7803EB02236E -:10DF200043804A790B7903EB02238380CA798B798A -:10DF300003EB0223C3804A7A0B7A03EB02230381AB -:10DF4000CA7A8B7A03EB022343810C2070478B78CB -:10DF5000CA781B0212049B182CBF0122002210B5A4 -:10DF60004C781B1942F100040A7912069B184A7971 -:10DF700042EB0402C0E90032CA798B7903EB022339 -:10DF80000381082010BD10B50446481C0CF0CDFEDE -:10DF9000C4E90001092010BD4B780370CA788B7862 -:10DFA00003EB022343804A790B7903EB022383803E -:10DFB000062070478A784B7803EB022303800A79A6 -:10DFC000CB7803EB022343808A794B7903EB02235E -:10DFD00083800A7ACB7903EB0223C3800920704740 -:10DFE00010B58A784B780C3003EB022320F80C3CF8 -:10DFF0000A79CB7803EB022320F80A3C8A794B7923 -:10E0000003EB022320F8083C0A7ACB7903EB0223C6 -:10E0100020F8063C4B7A00F8043CCA7A8B7A03EB72 -:10E02000022320F8023C01F10E031A3113F8014CCF -:10E0300013F8022C023302EB04228B4220F8022B4D -:10E04000F4D1182010BD4B7803708A7803F00703D1 -:10E05000037002F007034370032070474B7803708E -:10E060008B7843700A79CB7803EB02234380052039 -:10E07000704738B58B784A78054602EB0322034691 -:10E080000C4623F8022BCA1C153112F8010B8A42E8 -:10E0900003F8010BF9D1A27D637D04F11B0003EBB2 -:10E0A0000223AB82227EE37D03EB0223EB82637EBD -:10E0B00003F00F022A76C3F300125B096A76AB768F -:10E0C000A37EEB760CF044FEC5E9080194F822200B -:10E0D00094F82130232003EB02232B8538BD4B78A5 -:10E0E00003708B784370CB7883700B79C3708A7917 -:10E0F0004B7903EB0223C3F30B03D2090271C380F4 -:10E100000A7ACB7903EB0223C3F30B0303818A7AE8 -:10E110004B7A03EB0223CA7A03EB0243C3F31303E4 -:10E12000C3604A7B0B7B03EB02238A7B03EB024336 -:10E13000C3F3130303610A7CCB7B03EB02238382CB -:10E140008A7C4B7C03EB0223C382CB7C03764A7D23 -:10E150000B7D03EB02238A7D03EB0243C361CB7D7E -:10E160001A0903F00F0380F8212080F820300B7E7D -:10E1700080F822304B7E80F82330CA7E8B7E03EB02 -:10E18000022383844A7F0B7F03EB02238A7F03EB06 -:10E190000243836291F82020CB7F03EB022391F8A6 -:10E1A000212003EB0243C36291F8232091F822302F -:10E1B00003EB02230386242070478A784B7803EB15 -:10E1C0000223CA7803EB024303604A790B7903EB1D -:10E1D00002238A7903EB024343600A7ACB7903EB8B -:10E1E0000223038109207047CB788A781B0403EB54 -:10E1F00002234A7813440A7903EB026303608A79A5 -:10E200004B7903EB0223CA7903EB024343604A7A5A -:10E210000B7A03EB02238A7A03EB024383600A7BC7 -:10E22000CB7A03EB02234A7B03EB0243C360CA7B36 -:10E230008B7B03EB022303821020704738B58B7869 -:10E240004A78054602EB032203460C4623F8022BCC -:10E25000CA1C153112F8010B8A4203F8010BF9D1DF -:10E26000A27D637D04F11B0003EB0223AB82227EBF -:10E27000E37D03EB0223EB82637E03F00F022A7639 -:10E28000C3F300125B096A76AB76A37EEB760CF0E3 -:10E290005FFDC5E9080194F8222094F821302B2075 -:10E2A00003EB02232B8594F8253094F824201B04DB -:10E2B00003EB022394F82320134494F8262003EB65 -:10E2C0000263EB6294F8273085F8303094F82830F8 -:10E2D00085F8313094F8293085F8323094F82A30B6 -:10E2E00085F8333038BD000070B504460E4615463B -:10E2F000FFF7F2FD365C014426722A2E00F291806F -:10E30000DFE816F02B006C00E4008F008F008F0018 -:10E310008F00E400830084008F008F00910096003E -:10E3200089005F005D009B008F008F007E007E00F3 -:10E33000A800A600B200BE00E900F300D700E0008C -:10E34000E000F90004010F011C013C0141012B0117 -:10E3500046016A016D0175018801002D61D004F14B -:10E360001000FFF7D7FD637983425AD140F67A4116 -:10E37000A38A9A1F92B28A4201D91E261DE0217CEF -:10E380000029FAD0092B8CBF082203F1FF329142F9 -:10E39000F3DC628A9A42F0D840F67640218BA1F1F4 -:10E3A0000A0292B28242E8D8E28A02FB0333B3EB5C -:10E3B000810FE2DAB2F5FA7FDFD2304670BD012D6F -:10E3C0002FD0994B9B6A9D072BD504F11000FFF7C6 -:10E3D00007FE6379834224D10026EEE70DB304F1F2 -:10E3E0001000FFF7B4FD637983421AD1D4E9040128 -:10E3F00031F01F03C1D10AF01AFF0128ECD8BCE7A5 -:10E4000004F11000FFF7D6FDE3E755B104F1100069 -:10E41000FFF7B9FDDDE7012D03D0834B9B6A180799 -:10E42000F4D41926C9E704F11000FFF7B5FDD0E7D1 -:10E43000FF2323744B7863744AE07B4B9B6A5A0733 -:10E44000EFD54B7823748B7863746379032BC2E721 -:10E45000012DE6D0744B9B6A13F4106FE1D004F1E8 -:10E460001000FFF7F0FDB4E7002DDAD06E4B9B6A89 -:10E4700013F4106FD5D004F11000FFF7EFFDA8E7FB -:10E48000012DCED0684B9B6ADB03CAD54B78237431 -:10E490008A78617903F00703032962742374C0D179 -:10E4A000002B3FF46AAF023A232A8CBF1E260026B7 -:10E4B00083E75D4B9B6A9E01B3D504F11000FFF723 -:10E4C000D8FD86E7584B9B6A5D01AAD54B7823742B -:10E4D0006379022B7FE7544B9B6A5803A1D54B7895 -:10E4E00003F01F0222749B09A5E74F4B9B6A990317 -:10E4F0003FF572AF95E74C4B9B6A9A0091D5002D82 -:10E500008FD004F11000FFF7EAFD62E7464B9B6AEB -:10E51000DB0086D5012D84D004F11000FFF74DFEFD -:10E5200057E7414B9B6A9E007FF57BAF002D3FF480 -:10E5300078AF04F11000FFF757FE4AE73A4B9B6AA9 -:10E5400013F0405F3FF46DAF4B7823748B786374A6 -:10E55000CB78A3746379042B3DE7334BDB6A13F06C -:10E56000040F3FF45EAF4B7823748B786374CB78E1 -:10E57000A3740B79E3746379052B2CE72A4BDB6AD0 -:10E5800013F0020FDEE7284BDB6A13F0020FE8E717 -:10E59000012D3FF446AF244BDB6A98067FF541AF6F -:10E5A0008A784B7803EB022323820A79CB7803EB3A -:10E5B000022363828A794B7903EB0223A3820A7ACE -:10E5C000CB7903EB0223E3828A7A4B7A03EB0223B3 -:10E5D000238363790B2BFEE6002DDCD121E7002D90 -:10E5E0003FF41FAF104BDB6A13F0800FAAE7012D39 -:10E5F0003FF417AF0C4BDB6A1A067FF512AF4B1CCA -:10E6000004F110020B3113F8010B8B4202F8010BDD -:10E61000F9D1DEE7044B9B6A9B017FF502AF04F161 -:10E620001000FFF70BFED4E62050002170B50E4617 -:10E6300004461546FFF750FC325C33182272033A49 -:10E64000102A3CD8DFE802F0092634363B3B3B3940 -:10E65000363B3B3B3B3B3B3D3D0085B3D3F8012084 -:10E660002261D3F805206261997A5A7A02EB01227D -:10E670002283D3F80B20C4F81A20D3F80F20C4F853 -:10E680001E20D3F81330C4F822306379172B16D12B -:10E69000002070BD012D12D0D3F801202261D3F8E3 -:10E6A00005206261D3F809206379A2610D2BEEE7A2 -:10E6B000012D04D06379012BE9E7002DFAD119204F -:10E6C000E7E7024B9B6ADB06F4D4F8E72050002111 -:10E6D000CB788A781B0243EA42120B7813434A78BC -:10E6E000920002F01C0213431BB20370C3F3072312 -:10E6F00043700220704710B50024BDF80810047064 -:10E70000140A427084708171140C090A120EC470CC -:10E7100002714371C171082010BD01238270120A79 -:10E7200003704170C270042070470B784A7803F080 -:10E7300003010170C3F38201C3F34013417083707E -:10E74000C2700220704770B5D3799579D47805EB03 -:10E750000325937824041B021B192CBF01260026D5 -:10E7600054781B19147952794FEA046446F1000673 -:10E770001B1942EB0602C0E9003208200D8070BD73 -:10E7800053780370D078937803EB00230B80042038 -:10E79000704770B50C4603464A7814F8040B00EB3A -:10E7A0000220C0F30B021A80C0F301329A70C0F34A -:10E7B0008032DA70CE788D7880F4805005EB0625B3 -:10E7C000C5F30B059D80C0F30035C00424D50AB302 -:10E7D0008A794879120402EB0022087901F10804D1 -:10E7E0000244C87902EB00620C209A6061782278BA -:10E7F000043402EB01229A8114F8011C14F8022C53 -:10E8000002EB0122C2F30B01C2F38132D9811A74E7 -:10E810005C6170BD0820E8E704209D60DD811D7407 -:10E82000F6E78B78CA781B03920302F4804203F464 -:10E83000405313430A8830B5C2F30B0213430370ED -:10E840001B0A43708B7813F0FD0F29D1CB78D3B915 -:10E850000422041D8B8923708B891B0A6370CB896A -:10E860000D7CC3F30B0343EA85331BB2A370C3F3E0 -:10E870000723E3708B88134483708B8813441B1227 -:10E88000C370101D30BD8B68082203718B6800F1C6 -:10E8900008041B0A43714B898371CB7AC371D9E792 -:10E8A0000022E7E74A780B7843EA420303700A78CC -:10E8B0008B7852B9033343704B6883704B681B0AE3 -:10E8C000C370CB88037105207047437002207047E6 -:10E8D0000B7803F00102C3F34003027043704B78DE -:10E8E00083704AB9CA788B7803EB02230A7903EB69 -:10E8F0000243436005207047022070474A790B7835 -:10E9000043EA02234A78920002F0040213438A7811 -:10E91000D20002F008021343CA78120102F010027A -:10E9200013430A79920102F0400213431BB20370B1 -:10E93000C3F307234370022070470B784A7803F033 -:10E9400003010170C3F380014170C3F3C001817002 -:10E95000C3F30011C3F38013C1700371427102202D -:10E960007047000038B50B4D0B4A95F8243004462B -:10E9700003EB8303034452F8233003B1984795F81F -:10E980002430064A03EB830313441B5D85F82430CF -:10E9900038BD00BF580D00210C2603015C26030181 -:10E9A00038B50378074A01EB830352F82330044655 -:10E9B0000D4603B198472278034B03EB82035B5D5E -:10E9C000237038BDE826030128270301062238B545 -:10E9D000084D04462B7802FB0303074A52F8233004 -:10E9E00003B1984706212A78044B01FB02331B5DD3 -:10E9F0002B7038BDC036002170260301D0260301DC -:10EA0000062238B5084D04462B7802FB0303074A5B -:10EA100052F8233003B1984706212A78044B01FBB2 -:10EA200002331B5D2B7038BDE83600219C270301A3 -:10EA3000D026030138B54378084A03EB83030B441F -:10EA400052F8233004460D4603B198476378044AD0 -:10EA500003EB830313445B5D637038BD3827030108 -:10EA60008827030138B50B4D0B4A95F8273004462B -:10EA700003EB8303034452F8233003B1984795F81E -:10EA80002730064A03EB830313441B5D85F82730C8 -:10EA900038BD00BF68370021FC2703014C28030163 -:10EAA00070B506268278084B06FB021253F8223016 -:10EAB00004460D4603B19847A278044B06FB023387 -:10EAC0005B5DA37070BD00BF7C280301DC280301DF -:10EAD00038B590F88831094A01EB830352F82330A6 -:10EAE00004460D4603B1984794F88821044B03EB84 -:10EAF00082035B5D84F8883138BD00BFF4280301D0 -:10EB000034290301032970B504460AD8012994BFAA -:10EB10000026012605291DD8DFE801F0081D081D83 -:10EB2000081D0B1F012B15D80226F3E700250B4B00 -:10EB300005EB460253F822300BB120469847682077 -:10EB400000FB0644064B94F8502003EB42035B5D48 -:10EB500084F8503070BD0125E9E700BF602803014B -:10EB60007828030138B54378074A01EBC30352F80C -:10EB7000233004460D4603B198476278034B03EBFC -:10EB8000C2035B5D637038BD44290301E4290301BE -:10EB900038B54378084A03EB83030B4452F823301B -:10EBA00004460D4603B198476378044A03EB830398 -:10EBB00013445B5D637038BD0C2A03015C2A0301BA -:10EBC000062970B505460C4608D859B14B1E052BD1 -:10EBD00008D8DFE803F00D0D07070D21172902D033 -:10EBE000472915D070BD0123C376E6F735FD032410 -:10EBF000AE78012E18D0022E27D0002EF2D1012C93 -:10EC00000DD0022CEED12846E6F786FDAE70E9E77E -:10EC1000E6F72DFD0424EBE7E6F738FDFAE7284692 -:10EC2000E6F738FDAC70DDE7042C09D0052C0ED0DA -:10EC3000032CD7D12846E6F795FD0223AB70D1E728 -:10EC40002846E6F703FE0023F8E7052CCAD128463C -:10EC5000E6F7A8FDF7E70000F0B543780446022B7D -:10EC60000D468BB050D0032B78D0002B55D13F29C7 -:10EC700053D1FAF7AFFF2046E7F79CFEA368D90708 -:10EC800003D56621204600F09FFDA368DA0503D571 -:10EC90006721204600F098FDA3685B060CD5B4F808 -:10ECA0004A331B2B04D8B4F84C33B3F5A47F03D9F3 -:10ECB0006821204600F088FD3349344B0868344908 -:10ECC000201AC0101A684843B4F8A21492F83C30D5 -:10ECD000099194F8A0140832089194F8451280B272 -:10ECE000079100210691D2E91467CDE90467D2E9C2 -:10ECF0001267CDE90267D2E91067CDE90067E7F74F -:10ED0000EDFB022363701FE03F291DD018D83D2979 -:10ED100021D02946204601F023FA4C2D2CD04D2D30 -:10ED200012D1194B18681A4B201AC0105843C0B2A0 -:10ED30000BF0F4F820460BB0BDE8F040F9F7F6BC54 -:10ED4000A1F14703012BE4D8294620460BB0BDE8CA -:10ED5000F04000F02BB8E8F7C1FAF5E75129DCD113 -:10ED6000D0F8883323F00103C0F88833E7F725FE95 -:10ED7000002384F87633E7E72046E8F75BFA20467D -:10ED8000E7F7CAFDCDE700BFB43A0021B03A002151 -:10ED9000BDCAE28C0322437842700022022B80F825 -:10EDA000762302D114300BF073BE7047482910B59A -:10EDB000044610D003D8A9B147290FD010BD4C2963 -:10EDC000FCD1E8F737FA2046E7F7A6FD2046BDE874 -:10EDD0001040F9F7ABBCE7F7FFFD2046BDE8104057 -:10EDE000FFF7D8BFE7F7EFFDF7E70000F0B543788E -:10EDF00004460D468BB0032B0FD8DFE813F0150047 -:10EE00008D00040021013D2907D0A5F14703012B06 -:10EE100003D92946204601F0EDFB294620460BB0D8 -:10EE2000BDE8F040FFF7C2BF0B29F6D1FBF72AF887 -:10EE30002046E7F7BFFDA36813F4007F03F40071D9 -:10EE400003F0010248D02AB1D4F88C2342F0080222 -:10EE5000C4F88C23D80542BFD4F88C2342F00402B6 -:10EE6000C4F88C2359060ED5B4F84A331B2B04D8AA -:10EE7000B4F84C33B3F5A47F05D9D4F88C3343F000 -:10EE80001003C4F88C330123754963700868754B0F -:10EE90007549201AC0101A684843B4F8A21492F8B1 -:10EEA0003C30099194F8A0140832089194F8451266 -:10EEB00080B2079100210691D2E91467CDE9046779 -:10EEC000D2E91267CDE902670121D2E91067CDE9E5 -:10EED0000067E7F703FBA0E752EA010303D06621CE -:10EEE000204600F071FCA368DA0503D567212046AF -:10EEF00000F06AFCA3685B060CD5B4F84A331B2B00 -:10EF000004D8B4F84C33B3F5A47F03D96821204664 -:10EF100000F05AFC0223B7E7232929D814297FF6E9 -:10EF200078AFA1F115030E2B3FF673AF01A252F893 -:10EF300023F000BF8DEF010113EE010113EE01017B -:10EF400013EE010113EE010113EE0101A7EF010120 -:10EF5000BDEF010113EE010113EE0101D3EF010139 -:10EF6000FFEF010115F001012BF00101E9EF0101B3 -:10EF7000402905D03FF649AF3D293FF44EAF48E761 -:10EF8000022370214370F9F7CBFD46E7D0F88C33AC -:10EF900043F40063C0F88C33D0F8883343F4006343 -:10EFA000C4F8883339E7D0F88C3343F00403C0F851 -:10EFB0008C33D0F8883343F00403F1E7D0F88C3376 -:10EFC00043F00803C0F88C33D0F8883343F00803CB -:10EFD000E6E7D0F88C3343F01003C0F88C33D0F858 -:10EFE000883343F01003DBE7D0F88C3343F0800321 -:10EFF000C0F88C33D0F8883343F08003D0E7D0F8E2 -:10F000008C3343F40043C0F88C33D0F8883343F496 -:10F010000043C5E7D0F88C3343F02003C0F88C33AD -:10F02000D0F8883343F02003BAE7D0F88C3343F0AC -:10F030004003C0F88C33D0F8883343F04003AFE787 -:10F0400051297FF4EAAED0F8883323F00103C0F8E9 -:10F050008833E7F7B2FC002384F87633DDE600BF9F -:10F06000B43A0021B03A0021BDCAE28C38B50A4D4D -:10F070000A4A95F82430044600EB830352F8233003 -:10F0800003B1984795F82420054B03EB82031B5DE1 -:10F0900085F8243038BD00BFD03A0021702A030122 -:10F0A000B02A030138B50378074A01EB830352F80D -:10F0B000233004460D4603B198472278034B03EBF7 -:10F0C00082035B5D237038BDC02A0301002B03015E -:10F0D00038B50B79154603EB83031344064A0C46F7 -:10F0E00052F8233003B198472379044A03EB830392 -:10F0F00013445B5D237138BD102B0301382B0301D2 -:10F10000172970B505460C462DD006D804291ED007 -:10F110000C290ED00024204670BD7029FAD1D0F8F9 -:10F120008C3319032DD523F400230224C0F88C332B -:10F130000DE04B4B1A7A222AECD1597C187CF6F759 -:10F140008FFD0028E6D001240389A5F82C34B5F8FA -:10F150002C04F6F769FD95F876330646CBB1012B02 -:10F1600026D00124D7E73F4C2368D888F6F75CFD0A -:10F170000028CFD023680024DA88A5F82C24DC806E -:10F18000E5E7DA02C6D523F480130324C0F88C33F4 -:10F19000DDE7014622462846FFF79AFF3379002B28 -:10F1A000DFD00124132385F8764385F88533B2E751 -:10F1B000012C15D195F88533042B0FD8012B0FD9CD -:10F1C0000121D5F88C2301FA03F31343C5F88C33DE -:10F1D000132385F8811385F8853301E0072BEFD0E1 -:10F1E00095F88523132A14D1224631462846FFF785 -:10F1F0006FFF3479002CB4D128463146F7F7FBF97C -:10F20000FF23284685F8764385F88533E7F7B0FF76 -:10F21000A7E7C4B1012CA4D10F2A04D849F60203F0 -:10F22000D340DB0709D43046E6F710FAD5F88C3323 -:10F2300043F48013C5F88C336DE722462A21284613 -:10F24000E7F7DCFE67E7D5F8883343F40023C5F819 -:10F250008833D5F88C3343F40023C5F88C3380E72A -:10F26000283A0021B03A002138B5CB781546C3EBD7 -:10F27000C3031344064A0C4652F8233003B198479F -:10F28000E378044AC3EBC30313445B5DE37038BD0A -:10F29000442B0301982B030101222321E7F7AEBE83 -:10F2A0004B29F8B5044647D008D8242926D0272969 -:10F2B0002BD00C290AD000252846F8BD6E292BD06A -:10F2C00070292FD05229F6D103260FE0454B1A7A28 -:10F2D000112A03D0202A06D0072AECD11B7C1F2B31 -:10F2E000E9D1022602E0012680F85264B4F82C0429 -:10F2F000F6F79AFC074608BB0125DDE73A4B1B6889 -:10F300009B88A0F82C340026F0E7374B05261B68B5 -:10F31000DB88A0F82C34E9E790F88533112BCAD1AB -:10F320000626E3E7D0F88C3313F40035C4D023F479 -:10F330000033C0F88C33E6E70426D7E794F8765319 -:10F34000D5B1012DD8D194F88533112B3BD132465C -:10F3500001462046FFF788FFFE78002ECCD12046DC -:10F360003946F7F748F9FF23204684F8766384F896 -:10F370008533E7F7FDFE9FE71C4B9B695B0102D4D9 -:10F3800094F8223373B1324639462046FFF76CFFBA -:10F39000FB78002BB0D00125112384F8765384F834 -:10F3A000853389E7D4F88833672143F40033C4F800 -:10F3B0008833D4F88C33204643F40033C4F88C33BC -:10F3C00000F002FA98E7002E96D1D4F8883343F47F -:10F3D0000033C4F88833D4F88C3343F40033C4F8D2 -:10F3E0008C3369E7283A0021B03A002120500021EF -:10F3F00038B5CB781546C3EBC3031344074A0C4614 -:10F4000052F8233003B19847237833B1E378044AA4 -:10F41000C3EBC30313445B5DE37038BDB02B030142 -:10F42000202C030110B5044600F5FA700CF011F819 -:10F430002046BDE8104001222321E7F7DFBD000090 -:10F440005229F8B504466BD008D825296ED0262954 -:10F450006AD00C2911D000252846F8BD6E2959D054 -:10F460007029F8D1D0F88C3313F48025F4D023F42C -:10F4700080230126C0F88C3340E05C4D2B7A1F2B93 -:10F4800008D0212B54D0112BE5D12B7C202BE2D19D -:10F49000052633E0287CF6F799FC48B9287CF6F776 -:10F4A00051FC48B9012243212046E7F7A7FDD2E7E6 -:10F4B00090F88030002BF5D1F6F770FB0028F1D0E2 -:10F4C0004B4B4C4A1B680026E31ADB1053430122C6 -:10F4D0009BB2C38082720289A4F8F83145F20123FD -:10F4E000A4F82C24444A4549C4F83C24444AA4F8CE -:10F4F000FA311160434A127B84F80022B4F82C04DC -:10F50000F6F792FB94F8765307469DB1012D20D073 -:10F510000125A1E790F88533112B9CD10626EDE754 -:10F520001022394B1B681A710326E7E70226E5E72C -:10F530000426E3E7014632462046FFF759FFFB78F1 -:10F54000002BE5D00125112384F8765384F8853308 -:10F5500082E7AEB994F88533042B0FD8012B0FD96D -:10F560000121D4F88C2301FA03F31343C4F88C333C -:10F57000112384F8811384F8853301E0072BEFD041 -:10F5800094F88523112A17D1324639462046FFF7D1 -:10F590002FFF3B7813B1FB78002BB9D120463946B9 -:10F5A000F7F729F8002384F87633FF23204684F800 -:10F5B0008533E7F7DDFD4FE7002EA9D10F2A04D8E8 -:10F5C00049F60203D340DB070AD439462046E6F762 -:10F5D000FFFDD4F88C3343F48023C4F88C333BE72D -:10F5E00001222A212046E7F709FD35E7283A0021C4 -:10F5F000B43A0021BDCAE28C25650101C56501014F -:10F60000143A002168500021B03A0021044B01EB6C -:10F610008101114453F8213003B11847704700BFEE -:10F62000682C030101390346082945D8DFE801F0B9 -:10F630001E0F05192732383D3D00022A0CBF93F8F2 -:10F64000190393F81A03B0FA80F0400970479878CC -:10F65000012831D1002A30D1D3F83003C0F3C000E3 -:10F660007047D3F83003C0F3401070479B78012BEC -:10F6700003D1101E18BF01207047101FFAE79978B8 -:10F680000029F6D0042A15D0B2B9B3F8320300F03D -:10F6900001007047002AF0D1084B93F82B00F6E7E1 -:10F6A000D3F83003C0F380607047D3F83403C0F35D -:10F6B000C010704700207047012070472050002183 -:10F6C0001FB5144B144A1B688DF80310C31ADB10C6 -:10F6D00053430022CDE9012203920A229BB2ADF8E6 -:10F6E0000630ADF800300D4B8DF804101B688DF816 -:10F6F00002201B79082B0AD8D0E9CC2302A80BF0F2 -:10F7000018FB684609F0C4FD05B05DF804FBD0E9BC -:10F71000CA23F3E7B43A0021BDCAE28CDC4D0021D4 -:10F720000B460121D0F888239940114210D022EADB -:10F7300001021549C0F888230A7A0D2A09D0112A36 -:10F7400007D0072A07D01A21022B0BD0072B19D07C -:10F750007047497CF8E7042B06D0072B0BD0022B0F -:10F76000F6D11A21FFF7ACBFD0F8303323F02003D5 -:10F77000C0F8303370471121D0F8303323F0806364 -:10F78000C0F83033E7F706BC283A002110B4012452 -:10F79000D0F888238C40144214D022EA04020329B2 -:10F7A000C0F8882307D0072908D002290AD10021F0 -:10F7B00010BCFFF785BF10BCE7F774B8002110BC80 -:10F7C000E7F7E8BB10BC70472329F8B504463BD8DF -:10F7D0000B2901D8002083E1A1F10C03172BF9D8E4 -:10F7E00001A252F823F000BF89F80101D5F7010109 -:10F7F000D5F70101D5F70101D5F70101D5F70101D1 -:10F80000D5F70101D5F70101D5F70101D5F70101C0 -:10F81000C1FD0101C1FD0101D5F70101D5F70101CC -:10F82000D5F70101C1FD0101C1FD0101D5F70101BC -:10F83000D5F70101C1FD0101D5F70101C1FD0101AC -:10F84000C1FD0101C1FD01016639CBB20A2BC1D84E -:10F850000A29BFD801A353F821F000BF81FD01019F -:10F8600081FD010181FD0101D5F7010181FD01014A -:10F8700081FD010181FD0101D5F701018BF9010134 -:10F88000D5F7010155F90101CF4B1B7A013BDBB2E2 -:10F89000292B9FD8CD4AD65CFF2E9BD0CA4B1D7A10 -:10F8A0006A1E292A96D801A151F822F097F9010180 -:10F8B0007BF90101D5F70101D5F70101D5F7010168 -:10F8C000D5F70101B7F9010113FB010113FB010198 -:10F8D000D5F70101D5F7010103FB01018DF9010104 -:10F8E00013FB0101D5F70101D5F701018DF90101E4 -:10F8F000D5F70101D5F70101F1FA0101F1FA010192 -:10F90000D5F70101D5F70101D5F701010DFB010183 -:10F91000D5F70101D5F7010129FB010187F90101A3 -:10F9200087F90101D5F70101D5F70101D5F70101EB -:10F93000D5F70101D5F70101D5F70101D5F701018F -:10F94000D5F70101D5F7010123FB010181F901017F -:10F9500029FB0101D4F89033002B0CBF01260226AD -:10F960006378032B3FF436AFD4F8902312F00105EF -:10F970007ED022F00102C4F8902300250BE001267E -:10F98000092508E00026072505E0062694F885539A -:10F99000FF2D3FF41FAF94F87633002B00F0C680A4 -:10F9A000012B00F01D81002D00F06481EAE00126AA -:10F9B000ECE7002672E71B7C5A1E282A3FF60AAFA6 -:10F9C00001A151F822F000BFEBFA01017BF901011E -:10F9D000D5F70101D5F70101D5F70101D5F70101EF -:10F9E000D5F7010113FB010113FB0101D5F701015B -:10F9F000D5F7010103FB0101D5F7010113FB01015B -:10FA0000D5F70101D5F70101D5F70101D5F70101BE -:10FA1000D5F70101F1FA0101F1FA0101D5F7010170 -:10FA2000D5F70101D5F70101D5F70101D5F701019E -:10FA3000D5F70101D5F7010197F9010197F9010106 -:10FA4000D5F70101D5F70101D5F70101D5F701017E -:10FA5000E3FA0101E3FA0101E7FA0101D5F7010137 -:10FA6000D5F7010123FB010181F90101012677E7A7 -:10FA7000D4F88C3313F001000CD14FF0010C0CFAC8 -:10FA800000F717EA0201C5B209D022EA0702C4F85A -:10FA9000902380E723F00103C4F88C337BE7013027 -:10FAA0000A28ECD1012707FA01F212EA0300CDB2CD -:10FAB00013D023EA0203C4F88C3394F88133012B6A -:10FAC0007FF469AF002284F8812394F87C230AB183 -:10FAD00084F8763384F885535DE701310A29E2D151 -:10FAE000F8BD162557E7152555E71D4653E70126AE -:10FAF000042550E70026FBE701263EE700263CE709 -:10FB00000126032547E70026FBE70026052542E7F7 -:10FB1000012602253FE70026FBE7002601253AE7FC -:10FB20000126082537E70026062534E7012E10D0E8 -:10FB30002AD8002E7FF437AF012303FA05F2D4F858 -:10FB400088332946134320463246C4F88833FFF7EA -:10FB50005DFD324629462046FFF764FD002800F08F -:10FB60009080012229462046FFF750FD2046E7F706 -:10FB7000E5FA84F88553012384F87C3384F87633DE -:10FB8000002D7BD00120ABE7B31E022B3FF60BAF5D -:10FB9000324629462046FFF745FDD8B1022E04D053 -:10FBA000022229462046FFF731FD1422084B02FBB2 -:10FBB0000533DB6813B120469847F4E684F8855393 -:10FBC00084F87E33D7E700BF283A00213C2C03019C -:10FBD000682C030100221A212046E7F70FFAE2E61B -:10FBE000072E3FF6E0AE01A353F826F00DFC01010D -:10FBF0000DFC0101A7F901018DFC01013FFD01018F -:10FC0000C1FC0101D3FC0101D3FC010132462946AC -:10FC10002046FFF707FDA0B33EB9012303FA05F222 -:10FC2000D4F888331343C4F8883394F88533AB424F -:10FC300007D0012303FA05F2D4F88C331343C4F838 -:10FC40008C3326B9324629462046FFF7DFFC002DCB -:10FC500098D1D4F88C33012223F00103C4F88C33FB -:10FC6000D4F89033294643F001032046C4F890337A -:10FC7000FFF7CCFC94F88533002B7BD10323637012 -:10FC800080E729462046FFF74BFD8CE694F8853344 -:10FC9000AB4215D0032229462046FFF7C3FC0028BB -:10FCA0003FF481AE022229462046FFF7AFFC012334 -:10FCB00003FA05F2D4F890331343C4F8903372E694 -:10FCC00094F88533AB4219D1042229462046FFF728 -:10FCD0009DFC072E294620462ED1FFF721FD204608 -:10FCE000E7F73EFAFF2384F885330023204684F8A3 -:10FCF0007C3384F87633E7F73BFA54E60122D4F8F4 -:10FD00008C33AA401A423FF44EAE23EA0203C4F8F1 -:10FD10008C3394F881332946012B08BF00232046F9 -:10FD20004FF0040208BF84F88133FFF76FFC2946C7 -:10FD30002046FFF72BFD36E6FFF728FDCFE702222E -:10FD400029462046FFF762FC94F885330D2BAED090 -:10FD50001422384B02FB0533DE68002EA7D00422A4 -:10FD600029462046FFF75EFC00283FF433AF2046CB -:10FD7000B04718E6D4F89033DB073FF57FAF01E7D3 -:10FD8000CBB20A2B3FF626AD0A293FF623AD01A3DD -:10FD900053F821F001FB010111FB0101EFFA010110 -:10FDA000D5F70101F9FA01017FF9010121FB0101F8 -:10FDB000D5F70101AFF90101D5F701016DFA010194 -:10FDC0000B297FF607AD172B3FF604AD01A252F8C1 -:10FDD00023F000BFB3F90101D5F70101D5F7010107 -:10FDE000D5F70101D5F70101D5F70101D5F70101DB -:10FDF000D5F70101D5F70101D5F701011BFB010181 -:10FE0000FDFA0101D5F70101D5F70101D5F701018F -:10FE100017FB010107FB0101D5F70101D5F701012E -:10FE2000F5FA0101D5F701010BFB010127FB0101E7 -:10FE300085F90101682C030190F885030238022836 -:10FE40008CBF00200120704770B50B2690F87923F5 -:10FE5000084B06FB021253F8223004460D4603B14C -:10FE6000984794F87923044B06FB02335B5D84F8D2 -:10FE7000793370BD302D0301E02D03010C21E6F72D -:10FE8000B3BB10B5012223210446E7F7B7F80023DE -:10FE900084F8523410BD10B50446E7F761F92046E6 -:10FEA000BDE81040E7F7D2B9012310B5044680F849 -:10FEB0007D33E7F755F92046E6F7A0FD2046BDE87B -:10FEC0001040E7F7C3B9012310B5044680F87D332D -:10FED000437C23F001034374E7F742F92046E6F739 -:10FEE000EBFD2046BDE81040E7F7B0B9427C42F098 -:10FEF00001024274E6F702BE10B50446437C43F0AB -:10FF000001034374E6F76CFD2046BDE81040E6F7B8 -:10FF1000F5BDD0F8883310B513F4006304460ED154 -:10FF2000C0F8883394F87D3383B10023204684F8E9 -:10FF30007D330122BDE810403B21E7F75FB8002385 -:10FF40003B21C0F88833E6F74FFBEBE710BD10B557 -:10FF500004461822002100F56B7011F03EFAD4F827 -:10FF600030339B0707D52046E6F7B2FD2046BDE8B3 -:10FF70001040E7F7E3B82046BDE810407121F8F7DC -:10FF8000CFBD10B50446D0F8883343F40063C0F801 -:10FF90008833E6F703FB2046BDE81040FFF7D7BFE4 -:10FFA000722970B5044608D86D2908D81D296CD06F -:10FFB00016D80C2918D0152969D0002539E06E39DA -:10FFC0000429FAD801A353F821F000BF5D00020113 -:10FFD000BBFF0101690002014B0002019300020115 -:10FFE0001E29EAD102211EE05C4B197ACA1F0A2A97 -:10FFF000E3D801A050F822F037000201BBFF010155 -:020000040102F7 -:10000000BBFF0101BBFF0101BBFF0101BBFF010100 -:100010004B000201BBFF0101250002019700020114 -:1000200057000201032194F87653B5B3012D44D053 -:100030000125284670BD1B7C0F2BBED1D4F8303370 -:1000400023F00203C4F83033EDE794F885330B2B2B -:10005000B3D10721E7E71B7C0F2BF9E790F8853335 -:100060000B2BAAD10621DEE7D0F88C330025B3F59F -:10007000006F03D10821C0F88C53D4E7B3F5805F3B -:10008000D7D10921C0F88C53CDE70121CBE700215E -:10009000C9E70A21C7E70421C5E72046FFF7D4FED8 -:1000A00094F87933002BC3D001230B2284F87633E4 -:1000B00084F8852384F87E53BAE7032915D194F890 -:1000C0008533042B0FD8012B0FD90120D4F88C23B2 -:1000D00000FA03F31343C4F88C330B2384F8810331 -:1000E00084F8853301E0072BEFD094F885330B2B90 -:1000F00016D12046FFF7A8FE94F87963002E97D119 -:100100002046E7F72DF8637C204623F00103637453 -:10011000FF2384F8766384F88533E7F729F888E7C6 -:1001200099B1032984D10D2B09D12046E6F758FC5B -:10013000D4F88C3343F48053C4F88C3379E701222C -:100140002A212046E6F75AFF73E72046E6F726FA0B -:10015000D4F88C3343F40063EEE700BF283A002163 -:100160001C2970B504460D4606D190F81A331BB110 -:10017000BDE87040E6F796BB2F4E3368FBB9736855 -:100180001BBBB368002B26D1F368002B29D1336940 -:10019000002B2CD17369002B2FD1B369002B32D1E6 -:1001A000F369002B35D1336A002B38D1736A002BE9 -:1001B0003BD129462046BDE8704000F0F1B9294600 -:1001C000204698470028DAD070BD29462046984737 -:1001D0000028D6D0F8E72946204698470028D3D0F3 -:1001E000F2E72946204698470028D0D0ECE7294678 -:1001F000204698470028CDD0E6E729462046984774 -:100200000028CAD0E0E72946204698470028C7D0F2 -:10021000DAE72946204698470028C4D0D4E7294683 -:10022000204698470028C1D0CEE729462046984767 -:100230000028BED0C8E700BFC04B002138B590F8F9 -:100240007933094A01EBC30352F8233004460D46C3 -:1002500003B1984794F87923044B03EBC2035B5D29 -:1002600084F8793338BD00BF0C2E03018C2E0301B6 -:1002700001222321E6F7C2BE10B50446437C0122C9 -:1002800023F001034374054B1B681979E6F7B6FEAA -:100290002046BDE81040E6F763BF00BFB03A00213A -:1002A000D0F88823110506D522F400620021C0F899 -:1002B0008823E6F799B97047014B597CE6F794B962 -:1002C000283A00210C21E6F78FB910B50446437C8B -:1002D00023F001034374E6F707FC2046BDE8104015 -:1002E000E6F72CBF10B50446E6F73AFF2046BDE816 -:1002F0001040E6F75FB910B50446E6F771FB637C82 -:10030000204643F001036374BDE81040E6F7F6BBF6 -:10031000FFF7F1BF0322437842700022022B80F8DE -:10032000762302D114300AF0B3BB7047D0F888238B -:10033000094922F40062C0F888230A7A03460D2A8C -:1003400005D0112A03D0072A05D11A2101E0184649 -:10035000497CE6F749B97047283A0021D0F8303394 -:1003600010B59B07044606D5E6F7B2FB2046BDE86C -:100370001040E6F7E3BE1A21E6F736F92046BDE85D -:1003800010406E21F8F7CCBB10B50446D0F8883386 -:1003900043F40063C0F88833E6F700F92046BDE86F -:1003A0001040FFF7DBBF00001E2970B504465DD08A -:1003B00007D815295CD01D295CD00C2909D000254F -:1003C00005E06E293DD070294FF000053FD028464A -:1003D00070BD724A137A002B4ED0073BD9B20A295E -:1003E000EDD80A2BEBD801A151F823F01904020132 -:1003F000BF030201BF030201BF030201BF030201E9 -:10040000BF0302012F040201BF0302017D040201A8 -:10041000BF03020139040201137C0F2BCFD1D0F8A6 -:10042000303323F00203C0F83033052617E090F88C -:1004300085330B2BC3D1F8E7137C0F3B012BBED8C0 -:10044000F3E790F885330B2BB9D1062607E0D0F8F7 -:100450008C33B3F5006FBAD10726C0F88C5394F8EB -:1004600076536DB1012D1CD00125B0E70326F6E7C8 -:100470000026F4E70226F2E70426F0E70126EEE77D -:1004800031462046FFF7DAFE94F87933002BEBD0A3 -:1004900001230B2284F8763384F8852384F87E5375 -:1004A000E2E7012E01D0042E17D194F88533072BF3 -:1004B00003D010D89A1E022A0FD80121D4F88C2319 -:1004C00001FA03F31343C4F88C330B2384F881132C -:1004D00084F8853301E00F2B1BD094F885330B2B68 -:1004E00021D131462046FFF7A9FE94F87963002E0A -:1004F000BAD12046E6F734FE637C204623F00103A0 -:100500006374FF2384F8766384F88533E6F730FE5E -:100510005DE7D4F88C3343F40043C4F88C330B23E9 -:1005200084F88533D9E7052E9ED801A353F826F029 -:100530006305020155050201690402016904020113 -:10054000490502017705020100222A212046E6F72B -:1005500055FD3CE701222A212046E6F74FFD3546AE -:1005600035E72046E6F71AF8D4F88C3343F40063F5 -:10057000C4F88C332BE7D4F88C3323F40063C4F82D -:100580008C3394F8793313B1002384F87933034B17 -:100590002046597CE6F728F819E700BF283A0021E1 -:1005A0004A2910B504461FD006D80E290FD0492974 -:1005B00013D00D2907D010BD512918D07329FAD1B5 -:1005C000E6F7FEF90BE0BDE81040E6F703BD0022B8 -:1005D000BDE810401E21E6F711BDE6F7F7F9204609 -:1005E000BDE81040FFF796BEE6F7F3F9F7E7E6F748 -:1005F000E4F9F4E71C2970B504460D4606D190F8DD -:100600001A331BB1BDE87040E6F74CB92F4E336882 -:10061000FBB973681BBBB368002B26D1F368002BB2 -:1006200029D13369002B2CD17369002B2FD1B369E9 -:10063000002B32D1F369002B35D1336A002B38D12E -:10064000736A002B3BD129462046BDE87040FFF776 -:10065000A7BF2946204698470028DAD070BD294612 -:10066000204698470028D6D0F8E7294620469847E4 -:100670000028D3D0F2E72946204698470028D0D05A -:10068000ECE72946204698470028CDD0E6E72946E2 -:10069000204698470028CAD0E0E7294620469847D8 -:1006A0000028C7D0DAE72946204698470028C4D05A -:1006B000D4E72946204698470028C1D0CEE72946EE -:1006C000204698470028BED0C8E700BFE84B00216D -:1006D00090F885330B2B05D190F87903831E58428F -:1006E000584170470020704790F88503A0F1160329 -:1006F00058425841704790F87903C31E58425841F8 -:10070000704710B50446E7F7D2FA2046E7F7EAFA51 -:100710002046E6F76FFD2046E7F7A8FB2046E7F7FF -:1007200093FC2046BDE81040E6F708BD10B504462E -:10073000E7F7BDFA2046E7F7D5FA2046E7F784FC4D -:100740002046BDE81040E6F7F9BC10B50446E7F7CF -:100750007EFB2046BDE81040E6F7F0BC10B504462D -:10076000E6F709FD2046E6F737FD012384F80B3351 -:1007700010BD10B50446E6F7FEFC2046BDE810406B -:10078000E6F72ABD10B50446E6F7EAFC2046E6F790 -:10079000F7FC2046E6F732FD94F80B13204629B10A -:1007A000E7F7DEFB002384F80B3310BDE7F7B2FB5D -:1007B000F8E7000010B50446E6F7D2FC2046E6F75D -:1007C000DFFC2046E6F71AFD064B20461A7A072A78 -:1007D00014BF597C1A21E7F79DFB002384F80B33E3 -:1007E00010BD00BF283A00210C21E7F793BB10B5DC -:1007F0000446E7F745FA2046E7F75DFA2046E7F7B3 -:1008000017FB2046BDE81040E6F798BC10B504463B -:10081000E6F7A6FC2046E7F707FC2046E7F7A2FA32 -:100820002046E6F7E7FC2046BDE81040E6F786BC28 -:1008300038B590F877330A4AC3EBC3030B4452F838 -:10084000233004460D4603B1984794F87733054AA0 -:10085000C3EBC30313445B5D84F8773338BD00BF3B -:10086000AC2E03018C2F030170B590F8974205461A -:10087000012C0E461CD10C2907D0A1F10D03012B30 -:1008800016D8E7F7A7FA204670BD554B1B7A023BF6 -:100890000F2B09D8DFE803F00C080C0C0C0C08082F -:1008A000080C080C0808080CE7F794FA0024EAE79B -:1008B00095F876332BB1012B08D195F885330D2BA4 -:1008C00004D0182E02D12846E7F786FB454B9C6AD8 -:1008D00014F00104D7D03E2E47D005D80C2E0FD0EF -:1008E000182EE3D1002130E0702EDFD1D5F88C3303 -:1008F00013F40054C7D023F40053C5F88C33F1E748 -:10090000374A137A043B0D2BD0D801A151F823F0BC -:100910007B09020177090201490902016509020107 -:10092000AD080201AD080201AD0802017F09020114 -:10093000AD08020159090201AD080201AD0802012A -:10094000AD08020165090201032195F87643C4B19F -:10095000012C26D0012496E795F885330D2BA5D1DF -:100960000621F2E7137C032BF9E795F885330D2B6D -:100970009CD10521E9E70221E7E70121E5E7042110 -:10098000E3E72846FFF754FF95F87733002BE1D0D3 -:10099000052BDFD00D23012485F8853385F87643B8 -:1009A00071E795F885330D2B06D0D5F88C3343F4D9 -:1009B0000053C5F88C3366E72846FFF739FF95F8F2 -:1009C0007733052B01D0002BC4D1FF2385F8853365 -:1009D0000023284685F87633E6F7CAFB53E700BFC5 -:1009E000283A00212050002190F87703C31E584276 -:1009F0005841704738B590F877330A4AC3EBC303C0 -:100A00000B4452F8233004460D4603B1984794F83E -:100A10007733054AC3EBC30313445B5D84F8773334 -:100A200038BD00BFC42F03018830030110B5044650 -:100A3000E7F71CFA2046BDE81040E6F77FBB10B58B -:100A40000446E7F74FF92046E6F795FB2046E6F720 -:100A5000D1FB2046E6F7C0FB012384F80B3310BD21 -:100A600010B50446E6F787FB2046E6F7C3FB2046B1 -:100A7000BDE81040E6F7B0BB10B50446E6F770FBE2 -:100A80002046E7F7FDF82046E7F7D2F92046E6F7DB -:100A900077FB2046E6F7B2FB94F80B13204629B10A -:100AA000E7F75EFA002384F80B3310BDE7F732FA5C -:100AB000F8E710B50446437C23F002034374E6F7DD -:100AC0004FFB94F80B236AB906212046E6F796FA05 -:100AD0002046E6F755FB2046E6F790FB002384F816 -:100AE0000B3310BD2046E7F739F96A212046FEF79F -:100AF0006BFEEDE710B50446437C23F0020343741C -:100B0000E7F71CF92046E7F72DF92046E7F7D3F879 -:100B10002046E7F77EF92046BDE81040E6F70EBB19 -:100B200010B50446E7F7C3F82046E7F7DBF82046A0 -:100B3000E7F7DCF82046E7F750F92046E6F7FEFA3B -:100B4000637C204643F002036374BDE81040E7F77E -:100B5000BBB9000010B590F87833044613B1012BEF -:100B600020D010BD0429FCD801A353F821F000BF08 -:100B7000850B0201B10B0201630B0201850B02011F -:100B8000970B0201E7F781F92046E6F7D7FA012330 -:100B900084F87833E5E7E7F7FFF92046BDE8104031 -:100BA000E7F714BA022908D004290AD00129D8D1BC -:100BB0002046BDE81040E7F777B9E6F7D1FA002301 -:100BC000E6E7BDE81040E7F7E7B900BF70B590F879 -:100BD00097520446012D1CD10C2907D0A1F10D0319 -:100BE000012B16D8E7F7F6F8284670BD574B1B7A4D -:100BF000023B0F2B09D8DFE803F00C0C08080C08A7 -:100C000008080C0C080C0808080CE7F7E3F80025A6 -:100C1000EAE74F4B9D6A15F00105E5D01A2935D05A -:100C200005D80C290BD01929F1D1042623E03E293F -:100C3000EDD194F885330D2BE9D106261BE0434B0B -:100C40001B7A033B082BE2D801A252F823F000BF25 -:100C5000890C02010F0C02010F0C0201850C02012C -:100C60000F0C02010F0C02010F0C0201750C0201A6 -:100C7000910C0201022694F876535DB1012D19D032 -:100C80000125B1E70126F6E70026F4E70526F2E79D -:100C90000326F0E731462046FFF7ACFE94F87733A1 -:100CA00013F0FB0FECD00D23012584F8853384F875 -:100CB000765399E716F0050F10D12046FFF708FD8F -:100CC000B8B1012394F8852303FA02F2D4F88C33E7 -:100CD0001343C4F88C330D2384F8853394F885339B -:100CE0000D2B19D0D4F88C3343F40053C4F88C3353 -:100CF0007AE72046FFF7A0F80028E2D1154B1B68E1 -:100D0000002BDED0204698470028DAD12046FFF796 -:100D1000EBFC0028D5D1E1E731462046FFF76AFE1B -:100D200094F8773313F0FB03AAD1627C84F876330E -:100D300022F002026274FF2294F8973284F885232D -:100D4000002B9DD12046E6F713FA4DE7283A002103 -:100D500020500021A83A002138B5304B05469B6A47 -:100D600003F01004DB061AD5542927D005D80C2926 -:100D700017D0532924D0002411E07029FBD1D0F8DA -:100D80008C3313F480440AD0002123F48043C0F84C -:100D90008C3395F87643BCB1012C23D00124204636 -:100DA00038BD1F4A137A122B0CD0132B04D0072BFB -:100DB000E1D1137C122BDED10221EAE70421E8E71E -:100DC0000321E6E70121E4E72846FFF7C3FE95F893 -:100DD0007833002BE2D00E23012485F8853385F883 -:100DE0007643DCE795F885330E2B06D0D5F88C33A7 -:100DF00043F48043C5F88C33D1E72846FFF7AAFEB9 -:100E000095F87833002BC9D1FF22284685F8852331 -:100E100085F87633E6F7ACF9C1E700BF2050002132 -:100E2000283A002190F87703C31E58425841704772 -:100E300038B590F87B33094A01EBC30352F82330ED -:100E400004460D4603B1984794F87B23044B03EB0B -:100E5000C2035B5D84F87B3338BD00BFBC30030147 -:100E60005C31030101222321E6F7C8B80C21E7F722 -:100E7000FFBB10B50446E7F727FB2046BDE810404E -:100E800000F020BA10B50446D0F8883343F400438C -:100E9000C0F88833E7F706FB2046BDE8104000F0B5 -:100EA00011BA2DE9F0419DF81880044648EA030084 -:100EB0001E4601EA080502EA030700F074FA8642BA -:100EC00004D1B04502D1B8F1000F02D1A3681B06CE -:100ED00001D53D402F46284600F065FA05463846C4 -:100EE00000F061FA94F854300646022B03D0032B2D -:100EF00014BF012304239D4208BF002594F85530F8 -:100F0000022B03D0032B14BF012304239E4208BFEE -:100F10000026294632462046E7F746FB65B91EB94A -:100F20006E212046F7F7FCFD2046F8F756FA2046DA -:100F3000BDE8F041E6F724B929462046F8F74AFA19 -:100F4000F5E773B590F862330446DA0790F8646306 -:100F500018D490F8635394F862339B0702D5EFF7E7 -:100F6000E3FB064694F8D9332046009332462946DF -:100F700094F8D833FFF795FF204602B0BDE87040E3 -:100F8000E6F7EEB8EFF7D0FB0546E4E713B5044605 -:100F9000074B5A7C009290F8D92390F8D8131B7C09 -:100FA000FFF77FFF204602B0BDE81040E6F7D8B853 -:100FB000283A00213E2970B5044649D005D80C29AD -:100FC00011D0202959D0002537E06E2946D070294C -:100FD000F9D1D0F88C331A0446D523F40043052107 -:100FE000C0F88C3323E0594A137A072B2DD00D3BE0 -:100FF000D9B20A29E7D80A2BE5D801A151F823F084 -:101000003F100201C70F0201C70F0201C70F020103 -:101010004B100201C70F0201C70F0201C70F0201E7 -:10102000C70F02012D1002017F100201022194F866 -:10103000765335B3012D34D00125284670BD90F884 -:1010400085330F2BBFD10321F1E7137C162BF9E772 -:1010500090F885330F2BB6D10721E8E790F8853358 -:101060000F2BB0D10421E2E713F48035E5D023F44F -:1010700080330621C0F88C33D9E70021D7E701215E -:10108000D5E72046FFF7D4FE94F87B33002BD3D06E -:1010900001230F2284F8763384F8852384F87E5365 -:1010A000CAE7022915D194F88533042B0FD8012BF8 -:1010B0000FD90120D4F88C2300FA03F31343C4F8AA -:1010C0008C330F2384F8810384F8853301E0072BE8 -:1010D000EFD094F885330F2B12D12046FFF7A8FEEE -:1010E00094F87B63002EA7D12046E6F739F8FF235A -:1010F000204684F8766384F88533E6F739F89CE770 -:10110000B1B1022998D1012B02D00B3B012B05D89C -:1011100001222A212046E5F771FF8EE72046E7F7F6 -:10112000D3F9D4F88C3343F48033C4F88C3384E798 -:101130002046E7F7B7F9D4F8883343F40043C4F8FE -:101140008833D4F88C3343F40043EEE7283A002187 -:10115000022803D0032814BF012004207047000098 -:1011600038B590F87B330C4AC3EBC3030B4452F8F9 -:10117000233004460D4603B1984794F87B33074A61 -:10118000C3EBC30313445B5D5A1F84F87B335342A4 -:10119000534184F8843338BD843103012C32030178 -:1011A0000C21E7F765BA0000F8B50446F8F715F921 -:1011B000D4F888331A0440F1818023F400430021DD -:1011C0002046C4F88833E7F753FA94F85410B4F87B -:1011D0004E730229B4F85003B4F85223B4F85453B0 -:1011E00033D8C1BB002694F85520022A41D8002AE2 -:1011F00045D10023032AA4F854634FD1B3F5296FD6 -:1012000038BF4FF42963A4F85803A4F850330329D6 -:1012100032464BD1B6F5296F38BF4FF42962A4F896 -:101220005C53A4F85423264B9B6A9B0646D5B4F81E -:101230005433AB4203D1B4F8503383423ED02046FE -:10124000BDE8F8400021E5F7DDBC0329CAD19201D1 -:1012500002F5747204E0B4F85C6336B90E32D20061 -:10126000AA42A8BF2A4696B2BDE70023A4F85C3381 -:10127000B9E7032ABDD1BB0103F5747305E0B4F8E7 -:1012800058333BB907F10E03DB008342A8BF034686 -:101290009BB2AFE70027A4F85873ABE7B3F5A47F80 -:1012A00038BF4FF4A473A4F85033B0E7B6F5A47F69 -:1012B00038BF4FF4A472A4F85423B4E7F8BD00BFBC -:1012C0002050002110B50446E5F755FF2046BDE843 -:1012D0001040E5F781BF000010B50446E5F740FF78 -:1012E000064B1B8A2BB92046BDE810406E21F7F74C -:1012F00017BC2046BDE81040E7F7EEB8283A0021B9 -:1013000010B50446E7F7E0F82046BDE81040FFF7C7 -:10131000D9BFFFF7F5BF10B50446D0F8883343F4C2 -:101320000043C0F88833E7F7BDF82046BDE8104019 -:10133000FFF7C8BF10B50446E5F712FFD4F88833AD -:101340001A0413D50A4A23F40043C4F88833137AE5 -:101350000D2B05D0112B03D0072B07D11A2100E04C -:10136000517C2046BDE81040E7F782B910BD00BFB0 -:10137000283A002110B50446F8F72FF8D4F888333E -:101380001A040FD523F40043C4F8883394F8943238 -:1013900043B16378032B05D02046BDE810400021FF -:1013A000E7F766B910BD8207034605D410F00100C7 -:1013B00003D103F004007047022070472DE9F04785 -:1013C00011F0010F07468A4616461D469DF82080FB -:1013D00093F800901DD114781AF0020F02D0EFF7A5 -:1013E000A3F98146BB681B060ED504EA090414F074 -:1013F000FF0412D197F85400FFF7AAFE044697F8AD -:101400005500FFF7A5FE8146347085F80090BDE8D1 -:10141000F087EFF789F90446DEE714EA080008BF11 -:101420002046FFF7C0FF04468146EDE71FB590F860 -:101430006213044601F00303032B08D1E5F7A0FE75 -:101440006E21204604B0BDE81040F7F769BB90F864 -:1014500063330DF10E028DF80E3090F864338DF881 -:101460000F30002300930DF10F03FFF7A7FF94F84F -:101470005400FFF76DFE9DF80E10884210D194F8CD -:101480005500FFF765FE9DF80F30834208D12046D6 -:10149000E5F776FE6E212046F7F742FB04B010BD5B -:1014A0002046F7F797FF2046E5F76AFE20469DF8AD -:1014B0000F209DF80E10E7F74DF82046E5F73EFEA9 -:1014C000ECE71FB5044690F8633390F8D9238DF804 -:1014D0000E3090F864338DF80F3090F8D833134005 -:1014E00000930DF10E020DF10F0390F86213FFF758 -:1014F00065FF9DF80E102046F7F76CFF2046E5F7D4 -:101500003FFE20469DF80F209DF80E10E7F739F8B2 -:101510002046E5F713FE04B010BD00003E2970B56B -:10152000044644D005D80C290BD0202954D00025DE -:1015300005E06E2941D070294FF0000543D02846C0 -:1015400070BD644A137A072B2ED00D3BD9B20B29FC -:10155000EDD80B2BEBD801A151F823F09D1502011A -:101560002F1502012F1502012F150201A9150201E5 -:101570002F1502012F1502012F1502012F1502014F -:101580008D1502012F150201DD150201022194F8CB -:1015900076532DB3012D33D00125D0E790F8853354 -:1015A0000F2BC4D10321F2E7137C162BF9E790F837 -:1015B00085330F2BBBD10621E9E790F885330F2B3C -:1015C000B5D10421E3E7D0F88C33B3F5004FB6D1A1 -:1015D0000521C0F88C53DAE70021D8E70121D6E7CE -:1015E0002046FFF7BDFD94F87B33002BD4D00123B8 -:1015F0000F2284F8763384F8852384F87E53CBE772 -:10160000022917D194F88533072B03D010D89A1EDE -:10161000022A0FD80120D4F88C2300FA03F31343D5 -:10162000C4F88C330F2384F8810384F8853301E0F8 -:101630000B2B16D094F885330F2B1CD12046FFF7C7 -:101640008FFD94F87B63002EA6D12046E5F788FD38 -:10165000FF23204684F8766384F88533E5F788FD18 -:101660006DE7D4F88C3343F40063C4F88C330F2354 -:1016700084F88533DEE7022913D0032917D0002927 -:101680008AD12046E6F70EFFD4F8883343F40043AE -:10169000C4F88833D4F88C3343F40043C4F88C3353 -:1016A0004DE701222A212046E5F7A8FC47E7D4F8B8 -:1016B0008C3323F40043C4F88C3394F87B3313B198 -:1016C000002384F87B33034B2046597CE6F7D0FF98 -:1016D00035E700BF283A002190F885330F2B07D15A -:1016E00090F87B03013801288CBF0020012070474F -:1016F0000020704738B505460C460F20042102F043 -:1017000099FD58B101222B88047083701B0A427026 -:10171000C370BDE83840023802F078BD38BD000023 -:1017200070B586B006460D4602F00CF8044608B1C6 -:1017300001241EE042F21F023388934200F2C88067 -:10174000B3F5005F41D840F64942934200F03F8133 -:1017500000F2A58040F60342934200F0298100F296 -:101760009780002B00F0EA8040F60142934200F09F -:10177000F680204606B070BD0520318802F09AFD43 -:1017800005460028D4D042F21F023388934200F26B -:10179000EE81B3F5005F00F2878141F209029342C6 -:1017A00000F2EE81B3F5805F00F2C48140F648425A -:1017B000934200F06D8200F2C98123B140F60142EC -:1017C000934240F0DD812C70DAE1A3F50053013B38 -:1017D0001E2BCED801A252F823F000BF7B190201C4 -:1017E000771A02013119020173170201351902013A -:1017F00073170201731702017317020173170201B5 -:1018000073170201731702017317020173170201A4 -:10181000731702019B1802014119020147190201C5 -:1018200053190201731702017317020173170201A2 -:1018300073170201731702013119020173170201B4 -:10184000731702017317020131190201D91902013C -:10185000011A020189190201A3F58053013B082BEB -:1018600087D801A252F823F0311902018D18020124 -:101870003119020173170201731702017317020174 -:1018800073170201731702017B1A0201412074E7EA -:1018900040F6484293427FF46CAF02206DE741F27C -:1018A000090293423FF665AFB3F5805FD4D840F6A6 -:1018B000634293425AD040F6824293427FF459AF3A -:1018C0006B78287800EB032080B204F01DFD34E033 -:1018D00042F25002934219D842F24A0293427FF6F2 -:1018E00048AFA3F501530B3B052B3FF642AF01A2D6 -:1018F00052F823F0891902017917020197190201A0 -:1019000073170201711A0201711A020142F2740284 -:1019100093423BD042F27B02934200F08D8042F230 -:101920005F0293427FF425AF287806F01BFA04E0AB -:10193000092022E7284604F095FC044601201CE714 -:1019400004F050FDF9E7294611F8010B04F056FDAB -:10195000F3E7294611F8010B04F07AFDEDE728467C -:1019600009F0E3F9BF4BC3E90001E7E7284609F0B6 -:10197000DCF9BC4BC3E90201E0E7284609F0D5F9E0 -:10198000B84BC3E90401D9E70320F6E66978287863 -:1019900004F088FDD1E7EB78A978287801EB0321E2 -:1019A0006B7809B200EB032000B204F0BDFDC4E780 -:1019B00002200CF0D2FC04F03BFB00200021A94BDC -:1019C000C3E90001C3E90201C3E90401B0E62A78D2 -:1019D000A44B83F83220B1E72A7800238DF8062043 -:1019E0004FF0807201250292022201A8ADF8043066 -:1019F0008DF807508DF80C20049306F0CBFD9CE782 -:101A000000232A78ADF804308DF806206A78ADF806 -:101A10000A308DF80720AA7801258DF808200222C7 -:101A200004937F238DF809508DF80C2001A88DF8C0 -:101A3000143006F09FFC80E72B78A9798DF80630EA -:101A40006B788DF80C108DF80730AB7829448DF841 -:101A50000830EB78ADF804008DF809302B798DF85B -:101A60000A306B798DF80B30EB1D0493CB79DDE7F1 -:101A70000120044681E604207FE607207DE6A3F5E9 -:101A800001530B3B052B7BD801A252F823F000BF7A -:101A9000551C02016D1C0201C7170201811B0201C6 -:101AA000C7170201C7170201A3F50053013B1E2B04 -:101AB00066D801A252F823F0C71702012B1C0201BD -:101AC000411C0201811B0201C7170201811B020197 -:101AD000811B0201811B0201811B0201811B02018A -:101AE000811B0201811B0201811B0201811B02017A -:101AF000B11B0201C7170201C7170201C717020174 -:101B0000811B0201811B0201811B0201811B020159 -:101B1000811B0201A51B0201811B0201811B020125 -:101B2000811B02014B1C0201C7170201C7170201EA -:101B30009D1C0201A3F58053013B082B20D8DFE850 -:101B400003F03C57681F1F1F1F1F6F0040F68242A3 -:101B500093423FF438AE07D840F6494293423FF4EF -:101B600032AE40F663422BE640F6844228E642F26B -:101B70005002934208D842F24A0293423FF67FAFA6 -:101B8000681F02F043FBD3E542F27B0293423FF42D -:101B90001AAEF5D842F25F0293423FF414AE42F21D -:101BA00074020DE6082100F8014B0BF0A5F9E7E7F8 -:101BB000047004F015FC6870E2E701AA0DF1010160 -:101BC0000DF1020004F0BCFB2C709DF801206A703E -:101BD000BDF804309DF804101B0AA970EB702A713F -:101BE000BDF80220E9716A71120AAA712B72C7E767 -:101BF000412200210FF0F1FB2A461B4B02F8014B5A -:101C000003F1400153F8040B8B4242F8040BF9D165 -:101C1000B6E70022602300F8014B09F08AF8AFE72D -:101C200000F8014B04F016FBAAE706F053F806464D -:101C300006F056F86E70360A2C70AE70E8709FE7AA -:101C400000F8014B04F092FB9AE700F8014B04F016 -:101C500085FB95E72946681C01F8024B04F060FCFF -:101C60008EE700BF404C00218D4D002101A90DF1F0 -:101C7000020004F057FC2C70BDF802306B709DF927 -:101C80000330AB70BDF90430EB701B122B7177E79A -:101C90000A4B047093F83230437071E7002301A8B7 -:101CA000CDE9013306F00EFD2870BDF806306B70EB -:101CB000BDF806301B0AAB7062E700BF404C002144 -:101CC00073B505460C4601F037FF08B1012008E066 -:101CD00042F20B032E889E4205D042F20C039E4234 -:101CE00028D002B070BD2378A2788DF804306378D4 -:101CF000684603EB0223ADF800302279E37803EB6A -:101D00000223ADF8023063798DF80530A3798DF8A0 -:101D1000063004F04DFC29880446012002F0CAFA7E -:101D20000028D3D02B880538B34208BF447102F095 -:101D30006DFACBE76178207804F08CFCC6E70000F0 -:101D40002DE9F04186B006460D4601F030FF04460D -:101D500020B10124204606B0BDE8F0813388A3F508 -:101D60000153013B092BF5D801A252F823F000BF23 -:101D7000991D0201311E0201551D02014F1E020173 -:101D8000B51E0201BB1E0201CB1E0201E51E0201AF -:101D9000FF1E0201051F0201002428786978AA7835 -:101DA000EB1C4FF0060E25468DF800008DF8011053 -:101DB0008DF8022042FA05F7FF0718D506AF0EFB93 -:101DC000047793F800C093F8028007F810CC93F8DA -:101DD00001C001340CEB082C27F814CC93F80480D4 -:101DE00093F803C005330CEB082C27F812CC01350F -:101DF000082D01D0032CDDD101AB04F057FC0446C3 -:101E00000120318802F056FA05460028A1D042F29E -:101E100049023388934277D842F24402934205D86C -:101E200003F55F43BF339BB2012B71D82C706FE079 -:101E30006A792B79E97803EB0223AA78287802EBF8 -:101E400001229BB2697892B204F0AAFC81E76A7819 -:101E5000A97A8DF80120AA782B788DF80220EA1C47 -:101E600001926A7A980702EB0122ADF80820297BDB -:101E7000EA7A8DF8003002EB0122ADF80A206A7B85 -:101E80008DF80C2004D52A4A92F8512091060DD5E0 -:101E90005A0703D5274B5B6ADB0609D5684604F071 -:101EA000CBFC01463046FFF725FC52E73E21F9E71F -:101EB0001121F7E704F02AFDA1E76B78287800EB01 -:101EC000032080B204F03EFD99E72B4613F8012B66 -:101ED00068460193EB798DF800208DF8083004F006 -:101EE0007BFD8CE72B4613F8012B68460193EB79B9 -:101EF0008DF800208DF8083004F0A4FD7FE704F091 -:101F0000CBFD7CE702207CE742F24A02934203D0F9 -:101F1000681F02F07BF91CE7002368468DF800304B -:101F200004F0D0FD28709DF800306B70F0E700BF22 -:101F3000644D00216850002173B50A4642F22E011B -:101F4000038806468B420ED842F226018B420ED9F8 -:101F5000A3F50053273B072B09D8DFE803F00B2834 -:101F60002E440808313542F24E018B4234D0002015 -:101F700002B070BD114602F1170311F8010B0732D0 -:101F800006F096FF04460120318802F093F90546D9 -:101F900000283CD042F22A023388934239D025D817 -:101FA000A3F50053273B022B2ED82C702CE01146B2 -:101FB00011F8010B06F0B2FFE4E706F0D9FFE1E704 -:101FC000107807F03DF8DDE75378107800EB032038 -:101FD00080B207F055F8D5E71146D27911F8010B18 -:101FE00007F05CF8CEE702200024CDE742F24E0273 -:101FF0009342DAD004D8A3F500532D3B012BD3E74D -:1020000042F27C029342D0D0681F02F0FFF8012018 -:10201000AEE700240DF107008DF8074006F0C6FF7B -:102020009DF80730AC7028706B70EDE7F0B589B0A3 -:1020300006460C4601F013FE054618B10125284658 -:1020400009B0F0BD3388A3F50053063B042BF6D846 -:10205000DFE803F02456031E5200214611F8010B5D -:1020600004F0B6FD05460120318802F023F904464C -:102070000028E3D042F207023388934249D041D886 -:1020800042F20602934242D0601F02F0BFF8D5E749 -:10209000214611F8010B04F0BFFDE3E76378D4F8A3 -:1020A00007702078A17800EB0320CDF81770E37853 -:1020B000B4F80B702279A57901EB0321ADF81B7000 -:1020C0006379677BA47B89B2CDE902748DF81E40E9 -:1020D0000DF11704CDE9005480B2ADF81000ADF851 -:1020E00012108DF814208DF815308DF816508DF8DB -:1020F0001D7004F00BFDB5E7207804F0B1FD9DE7FD -:102100000220B1E7A3F50053083B012BBCD8257092 -:10211000BAE7002304A88DF8103004F0E5FC207025 -:102120009DF810306370AFE7F0B58DB007460C46F0 -:1021300001F0CBFD054608B101253DE03B88B3F534 -:10214000015F35D842F23402934235D9A3F50053EA -:10215000363B0A2B33D8DFE813F03B00BF00CB003F -:10216000D50026010B00FB00FF0002011A0121012E -:10217000FF260220398802F09DF804460028DBD0B3 -:102180003B88B3F5015F00F2118142F234029342C1 -:1021900040F21081A3F50053363B052B00F22E814F -:1021A000DFE813F00C012C012C012C011501240196 -:1021B00042F27F0293424AD028460DB0F0BD21463C -:1021C00011F8016B304604F09FFD05460120D1E770 -:1021D000A2786378267803EB0223ADF80C302279DD -:1021E000E378304603EB0223627903A903EB024351 -:1021F0000493E279A37903EB0223227A03EB0243EF -:102200000593637A8DF81830A37A8DF81930E37A44 -:102210008DF81A3004F10C030793A37C8DF820305D -:10222000E37C8DF82130237D8DF82230637D8DF89D -:102230002330A37D8DF82430E37D8DF82530237E77 -:102240008DF8263004F068FD0546607691E7A278A7 -:102250006378267803EB0223ADF80C302279E3781B -:10226000304603EB0223627903A903EB0243049394 -:10227000E279A37903EB0223227A03EB024305936D -:10228000637A8DF81830A37A8DF81930E37A8DF8D7 -:102290001A3004F10C030793A37C8DF82030E37C03 -:1022A0008DF82130237D8DF82230637D8DF8233029 -:1022B000A37D8DF82430E37D8DF82530237E8DF8C5 -:1022C0002630637E8DF82730A37E8DF8283004F009 -:1022D0007DFD0546E0764CE7234613F8040B00939A -:1022E000E378A278617804F0D5FD0546FF266DE716 -:1022F000234613F8040B0093E378A278617804F086 -:10230000E1FDF2E7617803AB06290F464FF00005C7 -:102310001A4628BF062720780234AF4204F104048D -:1023200003F1060302D804F0E5FD05E714F8046C98 -:1023300014F802CC03F8066C14F8036C013506EBB4 -:102340000C2623F8046C14F8016C03F8026CE4E723 -:10235000207804F085FEC8E704F08EFEC5E7A27879 -:102360006378267803EB0223ADF80C302279E3780A -:10237000304603EB0223ADF80E30A279637903A94E -:1023800003EB0223ADF8103004F080FE1DE7A278C5 -:1023900061782078E31C04F093FEA6E7617820784A -:1023A00004F0AAFEC8E6FF260320E3E642F27F021D -:1023B000934203D0601F01F029FFBDE6304603A918 -:1023C00004F064FD25709DF80C306370F2E71F2364 -:1023D00003A8ADF80C3004F01FFE2070BDF80C30DF -:1023E0006370BDF80C301B0AA370E3E7012303A858 -:1023F0008DF80C3004F024FE2070E4E70570D9E776 -:1024000042F26B0230B503880446934289B006D08D -:1024100042F26C02934236D0002009B030BD0B78F6 -:102420008A788DF800304B7801F1140003EB022319 -:10243000ADF80230CB780DF105028DF804300B1D9C -:1024400053F8045B834242F8045BF9D10B7D8A7D2B -:102450008DF815304B7D0DF1190003EB0223CA7D79 -:102460001831062A8DF8182028BF0622ADF816303C -:102470000EF08CFF684604F066FE01462046FFF72A -:1024800039F90120C9E7087804F079FEF9E70B462D -:1024900042F2690170B5028804468A428AB04AD085 -:1024A00042F26A018A4200F0918042F268018A4257 -:1024B00040F091801A7819798DF800205A780DF142 -:1024C00011008DF801209A788DF80220DA7802EB5D -:1024D0000122597902EB01420192D9799A7902EBF2 -:1024E0000122ADF80820597A1A7A02EB0122ADF8E0 -:1024F0000A209A7A8DF80C20DA7A8DF80D201A7B52 -:102500008DF80E205A7B8DF80F209A7B8DF81020C5 -:1025100003F10F021F3352F8041B9A4240F8041BC8 -:10252000F9D1684604F02EFE01462046FFF7E2F896 -:1025300001200AB070BD1A7819798DF800205A78F8 -:1025400002AE8DF801209A788DF80220DA7802EB3D -:102550000122597902EB01420192D9799A7902EB71 -:102560000122ADF818201A7A997A8DF81A205A7A31 -:1025700002EB0122ADF81C20197BDA7A02EB012272 -:10258000ADF81E205A7B8DF820209A7B8DF82120F3 -:10259000DA7B8DF822201A7C8DF823205A7C8DF866 -:1025A00024209A7C8DF82520DA7C8DF8262003F1F2 -:1025B00014022433354610685168083203C59A4224 -:1025C0002E46F7D1684604F02DFEADE7597818780D -:1025D00004F0BCFEA8E70020ABE700002DE9F04FB7 -:1025E00003888046A3F50153223BA3B0032B00F2DE -:1025F0007D81DFE813F00400860012013E0191F8AE -:1026000000C0BC4B4C7883F800C08B78087904EB91 -:102610000324CB788A7A04EB03444B794D7B00EB9F -:1026200003208B79002600EB03400B7A91F807908A -:102630000193CB7A91F809E002EB03220B7B92B273 -:1026400003EB05238D7B9BB2062DAA4628BF4FF0D6 -:10265000060A0293A84B0F311D700DABB24501F174 -:10266000090103F10A0326D8019BCDE907408DF843 -:102670002530029BA149ADF82A3006A80DAB8DF894 -:1026800018C08DF824908DF826E0ADF828208DF83C -:102690002C500C9304F05CFE974B04461B785B00B7 -:1026A0000333D8B2FF2840F0EB8021464046FFF7C5 -:1026B00021F801201BE111F8097C11F807BC03F88F -:1026C0000A7C11F8087C013607EB0B2723F8087CFD -:1026D00011F805BC11F8067C07EB0B2723F8067CE4 -:1026E00011F8047C03F8047C11F8037C03F8037CE4 -:1026F00011F8027C03F8027C11F8017C03F8017CDC -:10270000ACE78D7B0026062DA94628BF4FF00609B1 -:1027100091F800C0774B4C7883F800C08B7808792B -:1027200004EB0324CB784A7A04EB03444B7991F809 -:1027300008E000EB03208B7991F80BB000EB03402D -:10274000CB790F31019311F8053C02EB032211F80C -:10275000033C92B2029311F8023C0393664B1D7046 -:102760000DABB14501F10E0103F10E031BD8019B26 -:10277000CDE907408DF82430029B60498DF829305F -:10278000039B06A88DF82A300DAB8DF818C08DF884 -:1027900025E0ADF826208DF828B08DF82B500B934E -:1027A00004F0AEFE78E711F80E7C11F80BAC03F8DC -:1027B0000E7C11F80D7C013603F80D7C11F80C7CB1 -:1027C00007EB0A2723F80C7C11F809AC11F80A7CF6 -:1027D00007EB0A2723F80A7C11F807AC11F8087CEC -:1027E00007EB0A2723F8087C11F805AC11F8067CE2 -:1027F00007EB0A2723F8067C11F8047C03F8047C15 -:1028000011F8037C03F8037C11F8027C03F8027CC6 -:1028100011F8017C03F8017CA3E711F8010B364B9A -:102820000DAA06AC06288446187017464FF0000320 -:10283000264628BF4FF0060C9C4501F1040106D83E -:1028400004A9CDE9047604F0FBFE04462DE711F857 -:1028500003EC11F8045C013305EB0E2522F8025B52 -:1028600011F801EC11F8025C05EB0E2524F8025B6F -:10287000E2E708781F4B187004F020FF044602209E -:10288000B8F8001001F016FD00283FF412AF42F234 -:102890006302B8F8003093421BD842F261029342BF -:1028A0001BD9154B134A1B7804701278002C18BFE3 -:1028B0000023427002461149837000EB43039342A8 -:1028C0000BD00C880232547031F8024B240A9470F9 -:1028D000F5E742F26502934203D0053801F096FC19 -:1028E000E7E6044B04701B784370F6E7002023B042 -:1028F000BDE8F08F104C00211E4C0021124C00212D -:10290000F8B542F26603078805469F4205D042F2B9 -:1029100067039F420ED00020F8BD4B78087800EB8B -:10292000032080B204F0CCFE01462846FEF7E2FE0A -:102930000120F1E74B780C78897804EB0324A4B2EA -:10294000204604F0BFFE29880646032001F0B2FCB1 -:102950000028EDD02B880538BB4201BF002346710B -:102960008471C37101F052FCE2E74A780B7803EB03 -:1029700002230380CA788B7803EB022343804A79D1 -:102980000B7903EB02238380CA798B7903EB022353 -:10299000C3804A7A0B7A03EB02230381CA7A8B7ACB -:1029A00003EB022343810C2070472DE9F3410746D6 -:1029B0000E46018810469846BDF8205001F07AFC7A -:1029C0000446002800F08C8042F222033A889A42A2 -:1029D00015D842F21F039A422CD841F205439A427D -:1029E00072D042F215039A4274D040F62D439A42B7 -:1029F00058D0601F02B0BDE8F04101F007BC42F2C0 -:102A00002F039A422ED007D842F223039A4216D0BF -:102A100042F224039A4207E042F25C039A4206D84B -:102A200042F259039A4205D8E3D12670E1E742F217 -:102A30005D03EFE7267065702D0AA570D9E70DF1EB -:102A4000060101A805F082F82670BDF80430637015 -:102A5000BDF804301B0AA370BDF80630E3701B0AF2 -:102A60002371C6E70DF10603684601AA0DF10201C4 -:102A700005F09AF82670BDF800306370BDF800309C -:102A80001B0AA370BDF80230E3701B0A2371BDF866 -:102A9000043063711B0AA371BDF80630E3711B0A91 -:102AA0002372A6E70023284698F800100DF10602CD -:102AB0008DF8063004F028FE9DF9063065702D0A69 -:102AC0002070A570E37094E728460DF1060104F02C -:102AD000FBFDF1E7C11C284604F082FE2070AAE746 -:102AE00002B0BDE8F081000070B586B006460C4625 -:102AF00001F064F9002840F0948042F22402338807 -:102B000093424CD842F21202934210D840F62D4222 -:102B1000934200F0A58037D840F2064293424FD04E -:102B200040F21D42934200F0C48006B070BDA3F590 -:102B30000053133B112BF8D801A252F823F000BF29 -:102B4000DB2B02012B2B0201A32C0201932C02018F -:102B50002B2B02012B2B02012B2B02012B2B020111 -:102B60002B2B02012B2B02012B2B02012B2B020101 -:102B70002B2B0201F92B0201272C02013B2C020115 -:102B8000C32C0201732C020141F205429342CCD1C5 -:102B90006378257805EB0325ADB2034667E042F282 -:102BA0002F02934200F0918042F26D029342BCD119 -:102BB0006378207800EB032080B205F0A7F807E0E7 -:102BC00063782078A17800EB032080B204F054FEF3 -:102BD00001463046FEF78EFD23E02146637811F86A -:102BE000025B03A805EB0325ADB2FFF7BEFE284646 -:102BF00003A904F09BFEEBE72146637811F8025B22 -:102C000003A805EB0325ADB2FFF7AFFE284603A9E5 -:102C100004F0CEFE00230322014600953046FFF764 -:102C2000C4FE012081E763782578A17805EB0325B0 -:102C3000ADB2284604F0F2FEECE7637825782279FD -:102C400005EB03256379A17802EB0322E378ADB2AB -:102C500001EB0321284692B289B204F035FFD9E78F -:102C60002346627813F8025B05EB0225ADB204221D -:102C7000D2E70025E378A178207801EB032163787F -:102C800089B200EB032080B204F068FF2B460122DA -:102C9000C2E76378207800EB032080B205F05AFA8F -:102CA00096E763782578082205EB0325ADB200236B -:102CB000B2E76378207800EB032080B204F0DAFEFC -:102CC00086E7002505222B46A6E70546034609228E -:102CD000A2E700BF2DE9F047174E804696F8243052 -:102CE0000F46154693B90123C0F3032986F8243013 -:102CF0004FEA112A3DB140F2031008F08BF9013D73 -:102D00000446EDB220B9002386F82430BDE8F087F0 -:102D100080F8008080F80190877080F803A096F812 -:102D200025103A464B1C043086F825300EF055FB32 -:102D3000204604F0DDFFDDE7404C002170B586B091 -:102D400005460C4601F022F980BB42F20E032E88A4 -:102D50009E422ED042F214039E422DD042F20D0329 -:102D60009E423BD16278237804F10D0103EB0223EC -:102D7000ADF80030E278A37803A803EB0223ADF8A6 -:102D8000023023798DF8043063798DF80630A31D65 -:102D90000293237B8DF80530FFF7E7FD03A9684612 -:102DA00005F06AF801462846FEF7A4FC012006B0AB -:102DB00070BD05F0C9F8F9E7204603F0BDFB29888E -:102DC0000446012001F076FA0028EFD02B88053860 -:102DD000B34208BF447101F019FAE7E721462846DB -:102DE00006B0BDE87040FFF77FBE2DE9F0438DB01F -:102DF00006460D4601F0CAF8044600284ED142F2BC -:102E0000430332889A424DD11822FF2301460DEB2D -:102E100002008DF815308DF816300EF0DEFA2B78A2 -:102E20006A7A8DF80C306B784FF00C088DF80D3005 -:102E3000AB788DF814208DF80E30EB1C049305F15F -:102E40000A03254601AF9DF814202A41D20717D561 -:102E500058781A7807EB840102EB002227F8242027 -:102E6000D8789A7803F1040902EB002206AB08FB3C -:102E700004304A804946FFF778FD013409EB00032E -:102E80000135082D01D0022CDDD101A906AA03A825 -:102E900005F09EF801463046FEF72CFC01200DB0EF -:102EA000BDE8F083294630460DB0BDE8F043FFF79A -:102EB00045BF002273B542F22B040092ADF8042006 -:102EC00002880546A24207D042F22C04A2421FD03B -:102ED000FFF732F802B070BD6A4611F8010B06F038 -:102EE0006CF804462988072001F0E4F9064668B129 -:102EF0002B88A3F500532B3B012B04D8694600F81F -:102F0000014B07F00DFF701F01F080F90120E1E790 -:102F10006A4611F8010B06F071F8E2E738B542F2A3 -:102F20001903028805469A4203D0BDE8384000F0F4 -:102F300015B8CB7A8A7A087802EB03224B7892B2E2 -:102F400000EB032080B201F10C03023105F0E0FC3C -:102F500001462846FEF7CEFB012038BD2DE9F3419E -:102F600007460E4601F02FF8054608B101250DE091 -:102F700042F217023B8893421DD00BD840F67B42A9 -:102F8000934247D040F67C4293424BD0284602B051 -:102F9000BDE8F08142F21A0293422CD042F21B02A9 -:102FA0009342F3D17378347804EB0324A4B220461F -:102FB00005F03AFD29E006F110084146304605F0DB -:102FC000F3FC2C461120398801F074F906460028DC -:102FD000CCD042F217023B8893423BD030D840F627 -:102FE0007B42934243D040F67C4293422DD0701FE7 -:102FF00001F00CF9BAE73146737811F8024B04EB93 -:103000000324A4B2204605F0D5FC05464FF0000885 -:103010000320D8E773783478804604EB0324052036 -:10302000A4B2D0E773783478B17804EB0324F37852 -:10303000A4B201EB0321204689B205F045FDE4E787 -:10304000A3F500531A3B012BD1D87470240A3570B4 -:10305000B470CCE70346414603F8015B08F1100267 -:1030600051F8040B914243F8040BF9D1BFE7002358 -:1030700020460DF10601ADF8063005F005FDBDF85E -:1030800006307470F370240A1B0A3070B470337108 -:10309000ADE700002DE9F0418AB007460C4600F08C -:1030A000EDFF064608B1012618E042F275023B88A2 -:1030B000934213D842F25F02934213D840F6834200 -:1030C000934200F0E68041D840F61542934200F06A -:1030D000FA8040F61642934200F0ED8030460AB086 -:1030E000BDE8F081A3F50153203B152BF6D801A2D2 -:1030F00052F823F0CB32020163310201DD300201CC -:10310000DD300201DD300201DD300201DD3002017F -:10311000DD300201DD300201DD300201DD3002016F -:10312000DD300201DD300201DD3002010D3202012D -:103130007D320201B9310201D1310201F1310201C6 -:10314000F1310201DD300201FF31020141F205429D -:103150009342C3D163782578042005EB0325ADB2F3 -:1031600005E00C206378257805EB0325ADB239889E -:1031700001F0A0F80446002895D042F275023B8881 -:10318000934215D842F25F02934200F2A18040F6CA -:103190008342934200F09B8100F2D08040F61542BA -:1031A000934200F08E8140F61642934200F08F81E8 -:1031B000601F01F02BF876E763782578A17805EB9E -:1031C0000325ADB2284605F0EBFC06460120CEE70C -:1031D00063782578A17805EB0325ADB2284605F084 -:1031E000E1FC06460120002EC1D1BB4B1876BEE79C -:1031F000637825780F2005EB0325ADB2B7E7637838 -:1032000025781F2005EB0325ADB2B0E7627823785F -:1032100003A803EB0223ADF80C30A378A2798DF854 -:103220000E30E3780D348DF80F3014F8093C8DF82A -:10323000103014F8083C03EB0223ADF8123014F8F8 -:10324000052C14F8063C03EB0223ADF8143014F8F7 -:10325000032C14F8043C03EB022314F8022C03EBB8 -:103260000243069314F8013C08948DF81C3005F0D5 -:1032700093FC0646BDF80C50032078E76378257868 -:10328000A17805EB0325ADB2284605F087FC06467C -:10329000F2E7237803A88DF80C30637803348DF8B7 -:1032A0000D3014F8013C04948DF80E3005F072FCDA -:1032B000064600258AE76378207800EB032080B279 -:1032C00005F07BFCF4E70546D6E7002507204EE72E -:1032D000A3F50153203B152B3FF66AAF01A252F82C -:1032E00023F000BF5F3302018B330201B1310201D1 -:1032F000B1310201B1310201B1310201B13102013A -:10330000B1310201B1310201B1310201B131020129 -:10331000B1310201B1310201B1310201C9330201FF -:10332000C9330201CF340201CF340201D333020189 -:103330001B340201B13102012D34020141F2054278 -:1033400093427FF435AF284603A905F005FC9DF9AB -:103350000C3065702D0A2070A570E37028E704F02A -:10336000B9FC074604F0BCFC804605F0E5FB0546C9 -:1033700005F0E8FB677025713F0A2D0A2670A770DB -:1033800084F803806571A07112E7284603AB02AA96 -:103390000DF1060105F0FCFBDDE90232BDF8061077 -:1033A0006371E170090A2171190AA171190C1B0ED0 -:1033B000657023722D0A130A6272120C2070A570B8 -:1033C000E171A372E272F3E645702D0A0670857012 -:1033D000EEE6284603A905F0E7FB65702D0A20708C -:1033E000A570039BE370039B1A0A22711A0C1B0E33 -:1033F0006271A371049BE371049B1A0A22721A0C76 -:103400001B0E6272A372059BE372059B1A0A22735C -:103410001A0C1B0E6273A373CAE6284603A905F0B3 -:10342000C8FB0028D9D12C4B1876D6E7284603A92B -:1034300005F090FBDDE903ECDDE90576DDE9071237 -:10344000099B20704FEA1E2020714FEA1E406071D8 -:103450004FEA1C2020724FEA1C406072380A207329 -:10346000380C6073300A2074300C6074080AE17400 -:103470002075080C090EA175110A657084F803E027 -:1034800084F807C0E772E673E27521762D0A110C05 -:103490004FEA1E6E120E4FEA1C6C3F0E360EA570E0 -:1034A00084F806E084F80AC0A773A6746075617694 -:1034B000A2761A0AE37622771A0C1B0E6277A3779C -:1034C00076E6002300F8013B05F075FB70E6314617 -:1034D000204600F098FE6BE6244C0021038873B56B -:1034E000A3F50153193B06460C46042B5FD8DFE8D1 -:1034F00003F0030E2A394F004B780878897800EBE7 -:10350000032080B205F064FB0122002512E04B7815 -:103510000D780A7905EB03254B79ADB202EB032256 -:10352000CB788978284601EB032192B289B205F065 -:1035300075FB03220146002330460095FFF735FA5C -:10354000012002B070BD4B780D78227905EB032580 -:10355000CB788978ADB201EB0321284689B205F01A -:103560006DFBE6E74B780D788A7905EB03254B79FF -:10357000097903EB0223E278ADB202EB0122E17993 -:10358000284600919BB2A17892B205F067FBD0E784 -:103590000B79CA78207802EB03228B78497892B2B3 -:1035A00001EB032189B2637905F088FBACE70020C9 -:1035B000C7E7F0B503880746A3F50053303B0D4637 -:1035C00089B0042B00F29280DFE803F0031D263C53 -:1035D0005700052000264B780C7804EB0324A4B296 -:1035E000398800F067FE054650B342F231023B884D -:1035F000934263D05DD842F23002934260D0681F9C -:1036000000F004FE1CE08A782878497805F0DEFB9B -:10361000002406460120E3E74B7808788A7900EB1E -:1036200003204B7980B203EB02239BB200930B790A -:10363000CA78897805F0ECFB01463846FEF75AF85F -:10364000012054E00B7800248DF80E304B7803A84D -:103650008DF80F308B78ADF80C408DF810304FF4AA -:103660008073ADF8123002238DF811408DF81430BC -:10367000069404F08FFF0646CCE70B7800248DF803 -:103680000E304B7803A88DF80F308B78ADF80C40D6 -:103690008DF81030CB78ADF812408DF81130022340 -:1036A0008DF814307F2306948DF81C3004F062FEF0 -:1036B000E1E7A3F50053333B012BA0D82E709EE722 -:1036C0000023204603AA0DF10B018DF80B308DF875 -:1036D0000C3005F045FB9DF80C309DF80B206C700C -:1036E000240A2870AC70EA702B7188E7002009B0BA -:1036F000F0BD38B505460C4600F05EFD90B942F2CB -:1037000026022B8893420FD042F25E02934211D0E0 -:1037100042F22502934206D105F0F2FC014628460A -:10372000FDF7E8FF012038BD204604F1200105F037 -:10373000E9FCF3E7204694F8402004F1200105F06D -:1037400011FDEBE74FF6E072F0B5038806469342B1 -:103750000C4693B00AD84FF6A372934277D84FF62F -:103760009F72934269D8002013B0F0BDA3F57F4348 -:10377000E13B1E2BF7D801A252F823F09938020141 -:1037800067370201673702016737020167370201B5 -:10379000BD3802016737020167370201673702014E -:1037A0006737020167370201673702016737020195 -:1037B0006737020167370201D7380201DF3802019B -:1037C000EB38020165380201013902016737020155 -:1037D000673702016737020167370201F3380201D8 -:1037E000F9370201673702016737020167370201C3 -:1037F0003D390201FB38020123200025318800F009 -:1038000059FD0446B8B107464FF6FA7207F8015B56 -:103810003388934200F0AD8000F294804FF6C0727E -:10382000934200F0E9804FF6F472934200F06A810F -:10383000601F00F0EBFC012096E7A3F57F43A13B5E -:103840000122022B75D8DFE803F0775D6B004FF69D -:10385000C072934274D04FF6CD72934283D101204F -:103860000546CBE78378052B11D188784B78000487 -:1038700000EB03200B7804341844CB78002100EBD4 -:103880000360227802F08CFD05460120B6E7084669 -:1038900007F04BFA0834F4E7084607F046FAC20787 -:1038A0000546247A02D5204603F028FA6B0701D496 -:1038B0000120A2E72046F7F78BFEF9E78B784878DE -:1038C0001B0403EB002308780344C87803EB006073 -:1038D00005F000F8D8E7084602F0B2FCE8E7084631 -:1038E00002F020FD0546072088E7084602F046FD65 -:1038F000CAE708780AF008FDDAE701200C257DE721 -:1039000027207AE7E378A278617802EB0322207817 -:1039100092B209F06FFC0028CAD1012012256DE790 -:10392000207809F051FD0028F7D0607809F068FD93 -:10393000F1E77E4B1A70BBE77D4BFBE71D205CE790 -:1039400039205AE74FF6FE7293427FF471AF08A810 -:10395000E0F708FA3B4608AA0EAE154603CDB5427D -:10396000186059602A4603F10803F6D128681860E8 -:103970005EE70AF0D5FC6070C0F30720A0700AF083 -:10398000C9FCE0700AF0C6FC000A207107F028FBB1 -:10399000030A6071A371030C000EE371207207F03B -:1039A00025FB0025030A6072A372030C000EE3726C -:1039B000207308A90DF11E00ADF81E5002F05EFB49 -:1039C000BDF81E3063731B0AA373BDF82030657405 -:1039D000E3731B0A2374A57402F0A6FBE074000ACB -:1039E000207507F097F9534B60751B88000AE37543 -:1039F0001B0AA07523761BE7002503A90DF10A0019 -:103A0000ADF80A5002F02CFBBDF80A3004A963702F -:103A1000BDF80A300DF10E001B0AA370BDF80C3082 -:103A2000ADF80E50E3701B0A237102F035FBBDF8B0 -:103A30000E3005A963711B0AA371BDF810300DF19A -:103A40001200E3711B0A2372ADF8125002F02CFB36 -:103A5000BDF8123006A963721B0AA372BDF81430B8 -:103A60000DF11600E3721B0A2373ADF8165002F035 -:103A700023FBBDF816300DF1070263731B0AA37315 -:103A8000BDF818300DF11A01E3731B0A23740DF110 -:103A9000060007AB8DF806508DF8075002F014FBB6 -:103AA0009DF80630A5746374BDF81A30A575E374EB -:103AB0001B0A23759DF807300DF109026375BDF8E7 -:103AC0001C300DF11E01E3751B0A237602A808AB1A -:103AD0008DF808508DF8095002F00EFB9DF8083063 -:103AE000A5766376BDF81E30A577E3761B0A2377AB -:103AF0009DF809306377BDF82030E3771B0A84F81E -:103B0000203095E608A8DFF73FFC3B4608AA10AE38 -:103B1000154603CDB542186059602A4603F10803E3 -:103B2000F6D128681860AA889A8081E6204C002186 -:103B30001F4C0021604D00214FF6E07270B50388E4 -:103B4000054693428AB006D04FF6FC7293422BD0C2 -:103B500000200AB070BD087802F014FD064601206E -:103B6000298800F0A7FB0446E0B14FF6FC7306700D -:103B70002A889A4213D12822002168460DF02DFC94 -:103B80006846DDF72BF86B46651C0AAE1A4603CA79 -:103B9000B24228606960134605F10805F6D1601F3E -:103BA00000F034FB0120D4E729200026D8E74FF6A7 -:103BB000B372F0B50388064693428FB006D04FF635 -:103BC000DB72934226D000200FB0F0BDCA788B780C -:103BD000087803EB02234A7899B200EB022080B206 -:103BE00002F0DAFE07460120318800F063FB05464B -:103BF00070B104464FF6DB7204F8017B33889342C0 -:103C00000BD04FF6DC72934219D0681F00F0FEFA19 -:103C10000120D9E735200027E6E701A8DDF74CFCB5 -:103C2000234601AA0DAE144603CCB4421860596075 -:103C3000224603F10803F6D110681860E5E701A8F1 -:103C4000DDF760FC234601AA09AE144603CCB4425A -:103C500018605960224603F10803F6D1ECE74FF6ED -:103C6000F57270B503880546934288B006D04FF6CA -:103C7000FB72934227D0002008B070BD91F900007C -:103C800002F02CFF0120298800F014FB0446C0B18B -:103C9000002303704FF6FB732A889A420ED16846C0 -:103CA000DDF746FE6B46651C08AE1A4603CAB242F3 -:103CB00028606960134605F10805F6D1601F00F021 -:103CC000A5FA0120D8E72120DDE72DE9F04102889F -:103CD0000746A2F57F42D03A0B468AB00E2A68D832 -:103CE000DFE802F0082D3267676767676767436739 -:103CF00067673800DA789978120402EB0122597864 -:103D000018780A44197902EB016103F00BFA0026D6 -:103D10000546B0460120398800F0CCFA044660B16F -:103D20004FF6DA7205703B88934223D04FF6DE726D -:103D3000934231D0601F00F069FA01203AE05978CF -:103D4000187803F0F1F9E2E79A785978187803F0D7 -:103D5000EDF9DCE75A7893F80080062008EB02289A -:103D600000259E781FFA88F8D5E700262520B04662 -:103D70003546D0E701A8DEF737F809AE01AB621C83 -:103D80001D4603CDB542106051602B4602F108027A -:103D9000F6D128681060CDE73146404602F0B6FF04 -:103DA000030A6070A370030C000EE3702071617150 -:103DB000C0E700200AB0BDE8F081000070B50646FB -:103DC0004FF6DD7200206F4B8AB01B880C46ADF8B1 -:103DD000083033888DF80A00934200F0968003F192 -:103DE0001D0292B21A2A00F2CA80A3F57F43E33B78 -:103DF0001A2B00F2C380DFE803F0111624C12BC197 -:103E0000A5939AC1C1C1C1C1C1C1C1C1C17EC1C156 -:103E1000C1C1C1C10E001D2000252BE00A785A4BFC -:103E20009A760120F8E7CB788978207801EB032196 -:103E30006378227900EB032089B280B2FEF74AFF53 -:103E4000EFE74A780B7803EB02234F4AD384E8E785 -:103E500008464B7810F8025B05EB032506F065FF7A -:103E60000B46A17AADB202460091284603F0DCFC75 -:103E700005460120318800F01DFA0446002838D09C -:103E80004FF6EB720570338893426FD04FF6FD7298 -:103E9000934259D04FF6E972934227D13A4BDA69EF -:103EA0004270DA69120A8270DA8BC270DA7F0271AC -:103EB0001A6A42711A6A120A82715A8CC27193F894 -:103EC000232002729A6A42729A6A120A82725A8D88 -:103ED000C27293F82B200273DA6A4273DA6A120A0A -:103EE0008273DA8DC27393F82F300374601F00F071 -:103EF0008DF9012043E04B78087891F9021000EB2E -:103F0000032080B203F02AFCB2E74B780878CA7825 -:103F100000EB032091F9021080B203F03DFCA7E70B -:103F20008A78207891F9011003F050FEA0E74B78D1 -:103F3000087802A900EB032080B203F0A1FE054639 -:103F4000042097E7112067E703A8DEF7B9FC09AE64 -:103F500003AB621C1D4603CDB542106051602B4679 -:103F600002F10802F6D128681060BFE79DF80A3018 -:103F7000BDF80820C370A0F80120B7E700200AB000 -:103F800070BD00BF56320301404C002138B54FF6DA -:103F9000F873028804469A4213D14B7808780231AC -:103FA00000EB032080B203F021FF218805460120A9 -:103FB00000F080F918B100F8055900F027F9012048 -:103FC00000E0002038BD4FF6F77337B5028804468D -:103FD0009A421FD14B78087800EB03208B7880B28F -:103FE000003B18BF01238DF80430CB7801A95A1E7D -:103FF000534253418DF8053004F084FD2188054675 -:10400000012000F057F918B100F8055900F0FEF84A -:10401000012000E0002003B030BD00002DE9F04792 -:10402000154E8046337B0F46154683B90123C0F3F6 -:10403000032933734FEA112A3DB140F2031006F011 -:10404000E9FF013D0446EDB218B900233373BDE822 -:10405000F08780F8008080F80190877080F803A0D6 -:10406000717B3A464B1C043073730DF0B6F9204651 -:1040700004F080FDE0E700BF244C00214FF6C17240 -:1040800070B503880646934288B050D003F12B02E6 -:1040900092B2042A00F28B80A3F57F43D53B042B18 -:1040A00000F28580DFE803F03545032E43000A78EF -:1040B000404B1A700120318800F0FCF804460028BB -:1040C00061D0002305464FF6D67205F8013B3388D0 -:1040D000934230D04FF6D972934256D04FF6C17208 -:1040E00093424DD101A8DEF71DF82B4601AA07AE79 -:1040F000154603CDB542186059602A4603F10803FE -:10410000F6D151E04A780B7803EB0223294AD38198 -:10411000D0E7CA788B78087803EB02234A7800EB63 -:10412000022080B20A7999B2FFF778FFC2E71D201A -:10413000C1E71120BFE71F4B5A6842705A68120A44 -:104140008270DA88C270DA7902719A6842719A686C -:10415000120A82715A89C271DA7A02721A6942723B -:104160001A69120A82725A8AC272DA7C02735A6916 -:1041700042735A69120A8273DA8AC273DB7D03744E -:10418000601F00F043F8012012E001A8DEF736F8C6 -:104190002B4601AA07AE154603CDB54218605960FB -:1041A0002A4603F10803F6D110681860E8E70020FA -:1041B00008B070BD244C002138B505464FF6E872B2 -:1041C0002B880846934205D04FF6EC7293420FD0ED -:1041D000002038BD04F0FCFF04462988012000F0CF -:1041E00069F818B100F8054900F010F80120F0E76F -:1041F000087805F00BF8EFE701234170090A037016 -:10420000817003207047017001207047024608B595 -:1042100018B10021054806F008FF054B93F8280067 -:1042200018B9BDE8084006F06DB908BD784D002109 -:10423000644D002138B50546881C0C4606F0EAFEA0 -:1042400010B105704470023038BD000070B50446EE -:104250000025174E56F8043B7BB901351D2DF9D1C9 -:10426000A578DDB1012D06D101F0BEFC04210E20A0 -:10427000FFF7E0FF38B9002004E020469847002807 -:10428000EBD0012070BD032343700C2305708370B5 -:10429000E378C3700238FFF7B9FFF2E7012110207D -:1042A000FFF7C8FF0028E6D0237900F8013BF1E7CB -:1042B000EC4C002138B5054605300C4606F0AAFE48 -:1042C00048B10E2303700123C4700335240A4570DE -:1042D00083700471053038BDF8B587780546022F24 -:1042E00003D0042F6AD00020F8BD827C3B4EFF2A09 -:1042F000336935D0580501D40120F5E7736899007A -:10430000FAD5374B96F830201B689B7B9A42F3D244 -:1043100012213E20FFF78EFF04460028ECD00B232D -:10432000037001234370AB7A05F10C018370EB7AC3 -:10433000043000F8013C06F0F3FCAB7C05F11301FE -:10434000A37204F10B0006F0EBFC6B7A637496F831 -:104350003030013386F83030A01EFFF757FFCBE72F -:104360009A07C0D573689B00BDD51D4B96F83020C9 -:104370001B689B7B9A42B6D2017A3E200C31C9B2AF -:10438000FFF758FF04460028ADD0012307704370A3 -:10439000AB7A05F10C018370EB7A043000F8013C34 -:1043A00006F0BEFC2A7A04F10B03A2726968184673 -:1043B0000CF0ECFF2A7A697A8154C8E739460E205E -:1043C000FFF738FF044600288DD0012303700C232B -:1043D000437020238370EB78C370BDE7404C00210D -:1043E000DC4D00210238FFF711BF38B50546F92032 -:1043F0000C4606F00FFE10B105704470023038BD57 -:104400002DE9F04F83780446173B85B00F2B15D864 -:10441000DFE813F01000A900BD0014001400140020 -:104420001400D4008E0106011400140014001400BE -:104430001400A601BB4F3B69DE0402D44FF0000B11 -:1044400088E07B689D00F9D5E522868BDFF8D8925D -:10445000B6FBF2F302FB1362002A18BF013397F890 -:104460003020DBB21344D9F80020927B9342E5DC84 -:10447000D0F82080D9F8003097F830209B7B9A4202 -:10448000DCD2E72006F0C6FD05460028D6D0E52E92 -:10449000324628BFE5224FF03E01D3B2017003F14E -:1044A0001A014170811C019197F83010D9F8000071 -:1044B0000131C9B287F83010807BB61A88424FD1DB -:1044C000002E4DD00026B346A18841F04001A180C6 -:1044D000206AB4F81CC008EB020AAAEB0000604591 -:1044E000CDE902324FF00D004FF00103A188EB70CF -:1044F0001CBF01F01F0141F020012971090AA870B9 -:104500006971A179E81DA971E11D06F009FC617BC3 -:1045100005F115006973A17BA973E17BE973217C27 -:104520002974617C6974618AA97494F91310E9741F -:10453000217D297504F1150106F0F2FB029B41462D -:10454000039AEB7605F11C000CF020FF0198FFF7B1 -:1045500049FF1EB9584605B0BDE8F08FD04689E73F -:104560004FF0010BB4E704210E20FFF763FE002893 -:104570003FF464AF42224FF0010B4270202280F8DA -:1045800000B08270E278C270FFF72CFFE2E7654B63 -:104590001A69D0037FF552AF5B6899007FF54EAF83 -:1045A00001213E20FFF746FE00283FF447AF1122CD -:1045B0000270FFF717FF4FF0010BCBE7594B1A6959 -:1045C00092047FF53BAF5B689B007FF537AF10210E -:1045D0003E20FFF72FFE054600283FF42FAF0E23A5 -:1045E0000370237904F10A014370E388063000F870 -:1045F000043CE3881B0A00F8033C237A00F8023CE1 -:10460000637A00F8013C06F08BFB237C2B73638AF2 -:104610006B73638A1B0AAB73237DEB732846C8E771 -:10462000404E33695F047FF509AF73689D007FF5E5 -:1046300005AFF7224789DFF8F0A0B7FBF2F302FBE2 -:104640001372002A18BF013396F83020DBB21344EE -:10465000DAF80020927B93423FF7F0AEC368DAF8B5 -:10466000002096F83010927B02939142BFF4E6AEA0 -:10467000F72FB94628BF4FF0F7095FFA89F202F128 -:1046800008013E20C9B20192FFF7AFFE054600289F -:104690003FF4D4AEDDE9012396F83010DAF80000DB -:1046A0000131C9B286F83010807BA7EB0908884237 -:1046B00035D1B8F1000F32D04FF000080221C346C7 -:1046C000617203EB09010191E16803EB0900411AF2 -:1046D000608981422AD1617A022918BF00210F2006 -:1046E0002870A0886870A088000AA870A079E87077 -:1046F000E0792871207AA9716871EA712FB14A4670 -:10470000194605F108000CF041FE2846FFF76AFE45 -:10471000B8F1000F3FF41EAF4746019B9FE74FF0F3 -:10472000010BCEE7404C0021DC4D00210121D6E7F2 -:104730002B4B1A6910047FF581AE5B6899007FF5F9 -:104740007DAE03213E20FFF775FD00283FF476AED5 -:1047500010220270A2884270A288120A827028E792 -:104760001F4B1A6912027FF569AE5B689B007FF5EB -:1047700065AE14213E20FFF75DFD054600283FF49D -:104780005DAE18230370237904F10E014370E388B2 -:104790000A3000F8083CE3881B0A00F8073C23892C -:1047A00000F8063C23891B0A00F8053C638900F8E1 -:1047B000043C63891B0A00F8033C237B00F8023C9D -:1047C000637B00F8013C06F0ABFA237D2B74E38A8F -:1047D0006B74E38A1B0AAB74237EEB741EE700BF85 -:1047E000404C002138B5054600F058FE0446A0B9FB -:1047F000AB78032B0FD104210E20FFF71BFD50B126 -:104800000A2301244370202304708370EB7802385C -:104810004371FFF7FBFC204638BD0124FBE7000095 -:10482000837870B51A3B0546032B0AD8DFE803F0FE -:10483000022B3B572F4B304E1B68327E9B7F9A4298 -:1048400001D3002070BD33695803FAD5736899000D -:10485000F7D509213E20FFF7EDFC04460028F0D0F3 -:10486000132303702B79A91D43706B79033000F873 -:10487000013C06F055FA337E01333376A01EFFF774 -:10488000C5FC0120DEE704210E20FFF7D3FC04461F -:104890000028D6D001230370392363702023A3702E -:1048A0002B79E370EAE7144B1A699203C9D55B6868 -:1048B0009B00C6D506213E20FFF7BCFC044600281D -:1048C000BFD0122303702B7943706B798370EB8810 -:1048D000C370EB881B0A03712B7A4371CEE7042166 -:1048E0000E20FFF7A7FC04460028AAD0012303707E -:1048F0004023D2E7DC4D0021404C0021837870B585 -:104900002B3B0546072B0BD8DFE803F004195E0AA2 -:104910000A0A0A7305210E20FFF78CFC044608B929 -:10492000002070BD42F26C01FFF766FC2A79231863 -:1049300022546A795A70A01EFFF768FC5DE0524B62 -:104940001A69D600ECD55B689C00E9D5017D3E2054 -:1049500049000F31C9B2FFF76DFC04460028DFD0D3 -:104960001D2303702B79002243706B7905F116012A -:104970008370AB68C370AB681B0A03716B894371AA -:104980002B7B83716B7BC371AB7B0372EB7B4372BD -:104990002B8A83722B8A1B0AC3726B8A03736B8AFE -:1049A0001B0A43732B7D837300F10F03287D0233B1 -:1049B0008242C0D20888013203F8020C31F8020B9F -:1049C000000A03F8010CF1E72F4B1A699000A7D5F4 -:1049D0005B689900A4D503213E20FFF72BFC044619 -:1049E00000289DD01E2303702B7943706B79837050 -:1049F000A1E7254E73699A0701D4012091E77368F6 -:104A00009B00FAD5214B96F830201B689B7B9A427D -:104A1000F3D214213E20FFF70DFC04460028ECD011 -:104A200022230370AB884370AB881B0A8370AB7979 -:104A3000C370EB7903712B8943712B891B0A837136 -:104A4000AB7AC371EB7A03722B7B4372EB8983726F -:104A5000EB891B0AC3722B6903732B691B0A43730F -:104A60006B8A8373AB8AC373AB8A1B0A0374AB7DF7 -:104A70004374EB7D83742B7EC37496F8303001331E -:104A800086F8303057E700BF404C0021DC4D002154 -:104A900038B583780446292B03D02A2B53D0002025 -:104AA00038BD334B1A695001F9D55B689900F6D5CA -:104AB000A17E3E2049001331C9B2FFF7BBFB00289D -:104AC000EDD01B230370237900224370637904F136 -:104AD0001C018370A368C370A3681B0A03716389F8 -:104AE0004371E3688371E3681B0AC371E38903724E -:104AF000237C4372637C8372A37CC372E37C037365 -:104B0000237D4373E38A8373E38A1B0AC373238B76 -:104B10000374238B1B0A4374A37E837400F1130375 -:104B2000A57E0233AA4204D30238FFF76FFB0120AF -:104B3000B6E70D88013203F8025C31F8025B2D0AFA -:104B400003F8015CECE70A4B1A691201A7D55B6810 -:104B50009B00A4D503213E20FFF76CFB00289ED0CC -:104B60001C2303702379437063798370DCE700BFF3 -:104B7000404C002138B583780546272B01D0002012 -:104B800038BD0B4B1A69D201F9D55B689B00F6D58D -:104B90001D213E20FFF74EFB04460028EFD029469A -:104BA00000F008F8A01EFFF731FB0120E8E700BF86 -:104BB000404C0021192303700B794370CB8883701C -:104BC000CB881B0AC3708B6803718B681B0A437107 -:104BD0004B898371CB68C371CB681B0A0372CB8985 -:104BE00043720B6983720B691B0AC3724B8A03738E -:104BF0004B6943734B691B0A8373CB8AC3730B7E68 -:104C000003744B7E43748B7E8374CB7EC3740B7FA3 -:104C100003754B7F43758B7F83750B8CC3750B8C32 -:104C20001B0A03764B8C43764B8C1B0A83768B8C4A -:104C3000C3768B8C1B0A03771D207047837810B5D1 -:104C4000272B044626D0282B03D11B4B1A69900131 -:104C500001D4002010BD5B689900FAD507213E20E1 -:104C6000FFF7E8FA02460028F3D01A230370A3885E -:104C70004370A3881B0A8370E388C370E3881B0A10 -:104C80000371237A4371637A8371901EFFF7BEFA32 -:104C90000120DFE7084B1A69D201DAD55B689B0077 -:104CA000D7D51D213E20FFF7C5FA02460028D0D0F7 -:104CB0002146FFF77FFFE8E7404C002108B5094A8D -:104CC000C178837803EB0123D1699BB20131D161B3 -:104CD000116A0B44136206F0A5F9012003F014F8E1 -:104CE000012008BD404C0021114B70B5DD8C0446FD -:104CF0000E4685B905211320FFF79CFAB8B10123B0 -:104D00004470240A03708470C6700571BDE8704059 -:104D10000238FFF77BBA9A6A01329A62DA6A2A4449 -:104D2000DA620A462946BDE87040FDF7D3BF70BD80 -:104D3000404C002110B502F0E5FF044610B90024F4 -:104D4000204610BD044B9B7E002BF9D0FFF7B6FF29 -:104D50000028F4D1F4E700BF404C002110B5094C05 -:104D6000A37E43B102F0CEFF28B1A37E43B1BDE8DC -:104D70001040FFF7A3BF0020BDE8104005F0C2BB04 -:104D800010BD00BF404C002138B583780546122B7A -:104D900014D8042B1BD9053B0D2B18D8DFE813F0D2 -:104DA000190059006E001700E100C200170017003B -:104DB0001700170017009500170002012F2B00F0B5 -:104DC0001D81302B00F03F812E2B00F0FA80002057 -:104DD00038BDAB4B1A69D207F9D55B689B00F6D595 -:104DE00013213E20FFF726FA04460028EFD00122C7 -:104DF00002702B79063000F8053CEB8800F8043C83 -:104E0000EB881B0A00F8033C2B7A00F8023C6B7A13 -:104E1000991E914287BF637105F10A01627105F124 -:104E20001D0105F07DFF2B8A23732B8A1B0A6373F8 -:104E30006B8AA3736B8A1B0AE373AB8A2374AB8AF6 -:104E40001B0A6374AB7DA374A01EFFF7DFF901207A -:104E5000BEE78B4B1B68DC06B9D504210520FFF7A4 -:104E6000E9F904460028B2D02B790370EB8843702F -:104E7000EB881B0A83702B7AC370E5E7804B1A69B5 -:104E80005007A4D55B689900A1D50A213E20FFF701 -:104E9000D1F9044600289AD0032303702B7943707C -:104EA000EB888370EB881B0AC3702B8903712B89F5 -:104EB0001B0A43716B8983716B891B0AC371AB89B0 -:104EC0000372AB891B0A4372BEE76D4B1A699206E7 -:104ED0007FF57DAF5B689C007FF579AF0B213E20AD -:104EE000FFF7A8F9044600283FF471AF06232370AA -:104EF000AB886370AB881B0AA370EB88E370EB8808 -:104F00001B0A23712B8963712B891B0AA3716B897F -:104F1000E3716B891B0A2372AB896372AB891B0A2D -:104F2000A37291E7564B1A6910077FF550AF5B6883 -:104F300099007FF54CAF0C213E20FFF77BF904462A -:104F400000283FF444AF042303702B794370EB88AF -:104F50008370EB881B0AC370AB684360EB688360A7 -:104F600072E7474B1B681A057FF531AF08210C200B -:104F7000FFF760F9044600283FF429AF2B7903704E -:104F8000EB884370EB881B0A83702B7AC3706B89A4 -:104F900003716B891B0A4371AB898371AB891B0A4F -:104FA000C37151E7364B1B695B067FF510AF0B21D0 -:104FB0003E20FFF73FF9044600283FF408AF0723DF -:104FC00095E72F4B1A6954007FF501AF5B68980095 -:104FD0007FF5FDAE05213E20FFF72CF904460028A1 -:104FE0003FF4F5AE1F2303702B794370EB88837079 -:104FF000EB881B0AC3702B7A237125E7204B5A6973 -:10500000D1077FF5E4AE5B689A007FF5E0AE092139 -:105010003E20FFF70FF9044600283FF4D8AE2123C5 -:1050200003702B794370EB888370EB881B0AC37085 -:105030002B7A03716B7A4371AB7A8371EB7AC3710C -:105040002B7B037200E70E4B1A69002ABFF6BFAE36 -:105050005B689B007FF5BBAE05213E20FFF7EAF8B9 -:10506000044600283FF4B3AE20230370AB8843709E -:10507000AB881B0A8370AB79C370EB79BCE700BFC8 -:10508000404C0021837810B5212B044601D000202C -:1050900010BD0D4B1A691203F9D55B689B00F6D55C -:1050A00004213E20FFF7C6F80028F0D01423037037 -:1050B000A3880238C370A3881B0A0371A3794371C4 -:1050C000FFF7A4F80120E3E7404C002138B58378CE -:1050D0000446082B11D104210E20FFF7ABF858B17C -:1050E0000E23012543702023057083702379023835 -:1050F0004371FFF78BF8284638BDBDE83840FFF70D -:1051000043BE000038B583780546052B01D000204A -:1051100038BD234B1A699205F9D55B689B00F6D51B -:105120001F213E20FFF786F804460028EFD00A230F -:1051300003702B7905F10A014370EB88063000F803 -:10514000043CEB881B0A00F8033C2B7A00F8023C75 -:105150006B7A00F8013C05F0E3FD05F1170104F15D -:105160000C0005F0DDFD05F11D0104F1120005F054 -:10517000D7FD2B8AA01E23762B8A1B0A63766B8AA7 -:10518000A3766B8A1B0AE376AB8A2377AB8A1B0A6A -:105190006377AB7DA377FFF739F80120B8E700BF4D -:1051A000404C002100F000B8837810B50B3B04465A -:1051B000062B10D8DFE803F004384A0F0F0F6F00FA -:1051C0003D4B9A6802F00071920118D505215920D3 -:1051D000FFF730F808B9002010BD0123637223796E -:1051E0000370E3884370E3881B0A8370237AC370DB -:1051F000637A03710238FFF709F80120ECE71B68B6 -:1052000003F080030B43E6D004210820FFF712F8D7 -:105210000028E0D023790370E3884370E3881B0AF9 -:105220008370237AC370E5E7234B5B681804D2D5FB -:1052300003213020FEF7FEFF0028CCD02379037035 -:10524000E3884370E3881B0A8370D3E71A4B1A691B -:10525000D1061CD55B689A0019D50D213E20FEF7BA -:10526000E9FFA0B105230370A3884370A3881B0A3C -:105270008370D4F80630C0F80330D4F80A30C0F890 -:105280000730E389C372E3891B0A0373B2E7A0887E -:1052900003F0CAFB9FE7084B9B681B029BD50221CA -:1052A0005720FEF7C7FF002895D0A3880370A38876 -:1052B0001B0A43709EE700BF404C002110B5074B0E -:1052C000847859689A680131224459609A6005F0DF -:1052D000A9FE012003F05AFC012010BD244C00213E -:1052E00070B50E46810001310546C9B2132014463F -:1052F000FEF7A0FF00B30346224603F8015BB11E90 -:1053000004EB4505AA4203F1040304D1BDE8704053 -:105310000238FEF77BBF31F8024F03F8044C0C88CB -:10532000240A03F8034C148803F8024C32F8024BA9 -:10533000240A03F8014CE5E770BD000010B503F046 -:1053400023FC044610B90024204610BD044B1B78F2 -:10535000002BF9D0FFF7B2FF0028F4D1F4E700BF2B -:10536000244C002138B50F4C257E012D09D103F0C6 -:105370000BFC88B105F056FE2846BDE8384003F026 -:1053800005BC237843B103F0FFFB28B1237843B178 -:10539000BDE83840FFF792BF0020BDE8384005F077 -:1053A000B1B838BD244C002100207047837810B577 -:1053B000162B044601D0002010BD0F4B1A691205B0 -:1053C000F9D55B689B00F6D506213E20FEF732FF3B -:1053D0000028F0D00C23037023790238C370E388CF -:1053E0000371E3881B0A4371237A8371637AC37163 -:1053F000FEF70CFF0120DFE7404C002138B5837831 -:105400000446132B4FF0000503D0142B29D00020A5 -:1054100038BD214B1A691006F9D55B689900F6D59D -:1054200042213E20FEF706FF0028F0D008234570F9 -:105430000370821C631D04F1250153F8045B8B4249 -:1054400042F8045BF9D100F12202453453F8041B01 -:10545000A34242F8041BF9D10238FEF7D7FE01201F -:10546000D6E70D4B1A69D205D1D55B689B00CED526 -:1054700022213E20FEF7DEFE0028C8D0092303705B -:105480002379821C4370631D253453F8041BA34207 -:1054900042F8041BF9D1DFE7404C002138B583788E -:1054A0000546222B39D0312B20D0152B05D10F21C9 -:1054B000FF20FEF7BFFE044608B9002038BDF123E7 -:1054C0000370FF2343702B79033000F8013CD5E9CA -:1054D000022305F043FCD5E9042304F1090005F09B -:1054E0003DFCA01EFEF792FE0120E7E70A21FF2007 -:1054F000FEF7A0FE04460028DFD0F3230370FF234D -:1055000043702B798370AB688371AB681B0AC371DE -:105510006B890372EB7A4372E3E70F21FF20FEF7FA -:1055200089FE04460028C8D0F5230370FF2343708A -:105530002B798370EB88C370EB881B0A03712B896E -:1055400043712B891B0A8371EB68C371EB681B0ADB -:105550000372EB894372EB7B83722B69C3722B69F5 -:105560001B0A03736B8A4373EB7C8373B9E70000F8 -:10557000014B5866704700BF784C0021034B044A2A -:105580001A62044B044A1A62704700BF784C00212B -:10559000C11C0201EC4C0021D9420201044905481A -:1055A000054B064A48625A6288629A62704700BF99 -:1055B000784C0021411D0201EC4C00210144020104 -:1055C000034A93681BB903499160034A936070478B -:1055D000784C0021391F0201EC4C0021034B044A96 -:1055E000DA62044B044ADA62704700BF784C00214B -:1055F0002D200201EC4C0021E54702010449054839 -:10560000054B064A08631A6348635A63704700BF34 -:10561000784C002129210201EC4C00212148020193 -:10562000034B044A1A65044B044A1A65704700BFCD -:10563000784C002101240201EC4C0021FD480201BC -:10564000034B044A5A65044B044A5A65704700BF2D -:10565000784C00218F240201EC4C0021914A020178 -:10566000034B044A9A64044B044A9A64704700BF8F -:10567000784C0021DD250201EC4C0021754B020124 -:10568000034B044ADA64044B044ADA64704700BFEF -:10569000784C002101290201EC4C00213D4C020113 -:1056A00008B50849084800F093FD084B5A6922B92B -:1056B000074A5A61074B084A5A61084B084A1A6060 -:1056C00008BD00BF5D4D0201E94C0201784C00218C -:1056D000E92A0201EC4C0021894D0201D04D002144 -:1056E000354D0201014B024A9A617047EC4C002192 -:1056F0008550020108B50749074800F069FD074BCE -:10570000074A5A61074B084A5A61084B084A1A600F -:1057100008BD00BF5D4D0201E94C0201784C00213B -:105720003D2D0201EC4C0021CD500201D04D002155 -:10573000354D020108B50749074800F049FD074B00 -:10574000074A5A61074B084A5A61084B084A1A60CF -:1057500008BD00BF5D4D0201E94C0201784C0021FB -:10576000EB2D0201EC4C0021CD500201D04D002167 -:10577000354D0201034B044A9A60044B044A9A6077 -:10578000704700BF784C0021B32E0201EC4C002181 -:1057900005510201034B044ADA61044B044ADA6101 -:1057A000704700BF784C00211D2F0201EC4C0021F6 -:1057B000A5510201044BDA6922B9044ADA61044BAB -:1057C000044ADA61704700BF784C00215D2F020166 -:1057D000EC4C0021A951020110B50E4B04460E4AB3 -:1057E0000E49002004F07AFE0D4804F085FE0D4BB2 -:1057F0006C22184600210BF0F0FD382204700021C5 -:1058000009480BF0EAFD094800F024FCBDE810400F -:1058100000F0EAB93D5B02014D5A0201F55902015F -:10582000CD5B0201644D0021404C00214D4202013C -:1058300008B50749074800F0E3FC074B074A1A6020 -:10584000074B084ADA60084B084ADA6008BD00BF17 -:1058500065530201E1520201D44D00213D53020182 -:10586000784C002195300201EC4C0021A953020133 -:10587000054B1B681B79092B05D9044B044A5A6454 -:105880000022044B5A647047DC4D0021784C002103 -:10589000DD340201EC4C0021034B044ADA63044B73 -:1058A000044ADA63704700BF784C0021B335020127 -:1058B000EC4C0021AD530201034B044A9A63044BA4 -:1058C000044A9A63704700BF784C0021F336020106 -:1058D000EC4C0021FD5302012DE9F74F804607F003 -:1058E0005DFB10F0FF0502D007F0E6FB064618F05E -:1058F000010F05D0394C204601A905F0ABFBB0BB28 -:1059000018F0020F08D0DFF8D89048460DF10301D7 -:1059100005F0A0FB044668BB18F0040F08D0002077 -:10592000304C84F8280004F0EDFD636A03B1984719 -:1059300018F0080F0AD001211020FEF77BFC28B1D7 -:10594000294B5B7E00F80239FEF760FC65B107F079 -:1059500025FB48B107F0B0FB314607F085FB234B30 -:105960001A88824200D2188003B0BDE8F08F02F09E -:10597000BFF9C0E76278237804F1030A03EB02233E -:10598000ADF80430A378514601A88DF80630FBF736 -:10599000C7FE0746E8B9DFF858B05BF8043B9BB98F -:1059A00001371D2FF9D104210F20FEF743FC80B1F0 -:1059B0000122BDF80430023803711B0A8270C270E4 -:1059C0004371FEF723FC04E0514601A898470028E4 -:1059D000E6D0204605F026FB97E700BF684D002182 -:1059E000704D0021644D0021404C0021604D00218C -:1059F000784C0021012838B50A46044616D0032801 -:105A000008D0D8B9104D014605F10C0005F00DFB8A -:105A1000022111E00C4C002104F11C0005F005FBF3 -:105A200010212078BDE8384005F0A0BB064D0021CC -:105A3000281D05F0FAFA21462878F3E70846BDE864 -:105A4000384005F0EFBA00BF644D002110B50446A0 -:105A5000022C084609D0032C65D0012C0FD105F08B -:105A6000E1FA204602F050F909E00B783E2B04D110 -:105A70008B78162B3AD8012B08D805F0D3FABDE85D -:105A800010402C4B0421187805F070BB023B142BFE -:105A9000F3D801A252F823F0015B02017B5A020104 -:105AA0007B5A02017B5A02017B5A02017B5A020196 -:105AB0007B5A02017B5A02017B5A0201015B0201FF -:105AC0007B5A0201015B02017B5A0201015B020168 -:105AD0007B5A02017B5A02017B5A02010F5B0201D1 -:105AE0007B5A0201195B0201195B0201223BDBB206 -:105AF000062BC2D8012202FA03F313F0490FBCD0DF -:105B00000D4A92F83030013B82F83030B5E70A4A4E -:105B1000137E013B1376B0E7074A92F83130013B20 -:105B200082F83130A9E705F07DFA012003F02EF864 -:105B3000A5E700BF644D0021404C00212DE9F34151 -:105B4000DFF87C80064698F828700D461446002F32 -:105B500033D10DF1070108F1140005F07BFA68B1AB -:105B60000122437888F8282002220233012732706C -:105B70002B802060384602B0BDE8F081114B1B68D5 -:105B80005BB1984748B18378C278043303EB0223B2 -:105B9000012288F828200322E8E70B4B1B68002B22 -:105BA000E8D098470028E5D08378C278043303EB27 -:105BB0000223012288F82820D8E70027DAE700BF6F -:105BC000644D0021D44D0021D04D0021044B5A7E5C -:105BD0002AB95876034B0821187805F0C7BA7047E0 -:105BE000404C0021644D002110B5094C30220021A9 -:105BF00004F108000BF0F1FB4FF0FF3241F6FF73A8 -:105C0000C4E900231F220023C4E9042310BD00BF00 -:105C1000404C0021C022A24B70B583F82E202822D0 -:105C2000042183F83720022283F83F104CF2170139 -:105C300083F8382083F855200022A3F8421047F655 -:105C4000830183F856208022A3F84410102183F8A2 -:105C50004F20944A83F85210506918B393F82910D2 -:105C6000B3F84A4041F0200183F8291093F82B1033 -:105C700044F4F87461F07F0183F82B1093F833102B -:105C8000A3F84A4041F0040183F83310222183F83D -:105C90003810B72183F8441093F84C1041F00801F4 -:105CA00083F84C10116A29B1002840F0EB80CC2118 -:105CB00083F84310D16A41B1F72183F8421093F879 -:105CC000431041F0030183F84310D16979B170B1F9 -:105CD00093F8441041F0400183F844107F2183F889 -:105CE000451093F8491041F0300183F8491091684C -:105CF000D1B193F84B4093F8505044F0780183F8B9 -:105D00004B1093F84C1045F0040541F0060683F85B -:105D10004C6083F8505038B164F0070441F007013B -:105D200083F84B4083F84C10916B41B193F84B10C2 -:105D300041F0060183F84B10142183F85210D16B07 -:105D400029B1B3F84C1041F4F871A3F84C10116B61 -:105D500089B193F84D4093F8501064F0010483F832 -:105D60004D4093F84E4041F0030144F0030483F8A2 -:105D70004E4083F85010516A41B193F84E100028FC -:105D800040F08A8041F0600183F84E10516B29B1D8 -:105D900093F84E1041F01C0183F84E10916A11B136 -:105DA000FF2183F84F10116C29B1B3F8501041F462 -:105DB000FF51A3F85010516C59B193F8511061F094 -:105DC0001F0183F8511093F8521041F0030183F83A -:105DD0005210916C29B1B3F8521041F4F061A3F85C -:105DE0005210D16C29B193F8531041F0180183F887 -:105DF0005310116D29B193F8541041F0030183F849 -:105E00005410516D29B193F8531061F01F0183F8BC -:105E10005310D168A1B193F8301041F00C0183F810 -:105E2000301093F8521041F0600183F8521093F84B -:105E3000541061F0030183F85410072183F85510C2 -:105E4000916D11B13C2183F85610116E29B193F870 -:105E5000551061F0070183F8551093F8501012693E -:105E600041F0180183F8501093F8561041F00101E9 -:105E700083F856102AB193F8572042F0030283F8B2 -:105E8000572070BDFC2183F8431093F8441041F073 -:105E9000080183F844100DE761F01F0174E700BFAB -:105EA000644D0021784C0021C30673B504460D46AD -:105EB00006D5084E30460DF1070105F0CBF830B994 -:105EC0002946204602B0BDE87040FFF705BD02F04C -:105ED00051FEEFE7804D002110B504464C22002111 -:105EE0000BF07BFA0F4B104A236008232261022239 -:105EF00023710423E2820D4AA373A261A3770C4AA3 -:105F00000C4BC4E9082342F21073A3874CF6DD134F -:105F1000A4F84230084B636440F6E213A4F848301A -:105F200010BD00BFE807F149FB0040001900FB006D -:105F3000FB00000404001B00320000D8014B186075 -:105F4000704700BFDC4D002113B5244C2073EAF7E5 -:105F500047FAEAF7AFFA00220023C4E90C23204BEA -:105F600083F840201A601A719A711A721D4AD4E996 -:105F7000083112680DF1070192F83E00002818BFA1 -:105F80004FF48070034392F83F00002818BF4FF48D -:105F90000060034392F8400092F84120002818BFA7 -:105FA0004FF40070002A18BF4FF48062034313437C -:105FB0000DF10600236207F073F99DF90720236AAB -:105FC000132ACCBF4FF4004200221343236203F094 -:105FD000AFF902F087FC02B010BD00BF685000218D -:105FE00020500021DC4D0021F8B506460D4606F094 -:105FF000D5FF074656B1002446FA04F3DB0702D565 -:10600000E0B2EAF7B9FA01340E2CF5D115B1284601 -:10601000EAF76AFA06F0C2FF394607F025F8034BA3 -:106020001A88824238BF1880F8BD00BFD84D0021C1 -:10603000042008B504F0EEFF014640B1FF23438081 -:106040000380034B187BBDE8084004F0F4BF08BD93 -:1060500068500021014B1860704700BF6850002154 -:10606000044B1B6803B11B7B0370034B1B8A0B8023 -:10607000704700BFDC4D002168500021044B1B68B5 -:106080000BB193F822300370024BDB890B80704711 -:10609000DC4D00216850002103230370014B5B8A13 -:1060A0000B8070476850002103230370014B9B8ACB -:1060B0000B8070476850002106230370014BDB8A78 -:1060C0000B8070476850002130B5094D2C6864B1D1 -:1060D00094F834400470286890F835001070054A30 -:1060E000508B0880128B1A8030BD04701470F6E754 -:1060F000DC4D00216850002130B5094D2C6864B199 -:1061000094F839400470286890F83A001070054AF5 -:10611000D08B0880928B1A8030BD04701470F6E723 -:10612000DC4D002168500021014B1888704700BFEA -:10613000D84D002108B503F035FBBDE80840EAF76B -:1061400071BDEBF747BA08B503F02CFBEBF712FA79 -:10615000EBF720FBEBF740FBBDE80840EBF758BB43 -:1061600008B503F049FBBDE80840ECF737B9ECF798 -:106170003FBD08B503F040FBECF7F0FCBDE808407C -:10618000EDF75EBC08B503F0F7FABDE80840EEF79E -:10619000EFBEEEF759BB08B503F0EEFABDE80840D4 -:1061A000EFF7F4B808B503F0E7FA03F0B3FABDE887 -:1061B0000840F1F715BCEFF723BE08B503F0DCFA91 -:1061C000BDE80840F1F7ACBEF3F76EB8F2F7F0B8EF -:1061D000014BC3E9010170476850002108B503F085 -:1061E000A7FABDE80840F4F71BB808B503F0A0FA19 -:1061F000BDE80840F4F76EB8F4F7EEB9F4F748BC20 -:10620000014BC3E90A0170476850002108B5F4F753 -:1062100011FF80B208BDF6F7F5B8F6F7A9B908B5D1 -:1062200003F0D4FABDE80840F6F748BA08B503F021 -:10623000D7FABDE80840F6F75BBCF6F773BC000080 -:1062400008B504F085FD024BC3E90C0108BD00BF91 -:1062500068500021024BD3E90C2304F07FBD00BF3E -:1062600068500021F8B5244D06466B782BB1234BBE -:106270005B7CDA0701D50C20F8BDEB787BB1EAF73F -:106280006FFD04460028F6D11D4F3B683BB13B68CB -:10629000E0B298470028EED10134032CF7D12B79D6 -:1062A0007BB1F4F7ABF904460028E4D1154F3B6805 -:1062B0003BB13B68E0B298470028DCD10134032CA5 -:1062C000F7D1304604F044FD01F44043B3F5404FAC -:1062D00006460C4601D00B040CD404F053FE0123F7 -:1062E000EB7340F20113C5E908642B8204F056FEFB -:1062F0000020C1E71220BFE72050002140510021BB -:10630000E44D0021E04D002147F6EE5208B5831E12 -:106310009BB2934203D803F067FF002008BD122010 -:10632000FCE7000008B5054B5A7C2AB1D3E90823E5 -:1063300004F014FD002008BD1220FCE720500021CD -:10634000054B30B51C6825880580207908701B68CE -:106350005B88138030BD00BFDC4D0021024BD3E9C8 -:106360000E2304F0E6BC00BF68500021024BD3E9C5 -:106370000A2304F0DEBC00BF2050002108B504F061 -:10638000D4FC034621F4FF5020F01F0018B9034A43 -:10639000C2E90A3108BD1220FCE700BF20500021ED -:1063A000034630B50C4C10461C4021F07E4222437F -:1063B00010D10A4AD2E9065428B100202B432143C8 -:1063C000C2E9063130BD25EA030324EA0101C2E92E -:1063D0000631F7E71220F5E7000001C02050002148 -:1063E000DDF70EBD10B5044B9C791CB9DDF70EFD31 -:1063F000204610BD0C24FBE72050002138B5124B7D -:1064000005461B6808461B79082B03D8012D05D9C2 -:1064100012240AE0AB1EDBB2FC2BF9D90B4B9C79A2 -:1064200084B9FF2D03D1DDF745FD204638BD04F0CA -:106430008FFC02460B462846DDF7F2FC002808BF19 -:106440000724F2E70C24F0E7DC4D00212050002166 -:1064500038B5124B04461B6808461B79082B03D835 -:10646000012C05D912250AE0A31EDBB2FC2BF9D9B9 -:106470000B4B9D797DB9FF2C03D1DDF721FD28461B -:1064800038BD04F065FC02460B462046DDF7E8FC0B -:106490000028F4D1E6E70C25F1E700BFDC4D002130 -:1064A0002050002103461C48F0B5D0E91025C3F167 -:1064B0002004A3F12000DA4005FA04F4224325FA6F -:1064C00000F0024312F0010FC3F1200CA3F12002EF -:1064D0001DD0124E3078E0B9012505FA02F425FAF4 -:1064E0000CFE44EA0E0E05FA03F701FA02F221FA55 -:1064F0000CFCD6E90A5442EA0C0225EA070524EA14 -:106500000E04994029432243C6E90A12F0BD112026 -:10651000FCE70C20FAE700BF685000212050002162 -:1065200006F0BEBE06F0D8BE08B506F0E5FE0028AF -:106530000CBF1220002008BD38B5437882781B02BA -:1065400012049B182CBF012100210278C478057920 -:106550009B184FEA046441F100011C1945EB010549 -:106560002046294602F063FE012808D915F4787FF9 -:1065700005D120462946BDE83840EAF77FB8122009 -:1065800038BD000008490246CB780879184306D187 -:1065900012F0F80F05D122B1044B1A7270470C208B -:1065A00070471220704700BF20500021F850002192 -:1065B0002DE9F041254D8046AB6A1A0654BF0126ED -:1065C00003265B0654BF0127032702F019FFC0B35F -:1065D000EC782B791C4334D1B8F80020B2F5804F09 -:1065E00031D8B8F802309A422DD3032B2BD998F822 -:1065F0000430012B27D898F80530BB4223D898F8EF -:106600000630B3421FD80C2004F004FD0146A8B1A7 -:1066100040F202434380B8F800308380B8F802307B -:10662000C38098F80430037298F80530437298F8E4 -:1066300006308372064B187B04F0FDFC2046BDE853 -:10664000F0810C24FAE71224F8E700BF2050002163 -:106650006850002138B504460D4602F0D1FE20B93D -:106660000C20BDE8384002F02ABE012C06D10D4BAB -:10667000587902F0ADFE08B91220F2E7062004F0C6 -:10668000C9FC014660B10223002C837018BF0123AE -:10669000C370054B0571187BBDE8384004F0CBBCD6 -:1066A00038BD00BFF8500021685000212DE9F74F98 -:1066B000DFF8E8A01646DAF828501F462A0654BF2D -:1066C0004FF0010B4FF0030B6B0654BF0123032364 -:1066D00080468946019302F09FFE002858D09AF820 -:1066E00003409AF80420144352D16D0A05F00405C2 -:1066F00045F0010536EA05034CD1019B43454BD3D8 -:10670000CB4549D3002E47D016F0010537D07B8802 -:106710003A889A4240D3032B3ED93B79012B3BD890 -:10672000012316F004060BD006225343FA185188B1 -:10673000FB5A8B4230D303292ED91379012B2BD846 -:10674000FDB10020EAF790FF3B464A464146002053 -:10675000EAF79EFF01250220BEB1EAF785FF062376 -:106760004A4603FB0573414602206E1CEAF790FF80 -:1067700035468AF80C50204603B0BDE8F08F2B4612 -:10678000CFE72846EAF77AFFE5E7EAF777FFF0E791 -:106790000C24F0E71124EEE71224ECE7205000214E -:1067A0002DE9F0414FF4A064214E5C43337B0A2570 -:1067B0007373002380460F465543B37302F02CFEDB -:1067C00030B901230C207373BDE8F04102F0CEBE56 -:1067D000B8F1010F10D1022F03D9012312207373D6 -:1067E000F2E706D1002CF8D0002DF6D0A54203D355 -:1067F000F3E70CB1002DF9D1EAF718FF0028ECD02F -:10680000102004F007FC014680B10723B8F1000F07 -:10681000837014BF01230223C0E90254C370054BE7 -:106820000771187BBDE8F04104F005BCBDE8F081BC -:10683000205000216850002170B5044602F0ECFDA4 -:1068400010B90C26304670BDA378012B55D863785B -:106850000F2B52D82389B3F5FA7F4ED2237813F049 -:10686000F80F4AD143F6F67263890A3B9BB2934212 -:1068700043D8237B1F2BE4D0EAF766FF0028E0D043 -:106880006068A678657804F063FA02460B462846ED -:106890003146EAF761FF0646002830D1EBF77AFA75 -:1068A00005282ED8182004F0B5FB05460028C9D0CD -:1068B00040F20B134380606804F04AFAC5E9020114 -:1068C000A378EB716378AB71237803F001022A712E -:1068D000C3F340026A7172B9C3F380032B75238935 -:1068E00029462B8263896B82237B6B75064B187B51 -:1068F00004F0A1FBA6E70023F0E71226A2E70B268F -:10690000A0E707269EE700BF6850002108B502F007 -:1069100083FD08B90C2008BDEAF736FA0028F9D043 -:10692000402004F077FB01460028F4D040F20B230E -:106930004380034B187B04F07EFB0020EBE700BF95 -:106940006850002138B5054602F066FD10B90C24E8 -:10695000204638BDB5F5706F17D22846EBF72CFAF4 -:10696000A8B1EAF711FA04460028F0D1402004F05B -:1069700051FB01460028EBD040F20D234380054B2C -:106980000580187B04F057FBE2E71224E0E742247D -:10699000DEE700BF6850002170B505460E4602F0E4 -:1069A0003BFD10B90C24204670BDB5F5706F0ED2BA -:1069B0002846EBF701FA60B1EAF7E6F90446002849 -:1069C000F0D131462846EBF7EFFA0028EBD112243C -:1069D000E9E74224E7E70000F7B5044602F01CFDB2 -:1069E00018B90C25284603B0F0BD154BDB79002BF8 -:1069F000F7D12378012B01D91225F3E7237A0F2B46 -:106A0000FAD8EAF7C1F90028EBD1606804F0A0F9E0 -:106A1000237A0246009307460B4620780E46DCF7A1 -:106A2000E3FC05460028E7D1237A3A460093207814 -:106A30003346DCF707FD002808BF0725D2E700BF73 -:106A40002050002137B5054602F0E6FC18B90C24A9 -:106A5000204603B030BD0F4BDB79002BF7D12B78EC -:106A6000012B15D82B7A0F2B12D8EAF78DF9044693 -:106A70000028ECD1686804F06BF90B46297A0246CD -:106A800000912878DCF7FCFC002808BF4224DFE7EF -:106A90001224DDE72050002110B502F0BDFC10B932 -:106AA0000C24204610BD064BDB79002BF8D1EAF709 -:106AB0006BF904460028F3D1DCF7BEFCF1E700BF18 -:106AC0002050002110B5044602F0A6FC20B1DCF7EE -:106AD000ADFC2070002010BD0C20FCE7014B83F8BA -:106AE000300070472050002110B5044602F088FCA9 -:106AF00038B1054B93F9300006F008FC20700020F7 -:106B000010BD0C20FCE700BF205000212DE9F74FFD -:106B10002D4C8946A16A15469DF83C2098464B06A7 -:106B200054BF0126032607469DF830A09DF838B0D3 -:106B3000019202F065FC78B164786CB9012D019A7C -:106B40000CD01F2F06D94F4504D8B9F5804F01D876 -:106B5000042D06D9112433E00C2431E04645F9D345 -:106B600006E04645F6D3042D02D018F0020F05D0FA -:106B70000D9B002BEED0BAF1010FEBD81BF0F80FF4 -:106B8000E8D1BBF1000FE5D0012D03D0042D01D0D9 -:106B9000032ADFD840F271214F4301FB09F10B4E6C -:106BA0000D98B760F160357486F8118086F812A0F0 -:106BB00086F820B086F8212004F0CAF8C6E906015C -:106BC000204603B0BDE8F08F205000214051002145 -:106BD00038B504460D4602F013FCA8B11F2C15D899 -:106BE00004F0D0F92246294609480AF0CFFB094BA8 -:106BF00083F84740012483F8484004F0CFF9204649 -:106C0000EBF71CFA002038BD0C20FCE71220FAE755 -:106C1000685100214051002138B504460D4602F06C -:106C2000EFFBA8B11F2C15D804F0ACF92946224679 -:106C300009480AF0ABFB0122084B83F8684083F84F -:106C4000692004F0ABF90220EBF7F8F9002038BD19 -:106C50000C20FCE71220FAE7895100214051002165 -:106C600038B5054602F0CCFB20B90C20BDE8384011 -:106C700002F016BB1D4C237C012B01D9042B07D13C -:106C80001B4B1C4A1B68127893F822309A42ECD0B6 -:106C9000012D1CD1607C02F09BFBC0B9237C032B2F -:106CA00013D1D4E90623A07CDCF74BFF68B10420A4 -:106CB00004F0B0F9014640B14FF4827343800E4BAB -:106CC000187BBDE8384004F0B6B91220CEE70420A6 -:106CD00004F0A0F9014638B10423002D837014BFDD -:106CE00001230223C370EAE738BD00BF40510021F1 -:106CF000DC4D00212050002168500021014B83F819 -:106D00007800704740510021ECF73EB811B1C0B295 -:106D1000ECF7FAB9EBF7CEB838B505460C4602F0F9 -:106D20007BFB002847D0EF2D47D8D4E901128A42D7 -:106D300020D323881D2B04D01F291BD921498A4227 -:106D400029D813F0100102D0B2F5804F23D823F0D8 -:106D50007F027AB903F01302032A0BD011B113F0AA -:106D6000600F07D19A0601D5980703D1A37D19B109 -:106D7000012B09D012201FE003F0FD02012AF9D1F6 -:106D8000227E013A022AF5D8227E022A05D10E4A35 -:106D9000926AD20513D411200EE0032B01D0032AEE -:106DA00003D1094B9B6A1B05F5D521462846BDE852 -:106DB0003840ECF7ADB80C2038BD3020FCE7032B91 -:106DC000EEE700BFC66D34002050002138B50546FF -:106DD0000C4602F021FB00284ED0EF2D4ED8D4E90E -:106DE00001128A4220D323881D2B04D01F291BD9CE -:106DF00024498A422AD813F0100102D0B2F5804FFC -:106E000024D823F07F027AB903F01302032A0BD0AF -:106E100011B113F0600F07D19A0601D5980703D17D -:106E2000A37D19B1012B09D0122026E003F0FD0249 -:106E3000012AF9D1227E013A022AF5D8217E124890 -:106E40000229D0E90A2003D1D10519D4112014E078 -:106E5000032B01D0032901D11205F7D5C30505D4B1 -:106E6000E37E002BF2D1237F002BEFD12146284671 -:106E7000BDE83840ECF74CB80C2038BD3020FCE7BA -:106E8000032BE8E7C66D34002050002181230B70EE -:106E9000EBF74CBF2DE9F041DDF8188004460D46B4 -:106EA00016461F4602F0B8FA48B13B46324629461C -:106EB0002046CDF81880BDE8F041ECF70CBF0C205F -:106EC000BDE8F0812DE9F041DDF8188004460D465B -:106ED00016461F4602F0A0FA48B13B463246294604 -:106EE0002046CDF81880BDE8F041ECF747BF0C20F4 -:106EF000BDE8F0812DE9F347454E0746B37A0C46CD -:106F000015461BB10C21002002F0A6FB0023F372F2 -:106F100002F082FA38B901230C21B37202B0BDE845 -:106F2000F04702F099BB062C33D804B98FBBA946B1 -:106F30004FF0000A544531D8002C46D0002F14BF22 -:106F40004FF001084FF0020800274FF00809DFF862 -:106F5000C4A00C2004F05EF8014690B10A222B7800 -:106F600080F80290038080F803806B88534343606D -:106F70002B790372B37A9AF80C000133B37204F0E0 -:106F80005AF80137BC4205F10605E2D802B0BDE867 -:106F9000F087012312210020B372BFE799F80000A7 -:106FA000EBF782FEC846014638B949463846EBF74A -:106FB00063FE09F10609014620B10123B37298F876 -:106FC0000000ABE70AF1010AB4E768460094ADF8A7 -:106FD0000440EBF7BBFE4FF402770546DFF8348040 -:106FE000A542D3D90C2004F015F8014668B11DF86C -:106FF000043047800380002343600372B37A98F81B -:107000000C000133B37204F016F80134E8E700BF56 -:10701000205000216850002110B5044602F0FCF910 -:1070200050B140F27262054B00201B681B8A9342EC -:1070300028BF1346238010BD0C20FCE7DC4D002147 -:1070400010B5044602F0E8F928B10020034B1B6894 -:107050001B7B237010BD0C20FCE700BFDC4D002122 -:1070600010B5044602F0D8F920B12046BDE8104022 -:10707000ECF7D8B90C2010BD08B502F0CDF918B165 -:10708000BDE80840ECF7E8B90C2008BD38B5054666 -:107090000C4602F0C1F968B1EF2D0DD82388628843 -:1070A0009A420BD3052B09D921462846BDE8384022 -:1070B000ECF734B80C2038BD3020FCE71220FAE79A -:1070C0002DE9F04104460D4616461F4602F0A4F98C -:1070D00058B1EF2C0CD8042D0CD83B46324629462B -:1070E0002046BDE8F041ECF769B80C20BDE8F0811E -:1070F0003020FBE71220F9E738B505460C4602F0D0 -:107100008BF928B90C212046BDE8384002F0DBBAE3 -:10711000EF2C01D93021F6E729462046BDE838405A -:10712000ECF72EB9ECF7C6B9ECF7D3B910B44C1E96 -:10713000012C05D8531E012B02D810BCECF7DFB987 -:10714000122010BC70470278EF2A16D84288B2F598 -:10715000706F12D20279012A0FD8427D1F2A0CD8F3 -:1071600043F6F671C28A0A3A92B28A4205D8037E81 -:10717000013B1E2B01D8EDF7A1BC30207047EDF785 -:107180003FBD000038B5254B04461B6893F83E20F0 -:1071900093F83F30002A14BF03220122002B03780A -:1071A00014BF04250025EF2B34D84078EF2831D8C0 -:1071B000A17801391E292DD86168194BA1F580717C -:1071C000994227D82389B3F5805F23D240F69B717B -:1071D0006389053B9BB28B421CD8237B0F2B19D8AC -:1071E000617B42EA050331EA030311D191B1A37B2C -:1071F000012B0FD8E37B012B0CD8237C012B09D862 -:10720000EBF78DFD40B12046BDE83840EEF7ECB815 -:10721000112038BD1220FCE74220FAE7DC4D0021A6 -:10722000FFFE0F002DE9F041454B04469B691B0210 -:1072300003784CBF02220422EF2B7CD84078EF2841 -:1072400079D8A378013B1E2B75D866683D4BA6F50F -:10725000807199426FD8238B93426CD3B3F5486FFA -:1072600069D8A17E4A1E1E2A65D8A28BB2F5805F1E -:1072700061D2E78B7A1EFA2A5DD894F82020002A82 -:1072800059D094F82120012A55D894F822E0BEF173 -:10729000010F50D894F823506A1E062A4BD894F850 -:1072A000242002F1FF3CBCF10E0F44D894F825C015 -:1072B000BCF10F0F3FD894F82680B8F1010F3AD8EF -:1072C000BEF1000F08D140F2E24E0EFB03F3B3FB18 -:1072D000F6FE06FB1E3373BBBCF1000F02D011207B -:1072E000BDE8F081072DFAD00829F8D8164E33688A -:1072F000DB8DBB42F3D3042AF1D86A439142EEDB23 -:10730000EBF75EFAC8B1326892F83E3092F83F204F -:10731000002B14BF03230123002A14BF04220022E0 -:10732000134394F8202032EA0303D8D12046BDE865 -:10733000F041EEF76BB93020D2E74220D0E700BF32 -:1073400020500021FFFE0F00DC4D0021EEF728BA8F -:107350002DE9F041027D0446531E0F2B0E4602D943 -:107360001220BDE8F081654B1B6893F835309342DD -:10737000C0F0C280012300211D460A2791422DD36F -:107380002178EF29ECD861680DB9FE29E8D9B1F56B -:10739000801FE5D2A1680BB9FE29E1D9B1F5801FA4 -:1073A000DED2237B072BDBD8637B012BD8D8A37BD2 -:1073B000012BD5D800210F20A3691D78EF2DCFD840 -:1073C0005F88B7F5805FCBD29D88B5F5805FC7D267 -:1073D0003D43C5D09D7985B91120C2E7A06907FB5F -:1073E0000100B0F802C08088BCF1000F18BF002572 -:1073F000002818BF00230131C0E7DD79002DEBD054 -:107400001D7A01310F2D5D7A88BF18720F2D88BF4C -:1074100058728A4203F10A03CFD800274FF00A08B6 -:10742000227D97421AD300210A208A422FD140F6AA -:107430009B71238A053B9BB28B4291D8638A053BA3 -:107440009BB28B428CD800213046520009F0C5FF18 -:1074500031462046BDE8F041F0F7D6B8A56908FBF3 -:107460000755E979A87901F097FC0028B4D0A979EB -:1074700011F0F80FB0D1EB794A1E0A40591E19409D -:107480000A4323F007031343A6D10137C8E7A769CE -:1074900000FB01777D8845B1BB79022B1AD0042B04 -:1074A0001BD0012B1DD10A35ED00BB8843B1BF793C -:1074B000022F18D0042F19D0012F1BD10A33DB0063 -:1074C0006768AF42FFF44CAFA5689D42FFF448AF38 -:1074D0000131AAE70B35AD00E7E7AD0105F53475DD -:1074E000E3E70025E1E70B339B00E9E79B0103F5A8 -:1074F0003473E5E70023E3E7092032E7DC4D0021A0 -:107500002DE9F0410E460446C27C0021520030466F -:1075100009F063FF484B9B691B0223784CBF022292 -:107520000422EF2B00F2818063684449FF3B8B42C9 -:107530007BD8A368FF3B8B4277D8237B013B1E2B74 -:1075400073D8637B013B1E2B6FD8E38993426CD3C6 -:10755000B3F5486F69D8237C072B66D8637C012B71 -:1075600063D8A37C012B60D8E07C431E0F2B5CD832 -:1075700062690021134640F6FB751F78EF2F54D83F -:107580005F88B7F5805F50D29F88B7F5805F4CD297 -:10759000DF88AF4249D81F89AF4246D89F7A002F73 -:1075A00043D0DF7A002F40D01F7B0F2F3DD85F7B69 -:1075B0000F2F3AD80131814203F10E03DDD3537806 -:1075C000117B994231D8527B9A422ED800274FF036 -:1075D0000E08E17C8F4209D300220E20914217D180 -:1075E00031462046BDE8F041F0F78EB9656908FBE9 -:1075F0000755E97AA87A01F0CFFBC8B1AB7A13F04E -:10760000F80F15D1EB7A13F0F80F11D10137E0E73D -:10761000636900FB02331D7B0DB15D8855B15D7B55 -:107620000DB19B8833B10132D8E73020BDE8F0813D -:107630001120FBE71220F9E72050002100FF0F0086 -:107640001C4B2DE9F041DB6A0646DB070C4625D4CE -:107650000C20BDE8F0812268D15B32F81320914202 -:1076600026D001339D42F6D16368D85BD8F800304C -:1076700093F82230834201D80220EAE7F1F7A8F913 -:107680000028F9D06368D85BF1F7C6F90028DFD18C -:107690000135AE4206D900236F00E3E70025DFF88D -:1076A0001880F6E721463046BDE8F041F0F710BA01 -:1076B0001220CEE720500021DC4D0021F0F7D0B899 -:1076C000F0F7BCBCF0F78CBC38B504460D4603F0AF -:1076D00059FC0C4B1B6893F82230A34206D87F2339 -:1076E00002242B7003F05AFC204638BD2046F1F7E7 -:1076F0006FF90028F3D02046F1F798F9002428709C -:10770000F0E700BFDC4D002170B506460C4615467B -:1077100003F038FC104B1B6893F82230B34206D8B4 -:10772000E22302242B7003F039FC204670BD304662 -:10773000F1F74EF90028F3D0012C03D9E2231224EB -:107740002B70F0E724B93046F1F77CF92870EAE7AE -:10775000142300242B70E6E7DC4D002138B50446E5 -:107760000D4603F00FFC0B4B1B6893F82230A3422D -:1077700004D8022403F012FC204638BD2046F1F75D -:1077800027F90028F5D020462946F1F709FC002406 -:10779000F0E700BFDC4D002170B504460E461546EB -:1077A00003F0F0FB0D4B1B6893F82230A34204D882 -:1077B000022403F0F3FB204670BD2046F1F708F9E0 -:1077C0000028F5D0042D06D820462A463146F1F788 -:1077D00041FC0024EDE71224EBE700BFDC4D002163 -:1077E00038B505460C4603F0CDFB0E4B1B6893F8ED -:1077F0002230AB4204D8022403F0D0FB204638BD2F -:107800002846F1F7E5F80028F5D02846F1F726F9E3 -:10781000030A20706370030C000EA370E0702171E6 -:107820000024E9E7DC4D002173B51D46104B0446EA -:107830001B68164693F82230834202D8022002B019 -:1078400070BDF1F7C5F80028F8D00A4B25F0784252 -:107850003340134309D19DF8183020460093324637 -:107860002B46F0F74BFE0020E9E71220E7E700BFC8 -:10787000DC4D002141FBF7FFF8B52A4E0446336882 -:107880000F4693F8222093F835301344984202DBD8 -:1078900002252846F8BD824218D9F1F799F8002848 -:1078A000F6D03368062093F82230A3422DD903F096 -:1078B000B1FB0146C0B141F20173048043800771FE -:1078C000C480194B187B03F0B6FB0DE0F1F78AF882 -:1078D00005460028E5D12046F1F796F800B30820C8 -:1078E00003F098FB064608B90025D2E72046F1F7D9 -:1078F00081F842F2017373800B4B3080F480377152 -:107900003146187B03F097FBC3E703F083FB014686 -:107910000028E9D041F20F73048043800771D0E75B -:107920000C25B6E7DC4D00216850002170B51D4BD9 -:1079300006461B680D4693F82230834202D8022483 -:10794000204670BDF1F744F80028F8D015213046E4 -:10795000F0F77EFD012801D10C24F1E73046F1F764 -:107960005BF8012803D1104B9B6A9B07F4D528468E -:10797000F0F744FD04460028E2D1102003F04AFB52 -:1079800001460028DCD041F2015343802B68068079 -:1079900043606B688360AB68C360044B187B03F083 -:1079A0004AFBCDE7DC4D002120500021685000212A -:1079B00070B5184B06461B680D4693F8223083427B -:1079C00002D80224204670BDF1F702F80028F8D052 -:1079D00001213046F1F796F8D0B12846F0F70EFDB8 -:1079E00004460028EED1102003F014FB01460028C5 -:1079F000E8D041F6015343802B68068043606B68F2 -:107A00008360AB68C360044B187B03F014FBD9E7B9 -:107A10000C24D7E7DC4D00216850002138B5134B0A -:107A200004461B680D4693F82230834201D8022099 -:107A300038BDF0F7CDFF0028F9D001212046F1F73D -:107A400061F880B1062003F0E5FA01460028EFD086 -:107A500041F601634380064B04800571187B03F0F7 -:107A6000EAFA0020E4E70C20E2E700BFDC4D002149 -:107A70006850002110B5124B04461B6893F8223061 -:107A8000834201D8022010BDF0F7A2FF0028F9D0F0 -:107A90001C212046F0F7DCFC01280FD0042003F065 -:107AA000B9FA01460028EED041F601434380054B68 -:107AB0000480187B03F0BFFA0020E4E70C20E2E723 -:107AC000DC4D002168500021F8B51E4F05463B688B -:107AD0000E4693F822301446834201D80220F8BDA6 -:107AE000F0F776FF0028F9D01F212846F0F7B0FC08 -:107AF000012822D0A6F11B03E02B20D8B4F5A47FE7 -:107B00001DD33B681B79082B94BF40F6480344F211 -:107B100090239C4213D8082003F07CFA01460028E9 -:107B2000DDD041F601734380074B05808680C48019 -:107B3000187B03F080FA0020D1E70C20CFE7122059 -:107B4000CDE700BFDC4D002168500021024B5A8870 -:107B500002809B880B807047B4500021A0F11B036A -:107B6000E02B18D8B1F5A47F15D30D4B1B681A79FB -:107B7000082A94BF40F6480244F2902291420AD863 -:107B8000DB8CFB2B28BFFB23834206D3054B58809D -:107B9000998000207047302070471120704700BF47 -:107BA000DC4D0021B450002110B5074C2468E48C52 -:107BB000FB2C28BFFB2404800E34E4000C800088DA -:107BC00010800A881A8010BDDC4D00212DE9F84391 -:107BD000284B15469A6A0446D70302D40C20BDE808 -:107BE000F883421E062A42D8AA1E232A3FD800271D -:107BF000C60744BF83F8411083F84450A00744BF30 -:107C000083F8421083F84550DFF86C806207DFF894 -:107C10006C9044BF83F8431083F84650D8F8003086 -:107C2000BEB293F82230B34201D80020D7E73046E5 -:107C3000F0F7CEFEC8B13046F0F7EEFE012814D1C1 -:107C400021213046F0F704FC0128C7D0062003F0BC -:107C5000E1F9014648B142F2011306804380047104 -:107C6000457199F80C0003F0E6F90137D6E71220C8 -:107C7000B5E700BF20500021DC4D002168500021F5 -:107C800070B505460E4603F07DF9104B1B6893F85E -:107C90002230AB4204D8022403F080F9204670BDA4 -:107CA0002846F0F795FE0028F5D0094B9B6ADB03C8 -:107CB00001D40C24F0E72846F0F7AEFE0446002875 -:107CC000F7D131462846F0F70BFFE5E7DC4D002100 -:107CD00020500021014B1B68D88C7047DC4D0021DF -:107CE000024B1B6893F82300704700BFDC4D002156 -:107CF000034B1B780BB903F095B9F0F7DBBD00BF60 -:107D0000B4500021F0F744BEF0F760BE10B5134B3D -:107D100004461B6893F82230834201D8022010BD2C -:107D2000F0F756FE0028F9D02046F0F7A3FE4301F5 -:107D300011D5062003F06EF901460028EFD042F27B -:107D40000133438002230371054B0480187B03F049 -:107D500072F90020E3E71A20E1E700BFDC4D0021C3 -:107D60006850002101282DE9F843054635D8F1F780 -:107D700075F8044648B91A4A012D92F8403014BFEC -:107D8000013303F1FF3382F840300027DFF85480DD -:107D9000DFF85490D8F80030BEB293F82230B342E6 -:107DA00002D82046BDE8F8833046F0F711FE90B1C6 -:107DB0003046F0F75FFE43010DD5062003F02AF9A7 -:107DC000014640B142F2013306804380057199F8C3 -:107DD0000C0003F030F90137DCE71224E1E700BFC3 -:107DE00020500021DC4D002168500021F8B50E46DE -:107DF00016210546F0F72CFB012802D10C24204661 -:107E0000F8BD1A4B1B6893F82230AB4201D802240C -:107E1000F5E72846F0F7DCFD0028F8D02846F0F713 -:107E2000FBFD04460028E9D1304602F07EFF104BEE -:107E3000D3E90E7607400E403846314601F0F7F997 -:107E4000012810D9102003F0E5F801460028D6D00B -:107E500041F20163C0E902764380064B0580187B3E -:107E600003F0E9F8CBE71224C9E700BFDC4D00219D -:107E700020500021685000212DE9F843304B044682 -:107E80009B6A0F465B0654BF0125032501F0B8FA33 -:107E9000002851D02288B2F5804F03D912263046EF -:107EA000BDE8F88363889A42F8D3032BF6D9237987 -:107EB000012BF3D813B9A379AB42EFD86379AB4266 -:107EC000ECD83846F0F79AFA0028E7D1607901F04B -:107ED0007FFA0028E2D0A06802F03AFF024681460D -:107EE0000B46A0798846F1F765F9064630BB282095 -:107EF00003F090F805460028D1D040F203134380E8 -:107F0000796800F1040C38682388ACE80300B8688D -:107F10002946CCF800002B8263886B8263796B75ED -:107F20002379AB75A379C5E9069885F82030054B10 -:107F3000187B03F080F8B2E70C26B0E70B26AEE71B -:107F40002050002168500021042008B503F062F899 -:107F5000014678B1084B93F83330002B14BF092346 -:107F6000032383700223C370044B187BBDE80840D1 -:107F700003F061B808BD00BF205000216850002107 -:107F80000C4A08B5926A0346520654BF01220322E6 -:107F9000407890420BD89978914208D81B78012BF1 -:107FA00005D801F015FA003818BF012008BD0020DF -:107FB000FCE700BF20500021438802889A4204D386 -:107FC000032B94BF00200120704700207047000061 -:107FD0002DE9F84F04468946007A0021164601F043 -:107FE00026F9DFF868810546D8F828A001F014FAD0 -:107FF000002800F0A68098F80470002F40F0A180BF -:108000004FEADA134FEA5A2A03F002030AF0040A8D -:10801000227A43EA0A0343F0010332EA030340F001 -:1080200092801AB912273846BDE8F88F2046FFF72C -:10803000A7FF0028F6D0BA464FF00C0B554555D88F -:108040004FF0000A88F80CA0257A15F001055CD0E5 -:108050005046F2F73FFD98F80C303246013349465E -:10806000504688F80C300125F2F748FD217A11F0CE -:10807000020153D00C22002102FB05620120F2F71D -:108080003DFD0135217A022011F0040A4BD0F2F7B0 -:1080900021FD0C2298F80C3002FB0562013388F8B0 -:1080A0000C3009EB85010220F2F728FD606802F030 -:1080B0004FFE237806460D46002B39D0182002F0DB -:1080C000A9FF01460028AED040F20913438023786F -:1080D000037163784371A378C0E902658371237AE1 -:1080E00003741B4B187B02F0A6FF9CE70BFB0A6096 -:1080F000F0F784F9002895D109EB8A00FFF75CFFBF -:1081000000288FD00AF1010A98E72846F2F7ECFC24 -:10811000324629462846F2F7F1FCA7E7324601200D -:10812000F2F7ECFCAEE7F2F7DFFC32465146BAE775 -:1081300002460B46A078F1F73DF80028BED00B2789 -:1081400071E70C276FE711276DE700BF2050002172 -:108150006850002110B51B210446F0F779F9012879 -:108160000FD12046F0F734FC08B90C2010BD204692 -:10817000F0F790F90028F8D02046F0F79BF900209E -:10818000F4E70E4B1B6893F82230A34201D802207B -:10819000ECE72046F0F71CFC0028F8D0042002F0A1 -:1081A00039FF01460028E1D041F601334380044BFA -:1081B0000480187B02F03FFFE1E700BFDC4D0021A7 -:1081C000685000211D4B30B59A88C46A0132588826 -:1081D00092B29A8008B182422ED201292CD018780E -:1081E000012829D193F8C2116278914224D1D4F8A0 -:1081F0009C1093F8C1510A7822F0200295421BD1BD -:1082000093F8C0514A78954216D193F8C311227B56 -:10821000914211D1D3F8D021D3F8CC1100FA02F554 -:10822000013202F01F02C3F8D021054A0D42054B6E -:1082300018BF1346A36030BD0020FCE7F04D0021BD -:1082400055555500AAAAAA0010B50F4B29B104290B -:1082500014D05A8901325A8102E0DA880132DA8078 -:108260005988DA881C89588919B1224402449142FC -:1082700008D91878831E5842584110BD1A89013216 -:108280001A81EDE70020F8E7F04D00214FF40A7263 -:108290000021014809F0A1B8F04D00210346104625 -:1082A00010B400F8021B5370072922D8DFE801F050 -:1082B0002B0409210C0F12151A460F2110BC09F0CE -:1082C0008CB81A465521F9E71A46FF21F6E71A46F7 -:1082D0000021F3E71A46F021F0E71A46AA21EDE75C -:1082E000092400F8012B013C05D1013BDBB2FF2B37 -:1082F000F6D110BC704782EA1211090201F48071B4 -:1083000041EA5202EFE740F2FF12EEE7022916D0EF -:10831000032917D10530012A0BBF0001800100F5A8 -:10832000BF7000F5C870094A00F26930A0FB020274 -:10833000830F40F2712043EA8203584370470B30A9 -:108340008000F0E70A30C000EDE700BFE3361A0016 -:1083500050B10B2802D80138C0B270470C2805D0A4 -:10836000262805D80238F7E72520704726207047D1 -:10837000272070472DE9F3477D4C05462378012BD4 -:108380000DD87C4F3A6852B93A7942B9012B0AD1DB -:10839000027994F8C131032A03D1032B03D00C26B0 -:1083A00005E0032BFBD0AB78272B04D930263046D1 -:1083B00002B0BDE8F0872B79072BF7D86B795A1EEE -:1083C000032AF3D8022B08D0033B012B09D8BB6A40 -:1083D00013F4006F05D11126E9E7BB6A13F4807F1F -:1083E000F8E7AE79002EF6D10DF106000DF1070188 -:1083F00004F056FF95F910007E2816D07F2817D17B -:108400009DF807302B74237813B95B4A636053607F -:10841000287903281DD1012584F8C101257001F0B8 -:108420001DFF3D7200F0A4FFC1E79DF80630E9E7AB -:1084300000F17E03DBB2922BB8D89DF9073083425E -:10844000C9DB9DF906308342C5DC04F05FFF287468 -:10845000D9E702F097FDEB78002284F8C0312B7940 -:1084600084F8C131A878FFF773FF84F8C2016B79F3 -:10847000013B032B08D8DFE803F0026B746D012386 -:1084800084F8C331A4F8C4212B7C4FF0000984F890 -:10849000D4314FF0FF33C4E9733902F07FFD237804 -:1084A000012B84D049462C22344808F096FF40F234 -:1084B000011A49464FF00209DFF8C4804FF4C07238 -:1084C000404608F08AFF2B882E4A63802E4B94F892 -:1084D000C311A36294F8C23194F8C00184F841300A -:1084E0002A4B84F84D10C4E9112394F8D43194F840 -:1084F000C42184F84230264B84F84E2084F84C1076 -:10850000C4F8D830C4F8388084F82690A4F8E0A0E5 -:10851000FFF7FCFEA4F8E200504602F0E9FC024638 -:10852000C4F8DC0010B32979E878FFF7B7FEB4F897 -:10853000E230C4F8C831012323703B7200F018FF09 -:10854000484601F08BFEA8F1340002F075F82EE7E2 -:10855000022395E7032384F8C3310123A4F8C4312F -:1085600092E7032384F8C3310223F7E71F261EE7AF -:10857000F04D002120500021F44D0021FC4D002140 -:10858000304E0021294176711D8702015555550055 -:10859000C58102012DE9F041404F06463B68002BA2 -:1085A00076D13F4C3B792278134371D18378272BC6 -:1085B00070D8C3785A1E022A6CD80279012A69D869 -:1085C000022B5BD0032B5FD07579002D5AD12C2262 -:1085D0002946344808F001FF334B4FF4C072184667 -:1085E000294608F0FAFE3388A0636380022384F8EA -:1085F00026302E4B2E4AA362012384F84030B078F7 -:10860000FFF7A6FE2B4B84F84100C4E91123F37851 -:10861000022B03D0032B01D0012B01D184F84D3064 -:108620004FF47A7240F2011094F84D3084F84C30D7 -:10863000214B1B689B8FA4F8E4005343C4F8D83047 -:108640001E4BC4F8DC3002F053FCC4F8E00018B351 -:1086500001234FF002083B7284F8008000F088FE8E -:108660000023174E40466360736001F0F7FD06F18A -:10867000080001F0E1FF2846BDE8F081BB6A13F471 -:10868000807FA1D11125F6E7BB6A13F4006FF8E7EC -:108690000C25F0E73025EEE71F25ECE72050002100 -:1086A000F04D0021FC4D0021304E002109880201CF -:1086B0002941767155555500DC4D00214982020152 -:1086C000F44D002138B5124D04462B78012B0DD105 -:1086D00095F8C10103280DD1002401F0D5FD0D4B03 -:1086E0002C701C7200F04CFE204638BD022B0DD1C0 -:1086F00001F01AFE0323084A2B701CB1134603CB6A -:1087000020606160002068605060EEE70C20ECE7BC -:10871000F04D002120500021F44D00212DE9F041C1 -:10872000364C0746A388628801339BB2C56AA38092 -:1087300022B1934202D30020FFF7C4FF2378D5F87B -:108740009C60012B3AD194F8C2216B78934215D1E9 -:10875000337894F8C11123F0200399420ED194F894 -:10876000C0117378994209D194F8C3112B7B9942B7 -:1087700004D1B4F8C411AB7B99421AD000236A70BB -:1087800094F8C3116973297394F8C421EB73AA7325 -:1087900094F8C08108F102034046A5F8A030FFF725 -:1087A000B5FDA5F8A2003246404694F8C111FFF786 -:1087B00075FD3846BDE8F04101F03EBF304602F09D -:1087C000BDFB022001F060FD207804280CD102F0EE -:1087D00021FC014680B140F205134380084BBDE8FF -:1087E000F041187B02F027BC0023064A2370137265 -:1087F000BDE8F04100F0C4BDBDE8F081F04D0021BE -:10880000685000212050002170B51F4C0546628839 -:10881000C66A4AB12189E3880B4461890B449A42B4 -:1088200002D80020FFF74EFF2378022B04D1284600 -:10883000BDE8704001F000BFD6F8A00002F07EFB5A -:10884000D4F8240220B102F0EDFB0023C4F8243256 -:10885000022001F019FD207804280CD102F0DAFB87 -:10886000014680B140F205134380084BBDE87040DB -:10887000187B02F0E0BB0023054A23701372BDE8A9 -:10888000704000F07DBD70BDF04D002168500021AA -:108890002050002108B5C07810B101280DD008BDC6 -:1088A0000A4B1B7A002BFAD0FFF70CFF084B1A7803 -:1088B000032AF4D104221A70F1E70023044A13704A -:1088C000024A1372BDE8084000F05ABD2050002152 -:1088D000F04D0021024BC3F8CC010020704700BFCF -:1088E000F04D002108B5FFF7D1FC054B054A5A6150 -:1088F000054B064A5A61BDE80840DBF717BA00BFCE -:10890000040D00218D820201B00C00219588020126 -:108910002DE9F0410F461821044690461D46EFF719 -:1089200097FD012803D10C263046BDE8F081204692 -:10893000F0F7ECFA0128F6D0194B1B6893F82230B7 -:10894000A34201D80226EFE72046F0F741F80028BD -:10895000F8D02046F0F760F806460028E3D11E2044 -:1089600002F058FB01460028DED041F601030480E6 -:1089700043803B6800F10E0243607B68A0F80C80E6 -:1089800083602B4605F1100053F8044B834242F8F4 -:10899000044BF9D1034B187B02F04DFBC4E700BF39 -:1089A000DC4D00216850002108B50A4604F0E8F9C2 -:1089B000002008BD38B51A4B05461B680C4693F8D5 -:1089C0002230834201D8022038BDF0F701F8002898 -:1089D000F9D02846F0F720F8012801D00C20F3E761 -:1089E00002212846F0F78EF80028F7D0142002F074 -:1089F00011FB01460028E7D041F6011343802346CE -:108A00000580021D04F1100053F8044B834242F824 -:108A1000044BF9D1034B187B02F00DFB0020D3E788 -:108A2000DC4D00216850002110B5154B04461B6831 -:108A300093F82230834201D8022010BDEFF7C8FF1F -:108A40000028F9D02046EFF7E7FF012801D00C20DD -:108A5000F3E702212046F0F755F80028F7D004206C -:108A600002F0D8FA01460028E7D041F601234380FE -:108A7000044B0480187B02F0DEFA0020DDE700BF23 -:108A8000DC4D00216850002138B50D4B04461B68B1 -:108A90000D4693F82230834201D8022038BDEFF70B -:108AA00097FF0028F9D02046F1F74AFC054BA0FBC0 -:108AB0000303800D40EA832028800020EEE700BFFA -:108AC000DC4D00216766060038B50D4B04461B6877 -:108AD0000D4693F82230834201D8022038BDEFF7CB -:108AE00077FF0028F9D04DB10A2120466943F1F7FC -:108AF00033FC002814BF00201E20EFE71220EDE712 -:108B0000DC4D002138B50B4B04461B680D4693F82D -:108B10002230834201D8022038BDEFF759FF0028E8 -:108B2000F9D029462046EFF7D5FC002814BF0020D5 -:108B30000C20F1E7DC4D0021014B1B68988D70473C -:108B4000DC4D0021024B1B6893F82A00704700BFE0 -:108B5000DC4D0021F2F7FABC38B504460D46F2F7B9 -:108B60001BFD28B129462046BDE83840FEF7ACBDC4 -:108B700038BD0000034B1B780BB902F053BAF2F773 -:108B800067BA00BFDC500021F2F7FCBAF2F73EBB37 -:108B9000F2F73EBBF2F7A3BBF2F724BEF2F7A8BB95 -:108BA000F2F726BCF2F757BC08B5F2F776FC0020C6 -:108BB00008BDF2F79BBCF2F7A1BE4BF23F52431E39 -:108BC0009BB2934201D8F2F7A3BE12207047000077 -:108BD00038B504460D4600F01FFCA0B1B4F5706F27 -:108BE00013D22046E9F7E8F888B10B4B5B6ADB0645 -:108BF00003D405F00303032B0BD020462946E9F7E5 -:108C0000C1F9002038BD0C20FCE71220FAE7422011 -:108C1000F8E71120F6E700BF6850002170B5044660 -:108C20000D46164600F0F8FB30B132462946204684 -:108C3000BDE87040F3F7EEBB0C2070BD70B5044684 -:108C40000D46164600F0E8FB30B132462946204674 -:108C5000BDE87040F3F72ABC0C2070BD2DE9F0414F -:108C600007460C4615461E469DF8188000F0D4FBBA -:108C7000D8B1032C1ED8104B5B6ADB0601D4032C41 -:108C800016D0B5F5FA7F15D243F6F672A6F10A03AF -:108C90009BB293420ED833462A4621463846CDF839 -:108CA0001880BDE8F041F3F745BC0C20BDE8F08129 -:108CB0001120FBE71220F9E76850002170B5044647 -:108CC0000E46154600F0A8FBB8B1032C19D80E4B80 -:108CD0005B6ADB0601D4032C11D0B6F5FA7F10D203 -:108CE00043F6F672A5F10A039BB2934209D800201D -:108CF000064BDC751E835D8370BD0C20FCE71120E4 -:108D0000FAE71220F8E700BF68500021B4500021B4 -:108D100030B541EA020424F0070420F003052C4397 -:108D200008D1022B06D80D4B9B691C0604D518B937 -:108D300091420ED0112009E000F001030B430AD04C -:108D4000830704D4002A14BF0020122030BD002065 -:108D5000FCE70029F6D11220F8E700BF20500021DF -:108D600070B50C4B04461B680E4693F8223015462E -:108D7000834201D8022070BDEFF72AFE0028F9D007 -:108D80002046EFF783FE30702046EFF78BFE287009 -:108D90000020F0E7DC4D00210B4B10B59A6AD4059A -:108DA00002F4807303D440EA0104A40707D4130536 -:108DB00007D4084380F00400C0F3800010BD1846BB -:108DC000FCE70120FAE700BF2050002170B50D46F6 -:108DD0000646114628461446FFF7DEFF98B10023E9 -:108DE000224629463046FFF793FF58B916F0010F87 -:108DF00018BF002516F0020F18BF0024034B1E7584 -:108E00005D759C7570BD1120FCE700BFB45000215A -:108E10002DE9F8431D46244B80461B680F4693F806 -:108E2000223016468342BDF8209003D80224204603 -:108E3000BDE8F883EFF7CCFD0028F7D020214046AD -:108E4000EFF706FB01282AD029463046FFF7A4FF9A -:108E500038B34B462A4631463846FFF759FF044699 -:108E60000028E4D117F0010F18BF00260A2017F0E0 -:108E7000020F18BF002502F0CDF801460028D6D019 -:108E800042F201034380094BA0F80080077146714C -:108E90008571A0F80890187B02F0CDF8C7E70C2484 -:108EA000C5E71124C3E700BFDC4D00216850002155 -:108EB00001282DE9F34104460D4616461F4627D8E2 -:108EC000DFF85080D8F8003033F0FF0304D098F872 -:108ED000313043B10C2014E098F80430002BF6D167 -:108EE0000D4B1B6883B9284601F032FFCDE90067BE -:108EF00002460B462046DAF78DFB002814BF0020FF -:108F0000072002B0BDE8F08198470028DFD1EAE7EA -:108F10001220F6E7205000211C500021012870B5D6 -:108F200004460D4618D8104E336833F0FF0304D0C2 -:108F300096F831303BB10C200FE03379002BF7D19C -:108F40000A4B1B6853B9284601F002FF02460B4644 -:108F50002046DAF7CBFB28B9122070BD98470028CD -:108F6000E6D1F0E70020F8E7205000211C50002156 -:108F700010B50C4C236833F0FF0304D094F8313063 -:108F80003BB10C2008E02379002BF7D1064B1B687E -:108F90001BB9DAF739FB002010BD98470028EDD146 -:108FA000F7E700BF205000211C50002110B50446F7 -:108FB000DAF724FB2070002010BD30B50446012CE8 -:108FC0000846154685B015D801F0C2FE02460B468C -:108FD00000200021CDE9020102A920460091DAF724 -:108FE000B3FB48B1DDE90223284601F0B7FE0020BB -:108FF00005B030BD1220FBE70220F9E730B504468A -:10900000012C0846154685B015D801F0A1FE024690 -:109010000B4600200021CDE9020102A92046009163 -:10902000DAF7A1FB48B1DDE90223284601F096FEFC -:10903000002005B030BD1220FBE70220F9E7000058 -:10904000012870B5054614D80B4E336833F0FF0382 -:1090500002D00C24204670BD3479002CF9D1074B86 -:109060001B6813B986F83150F4E798470028F9D007 -:10907000EFE71224EEE700BF205000211C50002132 -:109080004AF2B71208B5431E9BB2934203D8F3F7D6 -:109090000FFB002008BD1220FCE700000128F7B5F7 -:1090A00004460E46154624D8012A22D8124F3B68A2 -:1090B00033F0FF0304D097F831303BB10C2012E0BD -:1090C0003B79002BF7D10D4B1B6873B9304601F08B -:1090D0003FFE009502460B462046DAF721FB0028AA -:1090E00014BF0020022003B0F0BD98470028E2D151 -:1090F000ECE71220F7E700BF205000211C500021B0 -:10910000F3F77CBC0B46024670B598B008AD00F191 -:1091100020062C4610685168083203C4B242254626 -:10912000F7D110AC03F120052246186859680833BE -:1091300003C2AB421446F7D16A461546084B03F109 -:109140002006144618685968083303C4B3422246FF -:10915000F7D1294608A8F3F767FC18B070BD00BF27 -:109160001851002170B5012A0B4698B004D118B0EF -:10917000BDE87040F3F780BC024608AD00F1200660 -:109180002C4610685168083203C4B2422546F7D114 -:1091900010AC03F12005224618685968083303C251 -:1091A000AB421446F7D16A461546084B03F1200638 -:1091B000144618685968083303C4B3422246F7D1ED -:1091C000294608A8F3F730FC18B070BD18510021EB -:1091D00010B5431E00F11F0113F8012F32B98B4265 -:1091E000FAD1094B83F82120002010BD064B00F175 -:1091F00020011A4650F8044B884243F8044BF9D139 -:10920000012382F82130EFE718510021012801D80D -:10921000F3F766BC1220704710B5044601F0BCFDA0 -:109220002046BDE8104001F0D1BD01F0E1BD43088A -:109230004A0803F05533C01A02F0553261EB0201BF -:1092400000F03333800801F0333200F03330890806 -:10925000181801F0333142EB01024FF001310309DC -:1092600043EA02731B1842EB121003F00F3300F0B5 -:109270000F301844A3FB013200FB0120000E7047A1 -:10928000B0FBF1F0704701380844B0FBF1F07047D3 -:10929000024B1B6803B118471846704768500021FD -:1092A000002307B5ADF8043003238DF8070001A8AB -:1092B0008DF80630FFF7ECFF03B05DF804FB0023E8 -:1092C00007B5ADF8043004238DF807000DEB03005B -:1092D0008DF80630FFF7DCFF03B05DF804FB1FB527 -:1092E0001C24ADF804008DF8090001A88DF8064093 -:1092F0008DF807108DF80810ADF80A208DF80C30A5 -:10930000FFF7C6FF04B010BD030203F00F3300F0F7 -:10931000F0300343180100F0333003F0CC3318432E -:10932000830003F0553300F0AA301843C00970479A -:1093300008B50D4B48220021184608F04EF80346A8 -:109340000A4AD2E90801C3E90A0105A1D1E90001ED -:10935000C3E906014FF0FF301F21C3E90E0108BD2C -:10936000405C4600000000FE2050002168500021B3 -:10937000024A537A01335372704700BF20500021D4 -:10938000024A537A013B5372704700BF20500021BC -:10939000024A937901339371704700BF2050002136 -:1093A000024A9379013B9371704700BF205000211E -:1093B000024AD3790133D371704700BF2050002196 -:1093C000024AD379013BD371704700BF205000217E -:1093D000032806D8013802280ED8DFE800F0070D70 -:1093E0000700A0F1FF03584258417047034B587CD7 -:1093F000003818BF0120704701207047205000211D -:10940000044B93F833201AB9012083F832007047D7 -:109410000020704720500021044B93F832201AB9E5 -:10942000012083F83300704700207047205000214E -:1094300000221346F0B5D0E90076C3F12005A3F170 -:10944000200427FA03F106FA05F5294326FA04F465 -:109450002143C90744BF81180B7203F1010348BFC0 -:109460000132252BE9D180F82D20F0BD028EF8B510 -:10947000044682EA01001D46FFF746FF00EB00109C -:10948000104480B2FFF740FF00EB0010104480B2A0 -:10949000FFF73AFFD4E9003700EB0010111889B24A -:1094A000618651404DF668524A43520D02EBC200AC -:1094B00002EB80028A1A92B2C2F12006A2F12000C9 -:1094C000D34007FA06F6334327FA00F00343DB07DD -:1094D00009D494F82D305943090C0DB184F8341097 -:1094E0002144087AF8BD45B1002304F1080111F8C0 -:1094F000010B904203D184F83430D0B2F2E701334B -:10950000252BF4D1F9E738B5024690F83410408E97 -:10951000FFF7FAFE138E00EB001092F82D5018445E -:1095200080B283EA0004A5F10A035B100B2BA8BFED -:109530000B23082D50868CBF0320681F012BB8BF5A -:1095400001238342B8BF0346A5EB430000FB04445C -:10955000C81800EB244080B2B0FBF5F305FB130004 -:1095600082F834001044007A38BD000007B50E4A76 -:10957000937B0BB900B19073537B8BB1013BDBB292 -:1095800053736BB90093ADF8043018238DF8023093 -:10959000937B68468DF803308DF80430FFF778FE32 -:1095A00003B05DF804FB00BF20500021002307B585 -:1095B0000193192301A88DF80630FFF769FE03B067 -:1095C0005DF804FB4FF4B8130360FFF761BE4FF47E -:1095D00000130360FFF75CBEF0B589B01446074680 -:1095E0000E461A22002101A81D4607F0F6FE1E2392 -:1095F0008DF8063023888DF80870ADF80C30237A8A -:10960000ADF80A608DF814306389ADF81630237B0D -:109610008DF8183005B1657B237CE289A11C0DF122 -:109620000E00ADF81A208DF81C308DF8195001F09D -:1096300077FB01A8FFF72CFE09B0F0BD002307B5AA -:1096400000931F23ADF8040068468DF80230FFF741 -:109650001FFE03B05DF804FB07B50E4AD37A0BB9C1 -:1096600001B1D172937A013BDBB2937273B91B23C0 -:109670008DF80230D37AADF800008DF80500684609 -:109680008DF803308DF80430FFF702FE03B05DF86B -:1096900004FB00BF205000211FB50024CDE9014488 -:1096A00003941A24ADF804008DF808000DF10A00A7 -:1096B0008DF809108DF8064001F050FB01A8FFF766 -:1096C000E7FD04B010BD1D2307B5ADF800008DF80F -:1096D000050068468DF802308DF803108DF80410EF -:1096E000FFF7D6FD03B05DF804FB10B5222486B069 -:1096F0000493089BADF804008DF8080001A8ADF8AC -:109700000640ADF80A10ADF80C200593FFF7C0FD38 -:1097100006B010BD0022044B5A70044A126892F839 -:1097200035201A70704700BFB0500021DC4D002179 -:1097300008B50F4B28220021184607F04EFE0D4AAF -:10974000126892F8231092F82420017042701B22B4 -:1097500042804FF4A4728280032202750A2242835F -:109760004FF00112C2614FF44862828408BD00BF0D -:10977000B4500021DC4D002108B5084B1C2200210B -:10978000184607F02AFE064A1268528D028003220C -:1097900002754FF4FD52028308BD00BFDC5000216A -:1097A000DC4D002110B5074C1022002104F1080007 -:1097B00007F013FE2346044A1068516803C30723C9 -:1097C000237210BDF85000215A3203014FF4617228 -:1097D000024B1A6000221A71704700BF105100211D -:1097E0000022044B83F8202083F8212083F82220D4 -:1097F000704700BF1851002110B50B4C802200218A -:10980000204607F0EAFD7F231822002104F1100012 -:1098100084F87B3007F0E1FD044BC4E902330723F1 -:1098200084F8203010BD00BF405100210088130093 -:10983000022807D0032808D001280AD1C80000F563 -:10984000837070478800D2307047880100F266400C -:10985000704796207047022805D0032807D002F1F0 -:109860000800C000704702F109008000704701291C -:109870000CBF02230823D0001B30584300F5BC70F6 -:1098800070472DE9F0471D469DF8243081469046EB -:109890000846BDF820609DF828109DF82C70C3B9CB -:1098A000DFB1BFB2BE46E0B940F2011CACEB07032A -:1098B000ACEB0E0C9BB21FFA8CFCB34214D3BA195A -:1098C000484692B2FFF7C7FF044604EB0800BDE824 -:1098D000F0874FF0420E7746E5E74FF00A0E052776 -:1098E000E1E783B29C46E8E7B6FBFCF40CFB1466A8 -:1098F000B6B2002E08BF013C0EEB0C02484692B2F5 -:10990000FFF7A9FF1FFA84FA05F596740AFB04F421 -:1099100000FB0A44002ED8D0BA19484692B2FFF78D -:109920009AFF0444D1E708B5FFF795FF00F596705C -:1099300008BD00000E4B0246984209D80D4BA2FB11 -:1099400003031E205B085843824210D91E30704723 -:10995000094BA2FB0303032000FB02334FF4967074 -:10996000C3F38F235843824288BF00F59670704737 -:10997000C3BF0300121111119E36D0692DE9F04FBB -:10998000C76A05463B788846023B85B0072B00F244 -:109990001A81DFE813F008002700180118015E00A3 -:1099A000AE00FB0010017E7BD7F89C30032E14BF65 -:1099B0004FF4BC744FF4416483B1002197F8C9207F -:1099C000387BFFF748FFD7F8A030963404442BB11A -:1099D000032E14BF04F20E2404F6A644EC6005B076 -:1099E000BDE8F08F97F8B020B97B387BFFF733FFE5 -:1099F00097F8B330044603F00102C3F34006C3F303 -:109A0000800333449E1800F0D7FC2044FFF792FFF8 -:109A1000731E00FB0344D7F89C30002BDED0962346 -:109A200073437A7B1819032A14BF4FF4BC744FF4A4 -:109A30004164D7F8A02004FB0604002ACED0002100 -:109A400097F8C920387B1C44FFF705FF06FB00444C -:109A5000C4E797F8B8207E7BD7F8983042BB022E37 -:109A60001AD0032E1AD144F290224FF46D64026191 -:109A7000002BB3D0F97B97F8B020002908BF022152 -:109A8000387BFFF7E8FE9634022E204409D0032EDF -:109A90000AD000F6DE04A1E7EC24E9E74FF4E8740D -:109AA000E6E700F2BE4499E700F58644263495E7E0 -:109AB000022E1AD0032E1AD144F290224FF434749D -:109AC0000261002B8AD0F97B2422002908BF0221E1 -:109AD000387BFFF7C0FE1022022104F5967404447F -:109AE0003046FFF7B8FE044478E72C24E9E7502419 -:109AF000E7E731BB4FF0F4094FF0F108D7F8A84081 -:109B00003E7BB97B5CB10D223046FFF7A4FE7B7B28 -:109B1000022B18D0032B19D000F6DE049634AA6A63 -:109B2000C2B1B2F800A01FFA89F9D14514D3B7F831 -:109B300098300D2B2CBF9A440AF10D0A1FFA8AF2B5 -:109B4000CEE78946DAE700F2BE44E7E700F586444F -:109B50002634E3E79246EAE7BAFBF8F708F1100289 -:109B60003046FFF778FE4FF496731FFA88F91FFA14 -:109B700087FB09FB17A203FB0B4492B200FB0B44CB -:109B8000002A3FF42BAF0D3292B2A9E7836A83B16A -:109B90001A88402A38BF40220023387B0393B97BC0 -:109BA0000092CDE901311A461946FFF76AFE0446D4 -:109BB00014E74022F0E70023387B0393BA7B00933D -:109BC000CDE90132EFE7002408E700002E4B2DE934 -:109BD000F74F8446D3F804800346002001914FF0EC -:109BE0000109014613B903B0BDE8F08F5D6925B1E5 -:109BF0005A7E012A03D1019A0AB95B68F2E79A6892 -:109C0000DCF80840161BDC68B6FBF8F23444B4FB01 -:109C1000F8F4D2B2E4B2A61A0136F6B23F2C00969E -:109C2000E1D8B5FBF8F515F0FF051ABFC2F1400405 -:109C300094FBF5F401244FF0000A1CBF0134E4B298 -:109C40005FFA8AF6B442D8D94FF0000E11E002EB69 -:109C50000E07A7F1200BC7F1200609FA0BFB29FA22 -:109C600006F64BEA060609FA07F7384331430EF1C8 -:109C7000010E009F5FFA8EF6B742E8D82A44D2B2AE -:109C80000AF1010ADCE700BFC051002110B5094A02 -:109C9000137B4BB90849906051F8044BA04204D99A -:109CA000064951F82330536010BD0133082BF3D11E -:109CB000FAE700BFC051002164320301843203017E -:109CC000F8B5144D0746AB68084616460C2413B980 -:109CD000FFF7DCFF01E08B4203D1012304FB0754B3 -:109CE00009E040F27121B0FBF1F201FB12022AB14E -:109CF000002304FB075484F8493002E08342E7D391 -:109D0000EBD80C2303FB075585F84870C5E913060B -:109D10000120F8BDC05100212DE9F8430D4617463A -:109D20009846294B0646186900284AD0436933B142 -:109D30000121FFF74BFF254B00245B6809E04068D9 -:109D4000F2E7C2074FEA500040EAC17048BFE4188A -:109D5000490850EA0102F4D1DFF87090B8F1000F21 -:109D60001BD04FF00C0808FB069898F84830B34217 -:109D700013D1D8F8506000F01FFBD9F80420D8F8B0 -:109D80004C303044B3FBF2F3DAB23F23B3FBF2F3CF -:109D90005843A0422CBF0024241A00F00DFBD9F830 -:109DA00004300744B5FBF3F5E9B23F25B5FBF1F507 -:109DB00007FB0545B5EB831F34BF01200020BDE83C -:109DC000F8830446C8E700BFA8530021C051002112 -:109DD000F0220021014807F000BB00BFC051002164 -:109DE000024640F27120B2FBF0F34343934202D1AA -:109DF000984238BF184670472DE9F04101290646C0 -:109E0000DDE9068740F271242ED1B3FBF4F14C4317 -:109E1000A24288BF1C4600252A461C48964250F89C -:109E2000041B06D0A14204D38B4202D38D4238BF1B -:109E30000D4601320E2AF1D11DB9A34228BF234697 -:109E40001D46134C2378BBB9424629463046FFF7DE -:109E500037FF012818D123780436013344F82650FF -:109E600023708FB13D600FE0B2FBF4F14C43A2428E -:109E700088BF04F27124CEE70023424629463046CB -:109E8000FFF74AFF0028DFD1BDE8F081D051002163 -:109E9000C0510021F8B5064640F271208342B1FB63 -:109EA000F0F584BFB3FBF0F0B5FBF0F500245D43A3 -:109EB000A94288BFED182346069F16489E4250F8D7 -:109EC000041B06D0A94204D38A4202D38C4238BF75 -:109ED0000C4601330E2BF1D11CB9AA4228BF2A46E9 -:109EE00014460D4D2B785BB9331D45F82340079B75 -:109EF0003A46214630461C60FFF7E2FE0120F8BDDD -:109F000001233A4621463046FFF706FF0028F6D0E7 -:109F1000EAE700BFD0510021C051002138B50C2321 -:109F20000F4D044603FB0053DA6CAB689A420FD125 -:109F3000002318469C4206D005EB8302126912B139 -:109F4000904238BF104601330E2BF3D1FFF79EFE2F -:109F50000023043445F824302B78013B2B7038BDA6 -:109F6000C05100212DE9F04F8DB01C469DF85830AE -:109F70008B4601939A4B90461D690A902E462EB946 -:109F80000A980DB0BDE8F08F7668F8E77369002B8A -:109F9000FAD03246537E012B01D0536913B952686F -:109FA000002AF7D1717E012901D0002103E0002AA7 -:109FB0001CBF164600213046FFF708FE019B0990A2 -:109FC000032B029165D00C23864A002703FB0B2349 -:109FD000D96C53683D46B1FBF3F91FFA89F3059339 -:109FE00001223B46DDF808E00999C2F12004A2F104 -:109FF0002000D1400EFA04F421432EFA00F0014370 -:10A00000C9071FFA82FC49D59D4201D21D46674609 -:10A01000002345E0AC423BD1AC68B068844208D232 -:10A02000214600F0CFF96B69B0FBF3F000FB03337E -:10A030001C446C4BB1685F68611AB1FBF7F0ED68C6 -:10A0400007FB101700F03F0400F0B6F92435284450 -:10A050003844B368634E1844756805FB0404A34292 -:10A060008ED0444500F2AE802146404600F0AAF969 -:10A070000C2101FB0B66F36C4146B0FBF3F00130A1 -:10A08000C0B203FB00400DB0BDE8F04F00F09AB93C -:10A090006D68002DBED128462C46DAE701339BB20D -:10A0A0000132402A9ED10C234E4C03FB0B43D3F8C4 -:10A0B00050A000F081F982446068BAFBF0FA0AF11E -:10A0C000010A1FFA8AF306937B1B1FFA83FA002307 -:10A0D0000E201C4608931FFA89F30B93002D6AD0BB -:10A0E0000028B6D0019B012B09D0022B05EB0A07F3 -:10A0F0002AD0BFB207EB0A04C4F34F0403E07B1B72 -:10A100001FFA83FA5446059B1BB30B9BC4F1400C0A -:10A110009CFBF3FC0CF1010C1FFA8CF34FF0000ECA -:10A1200072460793039407991FFA8EF38B423CD330 -:10A13000904284BFE3B20893019B88BFD0B2002B4A -:10A1400036D1C5F34F05C9E7069BBFB2FC1AA4B2CE -:10A15000D9E70123E2E7039B4B44C3F120018C467E -:10A16000A3F120010491099909F1010921FA03F3EE -:10A17000029901FA0CF10B43DDF810C0029921FAA3 -:10A180000CF10B43DB0748BF0132049148BF92B288 -:10A1900006991FFA89F39942DDD8059B03990EF1C0 -:10A1A000010E19448BB20393BDE74FF00009EFE7AE -:10A1B000013DADB292E700283FF44BAF2846BDF811 -:10A1C000204046E74146204600F0FCF80C2101FB08 -:10A1D0000B66F36CB0FBF3F202FB1300D1E600BF99 -:10A1E000A8530021C0510021002310B5044C237353 -:10A1F00040F2E2435843FFF749FD0123237310BDAA -:10A20000C051002138B51823074D044603FB005305 -:10A210001B6998470123204685F8813085F88040E6 -:10A22000BDE8384002F0B3BCB0520021014B1860C9 -:10A23000704700BF3453002108B502F07FFCBDE831 -:10A24000084084220021014807F0C7B8B05200211D -:10A25000014B5860704700BFB052002138B5094C1F -:10A26000054694F8813023B902F06EFC2846FFF7CA -:10A27000C9FF182305FB03331C4463680133636083 -:10A2800038BD00BFB052002110B5182400FB0441B6 -:10A290000B4B19444A68013A4A6093F8811071B136 -:10A2A00093F8801081420AD14AB983F8812004FBD7 -:10A2B00001335B699847BDE8104002F04DBC10BD0A -:10A2C000B0520021002370B5164C054684F8823048 -:10A2D00094F88130206083B194F88030AA7E9A424D -:10A2E00014D0002284F88120182202FB03435B690A -:10A2F000984794F881304BB905E002F025FC94F8BA -:10A300008130002BE8D1A87EFFF77CFF1822AB7EBE -:10A3100002FB0344A3681BB12846BDE87040184700 -:10A3200070BD00BFB0520021064B186840B100223A -:10A3300018211A60827E01FB0233DB6803B11847E3 -:10A34000704700BFB0520021014B1868704700BF32 -:10A35000B0520021034B1A6812B1012283F8822007 -:10A36000704700BFB0520021014B93F88200704744 -:10A37000B052002110B5094C236833B19A7E1823DE -:10A3800002FB0333E35803B1984700232360012302 -:10A3900084F882306368BDE810401847B05200214D -:10A3A000014B1B681888704734530021014B1B6810 -:10A3B0009878704734530021014B1B68D888704748 -:10A3C00034530021401A20EAE070704730B5182558 -:10A3D000044C05FB00400361039BC0E9021243618A -:10A3E00030BD00BFB0520021182300FB0333014AE7 -:10A3F000D1507047B052002120B9064A1369013389 -:10A4000013617047022801BF024A53690133536147 -:10A41000704700BF38530021002210B5074C616817 -:10A4200062600C22637A207A02FB03431B6A98471E -:10A4300020780121BDE8104000F098BE385300217B -:10A44000094B70B50C461546064600217022184689 -:10A4500006F0C3FF06708481C58129462046BDE809 -:10A460007040D6F77DB800BF385300212DE9F34185 -:10A47000194D6F6847BB05264FF00C086C7A032C0A -:10A480008EBF00240134E4B208FB04535B6A8DF8EC -:10A4900001700197ADF80270CBB101AA0DF1020174 -:10A4A0000DF10100984790B1019B9DF801006B6090 -:10A4B00028726C72FFF7A0FF2046019BBDF80220B6 -:10A4C0009DF80110D6F7C0F802B0BDE8F081013E5A -:10A4D00016F0FF06D3D1F7E738530021042830B532 -:10A4E00006D80C25034C05FB0040C0E90712436267 -:10A4F00030BD00BF38530021014B9861704700BF49 -:10A5000038530021034B596811B90120FFF7AEBF42 -:10A51000704700BF3853002110B504460846114665 -:10A52000FFF76AFF042C08D80C22064B02FB043408 -:10A53000E36913B1BDE8104018470846BDE8104074 -:10A5400000F070BD385300210B6841600360086063 -:10A5500003680BB158607047014B1861704700BF2A -:10A56000A85300214B6801604360486043680BB109 -:10A5700018607047014B5861704700BFA853002115 -:10A58000074A03685169814206D1536113B1002221 -:10A590005A6070471361704742685A601360704791 -:10A5A000A853002110B5044602F086FD00F1190100 -:10A5B000A068FFF707FF003818BF012010BD38B5AD -:10A5C000057E0B7E04469D4206D307D142B19047DB -:10A5D000231A5842584138BD0120FCE70020FAE711 -:10A5E0001046F8E770B5134C23695B682361B3B17B -:10A5F00000221A60A3698BB15D6802F05DFD06461A -:10A60000FFF7DAFE2369A269304453B95360A369A6 -:10A6100023619860A5610DB100232B6070BD63615B -:10A62000E8E711699E6801448E42F7D353601A60CF -:10A63000EDE700BFA85300212DE9F843044602F0DE -:10A640003BFD0746FFF7B8FE244D07442B69A76082 -:10A650003BB9C5E90444C4E90033BDE8F84300F060 -:10A66000A7BA9E68D4F80C80FFF7A6FEA6EB0806F2 -:10A67000F61B361A002E0BDB2B78022B08D0204657 -:10A680002969FFF761FF2B69A342E6D0BDE8F88393 -:10A690002E692B69D6F80880B3420DD137695FB1B6 -:10A6A0004744FFF789FE73680744A7604BB93146FA -:10A6B0002046FFF757FFE6E7F768FFF77DFE4744C0 -:10A6C000F1E79F68D4E90289FFF776FEC844A7EB5B -:10A6D00008073F1A002FEADA7668DAE7A853002164 -:10A6E0002DE9F74F604E0446356989466DB9C6E9D4 -:10A6F0000400C0E9005501273369A34217D102F0D5 -:10A70000C3FC00F055FA12E01D46D4E9028AAF6896 -:10A71000FFF752FED044A7EB08073F1A002F0FDBCC -:10A720003369AB4207D13378022B04D10027384676 -:10A7300003B0BDE8F08F29462046FFF705FFDAE7B2 -:10A74000A768D5E9028AFFF737FED044A7EB0807D0 -:10A750003F1A002F7BDA3369AB4202D13378022BE8 -:10A76000E4D02F467B6873B939464A462046FFF746 -:10A7700026FF0128074673D133699D4246D1A8467A -:10A780004FF0000A1CE0D3F80880D4E902ABFFF7D1 -:10A7900013FEDA44A8EB0A08A8EB0008B8F1000F92 -:10A7A000E2DA4A4639462046FFF709FF0028BDD0C5 -:10A7B0007F68D7E7D6F81080FFF714FF86F800A06F -:10A7C00033697BB1D3F80890D4E902B30193FFF762 -:10A7D000F3FD019B9B44A9EB0B09A9EB0009B9F11F -:10A7E000000FE7DB316921B9C6E90444C4E900116F -:10A7F00002E02046FFF7A8FEA946D9F820306D6890 -:10A800000BB148469847C145F6D175E7A846D5F83B -:10A8100000A0DAF804307BB1D3F80890D4E902B391 -:10A820000193FFF7C9FD019B9B44A9EB0B09A9EB21 -:10A830000009B9F1000F04DB51462046FFF792FEF4 -:10A84000DAE7DAF804804046FFF79AFEE1E76B6842 -:10A85000002B7FF459AF29462046FFF783FE4AE7D5 -:10A8600000287FF449AF61E7A85300212DE9F74F95 -:10A87000876804467B18836088469146FFF792FEFE -:10A8800068B9B9F1000F03DBA76003B0BDE8F08F32 -:10A8900002F012FC0746FFF78FFD0744A760394E10 -:10A8A000336933B9C6E90444C4E9003300F080F9E0 -:10A8B0002BE09D68D4F808A0A5EB0A03002B11DB60 -:10A8C000D4F80CB0FFF778FDDA44A5EB0A052D1A91 -:10A8D000002D07DB3378022B04D031692046FFF7C7 -:10A8E00033FE0FE07369A568D3E902ABFFF764FD9F -:10A8F000DA44A5EB0A052D1A002D08DB7169204604 -:10A90000FFF730FE3369A342D0D00120BDE735699F -:10A9100015B92846A760B8E7D5E902B3D4F808A06E -:10A920000193FFF749FD019B9B44AAEB0B0AAAEB9D -:10A93000000ABAF1000F06DAD5E902ABFFF73CFDD9 -:10A94000DA445044A060D4F808B0ABEB0703984554 -:10A9500016D8994514D36B680BB92946CFE7D3F8BD -:10A9600008A0E3680193FFF727FD019B9B44AAEB36 -:10A970000B0AAAEB000ABAF1000F01DB6968ADE728 -:10A980006D68C5E7A85300212DE9F74F3F4E876852 -:10A99000D6F814A0BD180446894690468560BAF1E1 -:10A9A000000F09D1FFF7FEFDF8B1C6E90444C4E980 -:10A9B00000AA00F0FDF814E0DAE902BAFFF7FCFCA7 -:10A9C000D344A5EB0B052D1A002D0CDB2046FFF719 -:10A9D000E9FD50B120467169FFF7C4FD3369A34218 -:10A9E000E7D0012003E0756925B90020A76003B016 -:10A9F000BDE8F08F2B681BBBD5F808A0D4F80CB0CD -:10AA0000FFF7DAFCAAEB0B0A3946AAEB0000FFF7C6 -:10AA1000D9FC404528BF40463A188145A26033D84A -:10AA2000AB689B1A002B2FDB2046FFF7BBFD58B30A -:10AA30003378022B28D029462046FFF785FDCDE745 -:10AA4000D3E902ABFFF7B8FCDA445044A0602046DB -:10AA5000FFF7A8FD0028C8D03946A068FFF7B2FC70 -:10AA6000484511D380450FD3D4E902B3D5F808A0E7 -:10AA70000193FFF7A1FC019B9B44AAEB0B0AAAEBF5 -:10AA8000000ABAF1000FD6DA2D68ADE7A85300210D -:10AA9000144A10B5116904460B4603B910BD9C4217 -:10AAA00015D05B68F9E7BDE8104000F091B8FFF7FA -:10AAB00099FD236A002BF1D02046BDE810401847CD -:10AAC0002046FFF75DFD236A002BF6D1E6E78C42B6 -:10AAD000F6D11378012BE6D0022BE8D1BDE8104067 -:10AAE000FFF738BCA8530021044B1A69824204D1F5 -:10AAF0001B78022B01D000F05BB87047A8530021EF -:10AB0000054B1A69824204D11878023818BF012017 -:10AB100070470120704700BFA8530021074B82B047 -:10AB20005A68511C01F00301019101211A4410736C -:10AB3000019A58785A6002B000F018BBA85300215F -:10AB4000034B1B78022B02D10120FFF7E7BF7047B0 -:10AB5000A8530021034B1B78012B02D10020FFF7E3 -:10AB6000DDBF7047A85300210F4B70B51E6900F080 -:10AB700009FA02F0A1FA0546FFF71EFC2946044631 -:10AB8000B068FFF71FFC04F11903984203D200F0EC -:10AB900005FA002070BDB0680449001B02F068FA95 -:10ABA00000F0FCF90120F5E7A853002155AB0201A4 -:10ABB00008B5064B1B781BB1012B06D102F064FAD5 -:10ABC000BDE808400320FFF7A9BF08BDA853002136 -:10ABD00008B5064B1B78013B012B06D802F054FA4E -:10ABE000BDE808400220FFF799BF08BDA853002127 -:10ABF0000022044BC3E90422C3E906221A701A8416 -:10AC0000704700BFA853002108B524220021034843 -:10AC100006F0E3FBBDE80840FFF7EABFA8530021B8 -:10AC200010B50446FFF7F0FF034B04485C70BDE825 -:10AC30001040FFF70DBB00BFA853002141AB02013C -:10AC4000F7B502F039FA03270646314CD4E901235F -:10AC500093420AD05A1C02F003020192019A25691C -:10AC600023441B7BA2605DB9257002F025FA3146B2 -:10AC7000FFF7A8FB238C834238BF208403B0F0BDCC -:10AC80002278012A05D0022A25D0E2B9032B1AD155 -:10AC900034E0022B23D0032B32D0A3B9022323703C -:10ACA00002F00AFA00F11901A868FFF78BFB10B94E -:10ACB000EB7E012B0CD12846FFF704FBFFF754FB7A -:10ACC00008B1FFF73DFF2369002BBFD12370BDE71B -:10ACD000FFF77EFFF7E7012B06D0022BF3D1FFF73A -:10ACE00081FC2B6A277003E0FFF77CFCEB6927707F -:10ACF0000BB1284698472369002BE4D00123237029 -:10AD0000FFF732FF0028DED1FFF724FFDBE700BFAB -:10AD1000A8530021014B188C704700BFA853002195 -:10AD20000B6803608B88838070470346006859680E -:10AD30007047110A02704170110C120EC2701A0A8B -:10AD4000037142711A0C1B0E81708271C3717047BE -:10AD500003794179006843EA01217047110A0270C2 -:10AD600041700371110C1B0A120E8170C270437185 -:10AD70007047000010B5074C11448A4201D1C0430E -:10AD800010BD12F8013B4340DBB254F8233083EA94 -:10AD90001020F2E7A4320301094B0A4A0A49C3E929 -:10ADA000001202F1636202F5682202F50D629A60F8 -:10ADB00002F1176202F5FC2202F5BA62DA6070470E -:10ADC000CC53002115CD5B0733134905074B0268AF -:10ADD000196851401960596851405960996851404B -:10ADE0009960D9684A40DA60704700BFCC530021AF -:10ADF000084A936810685168536081EAC121D3689A -:10AE0000D06080EAD040484080EA11209360106012 -:10AE1000704700BFCC5300212DE9F74F05460E4681 -:10AE20000C2400F0D7F84FF0040B04FB0504DFF806 -:10AE3000B4802D4BC8F800001D70043600F10C0AD8 -:10AE4000D8F8007000F0CCF820F003000744BC42B2 -:10AE500003D9002003B0BDE8F08F002D3BD036F8B9 -:10AE6000042C032A20D82AF80CBC3AF80C7C16F8DB -:10AE7000022C4AE90244BF080AF80A2CBF00012A42 -:10AE8000D8F8009018D800F0ABF820F00300814407 -:10AE90004C4506F104060AF10C0ADAD80023013DFC -:10AEA0002360EDB23C44CBE793071CBF22F00302C2 -:10AEB00004322AF80C2CD8E7019200F091F820F027 -:10AEC000030081444C45C4D8019AE119013A21603C -:10AED000D2B20C46D3E7D8F80000044B201A186011 -:10AEE000B8E700BFDC530021E4530021E053002108 -:10AEF000F8B507460E4B1D680E4B1C780CB926465C -:10AF00000EE02B88BB420FD300F03CF8AE684EB188 -:10AF10003368094AAB6013680133136000F03EF8F0 -:10AF20003046F8BD00F03AF8013CE4B20C35E5E7F4 -:10AF3000DC530021E4530021E853002138B50E4AC8 -:10AF4000054614780C220D4B1B6802FB04340C3CA4 -:10AF5000A34200D938BD6268AA42F8D800F012F8BE -:10AF6000A368074A2B601368A560013B1360BDE826 -:10AF7000384000F013B800BFE4530021DC53002137 -:10AF8000E853002110B5044C23780BB903F05CF9A9 -:10AF900023780133237010BDEC530021044A137849 -:10AFA000013BDBB213700BB903F050B9704700BF1F -:10AFB000EC530021054A0330136820F003000344DA -:10AFC0001360034A1368181A10607047805B0021F1 -:10AFD0007C5B0021014B1868704700BF805B00213B -:10AFE000014B1868704700BF7C5B0021034B044A8B -:10AFF0001868044B9B1A181A704700BF7C5B00212D -:10B00000485D002100F0002183071CBF20F00300F1 -:10B0100004307047083008B580B2FFF769FF00B10F -:10B02000083008BD0838FFF789BF02F8041CA2F1F8 -:10B03000080100F03DB938B504460D4600F0C0F8EF -:10B0400021462A46FFF7F1FF2046BDE8384001219E -:10B0500000F0A6B810B50C4600F03CF910B1037929 -:10B060000830237010BD006810B1037908300B70F0 -:10B070007047006818B119B9037908301370704728 -:10B0800001390068C9B2F5E7F8B500252C46094E2C -:10B09000A6F16C0797F878309D4203D387F8794082 -:10B0A0002046F8BD56F8043B13B198470443E4B278 -:10B0B0000135EFE7605400212DE9F341FFF762FF0E -:10B0C0000023264C94F8686084F86830FFF766FF28 -:10B0D000F10708D504F1600738460DF10701FFF7C5 -:10B0E000B9FF054630B9B20715D4730719D402B0B9 -:10B0F000BDE8F0819DF807302946002054F8233040 -:10B1000098472846FFF78EFFE6E7037B011D54F8BA -:10B11000233000209847002000F0D0F90028F4D117 -:10B12000E3E7102400270E4DA5F1400635F8023B59 -:10B130006BB133685BB1FFF725FF35F8028C25F85A -:10B14000027CFFF72BFF0021404633689847013C03 -:10B1500014F0FF0406F10406E8D1C8E7F453002117 -:10B1600034540021FFF70EBFFFF718BF38B504466F -:10B170000D46FFF707FF094B04F00F0093F8682016 -:10B18000203033F8101042F004020D4383F8682099 -:10B1900023F81050BDE83840FFF700BFF4530021FA -:10B1A00010B50C46FFF7EEFE044B93F868100C4305 -:10B1B00083F86840BDE81040FFF7F0BEF45300216B -:10B1C0000048704754540021044A92F86930591CD1 -:10B1D00042F8230082F8691018467047F4530021A2 -:10B1E000044B93F8682093F8793013430CBF012087 -:10B1F00000207047F453002108B57C220021044848 -:10B2000006F0EBF801F0CAFE024B186008BD00BF63 -:10B21000F4530021F0530021044B93F87820511C83 -:10B2200083F8781003EB8203D8667047F45300214B -:10B2300073B51D4D1D4E01F0B1FE296801F004FFEC -:10B2400009280CD90A23B0FBF3F403FB04F001F046 -:10B25000EFFE2B68034420462B6000F005F9FFF752 -:10B260002BFF96F879301BB1FFF70EFF0028E2D1D3 -:10B2700001F094FE296801F0E7FE0928DBD802F00E -:10B28000E3FFFFF7ADFF58B10DF1070000F008F93B -:10B290009DF8073003B118B10A23584303F050F862 -:10B2A00002F0D4FFC7E700BFF0530021F4530021A0 -:10B2B00038B5002304460B600D46FFF763FE236894 -:10B2C0002BB925606560BDE83840FFF767BE63684D -:10B2D0001D60F7E738B50446FFF754FE25681DB139 -:10B2E0002B68236003B96360FFF758FE284638BD1A -:10B2F00038B504460D46FFF745FE23682B6003B9B9 -:10B3000065602560BDE83840FFF748BE70B5064669 -:10B310000D461446FFF736FE336813B17368A34237 -:10B3200007D129463046FFF7C3FFBDE87040FFF75D -:10B3300035BE24B929463046FFF7DAFFF5E7236822 -:10B340002B602560F1E770B504460D461646FFF701 -:10B3500019FE2368AB4209D12B6823606368AB42B6 -:10B3600008BF6660BDE87040FFF718BE002EF5D03C -:10B370002B683360F2E710B50446FFF703FE0022A6 -:10B38000236894B201321BB9FFF708FE204610BDB6 -:10B390001B68F6E710B50446FFF7F4FD2468FFF7D5 -:10B3A000FDFDB4FA84F46409204610BDD0E9002004 -:10B3B000131A5842584170470022084B10B51C68B8 -:10B3C00004B910BD844202D022462468F8E7214621 -:10B3D0000248FFF7B8FF00236373F2E770540021BF -:10B3E00038B504460D46FFF7BDFE637B13B120461A -:10B3F000FFF7E2FF012300226373094BA5601B687E -:10B4000013B19968A94207D921460548FFF77EFF85 -:10B41000BDE83840FFF7A8BE1A461B68F0E700BF3A -:10B42000705400210022024BC3E90022704700BF84 -:10B43000705400214FF47A7359430A230931B1FB48 -:10B44000F3F1FFF7CDBF0A230931B1FBF3F1FFF7A9 -:10B45000C7BF10B50446FFF785FE2046FFF7ACFFD7 -:10B46000BDE81040FFF780BE70B500260546FFF727 -:10B4700079FE0A4B1C681CB9BDE87040FFF774BE2A -:10B48000A368AB4203D95B1BA3602468F3E70221E6 -:10B49000207BA660FFF784FEF7E700BF7054002111 -:10B4A000054A0346106808B91870704701211970E1 -:10B4B00013689868704700BF7054002138B5FFF7D3 -:10B4C00051FE0948046854B1A56845B92A46214689 -:10B4D000FFF739FF6573FFF747FE204638BDFFF7DA -:10B4E00043FE0024F9E700BF7054002113B518B1E2 -:10B4F000012823D002B010BD02221F4BC3F808233D -:10B50000C3F80401D3F804210122DA600123984230 -:10B510008DF8073042F2107118BF0023164A08BF99 -:10B520000DF10703A0B10128E4D123B1D2F80C44F6 -:10B5300004F001041C70D2F80C4411E000220E4B00 -:10B54000C3F80803C3F80021D3F800215860DDE7F1 -:10B5500023B1D2F8184404F003041C70D2F8184444 -:10B56000E403C7D513B90139DCD1C3E79DF807401F -:10B57000012CF8D0BEE700BF00500041044B1A79FF -:10B5800022B9012218601A710248704702487047B8 -:10B59000785400210000AD0B0C00AD0B094B1A686C -:10B5A000920604D4E02283F8052320221A600223A5 -:10B5B000054AC2F818350123C2F81435034A13703E -:10B5C000704700BF00E100E00050004180540021BE -:10B5D00008B510B1012829D008BD194BD3F818249B -:10B5E000D3F81814C9030CD4D3F81424D2070FD5F8 -:10B5F000D3F81C2402F00302022A06D1C3F8042364 -:10B60000EAE702F00303022B02D00020FFF76EFFEF -:10B61000022200210A4BC3F81825C3F80411D3F8FD -:10B620000411C3F8042301229A60D5E70022044BD9 -:10B63000C3F80021D3F80021C3F804031860CBE756 -:10B6400000500041114B10B5D3F8002152B1002039 -:10B65000C3F80001D3F800210122C3F808230C4BE2 -:10B660001B689847094BD3F804216AB1BDE8104024 -:10B670000022C3F80421D3F804210222C3F80823CE -:10B68000034B01201B68184710BD00BF005000414C -:10B69000785400210146014800F044BE60000021BA -:10B6A0000123044A83400146C2F80835024800F0ED -:10B6B00059BE00BF00F000416000002110B50446F3 -:10B6C000074B2146186800F023FE30B10120054BDE -:10B6D000A040C3F80405044810BD0448FCE700BFBF -:10B6E0006000002100F000410000AD0B0400AD0B34 -:10B6F00010B50446074B2146186800F009FE30B12A -:10B700000120054BA040C3F80805044810BD0448BB -:10B71000FCE700BF6000002100F000410000AD0B1D -:10B720000400AD0B036803F01F020260034A0448E3 -:10B730005B09012B08BF1046704700BF00088C4111 -:10B7400000058C41F7B51746DDE90846019001A8D0 -:10B750001D46FFF7E7FF019B002F00EB830014BF9E -:10B7600002230023002918BF43F00103002D14BF5A -:10B770004FF00C0C4FF0000C002C43EA0C0314BFEC -:10B780004FF4706C4FF0000C002E43EA0C0314BF12 -:10B790004FF4403C4FF0000CD0F8002243EA0C0379 -:10B7A00022EA030301B109780FB13F787F00194302 -:10B7B0000DB12D78AD0039430CB1227814020D4340 -:10B7C0000EB1367836042C433443C0F8004203B03F -:10B7D000F0BD1FB50DF10F03019300238DF80F107D -:10B7E0001A4619460093FFF7ADFF05B05DF804FB5C -:10B7F000034B0C3033F81000C0F34010704700BF0B -:10B800006400002170B50D4C00F10C0334F81330C6 -:10B810000546DA050E4607D5C3F3432304EBC302FE -:10B82000526854F83330984723692BB13146284683 -:10B830006269BDE87040184770BD00BF6400002118 -:10B84000124A0C3032F8103010B4D9051BD5C3F3AE -:10B85000432123F4F85322F81030002002F1180499 -:10B8600034F8023B13F4807F03D0C3F3432399429F -:10B8700009D001303028F3D10023054810BC42F82C -:10B88000313000F06FBD10BC704700BF6400002174 -:10B89000E000002138B50246FFF7AAFF0B4C02F189 -:10B8A0000C0560B1002134F815305B0B9B0003F1EF -:10B8B000824303F52043C3F81015C3F81015104652 -:10B8C000FFF7BEFF002324F8153038BD64000021C7 -:10B8D000F0B50446164685B019B3344D00F10C0797 -:10B8E00035F81720930703D4FFF782FF00285AD1B9 -:10B8F00012F01C0F02D04B78012B54D001238DF88D -:10B900000F3000234A1CCDE9001320468B1C0DF19B -:10B910000F01FFF717FF35F8173043F0030325F841 -:10B92000173016B9224805B0F0BD204A04F10C07C3 -:10B9300032F81700830736D5002396F800C020F0B0 -:10B9400020004FEA8C0101F18241C00401F5204141 -:10B95000C00CC1F8103522F81700C1F81035757801 -:10B96000002DDFD0D1F81035B67823F4991323F4E5 -:10B97000F853C1F81035D1F810E5230203F47C53D5 -:10B980002D0443EA0E0305F4403534052B4304F43B -:10B99000801440EA4C30234340F02000C1F81035B9 -:10B9A00022F81700BEE70348BDE700BF640000218E -:10B9B0000000AD0B0400AD0B70B5124D044695F8B8 -:10B9C0008060EEB96022314605F1180005F005FDF2 -:10B9D00064010D4BE4B283F80A434FF480621A60AD -:10B9E0000A4B0B48C3F87C61D3F87C214FF000422E -:10B9F000C3F80423012385F880300323EB6770BD6F -:10BA00000448FCE76400002100E100E000A00041E0 -:10BA10000000AD0B0500AD0B0146014800F0A2BCD3 -:10BA2000DC0000210146014800F07CBCDC00002164 -:10BA300000232DE9F743914601221B4F00F10C082A -:10BA40008DF800308DF8023037F818300446DB07E7 -:10BA50008DF8012026D44E788D78964206D101903B -:10BA600001A8FFF75FFE019B9E408660C5B14B7841 -:10BA70008DF804908DF806300B7801AA8DF805300A -:10BA800069462046FFF724FF084B984205D137F856 -:10BA9000183043F0800327F8183003B0BDE8F08376 -:10BAA0002A46EDE70248F8E7640000210000AD0BEC -:10BAB0000B00AD0B8B7873B506460D46D3B10DF177 -:10BAC0000700FFF7AFFF0D4B044698420FD1294600 -:10BAD00030469DF80720FFF7ABFF094B044698421C -:10BAE00005D1AB781BB19DF80700FFF795FF204605 -:10BAF00002B070BDFF238DF80730E8E70000AD0B02 -:10BB00000B00AD0B07B5019001A8FFF70BFE012359 -:10BB1000019A9340836003B05DF804FB07B5019080 -:10BB200001A8FFF7FFFD0123019A9340C36003B012 -:10BB30005DF804FB084B0C3033F810305B0B9B00B6 -:10BB400003F1824303F52043D3F8102542F00302AA -:10BB5000C3F81025704700BF64000021084B0C306B -:10BB600033F810305B0B9B0003F1824303F5204355 -:10BB7000D3F8102522F00302C3F81025704700BF48 -:10BB800064000021034B0C3033F81000400B8000A0 -:10BB90003030704764000021034B0C3033F8100044 -:10BBA000400B8000603070476400002108B50246F9 -:10BBB000FFF71EFEC0B10F4B02F10C0133F811303C -:10BBC000990711D401225B0B9A400B499B0003F1AA -:10BBD0008243C1F8082303F52043D3F8102522F04F -:10BBE0000302C3F8102508BD0021BDE80840104637 -:10BBF000FFF7EFBD6400002100A00041104B00F1F1 -:10BC00000C0233F8123013B5DB07044616D5FFF7E4 -:10BC1000CDFF2046FFF73EFE01A80194FFF782FD0D -:10BC2000019B00EB8300D0F8003203F0E04343F0C7 -:10BC30000203C0F80032034802B010BD0248FBE71F -:10BC4000640000210000AD0B0400AD0B10B50246EE -:10BC5000FFF7CEFD78B1094B02F10C0133F811402A -:10BC6000640B1046FFF7CAFFFF2C06D02046BDE844 -:10BC70001040FFF7D1BEFF24F3E710BD64000021A0 -:10BC80002DE9F04F002601223446614B614862499C -:10BC900087B01D6835B1D0F8045315421EBF1C6033 -:10BCA0001D68164304338B424FEA4202F1D1594BCF -:10BCB000D3F87C31002B00F08E80DFF86081584F84 -:10BCC000D8F820300493C8F820303B6A05933B62D3 -:10BCD0004FF000090DF1100B4FEA4913009348E0B3 -:10BCE00094FAA4F4B4FA84F4009B4E4A1C4404F180 -:10BCF0000C0332F813300122E00804F0070C02FABA -:10BD00000CFC1BF80020C3F3820522EA0C020BF89E -:10BD1000002003A899080394FFF704FD039A4B073A -:10BD200002F1800250F82220AA46C2F301422AD52D -:10BD300020465146D5B2FFF765FD03A80394FFF7EF -:10BD4000F1FC039B803350F82330C3F301439D4241 -:10BD500007D100212046FFF73CFD29462046FFF78A -:10BD600038FD03A80394FFF7DDFC0123039A9340F9 -:10BD700003625BF82940002CB2D1B9F1000F1AD14F -:10BD80004FF00109A8E7022A0CBF03210221204637 -:10BD90000192FFF71EFD032D04D0019A022A06D15D -:10BDA000012DDED151462046FFF72CFDD9E7032AAD -:10BDB000D7D1022DF5E7174BC3F87C41D3F87C317E -:10BDC000D8F820200492C8F820203B6A05933B62F3 -:10BDD00013437FF47DAF012416B907B0BDE8F08F9F -:10BDE00096FAA6F3B3FA83F304FA03F29B0003F185 -:10BDF000824303F52043D3F81005D3F81015C0F3A0 -:10BE00000520C1F3014126EA0206FFF7FBFCE3E748 -:10BE100000A1004100A0004120A1004100058C418B -:10BE200000088C416400002110B5094B1C796CB9E5 -:10BE3000084C4001C0B284F812034FF48020206007 -:10BE400001201871044819609A6010BD0348FCE78E -:10BE50008454002100E100E00000AD0B0C00AD0BAC -:10BE6000002330B50D4A50F8234003F5A271013389 -:10BE7000102B42F82140F6D10023084A00F140017E -:10BE800003F5B27451F8045B0133102B42F82450CF -:10BE9000F6D1D0F88030C2F8043330BD0020014123 -:10BEA0000123800000F1824000F590308B40D0F8F3 -:10BEB00010150B43C0F81035704700000C4B30B420 -:10BEC000D3F80C0301240246002522B930BC094BEB -:10BED0001A689968104792FAA2F3B3FA83F304FA46 -:10BEE00003F122EA010204499B00CD50EDE700BFB7 -:10BEF000002001418454002100210141114B10B563 -:10BF0000D3F80443A2060AD5D3F814213AB100208D -:10BF1000C3F81401D3F814310B4B1B689847630620 -:10BF20000ED5084BD3F8182152B1BDE810400022BD -:10BF3000C3F81821D3F81831034B01201B681847A8 -:10BF400010BD00BF005000419054002108B5FFF71C -:10BF5000D5FFBDE80840FFF775BB00002DE9F047AD -:10BF6000002504460E464FF48038A946DFF884A029 -:10BF700000F5A077D4F8043313EA080F0CD03B681F -:10BF800053B1C4F84883C4F80883C7F800903B68ED -:10BF9000E8B25AF8263098470135042D4FEA480890 -:10BFA00007F10407E6D1D4F80433DA070CD5D4F846 -:10BFB00000314BB10023C4F80031D4F800310D4BEF -:10BFC000284653F826309847D4F804339B070ED5FB -:10BFD000D4F804315BB10023C4F80431D4F804313F -:10BFE000044B052053F82630BDE8F0471847BDE85C -:10BFF000F08700BF9454002100210148FFF7AEBF35 -:10C000000010014101210148FFF7A8BF0060014174 -:10C010002DE9F843002406460F464FF48038A14628 -:10C0200000F5A0752B687BB1D6F8043308FA04F24A -:10C030001A4209D0C5F800902B68A30003F5A0733D -:10C0400098B2D7E9003198470134082C05F104056E -:10C05000E8D1BDE8F88300000C23F0B505792D4C3C -:10C060006B43E71816463A7A002A51D19446E650B7 -:10C070004B687B6047790368D6B2B7423BD8CA7831 -:10C0800043F307365201002EC3F30733D2B23ADB33 -:10C09000214F07EB060C8CF80023012203F01F034D -:10C0A000760902FA03F347F8263003684A78D3F892 -:10C0B000040502F0030220F003000243C3F8042544 -:10C0C000D3F808058A7820F0030002F00302024347 -:10C0D000C3F80825D3F810050A7820F00F0102F004 -:10C0E0000F020A43C3F810250C2303FB0544012368 -:10C0F0000A482372F0BD960006F5A07643F806C004 -:10C100009E590132B8E7064E03F00F03F254CCE714 -:10C110000448EFE79C54002100E100E00000AD0B73 -:10C1200014ED00E00500AD0B01220C2103681A603C -:10C130000279034B01FB023302221A72704700BFDF -:10C140009C540021012203681A6101790C20024BE2 -:10C1500000FB01331A7270479C54002102680120D1 -:10C160008B004033DBB2D05001F5A87152F82100AA -:10C17000704730B54FF4803400688C4063B10025BF -:10C180008B0003F5A073C550C358C0F8044301F5F4 -:10C19000A87140F8212030BDC0F80843F7E74FF4FC -:10C1A000803302688B40C2F8083370470149024867 -:10C1B000FFF72EBF9C54002100C0004101490248F6 -:10C1C000FFF726BFA8540021008001410149024821 -:10C1D000FFF71EBFB4540021009001411FB5012399 -:10C1E0008DF80030044BCDE90110D3E90012684608 -:10C1F000904705B05DF804FBC05400217FB5424B69 -:10C20000D3F82421002A5FD00022C3F82421D3F8D8 -:10C21000241102218DF80010D3F880146846C3F869 -:10C2200080140391D3F83C350293384BD968C3E9A5 -:10C2300006220191D3E900129047334AD2F84431E3 -:10C2400073B10021C2F84411D2F844312F4B9869E0 -:10C2500030B1C3E90611D2F83C05D968FFF7BEFF3B -:10C26000294AD2F82031ABB10021C2F82011D2F80E -:10C2700020310123D360254B586958B1D2F84C25A1 -:10C28000684602929A688DF8001001925961D3E9CC -:10C29000001290471C4AD2F858319BB10021C2F8D5 -:10C2A0005811D2F85831194B586958B1D2F84C2569 -:10C2B000684602929A688DF8001001925961D3E99C -:10C2C0000012904704B070BDD3F810110029B4D00B -:10C2D000C3F81021D3F810210C4A92F82160002EE7 -:10C2E000ABD1D2E90604D16864B1D3F8005225F08D -:10C2F0002005C3F8005213699461D360D661FFF73B -:10C300006DFF9AE79461FAE700300141C0540021C3 -:10C3100082B001900198C840C04300F0010002B013 -:10C320007047000030B50268B2FA82F3C3F11F0310 -:10C33000DDB25BB25C1C0FD072B60468A24201D0C1 -:10C3400062B6F0E7012404FA03F322EA0302026072 -:10C3500062B602480D7030BD0148FCE70000AD0B2D -:10C360000200AD0B0368CB40DB070ED4026872B647 -:10C3700003689A4201D062B6F8E7012303FA01F19B -:10C380001143016062B6024870470248704700BF1F -:10C390000000AD0B0400AD0B0022D30003F1FF73CE -:10C3A00003F58033D3F80013013107D0D3F800131D -:10C3B0000132D3F80433202A0B60EED1144BD3F8AA -:10C3C0003021072A1AD1D3F83431023B032B0CD881 -:10C3D000104AD35C4BB1104BD3F80024D10742BFB5 -:10C3E0000022C3F81421C3F818210B4BD3F8002402 -:10C3F000D20744BF6FF00102C3F80024074B1A684C -:10C40000074BC3F84425074B074A1A60704700BF23 -:10C410000000FF01A4360301005000410080FF012D -:10C4200000600041E80000210090D00380B400AF1C -:10C430001EF0040F0CBFEFF30880EFF3098000F04B -:10C4400065B800BFBD4680BC70470000012307B53A -:10C450000093084B11205B68C3F30803103B019362 -:10C4600000F06CFE009B002BFCD1019B03B05DF83B -:10C4700004FB00BF00ED00E008B5174A174B184950 -:10C480008B421ED30021174B174A93421ED34FF005 -:10C49000AF31164B164A93421BD3164A164B1A60FD -:10C4A000164B9B1A164A1360164A174B9A60FFF7F1 -:10C4B00073FF01F0CDFED3F77FFE4FF01800ABBE47 -:10C4C00008BD52F8040B43F8040BD9E743F8041BEA -:10C4D000DBE743F8041BDEE7883B03010000002193 -:10C4E0008401002184010021485D002100F0002129 -:10C4F00000000121485D0021805B002100F0002147 -:10C500007C5B00210000000100ED00E007B5112078 -:10C5100000F014FE01230093054B9B6AC3F38023B4 -:10C520000193009B002BFCD1019B03B05DF804FB41 -:10C5300000ED00E0002070470020704701207047A8 -:10C540000020704700207047002070470346064ACD -:10C550000333106823F00303C118116003490A680C -:10C56000D31A0B60704700BF805B00217C5B002109 -:10C5700010B5084B044693F82F2093F82E00824202 -:10C5800003D093F8451001F0E7F92046BDE81040CC -:10C5900001F05CBBE8550021022905D0032908D031 -:10C5A00001290BD10088704703880089184480B2A4 -:10C5B000704703880289008A1344F7E70020704718 -:10C5C00010B50446417E0D4B83F84E10007E01F0FD -:10C5D000D3FA238B83B1204601F0D6FA04F1100080 -:10C5E00001F0DEFA94F8280001F0E4FA94F829004A -:10C5F000BDE8104001F0E4BA10BD00BFE8550021CD -:10C600002DE9F743DFF840811F46B8F8283015467A -:10C6100001330646A8F8283018B1C31E012B00F2DA -:10C620008E80D8F84830B8F84C401B785A1CA2428B -:10C63000B8BF03F1090498F84E30A8BF063403B11F -:10C640000434032D39D0042D3AD0012D15BF013407 -:10C650000234E400A400D8F8083001EB030998F88C -:10C66000263083B398F810300C44022BC8F81C40D5 -:10C670002CD0032B4CD0012B5ED1B8F82C00C0F18C -:10C680009600044480B2C8F81C40FFF771FF032DE8 -:10C6900058D0042D14BF00230223042E98BF2B4A28 -:10C6A000009394BF905D01204B4600223946D8F894 -:10C6B0000440A04703B0BDE8F08305342401CAE775 -:10C6C000A4015034C7E7D8F81C10CBE7D8F81830CD -:10C6D000586801F013F9D8F81830986801F018F983 -:10C6E000D8F81830587801F019F9D8F81800443003 -:10C6F000FFF766FFD8F81400D8F80830B8F8201013 -:10C70000C01AC8F81C000431023801F0A9FABEE7CB -:10C71000D8F8183013B1587801F000F9D8F81C3067 -:10C72000B8F820109633C8F81C30D8F80C30942094 -:10C73000194401F0BDFAAAE701F0C4FAA7E74FF0E7 -:10C740000009A4E70123A8E7E8550021A836030162 -:10C7500001292DE9F04104460F4603D145682846DA -:10C76000BDE8F0810288022A23D1C368164E9D1EBF -:10C7700033F8023C33860288756386F838204168B6 -:10C78000284604F003FE022FE9D92389E76894F8CC -:10C7900010801F444246394606F1390004F0F6FD88 -:10C7A0004246384686F844806169376404F0EEFDFD -:10C7B000D5E7064D4168284604F0E8FD2088228927 -:10C7C000E1682844F2E700BFE8550021E454002165 -:10C7D00070B5324C0546238D0133238588B9237CFF -:10C7E000022B27D0032B4AD0012B54D1E369608D53 -:10C7F000218C963303449430043180B2E36101F01C -:10C8000057FA606B30B194F83820254904F0BEFD2A -:10C8100000236363206C30B194F84420214904F074 -:10C82000B5FD00232364281E236818BF0120BDE83E -:10C8300070401847A369586801F060F8A3699868C8 -:10C8400001F066F8A369587801F068F8A0694430EF -:10C85000FFF7B6FE6369A2689B1AE361238D012B83 -:10C8600009D194F82E0094F82F30834203D094F825 -:10C87000451001F071F8E06901F0AEF9C1E7A36974 -:10C8800013B1587801F04AF8E36996209633E361D2 -:10C89000FFF76EFEB5E701F015FAB2E7E8550021A3 -:10C8A000185600212156002108B500F023FFBDE8ED -:10C8B000084001F0C5BC000008B5044801F012F8BA -:10C8C000BDE80840024801F013B800BFD1C702011B -:10C8D00001C602017047000070B50546406801F0CE -:10C8E0000DF8A86801F014F8687801F017F895F9C8 -:10C8F000020001F07FF801F011F92B7B434C022B71 -:10C90000A8704AD0032B51D00023E38540F60803DA -:10C910006384A3846B7B022B6AD0032B6DD000232E -:10C9200084F84530282323842E78012E6BD9043EC9 -:10C93000012E8CBF002601262B7D8BB1082000F034 -:10C94000D3FE687D3246C000A97D00F0F80001F0FA -:10C95000E7FB287E05F1190101F0CAFB6B7DDB00C6 -:10C96000638595F82C305BB1314695F82F0001F0C6 -:10C9700029FC95F8300005F1310101F0B9FB1023D5 -:10C9800094F82E0094F84510A38500F0E5FF05F11A -:10C990004400BDE87040FFF713BE40F20113E38589 -:10C9A00040F20443638440F60803B2E7AA7B012AFD -:10C9B00015BF042384F82E3084F82E30102318BFBE -:10C9C000402384F82230502384F82430EB7B012B61 -:10C9D0000BBF0323042384F82F3084F82F300CBFBF -:10C9E0001023402384F82330502384F8253091E726 -:10C9F000012384F84530142395E7022384F8453059 -:10CA00004FF4A0738FE7012696E700BFE855002199 -:10CA100010B50FC8014C84E80F0010BDE855002187 -:10CA2000024B07C883E80700704700BFF855002194 -:10CA30002DE9F0410027124C0546A0680E462785D7 -:10CA400001F0EAF800F048FF022817D131462846E5 -:10CA5000FFF77EFE314680462846FFF79DFD0546DE -:10CA60000146404601F088F994F8220094F8241019 -:10CA7000093500FB051584F82670E561BDE8F081F5 -:10CA8000E855002170B504460E46FFF761FE3146B9 -:10CA900005462046FFF780FD04460146284601F082 -:10CAA0006BF9064B093493F8251093F8230000FB2B -:10CAB0000414D9690C44DC6170BD00BFE855002145 -:10CAC0002DE9F0414FF000080F4C431CA364A4F87B -:10CAD0004C10E3680F46218C06461944A068A4F860 -:10CAE000288001F0E9F9012805460BD100F0F4FE99 -:10CAF000032807D13946304601F002FAC4F81C80F9 -:10CB000084F82650BDE8F081E8550021034A431C13 -:10CB10009364A2F84C1001F0F3B900BFE85500216E -:10CB200001F0D0B801F0CEB800F0FEBF01F006B8B9 -:10CB300001F04CB801F04AB8704700000022014BE8 -:10CB40001A70704738560021024A13780133137067 -:10CB5000704700BF38560021024A13780BB1013BE1 -:10CB60001370704738560021142303809623837076 -:10CB70004FF47A7383804FF42F73C38040F21473A1 -:10CB8000038140F2013343810723037370477047E9 -:10CB900070B5062800F2AD80DFE800F004142045EF -:10CBA0005E1BA600544BD3F804321A0C0A708B702B -:10CBB0001A0AE823CB7007230B71C0234A704B710C -:10CBC000012005E0012300220B704A708B70CB70AE -:10CBD00070BD4A4BD3F800330B60F1E7002440F2FC -:10CBE00006450C81CD8340F20244FB2504234FF41B -:10CBF00080724FF40170CC824D840C8540F2E24586 -:10CC0000642408808B708A808B744A838A820B76B6 -:10CC10000A8481F82430CD844C85888581F82E30B3 -:10CC20000B73CA81CCE7344B0139D3F80462D3F8D3 -:10CC300008520023C3F12004A3F1200026FA03F2D6 -:10CC400005FA04F4224325FA00F008330243402B8E -:10CC500001F8012FEED1B3E7274BD3F804220A7075 -:10CC6000D3F80422120A4A70D3F80422120C8A70F4 -:10CC7000D3F80422120ECA70D3F808220A71D3F82E -:10CC80000822120A4A71D3F80822120C8A71D3F8CA -:10CC90000822120ECA71D3F80C0202F00F020872B9 -:10CCA000D3F80C4242F04002240A4C72D3F80C42F2 -:10CCB000240C8C72D3F80C42240ECC72D3F81042A0 -:10CCC0000C73D3F81042240A4C73D3F81042240C8E -:10CCD0008C73D3F810321B0ECB7300F03F0363F05C -:10CCE0007F03CA710B726BE70120102308704B7031 -:10CCF0006EE700206CE700BF0000FF010080FF012D -:10CD000000220C4BC3F80021D3F800110121C3F815 -:10CD10000421D3F804211960D3F8002102B170472F -:10CD2000D3F804010028F7D0C3F80421D3F8042174 -:10CD3000F1E700BF00D00041036810B50C68634004 -:10CD400013604C684368634053608C688368634039 -:10CD50009360C368C9684B40D36010BD002310B511 -:10CD600000F11002103112F8014D43EA440301F8BA -:10CD7000013D137882424FEAD313F4D110BD000075 -:10CD800038B50C460D4B0E491032C1F8043500F190 -:10CD9000100111F8015D03F8015B12F8015D814299 -:10CDA000DD73F6D1FFF7ACFF064A04F1100312F869 -:10CDB000011B03F8011DA342F9D138BD39560021EA -:10CDC00000D0004159560021F0B51C461368102CC4 -:10CDD0000D4695B01BBA57D1D16809BA0091916838 -:10CDE000526809BA12BACDE9022301913D4B3E4A7D -:10CDF000C3F8042500F1100313F8011D834202F863 -:10CE0000011BF9D110220021384804F0E6FAFFF79F -:10CE100077FF0CAA1646364B03F1100C174618681C -:10CE20005968083303C763453A46F7D19DF9303056 -:10CE3000002B2BDB304604A9FFF790FF9DF9103043 -:10CE4000002B2DDB08A904A8FFF788FF102C31D197 -:10CE50003246684604A9FFF76FFF1022002110A890 -:10CE600004F0BBFA214A314610A8FFF765FFFFF72F -:10CE700047FF1F4A05F1100312F8011B03F8011DBB -:10CE80009D42F9D115B0F0BD0093AFE7304610A92F -:10CE9000FFF764FF174904AA10A8FFF74DFFCDE77D -:10CEA00010A904A8FFF75AFF124908AA10A8FFF713 -:10CEB00043FFCBE7002280211346E4B210A894423E -:10CEC0000BD91DF8027007700132102A00F1010021 -:10CED000F5D1324608A910A8BDE70CBF0170037058 -:10CEE000F2E700BF00D00041395600214956002129 -:10CEF00059560021AD36030101220A4B10B51A60C4 -:10CF000000220144884202D101225A6010BDC3F8B8 -:10CF10000021D3F80041002CFBD0D3F8084500F8DD -:10CF2000014BEFE700900041024B40F00040C3F896 -:10CF3000CC0170470080014113B56B46124C134A77 -:10CF400092E80300124A83E8030019462046FFF7DF -:10CF500083F820460F4CFFF7E7F82046FEF79AFBD0 -:10CF600023780D4A43F00043C2F89031237802F54C -:10CF7000C04243F00043C2F88C302078FEF79EFB9D -:10CF800000F09CF802B010BDC8360301C0360301A2 -:10CF900095D002016956002100200141012101487C -:10CFA000FFF7DCB8C836030110B5044601F04CF9B0 -:10CFB000FFF7F4FF201A192809D407480023224656 -:10CFC0000321FFF7D6F801F041F9012010BD01F06F -:10CFD0003DF90020FAE700BFC836030170B50446EA -:10CFE000104BD3F81055FFF7D9FF0F4B4FF47A5180 -:10CFF000A34228BF2346A3FB0131EAB2C2F12005B8 -:10D0000001FA05F5A2F1200423FA02F221FA04F450 -:10D010002A43224302440123BDE870400021034813 -:10D02000FFF7A7B80080014170854100C8360301B1 -:10D0300008B504494FF47A720023A0FB010103F004 -:10D04000D7FF08BD40420F00411A08B508D44FF47D -:10D050007A700023A1FB0001024A03F0C9FF08BD5A -:10D060000020FCE740420F00401A20EAE0707047C1 -:10D07000034B02461960034801230221FFF779B8E8 -:10D080006C560021C836030102210148FFF787B81A -:10D09000C836030110B50446102000F04FF8B4F56F -:10D0A000A47F06D1FFF7F0FFBDE81040014B1B68DD -:10D0B000184710BD6C560021FFF770BF042108B55A -:10D0C0000846FEF7EDFE0122014B1A6108BD00BFC4 -:10D0D0000020014107B5302200210E4804F07DF9FF -:10D0E0000D4B01A91A889B782020ADF804208DF8FB -:10D0F0000630FEF7DFFC01A92120FEF7DBFC01A9C9 -:10D100001F20FEF7D7FC01A91C20FEF7D3FC03B0BB -:10D110005DF804FB70560021D036030108B52020CD -:10D12000FEF794FD2120FEF791FD1F20FEF78EFDF6 -:10D13000BDE808401C20FEF789BD000010B5174C63 -:10D14000637893B1162805D804EB4000837813B1B7 -:10D15000012B05D010BDC078BDE81040FEF7DEBC45 -:10D16000C078BDE81040FEF7CDBC10280DD004D823 -:10D1700048B10128EED12120EEE7112807D016286A -:10D18000E8D11C20E8E72020E6E71F20E4E71C2088 -:10D19000FEF7C4FC01232370DCE700BF70560021BA -:10D1A000134B5A7872B1162820D803EB40008378CD -:10D1B00013B1012B03D07047C078FEF7A3BCC07831 -:10D1C000FEF7ACBC10280BD003D828B1012805D03D -:10D1D0007047162806D070472020EEE72120ECE7A4 -:10D1E0001F20EAE71B780BB91C20E6E7704700BF59 -:10D1F0007056002116282DE9F34180460E46174649 -:10D200002ED8184D6B785BB9FF290DD001246C70B6 -:10D21000FFF784FFA64210D9012002B0BDE8F081DB -:10D2200001290AD9FF29F7D105EB4805EB78BB4264 -:10D2300016D13846FEF70AFDEEE70B4B05EB480525 -:10D240001A889B783846AE70EF7001A9ADF80420BB -:10D250008DF80630FEF72EFC4046FFF7A1FFDBE716 -:10D260000020DAE770560021D0360301054B1888FC -:10D27000054B00F5A06080B2A0FB0303800D803851 -:10D2800040B27047EE000021676606000023024AA4 -:10D290001380024A13807047EE000021EC00002149 -:10D2A000F8B50746FFF7E2FF0A4B0E46D3F80835FC -:10D2B00013F0010F14BF03240024044401F006F905 -:10D2C000054601F001F9E4B2283D254404443D70CF -:10D2D0003470F8BD0040004118B1054BB3F900307F -:10D2E000038019B1034BB3F900300B80704700BFC6 -:10D2F000EE000021EC000021024B1880024B0120BF -:10D3000019807047EE000021EC00002138B52D4B4C -:10D310000546D3F80835002213F0010F14BF03218E -:10D320000021FFF7A3FF01440423CCB2284649B2F1 -:10D3300001F0CEF8231858B28542DAB204DA431E5F -:10D340009D4202DB501E40B238BD831E9D4201DB70 -:10D35000901EF8E7C31E9D4201DBD01EF3E7031FBA -:10D360009D4201DB101FEEE7431F9D4201DB501F72 -:10D37000E9E7831F9D4201DB901FE4E7C31F9D4245 -:10D3800001DBD01FDFE7A0F108039D4202DBA2F121 -:10D390000800D8E7A0F10C039D4202DBA2F10C00CB -:10D3A000D1E7A0F110039D4202DBA2F11000CAE711 -:10D3B000A0F114039D42ACBFA2F11400A2F1280019 -:10D3C000C1E700BF0040004110B5044601F090F8ED -:10D3D000012804D10022094BC3F8002510BD032CFD -:10D3E00004D10120054BC3F80005F7E724B9034B2E -:10D3F0000120C3F80045F1E70020EFE700400041BD -:10D4000001F09AB8074B93F84B20074B012A05D03F -:10D41000022A05D0E322C3F820257047A322FAE7A9 -:10D42000C322F8E7D859002100E0004130B52C4A6A -:10D4300092F8223092F821101B0443EA012392F85B -:10D44000201092F827500B4392F82310002992F8ED -:10D45000241018BF4FF4801443EA815392F825102A -:10D4600008BF002443EA016392F8261043EA45739B -:10D47000002914BF4FF08061002123430B43194959 -:10D48000C1F8143592F82A3092F829401B0443EA77 -:10D49000042392F82840234392F82B4092F82C2042 -:10D4A000002C14BF4FF080740024002A14BF4FF0EA -:10D4B0000072002223431343C1F818350A4BC1F808 -:10D4C0001005D3F81042094A944207D104280CBF32 -:10D4D000D3F88430D3F88030C1F8883530BD00BF30 -:10D4E000D8590021008000410000FF0141414B510B -:10D4F000054A064B9069D3F854351B1AD08F1B1A76 -:10D50000B2F84000181A7047D85900210090014124 -:10D510000246012302210148FEF72BBEDC3603013F -:10D5200002210148FEF73BBEDC36030110202DE945 -:10D53000F047FFF703FE674BD3F8002152B10022FA -:10D54000C3F80021D3F80031634B1B78022B3ED087 -:10D55000032B40D05F4BD3F8042152B10022C3F813 -:10D560000421D3F804315C4B1B78032B01D1FFF766 -:10D57000D7FF584BD3F86C219AB100251220C3F87D -:10D580006C51554CD3F86C31FFF70AFE1320FFF7AE -:10D5900007FE94F80080B8F1020F1ED0B8F1030F17 -:10D5A00027D04C4BD3F83C21002A00F09080002279 -:10D5B000C3F83C21D3F83C21474A526C002A00F0C2 -:10D5C0008680BDE8F047D3F8680640B210471220C5 -:10D5D000FFF7B4FDBEE71320FAE700F0C3FF3F4BAF -:10D5E0002846D3F84C25A38F1344E361A3689847DA -:10D5F000D7E700F0B7FF394BE28FD3F850359B1ACD -:10D60000E361FFF775FF0646206B94F849304278D6 -:10D6100091463BB1324BC3F884501AB1C11C023061 -:10D6200003F0B4FEDFF8ACA0DAF8485500F05AFF7A -:10D6300005F07F0594F8357005446D42022F6DB2F8 -:10D6400009D1DAF85031012B4FF000030CBF4746E7 -:10D650000427CAF8503194F8492092B1B9F1000F6B -:10D660000FD002211E4BC3F80413D3F80411002974 -:10D67000FBD00221C3F808134FF48041194BC3F8C3 -:10D680008011144BD3F80034DB0709D41420FFF7C2 -:10D6900055FD2B463A46314603206468A04780E793 -:10D6A0007AB1B9F1000F0CD00D4BD3F8003443B967 -:10D6B0001420FFF743FD2B463A46314604206468A8 -:10D6C000ECE72B463A46314600206468E6E7BDE8C1 -:10D6D000F08700BF00800041D8590021009001412F -:10D6E00000E0004100E100E0014B83F822007047B8 -:10D6F000D8590021F7B5582200216D4803F06DFE7E -:10D70000002201236B496C4CC1F8FC2FC1F8FC3F8F -:10D71000D30003F1FF7303F58033D3F80003013026 -:10D720000CD0D3F8000301322040884202BFD3F866 -:10D730000003D3F804330360202AE9D15D4CD4F808 -:10D740003C3743F48063C4F83C37D4F83C371B05BE -:10D7500040F1A380D4F83C37584A23F0004323F02B -:10D76000FF0343F0004343F09603C4F83C37D4F87A -:10D7700040374F4D23F47F4343F4B053C4F8403750 -:10D780006B4692E803004E4A83E8030019464D4871 -:10D79000FEF762FC05F10C00FDF77CFF287BFFF72C -:10D7A000C3FB287B484E40F00043C6F88030FDF7AD -:10D7B00085FF05F10D00FDF76DFF6B7B05F10E0098 -:10D7C00043F00043C6F8C031C4F88030FDF762FF73 -:10D7D000AB7B05F10F0043F00043C6F8C431C4F839 -:10D7E0008430FDF757FFE87B002740F00043C4F882 -:10D7F0008C31C6F8CC30FDF761FF05F11000FDF764 -:10D8000049FF287C40F00043C4F8EC31C6F8D03022 -:10D81000FDF754FF05F11100FDF73CFF687C40F077 -:10D820000043C4F88431C6F8D430FDF747FF40F216 -:10D8300001230126C4F8503640F20313C4F82C75B6 -:10D84000C4F83065C4F8343540F25B63C4F8383549 -:10D85000D4F800221D4B20211343C4F800324FF4AA -:10D8600084732B84032385F82A30194B85F82C60A8 -:10D8700083F808134FF480721A601648C4F8040342 -:10D8800083F808131A60297CE87B00F083FE384691 -:10D89000FFF79AFD2E7003B0F0BDD4F8743723F073 -:10D8A000807323F0010343F08073C4F8743751E7A9 -:10D8B000D85900210080004100F0FFFFD436030159 -:10D8C00051DD0201DC36030100900141110110001D -:10D8D00000E100E003800008014B1878704700BFAA -:10D8E000D8590021014B9860704700BFD8590021DA -:10D8F000014B5860704700BFD8590021034B020EFE -:10D900000002C3F82425C3F81C05704700800041BD -:10D91000014BC3F83C057047008000410A280BD832 -:10D92000431CDBB20B4A5B00023300F07F00C2F8FD -:10D930000835C2F854057047242801D8831CF0E745 -:10D94000252804D026280CBF0C232723EAE7002330 -:10D95000E8E700BF00800041254B032883F834002E -:10D9600083F8351018D004281CD001280FD02922A4 -:10D970001A8701229A87032283F836202922013947 -:10D980005A87032914D8DFE801F01C2A232A282209 -:10D9900098871A870422EFE72B221A8701229A8799 -:10D9A0000622E9E72B221A8701229A870522E3E75C -:10D9B0000822DA872822A3F84020032283F83720A0 -:10D9C00070470522DA871822A3F840200422F5E7E1 -:10D9D0001922DA879022A3F840200622EEE71E22C1 -:10D9E000DA874FF4A872A3F840200522E6E700BFCB -:10D9F000D859002173B5464B0546D3F808350021A8 -:10DA000013F0010F0DF1060014BF03240024FFF7EB -:10DA100063FC0A23BDF90610002291FBF3F12144B7 -:10DA20000423CCB2284649B200F052FD064600F06D -:10DA30005FFDA219D3B252B29542364807DB0023EC -:10DA400080F84220344AC2F80C3502B070BD511E35 -:10DA50008D4204DB013B80F84230FF23F2E7911E48 -:10DA60008D4204DB023B80F84230FE23EAE7D11E00 -:10DA70008D4204DB033B80F84230FD23E2E7111FB7 -:10DA80008D4204DB043B80F84230FC23DAE7511F6F -:10DA90008D4204DB053B80F84230FB23D2E7911F27 -:10DAA0008D4204DB063B80F84230FA23CAE7D11FDF -:10DAB0008D4204DB073B80F84230F923C2E7A2F134 -:10DAC00008018D4204DB083B80F84230F823B9E7B7 -:10DAD000A2F10C018D4204DB0C3B80F84230F423B0 -:10DAE000B0E7A2F110018D4204DB103B80F8423018 -:10DAF000F023A7E7143A9542ABBF143B283B80F8CC -:10DB0000423080F84230ACBFEC23D8239AE700BF04 -:10DB100000400041D859002100800041014B93F999 -:10DB200042007047D8590021003818BF0120024B2D -:10DB300083F82C00704700BFD859002110B50C4B5A -:10DB40000C4C58B14FF40072C3F850260122122039 -:10DB50001A60FFF7F3FA0423237010BDC3F85006D0 -:10DB60001220FFF71DFB1320FFF71AFB0123F3E739 -:10DB700000800041D8590021024B83F8480083F807 -:10DB800049107047D8590021044A00F1100313F8D6 -:10DB9000011D834202F8011BF9D17047A4570021EF -:10DBA0000368034AC2F819304368C2F81D30704751 -:10DBB000A4570021014B83F84A007047D85900212F -:10DBC000014B83F84B007047D8590021014BC3E942 -:10DBD00014017047D859002138B505460C4CA0B146 -:10DBE000A269A38F218F02440B44D21A0023094853 -:10DBF0001946FEF7BEFA607BFDF760FDA069284478 -:10DC000000F024FD0223237038BD1422EEE700BF8C -:10DC1000D8590021DC36030110B50B4CA38F228F9D -:10DC200013441433C01AA3616061FFF7BDF920B932 -:10DC3000A3680120BDE8104018470223002023708C -:10DC4000BDE81040FFF7C8BFD8590021034AD2E908 -:10DC500006239B1A1844FFF7BFBF00BFD859002105 -:10DC600070B5114C0646B4F84050E38FA2691D44CC -:10DC700002440D441544A0B1638FD21A0023012140 -:10DC80000A48FEF776FAA07BFDF718FD2846FFF755 -:10DC90003FFCA069304400F0F5FC03230120237011 -:10DCA00070BD0122EAE700BFD8590021DC3603012C -:10DCB000034AD2E906239B1A1844FFF7D1BF00BFDD -:10DCC000D859002170B51E4E3378012B37D01D482E -:10DCD000FEF738FA012300251B4C2361707BFDF70A -:10DCE00007FDB07BFDF704FDC4F80051D4F8003106 -:10DCF000C4F80451D4F80431C4F80C51D4F80C31F0 -:10DD0000C4F81051D4F81031FFF70AFC0F4BC3F8D8 -:10DD1000005596F849200AB1C3F8845000F04CFA37 -:10DD200000F020FC1220FFF73BFA1320FFF738FA2F -:10DD3000012314203370BDE87040FFF731BA70BD85 -:10DD4000D8590021DC3603010080004100E0004189 -:10DD500070B5084C2378032B0BD1FFF7B3FF0023DA -:10DD6000656894F83520AC46BDE87040194602203D -:10DD7000604770BDD85900210239FF292DE9F041D3 -:10DD80000546464C06D9FFF79DFFA3680120BDE874 -:10DD9000F0411847002394F8482084F82830D21A1C -:10DDA00018BF012284F8232094F83420012A6AD075 -:10DDB000033A012A9DBF022384F8273040F203333F -:10DDC00084F8273094F83600A384FFF72FFB94F8EB -:10DDD0004820334B002A5DD0DFF8C8806A78C3F84A -:10DDE0000485314F94F84A30304E3B76D4E91431F3 -:10DDF00001F07F0139752946180A3B747874180CB4 -:10DE00001B0EB874FB7411F8023BF01C3370002336 -:10DE10007270B37003F0BAFA02222549254BC1F89B -:10DE20000025C1F80875C1F81435C1F80C65C1F8B2 -:10DE3000108594F83430032B04D0042B28D05A1EBC -:10DE4000534253411B0443F08073C1F80435FB2354 -:10DE5000C1F81835FFF7D6FA0023C1F80031D1F820 -:10DE60000021C1F80431D1F80421C1F80831D1F8FA -:10DE70000831D1F8003243F00103C1F80032012328 -:10DE80000B60BDE8F08184F827304FF4807399E788 -:10DE90001346D7E7C3F80455F3E700BFD85900216C -:10DEA00000800041A0560021A4570021C85700213E -:10DEB00000E00041C858002170B5104D0E466B8F30 -:10DEC000013BC01AAB616861FFF76EF8044638B1D8 -:10DED000032331462B700020BDE87040FFF7C0BE21 -:10DEE0001420FFF72BF9FFF7EDFE23462146012012 -:10DEF0006E6895F83520B047204670BDD85900218E -:10DF0000012970B505464C4C0BD8FFF7DBFE00230A -:10DF1000656894F83520AC46BDE87040194601208C -:10DF2000604794F849300239003B18BF012384F858 -:10DF3000233094F8353084F82810012B71D0023B3F -:10DF4000022B97BF0223002384F8273040F20333CB -:10DF500088BF84F8273094F83700A384FFF766FA67 -:10DF600094F84920354B002A63D03548C3F804059E -:10DF700094F84B3094F84A20022B18BFB2FA82F280 -:10DF8000304B18BF52091A76D4E91421160A1A74B4 -:10DF90005E74160C120EDA74022201F07F011975FC -:10DFA00029499E74C1F80025C1F80835274BC1F8EE -:10DFB0001435C1F80C05C1F8105594F83530032B11 -:10DFC00004D0042B33D05A1E53425341204A42EA14 -:10DFD0000343C1F8043594F82830C1F81835FFF729 -:10DFE00011FA0023C1F80031D1F80021C1F8043141 -:10DFF000D1F80421C1F80831D1F80821D1F8002264 -:10E0000022F00102C1F80022627C42F00042C1F815 -:10E010008420C1F80431D1F8043101230B60256359 -:10E0200070BD002384F827304FF4807393E71346C4 -:10E03000CCE7C3F80455F2E7D8590021008000412D -:10E04000A0560021A457002100E00041C85800213B -:10E05000010000010378427803F03F0343EAC21352 -:10E0600082780F4943EA0223C27843EA02330279F5 -:10E0700043EAC233427943EA02438279120602F04C -:10E0800070621343C1F81039B0F90A20054B03EA56 -:10E0900002430289C2F30C021343C1F814397047DA -:10E0A000008000410000FF0F437830B5002B8378DB -:10E0B00014BF08210021002B14BF10220022037975 -:10E0C000C57804789B0243EA85132343447943EAE5 -:10E0D00044338479C07943EA044343EA00630B4341 -:10E0E0001343024AC2F8043930BD00BF008000412A -:10E0F00001230A4A0328C2F82C394FF0000306D83E -:10E10000C2F82839C2F82839C2F8283970471946A8 -:10E1100001339842C2F82819FAD8704700800041AC -:10E120002DE9F0410127002A14BF3B4600234FF0A0 -:10E13000000618BF20224FF0020886B005460C46A4 -:10E1400001A88DF805308DF804708DF806608DF803 -:10E1500007608DF808808DF809708DF80A208DF819 -:10E160000B20FFF7A1FF0323ED08BC42CDE90366B6 -:10E1700005968DF80C508DF80D708DF80F308DF8D8 -:10E1800011300BD044450FD014B90A4AC2F80039F7 -:10E1900003A8FFF75FFF06B0BDE8F081054AC2F8AB -:10E1A00000898DF80E30F3E7024BC3F800498DF873 -:10E1B0000E40EDE7008000410148FFF775BF00BF4A -:10E1C000E43603011C4B1D4A70B5C3F850290126E3 -:10E1D00052220029C3F8542914BF3346002386B0C5 -:10E1E00018BF202100248DF805300223054601A820 -:10E1F0008DF808308DF80A108DF80B108DF804603A -:10E200008DF806408DF807408DF80960FFF74CFF48 -:10E210000323B542CDE903448DF80F300CBF022330 -:10E22000334603A805948DF80D608DF81130FFF783 -:10E2300011FF06B070BD00BF00800041305A0021C0 -:10E2400070471020FEF77ABF72B6704762B670470B -:10E2500008B54FF082424FF0FF33C2F8003E02F59E -:10E26000E042C2F8003E0023C2F8403EC2F8443EFD -:10E2700040F201127F201D49C1F840251C4AC2F816 -:10E280001801C1F8043EC1F8083EC2F82431C2F8B2 -:10E290002C3102F57F22C2F810311648FDF76EF9D5 -:10E2A000FDF77CF90120FDF793F9134BD3F80C240B -:10E2B000D3F80C14C903F9D5D207F7D50720FDF719 -:10E2C0007BFB00230D4AC2F804350D4A136001227E -:10E2D0000C4B1A70FEF7FEFE1120FEF761FF1020B6 -:10E2E000FEF72CFFBDE80840FEF726BE00000841FF -:10E2F0000020004143E202010050004100A0004123 -:10E30000845B0021785B0021014B1870704700BFCF -:10E31000785B0021014B1868704700BF845B0021C7 -:10E32000054B064883421A4604D211680433B1F102 -:10E33000AF3FF7D0801A704700F0002100000121A4 -:10E3400008B508B1FEF74AFE1020FEF729FF30BFDE -:10E35000BDE808401020FEF7F1BE7047012307B565 -:10E360008DF8043000238DF805308DF806304FF617 -:10E37000FF73984202D001A9FDF79CFB03B05DF842 -:10E3800004FB000007B5084B1A889B78ADF8042001 -:10E390008DF806304FF6FF73984202D001A9FDF7C1 -:10E3A00089FB03B05DF804FBEC36030138B5244C5F -:10E3B000244D601DFDF76EF96379A01D43F0004305 -:10E3C000C5F8D831FDF766F9A379608A43F00043B8 -:10E3D000C5F8DC314FF6FF73984209D0FDF7D2FB48 -:10E3E0006279194B42F0004119501046FDF766F969 -:10E3F0004FF6FF73A089984209D0FDF7C3FBA279BD -:10E40000114B42F0004119501046FDF757F94FF6F5 -:10E41000FF73E089984211D0FDF7B4FBA2790A4B53 -:10E4200042F0004119501046FDF748F9E089FDF728 -:10E43000B3FB227A044B42F000421A5038BD00BFB1 -:10E44000885B00210090014180A000414FF6FF73DE -:10E45000984201D0FDF7FABB70474FF6FF73984220 -:10E4600001D0FDF74FBB70474FF6FF73984201D0C4 -:10E47000FDF754BB70474FF6FF73984210B5044642 -:10E480000CD0FDF789FB012200F1824303F5204304 -:10E490002046BDE810401A60FDF760BB10BD0000CB -:10E4A0004FF6FF73984210B5044609D00548002383 -:10E4B000C9B2FDF75EFE2046BDE81040FDF73ABB4D -:10E4C00010BD00BFDC3603010A2070470A207047E8 -:10E4D000034B1B88002B14BF0A200020704700BF8D -:10E4E000885B0021014B9878704700BF885B002152 -:10E4F00038B54FF6FF73074D04466889984204D03B -:10E500001CB10A2C04D1FFF7A8FF01202C8038BDD4 -:10E510000020FCE7885B00214FF6FF72054B59890C -:10E52000914202D008B10E2802D1588001207047D4 -:10E5300000207047885B002110B5044620B10128F7 -:10E5400008D00024204610BD054B0124188AFFF78F -:10E550008BFFF7E7024B188AFFF77FFFF2E700BF58 -:10E56000885B002110B50A4CA089FFF784FFE08981 -:10E57000FFF781FF608AFFF77EFF6089FFF774FF76 -:10E58000208AFFF771FFA08ABDE81040FFF76CBF3B -:10E59000885B002138B52E23184C0025A381202349 -:10E5A000E381212323822B2365606382E0712C2386 -:10E5B0001F20A3822581608121722560FFF7CEFE96 -:10E5C000208AFFF7CBFEA08AFFF7C8FE608AFFF71C -:10E5D000D9FEA089FFF7D6FEE089FFF7D3FEFFF74B -:10E5E000E5FEFFF7BFFF2846FFF782FF2846FFF74B -:10E5F00093FF208ABDE83840FFF736BF885B0021D3 -:10E6000010B5114CFFF7AEFF6089FFF71FFF208A9E -:10E61000FFF71CFFA08AFFF719FF608AFFF716FFBC -:10E62000A089FFF713FFE089FFF710FFA079FDF73E -:10E630005FF8A079FDF734F86079FDF759F8607953 -:10E64000BDE81040FDF72CB8885B002138B50546C1 -:10E650000B4CA0F12C020621608AFFF721FFA5F1E7 -:10E660001A020721A089FFF71BFF2078FFF740FF60 -:10E670002079FFF761FFA08ABDE83840FFF7EDBEC3 -:10E68000885B002138B505460A4CA0F11C02062122 -:10E69000608AFFF705FFE089A5F10A020721FFF76D -:10E6A000FFFE2079FFF748FFA08ABDE83840FFF75A -:10E6B000D4BE00BF885B00212DE9F04105468846A5 -:10E6C00017461E46174CFFF79BFFBDF8183028462B -:10E6D0006382BDF81C306581A382A4F80C80E781B9 -:10E6E0002682FFF73BFE208AFFF738FEA08AFFF75D -:10E6F00035FE608AFFF746FEA089FFF743FEE089FA -:10E70000FFF740FEFFF752FEFFF72CFF0020FFF758 -:10E71000EFFE0020FFF700FF208AFFF7A5FE012093 -:10E72000BDE8F081885B002100207047034630B5CA -:10E73000002010C920CA641910C310C920CA6C4136 -:10E7400010C310C920CA6C4110C310C920CA6C4143 -:10E7500010C310C920CA6C4110C310C920CA6C4133 -:10E7600010C310C920CA6C4110C310C920CA6C4123 -:10E7700010C3404130BD30B5002310C920CA641B0E -:10E7800010C010C920CAAC4110C010C920CAAC4189 -:10E7900010C010C920CAAC4110C010C920CAAC4179 -:10E7A00010C010C920CAAC4110C010C920CAAC4169 -:10E7B00010C010C920CAAC4110C05B41B3FA83F04D -:10E7C000400930BD2022002102F007BE031F1C308B -:10E7D00053F8042F1AB98342FAD101207047002060 -:10E7E0007047002351F8232040F823200133082BE1 -:10E7F000F8D1704710B500F12003203153F8044DD3 -:10E8000051F8042D944204D805D38342F6D1002058 -:10E8100010BD0120FCE74FF0FF30F9E7002200F1C6 -:10E820002003834200D1704753F8041D42EA51028D -:10E830001A60CA07F5E70000F0B5002789B0FFF7B6 -:10E84000D0FFCB6A0C4603930B6B064604934B6BCD -:10E850006A4605938B6B68460693CB6B69460793B4 -:10E86000CDE901770097FFF761FF6A46054631461B -:10E870003046FFF75BFF236B6A460393636B694681 -:10E880000493A36B05440593E36B6846CDE9063713 -:10E89000FFF74CFF6A46314605443046FFF746FF16 -:10E8A000236A6A460093636A31460193A36A05446A -:10E8B0000293A36B30460693E36BCDE9047707938D -:10E8C0000397FFF733FF636AA26B0093A36A049276 -:10E8D0000193E36AE26B0293636B3146CDE9052352 -:10E8E0000393236A6A46054430460793FFF71EFFE9 -:10E8F000E36A6A460093236B31460193636B0544D8 -:10E900000293236A30460693A36ACDE904770793FE -:10E910000397FFF730FF236B6A460093636B314622 -:10E920000193A36B2D1A0293E36B30460393636A42 -:10E93000CDE904770693E36A0793FFF71CFF636B47 -:10E940006A460093A36B31460193E36B2D1A029341 -:10E95000236A30460393636A0493A36ACDE90537BB -:10E96000236B0793FFF707FFA36B2D1A0093E36B4D -:10E970006A46CDE90137636A31460393A36A30469C -:10E980000493E36ACDE90537636B0E4C0793FFF7F9 -:10E99000F2FE2D1A0DD42DB931462046FFF72AFF7D -:10E9A00001280DD0224631463046FFF7E4FE2D1AED -:10E9B000F1E7224631463046FFF7B8FE2D18F8D46D -:10E9C00009B0F0BD703703012DE9F04F93B001900D -:10E9D00002A800F1180002F1180218C9C0CAA3FB6E -:10E9E00006BC40F804BB4FF0000AA3FB07B91CEBC0 -:10E9F0000B0C49F10009A4FB06BE1CEB0B0C59EBF8 -:10EA00000E094AF1000A40F804CBA4FB07CE19EB2B -:10EA10000C094AEB0E0AA0E80006A0F11C00A2F1C6 -:10EA20001402B2E8C00120C9A3FB06BC40F804BB35 -:10EA30004FF0000AA3FB07B91CEB0B0C49F10009CE -:10EA4000A4FB06BE1CEB0B0C59EB0E094AF1000AA5 -:10EA500040F804CB4FF0000BA3FB08CE19EB0C09D8 -:10EA60005AEB0E0A4BF1000BA4FB07CE19EB0C0975 -:10EA70005AEB0E0A4BF1000BA5FB06CE19EB0C0965 -:10EA80005AEB0E0A4BF1000B40F8049B08C94FF0FB -:10EA9000000CA4FB08E91AEB0E0A5BEB090B4CF126 -:10EAA000000CA5FB07E91AEB0E0A5BEB090B4CF116 -:10EAB000000CA3FB06E91AEB0E0A5BEB090B4CF109 -:10EAC000000CD0F800E01AEB0E0A5BF1000B4CF1E1 -:10EAD000000C40F804AB10C94FF0000EA5FB089ADB -:10EAE0001BEB090B5CEB0A0C4EF1000EA3FB079A23 -:10EAF0001BEB090B5CEB0A0C4EF1000EA4FB069A13 -:10EB00001BEB090B5CEB0A0C4EF1000ED0F80090E9 -:10EB10001BEB090B5CF1000C4EF1000E40F804BB3E -:10EB200040CA4FF00009A5FB06AB1CEB0A0C5EEBDC -:10EB30000B0E49F10009A3FB08AB1CEB0A0C5EEBC2 -:10EB40000B0E49F10009A4FB07AB1CEB0A0C5EEBB2 -:10EB50000B0E49F10009D0F800A01CEB0A0C5EF185 -:10EB6000000E49F1000940F804CB80CA4FF0000ABA -:10EB7000A5FB07BC1EEB0B0E59EB0C094AF1000A72 -:10EB8000A3FB06BC1EEB0B0E59EB0C094AF1000A65 -:10EB9000A4FB08BC1EEB0B0E59EB0C094AF1000A52 -:10EBA000D0F800B01EEB0B0E59F100094AF1000A33 -:10EBB00040F804EB4FF0000BA3FB07CE19EB0C0958 -:10EBC0005AEB0E0A4BF1000BA4FB06CE19EB0C0915 -:10EBD0005AEB0E0A4BF1000B40F8049BA4FB07E92B -:10EBE0001AEB0E0A4BEB090BA0E8000CA0F1340065 -:10EBF000A1F11401A2F1200238C9B2E8C001A3FBBF -:10EC000006BC40F804BB4FF0000AA3FB07B91CEB9D -:10EC10000B0C49F10009A4FB06BE1CEB0B0C59EBD5 -:10EC20000E094AF1000A40F804CB4FF0000BA3FB99 -:10EC300008CE19EB0C095AEB0E0A4BF1000BA4FBA2 -:10EC400007CE19EB0C095AEB0E0A4BF1000BA5FB92 -:10EC500006CE19EB0C095AEB0E0A4BF1000B40F8EB -:10EC6000049B08C94FF0000CA4FB08E91AEB0E0A3C -:10EC70005BEB090B4CF1000CA5FB07E91AEB0E0A44 -:10EC80005BEB090B4CF1000CA3FB06E91AEB0E0A37 -:10EC90005BEB090B4CF1000CD0F800E01AEB0E0A0C -:10ECA0005BF1000B4CF1000C40F804AB10C94FF0C5 -:10ECB000000EA5FB089A1BEB090B5CEB0A0C4EF14E -:10ECC000000EA3FB079A1BEB090B5CEB0A0C4EF141 -:10ECD000000EA4FB069A1BEB090B5CEB0A0C4EF131 -:10ECE000000ED0F800901BEB090B5CF1000C4EF10C -:10ECF000000E40F804BB20C94FF00009A3FB08AB8D -:10ED00001CEB0A0C5EEB0B0E49F10009A4FB07ABF0 -:10ED10001CEB0A0C5EEB0B0E49F10009A5FB06ABE0 -:10ED20001CEB0A0C5EEB0B0E49F10009D0F800A0B9 -:10ED30001CEB0A0C5EF1000E49F1000940F804CB0F -:10ED400008C94FF0000AA4FB08BC1EEB0B0E59EBE0 -:10ED50000C094AF1000AA5FB07BC1EEB0B0E59EB90 -:10ED60000C094AF1000AA3FB06BC1EEB0B0E59EB83 -:10ED70000C094AF1000AD0F800B01EEB0B0E59F155 -:10ED800000094AF1000A40F804EB10C94FF0000BEB -:10ED9000A5FB08CE19EB0C095AEB0E0A4BF1000B40 -:10EDA000A3FB07CE19EB0C095AEB0E0A4BF1000B33 -:10EDB000A4FB06CE19EB0C095AEB0E0A4BF1000B23 -:10EDC000D0F800C019EB0C095AF1000A4BF1000B06 -:10EDD00040F8049B40CA4FF0000CA5FB06E91AEB73 -:10EDE0000E0A5BEB090B4CF1000CA3FB08E91AEBD4 -:10EDF0000E0A5BEB090B4CF1000CA4FB07E91AEBC4 -:10EE00000E0A5BEB090B4CF1000CD0F800E01AEB9A -:10EE10000E0A5BF1000B4CF1000C40F804AB80CA09 -:10EE20004FF0000EA5FB079A1BEB090B5CEB0A0CDD -:10EE30004EF1000EA3FB069A1BEB090B5CEB0A0CD0 -:10EE40004EF1000EA4FB089A1BEB090B5CEB0A0CBD -:10EE50004EF1000ED0F800901BEB090B5CF1000C9A -:10EE60004EF1000E40F804BB52F8048B4FF000093D -:10EE7000A5FB08AB1CEB0A0C5EEB0B0E49F100097D -:10EE8000A3FB07AB1CEB0A0C5EEB0B0E49F1000970 -:10EE9000A4FB06AB1CEB0A0C5EEB0B0E49F1000960 -:10EEA000D0F800A01CEB0A0C5EF1000E49F100093D -:10EEB00040F804CB40CA4FF0000AA5FB06BC1EEB8D -:10EEC0000B0E59EB0C094AF1000AA3FB08BC1EEB20 -:10EED0000B0E59EB0C094AF1000AA4FB07BC1EEB10 -:10EEE0000B0E59EB0C094AF1000AD0F800B01EEBEA -:10EEF0000B0E59F100094AF1000A40F804EB80CAF0 -:10EF00004FF0000BA5FB07CE19EB0C095AEB0E0ACC -:10EF10004BF1000BA3FB06CE19EB0C095AEB0E0AC2 -:10EF20004BF1000BA4FB08CE19EB0C095AEB0E0AAF -:10EF30004BF1000BD0F800C019EB0C095AF1000A94 -:10EF40004BF1000B40F8049B4FF0000CA3FB07E9CA -:10EF50001AEB0E0A5BEB090B4CF1000CA4FB06E963 -:10EF60001AEB0E0A5BEB090B4CF1000C40F804ABFA -:10EF7000A4FB079A1BEB090B4CEB0A0CA0E800184A -:10EF8000019802A9FFF758FC13B0BDE8F08F2DE9F6 -:10EF9000F04F93B0019002A80CC901F1100160C9B3 -:10EFA00000F11800A2FB058940F8048BA2FB06CAF9 -:10EFB00019EB0C094AF1000A40F8049BA3FB0689EF -:10EFC0001AEB080A49F1000BA0E8000CA0F1280098 -:10EFD000A1F12001FCC9A2FB02BC40F804BB4FF028 -:10EFE0000009A2FB03AB1CEB0A0C5BF1000849F122 -:10EFF00000091CEB0A0C58EB0B0849F1000940F81A -:10F0000004CB4FF0000AA2FB04BC1BEB0B0B5CEB28 -:10F010000C0C4AF1000A18EB0B0859EB0C094AF1E9 -:10F02000000AA3FB03BC18EB0B0859EB0C094AF1CF -:10F03000000A40F8048B4FF0000CA2FB058BDE4663 -:10F04000E3FB048BDE4588BF4CF1000C18EB08088D -:10F050005BEB0B0B4CEB0C0C18EB09085BEB0A0B96 -:10F060004CF1000C40F8048B4FF0000AA2FB06891B -:10F07000CE46E3FB0589CE4588BF4AF1000A18EB6E -:10F08000080859EB09094AEB0A0ACE46E4FB048951 -:10F09000CE4588BF4AF1000A18EB0B0859EB0C0962 -:10F0A0004AF1000A40F8048B4FF0000CA2FB078BDA -:10F0B000DE46E3FB068BDE4588BF4CF1000CDE46E6 -:10F0C000E4FB058BDE4588BF4CF1000C18EB08080B -:10F0D0005BEB0B0B4CEB0C0C18EB09085BEB0A0B16 -:10F0E0004CF1000C40F8048B04C94FF0000AA3FB5C -:10F0F0000789CE46E4FB0689CE4588BF4AF1000A5F -:10F10000D0F800E018EB0E0859F100094AF1000AA6 -:10F1100018EB080859EB09094AEB0A0ACE46E5FB49 -:10F120000589CE4588BF4AF1000A18EB0B0859EB58 -:10F130000C094AF1000A40F8048B4FF0000CA3FBC5 -:10F14000028BDE46E4FB078BDE4588BF4CF1000CEA -:10F15000DE46E5FB068BDE4588BF4CF1000CD0F89F -:10F1600000E018EB0E085BF1000B4CF1000C18EB03 -:10F1700008085BEB0B0B4CEB0C0C18EB09085BEB7A -:10F180000A0B4CF1000C40F8048B08C94FF0000A40 -:10F19000A4FB0289CE46E5FB0789CE4588BF4AF12C -:10F1A000000AD0F800E018EB0E0859F100094AF106 -:10F1B000000A18EB080859EB09094AEB0A0ACE467F -:10F1C000E6FB0689CE4588BF4AF1000A18EB0B081A -:10F1D00059EB0C094AF1000A40F8048B4FF0000C7F -:10F1E000A4FB038BDE46E5FB028BDE4588BF4CF1BA -:10F1F000000CDE46E6FB078BDE4588BF4CF1000CB9 -:10F20000D0F800E018EB0E085BF1000B4CF1000C9D -:10F2100018EB08085BEB0B0B4CEB0C0C18EB09081C -:10F220005BEB0A0B4CF1000C40F8048B4FF0000A2A -:10F23000A5FB0389CE46E6FB0289CE4588BF4AF18D -:10F24000000A18EB080859EB09094AEB0A0ACE46EE -:10F25000E7FB0789CE4588BF4AF1000A18EB0B0887 -:10F2600059EB0C094AF1000A40F8048B4FF0000CEE -:10F27000A6FB038BDE46E7FB028BDE4588BF4CF125 -:10F28000000C18EB08085BEB0B0B4CEB0C0C18EBB1 -:10F2900009085BEB0A0B4CF1000C40F8048B4FF0B3 -:10F2A0000008A7FB031A49185AEB0A0A48F100089C -:10F2B0001BEB010B5CEB0A0C48F10008A2FB021AE5 -:10F2C0001BEB010B5CEB0A0C48F1000840F804BB97 -:10F2D0004FF0000BA2FB031A49185AEB0A0A4BF134 -:10F2E000000B1CEB010C58EB0A084BF1000B40F82B -:10F2F00004CBA3FB031A18EB01085BEB0A0BA0E895 -:10F300000009019802A9FFF797FA13B0BDE8F08F42 -:10F3100070B5064614460D4688B011466846FFF79C -:10F3200036FE6A4631463046FFF74EFB22466946B6 -:10F330006846FFF749FB6A4629462846FFF744FB23 -:10F3400008B070BD0B1F1C3153F8042F0438120E87 -:10F3500080F820205A888B4280F821201A684FEAD2 -:10F36000122280F822201A6880F82320ECD17047FE -:10F3700001F11C0304381A688B4212BA40F8042FBA -:10F38000A3F10403F7D1704708B50146FFF71EFA51 -:10F3900030B101F12000FFF719FA003818BF012041 -:10F3A00008BD000010B50446FFF7E5F930B121466D -:10F3B0002046BDE81040024AFFF7B8B910BD00BFB3 -:10F3C00070370301F0B5144606461D460F4689B056 -:10F3D000024621466846FFF7E5FF69466846FFF7A3 -:10F3E000D6FD6A4631463046FFF7EEFA6A462146B8 -:10F3F0002046FFF7E9FA3A4629462846FFF7D2FFAA -:10F4000029466846FFF7C3FD324669466846FFF75E -:10F41000C9FF224669466846FFF7C4FF32462146C7 -:10F420002046FFF7BFFF224639463846FFF7CCFAA1 -:10F430006A4631462046FFF7B5FF22462946284650 -:10F44000FFF7C2FA3A4629462846FFF7ABFF69465E -:10F450002046FFF7C6F909B0F0BD000010B504461C -:10F46000FFF764F928B920460649FFF7C3F90028D9 -:10F4700006DB21462046BDE81040024AFFF77BB973 -:10F4800010BD00BF70370301F0B5144605461E4697 -:10F490000F4699B0024621466846FFF783FF69464A -:10F4A0006846FFF774FD6A4629462846FFF78CFA3E -:10F4B0006A4621462046FFF787FA3A4631466846B3 -:10F4C000FFF7CCFF3A4631463046FFF76BFF2A463E -:10F4D000214608A8FFF766FF3946384608AAFFF715 -:10F4E00073FA2246294608A8FFF7B8FF314620469E -:10F4F000FFF74DFD2146204608AAFFF753FF22469D -:10F50000294610A8FFF74EFF3146304610AAFFF7F4 -:10F510005BFA3A4631463046FFF744FF694610A889 -:10F52000FFF735FD10A9084608AAFFF73BFF2A465A -:10F5300010A908A8FFF736FF08A96A460846FFF792 -:10F5400043FA3A46384608A9FFF72CFF284610A987 -:10F55000FFF747F919B0F0BD2DE9F04F17460278D3 -:10F56000ADB004468946DDF8D880042A00F26381F4 -:10F57000DFE812F00500B300D200F9000F0100F13E -:10F5800024053946284604F16406FFF72AF907F1F5 -:10F5900020013046FFF725F9271D04F14409B8F191 -:10F5A000000F00F09080414614A8FFF71AF9294691 -:10F5B0003846FFF716F931464846FFF712F9284654 -:10F5C00014AAFFF7A5FE14A8FFF700F900286CD1D4 -:10F5D00031461CA8FFF7DBFC1CAA294624A8FFF72C -:10F5E000F3F91CA90846FFF7D2FC14AA31463046AD -:10F5F000FFF7EAF914A90846FFF7C9FC294628468F -:10F6000014AAFFF72BFF14AA11461046FFF726FF96 -:10F6100014AA10462946FFF7C5FE2946284614AA13 -:10F62000FFF7D2F92A46294614A8FFF717FF294603 -:10F63000284614AAFFF712FF636AD90749D529465D -:10F64000C34A2846FFF772F880462846FFF7E6F8D7 -:10F65000236C43EAC8732364294614A8FFF797FC78 -:10F6600014A9084624AAFFF79DFE14A9084624AA57 -:10F67000FFF798FE24A9084614AAFFF793FE29462F -:10F68000284624AAFFF7A0F91CAA10462946FFF72E -:10F6900089FE284614A9FFF7A4F8314614A8FFF7FD -:10F6A000A0F830461CA9FFF79CF84946384614AA32 -:10F6B000FFF72EFEFF23C4F88430012300202370BF -:10F6C0002DB0BDE8F08F14A8FFF77CF80123149348 -:10F6D0006DE72846FFF7A2F8BEE70121D0F88420A5 -:10F6E000501153F8203002F01F0201FA02F21A42C0 -:10F6F0000CBF0A460022881A4001520102F144035D -:10F7000000F14401043204302344224421442044C3 -:10F71000FFF7BAFE0223D1E70121D0F8842050116F -:10F7200053F8203002F01F0201FA02F21A420CBF15 -:10F730000A46002250018A1A520102F1440300F1E4 -:10F740004401043204302344224421442044FFF77E -:10F7500039FED4F88430013B002BC4F88430CCBF90 -:10F7600001230323AAE71A6802F00100D24302F042 -:10F7700001024001520102F1440300F1440104324C -:10F7800004302344224421442044FFF77DFE042317 -:10F7900094E71D6804F1040BE84305F0010500F04F -:10F7A00001035A4604F1240104A802350293FFF72D -:10F7B000F9FD6B0103F1040A04A9A244084652466C -:10F7C0000193FFF701F904A908463A46FFF7FCF850 -:10F7D00004A8FEF7FBFF80B304A8FEF7F3FF04A91B -:10F7E000084607F12002FFF7EFF8019B04A9A3F1F7 -:10F7F0003C0525442A460846FFF7E6F8029B2A46C0 -:10F80000580100F14401043053462144204404F1DE -:10F810004405FFF7D7FD04AA29465846FFF778FDAF -:10F8200059464846FEF7DDFF294609F12000FEF75C -:10F83000D8FF05232370012042E70CAE304604A90F -:10F84000FEF7CFFF424914A8FEF7CBFF1CA8FEF736 -:10F85000B9FF012324AD28461C93FEF7B3FFDFF860 -:10F86000F080304614A9FEF7C5FF20B91CA904A8F2 -:10F87000FEF7B7FFB3E70C9BDA0718D43046FEF764 -:10F88000CDFF1C9810F0010305D01CA94246084684 -:10F89000FEF74CFF03461CA80393FEF7BFFF039B34 -:10F8A000002BDED0239B43F000432393D9E7149B26 -:10F8B000DB0718D414A8FEF7B1FF249810F0010359 -:10F8C00005D0424629462846FEF730FF0346284623 -:10F8D0000393FEF7A3FF039B002BC2D02B9B43F0A7 -:10F8E00000432B93BDE7002818DD314614AA3046AB -:10F8F000FEF741FF3046FEF791FF29461CA8FEF7B0 -:10F9000079FF002804DA1CA942460846FEF70EFFDC -:10F910001CA92A460846FEF72EFFB2E714A9324674 -:10F920000846FEF728FF14A8FEF778FF28461CA912 -:10F93000FEF760FF002804DA424629462846FEF713 -:10F94000F5FE294628461CAAFEF715FFB5E700BFBD -:10F9500070370301014B1860704700BFF0000021B1 -:10F96000074B10B5002104464FF4BC72184601F055 -:10F9700034FD2146BDE810400430FFF7F9BC00BF5C -:10F98000A05B00212DE9F341294D2B78012B2BD0D1 -:10F99000022B40D0002B48D1281DFEF717FF04464C -:10F9A00018B1002002B0BDE8F0812248291DFEF701 -:10F9B00021FF01280646F4D105F164071D4A05F12F -:10F9C0008408291D3846C5F8A470C5F8A880FEF73C -:10F9D000ADFE3946C5F8AC00164A4046FEF7A6FE15 -:10F9E00085F8B0402E70DCE7D5F8AC300024B3FACF -:10F9F00083F35B0905EB83030094D3F8A4300E4A2C -:10FA000005F1240105F1B000FFF7A6FD0028C8D0DC -:10FA100002232B70C5E705F12400FFF7B5FC10B1F8 -:10FA200000202870BEE703232B700120BAE700BF37 -:10FA3000A05B002150370301F036030138B50446BE -:10FA4000084D0846291DFFF77DFC204605F12401DD -:10FA5000FFF778FC05F1440104F12000BDE83840CF -:10FA6000FFF770BCA05B0021014610B5A8B018A834 -:10FA7000FFF77EFC203120A8FFF77AFC18A8FFF7DB -:10FA800083FC0446002833D11A4818A9FEF7B2FEB9 -:10FA900001282AD1174820A9FEF7ACFE012824D15D -:10FAA000684620A9FFF773FA1C22214611A801F02D -:10FAB00094FC032318A908A81093FFF768FA08A973 -:10FAC000084610AAFFF76EFC08A9084618AAFEF718 -:10FAD0007BFF08A90846084AFFF7C0FC684608A94A -:10FAE000FEF788FEB0FA80F46409204628B010BD05 -:10FAF0000024FAE770370301303703012DE9F041A4 -:10FB00004FF4BC7206460F461E48002101F065FC0A -:10FB100040241C4DDFF870802021D8F800301948AF -:10FB2000984758B32846FEF751FE38BB2D62174C54 -:10FB300039462046FFF71CFC3146A4F18000FFF750 -:10FB400017FC06F12001A4F16000FFF711FC04F19D -:10FB5000200621460E4A2046C5F8E440C5F8E86074 -:10FB6000FEF7E4FD2146C5F8EC00094A3046FEF7F1 -:10FB7000DDFD002385F8F030BDE8F081013CCBD1FC -:10FB8000D5E700BFA05B0021F0000021445C00210C -:10FB90005037030107B50B48D0F8EC30026AB3FACE -:10FBA00083F35B09009200EB830300F1240200F170 -:10FBB0006401D3F8E430F030FFF7CEFC03B05DF819 -:10FBC00004FB00BFA05B00210149FFF7BBBB00BFE6 -:10FBD000045C002130B4046B0B4684B9C1684568ED -:10FBE0001F2998BF23FA01F465B181688B4209D2BD -:10FBF0000069034055F82400184430BC7047234680 -:10FC000030BC18474FF0FF30F7E770B5069CC4E9E9 -:10FC10000002049A21811989E260059A8E1C2261F2 -:10FC2000D3E9002502EB0113E36103EB46036E1CED -:10FC300033446D422B4023628369C4E9051261811C -:10FC4000A1847BB9481E834202EB03140CDB00291C -:10FC50004FEA001308BF00231A44002393736FF088 -:10FC60007F03D373002070BD0133E381EBE72DE9FF -:10FC7000F04F0026B0F82CB004465D46B24685B081 -:10FC800002EB03080E9B914600EBCB0253631FFA75 -:10FC900088F313870F1D826908F1FF310191B04588 -:10FCA00019DCA28CA585D31AA3846289E369511E4D -:10FCB0005A8800200A4003EB4203A3F804B0BFF3C4 -:10FCC0005B8FE269538801335380E38C0133E38413 -:10FCD00005B0BDE8F08FA06A03932B0157F8041C10 -:10FCE0000093036802EB0515C91A836802929942D2 -:10FCF00028BF4FF0FF31FFF76DFF009B029A396874 -:10FD0000D050019BA9609E42B6BF012185F80CA08E -:10FD1000297385F80DA0B145D8BFA989C5F804A0FD -:10FD2000DCBF41F00201A981039BED890136083750 -:10FD3000B5E7F0B550B3056AC38D6C889C4230D0EE -:10FD40005C1CC4854489BFF35B8F013C1C4005EB00 -:10FD5000C4056B689EB209B1AD680D60D0F818C0DB -:10FD60009BB20CEB031100EBC3031D8F878C2F4458 -:10FD7000013D87841D878D896F070ED5858DCD81C7 -:10FD800000218685586B596302B11480F0BD1D8F28 -:10FD9000C989013D0CEB01111D878D89ED07F6D452 -:10FDA000ECE70020F2E7836903EB011398687047E2 -:10FDB00010B5044690B1828C43899A4209D0084B11 -:10FDC0001A78032A05D95B681BB1426805490420EB -:10FDD00098472046BDE8104001F0D0BA10BD00BFE2 -:10FDE000185D0021903703012DE9F843BFF35B8FC5 -:10FDF0001746C2690E465388018E05468B4245D090 -:10FE00004B1C03864389D0F82880013B0B4002EB52 -:10FE100043039A8893B2328082691B0152F803909F -:10FE2000D8F834305BBBD8F81040621C09BFD8F852 -:10FE3000043009EA04041C68A9EB04042146404686 -:10FE4000FFF7C8FE814509D0D8F8103001331C44B3 -:10FE5000D8F808309C42F1D34FF0FF34D8F80000B6 -:10FE6000431C11D0D8F80830A3420DD92044328861 -:10FE7000AB6903EB02139B683B60BDE8F88349461E -:10FE8000404698470446E9E70020F0E70020F4E701 -:10FE900030B544898C4212D3036A013C5D882C4002 -:10FEA00003EBC4039A605960BFF35B8F026A538807 -:10FEB00001335380C38C0133C384002030BD01481B -:10FEC000FCE700BF41F4FFFF0268936912699200EA -:10FED0001AD58BB94269C36903EB4203C28D9A807C -:10FEE000BFF35B8F03689B69CBB9036AC08D5B88E6 -:10FEF000181A18BF01207047012BF1D14269036A1B -:10FF000003EBC203028EEAE72BB9C269138823F020 -:10FF100001031380E4E7012BE2D1026AF6E7012B2B -:10FF200003D1C369008E5B88E2E700207047026856 -:10FF300093691269920015D54BB9C38DC2694169A5 -:10FF40004089013B1B1A02EB410293807047012B51 -:10FF50000ED1038E026A41694089013B1B1A02EBF4 -:10FF6000C102F2E72BB9C269138843F00103138081 -:10FF70007047012BFCD1026AF6E710B5BFF35B8F27 -:10FF8000036804461A699B6912F0005F1AD07BB9B6 -:10FF9000C369026A5B884169013B02EBC102928836 -:10FFA0009B1AE28C9BB29A4214D80023E38410BDC2 -:10FFB000012BFAD1036AC2695B884169013B02EBFC -:10FFC0004102ECE763B9036A1B88DB4303F00103DA -:10FFD000002BEAD02369002BE7D020469847E4E7BE -:10FFE000012BE2D1C369EFE710B588B0E0B10F4B48 -:10FFF0001A78062A18D95C68B4B1D0E9073211889A -:020000040103F6 -:10000000079119880691528809490592C28D049278 -:100010005B880393838D0293C38C0193838C00933D -:10002000438942680720A04708B010BD185D002131 -:10003000B2370301C269018E53888B420AD04389CB -:10004000013B0B4002EB43039A88836903EB0213E5 -:100050009868704700207047BFF35B8FC36803B197 -:100060001847704700230121026A30B502F1580495 -:10007000D4E8EF5F9D4204BFC4E8EC1FBCF1000F61 -:100080002B46F5D1436AA3F580637F2B0BD85D091E -:10009000483203F01F0301FA03F352F8251021EA56 -:1000A000030342F8253000F13403D0E90D124A6011 -:1000B0001160C0E90D3300230362C4E8AF3F30BDD7 -:1000C000F0B4144648B1006A38B133B1013404D0F9 -:1000D000046E14B1A446F0BC60470148F0BC704700 -:1000E0002DF8FFFF30B5456A8DB004460B912022F4 -:1000F000014602A80A9501F073FD28230122294632 -:10010000CDE900322046352202ABFFF7D9FF00EAE5 -:10011000E0700DB030BD28B1006A18B111B1436E66 -:1001200003B11847704728B1006A18B111B1836E46 -:1001300003B11847704728B1006A18B111B1C36EF6 -:1001400003B118470020704770B4144648B1006AE4 -:1001500038B133B1013404D0046F14B1A44670BC7B -:100160006047014870BC70472DF8FFFF2DE9F84348 -:1001700007468846154699460668B74203D10024CB -:100180002046BDE8F8836A1CA6F1340402D0636AF5 -:10019000AB42F5D0B8F1000F10D0202241462046E6 -:1001A00001F00AFD50B9B9F1FF3F02D0A36A4B45F7 -:1001B000E6D06B1C02D1A36A0133E1D03668DCE7DC -:1001C00070B50C46114605461E460C4B20220029F0 -:1001D00008BF1946204601F003FD049B6A68A3622C -:1001E000059BC4E90D52E362069B6662236304F13A -:1001F000340325626B60A26B136070BDB1370301DD -:100200002DE9FF410E46054600286BD001F1580745 -:1002100000200121D7E8EF4F844204BFC7E8EC1F5C -:10022000BCF1000F2046F5D1581C1BD1002306F16C -:100230004801580901EB800C51F8200003F01F041D -:1002400020FA04FE1EF0010F07D10121A140014355 -:1002500003F58063CCF800101DE00133802BE8D15A -:10026000224C3BE0B3F5806F15D3A3F580607F2867 -:1002700006F1480431D84FEA501C54F82CE000F045 -:100280001F002EFA00F818F0010FE9D1814041EA71 -:100290000E0144F82C100C99304602910B990191F3 -:1002A0000A9900912946FFF78BFF0023C7E8AF3F6B -:1002B0002C7874B196F874405CB1AB6A013313D1F9 -:1002C00000212846FFF70EFF044610B12846FFF72D -:1002D000C9FE204604B0BDE8F081054C0023C7E804 -:1002E000AF3FF6E7024CF4E70024F2E729F8FFFFFE -:1002F0002DF8FFFF10B5044688B1036A7BB1027880 -:100300004AB193F8743033B1436AB3F5806F02D3C6 -:100310000121FFF7E7FE2046BDE81040A2E610BD30 -:1003200051F8083C43F0004341F8083C70477047DF -:100330000023C0E8AF3F7047F0B5282A0E4689B0C9 -:1003400032D1056A2023D5F88C006A46016884689A -:10035000711AA14228BF4FF0FF3100F03FFD00238A -:100360000121376A05F15804D4E8EF2F9A4204BFFF -:10037000C4E8E01F00281346F6D13B464FF0FF3299 -:1003800069462846FFF7F2FE736A0246DB070ED580 -:1003900010B14FF0FF3383622046FFF7C9FF1AB157 -:1003A000136B0BB110469847002009B0F0BD50B94F -:1003B0002046FFF7BDFFEB6D002BF5D03A466946AE -:1003C00028469847F0E787622046FFF7B1FFEBE742 -:1003D0007FB50C461946D0F880309D695DB9009410 -:1003E000CDE9024201232A46D0F8840002A9FFF792 -:1003F0003EFC04B070BD012DFBD1D0F8840004B0E8 -:10040000BDE87040FFF744BD2DE9F043A3F11009AA -:1004100053F8088C102300250446D0F88C0089B0CE -:10042000CDE9041201688768109EA9EB0101B94269 -:1004300028BF4FF0FF310DEB0302ADF81C600695AD -:10044000ADF81E5000F005FD10281FFA88F806D000 -:1004500040F28B11204B214A214800F057FF012226 -:1004600004F15807D7E8EF3FAB4204BFC7E8E12FDC -:1004700000291D46F6D1D4F880309B69A3B9A26F3C -:10048000D4F88030D4F888009B69A3B9CDE90292F2 -:10049000CDF80090012202A9FFF7E9FB88B14FF4E3 -:1004A000CC71104B0D4AD7E74146D4F88800FFF7CE -:1004B0007AFC0246E4E7012B03D14146FFF7E8FC52 -:1004C000ECE7D4F88800FFF758FD3846FFF730FF17 -:1004D000304609B0BDE8F0833B3803010839030119 -:1004E00054380301D1380301F8B5A1F1100751F8D0 -:1004F000085C044600230121ADB200F15806D6E89D -:10050000EF2F9A4204BFC6E8E01F00281346F6D139 -:100510002946D4F88400FFF746FC2B4602463946AC -:100520002046FFF755FF3046BDE8F84000E730B4FD -:10053000D0F880501346AD6925B930BCD0F884009E -:10054000FFF7F7BB012D06D130BC0A46D0F8840076 -:100550001946FFF749BC002030BC704703682DE9FD -:10056000F04301215F6A002385B007F15805D5E803 -:10057000EF2F9A4204BFC5E8E01F00281346F6D1CA -:1005800038460DF10A0203A9FFF7D1FF04462846B9 -:10059000FFF7CEFE4FF0010814B905B0BDE8F083B7 -:1005A000BDF80A30A3600023D5E8EF2F9A4204BFBC -:1005B000C5E8E18F00291346F6D14FF0FF33002143 -:1005C00038466268FFF7D2FD06462846FFF7B0FEC0 -:1005D000B6B1B26A23680132F16B08BFB362A28977 -:1005E00000913046D6F82C9004F11001C84700283D -:1005F00006DA4FF40271144B144A154800F086FED7 -:100600000023D5E8EF2F9A4204BFC5E8E18F002907 -:100610001346F6D1A368002B06DB21463846BDF809 -:100620000A30039AFFF7D4FE38460DF10A0203A9F7 -:10063000FFF77DFF044618B9D7F88400FFF79DFC4B -:100640002846FFF775FEA7E7DD3803012C390301C3 -:10065000543803010346426810B58A4229BF8068B6 -:100660000020841A186822BF521A00195A6010BD5F -:100670002DE9F3478146D0F880000E46036A1546FF -:100680001B689847430747D543F69823002D18BFAA -:100690001D464FF0010809F158070023D7E8EF2F56 -:1006A0009A4204BFC7E8E18F00291346F6D1D9F872 -:1006B0008030D3F818A0BAF1000F21D13146D9F813 -:1006C00088000DF10602FFF734FB044620B9D9F883 -:1006D00088309B8C3BB900243846FFF729FEFCB9D3 -:1006E000D5B1013DD9E7D9F87810D9F89000FFF7D6 -:1006F000B1FFD9F8783004463360ADF806A0EBE7D7 -:10070000BAF1010FE7D13246D9F888000DF10601A0 -:10071000FFF76AFB0446DFE7002002B0BDE8F08780 -:10072000BDF8063004F11000A3603368103B33605D -:10073000F3E72DE9F04385B00F46904603A90D9AE3 -:1007400006469946FFF794FF044628B30C9D039B89 -:10075000D6F88C009D42A8BF1D460168D0F808C09D -:10076000611A614528BF4FF0FF312B464A4600F021 -:1007700070FB854206D04FF4E471084B084A0948E3 -:1007800000F0C4FD23464246394630460095FFF747 -:100790003BFE05B0BDE8F0830348FAE7E938030102 -:1007A00045390301543803012EF8FFFF10B1C0E9A9 -:1007B00001220160704710B5D8B10023012100F17A -:1007C0005804D4E8EF2F9A4204BFC4E8EC1FBCF1F0 -:1007D000000F1346F5D1D0F880309B695BB9826F6A -:1007E000103A002A00DC084A2046FFF7A1FD104617 -:1007F00010BD064AFBE7012BF5D1D0F88800FFF7C2 -:1008000019FCA0F11002ECE72EF8FFFF2DF8FFFF16 -:100810002DE9F04704460D4690468AB07822DDE97E -:10082000129700211E4600F0D8FD04F15800FFF792 -:100830007FFD674BC4F85C80C4F880506C6223660F -:10084000644BD5F818806366634BA366634BE3661D -:10085000634B2367B8F1000F70D127B9614F384659 -:100860000AB0BDE8F08704F1780397E8030083E855 -:100870000300D4F88000036A9B689847002328612E -:1008800000F001006B6184F87400B8F1000F69D1C9 -:10089000B9F1000FE2D0D9F80830002B00F09580B4 -:1008A000514BC4F890900493504B0593504B0693D2 -:1008B000504B0793EB6A1A689B69C4F88420C4F80C -:1008C000883006AB009302220021D4F88000C4F8DF -:1008D0008C6004AB00F0C5F807460028BFD1D4F8FF -:1008E0008800FFF724FBEB6A1A689B6996629E6298 -:1008F000B8F1000F07D1C246E36F0993D4F88430F2 -:100900005B8953453FD894F87430C4E900445BB127 -:1009100000230293384B204601933523374A009336 -:1009200004F10801FFF74CFCB8F1000F97D1D4F89F -:1009300080000421036A5B68984790E7B8F1010FD3 -:1009400097D1D4F88000036A1B689847420606D501 -:10095000D4F880000021036A5B689847F1E74307F9 -:10096000EFD586E7B8F1010FABD1204B04931E4BB6 -:100970000593204B06931E4B0793EB6A9A691B68FD -:10098000C4F884209BE74846E16FFFF763FE054605 -:10099000C0B131680890411AB0680022814228BF76 -:1009A0004FF0FF31E36F304600F08DFA0123002253 -:1009B000D4F88400009508A9FFF759F918B90AF18D -:1009C000010A9BE70E48074649E70D4F47E700BF7E -:1009D0003307030121030301E90403017106030145 -:1009E000090403012DF8FFFFF7380301FD38030167 -:1009F0005D0503012F0303013903030103390301DB -:100A00002EF8FFFF7FB505460E46074902AC03C925 -:100A100084E8030008992846009101943146FFF7C5 -:100A2000F7FE04B070BD00BF6839030110B504467D -:100A30002068844203D10023C4E9213310BD343837 -:100A4000FFF758FCF4E700BF0246044B586800B9B2 -:100A5000704719889142FBD00833F7E7B439030196 -:100A600070472DE9F04F87B00593836A054693429E -:100A7000164649D300244FF0180BB44203D100208E -:100A800007B0BDE8F08F0BFB04F7D5F82C80AA69FE -:100A900008EB070C0CF1040902BBDCF81400BCF8ED -:100AA0000CE0DCF804300168DCF808C0591A0CF1DD -:100AB000FF3303EB0E130EF1030ACCF1000C03EB32 -:100AC0004A0303EA0C03D0F808C003EBCE036145E8 -:100AD00028BF4FF0FF31063300F0F5F958F8073022 -:100AE000059A02932B6A28461B6AA1B20193109BB8 -:100AF00053F82430009352F824204B46FFF785F832 -:100B00000028BDD10134B8E70048B9E740F4FFFF41 -:100B10002DE9F0410E4617460C4D55F8184FAC42E2 -:100B200003D16FF01200BDE8F081314654F8440C57 -:100B3000A4F1440801F036F830B94046C7F8008007 -:100B4000BDE8F04100F010BA2468E8E7185D002124 -:100B5000F8B5DDE906549C421746194604D00C222C -:100B600020466A4300F012FC0026AE4201DB284614 -:100B7000F8BD022F03D1A168206800F035FAA16802 -:100B800054F80C0B00F031FA0136EEE770B51C4654 -:100B90000025049EB54204F10C0400DB70BD54F83E -:100BA000041C54F80C0C00F020FA0135F2E700F1B7 -:100BB000240310B5D0E909124A601160C0E9093375 -:100BC0004368044603B19847054B1A78062A05D9AD -:100BD0005B681BB10720226802499847002010BDBE -:100BE000185D0021FC3903012DE9F04107460D464F -:100BF0000B4E56F8084FB44202D16FF001000AE0E4 -:100C0000394654F8240CA4F1240800F0CBFF20B995 -:100C10001DB1C5F80080BDE8F0812468EBE700BF96 -:100C2000185D002110B5044600B30068F0B10378E8 -:100C3000E3B10021FFF7D8FFD8B104F11C03C4E9E8 -:100C400007330E4B04F12402D96803F10800DA607F -:100C5000A16260620A601A78062A05D95B685BB1F6 -:100C60000720226806499847002001E06FF0150030 -:100C700010BD6FF01000FBE71846F9E7185D002182 -:100C8000FE39030137B50C46154688B103787BB1B0 -:100C900071B10B7863B15AB101A9FFF7A5FF28B96B -:100CA000019883683BB12A462146984703B030BD7E -:100CB0006FF01500FAE76FF01200F7E7014610B584 -:100CC00008B1406828B95121054B064A064800F092 -:100CD0001DFBC36813B1BDE81040184710BD00BF2D -:100CE000113A0301983A0301273A0301036810B54A -:100CF00093B11B7883B18368012B0DD8084B00F1A9 -:100D000044014360074BDA6903F1180482644464C8 -:100D10000020D961116010BD6FF01500FBE700BF26 -:100D2000F4000021185D00210E4B10B5044620226E -:100D30000021184600F051FB2268426002462179EA -:100D400002F8081BC0E9022200F11002C0E90422E7 -:100D500000F11802C0E906222046BDE8104000F06C -:100D60000FB900BF185D002108B500F011F9BDE80A -:100D7000084020220021014800F02FBB185D00210F -:100D80002DE9F04788B00646DDE910498A469046CD -:100D90000021202268461F46129D00F01EFB1F2CDA -:100DA00097BF01234FF0FF33A34003F1FF33C6E9A0 -:100DB0000274C6E900A8C6E9043906F118045DB159 -:100DC0000FCD0FC495E80F0084E80F00304608B03F -:100DD000BDE8F04700F0E2B86D46F1E773B504688E -:100DE000661C33D08568A94230D264182ED05E18B4 -:100DF000AE4288BF6B1A056A35B100930523A84738 -:100E00000346184602B070BD2146BFF35B8F1846FB -:100E10000028F6D042EA0105AD070C460AD10328A6 -:100E20000EDC013C10448242EBD014F8011F02F8A2 -:100E3000011BF8E711F8014B013802F8014BE7E715 -:100E400054F8041B043842F8041BE8E76FF0210350 -:100E5000D7E773B50468661C32D08568A9422FD2E3 -:100E600064182DD05E18AE4288BF6B1A456A35B93A -:100E70002146184670B9BFF35B8F184602E0009315 -:100E80000523A84702B070BD12F8014B013801F8E4 -:100E9000014BEFE741EA0205AD071446F4D1032800 -:100EA00008DC013C08448142E5D014F8012F01F828 -:100EB000012BF8E754F8042B043841F8042BEEE733 -:100EC0006FF02100DEE7F7B504681646621C1D4688 -:100ED0002DD0836899422AD2641828D06A18876A6C -:100EE0009A4288BF5D1A37B1052332460095B8474C -:100EF000284603B0F0BD20462A4632B9BFF35B8FC7 -:100F0000F6E700F8016B013AF7E78307F9D13306FA -:100F100043EA0643334343EA0623032A03DC31460C -:100F200000F05BFAEAE740F8043B043AF5E76FF0BB -:100F30002105DDE70EB403B07047014B58607047E0 -:100F4000185D0021014B5868704700BF185D0021F3 -:100F5000014B1870704700BF185D0021014B1878D5 -:100F6000704700BF185D0021826808B5034622B1B2 -:100F70005B690C300BB100F011F8002008BD0000D7 -:100F800008B50248FFF74EFE002008BDF40000211E -:100F90000148FFF70CBE00BFF40000212DE9F0412D -:100FA00085680446CDB1C368002635FA03F218BF40 -:100FB0000125076818BF9D404FEA850861682A46E9 -:100FC0003846636951F8261000F011F8D4E902326E -:100FD0000136D340B3424744F0D2BDE8F0817047B8 -:100FE00000207047704770477047704770477047E0 -:100FF00053B94AB9002908BF00281CBF4FF0FF3180 -:101000004FF0FF3000F080B9ADF1080C6DE904CE6F -:1010100000F006F8DDF804E0DDE9022304B07047D3 -:101020002DE9F04F099E0D4604460F46002B47D18F -:101030008A4294465FD9B2FA82F343B1C3F12001E8 -:101040009F4002FA03FC9C4020FA01F10F434FEA53 -:101050001C451FFA8CFE220CB7FBF5F105FB11773E -:1010600001FB0EF042EA0742904208D91CEB020253 -:1010700001F1FF3702D2904200F234813946121A50 -:10108000A4B2B2FBF5F005FB102200FB0EFE44EA11 -:101090000244A64508D91CEB040400F1FF3202D239 -:1010A000A64500F21981104640EA0140A4EB0E0467 -:1010B00000211EB1DC400023C6E90043BDE8F08FEB -:1010C0008B4208D9002E00F0FB800021C6E9000504 -:1010D0000846BDE8F08FB3FA83F100294BD1AB424B -:1010E000C0F0F180824240F2EE800846002EE5D04A -:1010F000C6E90047E2E702B9FFDEB2FA82F3002B4D -:1011000040F09D808D1A4FEA124E97B20121B5FB37 -:10111000FEF20EFB1250250C45EA004507FB02F0DB -:10112000A8420FD91CEB050502F1FF382CBF4FF088 -:1011300001094FF00009A84203D9B9F1000F00F0EE -:10114000CE8042462D1AA4B2B5FBFEF00EFB105520 -:1011500000FB07F744EA0544A74208D91CEB040446 -:1011600000F1FF3502D2A74200F2B3802846E41B0B -:1011700040EA02409DE7C1F120078B4005FA01F4E7 -:1011800022FA07FCFD408A404CEA030C20FA07F3E0 -:101190004FEA1C491C431FFA8CFE00FA01F3200C95 -:1011A000B5FBF9F809FB185540EA054508FB0EF0B8 -:1011B000A8420FD91CEB050508F1FF3A2CBF4FF0F0 -:1011C000010B4FF0000BA84203D9BBF1000F00F058 -:1011D0008C80D0462D1AA4B2B5FBF9F009FB10554E -:1011E00000FB0EFE44EA0545AE4507D91CEB05059C -:1011F00000F1FF3401D2AE457ED8204640EA0840D7 -:10120000A5EB0E05A0FB029845454C46C64602D309 -:1012100006D14B4504D20138B9EB020468EB0C0E41 -:10122000002E6FD01A1B65EB0E0522FA01F305FAAA -:1012300007F7CD4000211F43C6E900753EE702FADB -:1012400003FCC3F1200001FA03F24FEA1C4EC14037 -:1012500024FA00F51FFA8CF79C401543B1FBFEF011 -:101260002A0C0EFB101142EA014200FB07F19142E9 -:101270000ED91CEB020200F1FF382CBF4FF0010920 -:101280004FF00009914202D9B9F1000F31D0404628 -:10129000521AADB2B2FBFEF10EFB112245EA024535 -:1012A00001FB07F2AA4207D91CEB050501F1FF3843 -:1012B00001D2AA4223D84146AD1A41EA004126E7AD -:1012C00031463046FAE6841A65EB030301201F46D7 -:1012D0000CE7644402384AE764440238E4E6023A20 -:1012E00065442FE702396244C9E6A8F10208654463 -:1012F00070E702386244CBE7023865447EE7023982 -:101300006544D9E73146D9E6704700BF1FB514469A -:101310001A46094B05461B68D8684CB1074B00912B -:101320000749CDE901342B4600F00EF800F02CFD02 -:10133000044B1C46F3E700BF20010021AB3A030138 -:10134000B83A0301B13703010EB403B503AB01464C -:10135000054853F8042B0068019300F04DF902B0E2 -:101360005DF804EB03B0704720010021024B0146F9 -:10137000186800F0A5B800BF20010021024B01460B -:10138000186800F033B800BF200100210A44431E52 -:10139000914200D1704710B511F8014B914203F80A -:1013A000014FF9D110BD884210B501EB020402D9FA -:1013B0008442234607D8431EA14208D011F8012BCE -:1013C00003F8012FF8E7024401468A4200D110BD1C -:1013D00013F8014D02F8014DF7E70244034693422A -:1013E00000D1704703F8011BF9E7000038B5054646 -:1013F000002941D051F8043C0C1F002BB8BFE41861 -:1014000000F0F2FE1D4A136833B963601460284689 -:10141000BDE8384000F0EEBEA34208D9206821188C -:101420008B4201BF19685B6809182160EDE71A4615 -:101430005B680BB1A342FAD911685018A0420BD1D6 -:1014400020680144501811608342E0D118685B683D -:10145000014453601160DAE702D90C232B60D6E710 -:10146000206821188B4202BF19685B680918636005 -:1014700008BF21605460CAE738BD00BF385D002155 -:1014800070B50E4E0C460546316811B900F07AFB76 -:1014900030602146284600F075FB431C0AD0C41C6E -:1014A00024F00304A04207D0211A284600F06AFB6A -:1014B000013001D14FF0FF34204670BD3C5D00216A -:1014C0002DE9F041CD1C074625F0030508350C2D0C -:1014D00038BF0C25002D01DBA94205D90C230026BD -:1014E0003B603046BDE8F0812E4E00F07DFE336853 -:1014F0001C4634BB29463846FFF7C2FF431C04464E -:101500004DD134682646002E40D1236831463846F6 -:1015100004EB030800F036FB80453AD1216803351F -:1015200038466D1A25F0030508350C2D38BF0C25FB -:101530002946FFF7A5FF01302BD023682B442360F9 -:101540000EE02268521B1ED40B2A16D96119A34241 -:10155000256018BF5960636808BF316062514B60F5 -:1015600004F10B06384600F045FE231D26F0070661 -:10157000F21AB6D09B1BA350B3E76268A3420CBF1C -:1015800032605A60ECE723466468B2E73446766816 -:10159000B9E70C2338463B6000F02CFEA1E725603C -:1015A000DEE700BF385D00219368013B002B9360AC -:1015B00010B407DA9469A34201DB0A2902D110BCF6 -:1015C00000F022BB1368581C10600846197010BC4C -:1015D0007047F8B506460F461446D518AC4201D1FF -:1015E000002007E03A4614F8011B3046FFF7DCFF05 -:1015F000431CF3D1F8BD00002DE9F04F0D469DB01E -:1016000014469846064618B183690BB900F0D8FC19 -:10161000894B9D421BD175686B6ED90705D4AB8988 -:101620009A0502D4A86D00F069FDAB891B0701D5AE -:101630002B69EBB92946304600F038FBC0B16B6E20 -:10164000DC070ED54FF0FF301DB0BDE8F08F7B4BAF -:101650009D4201D1B568DFE7794B9D4208BFF5682F -:10166000DAE7AB899805EDD4A86D00F048FDE9E70D -:101670000023CDF80C804FF00109DFF8C8810993F1 -:1016800020238DF8293030238DF82A3023469A46BE -:1016900013F8012B0AB1252AF9D1BAEB040B0BD0B0 -:1016A0005B46224629463046FFF793FF013000F0A3 -:1016B000AA80099A5A4409929AF80030002B00F047 -:1016C000A28000234FF0FF320AF1010A049307932E -:1016D0008DF853301A93CDE9052354460522594815 -:1016E00014F8011B00F072FD049AD8B9D10644BF6A -:1016F00020238DF85330130744BF2B238DF853302C -:101700009AF800302A2B15D0079A544600204FF043 -:101710000A0C214611F8013B303B092B4ED9B0B1E0 -:10172000079214E0A0EB0803A24609FA03F313435F -:101730000493D2E7039B191D1B68002B0391BBBFC9 -:101740005B4242F0020207930793B8BF04922378EA -:101750002E2B0CD163782A2B35D1039B02341A1D12 -:101760001B68002B0392B8BF4FF0FF330593DFF8DF -:10177000D8A003222178504600F028FD40B1402334 -:10178000A0EB0A00013403FA00F0049B0343049326 -:1017900014F8011B06222D488DF8281000F016FDC4 -:1017A00000283FD02A4B1BBB039B073323F00703C2 -:1017B00008330393099B3B44099367E70CFB023210 -:1017C0000C460120A5E7002301344FF00A0C19460E -:1017D0000593204610F8012B303A092A03D9002B33 -:1017E000C5D00591C3E70CFB012104460123F0E7B6 -:1017F00003AB2A4604A930460093164B00E000BF15 -:101800000746781CD6D16B6ED90705D4AB899A05EB -:1018100002D4A86D00F073FCAB895B063FF512AFF4 -:10182000099811E703AB2A4604A930460093094BF7 -:1018300000F082F8E4E700BF403B0301603B030196 -:10184000203B0301EC3A0301F23A0301F63A0301AB -:1018500000000000D31503012DE9F0471646994614 -:101860008A6807460B690C46DDF820809342B8BFB2 -:101870001346336091F843200AB101333360236883 -:10188000990642BF336802333360256815F00605B8 -:1018900006D104F1190AE36832689B1AAB4229DCCD -:1018A00094F84320131E226818BF012392062ED4F9 -:1018B00004F1430249463846C047013021D023682D -:1018C0001A3454F80E5C03F0060332680026042B29 -:1018D00054F8123C08BFAD1A54F80A2C14BF002566 -:1018E00025EAE5759342C4BF9B1AED18B5421AD19B -:1018F000002008E00123524649463846C0470130DF -:1019000003D14FF0FF30BDE8F0870135C3E7E118A0 -:101910005A1C30200233224481F8430094F84510C9 -:1019200082F84310C4E70123224649463846C0479F -:101930000130E6D00136D9E72DE9FF470F7E914609 -:1019400080460C46782F9A460C9D01F1430207D839 -:10195000622F0AD8002F00F0D880582F00F0A38003 -:1019600004F1420584F842703AE0A7F16303152BB5 -:10197000F6D801A151F823F0D1190301E5190301AB -:10198000611903016119030161190301611903015F -:10199000E5190301611903016119030161190301CB -:1019A00061190301F11A0301151A0301D31A030186 -:1019B0006119030161190301131B0301611903017B -:1019C000151A03016119030161190301DB1A0301EF -:1019D0002B681A1D1B682A6004F1420584F8423006 -:1019E0000123A3E020682968060601F104030AD553 -:1019F0000E682B60002E03DA2D23764284F84330E4 -:101A00005E480A2319E00E6810F0400F2B6018BFE3 -:101A100036B2EFE72B682068191D2960010601D551 -:101A20001E6802E04606FBD51E886F2F53480CBF88 -:101A300008230A23002184F843106568002DA5605F -:101A4000A2BF216821F0040121600EB9002D4DD004 -:101A50001546B6FBF3F103FB1167C75D05F8017D81 -:101A600037460E46BB42F4D9082B0BD12368DE075C -:101A700008D5236961689942DEBF302305F8013C2F -:101A800005F1FF35521B22614B4603AA2146404611 -:101A9000CDF800A0FFF7E0FE01304CD14FF0FF3051 -:101AA00004B0BDE8F087354881F84570296823689F -:101AB00051F8046B29601D0614D5DF0744BF43F0BD -:101AC000200323601EB9236823F020032360102322 -:101AD000B0E7236843F0200323607823284884F884 -:101AE0004530E3E7590648BFB6B2E6E71546BBE71F -:101AF0002B682668181D6169286035061B6801D5AA -:101B0000196002E07006FBD5198000231546236199 -:101B1000BAE72B6800211A1D2A601D6862682846F2 -:101B200000F054FB08B1401B606063682361002330 -:101B300084F84330A8E723692A4649464046D047FF -:101B40000130ABD023689B0713D4E068039B984215 -:101B5000B8BF1846A4E70123324649464046D0475D -:101B600001309BD00135E36803995B1AAB42F2DC8C -:101B7000EBE7002504F11906F5E700BFFD3A030184 -:101B80000E3B030138B50023054D044608462B6083 -:101B9000FAF7DCFC431C02D12B6803B1236038BD8B -:101BA000445D002110F8012B11F8013B012A28BFE8 -:101BB0009A42F7D0D01A7047034610B572B1013976 -:101BC000841813F8010B11F8012F904201D1A342A0 -:101BD00001D1801A10BD0028F3D1FAE71046F9E7C9 -:101BE0000139034610B532B111F8014F013A03F83B -:101BF000014B002CF7D11A440021934200D110BDB3 -:101C000003F8011BF9E70000F8B50E461446054637 -:101C100018B183690BB900F0D3F9214B9C422BD149 -:101C20006C68A369A360A3891A072FD523696BB3D6 -:101C30002369F6B220683746C01A6369834204DC20 -:101C40002146284600F028F930BBA3680130013B4B -:101C5000A36023685A1C22601E706369834204D00B -:101C6000A389DB0706D50A2E04D12146284600F0B9 -:101C700013F988B93846F8BD0A4B9C4201D1AC68CB -:101C8000CFE7094B9C4208BFEC68CAE721462846CB -:101C900000F00CF80028CBD04FF0FF37EAE700BF88 -:101CA000403B0301603B0301203B0301324B70B515 -:101CB0001D6806460C4625B1AB6913B9284600F0ED -:101CC0007FF92E4B9C420FD16C68A389B4F90C208C -:101CD00019072CD4DD0611D40923336042F04003E8 -:101CE0004FF0FF30A3813EE0254B9C4201D1AC6810 -:101CF000EBE7244B9C4208BFEC68E6E7580712D597 -:101D0000616B41B104F14403994202D03046FFF7C0 -:101D10006DFB00236363A38923F02403A3810023C5 -:101D2000636023692360A38943F00803A3812369C7 -:101D30004BB9A38903F42073B3F5007F03D0214688 -:101D4000304600F003FAA089B4F90C2010F001032A -:101D50000AD00023A36063695B42A361236943B98E -:101D600010F08000BAD170BD810758BF6369A360CD -:101D7000F4E70020F7E700BF20010021403B03010A -:101D8000603B0301203B0301062008B500F060FA28 -:101D9000012000F035FB00008A89F8B505461007E0 -:101DA0000C4657D44B68002B04DC0B6C002B01DC79 -:101DB0000020F8BDE66A002EFAD0002312F480520B -:101DC0002F682B6032D0606DA3895A0705D56368F0 -:101DD000C01A636B0BB1236CC01A00230246E66A7B -:101DE0002846216AB047431CA38906D129681D29CA -:101DF0002CD8284ACA40D60728D50022D9046260C8 -:101E00002269226004D5421C01D12B6803B96065A8 -:101E1000616B2F600029CBD004F14403994202D0BA -:101E20002846FFF7E3FA00206063C2E7216A012336 -:101E30002846B047411CC7D12B68002BC4D01D2BAE -:101E400001D0162B01D12F60B2E7A38943F04003E4 -:101E5000A381AEE70F69002FAAD093070E680F6029 -:101E60000CBF4B690023F61B8B60002EA0DD3346B0 -:101E70003A46216A2846D4F828C0E047002806DC04 -:101E8000A3894FF0FF3043F04003A38191E707445B -:101E9000361AEAE70100402038B50B6905460C46C2 -:101EA00013B90025284638BD18B183690BB900F075 -:101EB00087F8144B9C421BD16C68B4F90C30002B92 -:101EC000EFD0626ED00704D4990502D4A06D00F063 -:101ED00015F928462146FFF75FFF636E0546DA07CE -:101EE000E0D4A3899B05DDD4A06D00F008F9D9E703 -:101EF000054B9C4201D1AC68DFE7044B9C4208BF14 -:101F0000EC68DAE7403B0301603B0301203B03013F -:101F1000002310B504468360818119464366C2815F -:101F200008228361C0E90033C0E904335C30FFF765 -:101F300054FA054B24626362044BA362044BE362D0 -:101F4000044B236310BD00BF89220301AB220301B0 -:101F5000E322030107230301014900F0AFB800BFEA -:101F6000991E030170B568224D1E0E46554305F1BA -:101F70007401FFF7A5FA044640B1002105F168029B -:101F8000C0E900160C30A060FFF727FA204670BDAC -:101F9000014800F0B3B800BF415D0021014800F0E6 -:101FA000AEB800BF415D0021014800F0A7B800BFF6 -:101FB000425D0021014800F0A2B800BF425D00214F -:101FC00010B50446FFF7F0FFA3691BB1BDE8104050 -:101FD000FFF7F0BFC4E9123323652046124B134AC2 -:101FE0001B68A262A34204BF0123A36100F020F892 -:101FF0006060204600F01CF8A060204600F018F851 -:1020000000220421E0606068FFF782FF01220921BD -:10201000A068FFF77DFF02221221E068FFF778FF3A -:102020000123A361D2E700BFE83A0301591F03016E -:10203000F8B50746FFF7ACFF1E4B1E68B36913B92E -:102040003046FFF7BDFF4836D6E90134013B03D5E2 -:1020500033680BB33668F7E7B4F90C50D5B9164BB3 -:1020600004F158006566E36000F047F8FFF796FF5B -:102070000822294604F15C002560A561C4E90155E8 -:10208000C4E90455FFF7A9F9C4E90D55C4E912558F -:102090002046F8BD6834D9E704213846FFF762FFCF -:1020A000044630600028D5D1FFF778FF0C233B6051 -:1020B000EEE700BFE83A03010100FFFF2DE9F84316 -:1020C0000646884600F148040027D4E90195B9F195 -:1020D000010905D52468002CF7D13846BDE8F883FE -:1020E000AB89012B07D9B5F90E30013303D029464E -:1020F0003046C04707436835E9E770477047704787 -:1021000070B50E46B1F90E1096B0144600291D4662 -:1021100008DAB6F90C3000222A601A0610D44FF4FF -:1021200080630EE06A4600F015F90028F1DB019AA1 -:1021300002F47042A2F500535A425A412A60EEE777 -:1021400040230020236016B070BD00008B8973B55A -:102150009D0706460C4607D504F14703236023611B -:102160000123636102B070BD01AB6A46FFF7C8FF8F -:10217000009905463046FFF7A3F948B9B4F90C3089 -:102180009A05EFD423F0030343F00203A381E3E7AE -:102190000D4BB362A389206043F080032061A381CB -:1021A000009B6361019B5BB1B4F90E10304600F0F7 -:1021B000E3F828B1A38923F0030343F00103A381CB -:1021C000A0890543A581CDE7591F0301C9B2034684 -:1021D000024410B59342184601D1002003E0047870 -:1021E00001338C42F6D110BD0148FFF787BF00BF15 -:1021F000405D00210148FFF782BF00BF405D002124 -:102200001F2938B504460D4604D9162303604FF044 -:10221000FF3038BD426C12B152F821304BB9204624 -:1022200000F030F82A4601462046BDE8384000F06C -:1022300017B8012B0AD0591C03D1162303600120C3 -:10224000E7E70024284642F8254098470020E0E7C9 -:10225000024B01461868FFF7D3BF00BF20010021E1 -:1022600038B50023064D0446084611462B6000F0A1 -:10227000BFF8431C02D12B6803B1236038BD00BFF7 -:10228000445D002100F0ACB810B50C46B1F90E1059 -:1022900000F094F80028ABBF636DA3891B1823F4EA -:1022A0008053ACBF6365A38110BD2DE9F0411F468B -:1022B0008B8905460C46DB05164605D50223002210 -:1022C000B1F90E1000F068F8A3893246B4F90E1087 -:1022D000284623F48053A3813B46BDE8F04100F03B -:1022E00017B810B50C46B1F90E1000F055F8431CA4 -:1022F000A38915BF606523F4805343F48053A38101 -:1023000018BFA38110BDB1F90E1000F013B8000082 -:1023100038B50446064D0846114600222A601A4682 -:10232000FAF712F9431C02D12B6803B1236038BDC0 -:10233000445D002138B50023054D044608462B6056 -:10234000FAF7F8F8431C02D12B6803B1236038BDBB -:10235000445D002138B50023064D04460846114669 -:102360002B60FAF7E9F8431C02D12B6803B1236014 -:1023700038BD00BF445D002138B50023054D04463B -:1023800008462B60FAF7DAF8431C02D12B6803B138 -:10239000236038BD445D002138B50446064D08462B -:1023A000114600222A601A46FAF7CAF8431C02D1E5 -:1023B0002B6803B1236038BD445D002138B5044665 -:1023C000064D0846114600222A601A46FAF7BAF866 -:1023D000431C02D12B6803B1236038BD445D00214A -:1023E000024B58224FF0FF301A607047445D0021C5 -:1023F000024B58224FF0FF301A607047445D0021B5 -:10240000FEE700BFF8B500BFF8BC08BC9E467047A9 -:10241000F8B500BFF8BC08BC9E4670477372616D8A -:10242000782E73686D0067656E65726963006E7201 -:10243000665F62745F68636900000000350F030126 -:10244000060000000100000002000000040000007F -:102450000800000010000000200000004000000004 -:1024600080000000000100000002000000040000E5 -:1024700000080000001000000020000000400000E4 -:1024800000800000010000000200000004000000C5 -:1024900008000000100000002000000040000000C4 -:1024A00080000000000100000002000000040000A5 -:1024B00000080000001000000020000000400000A4 -:1024C0000080000001000000810400018D04000173 -:1024D000990400010000000000000000000000005E -:1024E00000000000000000009D040001030000083F -:1024F0000300000402000000500C00210200000054 -:10250000540C002182868A8EA2A6AAAEC2C6CACE6A -:10251000E2E6EAEE1115191D3135393D5155595D87 -:102520007175797D081014182030343840444C5CA3 -:1025300058607078F4ECE8E4DCCCC8C4BCB8B0A057 -:10254000A49C8C841000100000000000C81400211E -:10255000D80F0021381900213147494200000000FE -:102560000000000000000000324749423347494262 -:102570000B01000DFFFF0203FFFF040F050607001C -:10258000F401FA00960064004B0032001E001400B3 -:10259000403D0021B041002120460021BD1A3CCD24 -:1025A000A6B8995899B740EB7B60FF4A503F10D2CC -:1025B000E3B3C974385FC5A3D4F6493F00E69D353F -:1025C0000E480103CCDBFDF4AC1191F4EFB9A5F991 -:1025D000E9A7832C5E2CBE97F2D203B0208BD28960 -:1025E00015D08E1C742430ED8FC24563765C155275 -:1025F0005ABF9A32636DEB2A65499C80DC0000006B -:10260000C7D0010139D10101FBD001010000000058 -:102610003D3F0001C93F0001000000000D400001E6 -:10262000A93F000125400001A93F0001D53F00015D -:102630000000000000000000CF3F0001CF3F00017C -:10264000ED3F00010D40000100000000CF3F000100 -:10265000CF3F0001094000010D40000100010000D2 -:10266000000301020001030202000203030300034E -:1026700000000000754200010000000000000000A2 -:1026800000000000000000000D43000100000000F9 -:102690000D43000135430001F94200010000000034 -:1026A000000000000000000000000000000000002A -:1026B0000000000085430001000000000000000051 -:1026C0000000000000000000000000008543000141 -:1026D00000010000000003010202000102020202E8 -:1026E0000200030303030000000000004541000155 -:1026F0000142000100000000BD410001B5410001A0 -:10270000BD4100010000000000000000494200013E -:102710000942000159420001000000003542000159 -:10272000354200015942000100010000030102008E -:10273000030202000303030000000000254600011D -:1027400000000000000000000000000071460001D1 -:1027500000000000714600010000000081460001F9 -:102760000000000000000000000000007D460001A5 -:102770000000000000000000000000000000000059 -:102780007D4600010000000000010000000301027E -:102790000102030202000203030300030000000021 -:1027A000554400010000000000000000000000008F -:1027B00000000000F94500010000000000000000DA -:1027C000D5450001D14500010000000000000000D7 -:1027D00000000000000000000000000000000000F9 -:1027E0000D46000100000000000000000000000095 -:1027F00000000000000000000D4600010000000085 -:1028000045470001C9470001794700010000000069 -:10281000A9470001C9470001A947000100000000C5 -:10282000D547000100000000CF470001CF4700015D -:10283000000000007949000100000000CF470001BE -:10284000CF47000100000000934900010001000192 -:10285000000301020100030202020003030303005C -:1028600069500001F55000019D500001A950000180 -:10287000B5500001DD50000101000100355000019C -:10288000194A00018F4B0001A54A00010000000019 -:102890000000000015500001214B0001754B0001A4 -:1028A00000000000A14B0001534E00010000000099 -:1028B000974B0001974B000100000000214E0001E2 -:1028C0000000000000000000974B0001974B000142 -:1028D000000000003B4E000100000000000100016C -:1028E00000000301020100010302020200020303CF -:1028F00003030003000000009D4E000100000000E3 -:102900000000000000000000994F0001A94F0001E5 -:102910000000000000000000A14F0001A14F0001D5 -:102920005550000100000000A14F0001A14F00011F -:102930000000000000010000030102000302020089 -:1029400003030300000000003F51000100000000ED -:102950000000000000000000000000000000000077 -:1029600000000000AB52000100000000AB5200016B -:1029700051510001000000000000000000000000B4 -:102980000000000000000000000000000000000047 -:1029900000000000A1520001F3520001FB520001AF -:1029A00003530001000000000000000000000000D0 -:1029B0000000000000000000000000000000000017 -:1029C00003530001000000000000000000000000B0 -:1029D00000000000000000000000000000000000F7 -:1029E0000353000100010000000000000401030285 -:1029F00001010301040203020303030004030303B0 -:102A0000030303030404040404040404000000009A -:102A1000435300010000000000000000000000001F -:102A20007954000100000000B15300011D54000161 -:102A30000000000000000000000000000000000096 -:102A40001D5400018F540001000000000000000030 -:102A500000000000000000008F5400010001000091 -:102A6000000301010200030202020003030303004A -:102A700000000000A1800001B183000100000000FF -:102A8000E581000199830001E581000105820001D3 -:102A90000000000099830001000000000D83000188 -:102AA0000000000099830001B183000165830001EB -:102AB00000010000030102000302020003030300FF -:102AC0000000000000000000818400010000000000 -:102AD000D383000169840001D38300016D74000178 -:102AE000000000006984000100000000ED83000187 -:102AF000000000006984000181840001ED83000171 -:102B000000010000030102000302020003030300AE -:102B10005758000189580001A5580001A958000123 -:102B200000000000000000000000000000000000A5 -:102B3000000000009D580001010101010001010198 -:102B400001000000395A000199F2010199F20101D6 -:102B50000000000000000000000000000000000075 -:102B600000000000A15C00017D5C0001955D00019A -:102B7000CB5D0001E55D00010000000000000000E9 -:102B800099F2010199F2010100000000000000002B -:102B90000000000000000000010000000000000133 -:102BA0000200000000000202020202020000000017 -:102BB00079620001F56200010000000000000000E1 -:102BC0000000000000000000000000000000000005 -:102BD00025F401011D5F0001E15E0001000000001D -:102BE000000000000000000025F4010100000000CA -:102BF0000000000000000000C15F0001E162000170 -:102C00000000000025F401010000000000000000A9 -:102C100000000000000000000000000000000000B4 -:102C20000101000000000001010200010101020297 -:102C30000202030000030303030303000403FFFF76 -:102C4000FFFF070405FFFF030704FFFF07FFFF0463 -:102C500005FFFFFF03FFFF030405FFFFFFFFFFFF6B -:102C6000FFFFFF0303030000A5690001F5680001F1 -:102C700091690001000000000000000049660001A9 -:102C80005D660001C1660001000000000000000058 -:102C9000000000000167000195670001496700011D -:102CA0009567000100000000657000018168000167 -:102CB0006570000181680001D16B0001F96B0001B2 -:102CC0005D6C0001FF6B00015D6C00010000000005 -:102CD000516D0001956D0001000000000000000032 -:102CE000057200011572000125720001000000004C -:102CF00000000000256F0001356F0001756F0001B5 -:102D00006D6F0001756F000100000000A16E0001F1 -:102D1000C1700001216F00010000000000000000F0 -:102D2000C16D0001296E0001216F0001000000004B -:102D300083FF01010000000000000000F9FE010116 -:102D40000000000000000000000000000000000083 -:102D50004FFF0101EDFE01010000000083FF0101B2 -:102D6000C7FE01017902020100000000000000001E -:102D70000000000000000000000000000000000053 -:102D800000000000000000007DFE010100000000C6 -:102D90000000000083FE0101A9FE01012D030201D4 -:102DA0000000000097FE010100000000000000008C -:102DB000000000007DFE0101000000000000000096 -:102DC00083FE010183FE010100000000A102020157 -:102DD00000000000000000000000000013FF0101DF -:102DE00002000001000000000201000103000101D7 -:102DF00001010101010102020202030000030202BB -:102E00000203030303030300030303008903020116 -:102E1000F70202010000000000000000E5020201CC -:102E200000000000000000005D030201C502020175 -:102E300071020201CB020201790202017102020158 -:102E4000B9020201000000005D030201C502020197 -:102E5000110302010000000000000000E502020171 -:102E60002D0302010000000000000000C502020165 -:102E70007102020100000000000000007102020166 -:102E800000000000A1020201000000000201000099 -:102E90000300000001010200010101010201020220 -:102EA000030000020303030303030003730702018B -:102EB000D57D0001D57D0001D57D0001D57D0001C6 -:102EC0000000000000000000E9070201D57D0001BC -:102ED000D57D0001D57D0001D57D00012D070201C2 -:102EE000B5070201E90702010D080201D57D0001C5 -:102EF000D57D0001D57D000100000000B50702016D -:102F0000E9070201D57D0001EF070201D57D00012F -:102F1000D57D000100000000B5070201E9070201AC -:102F2000D57D0001D57D000185070201D57D000119 -:102F300000000000B50702015D070201D57D000118 -:102F4000D57D0001D57D0001D57D00010000000088 -:102F500000000000E9070201D57D0001D57D0001D8 -:102F6000D57D0001D57D00014B0702010000000066 -:102F7000E9070201D57D0001D57D0001D57D000165 -:102F80000307020100000000000000000100000033 -:102F9000000000010101010102000203020202021D -:102FA00000030304030303000404040504040006EF -:102FB00005050505050506060606060700070707B9 -:102FC00007020707610A0201D57D0001D57D0001D6 -:102FD000D57D00010000000000000000000000009E -:102FE000D57D0001D57D0001D57D0001D57D000195 -:102FF0000000000000000000210B0201D57D00014F -:10300000D57D0001D57D0001D57D0001F50A0201C5 -:10301000B30A020100000000D57D0001790A020117 -:10302000D57D0001D57D00010000000000000000FA -:1030300000000000D57D0001D57D00013F0A02019E -:10304000D57D00010000000000000000000000002D -:10305000D57D0001D57D0001D57D0001D57D000124 -:1030600000000000000000002D0A0201D57D0001D3 -:10307000D57D0001D57D0001AF7C0001000000007E -:10308000000000000000000001000000000000013E -:103090000101010101020202020203000203040312 -:1030A00003030303040405040404040505050505DE -:1030B000050606060600060606000000850E02014B -:1030C00000000000730E020100000000000000007C -:1030D000C5120201C5120201000000006D0E0201BE -:1030E00000000000650E020100000000000000006A -:1030F00000000000000000002D1402016D0E02010E -:103100008D0F0201650E020135130201A9110201A2 -:103110000000000000000000000000006D0E020131 -:1031200000000000650E0201000000000000000029 -:103130000000000000000000430F02016D0E0201BC -:1031400000000000650E020100000000A91102014C -:10315000000000000000000000000000010003006B -:10316000000103000101010101010102020402004A -:103170000002020203030303030303040404040024 -:1031800000040404171302010000000001130201EF -:103190000000000000000000C51202010000000055 -:1031A000A111020100000000131302010000000041 -:1031B00000000000C51202012D140201A11102013C -:1031C000D912020113130201351302017513020112 -:1031D000C512020100000000A11102010000000060 -:1031E0000000000035130201000000000000000094 -:1031F000C3140201A1110201D91202010000000052 -:103200003513020100000000000000000000000073 -:10321000A1110201000000000000000000000000F9 -:10322000A9110201000000000000000001000300DD -:103230000001000101030101010202050300000277 -:103240000203030303030304040504040404040544 -:103250000505050005050200000010001000000033 -:103260000000000080841E0040420F0020A10700E3 -:103270000071020080380100409C000088130000AB -:103280000000000040420F00A086010050C3000073 -:103290001027000088130000C4090000E2040000A9 -:1032A0007102000000000000963007772C610EEEDE -:1032B000BA51099919C46D078FF46A7035A563E98D -:1032C000A395649E3288DB0EA4B8DC791EE9D5E0B4 -:1032D00088D9D2972B4CB609BD7CB17E072DB8E7B3 -:1032E000911DBF906410B71DF220B06A4871B9F308 -:1032F000DE41BE847DD4DA1AEBE4DD6D51B5D4F441 -:10330000C785D38356986C13C0A86B647AF962FDA5 -:10331000ECC9658A4F5C0114D96C0663633D0FFAF2 -:10332000F50D088DC8206E3B5E10694CE44160D5F8 -:10333000727167A2D1E4033C47D4044BFD850DD2E2 -:103340006BB50AA5FAA8B5356C98B242D6C9BBDBF5 -:1033500040F9BCACE36CD832755CDF45CF0DD6DCF0 -:10336000593DD1ABAC30D9263A00DE518051D7C897 -:103370001661D0BFB5F4B42123C4B3569995BACF22 -:103380000FA5BDB89EB802280888055FB2D90CC643 -:1033900024E90BB1877C6F2F114C6858AB1D61C1BC -:1033A0003D2D66B69041DC760671DB01BC20D298DB -:1033B0002A10D5EF8985B1711FB5B606A5E4BF9F68 -:1033C00033D4B8E8A2C9077834F9000F8EA809965B -:1033D00018980EE1BB0D6A7F2D3D6D08976C6491C6 -:1033E000015C63E6F4516B6B62616C1CD8306585DF -:1033F0004E0062F2ED95066C7BA5011BC1F40882BC -:1034000057C40FF5C6D9B06550E9B712EAB8BE8BFC -:103410007C88B9FCDF1DDD62492DDA15F37CD38C85 -:10342000654CD4FB5861B24DCE51B53A7400BCA383 -:10343000E230BBD441A5DF4AD795D83D6DC4D1A4B5 -:10344000FBF4D6D36AE96943FCD96E34468867AD8C -:10345000D0B860DA732D0444E51D03335F4C0AAA2B -:10346000C97C0DDD3C710550AA41022710100BBE2E -:1034700086200CC925B56857B3856F2009D466B975 -:103480009FE461CE0EF9DE5E98C9D9292298D0B0AA -:10349000B4A8D7C7173DB359810DB42E3B5CBDB757 -:1034A000AD6CBAC02083B8EDB6B3BF9A0CE2B603D8 -:1034B0009AD2B1743947D5EAAF77D29D1526DB048D -:1034C0008316DC73120B63E3843B64943E6A6D0DD8 -:1034D000A85A6A7A0BCF0EE49DFF099327AE000A23 -:1034E000B19E077D44930FF0D2A3088768F2011EB6 -:1034F000FEC206695D5762F7CB67658071366C194D -:10350000E7066B6E761BD4FEE02BD3895A7ADA106D -:10351000CC4ADD676FDFB9F9F9EFBE8E43BEB7174E -:10352000D58EB060E8A3D6D67E93D1A1C4C2D838D8 -:1035300052F2DF4FF167BBD16757BCA6DD06B53F3E -:103540004B36B248DA2B0DD84C1B0AAFF64A03367D -:10355000607A0441C3EF60DF55DF67A8EF8E6E31FC -:1035600079BE69468CB361CB1A8366BCA0D26F2545 -:1035700036E2685295770CCC03470BBBB916022292 -:103580002F260555BE3BBAC5280BBDB2925AB42BA7 -:10359000046AB35CA7FFD7C231CFD0B58B9ED92CBC -:1035A0001DAEDE5BB0C2649B26F263EC9CA36A7521 -:1035B0000A936D02A906099C3F360EEB85670772D8 -:1035C00013570005824ABF95147AB8E2AE2BB17B3F -:1035D000381BB60C9B8ED2920DBED5E5B7EFDC7CC6 -:1035E00021DFDB0BD4D2D38642E2D4F1F8B3DD681D -:1035F0006E83DA1FCD16BE815B26B9F6E177B06F18 -:103600007747B718E65A0888706A0FFFCA3B066604 -:103610005C0B0111FF9E658F69AE62F8D3FF6B6191 -:1036200045CF6C1678E20AA0EED20DD75483044E33 -:10363000C2B30339612667A7F71660D04D476949C1 -:10364000DB776E3E4A6AD1AEDC5AD6D9660BDF40D4 -:10365000F03BD83753AEBCA9C59EBBDE7FCFB24787 -:10366000E9FFB5301CF2BDBD8AC2BACA3093B3536C -:10367000A6A3B4240536D0BA9306D7CD2957DE5475 -:10368000BF67D9232E7A66B3B84A61C4021B685D4E -:10369000942B6F2A37BE0BB4A18E0CC31BDF055AC7 -:1036A0008DEF022D01000000000103040600000060 -:1036B0000000000000000000000000008700000083 -:1036C0000400030200000000008001410108000026 -:1036D000010100000400030200000000009001410D -:1036E00002080000000000000000000001000100CE -:1036F00096C298D84539A1F4A033EB2D817D03778C -:10370000F240A463E5E6BCF847422CE1F2D1176B26 -:10371000F551BF376840B6CBCE5E316B5733CE2BF9 -:10372000169E0F7C4AEBE78E9B7F1AFEE242E34F28 -:103730004B60D2273E3CCE3BF6B053CCB0061D6565 -:10374000BC86987655BDEBB3E7933AAAD835C65AEE -:10375000512563FCC2CAB9F3849E17A7ADFAE6BC33 -:10376000FFFFFFFFFFFFFFFF00000000FFFFFFFF65 -:10377000FFFFFFFFFFFFFFFFFFFFFFFF0000000055 -:10378000000000000000000001000000FFFFFFFF3C -:1037900025733A2066726565696E67206E6F6E2DBF -:1037A000656D707479207669727471756575650DD3 -:1037B0000A0056513A202573202D2073697A653D01 -:1037C00025643B20667265653D25643B2071756507 -:1037D0007565643D25643B20646573635F6865615E -:1037E000645F6964783D25643B20617661696C2E75 -:1037F0006964783D25643B20757365645F636F6E13 -:10380000735F6964783D25643B20757365642E6938 -:1038100064783D25643B20617661696C2E666C613D -:1038200067733D307825783B20757365642E666C30 -:103830006167733D307825780D0A00737461747583 -:1038400073203D3D2073697A656F662872705F68EA -:10385000647229002F6A656E6B696E735F776F7291 -:103860006B73706163652F776F726B7370616365E3 -:103870002F4F63746176655F7061636B657463720B -:103880006166745F6275696C645F6D6173746572A3 -:103890002F6E6F726469632E7374642F746869721B -:1038A0006470617274792F4F70656E414D502F6F47 -:1038B00070656E2D616D702F6C69622F72706D7303 -:1038C000672F72706D73675F76697274696F2E63AC -:1038D00000737461747573203D3D20300073746112 -:1038E000747573203E3D20300073746174757320CD -:1038F0003D3D206C656E0072785F76710074785F74 -:103900007671004E5300000072706D73675F7669C8 -:103910007274696F5F73656E645F6F66666368611A -:103920006E6E656C5F6E6F636F70790072706D7331 -:10393000675F76697274696F5F72785F63616C6CE0 -:103940006261636B0072706D73675F766972746930 -:103950006F5F73656E645F6F66666368616E6E65E8 -:103960006C5F72617700000000020000000200003E -:103970004E6574776F726B00426C6F636B00436FC0 -:103980006E736F6C6500456E74726F707900426182 -:103990006C6C6F6F6E00494F4D656D6F727900539F -:1039A000435349003950205472616E73706F7274C2 -:1039B0000000000001000000703903010200000057 -:1039C00078390301030000007E3903010400000080 -:1039D00086390301050000008E390301060000004E -:1039E00096390301080000009F3903010900000017 -:1039F000A43903010000000000000000756E72652C -:103A00006769737465726564202573206275730A33 -:103A1000006465766963652026262064657669639F -:103A2000652D3E627573002F6A656E6B696E735FFC -:103A3000776F726B73706163652F776F726B7370E2 -:103A40006163652F4F63746176655F7061636B6559 -:103A50007463726166745F6275696C645F6D6173D3 -:103A60007465722F6E6F726469632E7374642F7441 -:103A70006869726470617274792F4F70656E414D20 -:103A8000502F6C69626D6574616C2F6C69622F6474 -:103A900065766963652E63006D6574616C5F64654E -:103AA000766963655F636C6F7365002C2066756E65 -:103AB0006374696F6E3A2000617373657274696F25 -:103AC0006E2022257322206661696C65643A206647 -:103AD000696C6520222573222C206C696E65202577 -:103AE00064257325730A000024010021232D302B47 -:103AF0002000686C4C0065666745464700303132EF -:103B00003334353637383941424344454600303145 -:103B100032333435363738396162636465660000A4 -:103B20000000000000000000000000000000000095 -:103B30000000000000000000000000000000000085 -:103B40000000000000000000000000000000000075 -:103B50000000000000000000000000000000000065 -:103B60000000000000000000000000000000000055 -:103B70000000000000000000000000000000000045 -:083B8000A0D4FF7F010000004A -:103B88001C240301000000000100000004000720BD -:103B98005400002100000000FFFFFFFFFFFFFFFFB0 -:103BA800000000000000000000000000000000000D -:103BB80000000000000000000000000000000000FD -:103BC80000000000000000000000000000000000ED -:103BD8000000000004000720FFFFFFFF1F00000097 -:103BE800FFFFFFFF000000000000000000000000D1 -:103BF80000000000000000000000000000000000BD -:103C080000000000000000000000000000000000AC -:103C1800000000000000000000000000000000009C -:103C2800000000000000000000000000000000008C -:103C3800000000000000000000000000000000007C -:103C4800000000000000000000000000000000006C -:103C5800000000000000000000000000FF0000005D -:103C680000000000000000000090D00300FB00FBF3 -:103C780029E702012624030100000000110B0301BB -:103C88000000000000000000510B03018D0B030130 -:103C9800000000000000000000000000000000001C -:103CA8002401002100000000403B0301603B0301A8 -:103CB800203B03010000000000000000000000009D -:103CC80000000000000000000000000000000000EC -:103CD80000000000000000000000000000000000DC -:103CE80000000000000000000000000000000000CC -:103CF80000000000000000000000000000000000BC -:043D080000000000B7 -:040000050102C479B7 -:00000001FF diff --git a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_18929.hex b/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_18929.hex deleted file mode 100644 index 38722c94ec22..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_18929.hex +++ /dev/null @@ -1,13292 +0,0 @@ -:020000040100F9 -:1088000000000121B94D03018D4D03016D4D0301A0 -:108810008D4D03018D4D03018D4D03018D4D0301E0 -:108820008D4D03018D4D03018D4D03018D4D0301D0 -:108830008D4D03018D4D03018D4D03018D4D0301C0 -:108840008D4D03018D4D03018D4D03018D4D0301B0 -:108850008D4D03018D4803018D4D03018D4D0301A5 -:108860006D5E03018D4D0301C14503018D4D030173 -:10887000ED4A03018D4D03018D4D03018D4D030123 -:108880008D4D030139490301FD4703013D4B0301B0 -:108890008D4D03018D4D0301454903018D4D0301AC -:1088A000FD4A03010D4B03018D4D03018D4D030165 -:1088B0008D4D03018D4D03010000000000000000FC -:1088C00000000000000000000000000000000000A8 -:1088D0000000000000000000000000000000000098 -:1088E0000000000000000000000000000000000088 -:1088F0000000000000000000000000000000000078 -:108900000000000000000000000000000000000067 -:108910000000000000000000000000000000000057 -:108920000000000000000000000000000000000047 -:108930000000000000000000000000000000000037 -:108940000000000000000000000000000000000027 -:108950000000000000000000000000000000000017 -:108960000000000000000000000000000000000007 -:1089700000000000000000000000000000000000F7 -:1089800000000000000000000000000000000000E7 -:1089900000000000000000000000000000000000D7 -:1089A00000000000000000000000000000000000C7 -:1089B00000000000000000000000000000000000B7 -:1089C00000000000000000000000000000000000A7 -:1089D0000000000000000000000000000000000097 -:1089E0000000000000000000000000000000000087 -:1089F0000000000000000000000000000000000077 -:108A0000DEE61E284CBBCE8F023500003C00000085 -:108A10004C3E0300010000000088000100880001B6 -:108A2000FFFF0291000000000000000000000000B5 -:0C8A30000000000000000000000000003A -:108A4000002070470388F7B5A3F57C4306460C4623 -:108A5000032B4DD8DFE803F00212204391F9000008 -:108A600000F0B0FA04460120318824F0C3F818B1B0 -:108A700000F8054924F06AF801203AE0CB788A78BA -:108A8000207802EB0322497892B22DF053F808B116 -:108A90000024E8E71224E6E7CA798B79497903EBE9 -:108AA00002232279E07802EB0122A178657801EBBC -:108AB00000212078E77A00EB0520A57A9BB205EB30 -:108AC0000725ADB20195657A247A92B204EB0524AC -:108AD000A4B2009489B280B22EF08EFAD7E708785B -:108AE0002DF012F90028D5D060782DF029F9CEE7C5 -:108AF000002003B0F0BD00002DE9F047A84D86B07E -:108B000028462CF0D1FC4FF49673A64EEB803046ED -:108B100025F082FE402206F10C0102202CF0D8FC48 -:108B2000402206F13E0101202CF0D2FC402206F149 -:108B3000450106202CF0CCFC1022ADF804200822C0 -:108B40000B238DF80620202233714FF49C63ADF87F -:108B500008208022042740F20D11B383F38CADF876 -:108B60000C20B27B1C338DF80E208DF81220ADF84E -:108B7000143096F8242096F82330ADF810101344E2 -:108B800096F82A200DEB0701134496F82B200520B8 -:108B900013448DF816308DF80A702AF0DDFD80B28E -:108BA0002AF0A8FE2AF0C8FF2BF0DCF800F066F9E6 -:108BB0002AF0B0FE80462AF0B3FE0446284629F08B -:108BC000D5FF22464146384603F078FD08EB000900 -:108BD000A4EB000A054652464946384603F082F89F -:108BE0000544AAEB000209EB0001384603F07CF9CA -:108BF0004719304625F042FE96F82250B844E41B4F -:108C000035B12146404625F081FF05468044241AAF -:108C10002146404625F035FF241A8044214605446C -:108C2000404625F044FF241A8044814621464046B0 -:108C300025F061FF241A804482462146404625F0F3 -:108C400048FF3D44211A0746404425F07FFF002499 -:108C50004D4455443D44054429F08EFF02F04AFD41 -:108C600000F048FC02F0D8FB01F0EEFA02F0F0FC54 -:108C700001F0B0F801F0CEF801F03EFD2CF0A6FFB7 -:108C800002F0B2F802F048FA01F0DAFD01F09CFEC1 -:108C900003F0ECFC44482AF037FF2AF061FC25F091 -:108CA000E9FE25F049FF25F039FF25F0F9FE25F012 -:108CB0003CFF25F054FF25F059FF25F0E4FE25F098 -:108CC0003DFF25F048FF25F00DFF25F0FBFE25F0C8 -:108CD000F0FE25F052FF25F010FF25F0FCFE25F0F8 -:108CE00013FF25F03AFF31482AF00EFF25F0CCFDA6 -:108CF0002F482AF009FFB28DF18C2AF041F825F0B7 -:108D0000DDF825F0E7F925F095F925F007F925F0CC -:108D1000F1F925F065F925F0F3F825F0CBF925F008 -:108D20006BFA25F0DBF825F0A5F925F007F925F019 -:108D300079F925F051FA25F03BFA25F031F925F0C3 -:108D40000FF925F01DF925F03BF925F011FA194826 -:108D50002AF0DAFE25F0E0F925F0FCFB164825F0B4 -:108D6000A7F828462AF0C6FD01A80194ADF80840EE -:108D700025F006FF042168462CF05EFD684628F0C9 -:108D8000EBFE012200214FF4003025F0A9FF0B4833 -:108D90002AF0E2FE2AF0ECFE204606B0BDE8F0879D -:108DA00088010021980100218135030129E9020190 -:108DB000AD2D0301E9E70201458A0001418A000166 -:108DC000014B1878704700BF00000720014B197055 -:108DD000704700BF00000720012070470122014BAF -:108DE0005A6070470020014138B5C4003434204631 -:108DF00030F05CFF054618B12246002130F08DFFAF -:108E0000284638BD2FF016BF70B50E46CAB1541EA5 -:108E1000A0B22AF09FFD054698B12246711C30F0A1 -:108E200055FF3378022B0ED0052B05D0012B08D12E -:108E300000212A46084602E02A46032100202AF0A3 -:108E40000BF8002070BD2A460121F7E7C30703D5C0 -:108E5000024B58682FF0A0BD704700BF28020021C8 -:108E600048F29C63C360044B436003F55473036092 -:108E700020238360704700BF048007201FB5684629 -:108E8000FFF7EEFF0298FFF7AFFF044C2060029857 -:108E9000FFF7AAFF606004B010BD00BF28020021E8 -:108EA00030B5294B8BB004AC93E80300002284E872 -:108EB0000300264906202BF057FC25482BF070FCB8 -:108EC00006A8FFF7CDFF204630F0CEFB099B2148D6 -:108ED000214C436130F0AAFB22462049204830F063 -:108EE00071FB226893680BB102F10C0304201D4A48 -:108EF000069990601062012051601B49BDF8204026 -:108F00000D684968156091611849079D88610220C4 -:108F100053619481D362D5619484CA6200228862CD -:108F2000134808620092134830F00CFA124B134AAF -:108F30000293134B0F4901934FF0FF3311480093F5 -:108F40002FF0FEFD0BB030BD7CAD03014D8E000156 -:108F500084AD030100000021E40100215CAD0301A8 -:108F600066AD0301C402002128020021F80200219D -:108F700008AE030130020021058E00016EAD030131 -:108F8000098E0001E8010021022907B5184603F106 -:108F9000FF3310D1042100F8011C012108480A44C4 -:108FA00001910092D0E909122FF02AFD03B05DF87B -:108FB00004EB29F0D1BE01290CBF02210521EAE70B -:108FC000E8010021024B83F87B000020704700BFBE -:108FD000405100212CF046BA2DE9F8431C46D0F848 -:108FE0002C90C56807460E46904629F085FE99F8F4 -:108FF0000D302C44022B04440DD0032B0DD0012B3B -:1090000000D12834306C3D690319AB4208D935646E -:109010000020BDE8F8831834F4E704F5A874F1E7FC -:109020007B682D1A63B14146986829F06BFE854232 -:1090300028BF0546AC4203D9336C2B443364E7E7C1 -:10904000281B4FF47A75044B1B689C886C43A04224 -:1090500028BF2046DDE700BF345300211FB50123A0 -:109060008DF80430002301A8CDE902332CF078F903 -:1090700005B05DF804FB1FB5002301A8CDE901335D -:1090800003932CF06DF905B05DF804FB2DE9F8436E -:1090900004468846C66A2CF0AFFC05460146A06827 -:1090A00006F1980729F02EFE78B9A368DFF89090B2 -:1090B000C9F8843029F020FE2844A060D9F8841033 -:1090C000284629F01FFEC6F8D800D6F8A4300BB108 -:1090D00020469847394600232046A268FFF77CFFC8 -:1090E000074618B9BDE8F84329F0D4BD144DA3686C -:1090F0004046C5F884302CF08FF8124B05F18800FB -:10910000C5F88830104BC5F89470C5F88C30A3684A -:10911000C5F890302CF01CF9002385F88030D6F883 -:109120009C304BB1FFF79AFF96F8CA10D6F898001A -:10913000BDE8F8432CF064B9FFF79DFFF4E700BFEA -:109140006406002105940001E99100012DE9F8432E -:1091500080460C4629F0A8FD064618B10126304687 -:10916000BDE8F8832CF048FC1D4D8146D5F88410ED -:1091700029F0C8FD236C03442364C5F8849029F0CA -:10918000BBFD4A46034621464046FFF725FF0746FA -:109190000028E3D0636A53B10246494640469847E7 -:1091A00028B10122D8F82C3083F8C820D7E7D5F8A9 -:1091B000848029F0A1FD4044C5E9240709482CF02A -:1091C000C7F8002385F88030636833B1FFF746FFA6 -:1091D000272120682CF014F9C1E7FFF74CFFF7E7CF -:1091E00064060021EC0600212DE9F04F87B09A4675 -:1091F0009DF8403003910293934607462CF0FCFB08 -:10920000DFF8F491C9F8000029F03EFDDDE90231F4 -:10921000C46A8046D4F8C450ADB194F8C820012A7D -:1092200011D1CDE900A30A465B463946D4F8B8000F -:10923000A847012804D10023C4F8B83084F8C83006 -:1092400007B0BDE8F08F6D4A6D4D92F88060701CDC -:1092500082F8800076B1022E00F08680AC8C2CF073 -:10926000CBFBD9F80030C01A844240F2B580A88CFC -:10927000A884E5E707B3FB1E012B40F2B680042F5C -:1092800068D06FD833460126032F5DD032461E4684 -:10929000EB690133EB613346164643B117F0FB0F20 -:1092A00046D0404604F19801FFF750FF0646002ED5 -:1092B000D4D029F0FFFCD1E784F8CC1084F8CD306D -:1092C0003A46C4E934BAD4F8980004F1E00304F152 -:1092D000800102F01BFB002834D04046D4F8A830AF -:1092E000D4F89810984700287DD06E8C2CF084FB21 -:1092F000D9F80030C01A86421DD9688C94F8C9305C -:109300006884ADF81030D4F89C300593FFF7A6FEC2 -:10931000012104A82CF056F8D4F8AC301BB140461B -:10932000D4F8981098472B6801332B60002F95D004 -:109330002CF096F8B5E72CF05FFBD9F80030C01A96 -:1093400080B2DBE70127EEE7AA680132AA60002BB2 -:10935000A7D1ACE7334601266A6801326A60002B68 -:10936000E6D1A4E7012293E76FB1FB1E012B1ED9C2 -:10937000042F4FF000034FF0010629D022D9EA69EB -:109380000132EA6189E73A46D4F8A00004F1E0032B -:1093900004F1800102F0BAFA28B14046D4F8B430A2 -:1093A000D4F8A01098472B6901332B61C0E7D4F89B -:1093B000B430002140469847042F4FF001034FF08E -:1093C000000605D0032FDAD1AA690132AA61BEE7EF -:1093D0006A6901326A61C2E72CF00EFBD9F80030ED -:1093E000C01A80B244E7012796E7042F4FF001032B -:1093F0007FF44AAFB0E700BFDC050021640600211E -:10940000280300212DE9F84381462CF0F5FA364E69 -:10941000306029F039FCC56A0746D5F8C03083B101 -:1094200095F8C820012A0CD14946D5F8B8009847CC -:10943000012804D10023C5F8B83085F8C830BDE84C -:10944000F8832A4B2A4C93F8808008F10102B8F186 -:10945000010F83F880202CD1B9F1000F3FD138469D -:10946000D5F8B030D5F89C10984790B1B4F820806A -:109470002CF0C2FA3368C01A804524D9238C238487 -:10948000FFF7F9FD2721D5F8A0002BF0DFFF4FF003 -:109490000008E3680133E360B8F1000F09D02BF056 -:1094A000DFFF384605F19801FFF750FE08B129F0BB -:1094B00001FCE58C2CF0A0FA3368C01A854208D96B -:1094C000E08CE084BBE72CF097FA3368C31A9BB2B8 -:1094D000D5E72CF091FA3368C01A80B2F1E7E3695E -:1094E0000133E361E3E700BFDC05002164060021EE -:1094F0002803002108B50220054A064902F034F984 -:10950000BDE8084028220021034830F006BC00BF17 -:10951000D58F00018D9000012803002130B504464D -:10952000044D0FCD0FC40FCD0FC495E8030084E8A0 -:10953000030030BD280300211FB5002301A8CDE999 -:10954000013303932BF00CFF05B05DF804FB1FB54E -:1095500001238DF80430002301A8CDE902332BF05C -:10956000FFFE05B05DF804FB70B50546C66A084607 -:109570002BF052FE114C124B04F18800C4F88830D5 -:10958000104BC4F88C30D6F8B430C4F89430AB68C3 -:10959000C4F890302BF0DCFE002384F88030D6F83D -:1095A000983043B1FFF7D3FFBDE8704040F201119E -:1095B00005482BF025BFFFF7BFFFF5E76406002144 -:1095C000B99900017D9D000150030021F8B50546C1 -:1095D000134EC76A08462BF01FFE124C336804F185 -:1095E0008800C4F88830104BC4F88C30D7F8A0300D -:1095F000C4F89430AB68C4F890302BF0A9FE002377 -:1096000084F88030336843B1FFF7A1FFBDE8F8402C -:1096100040F2011105482BF0F3BEFFF78DFFF5E78F -:10962000B80500216406002131960001880400215C -:109630002DE9F04F85B08B469DF8381002920391CA -:109640009A4606462CF0D8F9DFF89482DFF8949217 -:10965000C8F8000029F018FB99F880200746C56A71 -:10966000A14C039982B1032A00F0BC80258C2CF018 -:10967000C3F9D8F80030C01A854240F22981208C05 -:10968000208405B0BDE8F08F012E00F08A800AD951 -:10969000F31E012B76D9042E00F09A8000F2A080F0 -:1096A0001346012278E0032385F8BEB04FF0010B8A -:1096B00089F88030029B85F8BF10C5E9303A8B49A4 -:1096C000D5F8983085F8C8B09847002838D002906F -:1096D00028462BF0A1FD029B09F188005344C9F8EC -:1096E00090302BF035FEB4F81C902CF085F9D8F8AA -:1096F0000030C01A81451CD9A08BA083FFF71CFF46 -:1097000040F2011179482BF07BFED5F89C303846A9 -:1097100076499847B0FA80F35B09226801322260EB -:10972000002BA3D016F0FB0F00F0A98029F0C2FA9D -:109730009CE72CF061F9D8F80030C01A80B2DCE761 -:1097400095F8BC3005F1980033B1694B1B68BBB18B -:10975000594698470346E0E795F8CA30012B0AD1ED -:10976000644A1568002DD8D00146604A3846CDF8C5 -:1097700000A0A847EEE73846D5F89C305B499847EB -:109780005B46CAE71146D5F89C3002929847042EF2 -:109790004FF00103029A1DD0032E13D011461A4632 -:1097A00006E01146D5F89C30029298473146029A5D -:1097B000A3690133A36113460A46002BB2D1002AE4 -:1097C000B4D153E7A1680131A160002BAED1F6E717 -:1097D00013460122616801316160002B4FD1EEE731 -:1097E0000121E5E7D5F89830AEB1F21E012A57D92C -:1097F000324600219847D5F89C30002138469847DA -:10980000042E4FF000034FF001025DD056D9A1693C -:109810000131A161D1E7324685F8C86085F8BF10F3 -:1098200085F8BEB031499847064690B328462BF0DC -:10983000F3FC564409F18800C9F890602BF088FDCC -:10984000A68B2CF0D9F8D8F80030C01A864219D966 -:10985000A08BA083FFF770FE40F2011123482BF08C -:10986000CFFD3846D5F89C3020499847B0FA80F0B3 -:109870004009E3680133E36000283FF4F7AE2BF0C2 -:10988000EFFD53E72CF0B8F8D8F80030C01A80B2DA -:10989000DFE73846D5F89C30144998470120E8E7BF -:1098A000324600219847D5F89C3000213846984729 -:1098B000042E4FF001034FF0000205D0032EA6D175 -:1098C00061690131616180E721690131216184E7CA -:1098D0002CF092F8D8F80030C01A80B2D0E600BF61 -:1098E000DC050021640600218C050021880400218C -:1098F000B0050021B4050021012370B50546C66AF4 -:10990000A0B0104C7C22314601A884F8803030F0A1 -:10991000DDF9B36F01A802932BF07EFC0A4B04F132 -:1099200088001B68C4F88830AB68C4F890302BF00E -:109930000FFDFFF701FE022106F1AC002BF018FD30 -:1099400020B070BD64060021B805002170B5164B2B -:1099500093F880506A1C012D83F8802015D1134C98 -:10996000E1B9A68D2CF048F8114D2B68C01A86423B -:109970000ED9A08DA085FFF7DFFD40F201110D4843 -:109980002BF064FDE3680133E3600025284670BDD9 -:109990002CF032F82B68C01A80B2EBE7A36A0133CF -:1099A000A36229F087F9F1E764060021540400213D -:1099B000DC0500215003002170B504462CF01CF892 -:1099C0000B4D286029F060F921460A4CFFF7BEFFD5 -:1099D000668E2CF011F82B68C01A864202D9608E70 -:1099E000608670BD2CF008F82B68C01A80B2F7E7CB -:1099F000DC050021540400212DE9F74FDFF87C92AB -:109A00000E4699F880408046022CDDF830A09DF883 -:109A10003410C56A00F0C480032C00F03981002C9A -:109A200040F09E81964F06B3F31E012B40F29A81BF -:109A3000042E00F0AA8000F2B18023460124032EF8 -:109A400000F0968022461C46BB6A0133BB62234667 -:109A50001446002B00F0928016F0FB0F01D12BF082 -:109A6000FFFC29F027F901248BE0C5E92F3A85F89E -:109A7000BA10D5F89C30834985F8B9209847044638 -:109A8000002862D0D5F89830002B5ED00123B7F8BB -:109A90002EB089F880302BF0AFFF7B4E3368C01AB0 -:109AA00083454CD9FB8DFB8595F8B030ADF800307F -:109AB000D5F898300193FFF74AFD012168462BF055 -:109AC00081FCD5F8A03013B140466E499847002C70 -:109AD0004CD1D5F8A830002B40D040466949984772 -:109AE000044600283AD0032389F880302BF0B8FCD4 -:109AF00028462BF091FB54446448C9F890402BF061 -:109B000027FCBE8D2BF078FF5F4C2368C01A86427D -:109B10001ED9B88DB885FFF70FFD40F201115948E5 -:109B20002BF06EFC4046D5F8AC3056499847B0FA59 -:109B300080F464093B6801333B6014B38FE72BF07A -:109B40005BFF3368C31A9BB2ADE72BF089FCB8E723 -:109B50002BF052FF2368C01A80B2DBE7D5F8AC3097 -:109B600013B14046474998470124E3E70024E1E761 -:109B7000BA680132BA60002B7FF473AF002C7FF417 -:109B800070AF204603B0BDE8F08F234601247A6809 -:109B900001327A60002B7FF462AFEFE7012253E7D6 -:109BA0000324374F89F880406EB1F31E012B51D941 -:109BB000042E4FF000034FF001045BD054D9BA6A71 -:109BC0000132BA6245E7C5E92F3A85F8BA10D5F8EF -:109BD000A4302C4985F8B9209847D5F8A8308BB324 -:109BE000404628499847044660B328462BF014FBAA -:109BF000544409F18800C9F890402BF0A9FBBE8DB0 -:109C00002BF0FAFE204C2368C01A864214D9B88D76 -:109C1000B885FFF791FC40F201111A482BF0F0FBD8 -:109C20004046D5F8AC3017499847B0FA80F464093B -:109C30003B6901333B6180E72BF0DEFE2368C01AED -:109C400080B2E5E7D5F8AC3013B140460D499847EE -:109C50000124EDE7D5F8A43000219847042E4FF0F9 -:109C600001034FF0000405D0032EA8D1BA690132D8 -:109C7000BA6180E77A6901327A618BE76406002174 -:109C80005404002150030021DC050021EC060021D2 -:109C9000D5F8A830364FC6B1F21E012A4ED90021A0 -:109CA0009847D5F8AC3013B1002140469847042EB0 -:109CB0004FF000034FF001044ED080D8032E7FF404 -:109CC0007EAF7A6A01327A6255E72A49984704469C -:109CD00060B328462BF0A0FA544409F18800C9F873 -:109CE00090402BF035FBBE8D2BF086FE224C236876 -:109CF000C01A864214D9B88DB885FFF71DFC40F212 -:109D000001111C482BF07CFB4046D5F8AC301949BA -:109D10009847B0FA80F46409FB690133FB610CE7F2 -:109D20002BF06AFE2368C01A80B2E5E7D5F8AC30A4 -:109D300013B140460F4998470124EDE700219847A9 -:109D4000D5F8AC3013B1002140469847042E4FF0AF -:109D500001034FF00004B1D13A6A01323A6219E7C7 -:109D600000240EE7042E4FF001037FF468AE0EE7E7 -:109D70005404002150030021DC0500212DE9F341AA -:109D80000E461746984604462BF036FE0F4D2860C7 -:109D900028F07AFF9DF8203021460D4C3246CDE95F -:109DA00000833B46FFF728FE268E2BF025FE2B680E -:109DB000C01A864204D9208E208602B0BDE8F08108 -:109DC0002BF01AFE2B68C01A80B2F5E7DC050021E3 -:109DD0005404002108B500220620054901F0C4FC06 -:109DE000BDE808403422002102482FF096BF00BF92 -:109DF000699500015404002130B50446044D0FCD8F -:109E00000FC40FCD0FC40FCD0FC42B68236030BD1E -:109E10005404002108B500220920074901F0A4FCE0 -:109E200000220F20054901F09FFCBDE808402422D4 -:109E3000002103482FF071BFCD950001F998000172 -:109E40008C05002130B50446034D0FCD0FC40FCD56 -:109E50000FC42B68236030BD8C05002170B505460A -:109E6000C66A08462BF0D8F90E4CD6F8B43004F187 -:109E70008800C4F89430AB68C4F890302BF068FACE -:109E8000002384F88030D6F8983043B1FFF75FFBA9 -:109E9000BDE8704040F2011103482BF0B1BAFFF762 -:109EA0004BFBF5E764060021500300212BF0DABAE2 -:109EB0001FB5002301A8CDE9013303932BF050FA1D -:109EC00005B05DF804FB00002DE9F04F85B0804639 -:109ED0000E469346994628F0E7FE074668B93E4C81 -:109EE000D8F82CA094F8823094F88150032B06D136 -:109EF00018B184F8823084F88150012754E0022D93 -:109F000092BF2A46033DEAB202F125018AF8011008 -:109F1000F17E551C41FA02F20133D2074FF00100E5 -:109F2000DBB2EDB2E2D584F8823084F88150B9F129 -:109F3000000F04D11BF0FB0F01D12BF091FA50461A -:109F40002BF06AF9B9F1000F04D0D8F80830C4F842 -:109F5000903009E073685BB32BF04EFD054628F0A6 -:109F6000C5FE2844C4F89000002384F88030F368CC -:109F70001BB14046D4F89010984718482BF0E8F9E8 -:109F8000736833B301238DF80430002301A8CDE9B1 -:109F900002332BF0E5F9337E0121ADF8043033684C -:109FA00001A802932BF0E4F9384605B0BDE8F08F24 -:109FB000327E9AF80E109AF80C0028F0ECF805465C -:109FC00028F094FE284428F055F9D4F89030034442 -:109FD000BDE7FFF76DFFDEE764060021EC06002118 -:109FE0000F4B104A10B5C16AC3F888200E4A91F889 -:109FF000B240C3F88C200422C3F89420002283F8D6 -:10A00000814083F8802083F8822098310123FFF774 -:10A010005BFF18B1BDE8104028F03CBE10BD00BF8A -:10A02000640600216DA100012DA000012DE9F34778 -:10A03000994605462BF0E0FCDFF82481494CC8F82E -:10A04000000028F021FE484AC66A92F88030074690 -:10A05000591C012B82F8801068D106F1980A002D56 -:10A060004BD1C6F8B4902A46D6F89C0006F1B80346 -:10A0700006F1800101F04AFC814668B33846D6F803 -:10A08000A830D6F89C10984730B3B4F81A902BF04B -:10A09000B3FCD8F80030C01A814516D9608B6083B4 -:10A0A000FFF706FF96F8B1300121ADF80030D6F881 -:10A0B000A030684601932BF085F9D6F8AC30ABB1EF -:10A0C0003846D6F89C10984710E02BF095FCD8F84D -:10A0D0000030C01A80B2E2E7002351461A463846E3 -:10A0E000FFF7F2FE0546B9F1000FE6D163680133D0 -:10A0F0006360DDB12BF0B4F910E000232A4651462D -:10A10000FFF7E2FE042D1ED001D8032D09D06369AC -:10A110000133636150B115F0FB0FEBD028F0CAFD9D -:10A1200004E0E3680133E3600028F7D1A58B2BF04E -:10A1300063FCD8F80030C01A85420AD9A08BA083EE -:10A1400002B0BDE8F087A3680133A3600028D1D135 -:10A15000ECE72BF051FCD8F80030C01A80B2EEE7E3 -:10A16000DC050021BC050021640600212DE9FF412A -:10A1700007462BF041FC314E314C306028F084FD15 -:10A180002FB163690133636128F094FD0CE02D4B1E -:10A19000D0F82C8093F8805008F198016A1C83F85D -:10A1A00080206DB1022D39D0E58B2BF025FC336872 -:10A1B000C01A85423BD9E08BE08304B0BDE8F08152 -:10A1C000D8F89C3023B3278B2BF016FC3368C01AC9 -:10A1D000874217D9208B01238DF804300023208378 -:10A1E00001A8CDE902332BF0BBF82421D8F89C005C -:10A1F0002BF02CF9236801332360002DD4D02BF0F1 -:10A200002FF9C1E72BF0F8FB3368C01A80B2E2E700 -:10A210002B462A46FFF758FE0546EBE73B463A46F3 -:10A22000FFF752FE2369054601332361E5E72BF072 -:10A23000E3FB3368C01A80B2BEE700BFDC05002133 -:10A24000BC0500216406002108B50320054A064923 -:10A2500001F08AFABDE808402022002103482FF0CF -:10A260005CBD00BFAD9E0001E19F0001BC05002167 -:10A2700030B50446034D0FCD0FC495E80F0084E8B8 -:10A280000F0030BDBC0500211FB501238DF804303F -:10A29000002301A8CDE902332BF062F805B05DF888 -:10A2A00004FB1FB5002301A8CDE9013303932BF074 -:10A2B00057F805B05DF804FBF8B5204E204BC46A92 -:10A2C000C6F888301F4B0F46C6F88C300423C6F8FA -:10A2D000943000230546A6F8803028F0E5FC0146BE -:10A2E00050BBD4F8D4300BB12846984738462AF0F2 -:10A2F00093FFAB681448C6F89030002386F880308E -:10A300002BF026F8D4F8A83013B9D4F8643183B10F -:10A31000FFF7BAFFAB68B4F8A020C4F868310AB1FF -:10A32000C4F86C3104F198000221BDE8F8402BF02C -:10A330001FB8FFF7B6FFEDE7F8BD00BF64060021C8 -:10A3400059A500014DA30001EC0600212DE9F74FAE -:10A350008B46019307462BF04FFBDFF878815E4D6B -:10A36000C8F8000028F090FC5C4AC46A92F880604B -:10A370008146711C012E019B82F8801040F0848080 -:10A38000012F04F1980A03D00BD9FB1E012B2AD808 -:10A3900094F87C21002A66D000214846D4F8CC30BD -:10A3A00010E0C4F8DC3084F85FB19DF8303094F8E8 -:10A3B0007CB184F8D930BBF1000F05D0D4F8CC3093 -:10A3C000D4F8F81098470EE094F85D3104EB83035D -:10A3D000D3F8F810E1B1D4F8CC309847C0B1404B75 -:10A3E0001B687BB900260023032F84F87C3147D0FB -:10A3F000042F56D0002F58D16B6801336B60002EAC -:10A4000042D05AE05A465146484698470646EAE73F -:10A41000D4F8A8100029E6D04846D4F8CC309847A4 -:10A420000028E0D0EE8B2BF0E7FAD8F80030C01A05 -:10A43000864211D9E88BE883FFF733FF022104F14C -:10A44000AC002AF0BFFFD4F8D030002BCAD0484669 -:10A45000D4F8A8109847C5E72BF0CEFAD8F800300A -:10A46000C01A80B2E7E794F85D3104EB8303D3F8B8 -:10A47000F830002BB7D01B4B1B68002BC3D1B1E7C2 -:10A48000EB680133EB60D6B92C8C2BF0B5FAD8F819 -:10A490000030C01A844215D9288C288403B0BDE846 -:10A4A000F08FAB680133AB60A9E7AB690133AB61F7 -:10A4B000002EE9D017F0FB0F01D12AF0D1FF28F0D0 -:10A4C000F9FBE1E72BF098FAD8F80030C01A80B217 -:10A4D000E3E700BFDC050021E00500216406002160 -:10A4E0000806002104060021F8B5CB6B06460C4691 -:10A4F0000BB90120F8BD0121984705460028F8D086 -:10A50000F06A2AF089FE1148114ED0F89030883058 -:10A510002B44104D83602AF01BFFAF8B2BF06CFA9D -:10A520003368C01A87420AD9A88BA883FFF7B9FEFF -:10A5300004F1240002212AF01BFF0020DAE72BF0AF -:10A540005BFA3368C01A80B2EFE700BF64060021EF -:10A55000DC050021E00500212DE9F04704462BF041 -:10A560004BFA424F424D386028F08EFB82462CB1A8 -:10A57000AB690133AB6128F09DFB20E0DFF8F4808C -:10A58000C66A98F8804006F19809022C44D0032C42 -:10A590005AD0A4B9D6F8A8301BBB96F85D3106EBAB -:10A5A0008306D6F8F830ABB1334B1B6813B149467C -:10A5B000984704462B6801332B60002C52D16C8CD9 -:10A5C0002BF01AFA3B68C01A844245D9688C68841B -:10A5D000BDE8F0870323494688F88030FFF784FF01 -:10A5E000E7E7012388F88030B5F81C802BF004FAE7 -:10A5F0003B68C01A804509D9A88BA883FFF744FEA1 -:10A600002421D6F8A8002AF021FFD3E72BF0F4F993 -:10A610003B68C01A80B2F0E7032388F880300E222E -:10A6200096F8D910707BD6F8DC4027F0B4FD96344C -:10A63000044449465046C8F89040FFF755FF2B693F -:10A64000044601332B61B8E74946FFF74DFF6B69BC -:10A65000044601336B61B0E72BF0CEF93B68C01ABA -:10A6600080B2B4E72AF0FCFE85E700BFDC050021DC -:10A67000E0050021640600210C060021F8B51A4C03 -:10A680001A4BC66AC4F88830194B0F46C4F88C3090 -:10A690000423C4F8943000230546A4F8803028F041 -:10A6A00003FB0146F8B9D6F8D4300BB128469847D9 -:10A6B00038462AF0B1FDAB680E48C4F8903000234C -:10A6C00084F880302AF044FED6F8A83043B1FFF772 -:10A6D000DBFD06F198000221BDE8F8402AF048BEF3 -:10A6E000FFF7DFFDF5E7F8BD6406002159A500017D -:10A6F0004DA30001EC06002108B500220720074900 -:10A7000001F032F800220820054901F02DF8BDE8DB -:10A7100008402422002103482FF0FFBA7DA6000143 -:10A72000B9A20001E005002130B50446034D0FCD6C -:10A730000FC40FCD0FC42B68236030BDE00500218E -:10A740002AF090BE2DE9F0410F46984605462BF0C1 -:10A7500053F9224C224E94F880303060013384F853 -:10A76000803028F091FA0023C26AD4F89C10C2F815 -:10A77000A48082F8A870C4F89C30D2F8A0302A4691 -:10A78000984728F091FA18B12AF06AFE28F092FA58 -:10A79000032D144C10D0042D12D0ADB92368013311 -:10A7A0002360258B2BF028F93368C01A85420FD916 -:10A7B000208B2083BDE8F081A3680133A360F0E71C -:10A7C000636801336360ECE7236901332361E8E7E1 -:10A7D0002BF012F93368C01A80B2EAE76406002150 -:10A7E000DC0500211006002170B50446C66A084643 -:10A7F0002AF012FD104D114B05F18800C5F88C3080 -:10A80000A368C5F89030D6F89830C5F894302AF08F -:10A810009FFD0023204685F88030D6F89C3098476D -:10A8200028F042FA30B128F02FFA18B1BDE8704094 -:10A8300028F040BA70BD00BF6406002145A70001A2 -:10A8400008B50C20054A064900F08EFFBDE8084017 -:10A850001C22002103482FF060BA00BF41A700016D -:10A86000E9A70001100600212DE9FF411A4E0D460F -:10A87000A6F898100221C6F89C00044601A8CDE96C -:10A8800002239DF828708DF804102AF069FD96F8CF -:10A89000803003B137B12946204604B0BDE8F0410D -:10A8A0002AF0AEBD0D4E0E4FB6F814802BF0A4F872 -:10A8B0003B68C01A804508D9B38A29462046B3822E -:10A8C00004B0BDE8F0412AF0C1BD2BF095F83B681B -:10A8D000C31A9BB2F1E700BF6406002110060021F5 -:10A8E000DC05002170B50C460546074E2AF0B8FD80 -:10A8F0002046C6F890502AF08FFC06F18800BDE88B -:10A9000070402AF025BD00BF640600212AF0AABDD0 -:10A9100070B504462BF070F8144A154D92F880304B -:10A920002860013382F8803028F0AEF9C36A2146EE -:10A93000104CD3F89C309847E3680133E36028F06B -:10A94000B3F918B12AF08CFD28F0B4F9668B2BF01E -:10A9500053F82B68C01A864202D9608B608370BDA1 -:10A960002BF04AF82B68C01A80B2F7E76406002182 -:10A97000DC0500211006002170B50446C66A0846B1 -:10A980002AF04AFC0E4D0F4B05F18800C5F88830BF -:10A99000A368C5F890302AF0DBFC0023204685F838 -:10A9A0008030D6F89830984728F07EF930B128F0FA -:10A9B0006BF918B1BDE8704028F07CB970BD00BFDC -:10A9C0006406002111A9000108B50D20054A0649B9 -:10A9D00000F0CAFEBDE808401C22002103482FF009 -:10A9E0009CB900BF0DA9000179A900011006002142 -:10A9F0002DE9FF4104460D4693B1022102928DF8E4 -:10AA0000041001A803932AF0ABFC134B93F8803099 -:10AA10004BB92946204604B0BDE8F0412AF0A8BC55 -:10AA2000CDE90133EDE70D4E0D4FB6F816802AF053 -:10AA3000E3FF3B68C01A804508D9F38A29462046BF -:10AA4000F38204B0BDE8F0412AF0BCBC2AF0D4FF88 -:10AA50003B68C31A9BB2F1E764060021100600218F -:10AA6000DC05002130B50446034D0FCD0FC495E839 -:10AA7000070084E8070030BD100600211FB5012340 -:10AA80008DF80430002301A8CDE902332AF068FCD8 -:10AA900005B05DF804FB00002DE9F04104460D46C9 -:10AAA00028F0F2F8C36A1B780A2B0BD1124B93F8EB -:10AAB00080303BB9FFF7E2FF29462046BDE8F04170 -:10AAC0002AF056BC0D4E0E4FB6F816802AF094FFB1 -:10AAD0003B68C01A804509D9F38AF382FFF7CEFF9D -:10AAE00029462046BDE8F0412AF06CBC2AF084FFDC -:10AAF0003B68C31A9BB2F0E7640600212C060021D4 -:10AB0000DC05002170B50C4E04460D46C6F89C00CD -:10AB1000A6F8981028F0B8F8C36A1B780B2B0AD156 -:10AB200096F880303BB9FFF7A9FF29462046BDE8DB -:10AB300070402AF065BC70BD6406002130B5044643 -:10AB4000034D0FCD0FC495E8070084E8070030BD22 -:10AB50002C06002170B50D4604462AF083FC094BF3 -:10AB6000D3F89C1039B100222046C3F89C20022261 -:10AB7000D5F8B43098472046D5F8AC30BDE87040E1 -:10AB8000184700BF640600212DE9F04105460C4638 -:10AB9000C76A28F089F80646E0B920462AF03CFB4F -:10ABA0000D4C0E4B04F18800C4F888300C4BC4F8EF -:10ABB0008C30AB68C4F890300423C4F894302AF089 -:10ABC000C7FBD7F8A03084F880601BB12846BDE8E9 -:10ABD000F0411847BDE8F08164060021E5AB0001B3 -:10ABE000B9AC00012DE9F04385B005462AF004FF19 -:10ABF0002E4F2F4E386028F047F8D0F82C90294679 -:10AC0000D9F8B03080469847D6F89C10294C0029D6 -:10AC10003AD055BBA58A2AF0EFFE3B68C01A8542A0 -:10AC20001DD9A08A0023A08201A8CDE90133039396 -:10AC30002AF096FBB6F89810D6F89C002AF006FC8D -:10AC4000E3680133E360658B2AF0D6FE3B68C01AE7 -:10AC5000854213D9608B608305B0BDE8F0832AF08C -:10AC6000CBFE3B68C01A80B2DCE700230222C6F8A4 -:10AC70009C304046D9F8B430984708E02AF0BCFE32 -:10AC80003B68C01A80B2E6E70DB92AF0E9FB96F8F6 -:10AC9000803023B928F00EF8012386F88030002D8B -:10ACA000CED0236901332361CDE700BFDC0500214D -:10ACB000640600212C0600212DE9F3470F460546C6 -:10ACC0002AF09AFEDFF81481C8F8000027F0DCFFB4 -:10ACD0000023C66A9DF8282086F8B870404F8DF88A -:10ACE0000730D7F89C1086F8B920C7F89C302A4660 -:10ACF000D6F8B4300446984727F0D6FF814600289E -:10AD000037D04FF0010927F0CFFF40EA0900C0B269 -:10AD100080B1062D06D80123AB4013F0510F01D0AE -:10AD20002AF09EFB97F8803023B927F0C3FF012358 -:10AD300087F880309DF8073023B929462046D6F899 -:10AD4000A8309847032D274C35D0042D37D0002D3F -:10AD500039D1236801332360258B2AF04DFED8F8C2 -:10AD60000030C01A854232D9208B208302B0BDE862 -:10AD7000F0872046D6F898300DF1070198478246B3 -:10AD80000028BED02AF06CFBD6F89C300DF10701EC -:10AD900020469847E06A2AF03FFAD7F890005044DE -:10ADA000C7F8900007F188002AF0D2FA2046D6F8BA -:10ADB000A4309847A7E7A3680133A360CCE7636892 -:10ADC00001336360C8E7236901332361C4E72AF0D4 -:10ADD00013FED8F80030C01A80B2C6E7DC050021A7 -:10ADE000640600212C06002108B50A20054A064900 -:10ADF00000F0BAFCBDE808401C22002103482EF0F8 -:10AE00008CBF00BF55AB000189AB00012C060021AF -:10AE100070B50D4604462AF025FB094BD3F89C106B -:10AE200039B100222046C3F89C200222D5F8B43064 -:10AE300098472046D5F8AC30BDE87040184700BFB1 -:10AE40006406002101232DE9F041C76A054687F811 -:10AE5000B83083680846C7F8C0300F4C0E462AF059 -:10AE6000DBF90E4B04F18800C4F888300C4BC4F8B1 -:10AE70008C30D7F8C030C4F89030D7F8C830C4F858 -:10AE800094302AF065FA0023284684F88030D6F8FA -:10AE9000A030BDE8F04118476406002125B000014C -:10AEA00005AF00012DE9F04106460C46904627F01B -:10AEB000FBFE074618B101273846BDE8F081414640 -:10AEC00030462368984705460028F4D02AF0C8FA8F -:10AED000A36A0B482B44A362B360C0F89030236B85 -:10AEE0008830C3602AF034FA636841463046984798 -:10AEF000F06A2AF091F93046E3689847DCE700BF32 -:10AF0000640600212DE9F04385B00F4698460446BB -:10AF10002AF072FD404E306027F0B6FEC56A9DF8FB -:10AF2000303085F8C47014F0FB07814685F8C530D1 -:10AF300007D1C5F8C08001A8CDE9017703972AF0B1 -:10AF40000FFA95F8B830012B06D12FB9D5F8C030DB -:10AF500085F8B870C5F8BC304FF000082F4FD5F811 -:10AF6000B430D7F89C1022464846C7F89C809847D2 -:10AF700004F0FD03012B8DF804800ED1484601AA90 -:10AF800005F19801FFF78EFF9DF80430804623B944 -:10AF900021464846D5F8A830984727F085FE40EA74 -:10AFA0000800C0B280B1062C06D80123A34013F0DC -:10AFB000510F01D02AF054FA97F8803023B927F0C6 -:10AFC00079FE012387F88030032C154D11D0042C15 -:10AFD00013D0B4B92B6801332B602C8B2AF00CFDF5 -:10AFE0003368C01A844210D9288B288305B0BDE885 -:10AFF000F083AB680133AB60EFE76B6801336B60E4 -:10B00000EBE72B6901332B61E7E72AF0F5FC3368A6 -:10B01000C01A80B2E9E700BFDC0500216406002108 -:10B020002C0600212DE9F74305462AF0E5FC374FB1 -:10B030004FF00009386027F027FE0446C66A29460B -:10B04000D6F8B030984720460DF1070206F1980176 -:10B050008DF80790FFF726FF804655BB27F024FEAA -:10B0600040EA0800C0B258B12AF0FAF9284B93F828 -:10B0700080302BB927F01EFE0122254B83F880205B -:10B080009DF8073023B929462046D6F8A8309847BE -:10B09000204C8DBBE3680133E360658B2AF0ACFC88 -:10B0A0003B68C01A85422BD9608B608303B0BDE832 -:10B0B000F083012D12D10028E2D0DFF85480D8F8B7 -:10B0C0009C1031B102222046D6F8B430C8F89C90CA -:10B0D00098472AF0C5F998F88030CAE7DFF8308041 -:10B0E000D8F89C100029F6D002222046D6F8B430B9 -:10B0F000C8F89C909847EEE7236901332361CCE7B9 -:10B100002AF07AFC3B68C01A80B2CEE7DC05002149 -:10B11000640600212C06002108B50B20054A0649CB -:10B1200000F022FBBDE808401C22002103482EF05D -:10B13000F4BD00BF11AE000145AE00012C06002198 -:10B140001FB501238DF80430002301A8CDE9023397 -:10B150002AF006F905B05DF804FB00002DE9F04186 -:10B1600004460D4627F090FDC36A1B78042B0BD1D3 -:10B17000124B93F880303BB9FFF7E2FF2946204697 -:10B18000BDE8F0412AF0F4B80D4E0E4FB6F8168027 -:10B190002AF032FC3B68C01A804509D9F38AF38251 -:10B1A000FFF7CEFF29462046BDE8F0412AF00AB954 -:10B1B0002AF022FC3B68C31A9BB2F0E76406002128 -:10B1C00048060021DC05002170B50C4E04460D46F2 -:10B1D000C6F89C00A6F8981027F056FDC36A1B78A5 -:10B1E000052B0AD196F880303BB9FFF7A9FF294615 -:10B1F0002046BDE870402AF003B970BD6406002106 -:10B2000030B50446034D0FCD0FC495E8070084E820 -:10B21000070030BD4806002170B50D4604462AF0EF -:10B2200021F9094BD3F89C1039B100222046C3F80C -:10B230009C200222D5F8A43098472046D5F89C30AF -:10B24000BDE87040184700BF6406002170B5054690 -:10B2500008460E4C0E4629F0DFFF0D4B04F1880026 -:10B26000C4F888300B4BC4F88C30AB68C4F890300D -:10B270000423C4F894302AF06BF80023284684F89D -:10B280008030D6F89830BDE8704018476406002139 -:10B290004DB3000199B2000170B50C4605462AF085 -:10B2A000ABFB274E306027F0EFFC9DF81030C26AF0 -:10B2B00082F8A930234B82F8A84093F8801011B986 -:10B2C000012183F880100024D3F89C10C3F89C401F -:10B2D000D2F8A4302A46984727F0E6FC50B1062D54 -:10B2E00006D80123AB4013F0510F01D02AF0B8F873 -:10B2F00027F0E0FC032D144C0FD0042D11D0A5B97C -:10B30000236801332360258B2AF076FB3368C01A4B -:10B3100085420ED9208B208370BDA3680133A360C2 -:10B32000F1E7636801336360EDE72369013323616B -:10B33000E9E72AF061FB3368C01A80B2EBE700BF8F -:10B34000DC05002164060021480600212DE9F043B8 -:10B3500085B005462AF050FB2C4EDFF8B4803060F3 -:10B3600027F092FCD0F82C902946D9F8A030074657 -:10B370009847D8F89C10274C00293CD065BBA58A7B -:10B380002AF03AFB3368C01A85421FD9A08A0123EC -:10B390008DF804300023A08201A8CDE9023329F002 -:10B3A000DFFFB8F89810D8F89C002AF04FF8E3684F -:10B3B0000133E360658B2AF01FFB3368C01A8542B6 -:10B3C00013D9608B608305B0BDE8F0832AF014FBCD -:10B3D0003368C01A80B2DAE700230222C8F89C3032 -:10B3E0003846D9F8A430984708E02AF005FB3368BE -:10B3F000C01A80B2E6E70DB92AF032F827F05AFCFD -:10B40000002DD4D0236901332361D3E7DC0500216B -:10B41000640600214806002108B50420054A0649B3 -:10B4200000F0A2F9BDE808401C22002103482EF0DC -:10B4300074BC00BF19B200014DB2000148060021E2 -:10B4400070B50D4604462AF00DF8094BD3F89C1050 -:10B4500039B100222046C3F89C200222D5F8A8303A -:10B4600098472046D5F8A030BDE87040184700BF87 -:10B47000640600212DE9F0410546C76A08460F4CD5 -:10B480000E4629F0C9FE0E4B04F18800C4F888303E -:10B490000C4BC4F88C30AB68C4F89030D7F89830B7 -:10B4A000C4F8943029F054FF0023284684F88030F3 -:10B4B000D6F89C30BDE8F041184700BF6406002173 -:10B4C00081B50001C9B40001F8B50C461F46054618 -:10B4D0002AF092FA274E306027F0D6FBC26A9DF818 -:10B4E000183082F8B040244C82F8B13094F88030A3 -:10B4F00023B90123C2F8AC7084F880300023D4F85B -:10B500009C10C4F89C30D2F8A8302A46984727F0FF -:10B51000CBFB50B1062D06D80123AB4013F0510FE1 -:10B5200001D029F09DFF27F0C5FB032D134C0FD050 -:10B53000042D11D0A5B9236801332360258B2AF08F -:10B540005BFA3368C01A85420ED9208B2083F8BD80 -:10B55000A3680133A360F1E7636801336360EDE73B -:10B56000236901332361E9E72AF046FA3368C01AF8 -:10B5700080B2EBE7DC0500216406002148060021CB -:10B580002DE9F04385B080462AF036FA2D4D2E4E37 -:10B59000286027F079FBD0F82C904146D9F8A430E8 -:10B5A00007462A4C9847B8F1000F29D1D6F89C30AD -:10B5B0000BB3A78A2AF020FA2B68C01A874214D945 -:10B5C000A08A01238DF804300023A08201A8CDE9D0 -:10B5D000023329F0C5FEB6F89810D6F89C0029F081 -:10B5E00035FFE3680133E3601AE02AF005FA2B68BF -:10B5F000C01A80B2E5E729F033FF27F05BFBF0E7E4 -:10B60000D6F89C1039B100230222C6F89C30384687 -:10B61000D9F8A830984727F04DFB236901332361FF -:10B62000668B2AF0E9F92B68C01A864204D9608B30 -:10B63000608305B0BDE8F0832AF0DEF92B68C01AFC -:10B6400080B2F5E7DC0500216406002148060021F0 -:10B6500008B50520054A064900F086F8BDE808400F -:10B660001C22002103482EF058BB00BF41B400014A -:10B6700075B4000148060021C16A034B0A7853F8EB -:10B68000323003B11847704764060021C16A044B89 -:10B690000A7803EBC2035B6803B11847704700BF29 -:10B6A0006406002129F0E8BE29F0B4BD08B529F0F0 -:10B6B000B1FDBDE80840002029F0D8BE08B529F04A -:10B6C0009BFD002029F0D0FEBDE80840012029F0B4 -:10B6D000CDBE08B529F090FDBDE80840002029F056 -:10B6E000C3BE08B529F088FDBDE80840012029F057 -:10B6F000BBBE000073B5134C134D144E29F074FDFE -:10B70000224629460120124B009627F0FFFA2246D6 -:10B71000294602200F4B009627F0F8FA0E4B2246DE -:10B72000009300210D4B032027F0F0FA01200C4973 -:10B7300027F0FAFAA02200210A4802B0BDE87040C2 -:10B740002EF0EBBA8DB6000179B60001A9B6000162 -:10B75000E3B60001D3B60001ADB60001BDB60001ED -:10B76000A5B6000164060021034B43F8301003EB3B -:10B77000C0035A60704700BF640600212DE9FF41F5 -:10B78000D3E90086044617461D461078002C3ED0AB -:10B7900010B34FEA162C0CF0C00CBCF1400F1BD1BB -:10B7A000404669B1314600F0C1FD38B12B463A46FA -:10B7B0004046314600F02AFD002846D0012008E02E -:10B7C000314600F0A5FC0028F8D1214AD38B013383 -:10B7D000D38304B0BDE8F0814246334600F0BCFD9F -:10B7E0000238C0B20128E9D80DF10F030093387870 -:10B7F000D5E9002300F03EFC10B19DF80F3023B9CD -:10B800000224134A138B013313832046E1E720B14E -:10B81000330A03F0C003402BD0D04246334600F039 -:10B820009BFD02380128C9D80DF10F030093387829 -:10B83000D5E9002300F01EFC18B19DF80F30002B55 -:10B84000BCD1034A138B013313830220C1E700BF2D -:10B85000040700212DE9F041884617461E4604469C -:10B8600058B152EA06030E4D0AD100F0CFFF01286D -:10B8700006D10446EB880133EB802046BDE8F08119 -:10B880003A463346404600F03FFF20B9AB880224D9 -:10B890000133AB80F1E7EB880133EB80EDE700BFCC -:10B8A0000407002137B5DDE9065410B9002003B0C4 -:10B8B00030BDCAB1230A03F0C003402B14D129B113 -:10B8C000284621460AAB08AA00F0FAFCDDE90A2363 -:10B8D0002846CDE9002321469DF8202000F050FCA9 -:10B8E000003818BF0120E2E79DF82000DDE90A23B7 -:10B8F00000F043FD0238C0B20128D7D8024A022026 -:10B90000538B01335383D2E7040700212DE9F04F15 -:10B9100090F800800D8808F00F0845FA08F515F03A -:10B92000010581460F4692461C466E4E87B006D1F1 -:10B93000338801333380284607B0BDE8F08F4FF4D9 -:10B94000C07B72884BFA08FB01321BF0010B437875 -:10B95000728001D00125EEE703F03F03637484F8A1 -:10B96000108010F8025B27F093FEC5F38015E57494 -:10B97000A574C4E90201C4E900017868514604F1E4 -:10B98000080304F11302C0F38010FFF7F7FE01284B -:10B99000054602D0022839D05D46D4E90223D7F803 -:10B9A00004C094F813E01CF0040B0ED0D7E9041087 -:10B9B000834208BF8A4203D1CCF3C00CE64527D0AE -:10B9C0004FF0020B3089013030817888714640FA9F -:10B9D00008F000F00100FFF73DFF584523D2D7F8EB -:10B9E00004C01CF0040F1CD0D7E90413A068E2685F -:10B9F0009A4208BF884204D1E37CCCF3C00C634573 -:10BA00000CD0338901333381012D1AD1002592E7FF -:10BA100070894FF0010B01307081D6E773890133D3 -:10BA2000738101250DE07888E17C40FA08F000F090 -:10BA30000100D4E90223FFF70DFF0128F1D9022804 -:10BA4000E2D04FF0010BB8F1050F257584F815B061 -:10BA500080D80BFA08F818F02A0F3FF47BAF48465D -:10BA600010F8085B27F014FED4E902238146CDE9E3 -:10BA700004237868E37CED09CDE9009188462A46E5 -:10BA800051460293C0F30010FFF70CFF01283FF46A -:10BA900061AF0228BAD07B68DA077FF55BAFD7E9E0 -:10BAA0000212424508BF494503D1C3F34002AA42EE -:10BAB00013D0B2890132B281002DA7D04FEA1828E5 -:10BAC00008F0C008B8F14008A0D19B069ED5338C81 -:10BAD0000133338484F815802DE7F3890133F38132 -:10BAE00038E700BF040700212DE9F04F8146924658 -:10BAF000027C08880E46104110F001001C46714D72 -:10BB000089B005D12B8801332B8009B0BDE8F08FB7 -:10BB10004FF00108D9E900016B88C4E90201013343 -:10BB20006B80C4E9000199F8123008FA02F8E37456 -:10BB3000A37470687388514608EA030800F0040B88 -:10BB400004F1080304F11302C0F38010FFF716FE9E -:10BB5000012807465FFA88F809D0022841D1BBF1D5 -:10BB6000000F01D00020D0E7B8F1000FFAD1D4E9DE -:10BB7000022394F813C0BBF1000F39D0D6E90410AA -:10BB8000834208BF8A4204D17068C0F3C000844574 -:10BB900029D002212889013028810791B8F10008B5 -:10BBA00018BF4FF0010861464046FFF753FE079B60 -:10BBB000984232D2BBF1000F3BD0D4E90202D6E961 -:10BBC00004139A4208BF884205D17368E27CC3F32C -:10BBD000C0039A420FD02B8901332B81012F0ED144 -:10BBE000C0E70027C3E76889012101306881D4E7F5 -:10BBF000CDF81CB0D2E701276B8901336B814FF080 -:10BC0000010B781E47424741277584F815B099F813 -:10BC100011309F0714D4012077E74046D4E902236E -:10BC2000E17CFFF717FE012808D00228D6D00028B3 -:10BC3000E5D1012F38BF0127FFB2E0E70746DEE775 -:10BC4000D4E9021299F81380CDE90412D9E9023738 -:10BC5000E27C706802925146424600930197C0F31D -:10BC600000100793FFF71EFE01283FF44EAF022895 -:10BC70003FF478AF7268D107CDD5D6E90201079BB2 -:10BC8000B94208BF984203D1C2F34003434514D0E0 -:10BC9000AB890133AB81B8F1000F3FF463AF3F0ACA -:10BCA00007F0C007403F7FF45DAF93067FF55AAFC2 -:10BCB0002B8C01332B846775ADE7EB890133EB8166 -:10BCC000A9E700BF04070021054B03F1240253F844 -:10BCD000041B934240F8041BF9D11B880380704772 -:10BCE000040700212DE9F04100240C4BDFF83080DF -:10BCF000054608460E4617461C7088F8004027F097 -:10BD000023FE084B186000EB0513991BB9428EBF48 -:10BD1000204688F8005088B2BDE8F0812A0700214B -:10BD20002B0700212C070021F0B500240D499DF8B8 -:10BD300014C00D780C490968A54201D80020F0BD57 -:10BD40000E7A864208D1D1E900769E4208BF97421A -:10BD500002D14E7A664502D001341031ECE7012061 -:10BD6000EDE700BF2A0700212C070021014B1878BE -:10BD7000704700BF2B0700210022014B1A7070474B -:10BD80002A07002130B50B490B4D09782C78A142C8 -:10BD90000DD90A49096801EB041108720120C1E9B3 -:10BDA00000239DF80C3001344B722C7030BD002004 -:10BDB000FCE700BF2B0700212A0700212C070021E8 -:10BDC0002DE9F0411B4C8446276800253C46DFF8EE -:10BDD00068E09DF818809EF80010EEB2B14201D8DC -:10BDE000002021E0267A664520D1D4E900069E4253 -:10BDF00008BF90421AD1667A464517D1012901F150 -:10BE0000FF300ED985420CD001F18051013907EB8A -:10BE100001110B7A2372D1E90023C4E900234B7A84 -:10BE200063728EF800000120BDE8F0810135103406 -:10BE3000D3E700BF2C0700212A070021F0B50C49E9 -:10BE400043EA00430D780B490C680021C8B28542D3 -:10BE500001D800200AE02046D0E908769E4208BFBB -:10BE6000974201F1010104F14804EFD1F0BD00BF98 -:10BE7000340700215C07002130B585B00C4605462B -:10BE80001022002168462DF048FF6A46230A284602 -:10BE90008DF800401146240C8DF801308DF80240D9 -:10BEA00029F00EFC9DF802309DF801001B0443EAC6 -:10BEB00000239DF80000184305B030BD13B50421E0 -:10BEC00004460DEB010029F0B7FC01992046C1F3AF -:10BED000150141F480010191FFF7CEFF019940EA7D -:10BEE0000160090A02B010BD2DE9F04100240D4B9C -:10BEF000DFF83480054608460E4617461C7088F861 -:10BF0000004027F021FD4821084B186001FB050384 -:10BF1000991BB9428EBF204688F8005088B2BDE810 -:10BF2000F08100BF34070021350700215C070021A4 -:10BF3000014B1860704700BF30070021014B187893 -:10BF4000704700BF350700210022014B1A7070476F -:10BF500034070021F8B507461D46FFF76FFF164668 -:10BF6000044680B92E4A2F4913780978994201D89E -:10BF70000020F8BD48202C490C6800FB0344013325 -:10BF80001370002CF4D0224645EA0745069BC4E90D -:10BF9000086503F1100153F8040B8B4242F8040BBF -:10BFA000F9D1012304F10F0284F84030631E13F825 -:10BFB000011F71B3002384F8403004F110000246E1 -:10BFC000079B03F1100153F8045B8B4242F8045BBA -:10BFD000F9D1012384F84130034604F1200213F81B -:10BFE000011BC9B1002384F8413000230022C4E9B9 -:10BFF0000A23C4E90C23C4E90E230023A4F8423029 -:10C0000094F841301BB9FFF759FFC4E90C01012036 -:10C01000AFE79A42CBD1D0E79A42E0D1E5E700BF43 -:10C0200034070021350700215C07002138B5FFF7F0 -:10C0300005FF78B1084D2C78012C08D9482202FB65 -:10C0400004F30649483B096819442DF03FFE0120DE -:10C05000013C2C7038BD00BF340700215C07002173 -:10C0600008B5FFF7EBFE20B19DF8083080F84330AB -:10C07000012008BD08B5FFF7E1FE20B190F843208C -:10C080000120029B1A7008BD10B5029CFFF7D6FE76 -:10C0900040B1D0E90A2352EA030116BF0120002073 -:10C0A000C4E9002310BD10B5029CFFF7C7FE40B1E4 -:10C0B000D0E90C2352EA030116BF01200020C4E995 -:10C0C000002310BD08B5FFF7B9FE28B1029BD3E9E4 -:10C0D0000023C0E90C23012008BD10B5FFF7AEFE18 -:10C0E000044698B190F8403083B990F8423033B9A3 -:10C0F000FFF7E4FE0123C4E90A0184F84230029B01 -:10C10000D4E90A01C3E90001012010BD0020FCE7C9 -:10C11000F7B50026174C94F800C0174C2568344634 -:10C12000F7B2BC450CD8ECB1144C2468D4B1D3E9B7 -:10C130000067CDE9006713780122A047002411E0D1 -:10C1400095F8407097B9D5E90A748C4208BF8742C8 -:10C150000BD10124E98C01F001011170296AAA8C2C -:10C16000C3E90012204603B0F0BD01240136483572 -:10C17000D6E700BF340700215C070021300700210B -:10C180002DE9F347DDE90A679146804632463B4692 -:10C1900048460D46FFF752FEC8B190F84140B4B989 -:10C1A000D0E90E23AB4208BF424512D00A4BD3F868 -:10C1B00000A0BAF1000F06D04B4622464046294661 -:10C1C000CDE90067D047204602B0BDE8F0870024E3 -:10C1D000F9E70124F7E700BF3007002138B505462D -:10C1E0001046DDE904230C46FFF728FE50B190F815 -:10C1F000413043B9D0E90E23A34208BFAA420CBF85 -:10C200000120002038BD0020FCE700002DE9F74F99 -:10C210000E4605461F464FF000084FF0480B010E32 -:10C2200041EA0621DFF888A021F07F41214B5FFA27 -:10C2300088F41B78A3420DD81F4A2049137801EBDC -:10C24000C30041F83350013303F003034660137019 -:10C25000002026E0DAF800300BFB043494F840901C -:10C26000B9F1000F20D1D4E90A03B34208BFA842B4 -:10C270000ED02046CDE90012FFF7FEFDDDE90012E9 -:10C2800025F07F4383420FD1C4E90A5684F84290D7 -:10C290000120E38C03F001031370226AA38CC7E929 -:10C2A000002303B0BDE8F08F08F10108BEE700BF2E -:10C2B0005C070021340700215807002138070021BE -:10C2C00070B50E461146D3E9002305460878FFF7FE -:10C2D000B5FD0446C0B190F84130ABB9D0E90E23AA -:10C2E000B34208BFAA420DD0290E41EA062121F02F -:10C2F0007F411030FFF7C0FD25F07F43834203D11B -:10C30000C4E90E5601200CE0064A0749137801EBF8 -:10C31000C30041F8335046600020013303F00303AB -:10C32000137070BD5807002138070021042330B571 -:10C33000084AD2E900548C4208BF854202F1080243 -:10C3400005D0013B13F0FF03F3D1012030BD0020E5 -:10C35000FCE700BF3807002108B5FFF76FFD48B1C3 -:10C36000D0E90A23134306D190F84030002B14BFC4 -:10C370000120022008BD0320FCE708B5FFF75EFDA1 -:10C3800048B1D0E90C23134306D190F84130002B7B -:10C3900014BF0120022008BD0320FCE72DE9F04175 -:10C3A00000254FF04808124E124F3378ECB2A342EA -:10C3B00001D8BDE8F0813B6808FB043494F84130B3 -:10C3C0002BB904F11000FFF779FDC4E90C0194F8D2 -:10C3D00040303BB994F8423023B12046FFF76EFD60 -:10C3E000C4E90A01012384F844301D44DDE700BF9D -:10C3F000340700215C0700212DE9F047174600258E -:10C400004FF0480ADFF85C80DFF85C9043EA0046B2 -:10C4100098F80030ECB2A34201D8BDE8F087D9F813 -:10C4200000300AFB0434D4E90823B34208BFBA42FF -:10C4300016D194F841302BB904F11000FFF73EFDFE -:10C44000C4E90C0194F840303BB994F8423023B170 -:10C450002046FFF733FDC4E90A01012384F8443084 -:10C460000135D5E7340700215C07002108B5FFF747 -:10C47000E5FC034620B1002290F8440083F84420F4 -:10C4800008BD08B5FFF7DAFC003818BF012008BD69 -:10C490001FB5002301A8CDE90133039328F060FF05 -:10C4A00005B05DF804FB000030B5144B144D85B0A9 -:10C4B000C5F88830134B0C46C5F88C3083680846A5 -:10C4C000C5F89030D1F89830C5F8943028F0A4FE23 -:10C4D00005F1880028F03CFF03238DF80430002389 -:10C4E00001A8CDE9023328F03BFFB4F8A410D4F83A -:10C4F000A00028F085FF05B030BD00BF85C5000154 -:10C500006406002109C500017FB504460E4626F0E9 -:10C51000BBFB38B3C56A214685F8A66014F0FB065C -:10C52000D5F89C3010D1984778B1032301A8CDE904 -:10C5300002668DF8043028F013FFB5F8A410D5F882 -:10C54000A00028F083FF04E0984728F089FF26F038 -:10C55000B1FB032C0A4B07D0042C09D064B91A682C -:10C5600001321A6004B070BD9A6801329A60F9E72E -:10C570005A6801325A60F5E71A6901321A61F1E727 -:10C5800060070021F7B5054626F07EFB1D4F0646E5 -:10C59000C46A25BB28F064FF29463046D4F8983099 -:10C5A000984718B3184DB4F8A220D5F8903020461B -:10C5B0001344C5F8903028F02FFE05F1880028F0CC -:10C5C000C7FEFFF765FFB4F8A0300121ADF80030D9 -:10C5D000D4F89C306846019328F0CAFE09E028F0A0 -:10C5E0003FFF29463046D4F89830984726F062FB42 -:10C5F00025B9FB680133FB6003B0F0BD3B69013333 -:10C600003B61F9E7600700216406002137B50C465D -:10C610000F4D104BC5F888300F4BC5F88C30836830 -:10C620000846C5F8903028F0F7FD05F1880028F09D -:10C630008FFEFFF72DFFB4F8A0300121ADF80030D8 -:10C64000D4F89C306846019328F092FE03B030BDC8 -:10C650006406002185C5000109C5000108B528F060 -:10C6600001FFBDE8084026F025BB000010B5094CCD -:10C67000002022460849FFF777F8224601200749A3 -:10C68000FFF772F8BDE810401C22002104482DF08D -:10C6900044BB00BF5DC600010DC60001A9C4000176 -:10C6A0006007002130B50446034D0FCD0FC495E857 -:10C6B000070084E8070030BD600700212DE9F04144 -:10C6C00000240D4BDFF834801C700D4B05460846E6 -:10C6D0000E4617461C7088F8004027F035F9094BC4 -:10C6E000186000EBC503991BB9428EBF204688F83D -:10C6F000005088B2BDE8F0817D0700217E0700214F -:10C700007C0700218007002130B50B4943EA004334 -:10C710000A480968047801EBC404A14201D1002051 -:10C7200030BDD1E90050984208BF954201F108019F -:10C73000F3D10120F4E700BF800700217D0700212D -:10C74000014B1878704700BF7E0700210023024A82 -:10C750001370024A137070477D0700217C07002187 -:10C7600070B5064615461C46FFF7CEFF80B9094B4B -:10C77000094A197812788A420BD9084A44EA0644D1 -:10C78000126802EBC10042F8315001314460197067 -:10C79000012070BD7D0700217E0700218007002158 -:10C7A00043EA00431148F0B50468DFF844C0254669 -:10C7B0009CF8001004EBC10E754501D1002014E077 -:10C7C0002846D0E900769E4208BF974205F1080549 -:10C7D000F2D1012905D904EBC10454E90223C0E9CF -:10C7E0000023012001398CF80010F0BD80070021E2 -:10C7F0007D0700210122014B1A7070477C07002140 -:10C800000022014B1A7070477C070021014B1878F9 -:10C81000704700BF7C07002137B5044625F050FA69 -:10C820000022144B9C42144B0CBFDA701A7194F81E -:10C83000423003F0FD03012B01D125F051FA2046CF -:10C840000CF082FC04F1280528460DF1070127F0C1 -:10C85000A1F840B9303420460DF1070127F09AF8CD -:10C8600020B903B030BD27F07DF8EDE727F07AF866 -:10C87000F1E700BF580D00212050002138B5164CBB -:10C88000164B174A1D6804F13C0392E8030083E845 -:10C89000030004F1480029790CF087FD012026F0FF -:10C8A0007DF925F005FA01230E4DEB7094F8423026 -:10C8B00003F0FD03012B01D125F00AFA0CF066FC10 -:10C8C00000200123687184F85832A4F85632BDE87C -:10C8D000384025F094B900BF580D0021540D0021B7 -:10C8E000F850002120500021054BDB7833B10123A3 -:10C8F000044880F899309C3026F06ABD704700BF2C -:10C9000020500021580D0021002025F078B90C207E -:10C9100025F075B908B5012026F056F9BDE80840A4 -:10C920000148FFF779BF00BF580D002108B501206D -:10C9300026F04AF90348FFF76FFFBDE808400020E2 -:10C9400025F05DB9580D0021FFF7E4BF034B1A68CD -:10C95000034B5068916803C3704700BF540D00211A -:10C96000F850002108B5084B08481B68197990F861 -:10C9700088308B4202D048300CF017FDBDE80840EB -:10C98000002025F03CB900BF540D0021580D0021B6 -:10C9900010B50446012026F017F9A37B03F0FD0330 -:10C9A000012B01D125F09CF9D4F8D00120B126F05B -:10C9B000D9FF0023C4F8D031D4F8D80120B126F033 -:10C9C000D1FF0023C4F8D831034AD378013BD37098 -:10C9D000BDE8104025F074B92050002110B5044680 -:10C9E000012026F0F1F8E36833B10B480B4A201A16 -:10C9F000C010504380B2984794F870330BB125F0C3 -:10CA00007FF925F05DF9D4F85C0308B126F0AAFFA0 -:10CA10000023237010BD00BFD01D00214DF833E16D -:10CA200038B50C4605461222002120462DF075F936 -:10CA3000204695F8D83300F8023BD5E9F82326F0D4 -:10CA40002DFE95F8D9330E4A637095F82034237281 -:10CA5000D5F8E431A3FB0232DB0F43EA42036381E2 -:10CA600095F8E831237395F8F832637395F8F93245 -:10CA7000A37395F8FA32E37395F8FB32237438BD4B -:10CA8000E3361A0038B50446012026F087F8A37B68 -:10CA900003F0FD03012B01D125F01AF900232046F4 -:10CAA0006370A370A4F8003184F83C300CF0A6FF4A -:10CAB000054620B920460DF0BFF8054640B128468E -:10CAC00025F0F4F92046BDE8384003210DF090BA76 -:10CAD000074AD3780133D37025F0EAF801232846BA -:10CAE00084F86830A4F86630BDE8384025F0DEB937 -:10CAF00020500021002025F0D9B9000030B4027C7C -:10CB00000121022A18BF00220C4C817065789542E1 -:10CB10000AD190F8002122B900F5827030BC26F0CD -:10CB200057BC00F52E70F9E701FA02F2217821EAEC -:10CB300002022270032130BC0DF05ABAB80F002156 -:10CB4000002025F0B3B9000010B5094C6378012B23 -:10CB500004D9BDE810400C2025F0A8B904F160000C -:10CB600027F017F904F17000BDE8104027F011B963 -:10CB700048140021034B5B7813B10C2025F096B9C3 -:10CB8000704700BF48140021024B587800B10C20B8 -:10CB900025F08CB94814002108B5FFF7F9FE044BC5 -:10CBA0005B7823B1BDE80840002025F07FB908BDBF -:10CBB0004814002138B51E4B01201C6825F0EEFFFB -:10CBC00023790BB125F094F823791A4D2B72D4E90F -:10CBD0000223C5E90423E379AB72A3796B72637D09 -:10CBE0002B760DF095FDD8B12862237980F870334B -:10CBF000A37980F87133E37980F87233D4E90223A2 -:10CC0000C0E9DE230A22238AA0F86833638A5343EB -:10CC1000C0F86C330B23437263798371237DC37136 -:10CC2000286A0DF0B5FABDE8384025F041B800BFDC -:10CC30001C370021C0360021034B5A78012A04BF5B -:10CC400000225A70704700BFC0360021084B186A96 -:10CC500090F85B230AB9012202715B78012B03D1A2 -:10CC6000C370303026F0B4BB05210DF0DBB900BF36 -:10CC7000C036002130B5104C87B06378012B07D146 -:10CC80000025206AC3700571303026F0A1FB657065 -:10CC9000206A01A9FFF7C4FE236A0849084A591A05 -:10CCA000C91051433E2093F8213401AA89B225F0DE -:10CCB00033F907B030BD00BFC0360021D01D0021C0 -:10CCC0004DF833E130B52F4C87B06378206A012BE3 -:10CCD00004BF00236370FFF781FE256A2B7983B1BF -:10CCE0001222002101A82DF018F82749274B691AB4 -:10CCF000C9105943442095F8213401AA89B225F07E -:10CD00000BF9256A95F85B33BBB1217A11F001016B -:10CD100015D1122201A82DF000F81B491B4B691AEE -:10CD2000C91059431A2095F8213401AA89B225F077 -:10CD3000F3F80022236A83F85B2307B030BD182084 -:10CD400026F008FE01460028F3D040F20B13438082 -:10CD5000D4E90423C0E90223A37AC371637A8371FF -:10CD6000237A0371236A9A794271B3F86823D3F85E -:10CD70006C3302824382237E4375054B187B26F079 -:10CD8000FAFDD6E7C0360021D01D00214DF833E171 -:10CD9000685000212DE9F043564B85B01D680DF019 -:10CDA000B7FC0446002800F0A180012025F0F6FE23 -:10CDB000002184F8701395F820304F4F84F87133B8 -:10CDC00095F821304D4E84F87233D5E90A23C4E931 -:10CDD000DE2395F82330384684F820344FF47A73F4 -:10CDE000C4F86C330C233461A4F868136372A91D72 -:10CDF00018F0B8FB40F2E242BB885343C4F8E43178 -:10CE000095F8203084F8D83395F8213084F8D93358 -:10CE1000DB07D5E90A01C4E9F8011CD50B0A03F0C8 -:10CE2000C003403B17D14FF000084FF000098DF8C8 -:10CE300007300DF1070202ABCDE90289FFF7E6F9F1 -:10CE400048B19DF8073043F0020384F8D933DDE997 -:10CE50000223C4E9F82395F83230306984F821348C -:10CE60006B6BC4F8F43295F8383084F8F83295F8E2 -:10CE7000393084F8F93295F83A3084F8FA3295F876 -:10CE80003B3084F8FB320DF083F994F821348BB1F8 -:10CE90001B4B6A6B1B68E3641A4B1B6823651A4BB8 -:10CEA0001B68C4F80831E36D9A67184B1B680BB117 -:10CEB0002046984724F0FCFEAB88288BB3806B8B10 -:10CEC0007080F380AB8B33812B8E738195F8223089 -:10CED0003373EB8BF3816B6B7361AB6BB3610DF0F1 -:10CEE0003BFA05B0BDE8F04306F044B805B0BDE834 -:10CEF000F08300BF1C37002120370021E8360021D5 -:10CF0000CC070021C4070021C0070021D007002161 -:10CF100070470000012310B5064C2069C370303003 -:10CF200026F056FA21693E20BDE8104091F82124F0 -:10CF30000DF070BCE8360021034B18690123303036 -:10CF400000F82D3C26F044BAE8360021044B18695D -:10CF5000C378012B04BF0023C370FFF73FBD00BFA0 -:10CF6000E836002110B5437A04460B2B86B010D169 -:10CF700001A9FFF755FD0C490C4B611AC910594323 -:10CF8000002094F8213401AA89B224F0C5FF06B02C -:10CF900010BD0C2BFBD1014690F82124002006B0D7 -:10CFA000BDE810400DF036BCD01D00214DF833E136 -:10CFB0000123303000F82E3C26F00ABAFFF70EBDF0 -:10CFC000012310B504468370303026F001FA04F5D1 -:10CFD000727026F0DEFE0548201A054CC010604332 -:10CFE000BDE8104080B224F0C9BF00BFD01D0021B1 -:10CFF0004DF833E1F8B50579C388012D1AD0022D1B -:10D0000021D0B5B94FF48562534313490688CC1833 -:10D01000B4F830224088921B82420ADCD4E98A6745 -:10D0200003F56473C4E9E467C81824F0A1FE84F82A -:10D030002052F8BD4FF48562074802FB030300222B -:10D0400083F88822F5E74FF48562034802FB030367 -:10D05000002283F8F022ECE7D01D002108B524F06F -:10D060002FFE0022054B5A70054B93F821301BB15F -:10D07000BDE8084024F034BE08BD00BF20500021A8 -:10D080004051002108B5012025F088FD24F010FE54 -:10D090000122074B5A70074B93F821300BB124F053 -:10D0A00017FE0DF0F1FCBDE80840002024F098BD0B -:10D0B000205000214051002108B5012025F06EFDCF -:10D0C00024F0F6FD0122064B5A70064B93F82130EE -:10D0D0000BB124F0FDFDBDE808400DF0D5BC00BF4C -:10D0E0002050002140510021054B5B7833B10123D2 -:10D0F000044880F829302C3026F06AB9704700BF08 -:10D100002050002168370021002024F069BD0C2048 -:10D1100024F066BD2DE9F041634B8AB05B78002BAB -:10D1200000F0BE80614D95F82860002E00F08C80E4 -:10D13000D5F8FC80B8F1000F00F08180012205F5E0 -:10D140008C7305F1E0014046FEF7E0FB06466820DF -:10D1500026F000FC0446002800F09E8000F108073D -:10D16000384608F1020118F0C8FB384618F01CFCDC -:10D1700000B196B9204626F0F5FB042026F0EAFB24 -:10D18000014630B14FF441734380494B187B26F080 -:10D19000F2FB012025F018FD51E00023A370D5F823 -:10D1A000E031A36395F82B3184F83C3095F82A21BF -:10D1B0009A4207D1D5E94861D5E94602914208BFB4 -:10D1C000864203D043F0020384F83C300020D5E9C6 -:10D1D00048230021C4E91223C4E9140195F82B0166 -:10D1E00095F82A11884207D1D5E94870D5E94661FA -:10D1F000884208BFB74203D0D5E94601C4E914010B -:10D2000094F83C0014F076FC0028B3D1294B214659 -:10D21000D3E91C23C4E9162395F82A3084F8410089 -:10D2200084F83D300123E387FF2384F860304FF614 -:10D23000FF73A4F862301E4B187B26F09CFB0AB0EB -:10D24000BDE8F041FFF70ABF1A4C0DF057FD257CF1 -:10D25000012D9ED13146232268462CF05EFD43F617 -:10D260000543ADF802303C238DF80430A37C0DF16A -:10D270000A008DF80930FF238DF823304FF6FF7335 -:10D28000ADF82430D4E906238DF8085026F006FACC -:10D29000684624F09DFC7CE7002E3FF46EAFCEE79D -:10D2A0000AB0BDE8F08100BF20500021683700219E -:10D2B000685000214051002108B5012025F084FC70 -:10D2C000FFF7CCFE0DF01AFDBDE80840002024F069 -:10D2D00087BC08B5012025F077FCFFF7BFFEBDE84D -:10D2E00008400DF00BBD000010B50446012025F0EC -:10D2F0006BFC074B1868201A064CC01060430430C2 -:10D30000C0B225F0ABFABDE8104024F0D9BC00BF94 -:10D31000C0390021D53FF54F10B50446D0F8E80AD2 -:10D3200028B1043826F01EFB0023C4F8E83AD4F8EC -:10D330002C0928B1043826F015FB0023C4F82C3939 -:10D3400094F83B300BB124F0CBFC024A9378013BBC -:10D35000937010BD2050002138B504461F4D0120A8 -:10D3600025F01CFC2A682046137A84F8D433002365 -:10D3700084F8D53384F8D63384F85C3884F85E3882 -:10D380005168C4F8D8330EF0B7FE014640B160785A -:10D3900024F002FE2046BDE8384004210EF062BDB4 -:10D3A0000F4A93780133937094F83B300BB124F01B -:10D3B0008FFC2B68596851B14FF47A72636A0A394D -:10D3C000B3FBF2F304F57170C91A26F0DCFC607847 -:10D3D0000021BDE8384024F0DFBD00BFC83900217E -:10D3E0002050002138B504461C4D012025F0D6FB05 -:10D3F0002A682046137A84F8D433002384F8D5337E -:10D4000084F8D63384F85C3884F85E385168C4F800 -:10D41000D8330EF071FE014640B1607824F0BCFDB7 -:10D420002046BDE8384004210EF01CBD2B685B6827 -:10D4300093B14FF47A71626A4B4302F59C52083201 -:10D44000B3FBF2F3013B534304F57170B3FBF1F10D -:10D45000BDE8384026F097BC38BD00BFC839002170 -:10D4600070B5134D00F571760446304626F091FCF8 -:10D470002B685B687BB14FF47A71626A4B4302F5AB -:10D480009C520832B3FBF2F3013B53433046B3FBEB -:10D49000F1F126F078FC00212B6860781B7A84F883 -:10D4A000D51384F8D433BDE8704024F075BD00BFB7 -:10D4B000C839002110B5044600F5717026F069FCEA -:10D4C000002384F8D633012384F85E3810BD002190 -:10D4D000407824F061BD0C21407824F05DBD00004F -:10D4E000F0B590F85C3804469FB0002B39D100F5B8 -:10D4F000717026F04EFC2046FFF70EFF012025F04C -:10D5000063FB94F8D42394F8D53322B1934224BF1B -:10D51000432284F8D623002294F8D613607824F0AE -:10D520007EFB238C03F01D031D2B18D1FF234FF628 -:10D53000FF7200200021CDE908323C230022CDE912 -:10D540000401CDE90632CDE90201D4E90C0194F8D9 -:10D550003A30CDE900010121607801F05FFC1FB095 -:10D56000F0BDD0F82C697C4F002E7ED000F6481319 -:10D5700000F5116101223046FEF7C8F9002800F0DD -:10D58000D780682026F0E6F90546002800F0D08014 -:10D590006378314603800023837012A818F084F961 -:10D5A000311805F1080018F0A8F9D4F82C39002B2F -:10D5B00000F0898094F85BC904F5156185F83CC0DA -:10D5C00094F85A39634508D151E90203D4F85069F7 -:10D5D0004A689A4208BF864203D04CF0020C85F894 -:10D5E0003CC0D1E90023C5E9122300220023C5E98C -:10D5F000142394F85B2994F85A399A4208D151E9D6 -:10D600000203D4F850694A689A4208BF864203D0A0 -:10D6100051E90223C5E91423012385F83E30D4F8EB -:10D620005838387BAB634D4B2946D3E91C23C5E9F9 -:10D63000162394F85D3885F83D30012385F83F3096 -:10D6400094F8D53385F8403094F8543885F8413053 -:10D65000FF2385F860304FF6FF73A5F8623026F09F -:10D660008AF92046FFF758FE79E7D0F8E86A002EDD -:10D6700087D031460AA818F017F9311812A818F007 -:10D680003CF9002311939DF8283004F511618DF8C1 -:10D69000403003238DF84130DDE91223CDE90C231E -:10D6A0009DF82A300CA88DF84230DDE91423CDE92D -:10D6B0000E239DF82B3001228DF8433004F53263A0 -:10D6C000FEF712FA5AE794F833CB04F5326185F885 -:10D6D0003CC094F8323B634508D1D1E90262D4F8EA -:10D6E000200B4B689A4208BF864203D04CF0020CD4 -:10D6F00085F83CC0D1E90223C5E9122300220023AA -:10D70000C5E9142394F8332B94F8323B9A4208D19C -:10D71000D1E90262D4F8200B4B689A4208BF8642D6 -:10D7200003D0D1E90023C5E9142394F84D3A74E7F6 -:10D730006378311F26F8043C082306F8023C0323D3 -:10D7400006F8013C387B26F016F901201FB0BDE831 -:10D75000F04025F039BA00BF685000214051002147 -:10D7600010B50446FFF7D8FD012025F02DFA6078AA -:10D770000021BDE8104024F00FBC10B50446FFF7AF -:10D78000CBFD012025F020FA2046BDE810400DF029 -:10D790002FBC3C2380F8D633012380F85E387047D5 -:10D7A00000221346F0B5D0E90076C3F12005A3F1BD -:10D7B000200427FA03F106FA05F5294326FA04F4B2 -:10D7C0002143C90744BF81180B7203F1010348BF0D -:10D7D0000132252BE9D180F82D20F0BD70B504462B -:10D7E0000025012025F0DAF984F84E530BF09CFB5C -:10D7F000A4F8905184F8B7532546354BC4F88C01F2 -:10D80000D3E90E23E5E9DA23284624F0B1FA01230F -:10D8100084F89633D4F88C3183EA1343A4F8983310 -:10D8200094F8DD3BEBB194F8B713B4F8903159405C -:10D8300028460DF007FD94F8DD3B84F84D032046A3 -:10D8400093B1244B1B687BB19847054678B12046BD -:10D8500003210EF07FFD29466078BDE8704024F07A -:10D86000D2BBB4F89011E3E70EF0B4FDEDE701236D -:10D8700084F88931A378012B13D194F8C52B0AB908 -:10D8800084F89231D4F82C66B4F8525824F06DF92B -:10D890003246294625F00EFF0123A4F83E0684F8FF -:10D8A000C63B94F854335BB1D4F82C66B4F85258A4 -:10D8B00024F05BF93246294625F0FCFEA4F8560315 -:10D8C0006078002124F09FFBBDE8704024F0F0B99F -:10D8D00020500021840700210021407824F093BBD0 -:10D8E0000C21407824F08FBBF8B583780446012BD7 -:10D8F00011D190F88951012D0DD1D0F82C76B0F8C6 -:10D90000526824F032F93A46314625F0D3FE84F8C5 -:10D91000C65BA4F83E06012384F84E33002394F836 -:10D92000DD2B84F8893184F892316AB1D4F824056A -:10D930000F22A0F8003F47F6FF73FF21A0F8023F37 -:10D9400000F604702CF0E9F904F5CA70BDE8F8405F -:10D9500025F03EBD10B590F888310446012B04D166 -:10D96000FFF7C2FF2046FFF7BFFC2046BDE810408E -:10D97000FFF7A0BD10B590F888310446012B04D103 -:10D98000FFF7B2FF2046FFF7AFFC2046BDE810408E -:10D990000DF02EBB10B50446FFF7A6FC6078002101 -:10D9A000BDE8104024F02FBB90F85030012B12D06E -:10D9B000094B1B68D3E90223C0E9E823C0E9162319 -:10D9C000B0F890310633A0F86030082380F8523068 -:10D9D000012380F850307047BC390021D0F8D03B8B -:10D9E0000BB1407818477047D0F8D43B0BB1407862 -:10D9F0001847704790F82031012B0ED0D0F8A8338B -:10DA0000C0F82431B0F8AC33A0F82831B0F8B43302 -:10DA1000A0F82A31092380F8223170470023C0F88A -:10DA20002031C0F82431C0F8283170476822002125 -:10DA30002CF073B95030FFF7F9BF2B2307B58DF8E1 -:10DA400003008DF804006846ADF800108DF8023030 -:10DA50008DF8051024F0BCF803B05DF804FB2D230D -:10DA600007B5ADF800008DF804006846ADF8023047 -:10DA70008DF8051024F0ACF803B05DF804FB08B590 -:10DA8000012025F08BF8BDE8084024F011B9000012 -:10DA90002DE9F04FDFF840810446D8F800608FB0E0 -:10DAA00006F1080529460FF0EFFD2946002520461E -:10DAB0000FF052FEAA46B37DAB4243D9002794F83B -:10DAC000562004F1570305F101090BE0D4F8943016 -:10DAD00053BB94F89C30C4F894B0ED1A84F89D5070 -:10DAE00022E00137BA421FD913F8011B4945F8D18A -:10DAF00020460EF0E5FE96F84030F18E0293D6E90E -:10DB00000E23CDE900230A46F16A83460EF07EFF1C -:10DB1000D4F89030002BD9D1E368C4F890B06B43AF -:10DB200084F89C50C4F8983094F85630BB4207D122 -:10DB300094F834305A1C0E3384F8342044F823A06F -:10DB40004D46B8E7D8F80010204608310FF01AFD0E -:10DB5000216F04F1600026F016F92C23A57820220D -:10DB6000002106A8ADF81630ADF814502CF0D5F809 -:10DB7000E36A1A4A0793238B04F138015BBAADF8C4 -:10DB80002030638B8DF81950ADF82230A3885034C3 -:10DB9000ADF8243054F8403CA3FB0232DB0F43EADB -:10DBA00042030022ADF82630134651F8040B40B171 -:10DBB00040880EAD5A1C05EB430323F80E0CD3B27C -:10DBC00001228C42F1D10AB18DF8283005A823F04A -:10DBD000FFFF0FB0BDE8F08FD8390021E3361A00FF -:10DBE00090F8BA3080F85430704710B504468AB0C7 -:10DBF00081780020FFF721FF0021202202A82CF0CD -:10DC00008CF82C228DF806204422A37801A8ADF8C8 -:10DC100004308DF807208DF808208DF8093023F0A6 -:10DC2000D7FF20460FF056FA0AB0BDE8104024F0A6 -:10DC300047B8082380F8543070473D2380F85430AB -:10DC4000704710B50446012024F0BEFF236D13B1C8 -:10DC5000002283F88A226378032B06D194F854308B -:10DC6000A0784BB11946FFF7FAFE20460FF032FAC2 -:10DC7000BDE8104024F024B801461846FFF7DDFE49 -:10DC8000F3E7F8B5054610F0DDFA044648B128463A -:10DC9000042110F0A5FA21462846BDE8F84010F00E -:10DCA00039BA012024F07AFF2C6DCCB1012384F81D -:10DCB0008931A378012B13D194F8C52B0AB984F8C4 -:10DCC0009231D4F82C76B4F8526823F04EFF3A46DD -:10DCD000314625F0EFFC0123A4F83E0684F8C63B4C -:10DCE0002846022110F092FABDE8F84023F0E0BF88 -:10DCF000F0B5044685B007200FF028F9064630B38A -:10DD0000144B03A91868258C0390304619F080F94C -:10DD1000114F0635ADB2D7E90E230095304419F006 -:10DD20008AF90622314620460FF017F994F8A03000 -:10DD3000A4F8A85043F0010384F8A030D7E90E23DB -:10DD4000C4E92C23236D13B1002283F8B82005B059 -:10DD5000F0BD00BF2CAE03012050002173B5044676 -:10DD600003200FF0F3F80646E0B1124B01A9586802 -:10DD7000258C0190304619F04BF90635ADB22A4694 -:10DD800094F8BA10304419F068F90622314620465A -:10DD90000FF0E3F894F8A030A4F8B85043F0020371 -:10DDA00084F8A0300321204602B0BDE8704010F096 -:10DDB0002DBA00BF2CAE030110B50446C43025F0C7 -:10DDC00007FB2046BDE81040032110F01FBA10B534 -:10DDD0000446012024F0F8FE20460FF07BF923F0E2 -:10DDE0006FFF6378022B04D12046BDE8104010F08D -:10DDF000E3B910BD164A30B514684FF49562C38874 -:10DE000085B002FB0344062203890546ADF80430C1 -:10DE1000ADF80A30C37F01A88DF80C308DF80620CC -:10DE20008DF807108DF8081023F0D2FE94F82E34E8 -:10DE300063B12989B4F8360410F0EEFB054628B921 -:10DE400004F5866023F0C4FE84F82E5405B030BD7E -:10DE5000B43A00212DE9F0438BB0044615460E4636 -:10DE60002422002101A82BF058FF27238DF802302F -:10DE700040F2E243B4F8E82294F8EB1294F8EA7224 -:10DE800002FB01FE02FB07F003FB0EFE94F8D892A2 -:10DE900003FB00F8D4F8E432B9F1010F0CBF5B19B1 -:10DEA000EB1A734405932369D4F8E0020393B4F8A2 -:10DEB000D432B4F808C0ADF8183094F8EC3208BF8A -:10DEC00040198DF81A3094F8F43218BF281A8DF8DA -:10DED0001B3094F8F53208BF40448DF81C30A37A0B -:10DEE00018BF4044ADF800C08DF803600CBF04902B -:10DEF0000490ADF806C08DF8046002958DF81D7091 -:10DF00008DF81E10ADF824208BB9B4F83021012B08 -:10DF10000CBFB4F83031B4F82C316846ADF820208D -:10DF2000ADF8223023F054FE0BB0BDE8F083B4F816 -:10DF30002C21ECE738B5054604200C4625F00AFDF7 -:10DF4000014650B12B89C47003800F238370034BAB -:10DF5000187BBDE8384025F00EBD38BD6850002163 -:10DF600038B5054604200C4625F0F4FC014650B1B6 -:10DF7000EB88C470038001238370034B187BBDE8DA -:10DF8000384025F0F8BC38BD68500021014B9B7C1F -:10DF9000C3777047283A0021024B1B681B79C3776F -:10DFA000704700BFE03900213E23C3777047082344 -:10DFB000C37770472223C37770470D23C377704719 -:10DFC000014B5B7CC3777047283A00213D23C37720 -:10DFD0007047000010B50446C07A10F097FB4FF46C -:10DFE00095611B4BE2881B6801FB0233C27D013245 -:10DFF000C275A27A22BB94F8D412032993F8562052 -:10E0000021D1013A18BF01228A1A1A4492F95022EA -:10E010007E2A1AD193F81504B8B10E4A581812681E -:10E02000032992F9282080F84F2208BF83F8532251 -:10E03000D3F834335B0702D5012384F8CB3210BD0B -:10E0400094F8D512D9E70122DEE784F83A21F6E701 -:10E05000B43A0021DC4D002138B590F84750044611 -:10E060000022C17F4DB1222906D180F8472011211D -:10E07000BDE83840FFF7EEBE0C25204684F8472067 -:10E080000022FFF7E7FE204610F04CFEE37F442B12 -:10E0900007D1162329462046E377BDE83840FFF72D -:10E0A000A9BE38BD38B50446C08813F0A7F90546A7 -:10E0B00098B9082025F04EFC014668B1E38803803A -:10E0C00041F2017343802389C380E37F0371044BD2 -:10E0D000187B25F050FCA57638BD0123A376FBE71D -:10E0E00068500021F8B504460121C688008915F062 -:10E0F0009FFD0221208915F09BFDE07A10F006FBC0 -:10E10000054604F52E7025F044FE01236376E37F77 -:10E110003E2B0CD100276776EB7D2046013BEB754B -:10E1200010F000FE3A462046E17FFFF793FE144BC5 -:10E130001B6893F83520134B1C680023934219D2B7 -:10E14000E188B14217D1657EADB9A17E99B10820B1 -:10E1500025F000FC014668B1E388038041F20173B9 -:10E1600043802389C380E37F0371074B187B25F02D -:10E1700002FCA576F8BD013304F56274DEE700BF4A -:10E18000DC4D0021E4390021685000218378012B07 -:10E1900008BF4376704770B5054604200C46CE7F15 -:10E1A00013F0D0FE014648B122230370E37A437096 -:10E1B000237BC6708370284613F09AFE21462846BA -:10E1C000BDE8704010F0ADBE034B9B7CCB770123C4 -:10E1D00080F87F33704700BF283A002108460521A8 -:10E1E000FFF7A8BEFFF7D7BF012380F87F33704742 -:10E1F0002DE9F34705460C46C87A10F087FAB5F8C2 -:10E200000432B5F80672DA1DB5F80832B5F85E14B6 -:10E21000C3EB470302FB0133A4F848300023A4F802 -:10E220004A30064610F03AFBB4F84830B5F806120A -:10E23000B5F80A225B1A5343EF6900285FD140F218 -:10E24000E242DFF8289102FB0377D9F80010DFF8EB -:10E250002081731A9B1008FB03F313F0FF0302D015 -:10E260003269002A47D03A46032340F2E247D9F800 -:10E270000010B08A711A891008FB01F10A3100936D -:10E28000784305F11403C9B224F00CFBD4E904234C -:10E290009B1A326913440344B3F5FA7F38BF4FF435 -:10E2A000FA73E36440F2E243B5F80A1294F8EC2200 -:10E2B0005943304BD4F8F0021B68DB8E00FB12335D -:10E2C0000B44E26C9A4249D202B0BDE8F0870132B9 -:10E2D000D2B2981AC7D40CFB001090F804E0BEF13B -:10E2E000000FF4D00369406B03EB000A24F004FD37 -:10E2F00050443061B7E701224FF09C0CE9E740F24F -:10E30000E24909FB0377B4F84A20B6F814800132D9 -:10E3100092B202FB08F8A4F84A20726A394609FB57 -:10E320000828404624F0EEFC0028ECD03946404650 -:10E3300024F0E8FCD4E904239B1A0344B3F5FA7FE4 -:10E3400003D84FF4FA70E064ACE73946404624F055 -:10E35000D9FCD4E904239B1A1844F4E7521AE26466 -:10E36000B4F848200132A4F84820AAE7DC3900219B -:10E37000976FF996DC4D00217FB50546C87A0C46AB -:10E3800010F0C4F9C37D0646F3B9837D002B00F07D -:10E39000F0804179C1B940F2E242838A5343804A16 -:10E3A0001068804A301A801050437F4A0A30CDE905 -:10E3B0000112F268C0B200921A4624F0BDF900289A -:10E3C00000F0D7800123737121462846FFF710FF24 -:10E3D0002146304610F018FB744BC5F83C34744BA2 -:10E3E000C5F84034734B1B681B88E380D5F848326E -:10E3F000C4F8E830B5F88232A4F8C8320AF094FDC7 -:10E40000D5E98623C4F8E400204610F04BFA242016 -:10E4100013F098FD0146002800F0A1801F2303702F -:10E42000E37A4370237B837094F8D432022B03D0B9 -:10E43000032B14BF01230423CB7094F8D532022B95 -:10E4400003D0032B14BF012304230B71B4F8DA3279 -:10E4500028464B7194F8D832B4F8DA22DB03C2F3C1 -:10E460000B029BB213431B128B71B4F8DC32CB71DD -:10E47000B4F8DC32C3F303230B72D4F8E0324B72EE -:10E48000D4F8E0321B0A8B72B4F8E23203F00F03C7 -:10E49000CB72D4F8E4320B73D4F8E4321B0A4B731A -:10E4A000B4F8E63203F00F038B73B4F83031CB735A -:10E4B000B4F830311B0A0B74B4F82C314B74B4F837 -:10E4C0002C311B0A8B7494F8EC32012BCB740CBFEB -:10E4D000002394F8F0320B7594F8EC32012B0CBF4A -:10E4E000002394F8F1324B7594F8EC32012B0CBFF9 -:10E4F000002394F8F2328B7594F8F43294F8F522F4 -:10E5000003F00F0343EA0213CB7594F8EA320B765B -:10E5100094F8EB324B76B4F8E8328B76B4F8E83204 -:10E520001B0ACB76E36C0B77E36C1B0A4B77B4F8D2 -:10E530004E308B77E36CCB77E36C1B0A81F820308D -:10E54000B4F84E3081F82130B4F8483081F82230E8 -:10E55000B4F848301B0A81F8233013F0C9FC0123BA -:10E560002146284684F8473004B0BDE8704010F0DA -:10E57000D8BC2046FFF721FD042025F0EBF9014629 -:10E5800008B904B070BDE388038044F601334380CA -:10E59000094B187B04B0BDE8704025F0ECB900BF12 -:10E5A000DC390021976FF996B107020165EE010190 -:10E5B000C1EE0101B03A002168500021002310B5DE -:10E5C0000C46084681F84730FFF7FAFC204612F067 -:10E5D000FFF82046BDE810400221FFF7ABBC000069 -:10E5E00070B50546C87A0C4610F090F8384B0646D0 -:10E5F000D3E904329A4205D3C378FBB1204611F027 -:10E60000FFFF1DE001220D21284601F097F9214668 -:10E61000284610F090FC0023204684F84730FFF78E -:10E62000CCFC2146304610F082FA204612F0D0F899 -:10E6300002212046BDE87040FFF77CBC11F046FF88 -:10E64000204610F091F9337923B922462946304605 -:10E6500012F04EF80023102084F8473013F072FCBB -:10E66000014670B321230370D4F8E4304370D4F82A -:10E67000E4301B0A8370B4F8E630C37094F8E730D6 -:10E680000371E36C4371E36C1B0A8371B4F84E3081 -:10E69000C3716369037263691B0A4372E38A8372FD -:10E6A0002369C37223691B0A0373638A4373B4F833 -:10E6B00048308373B4F848301B0AC373284613F0FC -:10E6C00017FC2146284610F036FC0121B1E700BFB7 -:10E6D000283A002170B50646C87A0C4610F016F8A4 -:10E6E00005462146304610F026FC2046FFF762FC26 -:10E6F0002146284610F01BFA204612F069F8204601 -:10E70000BDE870400221FFF715BC10B50C4610F0B3 -:10E7100012FC204612F05CF82046BDE810400221B1 -:10E72000FFF708BC10B50C4610F005FC204612F0AF -:10E730004FF844232046E3770221BDE81040FFF75D -:10E74000F9BB40F67C42838C10B5043B9BB29342EC -:10E75000044601D9122010BD037E1F2BFAD803797D -:10E76000012BF7D8C388B3F5805FF3D20389B3F5E3 -:10E77000805FEFD2C368B3F5801FEBD20369B3F5B6 -:10E78000801FE7D240F6FB73828A9A42E2D8C28A9F -:10E790009A42DFD881784B1E012B01D90429D9D1A7 -:10E7A000E078431E012B01D90428D3D122F094FF35 -:10E7B0000028CFD094F82230013B1E2BCAD894F801 -:10E7C0002330013B1E2BC5D894F82030102BC1D824 -:10E7D00094F82130102BBDD8D4E90A329A42B9D32B -:10E7E0000020B8E71FB528220389ADF80620ADF850 -:10E7F0000430ADF80A30C37AC2888DF80C30037B40 -:10E80000044601A8ADF808208DF80D3023F0E0F99A -:10E8100018B91A21208921F0F5FB04B010BD0000C1 -:10E8200070B50D4E054600F5FA700C4625F0B1FAAC -:10E8300033681979102903D100222046FFF70AFB1B -:10E84000336828460122197901F078F82046BDE89E -:10E85000704010F067BA00BFB03A00212DE9F74FC1 -:10E86000064600F5FA70894625F093FA092013F060 -:10E8700069FB044620B3214BD3E90E57BD42B3F8E0 -:10E88000408024D093F812A093F813B0336A019318 -:10E8900024F032FA019B1844854203D8356A24F0EB -:10E8A0002BFA0544BBF1040F02D0BAF1040F00D1DA -:10E8B0009635AF420BD201221121304601F03EF8CD -:10E8C0004946304603B0BDE8F04F10F02ABB202384 -:10E8D00023702B0A6570A3702D0C3B0A277184F8F6 -:10E8E00007803F0C4FEA182821463046E5706371D7 -:10E8F000A77184F8088013F0FBFAE1E7283A0021B9 -:10E900002DE9F74F814F06463B690C46C1F8E430CC -:10E910003B8CA1F84830D0F84832C1F8E830B0F864 -:10E920008232C87AA1F8C8327B69CB64BB694B617B -:10E93000FB690B610FF0EAFE0546214610F085F8F1 -:10E940002146284610F060F8EB78ABBBBB69204647 -:10E95000EB60B4F8E832AB82D6E986230FF0A2FF71 -:10E96000284612F037F820460FF0FEFFB4F8482092 -:10E97000B6F80632D01AB0F5004F0CDA40F2E24792 -:10E98000B6F8CA11521AB6F80A1292B24A43E16CAA -:10E9900007FB021222662F79BFB92246314628466C -:10E9A000AF7012F02DF9A4F84A700121204603B08F -:10E9B000BDE8F04FFFF7BEBA2046D6E986230FF038 -:10E9C00071FF204612F0A4F8CDE7B6F8CA21B5F8D9 -:10E9D00074E09B1A9BB2034440F2E240B6F80A226C -:10E9E000AF6F03FB0222D6F8D031A98A00FB0233B5 -:10E9F00000221FFA82FCBEF1000F53D101FB0CF87C -:10EA000000FB0878984502F10102F2D92846A4F8E3 -:10EA10004AC010F09EF801280746C6D9284610F0D3 -:10EA2000A7F801468246284610F0D4F8022F13D1E9 -:10EA30009AF8EC32012B38D0DAF8F022DAF81430F8 -:10EA40001344DAF810209B1AD0E90412521A9342A8 -:10EA500034BF00230123AB70AB78012B39D128469A -:10EA600010F086F801468146284610F0B3F80022DF -:10EA70008346022F1BD140F2E240D6F8D011236E1C -:10EA80000B44B6F80A1200FB0133A3EB0801A8EB14 -:10EA90000308DAF8F0328A1A4344C9F80821CBF89F -:10EAA000083182E70CFB0118AAE70023D3E7D9F865 -:10EAB000083149461A442846019210F08BF859460D -:10EAC0008146284610F086F8013F8346019AFFB23E -:10EAD000CFE72146284610F09DF84FF00008064683 -:10EAE0000146022F07D1D4E904239B1AA3EB0803A4 -:10EAF000C6F8F83259E7284610F08CF8D0F8F8320A -:10EB0000013F01469844FFB2EBE700BF283A0021DD -:10EB10000B4670B5264C01F1640204F1300625461F -:10EB200003CDB542106051602C4602F10802F6D1C7 -:10EB3000286810601F4A517C1973917C022903D008 -:10EB4000042914BF0121032183F8D412D17C0229A6 -:10EB500003D0042914BF0121032183F8D512117DAC -:10EB6000108E83F8D812D18AA3F8F402A3F8DA122F -:10EB7000118B508EA3F8DC12D169A3F8EA02C3F816 -:10EB8000E012116AC3F8E412918CA3F82C11D18C15 -:10EB9000A3F8301192F8281083F8EC12D16A928E03 -:10EBA000C3F8F012A3F8E822C3F8081170BD00BF43 -:10EBB000383A0021283A002138B5044615480D4658 -:10EBC000FFF7BFFD48B101221E21204600F0B6FE2E -:10EBD0002846BDE838400FF0C3BC0F4BDB6ADB07AB -:10EBE00002D401221A21F0E729462046FFF790FFC0 -:10EBF0002846FFF7F7FD40F27121084B04F5FA7043 -:10EC00001B8B4B434FF47A71B3FBF1F1BDE83840F5 -:10EC100025F0B9B8383A002120500021DC500021FD -:10EC2000034B08465B7CCB770221FFF783B900BF1B -:10EC3000283A002170B5054601F164000C46FFF743 -:10EC400080FD48B101221E21284600F077FE2046B3 -:10EC5000BDE870400FF084BC124BDB6ADB0702D4C6 -:10EC600001221A21F0E7104E307C0FF04FFD30B931 -:10EC7000307C0FF007FD10B901224321E4E7204664 -:10EC8000FFF7B0FD40F27121084B05F5FA701B8BC0 -:10EC9000BDE870404B434FF47A71B3FBF1F125F0BE -:10ECA00072B800BF20500021283A0021DC5000211A -:10ECB000F8B5054618200F4614461E4613F042F9D3 -:10ECC000014660B307702388FF22437023881B0A24 -:10ECD00083706388C37063881B0A0371A3884371C0 -:10ECE000A3881B0A8371E388C371E38846721B0AF9 -:10ECF0000372B5F806328372B5F806321B0AC37286 -:10ED000000F10E031A3003F8022C03F8012C023331 -:10ED10009842F8D12846BDE8F84013F0E9B8F8BDAC -:10ED200038B5044609200D4613F00CF901460028B9 -:10ED30003FD0057094F82203B4F84823B4F84C335C -:10ED400018B1D4F83003000520D440F648008242C0 -:10ED500028BF0246834228BF0346B4F846034870E2 -:10ED6000B4F84603CA70000A120A88700A71B4F82F -:10ED70004A2320464A71B4F84A23CB71120A1B0A6F -:10ED80008A710B72BDE8384013F0B2B894F85500A0 -:10ED9000032804D1B2F5296F38BF4FF4296294F8E3 -:10EDA00054000328D9D1B3F5296F38BF4FF4296334 -:10EDB000D3E738BD70B5054602200E4613F0C2F801 -:10EDC000044648B3067023F08BFF1428034617D976 -:10EDD0001E2817D9322817D94B2817D9642817D9D4 -:10EDE000962817D9FA288CBF0023012395F8F2033F -:10EDF0002146034463702846BDE8704013F078B89C -:10EE00000723F3E70623F1E70523EFE70423EDE704 -:10EE10000323EBE70223E9E770BD00002DE9F04191 -:10EE20008CB005468846144600211F2203A81F46C1 -:10EE30009DF860602AF071FF05238DF80A309DF877 -:10EE40006830ADF808508DF82B30BDF86C308DF877 -:10EE50000B608DF80C60ADF80E508DF810808DF8B9 -:10EE60001170ADF82C3064B1238CADF81830638C80 -:10EE7000ADF81A30A38CADF81C3094F82B308DF817 -:10EE80001E300DF11200DDE9122324F007FCDDE94C -:10EE900014230DF1250024F001FCDDE916230DF10A -:10EEA0001F0024F0FBFB02A822F092FE8EB90A4B51 -:10EEB0009B6A5B040DD52123ADF802309DF86430C8 -:10EEC0006846ADF80050ADF804508DF8063022F0D9 -:10EED0007FFE0CB0BDE8F08120500021044B1A6881 -:10EEE00000F56573043207CA83E80700704700BF66 -:10EEF000B03A00210A4BB0F806225B8B10B59B1A82 -:10EF000047F6FE729BB29342044602D9492112F0A1 -:10EF1000A7FA044A04F5687307CA83E8070010BD1E -:10EF2000283A0021383A00211FB5154B154A1B68B5 -:10EF30008DF80310C31ADB1053430022CDE90122E0 -:10EF4000ADF80C2007229BB2ADF800308DF80220FE -:10EF50008DF80410ADF8063059B9B0F8A433ADF807 -:10EF60000830B0F8A633ADF80A30B0F8A833ADF8E1 -:10EF70000C30684622F02CFE05B05DF804FB00BFA3 -:10EF8000B43A0021BDCAE28C034B1B68D3E90223CB -:10EF9000C0E9F223704700BFB03A002110B5044623 -:10EFA000082012F0CFFF014640B3B4F80432B4F8A1 -:10EFB0005E04DA1DB4F8063202FB0033A4F8D03345 -:10EFC00001230B70D4F8C83320464B70D4F8C833F3 -:10EFD0001B0A8B70B4F8CA33CB7094F8CB330B7127 -:10EFE000D4F8CC334B71B4F8D0338B71B4F8D03340 -:10EFF0001B0ACB71BDE8104012F07ABF10BD0000B3 -:10F0000030B404460D4B00F572750FCB85E80F0048 -:10F01000B4F80622B4F8D0339B1A47F6FE729BB2BE -:10F02000934203D8D4F8CC33034304D1204630BCF8 -:10F03000492112F015BA30BC704700BF383A0021A0 -:10F0400038B50546092012F07DFF0446B8B1AB780B -:10F050000B4A002B0CBF08230E2300F8013B094B81 -:10F06000D3E90A1323F48263DB040A40DB0C24F0A7 -:10F0700000FB21462846BDE8384012F039BF38BDB4 -:10F080002FCF87F72050002138B50546092012F010 -:10F0900059FF0446C0B1092300F8013B0B4BB5F8FA -:10F0A0003013D3E90A23120C1204114323F48263B0 -:10F0B000074ADB040A40DB0C24F0DBFA2146284631 -:10F0C000BDE8384012F014BF38BD00BF2050002109 -:10F0D0002FCF87F7F8B5044641F6EF30314F324A6B -:10F0E000D2E9043202EA000103EA0705C4E9CA5181 -:10F0F0002E4DD5E90A1632400126194039401040FC -:10F10000C4E9CC10C3F34021C3F3802384F8593001 -:10F11000A37884F8226384F8581033BB94F84533FD -:10F120001BBB100621D5A36859031ED5082024F067 -:10F1300011FC0146C8B11E4B1E4A1B68E31ADB10C6 -:10F140005343038046F6014343801B4B1B6893F8EF -:10F15000443006715A1FD2B2922A28BF9623837177 -:10F160004371164B187B24F006FCD4F8343304F2B8 -:10F1700004409A0711D5D4F8183423F07F4323F0C4 -:10F18000FF03B3F5803F08D1AB691B0405D5BDE88B -:10F19000F8404FF47A7124F0F6BDBDE8F84024F051 -:10F1A000F8BD00BF2FCF87F7283A0021205000215B -:10F1B000B43A0021BDCAE28CDC4D00216850002128 -:10F1C00090F81A2303464AB9012280F81A23044A08 -:10F1D00092E80300C3F81C03A3F82013704700BF94 -:10F1E000383A00211FB5114B114A1B68C31ADB10B6 -:10F1F00053430922ADF8022000229BB2ADF8003043 -:10F20000ADF8063090F81C338DF804208DF80830E6 -:10F21000B0F81E33ADF80A30B0F820336846ADF8C8 -:10F220000C3022F0D5FC05B05DF804FBB43A0021A7 -:10F23000BDCAE28C10B50446022012F083FE0146DE -:10F2400040B102230370237C43702046BDE8104088 -:10F2500012F04EBE10BD00001FB5027C0446FF2A0E -:10F260002AD0184B8DF80C201B68C31A1648DB10E7 -:10F27000434398B20623ADF8063000238DF80830DA -:10F28000D4F88833ADF80400DB0744BF16238DF8AB -:10F290000C300E4BADF80A001B687BB1984768B183 -:10F2A00001AB03CB1B88C4F83004A4F83834012325 -:10F2B000C4F8341484F82E3404B010BD01A822F030 -:10F2C00087FCF9E7B43A0021BDCAE28C783A002104 -:10F2D000034B1B7C0374012380F87F33704700BF0E -:10F2E000283A0021024B1B681B790374704700BF4A -:10F2F000B03A00213E230374704722230374704701 -:10F30000302303747047FF2303747047282303746A -:10F3100070471E23037470473D2303747047000039 -:10F3200030B5054D00F56B740FCD0FC495E80300A3 -:10F3300084E8030030BD00BF383A00212DE9FF41C9 -:10F340002C4D04462B8AADF804306B8AADF806309C -:10F35000AB8AADF80830EB8AADF80A300023ADF87F -:10F360000C30ADF80E308368DA0638D40DF104089D -:10F37000404611F0E3FC90BB04F56B7605F11007F5 -:10F380000FCF0FC697E80300A36886E803009B062B -:10F3900028D42B8AB4F894239A4205D8B4F896233B -:10F3A0009A4228BFA4F894336B8AB4F894239A4203 -:10F3B00005D8B4F896239A4228BFA4F89633AB8AAE -:10F3C000B4F89823934228BF1346B4F89A23A4F8BC -:10F3D0009833EB8A934238BF1346A4F89A3304B0AB -:10F3E000BDE8F08104F5657498E8070084E807003B -:10F3F000F5E700BF283A0021044B1A6800F5657351 -:10F40000043207CA83E80700704700BFB03A002102 -:10F41000B0F896330F21072B8CBF0823042300F587 -:10F420006572FFF745BC0000034B10211A680123E9 -:10F430000432FFF73DBC00BFB03A002170B5B0F810 -:10F44000B01388B0ADF80810B0F8B2132E4BADF879 -:10F450000A1000211D682D4B451BED105D43B0F8CF -:10F46000AC23B0F8AE3304469A42ADB2ADF80420F6 -:10F47000ADF80630ADF80C10ADF80E100AD090F8CB -:10F48000B4232AB91E21284620F068FF08B070BDB9 -:10F490009342F7D301A811F051FC0028F2D1B4F83F -:10F4A000AC33B4F80A22B4F8AE639342B4F8B003B4 -:10F4B000B4F8B2130BD19E4209D1B4F804228242AF -:10F4C00005D10A224A43B4F88242A24216D0102241 -:10F4D000ADF81A000DEB0200ADF81050ADF8122097 -:10F4E000ADF81450ADF81630ADF81860ADF81C103A -:10F4F00022F06EFB0028C9D11A21C4E7284601A9D1 -:10F5000020F0F6FEC2E700BFB43A0021BDCAE28C8B -:10F51000084B10B51B6800F246319A88DB88A0F8CA -:10F520004A23A0F84C33044612F0FBFBA4F85E0318 -:10F5300010BD00BFB03A00211421FFF7F1BB152127 -:10F54000FFF7EEBB1FB5134B134A1B688DF8031072 -:10F55000C31ADB10534312229BB2ADF80030ADF852 -:10F560000430B0F852338DF80220ADF80630B0F810 -:10F570005433ADF80830B0F84E33ADF80A30B0F877 -:10F5800050336846ADF80C3022F022FB05B05DF830 -:10F5900004FB00BFB43A0021BDCAE28C2DE9F84358 -:10F5A0003A4B0446998A1A296ED9188A1A286BD9B7 -:10F5B000DA8AB2F5A47F67D35B8AB3F5A47F63D3FD -:10F5C00094F82293B4F84E73B4F85053B4F852C37D -:10F5D000B4F85463B4F848E3B4F84C83B9F1000FBD -:10F5E00004D0D4F8309319F4006F07D140F64809DD -:10F5F000CE4528BFCE46C84528BFC846B4F84A9372 -:10F60000484528BF4846B4F84693A4F852034945F4 -:10F6100028BF4946434528BF4346724528BF724626 -:10F6200094F855E0A4F84E13BEF1030FA4F8543338 -:10F63000A4F8502306D1B2F5296F38BF4FF42962E0 -:10F64000A4F8502394F85420032A06D1B3F5296F67 -:10F6500038BF4FF42963A4F85433604509D1B94247 -:10F6600007D1B4F85433B34203D1B4F85033AB42AA -:10F6700003D000212046FFF765FF204604F24E31FB -:10F6800012F04FFBA4F86003BDE8F883283A00218C -:10F6900010B50446032012F055FC014658B1192359 -:10F6A00003700B4B1A68127942701B685B79837088 -:10F6B000204612F01DFCD4F88833204623F02003A6 -:10F6C000C4F888336E21BDE8104011F0C9BE00BFF8 -:10F6D000B03A0021094B1A7C5B7CD10748BF80F807 -:10F6E0006633910748BF80F8673352074FF06E01C9 -:10F6F00048BF80F8683311F0B3BE00BF283A00213C -:10F70000F8B504460B2012F01DFC0146E8B1054691 -:10F7100029230020134E05F8013B326802449379F7 -:10F7200057791B0143EA87031779D2793B430430A9 -:10F7300043EA8213242805F8013BEED133682046C2 -:10F7400093F828308B7212F0D3FBD4F8883320461C -:10F7500023F40073C4F888336E21BDE8F84011F03B -:10F760007FBE00BFB03A002138B5837804462BB184 -:10F770002046BDE838406E2111F072BE90F8453346 -:10F78000002BF5D026F038F9D4F8F01123F0BAFAAE -:10F79000D4F8F43198421ED323460F4904F12400D3 -:10F7A00011F8012B043302F0030583F8C55102F070 -:10F7B0000C0583F8C65102F0300522F03F0283F8B1 -:10F7C000C75183F8C8218342EAD1044B5B7E03F022 -:10F7D000030384F8ED3138BD383A0021283A00217E -:10F7E00038B58378044653B16E21D0F8883323F4BA -:10F7F0008073C0F88833BDE8384011F031BE042072 -:10F8000012F0A0FB144D014668B1282303702B6849 -:10F810001B7943702B685B7983702B689B79C3706D -:10F82000204612F065FB2B681A7984F845235B7932 -:10F830000A4A5343C4F8F43126F0DEF8D4F8F43120 -:10F840006E21C01AD4F88833C4F8F00123F4807311 -:10F850002046C4F88833CEE7B03A0021400D0300BB -:10F8600070470000024B1B681B7980F8F03370472B -:10F87000B03A002190F8F03323B1012B0CD01D21B8 -:10F88000FFF798BA084B90F9F22393F940309A4267 -:10F89000F5DA80F8F233F2E7034B90F9F22393F9AB -:10F8A00040309A42EBDDF4E7205000211E21FFF7A3 -:10F8B00081BA000010B50446054B187CA37884F883 -:10F8C0003803012B03D112F06DFFA4F8C80110BD5D -:10F8D000283A00211FB50D4B0D4A1B688DF8081002 -:10F8E000C31ADB1053432E229BB2ADF80430ADF89F -:10F8F0000A3090F8383301A8ADF806208DF80C30A6 -:10F9000022F066F905B05DF804FB00BFB43A0021AF -:10F91000BDCAE28C10B50446022012F013FB01466A -:10F9200048B107230370044B1B7A43702046BDE89F -:10F93000104012F0DDBA10BD283A002138B5044657 -:10F940000D4602BBD0F8302302F00403520704D561 -:10F9500090F82233003B18BF012394F85224012A67 -:10F9600008BF44258BB1032012F0ECFA0146A8B180 -:10F97000112303700A4B1B7A857043702046BDE843 -:10F98000384012F0B5BA0123E7E7022012F0DAFAA4 -:10F99000014618B10D2345700370EFE738BD00BF75 -:10F9A000283A002110B590F819330446FBB9012319 -:10F9B00080F81933062012F0C5FA0146E8B10C238D -:10F9C00003700E4B1A68127942701A68128882709E -:10F9D0001A681288120AC2701B685A8802715B8802 -:10F9E0001B0A43712046BDE8104012F081BA002284 -:10F9F000BDE810402421FFF7A1BF10BDDC4D002160 -:10FA000010B583780446012B0AD0BDE81040D0F829 -:10FA100088336E2123F48073C0F8883311F020BD41 -:10FA2000144A117C01290BD8537C042B08D9927CF1 -:10FA3000501FC0B2912803D8962B01D8934206D903 -:10FA40002046BDE8104001221E21FFF777BF0A487B -:10FA500084F8451343434243C4F8E831C4F8EC2129 -:10FA600019B125F0C9FFC4F8F00125F0C5FFC4F8AD -:10FA7000E40110BD283A0021400D0300C26803468E -:10FA800091000CD5D3F8882300F57870D20703D500 -:10FA9000B3F8821224F077B9282124F06BB97047AB -:10FAA000C3689B0003D500F5787024F072B97047E5 -:10FAB000702111F0D5BC012380F898327047000006 -:10FAC0000023F0B500F51977044685B080F8983228 -:10FAD000384624F0FFF878B9204612F036F9064689 -:10FAE00038460DF1070123F055FF054630B9094BA3 -:10FAF0000421187B23F0DAFF05B0F0BD294602A8E7 -:10FB000016F079FE2B463146204602AA12F052F931 -:10FB1000E6E700BF6850002110B5044600F51B70F1 -:10FB200024F0D8F828B12046BDE810403E2111F05D -:10FB300097BC10BD012380F897327047002380F8EE -:10FB400097327047024B1B6803B11847704700BFDC -:10FB5000AC3A0021024B1B6803B11847704700BF45 -:10FB6000983A0021024B1B6803B11847704700BF49 -:10FB70008C3A0021D0F88823110506D522F40062C2 -:10FB8000017CC0F88823FFF7CFB97047B0F89833ED -:10FB90002DE9F043A0F8A6330126B0F89A33B0F867 -:10FBA0009473A0F8A83340F2E243B0F89683B0F81B -:10FBB0006093044680F8A06390F8B40385B058437E -:10FBC0005F4303FB08F822F0ABFD114A03461568BA -:10FBD0001048651BED10684303AACDE90092394631 -:10FBE0004246C0B222F0F6FD30B97221204611F033 -:10FBF00037FC05B0BDE8F083039B074A84F8C86171 -:10FC0000A3FB0232DB0F43EA4203A4F8A433F0E77C -:10FC1000B43A0021BDCAE28CE3361A00143023F056 -:10FC200003BC00002DE9F04F87B004460E46904615 -:10FC30001F4611F01BF9054670B9092531462846C3 -:10FC400042463B4609F08BFB0221204613F006FC9E -:10FC5000284607B0BDE8F08F40F2E242DFF8F8B086 -:10FC6000DFF8F8C0DBF80000DFF8F4A0281AC010B5 -:10FC7000CDF808C00AFB00F00DF1140CCDF804C05B -:10FC8000A18BE38BB5F860C35343CDF800C04A4362 -:10FC9000C0B2002122F050FD20B9284611F0E6F94B -:10FCA0000D25CBE7059B2F49DBF80020A3FB013195 -:10FCB000DB0F43EA4103A4F8623000236370A370B2 -:10FCC000A4F800319DF84030AD1A84F86A309DF8F0 -:10FCD0004430ED1084F86B304FF495630AFB05F562 -:10FCE000A4F86050ADB203FB0525FF2385F8A034CE -:10FCF0004FF6FF730120A5F8A234C5E9C48785F843 -:10FD0000186304F11C0922F049FF42463B4649466C -:10FD10002046009613F026F9054618B1012022F07E -:10FD200053FF8BE742463B4649462046009613F078 -:10FD30009BFA05460028F1D194F86A3003F0FD03E0 -:10FD4000012B01D121F0C4FF074A1379013313714C -:10FD500021F0AEFF7CE700BFB43A0021C1170201D9 -:10FD6000BDCAE28CE3361A002050002110B50446CB -:10FD7000012022F029FF94F86A3003F0FD03012BE3 -:10FD800001D121F0ADFFD4F8D00120B123F0EAFD7C -:10FD90000023C4F8D031044A1379013B1371BDE844 -:10FDA000104021F08DBF00BF20500021F8B504465F -:10FDB000682023F0CFFD0546002858D04FF4956207 -:10FDC0000021B4F8603000F1080653433D4A04F1C5 -:10FDD000280712681A4491703B4ADB105343038092 -:10FDE00043F6017343800FCF0FC60FCF0FC697E8BE -:10FDF0000F0086E80F0094F86830012B42D1D4E957 -:10FE0000886394F82B2294F82A128A4205D1D4E907 -:10FE10008670834208BFBE4232D042F002078A4257 -:10FE200005D1D4E986129A4208BFB14247D0D4E93D -:10FE3000860185F83C70C5E91263D4E91623C5E94B -:10FE4000162394F86930C5E9140185F83D3094F81B -:10FE50006C30294685F83E30FF2385F860304FF638 -:10FE6000FF73A5F86230194B187B23F084FD204600 -:10FE7000FFF77CFF0123227C9340154A5372F8BDA3 -:10FE80001746CCE794F8C32394F8C213D4E9EE6381 -:10FE90008A4205D1D4E9EC70834208BFBE420CD03F -:10FEA00042F002078A4205D1D4E9EC129A4208BF17 -:10FEB000B14204D0D4E9EC01BBE71746F2E70020D9 -:10FEC0000021B6E7B43A0021BDCAE28C6850002197 -:10FED000303D00212DE9F74F4FF4856BB0F86EA34C -:10FEE000DFF8809206460BFB0A9B9BF82134002B1F -:10FEF00014BF2B20232012F025F80446002800F020 -:10FF00002E81B6F804829BF8213408F10708012BF2 -:10FF1000BBF8FC71DBF8F8511FFA88F810D1DBF858 -:10FF20002434987C43060BD0DBF8E43101372B44B2 -:10FF30009BF8F952BFB2454340F2E24000FB153551 -:10FF4000B6F806123046414489B211F04FFCB6F8BB -:10FF5000603383460344019322F0CEFE019B294681 -:10FF600003441846019322F0CDFE019B002800F0C7 -:10FF7000D2801846294622F0C5FE4FF4856303FB64 -:10FF80000A93D3F8E421B0FBF2F301339BB202FBF6 -:10FF900003501F44594622F0B5FE734BBFB298423E -:10FFA00000F2CA80714BA0FB0303C3F34F00002390 -:10FFB00019464FF4856505FB0A9595F821249B03A6 -:10FFC000002A14BF2A221C222270B6F86C2343EAAE -:10FFD00041336270B6F86C230343120A1B12E070BF -:10FFE0002371A270D5F8E421614BA2FB0321D20F4B -:10FFF00042EA41026271D5F8E421A2FB0323C3F374 -:020000040101F8 -:10000000D713A37195F8E811D5E9E43242EA411219 -:10001000190AE3712172190C1B0E6172E272A3724C -:100020006B6E23736B6E1B0A6373B5F86630A37334 -:1000300095F86730E373AB6E2374AB6E1B0A637481 -:10004000B5F86A30E7743F0AA3742775B6F806322C -:1000500043446375B6F8063298444FEA282884F87A -:100060001680B5F8FC31E375B5F8FC311B0A237630 -:1000700095F8DA3395F8D87347EA031711F066FB61 -:100080007FB247EA4017677695F8203404F11B00E9 -:10009000022B03D0032B14BF012304234FF48565E7 -:1000A00005FB0A95A376D5E9FA2323F0F7FAB6F80B -:1000B000063284F82130B6F806321B0A84F8223062 -:1000C00095F8213403B3D5F8F43284F82330D5F809 -:1000D000F4321B0A84F82430B5F8F63284F825305F -:1000E00095F8F73284F8263095F8F83284F82730FE -:1000F00095F8F93284F8283095F8FA3284F82930E6 -:1001000095F8FB3284F82A302146304603B0BDE82A -:10011000F04F11F0EDBE1946284622F0F3FD4FF4E2 -:10012000856303FB0A93D3F8E421B0FBF2F398B2A2 -:1001300002FB1050FF1A2DE7B0F5161F0D4A28BF1D -:10014000A0F51610A0FB02124FF0030101FB0020E6 -:100150002CBF012300230121C0F38F2029E703B026 -:10016000BDE8F08FD01D0021C3BF03001211111193 -:10017000E3361A009E36D0692DE9F84F064690F80E -:100180006E030AF04BFF90F8DD3B0546002B14BFD1 -:100190002B20232011F0D6FE0446002800F03481E5 -:1001A000B6F8048295F8DD3B08F10708012BB5F895 -:1001B00090A1D5F89C711FFA88F80ED195F8B73345 -:1001C00059060AD0D5F850030AF1010A3844D5F887 -:1001D000B0731FFA8AFA07FB1307B6F80612304607 -:1001E000414489B211F002FBB6F860B38146834402 -:1001F00022F082FD83443946584622F083FD0028D0 -:1002000000F0DF803946584622F07CFDD5F85023B7 -:10021000B0FBF2F301339BB202FB03700AEB03075E -:10022000494622F06FFD794BBFB2984200F2D78069 -:10023000774BA0FB0303C3F34F000023194695F847 -:10024000DD2B9B03002A14BF2A221C222270B6F841 -:100250006C2343EA41336270B6F86C230343120AFD -:100260001B122371A270E070D5F85023694BA2FBDA -:100270000321D20F42EA41026271D5F85023A2FB5A -:100280000323C3F3D713A371D5E9DA9A11F05EFA09 -:100290004FEA192384F8079023724AEA401A4FEA7A -:1002A00019434FEA1969637284F80A9084F80BA025 -:1002B000D5F8CC312373D5F8CC311B0A6373B5F86C -:1002C000CE31A37395F8CF31E373D5F8D0312374D1 -:1002D000D5F8D0311B0A6374B5F8D231E7743F0A00 -:1002E000A3742775B6F8063243446375B6F8063230 -:1002F00098444FEA282884F81680B5F89031E375C1 -:10030000B5F890311B0A237695F83930DA0702D513 -:100310002F79012F09D0022B74D16F693F0A07F0A2 -:10032000C007A7F140035F425F4195F9428011F099 -:100330000DFA400140EA071748EA0707677695F883 -:10034000D43104F11B00022B03D0032B14BF012373 -:100350000423A376D5E9042323F0A0F9B6F80632E6 -:1003600084F82130B6F806321B0A84F8223095F85A -:10037000DD3B03B3D5F8A83384F82330D5F8A83390 -:100380001B0A84F82430B5F8AA3384F8253095F890 -:10039000AB3384F8263095F8AC3384F8273095F8E1 -:1003A000AD3384F8283095F8B43384F8293095F8C3 -:1003B000B53384F82A3021463046BDE8F84F11F0B5 -:1003C00097BD3846594622F09DFCD5F85023B0FB26 -:1003D000F2F398B202FB1070AAEB030720E7B0F526 -:1003E000161F0D4A28BFA0F51610A0FB02124FF0F1 -:1003F000030101FB00202CBF012300230121C0F3D6 -:100400008F201CE7002790E7BDE8F88FC3BF0300EB -:1004100012111111E3361A009E36D069054B1B6884 -:100420009A8880F86A231A89DB88A0F86C23A0F8E0 -:100430006E337047B03A002190F869235AB901220F -:1004400080F86923D0F888236E2122F04002C0F89A -:10045000882311F005B8704770B5534C0546D4E9B0 -:100460000C2394F8291094F8280009F015FE0028B0 -:1004700040F0998095F87033002B00F08D804B4B45 -:100480009A6AD0054CBF03230123110594F82B2051 -:1004900048BF43F0040332EA03037DD1531E012B0E -:1004A00001D9042A78D194F840308BB10F2B73D83E -:1004B00094F8411005296FD994F84220531EDBB2FD -:1004C000FD2B69D8914267D994F84330012B63D949 -:1004D000402023F03FFA0146002857D04FF486739E -:1004E0004380238A821D8380314B03F1100053F82F -:1004F000046B834242F8046BF9D11B8813802D4BA7 -:100500002D4A1B68EB1ADB1053430B83A38C4B83E0 -:10051000B5F806328B83E38CCB8394F8283081F8CE -:10052000203094F8293081F8213094F82A3081F86D -:10053000223094F82B30022B03D0042B14BF01235C -:10054000032381F82330D4E90C23C1E90A23238F44 -:100550000B86E36B4B6394F8403081F8383094F8A5 -:10056000413081F8393094F8423081F83A3094F8CB -:10057000433081F83B30237AA3F12A02534253419E -:1005800081F832300D4B187B23F0F5F92846BDE891 -:1005900070406E2110F064BF237A2A2BF6D12846D2 -:1005A000FFF7B8F9F2E770BD283A0021205000218A -:1005B0003A3A0021B43A0021BDCAE28C68500021C9 -:1005C00090F80A3363B190F80933B0F80823012B8F -:1005D00014BF002300F20623A0F8A620C0F8A8301C -:1005E000002380F80A33012380F8A43070470023E9 -:1005F00080F8A430704790F80A3363B190F809335B -:10060000B0F80823012B14BF002300F20623A0F842 -:10061000A620C0F8A830002380F80A33012380F810 -:10062000A5307047002380F8A530704710B5044608 -:10063000114B03F1100203CA1A8BC4F8C102A4F8CB -:10064000CA22D3F81A20C4F8C512C4F8A922D3F8D4 -:100650001E20D3F8223004F2BD200421C4F8AD22BC -:10066000C4F8B93225F0E8F804F2B1200821BDE859 -:10067000104025F0E1B800BF283A0021064B00F2F7 -:1006800099201B681A1D143352F8041B9A4240F833 -:10069000041BF9D1704700BFB03A00210623037450 -:1006A0007047000070B5044600F18C0500F2A922E5 -:1006B000294600F2992025F003F8D4F8B932A2783F -:1006C000C4F89C30D4F8BD32B2FA82F2C4F8A0303B -:1006D00000230020002184F8B5300B4B52091B6821 -:1006E000C4E9B401C4E9B60184F8B42053B10749A0 -:1006F00028460968611A064CC9106143BDE870407C -:10070000C9B2184770BD00BF743A0021B43A002145 -:10071000BDCAE28C482110F0A3BE10B504460D20DE -:1007200011F010FC014698B10346042203F8012B96 -:10073000D4F8B122C0F80120D4F8B5225A60D4F818 -:10074000BD32C0F809302046BDE8104011F0D0BBE2 -:1007500010BD10B50446012011F0F4FB014630B184 -:10076000052303702046BDE8104011F0C1BB10BD49 -:1007700010B50446012011F0E5FB014630B1062317 -:1007800003702046BDE8104011F0B2BB10BD10B59B -:100790000446012011F0D6FB014630B10A23037054 -:1007A0002046BDE8104011F0A3BB10BD10B50446B3 -:1007B000012011F0C7FB014630B10B230370204626 -:1007C000BDE8104011F094BB10BD10B504460120E7 -:1007D00011F0B8FB014630B1122303702046BDE88A -:1007E000104011F085BB10BD10B50446012011F07A -:1007F000A9FB014630B1132303702046BDE8104029 -:1008000011F076BB10BD00001FB5104B104A1B68DD -:10081000C31ADB1053430D229BB2ADF80030ADF884 -:100820000430B0F8CA32ADF80220ADF80E30D0F87E -:10083000C132CDF80630D0F8C5326846CDF80A305E -:1008400021F0C6F905B05DF804FB00BFB43A002101 -:10085000BDCAE28C1FB5104B104A1B688DF80710FB -:10086000C31ADB1053430022CDF809208DF80D2068 -:100870000B229BB2ADF80430ADF80A3090F8A530E9 -:1008800001A88DF806208DF808108DF80C3021F0A5 -:100890009FF905B05DF804FBB43A0021BDCAE28CB3 -:1008A00007B50C22ADF802200022094B8DF8042078 -:1008B0001B68C31A0748DB10434368469BB2ADF878 -:1008C0000030ADF8063021F083F903B05DF804FB89 -:1008D000B43A0021BDCAE28C07B51122094BADF82C -:1008E00002201B68C31A0848DB10434368469BB2CA -:1008F000ADF80030ADF8043021F06AF903B05DF8CE -:1009000004FB00BFB43A0021BDCAE28CD0F8F41257 -:1009100000F53E7023F037BA38B5124B04461B6819 -:1009200000F2992103F10E0203F11E0052F8045B5C -:10093000824241F8045BF9D15A6804F2B920C4F844 -:10094000C1229A680421C4F8C5229B89A4F8CA323E -:1009500024F072FF04F2A9200821BDE8384024F0F9 -:100960006BBF00BFB03A0021034610B5054C04F13F -:10097000100203CAA269C3F8B102C3F8B512C3F8E2 -:10098000BD2210BD283A002110B50446172011F0F1 -:10099000D9FA014610B30346032203F8012BD4F819 -:1009A000C122C0F80120D4F8C5225A60B4F8CA3276 -:1009B0004372B4F8CA321B0A8372D4F8A932C0F861 -:1009C0000B30D4F8AD32C0F80F30D4F8B932C0F8DB -:1009D00013302046BDE8104011F08ABA10BD000067 -:1009E0002DE9F041464B86B01C6810F03FFA0546F1 -:1009F000A8B9D4E90623092094F8201008F0AFFC28 -:100A0000042022F0A7FF014630B140F203334380B7 -:100A10003C4B187B22F0AFFF06B0BDE8F08140F2FE -:100A2000E242DFF8E480394ED8F80000384F281A47 -:100A3000C010A188E3887843029605AE0196B5F808 -:100A40006063534300964A43C0B2002121F074FE14 -:100A500040B9284610F00AFBD4E906230D2094F88B -:100A60002010CBE7D8F800302A4EEB1ADB107B437E -:100A7000D4E904010127A6F88030274A059BDFF856 -:100A80009C80A3FB0232DB0F43EA4203A6F88230CC -:100A900006F13C0383E80300012022F07FF821F0F7 -:100AA00007F996F8423088F8047003F0FD03BB4262 -:100AB00001D121F00DF986F85872A6F85672D4E9E2 -:100AC000062394F82010201D12F024F90022284655 -:100AD000134911F039FCD4E90623C5E9C42394F87D -:100AE000203085F81833FF2385F8A0344FF6FF73C4 -:100AF000A5F8A23412F0ECF988F805708CE700BF75 -:100B0000540D002168500021B43A0021C1170201A0 -:100B1000BDCAE28CD03A0021E3361A0020500021F1 -:100B2000183B0021054B1B7933B10123044880F8A1 -:100B300099309C3022F04CBC704700BF20500021FF -:100B4000D03A0021F8B53C4B1B79002B70D06820BF -:100B500022F000FF0546002862D04FF49562002184 -:100B6000364C00F10806B4F8803004F148075343CE -:100B7000334A12681A449170324ADB10534303809F -:100B800043F6017343800FCF0FC60FCF0FC697E810 -:100B90000F0086E80F0094F8C33185F83C3094F8D4 -:100BA000C2219A4207D1D4E96E61D4E96C02914224 -:100BB00008BF864203D043F0020385F83C30D4E9F5 -:100BC0006E23C5E9122300220023C5E9142394F8FB -:100BD000C32194F8C2319A4207D1D4E96E02D4E914 -:100BE0006C139A4208BF884203D0D4E96C23C5E94C -:100BF0001423D4E91E23C5E9162394F88530294629 -:100C000085F83D30012385F83E30FF2385F86030BC -:100C10004FF6FF73A5F862300B4B187B22F0ABFE4A -:100C2000012021F0D1FFBDE8F8400448FBF7F4BDF6 -:100C3000BDE8F840FFF776BF20500021D03A0021F0 -:100C4000B43A0021BDCAE28C6850002113B54FF4BC -:100C50009560124C124BB4F880201B684D2100FBAC -:100C6000023010F0FDFB012021F0AEFF2046FBF723 -:100C7000D3FD00230093ADF80430082368468DF8B7 -:100C8000023020F0A5FFD4E95823D4F854110220F3 -:100C9000C1F3C00108F063FB02B010BDD03A0021DF -:100CA000B43A00214FF4956010B5094B094C1B680C -:100CB000B4F880204C2100FB023010F0D1FB012061 -:100CC00021F082FF2046BDE81040FBF7A5BD00BF24 -:100CD000B43A0021D03A0021044B0C201968D1E924 -:100CE000062391F8201008F03ABB00BF540D0021F4 -:100CF000002307B5ADF8003040F60843ADF80230E8 -:100D00000C236846ADF8043020F062FF03B05DF8B4 -:100D100004FB0123837090F800311BB900F5827049 -:100D200022F056BB00F52E70FAE70000F7B5064634 -:100D300000241A4D1A4FAB7A2341DA0713D56B7A88 -:100D40002341DB070FD44FF49562164B53F8243040 -:100D5000B3F8603053433A68D018D35C012B02D10A -:100D60004D2110F07DFB0134032CE4D13046FEF719 -:100D7000FDFF3378032B0FD000230093ADF8043030 -:100D8000082368468DF8023020F022FFD5E90023C1 -:100D90000220297A08F0E3FA03B0F0BD303D0021CB -:100DA000B43A0021D0AE0301044B0C201968D1E9FC -:100DB000062391F8201008F0D2BA00BF540D00218C -:100DC000002307B5ADF8003040F60843ADF8023017 -:100DD0000C236846ADF8043020F0FAFE03B05DF84D -:100DE00004FB0000074B1B681A7980F862235A79CC -:100DF00080F863239A7980F864231B8980F8573040 -:100E0000704700BFB03A0021024B1B8AA0F8D833CC -:100E1000704700BF283A002170B51D4C054694F973 -:100E20001030267C002B04DB94F91130627C002BFF -:100E300002DA4A21284602E0238A23B96E21BDE85E -:100E4000704010F00DBBB0F80612638A5B1A47F6CB -:100E5000FE719BB28B4201D94921F0E7022E04D9E1 -:100E6000042EE6D1022A02D804E0022A01D9042A7B -:100E7000DFD11EB108F0F8F80642DAD0667C1EB168 -:100E800008F0F2F80642D4D02069C5F8DA0370BD44 -:100E9000283A002170B580F8D81380F8D923044689 -:100EA00003200E46154611F04DF8014640B11623B9 -:100EB0004670037085702046BDE8704011F018B888 -:100EC00070BD70B5044603200E46154611F03AF881 -:100ED000014640B117234670037085702046BDE877 -:100EE000704011F005B870BD2DE9F04704460520AB -:100EF0000F46164611F026F80546002853D004F593 -:100F00001B7A504684F8DA7384F8DB6322F0D3FE50 -:100F1000DFF89890D9F80030B3F8268000FB08F885 -:100F2000204610F012FF0146404620F04CFE0628F5 -:100F300030D9504622F0BFFED9F80030B3F82680F1 -:100F400000FB08F8204610F000FF0146404620F064 -:100F50003AFEB4F8043257EA06021844B4F85E3494 -:100F600000FB03F39BB217D0B4F806221344A4F895 -:100F7000DC3318236F702B70AE70B4F8DC33294665 -:100F8000EB70B4F8DC3320461B0A2B71BDE8F04748 -:100F900010F0AEBF0720DCE76E212046A4F8DC236A -:100FA00010F05EFAE5E7BDE8F08700BFDC4D0021F8 -:100FB0001FB50F4B0F4A1B688DF80710C31ADB10C3 -:100FC000534300228DF8092016229BB2ADF804305D -:100FD000ADF80A30B0F8543001A88DF806208DF82D -:100FE0000810ADF80C3020F0F3FD05B05DF804FBFF -:100FF000B43A0021BDCAE28CF8B5446A0546B4F89B -:1010000098209AB1042022F0A5FC014600284ED079 -:10101000304B9C420CBF40F2023340F2033343801A -:101020002D4B187BBDE8F84022F0A5BC2B4E337C3D -:101030007BB194F84130D9070BD59B07327404D4A7 -:10104000D6E90823A01C22F029FBD6E90823C4E92D -:101050005623A36BE28FAB60A38F934213D040F271 -:1010600071235A43D4F8A811EB680B4493420AD277 -:10107000284622F09BF830B1A16BA86821F042FE0F -:10108000C4F8A80113E0002394F89B1194F8D10050 -:10109000C4F8A83108F054F9A68FE28F84F8D10083 -:1010A000964205D1284621F067FFAB68A363F8BDDF -:1010B00040F271277E4307FB0267AB683A46334430 -:1010C00031462846A36322F071F80028D4D1A36BDF -:1010D000AB60F2E7580D002168500021205000213C -:1010E0007FB5C46AD4F89C00002846D094F8F0304C -:1010F0000BB1062B45D194F8F40000283DD0D4E97B -:101100003823224822F0CAFA214D94F8F23085F8AB -:101110005332D4E93823C5E9242395F841309A079E -:1011200017D5D4E92223CDE9022302ABD4F8846099 -:1011300094F8F3000093D4E93A23FAF7B4FFF0B936 -:10114000C6F340061348DDE9022322F0A7FA85F82A -:1011500052621149A1F5147014F01AFB0F4BDB69B0 -:101160005B0110D595F8583213B1013B85F8583220 -:1011700095F85802B0FA80F0400904B070BD01261D -:10118000E0E70020F9E70120F7E700BF600D00214C -:10119000580D00215A0D0021A80F002120500021D8 -:1011A00070B5C46A94F8F030022B01D9062B53D1E4 -:1011B0002E4B2F4A1B68527A9B7B9A424CD294F852 -:1011C000CA0022F0C7FB0546002845D0D4F8983065 -:1011D00094F8CC2083F8272094F8F32094F8F23088 -:1011E0009A423AD1D4E93A31D4E93802914208BF5F -:1011F000834214BF01230023D4F898201D4E82F8A7 -:101200002830D4F89830D4F8D02083F82920D4F8A6 -:10121000D030D4F898201B0A82F82A30D4F89830BD -:10122000B4F8D22083F82B2094F8D320D4F8983047 -:1012300083F82C2094F8F510D4F8982079B1002187 -:101240000D4822F092FB4FF48071307B22F02EFC8F -:1012500008F0BEF9C4F8985070BD0123CCE70748E8 -:1012600022F083FB4FF40071EFE700BFDC4D00215B -:10127000F850002168500021800D0021880D0021C8 -:10128000C36AD3F8A000003818BF012070470000DF -:1012900070B54D4D00297DD0C46A94F8F030042B10 -:1012A00058D1D5E92402D4E938139A4208BF8842BC -:1012B00050D1464B464A1B68527A9B7B9A4249D290 -:1012C0002D2022F047FB0646002843D0D4F8A0305A -:1012D00094F8CC2083F827200023D4E93A1294F81C -:1012E000F2009A4208BF814207D0D4E938309042D8 -:1012F00008BF8B4214BF01230023D4F8A020002193 -:1013000082F82830D4F89830D4F8D020314883F8C7 -:101310002920D4F8D030D4F898201B0A82F82A303B -:10132000D4F89830B4F8D22083F82B20D4F8983031 -:1013300094F8D32083F82C20D4F8A02022F015FBB9 -:10134000254B4FF48071187B22F0B0FB08F040F978 -:10135000C4F8A06095F859320133DBB2012B85F84F -:10136000593209D9B5F856325B0808BF0123A5F8F0 -:101370005632002385F85932002385F85A3220F07E -:10138000F4FBB5F85632013B03400133002085F8E9 -:10139000583270BD95F85A320133DBB2012B85F813 -:1013A0005A320DD9B5F856325B009BB2B3F5807F47 -:1013B00088BF4FF48073A5F85632002385F85A325F -:1013C000002385F85932DAE7580D0021DC4D002161 -:1013D000F8500021800D002168500021C37CF0B539 -:1013E0001370847C9C4207D1D0E90275D0E9006477 -:1013F000A54208BFB74202D043F002031370D0E900 -:101400000223C1E90023F0BD90F86A3010B5013322 -:10141000DBB2012B044680F86A300DD9B0F8663093 -:101420005B009BB2B3F5807F88BF4FF48073A0F858 -:101430006630002380F86A30002384F8693020F099 -:1014400094FBB4F86630013B0340013384F8683004 -:1014500010BD00002DE9F84F044690F80EA4D0F816 -:1014600010344C4FDFF83081DFF83091BAF1000FC3 -:1014700001D1BDE8F88F1D465A7815F8026B2C2A69 -:101480001BD0322A7BD0282A11D194F8203284F83C -:10149000226284F8212253B96378012B07D12946AF -:1014A00084F8203204F5087014F0A0F80544F643DF -:1014B00056442B465FFA86FAD8E794F88832002B18 -:1014C000F5D16378012BF2D13246294604F522701A -:1014D00014F0A8F8BB690544180294F8963248BF86 -:1014E000022203F1FF3358BF04221E2B43D8D4F845 -:1014F000B032A3F5807343453DD8B4F8943293429B -:1015000039D3B3F5486F36D894F89732013B1E2B88 -:1015100031D8B4F8B432B3F5805F2CD2B4F8AA3223 -:10152000013B9BB2FA2B26D894F8C032032B22D869 -:10153000D9F82020D10501D4022B1CD0120501D4EA -:10154000032B18D094F8D032012B14D894F8983289 -:10155000013B062B0FD894F8A832013B0E2B0AD87A -:1015600094F8A0320F2B06D842F6014384F88A6221 -:10157000A4F888329BE7002384F8883297E7084B69 -:10158000D3F800B0BBF1000F91D02B463146204676 -:10159000D8478CE720500021FFFE0F006850002143 -:1015A000D8070021F8B583780446002B0CBF1E2312 -:1015B0004FF4967385880F465D43164621F090FBE5 -:1015C0006378012BA3780CBF32214FF4FA71002B02 -:1015D0000CBF1E234FF496730144581907F084FC86 -:1015E0002D1A3D60A378002B0CBF1E234FF4967379 -:1015F00003EB40003060F8BD2DE9F0414368057C05 -:101600000446022DC0F80C31D0F8307118BF002507 -:1016100000F5827621F070FBE37800F2CC4007F110 -:101620009808C4F81001DBB90323294A1178013561 -:10163000EDB2032D08BF002541FA05F0C0071FD504 -:10164000244B557053F82540D4F8307104F5827658 -:1016500007F1980898F83310787807F071FE7870E1 -:10166000002120896389C8F8401083420DD130469B -:1016700021F082FCB36863600023E370BDE8F08171 -:10168000013B13F0FF03D2D1E4E7114FBA782A41AE -:10169000D3070AD4304621F06FFCB368636001239E -:1016A000AB40BD781D43BD70E6E740F27122B368E0 -:1016B00002FB00334FF00042B3603046636021F01C -:1016C00075FDB36862689B1AC8F84030D4E700BF64 -:1016D000B80F00218CAE0301084BDB695B010BD511 -:1016E00090F8683013B1013B80F8683090F86800DA -:1016F000B0FA80F040097047012070472050002167 -:101700002DE9F3411E46DDE908451B0A03F0C0033D -:10171000402B0746904626D1DDE90A23CDE9002378 -:101720009DF830204046314602F0FD02FAF756FDA2 -:1017300090B17B7B03F0FD03012B07D103232B70BA -:101740000B4BD3E90823C4E9002309E002232B70E3 -:10175000084BD3E90C23F6E7FE232B70C4E900867F -:1017600002B0BDE8F081437B012BE8D00023EEE717 -:1017700020500021685000212DE9F04F0D4690F8CF -:101780003C108DB08346DDE9166792469DF8609067 -:101790001B9C21B1002108460DB0BDE8F08F24222A -:1017A0002046079128F0B9FA9DF96430A58063744A -:1017B000FF23E3737F232374724B0799DB6A03F4DF -:1017C00000789BF81030002B65D0022B66D09AF879 -:1017D0000030DA1F012A73D89BF8A230DB0768D5E6 -:1017E00032463B4684F80690E01D079121F056FFF3 -:1017F0000799DBF89C30A08823620023A3839BF821 -:10180000A1309BF8A22003F003030343500000F033 -:1018100004000343A3809BF8DC30B8F1000F01D033 -:101820009BF8A213012B47D0022B47D101290CBFF3 -:1018300004230323A373150744BF9BF8BC30E37351 -:10184000500644BF9BF8BD302374910644BFBBF8DB -:10185000E4306382930702D49BF86934CBB10DF175 -:10186000270301930AAB58460093CDE90267DBE9F1 -:101870002C23CDF81090FFF743FFDDE90A2304F194 -:10188000150021F00BFF9DF82730237500238BF8FE -:10189000693401217FE70123637398E7B8F1000FF2 -:1018A00003D09BF80532012B01D00323F4E7042376 -:1018B000F2E7FF23A3719CE70223BBE70123B9E70B -:1018C0009AF804A0AAF1060A5FFA8AFABAF11F0F81 -:1018D0003FF660AF1A9A02F1080845F01002A280A4 -:1018E000062B3FF658AF01A252F823F00919010167 -:1018F000111901014F190101971701016D1901011A -:10190000971701016719010145F01305A5801EE035 -:1019100045F015054046A58021F0BAFE4FF0000ABB -:101920000B460DF1270101910AA902460091584684 -:10193000CDE90267CDF81090FFF7E2FEDDE90A235A -:1019400004F1150021F0AAFE9DF8273023753246D8 -:101950003B4684F80690E01D21F0A0FEC4F82080EC -:10196000A4F81CA095E745F01205CFE7064B45F01B -:1019700012051B78002B08BF45F0010545F008054E -:10198000C4E700BF20500021880700212DE9F04165 -:1019900005780646012D0C46174686B01CD1C81D99 -:1019A00091F8068021F074FE0B46B6F8BA10024694 -:1019B0000291E17B04A8019121790091414607F051 -:1019C0000CFDDDE90423054807F021FD20B93D7039 -:1019D000284606B0BDE8F0810025F9E7581400213B -:1019E000F0B513780646012B0C46154687B023D177 -:1019F0008B885B0615D4C81D8F7921F049FE0B46F4 -:101A0000B6F8BA1002460291E17B04A8019121794F -:101A10000091394607F0E1FCDDE90423074807F0AF -:101A200053FD02234FF480712B70054B187B07B0D8 -:101A3000BDE8F04022F03AB807B0F0BD58140021DC -:101A40006850002190F82430012B05D090F8213403 -:101A50005BB1437EFF2B08D1022380F82430034B77 -:101A60004FF48071187B22F021B870476850002134 -:101A700090F8693010B50133DBB2012B044680F8D1 -:101A8000693009D9B0F866305B0808BF0123A0F8B7 -:101A90006630002380F86930002384F86A3020F033 -:101AA00064F8B4F86630013B0340013384F86830D1 -:101AB00010BDF8B5446A054694F868641746012ECF -:101AC00002D000263046F8BD002384F86834D4E9FB -:101AD000B003184421F016F9B842F2D2EB6A04F5CB -:101AE0002E70C3F8B80004F53A71F8F7B7F9E9E7D2 -:101AF0002DE9F0474FF0000892B0446AC66A0746E5 -:101B000008A8894613F0D0FE9DF82030BF4D072B62 -:101B100085F8018004F1A00040F03F8184F8A280A4 -:101B200009F102020DF11E0113F0ACFC94F8A13092 -:101B300073BB9DF81E10CB0601F0010000F1BC80C4 -:101B400020B901236B7012B0BDE8F0879DF82030FA -:101B5000F96A8DF8403094F8A23080318DF8413028 -:101B6000D4E92A23CDE90C239DF822300CA88DF866 -:101B70004230D4E92C23CDE90E239DF823300122F5 -:101B80008DF8433006F1E003F9F7AEFF0028D8D016 -:101B90000123DFF87CA29F4D8AF800302B78012BBF -:101BA00059D19DF81E3003F00903092B53D10022AF -:101BB0000023CDE90A239DF8203006F1E0088DF8D6 -:101BC000403094F8A2308DF81F208DF841309DF8F8 -:101BD0002230D4E92A018DF84230CDE90C01D4E954 -:101BE0002C019DF82330CDE90E01F96A8DF84330C0 -:101BF000803143460CA8F9F777FF40460DF11F02EC -:101C00000AA9FFF7EBFB2B7A012B94F8BC307AD1B1 -:101C10009DF81F00009300F00100DDE90A23FAF7A8 -:101C200083F800288FD00023296A8AF80030DDE984 -:101C30000A23C1E9F8239DF81F3081F8D93394F8BD -:101C4000BC3081F8D833D4E92A23C1E9FA239DF8BE -:101C5000223081F8DA339DF81E8018F0100868D021 -:101C60000023FB6004F1D6073846D4F8C41013F003 -:101C700063FC96F8F12096F8CD100232707BD6F80E -:101C8000D48020F088FA394608EB0003D6F8D42037 -:101C9000204608F065F894F80031002B40F0B2803F -:101CA0002B78012B7FF44FAF9AF80020002A7FF4A5 -:101CB0004AAF8AF8003046E7C8B1012385F82830DA -:101CC000D4E92A23C5E906239DF8223085F8293076 -:101CD00011F0020111D0012385F82A30D4E92C2318 -:101CE000C5E908239DF8233085F82B3050E7002202 -:101CF00000232885C5E90623EAE700220023698539 -:101D0000C5E9082344E76A7A9A427FF41CAF9DF83C -:101D10001F30AA7A03F001039A427FF414AFD5E989 -:101D20000402DDE90A139A4208BF88427FF40BAF30 -:101D300079E7002300220CA9CDE90C2306F1E0008D -:101D40000AAA04F118058DF82880FFF747FBCDE9B2 -:101D5000049596F9CC30414603939DF828302046EF -:101D60000293DDE90C23CDE9002308AAFFF704FD67 -:101D700000283FF4E8AE04F13C06324629462046EE -:101D800084F82680FFF702FE00283FF4DCAE3246DE -:101D900029462046FFF724FED5E6002300224146CF -:101DA000CDE90C2330228DF8288004F1180727F0A4 -:101DB000B4FF0AAA0CA906F1E000FFF70FFBCDE97A -:101DC000049796F9CC30414603939DF8283020467D -:101DD0000293DDE90C23CDE9002308AAFFF7CCFC30 -:101DE00000283FF4B0AE04F13C052A4639462046AF -:101DF00084F82680FFF7CAFD00283FF4A4AE2A46E7 -:101E00003946C6E720F046FF9DE600BF880700215F -:101E1000B8070021C03600212DE9F041814C456A08 -:101E2000C66A88B0074604F10C00884613F03CFDF2 -:101E300004F10A0108EB000205F1A00013F022FBF7 -:101E40000123227BE072072A63727FD195F8A120DB -:101E500095F8A210002A5BD194F828205AB9A27AEA -:101E6000D20708D584F82830D5E92A23C4E9062307 -:101E7000A37B84F8293094F82A3063B9A37A9B07AE -:101E800009D5012384F82A30D5E92C23C4E9082395 -:101E9000E37B84F82B3094F82830012BD4E9062317 -:101EA000C5E92A2394F8293008BF41F00101A37342 -:101EB00094F82A3008BF85F8A210012B02BF95F8CC -:101EC000A23043F0020385F8A230D4E90823C5E923 -:101ED0002C2394F82B30E37307238DF8183095F8F2 -:101EE000A230F96A8DF81930D5E92A23CDE9022309 -:101EF000D5E92C23CDE90423E3890022ADF81A307B -:101F0000803106F1C80302A8F9F7EEFD50B10BE0ED -:101F1000A37A21F0340123F03402D807A27285F8A5 -:101F2000A210D9D4012363706378012B01D100275B -:101F30005FE095F8A17017F0020749D0D6F89870C5 -:101F4000002F45D096F8DC3013B901236370EEE71B -:101F500095F8A230D907F8D52846FFF7BDFB012830 -:101F6000074635D1D6E9322305F1800021F096FBF2 -:101F700096F8DA3085F8D330D6E93223C5E91C2348 -:101F80006B7B9A071ED595F8A2309B0735D5D5E90E -:101F90002C23CDE902231B0A03F0C003402B94F845 -:101FA0000F8007D102AB96F8DB000093D6E934230B -:101FB000FAF788F8DDE9022305F17A0021F06EFBDB -:101FC00085F8D28005F1D00105F1780013F0E0FB2F -:101FD00095F8A13084F82C300023E38595F8A230E1 -:101FE0005B0003F00403A5F8443096F9B93085F896 -:101FF0005130384608B0BDE8F081D6E92223D6F842 -:102000008480CDE9022302AB96F8DB000093D6E989 -:102010003423FAF748F810B9C8F34008CAE7B846BD -:10202000C8E700BF880700212DE9F0478F4F86B031 -:102030003B7B072B40F0138100220023CDE90423D2 -:102040000023C66A8A4D446A0DF10F0204A906F105 -:10205000C8008DF80F30FFF7C1F995F80090B9F17D -:10206000010F00F08A804FF0000994F8A2309A0620 -:1020700005D5D4F8C81004F1E00013F073FA95F810 -:102080000080B8F1010F40F0C380DFF8E8A19AF8B2 -:102090000030002B40F0BC8094F8A2309B0640F149 -:1020A000B7806B78002B40F0B3802D6A04F1A00E4E -:1020B00005F57C7CBEE80F00ACE80F00BEE80F0021 -:1020C000ACE80F009EE80F008CE80F002846FFF7F1 -:1020D000C1F940F2E242B4F8FC30A5F8E031A5F8CD -:1020E000FE31B4F8E4305343C5F8E43194F8F020FD -:1020F00085F8E82194F8DC20012A00F08C80022A7F -:1021000008BF4FF00308B5F86823B9F1010F02FBCF -:1021100003F385F82084C5F8EC3112D1DDE90423FE -:10212000C5E9F8239DF80F3085F8D93394F8BC3011 -:1021300085F8D833D4E92A23C5E9FA23BB7B85F88F -:10214000DA3396F8B02096F8BA10707BD6F8C070E3 -:1021500020F021F895F821343844002B5ED100900E -:10216000D6F8C030204604F1E00204F1D60108F0B0 -:102170003FF800238AF801304AE0DFF8F88098F849 -:102180000030002B6ED16A7A94F8BC309A420FD19D -:102190009DF80F30AA7A03F001039A4208D1D5E9DD -:1021A0000402DDE904139A4208BF88423FF45BAFA2 -:1021B000012388F80030BB7A19077FF554AF13F07C -:1021C000210F3FF450AF2A7A94F8BC30012A0DD188 -:1021D0009DF80F00009300F00100DDE90423F9F7FA -:1021E000A3FDA8B1002388F800303EE76A7A9A423E -:1021F0000ED19DF80F30AA7A03F001039A4207D15D -:10220000D5E90402DDE904139A4208BF8842E9D007 -:1022100006B0BDE8F0874FF0020874E70022164BC5 -:102220001B68EB64154B1B682B65154B1B68C5F8C9 -:102230000831D5F824341A61124B1F6847B1009059 -:10224000D6F8C030204604F1E00204F1D601B847C8 -:102250000D4B1B68002B8CD02846984789E701233B -:102260007B70D5E7012B7FF4FEAEA4E78807002141 -:10227000C0360021B8070021CC070021C407002187 -:10228000C0070021C8070021D00700212DE9F04137 -:1022900006460F46446A86B031B92046FFF7B4F8C7 -:1022A000002006B0BDE8F081344DD0F82C802046E7 -:1022B000FFF7DEFB394605F10C0013F0F5FA05F1E6 -:1022C0000A013A1804F1A00013F0DCF8012194F897 -:1022D0006934E8726972FBB994F8A1305BB194F883 -:1022E000A230AA7A23F0260322F02602AA7284F8EA -:1022F000A23084F8691494F8A23003F00702072A88 -:102300000AD123F0260384F8A2300123AA7A84F8A4 -:10231000693422F02602AA722B7BF16A8DF8103004 -:1023200094F8A23068468DF81130D4E92A23CDE91B -:102330000023D4E92C23CDE90223EB890022ADF858 -:102340001230803108F1C803F9F7CEFB10B9012330 -:102350006B70A5E794F8A1309B07F8D1D4E91C0273 -:10236000D8E932139A4208BF8842F0D1B4F8443019 -:1023700003F0170343F00803EB8591E7880700217A -:10238000F0B5374C0D4694F801C085B0BCF1000F94 -:1023900002D0002005B0F0BD0029FAD0637AC76AE8 -:1023A000012B466A3FD1E27A237C0232154496F82B -:1023B000A020013B9B1A6560237284F809C0237B2F -:1023C000072BE6D1002396F869240193A37A002A0B -:1023D0003ED196F8A12042B123F03403A37296F8BF -:1023E000A23023F0340386F8A230A37ADA0618D597 -:1023F000D6F8C41002A813F09FF89DF80E30022BF7 -:10240000C7D806F031FE9DF80E301841C307C0D57D -:102410009DF8083007F1B4027B7001A902A8FFF70C -:10242000C1F80198B6E704F10C0013F03DFA054439 -:102430002A4604F10A0106F1A00013F023F8237CD8 -:1024400096F8A020013B05449B1A65602372B6E70D -:1024500023F02603A37296F8A23023F02603C2E7E6 -:10246000880700212DE9F043554E8BB07578002D7B -:1024700040F0A380446A94F83C7061B9012F04D104 -:10248000A38B43F04003A38339E084F864502846CB -:102490000BB0BDE8F083022FF9D0D0F82C80002FCC -:1024A00069D196F82C30002284F8A130002308A9C5 -:1024B000CDE9082308F1C8000DF11F028DF81F7047 -:1024C000FEF78CFF94F8A1309A0736D504F1400945 -:1024D000B4F84410CDE9047994F9513020460393BF -:1024E0009DF81F300293DDE90823CDE9002306F1B2 -:1024F0000C02FFF741F950B984F86400002520462A -:1025000004F13C0204F11801FFF76AFABFE7B4F8DE -:10251000443004F1640723F008033A464946204654 -:10252000A4F84430A4F85C502566FFF72FFA20B1D8 -:102530003A4649462046FFF753FA002304F11807AC -:102540000597049398F9B930204603939DF81F30FE -:10255000F18D0293DDE90823CDE90023194AFFF745 -:102560000BF90028CAD03946204604F13C02FFF797 -:102570000DFA0028C2D0144BA08E1B68327A1B8C37 -:1025800017461B1A9BB29342FFF47AAFD4F89C30E3 -:102590007168184498F9B95027F098FBA38E84F815 -:1025A00029501F4494F8BD30012584F82830B37AAF -:1025B000A786DB063FF56BAFA1E7002567E700BF05 -:1025C0008807002194070021DC4D00217FB5C46AF3 -:1025D000D4F89C30002B41D094F8F0300BB1062B8E -:1025E0003CD194F8F430002B38D0D4E93823456A34 -:1025F00005F1800021F052F894F8F23085F8D330DC -:10260000D4E93823C5E91C236B7B9B0718D5D4E993 -:102610002223CDE9022302ABD4F8846094F8F300BE -:102620000093D4E93A23F9F73EFDA8B9C6F3400672 -:1026300005F17A00DDE9022321F030F885F8D26057 -:1026400005F1D00105F1780013F0A2F8284604B096 -:10265000BDE87040FFF740B80126E9E7002004B06C -:1026600070BD000037B5044668460D4613F01CF9EE -:102670009DF80030054A072B137005D029462046E7 -:10268000FFF7A4FF03B030BD0020FBE7880700215F -:10269000FEF7F6BD2DE9F0410E46446A8CB00029E4 -:1026A00048D0C56A08A813F0FFF895F8F030042B5D -:1026B00039D1D4E91C02D5E938139A4208BF8842BF -:1026C00031D1002300224FF00008CDE90A230AA9E6 -:1026D0000DF11F0205F1E00004F118078DF81F80CD -:1026E000FEF77CFECDE9046795F9CC3041460393B3 -:1026F0009DF81F3020460293DDE90A23CDE900232F -:1027000008AAFFF739F870B104F13C052A463946AA -:10271000204684F82680FFF739F920B12A46394649 -:102720002046FFF75DF92046FFF7A2F900200CB024 -:10273000BDE8F0812046FEF767FEF7E730B4406A57 -:102740000368027C23F07F43022A23F0FF0318BFB3 -:10275000002290F80041BBB190F801310133DBB2A7 -:1027600080F801311CB1012B03D830BC7047002B1D -:10277000FBD001230C4993400A7822EA03020A7035 -:1027800030BC032107F034BC0121074D9140AA78E9 -:1027900080F8003222EA0102AA70C0F8F031002C61 -:1027A000E3D130BCFEF728BFB80F00210122436AF5 -:1027B000DA70FFF7C3BF000010B4406A0123027C47 -:1027C0000D49022A18BF00229340DB4302685BB226 -:1027D00022F07F4222F0FF0232B10A7813400B70E0 -:1027E00010BC032107F004BC8C7880F80021234042 -:1027F0008B7010BCFEF700BFB80F00212DE9F04F21 -:10280000446A8046E37885B043B100230521204621 -:10281000E37005B0BDE8F04F07F004BCA2785AB1F0 -:1028200020460321A37007F011FC04F5727005B077 -:10283000BDE8F04F21F0ADBA63799BB9237AB4F8C3 -:10284000FE11002B14BF07220622062A0CBF052208 -:102850000622B4F8E0315B1A934203D103212046EB -:1028600007F0E0FB0022564B22725978002940F015 -:1028700081800125B4F8FC31B4F8E061514FF61ABB -:10288000E71B514BFF105F43504BB6B293F87A30C1 -:10289000B3B1D4F8E40100FB06F994F8E8010FF0B5 -:1028A00081FF0146484606F01FFBD8F80830B4F80F -:1028B000E011009382B2D4F8E431F8B21FF0B5FB16 -:1028C000DFF80C91BFB2B4F8E0314FF0000AADF878 -:1028D00008306823ADF80A50ADF80E7004F5087B97 -:1028E00003FB0AF21BF802202AB102A88DF80CA003 -:1028F000FAF780FB68230AF1010ABAF1030FEFD15E -:10290000B4F8E031D4F8E4012E442B44B6B2A4F874 -:10291000E03100FB06FA94F8E8010FF043FF0146AE -:10292000504606F0E1FAD4F8E421D4F8F831B4F8CE -:10293000E01102FB06331B1AC8F80830D4F8F03156 -:10294000C8F814200344C8F80C30D4F8F43103EB71 -:102950004000C4F8000104F5647008F073FC4946B7 -:1029600084F86100404620F05BFB0028ABD005B046 -:10297000BDE8F08F5868B4F8E011C4F8F801A4F885 -:10298000FC1104F57270D4F86C135A7021F0FBF945 -:10299000D4F8EC31002B3FF46CAF4FF47A72D4F8DA -:1029A0006C535543AB4202D2B4F8685362E7D4F893 -:1029B000E431002B3FF45DAFB5FBF3F5ADB259E761 -:1029C000B8070021D01D00214DF833E1405100210E -:1029D000D99601010122436A1A72FFF70FBF000066 -:1029E0002DE9F04F446AC66A94F8213481460F46B7 -:1029F000904687B084F82C201BB1D4F82434727B25 -:102A00005A75002F00F0C9814FF0000A3B78914DB4 -:102A100097F801B003F00F03BA1C86F8BCA005F1CB -:102A20000A0104F57C700193009212F02BFD009ACC -:102A3000019B02446A6094F8F0230BF1FF3BABEB7F -:102A4000020B052B85F808B000F01281072B2AD164 -:102A500094F82134012B0CD186F8CA30D4F82434F0 -:102A6000B4F8E0211A829A7CDA74D9F82C205278D2 -:102A70001A756379784F93BB0123784A3B70137EB4 -:102A8000B3B194F8F21348070FD594F809140B4129 -:102A900013F0010F0CD0136A01220221204683F8A3 -:102AA0005B2307F0BFFA0020CDE013F0100FF1E731 -:102AB0004FF001090421204684F8059007F0B2FA8E -:102AC0004946204607F0C2FA654B1B784B4501BFCB -:102AD000D4F8E431B4F868235343C4F8EC3194F8E3 -:102AE0002134002B51D06379002B4ED00121D4F832 -:102AF00024044FF00009D0E9003C827C914001EAB7 -:102B0000030E0CEAE1725EEA020200F09F806FEAB7 -:102B1000010E90F86D2023EA01030CEAEE71C0E982 -:102B20000031A0F8582000F17001A0F86290C06D4B -:102B300027F0CCF8D4F824044A4B00F1160100F138 -:102B40005802D3F800A0C6F8B0104B46B0F86E019A -:102B5000D04740F2E241D4F82434A6F8AC00DA6D54 -:102B6000C6F8B820B3F86220A6F8B4209A7C1344C3 -:102B700093F8703194F8FB225A4394F8FA324B439D -:102B80007D2101FB0233C6F8A4307B7853B996F857 -:102B9000C830012B06D1B8F1000F03D1D6F8C420FC -:102BA0007B707A602046FEF755FC94F88832012B42 -:102BB00020D194F89212D6F8C43000290CBF1E21FF -:102BC0004FF49671B4F89022702001FB0233C4F8E0 -:102BD0008C3220F0BFFE074660B1234B04F5227112 -:102BE00040F8083B682227F071F8204B3946187BE3 -:102BF00020F0C1FEE379AA7A93B1110710D594F8B9 -:102C00002134B4F80A1423B1D4F824349B7C03F0A3 -:102C10007F0303F5807334F813308B423FF443AFE6 -:102C200000230393D3060DD5D4F8141404A812F08E -:102C300083FC9DF8103006F1A002737003A904A86C -:102C4000FEF7B0FC039807B0BDE8F08FC6F8A4907B -:102C50009BE700BF88070021B8070021C03600218C -:102C6000E8360021D407002100001103685000213C -:102C700086F8CAA094F82134002B3FF414AF4FF02B -:102C80000109D4F82424937CD2E9021209FA03F34F -:102C9000194002EAE3730B433FF405AF682020F0CC -:102CA00059FE054600283FF4FEAE3D4B3946A4EBE5 -:102CB00003083C4B4FEAE80803FB08F81FFA88F8C2 -:102CC000A0F8008080F802A004A812F0EDFD3918E9 -:102CD000354F05F1080012F010FED5E904C1D7E91F -:102CE0000C23994208BF944553D1D5E902239DF89E -:102CF00012004FF0000A43EA004E003818BF0120CE -:102D00004FF0000BC4F80024C4F804E49DF813E06D -:102D100041EA0E41C4E9FEC1C5E914ABC5E912237D -:102D200085F83C000EF0E6FE824690BBD4F82434D1 -:102D300024225B7D85F83E3096F8BF10707BD6F874 -:102D4000C4B01FF028FA194B5844D3E90423C5E94D -:102D500016234FF48073A5F84030FF232946A8635B -:102D600085F86030387B85F83D9085F83FA0A5F860 -:102D7000628020F000FE86F8BC90D4F824145246FD -:102D800016315046C6F8B01013F0AEFBA6F8AC00F2 -:102D900089E6284620F0E6FD85E6384653E700BF81 -:102DA000D01D00214DF833E168500021F85000217A -:102DB0002DE9F347446A074694F8216401256EB172 -:102DC000D4F824349A7C9540D3E902232A4003EABC -:102DD000E57552EA050314BF01250025002900F01E -:102DE00094806846FE6A12F05FFD9DF80030072B64 -:102DF00023D16378012B1ED1D4F86C1304F57270C3 -:102E000020F0C1FFE379B3B1564B9B7A1A0712D574 -:102E100094F82134B4F80A2423B1D4F824349B7CE8 -:102E200003F07F0304EB4303B3F80012914204D094 -:102E30000DB1A3F80022637923B90025284602B01A -:102E4000BDE8F087002DF8D094F82450022DF4D07E -:102E5000DFF8108195BB1422294604F1100098F880 -:102E60000A90D7F82CA07F6A26F057FF3E4B3F4AC6 -:102E7000FB1ADB10534319F0400FA3821CBF97F8D5 -:102E80000D34A3759AF8BE3019F0040FE3750CBF2A -:102E9000FF2397F809342376BB6AE361B7F8E03182 -:102EA000238497F82134DBB1D7F824349B7C84F851 -:102EB00022306378012B0FD184F824302C4B608BA7 -:102EC0001B6898F808201B8C15461B1A9BB293426E -:102ED00008D20223002563762046FEF7B3FDADE756 -:102EE000FF23E4E7A36AD8F80410184496F9BE60FB -:102EF00026F0ECFE638BE6751D4498F80A30658376 -:102F0000DB064FF0010599D4E6E794F82430012B55 -:102F100002D16378012B01D0002E8ED0002D8CD0F1 -:102F20001422002104F1100026F0F7FE0E4B0F4A88 -:102F3000E31ADB105343A38247F67F73E382FF2338 -:102F40002376D4F82434002E9B7C204684F822304B -:102F5000B4F8E031238414BFFF2302236376FEF725 -:102F600071FD6AE788070021D01D00214DF833E18B -:102F7000DC4D00210022014B5A707047B807002138 -:102F8000C36AD3F8A00018B1A1F10C03584258410C -:102F9000704700000C4B70B55B6815467BB1222969 -:102FA0000DD10126094C84F828601FF073FE2378A8 -:102FB0009A0605D52B789B0602D584F82A6070BD49 -:102FC000002384F82A30FAE7B00C0021683700218A -:102FD00010B5C46A0A4694F8C83094F8C910032B97 -:102FE00003D0052B09D0002010BD94F8CC30002B65 -:102FF000F9D0BDE81040FFF7C3BFFFF7CBFFD4F80F -:10300000B430034A03F5B073C2F8E031EBE700BF18 -:103010006837002110B5C46A94F8C830032B2AD150 -:1030200094F8CC303BB394F8C910FFF7A9FF10B364 -:10303000114B93F87830F3B1202020F08BFC02463E -:10304000C8B1D4E93001C2E9060194F8CB30137459 -:10305000D4E92E01C2E9020194F8CA3000210748E0 -:10306000137020F082FCBDE81040054B4FF48061E6 -:10307000187B20F01BBD10BD405100217439002188 -:103080006850002108B51EF070FDC0F3001300F079 -:103090000F00184408BD00002DE9F04FDFF8A8B17B -:1030A0000546BBF8282085B082B1042020F052FCF0 -:1030B0000146002800F08C8040F204434B80634BB3 -:1030C000187B05B0BDE8F04F20F055BC604F614C57 -:1030D000F97BD0F82CA094F86A3000297BD0012B22 -:1030E00079D1D7E90889FA735B4E4B4642463046A0 -:1030F00020F0D4FA3368C6F8E431B388A6F8E83192 -:10310000CAE92289237C042B01D0012B12D1DAF8E1 -:10311000843003F04403442B0CD102AB0093A07C19 -:10312000D4E90623F8F7B0FF20B1DDE902234B48CC -:1031300020F0B4FA237C042B14D0012B12D094F885 -:1031400048307BB1002394F8472084F8483002F1DE -:1031500008038AF8B0304249931D40488BF801308B -:1031600026F0B4FD94F869307BB1002394F8682010 -:1031700084F8693002F108038AF8B1303949931DA7 -:1031800039488BF8E53126F0A1FD002128461FF0D3 -:1031900095F8237C012B36D002D9023B022B17D89D -:1031A00040F27126FB699B0105D5FFF76BFFAB6809 -:1031B00006FB0033AB60D4E90212914219D1AB682F -:1031C00028461944A96000211FF02AFF0028E9D0F1 -:1031D00005B0BDE8F08F9A0794D502AB0093A07CB0 -:1031E000D4E90623F8F75FFF00288BD0DDE90289D8 -:1031F0007AE728461FF0DAFF0028E9D1AB68E268D9 -:103200001344AB60CEE7D5F8088027682368002B0D -:103210003FF44BAFD4E90212284620F055F8064699 -:1032200018B9AB68E2681344AB604146A8681FF068 -:1032300069FDE3680344BB422CBF0020381A2060BC -:10324000002EE3D0C4E700BF68370021685000219A -:1032500020500021405100216A37002170370021A1 -:1032600068510021895100215439002170B5446A08 -:10327000D4F8D833D3B194F8C53BBBB1D4F8180A0D -:103280001FF040FD0546D4F88C3894F89E1893F84A -:10329000B020187B1EF07FFF29462046D4F8D83393 -:1032A00094F8C42BBDE8704012F0CEBC70BD000095 -:1032B0002DE9F041446A01290D46D4F8C06B00D1D4 -:1032C0000EB3204B04F24D471B6804F5C568DB8A3A -:1032D0001E4494F8C43B84F8413ABDB92046A4F892 -:1032E000325607F05BFF2B4642463946204613F024 -:1032F0003FF8D4F82C36A4F8D80AC4F8E43AB4F865 -:103300003236A4F8E03A3046BDE8F081B4F83256DF -:10331000B4F85238AB4202D9204607F03FFF0023F1 -:1033200042463946204613F0C1F8D4F82C36A4F8AA -:10333000FC0A2B44C4F8083BB4F832365B1BA4F8F3 -:10334000043BE0E7DC4D0021F8B5446A074694F8F9 -:103350004D33D4F8486384F8C931002965D194F815 -:10336000DD3BA4F81E1513B9204607F041FF94F881 -:10337000B850012D16D0002594F8DD3B002B49D024 -:103380002046D4F8E43B984715B1012384F8B830BF -:10339000D4F81835C4F86C32B4F81E35A4F8683285 -:1033A0003046F8BDD4F8BC20BB68D31AB3F5167FFD -:1033B000B4F8C4200CD240F2E24194F8C77001FB8B -:1033C0000233D4E93E10C91940F10000C4E93E10AF -:1033D0002A498B4213D8002184F8C210A1F1EE31A2 -:1033E000A3FB01014908A4F8C01022B140F2E24158 -:1033F0004A439A42BFD2FF2384F8B830BCE7012188 -:1034000084F8C2101E49A3FB0101032000FB031135 -:10341000890AE8E70123204604F2145204F2D1415C -:1034200013F066F9A4F86002AEE794F8C033B4F87C -:103430001E5523B194F8C233013B84F8C233B4F86B -:103440001435AB4202D894F8C23313B1204607F0CA -:10345000CFFE0123204604F2145204F2D14113F0AE -:1034600025F8D4F81835A4F884022B44C4F8903217 -:10347000B4F81E355B1BA4F88C3291E7C37F0700BC -:103480009E36D069F8B5446A01290D46D4F8C06B60 -:1034900000D1F6B11E4B04F28F471B68DB8A1E4435 -:1034A00094F8C43B84F8413AADB92046A4F8465795 -:1034B00007F074FE2A463946204612F0C3FFD4F8BE -:1034C0004037A4F8EC0AC4F8F83AB4F84637A4F840 -:1034D000F43A3046F8BDB4F84657B4F85038AB4229 -:1034E00002D9204607F05AFE00233946204604F24E -:1034F0003C7212F0DBFFD4F84037A4F8FC0A2B44EE -:10350000C4F8083BB4F846375B1BA4F8043BE0E77B -:10351000DC4D00212DE9F0431C4CD0F82C800546F1 -:1035200087B020460F4612F0BFF994F80090B9F129 -:10353000030F29D123790C2B26D1154EB91C304607 -:1035400012F0CCF9D6E9000100222378CDE9000180 -:10355000D6E902018DF81030A378CDE902018DF88B -:103560001230E96AE37868468DF81330803108F14B -:10357000E00305928DF81190F8F7B6FA003818BFFD -:10358000012007B0BDE8F0830020FAE7DC07002146 -:10359000E807002130B4446A94F84330A3B1C06A0C -:1035A00090F8F31090F8F250D0E93A238D4205D10B -:1035B000D0E93850984208BF954201D041F002014D -:1035C000607830BC1EF008BD30BC704730B4446A2F -:1035D00094F84330A3B1C06A90F8CB1090F8CA5069 -:1035E000D0E930238D4205D1D0E92E50984208BF52 -:1035F000954201D041F00201607830BC1EF0ECBC75 -:1036000030BC7047F0B5464D97B0446A074628462F -:103610000E4612F049F931180AA812F06EF92B780B -:10362000052B02D0002017B0F0BD3E4B5B68002B8D -:10363000F8D02B79222BF5D10AA812F0B5F9002881 -:10364000F0D0DDE90A012B7800228DF82030032329 -:103650008DF82130AB78CDE90401DDE90C018DF85E -:103660002230CDE90601EB78F96A8DF823308031FC -:1036700004F5326304A80992F8F736FA0028D2D08C -:1036800004F52E67D7E9102304F2994020F006F8DC -:1036900094F8323B06F1080084F8CB3BED781FF03C -:1036A000F7FF94F83930CDE902019B0732D50B0AB8 -:1036B00003F0C003402B0AD11B4BC3E91C0102AB32 -:1036C00094F8330B0093D7E91223F8F7FBFCDDE9FC -:1036D000022304F293401FF0E1FF84F8CA5B04F672 -:1036E000C83104F28F4012F053F8012540F2011363 -:1036F000242294F8191B94F84D0A84F85458A4F81D -:103700005C38D4F81C6B1EF046FD0644C4F85868BB -:10371000284688E700200021034BC3E91C01D6E7B7 -:10372000DC070021B00C00214051002138B5C26AED -:1037300092F8C840032C03D0052C0BD0002038BDD4 -:1037400092F8CC30002BF9D0BDE8384092F8C9107F -:10375000FFF716BC0B4C456A204612F0A5F82378FB -:10376000052BEBD1084B5B68002BE7D02379222B8C -:10377000E4D1012385F85C38002385F854381FF024 -:1037800089FADBE7DC070021B00C002110B4C46A21 -:1037900094F8C820032A03D0052A08D010BC70472B -:1037A00094F8CC30002BF9D010BCFFF70FBF426A61 -:1037B00092F8E43313F0200304D0074B5B78003B0E -:1037C00018BF012382F85D38D4F8B43003F5B07324 -:1037D000C2F85838E2E700BFDC0700212DE9F843C2 -:1037E00004460025682700F1500600F55A7807FBCB -:1037F00005F316F80390B9F1010F1FD1F5B9B4F82C -:103800006020B4F890319A4218D1D4E9162340468A -:10381000C4E9DA231EF0ACFA4946204613F012FE42 -:10382000D4E9DA03D4E9E812934208BF8842C4E934 -:10383000200303D02946204613F004FE0135032D52 -:10384000D5D1BDE8F88300002DE9F043446A054670 -:1038500094F8C53BC66A85B003BB94F8C73B23B94F -:1038600094F8D533013384F8D533D4F85C3813F0A9 -:10387000FF1F09D194F8D43383B194F8D5239A4229 -:103880000CD3432384F8D633012384F85E38042113 -:10389000204605B0BDE8F04308F0E4BAF37B13B965 -:1038A000A34B93F87930B373238C13F0100368D1D2 -:1038B00094F83C76BFB184F83C3694F83D26D4F8B1 -:1038C0002C0604F5C86126F001FA94F83D36A4F8F8 -:1038D0002836A4F85238B4F83E36A4F8403094F8AC -:1038E0003B3784F834360022204604F5797112F013 -:1038F0009FFC86F8B0005FB194F8C53B43B9D4F89B -:10390000D8332BB1204607F051FD012384F8C53B85 -:1039100094F89261012E0FD194F8893163B1D4F8F3 -:10392000D8334BB194F8C53B33B9204684F8923173 -:1039300007F03CFD84F8C56BD4F8C43B23F07F430B -:1039400023F0FF03B3F5803F06D1B4F83E36A4F868 -:103950004030002384F8C63B002128461EF0AEFC10 -:10396000238C03F01D031D2B40F0B680D5F8088092 -:10397000E76AE36A002B40F093803C2384F8D63357 -:1039800085E76B4FE27897F86A30002A75D0012BF3 -:1039900073D1D4E902890023C4E90489E37004F2F5 -:1039A000E6374B46424638461FF078FED4F8E633F9 -:1039B000C4F82834B4F8EA33A4F82C34C6E92289D0 -:1039C000238C5A0718D5D6F8843003F04403442BCF -:1039D00012D102AB94F83A000093D4E90C23F8F723 -:1039E00053FB48B1DDE9022304F57B701FF056FE5E -:1039F000DDE90223C4E9062394F83C360BB3002327 -:103A0000D6F8981084F83C360B7803F00F03062B99 -:103A100017D8012202FA03F313F0450F11D094F8DE -:103A20003D36083386F8B03094F83D3606334B7097 -:103A3000D6F8980094F83D2604F23E61083026F04E -:103A400045F994F85037002B86D0002384F850377E -:103A500094F85137D6F8A020083386F8B13094F89E -:103A6000513704F2527106335370D6F8A00094F81F -:103A70005127083026F02AF96EE79907A0D502AB46 -:103A800094F83A000093D4E90C23F8F70CFB0028D3 -:103A900096D0DDE90289C4E90489C7E91C897EE77B -:103AA0002846D4E909121FF00FFC064618B9AB6886 -:103AB000A26A1344AB604146A8681FF023F9A36AC9 -:103AC0000344BB422CBF0020381AE062002E3FF4B2 -:103AD00050AF05B0BDE8F08394F8C53BEE6813B174 -:103AE000D4F81C3A1E4494F8C73BC3B9114B646A1E -:103AF000DB699B0107D5FFF7C5FA40F27122AB687D -:103B000002FB0033AB607100A1424FF0004238BFAE -:103B10002146284605B0BDE8F0431FF047BB00230F -:103B2000284684F8C73B05B0BDE8F0431FF024BA2F -:103B300040510021205000210122436A83F8C72B05 -:103B4000FFF782BEF8B5446AC66A94F8D533D4F854 -:103B50005C280133DBB212F0FF1F054684F8D53331 -:103B600007D194F8D423A2B1934212D3432384F80B -:103B7000D633012384F85E38002304F5066084F808 -:103B8000C53B1FF025FC2046BDE8F840042108F0A5 -:103B900069B9F37B13B93B4B93F87930B37394F85D -:103BA0003C3633B3002794F83D2604F5C861D4F8B9 -:103BB0002C0684F83C7626F089F894F83D363A468F -:103BC000A4F82836A4F85238B4F83E362046A4F8B3 -:103BD000403094F83B3704F5797184F8343612F0AC -:103BE00027FBD4F8D83384F8400913B984F8C53BCF -:103BF000F8BD94F85037C3B1002394F8512784F8E6 -:103C00005037D4F8400704F2547126F05FF894F866 -:103C10005137A4F83C37A4F85038B4F85237A4F818 -:103C2000403094F84F3884F8483794F8C63B94F8FD -:103C30003A00012B01BFB4F83E36A4F8403000230F -:103C400084F8C63BD4E90C23F8F710FC98B10023A4 -:103C50002046A4F8323604F5C56204F24D4112F054 -:103C600087FBD4F82C36A6F89800C6F8A430B4F830 -:103C70005238A6F8A03029462046BDE8F84007F0A3 -:103C80001BBB00BF4051002173B5446A054694F840 -:103C90004E3333B10321204602B0BDE8704008F036 -:103CA00059BBC26A244ED37B0BB996F87930937313 -:103CB00094F8283593B1002394F8292584F8283501 -:103CC000D4F8180504F22C5126F000F894F82935A0 -:103CD000A4F81435B4F82A35A4F8563396F87A3097 -:103CE0004BB1AB68B4F89011607800930022D4F81F -:103CF00050331EF09AF9D4F8503304F55A766B61BC -:103D0000AB68D4F8502320461344AB60B4F890312C -:103D10000133A4F89031FFF761FDB4F890113046FB -:103D200007F090FA002184F84D0328461FF078F937 -:103D30000028E5D002B070BD40510021FFF7A4BFBC -:103D4000F7B505460F46144622B909F02BF904468B -:103D5000002844D095F83433224EA3B1224B1A6880 -:103D60008AB1D5E9080395F818C0A0FB0C010CFB3B -:103D70000311336905F52E7C634503D07378181859 -:103D800041F10001904795F83423D5F89800002AB6 -:103D900014BF04210021AB88D5F88C2002330244E3 -:103DA000F0681944024433692046009789B2F6F757 -:103DB0005BFD337895F834209A420FD90E3355F8CD -:103DC00023405CB123784BB194F8B13004F1780012 -:103DD00086F8AE301EF037F884F8B100012003B049 -:103DE000F0BD00BFF8070021A03A002108B51FF080 -:103DF00069FD044A5378013B5370BDE808401FF049 -:103E00006DBD00BFDC50002108B51FF05BFD044A0A -:103E1000537801335370BDE808401FF05FBD00BF09 -:103E2000DC5000212DE9F04F0F461646446A85B05C -:103E300062B98D4B5A7901325A711A78134493F84A -:103E4000A820013283F8A820A4F886606378022BAA -:103E500015D01EF01FFFBEB99DF80430032B13D1FF -:103E6000814B5A6982B99DF8052094F8A2109142BD -:103E70000AD084F8A2205F6105B0BDE8F08F022E61 -:103E800008D876B11EF006FF002FF5D0384609F0AD -:103E9000B2F8F1E7062E04D13146204609F0D2FCF3 -:103EA000F0E7714DAB795BB9012316F0FB0FAB71F5 -:103EB00001BFD4F89820D4F89C319B1AC4E922336E -:103EC000394601A813F0D1F8002E40F022819DF868 -:103ED0000630EB719DF805302B729DF80430032BF2 -:103EE0004DD14FF000092B7894F834209A4203D931 -:103EF000002E5DD0042E63D0E37F4FF0000A012B2B -:103F00004FF0FF3B40F0CB802879617E0BF1010B35 -:103F100088429ED82046544909F0F7F900285AD023 -:103F200029780E3154F821100029F3D02879617EC8 -:103F3000884280F092804FF001084B4BD5F810A0DA -:103F400093E8030002908DF80C10204602A909F0B6 -:103F5000DCF900287ED09DF808100E3154F82110AD -:103F600041B1207E94F81BE09DF80CC00EFB00F0E0 -:103F7000844534DB08F101085FFA88F8E5E7012B96 -:103F800003D19DF80730002BABD006212A786B783F -:103F900001FB02330B4455F82320002AA1D195F8E8 -:103FA0000390B9F1000F9CD145F823704F469AE772 -:103FB0000E3354F8233094F8A02183F864209BE753 -:103FC0000E3354F8233094F8A02183F86420DA6C7F -:103FD0000132DA6490E7E9790029A7D139E7B031F5 -:103FE0002961E868E168214B01FB0801E9609969F2 -:103FF000CA030CD44FF0060E95F800C069780EFB8A -:104000000C11714455F8211000297FF47DAFBBF1EC -:10401000000F0DD0BAF1000F0AD0D4F89810D4F8E0 -:104020008C204FF001090A4410445146F6F75AFC1F -:104030009DF80430032B3FF40CAF3A464946204626 -:10404000FFF77EFE00283FF404AF002E7FF414AF8C -:10405000374601E704F52E71C2E74FF00108C0E7CB -:10406000E97900292FD1F4E6F8070021205000213A -:10407000B0312961E868216B2E4B01FB0801E96032 -:104080009969CB03C3D44FF0060E95F800C0697848 -:104090000EFB0C11714455F821100029B7D0287877 -:1040A00094F834100BF1010B8842BFF4D2AE2046D5 -:1040B000214909F0EDF80028D2D029780E3154F8C2 -:1040C00021100029F3D0287894F8341088421DD2AA -:1040D0004FF00108184BD5F810A093E803000290A8 -:1040E0008DF80C10204602A909F0D2F858B19DF8BD -:1040F00008100E3154F821100029B9D108F1010837 -:104100005FFA88F8EEE704F52E71B2E74FF0010888 -:10411000B0E7032E7FF4E5AED4F89830D4F88C00E5 -:104120004FF001091844D5E903311844F6F7DAFBDA -:10413000D9E600BF20500021F807002138B5446AB5 -:104140006378022B03D0BDE838401EF0A3BD274B97 -:10415000B0221846002125F0E0FD94F89C2003468B -:104160000270E27F012A29D194F83420E568012AFF -:10417000C5601BD9D4F89400A0B100F1B001196159 -:1041800020B96A43DA60627E012A12D80122DA710C -:10419000FF221A72002220461146FFF7D1FD0028A7 -:1041A000D1D038BDD4F89010B031E8E7627E012A52 -:1041B00016D9D4F89020B0321A61E7E7627E012A5E -:1041C00004D9D4F89020B0321A6107E094F8342072 -:1041D000012A03D9D4F89420002AF4D1226BDA60A2 -:1041E0001A69002AD2D104F52E72E5E7F8070021FA -:1041F0002DE9F04F05460026D0F824A0A3B0DAF848 -:104200008C30DAF828400593DAF82030DFF888920D -:1042100009930AF1380B9AF83420B24230D89AF850 -:1042200001309E4E022B2ED00721504609F00AFB8A -:104230000AF160001FF0ADFD706918B108F0DBFEF7 -:104240000023736123B0BDE8F08FD8F8001041B1AE -:104250005BF8260080B1FAB208F0D0FE0023C8F85F -:104260000030013708F104089AF81820BA42ECD857 -:10427000013609F11809CEE7084608F0BCFEF0E760 -:10428000C8460027F0E7716900296CD09AF83433EA -:10429000002B46D0824B1F68002F42D0DAE908304D -:1042A0009AF818C0A3FB0C320CFB0022CDE91C329B -:1042B0001CABCAF820330AF53F70B847074680BBED -:1042C000706908F098FE06215046776109F0BAFA45 -:1042D000059B099A23441C460023CDE91033CDE900 -:1042E0001233CDE914339AF8183053430A930AF184 -:1042F0003803CDE9073300231E4605939AF834307E -:10430000059A9A42C0F09E80664BDB6A002B00F053 -:10431000EB80002E00F0E880304613AA10A99847E1 -:10432000E2E09AF8A030CBB972699378012B15D8E6 -:1043300002F102026CD00AF1A8010AF1B00012F0F9 -:10434000A2FEBAF8A830BAF820209B1A1F0405D4A0 -:104350009AF8A03043F001038AF8A030706908F0A1 -:104360004AFE0023736173792BB1DAF870100AF1F9 -:1043700060001FF008FDDAE92236F61ADAE90832A1 -:10438000013342F10002CAE90832DAF81030DAF8F3 -:104390008C201E441A44CAF88C206B61BAF8841031 -:1043A000304604F0A1FDBAF88630DAF898201844B7 -:1043B000DAF88C3013441B1A4000AB60CAF8900145 -:1043C000504608F09FFB9AF8A030D3B1D90710D51A -:1043D000BAF82020BAF8A810013292B2914208D15E -:1043E00023F001038AF8A0305046DAE92C2308F0C4 -:1043F000B3FB9AF8A0309A0703D50421504609F080 -:1044000021FA002128461EF00BFE0028B6D05FE7F7 -:104410000AF1B8010AF1BA0012F052FEBAF8B83047 -:10442000BAF820209B1A180404D49AF8A03043F05C -:10443000020391E71E23042150468AF8BA3009F09E -:1044400001FA8BE7089B53F8045B0893FDB1002346 -:1044500005F1100B06939DF818709AF81830BB42BE -:1044600022D822AA02EB460232F83C1C730071B13A -:1044700095F86810002940F01E8295F82C1001294B -:1044800000F019826B88013622F8483CF6B2059B91 -:104490000133059332E700BF10080021F80700211F -:1044A000843A0021685000213946284608F0ADFDC5 -:1044B0000A9B8046FA184FF0000343F10003CDE950 -:1044C0000E230EABC5F8183120B3B44B1B680BB3E9 -:1044D000014605F1F4009847E0B9404608F08BFD2D -:1044E0000621504609F0AEF9002637469AF83430D6 -:1044F0009E42C0F0E681AA4B93F84730002B3FF470 -:10450000A1AEDAF820109AF8020023B0BDE8F04F0F -:104510000FF004BD6B6893F81E90B9F1000F40F0E6 -:104520007B81B8F1000F00F09C80414685F86C70EB -:104530000DA812F09AFD1822494616A825F0EDFBA9 -:104540006B880E9AADF858309DF83730A8F10A07FD -:10455000ADF85C30ADF8663095F82C311894ADF8B4 -:1045600064202BB1012B2DD038461FF0FBF926E03B -:104570009DF83430012B16BF4FF481738DF85B30FA -:10458000ADF85A309DF8343016A985F82C313846EC -:1045900012F0E7FD08F10201BDF86620384425F06D -:1045A000A2FB3946584610F06FFA40B105F12008D9 -:1045B00040460DF133011FF0EDF9074650B9069B57 -:1045C000013347E79DF83430012B18BF03238DF8E2 -:1045D0005A30D7E795F8683069886BB13A46C9B266 -:1045E00005F130001FF0C1F995F83830013385F836 -:1045F0003830FFF7FBFBDBE705F12C093B4648466B -:104600000E9A10F013F840B395F82C30E3B1012B5B -:10461000CED1484610F02FF807460028C8D03946BA -:104620001CA812F056FD5F4BBDF87E20DB68219977 -:104630000B93688F2346DDF82CC0E04738461FF007 -:1046400091F9FFF7E1FBE4E722AB03EB460232F816 -:104650003C3C013322F83C3CAAE738461FF082F983 -:10466000A6E7012385F82A309DF818309AF818201B -:1046700001339342A3D14146584610F005FA002871 -:104680004FD005F12008404616A91FF083F90746D0 -:10469000002894D095F8683069886BB13A46C9B261 -:1046A00005F130001FF061F995F83830013385F8D5 -:1046B0003830FFF79BFBE6E705F12C093B464846FF -:1046C0000E9A0FF0B3FF40B395F82C30E3B1012BF5 -:1046D000D9D148460FF0CFFF07460028D3D039463E -:1046E0001CA812F0F6FC2F4BBDF87E20DB68219948 -:1046F0000B93688F2346DDF82CC0E04738461FF047 -:1047000031F9FFF781FBE4E722AB03EB460232F815 -:104710003C3C013322F83C3CB5E738461FF022F917 -:10472000B1E71F4B9B699B037FF549AF1E4B059A71 -:10473000134493F8A830002B7FF441AF08F032FC0B -:10474000814600283FF43BAF6B881422ADF8583007 -:104750004FF481734146A0F10A0717A8ADF85A300B -:1047600025F0DBFA0E9B3846ADF86430022316A91B -:104770008DF86830189412F0F4FC95F86830ABB1FD -:104780004A46A97805F130001FF0EFF895F8383067 -:10479000013385F83830FFF729FB10E7843A002110 -:1047A00020500021904A0021F807002105F12C0932 -:1047B0003B4648460E9A69880FF038FF00283FF4C0 -:1047C000D3AE95F82C30F3B1012B7FF4F8AE484608 -:1047D0000FF051FF074600283FF4F1AE39461CA800 -:1047E00012F077FC5F4BBDF87E20DB6821990B93BC -:1047F000688F2346DDF82CC0E04738461FF0B2F83A -:10480000FFF702FBE3E722AB03EB460232F83C3C46 -:10481000013322F83C3CD2E6B8F1000F3FF4CFAEB2 -:1048200095F82C3023B1012B19D095F868304BB393 -:10483000BAF806306A88CDE9014398F80130584645 -:10484000009305F13001434610F094F922AB03EBDD -:10485000460333F83C2C104423F83C0C12E0BAF821 -:1048600006306A88CDE9014398F801305846009334 -:1048700005F13001434610F07DF9284608F0A8FB09 -:10488000074618B9404608F0B6FB98E639461CA81A -:1048900012F01FFC334BBDF87E20DB6821990B938F -:1048A00068882346DDF82CC0E04738461FF05AF8E8 -:1048B000FFF7AAFAE1E7002288336B4423F83C2C87 -:1048C000E5E5079B53F8044B07936CB194F8683007 -:1048D00053B194F86930002B3ED104F158082046BA -:1048E00008F076FB054608B90136FFE529461CA805 -:1048F00012F0EFFB9AF81E30012B25D194F86A30A4 -:104900006BB1219A937851781B0403EB0123117842 -:10491000D2780B4403EB0263E36684F86A70E26EBC -:10492000531CE36694F870300192BAF806209DF8A3 -:104930007E102198009242460FF0ACFF28461FF0EF -:1049400011F8FFF761FACAE79AF8183094F86C206A -:10495000099901FB0322E5E7A4F8687084F86A70FE -:10496000E766C1E7904A002110B50446B022002155 -:10497000034825F0D2F92046BDE81040FFF738BCC7 -:10498000F807002113B590F8343313B1184B1B68A6 -:104990005BBB184BDA69019253780233ADF80030F3 -:1049A00090F8A23011789B0003F01C0321F01C0149 -:1049B0000B431370019A137823F02003137090F8BF -:1049C000343353B10C4B1C683CB1D0E90831027E42 -:1049D000A3FB020302FB0131A047002301211A4679 -:1049E0006846F6F705F802B010BD044AD3E700BFE9 -:1049F000883A0021C8080021A43A0021A808002113 -:104A00002DE9F047234F04463B7897F801C003F1A6 -:104A10000E0250F82250902043431820FA781E4E80 -:104A20000CEB020100FB01331E44F36873B373699E -:104A3000002B14BF4FF003084FF0020894F83433F2 -:104A40009BB1164B1B6883B1D4E9080194F818A0F8 -:104A500094F81AE0A0FB0A090AFB019110EB0C0084 -:104A600041F10001E2FB0E019847D7E90523D4F894 -:104A7000CC1030460A444146F5F7BAFF05F17800FC -:104A80001DF0E1F985F8B100BDE8F0874FF00108AD -:104A9000D4E700BFC8080021E8080021A43A00219B -:104AA0002DE9F3479025182316464D4303FB025585 -:104AB000DFF8A48000EB810908EB050A07460C46E5 -:104AC00052463146D9F8380008F02EF900283AD07D -:104AD0003B7E224DB34217D9BB7E6BB1D9F838006B -:104AE000711C0DF10702C9B208301EF062FF38B127 -:104AF00090F90C30002B03DA2A19937B013393735E -:104B00002A19137A01331372902118224C4302FBA5 -:104B100006444444616897F8A2300A789B0022F06A -:104B20001C0203F01C0313430B70EA69636832B183 -:104B30001A7842F020021A7002B0BDE8F0871A78A5 -:104B400022F02002F7E7064BCAF80C00CAF804303E -:104B5000022328F80530EFE7E8080021C808002103 -:104B6000CE080021012973B5456A04D102B0BDE821 -:104B700070401EF08FB81A4C95F8343022789A4263 -:104B8000F4D22146284608F083FB40B9E369002BA4 -:104B9000ECD0284602B0BDE87040FFF7F3BED4E980 -:104BA000000100908DF804102846694608F070FB5B -:104BB00078B19DF800300E3355F82330B0332A6BAE -:104BC000A3616369284613446361FFF719FF02B0CC -:104BD00070BDE369002BF2D005F52E73EFE700BF3F -:104BE000C8080021012973B5456A04D102B0BDE8A7 -:104BF00070401EF04FB8194C6B7E22799A42F5D264 -:104C00002146284608F081FB40B9E369002BEDD02E -:104C1000284602B0BDE87040FFF7B4BED4E90001F9 -:104C200000908DF804102846694608F06EFB78B1B4 -:104C30009DF800300E3355F82330B033EA68A36195 -:104C40006369284613446361FFF7DAFE02B070BD62 -:104C5000E369002BF2D005F52E73EFE7C8080021B9 -:104C60002DE9F743674D446A20220021284625F0AC -:104C700054F8E37F012B70D194F83430012B64D9C0 -:104C8000E36BB033AB61E3680DF1020120466B6169 -:104C900008F06BF99DF80230E861012B08BF94F829 -:104CA000A2304FF0000604BF013384F8A230003870 -:104CB0004FF0010318BF01208DF8043094F8A230A2 -:104CC0008DF8060001A950488DF805308DF8076071 -:104CD00012F09EF9204632463146FFF7E1FE2046AB -:104CE000FFF78EFE94F83430B3425AD8A37E002BDF -:104CF00040F0848094F85C1029B90123204684F8A0 -:104D00005C3009F007FAE969E1B1D4E90836257E9B -:104D10003E4AA3FB053005FB0600C2E9003094F8CB -:104D20003433C4F81C236BB1394B1D6855B14E7830 -:104D30003848B21C24F0CAFF374A04F53F70931973 -:104D4000911EA84703B0BDE8F083637E012B01D913 -:104D5000A36B96E704F52E7394E7637E012B04D9C9 -:104D6000A36BB033AB61236B8EE794F83430012B27 -:104D700001D9E36BF5E704F52E73F3E756EA070371 -:104D800004D041462046FAB2FFF78AFE0137227E60 -:104D9000BA42F3D8E77E637E5743BB4205DC013657 -:104DA000A0E700275FFA86F8F1E74FF00008DF1B65 -:104DB0005FFA86F9B845F2D0227E49464244204641 -:104DC000D2B2FFF76DFE08F10108F3E7394680F82B -:104DD0000D9058F826004F1C0DF103020830FFB269 -:104DE0001EF0E7FD0028F1D13946013694F8343041 -:104DF000B3427FF67FAF04F13808EAE70026314678 -:104E0000B146F3E7C8080021CE080021480C002174 -:104E1000883A0021A8080021AA0800212DE9F04FB6 -:104E200006460125446A87B004F138074FF00008B0 -:104E3000DFF8349294F83430984518D3204608F0BF -:104E4000CFF9204608F0A2F86378012B22D094F81D -:104E5000A0309B0704D504F154001EF03BFFC8B1FD -:104E60000421204607B0BDE8F04F09F0B9B919F8A0 -:104E7000011B49B157F8280080F82050A37E33B1B8 -:104E800099F8052008F00EF808F10108D2E707F0BC -:104E9000C8FFF9E7D4E90832013342F10002C4E95E -:104EA00008322269B36820461344B360726107F088 -:104EB00029FE94F8A03063B994F8A130D80747D5FB -:104EC000022123F0010384F8A130204609F088F97B -:104ED0001DE0D9071BD5228CB4F8A810013292B27C -:104EE000914214D123F0010384F8A0302046D4E984 -:104EF0002C2307F031FE216D29B1D4E92C23C1E91F -:104F00003A2381F8B85094F8A030002BD4D0002177 -:104F100030461EF085F8002888D04FF0000904F1D3 -:104F20003808C246CB4694F83430994522D25AF814 -:104F3000045B95F8683043B195F86930002B3CD19B -:104F4000A77F67BB237EBB420AD809F10109EAE7C4 -:104F50009A07DCD523F00203032184F8A130B4E7DB -:104F6000226A95F8701002FB03736888E2880FF0DC -:104F700047FD80B9236D2BBBA37F012B6CD03B4B2E -:104F800093F84730002B6BD0216AA07807B0BDE8BA -:104F9000F04F0EF0C3BF0EF0FBFC0137D2E7EB6E13 -:104FA00095F870105A1CEA666888E2880FF028FDB0 -:104FB0000028DFD00EF0ECFCC7E7A5F868B0C5F814 -:104FC0006CB0C2E7B268C3F8BC20207ED4E90825E3 -:104FD000A2FB002100FB0511C3E93E21CCE758F8F4 -:104FE000046B337FE3B10FF04DFD06F1140A054663 -:104FF00058B318220021684624F08FFE7388294692 -:10500000ADF80030736850469A880FF06DFC80B29E -:10501000ADF80E0050B12A466946304607F0BCFD97 -:10502000013794F834309F42D9D3A8E728461EF0C0 -:1050300099FCF5E71EF096FC1EF044FC99F8003050 -:10504000013389F800301EF049FC694650461EF0D5 -:10505000A1FC0028EED1E3E70027DFF81490E0E799 -:1050600007B0BDE8F08F00BFD0080021205000211C -:10507000DC50002110B5044620220021034824F012 -:105080004CFE2046BDE81040FFF7C8BEC80800210E -:1050900010B590F8F7200346012A19D090F8EE20B9 -:1050A00090F8F510514011F0010132D1B3F82C41C4 -:1050B00090F8F80004340132A042D2B20ADDD3E9FC -:1050C0000C04013044F10004C3E90C0483F8EE2021 -:1050D00000201DE010B993F8F31059B91049096880 -:1050E00031B1D3E90C10013140F10000C3E90C10DB -:1050F000012006E0D3E90C14013144F10004C3E9B6 -:105100000C1483F8EE20D3F820310BB101225A7031 -:1051100010BDD0F854230132C0F85423D8E700BFA3 -:10512000A03A0021002310B580F8F23080F80E314B -:1051300004460FF0BFF920B194F8FD32013384F832 -:10514000FD3210BD38B590F8462090F8F430044692 -:10515000534013F001050CD090F80E31013280F865 -:10516000462043B1FFF7DEFFD4F814310BB1012222 -:105170001A70284638BD90F8FD32013380F8FD32B0 -:10518000F2E790F80D310BB9837F0BB10FF0B2B994 -:10519000704700000023F0B5046F89B084F8F13047 -:1051A00084F8F23094F8D832D4F81471012B0CBF83 -:1051B0000223002384F8ED3094F8463084F8EF3071 -:1051C000584B9B6903F0805CDB0008D494F81C31D9 -:1051D0002BB994F8283113B9012384F8F03051EA3F -:1051E00002004FF000031BD0657F02AE012D19D1E4 -:1051F00084F8ED3084F8EF3004F1ED014A4884F88A -:10520000F15012F01BF8494B93E8030086E80300C5 -:1052100030462946F5F740FCBDF8080084F80F51E8 -:1052200009B0F0BD84F80F31BCF1000F11D094F833 -:105230001C31012B0BD1FB78BA780133934208D192 -:1052400094F828312BB9012384F8F03001E0002BC9 -:10525000F6D0314620460FF0F5F80546002842D03A -:10526000039A537884F8F230012384F80E311378CE -:1052700003F0F303137094F8EE10890001F00401B9 -:105280000B435BB2137094F8EF10C90001F00801F2 -:105290000B43137094F8F010090101F010010B4357 -:1052A000137094F8F110890101F040010B43137061 -:1052B0001F4B1B682BB194F8942112B1D4E90A0159 -:1052C000984730462946F5F7E7FB039B227F58783D -:1052D00094F8EC3202309A42A2D1D4F8443301332C -:1052E000C4F844339CE794F8D83284F8F200012BD8 -:1052F00008BF022504F1ED010B4884F8ED5011F0D0 -:105300009DFF6B46094A92E8030083E803001846B4 -:105310000121F5F7C1FB0123BDF8000084F86433D7 -:105320007EE700BF20500021500C002134AE030165 -:10533000A43A002170B590F80C6104460D4626B9D8 -:1053400019B108460FF030F9354604F5907009F0B0 -:1053500083FDA0B9D4F82031B4F8E8229968A67A80 -:10536000D878891AD4E9B832002E18BF134622899A -:1053700003FB00112846BDE870400FF019B970BD5D -:105380000023D0F82021037780F8613080F8FD32C7 -:1053900080F8FE3202B11371D0F814311BB1002233 -:1053A0001A719B785BB9012343770023A0F8F03092 -:1053B000A0F8F63080F8F83080F8F3307047427784 -:1053C000F3E770B500F590750446284609F044FDF2 -:1053D000002858D1D4F820315A78EAB10120DA787F -:1053E00099180244C876DA7094F8FE22024484F8D0 -:1053F000FE229A7803F11B010F2A28BF0F22C3F166 -:10540000FF2303F57F03E5335818904237D328462E -:10541000BDE8704009F068BC9A79597901328A4236 -:10542000E7D1D97818795E18327B9042E1D194F8AF -:10543000EE20013284F8EE20D4E90C20013240F154 -:105440000000C4E90C2001221144F276D970B4F8AE -:10545000701384F86E231144A4F87013D4F8301339 -:105460001144C4F8301394F8FE12114484F8FE126B -:1054700094F8D8120029BCD184F88223B9E711F836 -:10548000010B0028C0D170BD38B504460FF07EF87E -:10549000054688B10A4B1B682BB194F8952112B1CF -:1054A000D4E90C019847B4F82C112846BDE83840DF -:1054B000063189B2F5F726BBBDE838401DF0EABBDE -:1054C000A03A0021F0B5C37D054699B02BB109F093 -:1054D0004FFB40F2E24604460CB919B0F0BD94F817 -:1054E000F412A9B194F8EA22A88A571E4743D5F8C6 -:1054F0000CC0286B94F8EC32604406FB0700009067 -:1055000002A809F049F902A904F58A7009F0DAFB4A -:1055100094F8F51299B1AF8A286B94F8EC3206FB37 -:105520001700D4F8E47294F8EB22384400900DA8E8 -:1055300009F032F90DA904F5907009F0C3FB20467B -:10554000FFF71EFF2146284609F044FB0446C3E747 -:10555000F8B500F590770446384609F07DFC002840 -:1055600041D1D4F820311A46CAB998786FF01A0C94 -:105570000F2803F11B0528BF0F202A464FF0010E0C -:10558000ACEB030C0CEB020188420DD80CEB0503CD -:10559000984224D83846BDE8F84009F0A5BB917977 -:1055A00001319171D26ADFE71178B1B99E795979E9 -:1055B0008E4212D182F800E094F8EE10013184F8A6 -:1055C000EE10D4E90C16013146F10006C4E90C16C0 -:1055D000D9780131D97084F86EE30132D2E715F839 -:1055E000013B002BD2D1F8BD2DE9F04700F58A77B9 -:1055F0000446384609F030FC002849D1D4F814514B -:105600002B46C3B96FF01A0805F11B06B2464FF0DE -:105610000109A8EB0508AB7808EB0A020F2B28BF9D -:105620000F2393420CD83344B3422DD13846BDE802 -:10563000F04709F059BB9A7901329A71DB6AE0E7C9 -:105640001AF8013B002BE6D1AA796B799A42E2D194 -:1056500094F846302046013384F846300AF8019C1D -:105660000EF01BFF28B12046FFF75CFD20460EF030 -:1056700041FFEB780133EB70D4E90A32013342F198 -:105680000002C4E90A32C6E716F8012B002ACBD182 -:10569000BDE8F087F8B500F58A760446304609F093 -:1056A000DBFB002865D194F8F130002B61D1D4F8F0 -:1056B00014512B78F3B10121EB78EA180B44D17621 -:1056C000EB70D4E90A325B1842F10002C4E90A32F5 -:1056D000AB7805F11B020F2B28BF0F23C5F1FF2567 -:1056E00005F57F05E535A9188B4238D8304609F015 -:1056F000FBFA38E0D4F83C330133C4F83C33AB79DF -:105700006A790133934224D1EB7829792B441A7BAF -:1057100091421ED10127DF7694F8463020463B4463 -:1057200084F846300EF0B9FE18B12046FFF7FAFCB7 -:10573000A777D4E90A32013342F10002C4E90A3200 -:10574000EB780133EB70D4F840330133C4F84033C5 -:10575000BEE7D4F848330133C4F84833B8E712F849 -:10576000011B0029BFD1304609F076FB08B10123A7 -:105770006377F8BD2DE9F04F456A81462C6FAA7812 -:105780008846D4F8087194F8F03099B0002A40F0B7 -:105790008580002B61D0637F002B5ED0237F5A1C55 -:1057A00094F8EC329A4202DA9B1A03FB07772146FF -:1057B000284609F00FFA0446002800F0D380B0F81C -:1057C0004A30002B40F0CE8090F84730002B40F05C -:1057D000C98090F8F412B9B190F8EA2290F8EC324E -:1057E000A88A561ED5F80CC04643286B604440F288 -:1057F000E24C0CFB0600009002A808F0CDFF02A9C5 -:1058000004F58A7009F05EFA94F8F512A9B140F235 -:10581000E24CAE8A286B94F8EC320CFB1600D4F8FC -:10582000E46294F8EB22304400900DA808F0B4FF35 -:105830000DA904F5907009F045FA2046FFF7A0FD88 -:10584000012388F8003004F59C73C9F82C302C67CC -:1058500094F8E03084F839311CE0B4F84A30002B79 -:10586000A5D194F84730002BA1D1237F94F8EC22E6 -:105870000133DBB29A42237702D10123237696E7E4 -:1058800094F8F63013B1012384F8F03094F8E13045 -:1058900084F83931384619B0BDE8F08FD4F8F0A259 -:1058A00094F8E16013B10123237606E0B4F84A309E -:1058B0008BB12146284609F0DFF9284609F049F95D -:1058C000012815D1284609F0BAF900284AD15746CF -:1058D00084F83961DEE7237F94F8EC220133DBB2F0 -:1058E0009A422377DFD094F8F630002BE5D0DAE740 -:1058F0002146284609F06EF983462846BBF1000F81 -:1059000006D109F09CF968BB012388F80030C1E793 -:1059100009F095F9064628BBBBF84A30002BF3D0B6 -:105920005946284609F0A8F9284609F02EF92867B3 -:1059300090F8E130044680F8393100F59C73C9F8DD -:105940002C3001232B762146284609F043F930B14B -:10595000834504D0D4F8083104461E44F3E7AAEB8B -:10596000060797E70123284688F8003009F076F902 -:1059700000278FE70023F0B5456A99B02C6F2B768E -:1059800094F8F412B1B194F8EA22A88A561EEF688E -:105990004643286B94F8EC32384440F2E24707FB68 -:1059A0000600009002A808F0F7FE02A904F58A702C -:1059B00009F088F994F8F512A9B140F2E247D4F859 -:1059C000E462286B94F8EC323044AE8A94F8EB220F -:1059D00007FB160000900DA808F0DEFE0DA904F5E7 -:1059E000907009F06FF92046FFF7CAFC00210122F0 -:1059F0002846FFF7CFFB1DF057F910B92046FFF7F7 -:105A000043FD19B0F0BD406A10B501220021046FBA -:105A1000FFF7C0FB1DF048F920B92046BDE8104053 -:105A2000FFF732BD10BD436A10B51C6F04F1A8002A -:105A30001CF009FA84F8E10010BDF0B50B780646B9 -:105A400099B0F3B1456AAF78012F1AD12846296F72 -:105A500009F0C0F80446B8B9284609F096F800F5F0 -:105A60009C732F76F362286790F8E130027F80F80C -:105A7000393190F8EC329A4203D800213046FFF7D2 -:105A8000D2FF002019B0F0BD2B7E002B36D190F84C -:105A9000F412B9B190F8EA2290F8EC32A88A571EB5 -:105AA000D5F80CC04743286B604440F2E24C0CFB35 -:105AB0000700009002A808F06FFE02A904F58A70A2 -:105AC00009F000F994F8F512A9B140F2E24CAF8A5E -:105AD000286B94F8EC320CFB1700D4F8E47294F8BD -:105AE000EB22384400900DA808F056FE0DA904F5ED -:105AF000907009F0E7F82046FFF742FC04F59C732C -:105B0000F3622B7E2C6723B994F8E03084F83931A6 -:105B1000B7E794F8E130227F84F8393194F8EC3219 -:105B2000A9E770472DE9F04F456A064689B0284637 -:105B300009F01EF84FF000080446DFF854923CB913 -:105B4000EB7D002B4FD102236B7009B0BDE8F08FC5 -:105B500094F8D8327BB994F86E2322B1204684F8A9 -:105B60006E3309F0A3FA94F8103123B1204684F87B -:105B7000108109F037FB4FF49563E7885F43854B4D -:105B8000D3F800B0637E0BEB070A012B06D01BF89D -:105B900007301BB199F80030012B15D1204609F0D0 -:105BA000C1F899F8003043B9E17E99B11622E37645 -:105BB000E27700212046F8F71DF984F819802B7848 -:105BC00013B1EB7D013BEB752146284609F002F845 -:105BD0000446B4E71BF80730002BEAD19AF81020EE -:105BE000A370E277E5E7284608F0CFFF0446DFF828 -:105BF000A881DFF8A891002C40F0C180284608F069 -:105C0000C4FF6B7E012B0DD16C76B368EA69134437 -:105C1000B36000F59C73EC61F362286790F8E030A4 -:105C200080F83931DFF86C91DFF8748140F2E2419D -:105C30006B6AAA8A284601FB02336B6208F098FF60 -:105C40004FF4956A0446E388D9F80070B4F84A2006 -:105C50000AFB0377002A40F03B81E18904F1A80B9D -:105C6000013189B20123E18158461CF09FF884F884 -:105C7000390184F8E00058461CF0E5F894F8183330 -:105C800084F8E100002B40F00F8194F8D432032B0C -:105C900040F01C8194F84621013A18BF01229B1A5A -:105CA0003B4493F8503284F83A3194F8D832012BBF -:105CB00020D194F86033EBB10EF0E4FE8346C8B116 -:105CC0000146B4F8302104F556700EF00DFE0023A5 -:105CD000ADF816008DF80B301DF0F4FD98F800308B -:105CE000013B88F800301DF0F9FD5A46204602A914 -:105CF0000EF010FB2146284608F06CFF04460028F1 -:105D0000A1D197F885332846A3F10B0253425341A2 -:105D1000337608F03AFF6A6AD0E904310A44D21AAD -:105D2000B260EA680746134440F2E2425B1AF3604D -:105D3000AB8A21465343304673611DF071F9002848 -:105D400040F0CA80706AFFF7BDFBB7F84A305BB914 -:105D5000FB8938460133FB81FFF746FC3846FFF7E5 -:105D6000F7FBFB89013BFB813946284608F032FFEF -:105D700007460028E9D1284608F0FAFE56E7B4F8AD -:105D80004A307BB12146284608F024FF044632E71A -:105D9000000D0021B43A0021B05000219C3A0021AE -:105DA000DC5000215A4B2046D3F800A0B4F806B0CE -:105DB000FFF71AFC2046FFF7CBFB94F8D83283B9E3 -:105DC00094F86E2322B1204684F86E3309F06EF900 -:105DD00094F810312BB10023204684F8103109F0DB -:105DE00001FA94F8CA7294F86130002F3ED16BB377 -:105DF000B4F8C81204F52E701DF0C5FF012384F815 -:105E0000CA3298F801305BB16E212046F8F7A8F845 -:105E100020460AF0DDFC394620466269F8F71AF898 -:105E200094F8CB3293B1D9F800707FB1A37AD3B98B -:105E300094F8D41201224FF49560364B00FB0BA06E -:105E40001B6893F9283000920022B84794F8FC327E -:105E5000ABB1E08809F006F8002893D00421204671 -:105E6000F8F77EF88EE794F8D512E3E7002BEDD033 -:105E7000B4F8C81204F52E701DF085FFE6E7E3893B -:105E8000062BE6D16E212046F8F76AF820460AF084 -:105E90009FFC2046F8F788F805212046F8F74AF8D5 -:105EA000EB7D012BD5D150E6D4F8E0B26B6AD4F883 -:105EB0001C239B1A5B45FFF4E8AE204609F0C6F8A8 -:105EC000D4F81C335B44C4F81C33EFE70122E6E648 -:105ED000013AA4F84A200DE7284608F056FE286744 -:105EE00000F59C70F062284608F04FFE0A4B2867C8 -:105EF00000F59C70F06293F84730002B3FF425AE1C -:105F00002146287A09B0BDE8F04F0EF007B800BF6F -:105F1000B43A0021DC4D00212050002110B5044688 -:105F2000406AFFF7CFFA2046BDE81040FFF7FABD00 -:105F3000436A1B6FD3F8143113B11A7901321A7105 -:105F40007047000070B50E464FF49561436A1546E0 -:105F50001C6F454BE2881B6801FB0233D4F8142107 -:105F60000AB100211170D4F8202122B11179013138 -:105F70001171002151700022032DA4F80C21A27789 -:105F800084F86E231BD0C26A042D92F8B82084F8DE -:105F9000EC200FD0022D12D130460EF005FB20462A -:105FA000FFF778FB2046FFF70CFA2046BDE870406B -:105FB000FFF7E7B8D4F84C230132C4F84C23D3F8E8 -:105FC000182422F07F4222F0FF02B2F5803F0BD16D -:105FD00094F9EC10D3F84824521AC3F8482493F8E3 -:105FE0004524013283F84524042D09D8DFE805F063 -:105FF000032D08202D00012384F8FC3284F8613041 -:10600000314604F1F30011F038F9062D21D194F84E -:10601000F53094F8EE205340DB071AD42946204689 -:10602000F7F788FF30460EF0BFFA1CF033FEB6E7F4 -:106030000023A4F80C31D4F850330133C4F85033A2 -:1060400031462046FFF776F9A9E70023A4F80C3182 -:10605000F6E72046FFF71CF884F80C012046FFF70E -:1060600071F884F80D01EBE7B43A00210322002314 -:1060700080F8A320D0F82021A0F8A030037780F882 -:10608000FD3280F8FE3202B11371D0F814311BB129 -:1060900000221A719B785BB9012343770023A0F893 -:1060A000F030A0F8F63080F8F83080F8F330704720 -:1060B0004277F3E770B500F590750446284608F07E -:1060C000CBFE00285ED1D4F820315A78EAB1012005 -:1060D000DA7899180244C876DA7094F8FE220244FD -:1060E00084F8FE229A7803F11B010F2A28BF0F22A1 -:1060F000C3F1FF2303F57F03E533581890423DD3E6 -:106100002846BDE8704008F0EFBD9A795979013210 -:106110008A42E7D1D97818795E18327B01329042F1 -:10612000E0D1D4E90C20013240F10000C4E90C2098 -:1061300001221144F276D97094F8EE1084F86E239F -:10614000114484F8EE10D4F850131144C4F85013DD -:10615000B4F870131144A4F87013D4F83013114438 -:10616000C4F8301394F8FE12114484F8FE1294F827 -:10617000D8120029B6D184F88223B3E711F8010BB5 -:106180000028BAD170BD000038B504460EF0FEF903 -:10619000054688B10A4B1B682BB194F8952112B1C2 -:1061A000D4E90C019847B4F82C112846BDE83840D2 -:1061B000063189B2F4F7A6BCBDE838401CF06ABDD0 -:1061C000A03A0021F0B5C37D054699B02BB108F087 -:1061D000CFFC40F2E24604460CB919B0F0BD94F889 -:1061E000F51299B1AF8A686A94F8EC3206FB170091 -:1061F000D4F8E47294F8EB223844009002A808F036 -:10620000CBFA02A904F58A7008F05CFD94F8F41248 -:10621000A9B194F8EA22A88A571E4743D5F80CC0C2 -:10622000686A94F8EC32604406FB070000900DA801 -:1062300008F0B2FA0DA904F5907008F043FD20466D -:10624000FFF714FF2146284608F0C4FC0446C3E7C4 -:10625000F8B500F590770446384608F0FDFD0028B3 -:1062600046D1D4F820311A46CAB998786FF01A0C82 -:106270000F2803F11B0528BF0F202A464FF0010EFF -:10628000ACEB030C0CEB020188420DD80CEB0503C0 -:10629000984229D83846BDE8F84008F025BD9179E4 -:1062A00001319171D26ADFE71178D9B99E795979B4 -:1062B0008E4217D182F800E0D4E90C16013146F184 -:1062C0000006C4E90C16D9780131D97094F8EE10A3 -:1062D00084F86EE3013184F8EE10D4F83013013104 -:1062E000C4F830130132CDE715F8013B002BCDD1B6 -:1062F000F8BD2DE9F04700F58A770446384608F0E6 -:10630000ABFD002849D1D4F814512B46C3B96FF026 -:106310001A0805F11B06B2464FF00109A8EB050863 -:10632000AB7808EB0A020F2B28BF0F2393420CD83F -:106330003344B3422DD13846BDE8F04708F0D4BC11 -:106340009A7901329A71DB6AE0E71AF8013B002B77 -:10635000E6D1AA796B799A42E2D10AF8019C94F8C5 -:1063600046302046013384F846300EF096F828B1C6 -:106370002046FEF7D7FE20460EF0BCF8EB7801333E -:10638000EB70D4E90A32013342F10002C4E90A3267 -:10639000C6E716F8012B002ACBD1BDE8F087F8B587 -:1063A00000F58A760446304608F056FD002865D18F -:1063B00094F80F31002B61D1D4F814512B78F3B13C -:1063C0000121EA78AB18D976D4E90A31013341F1D9 -:1063D00000010132C4E90A31EA70AB7805F11B0211 -:1063E0000F2B28BF0F23C5F1FF2505F57F05E535E8 -:1063F000A9188B4238D8304608F076FC38E0D4F83B -:106400003C330133C4F83C33AB796A7901339342AE -:1064100024D1EA782979A818037B99421ED1012753 -:1064200094F846303A44013384F84630D4E90A31CE -:10643000013341F10001C4E90A31C776EA70D4F8AA -:10644000403320463B44C4F840330EF026F8002881 -:10645000C3D02046FEF766FEA777BEE7D4F84833E0 -:106460000133C4F84833B8E712F8011B0029BFD143 -:10647000304608F0F1FC08B101236377F8BD2DE93F -:10648000F04F456A83462C6FAA7894F8A3908A4609 -:1064900094F8F630D4F8F0829BB009F0FB09002A9A -:1064A00040F08C80267F0136F6B22677ABB994F89F -:1064B000F0300BB1637F83B9B4F84A306BB994F80C -:1064C000EC32B34209D094F8E13084F8393108F164 -:1064D000FF360223C4F80032E3E02746D4F8F8324E -:1064E00003933946284608F075FB074678B92846D5 -:1064F00008F04BFB0123286700F59C70CBF82C00BB -:1065000028468AF8003008F0A9FB0026C9E0B7F851 -:106510004A30002BE5D197F8F512B1B140F2E24EC6 -:10652000B5F814C0686A97F8EC320EFB1C00D7F877 -:10653000E4C297F8EB226044009004A808F02CF91C -:1065400004A907F58A7008F0BDFB97F8F412C9B1E9 -:1065500097F8EA22A88A02F1FF3CD5F80CE00CFB80 -:1065600000FC686A97F8EC32704440F2E24E0EFB91 -:106570000C0000900FA808F00FF90FA907F5907014 -:1065800008F0A0FB039B3846013E08FB1636FFF7D8 -:106590006DFD01238AF80030D4F8F831C7F8F831DE -:1065A00007F59C73CBF82C302F6797F8E03087F80D -:1065B0003931B9F1000F74D1013E8AE7D4F808618E -:1065C00094F8E17013B994F8F03013B101232376F5 -:1065D00006E0B4F84A30B3B12146284608F04CFB37 -:1065E000284608F0B6FA012816D1284608F027FBFD -:1065F00000287FF47CAF84F83971B9F1000F3FF4C3 -:1066000066AF46464DE0237F94F8EC220133DBB2BF -:106610009A422377E4D1D9E72146284608F0DAFAEE -:106620000746284647B908F00AFB00287FF45FAF09 -:1066300001238AF80030BCE708F001FB00287FF452 -:1066400056AFB7F84A20002AF2D0394603902846C0 -:1066500008F012FB284608F08BFA286790F8E12032 -:10666000039B80F8392100F59C72CBF82C20012285 -:1066700006469A462A763146284608F0ABFA30B1EB -:10668000874204D0D6F8083106469A44F3E7B9F1B8 -:10669000000F04D1022308F1FF38C4F80032A8EB40 -:1066A0000A0630461BB0BDE8F08F70472DE9F04F69 -:1066B000456A06468BB0284608F067FA90F8A03085 -:1066C000044673B1B5F87420D0F89C30A5F87C204E -:1066D0000269AB67134442699B1A6B62002380F81E -:1066E000A030DFF8D8B2DFF8D8924FF49563B4F851 -:1066F0000680DBF800A003FB08F894F8D8320AEB18 -:10670000080783B994F86E2322B1204684F86E33CB -:1067100008F0CCFC94F810312BB10023204684F80B -:10672000103108F05FFD637E012B06D01AF80830A7 -:106730001BB199F80030012B17D1204608F0F2FA6E -:1067400099F8003053B9E27E002A00F0AA801622A0 -:10675000E376E27700212046F7F74CFB00236376CF -:106760002B7813B1EB7D013BEB752146284608F0F1 -:1067700031FA04460028B8D1EB7D002B00F01A81D5 -:10678000284608F002FA4FF495690446DFF834A26F -:10679000002C40F08E80284608F0F7F96B7E012B24 -:1067A00007D100F59C73F362286790F8E03080F819 -:1067B0003931B5F87480B5F87C30A8EB03081FFABE -:1067C00088F8B5F87430B5F814A00133A5F8743022 -:1067D00040F2E24303FB0AFA08F101081FFA88F8C5 -:1067E000B5F87E100AFB08F002F07EFB81462846D1 -:1067F00008F0BEF904464FEA5A030393002C40F018 -:10680000E780284608F0C1F940F2E243AA8A4169CC -:106810005A436B6A824613446B62A3EB09030B4431 -:1068200001695B1AD0F8F01272612A6F49444FEA8D -:106830004900B360F160C2F800026A7E012A04D107 -:10684000EA696C761344B360EC6197F8853330469F -:10685000A3F10B02534253415B4933761CF0E0FB3A -:10686000002840F04281706AFFF7ACFCBAF84A3069 -:106870007BB9BAF80E3050460133AAF80E30FFF754 -:1068800038FD5046FFF7E4FCBAF80E30013BAAF899 -:106890000E305146284608F09DF982460028E5D181 -:1068A0008FE71AF80830002B7FF454AF3B7CE37776 -:1068B00050E7E388DBF8007009FB0377B4F84A304F -:1068C0002BB12146284608F085F9044660E72046AA -:1068D000FFF70FFD2046FFF7BBFC94F8D83283B9D1 -:1068E00094F86E2322B1204684F86E3308F0DEFB64 -:1068F00094F810312BB10023204684F8103108F0B1 -:1069000071FC94F8CA2294F8A130002A38D13BB324 -:10691000B4F8C81204F52E701DF035FA012384F87E -:10692000CA3294F8CB3293B1284BD3F80080B8F137 -:10693000000F0CD0A37A03BB94F8D4120122DAF82A -:106940000030384693F9283000920022C0470021D9 -:1069500020466269F7F77EFA6E212046F7F700FBC2 -:1069600094F8FC32ABB1E08808F07CFA0028A8D09B -:1069700004212046F7F7F4FAA3E794F8D512DDE7EF -:10698000002BEDD0B4F8C81204F52E701DF0FBF901 -:10699000E6E7E389062BE6D16E212046F7F7E0FA19 -:1069A0002046F7F701FB05212046F7F7C3FAEB7DF8 -:1069B000012BD8D10BB0BDE8F08F00BFB43A002155 -:1069C000000D0021DC4D0021A1E801019C3A0021CD -:1069D0004FF49562E388DBF8007002FB0377B4F8AC -:1069E0004A20002A7DD1E18904F1A80A013189B247 -:1069F0000123E18150461BF0D9F984F8390184F86C -:106A0000E00050461BF01FFA94F8183384F8E100B8 -:106A1000002B4DD194F8D532032B5AD194F846214E -:106A2000013A18BF01229B1A3B4493F8503284F874 -:106A30003A3194F8D832012B1FD194F86033E3B186 -:106A40000EF020F88246C0B10146B4F8302104F5BA -:106A500056700DF049FF0023ADF81E008DF813307D -:106A60001CF030FF274A1378013B13701CF036FFEF -:106A70005246204604A90DF04DFC94F8EC32022B4E -:106A80002BD81CF039F9952825D91CF035F9039B32 -:106A9000181A484506D805212046F7F74BFAEB7D32 -:106AA000012B87D02146284608F094F80446A5E635 -:106AB000D4F8E4A2B368D4F81C239B1A5345A9D395 -:106AC000204608F0C3FAD4F81C335344C4F81C33EE -:106AD000F0E70122A7E79620D9E7D4F8F0324B453A -:106AE000D8E7013AA4F84A20DCE7074B93F847308F -:106AF000002B3FF45FAF0021287A0BB0BDE8F04FC8 -:106B00000DF00CBADC5000212050002110B50446D5 -:106B1000406AFFF757FB2046BDE81040FFF7C6BDAF -:106B2000436A1B6FD3F8143113B11A7901321A7109 -:106B300070470000F8B50E464FF495611546476A58 -:106B4000574B3C6F1B68E28884F8A35001FB02336B -:106B5000D4F8202122B11179013111710021517035 -:106B6000D4F81411002201B10A70032DA4F80C21ED -:106B7000A27784F86E2310D0C26A022D92F8C42046 -:106B800084F8EC2009D130460DF00EFD2046FFF7C9 -:106B900006FC2046FFF78EFA6DE0D3F8182422F0A9 -:106BA0007F4222F0FF02B2F5803F0BD194F9EC1046 -:106BB000D3F84824521AC3F8482493F845240132E4 -:106BC00083F8452494F8A02025F0040313432CD126 -:106BD000227FD4F8F012D4F8F43101FB1233C4F858 -:106BE0009C30012384F8A030FDB984F8FC320123E5 -:106BF00084F8A130002384F8A230314604F1F30078 -:106C000010F03BFB062D3FD194F8F53094F8EE20C0 -:106C10005340DB0738D429462046F7F78BF9304636 -:106C20000DF0C2FC1CF036F8B0E7042DE5D801A346 -:106C300053F825F0EF6B0101816C0101FB6B010141 -:106C4000816C0101496C0101D4F84C330133C4F863 -:106C50004C330023A4F80C3131462046FEF76AFB82 -:106C60002046FFF79CFB2046FFF724FA0122294625 -:106C70003846FEF78FFA2046BDE8F840FEF781BAA5 -:106C80000023A4F80C317EE72046FEF701FA84F8D1 -:106C90000C012046FEF756FA84F80D01DCE700BF30 -:106CA000B43A00210023F0B5456A99B02C6F2B76D9 -:106CB00094F8F512A9B140F2E247D4F8E462686AA8 -:106CC00094F8EC323044AE8A94F8EB2207FB1600BD -:106CD000009002A807F060FD02A904F58A7007F091 -:106CE000F1FF94F8F412B1B194F8EA22A88A561E82 -:106CF0004643686AED6894F8EC32284440F2E24575 -:106D000005FB060000900DA807F046FD0DA904F54F -:106D1000907007F0D7FF2046FFF7A8F9FFF734FA85 -:106D200019B0F0BD436A186FFFF72EBA436A10B569 -:106D30001C6F04F1A8001BF086F884F8E10010BD78 -:106D4000F0B50B78064699B0F3B1456AAF78012FDC -:106D50001AD12846296F07F03DFF0446B8B92846E6 -:106D600007F006FF00F59C732F76F362286790F812 -:106D7000E130027F80F8393190F8EC329A4203D842 -:106D800000213046FFF7D2FF002019B0F0BD2B7E66 -:106D9000002B36D190F8F512A9B140F2E24CAF8A3F -:106DA00090F8EC3290F8EB22686A0CFB1700D4F8EC -:106DB000E4723844009002A807F0EEFC02A904F542 -:106DC0008A7007F07FFF94F8F412B9B194F8EA22C0 -:106DD000A88A571ED5F80CC04743686A94F8EC326D -:106DE000604440F2E24C0CFB070000900DA807F055 -:106DF000D3FC0DA904F5907007F064FF2046FFF75F -:106E000035F904F59C73F3622B7E2C6723B994F853 -:106E1000E03084F83931B7E794F8E130227F84F824 -:106E2000393194F8EC32A9E770B590F85C12044659 -:106E3000A9B9284B1B6893B11B6983B1264A106816 -:106E4000264A201AC010504380B2984708B100204B -:106E500070BDB4F84603BDE870400BF061B994F81A -:106E6000552294F85E02504010F00103EFD1B4F8BF -:106E7000460394F86152061DB54203DD013284F8E1 -:106E80005522E4E71DB301390229F7D8144D6B7878 -:106E9000002BDCD00BF044F90028D8D06B78013BF4 -:106EA0006B70104B1B6863B194F8A5304BB194F82C -:106EB000A73033B9D4E9B632013342F10002C4E954 -:106EC000B63294F85532013384F85532C0E728467B -:106ED000F7E700BFB83A0021B43A0021BDCAE28CFE -:106EE000B4500021A03A0021002310B580F8593297 -:106EF00004460BF097F878B1084B1B6863B194F81F -:106F0000A4304BB194F8A73033B9D4E9B43201338B -:106F100042F10002C4E9B43210BD00BFA43A00211E -:106F200010B590F8562290F85D32534013F00104EA -:106F300011D090F85932013280F856226BB190F896 -:106F40005432032B05D190F87E3213B1013B80F807 -:106F50007E32FFF7C9FF204610BD80F87F32FAE786 -:106F60000BF088B870B504460E468AB031B990F877 -:106F70005F321BB990F85702104350D0FF232046D0 -:106F800084F854320DF1070204A90AF0F1FF94F8D5 -:106F90007F320546002B69D1002867D09DF8073065 -:106FA000002B3ED1A268910702F0020303D5A3781B -:106FB0005A1E53425341DBB2059984F857328DF87B -:106FC00007304B7884F859320B7803F0030384F8C8 -:106FD000543243BB444B1B682BB39B681BB3434ADF -:106FE0001068434A201AC010504380B29847059B4E -:106FF0001878404BC0F340101B68861C3BB194F8D6 -:10700000A42022B194F8A72042B3012A2AD004A8D0 -:107010002946F4F7A3F8059B5878304480B20AB0AB -:1070200070BD0123C7E70B7803F0E3030B7094F8FE -:107030005522920002F0040213435BB20B7094F8E5 -:107040005622D20002F0080213430B7094F8572224 -:10705000120102F0100213430B70C8E7D4E9B40127 -:107060009847D4E70021B4F80602F9E72EB3003DB3 -:1070700018BF0125002384F85752012584F859329E -:1070800004F515711C4884F854520FF06BFB1B4A31 -:1070900002AB92E8030083E8030018462946F4F7A0 -:1070A0005DF894F87F32BDF80800B3FA83F35B090A -:1070B00084F8803284F87F52B1E794F85C32002B78 -:1070C000D5D1094B1B68002BD1D0DB68002BCED06B -:1070D000064A1068064A201AC010504380B29847EA -:1070E0000028C4D130469AE7B83A0021B43A0021CA -:1070F000BDCAE28CA43A0021540C00213CAE03012D -:1071000070B504461E4608461546FAB1194BB4F848 -:1071100006121A68184BA21AD2105A4392B20BF0F8 -:107120000BF806B3154B1B683BB194F8A52022B1B0 -:1071300094F8A7206AB1012A0FD0B4F84613284664 -:10714000BDE87040063189B2F4F73EB84BB10D4648 -:10715000E8E7D4E9B6019847EFE70021B4F8060262 -:10716000F9E729B10D462846BDE870400AF0E0BFB6 -:1071700070BD00BFB43A0021BDCAE28CA03A002124 -:107180002DE9F843836806465B070F46144625D46D -:107190001EF032FC81461BF0AFFD40F2E245804616 -:1071A000B369B6F80A0245435BB1394698681BF0EB -:1071B000A9FDA84205D8B369394698681BF0A2FD1D -:1071C0000546394648461BF09DFD96344444044428 -:1071D000AC4294BF00200120BDE8F8830020FBE70B -:1071E0004378032B11D190F87F332BB190F88003B3 -:1071F000003818BF0120704790F876333BB1D0F8C3 -:107200006C02B0FA80F040097047002070470120FE -:107210007047000070B5446A2046FFF7E1FF18B1DF -:10722000BDE870401BF036BD224B1B684BB19B691B -:107230003BB1214A1068214A201AC010504380B245 -:107240009847002101221E4B84F85F12198084F8B0 -:10725000611284F85C22204659809980D980FFF71A -:1072600081FE1BF021FD064610BBB4F846030AF070 -:1072700057FF05460028D3D0124B1B683BB194F84A -:10728000A52022B194F8A72052B1012A0CD0B4F85D -:1072900046132846BDE87040063189B2F3F794BF23 -:1072A000D4E9B6019847F2E73146B4F80602F9E7A7 -:1072B00070BD00BFB83A0021B43A0021BDCAE28CCB -:1072C000580C0021A03A0021436A93F87F222AB18A -:1072D00093F8802212B1002283F87F2270470000C9 -:1072E0002DE9F04F446A064694F89432C76A4E4D31 -:1072F00085B0002B78D12B88002B75D0237CB4F877 -:1073000082123E2B08BF082304F5217008BF2374A6 -:107310001CF039FD454B9B69D80503F4807112D4EC -:10732000D4F8182422F07F4222F0FF02B2F5803F09 -:1073300009D103F400430B4305D04FF47A7104F2F2 -:1073400004401CF020FD012384F8943297F8A83003 -:1073500084F80C3294F81A34012B0BD194F80D32C6 -:1073600013B1802384F80C3294F81934002B49D0DF -:10737000012B54D0D4F83C343BB12D4A10682D4A2F -:10738000201AC010504380B2984794F894226B782A -:10739000134319D194F89632013BDBB284F896324C -:1073A00093B904201CF0D6FA014668B1204B214A5B -:1073B0001B68E31ADB105343038044F201734380DC -:1073C0001D4B187B1CF0D7FA2046FFF709FF002859 -:1073D00036D020464C210AF043F804F5217005B060 -:1073E000BDE8F04F1CF0D5BC6B78002BAED0B4F8E4 -:1073F000821204F521701CF0C6FCB4F80632A4F821 -:107400000832A3E7D4F8203494F90C229B1AC4F86C -:10741000203494F81E34013384F81E34AAE7074B55 -:1074200020461B689847A5E7580C002120500021F2 -:10743000B43A0021BDCAE28C68500021803A002194 -:10744000954BDFF858921B68002B00F00C81E88800 -:107450006A88A988003A014418BF0122204689B2EF -:107460009847054660B1B4F80632411E0344A4F8BB -:10747000063294F84532204659F8233089B29847AD -:1074800094F8C8317BB30C200AF05CFD804650B301 -:107490000023B4F80422B4F85E04D11DB4F8062227 -:1074A00084F8C83101FB0022A4F8AA237C4A1846BC -:1074B00011687C4A611AC91051430093B268C9B27D -:1074C0001BF0F0F9784B04F56871A0FB0330DB0F7B -:1074D00043EA4003A4F8A23340460FF06DF9414659 -:1074E00020460AF005FD94F8F4332BB3B4F80622D5 -:1074F000B4F8FA339A421FD394F87633E3B90420F0 -:107500001CF028FA014668B1654B664A1B68E31A0D -:10751000DB105343038046F601534380634B187BD3 -:107520001CF029FAB4F8F633002B00F09E80B4F872 -:1075300006221344A4F8FA3394F8693363B10023A4 -:1075400084F8693394F86A33002B40F09180584BEB -:107550001B680BB120469847B3680293FB7B0BB9BD -:1075600097F8A930BB733B7B032B0AD1FB685149C9 -:1075700003F0FF138B420CBF2246621E92F8533277 -:10758000BB704FF0030A40F2E24CB4F80A820135B6 -:10759000ADB208FB05F20CFB02F2B4F80632029918 -:1075A00001339BB21144A4F80632B160726194F8C1 -:1075B00085B3BBF10B0F5DD100223276B4F8AA235C -:1075C0009A423FD1B4F8A633B4F80422B4F8A2E347 -:1075D000A4F80432E369B4F8A4130CFB0E33E3619E -:1075E00018F0030318BF0123A4F80A120CFB01F1E1 -:1075F000B4F8A803616200EB8000400008EB98013A -:1076000080B21944B4F882B20144A4F8820204F5AD -:10761000217003921CF0B7FBB4F80A32039A434579 -:1076200007D1B4F80432934203D1B4F882325B45F7 -:1076300005D0D4F8883343F40063C4F888330123B9 -:1076400084F87E3394F845320021204659F82330DF -:1076500098471949787030461BF0E2FC002892D018 -:1076600005B0BDE8F08F1D460AE784F8F43363E700 -:10767000124B6DE701229345327621D1B4F8D02325 -:107680009A42DFD1D4E9F2232046C4E9862309F0E7 -:1076900092FD84F87EB3D5E7083A00210C3A002128 -:1076A000B43A0021BDCAE28CE3361A0068500021CA -:1076B000943A002103000100A9160201903A00212A -:1076C000BBF10F0FBED1B4F8DC239A42BAD194F8C3 -:1076D0005430022B03D0032B14BF0123042394F84E -:1076E0005580B8F1020F06D0B8F1030F14BF4FF068 -:1076F00001084FF0040894F8DA13A9B3994233D083 -:1077000002294FF0010360D0042955D0194684F8AE -:107710005430CB1A234493F95002D4F888337E288E -:1077200043F400430A4684F84A00C4F888331BD166 -:10773000274B22441B68032993F9283084F84A30E8 -:1077400082F84F32D4F8342308BF84F853325207FA -:107750000AD5204AD2F800B0BBF1000F04D00122B4 -:10776000204600920022D84794F8DB337BB1434592 -:107770000DD0022B03D0042B14BF0123032384F864 -:107780005530D4F8883343F40043C4F888330123D8 -:1077900004F24E3184F87E3320460AF0C2FA04F235 -:1077A0004631A4F8600320460AF0BBFAB4F860330F -:1077B000A4F85E03236245E794F856300321013BA9 -:1077C00018BF012384F854A0A3E784F85410A0E75D -:1077D000DC4D00219C3A0021436A93F87F222AB1B4 -:1077E00093F8802212B1002283F87F225B7823B1C4 -:1077F0000022024B1A80FFF773BD7047580C00211E -:1078000051B90122436A83F8802393F859321BB19E -:10781000024A938801339380704700BF580C0021BF -:107820002DE9F14F446A814694F87E330F4616469F -:1078300084F80D22ABB1002384F87E3394F88533AD -:10784000012B0AD1574B1A683AB1574B57481B685E -:10785000E31ADB10584380B290476E21204609F0AE -:10786000FFFD022E05D1384601B0BDE8F04F0AF009 -:107870005FBC2046FFF7B4FC054618B906F0FD03CF -:10788000012B02D11BF006FAEDE7C6B94FF4807266 -:10789000474B1A80394604F517700EF0BDFF062ECF -:1078A00017F800B02DD194F85E3294F85522534069 -:1078B000DB0726D44821204609F0D2FDE2E7042E5A -:1078C000E8D13B4A13780133DBB2012B1370D9D8CE -:1078D0008046D4E90232DB0843EA427383F00102B6 -:1078E00002F001025FFA82FA3146204682F001027C -:1078F000FFF738FBE0B11BF0D7F9B0FA80F56D095E -:1079000030E094F861321BB1294AD3880133D38027 -:107910002046FFF789FA80462046FFF701FBB4F8BE -:1079200060238246D9F808102046FFF729FC10B1E1 -:107930001BF0B0F916E086BB94F85C32032B2CD117 -:10794000BBF1050F29D194F87633012B25D194F89A -:1079500085330D2B21D1204611F0E6FCE8B11BF058 -:1079600099F93546124A20465388BAF1000F18BFDC -:1079700001335380FFF7F4FA94F85C324246032B4C -:1079800008BF0023394608BF84F8803320462B46C1 -:1079900001B0BDE8F04FFFF7B3BBBAF1000F98D0CC -:1079A00001229FE7EC4D0021B43A0021BDCAE28CD0 -:1079B000580C0021B0F806222DE9F8430446B0F82F -:1079C000CA51B0F80A92B0F80482B0F8827240F25C -:1079D000E240013292B2531B9BB209FB03F34343D3 -:1079E000D4F8D001A4F8CA211844C4F8D001B4F8DE -:1079F000AA03A84218BFC4F8D431B4F8A433A4F839 -:107A00000A32B4F8A633A4F80432B4F8A83303EB6E -:107A100083035B00A4F8823209BB40F2E243B4F86E -:107A2000A26394F8A0535E435D43B4F8C811701983 -:107A300001F05AFAD4F8D031C4F8CC513344C4F828 -:107A4000D031E3691E44236A361A03442362D4F812 -:107A5000E030E6611D4405EB4005C4F8E05019F044 -:107A6000030118BF012109EB99030B44B4F88212FA -:107A700004F5217019441CF086F9B4F80A324B451C -:107A800007D1B4F80432434503D1B4F88232BB4283 -:107A900005D0D4F8883343F40063C4F88833012355 -:107AA00084F87E33002384F8D831BDE8F883437826 -:107AB000032B11D190F87F332BB190F8800300385D -:107AC00018BF0120704790F876333BB1D0F86C02B4 -:107AD000B0FA80F0400970470020704701207047DD -:107AE00070B5446A2046FFF7E2FF18B1BDE8704068 -:107AF0001BF0D0B81C4B1B684BB19B693BB11B4AB8 -:107B000010681B4A201AC010504380B298470025C5 -:107B1000184BB4F84603A4F8DA5184F8DC51C4F8E1 -:107B2000E0511D805D800AF0FBFA06460028DDD09A -:107B3000114B1B683BB194F8A52022B194F8A72003 -:107B400052B1012A0CD0B4F846133046BDE870405B -:107B5000063189B2F3F738BBD4E9B6019847F2E7AA -:107B60002946B4F80602F9E7B83A0021B43A0021F0 -:107B7000BDCAE28C600C0021A03A002170470000D1 -:107B80002DE9F74F446A064694F8D931C76A83B3A2 -:107B90001DF032FF05460146B068B4F80A821BF0BA -:107BA000B1F818B340F2E2432946B06803FB08F885 -:107BB0001BF0A8F8804519D22946B0681BF0A2F83E -:107BC000414619F0FDFFB4F806321B1AA4F806323C -:107BD00094F8453253B994F80F3294F80E22434387 -:107BE0009A42D9B279D3521A84F80E22002384F82B -:107BF000D93197F8B03084F80C3294F81A34012B4C -:107C00000BD194F80D3213B1802384F80C3294F820 -:107C10001934002B73D0012B7ED094F8DB317BB16B -:107C2000D4F8E031C4F8D031B4F806320133A4F806 -:107C3000CA31002384F89532C4F8CC31C4F8D43169 -:107C400094F8942294F8DC31002A6AD113B994F89C -:107C5000DA313BB3237CB4F882123E2B08BF0823F1 -:107C600004F5217008BF23741CF08DF8314B9B691B -:107C7000DD0503F4807112D4D4F8182422F07F4279 -:107C800022F0FF02B2F5803F09D103F400430B4319 -:107C900005D04FF47A7104F204401CF074F801230B -:107CA00084F89432D4F83C343BB1234A1068234A18 -:107CB000201AC010504380B298472046FFF7F7FEC5 -:107CC00000283FD020464C2109F0CAFB04F5217062 -:107CD00003B0BDE8F04F1CF05CB89B1A2532521A75 -:107CE000252BD2B280D94DF668514B435B0D03EB87 -:107CF000C30103EB8103134484F80E3276E7D4F812 -:107D0000203494F90C229B1AC4F8203494F81E34C1 -:107D1000013384F81E3480E7094B20461B689847DE -:107D20007BE7002BBED0B4F8821204F521701CF062 -:107D30002AF8B7E720500021B43A0021BDCAE28CEE -:107D4000803A0021B84B1B684BB1DB693BB1B74AA5 -:107D50001068B74A201AC010504380B29847B4F850 -:107D60008233B3F5807F06D101234021204684F879 -:107D7000823309F075FB94F8693363B1002384F80A -:107D8000693394F86A33002B40F08381A94B1B6858 -:107D90000BB12046984794F885330B2B0DD1204624 -:107DA00011F049F948B1B4F80622B4F8AA339A425E -:107DB00003D101212046FFF7FDFD94F84533002B48 -:107DC00049D0D4F8F031002B45D0D4F8E411B06894 -:107DD0001AF098FFD4F8E83198423CD9D4F8F01161 -:107DE000B0681AF08FFFD4F8EC31984230D2B36803 -:107DF0002A20C4F8E4311BF0ADFD014640B38B4BA3 -:107E00008B4A1B68DFF830E2E31ADB105343038030 -:107E100046F601330022438000F1040CC2F1200534 -:107E2000DEE90E38A2F12000D34008FA05F528FA61 -:107E300000F02B430343D80754BF03230023013230 -:107E4000252A0CF8013BE9D17C4B187B1BF093FDF4 -:107E50000023C4F8F03194F8F4332BB3B4F8FA23C8 -:107E6000B4F806329A421FD894F87633E3B9042066 -:107E70001BF070FD014668B16C4B6D4A1B68E31A3C -:107E8000DB105343038046F6015343806B4B187B52 -:107E90001BF071FDB4F8F633002B00F0FC80B4F851 -:107EA00006221344A4F8FA33B4F80682B4F8CA31AF -:107EB00008F10108A8EB0308614B1FFA88F81D6858 -:107EC000002D40F0EB80B4F8049294F8D9319BBBBC -:107ED000E368D90030D5B4F804326BB394F8883431 -:107EE00053BB94F8D8313BB394F8DC3123B304F599 -:107EF0001B701BF0EFFEF8B16378032B1CD094F8D5 -:107F00008533FF2B00F0F3800B2B40F0D980204607 -:107F100011F091F8002800F0D380B4F8AA33B4F837 -:107F200006229B1A9DB209F10102954200F3DF80FF -:107F3000012B13DD023DADB285B1B4F8063294F8E1 -:107F400045222B44A4F806323E4B691EA844204625 -:107F500053F8223089B21FFA88F898474FF0030986 -:107F600040F2E24BB4F8063208F101080133A4F8FC -:107F70000632B4F80A321FFA88F808FB03F3D4F883 -:107F8000D401B4F8C8110BFB030000F0ADFFB4F846 -:107F90000A5282461AF0B0FE08FB05F50BFB05F508 -:107FA00095284FEA550B40F2A4801AF0A5FEABEBE2 -:107FB000000050457FF686AED4F8D0312B44A3EBB9 -:107FC0000A03B360D4F8CC31756103F59B73534455 -:107FD000F360D4F8CC0100EB4A00C7F8980094F89D -:107FE00085530B2D40F087800023B4F806223376AA -:107FF000B4F8AA33511C994202D1022184F8951297 -:108000009A4203D100212046FFF7D4FC94F8452280 -:108010000C4B002153F8223020469847787094F892 -:108020009532022B2BD00FE0B83A0021B43A002150 -:10803000BDCAE28C943A00212050002168500021F2 -:10804000083A00210C3A0021B4F80632B4F8CA21EB -:1080500001339B1A4FF47A7240F2E240D9B2B4F87D -:1080600082325343B4F80A224243B3FBF2F34A1C70 -:10807000DBB29A4240F0D780012384F89532304633 -:108080006B491AF0CDFF00283FF46AAF03B0BDE89A -:10809000F08F684B7BE684F8F43305E7664B0122EA -:1080A00019885B882046194489B2A847B4F804921D -:1080B000B4F85E34054603FB09091FFA89F904E7A1 -:1080C00094F88533B4F80622012B06D194F87C335A -:1080D000012B02D1B4F8D03323E740F60173B4F892 -:1080E000841399427FF43AAFB4F8DC3319E74D4674 -:1080F00022E796205BE701239D4233760FD1B4F847 -:108100000622B4F8D0339A4280D1D4E9F223204633 -:10811000C4E9862309F04FF884F87E5376E70F2DE3 -:108120007FF474AFB4F80622B4F8DC339A427FF4DB -:108130006DAF94F85430022B03D0032B14BF0123EE -:10814000042394F85550022D03D0032D14BF0125AC -:10815000042594F8DB13A9B3994233D002294FF0D8 -:1081600001035DD0042952D0194684F85430CB1A4B -:10817000234493F95002D4F888337E2843F4004313 -:108180000A4684F84A00C4F888331BD12B4B22449A -:108190001B68032993F9283084F84A3082F84F325B -:1081A000D4F8342308BF84F8533252070AD5244A3E -:1081B000D2F800A0BAF1000F04D0012220460092AC -:1081C0000022D04794F8DA337BB1AB420DD0022BBA -:1081D00003D0042B14BF0123032384F85530D4F8B3 -:1081E000883343F40043C4F88833012304F24E314A -:1081F00084F87E33204609F094FD04F24631A4F859 -:108200006003204609F08DFDA4F85E03FEE694F8B5 -:1082100056300321013B18BF012384F85490A6E790 -:1082200084F85410A3E79942FFF429AF022324E70E -:10823000A9160201903A0021600C0021DC4D0021BA -:108240009C3A00210023426AA2F8DA3182F8DC313C -:10825000C2F8E031024A13805380FFF791BC00BF9F -:10826000600C002151B90122436A83F8802393F8FE -:1082700059321BB1024A138801331380704700BF83 -:10828000600C00212DE9F047446A0F4694F87E33D4 -:10829000164684F80D22ABB1002384F87E3394F89F -:1082A0008533012B0AD16E4B1B683BB16D4A1068B8 -:1082B0006D4A201AC010504380B298476E21204664 -:1082C00009F0CEF8022E04D13846BDE8F04709F097 -:1082D0002FBF2046FFF7EBFB054618B906F0FD035C -:1082E000012B02D11AF0D6FCEEE794F8DB3163B92A -:1082F00026B1A368180308D4042E06D1D4F8F430AC -:10830000C4F8E031012384F8DB31394604F51770F5 -:108310000EF082FA17F80090002E4FD1012384F856 -:10832000DA6184F8DC3194F861321BB14F4A53882A -:108330000133538094F882334BB994F85C32032BA9 -:1083400005D0A3689A0544BF012384F883332046EF -:10835000FEF76AFD80462046FEF7E2FD94F8D8312C -:108360001BB910B1012384F8D8319EBB94F85C325C -:10837000032B2FD1B9F1060F2CD194F87633012BB2 -:1083800028D194F885330D2B24D1204611F0EAF939 -:1083900000B31AF07FFC35462046FEF7E1FD94F865 -:1083A0005C324246032B04BF002384F880333946F5 -:1083B0002B462046BDE8F047FEF7A2BE042E13D19F -:1083C00094F8DA310133DBB2012B84F8DA3189D841 -:1083D0004FF00008012231462046FEF7C3FD8146DA -:1083E00080B91AF057FCD7E7062E9CD194F85E327C -:1083F00094F855225340D90795D44821204609F0D6 -:108400002FF86FE7B4F88233B3F5807F09D1A36802 -:108410009B0506D594F85432032B04BF002384F83F -:1084200083331AF041FC0028B6D1042E05D094F80D -:108430005F3213B994F8575285B1494694F8540005 -:10844000D4F8F45019F094FEB4F86023294602449D -:108450002046FEF795FEB0FA80F56D09EDB29BE778 -:10846000EC4D0021B43A0021BDCAE28C600C002121 -:108470002DE9F84F174E054696F898301BB3164A6B -:10848000002714684FF4956240F2E249B6F8803054 -:10849000DFF848B002FB0344D4F81C8004F1140A4E -:1084A000594650461AF0BCFD013760B9B4F806329F -:1084B000B4F80A220133A4F80632BBB2534309FBD5 -:1084C0000383E361ECE728466E62BDE8F84FF8F7F6 -:1084D00093BD00BFD03A0021B43A0021A916020191 -:1084E0002DE9F04FC46A0F4694F8F40087B00028D5 -:1084F00000F08B80D4F89C00002800F08680D4F82F -:10850000D430564DDFF8588103930830D4E938232E -:10851000D8F800A0B5F880B094F8F1901BF0BEF840 -:1085200094F8F23085F8533295F841309A0740F1CB -:108530008B8094F8F030012B6AD1384610F8086B24 -:108540001BF0A6F80B0A03F0C003402BCDE9040191 -:108550004FEAD61673D104ABC5E91E0194F8F300B7 -:108560000093D4E93A23F3F7ADFDDDE90423D4F811 -:108570009C0002301BF092F885F852624FF495632C -:1085800003FB0BAA3749D4F89C000DF001F9039BBB -:10859000D8F8001003EBC909AAEB0101324BC9104E -:1085A00040F2E24659430023BAF80A0209F5E569A8 -:1085B0004A4670430093C9B21AF074F92B4BBAF8CB -:1085C0000A12A0FB0332DB0F43EA4203B3FBF1F2D2 -:1085D00001FB1233D4F89C204E439375D4F89C20B1 -:1085E000C3F30724D475A5F87030B0FBF6F306FB8F -:1085F00013004844CAF81C0095F85102012828D1FC -:108600003B789B0625D585F8850007B0BDE8F08F3F -:10861000D4E92223CDE9042304ABD4F8846094F890 -:10862000F3000093D4E93A23F3F73DFD28B1DDE9E7 -:1086300004230126C5E91E2397E7C6F3400600225E -:108640000023C5E91E2390E700220023C5E91E236D -:1086500094E70023012085F88530D6E7D03A002141 -:10866000B43A0021203D0021BDCAE28CE3361A0055 -:10867000012208B5034B83F898201AF00BFB002069 -:1086800008BD00BFD03A00212DE9F0410446D0F8E2 -:10869000305100F582771AF02FFB636E628BC4F8BD -:1086A0000C31238B00F2CC409342C4F8100113D05C -:1086B00040F271235A43D5F8D810084490420BD2A7 -:1086C00038461AF073FD38B1616ED4F80C011AF017 -:1086D00019FBC5F8D80012E0002395F8CB10687894 -:1086E000C5F8D83000F02CFE6870268B628B96425D -:1086F00007D138461AF040FCD4F80C316366BDE867 -:10870000F08140F2712808FB06F608FB0268D4F8F5 -:108710000C31424633443146384663661AF046FD12 -:108720000028D1D1636EC4F80C31F0E7406A0368C9 -:1087300090F8002123F07F4323F0FF036BB190F802 -:1087400001310133DBB280F8013112B1012B01D8C4 -:1087500070472BB103210AF081BE0AB9FFF794BF1D -:108760007047406A036823F07F4323F0FF0313B18F -:1087700003210AF073BE80F80031FFF785BF0000C7 -:108780002DE9F047436A06465A7822B393F8005120 -:108790000DBB134A40F2E24814684FF49562B3F8F7 -:1087A0006030DFF840A002FB0344E76904F11409DC -:1087B000514648461AF034FC013560B9B4F8063227 -:1087C000B4F80A220133A4F80632ABB2534308FBD3 -:1087D0000373E361ECE73046BDE8F047FFF7A6BF5F -:1087E000B43A0021A91602012DE9F047436A054673 -:1087F0005A7812B3134A002614684FF4956240F277 -:10880000E248B3F86030DFF840A002FB0344E769B8 -:1088100004F11409514648461AF002FC013660B9C9 -:10882000B4F80632B4F80A220133A4F80632B3B21F -:10883000534308FB0373E361ECE72846BDE8F047C8 -:10884000FFF78FBFB43A0021A9160201012208B533 -:10885000436A5A701AF01EFA002008BD2DE9F04F45 -:10886000C46A456A94F8F120DFF8749187B08846AD -:10887000607B94F8CD100232D9F800A0B5F860B052 -:10888000D4F8D46019F087FC039094F8F400002821 -:1088900000F08280D4F89C0000287DD0D4E93823F1 -:1088A00008301AF0FBFE94F8F23085F8D33095F8D2 -:1088B0006B309B0740F18F8094F8F030012B6ED124 -:1088C000404610F8087B1AF0E3FECDE90401C5E943 -:1088D0001601090A01F0C00140294FEAD71707D154 -:1088E00004AB94F8F3000093D4E93A23F3F7EAFBDE -:1088F000DDE90423D4F89C0002301AF0CFFE85F89D -:10890000D2704FF4956303FB0BAA364B05F1D001EF -:108910009B6A0027C3F3803385F8D130D4F89C00DC -:108920000CF036FF40F2E24C039BD9F8001006F53C -:10893000DB661E44AAEB01012B4BC9105943B5F865 -:1089400062003B4600973246C9B20CFB00F019F0BA -:10895000A9FF2649A0FB0113C90F41EA4301D4F83E -:108960009C3030449975D4F89C30C1F30722DA75F5 -:10897000A5F85010CAF81C00012095F8D130012B41 -:1089800004BF98F80070C7F3401785F86970237B1F -:1089900085F8680085F86C3007B0BDE8F08FD4E941 -:1089A0002223CDE9042304ABD4F8847094F8F300B7 -:1089B0000093D4E93A23F3F776FB28B1DDE90423E9 -:1089C0000127C5E9162393E700220023C7F34007D8 -:1089D000C5E916238CE700220023C5E9162390E79A -:1089E000B43A002120500021BDCAE28CE3361A00BF -:1089F00037B5044668460D460CF056FF9DF800302A -:108A0000072B05D029462046FFF728FF03B030BDCD -:108A10000020FBE7F0B587B0C46A456A064602A8A5 -:108A20000F460CF041FF9DF80830072B36D100238C -:108A3000BA1C85F8A2300DF1070105F1A0000CF079 -:108A400021FD9DF80730DB0628D5D5F8C41004A811 -:108A50000CF072FD9DF81630012B1AD0022B1FD09E -:108A60000023F36094F8F12094F8CD100232607B7B -:108A7000D4F8D46019F08FFBD4F8D420331804A9AB -:108A8000284601F06DF995F800313BB11AF002F972 -:108A900004E0064B9B6A13F4807FE1D107B0F0BD80 -:108AA000024B9B6A13F4006FF7E700BF20500021D0 -:108AB0002DE9F0478EB0446AC56A074604A80E4601 -:108AC0000CF0F2FE0DF10F01321804F1A0000CF0D1 -:108AD000D9FC94F8A130D90704D4002630460EB052 -:108AE000BDE8F0879DF80F6016F00106F5D09DF8FF -:108AF0001030F96A8DF8303094F8A23080318DF85A -:108B00003130D4E92A23CDE908239DF8123008A892 -:108B10008DF83230D4E92C23CDE90A239DF81330A7 -:108B200000228DF8333005F1C803F2F7DDFF00288D -:108B3000D3D095F8DC30002BCFD0D5F89830002B6F -:108B4000CBD04FF49562DFF85CA1B4F86030DAF86E -:108B5000007095F8BA1002FB03779DF81420687B2B -:108B60000232D5F8C09019F016FBE97B804609F176 -:108B70009609287B09B995F8BA10242219F00BFB45 -:108B8000D5E93223C1448144D5F8980008301AF061 -:108B900085FD95F8DA3084F8D33094F86B309A0775 -:108BA0007AD59DF80F309B075AD5D4E92C131A0AB1 -:108BB00002F0C002402ACDE906139DF8138009D1C6 -:108BC000C4E9161306AB95F8DB000093D5E934230E -:108BD000F3F778FADDE90623D5F8980002301AF0A9 -:108BE0005DFD84F8D28004F1D00104F178000CF02E -:108BF000CFFD6B7B40F2E248032B0CBF0322022225 -:108C0000DAF80010284B791AC9105943002308FBE1 -:108C10000299B7F80A024A4608FB00F00093C9B26D -:108C200019F040FE214BB7F80A22A0FB0331DB0FFD -:108C300043EA4103B3FBF2F108FB02F802FB1133F4 -:108C4000A4F88E30B0FBF8F308FB13004844F86139 -:108C50002B7B84F86C304FF48073A4F868303DE7C8 -:108C6000D5E92223CDE9062306ABD5F8848095F813 -:108C7000DB000093D5E93423F3F715FA28B1DDE9D9 -:108C80000623B046C4E91623A4E700220023C8F354 -:108C90004008C4E916239DE700220023C4E91623F7 -:108CA000A1E700BFB43A0021BDCAE28CE3361A0046 -:108CB000F0B505460E468BB079B3446AC76A02A880 -:108CC0000CF0F2FD0DF10701321804F1A0000CF0D8 -:108CD000D9FB9DF80830E96A8DF8203094F8A2306D -:108CE00080318DF82130D4E92A23CDE904239DF881 -:108CF0000A3004A88DF82230D4E92C23CDE90623CC -:108D00009DF80B3001228DF8233007F1C803F2F7EC -:108D1000EBFE0123637019F0BDFF00200BB0F0BD26 -:108D2000314B2DE97043D3E9024618695D682F4B3A -:108D300068B94FF000084FF00009C3E90E8924B16B -:108D40009A6BFDB942F030029A63BDE87083002C43 -:108D50003ED00FF28C09D9E90089C3E90E89002DB4 -:108D6000EDD0D3E90E2142F0005242F08C029A631A -:108D70001F4A126892F82220012A84BF41F4E07150 -:108D8000D963DCE742F0706141F0700199631849E2 -:108D9000096891F82240012C82BF42F0F85242F05B -:108DA00070029A631EB19A6B42F440029A630028E3 -:108DB000CBD0D3E90E21012C42F47F1242F4406261 -:108DC000C2D941F40F7141F00301C3E90E21BCE7A0 -:108DD0004FF003084FF00009BFE700BFAFF300807A -:108DE000033300C000000000B00C002168500021D7 -:108DF000DC4D00210B4BD3E90801CA0542BF5A6C78 -:108E000042F400725A648A0642BF5A6C42F0400231 -:108E10005A6410F0704F1EBF5A6C42F001025A643F -:108E2000704700BF6850002173B583781D4AFF2B3F -:108E300004461D4E106025D056F8233003B19847E4 -:108E40001A4D2B78E3B11A4B5B7ACBB9F3F77EFC62 -:108E50000124F3F779F81AF06BFB18F009FF154EAF -:108E600056F8243003B198470134142CF8D100236C -:108E700001932B70012301A88DF8063018F0A8FE8D -:108E800002B070BDC37813B90122084B1A700125D6 -:108E900056F825300BB1204698470135142DF7D1EF -:108EA000CEE700BF540D0021B00C0021000D0021C1 -:108EB00020500021040D0021024B53F8203003B153 -:108EC00018477047780C0021002307B58DF8030080 -:108ED0008DF804006846ADF800308DF8023018F0C7 -:108EE00077FE03B05DF804FB0D4BDA6902F0006316 -:108EF000120113D541F2C702A0FB0110A1FB02131E -:108F000002FB003046F6F963C918064B40F1010137 -:108F10001B6893F8290010300844704718467047C2 -:108F200020500021DC4D002108B518F01EFE094B31 -:108F300020F07C42C00E1B5C42EA0363D2074BBFA9 -:108F4000054A064A064807484CBF1A401A401043D3 -:108F500008BD00BF64AE0301F1FD7EFFCEF7FBFD4F -:108F6000310804020E02810008B5FFF7DDFF064A52 -:108F700020F4FF03C00E105C43EAC03020F0007004 -:108F800040F4000008BD00BF44AE0301094970B5BC -:108F900000220D46084C2378934204D85A1C2270B4 -:108FA00045F8230070BD51F8046B8642FAD00132B7 -:108FB000F2E700BF680C0021640C00212DE9F843A2 -:108FC000002705460E463C460D4BDFF83880C3E9C6 -:108FD0000E01DFF8349099F80030BB4202D82046E9 -:108FE000BDE8F88328463146D8F800302CB99847B8 -:108FF0000446013708F10408EDE79847F9E700BF98 -:1090000020500021680C0021640C002190F90030F0 -:1090100090F901201A4490F9023090F903001344AA -:10902000184440F3870070470379032BC1540EBFE7 -:1090300000230133DBB2037143790133437170477D -:10904000022805D0032808D0431E584258417047D3 -:10905000044B986AC0F300207047024B986AC0F333 -:10906000C020704720500021054B9B6ADA054CBF99 -:10907000032001201B0548BF40F00400704700BFDB -:1090800020500021C0780EF00DB9000070B588B0F6 -:1090900005460C460146684616460CF005FC9DF850 -:1090A0000430063BDBB21F2B01D9002042E09DF8C3 -:1090B000002005F10801062AF7D801A050F822F097 -:1090C000DD900101E390010139910101AB900101B3 -:1090D0003D910101AB900101419101010022A27279 -:1090E00002E00123A37200236160237295F8273008 -:1090F000012263722846134902ABF2F707FC0028ED -:10910000D3D0DDE904239DF81B109DF81A00884296 -:1091100005D1DDE90250984208BF954201D041F0E7 -:10912000020104F10C00E1721AF0B8FA01209DF876 -:109130001D30337008B070BD0322D0E70422CEE7A3 -:109140000222CCE7A80E002138B504460025D0F84D -:109150006801C4F8685108B11AF004FCD4F8700131 -:10916000C4F8705118B1BDE838401AF0FBBB38BDE7 -:10917000C20707D4830707D410F0040F0CBF2520C3 -:109180002720704725207047262070477FB55E4C0A -:109190002C22002104F19C0020F0BFFD04F1D0033B -:1091A0004FF4C0720021184620F0B7FD574BC4F8A9 -:1091B000C800C4E92E33564BC4F8C040C4F8B430DC -:1091C000022384F8D030534B534D197A0846FFF7E9 -:1091D000CFFF95F8303084F8D10084F8D2304F4872 -:1091E0004F4B5722C4E9350340F20113A4F8DC3099 -:1091F00094F84230A4F85021DE0748BFA4F8522169 -:109200009A0748BF20234FF02D0648BFC4F85431B9 -:10921000444B3046C4F87831434B84F89B11C4F872 -:109220007C31424B84F89A61C4F88031404BC4F8D9 -:1092300084311AF08FFB94F84030C4F86801012B98 -:1092400004D130461AF086FBC4F8700194F841301E -:10925000DB0750D5D5E90823D4F85411C4E95623C7 -:1092600041F00201C4F85411D4F8543143F0010222 -:10927000C4F8542195F831201AB143F05103C4F8D1 -:10928000543194F84030012B4FF0000339D1CDE92F -:109290000233032384F850320C2384F85432D4F878 -:1092A00054316946C3F34003224884F85232D4E96A -:1092B0005623CDE900230CF099FA0E23C4F86C4133 -:1092C00084F89931002584F8515219F015FD40F2C7 -:1092D0007122E38F00F2CC405343C4F8A800164833 -:1092E000C4F8AC30A4F8985019F046FED4F8A43075 -:1092F000A36304B070BD114BD3E90C23C4E956231A -:10930000B2E7C4F86C31DDE7580D0021F90F010117 -:1093100003000101F850002120500021D6BE898EA3 -:1093200055555500E1100101A11101018112010102 -:10933000911201015A0D0021F40D00216850002105 -:1093400059B10130C0B2282828BF2520A0F125033B -:1093500041FA03F3DB07F4D5704725207047F0B5D9 -:109360008BB004460F4616460021232268461D4650 -:1093700020F0D3FC05238DF80230FF238DF8233035 -:109380004FF6FF733246ADF824300DF10A002B463C -:109390008DF803408DF804408DF809701AF07EF9BD -:1093A000684618F015FC0BB0F0BD38B504460D4604 -:1093B0004822002120F0B1FC84F8405038BD10B59F -:1093C0009DF8084001F0030104F0070443EA8443D8 -:1093D00043EA0143C0E9002310BD10B5BDF81040B9 -:1093E000C3F3080343EA04539DF80C4001F0030162 -:1093F00004F00F0443EA04439DF8084004F01F04FE -:1094000043EAC42343EA4123C0E9002310BDF0B579 -:10941000014690F84000002838D00F4600254FF054 -:10942000010ED1F844C00EFA05F414EA0C0FE8B2AC -:109430003ED0D7E90064A34208BFB24238D191F8C8 -:10944000424084423ED0072D08BF00204FF0010E5D -:109450001CBF0130C0B2A04208D00EFA00F616EAD6 -:109460000C0F14D10EFA05F52CEA050CF4B1013CF1 -:10947000E4B2012000FA04F545EA0C054D6401EB65 -:10948000C40581F8424041F834206B60F0BD0728E4 -:1094900001EBC00601EBC505D6E90067C5E9006729 -:1094A0000CBF0026461C05463046D4E70724E0E7FB -:1094B0000135082D07F10807B5D10123002081F8F7 -:1094C0004130E3E70120E1E790F8401030B591B179 -:1094D00090F84210456C79B10139C9B201248C4031 -:1094E00080F842102C4300EBC1014464C1E9002321 -:1094F000002380F8413030BD0721EFE730B5044646 -:1095000085B0C57A0C301AF0C3F80B46A17A024632 -:10951000009129460E4D02A8FFF751FFDDE9022315 -:1095200005F14800FFF773FF78B9DDE9022305F183 -:109530004800FFF7C9FF95F82430012B05D14FF4FF -:1095400000332046236018F043FB05B030BD00BF58 -:10955000580D00214FF418720021014820F0DDBBA6 -:10956000580D002108B50C4A0C4B9A600C4B0D4A63 -:109570009A600D4B0D4A1A620D4A5A62FFF7EAFFD4 -:109580000C4B1B681B79072B81BF0B4A136A43F0F6 -:109590008003136208BD00BFBD950101040D0021C9 -:1095A000B00C002185900101780C00210996010181 -:1095B00049960101DC4D00216850002108B5EFF704 -:1095C00099FFFFF7C7FFBDE8084018F08BBD00000A -:1095D00008B51AF077F9044A537A01335372BDE89B -:1095E00008401AF07BB900BFF850002108B51AF006 -:1095F00069F9044A537A013B5372BDE808401AF0F6 -:109600006DB900BFF850002130B50E4D89B0284625 -:109610000DF102011AF0BEF9044608B909B030BDD7 -:109620000DF1030201A9FFF731FD28B1FF2301A8C5 -:109630008DF81630FFF762FF20461AF093F9FFF716 -:10964000D5FFE4E7800D002130B5144D89B02846E0 -:109650000DF102011AF09EF9044608B909B030BDB7 -:109660000DF1030201A9FFF711FD88B101238DF867 -:109670001630A368CDF81730A389ADF81B309DF8DC -:10968000033013B1FF238DF8163001A8FFF736FF22 -:1096900020461AF067F9FFF7A9FFD8E7880D0021E7 -:1096A000034B93F82400003818BF0120704700BF17 -:1096B000580D0021034B53F820301878003818BF9C -:1096C000012070478CAE0301024B1878431E5842AC -:1096D00058417047C036002130B5CB6A04461B782C -:1096E0000846092B25D142F210754A6AD2F8E431B6 -:1096F000D2F8D0236A43B2EB430F1AD3616AD1F890 -:10970000E421D1F8D0136943B1EB420F12D30A49D7 -:10971000A3FB0135A2FB0121DB0FD20F43EA450376 -:1097200042EA4102B2EB930F03D3B3EB920F38BF7F -:10973000204630BD2046FCE7E3361A002DE9F04113 -:10974000C6780546022E83783D4C20D162780132DE -:109750006270721E012A22D9A3F1FF0043424341E5 -:109760002A88FF2A1DD0E3B923781341D90705D5EC -:10977000344B314653F822000DF0B2FDEB78013B3B -:10978000052B5AD8DFE803F01D3C4459594C052EEF -:1097900003D0062E08BF0126DBE70226D9E7012306 -:1097A000DEE70027DFF89C8023783B41DB0704D508 -:1097B000314658F827000DF093FD0137032FF3D100 -:1097C000DCE70023297920486172C91A18BF0121FA -:1097D0006370FFF7EAFD1D481AF0DBFA1C481AF027 -:1097E000D8FAA968EB68A165E36531B317481AF0A8 -:1097F000CAFAE16D09B3BDE8F04115481AF0C3BAE1 -:1098000012481AF0C6FABDE8F04111481AF0C1BA80 -:10981000637893B9E36D83B9BDE8F04118F066BB96 -:10982000637A022B03D101210748FFF7BEFDA16D2A -:1098300006481AF0A8FAE16DDDE7BDE8F08100BF47 -:10984000481400218CAE030158140021A8140021F3 -:10985000B8140021024B1860C0780DF057BD00BF4E -:109860001C370021024B1860C0780DF069BD00BFA5 -:109870001C370021F0F7CEBA2DE9F04389B018F07B -:109880006BFA002800F08B8000242646464FDFF854 -:109890001C813B782341DB0715D558F8245095F8F7 -:1098A0006430022B05D105F1400018F02BFB85F840 -:1098B000646095F83C30022B05D105F1180018F0D2 -:1098C00021FB85F83C600134032CE2D14FF0000805 -:1098D000374C4FF48565A1464646364F05FB089345 -:1098E00093F82430022B50D1A379002B49D104F1F5 -:1098F000100018F00CFB94F88A32002B41D094F839 -:1099000089322C2B3DD13222A4EB0903DB107B439F -:109910009BB2ADF80430ADF8083094F8963201A847 -:109920008DF80A3094F89732ADF806208DF80B3098 -:10993000B4F89432ADF80C3094F898328DF80E30BB -:1099400094F8A0328DF80F3094F8A8328DF81030CA -:10995000B4F8AA32ADF81230D4F8B0320593B4F8A6 -:10996000B432ADF8183094F8C0328DF81A3094F84B -:10997000D0328DF81B3094F8D1328DF81C3018F0AD -:1099800027F905FB089383F8246008F10108B8F172 -:10999000060F04F58564A1D109B0BDE8F08309B0D4 -:1099A000BDE8F043FFF730BEB80F00218CAE0301D5 -:1099B000D01D00214DF833E10E4B70B5186083784F -:1099C0000446FF2B0C4D09D00388C1784FF4856005 -:1099D00000FB0350BDE870400DF0CCBC00262846CB -:1099E000E17801360DF0C6FC062E05F58565F6D149 -:1099F00070BD00BF1C370021D01D00212DE9FF41A3 -:109A0000044600F5827700F59C7530220021384627 -:109A100020F083F900214FF4C072284620F07DF930 -:109A2000754B764EC4F82031754BC4F83051C4E9FB -:109A30004934D4F81C31307A03F47F42714B724DB3 -:109A40001343C4F81C31022384F83831FFF790FB2C -:109A500095F8303084F8390184F83A316B486C4B12 -:109A6000D722C4E94F03237C4220022B14BF40F2CB -:109A7000011340F20333A4F84431A37BA4F8B821C6 -:109A8000D90748BFA4F8BA219A0748BFD4F8BC3117 -:109A900084F8020244BF43F02003C4F8BC31337A97 -:109AA00084F803325B4BC4F8E0315B4BC4F8E4311B -:109AB0005A4BC4F8F4315A4BC4F8F831594BC4F836 -:109AC000FC3119F047FFC4F8D001002852D0564BA2 -:109AD000C4F8E831637BDB074ED5D5E90823D4F819 -:109AE000BC11C4E9702341F00201C4F8BC11D4F8E0 -:109AF000BC3143F00102C4F8BC2195F831201AB101 -:109B000043F05103C4F8BC31237B012B4FF0000319 -:109B100038D1CDE90233032384F8D0300C2384F804 -:109B2000D430D4F8BC316946C3F3400384F8D23052 -:109B300004F17A00D4E97023CDE900230BF056FE3E -:109B400004F17803C4F8D4310E2384F80132374B82 -:109B5000C4F8EC31237B012B17D1272019F0FAFE32 -:109B60000546C4F8D80180B9D4F8D00119F0FAFE3E -:109B7000C4F8D0511F2036E02D4BD3E90C23C4E9A3 -:109B80007023B4E7C4F8D431E1E719F0B5F840F236 -:109B900071226389267C5343C4F814310023022EBA -:109BA00018BF1E460125DFF88C806370A37098F8FB -:109BB000003000F2CC40B540C4F810016DB2ABB932 -:109BC000384619F0D9F9D4F80C3188F8016063608F -:109BD00098F802302B43002088F8023098F80030C3 -:109BE0001D4388F8005004B0BDE8F08198F80230B9 -:109BF00023EA0503EFE700BF3D270101F8500021EC -:109C0000AD2701010300010120500021D6BE898E3D -:109C10005555550065260101F11A0101B31A0101DC -:109C20004D990001F9990001912601019526010144 -:109C300068500021B80F002138B53022044600F5E5 -:109C40003A75002100F52E7020F067F84FF4C072CD -:109C50000021284620F061F8022384F8D032012345 -:109C600084F8D232344B8021C4E9B5330623334A19 -:109C700084F8E83292F83030314884F8EA32314BD7 -:109C8000C4F8E452C4E9BB03A37BA4F86813DD075E -:109C900048BFA4F86A13990748BFD4F86C33C4F8D6 -:109CA000DC4244BF43F02003C4F86C33002384F843 -:109CB000A033254BC4F88433244BC4F88833637B2A -:109CC000DB0733D5D2E90801D4F86C33C4E9DC01F1 -:109CD00043F00203C4F86C33D4F86C3392F83120AB -:109CE00043F00101C4F86C131AB143F05103C4F8F6 -:109CF0006C33237B0020012B09BF04F17803002380 -:109D0000C4F880330E2314BFC4F8803384F898332A -:109D10000F4B6070C4F88C330E4BA070C4F89033B6 -:109D20000D4B84F80001C4F8943338BD0B4BD3E9D4 -:109D30000C01C4E9DC01CFE7B92701012050002163 -:109D4000D6BE898E55555500191E010129200101E5 -:109D50008D22010181230101652401016850002148 -:109D6000F8B5044688790D460130C0B21746FFF7B2 -:109D700067F900284AD02B7884F8E93294F8A230A9 -:109D80005B0644BF94F8BD3084F8EA32AB79012B0E -:109D90003DD0022B14BF0123032384F8F53284F84D -:109DA000F432AB78AE88002B0CBF1E234FF49673B1 -:109DB0005E4318F095FF6B78012BAB780CBF322116 -:109DC0004FF4FA71002B0CBF1E234FF4967301441D -:109DD000F018FFF789F8AB78361A002B0CBF1E235A -:109DE0004FF4967304F52E7503EB400037440021C1 -:109DF000C4F89C03C4F8C072284618F05FFA18F043 -:109E00007BFFB04205D9012384F86834F8BD0223F2 -:109E1000C3E70021284619F003F90028F6D00123F2 -:109E200084F80031F2E7000070B580220021194863 -:109E30001FF073FF0024184D184E55F8043B53B122 -:109E40004FF48E62002118461FF067FF56F8242059 -:109E50000474C0F89C200134032CEED10122104B75 -:109E600010491A730868104B496803C3094B40F244 -:109E700007511A700D4AA3F86610127B83F86C2004 -:109E800083F87C2040F20762A3F876200022084B7A -:109E90001A7070BD481400218CAE0301A81D00216A -:109EA0002050002184AE0301D0140021685000210D -:109EB000B80F002108B5094A094BDA61094B0A4A73 -:109EC000DA610A4B0A4A1A620A4B0B4A1A60FFF718 -:109ED000ABFF4FF48E62094B5A8208BD019F01010E -:109EE000040D0021B00C00213D970101780C0021E8 -:109EF00079980101E44D0021B596010168500021D7 -:109F000008B5EFF7F7FAEFF765FFBDE80840FFF790 -:109F10008BBF00002DE9F04104460D460026DFF816 -:109F20004080104F19F010FD3B6801361B8C032E4A -:109F300048F8040B1844F5D10026DFF82C8019F0FE -:109F400003FD3B6801361B8C062E48F8040B1844B1 -:109F5000F5D1001BA84288BF0020BDE8F08100BFFA -:109F6000A81D0021DC4D0021B41D002170B50B4B54 -:109F70005C7C44B90A4E0B4D33782341DB0704D493 -:109F80000134032CF8D1012006E055F82430587B29 -:109F900017F0BEFE0028F3D170BD00BF2050002195 -:109FA000481400218CAE03010123034A834010783A -:109FB00018431070704700BF481400210123034A62 -:109FC0008340107820EA0300107070474814002185 -:109FD00010B5064C54F820001C8804815C8844812C -:109FE0001B7941730373827310BD00BF8CAE0301F4 -:109FF00038B5044604200D4619F0ACFC014668B1A2 -:10A0000054B1237C0B8007238B70054BCD70187BDC -:10A01000BDE8384019F0AFBCFF23F3E738BD00BFFF -:10A020006850002138B5054604200C4619F092FC12 -:10A03000014640B16B7AC4708370034B187BBDE856 -:10A04000384019F098BC38BD6850002138B5044636 -:10A0500004200D4619F07EFC014670B10748084BFC -:10A06000241AE4105C430D238B70064B0C80CD70DA -:10A07000187BBDE8384019F07EBC38BDD01D0021EA -:10A080004DF833E168500021024B1878B0FA80F0A7 -:10A0900040097047C0360021F0B500250C4C2678E9 -:10A0A0006EB194F8D863864209D194F8D9638E4290 -:10A0B00005D1D4E9F8769E4208BF974206D0013513 -:10A0C000062D04F58564EAD10020F0BD0120FCE7EF -:10A0D000D01D00210022094BDA62094B094ADA62DD -:10A0E000094A0A4B1A600A4B1B681B79082B81BF6F -:10A0F000084A136A43F4005313627047040D0021A9 -:10A10000B00C002155980101C99601011C50002195 -:10A11000DC4D0021685000210022084B1A63084AD8 -:10A12000084B1A63084B1B681B79092B81BF074A30 -:10A13000136A43F000731362704700BF040D0021DF -:10A1400065980101B00C0021DC4D00216850002110 -:10A15000094B0A4A5A630A4A0A4B5A630A4B1B685C -:10A160001B79082B094B82BF1A6A42F400521A620B -:10A170004FF48562DA827047040D00217598010161 -:10A18000B9990101B00C0021DC4D0021685000217B -:10A19000302238B50021044600F1600510441FF05C -:10A1A000BCFD4FF4C072002128461FF0B6FD01230C -:10A1B00084F8483084F84A30094B0020E364094BA6 -:10A1C000E565C4E91434092384F86030064BA070B7 -:10A1D000C4F8F830054B84F85B03C4F8FC3038BD94 -:10A1E000FD270101D5290101E1290101B12D01015D -:10A1F0002DE9F84FDFF858911546D9F820409B46D5 -:10A20000D2E90223C4E9E423012304F56478064675 -:10A2100084F8BE3340460F4617F0AAFD6B694046EE -:10A2200083EA1343A4F8C033B4F8E01101F00AF84C -:10A2300084F8610096F8A2305B0644BF96F8BD3002 -:10A2400084F862306B696366AB69A366BB79012BE6 -:10A2500076D0022B14BF0123032384F86D3084F8D9 -:10A260006C304FF41611AA78EE78002A0CBF1E222B -:10A270004FF496724E432B8802FB036606EB0B03EA -:10A28000C4F8F831B4F8E031A4F8FC31287C08F0C7 -:10A2900089FAAB780746002B0CBF1E204FF496704E -:10A2A00039463044FEF720FEAB78361A002B0CBF3F -:10A2B0001E234FF49673B6F5967F03EB4000C4F867 -:10A2C0000001C4F8F40140D35E44A66301220021DA -:10A2D00094F86D0017F05FFF0026D4F8E431DFF842 -:10A2E00074B004F1300AE063C4F8F00163645946C5 -:10A2F000504618F095FE013620BBB4F8E0114046F8 -:10A30000013189B2A4F8E01100F09CFFD4F8E431E7 -:10A31000B5B25D4384F8610039462846FEF7E4FD96 -:10A32000D4F8F831D4F8F0211D44D4F8F4312D1AC2 -:10A33000024403EB4003A563E263C4F80031D6E7AF -:10A3400002238AE7012389F80130BDE8F88F00BFB6 -:10A35000C0360021D9960101B34B2DE9F04F1E689C -:10A360004FF49563DFF8C4A203FB0066DAF81040EF -:10A3700087B004F13003049396F87033012B40F05A -:10A380002B81A3710A22B6F87433A94F5343C4F842 -:10A390006C33B6F8723304F5647BA4F868333B7C05 -:10A3A000584684F8E831D7E90223C4E9E4230123BD -:10A3B00084F8BE33F3F7F4F97B69FD7883EA13423E -:10A3C0006366BB69A4F8C023A36694F82034BAF886 -:10A3D000061084F86D3084F86C30BB783046002B62 -:10A3E0004FF416130CBF4FF01E094FF496795D43DE -:10A3F000B7F8008007F0FAF9B6F8061205443046BF -:10A4000007F0F4F947F6FE73BAF806C0B6F806226C -:10A4100009FB0858ACEB020189B299428146BD8B19 -:10A42000D4F8E401B6F80A3200F2E68040F2E242E3 -:10A430005943336A02FB0133B3FBF0F3494603FB94 -:10A440001080ED1AADB218F05DFC94F82134039041 -:10A45000012BA4F8E05140F0E1800022D4F824342C -:10A460001A61D4F82434997C6940584600F0EAFE19 -:10A470003A7C704B062A98BF33F812709AF80C2079 -:10A4800088BFDF89062A94BF33F81220DA8984F85E -:10A490006100059218F024FCBAF80E1047F6FE7A17 -:10A4A0006D1AADB2554588BF0025D4F8E411804639 -:10A4B00001FB05F301933B18194601980293FEF73F -:10A4C00013FD5A49054608894989059A401A80B200 -:10A4D000504588BF0020B6F80A1240F2E2464843D1 -:10A4E00008EB02017043FEF7FFFC059A01371744A1 -:10A4F0004744394682462818FEF7F6FC4C4B00F1DB -:10A5000010029B780398002B0CBF1E234FF4967308 -:10A5100003EB42034844C4F80031C4F8F431B4F802 -:10A52000E031C4F8F801801AA4F8FC31A4F8FE3137 -:10A53000A0630021049817F0C1FE4FF00009E36BFF -:10A540004D46C4F8F03194F82134012B05BF94F83E -:10A55000F93294F8F8220023534304BFD4F8E421DD -:10A5600006FB13234E4603933349049818F058FD15 -:10A57000002840F0AB8094F82134002B5ED1B4F871 -:10A58000E0115846013189B2A4F8E01100F05AFEFA -:10A590000136D4F8E431B6B203FB06F8DDE9013147 -:10A5A00084F8610003EB0800FEF79EFC3946504436 -:10A5B000FEF79AFCD4F8F83110309844A8EB000369 -:10A5C000A363D4F8F0310344E363D4F8F43103EB2C -:10A5D0004000C4F80001C7E7032B7FF4D3AE01238A -:10A5E00040F6FF71E37104F21E2204F5007323F8B4 -:10A5F000021B9A42FBD1C5E640F2E241A2EB0C02FB -:10A6000092B25A43336A01FB0233B3FBF0F30133D6 -:10A610001D44494603FB0080ADB214E7002B7FF4D4 -:10A6200020AF294621E700BFB43A0021E8360021D7 -:10A6300020370021C0AE0301D9960101D4F82424AB -:10A640000135937CADB20133DBB2937494F8F81208 -:10A6500003F07F03994207D19074B4F8E03109F117 -:10A6600001090133A4F8E03194F8F982039A05FB5B -:10A6700008F302FB09F840F2E24202FB0388DDE93D -:10A68000013103EB0800FEF72FFC39465044FEF77A -:10A690002BFCD4F8F8311030A8EB00084344A36336 -:10A6A000D4F8F0310344E363D4F8F43103EB400011 -:10A6B000D4F82434C4F80001997CB4F8E031584649 -:10A6C000594000F0BFFD84F861004DE707B0BDE8D8 -:10A6D000F08F00BF00234FF48562184610B505497E -:10A6E00002FB03F4645C0CB10130C0B20133062BF1 -:10A6F000F6D110BDD01D002105289FBF4FF4856302 -:10A700005843024B185C88BF00207047D01D0021C1 -:10A710002DE9F0414FF485630025DFF8BC8003FB91 -:10A7200005F616F8087006EB0804002F4ED14FF41A -:10A730008562394620461FF0F0FA01232370274B2B -:10A7400053F82530A362264B1B7B84F8D43306F5DF -:10A75000737323F8085003EB080240F20D43538053 -:10A7600040F20113A4F86C301E4B06F500769B7D79 -:10A77000464484F8203440F6FF7301370F2F26F843 -:10A78000023BFAD14FF48563002103FB0588164B89 -:10A79000A8F858131B6888F85A131B790C2B12D988 -:10A7A000124B53F8250070B14FF44C72C8F82404D2 -:10A7B0001FF0B3FA0E4AD8F8243452F82520DA658F -:10A7C000012283F860202046BDE8F0810135062D86 -:10A7D000A5D10024F7E700BFD01D0021B41D002142 -:10A7E00068500021B4500021DC4D002104370021C5 -:10A7F000BC0F0021052807D84FF48562044B02FBEB -:10A800000030D0E9E401704700200021704700BF0C -:10A81000D01D002170B588B00C46064615460021B3 -:10A820001E2268461FF079FA26238DF80230214B4C -:10A830008DF804605A889B88ADF80620ADF8083082 -:10A840001D4B1E4AE31ADB105343ADF80A30B4F82F -:10A85000D8331B4AADF80C3094F820348DF81430FE -:10A86000D4F8E431A3FB0232DB0F43EA4203ADF834 -:10A87000163094F8E8318DF818300DB194F8F8528C -:10A8800094F8F9320DF10E008DF81A3094F8FA327E -:10A890008DF819508DF81B3094F8FB328DF81C3070 -:10A8A000D4E9F82318F0FAFE684617F091F908B0D9 -:10A8B00070BD00BFE8360021D01D00214DF833E106 -:10A8C000E3361A0010B54FF48564CA43054B02F015 -:10A8D000010204FB0030827112B9C1F34001C17161 -:10A8E00010BD00BFD01D002105280DD84FF4856292 -:10A8F000064B02FB0030D0F8E431A0F8681359434E -:10A90000C0F8EC110120704700207047D01D0021D5 -:10A91000F0B500260027164D89B028460DF1070135 -:10A9200019F038F8044608B909B0F0BD4FF4A8137F -:10A93000D4E906C0D4E90212904208BF8C450293C4 -:10A94000237CCDE904C0CDE906678DF80C3002D137 -:10A950002078984205D0CDE9061243F002038DF825 -:10A960000C3002A817F034F9204618F0FBFFD4E7AA -:10A9700074390021C0780CF015BD0000044B93F829 -:10A98000143230EA030301D10AF060BB704700BF04 -:10A99000683700212DE9F04F04460D4600200021C4 -:10A9A000DFF8A4B01F4602F0FD0385B0012B164668 -:10A9B000DDE90E89CBE91C01DDF840A08BF86A3097 -:10A9C0003AD122494A7C002A36D0AB70D1E908231B -:10A9D000CAE900230023CB73B30711D502AB009360 -:10A9E00042464B463846F1F75EFB48B10123AB7057 -:10A9F000DDE90223CAE90023CBE91C238BF86A6056 -:10AA0000DAE90023C4E92223AB782BB1D4F88430EF -:10AA100043F00203C4F88430D4F88420C4E92489C4 -:10AA200042F00103C4F884301FB142F00902C4F8B7 -:10AA3000842005B0BDE8F08F0023AB70044BD3E950 -:10AA40000C23CAE90023C7E7405100212050002110 -:10AA50006850002113B50446069B10460093DDE9BB -:10AA60000423F1F73AFB074B93F83120D4F88430F4 -:10AA70002AB143F04003C4F8843002B010BD23F083 -:10AA80004003F8E72050002100232DE9F0418B4FCF -:10AA90008AB004938DF81430BB6A894D5C042E7C17 -:10AAA00006D5042E01D0012E02D801238DF81130D5 -:10AAB0002C22844C0021A0181FF02FF904F1600310 -:10AAC0004FF4C072184600211FF027F97E4B022276 -:10AAD000C4E91233032384F8603097F83030A0655E -:10AAE00084F8623079487A4B84F844200122C4E922 -:10AAF000190340F20113964284F84620A4F86C3002 -:10AB000010D0042E0ED095F82130D90744BF08226A -:10AB1000A4F8E2209A0742BFB4F8E23043F02003E1 -:10AB2000A4F8E23095F8203084F81331BB695B0457 -:10AB300009D517F01AF80323B0FBF3F303EB430333 -:10AB4000C01A84F812012B7C042B77D8DFE803F0BD -:10AB50000379878C820000238DF810302823A4F815 -:10AB6000E03006AB5B48029304A9D5E90623CDE9A2 -:10AB70000023AB7C6A7CFFF70DFF00220023CDE9A8 -:10AB8000082308AB0293697CD5E906235148CDE937 -:10AB90000023AA7CFFF75EFF2B7C4F4E012B67D072 -:10ABA000042B65D04D4B30460093DDE906230AF0B7 -:10ABB00003FE00238DF81400064485F84830414810 -:10ABC00004A90AF0E5FD2B7C361B022B84F81061EA -:10ABD000C4F8F84001D9042B69D1414A13F0FD08AB -:10ABE000C4F8FC203F4AC4F808213F4AC4F80C21AD -:10ABF00060D104233D4F8DF8103095F8683004A9DA -:10AC0000063338468DF814300AF0C2FD384B3E1832 -:10AC100030460093DDE906230AF0F6FD0644F61BF4 -:10AC200085F86980C4F8007184F811610021314809 -:10AC3000218517F043FB2F4818F09EF90AB0BDE8B4 -:10AC4000F081002340F6A662C5E902322A4A84F860 -:10AC500012312A6001238DF8103020237FE706236C -:10AC60008DF8103008237AE702238DF8103078E74A -:10AC7000DDE9087057EA000CD5E906231CBF03463E -:10AC80003A46A97C18BF0121CDE90023DDE906235E -:10AC900011488DF813100AF09EFDD4F8E4308DF8B9 -:10ACA000140043F004030644C4F8E43087E70023AB -:10ACB000C4F8FC300023C4F80031B7E7205000216D -:10ACC000405100216837002199300101D6BE898E9C -:10ACD00055555500C83700216A37002168510021B9 -:10ACE00044370021D12F0101153001014C390021D9 -:10ACF0008951002194370021008813000022024B63 -:10AD0000C3F8FC20704700BF683700214FF406727B -:10AD1000002101481FF001B868370021054B064AA1 -:10AD20001A61064B064A1A61064B074A9A62FFF7F8 -:10AD3000EDBF00BF040D00214DAD0101B00C00219D -:10AD400075A90101780C002111A9010108B5EFF7DF -:10AD50007BFAFFF7DBFFBDE8084017F0EDB90138DB -:10AD6000032807D8DFE800F004020402022070473D -:10AD70000120704700207047030203F00F3300F0FA -:10AD8000F0300343180100F0333003F0CC331843A4 -:10AD9000830003F0553300F0AA301843C009704710 -:10ADA00040F6E8335843094BA0F53E501B68203865 -:10ADB000034493F88821012A06D1D3F89C0121B1DC -:10ADC000D3F8A0310B60704700207047C0390021D4 -:10ADD0002DE9F04705460E460024134FDFF84C805E -:10ADE000DFF84C903B685FFA84FA1B7B534502D82E -:10ADF0000020BDE8F0875046D8F800309847012879 -:10AE00000ED1102018F0A6FD014658B10E23C0E95E -:10AE10000256A0F800A0438099F80C0018F0ABFD92 -:10AE20000134DFE70C20E4E7DC4D0021E84D002190 -:10AE30006850002113B5094C20460DF1030118F0AC -:10AE4000A9FD019018B9FFF763FD02B010BD01A87C -:10AE500016F0BEFE019818F085FDEDE7B43900212B -:10AE600038B505460C4616F080FE2A46214618F0F5 -:10AE700021FC80B238BD00002DE9F047099F8046D3 -:10AE80000C4691469A469DF82050042A1FD8DFE8C8 -:10AE900002F00317032050000B7AC3B940F272602E -:10AEA000524A098812682944128A824228BF0246FF -:10AEB000914205DD0726238023723046BDE8F087E6 -:10AEC00098F80260002E40F08F80002D3BD11226B2 -:10AED000F3E78378012B75D14D752FB12A4639469A -:10AEE00004F118001EF0F2FE29463846FFF7B8FFBD -:10AEF0000123E08284F813A1237508F50664204637 -:10AF000018F09EFA08B90026D7E798F8C53B63B158 -:10AF100008F52165284618F093FA0028F3D098F830 -:10AF2000C53B13B1284618F053FA204618F050FAE2 -:10AF3000E9E78378002BCAD0002DC8D10B88002BFD -:10AF4000C5D0294646E0B9F1040FB6D801A353F89D -:10AF500029F000BF69AF010187AF01019BAF01017B -:10AF6000C5AF010143AF010137B1238860682A46AC -:10AF7000394618441EF0AAFE002321884E46294473 -:10AF80002180237299E727B12A46394660681EF06E -:10AF90009DFE0023258023728FE737B120886368E8 -:10AFA0002A46394618441EF091FE238829462B4430 -:10AFB00023803846FFF754FF0123A8F8400084F8A7 -:10AFC0000CA0E8E727B12A46394660681EF07EFEED -:10AFD000A9B221803846FFF743FF0123A8F84000BB -:10AFE00084F80CA023728EE70C2666E7DC4D002166 -:10AFF000002310B5037090F8DD3B0446012B03D10C -:10B00000054B1B6803B1984704F5717018F0C1FE39 -:10B01000BDE8104016F054BEC4390021014600229C -:10B0200030B50A4B1B681C7B094B1B68944201D846 -:10B03000002030BD5D7818468D4202D11D78002D6C -:10B04000F7D1013203F6E833F0E700BFDC4D002111 -:10B05000C039002138B583780446FF2B1AD0007818 -:10B06000FFF7DCFFA8B10D4BE1781C60BDE838406C -:10B070000CF0E8B9E0B2FFF7D1FF28B14FF49C72B1 -:10B08000002150301EF049FE01342B681B7B9C428E -:10B09000F0D338BD0024024DF7E700BFBC390021D2 -:10B0A000DC4D0021134B2DE9F041186083780446F4 -:10B0B000FF2B18D00078FFF7B1FF90B1E178BDE821 -:10B0C000F0410CF08DB908FB05F33A68D018D35C59 -:10B0D00013B1E1780CF084F9013533681B7BAB4286 -:10B0E000F1D8BDE8F081002540F6E838024E034F64 -:10B0F000F3E700BFC8390021DC4D0021C039002131 -:10B1000008B5FFF78BFF30B140F20113B0F88801AA -:10B11000C31A5842584108BD134B2DE9F04118603D -:10B1200083780446FF2B18D00078FFF777FF90B1A3 -:10B13000E178BDE8F0410CF06BB908FB05F33A6823 -:10B14000D018D35C13B1E1780CF062F901353368A3 -:10B150001B7BAB42F1D8BDE8F081002540F6E83812 -:10B16000024E034FF3E700BFCC390021DC4D002134 -:10B17000C039002110B50C46FFF750FF50B180F8E0 -:10B18000DC4B008C10F0100003D00020024B83F841 -:10B19000144210BD4220FCE768370021F8B5044690 -:10B1A0004DF66856114D07F043FA94F8C43B84F805 -:10B1B000DC03034406FB03F2520D02EBC20102EB77 -:10B1C00081029B1ADBB2C3F12000D5E90E27A3F15F -:10B1D000200184F8C43B07FA00F022FA03F303438A -:10B1E00027FA01F10B43DB07DDD5F8BD2050002124 -:10B1F000F8B504464DF66856114D07F019FA94F863 -:10B200004D3384F84C03034406FB03F2520D02EB6A -:10B21000C20102EB81029B1ADBB2C3F12000D5E927 -:10B220000E27A3F1200184F84D3307FA00F022FA2B -:10B2300003F3034327FA01F10B43DB07DDD5F8BD28 -:10B2400020500021028E70B5044682EA0100FFF70B -:10B2500093FD00EB0010104480B2FFF78DFD00EB72 -:10B260000010104480B2FFF787FD4DF6685300EBE5 -:10B27000001011184A4091B24B43D4E900265B0DEF -:10B2800003EBC30003EB8003CB1A9BB2C3F1200591 -:10B29000A3F12000DA4006FA05F526FA00F02A4369 -:10B2A0000243D20757BF94F82D00D8B2484304EBAD -:10B2B000104058BF007A70BDF8B504460D46D0F86E -:10B2C0006C6817F019FDB0F5967F2CD917F014FDB6 -:10B2D0001F4F3B689A8AA36C9A422CBFB618F61887 -:10B2E00006441C48B04228BF304616F0C3FF94F80D -:10B2F00034360646D3B994F84C10284616F0DEFFD3 -:10B30000D4F8E023D4F86838AB608AB93B682846A3 -:10B31000D98AA26A314417F049FFC0B9AB68A26A62 -:10B320001344AB60F2E74FF49670D1E70021E4E7F5 -:10B330003B682846D98AD4F8E023314417F0C4FF8B -:10B3400028B9AB68D4F8E0231344AB60F0E7F8BD4C -:10B35000DC4D0021D47E250038B590F83436044603 -:10B360000D46F3B990F84C10284616F0A7FF94F854 -:10B370003E2082B142F21073616A01FB02330A4A35 -:10B38000934228BF1346D4F86C289A422CBFC4F8C5 -:10B39000E023C4F8E03329462046BDE83840FFF7F3 -:10B3A0008BBF0021E0E700BFD47E250070B500F51B -:10B3B0002165044600F524663022002128461EF04F -:10B3C000ACFC4FF4C072002130461EF0A6FC0123F5 -:10B3D00084F8283A84F82A3A234B94F84500C4F8B4 -:10B3E0002C3AC4F8303A04F65203C4F8383A07232A -:10B3F00084F8403A94F8C43BC4F83C6A84F8413A73 -:10B4000094F93C30C4F8344A7F2B08BF174B04F240 -:10B410004D4208BF93F93030294684F8423A144B24 -:10B42000C4F8443A134BC4F8483A94F83F3084F8CF -:10B430004C3A84F84D3AFFF792FC0F4B84F84E0AD1 -:10B44000C4F8143B002384F84F0AA4F8323620468F -:10B45000C4F8DC2AC4F8E83AC4F80C3BC4F8002B62 -:10B46000BDE87040FFF778BF453B01012050002147 -:10B47000D6BE898E55555500B132010140F6E832ED -:10B48000044B00211B681B7B5A43034B18681EF0BA -:10B4900044BC00BFDC4D0021C039002108B5134A6F -:10B4A000134B14491A62144B144A15481A62154A70 -:10B4B0009162154A9A63FDF769FD144B144A1A60AC -:10B4C000144B1B68187908280BD9134B0C28D3E9A7 -:10B4D000082142F4805286BF41F48071C3E90821FB -:10B4E0001A62BDE80840FFF7C9BF00BF1DB50101E2 -:10B4F000040D002135AE0101B00C0021A5B0010101 -:10B50000D1AD0101780C002155B001011850002186 -:10B5100075B10101DC4D00216850002108B5EEF73E -:10B5200093FEEFF7E9F8BDE80840FFF7A7BF00007A -:10B530002DE9F04105460C4618F006FA40F6E832CF -:10B540000027184B184E18603368DFF860801B7BAB -:10B5500002FB030033681B7BBB4210D80027DFF8D7 -:10B56000508033681B7BBB4212D8401BA0429BBF5C -:10B5700040F6E8320F4B00201A82BDE8F08118F047 -:10B58000E3F9336848F8040B1B8A01371844E1E7F4 -:10B5900018F0DAF9336848F8040B1B8A01371844AD -:10B5A000DFE700BFC0390021DC4D002184390021D4 -:10B5B0009C3900216850002110B50C4678B10878FC -:10B5C000FFF72CFD60B1038C03F01D031D2B09D187 -:10B5D0006388013B9BB2802B34BF0020122010BD3A -:10B5E0004220FCE70020FAE708B5FFF717FD70B32B -:10B5F00090F830366BB390F8443753B3038C03F0B4 -:10B600001202022A02D1B0F8502812B390F8392061 -:10B6100002F0FD02012A01D10279E2B103F0110228 -:10B62000112A03D1B0F852281F2A14D803F00503B9 -:10B63000052B06D1B0F85238F02B34BF0020122071 -:10B6400008BD012B09D1B0F85238F62BF5E742209E -:10B65000F6E70C20F4E71220F2E70020F0E708B547 -:10B66000FFF7DCFC003818BF012008BD10B5C0B2E0 -:10B670000C46FFF7D3FC30B190F93C001AF0E6FA23 -:10B680002070002010BD4220FCE700000023F0B530 -:10B690001A4640F6E8370A4D0A4E2968097B994256 -:10B6A00001D8D0B2F0BD07FB03F1346804EB010C04 -:10B6B000615C19B19CF80110815401320133ECE74F -:10B6C000DC4D0021C039002170B50D46FFF7A6FC06 -:10B6D0000446D8B1038CDA0701D58378C3B928466C -:10B6E00017F0D6FF01F44043B3F5404F06460D4630 -:10B6F00001D00B040ED418F0E5F80123C4E902656B -:10B700002371E37018F0EAF8002070BD4220FCE7D6 -:10B710000C20FAE71220F8E7F0B506460D460020A7 -:10B72000002192F839C02A4F0CF0FD03012B14467A -:10B73000C7E91C0185B087F86A3040D11279002A28 -:10B740003DD0B370D4E90223C4E904230023E3709D -:10B750001CF0020F14D002AB009394F83A00D4E925 -:10B760000C23F0F7A0FC58B10123B37094F8391002 -:10B77000DDE90223C4E90423C7E91C2387F86A1022 -:10B78000D4E90423C5E92223B3782BB1D5F884305A -:10B7900043F00203C5F88430D5F8841041F001036A -:10B7A000C5F88430D4E90C23C5E9242394F83A3051 -:10B7B0001BB141F00901C5F8841005B0F0BD0023AC -:10B7C000B370044BD3E90C23C4E90423C0E700BFE2 -:10B7D00040510021685000212DE9F04306461446EF -:10B7E00092F83A000D46F070D2E90C23C4E9062322 -:10B7F000164985B091F8311021B394F839108907B2 -:10B800001AD54FF000084FF0000902AF0097CDE9BC -:10B810000289F0F739FC30B9D4E90C2394F83A00E6 -:10B820000097F0F75AFCDDE9022352EA03011EBF3C -:10B830000121F170C4E90623D5F8843043F04003B8 -:10B84000C5F8843005B0BDE8F08300BF205000216A -:10B850002DE9F84380460D46FFF7E0FB044600283B -:10B860006BD10646DFF8CC91D9F800301A7B724BC9 -:10B870001B68964203D307263046BDE8F8831C4672 -:10B88000277803F6E833002F55D140F6E8323946E1 -:10B8900020461EF042FA012384F801802370D9F873 -:10B8A0000020927C84F830369A4238BF1A4684F8D9 -:10B8B000443784F81C35614B84F84C201B7B604A6C -:10B8C00084F8D0334FF4A16352F82620A4F8C8833B -:10B8D000C4F82C26C4F840275A4AA4F8CA3352F8B0 -:10B8E0002620C4F8182516F0E3F9A678002E40F0BB -:10B8F0009E80B7B1238CDB0613D594F83D2604F265 -:10B900003E61A4F85228D4F82C061EF0DFF994F812 -:10B910005127D4F84007A4F8502804F252711EF0C1 -:10B92000D5F92B88D80621D4D90708D5B4F85038D2 -:10B9300053B11226A0E701369BE70127D5E79A0706 -:10B94000F4D5B4F85238F3E7B4F85228022194F849 -:10B950003F0016F020FC40F27122AB6800F51C504D -:10B9600053431030834220D2452685E7B4F852284D -:10B97000002F55D0238CDB0652D41F2AD9D8B4F817 -:10B9800050381F2BD5D8D4F82C1684F83D2604F255 -:10B990003E601EF09BF9B4F85028D4F8401784F8A4 -:10B9A000512704F252701EF091F994F889212B88E6 -:10B9B000012A02D113F03B0FBBD140F271216A681A -:10B9C0002384AB684A434B436262A3622B7B84F8B7 -:10B9D00038306B7B84F83930AB7B84F83A30286997 -:10B9E00017F056FEC4E90C012B7D84F83B306B7DCB -:10B9F00084F83C30AB7D84F83D30EB7D84F83E30FC -:10BA00002B7E84F83F306B7E84F84230AB7E84F826 -:10BA10004330EB7E84F844302B7F84F845302BE7AD -:10BA20001F2A86D8B4F850381F2BBED981E70C26C0 -:10BA300022E700BFDC4D0021C03900216850002101 -:10BA4000843900219C39002108B5FFF7E7FA10B1CD -:10BA5000D0E9DA0108BD00200021FBE7F0B585B090 -:10BA60000D46FFF7DBFA044600283AD090F88931FA -:10BA7000012B38D01F4B00271B689E8A836C9E4287 -:10BA800038BF1E461C4BB6B21B6843B398470246EC -:10BA900094F83F00022303970127CDE90173B4F81E -:10BAA000143500210093334616F08BFB40F2E2413F -:10BAB0006B884B43834218D3208C10F03B0016D187 -:10BAC0002A884A43C4E9D623AB8884F86273A4F871 -:10BAD000603384F8DD0BC4F8E40B05B0F0BD3A46E2 -:10BAE000D6E74220F9E70C20F7E74520F5E71220DA -:10BAF000F3E700BFDC4D0021803900212DE9F04F34 -:10BB000085B0884615461E46FFF788FA0446002889 -:10BB100000F0D08090F862331BB90C2005B0BDE86E -:10BB2000F08FA8F10303012B06D90DB91220F5E718 -:10BB300090F88931002BF0D1DFF87C91D9F80030F2 -:10BB4000B3F814B0A36C9B4538BF9B4694F8893179 -:10BB50001FFA8BFB23B3D4F850A3584B1A680AB1D1 -:10BB60009047024618F0FD014FF0020394F83F00A1 -:10BB7000AFB218D1CDE9023101230193B4F81435E5 -:10BB80003B449BB200935B4616F01BFB504521D80B -:10BB9000B8F1040FCAD8DFE808F00D1F0D2D4700DB -:10BBA000D4F85CA3D9E70021CDE902310123CDE926 -:10BBB0000073E8E794F81C35002BB7D1D9F80010D2 -:10BBC000B4F81425098A2A448A4205DDA4F81435FC -:10BBD00084F81C354520A1E794F88831002B9CD1CE -:10BBE000002DA3D0B8F1040F19D8DFE808F03244D3 -:10BBF0004B5A2A0094F88881B8F1010F51D12A4696 -:10BC0000314684F8295504F22C501EF05FF839466D -:10BC10003046FFF725F984F82885A4F82A05012382 -:10BC2000002084F8203579E794F88831002B3FF420 -:10BC30007DAF002D7FF47AAFB4F81435002B3FF4BC -:10BC400075AF39463046FFF70BF90123A4F85603C8 -:10BC50000EE0B4F81435D4F818052A4618443146D5 -:10BC60001EF034F8B4F814351F440023A4F81475FA -:10BC700084F81C35D3E72A463146D4F818051EF05F -:10BC800025F8F2E7B4F81435D4F818052A46184414 -:10BC900031461EF01BF8B4F814353B44A4F81435B3 -:10BCA000CFE72A463146D4F818051EF00FF8A4F85D -:10BCB0001475C6E7422031E7DC4D002180390021B0 -:10BCC0008A07F8B506460D46C1F3400708D5234B51 -:10BCD000DB6ADB0604D41121BDE8F84016F093B905 -:10BCE0003046FFF79BF9044610B942213046F3E78E -:10BCF00090F862334BB115F0010502D090F81C3575 -:10BD00001BB1238C03F03B030BB10C21EEE70420A5 -:10BD100084F8547317F01EFE014648B10A2383705D -:10BD2000C5F10203C3700E4B0680187B17F023FE8B -:10BD300094F8DD3B012B10D1042017F00BFE0146D7 -:10BD400058B10E23C5F105058370054B0680C570FB -:10BD5000187BBDE8F84017F00EBEF8BD205000215A -:10BD60006850002170B50646FFF758F9044678B1CF -:10BD700085787DB990F88931012B0BD0D0F8D83B6C -:10BD80000BB1304698472046FFF732F9284670BD80 -:10BD90004225FBE70C25F9E70022F8B5134D144EB8 -:10BDA0002B68197B3368914208D8002440F6E837A5 -:10BDB0002B681B7BA3420CD80020F8BD987890B963 -:10BDC00003F6E833A3F65F20007801280BD0013298 -:10BDD000E9E707FB04F33268D018D35C0BB1FFF737 -:10BDE00007F90134E4E70C20E7E700BFDC4D002150 -:10BDF000C039002138B50D46FFF710F9044630B1BF -:10BE000017F060FDA56417F069FD002038BD4220E1 -:10BE1000FCE738B50D46FFF701F9044658B16B1E33 -:10BE2000DBB2FA2B09D817F04DFD84F84C5017F00F -:10BE300055FD002038BD4220FCE71220FAE770B51E -:10BE40000E461546FFF7EAF8044648B117F03AFDEA -:10BE500084F89F6884F84F5A17F040FD002070BDA9 -:10BE60004220FCE738B5054604200C4617F072FD69 -:10BE7000014650B16B78C470038008238370034B74 -:10BE8000187BBDE8384017F076BD38BD68500021FA -:10BE900070B500F52165044600F5246630220021C6 -:10BEA00028461DF03AFF4FF4C072002130461DF0C5 -:10BEB00034FF022384F8283A012384F82A3A3B4BC2 -:10BEC00094F84500C4F82C3AC4F8303A04F50563F8 -:10BED000C4F8383A072384F8403A94F8C43BC4F8CD -:10BEE0003C6A84F8413A94F93C30C4F8344A7F2BD8 -:10BEF00004BF2F4B93F9303084F8423A2D4BC4F8ED -:10BF0000443A2D4BC4F8483A94F83F3084F84C3A00 -:10BF100084F84D3AFEF723FF0823228C84F84E0A5A -:10BF200084F84F0A5007C4F8C03A07D4910705D5E2 -:10BF300094F83B20D20748BFA4F8C23A002304F289 -:10BF40004D411A462046A4F83236C4F8DC1A0AF0ED -:10BF50000FFAA4F8D80A122017F0FCFCF0B1174B26 -:10BF60000430C4F80C3B164BC4F8E80AC4F8103B84 -:10BF70000023A4F8463704F28F43C4F8F03AC4F81B -:10BF8000003B104A94F8C43B29462046C4F8142BC1 -:10BF900084F8413ABDE87040FFF7DEB91F23042161 -:10BFA000204684F8D633FFF75DFFE1E7453B01010A -:10BFB00020500021D6BE898E5555550015350101FA -:10BFC000953501018534010170B500F52165044600 -:10BFD00000F524663022002128461DF09EFE4FF415 -:10BFE000C072002130461DF098FE022384F8283AE2 -:10BFF000012384F82A3A3B4B94F84500C4F82C3AC4 -:10C00000C4F8303A04F65203C4F8383A072384F8E7 -:10C01000403A94F8C43BC4F83C6A84F8413A94F935 -:10C020003C30C4F8344A7F2B04BF2F4B93F9303097 -:10C0300084F8423A2D4BC4F8443A2D4BC4F8483AA0 -:10C0400094F83F3084F84C3A84F84D3AFEF787FE76 -:10C050002023228C84F84E0A84F84F0A5007C4F833 -:10C06000C03A07D4D10705D594F83B20920748BFC2 -:10C07000A4F8C23A002304F24D41A4F83236204617 -:10C08000C4F8DC1A04F5C5620AF072F9D4F82C364B -:10C09000A4F8D80AC4F8E43AB4F852382820A4F82E -:10C0A000E03A17F057FCA8B1124B0430C4F8E80A84 -:10C0B000C4F80C3B04F28F41C4F8F01A2046002269 -:10C0C0000AF012FA2946A4F8EC0A2046BDE87040AE -:10C0D000FFF742B91F230421204684F8D633FFF727 -:10C0E000C1FEE7E7453B010120500021D6BE898E05 -:10C0F0005555550005360101F8B500F506660446AC -:10C1000000F5096730220D46304600211DF005FE7E -:10C110004FF4C072002138461DF0FFFD01220323B9 -:10C1200084F87A28804A94F93C10C4F87C287F4A25 -:10C1300084F87838C4F8802884F890387C4A7D4B9D -:10C140007F2993F97B3008BF92F93010C4F88C78BE -:10C150008B42A8BF0B4684F89238774B94F8440082 -:10C16000C4F89438754BC4F88448C4F8983894F8E7 -:10C170003D3084F89C3884F89D38FEF7F0FD282384 -:10C18000C4F81039238C84F89E085F0784F89F0850 -:10C1900000F18D80980706D594F83B10C90744BF7D -:10C1A0000821A4F81219DB0709D594F83B309F0742 -:10C1B00005D5B4F8123943F02003A4F8123994F8E5 -:10C1C000383084F843395E4BC4F8343993695804E5 -:10C1D00003F4804272D515F0C8FC00F0030084F827 -:10C1E0004209238C04F5797713F0100269D003F02B -:10C1F0001D031D2B0DD1002384F84239636240F6E4 -:10C20000A6634FF47A72A3624E4B1B685B6853437C -:10C21000E362394620460AF0B7F9238C84F84009D6 -:10C22000D906C4F828791CD59A071AD0282017F007 -:10C2300091FB002876D0444B0430C4F83839434B86 -:10C24000C4F82C09C4F83C39238C9B0709D504F2A7 -:10C250002647394620460AF00DFAC4F8307984F8AA -:10C2600041092046FEF79AFFD4F8D8332BB10021BC -:10C27000204694F8C42B09F0E7FC0021304616F064 -:10C280001DF8304B1B685B6803B319F0B5FB07461C -:10C2900016F032FD4FF47A723844C4F86808002171 -:10C2A00030466A4316F082FF98B9122029E0D4F88C -:10C2B000143943F00403C4F8143980E784F84229A0 -:10C2C0008FE73946204609F0B3FFA6E7304616F05F -:10C2D00053FED4F8D803A0B1258C05F00305012D39 -:10C2E00014D0022D0ED0002DDFD12046FFF75EF8CE -:10C2F000012384F8C53B3046D4F86818F6F7B6FF3A -:10C300000020F8BD2046FFF7C3FDF1E7104B1B6886 -:10C3100093F82230002BC8D02046FFF755FE84F852 -:10C32000C55BE8E71F20ECE749380101393B010113 -:10C330002050002140510021D6BE898E5555550010 -:10C340006D320101C83900212D3701018D370101FE -:10C35000DC4D002138B5054604200C4617F0FAFAEA -:10C36000014650B16B78C47003800A238370034B7D -:10C37000187BBDE8384017F0FEBA38BD6850002180 -:10C3800000220D4B9A620D4B0D4A9A620D4B0E4ADC -:10C390001A600E4B1B68187908280CD90C4B0B2817 -:10C3A000D3E9082142F4005201D81A62704741F0E3 -:10C3B0001001C3E908217047040D0021B00C0021D1 -:10C3C00019B10101E84D002101B10101DC4D00214D -:10C3D000685000212DE9F04F00F5CA75044689B078 -:10C3E00000F5E4763022002128461DF096FC4FF43B -:10C3F000C072002130461DF090FC012384F8AC315E -:10C4000084F8AE316F4BC4F8C061C4F8B0316E4BE4 -:10C410000026C4E96D3404F21453C4F8BC3106F0AC -:10C4200007F9082384F8C83194F84D3384F84C0395 -:10C4300084F8C93194F93C30DFF890B17F2B04BF08 -:10C44000634B93F9303084F8CA31D4F88C31C4F896 -:10C45000CC3106F0E7F894F83F30C4F8D00184F806 -:10C46000D43194F8450084F8D531FEF778FC594B67 -:10C4700084F8D601C4F89C3204F2D14384F8D70181 -:10C48000C4F86432C4F8883231462846A4F81E65E0 -:10C4900015F014FFD4F85833A26C0493DBF8003085 -:10C4A000D4F85C939B8A934238BF13464A4A1FFADA -:10C4B00083FA1268002A7AD09047024601274FF08B -:10C4C0000208B4F8141553460091CDE90178002113 -:10C4D00094F83F000396059215F073FEDBF8001008 -:10C4E000059A898B88420CD9B4F8141553460091EB -:10C4F000CDE90286002194F83F00019715F061FE16 -:10C500000146D4F8A0218A4238BF0A464945C4F8FA -:10C51000A0214ED8DFF8C480314FD8F80030E61A99 -:10C52000F610304B7E43029307ABCDE90023049A0B -:10C5300004368A4238BF0A464B460121F0B216F053 -:10C54000FBF8002839D0079BD4F8186AC4F8503398 -:10C55000C4F8A83116B919F04FFA06460023D8F8E6 -:10C5600000103246611AC910794304310093D4F89F -:10C570005003C9B216F096F90027636A984208BFC3 -:10C5800040080644C4F89C610021284616F048FD86 -:10C590000137A0B9B4F89031D4F850230133A4F88E -:10C5A0009031BBB202FB0363C4F89C31ECE7324626 -:10C5B00084E7452009B0BDE8F08F4320FAE700206A -:10C5C000F8E700BF893C01013D3D0101DC4D002140 -:10C5D000205000214933010180390021C039002158 -:10C5E000D53FF54FA1AD010170B504460D46FEF7EC -:10C5F00015FD78B190F8DC3B35EA03030AD14378A6 -:10C60000A34207D1D0E90C23BDE8704090F83A006E -:10C6100008F034BD70BD2DE9F74307460E4691463C -:10C620001D46FEF7FBFCDDF82880044600283FD0BD -:10C63000038CDA061DD425B19B073DD4B0F85038E1 -:10C64000C3BB4B4632462046CDE9005804F5C561D0 -:10C65000FEF712FC032E08D8DFE806F002050205FB -:10C66000B4F852381D44A4F85258D8B103B0BDE80C -:10C67000F083032E20D11F2D1ED880F83D56B8F12F -:10C68000000F05D02A46414600F23E601DF01EFB19 -:10C69000A378012B08BF84F83036012384F83C3698 -:10C6A00084F8343638460121FFF79EFF0020DDE78D -:10C6B0004220DBE70C20D9E71220D7E72DE9F7432A -:10C6C00007460E4691461D46FEF7A8FCDDF8288079 -:10C6D0000446002848D0042E48D0038C9A0701D481 -:10C6E000002D43D1DB0620D41DB9032E05D00C202C -:10C6F00018E0B4F85238002BF9D14B4632462046A8 -:10C70000CDE9005804F23C71FEF7B6FB032E08D8C1 -:10C71000DFE806F002050205B4F850381D44A4F81D -:10C720005058D8B103B0BDE8F083032E1ED11F2DA1 -:10C730001CD884F85157B8F1000F05D02A4641465D -:10C7400004F252701DF0C2FAA378012B08BF84F8DE -:10C750004437012384F8503784F84837384602219B -:10C76000FFF742FF0020DDE74220DBE71220D9E798 -:10C7700008B517F0A7F8044A137801331370BDE821 -:10C78000084017F0ABB800BFDC500021002238B5DC -:10C790000E4B04461B6893F839500D4B18689542B0 -:10C7A00001D800230DE00346197800F5547051B903 -:10C7B0004FF4547218461DF0B0FA0122034602707D -:10C7C0008470184638BD0132E9E700BFDC4D002116 -:10C7D000D03900210146002230B50C4B1B6893F87C -:10C7E00039500B4B1B68954201D8002030BD18789A -:10C7F00038B1D878012804D11C6D14B164788C420A -:10C80000F4D0013203F55473EDE700BFDC4D002195 -:10C81000D03900210146002230B50A4B1B6893F83D -:10C820003940094B1B68944201D8002030BD1D7867 -:10C83000184615B19D788D42F8D0013203F5547336 -:10C84000F1E700BFDC4D0021D039002130B50D4BA0 -:10C8500000221B680C4993F839404FF4856303FBB1 -:10C8600000110A4B1B68944201D8002030BD1D788E -:10C87000184615B11D6D8D42F8D0013203F5547381 -:10C88000F1E700BFDC4D0021D01D0021D03900218F -:10C890000022094B1B6893F83910084B1B68914222 -:10C8A00001D800207047187810B158780128F9D0C5 -:10C8B000013203F55473F2E7DC4D0021D039002139 -:10C8C00070B500251C4E0446336893F83A001B4BA4 -:10C8D0001A68A84201D8002327E01346197802F508 -:10C8E000987239BB4FF4987218461DF016FA01225F -:10C8F00002703168034691F8222091F835104460A7 -:10C900000A442A44428094F83420511CC9B2417030 -:10C91000E578FF205DB983F82C007F2083F8640060 -:10C920000E3284F8341044F82230184670BD83F873 -:10C930002400F5E70135CCE7DC4D0021D439002196 -:10C940000146002230B50A4B1B6893F83A40094B68 -:10C950001B68944201D8002030BD1D78184615B1DF -:10C960005D888D42F8D0013203F59873F1E700BF7E -:10C97000DC4D0021D439002130B50A4B4FF49874B6 -:10C980001B6893F83A20084B1968002318469A420E -:10C9900000D830BD04FB03F54D5D0DB90130C0B2C8 -:10C9A0000133F4E7DC4D0021D439002101EB810390 -:10C9B000C3EBC30303F0010103F12A028B0743EA2F -:10C9C000C27343EA417343EA017343EAC16310B59A -:10C9D00043EA8163C2F34004C2F3801143EA446333 -:10C9E00043EA016343EAC453C2F3401143EA4153AB -:10C9F000C2F3001143EA0153C2F3C00143EA814389 -:10CA0000C2F3800243EA4243584010BD2DE9F04191 -:10CA1000044663680846DB786178012B0CBF0D2360 -:10CA20000C2384F8B0301746FFF7C0FFDDE906237A -:10CA3000C4E91E23012384F8A63080EA104305468A -:10CA4000A4F8A830060C04F178009DF8208015F0B9 -:10CA50008FF96378C4F8B45043EA0723C4F8B830B8 -:10CA6000254B84F8BD8093F8303084F8BC8084F87E -:10CA7000B2300023A4F8BE30636893F83423CAB3FD -:10CA80001E4AC4F80C21D3F83513C4F80411D3F8A6 -:10CA9000391394F80701C4F8081194F8041194F8B4 -:10CAA0000621694084F8041194F80511724081EA66 -:10CAB000152180EA156504F1F40084F8051101469A -:10CAC00084F8062184F8075103F59E7203F5A673D6 -:10CAD00052F8045B9A4241F8045BF9D140F2012319 -:10CAE000A4F81C31064B1B6823B1A1780122BDE8D4 -:10CAF000F0411847BDE8F0812050002101010102FA -:10CB0000743A0021F8B50446002500F1380794F87E -:10CB10003430218CAB4212D80123002204F520705E -:10CB200015F044F9E37884F8B902012B0CBFA36B2C -:10CB3000D4F8903093F8B13084F8F930F8BD57F854 -:10CB4000046B3EB10123002206F1780015F02EF9A6 -:10CB500086F8B1000135DAE72DE9F04104461646C2 -:10CB60001D46002700F1380894F83430BB4208D83D -:10CB7000204632462B46BDE8F041E0E9A02315F0FF -:10CB8000F7B858F8040B28B132462B46E0E91E23CB -:10CB900015F0EEF80137E7E72DE9F04F87B00646CC -:10CBA0008846154607F0A4FB0446D8B9284616F077 -:10CBB000D9FE5B4B9B6A6BB196F8682052B9012095 -:10CBC000B8F80020ADF81000ADF80E200DF10E0100 -:10CBD00004AA9847FFF7CCFD072007B0BDE8F04F47 -:10CBE000FCF772B900234373D6F8049099F81C201F -:10CBF000027398F80320B8F80E709A4214BF0C2202 -:10CC00000822B9F804102A4407818172C3720560B2 -:10CC10004260002F40F0828004A910308DF810701F -:10CC20008DF811708DF812708DF813700AF0F0F90C -:10CC30000123A073E773E3725CE0A17A5F1BBFB2CC -:10CC40008F4228BF0F4699F81E103D44ADB200290F -:10CC50005AD15B1B18BF0123E17A4FF00D0A8DF802 -:10CC600010304FF000038DF811308DF812300AFBB0 -:10CC700001F30DF1100B03F110005946204401920D -:10CC800000938DF813700AF0C3F9009B254A2344E2 -:10CC900098737068E37A90F818C0D0E9081EA1FB79 -:10CCA0000C010CFB0E11C018C6F814B1D2F800B07C -:10CCB00041F10001CDE90401019ABBF1000F25D03B -:10CCC0000AFB03F101F1170310312344214406F15B -:10CCD000F4000092D847009AC0B1E37A0AFB034AF5 -:10CCE00004238AF80F30E37A3A440133E37223894C -:10CCF000AB42A2D8224698F8001006F1080007B00F -:10CD0000BDE8F04F16F031BE0223A5E70D21E37A0E -:10CD100001FB03434FF00001D973E4E71D46E6E74A -:10CD200068500021883A00212DE9F34743681546F1 -:10CD30009A7E80460E4600F1080722B3197E4FF016 -:10CD40000009B6FBF1F44FF0010A4C4304F0FF0474 -:10CD50005FFA89F6314638460DF1070216F029FED2 -:10CD600018B9002002B0BDE8F087D8F8041090F997 -:10CD70000C208B7E63439342F3DB1DD10A7E9B1A0A -:10CD80000373012343734FF0000838460DF1070287 -:10CD90005FFA88F116F00DFE04460028E1D02089E4 -:10CDA000002835D0A17A14F00EFF86420ED3361A31 -:10CDB000F6B208F10108E8E7437B23B90B7E80F85F -:10CDC0000DA0D21A027309F10109C1E794F80AC053 -:10CDD00023890CFB06F29342EBD90D219B1A634584 -:10CDE000A8BF63464E43A019817B2B8163682980CD -:10CDF0001344EB60002306F11001214469606B616C -:10CE0000C37B63B11736344403202B826C61A9E7DE -:10CE1000A37B1034E8602B8001206C60A2E7022025 -:10CE2000A0E7F7B506460F4600F1080537B12846DA -:10CE30000DF1070116F0B7FD044608B903B0F0BDC7 -:10CE4000A17A208914F0BFFEE37A874223BFC2B2E1 -:10CE50009B18BA1ADB1928BFD7B2A27A2CBFDBB253 -:10CE6000DBB2E37202FB03F3228938BF002793424F -:10CE7000DCDB0DF10701284616F08CFD206816F06A -:10CE800071FD204607F03EFAFFF772FC96F8243059 -:10CE9000002BCBD196F86830002BC7D1337C0133FF -:10CEA0003374C3E72DE9F347002581468A461746C8 -:10CEB0002E4600F10808BAF1000F08D0711B404659 -:10CEC0000DF10702C9B216F074FD044610B902B0A4 -:10CED000BDE8F087A17A208914F075FEE37A8245D7 -:10CEE0002ABFC0B253441B18A27A2CBFDBB2DBB2FC -:10CEF000E37202FB03F322892ABFAAEB000A4FF078 -:10CF0000000A5FFA8AFA9342D5DBBE420ED20DF1D7 -:10CF10000701404616F03EFD206816F023FD20462E -:10CF200007F0F0F9FFF724FC0135EDB299F8243051 -:10CF30000136F6B2002BBED199F86830002BBAD179 -:10CF400099F81030013389F81030B4E708B50B3088 -:10CF500016F06EFC00B1083008BD62F07F0201F8E7 -:10CF6000042C5430083916F063BE406D18B10379B3 -:10CF70000830DB090B70704708B5543016F04AFED4 -:10CF800018B1BDE8084016F079BC08BD426D42B149 -:10CF9000137903F07F03013BDBB213710BB9FFF789 -:10CFA000EBBF704708B5084B5B780BB9002008BD94 -:10CFB000064B1B68988D0C3080B216F0CBFC002815 -:10CFC000F4D00A30F3E700BFDC500021DC4D002133 -:10CFD00007B5034690F8680030B10DF1070103F181 -:10CFE000300016F0D7FC03E093F82C20012AF4D986 -:10CFF00003B05DF804FB0A3816F0B4BC13460830E1 -:10D00000A1F10A02194616F0B0BC37B500F10804C8 -:10D010000D4620460DF1070116F0C5FC48B19DF8FC -:10D020000730AB4207D120460DF1070116F0B2FCE4 -:10D030000A3003B030BD0020FBE707B508300DF122 -:10D04000070116F0A7FC00B10A3003B05DF804FB3D -:10D05000002337B5037043680446DB7893B1012B96 -:10D060000CD100F10805284616F034FE38B314340C -:10D0700020460DF1070116F08DFC28BB03B030BD32 -:10D08000FFF7B9FF2046FFF7D8FF0028F8D1104D71 -:10D090002046FFF79DFF40B9636804F11000997FB7 -:10D0A00003B0BDE8304007F0DBBB16F05BFC16F0C8 -:10D0B00009FC6B7801336B7016F010FCE8E7012176 -:10D0C0002046FFF7AEFECEE716F04CFCD0E700BFDF -:10D0D000DC500021F8B500250646044606F8385B0A -:10D0E00094F83430E178AB4208D8012905D104F135 -:10D0F0005405284616F0EEFD80B1F8BD56F8047BC5 -:10D1000047B149B1012902D1788806F091FD38462E -:10D11000FFF79EFF0135E3E70221F5E72046FFF721 -:10D120002BFFE6E70346B0F8680048B9064A1278D4 -:10D1300042B10122D866A3F8682083F870107047C6 -:10D140000C20704707207047DC500021B0F8683091 -:10D150005BB9012280F87010A0F8682080F86A207E -:10D160008365C3650366184670470C20704790F8C6 -:10D1700068200B462AB1583007C883E80700002012 -:10D1800070470C207047000070B50C46054616F03D -:10D19000DBFB4FF498720D4E0D4B1860336893F81B -:10D1A0003A3002FB030016F0CFFB4FF45472094BE8 -:10D1B0001860336893F8393002FB0300401BA0422B -:10D1C0009BBF054B054A0020DA6170BDDC4D002194 -:10D1D000D4390021D039002168500021300150039A -:10D1E0000023F0B500F1380290F83470184687B08B -:10D1F000CDE90033CDE90233CDE904339F4208D8AD -:10D200000F4B9B6A1BB110B1694603AA984707B040 -:10D21000F0BD52F8041B81B191F824406CB90E7C2A -:10D220005EB1B1F802C006AD05EB4005013025F84E -:10D2300018CC25F80C6C0C74C0B20133DEE700BFCB -:10D240006850002130B58DB00546144610230A46BB -:10D250000C48694618F058FA684604A904230A4A9B -:10D2600018F052FA102328460DEB030208A918F013 -:10D270004BFA04232146054A08A818F045FA0DB0D8 -:10D2800030BD00BF98AE0301A8AE0301ACAE0301F0 -:10D2900030B50B790133DBB20B71047EC57E05FB23 -:10D2A00004F2934224DA4A780132D2B2944202D98B -:10D2B0004A70012030BD00248A78013D0132D2B28B -:10D2C000AA424C7001DA8A70F3E78C70827E002AE1 -:10D2D000EFD1447E9C42ECD80A710B780133DBB26B -:10D2E0000B7090F83400984294BF00200120E1E7D1 -:10D2F000CA78013C01324C70CA70427E9A42D8D83A -:10D3000000234B70CB700B71E7E70B78F0B501335E -:10D31000DBB20B7090F834209A422DD800240B79A0 -:10D320000C700133DBB20B71067EC77E4A7807FBB7 -:10D3300006FC01326345457ED2B216DC964201D925 -:10D340004A7006E08A784C700132D2B2974205D911 -:10D350008A70AB422CBF0020012005E08C70807EDB -:10D360000028F6D1AB42F4D3F0BD9642E8D8CA7893 -:10D370004C700132CA70ECE70120F5E708B5FFF701 -:10D3800065FA18B1036D0BB10023036508BD0000F9 -:10D390002DE9F041164B044618608378FF2B1AD113 -:10D3A00000254FF45478134E134F0DE008FB05F39E -:10D3B0003A68D018D35C33B1C37823B98378E17865 -:10D3C00023800AF06FF80135336893F839309D42B5 -:10D3D000ECD3BDE8F081C378032BE1D00078FFF7F0 -:10D3E00019FA0028F5D0E178BDE8F0410AF05AB802 -:10D3F000D8390021DC4D0021D03900212DE9F84336 -:10D400000446FFF745FA064618B10C263046BDE83B -:10D41000F8832078FFF7FEF90028F6D16588062DFD -:10D4200000F282804FF485636B43424F07EB0309A0 -:10D43000FB5C002B78D02846FFF708FA08B11126CC -:10D44000E4E799F88A32002BDFD094F8188099F835 -:10D4500096324345F3D3B8F1060F01D90D26D5E72F -:10D46000FFF78AFA8045F9D86FF0180004F1190324 -:10D470009846217E001BC21891424BD84FF4856319 -:10D4800003FB0577227997F8D1329A4250D1207860 -:10D49000FFF77CF905460028E0D00A2294F80090B6 -:10D4A000254B80F80290FB600765637D414680F85C -:10D4B0005530E38A57305343C0F81930227E00F8C4 -:10D4C000012C1CF003FC237905F1740285F8343338 -:10D4D00004F11501631D53F8040B8B4242F8040B51 -:10D4E000F9D1164F04203B7BA5F8649085F86C3089 -:10D4F00040F21153A5F8663016F02CFA01460028C8 -:10D5000084D02378038040F211134380387B16F0D7 -:10D5100032FA7BE713F8012B42B1062A8FD899F82B -:10D5200096C29445A7D28AE742266FE712266DE796 -:10D5300025266BE7D01D00217DD301016850002115 -:10D5400010B50446FFF766F928B921464220BDE828 -:10D550001040F0F772BAC37813B121460C20F6E7F9 -:10D56000042016F0F7F9014648B140F21123438038 -:10D57000034B0480187BBDE8104016F0FCB910BDC9 -:10D58000685000212DE9F04100F1C40704460D4622 -:10D5900000F1F806D0F890803022002138461CF0C7 -:10D5A000BCFB4FF4C072002130461CF0B6FB4FF4B8 -:10D5B0008073A4F8DC30012384F8DE302E4B7C220B -:10D5C000C4F8E0302D4B3046C4E93934C4F8F0607B -:10D5D00008F1B0011CF07AFBE87B6E690721464335 -:10D5E00095F8380014F0C4FD254B2269C4F8943135 -:10D5F000244B3044C4F898316B68C4E93400C4F853 -:10D600008C309B1AC4F88830AB7A0025002B0CBFF5 -:10D610001E234FF49673A4F88630B4F8841028467D -:10D62000FBF762FCB4F88630D4F898201844D4F89C -:10D630008C3013441B1AC4F8CC3023694000C4F862 -:10D640009001C4F8D8302046FFF75CFA0021384634 -:10D6500015F0E6FC70B9D4E90832013342F100025A -:10D66000C4E908322269D4F88C3015441344C4F854 -:10D670008C30D2E7BDE8F081F14101016949010137 -:10D680003D410101253E010170B500264B8C0D4640 -:10D6900083808B8D0446C3804B6AC0F87832CB8D73 -:10D6A000A0F87C320A7C0276CB7B437691F820305E -:10D6B000C3760B7E837691F848308377D1E91001E9 -:10D6C00033461CF035F96A69C4E90801E969A87BA9 -:10D6D00091423BD341439639E677A162FF2384F818 -:10D6E000A23095F8383084F8C03095F8493084F885 -:10D6F0003433D3B104F23D300246D5F84A3005F157 -:10D700006201C4F83533D5F84E30C4F8393305F129 -:10D71000520353F8046B8B4242F8046BF9D104F5C1 -:10D720009E7204F17401FFF78DFD40F2E242AB8975 -:10D73000002053432361EB69E3606B692363AB6AA9 -:10D74000A36005F02FF8A4F8840070BD01234243C4 -:10D75000963AE377A262C1E70C2370B50D4680F8D4 -:10D76000B83204460021686AFFF720F9D5E90C2396 -:10D770000125C4F8BC0280EA1040C4E9A023A4F843 -:10D78000B00284F8AE5204F5207014F0F1FAB4F847 -:10D790007C321B02C4F8C03294F8C03084F8C53221 -:10D7A00094F83433002B46D040F20123A4F816330A -:10D7B000D4F8353304F53F70C4F80C33D4F839335A -:10D7C00094F80C23C4F81033D4F8BC3284F8155301 -:10D7D0005A4084F80C2394F80D2304F5A67182EACC -:10D7E000132284F80D2394F80E2382EA134284F85E -:10D7F0000E2394F80F2382EA1363024684F80F3352 -:10D8000004F59E7353F8045B8B4242F8045BF9D134 -:10D8100040F20123A4F82433074B1B685BB1074A8D -:10D8200011680122611A064C09116143BDE870407C -:10D830000831C9B2184770BD743A0021D0390021AF -:10D840001D52138C38B5054604200C4616F082F89C -:10D85000014650B1AB78C470038011238370034B31 -:10D86000187BBDE8384016F086B838BD68500021F6 -:10D870004FF4987210B50B4C0021236893F83A309E -:10D880005A43094B18681CF048FA4FF45472236845 -:10D890000021BDE8104093F839305A43034B186813 -:10D8A0001CF03BBADC4D0021D4390021D0390021D5 -:10D8B00008B5094A094B5A64094A0A4B5A64FFF7EA -:10D8C000D7FF094B1B681B790A2B81BF074A136AD4 -:10D8D00043F00043136208BDF1D80101040D00219B -:10D8E00091D30101B00C0021DC4D002168500021D2 -:10D8F000FFF7BEBF10B5037EBBB18168A9B1427E00 -:10D90000846AB2FBF3F2C37ED21A837E5A43036960 -:10D91000807F012809BF081902FB0330C01803FBF0 -:10D9200002001CBF611A401810BD41F28830FBE7AD -:10D9300000220C4B1B6893F839000B4B1B6890427C -:10D9400001D800207047197841B1D978012902BF68 -:10D9500093F8A11041F0010183F8A110013203F501 -:10D960005473ECE7DC4D0021D03900214FF454739F -:10D970000A385843084BA0F5D4601B6803445A7812 -:10D98000012A06D1D3F8CC0021B1D3F8D0300B60F6 -:10D9900070470020704700BFD0390021FFF768BFF3 -:10D9A00010B5FDF73BFB00220A4B1B6893F83910BA -:10D9B000094B1B68914207D9DC78012C05D11C6DFD -:10D9C000844202D100221A6510BD013203F554735E -:10D9D000F0E700BFDC4D0021D039002108B5FDF78C -:10D9E0001DFBBDE80840B830F0F720B838B5FDF7AA -:10D9F00015FB384B04461B681879FEF70BFF90F8AF -:10DA00003433002B61D0392384F8BA30D0F8353361 -:10DA100004F58572C4F80231D0F8393300F24D3183 -:10DA2000C4F8063100F23D3353F8045B8B4242F8F0 -:10DA3000045BF9D1012384F8B8300369264AA3FBBB -:10DA40000232DB0F43EA4203A4F8C43090F83430CA -:10DA500084F8C630437E84F8C730017E84F8C8104D -:10DA6000036BC4F8CC30837E84F8D030C368C4F82C -:10DA7000D430C37E84F8D8308388A4F8DA30D0F864 -:10DA80007832C4F8DC308368C4F8E030C388A4F886 -:10DA9000E430B0F87C32A4F8E630D0E9A023C4E941 -:10DAA0003A2390F8C03084F8F030D0E90835A3FB71 -:10DAB000013201FB0521C4E93E31837F84F8003146 -:10DAC00090F8343384F8013138BD212384F8BA301A -:10DAD000B0E700BFBC390021E3361A0070B5044638 -:10DAE000FBF742FAC4F8780204F09CFD0D23000A0B -:10DAF0000021A4F87C0284F8B832D4F87802FEF74A -:10DB000055FF0125364EC4F8BC0280EA1040D6E924 -:10DB10000E23A4F8B002C4E9A02384F8AE5204F5A1 -:10DB2000207014F025F9B4F87C321B02C4F8C0321E -:10DB300096F8303084F8BA3294F8C03084F8C432A1 -:10DB40000023A4F8C63294F83433002B46D040F2B8 -:10DB50000123A4F81633D4F8353304F53F70C4F824 -:10DB60000C33D4F8393394F80C23C4F81033D4F8B8 -:10DB7000BC3284F814535A4084F80C2394F80D23D3 -:10DB800004F5A67182EA132284F80D2394F80E237B -:10DB900082EA134284F80E2394F80F2382EA136377 -:10DBA000024684F80F3304F59E7353F8045B8B42EE -:10DBB00042F8045BF9D140F20123A4F82433094B65 -:10DBC0001B685BB1084A11680122611A074C0911F0 -:10DBD0006143BDE870400831C9B2184770BD00BF4D -:10DBE00020500021743A0021D03900211D52138C9D -:10DBF0000228034609D003280FD0002A14BF0423AB -:10DC0000002358180A30C0007047002A14BF0420AF -:10DC1000002008440B3080007047002A14BF042005 -:10DC200000200844800100F53470704738B5044680 -:10DC300090F834230D46017990F8C000FFF7D8FF23 -:10DC4000E17F00F196020129637E07BFE2606A432B -:10DC500022635A430CBF2263E260226B013B5343B1 -:10DC6000E168013D01FB0533184438BD83782DE997 -:10DC7000F041FF2B04461ED00078FEF7CBFDC0B16B -:10DC8000E178BDE8F04109F023BC08FB05F33A68F0 -:10DC9000D018D35C3BB1C378012B04D18378E178F1 -:10DCA000238009F015FC0135336893F839309D4223 -:10DCB000EBD3BDE8F08100254FF45478014E024FBC -:10DCC000F2E700BFDC4D0021D039002108B50D4A34 -:10DCD0000D4B0E481A640E4B0E4A1A640E4A0F4B37 -:10DCE000DA61FBF753F9FFF7C3FD06F065F90C4B5A -:10DCF0001B681B790A2B81BF0A4A136A43F08043D1 -:10DD0000136208BD9DD90101040D002131D9010123 -:10DD1000B00C00216DDC010121400201780C0021D2 -:10DD2000DC4D0021685000212DE9FF4D814E8478A3 -:10DD30003368054693F83A30A34201D20D2096E0AD -:10DD4000FEF71AFE8442F9D82878FEF763FD002812 -:10DD500040F0EC806878FEF73DFD012800F0E88097 -:10DD60002878FEF713FD04460028E7D033682A7BA5 -:10DD700093F830306878934228BF13462B73FDF731 -:10DD80004DF90123E370EB7B0646A377AB7BE3778A -:10DD9000687B0BF0A8FF022803D0042814BF0120E1 -:10DDA000032084F8C0002B7C84F834338BB1082125 -:10DDB00004F2353004F23D3717F03EFD10213846AD -:10DDC00017F03AFD384604F59E7205F11101FFF790 -:10DDD00039FA288940F2E241FB28034628BFFB2399 -:10DDE0006A68A380B2FBF1F34B439A42E080A260E1 -:10DDF000236108D00123A377D328034628BFD32368 -:10DE00002833A38002E0A37F012BF5D0A18813F073 -:10DE1000DAFEC0B220762B7B0133DBB25843E376C7 -:10DE2000A37EC2B262762BB3101A43435BB2237750 -:10DE300001236377A376A9782046FFF7F7FE002336 -:10DE4000A376FF23A0622377A9782046FFF7EEFE92 -:10DE5000A0622046FFF74EFD4FF47A726B89E062B4 -:10DE600053438342204608D2FFF734F9112004B00F -:10DE7000BDE8F08D4FF0FF33D9E7FFF72FFE3EB13D -:10DE80002D4B9B695A025CBF96F8423A84F8BA322D -:10DE9000A188E08813F097FE082843D92046FFF7B1 -:10DEA00019F91220E3E72046FEF70AFD68B3D8E926 -:10DEB0000EABB4F87C2294F8C030CDE900AB0293ED -:10DEC000D4F87812FEF7A2FD1EBB0137AB78BB4237 -:10DED000E9D84EB1194B2665C6F8D03B184BC6F8A9 -:10DEE000D43B184BC6F8D83B042015F033FD01464F -:10DEF0000028BCD02B7803804FF488734380124BEA -:10DF0000187B15F038FD0020B1E72046FFF7E2F856 -:10DF100014E7D8F818305B0244BF96F8423A84F808 -:10DF2000BA32D2E70027DFF81080CFE70C209EE757 -:10DF300042209CE7DC4D002120500021EDD9010159 -:10DF4000DDD90101A1D90101685000212DE9F0437B -:10DF500085B084780546FEF70FFD844201D90D2077 -:10DF60000BE02878FEF756FC002840F0AD8068787A -:10DF7000FEF730FC012803D1122005B0BDE8F08384 -:10DF80002878FEF703FC04460028E8D00123C3707C -:10DF900095F82230837795F82130C37795F82000E3 -:10DFA0000BF0A1FE022803D0042814BF0120032097 -:10DFB00084F8C00095F8263084F834338BB10821FA -:10DFC00004F2353004F23D3617F036FC10213046AD -:10DFD00017F032FC304604F59E7205F10801FFF798 -:10DFE00031F940F2E242EB8BA380AB8BE3806B68AC -:10DFF000A3602B8B5343236195F82320227695F859 -:10E000002400E07695F82530A376A97E617602FBA0 -:10E01000101191FBF2F25A4384F85E20002B39D0A4 -:10E020004B435BB22377A9782046FFF7FFFDA06240 -:10E030002046FFF75FFCE0622046FFF74FFDA18816 -:10E04000E08813F0C0FD082896D800261F4FAB7853 -:10E05000B34222D86878FCF7E1FF48B11C4B206539 -:10E06000C0F8D03B1B4BC0F8D43B1B4BC0F8D83B8F -:10E07000042015F06FFC014600283FF47EAF2B789A -:10E0800003804FF488734380144B187B15F073FCA6 -:10E09000002072E74FF0FF33C4E72046FEF710FC84 -:10E0A00070B1D7E90E89B4F87C2294F8C030CDE97C -:10E0B00000890293D4F87812FEF7A8FC0136C6E76F -:10E0C0002046FFF707F84AE70C2056E720500021CA -:10E0D000EDD90101DDD90101A1D90101685000216B -:10E0E00010B50C46FEF796FB78B1C378012B0ED124 -:10E0F0004378012B0BD190F8A13080F8BA4043F05F -:10E10000020380F8A130002010BD4220FCE70C2063 -:10E11000FAE7000030B504468BB00D4624220021FA -:10E1200001A81BF0FAFD2922A3788DF80220ADF892 -:10E1300000308DF803508DF804508DF8053025B16E -:10E14000684613F045FD0BB030BDA36A194A02932F -:10E15000E36A3834039394F888308DF8103014F85B -:10E160001F3C8DF8113014F8203C8DF8123014F853 -:10E170001E3C8DF8133014F81D3C8DF8143034F823 -:10E18000343CADF8163054F8283CA3FB0232DB0FC8 -:10E1900043EA4203ADF8183014F8043C07AA8DF89E -:10E1A0001A30AB42CCD954F8041B0135498822F807 -:10E1B000021BF6E7E3361A0007B52A228378ADF88A -:10E1C0000220ADF800308DF8043090F8BA3068467F -:10E1D0008DF8053013F0FCFC03B05DF804FB000083 -:10E1E00038B5054604200C4615F0B4FB014650B185 -:10E1F000AB78C470038010238370034B187BBDE899 -:10E20000384015F0B8BB38BD6850002138B5036DF3 -:10E2100004460D4693B1062015F09CFB014668B1FB -:10E22000236D5B78C57003800E238370A378037120 -:10E23000034B187BBDE8384015F09DBB38BD00BFCF -:10E24000685000212DE9F04F044600F1C407D0F8D2 -:10E25000389087B000F1F8083022002138461BF0D2 -:10E260005CFD4FF4C072002140461BF056FD236D4B -:10E27000DFF844A2D3F8A05114F03EFD4FF48073B0 -:10E28000A4F8DC30012384F8DE308C4B09F1B001B6 -:10E29000C4F8E0308A4B0646C4E939347C22404653 -:10E2A000C4F8F0801BF012FD637FDFF81892002B9A -:10E2B00000F08D80844B4FF454711B68B3F83280AA -:10E2C000DAF80030E31A1B1109FB03F35FFA83FB52 -:10E2D0000023DAB2934536D835440026454494F8F5 -:10E2E00034102046FFF7A2FCA0622046FFF702FB95 -:10E2F000E37F94F81980012B236BE0621FBF03FBBF -:10E3000008F394F83400E36003FB00F84FF00701D2 -:10E3100094F8C00008BF03FB08F813F029FF637EE0 -:10E320004044082BC4E9340023D9A37EE27E002BAD -:10E3300040D1012A40F2BA80013A637EE276227E21 -:10E340009B1A6376CBE701FB03F2DAF8000000EBDF -:10E35000020C825C5AB1DCF8D0200593049214F0D0 -:10E36000CBFC4FF45471049A059B904480440133D4 -:10E37000AFE705EB000814F0BFFCA36840449842E7 -:10E38000D3D2524BE17F524AC4F89031514B01290C -:10E3900018BF1346DAF80010C4F89431601A00115F -:10E3A00009FB00F0236D10F0FF00D3F89C8179D1B8 -:10E3B000002632E0207E637E02FB00F18B42B8DD56 -:10E3C0001B1ADBB29942637689D1A67687E794F867 -:10E3D00034102046FFF72AFCE37F256B012B637E78 -:10E3E000A06203FB05F51CBF94F83430E5604FF0E4 -:10E3F000070194F8C00018BF5D4313F0B9FE05444F -:10E40000C4E93455BDE70133DBB2C21AD0D46A4344 -:10E410008E188A5C002AF6D0C43600252E4A23695D -:10E420000292D4F8D0200C30009229461A46C4F843 -:10E43000D8300195C0B214F07FF9B8B346B9224A7A -:10E44000236D1268D3F8A011558E03F5CA766D1AA4 -:10E450000323DAF800100093611A091109FB01F196 -:10E460000C3133464246D4F8D000C9B214F01AFA3F -:10E4700005444544C4F8CC502046FEF743FB002138 -:10E48000384614F0CDFDA8B9D4E90832013342F181 -:10E490000002C4E90832D4F8CC3022691344C4F82D -:10E4A000CC30E9E701234FF45475AEE70D2007B0F7 -:10E4B000BDE8F08F0020FAE7D03900211D4E0101A0 -:10E4C000755001011D52138CDC4D0021614C01017E -:10E4D000654B0101E54B01016DD901010022F8B541 -:10E4E0001C4E0446336893F835701B4B186895B280 -:10E4F000AF4201D800232BE003461978013200F522 -:10E5000062700029F3D14FF4627218461BF005FCCB -:10E510000122034602703268104992F822202A44F0 -:10E5200092B20281097B80F85C10A3F8BC2244F20D -:10E530000F7245F20120A3F8BE22FF22A3F8560075 -:10E5400083F8C41283F8042383F80823A279DA72CB -:10E550001846F8BDDC4D0021E43900216850002147 -:10E5600000230370704700000146002230B50A4BBB -:10E570001B6893F83540094B1B68944201D8002072 -:10E5800030BD1D8918468D4202D11D78002DF7D16E -:10E59000013203F56273F0E7DC4D0021E43900211C -:10E5A00070B5002204460B4B1B6893F835500A4B9C -:10E5B0001B68954201D8002070BD1E7818462EB108 -:10E5C000DE7AA64202D11E7B8E42F5D0013203F5DF -:10E5D0006273EEE7DC4D0021E4390021002210B522 -:10E5E0000B4B1B6893F835100A4B1B68914201D8FE -:10E5F000002010BD1C782CB193F8CA4214B1DC88FD -:10E60000844203D0013203F56273EFE70120F0E7A3 -:10E61000DC4D0021E4390021002230B50D4B1B6890 -:10E6200093F835400C4B1B68944201D8002030BD54 -:10E630001D898D4207D01D782DB193F8CA5215B1AE -:10E64000DD88854203D0013203F56273ECE70120D7 -:10E65000EDE700BFDC4D0021E439002108B5FFF7EC -:10E6600083FF03780BB1C08808BD4FF6FF70FBE74E -:10E6700008B5FFF779FF20B190F84700003818BFC0 -:10E68000012008BD2DE9F04100220546144B1B680E -:10E6900093F83410134B1B6897B2B94201D8002489 -:10E6A0001BE01C4613F89C6B0132002EF4D14FF096 -:10E6B00001089C22314620461BF02FFB18223146D0 -:10E6C00084F80080A571278104F158001BF025FB18 -:10E6D00013F0EEFA404614F061FA2046BDE8F081EE -:10E6E000DC4D0021DC39002108B50023A0F87C3086 -:10E6F00080F88030C3700371C375038013F0E0FAB3 -:10E70000BDE80840012014F05FBA00000146002275 -:10E7100030B5094B1B6893F83440084B1B68944292 -:10E7200001D8002030BD1D78184615B19D798D4265 -:10E73000F8D001329C33F2E7DC4D0021DC390021B6 -:10E7400070B50C46054615F0FFF84FF462720D4E99 -:10E750000D4B1860336893F8353002FB030015F059 -:10E76000F3F89C22094B1860336893F8343002FBAD -:10E770000300401BA0429BBF054B064A00209A6144 -:10E7800070BD00BFDC4D0021E4390021DC390021DF -:10E790006850002188039C0030B500244271039A20 -:10E7A00001290480C470047181708471826002D177 -:10E7B0000373C47630BDB3FBF1F20F2901FB1233B2 -:10E7C00028BF0F2113440373C47600F10C03C0F17A -:10E7D000FF2000F57F00D5B2F530C2189142E9D98B -:10E7E0001A782A4403F8012FDC73F6E78378012BAB -:10E7F00005D190F8FC02431E584258417047002052 -:10E800007047000030B50A4B4FF462741B6893F8F0 -:10E810003520084B1968002318469A4200D830BDAD -:10E8200004FB03F54D5D0DB90130C0B20133F4E7CF -:10E83000DC4D0021E43900212DE9F0410025064698 -:10E840002C464FF00A08077DAF4202D82046BDE8AB -:10E85000F08108FB05F3B2693078D15CFFF7A0FEC8 -:10E8600008B10134E4B20135EEE72DE9F0410025AD -:10E8700006462C464FF00E08C77CAF4202D8204611 -:10E88000BDE8F08108FB05F372693078D15CFFF7D1 -:10E8900087FE08B10134E4B20135EEE7C07D704770 -:10E8A0000846704738B50546E5E92A230446284658 -:10E8B00013F05EFA0123D4F8E42084F8D63082EA1B -:10E8C0001242E189A4F8D8202846002213F06EFAFB -:10E8D00084F8E000284613F0B6FA002384F8E1003B -:10E8E000237738BD2DE9F04707460026DFF86C8016 -:10E8F000DFF86C90DFF86CA0D8F8003093F8353072 -:10E90000B34201D8BDE8F0874FF462737343D9F87E -:10E910000020D418E188B9421ED1D35CE3B14FF492 -:10E9200095622546DAF8003002FB0733D3E98623E7 -:10E93000E5E92A23284613F01BFA01230022E18986 -:10E94000284613F033FA84F8390184F8E0002846A9 -:10E9500013F079FA84F8E1000136CDE7DC4D0021AF -:10E96000E4390021B43A0021254A70B515684FF406 -:10E9700095620446C38800F5BE7602FB0355314616 -:10E9800005F2A92205F2992016F09AFED5F8B932BF -:10E99000C4F88C31D5F8BD3294F88C21C4F890318C -:10E9A000D4F8E4305A4084F88C2194F88D2182EA1E -:10E9B000132284F88D2194F88E2182EA134284F880 -:10E9C0008E2194F88F2182EA136384F88F3101231A -:10E9D000A27A84F8A531B2FA82F20A4B52091B6876 -:10E9E00084F8A42113B13046217A984795F8A430D1 -:10E9F00084F8943195F8A53084F8953170BD00BF46 -:10EA0000B43A0021743A002100F1580200F1700379 -:10EA100052F8040B38B1884202D101204870704787 -:10EA20009A42F5D10020704700F1580200F17003BE -:10EA300052F8040B40B1884203D1002301204B70EF -:10EA400070479A42F4D10020704770B5C46E0546F5 -:10EA50000E462CBB00F1580353F8042B22B90120B9 -:10EA6000163445F8246070BD31691269914214D999 -:10EA700004F11700052C4FEA8000A0F10401C4BF87 -:10EA80006C217020C4F105024FEA82022944C8BFFC -:10EA9000002228441BF027F9E1E70134062CDBD1E2 -:10EAA0000020E0E7C36E10B573B900F1580252F8C8 -:10EAB000044B8C4203D024B9163340F823100120B4 -:10EAC00003E00133062BF2D1002010BD10B5002366 -:10EAD000044600F1580252F8040BA0B1884213D149 -:10EAE00003F116008000C3F10502052B00F10401BB -:10EAF0004FEA82022144C8BF002220441BF0F3F8F1 -:10EB000000230120E36610BD0133062BE3D1002072 -:10EB1000F9E700F15803703053F8042B1AB152781A -:10EB20001AB98342F8D1012070470020704738B5E8 -:10EB30000446FFF7EEFF50B98B7A20461BB9BDE8BB -:10EB40003840FFF771BFBDE83840FFF7BFBF002076 -:10EB500038BD00F1580200F17003002052F8041B88 -:10EB600019B1497809B10130C0B29A42F6D1704763 -:10EB700000F1580200F1700352F8040B20B1417803 -:10EB800011B99A42F8D10846704700F1580200F1D5 -:10EB9000700352F8040B38B1417811B1B0F84A1043 -:10EBA00011B19A42F5D10020704738B50446FFF7FD -:10EBB000B0FF68B904F15803703453F8042B22B144 -:10EBC00055781DB18B1A5842584138BDA342F4D133 -:10EBD0000020FAE710B50446FFF79BFF034658B93B -:10EBE00004F15802144654F8040B30B1884203F182 -:10EBF00001030CD1052B01DD002010BD52F82300CC -:10EC00000028FAD041780029F7D10133F2E7062B2A -:10EC1000E9D1F1E738B50446FFF77BFF68B904F1A5 -:10EC20005802703452F8043B2BB18B4206D05D7809 -:10EC3000002D18BF1846A242F4D1002038BD00F1C3 -:10EC4000580200F1700352F8041B29B1487808B14A -:10EC5000087E10B19A42F6D101207047002110B50C -:10EC600000F15803703053F8042B22B1547804B1EA -:10EC700011768342F7D110BD70B50024012500F153 -:10EC80005802703052F8043B43B15E7826B18B4293 -:10EC900000D00CB101241D769042F3D170BD10B5A7 -:10ECA0000446302014F0C4FD58B100230246C3626C -:10ECB000234604F12C0153F8044B8B4242F8044BD9 -:10ECC000F9D110BD10B504460846FFF7E8FF30B192 -:10ECD000237A2BB9C4E9000001200133237210BD4F -:10ECE0006268D0626060F7E710B50446007A58B1F8 -:10ECF0002068C36A236014F0C1FD237A013BDBB2B4 -:10ED0000237203B96360012010BD38B5037A04464D -:10ED10000BB1056805B938BD2046FFF7E5FFED6A80 -:10ED2000F8E70000F7B50446C07AFFF7EFFC0026CD -:10ED3000002200230546C4E90A23C4E90C2301216B -:10ED40002089E68184F8466084F8FC6284F8CA620F -:10ED500004F06EFF0221208904F06AFF04F58A7036 -:10ED6000FFF7D3FF04F59070FFF7CFFF04F52E7087 -:10ED7000C4F8ED60A4F8F160C4F8F360A4F8F7609B -:10ED800015F007F804F1500015F003F82146284665 -:10ED9000FFF70BFF01280BD1AB786876012B1BBF67 -:10EDA00094F8EC22D4F8F032D4F808315343EB61F4 -:10EDB000A37A264E012B25D1002321462846237015 -:10EDC000FFF7B5FE2846FFF7A4FE10B12846FFF76F -:10EDD0008BFC204605F0B2FB33781BB105212046A1 -:10EDE000EFF7A8F804F5567528460DF1070114F061 -:10EDF000D1FD38BB94F8D81204F55A7005F030FDF7 -:10EE000003B0F0BD21462846FFF791FE2846FFF7E4 -:10EE100080FE88B100276B796F76012BEF702F7120 -:10EE20000AD10B4B18680B4B281A801058430A3034 -:10EE3000C0B213F013FD6F713378012BC9D10023D9 -:10EE40002370BFE714F08EFDCEE700BF000D002158 -:10EE5000DC390021976FF996007AB0FA80F040090A -:10EE60007047000038B5154B1C684FF4956303FBE1 -:10EE70000044B4F82C04FFF777FB034610B90025D3 -:10EE8000284638BD0579012DF9D194F87F2352B178 -:10EE9000002384F87F3394F88033002BEFD00421D3 -:10EEA000EFF75EF8ECE794F876231AB1D4F86C2209 -:10EEB000002AE4D104211846F2E700BFB43A002149 -:10EEC00070B5054600240D4B1B6893F835600C4B5C -:10EED0001A68A3B29E4202D80021084670BD11787C -:10EEE000012907D1D388AB4204D11046FFF77EFC3D -:10EEF0000028F2D1013402F56272EAE7DC4D00210C -:10EF0000E439002108B5FFF72FFB40B10378012B4E -:10EF100005D1FFF76BFC003818BF012008BD0020A9 -:10EF2000FCE7C2680B46920004D5282103F150008B -:10EF300014F020BF7047C3689B0003D501F1500057 -:10EF400014F027BF70470000022816D0032817D0FE -:10EF5000012821D10E32D200022902F196021DD0E1 -:10EF600003291FD0012902D10E3302EBC302144B37 -:10EF70001B68D88E9630104470470F329200EBE732 -:10EF8000104804328069C0024BBF1201920102F5A1 -:10EF9000E77202F53472DFE70022DDE70F3302EBA0 -:10EFA0008302E4E7074904338969C9024BBF02EBD6 -:10EFB000031202EB831202F5E77202F53472D6E710 -:10EFC000DC4D0021205000212DE9F04100240546B0 -:10EFD00026464FF00A08077DA74202D83046BDE812 -:10EFE000F08108FB04F3AA692878D15CFFF7D8FA0E -:10EFF00090F82C3190F8302190F8D51290F8D40286 -:10F00000FFF7A2FF01340644E6E700004FF4627206 -:10F0100010B50B4C0021236893F835305A43094B47 -:10F0200018681AF07AFE9C2223680021BDE810407F -:10F0300093F834305A43044B18681AF06EBE00BF80 -:10F04000DC4D0021E4390021DC39002110B5837A40 -:10F050000446FBB9B0F8DA2294F8D8322BB9D4F8C8 -:10F06000283313B9A36AC4F82833D4F82833208985 -:10F07000591CC4F8281394F8201305F0C1FC0A4A5F -:10F08000127852B914F06EFCD4F82833013BC4F85E -:10F09000283310BDB0F8DC22DEE70028F4D0BDE84C -:10F0A000104004F075BC00BFDC5000212DE9F04198 -:10F0B0000026038988B00446314600F55A70ADF841 -:10F0C0000030ADF8046005F0DFFC0546002875D17E -:10F0D000414B9B699B0366D5A37A012B74D194F8AD -:10F0E000A130002B5FD105F081FC064600285AD0E4 -:10F0F00014F0E8FB394A53780133537014F0EEFBF7 -:10F10000A37AD4F80053002B63D1D4F8E0321D4425 -:10F1100023891422ADF808304FF481730021C4F81C -:10F12000005303A8ADF80A301AF0F7FD236B02A9CB -:10F13000ADF81430022330468DF81830049508F0ED -:10F1400010F83346226B218904F5427005F06EFAFF -:10F1500010B9304614F006FC94F80833012B04D1A2 -:10F160001F4B2021187B14F0A1FCBDF804300125B1 -:10F170000133ADF8043016E033464046226B218956 -:10F1800005F054FA10B9304614F0ECFB0125BDF837 -:10F1900004300133ADF80430384602A914F0FAFB0C -:10F1A00006460028E8D10E4BDB6A23B11DB1694643 -:10F1B000012001AA984708B0BDE8F081354604F562 -:10F1C0005E7704F54278E7E7002BECD194F86130E4 -:10F1D00087E7D4F8E4329AE720500021DC50002180 -:10F1E00068500021F0B5038989B0ADF800300023E4 -:10F1F0000446ADF8043005F0F9FB294F0546002818 -:10F2000041D014F05FFB274A53780133537014F058 -:10F2100065FBA37AD4F80063002B3DD1D4F8E0322B -:10F220001E4423891422ADF808304FF48173002165 -:10F23000C4F8006303A8ADF80A301AF06EFD236B22 -:10F2400002A9ADF81430022328468DF81830049630 -:10F2500007F087FF2B46226B218904F5427005F0E9 -:10F26000E5F910B9284614F07DFB94F80833012B1A -:10F2700003D12021387B14F019FC0125BDF804309E -:10F280000133ADF80430FB6A23B11DB1694601209A -:10F2900001AA984709B0F0BDD4F8E432C0E700BF36 -:10F2A00068500021DC5000212DE9F843D0F83433B8 -:10F2B00004469E073CD54F4B9B691D0438D54E4AEA -:10F2C0004E4B156800221B68DFF8348193F8351027 -:10F2D000D8F800304B4FC31ADB107B4391422AD938 -:10F2E000E88898422ED1287860B395F8CA0248B3CE -:10F2F000AB7A012B21D195F8D42294F855309A425B -:10F3000019D094F84534D4F8481404F24C49B1FBB0 -:10F31000F3F14942484649B2F9F786FE0023C4F8A2 -:10F32000483484F84534AB7A83B195F8D4620FE061 -:10F33000002384F81A34BDE8F883002BE1D195F856 -:10F34000D522DAE7013205F56275C7E795F8D5628F -:10F35000032E34D195F8463103F0FD03581E434285 -:10F3600043411E4494F85134F6B2032B29D80025AA -:10F3700094F82A349D4202DA5B429D42DBDC94F829 -:10F380008533162BD7D0D4F88C335B02D3D4062028 -:10F3900014F0E0FA014670B1D8F800300571E31AB4 -:10F3A000DB107B43038042F601034380164B46711A -:10F3B000187B14F0E0FA002384F85134BBE70023F3 -:10F3C000CFE74846F9F722FE94F91C54854207DA44 -:10F3D000A31993F83D33D90702D42D1A6DB2C7E7AC -:10F3E00094F91D548542C2DDA31993F83D339A0761 -:10F3F000BDD4F2E720500021E4390021DC4D00218A -:10F40000B43A0021BDCAE28C68500021F8B500244E -:10F410009C270C4D0C4E2B6893F83420E3B29A4293 -:10F4200000D8F8BD7B433268D018D35C1BB1C37DD4 -:10F430001BB9FFF759F90134EDE7283013F0C8FF85 -:10F44000F9E700BFDC4D0021DC390021837810B5DD -:10F45000FF2B04460AD00088FFF786F850B1064B10 -:10F46000E1781C60BDE8104008F04AB8BDE81040E3 -:10F47000FFF7CCBF10BD00BFE0390021022803D048 -:10F48000042814BF012003207047531E434301FB8F -:10F4900000010133C9B2DBB2B1FBF3F203FB12117D -:10F4A000C9B2D0B209B10130C0B2704770B50D46D3 -:10F4B00042F21074194642F21173654303FB00F6E1 -:10F4C000B6FBF5F405FB146606B1013442435A431A -:10F4D000B2FBF5F005FB102202B1013004EB84040D -:10F4E000204412F070FB023070BD00002DE9F0479F -:10F4F0001378164603730B7B0D4680F8D6324B7B90 -:10F50000044680F8D73240F2E24391F80EE080F8EA -:10F51000D8E24A6841F288309A428A6898BF4B60C4 -:10F520009A4298BF8B60D1E901C161450A4628BF64 -:10F530006246904238BF1046BB4BB6F80280A0FB33 -:10F540000337DB0F43EA470340F2E2479BB25F43D6 -:10F55000B84288BF0133A4F8E832B079B388B34F1A -:10F56000BEF1000F0FD140F2E249B4F8E8E209FB26 -:10F570000EFEB2FBFEFA0EFB1A22002A00F05881A2 -:10F58000012284F8D822C4E9B8C1B8F1000F61D1D2 -:10F59000424667E03B6893F8380040F2E2494FF496 -:10F5A0007A7884F8EA02B4F8E812688A3B6809FBC2 -:10F5B00001F108FB00F093F838A012F001FB82453E -:10F5C00025D23B6893F83820B4F8300184F8EB2258 -:10F5D00040BB84F8F402B4F82C0178BB84F8F5023F -:10F5E00094F8EA72317A757A94F8F40294F8F53264 -:10F5F000BA4228BF3A46A94238BF2946984238BF86 -:10F600001846FFF742FF84F8EC02BDE8F087B4F833 -:10F61000E812688A09FB01F108FB00F012F0D0FA49 -:10F62000C2B2D1E7B4F8DA52B5FBF0F1CBB2414344 -:10F63000A942B8BF013384F8F432CCE7B4F8DC5205 -:10F64000B5FBF0F1CBB24143A942B8BF013384F816 -:10F65000F532C5E73A6808F10501D28D8A42A8BFA4 -:10F660000A4692B2A4F83021002B00F0AA803A6832 -:10F67000591DD28D8A42A8BF0A4692B2A4F82C2105 -:10F68000A4F8DC32A4F8DA820AF02DFBFFF7F6FECC -:10F6900084F8D402F0790AF026FBFFF7EFFE40F27F -:10F6A000E2494FF47A7884F8D502B4F8E812288A4F -:10F6B0003B6809FB01F108FB00F093F838A012F059 -:10F6C0007FFA82457FD23B6893F8380040F2E249E6 -:10F6D0004FF47A7884F8EA02B4F8E812688A3B6852 -:10F6E00009FB01F108FB00F093F838A012F068FA6A -:10F6F000824573D23B6893F8382084F8EB22B6F841 -:10F700000280B4F8DAE2B8F1000F72D03B68D98D0C -:10F710000EF105039942A8BF1946C9B2B388B4F8DF -:10F72000DC023BB13B6800F1050CDB8D6345A8BFF3 -:10F730006346DBB2BEF1000F5DD184F8F4E200282D -:10F7400066D184F8F50294F8EAC2717A337A624598 -:10F7500094F8F4A294F8F50238BF6246994238BF93 -:10F760001946504538BF5046FFF78FFE40F2E2433E -:10F77000B4F8E89284F8EC0203FB09F942465346D8 -:10F7800069684846FFF792FEB288804694F8F532E1 -:10F790004846A968FFF78AFE72882AB13B68DA8D6D -:10F7A000424528BF424692B2B388A4F830212BB11B -:10F7B0003B68DB8D834228BF03469BB2A4F82C3103 -:10F7C00023E71A465AE7B4F8E812288A09FB01F140 -:10F7D00008FB00F012F0F4F9C0B277E7B4F8E812D1 -:10F7E000688A09FB01F108FB00F012F0E9F9C2B2E6 -:10F7F00083E7414692E7BEFBF1F909FB01F15FFAAD -:10F8000089FC8E45C8BF0CF1010C84F8F4C296E760 -:10F81000B0FBF3FC0CFB03F35FFA8CF19842C8BF1A -:10F82000013184F8F5128EE7E3361A00DC4D002131 -:10F830003A68C4E9B8C1D28DA4F8DC324245114619 -:10F8400028BF41469A4228BF1A46A4F83011A4F8AE -:10F850002C21A4F8DA820AF046FAFFF70FFE84F8AA -:10F86000D402F0790AF03FFAFFF708FE4FF47A78F5 -:10F8700084F8D502B4F8E812288A3B6809FB01F144 -:10F8800008FB00F093F838A012F09AF98245FFF4D3 -:10F8900081AEB4F8E812288A09FB01F108FB00F0F8 -:10F8A00012F08EF9C0B278E62DE9F0470646194B02 -:10F8B00000271B684FF09C0A5D8E13F01DFADFF8DD -:10F8C00058800544D8F80030F41A144BA4105C4357 -:10F8D000E4B2FBB29C420ED8F46813F00DFA40F289 -:10F8E000E242B38A204453435B1B98428CBF002002 -:10F8F0000120BDE8F087D8F800300AFB07331A79F9 -:10F9000032B1D3F8349013F0F7F909EB0503C518B9 -:10F910000137DEE7DC4D0021DC390021976FF996D5 -:10F920002DE9F84F06460C464FF000084FF00E0A3E -:10F93000E27C2078424563691FD8677C1978012FE3 -:10F9400040F08A80FEF72CFE4FF00E0B054690F833 -:10F95000EC32D0F8F0225343C0E90433F360B0F83E -:10F96000E832B382E37CBB424BD8637C3046B37051 -:10F97000FFF79AFFB075BDE8F88F0AFB08F2995CB3 -:10F98000FEF70EFE014605463046FFF78BF8637C16 -:10F99000012B29D10027B94612E00AFB07F362695F -:10F9A0002078D15CFEF7FCFD90F82C3190F83021E6 -:10F9B00090F8D51290F8D402FFF7C6FA01378144C7 -:10F9C000E37C9F42E9D395F82C3195F8302195F8E6 -:10F9D000D51295F8D402C5F8F092FFF7B5FAC5F83C -:10F9E000080108F10108A3E795F82C3195F83021BA -:10F9F00095F8D51295F8D402FFF7A6FAC5F8F002EB -:10FA0000EDE70BFB07F362692078D15CFEF7C8FDD8 -:10FA10004FF000088146C2460BFB08F3626920786C -:10FA2000D15CFEF7BDFD90F82C3190F8302190F8B4 -:10FA3000D51290F8D402FFF787FA08F1010847457C -:10FA40008244E9D12B690137A3EB0A03C9F81030CE -:10FA50002B69C9F8143085E7FEF7A2FD002705469B -:10FA60004FF00E0AE37CBB4205D82B69F360B5F872 -:10FA7000E832B38279E70AFB07F362692078D15C48 -:10FA8000FEF78EFDB9468046E37C4B4504D82B69D2 -:10FA90000137C8F81430E5E70AFB09F362692078FA -:10FAA000D15CFEF77DFDD8F8103090F8EC22D0F84C -:10FAB000F01209F1010901FB0233C8F81030E3E745 -:10FAC00038B54B680446C0F8E0328B681546C0F87C -:10FAD000E4320B7B80F8EA324B7B80F8EB32CB8947 -:10FAE000A0F8E8320B7C80F8D6324B7C80F8D73215 -:10FAF0008B7C80F8D83213780373537880F8EC321B -:10FB00005388A0F8DA329388A0F8DC32907A0AF0B1 -:10FB1000EAF8FFF7B3FC84F8D402E87A0AF0E3F8D5 -:10FB2000FFF7ACFC84F8D5022B7B84F8F4326B7BB6 -:10FB300084F8F532F9F7F8F94FF495610A4BE28849 -:10FB40001B68C4F8E40001FB0233D3F84822B3F881 -:10FB50008232C4F8E820A4F8C832EB88A4F8303127 -:10FB60002B89A4F82C3138BDB43A00212DE9F0419D -:10FB700000244FF462780E4E0E4F336893F8353000 -:10FB8000A34201D8BDE8F08108FB04F33A68D51818 -:10FB9000D35C53B105F1FC0014F09CF828B9E87A65 -:10FBA000FEF7B4FD283013F03FFC0134E5E700BF59 -:10FBB000DC4D0021E439002170B500250A4E336880 -:10FBC000ACB293F82230A34201D8002070BD204689 -:10FBD00001F09EFB30B1204601F0BEFB10B920467B -:10FBE000FEF780FE0135EAE7DC4D002108B5EBF7B2 -:10FBF00093FAEBF7F9F8FFF709FABDE8084012F0BD -:10FC000029BA00002DE9F84FDFF89080824698F875 -:10FC10000130002B40D00025214C2A462F46264695 -:10FC20004FF0010904F11A0B31788D4214D38FB3D0 -:10FC300092B389B3062013F08DFE014660B3F389B9 -:10FC4000038042F20143438073888380154B187B05 -:10FC5000BDE8F84F13F08FBE9BF80010A9B9E189F9 -:10FC6000514511D104208BF8009013F073FE01462A -:10FC700040B162880B4B028040F20F224280187B19 -:10FC800013F079FE012200E00127013502340BF167 -:10FC9000010BC9E788F80170BDE8F88FB05000216A -:10FCA000E8390021685000212DE9F84F05460C463F -:10FCB00000274FF00A08237DBB4217D84FF00A09EE -:10FCC000677BAE6D012F6BD196F8EC32D6F8F0223F -:10FCD0005343C6E90433EB60B6F8E832AB82237DC8 -:10FCE000BB4232D8002640F2E247F4E008FB07F3BB -:10FCF000A2692078D15CFEF753FC014606462846EF -:10FD0000FEF7D0FE637B012B12D12046FFF75CF992 -:10FD100096F82C31C6F8F00296F8302196F8D512F4 -:10FD200096F8D402FFF710F9C6F808010137C2E7C8 -:10FD300096F82C3196F8302196F8D51296F8D40220 -:10FD4000FFF702F9C6F8F002EEE709FB07F3A26934 -:10FD50002078D15CFEF724FC4FF000088246C346B1 -:10FD600009FB08F3A2692078D15CFEF719FC90F832 -:10FD70002C3190F8302190F8D51290F8D402FFF78A -:10FD8000E3F808F1010847458344E9D133690137B5 -:10FD9000A3EB0B03CAF810303369CAF814309EE79E -:10FDA00033461946002091F8EC72D1F8F02202FB9C -:10FDB000070005F15807BC4600225CF804EB01324D -:10FDC000714517D1163255F822100029EBD10022C7 -:10FDD00018613169596157F8040B013283420CD123 -:10FDE000163255F82230002BDBD1B6F8E832E96044 -:10FDF000AB8277E7052AE0D1E9E7052AEBD1F4E702 -:10FE000009FB06F3A2692078D15CFEF7C9FB4FF429 -:10FE10007A7390F8D8C2228ABCF1010F03FB02F278 -:10FE200090F8EA82D0F8E032D0F814E0B0F8E812A6 -:10FE300036D17344D21A07FB01F39A423BD3B2FB8B -:10FE4000F3F2D3B2434528BF434680F8EA329B46DB -:10FE50004FF47A73628ABCF1010F03FB02F207FBD5 -:10FE600001F190F8EBA2D0F8E48226D1C644A2EBCF -:10FE70000E028A4203D3B2FBF1F15FFA81FCE24544 -:10FE8000524628BF624680F8EB22BBF1000F1FD11B -:10FE9000637B2846AB70FFF707FDA875BDE8F88FB8 -:10FEA0001A4407FB01F3A2EB0E029A4203D3B2FB02 -:10FEB000F3F3DBB2C6E70123C4E74244A2EB0E0E24 -:10FEC0008E4502D3BEFBF1F1D7E74FF0010CD6E728 -:10FED000002ADDD00136237D9E4291D30027B8460B -:10FEE000237D9F4204D3B8F1000F7FF4E9AECFE742 -:10FEF00009FB07F3A2692078D15C9A46FEF750FB14 -:10FF00000646A36990F8EBE290F8EA22534493F88E -:10FF100009C0197A90F8F40296F8F532724528BFB4 -:10FF20007246614538BF6146984238BF1846FFF7B0 -:10FF3000ACFA96F8EC32013783421CBF4FF001084F -:10FF400086F8EC02CCE700002DE9F84F0446007873 -:10FF50000F46FEF7DBFB054640B92078FEF792FB23 -:10FF6000054618B907263046BDE8F88FEB7D0BB182 -:10FF70000C26F8E7884B5B78012BF9D06E78002EC1 -:10FF8000F6D12046FEF758FC844B8046D3F800C0DB -:10FF90004FF00A0E334694F81490994529DCB8F1D5 -:10FFA000000F71D1FEF72EFC814500F2F380C246AE -:10FFB0004FF00A0B237D43452CD821462846FFF7F6 -:10FFC00073FE4FF001084FF00A09434695F816807A -:10FFD000B8F1000F54D000274FF00A08237D9F424C -:10FFE000C0F0C680AA7D002A00F0CC8085F8803061 -:10FFF000B9E7A2699CF830A00EFB0322107A517A6F -:020000040102F7 -:10000000504528BF5046514528BF51461072517285 -:100010000133C2E72846FEF761FA814680F80AA05C -:10002000A26921460BFB0822FFF760FAB9F80830F5 -:1000300027F8183008F10108BCE737F81A00FEF776 -:1000400093FAA26909FB0A22137A1BB14FF0010847 -:10005000013B1372537A1BB14FF00108013B5372FD -:100060002146FFF743FA21462846FFF71DFEAB7DE8 -:10007000002BAAD10AF1010A237D5345DDD8A4E75C -:10008000012BA8D1C246F7E7FEF7BCFBA9EB080895 -:1000900080453FF767AF4FF00009CB46237D4B45C6 -:1000A00011D821462846FFF7FFFD4FF001084FF019 -:1000B0000A09434695F81680B8F1000F8BD1012B41 -:1000C00089D1C24650E00A2303FB09FAA2692078CD -:1000D00012F80A10FEF764FA8046E0B190F8043393 -:1000E000A269FF2B524403D05388002B3FF440AF4A -:1000F00098F80833FF2B03D09388002B3FF438AFD8 -:1001000021464046FFF7F2F9B8F8083027F81930D1 -:1001100009F10109C2E72846FEF7E0F980F80AB0C4 -:10012000A269804621465244ECE737F81A00FEF7F0 -:100130001BFAA26909FB0A22137A1BB14FF00108CE -:10014000013B1372537A1BB14FF00108013B53720C -:100150002146FFF7CBF921462846FFF7A5FDAB7DE9 -:10016000002BA6D10AF1010A237D5345DDD8A0E773 -:1001700008FB07F3A2692078D15CFEF711FA90F82A -:10018000EA320BB91126EEE690F8EB32002BF9D0EB -:10019000013723E70926E6E6B0500021DC4D0021B7 -:1001A0002DE9F0470746FEF7B1FA0546002844D08E -:1001B0000022DFF88C80DFF88C90D8F8003093F8BC -:1001C0003510D9F80030914211D82846FEF766FB69 -:1001D0000446A8B906464FF4627AD8F8003093F87E -:1001E0003530B34218D82846FEF77EFA09E0187871 -:1001F00001280DD1D87AB8420AD1987A012803D1C2 -:100200000C242046BDE8F08793F847000128F7D07A -:10021000013203F56273D6E70AFB06F3D9F8002032 -:10022000D018D35C012B06D1C37ABB4203D1837AA9 -:100230000BB9FEF795F90136CFE70224E1E700BFDD -:10024000DC4D0021E43900212DE9F84F0446007807 -:100250008846FEF75BFA28B1C37D002B5BD120787E -:10026000FFF79EFF2078FEF70DFA064610B907202B -:10027000BDE8F88F2046FEF7F8FAE77C054618BB84 -:10028000FEF7C0FA874248D8A9464FF00E0AE37C31 -:10029000AB4208D830462146FFF742FBE37C002002 -:1002A00086F88030E4E73046FEF718F9074680F814 -:1002B0000A90626921460AFB0522FFF701FC3B898F -:1002C00028F815300135E2E73D1AFEF79BFA854222 -:1002D000CDDC00274FF00E09BA46E37CBB42D9D9EA -:1002E00009FB07FB6369207813F80B10FEF758F938 -:1002F000054648B1626921465A44FFF7E1FB2B8964 -:1003000028F817300137E8E73046FEF7E7F80546EA -:1003100080F80AA0EEE70C20AAE70920A8E7000071 -:1003200008B51E4A1E4B1F48DA631F4B1F4ADA638B -:100330001F4B204A1A60F8F729FE1F4B1F4A1A600C -:100340001F4B204A1A61204A5A61204A9A61204A6A -:10035000DA61204B204A9A61204ADA61FEF756FEA4 -:1003600011F078FE03F028FE1D4B1E4A1A601E4B4A -:100370001E4A1A601E4B1F4A1A601F4B1F4A1A6002 -:100380001F4A204B1A60204B1B681B790A2B81BF28 -:100390001E4A136A43F08053136208BDEDFB01014E -:1003A000040D0021B9FB0101B00C00214DF4010145 -:1003B000EC4D0021E5E801011C3A0021A9F2010100 -:1003C000780C00216DFB01010D3602016D35020133 -:1003D00021400201C04B0021E17B0201417A020170 -:1003E000143A002105EF0101203A002105FC01012A -:1003F000783A0021DDE50101703A00215DE6010156 -:1004000071E60101183A0021DC4D002168500021FD -:100410002DE9F047DFF8A880044698F801300D4632 -:10042000012B46D000264FF0010AB146B44220D835 -:100430000123002288F80130224B10461E461C7012 -:1004400003F11A01944203F1020326D1062013F0AE -:1004500081FA014658B1F389038042F20143438097 -:1004600073888380184B187B13F085FA0020BDE851 -:10047000F0872B6833F81600FEF776F80746D0B100 -:10048000FEF7B4F9012818D0F87AFEF73FF90136E3 -:1004900087F8199080F801A0C8E72F6837F8127024 -:1004A0001F806F6837F8127001329F8101F8010BCD -:1004B000C8E70C20DBE70220D9E70B20D7E700BF15 -:1004C000B0500021E8390021685000212DE9F041A9 -:1004D0000546FEF74DFB3D4B0446B0F8068000F59F -:1004E0009C7730220021286705F128001E6819F04A -:1004F00014FC4FF4C0720021384619F00EFC0A2398 -:1005000084F8383194F8E03040F2011284F839313F -:100510002F4B1B6893F82830A4F8482184F83A310F -:10052000D4F8E430C4F83C31D4F8E830C4F84031B1 -:10053000B4F8D432A4F84431264B9B69DB025DBF8A -:100540004FF4956303FB086393F85620A4F8462103 -:100550005CBF84F8462193F857301F4A58BF84F88F -:10056000473140F20123A4F8963104F12803C4F87E -:100570009C3104F13003C4F8A031EB686A64AB63CA -:100580004FF48073A5F840300123144A85F84230B7 -:10059000C5E91225124A6F65C4F8D021114AC4F882 -:1005A000D421114AC4F8D821104AC4F8DC21104AD9 -:1005B000C4F8E0210F4AC4F8E4210F4AC4F8E82146 -:1005C0000E4AC4F8EC21EB70BDE8F081B43A00218A -:1005D000DC4D002120500021255B01011D5F010140 -:1005E000755701013B5A010175590101075A010173 -:1005F000275A0101235B0101315F0101455F0101C0 -:10060000304B70B54FF4C0720446C688002100F527 -:100610009C701D6819F081FB0A2384F8383194F826 -:10062000E03040F2011284F83931274B1B6893F80F -:100630002830A4F8482184F83A31D4F8E430C4F8DA -:100640003C31D4F8E830C4F84031B4F8D432A4F8DE -:1006500044311E4B9B69DB025DBF4FF4956303FB86 -:10066000065393F85620A4F846215EBF84F846212D -:1006700093F8573084F8473140F20123A4F89631BB -:1006800004F12803C4F89C3104F13003C4F8A0310C -:100690000F4BC4F8D0310F4BC4F8D4310E4BC4F813 -:1006A000D8310E4BC4F8DC310D4BC4F8E0310D4BA2 -:1006B000C4F8E4310C4BC4F8E8310C4BC4F8EC310D -:1006C00070BD00BFB43A0021DC4D00212050002154 -:1006D000755701013B5A010175590101075A010182 -:1006E000275A0101235B0101315F0101455F0101CF -:1006F0002DE9F743B2F84830B1F806529046AB42C4 -:100700000446CA69B1F80AC200F1280942D8B1F812 -:100710000462B1F85E74073606FB0757BEB240F2BA -:10072000E247808AA8F84860761B0CFB06F61D4B52 -:1007300007FB06251E681C4BA61BB6105E43032351 -:100740000A3600932A4601F114037843F1B212F0FD -:10075000A9F8B0F5FA7F38BF4FF4FA70C8F84C002A -:1007600040F2E241D8F84C2048461544D8E9042329 -:10077000D21AE368256313446363A38A15444B4389 -:100780006562E363094912F04BFC0123237103B056 -:10079000BDE8F0835E1B40F2E2450CFB06F605FB6C -:1007A0000625DDE7DC390021976FF996A1E8010104 -:1007B0009C235843054BA0F5C3601B68034418797C -:1007C00018B1586A09B1DB680B607047DC39002149 -:1007D0001A4A70B5002315461178994207D906893F -:1007E00032F8024FA6420AD101222B449A76002405 -:1007F000134BA14205D80022124B5A7070BD013331 -:10080000EBE713F8012BB2B9062013F0A3F8014669 -:100810000028F3D005EB4403DB8905EB4404038097 -:1008200042F2014343806388BDE870408380064BF9 -:10083000187B13F0A0B80134DBE700BFE8390021D2 -:10084000023A0021B05000216850002108B5EAF7B3 -:1008500063FCEAF7C9FABDE80840FEF7D7BB000021 -:1008600008B5184A184BDA63184B194ADA63194B62 -:10087000194A1A60194B1A4A1A601A4B1A4A5A61D5 -:100880001A4A9A611A4ADA611A4B1B4A9A611B4A40 -:10089000DA61FEF7BBFB03F08FFB194B194A1A60B4 -:1008A000194B1A4A1A601A4A1A4B1A601A4B1B68DB -:1008B0001B790A2B81BF194A136A43F00053136254 -:1008C00008BD00BF4D080201040D0021B00C00213D -:1008D0004DF40101EC4D0021E5E801011C3A002135 -:1008E000A9F20101780C00210D3602016D350201DB -:1008F00021400201E84B0021817D0201417A020181 -:10090000143A002105EF0101783A0021DDE50101EB -:100910005DE60101703A0021DC4D002168500021A4 -:1009200070B50E46FDF720FE0546F8B18478FCB997 -:10093000C378022B1CD04FF495610E4BC2881B6804 -:1009400001FB023393B19B7893B1062013F002F8B8 -:10095000014648B1EB880671038042F2016343808F -:10096000054B187B13F007F8204670BD0224FBE707 -:100970000C24F9E7B43A00216850002138B5FDF79E -:10098000F3FD0546F0B18478F4B9C378022B1BD08F -:100990004FF495610D4BC2881B6801FB02338BB18C -:1009A0009B788BB1042012F0D5FF014640B1EB8853 -:1009B000038042F201534380054B187B12F0DBFFAA -:1009C000204638BD0224FBE70C24F9E7B43A0021A5 -:1009D000685000212DE9F0410546FEF7C9F83F4B6C -:1009E0000446B0F8068000F59C7730220021286785 -:1009F00005F128001E6819F090F94FF4C07200212B -:100A0000384619F08AF90B2384F8383194F8E0302D -:100A1000B4F8D42284F83931314B52BA1B6893F8B8 -:100A20002830A4F8442184F83A31D4F8E43040F274 -:100A30000112C4F83C31D4F8E830A4F84821C4F8D5 -:100A40004031284B9B69DB025DBF4FF4956303FB8C -:100A5000086393F85620A4F846215CBF84F8462129 -:100A600093F85730204A58BF84F8473140F20123A9 -:100A7000A4F8963104F12803C4F89C3104F1300342 -:100A8000C4F8A031D4F8F0326A646B63EB68174A9B -:100A9000AB634FF48073A5F840300123C5E91225FC -:100AA000134A85F842306F65C4F8D021114AC4F862 -:100AB000D421114AC4F8D821104AC4F8DC21104AC4 -:100AC000C4F8E0210F4AC4F8E4210F4AC4F8E82131 -:100AD0000E4AC4F8EC21EB70BDE8F081B43A002175 -:100AE000DC4D002120500021AD6601010D6B01019C -:100AF0007F640101416D0101A56C0101256D0101BA -:100B00002D6D0101AB660101216B0101356B010106 -:100B1000304B70B54FF4C0720446C688002100F512 -:100B20009C701D6819F0F9F80B2384F8383194F89B -:100B3000E030B4F8D42284F83931274B52BA1B681C -:100B400093F82830A4F8442184F83A31D4F8E430FA -:100B500040F20112C4F83C31D4F8E830A4F848213E -:100B6000C4F840311D4B9B69DB025DBF4FF49563B8 -:100B700003FB065393F85620A4F846215EBF84F881 -:100B8000462193F8573084F8473140F20123A4F806 -:100B9000963104F12803C4F89C3104F13003C4F801 -:100BA000A0310F4BC4F8D0310E4BC4F8D4310E4BEA -:100BB000C4F8D8310D4BC4F8DC310D4BC4F8E0312A -:100BC0000C4BC4F8E4310C4BC4F8E8310B4BC4F8BF -:100BD000EC3170BDB43A0021DC4D002120500021E1 -:100BE0007F640101416D0101A56C0101256D0101C9 -:100BF0002D6D0101AB660101216B0101356B010116 -:100C00002DE9F74F044616460F4600F1280BFDF775 -:100C1000AFFF40F2E24AD7F8D0310546306EB7F860 -:100C20000A2203440AFB0233B7F8C811A367A4F8E9 -:100C30007E10F8F759F9626BA16F02EB4009A28AA6 -:100C40000B1A0AFB02F22363E2634FEA4008D6E97B -:100C500004329B1A0B4408F10108C4F83490636213 -:100C600006F1A80AC5F800825846194912F0D8F9C9 -:100C7000024620B10123237103B0BDE8F08FE9895A -:100C80000123013189B2E981504611F08FF885F8CE -:100C90003901504611F0D7F886F8E100EA89A38AB5 -:100CA000B7F8C811534340F2E24253431846019348 -:100CB000F8F71AF9A26F019B13441B1A236309EB7F -:100CC000000308EB40006363C5F80002CCE700BFF7 -:100CD000A1E8010110B5044612F0F4FD034B587869 -:100CE00004445C70BDE8104012F0F8BDB45000211F -:100CF000F8B50E46054612F027FE4FF495670C4BEB -:100D000018600C4B1B6893F8224007FB0404611B1E -:100D1000B14201D90020F8BD2046711A00F0C0FF91 -:100D20000028F7D0044B0444DF81601BF3E700BFC9 -:100D3000B43A0021DC4D002168500021028841882E -:100D400010B58A4222D840F67A448B1F9BB2A34248 -:100D50001CD8063A92B2A24218D88388B3F5FA7F1B -:100D600014D240F6C41201339BB24B43534342F2B8 -:100D70001072C0884243934208D240F676430A3844 -:100D800080B298428CBF1220002010BD1220FCE7D8 -:100D90004FF495620D4B15391B68C9B20E2902FB41 -:100DA000003310D80A4A525CFF2A0CD093F88513FE -:100DB0000120914208D0D3F88C339040184214BFE0 -:100DC0000120002070470020704700BFB43A002186 -:100DD000B0AE03014FF495635843054B1B681A18D6 -:100DE000185C18B1D2F88803C0F38000704700BFC8 -:100DF000B43A00214FF49562054B1B6802FB0030AA -:100E0000D0F8883343F00403C0F88833704700BF3C -:100E1000B43A00214FF49562074B1B6802FB003384 -:100E200093F80A2332B901200A8883F80A03A3F849 -:100E30000823704700207047B43A002130B54FF4C2 -:100E4000956409499DF80C50096804FB0010D0E92D -:100E5000024125B122430B43C0E9022330BD24EAFD -:100E6000020221EA0303F7E7B43A00212DE9F04733 -:100E700000273D46DFF8D891DFF8D881D9F8003057 -:100E800093F82200D8F80030A3F59566A84201D85F -:100E90000020D8E007F59562B15CDC19002940F02C -:100EA000D4804FF49562204618F037FF0123DFF815 -:100EB000A8A12370DAE90623C4E90223DAE90A23A8 -:100EC000C4E9CC23C4E9CA2344F20172A4F88A22FB -:100ED00045F20112A4F8E62345F201325F4BA4F873 -:100EE000EA221B7B45F2014284F8903284F8EC330D -:100EF00084F8F03284F8043384F8103446F6011391 -:100F0000574EA4F80A347388A4F8FE22A4F84A3392 -:100F1000D9F80030B288DB8CADB2FB2B28BFFB23A5 -:100F2000A4F846339B0103F57473A4F848331B23DC -:100F3000A4F84E334B4BA4F84C23C4F850334FF471 -:100F4000A473A4F88852A4F8E453A4F8E852A4F8CF -:100F5000FC52A4F80854A4F8543340F2011304F2EC -:100F60004E31A4F85430204600F0DBFE04F2463146 -:100F7000A4F86003204600F0D4FEB37DB28A84F862 -:100F80006433062384F896329AF84030A4F85E035E -:100F900084F8F233F37DA4F8622384F87033338B42 -:100FA000A4F87233738BA4F8743340F20223A4F8CC -:100FB0006633022384F868332B4B1B681BB11B6814 -:100FC0000BB128469847D4F834230023910721D544 -:100FD000DAF8182012041DD5012284F81A24D9F851 -:100FE000002084F8193492F8421084F81C1492F806 -:100FF0004320C4F8203484F81D24042284F81E34CD -:1010000084F82A2484F82934C4F8483484F8453410 -:1010100084F851340125F269B38CC4F85424326A3F -:10102000A4F85C34C4F85824A4F85E5410F040FED0 -:101030009AF8003028462B448AF8003011F0AEFDB3 -:10104000D8F800003844BDE8F087174601351DE7A1 -:10105000DC4D0021B43A00212050002168500021CD -:10106000B450002148011B00B83A0021F7B50446EE -:1010700001F0C3F8FFF72EFE204601F02BF82B4EAF -:1010800004F5197738460DF1070112F083FC054687 -:1010900000283CD104F5217012F07BFE04F5787035 -:1010A00012F077FE04F5397012F073FE04F53E700D -:1010B00012F06FFE04F2044012F06BFE04F28C405A -:1010C00012F067FE1A4B1B481D681B4B651BED1089 -:1010D00045431B68ADB21BB15B680BB1284698470E -:1010E000164B1B680BB1284698470023D4F8000420 -:1010F000237008B112F036FC10F0E2FD104A012016 -:101100001378013B137011F05FFD03B0F0BD9DF843 -:101110000730FF2B06D012F0D5FB33780133337044 -:1011200012F0DCFB284612F01DFCABE7B4500021A6 -:10113000B43A0021BDCAE28CB83A0021203A00211D -:101140002050002170B590F80F22034601FB0222C7 -:1011500090F80E120A4491B2242909D94DF668522A -:101160004A43520D02EBC20002EB8002891A89B297 -:10117000C1F12005D3E98626A1F12004CA4006FA70 -:1011800005F52A4326FA04F42243C8B2D20783F8AD -:101190000E020AD493F810228A4203D8122A07D9E1 -:1011A000801AC0B2184490F8200270BD801AC0B2F4 -:1011B0008242FBD9F6E700221346F0B5D0E98676E5 -:1011C000C3F12005A3F1200427FA03F106FA05F57F -:1011D000294326FA04F42143C90744BF811881F842 -:1011E000203203F1010348BF0132252BE8D180F8FA -:1011F0001022F0BD37B501460446684605F0FBFAFB -:101200002E4ABDF80030116891F822209A4209D880 -:10121000204612F0A7FB2A4B01215B68BDF80000B5 -:1012200098470AE04FF495625343264A1268D5184E -:10123000D35C23B9204612F095FB03B030BD6B7828 -:10124000032BE5D0204A9DF8023012680AB9032B1F -:10125000DED0032BBDF8042000D062B3C98C9142CC -:1012600007D2002BD4D1002AD2D1012385F88132B4 -:10127000CEE712F027FB154A1378013B137012F0EA -:101280002DFB95F8983273B9284600F05EFD234691 -:1012900001466A46284600F08DFD094B0421187B63 -:1012A00012F004FCC9E722469DF8001005F51970FC -:1012B00012F05BFBC1E7002BD7D0A9E7DC4D002182 -:1012C00068500021B43A0021B83A0021B4500021FE -:1012D00070B54FF495660B4B0B4D1B6893F822408D -:1012E000013C06FB04F32A68D018D35C2BB9631EBB -:1012F0000CB9204670BD1C46F3E700F05DFF0028E6 -:10130000F5D0F7E7DC4D0021B43A0021FFF7E2BC4D -:101310004FF49562024B50431B68185C704700BF46 -:10132000B43A0021024B1B6803B1184718467047B6 -:10133000143A0021034B1B6803B118474FF6FF70A6 -:10134000704700BF703A0021024B1B6803B1184779 -:1013500018467047183A00214FF49562024B1B68FB -:1013600002FB003398787047B43A00214FF495623D -:10137000034B1B6802FB003393F90C02704700BF5C -:10138000B43A00214FF49562034B1B6802FB003313 -:1013900093F94A00704700BFB43A00214FF49562B8 -:1013A000034B1B6802FB0033D3E98601704700BF83 -:1013B000B43A00214FF49562034B1B6802FB0033E3 -:1013C000D3E9CC01704700BFB43A00214FF49562D5 -:1013D000034B1B6802FB003393F85400704700BFB7 -:1013E000B43A00214FF49562034B1B6802FB0033B3 -:1013F00093F85500704700BFB43A00214FF495624E -:10140000064B1B6802FB003090F88533132B1ABF84 -:10141000D0F88C03C0F3C04001207047B43A0021DB -:101420004FF495635843002310B5054C22680244DD -:101430001A4492F86623CA540133032BF6D110BD27 -:10144000B43A00214FF49562044B1B6802FB003351 -:101450005B7C194214BF012000207047B43A002180 -:1014600038B5044604200D4612F074FA014678B1EE -:10147000084B1868084B241AE4105C4301238B7056 -:10148000064B0C80CD70187BBDE8384012F073BA63 -:1014900038BD00BFB43A0021BDCAE28C68500021BB -:1014A0002DE9F7434FF00008224FCDF804803B6848 -:1014B000214E93F8224012F005FA4FF49563651E11 -:1014C0005C433368A4F59564234401AA197821B1DB -:1014D00093F87C1283F87C82A954013D691CA3F522 -:1014E0009563F3D14FF4956812F0F8F93B68DFF893 -:1014F0004C9093F8224001AF013CE15D21B1D9F855 -:1015000004300BB1A0B29847356808FB045595F834 -:10151000983243B105F51B7012F0DCFB18B13E2187 -:101520002846FFF79DFF631E14B903B0BDE8F083A2 -:101530001C46E2E7DC4D0021B43A0021685000214E -:101540002DE9FF410023464E464FDFF81C81ADF8E0 -:1015500006300DF1060000F007FE044630BB434F95 -:101560003B6893F8225012F0ADF94FF49560336860 -:10157000013D03F27D2302AE00FB05F2995CA95503 -:10158000013D9C54F8D212F0A9F93B68384D93F80C -:101590002240013C315D19B1AB680BB1A0B2984754 -:1015A000631E002C5AD104B0BDE8F0814FF495625F -:1015B000BDF8063053433268D518D35C2BB900F020 -:1015C000B7FD0120FFF786FBC3E7214602A805F01F -:1015D00023F995F8A530F3B1264B1B687BB1214662 -:1015E00005F18C00984750B9204600F0A1FD01207C -:1015F000FFF770FB48212846FFF732FFA9E7D5F82F -:10160000F41205F53E7012F0BEFBD5F8E01205F5B8 -:10161000397012F0B8FB9DF80830022B09D893B14D -:1016200095F89732002BDFD12146284600F0ACFD1B -:101630008FE7032B07D1D8F8003013B12146284695 -:1016400098472046BBE73B68002BFAD05B69002B2C -:10165000F7D02146BDF8060098477AE71C4699E77F -:10166000B43A0021B83A0021243A0021DC4D00218F -:1016700068500021843A00210246B2F80432B2F8E0 -:101680000A220433534303EBA30213F0030318BFEE -:10169000012313448B42084605D20A2903D9C81AEC -:1016A0000A2838BF0A207047F8B58B7E0746012B01 -:1016B0000D4608D1CB6A1B78043B012B03D8446A42 -:1016C000637813B92F463846F8BD4E6A94F89532C0 -:1016D00096F895229A42F5D842F2107C40F2E24008 -:1016E000D6F88C22B6F80A120CFB02F24143B2EB98 -:1016F000410FE7D3002BE6D1D4F88C32B4F80A229C -:101700000CFB03F34243B3EB420FDCD396F8853373 -:10171000FF2BD7D194F88533FF2BD4D106F51B705E -:1017200012F0D8FA0028CDD004F51B7012F0D2FACE -:101730000028C8D0B6F80A32B4F80A22B2EB930FE8 -:10174000C0D3B3EB920FBDD2BDE7000008B511F0D6 -:10175000C7FA142813D91E2813D9322813D94B28B5 -:1017600013D9642813D9962813D9FA288CBF0020DE -:101770000120094B93F840301844C0B208BD07203F -:10178000F7E70620F5E70520F3E70420F1E703205B -:10179000EFE70220EDE700BF2050002110B504461E -:1017A000FFF7D4FF40B220B9012C14BF0020432022 -:1017B00010BD072801D1002CF7E70020F8E7000052 -:1017C0004FF495635843084B1A681318105C48B1DE -:1017D00093F84820042A04D1D86919B11B6A0B6018 -:1017E00070470020704700BFB43A002130B58378BD -:1017F000B0F80A52A3B947F6FE73B0F80642C069C2 -:101800000A1B92B29A4240F2E24303D86A4303FBB6 -:10181000020030BD611A8AB26A4302FB1300F8E786 -:1018200047F6FE74B0F8CA314A1CD21A92B2A242EC -:10183000D0F8D00103D840F2E2436A43E7E7C94356 -:101840000B449BB240F2E2426B43E6E74FF49562F1 -:10185000044B1B6802FB0033D3F8403403B1184734 -:1018600018467047B43A0021114B10B59A6AD10559 -:101870004CBF03230123120548BF43F004035A0061 -:1018800002F008021A434FF07F33C0F839330123C6 -:1018900000F5147100F515701A4214BF7E247F24E0 -:1018A00001F8014B5B008842DBB2F5D110BD00BFEF -:1018B0002050002113B504460DF107010DF106007B -:1018C00014F08EF99DF90630A34207DA9DF907302E -:1018D000A342D4BF0220002002B010BD0120FBE7CC -:1018E000294B2DE9F0471C684FF4956303FB004436 -:1018F000D4F8503286B00846059394F94A6014F043 -:10190000A5F90422014684F84A00054604F514703E -:1019100018F003FA6378022B11D1AE420FD0D4F83D -:1019200034335B070BD5194B1F6847B10023AA1B43 -:1019300094F854102046009352B22B46B84794F8BE -:101940001734EBB10027DFF848A00DF1140818F99F -:10195000016BAE4211D0DAF80090B9F1000F0CD053 -:101960002846FFF7A7FF0022AE1B76B2CDE901069D -:10197000114620460095FBB2C8470137042FE6D137 -:1019800006B0BDE8F08700BFB43A00219C3A0021C0 -:101990007C3A00212DE9FF41244B15461C684FF489 -:1019A000956303FB004494F94A800AB994F85450B3 -:1019B000084614F04BF9A0EB08077FB2064697B330 -:1019C00094F85430AB4217D1637884F84A00022B64 -:1019D00012D1804510D0D4F834335B070CD5144BAA -:1019E000D3F80080B8F1000F06D000233A460093E8 -:1019F000294603462046C047254485F84F6294F89F -:101A0000173483B10B4B1D686DB194F94A0094F8FB -:101A10005480FFF74FFF0022CDE9010743461146EE -:101A200020460096A84704B0BDE8F081B43A0021F2 -:101A30009C3A00217C3A00212DE9F84305460E46E8 -:101A40000027DFF89C90DFF89C80D9F80030BCB20A -:101A500093F82230A34201D8002013E02046FFF77C -:101A600057FC08B32046FFF777FCF8B91E4B1B68FC -:101A70000BB12046984716212046FFF789F9012827 -:101A800002D10C20BDE8F883102011F063FF01465D -:101A90000028F6D041F20163C0E902564380134B9F -:101AA0000480187B11F067FF0137CEE7D8E90023E7 -:101AB000B34208BFAA42F7D00D4B1C684FF49563A0 -:101AC00003FB0744D4F834331B0606D594F845339A -:101AD0001BB113F091FFC4F8F001C8E90056E3E729 -:101AE000DC4D002158000021EC4D00216850002100 -:101AF000B43A00211049F0B5C969002908DA002478 -:101B00000E49096891F822500D490968A54201D88B -:101B10000020F0BD0E784EB1D1E9C4769E4208BFD8 -:101B2000974203D191F81863864203D0013401F53E -:101B30009561EBE70120ECE720500021DC4D00210E -:101B4000B43A0021030203F00F3300F0F0300343F6 -:101B5000180100F0333003F0CC331843830003F056 -:101B6000553300F0AA301843C0097047B0F8461248 -:101B70000246B0F80602F8B54840FFF7E3FF00EB75 -:101B80000010084480B2FFF7DDFF00EB00100844AE -:101B900080B2FFF7D7FF4DF6685300EB0010084402 -:101BA000414089B24B435B0D03EBC30003EB800361 -:101BB000CB1A9EB2C6F12005D8B2A6F12004D2E914 -:101BC0008637F34007FA05F52B4327FA04F423433D -:101BD000DB0782F80E025FBF92F81002414302EB6E -:101BE000114292F82002F8BD064A074B5A60074B93 -:101BF0001B681B79082B81BF054A136A43F4804395 -:101C0000136270476D1B02010C3A0021DC4D00216C -:101C10006850002108B511F055FE044A13780133CD -:101C20001370BDE8084011F059BE00BFB450002148 -:101C3000022808D0032809D00E31C8009042A8BF5E -:101C4000104680B270470F318800F7E78901B2F57E -:101C5000296F38BF4FF4296201F57470EEE738B58B -:101C600083780446DBB183685B0518D5B0F804328D -:101C7000ABB113F0C1FE40F2E243B4F80A520146A0 -:101C8000E0695D4311F03EF8854208D2012304F17A -:101C9000140084F8D931BDE8384011F099BB38BD43 -:101CA00000232DE9F04705460E4682469946154A1F -:101CB000154F13603A68DFF85480D48C144A1A34F4 -:101CC0005443C8E90033640D0234E4003B6893F8E0 -:101CD00023304B4503D8AAEB0500BDE8F0875046FA -:101CE00011F032FE00EB040AAAEB0503B3420146F1 -:101CF00005D8404611F07CFF09F10109E6E7002014 -:101D0000EBE700BFC83A0021DC4D0021BC3A0021BE -:101D1000692F010080F865137047002380F8653350 -:101D2000704738B5CA880C460546898890F8540033 -:101D3000FFF77EFF62880346218895F85500FFF77C -:101D400077FF1844963080B238BD014690F8542091 -:101D500090F86503B1F8543350B1012A06D0022A35 -:101D600008D100F00102C2F10202D2B2400717D43A -:101D7000022A10D0032A13D06F2B18D9503BDB1046 -:101D8000043B98B21B2838BF1B20B1F8523398424D -:101D900028BF184670473B2B09D92C3B9B10EFE717 -:101DA000B3F5747F03D3A3F534739B11E8E70020E8 -:101DB000E8E700002DE9F04F9846938889B0064681 -:101DC00048480F461446029311F024FF0546F0B12F -:101DD00000F108030193A38808F104029F4228BF81 -:101DE0001F46039787730027BB468381C7738260B2 -:101DF000029B9B451BD306F51B70019A217811F0BD -:101E0000B4FD304609B0BDE8F04FFFF728BF4046AB -:101E100011F0A8FD344B208801215B689847FFF73B -:101E2000F9FE072009B0BDE8F04FF7F74DB8029B67 -:101E3000DDF80CA0A3EB0B039BB29A4528BF9A4692 -:101E400000205FFA87F808F101030199DB0003F134 -:101E500002098944A178CDE90600A4F804A009B3D9 -:101E6000012925D006A94846CDE904238DF81DA0F7 -:101E700004F078FC02211D4B05EBC8081B6888F8AC -:101E8000101019469C46DDE90423E9B9002388F8BF -:101E900011300123A3700BEB0A031FFA83FB52449A -:101EA0000137A5E702208DF8180086F88112D9E7DE -:101EB0008DF8181096F881120129D3D102218DF8DE -:101EC00018104FF00001F0E7019904330B4406F1BC -:101ED0008C0049460492E047049A0028D6D0042397 -:101EE000D5E700BFBC3A002168500021883A0021A4 -:101EF00070B590F87E320446013380F87E320B785C -:101F00000A461B2B0CBF032502250C4B4D1B1E68DC -:101F100026B16B788C300B442946B0472A4604F52D -:101F20001B70FF2111F021FD054B0421187B11F0DE -:101F3000BDFD2046BDE87040FFF791BE883A002104 -:101F40006850002137B50546063011F003FD044600 -:101F500058B10023CDE90033032369468DF80030E2 -:101F60008DF8055004F0FEFB0444204603B030BD5C -:101F7000F0B500F51B7585B00F4628460DF1070139 -:101F8000164611F010FD0446002849D0284611F0ED -:101F9000ADFE9DF807300546FF2B34D0A079E379DC -:101FA000024603FB00FCA18804EBC30E6044884298 -:101FB00003F101039EF808004FEAC303388003F1E0 -:101FC0000200204478602068C8BFA1EB0C02604486 -:101FD000F8609EF80900C8BF92B23A8178B13882A1 -:101FE0000320043323447B615DB102EB0C05A9425D -:101FF000D4BF00250125EDB2357005B0F0BD02203B -:10200000F2E70125F7E7B0FA80F5214602A804F0CF -:1020100003FC63786D0903443B8001207C60EBE79F -:102020000546E9E737B500F51B7420460DF10701B9 -:1020300011F0B9FCB8B19DF80720FF2A07D0C1798B -:1020400083794D1C01FB033381888B4209DB074BED -:102050000DF107011860064B20461A7011F09AFC2A -:1020600000E0C571012003B030BD00BFC83A0021B7 -:10207000C43A002170B5134E0546306800B3124BC8 -:102080001B78FF2B19D0044654F80809043811F0C6 -:1020900069FC21460D4811F0ABFDFFF7BBFD95F83B -:1020A0007C32013385F87C3200233360084B0121F8 -:1020B000BDE87040187B11F0F9BC11F053FCF3E758 -:1020C00070BD00BFC83A0021C43A0021BC3A0021CB -:1020D00068500021F7B50025104F00F51B763046FB -:1020E0000DF1070111F056FC044610B9284603B063 -:1020F000F0BD9DF80730FF2B0DD054F808090135CD -:10210000043811F02FFC2146384611F071FDEDB274 -:10211000FFF780FDE3E711F025FCE0E7BC3A002182 -:102120000C3008B580B211F015FC00B1023008BDCA -:10213000023811F017BC000008B5134600F8021C65 -:10214000090A00F8011C821ED9B2054811F00DFCE5 -:10215000044B0221187BBDE8084011F0A7BC00BF6A -:10216000BC5000216850002113B504460DF1070151 -:10217000044811F00FFC18B19DF80730023023809D -:1021800002B010BDBC50002110B50446084B094AEE -:102190001B68C31ADB10534300F51D708A1ED9B2A9 -:1021A00011F0E3FB94F87D32013384F87D3210BDE9 -:1021B000B43A0021BDCAE28C1FB500F51D700DF1C7 -:1021C000070111F0E7FB0446A0B183789DF80720D2 -:1021D00003F00303ADF80820C278012BADF80C2002 -:1021E00002D0022B18BF0323204602A98DF80A3023 -:1021F00004F0A8FA204604B010BD73B5002400F521 -:102200001D7528460DF1070111F0C4FBE6B201343B -:1022100010B9304602B070BD11F0A4FBF1E7000028 -:102220004FF49561028803464A430B4909688818B0 -:102230008A5C82B1094A1360B3F86220A0F8A22434 -:1022400093F8602080F8A024D97883780BB905F042 -:10225000A3B905F06BBA7047B43A0021B03A002137 -:102260002DE9F04100244FF495680E4E0E4F33686F -:1022700093F82230A34201D8BDE8F08108FB04F3B3 -:102280003A68D518D35C53B105F51B7011F022FDE7 -:1022900028B9AB781BB93D21284605F07DF90134FA -:1022A000E5E700BFDC4D0021B43A002108B5E9F7AD -:1022B000CFF9E9F7B1F810F02BFA00F099FBBDE87F -:1022C00008400FF0D5BE000010B503780446B3B146 -:1022D00082780B4804F0A8FCA37818B11E2808D017 -:1022E0000D2100E00C2120462BB9BDE8104005F07F -:1022F00053B90E21F7E7BDE8104005F017BA10BD3D -:10230000283A0021837870B5FF2B044605D0BDE83C -:1023100070400B4B1860FFF783BF0023094D084E38 -:1023200003802B68228893F822309A4200D370BD34 -:1023300020463460FFF774FF238801332380F0E7E1 -:10234000B03A0021DC4D00212DE9F3470446002777 -:102350000D4600F14809002116461430302217F0CE -:10236000DCFC4FF4C0720021484617F0D6FC47F25F -:10237000305184F80E72D5E90623C4E98623A4F807 -:10238000067295F82A304FF0FF0884F80F322B8C34 -:102390002046A4F80A326B8C4FF0020AA4F80432EB -:1023A000AB8CC4F8F41203EB83035B00A4F8823215 -:1023B000FFF762F984F885836B69C4F8E002C4F81A -:1023C00048322B692046C4F84C32FEF7F4FE2B69E4 -:1023D000204683EA1342A4F84622042284F84820C7 -:1023E000424A126892F82820E36484F84A206B6914 -:1023F0000125236540F2011384F856A0A4F8543057 -:10240000FFF732FA84F8548204F24E31204684F801 -:10241000A650FFF786FC40F2E248A4F8600304F2FD -:1024200046312046FFF77DFCB4F86033304A236222 -:10243000B4F80A32226308FB03F36362A3622D4BF4 -:102440002D4AC4F8E0302D4BC4E90D24C4F8E43023 -:102450002B4BA4F85E03C4F8E8302A4BC4F8409034 -:10246000A58584F82E50C4F8EC30002E3BD094F8AB -:1024700056102422B94208BF514694F85400D6F8A9 -:102480009C510FF088FE10228146514694F8550069 -:102490000FF081FE94F855309635032B0CBF0322C4 -:1024A0005246194B4D441968184B611A0544C9101E -:1024B00008FB02555943B4F80A023B462A4608FB7A -:1024C00000F00097C9B210F0EDF9114BA0FB0332F8 -:1024D000DB0F43EA420386F8E7342844C3F30723BB -:1024E00086F8E834E06102B0BDE8F087DC4D0021F9 -:1024F000E172010115720101D9770101C97201016F -:102500000178010121780101B43A0021BDCAE28CB1 -:10251000E3361A000D4B10B51A68002192F83D30D1 -:10252000044680F8453292F83E2080F8552080F825 -:102530005420074A52F82330984784F8490004F1A0 -:102540001400BDE8104010F06FBF00BFB03A00218A -:102550000C3A002108B5204A204B21485A60214BF3 -:10256000214A5A60214B224A5A60224A9A60224AE2 -:102570001A60224B224ADA60224A5A62224B234ACC -:102580001A60234B234A1A60F6F700FD00F030FA78 -:10259000214B1B681979062907D9204A0729D2E956 -:1025A000083003D143F00E03136208BD082902D19D -:1025B00043F02E03F8E7092902D143F48033F7E70B -:1025C0000B29174988BF40F0800041EA03018CBF06 -:1025D000C2E908101162E8E7AD220201040D0021F2 -:1025E000391A0201B00C002105230201780C0021E8 -:1025F0004115020161220201A1140201C04B002118 -:10260000E188020109810201243A0021C922020164 -:102610000C3A002145110201DC4D002168500021D7 -:102620002E00010508B50FF0A0FA20F07F4008BD8C -:1026300008B50FF09AFA00F00702C0F30123053243 -:102640001344C0F30040184408BD00004FF49561E6 -:10265000028803464A430549096888188A5C22B102 -:10266000034AD978136005F061B87047B43A002185 -:10267000B03A0021F0B58BB00446FEF7F7FBD4E981 -:102680001267054688B3C0E9C46794F83C300B2153 -:1026900080F81833234B1C600123837094F860305A -:1026A00080F8A034B4F86230A0F8A23405F03EF807 -:1026B0006FF47F42236E23F47F43934230D1012095 -:1026C00010F082FA94F83F3053B30021164B207873 -:1026D0001A6894F84030AA1A144DD2106A4392B284 -:1026E0000BB0BDE8F0400FF09ABAB4F862300121A7 -:1026F000099394F86030CDE90067CDE90703092319 -:102700000693D4E91623CDE90423D4E91423CDE9B3 -:10271000022394F83C3004F10802ECF77FFBC7E792 -:102720000BB0F0BDB03A0021B43A0021BDCAE28C32 -:1027300010B50378044683B18278084804F074FA2F -:1027400018B11E2807D00D2100E00C212046BDE85D -:10275000104004F0EBBF0E21F8E710BD283A00212D -:10276000837870B5FF2B044605D0BDE870400B4B55 -:102770001860FFF76BBF0023094D084E03802B68DC -:10278000228893F822309A4200D370BD20463460EC -:10279000FFF75CFF238801332380F0E7B03A002184 -:1027A000DC4D002110B5044610F09AFA072C28BF22 -:1027B0000724034B33F81430184480B210BD00BF17 -:1027C000C0AE03012DE9F84F7F4F00F1140830220D -:1027D00000213D6800F148090446404617F09DFA83 -:1027E0004FF4C0720021484617F097FA95F841302F -:1027F000002B00F0E58095F83E30032B14BF022635 -:1028000003264FF0010A2B8EA4F8CAA11E4495F8A6 -:102810003D304FF0FF0B84F84532D5E90823C4E979 -:10282000862395F83230B6B284F80F322B8DA4F897 -:102830000A3295F83300FFF7B5FF47F230516B8D40 -:10284000A4F8C801A4F80432AB8D204603EB83033F -:1028500003FA0AF3A4F88232C4F8F412FEF70CFF6C -:10286000062284F885B3EB69C4F8E002C4F8483264 -:1028700095F82E30298D334402FB013303EB93018D -:1028800013F0030318BF534604F52170194411F0E7 -:102890007AFA2046FEF78FFCAB69204683EA1342A2 -:1028A000A4F84622052284F84820484A126892F883 -:1028B0002820E36484F84A20EB6923653B6893F899 -:1028C0003E3084F8553084F85430FEF7CDFF84F85C -:1028D000A6A084F854B204F24E312046FFF721FA44 -:1028E00004F24631A4F860032046FFF71AFA40F2DA -:1028F000E24BA4F85E0395F82E500BFB06F60BFB9B -:1029000005F5B4F8C8117019F6F7EEFA3B689B6B41 -:10291000C4F840901E442E4BC4E9735623632D4BDC -:1029200005EB4005C4E90D34B4F80A3205F2263748 -:102930000BFB03F3A362284B5544C4F8E430274B48 -:10294000361AC4F8E830264BA4F82CA0C4F8EC30B2 -:10295000244B84F82EA0DFF89090DFF890A0E66179 -:102960002762C4F8E050C4F8F03094F845320021F2 -:10297000204659F823309847514684F8490040468C -:1029800010F04EFBF0B9B4F80662B4F8C811013685 -:10299000B3B2B4F80A62A4F806325E4340F2E243EE -:1029A0005E433046F6F7A0FAD4F8D0311E44361A0A -:1029B0003B1805EB4000E6612362C4F8E000D4E771 -:1029C00001261EE7BDE8F88FB03A0021DC4D00215A -:1029D000817B010145820101E17A01017D7B0101D9 -:1029E00065820101858201010C3A0021A9160201CC -:1029F0004FF49562044B00211B6893F822305A4330 -:102A0000024B186817F089B9DC4D0021B43A002157 -:102A100008B5224A224B5A60224B234A1A605A6850 -:102A20000AB9224A5A60224B224A5A60224A1A6044 -:102A3000224B234ADA60234A5A62234B1A680AB9A6 -:102A4000224A1A60224B234A23481A60F6F79EFA5C -:102A5000FFF7CEFF214B1B681979062907D9204AB9 -:102A60000729D2E9083003D143F00E03136208BDF1 -:102A7000082902D143F02E03F8E7092902D143F4D3 -:102A80008033F7E70B29174988BF40F0800041EAFF -:102A900003018CBFC2E908101162E8E7E92A0201CC -:102AA000040D0021B00C00217526020161270201EE -:102AB000780C002141150201A1140201E84B00210C -:102AC000E98C020109810201243A00213127020127 -:102AD0000C3A002145110201391A0201DC4D002196 -:102AE000685000212E00010508B5E8F7B1FD0FF090 -:102AF0000FFEFFF77DFFBDE808400FF0B9BA0000F8 -:102B000070B5037804460E4633B38278134804F058 -:102B10008BF8054638B9A378B3B10C212046BDE83F -:102B2000704004F003BE3146A2780C4804F01EFA4F -:102B30000028F0D01E2DA37801D01E280AD10E2126 -:102B40002046002BEBD101E00C212046BDE870406F -:102B500004F022BD0D21F3E770BD00BF283A00212B -:102B600008B5FFF7F7FC0E4B0E4A1A600E4A5A6082 -:102B70000E4B0F4A1A600F4B0F4A1A600F4B104A48 -:102B80001A60104A136A43F0010111620E49096884 -:102B90000979062984BF43F01103136208BD00BF01 -:102BA000C04B0021A991020199960201243A00210B -:102BB000012B0201A43A002171540301A03A002123 -:102BC0007554030168500021DC4D002170B5037875 -:102BD00004460E46D3B182780D4804F025F8054628 -:102BE00028B90C212046BDE8704004F09FBD314655 -:102BF000A278074804F0BAF90028F2D01E2D01D0BF -:102C00001E2801D10E21EDE70D21EBE770BD00BFBD -:102C1000283A00210F4B104A1A60104A5A60104B94 -:102C20001A680AB90F4A1A600F4B104A1A60104B03 -:102C3000104A1A60104A136A43F0010111620F49E9 -:102C400009680979062984BF43F011031362FFF76D -:102C5000DFBE00BFE84B00210D95020199960201ED -:102C6000243A0021CD2B0201A43A00217154030122 -:102C7000A03A00217554030168500021DC4D002169 -:102C80004FF49562034B1B6802FB0033D3F8F40248 -:102C9000704700BFB43A002138B51B4B0D461C6885 -:102CA0004FF4956303FB00442046FEF7E5FCB4F8BF -:102CB0005E24B4F80A32854202FB03F3B4F804221E -:102CC00002FB033340F2E24202FB03F34FF47A7259 -:102CD00005FB02F215D0934213D894F8A530C4F83E -:102CE000F452C4F8E00253B1294604F53E7011F0E5 -:102CF0004AF8D4F8E01204F5397011F044F80120D4 -:102D000000E0002038BD00BFB43A0021C07804F0D4 -:102D10004DBE00002DE9F047624C064604F1D00597 -:102D20008A46914600212C2204F19C00984616F018 -:102D3000F4FF4FF4C0720021284616F0EEFF012286 -:102D40000223594F84F8B620C4F8C850574A584D4A -:102D5000387AC4E92E2284F8B43084F8D030F6F7FB -:102D600007FA95F83030534A84F8D230524B84F841 -:102D7000D100C4E9352340F20113A4F8DC30032369 -:102D800094F84220A4F850310AB1A4F852312D2011 -:102D90003B7A84F89A0184F89B31484BC4F8783127 -:102DA00010F0D8FD464BC4F86801C4F88031F6F73E -:102DB000BBF8A065FFF736FC012384F86E30B4F849 -:102DC0008230E065A4F86830B388A4F86A30F388EC -:102DD000A4F86C30D5E90E23C4E91823FFF728FCCA -:102DE00084F87200FEF7B2FC052384F850322223E7 -:102DF00084F85432AB6A84F87300C3F3803384F8E8 -:102E0000513294F84130DB0746D5D5E90823C4E9AF -:102E10005623D4F8543143F00203C4F85431D4F8A3 -:102E2000543143F00102C4F8542195F831201AB10D -:102E300043F05103C4F85431D4F85401D4E956672F -:102E4000C0F3400384F8523294F84230C4E9126768 -:102E500093B90AF00101C4E91498C4E9589884F8B8 -:102E6000531219B140F00800C4F85401D4F8543199 -:102E700043F00403C4F854311249A1F5147002F070 -:102E800087FC1149204402F0CFFC2423C4F86C4194 -:102E900084F89931BDE8F0870C4BD3E90C23C4E9E1 -:102EA0005623BCE7D03A0021F8500021718401017B -:102EB00020500021D6BE898E55555500E184010170 -:102EC00071860101203D0021183B0021685000213E -:102ED00010B50FF011FF40F271220A4C00F2CC4005 -:102EE000E38FC4F8A8005343C4F8AC30002304F1C6 -:102EF0009C00A4F8983010F03FF8D4F8A430A363F5 -:102F000010BD00BFD03A00214FF4187200210148D3 -:102F100016F003BFD03A0021034B044ADA60044B99 -:102F2000044ADA60FFF7F0BF040D0021392F0201D7 -:102F3000B00C00210D2D0201FFF7E6BF034B93F803 -:102F40002400003818BF0120704700BFD03A00218C -:102F5000034B53F820301878003818BF0120704711 -:102F6000D0AE03012DE9F843044600F59C760F46E8 -:102F700091460021302200F582701D4616F0CDFEEC -:102F80004FF4C0720021304616F0C7FE032384F8C8 -:102F90001C31012384F81E31604BDFF88481C4E9C1 -:102FA00048330223C4F830615E4E84F8383198F813 -:102FB0000800C4F82841F6F7DBF896F830305A4993 -:102FC00084F83A31594B84F83901C4E94F13237C12 -:102FD0004220022B14BF40F2011340F20333A4F845 -:102FE0004431832394F86A20A4F8B831D20748BF4B -:102FF000A4F8BA3198F8083084F8020284F8033251 -:103000004B4BC4F8E0314B4BC4F8E43110F0A2FC58 -:10301000C4F8D00100287FD0474B04F12808C4F839 -:10302000E831F5F781FFA063FFF7FCFA012384F88C -:103030004E30B4F86230E063A4F84830BB88A4F89E -:103040004A30FB88A4F84C30D6E90E23C4E910239B -:10305000FFF7EEFA84F85200FEF778FB052384F8B8 -:10306000D030222384F8D43094F86B3084F85300A5 -:10307000DB074BD5D6E90823C4E97023D4F8BC316B -:1030800043F00203C4F8BC31D4F8BC3143F0010270 -:10309000C4F8BC2196F831201AB143F05103C4F8AA -:1030A000BC31D4F8BC11D4E97067C1F3400384F893 -:1030B000D23094F86A30C4E90A67A3B99DF82000B9 -:1030C000C4E90C9500F00100C4E9729584F8D300BE -:1030D00018B141F00801C4F8BC11D4F8BC3143F078 -:1030E0000403C4F8BC3104F1780504F1D00128468A -:1030F00002F04EFB4146284402F096FB24230020B8 -:10310000C4F8D45184F80132BDE8F8830B4BD3E9FD -:103110000C23C4E97023B7E71F20F5E7818701017D -:10312000F850002120500021D6BE898E55555500FB -:10313000F1890101158A01014D88010168500021C2 -:1031400010B504460FF0D8FD40F27122638B00F2F7 -:10315000CC405343C4F814310023C4F81001637009 -:10316000A37004F582700FF007FFD4F80C3163668A -:1031700010BD00002DE9F743C77804467A1E012AE6 -:10318000837847D9A3F1FF056B426B412288324D0A -:10319000FF2A41D0002B3FD1AB7A1341D80705D588 -:1031A0002E4B394653F8220004F01CFCE378012B27 -:1031B0004FD100242A4B294F1E68AB7A2341DA07EE -:1031C0003AD40134032CF8D100244FF495676C7283 -:1031D000D6E90223C5E90023B379DFF88090DFF850 -:1031E00084802B72AB7A2341DB070FD559F824601A -:1031F000D8F80030B6F86000002207FB003006F176 -:103200002801FFF7A1F83046FFF79AFF0134032C9D -:10321000E8D11EE00123B9E70026DFF84080AB7A51 -:103220003341D90704D5394658F8260004F0DAFBB3 -:103230000136032EF3D1B9E77379B179019333796C -:1032400057F824000093D6E90223ECF7EBFC0028A2 -:10325000B7D003B0BDE8F083303D0021D0AE03010C -:10326000540D0021B43A00212DE9F8434FF4C07702 -:10327000044600F53A780021164600F52E703022FB -:103280001D4616F04AFD00213A46404616F045FD1F -:10329000022384F8D0320123354A84F8D232C4E9BB -:1032A000B522062284F8A033324B3348C4F8843365 -:1032B000002384F8E82290F83020DFF8C0C084F8BA -:1032C000EA222F4AC4F88833C4E9BBC294F86A20C2 -:1032D00094F86B30D10748BFA4F86A73D907C4F8D3 -:1032E000E482C4F8DC42A4F868733AD5D0E90889CE -:1032F000D4F86C13C4E9DC8941F00201C4F86C1302 -:10330000D4F86C1341F00103C4F86C3390F83130F9 -:103310001BB141F05101C4F86C138AB99DF82030FB -:10332000C4E9DE65DB0742BFD4F86C3343F0080321 -:10333000C4F86C33D4F86C3343F00403C4F86C3332 -:1033400004F17803C4F880332423002084F89833F0 -:103350000C4B6070C4F88C33A07084F80001BDE899 -:10336000F883094BD3E90C89C4E9DC89C8E700BFBD -:10337000E9870101B18A010120500021D6BE898E62 -:1033800055555500B18C01016850002138B50D4BE1 -:1033900010220021184616F0C0FC012200240A4920 -:1033A0000A4D0A73827255F8043B33B14FF48E62B2 -:1033B0000021184616F0B1FC04740134032CF2D13C -:1033C00038BD00BF303D002120500021D0AE0301A8 -:1033D00008B5084A084BDA60084B094A5A62094B9B -:1033E000094A1A60FFF7D2FF4FF48E62074B9A82A8 -:1033F00008BD00BF11340201040D0021B00C0021F2 -:1034000075310201E04D0021512F02016850002169 -:10341000FFF7BCBF0123034A8340907A18439072A0 -:10342000704700BF303D00210123034A8340907A5A -:1034300020EA030090727047303D0021064B53F89C -:10344000203009B108689861106851681C3303C3C3 -:1034500090681860704700BFD0AE030138B50446CD -:1034600004200D4610F076FA014668B154B1237C71 -:103470000B8009238B70054BCD70187BBDE838405D -:1034800010F079BAFF23F3E738BD00BF6850002180 -:1034900030B590F83943036B3CB1032A81BF0C6807 -:1034A000C0F82443002480F8394390F83853012DA4 -:1034B0001BD0022D46D1837AA3B9B0F8DC42032A8F -:1034C0001CD80023A24203F1010121D1D0F824230A -:1034D0009A421DD1C0F82413D0F82C330133C0F820 -:1034E0002C3329E0B0F8DA42E9E7032AB0F82C419E -:1034F00023D99B009BB29C4228BF1C46012D0B6820 -:103500000ED0022DDED0BDB922B9E5E70024F5E7E3 -:10351000C0F82413D0F834330133C0F834330BE04F -:10352000D0F824239A4209D1D0F82C330132013348 -:10353000C0F82C33C0F8242330BD00230133C0F879 -:103540002433E7E7032AE1D8022DDDD9F4E70000B0 -:1035500010B5044610F0B6F9034B587804445C707B -:10356000BDE8104010F0BAB9DC5000210023F0B5DE -:1035700018461C46224A87B01268CDE9003392F8FB -:103580003570204ACDE90233CDE9043312689F42F9 -:1035900008D81D4B9B6A1BB110B1694603AA984716 -:1035A00007B0F0BD1178A1B192F8181389B992F85B -:1035B000046192F8D81286B179B906AD05EB4005E1 -:1035C00025F80C6C168925F8186C82F80411013066 -:1035D000C0B2013302F56272D9E70129F9D192F83C -:1035E0006453002DF5D006A901EB400121F80C5CD5 -:1035F000158921F8185C82F8044182F86443E6E7F3 -:10360000DC4D0021E43900216850002100232DE920 -:10361000F04FB74F99B0DFF8DC82ADF8163006A94D -:103620000DF1160000F0E4FF0546D8B900252C4640 -:10363000CDE90955CDE90B55CDE90D55AE4FDFF874 -:10364000B4A23B6893F83530AB4200F24481AB4BF7 -:10365000DB6A23B11CB1204609AA0CA9984719B00E -:10366000BDE8F08FBDF81600FAF77EFF0378044638 -:103670001BB9284600F098FFD1E7294607A803F0B8 -:10368000FCFD3B689BB1294604F5BE70984738B9EC -:10369000284600F089FF06212046EAF74BFCBEE7EA -:1036A000D4E90C32013342F10002C4E90C3229465C -:1036B00009A803F0E2FD94F8D81204F55A7A00291B -:1036C00040F0A08018220CA816F027FBBDF8163099 -:1036D0009DF81C60ADF8303001238DF833306B78E5 -:1036E000ADF83430069B0E936B78ADF83E30A6B142 -:1036F000012EBED1A37A002B76D1B4F8DC32B4F817 -:103700002C219A4273D10123284684F8103100F00D -:103710004BFF002384F86F3381E794F86F333BB19C -:10372000012B5BD0284600F03FFF84F86F6376E7FB -:1037300002238DF832309DF83230A5F10C0613F0DB -:10374000FD0F08BFB4F87033304604BF0133A4F84E -:103750007033B4F870330CA9ADF83C3003F001FDC0 -:1037600094F819338146012B05F1020505D129464C -:1037700020469DF82120FFF78BFE29469DF8212049 -:1037800006EB090016F0AFFA314612A803F0A1FCCF -:10379000149B13B1069BC4F800333146504601F028 -:1037A00073F900283FF442AF04F5427904F55E76E0 -:1037B00030460DF1150110F0EDF8054600283FF4F4 -:1037C0002EAF226B2B4648462189013A00F02EFF8E -:1037D0000028EDD1284610F0C5F8E7E703238DF85F -:1037E000323084F86F63A6E7B4F8DA3287E794F8EA -:1037F0006F33003B18BF01238DF83230012384F86A -:103800006F3398E79DF81C30022B7FF432AFA37A18 -:10381000002B39D1B4F8DC3222890293069B04F5DF -:10382000437901939DF829304946009350462B4631 -:1038300001F0A0F994F81433184494F8193384F87B -:103840001403012B23D194F81433002B3FF411AF50 -:103850000CA9484610F09EF80646014612A803F04F -:1038600038FC9DF8562006F10C012046FFF710FEAB -:10387000304610F077F80120FFF76AFE94F8143311 -:10388000013B84F81433DEE7B4F8DA32C4E794F885 -:103890000833012B7FF4EDAE04F5427A94F814332B -:1038A000002B3FF4E6AE504600F0E5FE81460146AF -:1038B00012A803F00EFC149BBDF856201799B4F81B -:1038C0001603D8F80C60B047484610F04BF80120BA -:1038D000FFF73EFEE2E74FF46273094A6B4312685A -:1038E000D61896F8081369B101291FD00135A8E64A -:1038F000843A0021904A0021DC4D002168500021CB -:10390000E4390021D35C002BF0D096F81423002A70 -:10391000ECD0308918AB03EB4403013423F8300CAE -:1039200023F83C2CE4B286F81413DFE7D35C002BB9 -:10393000DCD096F8CA32002BD8D006F5427B584628 -:1039400000F099FE80460028D0D0414612A803F02E -:10395000C0FB149BBDF856201799B6F81603DAF889 -:103960000CC0E04740460FF0FDFF0120FFF7F0FDDF -:10397000E5E700BF70B50E4604460FF0E5FF011BFA -:10398000711A054600F086FC08B12844001B70BD82 -:10399000F0B587B001460546684603F09AFB464BF2 -:1039A000BDF80E201B689B8D93420AD228460FF06B -:1039B000D9FF424B5B681BB30121BDF8000098475B -:1039C0001EE03F4F3B78002BF0D09DF80310BDF870 -:1039D0000430002914BF04210021043B5B1A9BB270 -:1039E0009A42E3D1BDF80000FAF7BEFD0446002874 -:1039F0003CD00089FBF786FA20B928460FF0B2FFC9 -:103A000007B0F0BDB4F83031002BCFD0A37A94F8D2 -:103A1000F4221A43CAD094F8F5220AB9012BC5D072 -:103A2000ABB9B4F8DA32BDF80E209A42BED894F899 -:103A3000D8327BB90FF046FF3B78013B3B700FF06B -:103A40004DFF2A466946204600F064FCD8E7B4F8EA -:103A5000DC32E8E72A46002104F556700FF085FFB6 -:103A600094F86033013384F86033C9E7BDF800008F -:103A7000F8F766FF06460028BFD04368BDF80E2061 -:103A8000DB889A4292D80FF01DFF3B78013B3B70D8 -:103A90000FF024FF73682A469B7F23B9694630469E -:103AA000F9F77AF8ACE7214606F114000FF05DFF54 -:103AB000337F01333377A3E7DC4D002168500021C9 -:103AC000DC500021F8B500241D4D1E4E2B6893F8E4 -:103AD0003530A3420AD800244FF498771A4E2B6849 -:103AE00093F83A30A34215D8002012E04FF46273E5 -:103AF00063433268D018D35C0BB90134E6E790F821 -:103B00000833002BF9D100F5427000F0B4FD002815 -:103B1000F3D0F8BD07FB04F33268D018D35C0BB9BF -:103B20000134DCE74368DB78002BF9D190F82C30C6 -:103B3000002BF5D1F9F74CFA0028F1D0E9E700BFE6 -:103B4000DC4D0021E4390021D4390021FFF700BD0C -:103B50002DE9F0410546884617461E46FAF704FD52 -:103B6000044640B3C07AFAF7D1FDA37A2BB994F892 -:103B7000F4223AB90C20BDE8F081012B02D194F86F -:103B8000F522F6E794F86423002AF3D083B994F879 -:103B9000F432E28940F2E241013A5343A8F800309E -:103BA000828A036B002001FB12333B603060E2E746 -:103BB00094F8F532EDE72846F8F7C2FE034660B305 -:103BC0004568EA78012AD5D1A87F18B1012811D01B -:103BD0001120D0E7D5E908432343CBD0D5F8CC302A -:103BE00029692A7E013C5B1A54435343A8F80040DC -:103BF0003B60DBE793F82030002BBBD02B6A2A7E9A -:103C0000013B53432969A8F80030D5F8CC30204651 -:103C10005B1A53433B603460ADE70220ABE7437867 -:103C2000023BDBB2FD2B34BF1220002070470000A6 -:103C300070B58AB006460D46FAF796FC044628B3DE -:103C400015F0FC0F59D1002D57D015F0010307D006 -:103C500090F80423FF2A03D10C2528460AB070BD32 -:103C600015F002054DD094F80823FF2AF4D0002B5C -:103C700048D123896846ADF8003004F542730493B7 -:103C800000F0B8FDFF2384F808334DE03046F8F724 -:103C900057FE044698B3EA0703D590F82430FF2B6B -:103CA000DAD0AB0703D594F82C30FF2BD4D063883F -:103CB000ADF800306368DD786DB994F82C30FF2BD7 -:103CC000CAD004F12C036846049300F093FDFF234F -:103CD00084F82C30C1E794F82430FF2BBCD0134E6D -:103CE00004F12403684604933360002500F024FDAA -:103CF000FF23356084F82430AFE71225ADE70225B5 -:103D0000ABE78BB12389094EADF80030684604F566 -:103D100041730493336000F00FFD00233360FF23F1 -:103D200084F80433002DA4D1002596E7984B002198 -:103D300070B506460D46FAF717FC0446E0B1C07AA6 -:103D4000FAF7E4FC94F8F42203460AB9A27AE2B145 -:103D500094F8F52212B9A27A012A16D0022D16D8AB -:103D60001B6B0020C4F81C330123C4F8280384F81B -:103D7000205384F8183370BD3046F8F7E1FD40B1A8 -:103D80002946BDE87040F9F7CDB91120F3E71220BC -:103D9000F1E70220EFE738B505460C46FAF7E4FBF9 -:103DA00080B1231E18BF012380F83933012380F826 -:103DB0001933002380F83843C0E9CB33C0F83433DB -:103DC000184638BD2846F8F7BBFD20B12146BDE8AE -:103DD0003840F9F7BBB90220F3E738B505460C4681 -:103DE000FAF7C2FB0346A0B1B0F81823D2B190F89D -:103DF000190350B10020D3F82C232260D3F83023CC -:103E0000D3F834336260A36038BDC4E90000A06019 -:103E1000FAE72846F8F794FD30B12146BDE838406E -:103E2000F9F7A5B90C20EFE70220EDE738B5054614 -:103E30000C46FAF799FB0346C0B1B0F818230AB351 -:103E400090F819235AB1D0F82C232260D0F83023EF -:103E50006260D0F83423A260002280F8192393F81E -:103E6000180310B1002083F8180338BD2846F8F76E -:103E700067FD054640B12146F9F779F9012385F838 -:103E80006930F2E70C20F0E70220EEE738B505468E -:103E90000C46FAF769FB58B100F54F7300F5567000 -:103EA00053F8042B834244F8042BF9D1002038BD89 -:103EB0002846F8F745FD034660B14268D07848B916 -:103EC00003F13C02583352F8041B9A4244F8041B95 -:103ED000F9D1ECE70220EAE770B506460D46FAF79D -:103EE00043FB20B190F9EC3000202B7070BD3046C0 -:103EF000F8F726FD034640B14268D07818B993F927 -:103F000064302B70F2E77F23EEE70220EEE700003B -:103F1000014B83F847007047205000211FB5312323 -:103F2000ADF804008DF8080001A8ADF80630039143 -:103F30000DF04EFE05B05DF804FB00002DE9F047E2 -:103F40001B4F05463B680E46B3F82C80FAF70CFB76 -:103F50000446D8B1C07AFAF7D9FBD0F8249004F51A -:103F600041742378012B21D13B68988D083080B2B1 -:103F70000FF0F0FCD0B10F4B42469C6800F10C01F1 -:103F80004B462846A446BDE8F04760472846F8F768 -:103F9000D7FC58B1436800F12404D3F8CC90B3F8AF -:103FA00006804E4504BF1A699144DAE7BDE8F08700 -:103FB000DC4D0021904A0021F8220021014815F033 -:103FC000ACBE00BFA04A0021F0B406461846114B13 -:103FD000BDF810701B682BB15B88B34202D1F0BCF6 -:103FE0000FF0C0BC14250C4B1C6805FB0435C5E95B -:103FF00003120C220134B4FBF2F102FB11441C60E9 -:10400000064B68612E812F838021F0BC187B0FF056 -:104010004DBD00BF984B0021A04A002168500021EF -:104020002DE9F04114274FF481781D4D86B0D5E974 -:1040300000349C4202D106B0BDE8F08107FB045475 -:1040400023891422002101A86669ADF80030ADF87B -:10405000028015F062FE2269238B0C3E0292E26818 -:1040600069463046ADF80430ADF80C20ADF80E309E -:1040700003F077F83046FFF78BFC00226B6802995B -:1040800007FB0353BDF800005A61FFF757FF0C22EE -:104090006B680133B3FBF2F102FB11336B60C6E7CF -:1040A000A04A00212DE9F0418F7805460C461646BE -:1040B00027B1012F1DD00020BDE8F08103691A78D7 -:1040C000FF2A2AD1CA78FF2AF5D0DFF85480C8F831 -:1040D000003000F031FBE3782A69FF2BC8F800704C -:1040E0001370E8D0324621462846BDE8F04100F082 -:1040F000D1BA03691B78FF2B0FD1CB78FF2BDAD015 -:1041000000F078FBE3782A69FF2B1370D3D02146A7 -:104110002846BDE8F04100F01BBB0C20CCE700BFF7 -:10412000984B0021F0B505468BB028220021684647 -:1041300015F0F3FDEB78023BDBB2FC2B75D92B7944 -:10414000032B72D12B7C002B6FD12888FAF70CFA45 -:104150000446002845D0837A012B05D1C378012B72 -:1041600002D10C200BB0F0BDE07AFAF7CFFA426A28 -:104170004FF495602F4BE188A77A1B6800FB013351 -:10418000D4E9B860012F18BF30460190A06A218998 -:104190000130ADF800100290A97820698DF8021066 -:1041A000039069B10129DCD1D3E9C401224BCDE9E7 -:1041B0000601D3E90C0104F54274CDE908010AE0D7 -:1041C0001D4904F54174D1E90C01CDE90601D3E99B -:1041D000C401CDE90801049429466846FFF762FF4F -:1041E000C0E72888F8F7ACFB08B3436841881E7E17 -:1041F000ADF800101969AC780191196AD3F8CC2098 -:10420000013171430291996A8DF80240039134B1F2 -:10421000012CA6D1DB78002BA3D12C3003E0DB7876 -:10422000012B9ED124300490D6E712209AE7022079 -:1042300098E700BFB43A002168500021034B1A8B65 -:1042400002701B8B1B0A437002207047DC50002158 -:10425000014B188300207047DC50002108B50FF097 -:1042600031FB044A137801331370BDE808400FF0A6 -:1042700035BB00BFDC50002108B50FF023FB044A1A -:104280005378013B5370BDE808400FF027BB00BFD7 -:10429000DC5000212DE9F843002406460F46054670 -:1042A000DFF84080104AC8E90044DFF8409014600D -:1042B000D9F8003093F82A30A34202D8A81BBDE8F1 -:1042C000F88328460FF040FB00F18005AB1BBB4292 -:1042D000014604D840460FF08BFC0134E8E700208B -:1042E000EDE700BF9C4B0021A44B0021DC4D0021D9 -:1042F00008B503480FF08EFC00B1083008BD00BFC0 -:104300009C4B0021A0F1080101480FF071BC00BFD7 -:104310009C4B00212DE9F04FCB8989B007460D4613 -:104320001646B0F830810293FFF7E2FF0446D0B999 -:1043300030460FF017FB414B9B6A63B197F8182387 -:104340004AB901202A88ADF81800ADF816200DF101 -:10435000160106AA9847FFF781FF072009B0BDE8BC -:10436000F04FF4F7B1BDEB890660984528BF984639 -:104370000381002380F80A80C372EA78CDF80480B4 -:104380009A4214BF0C220822984606EB020B1E46E6 -:10439000C0F804B0029BDDF80490A3EB080189B2D9 -:1043A00097F8D832894528BF8946002B39D1019B1F -:1043B0008B422CBF002101210D22F3B2534303F1A4 -:1043C000100A03930023A2448DF81810504606A942 -:1043D000A5F80E90CDF819308DF81D9002F02EFF43 -:1043E0004FF00202039BE1188A7315490A6894464C -:1043F000CAB900210D22F3B202FB0343C844D973AA -:10440000029B1FFA88F84345CB4406F10106C1D848 -:104410002246297807F1FC0009B0BDE8F04F0FF003 -:10442000A4BA0221C8E717335A465146234407F578 -:10443000BE70E0470028DCD00421DBE76850002193 -:10444000883A002173B50C46FC300DF107010FF0DE -:10445000AAFAF0B1867AC37A028903FB06F13546DF -:104460000E449642C4BF521A95B20D225343C61849 -:10447000B27B2581228003F110020244626042680F -:104480000A44E260F27B32B11733184460610320C2 -:10449000228202B070BD0220FBE707B5FC300DF1AF -:1044A00007010FF080FA003818BF012003B05DF853 -:1044B00004FB000013B500F1FC0420460DF10701D8 -:1044C0000FF071FA78B1C27A837A511C02FB033380 -:1044D0000289934209DB064B0DF107011860204663 -:1044E0000FF058FA012002B010BDC172FAE700BF08 -:1044F000A44B002170B50F4E04463568C5B128683D -:104500000FF030FA2846FFF7FDFEFFF7A7FE94F8FC -:1045100004314021013384F80431012384F86433E9 -:1045200000233360044BBDE87040187B0FF0BEBA27 -:1045300070BD00BFA44B0021685000210023F7B5D7 -:10454000044690F8045180F8643380F8043100F197 -:10455000FC0738460DF107010FF01CFA064640B97A -:10456000094B5B681BB115B129462089984703B0F8 -:10457000F0BD30680FF0F6F901353046FFF7C2FEA6 -:10458000EDB2FFF76BFEE4E76850002108B5054B7C -:104590001B68988D103080B20FF0DCF900B10C3040 -:1045A00008BD00BFDC4D00210C380FF0DBB9000066 -:1045B00008B51346B0B10A0A00F8041C00F8032C31 -:1045C0000A0C090E00F8022C00F8011C021FD9B2D7 -:1045D00005480FF0CAF9054B2021187BBDE80840BB -:1045E0000FF064BA08BD00BFE450002168500021FC -:1045F00037B504460D460C480DF107010FF0CAF916 -:1046000078B1837842781B0403EB022302780430EC -:10461000134410F8012C03EB02632B609DF8073064 -:10462000238003B030BD00BFE4500021F0B5044644 -:1046300087B00F46684619461E4602F04AFD2578A7 -:104640002DB1012D0FD00025284607B0F0BD324610 -:10465000F9B2201D0FF089F9237B01250133237363 -:10466000FFF70AFEF0E73246F9B2201D0FF07DF9A0 -:10467000FFF702FEE8E7037807B5012B07D80DF135 -:10468000070104300FF086F903B05DF804FB002049 -:10469000FAE700002DE9F0430669044633780D4639 -:1046A000012B17468FB008D0013BDBB2FE2B34BF85 -:1046B000122000200FB0BDE8F0831D4BB0F8009031 -:1046C000D3F80080A6F80290B8F1000F2ED038225F -:1046D0000021684615F021FBA368694601932B79F8 -:1046E00048468DF80830EB88ADF80A302B89ADF8D4 -:1046F0000C302B7C8DF810306B690593E3680693C2 -:104700000C4B0793D4E90623CDE90823D4E9082309 -:10471000CDE90A23C04728B120883946FFF70EFCAF -:104720000020C7E7FF230D203370C3E71220C1E745 -:10473000904A0021C93F020103691A78012A04D175 -:10474000024A00215268588810477047904A002159 -:104750002DE9F047056906462C780F46012C8EB0EE -:1047600005D0FF2C41D0002C3BD0122435E04FF077 -:1047700000081F4BB0F800A0D3F80090C5E90188ED -:10478000A5F80EA0B9F1000FEFD0382241466846D7 -:1047900015F0C3FAB368694601933B7950468DF82A -:1047A0000830FB888DF80040ADF80A303B89ADF841 -:1047B0000C303B7C8DF810307B690593F3680693D1 -:1047C000D6E90623CDE90823D6E90823CDE90A2353 -:1047D000C84750B9FF230D242B7020460EB0BDE80A -:1047E000F087C5E901442C73F7E70024F5E700BF23 -:1047F000904A002137B50469217889B9164D0434EF -:1048000020460DF107010FF0C5F858B10FF0AAF8D6 -:104810000FF058F86B7801336B700FF05FF8EFE72B -:10482000012901D003B030BD0C4BE0895B6898478B -:10483000094D043420460DF107010FF0ABF80028B4 -:10484000F0D00FF08FF80FF03DF86B7801336B70FC -:104850000FF044F8EEE700BFDC500021904A002141 -:1048600037B5044671B900F1100528460DF107016E -:104870000FF090F818B90023E38003B030BD0FF0BB -:1048800071F8F2E700680028F5D00FF06BF800230C -:104890002360F0E7F0B55C1E012CBDF81460069DA6 -:1048A00013D884784778240404EB07240778C07869 -:1048B0003C4404EB0060012B09D0022B11D01BB942 -:1048C00059B1936801339360F0BD0020F3E70329E9 -:1048D000F7D9B142F5D8A842F3D113680133136078 -:1048E000F2E7B142EDD1F6E72DE9F04F002605469B -:1048F0001446B2468BB0CDE9026601F108081CB936 -:1049000050460BB0BDE8F08F28460DF107010FF0BF -:104910004AF807460028F3D0014604A802F0D9FB64 -:104920009DF81330002B14BF0C2108210F44698916 -:10493000002942D0BDF81E3002265B1AADF81E30A9 -:1049400001230F448DF80830BDF81E309A199442A7 -:1049500037DB01228DF809209DF808208DF80A30F8 -:1049600002B903924FF00002DBB228466A810DF1D2 -:104970000701E41A0FF00EF883462B7AA41B013BC3 -:104980002B722B7BA4B201332B73404602A902F099 -:1049900029FC9DF80A90804440464A46394615F065 -:1049A00095F9C844BBF1000F02D058460EF0DAFF6B -:1049B0004E4456445FFA86FAA1E705268DF80810A2 -:1049C000C2E7B4429CDD4FF00003A41B8DF8093010 -:1049D0009DF80830E4B28DF80A4003B903934FF014 -:1049E000000B214469815C46CFE70000034B1B6844 -:1049F000988D103080B20EF0ADBF00BFDC4D0021AD -:104A00002DE9F04186B00646884614461D46FFF75C -:104A1000EDFF074620B3B8F1010F25D0B8F1020F22 -:104A200029D000240223ADF802300023694638461D -:104A3000ADF80060ADF80440ADF80C30ADF80E40B4 -:104A40008DF8103002F08DFB54B13A182B0A3D540A -:104A500053702B0C93702B0ED37004239C420ED8F2 -:104A6000384606B0BDE8F0810DF07FF8B0FBF4F2F7 -:104A700002FB1404A4B2042C38BF0424D2E7D3549C -:104A80000133EBE7FFF7B2BF2DE9F04100F1100869 -:104A90008EB004460F4640460DF107010EF083FF2D -:104AA0000646002F4AD0394602A802F012FB9DF8B4 -:104AB0000A50032D40D8DFE805F00328021A01252B -:104AC00036B10DF1070140460EF064FF0EF04AFFCB -:104AD000BDF816303A462383002340469DF808105F -:104AE000A3760EF042FF28460EB0BDE8F081012506 -:104AF0006EB9BDF80C303A46238340469DF8081045 -:104B00000EF033FF0123A376EDE70025F0E73146F1 -:104B100008A802F0DEFA238B0D98BDF80C2018448B -:104B2000079915F0D3F838460EF01CFF238BBDF81B -:104B30000C20134423832DB90025D4E70028FBD093 -:104B40000123A376314608A802F0C3FA02238DF8A8 -:104B50002230238B3046ADF82430ADF82E30A37EC2 -:104B600008A98DF8303002F0FCFA002301252383D8 -:104B7000A376B8E72DE9F04F8DB0CDE90121BDF85E -:104B800060200446039282799DF8587052B1002546 -:104B90008571006830B10EF0E5FE256028460DB045 -:104BA000BDE8F08F0025A946CDE904559E1C002FD5 -:104BB000F4D0314604A802F02BFB9DF8102080466B -:104BC000064422B99DF81230033B8DF8123094F858 -:104BD00007B0BBF1000F0AD0BBF1010F206859D01C -:104BE00000284ED00EF0BEFEC4F8009049E0FFF75A -:104BF000FDFE20600028DAD0FFF73EFB0C239DF875 -:104C000010A0A380236803F10C00BAF1000F33D188 -:104C10009DF812200399DDF814B08A42C4F810B050 -:104C20003CD91422514607A8039315F076F822893F -:104C3000019B511CADF824204FF48172ADF81A206D -:104C40000222ADF81830179B8DF82820A3EB0B0239 -:104C5000039B2181184606A90892013502F081FACA -:104C600022689DF8041002980EF07FFEEDB2C4F8A1 -:104C700000A084F807A091E718460EF073FEC4F870 -:104C800000B09DF81230FF1AA7EB08071E4407F08A -:104C9000FF078CE7012A42D1A388184431469DF8CA -:104CA000122015F013F8A3889DF812A056449A44D8 -:104CB0009DF811301FFA8AFAA4F804A0002B3DD009 -:104CC0001422002107A815F028F8019BAAF10C0A6C -:104CD000ADF8183023891FFA8AFA5A1CADF824302F -:104CE0004FF481732281ADF81A30179A236906A90F -:104CF000D31A20680893ADF81CA0ADF826A002F0E6 -:104D000030FA029822689DF804100EF02EFE9DF8ED -:104D100012000135EDB2C4F800903F1A07E00EF022 -:104D200021FE9DF81230C4F800901E44FF1AA7EB34 -:104D3000080707F0FF0784F8079038E70123E371BD -:104D40002CE70000014B024A1A617047C04B00215A -:104D5000F5980201B2F5706FF8B505460E46144697 -:104D600033D2052A33D84FF4856363431B4AD118E5 -:104D7000D35C63B34B78012B29D1194B1B6893F893 -:104D80002230834225D94FF49563164A4343116874 -:104D9000CA18CB5CEBB1D2F8303300279B011AD58F -:104DA00092F82233BBB10A200EF0D4FD014658B16F -:104DB00042F2012343800C4B05808780C48006812A -:104DC000187B0EF0D8FD3846F8BD1220FCE74220D3 -:104DD000FAE70220F8E71A20F6E700BFD01D00210D -:104DE000DC4D0021B43A002168500021F8B51E4B7B -:104DF00004461B680E4693F822301546834201D8BC -:104E00000220F8BD1046F6F709F930B390F8897121 -:104E1000012F24D14FF49563144A63431168CA18D3 -:104E2000CB5C002BECD0D2F830339B0119D592F833 -:104E30002233B3B10A200EF08DFD01460028E0D0E8 -:104E400042F2012343800A4B04808780C58006819B -:104E5000187B0EF090FD0020D3E74220D1E70C2014 -:104E6000CFE71A20CDE700BFDC4D0021B43A002186 -:104E70006850002130B50C4C246894F822408442DC -:104E80000FD94FF495646043084C25682C18285CB2 -:104E900038B1002084F87013A4F87223A4F8743396 -:104EA00030BD0220FCE700BFDC4D0021B43A0021F8 -:104EB000074B084A1A60084B084A1A60084B094A0F -:104EC0001A60094B094A1A60094B0A4A1A6070476E -:104ED000943A0021D5FE0001903A002179010101A8 -:104EE000AC3A00211D040101983A00213904010166 -:104EF0008C3A002159040101034B04481B7B0373C6 -:104F0000034B19680EF036BF68500021A84B0021F2 -:104F100010510021C3780146022B70B517D0032B26 -:104F200007D0012B2CD1E7F739FABDE87040FFF725 -:104F3000E3BFD0E9022352EA030003D1BDE8704089 -:104F4000E7F72CBA4879BDE87040E7F755BA017920 -:104F5000421D00F10803D0E90445204661B129460D -:104F6000E7F754F90EF0AEFC064A1379013B1371D2 -:104F7000BDE870400EF0B2BC2946E7F7A1F9F1E7B1 -:104F800070BD00BF105100212DE9F84FDDE90A671F -:104F9000154C8246894690461D460EF093FC94F8C7 -:104FA00004B00EF09BFCBBF1030F1BD818200EF0D1 -:104FB000D1FC0146B0B140F20623C0E9026743804C -:104FC0000A4B80F804804571C0E904A9187B0EF0F3 -:104FD000D2FC0EF077FC237901332371BDE8F84F42 -:104FE0000EF07CBCBDE8F88F105100216850002104 -:104FF000014B1860FFF780BF1051002108B50D4A22 -:105000000D4B00219A610D48102214F086FE0C4BC6 -:105010000C481B681B79072B81BF0B4A136A43F0AE -:1050200040031362E6F784FF4FF48372034BDA8088 -:1050300008BD00BF154F0201B00C0021A84B002194 -:10504000DC4D0021894F020168500021182008B56D -:105050000EF080FC014670B140F20633438000231D -:10506000002243710023C0E90223034B187BBDE8F3 -:1050700008400EF080BC08BD6850002170B506469F -:10508000182015461C460EF065FC014658B140F24A -:105090000633C0E902544380034B4671187BBDE8D8 -:1050A00070400EF068BC70BD6850002108B5C9B2F0 -:1050B00010F0C2FB012008BD10B58AB004462622BC -:1050C0000021684614F029FE14238DF802300C4BA1 -:1050D000204693F8223004F12002002B14BF002355 -:1050E00012238DF804300DF1050350F8041B904293 -:1050F00043F8041BF9D168460CF06AFD0AB010BDF4 -:1051000018510021024B4FF40061187B0EF0CEBC09 -:105110006850002110B500F11F0300F10F029A4200 -:1051200000D110BD01781C7800F8014B03F801197B -:10513000F5E701F1200301388B4200D1704713F8E5 -:10514000012D00F8012FF7E700B589B0202168464E -:1051500010F072FB054813F09DF8684613F0A0F8B4 -:10516000FFF7D0FF09B05DF804FB00BFAD500201AE -:1051700000B589B001466846FFF7DBFF054813F02C -:1051800089F8684613F08CF8FFF7BCFF09B05DF8AA -:1051900004FB00BFAD50020110B513F093F80446B4 -:1051A00018B9FFF7AFFF204610BD0120FCE738B566 -:1051B00004460D4613F0E2F82046FFF7ABFF04F17A -:1051C0002000FFF7A7FF2846BDE83840FFF7A2BF41 -:1051D00070B5A2B0FFF7E0FF58B36846164910AEAD -:1051E000FFF7E5FF46220021304614F096FD132319 -:1051F0006A468DF842300DF1450508AB144603CCE4 -:105200009C4228606960224605F10805F6D10DF13F -:1052100065041A4603CAB24220606160134604F175 -:105220000804F6D130460CF0D3FC0022024B83F880 -:10523000202022B070BD00BF1851002130B50446B7 -:105240000D4699B0014608A8FFF773FF04F120014D -:1052500010A8FFF76EFF29466846FFF76AFF074868 -:1052600013F018F8694608A813F0E8F8044B4FF457 -:105270008051187B0EF01AFC19B030BDAD50020100 -:105280006850002110B513F025F9044638B9054BD4 -:105290004FF48051187B0EF009FC204610BD012010 -:1052A000FCE700BF6850002110B5044613F02CF94C -:1052B0002046BDE81040FFF72DBF000010B50E4C92 -:1052C00088B094F822304BB92022FF21684614F0B0 -:1052D00024FD6846FFF7F0FE08B010BDFFF7D2FFCF -:1052E0000028F9D06846FFF7DFFF6846FFF7E4FEC5 -:1052F000002384F82030EFE71851002130B5044630 -:1053000091B00D4601466846FFF713FF04F12001F6 -:1053100008A8FFF70EFF684613F046F810F0FF04E8 -:1053200006D12DB1044B4FF48051187B0EF0BEFB1B -:10533000204611B030BD00BF6850002110B50948AB -:1053400090F8204064B9012380F8203090F8213093 -:105350001BB1FFF70DFF204610BDFFF7F5FEFAE782 -:105360000C24F8E7185100212DE9F041114D0646B3 -:1053700095F820800F46B8F1000F18D195F823401A -:10538000B4FA84F14909FFF7B9FF85F8220028B97A -:10539000002C18BF12242046BDE8F08101233946B5 -:1053A000304685F820304446FFF748FFF3E70C24E9 -:1053B000F1E700BF18510021F0B599B06A461646D2 -:1053C000144B03F12005144618685968083303C4C8 -:1053D000AB422246F7D108AA15460F4B03F140070E -:1053E000144618685968083303C4BB422246F7D1F3 -:1053F0000A4B93F820405CB901223146284683F8D5 -:10540000222083F82020FFF719FF204619B0F0BDB5 -:105410000C24FAE7DCAE0301FDAE030118510021B4 -:10542000024B83F823000020704700BF1851002171 -:10543000074B084ADA62084A1A63084A136A43F0BB -:10544000006313620022064B83F82320704700BFDD -:10545000780C0021D1510201BD5202016850002197 -:1054600018510021034B044A1A61044B044A1A6084 -:10547000704700BFE84B00215D9E0201A83A002161 -:1054800019A00201F8B500230B701378164603F03B -:105490003F029B090546027043706AB9741C2A7862 -:1054A000A11B8A4244DB531C5B1ADBB22C62AB7734 -:1054B0001C44A01BC0B2F8BD7778B41C0F70837871 -:1054C000F90743EA0703837006D520460EF0E0F89B -:1054D000C5E9020106F10804BA0705D520460EF019 -:1054E000D7F8C5E9040106347B0706D514F8013B5B -:1054F00003F01F029B092A766B7638070AD562787B -:1055000014F8023B03EB0223C3F30B02C3F3033390 -:105510006A832B77F90644BF6C620334BA0644BF32 -:10552000AC6212347B0644BF14F8013B6B77B6E7DC -:1055300000232B62AB77BCE70B7803F03F030370CB -:105540000B78C3F3801343700B78DB0983708A7880 -:105550004B7803EB0223C3F30C02C3F34233828084 -:10556000837170474A780B7830B503EB0223C3F39D -:105570000C020280C3F34032C3F380338270C370E5 -:10558000CA788B7803EB022383804B798A791B02DC -:1055900012049B182CBF012200220C791B19CC7914 -:1055A00042F1000524060A7A1B1942EB050202F0BB -:1055B0001F04C0E9023452090274CB7A8A7A1B04B0 -:1055C00003EB02234A7A13440A7B03EB0263436131 -:1055D0008A7B4B7B03EB0223CA7B03EB0243836191 -:1055E0004A7C0B7C03EB0223838330BD4B788A78A3 -:1055F0001B0212049B182CBF0122002210B50C784C -:105600001B1942F10004CA7812069B180A7942EB72 -:105610000402C0E902328A794B7903EB0223038248 -:10562000072010BDF0B58B784C781B0403EB0423E6 -:105630000C782344CC78C3F30D0503EB0464C3F367 -:1056400080338372C4F3CB33E40E0581838184738A -:105650008B794C791B0403EB04230C792344CC791C -:1056600003F01F0503EB0464C3F342130374C4F394 -:105670001323240FC573436104768B7A4C7A1B0481 -:1056800003EB04230C7A2344CC7AC3F3130503EB16 -:105690000464C3F3035380F82030230EC5614384B0 -:1056A000CB7B8C7B1B0403EB04234C7B23440C7CC3 -:1056B00003EB04634362CB7C8C7C1B0403EB04236D -:1056C0004C7C23440C7D03EB0464C3F3130383621B -:1056D000230D83858C7D4B7D03EB04230024C38540 -:1056E0000B7E4D7E1B022D045B192CBF0125254628 -:1056F000CE7D9B198E7E45F1000536069B19CE7E28 -:1057000045F1000535441B1905F01F06C0E90C36AC -:105710006D0980F838504B7F8E7F1B0236049B1931 -:105720002CBF012626460F7F0135DB19CF7F46F1BE -:1057300000063F06DB1991F8207046F100063E4452 -:105740001B1906F07F07222A4FEAD616C0E9103748 -:1057500080F8486080F8385016D9012380F8493025 -:10576000D1F82130523040F8083CD1F8253040F8CB -:10577000043C01F12903393153F8042B8B4240F8E2 -:10578000042BF9D13820F0BD80F849402020FAE7F9 -:105790008B784A789B0143EA42120B781343CA780C -:1057A00043EAC2130A7943EA02231BB20370C3F32C -:1057B000072343700220704770B50546049EF47FAE -:1057C0000DF06CFF06343146F27FE4B2A81D14F0F0 -:1057D0007DFA204670BD10B504460DF05FFFDDE98F -:1057E0000223A01D0DF05AFF0C2010BD38B5D1E9E1 -:1057F00000230C4605460DF051FFD4E90223A81DF5 -:105800000DF04CFF0C2038BDFFF7D6BF38B5D1E9FD -:1058100000230C4605460DF041FFD4E90223A81DE4 -:105820000DF03CFF0C2038BD38B50C460546FFF79F -:10583000EDFF2169228C295421692B18090A59701E -:10584000618A22209970E17CD9706169197161695E -:10585000090A5971E18A997194F82610D971218D3C -:105860001972218D9A72090A120A5972DA72628CBF -:105870001A73628C120A5A73A28C9A73A28C120A3F -:10588000DA73A2691A74A269120A5A74628B9A7442 -:10589000E27EDA74E2691A7594F82B1094F82A20E3 -:1058A00042EA41125A7538BD0B784A7803F00F016D -:1058B0000170C3F340114170C3F38011DB09C37061 -:1058C0001346054A817012681279082A98BF03F0BE -:1058D0003F03037102207047DC4D002138B50446B8 -:1058E00008460D460DF0D4FEC4E90001A81D0DF0D8 -:1058F000CFFEC4E902010C2038BD38B50546084684 -:105900000C460DF0C5FEC5E90001A01D0DF0C0FE5E -:10591000C5E90201A37B627B1B0403EB0223227B0C -:1059200022201344E27B03EB02632B61627C237C25 -:1059300003EB0223A27C03EB02436B61E37C85F85B -:105940002630627D237D03EB02232B85E27DA37D40 -:1059500003EB02232B84627E237E03EB02236B8402 -:10596000E27EA37E03EB0223AB84637FA27F1B0254 -:1059700012049B182CBF01220022217F5B1842F1E8 -:105980000001E27F12069B1894F8202042EB0102EE -:10599000C5E9063294F8213003F01F025B0985F84F -:1059A0002A2085F82B3038BD10B590F82630028CAF -:1059B000082B22D840F67A41931F9BB28B428CBFB2 -:1059C00000230123018D914288BF002340F67641D8 -:1059D000828C0A3A92B28A4288BF0023D0E90642FA -:1059E00012F0E0010BD122430BD090F82A20053AA7 -:1059F0000B2A94BF1846002010BD0023E2E70023C5 -:105A0000F3E70B46F1E708230B7028234B70836DF7 -:105A10008B70836D1B0ACB70B0F85A300B7190F805 -:105A20005B304B71C36D8B71B0F86030CB71B0F8E7 -:105A3000603009201B0A0B72704709230B70322358 -:105A40004B70D0F824318B70D0F824311B0ACB7006 -:105A5000B0F826310B7190F827314B7190F828314E -:105A60008B7190F82931CB7190F82A310B7290F834 -:105A70002B310A204B727047034670B590F8BA205C -:105A800093F8F040901C01320A702C224A70B3F84F -:105A9000C020013C8A70B3F8C020B3F8C450C2F3F0 -:105AA0000D0242EAC53293F8C650E4B242EAC5623A -:105AB00093F8C250C0B2AD0305F480452A431212D8 -:105AC000CA70B3F8C420C2F347020A71B3F8C02009 -:105AD000B3F8C450C2F30D0242EAC53293F8C6507F -:105AE00042EAC562C2F307624A7193F8C85093F85C -:105AF000C72042EA45128A7193F8D020D3F8CC50DF -:105B0000120793F8C86042EA052293F8C75045EAA5 -:105B100046152A43120ACA7193F8CD200A7293F8E7 -:105B2000D020D3F8CC50120742EA0522120E4A7256 -:105B3000D3F8D4208A7293F8D520CA72B3F8DA2049 -:105B400093F8D850120642EA0552D3F8D4502A43AB -:105B5000120C0A73B3F8DA2093F8D850120642EA0E -:105B60000552D3F8D4502A43120E4A7300228A7386 -:105B7000D3F8DC20CA73D3F8DC20120A0A74B3F815 -:105B8000DE204A7493F8DF208A74D3F8E020CA74C8 -:105B900093F8E1200A75B3F8E450D3F8E02042EA24 -:105BA0000552120C4A75B3F8E450D3F8E02042EAEB -:105BB0000552120E8A75B3F8E620CA75B3F8E620CE -:105BC00012120A76D3F8E8204A76D3F8E820120AAF -:105BD0008A76B3F8EA20CA7693F8EB200A77D3F8EE -:105BE000EC2042EA44124A77D3F8F8208A77D3F8B7 -:105BF000F820120ACA77B3F8FA2081F8202093F827 -:105C0000FB2081F82120D3F8FC2093F8004102F01A -:105C10007F0242EAC41281F8222093F8012192B156 -:105C2000D3F802212B3141F8082CD3F8062141F892 -:105C3000042C03F5857203F58D7352F8044B9A42D8 -:105C400041F8044BF9D170BD2DE9F0410D4698465D -:105C5000074616460DF044F8174B32288CBF00203B -:105C600001209D421CD800221449A5FB0151C1F31B -:105C70004F0146EA801646EAC21688F8006097F897 -:105C80003F30022B16D0032B14BF0023022388F8C9 -:105C9000011041EA4331091288F80210BDE8F08191 -:105CA00007490122A5FB0114032101FB0541C1F3B2 -:105CB0008F21DEE70123EAE7C3BF030012111111B0 -:105CC0009E36D0692DE9F04F87B0059300239246A8 -:105CD000109A03911371129B044603330493129B91 -:105CE0009DF84C801D1D9A4B9DF850609B69D90111 -:105CF00003F0807B00F17E82B8F1040F40F08082D7 -:105D0000002E14BF4FF003084FF001080CB9A34652 -:105D100081E24FF0000B238C9A0600F17482039B02 -:105D200013F0010740F0E5801AF0010F04D094F859 -:105D3000D733DB0740F1DE80039B980706D41AF0C7 -:105D4000020F10D094F8D73399070CD447F002070C -:105D500005F10609002C00F0E480D4E9062328466A -:105D60000DF09CFC4D46039B1A070AD41AF0080F4D -:105D70001AD094F8D7331B0703D5AEB194F8543337 -:105D800093B147F00807002E00F0D380B4F85633E3 -:105D90002A4602F8023B94F84210C3F30B0343EA8D -:105DA00001331B126B701546129BEA1AC2F5807301 -:105DB00001330193039B13F0200107D11AF0200354 -:105DC00008D094F8D733980600F1B680C2F1EF03FB -:105DD000019301231AF040091DD0B8F1030F02D03E -:105DE000B8F1060F0AD1B4F8609319F040090DD14B -:105DF000B8F1030F0FD0B8F1060F0CD0B4F8209013 -:105E000019F0400902D1B8F1070F04D14FF0010990 -:105E1000019A013A0192BBF1000F019A18BF0022CA -:105E20000192119A002A00F08980119912884989FB -:105E30001AF0100FA2EB010292B2029209D0119A4D -:105E4000127B32B9019994F84C20914228BF114637 -:105E50000191039A12F0100610D11AF0100270D0BE -:105E6000DDE901128A4209D8B8F1030F0AD194F88A -:105E7000C223012A06D094F8C0631EB12E4647F013 -:105E800010070335002B00F0C58094F8DD2BD4F803 -:105E90009CA1012A47F020070AD194F8B7134A06BB -:105EA0001FBFD4F850239244D4F8B02302FB11AAA8 -:105EB0005046D4F8181A03930CF024FFB0F5967FDF -:105EC000039B40D95046D4F8181A0CF01BFF214A06 -:105ED000904243D9B0F5161F039B24BF00231846F8 -:105EE0001D4AA0FB0212032101FB0020C0F38F20FA -:105EF0003AE04CB1D4E9042328460DF0CFFB129BC5 -:105F0000012703F10A0517E7129B03F10A090CF0B8 -:105F1000BBFE436A2846D3E9FE230DF0BFFB4D4686 -:105F20000AE70CF0B1FE436A03F58063D3E900236E -:105F300015E7B4F840302BE70B464BE7119A029275 -:105F400087E716469EE7D4F850239244B0E700BF97 -:105F500020500021C3BF03009E36D069AF4BA0FB89 -:105F600003300023C0F34F00287040EA4330001292 -:105F70006870D4F85023AA4BA2FB0321D20F42EA47 -:105F80004102AA70D4F85023A2FB0323C3F3D71312 -:105F9000EB70D4E9DAA303F01F0BFBF7D7FB4FEA52 -:105FA0001A2385F804A06B714BEA401B4FEA1A4391 -:105FB0004FEA1A6AAB7185F807A085F808B0D4F8E3 -:105FC000CC316B72D4F8CC311B0AAB72B4F8CE3141 -:105FD000EB7294F8CF312B73D4F8D0316B73D4F8C3 -:105FE000D0311B0AAB73B4F8D231EB7394F8DD3BBC -:105FF000012B40F0878094F8B7335B0600F0828075 -:10600000B4F8903101332B74B4F8903101331B1282 -:106010006B741235B9F1000F07D094F992080FF0A4 -:1060200015FE47F0400705F8010BB8F1030F0BD040 -:10603000B8F1060F08D0B8F1010F40F0D68094F8FF -:10604000DD3B002B00F0D1804FF00009A24649460D -:10605000744AB9F1020F02D1B8F1010F17D19AF8C1 -:1060600050B0BBF1010F12D1049B9AF85200EB1A09 -:106070000230C3F14003C0B2DBB2984207D82946D0 -:1060800052F82930204698475946664A054409F196 -:106090000109B9F1030F0AF1680ADAD157EA0103DD -:1060A000049B08BF1D46129BA5EB0309029B83B30B -:1060B000DDE901128A4228BF0A46C9F5807301331F -:1060C000934228BF1346119A11995289DBB21A44A0 -:1060D0004A81049A1298AD1A6A1C1344109A1371DB -:1060E0001146FFF755FB059B45EA8315129B9D70F2 -:1060F000DF70B8F1060F15D8DFE808F00D1941532D -:1061000014417300B4F890312B74B4F890311B0A29 -:106110007EE7029BDDE7002384F8D773C4F8C03B19 -:10612000C4F8D8635FFA89F007B0BDE8F08F0023A8 -:10613000C4F8C03B002EF5D0109B94F84E1A1A7983 -:1061400094F84C0A02320CF08EF8374B1B689A8A8E -:10615000A36C9A422CBF8018C018344B984228BFB9 -:106160001846C4F8C00B0CF085F83346014694F885 -:10617000C42BC4F8C00B2046FFF766FDD2E7002C05 -:10618000D0D00023C4F8C03B002ECBD094F84F1AD7 -:1061900094F84C0A09B994F8191B109B1A79023229 -:1061A000D1E70023C4F84833002EBBD0109B94F8ED -:1061B0004E1A1A7994F84C0A02320CF054F81A4B21 -:1061C0001B689A8AA36C9A422CBF8118C118174B7E -:1061D00094F84D23994228BF19463346C4F8481312 -:1061E000C9E70023C4F848339CE7049B002F08BF8D -:1061F0001D4658E7B8F1040F3FF482AD4FF0010B94 -:10620000002C7FF488ADB8F1020F3FF488ADB8F1EF -:10621000050F3FF484AD00278EE500BF1211111168 -:10622000E3361A0040AF0301DC4D0021D47E250087 -:1062300000232DE9F04788B0CDF8193007238DF8F9 -:106240001830038C064603F007030F46904600F50E -:106250000969062B00F28680DFE803F0047C7C8469 -:106260004C7C7C00B0F85238002B07BF1A461D4604 -:1062700008221025154390F83D20012A14BF002460 -:10628000402408BF44F00104002B0CBF402300232E -:106290001C4390F88931012B04D190F8C63B002BA8 -:1062A00008BF1825E8064ED445F001050DF1180A7F -:1062B000EB0632464946504648BF04F0BF04F5F7A6 -:1062C0002BFA324649465046F5F786FA0022338CBF -:1062D000CDE90328CDE9012786F8D72329462246B0 -:1062E0003046CDF800A003F00303FFF7EBFC08B045 -:1062F000BDE8F087B0F85238002B07BF1A461D469C -:1063000008221025154390F83D20012A0ABF0224D7 -:106310000024402208BF44F0010418BF0022002BD3 -:106320000CBF4023002314431C4390F88931012BF8 -:1063300004D190F8C63B002B08BF1825E90602D40B -:1063400045F00305B2E7094B9B699A04AED504F00A -:10635000FE04ABE790F83D301825012B0CBF40241C -:106360000024A3E700242546A0E700BF2050002119 -:106370002DE9F04F9946002389B0CDF81930072355 -:106380008DF81830038C054603F00703884617463E -:1063900000F5246A062B4FD8DFE803F00751514E71 -:1063A00019044C0040240B2626E090F8D74390F8BF -:1063B000893104F00104C4F15104012BE4B204D189 -:1063C00090F8C63B0BB944F02004082614E090F87E -:1063D000D74390F8893114F0020F04F001040CBF88 -:1063E0000A260826C4F15104012BE4B204D190F826 -:1063F000C63B0BB944F020040DF1180B2A46514658 -:106400005846F5F789F92A4651465846F5F7E4F912 -:1064100001222B8CCDE90282314622462846CDE965 -:1064200000B7CDF8109003F00303FFF74BFC09B061 -:10643000BDE8F08F4824B6E700242646DCE7402478 -:106440000926D9E700232DE9F04389B0CDF81930AA -:10645000072304468DF81830134B00F524699B6917 -:1064600006AD1B050E46174649460246284654BF50 -:106470004FF001084FF00908F5F74EF9224649465A -:106480002846F5F7A9F90223CDE9026304F23C732B -:10649000CDE9005350220023414620460497FFF7E0 -:1064A00011FC09B0BDE8F0832050002130B50C4646 -:1064B0000725002189B0CDF819108DF818502BB997 -:1064C000018C11F0020F14BF002108210493042352 -:1064D000CDE9024306AB0192009310220023FFF79F -:1064E000F1FB09B030BD000000232DE9F04788B072 -:1064F0000F469046054606938DF81C3000B30823DE -:1065000000F5246600F6C8340246314680F8C83BE0 -:106510002046F5F701F92A4631462046F5F75CF9A1 -:106520000523CDE90273002303211A462846CDE94D -:106530000043CDF81080FFF7C5FB08B0BDE8F08739 -:10654000DFF83CA0DAF80030BBB1DFF83890D9F8BA -:10655000003093B10CF098FB08230446466AC16AE8 -:1065600032468DF8183006A8DAF8003098473246DF -:10657000D9F80030E16A06A8984706ACD0E700BF1A -:10658000BC4B0021B84B00212DE9F7430546002400 -:1065900000F5096702460E46684601F102083946D1 -:1065A00000948DF80440F5F7B7F82A463946684656 -:1065B000F5F712F92B8C03F00703032B05D0052BFD -:1065C0004ED0022B50D106234BE08DF80040D5E988 -:1065D000042340460DF062F89DF8003006F10807EC -:1065E000012B0CD1D5F81439384643F00403C5F813 -:1065F0001439D5E906230DF051F806F10E079DF880 -:106600000090B9F1060F31D8012303FA09F313F012 -:1066100045040BD095F83D4644B11F2C2246384620 -:1066200028BF1F2205F23E6113F050FB104B9B6AFE -:106630005B0405D5B9F1010F9CBF01238DF8013032 -:10664000A7EB08000444694630468DF80440FFF784 -:106650009FF89DF804000230C0B203B0BDE8F0839B -:1066600001238DF80030B2E70223FAE70024DDE7CA -:1066700020500021002337B5ADF801308DF80330EC -:1066800004238DF8003090F839300446022B0D4673 -:1066900025D003F0FD03012B01D18DF8023094F8D1 -:1066A00051376946063328468DF80430FFF770F8F5 -:1066B000D4E90423054428460CF0F0FF94F8512750 -:1066C0003AB11F2A28BF1F2204F25271A81D13F0ED -:1066D000FDFA9DF804000230C0B203B030BD43693A -:1066E0001B0A03F0C003402BD9D10123D5E70000DA -:1066F000F0B51F460023072490F8C06389B09E427E -:1067000014BF04261E468DF818400D4CB0F8605397 -:10671000E46A05F04005640804F0080434432C439F -:106720000325019206AACDE90215009219460497A5 -:1067300044F01002CDF81930FFF7C4FA09B0F0BDEB -:10674000205000218A780B8843EA02331BB2037081 -:10675000C3F3072343708B8883708B881B0AC37035 -:10676000042070474A790B7843EA02234A78920062 -:1067700002F0040213438A78D20002F008021343A5 -:10678000CA78120102F0100213430A79520102F092 -:10679000200213431BB20370C3F3072343700B792A -:1067A00043B1CB798A7903F01F0343EA82138370E4 -:1067B0000320704702207047002303700B7843705A -:1067C0004B8883704B881B0AC3708B8803718B883E -:1067D0001B0A4371CB888371CB881B0AC3710B8959 -:1067E00003720B891B0A43724B8983724B891B0A04 -:1067F000C3720C2070474A780B7803EB0223C3F373 -:106800000B02C3F3013302808370CA788B7803EBE9 -:1068100002238380042070470B7810B503F0030433 -:106820004A780470C3F380044470C3F3C0048470D6 -:10683000C3F30014C3F34013C470037142713BB13E -:106840008B7803F01F029B09C2718371032010BD76 -:106850000220FCE74B780370CA788B7803EB0223A5 -:1068600043804A790B7903EB02238380CA798B79C1 -:1068700003EB0223C3804A7A0B7A03EB02230381E2 -:10688000CA7A8B7A03EB022343810C2070478B7802 -:10689000CA781B0212049B182CBF0122002210B5DB -:1068A0004C781B1942F100040A7912069B184A79A8 -:1068B00042EB0402C0E90032CA798B7903EB022370 -:1068C0000381082010BD10B50446481C0CF0CDFE15 -:1068D000C4E90001092010BD4B780370CA788B7899 -:1068E00003EB022343804A790B7903EB0223838075 -:1068F000062070478A784B7803EB022303800A79DD -:10690000CB7803EB022343808A794B7903EB022394 -:1069100083800A7ACB7903EB0223C3800920704776 -:1069200010B58A784B780C3003EB022320F80C3C2E -:106930000A79CB7803EB022320F80A3C8A794B7959 -:1069400003EB022320F8083C0A7ACB7903EB0223FD -:1069500020F8063C4B7A00F8043CCA7A8B7A03EBA9 -:10696000022320F8023C01F10E031A3113F8014C06 -:1069700013F8022C023302EB04228B4220F8022B84 -:10698000F4D1182010BD4B7803708A7803F0070308 -:10699000037002F007034370032070474B780370C5 -:1069A0008B7843700A79CB7803EB02234380052070 -:1069B000704738B58B784A78054602EB03220346C8 -:1069C0000C4623F8022BCA1C153112F8010B8A421F -:1069D00003F8010BF9D1A27D637D04F11B0003EBE9 -:1069E0000223AB82227EE37D03EB0223EB82637EF4 -:1069F00003F00F022A76C3F300125B096A76AB76C6 -:106A0000A37EEB760CF044FEC5E9080194F8222041 -:106A100094F82130232003EB02232B8538BD4B78DB -:106A200003708B784370CB7883700B79C3708A794D -:106A30004B7903EB0223C3F30B03D2090271C3802A -:106A40000A7ACB7903EB0223C3F30B0303818A7A1F -:106A50004B7A03EB0223CA7A03EB0243C3F313031B -:106A6000C3604A7B0B7B03EB02238A7B03EB02436D -:106A7000C3F3130303610A7CCB7B03EB0223838202 -:106A80008A7C4B7C03EB0223C382CB7C03764A7D5A -:106A90000B7D03EB02238A7D03EB0243C361CB7DB5 -:106AA0001A0903F00F0380F8212080F820300B7EB4 -:106AB00080F822304B7E80F82330CA7E8B7E03EB39 -:106AC000022383844A7F0B7F03EB02238A7F03EB3D -:106AD0000243836291F82020CB7F03EB022391F8DD -:106AE000212003EB0243C36291F8232091F8223066 -:106AF00003EB02230386242070478A784B7803EB4C -:106B00000223CA7803EB024303604A790B7903EB53 -:106B100002238A7903EB024343600A7ACB7903EBC1 -:106B20000223038109207047CB788A781B0403EB8A -:106B300002234A7813440A7903EB026303608A79DB -:106B40004B7903EB0223CA7903EB024343604A7A91 -:106B50000B7A03EB02238A7A03EB024383600A7BFE -:106B6000CB7A03EB02234A7B03EB0243C360CA7B6D -:106B70008B7B03EB022303821020704738B58B78A0 -:106B80004A78054602EB032203460C4623F8022B03 -:106B9000CA1C153112F8010B8A4203F8010BF9D116 -:106BA000A27D637D04F11B0003EB0223AB82227EF6 -:106BB000E37D03EB0223EB82637E03F00F022A7670 -:106BC000C3F300125B096A76AB76A37EEB760CF01A -:106BD0005FFDC5E9080194F8222094F821302B20AC -:106BE00003EB02232B8594F8253094F824201B0412 -:106BF00003EB022394F82320134494F8262003EB9C -:106C00000263EB6294F8273085F8303094F828302E -:106C100085F8313094F8293085F8323094F82A30EC -:106C200085F8333038BD000070B504460E46154671 -:106C3000FFF7F2FD365C014426722A2E00F29180A5 -:106C4000DFE816F02B006C00E4008F008F008F004F -:106C50008F00E400830084008F008F009100960075 -:106C600089005F005D009B008F008F007E007E002A -:106C7000A800A600B200BE00E900F300D700E000C3 -:106C8000E000F90004010F011C013C0141012B014E -:106C900046016A016D0175018801002D61D004F182 -:106CA0001000FFF7D7FD637983425AD140F67A414D -:106CB000A38A9A1F92B28A4201D91E261DE0217C26 -:106CC0000029FAD0092B8CBF082203F1FF32914230 -:106CD000F3DC628A9A42F0D840F67640218BA1F12B -:106CE0000A0292B28242E8D8E28A02FB0333B3EB93 -:106CF000810FE2DAB2F5FA7FDFD2304670BD012DA6 -:106D00002FD0994B9B6A9D072BD504F11000FFF7FC -:106D100007FE6379834224D10026EEE70DB304F128 -:106D20001000FFF7B4FD637983421AD1D4E904015E -:106D300031F01F03C1D10AF01AFF0128ECD8BCE7DB -:106D400004F11000FFF7D6FDE3E755B104F11000A0 -:106D5000FFF7B9FDDDE7012D03D0834B9B6A1807D0 -:106D6000F4D41926C9E704F11000FFF7B5FDD0E708 -:106D7000FF2323744B7863744AE07B4B9B6A5A076A -:106D8000EFD54B7823748B7863746379032BC2E758 -:106D9000012DE6D0744B9B6A13F4106FE1D004F11F -:106DA0001000FFF7F0FDB4E7002DDAD06E4B9B6AC0 -:106DB00013F4106FD5D004F11000FFF7EFFDA8E732 -:106DC000012DCED0684B9B6ADB03CAD54B78237468 -:106DD0008A78617903F00703032962742374C0D1B0 -:106DE000002B3FF46AAF023A232A8CBF1E260026EE -:106DF00083E75D4B9B6A9E01B3D504F11000FFF75A -:106E0000D8FD86E7584B9B6A5D01AAD54B78237461 -:106E10006379022B7FE7544B9B6A5803A1D54B78CB -:106E200003F01F0222749B09A5E74F4B9B6A99034D -:106E30003FF572AF95E74C4B9B6A9A0091D5002DB8 -:106E40008FD004F11000FFF7EAFD62E7464B9B6A22 -:106E5000DB0086D5012D84D004F11000FFF74DFE34 -:106E600057E7414B9B6A9E007FF57BAF002D3FF4B7 -:106E700078AF04F11000FFF757FE4AE73A4B9B6AE0 -:106E800013F0405F3FF46DAF4B7823748B786374DD -:106E9000CB78A3746379042B3DE7334BDB6A13F0A3 -:106EA000040F3FF45EAF4B7823748B786374CB7818 -:106EB000A3740B79E3746379052B2CE72A4BDB6A07 -:106EC00013F0020FDEE7284BDB6A13F0020FE8E74E -:106ED000012D3FF446AF244BDB6A98067FF541AFA6 -:106EE0008A784B7803EB022323820A79CB7803EB71 -:106EF000022363828A794B7903EB0223A3820A7A05 -:106F0000CB7903EB0223E3828A7A4B7A03EB0223E9 -:106F1000238363790B2BFEE6002DDCD121E7002DC6 -:106F20003FF41FAF104BDB6A13F0800FAAE7012D6F -:106F30003FF417AF0C4BDB6A1A067FF512AF4B1C00 -:106F400004F110020B3113F8010B8B4202F8010B14 -:106F5000F9D1DEE7044B9B6A9B017FF502AF04F198 -:106F60001000FFF70BFED4E62050002170B50E464E -:106F700004461546FFF750FC325C33182272033A80 -:106F8000102A3CD8DFE802F0092634363B3B3B3977 -:106F9000363B3B3B3B3B3B3D3D0085B3D3F80120BB -:106FA0002261D3F805206261997A5A7A02EB0122B4 -:106FB0002283D3F80B20C4F81A20D3F80F20C4F88A -:106FC0001E20D3F81330C4F822306379172B16D162 -:106FD000002070BD012D12D0D3F801202261D3F81A -:106FE00005206261D3F809206379A2610D2BEEE7D9 -:106FF000012D04D06379012BE9E7002DFAD1192086 -:10700000E7E7024B9B6ADB06F4D4F8E72050002147 -:10701000CB788A781B0243EA42120B7813434A78F2 -:10702000920002F01C0213431BB20370C3F3072348 -:1070300043700220704710B50024BDF8081004709A -:10704000140A427084708171140C090A120EC47003 -:1070500002714371C171082010BD01238270120AB0 -:1070600003704170C270042070470B784A7803F0B7 -:1070700003010170C3F38201C3F3401341708370B5 -:10708000C2700220704770B5D3799579D47805EB3A -:107090000325937824041B021B192CBF012600260C -:1070A00054781B19147952794FEA046446F10006AA -:1070B0001B1942EB0602C0E9003208200D8070BDAA -:1070C00053780370D078937803EB00230B8004206F -:1070D000704770B50C4603464A7814F8040B00EB71 -:1070E0000220C0F30B021A80C0F301329A70C0F381 -:1070F0008032DA70CE788D7880F4805005EB0625EA -:10710000C5F30B059D80C0F30035C00424D50AB338 -:107110008A794879120402EB0022087901F1080407 -:107120000244C87902EB00620C209A6061782278F0 -:10713000043402EB01229A8114F8011C14F8022C89 -:1071400002EB0122C2F30B01C2F38132D9811A741E -:107150005C6170BD0820E8E704209D60DD811D743E -:10716000F6E78B78CA781B03920302F4804203F49B -:10717000405313430A8830B5C2F30B021343037024 -:107180001B0A43708B7813F0FD0F29D1CB78D3B94C -:107190000422041D8B8923708B891B0A6370CB89A1 -:1071A0000D7CC3F30B0343EA85331BB2A370C3F317 -:1071B0000723E3708B88134483708B8813441B125E -:1071C000C370101D30BD8B68082203718B6800F1FD -:1071D00008041B0A43714B898371CB7AC371D9E7C9 -:1071E0000022E7E74A780B7843EA420303700A7803 -:1071F0008B7852B9033343704B6883704B681B0A1A -:10720000C370CB880371052070474370022070471C -:107210000B7803F00102C3F34003027043704B7814 -:1072200083704AB9CA788B7803EB02230A7903EB9F -:107230000243436005207047022070474A790B786B -:1072400043EA02234A78920002F0040213438A7848 -:10725000D20002F008021343CA78120102F01002B1 -:1072600013430A79920102F0400213431BB20370E8 -:10727000C3F307234370022070470B784A7803F06A -:1072800003010170C3F380014170C3F3C001817039 -:10729000C3F30011C3F38013C17003714271022064 -:1072A0007047000038B50B4D0B4A95F82430044662 -:1072B00003EB8303034452F8233003B1984795F856 -:1072C0002430064A03EB830313441B5D85F8243006 -:1072D00038BD00BF580D00214CAF03019CAF030126 -:1072E00038B50378074A01EB830352F8233004468C -:1072F0000D4603B198472278034B03EB82035B5D95 -:10730000237038BD28B0030168B00301062238B5E8 -:10731000084D04462B7802FB0303074A52F823303A -:1073200003B1984706212A78044B01FB02331B5D09 -:107330002B7038BDC0360021B0AF030110B003017F -:10734000062238B5084D04462B7802FB0303074A92 -:1073500052F8233003B1984706212A78044B01FBE9 -:1073600002331B5D2B7038BDE8360021DCB0030111 -:1073700010B0030138B54378084A03EB83030B448C -:1073800052F8233004460D4603B198476378044A07 -:1073900003EB830313445B5D637038BD78B0030176 -:1073A000C8B0030138B50B4D0B4A95F82730044699 -:1073B00003EB8303034452F8233003B1984795F855 -:1073C0002730064A03EB830313441B5D85F82730FF -:1073D00038BD00BF683700213CB103018CB1030107 -:1073E00070B506268278084B06FB021253F822304D -:1073F00004460D4603B19847A278044B06FB0233BE -:107400005B5DA37070BD00BFBCB103011CB2030182 -:1074100038B590F88831094A01EB830352F82330DC -:1074200004460D4603B1984794F88821044B03EBBA -:1074300082035B5D84F8883138BD00BF34B203013C -:1074400074B20301032970B504460AD8012994BF18 -:107450000026012605291DD8DFE801F0081D081DBA -:10746000081D0B1F012B15D80226F3E700250B4B37 -:1074700005EB460253F822300BB1204698476820AE -:1074800000FB0644064B94F8502003EB42035B5D7F -:1074900084F8503070BD0125E9E700BFA0B10301B9 -:1074A000B8B1030138B54378074A01EBC30352F87A -:1074B000233004460D4603B198476278034B03EB33 -:1074C000C2035B5D637038BD84B2030124B3030162 -:1074D00038B54378084A03EB83030B4452F8233052 -:1074E00004460D4603B198476378044A03EB8303CF -:1074F00013445B5D637038BD4CB303019CB303015F -:10750000062970B505460C4608D859B14B1E052B07 -:1075100008D8DFE803F00D0D07070D21172902D069 -:10752000472915D070BD0123C376E6F735FD032446 -:10753000AE78012E18D0022E27D0002EF2D1012CC9 -:107540000DD0022CEED12846E6F786FDAE70E9E7B5 -:10755000E6F72DFD0424EBE7E6F738FDFAE72846C9 -:10756000E6F738FDAC70DDE7042C09D0052C0ED011 -:10757000032CD7D12846E6F795FD0223AB70D1E75F -:107580002846E6F703FE0023F8E7052CCAD1284673 -:10759000E6F7A8FDF7E70000F0B543780446022BB4 -:1075A0000D468BB050D0032B78D0002B55D13F29FE -:1075B00053D1FAF7AFFF2046E7F79CFEA368D9073F -:1075C00003D56621204600F09FFDA368DA0503D5A8 -:1075D0006721204600F098FDA3685B060CD5B4F83F -:1075E0004A331B2B04D8B4F84C33B3F5A47F03D92A -:1075F0006821204600F088FD3349344B086834493F -:10760000201AC0101A684843B4F8A21492F83C300B -:10761000099194F8A0140832089194F8451280B2A8 -:10762000079100210691D2E91467CDE90467D2E9F8 -:107630001267CDE90267D2E91067CDE90067E7F785 -:10764000EDFB022363701FE03F291DD018D83D29B0 -:1076500021D02946204601F023FA4C2D2CD04D2D67 -:1076600012D1194B18681A4B201AC0105843C0B2D7 -:107670000BF0F4F820460BB0BDE8F040F9F7F6BC8B -:10768000A1F14703012BE4D8294620460BB0BDE801 -:10769000F04000F02BB8E8F7C1FAF5E75129DCD14A -:1076A000D0F8883323F00103C0F88833E7F725FECC -:1076B000002384F87633E7E72046E8F75BFA2046B4 -:1076C000E7F7CAFDCDE700BFB43A0021B03A002188 -:1076D000BDCAE28C0322437842700022022B80F85C -:1076E000762302D114300BF073BE7047482910B5D1 -:1076F000044610D003D8A9B147290FD010BD4C299A -:10770000FCD1E8F737FA2046E7F7A6FD2046BDE8AA -:107710001040F9F7ABBCE7F7FFFD2046BDE810408D -:10772000FFF7D8BFE7F7EFFDF7E70000F0B54378C4 -:1077300004460D468BB0032B0FD8DFE813F015007D -:107740008D00040021013D2907D0A5F14703012B3D -:1077500003D92946204601F0EDFB294620460BB00F -:10776000BDE8F040FFF7C2BF0B29F6D1FBF72AF8BE -:107770002046E7F7BFFDA36813F4007F03F4007110 -:1077800003F0010248D02AB1D4F88C2342F0080259 -:10779000C4F88C23D80542BFD4F88C2342F00402ED -:1077A000C4F88C2359060ED5B4F84A331B2B04D8E1 -:1077B000B4F84C33B3F5A47F05D9D4F88C3343F037 -:1077C0001003C4F88C330123754963700868754B46 -:1077D0007549201AC0101A684843B4F8A21492F8E8 -:1077E0003C30099194F8A0140832089194F845129D -:1077F00080B2079100210691D2E91467CDE90467B0 -:10780000D2E91267CDE902670121D2E91067CDE91B -:107810000067E7F703FBA0E752EA010303D0662104 -:10782000204600F071FCA368DA0503D567212046E5 -:1078300000F06AFCA3685B060CD5B4F84A331B2B36 -:1078400004D8B4F84C33B3F5A47F03D9682120469B -:1078500000F05AFC0223B7E7232929D814297FF620 -:1078600078AFA1F115030E2B3FF673AF01A252F8CA -:1078700023F000BFCD780201537702015377020154 -:10788000537702015377020153770201E77802012F -:10789000FD78020153770201537702011379020147 -:1078A0003F790201557902016B79020129790201C0 -:1078B000402905D03FF649AF3D293FF44EAF48E798 -:1078C000022370214370F9F7CBFD46E7D0F88C33E3 -:1078D00043F40063C0F88C33D0F8883343F400637A -:1078E000C4F8883339E7D0F88C3343F00403C0F888 -:1078F0008C33D0F8883343F00403F1E7D0F88C33AD -:1079000043F00803C0F88C33D0F8883343F0080301 -:10791000E6E7D0F88C3343F01003C0F88C33D0F88E -:10792000883343F01003DBE7D0F88C3343F0800357 -:10793000C0F88C33D0F8883343F08003D0E7D0F818 -:107940008C3343F40043C0F88C33D0F8883343F4CD -:107950000043C5E7D0F88C3343F02003C0F88C33E4 -:10796000D0F8883343F02003BAE7D0F88C3343F0E3 -:107970004003C0F88C33D0F8883343F04003AFE7BE -:1079800051297FF4EAAED0F8883323F00103C0F820 -:107990008833E7F7B2FC002384F87633DDE600BFD6 -:1079A000B43A0021B03A0021BDCAE28C38B50A4D84 -:1079B0000A4A95F82430044600EB830352F823303A -:1079C00003B1984795F82420054B03EB82031B5D18 -:1079D00085F8243038BD00BFD03A0021B0B3030190 -:1079E000F0B3030138B50378074A01EB830352F87B -:1079F000233004460D4603B198472278034B03EB2E -:107A000082035B5D237038BD00B4030140B4030101 -:107A100038B50B79154603EB83031344064A0C462D -:107A200052F8233003B198472379044A03EB8303C8 -:107A300013445B5D237138BD50B4030178B4030176 -:107A4000172970B505460C462DD006D804291ED03E -:107A50000C290ED00024204670BD7029FAD1D0F830 -:107A60008C3319032DD523F400230224C0F88C3362 -:107A70000DE04B4B1A7A222AECD1597C187CF6F790 -:107A80008FFD0028E6D001240389A5F82C34B5F831 -:107A90002C04F6F769FD95F876330646CBB1012B39 -:107AA00026D00124D7E73F4C2368D888F6F75CFD41 -:107AB0000028CFD023680024DA88A5F82C24DC80A5 -:107AC000E5E7DA02C6D523F480130324C0F88C332B -:107AD000DDE7014622462846FFF79AFF3379002B5F -:107AE000DFD00124132385F8764385F88533B2E788 -:107AF000012C15D195F88533042B0FD8012B0FD904 -:107B00000121D5F88C2301FA03F31343C5F88C3314 -:107B1000132385F8811385F8853301E0072BEFD017 -:107B200095F88523132A14D1224631462846FFF7BB -:107B30006FFF3479002CB4D128463146F7F7FBF9B2 -:107B4000FF23284685F8764385F88533E7F7B0FFAD -:107B5000A7E7C4B1012CA4D10F2A04D849F6020327 -:107B6000D340DB0709D43046E6F710FAD5F88C335A -:107B700043F48013C5F88C336DE722462A2128464A -:107B8000E7F7DCFE67E7D5F8883343F40023C5F850 -:107B90008833D5F88C3343F40023C5F88C3380E761 -:107BA000283A0021B03A002138B5CB781546C3EB0E -:107BB000C3031344064A0C4652F8233003B19847D6 -:107BC000E378044AC3EBC30313445B5DE37038BD41 -:107BD00084B40301D8B4030101222321E7F7AEBE28 -:107BE0004B29F8B5044647D008D8242926D02729A0 -:107BF0002BD00C290AD000252846F8BD6E292BD0A1 -:107C000070292FD05229F6D103260FE0454B1A7A5E -:107C1000112A03D0202A06D0072AECD11B7C1F2B67 -:107C2000E9D1022602E0012680F85264B4F82C045F -:107C3000F6F79AFC074608BB0125DDE73A4B1B68BF -:107C40009B88A0F82C340026F0E7374B05261B68EC -:107C5000DB88A0F82C34E9E790F88533112BCAD1E2 -:107C60000626E3E7D0F88C3313F40035C4D023F4B0 -:107C70000033C0F88C33E6E70426D7E794F8765350 -:107C8000D5B1012DD8D194F88533112B3BD1324693 -:107C900001462046FFF788FFFE78002ECCD1204613 -:107CA0003946F7F748F9FF23204684F8766384F8CD -:107CB0008533E7F7FDFE9FE71C4B9B695B0102D410 -:107CC00094F8223373B1324639462046FFF76CFFF1 -:107CD000FB78002BB0D00125112384F8765384F86B -:107CE000853389E7D4F88833672143F40033C4F837 -:107CF0008833D4F88C33204643F40033C4F88C33F3 -:107D000000F002FA98E7002E96D1D4F8883343F4B5 -:107D10000033C4F88833D4F88C3343F40033C4F808 -:107D20008C3369E7283A0021B03A00212050002125 -:107D300038B5CB781546C3EBC3031344074A0C464A -:107D400052F8233003B19847237833B1E378044ADB -:107D5000C3EBC30313445B5DE37038BDF0B40301B0 -:107D600060B5030110B5044600F5FA700CF011F887 -:107D70002046BDE8104001222321E7F7DFBD0000C7 -:107D80005229F8B504466BD008D825296ED026298B -:107D90006AD00C2911D000252846F8BD6E2959D08B -:107DA0007029F8D1D0F88C3313F48025F4D023F463 -:107DB00080230126C0F88C3340E05C4D2B7A1F2BCA -:107DC00008D0212B54D0112BE5D12B7C202BE2D1D4 -:107DD000052633E0287CF6F799FC48B9287CF6F7AD -:107DE00051FC48B9012243212046E7F7A7FDD2E71D -:107DF00090F88030002BF5D1F6F770FB0028F1D019 -:107E00004B4B4C4A1B680026E31ADB1053430122FC -:107E10009BB2C38082720289A4F8F83145F2012333 -:107E2000A4F82C24444A4549C4F83C24444AA4F804 -:107E3000FA311160434A127B84F80022B4F82C0412 -:107E4000F6F792FB94F8765307469DB1012D20D0AA -:107E50000125A1E790F88533112B9CD10626EDE78B -:107E60001022394B1B681A710326E7E70226E5E763 -:107E70000426E3E7014632462046FFF759FFFB7828 -:107E8000002BE5D00125112384F8765384F885333F -:107E900082E7AEB994F88533042B0FD8012B0FD9A4 -:107EA0000121D4F88C2301FA03F31343C4F88C3373 -:107EB000112384F8811384F8853301E0072BEFD078 -:107EC00094F88523112A17D1324639462046FFF708 -:107ED0002FFF3B7813B1FB78002BB9D120463946F0 -:107EE000F7F729F8002384F87633FF23204684F837 -:107EF0008533E7F7DDFD4FE7002EA9D10F2A04D81F -:107F000049F60203D340DB070AD439462046E6F798 -:107F1000FFFDD4F88C3343F48023C4F88C333BE763 -:107F200001222A212046E7F709FD35E7283A0021FA -:107F3000B43A0021BDCAE28C65EE010105EF0101F2 -:107F4000143A002168500021B03A0021044B01EBA3 -:107F50008101114453F8213003B11847704700BF25 -:107F6000A8B5030101390346082945D8DFE801F027 -:107F70001E0F05192732383D3D00022A0CBF93F829 -:107F8000190393F81A03B0FA80F040097047987803 -:107F9000012831D1002A30D1D3F83003C0F3C0001A -:107FA0007047D3F83003C0F3401070479B78012B23 -:107FB00003D1101E18BF01207047101FFAE79978EF -:107FC0000029F6D0042A15D0B2B9B3F8320300F074 -:107FD00001007047002AF0D1084B93F82B00F6E718 -:107FE000D3F83003C0F380607047D3F83403C0F394 -:107FF000C0107047002070470120704720500021BA -:108000001FB5144B144A1B688DF80310C31ADB10FC -:1080100053430022CDE9012203920A229BB2ADF81C -:108020000630ADF800300D4B8DF804101B688DF84C -:1080300002201B79082B0AD8D0E9CC2302A80BF028 -:1080400018FB684609F0C4FD05B05DF804FBD0E9F3 -:10805000CA23F3E7B43A0021BDCAE28CDC4D00210B -:108060000B460121D0F888239940114210D022EA12 -:1080700001021549C0F888230A7A0D2A09D0112A6D -:1080800007D0072A07D01A21022B0BD0072B19D0B3 -:108090007047497CF8E7042B06D0072B0BD0022B46 -:1080A000F6D11A21FFF7ACBFD0F8303323F020030C -:1080B000C0F8303370471121D0F8303323F080639B -:1080C000C0F83033E7F706BC283A002110B4012489 -:1080D000D0F888238C40144214D022EA04020329E9 -:1080E000C0F8882307D0072908D002290AD1002127 -:1080F00010BCFFF785BF10BCE7F774B8002110BCB7 -:10810000E7F7E8BB10BC70472329F8B504463BD815 -:108110000B2901D8002083E1A1F10C03172BF9D81A -:1081200001A252F823F000BFC981020115810201AA -:1081300015810201158102011581020115810201DB -:1081400015810201158102011581020115810201CB -:1081500001870201018702011581020115810201D7 -:1081600015810201018702010187020115810201C7 -:1081700015810201018702011581020101870201B7 -:1081800001870201018702016639CBB20A2BC1D8EF -:108190000A29BFD801A353F821F000BFC18602010C -:1081A000C1860201C186020115810201C186020158 -:1081B000C1860201C186020115810201CB82020142 -:1081C0001581020195820201CF4B1B7A013BDBB284 -:1081D000292B9FD8CD4AD65CFF2E9BD0CA4B1D7A47 -:1081E0006A1E292A96D801A151F822F0D7820201ED -:1081F000BB82020115810201158102011581020174 -:1082000015810201F78202015384020153840201A5 -:10821000158102011581020143840201CD82020110 -:10822000538402011581020115810201CD820201F0 -:10823000158102011581020131840201318402019C -:108240001581020115810201158102014D8402018F -:10825000158102011581020169840201C7820201B0 -:10826000C7820201158102011581020115810201F7 -:10827000158102011581020115810201158102019A -:10828000158102011581020163840201C18202018C -:1082900069840201D4F89033002B0CBF012602261A -:1082A0006378032B3FF436AFD4F8902312F0010526 -:1082B0007ED022F00102C4F8902300250BE00126B5 -:1082C000092508E00026072505E0062694F88553D1 -:1082D000FF2D3FF41FAF94F87633002B00F0C680DB -:1082E000012B00F01D81002D00F06481EAE00126E1 -:1082F000ECE7002672E71B7C5A1E282A3FF60AAFDD -:1083000001A151F822F000BF2B840201BB820201BF -:1083100015810201158102011581020115810201F9 -:108320001581020153840201538402011581020167 -:108330001581020143840201158102015384020167 -:1083400015810201158102011581020115810201C9 -:10835000158102013184020131840201158102017B -:1083600015810201158102011581020115810201A9 -:108370001581020115810201D7820201D782020113 -:108380001581020115810201158102011581020189 -:108390002384020123840201278402011581020142 -:1083A0001581020163840201C1820201012677E77F -:1083B000D4F88C3313F001000CD14FF0010C0CFAFF -:1083C00000F717EA0201C5B209D022EA0702C4F891 -:1083D000902380E723F00103C4F88C337BE701305E -:1083E0000A28ECD1012707FA01F212EA0300CDB204 -:1083F00013D023EA0203C4F88C3394F88133012BA1 -:108400007FF469AF002284F8812394F87C230AB1B9 -:1084100084F8763384F885535DE701310A29E2D187 -:10842000F8BD162557E7152555E71D4653E70126E4 -:10843000042550E70026FBE701263EE700263CE73F -:108440000126032547E70026FBE70026052542E72E -:10845000012602253FE70026FBE7002601253AE733 -:108460000126082537E70026062534E7012E10D01F -:108470002AD8002E7FF437AF012303FA05F2D4F88F -:1084800088332946134320463246C4F88833FFF721 -:108490005DFD324629462046FFF764FD002800F0C6 -:1084A0009080012229462046FFF750FD2046E7F73D -:1084B000E5FA84F88553012384F87C3384F8763315 -:1084C000002D7BD00120ABE7B31E022B3FF60BAF94 -:1084D000324629462046FFF745FDD8B1022E04D08A -:1084E000022229462046FFF731FD1422084B02FBE9 -:1084F0000533DB6813B120469847F4E684F88553CA -:1085000084F87E33D7E700BF283A00217CB5030109 -:10851000A8B5030100221A212046E7F70FFAE2E688 -:10852000072E3FF6E0AE01A353F826F04D85020179 -:108530004D850201E7820201CD8502017F8602019D -:108540000186020113860201138602013246294682 -:108550002046FFF707FDA0B33EB9012303FA05F259 -:10856000D4F888331343C4F8883394F88533AB4286 -:1085700007D0012303FA05F2D4F88C331343C4F86F -:108580008C3326B9324629462046FFF7DFFC002D02 -:1085900098D1D4F88C33012223F00103C4F88C3332 -:1085A000D4F89033294643F001032046C4F89033B1 -:1085B000FFF7CCFC94F88533002B7BD10323637049 -:1085C00080E729462046FFF74BFD8CE694F885337B -:1085D000AB4215D0032229462046FFF7C3FC0028F2 -:1085E0003FF481AE022229462046FFF7AFFC01236B -:1085F00003FA05F2D4F890331343C4F8903372E6CB -:1086000094F88533AB4219D1042229462046FFF75E -:108610009DFC072E294620462ED1FFF721FD20463E -:10862000E7F73EFAFF2384F885330023204684F8D9 -:108630007C3384F87633E7F73BFA54E60122D4F82A -:108640008C33AA401A423FF44EAE23EA0203C4F828 -:108650008C3394F881332946012B08BF0023204630 -:108660004FF0040208BF84F88133FFF76FFC2946FE -:108670002046FFF72BFD36E6FFF728FDCFE7022265 -:1086800029462046FFF762FC94F885330D2BAED0C7 -:108690001422384B02FB0533DE68002EA7D00422DB -:1086A00029462046FFF75EFC00283FF433AF204602 -:1086B000B04718E6D4F89033DB073FF57FAF01E70A -:1086C000CBB20A2B3FF626AD0A293FF623AD01A314 -:1086D00053F821F041840201518402012F840201E8 -:1086E0001581020139840201BF8202016184020105 -:1086F00015810201EF82020115810201AD830201A1 -:108700000B297FF607AD172B3FF604AD01A252F8F7 -:1087100023F000BFF38202011581020115810201DD -:1087200015810201158102011581020115810201E5 -:108730001581020115810201158102015B8402018C -:108740003D8402011581020115810201158102019A -:10875000578402014784020115810201158102013B -:1087600035840201158102014B84020167840201F4 -:10877000C5820201A8B5030190F8850302380228DA -:108780008CBF00200120704770B50B2690F879232C -:10879000084B06FB021253F8223004460D4603B183 -:1087A000984794F87923044B06FB02335B5D84F809 -:1087B000793370BD70B6030120B703010C21E6F7D1 -:1087C000B3BB10B5012223210446E7F7B7F8002315 -:1087D00084F8523410BD10B50446E7F761F920461D -:1087E000BDE81040E7F7D2B9012310B5044680F880 -:1087F0007D33E7F755F92046E6F7A0FD2046BDE8B2 -:108800001040E7F7C3B9012310B5044680F87D3363 -:10881000437C23F001034374E7F742F92046E6F76F -:10882000EBFD2046BDE81040E7F7B0B9427C42F0CE -:1088300001024274E6F702BE10B50446437C43F0E1 -:1088400001034374E6F76CFD2046BDE81040E6F7EF -:10885000F5BDD0F8883310B513F4006304460ED18B -:10886000C0F8883394F87D3383B10023204684F820 -:108870007D330122BDE810403B21E7F75FB80023BC -:108880003B21C0F88833E6F74FFBEBE710BD10B58E -:1088900004461822002100F56B7011F03EFAD4F85E -:1088A00030339B0707D52046E6F7B2FD2046BDE8EA -:1088B0001040E7F7E3B82046BDE810407121F8F713 -:1088C000CFBD10B50446D0F8883343F40063C0F838 -:1088D0008833E6F703FB2046BDE81040FFF7D7BF1B -:1088E000722970B5044608D86D2908D81D296CD0A6 -:1088F00016D80C2918D0152969D0002539E06E3911 -:108900000429FAD801A353F821F000BF9D89020180 -:10891000FB880201A98902018B890201D389020126 -:108920001E29EAD102211EE05C4B197ACA1F0A2ACD -:10893000E3D801A050F822F077890201FB880201F8 -:10894000FB880201FB880201FB880201FB8802010F -:108950008B890201FB88020165890201D789020126 -:1089600097890201032194F87653B5B3012D44D0C1 -:108970000125284670BD1B7C0F2BBED1D4F83033A7 -:1089800023F00203C4F83033EDE794F885330B2B62 -:10899000B3D10721E7E71B7C0F2BF9E790F885336C -:1089A0000B2BAAD10621DEE7D0F88C330025B3F5D6 -:1089B000006F03D10821C0F88C53D4E7B3F5805F72 -:1089C000D7D10921C0F88C53CDE70121CBE7002195 -:1089D000C9E70A21C7E70421C5E72046FFF7D4FE0F -:1089E00094F87933002BC3D001230B2284F876331B -:1089F00084F8852384F87E53BAE7032915D194F8C7 -:108A00008533042B0FD8012B0FD90120D4F88C23E8 -:108A100000FA03F31343C4F88C330B2384F8810367 -:108A200084F8853301E0072BEFD094F885330B2BC6 -:108A300016D12046FFF7A8FE94F87963002E97D14F -:108A40002046E7F72DF8637C204623F0010363748A -:108A5000FF2384F8766384F88533E7F729F888E7FD -:108A600099B1032984D10D2B09D12046E6F758FC92 -:108A7000D4F88C3343F48053C4F88C3379E7012263 -:108A80002A212046E6F75AFF73E72046E6F726FA42 -:108A9000D4F88C3343F40063EEE700BF283A00219A -:108AA0001C2970B504460D4606D190F81A331BB147 -:108AB000BDE87040E6F796BB2F4E3368FBB973688C -:108AC0001BBBB368002B26D1F368002B29D1336977 -:108AD000002B2CD17369002B2FD1B369002B32D11D -:108AE000F369002B35D1336A002B38D1736A002B20 -:108AF0003BD129462046BDE8704000F0F1B9294637 -:108B0000204698470028DAD070BD2946204698476D -:108B10000028D6D0F8E72946204698470028D3D029 -:108B2000F2E72946204698470028D0D0ECE72946AE -:108B3000204698470028CDD0E6E7294620469847AA -:108B40000028CAD0E0E72946204698470028C7D029 -:108B5000DAE72946204698470028C4D0D4E72946BA -:108B6000204698470028C1D0CEE72946204698479E -:108B70000028BED0C8E700BFC04B002138B590F830 -:108B80007933094A01EBC30352F8233004460D46FA -:108B900003B1984794F87923044B03EBC2035B5D60 -:108BA00084F8793338BD00BF4CB70301CCB703015B -:108BB00001222321E6F7C2BE10B50446437C012200 -:108BC00023F001034374054B1B681979E6F7B6FEE1 -:108BD0002046BDE81040E6F763BF00BFB03A002171 -:108BE000D0F88823110506D522F400620021C0F8D0 -:108BF0008823E6F799B97047014B597CE6F794B999 -:108C0000283A00210C21E6F78FB910B50446437CC1 -:108C100023F001034374E6F707FC2046BDE810404B -:108C2000E6F72CBF10B50446E6F73AFF2046BDE84C -:108C30001040E6F75FB910B50446E6F771FB637CB8 -:108C4000204643F001036374BDE81040E6F7F6BB2D -:108C5000FFF7F1BF0322437842700022022B80F815 -:108C6000762302D114300AF0B3BB7047D0F88823C2 -:108C7000094922F40062C0F888230A7A03460D2AC3 -:108C800005D0112A03D0072A05D11A2101E0184680 -:108C9000497CE6F749B97047283A0021D0F83033CB -:108CA00010B59B07044606D5E6F7B2FB2046BDE8A3 -:108CB0001040E6F7E3BE1A21E6F736F92046BDE894 -:108CC00010406E21F8F7CCBB10B50446D0F88833BD -:108CD00043F40063C0F88833E6F700F92046BDE8A6 -:108CE0001040FFF7DBBF00001E2970B504465DD0C1 -:108CF00007D815295CD01D295CD00C2909D0002586 -:108D000005E06E293DD070294FF000053FD0284680 -:108D100070BD724A137A002B4ED0073BD9B20A2994 -:108D2000EDD80A2BEBD801A151F823F0598D02019F -:108D3000FF8C0201FF8C0201FF8C0201FF8C0201FB -:108D4000FF8C02016F8D0201FF8C0201BD8D0201BB -:108D5000FF8C0201798D0201137C0F2BCFD1D0F84B -:108D6000303323F00203C0F83033052617E090F8C3 -:108D700085330B2BC3D1F8E7137C0F3B012BBED8F7 -:108D8000F3E790F885330B2BB9D1062607E0D0F82E -:108D90008C33B3F5006FBAD10726C0F88C5394F822 -:108DA00076536DB1012D1CD00125B0E70326F6E7FF -:108DB0000026F4E70226F2E70426F0E70126EEE7B4 -:108DC00031462046FFF7DAFE94F87933002BEBD0DA -:108DD00001230B2284F8763384F8852384F87E53AC -:108DE000E2E7012E01D0042E17D194F88533072B2A -:108DF00003D010D89A1E022A0FD80121D4F88C2350 -:108E000001FA03F31343C4F88C330B2384F8811362 -:108E100084F8853301E00F2B1BD094F885330B2B9E -:108E200021D131462046FFF7A9FE94F87963002E40 -:108E3000BAD12046E6F734FE637C204623F00103D6 -:108E40006374FF2384F8766384F88533E6F730FE95 -:108E50005DE7D4F88C3343F40043C4F88C330B2320 -:108E600084F88533D9E7052E9ED801A353F826F060 -:108E7000A38E0201958E0201A98D0201A98D020126 -:108E8000898E0201B78E020100222A212046E6F7D0 -:108E900055FD3CE701222A212046E6F74FFD3546E5 -:108EA00035E72046E6F71AF8D4F88C3343F400632C -:108EB000C4F88C332BE7D4F88C3323F40063C4F864 -:108EC0008C3394F8793313B1002384F87933034B4E -:108ED0002046597CE6F728F819E700BF283A002118 -:108EE0004A2910B504461FD006D80E290FD04929AB -:108EF00013D00D2907D010BD512918D07329FAD1EC -:108F0000E6F7FEF90BE0BDE81040E6F703BD0022EE -:108F1000BDE810401E21E6F711BDE6F7F7F920463F -:108F2000BDE81040FFF796BEE6F7F3F9F7E7E6F77E -:108F3000E4F9F4E71C2970B504460D4606D190F813 -:108F40001A331BB1BDE87040E6F74CB92F4E3368B9 -:108F5000FBB973681BBBB368002B26D1F368002BE9 -:108F600029D13369002B2CD17369002B2FD1B36920 -:108F7000002B32D1F369002B35D1336A002B38D165 -:108F8000736A002B3BD129462046BDE87040FFF7AD -:108F9000A7BF2946204698470028DAD070BD294649 -:108FA000204698470028D6D0F8E72946204698471B -:108FB0000028D3D0F2E72946204698470028D0D091 -:108FC000ECE72946204698470028CDD0E6E7294619 -:108FD000204698470028CAD0E0E72946204698470F -:108FE0000028C7D0DAE72946204698470028C4D091 -:108FF000D4E72946204698470028C1D0CEE7294625 -:10900000204698470028BED0C8E700BFE84B0021A3 -:1090100090F885330B2B05D190F87903831E5842C5 -:10902000584170470020704790F88503A0F116035F -:1090300058425841704790F87903C31E584258412E -:10904000704710B50446E7F7D2FA2046E7F7EAFA88 -:109050002046E6F76FFD2046E7F7A8FB2046E7F736 -:1090600093FC2046BDE81040E6F708BD10B5044665 -:10907000E7F7BDFA2046E7F7D5FA2046E7F784FC84 -:109080002046BDE81040E6F7F9BC10B50446E7F706 -:109090007EFB2046BDE81040E6F7F0BC10B5044664 -:1090A000E6F709FD2046E6F737FD012384F80B3388 -:1090B00010BD10B50446E6F7FEFC2046BDE81040A2 -:1090C000E6F72ABD10B50446E6F7EAFC2046E6F7C7 -:1090D000F7FC2046E6F732FD94F80B13204629B141 -:1090E000E7F7DEFB002384F80B3310BDE7F7B2FB94 -:1090F000F8E7000010B50446E6F7D2FC2046E6F794 -:10910000DFFC2046E6F71AFD064B20461A7A072AAE -:1091100014BF597C1A21E7F79DFB002384F80B3319 -:1091200010BD00BF283A00210C21E7F793BB10B512 -:109130000446E7F745FA2046E7F75DFA2046E7F7E9 -:1091400017FB2046BDE81040E6F798BC10B5044672 -:10915000E6F7A6FC2046E7F707FC2046E7F7A2FA69 -:109160002046E6F7E7FC2046BDE81040E6F786BC5F -:1091700038B590F877330A4AC3EBC3030B4452F86F -:10918000233004460D4603B1984794F87733054AD7 -:10919000C3EBC30313445B5D84F8773338BD00BF72 -:1091A000ECB70301CCB8030170B590F897420546BF -:1091B000012C0E461CD10C2907D0A1F10D03012B67 -:1091C00016D8E7F7A7FA204670BD554B1B7A023B2D -:1091D0000F2B09D8DFE803F00C080C0C0C0C080866 -:1091E000080C080C0808080CE7F794FA0024EAE7D2 -:1091F00095F876332BB1012B08D195F885330D2BDB -:1092000004D0182E02D12846E7F786FB454B9C6A0E -:1092100014F00104D7D03E2E47D005D80C2E0FD025 -:10922000182EE3D1002130E0702EDFD1D5F88C3339 -:1092300013F40054C7D023F40053C5F88C33F1E77E -:10924000374A137A043B0D2BD0D801A151F823F0F3 -:10925000BB920201B792020189920201A59202011A -:10926000ED910201ED910201ED910201BF92020127 -:10927000ED91020199920201ED910201ED9102013D -:10928000ED910201A5920201032195F87643C4B144 -:10929000012C26D0012496E795F885330D2BA5D116 -:1092A0000621F2E7137C032BF9E795F885330D2BA4 -:1092B0009CD10521E9E70221E7E70121E5E7042147 -:1092C000E3E72846FFF754FF95F87733002BE1D00A -:1092D000052BDFD00D23012485F8853385F87643EF -:1092E00071E795F885330D2B06D0D5F88C3343F410 -:1092F0000053C5F88C3366E72846FFF739FF95F829 -:109300007733052B01D0002BC4D1FF2385F885339B -:109310000023284685F87633E6F7CAFB53E700BFFB -:10932000283A00212050002190F87703C31E5842AC -:109330005841704738B590F877330A4AC3EBC303F6 -:109340000B4452F8233004460D4603B1984794F875 -:109350007733054AC3EBC30313445B5D84F877336B -:1093600038BD00BF04B90301C8B9030110B50446F4 -:10937000E7F71CFA2046BDE81040E6F77FBB10B5C2 -:109380000446E7F74FF92046E6F795FB2046E6F757 -:10939000D1FB2046E6F7C0FB012384F80B3310BD58 -:1093A00010B50446E6F787FB2046E6F7C3FB2046E8 -:1093B000BDE81040E6F7B0BB10B50446E6F770FB19 -:1093C0002046E7F7FDF82046E7F7D2F92046E6F712 -:1093D00077FB2046E6F7B2FB94F80B13204629B141 -:1093E000E7F75EFA002384F80B3310BDE7F732FA93 -:1093F000F8E710B50446437C23F002034374E6F714 -:109400004FFB94F80B236AB906212046E6F796FA3B -:109410002046E6F755FB2046E6F790FB002384F84C -:109420000B3310BD2046E7F739F96A212046FEF7D5 -:109430006BFEEDE710B50446437C23F00203437452 -:10944000E7F71CF92046E7F72DF92046E7F7D3F8B0 -:109450002046E7F77EF92046BDE81040E6F70EBB50 -:1094600010B50446E7F7C3F82046E7F7DBF82046D7 -:10947000E7F7DCF82046E7F750F92046E6F7FEFA72 -:10948000637C204643F002036374BDE81040E7F7B5 -:10949000BBB9000010B590F87833044613B1012B26 -:1094A00020D010BD0429FCD801A353F821F000BF3F -:1094B000C5940201F1940201A3940201C594020132 -:1094C000D7940201E7F781F92046E6F7D7FA01239E -:1094D00084F87833E5E7E7F7FFF92046BDE8104068 -:1094E000E7F714BA022908D004290AD00129D8D1F3 -:1094F0002046BDE81040E7F777B9E6F7D1FA002338 -:10950000E6E7BDE81040E7F7E7B900BF70B590F8AF -:1095100097520446012D1CD10C2907D0A1F10D034F -:10952000012B16D8E7F7F6F8284670BD574B1B7A83 -:10953000023B0F2B09D8DFE803F00C0C08080C08DD -:1095400008080C0C080C0808080CE7F7E3F80025DD -:10955000EAE74F4B9D6A15F00105E5D01A2935D091 -:1095600005D80C290BD01929F1D1042623E03E2976 -:10957000EDD194F885330D2BE9D106261BE0434B42 -:109580001B7A033B082BE2D801A252F823F000BF5C -:10959000C99502014F9502014F950201C59502013F -:1095A0004F9502014F9502014F950201B5950201B9 -:1095B000D1950201022694F876535DB1012D19D0A0 -:1095C0000125B1E70126F6E70026F4E70526F2E7D4 -:1095D0000326F0E731462046FFF7ACFE94F87733D8 -:1095E00013F0FB0FECD00D23012584F8853384F8AC -:1095F000765399E716F0050F10D12046FFF708FDC6 -:10960000B8B1012394F8852303FA02F2D4F88C331D -:109610001343C4F88C330D2384F8853394F88533D1 -:109620000D2B19D0D4F88C3343F40053C4F88C3389 -:109630007AE72046FFF7A0F80028E2D1154B1B6817 -:10964000002BDED0204698470028DAD12046FFF7CD -:10965000EBFC0028D5D1E1E731462046FFF76AFE52 -:1096600094F8773313F0FB03AAD1627C84F8763345 -:1096700022F002026274FF2294F8973284F8852364 -:10968000002B9DD12046E6F713FA4DE7283A00213A -:1096900020500021A83A002138B5304B05469B6A7E -:1096A00003F01004DB061AD5542927D005D80C295D -:1096B00017D0532924D0002411E07029FBD1D0F811 -:1096C0008C3313F480440AD0002123F48043C0F883 -:1096D0008C3395F87643BCB1012C23D0012420466D -:1096E00038BD1F4A137A122B0CD0132B04D0072B32 -:1096F000E1D1137C122BDED10221EAE70421E8E755 -:109700000321E6E70121E4E72846FFF7C3FE95F8C9 -:109710007833002BE2D00E23012485F8853385F8B9 -:109720007643DCE795F885330E2B06D0D5F88C33DD -:1097300043F48043C5F88C33D1E72846FFF7AAFEEF -:1097400095F87833002BC9D1FF22284685F8852368 -:1097500085F87633E6F7ACF9C1E700BF2050002169 -:10976000283A002190F87703C31E584258417047A9 -:1097700038B590F87B33094A01EBC30352F8233024 -:1097800004460D4603B1984794F87B23044B03EB42 -:10979000C2035B5D84F87B3338BD00BFFCB90301B5 -:1097A0009CBA030101222321E6F7C8B80C21E7F790 -:1097B000FFBB10B50446E7F727FB2046BDE8104085 -:1097C00000F020BA10B50446D0F8883343F40043C3 -:1097D000C0F88833E7F706FB2046BDE8104000F0EC -:1097E00011BA2DE9F0419DF81880044648EA0300BB -:1097F0001E4601EA080502EA030700F074FA8642F1 -:1098000004D1B04502D1B8F1000F02D1A3681B0604 -:1098100001D53D402F46284600F065FA05463846FA -:1098200000F061FA94F854300646022B03D0032B63 -:1098300014BF012304239D4208BF002594F855302E -:10984000022B03D0032B14BF012304239E4208BF25 -:109850000026294632462046E7F746FB65B91EB981 -:109860006E212046F7F7FCFD2046F8F756FA204611 -:10987000BDE8F041E6F724B929462046F8F74AFA50 -:10988000F5E773B590F862330446DA0790F864633D -:1098900018D490F8635394F862339B0702D5EFF71E -:1098A000E3FB064694F8D933204600933246294616 -:1098B00094F8D833FFF795FF204602B0BDE870401A -:1098C000E6F7EEB8EFF7D0FB0546E4E713B504463C -:1098D000074B5A7C009290F8D92390F8D8131B7C40 -:1098E000FFF77FFF204602B0BDE81040E6F7D8B88A -:1098F000283A00213E2970B5044649D005D80C29E4 -:1099000011D0202959D0002537E06E2946D0702982 -:10991000F9D1D0F88C331A0446D523F4004305213D -:10992000C0F88C3323E0594A137A072B2DD00D3B16 -:10993000D9B20A29E7D80A2BE5D801A151F823F0BA -:109940007F99020107990201079902010799020113 -:109950008B990201079902010799020107990201F7 -:10996000079902016D990201BF990201022194F841 -:10997000765335B3012D34D00125284670BD90F8BB -:1099800085330F2BBFD10321F1E7137C162BF9E7A9 -:1099900090F885330F2BB6D10721E8E790F885338F -:1099A0000F2BB0D10421E2E713F48035E5D023F486 -:1099B00080330621C0F88C33D9E70021D7E7012195 -:1099C000D5E72046FFF7D4FE94F87B33002BD3D0A5 -:1099D00001230F2284F8763384F8852384F87E539C -:1099E000CAE7022915D194F88533042B0FD8012B2F -:1099F0000FD90120D4F88C2300FA03F31343C4F8E1 -:109A00008C330F2384F8810384F8853301E0072B1E -:109A1000EFD094F885330F2B12D12046FFF7A8FE24 -:109A200094F87B63002EA7D12046E6F739F8FF2390 -:109A3000204684F8766384F88533E6F739F89CE7A6 -:109A4000B1B1022998D1012B02D00B3B012B05D8D3 -:109A500001222A212046E5F771FF8EE72046E7F72D -:109A6000D3F9D4F88C3343F48033C4F88C3384E7CF -:109A70002046E7F7B7F9D4F8883343F40043C4F835 -:109A80008833D4F88C3343F40043EEE7283A0021BE -:109A9000022803D0032814BF0120042070470000CF -:109AA00038B590F87B330C4AC3EBC3030B4452F830 -:109AB000233004460D4603B1984794F87B33074A98 -:109AC000C3EBC30313445B5D5A1F84F87B335342DB -:109AD000534184F8843338BDC4BA03016CBB03011D -:109AE0000C21E7F765BA0000F8B50446F8F715F958 -:109AF000D4F888331A0440F1818023F40043002114 -:109B00002046C4F88833E7F753FA94F85410B4F8B1 -:109B10004E730229B4F85003B4F85223B4F85453E6 -:109B200033D8C1BB002694F85520022A41D8002A18 -:109B300045D10023032AA4F854634FD1B3F5296F0C -:109B400038BF4FF42963A4F85803A4F8503303290D -:109B500032464BD1B6F5296F38BF4FF42962A4F8CD -:109B60005C53A4F85423264B9B6A9B0646D5B4F855 -:109B70005433AB4203D1B4F8503383423ED0204635 -:109B8000BDE8F8400021E5F7DDBC0329CAD1920108 -:109B900002F5747204E0B4F85C6336B90E32D20098 -:109BA000AA42A8BF2A4696B2BDE70023A4F85C33B8 -:109BB000B9E7032ABDD1BB0103F5747305E0B4F81E -:109BC00058333BB907F10E03DB008342A8BF0346BD -:109BD0009BB2AFE70027A4F85873ABE7B3F5A47FB7 -:109BE00038BF4FF4A473A4F85033B0E7B6F5A47FA0 -:109BF00038BF4FF4A472A4F85423B4E7F8BD00BFF3 -:109C00002050002110B50446E5F755FF2046BDE879 -:109C10001040E5F781BF000010B50446E5F740FFAE -:109C2000064B1B8A2BB92046BDE810406E21F7F782 -:109C300017BC2046BDE81040E7F7EEB8283A0021EF -:109C400010B50446E7F7E0F82046BDE81040FFF7FE -:109C5000D9BFFFF7F5BF10B50446D0F8883343F4F9 -:109C60000043C0F88833E7F7BDF82046BDE8104050 -:109C7000FFF7C8BF10B50446E5F712FFD4F88833E4 -:109C80001A0413D50A4A23F40043C4F88833137A1C -:109C90000D2B05D0112B03D0072B07D11A2100E083 -:109CA000517C2046BDE81040E7F782B910BD00BFE7 -:109CB000283A002110B50446F8F72FF8D4F8883375 -:109CC0001A040FD523F40043C4F8883394F894326F -:109CD00043B16378032B05D02046BDE81040002136 -:109CE000E7F766B910BD8207034605D410F00100FE -:109CF00003D103F004007047022070472DE9F047BC -:109D000011F0010F07468A4616461D469DF8208031 -:109D100093F800901DD114781AF0020F02D0EFF7DB -:109D2000A3F98146BB681B060ED504EA090414F0AA -:109D3000FF0412D197F85400FFF7AAFE044697F8E3 -:109D40005500FFF7A5FE8146347085F80090BDE808 -:109D5000F087EFF789F90446DEE714EA080008BF48 -:109D60002046FFF7C0FF04468146EDE71FB590F897 -:109D70006213044601F00303032B08D1E5F7A0FEAC -:109D80006E21204604B0BDE81040F7F769BB90F89B -:109D900063330DF10E028DF80E3090F864338DF8B8 -:109DA0000F30002300930DF10F03FFF7A7FF94F886 -:109DB0005400FFF76DFE9DF80E10884210D194F804 -:109DC0005500FFF765FE9DF80F30834208D120460D -:109DD000E5F776FE6E212046F7F742FB04B010BD92 -:109DE0002046F7F797FF2046E5F76AFE20469DF8E4 -:109DF0000F209DF80E10E7F74DF82046E5F73EFEE0 -:109E0000ECE71FB5044690F8633390F8D9238DF83A -:109E10000E3090F864338DF80F3090F8D83313403B -:109E200000930DF10E020DF10F0390F86213FFF78E -:109E300065FF9DF80E102046F7F76CFF2046E5F70A -:109E40003FFE20469DF80F209DF80E10E7F739F8E9 -:109E50002046E5F713FE04B010BD00003E2970B5A2 -:109E6000044644D005D80C290BD0202954D0002515 -:109E700005E06E2941D070294FF0000543D02846F7 -:109E800070BD644A137A072B2ED00D3BD9B20B2933 -:109E9000EDD80B2BEBD801A151F823F0DD9E020188 -:109EA0006F9E02016F9E02016F9E0201E99E0201F8 -:109EB0006F9E02016F9E02016F9E02016F9E020162 -:109EC000CD9E02016F9E02011D9F0201022194F8A6 -:109ED00076532DB3012D33D00125D0E790F885338B -:109EE0000F2BC4D10321F2E7137C162BF9E790F86E -:109EF00085330F2BBBD10621E9E790F885330F2B73 -:109F0000B5D10421E3E7D0F88C33B3F5004FB6D1D7 -:109F10000521C0F88C53DAE70021D8E70121D6E704 -:109F20002046FFF7BDFD94F87B33002BD4D00123EE -:109F30000F2284F8763384F8852384F87E53CBE7A8 -:109F4000022917D194F88533072B03D010D89A1E15 -:109F5000022A0FD80120D4F88C2300FA03F313430C -:109F6000C4F88C330F2384F8810384F8853301E02F -:109F70000B2B16D094F885330F2B1CD12046FFF7FE -:109F80008FFD94F87B63002EA6D12046E5F788FD6F -:109F9000FF23204684F8766384F88533E5F788FD4F -:109FA0006DE7D4F88C3343F40063C4F88C330F238B -:109FB00084F88533DEE7022913D0032917D000295E -:109FC0008AD12046E6F70EFFD4F8883343F40043E5 -:109FD000C4F88833D4F88C3343F40043C4F88C338A -:109FE0004DE701222A212046E5F7A8FC47E7D4F8EF -:109FF0008C3323F40043C4F88C3394F87B3313B1CF -:10A00000002384F87B33034B2046597CE6F7D0FFCE -:10A0100035E700BF283A002190F885330F2B07D190 -:10A0200090F87B03013801288CBF00200120704785 -:10A030000020704738B505460C460F20042102F079 -:10A0400099FD58B101222B88047083701B0A42705D -:10A05000C370BDE83840023802F078BD38BD00005A -:10A0600070B586B006460D4602F00CF8044608B1FD -:10A0700001241EE042F21F023388934200F2C8809E -:10A08000B3F5005F41D840F64942934200F03F816A -:10A0900000F2A58040F60342934200F0298100F2CD -:10A0A0009780002B00F0EA8040F60142934200F0D6 -:10A0B000F680204606B070BD0520318802F09AFD7A -:10A0C00005460028D4D042F21F023388934200F2A2 -:10A0D000EE81B3F5005F00F2878141F209029342FD -:10A0E00000F2EE81B3F5805F00F2C48140F6484291 -:10A0F000934200F06D8200F2C98123B140F6014223 -:10A10000934240F0DD812C70DAE1A3F50053013B6E -:10A110001E2BCED801A252F823F000BFBBA2020131 -:10A12000B7A3020171A20201B3A0020175A202014C -:10A13000B3A00201B3A00201B3A00201B3A00201C7 -:10A14000B3A00201B3A00201B3A00201B3A00201B7 -:10A15000B3A00201DBA1020181A2020187A20201D8 -:10A1600093A20201B3A00201B3A00201B3A00201B5 -:10A17000B3A00201B3A0020171A20201B3A00201C7 -:10A18000B3A00201B3A0020171A2020119A302014E -:10A1900041A30201C9A20201A3F58053013B082B90 -:10A1A00087D801A252F823F071A20201CDA10201C9 -:10A1B00071A20201B3A00201B3A00201B3A0020187 -:10A1C000B3A00201B3A00201BBA30201412074E7C6 -:10A1D00040F6484293427FF46CAF02206DE741F2B3 -:10A1E000090293423FF665AFB3F5805FD4D840F6DD -:10A1F000634293425AD040F6824293427FF459AF71 -:10A200006B78287800EB032080B204F01DFD34E069 -:10A2100042F25002934219D842F24A0293427FF628 -:10A2200048AFA3F501530B3B052B3FF642AF01A20C -:10A2300052F823F0C9A20201B9A00201D7A202017B -:10A24000B3A00201B1A30201B1A3020142F2740260 -:10A2500093423BD042F27B02934200F08D8042F267 -:10A260005F0293427FF425AF287806F01BFA04E0E2 -:10A27000092022E7284604F095FC044601201CE74B -:10A2800004F050FDF9E7294611F8010B04F056FDE2 -:10A29000F3E7294611F8010B04F07AFDEDE72846B3 -:10A2A00009F0E3F9BF4BC3E90001E7E7284609F0ED -:10A2B000DCF9BC4BC3E90201E0E7284609F0D5F917 -:10A2C000B84BC3E90401D9E70320F6E6697828789A -:10A2D00004F088FDD1E7EB78A978287801EB032119 -:10A2E0006B7809B200EB032000B204F0BDFDC4E7B7 -:10A2F00002200CF0D2FC04F03BFB00200021A94B13 -:10A30000C3E90001C3E90201C3E90401B0E62A7808 -:10A31000A44B83F83220B1E72A7800238DF8062079 -:10A320004FF0807201250292022201A8ADF804309C -:10A330008DF807508DF80C20049306F0CBFD9CE7B8 -:10A3400000232A78ADF804308DF806206A78ADF83D -:10A350000A308DF80720AA7801258DF808200222FE -:10A3600004937F238DF809508DF80C2001A88DF8F7 -:10A37000143006F09FFC80E72B78A9798DF8063021 -:10A380006B788DF80C108DF80730AB7829448DF878 -:10A390000830EB78ADF804008DF809302B798DF892 -:10A3A0000A306B798DF80B30EB1D0493CB79DDE728 -:10A3B0000120044681E604207FE607207DE6A3F520 -:10A3C00001530B3B052B7BD801A252F823F000BFB1 -:10A3D00095A50201ADA5020107A10201C1A40201D8 -:10A3E00007A1020107A10201A3F50053013B1E2BA7 -:10A3F00066D801A252F823F007A102016BA5020161 -:10A4000081A50201C1A4020107A10201C1A40201A8 -:10A41000C1A40201C1A40201C1A40201C1A402019C -:10A42000C1A40201C1A40201C1A40201C1A402018C -:10A43000F1A4020107A1020107A1020107A1020183 -:10A44000C1A40201C1A40201C1A40201C1A402016C -:10A45000C1A40201E5A40201C1A40201C1A4020138 -:10A46000C1A402018BA5020107A1020107A10201FB -:10A47000DDA50201A3F58053013B082B20D8DFE8BE -:10A4800003F03C57681F1F1F1F1F6F0040F68242DA -:10A4900093423FF438AE07D840F6494293423FF426 -:10A4A00032AE40F663422BE640F6844228E642F2A2 -:10A4B0005002934208D842F24A0293423FF67FAFDD -:10A4C000681F02F043FBD3E542F27B0293423FF464 -:10A4D0001AAEF5D842F25F0293423FF414AE42F254 -:10A4E00074020DE6082100F8014B0BF0A5F9E7E72F -:10A4F000047004F015FC6870E2E701AA0DF1010197 -:10A500000DF1020004F0BCFB2C709DF801206A7074 -:10A51000BDF804309DF804101B0AA970EB702A7175 -:10A52000BDF80220E9716A71120AAA712B72C7E79D -:10A53000412200210FF0F1FB2A461B4B02F8014B90 -:10A5400003F1400153F8040B8B4242F8040BF9D19C -:10A55000B6E70022602300F8014B09F08AF8AFE764 -:10A5600000F8014B04F016FBAAE706F053F8064684 -:10A5700006F056F86E70360A2C70AE70E8709FE7E1 -:10A5800000F8014B04F092FB9AE700F8014B04F04D -:10A5900085FB95E72946681C01F8024B04F060FC36 -:10A5A0008EE700BF404C00218D4D002101A90DF127 -:10A5B000020004F057FC2C70BDF802306B709DF95E -:10A5C0000330AB70BDF90430EB701B122B7177E7D1 -:10A5D0000A4B047093F83230437071E7002301A8EE -:10A5E000CDE9013306F00EFD2870BDF806306B7022 -:10A5F000BDF806301B0AAB7062E700BF404C00217B -:10A6000073B505460C4601F037FF08B1012008E09C -:10A6100042F20B032E889E4205D042F20C039E426A -:10A6200028D002B070BD2378A2788DF8043063780A -:10A63000684603EB0223ADF800302279E37803EBA0 -:10A640000223ADF8023063798DF80530A3798DF8D7 -:10A65000063004F04DFC29880446012002F0CAFAB5 -:10A660000028D3D02B880538B34208BF447102F0CC -:10A670006DFACBE76178207804F08CFCC6E7000027 -:10A680002DE9F04186B006460D4601F030FF044644 -:10A6900020B10124204606B0BDE8F0813388A3F53F -:10A6A0000153013B092BF5D801A252F823F000BF5A -:10A6B000D9A6020171A7020195A602018FA7020186 -:10A6C000F5A70201FBA702010BA8020125A80201C0 -:10A6D0003FA8020145A80201002428786978AA78D9 -:10A6E000EB1C4FF0060E25468DF800008DF801108A -:10A6F0008DF8022042FA05F7FF0718D506AF0EFBCA -:10A70000047793F800C093F8028007F810CC93F810 -:10A7100001C001340CEB082C27F814CC93F804800A -:10A7200093F803C005330CEB082C27F812CC013545 -:10A73000082D01D0032CDDD101AB04F057FC0446F9 -:10A740000120318802F056FA05460028A1D042F2D5 -:10A7500049023388934277D842F24402934205D8A3 -:10A7600003F55F43BF339BB2012B71D82C706FE0B0 -:10A770006A792B79E97803EB0223AA78287802EB2F -:10A7800001229BB2697892B204F0AAFC81E76A7850 -:10A79000A97A8DF80120AA782B788DF80220EA1C7E -:10A7A00001926A7A980702EB0122ADF80820297B12 -:10A7B000EA7A8DF8003002EB0122ADF80A206A7BBC -:10A7C0008DF80C2004D52A4A92F8512091060DD517 -:10A7D0005A0703D5274B5B6ADB0609D5684604F0A8 -:10A7E000CBFC01463046FFF725FC52E73E21F9E756 -:10A7F0001121F7E704F02AFDA1E76B78287800EB38 -:10A80000032080B204F03EFD99E72B4613F8012B9C -:10A8100068460193EB798DF800208DF8083004F03C -:10A820007BFD8CE72B4613F8012B68460193EB79EF -:10A830008DF800208DF8083004F0A4FD7FE704F0C7 -:10A84000CBFD7CE702207CE742F24A02934203D030 -:10A85000681F02F07BF91CE7002368468DF8003082 -:10A8600004F0D0FD28709DF800306B70F0E700BF59 -:10A87000644D00216850002173B50A4642F22E0152 -:10A88000038806468B420ED842F226018B420ED92F -:10A89000A3F50053273B072B09D8DFE803F00B286B -:10A8A0002E440808313542F24E018B4234D000204C -:10A8B00002B070BD114602F1170311F8010B073207 -:10A8C00006F096FF04460120318802F093F9054610 -:10A8D00000283CD042F22A023388934239D025D84E -:10A8E000A3F50053273B022B2ED82C702CE01146E9 -:10A8F00011F8010B06F0B2FFE4E706F0D9FFE1E73B -:10A90000107807F03DF8DDE75378107800EB03206E -:10A9100080B207F055F8D5E71146D27911F8010B4E -:10A9200007F05CF8CEE702200024CDE742F24E02A9 -:10A930009342DAD004D8A3F500532D3B012BD3E783 -:10A9400042F27C029342D0D0681F02F0FFF801204F -:10A95000AEE700240DF107008DF8074006F0C6FFB2 -:10A960009DF80730AC7028706B70EDE7F0B589B0DA -:10A9700006460C4601F013FE054618B1012528468F -:10A9800009B0F0BD3388A3F50053063B042BF6D87D -:10A99000DFE803F02456031E5200214611F8010B94 -:10A9A00004F0B6FD05460120318802F023F9044683 -:10A9B0000028E3D042F207023388934249D041D8BD -:10A9C00042F20602934242D0601F02F0BFF8D5E780 -:10A9D000214611F8010B04F0BFFDE3E76378D4F8DA -:10A9E00007702078A17800EB0320CDF81770E3788A -:10A9F000B4F80B702279A57901EB0321ADF81B7037 -:10AA00006379677BA47B89B2CDE902748DF81E401F -:10AA10000DF11704CDE9005480B2ADF81000ADF887 -:10AA200012108DF814208DF815308DF816508DF811 -:10AA30001D7004F00BFDB5E7207804F0B1FD9DE733 -:10AA40000220B1E7A3F50053083B012BBCD82570C9 -:10AA5000BAE7002304A88DF8103004F0E5FC20705C -:10AA60009DF810306370AFE7F0B58DB007460C4627 -:10AA700001F0CBFD054608B101253DE03B88B3F56B -:10AA8000015F35D842F23402934235D9A3F5005321 -:10AA9000363B0A2B33D8DFE813F03B00BF00CB0076 -:10AAA000D50026010B00FB00FF0002011A01210165 -:10AAB000FF260220398802F09DF804460028DBD0EA -:10AAC0003B88B3F5015F00F2118142F234029342F8 -:10AAD00040F21081A3F50053363B052B00F22E8186 -:10AAE000DFE813F00C012C012C012C0115012401CD -:10AAF00042F27F0293424AD028460DB0F0BD214673 -:10AB000011F8016B304604F09FFD05460120D1E7A6 -:10AB1000A2786378267803EB0223ADF80C30227913 -:10AB2000E378304603EB0223627903A903EB024387 -:10AB30000493E279A37903EB0223227A03EB024325 -:10AB40000593637A8DF81830A37A8DF81930E37A7B -:10AB50008DF81A3004F10C030793A37C8DF8203094 -:10AB6000E37C8DF82130237D8DF82230637D8DF8D4 -:10AB70002330A37D8DF82430E37D8DF82530237EAE -:10AB80008DF8263004F068FD0546607691E7A278DE -:10AB90006378267803EB0223ADF80C302279E37852 -:10ABA000304603EB0223627903A903EB02430493CB -:10ABB000E279A37903EB0223227A03EB02430593A4 -:10ABC000637A8DF81830A37A8DF81930E37A8DF80E -:10ABD0001A3004F10C030793A37C8DF82030E37C3A -:10ABE0008DF82130237D8DF82230637D8DF8233060 -:10ABF000A37D8DF82430E37D8DF82530237E8DF8FC -:10AC00002630637E8DF82730A37E8DF8283004F03F -:10AC10007DFD0546E0764CE7234613F8040B0093D0 -:10AC2000E378A278617804F0D5FD0546FF266DE74C -:10AC3000234613F8040B0093E378A278617804F0BC -:10AC4000E1FDF2E7617803AB06290F464FF00005FE -:10AC50001A4628BF062720780234AF4204F10404C4 -:10AC600003F1060302D804F0E5FD05E714F8046CCF -:10AC700014F802CC03F8066C14F8036C013506EBEB -:10AC80000C2623F8046C14F8016C03F8026CE4E75A -:10AC9000207804F085FEC8E704F08EFEC5E7A278B0 -:10ACA0006378267803EB0223ADF80C302279E37841 -:10ACB000304603EB0223ADF80E30A279637903A985 -:10ACC00003EB0223ADF8103004F080FE1DE7A278FC -:10ACD00061782078E31C04F093FEA6E76178207881 -:10ACE00004F0AAFEC8E6FF260320E3E642F27F0254 -:10ACF000934203D0601F01F029FFBDE6304603A94F -:10AD000004F064FD25709DF80C306370F2E71F239A -:10AD100003A8ADF80C3004F01FFE2070BDF80C3015 -:10AD20006370BDF80C301B0AA370E3E7012303A88E -:10AD30008DF80C3004F024FE2070E4E70570D9E7AC -:10AD400042F26B0230B503880446934289B006D0C4 -:10AD500042F26C02934236D0002009B030BD0B782D -:10AD60008A788DF800304B7801F1140003EB022350 -:10AD7000ADF80230CB780DF105028DF804300B1DD3 -:10AD800053F8045B834242F8045BF9D10B7D8A7D62 -:10AD90008DF815304B7D0DF1190003EB0223CA7DB0 -:10ADA0001831062A8DF8182028BF0622ADF8163073 -:10ADB0000EF08CFF684604F066FE01462046FFF761 -:10ADC00039F90120C9E7087804F079FEF9E70B4664 -:10ADD00042F2690170B5028804468A428AB04AD0BC -:10ADE00042F26A018A4200F0918042F268018A428E -:10ADF00040F091801A7819798DF800205A780DF179 -:10AE000011008DF801209A788DF80220DA7802EB93 -:10AE10000122597902EB01420192D9799A7902EB28 -:10AE20000122ADF80820597A1A7A02EB0122ADF816 -:10AE30000A209A7A8DF80C20DA7A8DF80D201A7B88 -:10AE40008DF80E205A7B8DF80F209A7B8DF81020FC -:10AE500003F10F021F3352F8041B9A4240F8041BFF -:10AE6000F9D1684604F02EFE01462046FFF7E2F8CD -:10AE700001200AB070BD1A7819798DF800205A782F -:10AE800002AE8DF801209A788DF80220DA7802EB74 -:10AE90000122597902EB01420192D9799A7902EBA8 -:10AEA0000122ADF818201A7A997A8DF81A205A7A68 -:10AEB00002EB0122ADF81C20197BDA7A02EB0122A9 -:10AEC000ADF81E205A7B8DF820209A7B8DF821202A -:10AED000DA7B8DF822201A7C8DF823205A7C8DF89D -:10AEE00024209A7C8DF82520DA7C8DF8262003F129 -:10AEF00014022433354610685168083203C59A425B -:10AF00002E46F7D1684604F02DFEADE75978187843 -:10AF100004F0BCFEA8E70020ABE700002DE9F04FED -:10AF200003888046A3F50153223BA3B0032B00F214 -:10AF30007D81DFE813F00400860012013E0191F8E4 -:10AF400000C0BC4B4C7883F800C08B78087904EBC8 -:10AF50000324CB788A7A04EB03444B794D7B00EBD6 -:10AF600003208B79002600EB03400B7A91F80790C1 -:10AF70000193CB7A91F809E002EB03220B7B92B2AA -:10AF800003EB05238D7B9BB2062DAA4628BF4FF00D -:10AF9000060A0293A84B0F311D700DABB24501F1AB -:10AFA000090103F10A0326D8019BCDE907408DF87A -:10AFB0002530029BA149ADF82A3006A80DAB8DF8CB -:10AFC00018C08DF824908DF826E0ADF828208DF873 -:10AFD0002C500C9304F05CFE974B04461B785B00EE -:10AFE0000333D8B2FF2840F0EB8021464046FFF7FC -:10AFF00021F801201BE111F8097C11F807BC03F8C6 -:10B000000A7C11F8087C013607EB0B2723F8087C33 -:10B0100011F805BC11F8067C07EB0B2723F8067C1A -:10B0200011F8047C03F8047C11F8037C03F8037C1A -:10B0300011F8027C03F8027C11F8017C03F8017C12 -:10B04000ACE78D7B0026062DA94628BF4FF00609E8 -:10B0500091F800C0774B4C7883F800C08B78087962 -:10B0600004EB0324CB784A7A04EB03444B7991F840 -:10B0700008E000EB03208B7991F80BB000EB034064 -:10B08000CB790F31019311F8053C02EB032211F843 -:10B09000033C92B2029311F8023C0393664B1D707D -:10B0A0000DABB14501F10E0103F10E031BD8019B5D -:10B0B000CDE907408DF82430029B60498DF8293096 -:10B0C000039B06A88DF82A300DAB8DF818C08DF8BB -:10B0D00025E0ADF826208DF828B08DF82B500B9385 -:10B0E00004F0AEFE78E711F80E7C11F80BAC03F813 -:10B0F0000E7C11F80D7C013603F80D7C11F80C7CE8 -:10B1000007EB0A2723F80C7C11F809AC11F80A7C2C -:10B1100007EB0A2723F80A7C11F807AC11F8087C22 -:10B1200007EB0A2723F8087C11F805AC11F8067C18 -:10B1300007EB0A2723F8067C11F8047C03F8047C4B -:10B1400011F8037C03F8037C11F8027C03F8027CFD -:10B1500011F8017C03F8017CA3E711F8010B364BD1 -:10B160000DAA06AC06288446187017464FF0000357 -:10B17000264628BF4FF0060C9C4501F1040106D875 -:10B1800004A9CDE9047604F0FBFE04462DE711F88E -:10B1900003EC11F8045C013305EB0E2522F8025B89 -:10B1A00011F801EC11F8025C05EB0E2524F8025BA6 -:10B1B000E2E708781F4B187004F020FF04460220D5 -:10B1C000B8F8001001F016FD00283FF412AF42F26B -:10B1D0006302B8F8003093421BD842F261029342F6 -:10B1E0001BD9154B134A1B7804701278002C18BF1A -:10B1F0000023427002461149837000EB43039342DF -:10B200000BD00C880232547031F8024B240A94702F -:10B21000F5E742F26502934203D0053801F096FC4F -:10B22000E7E6044B04701B784370F6E7002023B078 -:10B23000BDE8F08F104C00211E4C0021124C002163 -:10B24000F8B542F26603078805469F4205D042F2F0 -:10B2500067039F420ED00020F8BD4B78087800EBC2 -:10B26000032080B204F0CCFE01462846FEF7E2FE41 -:10B270000120F1E74B780C78897804EB0324A4B221 -:10B28000204604F0BFFE29880646032001F0B2FCE8 -:10B290000028EDD02B880538BB4201BF0023467142 -:10B2A0008471C37101F052FCE2E74A780B7803EB3A -:10B2B00002230380CA788B7803EB022343804A7908 -:10B2C0000B7903EB02238380CA798B7903EB02238A -:10B2D000C3804A7A0B7A03EB02230381CA7A8B7A02 -:10B2E00003EB022343810C2070472DE9F34107460D -:10B2F0000E46018810469846BDF8205001F07AFCB1 -:10B300000446002800F08C8042F222033A889A42D8 -:10B3100015D842F21F039A422CD841F205439A42B3 -:10B3200072D042F215039A4274D040F62D439A42ED -:10B3300058D0601F02B0BDE8F04101F007BC42F2F6 -:10B340002F039A422ED007D842F223039A4216D0F6 -:10B3500042F224039A4207E042F25C039A4206D882 -:10B3600042F259039A4205D8E3D12670E1E742F24E -:10B370005D03EFE7267065702D0AA570D9E70DF122 -:10B38000060101A805F082F82670BDF8043063704C -:10B39000BDF804301B0AA370BDF80630E3701B0A29 -:10B3A0002371C6E70DF10603684601AA0DF10201FB -:10B3B00005F09AF82670BDF800306370BDF80030D3 -:10B3C0001B0AA370BDF80230E3701B0A2371BDF89D -:10B3D000043063711B0AA371BDF80630E3711B0AC8 -:10B3E0002372A6E70023284698F800100DF1060204 -:10B3F0008DF8063004F028FE9DF9063065702D0AA0 -:10B400002070A570E37094E728460DF1060104F062 -:10B41000FBFDF1E7C11C284604F082FE2070AAE77C -:10B4200002B0BDE8F081000070B586B006460C465B -:10B4300001F064F9002840F0948042F2240233883D -:10B4400093424CD842F21202934210D840F62D4259 -:10B45000934200F0A58037D840F2064293424FD085 -:10B4600040F21D42934200F0C48006B070BDA3F5C7 -:10B470000053133B112BF8D801A252F823F000BF60 -:10B480001BB502016BB40201E3B50201D3B50201A1 -:10B490006BB402016BB402016BB402016BB4020124 -:10B4A0006BB402016BB402016BB402016BB4020114 -:10B4B0006BB4020139B5020167B502017BB5020127 -:10B4C00003B60201B3B5020141F205429342CCD169 -:10B4D0006378257805EB0325ADB2034667E042F2B9 -:10B4E0002F02934200F0918042F26D029342BCD150 -:10B4F0006378207800EB032080B205F0A7F807E01E -:10B5000063782078A17800EB032080B204F054FE29 -:10B5100001463046FEF78EFD23E02146637811F8A0 -:10B52000025B03A805EB0325ADB2FFF7BEFE28467C -:10B5300003A904F09BFEEBE72146637811F8025B58 -:10B5400003A805EB0325ADB2FFF7AFFE284603A91C -:10B5500004F0CEFE00230322014600953046FFF79B -:10B56000C4FE012081E763782578A17805EB0325E7 -:10B57000ADB2284604F0F2FEECE763782578227934 -:10B5800005EB03256379A17802EB0322E378ADB2E2 -:10B5900001EB0321284692B289B204F035FFD9E7C6 -:10B5A0002346627813F8025B05EB0225ADB2042254 -:10B5B000D2E70025E378A178207801EB03216378B6 -:10B5C00089B200EB032080B204F068FF2B46012211 -:10B5D000C2E76378207800EB032080B205F05AFAC6 -:10B5E00096E763782578082205EB0325ADB20023A2 -:10B5F000B2E76378207800EB032080B204F0DAFE33 -:10B6000086E7002505222B46A6E7054603460922C4 -:10B61000A2E700BF2DE9F047174E804696F8243088 -:10B620000F46154693B90123C0F3032986F8243049 -:10B630004FEA112A3DB140F2031008F08BF9013DA9 -:10B640000446EDB220B9002386F82430BDE8F08727 -:10B6500080F8008080F80190877080F803A096F849 -:10B6600025103A464B1C043086F825300EF055FB69 -:10B67000204604F0DDFFDDE7404C002170B586B0C8 -:10B6800005460C4601F022F980BB42F20E032E88DB -:10B690009E422ED042F214039E422DD042F20D0360 -:10B6A0009E423BD16278237804F10D0103EB022323 -:10B6B000ADF80030E278A37803A803EB0223ADF8DD -:10B6C000023023798DF8043063798DF80630A31D9C -:10B6D0000293237B8DF80530FFF7E7FD03A9684649 -:10B6E00005F06AF801462846FEF7A4FC012006B0E2 -:10B6F00070BD05F0C9F8F9E7204603F0BDFB2988C5 -:10B700000446012001F076FA0028EFD02B88053896 -:10B71000B34208BF447101F019FAE7E72146284611 -:10B7200006B0BDE87040FFF77FBE2DE9F0438DB055 -:10B7300006460D4601F0CAF8044600284ED142F2F2 -:10B74000430332889A424DD11822FF2301460DEB64 -:10B7500002008DF815308DF816300EF0DEFA2B78D9 -:10B760006A7A8DF80C306B784FF00C088DF80D303C -:10B77000AB788DF814208DF80E30EB1C049305F196 -:10B780000A03254601AF9DF814202A41D20717D598 -:10B7900058781A7807EB840102EB002227F824205E -:10B7A000D8789A7803F1040902EB002206AB08FB73 -:10B7B00004304A804946FFF778FD013409EB000365 -:10B7C0000135082D01D0022CDDD101A906AA03A85C -:10B7D00005F09EF801463046FEF72CFC01200DB026 -:10B7E000BDE8F083294630460DB0BDE8F043FFF7D1 -:10B7F00045BF002273B542F22B040092ADF804203D -:10B8000002880546A24207D042F22C04A2421FD071 -:10B81000FFF732F802B070BD6A4611F8010B06F06E -:10B820006CF804462988072001F0E4F9064668B15F -:10B830002B88A3F500532B3B012B04D8694600F855 -:10B84000014B07F00DFF701F01F080F90120E1E7C7 -:10B850006A4611F8010B06F071F8E2E738B542F2DA -:10B860001903028805469A4203D0BDE8384000F02B -:10B8700015B8CB7A8A7A087802EB03224B7892B219 -:10B8800000EB032080B201F10C03023105F0E0FC73 -:10B8900001462846FEF7CEFB012038BD2DE9F341D5 -:10B8A00007460E4601F02FF8054608B101250DE0C8 -:10B8B00042F217023B8893421DD00BD840F67B42E0 -:10B8C000934247D040F67C4293424BD0284602B088 -:10B8D000BDE8F08142F21A0293422CD042F21B02E0 -:10B8E0009342F3D17378347804EB0324A4B2204656 -:10B8F00005F03AFD29E006F110084146304605F012 -:10B90000F3FC2C461120398801F074F90646002812 -:10B91000CCD042F217023B8893423BD030D840F65D -:10B920007B42934243D040F67C4293422DD0701F1D -:10B9300001F00CF9BAE73146737811F8024B04EBC9 -:10B940000324A4B2204605F0D5FC05464FF00008BC -:10B950000320D8E773783478804604EB032405206D -:10B96000A4B2D0E773783478B17804EB0324F37889 -:10B97000A4B201EB0321204689B205F045FDE4E7BE -:10B98000A3F500531A3B012BD1D87470240A3570EB -:10B99000B470CCE70346414603F8015B08F110029E -:10B9A00051F8040B914243F8040BF9D1BFE700238F -:10B9B00020460DF10601ADF8063005F005FDBDF895 -:10B9C00006307470F370240A1B0A3070B47033713F -:10B9D000ADE700002DE9F0418AB007460C4600F0C3 -:10B9E000EDFF064608B1012618E042F275023B88D9 -:10B9F000934213D842F25F02934213D840F6834237 -:10BA0000934200F0E68041D840F61542934200F0A0 -:10BA1000FA8040F61642934200F0ED8030460AB0BC -:10BA2000BDE8F081A3F50153203B152BF6D801A208 -:10BA300052F823F00BBC0201A3BA02011DBA0201A5 -:10BA40001DBA02011DBA02011DBA02011DBA02018E -:10BA50001DBA02011DBA02011DBA02011DBA02017E -:10BA60001DBA02011DBA02011DBA02014DBB02013D -:10BA7000BDBB0201F9BA020111BB020131BB0201D7 -:10BA800031BB02011DBA02013FBB020141F2054276 -:10BA90009342C3D163782578042005EB0325ADB22A -:10BAA00005E00C206378257805EB0325ADB23988D5 -:10BAB00001F0A0F80446002895D042F275023B88B8 -:10BAC000934215D842F25F02934200F2A18040F601 -:10BAD0008342934200F09B8100F2D08040F61542F1 -:10BAE000934200F08E8140F61642934200F08F811F -:10BAF000601F01F02BF876E763782578A17805EBD5 -:10BB00000325ADB2284605F0EBFC06460120CEE742 -:10BB100063782578A17805EB0325ADB2284605F0BA -:10BB2000E1FC06460120002EC1D1BB4B1876BEE7D2 -:10BB3000637825780F2005EB0325ADB2B7E763786E -:10BB400025781F2005EB0325ADB2B0E76278237896 -:10BB500003A803EB0223ADF80C30A378A2798DF88B -:10BB60000E30E3780D348DF80F3014F8093C8DF861 -:10BB7000103014F8083C03EB0223ADF8123014F82F -:10BB8000052C14F8063C03EB0223ADF8143014F82E -:10BB9000032C14F8043C03EB022314F8022C03EBEF -:10BBA0000243069314F8013C08948DF81C3005F00C -:10BBB00093FC0646BDF80C50032078E7637825789F -:10BBC000A17805EB0325ADB2284605F087FC0646B3 -:10BBD000F2E7237803A88DF80C30637803348DF8EE -:10BBE0000D3014F8013C04948DF80E3005F072FC11 -:10BBF000064600258AE76378207800EB032080B2B0 -:10BC000005F07BFCF4E70546D6E7002507204EE764 -:10BC1000A3F50153203B152B3FF66AAF01A252F862 -:10BC200023F000BF9FBC0201CBBC0201F1BA0201AC -:10BC3000F1BA0201F1BA0201F1BA0201F1BA02014C -:10BC4000F1BA0201F1BA0201F1BA0201F1BA02013C -:10BC5000F1BA0201F1BA0201F1BA020109BD020111 -:10BC600009BD02010FBE02010FBE020113BD020198 -:10BC70005BBD0201F1BA02016DBD020141F2054254 -:10BC800093427FF435AF284603A905F005FC9DF9E2 -:10BC90000C3065702D0A2070A570E37028E704F061 -:10BCA000B9FC074604F0BCFC804605F0E5FB054600 -:10BCB00005F0E8FB677025713F0A2D0A2670A77012 -:10BCC00084F803806571A07112E7284603AB02AACD -:10BCD0000DF1060105F0FCFBDDE90232BDF80610AE -:10BCE0006371E170090A2171190AA171190C1B0E07 -:10BCF000657023722D0A130A6272120C2070A570EF -:10BD0000E171A372E272F3E645702D0A0670857048 -:10BD1000EEE6284603A905F0E7FB65702D0A2070C2 -:10BD2000A570039BE370039B1A0A22711A0C1B0E69 -:10BD30006271A371049BE371049B1A0A22721A0CAC -:10BD40001B0E6272A372059BE372059B1A0A227393 -:10BD50001A0C1B0E6273A373CAE6284603A905F0EA -:10BD6000C8FB0028D9D12C4B1876D6E7284603A962 -:10BD700005F090FBDDE903ECDDE90576DDE907126E -:10BD8000099B20704FEA1E2020714FEA1E4060710F -:10BD90004FEA1C2020724FEA1C406072380A207360 -:10BDA000380C6073300A2074300C6074080AE17437 -:10BDB0002075080C090EA175110A657084F803E05E -:10BDC00084F807C0E772E673E27521762D0A110C3C -:10BDD0004FEA1E6E120E4FEA1C6C3F0E360EA57017 -:10BDE00084F806E084F80AC0A773A67460756176CB -:10BDF000A2761A0AE37622771A0C1B0E6277A377D3 -:10BE000076E6002300F8013B05F075FB70E631464D -:10BE1000204600F098FE6BE6244C0021038873B5A1 -:10BE2000A3F50153193B06460C46042B5FD8DFE807 -:10BE300003F0030E2A394F004B780878897800EB1D -:10BE4000032080B205F064FB0122002512E04B784C -:10BE50000D780A7905EB03254B79ADB202EB03228D -:10BE6000CB788978284601EB032192B289B205F09C -:10BE700075FB03220146002330460095FFF735FA93 -:10BE8000012002B070BD4B780D78227905EB0325B7 -:10BE9000CB788978ADB201EB0321284689B205F051 -:10BEA0006DFBE6E74B780D788A7905EB03254B7936 -:10BEB000097903EB0223E278ADB202EB0122E179CA -:10BEC000284600919BB2A17892B205F067FBD0E7BB -:10BED0000B79CA78207802EB03228B78497892B2EA -:10BEE00001EB032189B2637905F088FBACE7002000 -:10BEF000C7E7F0B503880746A3F50053303B0D466E -:10BF000089B0042B00F29280DFE803F0031D263C89 -:10BF10005700052000264B780C7804EB0324A4B2CC -:10BF2000398800F067FE054650B342F231023B8883 -:10BF3000934263D05DD842F23002934260D0681FD2 -:10BF400000F004FE1CE08A782878497805F0DEFBD2 -:10BF5000002406460120E3E74B7808788A7900EB55 -:10BF600003204B7980B203EB02239BB200930B7941 -:10BF7000CA78897805F0ECFB01463846FEF75AF896 -:10BF8000012054E00B7800248DF80E304B7803A884 -:10BF90008DF80F308B78ADF80C408DF810304FF4E1 -:10BFA0008073ADF8123002238DF811408DF81430F3 -:10BFB000069404F08FFF0646CCE70B7800248DF83A -:10BFC0000E304B7803A88DF80F308B78ADF80C400D -:10BFD0008DF81030CB78ADF812408DF81130022377 -:10BFE0008DF814307F2306948DF81C3004F062FE27 -:10BFF000E1E7A3F50053333B012BA0D82E709EE759 -:10C000000023204603AA0DF10B018DF80B308DF8AB -:10C010000C3005F045FB9DF80C309DF80B206C7042 -:10C02000240A2870AC70EA702B7188E7002009B0F0 -:10C03000F0BD38B505460C4600F05EFD90B942F201 -:10C0400026022B8893420FD042F25E02934211D017 -:10C0500042F22502934206D105F0F2FC0146284641 -:10C06000FDF7E8FF012038BD204604F1200105F06E -:10C07000E9FCF3E7204694F8402004F1200105F0A4 -:10C0800011FDEBE74FF6E072F0B5038806469342E8 -:10C090000C4693B00AD84FF6A372934277D84FF666 -:10C0A0009F72934269D8002013B0F0BDA3F57F437F -:10C0B000E13B1E2BF7D801A252F823F0D9C10201AF -:10C0C000A7C00201A7C00201A7C00201A7C00201C8 -:10C0D000FDC10201A7C00201A7C00201A7C0020161 -:10C0E000A7C00201A7C00201A7C00201A7C00201A8 -:10C0F000A7C00201A7C0020117C202011FC20201AC -:10C100002BC20201A5C1020141C20201A7C0020166 -:10C11000A7C00201A7C00201A7C0020133C20201E9 -:10C1200039C10201A7C00201A7C00201A7C00201D4 -:10C130007DC202013BC2020123200025318800F0AC -:10C1400059FD0446B8B107464FF6FA7207F8015B8D -:10C150003388934200F0AD8000F294804FF6C072B5 -:10C16000934200F0E9804FF6F472934200F06A8146 -:10C17000601F00F0EBFC012096E7A3F57F43A13B95 -:10C180000122022B75D8DFE803F0775D6B004FF6D4 -:10C19000C072934274D04FF6CD72934283D1012086 -:10C1A0000546CBE78378052B11D188784B780004BE -:10C1B00000EB03200B7804341844CB78002100EB0B -:10C1C0000360227802F08CFD05460120B6E70846A0 -:10C1D00007F04BFA0834F4E7084607F046FAC207BE -:10C1E0000546247A02D5204603F028FA6B0701D4CD -:10C1F0000120A2E72046F7F78BFEF9E78B78487815 -:10C200001B0403EB002308780344C87803EB0060A9 -:10C2100005F000F8D8E7084602F0B2FCE8E7084667 -:10C2200002F020FD0546072088E7084602F046FD9B -:10C23000CAE708780AF008FDDAE701200C257DE757 -:10C2400027207AE7E378A278617802EB032220784E -:10C2500092B209F06FFC0028CAD1012012256DE7C7 -:10C26000207809F051FD0028F7D0607809F068FDCA -:10C27000F1E77E4B1A70BBE77D4BFBE71D205CE7C7 -:10C2800039205AE74FF6FE7293427FF471AF08A847 -:10C29000E0F708FA3B4608AA0EAE154603CDB542B4 -:10C2A000186059602A4603F10803F6D1286818601F -:10C2B0005EE70AF0D5FC6070C0F30720A0700AF0BA -:10C2C000C9FCE0700AF0C6FC000A207107F028FBE8 -:10C2D000030A6071A371030C000EE371207207F072 -:10C2E00025FB0025030A6072A372030C000EE372A3 -:10C2F000207308A90DF11E00ADF81E5002F05EFB80 -:10C30000BDF81E3063731B0AA373BDF8203065743B -:10C31000E3731B0A2374A57402F0A6FBE074000A01 -:10C32000207507F097F9534B60751B88000AE37579 -:10C330001B0AA07523761BE7002503A90DF10A004F -:10C34000ADF80A5002F02CFBBDF80A3004A9637066 -:10C35000BDF80A300DF10E001B0AA370BDF80C30B9 -:10C36000ADF80E50E3701B0A237102F035FBBDF8E7 -:10C370000E3005A963711B0AA371BDF810300DF1D1 -:10C380001200E3711B0A2372ADF8125002F02CFB6D -:10C39000BDF8123006A963721B0AA372BDF81430EF -:10C3A0000DF11600E3721B0A2373ADF8165002F06C -:10C3B00023FBBDF816300DF1070263731B0AA3734C -:10C3C000BDF818300DF11A01E3731B0A23740DF147 -:10C3D000060007AB8DF806508DF8075002F014FBED -:10C3E0009DF80630A5746374BDF81A30A575E37422 -:10C3F0001B0A23759DF807300DF109026375BDF81E -:10C400001C300DF11E01E3751B0A237602A808AB50 -:10C410008DF808508DF8095002F00EFB9DF8083099 -:10C42000A5766376BDF81E30A577E3761B0A2377E1 -:10C430009DF809306377BDF82030E3771B0A84F854 -:10C44000203095E608A8DFF73FFC3B4608AA10AE6F -:10C45000154603CDB542186059602A4603F108031A -:10C46000F6D128681860AA889A8081E6204C0021BD -:10C470001F4C0021604D00214FF6E07270B503881B -:10C48000054693428AB006D04FF6FC7293422BD0F9 -:10C4900000200AB070BD087802F014FD06460120A5 -:10C4A000298800F0A7FB0446E0B14FF6FC73067044 -:10C4B0002A889A4213D12822002168460DF02DFCCB -:10C4C0006846DDF72BF86B46651C0AAE1A4603CAB0 -:10C4D000B24228606960134605F10805F6D1601F75 -:10C4E00000F034FB0120D4E729200026D8E74FF6DE -:10C4F000B372F0B50388064693428FB006D04FF66C -:10C50000DB72934226D000200FB0F0BDCA788B7842 -:10C51000087803EB02234A7899B200EB022080B23C -:10C5200002F0DAFE07460120318800F063FB054681 -:10C5300070B104464FF6DB7204F8017B33889342F6 -:10C540000BD04FF6DC72934219D0681F00F0FEFA50 -:10C550000120D9E735200027E6E701A8DDF74CFCEC -:10C56000234601AA0DAE144603CCB44218605960AC -:10C57000224603F10803F6D110681860E5E701A828 -:10C58000DDF760FC234601AA09AE144603CCB44291 -:10C5900018605960224603F10803F6D1ECE74FF624 -:10C5A000F57270B503880546934288B006D04FF601 -:10C5B000FB72934227D0002008B070BD91F90000B3 -:10C5C00002F02CFF0120298800F014FB0446C0B1C2 -:10C5D000002303704FF6FB732A889A420ED16846F7 -:10C5E000DDF746FE6B46651C08AE1A4603CAB2422A -:10C5F00028606960134605F10805F6D1601F00F058 -:10C60000A5FA0120D8E72120DDE72DE9F0410288D5 -:10C610000746A2F57F42D03A0B468AB00E2A68D868 -:10C62000DFE802F0082D326767676767676743676F -:10C6300067673800DA789978120402EB012259789A -:10C6400018780A44197902EB016103F00BFA00260D -:10C650000546B0460120398800F0CCFA044660B1A6 -:10C660004FF6DA7205703B88934223D04FF6DE72A4 -:10C67000934231D0601F00F069FA01203AE0597806 -:10C68000187803F0F1F9E2E79A785978187803F00E -:10C69000EDF9DCE75A7893F80080062008EB0228D1 -:10C6A00000259E781FFA88F8D5E700262520B04699 -:10C6B0003546D0E701A8DEF737F809AE01AB621CBA -:10C6C0001D4603CDB542106051602B4602F10802B1 -:10C6D000F6D128681060CDE73146404602F0B6FF3B -:10C6E000030A6070A370030C000EE3702071617187 -:10C6F000C0E700200AB0BDE8F081000070B5064632 -:10C700004FF6DD7200206F4B8AB01B880C46ADF8E7 -:10C71000083033888DF80A00934200F0968003F1C8 -:10C720001D0292B21A2A00F2CA80A3F57F43E33BAE -:10C730001A2B00F2C380DFE803F0111624C12BC1CD -:10C74000A5939AC1C1C1C1C1C1C1C1C1C17EC1C18D -:10C75000C1C1C1C10E001D2000252BE00A785A4B33 -:10C760009A760120F8E7CB788978207801EB0321CD -:10C770006378227900EB032089B280B2FEF74AFF8A -:10C78000EFE74A780B7803EB02234F4AD384E8E7BC -:10C7900008464B7810F8025B05EB032506F065FFB1 -:10C7A0000B46A17AADB202460091284603F0DCFCAC -:10C7B00005460120318800F01DFA0446002838D0D3 -:10C7C0004FF6EB720570338893426FD04FF6FD72CF -:10C7D000934259D04FF6E972934227D13A4BDA6926 -:10C7E0004270DA69120A8270DA8BC270DA7F0271E3 -:10C7F0001A6A42711A6A120A82715A8CC27193F8CB -:10C80000232002729A6A42729A6A120A82725A8DBE -:10C81000C27293F82B200273DA6A4273DA6A120A40 -:10C820008273DA8DC27393F82F300374601F00F0A7 -:10C830008DF9012043E04B78087891F9021000EB64 -:10C84000032080B203F02AFCB2E74B780878CA785C -:10C8500000EB032091F9021080B203F03DFCA7E742 -:10C860008A78207891F9011003F050FEA0E74B7808 -:10C87000087802A900EB032080B203F0A1FE054670 -:10C88000042097E7112067E703A8DEF7B9FC09AE9B -:10C8900003AB621C1D4603CDB542106051602B46B0 -:10C8A00002F10802F6D128681060BFE79DF80A304F -:10C8B000BDF80820C370A0F80120B7E700200AB037 -:10C8C00070BD00BF96BB0301404C002138B54FF648 -:10C8D000F873028804469A4213D14B7808780231E3 -:10C8E00000EB032080B203F021FF218805460120E0 -:10C8F00000F080F918B100F8055900F027F901207F -:10C9000000E0002038BD4FF6F77337B502880446C3 -:10C910009A421FD14B78087800EB03208B7880B2C5 -:10C92000003B18BF01238DF80430CB7801A95A1EB3 -:10C93000534253418DF8053004F084FD21880546AB -:10C94000012000F057F918B100F8055900F0FEF881 -:10C95000012000E0002003B030BD00002DE9F047C9 -:10C96000154E8046337B0F46154683B90123C0F32D -:10C97000032933734FEA112A3DB140F2031006F048 -:10C98000E9FF013D0446EDB218B900233373BDE859 -:10C99000F08780F8008080F80190877080F803A00D -:10C9A000717B3A464B1C043073730DF0B6F9204688 -:10C9B00004F080FDE0E700BF244C00214FF6C17277 -:10C9C00070B503880646934288B050D003F12B021D -:10C9D00092B2042A00F28B80A3F57F43D53B042B4F -:10C9E00000F28580DFE803F03545032E43000A7826 -:10C9F000404B1A700120318800F0FCF804460028F2 -:10CA000061D0002305464FF6D67205F8013B338806 -:10CA1000934230D04FF6D972934256D04FF6C1723E -:10CA200093424DD101A8DEF71DF82B4601AA07AEAF -:10CA3000154603CDB542186059602A4603F1080334 -:10CA4000F6D151E04A780B7803EB0223294AD381CF -:10CA5000D0E7CA788B78087803EB02234A7800EB9A -:10CA6000022080B20A7999B2FFF778FFC2E71D2051 -:10CA7000C1E71120BFE71F4B5A6842705A68120A7B -:10CA80008270DA88C270DA7902719A6842719A68A3 -:10CA9000120A82715A89C271DA7A02721A69427272 -:10CAA0001A69120A82725A8AC272DA7C02735A694D -:10CAB00042735A69120A8273DA8AC273DB7D037485 -:10CAC000601F00F043F8012012E001A8DEF736F8FD -:10CAD0002B4601AA07AE154603CDB5421860596032 -:10CAE0002A4603F10803F6D110681860E8E7002031 -:10CAF00008B070BD244C002138B505464FF6E872E9 -:10CB00002B880846934205D04FF6EC7293420FD023 -:10CB1000002038BD04F0FCFF04462988012000F005 -:10CB200069F818B100F8054900F010F80120F0E7A5 -:10CB3000087805F00BF8EFE701234170090A03704C -:10CB4000817003207047017001207047024608B5CC -:10CB500018B10021054806F008FF054B93F828009E -:10CB600018B9BDE8084006F06DB908BD784D002140 -:10CB7000644D002138B50546881C0C4606F0EAFED7 -:10CB800010B105704470023038BD000070B5044625 -:10CB90000025174E56F8043B7BB901351D2DF9D100 -:10CBA000A578DDB1012D06D101F0BEFC04210E20D7 -:10CBB000FFF7E0FF38B9002004E02046984700283E -:10CBC000EBD0012070BD032343700C2305708370EC -:10CBD000E378C3700238FFF7B9FFF2E701211020B4 -:10CBE000FFF7C8FF0028E6D0237900F8013BF1E702 -:10CBF000EC4C002138B5054605300C4606F0AAFE7F -:10CC000048B10E2303700123C4700335240A457014 -:10CC100083700471053038BDF8B587780546022F5A -:10CC200003D0042F6AD00020F8BD827C3B4EFF2A3F -:10CC3000336935D0580501D40120F5E773689900B0 -:10CC4000FAD5374B96F830201B689B7B9A42F3D27B -:10CC500012213E20FFF78EFF04460028ECD00B2364 -:10CC6000037001234370AB7A05F10C018370EB7AFA -:10CC7000043000F8013C06F0F3FCAB7C05F1130135 -:10CC8000A37204F10B0006F0EBFC6B7A637496F868 -:10CC90003030013386F83030A01EFFF757FFCBE766 -:10CCA0009A07C0D573689B00BDD51D4B96F8302000 -:10CCB0001B689B7B9A42B6D2017A3E200C31C9B2E6 -:10CCC000FFF758FF04460028ADD0012307704370DA -:10CCD000AB7A05F10C018370EB7A043000F8013C6B -:10CCE00006F0BEFC2A7A04F10B03A27269681846AA -:10CCF0000CF0ECFF2A7A697A8154C8E739460E2095 -:10CD0000FFF738FF044600288DD0012303700C2361 -:10CD1000437020238370EB78C370BDE7404C002143 -:10CD2000DC4D00210238FFF711BF38B50546F92068 -:10CD30000C4606F00FFE10B105704470023038BD8D -:10CD40002DE9F04F83780446173B85B00F2B15D89B -:10CD5000DFE813F01000A900BD0014001400140057 -:10CD60001400D4008E0106011400140014001400F5 -:10CD70001400A601BB4F3B69DE0402D44FF0000B48 -:10CD800088E07B689D00F9D5E522868BDFF8D89294 -:10CD9000B6FBF2F302FB1362002A18BF013397F8C7 -:10CDA0003020DBB21344D9F80020927B9342E5DCBB -:10CDB000D0F82080D9F8003097F830209B7B9A4239 -:10CDC000DCD2E72006F0C6FD05460028D6D0E52EC9 -:10CDD000324628BFE5224FF03E01D3B2017003F185 -:10CDE0001A014170811C019197F83010D9F80000A8 -:10CDF0000131C9B287F83010807BB61A88424FD112 -:10CE0000002E4DD00026B346A18841F04001A180FC -:10CE1000206AB4F81CC008EB020AAAEB00006045C7 -:10CE2000CDE902324FF00D004FF00103A188EB7005 -:10CE30001CBF01F01F0141F020012971090AA870EF -:10CE40006971A179E81DA971E11D06F009FC617BFA -:10CE500005F115006973A17BA973E17BE973217C5E -:10CE60002974617C6974618AA97494F91310E97456 -:10CE7000217D297504F1150106F0F2FB029B414664 -:10CE8000039AEB7605F11C000CF020FF0198FFF7E8 -:10CE900049FF1EB9584605B0BDE8F08FD04689E776 -:10CEA0004FF0010BB4E704210E20FFF763FE0028CA -:10CEB0003FF464AF42224FF0010B4270202280F811 -:10CEC00000B08270E278C270FFF72CFFE2E7654B9A -:10CED0001A69D0037FF552AF5B6899007FF54EAFBA -:10CEE00001213E20FFF746FE00283FF447AF112204 -:10CEF0000270FFF717FF4FF0010BCBE7594B1A6990 -:10CF000092047FF53BAF5B689B007FF537AF102144 -:10CF10003E20FFF72FFE054600283FF42FAF0E23DB -:10CF20000370237904F10A014370E388063000F8A6 -:10CF3000043CE3881B0A00F8033C237A00F8023C17 -:10CF4000637A00F8013C06F08BFB237C2B73638A29 -:10CF50006B73638A1B0AAB73237DEB732846C8E7A8 -:10CF6000404E33695F047FF509AF73689D007FF51C -:10CF700005AFF7224789DFF8F0A0B7FBF2F302FB19 -:10CF80001372002A18BF013396F83020DBB2134425 -:10CF9000DAF80020927B93423FF7F0AEC368DAF8EC -:10CFA000002096F83010927B02939142BFF4E6AED7 -:10CFB000F72FB94628BF4FF0F7095FFA89F202F15F -:10CFC00008013E20C9B20192FFF7AFFE05460028D6 -:10CFD0003FF4D4AEDDE9012396F83010DAF8000012 -:10CFE0000131C9B286F83010807BA7EB090888426E -:10CFF00035D1B8F1000F32D04FF000080221C346FE -:10D00000617203EB09010191E16803EB0900411A28 -:10D01000608981422AD1617A022918BF00210F203C -:10D020002870A0886870A088000AA870A079E870AD -:10D03000E0792871207AA9716871EA712FB14A46A6 -:10D04000194605F108000CF041FE2846FFF76AFE7C -:10D05000B8F1000F3FF41EAF4746019B9FE74FF02A -:10D06000010BCEE7404C0021DC4D00210121D6E729 -:10D070002B4B1A6910047FF581AE5B6899007FF530 -:10D080007DAE03213E20FFF775FD00283FF476AE0C -:10D0900010220270A2884270A288120A827028E7C9 -:10D0A0001F4B1A6912027FF569AE5B689B007FF522 -:10D0B00065AE14213E20FFF75DFD054600283FF4D4 -:10D0C0005DAE18230370237904F10E014370E388E9 -:10D0D0000A3000F8083CE3881B0A00F8073C238963 -:10D0E00000F8063C23891B0A00F8053C638900F818 -:10D0F000043C63891B0A00F8033C237B00F8023CD4 -:10D10000637B00F8013C06F0ABFA237D2B74E38AC5 -:10D110006B74E38A1B0AAB74237EEB741EE700BFBB -:10D12000404C002138B5054600F058FE0446A0B931 -:10D13000AB78032B0FD104210E20FFF71BFD50B15C -:10D140000A2301244370202304708370EB78023893 -:10D150004371FFF7FBFC204638BD0124FBE70000CC -:10D16000837870B51A3B0546032B0AD8DFE803F035 -:10D17000022B3B572F4B304E1B68327E9B7F9A42CF -:10D1800001D3002070BD33695803FAD57368990044 -:10D19000F7D509213E20FFF7EDFC04460028F0D02A -:10D1A000132303702B79A91D43706B79033000F8AA -:10D1B000013C06F055FA337E01333376A01EFFF7AB -:10D1C000C5FC0120DEE704210E20FFF7D3FC044656 -:10D1D0000028D6D001230370392363702023A37065 -:10D1E0002B79E370EAE7144B1A699203C9D55B689F -:10D1F0009B00C6D506213E20FFF7BCFC0446002854 -:10D20000BFD0122303702B7943706B798370EB8846 -:10D21000C370EB881B0A03712B7A4371CEE704219C -:10D220000E20FFF7A7FC04460028AAD001230370B4 -:10D230004023D2E7DC4D0021404C0021837870B5BB -:10D240002B3B0546072B0BD8DFE803F004195E0AD9 -:10D250000A0A0A7305210E20FFF78CFC044608B960 -:10D26000002070BD42F26C01FFF766FC2A7923189A -:10D2700022546A795A70A01EFFF768FC5DE0524B99 -:10D280001A69D600ECD55B689C00E9D5017D3E208B -:10D2900049000F31C9B2FFF76DFC04460028DFD00A -:10D2A0001D2303702B79002243706B7905F1160161 -:10D2B0008370AB68C370AB681B0A03716B894371E1 -:10D2C0002B7B83716B7BC371AB7B0372EB7B4372F4 -:10D2D0002B8A83722B8A1B0AC3726B8A03736B8A35 -:10D2E0001B0A43732B7D837300F10F03287D0233E8 -:10D2F0008242C0D20888013203F8020C31F8020BD6 -:10D30000000A03F8010CF1E72F4B1A699000A7D52A -:10D310005B689900A4D503213E20FFF72BFC04464F -:10D3200000289DD01E2303702B7943706B79837086 -:10D33000A1E7254E73699A0701D4012091E773682C -:10D340009B00FAD5214B96F830201B689B7B9A42B4 -:10D35000F3D214213E20FFF70DFC04460028ECD048 -:10D3600022230370AB884370AB881B0A8370AB79B0 -:10D37000C370EB7903712B8943712B891B0A83716D -:10D38000AB7AC371EB7A03722B7B4372EB898372A6 -:10D39000EB891B0AC3722B6903732B691B0A437346 -:10D3A0006B8A8373AB8AC373AB8A1B0A0374AB7D2E -:10D3B0004374EB7D83742B7EC37496F83030013355 -:10D3C00086F8303057E700BF404C0021DC4D00218B -:10D3D00038B583780446292B03D02A2B53D000205C -:10D3E00038BD334B1A695001F9D55B689900F6D501 -:10D3F000A17E3E2049001331C9B2FFF7BBFB0028D4 -:10D40000EDD01B230370237900224370637904F16C -:10D410001C018370A368C370A3681B0A037163892E -:10D420004371E3688371E3681B0AC371E389037284 -:10D43000237C4372637C8372A37CC372E37C03739B -:10D44000237D4373E38A8373E38A1B0AC373238BAD -:10D450000374238B1B0A4374A37E837400F11303AC -:10D46000A57E0233AA4204D30238FFF76FFB0120E6 -:10D47000B6E70D88013203F8025C31F8025B2D0A31 -:10D4800003F8015CECE70A4B1A691201A7D55B6847 -:10D490009B00A4D503213E20FFF76CFB00289ED003 -:10D4A0001C2303702379437063798370DCE700BF2A -:10D4B000404C002138B583780546272B01D0002049 -:10D4C00038BD0B4B1A69D201F9D55B689B00F6D5C4 -:10D4D0001D213E20FFF74EFB04460028EFD02946D1 -:10D4E00000F008F8A01EFFF731FB0120E8E700BFBD -:10D4F000404C0021192303700B794370CB88837053 -:10D50000CB881B0AC3708B6803718B681B0A43713D -:10D510004B898371CB68C371CB681B0A0372CB89BB -:10D5200043720B6983720B691B0AC3724B8A0373C4 -:10D530004B6943734B691B0A8373CB8AC3730B7E9E -:10D5400003744B7E43748B7E8374CB7EC3740B7FDA -:10D5500003754B7F43758B7F83750B8CC3750B8C69 -:10D560001B0A03764B8C43764B8C1B0A83768B8C81 -:10D57000C3768B8C1B0A03771D207047837810B508 -:10D58000272B044626D0282B03D11B4B1A69900168 -:10D5900001D4002010BD5B689900FAD507213E2018 -:10D5A000FFF7E8FA02460028F3D01A230370A38895 -:10D5B0004370A3881B0A8370E388C370E3881B0A47 -:10D5C0000371237A4371637A8371901EFFF7BEFA69 -:10D5D0000120DFE7084B1A69D201DAD55B689B00AE -:10D5E000D7D51D213E20FFF7C5FA02460028D0D02E -:10D5F0002146FFF77FFFE8E7404C002108B5094AC4 -:10D60000C178837803EB0123D1699BB20131D161E9 -:10D61000116A0B44136206F0A5F9012003F014F817 -:10D62000012008BD404C0021114B70B5DD8C044633 -:10D630000E4685B905211320FFF79CFAB8B10123E6 -:10D640004470240A03708470C6700571BDE8704090 -:10D650000238FFF77BBA9A6A01329A62DA6A2A4480 -:10D66000DA620A462946BDE87040FDF7D3BF70BDB7 -:10D67000404C002110B502F0E5FF044610B900242B -:10D68000204610BD044B9B7E002BF9D0FFF7B6FF60 -:10D690000028F4D1F4E700BF404C002110B5094C3C -:10D6A000A37E43B102F0CEFF28B1A37E43B1BDE813 -:10D6B0001040FFF7A3BF0020BDE8104005F0C2BB3B -:10D6C00010BD00BF404C002138B583780546122BB1 -:10D6D00014D8042B1BD9053B0D2B18D8DFE813F009 -:10D6E000190059006E001700E100C2001700170072 -:10D6F0001700170017009500170002012F2B00F0EC -:10D700001D81302B00F03F812E2B00F0FA8000208D -:10D7100038BDAB4B1A69D207F9D55B689B00F6D5CB -:10D7200013213E20FFF726FA04460028EFD00122FD -:10D7300002702B79063000F8053CEB8800F8043CB9 -:10D74000EB881B0A00F8033C2B7A00F8023C6B7A4A -:10D75000991E914287BF637105F10A01627105F15B -:10D760001D0105F07DFF2B8A23732B8A1B0A63732F -:10D770006B8AA3736B8A1B0AE373AB8A2374AB8A2D -:10D780001B0A6374AB7DA374A01EFFF7DFF90120B1 -:10D79000BEE78B4B1B68DC06B9D504210520FFF7DB -:10D7A000E9F904460028B2D02B790370EB88437066 -:10D7B000EB881B0A83702B7AC370E5E7804B1A69EC -:10D7C0005007A4D55B689900A1D50A213E20FFF738 -:10D7D000D1F9044600289AD0032303702B794370B3 -:10D7E000EB888370EB881B0AC3702B8903712B892C -:10D7F0001B0A43716B8983716B891B0AC371AB89E7 -:10D800000372AB891B0A4372BEE76D4B1A6992061D -:10D810007FF57DAF5B689C007FF579AF0B213E20E3 -:10D82000FFF7A8F9044600283FF471AF06232370E0 -:10D83000AB886370AB881B0AA370EB88E370EB883E -:10D840001B0A23712B8963712B891B0AA3716B89B6 -:10D85000E3716B891B0A2372AB896372AB891B0A64 -:10D86000A37291E7564B1A6910077FF550AF5B68BA -:10D8700099007FF54CAF0C213E20FFF77BF9044661 -:10D8800000283FF444AF042303702B794370EB88E6 -:10D890008370EB881B0AC370AB684360EB688360DE -:10D8A00072E7474B1B681A057FF531AF08210C2042 -:10D8B000FFF760F9044600283FF429AF2B79037085 -:10D8C000EB884370EB881B0A83702B7AC3706B89DB -:10D8D00003716B891B0A4371AB898371AB891B0A86 -:10D8E000C37151E7364B1B695B067FF510AF0B2107 -:10D8F0003E20FFF73FF9044600283FF408AF072316 -:10D9000095E72F4B1A6954007FF501AF5B689800CB -:10D910007FF5FDAE05213E20FFF72CF904460028D7 -:10D920003FF4F5AE1F2303702B794370EB888370AF -:10D93000EB881B0AC3702B7A237125E7204B5A69A9 -:10D94000D1077FF5E4AE5B689A007FF5E0AE092170 -:10D950003E20FFF70FF9044600283FF4D8AE2123FC -:10D9600003702B794370EB888370EB881B0AC370BC -:10D970002B7A03716B7A4371AB7A8371EB7AC37143 -:10D980002B7B037200E70E4B1A69002ABFF6BFAE6D -:10D990005B689B007FF5BBAE05213E20FFF7EAF8F0 -:10D9A000044600283FF4B3AE20230370AB884370D5 -:10D9B000AB881B0A8370AB79C370EB79BCE700BFFF -:10D9C000404C0021837810B5212B044601D0002063 -:10D9D00010BD0D4B1A691203F9D55B689B00F6D593 -:10D9E00004213E20FFF7C6F80028F0D0142303706E -:10D9F000A3880238C370A3881B0A0371A3794371FB -:10DA0000FFF7A4F80120E3E7404C002138B5837804 -:10DA10000446082B11D104210E20FFF7ABF858B1B2 -:10DA20000E2301254370202305708370237902386B -:10DA30004371FFF78BF8284638BDBDE83840FFF743 -:10DA400043BE000038B583780546052B01D0002081 -:10DA500038BD234B1A699205F9D55B689B00F6D552 -:10DA60001F213E20FFF786F804460028EFD00A2346 -:10DA700003702B7905F10A014370EB88063000F83A -:10DA8000043CEB881B0A00F8033C2B7A00F8023CAC -:10DA90006B7A00F8013C05F0E3FD05F1170104F194 -:10DAA0000C0005F0DDFD05F11D0104F1120005F08B -:10DAB000D7FD2B8AA01E23762B8A1B0A63766B8ADE -:10DAC000A3766B8A1B0AE376AB8A2377AB8A1B0AA1 -:10DAD0006377AB7DA377FFF739F80120B8E700BF84 -:10DAE000404C002100F000B8837810B50B3B044691 -:10DAF000062B10D8DFE803F004384A0F0F0F6F0031 -:10DB00003D4B9A6802F00071920118D50521592009 -:10DB1000FFF730F808B9002010BD012363722379A4 -:10DB20000370E3884370E3881B0A8370237AC37011 -:10DB3000637A03710238FFF709F80120ECE71B68EC -:10DB400003F080030B43E6D004210820FFF712F80E -:10DB50000028E0D023790370E3884370E3881B0A30 -:10DB60008370237AC370E5E7234B5B681804D2D532 -:10DB700003213020FEF7FEFF0028CCD0237903706C -:10DB8000E3884370E3881B0A8370D3E71A4B1A6952 -:10DB9000D1061CD55B689A0019D50D213E20FEF7F1 -:10DBA000E9FFA0B105230370A3884370A3881B0A73 -:10DBB0008370D4F80630C0F80330D4F80A30C0F8C7 -:10DBC0000730E389C372E3891B0A0373B2E7A088B5 -:10DBD00003F0CAFB9FE7084B9B681B029BD5022101 -:10DBE0005720FEF7C7FF002895D0A3880370A388AD -:10DBF0001B0A43709EE700BF404C002110B5074B45 -:10DC0000847859689A680131224459609A6005F015 -:10DC1000A9FE012003F05AFC012010BD244C002174 -:10DC200070B50E46810001310546C9B21320144675 -:10DC3000FEF7A0FF00B30346224603F8015BB11EC6 -:10DC400004EB4505AA4203F1040304D1BDE870408A -:10DC50000238FEF77BBF31F8024F03F8044C0C8802 -:10DC6000240A03F8034C148803F8024C32F8024BE0 -:10DC7000240A03F8014CE5E770BD000010B503F07D -:10DC800023FC044610B90024204610BD044B1B7829 -:10DC9000002BF9D0FFF7B2FF0028F4D1F4E700BF62 -:10DCA000244C002138B50F4C257E012D09D103F0FD -:10DCB0000BFC88B105F056FE2846BDE8384003F05D -:10DCC00005BC237843B103F0FFFB28B1237843B1AF -:10DCD000BDE83840FFF792BF0020BDE8384005F0AE -:10DCE000B1B838BD244C002100207047837810B5AE -:10DCF000162B044601D0002010BD0F4B1A691205E7 -:10DD0000F9D55B689B00F6D506213E20FEF732FF71 -:10DD10000028F0D00C23037023790238C370E38805 -:10DD20000371E3881B0A4371237A8371637AC37199 -:10DD3000FEF70CFF0120DFE7404C002138B5837867 -:10DD40000446132B4FF0000503D0142B29D00020DC -:10DD500038BD214B1A691006F9D55B689900F6D5D4 -:10DD600042213E20FEF706FF0028F0D00823457030 -:10DD70000370821C631D04F1250153F8045B8B4280 -:10DD800042F8045BF9D100F12202453453F8041B38 -:10DD9000A34242F8041BF9D10238FEF7D7FE012056 -:10DDA000D6E70D4B1A69D205D1D55B689B00CED55D -:10DDB00022213E20FEF7DEFE0028C8D00923037092 -:10DDC0002379821C4370631D253453F8041BA3423E -:10DDD00042F8041BF9D1DFE7404C002138B58378C5 -:10DDE0000546222B39D0312B20D0152B05D10F2100 -:10DDF000FF20FEF7BFFE044608B9002038BDF1231E -:10DE00000370FF2343702B79033000F8013CD5E900 -:10DE1000022305F043FCD5E9042304F1090005F0D1 -:10DE20003DFCA01EFEF792FE0120E7E70A21FF203D -:10DE3000FEF7A0FE04460028DFD0F3230370FF2383 -:10DE400043702B798370AB688371AB681B0AC37115 -:10DE50006B890372EB7A4372E3E70F21FF20FEF731 -:10DE600089FE04460028C8D0F5230370FF234370C1 -:10DE70002B798370EB88C370EB881B0A03712B89A5 -:10DE800043712B891B0A8371EB68C371EB681B0A12 -:10DE90000372EB894372EB7B83722B69C3722B692C -:10DEA0001B0A03736B8A4373EB7C8373B9E700002F -:10DEB000014B5866704700BF784C0021034B044A61 -:10DEC0001A62044B044A1A62704700BF784C002162 -:10DED00001A60201EC4C002119CC020104490548BD -:10DEE000054B064A48625A6288629A62704700BFD0 -:10DEF000784C002181A60201EC4C002141CD0201A9 -:10DF0000034A93681BB903499160034A93607047C1 -:10DF1000784C002179A80201EC4C0021034B044A03 -:10DF2000DA62044B044ADA62704700BF784C002181 -:10DF30006DA90201EC4C002125D1020104490548DC -:10DF4000054B064A08631A6348635A63704700BF6B -:10DF5000784C002169AA0201EC4C002161D1020138 -:10DF6000034B044A1A65044B044A1A65704700BF04 -:10DF7000784C002141AD0201EC4C00213DD2020160 -:10DF8000034B044A5A65044B044A5A65704700BF64 -:10DF9000784C0021CFAD0201EC4C0021D1D302011D -:10DFA000034B044A9A64044B044A9A64704700BFC6 -:10DFB000784C00211DAF0201EC4C0021B5D40201C8 -:10DFC000034B044ADA64044B044ADA64704700BF26 -:10DFD000784C002141B20201EC4C00217DD50201B8 -:10DFE00008B50849084800F093FD084B5A6922B962 -:10DFF000074A5A61074B084A5A61084B084A1A6097 -:10E0000008BD00BF9DD6020129D60201784C00212F -:10E0100029B40201EC4C0021C9D60201D04D0021E7 -:10E0200075D60201014B024A9A617047EC4C0021FF -:10E03000C5D9020108B50749074800F069FD074B3B -:10E04000074A5A61074B084A5A61084B084A1A6046 -:10E0500008BD00BF9DD6020129D60201784C0021DF -:10E060007DB60201EC4C00210DDA0201D04D0021F9 -:10E0700075D6020108B50749074800F049FD074B6E -:10E08000074A5A61074B084A5A61084B084A1A6006 -:10E0900008BD00BF9DD6020129D60201784C00219F -:10E0A0002BB70201EC4C00210DDA0201D04D00210A -:10E0B00075D60201034B044A9A60044B044A9A60E5 -:10E0C000704700BF784C0021F3B70201EC4C0021EF -:10E0D00045DA0201034B044ADA61044B044ADA616F -:10E0E000704700BF784C00215DB80201EC4C002164 -:10E0F000E5DA0201044BDA6922B9044ADA61044B19 -:10E10000044ADA61704700BF784C00219DB80201D3 -:10E11000EC4C0021E9DA020110B50E4B04460E4A20 -:10E120000E49002004F07AFE0D4804F085FE0D4BE8 -:10E130006C22184600210BF0F0FD382204700021FB -:10E1400009480BF0EAFD094800F024FCBDE8104046 -:10E1500000F0EAB97DE402018DE3020135E302013A -:10E160000DE50201644D0021404C00218DCB0201E0 -:10E1700008B50749074800F0E3FC074B074A1A6057 -:10E18000074B084ADA60084B084ADA6008BD00BF4E -:10E19000A5DC020121DC0201D44D00217DDC02015D -:10E1A000784C0021D5B90201EC4C0021E9DC0201D8 -:10E1B000054B1B681B79092B05D9044B044A5A648B -:10E1C0000022044B5A647047DC4D0021784C00213A -:10E1D0001DBE0201EC4C0021034B044ADA63044BE0 -:10E1E000044ADA63704700BF784C0021F3BE020195 -:10E1F000EC4C0021EDDC0201034B044A9A63044B12 -:10E20000044A9A63704700BF784C002133C0020172 -:10E21000EC4C00213DDD02012DE9F74F804607F06F -:10E220005DFB10F0FF0502D007F0E6FB064618F094 -:10E23000010F05D0394C204601A905F0ABFBB0BB5E -:10E2400018F0020F08D0DFF8D89048460DF103010E -:10E2500005F0A0FB044668BB18F0040F08D00020AE -:10E26000304C84F8280004F0EDFD636A03B1984750 -:10E2700018F0080F0AD001211020FEF77BFC28B10E -:10E28000294B5B7E00F80239FEF760FC65B107F0B0 -:10E2900025FB48B107F0B0FB314607F085FB234B67 -:10E2A0001A88824200D2188003B0BDE8F08F02F0D5 -:10E2B000BFF9C0E76278237804F1030A03EB022375 -:10E2C000ADF80430A378514601A88DF80630FBF76D -:10E2D000C7FE0746E8B9DFF858B05BF8043B9BB9C6 -:10E2E00001371D2FF9D104210F20FEF743FC80B127 -:10E2F0000122BDF80430023803711B0A8270C2701B -:10E300004371FEF723FC04E0514601A8984700281A -:10E31000E6D0204605F026FB97E700BF684D0021B8 -:10E32000704D0021644D0021404C0021604D0021C2 -:10E33000784C0021012838B50A46044616D0032837 -:10E3400008D0D8B9104D014605F10C0005F00DFBC1 -:10E35000022111E00C4C002104F11C0005F005FB2A -:10E3600010212078BDE8384005F0A0BB064D002103 -:10E37000281D05F0FAFA21462878F3E70846BDE89B -:10E38000384005F0EFBA00BF644D002110B50446D7 -:10E39000022C084609D0032C65D0012C0FD105F0C2 -:10E3A000E1FA204602F050F909E00B783E2B04D147 -:10E3B0008B78162B3AD8012B08D805F0D3FABDE894 -:10E3C00010402C4B0421187805F070BB023B142B35 -:10E3D000F3D801A252F823F041E40201BBE30201A9 -:10E3E000BBE30201BBE30201BBE30201BBE30201A9 -:10E3F000BBE30201BBE30201BBE3020141E4020112 -:10E40000BBE3020141E40201BBE3020141E402017A -:10E41000BBE30201BBE30201BBE302014FE40201E3 -:10E42000BBE3020159E4020159E40201223BDBB2E1 -:10E43000062BC2D8012202FA03F313F0490FBCD015 -:10E440000D4A92F83030013B82F83030B5E70A4A85 -:10E45000137E013B1376B0E7074A92F83130013B57 -:10E4600082F83130A9E705F07DFA012003F02EF89B -:10E47000A5E700BF644D0021404C00212DE9F34188 -:10E48000DFF87C80064698F828700D461446002F69 -:10E4900033D10DF1070108F1140005F07BFA68B1E2 -:10E4A0000122437888F828200222023301273270A3 -:10E4B0002B802060384602B0BDE8F081114B1B680C -:10E4C0005BB1984748B18378C278043303EB0223E9 -:10E4D000012288F828200322E8E70B4B1B68002B59 -:10E4E000E8D098470028E5D08378C278043303EB5E -:10E4F0000223012288F82820D8E70027DAE700BFA6 -:10E50000644D0021D44D0021D04D0021044B5A7E92 -:10E510002AB95876034B0821187805F0C7BA704716 -:10E52000404C0021644D002110B5094C30220021DF -:10E5300004F108000BF0F1FB4FF0FF3241F6FF73DE -:10E54000C4E900231F220023C4E9042310BD00BF37 -:10E55000404C0021C022A24B70B583F82E20282207 -:10E56000042183F83720022283F83F104CF2170170 -:10E5700083F8382083F855200022A3F8421047F68C -:10E58000830183F856208022A3F84410102183F8D9 -:10E590004F20944A83F85210506918B393F8291009 -:10E5A000B3F84A4041F0200183F8291093F82B106A -:10E5B00044F4F87461F07F0183F82B1093F8331062 -:10E5C000A3F84A4041F0040183F83310222183F874 -:10E5D0003810B72183F8441093F84C1041F008012B -:10E5E00083F84C10116A29B1002840F0EB80CC214F -:10E5F00083F84310D16A41B1F72183F8421093F8B0 -:10E60000431041F0030183F84310D16979B170B12F -:10E6100093F8441041F0400183F844107F2183F8BF -:10E62000451093F8491041F0300183F84910916882 -:10E63000D1B193F84B4093F8505044F0780183F8EF -:10E640004B1093F84C1045F0040541F0060683F892 -:10E650004C6083F8505038B164F0070441F0070172 -:10E6600083F84B4083F84C10916B41B193F84B10F9 -:10E6700041F0060183F84B10142183F85210D16B3E -:10E6800029B1B3F84C1041F4F871A3F84C10116B98 -:10E6900089B193F84D4093F8501064F0010483F869 -:10E6A0004D4093F84E4041F0030144F0030483F8D9 -:10E6B0004E4083F85010516A41B193F84E10002833 -:10E6C00040F08A8041F0600183F84E10516B29B10F -:10E6D00093F84E1041F01C0183F84E10916A11B16D -:10E6E000FF2183F84F10116C29B1B3F8501041F499 -:10E6F000FF51A3F85010516C59B193F8511061F0CB -:10E700001F0183F8511093F8521041F0030183F870 -:10E710005210916C29B1B3F8521041F4F061A3F892 -:10E720005210D16C29B193F8531041F0180183F8BD -:10E730005310116D29B193F8541041F0030183F87F -:10E740005410516D29B193F8531061F01F0183F8F3 -:10E750005310D168A1B193F8301041F00C0183F847 -:10E76000301093F8521041F0600183F8521093F882 -:10E77000541061F0030183F85410072183F85510F9 -:10E78000916D11B13C2183F85610116E29B193F8A7 -:10E79000551061F0070183F8551093F85010126975 -:10E7A00041F0180183F8501093F8561041F0010120 -:10E7B00083F856102AB193F8572042F0030283F8E9 -:10E7C000572070BDFC2183F8431093F8441041F0AA -:10E7D000080183F844100DE761F01F0174E700BFE2 -:10E7E000644D0021784C0021C30673B504460D46E4 -:10E7F00006D5084E30460DF1070105F0CBF830B9CB -:10E800002946204602B0BDE87040FFF705BD02F082 -:10E8100051FEEFE7804D002110B504464C22002147 -:10E820000BF07BFA0F4B104A23600823226102226F -:10E8300023710423E2820D4AA373A261A3770C4AD9 -:10E840000C4BC4E9082342F21073A3874CF6DD1386 -:10E85000A4F84230084B636440F6E213A4F8483051 -:10E8600010BD00BFE807F149FB0040001900FB00A4 -:10E87000FB00000404001B00320000D8014B1860AC -:10E88000704700BFDC4D002113B5244C2073EAF71C -:10E8900047FAEAF7AFFA00220023C4E90C23204B21 -:10E8A00083F840201A601A719A711A721D4AD4E9CD -:10E8B000083112680DF1070192F83E00002818BFD8 -:10E8C0004FF48070034392F83F00002818BF4FF4C4 -:10E8D0000060034392F8400092F84120002818BFDE -:10E8E0004FF40070002A18BF4FF4806203431343B3 -:10E8F0000DF10600236207F073F99DF90720236AE2 -:10E90000132ACCBF4FF4004200221343236203F0CA -:10E91000AFF902F087FC02B010BD00BF68500021C3 -:10E9200020500021DC4D0021F8B506460D4606F0CA -:10E93000D5FF074656B1002446FA04F3DB0702D59B -:10E94000E0B2EAF7B9FA01340E2CF5D115B1284638 -:10E95000EAF76AFA06F0C2FF394607F025F8034BDA -:10E960001A88824238BF1880F8BD00BFD84D0021F8 -:10E97000042008B504F0EEFF014640B1FF234380B8 -:10E980000380034B187BBDE8084004F0F4BF08BDCA -:10E9900068500021014B1860704700BF685000218B -:10E9A000044B1B6803B11B7B0370034B1B8A0B805A -:10E9B000704700BFDC4D002168500021044B1B68EC -:10E9C0000BB193F822300370024BDB890B80704748 -:10E9D000DC4D00216850002103230370014B5B8A4A -:10E9E0000B8070476850002103230370014B9B8A02 -:10E9F0000B8070476850002106230370014BDB8AAF -:10EA00000B8070476850002130B5094D2C6864B107 -:10EA100094F834400470286890F835001070054A66 -:10EA2000508B0880128B1A8030BD04701470F6E78A -:10EA3000DC4D00216850002130B5094D2C6864B1CF -:10EA400094F839400470286890F83A001070054A2C -:10EA5000D08B0880928B1A8030BD04701470F6E75A -:10EA6000DC4D002168500021014B1888704700BF21 -:10EA7000D84D002108B503F035FBBDE80840EAF7A2 -:10EA800071BDEBF747BA08B503F02CFBEBF712FAB0 -:10EA9000EBF720FBEBF740FBBDE80840EBF758BB7A -:10EAA00008B503F049FBBDE80840ECF737B9ECF7CF -:10EAB0003FBD08B503F040FBECF7F0FCBDE80840B3 -:10EAC000EDF75EBC08B503F0F7FABDE80840EEF7D5 -:10EAD000EFBEEEF759BB08B503F0EEFABDE808400B -:10EAE000EFF7F4B808B503F0E7FA03F0B3FABDE8BE -:10EAF0000840F1F715BCEFF723BE08B503F0DCFAC8 -:10EB0000BDE80840F1F7ACBEF3F76EB8F2F7F0B825 -:10EB1000014BC3E9010170476850002108B503F0BB -:10EB2000A7FABDE80840F4F71BB808B503F0A0FA4F -:10EB3000BDE80840F4F76EB8F4F7EEB9F4F748BC56 -:10EB4000014BC3E90A0170476850002108B5F4F78A -:10EB500011FF80B208BDF6F7F5B8F6F7A9B908B508 -:10EB600003F0D4FABDE80840F6F748BA08B503F058 -:10EB7000D7FABDE80840F6F75BBCF6F773BC0000B7 -:10EB800008B504F085FD024BC3E90C0108BD00BFC8 -:10EB900068500021024BD3E90C2304F07FBD00BF75 -:10EBA00068500021F8B5244D06466B782BB1234BF5 -:10EBB0005B7CDA0701D50C20F8BDEB787BB1EAF776 -:10EBC0006FFD04460028F6D11D4F3B683BB13B6802 -:10EBD000E0B298470028EED10134032CF7D12B790D -:10EBE0007BB1F4F7ABF904460028E4D1154F3B683C -:10EBF0003BB13B68E0B298470028DCD10134032CDC -:10EC0000F7D1304604F044FD01F44043B3F5404FE2 -:10EC100006460C4601D00B040CD404F053FE01232D -:10EC2000EB7340F20113C5E908642B8204F056FE31 -:10EC30000020C1E71220BFE72050002140510021F1 -:10EC4000E44D0021E04D002147F6EE5208B5831E49 -:10EC50009BB2934203D803F067FF002008BD122047 -:10EC6000FCE7000008B5054B5A7C2AB1D3E908231C -:10EC700004F014FD002008BD1220FCE72050002104 -:10EC8000054B30B51C6825880580207908701B6805 -:10EC90005B88138030BD00BFDC4D0021024BD3E9FF -:10ECA0000E2304F0E6BC00BF68500021024BD3E9FC -:10ECB0000A2304F0DEBC00BF2050002108B504F098 -:10ECC000D4FC034621F4FF5020F01F0018B9034A7A -:10ECD000C2E90A3108BD1220FCE700BF2050002124 -:10ECE000034630B50C4C10461C4021F07E422243B6 -:10ECF00010D10A4AD2E9065428B100202B432143FF -:10ED0000C2E9063130BD25EA030324EA0101C2E964 -:10ED10000631F7E71220F5E7000001C0205000217E -:10ED2000DDF70EBD10B5044B9C791CB9DDF70EFD67 -:10ED3000204610BD0C24FBE72050002138B5124BB3 -:10ED400005461B6808461B79082B03D8012D05D9F9 -:10ED500012240AE0AB1EDBB2FC2BF9D90B4B9C79D9 -:10ED600084B9FF2D03D1DDF745FD204638BD04F001 -:10ED70008FFC02460B462846DDF7F2FC002808BF50 -:10ED80000724F2E70C24F0E7DC4D0021205000219D -:10ED900038B5124B04461B6808461B79082B03D86C -:10EDA000012C05D912250AE0A31EDBB2FC2BF9D9F0 -:10EDB0000B4B9D797DB9FF2C03D1DDF721FD284652 -:10EDC00038BD04F065FC02460B462046DDF7E8FC42 -:10EDD0000028F4D1E6E70C25F1E700BFDC4D002167 -:10EDE0002050002103461C48F0B5D0E91025C3F19E -:10EDF0002004A3F12000DA4005FA04F4224325FAA6 -:10EE000000F0024312F0010FC3F1200CA3F1200225 -:10EE10001DD0124E3078E0B9012505FA02F425FA2A -:10EE20000CFE44EA0E0E05FA03F701FA02F221FA8B -:10EE30000CFCD6E90A5442EA0C0225EA070524EA4A -:10EE40000E04994029432243C6E90A12F0BD11205D -:10EE5000FCE70C20FAE700BF685000212050002199 -:10EE600006F0BEBE06F0D8BE08B506F0E5FE0028E6 -:10EE70000CBF1220002008BD38B5437882781B02F1 -:10EE800012049B182CBF012100210278C478057957 -:10EE90009B184FEA046441F100011C1945EB010580 -:10EEA0002046294602F063FE012808D915F4787F30 -:10EEB00005D120462946BDE83840EAF77FB8122040 -:10EEC00038BD000008490246CB780879184306D1BE -:10EED00012F0F80F05D122B1044B1A7270470C20C2 -:10EEE00070471220704700BF20500021F8500021C9 -:10EEF0002DE9F041254D8046AB6A1A0654BF012624 -:10EF000003265B0654BF0127032702F019FFC0B395 -:10EF1000EC782B791C4334D1B8F80020B2F5804F3F -:10EF200031D8B8F802309A422DD3032B2BD998F858 -:10EF30000430012B27D898F80530BB4223D898F825 -:10EF40000630B3421FD80C2004F004FD0146A8B1DE -:10EF500040F202434380B8F800308380B8F80230B2 -:10EF6000C38098F80430037298F80530437298F81B -:10EF700006308372064B187B04F0FDFC2046BDE88A -:10EF8000F0810C24FAE71224F8E700BF205000219A -:10EF90006850002138B504460D4602F0D1FE20B974 -:10EFA0000C20BDE8384002F02ABE012C06D10D4BE2 -:10EFB000587902F0ADFE08B91220F2E7062004F0FD -:10EFC000C9FC014660B10223002C837018BF0123E5 -:10EFD000C370054B0571187BBDE8384004F0CBBC0D -:10EFE00038BD00BFF8500021685000212DE9F74FCF -:10EFF000DFF8E8A01646DAF828501F462A0654BF64 -:10F000004FF0010B4FF0030B6B0654BF012303239A -:10F0100080468946019302F09FFE002858D09AF856 -:10F0200003409AF80420144352D16D0A05F00405F8 -:10F0300045F0010536EA05034CD1019B43454BD30E -:10F04000CB4549D3002E47D016F0010537D07B8839 -:10F050003A889A4240D3032B3ED93B79012B3BD8C7 -:10F06000012316F004060BD006225343FA185188E8 -:10F07000FB5A8B4230D303292ED91379012B2BD87D -:10F08000FDB10020EAF790FF3B464A46414600208A -:10F09000EAF79EFF01250220BEB1EAF785FF0623AD -:10F0A0004A4603FB0573414602206E1CEAF790FFB7 -:10F0B00035468AF80C50204603B0BDE8F08F2B4649 -:10F0C000CFE72846EAF77AFFE5E7EAF777FFF0E7C8 -:10F0D0000C24F0E71124EEE71224ECE72050002185 -:10F0E0002DE9F0414FF4A064214E5C43337B0A25A7 -:10F0F0007373002380460F465543B37302F02CFE12 -:10F1000030B901230C207373BDE8F04102F0CEBE8C -:10F11000B8F1010F10D1022F03D90123122073730C -:10F12000F2E706D1002CF8D0002DF6D0A54203D38B -:10F13000F3E70CB1002DF9D1EAF718FF0028ECD065 -:10F14000102004F007FC014680B10723B8F1000F3E -:10F15000837014BF01230223C0E90254C370054B1E -:10F160000771187BBDE8F04104F005BCBDE8F081F3 -:10F17000205000216850002170B5044602F0ECFDDB -:10F1800010B90C26304670BDA378012B55D8637892 -:10F190000F2B52D82389B3F5FA7F4ED2237813F080 -:10F1A000F80F4AD143F6F67263890A3B9BB2934249 -:10F1B00043D8237B1F2BE4D0EAF766FF0028E0D07A -:10F1C0006068A678657804F063FA02460B46284624 -:10F1D0003146EAF761FF0646002830D1EBF77AFAAC -:10F1E00005282ED8182004F0B5FB05460028C9D004 -:10F1F00040F20B134380606804F04AFAC5E902014B -:10F20000A378EB716378AB71237803F001022A7164 -:10F21000C3F340026A7172B9C3F380032B7523896B -:10F2200029462B8263896B82237B6B75064B187B87 -:10F2300004F0A1FBA6E70023F0E71226A2E70B26C5 -:10F24000A0E707269EE700BF6850002108B502F03E -:10F2500083FD08B90C2008BDEAF736FA0028F9D07A -:10F26000402004F077FB01460028F4D040F20B2345 -:10F270004380034B187B04F07EFB0020EBE700BFCC -:10F280006850002138B5054602F066FD10B90C241F -:10F29000204638BDB5F5706F17D22846EBF72CFA2B -:10F2A000A8B1EAF711FA04460028F0D1402004F092 -:10F2B00051FB01460028EBD040F20D234380054B63 -:10F2C0000580187B04F057FBE2E71224E0E74224B4 -:10F2D000DEE700BF6850002170B505460E4602F01B -:10F2E0003BFD10B90C24204670BDB5F5706F0ED2F1 -:10F2F0002846EBF701FA60B1EAF7E6F90446002880 -:10F30000F0D131462846EBF7EFFA0028EBD1122472 -:10F31000E9E74224E7E70000F7B5044602F01CFDE8 -:10F3200018B90C25284603B0F0BD154BDB79002B2E -:10F33000F7D12378012B01D91225F3E7237A0F2B7C -:10F34000FAD8EAF7C1F90028EBD1606804F0A0F917 -:10F35000237A0246009307460B4620780E46DCF7D8 -:10F36000E3FC05460028E7D1237A3A46009320784B -:10F370003346DCF707FD002808BF0725D2E700BFAA -:10F380002050002137B5054602F0E6FC18B90C24E0 -:10F39000204603B030BD0F4BDB79002BF7D12B7823 -:10F3A000012B15D82B7A0F2B12D8EAF78DF90446CA -:10F3B0000028ECD1686804F06BF90B46297A024604 -:10F3C00000912878DCF7FCFC002808BF4224DFE726 -:10F3D0001224DDE72050002110B502F0BDFC10B969 -:10F3E0000C24204610BD064BDB79002BF8D1EAF740 -:10F3F0006BF904460028F3D1DCF7BEFCF1E700BF4F -:10F400002050002110B5044602F0A6FC20B1DCF724 -:10F41000ADFC2070002010BD0C20FCE7014B83F8F0 -:10F42000300070472050002110B5044602F088FCDF -:10F4300038B1054B93F9300006F008FC207000202D -:10F4400010BD0C20FCE700BF205000212DE9F74F34 -:10F450002D4C8946A16A15469DF83C2098464B06DE -:10F4600054BF0126032607469DF830A09DF838B00A -:10F47000019202F065FC78B164786CB9012D019AB3 -:10F480000CD01F2F06D94F4504D8B9F5804F01D8AD -:10F49000042D06D9112433E00C2431E04645F9D37C -:10F4A00006E04645F6D3042D02D018F0020F05D031 -:10F4B0000D9B002BEED0BAF1010FEBD81BF0F80F2B -:10F4C000E8D1BBF1000FE5D0012D03D0042D01D010 -:10F4D000032ADFD840F271214F4301FB09F10B4EA3 -:10F4E0000D98B760F160357486F8118086F812A027 -:10F4F00086F820B086F8212004F0CAF8C6E9060193 -:10F50000204603B0BDE8F08F20500021405100217B -:10F5100038B504460D4602F013FCA8B11F2C15D8CF -:10F5200004F0D0F92246294609480AF0CFFB094BDE -:10F5300083F84740012483F8484004F0CFF920467F -:10F54000EBF71CFA002038BD0C20FCE71220FAE78C -:10F55000685100214051002138B504460D4602F0A3 -:10F56000EFFBA8B11F2C15D804F0ACF929462246B0 -:10F5700009480AF0ABFB0122084B83F8684083F886 -:10F58000692004F0ABF90220EBF7F8F9002038BD50 -:10F590000C20FCE71220FAE789510021405100219C -:10F5A00038B5054602F0CCFB20B90C20BDE8384048 -:10F5B00002F016BB1D4C237C012B01D9042B07D173 -:10F5C0001B4B1C4A1B68127893F822309A42ECD0ED -:10F5D000012D1CD1607C02F09BFBC0B9237C032B66 -:10F5E00013D1D4E90623A07CDCF74BFF68B10420DB -:10F5F00004F0B0F9014640B14FF4827343800E4BE2 -:10F60000187BBDE8384004F0B6B91220CEE70420DC -:10F6100004F0A0F9014638B10423002D837014BF13 -:10F6200001230223C370EAE738BD00BF4051002127 -:10F63000DC4D00212050002168500021014B83F84F -:10F640007800704740510021ECF73EB811B1C0B2CC -:10F65000ECF7FAB9EBF7CEB838B505460C4602F030 -:10F660007BFB002847D0EF2D47D8D4E901128A420E -:10F6700020D323881D2B04D01F291BD921498A425E -:10F6800029D813F0100102D0B2F5804F23D823F00F -:10F690007F027AB903F01302032A0BD011B113F0E1 -:10F6A000600F07D19A0601D5980703D1A37D19B140 -:10F6B000012B09D012201FE003F0FD02012AF9D12D -:10F6C000227E013A022AF5D8227E022A05D10E4A6C -:10F6D000926AD20513D411200EE0032B01D0032A25 -:10F6E00003D1094B9B6A1B05F5D521462846BDE889 -:10F6F0003840ECF7ADB80C2038BD3020FCE7032BC8 -:10F70000EEE700BFC66D34002050002138B5054635 -:10F710000C4602F021FB00284ED0EF2D4ED8D4E944 -:10F7200001128A4220D323881D2B04D01F291BD904 -:10F7300024498A422AD813F0100102D0B2F5804F32 -:10F7400024D823F07F027AB903F01302032A0BD0E6 -:10F7500011B113F0600F07D19A0601D5980703D1B4 -:10F76000A37D19B1012B09D0122026E003F0FD0280 -:10F77000012AF9D1227E013A022AF5D8217E1248C7 -:10F780000229D0E90A2003D1D10519D4112014E0AF -:10F79000032B01D0032901D11205F7D5C30505D4E8 -:10F7A000E37E002BF2D1237F002BEFD121462846A8 -:10F7B000BDE83840ECF74CB80C2038BD3020FCE7F1 -:10F7C000032BE8E7C66D34002050002181230B7025 -:10F7D000EBF74CBF2DE9F041DDF8188004460D46EB -:10F7E00016461F4602F0B8FA48B13B463246294653 -:10F7F0002046CDF81880BDE8F041ECF70CBF0C2096 -:10F80000BDE8F0812DE9F041DDF8188004460D4691 -:10F8100016461F4602F0A0FA48B13B46324629463A -:10F820002046CDF81880BDE8F041ECF747BF0C202A -:10F83000BDE8F0812DE9F347454E0746B37A0C4603 -:10F8400015461BB10C21002002F0A6FB0023F37229 -:10F8500002F082FA38B901230C21B37202B0BDE87C -:10F86000F04702F099BB062C33D804B98FBBA946E8 -:10F870004FF0000A544531D8002C46D0002F14BF59 -:10F880004FF001084FF0020800274FF00809DFF899 -:10F89000C4A00C2004F05EF8014690B10A222B7837 -:10F8A00080F80290038080F803806B8853434360A4 -:10F8B0002B790372B37A9AF80C000133B37204F017 -:10F8C0005AF80137BC4205F10605E2D802B0BDE89E -:10F8D000F087012312210020B372BFE799F80000DE -:10F8E000EBF782FEC846014638B949463846EBF781 -:10F8F00063FE09F10609014620B10123B37298F8AD -:10F900000000ABE70AF1010AB4E768460094ADF8DD -:10F910000440EBF7BBFE4FF402770546DFF8348076 -:10F92000A542D3D90C2004F015F8014668B11DF8A2 -:10F93000043047800380002343600372B37A98F851 -:10F940000C000133B37204F016F80134E8E700BF8D -:10F95000205000216850002110B5044602F0FCF947 -:10F9600050B140F27262054B00201B681B8A934223 -:10F9700028BF1346238010BD0C20FCE7DC4D00217E -:10F9800010B5044602F0E8F928B10020034B1B68CB -:10F990001B7B237010BD0C20FCE700BFDC4D002159 -:10F9A00010B5044602F0D8F920B12046BDE8104059 -:10F9B000ECF7D8B90C2010BD08B502F0CDF918B19C -:10F9C000BDE80840ECF7E8B90C2008BD38B505469D -:10F9D0000C4602F0C1F968B1EF2D0DD8238862887A -:10F9E0009A420BD3052B09D921462846BDE8384059 -:10F9F000ECF734B80C2038BD3020FCE71220FAE7D1 -:10FA00002DE9F04104460D4616461F4602F0A4F9C2 -:10FA100058B1EF2C0CD8042D0CD83B463246294661 -:10FA20002046BDE8F041ECF769B80C20BDE8F08154 -:10FA30003020FBE71220F9E738B505460C4602F006 -:10FA40008BF928B90C212046BDE8384002F0DBBA1A -:10FA5000EF2C01D93021F6E729462046BDE8384091 -:10FA6000ECF72EB9ECF7C6B9ECF7D3B910B44C1ECD -:10FA7000012C05D8531E012B02D810BCECF7DFB9BE -:10FA8000122010BC70470278EF2A16D84288B2F5CF -:10FA9000706F12D20279012A0FD8427D1F2A0CD82A -:10FAA00043F6F671C28A0A3A92B28A4205D8037EB8 -:10FAB000013B1E2B01D8EDF7A1BC30207047EDF7BC -:10FAC0003FBD000038B5254B04461B6893F83E2027 -:10FAD00093F83F30002A14BF03220122002B037841 -:10FAE00014BF04250025EF2B34D84078EF2831D8F7 -:10FAF000A17801391E292DD86168194BA1F58071B3 -:10FB0000994227D82389B3F5805F23D240F69B71B1 -:10FB10006389053B9BB28B421CD8237B0F2B19D8E2 -:10FB2000617B42EA050331EA030311D191B1A37B62 -:10FB3000012B0FD8E37B012B0CD8237C012B09D898 -:10FB4000EBF78DFD40B12046BDE83840EEF7ECB84C -:10FB5000112038BD1220FCE74220FAE7DC4D0021DD -:10FB6000FFFE0F002DE9F041454B04469B691B0247 -:10FB700003784CBF02220422EF2B7CD84078EF2878 -:10FB800079D8A378013B1E2B75D866683D4BA6F546 -:10FB9000807199426FD8238B93426CD3B3F5486F31 -:10FBA00069D8A17E4A1E1E2A65D8A28BB2F5805F55 -:10FBB00061D2E78B7A1EFA2A5DD894F82020002AB9 -:10FBC00059D094F82120012A55D894F822E0BEF1AA -:10FBD000010F50D894F823506A1E062A4BD894F887 -:10FBE000242002F1FF3CBCF10E0F44D894F825C04C -:10FBF000BCF10F0F3FD894F82680B8F1010F3AD826 -:10FC0000BEF1000F08D140F2E24E0EFB03F3B3FB4E -:10FC1000F6FE06FB1E3373BBBCF1000F02D01120B1 -:10FC2000BDE8F081072DFAD00829F8D8164E3368C0 -:10FC3000DB8DBB42F3D3042AF1D86A439142EEDB59 -:10FC4000EBF75EFAC8B1326892F83E3092F83F2086 -:10FC5000002B14BF03230123002A14BF0422002217 -:10FC6000134394F8202032EA0303D8D12046BDE89C -:10FC7000F041EEF76BB93020D2E74220D0E700BF69 -:10FC800020500021FFFE0F00DC4D0021EEF728BAC6 -:10FC90002DE9F041027D0446531E0F2B0E4602D97A -:10FCA0001220BDE8F081654B1B6893F83530934214 -:10FCB000C0F0C280012300211D460A2791422DD3A6 -:10FCC0002178EF29ECD861680DB9FE29E8D9B1F5A2 -:10FCD000801FE5D2A1680BB9FE29E1D9B1F5801FDB -:10FCE000DED2237B072BDBD8637B012BD8D8A37B09 -:10FCF000012BD5D800210F20A3691D78EF2DCFD877 -:10FD00005F88B7F5805FCBD29D88B5F5805FC7D29D -:10FD10003D43C5D09D7985B91120C2E7A06907FB95 -:10FD20000100B0F802C08088BCF1000F18BF0025A8 -:10FD3000002818BF00230131C0E7DD79002DEBD08A -:10FD40001D7A01310F2D5D7A88BF18720F2D88BF83 -:10FD500058728A4203F10A03CFD800274FF00A08ED -:10FD6000227D97421AD300210A208A422FD140F6E1 -:10FD70009B71238A053B9BB28B4291D8638A053BDA -:10FD80009BB28B428CD800213046520009F0C5FF4F -:10FD900031462046BDE8F041F0F7D6B8A56908FB2A -:10FDA0000755E979A87901F097FC0028B4D0A97922 -:10FDB00011F0F80FB0D1EB794A1E0A40591E1940D4 -:10FDC0000A4323F007031343A6D10137C8E7A76905 -:10FDD00000FB01777D8845B1BB79022B1AD0042B3B -:10FDE0001BD0012B1DD10A35ED00BB8843B1BF7973 -:10FDF000022F18D0042F19D0012F1BD10A33DB009A -:10FE00006768AF42FFF44CAFA5689D42FFF448AF6E -:10FE10000131AAE70B35AD00E7E7AD0105F5347513 -:10FE2000E3E70025E1E70B339B00E9E79B0103F5DE -:10FE30003473E5E70023E3E7092032E7DC4D0021D6 -:10FE40002DE9F0410E460446C27C002152003046A6 -:10FE500009F063FF484B9B691B0223784CBF0222C9 -:10FE60000422EF2B00F2818063684449FF3B8B4200 -:10FE70007BD8A368FF3B8B4277D8237B013B1E2BAB -:10FE800073D8637B013B1E2B6FD8E38993426CD3FD -:10FE9000B3F5486F69D8237C072B66D8637C012BA8 -:10FEA00063D8A37C012B60D8E07C431E0F2B5CD869 -:10FEB00062690021134640F6FB751F78EF2F54D876 -:10FEC0005F88B7F5805F50D29F88B7F5805F4CD2CE -:10FED000DF88AF4249D81F89AF4246D89F7A002FAA -:10FEE00043D0DF7A002F40D01F7B0F2F3DD85F7BA0 -:10FEF0000F2F3AD80131814203F10E03DDD353783D -:10FF0000117B994231D8527B9A422ED800274FF06C -:10FF10000E08E17C8F4209D300220E20914217D1B6 -:10FF200031462046BDE8F041F0F78EB9656908FB1F -:10FF30000755E97AA87A01F0CFFBC8B1AB7A13F084 -:10FF4000F80F15D1EB7A13F0F80F11D10137E0E774 -:10FF5000636900FB02331D7B0DB15D8855B15D7B8C -:10FF60000DB19B8833B10132D8E73020BDE8F08174 -:10FF70001120FBE71220F9E72050002100FF0F00BD -:10FF80001C4B2DE9F041DB6A0646DB070C4625D405 -:10FF90000C20BDE8F0812268D15B32F81320914239 -:10FFA00026D001339D42F6D16368D85BD8F8003083 -:10FFB00093F82230834201D80220EAE7F1F7A8F94A -:10FFC0000028F9D06368D85BF1F7C6F90028DFD1C3 -:10FFD0000135AE4206D900236F00E3E70025DFF8C4 -:10FFE0001880F6E721463046BDE8F041F0F710BA38 -:10FFF0001220CEE720500021DC4D0021F0F7D0B8D0 -:020000040103F6 -:10000000F0F7BCBCF0F78CBC38B504460D4603F0E5 -:1000100059FC0C4B1B6893F82230A34206D87F236F -:1000200002242B7003F05AFC204638BD2046F1F71D -:100030006FF90028F3D02046F1F798F900242870D2 -:10004000F0E700BFDC4D002170B506460C461546B2 -:1000500003F038FC104B1B6893F82230B34206D8EB -:10006000E22302242B7003F039FC204670BD304699 -:10007000F1F74EF90028F3D0012C03D9E223122422 -:100080002B70F0E724B93046F1F77CF92870EAE7E5 -:10009000142300242B70E6E7DC4D002138B504461C -:1000A0000D4603F00FFC0B4B1B6893F82230A34264 -:1000B00004D8022403F012FC204638BD2046F1F794 -:1000C00027F90028F5D020462946F1F709FC00243D -:1000D000F0E700BFDC4D002170B504460E46154622 -:1000E00003F0F0FB0D4B1B6893F82230A34204D8B9 -:1000F000022403F0F3FB204670BD2046F1F708F917 -:100100000028F5D0042D06D820462A463146F1F7BE -:1001100041FC0024EDE71224EBE700BFDC4D002199 -:1001200038B505460C4603F0CDFB0E4B1B6893F823 -:100130002230AB4204D8022403F0D0FB204638BD65 -:100140002846F1F7E5F80028F5D02846F1F726F91A -:10015000030A20706370030C000EA370E07021711D -:100160000024E9E7DC4D002173B51D46104B044621 -:100170001B68164693F82230834202D8022002B050 -:1001800070BDF1F7C5F80028F8D00A4B25F0784289 -:100190003340134309D19DF818302046009332466E -:1001A0002B46F0F74BFE0020E9E71220E7E700BFFF -:1001B000DC4D002141FBF7FFF8B52A4E04463368B9 -:1001C0000F4693F8222093F835301344984202DB0F -:1001D00002252846F8BD824218D9F1F799F800287F -:1001E000F6D03368062093F82230A3422DD903F0CD -:1001F000B1FB0146C0B141F2017304804380077135 -:10020000C480194B187B03F0B6FB0DE0F1F78AF8B8 -:1002100005460028E5D12046F1F796F800B30820FE -:1002200003F098FB064608B90025D2E72046F1F70F -:1002300081F842F2017373800B4B3080F480377188 -:100240003146187B03F097FBC3E703F083FB0146BD -:100250000028E9D041F20F73048043800771D0E792 -:100260000C25B6E7DC4D00216850002170B51D4B10 -:1002700006461B680D4693F82230834202D80224BA -:10028000204670BDF1F744F80028F8D0152130461B -:10029000F0F77EFD012801D10C24F1E73046F1F79B -:1002A0005BF8012803D1104B9B6A9B07F4D52846C5 -:1002B000F0F744FD04460028E2D1102003F04AFB89 -:1002C00001460028DCD041F2015343802B680680B0 -:1002D00043606B688360AB68C360044B187B03F0BA -:1002E0004AFBCDE7DC4D0021205000216850002161 -:1002F00070B5184B06461B680D4693F822308342B2 -:1003000002D80224204670BDF1F702F80028F8D088 -:1003100001213046F1F796F8D0B12846F0F70EFDEE -:1003200004460028EED1102003F014FB01460028FB -:10033000E8D041F6015343802B68068043606B6828 -:100340008360AB68C360044B187B03F014FBD9E7F0 -:100350000C24D7E7DC4D00216850002138B5134B41 -:1003600004461B680D4693F82230834201D80220D0 -:1003700038BDF0F7CDFF0028F9D001212046F1F774 -:1003800061F880B1062003F0E5FA01460028EFD0BD -:1003900041F601634380064B04800571187B03F02E -:1003A000EAFA0020E4E70C20E2E700BFDC4D002180 -:1003B0006850002110B5124B04461B6893F8223098 -:1003C000834201D8022010BDF0F7A2FF0028F9D027 -:1003D0001C212046F0F7DCFC01280FD0042003F09C -:1003E000B9FA01460028EED041F601434380054B9F -:1003F0000480187B03F0BFFA0020E4E70C20E2E75A -:10040000DC4D002168500021F8B51E4F05463B68C1 -:100410000E4693F822301446834201D80220F8BDDC -:10042000F0F776FF0028F9D01F212846F0F7B0FC3E -:10043000012822D0A6F11B03E02B20D8B4F5A47F1D -:100440001DD33B681B79082B94BF40F6480344F248 -:1004500090239C4213D8082003F07CFA0146002820 -:10046000DDD041F601734380074B05808680C48050 -:10047000187B03F080FA0020D1E70C20CFE7122090 -:10048000CDE700BFDC4D002168500021024B5A88A7 -:1004900002809B880B807047B4500021A0F11B03A1 -:1004A000E02B18D8B1F5A47F15D30D4B1B681A7932 -:1004B000082A94BF40F6480244F2902291420AD89A -:1004C000DB8CFB2B28BFFB23834206D3054B5880D4 -:1004D000998000207047302070471120704700BF7E -:1004E000DC4D0021B450002110B5074C2468E48C89 -:1004F000FB2C28BFFB2404800E34E4000C80008811 -:1005000010800A881A8010BDDC4D00212DE9F843C7 -:10051000284B15469A6A0446D70302D40C20BDE83E -:10052000F883421E062A42D8AA1E232A3FD8002753 -:10053000C60744BF83F8411083F84450A00744BF66 -:1005400083F8421083F84550DFF86C806207DFF8CB -:100550006C9044BF83F8431083F84650D8F80030BD -:10056000BEB293F82230B34201D80020D7E730461C -:10057000F0F7CEFEC8B13046F0F7EEFE012814D1F8 -:1005800021213046F0F704FC0128C7D0062003F0F3 -:10059000E1F9014648B142F201130680438004713B -:1005A000457199F80C0003F0E6F90137D6E71220FF -:1005B000B5E700BF20500021DC4D0021685000212C -:1005C00070B505460E4603F07DF9104B1B6893F895 -:1005D0002230AB4204D8022403F080F9204670BDDB -:1005E0002846F0F795FE0028F5D0094B9B6ADB03FF -:1005F00001D40C24F0E72846F0F7AEFE04460028AC -:10060000F7D131462846F0F70BFFE5E7DC4D002136 -:1006100020500021014B1B68D88C7047DC4D002115 -:10062000024B1B6893F82300704700BFDC4D00218C -:10063000034B1B780BB903F095B9F0F7DBBD00BF96 -:10064000B4500021F0F744BEF0F760BE10B5134B74 -:1006500004461B6893F82230834201D8022010BD63 -:10066000F0F756FE0028F9D02046F0F7A3FE43012C -:1006700011D5062003F06EF901460028EFD042F2B2 -:100680000133438002230371054B0480187B03F080 -:1006900072F90020E3E71A20E1E700BFDC4D0021FA -:1006A0006850002101282DE9F843054635D8F1F7B7 -:1006B00075F8044648B91A4A012D92F8403014BF23 -:1006C000013303F1FF3382F840300027DFF8548014 -:1006D000DFF85490D8F80030BEB293F82230B3421D -:1006E00002D82046BDE8F8833046F0F711FE90B1FD -:1006F0003046F0F75FFE43010DD5062003F02AF9DE -:10070000014640B142F2013306804380057199F8F9 -:100710000C0003F030F90137DCE71224E1E700BFF9 -:1007200020500021DC4D002168500021F8B50E4614 -:1007300016210546F0F72CFB012802D10C24204697 -:10074000F8BD1A4B1B6893F82230AB4201D8022443 -:10075000F5E72846F0F7DCFD0028F8D02846F0F74A -:10076000FBFD04460028E9D1304602F07EFF104B25 -:10077000D3E90E7607400E403846314601F0F7F9CE -:10078000012810D9102003F0E5F801460028D6D042 -:1007900041F20163C0E902764380064B0580187B75 -:1007A00003F0E9F8CBE71224C9E700BFDC4D0021D4 -:1007B00020500021685000212DE9F843304B0446B9 -:1007C0009B6A0F465B0654BF0125032501F0B8FA6A -:1007D000002851D02288B2F5804F03D91226304626 -:1007E000BDE8F88363889A42F8D3032BF6D92379BE -:1007F000012BF3D813B9A379AB42EFD86379AB429D -:10080000ECD83846F0F79AFA0028E7D1607901F081 -:100810007FFA0028E2D0A06802F03AFF0246814643 -:100820000B46A0798846F1F765F9064630BB2820CB -:1008300003F090F805460028D1D040F2031343801E -:10084000796800F1040C38682388ACE80300B868C4 -:100850002946CCF800002B8263886B8263796B7524 -:100860002379AB75A379C5E9069885F82030054B47 -:10087000187B03F080F8B2E70C26B0E70B26AEE752 -:100880002050002168500021042008B503F062F8D0 -:10089000014678B1084B93F83330002B14BF09237D -:1008A000032383700223C370044B187BBDE8084008 -:1008B00003F061B808BD00BF20500021685000213E -:1008C0000C4A08B5926A0346520654BF012203221D -:1008D000407890420BD89978914208D81B78012B28 -:1008E00005D801F015FA003818BF012008BD002016 -:1008F000FCE700BF20500021438802889A4204D3BD -:10090000032B94BF00200120704700207047000097 -:100910002DE9F84F04468946007A0021164601F079 -:1009200026F9DFF868810546D8F828A001F014FA06 -:10093000002800F0A68098F80470002F40F0A180F5 -:100940004FEADA134FEA5A2A03F002030AF0040AC4 -:10095000227A43EA0A0343F0010332EA030340F038 -:1009600092801AB912273846BDE8F88F2046FFF763 -:10097000A7FF0028F6D0BA464FF00C0B554555D8C6 -:100980004FF0000A88F80CA0257A15F001055CD01C -:100990005046F2F73FFD98F80C3032460133494695 -:1009A000504688F80C300125F2F748FD217A11F005 -:1009B000020153D00C22002102FB05620120F2F754 -:1009C0003DFD0135217A022011F0040A4BD0F2F7E7 -:1009D00021FD0C2298F80C3002FB0562013388F8E7 -:1009E0000C3009EB85010220F2F728FD606802F067 -:1009F0004FFE237806460D46002B39D0182002F012 -:100A0000A9FF01460028AED040F2091343802378A5 -:100A1000037163784371A378C0E902658371237A17 -:100A200003741B4B187B02F0A6FF9CE70BFB0A60CC -:100A3000F0F784F9002895D109EB8A00FFF75CFFF5 -:100A400000288FD00AF1010A98E72846F2F7ECFC5B -:100A5000324629462846F2F7F1FCA7E73246012044 -:100A6000F2F7ECFCAEE7F2F7DFFC32465146BAE7AC -:100A700002460B46A078F1F73DF80028BED00B27C0 -:100A800071E70C276FE711276DE700BF20500021A9 -:100A90006850002110B51B210446F0F779F90128B0 -:100AA0000FD12046F0F734FC08B90C2010BD2046C9 -:100AB000F0F790F90028F8D02046F0F79BF90020D5 -:100AC000F4E70E4B1B6893F82230A34201D80220B2 -:100AD000ECE72046F0F71CFC0028F8D0042002F0D8 -:100AE00039FF01460028E1D041F601334380044B31 -:100AF0000480187B02F03FFFE1E700BFDC4D0021DE -:100B0000685000211D4B30B59A88C46A013258885C -:100B100092B29A8008B182422ED201292CD0187844 -:100B2000012829D193F8C2116278914224D1D4F8D6 -:100B30009C1093F8C1510A7822F0200295421BD1F3 -:100B400093F8C0514A78954216D193F8C311227B8D -:100B5000914211D1D3F8D021D3F8CC1100FA02F58B -:100B6000013202F01F02C3F8D021054A0D42054BA5 -:100B700018BF1346A36030BD0020FCE7F04D0021F4 -:100B800055555500AAAAAA0010B50F4B29B1042942 -:100B900014D05A8901325A8102E0DA880132DA80AF -:100BA0005988DA881C89588919B122440244914233 -:100BB00008D91878831E5842584110BD1A8901324D -:100BC0001A81EDE70020F8E7F04D00214FF40A729A -:100BD0000021014809F0A1B8F04D0021034610465C -:100BE00010B400F8021B5370072922D8DFE801F087 -:100BF0002B0409210C0F12151A460F2110BC09F005 -:100C00008CB81A465521F9E71A46FF21F6E71A462D -:100C10000021F3E71A46F021F0E71A46AA21EDE792 -:100C2000092400F8012B013C05D1013BDBB2FF2B6D -:100C3000F6D110BC704782EA1211090201F48071EA -:100C400041EA5202EFE740F2FF12EEE7022916D026 -:100C5000032917D10530012A0BBF0001800100F5DF -:100C6000BF7000F5C870094A00F26930A0FB0202AB -:100C7000830F40F2712043EA8203584370470B30E0 -:100C80008000F0E70A30C000EDE700BFE3361A004D -:100C900050B10B2802D80138C0B270470C2805D0DB -:100CA000262805D80238F7E7252070472620704708 -:100CB000272070472DE9F3477D4C05462378012B0B -:100CC0000DD87C4F3A6852B93A7942B9012B0AD112 -:100CD000027994F8C131032A03D1032B03D00C26E7 -:100CE00005E0032BFBD0AB78272B04D93026304608 -:100CF00002B0BDE8F0872B79072BF7D86B795A1E25 -:100D0000032AF3D8022B08D0033B012B09D8BB6A76 -:100D100013F4006F05D11126E9E7BB6A13F4807F55 -:100D2000F8E7AE79002EF6D10DF106000DF10701BE -:100D300004F056FF95F910007E2816D07F2817D1B1 -:100D40009DF807302B74237813B95B4A63605360B6 -:100D5000287903281DD1012584F8C101257001F0EF -:100D60001DFF3D7200F0A4FFC1E79DF80630E9E7E2 -:100D700000F17E03DBB2922BB8D89DF90730834295 -:100D8000C9DB9DF906308342C5DC04F05FFF28749F -:100D9000D9E702F097FDEB78002284F8C0312B7977 -:100DA00084F8C131A878FFF773FF84F8C2016B792A -:100DB000013B032B08D8DFE803F0026B746D0123BD -:100DC00084F8C331A4F8C4212B7C4FF0000984F8C7 -:100DD000D4314FF0FF33C4E9733902F07FFD23783B -:100DE000012B84D049462C22344808F096FF40F26B -:100DF000011A49464FF00209DFF8C4804FF4C0726F -:100E0000404608F08AFF2B882E4A63802E4B94F8C8 -:100E1000C311A36294F8C23194F8C00184F8413040 -:100E20002A4B84F84D10C4E9112394F8D43194F876 -:100E3000C42184F84230264B84F84E2084F84C10AC -:100E4000C4F8D830C4F8388084F82690A4F8E0A01C -:100E5000FFF7FCFEA4F8E200504602F0E9FC02466F -:100E6000C4F8DC0010B32979E878FFF7B7FEB4F8CE -:100E7000E230C4F8C831012323703B7200F018FF40 -:100E8000484601F08BFEA8F1340002F075F82EE719 -:100E9000022395E7032384F8C3310123A4F8C43166 -:100EA00092E7032384F8C3310223F7E71F261EE7E6 -:100EB000F04D002120500021F44D0021FC4D002177 -:100EC000304E0021294176715D10030155555500C2 -:100ED000050B03012DE9F041404F06463B68002B0E -:100EE00076D13F4C3B792278134371D18378272BFD -:100EF00070D8C3785A1E022A6CD80279012A69D8A0 -:100F0000022B5BD0032B5FD07579002D5AD12C2298 -:100F10002946344808F001FF334B4FF4C07218469D -:100F2000294608F0FAFE3388A0636380022384F820 -:100F300026302E4B2E4AA362012384F84030B0782D -:100F4000FFF7A6FE2B4B84F84100C4E91123F37888 -:100F5000022B03D0032B01D0012B01D184F84D309B -:100F60004FF47A7240F2011094F84D3084F84C300E -:100F7000214B1B689B8FA4F8E4005343C4F8D8307E -:100F80001E4BC4F8DC3002F053FCC4F8E00018B388 -:100F900001234FF002083B7284F8008000F088FEC5 -:100FA0000023174E40466360736001F0F7FD06F1C1 -:100FB000080001F0E1FF2846BDE8F081BB6A13F4A8 -:100FC000807FA1D11125F6E7BB6A13F4006FF8E723 -:100FD0000C25F0E73025EEE71F25ECE72050002137 -:100FE000F04D0021FC4D0021304E0021491103013C -:100FF0002941767155555500DC4D0021890B0301BF -:10100000F44D002138B5124D04462B78012B0DD13B -:1010100095F8C10103280DD1002401F0D5FD0D4B39 -:101020002C701C7200F04CFE204638BD022B0DD1F6 -:1010300001F01AFE0323084A2B701CB1134603CBA0 -:1010400020606160002068605060EEE70C20ECE7F3 -:10105000F04D002120500021F44D00212DE9F041F8 -:10106000364C0746A388628801339BB2C56AA380C9 -:1010700022B1934202D30020FFF7C4FF2378D5F8B2 -:101080009C60012B3AD194F8C2216B78934215D120 -:10109000337894F8C11123F0200399420ED194F8CB -:1010A000C0117378994209D194F8C3112B7B9942EE -:1010B00004D1B4F8C411AB7B99421AD000236A70F2 -:1010C00094F8C3116973297394F8C421EB73AA735C -:1010D00094F8C08108F102034046A5F8A030FFF75C -:1010E000B5FDA5F8A2003246404694F8C111FFF7BD -:1010F00075FD3846BDE8F04101F03EBF304602F0D4 -:10110000BDFB022001F060FD207804280CD102F024 -:1011100021FC014680B140F205134380084BBDE835 -:10112000F041187B02F027BC0023064A237013729B -:10113000BDE8F04100F0C4BDBDE8F081F04D0021F4 -:10114000685000212050002170B51F4C0546628870 -:10115000C66A4AB12189E3880B4461890B449A42EB -:1011600002D80020FFF74EFF2378022B04D1284637 -:10117000BDE8704001F000BFD6F8A00002F07EFB91 -:10118000D4F8240220B102F0EDFB0023C4F824328D -:10119000022001F019FD207804280CD102F0DAFBBE -:1011A000014680B140F205134380084BBDE8704012 -:1011B000187B02F0E0BB0023054A23701372BDE8E0 -:1011C000704000F07DBD70BDF04D002168500021E1 -:1011D0002050002108B5C07810B101280DD008BDFD -:1011E0000A4B1B7A002BFAD0FFF70CFF084B1A783A -:1011F000032AF4D104221A70F1E70023044A137081 -:10120000024A1372BDE8084000F05ABD2050002188 -:10121000F04D0021024BC3F8CC010020704700BF05 -:10122000F04D002108B5FFF7D1FC054B054A5A6186 -:10123000054B064A5A61BDE80840DBF717BA00BF04 -:10124000040D0021CD0B0301B00C0021D5110301C9 -:101250002DE9F0410F461821044690461D46EFF750 -:1012600097FD012803D10C263046BDE8F0812046C9 -:10127000F0F7ECFA0128F6D0194B1B6893F82230EE -:10128000A34201D80226EFE72046F0F741F80028F4 -:10129000F8D02046F0F760F806460028E3D11E207B -:1012A00002F058FB01460028DED041F6010304801D -:1012B00043803B6800F10E0243607B68A0F80C801D -:1012C00083602B4605F1100053F8044B834242F82B -:1012D000044BF9D1034B187B02F04DFBC4E700BF70 -:1012E000DC4D00216850002108B50A4604F0E8F9F9 -:1012F000002008BD38B51A4B05461B680C4693F80C -:101300002230834201D8022038BDF0F701F80028CE -:10131000F9D02846F0F720F8012801D00C20F3E797 -:1013200002212846F0F78EF80028F7D0142002F0AA -:1013300011FB01460028E7D041F601134380234604 -:101340000580021D04F1100053F8044B834242F85B -:10135000044BF9D1034B187B02F00DFB0020D3E7BF -:10136000DC4D00216850002110B5154B04461B6868 -:1013700093F82230834201D8022010BDEFF7C8FF56 -:101380000028F9D02046EFF7E7FF012801D00C2014 -:10139000F3E702212046F0F755F80028F7D00420A3 -:1013A00002F0D8FA01460028E7D041F60123438035 -:1013B000044B0480187B02F0DEFA0020DDE700BF5A -:1013C000DC4D00216850002138B50D4B04461B68E8 -:1013D0000D4693F82230834201D8022038BDEFF742 -:1013E00097FF0028F9D02046F1F74AFC054BA0FBF7 -:1013F0000303800D40EA832028800020EEE700BF31 -:10140000DC4D00216766060038B50D4B04461B68AD -:101410000D4693F82230834201D8022038BDEFF701 -:1014200077FF0028F9D04DB10A2120466943F1F732 -:1014300033FC002814BF00201E20EFE71220EDE748 -:10144000DC4D002138B50B4B04461B680D4693F864 -:101450002230834201D8022038BDEFF759FF00281F -:10146000F9D029462046EFF7D5FC002814BF00200C -:101470000C20F1E7DC4D0021014B1B68988D704773 -:10148000DC4D0021024B1B6893F82A00704700BF17 -:10149000DC4D0021F2F7FABC38B504460D46F2F7F0 -:1014A0001BFD28B129462046BDE83840FEF7ACBDFB -:1014B00038BD0000034B1B780BB902F053BAF2F7AA -:1014C00067BA00BFDC500021F2F7FCBAF2F73EBB6E -:1014D000F2F73EBBF2F7A3BBF2F724BEF2F7A8BBCC -:1014E000F2F726BCF2F757BC08B5F2F776FC0020FD -:1014F00008BDF2F79BBCF2F7A1BE4BF23F52431E70 -:101500009BB2934201D8F2F7A3BE122070470000AD -:1015100038B504460D4600F01FFCA0B1B4F5706F5D -:1015200013D22046E9F7E8F888B10B4B5B6ADB067B -:1015300003D405F00303032B0BD020462946E9F71B -:10154000C1F9002038BD0C20FCE71220FAE7422048 -:10155000F8E71120F6E700BF6850002170B5044697 -:101560000D46164600F0F8FB30B1324629462046BB -:10157000BDE87040F3F7EEBB0C2070BD70B50446BB -:101580000D46164600F0E8FB30B1324629462046AB -:10159000BDE87040F3F72ABC0C2070BD2DE9F04186 -:1015A00007460C4615461E469DF8188000F0D4FBF1 -:1015B000D8B1032C1ED8104B5B6ADB0601D4032C78 -:1015C00016D0B5F5FA7F15D243F6F672A6F10A03E6 -:1015D0009BB293420ED833462A4621463846CDF870 -:1015E0001880BDE8F041F3F745BC0C20BDE8F08160 -:1015F0001120FBE71220F9E76850002170B504467E -:101600000E46154600F0A8FBB8B1032C19D80E4BB6 -:101610005B6ADB0601D4032C11D0B6F5FA7F10D239 -:1016200043F6F672A5F10A039BB2934209D8002053 -:10163000064BDC751E835D8370BD0C20FCE711201A -:10164000FAE71220F8E700BF68500021B4500021EB -:1016500030B541EA020424F0070420F003052C43CE -:1016600008D1022B06D80D4B9B691C0604D518B96E -:1016700091420ED0112009E000F001030B430AD083 -:10168000830704D4002A14BF0020122030BD00209C -:10169000FCE70029F6D11220F8E700BF2050002116 -:1016A00070B50C4B04461B680E4693F82230154665 -:1016B000834201D8022070BDEFF72AFE0028F9D03E -:1016C0002046EFF783FE30702046EFF78BFE287040 -:1016D0000020F0E7DC4D00210B4B10B59A6AD405D1 -:1016E00002F4807303D440EA0104A40707D413056D -:1016F00007D4084380F00400C0F3800010BD1846F2 -:10170000FCE70120FAE700BF2050002170B50D462C -:101710000646114628461446FFF7DEFF98B100231F -:10172000224629463046FFF793FF58B916F0010FBD -:1017300018BF002516F0020F18BF0024034B1E75BA -:101740005D759C7570BD1120FCE700BFB450002191 -:101750002DE9F8431D46244B80461B680F4693F83D -:10176000223016468342BDF8209003D8022420463A -:10177000BDE8F883EFF7CCFD0028F7D020214046E4 -:10178000EFF706FB01282AD029463046FFF7A4FFD1 -:1017900038B34B462A4631463846FFF759FF0446D0 -:1017A0000028E4D117F0010F18BF00260A2017F017 -:1017B000020F18BF002502F0CDF801460028D6D050 -:1017C00042F201034380094BA0F800800771467183 -:1017D0008571A0F80890187B02F0CDF8C7E70C24BB -:1017E000C5E71124C3E700BFDC4D0021685000218C -:1017F00001282DE9F34104460D4616461F4627D819 -:10180000DFF85080D8F8003033F0FF0304D098F8A8 -:10181000313043B10C2014E098F80430002BF6D19D -:101820000D4B1B6883B9284601F032FFCDE90067F4 -:1018300002460B462046DAF78DFB002814BF002035 -:10184000072002B0BDE8F08198470028DFD1EAE721 -:101850001220F6E7205000211C500021012870B50D -:1018600004460D4618D8104E336833F0FF0304D0F9 -:1018700096F831303BB10C200FE03379002BF7D1D3 -:101880000A4B1B6853B9284601F002FF02460B467B -:101890002046DAF7CBFB28B9122070BD9847002804 -:1018A000E6D1F0E70020F8E7205000211C5000218D -:1018B00010B50C4C236833F0FF0304D094F831309A -:1018C0003BB10C2008E02379002BF7D1064B1B68B5 -:1018D0001BB9DAF739FB002010BD98470028EDD17D -:1018E000F7E700BF205000211C50002110B504462E -:1018F000DAF724FB2070002010BD30B50446012C1F -:101900000846154685B015D801F0C2FE02460B46C2 -:1019100000200021CDE9020102A920460091DAF75A -:10192000B3FB48B1DDE90223284601F0B7FE0020F1 -:1019300005B030BD1220FBE70220F9E730B50446C0 -:10194000012C0846154685B015D801F0A1FE0246C7 -:101950000B4600200021CDE9020102A9204600919A -:10196000DAF7A1FB48B1DDE90223284601F096FE33 -:10197000002005B030BD1220FBE70220F9E700008F -:10198000012870B5054614D80B4E336833F0FF03B9 -:1019900002D00C24204670BD3479002CF9D1074BBD -:1019A0001B6813B986F83150F4E798470028F9D03E -:1019B000EFE71224EEE700BF205000211C50002169 -:1019C0004AF2B71208B5431E9BB2934203D8F3F70D -:1019D0000FFB002008BD1220FCE700000128F7B52E -:1019E00004460E46154624D8012A22D8124F3B68D9 -:1019F00033F0FF0304D097F831303BB10C2012E0F4 -:101A00003B79002BF7D10D4B1B6873B9304601F0C1 -:101A10003FFE009502460B462046DAF721FB0028E0 -:101A200014BF0020022003B0F0BD98470028E2D187 -:101A3000ECE71220F7E700BF205000211C500021E6 -:101A4000F3F77CBC0B46024670B598B008AD00F1C8 -:101A500020062C4610685168083203C4B24225465D -:101A6000F7D110AC03F120052246186859680833F5 -:101A700003C2AB421446F7D16A461546084B03F140 -:101A80002006144618685968083303C4B342224636 -:101A9000F7D1294608A8F3F767FC18B070BD00BF5E -:101AA0001851002170B5012A0B4698B004D118B026 -:101AB000BDE87040F3F780BC024608AD00F1200697 -:101AC0002C4610685168083203C4B2422546F7D14B -:101AD00010AC03F12005224618685968083303C288 -:101AE000AB421446F7D16A461546084B03F120066F -:101AF000144618685968083303C4B3422246F7D124 -:101B0000294608A8F3F730FC18B070BD1851002121 -:101B100010B5431E00F11F0113F8012F32B98B429B -:101B2000FAD1094B83F82120002010BD064B00F1AB -:101B300020011A4650F8044B884243F8044BF9D16F -:101B4000012382F82130EFE718510021012801D844 -:101B5000F3F766BC1220704710B5044601F0BCFDD7 -:101B60002046BDE8104001F0D1BD01F0E1BD4308C1 -:101B70004A0803F05533C01A02F0553261EB0201F6 -:101B800000F03333800801F0333200F0333089083D -:101B9000181801F0333142EB01024FF00131030913 -:101BA00043EA02731B1842EB121003F00F3300F0EC -:101BB0000F301844A3FB013200FB0120000E7047D8 -:101BC000B0FBF1F0704701380844B0FBF1F070470A -:101BD000024B1B6803B11847184670476850002134 -:101BE000002307B5ADF8043003238DF8070001A8E2 -:101BF0008DF80630FFF7ECFF03B05DF804FB00231F -:101C000007B5ADF8043004238DF807000DEB030091 -:101C10008DF80630FFF7DCFF03B05DF804FB1FB55D -:101C20001C24ADF804008DF8090001A88DF80640C9 -:101C30008DF807108DF80810ADF80A208DF80C30DB -:101C4000FFF7C6FF04B010BD030203F00F3300F02E -:101C5000F0300343180100F0333003F0CC33184365 -:101C6000830003F0553300F0AA301843C0097047D1 -:101C700008B50D4B48220021184608F04EF80346DF -:101C80000A4AD2E90801C3E90A0105A1D1E9000124 -:101C9000C3E906014FF0FF301F21C3E90E0108BD63 -:101CA000405C4600000000FE2050002168500021EA -:101CB000024A537A01335372704700BF205000210B -:101CC000024A537A013B5372704700BF20500021F3 -:101CD000024A937901339371704700BF205000216D -:101CE000024A9379013B9371704700BF2050002155 -:101CF000024AD3790133D371704700BF20500021CD -:101D0000024AD379013BD371704700BF20500021B4 -:101D1000032806D8013802280ED8DFE800F0070DA6 -:101D20000700A0F1FF03584258417047034B587C0D -:101D3000003818BF01207047012070472050002153 -:101D4000044B93F833201AB9012083F8320070470E -:101D50000020704720500021044B93F832201AB91C -:101D6000012083F833007047002070472050002185 -:101D700000221346F0B5D0E90076C3F12005A3F1A7 -:101D8000200427FA03F106FA05F5294326FA04F49C -:101D90002143C90744BF81180B7203F1010348BFF7 -:101DA0000132252BE9D180F82D20F0BD028EF8B547 -:101DB000044682EA01001D46FFF746FF00EB0010D3 -:101DC000104480B2FFF740FF00EB0010104480B2D7 -:101DD000FFF73AFFD4E9003700EB0010111889B281 -:101DE000618651404DF668524A43520D02EBC200E3 -:101DF00002EB80028A1A92B2C2F12006A2F1200000 -:101E0000D34007FA06F6334327FA00F00343DB0713 -:101E100009D494F82D305943090C0DB184F83410CD -:101E20002144087AF8BD45B1002304F1080111F8F6 -:101E3000010B904203D184F83430D0B2F2E7013381 -:101E4000252BF4D1F9E738B5024690F83410408ECE -:101E5000FFF7FAFE138E00EB001092F82D50184495 -:101E600080B283EA0004A5F10A035B100B2BA8BF24 -:101E70000B23082D50868CBF0320681F012BB8BF91 -:101E800001238342B8BF0346A5EB430000FB044493 -:101E9000C81800EB244080B2B0FBF5F305FB13003B -:101EA00082F834001044007A38BD000007B50E4AAD -:101EB000937B0BB900B19073537B8BB1013BDBB2C9 -:101EC00053736BB90093ADF8043018238DF80230CA -:101ED000937B68468DF803308DF80430FFF778FE69 -:101EE00003B05DF804FB00BF20500021002307B5BC -:101EF0000193192301A88DF80630FFF769FE03B09E -:101F00005DF804FB4FF4B8130360FFF761BE4FF4B4 -:101F100000130360FFF75CBEF0B589B014460746B6 -:101F20000E461A22002101A81D4607F0F6FE1E23C8 -:101F30008DF8063023888DF80870ADF80C30237AC0 -:101F4000ADF80A608DF814306389ADF81630237B44 -:101F50008DF8183005B1657B237CE289A11C0DF159 -:101F60000E00ADF81A208DF81C308DF8195001F0D4 -:101F700077FB01A8FFF72CFE09B0F0BD002307B5E1 -:101F800000931F23ADF8040068468DF80230FFF778 -:101F90001FFE03B05DF804FB07B50E4AD37A0BB9F8 -:101FA00001B1D172937A013BDBB2937273B91B23F7 -:101FB0008DF80230D37AADF800008DF80500684640 -:101FC0008DF803308DF80430FFF702FE03B05DF8A2 -:101FD00004FB00BF205000211FB50024CDE90144BF -:101FE00003941A24ADF804008DF808000DF10A00DE -:101FF0008DF809108DF8064001F050FB01A8FFF79D -:10200000E7FD04B010BD1D2307B5ADF800008DF845 -:10201000050068468DF802308DF803108DF8041025 -:10202000FFF7D6FD03B05DF804FB10B5222486B09F -:102030000493089BADF804008DF8080001A8ADF8E2 -:102040000640ADF80A10ADF80C200593FFF7C0FD6F -:1020500006B010BD0022044B5A70044A126892F870 -:1020600035201A70704700BFB0500021DC4D0021B0 -:1020700008B50F4B28220021184607F04EFE0D4AE6 -:10208000126892F8231092F82420017042701B22EB -:1020900042804FF4A4728280032202750A22428396 -:1020A0004FF00112C2614FF44862828408BD00BF44 -:1020B000B4500021DC4D002108B5084B1C22002142 -:1020C000184607F02AFE064A1268528D0280032243 -:1020D00002754FF4FD52028308BD00BFDC500021A1 -:1020E000DC4D002110B5074C1022002104F108003E -:1020F00007F013FE2346044A1068516803C3072300 -:10210000237210BDF85000219ABB03014FF4617295 -:10211000024B1A6000221A71704700BF1051002153 -:102120000022044B83F8202083F8212083F822200A -:10213000704700BF1851002110B50B4C80220021C0 -:10214000204607F0EAFD7F231822002104F1100049 -:1021500084F87B3007F0E1FD044BC4E90233072328 -:1021600084F8203010BD00BF4051002100881300CA -:10217000022807D0032808D001280AD1C80000F59A -:10218000837070478800D2307047880100F2664043 -:10219000704796207047022805D0032807D002F127 -:1021A0000800C000704702F1090080007047012953 -:1021B0000CBF02230823D0001B30584300F5BC702D -:1021C00070472DE9F0471D469DF824308146904622 -:1021D0000846BDF820609DF828109DF82C70C3B902 -:1021E000DFB1BFB2BE46E0B940F2011CACEB070361 -:1021F000ACEB0E0C9BB21FFA8CFCB34214D3BA1991 -:10220000484692B2FFF7C7FF044604EB0800BDE85A -:10221000F0874FF0420E7746E5E74FF00A0E0527AC -:10222000E1E783B29C46E8E7B6FBFCF40CFB1466DE -:10223000B6B2002E08BF013C0EEB0C02484692B22B -:10224000FFF7A9FF1FFA84FA05F596740AFB04F458 -:1022500000FB0A44002ED8D0BA19484692B2FFF7C4 -:102260009AFF0444D1E708B5FFF795FF00F5967093 -:1022700008BD00000E4B0246984209D80D4BA2FB48 -:1022800003031E205B085843824210D91E3070475A -:10229000094BA2FB0303032000FB02334FF49670AB -:1022A000C3F38F235843824288BF00F5967070476E -:1022B000C3BF0300121111119E36D0692DE9F04FF2 -:1022C000C76A05463B788846023B85B0072B00F27B -:1022D0001A81DFE813F008002700180118015E00DA -:1022E000AE00FB0010017E7BD7F89C30032E14BF9C -:1022F0004FF4BC744FF4416483B1002197F8C920B6 -:10230000387BFFF748FFD7F8A030963404442BB150 -:10231000032E14BF04F20E2404F6A644EC6005B0AC -:10232000BDE8F08F97F8B020B97B387BFFF733FF1B -:1023300097F8B330044603F00102C3F34006C3F339 -:10234000800333449E1800F0D7FC2044FFF792FF2F -:10235000731E00FB0344D7F89C30002BDED096237D -:1023600073437A7B1819032A14BF4FF4BC744FF4DB -:102370004164D7F8A02004FB0604002ACED0002137 -:1023800097F8C920387B1C44FFF705FF06FB004483 -:10239000C4E797F8B8207E7BD7F8983042BB022E6E -:1023A0001AD0032E1AD144F290224FF46D640261C8 -:1023B000002BB3D0F97B97F8B020002908BF022189 -:1023C000387BFFF7E8FE9634022E204409D0032E16 -:1023D0000AD000F6DE04A1E7EC24E9E74FF4E87444 -:1023E000E6E700F2BE4499E700F58644263495E717 -:1023F000022E1AD0032E1AD144F290224FF43474D4 -:102400000261002B8AD0F97B2422002908BF022117 -:10241000387BFFF7C0FE1022022104F596740444B5 -:102420003046FFF7B8FE044478E72C24E9E750244F -:10243000E7E731BB4FF0F4094FF0F108D7F8A840B7 -:102440003E7BB97B5CB10D223046FFF7A4FE7B7B5F -:10245000022B18D0032B19D000F6DE049634AA6A9A -:10246000C2B1B2F800A01FFA89F9D14514D3B7F868 -:1024700098300D2B2CBF9A440AF10D0A1FFA8AF2EC -:10248000CEE78946DAE700F2BE44E7E700F5864486 -:102490002634E3E79246EAE7BAFBF8F708F11002C0 -:1024A0003046FFF778FE4FF496731FFA88F91FFA4B -:1024B00087FB09FB17A203FB0B4492B200FB0B4402 -:1024C000002A3FF42BAF0D3292B2A9E7836A83B1A1 -:1024D0001A88402A38BF40220023387B0393B97BF7 -:1024E0000092CDE901311A461946FFF76AFE04460B -:1024F00014E74022F0E70023387B0393BA7B009374 -:10250000CDE90132EFE7002408E700002E4B2DE96A -:10251000F74F8446D3F804800346002001914FF022 -:102520000109014613B903B0BDE8F08F5D6925B11B -:102530005A7E012A03D1019A0AB95B68F2E79A68C8 -:10254000DCF80840161BDC68B6FBF8F23444B4FB38 -:10255000F8F4D2B2E4B2A61A0136F6B23F2C0096D5 -:10256000E1D8B5FBF8F515F0FF051ABFC2F140043C -:1025700094FBF5F401244FF0000A1CBF0134E4B2CF -:102580005FFA8AF6B442D8D94FF0000E11E002EBA0 -:102590000E07A7F1200BC7F1200609FA0BFB29FA59 -:1025A00006F64BEA060609FA07F7384331430EF1FF -:1025B000010E009F5FFA8EF6B742E8D82A44D2B2E5 -:1025C0000AF1010ADCE700BFC051002110B5094A39 -:1025D000137B4BB90849906051F8044BA04204D9D1 -:1025E000064951F82330536010BD0133082BF3D155 -:1025F000FAE700BFC0510021A4BB0301C4BB030123 -:10260000F8B5144D0746AB68084616460C2413B9B6 -:10261000FFF7DCFF01E08B4203D1012304FB0754E9 -:1026200009E040F27121B0FBF1F201FB12022AB184 -:10263000002304FB075484F8493002E08342E7D3C7 -:10264000EBD80C2303FB075585F84870C5E9130642 -:102650000120F8BDC05100212DE9F8430D46174671 -:102660009846294B0646186900284AD0436933B179 -:102670000121FFF74BFF254B00245B6809E0406810 -:10268000F2E7C2074FEA500040EAC17048BFE418C1 -:10269000490850EA0102F4D1DFF87090B8F1000F58 -:1026A0001BD04FF00C0808FB069898F84830B3424E -:1026B00013D1D8F8506000F01FFBD9F80420D8F8E7 -:1026C0004C303044B3FBF2F3DAB23F23B3FBF2F306 -:1026D0005843A0422CBF0024241A00F00DFBD9F867 -:1026E00004300744B5FBF3F5E9B23F25B5FBF1F53E -:1026F00007FB0545B5EB831F34BF01200020BDE873 -:10270000F8830446C8E700BFA8530021C051002148 -:10271000F0220021014807F000BB00BFC05100219A -:10272000024640F27120B2FBF0F34343934202D1E0 -:10273000984238BF184670472DE9F04101290646F6 -:10274000DDE9068740F271242ED1B3FBF4F14C434E -:10275000A24288BF1C4600252A461C48964250F8D3 -:10276000041B06D0A14204D38B4202D38D4238BF52 -:102770000D4601320E2AF1D11DB9A34228BF2346CE -:102780001D46134C2378BBB9424629463046FFF715 -:1027900037FF012818D123780436013344F8265036 -:1027A00023708FB13D600FE0B2FBF4F14C43A242C5 -:1027B00088BF04F27124CEE7002342462946304602 -:1027C000FFF74AFF0028DFD1BDE8F081D05100219A -:1027D000C0510021F8B5064640F271208342B1FB9A -:1027E000F0F584BFB3FBF0F0B5FBF0F500245D43DA -:1027F000A94288BFED182346069F16489E4250F80E -:10280000041B06D0A94204D38A4202D38C4238BFAB -:102810000C4601330E2BF1D11CB9AA4228BF2A461F -:1028200014460D4D2B785BB9331D45F82340079BAB -:102830003A46214630461C60FFF7E2FE0120F8BD13 -:1028400001233A4621463046FFF706FF0028F6D01E -:10285000EAE700BFD0510021C051002138B50C2358 -:102860000F4D044603FB0053DA6CAB689A420FD15C -:10287000002318469C4206D005EB8302126912B170 -:10288000904238BF104601330E2BF3D1FFF79EFE66 -:102890000023043445F824302B78013B2B7038BDDD -:1028A000C05100212DE9F04F8DB01C469DF85830E5 -:1028B0008B4601939A4B90461D690A902E462EB97D -:1028C0000A980DB0BDE8F08F7668F8E77369002BC1 -:1028D000FAD03246537E012B01D0536913B95268A6 -:1028E000002AF7D1717E012901D0002103E0002ADE -:1028F0001CBF164600213046FFF708FE019B0990D9 -:10290000032B029165D00C23864A002703FB0B237F -:10291000D96C53683D46B1FBF3F91FFA89F305936F -:1029200001223B46DDF808E00999C2F12004A2F13A -:102930002000D1400EFA04F421432EFA00F00143A6 -:10294000C9071FFA82FC49D59D4201D21D46674640 -:10295000002345E0AC423BD1AC68B068844208D269 -:10296000214600F0CFF96B69B0FBF3F000FB0333B5 -:102970001C446C4BB1685F68611AB1FBF7F0ED68FD -:1029800007FB101700F03F0400F0B6F92435284487 -:102990003844B368634E1844756805FB0404A342C9 -:1029A0008ED0444500F2AE802146404600F0AAF9A0 -:1029B0000C2101FB0B66F36C4146B0FBF3F00130D8 -:1029C000C0B203FB00400DB0BDE8F04F00F09AB973 -:1029D0006D68002DBED128462C46DAE701339BB244 -:1029E0000132402A9ED10C234E4C03FB0B43D3F8FB -:1029F00050A000F081F982446068BAFBF0FA0AF155 -:102A0000010A1FFA8AF306937B1B1FFA83FA00233D -:102A10000E201C4608931FFA89F30B93002D6AD0F1 -:102A20000028B6D0019B012B09D0022B05EB0A0729 -:102A30002AD0BFB207EB0A04C4F34F0403E07B1BA8 -:102A40001FFA83FA5446059B1BB30B9BC4F1400C41 -:102A50009CFBF3FC0CF1010C1FFA8CF34FF0000E01 -:102A600072460793039407991FFA8EF38B423CD367 -:102A7000904284BFE3B20893019B88BFD0B2002B81 -:102A800036D1C5F34F05C9E7069BBFB2FC1AA4B205 -:102A9000D9E70123E2E7039B4B44C3F120018C46B5 -:102AA000A3F120010491099909F1010921FA03F325 -:102AB000029901FA0CF10B43DDF810C0029921FADA -:102AC0000CF10B43DB0748BF0132049148BF92B2BF -:102AD00006991FFA89F39942DDD8059B03990EF1F7 -:102AE000010E19448BB20393BDE74FF00009EFE7E5 -:102AF000013DADB292E700283FF44BAF2846BDF848 -:102B0000204046E74146204600F0FCF80C2101FB3E -:102B10000B66F36CB0FBF3F202FB1300D1E600BFCF -:102B2000A8530021C0510021002310B5044C237389 -:102B300040F2E2435843FFF749FD0123237310BDE0 -:102B4000C051002138B51823074D044603FB00533C -:102B50001B6998470123204685F8813085F880401D -:102B6000BDE8384002F0B3BCB0520021014B186000 -:102B7000704700BF3453002108B502F07FFCBDE868 -:102B8000084084220021014807F0C7B8B052002154 -:102B9000014B5860704700BFB052002138B5094C56 -:102BA000054694F8813023B902F06EFC2846FFF701 -:102BB000C9FF182305FB03331C44636801336360BA -:102BC00038BD00BFB052002110B5182400FB0441ED -:102BD0000B4B19444A68013A4A6093F8811071B16D -:102BE00093F8801081420AD14AB983F8812004FB0E -:102BF00001335B699847BDE8104002F04DBC10BD41 -:102C0000B0520021002370B5164C054684F882307E -:102C100094F88130206083B194F88030AA7E9A4283 -:102C200014D0002284F88120182202FB03435B6940 -:102C3000984794F881304BB905E002F025FC94F8F0 -:102C40008130002BE8D1A87EFFF77CFF1822AB7EF5 -:102C500002FB0344A3681BB12846BDE87040184737 -:102C600070BD00BFB0520021064B186840B1002271 -:102C700018211A60827E01FB0233DB6803B118471A -:102C8000704700BFB0520021014B1868704700BF69 -:102C9000B0520021034B1A6812B1012283F882203E -:102CA000704700BFB0520021014B93F8820070477B -:102CB000B052002110B5094C236833B19A7E182315 -:102CC00002FB0333E35803B1984700232360012339 -:102CD00084F882306368BDE810401847B052002184 -:102CE000014B1B681888704734530021014B1B6847 -:102CF0009878704734530021014B1B68D88870477F -:102D000034530021401A20EAE070704730B518258E -:102D1000044C05FB00400361039BC0E902124361C0 -:102D200030BD00BFB0520021182300FB0333014A1D -:102D3000D1507047B052002120B9064A13690133BF -:102D400013617047022801BF024A5369013353617E -:102D5000704700BF38530021002210B5074C61684E -:102D600062600C22637A207A02FB03431B6A984755 -:102D700020780121BDE8104000F098BE38530021B2 -:102D8000094B70B50C4615460646002170221846C0 -:102D900006F0C3FF06708481C58129462046BDE840 -:102DA0007040D6F77DB800BF385300212DE9F341BC -:102DB000194D6F6847BB05264FF00C086C7A032C41 -:102DC0008EBF00240134E4B208FB04535B6A8DF823 -:102DD00001700197ADF80270CBB101AA0DF10201AB -:102DE0000DF10100984790B1019B9DF801006B60C7 -:102DF00028726C72FFF7A0FF2046019BBDF80220ED -:102E00009DF80110D6F7C0F802B0BDE8F081013E90 -:102E100016F0FF06D3D1F7E738530021042830B568 -:102E200006D80C25034C05FB0040C0E9071243629D -:102E300030BD00BF38530021014B9861704700BF7F -:102E400038530021034B596811B90120FFF7AEBF79 -:102E5000704700BF3853002110B50446084611469C -:102E6000FFF76AFF042C08D80C22064B02FB04343F -:102E7000E36913B1BDE8104018470846BDE81040AB -:102E800000F070BD385300210B684160036008609A -:102E900003680BB158607047014B1861704700BF61 -:102EA000A85300214B6801604360486043680BB140 -:102EB00018607047014B5861704700BFA85300214C -:102EC000074A03685169814206D1536113B1002258 -:102ED0005A6070471361704742685A6013607047C8 -:102EE000A853002110B5044602F086FD00F1190137 -:102EF000A068FFF707FF003818BF012010BD38B5E4 -:102F0000057E0B7E04469D4206D307D142B1904711 -:102F1000231A5842584138BD0120FCE70020FAE747 -:102F20001046F8E770B5134C23695B682361B3B1B1 -:102F300000221A60A3698BB15D6802F05DFD064650 -:102F4000FFF7DAFE2369A269304453B95360A369DD -:102F500023619860A5610DB100232B6070BD636192 -:102F6000E8E711699E6801448E42F7D353601A6006 -:102F7000EDE700BFA85300212DE9F843044602F015 -:102F80003BFD0746FFF7B8FE244D07442B69A760B9 -:102F90003BB9C5E90444C4E90033BDE8F84300F097 -:102FA000A7BA9E68D4F80C80FFF7A6FEA6EB080629 -:102FB000F61B361A002E0BDB2B78022B08D020468E -:102FC0002969FFF761FF2B69A342E6D0BDE8F883CA -:102FD0002E692B69D6F80880B3420DD137695FB1ED -:102FE0004744FFF789FE73680744A7604BB9314631 -:102FF0002046FFF757FFE6E7F768FFF77DFE4744F7 -:10300000F1E79F68D4E90289FFF776FEC844A7EB91 -:1030100008073F1A002FEADA7668DAE7A85300219A -:103020002DE9F74F604E0446356989466DB9C6E90A -:103030000400C0E9005501273369A34217D102F00B -:10304000C3FC00F055FA12E01D46D4E9028AAF68CD -:10305000FFF752FED044A7EB08073F1A002F0FDB03 -:103060003369AB4207D13378022B04D100273846AD -:1030700003B0BDE8F08F29462046FFF705FFDAE7E9 -:10308000A768D5E9028AFFF737FED044A7EB080707 -:103090003F1A002F7BDA3369AB4202D13378022B1F -:1030A000E4D02F467B6873B939464A462046FFF77D -:1030B00026FF0128074673D133699D4246D1A846B1 -:1030C0004FF0000A1CE0D3F80880D4E902ABFFF708 -:1030D00013FEDA44A8EB0A08A8EB0008B8F1000FC9 -:1030E000E2DA4A4639462046FFF709FF0028BDD0FC -:1030F0007F68D7E7D6F81080FFF714FF86F800A0A6 -:1031000033697BB1D3F80890D4E902B30193FFF798 -:10311000F3FD019B9B44A9EB0B09A9EB0009B9F155 -:10312000000FE7DB316921B9C6E90444C4E90011A5 -:1031300002E02046FFF7A8FEA946D9F820306D68C6 -:103140000BB148469847C145F6D175E7A846D5F872 -:1031500000A0DAF804307BB1D3F80890D4E902B3C8 -:103160000193FFF7C9FD019B9B44A9EB0B09A9EB58 -:103170000009B9F1000F04DB51462046FFF792FE2B -:10318000DAE7DAF804804046FFF79AFEE1E76B6879 -:10319000002B7FF459AF29462046FFF783FE4AE70C -:1031A00000287FF449AF61E7A85300212DE9F74FCC -:1031B000876804467B18836088469146FFF792FE35 -:1031C00068B9B9F1000F03DBA76003B0BDE8F08F69 -:1031D00002F012FC0746FFF78FFD0744A760394E47 -:1031E000336933B9C6E90444C4E9003300F080F917 -:1031F0002BE09D68D4F808A0A5EB0A03002B11DB97 -:10320000D4F80CB0FFF778FDDA44A5EB0A052D1AC7 -:10321000002D07DB3378022B04D031692046FFF7FD -:1032200033FE0FE07369A568D3E902ABFFF764FDD5 -:10323000DA44A5EB0A052D1A002D08DB716920463A -:10324000FFF730FE3369A342D0D00120BDE73569D6 -:1032500015B92846A760B8E7D5E902B3D4F808A0A5 -:103260000193FFF749FD019B9B44AAEB0B0AAAEBD4 -:10327000000ABAF1000F06DAD5E902ABFFF73CFD10 -:10328000DA445044A060D4F808B0ABEB070398458B -:1032900016D8994514D36B680BB92946CFE7D3F8F4 -:1032A00008A0E3680193FFF727FD019B9B44AAEB6D -:1032B0000B0AAAEB000ABAF1000F01DB6968ADE75F -:1032C0006D68C5E7A85300212DE9F74F3F4E876889 -:1032D000D6F814A0BD180446894690468560BAF118 -:1032E000000F09D1FFF7FEFDF8B1C6E90444C4E9B7 -:1032F00000AA00F0FDF814E0DAE902BAFFF7FCFCDE -:10330000D344A5EB0B052D1A002D0CDB2046FFF74F -:10331000E9FD50B120467169FFF7C4FD3369A3424E -:10332000E7D0012003E0756925B90020A76003B04C -:10333000BDE8F08F2B681BBBD5F808A0D4F80CB003 -:10334000FFF7DAFCAAEB0B0A3946AAEB0000FFF7FD -:10335000D9FC404528BF40463A188145A26033D881 -:10336000AB689B1A002B2FDB2046FFF7BBFD58B341 -:103370003378022B28D029462046FFF785FDCDE77C -:10338000D3E902ABFFF7B8FCDA445044A060204612 -:10339000FFF7A8FD0028C8D03946A068FFF7B2FCA7 -:1033A000484511D380450FD3D4E902B3D5F808A01E -:1033B0000193FFF7A1FC019B9B44AAEB0B0AAAEB2C -:1033C000000ABAF1000FD6DA2D68ADE7A853002144 -:1033D000144A10B5116904460B4603B910BD9C424E -:1033E00015D05B68F9E7BDE8104000F091B8FFF731 -:1033F00099FD236A002BF1D02046BDE81040184704 -:103400002046FFF75DFD236A002BF6D1E6E78C42EC -:10341000F6D11378012BE6D0022BE8D1BDE810409D -:10342000FFF738BCA8530021044B1A69824204D12B -:103430001B78022B01D000F05BB87047A853002125 -:10344000054B1A69824204D11878023818BF01204E -:1034500070470120704700BFA8530021074B82B07E -:103460005A68511C01F00301019101211A441073A3 -:10347000019A58785A6002B000F018BBA853002196 -:10348000034B1B78022B02D10120FFF7E7BF7047E7 -:10349000A8530021034B1B78012B02D10020FFF71A -:1034A000DDBF7047A85300210F4B70B51E6900F0B7 -:1034B00009FA02F0A1FA0546FFF71EFC2946044668 -:1034C000B068FFF71FFC04F11903984203D200F023 -:1034D00005FA002070BDB0680449001B02F068FACC -:1034E00000F0FCF90120F5E7A85300219534030111 -:1034F00008B5064B1B781BB1012B06D102F064FA0C -:10350000BDE808400320FFF7A9BF08BDA85300216C -:1035100008B5064B1B78013B012B06D802F054FA84 -:10352000BDE808400220FFF799BF08BDA85300215D -:103530000022044BC3E90422C3E906221A701A844C -:10354000704700BFA853002108B52422002103487A -:1035500006F0E3FBBDE80840FFF7EABFA8530021EF -:1035600010B50446FFF7F0FF034B04485C70BDE85C -:103570001040FFF70DBB00BFA853002181340301A9 -:10358000F7B502F039FA03270646314CD4E9012396 -:1035900093420AD05A1C02F003020192019A256953 -:1035A00023441B7BA2605DB9257002F025FA3146E9 -:1035B000FFF7A8FB238C834238BF208403B0F0BD03 -:1035C0002278012A05D0022A25D0E2B9032B1AD18C -:1035D00034E0022B23D0032B32D0A3B90223237073 -:1035E00002F00AFA00F11901A868FFF78BFB10B985 -:1035F000EB7E012B0CD12846FFF704FBFFF754FBB1 -:1036000008B1FFF73DFF2369002BBFD12370BDE751 -:10361000FFF77EFFF7E7012B06D0022BF3D1FFF770 -:1036200081FC2B6A277003E0FFF77CFCEB692770B5 -:103630000BB1284698472369002BE4D0012323705F -:10364000FFF732FF0028DED1FFF724FFDBE700BFE2 -:10365000A8530021014B188C704700BFA8530021CC -:103660000B6803608B888380704703460068596845 -:103670007047110A02704170110C120EC2701A0AC2 -:10368000037142711A0C1B0E81708271C3717047F5 -:1036900003794179006843EA01217047110A0270F9 -:1036A00041700371110C1B0A120E8170C2704371BC -:1036B0007047000010B5074C11448A4201D1C04345 -:1036C00010BD12F8013B4340DBB254F8233083EACB -:1036D0001020F2E7E4BB0301094B0A4A0A49C3E997 -:1036E000001202F1636202F5682202F50D629A602F -:1036F00002F1176202F5FC2202F5BA62DA60704745 -:10370000CC53002115CD5B0733134905074B0268E5 -:103710001968514019605968514059609968514081 -:103720009960D9684A40DA60704700BFCC530021E5 -:10373000084A936810685168536081EAC121D368D0 -:10374000D06080EAD040484080EA11209360106049 -:10375000704700BFCC5300212DE9F74F05460E46B8 -:103760000C2400F0D7F84FF0040B04FB0504DFF83D -:10377000B4802D4BC8F800001D70043600F10C0A0F -:10378000D8F8007000F0CCF820F003000744BC42E9 -:1037900003D9002003B0BDE8F08F002D3BD036F8F0 -:1037A000042C032A20D82AF80CBC3AF80C7C16F812 -:1037B000022C4AE90244BF080AF80A2CBF00012A79 -:1037C000D8F8009018D800F0ABF820F0030081443E -:1037D0004C4506F104060AF10C0ADAD80023013D33 -:1037E0002360EDB23C44CBE793071CBF22F00302F9 -:1037F00004322AF80C2CD8E7019200F091F820F05E -:10380000030081444C45C4D8019AE119013A216072 -:10381000D2B20C46D3E7D8F80000044B201A186047 -:10382000B8E700BFDC530021E4530021E05300213E -:10383000F8B507460E4B1D680E4B1C780CB9264692 -:103840000EE02B88BB420FD300F03CF8AE684EB1BF -:103850003368094AAB6013680133136000F03EF827 -:103860003046F8BD00F03AF8013CE4B20C35E5E72B -:10387000DC530021E4530021E853002138B50E4AFF -:10388000054614780C220D4B1B6802FB04340C3CDB -:10389000A34200D938BD6268AA42F8D800F012F8F5 -:1038A000A368074A2B601368A560013B1360BDE85D -:1038B000384000F013B800BFE4530021DC5300216E -:1038C000E853002110B5044C23780BB903F05CF9E0 -:1038D00023780133237010BDEC530021044A137880 -:1038E000013BDBB213700BB903F050B9704700BF56 -:1038F000EC530021054A0330136820F00300034411 -:103900001360034A1368181A10607047805B002127 -:103910007C5B0021014B1868704700BF805B002171 -:10392000014B1868704700BF7C5B0021034B044AC1 -:103930001868044B9B1A181A704700BF7C5B002163 -:10394000485D002100F0002183071CBF20F0030028 -:1039500004307047083008B580B2FFF769FF00B146 -:10396000083008BD0838FFF789BF02F8041CA2F12F -:10397000080100F03DB938B504460D4600F0C0F826 -:1039800021462A46FFF7F1FF2046BDE838400121D5 -:1039900000F0A6B810B50C4600F03CF910B1037960 -:1039A0000830237010BD006810B1037908300B7027 -:1039B0007047006818B119B903790830137070475F -:1039C00001390068C9B2F5E7F8B500252C46094E63 -:1039D000A6F16C0797F878309D4203D387F87940B9 -:1039E0002046F8BD56F8043B13B198470443E4B2AF -:1039F0000135EFE7605400212DE9F341FFF762FF45 -:103A00000023264C94F8686084F86830FFF766FF5E -:103A1000F10708D504F1600738460DF10701FFF7FB -:103A2000B9FF054630B9B20715D4730719D402B0EF -:103A3000BDE8F0819DF807302946002054F8233076 -:103A400098472846FFF78EFFE6E7037B011D54F8F1 -:103A5000233000209847002000F0D0F90028F4D14E -:103A6000E3E7102400270E4DA5F1400635F8023B90 -:103A70006BB133685BB1FFF725FF35F8028C25F891 -:103A8000027CFFF72BFF0021404633689847013C3A -:103A900014F0FF0406F10406E8D1C8E7F45300214E -:103AA00034540021FFF70EBFFFF718BF38B50446A6 -:103AB0000D46FFF707FF094B04F00F0093F868204D -:103AC000203033F8101042F004020D4383F86820D0 -:103AD00023F81050BDE83840FFF700BFF453002131 -:103AE00010B50C46FFF7EEFE044B93F868100C433C -:103AF00083F86840BDE81040FFF7F0BEF4530021A2 -:103B00000048704754540021044A92F86930591C07 -:103B100042F8230082F8691018467047F4530021D8 -:103B2000044B93F8682093F8793013430CBF0120BD -:103B300000207047F453002108B57C22002104487E -:103B400006F0EBF801F0CAFE024B186008BD00BF9A -:103B5000F4530021F0530021044B93F87820511CBA -:103B600083F8781003EB8203D8667047F453002182 -:103B700073B51D4D1D4E01F0B1FE296801F004FF23 -:103B800009280CD90A23B0FBF3F403FB04F001F07D -:103B9000EFFE2B68034420462B6000F005F9FFF789 -:103BA0002BFF96F879301BB1FFF70EFF0028E2D10A -:103BB00001F094FE296801F0E7FE0928DBD802F045 -:103BC000E3FFFFF7ADFF58B10DF1070000F008F972 -:103BD0009DF8073003B118B10A23584303F050F899 -:103BE00002F0D4FFC7E700BFF0530021F4530021D7 -:103BF00038B5002304460B600D46FFF763FE2368CB -:103C00002BB925606560BDE83840FFF767BE636883 -:103C10001D60F7E738B50446FFF754FE25681DB16F -:103C20002B68236003B96360FFF758FE284638BD50 -:103C300038B504460D46FFF745FE23682B6003B9EF -:103C400065602560BDE83840FFF748BE70B50646A0 -:103C50000D461446FFF736FE336813B17368A3426E -:103C600007D129463046FFF7C3FFBDE87040FFF794 -:103C700035BE24B929463046FFF7DAFFF5E7236859 -:103C80002B602560F1E770B504460D461646FFF738 -:103C900019FE2368AB4209D12B6823606368AB42ED -:103CA00008BF6660BDE87040FFF718BE002EF5D073 -:103CB0002B683360F2E710B50446FFF703FE0022DD -:103CC000236894B201321BB9FFF708FE204610BDED -:103CD0001B68F6E710B50446FFF7F4FD2468FFF70C -:103CE000FDFDB4FA84F46409204610BDD0E900203B -:103CF000131A5842584170470022084B10B51C68EF -:103D000004B910BD844202D022462468F8E7214657 -:103D10000248FFF7B8FF00236373F2E770540021F5 -:103D200038B504460D46FFF7BDFE637B13B1204650 -:103D3000FFF7E2FF012300226373094BA5601B68B4 -:103D400013B19968A94207D921460548FFF77EFFBC -:103D5000BDE83840FFF7A8BE1A461B68F0E700BF71 -:103D6000705400210022024BC3E90022704700BFBB -:103D7000705400214FF47A7359430A230931B1FB7F -:103D8000F3F1FFF7CDBF0A230931B1FBF3F1FFF7E0 -:103D9000C7BF10B50446FFF785FE2046FFF7ACFF0E -:103DA000BDE81040FFF780BE70B500260546FFF75E -:103DB00079FE0A4B1C681CB9BDE87040FFF774BE61 -:103DC000A368AB4203D95B1BA3602468F3E702211D -:103DD000207BA660FFF784FEF7E700BF7054002148 -:103DE000054A0346106808B9187070470121197018 -:103DF00013689868704700BF7054002138B5FFF70A -:103E000051FE0948046854B1A56845B92A462146BF -:103E1000FFF739FF6573FFF747FE204638BDFFF710 -:103E200043FE0024F9E700BF7054002113B518B118 -:103E3000012823D002B010BD02221F4BC3F8082373 -:103E4000C3F80401D3F804210122DA600123984267 -:103E50008DF8073042F2107118BF0023164A08BFD0 -:103E60000DF10703A0B10128E4D123B1D2F80C442D -:103E700004F001041C70D2F80C4411E000220E4B37 -:103E8000C3F80803C3F80021D3F800215860DDE728 -:103E900023B1D2F8184404F003041C70D2F818447B -:103EA000E403C7D513B90139DCD1C3E79DF8074056 -:103EB000012CF8D0BEE700BF00500041044B1A7936 -:103EC00022B9012218601A710248704702487047EF -:103ED000785400210000AD0B0C00AD0B094B1A68A3 -:103EE000920604D4E02283F8052320221A600223DC -:103EF000054AC2F818350123C2F81435034A137075 -:103F0000704700BF00E100E00050004180540021F4 -:103F100008B510B1012829D008BD194BD3F81824D1 -:103F2000D3F81814C9030CD4D3F81424D2070FD52E -:103F3000D3F81C2402F00302022A06D1C3F804239A -:103F4000EAE702F00303022B02D00020FFF76EFF26 -:103F5000022200210A4BC3F81825C3F80411D3F834 -:103F60000411C3F8042301229A60D5E70022044B10 -:103F7000C3F80021D3F80021C3F804031860CBE78D -:103F800000500041114B10B5D3F8002152B1002070 -:103F9000C3F80001D3F800210122C3F808230C4B19 -:103FA0001B689847094BD3F804216AB1BDE810405B -:103FB0000022C3F80421D3F804210222C3F8082305 -:103FC000034B01201B68184710BD00BF0050004183 -:103FD000785400210146014800F044BE60000021F1 -:103FE0000123044A83400146C2F80835024800F024 -:103FF00059BE00BF00F000416000002110B504462A -:10400000074B2146186800F023FE30B10120054B14 -:10401000A040C3F80405044810BD0448FCE700BFF5 -:104020006000002100F000410000AD0B0400AD0B6A -:1040300010B50446074B2146186800F009FE30B160 -:104040000120054BA040C3F80805044810BD0448F2 -:10405000FCE700BF6000002100F000410000AD0B54 -:104060000400AD0B036803F01F020260034A04481A -:104070005B09012B08BF1046704700BF00088C4148 -:1040800000058C41F7B51746DDE90846019001A807 -:104090001D46FFF7E7FF019B002F00EB830014BFD5 -:1040A00002230023002918BF43F00103002D14BF91 -:1040B0004FF00C0C4FF0000C002C43EA0C0314BF23 -:1040C0004FF4706C4FF0000C002E43EA0C0314BF49 -:1040D0004FF4403C4FF0000CD0F8002243EA0C03B0 -:1040E00022EA030301B109780FB13F787F00194339 -:1040F0000DB12D78AD0039430CB1227814020D4377 -:104100000EB1367836042C433443C0F8004203B075 -:10411000F0BD1FB50DF10F03019300238DF80F10B3 -:104120001A4619460093FFF7ADFF05B05DF804FB92 -:10413000034B0C3033F81000C0F34010704700BF41 -:104140006400002170B50D4C00F10C0334F81330FD -:104150000546DA050E4607D5C3F3432304EBC30235 -:10416000526854F83330984723692BB131462846BA -:104170006269BDE87040184770BD00BF640000214F -:10418000124A0C3032F8103010B4D9051BD5C3F3E5 -:10419000432123F4F85322F81030002002F11804D0 -:1041A00034F8023B13F4807F03D0C3F343239942D6 -:1041B00009D001303028F3D10023054810BC42F863 -:1041C000313000F06FBD10BC704700BF64000021AB -:1041D000E000002138B50246FFF7AAFF0B4C02F1C0 -:1041E0000C0560B1002134F815305B0B9B0003F126 -:1041F000824303F52043C3F81015C3F81015104689 -:10420000FFF7BEFF002324F8153038BD64000021FD -:10421000F0B50446164685B019B3344D00F10C07CD -:1042200035F81720930703D4FFF782FF00285AD1EF -:1042300012F01C0F02D04B78012B54D001238DF8C3 -:104240000F3000234A1CCDE9001320468B1C0DF1D2 -:104250000F01FFF717FF35F8173043F0030325F878 -:10426000173016B9224805B0F0BD204A04F10C07FA -:1042700032F81700830736D5002396F800C020F0E7 -:1042800020004FEA8C0101F18241C00401F5204178 -:10429000C00CC1F8103522F81700C1F81035757838 -:1042A000002DDFD0D1F81035B67823F4991323F41C -:1042B000F853C1F81035D1F810E5230203F47C530C -:1042C0002D0443EA0E0305F4403534052B4304F472 -:1042D000801440EA4C30234340F02000C1F81035F0 -:1042E00022F81700BEE70348BDE700BF64000021C5 -:1042F0000000AD0B0400AD0B70B5124D044695F8EF -:104300008060EEB96022314605F1180005F005FD28 -:1043100064010D4BE4B283F80A434FF480621A60E3 -:104320000A4B0B48C3F87C61D3F87C214FF0004264 -:10433000C3F80423012385F880300323EB6770BDA5 -:104340000448FCE76400002100E100E000A0004117 -:104350000000AD0B0500AD0B0146014800F0A2BC0A -:10436000DC0000210146014800F07CBCDC0000219B -:1043700000232DE9F743914601221B4F00F10C0861 -:104380008DF800308DF8023037F818300446DB071E -:104390008DF8012026D44E788D78964206D1019072 -:1043A00001A8FFF75FFE019B9E408660C5B14B7878 -:1043B0008DF804908DF806300B7801AA8DF8053041 -:1043C00069462046FFF724FF084B984205D137F88D -:1043D000183043F0800327F8183003B0BDE8F083AD -:1043E0002A46EDE70248F8E7640000210000AD0B23 -:1043F0000B00AD0B8B7873B506460D46D3B10DF1AE -:104400000700FFF7AFFF0D4B044698420FD1294636 -:1044100030469DF80720FFF7ABFF094B0446984252 -:1044200005D1AB781BB19DF80700FFF795FF20463B -:1044300002B070BDFF238DF80730E8E70000AD0B38 -:104440000B00AD0B07B5019001A8FFF70BFE012390 -:10445000019A9340836003B05DF804FB07B50190B7 -:1044600001A8FFF7FFFD0123019A9340C36003B049 -:104470005DF804FB084B0C3033F810305B0B9B00ED -:1044800003F1824303F52043D3F8102542F00302E1 -:10449000C3F81025704700BF64000021084B0C30A2 -:1044A00033F810305B0B9B0003F1824303F520438C -:1044B000D3F8102522F00302C3F81025704700BF7F -:1044C00064000021034B0C3033F81000400B8000D7 -:1044D0003030704764000021034B0C3033F810007B -:1044E000400B8000603070476400002108B5024630 -:1044F000FFF71EFEC0B10F4B02F10C0133F8113073 -:10450000990711D401225B0B9A400B499B0003F1E0 -:104510008243C1F8082303F52043D3F8102522F085 -:104520000302C3F8102508BD0021BDE8084010466D -:10453000FFF7EFBD6400002100A00041104B00F127 -:104540000C0233F8123013B5DB07044616D5FFF71B -:10455000CDFF2046FFF73EFE01A80194FFF782FD44 -:10456000019B00EB8300D0F8003203F0E04343F0FE -:104570000203C0F80032034802B010BD0248FBE756 -:10458000640000210000AD0B0400AD0B10B5024625 -:10459000FFF7CEFD78B1094B02F10C0133F8114061 -:1045A000640B1046FFF7CAFFFF2C06D02046BDE87B -:1045B0001040FFF7D1BEFF24F3E710BD64000021D7 -:1045C0002DE9F04F002601223446614B61486249D3 -:1045D00087B01D6835B1D0F8045315421EBF1C606A -:1045E0001D68164304338B424FEA4202F1D1594B06 -:1045F000D3F87C31002B00F08E80DFF86081584FBB -:10460000D8F820300493C8F820303B6A05933B6209 -:104610004FF000090DF1100B4FEA4913009348E0E9 -:1046200094FAA4F4B4FA84F4009B4E4A1C4404F1B6 -:104630000C0332F813300122E00804F0070C02FAF0 -:104640000CFC1BF80020C3F3820522EA0C020BF8D5 -:10465000002003A899080394FFF704FD039A4B0771 -:1046600002F1800250F82220AA46C2F301422AD564 -:1046700020465146D5B2FFF765FD03A80394FFF726 -:10468000F1FC039B803350F82330C3F301439D4278 -:1046900007D100212046FFF73CFD29462046FFF7C1 -:1046A00038FD03A80394FFF7DDFC0123039A934030 -:1046B00003625BF82940002CB2D1B9F1000F1AD186 -:1046C0004FF00109A8E7022A0CBF0321022120466E -:1046D0000192FFF71EFD032D04D0019A022A06D194 -:1046E000012DDED151462046FFF72CFDD9E7032AE4 -:1046F000D7D1022DF5E7174BC3F87C41D3F87C31B5 -:10470000D8F820200492C8F820203B6A05933B6229 -:1047100013437FF47DAF012416B907B0BDE8F08FD5 -:1047200096FAA6F3B3FA83F304FA03F29B0003F1BB -:10473000824303F52043D3F81005D3F81015C0F3D6 -:104740000520C1F3014126EA0206FFF7FBFCE3E77F -:1047500000A1004100A0004120A1004100058C41C2 -:1047600000088C416400002110B5094B1C796CB91C -:10477000084C4001C0B284F812034FF4802020603E -:1047800001201871044819609A6010BD0348FCE7C5 -:104790008454002100E100E00000AD0B0C00AD0BE3 -:1047A000002330B50D4A50F8234003F5A2710133C0 -:1047B000102B42F82140F6D10023084A00F14001B5 -:1047C00003F5B27451F8045B0133102B42F8245006 -:1047D000F6D1D0F88030C2F8043330BD002001415A -:1047E0000123800000F1824000F590308B40D0F82A -:1047F00010150B43C0F81035704700000C4B30B457 -:10480000D3F80C0301240246002522B930BC094B21 -:104810001A689968104792FAA2F3B3FA83F304FA7C -:1048200003F122EA010204499B00CD50EDE700BFED -:10483000002001418454002100210141114B10B599 -:10484000D3F80443A2060AD5D3F814213AB10020C4 -:10485000C3F81401D3F814310B4B1B689847630657 -:104860000ED5084BD3F8182152B1BDE810400022F4 -:10487000C3F81821D3F81831034B01201B681847DF -:1048800010BD00BF005000419054002108B5FFF753 -:10489000D5FFBDE80840FFF775BB00002DE9F047E4 -:1048A000002504460E464FF48038A946DFF884A060 -:1048B00000F5A077D4F8043313EA080F0CD03B6856 -:1048C00053B1C4F84883C4F80883C7F800903B6824 -:1048D000E8B25AF8263098470135042D4FEA4808C7 -:1048E00007F10407E6D1D4F80433DA070CD5D4F87D -:1048F00000314BB10023C4F80031D4F800310D4B26 -:10490000284653F826309847D4F804339B070ED531 -:10491000D4F804315BB10023C4F80431D4F8043175 -:10492000044B052053F82630BDE8F0471847BDE892 -:10493000F08700BF9454002100210148FFF7AEBF6B -:104940000010014101210148FFF7A8BF00600141AB -:104950002DE9F843002406460F464FF48038A1465F -:1049600000F5A0752B687BB1D6F8043308FA04F281 -:104970001A4209D0C5F800902B68A30003F5A07374 -:1049800098B2D7E9003198470134082C05F10405A5 -:10499000E8D1BDE8F88300000C23F0B505792D4C73 -:1049A0006B43E71816463A7A002A51D19446E650EE -:1049B0004B687B6047790368D6B2B7423BD8CA7868 -:1049C00043F307365201002EC3F30733D2B23ADB6A -:1049D000214F07EB060C8CF80023012203F01F0384 -:1049E000760902FA03F347F8263003684A78D3F8C9 -:1049F000040502F0030220F003000243C3F804257B -:104A0000D3F808058A7820F0030002F0030202437D -:104A1000C3F80825D3F810050A7820F00F0102F03A -:104A20000F020A43C3F810250C2303FB054401239E -:104A30000A482372F0BD960006F5A07643F806C03A -:104A40009E590132B8E7064E03F00F03F254CCE74B -:104A50000448EFE79C54002100E100E00000AD0BAA -:104A600014ED00E00500AD0B01220C2103681A6073 -:104A70000279034B01FB023302221A72704700BF16 -:104A80009C540021012203681A6101790C20024B19 -:104A900000FB01331A7270479C5400210268012008 -:104AA0008B004033DBB2D05001F5A87152F82100E1 -:104AB000704730B54FF4803400688C4063B10025F6 -:104AC0008B0003F5A073C550C358C0F8044301F52B -:104AD000A87140F8212030BDC0F80843F7E74FF433 -:104AE000803302688B40C2F808337047014902489E -:104AF000FFF72EBF9C54002100C00041014902482D -:104B0000FFF726BFA8540021008001410149024857 -:104B1000FFF71EBFB4540021009001411FB50123CF -:104B20008DF80030044BCDE90110D3E9001268463E -:104B3000904705B05DF804FBC05400217FB5424B9F -:104B4000D3F82421002A5FD00022C3F82421D3F80F -:104B5000241102218DF80010D3F880146846C3F8A0 -:104B600080140391D3F83C350293384BD968C3E9DC -:104B700006220191D3E900129047334AD2F844311A -:104B800073B10021C2F84411D2F844312F4B986917 -:104B900030B1C3E90611D2F83C05D968FFF7BEFF72 -:104BA000294AD2F82031ABB10021C2F82011D2F845 -:104BB00020310123D360254B586958B1D2F84C25D8 -:104BC000684602929A688DF8001001925961D3E903 -:104BD000001290471C4AD2F858319BB10021C2F80C -:104BE0005811D2F85831194B586958B1D2F84C25A0 -:104BF000684602929A688DF8001001925961D3E9D3 -:104C00000012904704B070BDD3F810110029B4D041 -:104C1000C3F81021D3F810210C4A92F82160002E1D -:104C2000ABD1D2E90604D16864B1D3F8005225F0C3 -:104C30002005C3F8005213699461D360D661FFF771 -:104C40006DFF9AE79461FAE700300141C0540021FA -:104C500082B001900198C840C04300F0010002B04A -:104C60007047000030B50268B2FA82F3C3F11F0347 -:104C7000DDB25BB25C1C0FD072B60468A24201D0F8 -:104C800062B6F0E7012404FA03F322EA03020260A9 -:104C900062B602480D7030BD0148FCE70000AD0B64 -:104CA0000200AD0B0368CB40DB070ED4026872B67E -:104CB00003689A4201D062B6F8E7012303FA01F1D2 -:104CC0001143016062B6024870470248704700BF56 -:104CD0000000AD0B0400AD0B0022D30003F1FF7305 -:104CE00003F58033D3F80013013107D0D3F8001354 -:104CF0000132D3F80433202A0B60EED1144BD3F8E1 -:104D00003021072A1AD1D3F83431023B032B0CD8B7 -:104D1000104AD35C4BB1104BD3F80024D10742BFEB -:104D20000022C3F81421C3F818210B4BD3F8002438 -:104D3000D20744BF6FF00102C3F80024074B1A6882 -:104D4000074BC3F84425074B074A1A60704700BF5A -:104D50000000FF01E4BF0301005000410080FF019B -:104D600000600041E80000210090D00380B400AF53 -:104D70001EF0040F0CBFEFF30880EFF3098000F082 -:104D800065B800BFBD4680BC70470000012307B571 -:104D90000093084B11205B68C3F30803103B019399 -:104DA00000F06CFE009B002BFCD1019B03B05DF872 -:104DB00004FB00BF00ED00E008B5174A174B184987 -:104DC0008B421ED30021174B174A93421ED34FF03C -:104DD000AF31164B164A93421BD3164A164B1A6034 -:104DE000164B9B1A164A1360164A174B9A60FFF728 -:104DF00073FF01F0CDFED3F77FFE4FF01800ABBE7E -:104E000008BD52F8040B43F8040BD9E743F8041B20 -:104E1000DBE743F8041BDEE7C8C403010000002100 -:104E20008401002184010021485D002100F000215F -:104E300000000121485D0021805B002100F000217D -:104E40007C5B00210088000100ED00E007B5112027 -:104E500000F014FE01230093054B9B6AC3F38023EB -:104E60000193009B002BFCD1019B03B05DF804FB78 -:104E700000ED00E0002070470020704701207047DF -:104E80000020704700207047002070470346064A04 -:104E90000333106823F00303C118116003490A6843 -:104EA000D31A0B60704700BF805B00217C5B002140 -:104EB00010B5084B044693F82F2093F82E00824239 -:104EC00003D093F8451001F0E7F92046BDE8104003 -:104ED00001F05CBBE8550021022905D0032908D068 -:104EE00001290BD10088704703880089184480B2DB -:104EF000704703880289008A1344F7E7002070474F -:104F000010B50446417E0D4B83F84E10007E01F033 -:104F1000D3FA238B83B1204601F0D6FA04F11000B6 -:104F200001F0DEFA94F8280001F0E4FA94F8290080 -:104F3000BDE8104001F0E4BA10BD00BFE855002103 -:104F40002DE9F743DFF840811F46B8F828301546B1 -:104F500001330646A8F8283018B1C31E012B00F211 -:104F60008E80D8F84830B8F84C401B785A1CA242C2 -:104F7000B8BF03F1090498F84E30A8BF063403B156 -:104F80000434032D39D0042D3AD0012D15BF01343E -:104F90000234E400A400D8F8083001EB030998F8C3 -:104FA000263083B398F810300C44022BC8F81C400C -:104FB0002CD0032B4CD0012B5ED1B8F82C00C0F1C3 -:104FC0009600044480B2C8F81C40FFF771FF032D1F -:104FD00058D0042D14BF00230223042E98BF2B4A5F -:104FE000009394BF905D01204B4600223946D8F8CB -:104FF0000440A04703B0BDE8F08305342401CAE7AC -:10500000A4015034C7E7D8F81C10CBE7D8F8183003 -:10501000586801F013F9D8F81830986801F018F9B9 -:10502000D8F81830587801F019F9D8F81800443039 -:10503000FFF766FFD8F81400D8F80830B8F8201049 -:10504000C01AC8F81C000431023801F0A9FABEE702 -:10505000D8F8183013B1587801F000F9D8F81C309E -:10506000B8F820109633C8F81C30D8F80C309420CB -:10507000194401F0BDFAAAE701F0C4FAA7E74FF01E -:105080000009A4E70123A8E7E8550021E8BF0301D0 -:1050900001292DE9F04104460F4603D14568284611 -:1050A000BDE8F0810288022A23D1C368164E9D1EF6 -:1050B00033F8023C33860288756386F838204168ED -:1050C000284604F003FE022FE9D92389E76894F803 -:1050D00010801F444246394606F1390004F0F6FDBF -:1050E0004246384686F844806169376404F0EEFD34 -:1050F000D5E7064D4168284604F0E8FD208822895E -:10510000E1682844F2E700BFE8550021E45400219B -:1051100070B5324C0546238D0133238588B9237C35 -:10512000022B27D0032B4AD0012B54D1E369608D89 -:10513000218C963303449430043180B2E36101F052 -:1051400057FA606B30B194F83820254904F0BEFD61 -:1051500000236363206C30B194F84420214904F0AB -:10516000B5FD00232364281E236818BF0120BDE875 -:1051700070401847A369586801F060F8A3699868FF -:1051800001F066F8A369587801F068F8A069443026 -:10519000FFF7B6FE6369A2689B1AE361238D012BBA -:1051A00009D194F82E0094F82F30834203D094F85C -:1051B000451001F071F8E06901F0AEF9C1E7A369AB -:1051C00013B1587801F04AF8E36996209633E36109 -:1051D000FFF76EFEB5E701F015FAB2E7E8550021DA -:1051E000185600212156002108B500F023FFBDE824 -:1051F000084001F0C5BC000008B5044801F012F8F1 -:10520000BDE80840024801F013B800BF1151030186 -:10521000414F03017047000070B50546406801F03A -:105220000DF8A86801F014F8687801F017F895F9FE -:10523000020001F07FF801F011F92B7B434C022BA7 -:10524000A8704AD0032B51D00023E38540F6080311 -:105250006384A3846B7B022B6AD0032B6DD0002365 -:1052600084F84530282323842E78012E6BD9043E00 -:10527000012E8CBF002601262B7D8BB1082000F06B -:10528000D3FE687D3246C000A97D00F0F80001F031 -:10529000E7FB287E05F1190101F0CAFB6B7DDB00FD -:1052A000638595F82C305BB1314695F82F0001F0FD -:1052B00029FC95F8300005F1310101F0B9FB10230C -:1052C00094F82E0094F84510A38500F0E5FF05F151 -:1052D0004400BDE87040FFF713BE40F20113E385C0 -:1052E00040F20443638440F60803B2E7AA7B012A34 -:1052F00015BF042384F82E3084F82E30102318BFF5 -:10530000402384F82230502384F82430EB7B012B97 -:105310000BBF0323042384F82F3084F82F300CBFF5 -:105320001023402384F82330502384F8253091E75C -:10533000012384F84530142395E7022384F845308F -:105340004FF4A0738FE7012696E700BFE8550021D0 -:1053500010B50FC8014C84E80F0010BDE8550021BE -:10536000024B07C883E80700704700BFF8550021CB -:105370002DE9F0410027124C0546A0680E4627850E -:1053800001F0EAF800F048FF022817D1314628461C -:10539000FFF77EFE314680462846FFF79DFD054615 -:1053A0000146404601F088F994F8220094F8241050 -:1053B000093500FB051584F82670E561BDE8F0812C -:1053C000E855002170B504460E46FFF761FE3146F0 -:1053D00005462046FFF780FD04460146284601F0B9 -:1053E0006BF9064B093493F8251093F8230000FB62 -:1053F0000414D9690C44DC6170BD00BFE85500217C -:105400002DE9F0414FF000080F4C431CA364A4F8B1 -:105410004C10E3680F46218C06461944A068A4F896 -:10542000288001F0E9F9012805460BD100F0F4FECF -:10543000032807D13946304601F002FAC4F81C802F -:1054400084F82650BDE8F081E8550021034A431C4A -:105450009364A2F84C1001F0F3B900BFE8550021A5 -:1054600001F0D0B801F0CEB800F0FEBF01F006B8F0 -:1054700001F04CB801F04AB8704700000022014B1F -:105480001A70704738560021024A1378013313709E -:10549000704700BF38560021024A13780BB1013B18 -:1054A00013707047385600211423038096238370AD -:1054B0004FF47A7383804FF42F73C38040F21473D8 -:1054C000038140F201334381072303737047704720 -:1054D00070B5062800F2AD80DFE800F00414204526 -:1054E0005E1BA600544BD3F804321A0C0A708B7062 -:1054F0001A0AE823CB7007230B71C0234A704B7143 -:10550000012005E0012300220B704A708B70CB70E4 -:1055100070BD4A4BD3F800330B60F1E7002440F232 -:1055200006450C81CD8340F20244FB2504234FF451 -:1055300080724FF40170CC824D840C8540F2E245BC -:10554000642408808B708A808B744A838A820B76ED -:105550000A8481F82430CD844C85888581F82E30EA -:105560000B73CA81CCE7344B0139D3F80462D3F80A -:1055700008520023C3F12004A3F1200026FA03F20D -:1055800005FA04F4224325FA00F008330243402BC5 -:1055900001F8012FEED1B3E7274BD3F804220A70AC -:1055A000D3F80422120A4A70D3F80422120C8A702B -:1055B000D3F80422120ECA70D3F808220A71D3F865 -:1055C0000822120A4A71D3F80822120C8A71D3F801 -:1055D0000822120ECA71D3F80C0202F00F020872F0 -:1055E000D3F80C4242F04002240A4C72D3F80C4229 -:1055F000240C8C72D3F80C42240ECC72D3F81042D7 -:105600000C73D3F81042240A4C73D3F81042240CC4 -:105610008C73D3F810321B0ECB7300F03F0363F092 -:105620007F03CA710B726BE70120102308704B7067 -:105630006EE700206CE700BF0000FF010080FF0163 -:1056400000220C4BC3F80021D3F800110121C3F84C -:105650000421D3F804211960D3F8002102B1704766 -:10566000D3F804010028F7D0C3F80421D3F80421AB -:10567000F1E700BF00D00041036810B50C6863403B -:1056800013604C684368634053608C688368634070 -:105690009360C368C9684B40D36010BD002310B548 -:1056A00000F11002103112F8014D43EA440301F8F1 -:1056B000013D137882424FEAD313F4D110BD0000AC -:1056C00038B50C460D4B0E491032C1F8043500F1C7 -:1056D000100111F8015D03F8015B12F8015D8142D0 -:1056E000DD73F6D1FFF7ACFF064A04F1100312F8A0 -:1056F000011B03F8011DA342F9D138BD3956002121 -:1057000000D0004159560021F0B51C461368102CFA -:105710000D4695B01BBA57D1D16809BA009191686E -:10572000526809BA12BACDE9022301913D4B3E4AB3 -:10573000C3F8042500F1100313F8011D834202F899 -:10574000011BF9D110220021384804F0E6FAFFF7D6 -:1057500077FF0CAA1646364B03F1100C1746186853 -:105760005968083303C763453A46F7D19DF930308D -:10577000002B2BDB304604A9FFF790FF9DF910307A -:10578000002B2DDB08A904A8FFF788FF102C31D1CE -:105790003246684604A9FFF76FFF1022002110A8C7 -:1057A00004F0BBFA214A314610A8FFF765FFFFF766 -:1057B00047FF1F4A05F1100312F8011B03F8011DF2 -:1057C0009D42F9D115B0F0BD0093AFE7304610A966 -:1057D000FFF764FF174904AA10A8FFF74DFFCDE7B4 -:1057E00010A904A8FFF75AFF124908AA10A8FFF74A -:1057F00043FFCBE7002280211346E4B210A8944275 -:105800000BD91DF8027007700132102A00F1010057 -:10581000F5D1324608A910A8BDE70CBF017003708E -:10582000F2E700BF00D0004139560021495600215F -:1058300059560021EDBF030101220A4B10B51A6031 -:1058400000220144884202D101225A6010BDC3F8EF -:105850000021D3F80041002CFBD0D3F8084500F814 -:10586000014BEFE700900041024B40F00040C3F8CD -:10587000CC0170470080014113B56B46124C134AAE -:1058800092E80300124A83E8030019462046FFF716 -:1058900083F820460F4CFFF7E7F82046FEF79AFB07 -:1058A00023780D4A43F00043C2F89031237802F583 -:1058B000C04243F00043C2F88C302078FEF79EFBD4 -:1058C00000F09CF802B010BD08C0030100C0030145 -:1058D000D5590301695600210020014101210148E9 -:1058E000FFF7DCB808C0030110B5044601F04CF91D -:1058F000FFF7F4FF201A192809D40748002322468D -:105900000321FFF7D6F801F041F9012010BD01F0A5 -:105910003DF90020FAE700BF08C0030170B5044656 -:10592000104BD3F81055FFF7D9FF0F4B4FF47A51B6 -:10593000A34228BF2346A3FB0131EAB2C2F12005EE -:1059400001FA05F5A2F1200423FA02F221FA04F487 -:105950002A43224302440123BDE87040002103484A -:10596000FFF7A7B8008001417085410008C003011E -:1059700008B504494FF47A720023A0FB010103F03B -:10598000D7FF08BD40420F00411A08B508D44FF4B4 -:105990007A700023A1FB0001024A03F0C9FF08BD91 -:1059A0000020FCE740420F00401A20EAE0707047F8 -:1059B000034B02461960034801230221FFF779B81F -:1059C0006C56002108C0030102210148FFF787B887 -:1059D00008C0030110B50446102000F04FF8B4F5DC -:1059E000A47F06D1FFF7F0FFBDE81040014B1B6814 -:1059F000184710BD6C560021FFF770BF042108B591 -:105A00000846FEF7EDFE0122014B1A6108BD00BFFA -:105A10000020014107B5302200210E4804F07DF935 -:105A20000D4B01A91A889B781C20ADF804208DF835 -:105A30000630FEF7DFFC01A91D20FEF7DBFC01A903 -:105A40001E20FEF7D7FC01A91F20FEF7D3FC03B0F0 -:105A50005DF804FB7056002110C0030108B51C203E -:105A6000FEF794FD1D20FEF791FD1E20FEF78EFD32 -:105A7000BDE808401F20FEF789BD000010B5174C97 -:105A8000637893B1162805D804EB4000837813B1EE -:105A9000012B05D010BDC078BDE81040FEF7DEBC7C -:105AA000C078BDE81040FEF7CDBC10280DD004D85A -:105AB00048B10128EED11D20EEE7112807D01628A5 -:105AC000E8D11F20E8E71C20E6E71E20E4E71F20BE -:105AD000FEF7C4FC01232370DCE700BF70560021F1 -:105AE000134B5A7872B1162820D803EB4000837804 -:105AF00013B1012B03D07047C078FEF7A3BCC07868 -:105B0000FEF7ACBC10280BD003D828B1012805D073 -:105B10007047162806D070471C20EEE71D20ECE7E2 -:105B20001E20EAE71B780BB91F20E6E7704700BF8D -:105B30007056002116282DE9F34180460E4617467F -:105B40002ED8184D6B785BB9FF290DD001246C70ED -:105B5000FFF784FFA64210D9012002B0BDE8F08112 -:105B600001290AD9FF29F7D105EB4805EB78BB429B -:105B700016D13846FEF70AFDEEE70B4B05EB48055C -:105B80001A889B783846AE70EF7001A9ADF80420F2 -:105B90008DF80630FEF72EFC4046FFF7A1FFDBE74D -:105BA0000020DAE77056002110C00301054B188869 -:105BB000054B00F5A06080B2A0FB0303800D803888 -:105BC00040B27047EE000021676606000023024ADB -:105BD0001380024A13807047EE000021EC00002180 -:105BE000F8B50746FFF7E2FF0A4B0E46D3F8083533 -:105BF00013F0010F14BF03240024044401F006F93C -:105C0000054601F001F9E4B2283D254404443D7005 -:105C10003470F8BD0040004118B1054BB3F90030B5 -:105C2000038019B1034BB3F900300B80704700BFFC -:105C3000EE000021EC000021024B1880024B0120F5 -:105C400019807047EE000021EC00002138B52D4B83 -:105C50000546D3F80835002213F0010F14BF0321C5 -:105C60000021FFF7A3FF01440423CCB2284649B228 -:105C700001F0CEF8231858B28542DAB204DA431E96 -:105C80009D4202DB501E40B238BD831E9D4201DBA7 -:105C9000901EF8E7C31E9D4201DBD01EF3E7031FF1 -:105CA0009D4201DB101FEEE7431F9D4201DB501FA9 -:105CB000E9E7831F9D4201DB901FE4E7C31F9D427C -:105CC00001DBD01FDFE7A0F108039D4202DBA2F158 -:105CD0000800D8E7A0F10C039D4202DBA2F10C0002 -:105CE000D1E7A0F110039D4202DBA2F11000CAE748 -:105CF000A0F114039D42ACBFA2F11400A2F1280050 -:105D0000C1E700BF0040004110B5044601F090F823 -:105D1000012804D10022094BC3F8002510BD032C33 -:105D200004D10120054BC3F80005F7E724B9034B64 -:105D30000120C3F80045F1E70020EFE700400041F3 -:105D400001F09AB8074B93F84B20074B012A05D076 -:105D5000022A05D0E322C3F820257047A322FAE7E0 -:105D6000C322F8E7D859002100E0004130B52C4AA1 -:105D700092F8223092F821101B0443EA012392F892 -:105D8000201092F827500B4392F82310002992F824 -:105D9000241018BF4FF4801443EA815392F8251061 -:105DA00008BF002443EA016392F8261043EA4573D2 -:105DB000002914BF4FF08061002123430B43194990 -:105DC000C1F8143592F82A3092F829401B0443EAAE -:105DD000042392F82840234392F82B4092F82C2079 -:105DE000002C14BF4FF080740024002A14BF4FF021 -:105DF0000072002223431343C1F818350A4BC1F83F -:105E00001005D3F81042094A944207D104280CBF68 -:105E1000D3F88430D3F88030C1F8883530BD00BF66 -:105E2000D8590021008000410000FF0141414B5141 -:105E3000054A064B9069D3F854351B1AD08F1B1AAC -:105E4000B2F84000181A7047D8590021009001415B -:105E50000246012302210148FEF72BBE1CC00301AC -:105E600002210148FEF73BBE1CC0030110202DE9B2 -:105E7000F047FFF703FE674BD3F8002152B1002231 -:105E8000C3F80021D3F80031634B1B78022B3ED0BE -:105E9000032B40D05F4BD3F8042152B10022C3F84A -:105EA0000421D3F804315C4B1B78032B01D1FFF79D -:105EB000D7FF584BD3F86C219AB100251220C3F8B4 -:105EC0006C51554CD3F86C31FFF70AFE1320FFF7E5 -:105ED00007FE94F80080B8F1020F1ED0B8F1030F4E -:105EE00027D04C4BD3F83C21002A00F090800022B0 -:105EF000C3F83C21D3F83C21474A526C002A00F0F9 -:105F00008680BDE8F047D3F8680640B210471220FB -:105F1000FFF7B4FDBEE71320FAE700F0C3FF3F4BE5 -:105F20002846D3F84C25A38F1344E361A368984710 -:105F3000D7E700F0B7FF394BE28FD3F850359B1A03 -:105F4000E361FFF775FF0646206B94F8493042780D -:105F500091463BB1324BC3F884501AB1C11C023098 -:105F600003F0B4FEDFF8ACA0DAF8485500F05AFFB1 -:105F700005F07F0594F8357005446D42022F6DB22F -:105F800009D1DAF85031012B4FF000030CBF47461E -:105F90000427CAF8503194F8492092B1B9F1000FA2 -:105FA0000FD002211E4BC3F80413D3F804110029AB -:105FB000FBD00221C3F808134FF48041194BC3F8FA -:105FC0008011144BD3F80034DB0709D41420FFF7F9 -:105FD00055FD2B463A46314603206468A04780E7CA -:105FE0007AB1B9F1000F0CD00D4BD3F8003443B99E -:105FF0001420FFF743FD2B463A46314604206468DF -:10600000ECE72B463A46314600206468E6E7BDE8F7 -:10601000F08700BF00800041D85900210090014165 -:1060200000E0004100E100E0014B83F822007047EE -:10603000D8590021F7B5582200216D4803F06DFEB4 -:10604000002201236B496C4CC1F8FC2FC1F8FC3FC6 -:10605000D30003F1FF7303F58033D3F8000301305D -:106060000CD0D3F8000301322040884202BFD3F89D -:106070000003D3F804330360202AE9D15D4CD4F83F -:106080003C3743F48063C4F83C37D4F83C371B05F5 -:1060900040F1A380D4F83C37584A23F0004323F062 -:1060A000FF0343F0004343F09603C4F83C37D4F8B1 -:1060B00040374F4D23F47F4343F4B053C4F8403787 -:1060C0006B4692E803004E4A83E8030019464D48A8 -:1060D000FEF762FC05F10C00FDF77CFF287BFFF763 -:1060E000C3FB287B484E40F00043C6F88030FDF7E4 -:1060F00085FF05F10D00FDF76DFF6B7B05F10E00CF -:1061000043F00043C6F8C031C4F88030FDF762FFA9 -:10611000AB7B05F10F0043F00043C6F8C431C4F86F -:106120008430FDF757FFE87B002740F00043C4F8B8 -:106130008C31C6F8CC30FDF761FF05F11000FDF79A -:1061400049FF287C40F00043C4F8EC31C6F8D03059 -:10615000FDF754FF05F11100FDF73CFF687C40F0AE -:106160000043C4F88431C6F8D430FDF747FF40F24D -:1061700001230126C4F8503640F20313C4F82C75ED -:10618000C4F83065C4F8343540F25B63C4F8383580 -:10619000D4F800221D4B20211343C4F800324FF4E1 -:1061A00084732B84032385F82A30194B85F82C60DF -:1061B00083F808134FF480721A601648C4F8040379 -:1061C00083F808131A60297CE87B00F083FE3846C8 -:1061D000FFF79AFD2E7003B0F0BDD4F8743723F0AA -:1061E000807323F0010343F08073C4F8743751E7E0 -:1061F000D85900210080004100F0FFFF14C00301C6 -:10620000916603011CC003010090014111011000BF -:1062100000E100E003800008014B1878704700BFE0 -:10622000D8590021014B9860704700BFD859002110 -:10623000014B5860704700BFD8590021034B020E34 -:106240000002C3F82425C3F81C05704700800041F4 -:10625000014BC3F83C057047008000410A280BD869 -:10626000431CDBB20B4A5B00023300F07F00C2F834 -:106270000835C2F854057047242801D8831CF0E77C -:10628000252804D026280CBF0C232723EAE7002367 -:10629000E8E700BF00800041254B032883F8340065 -:1062A00083F8351018D004281CD001280FD02922DB -:1062B0001A8701229A87032283F83620292201397E -:1062C0005A87032914D8DFE801F01C2A232A282240 -:1062D00098871A870422EFE72B221A8701229A87D0 -:1062E0000622E9E72B221A8701229A870522E3E793 -:1062F0000822DA872822A3F84020032283F83720D7 -:1063000070470522DA871822A3F840200422F5E717 -:106310001922DA879022A3F840200622EEE71E22F7 -:10632000DA874FF4A872A3F840200522E6E700BF01 -:10633000D859002173B5464B0546D3F808350021DE -:1063400013F0010F0DF1060014BF03240024FFF722 -:1063500063FC0A23BDF90610002291FBF3F12144EE -:106360000423CCB2284649B200F052FD064600F0A4 -:106370005FFDA219D3B252B29542364807DB002323 -:1063800080F84220344AC2F80C3502B070BD511E6C -:106390008D4204DB013B80F84230FF23F2E7911E7F -:1063A0008D4204DB023B80F84230FE23EAE7D11E37 -:1063B0008D4204DB033B80F84230FD23E2E7111FEE -:1063C0008D4204DB043B80F84230FC23DAE7511FA6 -:1063D0008D4204DB053B80F84230FB23D2E7911F5E -:1063E0008D4204DB063B80F84230FA23CAE7D11F16 -:1063F0008D4204DB073B80F84230F923C2E7A2F16B -:1064000008018D4204DB083B80F84230F823B9E7ED -:10641000A2F10C018D4204DB0C3B80F84230F423E6 -:10642000B0E7A2F110018D4204DB103B80F842304E -:10643000F023A7E7143A9542ABBF143B283B80F802 -:10644000423080F84230ACBFEC23D8239AE700BF3B -:1064500000400041D859002100800041014B93F9D0 -:1064600042007047D8590021003818BF0120024B64 -:1064700083F82C00704700BFD859002110B50C4B91 -:106480000C4C58B14FF40072C3F850260122122070 -:106490001A60FFF7F3FA0423237010BDC3F8500607 -:1064A0001220FFF71DFB1320FFF71AFB0123F3E770 -:1064B00000800041D8590021024B83F8480083F83E -:1064C00049107047D8590021044A00F1100313F80D -:1064D000011D834202F8011BF9D17047A457002126 -:1064E0000368034AC2F819304368C2F81D30704788 -:1064F000A4570021014B83F84A007047D859002166 -:10650000014B83F84B007047D8590021014BC3E978 -:1065100014017047D859002138B505460C4CA0B17C -:10652000A269A38F218F02440B44D21A0023094889 -:106530001946FEF7BEFA607BFDF760FDA0692844AE -:1065400000F024FD0223237038BD1422EEE700BFC3 -:10655000D85900211CC0030110B50B4CA38F228F0A -:1065600013441433C01AA3616061FFF7BDF920B969 -:10657000A3680120BDE810401847022300202370C3 -:10658000BDE81040FFF7C8BFD8590021034AD2E93F -:1065900006239B1A1844FFF7BFBF00BFD85900213C -:1065A00070B5114C0646B4F84050E38FA2691D4403 -:1065B00002440D441544A0B1638FD21A0023012177 -:1065C0000A48FEF776FAA07BFDF718FD2846FFF78C -:1065D0003FFCA069304400F0F5FC03230120237048 -:1065E00070BD0122EAE700BFD85900211CC0030199 -:1065F000034AD2E906239B1A1844FFF7D1BF00BF14 -:10660000D859002170B51E4E3378012B37D01D4864 -:10661000FEF738FA012300251B4C2361707BFDF740 -:1066200007FDB07BFDF704FDC4F80051D4F800313C -:10663000C4F80451D4F80431C4F80C51D4F80C3126 -:10664000C4F81051D4F81031FFF70AFC0F4BC3F80F -:10665000005596F849200AB1C3F8845000F04CFA6E -:1066600000F020FC1220FFF73BFA1320FFF738FA66 -:10667000012314203370BDE87040FFF731BA70BDBC -:10668000D85900211CC003010080004100E00041F6 -:1066900070B5084C2378032B0BD1FFF7B3FF002311 -:1066A000656894F83520AC46BDE870401946022074 -:1066B000604770BDD85900210239FF292DE9F0410A -:1066C0000546464C06D9FFF79DFFA3680120BDE8AB -:1066D000F0411847002394F8482084F82830D21A53 -:1066E00018BF012284F8232094F83420012A6AD0AC -:1066F000033A012A9DBF022384F8273040F2033376 -:1067000084F8273094F83600A384FFF72FFB94F821 -:106710004820334B002A5DD0DFF8C8806A78C3F880 -:106720000485314F94F84A30304E3B76D4E9143129 -:1067300001F07F0139752946180A3B747874180CEA -:106740001B0EB874FB7411F8023BF01C337000236D -:106750007270B37003F0BAFA02222549254BC1F8D2 -:106760000025C1F80875C1F81435C1F80C65C1F8E9 -:10677000108594F83430032B04D0042B28D05A1EF3 -:10678000534253411B0443F08073C1F80435FB238B -:10679000C1F81835FFF7D6FA0023C1F80031D1F857 -:1067A0000021C1F80431D1F80421C1F80831D1F831 -:1067B0000831D1F8003243F00103C1F8003201235F -:1067C0000B60BDE8F08184F827304FF4807399E7BF -:1067D0001346D7E7C3F80455F3E700BFD8590021A3 -:1067E00000800041A0560021A4570021C857002175 -:1067F00000E00041C858002170B5104D0E466B8F67 -:10680000013BC01AAB616861FFF76EF8044638B10E -:10681000032331462B700020BDE87040FFF7C0BE57 -:106820001420FFF72BF9FFF7EDFE23462146012048 -:106830006E6895F83520B047204670BDD8590021C4 -:10684000012970B505464C4C0BD8FFF7DBFE002341 -:10685000656894F83520AC46BDE8704019460120C3 -:10686000604794F849300239003B18BF012384F88F -:10687000233094F8353084F82810012B71D0023B76 -:10688000022B97BF0223002384F8273040F2033302 -:1068900088BF84F8273094F83700A384FFF766FA9E -:1068A00094F84920354B002A63D03548C3F80405D5 -:1068B00094F84B3094F84A20022B18BFB2FA82F2B7 -:1068C000304B18BF52091A76D4E91421160A1A74EB -:1068D0005E74160C120EDA74022201F07F01197533 -:1068E00029499E74C1F80025C1F80835274BC1F825 -:1068F0001435C1F80C05C1F8105594F83530032B48 -:1069000004D0042B33D05A1E53425341204A42EA4A -:106910000343C1F8043594F82830C1F81835FFF75F -:1069200011FA0023C1F80031D1F80021C1F8043177 -:10693000D1F80421C1F80831D1F80821D1F800229A -:1069400022F00102C1F80022627C42F00042C1F84C -:106950008420C1F80431D1F8043101230B60256390 -:1069600070BD002384F827304FF4807393E71346FB -:10697000CCE7C3F80455F2E7D85900210080004164 -:10698000A0560021A457002100E00041C858002172 -:10699000010000010378427803F03F0343EAC21389 -:1069A00082780F4943EA0223C27843EA023302792C -:1069B00043EAC233427943EA02438279120602F083 -:1069C00070621343C1F81039B0F90A20054B03EA8D -:1069D00002430289C2F30C021343C1F81439704711 -:1069E000008000410000FF0F437830B5002B837812 -:1069F00014BF08210021002B14BF102200220379AC -:106A0000C57804789B0243EA85132343447943EA1B -:106A100044338479C07943EA044343EA00630B4377 -:106A20001343024AC2F8043930BD00BF0080004160 -:106A300001230A4A0328C2F82C394FF0000306D874 -:106A4000C2F82839C2F82839C2F8283970471946DF -:106A500001339842C2F82819FAD8704700800041E3 -:106A60002DE9F0410127002A14BF3B4600234FF0D7 -:106A7000000618BF20224FF0020886B005460C46DB -:106A800001A88DF805308DF804708DF806608DF83A -:106A900007608DF808808DF809708DF80A208DF850 -:106AA0000B20FFF7A1FF0323ED08BC42CDE90366ED -:106AB00005968DF80C508DF80D708DF80F308DF80F -:106AC00011300BD044450FD014B90A4AC2F800392E -:106AD00003A8FFF75FFF06B0BDE8F081054AC2F8E2 -:106AE00000898DF80E30F3E7024BC3F800498DF8AA -:106AF0000E40EDE7008000410148FFF775BF00BF81 -:106B000024C003011C4B1D4A70B5C3F8502901264F -:106B100052220029C3F8542914BF3346002386B0FB -:106B200018BF202100248DF805300223054601A856 -:106B30008DF808308DF80A108DF80B108DF8046070 -:106B40008DF806408DF807408DF80960FFF74CFF7F -:106B50000323B542CDE903448DF80F300CBF022367 -:106B6000334603A805948DF80D608DF81130FFF7BA -:106B700011FF06B070BD00BF00800041305A0021F7 -:106B800070471020FEF77ABF72B6704762B6704742 -:106B900008B54FF082424FF0FF33C2F8003E02F5D5 -:106BA000E042C2F8003E0023C2F8403EC2F8443E34 -:106BB00040F201127F201D49C1F840251C4AC2F84D -:106BC0001801C1F8043EC1F8083EC2F82431C2F8E9 -:106BD0002C3102F57F22C2F810311648FDF76EF90C -:106BE000FDF77CF90120FDF793F9134BD3F80C2442 -:106BF000D3F80C14C903F9D5D207F7D50720FDF750 -:106C00007BFB00230D4AC2F804350D4A13600122B4 -:106C10000C4B1A70FEF7FEFE1120FEF761FF1020EC -:106C2000FEF72CFFBDE80840FEF726BE0000084135 -:106C300000200041836B03010050004100A000418F -:106C4000845B0021785B0021014B1870704700BF06 -:106C5000785B0021014B1868704700BF845B0021FE -:106C6000054B064883421A4604D211680433B1F139 -:106C7000AF3FF7D0801A704700F0002100000121DB -:106C800008B508B1FEF74AFE1020FEF729FF30BF15 -:106C9000BDE808401020FEF7F1BE7047012307B59C -:106CA0008DF8043000238DF805308DF806304FF64E -:106CB000FF73984202D001A9FDF79CFB03B05DF879 -:106CC00004FB000007B5084B1A889B78ADF8042038 -:106CD0008DF806304FF6FF73984202D001A9FDF7F8 -:106CE00089FB03B05DF804FB2CC0030138B5244CCC -:106CF000244D601DFDF76EF96379A01D43F000433C -:106D0000C5F8D831FDF766F9A379608A43F00043EE -:106D1000C5F8DC314FF6FF73984209D0FDF7D2FB7E -:106D20006279194B42F0004119501046FDF766F99F -:106D30004FF6FF73A089984209D0FDF7C3FBA279F3 -:106D4000114B42F0004119501046FDF757F94FF62C -:106D5000FF73E089984211D0FDF7B4FBA2790A4B8A -:106D600042F0004119501046FDF748F9E089FDF75F -:106D7000B3FB227A044B42F000421A5038BD00BFE8 -:106D8000885B00210090014180A000414FF6FF7315 -:106D9000984201D0FDF7FABB70474FF6FF73984257 -:106DA00001D0FDF74FBB70474FF6FF73984201D0FB -:106DB000FDF754BB70474FF6FF73984210B5044679 -:106DC0000CD0FDF789FB012200F1824303F520433B -:106DD0002046BDE810401A60FDF760BB10BD000002 -:106DE0004FF6FF73984210B5044609D005480023BA -:106DF000C9B2FDF75EFE2046BDE81040FDF73ABB84 -:106E000010BD00BF1CC003010A2070470A20704754 -:106E1000034B1B88002B14BF0A200020704700BFC3 -:106E2000885B0021014B9878704700BF885B002188 -:106E300038B54FF6FF73074D04466889984204D071 -:106E40001CB10A2C04D1FFF7A8FF01202C8038BD0B -:106E50000020FCE7885B00214FF6FF72054B598943 -:106E6000914202D008B10E2802D15880012070470B -:106E700000207047885B002110B5044620B101282E -:106E800008D00024204610BD054B0124188AFFF7C6 -:106E90008BFFF7E7024B188AFFF77FFFF2E700BF8F -:106EA000885B002110B50A4CA089FFF784FFE089B8 -:106EB000FFF781FF608AFFF77EFF6089FFF774FFAD -:106EC000208AFFF771FFA08ABDE81040FFF76CBF72 -:106ED000885B002138B52723184C0025A381252382 -:106EE000E381262323822B2365606382E0712C23B8 -:106EF0002420A3822581608121722560FFF7CEFEC8 -:106F0000208AFFF7CBFEA08AFFF7C8FE608AFFF752 -:106F1000D9FEA089FFF7D6FEE089FFF7D3FEFFF781 -:106F2000E5FEFFF7BFFF2846FFF782FF2846FFF781 -:106F300093FF208ABDE83840FFF736BF885B002109 -:106F400010B5114CFFF7AEFF6089FFF71FFF208AD5 -:106F5000FFF71CFFA08AFFF719FF608AFFF716FFF3 -:106F6000A089FFF713FFE089FFF710FFA079FDF775 -:106F70005FF8A079FDF734F86079FDF759F860798A -:106F8000BDE81040FDF72CB8885B002138B50546F8 -:106F90000B4CA0F12C020621608AFFF721FFA5F11E -:106FA0001A020721A089FFF71BFF2078FFF740FF97 -:106FB0002079FFF761FFA08ABDE83840FFF7EDBEFA -:106FC000885B002138B505460A4CA0F11C02062159 -:106FD000608AFFF705FFE089A5F10A020721FFF7A4 -:106FE000FFFE2079FFF748FFA08ABDE83840FFF791 -:106FF000D4BE00BF885B00212DE9F04105468846DC -:1070000017461E46174CFFF79BFFBDF81830284661 -:107010006382BDF81C306581A382A4F80C80E781EF -:107020002682FFF73BFE208AFFF738FEA08AFFF793 -:1070300035FE608AFFF746FEA089FFF743FEE08930 -:10704000FFF740FEFFF752FEFFF72CFF0020FFF78F -:10705000EFFE0020FFF700FF208AFFF7A5FE0120CA -:10706000BDE8F081885B002100207047034630B501 -:10707000002010C920CA641910C310C920CA6C416D -:1070800010C310C920CA6C4110C310C920CA6C417A -:1070900010C310C920CA6C4110C310C920CA6C416A -:1070A00010C310C920CA6C4110C310C920CA6C415A -:1070B00010C3404130BD30B5002310C920CA641B45 -:1070C00010C010C920CAAC4110C010C920CAAC41C0 -:1070D00010C010C920CAAC4110C010C920CAAC41B0 -:1070E00010C010C920CAAC4110C010C920CAAC41A0 -:1070F00010C010C920CAAC4110C05B41B3FA83F084 -:10710000400930BD2022002102F007BE031F1C30C1 -:1071100053F8042F1AB98342FAD101207047002096 -:107120007047002351F8232040F823200133082B17 -:10713000F8D1704710B500F12003203153F8044D09 -:1071400051F8042D944204D805D38342F6D100208F -:1071500010BD0120FCE74FF0FF30F9E7002200F1FD -:107160002003834200D1704753F8041D42EA5102C4 -:107170001A60CA07F5E70000F0B5002789B0FFF7ED -:10718000D0FFCB6A0C4603930B6B064604934B6B04 -:107190006A4605938B6B68460693CB6B69460793EB -:1071A000CDE901770097FFF761FF6A460546314652 -:1071B0003046FFF75BFF236B6A460393636B6946B8 -:1071C0000493A36B05440593E36B6846CDE906374A -:1071D000FFF74CFF6A46314605443046FFF746FF4D -:1071E000236A6A460093636A31460193A36A0544A1 -:1071F0000293A36B30460693E36BCDE904770793C4 -:107200000397FFF733FF636AA26B0093A36A0492AC -:107210000193E36AE26B0293636B3146CDE9052388 -:107220000393236A6A46054430460793FFF71EFF1F -:10723000E36A6A460093236B31460193636B05440E -:107240000293236A30460693A36ACDE90477079335 -:107250000397FFF730FF236B6A460093636B314659 -:107260000193A36B2D1A0293E36B30460393636A79 -:10727000CDE904770693E36A0793FFF71CFF636B7E -:107280006A460093A36B31460193E36B2D1A029378 -:10729000236A30460393636A0493A36ACDE90537F2 -:1072A000236B0793FFF707FFA36B2D1A0093E36B84 -:1072B0006A46CDE90137636A31460393A36A3046D3 -:1072C0000493E36ACDE90537636B0E4C0793FFF730 -:1072D000F2FE2D1A0DD42DB931462046FFF72AFFB4 -:1072E00001280DD0224631463046FFF7E4FE2D1A24 -:1072F000F1E7224631463046FFF7B8FE2D18F8D4A4 -:1073000009B0F0BDB0C003012DE9F04F93B001907A -:1073100002A800F1180002F1180218C9C0CAA3FBA4 -:1073200006BC40F804BB4FF0000AA3FB07B91CEBF6 -:107330000B0C49F10009A4FB06BE1CEB0B0C59EB2E -:107340000E094AF1000A40F804CBA4FB07CE19EB62 -:107350000C094AEB0E0AA0E80006A0F11C00A2F1FD -:107360001402B2E8C00120C9A3FB06BC40F804BB6C -:107370004FF0000AA3FB07B91CEB0B0C49F1000905 -:10738000A4FB06BE1CEB0B0C59EB0E094AF1000ADC -:1073900040F804CB4FF0000BA3FB08CE19EB0C090F -:1073A0005AEB0E0A4BF1000BA4FB07CE19EB0C09AC -:1073B0005AEB0E0A4BF1000BA5FB06CE19EB0C099C -:1073C0005AEB0E0A4BF1000B40F8049B08C94FF032 -:1073D000000CA4FB08E91AEB0E0A5BEB090B4CF15D -:1073E000000CA5FB07E91AEB0E0A5BEB090B4CF14D -:1073F000000CA3FB06E91AEB0E0A5BEB090B4CF140 -:10740000000CD0F800E01AEB0E0A5BF1000B4CF117 -:10741000000C40F804AB10C94FF0000EA5FB089A11 -:107420001BEB090B5CEB0A0C4EF1000EA3FB079A59 -:107430001BEB090B5CEB0A0C4EF1000EA4FB069A49 -:107440001BEB090B5CEB0A0C4EF1000ED0F8009020 -:107450001BEB090B5CF1000C4EF1000E40F804BB75 -:1074600040CA4FF00009A5FB06AB1CEB0A0C5EEB13 -:107470000B0E49F10009A3FB08AB1CEB0A0C5EEBF9 -:107480000B0E49F10009A4FB07AB1CEB0A0C5EEBE9 -:107490000B0E49F10009D0F800A01CEB0A0C5EF1BC -:1074A000000E49F1000940F804CB80CA4FF0000AF1 -:1074B000A5FB07BC1EEB0B0E59EB0C094AF1000AA9 -:1074C000A3FB06BC1EEB0B0E59EB0C094AF1000A9C -:1074D000A4FB08BC1EEB0B0E59EB0C094AF1000A89 -:1074E000D0F800B01EEB0B0E59F100094AF1000A6A -:1074F00040F804EB4FF0000BA3FB07CE19EB0C098F -:107500005AEB0E0A4BF1000BA4FB06CE19EB0C094B -:107510005AEB0E0A4BF1000B40F8049BA4FB07E961 -:107520001AEB0E0A4BEB090BA0E8000CA0F134009B -:10753000A1F11401A2F1200238C9B2E8C001A3FBF5 -:1075400006BC40F804BB4FF0000AA3FB07B91CEBD4 -:107550000B0C49F10009A4FB06BE1CEB0B0C59EB0C -:107560000E094AF1000A40F804CB4FF0000BA3FBD0 -:1075700008CE19EB0C095AEB0E0A4BF1000BA4FBD9 -:1075800007CE19EB0C095AEB0E0A4BF1000BA5FBC9 -:1075900006CE19EB0C095AEB0E0A4BF1000B40F822 -:1075A000049B08C94FF0000CA4FB08E91AEB0E0A73 -:1075B0005BEB090B4CF1000CA5FB07E91AEB0E0A7B -:1075C0005BEB090B4CF1000CA3FB06E91AEB0E0A6E -:1075D0005BEB090B4CF1000CD0F800E01AEB0E0A43 -:1075E0005BF1000B4CF1000C40F804AB10C94FF0FC -:1075F000000EA5FB089A1BEB090B5CEB0A0C4EF185 -:10760000000EA3FB079A1BEB090B5CEB0A0C4EF177 -:10761000000EA4FB069A1BEB090B5CEB0A0C4EF167 -:10762000000ED0F800901BEB090B5CF1000C4EF142 -:10763000000E40F804BB20C94FF00009A3FB08ABC3 -:107640001CEB0A0C5EEB0B0E49F10009A4FB07AB27 -:107650001CEB0A0C5EEB0B0E49F10009A5FB06AB17 -:107660001CEB0A0C5EEB0B0E49F10009D0F800A0F0 -:107670001CEB0A0C5EF1000E49F1000940F804CB46 -:1076800008C94FF0000AA4FB08BC1EEB0B0E59EB17 -:107690000C094AF1000AA5FB07BC1EEB0B0E59EBC7 -:1076A0000C094AF1000AA3FB06BC1EEB0B0E59EBBA -:1076B0000C094AF1000AD0F800B01EEB0B0E59F18C -:1076C00000094AF1000A40F804EB10C94FF0000B22 -:1076D000A5FB08CE19EB0C095AEB0E0A4BF1000B77 -:1076E000A3FB07CE19EB0C095AEB0E0A4BF1000B6A -:1076F000A4FB06CE19EB0C095AEB0E0A4BF1000B5A -:10770000D0F800C019EB0C095AF1000A4BF1000B3C -:1077100040F8049B40CA4FF0000CA5FB06E91AEBA9 -:107720000E0A5BEB090B4CF1000CA3FB08E91AEB0A -:107730000E0A5BEB090B4CF1000CA4FB07E91AEBFA -:107740000E0A5BEB090B4CF1000CD0F800E01AEBD1 -:107750000E0A5BF1000B4CF1000C40F804AB80CA40 -:107760004FF0000EA5FB079A1BEB090B5CEB0A0C14 -:107770004EF1000EA3FB069A1BEB090B5CEB0A0C07 -:107780004EF1000EA4FB089A1BEB090B5CEB0A0CF4 -:107790004EF1000ED0F800901BEB090B5CF1000CD1 -:1077A0004EF1000E40F804BB52F8048B4FF0000974 -:1077B000A5FB08AB1CEB0A0C5EEB0B0E49F10009B4 -:1077C000A3FB07AB1CEB0A0C5EEB0B0E49F10009A7 -:1077D000A4FB06AB1CEB0A0C5EEB0B0E49F1000997 -:1077E000D0F800A01CEB0A0C5EF1000E49F1000974 -:1077F00040F804CB40CA4FF0000AA5FB06BC1EEBC4 -:107800000B0E59EB0C094AF1000AA3FB08BC1EEB56 -:107810000B0E59EB0C094AF1000AA4FB07BC1EEB46 -:107820000B0E59EB0C094AF1000AD0F800B01EEB20 -:107830000B0E59F100094AF1000A40F804EB80CA26 -:107840004FF0000BA5FB07CE19EB0C095AEB0E0A03 -:107850004BF1000BA3FB06CE19EB0C095AEB0E0AF9 -:107860004BF1000BA4FB08CE19EB0C095AEB0E0AE6 -:107870004BF1000BD0F800C019EB0C095AF1000ACB -:107880004BF1000B40F8049B4FF0000CA3FB07E901 -:107890001AEB0E0A5BEB090B4CF1000CA4FB06E99A -:1078A0001AEB0E0A5BEB090B4CF1000C40F804AB31 -:1078B000A4FB079A1BEB090B4CEB0A0CA0E8001881 -:1078C000019802A9FFF758FC13B0BDE8F08F2DE92D -:1078D000F04F93B0019002A80CC901F1100160C9EA -:1078E00000F11800A2FB058940F8048BA2FB06CA30 -:1078F00019EB0C094AF1000A40F8049BA3FB068926 -:107900001AEB080A49F1000BA0E8000CA0F12800CE -:10791000A1F12001FCC9A2FB02BC40F804BB4FF05E -:107920000009A2FB03AB1CEB0A0C5BF1000849F158 -:1079300000091CEB0A0C58EB0B0849F1000940F850 -:1079400004CB4FF0000AA2FB04BC1BEB0B0B5CEB5F -:107950000C0C4AF1000A18EB0B0859EB0C094AF120 -:10796000000AA3FB03BC18EB0B0859EB0C094AF106 -:10797000000A40F8048B4FF0000CA2FB058BDE469A -:10798000E3FB048BDE4588BF4CF1000C18EB0808C4 -:107990005BEB0B0B4CEB0C0C18EB09085BEB0A0BCD -:1079A0004CF1000C40F8048B4FF0000AA2FB068952 -:1079B000CE46E3FB0589CE4588BF4AF1000A18EBA5 -:1079C000080859EB09094AEB0A0ACE46E4FB048988 -:1079D000CE4588BF4AF1000A18EB0B0859EB0C0999 -:1079E0004AF1000A40F8048B4FF0000CA2FB078B11 -:1079F000DE46E3FB068BDE4588BF4CF1000CDE461D -:107A0000E4FB058BDE4588BF4CF1000C18EB080841 -:107A10005BEB0B0B4CEB0C0C18EB09085BEB0A0B4C -:107A20004CF1000C40F8048B04C94FF0000AA3FB92 -:107A30000789CE46E4FB0689CE4588BF4AF1000A95 -:107A4000D0F800E018EB0E0859F100094AF1000ADD -:107A500018EB080859EB09094AEB0A0ACE46E5FB80 -:107A60000589CE4588BF4AF1000A18EB0B0859EB8F -:107A70000C094AF1000A40F8048B4FF0000CA3FBFC -:107A8000028BDE46E4FB078BDE4588BF4CF1000C21 -:107A9000DE46E5FB068BDE4588BF4CF1000CD0F8D6 -:107AA00000E018EB0E085BF1000B4CF1000C18EB3A -:107AB00008085BEB0B0B4CEB0C0C18EB09085BEBB1 -:107AC0000A0B4CF1000C40F8048B08C94FF0000A77 -:107AD000A4FB0289CE46E5FB0789CE4588BF4AF163 -:107AE000000AD0F800E018EB0E0859F100094AF13D -:107AF000000A18EB080859EB09094AEB0A0ACE46B6 -:107B0000E6FB0689CE4588BF4AF1000A18EB0B0850 -:107B100059EB0C094AF1000A40F8048B4FF0000CB5 -:107B2000A4FB038BDE46E5FB028BDE4588BF4CF1F0 -:107B3000000CDE46E6FB078BDE4588BF4CF1000CEF -:107B4000D0F800E018EB0E085BF1000B4CF1000CD4 -:107B500018EB08085BEB0B0B4CEB0C0C18EB090853 -:107B60005BEB0A0B4CF1000C40F8048B4FF0000A61 -:107B7000A5FB0389CE46E6FB0289CE4588BF4AF1C4 -:107B8000000A18EB080859EB09094AEB0A0ACE4625 -:107B9000E7FB0789CE4588BF4AF1000A18EB0B08BE -:107BA00059EB0C094AF1000A40F8048B4FF0000C25 -:107BB000A6FB038BDE46E7FB028BDE4588BF4CF15C -:107BC000000C18EB08085BEB0B0B4CEB0C0C18EBE8 -:107BD00009085BEB0A0B4CF1000C40F8048B4FF0EA -:107BE0000008A7FB031A49185AEB0A0A48F10008D3 -:107BF0001BEB010B5CEB0A0C48F10008A2FB021A1C -:107C00001BEB010B5CEB0A0C48F1000840F804BBCD -:107C10004FF0000BA2FB031A49185AEB0A0A4BF16A -:107C2000000B1CEB010C58EB0A084BF1000B40F861 -:107C300004CBA3FB031A18EB01085BEB0A0BA0E8CB -:107C40000009019802A9FFF797FA13B0BDE8F08F79 -:107C500070B5064614460D4688B011466846FFF7D3 -:107C600036FE6A4631463046FFF74EFB22466946ED -:107C70006846FFF749FB6A4629462846FFF744FB5A -:107C800008B070BD0B1F1C3153F8042F0438120EBE -:107C900080F820205A888B4280F821201A684FEA09 -:107CA000122280F822201A6880F82320ECD1704735 -:107CB00001F11C0304381A688B4212BA40F8042FF1 -:107CC000A3F10403F7D1704708B50146FFF71EFA88 -:107CD00030B101F12000FFF719FA003818BF012078 -:107CE00008BD000010B50446FFF7E5F930B12146A4 -:107CF0002046BDE81040024AFFF7B8B910BD00BFEA -:107D0000B0C00301F0B5144606461D460F4689B0C3 -:107D1000024621466846FFF7E5FF69466846FFF7D9 -:107D2000D6FD6A4631463046FFF7EEFA6A462146EE -:107D30002046FFF7E9FA3A4629462846FFF7D2FFE0 -:107D400029466846FFF7C3FD324669466846FFF795 -:107D5000C9FF224669466846FFF7C4FF32462146FE -:107D60002046FFF7BFFF224639463846FFF7CCFAD8 -:107D70006A4631462046FFF7B5FF22462946284687 -:107D8000FFF7C2FA3A4629462846FFF7ABFF694695 -:107D90002046FFF7C6F909B0F0BD000010B5044653 -:107DA000FFF764F928B920460649FFF7C3F9002810 -:107DB00006DB21462046BDE81040024AFFF77BB9AA -:107DC00010BD00BFB0C00301F0B5144605461E4605 -:107DD0000F4699B0024621466846FFF783FF694681 -:107DE0006846FFF774FD6A4629462846FFF78CFA75 -:107DF0006A4621462046FFF787FA3A4631466846EA -:107E0000FFF7CCFF3A4631463046FFF76BFF2A4674 -:107E1000214608A8FFF766FF3946384608AAFFF74B -:107E200073FA2246294608A8FFF7B8FF31462046D4 -:107E3000FFF74DFD2146204608AAFFF753FF2246D3 -:107E4000294610A8FFF74EFF3146304610AAFFF72B -:107E50005BFA3A4631463046FFF744FF694610A8C0 -:107E6000FFF735FD10A9084608AAFFF73BFF2A4691 -:107E700010A908A8FFF736FF08A96A460846FFF7C9 -:107E800043FA3A46384608A9FFF72CFF284610A9BE -:107E9000FFF747F919B0F0BD2DE9F04F174602780A -:107EA000ADB004468946DDF8D880042A00F263812B -:107EB000DFE812F00500B300D200F9000F0100F175 -:107EC00024053946284604F16406FFF72AF907F12C -:107ED00020013046FFF725F9271D04F14409B8F1C8 -:107EE000000F00F09080414614A8FFF71AF92946C8 -:107EF0003846FFF716F931464846FFF712F928468B -:107F000014AAFFF7A5FE14A8FFF700F900286CD10A -:107F100031461CA8FFF7DBFC1CAA294624A8FFF762 -:107F2000F3F91CA90846FFF7D2FC14AA31463046E3 -:107F3000FFF7EAF914A90846FFF7C9FC29462846C5 -:107F400014AAFFF72BFF14AA11461046FFF726FFCD -:107F500014AA10462946FFF7C5FE2946284614AA4A -:107F6000FFF7D2F92A46294614A8FFF717FF29463A -:107F7000284614AAFFF712FF636AD90749D5294694 -:107F8000C34A2846FFF772F880462846FFF7E6F80E -:107F9000236C43EAC8732364294614A8FFF797FCAF -:107FA00014A9084624AAFFF79DFE14A9084624AA8E -:107FB000FFF798FE24A9084614AAFFF793FE294666 -:107FC000284624AAFFF7A0F91CAA10462946FFF765 -:107FD00089FE284614A9FFF7A4F8314614A8FFF734 -:107FE000A0F830461CA9FFF79CF84946384614AA69 -:107FF000FFF72EFEFF23C4F88430012300202370F6 -:108000002DB0BDE8F08F14A8FFF77CF8012314937E -:108010006DE72846FFF7A2F8BEE70121D0F88420DB -:10802000501153F8203002F01F0201FA02F21A42F6 -:108030000CBF0A460022881A4001520102F1440393 -:1080400000F14401043204302344224421442044FA -:10805000FFF7BAFE0223D1E70121D0F884205011A6 -:1080600053F8203002F01F0201FA02F21A420CBF4C -:108070000A46002250018A1A520102F1440300F11B -:108080004401043204302344224421442044FFF7B5 -:1080900039FED4F88430013B002BC4F88430CCBFC7 -:1080A00001230323AAE71A6802F00100D24302F079 -:1080B00001024001520102F1440300F14401043283 -:1080C00004302344224421442044FFF77DFE04234E -:1080D00094E71D6804F1040BE84305F0010500F086 -:1080E00001035A4604F1240104A802350293FFF764 -:1080F000F9FD6B0103F1040A04A9A24408465246A3 -:108100000193FFF701F904A908463A46FFF7FCF886 -:1081100004A8FEF7FBFF80B304A8FEF7F3FF04A951 -:10812000084607F12002FFF7EFF8019B04A9A3F12D -:108130003C0525442A460846FFF7E6F8029B2A46F6 -:10814000580100F14401043053462144204404F115 -:108150004405FFF7D7FD04AA29465846FFF778FDE6 -:1081600059464846FEF7DDFF294609F12000FEF793 -:10817000D8FF05232370012042E70CAE304604A946 -:10818000FEF7CFFF424914A8FEF7CBFF1CA8FEF76D -:10819000B9FF012324AD28461C93FEF7B3FFDFF897 -:1081A000F080304614A9FEF7C5FF20B91CA904A829 -:1081B000FEF7B7FFB3E70C9BDA0718D43046FEF79B -:1081C000CDFF1C9810F0010305D01CA942460846BB -:1081D000FEF74CFF03461CA80393FEF7BFFF039B6B -:1081E000002BDED0239B43F000432393D9E7149B5D -:1081F000DB0718D414A8FEF7B1FF249810F0010390 -:1082000005D0424629462846FEF730FF0346284659 -:108210000393FEF7A3FF039B002BC2D02B9B43F0DD -:1082200000432B93BDE7002818DD314614AA3046E1 -:10823000FEF741FF3046FEF791FF29461CA8FEF7E6 -:1082400079FF002804DA1CA942460846FEF70EFF13 -:108250001CA92A460846FEF72EFFB2E714A93246AB -:108260000846FEF728FF14A8FEF778FF28461CA949 -:10827000FEF760FF002804DA424629462846FEF74A -:10828000F5FE294628461CAAFEF715FFB5E700BFF4 -:10829000B0C00301014B1860704700BFF00000211F -:1082A000074B10B5002104464FF4BC72184601F08C -:1082B00034FD2146BDE810400430FFF7F9BC00BF93 -:1082C000A05B00212DE9F341294D2B78012B2BD008 -:1082D000022B40D0002B48D1281DFEF717FF044683 -:1082E00018B1002002B0BDE8F0812248291DFEF738 -:1082F00021FF01280646F4D105F164071D4A05F166 -:108300008408291D3846C5F8A470C5F8A880FEF772 -:10831000ADFE3946C5F8AC00164A4046FEF7A6FE4B -:1083200085F8B0402E70DCE7D5F8AC300024B3FA05 -:1083300083F35B0905EB83030094D3F8A4300E4A62 -:1083400005F1240105F1B000FFF7A6FD0028C8D013 -:1083500002232B70C5E705F12400FFF7B5FC10B12F -:1083600000202870BEE703232B700120BAE700BF6E -:10837000A05B002190C0030130C0030138B5044662 -:10838000084D0846291DFFF77DFC204605F1240114 -:10839000FFF778FC05F1440104F12000BDE8384006 -:1083A000FFF770BCA05B0021014610B5A8B018A86B -:1083B000FFF77EFC203120A8FFF77AFC18A8FFF712 -:1083C00083FC0446002833D11A4818A9FEF7B2FEF0 -:1083D00001282AD1174820A9FEF7ACFE012824D194 -:1083E000684620A9FFF773FA1C22214611A801F064 -:1083F00094FC032318A908A81093FFF768FA08A9AA -:10840000084610AAFFF76EFC08A9084618AAFEF74E -:108410007BFF08A90846084AFFF7C0FC684608A980 -:10842000FEF788FEB0FA80F46409204628B010BD3B -:108430000024FAE7B0C0030170C003012DE9F04148 -:108440004FF4BC7206460F461E48002101F065FC41 -:1084500040241C4DDFF870802021D8F800301948E6 -:10846000984758B32846FEF751FE38BB2D62174C8B -:1084700039462046FFF71CFC3146A4F18000FFF787 -:1084800017FC06F12001A4F16000FFF711FC04F1D4 -:10849000200621460E4A2046C5F8E440C5F8E860AB -:1084A000FEF7E4FD2146C5F8EC00094A3046FEF728 -:1084B000DDFD002385F8F030BDE8F081013CCBD133 -:1084C000D5E700BFA05B0021F0000021445C002143 -:1084D00090C0030107B50B48D0F8EC30026AB3FA3C -:1084E00083F35B09009200EB830300F1240200F1A7 -:1084F0006401D3F8E430F030FFF7CEFC03B05DF850 -:1085000004FB00BFA05B00210149FFF7BBBB00BF1C -:10851000045C002130B4046B0B4684B9C168456823 -:108520001F2998BF23FA01F465B181688B4209D2F3 -:108530000069034055F82400184430BC70472346B6 -:1085400030BC18474FF0FF30F7E770B5069CC4E920 -:108550000002049A21811989E260059A8E1C226129 -:10856000D3E9002502EB0113E36103EB46036E1C24 -:1085700033446D422B4023628369C4E90512618153 -:10858000A1847BB9481E834202EB03140CDB002953 -:108590004FEA001308BF00231A44002393736FF0BF -:1085A0007F03D373002070BD0133E381EBE72DE936 -:1085B000F04F0026B0F82CB004465D46B24685B0B8 -:1085C00002EB03080E9B914600EBCB0253631FFAAC -:1085D00088F313870F1D826908F1FF310191B045BF -:1085E00019DCA28CA585D31AA3846289E369511E84 -:1085F0005A8800200A4003EB4203A3F804B0BFF3FB -:108600005B8FE269538801335380E38C0133E38449 -:1086100005B0BDE8F08FA06A03932B0157F8041C46 -:108620000093036802EB0515C91A83680292994208 -:1086300028BF4FF0FF31FFF76DFF009B029A3968AA -:10864000D050019BA9609E42B6BF012185F80CA0C5 -:10865000297385F80DA0B145D8BFA989C5F804A034 -:10866000DCBF41F00201A981039BED890136083787 -:10867000B5E7F0B550B3056AC38D6C889C4230D025 -:108680005C1CC4854489BFF35B8F013C1C4005EB37 -:10869000C4056B689EB209B1AD680D60D0F818C012 -:1086A0009BB20CEB031100EBC3031D8F878C2F448F -:1086B000013D87841D878D896F070ED5858DCD81FE -:1086C00000218685586B596302B11480F0BD1D8F5F -:1086D000C989013D0CEB01111D878D89ED07F6D489 -:1086E000ECE70020F2E7836903EB01139868704719 -:1086F00010B5044690B1828C43899A4209D0084B48 -:108700001A78032A05D95B681BB142680549042021 -:1087100098472046BDE8104001F0D0BA10BD00BF18 -:10872000185D0021D0C003012DE9F843BFF35B8F32 -:108730001746C2690E465388018E05468B4245D0C6 -:108740004B1C03864389D0F82880013B0B4002EB89 -:1087500043039A8893B2328082691B0152F80390D6 -:10876000D8F834305BBBD8F81040621C09BFD8F889 -:10877000043009EA04041C68A9EB040421464046BD -:10878000FFF7C8FE814509D0D8F8103001331C44EA -:10879000D8F808309C42F1D34FF0FF34D8F80000ED -:1087A000431C11D0D8F80830A3420DD92044328898 -:1087B000AB6903EB02139B683B60BDE8F883494655 -:1087C000404698470446E9E70020F0E70020F4E738 -:1087D00030B544898C4212D3036A013C5D882C4039 -:1087E00003EBC4039A605960BFF35B8F026A53883E -:1087F00001335380C38C0133C384002030BD014852 -:10880000FCE700BF41F4FFFF026893691269920020 -:108810001AD58BB94269C36903EB4203C28D9A80B2 -:10882000BFF35B8F03689B69CBB9036AC08D5B881C -:10883000181A18BF01207047012BF1D14269036A51 -:1088400003EBC203028EEAE72BB9C269138823F057 -:1088500001031380E4E7012BE2D1026AF6E7012B62 -:1088600003D1C369008E5B88E2E70020704702688D -:1088700093691269920015D54BB9C38DC2694169DC -:108880004089013B1B1A02EB410293807047012B88 -:108890000ED1038E026A41694089013B1B1A02EB2B -:1088A000C102F2E72BB9C269138843F001031380B8 -:1088B0007047012BFCD1026AF6E710B5BFF35B8F5E -:1088C000036804461A699B6912F0005F1AD07BB9ED -:1088D000C369026A5B884169013B02EBC10292886D -:1088E0009B1AE28C9BB29A4214D80023E38410BDF9 -:1088F000012BFAD1036AC2695B884169013B02EB33 -:108900004102ECE763B9036A1B88DB4303F0010310 -:10891000002BEAD02369002BE7D020469847E4E7F4 -:10892000012BE2D1C369EFE710B588B0E0B10F4B7E -:108930001A78062A18D95C68B4B1D0E907321188D0 -:10894000079119880691528809490592C28D0492AF -:108950005B880393838D0293C38C0193838C009374 -:10896000438942680720A04708B010BD185D002168 -:10897000F2C00301C269018E53888B420AD0438939 -:10898000013B0B4002EB43039A88836903EB02131C -:108990009868704700207047BFF35B8FC36803B1CE -:1089A0001847704700230121026A30B502F15804CC -:1089B000D4E8EF5F9D4204BFC4E8EC1FBCF1000F98 -:1089C0002B46F5D1436AA3F580637F2B0BD85D0955 -:1089D000483203F01F0301FA03F352F8251021EA8D -:1089E000030342F8253000F13403D0E90D124A6048 -:1089F0001160C0E90D3300230362C4E8AF3F30BD0E -:108A0000F0B4144648B1006A38B133B1013404D02F -:108A1000046E14B1A446F0BC60470148F0BC704736 -:108A20002DF8FFFF30B5456A8DB004460B9120222A -:108A3000014602A80A9501F073FD28230122294668 -:108A4000CDE900322046352202ABFFF7D9FF00EA1C -:108A5000E0700DB030BD28B1006A18B111B1436E9D -:108A600003B11847704728B1006A18B111B1836E7D -:108A700003B11847704728B1006A18B111B1C36E2D -:108A800003B118470020704770B4144648B1006A1B -:108A900038B133B1013404D0046F14B1A44670BCB2 -:108AA0006047014870BC70472DF8FFFF2DE9F8437F -:108AB00007468846154699460668B74203D1002402 -:108AC0002046BDE8F8836A1CA6F1340402D0636A2C -:108AD000AB42F5D0B8F1000F10D02022414620461D -:108AE00001F00AFD50B9B9F1FF3F02D0A36A4B452E -:108AF000E6D06B1C02D1A36A0133E1D03668DCE713 -:108B000070B50C46114605461E460C4B2022002926 -:108B100008BF1946204601F003FD049B6A68A36262 -:108B2000059BC4E90D52E362069B6662236304F170 -:108B3000340325626B60A26B136070BDF1C003014A -:108B40002DE9FF410E46054600286BD001F158077C -:108B500000200121D7E8EF4F844204BFC7E8EC1F93 -:108B6000BCF1000F2046F5D1581C1BD1002306F1A3 -:108B70004801580901EB800C51F8200003F01F0454 -:108B800020FA04FE1EF0010F07D10121A14001438C -:108B900003F58063CCF800101DE00133802BE8D191 -:108BA000224C3BE0B3F5806F15D3A3F580607F289E -:108BB00006F1480431D84FEA501C54F82CE000F07C -:108BC0001F002EFA00F818F0010FE9D1814041EAA8 -:108BD0000E0144F82C100C99304602910B9901912A -:108BE0000A9900912946FFF78BFF0023C7E8AF3FA2 -:108BF0002C7874B196F874405CB1AB6A013313D130 -:108C000000212846FFF70EFF044610B12846FFF763 -:108C1000C9FE204604B0BDE8F081054C0023C7E83A -:108C2000AF3FF6E7024CF4E70024F2E729F8FFFF34 -:108C30002DF8FFFF10B5044688B1036A7BB10278B6 -:108C40004AB193F8743033B1436AB3F5806F02D3FD -:108C50000121FFF7E7FE2046BDE81040A2E610BD67 -:108C600051F8083C43F0004341F8083C7047704716 -:108C70000023C0E8AF3F7047F0B5282A0E4689B000 -:108C800032D1056A2023D5F88C006A4601688468D1 -:108C9000711AA14228BF4FF0FF3100F03FFD0023C1 -:108CA0000121376A05F15804D4E8EF2F9A4204BF36 -:108CB000C4E8E01F00281346F6D13B464FF0FF32D0 -:108CC00069462846FFF7F2FE736A0246DB070ED5B7 -:108CD00010B14FF0FF3383622046FFF7C9FF1AB18E -:108CE000136B0BB110469847002009B0F0BD50B986 -:108CF0002046FFF7BDFFEB6D002BF5D03A466946E5 -:108D000028469847F0E787622046FFF7B1FFEBE778 -:108D10007FB50C461946D0F880309D695DB9009446 -:108D2000CDE9024201232A46D0F8840002A9FFF7C8 -:108D30003EFC04B070BD012DFBD1D0F8840004B01E -:108D4000BDE87040FFF744BD2DE9F043A3F11009E1 -:108D500053F8088C102300250446D0F88C0089B005 -:108D6000CDE9041201688768109EA9EB0101B942A0 -:108D700028BF4FF0FF310DEB0302ADF81C600695E4 -:108D8000ADF81E5000F005FD10281FFA88F806D037 -:108D900040F28B11204B214A214800F057FF01225D -:108DA00004F15807D7E8EF3FAB4204BFC7E8E12F13 -:108DB00000291D46F6D1D4F880309B69A3B9A26F73 -:108DC000D4F88030D4F888009B69A3B9CDE9029229 -:108DD000CDF80090012202A9FFF7E9FB88B14FF41A -:108DE000CC71104B0D4AD7E74146D4F88800FFF705 -:108DF0007AFC0246E4E7012B03D14146FFF7E8FC89 -:108E0000ECE7D4F88800FFF758FD3846FFF730FF4D -:108E1000304609B0BDE8F0837BC1030148C20301BD -:108E200094C1030111C20301F8B5A1F1100751F873 -:108E3000085C044600230121ADB200F15806D6E8D3 -:108E4000EF2F9A4204BFC6E8E01F00281346F6D170 -:108E50002946D4F88400FFF746FC2B4602463946E3 -:108E60002046FFF755FF3046BDE8F84000E730B434 -:108E7000D0F880501346AD6925B930BCD0F88400D5 -:108E8000FFF7F7BB012D06D130BC0A46D0F88400AD -:108E90001946FFF749BC002030BC704703682DE934 -:108EA000F04301215F6A002385B007F15805D5E83A -:108EB000EF2F9A4204BFC5E8E01F00281346F6D101 -:108EC00038460DF10A0203A9FFF7D1FF04462846F0 -:108ED000FFF7CEFE4FF0010814B905B0BDE8F083EE -:108EE000BDF80A30A3600023D5E8EF2F9A4204BFF3 -:108EF000C5E8E18F00291346F6D14FF0FF3300217A -:108F000038466268FFF7D2FD06462846FFF7B0FEF6 -:108F1000B6B1B26A23680132F16B08BFB362A289AD -:108F200000913046D6F82C9004F11001C847002873 -:108F300006DA4FF40271144B144A154800F086FE0D -:108F40000023D5E8EF2F9A4204BFC5E8E18F00293E -:108F50001346F6D1A368002B06DB21463846BDF840 -:108F60000A30039AFFF7D4FE38460DF10A0203A92E -:108F7000FFF77DFF044618B9D7F88400FFF79DFC82 -:108F80002846FFF775FEA7E71DC203016CC2030167 -:108F900094C103010346426810B58A4229BF806824 -:108FA0000020841A186822BF521A00195A6010BD96 -:108FB0002DE9F3478146D0F880000E46036A154636 -:108FC0001B689847430747D543F69823002D18BFE1 -:108FD0001D464FF0010809F158070023D7E8EF2F8D -:108FE0009A4204BFC7E8E18F00291346F6D1D9F8A9 -:108FF0008030D3F818A0BAF1000F21D13146D9F84A -:1090000088000DF10602FFF734FB044620B9D9F8B9 -:1090100088309B8C3BB900243846FFF729FEFCB909 -:10902000D5B1013DD9E7D9F87810D9F89000FFF70C -:10903000B1FFD9F8783004463360ADF806A0EBE70D -:10904000BAF1010FE7D13246D9F888000DF10601D7 -:10905000FFF76AFB0446DFE7002002B0BDE8F087B7 -:10906000BDF8063004F11000A3603368103B336094 -:10907000F3E72DE9F04385B00F46904603A90D9A1A -:1090800006469946FFF794FF044628B30C9D039BC0 -:10909000D6F88C009D42A8BF1D460168D0F808C0D4 -:1090A000611A614528BF4FF0FF312B464A4600F058 -:1090B00070FB854206D04FF4E471084B084A09481A -:1090C00000F0C4FD23464246394630460095FFF77E -:1090D0003BFE05B0BDE8F0830348FAE729C203016F -:1090E00085C2030194C103012EF8FFFF10B1C0E94E -:1090F00001220160704710B5D8B10023012100F1B1 -:109100005804D4E8EF2F9A4204BFC4E8EC1FBCF126 -:10911000000F1346F5D1D0F880309B695BB9826FA0 -:10912000103A002A00DC084A2046FFF7A1FD10464D -:1091300010BD064AFBE7012BF5D1D0F88800FFF7F8 -:1091400019FCA0F11002ECE72EF8FFFF2DF8FFFF4D -:109150002DE9F04704460D4690468AB07822DDE9B5 -:10916000129700211E4600F0D8FD04F15800FFF7C9 -:109170007FFD674BC4F85C80C4F880506C62236646 -:10918000644BD5F818806366634BA366634BE36654 -:10919000634B2367B8F1000F70D127B9614F384690 -:1091A0000AB0BDE8F08704F1780397E8030083E88C -:1091B0000300D4F88000036A9B6898470023286165 -:1091C00000F001006B6184F87400B8F1000F69D100 -:1091D000B9F1000FE2D0D9F80830002B00F09580EB -:1091E000514BC4F890900493504B0593504B069309 -:1091F000504B0793EB6A1A689B69C4F88420C4F843 -:10920000883006AB009302220021D4F88000C4F815 -:109210008C6004AB00F0C5F807460028BFD1D4F835 -:109220008800FFF724FBEB6A1A689B6996629E62CE -:10923000B8F1000F07D1C246E36F0993D4F8843028 -:109240005B8953453FD894F87430C4E900445BB15E -:1092500000230293384B204601933523374A00936D -:1092600004F10801FFF74CFCB8F1000F97D1D4F8D6 -:1092700080000421036A5B68984790E7B8F1010F0A -:1092800097D1D4F88000036A1B689847420606D538 -:10929000D4F880000021036A5B689847F1E7430730 -:1092A000EFD586E7B8F1010FABD1204B04931E4BED -:1092B0000593204B06931E4B0793EB6A9A691B6834 -:1092C000C4F884209BE74846E16FFFF763FE05463C -:1092D000C0B131680890411AB0680022814228BFAD -:1092E0004FF0FF31E36F304600F08DFA012300228A -:1092F000D4F88400009508A9FFF759F918B90AF1C4 -:10930000010A9BE70E48074649E70D4F47E700BFB4 -:1093100073900301618C0301298E0301B18F030156 -:10932000498D03012DF8FFFF37C203013DC2030140 -:109330009D8E03016F8C0301798C030143C20301ED -:109340002EF8FFFF7FB505460E46074902AC03C95C -:1093500084E8030008992846009101943146FFF7FC -:10936000F7FE04B070BD00BFA8C2030110B50446EB -:109370002068844203D10023C4E9213310BD34386E -:10938000FFF758FCF4E700BF0246044B586800B9E9 -:10939000704719889142FBD00833F7E7F4C2030104 -:1093A00070472DE9F04F87B00593836A05469342D5 -:1093B000164649D300244FF0180BB44203D10020C5 -:1093C00007B0BDE8F08F0BFB04F7D5F82C80AA6935 -:1093D00008EB070C0CF1040902BBDCF81400BCF824 -:1093E0000CE0DCF804300168DCF808C0591A0CF114 -:1093F000FF3303EB0E130EF1030ACCF1000C03EB69 -:109400004A0303EA0C03D0F808C003EBCE0361451E -:1094100028BF4FF0FF31063300F0F5F958F8073058 -:10942000059A02932B6A28461B6AA1B20193109BEE -:1094300053F82430009352F824204B46FFF785F868 -:109440000028BDD10134B8E70048B9E740F4FFFF78 -:109450002DE9F0410E4617460C4D55F8184FAC4219 -:1094600003D16FF01200BDE8F081314654F8440C8E -:10947000A4F1440801F036F830B94046C7F800803E -:10948000BDE8F04100F010BA2468E8E7185D00215B -:10949000F8B5DDE906549C421746194604D00C2263 -:1094A00020466A4300F012FC0026AE4201DB28464B -:1094B000F8BD022F03D1A168206800F035FAA16839 -:1094C00054F80C0B00F031FA0136EEE770B51C468B -:1094D0000025049EB54204F10C0400DB70BD54F875 -:1094E000041C54F80C0C00F020FA0135F2E700F1EE -:1094F000240310B5D0E909124A601160C0E90933AC -:109500004368044603B19847054B1A78062A05D9E3 -:109510005B681BB10720226802499847002010BDF4 -:10952000185D00213CC303012DE9F04107460D46BB -:109530000B4E56F8084FB44202D16FF001000AE01A -:10954000394654F8240CA4F1240800F0CBFF20B9CC -:109550001DB1C5F80080BDE8F0812468EBE700BFCD -:10956000185D002110B5044600B30068F0B103781F -:10957000E3B10021FFF7D8FFD8B104F11C03C4E91F -:1095800007330E4B04F12402D96803F10800DA60B6 -:10959000A16260620A601A78062A05D95B685BB12D -:1095A0000720226806499847002001E06FF0150067 -:1095B00010BD6FF01000FBE71846F9E7185D0021B9 -:1095C0003EC3030137B50C46154688B103787BB11D -:1095D00071B10B7863B15AB101A9FFF7A5FF28B9A2 -:1095E000019883683BB12A462146984703B030BDB5 -:1095F0006FF01500FAE76FF01200F7E7014610B5BB -:1096000008B1406828B95121054B064A064800F0C8 -:109610001DFBC36813B1BDE81040184710BD00BF63 -:1096200051C30301D8C3030167C30301036810B525 -:1096300093B11B7883B18368012B0DD8084B00F1DF -:1096400044014360074BDA6903F1180482644464FF -:109650000020D961116010BD6FF01500FBE700BF5D -:10966000F4000021185D00210E4B10B504462022A5 -:109670000021184600F051FB226842600246217921 -:1096800002F8081BC0E9022200F11002C0E904221E -:1096900000F11802C0E906222046BDE8104000F0A3 -:1096A0000FB900BF185D002108B500F011F9BDE841 -:1096B000084020220021014800F02FBB185D002146 -:1096C0002DE9F04788B00646DDE910498A46904604 -:1096D0000021202268461F46129D00F01EFB1F2C11 -:1096E00097BF01234FF0FF33A34003F1FF33C6E9D7 -:1096F0000274C6E900A8C6E9043906F118045DB190 -:109700000FCD0FC495E80F0084E80F00304608B075 -:10971000BDE8F04700F0E2B86D46F1E773B50468C4 -:10972000661C33D08568A94230D264182ED05E18EA -:10973000AE4288BF6B1A056A35B100930523A8476E -:109740000346184602B070BD2146BFF35B8F184632 -:109750000028F6D042EA0105AD070C460AD10328DD -:109760000EDC013C10448242EBD014F8011F02F8D9 -:10977000011BF8E711F8014B013802F8014BE7E74C -:1097800054F8041B043842F8041BE8E76FF0210387 -:10979000D7E773B50468661C32D08568A9422FD21A -:1097A00064182DD05E18AE4288BF6B1A456A35B971 -:1097B0002146184670B9BFF35B8F184602E000934C -:1097C0000523A84702B070BD12F8014B013801F81B -:1097D000014BEFE741EA0205AD071446F4D1032837 -:1097E00008DC013C08448142E5D014F8012F01F85F -:1097F000012BF8E754F8042B043841F8042BEEE76A -:109800006FF02100DEE7F7B504681646621C1D46BE -:109810002DD0836899422AD2641828D06A18876AA2 -:109820009A4288BF5D1A37B1052332460095B84782 -:10983000284603B0F0BD20462A4632B9BFF35B8FFD -:10984000F6E700F8016B013AF7E78307F9D1330631 -:1098500043EA0643334343EA0623032A03DC314643 -:1098600000F05BFAEAE740F8043B043AF5E76FF0F2 -:109870002105DDE70EB403B07047014B5860704717 -:10988000185D0021014B5868704700BF185D00212A -:10989000014B1870704700BF185D0021014B18780C -:1098A000704700BF185D0021826808B5034622B1E9 -:1098B0005B690C300BB100F011F8002008BD00000E -:1098C00008B50248FFF74EFE002008BDF400002155 -:1098D0000148FFF70CBE00BFF40000212DE9F04164 -:1098E00085680446CDB1C368002635FA03F218BF77 -:1098F0000125076818BF9D404FEA850861682A4620 -:109900003846636951F8261000F011F8D4E90232A4 -:109910000136D340B3424744F0D2BDE8F0817047EE -:109920000020704770477047704770477047704716 -:1099300053B94AB9002908BF00281CBF4FF0FF31B6 -:109940004FF0FF3000F080B9ADF1080C6DE904CEA6 -:1099500000F006F8DDF804E0DDE9022304B070470A -:109960002DE9F04F099E0D4604460F46002B47D1C6 -:109970008A4294465FD9B2FA82F343B1C3F120011F -:109980009F4002FA03FC9C4020FA01F10F434FEA8A -:109990001C451FFA8CFE220CB7FBF5F105FB117775 -:1099A00001FB0EF042EA0742904208D91CEB02028A -:1099B00001F1FF3702D2904200F234813946121A87 -:1099C000A4B2B2FBF5F005FB102200FB0EFE44EA48 -:1099D0000244A64508D91CEB040400F1FF3202D270 -:1099E000A64500F21981104640EA0140A4EB0E049E -:1099F00000211EB1DC400023C6E90043BDE8F08F22 -:109A00008B4208D9002E00F0FB800021C6E900053A -:109A10000846BDE8F08FB3FA83F100294BD1AB4281 -:109A2000C0F0F180824240F2EE800846002EE5D080 -:109A3000C6E90047E2E702B9FFDEB2FA82F3002B83 -:109A400040F09D808D1A4FEA124E97B20121B5FB6E -:109A5000FEF20EFB1250250C45EA004507FB02F012 -:109A6000A8420FD91CEB050502F1FF382CBF4FF0BF -:109A700001094FF00009A84203D9B9F1000F00F025 -:109A8000CE8042462D1AA4B2B5FBFEF00EFB105557 -:109A900000FB07F744EA0544A74208D91CEB04047D -:109AA00000F1FF3502D2A74200F2B3802846E41B42 -:109AB00040EA02409DE7C1F120078B4005FA01F41E -:109AC00022FA07FCFD408A404CEA030C20FA07F317 -:109AD0004FEA1C491C431FFA8CFE00FA01F3200CCC -:109AE000B5FBF9F809FB185540EA054508FB0EF0EF -:109AF000A8420FD91CEB050508F1FF3A2CBF4FF027 -:109B0000010B4FF0000BA84203D9BBF1000F00F08E -:109B10008C80D0462D1AA4B2B5FBF9F009FB105584 -:109B200000FB0EFE44EA0545AE4507D91CEB0505D2 -:109B300000F1FF3401D2AE457ED8204640EA08400D -:109B4000A5EB0E05A0FB029845454C46C64602D340 -:109B500006D14B4504D20138B9EB020468EB0C0E78 -:109B6000002E6FD01A1B65EB0E0522FA01F305FAE1 -:109B700007F7CD4000211F43C6E900753EE702FA12 -:109B800003FCC3F1200001FA03F24FEA1C4EC1406E -:109B900024FA00F51FFA8CF79C401543B1FBFEF048 -:109BA0002A0C0EFB101142EA014200FB07F1914220 -:109BB0000ED91CEB020200F1FF382CBF4FF0010957 -:109BC0004FF00009914202D9B9F1000F31D040465F -:109BD000521AADB2B2FBFEF10EFB112245EA02456C -:109BE00001FB07F2AA4207D91CEB050501F1FF387A -:109BF00001D2AA4223D84146AD1A41EA004126E7E4 -:109C000031463046FAE6841A65EB030301201F460D -:109C10000CE7644402384AE764440238E4E6023A56 -:109C200065442FE702396244C9E6A8F10208654499 -:109C300070E702386244CBE7023865447EE70239B8 -:109C40006544D9E73146D9E6704700BF1FB51446D1 -:109C50001A46094B05461B68D8684CB1074B009162 -:109C60000749CDE901342B4600F00EF800F02CFD39 -:109C7000044B1C46F3E700BF20010021EBC30301A6 -:109C8000F8C30301F1C003010EB403B503AB0146F1 -:109C9000054853F8042B0068019300F04DF902B019 -:109CA0005DF804EB03B0704720010021024B014630 -:109CB000186800F0A5B800BF20010021024B014642 -:109CC000186800F033B800BF200100210A44431E89 -:109CD000914200D1704710B511F8014B914203F841 -:109CE000014FF9D110BD884210B501EB020402D931 -:109CF0008442234607D8431EA14208D011F8012B05 -:109D000003F8012FF8E7024401468A4200D110BD52 -:109D100013F8014D02F8014DF7E702440346934260 -:109D200000D1704703F8011BF9E7000038B505467C -:109D3000002941D051F8043C0C1F002BB8BFE41897 -:109D400000F0F2FE1D4A136833B9636014602846C0 -:109D5000BDE8384000F0EEBEA34208D920682118C3 -:109D60008B4201BF19685B6809182160EDE71A464C -:109D70005B680BB1A342FAD911685018A0420BD10D -:109D800020680144501811608342E0D118685B6874 -:109D9000014453601160DAE702D90C232B60D6E747 -:109DA000206821188B4202BF19685B68091863603C -:109DB00008BF21605460CAE738BD00BF385D00218C -:109DC00070B50E4E0C460546316811B900F07AFBAD -:109DD00030602146284600F075FB431C0AD0C41CA5 -:109DE00024F00304A04207D0211A284600F06AFBA1 -:109DF000013001D14FF0FF34204670BD3C5D0021A1 -:109E00002DE9F041CD1C074625F0030508350C2D42 -:109E100038BF0C25002D01DBA94205D90C230026F3 -:109E20003B603046BDE8F0812E4E00F07DFE336889 -:109E30001C4634BB29463846FFF7C2FF431C044684 -:109E40004DD134682646002E40D12368314638462D -:109E500004EB030800F036FB80453AD12168033556 -:109E600038466D1A25F0030508350C2D38BF0C2532 -:109E70002946FFF7A5FF01302BD023682B44236030 -:109E80000EE02268521B1ED40B2A16D96119A34278 -:109E9000256018BF5960636808BF316062514B602C -:109EA00004F10B06384600F045FE231D26F0070698 -:109EB000F21AB6D09B1BA350B3E76268A3420CBF53 -:109EC00032605A60ECE723466468B2E7344676684D -:109ED000B9E70C2338463B6000F02CFEA1E7256073 -:109EE000DEE700BF385D00219368013B002B9360E3 -:109EF00010B407DA9469A34201DB0A2902D110BC2D -:109F000000F022BB1368581C10600846197010BC82 -:109F10007047F8B506460F461446D518AC4201D135 -:109F2000002007E03A4614F8011B3046FFF7DCFF3B -:109F3000431CF3D1F8BD00002DE9F04F0D469DB054 -:109F400014469846064618B183690BB900F0D8FC50 -:109F5000894B9D421BD175686B6ED90705D4AB89BF -:109F60009A0502D4A86D00F069FDAB891B0701D5E5 -:109F70002B69EBB92946304600F038FBC0B16B6E57 -:109F8000DC070ED54FF0FF301DB0BDE8F08F7B4BE6 -:109F90009D4201D1B568DFE7794B9D4208BFF56866 -:109FA000DAE7AB899805EDD4A86D00F048FDE9E744 -:109FB0000023CDF80C804FF00109DFF8C881099328 -:109FC00020238DF8293030238DF82A3023469A46F5 -:109FD00013F8012B0AB1252AF9D1BAEB040B0BD0E7 -:109FE0005B46224629463046FFF793FF013000F0DA -:109FF000AA80099A5A4409929AF80030002B00F07E -:10A00000A28000234FF0FF320AF1010A0493079364 -:10A010008DF853301A93CDE905235446052259484B -:10A0200014F8011B00F072FD049AD8B9D10644BFA0 -:10A0300020238DF85330130744BF2B238DF8533062 -:10A040009AF800302A2B15D0079A544600204FF07A -:10A050000A0C214611F8013B303B092B4ED9B0B117 -:10A06000079214E0A0EB0803A24609FA03F3134396 -:10A070000493D2E7039B191D1B68002B0391BBBF00 -:10A080005B4242F0020207930793B8BF0492237821 -:10A090002E2B0CD163782A2B35D1039B02341A1D49 -:10A0A0001B68002B0392B8BF4FF0FF330593DFF816 -:10A0B000D8A003222178504600F028FD40B140236B -:10A0C000A0EB0A00013403FA00F0049B034304935D -:10A0D00014F8011B06222D488DF8281000F016FDFB -:10A0E00000283FD02A4B1BBB039B073323F00703F9 -:10A0F00008330393099B3B44099367E70CFB023247 -:10A100000C460120A5E7002301344FF00A0C194644 -:10A110000593204610F8012B303A092A03D9002B69 -:10A12000C5D00591C3E70CFB012104460123F0E7EC -:10A1300003AB2A4604A930460093164B00E000BF4B -:10A140000746781CD6D16B6ED90705D4AB899A0522 -:10A1500002D4A86D00F073FCAB895B063FF512AF2B -:10A16000099811E703AB2A4604A930460093094B2E -:10A1700000F082F8E4E700BF80C40301A0C403013B -:10A1800060C403012CC4030132C4030136C40301BB -:10A1900000000000139F03012DE9F0471646994681 -:10A1A0008A6807460B690C46DDF820809342B8BFE9 -:10A1B0001346336091F843200AB1013333602368BA -:10A1C000990642BF336802333360256815F00605EF -:10A1D00006D104F1190AE36832689B1AAB4229DC04 -:10A1E00094F84320131E226818BF012392062ED430 -:10A1F00004F1430249463846C047013021D0236864 -:10A200001A3454F80E5C03F0060332680026042B5F -:10A2100054F8123C08BFAD1A54F80A2C14BF00259C -:10A2200025EAE5759342C4BF9B1AED18B5421AD1D1 -:10A23000002008E00123524649463846C047013015 -:10A2400003D14FF0FF30BDE8F0870135C3E7E118D7 -:10A250005A1C30200233224481F8430094F8451000 -:10A2600082F84310C4E70123224649463846C047D6 -:10A270000130E6D00136D9E72DE9FF470F7E914640 -:10A2800080460C46782F9A460C9D01F1430207D870 -:10A29000622F0AD8002F00F0D880582F00F0A3803A -:10A2A00004F1420584F842703AE0A7F16303152BEC -:10A2B000F6D801A151F823F011A3030125A303014E -:10A2C000A1A20301A1A20301A1A20301A1A2030172 -:10A2D00025A30301A1A20301A1A20301A1A20301DD -:10A2E000A1A2030131A4030155A3030113A4030197 -:10A2F000A1A20301A1A2030153A40301A1A203018E -:10A3000055A30301A1A20301A1A203011BA4030100 -:10A310002B681A1D1B682A6004F1420584F842303C -:10A320000123A3E020682968060601F104030AD589 -:10A330000E682B60002E03DA2D23764284F843301A -:10A340005E480A2319E00E6810F0400F2B6018BF1A -:10A3500036B2EFE72B682068191D2960010601D588 -:10A360001E6802E04606FBD51E886F2F53480CBFBF -:10A3700008230A23002184F843106568002DA56096 -:10A38000A2BF216821F0040121600EB9002D4DD03B -:10A390001546B6FBF3F103FB1167C75D05F8017DB8 -:10A3A00037460E46BB42F4D9082B0BD12368DE0793 -:10A3B00008D5236961689942DEBF302305F8013C66 -:10A3C00005F1FF35521B22614B4603AA2146404648 -:10A3D000CDF800A0FFF7E0FE01304CD14FF0FF3088 -:10A3E00004B0BDE8F087354881F8457029682368D6 -:10A3F00051F8046B29601D0614D5DF0744BF43F0F4 -:10A40000200323601EB9236823F020032360102358 -:10A41000B0E7236843F0200323607823284884F8BA -:10A420004530E3E7590648BFB6B2E6E71546BBE755 -:10A430002B682668181D6169286035061B6801D5E0 -:10A44000196002E07006FBD51980002315462361D0 -:10A45000BAE72B6800211A1D2A601D686268284629 -:10A4600000F054FB08B1401B606063682361002367 -:10A4700084F84330A8E723692A4649464046D04736 -:10A480000130ABD023689B0713D4E068039B98424C -:10A49000B8BF1846A4E70123324649464046D04794 -:10A4A00001309BD00135E36803995B1AAB42F2DCC3 -:10A4B000EBE7002504F11906F5E700BF3DC40301F1 -:10A4C0004EC4030138B50023054D044608462B60F1 -:10A4D000FAF7DCFC431C02D12B6803B1236038BDC2 -:10A4E000445D002110F8012B11F8013B012A28BF1F -:10A4F0009A42F7D0D01A7047034610B572B10139AD -:10A50000841813F8010B11F8012F904201D1A342D6 -:10A5100001D1801A10BD0028F3D1FAE71046F9E7FF -:10A520000139034610B532B111F8014F013A03F871 -:10A53000014B002CF7D11A440021934200D110BDE9 -:10A5400003F8011BF9E70000F8B50E46144605466E -:10A5500018B183690BB900F0D3F9214B9C422BD180 -:10A560006C68A369A360A3891A072FD523696BB30D -:10A570002369F6B220683746C01A6369834204DC57 -:10A580002146284600F028F930BBA3680130013B82 -:10A59000A36023685A1C22601E706369834204D042 -:10A5A000A389DB0706D50A2E04D12146284600F0F0 -:10A5B00013F988B93846F8BD0A4B9C4201D1AC6802 -:10A5C000CFE7094B9C4208BFEC68CAE72146284602 -:10A5D00000F00CF80028CBD04FF0FF37EAE700BFBF -:10A5E00080C40301A0C4030160C40301324B70B5F1 -:10A5F0001D6806460C4625B1AB6913B9284600F024 -:10A600007FF92E4B9C420FD16C68A389B4F90C20C2 -:10A6100019072CD4DD0611D40923336042F040031E -:10A620004FF0FF30A3813EE0254B9C4201D1AC6846 -:10A63000EBE7244B9C4208BFEC68E6E7580712D5CD -:10A64000616B41B104F14403994202D03046FFF7F7 -:10A650006DFB00236363A38923F02403A3810023FC -:10A66000636023692360A38943F00803A3812369FE -:10A670004BB9A38903F42073B3F5007F03D02146BF -:10A68000304600F003FAA089B4F90C2010F0010361 -:10A690000AD00023A36063695B42A361236943B9C5 -:10A6A00010F08000BAD170BD810758BF6369A36004 -:10A6B000F4E70020F7E700BF2001002180C4030178 -:10A6C000A0C4030160C40301062008B500F060FACD -:10A6D000012000F035FB00008A89F8B50546100717 -:10A6E0000C4657D44B68002B04DC0B6C002B01DCB0 -:10A6F0000020F8BDE66A002EFAD0002312F4805242 -:10A700002F682B6032D0606DA3895A0705D5636826 -:10A71000C01A636B0BB1236CC01A00230246E66AB1 -:10A720002846216AB047431CA38906D129681D2900 -:10A730002CD8284ACA40D60728D50022D9046260FE -:10A740002269226004D5421C01D12B6803B96065DF -:10A75000616B2F600029CBD004F14403994202D0F1 -:10A760002846FFF7E3FA00206063C2E7216A01236D -:10A770002846B047411CC7D12B68002BC4D01D2BE5 -:10A7800001D0162B01D12F60B2E7A38943F040031B -:10A79000A381AEE70F69002FAAD093070E680F6060 -:10A7A0000CBF4B690023F61B8B60002EA0DD3346E7 -:10A7B0003A46216A2846D4F828C0E047002806DC3B -:10A7C000A3894FF0FF3043F04003A38191E7074492 -:10A7D000361AEAE70100402038B50B6905460C46F9 -:10A7E00013B90025284638BD18B183690BB900F0AC -:10A7F00087F8144B9C421BD16C68B4F90C30002BC9 -:10A80000EFD0626ED00704D4990502D4A06D00F099 -:10A8100015F928462146FFF75FFF636E0546DA0704 -:10A82000E0D4A3899B05DDD4A06D00F008F9D9E739 -:10A83000054B9C4201D1AC68DFE7044B9C4208BF4A -:10A84000EC68DAE780C40301A0C4030160C403011B -:10A85000002310B504468360818119464366C28196 -:10A8600008228361C0E90033C0E904335C30FFF79C -:10A8700054FA054B24626362044BA362044BE36207 -:10A88000044B236310BD00BFC9AB0301EBAB030155 -:10A8900023AC030147AC0301014900F0AFB800BF8E -:10A8A000D9A7030170B568224D1E0E46554305F128 -:10A8B0007401FFF7A5FA044640B1002105F16802D2 -:10A8C000C0E900160C30A060FFF727FA204670BDE3 -:10A8D000014800F0B3B800BF415D0021014800F01D -:10A8E000AEB800BF415D0021014800F0A7B800BF2D -:10A8F000425D0021014800F0A2B800BF425D002186 -:10A9000010B50446FFF7F0FFA3691BB1BDE8104086 -:10A91000FFF7F0BFC4E9123323652046124B134AF8 -:10A920001B68A262A34204BF0123A36100F020F8C8 -:10A930006060204600F01CF8A060204600F018F887 -:10A9400000220421E0606068FFF782FF01220921F4 -:10A95000A068FFF77DFF02221221E068FFF778FF71 -:10A960000123A361D2E700BF28C4030199A8030112 -:10A97000F8B50746FFF7ACFF1E4B1E68B36913B965 -:10A980003046FFF7BDFF4836D6E90134013B03D519 -:10A9900033680BB33668F7E7B4F90C50D5B9164BEA -:10A9A00004F158006566E36000F047F8FFF796FF92 -:10A9B0000822294604F15C002560A561C4E901551F -:10A9C000C4E90455FFF7A9F9C4E90D55C4E91255C6 -:10A9D0002046F8BD6834D9E704213846FFF762FF06 -:10A9E000044630600028D5D1FFF778FF0C233B6088 -:10A9F000EEE700BF28C403010100FFFF2DE9F84383 -:10AA00000646884600F148040027D4E90195B9F1CB -:10AA1000010905D52468002CF7D13846BDE8F88334 -:10AA2000AB89012B07D9B5F90E30013303D0294684 -:10AA30003046C04707436835E9E7704770477047BD -:10AA400070B50E46B1F90E1096B0144600291D4699 -:10AA500008DAB6F90C3000222A601A0610D44FF436 -:10AA600080630EE06A4600F015F90028F1DB019AD8 -:10AA700002F47042A2F500535A425A412A60EEE7AE -:10AA800040230020236016B070BD00008B8973B591 -:10AA90009D0706460C4607D504F147032360236152 -:10AAA0000123636102B070BD01AB6A46FFF7C8FFC6 -:10AAB000009905463046FFF7A3F948B9B4F90C30C0 -:10AAC0009A05EFD423F0030343F00203A381E3E7E5 -:10AAD0000D4BB362A389206043F080032061A38102 -:10AAE000009B6361019B5BB1B4F90E10304600F02E -:10AAF000E3F828B1A38923F0030343F00103A38102 -:10AB0000A0890543A581CDE799A80301C9B20346F1 -:10AB1000024410B59342184601D1002003E00478A6 -:10AB200001338C42F6D110BD0148FFF787BF00BF4B -:10AB3000405D00210148FFF782BF00BF405D00215A -:10AB40001F2938B504460D4604D9162303604FF07B -:10AB5000FF3038BD426C12B152F821304BB920465B -:10AB600000F030F82A4601462046BDE8384000F0A3 -:10AB700017B8012B0AD0591C03D1162303600120FA -:10AB8000E7E70024284642F8254098470020E0E700 -:10AB9000024B01461868FFF7D3BF00BF2001002118 -:10ABA00038B50023064D0446084611462B6000F0D8 -:10ABB000BFF8431C02D12B6803B1236038BD00BF2E -:10ABC000445D002100F0ACB810B50C46B1F90E1090 -:10ABD00000F094F80028ABBF636DA3891B1823F421 -:10ABE0008053ACBF6365A38110BD2DE9F0411F46C2 -:10ABF0008B8905460C46DB05164605D50223002247 -:10AC0000B1F90E1000F068F8A3893246B4F90E10BD -:10AC1000284623F48053A3813B46BDE8F04100F071 -:10AC200017B810B50C46B1F90E1000F055F8431CDA -:10AC3000A38915BF606523F4805343F48053A38137 -:10AC400018BFA38110BDB1F90E1000F013B80000B9 -:10AC500038B50446064D0846114600222A601A46B9 -:10AC6000FAF712F9431C02D12B6803B1236038BDF7 -:10AC7000445D002138B50023054D044608462B608D -:10AC8000FAF7F8F8431C02D12B6803B1236038BDF2 -:10AC9000445D002138B50023064D044608461146A0 -:10ACA0002B60FAF7E9F8431C02D12B6803B123604B -:10ACB00038BD00BF445D002138B50023054D044672 -:10ACC00008462B60FAF7DAF8431C02D12B6803B16F -:10ACD000236038BD445D002138B50446064D084662 -:10ACE000114600222A601A46FAF7CAF8431C02D11C -:10ACF0002B6803B1236038BD445D002138B504469C -:10AD0000064D0846114600222A601A46FAF7BAF89C -:10AD1000431C02D12B6803B1236038BD445D002180 -:10AD2000024B58224FF0FF301A607047445D0021FB -:10AD3000024B58224FF0FF301A607047445D0021EB -:10AD4000FEE700BFF8B500BFF8BC08BC9E467047E0 -:10AD5000F8B500BFF8BC08BC9E4670477372616DC1 -:10AD6000782E73686D0067656E65726963006E7238 -:10AD7000665F62745F686369000000007598030194 -:10AD800006000000010000000200000004000000B6 -:10AD9000080000001000000020000000400000003B -:10ADA000800000000001000000020000000400001C -:10ADB000000800000010000000200000004000001B -:10ADC00000800000010000000200000004000000FC -:10ADD00008000000100000002000000040000000FB -:10ADE00080000000000100000002000000040000DC -:10ADF00000080000001000000020000000400000DB -:10AE00000080000001000000C18D0001CD8D000117 -:10AE1000D98D0001000000000000000000000000CB -:10AE20000000000000000000DD8D000103000008AC -:10AE30000300000402000000500C0021020000008A -:10AE4000540C002182868A8EA2A6AAAEC2C6CACEA1 -:10AE5000E2E6EAEE1115191D3135393D5155595DBE -:10AE60007175797D081014182030343840444C5CDA -:10AE700058607078F4ECE8E4DCCCC8C4BCB8B0A08E -:10AE8000A49C8C841000100000000000C814002155 -:10AE9000D80F002138190021314749420000000035 -:10AEA0000000000000000000324749423347494299 -:10AEB0000B01000DFFFF0203FFFF040F0506070053 -:10AEC000F401FA00960064004B0032001E001400EA -:10AED000403D0021B041002120460021BD1A3CCD5B -:10AEE000A6B8995899B740EB7B60FF4A503F10D203 -:10AEF000E3B3C974385FC5A3D4F6493F00E69D3576 -:10AF00000E480103CCDBFDF4AC1191F4EFB9A5F9C7 -:10AF1000E9A7832C5E2CBE97F2D203B0208BD28996 -:10AF200015D08E1C742430ED8FC24563765C1552AB -:10AF30005ABF9A32636DEB2A65499C80DC000000A1 -:10AF4000075A0201795A02013B5A0201000000002F -:10AF50007DC8000109C90001000000004DC90001C1 -:10AF6000E9C8000165C90001E9C8000115C900016F -:10AF700000000000000000000FC900010FC900011F -:10AF80002DC900014DC90001000000000FC90001DA -:10AF90000FC9000149C900014DC9000100010000AD -:10AFA0000003010200010302020002030303000385 -:10AFB00000000000B5CB0001000000000000000010 -:10AFC00000000000000000004DCC00010000000067 -:10AFD0004DCC000175CC000139CC0001000000000F -:10AFE0000000000000000000000000000000000061 -:10AFF00000000000C5CC00010000000000000000BF -:10B00000000000000000000000000000C5CC0001AE -:10B01000000100000000030102020001020202021E -:10B0200002000303030300000000000085CA0001C2 -:10B0300041CB000100000000FDCA0001F5CA00017B -:10B04000FDCA0001000000000000000089CB0001E3 -:10B0500049CB000199CB00010000000075CB000135 -:10B0600075CB000199CB0001000100000301020033 -:10B0700003020200030303000000000065CF00018B -:10B08000000000000000000000000000B1CF00013F -:10B0900000000000B1CF000100000000C1CF00019E -:10B0A000000000000000000000000000BDCF000113 -:10B0B0000000000000000000000000000000000090 -:10B0C000BDCF0001000000000001000000030102EC -:10B0D0000102030202000203030300030000000058 -:10B0E00095CD0001000000000000000000000000FD -:10B0F0000000000039CF0001000000000000000047 -:10B1000015CF000111CF0001000000000000000079 -:10B11000000000000000000000000000000000002F -:10B120004DCF000100000000000000000000000002 -:10B1300000000000000000004DCF000100000000F2 -:10B1400085D0000109D10001B9D000010000000044 -:10B15000E9D0000109D10001E9D0000100000000A0 -:10B1600015D10001000000000FD100010FD1000136 -:10B1700000000000B9D20001000000000FD1000162 -:10B180000FD1000100000000D3D200010001000136 -:10B190000003010201000302020200030303030093 -:10B1A000A9D9000135DA0001DDD90001E9D9000192 -:10B1B000F5D900011DDA00010100010075D9000177 -:10B1C00059D30001CFD40001E5D3000100000000F5 -:10B1D0000000000055D9000161D40001B5D4000180 -:10B1E00000000000E1D4000193D70001000000003E -:10B1F000D7D40001D7D400010000000061D70001BE -:10B200000000000000000000D7D40001D7D40001E6 -:10B21000000000007BD700010000000000010001D9 -:10B220000000030102010001030202020002030305 -:10B230000303000300000000DDD700010000000050 -:10B240000000000000000000D9D80001E9D800018A -:10B250000000000000000000E1D80001E1D800017A -:10B2600095D9000100000000E1D80001E1D80001FB -:10B2700000000000000100000301020003020200C0 -:10B2800003030300000000007FDA0001000000005B -:10B2900000000000000000000000000000000000AE -:10B2A00000000000EBDB000100000000EBDB000110 -:10B2B00091DA000100000000000000000000000022 -:10B2C000000000000000000000000000000000007E -:10B2D00000000000E1DB000133DC00013BDC000189 -:10B2E00043DC00010000000000000000000000003E -:10B2F000000000000000000000000000000000004E -:10B3000043DC00010000000000000000000000001D -:10B31000000000000000000000000000000000002D -:10B3200043DC0001000100000000000004010302F2 -:10B3300001010301040203020303030004030303E6 -:10B3400003030303040404040404040400000000D1 -:10B3500083DC00010000000000000000000000008D -:10B36000B9DD000100000000F1DC00015DDD00013D -:10B3700000000000000000000000000000000000CD -:10B380005DDD0001CFDD00010000000000000000D5 -:10B390000000000000000000CFDD000100010000FF -:10B3A0000003010102000302020200030303030081 -:10B3B00000000000E1090101F10C010100000000A2 -:10B3C000250B0101D90C0101250B0101450B0101E0 -:10B3D00000000000D90C0101000000004D0C01012B -:10B3E00000000000D90C0101F10C0101A50C0101C4 -:10B3F0000001000003010200030202000303030036 -:10B400000000000000000000C10D0101000000006C -:10B41000130D0101A90D0101130D0101ADFD000185 -:10B4200000000000A90D0101000000002D0D010128 -:10B4300000000000A90D0101C10D01012D0D010148 -:10B4400000010000030102000302020003030300E5 -:10B4500097E10001C9E10001E5E10001E9E1000136 -:10B4600000000000000000000000000000000000DC -:10B4700000000000DDE10001010101010001010106 -:10B480000100000079E30001D97B0201D97B0201B0 -:10B4900000000000000000000000000000000000AC -:10B4A00000000000E1E50001BDE50001D5E6000176 -:10B4B0000BE7000125E7000100000000000000008C -:10B4C000D97B0201D97B02010000000000000000CE -:10B4D000000000000000000001000000000000016A -:10B4E000020000000000020202020202000000004E -:10B4F000B9EB000135EC0001000000000000000085 -:10B50000000000000000000000000000000000003B -:10B51000657D02015DE8000121E8000100000000F6 -:10B520000000000000000000657D02010000000036 -:10B53000000000000000000001E9000121EC000112 -:10B5400000000000657D0201000000000000000016 -:10B5500000000000000000000000000000000000EB -:10B5600001010000000000010102000101010202CE -:10B570000202030000030303030303000403FFFFAD -:10B58000FFFF070405FFFF030704FFFF07FFFF049A -:10B5900005FFFFFF03FFFF030405FFFFFFFFFFFFA2 -:10B5A000FFFFFF0303030000E5F2000135F2000195 -:10B5B000D1F20001000000000000000089EF00014E -:10B5C0009DEF000101F000010000000000000000FC -:10B5D0000000000041F00001D5F0000189F00001F9 -:10B5E000D5F0000100000000A5F90001C1F1000143 -:10B5F000A5F90001C1F1000111F5000139F50001C3 -:10B600009DF500013FF500019DF5000100000000DF -:10B6100091F60001D5F600010000000000000000D6 -:10B6200045FB000155FB000165FB00010000000027 -:10B630000000000065F8000175F80001B5F8000190 -:10B64000ADF80001B5F8000100000000E1F70001CD -:10B6500001FA000161F80001000000000000000094 -:10B6600001F7000169F7000161F800010000000026 -:10B67000C3880201000000000000000039880201B8 -:10B6800000000000000000000000000000000000BA -:10B690008F8802012D88020100000000C38802018A -:10B6A00007880201B98B02010000000000000000C1 -:10B6B000000000000000000000000000000000008A -:10B6C0000000000000000000BD8702010000000033 -:10B6D00000000000C3870201E98702016D8C0201AE -:10B6E00000000000D78702010000000000000000F9 -:10B6F00000000000BD870201000000000000000003 -:10B70000C3870201C387020100000000E18B020130 -:10B71000000000000000000000000000538802014B -:10B72000020000010000000002010001030001010D -:10B7300001010101010102020202030000030202F1 -:10B74000020303030303030003030300C98C020184 -:10B75000378C02010000000000000000258C02016F -:10B7600000000000000000009D8C0201058C020119 -:10B77000B18B02010B8C0201B98B0201B18B02016A -:10B78000F98B0201000000009D8C0201058C020172 -:10B79000518C02010000000000000000258C020115 -:10B7A0006D8C02010000000000000000058C020109 -:10B7B000B18B02010000000000000000B18B02010B -:10B7C00000000000E18B0201000000000201000007 -:10B7D0000300000001010200010101010201020257 -:10B7E000030000020303030303030003B3900201F9 -:10B7F00015070101150701011507010115070101D1 -:10B80000000000000000000029910201150701015D -:10B810001507010115070101150701016D900201CE -:10B82000F5900201299102014D91020115070101D4 -:10B83000150701011507010100000000F590020144 -:10B8400029910201150701012F910201150701013C -:10B850001507010100000000F59002012991020185 -:10B860001507010115070101C59002011507010126 -:10B8700000000000F59002019D90020115070101F2 -:10B88000150701011507010115070101000000005E -:10B8900000000000299102011507010115070101AF -:10B8A00015070101150701018B900201000000003E -:10B8B0002991020115070101150701011507010171 -:10B8C00043900201000000000000000001000000A1 -:10B8D0000000000101010101020002030202020254 -:10B8E0000003030403030300040404050404000626 -:10B8F00005050505050506060606060700070707F0 -:10B9000007020707A19302011507010115070101AD -:10B910001507010100000000000000000000000009 -:10B92000150701011507010115070101150701019F -:10B9300000000000000000006194020115070101F1 -:10B9400015070101150701011507010135940201D1 -:10B95000F39302010000000015070101B9930201F1 -:10B96000150701011507010100000000000000009B -:10B970000000000015070101150701017F93020176 -:10B980001507010100000000000000000000000099 -:10B99000150701011507010115070101150701012F -:10B9A00000000000000000006D9302011507010176 -:10B9B0001507010115070101EF0501010000000055 -:10B9C0000000000000000000010000000000000175 -:10B9D0000101010101020202020203000203040349 -:10B9E0000303030304040504040404050505050515 -:10B9F000050606060600060606000000C5970201B9 -:10BA000000000000B39702010000000000000000E9 -:10BA1000059C0201059C020100000000AD97020197 -:10BA200000000000A59702010000000000000000D7 -:10BA300000000000000000006D9D0201AD970201B2 -:10BA4000CD980201A5970201759C0201E99A0201B5 -:10BA5000000000000000000000000000AD9702019F -:10BA600000000000A5970201000000000000000097 -:10BA7000000000000000000083980201AD97020161 -:10BA800000000000A597020100000000E99A0201F1 -:10BA900000000000000000000000000001000300A2 -:10BAA0000001030001010101010101020204020081 -:10BAB000000202020303030303030304040404005B -:10BAC00000040404579C020100000000419C020194 -:10BAD0000000000000000000059C020100000000C2 -:10BAE000E19A020100000000539C020100000000E6 -:10BAF00000000000059C02016D9D0201E19A020117 -:10BB0000199C0201539C0201759C0201B59C020123 -:10BB1000059C020100000000E19A02010000000003 -:10BB200000000000759C0201000000000000000001 -:10BB3000039E0201E19A0201199C0201000000002B -:10BB4000759C0201000000000000000000000000E1 -:10BB5000E19A020100000000000000000000000067 -:10BB6000E99A02010000000000000000010003004B -:10BB700000010001010301010102020503000002AE -:10BB8000020303030303030404050404040404057B -:10BB9000050505000505020000001000100000006A -:10BBA0000000000080841E0040420F0020A107001A -:10BBB0000071020080380100409C000088130000E2 -:10BBC0000000000040420F00A086010050C30000AA -:10BBD0001027000088130000C4090000E2040000E0 -:10BBE0007102000000000000963007772C610EEE15 -:10BBF000BA51099919C46D078FF46A7035A563E9C4 -:10BC0000A395649E3288DB0EA4B8DC791EE9D5E0EA -:10BC100088D9D2972B4CB609BD7CB17E072DB8E7E9 -:10BC2000911DBF906410B71DF220B06A4871B9F33E -:10BC3000DE41BE847DD4DA1AEBE4DD6D51B5D4F477 -:10BC4000C785D38356986C13C0A86B647AF962FDDC -:10BC5000ECC9658A4F5C0114D96C0663633D0FFA29 -:10BC6000F50D088DC8206E3B5E10694CE44160D52F -:10BC7000727167A2D1E4033C47D4044BFD850DD219 -:10BC80006BB50AA5FAA8B5356C98B242D6C9BBDB2C -:10BC900040F9BCACE36CD832755CDF45CF0DD6DC27 -:10BCA000593DD1ABAC30D9263A00DE518051D7C8CE -:10BCB0001661D0BFB5F4B42123C4B3569995BACF59 -:10BCC0000FA5BDB89EB802280888055FB2D90CC67A -:10BCD00024E90BB1877C6F2F114C6858AB1D61C1F3 -:10BCE0003D2D66B69041DC760671DB01BC20D29812 -:10BCF0002A10D5EF8985B1711FB5B606A5E4BF9F9F -:10BD000033D4B8E8A2C9077834F9000F8EA8099691 -:10BD100018980EE1BB0D6A7F2D3D6D08976C6491FC -:10BD2000015C63E6F4516B6B62616C1CD830658515 -:10BD30004E0062F2ED95066C7BA5011BC1F40882F2 -:10BD400057C40FF5C6D9B06550E9B712EAB8BE8B33 -:10BD50007C88B9FCDF1DDD62492DDA15F37CD38CBC -:10BD6000654CD4FB5861B24DCE51B53A7400BCA3BA -:10BD7000E230BBD441A5DF4AD795D83D6DC4D1A4EC -:10BD8000FBF4D6D36AE96943FCD96E34468867ADC3 -:10BD9000D0B860DA732D0444E51D03335F4C0AAA62 -:10BDA000C97C0DDD3C710550AA41022710100BBE65 -:10BDB00086200CC925B56857B3856F2009D466B9AC -:10BDC0009FE461CE0EF9DE5E98C9D9292298D0B0E1 -:10BDD000B4A8D7C7173DB359810DB42E3B5CBDB78E -:10BDE000AD6CBAC02083B8EDB6B3BF9A0CE2B6030F -:10BDF0009AD2B1743947D5EAAF77D29D1526DB04C4 -:10BE00008316DC73120B63E3843B64943E6A6D0D0E -:10BE1000A85A6A7A0BCF0EE49DFF099327AE000A59 -:10BE2000B19E077D44930FF0D2A3088768F2011EEC -:10BE3000FEC206695D5762F7CB67658071366C1983 -:10BE4000E7066B6E761BD4FEE02BD3895A7ADA10A4 -:10BE5000CC4ADD676FDFB9F9F9EFBE8E43BEB71785 -:10BE6000D58EB060E8A3D6D67E93D1A1C4C2D8380F -:10BE700052F2DF4FF167BBD16757BCA6DD06B53F75 -:10BE80004B36B248DA2B0DD84C1B0AAFF64A0336B4 -:10BE9000607A0441C3EF60DF55DF67A8EF8E6E3133 -:10BEA00079BE69468CB361CB1A8366BCA0D26F257C -:10BEB00036E2685295770CCC03470BBBB9160222C9 -:10BEC0002F260555BE3BBAC5280BBDB2925AB42BDE -:10BED000046AB35CA7FFD7C231CFD0B58B9ED92CF3 -:10BEE0001DAEDE5BB0C2649B26F263EC9CA36A7558 -:10BEF0000A936D02A906099C3F360EEB856707720F -:10BF000013570005824ABF95147AB8E2AE2BB17B75 -:10BF1000381BB60C9B8ED2920DBED5E5B7EFDC7CFC -:10BF200021DFDB0BD4D2D38642E2D4F1F8B3DD6853 -:10BF30006E83DA1FCD16BE815B26B9F6E177B06F4E -:10BF40007747B718E65A0888706A0FFFCA3B06663B -:10BF50005C0B0111FF9E658F69AE62F8D3FF6B61C8 -:10BF600045CF6C1678E20AA0EED20DD75483044E6A -:10BF7000C2B30339612667A7F71660D04D476949F8 -:10BF8000DB776E3E4A6AD1AEDC5AD6D9660BDF400B -:10BF9000F03BD83753AEBCA9C59EBBDE7FCFB247BE -:10BFA000E9FFB5301CF2BDBD8AC2BACA3093B353A3 -:10BFB000A6A3B4240536D0BA9306D7CD2957DE54AC -:10BFC000BF67D9232E7A66B3B84A61C4021B685D85 -:10BFD000942B6F2A37BE0BB4A18E0CC31BDF055AFE -:10BFE0008DEF022D01000000000103040600000097 -:10BFF00000000000000000000000000087000000BA -:10C00000040003020000000000800141010800005C -:10C010000101000004000302000000000090014143 -:10C020000208000000000000000000000100010004 -:10C0300096C298D84539A1F4A033EB2D817D0377C2 -:10C04000F240A463E5E6BCF847422CE1F2D1176B5D -:10C05000F551BF376840B6CBCE5E316B5733CE2B30 -:10C06000169E0F7C4AEBE78E9B7F1AFEE242E34F5F -:10C070004B60D2273E3CCE3BF6B053CCB0061D659C -:10C08000BC86987655BDEBB3E7933AAAD835C65A25 -:10C09000512563FCC2CAB9F3849E17A7ADFAE6BC6A -:10C0A000FFFFFFFFFFFFFFFF00000000FFFFFFFF9C -:10C0B000FFFFFFFFFFFFFFFFFFFFFFFF000000008C -:10C0C000000000000000000001000000FFFFFFFF73 -:10C0D00025733A2066726565696E67206E6F6E2DF6 -:10C0E000656D707479207669727471756575650D0A -:10C0F0000A0056513A202573202D2073697A653D38 -:10C1000025643B20667265653D25643B207175653D -:10C110007565643D25643B20646573635F68656194 -:10C12000645F6964783D25643B20617661696C2EAB -:10C130006964783D25643B20757365645F636F6E49 -:10C14000735F6964783D25643B20757365642E696F -:10C1500064783D25643B20617661696C2E666C6174 -:10C1600067733D307825783B20757365642E666C67 -:10C170006167733D307825780D0A007374617475BA -:10C1800073203D3D2073697A656F662872705F6821 -:10C19000647229002F6A656E6B696E735F776F72C8 -:10C1A0006B73706163652F776F726B73706163651A -:10C1B0002F4F63746176655F7061636B6574637242 -:10C1C0006166745F6275696C645F6D6173746572DA -:10C1D0002F6E6F726469632E7374642F7468697252 -:10C1E0006470617274792F4F70656E414D502F6F7E -:10C1F00070656E2D616D702F6C69622F72706D733A -:10C20000672F72706D73675F76697274696F2E63E2 -:10C2100000737461747573203D3D20300073746148 -:10C22000747573203E3D2030007374617475732003 -:10C230003D3D206C656E0072785F76710074785FAA -:10C240007671004E5300000072706D73675F7669FF -:10C250007274696F5F73656E645F6F666663686151 -:10C260006E6E656C5F6E6F636F70790072706D7368 -:10C27000675F76697274696F5F72785F63616C6C17 -:10C280006261636B0072706D73675F766972746967 -:10C290006F5F73656E645F6F66666368616E6E651F -:10C2A0006C5F726177000000000200000002000075 -:10C2B0004E6574776F726B00426C6F636B00436FF7 -:10C2C0006E736F6C6500456E74726F7079004261B9 -:10C2D0006C6C6F6F6E00494F4D656D6F72790053D6 -:10C2E000435349003950205472616E73706F7274F9 -:10C2F0000000000001000000B0C2030102000000C5 -:10C30000B8C2030103000000BEC203010400000024 -:10C31000C6C2030105000000CEC2030106000000F2 -:10C32000D6C2030108000000DFC2030109000000BB -:10C33000E4C203010000000000000000756E726599 -:10C340006769737465726564202573206275730A6A -:10C3500000646576696365202626206465766963D6 -:10C36000652D3E627573002F6A656E6B696E735F33 -:10C37000776F726B73706163652F776F726B737019 -:10C380006163652F4F63746176655F7061636B6590 -:10C390007463726166745F6275696C645F6D61730A -:10C3A0007465722F6E6F726469632E7374642F7478 -:10C3B0006869726470617274792F4F70656E414D57 -:10C3C000502F6C69626D6574616C2F6C69622F64AB -:10C3D00065766963652E63006D6574616C5F646585 -:10C3E000766963655F636C6F7365002C2066756E9C -:10C3F0006374696F6E3A2000617373657274696F5C -:10C400006E2022257322206661696C65643A20667D -:10C41000696C6520222573222C206C696E652025AD -:10C4200064257325730A000024010021232D302B7D -:10C430002000686C4C006566674546470030313225 -:10C44000333435363738394142434445460030317C -:10C4500032333435363738396162636465660000DB -:10C4600000000000000000000000000000000000CC -:10C4700000000000000000000000000000000000BC -:10C4800000000000000000000000000000000000AC -:10C49000000000000000000000000000000000009C -:10C4A000000000000000000000000000000000008C -:10C4B000000000000000000000000000000000007C -:08C4C000A0D4FF7F0100000081 -:10C4C8005CAD03010000000001000000040007202B -:10C4D8005400002100000000FFFFFFFFFFFFFFFFE7 -:10C4E8000000000000000000000000000000000044 -:10C4F8000000000000000000000000000000000034 -:10C508000000000000000000000000000000000023 -:10C518000000000004000720FFFFFFFF1F000000CD -:10C52800FFFFFFFF00000000000000000000000007 -:10C5380000000000000000000000000000000000F3 -:10C5480000000000000000000000000000000000E3 -:10C5580000000000000000000000000000000000D3 -:10C5680000000000000000000000000000000000C3 -:10C5780000000000000000000000000000000000B3 -:10C5880000000000000000000000000000000000A3 -:10C59800000000000000000000000000FF00000094 -:10C5A80000000000000000000090D00300FB00FB2A -:10C5B8006970030166AD0301000000005194030196 -:10C5C800000000000000000091940301CD940301D5 -:10C5D8000000000000000000000000000000000053 -:10C5E800240100210000000080C40301A0C403014D -:10C5F80060C403010000000000000000000000000B -:10C608000000000000000000000000000000000022 -:10C618000000000000000000000000000000000012 -:10C628000000000000000000000000000000000002 -:10C6380000000000000000000000000000000000F2 -:04C6480000000000EE -:0400000501034DB9ED -:00000001FF diff --git a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_min_18929.hex b/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_min_18929.hex deleted file mode 100644 index 47c767b2ddf6..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/bin/ble5-ctr-rpmsg_shifted_min_18929.hex +++ /dev/null @@ -1,13292 +0,0 @@ -:020000040100F9 -:1028000000000121B9ED02018DED02016DED020123 -:102810008DED02018DED02018DED02018DED0201C4 -:102820008DED02018DED02018DED02018DED0201B4 -:102830008DED02018DED02018DED02018DED0201A4 -:102840008DED02018DED02018DED02018DED020194 -:102850008DED02018DE802018DED02018DED020189 -:102860006DFE02018DED0201C1E502018DED020157 -:10287000EDEA02018DED02018DED02018DED020107 -:102880008DED020139E90201FDE702013DEB020194 -:102890008DED02018DED020145E902018DED020190 -:1028A000FDEA02010DEB02018DED02018DED020149 -:1028B0008DED02018DED020100000000000000001E -:1028C0000000000000000000000000000000000008 -:1028D00000000000000000000000000000000000F8 -:1028E00000000000000000000000000000000000E8 -:1028F00000000000000000000000000000000000D8 -:1029000000000000000000000000000000000000C7 -:1029100000000000000000000000000000000000B7 -:1029200000000000000000000000000000000000A7 -:102930000000000000000000000000000000000097 -:102940000000000000000000000000000000000087 -:102950000000000000000000000000000000000077 -:102960000000000000000000000000000000000067 -:102970000000000000000000000000000000000057 -:102980000000000000000000000000000000000047 -:102990000000000000000000000000000000000037 -:1029A0000000000000000000000000000000000027 -:1029B0000000000000000000000000000000000017 -:1029C0000000000000000000000000000000000007 -:1029D00000000000000000000000000000000000F7 -:1029E00000000000000000000000000000000000E7 -:1029F00000000000000000000000000000000000D7 -:102A0000DEE61E284CBBCE8F023500003C000000E5 -:102A10004C3E0300010000000028000100280001D6 -:102A2000FFFF029100000000000000000000000015 -:0C2A30000000000000000000000000009A -:102A4000002070470388F7B5A3F57C4306460C4683 -:102A5000032B4DD8DFE803F00212204391F9000068 -:102A600000F0B0FA04460120318824F0C3F818B110 -:102A700000F8054924F06AF801203AE0CB788A781A -:102A8000207802EB0322497892B22DF053F808B176 -:102A90000024E8E71224E6E7CA798B79497903EB49 -:102AA00002232279E07802EB0122A178657801EB1C -:102AB00000212078E77A00EB0520A57A9BB205EB90 -:102AC0000725ADB20195657A247A92B204EB05240C -:102AD000A4B2009489B280B22EF08EFAD7E70878BB -:102AE0002DF012F90028D5D060782DF029F9CEE725 -:102AF000002003B0F0BD00002DE9F047A84D86B0DE -:102B000028462CF0D1FC4FF49673A64EEB8030464D -:102B100025F082FE402206F10C0102202CF0D8FCA8 -:102B2000402206F13E0101202CF0D2FC402206F1A9 -:102B3000450106202CF0CCFC1022ADF80420082220 -:102B40000B238DF80620202233714FF49C63ADF8DF -:102B500008208022042740F20D11B383F38CADF8D6 -:102B60000C20B27B1C338DF80E208DF81220ADF8AE -:102B7000143096F8242096F82330ADF81010134442 -:102B800096F82A200DEB0701134496F82B20052018 -:102B900013448DF816308DF80A702AF0DDFD80B2EE -:102BA0002AF0A8FE2AF0C8FF2BF0DCF800F066F946 -:102BB0002AF0B0FE80462AF0B3FE0446284629F0EB -:102BC000D5FF22464146384603F078FD08EB000960 -:102BD000A4EB000A054652464946384603F082F8FF -:102BE0000544AAEB000209EB0001384603F07CF92A -:102BF0004719304625F042FE96F82250B844E41BAF -:102C000035B12146404625F081FF05468044241A0F -:102C10002146404625F035FF241A804421460544CC -:102C2000404625F044FF241A804481462146404610 -:102C300025F061FF241A804482462146404625F053 -:102C400048FF3D44211A0746404425F07FFF0024F9 -:102C50004D4455443D44054429F08EFF02F04AFDA1 -:102C600000F048FC02F0D8FB01F0EEFA02F0F0FCB4 -:102C700001F0B0F801F0CEF801F03EFD2CF0A6FF17 -:102C800002F0B2F802F048FA01F0DAFD01F09CFE21 -:102C900003F0ECFC44482AF037FF2AF061FC25F0F1 -:102CA000E9FE25F049FF25F039FF25F0F9FE25F072 -:102CB0003CFF25F054FF25F059FF25F0E4FE25F0F8 -:102CC0003DFF25F048FF25F00DFF25F0FBFE25F028 -:102CD000F0FE25F052FF25F010FF25F0FCFE25F058 -:102CE00013FF25F03AFF31482AF00EFF25F0CCFD06 -:102CF0002F482AF009FFB28DF18C2AF041F825F017 -:102D0000DDF825F0E7F925F095F925F007F925F02C -:102D1000F1F925F065F925F0F3F825F0CBF925F068 -:102D20006BFA25F0DBF825F0A5F925F007F925F079 -:102D300079F925F051FA25F03BFA25F031F925F023 -:102D40000FF925F01DF925F03BF925F011FA194886 -:102D50002AF0DAFE25F0E0F925F0FCFB164825F014 -:102D6000A7F828462AF0C6FD01A80194ADF808404E -:102D700025F006FF042168462CF05EFD684628F029 -:102D8000EBFE012200214FF4003025F0A9FF0B4893 -:102D90002AF0E2FE2AF0ECFE204606B0BDE8F087FD -:102DA000880100219801002181D5020129890201B1 -:102DB000ADCD0201E9870201452A0001412A000147 -:102DC000014B1878704700BF00000720014B1970B5 -:102DD000704700BF00000720012070470122014B0F -:102DE0005A6070470020014138B5C4003434204691 -:102DF00030F05CFF054618B12246002130F08DFF0F -:102E0000284638BD2FF016BF70B50E46CAB1541E05 -:102E1000A0B22AF09FFD054698B12246711C30F001 -:102E200055FF3378022B0ED0052B05D0012B08D18E -:102E300000212A46084602E02A46032100202AF003 -:102E40000BF8002070BD2A460121F7E7C30703D520 -:102E5000024B58682FF0A0BD704700BF2802002128 -:102E600048F29C63C360044B436003F554730360F2 -:102E700020238360704700BF048007201FB5684689 -:102E8000FFF7EEFF0298FFF7AFFF044C20600298B7 -:102E9000FFF7AAFF606004B010BD00BF2802002148 -:102EA00030B5294B8BB004AC93E80300002284E8D2 -:102EB0000300264906202BF057FC25482BF070FC18 -:102EC00006A8FFF7CDFF204630F0CEFB099B214836 -:102ED000214C436130F0AAFB22462049204830F0C3 -:102EE00071FB226893680BB102F10C0304201D4AA8 -:102EF000069990601062012051601B49BDF8204086 -:102F00000D684968156091611849079D8861022024 -:102F100053619481D362D5619484CA62002288622D -:102F2000134808620092134830F00CFA124B134A0F -:102F30000293134B0F4901934FF0FF331148009355 -:102F40002FF0FEFD0BB030BD7C4D03014D2E000176 -:102F5000844D030100000021E40100215C4D0301C8 -:102F6000664D0301C402002128020021F80200215D -:102F7000084E030130020021052E00016E4D0301B1 -:102F8000092E0001E8010021022907B5184603F1C6 -:102F9000FF3310D1042100F8011C012108480A4424 -:102FA00001910092D0E909122FF02AFD03B05DF8DB -:102FB00004EB29F0D1BE01290CBF02210521EAE76B -:102FC000E8010021024B83F87B000020704700BF1E -:102FD000405100212CF046BA2DE9F8431C46D0F8A8 -:102FE0002C90C56807460E46904629F085FE99F854 -:102FF0000D302C44022B04440DD0032B0DD0012B9B -:1030000000D12834306C3D690319AB4208D93564CE -:103010000020BDE8F8831834F4E704F5A874F1E75C -:103020007B682D1A63B14146986829F06BFE854292 -:1030300028BF0546AC4203D9336C2B443364E7E721 -:10304000281B4FF47A75044B1B689C886C43A04284 -:1030500028BF2046DDE700BF345300211FB5012300 -:103060008DF80430002301A8CDE902332CF078F963 -:1030700005B05DF804FB1FB5002301A8CDE90133BD -:1030800003932CF06DF905B05DF804FB2DE9F843CE -:1030900004468846C66A2CF0AFFC05460146A06887 -:1030A00006F1980729F02EFE78B9A368DFF8909012 -:1030B000C9F8843029F020FE2844A060D9F8841093 -:1030C000284629F01FFEC6F8D800D6F8A4300BB168 -:1030D00020469847394600232046A268FFF77CFF28 -:1030E000074618B9BDE8F84329F0D4BD144DA368CC -:1030F0004046C5F884302CF08FF8124B05F188005B -:10310000C5F88830104BC5F89470C5F88C30A368AA -:10311000C5F890302CF01CF9002385F88030D6F8E3 -:103120009C304BB1FFF79AFF96F8CA10D6F898007A -:10313000BDE8F8432CF064B9FFF79DFFF4E700BF4A -:103140006406002105340001E93100012DE9F8434E -:1031500080460C4629F0A8FD064618B101263046E7 -:10316000BDE8F8832CF048FC1D4D8146D5F884104D -:1031700029F0C8FD236C03442364C5F8849029F02A -:10318000BBFD4A46034621464046FFF725FF07465A -:103190000028E3D0636A53B1024649464046984747 -:1031A00028B10122D8F82C3083F8C820D7E7D5F809 -:1031B000848029F0A1FD4044C5E9240709482CF08A -:1031C000C7F8002385F88030636833B1FFF746FF06 -:1031D000272120682CF014F9C1E7FFF74CFFF7E72F -:1031E00064060021EC0600212DE9F04F87B09A46D5 -:1031F0009DF8403003910293934607462CF0FCFB68 -:10320000DFF8F491C9F8000029F03EFDDDE9023154 -:10321000C46A8046D4F8C450ADB194F8C820012ADD -:1032200011D1CDE900A30A465B463946D4F8B8006F -:10323000A847012804D10023C4F8B83084F8C83066 -:1032400007B0BDE8F08F6D4A6D4D92F88060701C3C -:1032500082F8800076B1022E00F08680AC8C2CF0D3 -:10326000CBFBD9F80030C01A844240F2B580A88C5C -:10327000A884E5E707B3FB1E012B40F2B680042FBC -:1032800068D06FD833460126032F5DD032461E46E4 -:10329000EB690133EB613346164643B117F0FB0F80 -:1032A00046D0404604F19801FFF750FF0646002E35 -:1032B000D4D029F0FFFCD1E784F8CC1084F8CD30CD -:1032C0003A46C4E934BAD4F8980004F1E00304F1B2 -:1032D000800102F01BFB002834D04046D4F8A8300F -:1032E000D4F89810984700287DD06E8C2CF084FB81 -:1032F000D9F80030C01A86421DD9688C94F8C930BC -:103300006884ADF81030D4F89C300593FFF7A6FE22 -:10331000012104A82CF056F8D4F8AC301BB140467B -:10332000D4F8981098472B6801332B60002F95D064 -:103330002CF096F8B5E72CF05FFBD9F80030C01AF6 -:1033400080B2DBE70127EEE7AA680132AA60002B12 -:10335000A7D1ACE7334601266A6801326A60002BC8 -:10336000E6D1A4E7012293E76FB1FB1E012B1ED922 -:10337000042F4FF000034FF0010629D022D9EA694B -:103380000132EA6189E73A46D4F8A00004F1E0038B -:1033900004F1800102F0BAFA28B14046D4F8B43002 -:1033A000D4F8A01098472B6901332B61C0E7D4F8FB -:1033B000B430002140469847042F4FF001034FF0EE -:1033C000000605D0032FDAD1AA690132AA61BEE74F -:1033D0006A6901326A61C2E72CF00EFBD9F800304D -:1033E000C01A80B244E7012796E7042F4FF001038B -:1033F0007FF44AAFB0E700BFDC050021640600217E -:10340000280300212DE9F84381462CF0F5FA364EC9 -:10341000306029F039FCC56A0746D5F8C03083B161 -:1034200095F8C820012A0CD14946D5F8B80098472C -:10343000012804D10023C5F8B83085F8C830BDE8AC -:10344000F8832A4B2A4C93F8808008F10102B8F1E6 -:10345000010F83F880202CD1B9F1000F3FD13846FD -:10346000D5F8B030D5F89C10984790B1B4F82080CA -:103470002CF0C2FA3368C01A804524D9238C2384E7 -:10348000FFF7F9FD2721D5F8A0002BF0DFFF4FF063 -:103490000008E3680133E360B8F1000F09D02BF0B6 -:1034A000DFFF384605F19801FFF750FE08B129F01B -:1034B00001FCE58C2CF0A0FA3368C01A854208D9CB -:1034C000E08CE084BBE72CF097FA3368C31A9BB218 -:1034D000D5E72CF091FA3368C01A80B2F1E7E369BE -:1034E0000133E361E3E700BFDC050021640600214E -:1034F0002803002108B50220054A064902F034F9E4 -:10350000BDE8084028220021034830F006BC00BF77 -:10351000D52F00018D3000012803002130B504466D -:10352000044D0FCD0FC40FCD0FC495E8030084E800 -:10353000030030BD280300211FB5002301A8CDE9F9 -:10354000013303932BF00CFF05B05DF804FB1FB5AE -:1035500001238DF80430002301A8CDE902332BF0BC -:10356000FFFE05B05DF804FB70B50546C66A084667 -:103570002BF052FE114C124B04F18800C4F8883035 -:10358000104BC4F88C30D6F8B430C4F89430AB6823 -:10359000C4F890302BF0DCFE002384F88030D6F89D -:1035A000983043B1FFF7D3FFBDE8704040F20111FE -:1035B00005482BF025BFFFF7BFFFF5E764060021A4 -:1035C000B93900017D3D000150030021F8B50546E1 -:1035D000134EC76A08462BF01FFE124C336804F1E5 -:1035E0008800C4F88830104BC4F88C30D7F8A0306D -:1035F000C4F89430AB68C4F890302BF0A9FE0023D7 -:1036000084F88030336843B1FFF7A1FFBDE8F8408C -:1036100040F2011105482BF0F3BEFFF78DFFF5E7EF -:10362000B80500216406002131360001880400211C -:103630002DE9F04F85B08B469DF83810029203912A -:103640009A4606462CF0D8F9DFF89482DFF8949277 -:10365000C8F8000029F018FB99F880200746C56AD1 -:10366000A14C039982B1032A00F0BC80258C2CF078 -:10367000C3F9D8F80030C01A854240F22981208C65 -:10368000208405B0BDE8F08F012E00F08A800AD9B1 -:10369000F31E012B76D9042E00F09A8000F2A08050 -:1036A0001346012278E0032385F8BEB04FF0010BEA -:1036B00089F88030029B85F8BF10C5E9303A8B4904 -:1036C000D5F8983085F8C8B09847002838D00290CF -:1036D00028462BF0A1FD029B09F188005344C9F84C -:1036E00090302BF035FEB4F81C902CF085F9D8F80A -:1036F0000030C01A81451CD9A08BA083FFF71CFFA6 -:1037000040F2011179482BF07BFED5F89C30384609 -:1037100076499847B0FA80F35B092268013222604B -:10372000002BA3D016F0FB0F00F0A98029F0C2FAFD -:103730009CE72CF061F9D8F80030C01A80B2DCE7C1 -:1037400095F8BC3005F1980033B1694B1B68BBB1EB -:10375000594698470346E0E795F8CA30012B0AD14D -:10376000644A1568002DD8D00146604A3846CDF825 -:1037700000A0A847EEE73846D5F89C305B4998474B -:103780005B46CAE71146D5F89C3002929847042E52 -:103790004FF00103029A1DD0032E13D011461A4692 -:1037A00006E01146D5F89C30029298473146029ABD -:1037B000A3690133A36113460A46002BB2D1002A44 -:1037C000B4D153E7A1680131A160002BAED1F6E777 -:1037D00013460122616801316160002B4FD1EEE791 -:1037E0000121E5E7D5F89830AEB1F21E012A57D98C -:1037F000324600219847D5F89C300021384698473A -:10380000042E4FF000034FF001025DD056D9A1699C -:103810000131A161D1E7324685F8C86085F8BF1053 -:1038200085F8BEB031499847064690B328462BF03C -:10383000F3FC564409F18800C9F890602BF088FD2C -:10384000A68B2CF0D9F8D8F80030C01A864219D9C6 -:10385000A08BA083FFF770FE40F2011123482BF0EC -:10386000CFFD3846D5F89C3020499847B0FA80F013 -:103870004009E3680133E36000283FF4F7AE2BF022 -:10388000EFFD53E72CF0B8F8D8F80030C01A80B23A -:10389000DFE73846D5F89C30144998470120E8E71F -:1038A000324600219847D5F89C3000213846984789 -:1038B000042E4FF001034FF0000205D0032EA6D1D5 -:1038C00061690131616180E721690131216184E72A -:1038D0002CF092F8D8F80030C01A80B2D0E600BFC1 -:1038E000DC050021640600218C05002188040021EC -:1038F000B0050021B4050021012370B50546C66A54 -:10390000A0B0104C7C22314601A884F8803030F001 -:10391000DDF9B36F01A802932BF07EFC0A4B04F192 -:1039200088001B68C4F88830AB68C4F890302BF06E -:103930000FFDFFF701FE022106F1AC002BF018FD90 -:1039400020B070BD64060021B805002170B5164B8B -:1039500093F880506A1C012D83F8802015D1134CF8 -:10396000E1B9A68D2CF048F8114D2B68C01A86429B -:103970000ED9A08DA085FFF7DFFD40F201110D48A3 -:103980002BF064FDE3680133E3600025284670BD39 -:103990002CF032F82B68C01A80B2EBE7A36A01332F -:1039A000A36229F087F9F1E764060021540400219D -:1039B000DC0500215003002170B504462CF01CF8F2 -:1039C0000B4D286029F060F921460A4CFFF7BEFF35 -:1039D000668E2CF011F82B68C01A864202D9608ED0 -:1039E000608670BD2CF008F82B68C01A80B2F7E72B -:1039F000DC050021540400212DE9F74FDFF87C920B -:103A00000E4699F880408046022CDDF830A09DF8E3 -:103A10003410C56A00F0C480032C00F03981002CFA -:103A200040F09E81964F06B3F31E012B40F29A811F -:103A3000042E00F0AA8000F2B18023460124032E58 -:103A400000F0968022461C46BB6A0133BB622346C7 -:103A50001446002B00F0928016F0FB0F01D12BF0E2 -:103A6000FFFC29F027F901248BE0C5E92F3A85F8FE -:103A7000BA10D5F89C30834985F8B9209847044698 -:103A8000002862D0D5F89830002B5ED00123B7F81B -:103A90002EB089F880302BF0AFFF7B4E3368C01A10 -:103AA00083454CD9FB8DFB8595F8B030ADF80030DF -:103AB000D5F898300193FFF74AFD012168462BF0B5 -:103AC00081FCD5F8A03013B140466E499847002CD0 -:103AD0004CD1D5F8A830002B40D0404669499847D2 -:103AE000044600283AD0032389F880302BF0B8FC34 -:103AF00028462BF091FB54446448C9F890402BF0C1 -:103B000027FCBE8D2BF078FF5F4C2368C01A8642DD -:103B10001ED9B88DB885FFF70FFD40F20111594845 -:103B20002BF06EFC4046D5F8AC3056499847B0FAB9 -:103B300080F464093B6801333B6014B38FE72BF0DA -:103B40005BFF3368C31A9BB2ADE72BF089FCB8E783 -:103B50002BF052FF2368C01A80B2DBE7D5F8AC30F7 -:103B600013B14046474998470124E3E70024E1E7C1 -:103B7000BA680132BA60002B7FF473AF002C7FF477 -:103B800070AF204603B0BDE8F08F234601247A6869 -:103B900001327A60002B7FF462AFEFE7012253E736 -:103BA0000324374F89F880406EB1F31E012B51D9A1 -:103BB000042E4FF000034FF001045BD054D9BA6AD1 -:103BC0000132BA6245E7C5E92F3A85F8BA10D5F84F -:103BD000A4302C4985F8B9209847D5F8A8308BB384 -:103BE000404628499847044660B328462BF014FB0A -:103BF000544409F18800C9F890402BF0A9FBBE8D10 -:103C00002BF0FAFE204C2368C01A864214D9B88DD6 -:103C1000B885FFF791FC40F201111A482BF0F0FB38 -:103C20004046D5F8AC3017499847B0FA80F464099B -:103C30003B6901333B6180E72BF0DEFE2368C01A4D -:103C400080B2E5E7D5F8AC3013B140460D4998474E -:103C50000124EDE7D5F8A43000219847042E4FF059 -:103C600001034FF0000405D0032EA8D1BA69013238 -:103C7000BA6180E77A6901327A618BE764060021D4 -:103C80005404002150030021DC050021EC06002132 -:103C9000D5F8A830364FC6B1F21E012A4ED9002100 -:103CA0009847D5F8AC3013B1002140469847042E10 -:103CB0004FF000034FF001044ED080D8032E7FF464 -:103CC0007EAF7A6A01327A6255E72A4998470446FC -:103CD00060B328462BF0A0FA544409F18800C9F8D3 -:103CE00090402BF035FBBE8D2BF086FE224C2368D6 -:103CF000C01A864214D9B88DB885FFF71DFC40F272 -:103D000001111C482BF07CFB4046D5F8AC3019491A -:103D10009847B0FA80F46409FB690133FB610CE752 -:103D20002BF06AFE2368C01A80B2E5E7D5F8AC3004 -:103D300013B140460F4998470124EDE70021984709 -:103D4000D5F8AC3013B1002140469847042E4FF00F -:103D500001034FF00004B1D13A6A01323A6219E727 -:103D600000240EE7042E4FF001037FF468AE0EE747 -:103D70005404002150030021DC0500212DE9F3410A -:103D80000E461746984604462BF036FE0F4D286027 -:103D900028F07AFF9DF8203021460D4C3246CDE9BF -:103DA00000833B46FFF728FE268E2BF025FE2B686E -:103DB000C01A864204D9208E208602B0BDE8F08168 -:103DC0002BF01AFE2B68C01A80B2F5E7DC05002143 -:103DD0005404002108B500220620054901F0C4FC66 -:103DE000BDE808403422002102482FF096BF00BFF2 -:103DF000693500015404002130B50446044D0FCD4F -:103E00000FC40FCD0FC40FCD0FC42B68236030BD7E -:103E10005404002108B500220920074901F0A4FC40 -:103E200000220F20054901F09FFCBDE80840242234 -:103E3000002103482FF071BFCD350001F938000192 -:103E40008C05002130B50446034D0FCD0FC40FCDB6 -:103E50000FC42B68236030BD8C05002170B505466A -:103E6000C66A08462BF0D8F90E4CD6F8B43004F1E7 -:103E70008800C4F89430AB68C4F890302BF068FA2E -:103E8000002384F88030D6F8983043B1FFF75FFB09 -:103E9000BDE8704040F2011103482BF0B1BAFFF7C2 -:103EA0004BFBF5E764060021500300212BF0DABA42 -:103EB0001FB5002301A8CDE9013303932BF050FA7D -:103EC00005B05DF804FB00002DE9F04F85B0804699 -:103ED0000E469346994628F0E7FE074668B93E4CE1 -:103EE000D8F82CA094F8823094F88150032B06D196 -:103EF00018B184F8823084F88150012754E0022DF3 -:103F000092BF2A46033DEAB202F125018AF8011068 -:103F1000F17E551C41FA02F20133D2074FF0010045 -:103F2000DBB2EDB2E2D584F8823084F88150B9F189 -:103F3000000F04D11BF0FB0F01D12BF091FA50467A -:103F40002BF06AF9B9F1000F04D0D8F80830C4F8A2 -:103F5000903009E073685BB32BF04EFD054628F006 -:103F6000C5FE2844C4F89000002384F88030F3682C -:103F70001BB14046D4F89010984718482BF0E8F948 -:103F8000736833B301238DF80430002301A8CDE911 -:103F900002332BF0E5F9337E0121ADF804303368AC -:103FA00001A802932BF0E4F9384605B0BDE8F08F84 -:103FB000327E9AF80E109AF80C0028F0ECF80546BC -:103FC00028F094FE284428F055F9D4F890300344A2 -:103FD000BDE7FFF76DFFDEE764060021EC06002178 -:103FE0000F4B104A10B5C16AC3F888200E4A91F8E9 -:103FF000B240C3F88C200422C3F89420002283F836 -:10400000814083F8802083F8822098310123FFF7D4 -:104010005BFF18B1BDE8104028F03CBE10BD00BFEA -:10402000640600216D4100012D4000012DE9F34798 -:10403000994605462BF0E0FCDFF82481494CC8F88E -:10404000000028F021FE484AC66A92F880300746F0 -:10405000591C012B82F8801068D106F1980A002DB6 -:104060004BD1C6F8B4902A46D6F89C0006F1B803A6 -:1040700006F1800101F04AFC814668B33846D6F863 -:10408000A830D6F89C10984730B3B4F81A902BF0AB -:10409000B3FCD8F80030C01A814516D9608B608314 -:1040A000FFF706FF96F8B1300121ADF80030D6F8E1 -:1040B000A030684601932BF085F9D6F8AC30ABB14F -:1040C0003846D6F89C10984710E02BF095FCD8F8AD -:1040D0000030C01A80B2E2E7002351461A46384643 -:1040E000FFF7F2FE0546B9F1000FE6D16368013330 -:1040F0006360DDB12BF0B4F910E000232A4651468D -:10410000FFF7E2FE042D1ED001D8032D09D063690C -:104110000133636150B115F0FB0FEBD028F0CAFDFD -:1041200004E0E3680133E3600028F7D1A58B2BF0AE -:1041300063FCD8F80030C01A85420AD9A08BA0834E -:1041400002B0BDE8F087A3680133A3600028D1D195 -:10415000ECE72BF051FCD8F80030C01A80B2EEE743 -:10416000DC050021BC050021640600212DE9FF418A -:1041700007462BF041FC314E314C306028F084FD75 -:104180002FB163690133636128F094FD0CE02D4B7E -:10419000D0F82C8093F8805008F198016A1C83F8BD -:1041A00080206DB1022D39D0E58B2BF025FC3368D2 -:1041B000C01A85423BD9E08BE08304B0BDE8F081B2 -:1041C000D8F89C3023B3278B2BF016FC3368C01A29 -:1041D000874217D9208B01238DF8043000232083D8 -:1041E00001A8CDE902332BF0BBF82421D8F89C00BC -:1041F0002BF02CF9236801332360002DD4D02BF051 -:104200002FF9C1E72BF0F8FB3368C01A80B2E2E760 -:104210002B462A46FFF758FE0546EBE73B463A4653 -:10422000FFF752FE2369054601332361E5E72BF0D2 -:10423000E3FB3368C01A80B2BEE700BFDC05002193 -:10424000BC0500216406002108B50320054A064983 -:1042500001F08AFABDE808402022002103482FF02F -:104260005CBD00BFAD3E0001E13F0001BC05002187 -:1042700030B50446034D0FCD0FC495E80F0084E818 -:104280000F0030BDBC0500211FB501238DF804309F -:10429000002301A8CDE902332BF062F805B05DF8E8 -:1042A00004FB1FB5002301A8CDE9013303932BF0D4 -:1042B00057F805B05DF804FBF8B5204E204BC46AF2 -:1042C000C6F888301F4B0F46C6F88C300423C6F85A -:1042D000943000230546A6F8803028F0E5FC01461E -:1042E00050BBD4F8D4300BB12846984738462AF052 -:1042F00093FFAB681448C6F89030002386F88030EE -:104300002BF026F8D4F8A83013B9D4F8643183B16F -:10431000FFF7BAFFAB68B4F8A020C4F868310AB15F -:10432000C4F86C3104F198000221BDE8F8402BF08C -:104330001FB8FFF7B6FFEDE7F8BD00BF6406002128 -:10434000594500014D430001EC0600212DE9F74FCE -:104350008B46019307462BF04FFBDFF878815E4DCB -:10436000C8F8000028F090FC5C4AC46A92F88060AB -:104370008146711C012E019B82F8801040F08480E0 -:10438000012F04F1980A03D00BD9FB1E012B2AD868 -:1043900094F87C21002A66D000214846D4F8CC301D -:1043A00010E0C4F8DC3084F85FB19DF8303094F848 -:1043B0007CB184F8D930BBF1000F05D0D4F8CC30F3 -:1043C000D4F8F81098470EE094F85D3104EB8303BD -:1043D000D3F8F810E1B1D4F8CC309847C0B1404BD5 -:1043E0001B687BB900260023032F84F87C3147D05B -:1043F000042F56D0002F58D16B6801336B60002E0C -:1044000042D05AE05A465146484698470646EAE79F -:10441000D4F8A8100029E6D04846D4F8CC30984704 -:104420000028E0D0EE8B2BF0E7FAD8F80030C01A65 -:10443000864211D9E88BE883FFF733FF022104F1AC -:10444000AC002AF0BFFFD4F8D030002BCAD04846C9 -:10445000D4F8A8109847C5E72BF0CEFAD8F800306A -:10446000C01A80B2E7E794F85D3104EB8303D3F818 -:10447000F830002BB7D01B4B1B68002BC3D1B1E722 -:10448000EB680133EB60D6B92C8C2BF0B5FAD8F879 -:104490000030C01A844215D9288C288403B0BDE8A6 -:1044A000F08FAB680133AB60A9E7AB690133AB6157 -:1044B000002EE9D017F0FB0F01D12AF0D1FF28F030 -:1044C000F9FBE1E72BF098FAD8F80030C01A80B277 -:1044D000E3E700BFDC050021E005002164060021C0 -:1044E0000806002104060021F8B5CB6B06460C46F1 -:1044F0000BB90120F8BD0121984705460028F8D0E6 -:10450000F06A2AF089FE1148114ED0F890308830B8 -:104510002B44104D83602AF01BFFAF8B2BF06CFAFD -:104520003368C01A87420AD9A88BA883FFF7B9FE5F -:1045300004F1240002212AF01BFF0020DAE72BF00F -:104540005BFA3368C01A80B2EFE700BF640600214F -:10455000DC050021E00500212DE9F04704462BF0A1 -:104560004BFA424F424D386028F08EFB82462CB108 -:10457000AB690133AB6128F09DFB20E0DFF8F480EC -:10458000C66A98F8804006F19809022C44D0032CA2 -:104590005AD0A4B9D6F8A8301BBB96F85D3106EB0B -:1045A0008306D6F8F830ABB1334B1B6813B14946DC -:1045B000984704462B6801332B60002C52D16C8C39 -:1045C0002BF01AFA3B68C01A844245D9688C68847B -:1045D000BDE8F0870323494688F88030FFF784FF61 -:1045E000E7E7012388F88030B5F81C802BF004FA47 -:1045F0003B68C01A804509D9A88BA883FFF744FE01 -:104600002421D6F8A8002AF021FFD3E72BF0F4F9F3 -:104610003B68C01A80B2F0E7032388F880300E228E -:1046200096F8D910707BD6F8DC4027F0B4FD9634AC -:10463000044449465046C8F89040FFF755FF2B699F -:10464000044601332B61B8E74946FFF74DFF6B691C -:10465000044601336B61B0E72BF0CEF93B68C01A1A -:1046600080B2B4E72AF0FCFE85E700BFDC0500213C -:10467000E0050021640600210C060021F8B51A4C63 -:104680001A4BC66AC4F88830194B0F46C4F88C30F0 -:104690000423C4F8943000230546A4F8803028F0A1 -:1046A00003FB0146F8B9D6F8D4300BB12846984739 -:1046B00038462AF0B1FDAB680E48C4F890300023AC -:1046C00084F880302AF044FED6F8A83043B1FFF7D2 -:1046D000DBFD06F198000221BDE8F8402AF048BE53 -:1046E000FFF7DFFDF5E7F8BD64060021594500013D -:1046F0004D430001EC06002108B5002207200749C0 -:1047000001F032F800220820054901F02DF8BDE83B -:1047100008402422002103482FF0FFBA7D46000103 -:10472000B9420001E005002130B50446034D0FCD2C -:104730000FC40FCD0FC42B68236030BDE0050021EE -:104740002AF090BE2DE9F0410F46984605462BF021 -:1047500053F9224C224E94F880303060013384F8B3 -:10476000803028F091FA0023C26AD4F89C10C2F875 -:10477000A48082F8A870C4F89C30D2F8A0302A46F1 -:10478000984728F091FA18B12AF06AFE28F092FAB8 -:10479000032D144C10D0042D12D0ADB92368013371 -:1047A0002360258B2BF028F93368C01A85420FD976 -:1047B000208B2083BDE8F081A3680133A360F0E77C -:1047C000636801336360ECE7236901332361E8E741 -:1047D0002BF012F93368C01A80B2EAE764060021B0 -:1047E000DC0500211006002170B50446C66A0846A3 -:1047F0002AF012FD104D114B05F18800C5F88C30E0 -:10480000A368C5F89030D6F89830C5F894302AF0EF -:104810009FFD0023204685F88030D6F89C309847CD -:1048200028F042FA30B128F02FFA18B1BDE87040F4 -:1048300028F040BA70BD00BF640600214547000162 -:1048400008B50C20054A064900F08EFFBDE8084077 -:104850001C22002103482FF060BA00BF414700012D -:10486000E9470001100600212DE9FF411A4E0D46CF -:10487000A6F898100221C6F89C00044601A8CDE9CC -:1048800002239DF828708DF804102AF069FD96F82F -:10489000803003B137B12946204604B0BDE8F0416D -:1048A0002AF0AEBD0D4E0E4FB6F814802BF0A4F8D2 -:1048B0003B68C01A804508D9B38A29462046B3828E -:1048C00004B0BDE8F0412AF0C1BD2BF095F83B687B -:1048D000C31A9BB2F1E700BF640600211006002155 -:1048E000DC05002170B50C460546074E2AF0B8FDE0 -:1048F0002046C6F890502AF08FFC06F18800BDE8EB -:1049000070402AF025BD00BF640600212AF0AABD30 -:1049100070B504462BF070F8144A154D92F88030AB -:104920002860013382F8803028F0AEF9C36A21464E -:10493000104CD3F89C309847E3680133E36028F0CB -:10494000B3F918B12AF08CFD28F0B4F9668B2BF07E -:1049500053F82B68C01A864202D9608B608370BD01 -:104960002BF04AF82B68C01A80B2F7E764060021E2 -:10497000DC0500211006002170B50446C66A084611 -:104980002AF04AFC0E4D0F4B05F18800C5F888301F -:10499000A368C5F890302AF0DBFC0023204685F898 -:1049A0008030D6F89830984728F07EF930B128F05A -:1049B0006BF918B1BDE8704028F07CB970BD00BF3C -:1049C000640600211149000108B50D20054A064979 -:1049D00000F0CAFEBDE808401C22002103482FF069 -:1049E0009CB900BF0D490001794900011006002162 -:1049F0002DE9FF4104460D4693B1022102928DF844 -:104A0000041001A803932AF0ABFC134B93F88030F9 -:104A10004BB92946204604B0BDE8F0412AF0A8BCB5 -:104A2000CDE90133EDE70D4E0D4FB6F816802AF0B3 -:104A3000E3FF3B68C01A804508D9F38A294620461F -:104A4000F38204B0BDE8F0412AF0BCBC2AF0D4FFE8 -:104A50003B68C31A9BB2F1E76406002110060021EF -:104A6000DC05002130B50446034D0FCD0FC495E899 -:104A7000070084E8070030BD100600211FB50123A0 -:104A80008DF80430002301A8CDE902332AF068FC38 -:104A900005B05DF804FB00002DE9F04104460D4629 -:104AA00028F0F2F8C36A1B780A2B0BD1124B93F84B -:104AB00080303BB9FFF7E2FF29462046BDE8F041D0 -:104AC0002AF056BC0D4E0E4FB6F816802AF094FF11 -:104AD0003B68C01A804509D9F38AF382FFF7CEFFFD -:104AE00029462046BDE8F0412AF06CBC2AF084FF3C -:104AF0003B68C31A9BB2F0E7640600212C06002134 -:104B0000DC05002170B50C4E04460D46C6F89C002D -:104B1000A6F8981028F0B8F8C36A1B780B2B0AD1B6 -:104B200096F880303BB9FFF7A9FF29462046BDE83B -:104B300070402AF065BC70BD6406002130B50446A3 -:104B4000034D0FCD0FC495E8070084E8070030BD82 -:104B50002C06002170B50D4604462AF083FC094B53 -:104B6000D3F89C1039B100222046C3F89C200222C1 -:104B7000D5F8B43098472046D5F8AC30BDE8704041 -:104B8000184700BF640600212DE9F04105460C4698 -:104B9000C76A28F089F80646E0B920462AF03CFBAF -:104BA0000D4C0E4B04F18800C4F888300C4BC4F84F -:104BB0008C30AB68C4F890300423C4F894302AF0E9 -:104BC000C7FBD7F8A03084F880601BB12846BDE849 -:104BD000F0411847BDE8F08164060021E54B000173 -:104BE000B94C00012DE9F04385B005462AF004FFD9 -:104BF0002E4F2F4E386028F047F8D0F82C902946D9 -:104C0000D9F8B03080469847D6F89C10294C002936 -:104C10003AD055BBA58A2AF0EFFE3B68C01A854200 -:104C20001DD9A08A0023A08201A8CDE901330393F6 -:104C30002AF096FBB6F89810D6F89C002AF006FCED -:104C4000E3680133E360658B2AF0D6FE3B68C01A47 -:104C5000854213D9608B608305B0BDE8F0832AF0EC -:104C6000CBFE3B68C01A80B2DCE700230222C6F804 -:104C70009C304046D9F8B430984708E02AF0BCFE92 -:104C80003B68C01A80B2E6E70DB92AF0E9FB96F856 -:104C9000803023B928F00EF8012386F88030002DEB -:104CA000CED0236901332361CDE700BFDC050021AD -:104CB000640600212C0600212DE9F3470F46054626 -:104CC0002AF09AFEDFF81481C8F8000027F0DCFF14 -:104CD0000023C66A9DF8282086F8B870404F8DF8EA -:104CE0000730D7F89C1086F8B920C7F89C302A46C0 -:104CF000D6F8B4300446984727F0D6FF81460028FE -:104D000037D04FF0010927F0CFFF40EA0900C0B2C9 -:104D100080B1062D06D80123AB4013F0510F01D00E -:104D20002AF09EFB97F8803023B927F0C3FF0123B8 -:104D300087F880309DF8073023B929462046D6F8F9 -:104D4000A8309847032D274C35D0042D37D0002D9F -:104D500039D1236801332360258B2AF04DFED8F822 -:104D60000030C01A854232D9208B208302B0BDE8C2 -:104D7000F0872046D6F898300DF107019847824613 -:104D80000028BED02AF06CFBD6F89C300DF107014C -:104D900020469847E06A2AF03FFAD7F8900050443E -:104DA000C7F8900007F188002AF0D2FA2046D6F81A -:104DB000A4309847A7E7A3680133A360CCE76368F2 -:104DC00001336360C8E7236901332361C4E72AF034 -:104DD00013FED8F80030C01A80B2C6E7DC05002107 -:104DE000640600212C06002108B50A20054A064960 -:104DF00000F0BAFCBDE808401C22002103482EF058 -:104E00008CBF00BF554B0001894B00012C060021CF -:104E100070B50D4604462AF025FB094BD3F89C10CB -:104E200039B100222046C3F89C200222D5F8B430C4 -:104E300098472046D5F8AC30BDE87040184700BF11 -:104E40006406002101232DE9F041C76A054687F871 -:104E5000B83083680846C7F8C0300F4C0E462AF0B9 -:104E6000DBF90E4B04F18800C4F888300C4BC4F811 -:104E70008C30D7F8C030C4F89030D7F8C830C4F8B8 -:104E800094302AF065FA0023284684F88030D6F85A -:104E9000A030BDE8F041184764060021255000010C -:104EA000054F00012DE9F04106460C46904627F0DB -:104EB000FBFE074618B101273846BDE8F0814146A0 -:104EC00030462368984705460028F4D02AF0C8FAEF -:104ED000A36A0B482B44A362B360C0F89030236BE5 -:104EE0008830C3602AF034FA6368414630469847F8 -:104EF000F06A2AF091F93046E3689847DCE700BF92 -:104F0000640600212DE9F04385B00F46984604461B -:104F10002AF072FD404E306027F0B6FEC56A9DF85B -:104F2000303085F8C47014F0FB07814685F8C53031 -:104F300007D1C5F8C08001A8CDE9017703972AF011 -:104F40000FFA95F8B830012B06D12FB9D5F8C0303B -:104F500085F8B870C5F8BC304FF000082F4FD5F871 -:104F6000B430D7F89C1022464846C7F89C80984732 -:104F700004F0FD03012B8DF804800ED1484601AAF0 -:104F800005F19801FFF78EFF9DF80430804623B9A4 -:104F900021464846D5F8A830984727F085FE40EAD4 -:104FA0000800C0B280B1062C06D80123A34013F03C -:104FB000510F01D02AF054FA97F8803023B927F026 -:104FC00079FE012387F88030032C154D11D0042C75 -:104FD00013D0B4B92B6801332B602C8B2AF00CFD55 -:104FE0003368C01A844210D9288B288305B0BDE8E5 -:104FF000F083AB680133AB60EFE76B6801336B6044 -:10500000EBE72B6901332B61E7E72AF0F5FC336806 -:10501000C01A80B2E9E700BFDC0500216406002168 -:105020002C0600212DE9F74305462AF0E5FC374F11 -:105030004FF00009386027F027FE0446C66A29466B -:10504000D6F8B030984720460DF1070206F19801D6 -:105050008DF80790FFF726FF804655BB27F024FE0A -:1050600040EA0800C0B258B12AF0FAF9284B93F888 -:1050700080302BB927F01EFE0122254B83F88020BB -:105080009DF8073023B929462046D6F8A83098471E -:10509000204C8DBBE3680133E360658B2AF0ACFCE8 -:1050A0003B68C01A85422BD9608B608303B0BDE892 -:1050B000F083012D12D10028E2D0DFF85480D8F817 -:1050C0009C1031B102222046D6F8B430C8F89C902A -:1050D00098472AF0C5F998F88030CAE7DFF83080A1 -:1050E000D8F89C100029F6D002222046D6F8B43019 -:1050F000C8F89C909847EEE7236901332361CCE719 -:105100002AF07AFC3B68C01A80B2CEE7DC050021A9 -:10511000640600212C06002108B50B20054A06492B -:1051200000F022FBBDE808401C22002103482EF0BD -:10513000F4BD00BF114E0001454E00012C060021B8 -:105140001FB501238DF80430002301A8CDE90233F7 -:105150002AF006F905B05DF804FB00002DE9F041E6 -:1051600004460D4627F090FDC36A1B78042B0BD133 -:10517000124B93F880303BB9FFF7E2FF29462046F7 -:10518000BDE8F0412AF0F4B80D4E0E4FB6F8168087 -:105190002AF032FC3B68C01A804509D9F38AF382B1 -:1051A000FFF7CEFF29462046BDE8F0412AF00AB9B4 -:1051B0002AF022FC3B68C31A9BB2F0E76406002188 -:1051C00048060021DC05002170B50C4E04460D4652 -:1051D000C6F89C00A6F8981027F056FDC36A1B7805 -:1051E000052B0AD196F880303BB9FFF7A9FF294675 -:1051F0002046BDE870402AF003B970BD6406002166 -:1052000030B50446034D0FCD0FC495E8070084E880 -:10521000070030BD4806002170B50D4604462AF04F -:1052200021F9094BD3F89C1039B100222046C3F86C -:105230009C200222D5F8A43098472046D5F89C300F -:10524000BDE87040184700BF6406002170B50546F0 -:1052500008460E4C0E4629F0DFFF0D4B04F1880086 -:10526000C4F888300B4BC4F88C30AB68C4F890306D -:105270000423C4F894302AF06BF80023284684F8FD -:105280008030D6F89830BDE8704018476406002199 -:105290004D5300019952000170B50C4605462AF0A5 -:1052A000ABFB274E306027F0EFFC9DF81030C26A50 -:1052B00082F8A930234B82F8A84093F8801011B9E6 -:1052C000012183F880100024D3F89C10C3F89C407F -:1052D000D2F8A4302A46984727F0E6FC50B1062DB4 -:1052E00006D80123AB4013F0510F01D02AF0B8F8D3 -:1052F00027F0E0FC032D144C0FD0042D11D0A5B9DC -:10530000236801332360258B2AF076FB3368C01AAB -:1053100085420ED9208B208370BDA3680133A36022 -:10532000F1E7636801336360EDE7236901332361CB -:10533000E9E72AF061FB3368C01A80B2EBE700BFEF -:10534000DC05002164060021480600212DE9F04318 -:1053500085B005462AF050FB2C4EDFF8B480306053 -:1053600027F092FCD0F82C902946D9F8A0300746B7 -:105370009847D8F89C10274C00293CD065BBA58ADB -:105380002AF03AFB3368C01A85421FD9A08A01234C -:105390008DF804300023A08201A8CDE9023329F062 -:1053A000DFFFB8F89810D8F89C002AF04FF8E368AF -:1053B0000133E360658B2AF01FFB3368C01A854216 -:1053C00013D9608B608305B0BDE8F0832AF014FB2D -:1053D0003368C01A80B2DAE700230222C8F89C3092 -:1053E0003846D9F8A430984708E02AF005FB33681E -:1053F000C01A80B2E6E70DB92AF032F827F05AFC5D -:10540000002DD4D0236901332361D3E7DC050021CB -:10541000640600214806002108B50420054A064913 -:1054200000F0A2F9BDE808401C22002103482EF03C -:1054300074BC00BF195200014D5200014806002102 -:1054400070B50D4604462AF00DF8094BD3F89C10B0 -:1054500039B100222046C3F89C200222D5F8A8309A -:1054600098472046D5F8A030BDE87040184700BFE7 -:10547000640600212DE9F0410546C76A08460F4C35 -:105480000E4629F0C9FE0E4B04F18800C4F888309E -:105490000C4BC4F88C30AB68C4F89030D7F8983017 -:1054A000C4F8943029F054FF0023284684F8803053 -:1054B000D6F89C30BDE8F041184700BF64060021D3 -:1054C00081550001C9540001F8B50C461F46054638 -:1054D0002AF092FA274E306027F0D6FBC26A9DF878 -:1054E000183082F8B040244C82F8B13094F8803003 -:1054F00023B90123C2F8AC7084F880300023D4F8BB -:105500009C10C4F89C30D2F8A8302A46984727F05F -:10551000CBFB50B1062D06D80123AB4013F0510F41 -:1055200001D029F09DFF27F0C5FB032D134C0FD0B0 -:10553000042D11D0A5B9236801332360258B2AF0EF -:105540005BFA3368C01A85420ED9208B2083F8BDE0 -:10555000A3680133A360F1E7636801336360EDE79B -:10556000236901332361E9E72AF046FA3368C01A58 -:1055700080B2EBE7DC05002164060021480600212B -:105580002DE9F04385B080462AF036FA2D4D2E4E97 -:10559000286027F079FBD0F82C904146D9F8A43048 -:1055A00007462A4C9847B8F1000F29D1D6F89C300D -:1055B0000BB3A78A2AF020FA2B68C01A874214D9A5 -:1055C000A08A01238DF804300023A08201A8CDE930 -:1055D000023329F0C5FEB6F89810D6F89C0029F0E1 -:1055E00035FFE3680133E3601AE02AF005FA2B681F -:1055F000C01A80B2E5E729F033FF27F05BFBF0E744 -:10560000D6F89C1039B100230222C6F89C303846E7 -:10561000D9F8A830984727F04DFB2369013323615F -:10562000668B2AF0E9F92B68C01A864204D9608B90 -:10563000608305B0BDE8F0832AF0DEF92B68C01A5C -:1056400080B2F5E7DC050021640600214806002150 -:1056500008B50520054A064900F086F8BDE808406F -:105660001C22002103482EF058BB00BF415400010A -:105670007554000148060021C16A034B0A7853F8AB -:10568000323003B11847704764060021C16A044BE9 -:105690000A7803EBC2035B6803B11847704700BF89 -:1056A0006406002129F0E8BE29F0B4BD08B529F050 -:1056B000B1FDBDE80840002029F0D8BE08B529F0AA -:1056C0009BFD002029F0D0FEBDE80840012029F014 -:1056D000CDBE08B529F090FDBDE80840002029F0B6 -:1056E000C3BE08B529F088FDBDE80840012029F0B7 -:1056F000BBBE000073B5134C134D144E29F074FD5E -:10570000224629460120124B009627F0FFFA224636 -:10571000294602200F4B009627F0F8FA0E4B22463E -:10572000009300210D4B032027F0F0FA01200C49D3 -:1057300027F0FAFAA02200210A4802B0BDE8704022 -:105740002EF0EBBA8D56000179560001A9560001E2 -:10575000E3560001D3560001AD560001BD560001CD -:10576000A556000164060021034B43F8301003EBFB -:10577000C0035A60704700BF640600212DE9FF4155 -:10578000D3E90086044617461D461078002C3ED00B -:1057900010B34FEA162C0CF0C00CBCF1400F1BD11B -:1057A000404669B1314600F0C1FD38B12B463A465A -:1057B0004046314600F02AFD002846D0012008E08E -:1057C000314600F0A5FC0028F8D1214AD38B0133E3 -:1057D000D38304B0BDE8F0814246334600F0BCFDFF -:1057E0000238C0B20128E9D80DF10F0300933878D0 -:1057F000D5E9002300F03EFC10B19DF80F3023B92D -:105800000224134A138B013313832046E1E720B1AE -:10581000330A03F0C003402BD0D04246334600F099 -:105820009BFD02380128C9D80DF10F030093387889 -:10583000D5E9002300F01EFC18B19DF80F30002BB5 -:10584000BCD1034A138B013313830220C1E700BF8D -:10585000040700212DE9F041884617461E460446FC -:1058600058B152EA06030E4D0AD100F0CFFF0128CD -:1058700006D10446EB880133EB802046BDE8F08179 -:105880003A463346404600F03FFF20B9AB88022439 -:105890000133AB80F1E7EB880133EB80EDE700BF2C -:1058A0000407002137B5DDE9065410B9002003B024 -:1058B00030BDCAB1230A03F0C003402B14D129B173 -:1058C000284621460AAB08AA00F0FAFCDDE90A23C3 -:1058D0002846CDE9002321469DF8202000F050FC09 -:1058E000003818BF0120E2E79DF82000DDE90A2317 -:1058F00000F043FD0238C0B20128D7D8024A022086 -:10590000538B01335383D2E7040700212DE9F04F75 -:1059100090F800800D8808F00F0845FA08F515F09A -:10592000010581460F4692461C466E4E87B006D151 -:10593000338801333380284607B0BDE8F08F4FF439 -:10594000C07B72884BFA08FB01321BF0010B4378D5 -:10595000728001D00125EEE703F03F03637484F801 -:10596000108010F8025B27F093FEC5F38015E574F4 -:10597000A574C4E90201C4E900017868514604F144 -:10598000080304F11302C0F38010FFF7F7FE0128AB -:10599000054602D0022839D05D46D4E90223D7F863 -:1059A00004C094F813E01CF0040B0ED0D7E90410E7 -:1059B000834208BF8A4203D1CCF3C00CE64527D00E -:1059C0004FF0020B3089013030817888714640FAFF -:1059D00008F000F00100FFF73DFF584523D2D7F84B -:1059E00004C01CF0040F1CD0D7E90413A068E268BF -:1059F0009A4208BF884204D1E37CCCF3C00C6345D3 -:105A00000CD0338901333381012D1AD1002592E75F -:105A100070894FF0010B01307081D6E77389013333 -:105A2000738101250DE07888E17C40FA08F000F0F0 -:105A30000100D4E90223FFF70DFF0128F1D9022864 -:105A4000E2D04FF0010BB8F1050F257584F815B0C1 -:105A500080D80BFA08F818F02A0F3FF47BAF4846BD -:105A600010F8085B27F014FED4E902238146CDE943 -:105A700004237868E37CED09CDE9009188462A4645 -:105A800051460293C0F30010FFF70CFF01283FF4CA -:105A900061AF0228BAD07B68DA077FF55BAFD7E940 -:105AA0000212424508BF494503D1C3F34002AA424E -:105AB00013D0B2890132B281002DA7D04FEA182845 -:105AC00008F0C008B8F14008A0D19B069ED5338CE1 -:105AD0000133338484F815802DE7F3890133F38192 -:105AE00038E700BF040700212DE9F04F81469246B8 -:105AF000027C08880E46104110F001001C46714DD2 -:105B000089B005D12B8801332B8009B0BDE8F08F17 -:105B10004FF00108D9E900016B88C4E902010133A3 -:105B20006B80C4E9000199F8123008FA02F8E374B6 -:105B3000A37470687388514608EA030800F0040BE8 -:105B400004F1080304F11302C0F38010FFF716FEFE -:105B5000012807465FFA88F809D0022841D1BBF135 -:105B6000000F01D00020D0E7B8F1000FFAD1D4E93E -:105B7000022394F813C0BBF1000F39D0D6E904100A -:105B8000834208BF8A4204D17068C0F3C0008445D4 -:105B900029D002212889013028810791B8F1000815 -:105BA00018BF4FF0010861464046FFF753FE079BC0 -:105BB000984232D2BBF1000F3BD0D4E90202D6E9C1 -:105BC00004139A4208BF884205D17368E27CC3F38C -:105BD000C0039A420FD02B8901332B81012F0ED1A4 -:105BE000C0E70027C3E76889012101306881D4E755 -:105BF000CDF81CB0D2E701276B8901336B814FF0E0 -:105C0000010B781E47424741277584F815B099F873 -:105C100011309F0714D4012077E74046D4E90223CE -:105C2000E17CFFF717FE012808D00228D6D0002813 -:105C3000E5D1012F38BF0127FFB2E0E70746DEE7D5 -:105C4000D4E9021299F81380CDE90412D9E9023798 -:105C5000E27C706802925146424600930197C0F37D -:105C600000100793FFF71EFE01283FF44EAF0228F5 -:105C70003FF478AF7268D107CDD5D6E90201079B12 -:105C8000B94208BF984203D1C2F34003434514D040 -:105C9000AB890133AB81B8F1000F3FF463AF3F0A2A -:105CA00007F0C007403F7FF45DAF93067FF55AAF22 -:105CB0002B8C01332B846775ADE7EB890133EB81C6 -:105CC000A9E700BF04070021054B03F1240253F8A4 -:105CD000041B934240F8041BF9D11B8803807047D2 -:105CE000040700212DE9F04100240C4BDFF830803F -:105CF000054608460E4617461C7088F8004027F0F7 -:105D000023FE084B186000EB0513991BB9428EBFA8 -:105D1000204688F8005088B2BDE8F0812A070021AB -:105D20002B0700212C070021F0B500240D499DF818 -:105D300014C00D780C490968A54201D80020F0BDB7 -:105D40000E7A864208D1D1E900769E4208BF97427A -:105D500002D14E7A664502D001341031ECE70120C1 -:105D6000EDE700BF2A0700212C070021014B18781E -:105D7000704700BF2B0700210022014B1A707047AB -:105D80002A07002130B50B490B4D09782C78A14228 -:105D90000DD90A49096801EB041108720120C1E913 -:105DA00000239DF80C3001344B722C7030BD002064 -:105DB000FCE700BF2B0700212A0700212C07002148 -:105DC0002DE9F0411B4C8446276800253C46DFF84E -:105DD00068E09DF818809EF80010EEB2B14201D83C -:105DE000002021E0267A664520D1D4E900069E42B3 -:105DF00008BF90421AD1667A464517D1012901F1B0 -:105E0000FF300ED985420CD001F18051013907EBEA -:105E100001110B7A2372D1E90023C4E900234B7AE4 -:105E200063728EF800000120BDE8F0810135103466 -:105E3000D3E700BF2C0700212A070021F0B50C4949 -:105E400043EA00430D780B490C680021C8B2854233 -:105E500001D800200AE02046D0E908769E4208BF1B -:105E6000974201F1010104F14804EFD1F0BD00BFF8 -:105E7000340700215C07002130B585B00C4605468B -:105E80001022002168462DF048FF6A46230A284662 -:105E90008DF800401146240C8DF801308DF8024039 -:105EA00029F00EFC9DF802309DF801001B0443EA26 -:105EB00000239DF80000184305B030BD13B5042140 -:105EC00004460DEB010029F0B7FC01992046C1F30F -:105ED000150141F480010191FFF7CEFF019940EADD -:105EE0000160090A02B010BD2DE9F04100240D4BFC -:105EF000DFF83480054608460E4617461C7088F8C1 -:105F0000004027F021FD4821084B186001FB0503E4 -:105F1000991BB9428EBF204688F8005088B2BDE870 -:105F2000F08100BF34070021350700215C07002104 -:105F3000014B1860704700BF30070021014B1878F3 -:105F4000704700BF350700210022014B1A707047CF -:105F500034070021F8B507461D46FFF76FFF1646C8 -:105F6000044680B92E4A2F4913780978994201D8FE -:105F70000020F8BD48202C490C6800FB0344013385 -:105F80001370002CF4D0224645EA0745069BC4E96D -:105F9000086503F1100153F8040B8B4242F8040B1F -:105FA000F9D1012304F10F0284F84030631E13F885 -:105FB000011F71B3002384F8403004F11000024641 -:105FC000079B03F1100153F8045B8B4242F8045B1A -:105FD000F9D1012384F84130034604F1200213F87B -:105FE000011BC9B1002384F8413000230022C4E919 -:105FF0000A23C4E90C23C4E90E230023A4F8423089 -:1060000094F841301BB9FFF759FFC4E90C01012096 -:10601000AFE79A42CBD1D0E79A42E0D1E5E700BFA3 -:1060200034070021350700215C07002138B5FFF750 -:1060300005FF78B1084D2C78012C08D9482202FBC5 -:1060400004F30649483B096819442DF03FFE01203E -:10605000013C2C7038BD00BF340700215C070021D3 -:1060600008B5FFF7EBFE20B19DF8083080F843300B -:10607000012008BD08B5FFF7E1FE20B190F84320EC -:106080000120029B1A7008BD10B5029CFFF7D6FED6 -:1060900040B1D0E90A2352EA030116BF01200020D3 -:1060A000C4E9002310BD10B5029CFFF7C7FE40B144 -:1060B000D0E90C2352EA030116BF01200020C4E9F5 -:1060C000002310BD08B5FFF7B9FE28B1029BD3E944 -:1060D0000023C0E90C23012008BD10B5FFF7AEFE78 -:1060E000044698B190F8403083B990F8423033B903 -:1060F000FFF7E4FE0123C4E90A0184F84230029B61 -:10610000D4E90A01C3E90001012010BD0020FCE729 -:10611000F7B50026174C94F800C0174C2568344694 -:10612000F7B2BC450CD8ECB1144C2468D4B1D3E917 -:106130000067CDE9006713780122A047002411E031 -:1061400095F8407097B9D5E90A748C4208BF874228 -:106150000BD10124E98C01F001011170296AAA8C8C -:10616000C3E90012204603B0F0BD012401364835D2 -:10617000D6E700BF340700215C070021300700216B -:106180002DE9F347DDE90A679146804632463B46F2 -:1061900048460D46FFF752FEC8B190F84140B4B9E9 -:1061A000D0E90E23AB4208BF424512D00A4BD3F8C8 -:1061B00000A0BAF1000F06D04B46224640462946C1 -:1061C000CDE90067D047204602B0BDE8F087002443 -:1061D000F9E70124F7E700BF3007002138B505468D -:1061E0001046DDE904230C46FFF728FE50B190F875 -:1061F000413043B9D0E90E23A34208BFAA420CBFE5 -:106200000120002038BD0020FCE700002DE9F74FF9 -:106210000E4605461F464FF000084FF0480B010E92 -:1062200041EA0621DFF888A021F07F41214B5FFA87 -:1062300088F41B78A3420DD81F4A2049137801EB3C -:10624000C30041F83350013303F003034660137079 -:10625000002026E0DAF800300BFB043494F840907C -:10626000B9F1000F20D1D4E90A03B34208BFA84214 -:106270000ED02046CDE90012FFF7FEFDDDE9001249 -:1062800025F07F4383420FD1C4E90A5684F8429037 -:106290000120E38C03F001031370226AA38CC7E989 -:1062A000002303B0BDE8F08F08F10108BEE700BF8E -:1062B0005C0700213407002158070021380700211E -:1062C00070B50E461146D3E9002305460878FFF75E -:1062D000B5FD0446C0B190F84130ABB9D0E90E230A -:1062E000B34208BFAA420DD0290E41EA062121F08F -:1062F0007F411030FFF7C0FD25F07F43834203D17B -:10630000C4E90E5601200CE0064A0749137801EB58 -:10631000C30041F8335046600020013303F003030B -:10632000137070BD5807002138070021042330B5D1 -:10633000084AD2E900548C4208BF854202F10802A3 -:1063400005D0013B13F0FF03F3D1012030BD002045 -:10635000FCE700BF3807002108B5FFF76FFD48B123 -:10636000D0E90A23134306D190F84030002B14BF24 -:106370000120022008BD0320FCE708B5FFF75EFD01 -:1063800048B1D0E90C23134306D190F84130002BDB -:1063900014BF0120022008BD0320FCE72DE9F041D5 -:1063A00000254FF04808124E124F3378ECB2A3424A -:1063B00001D8BDE8F0813B6808FB043494F8413013 -:1063C0002BB904F11000FFF779FDC4E90C0194F832 -:1063D00040303BB994F8423023B12046FFF76EFDC0 -:1063E000C4E90A01012384F844301D44DDE700BFFD -:1063F000340700215C0700212DE9F04717460025EE -:106400004FF0480ADFF85C80DFF85C9043EA004612 -:1064100098F80030ECB2A34201D8BDE8F087D9F873 -:1064200000300AFB0434D4E90823B34208BFBA425F -:1064300016D194F841302BB904F11000FFF73EFD5E -:10644000C4E90C0194F840303BB994F8423023B1D0 -:106450002046FFF733FDC4E90A01012384F84430E4 -:106460000135D5E7340700215C07002108B5FFF7A7 -:10647000E5FC034620B1002290F8440083F8442054 -:1064800008BD08B5FFF7DAFC003818BF012008BDC9 -:106490001FB5002301A8CDE90133039328F060FF65 -:1064A00005B05DF804FB000030B5144B144D85B009 -:1064B000C5F88830134B0C46C5F88C308368084605 -:1064C000C5F89030D1F89830C5F8943028F0A4FE83 -:1064D00005F1880028F03CFF03238DF804300023E9 -:1064E00001A8CDE9023328F03BFFB4F8A410D4F89A -:1064F000A00028F085FF05B030BD00BF8565000114 -:1065000064060021096500017FB504460E4626F0A9 -:10651000BBFB38B3C56A214685F8A66014F0FB06BC -:10652000D5F89C3010D1984778B1032301A8CDE964 -:1065300002668DF8043028F013FFB5F8A410D5F8E2 -:10654000A00028F083FF04E0984728F089FF26F098 -:10655000B1FB032C0A4B07D0042C09D064B91A688C -:1065600001321A6004B070BD9A6801329A60F9E78E -:106570005A6801325A60F5E71A6901321A61F1E787 -:1065800060070021F7B5054626F07EFB1D4F064645 -:10659000C46A25BB28F064FF29463046D4F89830F9 -:1065A000984718B3184DB4F8A220D5F8903020467B -:1065B0001344C5F8903028F02FFE05F1880028F02C -:1065C000C7FEFFF765FFB4F8A0300121ADF8003039 -:1065D000D4F89C306846019328F0CAFE09E028F000 -:1065E0003FFF29463046D4F89830984726F062FBA2 -:1065F00025B9FB680133FB6003B0F0BD3B69013393 -:106600003B61F9E7600700216406002137B50C46BD -:106610000F4D104BC5F888300F4BC5F88C30836890 -:106620000846C5F8903028F0F7FD05F1880028F0FD -:106630008FFEFFF72DFFB4F8A0300121ADF8003038 -:10664000D4F89C306846019328F092FE03B030BD28 -:1066500064060021856500010965000108B528F080 -:1066600001FFBDE8084026F025BB000010B5094C2D -:10667000002022460849FFF777F822460120074903 -:10668000FFF772F8BDE810401C22002104482DF0ED -:1066900044BB00BF5D6600010D660001A9640001F6 -:1066A0006007002130B50446034D0FCD0FC495E8B7 -:1066B000070084E8070030BD600700212DE9F041A4 -:1066C00000240D4BDFF834801C700D4B0546084646 -:1066D0000E4617461C7088F8004027F035F9094B24 -:1066E000186000EBC503991BB9428EBF204688F89D -:1066F000005088B2BDE8F0817D0700217E070021AF -:106700007C0700218007002130B50B4943EA004394 -:106710000A480968047801EBC404A14201D10020B1 -:1067200030BDD1E90050984208BF954201F10801FF -:10673000F3D10120F4E700BF800700217D0700218D -:10674000014B1878704700BF7E0700210023024AE2 -:106750001370024A137070477D0700217C070021E7 -:1067600070B5064615461C46FFF7CEFF80B9094BAB -:10677000094A197812788A420BD9084A44EA064431 -:10678000126802EBC10042F83150013144601970C7 -:10679000012070BD7D0700217E07002180070021B8 -:1067A00043EA00431148F0B50468DFF844C02546C9 -:1067B0009CF8001004EBC10E754501D1002014E0D7 -:1067C0002846D0E900769E4208BF974205F10805A9 -:1067D000F2D1012905D904EBC10454E90223C0E92F -:1067E0000023012001398CF80010F0BD8007002142 -:1067F0007D0700210122014B1A7070477C070021A0 -:106800000022014B1A7070477C070021014B187859 -:10681000704700BF7C07002137B5044625F050FAC9 -:106820000022144B9C42144B0CBFDA701A7194F87E -:10683000423003F0FD03012B01D125F051FA20462F -:106840000CF082FC04F1280528460DF1070127F021 -:10685000A1F840B9303420460DF1070127F09AF82D -:1068600020B903B030BD27F07DF8EDE727F07AF8C6 -:10687000F1E700BF580D00212050002138B5164C1B -:10688000164B174A1D6804F13C0392E8030083E8A5 -:10689000030004F1480029790CF087FD012026F05F -:1068A0007DF925F005FA01230E4DEB7094F8423086 -:1068B00003F0FD03012B01D125F00AFA0CF066FC70 -:1068C00000200123687184F85832A4F85632BDE8DC -:1068D000384025F094B900BF580D0021540D002117 -:1068E000F850002120500021054BDB7833B1012303 -:1068F000044880F899309C3026F06ABD704700BF8C -:1069000020500021580D0021002025F078B90C20DE -:1069100025F075B908B5012026F056F9BDE8084004 -:106920000148FFF779BF00BF580D002108B50120CD -:1069300026F04AF90348FFF76FFFBDE80840002042 -:1069400025F05DB9580D0021FFF7E4BF034B1A682D -:10695000034B5068916803C3704700BF540D00217A -:10696000F850002108B5084B08481B68197990F8C1 -:1069700088308B4202D048300CF017FDBDE808404B -:10698000002025F03CB900BF540D0021580D002116 -:1069900010B50446012026F017F9A37B03F0FD0390 -:1069A000012B01D125F09CF9D4F8D00120B126F0BB -:1069B000D9FF0023C4F8D031D4F8D80120B126F093 -:1069C000D1FF0023C4F8D831034AD378013BD370F8 -:1069D000BDE8104025F074B92050002110B50446E0 -:1069E000012026F0F1F8E36833B10B480B4A201A76 -:1069F000C010504380B2984794F870330BB125F023 -:106A00007FF925F05DF9D4F85C0308B126F0AAFF00 -:106A10000023237010BD00BFD01D00214DF833E1CD -:106A200038B50C4605461222002120462DF075F996 -:106A3000204695F8D83300F8023BD5E9F82326F034 -:106A40002DFE95F8D9330E4A637095F820342372E1 -:106A5000D5F8E431A3FB0232DB0F43EA4203638142 -:106A600095F8E831237395F8F832637395F8F932A5 -:106A7000A37395F8FA32E37395F8FB32237438BDAB -:106A8000E3361A0038B50446012026F087F8A37BC8 -:106A900003F0FD03012B01D125F01AF90023204654 -:106AA0006370A370A4F8003184F83C300CF0A6FFAA -:106AB000054620B920460DF0BFF8054640B12846EE -:106AC00025F0F4F92046BDE8384003210DF090BAD6 -:106AD000074AD3780133D37025F0EAF8012328461A -:106AE00084F86830A4F86630BDE8384025F0DEB997 -:106AF00020500021002025F0D9B9000030B4027CDC -:106B00000121022A18BF00220C4C81706578954241 -:106B10000AD190F8002122B900F5827030BC26F02D -:106B200057BC00F52E70F9E701FA02F2217821EA4C -:106B300002022270032130BC0DF05ABAB80F0021B6 -:106B4000002025F0B3B9000010B5094C6378012B83 -:106B500004D9BDE810400C2025F0A8B904F160006C -:106B600027F017F904F17000BDE8104027F011B9C3 -:106B700048140021034B5B7813B10C2025F096B923 -:106B8000704700BF48140021024B587800B10C2018 -:106B900025F08CB94814002108B5FFF7F9FE044B25 -:106BA0005B7823B1BDE80840002025F07FB908BD1F -:106BB0004814002138B51E4B01201C6825F0EEFF5B -:106BC00023790BB125F094F823791A4D2B72D4E96F -:106BD0000223C5E90423E379AB72A3796B72637D69 -:106BE0002B760DF095FDD8B12862237980F87033AB -:106BF000A37980F87133E37980F87233D4E9022302 -:106C0000C0E9DE230A22238AA0F86833638A53434B -:106C1000C0F86C330B23437263798371237DC37196 -:106C2000286A0DF0B5FABDE8384025F041B800BF3C -:106C30001C370021C0360021034B5A78012A04BFBB -:106C400000225A70704700BFC0360021084B186AF6 -:106C500090F85B230AB9012202715B78012B03D102 -:106C6000C370303026F0B4BB05210DF0DBB900BF96 -:106C7000C036002130B5104C87B06378012B07D1A6 -:106C80000025206AC3700571303026F0A1FB6570C5 -:106C9000206A01A9FFF7C4FE236A0849084A591A65 -:106CA000C91051433E2093F8213401AA89B225F03E -:106CB00033F907B030BD00BFC0360021D01D002120 -:106CC0004DF833E130B52F4C87B06378206A012B43 -:106CD00004BF00236370FFF781FE256A2B7983B11F -:106CE0001222002101A82DF018F82749274B691A14 -:106CF000C9105943442095F8213401AA89B225F0DE -:106D00000BF9256A95F85B33BBB1217A11F00101CB -:106D100015D1122201A82DF000F81B491B4B691A4E -:106D2000C91059431A2095F8213401AA89B225F0D7 -:106D3000F3F80022236A83F85B2307B030BD1820E4 -:106D400026F008FE01460028F3D040F20B134380E2 -:106D5000D4E90423C0E90223A37AC371637A83715F -:106D6000237A0371236A9A794271B3F86823D3F8BE -:106D70006C3302824382237E4375054B187B26F0D9 -:106D8000FAFDD6E7C0360021D01D00214DF833E1D1 -:106D9000685000212DE9F043564B85B01D680DF079 -:106DA000B7FC0446002800F0A180012025F0F6FE83 -:106DB000002184F8701395F820304F4F84F8713318 -:106DC00095F821304D4E84F87233D5E90A23C4E991 -:106DD000DE2395F82330384684F820344FF47A7354 -:106DE000C4F86C330C233461A4F868136372A91DD2 -:106DF00018F0B8FB40F2E242BB885343C4F8E431D8 -:106E000095F8203084F8D83395F8213084F8D933B8 -:106E1000DB07D5E90A01C4E9F8011CD50B0A03F028 -:106E2000C003403B17D14FF000084FF000098DF828 -:106E300007300DF1070202ABCDE90289FFF7E6F951 -:106E400048B19DF8073043F0020384F8D933DDE9F7 -:106E50000223C4E9F82395F83230306984F82134EC -:106E60006B6BC4F8F43295F8383084F8F83295F842 -:106E7000393084F8F93295F83A3084F8FA3295F8D6 -:106E80003B3084F8FB320DF083F994F821348BB158 -:106E90001B4B6A6B1B68E3641A4B1B6823651A4B18 -:106EA0001B68C4F80831E36D9A67184B1B680BB177 -:106EB0002046984724F0FCFEAB88288BB3806B8B70 -:106EC0007080F380AB8B33812B8E738195F82230E9 -:106ED0003373EB8BF3816B6B7361AB6BB3610DF051 -:106EE0003BFA05B0BDE8F04306F044B805B0BDE894 -:106EF000F08300BF1C37002120370021E836002135 -:106F0000CC070021C4070021C0070021D0070021C1 -:106F100070470000012310B5064C2069C370303063 -:106F200026F056FA21693E20BDE8104091F8212450 -:106F30000DF070BCE8360021034B18690123303096 -:106F400000F82D3C26F044BAE8360021044B1869BD -:106F5000C378012B04BF0023C370FFF73FBD00BF00 -:106F6000E836002110B5437A04460B2B86B010D1C9 -:106F700001A9FFF755FD0C490C4B611AC910594383 -:106F8000002094F8213401AA89B224F0C5FF06B08C -:106F900010BD0C2BFBD1014690F82124002006B037 -:106FA000BDE810400DF036BCD01D00214DF833E196 -:106FB0000123303000F82E3C26F00ABAFFF70EBD50 -:106FC000012310B504468370303026F001FA04F531 -:106FD000727026F0DEFE0548201A054CC010604392 -:106FE000BDE8104080B224F0C9BF00BFD01D002111 -:106FF0004DF833E1F8B50579C388012D1AD0022D7B -:1070000021D0B5B94FF48562534313490688CC1893 -:10701000B4F830224088921B82420ADCD4E98A67A5 -:1070200003F56473C4E9E467C81824F0A1FE84F88A -:107030002052F8BD4FF48562074802FB030300228B -:1070400083F88822F5E74FF48562034802FB0303C7 -:10705000002283F8F022ECE7D01D002108B524F0CF -:107060002FFE0022054B5A70054B93F821301BB1BF -:10707000BDE8084024F034BE08BD00BF2050002108 -:107080004051002108B5012025F088FD24F010FEB4 -:107090000122074B5A70074B93F821300BB124F0B3 -:1070A00017FE0DF0F1FCBDE80840002024F098BD6B -:1070B000205000214051002108B5012025F06EFD2F -:1070C00024F0F6FD0122064B5A70064B93F821304E -:1070D0000BB124F0FDFDBDE808400DF0D5BC00BFAC -:1070E0002050002140510021054B5B7833B1012332 -:1070F000044880F829302C3026F06AB9704700BF68 -:107100002050002168370021002024F069BD0C20A8 -:1071100024F066BD2DE9F041634B8AB05B78002B0B -:1071200000F0BE80614D95F82860002E00F08C8044 -:10713000D5F8FC80B8F1000F00F08180012205F540 -:107140008C7305F1E0014046FEF7E0FB064668203F -:1071500026F000FC0446002800F09E8000F108079D -:10716000384608F1020118F0C8FB384618F01CFC3C -:1071700000B196B9204626F0F5FB042026F0EAFB84 -:10718000014630B14FF441734380494B187B26F0E0 -:10719000F2FB012025F018FD51E00023A370D5F883 -:1071A000E031A36395F82B3184F83C3095F82A211F -:1071B0009A4207D1D5E94861D5E94602914208BF14 -:1071C000864203D043F0020384F83C300020D5E926 -:1071D00048230021C4E91223C4E9140195F82B01C6 -:1071E00095F82A11884207D1D5E94870D5E946615A -:1071F000884208BFB74203D0D5E94601C4E914016B -:1072000094F83C0014F076FC0028B3D1294B2146B9 -:10721000D3E91C23C4E9162395F82A3084F84100E9 -:1072200084F83D300123E387FF2384F860304FF674 -:10723000FF73A4F862301E4B187B26F09CFB0AB04B -:10724000BDE8F041FFF70ABF1A4C0DF057FD257C51 -:10725000012D9ED13146232268462CF05EFD43F677 -:107260000543ADF802303C238DF80430A37C0DF1CA -:107270000A008DF80930FF238DF823304FF6FF7395 -:10728000ADF82430D4E906238DF8085026F006FA2C -:10729000684624F09DFC7CE7002E3FF46EAFCEE7FD -:1072A0000AB0BDE8F08100BF2050002168370021FE -:1072B000685000214051002108B5012025F084FCD0 -:1072C000FFF7CCFE0DF01AFDBDE80840002024F0C9 -:1072D00087BC08B5012025F077FCFFF7BFFEBDE8AD -:1072E00008400DF00BBD000010B50446012025F04C -:1072F0006BFC074B1868201A064CC0106043043022 -:10730000C0B225F0ABFABDE8104024F0D9BC00BFF4 -:10731000C0390021D53FF54F10B50446D0F8E80A32 -:1073200028B1043826F01EFB0023C4F8E83AD4F84C -:107330002C0928B1043826F015FB0023C4F82C3999 -:1073400094F83B300BB124F0CBFC024A9378013B1C -:10735000937010BD2050002138B504461F4D012008 -:1073600025F01CFC2A682046137A84F8D4330023C5 -:1073700084F8D53384F8D63384F85C3884F85E38E2 -:107380005168C4F8D8330EF0B7FE014640B16078BA -:1073900024F002FE2046BDE8384004210EF062BD14 -:1073A0000F4A93780133937094F83B300BB124F07B -:1073B0008FFC2B68596851B14FF47A72636A0A39AD -:1073C000B3FBF2F304F57170C91A26F0DCFC6078A7 -:1073D0000021BDE8384024F0DFBD00BFC8390021DE -:1073E0002050002138B504461C4D012025F0D6FB65 -:1073F0002A682046137A84F8D433002384F8D533DE -:1074000084F8D63384F85C3884F85E385168C4F860 -:10741000D8330EF071FE014640B1607824F0BCFD17 -:107420002046BDE8384004210EF01CBD2B685B6887 -:1074300093B14FF47A71626A4B4302F59C52083261 -:10744000B3FBF2F3013B534304F57170B3FBF1F16D -:10745000BDE8384026F097BC38BD00BFC8390021D0 -:1074600070B5134D00F571760446304626F091FC58 -:107470002B685B687BB14FF47A71626A4B4302F50B -:107480009C520832B3FBF2F3013B53433046B3FB4B -:10749000F1F126F078FC00212B6860781B7A84F8E3 -:1074A000D51384F8D433BDE8704024F075BD00BF17 -:1074B000C839002110B5044600F5717026F069FC4A -:1074C000002384F8D633012384F85E3810BD0021F0 -:1074D000407824F061BD0C21407824F05DBD0000AF -:1074E000F0B590F85C3804469FB0002B39D100F518 -:1074F000717026F04EFC2046FFF70EFF012025F0AC -:1075000063FB94F8D42394F8D53322B1934224BF7B -:10751000432284F8D623002294F8D613607824F00E -:107520007EFB238C03F01D031D2B18D1FF234FF688 -:10753000FF7200200021CDE908323C230022CDE972 -:107540000401CDE90632CDE90201D4E90C0194F839 -:107550003A30CDE900010121607801F05FFC1FB0F5 -:10756000F0BDD0F82C697C4F002E7ED000F6481379 -:1075700000F5116101223046FEF7C8F9002800F03D -:10758000D780682026F0E6F90546002800F0D08074 -:107590006378314603800023837012A818F084F9C1 -:1075A000311805F1080018F0A8F9D4F82C39002B8F -:1075B00000F0898094F85BC904F5156185F83CC03A -:1075C00094F85A39634508D151E90203D4F8506957 -:1075D0004A689A4208BF864203D04CF0020C85F8F4 -:1075E0003CC0D1E90023C5E9122300220023C5E9EC -:1075F000142394F85B2994F85A399A4208D151E936 -:107600000203D4F850694A689A4208BF864203D000 -:1076100051E90223C5E91423012385F83E30D4F84B -:107620005838387BAB634D4B2946D3E91C23C5E959 -:10763000162394F85D3885F83D30012385F83F30F6 -:1076400094F8D53385F8403094F8543885F84130B3 -:10765000FF2385F860304FF6FF73A5F8623026F0FF -:107660008AF92046FFF758FE79E7D0F8E86A002E3D -:1076700087D031460AA818F017F9311812A818F067 -:107680003CF9002311939DF8283004F511618DF821 -:10769000403003238DF84130DDE91223CDE90C237E -:1076A0009DF82A300CA88DF84230DDE91423CDE98D -:1076B0000E239DF82B3001228DF8433004F5326300 -:1076C000FEF712FA5AE794F833CB04F5326185F8E5 -:1076D0003CC094F8323B634508D1D1E90262D4F84A -:1076E000200B4B689A4208BF864203D04CF0020C34 -:1076F00085F83CC0D1E90223C5E91223002200230A -:10770000C5E9142394F8332B94F8323B9A4208D1FC -:10771000D1E90262D4F8200B4B689A4208BF864236 -:1077200003D0D1E90023C5E9142394F84D3A74E756 -:107730006378311F26F8043C082306F8023C032333 -:1077400006F8013C387B26F016F901201FB0BDE891 -:10775000F04025F039BA00BF6850002140510021A7 -:1077600010B50446FFF7D8FD012025F02DFA60780A -:107770000021BDE8104024F00FBC10B50446FFF70F -:10778000CBFD012025F020FA2046BDE810400DF089 -:107790002FBC3C2380F8D633012380F85E38704735 -:1077A00000221346F0B5D0E90076C3F12005A3F11D -:1077B000200427FA03F106FA05F5294326FA04F412 -:1077C0002143C90744BF81180B7203F1010348BF6D -:1077D0000132252BE9D180F82D20F0BD70B504468B -:1077E0000025012025F0DAF984F84E530BF09CFBBC -:1077F000A4F8905184F8B7532546354BC4F88C0152 -:10780000D3E90E23E5E9DA23284624F0B1FA01236F -:1078100084F89633D4F88C3183EA1343A4F8983370 -:1078200094F8DD3BEBB194F8B713B4F890315940BC -:1078300028460DF007FD94F8DD3B84F84D03204603 -:1078400093B1244B1B687BB19847054678B120461D -:1078500003210EF07FFD29466078BDE8704024F0DA -:10786000D2BBB4F89011E3E70EF0B4FDEDE70123CD -:1078700084F88931A378012B13D194F8C52B0AB968 -:1078800084F89231D4F82C66B4F8525824F06DF98B -:107890003246294625F00EFF0123A4F83E0684F85F -:1078A000C63B94F854335BB1D4F82C66B4F8525804 -:1078B00024F05BF93246294625F0FCFEA4F8560375 -:1078C0006078002124F09FFBBDE8704024F0F0B9FF -:1078D00020500021840700210021407824F093BB30 -:1078E0000C21407824F08FBBF8B583780446012B37 -:1078F00011D190F88951012D0DD1D0F82C76B0F826 -:10790000526824F032F93A46314625F0D3FE84F825 -:10791000C65BA4F83E06012384F84E33002394F896 -:10792000DD2B84F8893184F892316AB1D4F82405CA -:107930000F22A0F8003F47F6FF73FF21A0F8023F97 -:1079400000F604702CF0E9F904F5CA70BDE8F840BF -:1079500025F03EBD10B590F888310446012B04D1C6 -:10796000FFF7C2FF2046FFF7BFFC2046BDE81040EE -:10797000FFF7A0BD10B590F888310446012B04D163 -:10798000FFF7B2FF2046FFF7AFFC2046BDE81040EE -:107990000DF02EBB10B50446FFF7A6FC6078002161 -:1079A000BDE8104024F02FBB90F85030012B12D0CE -:1079B000094B1B68D3E90223C0E9E823C0E9162379 -:1079C000B0F890310633A0F86030082380F85230C8 -:1079D000012380F850307047BC390021D0F8D03BEB -:1079E0000BB1407818477047D0F8D43B0BB14078C2 -:1079F0001847704790F82031012B0ED0D0F8A833EB -:107A0000C0F82431B0F8AC33A0F82831B0F8B43362 -:107A1000A0F82A31092380F8223170470023C0F8EA -:107A20002031C0F82431C0F8283170476822002185 -:107A30002CF073B95030FFF7F9BF2B2307B58DF841 -:107A400003008DF804006846ADF800108DF8023090 -:107A50008DF8051024F0BCF803B05DF804FB2D236D -:107A600007B5ADF800008DF804006846ADF80230A7 -:107A70008DF8051024F0ACF803B05DF804FB08B5F0 -:107A8000012025F08BF8BDE8084024F011B9000072 -:107A90002DE9F04FDFF840810446D8F800608FB040 -:107AA00006F1080529460FF0EFFD2946002520467E -:107AB0000FF052FEAA46B37DAB4243D9002794F89B -:107AC000562004F1570305F101090BE0D4F8943076 -:107AD00053BB94F89C30C4F894B0ED1A84F89D50D0 -:107AE00022E00137BA421FD913F8011B4945F8D1EA -:107AF00020460EF0E5FE96F84030F18E0293D6E96E -:107B00000E23CDE900230A46F16A83460EF07EFF7C -:107B1000D4F89030002BD9D1E368C4F890B06B430F -:107B200084F89C50C4F8983094F85630BB4207D182 -:107B300094F834305A1C0E3384F8342044F823A0CF -:107B40004D46B8E7D8F80010204608310FF01AFD6E -:107B5000216F04F1600026F016F92C23A57820226D -:107B6000002106A8ADF81630ADF814502CF0D5F869 -:107B7000E36A1A4A0793238B04F138015BBAADF824 -:107B80002030638B8DF81950ADF82230A388503423 -:107B9000ADF8243054F8403CA3FB0232DB0F43EA3B -:107BA00042030022ADF82630134651F8040B40B1D1 -:107BB00040880EAD5A1C05EB430323F80E0CD3B2DC -:107BC00001228C42F1D10AB18DF8283005A823F0AA -:107BD000FFFF0FB0BDE8F08FD8390021E3361A005F -:107BE00090F8BA3080F85430704710B504468AB027 -:107BF00081780020FFF721FF0021202202A82CF02D -:107C00008CF82C228DF806204422A37801A8ADF828 -:107C100004308DF807208DF808208DF8093023F006 -:107C2000D7FF20460FF056FA0AB0BDE8104024F006 -:107C300047B8082380F8543070473D2380F854300B -:107C4000704710B50446012024F0BEFF236D13B128 -:107C5000002283F88A226378032B06D194F85430EB -:107C6000A0784BB11946FFF7FAFE20460FF032FA22 -:107C7000BDE8104024F024B801461846FFF7DDFEA9 -:107C8000F3E7F8B5054610F0DDFA044648B128469A -:107C9000042110F0A5FA21462846BDE8F84010F06E -:107CA00039BA012024F07AFF2C6DCCB1012384F87D -:107CB0008931A378012B13D194F8C52B0AB984F824 -:107CC0009231D4F82C76B4F8526823F04EFF3A463D -:107CD000314625F0EFFC0123A4F83E0684F8C63BAC -:107CE0002846022110F092FABDE8F84023F0E0BFE8 -:107CF000F0B5044685B007200FF028F9064630B3EA -:107D0000144B03A91868258C0390304619F080F9AC -:107D1000114F0635ADB2D7E90E230095304419F066 -:107D20008AF90622314620460FF017F994F8A03060 -:107D3000A4F8A85043F0010384F8A030D7E90E233B -:107D4000C4E92C23236D13B1002283F8B82005B0B9 -:107D5000F0BD00BF2C4E03012050002173B5044636 -:107D600003200FF0F3F80646E0B1124B01A9586862 -:107D7000258C0190304619F04BF90635ADB22A46F4 -:107D800094F8BA10304419F068F9062231462046BA -:107D90000FF0E3F894F8A030A4F8B85043F00203D1 -:107DA00084F8A0300321204602B0BDE8704010F0F6 -:107DB0002DBA00BF2C4E030110B50446C43025F087 -:107DC00007FB2046BDE81040032110F01FBA10B594 -:107DD0000446012024F0F8FE20460FF07BF923F042 -:107DE0006FFF6378022B04D12046BDE8104010F0ED -:107DF000E3B910BD164A30B514684FF49562C388D4 -:107E000085B002FB0344062203890546ADF8043021 -:107E1000ADF80A30C37F01A88DF80C308DF806202C -:107E20008DF807108DF8081023F0D2FE94F82E3448 -:107E300063B12989B4F8360410F0EEFB054628B981 -:107E400004F5866023F0C4FE84F82E5405B030BDDE -:107E5000B43A00212DE9F0438BB0044615460E4696 -:107E60002422002101A82BF058FF27238DF802308F -:107E700040F2E243B4F8E82294F8EB1294F8EA7284 -:107E800002FB01FE02FB07F003FB0EFE94F8D89202 -:107E900003FB00F8D4F8E432B9F1010F0CBF5B1911 -:107EA000EB1A734405932369D4F8E0020393B4F802 -:107EB000D432B4F808C0ADF8183094F8EC3208BFEA -:107EC00040198DF81A3094F8F43218BF281A8DF83A -:107ED0001B3094F8F53208BF40448DF81C30A37A6B -:107EE00018BF4044ADF800C08DF803600CBF04908B -:107EF0000490ADF806C08DF8046002958DF81D70F1 -:107F00008DF81E10ADF824208BB9B4F83021012B68 -:107F10000CBFB4F83031B4F82C316846ADF82020ED -:107F2000ADF8223023F054FE0BB0BDE8F083B4F876 -:107F30002C21ECE738B5054604200C4625F00AFD57 -:107F4000014650B12B89C47003800F238370034B0B -:107F5000187BBDE8384025F00EBD38BD68500021C3 -:107F600038B5054604200C4625F0F4FC014650B116 -:107F7000EB88C470038001238370034B187BBDE83A -:107F8000384025F0F8BC38BD68500021014B9B7C7F -:107F9000C3777047283A0021024B1B681B79C377CF -:107FA000704700BFE03900213E23C37770470823A4 -:107FB000C37770472223C37770470D23C377704779 -:107FC000014B5B7CC3777047283A00213D23C37780 -:107FD0007047000010B50446C07A10F097FB4FF4CC -:107FE00095611B4BE2881B6801FB0233C27D0132A5 -:107FF000C275A27A22BB94F8D412032993F85620B2 -:1080000021D1013A18BF01228A1A1A4492F950224A -:108010007E2A1AD193F81504B8B10E4A581812687E -:10802000032992F9282080F84F2208BF83F85322B1 -:10803000D3F834335B0702D5012384F8CB3210BD6B -:1080400094F8D512D9E70122DEE784F83A21F6E761 -:10805000B43A0021DC4D002138B590F84750044671 -:108060000022C17F4DB1222906D180F8472011217D -:10807000BDE83840FFF7EEBE0C25204684F84720C7 -:108080000022FFF7E7FE204610F04CFEE37F442B72 -:1080900007D1162329462046E377BDE83840FFF78D -:1080A000A9BE38BD38B50446C08813F0A7F9054607 -:1080B00098B9082025F04EFC014668B1E38803809A -:1080C00041F2017343802389C380E37F0371044B32 -:1080D000187B25F050FCA57638BD0123A376FBE77D -:1080E00068500021F8B504460121C688008915F0C2 -:1080F0009FFD0221208915F09BFDE07A10F006FB20 -:10810000054604F52E7025F044FE01236376E37FD7 -:108110003E2B0CD100276776EB7D2046013BEB75AB -:1081200010F000FE3A462046E17FFFF793FE144B25 -:108130001B6893F83520134B1C680023934219D217 -:10814000E188B14217D1657EADB9A17E99B1082011 -:1081500025F000FC014668B1E388038041F2017319 -:1081600043802389C380E37F0371074B187B25F08D -:1081700002FCA576F8BD013304F56274DEE700BFAA -:10818000DC4D0021E4390021685000218378012B67 -:1081900008BF4376704770B5054604200C46CE7F75 -:1081A00013F0D0FE014648B122230370E37A4370F6 -:1081B000237BC6708370284613F09AFE214628461A -:1081C000BDE8704010F0ADBE034B9B7CCB77012324 -:1081D00080F87F33704700BF283A00210846052108 -:1081E000FFF7A8BEFFF7D7BF012380F87F337047A2 -:1081F0002DE9F34705460C46C87A10F087FAB5F822 -:108200000432B5F80672DA1DB5F80832B5F85E1416 -:10821000C3EB470302FB0133A4F848300023A4F862 -:108220004A30064610F03AFBB4F84830B5F806126A -:10823000B5F80A225B1A5343EF6900285FD140F278 -:10824000E242DFF8289102FB0377D9F80010DFF84B -:108250002081731A9B1008FB03F313F0FF0302D075 -:108260003269002A47D03A46032340F2E247D9F860 -:108270000010B08A711A891008FB01F10A310093CD -:10828000784305F11403C9B224F00CFBD4E90423AC -:108290009B1A326913440344B3F5FA7F38BF4FF495 -:1082A000FA73E36440F2E243B5F80A1294F8EC2260 -:1082B0005943304BD4F8F0021B68DB8E00FB1233BD -:1082C0000B44E26C9A4249D202B0BDE8F087013219 -:1082D000D2B2981AC7D40CFB001090F804E0BEF19B -:1082E000000FF4D00369406B03EB000A24F004FD97 -:1082F00050443061B7E701224FF09C0CE9E740F2AF -:10830000E24909FB0377B4F84A20B6F81480013239 -:1083100092B202FB08F8A4F84A20726A394609FBB7 -:108320000828404624F0EEFC0028ECD039464046B0 -:1083300024F0E8FCD4E904239B1A0344B3F5FA7F44 -:1083400003D84FF4FA70E064ACE73946404624F0B5 -:10835000D9FCD4E904239B1A1844F4E7521AE264C6 -:10836000B4F848200132A4F84820AAE7DC390021FB -:10837000976FF996DC4D00217FB50546C87A0C460B -:1083800010F0C4F9C37D0646F3B9837D002B00F0DD -:10839000F0804179C1B940F2E242838A5343804A76 -:1083A0001068804A301A801050437F4A0A30CDE965 -:1083B0000112F268C0B200921A4624F0BDF90028FA -:1083C00000F0D7800123737121462846FFF710FF84 -:1083D0002146304610F018FB744BC5F83C34744B02 -:1083E000C5F84034734B1B681B88E380D5F84832CE -:1083F000C4F8E830B5F88232A4F8C8320AF094FD27 -:10840000D5E98623C4F8E400204610F04BFA242076 -:1084100013F098FD0146002800F0A1801F2303708F -:10842000E37A4370237B837094F8D432022B03D019 -:10843000032B14BF01230423CB7094F8D532022BF5 -:1084400003D0032B14BF012304230B71B4F8DA32D9 -:1084500028464B7194F8D832B4F8DA22DB03C2F321 -:108460000B029BB213431B128B71B4F8DC32CB713D -:10847000B4F8DC32C3F303230B72D4F8E0324B724E -:10848000D4F8E0321B0A8B72B4F8E23203F00F0327 -:10849000CB72D4F8E4320B73D4F8E4321B0A4B737A -:1084A000B4F8E63203F00F038B73B4F83031CB73BA -:1084B000B4F830311B0A0B74B4F82C314B74B4F897 -:1084C0002C311B0A8B7494F8EC32012BCB740CBF4B -:1084D000002394F8F0320B7594F8EC32012B0CBFAA -:1084E000002394F8F1324B7594F8EC32012B0CBF59 -:1084F000002394F8F2328B7594F8F43294F8F52254 -:1085000003F00F0343EA0213CB7594F8EA320B76BB -:1085100094F8EB324B76B4F8E8328B76B4F8E83264 -:108520001B0ACB76E36C0B77E36C1B0A4B77B4F832 -:108530004E308B77E36CCB77E36C1B0A81F82030ED -:10854000B4F84E3081F82130B4F8483081F8223048 -:10855000B4F848301B0A81F8233013F0C9FC01231A -:108560002146284684F8473004B0BDE8704010F03A -:10857000D8BC2046FFF721FD042025F0EBF9014689 -:1085800008B904B070BDE388038044F6013343802A -:10859000094B187B04B0BDE8704025F0ECB900BF72 -:1085A000DC390021976FF996B1A70101658E0101B1 -:1085B000C18E0101B03A002168500021002310B59E -:1085C0000C46084681F84730FFF7FAFC204612F0C7 -:1085D000FFF82046BDE810400221FFF7ABBC0000C9 -:1085E00070B50546C87A0C4610F090F8384B064630 -:1085F000D3E904329A4205D3C378FBB1204611F087 -:10860000FFFF1DE001220D21284601F097F92146C8 -:10861000284610F090FC0023204684F84730FFF7EE -:10862000CCFC2146304610F082FA204612F0D0F8F9 -:1086300002212046BDE87040FFF77CBC11F046FFE8 -:10864000204610F091F9337923B922462946304665 -:1086500012F04EF80023102084F8473013F072FC1B -:10866000014670B321230370D4F8E4304370D4F88A -:10867000E4301B0A8370B4F8E630C37094F8E73036 -:108680000371E36C4371E36C1B0A8371B4F84E30E1 -:10869000C3716369037263691B0A4372E38A83725D -:1086A0002369C37223691B0A0373638A4373B4F893 -:1086B00048308373B4F848301B0AC373284613F05C -:1086C00017FC2146284610F036FC0121B1E700BF17 -:1086D000283A002170B50646C87A0C4610F016F804 -:1086E00005462146304610F026FC2046FFF762FC86 -:1086F0002146284610F01BFA204612F069F8204661 -:10870000BDE870400221FFF715BC10B50C4610F013 -:1087100012FC204612F05CF82046BDE81040022111 -:10872000FFF708BC10B50C4610F005FC204612F00F -:108730004FF844232046E3770221BDE81040FFF7BD -:10874000F9BB40F67C42838C10B5043B9BB293424C -:10875000044601D9122010BD037E1F2BFAD80379DD -:10876000012BF7D8C388B3F5805FF3D20389B3F543 -:10877000805FEFD2C368B3F5801FEBD20369B3F516 -:10878000801FE7D240F6FB73828A9A42E2D8C28AFF -:108790009A42DFD881784B1E012B01D90429D9D107 -:1087A000E078431E012B01D90428D3D122F094FF95 -:1087B0000028CFD094F82230013B1E2BCAD894F861 -:1087C0002330013B1E2BC5D894F82030102BC1D884 -:1087D00094F82130102BBDD8D4E90A329A42B9D38B -:1087E0000020B8E71FB528220389ADF80620ADF8B0 -:1087F0000430ADF80A30C37AC2888DF80C30037BA0 -:10880000044601A8ADF808208DF80D3023F0E0F9FA -:1088100018B91A21208921F0F5FB04B010BD000021 -:1088200070B50D4E054600F5FA700C4625F0B1FA0C -:1088300033681979102903D100222046FFF70AFB7B -:10884000336828460122197901F078F82046BDE8FE -:10885000704010F067BA00BFB03A00212DE9F74F21 -:10886000064600F5FA70894625F093FA092013F0C0 -:1088700069FB044620B3214BD3E90E57BD42B3F840 -:10888000408024D093F812A093F813B0336A019378 -:1088900024F032FA019B1844854203D8356A24F04B -:1088A0002BFA0544BBF1040F02D0BAF1040F00D13A -:1088B0009635AF420BD201221121304601F03EF82D -:1088C0004946304603B0BDE8F04F10F02ABB2023E4 -:1088D00023702B0A6570A3702D0C3B0A277184F856 -:1088E00007803F0C4FEA182821463046E570637137 -:1088F000A77184F8088013F0FBFAE1E7283A002119 -:108900002DE9F74F814F06463B690C46C1F8E4302C -:108910003B8CA1F84830D0F84832C1F8E830B0F8C4 -:108920008232C87AA1F8C8327B69CB64BB694B61DB -:10893000FB690B610FF0EAFE0546214610F085F851 -:108940002146284610F060F8EB78ABBBBB692046A7 -:10895000EB60B4F8E832AB82D6E986230FF0A2FFD1 -:10896000284612F037F820460FF0FEFFB4F84820F2 -:10897000B6F80632D01AB0F5004F0CDA40F2E247F2 -:10898000B6F8CA11521AB6F80A1292B24A43E16C0A -:1089900007FB021222662F79BFB9224631462846CC -:1089A000AF7012F02DF9A4F84A700121204603B0EF -:1089B000BDE8F04FFFF7BEBA2046D6E986230FF098 -:1089C00071FF204612F0A4F8CDE7B6F8CA21B5F839 -:1089D00074E09B1A9BB2034440F2E240B6F80A22CC -:1089E000AF6F03FB0222D6F8D031A98A00FB023315 -:1089F00000221FFA82FCBEF1000F53D101FB0CF8DC -:108A000000FB0878984502F10102F2D92846A4F843 -:108A10004AC010F09EF801280746C6D9284610F033 -:108A2000A7F801468246284610F0D4F8022F13D149 -:108A30009AF8EC32012B38D0DAF8F022DAF8143058 -:108A40001344DAF810209B1AD0E90412521A934208 -:108A500034BF00230123AB70AB78012B39D12846FA -:108A600010F086F801468146284610F0B3F800223F -:108A70008346022F1BD140F2E240D6F8D011236E7C -:108A80000B44B6F80A1200FB0133A3EB0801A8EB74 -:108A90000308DAF8F0328A1A4344C9F80821CBF8FF -:108AA000083182E70CFB0118AAE70023D3E7D9F8C5 -:108AB000083149461A442846019210F08BF859466D -:108AC0008146284610F086F8013F8346019AFFB29E -:108AD000CFE72146284610F09DF84FF000080646E3 -:108AE0000146022F07D1D4E904239B1AA3EB080304 -:108AF000C6F8F83259E7284610F08CF8D0F8F8326A -:108B0000013F01469844FFB2EBE700BF283A00213D -:108B10000B4670B5264C01F1640204F1300625467F -:108B200003CDB542106051602C4602F10802F6D127 -:108B3000286810601F4A517C1973917C022903D068 -:108B4000042914BF0121032183F8D412D17C022906 -:108B500003D0042914BF0121032183F8D512117D0C -:108B6000108E83F8D812D18AA3F8F402A3F8DA128F -:108B7000118B508EA3F8DC12D169A3F8EA02C3F876 -:108B8000E012116AC3F8E412918CA3F82C11D18C75 -:108B9000A3F8301192F8281083F8EC12D16A928E63 -:108BA000C3F8F012A3F8E822C3F8081170BD00BFA3 -:108BB000383A0021283A002138B5044615480D46B8 -:108BC000FFF7BFFD48B101221E21204600F0B6FE8E -:108BD0002846BDE838400FF0C3BC0F4BDB6ADB070B -:108BE00002D401221A21F0E729462046FFF790FF20 -:108BF0002846FFF7F7FD40F27121084B04F5FA70A3 -:108C00001B8B4B434FF47A71B3FBF1F1BDE8384055 -:108C100025F0B9B8383A002120500021DC5000215D -:108C2000034B08465B7CCB770221FFF783B900BF7B -:108C3000283A002170B5054601F164000C46FFF7A3 -:108C400080FD48B101221E21284600F077FE204613 -:108C5000BDE870400FF084BC124BDB6ADB0702D426 -:108C600001221A21F0E7104E307C0FF04FFD30B991 -:108C7000307C0FF007FD10B901224321E4E72046C4 -:108C8000FFF7B0FD40F27121084B05F5FA701B8B20 -:108C9000BDE870404B434FF47A71B3FBF1F125F01E -:108CA00072B800BF20500021283A0021DC5000217A -:108CB000F8B5054618200F4614461E4613F042F933 -:108CC000014660B307702388FF22437023881B0A84 -:108CD00083706388C37063881B0A0371A388437120 -:108CE000A3881B0A8371E388C371E38846721B0A59 -:108CF0000372B5F806328372B5F806321B0AC372E6 -:108D000000F10E031A3003F8022C03F8012C023391 -:108D10009842F8D12846BDE8F84013F0E9B8F8BD0C -:108D200038B5044609200D4613F00CF90146002819 -:108D30003FD0057094F82203B4F84823B4F84C33BC -:108D400018B1D4F83003000520D440F64800824220 -:108D500028BF0246834228BF0346B4F84603487042 -:108D6000B4F84603CA70000A120A88700A71B4F88F -:108D70004A2320464A71B4F84A23CB71120A1B0ACF -:108D80008A710B72BDE8384013F0B2B894F8550000 -:108D9000032804D1B2F5296F38BF4FF4296294F843 -:108DA00054000328D9D1B3F5296F38BF4FF4296394 -:108DB000D3E738BD70B5054602200E4613F0C2F861 -:108DC000044648B3067023F08BFF1428034617D9D6 -:108DD0001E2817D9322817D94B2817D9642817D934 -:108DE000962817D9FA288CBF0023012395F8F2039F -:108DF0002146034463702846BDE8704013F078B8FC -:108E00000723F3E70623F1E70523EFE70423EDE764 -:108E10000323EBE70223E9E770BD00002DE9F041F1 -:108E20008CB005468846144600211F2203A81F4621 -:108E30009DF860602AF071FF05238DF80A309DF8D7 -:108E40006830ADF808508DF82B30BDF86C308DF8D7 -:108E50000B608DF80C60ADF80E508DF810808DF819 -:108E60001170ADF82C3064B1238CADF81830638CE0 -:108E7000ADF81A30A38CADF81C3094F82B308DF877 -:108E80001E300DF11200DDE9122324F007FCDDE9AC -:108E900014230DF1250024F001FCDDE916230DF16A -:108EA0001F0024F0FBFB02A822F092FE8EB90A4BB1 -:108EB0009B6A5B040DD52123ADF802309DF8643028 -:108EC0006846ADF80050ADF804508DF8063022F039 -:108ED0007FFE0CB0BDE8F08120500021044B1A68E1 -:108EE00000F56573043207CA83E80700704700BFC6 -:108EF000B03A00210A4BB0F806225B8B10B59B1AE2 -:108F000047F6FE729BB29342044602D9492112F001 -:108F1000A7FA044A04F5687307CA83E8070010BD7E -:108F2000283A0021383A00211FB5154B154A1B6815 -:108F30008DF80310C31ADB1053430022CDE9012240 -:108F4000ADF80C2007229BB2ADF800308DF802205E -:108F50008DF80410ADF8063059B9B0F8A433ADF867 -:108F60000830B0F8A633ADF80A30B0F8A833ADF841 -:108F70000C30684622F02CFE05B05DF804FB00BF03 -:108F8000B43A0021BDCAE28C034B1B68D3E902232B -:108F9000C0E9F223704700BFB03A002110B5044683 -:108FA000082012F0CFFF014640B3B4F80432B4F801 -:108FB0005E04DA1DB4F8063202FB0033A4F8D033A5 -:108FC00001230B70D4F8C83320464B70D4F8C83353 -:108FD0001B0A8B70B4F8CA33CB7094F8CB330B7187 -:108FE000D4F8CC334B71B4F8D0338B71B4F8D033A0 -:108FF0001B0ACB71BDE8104012F07ABF10BD000013 -:1090000030B404460D4B00F572750FCB85E80F00A8 -:10901000B4F80622B4F8D0339B1A47F6FE729BB21E -:10902000934203D8D4F8CC33034304D1204630BC58 -:10903000492112F015BA30BC704700BF383A002100 -:1090400038B50546092012F07DFF0446B8B1AB786B -:109050000B4A002B0CBF08230E2300F8013B094BE1 -:10906000D3E90A1323F48263DB040A40DB0C24F007 -:1090700000FB21462846BDE8384012F039BF38BD14 -:109080002FCF87F72050002138B50546092012F070 -:1090900059FF0446C0B1092300F8013B0B4BB5F85A -:1090A0003013D3E90A23120C1204114323F4826310 -:1090B000074ADB040A40DB0C24F0DBFA2146284691 -:1090C000BDE8384012F014BF38BD00BF2050002169 -:1090D0002FCF87F7F8B5044641F6EF30314F324ACB -:1090E000D2E9043202EA000103EA0705C4E9CA51E1 -:1090F0002E4DD5E90A16324001261940394010405C -:10910000C4E9CC10C3F34021C3F3802384F8593061 -:10911000A37884F8226384F8581033BB94F845335D -:109120001BBB100621D5A36859031ED5082024F0C7 -:1091300011FC0146C8B11E4B1E4A1B68E31ADB1026 -:109140005343038046F6014343801B4B1B6893F84F -:10915000443006715A1FD2B2922A28BF96238371D7 -:109160004371164B187B24F006FCD4F8343304F218 -:1091700004409A0711D5D4F8183423F07F4323F024 -:10918000FF03B3F5803F08D1AB691B0405D5BDE8EB -:10919000F8404FF47A7124F0F6BDBDE8F84024F0B1 -:1091A000F8BD00BF2FCF87F7283A002120500021BB -:1091B000B43A0021BDCAE28CDC4D00216850002188 -:1091C00090F81A2303464AB9012280F81A23044A68 -:1091D00092E80300C3F81C03A3F82013704700BFF4 -:1091E000383A00211FB5114B114A1B68C31ADB1016 -:1091F00053430922ADF8022000229BB2ADF80030A3 -:10920000ADF8063090F81C338DF804208DF8083046 -:10921000B0F81E33ADF80A30B0F820336846ADF828 -:109220000C3022F0D5FC05B05DF804FBB43A002107 -:10923000BDCAE28C10B50446022012F083FE01463E -:1092400040B102230370237C43702046BDE81040E8 -:1092500012F04EBE10BD00001FB5027C0446FF2A6E -:109260002AD0184B8DF80C201B68C31A1648DB1047 -:10927000434398B20623ADF8063000238DF808303A -:10928000D4F88833ADF80400DB0744BF16238DF80B -:109290000C300E4BADF80A001B687BB1984768B1E3 -:1092A00001AB03CB1B88C4F83004A4F83834012385 -:1092B000C4F8341484F82E3404B010BD01A822F090 -:1092C00087FCF9E7B43A0021BDCAE28C783A002164 -:1092D000034B1B7C0374012380F87F33704700BF6E -:1092E000283A0021024B1B681B790374704700BFAA -:1092F000B03A00213E230374704722230374704761 -:10930000302303747047FF230374704728230374CA -:1093100070471E23037470473D2303747047000099 -:1093200030B5054D00F56B740FCD0FC495E8030003 -:1093300084E8030030BD00BF383A00212DE9FF4129 -:109340002C4D04462B8AADF804306B8AADF80630FC -:10935000AB8AADF80830EB8AADF80A300023ADF8DF -:109360000C30ADF80E308368DA0638D40DF10408FD -:10937000404611F0E3FC90BB04F56B7605F1100755 -:109380000FCF0FC697E80300A36886E803009B068B -:1093900028D42B8AB4F894239A4205D8B4F896239B -:1093A0009A4228BFA4F894336B8AB4F894239A4263 -:1093B00005D8B4F896239A4228BFA4F89633AB8A0E -:1093C000B4F89823934228BF1346B4F89A23A4F81C -:1093D0009833EB8A934238BF1346A4F89A3304B00B -:1093E000BDE8F08104F5657498E8070084E807009B -:1093F000F5E700BF283A0021044B1A6800F56573B1 -:10940000043207CA83E80700704700BFB03A002162 -:10941000B0F896330F21072B8CBF0823042300F5E7 -:109420006572FFF745BC0000034B10211A68012349 -:109430000432FFF73DBC00BFB03A002170B5B0F870 -:10944000B01388B0ADF80810B0F8B2132E4BADF8D9 -:109450000A1000211D682D4B451BED105D43B0F82F -:10946000AC23B0F8AE3304469A42ADB2ADF8042056 -:10947000ADF80630ADF80C10ADF80E100AD090F82B -:10948000B4232AB91E21284620F068FF08B070BD19 -:109490009342F7D301A811F051FC0028F2D1B4F89F -:1094A000AC33B4F80A22B4F8AE639342B4F8B00314 -:1094B000B4F8B2130BD19E4209D1B4F8042282420F -:1094C00005D10A224A43B4F88242A24216D01022A1 -:1094D000ADF81A000DEB0200ADF81050ADF81220F7 -:1094E000ADF81450ADF81630ADF81860ADF81C109A -:1094F00022F06EFB0028C9D11A21C4E7284601A931 -:1095000020F0F6FEC2E700BFB43A0021BDCAE28CEB -:10951000084B10B51B6800F246319A88DB88A0F82A -:109520004A23A0F84C33044612F0FBFBA4F85E0378 -:1095300010BD00BFB03A00211421FFF7F1BB152187 -:10954000FFF7EEBB1FB5134B134A1B688DF80310D2 -:10955000C31ADB10534312229BB2ADF80030ADF8B2 -:109560000430B0F852338DF80220ADF80630B0F870 -:109570005433ADF80830B0F84E33ADF80A30B0F8D7 -:1095800050336846ADF80C3022F022FB05B05DF890 -:1095900004FB00BFB43A0021BDCAE28C2DE9F843B8 -:1095A0003A4B0446998A1A296ED9188A1A286BD917 -:1095B000DA8AB2F5A47F67D35B8AB3F5A47F63D35D -:1095C00094F82293B4F84E73B4F85053B4F852C3DD -:1095D000B4F85463B4F848E3B4F84C83B9F1000F1D -:1095E00004D0D4F8309319F4006F07D140F648093D -:1095F000CE4528BFCE46C84528BFC846B4F84A93D2 -:10960000484528BF4846B4F84693A4F85203494554 -:1096100028BF4946434528BF4346724528BF724686 -:1096200094F855E0A4F84E13BEF1030FA4F8543398 -:10963000A4F8502306D1B2F5296F38BF4FF4296240 -:10964000A4F8502394F85420032A06D1B3F5296FC7 -:1096500038BF4FF42963A4F85433604509D1B942A7 -:1096600007D1B4F85433B34203D1B4F85033AB420A -:1096700003D000212046FFF765FF204604F24E315B -:1096800012F04FFBA4F86003BDE8F883283A0021EC -:1096900010B50446032012F055FC014658B11923B9 -:1096A00003700B4B1A68127942701B685B798370E8 -:1096B000204612F01DFCD4F88833204623F0200306 -:1096C000C4F888336E21BDE8104011F0C9BE00BF58 -:1096D000B03A0021094B1A7C5B7CD10748BF80F867 -:1096E0006633910748BF80F8673352074FF06E0129 -:1096F00048BF80F8683311F0B3BE00BF283A00219C -:10970000F8B504460B2012F01DFC0146E8B10546F1 -:1097100029230020134E05F8013B32680244937957 -:1097200057791B0143EA87031779D2793B43043009 -:1097300043EA8213242805F8013BEED13368204622 -:1097400093F828308B7212F0D3FBD4F8883320467C -:1097500023F40073C4F888336E21BDE8F84011F09B -:109760007FBE00BFB03A002138B5837804462BB1E4 -:109770002046BDE838406E2111F072BE90F84533A6 -:10978000002BF5D026F038F9D4F8F01123F0BAFA0E -:10979000D4F8F43198421ED323460F4904F1240033 -:1097A00011F8012B043302F0030583F8C55102F0D0 -:1097B0000C0583F8C65102F0300522F03F0283F811 -:1097C000C75183F8C8218342EAD1044B5B7E03F082 -:1097D000030384F8ED3138BD383A0021283A0021DE -:1097E00038B58378044653B16E21D0F8883323F41A -:1097F0008073C0F88833BDE8384011F031BE0420D2 -:1098000012F0A0FB144D014668B1282303702B68A9 -:109810001B7943702B685B7983702B689B79C370CD -:10982000204612F065FB2B681A7984F845235B7992 -:109830000A4A5343C4F8F43126F0DEF8D4F8F43180 -:109840006E21C01AD4F88833C4F8F00123F4807371 -:109850002046C4F88833CEE7B03A0021400D03001B -:1098600070470000024B1B681B7980F8F03370478B -:10987000B03A002190F8F03323B1012B0CD01D2118 -:10988000FFF798BA084B90F9F22393F940309A42C7 -:10989000F5DA80F8F233F2E7034B90F9F22393F90B -:1098A00040309A42EBDDF4E7205000211E21FFF703 -:1098B00081BA000010B50446054B187CA37884F8E3 -:1098C0003803012B03D112F06DFFA4F8C80110BDBD -:1098D000283A00211FB50D4B0D4A1B688DF8081062 -:1098E000C31ADB1053432E229BB2ADF80430ADF8FF -:1098F0000A3090F8383301A8ADF806208DF80C3006 -:1099000022F066F905B05DF804FB00BFB43A00210F -:10991000BDCAE28C10B50446022012F013FB0146CA -:1099200048B107230370044B1B7A43702046BDE8FF -:10993000104012F0DDBA10BD283A002138B50446B7 -:109940000D4602BBD0F8302302F00403520704D5C1 -:1099500090F82233003B18BF012394F85224012AC7 -:1099600008BF44258BB1032012F0ECFA0146A8B1E0 -:10997000112303700A4B1B7A857043702046BDE8A3 -:10998000384012F0B5BA0123E7E7022012F0DAFA04 -:10999000014618B10D2345700370EFE738BD00BFD5 -:1099A000283A002110B590F819330446FBB9012379 -:1099B00080F81933062012F0C5FA0146E8B10C23ED -:1099C00003700E4B1A68127942701A6812888270FE -:1099D0001A681288120AC2701B685A8802715B8862 -:1099E0001B0A43712046BDE8104012F081BA0022E4 -:1099F000BDE810402421FFF7A1BF10BDDC4D0021C0 -:109A000010B583780446012B0AD0BDE81040D0F889 -:109A100088336E2123F48073C0F8883311F020BDA1 -:109A2000144A117C01290BD8537C042B08D9927C51 -:109A3000501FC0B2912803D8962B01D8934206D963 -:109A40002046BDE8104001221E21FFF777BF0A48DB -:109A500084F8451343434243C4F8E831C4F8EC2189 -:109A600019B125F0C9FFC4F8F00125F0C5FFC4F80D -:109A7000E40110BD283A0021400D0300C2680346EE -:109A800091000CD5D3F8882300F57870D20703D560 -:109A9000B3F8821224F077B9282124F06BB970470B -:109AA000C3689B0003D500F5787024F072B9704745 -:109AB000702111F0D5BC012380F898327047000066 -:109AC0000023F0B500F51977044685B080F8983288 -:109AD000384624F0FFF878B9204612F036F90646E9 -:109AE00038460DF1070123F055FF054630B9094B03 -:109AF0000421187B23F0DAFF05B0F0BD294602A847 -:109B000016F079FE2B463146204602AA12F052F991 -:109B1000E6E700BF6850002110B5044600F51B7051 -:109B200024F0D8F828B12046BDE810403E2111F0BD -:109B300097BC10BD012380F897327047002380F84E -:109B400097327047024B1B6803B11847704700BF3C -:109B5000AC3A0021024B1B6803B11847704700BFA5 -:109B6000983A0021024B1B6803B11847704700BFA9 -:109B70008C3A0021D0F88823110506D522F4006222 -:109B8000017CC0F88823FFF7CFB97047B0F898334D -:109B90002DE9F043A0F8A6330126B0F89A33B0F8C7 -:109BA0009473A0F8A83340F2E243B0F89683B0F87B -:109BB0006093044680F8A06390F8B40385B05843DE -:109BC0005F4303FB08F822F0ABFD114A034615681A -:109BD0001048651BED10684303AACDE90092394691 -:109BE0004246C0B222F0F6FD30B97221204611F093 -:109BF00037FC05B0BDE8F083039B074A84F8C861D1 -:109C0000A3FB0232DB0F43EA4203A4F8A433F0E7DC -:109C1000B43A0021BDCAE28CE3361A00143023F0B6 -:109C200003BC00002DE9F04F87B004460E46904675 -:109C30001F4611F01BF9054670B909253146284623 -:109C400042463B4609F08BFB0221204613F006FCFE -:109C5000284607B0BDE8F08F40F2E242DFF8F8B0E6 -:109C6000DFF8F8C0DBF80000DFF8F4A0281AC01015 -:109C7000CDF808C00AFB00F00DF1140CCDF804C0BB -:109C8000A18BE38BB5F860C35343CDF800C04A43C2 -:109C9000C0B2002122F050FD20B9284611F0E6F9AB -:109CA0000D25CBE7059B2F49DBF80020A3FB0131F5 -:109CB000DB0F43EA4103A4F8623000236370A37012 -:109CC000A4F800319DF84030AD1A84F86A309DF850 -:109CD0004430ED1084F86B304FF495630AFB05F5C2 -:109CE000A4F86050ADB203FB0525FF2385F8A0342E -:109CF0004FF6FF730120A5F8A234C5E9C48785F8A3 -:109D0000186304F11C0922F049FF42463B464946CC -:109D10002046009613F026F9054618B1012022F0DE -:109D200053FF8BE742463B4649462046009613F0D8 -:109D30009BFA05460028F1D194F86A3003F0FD0340 -:109D4000012B01D121F0C4FF074A137901331371AC -:109D500021F0AEFF7CE700BFB43A0021C1B701019A -:109D6000BDCAE28CE3361A002050002110B504462B -:109D7000012022F029FF94F86A3003F0FD03012B43 -:109D800001D121F0ADFFD4F8D00120B123F0EAFDDC -:109D90000023C4F8D031044A1379013B1371BDE8A4 -:109DA000104021F08DBF00BF20500021F8B50446BF -:109DB000682023F0CFFD0546002858D04FF4956267 -:109DC0000021B4F8603000F1080653433D4A04F125 -:109DD000280712681A4491703B4ADB1053430380F2 -:109DE00043F6017343800FCF0FC60FCF0FC697E81E -:109DF0000F0086E80F0094F86830012B42D1D4E9B7 -:109E0000886394F82B2294F82A128A4205D1D4E967 -:109E10008670834208BFBE4232D042F002078A42B7 -:109E200005D1D4E986129A4208BFB14247D0D4E99D -:109E3000860185F83C70C5E91263D4E91623C5E9AB -:109E4000162394F86930C5E9140185F83D3094F87B -:109E50006C30294685F83E30FF2385F860304FF698 -:109E6000FF73A5F86230194B187B23F084FD204660 -:109E7000FFF77CFF0123227C9340154A5372F8BD03 -:109E80001746CCE794F8C32394F8C213D4E9EE63E1 -:109E90008A4205D1D4E9EC70834208BFBE420CD09F -:109EA00042F002078A4205D1D4E9EC129A4208BF77 -:109EB000B14204D0D4E9EC01BBE71746F2E7002039 -:109EC0000021B6E7B43A0021BDCAE28C68500021F7 -:109ED000303D00212DE9F74F4FF4856BB0F86EA3AC -:109EE000DFF8809206460BFB0A9B9BF82134002B7F -:109EF00014BF2B20232012F025F80446002800F080 -:109F00002E81B6F804829BF8213408F10708012B52 -:109F1000BBF8FC71DBF8F8511FFA88F810D1DBF8B8 -:109F20002434987C43060BD0DBF8E43101372B4412 -:109F30009BF8F952BFB2454340F2E24000FB1535B1 -:109F4000B6F806123046414489B211F04FFCB6F81B -:109F5000603383460344019322F0CEFE019B2946E1 -:109F600003441846019322F0CDFE019B002800F027 -:109F7000D2801846294622F0C5FE4FF4856303FBC4 -:109F80000A93D3F8E421B0FBF2F301339BB202FB56 -:109F900003501F44594622F0B5FE734BBFB298429E -:109FA00000F2CA80714BA0FB0303C3F34F000023F0 -:109FB00019464FF4856505FB0A9595F821249B0306 -:109FC000002A14BF2A221C222270B6F86C2343EA0E -:109FD00041336270B6F86C230343120A1B12E0701F -:109FE0002371A270D5F8E421614BA2FB0321D20FAB -:109FF00042EA41026271D5F8E421A2FB0323C3F3D4 -:10A00000D713A37195F8E811D5E9E43242EA411279 -:10A01000190AE3712172190C1B0E6172E272A372AC -:10A020006B6E23736B6E1B0A6373B5F86630A37394 -:10A0300095F86730E373AB6E2374AB6E1B0A6374E1 -:10A04000B5F86A30E7743F0AA3742775B6F806328C -:10A0500043446375B6F8063298444FEA282884F8DA -:10A060001680B5F8FC31E375B5F8FC311B0A237690 -:10A0700095F8DA3395F8D87347EA031711F066FBC1 -:10A080007FB247EA4017677695F8203404F11B0049 -:10A09000022B03D0032B14BF012304234FF4856547 -:10A0A00005FB0A95A376D5E9FA2323F0F7FAB6F86B -:10A0B000063284F82130B6F806321B0A84F82230C2 -:10A0C00095F8213403B3D5F8F43284F82330D5F869 -:10A0D000F4321B0A84F82430B5F8F63284F82530BF -:10A0E00095F8F73284F8263095F8F83284F827305E -:10A0F00095F8F93284F8283095F8FA3284F8293046 -:10A1000095F8FB3284F82A302146304603B0BDE88A -:10A11000F04F11F0EDBE1946284622F0F3FD4FF442 -:10A12000856303FB0A93D3F8E421B0FBF2F398B202 -:10A1300002FB1050FF1A2DE7B0F5161F0D4A28BF7D -:10A14000A0F51610A0FB02124FF0030101FB002046 -:10A150002CBF012300230121C0F38F2029E703B086 -:10A16000BDE8F08FD01D0021C3BF030012111111F3 -:10A17000E3361A009E36D0692DE9F84F064690F86E -:10A180006E030AF04BFF90F8DD3B0546002B14BF31 -:10A190002B20232011F0D6FE0446002800F0348145 -:10A1A000B6F8048295F8DD3B08F10708012BB5F8F5 -:10A1B00090A1D5F89C711FFA88F80ED195F8B733A5 -:10A1C00059060AD0D5F850030AF1010A3844D5F8E7 -:10A1D000B0731FFA8AFA07FB1307B6F80612304667 -:10A1E000414489B211F002FBB6F860B38146834462 -:10A1F00022F082FD83443946584622F083FD002830 -:10A2000000F0DF803946584622F07CFDD5F8502317 -:10A21000B0FBF2F301339BB202FB03700AEB0307BE -:10A22000494622F06FFD794BBFB2984200F2D780C9 -:10A23000774BA0FB0303C3F34F000023194695F8A7 -:10A24000DD2B9B03002A14BF2A221C222270B6F8A1 -:10A250006C2343EA41336270B6F86C230343120A5D -:10A260001B122371A270E070D5F85023694BA2FB3A -:10A270000321D20F42EA41026271D5F85023A2FBBA -:10A280000323C3F3D713A371D5E9DA9A11F05EFA69 -:10A290004FEA192384F8079023724AEA401A4FEADA -:10A2A00019434FEA1969637284F80A9084F80BA085 -:10A2B000D5F8CC312373D5F8CC311B0A6373B5F8CC -:10A2C000CE31A37395F8CF31E373D5F8D031237431 -:10A2D000D5F8D0311B0A6374B5F8D231E7743F0A60 -:10A2E000A3742775B6F8063243446375B6F8063290 -:10A2F00098444FEA282884F81680B5F89031E37521 -:10A30000B5F890311B0A237695F83930DA0702D573 -:10A310002F79012F09D0022B74D16F693F0A07F002 -:10A32000C007A7F140035F425F4195F9428011F0F9 -:10A330000DFA400140EA071748EA0707677695F8E3 -:10A34000D43104F11B00022B03D0032B14BF0123D3 -:10A350000423A376D5E9042323F0A0F9B6F8063246 -:10A3600084F82130B6F806321B0A84F8223095F8BA -:10A37000DD3B03B3D5F8A83384F82330D5F8A833F0 -:10A380001B0A84F82430B5F8AA3384F8253095F8F0 -:10A39000AB3384F8263095F8AC3384F8273095F841 -:10A3A000AD3384F8283095F8B43384F8293095F823 -:10A3B000B53384F82A3021463046BDE8F84F11F015 -:10A3C00097BD3846594622F09DFCD5F85023B0FB86 -:10A3D000F2F398B202FB1070AAEB030720E7B0F586 -:10A3E000161F0D4A28BFA0F51610A0FB02124FF051 -:10A3F000030101FB00202CBF012300230121C0F336 -:10A400008F201CE7002790E7BDE8F88FC3BF03004B -:10A4100012111111E3361A009E36D069054B1B68E4 -:10A420009A8880F86A231A89DB88A0F86C23A0F840 -:10A430006E337047B03A002190F869235AB901226F -:10A4400080F86923D0F888236E2122F04002C0F8FA -:10A45000882311F005B8704770B5534C0546D4E910 -:10A460000C2394F8291094F8280009F015FE002810 -:10A4700040F0998095F87033002B00F08D804B4BA5 -:10A480009A6AD0054CBF03230123110594F82B20B1 -:10A4900048BF43F0040332EA03037DD1531E012B6E -:10A4A00001D9042A78D194F840308BB10F2B73D89E -:10A4B00094F8411005296FD994F84220531EDBB25D -:10A4C000FD2B69D8914267D994F84330012B63D9A9 -:10A4D000402023F03FFA0146002857D04FF48673FE -:10A4E0004380238A821D8380314B03F1100053F88F -:10A4F000046B834242F8046BF9D11B8813802D4B07 -:10A500002D4A1B68EB1ADB1053430B83A38C4B8340 -:10A51000B5F806328B83E38CCB8394F8283081F82E -:10A52000203094F8293081F8213094F82A3081F8CD -:10A53000223094F82B30022B03D0042B14BF0123BC -:10A54000032381F82330D4E90C23C1E90A23238FA4 -:10A550000B86E36B4B6394F8403081F8383094F805 -:10A56000413081F8393094F8423081F83A3094F82B -:10A57000433081F83B30237AA3F12A0253425341FE -:10A5800081F832300D4B187B23F0F5F92846BDE8F1 -:10A5900070406E2110F064BF237A2A2BF6D1284632 -:10A5A000FFF7B8F9F2E770BD283A002120500021EA -:10A5B0003A3A0021B43A0021BDCAE28C6850002129 -:10A5C00090F80A3363B190F80933B0F80823012BEF -:10A5D00014BF002300F20623A0F8A620C0F8A8307C -:10A5E000002380F80A33012380F8A4307047002349 -:10A5F00080F8A430704790F80A3363B190F80933BB -:10A60000B0F80823012B14BF002300F20623A0F8A2 -:10A61000A620C0F8A830002380F80A33012380F870 -:10A62000A5307047002380F8A530704710B5044668 -:10A63000114B03F1100203CA1A8BC4F8C102A4F82B -:10A64000CA22D3F81A20C4F8C512C4F8A922D3F834 -:10A650001E20D3F8223004F2BD200421C4F8AD221C -:10A66000C4F8B93225F0E8F804F2B1200821BDE8B9 -:10A67000104025F0E1B800BF283A0021064B00F257 -:10A6800099201B681A1D143352F8041B9A4240F893 -:10A69000041BF9D1704700BFB03A002106230374B0 -:10A6A0007047000070B5044600F18C0500F2A92245 -:10A6B000294600F2992025F003F8D4F8B932A2789F -:10A6C000C4F89C30D4F8BD32B2FA82F2C4F8A0309B -:10A6D00000230020002184F8B5300B4B52091B6881 -:10A6E000C4E9B401C4E9B60184F8B42053B1074900 -:10A6F00028460968611A064CC9106143BDE87040DC -:10A70000C9B2184770BD00BF743A0021B43A0021A5 -:10A71000BDCAE28C482110F0A3BE10B504460D203E -:10A7200011F010FC014698B10346042203F8012BF6 -:10A73000D4F8B122C0F80120D4F8B5225A60D4F878 -:10A74000BD32C0F809302046BDE8104011F0D0BB42 -:10A7500010BD10B50446012011F0F4FB014630B1E4 -:10A76000052303702046BDE8104011F0C1BB10BDA9 -:10A7700010B50446012011F0E5FB014630B1062377 -:10A7800003702046BDE8104011F0B2BB10BD10B5FB -:10A790000446012011F0D6FB014630B10A230370B4 -:10A7A0002046BDE8104011F0A3BB10BD10B5044613 -:10A7B000012011F0C7FB014630B10B230370204686 -:10A7C000BDE8104011F094BB10BD10B50446012047 -:10A7D00011F0B8FB014630B1122303702046BDE8EA -:10A7E000104011F085BB10BD10B50446012011F0DA -:10A7F000A9FB014630B1132303702046BDE8104089 -:10A8000011F076BB10BD00001FB5104B104A1B683D -:10A81000C31ADB1053430D229BB2ADF80030ADF8E4 -:10A820000430B0F8CA32ADF80220ADF80E30D0F8DE -:10A83000C132CDF80630D0F8C5326846CDF80A30BE -:10A8400021F0C6F905B05DF804FB00BFB43A002161 -:10A85000BDCAE28C1FB5104B104A1B688DF807105B -:10A86000C31ADB1053430022CDF809208DF80D20C8 -:10A870000B229BB2ADF80430ADF80A3090F8A53049 -:10A8800001A88DF806208DF808108DF80C3021F005 -:10A890009FF905B05DF804FBB43A0021BDCAE28C13 -:10A8A00007B50C22ADF802200022094B8DF80420D8 -:10A8B0001B68C31A0748DB10434368469BB2ADF8D8 -:10A8C0000030ADF8063021F083F903B05DF804FBE9 -:10A8D000B43A0021BDCAE28C07B51122094BADF88C -:10A8E00002201B68C31A0848DB10434368469BB22A -:10A8F000ADF80030ADF8043021F06AF903B05DF82E -:10A9000004FB00BFB43A0021BDCAE28CD0F8F412B7 -:10A9100000F53E7023F037BA38B5124B04461B6879 -:10A9200000F2992103F10E0203F11E0052F8045BBC -:10A93000824241F8045BF9D15A6804F2B920C4F8A4 -:10A94000C1229A680421C4F8C5229B89A4F8CA329E -:10A9500024F072FF04F2A9200821BDE8384024F059 -:10A960006BBF00BFB03A0021034610B5054C04F19F -:10A97000100203CAA269C3F8B102C3F8B512C3F842 -:10A98000BD2210BD283A002110B50446172011F051 -:10A99000D9FA014610B30346032203F8012BD4F879 -:10A9A000C122C0F80120D4F8C5225A60B4F8CA32D6 -:10A9B0004372B4F8CA321B0A8372D4F8A932C0F8C1 -:10A9C0000B30D4F8AD32C0F80F30D4F8B932C0F83B -:10A9D00013302046BDE8104011F08ABA10BD0000C7 -:10A9E0002DE9F041464B86B01C6810F03FFA054651 -:10A9F000A8B9D4E90623092094F8201008F0AFFC88 -:10AA0000042022F0A7FF014630B140F20333438017 -:10AA10003C4B187B22F0AFFF06B0BDE8F08140F25E -:10AA2000E242DFF8E480394ED8F80000384F281AA7 -:10AA3000C010A188E3887843029605AE0196B5F868 -:10AA40006063534300964A43C0B2002121F074FE74 -:10AA500040B9284610F00AFBD4E906230D2094F8EB -:10AA60002010CBE7D8F800302A4EEB1ADB107B43DE -:10AA7000D4E904010127A6F88030274A059BDFF8B6 -:10AA80009C80A3FB0232DB0F43EA4203A6F882302C -:10AA900006F13C0383E80300012022F07FF821F057 -:10AAA00007F996F8423088F8047003F0FD03BB42C2 -:10AAB00001D121F00DF986F85872A6F85672D4E942 -:10AAC000062394F82010201D12F024F900222846B5 -:10AAD000134911F039FCD4E90623C5E9C42394F8DD -:10AAE000203085F81833FF2385F8A0344FF6FF7324 -:10AAF000A5F8A23412F0ECF988F805708CE700BFD5 -:10AB0000540D002168500021B43A0021C1B7010161 -:10AB1000BDCAE28CD03A0021E3361A002050002151 -:10AB2000183B0021054B1B7933B10123044880F801 -:10AB300099309C3022F04CBC704700BF205000215F -:10AB4000D03A0021F8B53C4B1B79002B70D068201F -:10AB500022F000FF0546002862D04FF495620021E4 -:10AB6000364C00F10806B4F8803004F1480753432E -:10AB7000334A12681A449170324ADB1053430380FF -:10AB800043F6017343800FCF0FC60FCF0FC697E870 -:10AB90000F0086E80F0094F8C33185F83C3094F834 -:10ABA000C2219A4207D1D4E96E61D4E96C02914284 -:10ABB00008BF864203D043F0020385F83C30D4E955 -:10ABC0006E23C5E9122300220023C5E9142394F85B -:10ABD000C32194F8C2319A4207D1D4E96E02D4E974 -:10ABE0006C139A4208BF884203D0D4E96C23C5E9AC -:10ABF0001423D4E91E23C5E9162394F88530294689 -:10AC000085F83D30012385F83E30FF2385F860301C -:10AC10004FF6FF73A5F862300B4B187B22F0ABFEAA -:10AC2000012021F0D1FFBDE8F8400448FBF7F4BD56 -:10AC3000BDE8F840FFF776BF20500021D03A002150 -:10AC4000B43A0021BDCAE28C6850002113B54FF41C -:10AC50009560124C124BB4F880201B684D2100FB0C -:10AC6000023010F0FDFB012021F0AEFF2046FBF783 -:10AC7000D3FD00230093ADF80430082368468DF817 -:10AC8000023020F0A5FFD4E95823D4F85411022053 -:10AC9000C1F3C00108F063FB02B010BDD03A00213F -:10ACA000B43A00214FF4956010B5094B094C1B686C -:10ACB000B4F880204C2100FB023010F0D1FB0120C1 -:10ACC00021F082FF2046BDE81040FBF7A5BD00BF84 -:10ACD000B43A0021D03A0021044B0C201968D1E984 -:10ACE000062391F8201008F03ABB00BF540D002154 -:10ACF000002307B5ADF8003040F60843ADF8023048 -:10AD00000C236846ADF8043020F062FF03B05DF814 -:10AD100004FB0123837090F800311BB900F58270A9 -:10AD200022F056BB00F52E70FAE70000F7B5064694 -:10AD300000241A4D1A4FAB7A2341DA0713D56B7AE8 -:10AD40002341DB070FD44FF49562164B53F82430A0 -:10AD5000B3F8603053433A68D018D35C012B02D16A -:10AD60004D2110F07DFB0134032CE4D13046FEF779 -:10AD7000FDFF3378032B0FD000230093ADF8043090 -:10AD8000082368468DF8023020F022FFD5E9002321 -:10AD90000220297A08F0E3FA03B0F0BD303D00212B -:10ADA000B43A0021D04E0301044B0C201968D1E9BC -:10ADB000062391F8201008F0D2BA00BF540D0021EC -:10ADC000002307B5ADF8003040F60843ADF8023077 -:10ADD0000C236846ADF8043020F0FAFE03B05DF8AD -:10ADE00004FB0000074B1B681A7980F862235A792C -:10ADF00080F863239A7980F864231B8980F85730A0 -:10AE0000704700BFB03A0021024B1B8AA0F8D8332C -:10AE1000704700BF283A002170B51D4C054694F9D3 -:10AE20001030267C002B04DB94F91130627C002B5F -:10AE300002DA4A21284602E0238A23B96E21BDE8BE -:10AE4000704010F00DBBB0F80612638A5B1A47F62B -:10AE5000FE719BB28B4201D94921F0E7022E04D941 -:10AE6000042EE6D1022A02D804E0022A01D9042ADB -:10AE7000DFD11EB108F0F8F80642DAD0667C1EB1C8 -:10AE800008F0F2F80642D4D02069C5F8DA0370BDA4 -:10AE9000283A002170B580F8D81380F8D9230446E9 -:10AEA00003200E46154611F04DF8014640B1162319 -:10AEB0004670037085702046BDE8704011F018B8E8 -:10AEC00070BD70B5044603200E46154611F03AF8E1 -:10AED000014640B117234670037085702046BDE8D7 -:10AEE000704011F005B870BD2DE9F047044605200B -:10AEF0000F46164611F026F80546002853D004F5F3 -:10AF00001B7A504684F8DA7384F8DB6322F0D3FEB0 -:10AF1000DFF89890D9F80030B3F8268000FB08F8E5 -:10AF2000204610F012FF0146404620F04CFE062855 -:10AF300030D9504622F0BFFED9F80030B3F8268051 -:10AF400000FB08F8204610F000FF0146404620F0C4 -:10AF50003AFEB4F8043257EA06021844B4F85E34F4 -:10AF600000FB03F39BB217D0B4F806221344A4F8F5 -:10AF7000DC3318236F702B70AE70B4F8DC332946C5 -:10AF8000EB70B4F8DC3320461B0A2B71BDE8F047A8 -:10AF900010F0AEBF0720DCE76E212046A4F8DC23CA -:10AFA00010F05EFAE5E7BDE8F08700BFDC4D002158 -:10AFB0001FB50F4B0F4A1B688DF80710C31ADB1023 -:10AFC000534300228DF8092016229BB2ADF80430BD -:10AFD000ADF80A30B0F8543001A88DF806208DF88D -:10AFE0000810ADF80C3020F0F3FD05B05DF804FB5F -:10AFF000B43A0021BDCAE28CF8B5446A0546B4F8FB -:10B0000098209AB1042022F0A5FC014600284ED0D9 -:10B01000304B9C420CBF40F2023340F2033343807A -:10B020002D4B187BBDE8F84022F0A5BC2B4E337C9D -:10B030007BB194F84130D9070BD59B07327404D407 -:10B04000D6E90823A01C22F029FBD6E90823C4E98D -:10B050005623A36BE28FAB60A38F934213D040F2D1 -:10B0600071235A43D4F8A811EB680B4493420AD2D7 -:10B07000284622F09BF830B1A16BA86821F042FE6F -:10B08000C4F8A80113E0002394F89B1194F8D100B0 -:10B09000C4F8A83108F054F9A68FE28F84F8D100E3 -:10B0A000964205D1284621F067FFAB68A363F8BD3F -:10B0B00040F271277E4307FB0267AB683A46334490 -:10B0C00031462846A36322F071F80028D4D1A36B3F -:10B0D000AB60F2E7580D002168500021205000219C -:10B0E0007FB5C46AD4F89C00002846D094F8F030AC -:10B0F0000BB1062B45D194F8F40000283DD0D4E9DB -:10B100003823224822F0CAFA214D94F8F23085F80B -:10B110005332D4E93823C5E9242395F841309A07FE -:10B1200017D5D4E92223CDE9022302ABD4F88460F9 -:10B1300094F8F3000093D4E93A23FAF7B4FFF0B996 -:10B14000C6F340061348DDE9022322F0A7FA85F88A -:10B1500052621149A1F5147014F01AFB0F4BDB6910 -:10B160005B0110D595F8583213B1013B85F8583280 -:10B1700095F85802B0FA80F0400904B070BD01267D -:10B18000E0E70020F9E70120F7E700BF600D0021AC -:10B19000580D00215A0D0021A80F00212050002138 -:10B1A00070B5C46A94F8F030022B01D9062B53D144 -:10B1B0002E4B2F4A1B68527A9B7B9A424CD294F8B2 -:10B1C000CA0022F0C7FB0546002845D0D4F89830C5 -:10B1D00094F8CC2083F8272094F8F32094F8F230E8 -:10B1E0009A423AD1D4E93A31D4E93802914208BFBF -:10B1F000834214BF01230023D4F898201D4E82F807 -:10B200002830D4F89830D4F8D02083F82920D4F806 -:10B21000D030D4F898201B0A82F82A30D4F898301D -:10B22000B4F8D22083F82B2094F8D320D4F89830A7 -:10B2300083F82C2094F8F510D4F8982079B10021E7 -:10B240000D4822F092FB4FF48071307B22F02EFCEF -:10B2500008F0BEF9C4F8985070BD0123CCE7074848 -:10B2600022F083FB4FF40071EFE700BFDC4D0021BB -:10B27000F850002168500021800D0021880D002128 -:10B28000C36AD3F8A000003818BF0120704700003F -:10B2900070B54D4D00297DD0C46A94F8F030042B70 -:10B2A00058D1D5E92402D4E938139A4208BF88421C -:10B2B00050D1464B464A1B68527A9B7B9A4249D2F0 -:10B2C0002D2022F047FB0646002843D0D4F8A030BA -:10B2D00094F8CC2083F827200023D4E93A1294F87C -:10B2E000F2009A4208BF814207D0D4E93830904238 -:10B2F00008BF8B4214BF01230023D4F8A0200021F3 -:10B3000082F82830D4F89830D4F8D020314883F827 -:10B310002920D4F8D030D4F898201B0A82F82A309B -:10B32000D4F89830B4F8D22083F82B20D4F8983091 -:10B3300094F8D32083F82C20D4F8A02022F015FB19 -:10B34000254B4FF48071187B22F0B0FB08F040F9D8 -:10B35000C4F8A06095F859320133DBB2012B85F8AF -:10B36000593209D9B5F856325B0808BF0123A5F850 -:10B370005632002385F85932002385F85A3220F0DE -:10B38000F4FBB5F85632013B03400133002085F849 -:10B39000583270BD95F85A320133DBB2012B85F873 -:10B3A0005A320DD9B5F856325B009BB2B3F5807FA7 -:10B3B00088BF4FF48073A5F85632002385F85A32BF -:10B3C000002385F85932DAE7580D0021DC4D0021C1 -:10B3D000F8500021800D002168500021C37CF0B599 -:10B3E0001370847C9C4207D1D0E90275D0E90064D7 -:10B3F000A54208BFB74202D043F002031370D0E960 -:10B400000223C1E90023F0BD90F86A3010B5013382 -:10B41000DBB2012B044680F86A300DD9B0F86630F3 -:10B420005B009BB2B3F5807F88BF4FF48073A0F8B8 -:10B430006630002380F86A30002384F8693020F0F9 -:10B4400094FBB4F86630013B0340013384F8683064 -:10B4500010BD00002DE9F84F044690F80EA4D0F876 -:10B4600010344C4FDFF83081DFF83091BAF1000F23 -:10B4700001D1BDE8F88F1D465A7815F8026B2C2AC9 -:10B480001BD0322A7BD0282A11D194F8203284F89C -:10B49000226284F8212253B96378012B07D129460F -:10B4A00084F8203204F5087014F0A0F80544F6433F -:10B4B00056442B465FFA86FAD8E794F88832002B78 -:10B4C000F5D16378012BF2D13246294604F522707A -:10B4D00014F0A8F8BB690544180294F8963248BFE6 -:10B4E000022203F1FF3358BF04221E2B43D8D4F8A5 -:10B4F000B032A3F5807343453DD8B4F894329342FB -:10B5000039D3B3F5486F36D894F89732013B1E2BE8 -:10B5100031D8B4F8B432B3F5805F2CD2B4F8AA3283 -:10B52000013B9BB2FA2B26D894F8C032032B22D8C9 -:10B53000D9F82020D10501D4022B1CD0120501D44A -:10B54000032B18D094F8D032012B14D894F89832E9 -:10B55000013B062B0FD894F8A832013B0E2B0AD8DA -:10B5600094F8A0320F2B06D842F6014384F88A6281 -:10B57000A4F888329BE7002384F8883297E7084BC9 -:10B58000D3F800B0BBF1000F91D02B4631462046D6 -:10B59000D8478CE720500021FFFE0F0068500021A3 -:10B5A000D8070021F8B583780446002B0CBF1E2372 -:10B5B0004FF4967385880F465D43164621F090FB45 -:10B5C0006378012BA3780CBF32214FF4FA71002B62 -:10B5D0000CBF1E234FF496730144581907F084FCE6 -:10B5E0002D1A3D60A378002B0CBF1E234FF49673D9 -:10B5F00003EB40003060F8BD2DE9F0414368057C65 -:10B600000446022DC0F80C31D0F8307118BF002567 -:10B6100000F5827621F070FBE37800F2CC4007F170 -:10B620009808C4F81001DBB90323294A11780135C1 -:10B63000EDB2032D08BF002541FA05F0C0071FD564 -:10B64000244B557053F82540D4F8307104F58276B8 -:10B6500007F1980898F83310787807F071FE787041 -:10B66000002120896389C8F8401083420DD13046FB -:10B6700021F082FCB36863600023E370BDE8F081D1 -:10B68000013B13F0FF03D2D1E4E7114FBA782A410E -:10B69000D3070AD4304621F06FFCB36863600123FE -:10B6A000AB40BD781D43BD70E6E740F27122B36840 -:10B6B00002FB00334FF00042B3603046636021F07C -:10B6C00075FDB36862689B1AC8F84030D4E700BFC4 -:10B6D000B80F00218C4E0301084BDB695B010BD5D1 -:10B6E00090F8683013B1013B80F8683090F868003A -:10B6F000B0FA80F0400970470120704720500021C7 -:10B700002DE9F3411E46DDE908451B0A03F0C0039D -:10B71000402B0746904626D1DDE90A23CDE90023D8 -:10B720009DF830204046314602F0FD02FAF756FD02 -:10B7300090B17B7B03F0FD03012B07D103232B701A -:10B740000B4BD3E90823C4E9002309E002232B7043 -:10B75000084BD3E90C23F6E7FE232B70C4E90086DF -:10B7600002B0BDE8F081437B012BE8D00023EEE777 -:10B7700020500021685000212DE9F04F0D4690F82F -:10B780003C108DB08346DDE9166792469DF86090C7 -:10B790001B9C21B1002108460DB0BDE8F08F24228A -:10B7A0002046079128F0B9FA9DF96430A5806374AA -:10B7B000FF23E3737F232374724B0799DB6A03F43F -:10B7C00000789BF81030002B65D0022B66D09AF8D9 -:10B7D0000030DA1F012A73D89BF8A230DB0768D546 -:10B7E00032463B4684F80690E01D079121F056FF53 -:10B7F0000799DBF89C30A08823620023A3839BF881 -:10B80000A1309BF8A22003F003030343500000F093 -:10B8100004000343A3809BF8DC30B8F1000F01D093 -:10B820009BF8A213012B47D0022B47D101290CBF53 -:10B8300004230323A373150744BF9BF8BC30E373B1 -:10B84000500644BF9BF8BD302374910644BFBBF83B -:10B85000E4306382930702D49BF86934CBB10DF1D5 -:10B86000270301930AAB58460093CDE90267DBE951 -:10B870002C23CDF81090FFF743FFDDE90A2304F1F4 -:10B88000150021F00BFF9DF82730237500238BF85E -:10B89000693401217FE70123637398E7B8F1000F52 -:10B8A00003D09BF80532012B01D00323F4E70423D6 -:10B8B000F2E7FF23A3719CE70223BBE70123B9E76B -:10B8C0009AF804A0AAF1060A5FFA8AFABAF11F0FE1 -:10B8D0003FF660AF1A9A02F1080845F01002A28004 -:10B8E000062B3FF658AF01A252F823F009B9000128 -:10B8F00011B900014FB9000197B700016DB90001FE -:10B9000097B7000167B9000145F01305A5801EE057 -:10B9100045F015054046A58021F0BAFE4FF0000A1B -:10B920000B460DF1270101910AA9024600915846E4 -:10B93000CDE90267CDF81090FFF7E2FEDDE90A23BA -:10B9400004F1150021F0AAFE9DF827302375324638 -:10B950003B4684F80690E01D21F0A0FEC4F820804C -:10B96000A4F81CA095E745F01205CFE7064B45F07B -:10B9700012051B78002B08BF45F0010545F00805AE -:10B98000C4E700BF20500021880700212DE9F041C5 -:10B9900005780646012D0C46174686B01CD1C81DF9 -:10B9A00091F8068021F074FE0B46B6F8BA100246F4 -:10B9B0000291E17B04A8019121790091414607F0B1 -:10B9C0000CFDDDE90423054807F021FD20B93D7099 -:10B9D000284606B0BDE8F0810025F9E7581400219B -:10B9E000F0B513780646012B0C46154687B023D1D7 -:10B9F0008B885B0615D4C81D8F7921F049FE0B4654 -:10BA0000B6F8BA1002460291E17B04A801912179AF -:10BA10000091394607F0E1FCDDE90423074807F00F -:10BA200053FD02234FF480712B70054B187B07B038 -:10BA3000BDE8F04022F03AB807B0F0BD581400213C -:10BA40006850002190F82430012B05D090F8213463 -:10BA50005BB1437EFF2B08D1022380F82430034BD7 -:10BA60004FF48071187B22F021B870476850002194 -:10BA700090F8693010B50133DBB2012B044680F831 -:10BA8000693009D9B0F866305B0808BF0123A0F817 -:10BA90006630002380F86930002384F86A3020F093 -:10BAA00064F8B4F86630013B0340013384F8683031 -:10BAB00010BDF8B5446A054694F868641746012E2F -:10BAC00002D000263046F8BD002384F86834D4E95B -:10BAD000B003184421F016F9B842F2D2EB6A04F52B -:10BAE0002E70C3F8B80004F53A71F8F7B7F9E9E732 -:10BAF0002DE9F0474FF0000892B0446AC66A074645 -:10BB000008A8894613F0D0FE9DF82030BF4D072BC2 -:10BB100085F8018004F1A00040F03F8184F8A28004 -:10BB200009F102020DF11E0113F0ACFC94F8A130F2 -:10BB300073BB9DF81E10CB0601F0010000F1BC8024 -:10BB400020B901236B7012B0BDE8F0879DF820305A -:10BB5000F96A8DF8403094F8A23080318DF8413088 -:10BB6000D4E92A23CDE90C239DF822300CA88DF8C6 -:10BB70004230D4E92C23CDE90E239DF82330012255 -:10BB80008DF8433006F1E003F9F7AEFF0028D8D076 -:10BB90000123DFF87CA29F4D8AF800302B78012B1F -:10BBA00059D19DF81E3003F00903092B53D100220F -:10BBB0000023CDE90A239DF8203006F1E0088DF836 -:10BBC000403094F8A2308DF81F208DF841309DF858 -:10BBD0002230D4E92A018DF84230CDE90C01D4E9B4 -:10BBE0002C019DF82330CDE90E01F96A8DF8433020 -:10BBF000803143460CA8F9F777FF40460DF11F024C -:10BC00000AA9FFF7EBFB2B7A012B94F8BC307AD111 -:10BC10009DF81F00009300F00100DDE90A23FAF708 -:10BC200083F800288FD00023296A8AF80030DDE9E4 -:10BC30000A23C1E9F8239DF81F3081F8D93394F81D -:10BC4000BC3081F8D833D4E92A23C1E9FA239DF81E -:10BC5000223081F8DA339DF81E8018F0100868D081 -:10BC60000023FB6004F1D6073846D4F8C41013F063 -:10BC700063FC96F8F12096F8CD100232707BD6F86E -:10BC8000D48020F088FA394608EB0003D6F8D42097 -:10BC9000204608F065F894F80031002B40F0B2809F -:10BCA0002B78012B7FF44FAF9AF80020002A7FF405 -:10BCB0004AAF8AF8003046E7C8B1012385F828303A -:10BCC000D4E92A23C5E906239DF8223085F82930D6 -:10BCD00011F0020111D0012385F82A30D4E92C2378 -:10BCE000C5E908239DF8233085F82B3050E7002262 -:10BCF00000232885C5E90623EAE700220023698599 -:10BD0000C5E9082344E76A7A9A427FF41CAF9DF89C -:10BD10001F30AA7A03F001039A427FF414AFD5E9E9 -:10BD20000402DDE90A139A4208BF88427FF40BAF90 -:10BD300079E7002300220CA9CDE90C2306F1E000ED -:10BD40000AAA04F118058DF82880FFF747FBCDE912 -:10BD5000049596F9CC30414603939DF8283020464F -:10BD60000293DDE90C23CDE9002308AAFFF704FDC7 -:10BD700000283FF4E8AE04F13C063246294620464E -:10BD800084F82680FFF702FE00283FF4DCAE32463E -:10BD900029462046FFF724FED5E60023002241462F -:10BDA000CDE90C2330228DF8288004F1180727F004 -:10BDB000B4FF0AAA0CA906F1E000FFF70FFBCDE9DA -:10BDC000049796F9CC30414603939DF828302046DD -:10BDD0000293DDE90C23CDE9002308AAFFF7CCFC90 -:10BDE00000283FF4B0AE04F13C052A46394620460F -:10BDF00084F82680FFF7CAFD00283FF4A4AE2A4647 -:10BE00003946C6E720F046FF9DE600BF88070021BF -:10BE1000B8070021C03600212DE9F041814C456A68 -:10BE2000C66A88B0074604F10C00884613F03CFD52 -:10BE300004F10A0108EB000205F1A00013F022FB57 -:10BE40000123227BE072072A63727FD195F8A1203B -:10BE500095F8A210002A5BD194F828205AB9A27A4A -:10BE6000D20708D584F82830D5E92A23C4E9062367 -:10BE7000A37B84F8293094F82A3063B9A37A9B070E -:10BE800009D5012384F82A30D5E92C23C4E90823F5 -:10BE9000E37B84F82B3094F82830012BD4E9062377 -:10BEA000C5E92A2394F8293008BF41F00101A373A2 -:10BEB00094F82A3008BF85F8A210012B02BF95F82C -:10BEC000A23043F0020385F8A230D4E90823C5E983 -:10BED0002C2394F82B30E37307238DF8183095F852 -:10BEE000A230F96A8DF81930D5E92A23CDE9022369 -:10BEF000D5E92C23CDE90423E3890022ADF81A30DB -:10BF0000803106F1C80302A8F9F7EEFD50B10BE04D -:10BF1000A37A21F0340123F03402D807A27285F805 -:10BF2000A210D9D4012363706378012B01D10027BB -:10BF30005FE095F8A17017F0020749D0D6F8987025 -:10BF4000002F45D096F8DC3013B901236370EEE77B -:10BF500095F8A230D907F8D52846FFF7BDFB012890 -:10BF6000074635D1D6E9322305F1800021F096FB52 -:10BF700096F8DA3085F8D330D6E93223C5E91C23A8 -:10BF80006B7B9A071ED595F8A2309B0735D5D5E96E -:10BF90002C23CDE902231B0A03F0C003402B94F8A5 -:10BFA0000F8007D102AB96F8DB000093D6E934236B -:10BFB000FAF788F8DDE9022305F17A0021F06EFB3B -:10BFC00085F8D28005F1D00105F1780013F0E0FB8F -:10BFD00095F8A13084F82C300023E38595F8A23041 -:10BFE0005B0003F00403A5F8443096F9B93085F8F6 -:10BFF0005130384608B0BDE8F081D6E92223D6F8A2 -:10C000008480CDE9022302AB96F8DB000093D6E9E9 -:10C010003423FAF748F810B9C8F34008CAE7B8461D -:10C02000C8E700BF880700212DE9F0478F4F86B091 -:10C030003B7B072B40F0138100220023CDE9042332 -:10C040000023C66A8A4D446A0DF10F0204A906F165 -:10C05000C8008DF80F30FFF7C1F995F80090B9F1DD -:10C06000010F00F08A804FF0000994F8A2309A0680 -:10C0700005D5D4F8C81004F1E00013F073FA95F870 -:10C080000080B8F1010F40F0C380DFF8E8A19AF812 -:10C090000030002B40F0BC8094F8A2309B0640F1A9 -:10C0A000B7806B78002B40F0B3802D6A04F1A00EAE -:10C0B00005F57C7CBEE80F00ACE80F00BEE80F0081 -:10C0C000ACE80F009EE80F008CE80F002846FFF751 -:10C0D000C1F940F2E242B4F8FC30A5F8E031A5F82D -:10C0E000FE31B4F8E4305343C5F8E43194F8F0205D -:10C0F00085F8E82194F8DC20012A00F08C80022ADF -:10C1000008BF4FF00308B5F86823B9F1010F02FB2F -:10C1100003F385F82084C5F8EC3112D1DDE904235E -:10C12000C5E9F8239DF80F3085F8D93394F8BC3071 -:10C1300085F8D833D4E92A23C5E9FA23BB7B85F8EF -:10C14000DA3396F8B02096F8BA10707BD6F8C07043 -:10C1500020F021F895F821343844002B5ED100906E -:10C16000D6F8C030204604F1E00204F1D60108F010 -:10C170003FF800238AF801304AE0DFF8F88098F8A9 -:10C180000030002B6ED16A7A94F8BC309A420FD1FD -:10C190009DF80F30AA7A03F001039A4208D1D5E93D -:10C1A0000402DDE904139A4208BF88423FF45BAF02 -:10C1B000012388F80030BB7A19077FF554AF13F0DC -:10C1C000210F3FF450AF2A7A94F8BC30012A0DD1E8 -:10C1D0009DF80F00009300F00100DDE90423F9F75A -:10C1E000A3FDA8B1002388F800303EE76A7A9A429E -:10C1F0000ED19DF80F30AA7A03F001039A4207D1BD -:10C20000D5E90402DDE904139A4208BF8842E9D067 -:10C2100006B0BDE8F0874FF0020874E70022164B25 -:10C220001B68EB64154B1B682B65154B1B68C5F829 -:10C230000831D5F824341A61124B1F6847B10090B9 -:10C24000D6F8C030204604F1E00204F1D601B84728 -:10C250000D4B1B68002B8CD02846984789E701239B -:10C260007B70D5E7012B7FF4FEAEA4E788070021A1 -:10C27000C0360021B8070021CC070021C4070021E7 -:10C28000C0070021C8070021D00700212DE9F04197 -:10C2900006460F46446A86B031B92046FFF7B4F827 -:10C2A000002006B0BDE8F081344DD0F82C80204647 -:10C2B000FFF7DEFB394605F10C0013F0F5FA05F146 -:10C2C0000A013A1804F1A00013F0DCF8012194F8F7 -:10C2D0006934E8726972FBB994F8A1305BB194F8E3 -:10C2E000A230AA7A23F0260322F02602AA7284F84A -:10C2F000A23084F8691494F8A23003F00702072AE8 -:10C300000AD123F0260384F8A2300123AA7A84F804 -:10C31000693422F02602AA722B7BF16A8DF8103064 -:10C3200094F8A23068468DF81130D4E92A23CDE97B -:10C330000023D4E92C23CDE90223EB890022ADF8B8 -:10C340001230803108F1C803F9F7CEFB10B9012390 -:10C350006B70A5E794F8A1309B07F8D1D4E91C02D3 -:10C36000D8E932139A4208BF8842F0D1B4F8443079 -:10C3700003F0170343F00803EB8591E788070021DA -:10C38000F0B5374C0D4694F801C085B0BCF1000FF4 -:10C3900002D0002005B0F0BD0029FAD0637AC76A48 -:10C3A000012B466A3FD1E27A237C0232154496F88B -:10C3B000A020013B9B1A6560237284F809C0237B8F -:10C3C000072BE6D1002396F869240193A37A002A6B -:10C3D0003ED196F8A12042B123F03403A37296F81F -:10C3E000A23023F0340386F8A230A37ADA0618D5F7 -:10C3F000D6F8C41002A813F09FF89DF80E30022B57 -:10C40000C7D806F031FE9DF80E301841C307C0D5DD -:10C410009DF8083007F1B4027B7001A902A8FFF76C -:10C42000C1F80198B6E704F10C0013F03DFA054499 -:10C430002A4604F10A0106F1A00013F023F8237C38 -:10C4400096F8A020013B05449B1A65602372B6E76D -:10C4500023F02603A37296F8A23023F02603C2E746 -:10C46000880700212DE9F043554E8BB07578002DDB -:10C4700040F0A380446A94F83C7061B9012F04D164 -:10C48000A38B43F04003A38339E084F8645028462B -:10C490000BB0BDE8F083022FF9D0D0F82C80002F2C -:10C4A00069D196F82C30002284F8A130002308A925 -:10C4B000CDE9082308F1C8000DF11F028DF81F70A7 -:10C4C000FEF78CFF94F8A1309A0736D504F14009A5 -:10C4D000B4F84410CDE9047994F95130204603931F -:10C4E0009DF81F300293DDE90823CDE9002306F112 -:10C4F0000C02FFF741F950B984F86400002520468A -:10C5000004F13C0204F11801FFF76AFABFE7B4F83E -:10C51000443004F1640723F008033A4649462046B4 -:10C52000A4F84430A4F85C502566FFF72FFA20B138 -:10C530003A4649462046FFF753FA002304F118070C -:10C540000597049398F9B930204603939DF81F305E -:10C55000F18D0293DDE90823CDE90023194AFFF7A5 -:10C560000BF90028CAD03946204604F13C02FFF7F7 -:10C570000DFA0028C2D0144BA08E1B68327A1B8C97 -:10C5800017461B1A9BB29342FFF47AAFD4F89C3043 -:10C590007168184498F9B95027F098FBA38E84F875 -:10C5A00029501F4494F8BD30012584F82830B37A0F -:10C5B000A786DB063FF56BAFA1E7002567E700BF65 -:10C5C0008807002194070021DC4D00217FB5C46A53 -:10C5D000D4F89C30002B41D094F8F0300BB1062BEE -:10C5E0003CD194F8F430002B38D0D4E93823456A94 -:10C5F00005F1800021F052F894F8F23085F8D3303C -:10C60000D4E93823C5E91C236B7B9B0718D5D4E9F3 -:10C610002223CDE9022302ABD4F8846094F8F3001E -:10C620000093D4E93A23F9F73EFDA8B9C6F34006D2 -:10C6300005F17A00DDE9022321F030F885F8D260B7 -:10C6400005F1D00105F1780013F0A2F8284604B0F6 -:10C65000BDE87040FFF740B80126E9E7002004B0CC -:10C6600070BD000037B5044668460D4613F01CF94E -:10C670009DF80030054A072B137005D02946204647 -:10C68000FFF7A4FF03B030BD0020FBE788070021BF -:10C69000FEF7F6BD2DE9F0410E46446A8CB0002944 -:10C6A00048D0C56A08A813F0FFF895F8F030042BBD -:10C6B00039D1D4E91C02D5E938139A4208BF88421F -:10C6C00031D1002300224FF00008CDE90A230AA946 -:10C6D0000DF11F0205F1E00004F118078DF81F802D -:10C6E000FEF77CFECDE9046795F9CC304146039313 -:10C6F0009DF81F3020460293DDE90A23CDE900238F -:10C7000008AAFFF739F870B104F13C052A4639460A -:10C71000204684F82680FFF739F920B12A463946A9 -:10C720002046FFF75DF92046FFF7A2F900200CB084 -:10C73000BDE8F0812046FEF767FEF7E730B4406AB7 -:10C740000368027C23F07F43022A23F0FF0318BF13 -:10C75000002290F80041BBB190F801310133DBB207 -:10C7600080F801311CB1012B03D830BC7047002B7D -:10C77000FBD001230C4993400A7822EA03020A7095 -:10C7800030BC032107F034BC0121074D9140AA7849 -:10C7900080F8003222EA0102AA70C0F8F031002CC1 -:10C7A000E3D130BCFEF728BFB80F00210122436A55 -:10C7B000DA70FFF7C3BF000010B4406A0123027CA7 -:10C7C0000D49022A18BF00229340DB4302685BB286 -:10C7D00022F07F4222F0FF0232B10A7813400B7040 -:10C7E00010BC032107F004BC8C7880F800212340A2 -:10C7F0008B7010BCFEF700BFB80F00212DE9F04F81 -:10C80000446A8046E37885B043B100230521204681 -:10C81000E37005B0BDE8F04F07F004BCA2785AB150 -:10C8200020460321A37007F011FC04F5727005B0D7 -:10C83000BDE8F04F21F0ADBA63799BB9237AB4F823 -:10C84000FE11002B14BF07220622062A0CBF052268 -:10C850000622B4F8E0315B1A934203D1032120464B -:10C8600007F0E0FB0022564B22725978002940F075 -:10C8700081800125B4F8FC31B4F8E061514FF61A1B -:10C88000E71B514BFF105F43504BB6B293F87A3021 -:10C89000B3B1D4F8E40100FB06F994F8E8010FF015 -:10C8A00081FF0146484606F01FFBD8F80830B4F86F -:10C8B000E011009382B2D4F8E431F8B21FF0B5FB76 -:10C8C000DFF80C91BFB2B4F8E0314FF0000AADF8D8 -:10C8D00008306823ADF80A50ADF80E7004F5087BF7 -:10C8E00003FB0AF21BF802202AB102A88DF80CA063 -:10C8F000FAF780FB68230AF1010ABAF1030FEFD1BE -:10C90000B4F8E031D4F8E4012E442B44B6B2A4F8D4 -:10C91000E03100FB06FA94F8E8010FF043FF01460E -:10C92000504606F0E1FAD4F8E421D4F8F831B4F82E -:10C93000E01102FB06331B1AC8F80830D4F8F031B6 -:10C94000C8F814200344C8F80C30D4F8F43103EBD1 -:10C950004000C4F8000104F5647008F073FC494617 -:10C9600084F86100404620F05BFB0028ABD005B0A6 -:10C97000BDE8F08F5868B4F8E011C4F8F801A4F8E5 -:10C98000FC1104F57270D4F86C135A7021F0FBF9A5 -:10C99000D4F8EC31002B3FF46CAF4FF47A72D4F83A -:10C9A0006C535543AB4202D2B4F8685362E7D4F8F3 -:10C9B000E431002B3FF45DAFB5FBF3F5ADB259E7C1 -:10C9C000B8070021D01D00214DF833E1405100216E -:10C9D000D93601010122436A1A72FFF70FBF000026 -:10C9E0002DE9F04F446AC66A94F8213481460F4617 -:10C9F000904687B084F82C201BB1D4F82434727B85 -:10CA00005A75002F00F0C9814FF0000A3B78914D14 -:10CA100097F801B003F00F03BA1C86F8BCA005F12B -:10CA20000A0104F57C700193009212F02BFD009A2C -:10CA3000019B02446A6094F8F0230BF1FF3BABEBDF -:10CA4000020B052B85F808B000F01281072B2AD1C4 -:10CA500094F82134012B0CD186F8CA30D4F8243450 -:10CA6000B4F8E0211A829A7CDA74D9F82C20527832 -:10CA70001A756379784F93BB0123784A3B70137E14 -:10CA8000B3B194F8F21348070FD594F809140B4189 -:10CA900013F0010F0CD0136A01220221204683F803 -:10CAA0005B2307F0BFFA0020CDE013F0100FF1E791 -:10CAB0004FF001090421204684F8059007F0B2FAEE -:10CAC0004946204607F0C2FA654B1B784B4501BF2B -:10CAD000D4F8E431B4F868235343C4F8EC3194F843 -:10CAE0002134002B51D06379002B4ED00121D4F892 -:10CAF00024044FF00009D0E9003C827C914001EA17 -:10CB0000030E0CEAE1725EEA020200F09F806FEA17 -:10CB1000010E90F86D2023EA01030CEAEE71C0E9E2 -:10CB20000031A0F8582000F17001A0F86290C06DAB -:10CB300027F0CCF8D4F824044A4B00F1160100F198 -:10CB40005802D3F800A0C6F8B0104B46B0F86E01FA -:10CB5000D04740F2E241D4F82434A6F8AC00DA6DB4 -:10CB6000C6F8B820B3F86220A6F8B4209A7C134423 -:10CB700093F8703194F8FB225A4394F8FA324B43FD -:10CB80007D2101FB0233C6F8A4307B7853B996F8B7 -:10CB9000C830012B06D1B8F1000F03D1D6F8C4205C -:10CBA0007B707A602046FEF755FC94F88832012BA2 -:10CBB00020D194F89212D6F8C43000290CBF1E215F -:10CBC0004FF49671B4F89022702001FB0233C4F840 -:10CBD0008C3220F0BFFE074660B1234B04F5227172 -:10CBE00040F8083B682227F071F8204B3946187B43 -:10CBF00020F0C1FEE379AA7A93B1110710D594F819 -:10CC00002134B4F80A1423B1D4F824349B7C03F003 -:10CC10007F0303F5807334F813308B423FF443AF46 -:10CC200000230393D3060DD5D4F8141404A812F0EE -:10CC300083FC9DF8103006F1A002737003A904A8CC -:10CC4000FEF7B0FC039807B0BDE8F08FC6F8A490DB -:10CC50009BE700BF88070021B8070021C0360021EC -:10CC6000E8360021D407002100001103685000219C -:10CC700086F8CAA094F82134002B3FF414AF4FF08B -:10CC80000109D4F82424937CD2E9021209FA03F3AF -:10CC9000194002EAE3730B433FF405AF682020F02C -:10CCA00059FE054600283FF4FEAE3D4B3946A4EB45 -:10CCB00003083C4B4FEAE80803FB08F81FFA88F822 -:10CCC000A0F8008080F802A004A812F0EDFD391849 -:10CCD000354F05F1080012F010FED5E904C1D7E97F -:10CCE0000C23994208BF944553D1D5E902239DF8FE -:10CCF00012004FF0000A43EA004E003818BF01202E -:10CD00004FF0000BC4F80024C4F804E49DF813E0CD -:10CD100041EA0E41C4E9FEC1C5E914ABC5E91223DD -:10CD200085F83C000EF0E6FE824690BBD4F8243431 -:10CD300024225B7D85F83E3096F8BF10707BD6F8D4 -:10CD4000C4B01FF028FA194B5844D3E90423C5E9AD -:10CD500016234FF48073A5F84030FF232946A863BB -:10CD600085F86030387B85F83D9085F83FA0A5F8C0 -:10CD7000628020F000FE86F8BC90D4F8241452465D -:10CD800016315046C6F8B01013F0AEFBA6F8AC0052 -:10CD900089E6284620F0E6FD85E6384653E700BFE1 -:10CDA000D01D00214DF833E168500021F8500021DA -:10CDB0002DE9F347446A074694F8216401256EB1D2 -:10CDC000D4F824349A7C9540D3E902232A4003EA1C -:10CDD000E57552EA050314BF01250025002900F07E -:10CDE00094806846FE6A12F05FFD9DF80030072BC4 -:10CDF00023D16378012B1ED1D4F86C1304F5727023 -:10CE000020F0C1FFE379B3B1564B9B7A1A0712D5D4 -:10CE100094F82134B4F80A2423B1D4F824349B7C48 -:10CE200003F07F0304EB4303B3F80012914204D0F4 -:10CE30000DB1A3F80022637923B90025284602B07A -:10CE4000BDE8F087002DF8D094F82450022DF4D0DE -:10CE5000DFF8108195BB1422294604F1100098F8E0 -:10CE60000A90D7F82CA07F6A26F057FF3E4B3F4A26 -:10CE7000FB1ADB10534319F0400FA3821CBF97F835 -:10CE80000D34A3759AF8BE3019F0040FE3750CBF8A -:10CE9000FF2397F809342376BB6AE361B7F8E031E2 -:10CEA000238497F82134DBB1D7F824349B7C84F8B1 -:10CEB00022306378012B0FD184F824302C4B608B07 -:10CEC0001B6898F808201B8C15461B1A9BB29342CE -:10CED00008D20223002563762046FEF7B3FDADE7B6 -:10CEE000FF23E4E7A36AD8F80410184496F9BE605B -:10CEF00026F0ECFE638BE6751D4498F80A306583D6 -:10CF0000DB064FF0010599D4E6E794F82430012BB5 -:10CF100002D16378012B01D0002E8ED0002D8CD051 -:10CF20001422002104F1100026F0F7FE0E4B0F4AE8 -:10CF3000E31ADB105343A38247F67F73E382FF2398 -:10CF40002376D4F82434002E9B7C204684F82230AB -:10CF5000B4F8E031238414BFFF2302236376FEF785 -:10CF600071FD6AE788070021D01D00214DF833E1EB -:10CF7000DC4D00210022014B5A707047B807002198 -:10CF8000C36AD3F8A00018B1A1F10C03584258416C -:10CF9000704700000C4B70B55B6815467BB12229C9 -:10CFA0000DD10126094C84F828601FF073FE237808 -:10CFB0009A0605D52B789B0602D584F82A6070BDA9 -:10CFC000002384F82A30FAE7B00C002168370021EA -:10CFD00010B5C46A0A4694F8C83094F8C910032BF7 -:10CFE00003D0052B09D0002010BD94F8CC30002BC5 -:10CFF000F9D0BDE81040FFF7C3BFFFF7CBFFD4F86F -:10D00000B430034A03F5B073C2F8E031EBE700BF78 -:10D010006837002110B5C46A94F8C830032B2AD1B0 -:10D0200094F8CC303BB394F8C910FFF7A9FF10B3C4 -:10D03000114B93F87830F3B1202020F08BFC02469E -:10D04000C8B1D4E93001C2E9060194F8CB301374B9 -:10D05000D4E92E01C2E9020194F8CA300021074840 -:10D06000137020F082FCBDE81040054B4FF4806146 -:10D07000187B20F01BBD10BD4051002174390021E8 -:10D080006850002108B51EF070FDC0F3001300F0D9 -:10D090000F00184408BD00002DE9F04FDFF8A8B1DB -:10D0A0000546BBF8282085B082B1042020F052FC50 -:10D0B0000146002800F08C8040F204434B80634B13 -:10D0C000187B05B0BDE8F04F20F055BC604F614CB7 -:10D0D000F97BD0F82CA094F86A3000297BD0012B82 -:10D0E00079D1D7E90889FA735B4E4B464246304600 -:10D0F00020F0D4FA3368C6F8E431B388A6F8E831F2 -:10D10000CAE92289237C042B01D0012B12D1DAF841 -:10D11000843003F04403442B0CD102AB0093A07C79 -:10D12000D4E90623F8F7B0FF20B1DDE902234B482C -:10D1300020F0B4FA237C042B14D0012B12D094F8E5 -:10D1400048307BB1002394F8472084F8483002F13E -:10D1500008038AF8B0304249931D40488BF80130EB -:10D1600026F0B4FD94F869307BB1002394F8682070 -:10D1700084F8693002F108038AF8B1303949931D07 -:10D1800039488BF8E53126F0A1FD002128461FF033 -:10D1900095F8237C012B36D002D9023B022B17D8FD -:10D1A00040F27126FB699B0105D5FFF76BFFAB6869 -:10D1B00006FB0033AB60D4E90212914219D1AB688F -:10D1C00028461944A96000211FF02AFF0028E9D051 -:10D1D00005B0BDE8F08F9A0794D502AB0093A07C10 -:10D1E000D4E90623F8F75FFF00288BD0DDE9028938 -:10D1F0007AE728461FF0DAFF0028E9D1AB68E26839 -:10D200001344AB60CEE7D5F8088027682368002B6D -:10D210003FF44BAFD4E90212284620F055F80646F9 -:10D2200018B9AB68E2681344AB604146A8681FF0C8 -:10D2300069FDE3680344BB422CBF0020381A20601C -:10D24000002EE3D0C4E700BF6837002168500021FA -:10D2500020500021405100216A3700217037002101 -:10D2600068510021895100215439002170B5446A68 -:10D27000D4F8D833D3B194F8C53BBBB1D4F8180A6D -:10D280001FF040FD0546D4F88C3894F89E1893F8AA -:10D29000B020187B1EF07FFF29462046D4F8D833F3 -:10D2A00094F8C42BBDE8704012F0CEBC70BD0000F5 -:10D2B0002DE9F041446A01290D46D4F8C06B00D134 -:10D2C0000EB3204B04F24D471B6804F5C568DB8A9A -:10D2D0001E4494F8C43B84F8413ABDB92046A4F8F2 -:10D2E000325607F05BFF2B4642463946204613F084 -:10D2F0003FF8D4F82C36A4F8D80AC4F8E43AB4F8C5 -:10D300003236A4F8E03A3046BDE8F081B4F832563F -:10D31000B4F85238AB4202D9204607F03FFF002351 -:10D3200042463946204613F0C1F8D4F82C36A4F80A -:10D33000FC0A2B44C4F8083BB4F832365B1BA4F853 -:10D34000043BE0E7DC4D0021F8B5446A074694F859 -:10D350004D33D4F8486384F8C931002965D194F875 -:10D36000DD3BA4F81E1513B9204607F041FF94F8E1 -:10D37000B850012D16D0002594F8DD3B002B49D084 -:10D380002046D4F8E43B984715B1012384F8B8301F -:10D39000D4F81835C4F86C32B4F81E35A4F86832E5 -:10D3A0003046F8BDD4F8BC20BB68D31AB3F5167F5D -:10D3B000B4F8C4200CD240F2E24194F8C77001FBEB -:10D3C0000233D4E93E10C91940F10000C4E93E100F -:10D3D0002A498B4213D8002184F8C210A1F1EE3102 -:10D3E000A3FB01014908A4F8C01022B140F2E241B8 -:10D3F0004A439A42BFD2FF2384F8B830BCE70121E8 -:10D4000084F8C2101E49A3FB0101032000FB031195 -:10D41000890AE8E70123204604F2145204F2D141BC -:10D4200013F066F9A4F86002AEE794F8C033B4F8DC -:10D430001E5523B194F8C233013B84F8C233B4F8CB -:10D440001435AB4202D894F8C23313B1204607F02A -:10D45000CFFE0123204604F2145204F2D14113F00E -:10D4600025F8D4F81835A4F884022B44C4F8903277 -:10D47000B4F81E355B1BA4F88C3291E7C37F07001C -:10D480009E36D069F8B5446A01290D46D4F8C06BC0 -:10D4900000D1F6B11E4B04F28F471B68DB8A1E4495 -:10D4A00094F8C43B84F8413AADB92046A4F84657F5 -:10D4B00007F074FE2A463946204612F0C3FFD4F81E -:10D4C0004037A4F8EC0AC4F8F83AB4F84637A4F8A0 -:10D4D000F43A3046F8BDB4F84657B4F85038AB4289 -:10D4E00002D9204607F05AFE00233946204604F2AE -:10D4F0003C7212F0DBFFD4F84037A4F8FC0A2B444E -:10D50000C4F8083BB4F846375B1BA4F8043BE0E7DB -:10D51000DC4D00212DE9F0431C4CD0F82C80054651 -:10D5200087B020460F4612F0BFF994F80090B9F189 -:10D53000030F29D123790C2B26D1154EB91C304667 -:10D5400012F0CCF9D6E9000100222378CDE90001E0 -:10D55000D6E902018DF81030A378CDE902018DF8EB -:10D560001230E96AE37868468DF81330803108F1AB -:10D57000E00305928DF81190F8F7B6FA003818BF5D -:10D58000012007B0BDE8F0830020FAE7DC070021A6 -:10D59000E807002130B4446A94F84330A3B1C06A6C -:10D5A00090F8F31090F8F250D0E93A238D4205D16B -:10D5B000D0E93850984208BF954201D041F00201AD -:10D5C000607830BC1EF008BD30BC704730B4446A8F -:10D5D00094F84330A3B1C06A90F8CB1090F8CA50C9 -:10D5E000D0E930238D4205D1D0E92E50984208BFB2 -:10D5F000954201D041F00201607830BC1EF0ECBCD5 -:10D6000030BC7047F0B5464D97B0446A074628468F -:10D610000E4612F049F931180AA812F06EF92B786B -:10D62000052B02D0002017B0F0BD3E4B5B68002BED -:10D63000F8D02B79222BF5D10AA812F0B5F90028E1 -:10D64000F0D0DDE90A012B7800228DF82030032389 -:10D650008DF82130AB78CDE90401DDE90C018DF8BE -:10D660002230CDE90601EB78F96A8DF8233080315C -:10D6700004F5326304A80992F8F736FA0028D2D0EC -:10D6800004F52E67D7E9102304F2994020F006F83C -:10D6900094F8323B06F1080084F8CB3BED781FF09C -:10D6A000F7FF94F83930CDE902019B0732D50B0A18 -:10D6B00003F0C003402B0AD11B4BC3E91C0102AB92 -:10D6C00094F8330B0093D7E91223F8F7FBFCDDE95C -:10D6D000022304F293401FF0E1FF84F8CA5B04F6D2 -:10D6E000C83104F28F4012F053F8012540F20113C3 -:10D6F000242294F8191B94F84D0A84F85458A4F87D -:10D700005C38D4F81C6B1EF046FD0644C4F858681B -:10D71000284688E700200021034BC3E91C01D6E717 -:10D72000DC070021B00C00214051002138B5C26A4D -:10D7300092F8C840032C03D0052C0BD0002038BD34 -:10D7400092F8CC30002BF9D0BDE8384092F8C910DF -:10D75000FFF716BC0B4C456A204612F0A5F823785B -:10D76000052BEBD1084B5B68002BE7D02379222BEC -:10D77000E4D1012385F85C38002385F854381FF084 -:10D7800089FADBE7DC070021B00C002110B4C46A81 -:10D7900094F8C820032A03D0052A08D010BC70478B -:10D7A00094F8CC30002BF9D010BCFFF70FBF426AC1 -:10D7B00092F8E43313F0200304D0074B5B78003B6E -:10D7C00018BF012382F85D38D4F8B43003F5B07384 -:10D7D000C2F85838E2E700BFDC0700212DE9F84322 -:10D7E00004460025682700F1500600F55A7807FB2B -:10D7F00005F316F80390B9F1010F1FD1F5B9B4F88C -:10D800006020B4F890319A4218D1D4E916234046EA -:10D81000C4E9DA231EF0ACFA4946204613F012FEA2 -:10D82000D4E9DA03D4E9E812934208BF8842C4E994 -:10D83000200303D02946204613F004FE0135032DB2 -:10D84000D5D1BDE8F88300002DE9F043446A0546D0 -:10D8500094F8C53BC66A85B003BB94F8C73B23B9AF -:10D8600094F8D533013384F8D533D4F85C3813F009 -:10D87000FF1F09D194F8D43383B194F8D5239A4289 -:10D880000CD3432384F8D633012384F85E38042173 -:10D89000204605B0BDE8F04308F0E4BAF37B13B9C5 -:10D8A000A34B93F87930B373238C13F0100368D132 -:10D8B00094F83C76BFB184F83C3694F83D26D4F811 -:10D8C0002C0604F5C86126F001FA94F83D36A4F858 -:10D8D0002836A4F85238B4F83E36A4F8403094F80C -:10D8E0003B3784F834360022204604F5797112F073 -:10D8F0009FFC86F8B0005FB194F8C53B43B9D4F8FB -:10D90000D8332BB1204607F051FD012384F8C53BE5 -:10D9100094F89261012E0FD194F8893163B1D4F853 -:10D92000D8334BB194F8C53B33B9204684F89231D3 -:10D9300007F03CFD84F8C56BD4F8C43B23F07F436B -:10D9400023F0FF03B3F5803F06D1B4F83E36A4F8C8 -:10D950004030002384F8C63B002128461EF0AEFC70 -:10D96000238C03F01D031D2B40F0B680D5F80880F2 -:10D97000E76AE36A002B40F093803C2384F8D633B7 -:10D9800085E76B4FE27897F86A30002A75D0012B53 -:10D9900073D1D4E902890023C4E90489E37004F255 -:10D9A000E6374B46424638461FF078FED4F8E63359 -:10D9B000C4F82834B4F8EA33A4F82C34C6E9228930 -:10D9C000238C5A0718D5D6F8843003F04403442B2F -:10D9D00012D102AB94F83A000093D4E90C23F8F783 -:10D9E00053FB48B1DDE9022304F57B701FF056FEBE -:10D9F000DDE90223C4E9062394F83C360BB3002387 -:10DA0000D6F8981084F83C360B7803F00F03062BF9 -:10DA100017D8012202FA03F313F0450F11D094F83E -:10DA20003D36083386F8B03094F83D3606334B70F7 -:10DA3000D6F8980094F83D2604F23E61083026F0AE -:10DA400045F994F85037002B86D0002384F85037DE -:10DA500094F85137D6F8A020083386F8B13094F8FE -:10DA6000513704F2527106335370D6F8A00094F87F -:10DA70005127083026F02AF96EE79907A0D502ABA6 -:10DA800094F83A000093D4E90C23F8F70CFB002833 -:10DA900096D0DDE90289C4E90489C7E91C897EE7DB -:10DAA0002846D4E909121FF00FFC064618B9AB68E6 -:10DAB000A26A1344AB604146A8681FF023F9A36A29 -:10DAC0000344BB422CBF0020381AE062002E3FF412 -:10DAD00050AF05B0BDE8F08394F8C53BEE6813B1D4 -:10DAE000D4F81C3A1E4494F8C73BC3B9114B646A7E -:10DAF000DB699B0107D5FFF7C5FA40F27122AB68DD -:10DB000002FB0033AB607100A1424FF0004238BF0E -:10DB10002146284605B0BDE8F0431FF047BB00236F -:10DB2000284684F8C73B05B0BDE8F0431FF024BA8F -:10DB300040510021205000210122436A83F8C72B65 -:10DB4000FFF782BEF8B5446AC66A94F8D533D4F8B4 -:10DB50005C280133DBB212F0FF1F054684F8D53391 -:10DB600007D194F8D423A2B1934212D3432384F86B -:10DB7000D633012384F85E38002304F5066084F868 -:10DB8000C53B1FF025FC2046BDE8F840042108F005 -:10DB900069B9F37B13B93B4B93F87930B37394F8BD -:10DBA0003C3633B3002794F83D2604F5C861D4F819 -:10DBB0002C0684F83C7626F089F894F83D363A46EF -:10DBC000A4F82836A4F85238B4F83E362046A4F813 -:10DBD000403094F83B3704F5797184F8343612F00C -:10DBE00027FBD4F8D83384F8400913B984F8C53B2F -:10DBF000F8BD94F85037C3B1002394F8512784F846 -:10DC00005037D4F8400704F2547126F05FF894F8C6 -:10DC10005137A4F83C37A4F85038B4F85237A4F878 -:10DC2000403094F84F3884F8483794F8C63B94F85D -:10DC30003A00012B01BFB4F83E36A4F8403000236F -:10DC400084F8C63BD4E90C23F8F710FC98B1002304 -:10DC50002046A4F8323604F5C56204F24D4112F0B4 -:10DC600087FBD4F82C36A6F89800C6F8A430B4F890 -:10DC70005238A6F8A03029462046BDE8F84007F003 -:10DC80001BBB00BF4051002173B5446A054694F8A0 -:10DC90004E3333B10321204602B0BDE8704008F096 -:10DCA00059BBC26A244ED37B0BB996F87930937373 -:10DCB00094F8283593B1002394F8292584F8283561 -:10DCC000D4F8180504F22C5126F000F894F8293500 -:10DCD000A4F81435B4F82A35A4F8563396F87A30F7 -:10DCE0004BB1AB68B4F89011607800930022D4F87F -:10DCF00050331EF09AF9D4F8503304F55A766B611C -:10DD0000AB68D4F8502320461344AB60B4F890318C -:10DD10000133A4F89031FFF761FDB4F8901130465B -:10DD200007F090FA002184F84D0328461FF078F997 -:10DD30000028E5D002B070BD40510021FFF7A4BF1C -:10DD4000F7B505460F46144622B909F02BF90446EB -:10DD5000002844D095F83433224EA3B1224B1A68E0 -:10DD60008AB1D5E9080395F818C0A0FB0C010CFB9B -:10DD70000311336905F52E7C634503D073781818B9 -:10DD800041F10001904795F83423D5F89800002A16 -:10DD900014BF04210021AB88D5F88C200233024443 -:10DDA000F0681944024433692046009789B2F6F7B7 -:10DDB0005BFD337895F834209A420FD90E3355F82D -:10DDC00023405CB123784BB194F8B13004F1780072 -:10DDD00086F8AE301EF037F884F8B100012003B0A9 -:10DDE000F0BD00BFF8070021A03A002108B51FF0E0 -:10DDF00069FD044A5378013B5370BDE808401FF0A9 -:10DE00006DBD00BFDC50002108B51FF05BFD044A6A -:10DE1000537801335370BDE808401FF05FBD00BF69 -:10DE2000DC5000212DE9F04F0F461646446A85B0BC -:10DE300062B98D4B5A7901325A711A78134493F8AA -:10DE4000A820013283F8A820A4F886606378022B0A -:10DE500015D01EF01FFFBEB99DF80430032B13D15F -:10DE6000814B5A6982B99DF8052094F8A21091421D -:10DE70000AD084F8A2205F6105B0BDE8F08F022EC1 -:10DE800008D876B11EF006FF002FF5D0384609F00D -:10DE9000B2F8F1E7062E04D13146204609F0D2FC53 -:10DEA000F0E7714DAB795BB9012316F0FB0FAB7155 -:10DEB00001BFD4F89820D4F89C319B1AC4E92233CE -:10DEC000394601A813F0D1F8002E40F022819DF8C8 -:10DED0000630EB719DF805302B729DF80430032B52 -:10DEE0004DD14FF000092B7894F834209A4203D991 -:10DEF000002E5DD0042E63D0E37F4FF0000A012B8B -:10DF00004FF0FF3B40F0CB802879617E0BF1010B95 -:10DF100088429ED82046544909F0F7F900285AD083 -:10DF200029780E3154F821100029F3D02879617E28 -:10DF3000884280F092804FF001084B4BD5F810A03A -:10DF400093E8030002908DF80C10204602A909F016 -:10DF5000DCF900287ED09DF808100E3154F821100D -:10DF600041B1207E94F81BE09DF80CC00EFB00F040 -:10DF7000844534DB08F101085FFA88F8E5E7012BF6 -:10DF800003D19DF80730002BABD006212A786B789F -:10DF900001FB02330B4455F82320002AA1D195F848 -:10DFA0000390B9F1000F9CD145F823704F469AE7D2 -:10DFB0000E3354F8233094F8A02183F864209BE7B3 -:10DFC0000E3354F8233094F8A02183F86420DA6CDF -:10DFD0000132DA6490E7E9790029A7D139E7B03155 -:10DFE0002961E868E168214B01FB0801E960996952 -:10DFF000CA030CD44FF0060E95F800C069780EFBEA -:10E000000C11714455F8211000297FF47DAFBBF14C -:10E01000000F0DD0BAF1000F0AD0D4F89810D4F840 -:10E020008C204FF001090A4410445146F6F75AFC7F -:10E030009DF80430032B3FF40CAF3A464946204686 -:10E04000FFF77EFE00283FF404AF002E7FF414AFEC -:10E05000374601E704F52E71C2E74FF00108C0E72B -:10E06000E97900292FD1F4E6F8070021205000219A -:10E07000B0312961E868216B2E4B01FB0801E96092 -:10E080009969CB03C3D44FF0060E95F800C06978A8 -:10E090000EFB0C11714455F821100029B7D02878D7 -:10E0A00094F834100BF1010B8842BFF4D2AE204635 -:10E0B000214909F0EDF80028D2D029780E3154F822 -:10E0C00021100029F3D0287894F8341088421DD20A -:10E0D0004FF00108184BD5F810A093E80300029008 -:10E0E0008DF80C10204602A909F0D2F858B19DF81D -:10E0F00008100E3154F821100029B9D108F1010897 -:10E100005FFA88F8EEE704F52E71B2E74FF00108E8 -:10E11000B0E7032E7FF4E5AED4F89830D4F88C0045 -:10E120004FF001091844D5E903311844F6F7DAFB3A -:10E13000D9E600BF20500021F807002138B5446A15 -:10E140006378022B03D0BDE838401EF0A3BD274BF7 -:10E15000B0221846002125F0E0FD94F89C200346EB -:10E160000270E27F012A29D194F83420E568012A5F -:10E17000C5601BD9D4F89400A0B100F1B0011961B9 -:10E1800020B96A43DA60627E012A12D80122DA716C -:10E19000FF221A72002220461146FFF7D1FD002807 -:10E1A000D1D038BDD4F89010B031E8E7627E012AB2 -:10E1B00016D9D4F89020B0321A61E7E7627E012ABE -:10E1C00004D9D4F89020B0321A6107E094F83420D2 -:10E1D000012A03D9D4F89420002AF4D1226BDA6002 -:10E1E0001A69002AD2D104F52E72E5E7F80700215A -:10E1F0002DE9F04F05460026D0F824A0A3B0DAF8A8 -:10E200008C30DAF828400593DAF82030DFF888926D -:10E2100009930AF1380B9AF83420B24230D89AF8B0 -:10E2200001309E4E022B2ED00721504609F00AFBEA -:10E230000AF160001FF0ADFD706918B108F0DBFE57 -:10E240000023736123B0BDE8F08FD8F8001041B10E -:10E250005BF8260080B1FAB208F0D0FE0023C8F8BF -:10E260000030013708F104089AF81820BA42ECD8B7 -:10E27000013609F11809CEE7084608F0BCFEF0E7C0 -:10E28000C8460027F0E7716900296CD09AF834334A -:10E29000002B46D0824B1F68002F42D0DAE90830AD -:10E2A0009AF818C0A3FB0C320CFB0022CDE91C32FB -:10E2B0001CABCAF820330AF53F70B847074680BB4D -:10E2C000706908F098FE06215046776109F0BAFAA5 -:10E2D000059B099A23441C460023CDE91033CDE960 -:10E2E0001233CDE914339AF8183053430A930AF1E4 -:10E2F0003803CDE9073300231E4605939AF83430DE -:10E30000059A9A42C0F09E80664BDB6A002B00F0B3 -:10E31000EB80002E00F0E880304613AA10A9984741 -:10E32000E2E09AF8A030CBB972699378012B15D846 -:10E3300002F102026CD00AF1A8010AF1B00012F059 -:10E34000A2FEBAF8A830BAF820209B1A1F0405D400 -:10E350009AF8A03043F001038AF8A030706908F001 -:10E360004AFE0023736173792BB1DAF870100AF159 -:10E3700060001FF008FDDAE92236F61ADAE9083201 -:10E38000013342F10002CAE90832DAF81030DAF853 -:10E390008C201E441A44CAF88C206B61BAF8841091 -:10E3A000304604F0A1FDBAF88630DAF89820184417 -:10E3B000DAF88C3013441B1A4000AB60CAF89001A5 -:10E3C000504608F09FFB9AF8A030D3B1D90710D57A -:10E3D000BAF82020BAF8A810013292B2914208D1BE -:10E3E00023F001038AF8A0305046DAE92C2308F024 -:10E3F000B3FB9AF8A0309A0703D50421504609F0E0 -:10E4000021FA002128461EF00BFE0028B6D05FE757 -:10E410000AF1B8010AF1BA0012F052FEBAF8B830A7 -:10E42000BAF820209B1A180404D49AF8A03043F0BC -:10E43000020391E71E23042150468AF8BA3009F0FE -:10E4400001FA8BE7089B53F8045B0893FDB10023A6 -:10E4500005F1100B06939DF818709AF81830BB421E -:10E4600022D822AA02EB460232F83C1C730071B19A -:10E4700095F86810002940F01E8295F82C100129AB -:10E4800000F019826B88013622F8483CF6B2059BF1 -:10E490000133059332E700BF10080021F80700217F -:10E4A000843A0021685000213946284608F0ADFD25 -:10E4B0000A9B8046FA184FF0000343F10003CDE9B0 -:10E4C0000E230EABC5F8183120B3B44B1B680BB349 -:10E4D000014605F1F4009847E0B9404608F08BFD8D -:10E4E0000621504609F0AEF9002637469AF8343036 -:10E4F0009E42C0F0E681AA4B93F84730002B3FF4D0 -:10E50000A1AEDAF820109AF8020023B0BDE8F04F6F -:10E510000FF004BD6B6893F81E90B9F1000F40F046 -:10E520007B81B8F1000F00F09C80414685F86C704B -:10E530000DA812F09AFD1822494616A825F0EDFB09 -:10E540006B880E9AADF858309DF83730A8F10A075D -:10E55000ADF85C30ADF8663095F82C311894ADF814 -:10E5600064202BB1012B2DD038461FF0FBF926E09B -:10E570009DF83430012B16BF4FF481738DF85B305A -:10E58000ADF85A309DF8343016A985F82C3138464C -:10E5900012F0E7FD08F10201BDF86620384425F0CD -:10E5A000A2FB3946584610F06FFA40B105F1200839 -:10E5B00040460DF133011FF0EDF9074650B9069BB7 -:10E5C000013347E79DF83430012B18BF03238DF842 -:10E5D0005A30D7E795F8683069886BB13A46C9B2C6 -:10E5E00005F130001FF0C1F995F83830013385F896 -:10E5F0003830FFF7FBFBDBE705F12C093B464846CB -:10E600000E9A10F013F840B395F82C30E3B1012BBB -:10E61000CED1484610F02FF807460028C8D039461A -:10E620001CA812F056FD5F4BBDF87E20DB682199D7 -:10E630000B93688F2346DDF82CC0E04738461FF067 -:10E6400091F9FFF7E1FBE4E722AB03EB460232F876 -:10E650003C3C013322F83C3CAAE738461FF082F9E3 -:10E66000A6E7012385F82A309DF818309AF818207B -:10E6700001339342A3D14146584610F005FA0028D1 -:10E680004FD005F12008404616A91FF083F9074630 -:10E69000002894D095F8683069886BB13A46C9B2C1 -:10E6A00005F130001FF061F995F83830013385F835 -:10E6B0003830FFF79BFBE6E705F12C093B4648465F -:10E6C0000E9A0FF0B3FF40B395F82C30E3B1012B55 -:10E6D000D9D148460FF0CFFF07460028D3D039469E -:10E6E0001CA812F0F6FC2F4BBDF87E20DB682199A8 -:10E6F0000B93688F2346DDF82CC0E04738461FF0A7 -:10E7000031F9FFF781FBE4E722AB03EB460232F875 -:10E710003C3C013322F83C3CB5E738461FF022F977 -:10E72000B1E71F4B9B699B037FF549AF1E4B059AD1 -:10E73000134493F8A830002B7FF441AF08F032FC6B -:10E74000814600283FF43BAF6B881422ADF8583067 -:10E750004FF481734146A0F10A0717A8ADF85A306B -:10E7600025F0DBFA0E9B3846ADF86430022316A97B -:10E770008DF86830189412F0F4FC95F86830ABB15D -:10E780004A46A97805F130001FF0EFF895F83830C7 -:10E79000013385F83830FFF729FB10E7843A002170 -:10E7A00020500021904A0021F807002105F12C0992 -:10E7B0003B4648460E9A69880FF038FF00283FF420 -:10E7C000D3AE95F82C30F3B1012B7FF4F8AE484668 -:10E7D0000FF051FF074600283FF4F1AE39461CA860 -:10E7E00012F077FC5F4BBDF87E20DB6821990B931C -:10E7F000688F2346DDF82CC0E04738461FF0B2F89A -:10E80000FFF702FBE3E722AB03EB460232F83C3CA6 -:10E81000013322F83C3CD2E6B8F1000F3FF4CFAE12 -:10E8200095F82C3023B1012B19D095F868304BB3F3 -:10E83000BAF806306A88CDE9014398F801305846A5 -:10E84000009305F13001434610F094F922AB03EB3D -:10E85000460333F83C2C104423F83C0C12E0BAF881 -:10E8600006306A88CDE9014398F801305846009394 -:10E8700005F13001434610F07DF9284608F0A8FB69 -:10E88000074618B9404608F0B6FB98E639461CA87A -:10E8900012F01FFC334BBDF87E20DB6821990B93EF -:10E8A00068882346DDF82CC0E04738461FF05AF848 -:10E8B000FFF7AAFAE1E7002288336B4423F83C2CE7 -:10E8C000E5E5079B53F8044B07936CB194F8683067 -:10E8D00053B194F86930002B3ED104F1580820461A -:10E8E00008F076FB054608B90136FFE529461CA865 -:10E8F00012F0EFFB9AF81E30012B25D194F86A3004 -:10E900006BB1219A937851781B0403EB01231178A2 -:10E91000D2780B4403EB0263E36684F86A70E26E1C -:10E92000531CE36694F870300192BAF806209DF803 -:10E930007E102198009242460FF0ACFF28461FF04F -:10E9400011F8FFF761FACAE79AF8183094F86C20CA -:10E95000099901FB0322E5E7A4F8687084F86A705E -:10E96000E766C1E7904A002110B50446B0220021B5 -:10E97000034825F0D2F92046BDE81040FFF738BC27 -:10E98000F807002113B590F8343313B1184B1B6806 -:10E990005BBB184BDA69019253780233ADF8003053 -:10E9A00090F8A23011789B0003F01C0321F01C01A9 -:10E9B0000B431370019A137823F02003137090F81F -:10E9C000343353B10C4B1C683CB1D0E90831027EA2 -:10E9D000A3FB020302FB0131A047002301211A46D9 -:10E9E0006846F6F705F802B010BD044AD3E700BF49 -:10E9F000883A0021C8080021A43A0021A808002173 -:10EA00002DE9F047234F04463B7897F801C003F106 -:10EA10000E0250F82250902043431820FA781E4EE0 -:10EA20000CEB020100FB01331E44F36873B37369FE -:10EA3000002B14BF4FF003084FF0020894F8343352 -:10EA40009BB1164B1B6883B1D4E9080194F818A058 -:10EA500094F81AE0A0FB0A090AFB019110EB0C00E4 -:10EA600041F10001E2FB0E019847D7E90523D4F8F4 -:10EA7000CC1030460A444146F5F7BAFF05F178005C -:10EA80001DF0E1F985F8B100BDE8F0874FF001080D -:10EA9000D4E700BFC8080021E8080021A43A0021FB -:10EAA0002DE9F3479025182316464D4303FB0255E5 -:10EAB000DFF8A48000EB810908EB050A07460C4645 -:10EAC00052463146D9F8380008F02EF900283AD0DD -:10EAD0003B7E224DB34217D9BB7E6BB1D9F83800CB -:10EAE000711C0DF10702C9B208301EF062FF38B187 -:10EAF00090F90C30002B03DA2A19937B01339373BE -:10EB00002A19137A01331372902118224C4302FB05 -:10EB100006444444616897F8A2300A789B0022F0CA -:10EB20001C0203F01C0313430B70EA69636832B1E3 -:10EB30001A7842F020021A7002B0BDE8F0871A7805 -:10EB400022F02002F7E7064BCAF80C00CAF804309E -:10EB5000022328F80530EFE7E8080021C808002163 -:10EB6000CE080021012973B5456A04D102B0BDE881 -:10EB700070401EF08FB81A4C95F8343022789A42C3 -:10EB8000F4D22146284608F083FB40B9E369002B04 -:10EB9000ECD0284602B0BDE87040FFF7F3BED4E9E0 -:10EBA000000100908DF804102846694608F070FBBB -:10EBB00078B19DF800300E3355F82330B0332A6B0E -:10EBC000A3616369284613446361FFF719FF02B02C -:10EBD00070BDE369002BF2D005F52E73EFE700BF9F -:10EBE000C8080021012973B5456A04D102B0BDE807 -:10EBF00070401EF04FB8194C6B7E22799A42F5D2C4 -:10EC00002146284608F081FB40B9E369002BEDD08E -:10EC1000284602B0BDE87040FFF7B4BED4E9000159 -:10EC200000908DF804102846694608F06EFB78B114 -:10EC30009DF800300E3355F82330B033EA68A361F5 -:10EC40006369284613446361FFF7DAFE02B070BDC2 -:10EC5000E369002BF2D005F52E73EFE7C808002119 -:10EC60002DE9F743674D446A20220021284625F00C -:10EC700054F8E37F012B70D194F83430012B64D920 -:10EC8000E36BB033AB61E3680DF1020120466B61C9 -:10EC900008F06BF99DF80230E861012B08BF94F889 -:10ECA000A2304FF0000604BF013384F8A2300038D0 -:10ECB0004FF0010318BF01208DF8043094F8A23002 -:10ECC0008DF8060001A950488DF805308DF80760D1 -:10ECD00012F09EF9204632463146FFF7E1FE20460B -:10ECE000FFF78EFE94F83430B3425AD8A37E002B3F -:10ECF00040F0848094F85C1029B90123204684F800 -:10ED00005C3009F007FAE969E1B1D4E90836257EFB -:10ED10003E4AA3FB053005FB0600C2E9003094F82B -:10ED20003433C4F81C236BB1394B1D6855B14E7890 -:10ED30003848B21C24F0CAFF374A04F53F709319D3 -:10ED4000911EA84703B0BDE8F083637E012B01D973 -:10ED5000A36B96E704F52E7394E7637E012B04D929 -:10ED6000A36BB033AB61236B8EE794F83430012B87 -:10ED700001D9E36BF5E704F52E73F3E756EA0703D1 -:10ED800004D041462046FAB2FFF78AFE0137227EC0 -:10ED9000BA42F3D8E77E637E5743BB4205DC0136B7 -:10EDA000A0E700275FFA86F8F1E74FF00008DF1BC5 -:10EDB0005FFA86F9B845F2D0227E494642442046A1 -:10EDC000D2B2FFF76DFE08F10108F3E7394680F88B -:10EDD0000D9058F826004F1C0DF103020830FFB2C9 -:10EDE0001EF0E7FD0028F1D13946013694F83430A1 -:10EDF000B3427FF67FAF04F13808EAE700263146D8 -:10EE0000B146F3E7C8080021CE080021480C0021D4 -:10EE1000883A0021A8080021AA0800212DE9F04F16 -:10EE200006460125446A87B004F138074FF0000810 -:10EE3000DFF8349294F83430984518D3204608F01F -:10EE4000CFF9204608F0A2F86378012B22D094F87D -:10EE5000A0309B0704D504F154001EF03BFFC8B15D -:10EE60000421204607B0BDE8F04F09F0B9B919F800 -:10EE7000011B49B157F8280080F82050A37E33B118 -:10EE800099F8052008F00EF808F10108D2E707F01C -:10EE9000C8FFF9E7D4E90832013342F10002C4E9BE -:10EEA00008322269B36820461344B360726107F0E8 -:10EEB00029FE94F8A03063B994F8A130D80747D55B -:10EEC000022123F0010384F8A130204609F088F9DB -:10EED0001DE0D9071BD5228CB4F8A810013292B2DC -:10EEE000914214D123F0010384F8A0302046D4E9E4 -:10EEF0002C2307F031FE216D29B1D4E92C23C1E97F -:10EF00003A2381F8B85094F8A030002BD4D00021D7 -:10EF100030461EF085F8002888D04FF0000904F133 -:10EF20003808C246CB4694F83430994522D25AF874 -:10EF3000045B95F8683043B195F86930002B3CD1FB -:10EF4000A77F67BB237EBB420AD809F10109EAE724 -:10EF50009A07DCD523F00203032184F8A130B4E73B -:10EF6000226A95F8701002FB03736888E2880FF03C -:10EF700047FD80B9236D2BBBA37F012B6CD03B4B8E -:10EF800093F84730002B6BD0216AA07807B0BDE81A -:10EF9000F04F0EF0C3BF0EF0FBFC0137D2E7EB6E73 -:10EFA00095F870105A1CEA666888E2880FF028FD10 -:10EFB0000028DFD00EF0ECFCC7E7A5F868B0C5F874 -:10EFC0006CB0C2E7B268C3F8BC20207ED4E9082543 -:10EFD000A2FB002100FB0511C3E93E21CCE758F854 -:10EFE000046B337FE3B10FF04DFD06F1140A0546C3 -:10EFF00058B318220021684624F08FFE73882946F2 -:10F00000ADF80030736850469A880FF06DFC80B2FE -:10F01000ADF80E0050B12A466946304607F0BCFDF7 -:10F02000013794F834309F42D9D3A8E728461EF020 -:10F0300099FCF5E71EF096FC1EF044FC99F80030B0 -:10F04000013389F800301EF049FC694650461EF035 -:10F05000A1FC0028EED1E3E70027DFF81490E0E7F9 -:10F0600007B0BDE8F08F00BFD0080021205000217C -:10F07000DC50002110B5044620220021034824F072 -:10F080004CFE2046BDE81040FFF7C8BEC80800216E -:10F0900010B590F8F7200346012A19D090F8EE2019 -:10F0A00090F8F510514011F0010132D1B3F82C4124 -:10F0B00090F8F80004340132A042D2B20ADDD3E95C -:10F0C0000C04013044F10004C3E90C0483F8EE2081 -:10F0D00000201DE010B993F8F31059B910490968E0 -:10F0E00031B1D3E90C10013140F10000C3E90C103B -:10F0F000012006E0D3E90C14013144F10004C3E916 -:10F100000C1483F8EE20D3F820310BB101225A7091 -:10F1100010BDD0F854230132C0F85423D8E700BF03 -:10F12000A03A0021002310B580F8F23080F80E31AB -:10F1300004460FF0BFF920B194F8FD32013384F892 -:10F14000FD3210BD38B590F8462090F8F4300446F2 -:10F15000534013F001050CD090F80E31013280F8C5 -:10F16000462043B1FFF7DEFFD4F814310BB1012282 -:10F170001A70284638BD90F8FD32013380F8FD3210 -:10F18000F2E790F80D310BB9837F0BB10FF0B2B9F4 -:10F19000704700000023F0B5046F89B084F8F130A7 -:10F1A00084F8F23094F8D832D4F81471012B0CBFE3 -:10F1B0000223002384F8ED3094F8463084F8EF30D1 -:10F1C000584B9B6903F0805CDB0008D494F81C3139 -:10F1D0002BB994F8283113B9012384F8F03051EA9F -:10F1E00002004FF000031BD0657F02AE012D19D144 -:10F1F00084F8ED3084F8EF3004F1ED014A4884F8EA -:10F20000F15012F01BF8494B93E8030086E8030025 -:10F2100030462946F5F740FCBDF8080084F80F5148 -:10F2200009B0F0BD84F80F31BCF1000F11D094F893 -:10F230001C31012B0BD1FB78BA780133934208D1F2 -:10F2400094F828312BB9012384F8F03001E0002B29 -:10F25000F6D0314620460FF0F5F80546002842D09A -:10F26000039A537884F8F230012384F80E3113782E -:10F2700003F0F303137094F8EE10890001F0040119 -:10F280000B435BB2137094F8EF10C90001F0080152 -:10F290000B43137094F8F010090101F010010B43B7 -:10F2A000137094F8F110890101F040010B431370C1 -:10F2B0001F4B1B682BB194F8942112B1D4E90A01B9 -:10F2C000984730462946F5F7E7FB039B227F58789D -:10F2D00094F8EC3202309A42A2D1D4F8443301338C -:10F2E000C4F844339CE794F8D83284F8F200012B38 -:10F2F00008BF022504F1ED010B4884F8ED5011F030 -:10F300009DFF6B46094A92E8030083E80300184614 -:10F310000121F5F7C1FB0123BDF8000084F8643337 -:10F320007EE700BF20500021500C0021344E030125 -:10F33000A43A002170B590F80C6104460D4626B938 -:10F3400019B108460FF030F9354604F5907009F010 -:10F3500083FDA0B9D4F82031B4F8E8229968A67AE0 -:10F36000D878891AD4E9B832002E18BF13462289FA -:10F3700003FB00112846BDE870400FF019B970BDBD -:10F380000023D0F82021037780F8613080F8FD3227 -:10F3900080F8FE3202B11371D0F814311BB1002293 -:10F3A0001A719B785BB9012343770023A0F8F030F2 -:10F3B000A0F8F63080F8F83080F8F33070474277E4 -:10F3C000F3E770B500F590750446284609F044FD52 -:10F3D000002858D1D4F820315A78EAB10120DA78DF -:10F3E00099180244C876DA7094F8FE22024484F830 -:10F3F000FE229A7803F11B010F2A28BF0F22C3F1C6 -:10F40000FF2303F57F03E5335818904237D328468E -:10F41000BDE8704009F068BC9A79597901328A4296 -:10F42000E7D1D97818795E18327B9042E1D194F80F -:10F43000EE20013284F8EE20D4E90C20013240F1B4 -:10F440000000C4E90C2001221144F276D970B4F80E -:10F45000701384F86E231144A4F87013D4F8301399 -:10F460001144C4F8301394F8FE12114484F8FE12CB -:10F4700094F8D8120029BCD184F88223B9E711F896 -:10F48000010B0028C0D170BD38B504460FF07EF8DE -:10F49000054688B10A4B1B682BB194F8952112B12F -:10F4A000D4E90C019847B4F82C112846BDE838403F -:10F4B000063189B2F5F726BBBDE838401DF0EABB3E -:10F4C000A03A0021F0B5C37D054699B02BB109F0F3 -:10F4D0004FFB40F2E24604460CB919B0F0BD94F877 -:10F4E000F412A9B194F8EA22A88A571E4743D5F826 -:10F4F0000CC0286B94F8EC32604406FB07000090C7 -:10F5000002A809F049F902A904F58A7009F0DAFBAA -:10F5100094F8F51299B1AF8A286B94F8EC3206FB97 -:10F520001700D4F8E47294F8EB22384400900DA848 -:10F5300009F032F90DA904F5907009F0C3FB2046DB -:10F54000FFF71EFF2146284609F044FB0446C3E7A7 -:10F55000F8B500F590770446384609F07DFC0028A0 -:10F5600041D1D4F820311A46CAB998786FF01A0CF4 -:10F570000F2803F11B0528BF0F202A464FF0010E6C -:10F58000ACEB030C0CEB020188420DD80CEB05032D -:10F59000984224D83846BDE8F84009F0A5BB9179D7 -:10F5A00001319171D26ADFE71178B1B99E79597949 -:10F5B0008E4212D182F800E094F8EE10013184F806 -:10F5C000EE10D4E90C16013146F10006C4E90C1620 -:10F5D000D9780131D97084F86EE30132D2E715F899 -:10F5E000013B002BD2D1F8BD2DE9F04700F58A7719 -:10F5F0000446384609F030FC002849D1D4F81451AB -:10F600002B46C3B96FF01A0805F11B06B2464FF03E -:10F610000109A8EB0508AB7808EB0A020F2B28BFFD -:10F620000F2393420CD83344B3422DD13846BDE862 -:10F63000F04709F059BB9A7901329A71DB6AE0E729 -:10F640001AF8013B002BE6D1AA796B799A42E2D1F4 -:10F6500094F846302046013384F846300AF8019C7D -:10F660000EF01BFF28B12046FFF75CFD20460EF090 -:10F6700041FFEB780133EB70D4E90A32013342F1F8 -:10F680000002C4E90A32C6E716F8012B002ACBD1E2 -:10F69000BDE8F087F8B500F58A760446304609F0F3 -:10F6A000DBFB002865D194F8F130002B61D1D4F850 -:10F6B00014512B78F3B10121EB78EA180B44D17681 -:10F6C000EB70D4E90A325B1842F10002C4E90A3255 -:10F6D000AB7805F11B020F2B28BF0F23C5F1FF25C7 -:10F6E00005F57F05E535A9188B4238D8304609F075 -:10F6F000FBFA38E0D4F83C330133C4F83C33AB793F -:10F700006A790133934224D1EB7829792B441A7B0F -:10F7100091421ED10127DF7694F8463020463B44C3 -:10F7200084F846300EF0B9FE18B12046FFF7FAFC17 -:10F73000A777D4E90A32013342F10002C4E90A3260 -:10F74000EB780133EB70D4F840330133C4F8403325 -:10F75000BEE7D4F848330133C4F84833B8E712F8A9 -:10F76000011B0029BFD1304609F076FB08B1012307 -:10F770006377F8BD2DE9F04F456A81462C6FAA7872 -:10F780008846D4F8087194F8F03099B0002A40F017 -:10F790008580002B61D0637F002B5ED0237F5A1CB5 -:10F7A00094F8EC329A4202DA9B1A03FB077721465F -:10F7B000284609F00FFA0446002800F0D380B0F87C -:10F7C0004A30002B40F0CE8090F84730002B40F0BC -:10F7D000C98090F8F412B9B190F8EA2290F8EC32AE -:10F7E000A88A561ED5F80CC04643286B604440F2E8 -:10F7F000E24C0CFB0600009002A808F0CDFF02A925 -:10F8000004F58A7009F05EFA94F8F512A9B140F295 -:10F81000E24CAE8A286B94F8EC320CFB1600D4F85C -:10F82000E46294F8EB22304400900DA808F0B4FF95 -:10F830000DA904F5907009F045FA2046FFF7A0FDE8 -:10F84000012388F8003004F59C73C9F82C302C672C -:10F8500094F8E03084F839311CE0B4F84A30002BD9 -:10F86000A5D194F84730002BA1D1237F94F8EC2246 -:10F870000133DBB29A42237702D10123237696E744 -:10F8800094F8F63013B1012384F8F03094F8E130A5 -:10F8900084F83931384619B0BDE8F08FD4F8F0A2B9 -:10F8A00094F8E16013B10123237606E0B4F84A30FE -:10F8B0008BB12146284609F0DFF9284609F049F9BD -:10F8C000012815D1284609F0BAF900284AD157462F -:10F8D00084F83961DEE7237F94F8EC220133DBB250 -:10F8E0009A422377DFD094F8F630002BE5D0DAE7A0 -:10F8F0002146284609F06EF983462846BBF1000FE1 -:10F9000006D109F09CF968BB012388F80030C1E7F3 -:10F9100009F095F9064628BBBBF84A30002BF3D016 -:10F920005946284609F0A8F9284609F02EF9286713 -:10F9300090F8E130044680F8393100F59C73C9F83D -:10F940002C3001232B762146284609F043F930B1AB -:10F95000834504D0D4F8083104461E44F3E7AAEBEB -:10F96000060797E70123284688F8003009F076F962 -:10F9700000278FE70023F0B5456A99B02C6F2B76EE -:10F9800094F8F412B1B194F8EA22A88A561EEF68EE -:10F990004643286B94F8EC32384440F2E24707FBC8 -:10F9A0000600009002A808F0F7FE02A904F58A708C -:10F9B00009F088F994F8F512A9B140F2E247D4F8B9 -:10F9C000E462286B94F8EC323044AE8A94F8EB226F -:10F9D00007FB160000900DA808F0DEFE0DA904F547 -:10F9E000907009F06FF92046FFF7CAFC0021012250 -:10F9F0002846FFF7CFFB1DF057F910B92046FFF757 -:10FA000043FD19B0F0BD406A10B501220021046F1A -:10FA1000FFF7C0FB1DF048F920B92046BDE81040B3 -:10FA2000FFF732BD10BD436A10B51C6F04F1A8008A -:10FA30001CF009FA84F8E10010BDF0B50B78064619 -:10FA400099B0F3B1456AAF78012F1AD12846296FD2 -:10FA500009F0C0F80446B8B9284609F096F800F550 -:10FA60009C732F76F362286790F8E130027F80F86C -:10FA7000393190F8EC329A4203D800213046FFF732 -:10FA8000D2FF002019B0F0BD2B7E002B36D190F8AC -:10FA9000F412B9B190F8EA2290F8EC32A88A571E15 -:10FAA000D5F80CC04743286B604440F2E24C0CFB95 -:10FAB0000700009002A808F06FFE02A904F58A7002 -:10FAC00009F000F994F8F512A9B140F2E24CAF8ABE -:10FAD000286B94F8EC320CFB1700D4F8E47294F81D -:10FAE000EB22384400900DA808F056FE0DA904F54D -:10FAF000907009F0E7F82046FFF742FC04F59C738C -:10FB0000F3622B7E2C6723B994F8E03084F8393106 -:10FB1000B7E794F8E130227F84F8393194F8EC3279 -:10FB2000A9E770472DE9F04F456A064689B0284697 -:10FB300009F01EF84FF000080446DFF854923CB973 -:10FB4000EB7D002B4FD102236B7009B0BDE8F08F25 -:10FB500094F8D8327BB994F86E2322B1204684F809 -:10FB60006E3309F0A3FA94F8103123B1204684F8DB -:10FB7000108109F037FB4FF49563E7885F43854BAD -:10FB8000D3F800B0637E0BEB070A012B06D01BF8FD -:10FB900007301BB199F80030012B15D1204609F030 -:10FBA000C1F899F8003043B9E17E99B11622E376A5 -:10FBB000E27700212046F8F71DF984F819802B78A8 -:10FBC00013B1EB7D013BEB752146284609F002F8A5 -:10FBD0000446B4E71BF80730002BEAD19AF810204E -:10FBE000A370E277E5E7284608F0CFFF0446DFF888 -:10FBF000A881DFF8A891002C40F0C180284608F0C9 -:10FC0000C4FF6B7E012B0DD16C76B368EA69134497 -:10FC1000B36000F59C73EC61F362286790F8E03004 -:10FC200080F83931DFF86C91DFF8748140F2E241FD -:10FC30006B6AAA8A284601FB02336B6208F098FFC0 -:10FC40004FF4956A0446E388D9F80070B4F84A2066 -:10FC50000AFB0377002A40F03B81E18904F1A80BFD -:10FC6000013189B20123E18158461CF09FF884F8E4 -:10FC7000390184F8E00058461CF0E5F894F8183390 -:10FC800084F8E100002B40F00F8194F8D432032B6C -:10FC900040F01C8194F84621013A18BF01229B1ABA -:10FCA0003B4493F8503284F83A3194F8D832012B1F -:10FCB00020D194F86033EBB10EF0E4FE8346C8B176 -:10FCC0000146B4F8302104F556700EF00DFE002305 -:10FCD000ADF816008DF80B301DF0F4FD98F80030EB -:10FCE000013B88F800301DF0F9FD5A46204602A974 -:10FCF0000EF010FB2146284608F06CFF0446002851 -:10FD0000A1D197F885332846A3F10B025342534102 -:10FD1000337608F03AFF6A6AD0E904310A44D21A0D -:10FD2000B260EA680746134440F2E2425B1AF360AD -:10FD3000AB8A21465343304673611DF071F90028A8 -:10FD400040F0CA80706AFFF7BDFBB7F84A305BB974 -:10FD5000FB8938460133FB81FFF746FC3846FFF745 -:10FD6000F7FBFB89013BFB813946284608F032FF4F -:10FD700007460028E9D1284608F0FAFE56E7B4F80D -:10FD80004A307BB12146284608F024FF044632E77A -:10FD9000000D0021B43A0021B05000219C3A00210E -:10FDA000DC5000215A4B2046D3F800A0B4F806B02E -:10FDB000FFF71AFC2046FFF7CBFB94F8D83283B943 -:10FDC00094F86E2322B1204684F86E3309F06EF960 -:10FDD00094F810312BB10023204684F8103109F03B -:10FDE00001FA94F8CA7294F86130002F3ED16BB3D7 -:10FDF000B4F8C81204F52E701DF0C5FF012384F875 -:10FE0000CA3298F801305BB16E212046F8F7A8F8A5 -:10FE100020460AF0DDFC394620466269F8F71AF8F8 -:10FE200094F8CB3293B1D9F800707FB1A37AD3B9EB -:10FE300094F8D41201224FF49560364B00FB0BA0CE -:10FE40001B6893F9283000920022B84794F8FC32DE -:10FE5000ABB1E08809F006F8002893D004212046D1 -:10FE6000F8F77EF88EE794F8D512E3E7002BEDD093 -:10FE7000B4F8C81204F52E701DF085FFE6E7E3899B -:10FE8000062BE6D16E212046F8F76AF820460AF0E4 -:10FE90009FFC2046F8F788F805212046F8F74AF835 -:10FEA000EB7D012BD5D150E6D4F8E0B26B6AD4F8E3 -:10FEB0001C239B1A5B45FFF4E8AE204609F0C6F808 -:10FEC000D4F81C335B44C4F81C33EFE70122E6E6A8 -:10FED000013AA4F84A200DE7284608F056FE2867A4 -:10FEE00000F59C70F062284608F04FFE0A4B286728 -:10FEF00000F59C70F06293F84730002B3FF425AE7C -:10FF00002146287A09B0BDE8F04F0EF007B800BFCF -:10FF1000B43A0021DC4D00212050002110B50446E8 -:10FF2000406AFFF7CFFA2046BDE81040FFF7FABD60 -:10FF3000436A1B6FD3F8143113B11A7901321A7165 -:10FF40007047000070B50E464FF49561436A154640 -:10FF50001C6F454BE2881B6801FB0233D4F8142167 -:10FF60000AB100211170D4F8202122B11179013198 -:10FF70001171002151700022032DA4F80C21A277E9 -:10FF800084F86E231BD0C26A042D92F8B82084F83E -:10FF9000EC200FD0022D12D130460EF005FB20468A -:10FFA000FFF778FB2046FFF70CFA2046BDE87040CB -:10FFB000FFF7E7B8D4F84C230132C4F84C23D3F848 -:10FFC000182422F07F4222F0FF02B2F5803F0BD1CD -:10FFD00094F9EC10D3F84824521AC3F8482493F843 -:10FFE0004524013283F84524042D09D8DFE805F0C3 -:10FFF000032D08202D00012384F8FC3284F86130A1 -:020000040101F8 -:10000000314604F1F30011F038F9062D21D194F8AE -:10001000F53094F8EE205340DB071AD429462046E9 -:10002000F7F788FF30460EF0BFFA1CF033FEB6E754 -:100030000023A4F80C31D4F850330133C4F8503302 -:1000400031462046FFF776F9A9E70023A4F80C31E2 -:10005000F6E72046FFF71CF884F80C012046FFF76E -:1000600071F884F80D01EBE7B43A00210322002374 -:1000700080F8A320D0F82021A0F8A030037780F8E2 -:10008000FD3280F8FE3202B11371D0F814311BB189 -:1000900000221A719B785BB9012343770023A0F8F3 -:1000A000F030A0F8F63080F8F83080F8F330704780 -:1000B0004277F3E770B500F590750446284608F0DE -:1000C000CBFE00285ED1D4F820315A78EAB1012065 -:1000D000DA7899180244C876DA7094F8FE2202445D -:1000E00084F8FE229A7803F11B010F2A28BF0F2201 -:1000F000C3F1FF2303F57F03E533581890423DD346 -:100100002846BDE8704008F0EFBD9A795979013270 -:100110008A42E7D1D97818795E18327B0132904251 -:10012000E0D1D4E90C20013240F10000C4E90C20F8 -:1001300001221144F276D97094F8EE1084F86E23FF -:10014000114484F8EE10D4F850131144C4F850133D -:10015000B4F870131144A4F87013D4F83013114498 -:10016000C4F8301394F8FE12114484F8FE1294F887 -:10017000D8120029B6D184F88223B3E711F8010B15 -:100180000028BAD170BD000038B504460EF0FEF963 -:10019000054688B10A4B1B682BB194F8952112B122 -:1001A000D4E90C019847B4F82C112846BDE8384032 -:1001B000063189B2F4F7A6BCBDE838401CF06ABD30 -:1001C000A03A0021F0B5C37D054699B02BB108F0E7 -:1001D000CFFC40F2E24604460CB919B0F0BD94F8E9 -:1001E000F51299B1AF8A686A94F8EC3206FB1700F1 -:1001F000D4F8E47294F8EB223844009002A808F096 -:10020000CBFA02A904F58A7008F05CFD94F8F412A8 -:10021000A9B194F8EA22A88A571E4743D5F80CC022 -:10022000686A94F8EC32604406FB070000900DA861 -:1002300008F0B2FA0DA904F5907008F043FD2046CD -:10024000FFF714FF2146284608F0C4FC0446C3E724 -:10025000F8B500F590770446384608F0FDFD002813 -:1002600046D1D4F820311A46CAB998786FF01A0CE2 -:100270000F2803F11B0528BF0F202A464FF0010E5F -:10028000ACEB030C0CEB020188420DD80CEB050320 -:10029000984229D83846BDE8F84008F025BD917944 -:1002A00001319171D26ADFE71178D9B99E79597914 -:1002B0008E4217D182F800E0D4E90C16013146F1E4 -:1002C0000006C4E90C16D9780131D97094F8EE1003 -:1002D00084F86EE3013184F8EE10D4F83013013164 -:1002E000C4F830130132CDE715F8013B002BCDD116 -:1002F000F8BD2DE9F04700F58A770446384608F046 -:10030000ABFD002849D1D4F814512B46C3B96FF086 -:100310001A0805F11B06B2464FF00109A8EB0508C3 -:10032000AB7808EB0A020F2B28BF0F2393420CD89F -:100330003344B3422DD13846BDE8F04708F0D4BC71 -:100340009A7901329A71DB6AE0E71AF8013B002BD7 -:10035000E6D1AA796B799A42E2D10AF8019C94F825 -:1003600046302046013384F846300EF096F828B126 -:100370002046FEF7D7FE20460EF0BCF8EB7801339E -:10038000EB70D4E90A32013342F10002C4E90A32C7 -:10039000C6E716F8012B002ACBD1BDE8F087F8B5E7 -:1003A00000F58A760446304608F056FD002865D1EF -:1003B00094F80F31002B61D1D4F814512B78F3B19C -:1003C0000121EA78AB18D976D4E90A31013341F139 -:1003D00000010132C4E90A31EA70AB7805F11B0271 -:1003E0000F2B28BF0F23C5F1FF2505F57F05E53548 -:1003F000A9188B4238D8304608F076FC38E0D4F89B -:100400003C330133C4F83C33AB796A79013393420E -:1004100024D1EA782979A818037B99421ED10127B3 -:1004200094F846303A44013384F84630D4E90A312E -:10043000013341F10001C4E90A31C776EA70D4F80A -:10044000403320463B44C4F840330EF026F80028E1 -:10045000C3D02046FEF766FEA777BEE7D4F8483340 -:100460000133C4F84833B8E712F8011B0029BFD1A3 -:10047000304608F0F1FC08B101236377F8BD2DE99F -:10048000F04F456A83462C6FAA7894F8A3908A4669 -:1004900094F8F630D4F8F0829BB009F0FB09002AFA -:1004A00040F08C80267F0136F6B22677ABB994F8FF -:1004B000F0300BB1637F83B9B4F84A306BB994F86C -:1004C000EC32B34209D094F8E13084F8393108F1C4 -:1004D000FF360223C4F80032E3E02746D4F8F832AE -:1004E00003933946284608F075FB074678B9284635 -:1004F00008F04BFB0123286700F59C70CBF82C001B -:1005000028468AF8003008F0A9FB0026C9E0B7F8B1 -:100510004A30002BE5D197F8F512B1B140F2E24E26 -:10052000B5F814C0686A97F8EC320EFB1C00D7F8D7 -:10053000E4C297F8EB226044009004A808F02CF97C -:1005400004A907F58A7008F0BDFB97F8F412C9B149 -:1005500097F8EA22A88A02F1FF3CD5F80CE00CFBE0 -:1005600000FC686A97F8EC32704440F2E24E0EFBF1 -:100570000C0000900FA808F00FF90FA907F5907074 -:1005800008F0A0FB039B3846013E08FB1636FFF738 -:100590006DFD01238AF80030D4F8F831C7F8F8313E -:1005A00007F59C73CBF82C302F6797F8E03087F86D -:1005B0003931B9F1000F74D1013E8AE7D4F80861EE -:1005C00094F8E17013B994F8F03013B10123237655 -:1005D00006E0B4F84A30B3B12146284608F04CFB97 -:1005E000284608F0B6FA012816D1284608F027FB5D -:1005F00000287FF47CAF84F83971B9F1000F3FF423 -:1006000066AF46464DE0237F94F8EC220133DBB21F -:100610009A422377E4D1D9E72146284608F0DAFA4E -:100620000746284647B908F00AFB00287FF45FAF69 -:1006300001238AF80030BCE708F001FB00287FF4B2 -:1006400056AFB7F84A20002AF2D039460390284620 -:1006500008F012FB284608F08BFA286790F8E12092 -:10066000039B80F8392100F59C72CBF82C200122E5 -:1006700006469A462A763146284608F0ABFA30B14B -:10068000874204D0D6F8083106469A44F3E7B9F118 -:10069000000F04D1022308F1FF38C4F80032A8EBA0 -:1006A0000A0630461BB0BDE8F08F70472DE9F04FC9 -:1006B000456A06468BB0284608F067FA90F8A030E5 -:1006C000044673B1B5F87420D0F89C30A5F87C20AE -:1006D0000269AB67134442699B1A6B62002380F87E -:1006E000A030DFF8D8B2DFF8D8924FF49563B4F8B1 -:1006F0000680DBF800A003FB08F894F8D8320AEB78 -:10070000080783B994F86E2322B1204684F86E332B -:1007100008F0CCFC94F810312BB10023204684F86B -:10072000103108F05FFD637E012B06D01AF8083007 -:100730001BB199F80030012B17D1204608F0F2FACE -:1007400099F8003053B9E27E002A00F0AA80162200 -:10075000E376E27700212046F7F74CFB002363762F -:100760002B7813B1EB7D013BEB752146284608F051 -:1007700031FA04460028B8D1EB7D002B00F01A8135 -:10078000284608F002FA4FF495690446DFF834A2CF -:10079000002C40F08E80284608F0F7F96B7E012B84 -:1007A00007D100F59C73F362286790F8E03080F879 -:1007B0003931B5F87480B5F87C30A8EB03081FFA1E -:1007C00088F8B5F87430B5F814A00133A5F8743082 -:1007D00040F2E24303FB0AFA08F101081FFA88F825 -:1007E000B5F87E100AFB08F002F07EFB8146284631 -:1007F00008F0BEF904464FEA5A030393002C40F078 -:10080000E780284608F0C1F940F2E243AA8A41692C -:100810005A436B6A824613446B62A3EB09030B4491 -:1008200001695B1AD0F8F01272612A6F49444FEAED -:100830004900B360F160C2F800026A7E012A04D167 -:10084000EA696C761344B360EC6197F885333046FF -:10085000A3F10B02534253415B4933761CF0E0FB9A -:10086000002840F04281706AFFF7ACFCBAF84A30C9 -:100870007BB9BAF80E3050460133AAF80E30FFF7B4 -:1008800038FD5046FFF7E4FCBAF80E30013BAAF8F9 -:100890000E305146284608F09DF982460028E5D1E1 -:1008A0008FE71AF80830002B7FF454AF3B7CE377D6 -:1008B00050E7E388DBF8007009FB0377B4F84A30AF -:1008C0002BB12146284608F085F9044660E720460A -:1008D000FFF70FFD2046FFF7BBFC94F8D83283B931 -:1008E00094F86E2322B1204684F86E3308F0DEFBC4 -:1008F00094F810312BB10023204684F8103108F011 -:1009000071FC94F8CA2294F8A130002A38D13BB384 -:10091000B4F8C81204F52E701DF035FA012384F8DE -:10092000CA3294F8CB3293B1284BD3F80080B8F197 -:10093000000F0CD0A37A03BB94F8D4120122DAF88A -:100940000030384693F9283000920022C047002139 -:1009500020466269F7F77EFA6E212046F7F700FB22 -:1009600094F8FC32ABB1E08808F07CFA0028A8D0FB -:1009700004212046F7F7F4FAA3E794F8D512DDE74F -:10098000002BEDD0B4F8C81204F52E701DF0FBF961 -:10099000E6E7E389062BE6D16E212046F7F7E0FA79 -:1009A0002046F7F701FB05212046F7F7C3FAEB7D58 -:1009B000012BD8D10BB0BDE8F08F00BFB43A0021B5 -:1009C000000D0021DC4D0021A18801019C3A00218D -:1009D0004FF49562E388DBF8007002FB0377B4F80C -:1009E0004A20002A7DD1E18904F1A80A013189B2A7 -:1009F0000123E18150461BF0D9F984F8390184F8CC -:100A0000E00050461BF01FFA94F8183384F8E10018 -:100A1000002B4DD194F8D532032B5AD194F84621AE -:100A2000013A18BF01229B1A3B4493F8503284F8D4 -:100A30003A3194F8D832012B1FD194F86033E3B1E6 -:100A40000EF020F88246C0B10146B4F8302104F51A -:100A500056700DF049FF0023ADF81E008DF81330DD -:100A60001CF030FF274A1378013B13701CF036FF4F -:100A70005246204604A90DF04DFC94F8EC32022BAE -:100A80002BD81CF039F9952825D91CF035F9039B92 -:100A9000181A484506D805212046F7F74BFAEB7D92 -:100AA000012B87D02146284608F094F80446A5E695 -:100AB000D4F8E4A2B368D4F81C239B1A5345A9D3F5 -:100AC000204608F0C3FAD4F81C335344C4F81C334E -:100AD000F0E70122A7E79620D9E7D4F8F0324B459A -:100AE000D8E7013AA4F84A20DCE7074B93F84730EF -:100AF000002B3FF45FAF0021287A0BB0BDE8F04F28 -:100B00000DF00CBADC5000212050002110B5044635 -:100B1000406AFFF757FB2046BDE81040FFF7C6BD0F -:100B2000436A1B6FD3F8143113B11A7901321A7169 -:100B300070470000F8B50E464FF495611546476AB8 -:100B4000574B3C6F1B68E28884F8A35001FB0233CB -:100B5000D4F8202122B11179013111710021517095 -:100B6000D4F81411002201B10A70032DA4F80C214D -:100B7000A27784F86E2310D0C26A022D92F8C420A6 -:100B800084F8EC2009D130460DF00EFD2046FFF729 -:100B900006FC2046FFF78EFA6DE0D3F8182422F009 -:100BA0007F4222F0FF02B2F5803F0BD194F9EC10A6 -:100BB000D3F84824521AC3F8482493F84524013244 -:100BC00083F8452494F8A02025F0040313432CD186 -:100BD000227FD4F8F012D4F8F43101FB1233C4F8B8 -:100BE0009C30012384F8A030FDB984F8FC32012345 -:100BF00084F8A130002384F8A230314604F1F300D8 -:100C000010F03BFB062D3FD194F8F53094F8EE2020 -:100C10005340DB0738D429462046F7F78BF9304696 -:100C20000DF0C2FC1CF036F8B0E7042DE5D801A3A6 -:100C300053F825F0EF0B0101810C0101FB0B0101C1 -:100C4000810C0101490C0101D4F84C330133C4F883 -:100C50004C330023A4F80C3131462046FEF76AFBE2 -:100C60002046FFF79CFB2046FFF724FA0122294685 -:100C70003846FEF78FFA2046BDE8F840FEF781BA05 -:100C80000023A4F80C317EE72046FEF701FA84F831 -:100C90000C012046FEF756FA84F80D01DCE700BF90 -:100CA000B43A00210023F0B5456A99B02C6F2B7639 -:100CB00094F8F512A9B140F2E247D4F8E462686A08 -:100CC00094F8EC323044AE8A94F8EB2207FB16001D -:100CD000009002A807F060FD02A904F58A7007F0F1 -:100CE000F1FF94F8F412B1B194F8EA22A88A561EE2 -:100CF0004643686AED6894F8EC32284440F2E245D5 -:100D000005FB060000900DA807F046FD0DA904F5AF -:100D1000907007F0D7FF2046FFF7A8F9FFF734FAE5 -:100D200019B0F0BD436A186FFFF72EBA436A10B5C9 -:100D30001C6F04F1A8001BF086F884F8E10010BDD8 -:100D4000F0B50B78064699B0F3B1456AAF78012F3C -:100D50001AD12846296F07F03DFF0446B8B9284646 -:100D600007F006FF00F59C732F76F362286790F872 -:100D7000E130027F80F8393190F8EC329A4203D8A2 -:100D800000213046FFF7D2FF002019B0F0BD2B7EC6 -:100D9000002B36D190F8F512A9B140F2E24CAF8A9F -:100DA00090F8EC3290F8EB22686A0CFB1700D4F84C -:100DB000E4723844009002A807F0EEFC02A904F5A2 -:100DC0008A7007F07FFF94F8F412B9B194F8EA2220 -:100DD000A88A571ED5F80CC04743686A94F8EC32CD -:100DE000604440F2E24C0CFB070000900DA807F0B5 -:100DF000D3FC0DA904F5907007F064FF2046FFF7BF -:100E000035F904F59C73F3622B7E2C6723B994F8B3 -:100E1000E03084F83931B7E794F8E130227F84F884 -:100E2000393194F8EC32A9E770B590F85C120446B9 -:100E3000A9B9284B1B6893B11B6983B1264A106876 -:100E4000264A201AC010504380B2984708B10020AB -:100E500070BDB4F84603BDE870400BF061B994F87A -:100E6000552294F85E02504010F00103EFD1B4F81F -:100E7000460394F86152061DB54203DD013284F841 -:100E80005522E4E71DB301390229F7D8144D6B78D8 -:100E9000002BDCD00BF044F90028D8D06B78013B54 -:100EA0006B70104B1B6863B194F8A5304BB194F88C -:100EB000A73033B9D4E9B632013342F10002C4E9B4 -:100EC000B63294F85532013384F85532C0E72846DB -:100ED000F7E700BFB83A0021B43A0021BDCAE28C5E -:100EE000B4500021A03A0021002310B580F85932F7 -:100EF00004460BF097F878B1084B1B6863B194F87F -:100F0000A4304BB194F8A73033B9D4E9B4320133EB -:100F100042F10002C4E9B43210BD00BFA43A00217E -:100F200010B590F8562290F85D32534013F001044A -:100F300011D090F85932013280F856226BB190F8F6 -:100F40005432032B05D190F87E3213B1013B80F867 -:100F50007E32FFF7C9FF204610BD80F87F32FAE7E6 -:100F60000BF088B870B504460E468AB031B990F8D7 -:100F70005F321BB990F85702104350D0FF23204630 -:100F800084F854320DF1070204A90AF0F1FF94F835 -:100F90007F320546002B69D1002867D09DF80730C5 -:100FA000002B3ED1A268910702F0020303D5A3787B -:100FB0005A1E53425341DBB2059984F857328DF8DB -:100FC00007304B7884F859320B7803F0030384F828 -:100FD000543243BB444B1B682BB39B681BB3434A3F -:100FE0001068434A201AC010504380B29847059BAE -:100FF0001878404BC0F340101B68861C3BB194F836 -:10100000A42022B194F8A72042B3012A2AD004A830 -:101010002946F4F7A3F8059B5878304480B20AB00B -:1010200070BD0123C7E70B7803F0E3030B7094F85E -:101030005522920002F0040213435BB20B7094F845 -:101040005622D20002F0080213430B7094F8572284 -:10105000120102F0100213430B70C8E7D4E9B40187 -:101060009847D4E70021B4F80602F9E72EB3003D13 -:1010700018BF0125002384F85752012584F85932FE -:1010800004F515711C4884F854520FF06BFB1B4A91 -:1010900002AB92E8030083E8030018462946F4F700 -:1010A0005DF894F87F32BDF80800B3FA83F35B096A -:1010B00084F8803284F87F52B1E794F85C32002BD8 -:1010C000D5D1094B1B68002BD1D0DB68002BCED0CB -:1010D000064A1068064A201AC010504380B298474A -:1010E0000028C4D130469AE7B83A0021B43A00212A -:1010F000BDCAE28CA43A0021540C00213C4E0301ED -:1011000070B504461E4608461546FAB1194BB4F8A8 -:1011100006121A68184BA21AD2105A4392B20BF058 -:101120000BF806B3154B1B683BB194F8A52022B110 -:1011300094F8A7206AB1012A0FD0B4F846132846C4 -:10114000BDE87040063189B2F4F73EB84BB10D46A8 -:10115000E8E7D4E9B6019847EFE70021B4F80602C2 -:10116000F9E729B10D462846BDE870400AF0E0BF16 -:1011700070BD00BFB43A0021BDCAE28CA03A002184 -:101180002DE9F843836806465B070F46144625D4CD -:101190001EF032FC81461BF0AFFD40F2E245804676 -:1011A000B369B6F80A0245435BB1394698681BF04B -:1011B000A9FDA84205D8B369394698681BF0A2FD7D -:1011C0000546394648461BF09DFD96344444044488 -:1011D000AC4294BF00200120BDE8F8830020FBE76B -:1011E0004378032B11D190F87F332BB190F8800313 -:1011F000003818BF0120704790F876333BB1D0F823 -:101200006C02B0FA80F0400970470020704701205E -:101210007047000070B5446A2046FFF7E1FF18B13F -:10122000BDE870401BF036BD224B1B684BB19B697B -:101230003BB1214A1068214A201AC010504380B2A5 -:101240009847002101221E4B84F85F12198084F810 -:10125000611284F85C22204659809980D980FFF77A -:1012600081FE1BF021FD064610BBB4F846030AF0D0 -:1012700057FF05460028D3D0124B1B683BB194F8AA -:10128000A52022B194F8A72052B1012A0CD0B4F8BD -:1012900046132846BDE87040063189B2F3F794BF83 -:1012A000D4E9B6019847F2E73146B4F80602F9E707 -:1012B00070BD00BFB83A0021B43A0021BDCAE28C2B -:1012C000580C0021A03A0021436A93F87F222AB1EA -:1012D00093F8802212B1002283F87F227047000029 -:1012E0002DE9F04F446A064694F89432C76A4E4D91 -:1012F00085B0002B78D12B88002B75D0237CB4F8D7 -:1013000082123E2B08BF082304F5217008BF237406 -:101310001CF039FD454B9B69D80503F4807112D44C -:10132000D4F8182422F07F4222F0FF02B2F5803F69 -:1013300009D103F400430B4305D04FF47A7104F252 -:1013400004401CF020FD012384F8943297F8A83063 -:1013500084F80C3294F81A34012B0BD194F80D3226 -:1013600013B1802384F80C3294F81934002B49D03F -:10137000012B54D0D4F83C343BB12D4A10682D4A8F -:10138000201AC010504380B2984794F894226B788A -:10139000134319D194F89632013BDBB284F89632AC -:1013A00093B904201CF0D6FA014668B1204B214ABB -:1013B0001B68E31ADB105343038044F2017343803C -:1013C0001D4B187B1CF0D7FA2046FFF709FF0028B9 -:1013D00036D020464C210AF043F804F5217005B0C0 -:1013E000BDE8F04F1CF0D5BC6B78002BAED0B4F844 -:1013F000821204F521701CF0C6FCB4F80632A4F881 -:101400000832A3E7D4F8203494F90C229B1AC4F8CC -:10141000203494F81E34013384F81E34AAE7074BB5 -:1014200020461B689847A5E7580C00212050002152 -:10143000B43A0021BDCAE28C68500021803A0021F4 -:10144000954BDFF858921B68002B00F00C81E88860 -:101450006A88A988003A014418BF0122204689B24F -:101460009847054660B1B4F80632411E0344A4F81B -:10147000063294F84532204659F8233089B298470D -:1014800094F8C8317BB30C200AF05CFD804650B361 -:101490000023B4F80422B4F85E04D11DB4F8062287 -:1014A00084F8C83101FB0022A4F8AA237C4A18461C -:1014B00011687C4A611AC91051430093B268C9B2DD -:1014C0001BF0F0F9784B04F56871A0FB0330DB0FDB -:1014D00043EA4003A4F8A23340460FF06DF94146B9 -:1014E00020460AF005FD94F8F4332BB3B4F8062235 -:1014F000B4F8FA339A421FD394F87633E3B9042050 -:101500001CF028FA014668B1654B664A1B68E31A6D -:10151000DB105343038046F601534380634B187B33 -:101520001CF029FAB4F8F633002B00F09E80B4F8D2 -:1015300006221344A4F8FA3394F8693363B1002304 -:1015400084F8693394F86A33002B40F09180584B4B -:101550001B680BB120469847B3680293FB7B0BB91D -:1015600097F8A930BB733B7B032B0AD1FB68514929 -:1015700003F0FF138B420CBF2246621E92F85332D7 -:10158000BB704FF0030A40F2E24CB4F80A82013516 -:10159000ADB208FB05F20CFB02F2B4F80632029978 -:1015A00001339BB21144A4F80632B160726194F821 -:1015B00085B3BBF10B0F5DD100223276B4F8AA23BC -:1015C0009A423FD1B4F8A633B4F80422B4F8A2E3A7 -:1015D000A4F80432E369B4F8A4130CFB0E33E361FE -:1015E00018F0030318BF0123A4F80A120CFB01F141 -:1015F000B4F8A803616200EB8000400008EB98019A -:1016000080B21944B4F882B20144A4F8820204F50D -:10161000217003921CF0B7FBB4F80A32039A4345D9 -:1016200007D1B4F80432934203D1B4F882325B4557 -:1016300005D0D4F8883343F40063C4F88833012319 -:1016400084F87E3394F845320021204659F823303F -:1016500098471949787030461BF0E2FC002892D078 -:1016600005B0BDE8F08F1D460AE784F8F43363E760 -:10167000124B6DE701229345327621D1B4F8D02385 -:101680009A42DFD1D4E9F2232046C4E9862309F047 -:1016900092FD84F87EB3D5E7083A00210C3A002188 -:1016A000B43A0021BDCAE28CE3361A00685000212A -:1016B000943A002103000100A9B60101903A0021EB -:1016C000BBF10F0FBED1B4F8DC239A42BAD194F823 -:1016D0005430022B03D0032B14BF0123042394F8AE -:1016E0005580B8F1020F06D0B8F1030F14BF4FF0C8 -:1016F00001084FF0040894F8DA13A9B3994233D0E3 -:1017000002294FF0010360D0042955D0194684F80E -:101710005430CB1A234493F95002D4F888337E28EE -:1017200043F400430A4684F84A00C4F888331BD1C6 -:10173000274B22441B68032993F9283084F84A3048 -:1017400082F84F32D4F8342308BF84F8533252075A -:101750000AD5204AD2F800B0BBF1000F04D0012214 -:10176000204600920022D84794F8DB337BB14345F2 -:101770000DD0022B03D0042B14BF0123032384F8C4 -:101780005530D4F8883343F40043C4F88833012338 -:1017900004F24E3184F87E3320460AF0C2FA04F295 -:1017A0004631A4F8600320460AF0BBFAB4F860336F -:1017B000A4F85E03236245E794F856300321013B09 -:1017C00018BF012384F854A0A3E784F85410A0E7BD -:1017D000DC4D00219C3A0021436A93F87F222AB114 -:1017E00093F8802212B1002283F87F225B7823B124 -:1017F0000022024B1A80FFF773BD7047580C00217E -:1018000051B90122436A83F8802393F859321BB1FE -:10181000024A938801339380704700BF580C00211F -:101820002DE9F14F446A814694F87E330F461646FF -:1018300084F80D22ABB1002384F87E3394F885330D -:10184000012B0AD1574B1A683AB1574B57481B68BE -:10185000E31ADB10584380B290476E21204609F00E -:10186000FFFD022E05D1384601B0BDE8F04F0AF069 -:101870005FBC2046FFF7B4FC054618B906F0FD032F -:10188000012B02D11BF006FAEDE7C6B94FF48072C6 -:10189000474B1A80394604F517700EF0BDFF062E2F -:1018A00017F800B02DD194F85E3294F855225340C9 -:1018B000DB0726D44821204609F0D2FDE2E7042EBA -:1018C000E8D13B4A13780133DBB2012B1370D9D82E -:1018D0008046D4E90232DB0843EA427383F0010216 -:1018E00002F001025FFA82FA3146204682F00102DC -:1018F000FFF738FBE0B11BF0D7F9B0FA80F56D09BE -:1019000030E094F861321BB1294AD3880133D38087 -:101910002046FFF789FA80462046FFF701FBB4F81E -:1019200060238246D9F808102046FFF729FC10B141 -:101930001BF0B0F916E086BB94F85C32032B2CD177 -:10194000BBF1050F29D194F87633012B25D194F8FA -:1019500085330D2B21D1204611F0E6FCE8B11BF0B8 -:1019600099F93546124A20465388BAF1000F18BF3C -:1019700001335380FFF7F4FA94F85C324246032BAC -:1019800008BF0023394608BF84F8803320462B4621 -:1019900001B0BDE8F04FFFF7B3BBBAF1000F98D02C -:1019A00001229FE7EC4D0021B43A0021BDCAE28C30 -:1019B000580C0021B0F806222DE9F8430446B0F88F -:1019C000CA51B0F80A92B0F80482B0F8827240F2BC -:1019D000E240013292B2531B9BB209FB03F3434333 -:1019E000D4F8D001A4F8CA211844C4F8D001B4F83E -:1019F000AA03A84218BFC4F8D431B4F8A433A4F899 -:101A00000A32B4F8A633A4F80432B4F8A83303EBCE -:101A100083035B00A4F8823209BB40F2E243B4F8CE -:101A2000A26394F8A0535E435D43B4F8C8117019E3 -:101A300001F05AFAD4F8D031C4F8CC513344C4F888 -:101A4000D031E3691E44236A361A03442362D4F872 -:101A5000E030E6611D4405EB4005C4F8E05019F0A4 -:101A6000030118BF012109EB99030B44B4F882125A -:101A700004F5217019441CF086F9B4F80A324B457C -:101A800007D1B4F80432434503D1B4F88232BB42E3 -:101A900005D0D4F8883343F40063C4F888330123B5 -:101AA00084F87E33002384F8D831BDE8F883437886 -:101AB000032B11D190F87F332BB190F880030038BD -:101AC00018BF0120704790F876333BB1D0F86C0214 -:101AD000B0FA80F04009704700207047012070473D -:101AE00070B5446A2046FFF7E2FF18B1BDE87040C8 -:101AF0001BF0D0B81C4B1B684BB19B693BB11B4A18 -:101B000010681B4A201AC010504380B29847002525 -:101B1000184BB4F84603A4F8DA5184F8DC51C4F841 -:101B2000E0511D805D800AF0FBFA06460028DDD0FA -:101B3000114B1B683BB194F8A52022B194F8A72063 -:101B400052B1012A0CD0B4F846133046BDE87040BB -:101B5000063189B2F3F738BBD4E9B6019847F2E70A -:101B60002946B4F80602F9E7B83A0021B43A002150 -:101B7000BDCAE28C600C0021A03A00217047000031 -:101B80002DE9F74F446A064694F8D931C76A83B302 -:101B90001DF032FF05460146B068B4F80A821BF01A -:101BA000B1F818B340F2E2432946B06803FB08F8E5 -:101BB0001BF0A8F8804519D22946B0681BF0A2F89E -:101BC000414619F0FDFFB4F806321B1AA4F806329C -:101BD00094F8453253B994F80F3294F80E224343E7 -:101BE0009A42D9B279D3521A84F80E22002384F88B -:101BF000D93197F8B03084F80C3294F81A34012BAC -:101C00000BD194F80D3213B1802384F80C3294F880 -:101C10001934002B73D0012B7ED094F8DB317BB1CB -:101C2000D4F8E031C4F8D031B4F806320133A4F866 -:101C3000CA31002384F89532C4F8CC31C4F8D431C9 -:101C400094F8942294F8DC31002A6AD113B994F8FC -:101C5000DA313BB3237CB4F882123E2B08BF082351 -:101C600004F5217008BF23741CF08DF8314B9B697B -:101C7000DD0503F4807112D4D4F8182422F07F42D9 -:101C800022F0FF02B2F5803F09D103F400430B4379 -:101C900005D04FF47A7104F204401CF074F801236B -:101CA00084F89432D4F83C343BB1234A1068234A78 -:101CB000201AC010504380B298472046FFF7F7FE25 -:101CC00000283FD020464C2109F0CAFB04F52170C2 -:101CD00003B0BDE8F04F1CF05CB89B1A2532521AD5 -:101CE000252BD2B280D94DF668514B435B0D03EBE7 -:101CF000C30103EB8103134484F80E3276E7D4F872 -:101D0000203494F90C229B1AC4F8203494F81E3421 -:101D1000013384F81E3480E7094B20461B6898473E -:101D20007BE7002BBED0B4F8821204F521701CF0C2 -:101D30002AF8B7E720500021B43A0021BDCAE28C4E -:101D4000803A0021B84B1B684BB1DB693BB1B74A05 -:101D50001068B74A201AC010504380B29847B4F8B0 -:101D60008233B3F5807F06D101234021204684F8D9 -:101D7000823309F075FB94F8693363B1002384F86A -:101D8000693394F86A33002B40F08381A94B1B68B8 -:101D90000BB12046984794F885330B2B0DD1204684 -:101DA00011F049F948B1B4F80622B4F8AA339A42BE -:101DB00003D101212046FFF7FDFD94F84533002BA8 -:101DC00049D0D4F8F031002B45D0D4F8E411B068F4 -:101DD0001AF098FFD4F8E83198423CD9D4F8F011C1 -:101DE000B0681AF08FFFD4F8EC31984230D2B36863 -:101DF0002A20C4F8E4311BF0ADFD014640B38B4B03 -:101E00008B4A1B68DFF830E2E31ADB105343038090 -:101E100046F601330022438000F1040CC2F1200594 -:101E2000DEE90E38A2F12000D34008FA05F528FAC1 -:101E300000F02B430343D80754BF03230023013290 -:101E4000252A0CF8013BE9D17C4B187B1BF093FD54 -:101E50000023C4F8F03194F8F4332BB3B4F8FA2328 -:101E6000B4F806329A421FD894F87633E3B90420C6 -:101E70001BF070FD014668B16C4B6D4A1B68E31A9C -:101E8000DB105343038046F6015343806B4B187BB2 -:101E90001BF071FDB4F8F633002B00F0FC80B4F8B1 -:101EA00006221344A4F8FA33B4F80682B4F8CA310F -:101EB00008F10108A8EB0308614B1FFA88F81D68B8 -:101EC000002D40F0EB80B4F8049294F8D9319BBB1C -:101ED000E368D90030D5B4F804326BB394F8883491 -:101EE00053BB94F8D8313BB394F8DC3123B304F5F9 -:101EF0001B701BF0EFFEF8B16378032B1CD094F835 -:101F00008533FF2B00F0F3800B2B40F0D980204667 -:101F100011F091F8002800F0D380B4F8AA33B4F897 -:101F200006229B1A9DB209F10102954200F3DF805F -:101F3000012B13DD023DADB285B1B4F8063294F841 -:101F400045222B44A4F806323E4B691EA844204685 -:101F500053F8223089B21FFA88F898474FF00309E6 -:101F600040F2E24BB4F8063208F101080133A4F85C -:101F70000632B4F80A321FFA88F808FB03F3D4F8E3 -:101F8000D401B4F8C8110BFB030000F0ADFFB4F8A6 -:101F90000A5282461AF0B0FE08FB05F50BFB05F568 -:101FA00095284FEA550B40F2A4801AF0A5FEABEB42 -:101FB000000050457FF686AED4F8D0312B44A3EB19 -:101FC0000A03B360D4F8CC31756103F59B735344B5 -:101FD000F360D4F8CC0100EB4A00C7F8980094F8FD -:101FE00085530B2D40F087800023B4F8062233760A -:101FF000B4F8AA33511C994202D1022184F89512F7 -:102000009A4203D100212046FFF7D4FC94F84522E0 -:102010000C4B002153F8223020469847787094F8F2 -:102020009532022B2BD00FE0B83A0021B43A0021B0 -:10203000BDCAE28C943A0021205000216850002152 -:10204000083A00210C3A0021B4F80632B4F8CA214B -:1020500001339B1A4FF47A7240F2E240D9B2B4F8DD -:1020600082325343B4F80A224243B3FBF2F34A1CD0 -:10207000DBB29A4240F0D780012384F89532304693 -:102080006B491AF0CDFF00283FF46AAF03B0BDE8FA -:10209000F08F684B7BE684F8F43305E7664B01224A -:1020A00019885B882046194489B2A847B4F804927D -:1020B000B4F85E34054603FB09091FFA89F904E701 -:1020C00094F88533B4F80622012B06D194F87C33BA -:1020D000012B02D1B4F8D03323E740F60173B4F8F2 -:1020E000841399427FF43AAFB4F8DC3319E74D46D4 -:1020F00022E796205BE701239D4233760FD1B4F8A7 -:102100000622B4F8D0339A4280D1D4E9F223204693 -:10211000C4E9862309F04FF884F87E5376E70F2D43 -:102120007FF474AFB4F80622B4F8DC339A427FF43B -:102130006DAF94F85430022B03D0032B14BF01234E -:10214000042394F85550022D03D0032D14BF01250C -:10215000042594F8DB13A9B3994233D002294FF038 -:1021600001035DD0042952D0194684F85430CB1AAB -:10217000234493F95002D4F888337E2843F4004373 -:102180000A4684F84A00C4F888331BD12B4B2244FA -:102190001B68032993F9283084F84A3082F84F32BB -:1021A000D4F8342308BF84F8533252070AD5244A9E -:1021B000D2F800A0BAF1000F04D00122204600920C -:1021C0000022D04794F8DA337BB1AB420DD0022B1A -:1021D00003D0042B14BF0123032384F85530D4F813 -:1021E000883343F40043C4F88833012304F24E31AA -:1021F00084F87E33204609F094FD04F24631A4F8B9 -:102200006003204609F08DFDA4F85E03FEE694F815 -:1022100056300321013B18BF012384F85490A6E7F0 -:1022200084F85410A3E79942FFF429AF022324E76E -:10223000A9B60101903A0021600C0021DC4D00217B -:102240009C3A00210023426AA2F8DA3182F8DC319C -:10225000C2F8E031024A13805380FFF791BC00BFFF -:10226000600C002151B90122436A83F8802393F85E -:1022700059321BB1024A138801331380704700BFE3 -:10228000600C00212DE9F047446A0F4694F87E3334 -:10229000164684F80D22ABB1002384F87E3394F8FF -:1022A0008533012B0AD16E4B1B683BB16D4A106818 -:1022B0006D4A201AC010504380B298476E212046C4 -:1022C00009F0CEF8022E04D13846BDE8F04709F0F7 -:1022D0002FBF2046FFF7EBFB054618B906F0FD03BC -:1022E000012B02D11AF0D6FCEEE794F8DB3163B98A -:1022F00026B1A368180308D4042E06D1D4F8F4300C -:10230000C4F8E031012384F8DB31394604F5177055 -:102310000EF082FA17F80090002E4FD1012384F8B6 -:10232000DA6184F8DC3194F861321BB14F4A53888A -:102330000133538094F882334BB994F85C32032B09 -:1023400005D0A3689A0544BF012384F8833320464F -:10235000FEF76AFD80462046FEF7E2FD94F8D8318C -:102360001BB910B1012384F8D8319EBB94F85C32BC -:10237000032B2FD1B9F1060F2CD194F87633012B12 -:1023800028D194F885330D2B24D1204611F0EAF999 -:1023900000B31AF07FFC35462046FEF7E1FD94F8C5 -:1023A0005C324246032B04BF002384F88033394655 -:1023B0002B462046BDE8F047FEF7A2BE042E13D1FF -:1023C00094F8DA310133DBB2012B84F8DA3189D8A1 -:1023D0004FF00008012231462046FEF7C3FD81463A -:1023E00080B91AF057FCD7E7062E9CD194F85E32DC -:1023F00094F855225340D90795D44821204609F036 -:102400002FF86FE7B4F88233B3F5807F09D1A36862 -:102410009B0506D594F85432032B04BF002384F89F -:1024200083331AF041FC0028B6D1042E05D094F86D -:102430005F3213B994F8575285B1494694F8540065 -:10244000D4F8F45019F094FEB4F8602329460244FD -:102450002046FEF795FEB0FA80F56D09EDB29BE7D8 -:10246000EC4D0021B43A0021BDCAE28C600C002181 -:102470002DE9F84F174E054696F898301BB3164ACB -:10248000002714684FF4956240F2E249B6F88030B4 -:10249000DFF848B002FB0344D4F81C8004F1140AAE -:1024A000594650461AF0BCFD013760B9B4F80632FF -:1024B000B4F80A220133A4F80632BBB2534309FB35 -:1024C0000383E361ECE728466E62BDE8F84FF8F756 -:1024D00093BD00BFD03A0021B43A0021A9B6010152 -:1024E0002DE9F04FC46A0F4694F8F40087B0002835 -:1024F00000F08B80D4F89C00002800F08680D4F88F -:10250000D430564DDFF8588103930830D4E938238E -:10251000D8F800A0B5F880B094F8F1901BF0BEF8A0 -:1025200094F8F23085F8533295F841309A0740F12B -:102530008B8094F8F030012B6AD1384610F8086B84 -:102540001BF0A6F80B0A03F0C003402BCDE90401F1 -:102550004FEAD61673D104ABC5E91E0194F8F30017 -:102560000093D4E93A23F3F7ADFDDDE90423D4F871 -:102570009C0002301BF092F885F852624FF495638C -:1025800003FB0BAA3749D4F89C000DF001F9039B1B -:10259000D8F8001003EBC909AAEB0101324BC910AE -:1025A00040F2E24659430023BAF80A0209F5E56908 -:1025B0004A4670430093C9B21AF074F92B4BBAF82B -:1025C0000A12A0FB0332DB0F43EA4203B3FBF1F232 -:1025D00001FB1233D4F89C204E439375D4F89C2011 -:1025E000C3F30724D475A5F87030B0FBF6F306FBEF -:1025F00013004844CAF81C0095F85102012828D15C -:102600003B789B0625D585F8850007B0BDE8F08F9F -:10261000D4E92223CDE9042304ABD4F8846094F8F0 -:10262000F3000093D4E93A23F3F73DFD28B1DDE947 -:1026300004230126C5E91E2397E7C6F340060022BE -:102640000023C5E91E2390E700220023C5E91E23CD -:1026500094E70023012085F88530D6E7D03A0021A1 -:10266000B43A0021203D0021BDCAE28CE3361A00B5 -:10267000012208B5034B83F898201AF00BFB0020C9 -:1026800008BD00BFD03A00212DE9F0410446D0F842 -:10269000305100F582771AF02FFB636E628BC4F81D -:1026A0000C31238B00F2CC409342C4F8100113D0BC -:1026B00040F271235A43D5F8D810084490420BD207 -:1026C00038461AF073FD38B1616ED4F80C011AF077 -:1026D00019FBC5F8D80012E0002395F8CB106878F4 -:1026E000C5F8D83000F02CFE6870268B628B9642BD -:1026F00007D138461AF040FCD4F80C316366BDE8C7 -:10270000F08140F2712808FB06F608FB0268D4F855 -:102710000C31424633443146384663661AF046FD72 -:102720000028D1D1636EC4F80C31F0E7406A036829 -:1027300090F8002123F07F4323F0FF036BB190F862 -:1027400001310133DBB280F8013112B1012B01D824 -:1027500070472BB103210AF081BE0AB9FFF794BF7D -:102760007047406A036823F07F4323F0FF0313B1EF -:1027700003210AF073BE80F80031FFF785BF000027 -:102780002DE9F047436A06465A7822B393F8005180 -:102790000DBB134A40F2E24814684FF49562B3F857 -:1027A0006030DFF840A002FB0344E76904F114093C -:1027B000514648461AF034FC013560B9B4F8063287 -:1027C000B4F80A220133A4F80632ABB2534308FB33 -:1027D0000373E361ECE73046BDE8F047FFF7A6BFBF -:1027E000B43A0021A9B601012DE9F047436A054634 -:1027F0005A7812B3134A002614684FF4956240F2D7 -:10280000E248B3F86030DFF840A002FB0344E76918 -:1028100004F11409514648461AF002FC013660B929 -:10282000B4F80632B4F80A220133A4F80632B3B27F -:10283000534308FB0373E361ECE72846BDE8F04728 -:10284000FFF78FBFB43A0021A9B60101012208B5F4 -:10285000436A5A701AF01EFA002008BD2DE9F04FA5 -:10286000C46A456A94F8F120DFF8749187B088460D -:10287000607B94F8CD100232D9F800A0B5F860B0B2 -:10288000D4F8D46019F087FC039094F8F400002881 -:1028900000F08280D4F89C0000287DD0D4E9382351 -:1028A00008301AF0FBFE94F8F23085F8D33095F832 -:1028B0006B309B0740F18F8094F8F030012B6ED184 -:1028C000404610F8087B1AF0E3FECDE90401C5E9A3 -:1028D0001601090A01F0C00140294FEAD71707D1B4 -:1028E00004AB94F8F3000093D4E93A23F3F7EAFB3E -:1028F000DDE90423D4F89C0002301AF0CFFE85F8FD -:10290000D2704FF4956303FB0BAA364B05F1D0014F -:102910009B6A0027C3F3803385F8D130D4F89C003C -:102920000CF036FF40F2E24C039BD9F8001006F59C -:10293000DB661E44AAEB01012B4BC9105943B5F8C5 -:1029400062003B4600973246C9B20CFB00F019F01A -:10295000A9FF2649A0FB0113C90F41EA4301D4F89E -:102960009C3030449975D4F89C30C1F30722DA7555 -:10297000A5F85010CAF81C00012095F8D130012BA1 -:1029800004BF98F80070C7F3401785F86970237B7F -:1029900085F8680085F86C3007B0BDE8F08FD4E9A1 -:1029A0002223CDE9042304ABD4F8847094F8F30017 -:1029B0000093D4E93A23F3F776FB28B1DDE9042349 -:1029C0000127C5E9162393E700220023C7F3400738 -:1029D000C5E916238CE700220023C5E9162390E7FA -:1029E000B43A002120500021BDCAE28CE3361A001F -:1029F00037B5044668460D460CF056FF9DF800308A -:102A0000072B05D029462046FFF728FF03B030BD2D -:102A10000020FBE7F0B587B0C46A456A064602A805 -:102A20000F460CF041FF9DF80830072B36D10023EC -:102A3000BA1C85F8A2300DF1070105F1A0000CF0D9 -:102A400021FD9DF80730DB0628D5D5F8C41004A871 -:102A50000CF072FD9DF81630012B1AD0022B1FD0FE -:102A60000023F36094F8F12094F8CD100232607BDB -:102A7000D4F8D46019F08FFBD4F8D420331804A90B -:102A8000284601F06DF995F800313BB11AF002F9D2 -:102A900004E0064B9B6A13F4807FE1D107B0F0BDE0 -:102AA000024B9B6A13F4006FF7E700BF2050002130 -:102AB0002DE9F0478EB0446AC56A074604A80E4661 -:102AC0000CF0F2FE0DF10F01321804F1A0000CF031 -:102AD000D9FC94F8A130D90704D4002630460EB0B2 -:102AE000BDE8F0879DF80F6016F00106F5D09DF85F -:102AF0001030F96A8DF8303094F8A23080318DF8BA -:102B00003130D4E92A23CDE908239DF8123008A8F2 -:102B10008DF83230D4E92C23CDE90A239DF8133007 -:102B200000228DF8333005F1C803F2F7DDFF0028ED -:102B3000D3D095F8DC30002BCFD0D5F89830002BCF -:102B4000CBD04FF49562DFF85CA1B4F86030DAF8CE -:102B5000007095F8BA1002FB03779DF81420687B8B -:102B60000232D5F8C09019F016FBE97B804609F1D6 -:102B70009609287B09B995F8BA10242219F00BFBA5 -:102B8000D5E93223C1448144D5F8980008301AF0C1 -:102B900085FD95F8DA3084F8D33094F86B309A07D5 -:102BA0007AD59DF80F309B075AD5D4E92C131A0A11 -:102BB00002F0C002402ACDE906139DF8138009D126 -:102BC000C4E9161306AB95F8DB000093D5E934236E -:102BD000F3F778FADDE90623D5F8980002301AF009 -:102BE0005DFD84F8D28004F1D00104F178000CF08E -:102BF000CFFD6B7B40F2E248032B0CBF0322022285 -:102C0000DAF80010284B791AC9105943002308FB41 -:102C10000299B7F80A024A4608FB00F00093C9B2CD -:102C200019F040FE214BB7F80A22A0FB0331DB0F5D -:102C300043EA4103B3FBF2F108FB02F802FB113354 -:102C4000A4F88E30B0FBF8F308FB13004844F86199 -:102C50002B7B84F86C304FF48073A4F868303DE728 -:102C6000D5E92223CDE9062306ABD5F8848095F873 -:102C7000DB000093D5E93423F3F715FA28B1DDE939 -:102C80000623B046C4E91623A4E700220023C8F3B4 -:102C90004008C4E916239DE700220023C4E9162357 -:102CA000A1E700BFB43A0021BDCAE28CE3361A00A6 -:102CB000F0B505460E468BB079B3446AC76A02A8E0 -:102CC0000CF0F2FD0DF10701321804F1A0000CF038 -:102CD000D9FB9DF80830E96A8DF8203094F8A230CD -:102CE00080318DF82130D4E92A23CDE904239DF8E1 -:102CF0000A3004A88DF82230D4E92C23CDE906232C -:102D00009DF80B3001228DF8233007F1C803F2F74C -:102D1000EBFE0123637019F0BDFF00200BB0F0BD86 -:102D2000314B2DE97043D3E9024618695D682F4B9A -:102D300068B94FF000084FF00009C3E90E8924B1CB -:102D40009A6BFDB942F030029A63BDE87083002CA3 -:102D50003ED00FF28C09D9E90089C3E90E89002D14 -:102D6000EDD0D3E90E2142F0005242F08C029A637A -:102D70001F4A126892F82220012A84BF41F4E071B0 -:102D8000D963DCE742F0706141F070019963184942 -:102D9000096891F82240012C82BF42F0F85242F0BB -:102DA00070029A631EB19A6B42F440029A63002843 -:102DB000CBD0D3E90E21012C42F47F1242F44062C1 -:102DC000C2D941F40F7141F00301C3E90E21BCE700 -:102DD0004FF003084FF00009BFE700BFAFF30080DA -:102DE000033300C000000000B00C00216850002137 -:102DF000DC4D00210B4BD3E90801CA0542BF5A6CD8 -:102E000042F400725A648A0642BF5A6C42F0400291 -:102E10005A6410F0704F1EBF5A6C42F001025A649F -:102E2000704700BF6850002173B583781D4AFF2B9F -:102E300004461D4E106025D056F8233003B1984744 -:102E40001A4D2B78E3B11A4B5B7ACBB9F3F77EFCC2 -:102E50000124F3F779F81AF06BFB18F009FF154E0F -:102E600056F8243003B198470134142CF8D10023CC -:102E700001932B70012301A88DF8063018F0A8FEED -:102E800002B070BDC37813B90122084B1A70012536 -:102E900056F825300BB1204698470135142DF7D14F -:102EA000CEE700BF540D0021B00C0021000D002121 -:102EB00020500021040D0021024B53F8203003B1B3 -:102EC00018477047780C0021002307B58DF80300E0 -:102ED0008DF804006846ADF800308DF8023018F027 -:102EE00077FE03B05DF804FB0D4BDA6902F0006376 -:102EF000120113D541F2C702A0FB0110A1FB02137E -:102F000002FB003046F6F963C918064B40F1010197 -:102F10001B6893F829001030084470471846704722 -:102F200020500021DC4D002108B518F01EFE094B91 -:102F300020F07C42C00E1B5C42EA0363D2074BBF09 -:102F4000054A064A064807484CBF1A401A40104333 -:102F500008BD00BF644E0301F1FD7EFFCEF7FBFD0F -:102F6000310804020E02810008B5FFF7DDFF064AB2 -:102F700020F4FF03C00E105C43EAC03020F0007064 -:102F800040F4000008BD00BF444E0301094970B57C -:102F900000220D46084C2378934204D85A1C227014 -:102FA00045F8230070BD51F8046B8642FAD0013217 -:102FB000F2E700BF680C0021640C00212DE9F84302 -:102FC000002705460E463C460D4BDFF83880C3E926 -:102FD0000E01DFF8349099F80030BB4202D8204649 -:102FE000BDE8F88328463146D8F800302CB9984718 -:102FF0000446013708F10408EDE79847F9E700BFF8 -:1030000020500021680C0021640C002190F9003050 -:1030100090F901201A4490F9023090F9030013440A -:10302000184440F3870070470379032BC1540EBF47 -:1030300000230133DBB203714379013343717047DD -:10304000022805D0032808D0431E58425841704733 -:10305000044B986AC0F300207047024B986AC0F393 -:10306000C020704720500021054B9B6ADA054CBFF9 -:10307000032001201B0548BF40F00400704700BF3B -:1030800020500021C0780EF00DB9000070B588B056 -:1030900005460C460146684616460CF005FC9DF8B0 -:1030A0000430063BDBB21F2B01D9002042E09DF823 -:1030B000002005F10801062AF7D801A050F822F0F7 -:1030C000DD300101E330010139310101AB30010193 -:1030D0003D310101AB300101413101010022A272F9 -:1030E00002E00123A37200236160237295F8273068 -:1030F000012263722846134902ABF2F707FC00284D -:10310000D3D0DDE904239DF81B109DF81A008842F6 -:1031100005D1DDE90250984208BF954201D041F047 -:10312000020104F10C00E1721AF0B8FA01209DF8D6 -:103130001D30337008B070BD0322D0E70422CEE703 -:103140000222CCE7A80E002138B504460025D0F8AD -:103150006801C4F8685108B11AF004FCD4F8700191 -:10316000C4F8705118B1BDE838401AF0FBBB38BD47 -:10317000C20707D4830707D410F0040F0CBF252023 -:103180002720704725207047262070477FB55E4C6A -:103190002C22002104F19C0020F0BFFD04F1D0039B -:1031A0004FF4C0720021184620F0B7FD574BC4F809 -:1031B000C800C4E92E33564BC4F8C040C4F8B4303C -:1031C000022384F8D030534B534D197A0846FFF749 -:1031D000CFFF95F8303084F8D10084F8D2304F48D2 -:1031E0004F4B5722C4E9350340F20113A4F8DC30F9 -:1031F00094F84230A4F85021DE0748BFA4F85221C9 -:103200009A0748BF20234FF02D0648BFC4F8543119 -:10321000444B3046C4F87831434B84F89B11C4F8D2 -:103220007C31424B84F89A61C4F88031404BC4F839 -:1032300084311AF08FFB94F84030C4F86801012BF8 -:1032400004D130461AF086FBC4F8700194F841307E -:10325000DB0750D5D5E90823D4F85411C4E9562327 -:1032600041F00201C4F85411D4F8543143F0010282 -:10327000C4F8542195F831201AB143F05103C4F831 -:10328000543194F84030012B4FF0000339D1CDE98F -:103290000233032384F850320C2384F85432D4F8D8 -:1032A00054316946C3F34003224884F85232D4E9CA -:1032B0005623CDE900230CF099FA0E23C4F86C4193 -:1032C00084F89931002584F8515219F015FD40F227 -:1032D0007122E38F00F2CC405343C4F8A800164893 -:1032E000C4F8AC30A4F8985019F046FED4F8A430D5 -:1032F000A36304B070BD114BD3E90C23C4E956237A -:10330000B2E7C4F86C31DDE7580D0021F9AF0001D8 -:1033100003000101F850002120500021D6BE898E03 -:1033200055555500E1B00001A1B1000181B2000185 -:1033300091B200015A0D0021F40D002168500021C6 -:1033400059B10130C0B2282828BF2520A0F125039B -:1033500041FA03F3DB07F4D5704725207047F0B539 -:103360008BB004460F4616460021232268461D46B0 -:1033700020F0D3FC05238DF80230FF238DF8233095 -:103380004FF6FF733246ADF824300DF10A002B469C -:103390008DF803408DF804408DF809701AF07EF91D -:1033A000684618F015FC0BB0F0BD38B504460D4664 -:1033B0004822002120F0B1FC84F8405038BD10B5FF -:1033C0009DF8084001F0030104F0070443EA844338 -:1033D00043EA0143C0E9002310BD10B5BDF8104019 -:1033E000C3F3080343EA04539DF80C4001F00301C2 -:1033F00004F00F0443EA04439DF8084004F01F045E -:1034000043EAC42343EA4123C0E9002310BDF0B5D9 -:10341000014690F84000002838D00F4600254FF0B4 -:10342000010ED1F844C00EFA05F414EA0C0FE8B20C -:103430003ED0D7E90064A34208BFB24238D191F828 -:10344000424084423ED0072D08BF00204FF0010EBD -:103450001CBF0130C0B2A04208D00EFA00F616EA36 -:103460000C0F14D10EFA05F52CEA050CF4B1013C51 -:10347000E4B2012000FA04F545EA0C054D6401EBC5 -:10348000C40581F8424041F834206B60F0BD072844 -:1034900001EBC00601EBC505D6E90067C5E9006789 -:1034A0000CBF0026461C05463046D4E70724E0E75B -:1034B0000135082D07F10807B5D10123002081F857 -:1034C0004130E3E70120E1E790F8401030B591B1D9 -:1034D00090F84210456C79B10139C9B201248C4091 -:1034E00080F842102C4300EBC1014464C1E9002381 -:1034F000002380F8413030BD0721EFE730B50446A6 -:1035000085B0C57A0C301AF0C3F80B46A17A024692 -:10351000009129460E4D02A8FFF751FFDDE9022375 -:1035200005F14800FFF773FF78B9DDE9022305F1E3 -:103530004800FFF7C9FF95F82430012B05D14FF45F -:1035400000332046236018F043FB05B030BD00BFB8 -:10355000580D00214FF418720021014820F0DDBB06 -:10356000580D002108B50C4A0C4B9A600C4B0D4AC3 -:103570009A600D4B0D4A1A620D4A5A62FFF7EAFF34 -:103580000C4B1B681B79072B81BF0B4A136A43F056 -:103590008003136208BD00BFBD350101040D002189 -:1035A000B00C002185300101780C002109360101A1 -:1035B00049360101DC4D00216850002108B5EFF7C4 -:1035C00099FFFFF7C7FFBDE8084018F08BBD00006A -:1035D00008B51AF077F9044A537A01335372BDE8FB -:1035E00008401AF07BB900BFF850002108B51AF066 -:1035F00069F9044A537A013B5372BDE808401AF056 -:103600006DB900BFF850002130B50E4D89B0284685 -:103610000DF102011AF0BEF9044608B909B030BD37 -:103620000DF1030201A9FFF731FD28B1FF2301A825 -:103630008DF81630FFF762FF20461AF093F9FFF776 -:10364000D5FFE4E7800D002130B5144D89B0284640 -:103650000DF102011AF09EF9044608B909B030BD17 -:103660000DF1030201A9FFF711FD88B101238DF8C7 -:103670001630A368CDF81730A389ADF81B309DF83C -:10368000033013B1FF238DF8163001A8FFF736FF82 -:1036900020461AF067F9FFF7A9FFD8E7880D002147 -:1036A000034B93F82400003818BF0120704700BF77 -:1036B000580D0021034B53F820301878003818BFFC -:1036C000012070478C4E0301024B1878431E58426C -:1036D00058417047C036002130B5CB6A04461B788C -:1036E0000846092B25D142F210754A6AD2F8E43116 -:1036F000D2F8D0236A43B2EB430F1AD3616AD1F8F0 -:10370000E421D1F8D0136943B1EB420F12D30A4937 -:10371000A3FB0135A2FB0121DB0FD20F43EA4503D6 -:1037200042EA4102B2EB930F03D3B3EB920F38BFDF -:10373000204630BD2046FCE7E3361A002DE9F04173 -:10374000C6780546022E83783D4C20D1627801323E -:103750006270721E012A22D9A3F1FF004342434145 -:103760002A88FF2A1DD0E3B923781341D90705D54C -:10377000344B314653F822000DF0B2FDEB78013B9B -:10378000052B5AD8DFE803F01D3C4459594C052E4F -:1037900003D0062E08BF0126DBE70226D9E7012366 -:1037A000DEE70027DFF89C8023783B41DB0704D568 -:1037B000314658F827000DF093FD0137032FF3D160 -:1037C000DCE70023297920486172C91A18BF01215A -:1037D0006370FFF7EAFD1D481AF0DBFA1C481AF087 -:1037E000D8FAA968EB68A165E36531B317481AF008 -:1037F000CAFAE16D09B3BDE8F04115481AF0C3BA41 -:1038000012481AF0C6FABDE8F04111481AF0C1BAE0 -:10381000637893B9E36D83B9BDE8F04118F066BBF6 -:10382000637A022B03D101210748FFF7BEFDA16D8A -:1038300006481AF0A8FAE16DDDE7BDE8F08100BFA7 -:10384000481400218C4E030158140021A8140021B3 -:10385000B8140021024B1860C0780DF057BD00BFAE -:103860001C370021024B1860C0780DF069BD00BF05 -:103870001C370021F0F7CEBA2DE9F04389B018F0DB -:103880006BFA002800F08B8000242646464FDFF8B4 -:103890001C813B782341DB0715D558F8245095F857 -:1038A0006430022B05D105F1400018F02BFB85F8A0 -:1038B000646095F83C30022B05D105F1180018F032 -:1038C00021FB85F83C600134032CE2D14FF0000865 -:1038D000374C4FF48565A1464646364F05FB0893A5 -:1038E00093F82430022B50D1A379002B49D104F155 -:1038F000100018F00CFB94F88A32002B41D094F899 -:1039000089322C2B3DD13222A4EB0903DB107B43FF -:103910009BB2ADF80430ADF8083094F8963201A8A7 -:103920008DF80A3094F89732ADF806208DF80B30F8 -:10393000B4F89432ADF80C3094F898328DF80E301B -:1039400094F8A0328DF80F3094F8A8328DF810302A -:10395000B4F8AA32ADF81230D4F8B0320593B4F806 -:10396000B432ADF8183094F8C0328DF81A3094F8AB -:10397000D0328DF81B3094F8D1328DF81C3018F00D -:1039800027F905FB089383F8246008F10108B8F1D2 -:10399000060F04F58564A1D109B0BDE8F08309B034 -:1039A000BDE8F043FFF730BEB80F00218C4E030195 -:1039B000D01D00214DF833E10E4B70B518608378AF -:1039C0000446FF2B0C4D09D00388C1784FF4856065 -:1039D00000FB0350BDE870400DF0CCBC002628462B -:1039E000E17801360DF0C6FC062E05F58565F6D1A9 -:1039F00070BD00BF1C370021D01D00212DE9FF4103 -:103A0000044600F5827700F59C7530220021384687 -:103A100020F083F900214FF4C072284620F07DF990 -:103A2000754B764EC4F82031754BC4F83051C4E95B -:103A30004934D4F81C31307A03F47F42714B724D13 -:103A40001343C4F81C31022384F83831FFF790FB8C -:103A500095F8303084F8390184F83A316B486C4B72 -:103A6000D722C4E94F03237C4220022B14BF40F22B -:103A7000011340F20333A4F84431A37BA4F8B82126 -:103A8000D90748BFA4F8BA219A0748BFD4F8BC3177 -:103A900084F8020244BF43F02003C4F8BC31337AF7 -:103AA00084F803325B4BC4F8E0315B4BC4F8E4317B -:103AB0005A4BC4F8F4315A4BC4F8F831594BC4F896 -:103AC000FC3119F047FFC4F8D001002852D0564B02 -:103AD000C4F8E831637BDB074ED5D5E90823D4F879 -:103AE000BC11C4E9702341F00201C4F8BC11D4F840 -:103AF000BC3143F00102C4F8BC2195F831201AB161 -:103B000043F05103C4F8BC31237B012B4FF0000379 -:103B100038D1CDE90233032384F8D0300C2384F864 -:103B2000D430D4F8BC316946C3F3400384F8D230B2 -:103B300004F17A00D4E97023CDE900230BF056FE9E -:103B400004F17803C4F8D4310E2384F80132374BE2 -:103B5000C4F8EC31237B012B17D1272019F0FAFE92 -:103B60000546C4F8D80180B9D4F8D00119F0FAFE9E -:103B7000C4F8D0511F2036E02D4BD3E90C23C4E903 -:103B80007023B4E7C4F8D431E1E719F0B5F840F296 -:103B900071226389267C5343C4F814310023022E1A -:103BA00018BF1E460125DFF88C806370A37098F85B -:103BB000003000F2CC40B540C4F810016DB2ABB992 -:103BC000384619F0D9F9D4F80C3188F801606360EF -:103BD00098F802302B43002088F8023098F8003023 -:103BE0001D4388F8005004B0BDE8F08198F8023019 -:103BF00023EA0503EFE700BF3DC70001F8500021AD -:103C0000ADC700010300010120500021D6BE898EFE -:103C10005555550065C60001F1BA0001B3BA00015F -:103C20004D390001F939000191C6000195C6000126 -:103C300068500021B80F002138B53022044600F545 -:103C40003A75002100F52E7020F067F84FF4C0722D -:103C50000021284620F061F8022384F8D0320123A5 -:103C600084F8D232344B8021C4E9B5330623334A79 -:103C700084F8E83292F83030314884F8EA32314B37 -:103C8000C4F8E452C4E9BB03A37BA4F86813DD07BE -:103C900048BFA4F86A13990748BFD4F86C33C4F836 -:103CA000DC4244BF43F02003C4F86C33002384F8A3 -:103CB000A033254BC4F88433244BC4F88833637B8A -:103CC000DB0733D5D2E90801D4F86C33C4E9DC0151 -:103CD00043F00203C4F86C33D4F86C3392F831200B -:103CE00043F00101C4F86C131AB143F05103C4F856 -:103CF0006C33237B0020012B09BF04F178030023E0 -:103D0000C4F880330E2314BFC4F8803384F898338A -:103D10000F4B6070C4F88C330E4BA070C4F8903316 -:103D20000D4B84F80001C4F8943338BD0B4BD3E934 -:103D30000C01C4E9DC01CFE7B9C700012050002124 -:103D4000D6BE898E5555550019BE000129C0000107 -:103D50008DC2000181C3000165C4000168500021CB -:103D6000F8B5044688790D460130C0B21746FFF712 -:103D700067F900284AD02B7884F8E93294F8A23009 -:103D80005B0644BF94F8BD3084F8EA32AB79012B6E -:103D90003DD0022B14BF0123032384F8F53284F8AD -:103DA000F432AB78AE88002B0CBF1E234FF4967311 -:103DB0005E4318F095FF6B78012BAB780CBF322176 -:103DC0004FF4FA71002B0CBF1E234FF4967301447D -:103DD000F018FFF789F8AB78361A002B0CBF1E23BA -:103DE0004FF4967304F52E7503EB40003744002121 -:103DF000C4F89C03C4F8C072284618F05FFA18F0A3 -:103E00007BFFB04205D9012384F86834F8BD022352 -:103E1000C3E70021284619F003F90028F6D0012352 -:103E200084F80031F2E7000070B5802200211948C3 -:103E30001FF073FF0024184D184E55F8043B53B182 -:103E40004FF48E62002118461FF067FF56F82420B9 -:103E50000474C0F89C200134032CEED10122104BD5 -:103E600010491A730868104B496803C3094B40F2A4 -:103E700007511A700D4AA3F86610127B83F86C2064 -:103E800083F87C2040F20762A3F876200022084BDA -:103E90001A7070BD481400218C4E0301A81D00212A -:103EA00020500021844E0301D014002168500021CD -:103EB000B80F002108B5094A094BDA61094B0A4AD3 -:103EC000DA610A4B0A4A1A620A4B0B4A1A60FFF778 -:103ED000ABFF4FF48E62094B5A8208BD013F0101CE -:103EE000040D0021B00C00213D370101780C0021A8 -:103EF00079380101E44D0021B536010168500021F7 -:103F000008B5EFF7F7FAEFF765FFBDE80840FFF7F0 -:103F10008BBF00002DE9F04104460D460026DFF876 -:103F20004080104F19F010FD3B6801361B8C032EAA -:103F300048F8040B1844F5D10026DFF82C8019F05E -:103F400003FD3B6801361B8C062E48F8040B184411 -:103F5000F5D1001BA84288BF0020BDE8F08100BF5A -:103F6000A81D0021DC4D0021B41D002170B50B4BB4 -:103F70005C7C44B90A4E0B4D33782341DB0704D4F3 -:103F80000134032CF8D1012006E055F82430587B89 -:103F900017F0BEFE0028F3D170BD00BF20500021F5 -:103FA000481400218C4E03010123034A83401078FA -:103FB00018431070704700BF481400210123034AC2 -:103FC0008340107820EA03001070704748140021E5 -:103FD00010B5064C54F820001C8804815C8844818C -:103FE0001B7941730373827310BD00BF8C4E0301B4 -:103FF00038B5044604200D4619F0ACFC014668B102 -:1040000054B1237C0B8007238B70054BCD70187B3C -:10401000BDE8384019F0AFBCFF23F3E738BD00BF5F -:104020006850002138B5054604200C4619F092FC72 -:10403000014640B16B7AC4708370034B187BBDE8B6 -:10404000384019F098BC38BD6850002138B5044696 -:1040500004200D4619F07EFC014670B10748084B5C -:10406000241AE4105C430D238B70064B0C80CD703A -:10407000187BBDE8384019F07EBC38BDD01D00214A -:104080004DF833E168500021024B1878B0FA80F007 -:1040900040097047C0360021F0B500250C4C267849 -:1040A0006EB194F8D863864209D194F8D9638E42F0 -:1040B00005D1D4E9F8769E4208BF974206D0013573 -:1040C000062D04F58564EAD10020F0BD0120FCE74F -:1040D000D01D00210022094BDA62094B094ADA623D -:1040E000094A0A4B1A600A4B1B681B79082B81BFCF -:1040F000084A136A43F4005313627047040D002109 -:10410000B00C002155380101C93601011C500021B5 -:10411000DC4D0021685000210022084B1A63084A38 -:10412000084B1A63084B1B681B79092B81BF074A90 -:10413000136A43F000731362704700BF040D00213F -:1041400065380101B00C0021DC4D002168500021D0 -:10415000094B0A4A5A630A4A0A4B5A630A4B1B68BC -:104160001B79082B094B82BF1A6A42F400521A626B -:104170004FF48562DA827047040D00217538010121 -:10418000B9390101B00C0021DC4D0021685000213B -:10419000302238B50021044600F1600510441FF0BC -:1041A000BCFD4FF4C072002128461FF0B6FD01236C -:1041B00084F8483084F84A30094B0020E364094B06 -:1041C000E565C4E91434092384F86030064BA07017 -:1041D000C4F8F830054B84F85B03C4F8FC3038BDF4 -:1041E000FDC70001D5C90001E1C90001B1CD000141 -:1041F0002DE9F84FDFF858911546D9F820409B4635 -:10420000D2E90223C4E9E423012304F564780646D5 -:1042100084F8BE3340460F4617F0AAFD6B6940464E -:1042200083EA1343A4F8C033B4F8E01101F00AF8AC -:1042300084F8610096F8A2305B0644BF96F8BD3062 -:1042400084F862306B696366AB69A366BB79012B46 -:1042500076D0022B14BF0123032384F86D3084F839 -:104260006C304FF41611AA78EE78002A0CBF1E228B -:104270004FF496724E432B8802FB036606EB0B034A -:10428000C4F8F831B4F8E031A4F8FC31287C08F027 -:1042900089FAAB780746002B0CBF1E204FF49670AE -:1042A00039463044FEF720FEAB78361A002B0CBF9F -:1042B0001E234FF49673B6F5967F03EB4000C4F8C7 -:1042C0000001C4F8F40140D35E44A663012200213A -:1042D00094F86D0017F05FFF0026D4F8E431DFF8A2 -:1042E00074B004F1300AE063C4F8F0016364594625 -:1042F000504618F095FE013620BBB4F8E011404658 -:10430000013189B2A4F8E01100F09CFFD4F8E43147 -:10431000B5B25D4384F8610039462846FEF7E4FDF6 -:10432000D4F8F831D4F8F0211D44D4F8F4312D1A22 -:10433000024403EB4003A563E263C4F80031D6E70F -:1043400002238AE7012389F80130BDE8F88F00BF16 -:10435000C0360021D9360101B34B2DE9F04F1E685C -:104360004FF49563DFF8C4A203FB0066DAF810404F -:1043700087B004F13003049396F87033012B40F0BA -:104380002B81A3710A22B6F87433A94F5343C4F8A2 -:104390006C33B6F8723304F5647BA4F868333B7C65 -:1043A000584684F8E831D7E90223C4E9E42301231D -:1043B00084F8BE33F3F7F4F97B69FD7883EA13429E -:1043C0006366BB69A4F8C023A36694F82034BAF8E6 -:1043D000061084F86D3084F86C30BB783046002BC2 -:1043E0004FF416130CBF4FF01E094FF496795D433E -:1043F000B7F8008007F0FAF9B6F80612054430461F -:1044000007F0F4F947F6FE73BAF806C0B6F80622CC -:1044100009FB0858ACEB020189B299428146BD8B79 -:10442000D4F8E401B6F80A3200F2E68040F2E24243 -:104430005943336A02FB0133B3FBF0F3494603FBF4 -:104440001080ED1AADB218F05DFC94F821340390A1 -:10445000012BA4F8E05140F0E1800022D4F824348C -:104460001A61D4F82434997C6940584600F0EAFE79 -:104470003A7C704B062A98BF33F812709AF80C20D9 -:1044800088BFDF89062A94BF33F81220DA8984F8BE -:104490006100059218F024FCBAF80E1047F6FE7A77 -:1044A0006D1AADB2554588BF0025D4F8E411804699 -:1044B00001FB05F301933B18194601980293FEF79F -:1044C00013FD5A49054608894989059A401A80B260 -:1044D000504588BF0020B6F80A1240F2E246484331 -:1044E00008EB02017043FEF7FFFC059A0137174401 -:1044F0004744394682462818FEF7F6FC4C4B00F13B -:1045000010029B780398002B0CBF1E234FF4967368 -:1045100003EB42034844C4F80031C4F8F431B4F862 -:10452000E031C4F8F801801AA4F8FC31A4F8FE3197 -:10453000A0630021049817F0C1FE4FF00009E36B5F -:104540004D46C4F8F03194F82134012B05BF94F89E -:10455000F93294F8F8220023534304BFD4F8E4213D -:1045600006FB13234E4603933349049818F058FD75 -:10457000002840F0AB8094F82134002B5ED1B4F8D1 -:10458000E0115846013189B2A4F8E01100F05AFE5A -:104590000136D4F8E431B6B203FB06F8DDE90131A7 -:1045A00084F8610003EB0800FEF79EFC3946504496 -:1045B000FEF79AFCD4F8F83110309844A8EB0003C9 -:1045C000A363D4F8F0310344E363D4F8F43103EB8C -:1045D0004000C4F80001C7E7032B7FF4D3AE0123EA -:1045E00040F6FF71E37104F21E2204F5007323F814 -:1045F000021B9A42FBD1C5E640F2E241A2EB0C025B -:1046000092B25A43336A01FB0233B3FBF0F3013336 -:104610001D44494603FB0080ADB214E7002B7FF434 -:1046200020AF294621E700BFB43A0021E836002137 -:1046300020370021C04E0301D9360101D4F82424CB -:104640000135937CADB20133DBB2937494F8F81268 -:1046500003F07F03994207D19074B4F8E03109F177 -:1046600001090133A4F8E03194F8F982039A05FBBB -:1046700008F302FB09F840F2E24202FB0388DDE99D -:10468000013103EB0800FEF72FFC39465044FEF7DA -:104690002BFCD4F8F8311030A8EB00084344A36396 -:1046A000D4F8F0310344E363D4F8F43103EB400071 -:1046B000D4F82434C4F80001997CB4F8E0315846A9 -:1046C000594000F0BFFD84F861004DE707B0BDE838 -:1046D000F08F00BF00234FF48562184610B50549DE -:1046E00002FB03F4645C0CB10130C0B20133062B51 -:1046F000F6D110BDD01D002105289FBF4FF4856362 -:104700005843024B185C88BF00207047D01D002121 -:104710002DE9F0414FF485630025DFF8BC8003FBF1 -:1047200005F616F8087006EB0804002F4ED14FF47A -:104730008562394620461FF0F0FA01232370274B8B -:1047400053F82530A362264B1B7B84F8D43306F53F -:10475000737323F8085003EB080240F20D435380B3 -:1047600040F20113A4F86C301E4B06F500769B7DD9 -:10477000464484F8203440F6FF7301370F2F26F8A3 -:10478000023BFAD14FF48563002103FB0588164BE9 -:10479000A8F858131B6888F85A131B790C2B12D9E8 -:1047A000124B53F8250070B14FF44C72C8F8240432 -:1047B0001FF0B3FA0E4AD8F8243452F82520DA65EF -:1047C000012283F860202046BDE8F0810135062DE6 -:1047D000A5D10024F7E700BFD01D0021B41D0021A2 -:1047E00068500021B4500021DC4D00210437002125 -:1047F000BC0F0021052807D84FF48562044B02FB4B -:104800000030D0E9E401704700200021704700BF6C -:10481000D01D002170B588B00C4606461546002113 -:104820001E2268461FF079FA26238DF80230214BAC -:104830008DF804605A889B88ADF80620ADF80830E2 -:104840001D4B1E4AE31ADB105343ADF80A30B4F88F -:10485000D8331B4AADF80C3094F820348DF814305E -:10486000D4F8E431A3FB0232DB0F43EA4203ADF894 -:10487000163094F8E8318DF818300DB194F8F852EC -:1048800094F8F9320DF10E008DF81A3094F8FA32DE -:104890008DF819508DF81B3094F8FB328DF81C30D0 -:1048A000D4E9F82318F0FAFE684617F091F908B039 -:1048B00070BD00BFE8360021D01D00214DF833E166 -:1048C000E3361A0010B54FF48564CA43054B02F075 -:1048D000010204FB0030827112B9C1F34001C171C1 -:1048E00010BD00BFD01D002105280DD84FF48562F2 -:1048F000064B02FB0030D0F8E431A0F868135943AE -:10490000C0F8EC110120704700207047D01D002135 -:10491000F0B500260027164D89B028460DF1070195 -:1049200019F038F8044608B909B0F0BD4FF4A813DF -:10493000D4E906C0D4E90212904208BF8C45029324 -:10494000237CCDE904C0CDE906678DF80C3002D197 -:104950002078984205D0CDE9061243F002038DF885 -:104960000C3002A817F034F9204618F0FBFFD4E70A -:1049700074390021C0780CF015BD0000044B93F889 -:10498000143230EA030301D10AF060BB704700BF64 -:10499000683700212DE9F04F04460D460020002124 -:1049A000DFF8A4B01F4602F0FD0385B0012B1646C8 -:1049B000DDE90E89CBE91C01DDF840A08BF86A30F7 -:1049C0003AD122494A7C002A36D0AB70D1E908237B -:1049D000CAE900230023CB73B30711D502AB0093C0 -:1049E00042464B463846F1F75EFB48B10123AB70B7 -:1049F000DDE90223CAE90023CBE91C238BF86A60B6 -:104A0000DAE90023C4E92223AB782BB1D4F884304F -:104A100043F00203C4F88430D4F88420C4E9248924 -:104A200042F00103C4F884301FB142F00902C4F817 -:104A3000842005B0BDE8F08F0023AB70044BD3E9B0 -:104A40000C23CAE90023C7E7405100212050002170 -:104A50006850002113B50446069B10460093DDE91B -:104A60000423F1F73AFB074B93F83120D4F8843054 -:104A70002AB143F04003C4F8843002B010BD23F0E3 -:104A80004003F8E72050002100232DE9F0418B4F2F -:104A90008AB004938DF81430BB6A894D5C042E7C77 -:104AA00006D5042E01D0012E02D801238DF8113035 -:104AB0002C22844C0021A0181FF02FF904F1600370 -:104AC0004FF4C072184600211FF027F97E4B0222D6 -:104AD000C4E91233032384F8603097F83030A065BE -:104AE00084F8623079487A4B84F844200122C4E982 -:104AF000190340F20113964284F84620A4F86C3062 -:104B000010D0042E0ED095F82130D90744BF0822CA -:104B1000A4F8E2209A0742BFB4F8E23043F0200341 -:104B2000A4F8E23095F8203084F81331BB695B04B7 -:104B300009D517F01AF80323B0FBF3F303EB430393 -:104B4000C01A84F812012B7C042B77D8DFE803F01D -:104B50000379878C820000238DF810302823A4F875 -:104B6000E03006AB5B48029304A9D5E90623CDE902 -:104B70000023AB7C6A7CFFF70DFF00220023CDE908 -:104B8000082308AB0293697CD5E906235148CDE997 -:104B90000023AA7CFFF75EFF2B7C4F4E012B67D0D2 -:104BA000042B65D04D4B30460093DDE906230AF017 -:104BB00003FE00238DF81400064485F84830414870 -:104BC00004A90AF0E5FD2B7C361B022B84F810614A -:104BD000C4F8F84001D9042B69D1414A13F0FD080B -:104BE000C4F8FC203F4AC4F808213F4AC4F80C210D -:104BF00060D104233D4F8DF8103095F8683004A93A -:104C0000063338468DF814300AF0C2FD384B3E1892 -:104C100030460093DDE906230AF0F6FD0644F61B54 -:104C200085F86980C4F8007184F811610021314869 -:104C3000218517F043FB2F4818F09EF90AB0BDE814 -:104C4000F081002340F6A662C5E902322A4A84F8C0 -:104C500012312A6001238DF8103020237FE70623CC -:104C60008DF8103008237AE702238DF8103078E7AA -:104C7000DDE9087057EA000CD5E906231CBF03469E -:104C80003A46A97C18BF0121CDE90023DDE90623BE -:104C900011488DF813100AF09EFDD4F8E4308DF819 -:104CA000140043F004030644C4F8E43087E700230B -:104CB000C4F8FC300023C4F80031B7E720500021CD -:104CC000405100216837002199D00001D6BE898E5D -:104CD00055555500C83700216A3700216851002119 -:104CE00044370021D1CF000115D000014C390021FB -:104CF0008951002194370021008813000022024BC3 -:104D0000C3F8FC20704700BF683700214FF40672DB -:104D1000002101481FF001B868370021054B064A01 -:104D20001A61064B064A1A61064B074A9A62FFF758 -:104D3000EDBF00BF040D00214D4D0101B00C00215D -:104D400075490101780C00211149010108B5EFF7FF -:104D50007BFAFFF7DBFFBDE8084017F0EDB901383B -:104D6000032807D8DFE800F004020402022070479D -:104D70000120704700207047030203F00F3300F05A -:104D8000F0300343180100F0333003F0CC33184304 -:104D9000830003F0553300F0AA301843C009704770 -:104DA00040F6E8335843094BA0F53E501B682038C5 -:104DB000034493F88821012A06D1D3F89C0121B13C -:104DC000D3F8A0310B60704700207047C039002134 -:104DD0002DE9F04705460E460024134FDFF84C80BE -:104DE000DFF84C903B685FFA84FA1B7B534502D88E -:104DF0000020BDE8F0875046D8F8003098470128D9 -:104E00000ED1102018F0A6FD014658B10E23C0E9BE -:104E10000256A0F800A0438099F80C0018F0ABFDF2 -:104E20000134DFE70C20E4E7DC4D0021E84D0021F0 -:104E30006850002113B5094C20460DF1030118F00C -:104E4000A9FD019018B9FFF763FD02B010BD01A8DC -:104E500016F0BEFE019818F085FDEDE7B43900218B -:104E600038B505460C4616F080FE2A46214618F055 -:104E700021FC80B238BD00002DE9F047099F804633 -:104E80000C4691469A469DF82050042A1FD8DFE828 -:104E900002F00317032050000B7AC3B940F272608E -:104EA000524A098812682944128A824228BF02465F -:104EB000914205DD0726238023723046BDE8F08746 -:104EC00098F80260002E40F08F80002D3BD1122612 -:104ED000F3E78378012B75D14D752FB12A463946FA -:104EE00004F118001EF0F2FE29463846FFF7B8FF1D -:104EF0000123E08284F813A1237508F50664204697 -:104F000018F09EFA08B90026D7E798F8C53B63B1B8 -:104F100008F52165284618F093FA0028F3D098F890 -:104F2000C53B13B1284618F053FA204618F050FA42 -:104F3000E9E78378002BCAD0002DC8D10B88002B5D -:104F4000C5D0294646E0B9F1040FB6D801A353F8FD -:104F500029F000BF694F0101874F01019B4F0101FB -:104F6000C54F0101434F010137B1238860682A46CC -:104F7000394618441EF0AAFE002321884E462944D3 -:104F80002180237299E727B12A46394660681EF0CE -:104F90009DFE0023258023728FE737B12088636848 -:104FA0002A46394618441EF091FE238829462B4490 -:104FB00023803846FFF754FF0123A8F8400084F807 -:104FC0000CA0E8E727B12A46394660681EF07EFE4D -:104FD000A9B221803846FFF743FF0123A8F840001B -:104FE00084F80CA023728EE70C2666E7DC4D0021C6 -:104FF000002310B5037090F8DD3B0446012B03D16C -:10500000054B1B6803B1984704F5717018F0C1FE99 -:10501000BDE8104016F054BEC439002101460022FC -:1050200030B50A4B1B681C7B094B1B68944201D8A6 -:10503000002030BD5D7818468D4202D11D78002DCC -:10504000F7D1013203F6E833F0E700BFDC4D002171 -:10505000C039002138B583780446FF2B1AD0007878 -:10506000FFF7DCFFA8B10D4BE1781C60BDE83840CC -:105070000CF0E8B9E0B2FFF7D1FF28B14FF49C7211 -:10508000002150301EF049FE01342B681B7B9C42EE -:10509000F0D338BD0024024DF7E700BFBC39002132 -:1050A000DC4D0021134B2DE9F04118608378044654 -:1050B000FF2B18D00078FFF7B1FF90B1E178BDE881 -:1050C000F0410CF08DB908FB05F33A68D018D35CB9 -:1050D00013B1E1780CF084F9013533681B7BAB42E6 -:1050E000F1D8BDE8F081002540F6E838024E034FC4 -:1050F000F3E700BFC8390021DC4D0021C039002191 -:1051000008B5FFF78BFF30B140F20113B0F888010A -:10511000C31A5842584108BD134B2DE9F04118609D -:1051200083780446FF2B18D00078FFF777FF90B103 -:10513000E178BDE8F0410CF06BB908FB05F33A6883 -:10514000D018D35C13B1E1780CF062F90135336803 -:105150001B7BAB42F1D8BDE8F081002540F6E83872 -:10516000024E034FF3E700BFCC390021DC4D002194 -:10517000C039002110B50C46FFF750FF50B180F840 -:10518000DC4B008C10F0100003D00020024B83F8A1 -:10519000144210BD4220FCE768370021F8B50446F0 -:1051A0004DF66856114D07F043FA94F8C43B84F865 -:1051B000DC03034406FB03F2520D02EBC20102EBD7 -:1051C00081029B1ADBB2C3F12000D5E90E27A3F1BF -:1051D000200184F8C43B07FA00F022FA03F30343EA -:1051E00027FA01F10B43DB07DDD5F8BD2050002184 -:1051F000F8B504464DF66856114D07F019FA94F8C3 -:105200004D3384F84C03034406FB03F2520D02EBCA -:10521000C20102EB81029B1ADBB2C3F12000D5E987 -:105220000E27A3F1200184F84D3307FA00F022FA8B -:1052300003F3034327FA01F10B43DB07DDD5F8BD88 -:1052400020500021028E70B5044682EA0100FFF76B -:1052500093FD00EB0010104480B2FFF78DFD00EBD2 -:105260000010104480B2FFF787FD4DF6685300EB45 -:10527000001011184A4091B24B43D4E900265B0D4F -:1052800003EBC30003EB8003CB1A9BB2C3F12005F1 -:10529000A3F12000DA4006FA05F526FA00F02A43C9 -:1052A0000243D20757BF94F82D00D8B2484304EB0D -:1052B000104058BF007A70BDF8B504460D46D0F8CE -:1052C0006C6817F019FDB0F5967F2CD917F014FD16 -:1052D0001F4F3B689A8AA36C9A422CBFB618F618E7 -:1052E00006441C48B04228BF304616F0C3FF94F86D -:1052F00034360646D3B994F84C10284616F0DEFF33 -:10530000D4F8E023D4F86838AB608AB93B68284603 -:10531000D98AA26A314417F049FFC0B9AB68A26AC2 -:105320001344AB60F2E74FF49670D1E70021E4E755 -:105330003B682846D98AD4F8E023314417F0C4FFEB -:1053400028B9AB68D4F8E0231344AB60F0E7F8BDAC -:10535000DC4D0021D47E250038B590F83436044663 -:105360000D46F3B990F84C10284616F0A7FF94F8B4 -:105370003E2082B142F21073616A01FB02330A4A95 -:10538000934228BF1346D4F86C289A422CBFC4F825 -:10539000E023C4F8E03329462046BDE83840FFF753 -:1053A0008BBF0021E0E700BFD47E250070B500F57B -:1053B0002165044600F524663022002128461EF0AF -:1053C000ACFC4FF4C072002130461EF0A6FC012355 -:1053D00084F8283A84F82A3A234B94F84500C4F814 -:1053E0002C3AC4F8303A04F65203C4F8383A07238A -:1053F00084F8403A94F8C43BC4F83C6A84F8413AD3 -:1054000094F93C30C4F8344A7F2B08BF174B04F2A0 -:105410004D4208BF93F93030294684F8423A144B84 -:10542000C4F8443A134BC4F8483A94F83F3084F82F -:105430004C3A84F84D3AFFF792FC0F4B84F84E0A31 -:10544000C4F8143B002384F84F0AA4F832362046EF -:10545000C4F8DC2AC4F8E83AC4F80C3BC4F8002BC2 -:10546000BDE87040FFF778BF45DB00012050002108 -:10547000D6BE898E55555500B1D2000140F6E832AE -:10548000044B00211B681B7B5A43034B18681EF01A -:1054900044BC00BFDC4D0021C039002108B5134ACF -:1054A000134B14491A62144B144A15481A62154AD0 -:1054B0009162154A9A63FDF769FD144B144A1A600C -:1054C000144B1B68187908280BD9134B0C28D3E907 -:1054D000082142F4805286BF41F48071C3E908215B -:1054E0001A62BDE80840FFF7C9BF00BF1D550101A2 -:1054F000040D0021354E0101B00C0021A550010121 -:10550000D14D0101780C00215550010118500021A6 -:1055100075510101DC4D00216850002108B5EEF7FE -:1055200093FEEFF7E9F8BDE80840FFF7A7BF0000DA -:105530002DE9F04105460C4618F006FA40F6E8322F -:105540000027184B184E18603368DFF860801B7B0B -:1055500002FB030033681B7BBB4210D80027DFF837 -:10556000508033681B7BBB4212D8401BA0429BBFBC -:1055700040F6E8320F4B00201A82BDE8F08118F0A7 -:10558000E3F9336848F8040B1B8A01371844E1E754 -:1055900018F0DAF9336848F8040B1B8A013718440D -:1055A000DFE700BFC0390021DC4D00218439002134 -:1055B0009C3900216850002110B50C4678B108785C -:1055C000FFF72CFD60B1038C03F01D031D2B09D1E7 -:1055D0006388013B9BB2802B34BF0020122010BD9A -:1055E0004220FCE70020FAE708B5FFF717FD70B38B -:1055F00090F830366BB390F8443753B3038C03F014 -:105600001202022A02D1B0F8502812B390F83920C1 -:1056100002F0FD02012A01D10279E2B103F0110288 -:10562000112A03D1B0F852281F2A14D803F0050319 -:10563000052B06D1B0F85238F02B34BF00201220D1 -:1056400008BD012B09D1B0F85238F62BF5E74220FE -:10565000F6E70C20F4E71220F2E70020F0E708B5A7 -:10566000FFF7DCFC003818BF012008BD10B5C0B240 -:105670000C46FFF7D3FC30B190F93C001AF0E6FA83 -:105680002070002010BD4220FCE700000023F0B590 -:105690001A4640F6E8370A4D0A4E2968097B9942B6 -:1056A00001D8D0B2F0BD07FB03F1346804EB010C64 -:1056B000615C19B19CF80110815401320133ECE7AF -:1056C000DC4D0021C039002170B50D46FFF7A6FC66 -:1056D0000446D8B1038CDA0701D58378C3B92846CC -:1056E00017F0D6FF01F44043B3F5404F06460D4690 -:1056F00001D00B040ED418F0E5F80123C4E90265CB -:105700002371E37018F0EAF8002070BD4220FCE736 -:105710000C20FAE71220F8E7F0B506460D46002007 -:10572000002192F839C02A4F0CF0FD03012B1446DA -:10573000C7E91C0185B087F86A3040D11279002A88 -:105740003DD0B370D4E90223C4E904230023E370FD -:105750001CF0020F14D002AB009394F83A00D4E985 -:105760000C23F0F7A0FC58B10123B37094F8391062 -:10577000DDE90223C4E90423C7E91C2387F86A1082 -:10578000D4E90423C5E92223B3782BB1D5F88430BA -:1057900043F00203C5F88430D5F8841041F00103CA -:1057A000C5F88430D4E90C23C5E9242394F83A30B1 -:1057B0001BB141F00901C5F8841005B0F0BD00230C -:1057C000B370044BD3E90C23C4E90423C0E700BF42 -:1057D00040510021685000212DE9F043064614464F -:1057E00092F83A000D46F070D2E90C23C4E9062382 -:1057F000164985B091F8311021B394F83910890712 -:105800001AD54FF000084FF0000902AF0097CDE91C -:105810000289F0F739FC30B9D4E90C2394F83A0046 -:105820000097F0F75AFCDDE9022352EA03011EBF9C -:105830000121F170C4E90623D5F8843043F0400318 -:10584000C5F8843005B0BDE8F08300BF20500021CA -:105850002DE9F84380460D46FFF7E0FB044600289B -:105860006BD10646DFF8CC91D9F800301A7B724B29 -:105870001B68964203D307263046BDE8F8831C46D2 -:10588000277803F6E833002F55D140F6E832394641 -:1058900020461EF042FA012384F801802370D9F8D3 -:1058A0000020927C84F830369A4238BF1A4684F839 -:1058B000443784F81C35614B84F84C201B7B604ACC -:1058C00084F8D0334FF4A16352F82620A4F8C8839B -:1058D000C4F82C26C4F840275A4AA4F8CA3352F810 -:1058E0002620C4F8182516F0E3F9A678002E40F01B -:1058F0009E80B7B1238CDB0613D594F83D2604F2C5 -:105900003E61A4F85228D4F82C061EF0DFF994F872 -:105910005127D4F84007A4F8502804F252711EF021 -:10592000D5F92B88D80621D4D90708D5B4F8503832 -:1059300053B11226A0E701369BE70127D5E79A0766 -:10594000F4D5B4F85238F3E7B4F85228022194F8A9 -:105950003F0016F020FC40F27122AB6800F51C50AD -:1059600053431030834220D2452685E7B4F85228AD -:10597000002F55D0238CDB0652D41F2AD9D8B4F877 -:1059800050381F2BD5D8D4F82C1684F83D2604F2B5 -:105990003E601EF09BF9B4F85028D4F8401784F804 -:1059A000512704F252701EF091F994F889212B8846 -:1059B000012A02D113F03B0FBBD140F271216A687A -:1059C0002384AB684A434B436262A3622B7B84F817 -:1059D00038306B7B84F83930AB7B84F83A302869F7 -:1059E00017F056FEC4E90C012B7D84F83B306B7D2B -:1059F00084F83C30AB7D84F83D30EB7D84F83E305C -:105A00002B7E84F83F306B7E84F84230AB7E84F886 -:105A10004330EB7E84F844302B7F84F845302BE70D -:105A20001F2A86D8B4F850381F2BBED981E70C2620 -:105A300022E700BFDC4D0021C03900216850002161 -:105A4000843900219C39002108B5FFF7E7FA10B12D -:105A5000D0E9DA0108BD00200021FBE7F0B585B0F0 -:105A60000D46FFF7DBFA044600283AD090F889315A -:105A7000012B38D01F4B00271B689E8A836C9E42E7 -:105A800038BF1E461C4BB6B21B6843B3984702464C -:105A900094F83F00022303970127CDE90173B4F87E -:105AA000143500210093334616F08BFB40F2E2419F -:105AB0006B884B43834218D3208C10F03B0016D1E7 -:105AC0002A884A43C4E9D623AB8884F86273A4F8D1 -:105AD000603384F8DD0BC4F8E40B05B0F0BD3A4642 -:105AE000D6E74220F9E70C20F7E74520F5E712203A -:105AF000F3E700BFDC4D0021803900212DE9F04F94 -:105B000085B0884615461E46FFF788FA04460028E9 -:105B100000F0D08090F862331BB90C2005B0BDE8CE -:105B2000F08FA8F10303012B06D90DB91220F5E778 -:105B300090F88931002BF0D1DFF87C91D9F8003052 -:105B4000B3F814B0A36C9B4538BF9B4694F88931D9 -:105B50001FFA8BFB23B3D4F850A3584B1A680AB131 -:105B60009047024618F0FD014FF0020394F83F0001 -:105B7000AFB218D1CDE9023101230193B4F8143545 -:105B80003B449BB200935B4616F01BFB504521D86B -:105B9000B8F1040FCAD8DFE808F00D1F0D2D47003B -:105BA000D4F85CA3D9E70021CDE902310123CDE986 -:105BB0000073E8E794F81C35002BB7D1D9F8001032 -:105BC000B4F81425098A2A448A4205DDA4F814355C -:105BD00084F81C354520A1E794F88831002B9CD12E -:105BE000002DA3D0B8F1040F19D8DFE808F0324433 -:105BF0004B5A2A0094F88881B8F1010F51D12A46F6 -:105C0000314684F8295504F22C501EF05FF83946CD -:105C10003046FFF725F984F82885A4F82A050123E2 -:105C2000002084F8203579E794F88831002B3FF480 -:105C30007DAF002D7FF47AAFB4F81435002B3FF41C -:105C400075AF39463046FFF70BF90123A4F8560328 -:105C50000EE0B4F81435D4F818052A461844314635 -:105C60001EF034F8B4F814351F440023A4F814755A -:105C700084F81C35D3E72A463146D4F818051EF0BF -:105C800025F8F2E7B4F81435D4F818052A46184474 -:105C900031461EF01BF8B4F814353B44A4F8143513 -:105CA000CFE72A463146D4F818051EF00FF8A4F8BD -:105CB0001475C6E7422031E7DC4D00218039002110 -:105CC0008A07F8B506460D46C1F3400708D5234BB1 -:105CD000DB6ADB0604D41121BDE8F84016F093B965 -:105CE0003046FFF79BF9044610B942213046F3E7EE -:105CF00090F862334BB115F0010502D090F81C35D5 -:105D00001BB1238C03F03B030BB10C21EEE7042005 -:105D100084F8547317F01EFE014648B10A238370BD -:105D2000C5F10203C3700E4B0680187B17F023FEEB -:105D300094F8DD3B012B10D1042017F00BFE014637 -:105D400058B10E23C5F105058370054B0680C5705B -:105D5000187BBDE8F84017F00EBEF8BD20500021BA -:105D60006850002170B50646FFF758F9044678B12F -:105D700085787DB990F88931012B0BD0D0F8D83BCC -:105D80000BB1304698472046FFF732F9284670BDE0 -:105D90004225FBE70C25F9E70022F8B5134D144E18 -:105DA0002B68197B3368914208D8002440F6E83705 -:105DB0002B681B7BA3420CD80020F8BD987890B9C3 -:105DC00003F6E833A3F65F20007801280BD00132F8 -:105DD000E9E707FB04F33268D018D35C0BB1FFF797 -:105DE00007F90134E4E70C20E7E700BFDC4D0021B0 -:105DF000C039002138B50D46FFF710F9044630B11F -:105E000017F060FDA56417F069FD002038BD422041 -:105E1000FCE738B50D46FFF701F9044658B16B1E93 -:105E2000DBB2FA2B09D817F04DFD84F84C5017F06F -:105E300055FD002038BD4220FCE71220FAE770B57E -:105E40000E461546FFF7EAF8044648B117F03AFD4A -:105E500084F89F6884F84F5A17F040FD002070BD09 -:105E60004220FCE738B5054604200C4617F072FDC9 -:105E7000014650B16B78C470038008238370034BD4 -:105E8000187BBDE8384017F076BD38BD685000215A -:105E900070B500F52165044600F524663022002126 -:105EA00028461DF03AFF4FF4C072002130461DF025 -:105EB00034FF022384F8283A012384F82A3A3B4B22 -:105EC00094F84500C4F82C3AC4F8303A04F5056358 -:105ED000C4F8383A072384F8403A94F8C43BC4F82D -:105EE0003C6A84F8413A94F93C30C4F8344A7F2B38 -:105EF00004BF2F4B93F9303084F8423A2D4BC4F84D -:105F0000443A2D4BC4F8483A94F83F3084F84C3A60 -:105F100084F84D3AFEF723FF0823228C84F84E0ABA -:105F200084F84F0A5007C4F8C03A07D4910705D542 -:105F300094F83B20D20748BFA4F8C23A002304F2E9 -:105F40004D411A462046A4F83236C4F8DC1A0AF04D -:105F50000FFAA4F8D80A122017F0FCFCF0B1174B86 -:105F60000430C4F80C3B164BC4F8E80AC4F8103BE4 -:105F70000023A4F8463704F28F43C4F8F03AC4F87B -:105F8000003B104A94F8C43B29462046C4F8142B21 -:105F900084F8413ABDE87040FFF7DEB91F230421C1 -:105FA000204684F8D633FFF75DFFE1E745DB0001CB -:105FB00020500021D6BE898E5555550015D50001BB -:105FC00095D5000185D4000170B500F52165044622 -:105FD00000F524663022002128461DF09EFE4FF475 -:105FE000C072002130461DF098FE022384F8283A42 -:105FF000012384F82A3A3B4B94F84500C4F82C3A24 -:10600000C4F8303A04F65203C4F8383A072384F847 -:10601000403A94F8C43BC4F83C6A84F8413A94F995 -:106020003C30C4F8344A7F2B04BF2F4B93F93030F7 -:1060300084F8423A2D4BC4F8443A2D4BC4F8483A00 -:1060400094F83F3084F84C3A84F84D3AFEF787FED6 -:106050002023228C84F84E0A84F84F0A5007C4F893 -:10606000C03A07D4D10705D594F83B20920748BF22 -:10607000A4F8C23A002304F24D41A4F83236204677 -:10608000C4F8DC1A04F5C5620AF072F9D4F82C36AB -:10609000A4F8D80AC4F8E43AB4F852382820A4F88E -:1060A000E03A17F057FCA8B1124B0430C4F8E80AE4 -:1060B000C4F80C3B04F28F41C4F8F01A20460022C9 -:1060C0000AF012FA2946A4F8EC0A2046BDE870400E -:1060D000FFF742B91F230421204684F8D633FFF787 -:1060E000C1FEE7E745DB000120500021D6BE898EC6 -:1060F0005555550005D60001F8B500F5066604466D -:1061000000F5096730220D46304600211DF005FEDE -:106110004FF4C072002138461DF0FFFD0122032319 -:1061200084F87A28804A94F93C10C4F87C287F4A85 -:1061300084F87838C4F8802884F890387C4A7D4BFD -:106140007F2993F97B3008BF92F93010C4F88C781E -:106150008B42A8BF0B4684F89238774B94F84400E2 -:10616000C4F89438754BC4F88448C4F8983894F847 -:106170003D3084F89C3884F89D38FEF7F0FD2823E4 -:10618000C4F81039238C84F89E085F0784F89F08B0 -:1061900000F18D80980706D594F83B10C90744BFDD -:1061A0000821A4F81219DB0709D594F83B309F07A2 -:1061B00005D5B4F8123943F02003A4F8123994F845 -:1061C000383084F843395E4BC4F834399369580445 -:1061D00003F4804272D515F0C8FC00F0030084F887 -:1061E0004209238C04F5797713F0100269D003F08B -:1061F0001D031D2B0DD1002384F84239636240F644 -:10620000A6634FF47A72A3624E4B1B685B685343DC -:10621000E362394620460AF0B7F9238C84F8400936 -:10622000D906C4F828791CD59A071AD0282017F067 -:1062300091FB002876D0444B0430C4F83839434BE6 -:10624000C4F82C09C4F83C39238C9B0709D504F207 -:106250002647394620460AF00DFAC4F8307984F80A -:1062600041092046FEF79AFFD4F8D8332BB100211C -:10627000204694F8C42B09F0E7FC0021304616F0C4 -:106280001DF8304B1B685B6803B319F0B5FB07467C -:1062900016F032FD4FF47A723844C4F868080021D1 -:1062A00030466A4316F082FF98B9122029E0D4F8EC -:1062B000143943F00403C4F8143980E784F8422900 -:1062C0008FE73946204609F0B3FFA6E7304616F0BF -:1062D00053FED4F8D803A0B1258C05F00305012D99 -:1062E00014D0022D0ED0002DDFD12046FFF75EF82E -:1062F000012384F8C53B3046D4F86818F6F7B6FF9A -:106300000020F8BD2046FFF7C3FDF1E7104B1B68E6 -:1063100093F82230002BC8D02046FFF755FE84F8B2 -:10632000C55BE8E71F20ECE749D8000139DB000135 -:106330002050002140510021D6BE898E5555550070 -:106340006DD20001C83900212DD700018DD7000181 -:10635000DC4D002138B5054604200C4617F0FAFA4A -:10636000014650B16B78C47003800A238370034BDD -:10637000187BBDE8384017F0FEBA38BD68500021E0 -:1063800000220D4B9A620D4B0D4A9A620D4B0E4A3C -:106390001A600E4B1B68187908280CD90C4B0B2877 -:1063A000D3E9082142F4005201D81A62704741F043 -:1063B0001001C3E908217047040D0021B00C002131 -:1063C00019510101E84D002101510101DC4D00216D -:1063D000685000212DE9F04F00F5CA75044689B0D8 -:1063E00000F5E4763022002128461DF096FC4FF49B -:1063F000C072002130461DF090FC012384F8AC31BE -:1064000084F8AE316F4BC4F8C061C4F8B0316E4B44 -:106410000026C4E96D3404F21453C4F8BC3106F00C -:1064200007F9082384F8C83194F84D3384F84C03F5 -:1064300084F8C93194F93C30DFF890B17F2B04BF68 -:10644000634B93F9303084F8CA31D4F88C31C4F8F6 -:10645000CC3106F0E7F894F83F30C4F8D00184F866 -:10646000D43194F8450084F8D531FEF778FC594BC7 -:1064700084F8D601C4F89C3204F2D14384F8D701E1 -:10648000C4F86432C4F8883231462846A4F81E6540 -:1064900015F014FFD4F85833A26C0493DBF80030E5 -:1064A000D4F85C939B8A934238BF13464A4A1FFA3A -:1064B00083FA1268002A7AD09047024601274FF0EB -:1064C0000208B4F8141553460091CDE90178002173 -:1064D00094F83F000396059215F073FEDBF8001068 -:1064E000059A898B88420CD9B4F81415534600914B -:1064F000CDE90286002194F83F00019715F061FE76 -:106500000146D4F8A0218A4238BF0A464945C4F85A -:10651000A0214ED8DFF8C480314FD8F80030E61AF9 -:10652000F610304B7E43029307ABCDE90023049A6B -:1065300004368A4238BF0A464B460121F0B216F0B3 -:10654000FBF8002839D0079BD4F8186AC4F85033F8 -:10655000C4F8A83116B919F04FFA06460023D8F846 -:1065600000103246611AC910794304310093D4F8FF -:106570005003C9B216F096F90027636A984208BF23 -:1065800040080644C4F89C610021284616F048FDE6 -:106590000137A0B9B4F89031D4F850230133A4F8EE -:1065A0009031BBB202FB0363C4F89C31ECE7324686 -:1065B00084E7452009B0BDE8F08F4320FAE70020CA -:1065C000F8E700BF89DC00013DDD0001DC4D002162 -:1065D0002050002149D3000180390021C039002119 -:1065E000D53FF54FA14D010170B504460D46FEF7AC -:1065F00015FD78B190F8DC3B35EA03030AD1437806 -:10660000A34207D1D0E90C23BDE8704090F83A00CE -:1066100008F034BD70BD2DE9F74307460E4691469C -:106620001D46FEF7FBFCDDF82880044600283FD01D -:10663000038CDA061DD425B19B073DD4B0F8503841 -:10664000C3BB4B4632462046CDE9005804F5C56130 -:10665000FEF712FC032E08D8DFE806F0020502055B -:10666000B4F852381D44A4F85258D8B103B0BDE86C -:10667000F083032E20D11F2D1ED880F83D56B8F18F -:10668000000F05D02A46414600F23E601DF01EFB79 -:10669000A378012B08BF84F83036012384F83C36F8 -:1066A00084F8343638460121FFF79EFF0020DDE7ED -:1066B0004220DBE70C20D9E71220D7E72DE9F7438A -:1066C00007460E4691461D46FEF7A8FCDDF82880D9 -:1066D0000446002848D0042E48D0038C9A0701D4E1 -:1066E000002D43D1DB0620D41DB9032E05D00C208C -:1066F00018E0B4F85238002BF9D14B463246204608 -:10670000CDE9005804F23C71FEF7B6FB032E08D821 -:10671000DFE806F002050205B4F850381D44A4F87D -:106720005058D8B103B0BDE8F083032E1ED11F2D01 -:106730001CD884F85157B8F1000F05D02A464146BD -:1067400004F252701DF0C2FAA378012B08BF84F83E -:106750004437012384F8503784F8483738460221FB -:10676000FFF742FF0020DDE74220DBE71220D9E7F8 -:1067700008B517F0A7F8044A137801331370BDE881 -:10678000084017F0ABB800BFDC500021002238B53C -:106790000E4B04461B6893F839500D4B1868954210 -:1067A00001D800230DE00346197800F5547051B963 -:1067B0004FF4547218461DF0B0FA012203460270DD -:1067C0008470184638BD0132E9E700BFDC4D002176 -:1067D000D03900210146002230B50C4B1B6893F8DC -:1067E00039500B4B1B68954201D8002030BD1878FA -:1067F00038B1D878012804D11C6D14B164788C426A -:10680000F4D0013203F55473EDE700BFDC4D0021F5 -:10681000D03900210146002230B50A4B1B6893F89D -:106820003940094B1B68944201D8002030BD1D78C7 -:10683000184615B19D788D42F8D0013203F5547396 -:10684000F1E700BFDC4D0021D039002130B50D4B00 -:1068500000221B680C4993F839404FF4856303FB11 -:1068600000110A4B1B68944201D8002030BD1D78EE -:10687000184615B11D6D8D42F8D0013203F55473E1 -:10688000F1E700BFDC4D0021D01D0021D0390021EF -:106890000022094B1B6893F83910084B1B68914282 -:1068A00001D800207047187810B158780128F9D025 -:1068B000013203F55473F2E7DC4D0021D039002199 -:1068C00070B500251C4E0446336893F83A001B4B04 -:1068D0001A68A84201D8002327E01346197802F568 -:1068E000987239BB4FF4987218461DF016FA0122BF -:1068F00002703168034691F8222091F83510446007 -:106900000A442A44428094F83420511CC9B2417090 -:10691000E578FF205DB983F82C007F2083F86400C0 -:106920000E3284F8341044F82230184670BD83F8D3 -:106930002400F5E70135CCE7DC4D0021D4390021F6 -:106940000146002230B50A4B1B6893F83A40094BC8 -:106950001B68944201D8002030BD1D78184615B13F -:106960005D888D42F8D0013203F59873F1E700BFDE -:10697000DC4D0021D439002130B50A4B4FF4987416 -:106980001B6893F83A20084B1968002318469A426E -:1069900000D830BD04FB03F54D5D0DB90130C0B228 -:1069A0000133F4E7DC4D0021D439002101EB8103F0 -:1069B000C3EBC30303F0010103F12A028B0743EA8F -:1069C000C27343EA417343EA017343EAC16310B5FA -:1069D00043EA8163C2F34004C2F3801143EA446393 -:1069E00043EA016343EAC453C2F3401143EA41530B -:1069F000C2F3001143EA0153C2F3C00143EA8143E9 -:106A0000C2F3800243EA4243584010BD2DE9F041F1 -:106A1000044663680846DB786178012B0CBF0D23C0 -:106A20000C2384F8B0301746FFF7C0FFDDE90623DA -:106A3000C4E91E23012384F8A63080EA10430546EA -:106A4000A4F8A830060C04F178009DF8208015F019 -:106A50008FF96378C4F8B45043EA0723C4F8B83018 -:106A6000254B84F8BD8093F8303084F8BC8084F8DE -:106A7000B2300023A4F8BE30636893F83423CAB35D -:106A80001E4AC4F80C21D3F83513C4F80411D3F806 -:106A9000391394F80701C4F8081194F8041194F814 -:106AA0000621694084F8041194F80511724081EAC6 -:106AB000152180EA156504F1F40084F805110146FA -:106AC00084F8062184F8075103F59E7203F5A67336 -:106AD00052F8045B9A4241F8045BF9D140F2012379 -:106AE000A4F81C31064B1B6823B1A1780122BDE834 -:106AF000F0411847BDE8F08120500021010101025A -:106B0000743A0021F8B50446002500F1380794F8DE -:106B10003430218CAB4212D80123002204F52070BE -:106B200015F044F9E37884F8B902012B0CBFA36B8C -:106B3000D4F8903093F8B13084F8F930F8BD57F8B4 -:106B4000046B3EB10123002206F1780015F02EF906 -:106B500086F8B1000135DAE72DE9F0410446164622 -:106B60001D46002700F1380894F83430BB4208D89D -:106B7000204632462B46BDE8F041E0E9A02315F05F -:106B8000F7B858F8040B28B132462B46E0E91E232B -:106B900015F0EEF80137E7E72DE9F04F87B006462C -:106BA0008846154607F0A4FB0446D8B9284616F0D7 -:106BB000D9FE5B4B9B6A6BB196F8682052B90120F5 -:106BC000B8F80020ADF81000ADF80E200DF10E0160 -:106BD00004AA9847FFF7CCFD072007B0BDE8F04FA7 -:106BE000FCF772B900234373D6F8049099F81C207F -:106BF000027398F80320B8F80E709A4214BF0C2262 -:106C00000822B9F804102A4407818172C372056012 -:106C10004260002F40F0828004A910308DF810707F -:106C20008DF811708DF812708DF813700AF0F0F96C -:106C30000123A073E773E3725CE0A17A5F1BBFB22C -:106C40008F4228BF0F4699F81E103D44ADB200296F -:106C50005AD15B1B18BF0123E17A4FF00D0A8DF862 -:106C600010304FF000038DF811308DF812300AFB10 -:106C700001F30DF1100B03F110005946204401926D -:106C800000938DF813700AF0C3F9009B254A234442 -:106C900098737068E37A90F818C0D0E9081EA1FBD9 -:106CA0000C010CFB0E11C018C6F814B1D2F800B0DC -:106CB00041F10001CDE90401019ABBF1000F25D09B -:106CC0000AFB03F101F1170310312344214406F1BB -:106CD000F4000092D847009AC0B1E37A0AFB034A55 -:106CE00004238AF80F30E37A3A440133E3722389AC -:106CF000AB42A2D8224698F8001006F1080007B06F -:106D0000BDE8F04F16F031BE0223A5E70D21E37A6E -:106D100001FB03434FF00001D973E4E71D46E6E7AA -:106D200068500021883A00212DE9F3474368154651 -:106D30009A7E80460E4600F1080722B3197E4FF076 -:106D40000009B6FBF1F44FF0010A4C4304F0FF04D4 -:106D50005FFA89F6314638460DF1070216F029FE32 -:106D600018B9002002B0BDE8F087D8F8041090F9F7 -:106D70000C208B7E63439342F3DB1DD10A7E9B1A6A -:106D80000373012343734FF0000838460DF10702E7 -:106D90005FFA88F116F00DFE04460028E1D0208944 -:106DA000002835D0A17A14F00EFF86420ED3361A91 -:106DB000F6B208F10108E8E7437B23B90B7E80F8BF -:106DC0000DA0D21A027309F10109C1E794F80AC0B3 -:106DD00023890CFB06F29342EBD90D219B1A6345E4 -:106DE000A8BF63464E43A019817B2B81636829802D -:106DF0001344EB60002306F11001214469606B61CC -:106E0000C37B63B11736344403202B826C61A9E73E -:106E1000A37B1034E8602B8001206C60A2E7022085 -:106E2000A0E7F7B506460F4600F1080537B128463A -:106E30000DF1070116F0B7FD044608B903B0F0BD27 -:106E4000A17A208914F0BFFEE37A874223BFC2B241 -:106E50009B18BA1ADB1928BFD7B2A27A2CBFDBB2B3 -:106E6000DBB2E37202FB03F3228938BF00279342AF -:106E7000DCDB0DF10701284616F08CFD206816F0CA -:106E800071FD204607F03EFAFFF772FC96F82430B9 -:106E9000002BCBD196F86830002BC7D1337C01335F -:106EA0003374C3E72DE9F347002581468A46174628 -:106EB0002E4600F10808BAF1000F08D0711B4046B9 -:106EC0000DF10702C9B216F074FD044610B902B004 -:106ED000BDE8F087A17A208914F075FEE37A824537 -:106EE0002ABFC0B253441B18A27A2CBFDBB2DBB25C -:106EF000E37202FB03F322892ABFAAEB000A4FF0D8 -:106F0000000A5FFA8AFA9342D5DBBE420ED20DF137 -:106F10000701404616F03EFD206816F023FD20468E -:106F200007F0F0F9FFF724FC0135EDB299F82430B1 -:106F30000136F6B2002BBED199F86830002BBAD1D9 -:106F400099F81030013389F81030B4E708B50B30E8 -:106F500016F06EFC00B1083008BD62F07F0201F847 -:106F6000042C5430083916F063BE406D18B1037913 -:106F70000830DB090B70704708B5543016F04AFE34 -:106F800018B1BDE8084016F079BC08BD426D42B1A9 -:106F9000137903F07F03013BDBB213710BB9FFF7E9 -:106FA000EBBF704708B5084B5B780BB9002008BDF4 -:106FB000064B1B68988D0C3080B216F0CBFC002875 -:106FC000F4D00A30F3E700BFDC500021DC4D002193 -:106FD00007B5034690F8680030B10DF1070103F1E1 -:106FE000300016F0D7FC03E093F82C20012AF4D9E6 -:106FF00003B05DF804FB0A3816F0B4BC1346083041 -:10700000A1F10A02194616F0B0BC37B500F1080428 -:107010000D4620460DF1070116F0C5FC48B19DF85C -:107020000730AB4207D120460DF1070116F0B2FC44 -:107030000A3003B030BD0020FBE707B508300DF182 -:10704000070116F0A7FC00B10A3003B05DF804FB9D -:10705000002337B5037043680446DB7893B1012BF6 -:107060000CD100F10805284616F034FE38B314346C -:1070700020460DF1070116F08DFC28BB03B030BD92 -:10708000FFF7B9FF2046FFF7D8FF0028F8D1104DD1 -:107090002046FFF79DFF40B9636804F11000997F17 -:1070A00003B0BDE8304007F0DBBB16F05BFC16F028 -:1070B00009FC6B7801336B7016F010FCE8E70121D6 -:1070C0002046FFF7AEFECEE716F04CFCD0E700BF3F -:1070D000DC500021F8B500250646044606F8385B6A -:1070E00094F83430E178AB4208D8012905D104F195 -:1070F0005405284616F0EEFD80B1F8BD56F8047B25 -:1071000047B149B1012902D1788806F091FD38468E -:10711000FFF79EFF0135E3E70221F5E72046FFF781 -:107120002BFFE6E70346B0F8680048B9064A127834 -:1071300042B10122D866A3F8682083F87010704726 -:107140000C20704707207047DC500021B0F86830F1 -:107150005BB9012280F87010A0F8682080F86A20DE -:107160008365C3650366184670470C20704790F826 -:1071700068200B462AB1583007C883E80700002072 -:1071800070470C207047000070B50C46054616F09D -:10719000DBFB4FF498720D4E0D4B1860336893F87B -:1071A0003A3002FB030016F0CFFB4FF45472094B48 -:1071B0001860336893F8393002FB0300401BA0428B -:1071C0009BBF054B054A0020DA6170BDDC4D0021F4 -:1071D000D4390021D03900216850002130015003FA -:1071E0000023F0B500F1380290F83470184687B0EB -:1071F000CDE90033CDE90233CDE904339F4208D80D -:107200000F4B9B6A1BB110B1694603AA984707B0A0 -:10721000F0BD52F8041B81B191F824406CB90E7C8A -:107220005EB1B1F802C006AD05EB4005013025F8AE -:1072300018CC25F80C6C0C74C0B20133DEE700BF2B -:107240006850002130B58DB00546144610230A461B -:107250000C48694618F058FA684604A904230A4AFB -:1072600018F052FA102328460DEB030208A918F073 -:107270004BFA04232146054A08A818F045FA0DB038 -:1072800030BD00BF984E0301A84E0301AC4E030170 -:1072900030B50B790133DBB20B71047EC57E05FB83 -:1072A00004F2934224DA4A780132D2B2944202D9EB -:1072B0004A70012030BD00248A78013D0132D2B2EB -:1072C000AA424C7001DA8A70F3E78C70827E002A41 -:1072D000EFD1447E9C42ECD80A710B780133DBB2CB -:1072E0000B7090F83400984294BF00200120E1E731 -:1072F000CA78013C01324C70CA70427E9A42D8D89A -:1073000000234B70CB700B71E7E70B78F0B50133BE -:10731000DBB20B7090F834209A422DD800240B7900 -:107320000C700133DBB20B71067EC77E4A7807FB17 -:1073300006FC01326345457ED2B216DC964201D985 -:107340004A7006E08A784C700132D2B2974205D971 -:107350008A70AB422CBF0020012005E08C70807E3B -:107360000028F6D1AB42F4D3F0BD9642E8D8CA78F3 -:107370004C700132CA70ECE70120F5E708B5FFF761 -:1073800065FA18B1036D0BB10023036508BD000059 -:107390002DE9F041164B044618608378FF2B1AD173 -:1073A00000254FF45478134E134F0DE008FB05F3FE -:1073B0003A68D018D35C33B1C37823B98378E178C5 -:1073C00023800AF06FF80135336893F839309D4215 -:1073D000ECD3BDE8F081C378032BE1D00078FFF750 -:1073E00019FA0028F5D0E178BDE8F0410AF05AB862 -:1073F000D8390021DC4D0021D03900212DE9F84396 -:107400000446FFF745FA064618B10C263046BDE89B -:10741000F8832078FFF7FEF90028F6D16588062D5D -:1074200000F282804FF485636B43424F07EB030900 -:10743000FB5C002B78D02846FFF708FA08B111262C -:10744000E4E799F88A32002BDFD094F8188099F895 -:1074500096324345F3D3B8F1060F01D90D26D5E78F -:10746000FFF78AFA8045F9D86FF0180004F1190384 -:107470009846217E001BC21891424BD84FF4856379 -:1074800003FB0577227997F8D1329A4250D12078C0 -:10749000FFF77CF905460028E0D00A2294F8009016 -:1074A000254B80F80290FB600765637D414680F8BC -:1074B0005530E38A57305343C0F81930227E00F824 -:1074C000012C1CF003FC237905F1740285F8343398 -:1074D00004F11501631D53F8040B8B4242F8040BB1 -:1074E000F9D1164F04203B7BA5F8649085F86C30E9 -:1074F00040F21153A5F8663016F02CFA0146002828 -:1075000084D02378038040F211134380387B16F037 -:1075100032FA7BE713F8012B42B1062A8FD899F88B -:1075200096C29445A7D28AE742266FE712266DE7F6 -:1075300025266BE7D01D00217D73010168500021D5 -:1075400010B50446FFF766F928B921464220BDE888 -:107550001040F0F772BAC37813B121460C20F6E759 -:10756000042016F0F7F9014648B140F21123438098 -:10757000034B0480187BBDE8104016F0FCB910BD29 -:10758000685000212DE9F04100F1C40704460D4682 -:1075900000F1F806D0F890803022002138461CF027 -:1075A000BCFB4FF4C072002130461CF0B6FB4FF418 -:1075B0008073A4F8DC30012384F8DE302E4B7C226B -:1075C000C4F8E0302D4B3046C4E93934C4F8F060DB -:1075D00008F1B0011CF07AFBE87B6E690721464395 -:1075E00095F8380014F0C4FD254B2269C4F8943195 -:1075F000244B3044C4F898316B68C4E93400C4F8B3 -:107600008C309B1AC4F88830AB7A0025002B0CBF55 -:107610001E234FF49673A4F88630B4F884102846DD -:10762000FBF762FCB4F88630D4F898201844D4F8FC -:107630008C3013441B1AC4F8CC3023694000C4F8C2 -:107640009001C4F8D8302046FFF75CFA0021384694 -:1076500015F0E6FC70B9D4E90832013342F10002BA -:10766000C4E908322269D4F88C3015441344C4F8B4 -:107670008C30D2E7BDE8F081F1E1000169E9000159 -:107680003DE1000125DE000170B500264B8C0D4662 -:1076900083808B8D0446C3804B6AC0F87832CB8DD3 -:1076A000A0F87C320A7C0276CB7B437691F82030BE -:1076B000C3760B7E837691F848308377D1E9100149 -:1076C00033461CF035F96A69C4E90801E969A87B09 -:1076D00091423BD341439639E677A162FF2384F878 -:1076E000A23095F8383084F8C03095F8493084F8E5 -:1076F0003433D3B104F23D300246D5F84A3005F1B7 -:107700006201C4F83533D5F84E30C4F8393305F189 -:10771000520353F8046B8B4242F8046BF9D104F521 -:107720009E7204F17401FFF78DFD40F2E242AB89D5 -:10773000002053432361EB69E3606B692363AB6A09 -:10774000A36005F02FF8A4F8840070BD0123424324 -:10775000963AE377A262C1E70C2370B50D4680F834 -:10776000B83204460021686AFFF720F9D5E90C23F6 -:107770000125C4F8BC0280EA1040C4E9A023A4F8A3 -:10778000B00284F8AE5204F5207014F0F1FAB4F8A7 -:107790007C321B02C4F8C03294F8C03084F8C53281 -:1077A00094F83433002B46D040F20123A4F816336A -:1077B000D4F8353304F53F70C4F80C33D4F83933BA -:1077C00094F80C23C4F81033D4F8BC3284F8155361 -:1077D0005A4084F80C2394F80D2304F5A67182EA2C -:1077E000132284F80D2394F80E2382EA134284F8BE -:1077F0000E2394F80F2382EA1363024684F80F33B2 -:1078000004F59E7353F8045B8B4242F8045BF9D194 -:1078100040F20123A4F82433074B1B685BB1074AED -:1078200011680122611A064C09116143BDE87040DC -:107830000831C9B2184770BD743A0021D03900210F -:107840001D52138C38B5054604200C4616F082F8FC -:10785000014650B1AB78C470038011238370034B91 -:10786000187BBDE8384016F086B838BD6850002156 -:107870004FF4987210B50B4C0021236893F83A30FE -:107880005A43094B18681CF048FA4FF454722368A5 -:107890000021BDE8104093F839305A43034B186873 -:1078A0001CF03BBADC4D0021D4390021D039002135 -:1078B00008B5094A094B5A64094A0A4B5A64FFF74A -:1078C000D7FF094B1B681B790A2B81BF074A136A34 -:1078D00043F00043136208BDF1780101040D00215B -:1078E00091730101B00C0021DC4D00216850002192 -:1078F000FFF7BEBF10B5037EBBB18168A9B1427E60 -:10790000846AB2FBF3F2C37ED21A837E5A430369C0 -:10791000807F012809BF081902FB0330C01803FB50 -:1079200002001CBF611A401810BD41F28830FBE70D -:1079300000220C4B1B6893F839000B4B1B689042DC -:1079400001D800207047197841B1D978012902BFC8 -:1079500093F8A11041F0010183F8A110013203F561 -:107960005473ECE7DC4D0021D03900214FF45473FF -:107970000A385843084BA0F5D4601B6803445A7872 -:10798000012A06D1D3F8CC0021B1D3F8D0300B6056 -:1079900070470020704700BFD0390021FFF768BF53 -:1079A00010B5FDF73BFB00220A4B1B6893F839101A -:1079B000094B1B68914207D9DC78012C05D11C6D5D -:1079C000844202D100221A6510BD013203F55473BE -:1079D000F0E700BFDC4D0021D039002108B5FDF7EC -:1079E0001DFBBDE80840B830F0F720B838B5FDF70A -:1079F00015FB384B04461B681879FEF70BFF90F80F -:107A00003433002B61D0392384F8BA30D0F83533C1 -:107A100004F58572C4F80231D0F8393300F24D31E3 -:107A2000C4F8063100F23D3353F8045B8B4242F850 -:107A3000045BF9D1012384F8B8300369264AA3FB1B -:107A40000232DB0F43EA4203A4F8C43090F834302A -:107A500084F8C630437E84F8C730017E84F8C810AD -:107A6000036BC4F8CC30837E84F8D030C368C4F88C -:107A7000D430C37E84F8D8308388A4F8DA30D0F8C4 -:107A80007832C4F8DC308368C4F8E030C388A4F8E6 -:107A9000E430B0F87C32A4F8E630D0E9A023C4E9A1 -:107AA0003A2390F8C03084F8F030D0E90835A3FBD1 -:107AB000013201FB0521C4E93E31837F84F80031A6 -:107AC00090F8343384F8013138BD212384F8BA307A -:107AD000B0E700BFBC390021E3361A0070B5044698 -:107AE000FBF742FAC4F8780204F09CFD0D23000A6B -:107AF0000021A4F87C0284F8B832D4F87802FEF7AA -:107B000055FF0125364EC4F8BC0280EA1040D6E984 -:107B10000E23A4F8B002C4E9A02384F8AE5204F501 -:107B2000207014F025F9B4F87C321B02C4F8C0327E -:107B300096F8303084F8BA3294F8C03084F8C43201 -:107B40000023A4F8C63294F83433002B46D040F218 -:107B50000123A4F81633D4F8353304F53F70C4F884 -:107B60000C33D4F8393394F80C23C4F81033D4F818 -:107B7000BC3284F814535A4084F80C2394F80D2333 -:107B800004F5A67182EA132284F80D2394F80E23DB -:107B900082EA134284F80E2394F80F2382EA1363D7 -:107BA000024684F80F3304F59E7353F8045B8B424E -:107BB00042F8045BF9D140F20123A4F82433094BC5 -:107BC0001B685BB1084A11680122611A074C091150 -:107BD0006143BDE870400831C9B2184770BD00BFAD -:107BE00020500021743A0021D03900211D52138CFD -:107BF0000228034609D003280FD0002A14BF04230B -:107C0000002358180A30C0007047002A14BF04200F -:107C1000002008440B3080007047002A14BF042065 -:107C200000200844800100F53470704738B50446E0 -:107C300090F834230D46017990F8C000FFF7D8FF83 -:107C4000E17F00F196020129637E07BFE2606A438B -:107C500022635A430CBF2263E260226B013B534311 -:107C6000E168013D01FB0533184438BD83782DE9F7 -:107C7000F041FF2B04461ED00078FEF7CBFDC0B1CB -:107C8000E178BDE8F04109F023BC08FB05F33A6850 -:107C9000D018D35C3BB1C378012B04D18378E17851 -:107CA000238009F015FC0135336893F839309D4283 -:107CB000EBD3BDE8F08100254FF45478014E024F1C -:107CC000F2E700BFDC4D0021D039002108B50D4A94 -:107CD0000D4B0E481A640E4B0E4A1A640E4A0F4B97 -:107CE000DA61FBF753F9FFF7C3FD06F065F90C4BBA -:107CF0001B681B790A2B81BF0A4A136A43F0804331 -:107D0000136208BD9D790101040D00213179010143 -:107D1000B00C00216D7C010121E00101780C0021F3 -:107D2000DC4D0021685000212DE9FF4D814E847803 -:107D30003368054693F83A30A34201D20D2096E00D -:107D4000FEF71AFE8442F9D82878FEF763FD002872 -:107D500040F0EC806878FEF73DFD012800F0E880F7 -:107D60002878FEF713FD04460028E7D033682A7B05 -:107D700093F830306878934228BF13462B73FDF791 -:107D80004DF90123E370EB7B0646A377AB7BE377EA -:107D9000687B0BF0A8FF022803D0042814BF012041 -:107DA000032084F8C0002B7C84F834338BB1082185 -:107DB00004F2353004F23D3717F03EFD102138460D -:107DC00017F03AFD384604F59E7205F11101FFF7F0 -:107DD00039FA288940F2E241FB28034628BFFB23F9 -:107DE0006A68A380B2FBF1F34B439A42E080A26041 -:107DF000236108D00123A377D328034628BFD323C8 -:107E00002833A38002E0A37F012BF5D0A18813F0D3 -:107E1000DAFEC0B220762B7B0133DBB25843E37627 -:107E2000A37EC2B262762BB3101A43435BB22377B0 -:107E300001236377A376A9782046FFF7F7FE002396 -:107E4000A376FF23A0622377A9782046FFF7EEFEF2 -:107E5000A0622046FFF74EFD4FF47A726B89E06214 -:107E600053438342204608D2FFF734F9112004B06F -:107E7000BDE8F08D4FF0FF33D9E7FFF72FFE3EB19D -:107E80002D4B9B695A025CBF96F8423A84F8BA328D -:107E9000A188E08813F097FE082843D92046FFF711 -:107EA00019F91220E3E72046FEF70AFD68B3D8E986 -:107EB0000EABB4F87C2294F8C030CDE900AB02934D -:107EC000D4F87812FEF7A2FD1EBB0137AB78BB4297 -:107ED000E9D84EB1194B2665C6F8D03B184BC6F809 -:107EE000D43B184BC6F8D83B042015F033FD0146AF -:107EF0000028BCD02B7803804FF488734380124B4A -:107F0000187B15F038FD0020B1E72046FFF7E2F8B6 -:107F100014E7D8F818305B0244BF96F8423A84F868 -:107F2000BA32D2E70027DFF81080CFE70C209EE7B7 -:107F300042209CE7DC4D002120500021ED79010119 -:107F4000DD790101A1790101685000212DE9F0439B -:107F500085B084780546FEF70FFD844201D90D20D7 -:107F60000BE02878FEF756FC002840F0AD806878DA -:107F7000FEF730FC012803D1122005B0BDE8F083E4 -:107F80002878FEF703FC04460028E8D00123C370DC -:107F900095F82230837795F82130C37795F8200043 -:107FA0000BF0A1FE022803D0042814BF01200320F7 -:107FB00084F8C00095F8263084F834338BB108215A -:107FC00004F2353004F23D3617F036FC102130460D -:107FD00017F032FC304604F59E7205F10801FFF7F8 -:107FE00031F940F2E242EB8BA380AB8BE3806B680C -:107FF000A3602B8B5343236195F82320227695F8B9 -:108000002400E07695F82530A376A97E617602FB00 -:10801000101191FBF2F25A4384F85E20002B39D004 -:108020004B435BB22377A9782046FFF7FFFDA062A0 -:108030002046FFF75FFCE0622046FFF74FFDA18876 -:10804000E08813F0C0FD082896D800261F4FAB78B3 -:10805000B34222D86878FCF7E1FF48B11C4B206599 -:10806000C0F8D03B1B4BC0F8D43B1B4BC0F8D83BEF -:10807000042015F06FFC014600283FF47EAF2B78FA -:1080800003804FF488734380144B187B15F073FC06 -:10809000002072E74FF0FF33C4E72046FEF710FCE4 -:1080A00070B1D7E90E89B4F87C2294F8C030CDE9DC -:1080B00000890293D4F87812FEF7A8FC0136C6E7CF -:1080C0002046FFF707F84AE70C2056E7205000212A -:1080D000ED790101DD790101A179010168500021EB -:1080E00010B50C46FEF796FB78B1C378012B0ED184 -:1080F0004378012B0BD190F8A13080F8BA4043F0BF -:10810000020380F8A130002010BD4220FCE70C20C3 -:10811000FAE7000030B504468BB00D46242200215A -:1081200001A81BF0FAFD2922A3788DF80220ADF8F2 -:1081300000308DF803508DF804508DF8053025B1CE -:10814000684613F045FD0BB030BDA36A194A02938F -:10815000E36A3834039394F888308DF8103014F8BB -:108160001F3C8DF8113014F8203C8DF8123014F8B3 -:108170001E3C8DF8133014F81D3C8DF8143034F883 -:10818000343CADF8163054F8283CA3FB0232DB0F28 -:1081900043EA4203ADF8183014F8043C07AA8DF8FE -:1081A0001A30AB42CCD954F8041B0135498822F867 -:1081B000021BF6E7E3361A0007B52A228378ADF8EA -:1081C0000220ADF800308DF8043090F8BA306846DF -:1081D0008DF8053013F0FCFC03B05DF804FB0000E3 -:1081E00038B5054604200C4615F0B4FB014650B1E5 -:1081F000AB78C470038010238370034B187BBDE8F9 -:10820000384015F0B8BB38BD6850002138B5036D53 -:1082100004460D4693B1062015F09CFB014668B15B -:10822000236D5B78C57003800E238370A378037180 -:10823000034B187BBDE8384015F09DBB38BD00BF2F -:10824000685000212DE9F04F044600F1C407D0F832 -:10825000389087B000F1F8083022002138461BF032 -:108260005CFD4FF4C072002140461BF056FD236DAB -:10827000DFF844A2D3F8A05114F03EFD4FF4807310 -:10828000A4F8DC30012384F8DE308C4B09F1B00116 -:10829000C4F8E0308A4B0646C4E939347C224046B3 -:1082A000C4F8F0801BF012FD637FDFF81892002BFA -:1082B00000F08D80844B4FF454711B68B3F832800A -:1082C000DAF80030E31A1B1109FB03F35FFA83FBB2 -:1082D0000023DAB2934536D835440026454494F855 -:1082E00034102046FFF7A2FCA0622046FFF702FBF5 -:1082F000E37F94F81980012B236BE0621FBF03FB1F -:1083000008F394F83400E36003FB00F84FF0070132 -:1083100094F8C00008BF03FB08F813F029FF637E40 -:108320004044082BC4E9340023D9A37EE27E002B0D -:1083300040D1012A40F2BA80013A637EE276227E81 -:108340009B1A6376CBE701FB03F2DAF8000000EB3F -:10835000020C825C5AB1DCF8D0200593049214F030 -:10836000CBFC4FF45471049A059B90448044013334 -:10837000AFE705EB000814F0BFFCA3684044984247 -:10838000D3D2524BE17F524AC4F89031514B01296C -:1083900018BF1346DAF80010C4F89431601A0011BF -:1083A00009FB00F0236D10F0FF00D3F89C8179D118 -:1083B000002632E0207E637E02FB00F18B42B8DDB6 -:1083C0001B1ADBB29942637689D1A67687E794F8C7 -:1083D00034102046FFF72AFCE37F256B012B637ED8 -:1083E000A06203FB05F51CBF94F83430E5604FF044 -:1083F000070194F8C00018BF5D4313F0B9FE0544AF -:10840000C4E93455BDE70133DBB2C21AD0D46A43A4 -:108410008E188A5C002AF6D0C43600252E4A2369BD -:108420000292D4F8D0200C30009229461A46C4F8A3 -:10843000D8300195C0B214F07FF9B8B346B9224ADA -:10844000236D1268D3F8A011558E03F5CA766D1A04 -:108450000323DAF800100093611A091109FB01F1F6 -:108460000C3133464246D4F8D000C9B214F01AFA9F -:1084700005444544C4F8CC502046FEF743FB002198 -:10848000384614F0CDFDA8B9D4E90832013342F1E1 -:108490000002C4E90832D4F8CC3022691344C4F88D -:1084A000CC30E9E701234FF45475AEE70D2007B057 -:1084B000BDE8F08F0020FAE7D03900211DEE000161 -:1084C00075F000011D52138CDC4D002161EC0001A0 -:1084D00065EB0001E5EB00016D7901010022F8B5C3 -:1084E0001C4E0446336893F835701B4B186895B2E0 -:1084F000AF4201D800232BE003461978013200F582 -:1085000062700029F3D14FF4627218461BF005FC2B -:108510000122034602703268104992F822202A4450 -:1085200092B20281097B80F85C10A3F8BC2244F26D -:108530000F7245F20120A3F8BE22FF22A3F85600D5 -:1085400083F8C41283F8042383F80823A279DA722B -:108550001846F8BDDC4D0021E439002168500021A7 -:1085600000230370704700000146002230B50A4B1B -:108570001B6893F83540094B1B68944201D80020D2 -:1085800030BD1D8918468D4202D11D78002DF7D1CE -:10859000013203F56273F0E7DC4D0021E43900217C -:1085A00070B5002204460B4B1B6893F835500A4BFC -:1085B0001B68954201D8002070BD1E7818462EB168 -:1085C000DE7AA64202D11E7B8E42F5D0013203F53F -:1085D0006273EEE7DC4D0021E4390021002210B582 -:1085E0000B4B1B6893F835100A4B1B68914201D85E -:1085F000002010BD1C782CB193F8CA4214B1DC885D -:10860000844203D0013203F56273EFE70120F0E703 -:10861000DC4D0021E4390021002230B50D4B1B68F0 -:1086200093F835400C4B1B68944201D8002030BDB4 -:108630001D898D4207D01D782DB193F8CA5215B10E -:10864000DD88854203D0013203F56273ECE7012037 -:10865000EDE700BFDC4D0021E439002108B5FFF74C -:1086600083FF03780BB1C08808BD4FF6FF70FBE7AE -:1086700008B5FFF779FF20B190F84700003818BF20 -:10868000012008BD2DE9F04100220546144B1B686E -:1086900093F83410134B1B6897B2B94201D80024E9 -:1086A0001BE01C4613F89C6B0132002EF4D14FF0F6 -:1086B00001089C22314620461BF02FFB1822314630 -:1086C00084F80080A571278104F158001BF025FB78 -:1086D00013F0EEFA404614F061FA2046BDE8F0814E -:1086E000DC4D0021DC39002108B50023A0F87C30E6 -:1086F00080F88030C3700371C375038013F0E0FA13 -:10870000BDE80840012014F05FBA000001460022D5 -:1087100030B5094B1B6893F83440084B1B689442F2 -:1087200001D8002030BD1D78184615B19D798D42C5 -:10873000F8D001329C33F2E7DC4D0021DC39002116 -:1087400070B50C46054615F0FFF84FF462720D4EF9 -:108750000D4B1860336893F8353002FB030015F0B9 -:10876000F3F89C22094B1860336893F8343002FB0D -:108770000300401BA0429BBF054B064A00209A61A4 -:1087800070BD00BFDC4D0021E4390021DC3900213F -:108790006850002188039C0030B500244271039A80 -:1087A00001290480C470047181708471826002D1D7 -:1087B0000373C47630BDB3FBF1F20F2901FB123312 -:1087C00028BF0F2113440373C47600F10C03C0F1DA -:1087D000FF2000F57F00D5B2F530C2189142E9D9EB -:1087E0001A782A4403F8012FDC73F6E78378012B0B -:1087F00005D190F8FC02431E5842584170470020B2 -:108800007047000030B50A4B4FF462741B6893F850 -:108810003520084B1968002318469A4200D830BD0D -:1088200004FB03F54D5D0DB90130C0B20133F4E72F -:10883000DC4D0021E43900212DE9F04100250646F8 -:108840002C464FF00A08077DAF4202D82046BDE80B -:10885000F08108FB05F3B2693078D15CFFF7A0FE28 -:1088600008B10134E4B20135EEE72DE9F04100250D -:1088700006462C464FF00E08C77CAF4202D8204671 -:10888000BDE8F08108FB05F372693078D15CFFF731 -:1088900087FE08B10134E4B20135EEE7C07D7047D0 -:1088A0000846704738B50546E5E92A2304462846B8 -:1088B00013F05EFA0123D4F8E42084F8D63082EA7B -:1088C0001242E189A4F8D8202846002213F06EFA5B -:1088D00084F8E000284613F0B6FA002384F8E1009B -:1088E000237738BD2DE9F04707460026DFF86C8076 -:1088F000DFF86C90DFF86CA0D8F8003093F83530D2 -:10890000B34201D8BDE8F0874FF462737343D9F8DE -:108910000020D418E188B9421ED1D35CE3B14FF4F2 -:1089200095622546DAF8003002FB0733D3E9862347 -:10893000E5E92A23284613F01BFA01230022E189E6 -:10894000284613F033FA84F8390184F8E000284609 -:1089500013F079FA84F8E1000136CDE7DC4D00210F -:10896000E4390021B43A0021254A70B515684FF466 -:1089700095620446C38800F5BE7602FB0355314676 -:1089800005F2A92205F2992016F09AFED5F8B9321F -:10899000C4F88C31D5F8BD3294F88C21C4F89031EC -:1089A000D4F8E4305A4084F88C2194F88D2182EA7E -:1089B000132284F88D2194F88E2182EA134284F8E0 -:1089C0008E2194F88F2182EA136384F88F3101237A -:1089D000A27A84F8A531B2FA82F20A4B52091B68D6 -:1089E00084F8A42113B13046217A984795F8A43031 -:1089F00084F8943195F8A53084F8953170BD00BFA6 -:108A0000B43A0021743A002100F1580200F17003D9 -:108A100052F8040B38B1884202D1012048707047E7 -:108A20009A42F5D10020704700F1580200F170031E -:108A300052F8040B40B1884203D1002301204B704F -:108A400070479A42F4D10020704770B5C46E054655 -:108A50000E462CBB00F1580353F8042B22B9012019 -:108A6000163445F8246070BD31691269914214D9F9 -:108A700004F11700052C4FEA8000A0F10401C4BFE7 -:108A80006C217020C4F105024FEA82022944C8BF5C -:108A9000002228441BF027F9E1E70134062CDBD142 -:108AA0000020E0E7C36E10B573B900F1580252F828 -:108AB000044B8C4203D024B9163340F82310012014 -:108AC00003E00133062BF2D1002010BD10B50023C6 -:108AD000044600F1580252F8040BA0B1884213D1A9 -:108AE00003F116008000C3F10502052B00F104011B -:108AF0004FEA82022144C8BF002220441BF0F3F851 -:108B000000230120E36610BD0133062BE3D10020D2 -:108B1000F9E700F15803703053F8042B1AB152787A -:108B20001AB98342F8D1012070470020704738B548 -:108B30000446FFF7EEFF50B98B7A20461BB9BDE81B -:108B40003840FFF771BFBDE83840FFF7BFBF0020D6 -:108B500038BD00F1580200F17003002052F8041BE8 -:108B600019B1497809B10130C0B29A42F6D17047C3 -:108B700000F1580200F1700352F8040B20B1417863 -:108B800011B99A42F8D10846704700F1580200F135 -:108B9000700352F8040B38B1417811B1B0F84A10A3 -:108BA00011B19A42F5D10020704738B50446FFF75D -:108BB000B0FF68B904F15803703453F8042B22B1A4 -:108BC00055781DB18B1A5842584138BDA342F4D193 -:108BD0000020FAE710B50446FFF79BFF034658B99B -:108BE00004F15802144654F8040B30B1884203F1E2 -:108BF00001030CD1052B01DD002010BD52F823002C -:108C00000028FAD041780029F7D10133F2E7062B8A -:108C1000E9D1F1E738B50446FFF77BFF68B904F105 -:108C20005802703452F8043B2BB18B4206D05D7869 -:108C3000002D18BF1846A242F4D1002038BD00F123 -:108C4000580200F1700352F8041B29B1487808B1AA -:108C5000087E10B19A42F6D101207047002110B56C -:108C600000F15803703053F8042B22B1547804B14A -:108C700011768342F7D110BD70B50024012500F1B3 -:108C80005802703052F8043B43B15E7826B18B42F3 -:108C900000D00CB101241D769042F3D170BD10B507 -:108CA0000446302014F0C4FD58B100230246C362CC -:108CB000234604F12C0153F8044B8B4242F8044B39 -:108CC000F9D110BD10B504460846FFF7E8FF30B1F2 -:108CD000237A2BB9C4E9000001200133237210BDAF -:108CE0006268D0626060F7E710B50446007A58B158 -:108CF0002068C36A236014F0C1FD237A013BDBB214 -:108D0000237203B96360012010BD38B5037A0446AD -:108D10000BB1056805B938BD2046FFF7E5FFED6AE0 -:108D2000F8E70000F7B50446C07AFFF7EFFC00262D -:108D3000002200230546C4E90A23C4E90C230121CB -:108D40002089E68184F8466084F8FC6284F8CA626F -:108D500004F06EFF0221208904F06AFF04F58A7096 -:108D6000FFF7D3FF04F59070FFF7CFFF04F52E70E7 -:108D7000C4F8ED60A4F8F160C4F8F360A4F8F760FB -:108D800015F007F804F1500015F003F821462846C5 -:108D9000FFF70BFF01280BD1AB786876012B1BBFC7 -:108DA00094F8EC22D4F8F032D4F808315343EB6154 -:108DB000A37A264E012B25D1002321462846237075 -:108DC000FFF7B5FE2846FFF7A4FE10B12846FFF7CF -:108DD0008BFC204605F0B2FB33781BB10521204601 -:108DE000EFF7A8F804F5567528460DF1070114F0C1 -:108DF000D1FD38BB94F8D81204F55A7005F030FD57 -:108E000003B0F0BD21462846FFF791FE2846FFF744 -:108E100080FE88B100276B796F76012BEF702F7180 -:108E20000AD10B4B18680B4B281A801058430A3094 -:108E3000C0B213F013FD6F713378012BC9D1002339 -:108E40002370BFE714F08EFDCEE700BF000D0021B8 -:108E5000DC390021976FF996007AB0FA80F040096A -:108E60007047000038B5154B1C684FF4956303FB41 -:108E70000044B4F82C04FFF777FB034610B9002533 -:108E8000284638BD0579012DF9D194F87F2352B1D8 -:108E9000002384F87F3394F88033002BEFD0042133 -:108EA000EFF75EF8ECE794F876231AB1D4F86C2269 -:108EB000002AE4D104211846F2E700BFB43A0021A9 -:108EC00070B5054600240D4B1B6893F835600C4BBC -:108ED0001A68A3B29E4202D80021084670BD1178DC -:108EE000012907D1D388AB4204D11046FFF77EFC9D -:108EF0000028F2D1013402F56272EAE7DC4D00216C -:108F0000E439002108B5FFF72FFB40B10378012BAE -:108F100005D1FFF76BFC003818BF012008BD002009 -:108F2000FCE7C2680B46920004D5282103F15000EB -:108F300014F020BF7047C3689B0003D501F15000B7 -:108F400014F027BF70470000022816D0032817D05E -:108F5000012821D10E32D200022902F196021DD041 -:108F600003291FD0012902D10E3302EBC302144B97 -:108F70001B68D88E9630104470470F329200EBE792 -:108F8000104804328069C0024BBF1201920102F501 -:108F9000E77202F53472DFE70022DDE70F3302EB00 -:108FA0008302E4E7074904338969C9024BBF02EB36 -:108FB000031202EB831202F5E77202F53472D6E770 -:108FC000DC4D0021205000212DE9F0410024054610 -:108FD00026464FF00A08077DA74202D83046BDE872 -:108FE000F08108FB04F3AA692878D15CFFF7D8FA6E -:108FF00090F82C3190F8302190F8D51290F8D402E6 -:10900000FFF7A2FF01340644E6E700004FF4627266 -:1090100010B50B4C0021236893F835305A43094BA7 -:1090200018681AF07AFE9C2223680021BDE81040DF -:1090300093F834305A43044B18681AF06EBE00BFE0 -:10904000DC4D0021E4390021DC39002110B5837AA0 -:109050000446FBB9B0F8DA2294F8D8322BB9D4F828 -:10906000283313B9A36AC4F82833D4F828332089E5 -:10907000591CC4F8281394F8201305F0C1FC0A4ABF -:10908000127852B914F06EFCD4F82833013BC4F8BE -:10909000283310BDB0F8DC22DEE70028F4D0BDE8AC -:1090A000104004F075BC00BFDC5000212DE9F041F8 -:1090B0000026038988B00446314600F55A70ADF8A1 -:1090C0000030ADF8046005F0DFFC0546002875D1DE -:1090D000414B9B699B0366D5A37A012B74D194F80D -:1090E000A130002B5FD105F081FC064600285AD044 -:1090F00014F0E8FB394A53780133537014F0EEFB57 -:10910000A37AD4F80053002B63D1D4F8E0321D4485 -:1091100023891422ADF808304FF481730021C4F87C -:10912000005303A8ADF80A301AF0F7FD236B02A92B -:10913000ADF81430022330468DF81830049508F04D -:1091400010F83346226B218904F5427005F06EFA5F -:1091500010B9304614F006FC94F80833012B04D102 -:109160001F4B2021187B14F0A1FCBDF80430012511 -:109170000133ADF8043016E033464046226B2189B6 -:1091800005F054FA10B9304614F0ECFB0125BDF897 -:1091900004300133ADF80430384602A914F0FAFB6C -:1091A00006460028E8D10E4BDB6A23B11DB16946A3 -:1091B000012001AA984708B0BDE8F081354604F5C2 -:1091C0005E7704F54278E7E7002BECD194F8613044 -:1091D00087E7D4F8E4329AE720500021DC500021E0 -:1091E00068500021F0B5038989B0ADF80030002344 -:1091F0000446ADF8043005F0F9FB294F0546002878 -:1092000041D014F05FFB274A53780133537014F0B8 -:1092100065FBA37AD4F80063002B3DD1D4F8E0328B -:109220001E4423891422ADF808304FF481730021C5 -:10923000C4F8006303A8ADF80A301AF06EFD236B82 -:1092400002A9ADF81430022328468DF81830049690 -:1092500007F087FF2B46226B218904F5427005F049 -:10926000E5F910B9284614F07DFB94F80833012B7A -:1092700003D12021387B14F019FC0125BDF80430FE -:109280000133ADF80430FB6A23B11DB169460120FA -:1092900001AA984709B0F0BDD4F8E432C0E700BF96 -:1092A00068500021DC5000212DE9F843D0F8343318 -:1092B00004469E073CD54F4B9B691D0438D54E4A4A -:1092C0004E4B156800221B68DFF8348193F8351087 -:1092D000D8F800304B4FC31ADB107B4391422AD998 -:1092E000E88898422ED1287860B395F8CA0248B32E -:1092F000AB7A012B21D195F8D42294F855309A42BB -:1093000019D094F84534D4F8481404F24C49B1FB10 -:10931000F3F14942484649B2F9F786FE0023C4F802 -:10932000483484F84534AB7A83B195F8D4620FE0C1 -:10933000002384F81A34BDE8F883002BE1D195F8B6 -:10934000D522DAE7013205F56275C7E795F8D562EF -:10935000032E34D195F8463103F0FD03581E4342E5 -:1093600043411E4494F85134F6B2032B29D800250A -:1093700094F82A349D4202DA5B429D42DBDC94F889 -:109380008533162BD7D0D4F88C335B02D3D4062088 -:1093900014F0E0FA014670B1D8F800300571E31A14 -:1093A000DB107B43038042F601034380164B46717A -:1093B000187B14F0E0FA002384F85134BBE7002353 -:1093C000CFE74846F9F722FE94F91C54854207DAA4 -:1093D000A31993F83D33D90702D42D1A6DB2C7E70C -:1093E00094F91D548542C2DDA31993F83D339A07C1 -:1093F000BDD4F2E720500021E4390021DC4D0021EA -:10940000B43A0021BDCAE28C68500021F8B50024AE -:109410009C270C4D0C4E2B6893F83420E3B29A42F3 -:1094200000D8F8BD7B433268D018D35C1BB1C37D34 -:109430001BB9FFF759F90134EDE7283013F0C8FFE5 -:10944000F9E700BFDC4D0021DC390021837810B53D -:10945000FF2B04460AD00088FFF786F850B1064B70 -:10946000E1781C60BDE8104008F04AB8BDE8104043 -:10947000FFF7CCBF10BD00BFE0390021022803D0A8 -:10948000042814BF012003207047531E434301FBEF -:1094900000010133C9B2DBB2B1FBF3F203FB1211DD -:1094A000C9B2D0B209B10130C0B2704770B50D4633 -:1094B00042F21074194642F21173654303FB00F641 -:1094C000B6FBF5F405FB146606B1013442435A437A -:1094D000B2FBF5F005FB102202B1013004EB84046D -:1094E000204412F070FB023070BD00002DE9F047FF -:1094F0001378164603730B7B0D4680F8D6324B7BF0 -:10950000044680F8D73240F2E24391F80EE080F84A -:10951000D8E24A6841F288309A428A6898BF4B6024 -:109520009A4298BF8B60D1E901C161450A4628BFC4 -:109530006246904238BF1046BB4BB6F80280A0FB93 -:109540000337DB0F43EA470340F2E2479BB25F4336 -:10955000B84288BF0133A4F8E832B079B388B34F7A -:10956000BEF1000F0FD140F2E249B4F8E8E209FB86 -:109570000EFEB2FBFEFA0EFB1A22002A00F0588102 -:10958000012284F8D822C4E9B8C1B8F1000F61D132 -:10959000424667E03B6893F8380040F2E2494FF4F6 -:1095A0007A7884F8EA02B4F8E812688A3B6809FB22 -:1095B00001F108FB00F093F838A012F001FB82459E -:1095C00025D23B6893F83820B4F8300184F8EB22B8 -:1095D00040BB84F8F402B4F82C0178BB84F8F5029F -:1095E00094F8EA72317A757A94F8F40294F8F532C4 -:1095F000BA4228BF3A46A94238BF2946984238BFE6 -:109600001846FFF742FF84F8EC02BDE8F087B4F893 -:10961000E812688A09FB01F108FB00F012F0D0FAA9 -:10962000C2B2D1E7B4F8DA52B5FBF0F1CBB24143A4 -:10963000A942B8BF013384F8F432CCE7B4F8DC5265 -:10964000B5FBF0F1CBB24143A942B8BF013384F876 -:10965000F532C5E73A6808F10501D28D8A42A8BF04 -:109660000A4692B2A4F83021002B00F0AA803A6892 -:10967000591DD28D8A42A8BF0A4692B2A4F82C2165 -:10968000A4F8DC32A4F8DA820AF02DFBFFF7F6FE2C -:1096900084F8D402F0790AF026FBFFF7EFFE40F2DF -:1096A000E2494FF47A7884F8D502B4F8E812288AAF -:1096B0003B6809FB01F108FB00F093F838A012F0B9 -:1096C0007FFA82457FD23B6893F8380040F2E24946 -:1096D0004FF47A7884F8EA02B4F8E812688A3B68B2 -:1096E00009FB01F108FB00F093F838A012F068FACA -:1096F000824573D23B6893F8382084F8EB22B6F8A1 -:109700000280B4F8DAE2B8F1000F72D03B68D98D6C -:109710000EF105039942A8BF1946C9B2B388B4F83F -:10972000DC023BB13B6800F1050CDB8D6345A8BF53 -:109730006346DBB2BEF1000F5DD184F8F4E200288D -:1097400066D184F8F50294F8EAC2717A337A6245F8 -:1097500094F8F4A294F8F50238BF6246994238BFF3 -:109760001946504538BF5046FFF78FFE40F2E2439E -:10977000B4F8E89284F8EC0203FB09F94246534638 -:1097800069684846FFF792FEB288804694F8F53241 -:109790004846A968FFF78AFE72882AB13B68DA8DCD -:1097A000424528BF424692B2B388A4F830212BB17B -:1097B0003B68DB8D834228BF03469BB2A4F82C3163 -:1097C00023E71A465AE7B4F8E812288A09FB01F1A0 -:1097D00008FB00F012F0F4F9C0B277E7B4F8E81231 -:1097E000688A09FB01F108FB00F012F0E9F9C2B246 -:1097F00083E7414692E7BEFBF1F909FB01F15FFA0D -:1098000089FC8E45C8BF0CF1010C84F8F4C296E7C0 -:10981000B0FBF3FC0CFB03F35FFA8CF19842C8BF7A -:10982000013184F8F5128EE7E3361A00DC4D002191 -:109830003A68C4E9B8C1D28DA4F8DC324245114679 -:1098400028BF41469A4228BF1A46A4F83011A4F80E -:109850002C21A4F8DA820AF046FAFFF70FFE84F80A -:10986000D402F0790AF03FFAFFF708FE4FF47A7855 -:1098700084F8D502B4F8E812288A3B6809FB01F1A4 -:1098800008FB00F093F838A012F09AF98245FFF433 -:1098900081AEB4F8E812288A09FB01F108FB00F058 -:1098A00012F08EF9C0B278E62DE9F0470646194B62 -:1098B00000271B684FF09C0A5D8E13F01DFADFF83D -:1098C00058800544D8F80030F41A144BA4105C43B7 -:1098D000E4B2FBB29C420ED8F46813F00DFA40F2E9 -:1098E000E242B38A204453435B1B98428CBF002062 -:1098F0000120BDE8F087D8F800300AFB07331A7959 -:1099000032B1D3F8349013F0F7F909EB0503C51819 -:109910000137DEE7DC4D0021DC390021976FF99635 -:109920002DE9F84F06460C464FF000084FF00E0A9E -:10993000E27C2078424563691FD8677C1978012F43 -:1099400040F08A80FEF72CFE4FF00E0B054690F893 -:10995000EC32D0F8F0225343C0E90433F360B0F89E -:10996000E832B382E37CBB424BD8637C3046B370B1 -:10997000FFF79AFFB075BDE8F88F0AFB08F2995C13 -:10998000FEF70EFE014605463046FFF78BF8637C76 -:10999000012B29D10027B94612E00AFB07F36269BF -:1099A0002078D15CFEF7FCFD90F82C3190F8302146 -:1099B00090F8D51290F8D402FFF7C6FA0137814427 -:1099C000E37C9F42E9D395F82C3195F8302195F846 -:1099D000D51295F8D402C5F8F092FFF7B5FAC5F89C -:1099E000080108F10108A3E795F82C3195F830211A -:1099F00095F8D51295F8D402FFF7A6FAC5F8F0024B -:109A0000EDE70BFB07F362692078D15CFEF7C8FD38 -:109A10004FF000088146C2460BFB08F362692078CC -:109A2000D15CFEF7BDFD90F82C3190F8302190F814 -:109A3000D51290F8D402FFF787FA08F101084745DC -:109A40008244E9D12B690137A3EB0A03C9F810302E -:109A50002B69C9F8143085E7FEF7A2FD00270546FB -:109A60004FF00E0AE37CBB4205D82B69F360B5F8D2 -:109A7000E832B38279E70AFB07F362692078D15CA8 -:109A8000FEF78EFDB9468046E37C4B4504D82B6932 -:109A90000137C8F81430E5E70AFB09F3626920785A -:109AA000D15CFEF77DFDD8F8103090F8EC22D0F8AC -:109AB000F01209F1010901FB0233C8F81030E3E7A5 -:109AC00038B54B680446C0F8E0328B681546C0F8DC -:109AD000E4320B7B80F8EA324B7B80F8EB32CB89A7 -:109AE000A0F8E8320B7C80F8D6324B7C80F8D73275 -:109AF0008B7C80F8D83213780373537880F8EC327B -:109B00005388A0F8DA329388A0F8DC32907A0AF011 -:109B1000EAF8FFF7B3FC84F8D402E87A0AF0E3F835 -:109B2000FFF7ACFC84F8D5022B7B84F8F4326B7B16 -:109B300084F8F532F9F7F8F94FF495610A4BE288A9 -:109B40001B68C4F8E40001FB0233D3F84822B3F8E1 -:109B50008232C4F8E820A4F8C832EB88A4F8303187 -:109B60002B89A4F82C3138BDB43A00212DE9F041FD -:109B700000244FF462780E4E0E4F336893F8353060 -:109B8000A34201D8BDE8F08108FB04F33A68D51878 -:109B9000D35C53B105F1FC0014F09CF828B9E87AC5 -:109BA000FEF7B4FD283013F03FFC0134E5E700BFB9 -:109BB000DC4D0021E439002170B500250A4E3368E0 -:109BC000ACB293F82230A34201D8002070BD2046E9 -:109BD00001F09EFB30B1204601F0BEFB10B92046DB -:109BE000FEF780FE0135EAE7DC4D002108B5EBF712 -:109BF00093FAEBF7F9F8FFF709FABDE8084012F01D -:109C000029BA00002DE9F84FDFF89080824698F8D5 -:109C10000130002B40D00025214C2A462F462646F5 -:109C20004FF0010904F11A0B31788D4214D38FB330 -:109C300092B389B3062013F08DFE014660B3F38919 -:109C4000038042F20143438073888380154B187B65 -:109C5000BDE8F84F13F08FBE9BF80010A9B9E18959 -:109C6000514511D104208BF8009013F073FE01468A -:109C700040B162880B4B028040F20F224280187B79 -:109C800013F079FE012200E00127013502340BF1C7 -:109C9000010BC9E788F80170BDE8F88FB0500021CA -:109CA000E8390021685000212DE9F84F05460C469F -:109CB00000274FF00A08237DBB4217D84FF00A094E -:109CC000677BAE6D012F6BD196F8EC32D6F8F0229F -:109CD0005343C6E90433EB60B6F8E832AB82237D28 -:109CE000BB4232D8002640F2E247F4E008FB07F31B -:109CF000A2692078D15CFEF753FC0146064628464F -:109D0000FEF7D0FE637B012B12D12046FFF75CF9F2 -:109D100096F82C31C6F8F00296F8302196F8D51254 -:109D200096F8D402FFF710F9C6F808010137C2E728 -:109D300096F82C3196F8302196F8D51296F8D40280 -:109D4000FFF702F9C6F8F002EEE709FB07F3A26994 -:109D50002078D15CFEF724FC4FF000088246C34611 -:109D600009FB08F3A2692078D15CFEF719FC90F892 -:109D70002C3190F8302190F8D51290F8D402FFF7EA -:109D8000E3F808F1010847458344E9D13369013715 -:109D9000A3EB0B03CAF810303369CAF814309EE7FE -:109DA00033461946002091F8EC72D1F8F02202FBFC -:109DB000070005F15807BC4600225CF804EB0132AD -:109DC000714517D1163255F822100029EBD1002227 -:109DD00018613169596157F8040B013283420CD183 -:109DE000163255F82230002BDBD1B6F8E832E960A4 -:109DF000AB8277E7052AE0D1E9E7052AEBD1F4E762 -:109E000009FB06F3A2692078D15CFEF7C9FB4FF489 -:109E10007A7390F8D8C2228ABCF1010F03FB02F2D8 -:109E200090F8EA82D0F8E032D0F814E0B0F8E81206 -:109E300036D17344D21A07FB01F39A423BD3B2FBEB -:109E4000F3F2D3B2434528BF434680F8EA329B463B -:109E50004FF47A73628ABCF1010F03FB02F207FB35 -:109E600001F190F8EBA2D0F8E48226D1C644A2EB2F -:109E70000E028A4203D3B2FBF1F15FFA81FCE245A4 -:109E8000524628BF624680F8EB22BBF1000F1FD17B -:109E9000637B2846AB70FFF707FDA875BDE8F88F18 -:109EA0001A4407FB01F3A2EB0E029A4203D3B2FB62 -:109EB000F3F3DBB2C6E70123C4E74244A2EB0E0E84 -:109EC0008E4502D3BEFBF1F1D7E74FF0010CD6E788 -:109ED000002ADDD00136237D9E4291D30027B8466B -:109EE000237D9F4204D3B8F1000F7FF4E9AECFE7A2 -:109EF00009FB07F3A2692078D15C9A46FEF750FB74 -:109F00000646A36990F8EBE290F8EA22534493F8EE -:109F100009C0197A90F8F40296F8F532724528BF14 -:109F20007246614538BF6146984238BF1846FFF710 -:109F3000ACFA96F8EC32013783421CBF4FF00108AF -:109F400086F8EC02CCE700002DE9F84F04460078D3 -:109F50000F46FEF7DBFB054640B92078FEF792FB83 -:109F6000054618B907263046BDE8F88FEB7D0BB1E2 -:109F70000C26F8E7884B5B78012BF9D06E78002E21 -:109F8000F6D12046FEF758FC844B8046D3F800C03B -:109F90004FF00A0E334694F81490994529DCB8F135 -:109FA000000F71D1FEF72EFC814500F2F380C2460E -:109FB0004FF00A0B237D43452CD821462846FFF756 -:109FC00073FE4FF001084FF00A09434695F81680DA -:109FD000B8F1000F54D000274FF00A08237D9F42AC -:109FE000C0F0C680AA7D002A00F0CC8085F88030C1 -:109FF000B9E7A2699CF830A00EFB0322107A517ACF -:10A00000504528BF5046514528BF514610725172E5 -:10A010000133C2E72846FEF761FA814680F80AA0BC -:10A02000A26921460BFB0822FFF760FAB9F8083055 -:10A0300027F8183008F10108BCE737F81A00FEF7D6 -:10A0400093FAA26909FB0A22137A1BB14FF00108A7 -:10A05000013B1372537A1BB14FF00108013B53725D -:10A060002146FFF743FA21462846FFF71DFEAB7D48 -:10A07000002BAAD10AF1010A237D5345DDD8A4E7BC -:10A08000012BA8D1C246F7E7FEF7BCFBA9EB0808F5 -:10A0900080453FF767AF4FF00009CB46237D4B4526 -:10A0A00011D821462846FFF7FFFD4FF001084FF079 -:10A0B0000A09434695F81680B8F1000F8BD1012BA1 -:10A0C00089D1C24650E00A2303FB09FAA26920782D -:10A0D00012F80A10FEF764FA8046E0B190F80433F3 -:10A0E000A269FF2B524403D05388002B3FF440AFAA -:10A0F00098F80833FF2B03D09388002B3FF438AF38 -:10A1000021464046FFF7F2F9B8F8083027F8193031 -:10A1100009F10109C2E72846FEF7E0F980F80AB024 -:10A12000A269804621465244ECE737F81A00FEF750 -:10A130001BFAA26909FB0A22137A1BB14FF001082E -:10A14000013B1372537A1BB14FF00108013B53726C -:10A150002146FFF7CBF921462846FFF7A5FDAB7D49 -:10A16000002BA6D10AF1010A237D5345DDD8A0E7D3 -:10A1700008FB07F3A2692078D15CFEF711FA90F88A -:10A18000EA320BB91126EEE690F8EB32002BF9D04B -:10A19000013723E70926E6E6B0500021DC4D002117 -:10A1A0002DE9F0470746FEF7B1FA0546002844D0EE -:10A1B0000022DFF88C80DFF88C90D8F8003093F81C -:10A1C0003510D9F80030914211D82846FEF766FBC9 -:10A1D0000446A8B906464FF4627AD8F8003093F8DE -:10A1E0003530B34218D82846FEF77EFA09E01878D1 -:10A1F00001280DD1D87AB8420AD1987A012803D122 -:10A200000C242046BDE8F08793F847000128F7D0DA -:10A21000013203F56273D6E70AFB06F3D9F8002092 -:10A22000D018D35C012B06D1C37ABB4203D1837A09 -:10A230000BB9FEF795F90136CFE70224E1E700BF3D -:10A24000DC4D0021E43900212DE9F84F0446007867 -:10A250008846FEF75BFA28B1C37D002B5BD12078DE -:10A26000FFF79EFF2078FEF70DFA064610B907208B -:10A27000BDE8F88F2046FEF7F8FAE77C054618BBE4 -:10A28000FEF7C0FA874248D8A9464FF00E0AE37C91 -:10A29000AB4208D830462146FFF742FBE37C002062 -:10A2A00086F88030E4E73046FEF718F9074680F874 -:10A2B0000A90626921460AFB0522FFF701FC3B89EF -:10A2C00028F815300135E2E73D1AFEF79BFA854282 -:10A2D000CDDC00274FF00E09BA46E37CBB42D9D94A -:10A2E00009FB07FB6369207813F80B10FEF758F998 -:10A2F000054648B1626921465A44FFF7E1FB2B89C4 -:10A3000028F817300137E8E73046FEF7E7F805464A -:10A3100080F80AA0EEE70C20AAE70920A8E70000D1 -:10A3200008B51E4A1E4B1F48DA631F4B1F4ADA63EB -:10A330001F4B204A1A60F8F729FE1F4B1F4A1A606C -:10A340001F4B204A1A61204A5A61204A9A61204ACA -:10A35000DA61204B204A9A61204ADA61FEF756FE04 -:10A3600011F078FE03F028FE1D4B1E4A1A601E4BAA -:10A370001E4A1A601E4B1F4A1A601F4B1F4A1A6062 -:10A380001F4A204B1A60204B1B681B790A2B81BF88 -:10A390001E4A136A43F08053136208BDED9B01010E -:10A3A000040D0021B99B0101B00C00214D94010165 -:10A3B000EC4D0021E58801011C3A0021A992010120 -:10A3C000780C00216D9B01010DD601016DD50101B5 -:10A3D00021E00101C04B0021E11B0201411A0201F1 -:10A3E000143A0021058F0101203A0021059C01014A -:10A3F000783A0021DD850101703A00215D86010176 -:10A4000071860101183A0021DC4D002168500021BD -:10A410002DE9F047DFF8A880044698F801300D4692 -:10A42000012B46D000264FF0010AB146B44220D895 -:10A430000123002288F80130224B10461E461C7072 -:10A4400003F11A01944203F1020326D1062013F00E -:10A4500081FA014658B1F389038042F201434380F7 -:10A4600073888380184B187B13F085FA0020BDE8B1 -:10A47000F0872B6833F81600FEF776F80746D0B160 -:10A48000FEF7B4F9012818D0F87AFEF73FF9013643 -:10A4900087F8199080F801A0C8E72F6837F8127084 -:10A4A0001F806F6837F8127001329F8101F8010B2D -:10A4B000C8E70C20DBE70220D9E70B20D7E700BF75 -:10A4C000B0500021E8390021685000212DE9F04109 -:10A4D0000546FEF74DFB3D4B0446B0F8068000F5FF -:10A4E0009C7730220021286705F128001E6819F0AA -:10A4F00014FC4FF4C0720021384619F00EFC0A23F8 -:10A5000084F8383194F8E03040F2011284F839319F -:10A510002F4B1B6893F82830A4F8482184F83A316F -:10A52000D4F8E430C4F83C31D4F8E830C4F8403111 -:10A53000B4F8D432A4F84431264B9B69DB025DBFEA -:10A540004FF4956303FB086393F85620A4F8462163 -:10A550005CBF84F8462193F857301F4A58BF84F8EF -:10A56000473140F20123A4F8963104F12803C4F8DE -:10A570009C3104F13003C4F8A031EB686A64AB632A -:10A580004FF48073A5F840300123144A85F8423017 -:10A59000C5E91225124A6F65C4F8D021114AC4F8E2 -:10A5A000D421114AC4F8D821104AC4F8DC21104A39 -:10A5B000C4F8E0210F4AC4F8E4210F4AC4F8E821A6 -:10A5C0000E4AC4F8EC21EB70BDE8F081B43A0021EA -:10A5D000DC4D00212050002125FB00011DFF000162 -:10A5E00075F700013BFA000175F9000107FA000157 -:10A5F00027FA000123FB000131FF000145FF0001A4 -:10A60000304B70B54FF4C0720446C688002100F587 -:10A610009C701D6819F081FB0A2384F8383194F886 -:10A62000E03040F2011284F83931274B1B6893F86F -:10A630002830A4F8482184F83A31D4F8E430C4F83A -:10A640003C31D4F8E830C4F84031B4F8D432A4F83E -:10A6500044311E4B9B69DB025DBF4FF4956303FBE6 -:10A66000065393F85620A4F846215EBF84F846218D -:10A6700093F8573084F8473140F20123A4F896311B -:10A6800004F12803C4F89C3104F13003C4F8A0316C -:10A690000F4BC4F8D0310F4BC4F8D4310E4BC4F873 -:10A6A000D8310E4BC4F8DC310D4BC4F8E0310D4B02 -:10A6B000C4F8E4310C4BC4F8E8310C4BC4F8EC316D -:10A6C00070BD00BFB43A0021DC4D002120500021B4 -:10A6D00075F700013BFA000175F9000107FA000166 -:10A6E00027FA000123FB000131FF000145FF0001B3 -:10A6F0002DE9F743B2F84830B1F806529046AB4224 -:10A700000446CA69B1F80AC200F1280942D8B1F872 -:10A710000462B1F85E74073606FB0757BEB240F21A -:10A72000E247808AA8F84860761B0CFB06F61D4BB2 -:10A7300007FB06251E681C4BA61BB6105E430323B1 -:10A740000A3600932A4601F114037843F1B212F05D -:10A75000A9F8B0F5FA7F38BF4FF4FA70C8F84C008A -:10A7600040F2E241D8F84C2048461544D8E9042389 -:10A77000D21AE368256313446363A38A15444B43E9 -:10A780006562E363094912F04BFC0123237103B0B6 -:10A79000BDE8F0835E1B40F2E2450CFB06F605FBCC -:10A7A0000625DDE7DC390021976FF996A1880101C4 -:10A7B0009C235843054BA0F5C3601B6803441879DC -:10A7C00018B1586A09B1DB680B607047DC390021A9 -:10A7D0001A4A70B5002315461178994207D906899F -:10A7E00032F8024FA6420AD101222B449A76002465 -:10A7F000134BA14205D80022124B5A7070BD013391 -:10A80000EBE713F8012BB2B9062013F0A3F80146C9 -:10A810000028F3D005EB4403DB8905EB44040380F7 -:10A8200042F2014343806388BDE870408380064B59 -:10A83000187B13F0A0B80134DBE700BFE839002132 -:10A84000023A0021B05000216850002108B5EAF713 -:10A8500063FCEAF7C9FABDE80840FEF7D7BB000081 -:10A8600008B5184A184BDA63184B194ADA63194BC2 -:10A87000194A1A60194B1A4A1A601A4B1A4A5A6135 -:10A880001A4A9A611A4ADA611A4B1B4A9A611B4AA0 -:10A89000DA61FEF7BBFB03F08FFB194B194A1A6014 -:10A8A000194B1A4A1A601A4A1A4B1A601A4B1B683B -:10A8B0001B790A2B81BF194A136A43F000531362B4 -:10A8C00008BD00BF4DA80101040D0021B00C0021FE -:10A8D0004D940101EC4D0021E58801011C3A002155 -:10A8E000A9920101780C00210DD601016DD501015D -:10A8F00021E00101E84B0021811D0201411A020102 -:10A90000143A0021058F0101783A0021DD8501010B -:10A910005D860101703A0021DC4D00216850002164 -:10A9200070B50E46FDF720FE0546F8B18478FCB9F7 -:10A93000C378022B1CD04FF495610E4BC2881B6864 -:10A9400001FB023393B19B7893B1062013F002F818 -:10A95000014648B1EB880671038042F201634380EF -:10A96000054B187B13F007F8204670BD0224FBE767 -:10A970000C24F9E7B43A00216850002138B5FDF7FE -:10A98000F3FD0546F0B18478F4B9C378022B1BD0EF -:10A990004FF495610D4BC2881B6801FB02338BB1EC -:10A9A0009B788BB1042012F0D5FF014640B1EB88B3 -:10A9B000038042F201534380054B187B12F0DBFF0A -:10A9C000204638BD0224FBE70C24F9E7B43A002105 -:10A9D000685000212DE9F0410546FEF7C9F83F4BCC -:10A9E0000446B0F8068000F59C77302200212867E5 -:10A9F00005F128001E6819F090F94FF4C07200218B -:10AA0000384619F08AF90B2384F8383194F8E0308D -:10AA1000B4F8D42284F83931314B52BA1B6893F818 -:10AA20002830A4F8442184F83A31D4F8E43040F2D4 -:10AA30000112C4F83C31D4F8E830A4F84821C4F835 -:10AA40004031284B9B69DB025DBF4FF4956303FBEC -:10AA5000086393F85620A4F846215CBF84F8462189 -:10AA600093F85730204A58BF84F8473140F2012309 -:10AA7000A4F8963104F12803C4F89C3104F13003A2 -:10AA8000C4F8A031D4F8F0326A646B63EB68174AFB -:10AA9000AB634FF48073A5F840300123C5E912255C -:10AAA000134A85F842306F65C4F8D021114AC4F8C2 -:10AAB000D421114AC4F8D821104AC4F8DC21104A24 -:10AAC000C4F8E0210F4AC4F8E4210F4AC4F8E82191 -:10AAD0000E4AC4F8EC21EB70BDE8F081B43A0021D5 -:10AAE000DC4D002120500021AD0601010D0B0101BC -:10AAF0007F040101410D0101A50C0101250D01019A -:10AB00002D0D0101AB060101210B0101350B0101E6 -:10AB1000304B70B54FF4C0720446C688002100F572 -:10AB20009C701D6819F0F9F80B2384F8383194F8FB -:10AB3000E030B4F8D42284F83931274B52BA1B687C -:10AB400093F82830A4F8442184F83A31D4F8E4305A -:10AB500040F20112C4F83C31D4F8E830A4F848219E -:10AB6000C4F840311D4B9B69DB025DBF4FF4956318 -:10AB700003FB065393F85620A4F846215EBF84F8E1 -:10AB8000462193F8573084F8473140F20123A4F866 -:10AB9000963104F12803C4F89C3104F13003C4F861 -:10ABA000A0310F4BC4F8D0310E4BC4F8D4310E4B4A -:10ABB000C4F8D8310D4BC4F8DC310D4BC4F8E0318A -:10ABC0000C4BC4F8E4310C4BC4F8E8310B4BC4F81F -:10ABD000EC3170BDB43A0021DC4D00212050002141 -:10ABE0007F040101410D0101A50C0101250D0101A9 -:10ABF0002D0D0101AB060101210B0101350B0101F6 -:10AC00002DE9F74F044616460F4600F1280BFDF7D5 -:10AC1000AFFF40F2E24AD7F8D0310546306EB7F8C0 -:10AC20000A2203440AFB0233B7F8C811A367A4F849 -:10AC30007E10F8F759F9626BA16F02EB4009A28A06 -:10AC40000B1A0AFB02F22363E2634FEA4008D6E9DB -:10AC500004329B1A0B4408F10108C4F83490636273 -:10AC600006F1A80AC5F800825846194912F0D8F929 -:10AC7000024620B10123237103B0BDE8F08FE989BA -:10AC80000123013189B2E981504611F08FF885F82E -:10AC90003901504611F0D7F886F8E100EA89A38A15 -:10ACA000B7F8C811534340F2E242534318460193A8 -:10ACB000F8F71AF9A26F019B13441B1A236309EBDF -:10ACC000000308EB40006363C5F80002CCE700BF57 -:10ACD000A188010110B5044612F0F4FD034B587829 -:10ACE00004445C70BDE8104012F0F8BDB45000217F -:10ACF000F8B50E46054612F027FE4FF495670C4B4B -:10AD000018600C4B1B6893F8224007FB0404611B7E -:10AD1000B14201D90020F8BD2046711A00F0C0FFF1 -:10AD20000028F7D0044B0444DF81601BF3E700BF29 -:10AD3000B43A0021DC4D002168500021028841888E -:10AD400010B58A4222D840F67A448B1F9BB2A342A8 -:10AD50001CD8063A92B2A24218D88388B3F5FA7F7B -:10AD600014D240F6C41201339BB24B43534342F218 -:10AD70001072C0884243934208D240F676430A38A4 -:10AD800080B298428CBF1220002010BD1220FCE738 -:10AD90004FF495620D4B15391B68C9B20E2902FBA1 -:10ADA000003310D80A4A525CFF2A0CD093F885135E -:10ADB0000120914208D0D3F88C339040184214BF40 -:10ADC0000120002070470020704700BFB43A0021E6 -:10ADD000B04E03014FF495635843054B1B681A1896 -:10ADE000185C18B1D2F88803C0F38000704700BF28 -:10ADF000B43A00214FF49562054B1B6802FB00300A -:10AE0000D0F8883343F00403C0F88833704700BF9C -:10AE1000B43A00214FF49562074B1B6802FB0033E4 -:10AE200093F80A2332B901200A8883F80A03A3F8A9 -:10AE30000823704700207047B43A002130B54FF422 -:10AE4000956409499DF80C50096804FB0010D0E98D -:10AE5000024125B122430B43C0E9022330BD24EA5D -:10AE6000020221EA0303F7E7B43A00212DE9F04793 -:10AE700000273D46DFF8D891DFF8D881D9F80030B7 -:10AE800093F82200D8F80030A3F59566A84201D8BF -:10AE90000020D8E007F59562B15CDC19002940F08C -:10AEA000D4804FF49562204618F037FF0123DFF875 -:10AEB000A8A12370DAE90623C4E90223DAE90A2308 -:10AEC000C4E9CC23C4E9CA2344F20172A4F88A225B -:10AED00045F20112A4F8E62345F201325F4BA4F8D3 -:10AEE000EA221B7B45F2014284F8903284F8EC336D -:10AEF00084F8F03284F8043384F8103446F60113F1 -:10AF0000574EA4F80A347388A4F8FE22A4F84A33F2 -:10AF1000D9F80030B288DB8CADB2FB2B28BFFB2305 -:10AF2000A4F846339B0103F57473A4F848331B233C -:10AF3000A4F84E334B4BA4F84C23C4F850334FF4D1 -:10AF4000A473A4F88852A4F8E453A4F8E852A4F82F -:10AF5000FC52A4F80854A4F8543340F2011304F24C -:10AF60004E31A4F85430204600F0DBFE04F24631A6 -:10AF7000A4F86003204600F0D4FEB37DB28A84F8C2 -:10AF80006433062384F896329AF84030A4F85E03BE -:10AF900084F8F233F37DA4F8622384F87033338BA2 -:10AFA000A4F87233738BA4F8743340F20223A4F82C -:10AFB0006633022384F868332B4B1B681BB11B6874 -:10AFC0000BB128469847D4F834230023910721D5A4 -:10AFD000DAF8182012041DD5012284F81A24D9F8B1 -:10AFE000002084F8193492F8421084F81C1492F866 -:10AFF0004320C4F8203484F81D24042284F81E342D -:10B0000084F82A2484F82934C4F8483484F8453470 -:10B0100084F851340125F269B38CC4F85424326A9F -:10B02000A4F85C34C4F85824A4F85E5410F040FE30 -:10B030009AF8003028462B448AF8003011F0AEFD13 -:10B04000D8F800003844BDE8F087174601351DE701 -:10B05000DC4D0021B43A002120500021685000212D -:10B06000B450002148011B00B83A0021F7B504464E -:10B0700001F0C3F8FFF72EFE204601F02BF82B4E0F -:10B0800004F5197738460DF1070112F083FC0546E7 -:10B0900000283CD104F5217012F07BFE04F5787095 -:10B0A00012F077FE04F5397012F073FE04F53E706D -:10B0B00012F06FFE04F2044012F06BFE04F28C40BA -:10B0C00012F067FE1A4B1B481D681B4B651BED10E9 -:10B0D00045431B68ADB21BB15B680BB1284698476E -:10B0E000164B1B680BB1284698470023D4F8000480 -:10B0F000237008B112F036FC10F0E2FD104A012076 -:10B100001378013B137011F05FFD03B0F0BD9DF8A3 -:10B110000730FF2B06D012F0D5FB337801333370A4 -:10B1200012F0DCFB284612F01DFCABE7B450002106 -:10B13000B43A0021BDCAE28CB83A0021203A00217D -:10B140002050002170B590F80F22034601FB022227 -:10B1500090F80E120A4491B2242909D94DF668528A -:10B160004A43520D02EBC20002EB8002891A89B2F7 -:10B17000C1F12005D3E98626A1F12004CA4006FAD0 -:10B1800005F52A4326FA04F42243C8B2D20783F80D -:10B190000E020AD493F810228A4203D8122A07D941 -:10B1A000801AC0B2184490F8200270BD801AC0B254 -:10B1B0008242FBD9F6E700221346F0B5D0E9867645 -:10B1C000C3F12005A3F1200427FA03F106FA05F5DF -:10B1D000294326FA04F42143C90744BF811881F8A2 -:10B1E000203203F1010348BF0132252BE8D180F85A -:10B1F0001022F0BD37B501460446684605F0FBFA5B -:10B200002E4ABDF80030116891F822209A4209D8E0 -:10B21000204612F0A7FB2A4B01215B68BDF8000015 -:10B2200098470AE04FF495625343264A1268D518AE -:10B23000D35C23B9204612F095FB03B030BD6B7888 -:10B24000032BE5D0204A9DF8023012680AB9032B7F -:10B25000DED0032BBDF8042000D062B3C98C91422C -:10B2600007D2002BD4D1002AD2D1012385F8813214 -:10B27000CEE712F027FB154A1378013B137012F04A -:10B280002DFB95F8983273B9284600F05EFD2346F1 -:10B2900001466A46284600F08DFD094B0421187BC3 -:10B2A00012F004FCC9E722469DF8001005F519705C -:10B2B00012F05BFBC1E7002BD7D0A9E7DC4D0021E2 -:10B2C00068500021B43A0021B83A0021B45000215E -:10B2D00070B54FF495660B4B0B4D1B6893F82240ED -:10B2E000013C06FB04F32A68D018D35C2BB9631E1B -:10B2F0000CB9204670BD1C46F3E700F05DFF002846 -:10B30000F5D0F7E7DC4D0021B43A0021FFF7E2BCAD -:10B310004FF49562024B50431B68185C704700BFA6 -:10B32000B43A0021024B1B6803B118471846704716 -:10B33000143A0021034B1B6803B118474FF6FF7006 -:10B34000704700BF703A0021024B1B6803B11847D9 -:10B3500018467047183A00214FF49562024B1B685B -:10B3600002FB003398787047B43A00214FF495629D -:10B37000034B1B6802FB003393F90C02704700BFBC -:10B38000B43A00214FF49562034B1B6802FB003373 -:10B3900093F94A00704700BFB43A00214FF4956218 -:10B3A000034B1B6802FB0033D3E98601704700BFE3 -:10B3B000B43A00214FF49562034B1B6802FB003343 -:10B3C000D3E9CC01704700BFB43A00214FF4956235 -:10B3D000034B1B6802FB003393F85400704700BF17 -:10B3E000B43A00214FF49562034B1B6802FB003313 -:10B3F00093F85500704700BFB43A00214FF49562AE -:10B40000064B1B6802FB003090F88533132B1ABFE4 -:10B41000D0F88C03C0F3C04001207047B43A00213B -:10B420004FF495635843002310B5054C226802443D -:10B430001A4492F86623CA540133032BF6D110BD87 -:10B44000B43A00214FF49562044B1B6802FB0033B1 -:10B450005B7C194214BF012000207047B43A0021E0 -:10B4600038B5044604200D4612F074FA014678B14E -:10B47000084B1868084B241AE4105C4301238B70B6 -:10B48000064B0C80CD70187BBDE8384012F073BAC3 -:10B4900038BD00BFB43A0021BDCAE28C685000211B -:10B4A0002DE9F7434FF00008224FCDF804803B68A8 -:10B4B000214E93F8224012F005FA4FF49563651E71 -:10B4C0005C433368A4F59564234401AA197821B13B -:10B4D00093F87C1283F87C82A954013D691CA3F582 -:10B4E0009563F3D14FF4956812F0F8F93B68DFF8F3 -:10B4F0004C9093F8224001AF013CE15D21B1D9F8B5 -:10B5000004300BB1A0B29847356808FB045595F894 -:10B51000983243B105F51B7012F0DCFB18B13E21E7 -:10B520002846FFF79DFF631E14B903B0BDE8F08302 -:10B530001C46E2E7DC4D0021B43A002168500021AE -:10B540002DE9FF410023464E464FDFF81C81ADF840 -:10B5500006300DF1060000F007FE044630BB434FF5 -:10B560003B6893F8225012F0ADF94FF495603368C0 -:10B57000013D03F27D2302AE00FB05F2995CA95563 -:10B58000013D9C54F8D212F0A9F93B68384D93F86C -:10B590002240013C315D19B1AB680BB1A0B29847B4 -:10B5A000631E002C5AD104B0BDE8F0814FF49562BF -:10B5B000BDF8063053433268D518D35C2BB900F080 -:10B5C000B7FD0120FFF786FBC3E7214602A805F07F -:10B5D00023F995F8A530F3B1264B1B687BB12146C2 -:10B5E00005F18C00984750B9204600F0A1FD0120DC -:10B5F000FFF770FB48212846FFF732FFA9E7D5F88F -:10B60000F41205F53E7012F0BEFBD5F8E01205F518 -:10B61000397012F0B8FB9DF80830022B09D893B1AD -:10B6200095F89732002BDFD12146284600F0ACFD7B -:10B630008FE7032B07D1D8F8003013B121462846F5 -:10B6400098472046BBE73B68002BFAD05B69002B8C -:10B65000F7D02146BDF8060098477AE71C4699E7DF -:10B66000B43A0021B83A0021243A0021DC4D0021EF -:10B6700068500021843A00210246B2F80432B2F840 -:10B680000A220433534303EBA30213F0030318BF4E -:10B69000012313448B42084605D20A2903D9C81A4C -:10B6A0000A2838BF0A207047F8B58B7E0746012B61 -:10B6B0000D4608D1CB6A1B78043B012B03D8446AA2 -:10B6C000637813B92F463846F8BD4E6A94F8953220 -:10B6D00096F895229A42F5D842F2107C40F2E24068 -:10B6E000D6F88C22B6F80A120CFB02F24143B2EBF8 -:10B6F000410FE7D3002BE6D1D4F88C32B4F80A22FC -:10B700000CFB03F34243B3EB420FDCD396F88533D3 -:10B71000FF2BD7D194F88533FF2BD4D106F51B70BE -:10B7200012F0D8FA0028CDD004F51B7012F0D2FA2E -:10B730000028C8D0B6F80A32B4F80A22B2EB930F48 -:10B74000C0D3B3EB920FBDD2BDE7000008B511F036 -:10B75000C7FA142813D91E2813D9322813D94B2815 -:10B7600013D9642813D9962813D9FA288CBF00203E -:10B770000120094B93F840301844C0B208BD07209F -:10B78000F7E70620F5E70520F3E70420F1E70320BB -:10B79000EFE70220EDE700BF2050002110B504467E -:10B7A000FFF7D4FF40B220B9012C14BF0020432082 -:10B7B00010BD072801D1002CF7E70020F8E70000B2 -:10B7C0004FF495635843084B1A681318105C48B13E -:10B7D00093F84820042A04D1D86919B11B6A0B6078 -:10B7E00070470020704700BFB43A002130B583781D -:10B7F000B0F80A52A3B947F6FE73B0F80642C06922 -:10B800000A1B92B29A4240F2E24303D86A4303FB16 -:10B81000020030BD611A8AB26A4302FB1300F8E7E6 -:10B8200047F6FE74B0F8CA314A1CD21A92B2A2424C -:10B83000D0F8D00103D840F2E2436A43E7E7C943B6 -:10B840000B449BB240F2E2426B43E6E74FF4956251 -:10B85000044B1B6802FB0033D3F8403403B1184794 -:10B8600018467047B43A0021114B10B59A6AD105B9 -:10B870004CBF03230123120548BF43F004035A00C1 -:10B8800002F008021A434FF07F33C0F83933012326 -:10B8900000F5147100F515701A4214BF7E247F2440 -:10B8A00001F8014B5B008842DBB2F5D110BD00BF4F -:10B8B0002050002113B504460DF107010DF10600DB -:10B8C00014F08EF99DF90630A34207DA9DF907308E -:10B8D000A342D4BF0220002002B010BD0120FBE72C -:10B8E000294B2DE9F0471C684FF4956303FB004496 -:10B8F000D4F8503286B00846059394F94A6014F0A3 -:10B90000A5F90422014684F84A00054604F514709E -:10B9100018F003FA6378022B11D1AE420FD0D4F89D -:10B9200034335B070BD5194B1F6847B10023AA1BA3 -:10B9300094F854102046009352B22B46B84794F81E -:10B940001734EBB10027DFF848A00DF1140818F9FF -:10B95000016BAE4211D0DAF80090B9F1000F0CD0B3 -:10B960002846FFF7A7FF0022AE1B76B2CDE90106FD -:10B97000114620460095FBB2C8470137042FE6D197 -:10B9800006B0BDE8F08700BFB43A00219C3A002120 -:10B990007C3A00212DE9FF41244B15461C684FF4E9 -:10B9A000956303FB004494F94A800AB994F8545013 -:10B9B000084614F04BF9A0EB08077FB2064697B390 -:10B9C00094F85430AB4217D1637884F84A00022BC4 -:10B9D00012D1804510D0D4F834335B070CD5144B0A -:10B9E000D3F80080B8F1000F06D000233A46009348 -:10B9F000294603462046C047254485F84F6294F8FF -:10BA0000173483B10B4B1D686DB194F94A0094F85B -:10BA10005480FFF74FFF0022CDE90107434611464E -:10BA200020460096A84704B0BDE8F081B43A002152 -:10BA30009C3A00217C3A00212DE9F84305460E4648 -:10BA40000027DFF89C90DFF89C80D9F80030BCB26A -:10BA500093F82230A34201D8002013E02046FFF7DC -:10BA600057FC08B32046FFF777FCF8B91E4B1B685C -:10BA70000BB12046984716212046FFF789F9012887 -:10BA800002D10C20BDE8F883102011F063FF0146BD -:10BA90000028F6D041F20163C0E902564380134BFF -:10BAA0000480187B11F067FF0137CEE7D8E9002347 -:10BAB000B34208BFAA42F7D00D4B1C684FF4956300 -:10BAC00003FB0744D4F834331B0606D594F84533FA -:10BAD0001BB113F091FFC4F8F001C8E90056E3E789 -:10BAE000DC4D002158000021EC4D00216850002160 -:10BAF000B43A00211049F0B5C969002908DA0024D8 -:10BB00000E49096891F822500D490968A54201D8EB -:10BB10000020F0BD0E784EB1D1E9C4769E4208BF38 -:10BB2000974203D191F81863864203D0013401F59E -:10BB30009561EBE70120ECE720500021DC4D00216E -:10BB4000B43A0021030203F00F3300F0F030034356 -:10BB5000180100F0333003F0CC331843830003F0B6 -:10BB6000553300F0AA301843C0097047B0F84612A8 -:10BB70000246B0F80602F8B54840FFF7E3FF00EBD5 -:10BB80000010084480B2FFF7DDFF00EB001008440E -:10BB900080B2FFF7D7FF4DF6685300EB0010084462 -:10BBA000414089B24B435B0D03EBC30003EB8003C1 -:10BBB000CB1A9EB2C6F12005D8B2A6F12004D2E974 -:10BBC0008637F34007FA05F52B4327FA04F423439D -:10BBD000DB0782F80E025FBF92F81002414302EBCE -:10BBE000114292F82002F8BD064A074B5A60074BF3 -:10BBF0001B681B79082B81BF054A136A43F48043F5 -:10BC0000136270476DBB01010C3A0021DC4D00212D -:10BC10006850002108B511F055FE044A137801332D -:10BC20001370BDE8084011F059BE00BFB4500021A8 -:10BC3000022808D0032809D00E31C8009042A8BFBE -:10BC4000104680B270470F318800F7E78901B2F5DE -:10BC5000296F38BF4FF4296201F57470EEE738B5EB -:10BC600083780446DBB183685B0518D5B0F80432ED -:10BC7000ABB113F0C1FE40F2E243B4F80A52014600 -:10BC8000E0695D4311F03EF8854208D2012304F1DA -:10BC9000140084F8D931BDE8384011F099BB38BDA3 -:10BCA00000232DE9F04705460E4682469946154A7F -:10BCB000154F13603A68DFF85480D48C144A1A3454 -:10BCC0005443C8E90033640D0234E4003B6893F840 -:10BCD00023304B4503D8AAEB0500BDE8F08750465A -:10BCE00011F032FE00EB040AAAEB0503B342014651 -:10BCF00005D8404611F07CFF09F10109E6E7002074 -:10BD0000EBE700BFC83A0021DC4D0021BC3A00211E -:10BD1000692F010080F865137047002380F86533B0 -:10BD2000704738B5CA880C460546898890F8540093 -:10BD3000FFF77EFF62880346218895F85500FFF7DC -:10BD400077FF1844963080B238BD014690F85420F1 -:10BD500090F86503B1F8543350B1012A06D0022A95 -:10BD600008D100F00102C2F10202D2B2400717D49A -:10BD7000022A10D0032A13D06F2B18D9503BDB10A6 -:10BD8000043B98B21B2838BF1B20B1F852339842AD -:10BD900028BF184670473B2B09D92C3B9B10EFE777 -:10BDA000B3F5747F03D3A3F534739B11E8E7002048 -:10BDB000E8E700002DE9F04F9846938889B00646E1 -:10BDC00048480F461446029311F024FF0546F0B18F -:10BDD00000F108030193A38808F104029F4228BFE1 -:10BDE0001F46039787730027BB468381C773826012 -:10BDF000029B9B451BD306F51B70019A217811F01D -:10BE0000B4FD304609B0BDE8F04FFFF728BF40460B -:10BE100011F0A8FD344B208801215B689847FFF79B -:10BE2000F9FE072009B0BDE8F04FF7F74DB8029BC7 -:10BE3000DDF80CA0A3EB0B039BB29A4528BF9A46F2 -:10BE400000205FFA87F808F101030199DB0003F194 -:10BE500002098944A178CDE90600A4F804A009B339 -:10BE6000012925D006A94846CDE904238DF81DA057 -:10BE700004F078FC02211D4B05EBC8081B6888F80C -:10BE8000101019469C46DDE90423E9B9002388F81F -:10BE900011300123A3700BEB0A031FFA83FB5244FA -:10BEA0000137A5E702208DF8180086F88112D9E73E -:10BEB0008DF8181096F881120129D3D102218DF83E -:10BEC00018104FF00001F0E7019904330B4406F11C -:10BED0008C0049460492E047049A0028D6D00423F7 -:10BEE000D5E700BFBC3A002168500021883A002104 -:10BEF00070B590F87E320446013380F87E320B78BC -:10BF00000A461B2B0CBF032502250C4B4D1B1E683C -:10BF100026B16B788C300B442946B0472A4604F58D -:10BF20001B70FF2111F021FD054B0421187B11F03E -:10BF3000BDFD2046BDE87040FFF791BE883A002164 -:10BF40006850002137B50546063011F003FD044660 -:10BF500058B10023CDE90033032369468DF8003042 -:10BF60008DF8055004F0FEFB0444204603B030BDBC -:10BF7000F0B500F51B7585B00F4628460DF1070199 -:10BF8000164611F010FD0446002849D0284611F04D -:10BF9000ADFE9DF807300546FF2B34D0A079E3793C -:10BFA000024603FB00FCA18804EBC30E60448842F8 -:10BFB00003F101039EF808004FEAC303388003F140 -:10BFC0000200204478602068C8BFA1EB0C026044E6 -:10BFD000F8609EF80900C8BF92B23A8178B1388201 -:10BFE0000320043323447B615DB102EB0C05A942BD -:10BFF000D4BF00250125EDB2357005B0F0BD02209B -:10C00000F2E70125F7E7B0FA80F5214602A804F02F -:10C0100003FC63786D0903443B8001207C60EBE7FF -:10C020000546E9E737B500F51B7420460DF1070119 -:10C0300011F0B9FCB8B19DF80720FF2A07D0C179EB -:10C0400083794D1C01FB033381888B4209DB074B4D -:10C050000DF107011860064B20461A7011F09AFC8A -:10C0600000E0C571012003B030BD00BFC83A002117 -:10C07000C43A002170B5134E0546306800B3124B28 -:10C080001B78FF2B19D0044654F80809043811F026 -:10C0900069FC21460D4811F0ABFDFFF7BBFD95F89B -:10C0A0007C32013385F87C3200233360084B012158 -:10C0B000BDE87040187B11F0F9BC11F053FCF3E7B8 -:10C0C00070BD00BFC83A0021C43A0021BC3A00212B -:10C0D00068500021F7B50025104F00F51B7630465B -:10C0E0000DF1070111F056FC044610B9284603B0C3 -:10C0F000F0BD9DF80730FF2B0DD054F8080901352D -:10C10000043811F02FFC2146384611F071FDEDB2D4 -:10C11000FFF780FDE3E711F025FCE0E7BC3A0021E2 -:10C120000C3008B580B211F015FC00B1023008BD2A -:10C13000023811F017BC000008B5134600F8021CC5 -:10C14000090A00F8011C821ED9B2054811F00DFC45 -:10C15000044B0221187BBDE8084011F0A7BC00BFCA -:10C16000BC5000216850002113B504460DF10701B1 -:10C17000044811F00FFC18B19DF8073002302380FD -:10C1800002B010BDBC50002110B50446084B094A4E -:10C190001B68C31ADB10534300F51D708A1ED9B209 -:10C1A00011F0E3FB94F87D32013384F87D3210BD49 -:10C1B000B43A0021BDCAE28C1FB500F51D700DF127 -:10C1C000070111F0E7FB0446A0B183789DF8072032 -:10C1D00003F00303ADF80820C278012BADF80C2062 -:10C1E00002D0022B18BF0323204602A98DF80A3083 -:10C1F00004F0A8FA204604B010BD73B5002400F581 -:10C200001D7528460DF1070111F0C4FBE6B201349B -:10C2100010B9304602B070BD11F0A4FBF1E7000088 -:10C220004FF49561028803464A430B490968881810 -:10C230008A5C82B1094A1360B3F86220A0F8A22494 -:10C2400093F8602080F8A024D97883780BB905F0A2 -:10C25000A3B905F06BBA7047B43A0021B03A002197 -:10C260002DE9F04100244FF495680E4E0E4F3368CF -:10C2700093F82230A34201D8BDE8F08108FB04F313 -:10C280003A68D518D35C53B105F51B7011F022FD47 -:10C2900028B9AB781BB93D21284605F07DF901345A -:10C2A000E5E700BFDC4D0021B43A002108B5E9F70D -:10C2B000CFF9E9F7B1F810F02BFA00F099FBBDE8DF -:10C2C00008400FF0D5BE000010B503780446B3B1A6 -:10C2D00082780B4804F0A8FCA37818B11E2808D077 -:10C2E0000D2100E00C2120462BB9BDE8104005F0DF -:10C2F00053B90E21F7E7BDE8104005F017BA10BD9D -:10C30000283A0021837870B5FF2B044605D0BDE89C -:10C3100070400B4B1860FFF783BF0023094D084E98 -:10C3200003802B68228893F822309A4200D370BD94 -:10C3300020463460FFF774FF238801332380F0E741 -:10C34000B03A0021DC4D00212DE9F34704460027D7 -:10C350000D4600F14809002116461430302217F02E -:10C36000DCFC4FF4C0720021484617F0D6FC47F2BF -:10C37000305184F80E72D5E90623C4E98623A4F867 -:10C38000067295F82A304FF0FF0884F80F322B8C94 -:10C390002046A4F80A326B8C4FF0020AA4F804324B -:10C3A000AB8CC4F8F41203EB83035B00A4F8823275 -:10C3B000FFF762F984F885836B69C4F8E002C4F87A -:10C3C00048322B692046C4F84C32FEF7F4FE2B6944 -:10C3D000204683EA1342A4F84622042284F8482027 -:10C3E000424A126892F82820E36484F84A206B6974 -:10C3F0000125236540F2011384F856A0A4F85430B7 -:10C40000FFF732FA84F8548204F24E31204684F861 -:10C41000A650FFF786FC40F2E248A4F8600304F25D -:10C4200046312046FFF77DFCB4F86033304A236282 -:10C43000B4F80A32226308FB03F36362A3622D4B54 -:10C440002D4AC4F8E0302D4BC4E90D24C4F8E43083 -:10C450002B4BA4F85E03C4F8E8302A4BC4F8409094 -:10C46000A58584F82E50C4F8EC30002E3BD094F80B -:10C4700056102422B94208BF514694F85400D6F809 -:10C480009C510FF088FE10228146514694F85500C9 -:10C490000FF081FE94F855309635032B0CBF032224 -:10C4A0005246194B4D441968184B611A0544C9107E -:10C4B00008FB02555943B4F80A023B462A4608FBDA -:10C4C00000F00097C9B210F0EDF9114BA0FB033258 -:10C4D000DB0F43EA420386F8E7342844C3F307231B -:10C4E00086F8E834E06102B0BDE8F087DC4D002159 -:10C4F000E112010115120101D9170101C91201014F -:10C500000118010121180101B43A0021BDCAE28CD1 -:10C51000E3361A000D4B10B51A68002192F83D3031 -:10C52000044680F8453292F83E2080F8552080F885 -:10C530005420074A52F82330984784F8490004F100 -:10C540001400BDE8104010F06FBF00BFB03A0021EA -:10C550000C3A002108B5204A204B21485A60214B53 -:10C56000214A5A60214B224A5A60224A9A60224A42 -:10C570001A60224B224ADA60224A5A62224B234A2C -:10C580001A60234B234A1A60F6F700FD00F030FAD8 -:10C59000214B1B681979062907D9204A0729D2E9B6 -:10C5A000083003D143F00E03136208BD082902D1FD -:10C5B00043F02E03F8E7092902D143F48033F7E76B -:10C5C0000B29174988BF40F0800041EA03018CBF66 -:10C5D000C2E908101162E8E7ADC20101040D0021B3 -:10C5E00039BA0101B00C002105C30101780C00210A -:10C5F00041B5010161C20101A1B40101C04B00219B -:10C60000E128020109210201243A0021C9C20101E5 -:10C610000C3A002145B10101DC4D00216850002198 -:10C620002E00010508B50FF0A0FA20F07F4008BDEC -:10C6300008B50FF09AFA00F00702C0F301230532A3 -:10C640001344C0F30040184408BD00004FF4956146 -:10C65000028803464A430549096888188A5C22B162 -:10C66000034AD978136005F061B87047B43A0021E5 -:10C67000B03A0021F0B58BB00446FEF7F7FBD4E9E1 -:10C680001267054688B3C0E9C46794F83C300B21B3 -:10C6900080F81833234B1C600123837094F86030BA -:10C6A00080F8A034B4F86230A0F8A23405F03EF867 -:10C6B0006FF47F42236E23F47F43934230D10120F5 -:10C6C00010F082FA94F83F3053B30021164B2078D3 -:10C6D0001A6894F84030AA1A144DD2106A4392B2E4 -:10C6E0000BB0BDE8F0400FF09ABAB4F86230012107 -:10C6F000099394F86030CDE90067CDE90703092379 -:10C700000693D4E91623CDE90423D4E91423CDE913 -:10C71000022394F83C3004F10802ECF77FFBC7E7F2 -:10C720000BB0F0BDB03A0021B43A0021BDCAE28C92 -:10C7300010B50378044683B18278084804F074FA8F -:10C7400018B11E2807D00D2100E00C212046BDE8BD -:10C75000104004F0EBBF0E21F8E710BD283A00218D -:10C76000837870B5FF2B044605D0BDE870400B4BB5 -:10C770001860FFF76BBF0023094D084E03802B683C -:10C78000228893F822309A4200D370BD204634604C -:10C79000FFF75CFF238801332380F0E7B03A0021E4 -:10C7A000DC4D002110B5044610F09AFA072C28BF82 -:10C7B0000724034B33F81430184480B210BD00BF77 -:10C7C000C04E03012DE9F84F7F4F00F114083022CD -:10C7D00000213D6800F148090446404617F09DFAE3 -:10C7E0004FF4C0720021484617F097FA95F841308F -:10C7F000002B00F0E58095F83E30032B14BF022695 -:10C8000003264FF0010A2B8EA4F8CAA11E4495F806 -:10C810003D304FF0FF0B84F84532D5E90823C4E9D9 -:10C82000862395F83230B6B284F80F322B8DA4F8F7 -:10C830000A3295F83300FFF7B5FF47F230516B8DA0 -:10C84000A4F8C801A4F80432AB8D204603EB83039F -:10C8500003FA0AF3A4F88232C4F8F412FEF70CFFCC -:10C86000062284F885B3EB69C4F8E002C4F84832C4 -:10C8700095F82E30298D334402FB013303EB9301ED -:10C8800013F0030318BF534604F52170194411F047 -:10C890007AFA2046FEF78FFCAB69204683EA134202 -:10C8A000A4F84622052284F84820484A126892F8E3 -:10C8B0002820E36484F84A20EB6923653B6893F8F9 -:10C8C0003E3084F8553084F85430FEF7CDFF84F8BC -:10C8D000A6A084F854B204F24E312046FFF721FAA4 -:10C8E00004F24631A4F860032046FFF71AFA40F23A -:10C8F000E24BA4F85E0395F82E500BFB06F60BFBFB -:10C9000005F5B4F8C8117019F6F7EEFA3B689B6BA1 -:10C91000C4F840901E442E4BC4E9735623632D4B3C -:10C9200005EB4005C4E90D34B4F80A3205F22637A8 -:10C930000BFB03F3A362284B5544C4F8E430274BA8 -:10C94000361AC4F8E830264BA4F82CA0C4F8EC3012 -:10C95000244B84F82EA0DFF89090DFF890A0E661D9 -:10C960002762C4F8E050C4F8F03094F84532002152 -:10C97000204659F823309847514684F849004046EC -:10C9800010F04EFBF0B9B4F80662B4F8C8110136E5 -:10C99000B3B2B4F80A62A4F806325E4340F2E2434E -:10C9A0005E433046F6F7A0FAD4F8D0311E44361A6A -:10C9B0003B1805EB4000E6612362C4F8E000D4E7D1 -:10C9C00001261EE7BDE8F88FB03A0021DC4D0021BA -:10C9D000811B010145220101E11A01017D1B0101B9 -:10C9E00065220101852201010C3A0021A9B601014D -:10C9F0004FF49562044B00211B6893F822305A4390 -:10CA0000024B186817F089B9DC4D0021B43A0021B7 -:10CA100008B5224A224B5A60224B234A1A605A68B0 -:10CA20000AB9224A5A60224B224A5A60224A1A60A4 -:10CA3000224B234ADA60234A5A62234B1A680AB906 -:10CA4000224A1A60224B234A23481A60F6F79EFABC -:10CA5000FFF7CEFF214B1B681979062907D9204A19 -:10CA60000729D2E9083003D143F00E03136208BD51 -:10CA7000082902D143F02E03F8E7092902D143F433 -:10CA80008033F7E70B29174988BF40F0800041EA5F -:10CA900003018CBFC2E908101162E8E7E9CA01018D -:10CAA000040D0021B00C002175C6010161C7010110 -:10CAB000780C002141B50101A1B40101E84B00212E -:10CAC000E92C020109210201243A002131C70101A8 -:10CAD0000C3A002145B1010139BA0101DC4D0021B8 -:10CAE000685000212E00010508B5E8F7B1FD0FF0F0 -:10CAF0000FFEFFF77DFFBDE808400FF0B9BA000058 -:10CB000070B5037804460E4633B38278134804F0B8 -:10CB10008BF8054638B9A378B3B10C212046BDE89F -:10CB2000704004F003BE3146A2780C4804F01EFAAF -:10CB30000028F0D01E2DA37801D01E280AD10E2186 -:10CB40002046002BEBD101E00C212046BDE87040CF -:10CB500004F022BD0D21F3E770BD00BF283A00218B -:10CB600008B5FFF7F7FC0E4B0E4A1A600E4A5A60E2 -:10CB70000E4B0F4A1A600F4B0F4A1A600F4B104AA8 -:10CB80001A60104A136A43F0010111620E490968E4 -:10CB90000979062984BF43F01103136208BD00BF61 -:10CBA000C04B0021A931020199360201243A00212B -:10CBB00001CB0101A43A002171F40201A03A002145 -:10CBC00075F4020168500021DC4D002170B5037836 -:10CBD00004460E46D3B182780D4804F025F8054688 -:10CBE00028B90C212046BDE8704004F09FBD3146B5 -:10CBF000A278074804F0BAF90028F2D01E2D01D01F -:10CC00001E2801D10E21EDE70D21EBE770BD00BF1D -:10CC1000283A00210F4B104A1A60104A5A60104BF4 -:10CC20001A680AB90F4A1A600F4B104A1A60104B63 -:10CC3000104A1A60104A136A43F0010111620F4949 -:10CC400009680979062984BF43F011031362FFF7CD -:10CC5000DFBE00BFE84B00210D350201993602010D -:10CC6000243A0021CDCB0101A43A002171F4020144 -:10CC7000A03A002175F4020168500021DC4D00212A -:10CC80004FF49562034B1B6802FB0033D3F8F402A8 -:10CC9000704700BFB43A002138B51B4B0D461C68E5 -:10CCA0004FF4956303FB00442046FEF7E5FCB4F81F -:10CCB0005E24B4F80A32854202FB03F3B4F804227E -:10CCC00002FB033340F2E24202FB03F34FF47A72B9 -:10CCD00005FB02F215D0934213D894F8A530C4F89E -:10CCE000F452C4F8E00253B1294604F53E7011F045 -:10CCF0004AF8D4F8E01204F5397011F044F8012034 -:10CD000000E0002038BD00BFB43A0021C07804F034 -:10CD10004DBE00002DE9F047624C064604F1D005F7 -:10CD20008A46914600212C2204F19C00984616F078 -:10CD3000F4FF4FF4C0720021284616F0EEFF0122E6 -:10CD40000223594F84F8B620C4F8C850574A584DAA -:10CD5000387AC4E92E2284F8B43084F8D030F6F75B -:10CD600007FA95F83030534A84F8D230524B84F8A1 -:10CD7000D100C4E9352340F20113A4F8DC300323C9 -:10CD800094F84220A4F850310AB1A4F852312D2071 -:10CD90003B7A84F89A0184F89B31484BC4F8783187 -:10CDA00010F0D8FD464BC4F86801C4F88031F6F79E -:10CDB000BBF8A065FFF736FC012384F86E30B4F8A9 -:10CDC0008230E065A4F86830B388A4F86A30F3884C -:10CDD000A4F86C30D5E90E23C4E91823FFF728FC2A -:10CDE00084F87200FEF7B2FC052384F85032222347 -:10CDF00084F85432AB6A84F87300C3F3803384F848 -:10CE0000513294F84130DB0746D5D5E90823C4E90F -:10CE10005623D4F8543143F00203C4F85431D4F803 -:10CE2000543143F00102C4F8542195F831201AB16D -:10CE300043F05103C4F85431D4F85401D4E956678F -:10CE4000C0F3400384F8523294F84230C4E91267C8 -:10CE500093B90AF00101C4E91498C4E9589884F818 -:10CE6000531219B140F00800C4F85401D4F85431F9 -:10CE700043F00403C4F854311249A1F5147002F0D0 -:10CE800087FC1149204402F0CFFC2423C4F86C41F4 -:10CE900084F89931BDE8F0870C4BD3E90C23C4E941 -:10CEA0005623BCE7D03A0021F8500021712401013B -:10CEB00020500021D6BE898E55555500E124010130 -:10CEC00071260101203D0021183B002168500021FE -:10CED00010B50FF011FF40F271220A4C00F2CC4065 -:10CEE000E38FC4F8A8005343C4F8AC30002304F126 -:10CEF0009C00A4F8983010F03FF8D4F8A430A36355 -:10CF000010BD00BFD03A00214FF418720021014833 -:10CF100016F003BFD03A0021034B044ADA60044BF9 -:10CF2000044ADA60FFF7F0BF040D002139CF010198 -:10CF3000B00C00210DCD0101FFF7E6BF034B93F8C4 -:10CF40002400003818BF0120704700BFD03A0021EC -:10CF5000034B53F820301878003818BF0120704771 -:10CF6000D04E03012DE9F843044600F59C760F46A8 -:10CF700091460021302200F582701D4616F0CDFE4C -:10CF80004FF4C0720021304616F0C7FE032384F828 -:10CF90001C31012384F81E31604BDFF88481C4E921 -:10CFA00048330223C4F830615E4E84F8383198F873 -:10CFB0000800C4F82841F6F7DBF896F830305A49F3 -:10CFC00084F83A31594B84F83901C4E94F13237C72 -:10CFD0004220022B14BF40F2011340F20333A4F8A5 -:10CFE0004431832394F86A20A4F8B831D20748BFAB -:10CFF000A4F8BA3198F8083084F8020284F80332B1 -:10D000004B4BC4F8E0314B4BC4F8E43110F0A2FCB8 -:10D01000C4F8D00100287FD0474B04F12808C4F899 -:10D02000E831F5F781FFA063FFF7FCFA012384F8EC -:10D030004E30B4F86230E063A4F84830BB88A4F8FE -:10D040004A30FB88A4F84C30D6E90E23C4E91023FB -:10D05000FFF7EEFA84F85200FEF778FB052384F818 -:10D06000D030222384F8D43094F86B3084F8530005 -:10D07000DB074BD5D6E90823C4E97023D4F8BC31CB -:10D0800043F00203C4F8BC31D4F8BC3143F00102D0 -:10D09000C4F8BC2196F831201AB143F05103C4F80A -:10D0A000BC31D4F8BC11D4E97067C1F3400384F8F3 -:10D0B000D23094F86A30C4E90A67A3B99DF8200019 -:10D0C000C4E90C9500F00100C4E9729584F8D3001E -:10D0D00018B141F00801C4F8BC11D4F8BC3143F0D8 -:10D0E0000403C4F8BC3104F1780504F1D0012846EA -:10D0F00002F04EFB4146284402F096FB2423002018 -:10D10000C4F8D45184F80132BDE8F8830B4BD3E95D -:10D110000C23C4E97023B7E71F20F5E7812701013D -:10D12000F850002120500021D6BE898E555555005B -:10D13000F1290101152A01014D2801016850002142 -:10D1400010B504460FF0D8FD40F27122638B00F257 -:10D15000CC405343C4F814310023C4F81001637069 -:10D16000A37004F582700FF007FFD4F80C316366EA -:10D1700010BD00002DE9F743C77804467A1E012A46 -:10D18000837847D9A3F1FF056B426B412288324D6A -:10D19000FF2A41D0002B3FD1AB7A1341D80705D5E8 -:10D1A0002E4B394653F8220004F01CFCE378012B87 -:10D1B0004FD100242A4B294F1E68AB7A2341DA074E -:10D1C0003AD40134032CF8D100244FF495676C72E3 -:10D1D000D6E90223C5E90023B379DFF88090DFF8B0 -:10D1E00084802B72AB7A2341DB070FD559F824607A -:10D1F000D8F80030B6F86000002207FB003006F1D6 -:10D200002801FFF7A1F83046FFF79AFF0134032CFD -:10D21000E8D11EE00123B9E70026DFF84080AB7AB1 -:10D220003341D90704D5394658F8260004F0DAFB13 -:10D230000136032EF3D1B9E77379B17901933379CC -:10D2400057F824000093D6E90223ECF7EBFC002802 -:10D25000B7D003B0BDE8F083303D0021D04E0301CC -:10D26000540D0021B43A00212DE9F8434FF4C07762 -:10D27000044600F53A780021164600F52E7030225B -:10D280001D4616F04AFD00213A46404616F045FD7F -:10D29000022384F8D0320123354A84F8D232C4E91B -:10D2A000B522062284F8A033324B3348C4F88433C5 -:10D2B000002384F8E82290F83020DFF8C0C084F81A -:10D2C000EA222F4AC4F88833C4E9BBC294F86A2022 -:10D2D00094F86B30D10748BFA4F86A73D907C4F833 -:10D2E000E482C4F8DC42A4F868733AD5D0E908892E -:10D2F000D4F86C13C4E9DC8941F00201C4F86C1362 -:10D30000D4F86C1341F00103C4F86C3390F8313059 -:10D310001BB141F05101C4F86C138AB99DF820305B -:10D32000C4E9DE65DB0742BFD4F86C3343F0080381 -:10D33000C4F86C33D4F86C3343F00403C4F86C3392 -:10D3400004F17803C4F880332423002084F8983350 -:10D350000C4B6070C4F88C33A07084F80001BDE8F9 -:10D36000F883094BD3E90C89C4E9DC89C8E700BF1D -:10D37000E9270101B12A010120500021D6BE898E82 -:10D3800055555500B12C01016850002138B50D4BA1 -:10D3900010220021184616F0C0FC012200240A4980 -:10D3A0000A4D0A73827255F8043B33B14FF48E6212 -:10D3B0000021184616F0B1FC04740134032CF2D19C -:10D3C00038BD00BF303D002120500021D04E030168 -:10D3D00008B5084A084BDA60084B094A5A62094BFB -:10D3E000094A1A60FFF7D2FF4FF48E62074B9A8208 -:10D3F00008BD00BF11D40101040D0021B00C0021B3 -:10D4000075D10101E04D002151CF0101685000218B -:10D41000FFF7BCBF0123034A8340907A1843907200 -:10D42000704700BF303D00210123034A8340907ABA -:10D4300020EA030090727047303D0021064B53F8FC -:10D44000203009B108689861106851681C3303C323 -:10D4500090681860704700BFD04E030138B504468D -:10D4600004200D4610F076FA014668B154B1237CD1 -:10D470000B8009238B70054BCD70187BBDE83840BD -:10D4800010F079BAFF23F3E738BD00BF68500021E0 -:10D4900030B590F83943036B3CB1032A81BF0C6867 -:10D4A000C0F82443002480F8394390F83853012D04 -:10D4B0001BD0022D46D1837AA3B9B0F8DC42032AEF -:10D4C0001CD80023A24203F1010121D1D0F824236A -:10D4D0009A421DD1C0F82413D0F82C330133C0F880 -:10D4E0002C3329E0B0F8DA42E9E7032AB0F82C41FE -:10D4F00023D99B009BB29C4228BF1C46012D0B6880 -:10D500000ED0022DDED0BDB922B9E5E70024F5E743 -:10D51000C0F82413D0F834330133C0F834330BE0AF -:10D52000D0F824239A4209D1D0F82C3301320133A8 -:10D53000C0F82C33C0F8242330BD00230133C0F8D9 -:10D540002433E7E7032AE1D8022DDDD9F4E7000010 -:10D5500010B5044610F0B6F9034B587804445C70DB -:10D56000BDE8104010F0BAB9DC5000210023F0B53E -:10D5700018461C46224A87B01268CDE9003392F85B -:10D580003570204ACDE90233CDE9043312689F4259 -:10D5900008D81D4B9B6A1BB110B1694603AA984776 -:10D5A00007B0F0BD1178A1B192F8181389B992F8BB -:10D5B000046192F8D81286B179B906AD05EB400541 -:10D5C00025F80C6C168925F8186C82F804110130C6 -:10D5D000C0B2013302F56272D9E70129F9D192F89C -:10D5E0006453002DF5D006A901EB400121F80C5C35 -:10D5F000158921F8185C82F8044182F86443E6E753 -:10D60000DC4D0021E43900216850002100232DE980 -:10D61000F04FB74F99B0DFF8DC82ADF8163006A9AD -:10D620000DF1160000F0E4FF0546D8B900252C46A0 -:10D63000CDE90955CDE90B55CDE90D55AE4FDFF8D4 -:10D64000B4A23B6893F83530AB4200F24481AB4B57 -:10D65000DB6A23B11CB1204609AA0CA9984719B06E -:10D66000BDE8F08FBDF81600FAF77EFF0378044698 -:10D670001BB9284600F098FFD1E7294607A803F018 -:10D68000FCFD3B689BB1294604F5BE70984738B94C -:10D69000284600F089FF06212046EAF74BFCBEE74A -:10D6A000D4E90C32013342F10002C4E90C322946BC -:10D6B00009A803F0E2FD94F8D81204F55A7A00297B -:10D6C00040F0A08018220CA816F027FBBDF81630F9 -:10D6D0009DF81C60ADF8303001238DF833306B7845 -:10D6E000ADF83430069B0E936B78ADF83E30A6B1A2 -:10D6F000012EBED1A37A002B76D1B4F8DC32B4F877 -:10D700002C219A4273D10123284684F8103100F06D -:10D710004BFF002384F86F3381E794F86F333BB1FC -:10D72000012B5BD0284600F03FFF84F86F6376E75B -:10D7300002238DF832309DF83230A5F10C0613F03B -:10D74000FD0F08BFB4F87033304604BF0133A4F8AE -:10D750007033B4F870330CA9ADF83C3003F001FD20 -:10D7600094F819338146012B05F1020505D12946AC -:10D7700020469DF82120FFF78BFE29469DF82120A9 -:10D7800006EB090016F0AFFA314612A803F0A1FC2F -:10D79000149B13B1069BC4F800333146504601F088 -:10D7A00073F900283FF442AF04F5427904F55E7640 -:10D7B00030460DF1150110F0EDF8054600283FF454 -:10D7C0002EAF226B2B4648462189013A00F02EFFEE -:10D7D0000028EDD1284610F0C5F8E7E703238DF8BF -:10D7E000323084F86F63A6E7B4F8DA3287E794F84A -:10D7F0006F33003B18BF01238DF83230012384F8CA -:10D800006F3398E79DF81C30022B7FF432AFA37A78 -:10D81000002B39D1B4F8DC3222890293069B04F53F -:10D82000437901939DF829304946009350462B4691 -:10D8300001F0A0F994F81433184494F8193384F8DB -:10D840001403012B23D194F81433002B3FF411AFB0 -:10D850000CA9484610F09EF80646014612A803F0AF -:10D8600038FC9DF8562006F10C012046FFF710FE0B -:10D87000304610F077F80120FFF76AFE94F8143371 -:10D88000013B84F81433DEE7B4F8DA32C4E794F8E5 -:10D890000833012B7FF4EDAE04F5427A94F814338B -:10D8A000002B3FF4E6AE504600F0E5FE814601460F -:10D8B00012A803F00EFC149BBDF856201799B4F87B -:10D8C0001603D8F80C60B047484610F04BF801201A -:10D8D000FFF73EFEE2E74FF46273094A6B431268BA -:10D8E000D61896F8081369B101291FD00135A8E6AA -:10D8F000843A0021904A0021DC4D0021685000212B -:10D90000E4390021D35C002BF0D096F81423002AD0 -:10D91000ECD0308918AB03EB4403013423F8300C0E -:10D9200023F83C2CE4B286F81413DFE7D35C002B19 -:10D93000DCD096F8CA32002BD8D006F5427B584688 -:10D9400000F099FE80460028D0D0414612A803F08E -:10D95000C0FB149BBDF856201799B6F81603DAF8E9 -:10D960000CC0E04740460FF0FDFF0120FFF7F0FD3F -:10D97000E5E700BF70B50E4604460FF0E5FF011B5A -:10D98000711A054600F086FC08B12844001B70BDE2 -:10D99000F0B587B001460546684603F09AFB464B52 -:10D9A000BDF80E201B689B8D93420AD228460FF0CB -:10D9B000D9FF424B5B681BB30121BDF800009847BB -:10D9C0001EE03F4F3B78002BF0D09DF80310BDF8D0 -:10D9D0000430002914BF04210021043B5B1A9BB2D0 -:10D9E0009A42E3D1BDF80000FAF7BEFD04460028D4 -:10D9F0003CD00089FBF786FA20B928460FF0B2FF29 -:10DA000007B0F0BDB4F83031002BCFD0A37A94F832 -:10DA1000F4221A43CAD094F8F5220AB9012BC5D0D2 -:10DA2000ABB9B4F8DA32BDF80E209A42BED894F8F9 -:10DA3000D8327BB90FF046FF3B78013B3B700FF0CB -:10DA40004DFF2A466946204600F064FCD8E7B4F84A -:10DA5000DC32E8E72A46002104F556700FF085FF16 -:10DA600094F86033013384F86033C9E7BDF80000EF -:10DA7000F8F766FF06460028BFD04368BDF80E20C1 -:10DA8000DB889A4292D80FF01DFF3B78013B3B7038 -:10DA90000FF024FF73682A469B7F23B969463046FE -:10DAA000F9F77AF8ACE7214606F114000FF05DFFB4 -:10DAB000337F01333377A3E7DC4D00216850002129 -:10DAC000DC500021F8B500241D4D1E4E2B6893F844 -:10DAD0003530A3420AD800244FF498771A4E2B68A9 -:10DAE00093F83A30A34215D8002012E04FF4627345 -:10DAF00063433268D018D35C0BB90134E6E790F881 -:10DB00000833002BF9D100F5427000F0B4FD002875 -:10DB1000F3D0F8BD07FB04F33268D018D35C0BB91F -:10DB20000134DCE74368DB78002BF9D190F82C3026 -:10DB3000002BF5D1F9F74CFA0028F1D0E9E700BF46 -:10DB4000DC4D0021E4390021D4390021FFF700BD6C -:10DB50002DE9F0410546884617461E46FAF704FDB2 -:10DB6000044640B3C07AFAF7D1FDA37A2BB994F8F2 -:10DB7000F4223AB90C20BDE8F081012B02D194F8CF -:10DB8000F522F6E794F86423002AF3D083B994F8D9 -:10DB9000F432E28940F2E241013A5343A8F80030FE -:10DBA000828A036B002001FB12333B603060E2E7A6 -:10DBB00094F8F532EDE72846F8F7C2FE034660B365 -:10DBC0004568EA78012AD5D1A87F18B1012811D07B -:10DBD0001120D0E7D5E908432343CBD0D5F8CC308A -:10DBE00029692A7E013C5B1A54435343A8F800403C -:10DBF0003B60DBE793F82030002BBBD02B6A2A7EFA -:10DC0000013B53432969A8F80030D5F8CC302046B1 -:10DC10005B1A53433B603460ADE70220ABE74378C7 -:10DC2000023BDBB2FD2B34BF122000207047000006 -:10DC300070B58AB006460D46FAF796FC044628B33E -:10DC400015F0FC0F59D1002D57D015F0010307D066 -:10DC500090F80423FF2A03D10C2528460AB070BD92 -:10DC600015F002054DD094F80823FF2AF4D0002BBC -:10DC700048D123896846ADF8003004F54273049317 -:10DC800000F0B8FDFF2384F808334DE03046F8F784 -:10DC900057FE044698B3EA0703D590F82430FF2BCB -:10DCA000DAD0AB0703D594F82C30FF2BD4D063889F -:10DCB000ADF800306368DD786DB994F82C30FF2B37 -:10DCC000CAD004F12C036846049300F093FDFF23AF -:10DCD00084F82C30C1E794F82430FF2BBCD0134ECD -:10DCE00004F12403684604933360002500F024FD0A -:10DCF000FF23356084F82430AFE71225ADE7022515 -:10DD0000ABE78BB12389094EADF80030684604F5C6 -:10DD100041730493336000F00FFD00233360FF2351 -:10DD200084F80433002DA4D1002596E7984B0021F8 -:10DD300070B506460D46FAF717FC0446E0B1C07A06 -:10DD4000FAF7E4FC94F8F42203460AB9A27AE2B1A5 -:10DD500094F8F52212B9A27A012A16D0022D16D80B -:10DD60001B6B0020C4F81C330123C4F8280384F87B -:10DD7000205384F8183370BD3046F8F7E1FD40B108 -:10DD80002946BDE87040F9F7CDB91120F3E712201C -:10DD9000F1E70220EFE738B505460C46FAF7E4FB59 -:10DDA00080B1231E18BF012380F83933012380F886 -:10DDB0001933002380F83843C0E9CB33C0F834333B -:10DDC000184638BD2846F8F7BBFD20B12146BDE80E -:10DDD0003840F9F7BBB90220F3E738B505460C46E1 -:10DDE000FAF7C2FB0346A0B1B0F81823D2B190F8FD -:10DDF000190350B10020D3F82C232260D3F830232C -:10DE0000D3F834336260A36038BDC4E90000A06079 -:10DE1000FAE72846F8F794FD30B12146BDE83840CE -:10DE2000F9F7A5B90C20EFE70220EDE738B5054674 -:10DE30000C46FAF799FB0346C0B1B0F818230AB3B1 -:10DE400090F819235AB1D0F82C232260D0F830234F -:10DE50006260D0F83423A260002280F8192393F87E -:10DE6000180310B1002083F8180338BD2846F8F7CE -:10DE700067FD054640B12146F9F779F9012385F898 -:10DE80006930F2E70C20F0E70220EEE738B50546EE -:10DE90000C46FAF769FB58B100F54F7300F5567060 -:10DEA00053F8042B834244F8042BF9D1002038BDE9 -:10DEB0002846F8F745FD034660B14268D07848B976 -:10DEC00003F13C02583352F8041B9A4244F8041BF5 -:10DED000F9D1ECE70220EAE770B506460D46FAF7FD -:10DEE00043FB20B190F9EC3000202B7070BD304620 -:10DEF000F8F726FD034640B14268D07818B993F987 -:10DF000064302B70F2E77F23EEE70220EEE700009B -:10DF1000014B83F847007047205000211FB5312383 -:10DF2000ADF804008DF8080001A8ADF806300391A3 -:10DF30000DF04EFE05B05DF804FB00002DE9F04742 -:10DF40001B4F05463B680E46B3F82C80FAF70CFBD6 -:10DF50000446D8B1C07AFAF7D9FBD0F8249004F57A -:10DF600041742378012B21D13B68988D083080B211 -:10DF70000FF0F0FCD0B10F4B42469C6800F10C0151 -:10DF80004B462846A446BDE8F04760472846F8F7C8 -:10DF9000D7FC58B1436800F12404D3F8CC90B3F80F -:10DFA00006804E4504BF1A699144DAE7BDE8F08760 -:10DFB000DC4D0021904A0021F8220021014815F093 -:10DFC000ACBE00BFA04A0021F0B406461846114B73 -:10DFD000BDF810701B682BB15B88B34202D1F0BC56 -:10DFE0000FF0C0BC14250C4B1C6805FB0435C5E9BB -:10DFF00003120C220134B4FBF2F102FB11441C6049 -:10E00000064B68612E812F838021F0BC187B0FF0B6 -:10E010004DBD00BF984B0021A04A0021685000214F -:10E020002DE9F04114274FF481781D4D86B0D5E9D4 -:10E0300000349C4202D106B0BDE8F08107FB0454D5 -:10E0400023891422002101A86669ADF80030ADF8DB -:10E05000028015F062FE2269238B0C3E0292E26878 -:10E0600069463046ADF80430ADF80C20ADF80E30FE -:10E0700003F077F83046FFF78BFC00226B680299BB -:10E0800007FB0353BDF800005A61FFF757FF0C224E -:10E090006B680133B3FBF2F102FB11336B60C6E72F -:10E0A000A04A00212DE9F0418F7805460C4616461E -:10E0B00027B1012F1DD00020BDE8F08103691A7837 -:10E0C000FF2A2AD1CA78FF2AF5D0DFF85480C8F891 -:10E0D000003000F031FBE3782A69FF2BC8F80070AC -:10E0E0001370E8D0324621462846BDE8F04100F0E2 -:10E0F000D1BA03691B78FF2B0FD1CB78FF2BDAD075 -:10E1000000F078FBE3782A69FF2B1370D3D0214607 -:10E110002846BDE8F04100F01BBB0C20CCE700BF57 -:10E12000984B0021F0B505468BB0282200216846A7 -:10E1300015F0F3FDEB78023BDBB2FC2B75D92B79A4 -:10E14000032B72D12B7C002B6FD12888FAF70CFAA5 -:10E150000446002845D0837A012B05D1C378012BD2 -:10E1600002D10C200BB0F0BDE07AFAF7CFFA426A88 -:10E170004FF495602F4BE188A77A1B6800FB0133B1 -:10E18000D4E9B860012F18BF30460190A06A2189F8 -:10E190000130ADF800100290A97820698DF80210C6 -:10E1A000039069B10129DCD1D3E9C401224BCDE947 -:10E1B0000601D3E90C0104F54274CDE908010AE037 -:10E1C0001D4904F54174D1E90C01CDE90601D3E9FB -:10E1D000C401CDE90801049429466846FFF762FFAF -:10E1E000C0E72888F8F7ACFB08B3436841881E7E77 -:10E1F000ADF800101969AC780191196AD3F8CC20F8 -:10E20000013171430291996A8DF80240039134B152 -:10E21000012CA6D1DB78002BA3D12C3003E0DB78D6 -:10E22000012B9ED124300490D6E712209AE70220D9 -:10E2300098E700BFB43A002168500021034B1A8BC5 -:10E2400002701B8B1B0A437002207047DC500021B8 -:10E25000014B188300207047DC50002108B50FF0F7 -:10E2600031FB044A137801331370BDE808400FF006 -:10E2700035BB00BFDC50002108B50FF023FB044A7A -:10E280005378013B5370BDE808400FF027BB00BF37 -:10E29000DC5000212DE9F843002406460F460546D0 -:10E2A000DFF84080104AC8E90044DFF8409014606D -:10E2B000D9F8003093F82A30A34202D8A81BBDE851 -:10E2C000F88328460FF040FB00F18005AB1BBB42F2 -:10E2D000014604D840460FF08BFC0134E8E70020EB -:10E2E000EDE700BF9C4B0021A44B0021DC4D002139 -:10E2F00008B503480FF08EFC00B1083008BD00BF20 -:10E300009C4B0021A0F1080101480FF071BC00BF37 -:10E310009C4B00212DE9F04FCB8989B007460D4673 -:10E320001646B0F830810293FFF7E2FF0446D0B9F9 -:10E3300030460FF017FB414B9B6A63B197F81823E7 -:10E340004AB901202A88ADF81800ADF816200DF161 -:10E35000160106AA9847FFF781FF072009B0BDE81C -:10E36000F04FF4F7B1BDEB890660984528BF984699 -:10E370000381002380F80A80C372EA78CDF8048014 -:10E380009A4214BF0C220822984606EB020B1E4646 -:10E39000C0F804B0029BDDF80490A3EB080189B239 -:10E3A00097F8D832894528BF8946002B39D1019B7F -:10E3B0008B422CBF002101210D22F3B2534303F104 -:10E3C000100A03930023A2448DF81810504606A9A2 -:10E3D000A5F80E90CDF819308DF81D9002F02EFFA3 -:10E3E0004FF00202039BE1188A7315490A689446AC -:10E3F000CAB900210D22F3B202FB0343C844D9730A -:10E40000029B1FFA88F84345CB4406F10106C1D8A8 -:10E410002246297807F1FC0009B0BDE8F04F0FF063 -:10E42000A4BA0221C8E717335A465146234407F5D8 -:10E43000BE70E0470028DCD00421DBE768500021F3 -:10E44000883A002173B50C46FC300DF107010FF03E -:10E45000AAFAF0B1867AC37A028903FB06F135463F -:10E460000E449642C4BF521A95B20D225343C618A9 -:10E47000B27B2581228003F110020244626042686F -:10E480000A44E260F27B32B1173318446061032022 -:10E49000228202B070BD0220FBE707B5FC300DF10F -:10E4A00007010FF080FA003818BF012003B05DF8B3 -:10E4B00004FB000013B500F1FC0420460DF1070138 -:10E4C0000FF071FA78B1C27A837A511C02FB0333E0 -:10E4D0000289934209DB064B0DF1070118602046C3 -:10E4E0000FF058FA012002B010BDC172FAE700BF68 -:10E4F000A44B002170B50F4E04463568C5B128689D -:10E500000FF030FA2846FFF7FDFEFFF7A7FE94F85C -:10E5100004314021013384F80431012384F8643349 -:10E5200000233360044BBDE87040187B0FF0BEBA87 -:10E5300070BD00BFA44B0021685000210023F7B537 -:10E54000044690F8045180F8643380F8043100F1F7 -:10E55000FC0738460DF107010FF01CFA064640B9DA -:10E56000094B5B681BB115B129462089984703B058 -:10E57000F0BD30680FF0F6F901353046FFF7C2FE06 -:10E58000EDB2FFF76BFEE4E76850002108B5054BDC -:10E590001B68988D103080B20FF0DCF900B10C30A0 -:10E5A00008BD00BFDC4D00210C380FF0DBB90000C6 -:10E5B00008B51346B0B10A0A00F8041C00F8032C91 -:10E5C0000A0C090E00F8022C00F8011C021FD9B237 -:10E5D00005480FF0CAF9054B2021187BBDE808401B -:10E5E0000FF064BA08BD00BFE4500021685000215C -:10E5F00037B504460D460C480DF107010FF0CAF976 -:10E6000078B1837842781B0403EB0223027804304C -:10E61000134410F8012C03EB02632B609DF80730C4 -:10E62000238003B030BD00BFE4500021F0B50446A4 -:10E6300087B00F46684619461E4602F04AFD257807 -:10E640002DB1012D0FD00025284607B0F0BD324670 -:10E65000F9B2201D0FF089F9237B012501332373C3 -:10E66000FFF70AFEF0E73246F9B2201D0FF07DF900 -:10E67000FFF702FEE8E7037807B5012B07D80DF195 -:10E68000070104300FF086F903B05DF804FB0020A9 -:10E69000FAE700002DE9F0430669044633780D4699 -:10E6A000012B17468FB008D0013BDBB2FE2B34BFE5 -:10E6B000122000200FB0BDE8F0831D4BB0F8009091 -:10E6C000D3F80080A6F80290B8F1000F2ED03822BF -:10E6D0000021684615F021FBA368694601932B7958 -:10E6E00048468DF80830EB88ADF80A302B89ADF834 -:10E6F0000C302B7C8DF810306B690593E368069322 -:10E700000C4B0793D4E90623CDE90823D4E9082369 -:10E71000CDE90A23C04728B120883946FFF70EFC0F -:10E720000020C7E7FF230D203370C3E71220C1E7A5 -:10E73000904A0021C9DF010103691A78012A04D136 -:10E74000024A00215268588810477047904A0021B9 -:10E750002DE9F047056906462C780F46012C8EB04E -:10E7600005D0FF2C41D0002C3BD0122435E04FF0D7 -:10E7700000081F4BB0F800A0D3F80090C5E901884D -:10E78000A5F80EA0B9F1000FEFD038224146684637 -:10E7900015F0C3FAB368694601933B7950468DF88A -:10E7A0000830FB888DF80040ADF80A303B89ADF8A1 -:10E7B0000C303B7C8DF810307B690593F368069331 -:10E7C000D6E90623CDE90823D6E90823CDE90A23B3 -:10E7D000C84750B9FF230D242B7020460EB0BDE86A -:10E7E000F087C5E901442C73F7E70024F5E700BF83 -:10E7F000904A002137B50469217889B9164D04344F -:10E8000020460DF107010FF0C5F858B10FF0AAF836 -:10E810000FF058F86B7801336B700FF05FF8EFE78B -:10E82000012901D003B030BD0C4BE0895B689847EB -:10E83000094D043420460DF107010FF0ABF8002814 -:10E84000F0D00FF08FF80FF03DF86B7801336B705C -:10E850000FF044F8EEE700BFDC500021904A0021A1 -:10E8600037B5044671B900F1100528460DF10701CE -:10E870000FF090F818B90023E38003B030BD0FF01B -:10E8800071F8F2E700680028F5D00FF06BF800236C -:10E890002360F0E7F0B55C1E012CBDF81460069D06 -:10E8A00013D884784778240404EB07240778C078C9 -:10E8B0003C4404EB0060012B09D0022B11D01BB9A2 -:10E8C00059B1936801339360F0BD0020F3E7032949 -:10E8D000F7D9B142F5D8A842F3D1136801331360D8 -:10E8E000F2E7B142EDD1F6E72DE9F04F00260546FB -:10E8F0001446B2468BB0CDE9026601F108081CB996 -:10E9000050460BB0BDE8F08F28460DF107010FF01F -:10E910004AF807460028F3D0014604A802F0D9FBC4 -:10E920009DF81330002B14BF0C2108210F44698976 -:10E93000002942D0BDF81E3002265B1AADF81E3009 -:10E9400001230F448DF80830BDF81E309A19944207 -:10E9500037DB01228DF809209DF808208DF80A3058 -:10E9600002B903924FF00002DBB228466A810DF132 -:10E970000701E41A0FF00EF883462B7AA41B013B23 -:10E980002B722B7BA4B201332B73404602A902F0F9 -:10E9900029FC9DF80A90804440464A46394615F0C5 -:10E9A00095F9C844BBF1000F02D058460EF0DAFFCB -:10E9B0004E4456445FFA86FAA1E705268DF8081002 -:10E9C000C2E7B4429CDD4FF00003A41B8DF8093070 -:10E9D0009DF80830E4B28DF80A4003B903934FF074 -:10E9E000000B214469815C46CFE70000034B1B68A4 -:10E9F000988D103080B20EF0ADBF00BFDC4D00210D -:10EA00002DE9F04186B00646884614461D46FFF7BC -:10EA1000EDFF074620B3B8F1010F25D0B8F1020F82 -:10EA200029D000240223ADF802300023694638467D -:10EA3000ADF80060ADF80440ADF80C30ADF80E4014 -:10EA40008DF8103002F08DFB54B13A182B0A3D546A -:10EA500053702B0C93702B0ED37004239C420ED852 -:10EA6000384606B0BDE8F0810DF07FF8B0FBF4F257 -:10EA700002FB1404A4B2042C38BF0424D2E7D354FC -:10EA80000133EBE7FFF7B2BF2DE9F04100F11008C9 -:10EA90008EB004460F4640460DF107010EF083FF8D -:10EAA0000646002F4AD0394602A802F012FB9DF814 -:10EAB0000A50032D40D8DFE805F00328021A01258B -:10EAC00036B10DF1070140460EF064FF0EF04AFF2B -:10EAD000BDF816303A462383002340469DF80810BF -:10EAE000A3760EF042FF28460EB0BDE8F081012566 -:10EAF0006EB9BDF80C303A46238340469DF80810A5 -:10EB00000EF033FF0123A376EDE70025F0E7314651 -:10EB100008A802F0DEFA238B0D98BDF80C201844EB -:10EB2000079915F0D3F838460EF01CFF238BBDF87B -:10EB30000C20134423832DB90025D4E70028FBD0F3 -:10EB40000123A376314608A802F0C3FA02238DF808 -:10EB50002230238B3046ADF82430ADF82E30A37E22 -:10EB600008A98DF8303002F0FCFA00230125238338 -:10EB7000A376B8E72DE9F04F8DB0CDE90121BDF8BE -:10EB800060200446039282799DF8587052B10025A6 -:10EB90008571006830B10EF0E5FE256028460DB0A5 -:10EBA000BDE8F08F0025A946CDE904559E1C002F35 -:10EBB000F4D0314604A802F02BFB9DF810208046CB -:10EBC000064422B99DF81230033B8DF8123094F8B8 -:10EBD00007B0BBF1000F0AD0BBF1010F206859D07C -:10EBE00000284ED00EF0BEFEC4F8009049E0FFF7BA -:10EBF000FDFE20600028DAD0FFF73EFB0C239DF8D5 -:10EC000010A0A380236803F10C00BAF1000F33D1E8 -:10EC10009DF812200399DDF814B08A42C4F810B0B0 -:10EC20003CD91422514607A8039315F076F822899F -:10EC3000019B511CADF824204FF48172ADF81A20CD -:10EC40000222ADF81830179B8DF82820A3EB0B0299 -:10EC5000039B2181184606A90892013502F081FA2A -:10EC600022689DF8041002980EF07FFEEDB2C4F801 -:10EC700000A084F807A091E718460EF073FEC4F8D0 -:10EC800000B09DF81230FF1AA7EB08071E4407F0EA -:10EC9000FF078CE7012A42D1A388184431469DF82A -:10ECA000122015F013F8A3889DF812A056449A4438 -:10ECB0009DF811301FFA8AFAA4F804A0002B3DD069 -:10ECC0001422002107A815F028F8019BAAF10C0ACC -:10ECD000ADF8183023891FFA8AFA5A1CADF824308F -:10ECE0004FF481732281ADF81A30179A236906A96F -:10ECF000D31A20680893ADF81CA0ADF826A002F046 -:10ED000030FA029822689DF804100EF02EFE9DF84D -:10ED100012000135EDB2C4F800903F1A07E00EF082 -:10ED200021FE9DF81230C4F800901E44FF1AA7EB94 -:10ED3000080707F0FF0784F8079038E70123E3711D -:10ED40002CE70000014B024A1A617047C04B0021BA -:10ED5000F5380201B2F5706FF8B505460E46144657 -:10ED600033D2052A33D84FF4856363431B4AD11845 -:10ED7000D35C63B34B78012B29D1194B1B6893F8F3 -:10ED80002230834225D94FF49563164A43431168D4 -:10ED9000CA18CB5CEBB1D2F8303300279B011AD5EF -:10EDA00092F82233BBB10A200EF0D4FD014658B1CF -:10EDB00042F2012343800C4B05808780C48006818A -:10EDC000187B0EF0D8FD3846F8BD1220FCE7422033 -:10EDD000FAE70220F8E71A20F6E700BFD01D00216D -:10EDE000DC4D0021B43A002168500021F8B51E4BDB -:10EDF00004461B680E4693F822301546834201D81C -:10EE00000220F8BD1046F6F709F930B390F8897181 -:10EE1000012F24D14FF49563144A63431168CA1833 -:10EE2000CB5C002BECD0D2F830339B0119D592F893 -:10EE30002233B3B10A200EF08DFD01460028E0D048 -:10EE400042F2012343800A4B04808780C5800681FB -:10EE5000187B0EF090FD0020D3E74220D1E70C2074 -:10EE6000CFE71A20CDE700BFDC4D0021B43A0021E6 -:10EE70006850002130B50C4C246894F8224084423C -:10EE80000FD94FF495646043084C25682C18285C12 -:10EE900038B1002084F87013A4F87223A4F87433F6 -:10EEA00030BD0220FCE700BFDC4D0021B43A002158 -:10EEB000074B084A1A60084B084A1A60084B094A6F -:10EEC0001A60094B094A1A60094B0A4A1A607047CE -:10EED000943A0021D59E0001903A002179A10001C9 -:10EEE000AC3A00211DA40001983A002139A4000188 -:10EEF0008C3A002159A40001034B04481B7B037387 -:10EF0000034B19680EF036BF68500021A84B002152 -:10EF100010510021C3780146022B70B517D0032B86 -:10EF200007D0012B2CD1E7F739FABDE87040FFF785 -:10EF3000E3BFD0E9022352EA030003D1BDE87040E9 -:10EF4000E7F72CBA4879BDE87040E7F755BA017980 -:10EF5000421D00F10803D0E90445204661B129466D -:10EF6000E7F754F90EF0AEFC064A1379013B137132 -:10EF7000BDE870400EF0B2BC2946E7F7A1F9F1E711 -:10EF800070BD00BF105100212DE9F84FDDE90A677F -:10EF9000154C8246894690461D460EF093FC94F827 -:10EFA00004B00EF09BFCBBF1030F1BD818200EF031 -:10EFB000D1FC0146B0B140F20623C0E902674380AC -:10EFC0000A4B80F804804571C0E904A9187B0EF053 -:10EFD000D2FC0EF077FC237901332371BDE8F84FA2 -:10EFE0000EF07CBCBDE8F88F105100216850002164 -:10EFF000014B1860FFF780BF1051002108B50D4A82 -:10F000000D4B00219A610D48102214F086FE0C4B26 -:10F010000C481B681B79072B81BF0B4A136A43F00E -:10F0200040031362E6F784FF4FF48372034BDA80E8 -:10F0300008BD00BF15EF0101B00C0021A84B002155 -:10F04000DC4D002189EF010168500021182008B52E -:10F050000EF080FC014670B140F20633438000237D -:10F06000002243710023C0E90223034B187BBDE853 -:10F0700008400EF080BC08BD6850002170B50646FF -:10F08000182015461C460EF065FC014658B140F2AA -:10F090000633C0E902544380034B4671187BBDE838 -:10F0A00070400EF068BC70BD6850002108B5C9B250 -:10F0B00010F0C2FB012008BD10B58AB0044626221C -:10F0C0000021684614F029FE14238DF802300C4B01 -:10F0D000204693F8223004F12002002B14BF0023B5 -:10F0E00012238DF804300DF1050350F8041B9042F3 -:10F0F00043F8041BF9D168460CF06AFD0AB010BD54 -:10F1000018510021024B4FF40061187B0EF0CEBC69 -:10F110006850002110B500F11F0300F10F029A4260 -:10F1200000D110BD01781C7800F8014B03F80119DB -:10F13000F5E701F1200301388B4200D1704713F845 -:10F14000012D00F8012FF7E700B589B020216846AE -:10F1500010F072FB054813F09DF8684613F0A0F814 -:10F16000FFF7D0FF09B05DF804FB00BFADF001016F -:10F1700000B589B001466846FFF7DBFF054813F08C -:10F1800089F8684613F08CF8FFF7BCFF09B05DF80A -:10F1900004FB00BFADF0010110B513F093F8044675 -:10F1A00018B9FFF7AFFF204610BD0120FCE738B5C6 -:10F1B00004460D4613F0E2F82046FFF7ABFF04F1DA -:10F1C0002000FFF7A7FF2846BDE83840FFF7A2BFA1 -:10F1D00070B5A2B0FFF7E0FF58B36846164910AE0D -:10F1E000FFF7E5FF46220021304614F096FD132379 -:10F1F0006A468DF842300DF1450508AB144603CC44 -:10F200009C4228606960224605F10805F6D10DF19F -:10F2100065041A4603CAB24220606160134604F1D5 -:10F220000804F6D130460CF0D3FC0022024B83F8E0 -:10F23000202022B070BD00BF1851002130B5044617 -:10F240000D4699B0014608A8FFF773FF04F12001AD -:10F2500010A8FFF76EFF29466846FFF76AFF0748C8 -:10F2600013F018F8694608A813F0E8F8044B4FF4B7 -:10F270008051187B0EF01AFC19B030BDADF00101C1 -:10F280006850002110B513F025F9044638B9054B34 -:10F290004FF48051187B0EF009FC204610BD012070 -:10F2A000FCE700BF6850002110B5044613F02CF9AC -:10F2B0002046BDE81040FFF72DBF000010B50E4CF2 -:10F2C00088B094F822304BB92022FF21684614F010 -:10F2D00024FD6846FFF7F0FE08B010BDFFF7D2FF2F -:10F2E0000028F9D06846FFF7DFFF6846FFF7E4FE25 -:10F2F000002384F82030EFE71851002130B5044690 -:10F3000091B00D4601466846FFF713FF04F1200156 -:10F3100008A8FFF70EFF684613F046F810F0FF0448 -:10F3200006D12DB1044B4FF48051187B0EF0BEFB7B -:10F33000204611B030BD00BF6850002110B509480B -:10F3400090F8204064B9012380F8203090F82130F3 -:10F350001BB1FFF70DFF204610BDFFF7F5FEFAE7E2 -:10F360000C24F8E7185100212DE9F041114D064613 -:10F3700095F820800F46B8F1000F18D195F823407A -:10F38000B4FA84F14909FFF7B9FF85F8220028B9DA -:10F39000002C18BF12242046BDE8F0810123394615 -:10F3A000304685F820304446FFF748FFF3E70C2449 -:10F3B000F1E700BF18510021F0B599B06A46164632 -:10F3C000144B03F12005144618685968083303C428 -:10F3D000AB422246F7D108AA15460F4B03F140076E -:10F3E000144618685968083303C4BB422246F7D153 -:10F3F0000A4B93F820405CB901223146284683F835 -:10F40000222083F82020FFF719FF204619B0F0BD15 -:10F410000C24FAE7DC4E0301FD4E030118510021D4 -:10F42000024B83F823000020704700BF18510021D1 -:10F43000074B084ADA62084A1A63084A136A43F01B -:10F44000006313620022064B83F82320704700BF3D -:10F45000780C0021D1F10101BDF2010168500021B9 -:10F4600018510021034B044A1A61044B044A1A60E4 -:10F47000704700BFE84B00215D3E0201A83A002121 -:10F4800019400201F8B500230B701378164603F0FB -:10F490003F029B090546027043706AB9741C2A78C2 -:10F4A000A11B8A4244DB531C5B1ADBB22C62AB7794 -:10F4B0001C44A01BC0B2F8BD7778B41C0F708378D1 -:10F4C000F90743EA0703837006D520460EF0E0F8FB -:10F4D000C5E9020106F10804BA0705D520460EF079 -:10F4E000D7F8C5E9040106347B0706D514F8013BBB -:10F4F00003F01F029B092A766B7638070AD56278DB -:10F5000014F8023B03EB0223C3F30B02C3F30333F0 -:10F510006A832B77F90644BF6C620334BA0644BF92 -:10F52000AC6212347B0644BF14F8013B6B77B6E73C -:10F5300000232B62AB77BCE70B7803F03F0303702B -:10F540000B78C3F3801343700B78DB0983708A78E0 -:10F550004B7803EB0223C3F30C02C3F342338280E4 -:10F56000837170474A780B7830B503EB0223C3F3FD -:10F570000C020280C3F34032C3F380338270C37045 -:10F58000CA788B7803EB022383804B798A791B023C -:10F5900012049B182CBF012200220C791B19CC7974 -:10F5A00042F1000524060A7A1B1942EB050202F01B -:10F5B0001F04C0E9023452090274CB7A8A7A1B0410 -:10F5C00003EB02234A7A13440A7B03EB0263436191 -:10F5D0008A7B4B7B03EB0223CA7B03EB02438361F1 -:10F5E0004A7C0B7C03EB0223838330BD4B788A7803 -:10F5F0001B0212049B182CBF0122002210B50C78AC -:10F600001B1942F10004CA7812069B180A7942EBD2 -:10F610000402C0E902328A794B7903EB02230382A8 -:10F62000072010BDF0B58B784C781B0403EB042346 -:10F630000C782344CC78C3F30D0503EB0464C3F3C7 -:10F6400080338372C4F3CB33E40E058183818473EA -:10F650008B794C791B0403EB04230C792344CC797C -:10F6600003F01F0503EB0464C3F342130374C4F3F4 -:10F670001323240FC573436104768B7A4C7A1B04E1 -:10F6800003EB04230C7A2344CC7AC3F3130503EB76 -:10F690000464C3F3035380F82030230EC561438410 -:10F6A000CB7B8C7B1B0403EB04234C7B23440C7C23 -:10F6B00003EB04634362CB7C8C7C1B0403EB0423CD -:10F6C0004C7C23440C7D03EB0464C3F3130383627B -:10F6D000230D83858C7D4B7D03EB04230024C385A0 -:10F6E0000B7E4D7E1B022D045B192CBF0125254688 -:10F6F000CE7D9B198E7E45F1000536069B19CE7E88 -:10F7000045F1000535441B1905F01F06C0E90C360C -:10F710006D0980F838504B7F8E7F1B0236049B1991 -:10F720002CBF012626460F7F0135DB19CF7F46F11E -:10F7300000063F06DB1991F8207046F100063E44B2 -:10F740001B1906F07F07222A4FEAD616C0E91037A8 -:10F7500080F8486080F8385016D9012380F8493085 -:10F76000D1F82130523040F8083CD1F8253040F82B -:10F77000043C01F12903393153F8042B8B4240F842 -:10F78000042BF9D13820F0BD80F849402020FAE759 -:10F790008B784A789B0143EA42120B781343CA786C -:10F7A00043EAC2130A7943EA02231BB20370C3F38C -:10F7B000072343700220704770B50546049EF47F0E -:10F7C0000DF06CFF06343146F27FE4B2A81D14F050 -:10F7D0007DFA204670BD10B504460DF05FFFDDE9EF -:10F7E0000223A01D0DF05AFF0C2010BD38B5D1E941 -:10F7F00000230C4605460DF051FFD4E90223A81D55 -:10F800000DF04CFF0C2038BDFFF7D6BF38B5D1E95D -:10F8100000230C4605460DF041FFD4E90223A81D44 -:10F820000DF03CFF0C2038BD38B50C460546FFF7FF -:10F83000EDFF2169228C295421692B18090A59707E -:10F84000618A22209970E17CD970616919716169BE -:10F85000090A5971E18A997194F82610D971218D9C -:10F860001972218D9A72090A120A5972DA72628C1F -:10F870001A73628C120A5A73A28C9A73A28C120A9F -:10F88000DA73A2691A74A269120A5A74628B9A74A2 -:10F89000E27EDA74E2691A7594F82B1094F82A2043 -:10F8A00042EA41125A7538BD0B784A7803F00F01CD -:10F8B0000170C3F340114170C3F38011DB09C370C1 -:10F8C0001346054A817012681279082A98BF03F01E -:10F8D0003F03037102207047DC4D002138B5044618 -:10F8E00008460D460DF0D4FEC4E90001A81D0DF038 -:10F8F000CFFEC4E902010C2038BD38B505460846E4 -:10F900000C460DF0C5FEC5E90001A01D0DF0C0FEBE -:10F91000C5E90201A37B627B1B0403EB0223227B6C -:10F9200022201344E27B03EB02632B61627C237C85 -:10F9300003EB0223A27C03EB02436B61E37C85F8BB -:10F940002630627D237D03EB02232B85E27DA37DA0 -:10F9500003EB02232B84627E237E03EB02236B8462 -:10F96000E27EA37E03EB0223AB84637FA27F1B02B4 -:10F9700012049B182CBF01220022217F5B1842F148 -:10F980000001E27F12069B1894F8202042EB01024E -:10F99000C5E9063294F8213003F01F025B0985F8AF -:10F9A0002A2085F82B3038BD10B590F82630028C0F -:10F9B000082B22D840F67A41931F9BB28B428CBF12 -:10F9C00000230123018D914288BF002340F6764138 -:10F9D000828C0A3A92B28A4288BF0023D0E906425A -:10F9E00012F0E0010BD122430BD090F82A20053A07 -:10F9F0000B2A94BF1846002010BD0023E2E7002325 -:10FA0000F3E70B46F1E708230B7028234B70836D57 -:10FA10008B70836D1B0ACB70B0F85A300B7190F865 -:10FA20005B304B71C36D8B71B0F86030CB71B0F847 -:10FA3000603009201B0A0B72704709230B703223B8 -:10FA40004B70D0F824318B70D0F824311B0ACB7066 -:10FA5000B0F826310B7190F827314B7190F82831AE -:10FA60008B7190F82931CB7190F82A310B7290F894 -:10FA70002B310A204B727047034670B590F8BA20BC -:10FA800093F8F040901C01320A702C224A70B3F8AF -:10FA9000C020013C8A70B3F8C020B3F8C450C2F350 -:10FAA0000D0242EAC53293F8C650E4B242EAC5629A -:10FAB00093F8C250C0B2AD0305F480452A43121238 -:10FAC000CA70B3F8C420C2F347020A71B3F8C02069 -:10FAD000B3F8C450C2F30D0242EAC53293F8C650DF -:10FAE00042EAC562C2F307624A7193F8C85093F8BC -:10FAF000C72042EA45128A7193F8D020D3F8CC503F -:10FB0000120793F8C86042EA052293F8C75045EA05 -:10FB100046152A43120ACA7193F8CD200A7293F847 -:10FB2000D020D3F8CC50120742EA0522120E4A72B6 -:10FB3000D3F8D4208A7293F8D520CA72B3F8DA20A9 -:10FB400093F8D850120642EA0552D3F8D4502A430B -:10FB5000120C0A73B3F8DA2093F8D850120642EA6E -:10FB60000552D3F8D4502A43120E4A7300228A73E6 -:10FB7000D3F8DC20CA73D3F8DC20120A0A74B3F875 -:10FB8000DE204A7493F8DF208A74D3F8E020CA7428 -:10FB900093F8E1200A75B3F8E450D3F8E02042EA84 -:10FBA0000552120C4A75B3F8E450D3F8E02042EA4B -:10FBB0000552120E8A75B3F8E620CA75B3F8E6202E -:10FBC00012120A76D3F8E8204A76D3F8E820120A0F -:10FBD0008A76B3F8EA20CA7693F8EB200A77D3F84E -:10FBE000EC2042EA44124A77D3F8F8208A77D3F817 -:10FBF000F820120ACA77B3F8FA2081F8202093F887 -:10FC0000FB2081F82120D3F8FC2093F8004102F07A -:10FC10007F0242EAC41281F8222093F8012192B1B6 -:10FC2000D3F802212B3141F8082CD3F8062141F8F2 -:10FC3000042C03F5857203F58D7352F8044B9A4238 -:10FC400041F8044BF9D170BD2DE9F0410D469846BD -:10FC5000074616460DF044F8174B32288CBF00209B -:10FC600001209D421CD800221449A5FB0151C1F37B -:10FC70004F0146EA801646EAC21688F8006097F8F7 -:10FC80003F30022B16D0032B14BF0023022388F829 -:10FC9000011041EA4331091288F80210BDE8F081F1 -:10FCA00007490122A5FB0114032101FB0541C1F312 -:10FCB0008F21DEE70123EAE7C3BF03001211111110 -:10FCC0009E36D0692DE9F04F87B005930023924608 -:10FCD000109A03911371129B044603330493129BF1 -:10FCE0009DF84C801D1D9A4B9DF850609B69D90171 -:10FCF00003F0807B00F17E82B8F1040F40F0808237 -:10FD0000002E14BF4FF003084FF001080CB9A346B2 -:10FD100081E24FF0000B238C9A0600F17482039B62 -:10FD200013F0010740F0E5801AF0010F04D094F8B9 -:10FD3000D733DB0740F1DE80039B980706D41AF027 -:10FD4000020F10D094F8D73399070CD447F002076C -:10FD500005F10609002C00F0E480D4E906232846CA -:10FD60000DF09CFC4D46039B1A070AD41AF0080FAD -:10FD70001AD094F8D7331B0703D5AEB194F8543397 -:10FD800093B147F00807002E00F0D380B4F8563343 -:10FD90002A4602F8023B94F84210C3F30B0343EAED -:10FDA00001331B126B701546129BEA1AC2F5807361 -:10FDB00001330193039B13F0200107D11AF02003B4 -:10FDC00008D094F8D733980600F1B680C2F1EF035B -:10FDD000019301231AF040091DD0B8F1030F02D09E -:10FDE000B8F1060F0AD1B4F8609319F040090DD1AB -:10FDF000B8F1030F0FD0B8F1060F0CD0B4F8209073 -:10FE000019F0400902D1B8F1070F04D14FF00109F0 -:10FE1000019A013A0192BBF1000F019A18BF00222A -:10FE20000192119A002A00F089801199128849895B -:10FE30001AF0100FA2EB010292B2029209D0119AAD -:10FE4000127B32B9019994F84C20914228BF114697 -:10FE50000191039A12F0100610D11AF0100270D01E -:10FE6000DDE901128A4209D8B8F1030F0AD194F8EA -:10FE7000C223012A06D094F8C0631EB12E4647F073 -:10FE800010070335002B00F0C58094F8DD2BD4F863 -:10FE90009CA1012A47F020070AD194F8B7134A061B -:10FEA0001FBFD4F850239244D4F8B02302FB11AA08 -:10FEB0005046D4F8181A03930CF024FFB0F5967F3F -:10FEC000039B40D95046D4F8181A0CF01BFF214A66 -:10FED000904243D9B0F5161F039B24BF0023184658 -:10FEE0001D4AA0FB0212032101FB0020C0F38F205A -:10FEF0003AE04CB1D4E9042328460DF0CFFB129B25 -:10FF0000012703F10A0517E7129B03F10A090CF018 -:10FF1000BBFE436A2846D3E9FE230DF0BFFB4D46E6 -:10FF20000AE70CF0B1FE436A03F58063D3E90023CE -:10FF300015E7B4F840302BE70B464BE7119A0292D5 -:10FF400087E716469EE7D4F850239244B0E700BFF7 -:10FF500020500021C3BF03009E36D069AF4BA0FBE9 -:10FF600003300023C0F34F00287040EA43300012F2 -:10FF70006870D4F85023AA4BA2FB0321D20F42EAA7 -:10FF80004102AA70D4F85023A2FB0323C3F3D71372 -:10FF9000EB70D4E9DAA303F01F0BFBF7D7FB4FEAB2 -:10FFA0001A2385F804A06B714BEA401B4FEA1A43F1 -:10FFB0004FEA1A6AAB7185F807A085F808B0D4F843 -:10FFC000CC316B72D4F8CC311B0AAB72B4F8CE31A1 -:10FFD000EB7294F8CF312B73D4F8D0316B73D4F823 -:10FFE000D0311B0AAB73B4F8D231EB7394F8DD3B1C -:10FFF000012B40F0878094F8B7335B0600F08280D5 -:020000040102F7 -:10000000B4F8903101332B74B4F8903101331B12E2 -:100010006B741235B9F1000F07D094F992080FF004 -:1000200015FE47F0400705F8010BB8F1030F0BD0A0 -:10003000B8F1060F08D0B8F1010F40F0D68094F85F -:10004000DD3B002B00F0D1804FF00009A24649466D -:10005000744AB9F1020F02D1B8F1010F17D19AF821 -:1000600050B0BBF1010F12D1049B9AF85200EB1A69 -:100070000230C3F14003C0B2DBB2984207D8294630 -:1000800052F82930204698475946664A054409F1F6 -:100090000109B9F1030F0AF1680ADAD157EA01033D -:1000A000049B08BF1D46129BA5EB0309029B83B36B -:1000B000DDE901128A4228BF0A46C9F5807301337F -:1000C000934228BF1346119A11995289DBB21A4400 -:1000D0004A81049A1298AD1A6A1C1344109A13713B -:1000E0001146FFF755FB059B45EA8315129B9D7052 -:1000F000DF70B8F1060F15D8DFE808F00D1941538D -:1001000014417300B4F890312B74B4F890311B0A89 -:100110007EE7029BDDE7002384F8D773C4F8C03B79 -:10012000C4F8D8635FFA89F007B0BDE8F08F002308 -:10013000C4F8C03B002EF5D0109B94F84E1A1A79E3 -:1001400094F84C0A02320CF08EF8374B1B689A8AEE -:10015000A36C9A422CBF8018C018344B984228BF19 -:100160001846C4F8C00B0CF085F83346014694F8E5 -:10017000C42BC4F8C00B2046FFF766FDD2E7002C65 -:10018000D0D00023C4F8C03B002ECBD094F84F1A37 -:1001900094F84C0A09B994F8191B109B1A79023289 -:1001A000D1E70023C4F84833002EBBD0109B94F84D -:1001B0004E1A1A7994F84C0A02320CF054F81A4B81 -:1001C0001B689A8AA36C9A422CBF8118C118174BDE -:1001D00094F84D23994228BF19463346C4F8481372 -:1001E000C9E70023C4F848339CE7049B002F08BFED -:1001F0001D4658E7B8F1040F3FF482AD4FF0010BF4 -:10020000002C7FF488ADB8F1020F3FF488ADB8F14F -:10021000050F3FF484AD00278EE500BF12111111C8 -:10022000E3361A00404F0301DC4D0021D47E250047 -:1002300000232DE9F04788B0CDF8193007238DF859 -:100240001830038C064603F007030F46904600F56E -:100250000969062B00F28680DFE803F0047C7C84C9 -:100260004C7C7C00B0F85238002B07BF1A461D4664 -:1002700008221025154390F83D20012A14BF0024C0 -:10028000402408BF44F00104002B0CBF402300238E -:100290001C4390F88931012B04D190F8C63B002B08 -:1002A00008BF1825E8064ED445F001050DF1180ADF -:1002B000EB0632464946504648BF04F0BF04F5F706 -:1002C0002BFA324649465046F5F786FA0022338C1F -:1002D000CDE90328CDE9012786F8D7232946224610 -:1002E0003046CDF800A003F00303FFF7EBFC08B0A5 -:1002F000BDE8F087B0F85238002B07BF1A461D46FC -:1003000008221025154390F83D20012A0ABF022437 -:100310000024402208BF44F0010418BF0022002B33 -:100320000CBF4023002314431C4390F88931012B58 -:1003300004D190F8C63B002B08BF1825E90602D46B -:1003400045F00305B2E7094B9B699A04AED504F06A -:10035000FE04ABE790F83D301825012B0CBF40247C -:100360000024A3E700242546A0E700BF2050002179 -:100370002DE9F04F9946002389B0CDF819300723B5 -:100380008DF81830038C054603F00703884617469E -:1003900000F5246A062B4FD8DFE803F00751514ED1 -:1003A00019044C0040240B2626E090F8D74390F81F -:1003B000893104F00104C4F15104012BE4B204D1E9 -:1003C00090F8C63B0BB944F02004082614E090F8DE -:1003D000D74390F8893114F0020F04F001040CBFE8 -:1003E0000A260826C4F15104012BE4B204D190F886 -:1003F000C63B0BB944F020040DF1180B2A465146B8 -:100400005846F5F789F92A4651465846F5F7E4F972 -:1004100001222B8CCDE90282314622462846CDE9C5 -:1004200000B7CDF8109003F00303FFF74BFC09B0C1 -:10043000BDE8F08F4824B6E700242646DCE74024D8 -:100440000926D9E700232DE9F04389B0CDF819300A -:10045000072304468DF81830134B00F524699B6977 -:1004600006AD1B050E46174649460246284654BFB0 -:100470004FF001084FF00908F5F74EF922464946BA -:100480002846F5F7A9F90223CDE9026304F23C738B -:10049000CDE9005350220023414620460497FFF740 -:1004A00011FC09B0BDE8F0832050002130B50C46A6 -:1004B0000725002189B0CDF819108DF818502BB9F7 -:1004C000018C11F0020F14BF0021082104930423B2 -:1004D000CDE9024306AB0192009310220023FFF7FF -:1004E000F1FB09B030BD000000232DE9F04788B0D2 -:1004F0000F469046054606938DF81C3000B308233E -:1005000000F5246600F6C8340246314680F8C83B40 -:100510002046F5F701F92A4631462046F5F75CF901 -:100520000523CDE90273002303211A462846CDE9AD -:100530000043CDF81080FFF7C5FB08B0BDE8F08799 -:10054000DFF83CA0DAF80030BBB1DFF83890D9F81A -:10055000003093B10CF098FB08230446466AC16A48 -:1005600032468DF8183006A8DAF80030984732463F -:10057000D9F80030E16A06A8984706ACD0E700BF7A -:10058000BC4B0021B84B00212DE9F7430546002460 -:1005900000F5096702460E46684601F10208394631 -:1005A00000948DF80440F5F7B7F82A4639466846B6 -:1005B000F5F712F92B8C03F00703032B05D0052B5D -:1005C0004ED0022B50D106234BE08DF80040D5E9E8 -:1005D000042340460DF062F89DF8003006F108074C -:1005E000012B0CD1D5F81439384643F00403C5F873 -:1005F0001439D5E906230DF051F806F10E079DF8E0 -:100600000090B9F1060F31D8012303FA09F313F072 -:1006100045040BD095F83D4644B11F2C2246384680 -:1006200028BF1F2205F23E6113F050FB104B9B6A5E -:100630005B0405D5B9F1010F9CBF01238DF8013092 -:10064000A7EB08000444694630468DF80440FFF7E4 -:100650009FF89DF804000230C0B203B0BDE8F083FB -:1006600001238DF80030B2E70223FAE70024DDE72A -:1006700020500021002337B5ADF801308DF803304C -:1006800004238DF8003090F839300446022B0D46D3 -:1006900025D003F0FD03012B01D18DF8023094F831 -:1006A00051376946063328468DF80430FFF770F855 -:1006B000D4E90423054428460CF0F0FF94F85127B0 -:1006C0003AB11F2A28BF1F2204F25271A81D13F04D -:1006D000FDFA9DF804000230C0B203B030BD43699A -:1006E0001B0A03F0C003402BD9D10123D5E700003A -:1006F000F0B51F460023072490F8C06389B09E42DE -:1007000014BF04261E468DF818400D4CB0F86053F7 -:10071000E46A05F04005640804F0080434432C43FF -:100720000325019206AACDE9021500921946049705 -:1007300044F01002CDF81930FFF7C4FA09B0F0BD4B -:10074000205000218A780B8843EA02331BB20370E1 -:10075000C3F3072343708B8883708B881B0AC37095 -:10076000042070474A790B7843EA02234A789200C2 -:1007700002F0040213438A78D20002F00802134305 -:10078000CA78120102F0100213430A79520102F0F2 -:10079000200213431BB20370C3F3072343700B798A -:1007A00043B1CB798A7903F01F0343EA8213837044 -:1007B0000320704702207047002303700B784370BA -:1007C0004B8883704B881B0AC3708B8803718B889E -:1007D0001B0A4371CB888371CB881B0AC3710B89B9 -:1007E00003720B891B0A43724B8983724B891B0A64 -:1007F000C3720C2070474A780B7803EB0223C3F3D3 -:100800000B02C3F3013302808370CA788B7803EB49 -:1008100002238380042070470B7810B503F0030493 -:100820004A780470C3F380044470C3F3C004847036 -:10083000C3F30014C3F34013C470037142713BB19E -:100840008B7803F01F029B09C2718371032010BDD6 -:100850000220FCE74B780370CA788B7803EB022305 -:1008600043804A790B7903EB02238380CA798B7921 -:1008700003EB0223C3804A7A0B7A03EB0223038142 -:10088000CA7A8B7A03EB022343810C2070478B7862 -:10089000CA781B0212049B182CBF0122002210B53B -:1008A0004C781B1942F100040A7912069B184A7908 -:1008B00042EB0402C0E90032CA798B7903EB0223D0 -:1008C0000381082010BD10B50446481C0CF0CDFE75 -:1008D000C4E90001092010BD4B780370CA788B78F9 -:1008E00003EB022343804A790B7903EB02238380D5 -:1008F000062070478A784B7803EB022303800A793D -:10090000CB7803EB022343808A794B7903EB0223F4 -:1009100083800A7ACB7903EB0223C38009207047D6 -:1009200010B58A784B780C3003EB022320F80C3C8E -:100930000A79CB7803EB022320F80A3C8A794B79B9 -:1009400003EB022320F8083C0A7ACB7903EB02235D -:1009500020F8063C4B7A00F8043CCA7A8B7A03EB09 -:10096000022320F8023C01F10E031A3113F8014C66 -:1009700013F8022C023302EB04228B4220F8022BE4 -:10098000F4D1182010BD4B7803708A7803F0070368 -:10099000037002F007034370032070474B78037025 -:1009A0008B7843700A79CB7803EB022343800520D0 -:1009B000704738B58B784A78054602EB0322034628 -:1009C0000C4623F8022BCA1C153112F8010B8A427F -:1009D00003F8010BF9D1A27D637D04F11B0003EB49 -:1009E0000223AB82227EE37D03EB0223EB82637E54 -:1009F00003F00F022A76C3F300125B096A76AB7626 -:100A0000A37EEB760CF044FEC5E9080194F82220A1 -:100A100094F82130232003EB02232B8538BD4B783B -:100A200003708B784370CB7883700B79C3708A79AD -:100A30004B7903EB0223C3F30B03D2090271C3808A -:100A40000A7ACB7903EB0223C3F30B0303818A7A7F -:100A50004B7A03EB0223CA7A03EB0243C3F313037B -:100A6000C3604A7B0B7B03EB02238A7B03EB0243CD -:100A7000C3F3130303610A7CCB7B03EB0223838262 -:100A80008A7C4B7C03EB0223C382CB7C03764A7DBA -:100A90000B7D03EB02238A7D03EB0243C361CB7D15 -:100AA0001A0903F00F0380F8212080F820300B7E14 -:100AB00080F822304B7E80F82330CA7E8B7E03EB99 -:100AC000022383844A7F0B7F03EB02238A7F03EB9D -:100AD0000243836291F82020CB7F03EB022391F83D -:100AE000212003EB0243C36291F8232091F82230C6 -:100AF00003EB02230386242070478A784B7803EBAC -:100B00000223CA7803EB024303604A790B7903EBB3 -:100B100002238A7903EB024343600A7ACB7903EB21 -:100B20000223038109207047CB788A781B0403EBEA -:100B300002234A7813440A7903EB026303608A793B -:100B40004B7903EB0223CA7903EB024343604A7AF1 -:100B50000B7A03EB02238A7A03EB024383600A7B5E -:100B6000CB7A03EB02234A7B03EB0243C360CA7BCD -:100B70008B7B03EB022303821020704738B58B7800 -:100B80004A78054602EB032203460C4623F8022B63 -:100B9000CA1C153112F8010B8A4203F8010BF9D176 -:100BA000A27D637D04F11B0003EB0223AB82227E56 -:100BB000E37D03EB0223EB82637E03F00F022A76D0 -:100BC000C3F300125B096A76AB76A37EEB760CF07A -:100BD0005FFDC5E9080194F8222094F821302B200C -:100BE00003EB02232B8594F8253094F824201B0472 -:100BF00003EB022394F82320134494F8262003EBFC -:100C00000263EB6294F8273085F8303094F828308E -:100C100085F8313094F8293085F8323094F82A304C -:100C200085F8333038BD000070B504460E461546D1 -:100C3000FFF7F2FD365C014426722A2E00F2918005 -:100C4000DFE816F02B006C00E4008F008F008F00AF -:100C50008F00E400830084008F008F0091009600D5 -:100C600089005F005D009B008F008F007E007E008A -:100C7000A800A600B200BE00E900F300D700E00023 -:100C8000E000F90004010F011C013C0141012B01AE -:100C900046016A016D0175018801002D61D004F1E2 -:100CA0001000FFF7D7FD637983425AD140F67A41AD -:100CB000A38A9A1F92B28A4201D91E261DE0217C86 -:100CC0000029FAD0092B8CBF082203F1FF32914290 -:100CD000F3DC628A9A42F0D840F67640218BA1F18B -:100CE0000A0292B28242E8D8E28A02FB0333B3EBF3 -:100CF000810FE2DAB2F5FA7FDFD2304670BD012D06 -:100D00002FD0994B9B6A9D072BD504F11000FFF75C -:100D100007FE6379834224D10026EEE70DB304F188 -:100D20001000FFF7B4FD637983421AD1D4E90401BE -:100D300031F01F03C1D10AF01AFF0128ECD8BCE73B -:100D400004F11000FFF7D6FDE3E755B104F1100000 -:100D5000FFF7B9FDDDE7012D03D0834B9B6A180730 -:100D6000F4D41926C9E704F11000FFF7B5FDD0E768 -:100D7000FF2323744B7863744AE07B4B9B6A5A07CA -:100D8000EFD54B7823748B7863746379032BC2E7B8 -:100D9000012DE6D0744B9B6A13F4106FE1D004F17F -:100DA0001000FFF7F0FDB4E7002DDAD06E4B9B6A20 -:100DB00013F4106FD5D004F11000FFF7EFFDA8E792 -:100DC000012DCED0684B9B6ADB03CAD54B782374C8 -:100DD0008A78617903F00703032962742374C0D110 -:100DE000002B3FF46AAF023A232A8CBF1E2600264E -:100DF00083E75D4B9B6A9E01B3D504F11000FFF7BA -:100E0000D8FD86E7584B9B6A5D01AAD54B782374C1 -:100E10006379022B7FE7544B9B6A5803A1D54B782B -:100E200003F01F0222749B09A5E74F4B9B6A9903AD -:100E30003FF572AF95E74C4B9B6A9A0091D5002D18 -:100E40008FD004F11000FFF7EAFD62E7464B9B6A82 -:100E5000DB0086D5012D84D004F11000FFF74DFE94 -:100E600057E7414B9B6A9E007FF57BAF002D3FF417 -:100E700078AF04F11000FFF757FE4AE73A4B9B6A40 -:100E800013F0405F3FF46DAF4B7823748B7863743D -:100E9000CB78A3746379042B3DE7334BDB6A13F003 -:100EA000040F3FF45EAF4B7823748B786374CB7878 -:100EB000A3740B79E3746379052B2CE72A4BDB6A67 -:100EC00013F0020FDEE7284BDB6A13F0020FE8E7AE -:100ED000012D3FF446AF244BDB6A98067FF541AF06 -:100EE0008A784B7803EB022323820A79CB7803EBD1 -:100EF000022363828A794B7903EB0223A3820A7A65 -:100F0000CB7903EB0223E3828A7A4B7A03EB022349 -:100F1000238363790B2BFEE6002DDCD121E7002D26 -:100F20003FF41FAF104BDB6A13F0800FAAE7012DCF -:100F30003FF417AF0C4BDB6A1A067FF512AF4B1C60 -:100F400004F110020B3113F8010B8B4202F8010B74 -:100F5000F9D1DEE7044B9B6A9B017FF502AF04F1F8 -:100F60001000FFF70BFED4E62050002170B50E46AE -:100F700004461546FFF750FC325C33182272033AE0 -:100F8000102A3CD8DFE802F0092634363B3B3B39D7 -:100F9000363B3B3B3B3B3B3D3D0085B3D3F801201B -:100FA0002261D3F805206261997A5A7A02EB012214 -:100FB0002283D3F80B20C4F81A20D3F80F20C4F8EA -:100FC0001E20D3F81330C4F822306379172B16D1C2 -:100FD000002070BD012D12D0D3F801202261D3F87A -:100FE00005206261D3F809206379A2610D2BEEE739 -:100FF000012D04D06379012BE9E7002DFAD11920E6 -:10100000E7E7024B9B6ADB06F4D4F8E720500021A7 -:10101000CB788A781B0243EA42120B7813434A7852 -:10102000920002F01C0213431BB20370C3F30723A8 -:1010300043700220704710B50024BDF808100470FA -:10104000140A427084708171140C090A120EC47063 -:1010500002714371C171082010BD01238270120A10 -:1010600003704170C270042070470B784A7803F017 -:1010700003010170C3F38201C3F340134170837015 -:10108000C2700220704770B5D3799579D47805EB9A -:101090000325937824041B021B192CBF012600266C -:1010A00054781B19147952794FEA046446F100060A -:1010B0001B1942EB0602C0E9003208200D8070BD0A -:1010C00053780370D078937803EB00230B800420CF -:1010D000704770B50C4603464A7814F8040B00EBD1 -:1010E0000220C0F30B021A80C0F301329A70C0F3E1 -:1010F0008032DA70CE788D7880F4805005EB06254A -:10110000C5F30B059D80C0F30035C00424D50AB398 -:101110008A794879120402EB0022087901F1080467 -:101120000244C87902EB00620C209A606178227850 -:10113000043402EB01229A8114F8011C14F8022CE9 -:1011400002EB0122C2F30B01C2F38132D9811A747E -:101150005C6170BD0820E8E704209D60DD811D749E -:10116000F6E78B78CA781B03920302F4804203F4FB -:10117000405313430A8830B5C2F30B021343037084 -:101180001B0A43708B7813F0FD0F29D1CB78D3B9AC -:101190000422041D8B8923708B891B0A6370CB8901 -:1011A0000D7CC3F30B0343EA85331BB2A370C3F377 -:1011B0000723E3708B88134483708B8813441B12BE -:1011C000C370101D30BD8B68082203718B6800F15D -:1011D00008041B0A43714B898371CB7AC371D9E729 -:1011E0000022E7E74A780B7843EA420303700A7863 -:1011F0008B7852B9033343704B6883704B681B0A7A -:10120000C370CB880371052070474370022070477C -:101210000B7803F00102C3F34003027043704B7874 -:1012200083704AB9CA788B7803EB02230A7903EBFF -:101230000243436005207047022070474A790B78CB -:1012400043EA02234A78920002F0040213438A78A8 -:10125000D20002F008021343CA78120102F0100211 -:1012600013430A79920102F0400213431BB2037048 -:10127000C3F307234370022070470B784A7803F0CA -:1012800003010170C3F380014170C3F3C001817099 -:10129000C3F30011C3F38013C170037142710220C4 -:1012A0007047000038B50B4D0B4A95F824300446C2 -:1012B00003EB8303034452F8233003B1984795F8B6 -:1012C0002430064A03EB830313441B5D85F8243066 -:1012D00038BD00BF580D00214C4F03019C4F030146 -:1012E00038B50378074A01EB830352F823300446EC -:1012F0000D4603B198472278034B03EB82035B5DF5 -:10130000237038BD2850030168500301062238B508 -:10131000084D04462B7802FB0303074A52F823309A -:1013200003B1984706212A78044B01FB02331B5D69 -:101330002B7038BDC0360021B04F0301105003019F -:10134000062238B5084D04462B7802FB0303074AF2 -:1013500052F8233003B1984706212A78044B01FB49 -:1013600002331B5D2B7038BDE8360021DC500301D1 -:101370001050030138B54378084A03EB83030B444C -:1013800052F8233004460D4603B198476378044A67 -:1013900003EB830313445B5D637038BD7850030136 -:1013A000C850030138B50B4D0B4A95F82730044659 -:1013B00003EB8303034452F8233003B1984795F8B5 -:1013C0002730064A03EB830313441B5D85F827305F -:1013D00038BD00BF683700213C5103018C51030127 -:1013E00070B506268278084B06FB021253F82230AD -:1013F00004460D4603B19847A278044B06FB02331E -:101400005B5DA37070BD00BFBC5103011C520301A2 -:1014100038B590F88831094A01EB830352F823303C -:1014200004460D4603B1984794F88821044B03EB1A -:1014300082035B5D84F8883138BD00BF34520301FC -:1014400074520301032970B504460AD8012994BFD8 -:101450000026012605291DD8DFE801F0081D081D1A -:10146000081D0B1F012B15D80226F3E700250B4B97 -:1014700005EB460253F822300BB12046984768200E -:1014800000FB0644064B94F8502003EB42035B5DDF -:1014900084F8503070BD0125E9E700BFA051030179 -:1014A000B851030138B54378074A01EBC30352F83A -:1014B000233004460D4603B198476278034B03EB93 -:1014C000C2035B5D637038BD845203012453030182 -:1014D00038B54378084A03EB83030B4452F82330B2 -:1014E00004460D4603B198476378044A03EB83032F -:1014F00013445B5D637038BD4C5303019C5303017F -:10150000062970B505460C4608D859B14B1E052B67 -:1015100008D8DFE803F00D0D07070D21172902D0C9 -:10152000472915D070BD0123C376E6F735FD0324A6 -:10153000AE78012E18D0022E27D0002EF2D1012C29 -:101540000DD0022CEED12846E6F786FDAE70E9E715 -:10155000E6F72DFD0424EBE7E6F738FDFAE7284629 -:10156000E6F738FDAC70DDE7042C09D0052C0ED071 -:10157000032CD7D12846E6F795FD0223AB70D1E7BF -:101580002846E6F703FE0023F8E7052CCAD12846D3 -:10159000E6F7A8FDF7E70000F0B543780446022B14 -:1015A0000D468BB050D0032B78D0002B55D13F295E -:1015B00053D1FAF7AFFF2046E7F79CFEA368D9079F -:1015C00003D56621204600F09FFDA368DA0503D508 -:1015D0006721204600F098FDA3685B060CD5B4F89F -:1015E0004A331B2B04D8B4F84C33B3F5A47F03D98A -:1015F0006821204600F088FD3349344B086834499F -:10160000201AC0101A684843B4F8A21492F83C306B -:10161000099194F8A0140832089194F8451280B208 -:10162000079100210691D2E91467CDE90467D2E958 -:101630001267CDE90267D2E91067CDE90067E7F7E5 -:10164000EDFB022363701FE03F291DD018D83D2910 -:1016500021D02946204601F023FA4C2D2CD04D2DC7 -:1016600012D1194B18681A4B201AC0105843C0B237 -:101670000BF0F4F820460BB0BDE8F040F9F7F6BCEB -:10168000A1F14703012BE4D8294620460BB0BDE861 -:10169000F04000F02BB8E8F7C1FAF5E75129DCD1AA -:1016A000D0F8883323F00103C0F88833E7F725FE2C -:1016B000002384F87633E7E72046E8F75BFA204614 -:1016C000E7F7CAFDCDE700BFB43A0021B03A0021E8 -:1016D000BDCAE28C0322437842700022022B80F8BC -:1016E000762302D114300BF073BE7047482910B531 -:1016F000044610D003D8A9B147290FD010BD4C29FA -:10170000FCD1E8F737FA2046E7F7A6FD2046BDE80A -:101710001040F9F7ABBCE7F7FFFD2046BDE81040ED -:10172000FFF7D8BFE7F7EFFDF7E70000F0B5437824 -:1017300004460D468BB0032B0FD8DFE813F01500DD -:101740008D00040021013D2907D0A5F14703012B9D -:1017500003D92946204601F0EDFB294620460BB06F -:10176000BDE8F040FFF7C2BF0B29F6D1FBF72AF81E -:101770002046E7F7BFFDA36813F4007F03F4007170 -:1017800003F0010248D02AB1D4F88C2342F00802B9 -:10179000C4F88C23D80542BFD4F88C2342F004024D -:1017A000C4F88C2359060ED5B4F84A331B2B04D841 -:1017B000B4F84C33B3F5A47F05D9D4F88C3343F097 -:1017C0001003C4F88C330123754963700868754BA6 -:1017D0007549201AC0101A684843B4F8A21492F848 -:1017E0003C30099194F8A0140832089194F84512FD -:1017F00080B2079100210691D2E91467CDE9046710 -:10180000D2E91267CDE902670121D2E91067CDE97B -:101810000067E7F703FBA0E752EA010303D0662164 -:10182000204600F071FCA368DA0503D56721204645 -:1018300000F06AFCA3685B060CD5B4F84A331B2B96 -:1018400004D8B4F84C33B3F5A47F03D968212046FB -:1018500000F05AFC0223B7E7232929D814297FF680 -:1018600078AFA1F115030E2B3FF673AF01A252F82A -:1018700023F000BFCD1802015317020153170201D4 -:10188000531702015317020153170201E71802010F -:10189000FD18020153170201531702011319020127 -:1018A0003F190201551902016B19020129190201A0 -:1018B000402905D03FF649AF3D293FF44EAF48E7F8 -:1018C000022370214370F9F7CBFD46E7D0F88C3343 -:1018D00043F40063C0F88C33D0F8883343F40063DA -:1018E000C4F8883339E7D0F88C3343F00403C0F8E8 -:1018F0008C33D0F8883343F00403F1E7D0F88C330D -:1019000043F00803C0F88C33D0F8883343F0080361 -:10191000E6E7D0F88C3343F01003C0F88C33D0F8EE -:10192000883343F01003DBE7D0F88C3343F08003B7 -:10193000C0F88C33D0F8883343F08003D0E7D0F878 -:101940008C3343F40043C0F88C33D0F8883343F42D -:101950000043C5E7D0F88C3343F02003C0F88C3344 -:10196000D0F8883343F02003BAE7D0F88C3343F043 -:101970004003C0F88C33D0F8883343F04003AFE71E -:1019800051297FF4EAAED0F8883323F00103C0F880 -:101990008833E7F7B2FC002384F87633DDE600BF36 -:1019A000B43A0021B03A0021BDCAE28C38B50A4DE4 -:1019B0000A4A95F82430044600EB830352F823309A -:1019C00003B1984795F82420054B03EB82031B5D78 -:1019D00085F8243038BD00BFD03A0021B053030150 -:1019E000F053030138B50378074A01EB830352F83B -:1019F000233004460D4603B198472278034B03EB8E -:101A000082035B5D237038BD005403014054030121 -:101A100038B50B79154603EB83031344064A0C468D -:101A200052F8233003B198472379044A03EB830328 -:101A300013445B5D237138BD505403017854030196 -:101A4000172970B505460C462DD006D804291ED09E -:101A50000C290ED00024204670BD7029FAD1D0F890 -:101A60008C3319032DD523F400230224C0F88C33C2 -:101A70000DE04B4B1A7A222AECD1597C187CF6F7F0 -:101A80008FFD0028E6D001240389A5F82C34B5F891 -:101A90002C04F6F769FD95F876330646CBB1012B99 -:101AA00026D00124D7E73F4C2368D888F6F75CFDA1 -:101AB0000028CFD023680024DA88A5F82C24DC8005 -:101AC000E5E7DA02C6D523F480130324C0F88C338B -:101AD000DDE7014622462846FFF79AFF3379002BBF -:101AE000DFD00124132385F8764385F88533B2E7E8 -:101AF000012C15D195F88533042B0FD8012B0FD964 -:101B00000121D5F88C2301FA03F31343C5F88C3374 -:101B1000132385F8811385F8853301E0072BEFD077 -:101B200095F88523132A14D1224631462846FFF71B -:101B30006FFF3479002CB4D128463146F7F7FBF912 -:101B4000FF23284685F8764385F88533E7F7B0FF0D -:101B5000A7E7C4B1012CA4D10F2A04D849F6020387 -:101B6000D340DB0709D43046E6F710FAD5F88C33BA -:101B700043F48013C5F88C336DE722462A212846AA -:101B8000E7F7DCFE67E7D5F8883343F40023C5F8B0 -:101B90008833D5F88C3343F40023C5F88C3380E7C1 -:101BA000283A0021B03A002138B5CB781546C3EB6E -:101BB000C3031344064A0C4652F8233003B1984736 -:101BC000E378044AC3EBC30313445B5DE37038BDA1 -:101BD00084540301D854030101222321E7F7AEBE48 -:101BE0004B29F8B5044647D008D8242926D0272900 -:101BF0002BD00C290AD000252846F8BD6E292BD001 -:101C000070292FD05229F6D103260FE0454B1A7ABE -:101C1000112A03D0202A06D0072AECD11B7C1F2BC7 -:101C2000E9D1022602E0012680F85264B4F82C04BF -:101C3000F6F79AFC074608BB0125DDE73A4B1B681F -:101C40009B88A0F82C340026F0E7374B05261B684C -:101C5000DB88A0F82C34E9E790F88533112BCAD142 -:101C60000626E3E7D0F88C3313F40035C4D023F410 -:101C70000033C0F88C33E6E70426D7E794F87653B0 -:101C8000D5B1012DD8D194F88533112B3BD13246F3 -:101C900001462046FFF788FFFE78002ECCD1204673 -:101CA0003946F7F748F9FF23204684F8766384F82D -:101CB0008533E7F7FDFE9FE71C4B9B695B0102D470 -:101CC00094F8223373B1324639462046FFF76CFF51 -:101CD000FB78002BB0D00125112384F8765384F8CB -:101CE000853389E7D4F88833672143F40033C4F897 -:101CF0008833D4F88C33204643F40033C4F88C3353 -:101D000000F002FA98E7002E96D1D4F8883343F415 -:101D10000033C4F88833D4F88C3343F40033C4F868 -:101D20008C3369E7283A0021B03A00212050002185 -:101D300038B5CB781546C3EBC3031344074A0C46AA -:101D400052F8233003B19847237833B1E378044A3B -:101D5000C3EBC30313445B5DE37038BDF054030170 -:101D60006055030110B5044600F5FA700CF011F847 -:101D70002046BDE8104001222321E7F7DFBD000027 -:101D80005229F8B504466BD008D825296ED02629EB -:101D90006AD00C2911D000252846F8BD6E2959D0EB -:101DA0007029F8D1D0F88C3313F48025F4D023F4C3 -:101DB00080230126C0F88C3340E05C4D2B7A1F2B2A -:101DC00008D0212B54D0112BE5D12B7C202BE2D134 -:101DD000052633E0287CF6F799FC48B9287CF6F70D -:101DE00051FC48B9012243212046E7F7A7FDD2E77D -:101DF00090F88030002BF5D1F6F770FB0028F1D079 -:101E00004B4B4C4A1B680026E31ADB10534301225C -:101E10009BB2C38082720289A4F8F83145F2012393 -:101E2000A4F82C24444A4549C4F83C24444AA4F864 -:101E3000FA311160434A127B84F80022B4F82C0472 -:101E4000F6F792FB94F8765307469DB1012D20D00A -:101E50000125A1E790F88533112B9CD10626EDE7EB -:101E60001022394B1B681A710326E7E70226E5E7C3 -:101E70000426E3E7014632462046FFF759FFFB7888 -:101E8000002BE5D00125112384F8765384F885339F -:101E900082E7AEB994F88533042B0FD8012B0FD904 -:101EA0000121D4F88C2301FA03F31343C4F88C33D3 -:101EB000112384F8811384F8853301E0072BEFD0D8 -:101EC00094F88523112A17D1324639462046FFF768 -:101ED0002FFF3B7813B1FB78002BB9D12046394650 -:101EE000F7F729F8002384F87633FF23204684F897 -:101EF0008533E7F7DDFD4FE7002EA9D10F2A04D87F -:101F000049F60203D340DB070AD439462046E6F7F8 -:101F1000FFFDD4F88C3343F48023C4F88C333BE7C3 -:101F200001222A212046E7F709FD35E7283A00215A -:101F3000B43A0021BDCAE28C658E0101058F010112 -:101F4000143A002168500021B03A0021044B01EB03 -:101F50008101114453F8213003B11847704700BF85 -:101F6000A855030101390346082945D8DFE801F0E7 -:101F70001E0F05192732383D3D00022A0CBF93F889 -:101F8000190393F81A03B0FA80F040097047987863 -:101F9000012831D1002A30D1D3F83003C0F3C0007A -:101FA0007047D3F83003C0F3401070479B78012B83 -:101FB00003D1101E18BF01207047101FFAE799784F -:101FC0000029F6D0042A15D0B2B9B3F8320300F0D4 -:101FD00001007047002AF0D1084B93F82B00F6E778 -:101FE000D3F83003C0F380607047D3F83403C0F3F4 -:101FF000C01070470020704701207047205000211A -:102000001FB5144B144A1B688DF80310C31ADB105C -:1020100053430022CDE9012203920A229BB2ADF87C -:102020000630ADF800300D4B8DF804101B688DF8AC -:1020300002201B79082B0AD8D0E9CC2302A80BF088 -:1020400018FB684609F0C4FD05B05DF804FBD0E953 -:10205000CA23F3E7B43A0021BDCAE28CDC4D00216B -:102060000B460121D0F888239940114210D022EA72 -:1020700001021549C0F888230A7A0D2A09D0112ACD -:1020800007D0072A07D01A21022B0BD0072B19D013 -:102090007047497CF8E7042B06D0072B0BD0022BA6 -:1020A000F6D11A21FFF7ACBFD0F8303323F020036C -:1020B000C0F8303370471121D0F8303323F08063FB -:1020C000C0F83033E7F706BC283A002110B40124E9 -:1020D000D0F888238C40144214D022EA0402032949 -:1020E000C0F8882307D0072908D002290AD1002187 -:1020F00010BCFFF785BF10BCE7F774B8002110BC17 -:10210000E7F7E8BB10BC70472329F8B504463BD875 -:102110000B2901D8002083E1A1F10C03172BF9D87A -:1021200001A252F823F000BFC921020115210201CA -:1021300015210201152102011521020115210201BB -:1021400015210201152102011521020115210201AB -:1021500001270201012702011521020115210201B7 -:1021600015210201012702010127020115210201A7 -:102170001521020101270201152102010127020197 -:1021800001270201012702016639CBB20A2BC1D80F -:102190000A29BFD801A353F821F000BFC1260201CC -:1021A000C1260201C126020115210201C126020138 -:1021B000C1260201C126020115210201CB22020122 -:1021C0001521020195220201CF4B1B7A013BDBB2A4 -:1021D000292B9FD8CD4AD65CFF2E9BD0CA4B1D7AA7 -:1021E0006A1E292A96D801A151F822F0D7220201AD -:1021F000BB22020115210201152102011521020154 -:1022000015210201F7220201532402015324020185 -:10221000152102011521020143240201CD220201F0 -:10222000532402011521020115210201CD220201D0 -:10223000152102011521020131240201312402017C -:102240001521020115210201152102014D2402016F -:10225000152102011521020169240201C722020190 -:10226000C7220201152102011521020115210201D7 -:10227000152102011521020115210201152102017A -:10228000152102011521020163240201C12202016C -:1022900069240201D4F89033002B0CBF01260226DA -:1022A0006378032B3FF436AFD4F8902312F0010586 -:1022B0007ED022F00102C4F8902300250BE0012615 -:1022C000092508E00026072505E0062694F8855331 -:1022D000FF2D3FF41FAF94F87633002B00F0C6803B -:1022E000012B00F01D81002D00F06481EAE0012641 -:1022F000ECE7002672E71B7C5A1E282A3FF60AAF3D -:1023000001A151F822F000BF2B240201BB220201DF -:1023100015210201152102011521020115210201D9 -:102320001521020153240201532402011521020147 -:102330001521020143240201152102015324020147 -:1023400015210201152102011521020115210201A9 -:10235000152102013124020131240201152102015B -:102360001521020115210201152102011521020189 -:102370001521020115210201D7220201D7220201F3 -:102380001521020115210201152102011521020169 -:102390002324020123240201272402011521020122 -:1023A0001521020163240201C1220201012677E7FF -:1023B000D4F88C3313F001000CD14FF0010C0CFA5F -:1023C00000F717EA0201C5B209D022EA0702C4F8F1 -:1023D000902380E723F00103C4F88C337BE70130BE -:1023E0000A28ECD1012707FA01F212EA0300CDB264 -:1023F00013D023EA0203C4F88C3394F88133012B01 -:102400007FF469AF002284F8812394F87C230AB119 -:1024100084F8763384F885535DE701310A29E2D1E7 -:10242000F8BD162557E7152555E71D4653E7012644 -:10243000042550E70026FBE701263EE700263CE79F -:102440000126032547E70026FBE70026052542E78E -:10245000012602253FE70026FBE7002601253AE793 -:102460000126082537E70026062534E7012E10D07F -:102470002AD8002E7FF437AF012303FA05F2D4F8EF -:1024800088332946134320463246C4F88833FFF781 -:102490005DFD324629462046FFF764FD002800F026 -:1024A0009080012229462046FFF750FD2046E7F79D -:1024B000E5FA84F88553012384F87C3384F8763375 -:1024C000002D7BD00120ABE7B31E022B3FF60BAFF4 -:1024D000324629462046FFF745FDD8B1022E04D0EA -:1024E000022229462046FFF731FD1422084B02FB49 -:1024F0000533DB6813B120469847F4E684F885532A -:1025000084F87E33D7E700BF283A00217C550301C9 -:10251000A855030100221A212046E7F70FFAE2E648 -:10252000072E3FF6E0AE01A353F826F04D25020139 -:102530004D250201E7220201CD2502017F2602017D -:102540000126020113260201132602013246294602 -:102550002046FFF707FDA0B33EB9012303FA05F2B9 -:10256000D4F888331343C4F8883394F88533AB42E6 -:1025700007D0012303FA05F2D4F88C331343C4F8CF -:102580008C3326B9324629462046FFF7DFFC002D62 -:1025900098D1D4F88C33012223F00103C4F88C3392 -:1025A000D4F89033294643F001032046C4F8903311 -:1025B000FFF7CCFC94F88533002B7BD103236370A9 -:1025C00080E729462046FFF74BFD8CE694F88533DB -:1025D000AB4215D0032229462046FFF7C3FC002852 -:1025E0003FF481AE022229462046FFF7AFFC0123CB -:1025F00003FA05F2D4F890331343C4F8903372E62B -:1026000094F88533AB4219D1042229462046FFF7BE -:102610009DFC072E294620462ED1FFF721FD20469E -:10262000E7F73EFAFF2384F885330023204684F839 -:102630007C3384F87633E7F73BFA54E60122D4F88A -:102640008C33AA401A423FF44EAE23EA0203C4F888 -:102650008C3394F881332946012B08BF0023204690 -:102660004FF0040208BF84F88133FFF76FFC29465E -:102670002046FFF72BFD36E6FFF728FDCFE70222C5 -:1026800029462046FFF762FC94F885330D2BAED027 -:102690001422384B02FB0533DE68002EA7D004223B -:1026A00029462046FFF75EFC00283FF433AF204662 -:1026B000B04718E6D4F89033DB073FF57FAF01E76A -:1026C000CBB20A2B3FF626AD0A293FF623AD01A374 -:1026D00053F821F041240201512402012F24020168 -:1026E0001521020139240201BF22020161240201E5 -:1026F00015210201EF22020115210201AD23020181 -:102700000B297FF607AD172B3FF604AD01A252F857 -:1027100023F000BFF322020115210201152102015D -:1027200015210201152102011521020115210201C5 -:102730001521020115210201152102015B2402016C -:102740003D2402011521020115210201152102017A -:10275000572402014724020115210201152102011B -:1027600035240201152102014B24020167240201D4 -:10277000C5220201A855030190F8850302380228FA -:102780008CBF00200120704770B50B2690F879238C -:10279000084B06FB021253F8223004460D4603B1E3 -:1027A000984794F87923044B06FB02335B5D84F869 -:1027B000793370BD70560301205703010C21E6F7F1 -:1027C000B3BB10B5012223210446E7F7B7F8002375 -:1027D00084F8523410BD10B50446E7F761F920467D -:1027E000BDE81040E7F7D2B9012310B5044680F8E0 -:1027F0007D33E7F755F92046E6F7A0FD2046BDE812 -:102800001040E7F7C3B9012310B5044680F87D33C3 -:10281000437C23F001034374E7F742F92046E6F7CF -:10282000EBFD2046BDE81040E7F7B0B9427C42F02E -:1028300001024274E6F702BE10B50446437C43F041 -:1028400001034374E6F76CFD2046BDE81040E6F74F -:10285000F5BDD0F8883310B513F4006304460ED1EB -:10286000C0F8883394F87D3383B10023204684F880 -:102870007D330122BDE810403B21E7F75FB800231C -:102880003B21C0F88833E6F74FFBEBE710BD10B5EE -:1028900004461822002100F56B7011F03EFAD4F8BE -:1028A00030339B0707D52046E6F7B2FD2046BDE84A -:1028B0001040E7F7E3B82046BDE810407121F8F773 -:1028C000CFBD10B50446D0F8883343F40063C0F898 -:1028D0008833E6F703FB2046BDE81040FFF7D7BF7B -:1028E000722970B5044608D86D2908D81D296CD006 -:1028F00016D80C2918D0152969D0002539E06E3971 -:102900000429FAD801A353F821F000BF9D29020140 -:10291000FB280201A92902018B290201D329020106 -:102920001E29EAD102211EE05C4B197ACA1F0A2A2D -:10293000E3D801A050F822F077290201FB28020118 -:10294000FB280201FB280201FB280201FB280201EF -:102950008B290201FB28020165290201D729020106 -:1029600097290201032194F87653B5B3012D44D081 -:102970000125284670BD1B7C0F2BBED1D4F8303307 -:1029800023F00203C4F83033EDE794F885330B2BC2 -:10299000B3D10721E7E71B7C0F2BF9E790F88533CC -:1029A0000B2BAAD10621DEE7D0F88C330025B3F536 -:1029B000006F03D10821C0F88C53D4E7B3F5805FD2 -:1029C000D7D10921C0F88C53CDE70121CBE70021F5 -:1029D000C9E70A21C7E70421C5E72046FFF7D4FE6F -:1029E00094F87933002BC3D001230B2284F876337B -:1029F00084F8852384F87E53BAE7032915D194F827 -:102A00008533042B0FD8012B0FD90120D4F88C2348 -:102A100000FA03F31343C4F88C330B2384F88103C7 -:102A200084F8853301E0072BEFD094F885330B2B26 -:102A300016D12046FFF7A8FE94F87963002E97D1AF -:102A40002046E7F72DF8637C204623F001036374EA -:102A5000FF2384F8766384F88533E7F729F888E75D -:102A600099B1032984D10D2B09D12046E6F758FCF2 -:102A7000D4F88C3343F48053C4F88C3379E70122C3 -:102A80002A212046E6F75AFF73E72046E6F726FAA2 -:102A9000D4F88C3343F40063EEE700BF283A0021FA -:102AA0001C2970B504460D4606D190F81A331BB1A7 -:102AB000BDE87040E6F796BB2F4E3368FBB97368EC -:102AC0001BBBB368002B26D1F368002B29D13369D7 -:102AD000002B2CD17369002B2FD1B369002B32D17D -:102AE000F369002B35D1336A002B38D1736A002B80 -:102AF0003BD129462046BDE8704000F0F1B9294697 -:102B0000204698470028DAD070BD294620469847CD -:102B10000028D6D0F8E72946204698470028D3D089 -:102B2000F2E72946204698470028D0D0ECE729460E -:102B3000204698470028CDD0E6E72946204698470A -:102B40000028CAD0E0E72946204698470028C7D089 -:102B5000DAE72946204698470028C4D0D4E729461A -:102B6000204698470028C1D0CEE7294620469847FE -:102B70000028BED0C8E700BFC04B002138B590F890 -:102B80007933094A01EBC30352F8233004460D465A -:102B900003B1984794F87923044B03EBC2035B5DC0 -:102BA00084F8793338BD00BF4C570301CC5703017B -:102BB00001222321E6F7C2BE10B50446437C012260 -:102BC00023F001034374054B1B681979E6F7B6FE41 -:102BD0002046BDE81040E6F763BF00BFB03A0021D1 -:102BE000D0F88823110506D522F400620021C0F830 -:102BF0008823E6F799B97047014B597CE6F794B9F9 -:102C0000283A00210C21E6F78FB910B50446437C21 -:102C100023F001034374E6F707FC2046BDE81040AB -:102C2000E6F72CBF10B50446E6F73AFF2046BDE8AC -:102C30001040E6F75FB910B50446E6F771FB637C18 -:102C4000204643F001036374BDE81040E6F7F6BB8D -:102C5000FFF7F1BF0322437842700022022B80F875 -:102C6000762302D114300AF0B3BB7047D0F8882322 -:102C7000094922F40062C0F888230A7A03460D2A23 -:102C800005D0112A03D0072A05D11A2101E01846E0 -:102C9000497CE6F749B97047283A0021D0F830332B -:102CA00010B59B07044606D5E6F7B2FB2046BDE803 -:102CB0001040E6F7E3BE1A21E6F736F92046BDE8F4 -:102CC00010406E21F8F7CCBB10B50446D0F888331D -:102CD00043F40063C0F88833E6F700F92046BDE806 -:102CE0001040FFF7DBBF00001E2970B504465DD021 -:102CF00007D815295CD01D295CD00C2909D00025E6 -:102D000005E06E293DD070294FF000053FD02846E0 -:102D100070BD724A137A002B4ED0073BD9B20A29F4 -:102D2000EDD80A2BEBD801A151F823F0592D02015F -:102D3000FF2C0201FF2C0201FF2C0201FF2C0201DB -:102D4000FF2C02016F2D0201FF2C0201BD2D02019B -:102D5000FF2C0201792D0201137C0F2BCFD1D0F86B -:102D6000303323F00203C0F83033052617E090F823 -:102D700085330B2BC3D1F8E7137C0F3B012BBED857 -:102D8000F3E790F885330B2BB9D1062607E0D0F88E -:102D90008C33B3F5006FBAD10726C0F88C5394F882 -:102DA00076536DB1012D1CD00125B0E70326F6E75F -:102DB0000026F4E70226F2E70426F0E70126EEE714 -:102DC00031462046FFF7DAFE94F87933002BEBD03A -:102DD00001230B2284F8763384F8852384F87E530C -:102DE000E2E7012E01D0042E17D194F88533072B8A -:102DF00003D010D89A1E022A0FD80121D4F88C23B0 -:102E000001FA03F31343C4F88C330B2384F88113C2 -:102E100084F8853301E00F2B1BD094F885330B2BFE -:102E200021D131462046FFF7A9FE94F87963002EA0 -:102E3000BAD12046E6F734FE637C204623F0010336 -:102E40006374FF2384F8766384F88533E6F730FEF5 -:102E50005DE7D4F88C3343F40043C4F88C330B2380 -:102E600084F88533D9E7052E9ED801A353F826F0C0 -:102E7000A32E0201952E0201A92D0201A92D020106 -:102E8000892E0201B72E020100222A212046E6F7F0 -:102E900055FD3CE701222A212046E6F74FFD354645 -:102EA00035E72046E6F71AF8D4F88C3343F400638C -:102EB000C4F88C332BE7D4F88C3323F40063C4F8C4 -:102EC0008C3394F8793313B1002384F87933034BAE -:102ED0002046597CE6F728F819E700BF283A002178 -:102EE0004A2910B504461FD006D80E290FD049290B -:102EF00013D00D2907D010BD512918D07329FAD14C -:102F0000E6F7FEF90BE0BDE81040E6F703BD00224E -:102F1000BDE810401E21E6F711BDE6F7F7F920469F -:102F2000BDE81040FFF796BEE6F7F3F9F7E7E6F7DE -:102F3000E4F9F4E71C2970B504460D4606D190F873 -:102F40001A331BB1BDE87040E6F74CB92F4E336819 -:102F5000FBB973681BBBB368002B26D1F368002B49 -:102F600029D13369002B2CD17369002B2FD1B36980 -:102F7000002B32D1F369002B35D1336A002B38D1C5 -:102F8000736A002B3BD129462046BDE87040FFF70D -:102F9000A7BF2946204698470028DAD070BD2946A9 -:102FA000204698470028D6D0F8E72946204698477B -:102FB0000028D3D0F2E72946204698470028D0D0F1 -:102FC000ECE72946204698470028CDD0E6E7294679 -:102FD000204698470028CAD0E0E72946204698476F -:102FE0000028C7D0DAE72946204698470028C4D0F1 -:102FF000D4E72946204698470028C1D0CEE7294685 -:10300000204698470028BED0C8E700BFE84B002103 -:1030100090F885330B2B05D190F87903831E584225 -:10302000584170470020704790F88503A0F11603BF -:1030300058425841704790F87903C31E584258418E -:10304000704710B50446E7F7D2FA2046E7F7EAFAE8 -:103050002046E6F76FFD2046E7F7A8FB2046E7F796 -:1030600093FC2046BDE81040E6F708BD10B50446C5 -:10307000E7F7BDFA2046E7F7D5FA2046E7F784FCE4 -:103080002046BDE81040E6F7F9BC10B50446E7F766 -:103090007EFB2046BDE81040E6F7F0BC10B50446C4 -:1030A000E6F709FD2046E6F737FD012384F80B33E8 -:1030B00010BD10B50446E6F7FEFC2046BDE8104002 -:1030C000E6F72ABD10B50446E6F7EAFC2046E6F727 -:1030D000F7FC2046E6F732FD94F80B13204629B1A1 -:1030E000E7F7DEFB002384F80B3310BDE7F7B2FBF4 -:1030F000F8E7000010B50446E6F7D2FC2046E6F7F4 -:10310000DFFC2046E6F71AFD064B20461A7A072A0E -:1031100014BF597C1A21E7F79DFB002384F80B3379 -:1031200010BD00BF283A00210C21E7F793BB10B572 -:103130000446E7F745FA2046E7F75DFA2046E7F749 -:1031400017FB2046BDE81040E6F798BC10B50446D2 -:10315000E6F7A6FC2046E7F707FC2046E7F7A2FAC9 -:103160002046E6F7E7FC2046BDE81040E6F786BCBF -:1031700038B590F877330A4AC3EBC3030B4452F8CF -:10318000233004460D4603B1984794F87733054A37 -:10319000C3EBC30313445B5D84F8773338BD00BFD2 -:1031A000EC570301CC58030170B590F897420546DF -:1031B000012C0E461CD10C2907D0A1F10D03012BC7 -:1031C00016D8E7F7A7FA204670BD554B1B7A023B8D -:1031D0000F2B09D8DFE803F00C080C0C0C0C0808C6 -:1031E000080C080C0808080CE7F794FA0024EAE732 -:1031F00095F876332BB1012B08D195F885330D2B3B -:1032000004D0182E02D12846E7F786FB454B9C6A6E -:1032100014F00104D7D03E2E47D005D80C2E0FD085 -:10322000182EE3D1002130E0702EDFD1D5F88C3399 -:1032300013F40054C7D023F40053C5F88C33F1E7DE -:10324000374A137A043B0D2BD0D801A151F823F053 -:10325000BB320201B732020189320201A5320201FA -:10326000ED310201ED310201ED310201BF32020107 -:10327000ED31020199320201ED310201ED3102011D -:10328000ED310201A5320201032195F87643C4B164 -:10329000012C26D0012496E795F885330D2BA5D176 -:1032A0000621F2E7137C032BF9E795F885330D2B04 -:1032B0009CD10521E9E70221E7E70121E5E70421A7 -:1032C000E3E72846FFF754FF95F87733002BE1D06A -:1032D000052BDFD00D23012485F8853385F876434F -:1032E00071E795F885330D2B06D0D5F88C3343F470 -:1032F0000053C5F88C3366E72846FFF739FF95F889 -:103300007733052B01D0002BC4D1FF2385F88533FB -:103310000023284685F87633E6F7CAFB53E700BF5B -:10332000283A00212050002190F87703C31E58420C -:103330005841704738B590F877330A4AC3EBC30356 -:103340000B4452F8233004460D4603B1984794F8D5 -:103350007733054AC3EBC30313445B5D84F87733CB -:1033600038BD00BF04590301C859030110B5044614 -:10337000E7F71CFA2046BDE81040E6F77FBB10B522 -:103380000446E7F74FF92046E6F795FB2046E6F7B7 -:10339000D1FB2046E6F7C0FB012384F80B3310BDB8 -:1033A00010B50446E6F787FB2046E6F7C3FB204648 -:1033B000BDE81040E6F7B0BB10B50446E6F770FB79 -:1033C0002046E7F7FDF82046E7F7D2F92046E6F772 -:1033D00077FB2046E6F7B2FB94F80B13204629B1A1 -:1033E000E7F75EFA002384F80B3310BDE7F732FAF3 -:1033F000F8E710B50446437C23F002034374E6F774 -:103400004FFB94F80B236AB906212046E6F796FA9B -:103410002046E6F755FB2046E6F790FB002384F8AC -:103420000B3310BD2046E7F739F96A212046FEF735 -:103430006BFEEDE710B50446437C23F002034374B2 -:10344000E7F71CF92046E7F72DF92046E7F7D3F810 -:103450002046E7F77EF92046BDE81040E6F70EBBB0 -:1034600010B50446E7F7C3F82046E7F7DBF8204637 -:10347000E7F7DCF82046E7F750F92046E6F7FEFAD2 -:10348000637C204643F002036374BDE81040E7F715 -:10349000BBB9000010B590F87833044613B1012B86 -:1034A00020D010BD0429FCD801A353F821F000BF9F -:1034B000C5340201F1340201A3340201C534020112 -:1034C000D7340201E7F781F92046E6F7D7FA01235E -:1034D00084F87833E5E7E7F7FFF92046BDE81040C8 -:1034E000E7F714BA022908D004290AD00129D8D153 -:1034F0002046BDE81040E7F777B9E6F7D1FA002398 -:10350000E6E7BDE81040E7F7E7B900BF70B590F80F -:1035100097520446012D1CD10C2907D0A1F10D03AF -:10352000012B16D8E7F7F6F8284670BD574B1B7AE3 -:10353000023B0F2B09D8DFE803F00C0C08080C083D -:1035400008080C0C080C0808080CE7F7E3F800253D -:10355000EAE74F4B9D6A15F00105E5D01A2935D0F1 -:1035600005D80C290BD01929F1D1042623E03E29D6 -:10357000EDD194F885330D2BE9D106261BE0434BA2 -:103580001B7A033B082BE2D801A252F823F000BFBC -:10359000C93502014F3502014F350201C53502011F -:1035A0004F3502014F3502014F350201B535020199 -:1035B000D1350201022694F876535DB1012D19D060 -:1035C0000125B1E70126F6E70026F4E70526F2E734 -:1035D0000326F0E731462046FFF7ACFE94F8773338 -:1035E00013F0FB0FECD00D23012584F8853384F80C -:1035F000765399E716F0050F10D12046FFF708FD26 -:10360000B8B1012394F8852303FA02F2D4F88C337D -:103610001343C4F88C330D2384F8853394F8853331 -:103620000D2B19D0D4F88C3343F40053C4F88C33E9 -:103630007AE72046FFF7A0F80028E2D1154B1B6877 -:10364000002BDED0204698470028DAD12046FFF72D -:10365000EBFC0028D5D1E1E731462046FFF76AFEB2 -:1036600094F8773313F0FB03AAD1627C84F87633A5 -:1036700022F002026274FF2294F8973284F88523C4 -:10368000002B9DD12046E6F713FA4DE7283A00219A -:1036900020500021A83A002138B5304B05469B6ADE -:1036A00003F01004DB061AD5542927D005D80C29BD -:1036B00017D0532924D0002411E07029FBD1D0F871 -:1036C0008C3313F480440AD0002123F48043C0F8E3 -:1036D0008C3395F87643BCB1012C23D001242046CD -:1036E00038BD1F4A137A122B0CD0132B04D0072B92 -:1036F000E1D1137C122BDED10221EAE70421E8E7B5 -:103700000321E6E70121E4E72846FFF7C3FE95F829 -:103710007833002BE2D00E23012485F8853385F819 -:103720007643DCE795F885330E2B06D0D5F88C333D -:1037300043F48043C5F88C33D1E72846FFF7AAFE4F -:1037400095F87833002BC9D1FF22284685F88523C8 -:1037500085F87633E6F7ACF9C1E700BF20500021C9 -:10376000283A002190F87703C31E58425841704709 -:1037700038B590F87B33094A01EBC30352F8233084 -:1037800004460D4603B1984794F87B23044B03EBA2 -:10379000C2035B5D84F87B3338BD00BFFC59030175 -:1037A0009C5A030101222321E6F7C8B80C21E7F750 -:1037B000FFBB10B50446E7F727FB2046BDE81040E5 -:1037C00000F020BA10B50446D0F8883343F4004323 -:1037D000C0F88833E7F706FB2046BDE8104000F04C -:1037E00011BA2DE9F0419DF81880044648EA03001B -:1037F0001E4601EA080502EA030700F074FA864251 -:1038000004D1B04502D1B8F1000F02D1A3681B0664 -:1038100001D53D402F46284600F065FA054638465A -:1038200000F061FA94F854300646022B03D0032BC3 -:1038300014BF012304239D4208BF002594F855308E -:10384000022B03D0032B14BF012304239E4208BF85 -:103850000026294632462046E7F746FB65B91EB9E1 -:103860006E212046F7F7FCFD2046F8F756FA204671 -:10387000BDE8F041E6F724B929462046F8F74AFAB0 -:10388000F5E773B590F862330446DA0790F864639D -:1038900018D490F8635394F862339B0702D5EFF77E -:1038A000E3FB064694F8D933204600933246294676 -:1038B00094F8D833FFF795FF204602B0BDE870407A -:1038C000E6F7EEB8EFF7D0FB0546E4E713B504469C -:1038D000074B5A7C009290F8D92390F8D8131B7CA0 -:1038E000FFF77FFF204602B0BDE81040E6F7D8B8EA -:1038F000283A00213E2970B5044649D005D80C2944 -:1039000011D0202959D0002537E06E2946D07029E2 -:10391000F9D1D0F88C331A0446D523F4004305219D -:10392000C0F88C3323E0594A137A072B2DD00D3B76 -:10393000D9B20A29E7D80A2BE5D801A151F823F01A -:103940007F390201073902010739020107390201F3 -:103950008B390201073902010739020107390201D7 -:10396000073902016D390201BF390201022194F8C1 -:10397000765335B3012D34D00125284670BD90F81B -:1039800085330F2BBFD10321F1E7137C162BF9E709 -:1039900090F885330F2BB6D10721E8E790F88533EF -:1039A0000F2BB0D10421E2E713F48035E5D023F4E6 -:1039B00080330621C0F88C33D9E70021D7E70121F5 -:1039C000D5E72046FFF7D4FE94F87B33002BD3D005 -:1039D00001230F2284F8763384F8852384F87E53FC -:1039E000CAE7022915D194F88533042B0FD8012B8F -:1039F0000FD90120D4F88C2300FA03F31343C4F841 -:103A00008C330F2384F8810384F8853301E0072B7E -:103A1000EFD094F885330F2B12D12046FFF7A8FE84 -:103A200094F87B63002EA7D12046E6F739F8FF23F0 -:103A3000204684F8766384F88533E6F739F89CE706 -:103A4000B1B1022998D1012B02D00B3B012B05D833 -:103A500001222A212046E5F771FF8EE72046E7F78D -:103A6000D3F9D4F88C3343F48033C4F88C3384E72F -:103A70002046E7F7B7F9D4F8883343F40043C4F895 -:103A80008833D4F88C3343F40043EEE7283A00211E -:103A9000022803D0032814BF01200420704700002F -:103AA00038B590F87B330C4AC3EBC3030B4452F890 -:103AB000233004460D4603B1984794F87B33074AF8 -:103AC000C3EBC30313445B5D5A1F84F87B3353423B -:103AD000534184F8843338BDC45A03016C5B03013D -:103AE0000C21E7F765BA0000F8B50446F8F715F9B8 -:103AF000D4F888331A0440F1818023F40043002174 -:103B00002046C4F88833E7F753FA94F85410B4F811 -:103B10004E730229B4F85003B4F85223B4F8545346 -:103B200033D8C1BB002694F85520022A41D8002A78 -:103B300045D10023032AA4F854634FD1B3F5296F6C -:103B400038BF4FF42963A4F85803A4F8503303296D -:103B500032464BD1B6F5296F38BF4FF42962A4F82D -:103B60005C53A4F85423264B9B6A9B0646D5B4F8B5 -:103B70005433AB4203D1B4F8503383423ED0204695 -:103B8000BDE8F8400021E5F7DDBC0329CAD1920168 -:103B900002F5747204E0B4F85C6336B90E32D200F8 -:103BA000AA42A8BF2A4696B2BDE70023A4F85C3318 -:103BB000B9E7032ABDD1BB0103F5747305E0B4F87E -:103BC00058333BB907F10E03DB008342A8BF03461D -:103BD0009BB2AFE70027A4F85873ABE7B3F5A47F17 -:103BE00038BF4FF4A473A4F85033B0E7B6F5A47F00 -:103BF00038BF4FF4A472A4F85423B4E7F8BD00BF53 -:103C00002050002110B50446E5F755FF2046BDE8D9 -:103C10001040E5F781BF000010B50446E5F740FF0E -:103C2000064B1B8A2BB92046BDE810406E21F7F7E2 -:103C300017BC2046BDE81040E7F7EEB8283A00214F -:103C400010B50446E7F7E0F82046BDE81040FFF75E -:103C5000D9BFFFF7F5BF10B50446D0F8883343F459 -:103C60000043C0F88833E7F7BDF82046BDE81040B0 -:103C7000FFF7C8BF10B50446E5F712FFD4F8883344 -:103C80001A0413D50A4A23F40043C4F88833137A7C -:103C90000D2B05D0112B03D0072B07D11A2100E0E3 -:103CA000517C2046BDE81040E7F782B910BD00BF47 -:103CB000283A002110B50446F8F72FF8D4F88833D5 -:103CC0001A040FD523F40043C4F8883394F89432CF -:103CD00043B16378032B05D02046BDE81040002196 -:103CE000E7F766B910BD8207034605D410F001005E -:103CF00003D103F004007047022070472DE9F0471C -:103D000011F0010F07468A4616461D469DF8208091 -:103D100093F800901DD114781AF0020F02D0EFF73B -:103D2000A3F98146BB681B060ED504EA090414F00A -:103D3000FF0412D197F85400FFF7AAFE044697F843 -:103D40005500FFF7A5FE8146347085F80090BDE868 -:103D5000F087EFF789F90446DEE714EA080008BFA8 -:103D60002046FFF7C0FF04468146EDE71FB590F8F7 -:103D70006213044601F00303032B08D1E5F7A0FE0C -:103D80006E21204604B0BDE81040F7F769BB90F8FB -:103D900063330DF10E028DF80E3090F864338DF818 -:103DA0000F30002300930DF10F03FFF7A7FF94F8E6 -:103DB0005400FFF76DFE9DF80E10884210D194F864 -:103DC0005500FFF765FE9DF80F30834208D120466D -:103DD000E5F776FE6E212046F7F742FB04B010BDF2 -:103DE0002046F7F797FF2046E5F76AFE20469DF844 -:103DF0000F209DF80E10E7F74DF82046E5F73EFE40 -:103E0000ECE71FB5044690F8633390F8D9238DF89A -:103E10000E3090F864338DF80F3090F8D83313409B -:103E200000930DF10E020DF10F0390F86213FFF7EE -:103E300065FF9DF80E102046F7F76CFF2046E5F76A -:103E40003FFE20469DF80F209DF80E10E7F739F849 -:103E50002046E5F713FE04B010BD00003E2970B502 -:103E6000044644D005D80C290BD0202954D0002575 -:103E700005E06E2941D070294FF0000543D0284657 -:103E800070BD644A137A072B2ED00D3BD9B20B2993 -:103E9000EDD80B2BEBD801A151F823F0DD3E020148 -:103EA0006F3E02016F3E02016F3E0201E93E0201D8 -:103EB0006F3E02016F3E02016F3E02016F3E020142 -:103EC000CD3E02016F3E02011D3F0201022194F826 -:103ED00076532DB3012D33D00125D0E790F88533EB -:103EE0000F2BC4D10321F2E7137C162BF9E790F8CE -:103EF00085330F2BBBD10621E9E790F885330F2BD3 -:103F0000B5D10421E3E7D0F88C33B3F5004FB6D137 -:103F10000521C0F88C53DAE70021D8E70121D6E764 -:103F20002046FFF7BDFD94F87B33002BD4D001234E -:103F30000F2284F8763384F8852384F87E53CBE708 -:103F4000022917D194F88533072B03D010D89A1E75 -:103F5000022A0FD80120D4F88C2300FA03F313436C -:103F6000C4F88C330F2384F8810384F8853301E08F -:103F70000B2B16D094F885330F2B1CD12046FFF75E -:103F80008FFD94F87B63002EA6D12046E5F788FDCF -:103F9000FF23204684F8766384F88533E5F788FDAF -:103FA0006DE7D4F88C3343F40063C4F88C330F23EB -:103FB00084F88533DEE7022913D0032917D00029BE -:103FC0008AD12046E6F70EFFD4F8883343F4004345 -:103FD000C4F88833D4F88C3343F40043C4F88C33EA -:103FE0004DE701222A212046E5F7A8FC47E7D4F84F -:103FF0008C3323F40043C4F88C3394F87B3313B12F -:10400000002384F87B33034B2046597CE6F7D0FF2E -:1040100035E700BF283A002190F885330F2B07D1F0 -:1040200090F87B03013801288CBF002001207047E5 -:104030000020704738B505460C460F20042102F0D9 -:1040400099FD58B101222B88047083701B0A4270BD -:10405000C370BDE83840023802F078BD38BD0000BA -:1040600070B586B006460D4602F00CF8044608B15D -:1040700001241EE042F21F023388934200F2C880FE -:10408000B3F5005F41D840F64942934200F03F81CA -:1040900000F2A58040F60342934200F0298100F22D -:1040A0009780002B00F0EA8040F60142934200F036 -:1040B000F680204606B070BD0520318802F09AFDDA -:1040C00005460028D4D042F21F023388934200F202 -:1040D000EE81B3F5005F00F2878141F2090293425D -:1040E00000F2EE81B3F5805F00F2C48140F64842F1 -:1040F000934200F06D8200F2C98123B140F6014283 -:10410000934240F0DD812C70DAE1A3F50053013BCE -:104110001E2BCED801A252F823F000BFBB420201F1 -:10412000B743020171420201B3400201754202012C -:10413000B3400201B3400201B3400201B3400201A7 -:10414000B3400201B3400201B3400201B340020197 -:10415000B3400201DB4102018142020187420201B8 -:1041600093420201B3400201B3400201B340020195 -:10417000B3400201B340020171420201B3400201A7 -:10418000B3400201B340020171420201194302012E -:1041900041430201C9420201A3F58053013B082BB0 -:1041A00087D801A252F823F071420201CD410201E9 -:1041B00071420201B3400201B3400201B340020167 -:1041C000B3400201B3400201BB430201412074E746 -:1041D00040F6484293427FF46CAF02206DE741F213 -:1041E000090293423FF665AFB3F5805FD4D840F63D -:1041F000634293425AD040F6824293427FF459AFD1 -:104200006B78287800EB032080B204F01DFD34E0C9 -:1042100042F25002934219D842F24A0293427FF688 -:1042200048AFA3F501530B3B052B3FF642AF01A26C -:1042300052F823F0C9420201B9400201D7420201FB -:10424000B3400201B1430201B143020142F27402E0 -:1042500093423BD042F27B02934200F08D8042F2C7 -:104260005F0293427FF425AF287806F01BFA04E042 -:10427000092022E7284604F095FC044601201CE7AB -:1042800004F050FDF9E7294611F8010B04F056FD42 -:10429000F3E7294611F8010B04F07AFDEDE7284613 -:1042A00009F0E3F9BF4BC3E90001E7E7284609F04D -:1042B000DCF9BC4BC3E90201E0E7284609F0D5F977 -:1042C000B84BC3E90401D9E70320F6E669782878FA -:1042D00004F088FDD1E7EB78A978287801EB032179 -:1042E0006B7809B200EB032000B204F0BDFDC4E717 -:1042F00002200CF0D2FC04F03BFB00200021A94B73 -:10430000C3E90001C3E90201C3E90401B0E62A7868 -:10431000A44B83F83220B1E72A7800238DF80620D9 -:104320004FF0807201250292022201A8ADF80430FC -:104330008DF807508DF80C20049306F0CBFD9CE718 -:1043400000232A78ADF804308DF806206A78ADF89D -:104350000A308DF80720AA7801258DF8082002225E -:1043600004937F238DF809508DF80C2001A88DF857 -:10437000143006F09FFC80E72B78A9798DF8063081 -:104380006B788DF80C108DF80730AB7829448DF8D8 -:104390000830EB78ADF804008DF809302B798DF8F2 -:1043A0000A306B798DF80B30EB1D0493CB79DDE788 -:1043B0000120044681E604207FE607207DE6A3F580 -:1043C00001530B3B052B7BD801A252F823F000BF11 -:1043D00095450201AD45020107410201C1440201B8 -:1043E0000741020107410201A3F50053013B1E2BC7 -:1043F00066D801A252F823F0074102016B45020181 -:1044000081450201C144020107410201C144020188 -:10441000C1440201C1440201C1440201C14402017C -:10442000C1440201C1440201C1440201C14402016C -:10443000F144020107410201074102010741020163 -:10444000C1440201C1440201C1440201C14402014C -:10445000C1440201E5440201C1440201C144020118 -:10446000C14402018B4502010741020107410201DB -:10447000DD450201A3F58053013B082B20D8DFE87E -:1044800003F03C57681F1F1F1F1F6F0040F682423A -:1044900093423FF438AE07D840F6494293423FF486 -:1044A00032AE40F663422BE640F6844228E642F202 -:1044B0005002934208D842F24A0293423FF67FAF3D -:1044C000681F02F043FBD3E542F27B0293423FF4C4 -:1044D0001AAEF5D842F25F0293423FF414AE42F2B4 -:1044E00074020DE6082100F8014B0BF0A5F9E7E78F -:1044F000047004F015FC6870E2E701AA0DF10101F7 -:104500000DF1020004F0BCFB2C709DF801206A70D4 -:10451000BDF804309DF804101B0AA970EB702A71D5 -:10452000BDF80220E9716A71120AAA712B72C7E7FD -:10453000412200210FF0F1FB2A461B4B02F8014BF0 -:1045400003F1400153F8040B8B4242F8040BF9D1FC -:10455000B6E70022602300F8014B09F08AF8AFE7C4 -:1045600000F8014B04F016FBAAE706F053F80646E4 -:1045700006F056F86E70360A2C70AE70E8709FE741 -:1045800000F8014B04F092FB9AE700F8014B04F0AD -:1045900085FB95E72946681C01F8024B04F060FC96 -:1045A0008EE700BF404C00218D4D002101A90DF187 -:1045B000020004F057FC2C70BDF802306B709DF9BE -:1045C0000330AB70BDF90430EB701B122B7177E731 -:1045D0000A4B047093F83230437071E7002301A84E -:1045E000CDE9013306F00EFD2870BDF806306B7082 -:1045F000BDF806301B0AAB7062E700BF404C0021DB -:1046000073B505460C4601F037FF08B1012008E0FC -:1046100042F20B032E889E4205D042F20C039E42CA -:1046200028D002B070BD2378A2788DF8043063786A -:10463000684603EB0223ADF800302279E37803EB00 -:104640000223ADF8023063798DF80530A3798DF837 -:10465000063004F04DFC29880446012002F0CAFA15 -:104660000028D3D02B880538B34208BF447102F02C -:104670006DFACBE76178207804F08CFCC6E7000087 -:104680002DE9F04186B006460D4601F030FF0446A4 -:1046900020B10124204606B0BDE8F0813388A3F59F -:1046A0000153013B092BF5D801A252F823F000BFBA -:1046B000D946020171470201954602018F47020166 -:1046C000F5470201FB4702010B48020125480201A0 -:1046D0003F48020145480201002428786978AA78F9 -:1046E000EB1C4FF0060E25468DF800008DF80110EA -:1046F0008DF8022042FA05F7FF0718D506AF0EFB2A -:10470000047793F800C093F8028007F810CC93F870 -:1047100001C001340CEB082C27F814CC93F804806A -:1047200093F803C005330CEB082C27F812CC0135A5 -:10473000082D01D0032CDDD101AB04F057FC044659 -:104740000120318802F056FA05460028A1D042F235 -:1047500049023388934277D842F24402934205D803 -:1047600003F55F43BF339BB2012B71D82C706FE010 -:104770006A792B79E97803EB0223AA78287802EB8F -:1047800001229BB2697892B204F0AAFC81E76A78B0 -:10479000A97A8DF80120AA782B788DF80220EA1CDE -:1047A00001926A7A980702EB0122ADF80820297B72 -:1047B000EA7A8DF8003002EB0122ADF80A206A7B1C -:1047C0008DF80C2004D52A4A92F8512091060DD577 -:1047D0005A0703D5274B5B6ADB0609D5684604F008 -:1047E000CBFC01463046FFF725FC52E73E21F9E7B6 -:1047F0001121F7E704F02AFDA1E76B78287800EB98 -:10480000032080B204F03EFD99E72B4613F8012BFC -:1048100068460193EB798DF800208DF8083004F09C -:104820007BFD8CE72B4613F8012B68460193EB794F -:104830008DF800208DF8083004F0A4FD7FE704F027 -:10484000CBFD7CE702207CE742F24A02934203D090 -:10485000681F02F07BF91CE7002368468DF80030E2 -:1048600004F0D0FD28709DF800306B70F0E700BFB9 -:10487000644D00216850002173B50A4642F22E01B2 -:10488000038806468B420ED842F226018B420ED98F -:10489000A3F50053273B072B09D8DFE803F00B28CB -:1048A0002E440808313542F24E018B4234D00020AC -:1048B00002B070BD114602F1170311F8010B073267 -:1048C00006F096FF04460120318802F093F9054670 -:1048D00000283CD042F22A023388934239D025D8AE -:1048E000A3F50053273B022B2ED82C702CE0114649 -:1048F00011F8010B06F0B2FFE4E706F0D9FFE1E79B -:10490000107807F03DF8DDE75378107800EB0320CE -:1049100080B207F055F8D5E71146D27911F8010BAE -:1049200007F05CF8CEE702200024CDE742F24E0209 -:104930009342DAD004D8A3F500532D3B012BD3E7E3 -:1049400042F27C029342D0D0681F02F0FFF80120AF -:10495000AEE700240DF107008DF8074006F0C6FF12 -:104960009DF80730AC7028706B70EDE7F0B589B03A -:1049700006460C4601F013FE054618B101252846EF -:1049800009B0F0BD3388A3F50053063B042BF6D8DD -:10499000DFE803F02456031E5200214611F8010BF4 -:1049A00004F0B6FD05460120318802F023F90446E3 -:1049B0000028E3D042F207023388934249D041D81D -:1049C00042F20602934242D0601F02F0BFF8D5E7E0 -:1049D000214611F8010B04F0BFFDE3E76378D4F83A -:1049E00007702078A17800EB0320CDF81770E378EA -:1049F000B4F80B702279A57901EB0321ADF81B7097 -:104A00006379677BA47B89B2CDE902748DF81E407F -:104A10000DF11704CDE9005480B2ADF81000ADF8E7 -:104A200012108DF814208DF815308DF816508DF871 -:104A30001D7004F00BFDB5E7207804F0B1FD9DE793 -:104A40000220B1E7A3F50053083B012BBCD8257029 -:104A5000BAE7002304A88DF8103004F0E5FC2070BC -:104A60009DF810306370AFE7F0B58DB007460C4687 -:104A700001F0CBFD054608B101253DE03B88B3F5CB -:104A8000015F35D842F23402934235D9A3F5005381 -:104A9000363B0A2B33D8DFE813F03B00BF00CB00D6 -:104AA000D50026010B00FB00FF0002011A012101C5 -:104AB000FF260220398802F09DF804460028DBD04A -:104AC0003B88B3F5015F00F2118142F23402934258 -:104AD00040F21081A3F50053363B052B00F22E81E6 -:104AE000DFE813F00C012C012C012C01150124012D -:104AF00042F27F0293424AD028460DB0F0BD2146D3 -:104B000011F8016B304604F09FFD05460120D1E706 -:104B1000A2786378267803EB0223ADF80C30227973 -:104B2000E378304603EB0223627903A903EB0243E7 -:104B30000493E279A37903EB0223227A03EB024385 -:104B40000593637A8DF81830A37A8DF81930E37ADB -:104B50008DF81A3004F10C030793A37C8DF82030F4 -:104B6000E37C8DF82130237D8DF82230637D8DF834 -:104B70002330A37D8DF82430E37D8DF82530237E0E -:104B80008DF8263004F068FD0546607691E7A2783E -:104B90006378267803EB0223ADF80C302279E378B2 -:104BA000304603EB0223627903A903EB024304932B -:104BB000E279A37903EB0223227A03EB0243059304 -:104BC000637A8DF81830A37A8DF81930E37A8DF86E -:104BD0001A3004F10C030793A37C8DF82030E37C9A -:104BE0008DF82130237D8DF82230637D8DF82330C0 -:104BF000A37D8DF82430E37D8DF82530237E8DF85C -:104C00002630637E8DF82730A37E8DF8283004F09F -:104C10007DFD0546E0764CE7234613F8040B009330 -:104C2000E378A278617804F0D5FD0546FF266DE7AC -:104C3000234613F8040B0093E378A278617804F01C -:104C4000E1FDF2E7617803AB06290F464FF000055E -:104C50001A4628BF062720780234AF4204F1040424 -:104C600003F1060302D804F0E5FD05E714F8046C2F -:104C700014F802CC03F8066C14F8036C013506EB4B -:104C80000C2623F8046C14F8016C03F8026CE4E7BA -:104C9000207804F085FEC8E704F08EFEC5E7A27810 -:104CA0006378267803EB0223ADF80C302279E378A1 -:104CB000304603EB0223ADF80E30A279637903A9E5 -:104CC00003EB0223ADF8103004F080FE1DE7A2785C -:104CD00061782078E31C04F093FEA6E761782078E1 -:104CE00004F0AAFEC8E6FF260320E3E642F27F02B4 -:104CF000934203D0601F01F029FFBDE6304603A9AF -:104D000004F064FD25709DF80C306370F2E71F23FA -:104D100003A8ADF80C3004F01FFE2070BDF80C3075 -:104D20006370BDF80C301B0AA370E3E7012303A8EE -:104D30008DF80C3004F024FE2070E4E70570D9E70C -:104D400042F26B0230B503880446934289B006D024 -:104D500042F26C02934236D0002009B030BD0B788D -:104D60008A788DF800304B7801F1140003EB0223B0 -:104D7000ADF80230CB780DF105028DF804300B1D33 -:104D800053F8045B834242F8045BF9D10B7D8A7DC2 -:104D90008DF815304B7D0DF1190003EB0223CA7D10 -:104DA0001831062A8DF8182028BF0622ADF81630D3 -:104DB0000EF08CFF684604F066FE01462046FFF7C1 -:104DC00039F90120C9E7087804F079FEF9E70B46C4 -:104DD00042F2690170B5028804468A428AB04AD01C -:104DE00042F26A018A4200F0918042F268018A42EE -:104DF00040F091801A7819798DF800205A780DF1D9 -:104E000011008DF801209A788DF80220DA7802EBF3 -:104E10000122597902EB01420192D9799A7902EB88 -:104E20000122ADF80820597A1A7A02EB0122ADF876 -:104E30000A209A7A8DF80C20DA7A8DF80D201A7BE8 -:104E40008DF80E205A7B8DF80F209A7B8DF810205C -:104E500003F10F021F3352F8041B9A4240F8041B5F -:104E6000F9D1684604F02EFE01462046FFF7E2F82D -:104E700001200AB070BD1A7819798DF800205A788F -:104E800002AE8DF801209A788DF80220DA7802EBD4 -:104E90000122597902EB01420192D9799A7902EB08 -:104EA0000122ADF818201A7A997A8DF81A205A7AC8 -:104EB00002EB0122ADF81C20197BDA7A02EB012209 -:104EC000ADF81E205A7B8DF820209A7B8DF821208A -:104ED000DA7B8DF822201A7C8DF823205A7C8DF8FD -:104EE00024209A7C8DF82520DA7C8DF8262003F189 -:104EF00014022433354610685168083203C59A42BB -:104F00002E46F7D1684604F02DFEADE759781878A3 -:104F100004F0BCFEA8E70020ABE700002DE9F04F4D -:104F200003888046A3F50153223BA3B0032B00F274 -:104F30007D81DFE813F00400860012013E0191F844 -:104F400000C0BC4B4C7883F800C08B78087904EB28 -:104F50000324CB788A7A04EB03444B794D7B00EB36 -:104F600003208B79002600EB03400B7A91F8079021 -:104F70000193CB7A91F809E002EB03220B7B92B20A -:104F800003EB05238D7B9BB2062DAA4628BF4FF06D -:104F9000060A0293A84B0F311D700DABB24501F10B -:104FA000090103F10A0326D8019BCDE907408DF8DA -:104FB0002530029BA149ADF82A3006A80DAB8DF82B -:104FC00018C08DF824908DF826E0ADF828208DF8D3 -:104FD0002C500C9304F05CFE974B04461B785B004E -:104FE0000333D8B2FF2840F0EB8021464046FFF75C -:104FF00021F801201BE111F8097C11F807BC03F826 -:105000000A7C11F8087C013607EB0B2723F8087C93 -:1050100011F805BC11F8067C07EB0B2723F8067C7A -:1050200011F8047C03F8047C11F8037C03F8037C7A -:1050300011F8027C03F8027C11F8017C03F8017C72 -:10504000ACE78D7B0026062DA94628BF4FF0060948 -:1050500091F800C0774B4C7883F800C08B780879C2 -:1050600004EB0324CB784A7A04EB03444B7991F8A0 -:1050700008E000EB03208B7991F80BB000EB0340C4 -:10508000CB790F31019311F8053C02EB032211F8A3 -:10509000033C92B2029311F8023C0393664B1D70DD -:1050A0000DABB14501F10E0103F10E031BD8019BBD -:1050B000CDE907408DF82430029B60498DF82930F6 -:1050C000039B06A88DF82A300DAB8DF818C08DF81B -:1050D00025E0ADF826208DF828B08DF82B500B93E5 -:1050E00004F0AEFE78E711F80E7C11F80BAC03F873 -:1050F0000E7C11F80D7C013603F80D7C11F80C7C48 -:1051000007EB0A2723F80C7C11F809AC11F80A7C8C -:1051100007EB0A2723F80A7C11F807AC11F8087C82 -:1051200007EB0A2723F8087C11F805AC11F8067C78 -:1051300007EB0A2723F8067C11F8047C03F8047CAB -:1051400011F8037C03F8037C11F8027C03F8027C5D -:1051500011F8017C03F8017CA3E711F8010B364B31 -:105160000DAA06AC06288446187017464FF00003B7 -:10517000264628BF4FF0060C9C4501F1040106D8D5 -:1051800004A9CDE9047604F0FBFE04462DE711F8EE -:1051900003EC11F8045C013305EB0E2522F8025BE9 -:1051A00011F801EC11F8025C05EB0E2524F8025B06 -:1051B000E2E708781F4B187004F020FF0446022035 -:1051C000B8F8001001F016FD00283FF412AF42F2CB -:1051D0006302B8F8003093421BD842F26102934256 -:1051E0001BD9154B134A1B7804701278002C18BF7A -:1051F0000023427002461149837000EB430393423F -:105200000BD00C880232547031F8024B240A94708F -:10521000F5E742F26502934203D0053801F096FCAF -:10522000E7E6044B04701B784370F6E7002023B0D8 -:10523000BDE8F08F104C00211E4C0021124C0021C3 -:10524000F8B542F26603078805469F4205D042F250 -:1052500067039F420ED00020F8BD4B78087800EB22 -:10526000032080B204F0CCFE01462846FEF7E2FEA1 -:105270000120F1E74B780C78897804EB0324A4B281 -:10528000204604F0BFFE29880646032001F0B2FC48 -:105290000028EDD02B880538BB4201BF00234671A2 -:1052A0008471C37101F052FCE2E74A780B7803EB9A -:1052B00002230380CA788B7803EB022343804A7968 -:1052C0000B7903EB02238380CA798B7903EB0223EA -:1052D000C3804A7A0B7A03EB02230381CA7A8B7A62 -:1052E00003EB022343810C2070472DE9F34107466D -:1052F0000E46018810469846BDF8205001F07AFC11 -:105300000446002800F08C8042F222033A889A4238 -:1053100015D842F21F039A422CD841F205439A4213 -:1053200072D042F215039A4274D040F62D439A424D -:1053300058D0601F02B0BDE8F04101F007BC42F256 -:105340002F039A422ED007D842F223039A4216D056 -:1053500042F224039A4207E042F25C039A4206D8E2 -:1053600042F259039A4205D8E3D12670E1E742F2AE -:105370005D03EFE7267065702D0AA570D9E70DF182 -:10538000060101A805F082F82670BDF804306370AC -:10539000BDF804301B0AA370BDF80630E3701B0A89 -:1053A0002371C6E70DF10603684601AA0DF102015B -:1053B00005F09AF82670BDF800306370BDF8003033 -:1053C0001B0AA370BDF80230E3701B0A2371BDF8FD -:1053D000043063711B0AA371BDF80630E3711B0A28 -:1053E0002372A6E70023284698F800100DF1060264 -:1053F0008DF8063004F028FE9DF9063065702D0A00 -:105400002070A570E37094E728460DF1060104F0C2 -:10541000FBFDF1E7C11C284604F082FE2070AAE7DC -:1054200002B0BDE8F081000070B586B006460C46BB -:1054300001F064F9002840F0948042F2240233889D -:1054400093424CD842F21202934210D840F62D42B9 -:10545000934200F0A58037D840F2064293424FD0E5 -:1054600040F21D42934200F0C48006B070BDA3F527 -:105470000053133B112BF8D801A252F823F000BFC0 -:105480001B5502016B540201E3550201D355020181 -:105490006B5402016B5402016B5402016B54020104 -:1054A0006B5402016B5402016B5402016B540201F4 -:1054B0006B54020139550201675502017B55020107 -:1054C00003560201B355020141F205429342CCD189 -:1054D0006378257805EB0325ADB2034667E042F219 -:1054E0002F02934200F0918042F26D029342BCD1B0 -:1054F0006378207800EB032080B205F0A7F807E07E -:1055000063782078A17800EB032080B204F054FE89 -:1055100001463046FEF78EFD23E02146637811F800 -:10552000025B03A805EB0325ADB2FFF7BEFE2846DC -:1055300003A904F09BFEEBE72146637811F8025BB8 -:1055400003A805EB0325ADB2FFF7AFFE284603A97C -:1055500004F0CEFE00230322014600953046FFF7FB -:10556000C4FE012081E763782578A17805EB032547 -:10557000ADB2284604F0F2FEECE763782578227994 -:1055800005EB03256379A17802EB0322E378ADB242 -:1055900001EB0321284692B289B204F035FFD9E726 -:1055A0002346627813F8025B05EB0225ADB20422B4 -:1055B000D2E70025E378A178207801EB0321637816 -:1055C00089B200EB032080B204F068FF2B46012271 -:1055D000C2E76378207800EB032080B205F05AFA26 -:1055E00096E763782578082205EB0325ADB2002302 -:1055F000B2E76378207800EB032080B204F0DAFE93 -:1056000086E7002505222B46A6E705460346092224 -:10561000A2E700BF2DE9F047174E804696F82430E8 -:105620000F46154693B90123C0F3032986F82430A9 -:105630004FEA112A3DB140F2031008F08BF9013D09 -:105640000446EDB220B9002386F82430BDE8F08787 -:1056500080F8008080F80190877080F803A096F8A9 -:1056600025103A464B1C043086F825300EF055FBC9 -:10567000204604F0DDFFDDE7404C002170B586B028 -:1056800005460C4601F022F980BB42F20E032E883B -:105690009E422ED042F214039E422DD042F20D03C0 -:1056A0009E423BD16278237804F10D0103EB022383 -:1056B000ADF80030E278A37803A803EB0223ADF83D -:1056C000023023798DF8043063798DF80630A31DFC -:1056D0000293237B8DF80530FFF7E7FD03A96846A9 -:1056E00005F06AF801462846FEF7A4FC012006B042 -:1056F00070BD05F0C9F8F9E7204603F0BDFB298825 -:105700000446012001F076FA0028EFD02B880538F6 -:10571000B34208BF447101F019FAE7E72146284671 -:1057200006B0BDE87040FFF77FBE2DE9F0438DB0B5 -:1057300006460D4601F0CAF8044600284ED142F252 -:10574000430332889A424DD11822FF2301460DEBC4 -:1057500002008DF815308DF816300EF0DEFA2B7839 -:105760006A7A8DF80C306B784FF00C088DF80D309C -:10577000AB788DF814208DF80E30EB1C049305F1F6 -:105780000A03254601AF9DF814202A41D20717D5F8 -:1057900058781A7807EB840102EB002227F82420BE -:1057A000D8789A7803F1040902EB002206AB08FBD3 -:1057B00004304A804946FFF778FD013409EB0003C5 -:1057C0000135082D01D0022CDDD101A906AA03A8BC -:1057D00005F09EF801463046FEF72CFC01200DB086 -:1057E000BDE8F083294630460DB0BDE8F043FFF731 -:1057F00045BF002273B542F22B040092ADF804209D -:1058000002880546A24207D042F22C04A2421FD0D1 -:10581000FFF732F802B070BD6A4611F8010B06F0CE -:105820006CF804462988072001F0E4F9064668B1BF -:105830002B88A3F500532B3B012B04D8694600F8B5 -:10584000014B07F00DFF701F01F080F90120E1E727 -:105850006A4611F8010B06F071F8E2E738B542F23A -:105860001903028805469A4203D0BDE8384000F08B -:1058700015B8CB7A8A7A087802EB03224B7892B279 -:1058800000EB032080B201F10C03023105F0E0FCD3 -:1058900001462846FEF7CEFB012038BD2DE9F34135 -:1058A00007460E4601F02FF8054608B101250DE028 -:1058B00042F217023B8893421DD00BD840F67B4240 -:1058C000934247D040F67C4293424BD0284602B0E8 -:1058D000BDE8F08142F21A0293422CD042F21B0240 -:1058E0009342F3D17378347804EB0324A4B22046B6 -:1058F00005F03AFD29E006F110084146304605F072 -:10590000F3FC2C461120398801F074F90646002872 -:10591000CCD042F217023B8893423BD030D840F6BD -:105920007B42934243D040F67C4293422DD0701F7D -:1059300001F00CF9BAE73146737811F8024B04EB29 -:105940000324A4B2204605F0D5FC05464FF000081C -:105950000320D8E773783478804604EB03240520CD -:10596000A4B2D0E773783478B17804EB0324F378E9 -:10597000A4B201EB0321204689B205F045FDE4E71E -:10598000A3F500531A3B012BD1D87470240A35704B -:10599000B470CCE70346414603F8015B08F11002FE -:1059A00051F8040B914243F8040BF9D1BFE70023EF -:1059B00020460DF10601ADF8063005F005FDBDF8F5 -:1059C00006307470F370240A1B0A3070B47033719F -:1059D000ADE700002DE9F0418AB007460C4600F023 -:1059E000EDFF064608B1012618E042F275023B8839 -:1059F000934213D842F25F02934213D840F6834297 -:105A0000934200F0E68041D840F61542934200F000 -:105A1000FA8040F61642934200F0ED8030460AB01C -:105A2000BDE8F081A3F50153203B152BF6D801A268 -:105A300052F823F00B5C0201A35A02011D5A020125 -:105A40001D5A02011D5A02011D5A02011D5A02016E -:105A50001D5A02011D5A02011D5A02011D5A02015E -:105A60001D5A02011D5A02011D5A02014D5B02011D -:105A7000BD5B0201F95A0201115B0201315B0201B7 -:105A8000315B02011D5A02013F5B020141F20542F6 -:105A90009342C3D163782578042005EB0325ADB28A -:105AA00005E00C206378257805EB0325ADB2398835 -:105AB00001F0A0F80446002895D042F275023B8818 -:105AC000934215D842F25F02934200F2A18040F661 -:105AD0008342934200F09B8100F2D08040F6154251 -:105AE000934200F08E8140F61642934200F08F817F -:105AF000601F01F02BF876E763782578A17805EB35 -:105B00000325ADB2284605F0EBFC06460120CEE7A2 -:105B100063782578A17805EB0325ADB2284605F01A -:105B2000E1FC06460120002EC1D1BB4B1876BEE732 -:105B3000637825780F2005EB0325ADB2B7E76378CE -:105B400025781F2005EB0325ADB2B0E762782378F6 -:105B500003A803EB0223ADF80C30A378A2798DF8EB -:105B60000E30E3780D348DF80F3014F8093C8DF8C1 -:105B7000103014F8083C03EB0223ADF8123014F88F -:105B8000052C14F8063C03EB0223ADF8143014F88E -:105B9000032C14F8043C03EB022314F8022C03EB4F -:105BA0000243069314F8013C08948DF81C3005F06C -:105BB00093FC0646BDF80C50032078E763782578FF -:105BC000A17805EB0325ADB2284605F087FC064613 -:105BD000F2E7237803A88DF80C30637803348DF84E -:105BE0000D3014F8013C04948DF80E3005F072FC71 -:105BF000064600258AE76378207800EB032080B210 -:105C000005F07BFCF4E70546D6E7002507204EE7C4 -:105C1000A3F50153203B152B3FF66AAF01A252F8C2 -:105C200023F000BF9F5C0201CB5C0201F15A02012C -:105C3000F15A0201F15A0201F15A0201F15A02012C -:105C4000F15A0201F15A0201F15A0201F15A02011C -:105C5000F15A0201F15A0201F15A0201095D0201F1 -:105C6000095D02010F5E02010F5E0201135D020178 -:105C70005B5D0201F15A02016D5D020141F20542D4 -:105C800093427FF435AF284603A905F005FC9DF942 -:105C90000C3065702D0A2070A570E37028E704F0C1 -:105CA000B9FC074604F0BCFC804605F0E5FB054660 -:105CB00005F0E8FB677025713F0A2D0A2670A77072 -:105CC00084F803806571A07112E7284603AB02AA2D -:105CD0000DF1060105F0FCFBDDE90232BDF806100E -:105CE0006371E170090A2171190AA171190C1B0E67 -:105CF000657023722D0A130A6272120C2070A5704F -:105D0000E171A372E272F3E645702D0A06708570A8 -:105D1000EEE6284603A905F0E7FB65702D0A207022 -:105D2000A570039BE370039B1A0A22711A0C1B0EC9 -:105D30006271A371049BE371049B1A0A22721A0C0C -:105D40001B0E6272A372059BE372059B1A0A2273F3 -:105D50001A0C1B0E6273A373CAE6284603A905F04A -:105D6000C8FB0028D9D12C4B1876D6E7284603A9C2 -:105D700005F090FBDDE903ECDDE90576DDE90712CE -:105D8000099B20704FEA1E2020714FEA1E4060716F -:105D90004FEA1C2020724FEA1C406072380A2073C0 -:105DA000380C6073300A2074300C6074080AE17497 -:105DB0002075080C090EA175110A657084F803E0BE -:105DC00084F807C0E772E673E27521762D0A110C9C -:105DD0004FEA1E6E120E4FEA1C6C3F0E360EA57077 -:105DE00084F806E084F80AC0A773A674607561762B -:105DF000A2761A0AE37622771A0C1B0E6277A37733 -:105E000076E6002300F8013B05F075FB70E63146AD -:105E1000204600F098FE6BE6244C0021038873B501 -:105E2000A3F50153193B06460C46042B5FD8DFE867 -:105E300003F0030E2A394F004B780878897800EB7D -:105E4000032080B205F064FB0122002512E04B78AC -:105E50000D780A7905EB03254B79ADB202EB0322ED -:105E6000CB788978284601EB032192B289B205F0FC -:105E700075FB03220146002330460095FFF735FAF3 -:105E8000012002B070BD4B780D78227905EB032517 -:105E9000CB788978ADB201EB0321284689B205F0B1 -:105EA0006DFBE6E74B780D788A7905EB03254B7996 -:105EB000097903EB0223E278ADB202EB0122E1792A -:105EC000284600919BB2A17892B205F067FBD0E71B -:105ED0000B79CA78207802EB03228B78497892B24A -:105EE00001EB032189B2637905F088FBACE7002060 -:105EF000C7E7F0B503880746A3F50053303B0D46CE -:105F000089B0042B00F29280DFE803F0031D263CE9 -:105F10005700052000264B780C7804EB0324A4B22C -:105F2000398800F067FE054650B342F231023B88E3 -:105F3000934263D05DD842F23002934260D0681F32 -:105F400000F004FE1CE08A782878497805F0DEFB32 -:105F5000002406460120E3E74B7808788A7900EBB5 -:105F600003204B7980B203EB02239BB200930B79A1 -:105F7000CA78897805F0ECFB01463846FEF75AF8F6 -:105F8000012054E00B7800248DF80E304B7803A8E4 -:105F90008DF80F308B78ADF80C408DF810304FF441 -:105FA0008073ADF8123002238DF811408DF8143053 -:105FB000069404F08FFF0646CCE70B7800248DF89A -:105FC0000E304B7803A88DF80F308B78ADF80C406D -:105FD0008DF81030CB78ADF812408DF811300223D7 -:105FE0008DF814307F2306948DF81C3004F062FE87 -:105FF000E1E7A3F50053333B012BA0D82E709EE7B9 -:106000000023204603AA0DF10B018DF80B308DF80B -:106010000C3005F045FB9DF80C309DF80B206C70A2 -:10602000240A2870AC70EA702B7188E7002009B050 -:10603000F0BD38B505460C4600F05EFD90B942F261 -:1060400026022B8893420FD042F25E02934211D077 -:1060500042F22502934206D105F0F2FC01462846A1 -:10606000FDF7E8FF012038BD204604F1200105F0CE -:10607000E9FCF3E7204694F8402004F1200105F004 -:1060800011FDEBE74FF6E072F0B503880646934248 -:106090000C4693B00AD84FF6A372934277D84FF6C6 -:1060A0009F72934269D8002013B0F0BDA3F57F43DF -:1060B000E13B1E2BF7D801A252F823F0D96102016F -:1060C000A7600201A7600201A7600201A7600201A8 -:1060D000FD610201A7600201A7600201A760020141 -:1060E000A7600201A7600201A7600201A760020188 -:1060F000A7600201A7600201176202011F6202018C -:106100002B620201A561020141620201A760020146 -:10611000A7600201A7600201A760020133620201C9 -:1061200039610201A7600201A7600201A7600201B4 -:106130007D6202013B62020123200025318800F0CC -:1061400059FD0446B8B107464FF6FA7207F8015BED -:106150003388934200F0AD8000F294804FF6C07215 -:10616000934200F0E9804FF6F472934200F06A81A6 -:10617000601F00F0EBFC012096E7A3F57F43A13BF5 -:106180000122022B75D8DFE803F0775D6B004FF634 -:10619000C072934274D04FF6CD72934283D10120E6 -:1061A0000546CBE78378052B11D188784B7800041E -:1061B00000EB03200B7804341844CB78002100EB6B -:1061C0000360227802F08CFD05460120B6E7084600 -:1061D00007F04BFA0834F4E7084607F046FAC2071E -:1061E0000546247A02D5204603F028FA6B0701D42D -:1061F0000120A2E72046F7F78BFEF9E78B78487875 -:106200001B0403EB002308780344C87803EB006009 -:1062100005F000F8D8E7084602F0B2FCE8E70846C7 -:1062200002F020FD0546072088E7084602F046FDFB -:10623000CAE708780AF008FDDAE701200C257DE7B7 -:1062400027207AE7E378A278617802EB03222078AE -:1062500092B209F06FFC0028CAD1012012256DE727 -:10626000207809F051FD0028F7D0607809F068FD2A -:10627000F1E77E4B1A70BBE77D4BFBE71D205CE727 -:1062800039205AE74FF6FE7293427FF471AF08A8A7 -:10629000E0F708FA3B4608AA0EAE154603CDB54214 -:1062A000186059602A4603F10803F6D1286818607F -:1062B0005EE70AF0D5FC6070C0F30720A0700AF01A -:1062C000C9FCE0700AF0C6FC000A207107F028FB48 -:1062D000030A6071A371030C000EE371207207F0D2 -:1062E00025FB0025030A6072A372030C000EE37203 -:1062F000207308A90DF11E00ADF81E5002F05EFBE0 -:10630000BDF81E3063731B0AA373BDF8203065749B -:10631000E3731B0A2374A57402F0A6FBE074000A61 -:10632000207507F097F9534B60751B88000AE375D9 -:106330001B0AA07523761BE7002503A90DF10A00AF -:10634000ADF80A5002F02CFBBDF80A3004A96370C6 -:10635000BDF80A300DF10E001B0AA370BDF80C3019 -:10636000ADF80E50E3701B0A237102F035FBBDF847 -:106370000E3005A963711B0AA371BDF810300DF131 -:106380001200E3711B0A2372ADF8125002F02CFBCD -:10639000BDF8123006A963721B0AA372BDF814304F -:1063A0000DF11600E3721B0A2373ADF8165002F0CC -:1063B00023FBBDF816300DF1070263731B0AA373AC -:1063C000BDF818300DF11A01E3731B0A23740DF1A7 -:1063D000060007AB8DF806508DF8075002F014FB4D -:1063E0009DF80630A5746374BDF81A30A575E37482 -:1063F0001B0A23759DF807300DF109026375BDF87E -:106400001C300DF11E01E3751B0A237602A808ABB0 -:106410008DF808508DF8095002F00EFB9DF80830F9 -:10642000A5766376BDF81E30A577E3761B0A237741 -:106430009DF809306377BDF82030E3771B0A84F8B4 -:10644000203095E608A8DFF73FFC3B4608AA10AECF -:10645000154603CDB542186059602A4603F108037A -:10646000F6D128681860AA889A8081E6204C00211D -:106470001F4C0021604D00214FF6E07270B503887B -:10648000054693428AB006D04FF6FC7293422BD059 -:1064900000200AB070BD087802F014FD0646012005 -:1064A000298800F0A7FB0446E0B14FF6FC730670A4 -:1064B0002A889A4213D12822002168460DF02DFC2B -:1064C0006846DDF72BF86B46651C0AAE1A4603CA10 -:1064D000B24228606960134605F10805F6D1601FD5 -:1064E00000F034FB0120D4E729200026D8E74FF63E -:1064F000B372F0B50388064693428FB006D04FF6CC -:10650000DB72934226D000200FB0F0BDCA788B78A2 -:10651000087803EB02234A7899B200EB022080B29C -:1065200002F0DAFE07460120318800F063FB0546E1 -:1065300070B104464FF6DB7204F8017B3388934256 -:106540000BD04FF6DC72934219D0681F00F0FEFAB0 -:106550000120D9E735200027E6E701A8DDF74CFC4C -:10656000234601AA0DAE144603CCB442186059600C -:10657000224603F10803F6D110681860E5E701A888 -:10658000DDF760FC234601AA09AE144603CCB442F1 -:1065900018605960224603F10803F6D1ECE74FF684 -:1065A000F57270B503880546934288B006D04FF661 -:1065B000FB72934227D0002008B070BD91F9000013 -:1065C00002F02CFF0120298800F014FB0446C0B122 -:1065D000002303704FF6FB732A889A420ED1684657 -:1065E000DDF746FE6B46651C08AE1A4603CAB2428A -:1065F00028606960134605F10805F6D1601F00F0B8 -:10660000A5FA0120D8E72120DDE72DE9F041028835 -:106610000746A2F57F42D03A0B468AB00E2A68D8C8 -:10662000DFE802F0082D32676767676767674367CF -:1066300067673800DA789978120402EB01225978FA -:1066400018780A44197902EB016103F00BFA00266D -:106650000546B0460120398800F0CCFA044660B106 -:106660004FF6DA7205703B88934223D04FF6DE7204 -:10667000934231D0601F00F069FA01203AE0597866 -:10668000187803F0F1F9E2E79A785978187803F06E -:10669000EDF9DCE75A7893F80080062008EB022831 -:1066A00000259E781FFA88F8D5E700262520B046F9 -:1066B0003546D0E701A8DEF737F809AE01AB621C1A -:1066C0001D4603CDB542106051602B4602F1080211 -:1066D000F6D128681060CDE73146404602F0B6FF9B -:1066E000030A6070A370030C000EE37020716171E7 -:1066F000C0E700200AB0BDE8F081000070B5064692 -:106700004FF6DD7200206F4B8AB01B880C46ADF847 -:10671000083033888DF80A00934200F0968003F128 -:106720001D0292B21A2A00F2CA80A3F57F43E33B0E -:106730001A2B00F2C380DFE803F0111624C12BC12D -:10674000A5939AC1C1C1C1C1C1C1C1C1C17EC1C1ED -:10675000C1C1C1C10E001D2000252BE00A785A4B93 -:106760009A760120F8E7CB788978207801EB03212D -:106770006378227900EB032089B280B2FEF74AFFEA -:10678000EFE74A780B7803EB02234F4AD384E8E71C -:1067900008464B7810F8025B05EB032506F065FF11 -:1067A0000B46A17AADB202460091284603F0DCFC0C -:1067B00005460120318800F01DFA0446002838D033 -:1067C0004FF6EB720570338893426FD04FF6FD722F -:1067D000934259D04FF6E972934227D13A4BDA6986 -:1067E0004270DA69120A8270DA8BC270DA7F027143 -:1067F0001A6A42711A6A120A82715A8CC27193F82B -:10680000232002729A6A42729A6A120A82725A8D1E -:10681000C27293F82B200273DA6A4273DA6A120AA0 -:106820008273DA8DC27393F82F300374601F00F007 -:106830008DF9012043E04B78087891F9021000EBC4 -:10684000032080B203F02AFCB2E74B780878CA78BC -:1068500000EB032091F9021080B203F03DFCA7E7A2 -:106860008A78207891F9011003F050FEA0E74B7868 -:10687000087802A900EB032080B203F0A1FE0546D0 -:10688000042097E7112067E703A8DEF7B9FC09AEFB -:1068900003AB621C1D4603CDB542106051602B4610 -:1068A00002F10802F6D128681060BFE79DF80A30AF -:1068B000BDF80820C370A0F80120B7E700200AB097 -:1068C00070BD00BF965B0301404C002138B54FF608 -:1068D000F873028804469A4213D14B780878023143 -:1068E00000EB032080B203F021FF21880546012040 -:1068F00000F080F918B100F8055900F027F90120DF -:1069000000E0002038BD4FF6F77337B50288044623 -:106910009A421FD14B78087800EB03208B7880B225 -:10692000003B18BF01238DF80430CB7801A95A1E13 -:10693000534253418DF8053004F084FD218805460B -:10694000012000F057F918B100F8055900F0FEF8E1 -:10695000012000E0002003B030BD00002DE9F04729 -:10696000154E8046337B0F46154683B90123C0F38D -:10697000032933734FEA112A3DB140F2031006F0A8 -:10698000E9FF013D0446EDB218B900233373BDE8B9 -:10699000F08780F8008080F80190877080F803A06D -:1069A000717B3A464B1C043073730DF0B6F92046E8 -:1069B00004F080FDE0E700BF244C00214FF6C172D7 -:1069C00070B503880646934288B050D003F12B027D -:1069D00092B2042A00F28B80A3F57F43D53B042BAF -:1069E00000F28580DFE803F03545032E43000A7886 -:1069F000404B1A700120318800F0FCF80446002852 -:106A000061D0002305464FF6D67205F8013B338866 -:106A1000934230D04FF6D972934256D04FF6C1729E -:106A200093424DD101A8DEF71DF82B4601AA07AE0F -:106A3000154603CDB542186059602A4603F1080394 -:106A4000F6D151E04A780B7803EB0223294AD3812F -:106A5000D0E7CA788B78087803EB02234A7800EBFA -:106A6000022080B20A7999B2FFF778FFC2E71D20B1 -:106A7000C1E71120BFE71F4B5A6842705A68120ADB -:106A80008270DA88C270DA7902719A6842719A6803 -:106A9000120A82715A89C271DA7A02721A694272D2 -:106AA0001A69120A82725A8AC272DA7C02735A69AD -:106AB00042735A69120A8273DA8AC273DB7D0374E5 -:106AC000601F00F043F8012012E001A8DEF736F85D -:106AD0002B4601AA07AE154603CDB5421860596092 -:106AE0002A4603F10803F6D110681860E8E7002091 -:106AF00008B070BD244C002138B505464FF6E87249 -:106B00002B880846934205D04FF6EC7293420FD083 -:106B1000002038BD04F0FCFF04462988012000F065 -:106B200069F818B100F8054900F010F80120F0E705 -:106B3000087805F00BF8EFE701234170090A0370AC -:106B4000817003207047017001207047024608B52C -:106B500018B10021054806F008FF054B93F82800FE -:106B600018B9BDE8084006F06DB908BD784D0021A0 -:106B7000644D002138B50546881C0C4606F0EAFE37 -:106B800010B105704470023038BD000070B5044685 -:106B90000025174E56F8043B7BB901351D2DF9D160 -:106BA000A578DDB1012D06D101F0BEFC04210E2037 -:106BB000FFF7E0FF38B9002004E02046984700289E -:106BC000EBD0012070BD032343700C23057083704C -:106BD000E378C3700238FFF7B9FFF2E70121102014 -:106BE000FFF7C8FF0028E6D0237900F8013BF1E762 -:106BF000EC4C002138B5054605300C4606F0AAFEDF -:106C000048B10E2303700123C4700335240A457074 -:106C100083700471053038BDF8B587780546022FBA -:106C200003D0042F6AD00020F8BD827C3B4EFF2A9F -:106C3000336935D0580501D40120F5E77368990010 -:106C4000FAD5374B96F830201B689B7B9A42F3D2DB -:106C500012213E20FFF78EFF04460028ECD00B23C4 -:106C6000037001234370AB7A05F10C018370EB7A5A -:106C7000043000F8013C06F0F3FCAB7C05F1130195 -:106C8000A37204F10B0006F0EBFC6B7A637496F8C8 -:106C90003030013386F83030A01EFFF757FFCBE7C6 -:106CA0009A07C0D573689B00BDD51D4B96F8302060 -:106CB0001B689B7B9A42B6D2017A3E200C31C9B246 -:106CC000FFF758FF04460028ADD00123077043703A -:106CD000AB7A05F10C018370EB7A043000F8013CCB -:106CE00006F0BEFC2A7A04F10B03A272696818460A -:106CF0000CF0ECFF2A7A697A8154C8E739460E20F5 -:106D0000FFF738FF044600288DD0012303700C23C1 -:106D1000437020238370EB78C370BDE7404C0021A3 -:106D2000DC4D00210238FFF711BF38B50546F920C8 -:106D30000C4606F00FFE10B105704470023038BDED -:106D40002DE9F04F83780446173B85B00F2B15D8FB -:106D5000DFE813F01000A900BD00140014001400B7 -:106D60001400D4008E010601140014001400140055 -:106D70001400A601BB4F3B69DE0402D44FF0000BA8 -:106D800088E07B689D00F9D5E522868BDFF8D892F4 -:106D9000B6FBF2F302FB1362002A18BF013397F827 -:106DA0003020DBB21344D9F80020927B9342E5DC1B -:106DB000D0F82080D9F8003097F830209B7B9A4299 -:106DC000DCD2E72006F0C6FD05460028D6D0E52E29 -:106DD000324628BFE5224FF03E01D3B2017003F1E5 -:106DE0001A014170811C019197F83010D9F8000008 -:106DF0000131C9B287F83010807BB61A88424FD172 -:106E0000002E4DD00026B346A18841F04001A1805C -:106E1000206AB4F81CC008EB020AAAEB0000604527 -:106E2000CDE902324FF00D004FF00103A188EB7065 -:106E30001CBF01F01F0141F020012971090AA8704F -:106E40006971A179E81DA971E11D06F009FC617B5A -:106E500005F115006973A17BA973E17BE973217CBE -:106E60002974617C6974618AA97494F91310E974B6 -:106E7000217D297504F1150106F0F2FB029B4146C4 -:106E8000039AEB7605F11C000CF020FF0198FFF748 -:106E900049FF1EB9584605B0BDE8F08FD04689E7D6 -:106EA0004FF0010BB4E704210E20FFF763FE00282A -:106EB0003FF464AF42224FF0010B4270202280F871 -:106EC00000B08270E278C270FFF72CFFE2E7654BFA -:106ED0001A69D0037FF552AF5B6899007FF54EAF1A -:106EE00001213E20FFF746FE00283FF447AF112264 -:106EF0000270FFF717FF4FF0010BCBE7594B1A69F0 -:106F000092047FF53BAF5B689B007FF537AF1021A4 -:106F10003E20FFF72FFE054600283FF42FAF0E233B -:106F20000370237904F10A014370E388063000F806 -:106F3000043CE3881B0A00F8033C237A00F8023C77 -:106F4000637A00F8013C06F08BFB237C2B73638A89 -:106F50006B73638A1B0AAB73237DEB732846C8E708 -:106F6000404E33695F047FF509AF73689D007FF57C -:106F700005AFF7224789DFF8F0A0B7FBF2F302FB79 -:106F80001372002A18BF013396F83020DBB2134485 -:106F9000DAF80020927B93423FF7F0AEC368DAF84C -:106FA000002096F83010927B02939142BFF4E6AE37 -:106FB000F72FB94628BF4FF0F7095FFA89F202F1BF -:106FC00008013E20C9B20192FFF7AFFE0546002836 -:106FD0003FF4D4AEDDE9012396F83010DAF8000072 -:106FE0000131C9B286F83010807BA7EB09088842CE -:106FF00035D1B8F1000F32D04FF000080221C3465E -:10700000617203EB09010191E16803EB0900411A88 -:10701000608981422AD1617A022918BF00210F209C -:107020002870A0886870A088000AA870A079E8700D -:10703000E0792871207AA9716871EA712FB14A4606 -:10704000194605F108000CF041FE2846FFF76AFEDC -:10705000B8F1000F3FF41EAF4746019B9FE74FF08A -:10706000010BCEE7404C0021DC4D00210121D6E789 -:107070002B4B1A6910047FF581AE5B6899007FF590 -:107080007DAE03213E20FFF775FD00283FF476AE6C -:1070900010220270A2884270A288120A827028E729 -:1070A0001F4B1A6912027FF569AE5B689B007FF582 -:1070B00065AE14213E20FFF75DFD054600283FF434 -:1070C0005DAE18230370237904F10E014370E38849 -:1070D0000A3000F8083CE3881B0A00F8073C2389C3 -:1070E00000F8063C23891B0A00F8053C638900F878 -:1070F000043C63891B0A00F8033C237B00F8023C34 -:10710000637B00F8013C06F0ABFA237D2B74E38A25 -:107110006B74E38A1B0AAB74237EEB741EE700BF1B -:10712000404C002138B5054600F058FE0446A0B991 -:10713000AB78032B0FD104210E20FFF71BFD50B1BC -:107140000A2301244370202304708370EB780238F3 -:107150004371FFF7FBFC204638BD0124FBE700002C -:10716000837870B51A3B0546032B0AD8DFE803F095 -:10717000022B3B572F4B304E1B68327E9B7F9A422F -:1071800001D3002070BD33695803FAD573689900A4 -:10719000F7D509213E20FFF7EDFC04460028F0D08A -:1071A000132303702B79A91D43706B79033000F80A -:1071B000013C06F055FA337E01333376A01EFFF70B -:1071C000C5FC0120DEE704210E20FFF7D3FC0446B6 -:1071D0000028D6D001230370392363702023A370C5 -:1071E0002B79E370EAE7144B1A699203C9D55B68FF -:1071F0009B00C6D506213E20FFF7BCFC04460028B4 -:10720000BFD0122303702B7943706B798370EB88A6 -:10721000C370EB881B0A03712B7A4371CEE70421FC -:107220000E20FFF7A7FC04460028AAD00123037014 -:107230004023D2E7DC4D0021404C0021837870B51B -:107240002B3B0546072B0BD8DFE803F004195E0A39 -:107250000A0A0A7305210E20FFF78CFC044608B9C0 -:10726000002070BD42F26C01FFF766FC2A792318FA -:1072700022546A795A70A01EFFF768FC5DE0524BF9 -:107280001A69D600ECD55B689C00E9D5017D3E20EB -:1072900049000F31C9B2FFF76DFC04460028DFD06A -:1072A0001D2303702B79002243706B7905F11601C1 -:1072B0008370AB68C370AB681B0A03716B89437141 -:1072C0002B7B83716B7BC371AB7B0372EB7B437254 -:1072D0002B8A83722B8A1B0AC3726B8A03736B8A95 -:1072E0001B0A43732B7D837300F10F03287D023348 -:1072F0008242C0D20888013203F8020C31F8020B36 -:10730000000A03F8010CF1E72F4B1A699000A7D58A -:107310005B689900A4D503213E20FFF72BFC0446AF -:1073200000289DD01E2303702B7943706B798370E6 -:10733000A1E7254E73699A0701D4012091E773688C -:107340009B00FAD5214B96F830201B689B7B9A4214 -:10735000F3D214213E20FFF70DFC04460028ECD0A8 -:1073600022230370AB884370AB881B0A8370AB7910 -:10737000C370EB7903712B8943712B891B0A8371CD -:10738000AB7AC371EB7A03722B7B4372EB89837206 -:10739000EB891B0AC3722B6903732B691B0A4373A6 -:1073A0006B8A8373AB8AC373AB8A1B0A0374AB7D8E -:1073B0004374EB7D83742B7EC37496F830300133B5 -:1073C00086F8303057E700BF404C0021DC4D0021EB -:1073D00038B583780446292B03D02A2B53D00020BC -:1073E00038BD334B1A695001F9D55B689900F6D561 -:1073F000A17E3E2049001331C9B2FFF7BBFB002834 -:10740000EDD01B230370237900224370637904F1CC -:107410001C018370A368C370A3681B0A037163898E -:107420004371E3688371E3681B0AC371E3890372E4 -:10743000237C4372637C8372A37CC372E37C0373FB -:10744000237D4373E38A8373E38A1B0AC373238B0D -:107450000374238B1B0A4374A37E837400F113030C -:10746000A57E0233AA4204D30238FFF76FFB012046 -:10747000B6E70D88013203F8025C31F8025B2D0A91 -:1074800003F8015CECE70A4B1A691201A7D55B68A7 -:107490009B00A4D503213E20FFF76CFB00289ED063 -:1074A0001C2303702379437063798370DCE700BF8A -:1074B000404C002138B583780546272B01D00020A9 -:1074C00038BD0B4B1A69D201F9D55B689B00F6D524 -:1074D0001D213E20FFF74EFB04460028EFD0294631 -:1074E00000F008F8A01EFFF731FB0120E8E700BF1D -:1074F000404C0021192303700B794370CB888370B3 -:10750000CB881B0AC3708B6803718B681B0A43719D -:107510004B898371CB68C371CB681B0A0372CB891B -:1075200043720B6983720B691B0AC3724B8A037324 -:107530004B6943734B691B0A8373CB8AC3730B7EFE -:1075400003744B7E43748B7E8374CB7EC3740B7F3A -:1075500003754B7F43758B7F83750B8CC3750B8CC9 -:107560001B0A03764B8C43764B8C1B0A83768B8CE1 -:10757000C3768B8C1B0A03771D207047837810B568 -:10758000272B044626D0282B03D11B4B1A699001C8 -:1075900001D4002010BD5B689900FAD507213E2078 -:1075A000FFF7E8FA02460028F3D01A230370A388F5 -:1075B0004370A3881B0A8370E388C370E3881B0AA7 -:1075C0000371237A4371637A8371901EFFF7BEFAC9 -:1075D0000120DFE7084B1A69D201DAD55B689B000E -:1075E000D7D51D213E20FFF7C5FA02460028D0D08E -:1075F0002146FFF77FFFE8E7404C002108B5094A24 -:10760000C178837803EB0123D1699BB20131D16149 -:10761000116A0B44136206F0A5F9012003F014F877 -:10762000012008BD404C0021114B70B5DD8C044693 -:107630000E4685B905211320FFF79CFAB8B1012346 -:107640004470240A03708470C6700571BDE87040F0 -:107650000238FFF77BBA9A6A01329A62DA6A2A44E0 -:10766000DA620A462946BDE87040FDF7D3BF70BD17 -:10767000404C002110B502F0E5FF044610B900248B -:10768000204610BD044B9B7E002BF9D0FFF7B6FFC0 -:107690000028F4D1F4E700BF404C002110B5094C9C -:1076A000A37E43B102F0CEFF28B1A37E43B1BDE873 -:1076B0001040FFF7A3BF0020BDE8104005F0C2BB9B -:1076C00010BD00BF404C002138B583780546122B11 -:1076D00014D8042B1BD9053B0D2B18D8DFE813F069 -:1076E000190059006E001700E100C20017001700D2 -:1076F0001700170017009500170002012F2B00F04C -:107700001D81302B00F03F812E2B00F0FA800020ED -:1077100038BDAB4B1A69D207F9D55B689B00F6D52B -:1077200013213E20FFF726FA04460028EFD001225D -:1077300002702B79063000F8053CEB8800F8043C19 -:10774000EB881B0A00F8033C2B7A00F8023C6B7AAA -:10775000991E914287BF637105F10A01627105F1BB -:107760001D0105F07DFF2B8A23732B8A1B0A63738F -:107770006B8AA3736B8A1B0AE373AB8A2374AB8A8D -:107780001B0A6374AB7DA374A01EFFF7DFF9012011 -:10779000BEE78B4B1B68DC06B9D504210520FFF73B -:1077A000E9F904460028B2D02B790370EB884370C6 -:1077B000EB881B0A83702B7AC370E5E7804B1A694C -:1077C0005007A4D55B689900A1D50A213E20FFF798 -:1077D000D1F9044600289AD0032303702B79437013 -:1077E000EB888370EB881B0AC3702B8903712B898C -:1077F0001B0A43716B8983716B891B0AC371AB8947 -:107800000372AB891B0A4372BEE76D4B1A6992067D -:107810007FF57DAF5B689C007FF579AF0B213E2043 -:10782000FFF7A8F9044600283FF471AF0623237040 -:10783000AB886370AB881B0AA370EB88E370EB889E -:107840001B0A23712B8963712B891B0AA3716B8916 -:10785000E3716B891B0A2372AB896372AB891B0AC4 -:10786000A37291E7564B1A6910077FF550AF5B681A -:1078700099007FF54CAF0C213E20FFF77BF90446C1 -:1078800000283FF444AF042303702B794370EB8846 -:107890008370EB881B0AC370AB684360EB6883603E -:1078A00072E7474B1B681A057FF531AF08210C20A2 -:1078B000FFF760F9044600283FF429AF2B790370E5 -:1078C000EB884370EB881B0A83702B7AC3706B893B -:1078D00003716B891B0A4371AB898371AB891B0AE6 -:1078E000C37151E7364B1B695B067FF510AF0B2167 -:1078F0003E20FFF73FF9044600283FF408AF072376 -:1079000095E72F4B1A6954007FF501AF5B6898002B -:107910007FF5FDAE05213E20FFF72CF90446002837 -:107920003FF4F5AE1F2303702B794370EB8883700F -:10793000EB881B0AC3702B7A237125E7204B5A6909 -:10794000D1077FF5E4AE5B689A007FF5E0AE0921D0 -:107950003E20FFF70FF9044600283FF4D8AE21235C -:1079600003702B794370EB888370EB881B0AC3701C -:107970002B7A03716B7A4371AB7A8371EB7AC371A3 -:107980002B7B037200E70E4B1A69002ABFF6BFAECD -:107990005B689B007FF5BBAE05213E20FFF7EAF850 -:1079A000044600283FF4B3AE20230370AB88437035 -:1079B000AB881B0A8370AB79C370EB79BCE700BF5F -:1079C000404C0021837810B5212B044601D00020C3 -:1079D00010BD0D4B1A691203F9D55B689B00F6D5F3 -:1079E00004213E20FFF7C6F80028F0D014230370CE -:1079F000A3880238C370A3881B0A0371A37943715B -:107A0000FFF7A4F80120E3E7404C002138B5837864 -:107A10000446082B11D104210E20FFF7ABF858B112 -:107A20000E230125437020230570837023790238CB -:107A30004371FFF78BF8284638BDBDE83840FFF7A3 -:107A400043BE000038B583780546052B01D00020E1 -:107A500038BD234B1A699205F9D55B689B00F6D5B2 -:107A60001F213E20FFF786F804460028EFD00A23A6 -:107A700003702B7905F10A014370EB88063000F89A -:107A8000043CEB881B0A00F8033C2B7A00F8023C0C -:107A90006B7A00F8013C05F0E3FD05F1170104F1F4 -:107AA0000C0005F0DDFD05F11D0104F1120005F0EB -:107AB000D7FD2B8AA01E23762B8A1B0A63766B8A3E -:107AC000A3766B8A1B0AE376AB8A2377AB8A1B0A01 -:107AD0006377AB7DA377FFF739F80120B8E700BFE4 -:107AE000404C002100F000B8837810B50B3B0446F1 -:107AF000062B10D8DFE803F004384A0F0F0F6F0091 -:107B00003D4B9A6802F00071920118D50521592069 -:107B1000FFF730F808B9002010BD01236372237904 -:107B20000370E3884370E3881B0A8370237AC37071 -:107B3000637A03710238FFF709F80120ECE71B684C -:107B400003F080030B43E6D004210820FFF712F86E -:107B50000028E0D023790370E3884370E3881B0A90 -:107B60008370237AC370E5E7234B5B681804D2D592 -:107B700003213020FEF7FEFF0028CCD023790370CC -:107B8000E3884370E3881B0A8370D3E71A4B1A69B2 -:107B9000D1061CD55B689A0019D50D213E20FEF751 -:107BA000E9FFA0B105230370A3884370A3881B0AD3 -:107BB0008370D4F80630C0F80330D4F80A30C0F827 -:107BC0000730E389C372E3891B0A0373B2E7A08815 -:107BD00003F0CAFB9FE7084B9B681B029BD5022161 -:107BE0005720FEF7C7FF002895D0A3880370A3880D -:107BF0001B0A43709EE700BF404C002110B5074BA5 -:107C0000847859689A680131224459609A6005F075 -:107C1000A9FE012003F05AFC012010BD244C0021D4 -:107C200070B50E46810001310546C9B213201446D5 -:107C3000FEF7A0FF00B30346224603F8015BB11E26 -:107C400004EB4505AA4203F1040304D1BDE87040EA -:107C50000238FEF77BBF31F8024F03F8044C0C8862 -:107C6000240A03F8034C148803F8024C32F8024B40 -:107C7000240A03F8014CE5E770BD000010B503F0DD -:107C800023FC044610B90024204610BD044B1B7889 -:107C9000002BF9D0FFF7B2FF0028F4D1F4E700BFC2 -:107CA000244C002138B50F4C257E012D09D103F05D -:107CB0000BFC88B105F056FE2846BDE8384003F0BD -:107CC00005BC237843B103F0FFFB28B1237843B10F -:107CD000BDE83840FFF792BF0020BDE8384005F00E -:107CE000B1B838BD244C002100207047837810B50E -:107CF000162B044601D0002010BD0F4B1A69120547 -:107D0000F9D55B689B00F6D506213E20FEF732FFD1 -:107D10000028F0D00C23037023790238C370E38865 -:107D20000371E3881B0A4371237A8371637AC371F9 -:107D3000FEF70CFF0120DFE7404C002138B58378C7 -:107D40000446132B4FF0000503D0142B29D000203C -:107D500038BD214B1A691006F9D55B689900F6D534 -:107D600042213E20FEF706FF0028F0D00823457090 -:107D70000370821C631D04F1250153F8045B8B42E0 -:107D800042F8045BF9D100F12202453453F8041B98 -:107D9000A34242F8041BF9D10238FEF7D7FE0120B6 -:107DA000D6E70D4B1A69D205D1D55B689B00CED5BD -:107DB00022213E20FEF7DEFE0028C8D009230370F2 -:107DC0002379821C4370631D253453F8041BA3429E -:107DD00042F8041BF9D1DFE7404C002138B5837825 -:107DE0000546222B39D0312B20D0152B05D10F2160 -:107DF000FF20FEF7BFFE044608B9002038BDF1237E -:107E00000370FF2343702B79033000F8013CD5E960 -:107E1000022305F043FCD5E9042304F1090005F031 -:107E20003DFCA01EFEF792FE0120E7E70A21FF209D -:107E3000FEF7A0FE04460028DFD0F3230370FF23E3 -:107E400043702B798370AB688371AB681B0AC37175 -:107E50006B890372EB7A4372E3E70F21FF20FEF791 -:107E600089FE04460028C8D0F5230370FF23437021 -:107E70002B798370EB88C370EB881B0A03712B8905 -:107E800043712B891B0A8371EB68C371EB681B0A72 -:107E90000372EB894372EB7B83722B69C3722B698C -:107EA0001B0A03736B8A4373EB7C8373B9E700008F -:107EB000014B5866704700BF784C0021034B044AC1 -:107EC0001A62044B044A1A62704700BF784C0021C2 -:107ED00001460201EC4C0021196C020104490548DD -:107EE000054B064A48625A6288629A62704700BF30 -:107EF000784C002181460201EC4C0021416D0201C9 -:107F0000034A93681BB903499160034A9360704721 -:107F1000784C002179480201EC4C0021034B044AC3 -:107F2000DA62044B044ADA62704700BF784C0021E1 -:107F30006D490201EC4C00212571020104490548FC -:107F4000054B064A08631A6348635A63704700BFCB -:107F5000784C0021694A0201EC4C00216171020158 -:107F6000034B044A1A65044B044A1A65704700BF64 -:107F7000784C0021414D0201EC4C00213D72020180 -:107F8000034B044A5A65044B044A5A65704700BFC4 -:107F9000784C0021CF4D0201EC4C0021D17302013D -:107FA000034B044A9A64044B044A9A64704700BF26 -:107FB000784C00211D4F0201EC4C0021B5740201E8 -:107FC000034B044ADA64044B044ADA64704700BF86 -:107FD000784C002141520201EC4C00217D750201D8 -:107FE00008B50849084800F093FD084B5A6922B9C2 -:107FF000074A5A61074B084A5A61084B084A1A60F7 -:1080000008BD00BF9D76020129760201784C00214F -:1080100029540201EC4C0021C9760201D04D002107 -:1080200075760201014B024A9A617047EC4C0021BF -:10803000C579020108B50749074800F069FD074BFB -:10804000074A5A61074B084A5A61084B084A1A60A6 -:1080500008BD00BF9D76020129760201784C0021FF -:108060007D560201EC4C00210D7A0201D04D002119 -:108070007576020108B50749074800F049FD074B2E -:10808000074A5A61074B084A5A61084B084A1A6066 -:1080900008BD00BF9D76020129760201784C0021BF -:1080A0002B570201EC4C00210D7A0201D04D00212A -:1080B00075760201034B044A9A60044B044A9A60A5 -:1080C000704700BF784C0021F3570201EC4C0021AF -:1080D000457A0201034B044ADA61044B044ADA612F -:1080E000704700BF784C00215D580201EC4C002124 -:1080F000E57A0201044BDA6922B9044ADA61044BD9 -:10810000044ADA61704700BF784C00219D58020193 -:10811000EC4C0021E97A020110B50E4B04460E4AE0 -:108120000E49002004F07AFE0D4804F085FE0D4B48 -:108130006C22184600210BF0F0FD3822047000215B -:1081400009480BF0EAFD094800F024FCBDE81040A6 -:1081500000F0EAB97D8402018D83020135830201BA -:108160000D850201644D0021404C00218D6B020100 -:1081700008B50749074800F0E3FC074B074A1A60B7 -:10818000074B084ADA60084B084ADA6008BD00BFAE -:10819000A57C0201217C0201D44D00217D7C0201DD -:1081A000784C0021D5590201EC4C0021E97C0201F8 -:1081B000054B1B681B79092B05D9044B044A5A64EB -:1081C0000022044B5A647047DC4D0021784C00219A -:1081D0001D5E0201EC4C0021034B044ADA63044BA0 -:1081E000044ADA63704700BF784C0021F35E020155 -:1081F000EC4C0021ED7C0201034B044A9A63044BD2 -:10820000044A9A63704700BF784C00213360020132 -:10821000EC4C00213D7D02012DE9F74F804607F02F -:108220005DFB10F0FF0502D007F0E6FB064618F0F4 -:10823000010F05D0394C204601A905F0ABFBB0BBBE -:1082400018F0020F08D0DFF8D89048460DF103016E -:1082500005F0A0FB044668BB18F0040F08D000200E -:10826000304C84F8280004F0EDFD636A03B19847B0 -:1082700018F0080F0AD001211020FEF77BFC28B16E -:10828000294B5B7E00F80239FEF760FC65B107F010 -:1082900025FB48B107F0B0FB314607F085FB234BC7 -:1082A0001A88824200D2188003B0BDE8F08F02F035 -:1082B000BFF9C0E76278237804F1030A03EB0223D5 -:1082C000ADF80430A378514601A88DF80630FBF7CD -:1082D000C7FE0746E8B9DFF858B05BF8043B9BB926 -:1082E00001371D2FF9D104210F20FEF743FC80B187 -:1082F0000122BDF80430023803711B0A8270C2707B -:108300004371FEF723FC04E0514601A8984700287A -:10831000E6D0204605F026FB97E700BF684D002118 -:10832000704D0021644D0021404C0021604D002122 -:10833000784C0021012838B50A46044616D0032897 -:1083400008D0D8B9104D014605F10C0005F00DFB21 -:10835000022111E00C4C002104F11C0005F005FB8A -:1083600010212078BDE8384005F0A0BB064D002163 -:10837000281D05F0FAFA21462878F3E70846BDE8FB -:10838000384005F0EFBA00BF644D002110B5044637 -:10839000022C084609D0032C65D0012C0FD105F022 -:1083A000E1FA204602F050F909E00B783E2B04D1A7 -:1083B0008B78162B3AD8012B08D805F0D3FABDE8F4 -:1083C00010402C4B0421187805F070BB023B142B95 -:1083D000F3D801A252F823F041840201BB830201C9 -:1083E000BB830201BB830201BB830201BB83020189 -:1083F000BB830201BB830201BB83020141840201F2 -:10840000BB83020141840201BB830201418402015A -:10841000BB830201BB830201BB8302014F840201C3 -:10842000BB8302015984020159840201223BDBB261 -:10843000062BC2D8012202FA03F313F0490FBCD075 -:108440000D4A92F83030013B82F83030B5E70A4AE5 -:10845000137E013B1376B0E7074A92F83130013BB7 -:1084600082F83130A9E705F07DFA012003F02EF8FB -:10847000A5E700BF644D0021404C00212DE9F341E8 -:10848000DFF87C80064698F828700D461446002FC9 -:1084900033D10DF1070108F1140005F07BFA68B142 -:1084A0000122437888F82820022202330127327003 -:1084B0002B802060384602B0BDE8F081114B1B686C -:1084C0005BB1984748B18378C278043303EB022349 -:1084D000012288F828200322E8E70B4B1B68002BB9 -:1084E000E8D098470028E5D08378C278043303EBBE -:1084F0000223012288F82820D8E70027DAE700BF06 -:10850000644D0021D44D0021D04D0021044B5A7EF2 -:108510002AB95876034B0821187805F0C7BA704776 -:10852000404C0021644D002110B5094C302200213F -:1085300004F108000BF0F1FB4FF0FF3241F6FF733E -:10854000C4E900231F220023C4E9042310BD00BF97 -:10855000404C0021C022A24B70B583F82E20282267 -:10856000042183F83720022283F83F104CF21701D0 -:1085700083F8382083F855200022A3F8421047F6EC -:10858000830183F856208022A3F84410102183F839 -:108590004F20944A83F85210506918B393F8291069 -:1085A000B3F84A4041F0200183F8291093F82B10CA -:1085B00044F4F87461F07F0183F82B1093F83310C2 -:1085C000A3F84A4041F0040183F83310222183F8D4 -:1085D0003810B72183F8441093F84C1041F008018B -:1085E00083F84C10116A29B1002840F0EB80CC21AF -:1085F00083F84310D16A41B1F72183F8421093F810 -:10860000431041F0030183F84310D16979B170B18F -:1086100093F8441041F0400183F844107F2183F81F -:10862000451093F8491041F0300183F849109168E2 -:10863000D1B193F84B4093F8505044F0780183F84F -:108640004B1093F84C1045F0040541F0060683F8F2 -:108650004C6083F8505038B164F0070441F00701D2 -:1086600083F84B4083F84C10916B41B193F84B1059 -:1086700041F0060183F84B10142183F85210D16B9E -:1086800029B1B3F84C1041F4F871A3F84C10116BF8 -:1086900089B193F84D4093F8501064F0010483F8C9 -:1086A0004D4093F84E4041F0030144F0030483F839 -:1086B0004E4083F85010516A41B193F84E10002893 -:1086C00040F08A8041F0600183F84E10516B29B16F -:1086D00093F84E1041F01C0183F84E10916A11B1CD -:1086E000FF2183F84F10116C29B1B3F8501041F4F9 -:1086F000FF51A3F85010516C59B193F8511061F02B -:108700001F0183F8511093F8521041F0030183F8D0 -:108710005210916C29B1B3F8521041F4F061A3F8F2 -:108720005210D16C29B193F8531041F0180183F81D -:108730005310116D29B193F8541041F0030183F8DF -:108740005410516D29B193F8531061F01F0183F853 -:108750005310D168A1B193F8301041F00C0183F8A7 -:10876000301093F8521041F0600183F8521093F8E2 -:10877000541061F0030183F85410072183F8551059 -:10878000916D11B13C2183F85610116E29B193F807 -:10879000551061F0070183F8551093F850101269D5 -:1087A00041F0180183F8501093F8561041F0010180 -:1087B00083F856102AB193F8572042F0030283F849 -:1087C000572070BDFC2183F8431093F8441041F00A -:1087D000080183F844100DE761F01F0174E700BF42 -:1087E000644D0021784C0021C30673B504460D4644 -:1087F00006D5084E30460DF1070105F0CBF830B92B -:108800002946204602B0BDE87040FFF705BD02F0E2 -:1088100051FEEFE7804D002110B504464C220021A7 -:108820000BF07BFA0F4B104A2360082322610222CF -:1088300023710423E2820D4AA373A261A3770C4A39 -:108840000C4BC4E9082342F21073A3874CF6DD13E6 -:10885000A4F84230084B636440F6E213A4F84830B1 -:1088600010BD00BFE807F149FB0040001900FB0004 -:10887000FB00000404001B00320000D8014B18600C -:10888000704700BFDC4D002113B5244C2073EAF77C -:1088900047FAEAF7AFFA00220023C4E90C23204B81 -:1088A00083F840201A601A719A711A721D4AD4E92D -:1088B000083112680DF1070192F83E00002818BF38 -:1088C0004FF48070034392F83F00002818BF4FF424 -:1088D0000060034392F8400092F84120002818BF3E -:1088E0004FF40070002A18BF4FF480620343134313 -:1088F0000DF10600236207F073F99DF90720236A42 -:10890000132ACCBF4FF4004200221343236203F02A -:10891000AFF902F087FC02B010BD00BF6850002123 -:1089200020500021DC4D0021F8B506460D4606F02A -:10893000D5FF074656B1002446FA04F3DB0702D5FB -:10894000E0B2EAF7B9FA01340E2CF5D115B1284698 -:10895000EAF76AFA06F0C2FF394607F025F8034B3A -:108960001A88824238BF1880F8BD00BFD84D002158 -:10897000042008B504F0EEFF014640B1FF23438018 -:108980000380034B187BBDE8084004F0F4BF08BD2A -:1089900068500021014B1860704700BF68500021EB -:1089A000044B1B6803B11B7B0370034B1B8A0B80BA -:1089B000704700BFDC4D002168500021044B1B684C -:1089C0000BB193F822300370024BDB890B807047A8 -:1089D000DC4D00216850002103230370014B5B8AAA -:1089E0000B8070476850002103230370014B9B8A62 -:1089F0000B8070476850002106230370014BDB8A0F -:108A00000B8070476850002130B5094D2C6864B167 -:108A100094F834400470286890F835001070054AC6 -:108A2000508B0880128B1A8030BD04701470F6E7EA -:108A3000DC4D00216850002130B5094D2C6864B12F -:108A400094F839400470286890F83A001070054A8C -:108A5000D08B0880928B1A8030BD04701470F6E7BA -:108A6000DC4D002168500021014B1888704700BF81 -:108A7000D84D002108B503F035FBBDE80840EAF702 -:108A800071BDEBF747BA08B503F02CFBEBF712FA10 -:108A9000EBF720FBEBF740FBBDE80840EBF758BBDA -:108AA00008B503F049FBBDE80840ECF737B9ECF72F -:108AB0003FBD08B503F040FBECF7F0FCBDE8084013 -:108AC000EDF75EBC08B503F0F7FABDE80840EEF735 -:108AD000EFBEEEF759BB08B503F0EEFABDE808406B -:108AE000EFF7F4B808B503F0E7FA03F0B3FABDE81E -:108AF0000840F1F715BCEFF723BE08B503F0DCFA28 -:108B0000BDE80840F1F7ACBEF3F76EB8F2F7F0B885 -:108B1000014BC3E9010170476850002108B503F01B -:108B2000A7FABDE80840F4F71BB808B503F0A0FAAF -:108B3000BDE80840F4F76EB8F4F7EEB9F4F748BCB6 -:108B4000014BC3E90A0170476850002108B5F4F7EA -:108B500011FF80B208BDF6F7F5B8F6F7A9B908B568 -:108B600003F0D4FABDE80840F6F748BA08B503F0B8 -:108B7000D7FABDE80840F6F75BBCF6F773BC000017 -:108B800008B504F085FD024BC3E90C0108BD00BF28 -:108B900068500021024BD3E90C2304F07FBD00BFD5 -:108BA00068500021F8B5244D06466B782BB1234B55 -:108BB0005B7CDA0701D50C20F8BDEB787BB1EAF7D6 -:108BC0006FFD04460028F6D11D4F3B683BB13B6862 -:108BD000E0B298470028EED10134032CF7D12B796D -:108BE0007BB1F4F7ABF904460028E4D1154F3B689C -:108BF0003BB13B68E0B298470028DCD10134032C3C -:108C0000F7D1304604F044FD01F44043B3F5404F42 -:108C100006460C4601D00B040CD404F053FE01238D -:108C2000EB7340F20113C5E908642B8204F056FE91 -:108C30000020C1E71220BFE7205000214051002151 -:108C4000E44D0021E04D002147F6EE5208B5831EA9 -:108C50009BB2934203D803F067FF002008BD1220A7 -:108C6000FCE7000008B5054B5A7C2AB1D3E908237C -:108C700004F014FD002008BD1220FCE72050002164 -:108C8000054B30B51C6825880580207908701B6865 -:108C90005B88138030BD00BFDC4D0021024BD3E95F -:108CA0000E2304F0E6BC00BF68500021024BD3E95C -:108CB0000A2304F0DEBC00BF2050002108B504F0F8 -:108CC000D4FC034621F4FF5020F01F0018B9034ADA -:108CD000C2E90A3108BD1220FCE700BF2050002184 -:108CE000034630B50C4C10461C4021F07E42224316 -:108CF00010D10A4AD2E9065428B100202B4321435F -:108D0000C2E9063130BD25EA030324EA0101C2E9C4 -:108D10000631F7E71220F5E7000001C020500021DE -:108D2000DDF70EBD10B5044B9C791CB9DDF70EFDC7 -:108D3000204610BD0C24FBE72050002138B5124B13 -:108D400005461B6808461B79082B03D8012D05D959 -:108D500012240AE0AB1EDBB2FC2BF9D90B4B9C7939 -:108D600084B9FF2D03D1DDF745FD204638BD04F061 -:108D70008FFC02460B462846DDF7F2FC002808BFB0 -:108D80000724F2E70C24F0E7DC4D002120500021FD -:108D900038B5124B04461B6808461B79082B03D8CC -:108DA000012C05D912250AE0A31EDBB2FC2BF9D950 -:108DB0000B4B9D797DB9FF2C03D1DDF721FD2846B2 -:108DC00038BD04F065FC02460B462046DDF7E8FCA2 -:108DD0000028F4D1E6E70C25F1E700BFDC4D0021C7 -:108DE0002050002103461C48F0B5D0E91025C3F1FE -:108DF0002004A3F12000DA4005FA04F4224325FA06 -:108E000000F0024312F0010FC3F1200CA3F1200285 -:108E10001DD0124E3078E0B9012505FA02F425FA8A -:108E20000CFE44EA0E0E05FA03F701FA02F221FAEB -:108E30000CFCD6E90A5442EA0C0225EA070524EAAA -:108E40000E04994029432243C6E90A12F0BD1120BD -:108E5000FCE70C20FAE700BF6850002120500021F9 -:108E600006F0BEBE06F0D8BE08B506F0E5FE002846 -:108E70000CBF1220002008BD38B5437882781B0251 -:108E800012049B182CBF012100210278C4780579B7 -:108E90009B184FEA046441F100011C1945EB0105E0 -:108EA0002046294602F063FE012808D915F4787F90 -:108EB00005D120462946BDE83840EAF77FB81220A0 -:108EC00038BD000008490246CB780879184306D11E -:108ED00012F0F80F05D122B1044B1A7270470C2022 -:108EE00070471220704700BF20500021F850002129 -:108EF0002DE9F041254D8046AB6A1A0654BF012684 -:108F000003265B0654BF0127032702F019FFC0B3F5 -:108F1000EC782B791C4334D1B8F80020B2F5804F9F -:108F200031D8B8F802309A422DD3032B2BD998F8B8 -:108F30000430012B27D898F80530BB4223D898F885 -:108F40000630B3421FD80C2004F004FD0146A8B13E -:108F500040F202434380B8F800308380B8F8023012 -:108F6000C38098F80430037298F80530437298F87B -:108F700006308372064B187B04F0FDFC2046BDE8EA -:108F8000F0810C24FAE71224F8E700BF20500021FA -:108F90006850002138B504460D4602F0D1FE20B9D4 -:108FA0000C20BDE8384002F02ABE012C06D10D4B42 -:108FB000587902F0ADFE08B91220F2E7062004F05D -:108FC000C9FC014660B10223002C837018BF012345 -:108FD000C370054B0571187BBDE8384004F0CBBC6D -:108FE00038BD00BFF8500021685000212DE9F74F2F -:108FF000DFF8E8A01646DAF828501F462A0654BFC4 -:109000004FF0010B4FF0030B6B0654BF01230323FA -:1090100080468946019302F09FFE002858D09AF8B6 -:1090200003409AF80420144352D16D0A05F0040558 -:1090300045F0010536EA05034CD1019B43454BD36E -:10904000CB4549D3002E47D016F0010537D07B8899 -:109050003A889A4240D3032B3ED93B79012B3BD827 -:10906000012316F004060BD006225343FA18518848 -:10907000FB5A8B4230D303292ED91379012B2BD8DD -:10908000FDB10020EAF790FF3B464A4641460020EA -:10909000EAF79EFF01250220BEB1EAF785FF06230D -:1090A0004A4603FB0573414602206E1CEAF790FF17 -:1090B00035468AF80C50204603B0BDE8F08F2B46A9 -:1090C000CFE72846EAF77AFFE5E7EAF777FFF0E728 -:1090D0000C24F0E71124EEE71224ECE720500021E5 -:1090E0002DE9F0414FF4A064214E5C43337B0A2507 -:1090F0007373002380460F465543B37302F02CFE72 -:1091000030B901230C207373BDE8F04102F0CEBEEC -:10911000B8F1010F10D1022F03D90123122073736C -:10912000F2E706D1002CF8D0002DF6D0A54203D3EB -:10913000F3E70CB1002DF9D1EAF718FF0028ECD0C5 -:10914000102004F007FC014680B10723B8F1000F9E -:10915000837014BF01230223C0E90254C370054B7E -:109160000771187BBDE8F04104F005BCBDE8F08153 -:10917000205000216850002170B5044602F0ECFD3B -:1091800010B90C26304670BDA378012B55D86378F2 -:109190000F2B52D82389B3F5FA7F4ED2237813F0E0 -:1091A000F80F4AD143F6F67263890A3B9BB29342A9 -:1091B00043D8237B1F2BE4D0EAF766FF0028E0D0DA -:1091C0006068A678657804F063FA02460B46284684 -:1091D0003146EAF761FF0646002830D1EBF77AFA0C -:1091E00005282ED8182004F0B5FB05460028C9D064 -:1091F00040F20B134380606804F04AFAC5E90201AB -:10920000A378EB716378AB71237803F001022A71C4 -:10921000C3F340026A7172B9C3F380032B752389CB -:1092200029462B8263896B82237B6B75064B187BE7 -:1092300004F0A1FBA6E70023F0E71226A2E70B2625 -:10924000A0E707269EE700BF6850002108B502F09E -:1092500083FD08B90C2008BDEAF736FA0028F9D0DA -:10926000402004F077FB01460028F4D040F20B23A5 -:109270004380034B187B04F07EFB0020EBE700BF2C -:109280006850002138B5054602F066FD10B90C247F -:10929000204638BDB5F5706F17D22846EBF72CFA8B -:1092A000A8B1EAF711FA04460028F0D1402004F0F2 -:1092B00051FB01460028EBD040F20D234380054BC3 -:1092C0000580187B04F057FBE2E71224E0E7422414 -:1092D000DEE700BF6850002170B505460E4602F07B -:1092E0003BFD10B90C24204670BDB5F5706F0ED251 -:1092F0002846EBF701FA60B1EAF7E6F904460028E0 -:10930000F0D131462846EBF7EFFA0028EBD11224D2 -:10931000E9E74224E7E70000F7B5044602F01CFD48 -:1093200018B90C25284603B0F0BD154BDB79002B8E -:10933000F7D12378012B01D91225F3E7237A0F2BDC -:10934000FAD8EAF7C1F90028EBD1606804F0A0F977 -:10935000237A0246009307460B4620780E46DCF738 -:10936000E3FC05460028E7D1237A3A4600932078AB -:109370003346DCF707FD002808BF0725D2E700BF0A -:109380002050002137B5054602F0E6FC18B90C2440 -:10939000204603B030BD0F4BDB79002BF7D12B7883 -:1093A000012B15D82B7A0F2B12D8EAF78DF904462A -:1093B0000028ECD1686804F06BF90B46297A024664 -:1093C00000912878DCF7FCFC002808BF4224DFE786 -:1093D0001224DDE72050002110B502F0BDFC10B9C9 -:1093E0000C24204610BD064BDB79002BF8D1EAF7A0 -:1093F0006BF904460028F3D1DCF7BEFCF1E700BFAF -:109400002050002110B5044602F0A6FC20B1DCF784 -:10941000ADFC2070002010BD0C20FCE7014B83F850 -:10942000300070472050002110B5044602F088FC3F -:1094300038B1054B93F9300006F008FC207000208D -:1094400010BD0C20FCE700BF205000212DE9F74F94 -:109450002D4C8946A16A15469DF83C2098464B063E -:1094600054BF0126032607469DF830A09DF838B06A -:10947000019202F065FC78B164786CB9012D019A13 -:109480000CD01F2F06D94F4504D8B9F5804F01D80D -:10949000042D06D9112433E00C2431E04645F9D3DC -:1094A00006E04645F6D3042D02D018F0020F05D091 -:1094B0000D9B002BEED0BAF1010FEBD81BF0F80F8B -:1094C000E8D1BBF1000FE5D0012D03D0042D01D070 -:1094D000032ADFD840F271214F4301FB09F10B4E03 -:1094E0000D98B760F160357486F8118086F812A087 -:1094F00086F820B086F8212004F0CAF8C6E90601F3 -:10950000204603B0BDE8F08F2050002140510021DB -:1095100038B504460D4602F013FCA8B11F2C15D82F -:1095200004F0D0F92246294609480AF0CFFB094B3E -:1095300083F84740012483F8484004F0CFF92046DF -:10954000EBF71CFA002038BD0C20FCE71220FAE7EC -:10955000685100214051002138B504460D4602F003 -:10956000EFFBA8B11F2C15D804F0ACF92946224610 -:1095700009480AF0ABFB0122084B83F8684083F8E6 -:10958000692004F0ABF90220EBF7F8F9002038BDB0 -:109590000C20FCE71220FAE78951002140510021FC -:1095A00038B5054602F0CCFB20B90C20BDE83840A8 -:1095B00002F016BB1D4C237C012B01D9042B07D1D3 -:1095C0001B4B1C4A1B68127893F822309A42ECD04D -:1095D000012D1CD1607C02F09BFBC0B9237C032BC6 -:1095E00013D1D4E90623A07CDCF74BFF68B104203B -:1095F00004F0B0F9014640B14FF4827343800E4B42 -:10960000187BBDE8384004F0B6B91220CEE704203C -:1096100004F0A0F9014638B10423002D837014BF73 -:1096200001230223C370EAE738BD00BF4051002187 -:10963000DC4D00212050002168500021014B83F8AF -:109640007800704740510021ECF73EB811B1C0B22C -:10965000ECF7FAB9EBF7CEB838B505460C4602F090 -:109660007BFB002847D0EF2D47D8D4E901128A426E -:1096700020D323881D2B04D01F291BD921498A42BE -:1096800029D813F0100102D0B2F5804F23D823F06F -:109690007F027AB903F01302032A0BD011B113F041 -:1096A000600F07D19A0601D5980703D1A37D19B1A0 -:1096B000012B09D012201FE003F0FD02012AF9D18D -:1096C000227E013A022AF5D8227E022A05D10E4ACC -:1096D000926AD20513D411200EE0032B01D0032A85 -:1096E00003D1094B9B6A1B05F5D521462846BDE8E9 -:1096F0003840ECF7ADB80C2038BD3020FCE7032B28 -:10970000EEE700BFC66D34002050002138B5054695 -:109710000C4602F021FB00284ED0EF2D4ED8D4E9A4 -:1097200001128A4220D323881D2B04D01F291BD964 -:1097300024498A422AD813F0100102D0B2F5804F92 -:1097400024D823F07F027AB903F01302032A0BD046 -:1097500011B113F0600F07D19A0601D5980703D114 -:10976000A37D19B1012B09D0122026E003F0FD02E0 -:10977000012AF9D1227E013A022AF5D8217E124827 -:109780000229D0E90A2003D1D10519D4112014E00F -:10979000032B01D0032901D11205F7D5C30505D448 -:1097A000E37E002BF2D1237F002BEFD12146284608 -:1097B000BDE83840ECF74CB80C2038BD3020FCE751 -:1097C000032BE8E7C66D34002050002181230B7085 -:1097D000EBF74CBF2DE9F041DDF8188004460D464B -:1097E00016461F4602F0B8FA48B13B4632462946B3 -:1097F0002046CDF81880BDE8F041ECF70CBF0C20F6 -:10980000BDE8F0812DE9F041DDF8188004460D46F1 -:1098100016461F4602F0A0FA48B13B46324629469A -:109820002046CDF81880BDE8F041ECF747BF0C208A -:10983000BDE8F0812DE9F347454E0746B37A0C4663 -:1098400015461BB10C21002002F0A6FB0023F37289 -:1098500002F082FA38B901230C21B37202B0BDE8DC -:10986000F04702F099BB062C33D804B98FBBA94648 -:109870004FF0000A544531D8002C46D0002F14BFB9 -:109880004FF001084FF0020800274FF00809DFF8F9 -:10989000C4A00C2004F05EF8014690B10A222B7897 -:1098A00080F80290038080F803806B885343436004 -:1098B0002B790372B37A9AF80C000133B37204F077 -:1098C0005AF80137BC4205F10605E2D802B0BDE8FE -:1098D000F087012312210020B372BFE799F800003E -:1098E000EBF782FEC846014638B949463846EBF7E1 -:1098F00063FE09F10609014620B10123B37298F80D -:109900000000ABE70AF1010AB4E768460094ADF83D -:109910000440EBF7BBFE4FF402770546DFF83480D6 -:10992000A542D3D90C2004F015F8014668B11DF802 -:10993000043047800380002343600372B37A98F8B1 -:109940000C000133B37204F016F80134E8E700BFED -:10995000205000216850002110B5044602F0FCF9A7 -:1099600050B140F27262054B00201B681B8A934283 -:1099700028BF1346238010BD0C20FCE7DC4D0021DE -:1099800010B5044602F0E8F928B10020034B1B682B -:109990001B7B237010BD0C20FCE700BFDC4D0021B9 -:1099A00010B5044602F0D8F920B12046BDE81040B9 -:1099B000ECF7D8B90C2010BD08B502F0CDF918B1FC -:1099C000BDE80840ECF7E8B90C2008BD38B50546FD -:1099D0000C4602F0C1F968B1EF2D0DD823886288DA -:1099E0009A420BD3052B09D921462846BDE83840B9 -:1099F000ECF734B80C2038BD3020FCE71220FAE731 -:109A00002DE9F04104460D4616461F4602F0A4F922 -:109A100058B1EF2C0CD8042D0CD83B4632462946C1 -:109A20002046BDE8F041ECF769B80C20BDE8F081B4 -:109A30003020FBE71220F9E738B505460C4602F066 -:109A40008BF928B90C212046BDE8384002F0DBBA7A -:109A5000EF2C01D93021F6E729462046BDE83840F1 -:109A6000ECF72EB9ECF7C6B9ECF7D3B910B44C1E2D -:109A7000012C05D8531E012B02D810BCECF7DFB91E -:109A8000122010BC70470278EF2A16D84288B2F52F -:109A9000706F12D20279012A0FD8427D1F2A0CD88A -:109AA00043F6F671C28A0A3A92B28A4205D8037E18 -:109AB000013B1E2B01D8EDF7A1BC30207047EDF71C -:109AC0003FBD000038B5254B04461B6893F83E2087 -:109AD00093F83F30002A14BF03220122002B0378A1 -:109AE00014BF04250025EF2B34D84078EF2831D857 -:109AF000A17801391E292DD86168194BA1F5807113 -:109B0000994227D82389B3F5805F23D240F69B7111 -:109B10006389053B9BB28B421CD8237B0F2B19D842 -:109B2000617B42EA050331EA030311D191B1A37BC2 -:109B3000012B0FD8E37B012B0CD8237C012B09D8F8 -:109B4000EBF78DFD40B12046BDE83840EEF7ECB8AC -:109B5000112038BD1220FCE74220FAE7DC4D00213D -:109B6000FFFE0F002DE9F041454B04469B691B02A7 -:109B700003784CBF02220422EF2B7CD84078EF28D8 -:109B800079D8A378013B1E2B75D866683D4BA6F5A6 -:109B9000807199426FD8238B93426CD3B3F5486F91 -:109BA00069D8A17E4A1E1E2A65D8A28BB2F5805FB5 -:109BB00061D2E78B7A1EFA2A5DD894F82020002A19 -:109BC00059D094F82120012A55D894F822E0BEF10A -:109BD000010F50D894F823506A1E062A4BD894F8E7 -:109BE000242002F1FF3CBCF10E0F44D894F825C0AC -:109BF000BCF10F0F3FD894F82680B8F1010F3AD886 -:109C0000BEF1000F08D140F2E24E0EFB03F3B3FBAE -:109C1000F6FE06FB1E3373BBBCF1000F02D0112011 -:109C2000BDE8F081072DFAD00829F8D8164E336820 -:109C3000DB8DBB42F3D3042AF1D86A439142EEDBB9 -:109C4000EBF75EFAC8B1326892F83E3092F83F20E6 -:109C5000002B14BF03230123002A14BF0422002277 -:109C6000134394F8202032EA0303D8D12046BDE8FC -:109C7000F041EEF76BB93020D2E74220D0E700BFC9 -:109C800020500021FFFE0F00DC4D0021EEF728BA26 -:109C90002DE9F041027D0446531E0F2B0E4602D9DA -:109CA0001220BDE8F081654B1B6893F83530934274 -:109CB000C0F0C280012300211D460A2791422DD306 -:109CC0002178EF29ECD861680DB9FE29E8D9B1F502 -:109CD000801FE5D2A1680BB9FE29E1D9B1F5801F3B -:109CE000DED2237B072BDBD8637B012BD8D8A37B69 -:109CF000012BD5D800210F20A3691D78EF2DCFD8D7 -:109D00005F88B7F5805FCBD29D88B5F5805FC7D2FD -:109D10003D43C5D09D7985B91120C2E7A06907FBF5 -:109D20000100B0F802C08088BCF1000F18BF002508 -:109D3000002818BF00230131C0E7DD79002DEBD0EA -:109D40001D7A01310F2D5D7A88BF18720F2D88BFE3 -:109D500058728A4203F10A03CFD800274FF00A084D -:109D6000227D97421AD300210A208A422FD140F641 -:109D70009B71238A053B9BB28B4291D8638A053B3A -:109D80009BB28B428CD800213046520009F0C5FFAF -:109D900031462046BDE8F041F0F7D6B8A56908FB8A -:109DA0000755E979A87901F097FC0028B4D0A97982 -:109DB00011F0F80FB0D1EB794A1E0A40591E194034 -:109DC0000A4323F007031343A6D10137C8E7A76965 -:109DD00000FB01777D8845B1BB79022B1AD0042B9B -:109DE0001BD0012B1DD10A35ED00BB8843B1BF79D3 -:109DF000022F18D0042F19D0012F1BD10A33DB00FA -:109E00006768AF42FFF44CAFA5689D42FFF448AFCE -:109E10000131AAE70B35AD00E7E7AD0105F5347573 -:109E2000E3E70025E1E70B339B00E9E79B0103F53E -:109E30003473E5E70023E3E7092032E7DC4D002136 -:109E40002DE9F0410E460446C27C00215200304606 -:109E500009F063FF484B9B691B0223784CBF022229 -:109E60000422EF2B00F2818063684449FF3B8B4260 -:109E70007BD8A368FF3B8B4277D8237B013B1E2B0B -:109E800073D8637B013B1E2B6FD8E38993426CD35D -:109E9000B3F5486F69D8237C072B66D8637C012B08 -:109EA00063D8A37C012B60D8E07C431E0F2B5CD8C9 -:109EB00062690021134640F6FB751F78EF2F54D8D6 -:109EC0005F88B7F5805F50D29F88B7F5805F4CD22E -:109ED000DF88AF4249D81F89AF4246D89F7A002F0A -:109EE00043D0DF7A002F40D01F7B0F2F3DD85F7B00 -:109EF0000F2F3AD80131814203F10E03DDD353789D -:109F0000117B994231D8527B9A422ED800274FF0CC -:109F10000E08E17C8F4209D300220E20914217D116 -:109F200031462046BDE8F041F0F78EB9656908FB7F -:109F30000755E97AA87A01F0CFFBC8B1AB7A13F0E4 -:109F4000F80F15D1EB7A13F0F80F11D10137E0E7D4 -:109F5000636900FB02331D7B0DB15D8855B15D7BEC -:109F60000DB19B8833B10132D8E73020BDE8F081D4 -:109F70001120FBE71220F9E72050002100FF0F001D -:109F80001C4B2DE9F041DB6A0646DB070C4625D465 -:109F90000C20BDE8F0812268D15B32F81320914299 -:109FA00026D001339D42F6D16368D85BD8F80030E3 -:109FB00093F82230834201D80220EAE7F1F7A8F9AA -:109FC0000028F9D06368D85BF1F7C6F90028DFD123 -:109FD0000135AE4206D900236F00E3E70025DFF824 -:109FE0001880F6E721463046BDE8F041F0F710BA98 -:109FF0001220CEE720500021DC4D0021F0F7D0B830 -:10A00000F0F7BCBCF0F78CBC38B504460D4603F045 -:10A0100059FC0C4B1B6893F82230A34206D87F23CF -:10A0200002242B7003F05AFC204638BD2046F1F77D -:10A030006FF90028F3D02046F1F798F90024287032 -:10A04000F0E700BFDC4D002170B506460C46154612 -:10A0500003F038FC104B1B6893F82230B34206D84B -:10A06000E22302242B7003F039FC204670BD3046F9 -:10A07000F1F74EF90028F3D0012C03D9E223122482 -:10A080002B70F0E724B93046F1F77CF92870EAE745 -:10A09000142300242B70E6E7DC4D002138B504467C -:10A0A0000D4603F00FFC0B4B1B6893F82230A342C4 -:10A0B00004D8022403F012FC204638BD2046F1F7F4 -:10A0C00027F90028F5D020462946F1F709FC00249D -:10A0D000F0E700BFDC4D002170B504460E46154682 -:10A0E00003F0F0FB0D4B1B6893F82230A34204D819 -:10A0F000022403F0F3FB204670BD2046F1F708F977 -:10A100000028F5D0042D06D820462A463146F1F71E -:10A1100041FC0024EDE71224EBE700BFDC4D0021F9 -:10A1200038B505460C4603F0CDFB0E4B1B6893F883 -:10A130002230AB4204D8022403F0D0FB204638BDC5 -:10A140002846F1F7E5F80028F5D02846F1F726F97A -:10A15000030A20706370030C000EA370E07021717D -:10A160000024E9E7DC4D002173B51D46104B044681 -:10A170001B68164693F82230834202D8022002B0B0 -:10A1800070BDF1F7C5F80028F8D00A4B25F07842E9 -:10A190003340134309D19DF81830204600933246CE -:10A1A0002B46F0F74BFE0020E9E71220E7E700BF5F -:10A1B000DC4D002141FBF7FFF8B52A4E0446336819 -:10A1C0000F4693F8222093F835301344984202DB6F -:10A1D00002252846F8BD824218D9F1F799F80028DF -:10A1E000F6D03368062093F82230A3422DD903F02D -:10A1F000B1FB0146C0B141F2017304804380077195 -:10A20000C480194B187B03F0B6FB0DE0F1F78AF818 -:10A2100005460028E5D12046F1F796F800B308205E -:10A2200003F098FB064608B90025D2E72046F1F76F -:10A2300081F842F2017373800B4B3080F4803771E8 -:10A240003146187B03F097FBC3E703F083FB01461D -:10A250000028E9D041F20F73048043800771D0E7F2 -:10A260000C25B6E7DC4D00216850002170B51D4B70 -:10A2700006461B680D4693F82230834202D802241A -:10A28000204670BDF1F744F80028F8D0152130467B -:10A29000F0F77EFD012801D10C24F1E73046F1F7FB -:10A2A0005BF8012803D1104B9B6A9B07F4D5284625 -:10A2B000F0F744FD04460028E2D1102003F04AFBE9 -:10A2C00001460028DCD041F2015343802B68068010 -:10A2D00043606B688360AB68C360044B187B03F01A -:10A2E0004AFBCDE7DC4D00212050002168500021C1 -:10A2F00070B5184B06461B680D4693F82230834212 -:10A3000002D80224204670BDF1F702F80028F8D0E8 -:10A3100001213046F1F796F8D0B12846F0F70EFD4E -:10A3200004460028EED1102003F014FB014600285B -:10A33000E8D041F6015343802B68068043606B6888 -:10A340008360AB68C360044B187B03F014FBD9E750 -:10A350000C24D7E7DC4D00216850002138B5134BA1 -:10A3600004461B680D4693F82230834201D8022030 -:10A3700038BDF0F7CDFF0028F9D001212046F1F7D4 -:10A3800061F880B1062003F0E5FA01460028EFD01D -:10A3900041F601634380064B04800571187B03F08E -:10A3A000EAFA0020E4E70C20E2E700BFDC4D0021E0 -:10A3B0006850002110B5124B04461B6893F82230F8 -:10A3C000834201D8022010BDF0F7A2FF0028F9D087 -:10A3D0001C212046F0F7DCFC01280FD0042003F0FC -:10A3E000B9FA01460028EED041F601434380054BFF -:10A3F0000480187B03F0BFFA0020E4E70C20E2E7BA -:10A40000DC4D002168500021F8B51E4F05463B6821 -:10A410000E4693F822301446834201D80220F8BD3C -:10A42000F0F776FF0028F9D01F212846F0F7B0FC9E -:10A43000012822D0A6F11B03E02B20D8B4F5A47F7D -:10A440001DD33B681B79082B94BF40F6480344F2A8 -:10A4500090239C4213D8082003F07CFA0146002880 -:10A46000DDD041F601734380074B05808680C480B0 -:10A47000187B03F080FA0020D1E70C20CFE71220F0 -:10A48000CDE700BFDC4D002168500021024B5A8807 -:10A4900002809B880B807047B4500021A0F11B0301 -:10A4A000E02B18D8B1F5A47F15D30D4B1B681A7992 -:10A4B000082A94BF40F6480244F2902291420AD8FA -:10A4C000DB8CFB2B28BFFB23834206D3054B588034 -:10A4D000998000207047302070471120704700BFDE -:10A4E000DC4D0021B450002110B5074C2468E48CE9 -:10A4F000FB2C28BFFB2404800E34E4000C80008871 -:10A5000010800A881A8010BDDC4D00212DE9F84327 -:10A51000284B15469A6A0446D70302D40C20BDE89E -:10A52000F883421E062A42D8AA1E232A3FD80027B3 -:10A53000C60744BF83F8411083F84450A00744BFC6 -:10A5400083F8421083F84550DFF86C806207DFF82B -:10A550006C9044BF83F8431083F84650D8F800301D -:10A56000BEB293F82230B34201D80020D7E730467C -:10A57000F0F7CEFEC8B13046F0F7EEFE012814D158 -:10A5800021213046F0F704FC0128C7D0062003F053 -:10A59000E1F9014648B142F201130680438004719B -:10A5A000457199F80C0003F0E6F90137D6E712205F -:10A5B000B5E700BF20500021DC4D0021685000218C -:10A5C00070B505460E4603F07DF9104B1B6893F8F5 -:10A5D0002230AB4204D8022403F080F9204670BD3B -:10A5E0002846F0F795FE0028F5D0094B9B6ADB035F -:10A5F00001D40C24F0E72846F0F7AEFE044600280C -:10A60000F7D131462846F0F70BFFE5E7DC4D002196 -:10A6100020500021014B1B68D88C7047DC4D002175 -:10A62000024B1B6893F82300704700BFDC4D0021EC -:10A63000034B1B780BB903F095B9F0F7DBBD00BFF6 -:10A64000B4500021F0F744BEF0F760BE10B5134BD4 -:10A6500004461B6893F82230834201D8022010BDC3 -:10A66000F0F756FE0028F9D02046F0F7A3FE43018C -:10A6700011D5062003F06EF901460028EFD042F212 -:10A680000133438002230371054B0480187B03F0E0 -:10A6900072F90020E3E71A20E1E700BFDC4D00215A -:10A6A0006850002101282DE9F843054635D8F1F717 -:10A6B00075F8044648B91A4A012D92F8403014BF83 -:10A6C000013303F1FF3382F840300027DFF8548074 -:10A6D000DFF85490D8F80030BEB293F82230B3427D -:10A6E00002D82046BDE8F8833046F0F711FE90B15D -:10A6F0003046F0F75FFE43010DD5062003F02AF93E -:10A70000014640B142F2013306804380057199F859 -:10A710000C0003F030F90137DCE71224E1E700BF59 -:10A7200020500021DC4D002168500021F8B50E4674 -:10A7300016210546F0F72CFB012802D10C242046F7 -:10A74000F8BD1A4B1B6893F82230AB4201D80224A3 -:10A75000F5E72846F0F7DCFD0028F8D02846F0F7AA -:10A76000FBFD04460028E9D1304602F07EFF104B85 -:10A77000D3E90E7607400E403846314601F0F7F92E -:10A78000012810D9102003F0E5F801460028D6D0A2 -:10A7900041F20163C0E902764380064B0580187BD5 -:10A7A00003F0E9F8CBE71224C9E700BFDC4D002134 -:10A7B00020500021685000212DE9F843304B044619 -:10A7C0009B6A0F465B0654BF0125032501F0B8FACA -:10A7D000002851D02288B2F5804F03D91226304686 -:10A7E000BDE8F88363889A42F8D3032BF6D923791E -:10A7F000012BF3D813B9A379AB42EFD86379AB42FD -:10A80000ECD83846F0F79AFA0028E7D1607901F0E1 -:10A810007FFA0028E2D0A06802F03AFF02468146A3 -:10A820000B46A0798846F1F765F9064630BB28202B -:10A8300003F090F805460028D1D040F2031343807E -:10A84000796800F1040C38682388ACE80300B86824 -:10A850002946CCF800002B8263886B8263796B7584 -:10A860002379AB75A379C5E9069885F82030054BA7 -:10A87000187B03F080F8B2E70C26B0E70B26AEE7B2 -:10A880002050002168500021042008B503F062F830 -:10A89000014678B1084B93F83330002B14BF0923DD -:10A8A000032383700223C370044B187BBDE8084068 -:10A8B00003F061B808BD00BF20500021685000219E -:10A8C0000C4A08B5926A0346520654BF012203227D -:10A8D000407890420BD89978914208D81B78012B88 -:10A8E00005D801F015FA003818BF012008BD002076 -:10A8F000FCE700BF20500021438802889A4204D31D -:10A90000032B94BF002001207047002070470000F7 -:10A910002DE9F84F04468946007A0021164601F0D9 -:10A9200026F9DFF868810546D8F828A001F014FA66 -:10A93000002800F0A68098F80470002F40F0A18055 -:10A940004FEADA134FEA5A2A03F002030AF0040A24 -:10A95000227A43EA0A0343F0010332EA030340F098 -:10A9600092801AB912273846BDE8F88F2046FFF7C3 -:10A97000A7FF0028F6D0BA464FF00C0B554555D826 -:10A980004FF0000A88F80CA0257A15F001055CD07C -:10A990005046F2F73FFD98F80C30324601334946F5 -:10A9A000504688F80C300125F2F748FD217A11F065 -:10A9B000020153D00C22002102FB05620120F2F7B4 -:10A9C0003DFD0135217A022011F0040A4BD0F2F747 -:10A9D00021FD0C2298F80C3002FB0562013388F847 -:10A9E0000C3009EB85010220F2F728FD606802F0C7 -:10A9F0004FFE237806460D46002B39D0182002F072 -:10AA0000A9FF01460028AED040F209134380237805 -:10AA1000037163784371A378C0E902658371237A77 -:10AA200003741B4B187B02F0A6FF9CE70BFB0A602C -:10AA3000F0F784F9002895D109EB8A00FFF75CFF55 -:10AA400000288FD00AF1010A98E72846F2F7ECFCBB -:10AA5000324629462846F2F7F1FCA7E732460120A4 -:10AA6000F2F7ECFCAEE7F2F7DFFC32465146BAE70C -:10AA700002460B46A078F1F73DF80028BED00B2720 -:10AA800071E70C276FE711276DE700BF2050002109 -:10AA90006850002110B51B210446F0F779F9012810 -:10AAA0000FD12046F0F734FC08B90C2010BD204629 -:10AAB000F0F790F90028F8D02046F0F79BF9002035 -:10AAC000F4E70E4B1B6893F82230A34201D8022012 -:10AAD000ECE72046F0F71CFC0028F8D0042002F038 -:10AAE00039FF01460028E1D041F601334380044B91 -:10AAF0000480187B02F03FFFE1E700BFDC4D00213E -:10AB0000685000211D4B30B59A88C46A01325888BC -:10AB100092B29A8008B182422ED201292CD01878A4 -:10AB2000012829D193F8C2116278914224D1D4F836 -:10AB30009C1093F8C1510A7822F0200295421BD153 -:10AB400093F8C0514A78954216D193F8C311227BED -:10AB5000914211D1D3F8D021D3F8CC1100FA02F5EB -:10AB6000013202F01F02C3F8D021054A0D42054B05 -:10AB700018BF1346A36030BD0020FCE7F04D002154 -:10AB800055555500AAAAAA0010B50F4B29B10429A2 -:10AB900014D05A8901325A8102E0DA880132DA800F -:10ABA0005988DA881C89588919B122440244914293 -:10ABB00008D91878831E5842584110BD1A890132AD -:10ABC0001A81EDE70020F8E7F04D00214FF40A72FA -:10ABD0000021014809F0A1B8F04D002103461046BC -:10ABE00010B400F8021B5370072922D8DFE801F0E7 -:10ABF0002B0409210C0F12151A460F2110BC09F065 -:10AC00008CB81A465521F9E71A46FF21F6E71A468D -:10AC10000021F3E71A46F021F0E71A46AA21EDE7F2 -:10AC2000092400F8012B013C05D1013BDBB2FF2BCD -:10AC3000F6D110BC704782EA1211090201F480714A -:10AC400041EA5202EFE740F2FF12EEE7022916D086 -:10AC5000032917D10530012A0BBF0001800100F53F -:10AC6000BF7000F5C870094A00F26930A0FB02020B -:10AC7000830F40F2712043EA8203584370470B3040 -:10AC80008000F0E70A30C000EDE700BFE3361A00AD -:10AC900050B10B2802D80138C0B270470C2805D03B -:10ACA000262805D80238F7E7252070472620704768 -:10ACB000272070472DE9F3477D4C05462378012B6B -:10ACC0000DD87C4F3A6852B93A7942B9012B0AD172 -:10ACD000027994F8C131032A03D1032B03D00C2647 -:10ACE00005E0032BFBD0AB78272B04D93026304668 -:10ACF00002B0BDE8F0872B79072BF7D86B795A1E85 -:10AD0000032AF3D8022B08D0033B012B09D8BB6AD6 -:10AD100013F4006F05D11126E9E7BB6A13F4807FB5 -:10AD2000F8E7AE79002EF6D10DF106000DF107011E -:10AD300004F056FF95F910007E2816D07F2817D111 -:10AD40009DF807302B74237813B95B4A6360536016 -:10AD5000287903281DD1012584F8C101257001F04F -:10AD60001DFF3D7200F0A4FFC1E79DF80630E9E742 -:10AD700000F17E03DBB2922BB8D89DF907308342F5 -:10AD8000C9DB9DF906308342C5DC04F05FFF2874FF -:10AD9000D9E702F097FDEB78002284F8C0312B79D7 -:10ADA00084F8C131A878FFF773FF84F8C2016B798A -:10ADB000013B032B08D8DFE803F0026B746D01231D -:10ADC00084F8C331A4F8C4212B7C4FF0000984F827 -:10ADD000D4314FF0FF33C4E9733902F07FFD23789B -:10ADE000012B84D049462C22344808F096FF40F2CB -:10ADF000011A49464FF00209DFF8C4804FF4C072CF -:10AE0000404608F08AFF2B882E4A63802E4B94F828 -:10AE1000C311A36294F8C23194F8C00184F84130A0 -:10AE20002A4B84F84D10C4E9112394F8D43194F8D6 -:10AE3000C42184F84230264B84F84E2084F84C100C -:10AE4000C4F8D830C4F8388084F82690A4F8E0A07C -:10AE5000FFF7FCFEA4F8E200504602F0E9FC0246CF -:10AE6000C4F8DC0010B32979E878FFF7B7FEB4F82E -:10AE7000E230C4F8C831012323703B7200F018FFA0 -:10AE8000484601F08BFEA8F1340002F075F82EE779 -:10AE9000022395E7032384F8C3310123A4F8C431C6 -:10AEA00092E7032384F8C3310223F7E71F261EE746 -:10AEB000F04D002120500021F44D0021FC4D0021D7 -:10AEC000304E0021294176715DB002015555550083 -:10AED00005AB02012DE9F041404F06463B68002BCF -:10AEE00076D13F4C3B792278134371D18378272B5D -:10AEF00070D8C3785A1E022A6CD80279012A69D800 -:10AF0000022B5BD0032B5FD07579002D5AD12C22F8 -:10AF10002946344808F001FF334B4FF4C0721846FD -:10AF2000294608F0FAFE3388A0636380022384F880 -:10AF300026302E4B2E4AA362012384F84030B0788D -:10AF4000FFF7A6FE2B4B84F84100C4E91123F378E8 -:10AF5000022B03D0032B01D0012B01D184F84D30FB -:10AF60004FF47A7240F2011094F84D3084F84C306E -:10AF7000214B1B689B8FA4F8E4005343C4F8D830DE -:10AF80001E4BC4F8DC3002F053FCC4F8E00018B3E8 -:10AF900001234FF002083B7284F8008000F088FE25 -:10AFA0000023174E40466360736001F0F7FD06F121 -:10AFB000080001F0E1FF2846BDE8F081BB6A13F408 -:10AFC000807FA1D11125F6E7BB6A13F4006FF8E783 -:10AFD0000C25F0E73025EEE71F25ECE72050002197 -:10AFE000F04D0021FC4D0021304E002149B10201FD -:10AFF0002941767155555500DC4D002189AB020180 -:10B00000F44D002138B5124D04462B78012B0DD19B -:10B0100095F8C10103280DD1002401F0D5FD0D4B99 -:10B020002C701C7200F04CFE204638BD022B0DD156 -:10B0300001F01AFE0323084A2B701CB1134603CB00 -:10B0400020606160002068605060EEE70C20ECE753 -:10B05000F04D002120500021F44D00212DE9F04158 -:10B06000364C0746A388628801339BB2C56AA38029 -:10B0700022B1934202D30020FFF7C4FF2378D5F812 -:10B080009C60012B3AD194F8C2216B78934215D180 -:10B09000337894F8C11123F0200399420ED194F82B -:10B0A000C0117378994209D194F8C3112B7B99424E -:10B0B00004D1B4F8C411AB7B99421AD000236A7052 -:10B0C00094F8C3116973297394F8C421EB73AA73BC -:10B0D00094F8C08108F102034046A5F8A030FFF7BC -:10B0E000B5FDA5F8A2003246404694F8C111FFF71D -:10B0F00075FD3846BDE8F04101F03EBF304602F034 -:10B10000BDFB022001F060FD207804280CD102F084 -:10B1100021FC014680B140F205134380084BBDE895 -:10B12000F041187B02F027BC0023064A23701372FB -:10B13000BDE8F04100F0C4BDBDE8F081F04D002154 -:10B14000685000212050002170B51F4C05466288D0 -:10B15000C66A4AB12189E3880B4461890B449A424B -:10B1600002D80020FFF74EFF2378022B04D1284697 -:10B17000BDE8704001F000BFD6F8A00002F07EFBF1 -:10B18000D4F8240220B102F0EDFB0023C4F82432ED -:10B19000022001F019FD207804280CD102F0DAFB1E -:10B1A000014680B140F205134380084BBDE8704072 -:10B1B000187B02F0E0BB0023054A23701372BDE840 -:10B1C000704000F07DBD70BDF04D00216850002141 -:10B1D0002050002108B5C07810B101280DD008BD5D -:10B1E0000A4B1B7A002BFAD0FFF70CFF084B1A789A -:10B1F000032AF4D104221A70F1E70023044A1370E1 -:10B20000024A1372BDE8084000F05ABD20500021E8 -:10B21000F04D0021024BC3F8CC010020704700BF65 -:10B22000F04D002108B5FFF7D1FC054B054A5A61E6 -:10B23000054B064A5A61BDE80840DBF717BA00BF64 -:10B24000040D0021CDAB0201B00C0021D5B10201EB -:10B250002DE9F0410F461821044690461D46EFF7B0 -:10B2600097FD012803D10C263046BDE8F081204629 -:10B27000F0F7ECFA0128F6D0194B1B6893F822304E -:10B28000A34201D80226EFE72046F0F741F8002854 -:10B29000F8D02046F0F760F806460028E3D11E20DB -:10B2A00002F058FB01460028DED041F6010304807D -:10B2B00043803B6800F10E0243607B68A0F80C807D -:10B2C00083602B4605F1100053F8044B834242F88B -:10B2D000044BF9D1034B187B02F04DFBC4E700BFD0 -:10B2E000DC4D00216850002108B50A4604F0E8F959 -:10B2F000002008BD38B51A4B05461B680C4693F86C -:10B300002230834201D8022038BDF0F701F800282E -:10B31000F9D02846F0F720F8012801D00C20F3E7F7 -:10B3200002212846F0F78EF80028F7D0142002F00A -:10B3300011FB01460028E7D041F601134380234664 -:10B340000580021D04F1100053F8044B834242F8BB -:10B35000044BF9D1034B187B02F00DFB0020D3E71F -:10B36000DC4D00216850002110B5154B04461B68C8 -:10B3700093F82230834201D8022010BDEFF7C8FFB6 -:10B380000028F9D02046EFF7E7FF012801D00C2074 -:10B39000F3E702212046F0F755F80028F7D0042003 -:10B3A00002F0D8FA01460028E7D041F60123438095 -:10B3B000044B0480187B02F0DEFA0020DDE700BFBA -:10B3C000DC4D00216850002138B50D4B04461B6848 -:10B3D0000D4693F82230834201D8022038BDEFF7A2 -:10B3E00097FF0028F9D02046F1F74AFC054BA0FB57 -:10B3F0000303800D40EA832028800020EEE700BF91 -:10B40000DC4D00216766060038B50D4B04461B680D -:10B410000D4693F82230834201D8022038BDEFF761 -:10B4200077FF0028F9D04DB10A2120466943F1F792 -:10B4300033FC002814BF00201E20EFE71220EDE7A8 -:10B44000DC4D002138B50B4B04461B680D4693F8C4 -:10B450002230834201D8022038BDEFF759FF00287F -:10B46000F9D029462046EFF7D5FC002814BF00206C -:10B470000C20F1E7DC4D0021014B1B68988D7047D3 -:10B48000DC4D0021024B1B6893F82A00704700BF77 -:10B49000DC4D0021F2F7FABC38B504460D46F2F750 -:10B4A0001BFD28B129462046BDE83840FEF7ACBD5B -:10B4B00038BD0000034B1B780BB902F053BAF2F70A -:10B4C00067BA00BFDC500021F2F7FCBAF2F73EBBCE -:10B4D000F2F73EBBF2F7A3BBF2F724BEF2F7A8BB2C -:10B4E000F2F726BCF2F757BC08B5F2F776FC00205D -:10B4F00008BDF2F79BBCF2F7A1BE4BF23F52431ED0 -:10B500009BB2934201D8F2F7A3BE1220704700000D -:10B5100038B504460D4600F01FFCA0B1B4F5706FBD -:10B5200013D22046E9F7E8F888B10B4B5B6ADB06DB -:10B5300003D405F00303032B0BD020462946E9F77B -:10B54000C1F9002038BD0C20FCE71220FAE74220A8 -:10B55000F8E71120F6E700BF6850002170B50446F7 -:10B560000D46164600F0F8FB30B13246294620461B -:10B57000BDE87040F3F7EEBB0C2070BD70B504461B -:10B580000D46164600F0E8FB30B13246294620460B -:10B59000BDE87040F3F72ABC0C2070BD2DE9F041E6 -:10B5A00007460C4615461E469DF8188000F0D4FB51 -:10B5B000D8B1032C1ED8104B5B6ADB0601D4032CD8 -:10B5C00016D0B5F5FA7F15D243F6F672A6F10A0346 -:10B5D0009BB293420ED833462A4621463846CDF8D0 -:10B5E0001880BDE8F041F3F745BC0C20BDE8F081C0 -:10B5F0001120FBE71220F9E76850002170B50446DE -:10B600000E46154600F0A8FBB8B1032C19D80E4B16 -:10B610005B6ADB0601D4032C11D0B6F5FA7F10D299 -:10B6200043F6F672A5F10A039BB2934209D80020B3 -:10B63000064BDC751E835D8370BD0C20FCE711207A -:10B64000FAE71220F8E700BF68500021B45000214B -:10B6500030B541EA020424F0070420F003052C432E -:10B6600008D1022B06D80D4B9B691C0604D518B9CE -:10B6700091420ED0112009E000F001030B430AD0E3 -:10B68000830704D4002A14BF0020122030BD0020FC -:10B69000FCE70029F6D11220F8E700BF2050002176 -:10B6A00070B50C4B04461B680E4693F822301546C5 -:10B6B000834201D8022070BDEFF72AFE0028F9D09E -:10B6C0002046EFF783FE30702046EFF78BFE2870A0 -:10B6D0000020F0E7DC4D00210B4B10B59A6AD40531 -:10B6E00002F4807303D440EA0104A40707D41305CD -:10B6F00007D4084380F00400C0F3800010BD184652 -:10B70000FCE70120FAE700BF2050002170B50D468C -:10B710000646114628461446FFF7DEFF98B100237F -:10B72000224629463046FFF793FF58B916F0010F1D -:10B7300018BF002516F0020F18BF0024034B1E751A -:10B740005D759C7570BD1120FCE700BFB4500021F1 -:10B750002DE9F8431D46244B80461B680F4693F89D -:10B76000223016468342BDF8209003D8022420469A -:10B77000BDE8F883EFF7CCFD0028F7D02021404644 -:10B78000EFF706FB01282AD029463046FFF7A4FF31 -:10B7900038B34B462A4631463846FFF759FF044630 -:10B7A0000028E4D117F0010F18BF00260A2017F077 -:10B7B000020F18BF002502F0CDF801460028D6D0B0 -:10B7C00042F201034380094BA0F8008007714671E3 -:10B7D0008571A0F80890187B02F0CDF8C7E70C241B -:10B7E000C5E71124C3E700BFDC4D002168500021EC -:10B7F00001282DE9F34104460D4616461F4627D879 -:10B80000DFF85080D8F8003033F0FF0304D098F808 -:10B81000313043B10C2014E098F80430002BF6D1FD -:10B820000D4B1B6883B9284601F032FFCDE9006754 -:10B8300002460B462046DAF78DFB002814BF002095 -:10B84000072002B0BDE8F08198470028DFD1EAE781 -:10B850001220F6E7205000211C500021012870B56D -:10B8600004460D4618D8104E336833F0FF0304D059 -:10B8700096F831303BB10C200FE03379002BF7D133 -:10B880000A4B1B6853B9284601F002FF02460B46DB -:10B890002046DAF7CBFB28B9122070BD9847002864 -:10B8A000E6D1F0E70020F8E7205000211C500021ED -:10B8B00010B50C4C236833F0FF0304D094F83130FA -:10B8C0003BB10C2008E02379002BF7D1064B1B6815 -:10B8D0001BB9DAF739FB002010BD98470028EDD1DD -:10B8E000F7E700BF205000211C50002110B504468E -:10B8F000DAF724FB2070002010BD30B50446012C7F -:10B900000846154685B015D801F0C2FE02460B4622 -:10B9100000200021CDE9020102A920460091DAF7BA -:10B92000B3FB48B1DDE90223284601F0B7FE002051 -:10B9300005B030BD1220FBE70220F9E730B5044620 -:10B94000012C0846154685B015D801F0A1FE024627 -:10B950000B4600200021CDE9020102A920460091FA -:10B96000DAF7A1FB48B1DDE90223284601F096FE93 -:10B97000002005B030BD1220FBE70220F9E70000EF -:10B98000012870B5054614D80B4E336833F0FF0319 -:10B9900002D00C24204670BD3479002CF9D1074B1D -:10B9A0001B6813B986F83150F4E798470028F9D09E -:10B9B000EFE71224EEE700BF205000211C500021C9 -:10B9C0004AF2B71208B5431E9BB2934203D8F3F76D -:10B9D0000FFB002008BD1220FCE700000128F7B58E -:10B9E00004460E46154624D8012A22D8124F3B6839 -:10B9F00033F0FF0304D097F831303BB10C2012E054 -:10BA00003B79002BF7D10D4B1B6873B9304601F021 -:10BA10003FFE009502460B462046DAF721FB002840 -:10BA200014BF0020022003B0F0BD98470028E2D1E7 -:10BA3000ECE71220F7E700BF205000211C50002146 -:10BA4000F3F77CBC0B46024670B598B008AD00F128 -:10BA500020062C4610685168083203C4B2422546BD -:10BA6000F7D110AC03F12005224618685968083355 -:10BA700003C2AB421446F7D16A461546084B03F1A0 -:10BA80002006144618685968083303C4B342224696 -:10BA9000F7D1294608A8F3F767FC18B070BD00BFBE -:10BAA0001851002170B5012A0B4698B004D118B086 -:10BAB000BDE87040F3F780BC024608AD00F12006F7 -:10BAC0002C4610685168083203C4B2422546F7D1AB -:10BAD00010AC03F12005224618685968083303C2E8 -:10BAE000AB421446F7D16A461546084B03F12006CF -:10BAF000144618685968083303C4B3422246F7D184 -:10BB0000294608A8F3F730FC18B070BD1851002181 -:10BB100010B5431E00F11F0113F8012F32B98B42FB -:10BB2000FAD1094B83F82120002010BD064B00F10B -:10BB300020011A4650F8044B884243F8044BF9D1CF -:10BB4000012382F82130EFE718510021012801D8A4 -:10BB5000F3F766BC1220704710B5044601F0BCFD37 -:10BB60002046BDE8104001F0D1BD01F0E1BD430821 -:10BB70004A0803F05533C01A02F0553261EB020156 -:10BB800000F03333800801F0333200F0333089089D -:10BB9000181801F0333142EB01024FF00131030973 -:10BBA00043EA02731B1842EB121003F00F3300F04C -:10BBB0000F301844A3FB013200FB0120000E704738 -:10BBC000B0FBF1F0704701380844B0FBF1F070476A -:10BBD000024B1B6803B11847184670476850002194 -:10BBE000002307B5ADF8043003238DF8070001A842 -:10BBF0008DF80630FFF7ECFF03B05DF804FB00237F -:10BC000007B5ADF8043004238DF807000DEB0300F1 -:10BC10008DF80630FFF7DCFF03B05DF804FB1FB5BD -:10BC20001C24ADF804008DF8090001A88DF8064029 -:10BC30008DF807108DF80810ADF80A208DF80C303B -:10BC4000FFF7C6FF04B010BD030203F00F3300F08E -:10BC5000F0300343180100F0333003F0CC331843C5 -:10BC6000830003F0553300F0AA301843C009704731 -:10BC700008B50D4B48220021184608F04EF803463F -:10BC80000A4AD2E90801C3E90A0105A1D1E9000184 -:10BC9000C3E906014FF0FF301F21C3E90E0108BDC3 -:10BCA000405C4600000000FE20500021685000214A -:10BCB000024A537A01335372704700BF205000216B -:10BCC000024A537A013B5372704700BF2050002153 -:10BCD000024A937901339371704700BF20500021CD -:10BCE000024A9379013B9371704700BF20500021B5 -:10BCF000024AD3790133D371704700BF205000212D -:10BD0000024AD379013BD371704700BF2050002114 -:10BD1000032806D8013802280ED8DFE800F0070D06 -:10BD20000700A0F1FF03584258417047034B587C6D -:10BD3000003818BF012070470120704720500021B3 -:10BD4000044B93F833201AB9012083F8320070476E -:10BD50000020704720500021044B93F832201AB97C -:10BD6000012083F8330070470020704720500021E5 -:10BD700000221346F0B5D0E90076C3F12005A3F107 -:10BD8000200427FA03F106FA05F5294326FA04F4FC -:10BD90002143C90744BF81180B7203F1010348BF57 -:10BDA0000132252BE9D180F82D20F0BD028EF8B5A7 -:10BDB000044682EA01001D46FFF746FF00EB001033 -:10BDC000104480B2FFF740FF00EB0010104480B237 -:10BDD000FFF73AFFD4E9003700EB0010111889B2E1 -:10BDE000618651404DF668524A43520D02EBC20043 -:10BDF00002EB80028A1A92B2C2F12006A2F1200060 -:10BE0000D34007FA06F6334327FA00F00343DB0773 -:10BE100009D494F82D305943090C0DB184F834102D -:10BE20002144087AF8BD45B1002304F1080111F856 -:10BE3000010B904203D184F83430D0B2F2E70133E1 -:10BE4000252BF4D1F9E738B5024690F83410408E2E -:10BE5000FFF7FAFE138E00EB001092F82D501844F5 -:10BE600080B283EA0004A5F10A035B100B2BA8BF84 -:10BE70000B23082D50868CBF0320681F012BB8BFF1 -:10BE800001238342B8BF0346A5EB430000FB0444F3 -:10BE9000C81800EB244080B2B0FBF5F305FB13009B -:10BEA00082F834001044007A38BD000007B50E4A0D -:10BEB000937B0BB900B19073537B8BB1013BDBB229 -:10BEC00053736BB90093ADF8043018238DF802302A -:10BED000937B68468DF803308DF80430FFF778FEC9 -:10BEE00003B05DF804FB00BF20500021002307B51C -:10BEF0000193192301A88DF80630FFF769FE03B0FE -:10BF00005DF804FB4FF4B8130360FFF761BE4FF414 -:10BF100000130360FFF75CBEF0B589B01446074616 -:10BF20000E461A22002101A81D4607F0F6FE1E2328 -:10BF30008DF8063023888DF80870ADF80C30237A20 -:10BF4000ADF80A608DF814306389ADF81630237BA4 -:10BF50008DF8183005B1657B237CE289A11C0DF1B9 -:10BF60000E00ADF81A208DF81C308DF8195001F034 -:10BF700077FB01A8FFF72CFE09B0F0BD002307B541 -:10BF800000931F23ADF8040068468DF80230FFF7D8 -:10BF90001FFE03B05DF804FB07B50E4AD37A0BB958 -:10BFA00001B1D172937A013BDBB2937273B91B2357 -:10BFB0008DF80230D37AADF800008DF805006846A0 -:10BFC0008DF803308DF80430FFF702FE03B05DF802 -:10BFD00004FB00BF205000211FB50024CDE901441F -:10BFE00003941A24ADF804008DF808000DF10A003E -:10BFF0008DF809108DF8064001F050FB01A8FFF7FD -:10C00000E7FD04B010BD1D2307B5ADF800008DF8A5 -:10C01000050068468DF802308DF803108DF8041085 -:10C02000FFF7D6FD03B05DF804FB10B5222486B0FF -:10C030000493089BADF804008DF8080001A8ADF842 -:10C040000640ADF80A10ADF80C200593FFF7C0FDCF -:10C0500006B010BD0022044B5A70044A126892F8D0 -:10C0600035201A70704700BFB0500021DC4D002110 -:10C0700008B50F4B28220021184607F04EFE0D4A46 -:10C08000126892F8231092F82420017042701B224B -:10C0900042804FF4A4728280032202750A224283F6 -:10C0A0004FF00112C2614FF44862828408BD00BFA4 -:10C0B000B4500021DC4D002108B5084B1C220021A2 -:10C0C000184607F02AFE064A1268528D02800322A3 -:10C0D00002754FF4FD52028308BD00BFDC50002101 -:10C0E000DC4D002110B5074C1022002104F108009E -:10C0F00007F013FE2346044A1068516803C3072360 -:10C10000237210BDF85000219A5B03014FF4617255 -:10C11000024B1A6000221A71704700BF10510021B3 -:10C120000022044B83F8202083F8212083F822206A -:10C13000704700BF1851002110B50B4C8022002120 -:10C14000204607F0EAFD7F231822002104F11000A9 -:10C1500084F87B3007F0E1FD044BC4E90233072388 -:10C1600084F8203010BD00BF40510021008813002A -:10C17000022807D0032808D001280AD1C80000F5FA -:10C18000837070478800D2307047880100F26640A3 -:10C19000704796207047022805D0032807D002F187 -:10C1A0000800C000704702F10900800070470129B3 -:10C1B0000CBF02230823D0001B30584300F5BC708D -:10C1C00070472DE9F0471D469DF824308146904682 -:10C1D0000846BDF820609DF828109DF82C70C3B962 -:10C1E000DFB1BFB2BE46E0B940F2011CACEB0703C1 -:10C1F000ACEB0E0C9BB21FFA8CFCB34214D3BA19F1 -:10C20000484692B2FFF7C7FF044604EB0800BDE8BA -:10C21000F0874FF0420E7746E5E74FF00A0E05270C -:10C22000E1E783B29C46E8E7B6FBFCF40CFB14663E -:10C23000B6B2002E08BF013C0EEB0C02484692B28B -:10C24000FFF7A9FF1FFA84FA05F596740AFB04F4B8 -:10C2500000FB0A44002ED8D0BA19484692B2FFF724 -:10C260009AFF0444D1E708B5FFF795FF00F59670F3 -:10C2700008BD00000E4B0246984209D80D4BA2FBA8 -:10C2800003031E205B085843824210D91E307047BA -:10C29000094BA2FB0303032000FB02334FF496700B -:10C2A000C3F38F235843824288BF00F596707047CE -:10C2B000C3BF0300121111119E36D0692DE9F04F52 -:10C2C000C76A05463B788846023B85B0072B00F2DB -:10C2D0001A81DFE813F008002700180118015E003A -:10C2E000AE00FB0010017E7BD7F89C30032E14BFFC -:10C2F0004FF4BC744FF4416483B1002197F8C92016 -:10C30000387BFFF748FFD7F8A030963404442BB1B0 -:10C31000032E14BF04F20E2404F6A644EC6005B00C -:10C32000BDE8F08F97F8B020B97B387BFFF733FF7B -:10C3300097F8B330044603F00102C3F34006C3F399 -:10C34000800333449E1800F0D7FC2044FFF792FF8F -:10C35000731E00FB0344D7F89C30002BDED09623DD -:10C3600073437A7B1819032A14BF4FF4BC744FF43B -:10C370004164D7F8A02004FB0604002ACED0002197 -:10C3800097F8C920387B1C44FFF705FF06FB0044E3 -:10C39000C4E797F8B8207E7BD7F8983042BB022ECE -:10C3A0001AD0032E1AD144F290224FF46D64026128 -:10C3B000002BB3D0F97B97F8B020002908BF0221E9 -:10C3C000387BFFF7E8FE9634022E204409D0032E76 -:10C3D0000AD000F6DE04A1E7EC24E9E74FF4E874A4 -:10C3E000E6E700F2BE4499E700F58644263495E777 -:10C3F000022E1AD0032E1AD144F290224FF4347434 -:10C400000261002B8AD0F97B2422002908BF022177 -:10C41000387BFFF7C0FE1022022104F59674044415 -:10C420003046FFF7B8FE044478E72C24E9E75024AF -:10C43000E7E731BB4FF0F4094FF0F108D7F8A84017 -:10C440003E7BB97B5CB10D223046FFF7A4FE7B7BBF -:10C45000022B18D0032B19D000F6DE049634AA6AFA -:10C46000C2B1B2F800A01FFA89F9D14514D3B7F8C8 -:10C4700098300D2B2CBF9A440AF10D0A1FFA8AF24C -:10C48000CEE78946DAE700F2BE44E7E700F58644E6 -:10C490002634E3E79246EAE7BAFBF8F708F1100220 -:10C4A0003046FFF778FE4FF496731FFA88F91FFAAB -:10C4B00087FB09FB17A203FB0B4492B200FB0B4462 -:10C4C000002A3FF42BAF0D3292B2A9E7836A83B101 -:10C4D0001A88402A38BF40220023387B0393B97B57 -:10C4E0000092CDE901311A461946FFF76AFE04466B -:10C4F00014E74022F0E70023387B0393BA7B0093D4 -:10C50000CDE90132EFE7002408E700002E4B2DE9CA -:10C51000F74F8446D3F804800346002001914FF082 -:10C520000109014613B903B0BDE8F08F5D6925B17B -:10C530005A7E012A03D1019A0AB95B68F2E79A6828 -:10C54000DCF80840161BDC68B6FBF8F23444B4FB98 -:10C55000F8F4D2B2E4B2A61A0136F6B23F2C009635 -:10C56000E1D8B5FBF8F515F0FF051ABFC2F140049C -:10C5700094FBF5F401244FF0000A1CBF0134E4B22F -:10C580005FFA8AF6B442D8D94FF0000E11E002EB00 -:10C590000E07A7F1200BC7F1200609FA0BFB29FAB9 -:10C5A00006F64BEA060609FA07F7384331430EF15F -:10C5B000010E009F5FFA8EF6B742E8D82A44D2B245 -:10C5C0000AF1010ADCE700BFC051002110B5094A99 -:10C5D000137B4BB90849906051F8044BA04204D931 -:10C5E000064951F82330536010BD0133082BF3D1B5 -:10C5F000FAE700BFC0510021A45B0301C45B030143 -:10C60000F8B5144D0746AB68084616460C2413B916 -:10C61000FFF7DCFF01E08B4203D1012304FB075449 -:10C6200009E040F27121B0FBF1F201FB12022AB1E4 -:10C63000002304FB075484F8493002E08342E7D327 -:10C64000EBD80C2303FB075585F84870C5E91306A2 -:10C650000120F8BDC05100212DE9F8430D461746D1 -:10C660009846294B0646186900284AD0436933B1D9 -:10C670000121FFF74BFF254B00245B6809E0406870 -:10C68000F2E7C2074FEA500040EAC17048BFE41821 -:10C69000490850EA0102F4D1DFF87090B8F1000FB8 -:10C6A0001BD04FF00C0808FB069898F84830B342AE -:10C6B00013D1D8F8506000F01FFBD9F80420D8F847 -:10C6C0004C303044B3FBF2F3DAB23F23B3FBF2F366 -:10C6D0005843A0422CBF0024241A00F00DFBD9F8C7 -:10C6E00004300744B5FBF3F5E9B23F25B5FBF1F59E -:10C6F00007FB0545B5EB831F34BF01200020BDE8D3 -:10C70000F8830446C8E700BFA8530021C0510021A8 -:10C71000F0220021014807F000BB00BFC0510021FA -:10C72000024640F27120B2FBF0F34343934202D140 -:10C73000984238BF184670472DE9F0410129064656 -:10C74000DDE9068740F271242ED1B3FBF4F14C43AE -:10C75000A24288BF1C4600252A461C48964250F833 -:10C76000041B06D0A14204D38B4202D38D4238BFB2 -:10C770000D4601320E2AF1D11DB9A34228BF23462E -:10C780001D46134C2378BBB9424629463046FFF775 -:10C7900037FF012818D123780436013344F8265096 -:10C7A00023708FB13D600FE0B2FBF4F14C43A24225 -:10C7B00088BF04F27124CEE7002342462946304662 -:10C7C000FFF74AFF0028DFD1BDE8F081D0510021FA -:10C7D000C0510021F8B5064640F271208342B1FBFA -:10C7E000F0F584BFB3FBF0F0B5FBF0F500245D433A -:10C7F000A94288BFED182346069F16489E4250F86E -:10C80000041B06D0A94204D38A4202D38C4238BF0B -:10C810000C4601330E2BF1D11CB9AA4228BF2A467F -:10C8200014460D4D2B785BB9331D45F82340079B0B -:10C830003A46214630461C60FFF7E2FE0120F8BD73 -:10C8400001233A4621463046FFF706FF0028F6D07E -:10C85000EAE700BFD0510021C051002138B50C23B8 -:10C860000F4D044603FB0053DA6CAB689A420FD1BC -:10C87000002318469C4206D005EB8302126912B1D0 -:10C88000904238BF104601330E2BF3D1FFF79EFEC6 -:10C890000023043445F824302B78013B2B7038BD3D -:10C8A000C05100212DE9F04F8DB01C469DF8583045 -:10C8B0008B4601939A4B90461D690A902E462EB9DD -:10C8C0000A980DB0BDE8F08F7668F8E77369002B21 -:10C8D000FAD03246537E012B01D0536913B9526806 -:10C8E000002AF7D1717E012901D0002103E0002A3E -:10C8F0001CBF164600213046FFF708FE019B099039 -:10C90000032B029165D00C23864A002703FB0B23DF -:10C91000D96C53683D46B1FBF3F91FFA89F30593CF -:10C9200001223B46DDF808E00999C2F12004A2F19A -:10C930002000D1400EFA04F421432EFA00F0014306 -:10C94000C9071FFA82FC49D59D4201D21D466746A0 -:10C95000002345E0AC423BD1AC68B068844208D2C9 -:10C96000214600F0CFF96B69B0FBF3F000FB033315 -:10C970001C446C4BB1685F68611AB1FBF7F0ED685D -:10C9800007FB101700F03F0400F0B6F924352844E7 -:10C990003844B368634E1844756805FB0404A34229 -:10C9A0008ED0444500F2AE802146404600F0AAF900 -:10C9B0000C2101FB0B66F36C4146B0FBF3F0013038 -:10C9C000C0B203FB00400DB0BDE8F04F00F09AB9D3 -:10C9D0006D68002DBED128462C46DAE701339BB2A4 -:10C9E0000132402A9ED10C234E4C03FB0B43D3F85B -:10C9F00050A000F081F982446068BAFBF0FA0AF1B5 -:10CA0000010A1FFA8AF306937B1B1FFA83FA00239D -:10CA10000E201C4608931FFA89F30B93002D6AD051 -:10CA20000028B6D0019B012B09D0022B05EB0A0789 -:10CA30002AD0BFB207EB0A04C4F34F0403E07B1B08 -:10CA40001FFA83FA5446059B1BB30B9BC4F1400CA1 -:10CA50009CFBF3FC0CF1010C1FFA8CF34FF0000E61 -:10CA600072460793039407991FFA8EF38B423CD3C7 -:10CA7000904284BFE3B20893019B88BFD0B2002BE1 -:10CA800036D1C5F34F05C9E7069BBFB2FC1AA4B265 -:10CA9000D9E70123E2E7039B4B44C3F120018C4615 -:10CAA000A3F120010491099909F1010921FA03F385 -:10CAB000029901FA0CF10B43DDF810C0029921FA3A -:10CAC0000CF10B43DB0748BF0132049148BF92B21F -:10CAD00006991FFA89F39942DDD8059B03990EF157 -:10CAE000010E19448BB20393BDE74FF00009EFE745 -:10CAF000013DADB292E700283FF44BAF2846BDF8A8 -:10CB0000204046E74146204600F0FCF80C2101FB9E -:10CB10000B66F36CB0FBF3F202FB1300D1E600BF2F -:10CB2000A8530021C0510021002310B5044C2373E9 -:10CB300040F2E2435843FFF749FD0123237310BD40 -:10CB4000C051002138B51823074D044603FB00539C -:10CB50001B6998470123204685F8813085F880407D -:10CB6000BDE8384002F0B3BCB0520021014B186060 -:10CB7000704700BF3453002108B502F07FFCBDE8C8 -:10CB8000084084220021014807F0C7B8B0520021B4 -:10CB9000014B5860704700BFB052002138B5094CB6 -:10CBA000054694F8813023B902F06EFC2846FFF761 -:10CBB000C9FF182305FB03331C446368013363601A -:10CBC00038BD00BFB052002110B5182400FB04414D -:10CBD0000B4B19444A68013A4A6093F8811071B1CD -:10CBE00093F8801081420AD14AB983F8812004FB6E -:10CBF00001335B699847BDE8104002F04DBC10BDA1 -:10CC0000B0520021002370B5164C054684F88230DE -:10CC100094F88130206083B194F88030AA7E9A42E3 -:10CC200014D0002284F88120182202FB03435B69A0 -:10CC3000984794F881304BB905E002F025FC94F850 -:10CC40008130002BE8D1A87EFFF77CFF1822AB7E55 -:10CC500002FB0344A3681BB12846BDE87040184797 -:10CC600070BD00BFB0520021064B186840B10022D1 -:10CC700018211A60827E01FB0233DB6803B118477A -:10CC8000704700BFB0520021014B1868704700BFC9 -:10CC9000B0520021034B1A6812B1012283F882209E -:10CCA000704700BFB0520021014B93F882007047DB -:10CCB000B052002110B5094C236833B19A7E182375 -:10CCC00002FB0333E35803B1984700232360012399 -:10CCD00084F882306368BDE810401847B0520021E4 -:10CCE000014B1B681888704734530021014B1B68A7 -:10CCF0009878704734530021014B1B68D8887047DF -:10CD000034530021401A20EAE070704730B51825EE -:10CD1000044C05FB00400361039BC0E90212436120 -:10CD200030BD00BFB0520021182300FB0333014A7D -:10CD3000D1507047B052002120B9064A136901331F -:10CD400013617047022801BF024A536901335361DE -:10CD5000704700BF38530021002210B5074C6168AE -:10CD600062600C22637A207A02FB03431B6A9847B5 -:10CD700020780121BDE8104000F098BE3853002112 -:10CD8000094B70B50C461546064600217022184620 -:10CD900006F0C3FF06708481C58129462046BDE8A0 -:10CDA0007040D6F77DB800BF385300212DE9F3411C -:10CDB000194D6F6847BB05264FF00C086C7A032CA1 -:10CDC0008EBF00240134E4B208FB04535B6A8DF883 -:10CDD00001700197ADF80270CBB101AA0DF102010B -:10CDE0000DF10100984790B1019B9DF801006B6027 -:10CDF00028726C72FFF7A0FF2046019BBDF802204D -:10CE00009DF80110D6F7C0F802B0BDE8F081013EF0 -:10CE100016F0FF06D3D1F7E738530021042830B5C8 -:10CE200006D80C25034C05FB0040C0E907124362FD -:10CE300030BD00BF38530021014B9861704700BFDF -:10CE400038530021034B596811B90120FFF7AEBFD9 -:10CE5000704700BF3853002110B5044608461146FC -:10CE6000FFF76AFF042C08D80C22064B02FB04349F -:10CE7000E36913B1BDE8104018470846BDE810400B -:10CE800000F070BD385300210B68416003600860FA -:10CE900003680BB158607047014B1861704700BFC1 -:10CEA000A85300214B6801604360486043680BB1A0 -:10CEB00018607047014B5861704700BFA8530021AC -:10CEC000074A03685169814206D1536113B10022B8 -:10CED0005A6070471361704742685A601360704728 -:10CEE000A853002110B5044602F086FD00F1190197 -:10CEF000A068FFF707FF003818BF012010BD38B544 -:10CF0000057E0B7E04469D4206D307D142B1904771 -:10CF1000231A5842584138BD0120FCE70020FAE7A7 -:10CF20001046F8E770B5134C23695B682361B3B111 -:10CF300000221A60A3698BB15D6802F05DFD0646B0 -:10CF4000FFF7DAFE2369A269304453B95360A3693D -:10CF500023619860A5610DB100232B6070BD6361F2 -:10CF6000E8E711699E6801448E42F7D353601A6066 -:10CF7000EDE700BFA85300212DE9F843044602F075 -:10CF80003BFD0746FFF7B8FE244D07442B69A76019 -:10CF90003BB9C5E90444C4E90033BDE8F84300F0F7 -:10CFA000A7BA9E68D4F80C80FFF7A6FEA6EB080689 -:10CFB000F61B361A002E0BDB2B78022B08D02046EE -:10CFC0002969FFF761FF2B69A342E6D0BDE8F8832A -:10CFD0002E692B69D6F80880B3420DD137695FB14D -:10CFE0004744FFF789FE73680744A7604BB9314691 -:10CFF0002046FFF757FFE6E7F768FFF77DFE474457 -:10D00000F1E79F68D4E90289FFF776FEC844A7EBF1 -:10D0100008073F1A002FEADA7668DAE7A8530021FA -:10D020002DE9F74F604E0446356989466DB9C6E96A -:10D030000400C0E9005501273369A34217D102F06B -:10D04000C3FC00F055FA12E01D46D4E9028AAF682D -:10D05000FFF752FED044A7EB08073F1A002F0FDB63 -:10D060003369AB4207D13378022B04D1002738460D -:10D0700003B0BDE8F08F29462046FFF705FFDAE749 -:10D08000A768D5E9028AFFF737FED044A7EB080767 -:10D090003F1A002F7BDA3369AB4202D13378022B7F -:10D0A000E4D02F467B6873B939464A462046FFF7DD -:10D0B00026FF0128074673D133699D4246D1A84611 -:10D0C0004FF0000A1CE0D3F80880D4E902ABFFF768 -:10D0D00013FEDA44A8EB0A08A8EB0008B8F1000F29 -:10D0E000E2DA4A4639462046FFF709FF0028BDD05C -:10D0F0007F68D7E7D6F81080FFF714FF86F800A006 -:10D1000033697BB1D3F80890D4E902B30193FFF7F8 -:10D11000F3FD019B9B44A9EB0B09A9EB0009B9F1B5 -:10D12000000FE7DB316921B9C6E90444C4E9001105 -:10D1300002E02046FFF7A8FEA946D9F820306D6826 -:10D140000BB148469847C145F6D175E7A846D5F8D2 -:10D1500000A0DAF804307BB1D3F80890D4E902B328 -:10D160000193FFF7C9FD019B9B44A9EB0B09A9EBB8 -:10D170000009B9F1000F04DB51462046FFF792FE8B -:10D18000DAE7DAF804804046FFF79AFEE1E76B68D9 -:10D19000002B7FF459AF29462046FFF783FE4AE76C -:10D1A00000287FF449AF61E7A85300212DE9F74F2C -:10D1B000876804467B18836088469146FFF792FE95 -:10D1C00068B9B9F1000F03DBA76003B0BDE8F08FC9 -:10D1D00002F012FC0746FFF78FFD0744A760394EA7 -:10D1E000336933B9C6E90444C4E9003300F080F977 -:10D1F0002BE09D68D4F808A0A5EB0A03002B11DBF7 -:10D20000D4F80CB0FFF778FDDA44A5EB0A052D1A27 -:10D21000002D07DB3378022B04D031692046FFF75D -:10D2200033FE0FE07369A568D3E902ABFFF764FD35 -:10D23000DA44A5EB0A052D1A002D08DB716920469A -:10D24000FFF730FE3369A342D0D00120BDE7356936 -:10D2500015B92846A760B8E7D5E902B3D4F808A005 -:10D260000193FFF749FD019B9B44AAEB0B0AAAEB34 -:10D27000000ABAF1000F06DAD5E902ABFFF73CFD70 -:10D28000DA445044A060D4F808B0ABEB07039845EB -:10D2900016D8994514D36B680BB92946CFE7D3F854 -:10D2A00008A0E3680193FFF727FD019B9B44AAEBCD -:10D2B0000B0AAAEB000ABAF1000F01DB6968ADE7BF -:10D2C0006D68C5E7A85300212DE9F74F3F4E8768E9 -:10D2D000D6F814A0BD180446894690468560BAF178 -:10D2E000000F09D1FFF7FEFDF8B1C6E90444C4E917 -:10D2F00000AA00F0FDF814E0DAE902BAFFF7FCFC3E -:10D30000D344A5EB0B052D1A002D0CDB2046FFF7AF -:10D31000E9FD50B120467169FFF7C4FD3369A342AE -:10D32000E7D0012003E0756925B90020A76003B0AC -:10D33000BDE8F08F2B681BBBD5F808A0D4F80CB063 -:10D34000FFF7DAFCAAEB0B0A3946AAEB0000FFF75D -:10D35000D9FC404528BF40463A188145A26033D8E1 -:10D36000AB689B1A002B2FDB2046FFF7BBFD58B3A1 -:10D370003378022B28D029462046FFF785FDCDE7DC -:10D38000D3E902ABFFF7B8FCDA445044A060204672 -:10D39000FFF7A8FD0028C8D03946A068FFF7B2FC07 -:10D3A000484511D380450FD3D4E902B3D5F808A07E -:10D3B0000193FFF7A1FC019B9B44AAEB0B0AAAEB8C -:10D3C000000ABAF1000FD6DA2D68ADE7A8530021A4 -:10D3D000144A10B5116904460B4603B910BD9C42AE -:10D3E00015D05B68F9E7BDE8104000F091B8FFF791 -:10D3F00099FD236A002BF1D02046BDE81040184764 -:10D400002046FFF75DFD236A002BF6D1E6E78C424C -:10D41000F6D11378012BE6D0022BE8D1BDE81040FD -:10D42000FFF738BCA8530021044B1A69824204D18B -:10D430001B78022B01D000F05BB87047A853002185 -:10D44000054B1A69824204D11878023818BF0120AE -:10D4500070470120704700BFA8530021074B82B0DE -:10D460005A68511C01F00301019101211A44107303 -:10D47000019A58785A6002B000F018BBA8530021F6 -:10D48000034B1B78022B02D10120FFF7E7BF704747 -:10D49000A8530021034B1B78012B02D10020FFF77A -:10D4A000DDBF7047A85300210F4B70B51E6900F017 -:10D4B00009FA02F0A1FA0546FFF71EFC29460446C8 -:10D4C000B068FFF71FFC04F11903984203D200F083 -:10D4D00005FA002070BDB0680449001B02F068FA2C -:10D4E00000F0FCF90120F5E7A853002195D40201D2 -:10D4F00008B5064B1B781BB1012B06D102F064FA6C -:10D50000BDE808400320FFF7A9BF08BDA8530021CC -:10D5100008B5064B1B78013B012B06D802F054FAE4 -:10D52000BDE808400220FFF799BF08BDA8530021BD -:10D530000022044BC3E90422C3E906221A701A84AC -:10D54000704700BFA853002108B5242200210348DA -:10D5500006F0E3FBBDE80840FFF7EABFA85300214F -:10D5600010B50446FFF7F0FF034B04485C70BDE8BC -:10D570001040FFF70DBB00BFA853002181D402016A -:10D58000F7B502F039FA03270646314CD4E90123F6 -:10D5900093420AD05A1C02F003020192019A2569B3 -:10D5A00023441B7BA2605DB9257002F025FA314649 -:10D5B000FFF7A8FB238C834238BF208403B0F0BD63 -:10D5C0002278012A05D0022A25D0E2B9032B1AD1EC -:10D5D00034E0022B23D0032B32D0A3B902232370D3 -:10D5E00002F00AFA00F11901A868FFF78BFB10B9E5 -:10D5F000EB7E012B0CD12846FFF704FBFFF754FB11 -:10D6000008B1FFF73DFF2369002BBFD12370BDE7B1 -:10D61000FFF77EFFF7E7012B06D0022BF3D1FFF7D0 -:10D6200081FC2B6A277003E0FFF77CFCEB69277015 -:10D630000BB1284698472369002BE4D001232370BF -:10D64000FFF732FF0028DED1FFF724FFDBE700BF42 -:10D65000A8530021014B188C704700BFA85300212C -:10D660000B6803608B8883807047034600685968A5 -:10D670007047110A02704170110C120EC2701A0A22 -:10D68000037142711A0C1B0E81708271C371704755 -:10D6900003794179006843EA01217047110A027059 -:10D6A00041700371110C1B0A120E8170C27043711C -:10D6B0007047000010B5074C11448A4201D1C043A5 -:10D6C00010BD12F8013B4340DBB254F8233083EA2B -:10D6D0001020F2E7E45B0301094B0A4A0A49C3E957 -:10D6E000001202F1636202F5682202F50D629A608F -:10D6F00002F1176202F5FC2202F5BA62DA607047A5 -:10D70000CC53002115CD5B0733134905074B026845 -:10D7100019685140196059685140596099685140E1 -:10D720009960D9684A40DA60704700BFCC53002145 -:10D73000084A936810685168536081EAC121D36830 -:10D74000D06080EAD040484080EA112093601060A9 -:10D75000704700BFCC5300212DE9F74F05460E4618 -:10D760000C2400F0D7F84FF0040B04FB0504DFF89D -:10D77000B4802D4BC8F800001D70043600F10C0A6F -:10D78000D8F8007000F0CCF820F003000744BC4249 -:10D7900003D9002003B0BDE8F08F002D3BD036F850 -:10D7A000042C032A20D82AF80CBC3AF80C7C16F872 -:10D7B000022C4AE90244BF080AF80A2CBF00012AD9 -:10D7C000D8F8009018D800F0ABF820F0030081449E -:10D7D0004C4506F104060AF10C0ADAD80023013D93 -:10D7E0002360EDB23C44CBE793071CBF22F0030259 -:10D7F00004322AF80C2CD8E7019200F091F820F0BE -:10D80000030081444C45C4D8019AE119013A2160D2 -:10D81000D2B20C46D3E7D8F80000044B201A1860A7 -:10D82000B8E700BFDC530021E4530021E05300219E -:10D83000F8B507460E4B1D680E4B1C780CB92646F2 -:10D840000EE02B88BB420FD300F03CF8AE684EB11F -:10D850003368094AAB6013680133136000F03EF887 -:10D860003046F8BD00F03AF8013CE4B20C35E5E78B -:10D87000DC530021E4530021E853002138B50E4A5F -:10D88000054614780C220D4B1B6802FB04340C3C3B -:10D89000A34200D938BD6268AA42F8D800F012F855 -:10D8A000A368074A2B601368A560013B1360BDE8BD -:10D8B000384000F013B800BFE4530021DC530021CE -:10D8C000E853002110B5044C23780BB903F05CF940 -:10D8D00023780133237010BDEC530021044A1378E0 -:10D8E000013BDBB213700BB903F050B9704700BFB6 -:10D8F000EC530021054A0330136820F00300034471 -:10D900001360034A1368181A10607047805B002187 -:10D910007C5B0021014B1868704700BF805B0021D1 -:10D92000014B1868704700BF7C5B0021034B044A21 -:10D930001868044B9B1A181A704700BF7C5B0021C3 -:10D94000485D002100F0002183071CBF20F0030088 -:10D9500004307047083008B580B2FFF769FF00B1A6 -:10D96000083008BD0838FFF789BF02F8041CA2F18F -:10D97000080100F03DB938B504460D4600F0C0F886 -:10D9800021462A46FFF7F1FF2046BDE83840012135 -:10D9900000F0A6B810B50C4600F03CF910B10379C0 -:10D9A0000830237010BD006810B1037908300B7087 -:10D9B0007047006818B119B90379083013707047BF -:10D9C00001390068C9B2F5E7F8B500252C46094EC3 -:10D9D000A6F16C0797F878309D4203D387F8794019 -:10D9E0002046F8BD56F8043B13B198470443E4B20F -:10D9F0000135EFE7605400212DE9F341FFF762FFA5 -:10DA00000023264C94F8686084F86830FFF766FFBE -:10DA1000F10708D504F1600738460DF10701FFF75B -:10DA2000B9FF054630B9B20715D4730719D402B04F -:10DA3000BDE8F0819DF807302946002054F82330D6 -:10DA400098472846FFF78EFFE6E7037B011D54F851 -:10DA5000233000209847002000F0D0F90028F4D1AE -:10DA6000E3E7102400270E4DA5F1400635F8023BF0 -:10DA70006BB133685BB1FFF725FF35F8028C25F8F1 -:10DA8000027CFFF72BFF0021404633689847013C9A -:10DA900014F0FF0406F10406E8D1C8E7F4530021AE -:10DAA00034540021FFF70EBFFFF718BF38B5044606 -:10DAB0000D46FFF707FF094B04F00F0093F86820AD -:10DAC000203033F8101042F004020D4383F8682030 -:10DAD00023F81050BDE83840FFF700BFF453002191 -:10DAE00010B50C46FFF7EEFE044B93F868100C439C -:10DAF00083F86840BDE81040FFF7F0BEF453002102 -:10DB00000048704754540021044A92F86930591C67 -:10DB100042F8230082F8691018467047F453002138 -:10DB2000044B93F8682093F8793013430CBF01201D -:10DB300000207047F453002108B57C2200210448DE -:10DB400006F0EBF801F0CAFE024B186008BD00BFFA -:10DB5000F4530021F0530021044B93F87820511C1A -:10DB600083F8781003EB8203D8667047F4530021E2 -:10DB700073B51D4D1D4E01F0B1FE296801F004FF83 -:10DB800009280CD90A23B0FBF3F403FB04F001F0DD -:10DB9000EFFE2B68034420462B6000F005F9FFF7E9 -:10DBA0002BFF96F879301BB1FFF70EFF0028E2D16A -:10DBB00001F094FE296801F0E7FE0928DBD802F0A5 -:10DBC000E3FFFFF7ADFF58B10DF1070000F008F9D2 -:10DBD0009DF8073003B118B10A23584303F050F8F9 -:10DBE00002F0D4FFC7E700BFF0530021F453002137 -:10DBF00038B5002304460B600D46FFF763FE23682B -:10DC00002BB925606560BDE83840FFF767BE6368E3 -:10DC10001D60F7E738B50446FFF754FE25681DB1CF -:10DC20002B68236003B96360FFF758FE284638BDB0 -:10DC300038B504460D46FFF745FE23682B6003B94F -:10DC400065602560BDE83840FFF748BE70B5064600 -:10DC50000D461446FFF736FE336813B17368A342CE -:10DC600007D129463046FFF7C3FFBDE87040FFF7F4 -:10DC700035BE24B929463046FFF7DAFFF5E72368B9 -:10DC80002B602560F1E770B504460D461646FFF798 -:10DC900019FE2368AB4209D12B6823606368AB424D -:10DCA00008BF6660BDE87040FFF718BE002EF5D0D3 -:10DCB0002B683360F2E710B50446FFF703FE00223D -:10DCC000236894B201321BB9FFF708FE204610BD4D -:10DCD0001B68F6E710B50446FFF7F4FD2468FFF76C -:10DCE000FDFDB4FA84F46409204610BDD0E900209B -:10DCF000131A5842584170470022084B10B51C684F -:10DD000004B910BD844202D022462468F8E72146B7 -:10DD10000248FFF7B8FF00236373F2E77054002155 -:10DD200038B504460D46FFF7BDFE637B13B12046B0 -:10DD3000FFF7E2FF012300226373094BA5601B6814 -:10DD400013B19968A94207D921460548FFF77EFF1C -:10DD5000BDE83840FFF7A8BE1A461B68F0E700BFD1 -:10DD6000705400210022024BC3E90022704700BF1B -:10DD7000705400214FF47A7359430A230931B1FBDF -:10DD8000F3F1FFF7CDBF0A230931B1FBF3F1FFF740 -:10DD9000C7BF10B50446FFF785FE2046FFF7ACFF6E -:10DDA000BDE81040FFF780BE70B500260546FFF7BE -:10DDB00079FE0A4B1C681CB9BDE87040FFF774BEC1 -:10DDC000A368AB4203D95B1BA3602468F3E702217D -:10DDD000207BA660FFF784FEF7E700BF70540021A8 -:10DDE000054A0346106808B9187070470121197078 -:10DDF00013689868704700BF7054002138B5FFF76A -:10DE000051FE0948046854B1A56845B92A4621461F -:10DE1000FFF739FF6573FFF747FE204638BDFFF770 -:10DE200043FE0024F9E700BF7054002113B518B178 -:10DE3000012823D002B010BD02221F4BC3F80823D3 -:10DE4000C3F80401D3F804210122DA6001239842C7 -:10DE50008DF8073042F2107118BF0023164A08BF30 -:10DE60000DF10703A0B10128E4D123B1D2F80C448D -:10DE700004F001041C70D2F80C4411E000220E4B97 -:10DE8000C3F80803C3F80021D3F800215860DDE788 -:10DE900023B1D2F8184404F003041C70D2F81844DB -:10DEA000E403C7D513B90139DCD1C3E79DF80740B6 -:10DEB000012CF8D0BEE700BF00500041044B1A7996 -:10DEC00022B9012218601A7102487047024870474F -:10DED000785400210000AD0B0C00AD0B094B1A6803 -:10DEE000920604D4E02283F8052320221A6002233C -:10DEF000054AC2F818350123C2F81435034A1370D5 -:10DF0000704700BF00E100E0005000418054002154 -:10DF100008B510B1012829D008BD194BD3F8182431 -:10DF2000D3F81814C9030CD4D3F81424D2070FD58E -:10DF3000D3F81C2402F00302022A06D1C3F80423FA -:10DF4000EAE702F00303022B02D00020FFF76EFF86 -:10DF5000022200210A4BC3F81825C3F80411D3F894 -:10DF60000411C3F8042301229A60D5E70022044B70 -:10DF7000C3F80021D3F80021C3F804031860CBE7ED -:10DF800000500041114B10B5D3F8002152B10020D0 -:10DF9000C3F80001D3F800210122C3F808230C4B79 -:10DFA0001B689847094BD3F804216AB1BDE81040BB -:10DFB0000022C3F80421D3F804210222C3F8082365 -:10DFC000034B01201B68184710BD00BF00500041E3 -:10DFD000785400210146014800F044BE6000002151 -:10DFE0000123044A83400146C2F80835024800F084 -:10DFF00059BE00BF00F000416000002110B504468A -:10E00000074B2146186800F023FE30B10120054B74 -:10E01000A040C3F80405044810BD0448FCE700BF55 -:10E020006000002100F000410000AD0B0400AD0BCA -:10E0300010B50446074B2146186800F009FE30B1C0 -:10E040000120054BA040C3F80805044810BD044852 -:10E05000FCE700BF6000002100F000410000AD0BB4 -:10E060000400AD0B036803F01F020260034A04487A -:10E070005B09012B08BF1046704700BF00088C41A8 -:10E0800000058C41F7B51746DDE90846019001A867 -:10E090001D46FFF7E7FF019B002F00EB830014BF35 -:10E0A00002230023002918BF43F00103002D14BFF1 -:10E0B0004FF00C0C4FF0000C002C43EA0C0314BF83 -:10E0C0004FF4706C4FF0000C002E43EA0C0314BFA9 -:10E0D0004FF4403C4FF0000CD0F8002243EA0C0310 -:10E0E00022EA030301B109780FB13F787F00194399 -:10E0F0000DB12D78AD0039430CB1227814020D43D7 -:10E100000EB1367836042C433443C0F8004203B0D5 -:10E11000F0BD1FB50DF10F03019300238DF80F1013 -:10E120001A4619460093FFF7ADFF05B05DF804FBF2 -:10E13000034B0C3033F81000C0F34010704700BFA1 -:10E140006400002170B50D4C00F10C0334F813305D -:10E150000546DA050E4607D5C3F3432304EBC30295 -:10E16000526854F83330984723692BB1314628461A -:10E170006269BDE87040184770BD00BF64000021AF -:10E18000124A0C3032F8103010B4D9051BD5C3F345 -:10E19000432123F4F85322F81030002002F1180430 -:10E1A00034F8023B13F4807F03D0C3F34323994236 -:10E1B00009D001303028F3D10023054810BC42F8C3 -:10E1C000313000F06FBD10BC704700BF640000210B -:10E1D000E000002138B50246FFF7AAFF0B4C02F120 -:10E1E0000C0560B1002134F815305B0B9B0003F186 -:10E1F000824303F52043C3F81015C3F810151046E9 -:10E20000FFF7BEFF002324F8153038BD640000215D -:10E21000F0B50446164685B019B3344D00F10C072D -:10E2200035F81720930703D4FFF782FF00285AD14F -:10E2300012F01C0F02D04B78012B54D001238DF823 -:10E240000F3000234A1CCDE9001320468B1C0DF132 -:10E250000F01FFF717FF35F8173043F0030325F8D8 -:10E26000173016B9224805B0F0BD204A04F10C075A -:10E2700032F81700830736D5002396F800C020F047 -:10E2800020004FEA8C0101F18241C00401F52041D8 -:10E29000C00CC1F8103522F81700C1F81035757898 -:10E2A000002DDFD0D1F81035B67823F4991323F47C -:10E2B000F853C1F81035D1F810E5230203F47C536C -:10E2C0002D0443EA0E0305F4403534052B4304F4D2 -:10E2D000801440EA4C30234340F02000C1F8103550 -:10E2E00022F81700BEE70348BDE700BF6400002125 -:10E2F0000000AD0B0400AD0B70B5124D044695F84F -:10E300008060EEB96022314605F1180005F005FD88 -:10E3100064010D4BE4B283F80A434FF480621A6043 -:10E320000A4B0B48C3F87C61D3F87C214FF00042C4 -:10E33000C3F80423012385F880300323EB6770BD05 -:10E340000448FCE76400002100E100E000A0004177 -:10E350000000AD0B0500AD0B0146014800F0A2BC6A -:10E36000DC0000210146014800F07CBCDC000021FB -:10E3700000232DE9F743914601221B4F00F10C08C1 -:10E380008DF800308DF8023037F818300446DB077E -:10E390008DF8012026D44E788D78964206D10190D2 -:10E3A00001A8FFF75FFE019B9E408660C5B14B78D8 -:10E3B0008DF804908DF806300B7801AA8DF80530A1 -:10E3C00069462046FFF724FF084B984205D137F8ED -:10E3D000183043F0800327F8183003B0BDE8F0830D -:10E3E0002A46EDE70248F8E7640000210000AD0B83 -:10E3F0000B00AD0B8B7873B506460D46D3B10DF10E -:10E400000700FFF7AFFF0D4B044698420FD1294696 -:10E4100030469DF80720FFF7ABFF094B04469842B2 -:10E4200005D1AB781BB19DF80700FFF795FF20469B -:10E4300002B070BDFF238DF80730E8E70000AD0B98 -:10E440000B00AD0B07B5019001A8FFF70BFE0123F0 -:10E45000019A9340836003B05DF804FB07B5019017 -:10E4600001A8FFF7FFFD0123019A9340C36003B0A9 -:10E470005DF804FB084B0C3033F810305B0B9B004D -:10E4800003F1824303F52043D3F8102542F0030241 -:10E49000C3F81025704700BF64000021084B0C3002 -:10E4A00033F810305B0B9B0003F1824303F52043EC -:10E4B000D3F8102522F00302C3F81025704700BFDF -:10E4C00064000021034B0C3033F81000400B800037 -:10E4D0003030704764000021034B0C3033F81000DB -:10E4E000400B8000603070476400002108B5024690 -:10E4F000FFF71EFEC0B10F4B02F10C0133F81130D3 -:10E50000990711D401225B0B9A400B499B0003F140 -:10E510008243C1F8082303F52043D3F8102522F0E5 -:10E520000302C3F8102508BD0021BDE808401046CD -:10E53000FFF7EFBD6400002100A00041104B00F187 -:10E540000C0233F8123013B5DB07044616D5FFF77B -:10E55000CDFF2046FFF73EFE01A80194FFF782FDA4 -:10E56000019B00EB8300D0F8003203F0E04343F05E -:10E570000203C0F80032034802B010BD0248FBE7B6 -:10E58000640000210000AD0B0400AD0B10B5024685 -:10E59000FFF7CEFD78B1094B02F10C0133F81140C1 -:10E5A000640B1046FFF7CAFFFF2C06D02046BDE8DB -:10E5B0001040FFF7D1BEFF24F3E710BD6400002137 -:10E5C0002DE9F04F002601223446614B6148624933 -:10E5D00087B01D6835B1D0F8045315421EBF1C60CA -:10E5E0001D68164304338B424FEA4202F1D1594B66 -:10E5F000D3F87C31002B00F08E80DFF86081584F1B -:10E60000D8F820300493C8F820303B6A05933B6269 -:10E610004FF000090DF1100B4FEA4913009348E049 -:10E6200094FAA4F4B4FA84F4009B4E4A1C4404F116 -:10E630000C0332F813300122E00804F0070C02FA50 -:10E640000CFC1BF80020C3F3820522EA0C020BF835 -:10E65000002003A899080394FFF704FD039A4B07D1 -:10E6600002F1800250F82220AA46C2F301422AD5C4 -:10E6700020465146D5B2FFF765FD03A80394FFF786 -:10E68000F1FC039B803350F82330C3F301439D42D8 -:10E6900007D100212046FFF73CFD29462046FFF721 -:10E6A00038FD03A80394FFF7DDFC0123039A934090 -:10E6B00003625BF82940002CB2D1B9F1000F1AD1E6 -:10E6C0004FF00109A8E7022A0CBF032102212046CE -:10E6D0000192FFF71EFD032D04D0019A022A06D1F4 -:10E6E000012DDED151462046FFF72CFDD9E7032A44 -:10E6F000D7D1022DF5E7174BC3F87C41D3F87C3115 -:10E70000D8F820200492C8F820203B6A05933B6289 -:10E7100013437FF47DAF012416B907B0BDE8F08F35 -:10E7200096FAA6F3B3FA83F304FA03F29B0003F11B -:10E73000824303F52043D3F81005D3F81015C0F336 -:10E740000520C1F3014126EA0206FFF7FBFCE3E7DF -:10E7500000A1004100A0004120A1004100058C4122 -:10E7600000088C416400002110B5094B1C796CB97C -:10E77000084C4001C0B284F812034FF4802020609E -:10E7800001201871044819609A6010BD0348FCE725 -:10E790008454002100E100E00000AD0B0C00AD0B43 -:10E7A000002330B50D4A50F8234003F5A271013320 -:10E7B000102B42F82140F6D10023084A00F1400115 -:10E7C00003F5B27451F8045B0133102B42F8245066 -:10E7D000F6D1D0F88030C2F8043330BD00200141BA -:10E7E0000123800000F1824000F590308B40D0F88A -:10E7F00010150B43C0F81035704700000C4B30B4B7 -:10E80000D3F80C0301240246002522B930BC094B81 -:10E810001A689968104792FAA2F3B3FA83F304FADC -:10E8200003F122EA010204499B00CD50EDE700BF4D -:10E83000002001418454002100210141114B10B5F9 -:10E84000D3F80443A2060AD5D3F814213AB1002024 -:10E85000C3F81401D3F814310B4B1B6898476306B7 -:10E860000ED5084BD3F8182152B1BDE81040002254 -:10E87000C3F81821D3F81831034B01201B6818473F -:10E8800010BD00BF005000419054002108B5FFF7B3 -:10E89000D5FFBDE80840FFF775BB00002DE9F04744 -:10E8A000002504460E464FF48038A946DFF884A0C0 -:10E8B00000F5A077D4F8043313EA080F0CD03B68B6 -:10E8C00053B1C4F84883C4F80883C7F800903B6884 -:10E8D000E8B25AF8263098470135042D4FEA480827 -:10E8E00007F10407E6D1D4F80433DA070CD5D4F8DD -:10E8F00000314BB10023C4F80031D4F800310D4B86 -:10E90000284653F826309847D4F804339B070ED591 -:10E91000D4F804315BB10023C4F80431D4F80431D5 -:10E92000044B052053F82630BDE8F0471847BDE8F2 -:10E93000F08700BF9454002100210148FFF7AEBFCB -:10E940000010014101210148FFF7A8BF006001410B -:10E950002DE9F843002406460F464FF48038A146BF -:10E9600000F5A0752B687BB1D6F8043308FA04F2E1 -:10E970001A4209D0C5F800902B68A30003F5A073D4 -:10E9800098B2D7E9003198470134082C05F1040505 -:10E99000E8D1BDE8F88300000C23F0B505792D4CD3 -:10E9A0006B43E71816463A7A002A51D19446E6504E -:10E9B0004B687B6047790368D6B2B7423BD8CA78C8 -:10E9C00043F307365201002EC3F30733D2B23ADBCA -:10E9D000214F07EB060C8CF80023012203F01F03E4 -:10E9E000760902FA03F347F8263003684A78D3F829 -:10E9F000040502F0030220F003000243C3F80425DB -:10EA0000D3F808058A7820F0030002F003020243DD -:10EA1000C3F80825D3F810050A7820F00F0102F09A -:10EA20000F020A43C3F810250C2303FB05440123FE -:10EA30000A482372F0BD960006F5A07643F806C09A -:10EA40009E590132B8E7064E03F00F03F254CCE7AB -:10EA50000448EFE79C54002100E100E00000AD0B0A -:10EA600014ED00E00500AD0B01220C2103681A60D3 -:10EA70000279034B01FB023302221A72704700BF76 -:10EA80009C540021012203681A6101790C20024B79 -:10EA900000FB01331A7270479C5400210268012068 -:10EAA0008B004033DBB2D05001F5A87152F8210041 -:10EAB000704730B54FF4803400688C4063B1002556 -:10EAC0008B0003F5A073C550C358C0F8044301F58B -:10EAD000A87140F8212030BDC0F80843F7E74FF493 -:10EAE000803302688B40C2F80833704701490248FE -:10EAF000FFF72EBF9C54002100C00041014902488D -:10EB0000FFF726BFA85400210080014101490248B7 -:10EB1000FFF71EBFB4540021009001411FB501232F -:10EB20008DF80030044BCDE90110D3E9001268469E -:10EB3000904705B05DF804FBC05400217FB5424BFF -:10EB4000D3F82421002A5FD00022C3F82421D3F86F -:10EB5000241102218DF80010D3F880146846C3F800 -:10EB600080140391D3F83C350293384BD968C3E93C -:10EB700006220191D3E900129047334AD2F844317A -:10EB800073B10021C2F84411D2F844312F4B986977 -:10EB900030B1C3E90611D2F83C05D968FFF7BEFFD2 -:10EBA000294AD2F82031ABB10021C2F82011D2F8A5 -:10EBB00020310123D360254B586958B1D2F84C2538 -:10EBC000684602929A688DF8001001925961D3E963 -:10EBD000001290471C4AD2F858319BB10021C2F86C -:10EBE0005811D2F85831194B586958B1D2F84C2500 -:10EBF000684602929A688DF8001001925961D3E933 -:10EC00000012904704B070BDD3F810110029B4D0A1 -:10EC1000C3F81021D3F810210C4A92F82160002E7D -:10EC2000ABD1D2E90604D16864B1D3F8005225F023 -:10EC30002005C3F8005213699461D360D661FFF7D1 -:10EC40006DFF9AE79461FAE700300141C05400215A -:10EC500082B001900198C840C04300F0010002B0AA -:10EC60007047000030B50268B2FA82F3C3F11F03A7 -:10EC7000DDB25BB25C1C0FD072B60468A24201D058 -:10EC800062B6F0E7012404FA03F322EA0302026009 -:10EC900062B602480D7030BD0148FCE70000AD0BC4 -:10ECA0000200AD0B0368CB40DB070ED4026872B6DE -:10ECB00003689A4201D062B6F8E7012303FA01F132 -:10ECC0001143016062B6024870470248704700BFB6 -:10ECD0000000AD0B0400AD0B0022D30003F1FF7365 -:10ECE00003F58033D3F80013013107D0D3F80013B4 -:10ECF0000132D3F80433202A0B60EED1144BD3F841 -:10ED00003021072A1AD1D3F83431023B032B0CD817 -:10ED1000104AD35C4BB1104BD3F80024D10742BF4B -:10ED20000022C3F81421C3F818210B4BD3F8002498 -:10ED3000D20744BF6FF00102C3F80024074B1A68E2 -:10ED4000074BC3F84425074B074A1A60704700BFBA -:10ED50000000FF01E45F0301005000410080FF015B -:10ED600000600041E80000210090D00380B400AFB3 -:10ED70001EF0040F0CBFEFF30880EFF3098000F0E2 -:10ED800065B800BFBD4680BC70470000012307B5D1 -:10ED90000093084B11205B68C3F30803103B0193F9 -:10EDA00000F06CFE009B002BFCD1019B03B05DF8D2 -:10EDB00004FB00BF00ED00E008B5174A174B1849E7 -:10EDC0008B421ED30021174B174A93421ED34FF09C -:10EDD000AF31164B164A93421BD3164A164B1A6094 -:10EDE000164B9B1A164A1360164A174B9A60FFF788 -:10EDF00073FF01F0CDFED3F77FFE4FF01800ABBEDE -:10EE000008BD52F8040B43F8040BD9E743F8041B80 -:10EE1000DBE743F8041BDEE7C864030100000021C0 -:10EE20008401002184010021485D002100F00021BF -:10EE300000000121485D0021805B002100F00021DD -:10EE40007C5B00210028000100ED00E007B51120E7 -:10EE500000F014FE01230093054B9B6AC3F380234B -:10EE60000193009B002BFCD1019B03B05DF804FBD8 -:10EE700000ED00E00020704700207047012070473F -:10EE80000020704700207047002070470346064A64 -:10EE90000333106823F00303C118116003490A68A3 -:10EEA000D31A0B60704700BF805B00217C5B0021A0 -:10EEB00010B5084B044693F82F2093F82E00824299 -:10EEC00003D093F8451001F0E7F92046BDE8104063 -:10EED00001F05CBBE8550021022905D0032908D0C8 -:10EEE00001290BD10088704703880089184480B23B -:10EEF000704703880289008A1344F7E700207047AF -:10EF000010B50446417E0D4B83F84E10007E01F093 -:10EF1000D3FA238B83B1204601F0D6FA04F1100016 -:10EF200001F0DEFA94F8280001F0E4FA94F82900E0 -:10EF3000BDE8104001F0E4BA10BD00BFE855002163 -:10EF40002DE9F743DFF840811F46B8F82830154611 -:10EF500001330646A8F8283018B1C31E012B00F271 -:10EF60008E80D8F84830B8F84C401B785A1CA24222 -:10EF7000B8BF03F1090498F84E30A8BF063403B1B6 -:10EF80000434032D39D0042D3AD0012D15BF01349E -:10EF90000234E400A400D8F8083001EB030998F823 -:10EFA000263083B398F810300C44022BC8F81C406C -:10EFB0002CD0032B4CD0012B5ED1B8F82C00C0F123 -:10EFC0009600044480B2C8F81C40FFF771FF032D7F -:10EFD00058D0042D14BF00230223042E98BF2B4ABF -:10EFE000009394BF905D01204B4600223946D8F82B -:10EFF0000440A04703B0BDE8F08305342401CAE70C -:10F00000A4015034C7E7D8F81C10CBE7D8F8183063 -:10F01000586801F013F9D8F81830986801F018F919 -:10F02000D8F81830587801F019F9D8F81800443099 -:10F03000FFF766FFD8F81400D8F80830B8F82010A9 -:10F04000C01AC8F81C000431023801F0A9FABEE762 -:10F05000D8F8183013B1587801F000F9D8F81C30FE -:10F06000B8F820109633C8F81C30D8F80C3094202B -:10F07000194401F0BDFAAAE701F0C4FAA7E74FF07E -:10F080000009A4E70123A8E7E8550021E85F030190 -:10F0900001292DE9F04104460F4603D14568284671 -:10F0A000BDE8F0810288022A23D1C368164E9D1E56 -:10F0B00033F8023C33860288756386F8382041684D -:10F0C000284604F003FE022FE9D92389E76894F863 -:10F0D00010801F444246394606F1390004F0F6FD1F -:10F0E0004246384686F844806169376404F0EEFD94 -:10F0F000D5E7064D4168284604F0E8FD20882289BE -:10F10000E1682844F2E700BFE8550021E4540021FB -:10F1100070B5324C0546238D0133238588B9237C95 -:10F12000022B27D0032B4AD0012B54D1E369608DE9 -:10F13000218C963303449430043180B2E36101F0B2 -:10F1400057FA606B30B194F83820254904F0BEFDC1 -:10F1500000236363206C30B194F84420214904F00B -:10F16000B5FD00232364281E236818BF0120BDE8D5 -:10F1700070401847A369586801F060F8A36998685F -:10F1800001F066F8A369587801F068F8A069443086 -:10F19000FFF7B6FE6369A2689B1AE361238D012B1A -:10F1A00009D194F82E0094F82F30834203D094F8BC -:10F1B000451001F071F8E06901F0AEF9C1E7A3690B -:10F1C00013B1587801F04AF8E36996209633E36169 -:10F1D000FFF76EFEB5E701F015FAB2E7E85500213A -:10F1E000185600212156002108B500F023FFBDE884 -:10F1F000084001F0C5BC000008B5044801F012F851 -:10F20000BDE80840024801F013B800BF11F1020147 -:10F2100041EF02017047000070B50546406801F0FB -:10F220000DF8A86801F014F8687801F017F895F95E -:10F23000020001F07FF801F011F92B7B434C022B07 -:10F24000A8704AD0032B51D00023E38540F6080371 -:10F250006384A3846B7B022B6AD0032B6DD00023C5 -:10F2600084F84530282323842E78012E6BD9043E60 -:10F27000012E8CBF002601262B7D8BB1082000F0CB -:10F28000D3FE687D3246C000A97D00F0F80001F091 -:10F29000E7FB287E05F1190101F0CAFB6B7DDB005D -:10F2A000638595F82C305BB1314695F82F0001F05D -:10F2B00029FC95F8300005F1310101F0B9FB10236C -:10F2C00094F82E0094F84510A38500F0E5FF05F1B1 -:10F2D0004400BDE87040FFF713BE40F20113E38520 -:10F2E00040F20443638440F60803B2E7AA7B012A94 -:10F2F00015BF042384F82E3084F82E30102318BF55 -:10F30000402384F82230502384F82430EB7B012BF7 -:10F310000BBF0323042384F82F3084F82F300CBF55 -:10F320001023402384F82330502384F8253091E7BC -:10F33000012384F84530142395E7022384F84530EF -:10F340004FF4A0738FE7012696E700BFE855002130 -:10F3500010B50FC8014C84E80F0010BDE85500211E -:10F36000024B07C883E80700704700BFF85500212B -:10F370002DE9F0410027124C0546A0680E4627856E -:10F3800001F0EAF800F048FF022817D1314628467C -:10F39000FFF77EFE314680462846FFF79DFD054675 -:10F3A0000146404601F088F994F8220094F82410B0 -:10F3B000093500FB051584F82670E561BDE8F0818C -:10F3C000E855002170B504460E46FFF761FE314650 -:10F3D00005462046FFF780FD04460146284601F019 -:10F3E0006BF9064B093493F8251093F8230000FBC2 -:10F3F0000414D9690C44DC6170BD00BFE8550021DC -:10F400002DE9F0414FF000080F4C431CA364A4F811 -:10F410004C10E3680F46218C06461944A068A4F8F6 -:10F42000288001F0E9F9012805460BD100F0F4FE2F -:10F43000032807D13946304601F002FAC4F81C808F -:10F4400084F82650BDE8F081E8550021034A431CAA -:10F450009364A2F84C1001F0F3B900BFE855002105 -:10F4600001F0D0B801F0CEB800F0FEBF01F006B850 -:10F4700001F04CB801F04AB8704700000022014B7F -:10F480001A70704738560021024A137801331370FE -:10F49000704700BF38560021024A13780BB1013B78 -:10F4A000137070473856002114230380962383700D -:10F4B0004FF47A7383804FF42F73C38040F2147338 -:10F4C000038140F201334381072303737047704780 -:10F4D00070B5062800F2AD80DFE800F00414204586 -:10F4E0005E1BA600544BD3F804321A0C0A708B70C2 -:10F4F0001A0AE823CB7007230B71C0234A704B71A3 -:10F50000012005E0012300220B704A708B70CB7044 -:10F5100070BD4A4BD3F800330B60F1E7002440F292 -:10F5200006450C81CD8340F20244FB2504234FF4B1 -:10F5300080724FF40170CC824D840C8540F2E2451C -:10F54000642408808B708A808B744A838A820B764D -:10F550000A8481F82430CD844C85888581F82E304A -:10F560000B73CA81CCE7344B0139D3F80462D3F86A -:10F5700008520023C3F12004A3F1200026FA03F26D -:10F5800005FA04F4224325FA00F008330243402B25 -:10F5900001F8012FEED1B3E7274BD3F804220A700C -:10F5A000D3F80422120A4A70D3F80422120C8A708B -:10F5B000D3F80422120ECA70D3F808220A71D3F8C5 -:10F5C0000822120A4A71D3F80822120C8A71D3F861 -:10F5D0000822120ECA71D3F80C0202F00F02087250 -:10F5E000D3F80C4242F04002240A4C72D3F80C4289 -:10F5F000240C8C72D3F80C42240ECC72D3F8104237 -:10F600000C73D3F81042240A4C73D3F81042240C24 -:10F610008C73D3F810321B0ECB7300F03F0363F0F2 -:10F620007F03CA710B726BE70120102308704B70C7 -:10F630006EE700206CE700BF0000FF010080FF01C3 -:10F6400000220C4BC3F80021D3F800110121C3F8AC -:10F650000421D3F804211960D3F8002102B17047C6 -:10F66000D3F804010028F7D0C3F80421D3F804210B -:10F67000F1E700BF00D00041036810B50C6863409B -:10F6800013604C684368634053608C6883686340D0 -:10F690009360C368C9684B40D36010BD002310B5A8 -:10F6A00000F11002103112F8014D43EA440301F851 -:10F6B000013D137882424FEAD313F4D110BD00000C -:10F6C00038B50C460D4B0E491032C1F8043500F127 -:10F6D000100111F8015D03F8015B12F8015D814230 -:10F6E000DD73F6D1FFF7ACFF064A04F1100312F800 -:10F6F000011B03F8011DA342F9D138BD3956002181 -:10F7000000D0004159560021F0B51C461368102C5A -:10F710000D4695B01BBA57D1D16809BA00919168CE -:10F72000526809BA12BACDE9022301913D4B3E4A13 -:10F73000C3F8042500F1100313F8011D834202F8F9 -:10F74000011BF9D110220021384804F0E6FAFFF736 -:10F7500077FF0CAA1646364B03F1100C17461868B3 -:10F760005968083303C763453A46F7D19DF93030ED -:10F77000002B2BDB304604A9FFF790FF9DF91030DA -:10F78000002B2DDB08A904A8FFF788FF102C31D12E -:10F790003246684604A9FFF76FFF1022002110A827 -:10F7A00004F0BBFA214A314610A8FFF765FFFFF7C6 -:10F7B00047FF1F4A05F1100312F8011B03F8011D52 -:10F7C0009D42F9D115B0F0BD0093AFE7304610A9C6 -:10F7D000FFF764FF174904AA10A8FFF74DFFCDE714 -:10F7E00010A904A8FFF75AFF124908AA10A8FFF7AA -:10F7F00043FFCBE7002280211346E4B210A89442D5 -:10F800000BD91DF8027007700132102A00F10100B7 -:10F81000F5D1324608A910A8BDE70CBF01700370EE -:10F82000F2E700BF00D000413956002149560021BF -:10F8300059560021ED5F030101220A4B10B51A60F1 -:10F8400000220144884202D101225A6010BDC3F84F -:10F850000021D3F80041002CFBD0D3F8084500F874 -:10F86000014BEFE700900041024B40F00040C3F82D -:10F87000CC0170470080014113B56B46124C134A0E -:10F8800092E80300124A83E8030019462046FFF776 -:10F8900083F820460F4CFFF7E7F82046FEF79AFB67 -:10F8A00023780D4A43F00043C2F89031237802F5E3 -:10F8B000C04243F00043C2F88C302078FEF79EFB34 -:10F8C00000F09CF802B010BD086003010060030165 -:10F8D000D5F90201695600210020014101210148AA -:10F8E000FFF7DCB80860030110B5044601F04CF9DD -:10F8F000FFF7F4FF201A192809D4074800232246ED -:10F900000321FFF7D6F801F041F9012010BD01F005 -:10F910003DF90020FAE700BF0860030170B5044616 -:10F92000104BD3F81055FFF7D9FF0F4B4FF47A5116 -:10F93000A34228BF2346A3FB0131EAB2C2F120054E -:10F9400001FA05F5A2F1200423FA02F221FA04F4E7 -:10F950002A43224302440123BDE8704000210348AA -:10F96000FFF7A7B8008001417085410008600301DE -:10F9700008B504494FF47A720023A0FB010103F09B -:10F98000D7FF08BD40420F00411A08B508D44FF414 -:10F990007A700023A1FB0001024A03F0C9FF08BDF1 -:10F9A0000020FCE740420F00401A20EAE070704758 -:10F9B000034B02461960034801230221FFF779B87F -:10F9C0006C5600210860030102210148FFF787B847 -:10F9D0000860030110B50446102000F04FF8B4F59C -:10F9E000A47F06D1FFF7F0FFBDE81040014B1B6874 -:10F9F000184710BD6C560021FFF770BF042108B5F1 -:10FA00000846FEF7EDFE0122014B1A6108BD00BF5A -:10FA10000020014107B5302200210E4804F07DF995 -:10FA20000D4B01A91A889B781C20ADF804208DF895 -:10FA30000630FEF7DFFC01A91D20FEF7DBFC01A963 -:10FA40001E20FEF7D7FC01A91F20FEF7D3FC03B050 -:10FA50005DF804FB705600211060030108B51C20FE -:10FA6000FEF794FD1D20FEF791FD1E20FEF78EFD92 -:10FA7000BDE808401F20FEF789BD000010B5174CF7 -:10FA8000637893B1162805D804EB4000837813B14E -:10FA9000012B05D010BDC078BDE81040FEF7DEBCDC -:10FAA000C078BDE81040FEF7CDBC10280DD004D8BA -:10FAB00048B10128EED11D20EEE7112807D0162805 -:10FAC000E8D11F20E8E71C20E6E71E20E4E71F201E -:10FAD000FEF7C4FC01232370DCE700BF7056002151 -:10FAE000134B5A7872B1162820D803EB4000837864 -:10FAF00013B1012B03D07047C078FEF7A3BCC078C8 -:10FB0000FEF7ACBC10280BD003D828B1012805D0D3 -:10FB10007047162806D070471C20EEE71D20ECE742 -:10FB20001E20EAE71B780BB91F20E6E7704700BFED -:10FB30007056002116282DE9F34180460E461746DF -:10FB40002ED8184D6B785BB9FF290DD001246C704D -:10FB5000FFF784FFA64210D9012002B0BDE8F08172 -:10FB600001290AD9FF29F7D105EB4805EB78BB42FB -:10FB700016D13846FEF70AFDEEE70B4B05EB4805BC -:10FB80001A889B783846AE70EF7001A9ADF8042052 -:10FB90008DF80630FEF72EFC4046FFF7A1FFDBE7AD -:10FBA0000020DAE77056002110600301054B188829 -:10FBB000054B00F5A06080B2A0FB0303800D8038E8 -:10FBC00040B27047EE000021676606000023024A3B -:10FBD0001380024A13807047EE000021EC000021E0 -:10FBE000F8B50746FFF7E2FF0A4B0E46D3F8083593 -:10FBF00013F0010F14BF03240024044401F006F99C -:10FC0000054601F001F9E4B2283D254404443D7065 -:10FC10003470F8BD0040004118B1054BB3F9003015 -:10FC2000038019B1034BB3F900300B80704700BF5C -:10FC3000EE000021EC000021024B1880024B012055 -:10FC400019807047EE000021EC00002138B52D4BE3 -:10FC50000546D3F80835002213F0010F14BF032125 -:10FC60000021FFF7A3FF01440423CCB2284649B288 -:10FC700001F0CEF8231858B28542DAB204DA431EF6 -:10FC80009D4202DB501E40B238BD831E9D4201DB07 -:10FC9000901EF8E7C31E9D4201DBD01EF3E7031F51 -:10FCA0009D4201DB101FEEE7431F9D4201DB501F09 -:10FCB000E9E7831F9D4201DB901FE4E7C31F9D42DC -:10FCC00001DBD01FDFE7A0F108039D4202DBA2F1B8 -:10FCD0000800D8E7A0F10C039D4202DBA2F10C0062 -:10FCE000D1E7A0F110039D4202DBA2F11000CAE7A8 -:10FCF000A0F114039D42ACBFA2F11400A2F12800B0 -:10FD0000C1E700BF0040004110B5044601F090F883 -:10FD1000012804D10022094BC3F8002510BD032C93 -:10FD200004D10120054BC3F80005F7E724B9034BC4 -:10FD30000120C3F80045F1E70020EFE70040004153 -:10FD400001F09AB8074B93F84B20074B012A05D0D6 -:10FD5000022A05D0E322C3F820257047A322FAE740 -:10FD6000C322F8E7D859002100E0004130B52C4A01 -:10FD700092F8223092F821101B0443EA012392F8F2 -:10FD8000201092F827500B4392F82310002992F884 -:10FD9000241018BF4FF4801443EA815392F82510C1 -:10FDA00008BF002443EA016392F8261043EA457332 -:10FDB000002914BF4FF08061002123430B431949F0 -:10FDC000C1F8143592F82A3092F829401B0443EA0E -:10FDD000042392F82840234392F82B4092F82C20D9 -:10FDE000002C14BF4FF080740024002A14BF4FF081 -:10FDF0000072002223431343C1F818350A4BC1F89F -:10FE00001005D3F81042094A944207D104280CBFC8 -:10FE1000D3F88430D3F88030C1F8883530BD00BFC6 -:10FE2000D8590021008000410000FF0141414B51A1 -:10FE3000054A064B9069D3F854351B1AD08F1B1A0C -:10FE4000B2F84000181A7047D859002100900141BB -:10FE50000246012302210148FEF72BBE1C6003016C -:10FE600002210148FEF73BBE1C60030110202DE972 -:10FE7000F047FFF703FE674BD3F8002152B1002291 -:10FE8000C3F80021D3F80031634B1B78022B3ED01E -:10FE9000032B40D05F4BD3F8042152B10022C3F8AA -:10FEA0000421D3F804315C4B1B78032B01D1FFF7FD -:10FEB000D7FF584BD3F86C219AB100251220C3F814 -:10FEC0006C51554CD3F86C31FFF70AFE1320FFF745 -:10FED00007FE94F80080B8F1020F1ED0B8F1030FAE -:10FEE00027D04C4BD3F83C21002A00F09080002210 -:10FEF000C3F83C21D3F83C21474A526C002A00F059 -:10FF00008680BDE8F047D3F8680640B2104712205B -:10FF1000FFF7B4FDBEE71320FAE700F0C3FF3F4B45 -:10FF20002846D3F84C25A38F1344E361A368984770 -:10FF3000D7E700F0B7FF394BE28FD3F850359B1A63 -:10FF4000E361FFF775FF0646206B94F8493042786D -:10FF500091463BB1324BC3F884501AB1C11C0230F8 -:10FF600003F0B4FEDFF8ACA0DAF8485500F05AFF11 -:10FF700005F07F0594F8357005446D42022F6DB28F -:10FF800009D1DAF85031012B4FF000030CBF47467E -:10FF90000427CAF8503194F8492092B1B9F1000F02 -:10FFA0000FD002211E4BC3F80413D3F8041100290B -:10FFB000FBD00221C3F808134FF48041194BC3F85A -:10FFC0008011144BD3F80034DB0709D41420FFF759 -:10FFD00055FD2B463A46314603206468A04780E72A -:10FFE0007AB1B9F1000F0CD00D4BD3F8003443B9FE -:10FFF0001420FFF743FD2B463A463146042064683F -:020000040103F6 -:10000000ECE72B463A46314600206468E6E7BDE857 -:10001000F08700BF00800041D859002100900141C5 -:1000200000E0004100E100E0014B83F8220070474E -:10003000D8590021F7B5582200216D4803F06DFE14 -:10004000002201236B496C4CC1F8FC2FC1F8FC3F26 -:10005000D30003F1FF7303F58033D3F800030130BD -:100060000CD0D3F8000301322040884202BFD3F8FD -:100070000003D3F804330360202AE9D15D4CD4F89F -:100080003C3743F48063C4F83C37D4F83C371B0555 -:1000900040F1A380D4F83C37584A23F0004323F0C2 -:1000A000FF0343F0004343F09603C4F83C37D4F811 -:1000B00040374F4D23F47F4343F4B053C4F84037E7 -:1000C0006B4692E803004E4A83E8030019464D4808 -:1000D000FEF762FC05F10C00FDF77CFF287BFFF7C3 -:1000E000C3FB287B484E40F00043C6F88030FDF744 -:1000F00085FF05F10D00FDF76DFF6B7B05F10E002F -:1001000043F00043C6F8C031C4F88030FDF762FF09 -:10011000AB7B05F10F0043F00043C6F8C431C4F8CF -:100120008430FDF757FFE87B002740F00043C4F818 -:100130008C31C6F8CC30FDF761FF05F11000FDF7FA -:1001400049FF287C40F00043C4F8EC31C6F8D030B9 -:10015000FDF754FF05F11100FDF73CFF687C40F00E -:100160000043C4F88431C6F8D430FDF747FF40F2AD -:1001700001230126C4F8503640F20313C4F82C754D -:10018000C4F83065C4F8343540F25B63C4F83835E0 -:10019000D4F800221D4B20211343C4F800324FF441 -:1001A00084732B84032385F82A30194B85F82C603F -:1001B00083F808134FF480721A601648C4F80403D9 -:1001C00083F808131A60297CE87B00F083FE384628 -:1001D000FFF79AFD2E7003B0F0BDD4F8743723F00A -:1001E000807323F0010343F08073C4F8743751E740 -:1001F000D85900210080004100F0FFFF1460030186 -:10020000910603011C6003010090014111011000DF -:1002100000E100E003800008014B1878704700BF40 -:10022000D8590021014B9860704700BFD859002170 -:10023000014B5860704700BFD8590021034B020E94 -:100240000002C3F82425C3F81C0570470080004154 -:10025000014BC3F83C057047008000410A280BD8C9 -:10026000431CDBB20B4A5B00023300F07F00C2F894 -:100270000835C2F854057047242801D8831CF0E7DC -:10028000252804D026280CBF0C232723EAE70023C7 -:10029000E8E700BF00800041254B032883F83400C5 -:1002A00083F8351018D004281CD001280FD029223B -:1002B0001A8701229A87032283F8362029220139DE -:1002C0005A87032914D8DFE801F01C2A232A2822A0 -:1002D00098871A870422EFE72B221A8701229A8730 -:1002E0000622E9E72B221A8701229A870522E3E7F3 -:1002F0000822DA872822A3F84020032283F8372037 -:1003000070470522DA871822A3F840200422F5E777 -:100310001922DA879022A3F840200622EEE71E2257 -:10032000DA874FF4A872A3F840200522E6E700BF61 -:10033000D859002173B5464B0546D3F8083500213E -:1003400013F0010F0DF1060014BF03240024FFF782 -:1003500063FC0A23BDF90610002291FBF3F121444E -:100360000423CCB2284649B200F052FD064600F004 -:100370005FFDA219D3B252B29542364807DB002383 -:1003800080F84220344AC2F80C3502B070BD511ECC -:100390008D4204DB013B80F84230FF23F2E7911EDF -:1003A0008D4204DB023B80F84230FE23EAE7D11E97 -:1003B0008D4204DB033B80F84230FD23E2E7111F4E -:1003C0008D4204DB043B80F84230FC23DAE7511F06 -:1003D0008D4204DB053B80F84230FB23D2E7911FBE -:1003E0008D4204DB063B80F84230FA23CAE7D11F76 -:1003F0008D4204DB073B80F84230F923C2E7A2F1CB -:1004000008018D4204DB083B80F84230F823B9E74D -:10041000A2F10C018D4204DB0C3B80F84230F42346 -:10042000B0E7A2F110018D4204DB103B80F84230AE -:10043000F023A7E7143A9542ABBF143B283B80F862 -:10044000423080F84230ACBFEC23D8239AE700BF9B -:1004500000400041D859002100800041014B93F930 -:1004600042007047D8590021003818BF0120024BC4 -:1004700083F82C00704700BFD859002110B50C4BF1 -:100480000C4C58B14FF40072C3F8502601221220D0 -:100490001A60FFF7F3FA0423237010BDC3F8500667 -:1004A0001220FFF71DFB1320FFF71AFB0123F3E7D0 -:1004B00000800041D8590021024B83F8480083F89E -:1004C00049107047D8590021044A00F1100313F86D -:1004D000011D834202F8011BF9D17047A457002186 -:1004E0000368034AC2F819304368C2F81D307047E8 -:1004F000A4570021014B83F84A007047D8590021C6 -:10050000014B83F84B007047D8590021014BC3E9D8 -:1005100014017047D859002138B505460C4CA0B1DC -:10052000A269A38F218F02440B44D21A00230948E9 -:100530001946FEF7BEFA607BFDF760FDA06928440E -:1005400000F024FD0223237038BD1422EEE700BF23 -:10055000D85900211C60030110B50B4CA38F228FCA -:1005600013441433C01AA3616061FFF7BDF920B9C9 -:10057000A3680120BDE81040184702230020237023 -:10058000BDE81040FFF7C8BFD8590021034AD2E99F -:1005900006239B1A1844FFF7BFBF00BFD85900219C -:1005A00070B5114C0646B4F84050E38FA2691D4463 -:1005B00002440D441544A0B1638FD21A00230121D7 -:1005C0000A48FEF776FAA07BFDF718FD2846FFF7EC -:1005D0003FFCA069304400F0F5FC032301202370A8 -:1005E00070BD0122EAE700BFD85900211C60030159 -:1005F000034AD2E906239B1A1844FFF7D1BF00BF74 -:10060000D859002170B51E4E3378012B37D01D48C4 -:10061000FEF738FA012300251B4C2361707BFDF7A0 -:1006200007FDB07BFDF704FDC4F80051D4F800319C -:10063000C4F80451D4F80431C4F80C51D4F80C3186 -:10064000C4F81051D4F81031FFF70AFC0F4BC3F86F -:10065000005596F849200AB1C3F8845000F04CFACE -:1006600000F020FC1220FFF73BFA1320FFF738FAC6 -:10067000012314203370BDE87040FFF731BA70BD1C -:10068000D85900211C6003010080004100E00041B6 -:1006900070B5084C2378032B0BD1FFF7B3FF002371 -:1006A000656894F83520AC46BDE8704019460220D4 -:1006B000604770BDD85900210239FF292DE9F0416A -:1006C0000546464C06D9FFF79DFFA3680120BDE80B -:1006D000F0411847002394F8482084F82830D21AB3 -:1006E00018BF012284F8232094F83420012A6AD00C -:1006F000033A012A9DBF022384F8273040F20333D6 -:1007000084F8273094F83600A384FFF72FFB94F881 -:100710004820334B002A5DD0DFF8C8806A78C3F8E0 -:100720000485314F94F84A30304E3B76D4E9143189 -:1007300001F07F0139752946180A3B747874180C4A -:100740001B0EB874FB7411F8023BF01C33700023CD -:100750007270B37003F0BAFA02222549254BC1F832 -:100760000025C1F80875C1F81435C1F80C65C1F849 -:10077000108594F83430032B04D0042B28D05A1E53 -:10078000534253411B0443F08073C1F80435FB23EB -:10079000C1F81835FFF7D6FA0023C1F80031D1F8B7 -:1007A0000021C1F80431D1F80421C1F80831D1F891 -:1007B0000831D1F8003243F00103C1F800320123BF -:1007C0000B60BDE8F08184F827304FF4807399E71F -:1007D0001346D7E7C3F80455F3E700BFD859002103 -:1007E00000800041A0560021A4570021C8570021D5 -:1007F00000E00041C858002170B5104D0E466B8FC7 -:10080000013BC01AAB616861FFF76EF8044638B16E -:10081000032331462B700020BDE87040FFF7C0BEB7 -:100820001420FFF72BF9FFF7EDFE234621460120A8 -:100830006E6895F83520B047204670BDD859002124 -:10084000012970B505464C4C0BD8FFF7DBFE0023A1 -:10085000656894F83520AC46BDE870401946012023 -:10086000604794F849300239003B18BF012384F8EF -:10087000233094F8353084F82810012B71D0023BD6 -:10088000022B97BF0223002384F8273040F2033362 -:1008900088BF84F8273094F83700A384FFF766FAFE -:1008A00094F84920354B002A63D03548C3F8040535 -:1008B00094F84B3094F84A20022B18BFB2FA82F217 -:1008C000304B18BF52091A76D4E91421160A1A744B -:1008D0005E74160C120EDA74022201F07F01197593 -:1008E00029499E74C1F80025C1F80835274BC1F885 -:1008F0001435C1F80C05C1F8105594F83530032BA8 -:1009000004D0042B33D05A1E53425341204A42EAAA -:100910000343C1F8043594F82830C1F81835FFF7BF -:1009200011FA0023C1F80031D1F80021C1F80431D7 -:10093000D1F80421C1F80831D1F80821D1F80022FA -:1009400022F00102C1F80022627C42F00042C1F8AC -:100950008420C1F80431D1F8043101230B602563F0 -:1009600070BD002384F827304FF4807393E713465B -:10097000CCE7C3F80455F2E7D859002100800041C4 -:10098000A0560021A457002100E00041C8580021D2 -:10099000010000010378427803F03F0343EAC213E9 -:1009A00082780F4943EA0223C27843EA023302798C -:1009B00043EAC233427943EA02438279120602F0E3 -:1009C00070621343C1F81039B0F90A20054B03EAED -:1009D00002430289C2F30C021343C1F81439704771 -:1009E000008000410000FF0F437830B5002B837872 -:1009F00014BF08210021002B14BF1022002203790C -:100A0000C57804789B0243EA85132343447943EA7B -:100A100044338479C07943EA044343EA00630B43D7 -:100A20001343024AC2F8043930BD00BF00800041C0 -:100A300001230A4A0328C2F82C394FF0000306D8D4 -:100A4000C2F82839C2F82839C2F82839704719463F -:100A500001339842C2F82819FAD870470080004143 -:100A60002DE9F0410127002A14BF3B4600234FF037 -:100A7000000618BF20224FF0020886B005460C463B -:100A800001A88DF805308DF804708DF806608DF89A -:100A900007608DF808808DF809708DF80A208DF8B0 -:100AA0000B20FFF7A1FF0323ED08BC42CDE903664D -:100AB00005968DF80C508DF80D708DF80F308DF86F -:100AC00011300BD044450FD014B90A4AC2F800398E -:100AD00003A8FFF75FFF06B0BDE8F081054AC2F842 -:100AE00000898DF80E30F3E7024BC3F800498DF80A -:100AF0000E40EDE7008000410148FFF775BF00BFE1 -:100B0000246003011C4B1D4A70B5C3F8502901260F -:100B100052220029C3F8542914BF3346002386B05B -:100B200018BF202100248DF805300223054601A8B6 -:100B30008DF808308DF80A108DF80B108DF80460D0 -:100B40008DF806408DF807408DF80960FFF74CFFDF -:100B50000323B542CDE903448DF80F300CBF0223C7 -:100B6000334603A805948DF80D608DF81130FFF71A -:100B700011FF06B070BD00BF00800041305A002157 -:100B800070471020FEF77ABF72B6704762B67047A2 -:100B900008B54FF082424FF0FF33C2F8003E02F535 -:100BA000E042C2F8003E0023C2F8403EC2F8443E94 -:100BB00040F201127F201D49C1F840251C4AC2F8AD -:100BC0001801C1F8043EC1F8083EC2F82431C2F849 -:100BD0002C3102F57F22C2F810311648FDF76EF96C -:100BE000FDF77CF90120FDF793F9134BD3F80C24A2 -:100BF000D3F80C14C903F9D5D207F7D50720FDF7B0 -:100C00007BFB00230D4AC2F804350D4A1360012214 -:100C10000C4B1A70FEF7FEFE1120FEF761FF10204C -:100C2000FEF72CFFBDE80840FEF726BE0000084195 -:100C300000200041830B03010050004100A000414F -:100C4000845B0021785B0021014B1870704700BF66 -:100C5000785B0021014B1868704700BF845B00215E -:100C6000054B064883421A4604D211680433B1F199 -:100C7000AF3FF7D0801A704700F00021000001213B -:100C800008B508B1FEF74AFE1020FEF729FF30BF75 -:100C9000BDE808401020FEF7F1BE7047012307B5FC -:100CA0008DF8043000238DF805308DF806304FF6AE -:100CB000FF73984202D001A9FDF79CFB03B05DF8D9 -:100CC00004FB000007B5084B1A889B78ADF8042098 -:100CD0008DF806304FF6FF73984202D001A9FDF758 -:100CE00089FB03B05DF804FB2C60030138B5244C8C -:100CF000244D601DFDF76EF96379A01D43F000439C -:100D0000C5F8D831FDF766F9A379608A43F000434E -:100D1000C5F8DC314FF6FF73984209D0FDF7D2FBDE -:100D20006279194B42F0004119501046FDF766F9FF -:100D30004FF6FF73A089984209D0FDF7C3FBA27953 -:100D4000114B42F0004119501046FDF757F94FF68C -:100D5000FF73E089984211D0FDF7B4FBA2790A4BEA -:100D600042F0004119501046FDF748F9E089FDF7BF -:100D7000B3FB227A044B42F000421A5038BD00BF48 -:100D8000885B00210090014180A000414FF6FF7375 -:100D9000984201D0FDF7FABB70474FF6FF739842B7 -:100DA00001D0FDF74FBB70474FF6FF73984201D05B -:100DB000FDF754BB70474FF6FF73984210B50446D9 -:100DC0000CD0FDF789FB012200F1824303F520439B -:100DD0002046BDE810401A60FDF760BB10BD000062 -:100DE0004FF6FF73984210B5044609D0054800231A -:100DF000C9B2FDF75EFE2046BDE81040FDF73ABBE4 -:100E000010BD00BF1C6003010A2070470A20704714 -:100E1000034B1B88002B14BF0A200020704700BF23 -:100E2000885B0021014B9878704700BF885B0021E8 -:100E300038B54FF6FF73074D04466889984204D0D1 -:100E40001CB10A2C04D1FFF7A8FF01202C8038BD6B -:100E50000020FCE7885B00214FF6FF72054B5989A3 -:100E6000914202D008B10E2802D15880012070476B -:100E700000207047885B002110B5044620B101288E -:100E800008D00024204610BD054B0124188AFFF726 -:100E90008BFFF7E7024B188AFFF77FFFF2E700BFEF -:100EA000885B002110B50A4CA089FFF784FFE08918 -:100EB000FFF781FF608AFFF77EFF6089FFF774FF0D -:100EC000208AFFF771FFA08ABDE81040FFF76CBFD2 -:100ED000885B002138B52723184C0025A3812523E2 -:100EE000E381262323822B2365606382E0712C2318 -:100EF0002420A3822581608121722560FFF7CEFE28 -:100F0000208AFFF7CBFEA08AFFF7C8FE608AFFF7B2 -:100F1000D9FEA089FFF7D6FEE089FFF7D3FEFFF7E1 -:100F2000E5FEFFF7BFFF2846FFF782FF2846FFF7E1 -:100F300093FF208ABDE83840FFF736BF885B002169 -:100F400010B5114CFFF7AEFF6089FFF71FFF208A35 -:100F5000FFF71CFFA08AFFF719FF608AFFF716FF53 -:100F6000A089FFF713FFE089FFF710FFA079FDF7D5 -:100F70005FF8A079FDF734F86079FDF759F86079EA -:100F8000BDE81040FDF72CB8885B002138B5054658 -:100F90000B4CA0F12C020621608AFFF721FFA5F17E -:100FA0001A020721A089FFF71BFF2078FFF740FFF7 -:100FB0002079FFF761FFA08ABDE83840FFF7EDBE5A -:100FC000885B002138B505460A4CA0F11C020621B9 -:100FD000608AFFF705FFE089A5F10A020721FFF704 -:100FE000FFFE2079FFF748FFA08ABDE83840FFF7F1 -:100FF000D4BE00BF885B00212DE9F041054688463C -:1010000017461E46174CFFF79BFFBDF818302846C1 -:101010006382BDF81C306581A382A4F80C80E7814F -:101020002682FFF73BFE208AFFF738FEA08AFFF7F3 -:1010300035FE608AFFF746FEA089FFF743FEE08990 -:10104000FFF740FEFFF752FEFFF72CFF0020FFF7EF -:10105000EFFE0020FFF700FF208AFFF7A5FE01202A -:10106000BDE8F081885B002100207047034630B561 -:10107000002010C920CA641910C310C920CA6C41CD -:1010800010C310C920CA6C4110C310C920CA6C41DA -:1010900010C310C920CA6C4110C310C920CA6C41CA -:1010A00010C310C920CA6C4110C310C920CA6C41BA -:1010B00010C3404130BD30B5002310C920CA641BA5 -:1010C00010C010C920CAAC4110C010C920CAAC4120 -:1010D00010C010C920CAAC4110C010C920CAAC4110 -:1010E00010C010C920CAAC4110C010C920CAAC4100 -:1010F00010C010C920CAAC4110C05B41B3FA83F0E4 -:10110000400930BD2022002102F007BE031F1C3021 -:1011100053F8042F1AB98342FAD1012070470020F6 -:101120007047002351F8232040F823200133082B77 -:10113000F8D1704710B500F12003203153F8044D69 -:1011400051F8042D944204D805D38342F6D10020EF -:1011500010BD0120FCE74FF0FF30F9E7002200F15D -:101160002003834200D1704753F8041D42EA510224 -:101170001A60CA07F5E70000F0B5002789B0FFF74D -:10118000D0FFCB6A0C4603930B6B064604934B6B64 -:101190006A4605938B6B68460693CB6B694607934B -:1011A000CDE901770097FFF761FF6A4605463146B2 -:1011B0003046FFF75BFF236B6A460393636B694618 -:1011C0000493A36B05440593E36B6846CDE90637AA -:1011D000FFF74CFF6A46314605443046FFF746FFAD -:1011E000236A6A460093636A31460193A36A054401 -:1011F0000293A36B30460693E36BCDE90477079324 -:101200000397FFF733FF636AA26B0093A36A04920C -:101210000193E36AE26B0293636B3146CDE90523E8 -:101220000393236A6A46054430460793FFF71EFF7F -:10123000E36A6A460093236B31460193636B05446E -:101240000293236A30460693A36ACDE90477079395 -:101250000397FFF730FF236B6A460093636B3146B9 -:101260000193A36B2D1A0293E36B30460393636AD9 -:10127000CDE904770693E36A0793FFF71CFF636BDE -:101280006A460093A36B31460193E36B2D1A0293D8 -:10129000236A30460393636A0493A36ACDE9053752 -:1012A000236B0793FFF707FFA36B2D1A0093E36BE4 -:1012B0006A46CDE90137636A31460393A36A304633 -:1012C0000493E36ACDE90537636B0E4C0793FFF790 -:1012D000F2FE2D1A0DD42DB931462046FFF72AFF14 -:1012E00001280DD0224631463046FFF7E4FE2D1A84 -:1012F000F1E7224631463046FFF7B8FE2D18F8D404 -:1013000009B0F0BDB06003012DE9F04F93B001903A -:1013100002A800F1180002F1180218C9C0CAA3FB04 -:1013200006BC40F804BB4FF0000AA3FB07B91CEB56 -:101330000B0C49F10009A4FB06BE1CEB0B0C59EB8E -:101340000E094AF1000A40F804CBA4FB07CE19EBC2 -:101350000C094AEB0E0AA0E80006A0F11C00A2F15D -:101360001402B2E8C00120C9A3FB06BC40F804BBCC -:101370004FF0000AA3FB07B91CEB0B0C49F1000965 -:10138000A4FB06BE1CEB0B0C59EB0E094AF1000A3C -:1013900040F804CB4FF0000BA3FB08CE19EB0C096F -:1013A0005AEB0E0A4BF1000BA4FB07CE19EB0C090C -:1013B0005AEB0E0A4BF1000BA5FB06CE19EB0C09FC -:1013C0005AEB0E0A4BF1000B40F8049B08C94FF092 -:1013D000000CA4FB08E91AEB0E0A5BEB090B4CF1BD -:1013E000000CA5FB07E91AEB0E0A5BEB090B4CF1AD -:1013F000000CA3FB06E91AEB0E0A5BEB090B4CF1A0 -:10140000000CD0F800E01AEB0E0A5BF1000B4CF177 -:10141000000C40F804AB10C94FF0000EA5FB089A71 -:101420001BEB090B5CEB0A0C4EF1000EA3FB079AB9 -:101430001BEB090B5CEB0A0C4EF1000EA4FB069AA9 -:101440001BEB090B5CEB0A0C4EF1000ED0F8009080 -:101450001BEB090B5CF1000C4EF1000E40F804BBD5 -:1014600040CA4FF00009A5FB06AB1CEB0A0C5EEB73 -:101470000B0E49F10009A3FB08AB1CEB0A0C5EEB59 -:101480000B0E49F10009A4FB07AB1CEB0A0C5EEB49 -:101490000B0E49F10009D0F800A01CEB0A0C5EF11C -:1014A000000E49F1000940F804CB80CA4FF0000A51 -:1014B000A5FB07BC1EEB0B0E59EB0C094AF1000A09 -:1014C000A3FB06BC1EEB0B0E59EB0C094AF1000AFC -:1014D000A4FB08BC1EEB0B0E59EB0C094AF1000AE9 -:1014E000D0F800B01EEB0B0E59F100094AF1000ACA -:1014F00040F804EB4FF0000BA3FB07CE19EB0C09EF -:101500005AEB0E0A4BF1000BA4FB06CE19EB0C09AB -:101510005AEB0E0A4BF1000B40F8049BA4FB07E9C1 -:101520001AEB0E0A4BEB090BA0E8000CA0F13400FB -:10153000A1F11401A2F1200238C9B2E8C001A3FB55 -:1015400006BC40F804BB4FF0000AA3FB07B91CEB34 -:101550000B0C49F10009A4FB06BE1CEB0B0C59EB6C -:101560000E094AF1000A40F804CB4FF0000BA3FB30 -:1015700008CE19EB0C095AEB0E0A4BF1000BA4FB39 -:1015800007CE19EB0C095AEB0E0A4BF1000BA5FB29 -:1015900006CE19EB0C095AEB0E0A4BF1000B40F882 -:1015A000049B08C94FF0000CA4FB08E91AEB0E0AD3 -:1015B0005BEB090B4CF1000CA5FB07E91AEB0E0ADB -:1015C0005BEB090B4CF1000CA3FB06E91AEB0E0ACE -:1015D0005BEB090B4CF1000CD0F800E01AEB0E0AA3 -:1015E0005BF1000B4CF1000C40F804AB10C94FF05C -:1015F000000EA5FB089A1BEB090B5CEB0A0C4EF1E5 -:10160000000EA3FB079A1BEB090B5CEB0A0C4EF1D7 -:10161000000EA4FB069A1BEB090B5CEB0A0C4EF1C7 -:10162000000ED0F800901BEB090B5CF1000C4EF1A2 -:10163000000E40F804BB20C94FF00009A3FB08AB23 -:101640001CEB0A0C5EEB0B0E49F10009A4FB07AB87 -:101650001CEB0A0C5EEB0B0E49F10009A5FB06AB77 -:101660001CEB0A0C5EEB0B0E49F10009D0F800A050 -:101670001CEB0A0C5EF1000E49F1000940F804CBA6 -:1016800008C94FF0000AA4FB08BC1EEB0B0E59EB77 -:101690000C094AF1000AA5FB07BC1EEB0B0E59EB27 -:1016A0000C094AF1000AA3FB06BC1EEB0B0E59EB1A -:1016B0000C094AF1000AD0F800B01EEB0B0E59F1EC -:1016C00000094AF1000A40F804EB10C94FF0000B82 -:1016D000A5FB08CE19EB0C095AEB0E0A4BF1000BD7 -:1016E000A3FB07CE19EB0C095AEB0E0A4BF1000BCA -:1016F000A4FB06CE19EB0C095AEB0E0A4BF1000BBA -:10170000D0F800C019EB0C095AF1000A4BF1000B9C -:1017100040F8049B40CA4FF0000CA5FB06E91AEB09 -:101720000E0A5BEB090B4CF1000CA3FB08E91AEB6A -:101730000E0A5BEB090B4CF1000CA4FB07E91AEB5A -:101740000E0A5BEB090B4CF1000CD0F800E01AEB31 -:101750000E0A5BF1000B4CF1000C40F804AB80CAA0 -:101760004FF0000EA5FB079A1BEB090B5CEB0A0C74 -:101770004EF1000EA3FB069A1BEB090B5CEB0A0C67 -:101780004EF1000EA4FB089A1BEB090B5CEB0A0C54 -:101790004EF1000ED0F800901BEB090B5CF1000C31 -:1017A0004EF1000E40F804BB52F8048B4FF00009D4 -:1017B000A5FB08AB1CEB0A0C5EEB0B0E49F1000914 -:1017C000A3FB07AB1CEB0A0C5EEB0B0E49F1000907 -:1017D000A4FB06AB1CEB0A0C5EEB0B0E49F10009F7 -:1017E000D0F800A01CEB0A0C5EF1000E49F10009D4 -:1017F00040F804CB40CA4FF0000AA5FB06BC1EEB24 -:101800000B0E59EB0C094AF1000AA3FB08BC1EEBB6 -:101810000B0E59EB0C094AF1000AA4FB07BC1EEBA6 -:101820000B0E59EB0C094AF1000AD0F800B01EEB80 -:101830000B0E59F100094AF1000A40F804EB80CA86 -:101840004FF0000BA5FB07CE19EB0C095AEB0E0A63 -:101850004BF1000BA3FB06CE19EB0C095AEB0E0A59 -:101860004BF1000BA4FB08CE19EB0C095AEB0E0A46 -:101870004BF1000BD0F800C019EB0C095AF1000A2B -:101880004BF1000B40F8049B4FF0000CA3FB07E961 -:101890001AEB0E0A5BEB090B4CF1000CA4FB06E9FA -:1018A0001AEB0E0A5BEB090B4CF1000C40F804AB91 -:1018B000A4FB079A1BEB090B4CEB0A0CA0E80018E1 -:1018C000019802A9FFF758FC13B0BDE8F08F2DE98D -:1018D000F04F93B0019002A80CC901F1100160C94A -:1018E00000F11800A2FB058940F8048BA2FB06CA90 -:1018F00019EB0C094AF1000A40F8049BA3FB068986 -:101900001AEB080A49F1000BA0E8000CA0F128002E -:10191000A1F12001FCC9A2FB02BC40F804BB4FF0BE -:101920000009A2FB03AB1CEB0A0C5BF1000849F1B8 -:1019300000091CEB0A0C58EB0B0849F1000940F8B0 -:1019400004CB4FF0000AA2FB04BC1BEB0B0B5CEBBF -:101950000C0C4AF1000A18EB0B0859EB0C094AF180 -:10196000000AA3FB03BC18EB0B0859EB0C094AF166 -:10197000000A40F8048B4FF0000CA2FB058BDE46FA -:10198000E3FB048BDE4588BF4CF1000C18EB080824 -:101990005BEB0B0B4CEB0C0C18EB09085BEB0A0B2D -:1019A0004CF1000C40F8048B4FF0000AA2FB0689B2 -:1019B000CE46E3FB0589CE4588BF4AF1000A18EB05 -:1019C000080859EB09094AEB0A0ACE46E4FB0489E8 -:1019D000CE4588BF4AF1000A18EB0B0859EB0C09F9 -:1019E0004AF1000A40F8048B4FF0000CA2FB078B71 -:1019F000DE46E3FB068BDE4588BF4CF1000CDE467D -:101A0000E4FB058BDE4588BF4CF1000C18EB0808A1 -:101A10005BEB0B0B4CEB0C0C18EB09085BEB0A0BAC -:101A20004CF1000C40F8048B04C94FF0000AA3FBF2 -:101A30000789CE46E4FB0689CE4588BF4AF1000AF5 -:101A4000D0F800E018EB0E0859F100094AF1000A3D -:101A500018EB080859EB09094AEB0A0ACE46E5FBE0 -:101A60000589CE4588BF4AF1000A18EB0B0859EBEF -:101A70000C094AF1000A40F8048B4FF0000CA3FB5C -:101A8000028BDE46E4FB078BDE4588BF4CF1000C81 -:101A9000DE46E5FB068BDE4588BF4CF1000CD0F836 -:101AA00000E018EB0E085BF1000B4CF1000C18EB9A -:101AB00008085BEB0B0B4CEB0C0C18EB09085BEB11 -:101AC0000A0B4CF1000C40F8048B08C94FF0000AD7 -:101AD000A4FB0289CE46E5FB0789CE4588BF4AF1C3 -:101AE000000AD0F800E018EB0E0859F100094AF19D -:101AF000000A18EB080859EB09094AEB0A0ACE4616 -:101B0000E6FB0689CE4588BF4AF1000A18EB0B08B0 -:101B100059EB0C094AF1000A40F8048B4FF0000C15 -:101B2000A4FB038BDE46E5FB028BDE4588BF4CF150 -:101B3000000CDE46E6FB078BDE4588BF4CF1000C4F -:101B4000D0F800E018EB0E085BF1000B4CF1000C34 -:101B500018EB08085BEB0B0B4CEB0C0C18EB0908B3 -:101B60005BEB0A0B4CF1000C40F8048B4FF0000AC1 -:101B7000A5FB0389CE46E6FB0289CE4588BF4AF124 -:101B8000000A18EB080859EB09094AEB0A0ACE4685 -:101B9000E7FB0789CE4588BF4AF1000A18EB0B081E -:101BA00059EB0C094AF1000A40F8048B4FF0000C85 -:101BB000A6FB038BDE46E7FB028BDE4588BF4CF1BC -:101BC000000C18EB08085BEB0B0B4CEB0C0C18EB48 -:101BD00009085BEB0A0B4CF1000C40F8048B4FF04A -:101BE0000008A7FB031A49185AEB0A0A48F1000833 -:101BF0001BEB010B5CEB0A0C48F10008A2FB021A7C -:101C00001BEB010B5CEB0A0C48F1000840F804BB2D -:101C10004FF0000BA2FB031A49185AEB0A0A4BF1CA -:101C2000000B1CEB010C58EB0A084BF1000B40F8C1 -:101C300004CBA3FB031A18EB01085BEB0A0BA0E82B -:101C40000009019802A9FFF797FA13B0BDE8F08FD9 -:101C500070B5064614460D4688B011466846FFF733 -:101C600036FE6A4631463046FFF74EFB224669464D -:101C70006846FFF749FB6A4629462846FFF744FBBA -:101C800008B070BD0B1F1C3153F8042F0438120E1E -:101C900080F820205A888B4280F821201A684FEA69 -:101CA000122280F822201A6880F82320ECD1704795 -:101CB00001F11C0304381A688B4212BA40F8042F51 -:101CC000A3F10403F7D1704708B50146FFF71EFAE8 -:101CD00030B101F12000FFF719FA003818BF0120D8 -:101CE00008BD000010B50446FFF7E5F930B1214604 -:101CF0002046BDE81040024AFFF7B8B910BD00BF4A -:101D0000B0600301F0B5144606461D460F4689B083 -:101D1000024621466846FFF7E5FF69466846FFF739 -:101D2000D6FD6A4631463046FFF7EEFA6A4621464E -:101D30002046FFF7E9FA3A4629462846FFF7D2FF40 -:101D400029466846FFF7C3FD324669466846FFF7F5 -:101D5000C9FF224669466846FFF7C4FF324621465E -:101D60002046FFF7BFFF224639463846FFF7CCFA38 -:101D70006A4631462046FFF7B5FF224629462846E7 -:101D8000FFF7C2FA3A4629462846FFF7ABFF6946F5 -:101D90002046FFF7C6F909B0F0BD000010B50446B3 -:101DA000FFF764F928B920460649FFF7C3F9002870 -:101DB00006DB21462046BDE81040024AFFF77BB90A -:101DC00010BD00BFB0600301F0B5144605461E46C5 -:101DD0000F4699B0024621466846FFF783FF6946E1 -:101DE0006846FFF774FD6A4629462846FFF78CFAD5 -:101DF0006A4621462046FFF787FA3A46314668464A -:101E0000FFF7CCFF3A4631463046FFF76BFF2A46D4 -:101E1000214608A8FFF766FF3946384608AAFFF7AB -:101E200073FA2246294608A8FFF7B8FF3146204634 -:101E3000FFF74DFD2146204608AAFFF753FF224633 -:101E4000294610A8FFF74EFF3146304610AAFFF78B -:101E50005BFA3A4631463046FFF744FF694610A820 -:101E6000FFF735FD10A9084608AAFFF73BFF2A46F1 -:101E700010A908A8FFF736FF08A96A460846FFF729 -:101E800043FA3A46384608A9FFF72CFF284610A91E -:101E9000FFF747F919B0F0BD2DE9F04F174602786A -:101EA000ADB004468946DDF8D880042A00F263818B -:101EB000DFE812F00500B300D200F9000F0100F1D5 -:101EC00024053946284604F16406FFF72AF907F18C -:101ED00020013046FFF725F9271D04F14409B8F128 -:101EE000000F00F09080414614A8FFF71AF9294628 -:101EF0003846FFF716F931464846FFF712F92846EB -:101F000014AAFFF7A5FE14A8FFF700F900286CD16A -:101F100031461CA8FFF7DBFC1CAA294624A8FFF7C2 -:101F2000F3F91CA90846FFF7D2FC14AA3146304643 -:101F3000FFF7EAF914A90846FFF7C9FC2946284625 -:101F400014AAFFF72BFF14AA11461046FFF726FF2D -:101F500014AA10462946FFF7C5FE2946284614AAAA -:101F6000FFF7D2F92A46294614A8FFF717FF29469A -:101F7000284614AAFFF712FF636AD90749D52946F4 -:101F8000C34A2846FFF772F880462846FFF7E6F86E -:101F9000236C43EAC8732364294614A8FFF797FC0F -:101FA00014A9084624AAFFF79DFE14A9084624AAEE -:101FB000FFF798FE24A9084614AAFFF793FE2946C6 -:101FC000284624AAFFF7A0F91CAA10462946FFF7C5 -:101FD00089FE284614A9FFF7A4F8314614A8FFF794 -:101FE000A0F830461CA9FFF79CF84946384614AAC9 -:101FF000FFF72EFEFF23C4F8843001230020237056 -:102000002DB0BDE8F08F14A8FFF77CF801231493DE -:102010006DE72846FFF7A2F8BEE70121D0F884203B -:10202000501153F8203002F01F0201FA02F21A4256 -:102030000CBF0A460022881A4001520102F14403F3 -:1020400000F144010432043023442244214420445A -:10205000FFF7BAFE0223D1E70121D0F88420501106 -:1020600053F8203002F01F0201FA02F21A420CBFAC -:102070000A46002250018A1A520102F1440300F17B -:102080004401043204302344224421442044FFF715 -:1020900039FED4F88430013B002BC4F88430CCBF27 -:1020A00001230323AAE71A6802F00100D24302F0D9 -:1020B00001024001520102F1440300F144010432E3 -:1020C00004302344224421442044FFF77DFE0423AE -:1020D00094E71D6804F1040BE84305F0010500F0E6 -:1020E00001035A4604F1240104A802350293FFF7C4 -:1020F000F9FD6B0103F1040A04A9A2440846524603 -:102100000193FFF701F904A908463A46FFF7FCF8E6 -:1021100004A8FEF7FBFF80B304A8FEF7F3FF04A9B1 -:10212000084607F12002FFF7EFF8019B04A9A3F18D -:102130003C0525442A460846FFF7E6F8029B2A4656 -:10214000580100F14401043053462144204404F175 -:102150004405FFF7D7FD04AA29465846FFF778FD46 -:1021600059464846FEF7DDFF294609F12000FEF7F3 -:10217000D8FF05232370012042E70CAE304604A9A6 -:10218000FEF7CFFF424914A8FEF7CBFF1CA8FEF7CD -:10219000B9FF012324AD28461C93FEF7B3FFDFF8F7 -:1021A000F080304614A9FEF7C5FF20B91CA904A889 -:1021B000FEF7B7FFB3E70C9BDA0718D43046FEF7FB -:1021C000CDFF1C9810F0010305D01CA9424608461B -:1021D000FEF74CFF03461CA80393FEF7BFFF039BCB -:1021E000002BDED0239B43F000432393D9E7149BBD -:1021F000DB0718D414A8FEF7B1FF249810F00103F0 -:1022000005D0424629462846FEF730FF03462846B9 -:102210000393FEF7A3FF039B002BC2D02B9B43F03D -:1022200000432B93BDE7002818DD314614AA304641 -:10223000FEF741FF3046FEF791FF29461CA8FEF746 -:1022400079FF002804DA1CA942460846FEF70EFF73 -:102250001CA92A460846FEF72EFFB2E714A932460B -:102260000846FEF728FF14A8FEF778FF28461CA9A9 -:10227000FEF760FF002804DA424629462846FEF7AA -:10228000F5FE294628461CAAFEF715FFB5E700BF54 -:10229000B0600301014B1860704700BFF0000021DF -:1022A000074B10B5002104464FF4BC72184601F0EC -:1022B00034FD2146BDE810400430FFF7F9BC00BFF3 -:1022C000A05B00212DE9F341294D2B78012B2BD068 -:1022D000022B40D0002B48D1281DFEF717FF0446E3 -:1022E00018B1002002B0BDE8F0812248291DFEF798 -:1022F00021FF01280646F4D105F164071D4A05F1C6 -:102300008408291D3846C5F8A470C5F8A880FEF7D2 -:10231000ADFE3946C5F8AC00164A4046FEF7A6FEAB -:1023200085F8B0402E70DCE7D5F8AC300024B3FA65 -:1023300083F35B0905EB83030094D3F8A4300E4AC2 -:1023400005F1240105F1B000FFF7A6FD0028C8D073 -:1023500002232B70C5E705F12400FFF7B5FC10B18F -:1023600000202870BEE703232B700120BAE700BFCE -:10237000A05B0021906003013060030138B5044682 -:10238000084D0846291DFFF77DFC204605F1240174 -:10239000FFF778FC05F1440104F12000BDE8384066 -:1023A000FFF770BCA05B0021014610B5A8B018A8CB -:1023B000FFF77EFC203120A8FFF77AFC18A8FFF772 -:1023C00083FC0446002833D11A4818A9FEF7B2FE50 -:1023D00001282AD1174820A9FEF7ACFE012824D1F4 -:1023E000684620A9FFF773FA1C22214611A801F0C4 -:1023F00094FC032318A908A81093FFF768FA08A90A -:10240000084610AAFFF76EFC08A9084618AAFEF7AE -:102410007BFF08A90846084AFFF7C0FC684608A9E0 -:10242000FEF788FEB0FA80F46409204628B010BD9B -:102430000024FAE7B0600301706003012DE9F04168 -:102440004FF4BC7206460F461E48002101F065FCA1 -:1024500040241C4DDFF870802021D8F80030194846 -:10246000984758B32846FEF751FE38BB2D62174CEB -:1024700039462046FFF71CFC3146A4F18000FFF7E7 -:1024800017FC06F12001A4F16000FFF711FC04F134 -:10249000200621460E4A2046C5F8E440C5F8E8600B -:1024A000FEF7E4FD2146C5F8EC00094A3046FEF788 -:1024B000DDFD002385F8F030BDE8F081013CCBD193 -:1024C000D5E700BFA05B0021F0000021445C0021A3 -:1024D0009060030107B50B48D0F8EC30026AB3FAFC -:1024E00083F35B09009200EB830300F1240200F107 -:1024F0006401D3F8E430F030FFF7CEFC03B05DF8B0 -:1025000004FB00BFA05B00210149FFF7BBBB00BF7C -:10251000045C002130B4046B0B4684B9C168456883 -:102520001F2998BF23FA01F465B181688B4209D253 -:102530000069034055F82400184430BC7047234616 -:1025400030BC18474FF0FF30F7E770B5069CC4E980 -:102550000002049A21811989E260059A8E1C226189 -:10256000D3E9002502EB0113E36103EB46036E1C84 -:1025700033446D422B4023628369C4E905126181B3 -:10258000A1847BB9481E834202EB03140CDB0029B3 -:102590004FEA001308BF00231A44002393736FF01F -:1025A0007F03D373002070BD0133E381EBE72DE996 -:1025B000F04F0026B0F82CB004465D46B24685B018 -:1025C00002EB03080E9B914600EBCB0253631FFA0C -:1025D00088F313870F1D826908F1FF310191B0451F -:1025E00019DCA28CA585D31AA3846289E369511EE4 -:1025F0005A8800200A4003EB4203A3F804B0BFF35B -:102600005B8FE269538801335380E38C0133E384A9 -:1026100005B0BDE8F08FA06A03932B0157F8041CA6 -:102620000093036802EB0515C91A83680292994268 -:1026300028BF4FF0FF31FFF76DFF009B029A39680A -:10264000D050019BA9609E42B6BF012185F80CA025 -:10265000297385F80DA0B145D8BFA989C5F804A094 -:10266000DCBF41F00201A981039BED8901360837E7 -:10267000B5E7F0B550B3056AC38D6C889C4230D085 -:102680005C1CC4854489BFF35B8F013C1C4005EB97 -:10269000C4056B689EB209B1AD680D60D0F818C072 -:1026A0009BB20CEB031100EBC3031D8F878C2F44EF -:1026B000013D87841D878D896F070ED5858DCD815E -:1026C00000218685586B596302B11480F0BD1D8FBF -:1026D000C989013D0CEB01111D878D89ED07F6D4E9 -:1026E000ECE70020F2E7836903EB01139868704779 -:1026F00010B5044690B1828C43899A4209D0084BA8 -:102700001A78032A05D95B681BB142680549042081 -:1027100098472046BDE8104001F0D0BA10BD00BF78 -:10272000185D0021D06003012DE9F843BFF35B8FF2 -:102730001746C2690E465388018E05468B4245D026 -:102740004B1C03864389D0F82880013B0B4002EBE9 -:1027500043039A8893B2328082691B0152F8039036 -:10276000D8F834305BBBD8F81040621C09BFD8F8E9 -:10277000043009EA04041C68A9EB0404214640461D -:10278000FFF7C8FE814509D0D8F8103001331C444A -:10279000D8F808309C42F1D34FF0FF34D8F800004D -:1027A000431C11D0D8F80830A3420DD920443288F8 -:1027B000AB6903EB02139B683B60BDE8F8834946B5 -:1027C000404698470446E9E70020F0E70020F4E798 -:1027D00030B544898C4212D3036A013C5D882C4099 -:1027E00003EBC4039A605960BFF35B8F026A53889E -:1027F00001335380C38C0133C384002030BD0148B2 -:10280000FCE700BF41F4FFFF026893691269920080 -:102810001AD58BB94269C36903EB4203C28D9A8012 -:10282000BFF35B8F03689B69CBB9036AC08D5B887C -:10283000181A18BF01207047012BF1D14269036AB1 -:1028400003EBC203028EEAE72BB9C269138823F0B7 -:1028500001031380E4E7012BE2D1026AF6E7012BC2 -:1028600003D1C369008E5B88E2E7002070470268ED -:1028700093691269920015D54BB9C38DC26941693C -:102880004089013B1B1A02EB410293807047012BE8 -:102890000ED1038E026A41694089013B1B1A02EB8B -:1028A000C102F2E72BB9C269138843F00103138018 -:1028B0007047012BFCD1026AF6E710B5BFF35B8FBE -:1028C000036804461A699B6912F0005F1AD07BB94D -:1028D000C369026A5B884169013B02EBC1029288CD -:1028E0009B1AE28C9BB29A4214D80023E38410BD59 -:1028F000012BFAD1036AC2695B884169013B02EB93 -:102900004102ECE763B9036A1B88DB4303F0010370 -:10291000002BEAD02369002BE7D020469847E4E754 -:10292000012BE2D1C369EFE710B588B0E0B10F4BDE -:102930001A78062A18D95C68B4B1D0E90732118830 -:10294000079119880691528809490592C28D04920F -:102950005B880393838D0293C38C0193838C0093D4 -:10296000438942680720A04708B010BD185D0021C8 -:10297000F2600301C269018E53888B420AD04389F9 -:10298000013B0B4002EB43039A88836903EB02137C -:102990009868704700207047BFF35B8FC36803B12E -:1029A0001847704700230121026A30B502F158042C -:1029B000D4E8EF5F9D4204BFC4E8EC1FBCF1000FF8 -:1029C0002B46F5D1436AA3F580637F2B0BD85D09B5 -:1029D000483203F01F0301FA03F352F8251021EAED -:1029E000030342F8253000F13403D0E90D124A60A8 -:1029F0001160C0E90D3300230362C4E8AF3F30BD6E -:102A0000F0B4144648B1006A38B133B1013404D08F -:102A1000046E14B1A446F0BC60470148F0BC704796 -:102A20002DF8FFFF30B5456A8DB004460B9120228A -:102A3000014602A80A9501F073FD282301222946C8 -:102A4000CDE900322046352202ABFFF7D9FF00EA7C -:102A5000E0700DB030BD28B1006A18B111B1436EFD -:102A600003B11847704728B1006A18B111B1836EDD -:102A700003B11847704728B1006A18B111B1C36E8D -:102A800003B118470020704770B4144648B1006A7B -:102A900038B133B1013404D0046F14B1A44670BC12 -:102AA0006047014870BC70472DF8FFFF2DE9F843DF -:102AB00007468846154699460668B74203D1002462 -:102AC0002046BDE8F8836A1CA6F1340402D0636A8C -:102AD000AB42F5D0B8F1000F10D02022414620467D -:102AE00001F00AFD50B9B9F1FF3F02D0A36A4B458E -:102AF000E6D06B1C02D1A36A0133E1D03668DCE773 -:102B000070B50C46114605461E460C4B2022002986 -:102B100008BF1946204601F003FD049B6A68A362C2 -:102B2000059BC4E90D52E362069B6662236304F1D0 -:102B3000340325626B60A26B136070BDF16003010A -:102B40002DE9FF410E46054600286BD001F15807DC -:102B500000200121D7E8EF4F844204BFC7E8EC1FF3 -:102B6000BCF1000F2046F5D1581C1BD1002306F103 -:102B70004801580901EB800C51F8200003F01F04B4 -:102B800020FA04FE1EF0010F07D10121A1400143EC -:102B900003F58063CCF800101DE00133802BE8D1F1 -:102BA000224C3BE0B3F5806F15D3A3F580607F28FE -:102BB00006F1480431D84FEA501C54F82CE000F0DC -:102BC0001F002EFA00F818F0010FE9D1814041EA08 -:102BD0000E0144F82C100C99304602910B9901918A -:102BE0000A9900912946FFF78BFF0023C7E8AF3F02 -:102BF0002C7874B196F874405CB1AB6A013313D190 -:102C000000212846FFF70EFF044610B12846FFF7C3 -:102C1000C9FE204604B0BDE8F081054C0023C7E89A -:102C2000AF3FF6E7024CF4E70024F2E729F8FFFF94 -:102C30002DF8FFFF10B5044688B1036A7BB1027816 -:102C40004AB193F8743033B1436AB3F5806F02D35D -:102C50000121FFF7E7FE2046BDE81040A2E610BDC7 -:102C600051F8083C43F0004341F8083C7047704776 -:102C70000023C0E8AF3F7047F0B5282A0E4689B060 -:102C800032D1056A2023D5F88C006A460168846831 -:102C9000711AA14228BF4FF0FF3100F03FFD002321 -:102CA0000121376A05F15804D4E8EF2F9A4204BF96 -:102CB000C4E8E01F00281346F6D13B464FF0FF3230 -:102CC00069462846FFF7F2FE736A0246DB070ED517 -:102CD00010B14FF0FF3383622046FFF7C9FF1AB1EE -:102CE000136B0BB110469847002009B0F0BD50B9E6 -:102CF0002046FFF7BDFFEB6D002BF5D03A46694645 -:102D000028469847F0E787622046FFF7B1FFEBE7D8 -:102D10007FB50C461946D0F880309D695DB90094A6 -:102D2000CDE9024201232A46D0F8840002A9FFF728 -:102D30003EFC04B070BD012DFBD1D0F8840004B07E -:102D4000BDE87040FFF744BD2DE9F043A3F1100941 -:102D500053F8088C102300250446D0F88C0089B065 -:102D6000CDE9041201688768109EA9EB0101B94200 -:102D700028BF4FF0FF310DEB0302ADF81C60069544 -:102D8000ADF81E5000F005FD10281FFA88F806D097 -:102D900040F28B11204B214A214800F057FF0122BD -:102DA00004F15807D7E8EF3FAB4204BFC7E8E12F73 -:102DB00000291D46F6D1D4F880309B69A3B9A26FD3 -:102DC000D4F88030D4F888009B69A3B9CDE9029289 -:102DD000CDF80090012202A9FFF7E9FB88B14FF47A -:102DE000CC71104B0D4AD7E74146D4F88800FFF765 -:102DF0007AFC0246E4E7012B03D14146FFF7E8FCE9 -:102E0000ECE7D4F88800FFF758FD3846FFF730FFAD -:102E1000304609B0BDE8F0837B61030148620301DD -:102E20009461030111620301F8B5A1F1100751F893 -:102E3000085C044600230121ADB200F15806D6E833 -:102E4000EF2F9A4204BFC6E8E01F00281346F6D1D0 -:102E50002946D4F88400FFF746FC2B460246394643 -:102E60002046FFF755FF3046BDE8F84000E730B494 -:102E7000D0F880501346AD6925B930BCD0F8840035 -:102E8000FFF7F7BB012D06D130BC0A46D0F884000D -:102E90001946FFF749BC002030BC704703682DE994 -:102EA000F04301215F6A002385B007F15805D5E89A -:102EB000EF2F9A4204BFC5E8E01F00281346F6D161 -:102EC00038460DF10A0203A9FFF7D1FF0446284650 -:102ED000FFF7CEFE4FF0010814B905B0BDE8F0834E -:102EE000BDF80A30A3600023D5E8EF2F9A4204BF53 -:102EF000C5E8E18F00291346F6D14FF0FF330021DA -:102F000038466268FFF7D2FD06462846FFF7B0FE56 -:102F1000B6B1B26A23680132F16B08BFB362A2890D -:102F200000913046D6F82C9004F11001C8470028D3 -:102F300006DA4FF40271144B144A154800F086FE6D -:102F40000023D5E8EF2F9A4204BFC5E8E18F00299E -:102F50001346F6D1A368002B06DB21463846BDF8A0 -:102F60000A30039AFFF7D4FE38460DF10A0203A98E -:102F7000FFF77DFF044618B9D7F88400FFF79DFCE2 -:102F80002846FFF775FEA7E71D6203016C62030187 -:102F9000946103010346426810B58A4229BF8068E4 -:102FA0000020841A186822BF521A00195A6010BDF6 -:102FB0002DE9F3478146D0F880000E46036A154696 -:102FC0001B689847430747D543F69823002D18BF41 -:102FD0001D464FF0010809F158070023D7E8EF2FED -:102FE0009A4204BFC7E8E18F00291346F6D1D9F809 -:102FF0008030D3F818A0BAF1000F21D13146D9F8AA -:1030000088000DF10602FFF734FB044620B9D9F819 -:1030100088309B8C3BB900243846FFF729FEFCB969 -:10302000D5B1013DD9E7D9F87810D9F89000FFF76C -:10303000B1FFD9F8783004463360ADF806A0EBE76D -:10304000BAF1010FE7D13246D9F888000DF1060137 -:10305000FFF76AFB0446DFE7002002B0BDE8F08717 -:10306000BDF8063004F11000A3603368103B3360F4 -:10307000F3E72DE9F04385B00F46904603A90D9A7A -:1030800006469946FFF794FF044628B30C9D039B20 -:10309000D6F88C009D42A8BF1D460168D0F808C034 -:1030A000611A614528BF4FF0FF312B464A4600F0B8 -:1030B00070FB854206D04FF4E471084B084A09487A -:1030C00000F0C4FD23464246394630460095FFF7DE -:1030D0003BFE05B0BDE8F0830348FAE7296203012F -:1030E00085620301946103012EF8FFFF10B1C0E96E -:1030F00001220160704710B5D8B10023012100F111 -:103100005804D4E8EF2F9A4204BFC4E8EC1FBCF186 -:10311000000F1346F5D1D0F880309B695BB9826F00 -:10312000103A002A00DC084A2046FFF7A1FD1046AD -:1031300010BD064AFBE7012BF5D1D0F88800FFF758 -:1031400019FCA0F11002ECE72EF8FFFF2DF8FFFFAD -:103150002DE9F04704460D4690468AB07822DDE915 -:10316000129700211E4600F0D8FD04F15800FFF729 -:103170007FFD674BC4F85C80C4F880506C622366A6 -:10318000644BD5F818806366634BA366634BE366B4 -:10319000634B2367B8F1000F70D127B9614F3846F0 -:1031A0000AB0BDE8F08704F1780397E8030083E8EC -:1031B0000300D4F88000036A9B68984700232861C5 -:1031C00000F001006B6184F87400B8F1000F69D160 -:1031D000B9F1000FE2D0D9F80830002B00F095804B -:1031E000514BC4F890900493504B0593504B069369 -:1031F000504B0793EB6A1A689B69C4F88420C4F8A3 -:10320000883006AB009302220021D4F88000C4F875 -:103210008C6004AB00F0C5F807460028BFD1D4F895 -:103220008800FFF724FBEB6A1A689B6996629E622E -:10323000B8F1000F07D1C246E36F0993D4F8843088 -:103240005B8953453FD894F87430C4E900445BB1BE -:1032500000230293384B204601933523374A0093CD -:1032600004F10801FFF74CFCB8F1000F97D1D4F836 -:1032700080000421036A5B68984790E7B8F1010F6A -:1032800097D1D4F88000036A1B689847420606D598 -:10329000D4F880000021036A5B689847F1E7430790 -:1032A000EFD586E7B8F1010FABD1204B04931E4B4D -:1032B0000593204B06931E4B0793EB6A9A691B6894 -:1032C000C4F884209BE74846E16FFFF763FE05469C -:1032D000C0B131680890411AB0680022814228BF0D -:1032E0004FF0FF31E36F304600F08DFA01230022EA -:1032F000D4F88400009508A9FFF759F918B90AF124 -:10330000010A9BE70E48074649E70D4F47E700BF14 -:1033100073300301612C0301292E0301B12F030136 -:10332000492D03012DF8FFFF376203013D620301C0 -:103330009D2E03016F2C0301792C030143620301CD -:103340002EF8FFFF7FB505460E46074902AC03C9BC -:1033500084E8030008992846009101943146FFF75C -:10336000F7FE04B070BD00BFA862030110B50446AB -:103370002068844203D10023C4E9213310BD3438CE -:10338000FFF758FCF4E700BF0246044B586800B949 -:10339000704719889142FBD00833F7E7F4620301C4 -:1033A00070472DE9F04F87B00593836A0546934235 -:1033B000164649D300244FF0180BB44203D1002025 -:1033C00007B0BDE8F08F0BFB04F7D5F82C80AA6995 -:1033D00008EB070C0CF1040902BBDCF81400BCF884 -:1033E0000CE0DCF804300168DCF808C0591A0CF174 -:1033F000FF3303EB0E130EF1030ACCF1000C03EBC9 -:103400004A0303EA0C03D0F808C003EBCE0361457E -:1034100028BF4FF0FF31063300F0F5F958F80730B8 -:10342000059A02932B6A28461B6AA1B20193109B4E -:1034300053F82430009352F824204B46FFF785F8C8 -:103440000028BDD10134B8E70048B9E740F4FFFFD8 -:103450002DE9F0410E4617460C4D55F8184FAC4279 -:1034600003D16FF01200BDE8F081314654F8440CEE -:10347000A4F1440801F036F830B94046C7F800809E -:10348000BDE8F04100F010BA2468E8E7185D0021BB -:10349000F8B5DDE906549C421746194604D00C22C3 -:1034A00020466A4300F012FC0026AE4201DB2846AB -:1034B000F8BD022F03D1A168206800F035FAA16899 -:1034C00054F80C0B00F031FA0136EEE770B51C46EB -:1034D0000025049EB54204F10C0400DB70BD54F8D5 -:1034E000041C54F80C0C00F020FA0135F2E700F14E -:1034F000240310B5D0E909124A601160C0E909330C -:103500004368044603B19847054B1A78062A05D943 -:103510005B681BB10720226802499847002010BD54 -:10352000185D00213C6303012DE9F04107460D467B -:103530000B4E56F8084FB44202D16FF001000AE07A -:10354000394654F8240CA4F1240800F0CBFF20B92C -:103550001DB1C5F80080BDE8F0812468EBE700BF2D -:10356000185D002110B5044600B30068F0B103787F -:10357000E3B10021FFF7D8FFD8B104F11C03C4E97F -:1035800007330E4B04F12402D96803F10800DA6016 -:10359000A16260620A601A78062A05D95B685BB18D -:1035A0000720226806499847002001E06FF01500C7 -:1035B00010BD6FF01000FBE71846F9E7185D002119 -:1035C0003E63030137B50C46154688B103787BB1DD -:1035D00071B10B7863B15AB101A9FFF7A5FF28B902 -:1035E000019883683BB12A462146984703B030BD15 -:1035F0006FF01500FAE76FF01200F7E7014610B51B -:1036000008B1406828B95121054B064A064800F028 -:103610001DFBC36813B1BDE81040184710BD00BFC3 -:1036200051630301D863030167630301036810B5A5 -:1036300093B11B7883B18368012B0DD8084B00F13F -:1036400044014360074BDA6903F11804826444645F -:103650000020D961116010BD6FF01500FBE700BFBD -:10366000F4000021185D00210E4B10B50446202205 -:103670000021184600F051FB226842600246217981 -:1036800002F8081BC0E9022200F11002C0E904227E -:1036900000F11802C0E906222046BDE8104000F003 -:1036A0000FB900BF185D002108B500F011F9BDE8A1 -:1036B000084020220021014800F02FBB185D0021A6 -:1036C0002DE9F04788B00646DDE910498A46904664 -:1036D0000021202268461F46129D00F01EFB1F2C71 -:1036E00097BF01234FF0FF33A34003F1FF33C6E937 -:1036F0000274C6E900A8C6E9043906F118045DB1F0 -:103700000FCD0FC495E80F0084E80F00304608B0D5 -:10371000BDE8F04700F0E2B86D46F1E773B5046824 -:10372000661C33D08568A94230D264182ED05E184A -:10373000AE4288BF6B1A056A35B100930523A847CE -:103740000346184602B070BD2146BFF35B8F184692 -:103750000028F6D042EA0105AD070C460AD103283D -:103760000EDC013C10448242EBD014F8011F02F839 -:10377000011BF8E711F8014B013802F8014BE7E7AC -:1037800054F8041B043842F8041BE8E76FF02103E7 -:10379000D7E773B50468661C32D08568A9422FD27A -:1037A00064182DD05E18AE4288BF6B1A456A35B9D1 -:1037B0002146184670B9BFF35B8F184602E00093AC -:1037C0000523A84702B070BD12F8014B013801F87B -:1037D000014BEFE741EA0205AD071446F4D1032897 -:1037E00008DC013C08448142E5D014F8012F01F8BF -:1037F000012BF8E754F8042B043841F8042BEEE7CA -:103800006FF02100DEE7F7B504681646621C1D461E -:103810002DD0836899422AD2641828D06A18876A02 -:103820009A4288BF5D1A37B1052332460095B847E2 -:10383000284603B0F0BD20462A4632B9BFF35B8F5D -:10384000F6E700F8016B013AF7E78307F9D1330691 -:1038500043EA0643334343EA0623032A03DC3146A3 -:1038600000F05BFAEAE740F8043B043AF5E76FF052 -:103870002105DDE70EB403B07047014B5860704777 -:10388000185D0021014B5868704700BF185D00218A -:10389000014B1870704700BF185D0021014B18786C -:1038A000704700BF185D0021826808B5034622B149 -:1038B0005B690C300BB100F011F8002008BD00006E -:1038C00008B50248FFF74EFE002008BDF4000021B5 -:1038D0000148FFF70CBE00BFF40000212DE9F041C4 -:1038E00085680446CDB1C368002635FA03F218BFD7 -:1038F0000125076818BF9D404FEA850861682A4680 -:103900003846636951F8261000F011F8D4E9023204 -:103910000136D340B3424744F0D2BDE8F08170474E -:103920000020704770477047704770477047704776 -:1039300053B94AB9002908BF00281CBF4FF0FF3116 -:103940004FF0FF3000F080B9ADF1080C6DE904CE06 -:1039500000F006F8DDF804E0DDE9022304B070476A -:103960002DE9F04F099E0D4604460F46002B47D126 -:103970008A4294465FD9B2FA82F343B1C3F120017F -:103980009F4002FA03FC9C4020FA01F10F434FEAEA -:103990001C451FFA8CFE220CB7FBF5F105FB1177D5 -:1039A00001FB0EF042EA0742904208D91CEB0202EA -:1039B00001F1FF3702D2904200F234813946121AE7 -:1039C000A4B2B2FBF5F005FB102200FB0EFE44EAA8 -:1039D0000244A64508D91CEB040400F1FF3202D2D0 -:1039E000A64500F21981104640EA0140A4EB0E04FE -:1039F00000211EB1DC400023C6E90043BDE8F08F82 -:103A00008B4208D9002E00F0FB800021C6E900059A -:103A10000846BDE8F08FB3FA83F100294BD1AB42E1 -:103A2000C0F0F180824240F2EE800846002EE5D0E0 -:103A3000C6E90047E2E702B9FFDEB2FA82F3002BE3 -:103A400040F09D808D1A4FEA124E97B20121B5FBCE -:103A5000FEF20EFB1250250C45EA004507FB02F072 -:103A6000A8420FD91CEB050502F1FF382CBF4FF01F -:103A700001094FF00009A84203D9B9F1000F00F085 -:103A8000CE8042462D1AA4B2B5FBFEF00EFB1055B7 -:103A900000FB07F744EA0544A74208D91CEB0404DD -:103AA00000F1FF3502D2A74200F2B3802846E41BA2 -:103AB00040EA02409DE7C1F120078B4005FA01F47E -:103AC00022FA07FCFD408A404CEA030C20FA07F377 -:103AD0004FEA1C491C431FFA8CFE00FA01F3200C2C -:103AE000B5FBF9F809FB185540EA054508FB0EF04F -:103AF000A8420FD91CEB050508F1FF3A2CBF4FF087 -:103B0000010B4FF0000BA84203D9BBF1000F00F0EE -:103B10008C80D0462D1AA4B2B5FBF9F009FB1055E4 -:103B200000FB0EFE44EA0545AE4507D91CEB050532 -:103B300000F1FF3401D2AE457ED8204640EA08406D -:103B4000A5EB0E05A0FB029845454C46C64602D3A0 -:103B500006D14B4504D20138B9EB020468EB0C0ED8 -:103B6000002E6FD01A1B65EB0E0522FA01F305FA41 -:103B700007F7CD4000211F43C6E900753EE702FA72 -:103B800003FCC3F1200001FA03F24FEA1C4EC140CE -:103B900024FA00F51FFA8CF79C401543B1FBFEF0A8 -:103BA0002A0C0EFB101142EA014200FB07F1914280 -:103BB0000ED91CEB020200F1FF382CBF4FF00109B7 -:103BC0004FF00009914202D9B9F1000F31D04046BF -:103BD000521AADB2B2FBFEF10EFB112245EA0245CC -:103BE00001FB07F2AA4207D91CEB050501F1FF38DA -:103BF00001D2AA4223D84146AD1A41EA004126E744 -:103C000031463046FAE6841A65EB030301201F466D -:103C10000CE7644402384AE764440238E4E6023AB6 -:103C200065442FE702396244C9E6A8F102086544F9 -:103C300070E702386244CBE7023865447EE7023918 -:103C40006544D9E73146D9E6704700BF1FB5144631 -:103C50001A46094B05461B68D8684CB1074B0091C2 -:103C60000749CDE901342B4600F00EF800F02CFD99 -:103C7000044B1C46F3E700BF20010021EB63030166 -:103C8000F8630301F16003010EB403B503AB014611 -:103C9000054853F8042B0068019300F04DF902B079 -:103CA0005DF804EB03B0704720010021024B014690 -:103CB000186800F0A5B800BF20010021024B0146A2 -:103CC000186800F033B800BF200100210A44431EE9 -:103CD000914200D1704710B511F8014B914203F8A1 -:103CE000014FF9D110BD884210B501EB020402D991 -:103CF0008442234607D8431EA14208D011F8012B65 -:103D000003F8012FF8E7024401468A4200D110BDB2 -:103D100013F8014D02F8014DF7E7024403469342C0 -:103D200000D1704703F8011BF9E7000038B50546DC -:103D3000002941D051F8043C0C1F002BB8BFE418F7 -:103D400000F0F2FE1D4A136833B963601460284620 -:103D5000BDE8384000F0EEBEA34208D92068211823 -:103D60008B4201BF19685B6809182160EDE71A46AC -:103D70005B680BB1A342FAD911685018A0420BD16D -:103D800020680144501811608342E0D118685B68D4 -:103D9000014453601160DAE702D90C232B60D6E7A7 -:103DA000206821188B4202BF19685B68091863609C -:103DB00008BF21605460CAE738BD00BF385D0021EC -:103DC00070B50E4E0C460546316811B900F07AFB0D -:103DD00030602146284600F075FB431C0AD0C41C05 -:103DE00024F00304A04207D0211A284600F06AFB01 -:103DF000013001D14FF0FF34204670BD3C5D002101 -:103E00002DE9F041CD1C074625F0030508350C2DA2 -:103E100038BF0C25002D01DBA94205D90C23002653 -:103E20003B603046BDE8F0812E4E00F07DFE3368E9 -:103E30001C4634BB29463846FFF7C2FF431C0446E4 -:103E40004DD134682646002E40D12368314638468D -:103E500004EB030800F036FB80453AD121680335B6 -:103E600038466D1A25F0030508350C2D38BF0C2592 -:103E70002946FFF7A5FF01302BD023682B44236090 -:103E80000EE02268521B1ED40B2A16D96119A342D8 -:103E9000256018BF5960636808BF316062514B608C -:103EA00004F10B06384600F045FE231D26F00706F8 -:103EB000F21AB6D09B1BA350B3E76268A3420CBFB3 -:103EC00032605A60ECE723466468B2E734467668AD -:103ED000B9E70C2338463B6000F02CFEA1E72560D3 -:103EE000DEE700BF385D00219368013B002B936043 -:103EF00010B407DA9469A34201DB0A2902D110BC8D -:103F000000F022BB1368581C10600846197010BCE2 -:103F10007047F8B506460F461446D518AC4201D195 -:103F2000002007E03A4614F8011B3046FFF7DCFF9B -:103F3000431CF3D1F8BD00002DE9F04F0D469DB0B4 -:103F400014469846064618B183690BB900F0D8FCB0 -:103F5000894B9D421BD175686B6ED90705D4AB891F -:103F60009A0502D4A86D00F069FDAB891B0701D545 -:103F70002B69EBB92946304600F038FBC0B16B6EB7 -:103F8000DC070ED54FF0FF301DB0BDE8F08F7B4B46 -:103F90009D4201D1B568DFE7794B9D4208BFF568C6 -:103FA000DAE7AB899805EDD4A86D00F048FDE9E7A4 -:103FB0000023CDF80C804FF00109DFF8C881099388 -:103FC00020238DF8293030238DF82A3023469A4655 -:103FD00013F8012B0AB1252AF9D1BAEB040B0BD047 -:103FE0005B46224629463046FFF793FF013000F03A -:103FF000AA80099A5A4409929AF80030002B00F0DE -:10400000A28000234FF0FF320AF1010A04930793C4 -:104010008DF853301A93CDE90523544605225948AB -:1040200014F8011B00F072FD049AD8B9D10644BF00 -:1040300020238DF85330130744BF2B238DF85330C2 -:104040009AF800302A2B15D0079A544600204FF0DA -:104050000A0C214611F8013B303B092B4ED9B0B177 -:10406000079214E0A0EB0803A24609FA03F31343F6 -:104070000493D2E7039B191D1B68002B0391BBBF60 -:104080005B4242F0020207930793B8BF0492237881 -:104090002E2B0CD163782A2B35D1039B02341A1DA9 -:1040A0001B68002B0392B8BF4FF0FF330593DFF876 -:1040B000D8A003222178504600F028FD40B14023CB -:1040C000A0EB0A00013403FA00F0049B03430493BD -:1040D00014F8011B06222D488DF8281000F016FD5B -:1040E00000283FD02A4B1BBB039B073323F0070359 -:1040F00008330393099B3B44099367E70CFB0232A7 -:104100000C460120A5E7002301344FF00A0C1946A4 -:104110000593204610F8012B303A092A03D9002BC9 -:10412000C5D00591C3E70CFB012104460123F0E74C -:1041300003AB2A4604A930460093164B00E000BFAB -:104140000746781CD6D16B6ED90705D4AB899A0582 -:1041500002D4A86D00F073FCAB895B063FF512AF8B -:10416000099811E703AB2A4604A930460093094B8E -:1041700000F082F8E4E700BF80640301A06403015B -:10418000606403012C64030132640301366403019B -:1041900000000000133F03012DE9F0471646994641 -:1041A0008A6807460B690C46DDF820809342B8BF49 -:1041B0001346336091F843200AB10133336023681A -:1041C000990642BF336802333360256815F006054F -:1041D00006D104F1190AE36832689B1AAB4229DC64 -:1041E00094F84320131E226818BF012392062ED490 -:1041F00004F1430249463846C047013021D02368C4 -:104200001A3454F80E5C03F0060332680026042BBF -:1042100054F8123C08BFAD1A54F80A2C14BF0025FC -:1042200025EAE5759342C4BF9B1AED18B5421AD131 -:10423000002008E00123524649463846C047013075 -:1042400003D14FF0FF30BDE8F0870135C3E7E11837 -:104250005A1C30200233224481F8430094F8451060 -:1042600082F84310C4E70123224649463846C04736 -:104270000130E6D00136D9E72DE9FF470F7E9146A0 -:1042800080460C46782F9A460C9D01F1430207D8D0 -:10429000622F0AD8002F00F0D880582F00F0A3809A -:1042A00004F1420584F842703AE0A7F16303152B4C -:1042B000F6D801A151F823F011430301254303016E -:1042C000A1420301A1420301A1420301A142030152 -:1042D00025430301A1420301A1420301A1420301BD -:1042E000A142030131440301554303011344030177 -:1042F000A1420301A142030153440301A14203016E -:1043000055430301A1420301A14203011B440301E0 -:104310002B681A1D1B682A6004F1420584F842309C -:104320000123A3E020682968060601F104030AD5E9 -:104330000E682B60002E03DA2D23764284F843307A -:104340005E480A2319E00E6810F0400F2B6018BF7A -:1043500036B2EFE72B682068191D2960010601D5E8 -:104360001E6802E04606FBD51E886F2F53480CBF1F -:1043700008230A23002184F843106568002DA560F6 -:10438000A2BF216821F0040121600EB9002D4DD09B -:104390001546B6FBF3F103FB1167C75D05F8017D18 -:1043A00037460E46BB42F4D9082B0BD12368DE07F3 -:1043B00008D5236961689942DEBF302305F8013CC6 -:1043C00005F1FF35521B22614B4603AA21464046A8 -:1043D000CDF800A0FFF7E0FE01304CD14FF0FF30E8 -:1043E00004B0BDE8F087354881F845702968236836 -:1043F00051F8046B29601D0614D5DF0744BF43F054 -:10440000200323601EB9236823F0200323601023B8 -:10441000B0E7236843F0200323607823284884F81A -:104420004530E3E7590648BFB6B2E6E71546BBE7B5 -:104430002B682668181D6169286035061B6801D540 -:10444000196002E07006FBD5198000231546236130 -:10445000BAE72B6800211A1D2A601D686268284689 -:1044600000F054FB08B1401B6060636823610023C7 -:1044700084F84330A8E723692A4649464046D04796 -:104480000130ABD023689B0713D4E068039B9842AC -:10449000B8BF1846A4E70123324649464046D047F4 -:1044A00001309BD00135E36803995B1AAB42F2DC23 -:1044B000EBE7002504F11906F5E700BF3D640301B1 -:1044C0004E64030138B50023054D044608462B60B1 -:1044D000FAF7DCFC431C02D12B6803B1236038BD22 -:1044E000445D002110F8012B11F8013B012A28BF7F -:1044F0009A42F7D0D01A7047034610B572B101390D -:10450000841813F8010B11F8012F904201D1A34236 -:1045100001D1801A10BD0028F3D1FAE71046F9E75F -:104520000139034610B532B111F8014F013A03F8D1 -:10453000014B002CF7D11A440021934200D110BD49 -:1045400003F8011BF9E70000F8B50E4614460546CE -:1045500018B183690BB900F0D3F9214B9C422BD1E0 -:104560006C68A369A360A3891A072FD523696BB36D -:104570002369F6B220683746C01A6369834204DCB7 -:104580002146284600F028F930BBA3680130013BE2 -:10459000A36023685A1C22601E706369834204D0A2 -:1045A000A389DB0706D50A2E04D12146284600F050 -:1045B00013F988B93846F8BD0A4B9C4201D1AC6862 -:1045C000CFE7094B9C4208BFEC68CAE72146284662 -:1045D00000F00CF80028CBD04FF0FF37EAE700BF1F -:1045E00080640301A064030160640301324B70B571 -:1045F0001D6806460C4625B1AB6913B9284600F084 -:104600007FF92E4B9C420FD16C68A389B4F90C2022 -:1046100019072CD4DD0611D40923336042F040037E -:104620004FF0FF30A3813EE0254B9C4201D1AC68A6 -:10463000EBE7244B9C4208BFEC68E6E7580712D52D -:10464000616B41B104F14403994202D03046FFF757 -:104650006DFB00236363A38923F02403A38100235C -:10466000636023692360A38943F00803A38123695E -:104670004BB9A38903F42073B3F5007F03D021461F -:10468000304600F003FAA089B4F90C2010F00103C1 -:104690000AD00023A36063695B42A361236943B925 -:1046A00010F08000BAD170BD810758BF6369A36064 -:1046B000F4E70020F7E700BF200100218064030138 -:1046C000A064030160640301062008B500F060FAED -:1046D000012000F035FB00008A89F8B50546100777 -:1046E0000C4657D44B68002B04DC0B6C002B01DC10 -:1046F0000020F8BDE66A002EFAD0002312F48052A2 -:104700002F682B6032D0606DA3895A0705D5636886 -:10471000C01A636B0BB1236CC01A00230246E66A11 -:104720002846216AB047431CA38906D129681D2960 -:104730002CD8284ACA40D60728D50022D90462605E -:104740002269226004D5421C01D12B6803B960653F -:10475000616B2F600029CBD004F14403994202D051 -:104760002846FFF7E3FA00206063C2E7216A0123CD -:104770002846B047411CC7D12B68002BC4D01D2B45 -:1047800001D0162B01D12F60B2E7A38943F040037B -:10479000A381AEE70F69002FAAD093070E680F60C0 -:1047A0000CBF4B690023F61B8B60002EA0DD334647 -:1047B0003A46216A2846D4F828C0E047002806DC9B -:1047C000A3894FF0FF3043F04003A38191E70744F2 -:1047D000361AEAE70100402038B50B6905460C4659 -:1047E00013B90025284638BD18B183690BB900F00C -:1047F00087F8144B9C421BD16C68B4F90C30002B29 -:10480000EFD0626ED00704D4990502D4A06D00F0F9 -:1048100015F928462146FFF75FFF636E0546DA0764 -:10482000E0D4A3899B05DDD4A06D00F008F9D9E799 -:10483000054B9C4201D1AC68DFE7044B9C4208BFAA -:10484000EC68DAE780640301A0640301606403019B -:10485000002310B504468360818119464366C281F6 -:1048600008228361C0E90033C0E904335C30FFF7FC -:1048700054FA054B24626362044BA362044BE36267 -:10488000044B236310BD00BFC94B0301EB4B030175 -:10489000234C0301474C0301014900F0AFB800BFAE -:1048A000D947030170B568224D1E0E46554305F1E8 -:1048B0007401FFF7A5FA044640B1002105F1680232 -:1048C000C0E900160C30A060FFF727FA204670BD43 -:1048D000014800F0B3B800BF415D0021014800F07D -:1048E000AEB800BF415D0021014800F0A7B800BF8D -:1048F000425D0021014800F0A2B800BF425D0021E6 -:1049000010B50446FFF7F0FFA3691BB1BDE81040E6 -:10491000FFF7F0BFC4E9123323652046124B134A58 -:104920001B68A262A34204BF0123A36100F020F828 -:104930006060204600F01CF8A060204600F018F8E7 -:1049400000220421E0606068FFF782FF0122092154 -:10495000A068FFF77DFF02221221E068FFF778FFD1 -:104960000123A361D2E700BF286403019948030132 -:10497000F8B50746FFF7ACFF1E4B1E68B36913B9C5 -:104980003046FFF7BDFF4836D6E90134013B03D579 -:1049900033680BB33668F7E7B4F90C50D5B9164B4A -:1049A00004F158006566E36000F047F8FFF796FFF2 -:1049B0000822294604F15C002560A561C4E901557F -:1049C000C4E90455FFF7A9F9C4E90D55C4E9125526 -:1049D0002046F8BD6834D9E704213846FFF762FF66 -:1049E000044630600028D5D1FFF778FF0C233B60E8 -:1049F000EEE700BF286403010100FFFF2DE9F84343 -:104A00000646884600F148040027D4E90195B9F12B -:104A1000010905D52468002CF7D13846BDE8F88394 -:104A2000AB89012B07D9B5F90E30013303D02946E4 -:104A30003046C04707436835E9E77047704770471D -:104A400070B50E46B1F90E1096B0144600291D46F9 -:104A500008DAB6F90C3000222A601A0610D44FF496 -:104A600080630EE06A4600F015F90028F1DB019A38 -:104A700002F47042A2F500535A425A412A60EEE70E -:104A800040230020236016B070BD00008B8973B5F1 -:104A90009D0706460C4607D504F1470323602361B2 -:104AA0000123636102B070BD01AB6A46FFF7C8FF26 -:104AB000009905463046FFF7A3F948B9B4F90C3020 -:104AC0009A05EFD423F0030343F00203A381E3E745 -:104AD0000D4BB362A389206043F080032061A38162 -:104AE000009B6361019B5BB1B4F90E10304600F08E -:104AF000E3F828B1A38923F0030343F00103A38162 -:104B0000A0890543A581CDE799480301C9B20346B1 -:104B1000024410B59342184601D1002003E0047806 -:104B200001338C42F6D110BD0148FFF787BF00BFAB -:104B3000405D00210148FFF782BF00BF405D0021BA -:104B40001F2938B504460D4604D9162303604FF0DB -:104B5000FF3038BD426C12B152F821304BB92046BB -:104B600000F030F82A4601462046BDE8384000F003 -:104B700017B8012B0AD0591C03D11623036001205A -:104B8000E7E70024284642F8254098470020E0E760 -:104B9000024B01461868FFF7D3BF00BF2001002178 -:104BA00038B50023064D0446084611462B6000F038 -:104BB000BFF8431C02D12B6803B1236038BD00BF8E -:104BC000445D002100F0ACB810B50C46B1F90E10F0 -:104BD00000F094F80028ABBF636DA3891B1823F481 -:104BE0008053ACBF6365A38110BD2DE9F0411F4622 -:104BF0008B8905460C46DB05164605D502230022A7 -:104C0000B1F90E1000F068F8A3893246B4F90E101D -:104C1000284623F48053A3813B46BDE8F04100F0D1 -:104C200017B810B50C46B1F90E1000F055F8431C3A -:104C3000A38915BF606523F4805343F48053A38197 -:104C400018BFA38110BDB1F90E1000F013B8000019 -:104C500038B50446064D0846114600222A601A4619 -:104C6000FAF712F9431C02D12B6803B1236038BD57 -:104C7000445D002138B50023054D044608462B60ED -:104C8000FAF7F8F8431C02D12B6803B1236038BD52 -:104C9000445D002138B50023064D04460846114600 -:104CA0002B60FAF7E9F8431C02D12B6803B12360AB -:104CB00038BD00BF445D002138B50023054D0446D2 -:104CC00008462B60FAF7DAF8431C02D12B6803B1CF -:104CD000236038BD445D002138B50446064D0846C2 -:104CE000114600222A601A46FAF7CAF8431C02D17C -:104CF0002B6803B1236038BD445D002138B50446FC -:104D0000064D0846114600222A601A46FAF7BAF8FC -:104D1000431C02D12B6803B1236038BD445D0021E0 -:104D2000024B58224FF0FF301A607047445D00215B -:104D3000024B58224FF0FF301A607047445D00214B -:104D4000FEE700BFF8B500BFF8BC08BC9E46704740 -:104D5000F8B500BFF8BC08BC9E4670477372616D21 -:104D6000782E73686D0067656E65726963006E7298 -:104D7000665F62745F686369000000007538030154 -:104D80000600000001000000020000000400000016 -:104D9000080000001000000020000000400000009B -:104DA000800000000001000000020000000400007C -:104DB000000800000010000000200000004000007B -:104DC000008000000100000002000000040000005C -:104DD000080000001000000020000000400000005B -:104DE000800000000001000000020000000400003C -:104DF000000800000010000000200000004000003B -:104E00000080000001000000C12D0001CD2D000137 -:104E1000D92D00010000000000000000000000008B -:104E20000000000000000000DD2D0001030000086C -:104E30000300000402000000500C002102000000EA -:104E4000540C002182868A8EA2A6AAAEC2C6CACE01 -:104E5000E2E6EAEE1115191D3135393D5155595D1E -:104E60007175797D081014182030343840444C5C3A -:104E700058607078F4ECE8E4DCCCC8C4BCB8B0A0EE -:104E8000A49C8C841000100000000000C8140021B5 -:104E9000D80F002138190021314749420000000095 -:104EA00000000000000000003247494233474942F9 -:104EB0000B01000DFFFF0203FFFF040F05060700B3 -:104EC000F401FA00960064004B0032001E0014004A -:104ED000403D0021B041002120460021BD1A3CCDBB -:104EE000A6B8995899B740EB7B60FF4A503F10D263 -:104EF000E3B3C974385FC5A3D4F6493F00E69D35D6 -:104F00000E480103CCDBFDF4AC1191F4EFB9A5F927 -:104F1000E9A7832C5E2CBE97F2D203B0208BD289F6 -:104F200015D08E1C742430ED8FC24563765C15520B -:104F30005ABF9A32636DEB2A65499C80DC00000001 -:104F400007FA010179FA01013BFA010100000000B2 -:104F50007D68000109690001000000004D69000141 -:104F6000E968000165690001E9680001156900014F -:104F700000000000000000000F6900010F6900013F -:104F80002D6900014D690001000000000F6900015A -:104F90000F690001496900014D690001000100002D -:104FA00000030102000103020200020303030003E5 -:104FB00000000000B56B00010000000000000000D0 -:104FC00000000000000000004D6C00010000000027 -:104FD0004D6C0001756C0001396C0001000000008F -:104FE00000000000000000000000000000000000C1 -:104FF00000000000C56C000100000000000000007F -:10500000000000000000000000000000C56C00016E -:10501000000100000000030102020001020202027E -:10502000020003030303000000000000856A000182 -:10503000416B000100000000FD6A0001F56A0001FB -:10504000FD6A00010000000000000000896B000103 -:10505000496B0001996B000100000000756B0001B5 -:10506000756B0001996B0001000100000301020053 -:10507000030202000303030000000000656F00014B -:10508000000000000000000000000000B16F0001FF -:1050900000000000B16F000100000000C16F0001BE -:1050A000000000000000000000000000BD6F0001D3 -:1050B00000000000000000000000000000000000F0 -:1050C000BD6F0001000000000001000000030102AC -:1050D00001020302020002030303000300000000B8 -:1050E000956D0001000000000000000000000000BD -:1050F00000000000396F0001000000000000000007 -:10510000156F0001116F0001000000000000000099 -:10511000000000000000000000000000000000008F -:105120004D6F0001000000000000000000000000C2 -:1051300000000000000000004D6F000100000000B2 -:105140008570000109710001B970000100000000C4 -:10515000E970000109710001E97000010000000020 -:1051600015710001000000000F7100010F710001B6 -:1051700000000000B9720001000000000F71000182 -:105180000F71000100000000D37200010001000156 -:1051900000030102010003020202000303030300F3 -:1051A000A9790001357A0001DD790001E979000172 -:1051B000F57900011D7A00010100010075790001F7 -:1051C00059730001CF740001E57300010000000075 -:1051D000000000005579000161740001B574000100 -:1051E00000000000E174000193770001000000005E -:1051F000D7740001D774000100000000617700013E -:105200000000000000000000D7740001D774000106 -:10521000000000007B770001000000000001000199 -:105220000000030102010001030202020002030365 -:105230000303000300000000DD7700010000000010 -:105240000000000000000000D9780001E9780001AA -:105250000000000000000000E1780001E17800019A -:105260009579000100000000E1780001E17800017B -:105270000000000000010000030102000302020020 -:1052800003030300000000007F7A0001000000001B -:10529000000000000000000000000000000000000E -:1052A00000000000EB7B000100000000EB7B000130 -:1052B000917A0001000000000000000000000000E2 -:1052C00000000000000000000000000000000000DE -:1052D00000000000E17B0001337C00013B7C000109 -:1052E000437C0001000000000000000000000000FE -:1052F00000000000000000000000000000000000AE -:10530000437C0001000000000000000000000000DD -:10531000000000000000000000000000000000008D -:10532000437C0001000100000000000004010302B2 -:105330000101030104020302030303000403030346 -:105340000303030304040404040404040000000031 -:10535000837C00010000000000000000000000004D -:10536000B97D000100000000F17C00015D7D0001BD -:10537000000000000000000000000000000000002D -:105380005D7D0001CF7D00010000000000000000F5 -:105390000000000000000000CF7D000100010000BF -:1053A00000030101020003020202000303030300E1 -:1053B00000000000E1A90001F1AC000100000000C4 -:1053C00025AB0001D9AC000125AB000145AB0001C4 -:1053D00000000000D9AC0001000000004DAC00014D -:1053E00000000000D9AC0001F1AC0001A5AC000147 -:1053F0000001000003010200030202000303030096 -:105400000000000000000000C1AD0001000000002D -:1054100013AD0001A9AD000113AD0001AD9D000168 -:1054200000000000A9AD0001000000002DAD00014A -:1054300000000000A9AD0001C1AD00012DAD0001CB -:105440000001000003010200030202000303030045 -:1054500097810001C9810001E5810001E981000116 -:10546000000000000000000000000000000000003C -:1054700000000000DD8100010101010100010101C6 -:105480000100000079830001D91B0201D91B020130 -:10549000000000000000000000000000000000000C -:1054A00000000000E1850001BD850001D5860001F6 -:1054B0000B870001258700010000000000000000AC -:1054C000D91B0201D91B02010000000000000000EE -:1054D00000000000000000000100000000000001CA -:1054E00002000000000002020202020200000000AE -:1054F000B98B0001358C00010000000000000000A5 -:10550000000000000000000000000000000000009B -:10551000651D02015D880001218800010000000076 -:105520000000000000000000651D020100000000F6 -:10553000000000000000000001890001218C000132 -:1055400000000000651D02010000000000000000D6 -:10555000000000000000000000000000000000004B -:10556000010100000000000101020001010102022E -:105570000202030000030303030303000403FFFF0D -:10558000FFFF070405FFFF030704FFFF07FFFF04FA -:1055900005FFFFFF03FFFF030405FFFFFFFFFFFF02 -:1055A000FFFFFF0303030000E592000135920001B5 -:1055B000D19200010000000000000000898F00016E -:1055C0009D8F00010190000100000000000000001C -:1055D0000000000041900001D59000018990000179 -:1055E000D590000100000000A5990001C1910001C3 -:1055F000A5990001C19100011195000139950001A3 -:105600009D9500013F9500019D950001000000005F -:1056100091960001D59600010000000000000000F6 -:10562000459B0001559B0001659B000100000000A7 -:10563000000000006598000175980001B598000110 -:10564000AD980001B598000100000000E19700014D -:10565000019A0001619800010000000000000000B4 -:1056600001970001699700016198000100000000A6 -:10567000C3280201000000000000000039280201D8 -:10568000000000000000000000000000000000001A -:105690008F2802012D28020100000000C32802010A -:1056A00007280201B92B02010000000000000000E1 -:1056B00000000000000000000000000000000000EA -:1056C0000000000000000000BD27020100000000F3 -:1056D00000000000C3270201E92702016D2C02012E -:1056E00000000000D72702010000000000000000B9 -:1056F00000000000BD2702010000000000000000C3 -:10570000C3270201C327020100000000E12B0201B0 -:10571000000000000000000000000000532802010B -:10572000020000010000000002010001030001016D -:105730000101010101010202020203000003020251 -:10574000020303030303030003030300C92C020144 -:10575000372C02010000000000000000252C02018F -:1057600000000000000000009D2C0201052C020139 -:10577000B12B02010B2C0201B92B0201B12B02014A -:10578000F92B0201000000009D2C0201052C0201F2 -:10579000512C02010000000000000000252C020135 -:1057A0006D2C02010000000000000000052C020129 -:1057B000B12B02010000000000000000B12B02012B -:1057C00000000000E12B02010000000002010000C7 -:1057D00003000000010102000101010102010202B7 -:1057E000030000020303030303030003B3300201B9 -:1057F00015A7000115A7000115A7000115A70001B5 -:1058000000000000000000002931020115A700017E -:1058100015A7000115A7000115A700016D300201B1 -:10582000F5300201293102014D31020115A70001B5 -:1058300015A7000115A7000100000000F5300201C6 -:105840002931020115A700012F31020115A700011E -:1058500015A7000100000000F53002012931020106 -:1058600015A7000115A70001C530020115A7000109 -:1058700000000000F53002019D30020115A7000173 -:1058800015A7000115A7000115A7000100000000E1 -:10589000000000002931020115A7000115A7000131 -:1058A00015A7000115A700018B30020100000000C0 -:1058B0002931020115A7000115A7000115A7000154 -:1058C0004330020100000000000000000100000061 -:1058D00000000001010101010200020302020202B4 -:1058E0000003030403030300040404050404000686 -:1058F0000505050505050606060606070007070750 -:1059000007020707A133020115A7000115A700012F -:1059100015A70001000000000000000000000000CA -:1059200015A7000115A7000115A7000115A7000183 -:1059300000000000000000006134020115A7000112 -:1059400015A7000115A7000115A7000135340201B4 -:10595000F33302010000000015A70001B933020172 -:1059600015A7000115A700010000000000000000BD -:105970000000000015A7000115A700017F330201F8 -:1059800015A700010000000000000000000000005A -:1059900015A7000115A7000115A7000115A7000113 -:1059A00000000000000000006D33020115A7000197 -:1059B00015A7000115A70001EFA5000100000000D8 -:1059C00000000000000000000100000000000001D5 -:1059D00001010101010202020202030002030403A9 -:1059E0000303030304040504040404050505050575 -:1059F000050606060600060606000000C537020179 -:105A000000000000B33702010000000000000000A9 -:105A1000053C0201053C020100000000AD37020117 -:105A200000000000A5370201000000000000000097 -:105A300000000000000000006D3D0201AD370201D2 -:105A4000CD380201A5370201753C0201E93A020195 -:105A5000000000000000000000000000AD3702015F -:105A600000000000A5370201000000000000000057 -:105A7000000000000000000083380201AD37020181 -:105A800000000000A537020100000000E93A020111 -:105A90000000000000000000000000000100030002 -:105AA00000010300010101010101010202040200E1 -:105AB00000020202030303030303030404040400BB -:105AC00000040404573C020100000000413C0201B4 -:105AD0000000000000000000053C02010000000082 -:105AE000E13A020100000000533C02010000000006 -:105AF00000000000053C02016D3D0201E13A020197 -:105B0000193C0201533C0201753C0201B53C020103 -:105B1000053C020100000000E13A02010000000023 -:105B200000000000753C02010000000000000000C1 -:105B3000033E0201E13A0201193C020100000000AB -:105B4000753C0201000000000000000000000000A1 -:105B5000E13A020100000000000000000000000027 -:105B6000E93A02010000000000000000010003000B -:105B7000000100010103010101020205030000020E -:105B800002030303030303040405040404040405DB -:105B900005050500050502000000100010000000CA -:105BA0000000000080841E0040420F0020A107007A -:105BB0000071020080380100409C00008813000042 -:105BC0000000000040420F00A086010050C300000A -:105BD0001027000088130000C4090000E204000040 -:105BE0007102000000000000963007772C610EEE75 -:105BF000BA51099919C46D078FF46A7035A563E924 -:105C0000A395649E3288DB0EA4B8DC791EE9D5E04A -:105C100088D9D2972B4CB609BD7CB17E072DB8E749 -:105C2000911DBF906410B71DF220B06A4871B9F39E -:105C3000DE41BE847DD4DA1AEBE4DD6D51B5D4F4D7 -:105C4000C785D38356986C13C0A86B647AF962FD3C -:105C5000ECC9658A4F5C0114D96C0663633D0FFA89 -:105C6000F50D088DC8206E3B5E10694CE44160D58F -:105C7000727167A2D1E4033C47D4044BFD850DD279 -:105C80006BB50AA5FAA8B5356C98B242D6C9BBDB8C -:105C900040F9BCACE36CD832755CDF45CF0DD6DC87 -:105CA000593DD1ABAC30D9263A00DE518051D7C82E -:105CB0001661D0BFB5F4B42123C4B3569995BACFB9 -:105CC0000FA5BDB89EB802280888055FB2D90CC6DA -:105CD00024E90BB1877C6F2F114C6858AB1D61C153 -:105CE0003D2D66B69041DC760671DB01BC20D29872 -:105CF0002A10D5EF8985B1711FB5B606A5E4BF9FFF -:105D000033D4B8E8A2C9077834F9000F8EA80996F1 -:105D100018980EE1BB0D6A7F2D3D6D08976C64915C -:105D2000015C63E6F4516B6B62616C1CD830658575 -:105D30004E0062F2ED95066C7BA5011BC1F4088252 -:105D400057C40FF5C6D9B06550E9B712EAB8BE8B93 -:105D50007C88B9FCDF1DDD62492DDA15F37CD38C1C -:105D6000654CD4FB5861B24DCE51B53A7400BCA31A -:105D7000E230BBD441A5DF4AD795D83D6DC4D1A44C -:105D8000FBF4D6D36AE96943FCD96E34468867AD23 -:105D9000D0B860DA732D0444E51D03335F4C0AAAC2 -:105DA000C97C0DDD3C710550AA41022710100BBEC5 -:105DB00086200CC925B56857B3856F2009D466B90C -:105DC0009FE461CE0EF9DE5E98C9D9292298D0B041 -:105DD000B4A8D7C7173DB359810DB42E3B5CBDB7EE -:105DE000AD6CBAC02083B8EDB6B3BF9A0CE2B6036F -:105DF0009AD2B1743947D5EAAF77D29D1526DB0424 -:105E00008316DC73120B63E3843B64943E6A6D0D6E -:105E1000A85A6A7A0BCF0EE49DFF099327AE000AB9 -:105E2000B19E077D44930FF0D2A3088768F2011E4C -:105E3000FEC206695D5762F7CB67658071366C19E3 -:105E4000E7066B6E761BD4FEE02BD3895A7ADA1004 -:105E5000CC4ADD676FDFB9F9F9EFBE8E43BEB717E5 -:105E6000D58EB060E8A3D6D67E93D1A1C4C2D8386F -:105E700052F2DF4FF167BBD16757BCA6DD06B53FD5 -:105E80004B36B248DA2B0DD84C1B0AAFF64A033614 -:105E9000607A0441C3EF60DF55DF67A8EF8E6E3193 -:105EA00079BE69468CB361CB1A8366BCA0D26F25DC -:105EB00036E2685295770CCC03470BBBB916022229 -:105EC0002F260555BE3BBAC5280BBDB2925AB42B3E -:105ED000046AB35CA7FFD7C231CFD0B58B9ED92C53 -:105EE0001DAEDE5BB0C2649B26F263EC9CA36A75B8 -:105EF0000A936D02A906099C3F360EEB856707726F -:105F000013570005824ABF95147AB8E2AE2BB17BD5 -:105F1000381BB60C9B8ED2920DBED5E5B7EFDC7C5C -:105F200021DFDB0BD4D2D38642E2D4F1F8B3DD68B3 -:105F30006E83DA1FCD16BE815B26B9F6E177B06FAE -:105F40007747B718E65A0888706A0FFFCA3B06669B -:105F50005C0B0111FF9E658F69AE62F8D3FF6B6128 -:105F600045CF6C1678E20AA0EED20DD75483044ECA -:105F7000C2B30339612667A7F71660D04D47694958 -:105F8000DB776E3E4A6AD1AEDC5AD6D9660BDF406B -:105F9000F03BD83753AEBCA9C59EBBDE7FCFB2471E -:105FA000E9FFB5301CF2BDBD8AC2BACA3093B35303 -:105FB000A6A3B4240536D0BA9306D7CD2957DE540C -:105FC000BF67D9232E7A66B3B84A61C4021B685DE5 -:105FD000942B6F2A37BE0BB4A18E0CC31BDF055A5E -:105FE0008DEF022D010000000001030406000000F7 -:105FF000000000000000000000000000870000001A -:1060000004000302000000000080014101080000BC -:1060100001010000040003020000000000900141A3 -:106020000208000000000000000000000100010064 -:1060300096C298D84539A1F4A033EB2D817D037722 -:10604000F240A463E5E6BCF847422CE1F2D1176BBD -:10605000F551BF376840B6CBCE5E316B5733CE2B90 -:10606000169E0F7C4AEBE78E9B7F1AFEE242E34FBF -:106070004B60D2273E3CCE3BF6B053CCB0061D65FC -:10608000BC86987655BDEBB3E7933AAAD835C65A85 -:10609000512563FCC2CAB9F3849E17A7ADFAE6BCCA -:1060A000FFFFFFFFFFFFFFFF00000000FFFFFFFFFC -:1060B000FFFFFFFFFFFFFFFFFFFFFFFF00000000EC -:1060C000000000000000000001000000FFFFFFFFD3 -:1060D00025733A2066726565696E67206E6F6E2D56 -:1060E000656D707479207669727471756575650D6A -:1060F0000A0056513A202573202D2073697A653D98 -:1061000025643B20667265653D25643B207175659D -:106110007565643D25643B20646573635F686561F4 -:10612000645F6964783D25643B20617661696C2E0B -:106130006964783D25643B20757365645F636F6EA9 -:10614000735F6964783D25643B20757365642E69CF -:1061500064783D25643B20617661696C2E666C61D4 -:1061600067733D307825783B20757365642E666CC7 -:106170006167733D307825780D0A0073746174751A -:1061800073203D3D2073697A656F662872705F6881 -:10619000647229002F6A656E6B696E735F776F7228 -:1061A0006B73706163652F776F726B73706163657A -:1061B0002F4F63746176655F7061636B65746372A2 -:1061C0006166745F6275696C645F6D61737465723A -:1061D0002F6E6F726469632E7374642F74686972B2 -:1061E0006470617274792F4F70656E414D502F6FDE -:1061F00070656E2D616D702F6C69622F72706D739A -:10620000672F72706D73675F76697274696F2E6342 -:1062100000737461747573203D3D203000737461A8 -:10622000747573203E3D2030007374617475732063 -:106230003D3D206C656E0072785F76710074785F0A -:106240007671004E5300000072706D73675F76695F -:106250007274696F5F73656E645F6F6666636861B1 -:106260006E6E656C5F6E6F636F70790072706D73C8 -:10627000675F76697274696F5F72785F63616C6C77 -:106280006261636B0072706D73675F7669727469C7 -:106290006F5F73656E645F6F66666368616E6E657F -:1062A0006C5F7261770000000002000000020000D5 -:1062B0004E6574776F726B00426C6F636B00436F57 -:1062C0006E736F6C6500456E74726F707900426119 -:1062D0006C6C6F6F6E00494F4D656D6F7279005336 -:1062E000435349003950205472616E73706F727459 -:1062F0000000000001000000B06203010200000085 -:10630000B862030103000000BE6203010400000044 -:10631000C662030105000000CE6203010600000012 -:10632000D662030108000000DF62030109000000DB -:10633000E46203010000000000000000756E726559 -:106340006769737465726564202573206275730ACA -:106350000064657669636520262620646576696336 -:10636000652D3E627573002F6A656E6B696E735F93 -:10637000776F726B73706163652F776F726B737079 -:106380006163652F4F63746176655F7061636B65F0 -:106390007463726166745F6275696C645F6D61736A -:1063A0007465722F6E6F726469632E7374642F74D8 -:1063B0006869726470617274792F4F70656E414DB7 -:1063C000502F6C69626D6574616C2F6C69622F640B -:1063D00065766963652E63006D6574616C5F6465E5 -:1063E000766963655F636C6F7365002C2066756EFC -:1063F0006374696F6E3A2000617373657274696FBC -:106400006E2022257322206661696C65643A2066DD -:10641000696C6520222573222C206C696E6520250D -:1064200064257325730A000024010021232D302BDD -:106430002000686C4C006566674546470030313285 -:1064400033343536373839414243444546003031DC -:10645000323334353637383961626364656600003B -:10646000000000000000000000000000000000002C -:10647000000000000000000000000000000000001C -:10648000000000000000000000000000000000000C -:1064900000000000000000000000000000000000FC -:1064A00000000000000000000000000000000000EC -:1064B00000000000000000000000000000000000DC -:0864C000A0D4FF7F01000000E1 -:1064C8005C4D0301000000000100000004000720EB -:1064D8005400002100000000FFFFFFFFFFFFFFFF47 -:1064E80000000000000000000000000000000000A4 -:1064F8000000000000000000000000000000000094 -:106508000000000000000000000000000000000083 -:106518000000000004000720FFFFFFFF1F0000002D -:10652800FFFFFFFF00000000000000000000000067 -:106538000000000000000000000000000000000053 -:106548000000000000000000000000000000000043 -:106558000000000000000000000000000000000033 -:106568000000000000000000000000000000000023 -:106578000000000000000000000000000000000013 -:106588000000000000000000000000000000000003 -:10659800000000000000000000000000FF000000F4 -:1065A80000000000000000000090D00300FB00FB8A -:1065B80069100301664D0301000000005134030116 -:1065C800000000000000000091340301CD340301F5 -:1065D80000000000000000000000000000000000B3 -:1065E800240100210000000080640301A06403016D -:1065F80060640301000000000000000000000000CB -:106608000000000000000000000000000000000082 -:106618000000000000000000000000000000000072 -:106628000000000000000000000000000000000062 -:106638000000000000000000000000000000000052 -:04664800000000004E -:040000050102EDB94E -:00000001FF diff --git a/lib/bin/bt_ll_acs_nrf53/bin/manifest.yaml b/lib/bin/bt_ll_acs_nrf53/bin/manifest.yaml deleted file mode 100644 index 869f9471e0b3..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/bin/manifest.yaml +++ /dev/null @@ -1,7 +0,0 @@ -description: LE Audio Controller Subsystem for nRF53 -git_revision: 3c350ba58d499b9716ceda639b390b2931e57dec -ll_subversion_number: '0x49F1' -ll_version_number: '0x0B' -ll_subversion_number_decimal: '18929' -ll_version_number_decimal: '11' -timestamp: '2024-02-28T13:06:23Z' diff --git a/lib/bin/bt_ll_acs_nrf53/include/ble_hci_vsc.h b/lib/bin/bt_ll_acs_nrf53/include/ble_hci_vsc.h deleted file mode 100644 index 477b5c10638a..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/include/ble_hci_vsc.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/** - * @file ble_hci_vsc.h - * - * @defgroup ble_hci_vsc_api LE Audio Controller for nRF5340 API - * @{ - */ - -#ifndef _BLE_HCI_VSC_H_ -#define _BLE_HCI_VSC_H_ - -#include - -#define HCI_OPCODE_VS_SET_PRI_ADV_CHAN_MAX_TX_PWR BT_OP(BT_OGF_VS, 0x000) -#define HCI_OPCODE_VS_SET_LED_PIN_MAP BT_OP(BT_OGF_VS, 0x001) -#define HCI_OPCODE_VS_CONFIG_FEM_PIN BT_OP(BT_OGF_VS, 0x002) -#define HCI_OPCODE_VS_SET_RADIO_FE_CFG BT_OP(BT_OGF_VS, 0x3A3) -#define HCI_OPCODE_VS_SET_BD_ADDR BT_OP(BT_OGF_VS, 0x3F0) -#define HCI_OPCODE_VS_SET_OP_FLAGS BT_OP(BT_OGF_VS, 0x3F3) -#define HCI_OPCODE_VS_SET_ADV_TX_PWR BT_OP(BT_OGF_VS, 0x3F5) -#define HCI_OPCODE_VS_SET_CONN_TX_PWR BT_OP(BT_OGF_VS, 0x3F6) - -/* This bit setting enables the flag from controller - * if an ISO packet is lost. - */ -#define BLE_HCI_VSC_OP_ISO_LOST_NOTIFY (1 << 17) -#define BLE_HCI_VSC_OP_DIS_POWER_MONITOR (1 << 15) - -/** @brief nRF21540 Front End Module (FEM) pin definitions. */ -struct ble_hci_vs_cp_nrf21540_pins { - uint16_t mode; - uint16_t txen; - uint16_t rxen; - uint16_t antsel; - uint16_t pdn; - uint16_t csn; -} __packed; - -/** @brief Host-Controller Interface vendor-specific response data. */ -struct ble_hci_vs_rp_status { - int8_t status; -} __packed; - -/** @brief Host-Controller Interface vendor-specific structure for setting custom flags. */ -struct ble_hci_vs_cp_set_op_flag { - uint32_t flag_bit; - uint8_t setting; -} __packed; - -/** @brief Host-Controller Interface vendor-specific Bluetooth address. */ -struct ble_hci_vs_cp_set_bd_addr { - uint8_t bd_addr[6]; -} __packed; - -/** @brief Host-Controller Interface vendor-specific advertising TX power. */ -struct ble_hci_vs_cp_set_adv_tx_pwr { - int8_t tx_power; -} __packed; - -/** @brief Host-Controller Interface vendor-specific connection TX power. */ -struct ble_hci_vs_cp_set_conn_tx_pwr { - uint16_t handle; - int8_t tx_power; -} __packed; - -/** @brief Host-Controller Interface vendor-specific LED pin mapping. */ -struct ble_hci_vs_cp_set_led_pin_map { - uint8_t id; - uint8_t mode; - uint16_t pin; -} __packed; - -/** @brief Host-Controller Interface vendor-specific Front End Module (FEM) configuration. */ -struct ble_hci_vs_cp_set_radio_fe_cfg { - int8_t max_tx_power; - uint8_t ant_id; -} __packed; - -/** @brief Host-Controller Interface vendor-specific connection max TX power values.*/ -enum ble_hci_vs_max_tx_power { - BLE_HCI_VSC_MAX_TX_PWR_0dBm = 0, - BLE_HCI_VSC_MAX_TX_PWR_3dBm = 3, - BLE_HCI_VSC_MAX_TX_PWR_10dBm = 10, - BLE_HCI_VSC_MAX_TX_PWR_20dBm = 20 -}; - -/** @brief Host-Controller Interface vendor-specific connection TX power values.*/ -enum ble_hci_vs_tx_power { - BLE_HCI_VSC_TX_PWR_0dBm = 0, - BLE_HCI_VSC_TX_PWR_Neg1dBm = -1, - BLE_HCI_VSC_TX_PWR_Neg2dBm = -2, - BLE_HCI_VSC_TX_PWR_Neg3dBm = -3, - BLE_HCI_VSC_TX_PWR_Neg4dBm = -4, - BLE_HCI_VSC_TX_PWR_Neg5dBm = -5, - BLE_HCI_VSC_TX_PWR_Neg6dBm = -6, - BLE_HCI_VSC_TX_PWR_Neg7dBm = -7, - BLE_HCI_VSC_TX_PWR_Neg8dBm = -8, - BLE_HCI_VSC_TX_PWR_Neg12dBm = -12, - BLE_HCI_VSC_TX_PWR_Neg16dBm = -16, - BLE_HCI_VSC_TX_PWR_Neg20dBm = -20, - BLE_HCI_VSC_TX_PWR_Neg40dBm = -40, - BLE_HCI_VSC_PRI_EXT_ADV_MAX_TX_PWR_DISABLE = 127, -}; - -/** @brief Host-Controller Interface vendor-specific LED functions.*/ -enum ble_hci_vs_led_function_id { - PAL_LED_ID_CPU_ACTIVE = 0x10, - PAL_LED_ID_ERROR = 0x11, - PAL_LED_ID_BLE_TX = 0x12, - PAL_LED_ID_BLE_RX = 0x13, -}; - -/** @brief Host-Controller Interface vendor-specific LED modes of operation.*/ -enum ble_hci_vs_led_function_mode { - PAL_LED_MODE_ACTIVE_LOW = 0x00, - PAL_LED_MODE_ACTIVE_HIGH = 0x01, - PAL_LED_MODE_DISABLE_TOGGLE = 0xFF, -}; - -/** - * @brief Set the pins to be used by the nRF21540 Front End Module (FEM). - * - * @param nrf21540_pins Pointer to a struct containing the pins. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_nrf21540_pins_set(struct ble_hci_vs_cp_nrf21540_pins *nrf21540_pins); - -/** - * @brief Enable VREGRADIO.VREQH in the network core for getting extra TX power. - * - * @param max_tx_power Max TX power to set. - * - * @note If the nRF21540 is not used, setting max_tx_power to 10 or 20 will - * result in +3 dBm. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_radio_high_pwr_mode_set(enum ble_hci_vs_max_tx_power max_tx_power); - -/** - * @brief Set Bluetooth MAC device address. - * - * @param bd_addr Bluetooth MAC device address. - * - * @note This can be used to set a public address for the device. - * bt_setup_public_id_addr(void) should be called - * after this function to properly set the address. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_bd_addr_set(uint8_t *bd_addr); - -/** - * @brief Set the controller operation mode flag. - * - * @param flag_bit The target bit in operation mode flag. - * @param setting The setting of the bit. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_op_flag_set(uint32_t flag_bit, uint8_t setting); - -/** - * @brief Set the advertising TX power. - * - * @param tx_power TX power setting for the advertising. - * Check ble_hci_vs_tx_power for possible settings. - * - * @note If extended advertising is used, the TX power for - * both the primary and secondary advertisement channels - * is changed. In other words, the TX power for all - * Bluetooth Low Energy channels is changed. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_adv_tx_pwr_set(enum ble_hci_vs_tx_power tx_power); - -/** - * @brief Set TX power for specific connection. - * - * @param conn_handle Specific connection handle for the TX power setting. - * @param tx_power TX power setting for the specific connection handle. - * Check ble_hci_vs_tx_power for possible settings. - * - * @note The TX power for the primary advertisement channels - * (37, 38 and 39) will not be affected. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_conn_tx_pwr_set(uint16_t conn_handle, enum ble_hci_vs_tx_power tx_power); - -/** - * @brief Set the maximum transmit power on primary advertising channels. - * - * @param tx_power TX power setting for the primary advertising channels. - * Please check ble_hci_vs_tx_power for possible settings. - * Set to BLE_HCI_VSC_PRI_EXT_ADV_MAX_TX_PWR_DISABLE (-127) for - * disabling this feature. - * - * @note BLE channels 37, 38 and 39 are the primary advertising channels. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_pri_adv_chan_max_tx_pwr_set(enum ble_hci_vs_tx_power tx_power); - -/** - * @brief Map LED pin to a specific controller function. - * - * @details Only support for gpio0 (pin 0-31). - * - * @param id Describes the LED function. - * Please check ble_hci_vs_led_function_id for possible IDs. - * @param mode Describes how the pin is toggled. - * Please check ble_hci_vs_led_function_mode for possible modes. - * @param pin Pin designator of the GPIO. - * - * @return 0 for success, error otherwise. - */ -int ble_hci_vsc_led_pin_map(enum ble_hci_vs_led_function_id id, - enum ble_hci_vs_led_function_mode mode, uint16_t pin); - -/** @} */ - -#endif /* _BLE_HCI_VSC_H_ */ diff --git a/lib/bin/bt_ll_acs_nrf53/src/ble_hci_vsc.c b/lib/bin/bt_ll_acs_nrf53/src/ble_hci_vsc.c deleted file mode 100644 index 1420540ccf6f..000000000000 --- a/lib/bin/bt_ll_acs_nrf53/src/ble_hci_vsc.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include "ble_hci_vsc.h" -#include - -#include -LOG_MODULE_REGISTER(ble_hci_vsc, CONFIG_BLE_HCI_VSC_LOG_LEVEL); - -int ble_hci_vsc_nrf21540_pins_set(struct ble_hci_vs_cp_nrf21540_pins *nrf21540_pins) -{ - int ret; - struct net_buf *buf = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_CONFIG_FEM_PIN, sizeof(*nrf21540_pins)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - net_buf_add_mem(buf, nrf21540_pins, sizeof(*nrf21540_pins)); - - ret = bt_hci_cmd_send(HCI_OPCODE_VS_CONFIG_FEM_PIN, buf); - - return ret; -} - -int ble_hci_vsc_radio_high_pwr_mode_set(enum ble_hci_vs_max_tx_power max_tx_power) -{ - int ret; - struct ble_hci_vs_cp_set_radio_fe_cfg *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_RADIO_FE_CFG, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->max_tx_power = max_tx_power; - cp->ant_id = 0; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_RADIO_FE_CFG, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_RADIO_FE_CFG"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - - return ret; -} - -int ble_hci_vsc_bd_addr_set(uint8_t *bd_addr) -{ - int ret; - struct ble_hci_vs_cp_set_bd_addr *cp; - struct net_buf *buf = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_BD_ADDR, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - cp = net_buf_add(buf, sizeof(*cp)); - memcpy(cp, bd_addr, sizeof(*cp)); - - ret = bt_hci_cmd_send(HCI_OPCODE_VS_SET_BD_ADDR, buf); - return ret; -} - -int ble_hci_vsc_op_flag_set(uint32_t flag_bit, uint8_t setting) -{ - int ret; - struct ble_hci_vs_cp_set_op_flag *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_OP_FLAGS, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - cp = net_buf_add(buf, sizeof(*cp)); - cp->flag_bit = flag_bit; - cp->setting = setting; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_OP_FLAGS, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_OP_FLAGS"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - - return ret; -} - -int ble_hci_vsc_adv_tx_pwr_set(enum ble_hci_vs_tx_power tx_power) -{ - int ret; - struct ble_hci_vs_cp_set_adv_tx_pwr *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_ADV_TX_PWR, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - cp = net_buf_add(buf, sizeof(*cp)); - cp->tx_power = tx_power; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_ADV_TX_PWR, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_ADV_TX_PWR"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - - return ret; -} - -int ble_hci_vsc_conn_tx_pwr_set(uint16_t conn_handle, enum ble_hci_vs_tx_power tx_power) -{ - int ret; - struct ble_hci_vs_cp_set_conn_tx_pwr *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_CONN_TX_PWR, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - cp = net_buf_add(buf, sizeof(*cp)); - cp->handle = conn_handle; - cp->tx_power = tx_power; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_CONN_TX_PWR, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_CONN_TX_PWR"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - - return ret; -} - -int ble_hci_vsc_pri_adv_chan_max_tx_pwr_set(enum ble_hci_vs_tx_power tx_power) -{ - int ret; - struct ble_hci_vs_cp_set_adv_tx_pwr *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_PRI_ADV_CHAN_MAX_TX_PWR, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - cp = net_buf_add(buf, sizeof(*cp)); - cp->tx_power = tx_power; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_PRI_ADV_CHAN_MAX_TX_PWR, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_PRI_ADV_CHAN_MAX_TX_PWR"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - return ret; -} - -int ble_hci_vsc_led_pin_map(enum ble_hci_vs_led_function_id id, - enum ble_hci_vs_led_function_mode mode, uint16_t pin) -{ - int ret; - struct ble_hci_vs_cp_set_led_pin_map *cp; - struct ble_hci_vs_rp_status *rp; - struct net_buf *buf, *rsp = NULL; - - buf = bt_hci_cmd_create(HCI_OPCODE_VS_SET_LED_PIN_MAP, sizeof(*cp)); - if (!buf) { - LOG_ERR("Unable to allocate command buffer"); - return -ENOMEM; - } - - cp = net_buf_add(buf, sizeof(*cp)); - cp->id = id; - - if (mode == GPIO_ACTIVE_LOW) { - cp->mode = PAL_LED_MODE_ACTIVE_LOW; - } else { - cp->mode = PAL_LED_MODE_ACTIVE_HIGH; - } - - cp->pin = pin; - - ret = bt_hci_cmd_send_sync(HCI_OPCODE_VS_SET_LED_PIN_MAP, buf, &rsp); - if (ret) { - LOG_ERR("Error for HCI VS command HCI_OPCODE_VS_SET_LED_PIN_MAP"); - return ret; - } - - rp = (void *)rsp->data; - ret = rp->status; - net_buf_unref(rsp); - - return ret; -} diff --git a/lib/date_time/date_time_core.c b/lib/date_time/date_time_core.c index 9c24a845b635..611d7fe998c7 100644 --- a/lib/date_time/date_time_core.c +++ b/lib/date_time/date_time_core.c @@ -25,10 +25,13 @@ BUILD_ASSERT(CONFIG_DATE_TIME_TOO_OLD_SECONDS <= CONFIG_DATE_TIME_UPDATE_INTERVA #define DATE_TIME_EVT_TYPE_PREVIOUS 0xFF -static K_SEM_DEFINE(time_fetch_sem, 0, 1); +K_THREAD_STACK_DEFINE(date_time_stack, CONFIG_DATE_TIME_THREAD_STACK_SIZE); +struct k_work_q date_time_work_q; -static void date_time_handler(struct k_work *work); -static K_WORK_DELAYABLE_DEFINE(time_work, date_time_handler); +static void date_time_update_work_fn(struct k_work *work); +static K_WORK_DELAYABLE_DEFINE(date_time_update_work, date_time_update_work_fn); + +static K_WORK_DEFINE(date_time_update_manual_work, date_time_update_work_fn); static int64_t date_time_last_update_uptime; static date_time_evt_handler_t app_evt_handler; @@ -59,69 +62,59 @@ static void date_time_core_schedule_update(bool check_pending) /* Don't reschedule time update work in some cases, * e.g. if time is not obtained and the work is already pending. */ - if (check_pending && k_work_delayable_is_pending(&time_work)) { + if (check_pending && k_work_delayable_is_pending(&date_time_update_work)) { return; } LOG_DBG("New periodic date time update in: %d seconds", CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS); - k_work_reschedule(&time_work, K_SECONDS(CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS)); + k_work_reschedule_for_queue( + &date_time_work_q, + &date_time_update_work, + K_SECONDS(CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS)); } } -static void date_time_update_thread(void) +static void date_time_update_work_fn(struct k_work *work) { int err; - while (true) { - k_sem_take(&time_fetch_sem, K_FOREVER); - - LOG_DBG("Updating date time UTC..."); + LOG_DBG("Updating date time UTC..."); - err = date_time_core_current_check(); - if (err == 0) { - LOG_DBG("Using previously obtained time"); - date_time_core_schedule_update(true); - date_time_core_notify_event(DATE_TIME_EVT_TYPE_PREVIOUS); - continue; - } + err = date_time_core_current_check(); + if (err == 0) { + LOG_DBG("Using previously obtained time"); + date_time_core_schedule_update(true); + date_time_core_notify_event(DATE_TIME_EVT_TYPE_PREVIOUS); + return; + } #if defined(CONFIG_DATE_TIME_MODEM) - LOG_DBG("Getting time from cellular network"); - int tz = DATE_TIME_TZ_INVALID; - int64_t date_time_ms_modem = 0; - - err = date_time_modem_get(&date_time_ms_modem, &tz); - if (err == 0) { - date_time_core_store_tz(date_time_ms_modem, DATE_TIME_OBTAINED_MODEM, tz); - continue; - } -#endif -#if defined(CONFIG_DATE_TIME_NTP) - LOG_DBG("Getting time from NTP server"); - int64_t date_time_ms_ntp = 0; + LOG_DBG("Getting time from cellular network"); + int tz = DATE_TIME_TZ_INVALID; + int64_t date_time_ms_modem = 0; - err = date_time_ntp_get(&date_time_ms_ntp); - if (err == 0) { - date_time_core_store(date_time_ms_ntp, DATE_TIME_OBTAINED_NTP); - continue; - } + err = date_time_modem_get(&date_time_ms_modem, &tz); + if (err == 0) { + date_time_core_store_tz(date_time_ms_modem, DATE_TIME_OBTAINED_MODEM, tz); + return; + } #endif - LOG_DBG("Did not get time from any time source"); +#if defined(CONFIG_DATE_TIME_NTP) + LOG_DBG("Getting time from NTP server"); + int64_t date_time_ms_ntp = 0; - date_time_core_schedule_update(true); - date_time_core_notify_event(DATE_TIME_NOT_OBTAINED); + err = date_time_ntp_get(&date_time_ms_ntp); + if (err == 0) { + date_time_core_store(date_time_ms_ntp, DATE_TIME_OBTAINED_NTP); + return; } -} - -K_THREAD_DEFINE(time_thread, CONFIG_DATE_TIME_THREAD_STACK_SIZE, - date_time_update_thread, NULL, NULL, NULL, - K_LOWEST_APPLICATION_THREAD_PRIO, 0, 0); +#endif + LOG_DBG("Did not get time from any time source"); -static void date_time_handler(struct k_work *work) -{ - k_sem_give(&time_fetch_sem); + date_time_core_schedule_update(true); + date_time_core_notify_event(DATE_TIME_NOT_OBTAINED); } void date_time_lte_ind_handler(const struct lte_lc_evt *const evt) @@ -134,14 +127,12 @@ 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()) { - k_work_reschedule(&time_work, K_SECONDS(1)); + k_work_reschedule_for_queue( + &date_time_work_q, + &date_time_update_work, + K_SECONDS(1)); } break; -#if defined(CONFIG_DATE_TIME_MODEM) - case LTE_LC_NW_REG_SEARCHING: - date_time_modem_xtime_subscribe(); - break; -#endif default: break; } @@ -154,6 +145,17 @@ void date_time_lte_ind_handler(const struct lte_lc_evt *const evt) void date_time_core_init(void) { + struct k_work_queue_config cfg = { + .name = "date_time_work_q", + }; + + k_work_queue_start( + &date_time_work_q, + date_time_stack, + CONFIG_DATE_TIME_THREAD_STACK_SIZE, + K_LOWEST_APPLICATION_THREAD_PRIO, + &cfg); + if (IS_ENABLED(CONFIG_DATE_TIME_AUTO_UPDATE) && IS_ENABLED(CONFIG_LTE_LINK_CONTROL)) { lte_lc_register_handler(date_time_lte_ind_handler); } @@ -203,7 +205,8 @@ int date_time_core_update_async(date_time_evt_handler_t evt_handler) LOG_DBG("No handler registered"); } - k_sem_give(&time_fetch_sem); + /* Cannot reschedule date_time_update_work because it would mess up normal update cycle */ + k_work_submit_to_queue(&date_time_work_q, &date_time_update_manual_work); return 0; } diff --git a/lib/date_time/date_time_modem.c b/lib/date_time/date_time_modem.c index e0c590ab757f..17fb8fb1b8d8 100644 --- a/lib/date_time/date_time_modem.c +++ b/lib/date_time/date_time_modem.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #if defined(CONFIG_DATE_TIME_AUTO_UPDATE) #include @@ -19,10 +20,15 @@ LOG_MODULE_DECLARE(date_time, CONFIG_DATE_TIME_LOG_LEVEL); +extern struct k_work_q date_time_work_q; + #if defined(CONFIG_DATE_TIME_AUTO_UPDATE) /* AT monitor for %XTIME notifications */ AT_MONITOR(xtime, "%XTIME", date_time_at_xtime_handler); +void date_time_modem_xtime_subscribe_work_fn(struct k_work *work_item); +K_WORK_DEFINE(date_time_modem_xtime_subscribe_work, date_time_modem_xtime_subscribe_work_fn); + /* Indicates whether modem network time has been received with XTIME notification. */ static bool modem_valid_network_time; #else @@ -215,12 +221,29 @@ void date_time_modem_store(struct tm *ltm, int tz) } } -void date_time_modem_xtime_subscribe(void) +#if defined(CONFIG_DATE_TIME_AUTO_UPDATE) + +void date_time_modem_xtime_subscribe_work_fn(struct k_work *work_item) { /* Subscribe to modem time notifications */ int err = nrf_modem_at_printf("AT%%XTIME=1"); if (err) { LOG_ERR("Subscribing to modem AT%%XTIME notifications failed, err=%d", err); + } else { + LOG_DBG("Subscribing to modem AT%%XTIME notifications succeeded"); + } +} + +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) +{ + ARG_UNUSED(ctx); + + if (mode == LTE_LC_FUNC_MODE_NORMAL || mode == LTE_LC_FUNC_MODE_ACTIVATE_LTE) { + k_work_submit_to_queue(&date_time_work_q, &date_time_modem_xtime_subscribe_work); } } + +#endif /* defined(CONFIG_DATE_TIME_AUTO_UPDATE) */ diff --git a/lib/date_time/date_time_modem.h b/lib/date_time/date_time_modem.h index 537e92df7319..5098e36dec08 100644 --- a/lib/date_time/date_time_modem.h +++ b/lib/date_time/date_time_modem.h @@ -9,6 +9,5 @@ int date_time_modem_get(int64_t *date_time_ms, int *tz); void date_time_modem_store(struct tm *ltm, int tz); -void date_time_modem_xtime_subscribe(void); #endif /* DATE_TIME_MODEM_H_ */ diff --git a/lib/dk_buttons_and_leds/Kconfig b/lib/dk_buttons_and_leds/Kconfig index cc3848448d49..dc876fb9e908 100644 --- a/lib/dk_buttons_and_leds/Kconfig +++ b/lib/dk_buttons_and_leds/Kconfig @@ -21,6 +21,8 @@ config DK_LIBRARY_DYNAMIC_BUTTON_HANDLERS config DK_LIBRARY_BUTTON_NO_ISR bool "Poll buttons unconditionally (no interrupts) [EXPERIMENTAL]" + # Workaround for buttons on nRF54L15 PDK in revision 0.2.x. + default y if BOARD_NRF54L15PDK_NRF54L15_CPUAPP && (BOARD_REVISION = "0.2.0" || BOARD_REVISION = "0.2.1") select EXPERIMENTAL help With this option disabled, the module periodically scans all the diff --git a/lib/edge_impulse/CMakeLists.txt b/lib/edge_impulse/CMakeLists.txt index 0e58ff1fd78b..fb2dc1e8fb04 100644 --- a/lib/edge_impulse/CMakeLists.txt +++ b/lib/edge_impulse/CMakeLists.txt @@ -12,6 +12,9 @@ set(EDGE_IMPULSE_BINARY_DIR ${EDGE_IMPULSE_DIR}/src/edge_impulse_project-build) set(EDGE_IMPULSE_STAMP_DIR ${EDGE_IMPULSE_DIR}/src/edge_impulse_project-stamp) set(EDGE_IMPULSE_LIBRARY ${EDGE_IMPULSE_BINARY_DIR}/libedge_impulse.a) +# Override Zephyr's Wdouble-promotion, as Edge Impulse gives warnings. +zephyr_compile_options(-Wno-double-promotion) + file(GENERATE OUTPUT ${EDGE_IMPULSE_DIR}/compile_options.$.cmake CONTENT "set(EI_$_COMPILE_OPTIONS \"$\")" ) diff --git a/lib/fatal_error/fatal_error.c b/lib/fatal_error/fatal_error.c index dea4ceb19437..d8e8391e6be3 100644 --- a/lib/fatal_error/fatal_error.c +++ b/lib/fatal_error/fatal_error.c @@ -20,16 +20,8 @@ void k_sys_fatal_error_handler(unsigned int reason, ARG_UNUSED(reason); LOG_PANIC(); - - if (IS_ENABLED(CONFIG_RESET_ON_FATAL_ERROR)) { - LOG_ERR("Resetting system"); - sys_arch_reboot(0); - } else { - LOG_ERR("Halting system"); - for (;;) { - /* Spin endlessly */ - } - } + LOG_ERR("Resetting system"); + sys_arch_reboot(0); CODE_UNREACHABLE; } diff --git a/lib/fem_al/CMakeLists.txt b/lib/fem_al/CMakeLists.txt index 5d15765d74e6..6850950303fe 100644 --- a/lib/fem_al/CMakeLists.txt +++ b/lib/fem_al/CMakeLists.txt @@ -18,4 +18,8 @@ endif() target_sources_ifdef(CONFIG_MPSL_FEM_SIMPLE_GPIO app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/generic_fem.c) +if (CONFIG_MPSL_FEM_NRF2220 OR CONFIG_MPSL_FEM_NRF2240) + target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/nrf22xx.c) +endif() + endif() # CONFIG_FEM_AL_LIB diff --git a/lib/fem_al/fem_al.c b/lib/fem_al/fem_al.c index 3fedfb608b64..9f48eef1a709 100644 --- a/lib/fem_al/fem_al.c +++ b/lib/fem_al/fem_al.c @@ -198,37 +198,26 @@ int fem_rx_configure(uint32_t ramp_up_time) return 0; } -int fem_tx_gain_set(uint32_t gain) +int fem_tx_power_control_set(fem_tx_power_control tx_power_control) { int32_t err; - mpsl_fem_gain_t fem_gain = { 0 }; + mpsl_fem_pa_power_control_t fem_pa_power_control = 0; /* Fallback to FEM specific function. It can be used for checking the valid output power * range. */ - if (fem_api->tx_gain_validate) { - err = fem_api->tx_gain_validate(gain); + if (fem_api->tx_power_control_validate) { + err = fem_api->tx_power_control_validate(tx_power_control); if (err) { return err; } } - if (!fem_api->tx_default_gain_get) { - /* Should not happen. */ - __ASSERT(false, "Missing FEM specific function for getting default Tx gain"); - return -EFAULT; - } - - /* We need to pass valid gain db value for given front-end module to have possibility to set - * gain value directly in arbitrary value defined in your front-end module - * product specification. In this case the default Tx gain value will be used. - */ - fem_gain.gain_db = fem_api->tx_default_gain_get(); - fem_gain.private_setting = gain; + fem_pa_power_control = tx_power_control; - err = mpsl_fem_pa_gain_set(&fem_gain); + err = mpsl_fem_pa_power_control_set(fem_pa_power_control); if (err) { - printk("Failed to set front-end module gain (err %d)\n", err); + printk("Failed to set front-end module Tx power control (err %d)\n", err); return -EINVAL; } @@ -268,10 +257,10 @@ int8_t fem_tx_output_power_prepare(int8_t power, int8_t *radio_tx_power, uint16_ *radio_tx_power = power_split.radio_tx_power; - err = mpsl_fem_pa_gain_set(&power_split.fem); + err = mpsl_fem_pa_power_control_set(power_split.fem_pa_power_control); if (err) { /* Should not happen */ - printk("Failed to set front-end module gain (err %d)\n", err); + printk("Failed to set front-end module Tx power control (err %d)\n", err); __ASSERT_NO_MSG(false); } @@ -285,10 +274,10 @@ int8_t fem_tx_output_power_check(int8_t power, uint16_t freq_mhz, bool tx_power_ return mpsl_fem_tx_power_split(power, &power_split, freq_mhz, tx_power_ceiling); } -uint32_t fem_default_tx_gain_get(void) +int8_t fem_default_tx_output_power_get(void) { - if (fem_api->tx_default_gain_get) { - return fem_api->tx_default_gain_get(); + if (fem_api->default_tx_output_power_get) { + return fem_api->default_tx_output_power_get(); } return 0; diff --git a/lib/fem_al/fem_interface.h b/lib/fem_al/fem_interface.h index 240a6771d94e..f4f61462313d 100644 --- a/lib/fem_al/fem_interface.h +++ b/lib/fem_al/fem_interface.h @@ -28,8 +28,8 @@ extern "C" { struct fem_interface_api { int (*power_up)(void); int (*power_down)(void); - int (*tx_gain_validate)(uint32_t gain); - uint32_t (*tx_default_gain_get)(void); + int (*tx_power_control_validate)(fem_tx_power_control tx_power_control); + int8_t (*default_tx_output_power_get)(void); uint32_t (*default_active_delay_calculate)(bool rx, nrf_radio_mode_t mode); int (*antenna_select)(enum fem_antenna ant); }; diff --git a/lib/fem_al/generic_fem.c b/lib/fem_al/generic_fem.c index 0d1d7bde9fd6..755e7185aa7a 100644 --- a/lib/fem_al/generic_fem.c +++ b/lib/fem_al/generic_fem.c @@ -148,7 +148,7 @@ static int generic_fem_power_down(void) return err; } -static uint32_t tx_default_gain_get(void) +static int8_t default_tx_output_power_get(void) { return DT_PROP(DT_NODELABEL(nrf_radio_fem), tx_gain_db); } @@ -188,7 +188,7 @@ static const struct fem_interface_api generic_fem_api = { .power_up = generic_fem_power_up, .power_down = generic_fem_power_down, .antenna_select = generic_fem_antenna_select, - .tx_default_gain_get = tx_default_gain_get, + .default_tx_output_power_get = default_tx_output_power_get, }; static int generic_fem_setup(void) diff --git a/lib/fem_al/nrf21540.c b/lib/fem_al/nrf21540.c index a1efacb00423..59ad10598229 100644 --- a/lib/fem_al/nrf21540.c +++ b/lib/fem_al/nrf21540.c @@ -64,16 +64,16 @@ static int nrf21540_init(void) return 0; } -static int tx_gain_validate(uint32_t gain) +static int tx_power_control_validate(fem_tx_power_control tx_power_control) { if (IS_ENABLED(CONFIG_MPSL_FEM_NRF21540_GPIO_SPI)) { - return (gain > NRF21540_TX_GAIN_MAX) ? -EINVAL : 0; + return (tx_power_control > NRF21540_TX_GAIN_MAX) ? -EINVAL : 0; } else { - return ((gain == 0) || (gain == 1)) ? 0 : -EINVAL; + return ((tx_power_control == 0) || (tx_power_control == 1)) ? 0 : -EINVAL; } } -static uint32_t tx_default_gain_get(void) +static int8_t default_tx_output_power_get(void) { return CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB; } @@ -108,8 +108,8 @@ static int nrf21540_antenna_select(enum fem_antenna ant) #endif /* DT_NODE_HAS_PROP(NRF21540_NODE, ant_sel_gpios) */ static const struct fem_interface_api nrf21540_api = { - .tx_gain_validate = tx_gain_validate, - .tx_default_gain_get = tx_default_gain_get, + .tx_power_control_validate = tx_power_control_validate, + .default_tx_output_power_get = default_tx_output_power_get, .antenna_select = nrf21540_antenna_select }; diff --git a/lib/fem_al/nrf22xx.c b/lib/fem_al/nrf22xx.c new file mode 100644 index 000000000000..dd82fe8d5f31 --- /dev/null +++ b/lib/fem_al/nrf22xx.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include "fem_interface.h" + +static int8_t default_tx_output_power_get(void) +{ + return DT_PROP(DT_NODELABEL(nrf_radio_fem), output_power_dbm); +} + +static const struct fem_interface_api nrf22xx_fem_api = { + .default_tx_output_power_get = default_tx_output_power_get, +}; + +static int nrf22xx_fem_setup(void) +{ + return fem_interface_api_set(&nrf22xx_fem_api); +} + +SYS_INIT(nrf22xx_fem_setup, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/lib/fprotect/Kconfig b/lib/fprotect/Kconfig index 03f38a216517..74e4f7bd7264 100644 --- a/lib/fprotect/Kconfig +++ b/lib/fprotect/Kconfig @@ -45,7 +45,7 @@ config FPROTECT_BLOCK_SIZE menuconfig FPROTECT bool "Enable FPROTECT" - depends on SOC_FAMILY_NRF + depends on SOC_FAMILY_NORDIC_NRF help Enable the software library FPROTECT that may or may not be used by other systems to protect flash from writes and possibly also diff --git a/lib/hw_unique_key/CMakeLists.txt b/lib/hw_unique_key/CMakeLists.txt index 7de25bd65d51..18de28e677bb 100644 --- a/lib/hw_unique_key/CMakeLists.txt +++ b/lib/hw_unique_key/CMakeLists.txt @@ -6,12 +6,16 @@ zephyr_library() -zephyr_library_sources(hw_unique_key.c) - -if (DEFINED CONFIG_HAS_HW_NRF_ACL) - zephyr_library_sources(hw_unique_key_acl.c) +if (CONFIG_CRACEN_HW_PRESENT) + zephyr_library_sources(hw_unique_key_cracen.c) else() - zephyr_library_sources(hw_unique_key_kmu.c) -endif() + zephyr_library_sources(hw_unique_key.c) -ncs_add_partition_manager_config(pm.yml.huk) + if (DEFINED CONFIG_HAS_HW_NRF_ACL) + zephyr_library_sources(hw_unique_key_acl.c) + else() + zephyr_library_sources(hw_unique_key_kmu.c) + endif() + + ncs_add_partition_manager_config(pm.yml.huk) +endif() diff --git a/lib/hw_unique_key/Kconfig b/lib/hw_unique_key/Kconfig index 3af0b90bbcd2..b739b0094ba5 100644 --- a/lib/hw_unique_key/Kconfig +++ b/lib/hw_unique_key/Kconfig @@ -30,15 +30,21 @@ config HW_UNIQUE_KEY_LOAD config HW_UNIQUE_KEY_SUPPORTED bool - default y if HAS_HW_NRF_CC3XX + default y if HAS_HW_NRF_CC3XX || (CRACEN_HW_PRESENT && !TFM_PROFILE_TYPE_MINIMAL) config HW_UNIQUE_KEY bool "Hardware Unique Keys (HUK)" depends on HW_UNIQUE_KEY_SUPPORTED - depends on NRF_CC3XX_PLATFORM || BUILD_WITH_TFM + depends on NRF_CC3XX_PLATFORM || BUILD_WITH_TFM || CRACEN_HW_PRESENT depends on NRF_SECURITY - depends on MPU_ALLOW_FLASH_WRITE || BUILD_WITH_TFM - depends on !BUILD_WITH_TFM || TFM_CRYPTO_BUILTIN_KEYS + depends on MPU_ALLOW_FLASH_WRITE || BUILD_WITH_TFM || CRACEN_HW_PRESENT + depends on !BUILD_WITH_TFM || (TFM_CRYPTO_BUILTIN_KEYS || CRACEN_HW_PRESENT) + select PSA_WANT_ALG_SP800_108_COUNTER_CMAC if CRACEN_HW_PRESENT + select PSA_WANT_ALG_CMAC if CRACEN_HW_PRESENT + select PSA_WANT_KEY_TYPE_AES if CRACEN_HW_PRESENT + select PSA_WANT_ALG_ECB_NO_PADDING if CRACEN_HW_PRESENT + select PSA_WANT_ALG_GCM if CRACEN_HW_PRESENT + select PSA_NEED_CRACEN_KMU_DRIVER if CRACEN_HW_PRESENT select FPROTECT if HAS_HW_NRF_ACL imply NRFX_NVMC if HAS_HW_NRF_ACL default y if BUILD_WITH_TFM diff --git a/lib/hw_unique_key/hw_unique_key_cracen.c b/lib/hw_unique_key/hw_unique_key_cracen.c new file mode 100644 index 000000000000..842e4f68567d --- /dev/null +++ b/lib/hw_unique_key/hw_unique_key_cracen.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include "hw_unique_key_internal.h" + +int hw_unique_key_derive_key(enum hw_unique_key_slot key_slot, const uint8_t *context, + size_t context_size, uint8_t const *label, size_t label_size, + uint8_t *output, uint32_t output_size) +{ + psa_key_attributes_t mkek_attr = PSA_KEY_ATTRIBUTES_INIT; + psa_status_t status; + + if (key_slot == HUK_KEYSLOT_MKEK) { + psa_set_key_id(&mkek_attr, mbedtls_svc_key_id_make(0, CRACEN_BUILTIN_MKEK_ID)); + } else if (key_slot == HUK_KEYSLOT_MEXT) { + psa_set_key_id(&mkek_attr, mbedtls_svc_key_id_make(0, CRACEN_BUILTIN_MEXT_ID)); + } else { + return -HW_UNIQUE_KEY_ERR_MISSING; + } + + psa_set_key_type(&mkek_attr, PSA_KEY_TYPE_AES); + psa_set_key_lifetime(&mkek_attr, + PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( + PSA_KEY_PERSISTENCE_READ_ONLY, PSA_KEY_LOCATION_CRACEN)); + + cracen_key_derivation_operation_t op = {}; + + status = cracen_key_derivation_setup(&op, PSA_ALG_SP800_108_COUNTER_CMAC); + if (status != PSA_SUCCESS) { + if (status == PSA_ERROR_DOES_NOT_EXIST) { + return -HW_UNIQUE_KEY_ERR_MISSING; + } + return -HW_UNIQUE_KEY_ERR_DERIVE_FAILED; + } + status = cracen_key_derivation_input_key(&op, PSA_KEY_DERIVATION_INPUT_SECRET, &mkek_attr, + NULL, 0); + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_DERIVE_FAILED; + } + status = cracen_key_derivation_input_bytes(&op, PSA_KEY_DERIVATION_INPUT_LABEL, label, + label_size); + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_DERIVE_FAILED; + } + status = cracen_key_derivation_input_bytes(&op, PSA_KEY_DERIVATION_INPUT_CONTEXT, context, + context_size); + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_DERIVE_FAILED; + } + status = cracen_key_derivation_output_bytes(&op, output, output_size); + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_DERIVE_FAILED; + } + + return HW_UNIQUE_KEY_SUCCESS; +} + +bool hw_unique_key_are_any_written(void) +{ + + psa_key_lifetime_t lifetime; + psa_drv_slot_number_t slot_number; + mbedtls_svc_key_id_t key_id = mbedtls_svc_key_id_make( + 0, PSA_KEY_HANDLE_FROM_CRACEN_KMU_SLOT(CRACEN_KMU_KEY_USAGE_SCHEME_SEED, 0)); + return cracen_kmu_get_key_slot(key_id, &lifetime, &slot_number) == PSA_SUCCESS; +} + +int hw_unique_key_write(enum hw_unique_key_slot key_slot, const uint8_t *key) +{ + size_t key_bits; + uint8_t opaque_buffer[2]; + size_t outlen; + psa_status_t status; + (void)key_slot; + + psa_key_attributes_t seed_attr = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_id(&seed_attr, + mbedtls_svc_key_id_make(0, PSA_KEY_HANDLE_FROM_CRACEN_KMU_SLOT( + CRACEN_KMU_KEY_USAGE_SCHEME_SEED, 0))); + psa_set_key_type(&seed_attr, PSA_KEY_TYPE_RAW_DATA); + psa_set_key_lifetime(&seed_attr, + PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( + PSA_KEY_PERSISTENCE_DEFAULT, PSA_KEY_LOCATION_CRACEN_KMU)); + + status = cracen_import_key(&seed_attr, key, HUK_SIZE_BYTES, opaque_buffer, + sizeof(opaque_buffer), &outlen, &key_bits); + + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_WRITE_FAILED; + } + + if (key_bits != PSA_BYTES_TO_BITS(HUK_SIZE_BYTES)) { + return -HW_UNIQUE_KEY_ERR_GENERIC_ERROR; + } + + return HW_UNIQUE_KEY_SUCCESS; +} +int hw_unique_key_write_random(void) +{ + psa_status_t status; + uint8_t random_data[HUK_SIZE_BYTES]; + + status = cracen_get_random(NULL, random_data, sizeof(random_data)); + if (status != PSA_SUCCESS) { + return -HW_UNIQUE_KEY_ERR_GENERATION_FAILED; + } + + return hw_unique_key_write(0, random_data); +} + +bool hw_unique_key_is_written(enum hw_unique_key_slot key_slot) +{ + return hw_unique_key_are_any_written(); +} diff --git a/lib/identity_key/Kconfig b/lib/identity_key/Kconfig index f485ebfb5d09..dc3d03ea9c86 100644 --- a/lib/identity_key/Kconfig +++ b/lib/identity_key/Kconfig @@ -21,7 +21,8 @@ if IDENTITY_KEY config IDENTITY_KEY_RANDOM bool "Enable writing random Identity Keys" - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT select PSA_WANT_ECC_SECP_R1_256 help Enable the identity_key_write_random() function. diff --git a/lib/location/CMakeLists.txt b/lib/location/CMakeLists.txt index 5125dbb81806..88698d8aa2eb 100644 --- a/lib/location/CMakeLists.txt +++ b/lib/location/CMakeLists.txt @@ -19,3 +19,5 @@ if(CONFIG_LOCATION_METHOD_CELLULAR OR CONFIG_LOCATION_METHOD_WIFI) zephyr_library_sources(method_cloud_location.c) add_subdirectory(cloud_service) endif() + +zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L) diff --git a/lib/location/Kconfig b/lib/location/Kconfig index d63bdbeeba31..3b44e130ff46 100644 --- a/lib/location/Kconfig +++ b/lib/location/Kconfig @@ -37,6 +37,14 @@ config LOCATION_METHOD_WIFI_NET_MGMT separated here from other dependencies to allow disabling of Network Management APIs in tests for mocking purposes. +config LOCATION_METHOD_WIFI_NET_IF_UPDOWN + bool + default y if (BOARD_THINGY91X_NRF9151 || BOARD_THINGY91X_NRF9151_NS || BOARD_THINGY91X_NRF5340_CPUAPP || BOARD_THINGY91X_NRF5340_CPUAPP_NS) + depends on LOCATION_METHOD_WIFI_NET_MGMT + help + Use the Network Interface Up/Down APIs for Wi-Fi functionality. + + config LOCATION_METHODS_LIST_SIZE int "Maximum number of location methods in configuration" default 3 diff --git a/lib/location/location.c b/lib/location/location.c index 93c1e28adb22..0d7d95136c15 100644 --- a/lib/location/location.c +++ b/lib/location/location.c @@ -307,6 +307,33 @@ const char *location_method_str(enum location_method method) } } +const struct location_data_details *location_details_get( + const struct location_event_data *event_data) +{ + const struct location_data_details *details = NULL; + +#if defined(CONFIG_LOCATION_DATA_DETAILS) + switch (event_data->id) { + case LOCATION_EVT_LOCATION: + details = &event_data->location.details; + break; + case LOCATION_EVT_TIMEOUT: + case LOCATION_EVT_ERROR: + details = &event_data->error.details; + break; + case LOCATION_EVT_RESULT_UNKNOWN: + details = &event_data->unknown.details; + break; + case LOCATION_EVT_FALLBACK: + details = &event_data->fallback.details; + break; + default: + break; + } +#endif + return details; +} + int location_agnss_data_process(const char *buf, size_t buf_len) { #if defined(CONFIG_LOCATION_SERVICE_EXTERNAL) && defined(CONFIG_NRF_CLOUD_AGNSS) diff --git a/lib/location/location_core.c b/lib/location/location_core.c index 6fcb6f2b2604..f6cc7a30dfd0 100644 --- a/lib/location/location_core.c +++ b/lib/location/location_core.c @@ -655,7 +655,8 @@ static void location_core_event_cb_fn(struct k_work *work) LOG_DBG(" latitude: %s", latitude_str); sprintf(longitude_str, "%.06f", loc_req_info.current_event_data.location.longitude); LOG_DBG(" longitude: %s", longitude_str); - sprintf(accuracy_str, "%.01f", loc_req_info.current_event_data.location.accuracy); + sprintf(accuracy_str, "%.01f", + (double)loc_req_info.current_event_data.location.accuracy); LOG_DBG(" accuracy: %s m", accuracy_str); if (loc_req_info.current_event_data.location.datetime.valid) { LOG_DBG(" date: %04d-%02d-%02d", diff --git a/lib/location/method_cloud_location.c b/lib/location/method_cloud_location.c index 8ef8c57c31a2..aee0549c8759 100644 --- a/lib/location/method_cloud_location.c +++ b/lib/location/method_cloud_location.c @@ -36,6 +36,10 @@ struct method_cloud_location_start_work_args { static struct method_cloud_location_start_work_args method_cloud_location_start_work; static bool running; +#if defined(CONFIG_LOCATION_METHOD_WIFI) +static K_SEM_DEFINE(wifi_scan_ready, 0, 1); +#endif + static void method_cloud_location_positioning_work_fn(struct k_work *work) { struct method_cloud_location_start_work_args *work_data = @@ -45,10 +49,9 @@ static void method_cloud_location_positioning_work_fn(struct k_work *work) struct wifi_scan_info *scan_wifi_info = NULL; struct lte_lc_cells_info *scan_cellular_info = NULL; int err = 0; -#if defined(CONFIG_LOCATION_METHOD_WIFI) - struct k_sem wifi_scan_ready; - k_sem_init(&wifi_scan_ready, 0, 1); +#if defined(CONFIG_LOCATION_METHOD_WIFI) + k_sem_reset(&wifi_scan_ready); if (wifi_config != NULL) { scan_wifi_execute(wifi_config->timeout, &wifi_scan_ready); diff --git a/lib/location/method_gnss.c b/lib/location/method_gnss.c index 1df839ff1e1c..a733bc9778af 100644 --- a/lib/location/method_gnss.c +++ b/lib/location/method_gnss.c @@ -1273,10 +1273,10 @@ int method_gnss_location_get(const struct location_request_info *request) return err; } - k_work_submit_to_queue(location_core_work_queue_get(), &method_gnss_prepare_work); - running = true; + k_work_submit_to_queue(location_core_work_queue_get(), &method_gnss_prepare_work); + return 0; } diff --git a/lib/location/scan_wifi.c b/lib/location/scan_wifi.c index 97031ffe5915..5b6285f4d2f7 100644 --- a/lib/location/scan_wifi.c +++ b/lib/location/scan_wifi.c @@ -59,6 +59,44 @@ void scan_wifi_details_get(struct location_data_details *details) } #endif +#if defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) +static int scan_wifi_interface_shutdown(struct net_if *iface) +{ + LOG_DBG("Shutting down Wi-Fi interface"); + int ret; + + if (!net_if_is_admin_up(iface)) { + return 0; + } + + ret = net_if_down(iface); + if (ret) { + LOG_ERR("Cannot bring down Wi-Fi interface (%d)", ret); + return ret; + } + + LOG_DBG("Interface down"); + + return 0; +} + +static int scan_wifi_startup_interface(struct net_if *iface) +{ + LOG_DBG("Starting up Wi-Fi interface"); + int ret; + + if (!net_if_is_admin_up(iface)) { + ret = net_if_up(iface); + if (ret) { + LOG_ERR("Cannot bring up Wi-Fi interface (%d)", ret); + return ret; + } + LOG_DBG("Interface up"); + } + return 0; +} +#endif /* defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) */ + void scan_wifi_execute(int32_t timeout, struct k_sem *wifi_scan_ready) { int ret; @@ -70,6 +108,14 @@ void scan_wifi_execute(int32_t timeout, struct k_sem *wifi_scan_ready) scan_wifi_info.cnt = 0; __ASSERT_NO_MSG(wifi_iface != NULL); + +#if defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) + ret = scan_wifi_startup_interface(wifi_iface); + if (ret) { + return; + } +#endif /* defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) */ + ret = net_mgmt(NET_REQUEST_WIFI_SCAN, wifi_iface, NULL, 0); if (ret) { LOG_ERR("Failed to initiate Wi-Fi scanning: %d", ret); @@ -143,6 +189,15 @@ void scan_wifi_net_mgmt_event_handler( break; } } +#if defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) + /* This is a workaround for devices like the Thingy:91 X. + * Usually, libraries should not shut down the interface in case there might be other + * users of the device. + */ + if (mgmt_event == NET_EVENT_WIFI_SCAN_DONE) { + scan_wifi_interface_shutdown(wifi_iface); + } +#endif /* defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) */ } int scan_wifi_cancel(void) @@ -185,7 +240,11 @@ int scan_wifi_init(void) (NET_EVENT_WIFI_SCAN_RESULT | NET_EVENT_WIFI_SCAN_DONE)); net_mgmt_add_event_callback(&scan_wifi_net_mgmt_cb); +#if defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) + return scan_wifi_interface_shutdown(wifi_iface); +#else return 0; +#endif /* defined(CONFIG_LOCATION_METHOD_WIFI_NET_IF_UPDOWN) */ } static void scan_wifi_timeout_work_fn(struct k_work *work) diff --git a/lib/lte_link_control/Kconfig b/lib/lte_link_control/Kconfig index c171c3dd61b9..71405fc685a4 100644 --- a/lib/lte_link_control/Kconfig +++ b/lib/lte_link_control/Kconfig @@ -265,16 +265,6 @@ config LTE_RAI_REQ the RAI socket option (SO_RAI) to inform the modem when no more data is expected and the RRC connection can be released. -config LTE_RAI_REQ_VALUE - string "Requested RAI value [DEPRECATED]" - default "0" - help - Sets Release Assistance Indication. Allowed values - are "0", "3" and "4" signifying disabled, - control plane one response, and control plane no response, - respectively. For reference see 3GPP 24.301 Ch. 9.9.4.25. - This Kconfig option is deprecated. Use CONFIG_LTE_RAI_REQ instead. - config LTE_NETWORK_USE_FALLBACK bool "Use fallback network mode if selected mode fails [DEPRECATED]" select DEPRECATED diff --git a/lib/lte_link_control/lte_lc.c b/lib/lte_link_control/lte_lc.c index 656f45e1ef48..1bc51ecf72ed 100644 --- a/lib/lte_link_control/lte_lc.c +++ b/lib/lte_link_control/lte_lc.c @@ -73,10 +73,6 @@ static char psm_param_rptau[9] = CONFIG_LTE_PSM_REQ_RPTAU; static const char psm_disable[] = "AT+CPSMS="; /* Enable CSCON (RRC mode) notifications */ static const char cscon[] = "AT+CSCON=1"; -/* Disable RAI */ -static const char rai_disable[] = "AT%%XRAI=0"; -/* Default RAI setting */ -static char rai_param[2] = CONFIG_LTE_RAI_REQ_VALUE; /* Requested NCELLMEAS params */ static struct lte_lc_ncellmeas_params ncellmeas_params; @@ -123,6 +119,14 @@ static const char system_mode_preference[] = { [LTE_LC_SYSTEM_MODE_PREFER_NBIOT_PLMN_PRIO] = '4', }; +static void lte_lc_psm_get_work_fn(struct k_work *work_item); +K_WORK_DEFINE(lte_lc_psm_get_work, lte_lc_psm_get_work_fn); + +#define LTE_LC_PSM_GET_STACK_SIZE 1024 +K_THREAD_STACK_DEFINE(lte_lc_psm_get_stack, LTE_LC_PSM_GET_STACK_SIZE); + +static struct k_work_q lte_lc_psm_get_work_q; + static bool is_cellid_valid(uint32_t cellid) { if (cellid == LTE_LC_CELL_EUTRAN_ID_INVALID) { @@ -132,6 +136,41 @@ static bool is_cellid_valid(uint32_t cellid) return true; } +static void lte_lc_evt_psm_update_send(struct lte_lc_psm_cfg *psm_cfg) +{ + static struct lte_lc_psm_cfg prev_psm_cfg; + struct lte_lc_evt evt = {0}; + + /* PSM configuration update event */ + if ((psm_cfg->tau != prev_psm_cfg.tau) || + (psm_cfg->active_time != prev_psm_cfg.active_time)) { + evt.type = LTE_LC_EVT_PSM_UPDATE; + + memcpy(&prev_psm_cfg, psm_cfg, sizeof(struct lte_lc_psm_cfg)); + memcpy(&evt.psm_cfg, psm_cfg, sizeof(struct lte_lc_psm_cfg)); + event_handler_list_dispatch(&evt); + } +} + +static void lte_lc_psm_get_work_fn(struct k_work *work_item) +{ + int err; + struct lte_lc_psm_cfg psm_cfg = { + .active_time = -1, + .tau = -1 + }; + + err = lte_lc_psm_get(&psm_cfg.tau, &psm_cfg.active_time); + if (err) { + if (err != -EBADMSG) { + LOG_ERR("Failed to get PSM information"); + } + return; + } + + lte_lc_evt_psm_update_send(&psm_cfg); +} + AT_MONITOR(ltelc_atmon_cereg, "+CEREG", at_handler_cereg); AT_MONITOR(ltelc_atmon_cscon, "+CSCON", at_handler_cscon); AT_MONITOR(ltelc_atmon_cedrxp, "+CEDRXP", at_handler_cedrxp); @@ -147,19 +186,20 @@ static void at_handler_cereg(const char *response) __ASSERT_NO_MSG(response != NULL); - static enum lte_lc_nw_reg_status prev_reg_status = - LTE_LC_NW_REG_NOT_REGISTERED; + static enum lte_lc_nw_reg_status prev_reg_status = LTE_LC_NW_REG_NOT_REGISTERED; static struct lte_lc_cell prev_cell; - static struct lte_lc_psm_cfg prev_psm_cfg; static enum lte_lc_lte_mode prev_lte_mode = LTE_LC_LTE_MODE_NONE; enum lte_lc_nw_reg_status reg_status = 0; struct lte_lc_cell cell = {0}; enum lte_lc_lte_mode lte_mode; - struct lte_lc_psm_cfg psm_cfg = {0}; + struct lte_lc_psm_cfg psm_cfg = { + .active_time = -1, + .tau = -1 + }; LOG_DBG("+CEREG notification: %.*s", strlen(response) - strlen("\r\n"), response); - err = parse_cereg(response, true, ®_status, &cell, <e_mode); + err = parse_cereg(response, true, ®_status, &cell, <e_mode, &psm_cfg); if (err) { LOG_ERR("Failed to parse notification (error %d): %s", err, response); @@ -250,23 +290,21 @@ static void at_handler_cereg(const char *response) return; } - err = lte_lc_psm_get(&psm_cfg.tau, &psm_cfg.active_time); - if (err) { - if (err != -EBADMSG) { - LOG_ERR("Failed to get PSM information"); - } + if (psm_cfg.tau == -1) { + /* Need to get legacy T3412 value as TAU using AT%XMONITOR. + * + * As we are in an AT notification handler that is run from the system work queue, + * we shall not send AT commands here because another AT command might be ongoing, + * and the second command will be blocked until the first one completes. + * Further AT notifications from the modem will gradually exhaust AT monitor + * library's heap, and eventually it will run out causing an assert or + * AT notifications not being dispatched. + */ + k_work_submit_to_queue(<e_lc_psm_get_work_q, <e_lc_psm_get_work); return; } - /* PSM configuration update event */ - if ((psm_cfg.tau != prev_psm_cfg.tau) || - (psm_cfg.active_time != prev_psm_cfg.active_time)) { - evt.type = LTE_LC_EVT_PSM_UPDATE; - - memcpy(&prev_psm_cfg, &psm_cfg, sizeof(struct lte_lc_psm_cfg)); - memcpy(&evt.psm_cfg, &psm_cfg, sizeof(struct lte_lc_psm_cfg)); - event_handler_list_dispatch(&evt); - } + lte_lc_evt_psm_update_send(&psm_cfg); } static void at_handler_cscon(const char *response) @@ -1089,61 +1127,6 @@ int lte_lc_edrx_get(struct lte_lc_edrx_cfg *edrx_cfg) return 0; } -int lte_lc_rai_req(bool enable) -{ - int err; - enum lte_lc_system_mode mode; - - err = lte_lc_system_mode_get(&mode, NULL); - if (err) { - return -EFAULT; - } - - switch (mode) { - case LTE_LC_SYSTEM_MODE_LTEM: - case LTE_LC_SYSTEM_MODE_LTEM_GPS: - LOG_ERR("RAI not supported for LTE-M networks"); - return -EOPNOTSUPP; - case LTE_LC_SYSTEM_MODE_NBIOT: - case LTE_LC_SYSTEM_MODE_NBIOT_GPS: - case LTE_LC_SYSTEM_MODE_LTEM_NBIOT: - case LTE_LC_SYSTEM_MODE_LTEM_NBIOT_GPS: - break; - default: - LOG_ERR("Unknown system mode"); - LOG_ERR("Cannot request RAI for unknown system mode"); - return -EOPNOTSUPP; - } - - if (enable) { - err = nrf_modem_at_printf("AT%%XRAI=%s", rai_param); - } else { - err = nrf_modem_at_printf(rai_disable); - } - - if (err) { - LOG_ERR("nrf_modem_at_printf failed, reported error: %d", err); - return -EFAULT; - } - - return 0; -} - -int lte_lc_rai_param_set(const char *value) -{ - if (value == NULL || strlen(value) != 1) { - return -EINVAL; - } - - if (value[0] == '3' || value[0] == '4') { - memcpy(rai_param, value, 2); - } else { - return -EINVAL; - } - - return 0; -} - int lte_lc_nw_reg_status_get(enum lte_lc_nw_reg_status *status) { int err; @@ -1818,3 +1801,21 @@ int lte_lc_factory_reset(enum lte_lc_factory_reset_type type) { return nrf_modem_at_printf("AT%%XFACTORYRESET=%d", type) ? -EFAULT : 0; } + +static int lte_lc_sys_init(void) +{ + struct k_work_queue_config cfg = { + .name = "lte_lc_psm_get_work_q", + }; + + k_work_queue_start( + <e_lc_psm_get_work_q, + lte_lc_psm_get_stack, + K_THREAD_STACK_SIZEOF(lte_lc_psm_get_stack), + K_LOWEST_APPLICATION_THREAD_PRIO, + &cfg); + + return 0; +} + +SYS_INIT(lte_lc_sys_init, APPLICATION, 0); diff --git a/lib/lte_link_control/lte_lc_helpers.c b/lib/lte_link_control/lte_lc_helpers.c index 2c17b2989c82..de351fd95f0b 100644 --- a/lib/lte_link_control/lte_lc_helpers.c +++ b/lib/lte_link_control/lte_lc_helpers.c @@ -585,7 +585,7 @@ int parse_psm(const char *active_time_str, const char *tau_ext_str, uint32_t timer_unit, timer_value; if (strlen(active_time_str) != 8 || strlen(tau_ext_str) != 8 || - strlen(tau_legacy_str) != 8) { + (tau_legacy_str != NULL && strlen(tau_legacy_str) != 8)) { return -EINVAL; } @@ -602,8 +602,10 @@ int parse_psm(const char *active_time_str, const char *tau_ext_str, timer_value = strtoul(tau_ext_str + unit_str_len, NULL, 2); psm_cfg->tau = timer_unit ? timer_unit * timer_value : -1; - /* If T3412-extended is disabled, periodic TAU is reported using the T3412 legacy timer */ - if (psm_cfg->tau == -1) { + /* If T3412-extended is disabled, periodic TAU is reported using the T3412 legacy timer + * if the caller requests for it + */ + if (psm_cfg->tau == -1 && tau_legacy_str != NULL) { memcpy(unit_str, tau_legacy_str, unit_str_len); lut_idx = strtoul(unit_str, NULL, 2); @@ -699,7 +701,8 @@ int parse_cereg(const char *at_response, bool is_notif, enum lte_lc_nw_reg_status *reg_status, struct lte_lc_cell *cell, - enum lte_lc_lte_mode *lte_mode) + enum lte_lc_lte_mode *lte_mode, + struct lte_lc_psm_cfg *psm_cfg) { int err, status; struct at_param_list resp_list; @@ -815,6 +818,62 @@ int parse_cereg(const char *at_response, } } + /* Check PSM parameters only if we are connected */ + if ((*reg_status != LTE_LC_NW_REG_REGISTERED_HOME) && + (*reg_status != LTE_LC_NW_REG_REGISTERED_ROAMING)) { + goto clean_exit; + } + + if (psm_cfg != NULL) { + char active_time_str[9] = {0}; + char tau_ext_str[9] = {0}; + int str_len = 8; + int err_active_time; + int err_tau; + + psm_cfg->active_time = -1; + psm_cfg->tau = -1; + + /* Get active time */ + err_active_time = at_params_string_get( + &resp_list, + is_notif ? AT_CEREG_ACTIVE_TIME_INDEX : + AT_CEREG_READ_ACTIVE_TIME_INDEX, + active_time_str, &str_len); + if (err_active_time) { + LOG_DBG("Active time not found, error: %d", err_active_time); + } else { + LOG_DBG("Active time: %s", active_time_str); + } + + /* Get Periodic-TAU-ext */ + err_tau = at_params_string_get( + &resp_list, + is_notif ? AT_CEREG_TAU_INDEX : + AT_CEREG_READ_TAU_INDEX, + tau_ext_str, &str_len); + if (err_tau) { + LOG_DBG("TAU not found, error: %d", err_tau); + } else { + LOG_DBG("TAU: %s", tau_ext_str); + } + + if (err_active_time == 0 && err_tau == 0) { + /* Legacy TAU is not requested because we do not get it from CEREG. + * If extended TAU is not set, TAU will be set to inactive so + * caller can then make its conclusions. + */ + err = parse_psm(active_time_str, tau_ext_str, NULL, psm_cfg); + if (err) { + LOG_ERR("Failed to parse PSM configuration, error: %d", err); + } + } + /* The notification does not always contain PSM parameters, + * so this is not considered an error + */ + err = 0; + } + clean_exit: at_params_list_free(&resp_list); diff --git a/lib/lte_link_control/lte_lc_helpers.h b/lib/lte_link_control/lte_lc_helpers.h index 47e84b1ae586..7896bac5f926 100644 --- a/lib/lte_link_control/lte_lc_helpers.h +++ b/lib/lte_link_control/lte_lc_helpers.h @@ -227,6 +227,7 @@ int encode_psm(char *tau_ext_str, char *active_time_str, int rptau, int rat); * Can be NULL. * @param cell Pointer to cell information struct. Can be NULL. * @param lte_mode Pointer to LTE mode struct. Can be NULL. + * @param psm_cfg Pointer to PSM configuration struct. Can be NULL. * * @return Zero on success or (negative) error code otherwise. */ @@ -234,7 +235,8 @@ int parse_cereg(const char *at_response, bool is_notif, enum lte_lc_nw_reg_status *reg_status, struct lte_lc_cell *cell, - enum lte_lc_lte_mode *lte_mode); + enum lte_lc_lte_mode *lte_mode, + struct lte_lc_psm_cfg *psm_cfg); /* @brief Parses an XT3412 response and extracts the time until next TAU. * diff --git a/lib/nrf_modem_lib/cfun_hooks.c b/lib/nrf_modem_lib/cfun_hooks.c index 7ae6c866508a..85ef84cb10e3 100644 --- a/lib/nrf_modem_lib/cfun_hooks.c +++ b/lib/nrf_modem_lib/cfun_hooks.c @@ -12,6 +12,8 @@ LOG_MODULE_DECLARE(nrf_modem, CONFIG_NRF_MODEM_LIB_LOG_LEVEL); +NRF_MODEM_LIB_ON_INIT(cfun_init_hook, on_modem_init, NULL); + static void cfun_callback(int mode) { STRUCT_SECTION_FOREACH(nrf_modem_lib_at_cfun_cb, e) { @@ -20,11 +22,7 @@ static void cfun_callback(int mode) } } -static int nrf_modem_lib_cfun_hooks_init(void) +static void on_modem_init(int err, void *ctx) { nrf_modem_at_cfun_handler_set(cfun_callback); - - return 0; } - -SYS_INIT(nrf_modem_lib_cfun_hooks_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/lib/nrf_modem_lib/lte_net_if/lte_ip_addr_helper.c b/lib/nrf_modem_lib/lte_net_if/lte_ip_addr_helper.c index 86b829119092..f6922f29b5df 100644 --- a/lib/nrf_modem_lib/lte_net_if/lte_ip_addr_helper.c +++ b/lib/nrf_modem_lib/lte_net_if/lte_ip_addr_helper.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -62,18 +63,18 @@ static int ip_addr_get(char *addr4, char *addr6) } /* inet_pton() is used to check the type of returned address(es). */ - if ((addr4 != NULL) && (inet_pton(AF_INET, addr1, tmp) == 1)) { + if ((addr4 != NULL) && (zsock_inet_pton(AF_INET, addr1, tmp) == 1)) { strcpy(addr4, addr1); return strlen(addr4); } - if ((addr6 != NULL) && (inet_pton(AF_INET6, addr1, tmp) == 1)) { + if ((addr6 != NULL) && (zsock_inet_pton(AF_INET6, addr1, tmp) == 1)) { strcpy(addr6, addr1); return strlen(addr6); } /* If two addresses are provided, the IPv6 address is in the second address argument. */ - if ((addr6 != NULL) && (ret > 1) && (inet_pton(AF_INET6, addr2, tmp) == 1)) { + if ((addr6 != NULL) && (ret > 1) && (zsock_inet_pton(AF_INET6, addr2, tmp) == 1)) { strcpy(addr6, addr2); return strlen(addr6); } diff --git a/lib/sample_rate_converter/Kconfig b/lib/sample_rate_converter/Kconfig index 59b62c60aa5e..37fd4f897130 100644 --- a/lib/sample_rate_converter/Kconfig +++ b/lib/sample_rate_converter/Kconfig @@ -8,6 +8,7 @@ menuconfig SAMPLE_RATE_CONVERTER bool "Sample Rate conversion library [EXPERIMENTAL]" select EXPERIMENTAL select CMSIS_DSP + select CMSIS_DSP_FILTERING select TIMING_FUNCTIONS select RING_BUFFER help diff --git a/lib/tone/Kconfig b/lib/tone/Kconfig index 0a13cc1be47d..09904db81422 100644 --- a/lib/tone/Kconfig +++ b/lib/tone/Kconfig @@ -7,6 +7,7 @@ menuconfig TONE bool "TONE - Sinus creation library" default n select CMSIS_DSP + select CMSIS_DSP_FASTMATH help Library for creating tones diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index a904000160b3..eb053de26d92 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -7,5 +7,6 @@ add_subdirectory_ifdef(CONFIG_BUILD_WITH_TFM trusted-firmware-m) add_subdirectory_ifdef(CONFIG_MEMFAULT memfault-firmware-sdk) add_subdirectory_ifdef(CONFIG_MCUBOOT mcuboot/hooks) +add_subdirectory_ifdef(CONFIG_COREMARK coremark) add_subdirectory(hostap) add_subdirectory(wfa-qt) diff --git a/modules/coremark/CMakeLists.txt b/modules/coremark/CMakeLists.txt new file mode 100644 index 000000000000..6df5037bbccb --- /dev/null +++ b/modules/coremark/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library_named(coremark) + +zephyr_include_directories(${ZEPHYR_COREMARK_MODULE_DIR} .) + +zephyr_library_sources(${ZEPHYR_COREMARK_MODULE_DIR}/core_main.c + ${ZEPHYR_COREMARK_MODULE_DIR}/core_matrix.c + ${ZEPHYR_COREMARK_MODULE_DIR}/core_state.c + ${ZEPHYR_COREMARK_MODULE_DIR}/core_util.c + ${ZEPHYR_COREMARK_MODULE_DIR}/core_list_join.c + core_portme.c) diff --git a/modules/coremark/Kconfig b/modules/coremark/Kconfig new file mode 100644 index 000000000000..d75aab90664f --- /dev/null +++ b/modules/coremark/Kconfig @@ -0,0 +1,111 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig COREMARK + bool "CoreMark benchmark" + imply CBPRINTF_FP_SUPPORT + +if COREMARK + +config COREMARK_ITERATIONS + int "Number of iterations to run" + range 10 10000 + default 2000 + help + Specify the number of iterations to run the benchmark. + CoreMark should execute for at least 10 seconds to have valid results. + The minimum number of iterations depends on the platform and its configuration. + +config COREMARK_THREADS_NUMBER + int "Number of threads for the parallel benchmark execution" + default 1 + range 1 1 if COREMARK_MEMORY_METHOD_STATIC + help + Specify the number of threads to use for the CoreMark execution. + 1 - means the execution only from the main thread. + Each thread will execute the CoreMark algorithm COREMARK_ITERATIONS number of times in parallel. + +config COREMARK_THREADS_PRIORITY + int "CoreMark thread priority" + default 0 + depends on COREMARK_THREADS_NUMBER > 1 + help + Specify the piority of threads to use for the CoreMark execution. + +config COREMARK_THREADS_TIMEOUT_MS + int + default 60000 + depends on COREMARK_THREADS_NUMBER > 1 + help + Timeout after which thread k_join operaton will timeout and signalize error. + +choice COREMARK_RUN_TYPE + prompt "Coremark run type" + default COREMARK_RUN_TYPE_PERFORMANCE + help + Specify the purpose of the CoreMark execution. The required memory size may vary + depending on the type. + +config COREMARK_RUN_TYPE_PERFORMANCE + bool "Performance run" + help + Predefined CoreMark run type which sets CoreMark data to 2000 bytes. + +config COREMARK_RUN_TYPE_PROFILE + bool "Profile run" + help + Predefined CoreMark run type which sets CoreMark data to 1000 bytes. + +config COREMARK_RUN_TYPE_VALIDATION + bool "Validation run" + help + Predefined CoreMark run type which sets CoreMark data to 500 bytes. + +endchoice # COREMARK_RUN_TYPE + +config COREMARK_DATA_SIZE + int "Total size for the data algorithms will operate on" + default 500 if COREMARK_RUN_TYPE_VALIDATION + default 1200 if COREMARK_RUN_TYPE_PROFILE + default 2000 if COREMARK_RUN_TYPE_PERFORMANCE + range 100 2000 + help + Specify the size for the data algorithms. You can choose different values + for it. For registering your results, you need to + run CoreMark with default values for PROFILE and PERFORMANCE run types. + +choice COREMARK_MEMORY_METHOD + prompt "Memory Method" + default COREMARK_MEMORY_METHOD_STACK + help + This option defines the method to get a block of memory. + +config COREMARK_MEMORY_METHOD_STACK + bool "Stack" + help + The main thread stack is used for this memory method. Make sure that there + is enough memory allocated with the MAIN_STACK_SIZE option. The size depends + on the size of the data that CoreMark operates on and a number of threads. It should + be higher than: + COREMARK_DATA_SIZE * COREMARK_THREADS_NUMBER + main thread context. + +config COREMARK_MEMORY_METHOD_STATIC + bool "Static" + help + Data is allocated in the RAM as a regular static variable. + In this case, you do not need to be aware of the main thread stack size or heap memory pool size. + +config COREMARK_MEMORY_METHOD_MALLOC + bool "Malloc" + help + To use this option, you need to set up the system heap size using the + HEAP_MEM_POOL_SIZE option. The size depends on the number of parallel + contexts executed and COREMARK_RUN_TYPE. It should be higher than + COREMARK_DATA_SIZE * COREMARK_THREADS_NUMBER. + +endchoice # COREMARK_MEMORY_METHOD + +endif # COREMARK diff --git a/modules/coremark/core_portme.c b/modules/coremark/core_portme.c new file mode 100644 index 000000000000..71d8f32d3ca1 --- /dev/null +++ b/modules/coremark/core_portme.c @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "coremark.h" + +#define THREAD_STACK_SIZE (512) + +#define _COREMARK_THREAD_STACK_ARRAY_ITEM(n, _) CONCAT(CONCAT(coremark_thread_, n), _stack) + +#define _COREMARK_THREAD_STACK_DEFINE(n, _) \ + static K_THREAD_STACK_DEFINE(_COREMARK_THREAD_STACK_ARRAY_ITEM(n, _), THREAD_STACK_SIZE) + +/** + * @brief Statically define thread stack structure array. + * + * Helper macro to statically define thread stack structure array. + * + * @param _name Name of stack structure array. + * @param _instance_num Number of elements in instance array. + */ +#define COREMARK_THREAD_STACK_INSTANCE_DEFINE(_name, _instance_num) \ + LISTIFY(_instance_num, _COREMARK_THREAD_STACK_DEFINE, (;)); \ + static k_thread_stack_t *_name[] = { \ + LISTIFY(_instance_num, _COREMARK_THREAD_STACK_ARRAY_ITEM, (,)) \ + } + +/* + * Predefined seed values are required by CoreMark for given run types. + */ +#if CONFIG_COREMARK_RUN_TYPE_VALIDATION +volatile ee_s32 seed1_volatile = 0x3415; +volatile ee_s32 seed2_volatile = 0x3415; +volatile ee_s32 seed3_volatile = 0x66; +#endif + +#if CONFIG_COREMARK_RUN_TYPE_PERFORMANCE +volatile ee_s32 seed1_volatile = 0x0; +volatile ee_s32 seed2_volatile = 0x0; +volatile ee_s32 seed3_volatile = 0x66; +#endif + +#if CONFIG_COREMARK_RUN_TYPE_PROFILE +volatile ee_s32 seed1_volatile = 0x8; +volatile ee_s32 seed2_volatile = 0x8; +volatile ee_s32 seed3_volatile = 0x8; +#endif + + +#ifndef CONFIG_COREMARK_THREADS_PRIORITY +#define CONFIG_COREMARK_THREADS_PRIORITY 0 +#endif + +#ifndef CONFIG_COREMARK_THREADS_TIMEOUT_MS +#define CONFIG_COREMARK_THREADS_TIMEOUT_MS 0 +#endif + +volatile ee_s32 seed4_volatile = CONFIG_COREMARK_ITERATIONS; +volatile ee_s32 seed5_volatile = 0; + +ee_u32 default_num_contexts = CONFIG_COREMARK_THREADS_NUMBER; + +static CORE_TICKS start_time_val; +static CORE_TICKS stop_time_val; + +COREMARK_THREAD_STACK_INSTANCE_DEFINE(thread_stacks, CONFIG_COREMARK_THREADS_NUMBER); + +static struct k_thread thread_descriptors[CONFIG_COREMARK_THREADS_NUMBER]; + +static int thread_cnt; + +BUILD_ASSERT((CONFIG_COREMARK_THREADS_NUMBER >= 1), "Number of threads has to be positive"); + +void start_time(void) +{ + start_time_val = k_cycle_get_32(); +} + +void stop_time(void) +{ + stop_time_val = k_cycle_get_32(); +} + +CORE_TICKS get_time(void) +{ + return (stop_time_val - start_time_val); +} + +secs_ret time_in_secs(CORE_TICKS ticks) +{ + secs_ret retval = (secs_ret)(k_cyc_to_ms_floor64(ticks)) / MSEC_PER_SEC; + return retval; +} + +void portable_init(core_portable *p, int *argc, char *argv[]) +{ + ARG_UNUSED(argc); + ARG_UNUSED(argv); + + if (sizeof(ee_ptr_int) != sizeof(ee_u8 *)) { + ee_printf( + "ERROR! Please define ee_ptr_int to a type that holds a " + "pointer!\n"); + k_panic(); + } + + if (sizeof(ee_u32) != 4) { + ee_printf("ERROR! Please define ee_u32 to a 32b unsigned type!\n"); + k_panic(); + } + + p->portable_id = 1; +} + +void portable_fini(core_portable *p) +{ + p->portable_id = 0; +} + +static void coremark_thread(void *id, void *pres, void *p3) +{ + ARG_UNUSED(id); + iterate(pres); +} + +ee_u8 core_start_parallel(core_results *res) +{ + __ASSERT(thread_cnt < CONFIG_COREMARK_THREADS_NUMBER, "Reached max number of threads"); + + (void)k_thread_create(&thread_descriptors[thread_cnt], + thread_stacks[thread_cnt], + THREAD_STACK_SIZE, + coremark_thread, + (void *)thread_cnt, + res, + NULL, + CONFIG_COREMARK_THREADS_PRIORITY, 0, K_NO_WAIT); + + /* Thread creation is done from single thread. + * CoreMark guarantees number of active thread is limited to defined bound. + */ + + thread_cnt++; + + return 0; +} + +ee_u8 core_stop_parallel(core_results *res) +{ + int ret; + + __ASSERT(thread_cnt > 0, "Can't have negative number of active threads"); + thread_cnt--; + + /* Order in which threads are joined does not matter. + * CoreMark will never start threads unless all previously started are joined. + * Stack is guaranteed to be used by one thread only. + */ + + if (thread_cnt == 0) { + for (size_t i = 0; i < CONFIG_COREMARK_THREADS_NUMBER; i++) { + ret = k_thread_join(&thread_descriptors[i], + K_MSEC(CONFIG_COREMARK_THREADS_TIMEOUT_MS)); + if (ret == -EAGAIN) { + ee_printf("Error: Thread join failed due to timeout. Consider " + "increasing CONFIG_COREMARK_THREADS_TIMEOUT_MS\n"); + k_panic(); + } else if (ret) { + ee_printf("Error: Thread %d join failed error: %d", i, ret); + k_panic(); + } + } + } + + return 0; +} diff --git a/modules/coremark/core_portme.h b/modules/coremark/core_portme.h new file mode 100644 index 000000000000..d7f9550fccbb --- /dev/null +++ b/modules/coremark/core_portme.h @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Code is based on template: https://github.com/eembc/coremark/blob/main/simple/core_portme.h + */ + +#ifndef CORE_PORTME_H +#define CORE_PORTME_H + +#include +#include + +#include + +/* Basic CoreMark configuration */ + +/* Configuration : HAS_FLOAT + *Define to 1 if the platform supports floating point. + */ +#ifndef HAS_FLOAT + #define HAS_FLOAT 1 +#endif + +/* Configuration : HAS_TIME_H + * Define to 1 if platform has the time.h header file, + * and implementation of functions thereof. + */ +#ifndef HAS_TIME_H + #define HAS_TIME_H 0 +#endif + +/* Configuration : USE_CLOCK + * Define to 1 if platform has the time.h header file, + * and implementation of functions thereof. + */ +#ifndef USE_CLOCK + #define USE_CLOCK 0 +#endif + +/* Configuration : HAS_STDIO + * Define to 1 if the platform has stdio.h. + */ +#ifndef HAS_STDIO + #define HAS_STDIO 0 +#endif + +/* Configuration : HAS_PRINTF + * Define to 1 if the platform has stdio.h and implements the printf function. + */ +#ifndef HAS_PRINTF + #define HAS_PRINTF 0 +#endif + +/* Configuration : MAIN_HAS_NOARGC + * Needed if platform does not support getting arguments to main. + * + * Valid values : + * 0 - argc/argv to main is supported + * 1 - argc/argv to main is not supported + * + * Note : + * This flag only matters if MULTITHREAD has been defined to a value greater then 1. + */ +#ifndef MAIN_HAS_NOARGC + #define MAIN_HAS_NOARGC 1 +#endif + +/* Configuration : MAIN_HAS_NORETURN + * Needed if platform does not support returning a value from main. + * + * Valid values : + * 0 - main returns an int, and return value will be 0. + * 1 - platform does not support returning a value from main + */ +#ifndef MAIN_HAS_NORETURN + #define MAIN_HAS_NORETURN 1 +#endif + +/* Configuration : SEED_METHOD + * Defines method to get seed values that cannot be computed at compile time. + * + * Valid values : + * SEED_ARG - from command line. + * SEED_FUNC - from a system function. + * SEED_VOLATILE - from volatile variables. + */ +#ifndef SEED_METHOD + #define SEED_METHOD SEED_VOLATILE +#endif + +/* Definitions : COMPILER_VERSION, COMPILER_FLAGS, MEM_LOCATION + * Initialize these strings per platform + */ +#ifndef COMPILER_VERSION + #ifdef __GNUC__ + #define COMPILER_VERSION "GCC"__VERSION__ + #else + #define COMPILER_VERSION "Please put compiler version here (e.g. gcc 4.1)" + #endif +#endif + +#ifndef COMPILER_FLAGS + #define COMPILER_FLAGS CONFIG_COMPILER_OPT " + see compiler flags added by Zephyr" +#endif + +/* Configuration : MEM_METHOD + * Defines method to get a block of memory. + * Valid values : + * MEM_MALLOC - for platforms that implement malloc and have malloc.h. + * MEM_STATIC - to use a static memory array. + * MEM_STACK - to allocate the data block on the stack. + */ +#ifndef MEM_METHOD + #ifdef CONFIG_COREMARK_MEMORY_METHOD_STACK + #define MEM_METHOD MEM_STACK + #define MEM_LOCATION "STACK" + #elif defined(CONFIG_COREMARK_MEMORY_METHOD_STATIC) + #define MEM_METHOD MEM_STATIC + #define MEM_LOCATION "STATIC" + #elif defined(CONFIG_COREMARK_MEMORY_METHOD_MALLOC) + #define MEM_METHOD MEM_MALLOC + #define MEM_LOCATION "MALLOC" + #endif +#endif + +/* Configuration : MULTITHREAD + * Define for parallel execution + * + * Valid values : + * 1 - only one context (default). + * N>1 - will execute N copies in parallel. + * + * Note : + * If this flag is defined to more then 1, an implementation for launching + * parallel contexts must be defined. + * + * Two sample implementations are provided. Use or + * to enable them. + * + * It is valid to have a different implementation of + * and in , to fit a particular architecture. + */ +#ifndef MULTITHREAD + #define MULTITHREAD CONFIG_COREMARK_THREADS_NUMBER +#endif + +#if (MULTITHREAD > 1) + #define PARALLEL_METHOD "Zephyr Threads" +#endif + +/* Depending on the benchmark run type different data size is required. + * Default values for TOTAL_DATA_SIZE is predefined in coremark.h + * Redefine it here and get value according to CoreMark configuration. + */ +#undef TOTAL_DATA_SIZE +#define TOTAL_DATA_SIZE CONFIG_COREMARK_DATA_SIZE + +/* CoreMark's entry point, called 'main' by default. + * As CoreMark sources are read-only this conflict must be solved in other way. + * You need to rename the CoreMark main function. + */ +#define main coremark_run + +/* The crc16 function is present both in Zephyr and CoreMark. + * To avoid multiple definition error without changing benchmark's code, + * CoreMark crc16 instance is renamed. + */ +#define crc16 coremark_crc16 + +/* This function will be used to output benchmark results */ +#define ee_printf printk + +/* Functions used by CoreMark for MEM_METHOD MALLOC case */ +#define portable_malloc k_malloc +#define portable_free k_free + +/* CoreMark-specific data type definition. + * ee_ptr_int must be the data type used for holding pointers. + */ +typedef signed short ee_s16; +typedef unsigned short ee_u16; +typedef signed int ee_s32; +typedef double ee_f32; +typedef unsigned char ee_u8; +typedef unsigned int ee_u32; +typedef ee_u32 ee_ptr_int; +typedef size_t ee_size_t; +typedef uint32_t CORE_TICKS; + +/* The align_mem macro is used to align an offset to point to a 32 b value. It is + * used in the matrix algorithm to initialize the input memory blocks. + */ +#define align_mem(x) (void *)(4 + (((ee_ptr_int)(x) - 1) & ~3)) + +typedef struct CORE_PORTABLE_S { + ee_u8 portable_id; +} core_portable; + +/* Variable : default_num_contexts + * Not used for this simple port, must contain the value 1. + */ +extern ee_u32 default_num_contexts; + +/* target specific init/fini */ +void portable_init(core_portable *p, int *argc, char *argv[]); +void portable_fini(core_portable *p); + +#endif /* CORE_PORTME_H */ diff --git a/modules/coremark/coremark_zephyr.h b/modules/coremark/coremark_zephyr.h new file mode 100644 index 000000000000..32775caac3ea --- /dev/null +++ b/modules/coremark/coremark_zephyr.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef COREMARK_ZEPHYR_H_ +#define COREMARK_ZEPHYR_H_ + +/** + * @brief Runs CoreMarks sample with number of iterations defined by CONFIG_COREMARK_ITERATIONS. + */ +void coremark_run(void); + +#endif /* COREMARK_ZEPHYR_H_ */ diff --git a/modules/hostap/CMakeLists.txt b/modules/hostap/CMakeLists.txt index 7e267b16ea28..199b4816e5fb 100644 --- a/modules/hostap/CMakeLists.txt +++ b/modules/hostap/CMakeLists.txt @@ -382,4 +382,8 @@ zephyr_library_sources_ifdef(CONFIG_WPA_SUPP_EAPOL zephyr_library_compile_definitions_ifdef(CONFIG_WPA_SUPP_EAPOL IEEE8021X_EAPOL ) + +zephyr_library_compile_definitions_ifdef(CONFIG_WPA_SUPP_NW_SEL_RELIABILITY + CONFIG_NW_SEL_RELIABILITY +) endif() diff --git a/modules/hostap/Kconfig b/modules/hostap/Kconfig index 8b32f4342352..1971d598e8e2 100644 --- a/modules/hostap/Kconfig +++ b/modules/hostap/Kconfig @@ -8,8 +8,9 @@ menuconfig WPA_SUPP bool "WPA supplicant support" # Need full POSIX from libc, Zephyr's POSIX support is only partial - depends on !POSIX_API select POSIX_CLOCK + select POSIX_SIGNAL + select POSIX_API select NET_SOCKETS select NET_SOCKETS_PACKET select NET_SOCKETPAIR @@ -58,10 +59,6 @@ config WPA_SUPP_RRM default y endif -choice LIBC_IMPLEMENTATION - default NEWLIB_LIBC -endchoice - config WPA_SUPP_MGD_IFACES_PREFIXES string "WPA supplicant managed interfaces prefixes" default "wlan,esp,nordic_wlan" @@ -104,7 +101,9 @@ config WPA_SUPP_CRYPTO_PSA select PSA_WANT_GENERATE_RANDOM select PSA_WANT_ALG_RSA_PSS select PSA_WANT_ALG_DETERMINISTIC_ECDSA - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR # dep for DETERMINISTIC_ECDSA + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE # ECC_KEY_PAIR* deps for DETERMINISTIC_ECDSA + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT select PSA_WANT_ALG_SHA_512 select PSA_WANT_ALG_SHA_1 select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR @@ -205,16 +204,11 @@ config BSS_MAX_IDLE_TIME # Control interface is stack heavy (buffers + snprintfs) # Making calls to RPU from net_mgmt callbacks (status - RSSI) config NET_MGMT_EVENT_STACK_SIZE - default 4096 + default 4200 config NET_SOCKETS_POLL_MAX default 6 -# Supplicant API is stack heavy (buffers + snprintfs) and control interface -# uses socketpair which pushes the stack usage causing overflow for 2048 bytes. -config SYSTEM_WORKQUEUE_STACK_SIZE - default 2560 - module = WPA_SUPP module-str = WPA supplicant source "subsys/logging/Kconfig.template.log_config" @@ -247,4 +241,22 @@ endif config WPA_SUPP_NO_DEBUG bool "Disable printing of debug messages, saves code size significantly" -endif + +choice WPA_SUPP_NW_SEL + prompt "WPA supplicant Network selection criterion" + default WPA_SUPP_NW_SEL_THROUGHPUT + help + Select the network selection method for the supplicant. + +config WPA_SUPP_NW_SEL_THROUGHPUT + bool "Throughput based network selection" + help + Select the network based on throughput. + +config WPA_SUPP_NW_SEL_RELIABILITY + bool "Reliability based network selection" + help + Select the network based on reliability. +endchoice + +endif # WPA_SUPP diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index c7139ec5715a..9ba1bd45c2d8 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -237,10 +237,15 @@ static inline int chan_to_freq(int chan) * op_class for 5GHz channels as there is no user input * for these (yet). */ - int freq = ieee80211_chan_to_freq(NULL, 81, chan); + int freq = -1; + int op_classes[] = {81, 82, 128}; + int op_classes_size = ARRAY_SIZE(op_classes); - if (freq <= 0) { - freq = ieee80211_chan_to_freq(NULL, 128, chan); + for (int i = 0; i < op_classes_size; i++) { + freq = ieee80211_chan_to_freq(NULL, op_classes[i], chan); + if (freq > 0) { + break; + } } if (freq <= 0) { @@ -289,6 +294,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, int ret; struct add_network_resp resp = {0}; char *chan_list = NULL; + struct net_eth_addr mac = {0}; _wpa_cli_cmd_v("remove_network all"); ret = z_wpa_ctrl_add_network(&resp); @@ -314,7 +320,7 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, } if (chan_list) { - _wpa_cli_cmd_v("set_network %d freq_list%s", resp.network_id, chan_list); + _wpa_cli_cmd_v("set_network %d scan_freq%s", resp.network_id, chan_list); k_free(chan_list); } } @@ -359,6 +365,17 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, _wpa_cli_cmd_v("set_network %d proto WPA", resp.network_id); } + } else if (params->security == WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL) { + if (params->sae_password) { + _wpa_cli_cmd_v("set_network %d sae_password \"%s\"", + resp.network_id, params->sae_password); + } + _wpa_cli_cmd_v("set_network %d psk \"%s\"", + resp.network_id, params->psk); + _wpa_cli_cmd_v("set_network %d key_mgmt WPA-PSK WPA-PSK-SHA256 SAE", + resp.network_id); + _wpa_cli_cmd_v("set_network %d proto WPA RSN", + resp.network_id); } else { ret = -1; wpa_printf(MSG_ERROR, "Unsupported security type: %d", @@ -398,6 +415,25 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, } } + memcpy((void *)&mac, params->bssid, WIFI_MAC_ADDR_LEN); + if (net_eth_is_addr_broadcast(&mac) || + net_eth_is_addr_multicast(&mac)) { + wpa_printf(MSG_ERROR, "Invalid BSSID. Configuration " + "of multicast or broadcast MAC is not allowed."); + ret = -EINVAL; + goto rem_net; + } + + if (!net_eth_is_addr_unspecified(&mac)) { + char bssid_str[MAC_STR_LEN] = {0}; + + snprintf(bssid_str, MAC_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x", + params->bssid[0], params->bssid[1], params->bssid[2], + params->bssid[3], params->bssid[4], params->bssid[5]); + _wpa_cli_cmd_v("set_network %d bssid %s", + resp.network_id, bssid_str); + } + /* enable and select network */ _wpa_cli_cmd_v("enable_network %d", resp.network_id); _wpa_cli_cmd_v("select_network %d", resp.network_id); @@ -778,6 +814,19 @@ int z_wpa_supplicant_channel(const struct device *dev, return wifi_mgmt_api->channel(dev, channel); } +int z_wpa_supplicant_set_rts_threshold(const struct device *dev, + unsigned int rts_threshold) +{ + const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_mgmt_api(dev); + + if (!wifi_mgmt_api || !wifi_mgmt_api->set_rts_threshold) { + wpa_printf(MSG_ERROR, "Set RTS not supported"); + return -ENOTSUP; + } + + return wifi_mgmt_api->set_rts_threshold(dev, rts_threshold); +} + #ifdef CONFIG_AP int z_wpa_supplicant_ap_enable(const struct device *dev, struct wifi_connect_req_params *params) diff --git a/modules/hostap/src/supp_api.h b/modules/hostap/src/supp_api.h index c31491d359bc..11f19502c431 100644 --- a/modules/hostap/src/supp_api.h +++ b/modules/hostap/src/supp_api.h @@ -12,6 +12,7 @@ #define MAX_SSID_LEN 32 #define MAC_ADDR_LEN 6 +#define MAC_STR_LEN 18 /* for ':' or '-' separated MAC address string */ #define CHAN_NUM_LEN 6 /* for space-separated channel numbers string */ /** @@ -141,6 +142,16 @@ int z_wpa_supplicant_filter(const struct device *dev, int z_wpa_supplicant_channel(const struct device *dev, struct wifi_channel_info *channel); +/** + * @brief Set Wi-Fi RTS threshold + * + * @param dev Wi-Fi interface handle to use + * @param rts_threshold RTS threshold to set + * @return 0 for OK; -1 for ERROR + */ +int z_wpa_supplicant_set_rts_threshold(const struct device *dev, + unsigned int rts_threshold); + #ifdef CONFIG_AP /** * @brief Set Wi-Fi AP configuration diff --git a/modules/hostap/src/supp_main.c b/modules/hostap/src/supp_main.c index f134f99adab5..348137d767ce 100644 --- a/modules/hostap/src/supp_main.c +++ b/modules/hostap/src/supp_main.c @@ -83,6 +83,7 @@ static const struct wifi_mgmt_ops wpa_supp_ops = { .mode = z_wpa_supplicant_mode, .filter = z_wpa_supplicant_filter, .channel = z_wpa_supplicant_channel, + .set_rts_threshold = z_wpa_supplicant_set_rts_threshold, #ifdef CONFIG_AP .ap_enable = z_wpa_supplicant_ap_enable, .ap_disable = z_wpa_supplicant_ap_disable, diff --git a/modules/mcuboot/boot/zephyr/Kconfig b/modules/mcuboot/boot/zephyr/Kconfig index f59464b54851..ad79622f0223 100644 --- a/modules/mcuboot/boot/zephyr/Kconfig +++ b/modules/mcuboot/boot/zephyr/Kconfig @@ -58,12 +58,12 @@ config BOOT_USE_NRF_EXTERNAL_CRYPTO config MCUBOOT_NRF_CLEANUP_PERIPHERAL bool "Perform peripheral cleanup before chain-load the application" - depends on SOC_FAMILY_NRF + depends on SOC_FAMILY_NORDIC_NRF default y config MCUBOOT_NRF_CLEANUP_NONSECURE_RAM bool "Perform non-secure RAM cleanup before chain-load the application" - depends on SOC_FAMILY_NRF && ARM_TRUSTZONE_M + depends on SOC_FAMILY_NORDIC_NRF && ARM_TRUSTZONE_M default y if MCUBOOT_USE_ALL_AVAILABLE_RAM config BOOT_SIGNATURE_KEY_FILE @@ -94,7 +94,7 @@ endchoice config BOOT_ERASE_PROGRESSIVELY bool "Erase flash progressively when receiving new firmware" - default y if SOC_FAMILY_NRF + default y if SOC_FAMILY_NORDIC_NRF help If enabled, flash is erased as necessary when receiving new firmware, instead of erasing the whole image slot at once. This is necessary diff --git a/modules/modules.cmake b/modules/modules.cmake index 72d23b92fad8..b274d98f47a9 100644 --- a/modules/modules.cmake +++ b/modules/modules.cmake @@ -3,6 +3,7 @@ set(ZEPHYR_MCUBOOT_KCONFIG ${CMAKE_CURRENT_LIST_DIR}/mcuboot/Kconfig) set(ZEPHYR_NRFXLIB_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}/nrfxlib) set(ZEPHYR_CJSON_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}/cjson) set(ZEPHYR_CJSON_KCONFIG ${CMAKE_CURRENT_LIST_DIR}/cjson/Kconfig) +set(ZEPHYR_COREMARK_KCONFIG ${CMAKE_CURRENT_LIST_DIR}/coremark/Kconfig) set(ZEPHYR_TRUSTED_FIRMWARE_M_KCONFIG ${CMAKE_CURRENT_LIST_DIR}/trusted-firmware-m/Kconfig) set(ZEPHYR_AZURE_SDK_FOR_C_KCONFIG ${CMAKE_CURRENT_LIST_DIR}/azure-sdk-for-c/Kconfig) set(ZEPHYR_AZURE_SDK_FOR_C_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}/azure-sdk-for-c) diff --git a/modules/nrfxlib/nrf_802154/CMakeLists.txt b/modules/nrfxlib/nrf_802154/CMakeLists.txt index 02830a083171..98a68bfbf428 100644 --- a/modules/nrfxlib/nrf_802154/CMakeLists.txt +++ b/modules/nrfxlib/nrf_802154/CMakeLists.txt @@ -6,11 +6,20 @@ if (CONFIG_NRF_802154_RADIO_DRIVER OR CONFIG_NRF_802154_SERIALIZATION) if (CONFIG_NRF_802154_SL) - target_sources(nrf-802154-platform - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_hp_timer.c - ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c - ) + if (CONFIG_SOC_COMPATIBLE_NRF52X OR CONFIG_SOC_COMPATIBLE_NRF53X) + target_sources(nrf-802154-platform + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_hp_timer.c + ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_platform_sl_lptimer_zephyr.c + ) + elseif(CONFIG_SOC_SERIES_NRF54HX OR CONFIG_SOC_SERIES_NRF54LX) + target_sources(nrf-802154-platform + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_platform_timestamper.c + ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_platform_sl_lptimer_grtc.c + ${CMAKE_CURRENT_SOURCE_DIR}/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c + ) + endif() endif () if (CONFIG_MPSL) diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc.c new file mode 100644 index 000000000000..94b46b864e55 --- /dev/null +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "platform/nrf_802154_platform_sl_lptimer.h" +#include "nrf_802154_platform_sl_lptimer_grtc_hw_task.h" + +#include +#include +#include + +#include +#include + +#include "nrf_802154_sl_config.h" +#include "nrf_802154_sl_atomics.h" +#include "nrf_802154_sl_utils.h" +#include "timer/nrf_802154_timer_coord.h" +#include "nrf_802154_sl_periphs.h" + +static atomic_t m_enabled; +static bool m_compare_int_lock_key; +static uint32_t m_critical_section_cnt; +static int32_t m_callbacks_cc_channel; +static int32_t m_hw_task_cc_channel; + +static inline bool is_lptimer_enabled(void) +{ + return atomic_test_bit(&m_enabled, 0); +} + +static void timer_compare_handler(int32_t id, uint64_t expire_time, void *user_data) +{ + (void)user_data; + (void)expire_time; + + assert(id == m_callbacks_cc_channel); + + if (!is_lptimer_enabled()) { + /* The interrupt is late. Ignore it */ + return; + } + + uint64_t curr_ticks = z_nrf_grtc_timer_read(); + + nrf_802154_sl_timer_handler(curr_ticks); +} + +void nrf_802154_platform_sl_lp_timer_init(void) +{ + m_critical_section_cnt = 0UL; + + m_callbacks_cc_channel = z_nrf_grtc_timer_chan_alloc(); + assert(m_callbacks_cc_channel >= 0); + + m_hw_task_cc_channel = z_nrf_grtc_timer_chan_alloc(); + assert(m_hw_task_cc_channel >= 0); + + nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(m_hw_task_cc_channel); +} + +void nrf_802154_platform_sl_lp_timer_deinit(void) +{ + (void)z_nrf_grtc_timer_compare_int_lock(m_callbacks_cc_channel); + + z_nrf_grtc_timer_chan_free(m_callbacks_cc_channel); + z_nrf_grtc_timer_chan_free(m_hw_task_cc_channel); +} + +uint64_t nrf_802154_platform_sl_lptimer_current_lpticks_get(void) +{ + return z_nrf_grtc_timer_read(); +} + +uint64_t nrf_802154_platform_sl_lptimer_us_to_lpticks_convert(uint64_t us, bool round_up) +{ + (void) round_up; + + return us; +} + +uint64_t nrf_802154_platform_sl_lptimer_lpticks_to_us_convert(uint64_t lpticks) +{ + return lpticks; +} + +void nrf_802154_platform_sl_lptimer_schedule_at(uint64_t fire_lpticks) +{ + /* This function is not required to be reentrant, hence no critical section. */ + atomic_set_bit(&m_enabled, 0); + + z_nrf_grtc_timer_set(m_callbacks_cc_channel, + fire_lpticks, + timer_compare_handler, + NULL); +} + +void nrf_802154_platform_sl_lptimer_disable(void) +{ + atomic_clear_bit(&m_enabled, 0); + + z_nrf_grtc_timer_abort(m_callbacks_cc_channel); +} + +void nrf_802154_platform_sl_lptimer_critical_section_enter(void) +{ + nrf_802154_sl_mcu_critical_state_t state; + + nrf_802154_sl_mcu_critical_enter(state); + + m_critical_section_cnt++; + + if (m_critical_section_cnt == 1UL) { + m_compare_int_lock_key = z_nrf_grtc_timer_compare_int_lock(m_callbacks_cc_channel); + } + + nrf_802154_sl_mcu_critical_exit(state); +} + +void nrf_802154_platform_sl_lptimer_critical_section_exit(void) +{ + nrf_802154_sl_mcu_critical_state_t state; + + nrf_802154_sl_mcu_critical_enter(state); + + assert(m_critical_section_cnt > 0UL); + + if (m_critical_section_cnt == 1UL) { + z_nrf_grtc_timer_compare_int_unlock(m_callbacks_cc_channel, m_compare_int_lock_key); + } + + m_critical_section_cnt--; + + nrf_802154_sl_mcu_critical_exit(state); +} + +typedef uint8_t hw_task_state_t; +#define HW_TASK_STATE_IDLE 0u +#define HW_TASK_STATE_SETTING_UP 1u +#define HW_TASK_STATE_READY 2u +#define HW_TASK_STATE_CLEANING 3u +#define HW_TASK_STATE_UPDATING 4u + +static volatile hw_task_state_t m_hw_task_state = HW_TASK_STATE_IDLE; +static uint64_t m_hw_task_fire_lpticks; + +static bool hw_task_state_set(hw_task_state_t expected_state, hw_task_state_t new_state) +{ + return nrf_802154_sl_atomic_cas_u8( + (uint8_t *)&m_hw_task_state, &expected_state, new_state); +} + +nrf_802154_sl_lptimer_platform_result_t nrf_802154_platform_sl_lptimer_hw_task_prepare( + uint64_t fire_lpticks, + uint32_t ppi_channel) +{ + const uint64_t grtc_cc_minimum_margin = 1uLL; + uint64_t syscnt_now; + bool done_on_time = true; + nrf_802154_sl_mcu_critical_state_t mcu_cs_state; + + if (!hw_task_state_set(HW_TASK_STATE_IDLE, HW_TASK_STATE_SETTING_UP)) { + /* the only one available set of peripherals is already used */ + return NRF_802154_SL_LPTIMER_PLATFORM_NO_RESOURCES; + } + + nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup( + ppi_channel, m_hw_task_cc_channel); + + m_hw_task_fire_lpticks = fire_lpticks; + + z_nrf_grtc_timer_set(m_hw_task_cc_channel, fire_lpticks, NULL, NULL); + + nrf_802154_sl_mcu_critical_enter(mcu_cs_state); + + /* @todo: can this read be done outside of critical section? */ + syscnt_now = z_nrf_grtc_timer_read(); + + if (syscnt_now + grtc_cc_minimum_margin >= fire_lpticks) { + /* it is too late */ + nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(); + z_nrf_grtc_timer_abort(m_hw_task_cc_channel); + done_on_time = false; + } + + nrf_802154_sl_mcu_critical_exit(mcu_cs_state); + + hw_task_state_set(HW_TASK_STATE_SETTING_UP, + done_on_time ? HW_TASK_STATE_READY : HW_TASK_STATE_IDLE); + + return done_on_time ? NRF_802154_SL_LPTIMER_PLATFORM_SUCCESS : + NRF_802154_SL_LPTIMER_PLATFORM_TOO_LATE; +} + +nrf_802154_sl_lptimer_platform_result_t nrf_802154_platform_sl_lptimer_hw_task_cleanup(void) +{ + if (!hw_task_state_set(HW_TASK_STATE_READY, HW_TASK_STATE_CLEANING)) { + return NRF_802154_SL_LPTIMER_PLATFORM_WRONG_STATE; + } + + nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(); + + z_nrf_grtc_timer_abort(m_hw_task_cc_channel); + + hw_task_state_set(HW_TASK_STATE_CLEANING, HW_TASK_STATE_IDLE); + + return NRF_802154_SL_LPTIMER_PLATFORM_SUCCESS; +} + +nrf_802154_sl_lptimer_platform_result_t nrf_802154_platform_sl_lptimer_hw_task_update_ppi( + uint32_t ppi_channel) +{ + bool cc_triggered; + + if (!hw_task_state_set(HW_TASK_STATE_READY, HW_TASK_STATE_UPDATING)) { + return NRF_802154_SL_LPTIMER_PLATFORM_WRONG_STATE; + } + + nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup( + ppi_channel, m_hw_task_cc_channel); + + cc_triggered = z_nrf_grtc_timer_compare_evt_check(m_hw_task_cc_channel); + if (z_nrf_grtc_timer_read() >= m_hw_task_fire_lpticks) { + cc_triggered = true; + } + + hw_task_state_set(HW_TASK_STATE_UPDATING, HW_TASK_STATE_READY); + + return cc_triggered ? NRF_802154_SL_LPTIMER_PLATFORM_TOO_LATE : + NRF_802154_SL_LPTIMER_PLATFORM_SUCCESS; +} diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c new file mode 100644 index 000000000000..33a3ad62c907 --- /dev/null +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf_802154_platform_sl_lptimer_grtc_hw_task.h" + +#include +#include +#include + +#include +#include + +#if defined(NRF54H_SERIES) + +#include + +/* To trigger RADIO.TASKS_{?} with GRTC.EVENT_COMPARE[#cc] the following connection chain must be + * created: + * - starting from LOCAL (RADIO core) domain: + * {a} RADIO.TASKS_{?} <-- DPPIC_020 + * {b} DPPIC_020 <-- IPCT_radio + * - entering the GLOBAL "Main power" domain (G1): + * {c} IPCT_radio <-- IPCT_130 + * {d} IPCT_130 <-- DPPIC_130 + * {e} DPPIC_130 <-- PPIB_130 + * {f} PPIB_130 <-- PPIB_133 + * - ending in the GLOBAL "Active power" domain (G2): + * {g} PPIB_133 <-- DPPIC_132 + * {h} DPPIC_132 <-- GRTC.CC + */ + +/* Peripherals used for hardware tasks - located in local domain (_L_) */ +/* - DPPIC_L : DPPIC020 (RADIOCORE.DPPIC020) */ +/* - IPCT_L : NRF_IPCT (RADIOCORE.IPCT) */ +#define IPCT_L_HT_CHANNEL 2 +#if defined(NRF54H20_ENGA_XXAA) +#define IPCT_L_SHORTS IPCT_SHORTS_RECEIVE2_ACK2_Msk +#else +#define IPCT_L_SHORTS IPCT_SHORTS_RECEIVE2_FLUSH2_Msk +#endif +#define IPCT_L_EVENT_RECEIVE NRFX_CONCAT_2(NRF_IPCT_EVENT_RECEIVE_, IPCT_L_HT_CHANNEL) + +/* Peripherals used for timestamping - located in global "Main power domain" (_G1_) */ +/* - IPCT_G1 : IPCT130_S */ +#define IPCT_G1_HT_CHANNEL 2 +#define IPCT_G1_TASK_SEND NRFX_CONCAT_2(NRF_IPCT_TASK_SEND_, IPCT_G1_HT_CHANNEL) + +/* - DPPIC_G1 : DPPIC130_S */ +/* The channel must be in the [0..7] range to satisfy the requirements for the dependent macros */ +#define DPPIC_G1_HT_CHANNEL 2 + +/* - PPIB_G1 : PPIB130_S */ +#define PPIB_G1_HT_CHANNEL (DPPIC_G1_HT_CHANNEL + 8) /* hw-fixed dependency */ + +/* Peripherals used for timestamping - located in global "Active power domain" (_G2_) */ +/* - PPIB_G2 : PPIB133_S */ +#define PPIB_G2_HT_CHANNEL (PPIB_G1_HT_CHANNEL - 8) /* hw-fixed dependency */ + +/* - DPPIC_G2 : DPPIC132_S */ +#define DPPIC_G2_HT_CHANNEL (PPIB_G2_HT_CHANNEL + 0) /* hw-fixed dependency */ + +#if (PPIB_G1_HT_CHANNEL < 8) || (PPIB_G1_HT_CHANNEL > 15) +/* Only this range of channels can be connected to PPIB133 */ +#error PPIB_G1_HT_CHANNEL is required to be in the [8..15] range +#endif + +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) +{ + /* {c} IPCT_radio <-- IPCT_130 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring of the UICR->IPCMAP[] registers. + * + * Only enable auto confirmations on destination - IPCT_radio. + */ + nrf_ipct_shorts_enable(NRF_IPCT, IPCT_L_SHORTS); + + /* {d} IPCT_130 <-- DPPIC_130 */ + nrf_ipct_subscribe_set(IPCT_G1_INST, IPCT_G1_TASK_SEND, DPPIC_G1_HT_CHANNEL); + + /* {e} DPPIC_130 <-- PPIB_130 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring the UICR->DPPI.GLOBAL[].CH.LINK.SOURCE registers. + * + * Only enable relevant DPPIC_G1_INST channel. + */ + nrfy_dppi_channels_enable(DPPIC_G1_INST, 1UL << DPPIC_G1_HT_CHANNEL); + + /* {f} PPIB_130 <-- PPIB_133 + * One of HW-fixed connections (channels [8..15] --> [0..7]), so nothing to do. + */ + + /* {g} PPIB_133 <-- DPPIC_132 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring of the UICR->DPPI.GLOBAL[].CH.LINK.SINK registers. + */ + + /* {h} DPPIC_132 <-- GRTC.CC */ + NRF_DPPI_ENDPOINT_SETUP( + z_nrf_grtc_timer_compare_evt_address_get(cc_channel), DPPIC_G2_HT_CHANNEL); +} + +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) +{ + /* @todo: implement */ +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, + uint32_t cc_channel) +{ + if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { + return; + } + + nrf_ipct_event_clear(NRF_IPCT, IPCT_L_EVENT_RECEIVE); + + /* {a} RADIO.TASKS_{?} <-- DPPIC_020[dppi_ch] + * It is the responsibility of the user of this platform to make the {a} connection + * and pass the DPPI channel number as a parameter here. + */ + + /* {b} DPPIC_020[dppi_ch] <-- IPCT_radio */ + nrf_ipct_publish_set(NRF_IPCT, IPCT_L_EVENT_RECEIVE, dppi_ch); + + /* {h} Enable relevant DPPIC_G2_INST channel. */ + nrfy_dppi_channels_enable(DPPIC_G2_INST, 1UL << DPPIC_G2_HT_CHANNEL); +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) +{ + nrf_ipct_publish_clear(NRF_IPCT, IPCT_L_EVENT_RECEIVE); + nrfy_dppi_channels_disable(DPPIC_G2_INST, 1UL << DPPIC_G2_HT_CHANNEL); + nrf_ipct_event_clear(NRF_IPCT, IPCT_L_EVENT_RECEIVE); +} + +#elif defined(NRF54L_SERIES) + +/* To trigger GRTC.TASKS_CAPTURE[#cc] with RADIO.EVENT_{?}, the following connection chain must be + * created: + * - starting from RADIO domain (_R_): + * {a} RADIO.EVENT_{?} <-- DPPIC_10 + * {b} DPPIC_10 <-- PPIB_11 + * - crossing domain boundaries + * {c} PPIB_11 <-- PPIB_21 + * - ending in the PERI domain (_P_): + * {d} PPIB_21 <-- DPPIC_20 + * {e} DPPIC_20 <-- GRTC.CC + */ + +/* Peripherals used for timestamping - located in radio power domain (_R_) */ +/* - DPPIC_L : DPPIC10 */ +#define DPPIC_R_INST NRF_DPPIC10 +#define PPIB_R_INST NRF_PPIB11 + +/* Peripherals used for timestamping - located in peripheral power domain (_P_) */ + +/* - DPPIC_P : DPPIC20 */ +#define DPPIC_P_INST NRF_DPPIC20 + +/* - PPIB_P : PPIB21 */ +#define PPIB_P_INST NRF_PPIB21 + +static uint32_t m_dppi_ch = NRF_802154_SL_HW_TASK_PPI_INVALID; + +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) +{ + /* Intentionally empty. */ +} + +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) +{ + /* Intentionally empty. */ +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, + uint32_t cc_channel) +{ + if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { + return; + } + + m_dppi_ch = dppi_ch; + + /* {a} RADIO.TASKS_{?} <-- DPPIC_10[dppi_ch] + * It is the responsibility of the user of this platform to make the {a} connection + * and pass the DPPI channel number as a parameter here. + */ + + /* {b} DPPIC_10 <-- PPIB_11 */ + nrf_ppib_publish_set(PPIB_R_INST, nrf_ppib_receive_event_get(dppi_ch), dppi_ch); + + /* {c} PPIB_11 <-- PPIB_21 + * One of HW-fixed connections, so nothing to do. + */ + + /* {d} PPIB_21 <-- DPPIC_20 */ + nrf_ppib_subscribe_set(PPIB_P_INST, nrf_ppib_send_task_get(dppi_ch), dppi_ch); + + /* {e} DPPIC_20 <-- GRTC.CC */ + NRF_DPPI_ENDPOINT_SETUP( + z_nrf_grtc_timer_compare_evt_address_get(cc_channel), dppi_ch); + + nrfy_dppi_channels_enable(DPPIC_P_INST, 1UL << dppi_ch); +} + +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) +{ + uint32_t dppi_ch = m_dppi_ch; + + if (dppi_ch != NRF_802154_SL_HW_TASK_PPI_INVALID) { + nrf_ppib_subscribe_clear(PPIB_R_INST, nrf_ppib_send_task_get(dppi_ch)); + nrf_ppib_publish_clear(PPIB_P_INST, nrf_ppib_receive_event_get(dppi_ch)); + nrfy_dppi_channels_disable(DPPIC_P_INST, 1UL << dppi_ch); + } +} + +#endif diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.h b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.h new file mode 100644 index 000000000000..d49ff14ad1ae --- /dev/null +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef NRF_802154_PLATFORM_SL_LPTIMER_GRTC_HW_TASK_H_ +#define NRF_802154_PLATFORM_SL_LPTIMER_GRTC_HW_TASK_H_ + +#include + +/** + * @brief Sets up cross-domain hardware connections necessary to trigger a RADIO task. + * + * This function configures cross-domain hardware connections necessary to trigger a RADIO task with + * an event from GRTC. These connections are identical for all RADIO tasks. + * + * @note Every call to this function must be paired with a call to @ref + * nrf_802154_platform_timestamper_cross_domain_connections_clear. + */ +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel); + +/** + * @brief Clears cross-domain hardware connections necessary to capture a timestamp. + */ +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void); + +/** + * @brief Sets up local domain hardware connections necessary to trigger a RADIO task. + * + * This function configures local-domain hardware connections necessary to trigger a RADIO task with + * an event from GRTC. These connections must be setup separately for every RADIO task. + * + * @param dppi_ch Local domain DPPI channel that the RADIO task to be triggered subscribes to. + */ +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, + uint32_t cc_channel); + +/** + * @brief Clears local domain hardware connections necessary to trigger a RADIO task. + */ +void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void); + +#endif /* NRF_802154_PLATFORM_SL_LPTIMER_GRTC_HW_TASK_H_ */ diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c new file mode 100644 index 000000000000..8c5288049761 --- /dev/null +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "platform/nrf_802154_platform_timestamper.h" + +#include +#include +#include +#include + +#include +#include + +static int32_t m_timestamp_cc_channel; + +#if defined(NRF54H_SERIES) +/* To trigger GRTC.TASKS_CAPTURE[#cc] with RADIO.EVENT_{?}, the following connection chain must be + * created: + * - starting from LOCAL (RADIO core) domain: + * {a} RADIO.EVENT_{?} --> DPPIC_020 + * {b} DPPIC_020 --> IPCT_radio + * - entering the GLOBAL "Main power" domain (G1): + * {c} IPCT_radio --> IPCT_130 + * {d} IPCT_130 --> DPPIC_130 + * {e} DPPIC_130 --> PPIB_130 + * {f} PPIB_130 --> PPIB_133 + * - ending in the GLOBAL "Active power" domain (G2): + * {g} PPIB_133 --> DPPIC_132 + * {h} DPPIC_132 --> GRTC.CC + */ + +/* Peripherals used for timestamping - located in local domain (_L_) */ +/* - DPPIC_L : DPPIC020 (RADIOCORE.DPPIC020) */ +#define DPPIC_L_INST NRF_DPPIC020 + +/* - IPCT_L : NRF_IPCT (RADIOCORE.IPCT) */ +#define IPCT_L_TS_CHANNEL 0 +#define IPCT_L_TASK_SEND NRFX_CONCAT_2(NRF_IPCT_TASK_SEND_, IPCT_L_TS_CHANNEL) + +/* Peripherals used for timestamping - located in global "Main power domain" (_G1_) */ +/* - IPCT_G1 : IPCT130_S */ +#define IPCT_G1_INST NRF_IPCT130_S +#define IPCT_G1_TS_CHANNEL 0 +#if defined(NRF54H20_ENGA_XXAA) +#define IPCT_G1_SHORTS IPCT_SHORTS_RECEIVE0_ACK0_Msk +#else +#define IPCT_G1_SHORTS IPCT_SHORTS_RECEIVE0_FLUSH0_Msk +#endif +#define IPCT_G1_EVENT_RECEIVE NRFX_CONCAT_2(NRF_IPCT_EVENT_RECEIVE_, IPCT_G1_TS_CHANNEL) + +/* - DPPIC_G1 : DPPIC130_S */ +/* The channel must be in the [0..7] range to satisfy the requirements for the dependent macros */ +#define DPPIC_G1_INST NRF_DPPIC130_S +#define DPPIC_G1_TS_CHANNEL 3 + +/* - PPIB_G1 : PPIB130_S */ +#define PPIB_G1_TS_CHANNEL (DPPIC_G1_TS_CHANNEL + 8) /* hw-fixed dependency */ + +/* Peripherals used for timestamping - located in global "Active power domain" (_G2_) */ +/* - PPIB_G2 : PPIB133_S */ +#define PPIB_G2_TS_CHANNEL (PPIB_G1_TS_CHANNEL - 8) /* hw-fixed dependency */ + +/* - DPPIC_G2 : DPPIC132_S */ +#define DPPIC_G2_INST NRF_DPPIC132_S +#define DPPIC_G2_TS_CHANNEL (PPIB_G2_TS_CHANNEL + 0) /* hw-fixed dependency */ + +#if (PPIB_G1_TS_CHANNEL < 8) || (PPIB_G1_TS_CHANNEL > 15) +/* Only this range of channels can be connected to PPIB133 */ +#error PPIB_G1_TS_CHANNEL is required to be in the [8..15] range +#endif + +void nrf_802154_platform_timestamper_cross_domain_connections_setup(void) +{ + /* {c} IPCT_radio --> IPCT_130 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring the UICR->IPCMAP[] registers. + * + * Only enable auto confirmations on destination - IPCT_130. + */ + nrf_ipct_shorts_enable(IPCT_G1_INST, IPCT_G1_SHORTS); + + /* {d} IPCT_130 --> DPPIC_130 */ + nrf_ipct_publish_set(IPCT_G1_INST, IPCT_G1_EVENT_RECEIVE, DPPIC_G1_TS_CHANNEL); + + /* {e} DPPIC_130 --> PPIB_130 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring the UICR->DPPI.GLOBAL[].CH.LINK.SOURCE registers. + * + * Only enable relevant DPPIC_G1_INST channel. + */ + nrfy_dppi_channels_enable(DPPIC_G1_INST, 1UL << DPPIC_G1_TS_CHANNEL); + + /* {f} PPIB_130 --> PPIB_133 + * One of HW-fixed connections (channels [8..15] --> [0..7]), so nothing to do. + */ + + /* {g} PPIB_133 --> DPPIC_132 + * It is assumed that this connection has already been made by SECURE-core as a result of + * configuring of the UICR->DPPI.GLOBAL[].CH.LINK.SINK registers. + */ + + /* {h} DPPIC_132 --> GRTC.CC */ + nrf_grtc_task_t capture_task = + nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); + NRF_DPPI_ENDPOINT_SETUP( + nrfy_grtc_task_address_get(NRF_GRTC, capture_task), DPPIC_G2_TS_CHANNEL); + + /* Enable relevant DPPIC_G2_INST channel. */ + nrfy_dppi_channels_enable(DPPIC_G2_INST, 1UL << DPPIC_G2_TS_CHANNEL); +} + +void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch) +{ + /* {a} RADIO.EVENT_{?} --> DPPIC_020[dppi_ch] + * It is the responsibility of the user of this platform to make the {a} connection + * and pass the DPPI channel number as a parameter here. + */ + + /* {b} DPPIC_020[dppi_ch] to IPCT_radio. */ + nrf_ipct_subscribe_set(NRF_IPCT, IPCT_L_TASK_SEND, dppi_ch); +} + +#elif defined(NRF54L_SERIES) + +/* To trigger GRTC.TASKS_CAPTURE[#cc] with RADIO.EVENT_{?}, the following connection chain must be + * created: + * - starting from RADIO domain (_R_): + * {a} RADIO.EVENT_{?} --> DPPIC_10 + * {b} DPPIC_10 --> PPIB_11 + * - crossing domain boundaries + * {c} PPIB_11 --> PPIB_21 + * - ending in the PERI domain (_P_): + * {d} PPIB_21 --> DPPIC_20 + * {e} DPPIC_20 --> GRTC.CC + */ + +/* Peripherals used for timestamping - located in radio power domain (_R_) */ +/* - DPPIC_L : DPPIC10 */ +#define DPPIC_R_INST NRF_DPPIC10 +#define PPIB_R_INST NRF_PPIB11 + +/* Peripherals used for timestamping - located in peripheral power domain (_P_) */ + +/* - DPPIC_P : DPPIC20 */ +#define DPPIC_P_INST NRF_DPPIC20 + +/* - PPIB_P : PPIB21 */ +#define PPIB_P_INST NRF_PPIB21 + +void nrf_802154_platform_timestamper_cross_domain_connections_setup(void) +{ + /* Intentionally empty. */ +} + +void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch) +{ + z_nrf_grtc_timer_capture_prepare(m_timestamp_cc_channel); + + /* {a} RADIO.EVENT_{?} --> DPPIC_10 + * It is the responsibility of the user of this platform to make the {a} connection + * and pass the DPPI channel number as a parameter here. + */ + + /* {b} DPPIC_10 --> PPIB_11 */ + nrf_ppib_subscribe_set(PPIB_R_INST, nrf_ppib_send_task_get(dppi_ch), dppi_ch); + + /* {c} PPIB_11 --> PPIB_21 + * One of HW-fixed connections, so nothing to do. + */ + + /* {d} PPIB_21 --> DPPIC_20 */ + nrf_ppib_publish_set(PPIB_P_INST, nrf_ppib_receive_event_get(dppi_ch), dppi_ch); + + /* {e} DPPIC_20[dppi_ch] --> GRTC.CC[cc_channel] */ + nrf_grtc_task_t capture_task = + nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); + NRF_DPPI_ENDPOINT_SETUP(nrfy_grtc_task_address_get(NRF_GRTC, capture_task), dppi_ch); + + nrfy_dppi_channels_enable(DPPIC_P_INST, 1UL << dppi_ch); +} + +#endif + +void nrf_802154_platform_timestamper_init(void) +{ + m_timestamp_cc_channel = z_nrf_grtc_timer_chan_alloc(); + assert(m_timestamp_cc_channel >= 0); +} + +void nrf_802154_platform_timestamper_cross_domain_connections_clear(void) +{ + nrf_grtc_task_t capture_task = + nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); + + NRF_DPPI_ENDPOINT_CLEAR(nrfy_grtc_task_address_get(NRF_GRTC, capture_task)); +} + +void nrf_802154_platform_timestamper_local_domain_connections_clear(uint32_t dppi_ch) +{ + /* Intentionally empty. */ +} + +bool nrf_802154_platform_timestamper_captured_timestamp_read(uint64_t *p_captured) +{ + /* @todo: check if this can be replaced with: + * + * z_nrf_grtc_timer_capture_read(m_timestamp_cc_channel, p_captured); + */ + if (nrf_grtc_sys_counter_cc_enable_check(NRF_GRTC, m_timestamp_cc_channel)) { + return false; + } + + *p_captured = nrfy_grtc_sys_counter_cc_get(NRF_GRTC, m_timestamp_cc_channel); + return true; +} diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 7df9007655fb..8d3923983fb5 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_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 @@ -105,9 +105,9 @@ if (CONFIG_TFM_SECURE_UART1) ) endif() -if (CONFIG_TFM_SECURE_UART22) +if (CONFIG_TFM_SECURE_UART30) 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=30 ) endif() @@ -193,10 +193,10 @@ if (CONFIG_TFM_PSA_FRAMEWORK_HAS_MM_IOVEC) ) endif() -if (CONFIG_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 - -DCONFIG_NFCT_PINS_AS_GPIOS=${CONFIG_NFCT_PINS_AS_GPIOS} + -DCONFIG_NFCT_PINS_AS_GPIOS=ON ) endif() @@ -243,6 +243,7 @@ set(CRYPTO_CIPHER_MODULE_ENABLED ${CONFIG_TFM_CRYPTO_CIPHER_MODULE_ENA set(CRYPTO_ASYM_SIGN_MODULE_ENABLED ${CONFIG_TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED}) set(CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED ${CONFIG_TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED}) set(CRYPTO_KEY_DERIVATION_MODULE_ENABLED ${CONFIG_TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED}) +set(CRYPTO_PAKE_MODULE_ENABLED ${CONFIG_TFM_CRYPTO_PAKE_MODULE_ENABLED}) set(CRYPTO_IOVEC_BUFFER_SIZE ${CONFIG_TFM_CRYPTO_IOVEC_BUFFER_SIZE}) set(CRYPTO_NV_SEED ${CONFIG_TFM_CRYPTO_NV_SEED}) set(CRYPTO_SINGLE_PART_FUNCS_DISABLED ${CONFIG_TFM_CRYPTO_SINGLE_PART_FUNCS_DISABLED}) diff --git a/modules/trusted-firmware-m/Kconfig b/modules/trusted-firmware-m/Kconfig index 3919ca1cd283..a5688d90748d 100644 --- a/modules/trusted-firmware-m/Kconfig +++ b/modules/trusted-firmware-m/Kconfig @@ -64,6 +64,7 @@ config TFM_CRYPTO_BUILTIN_KEYS prompt "TF-M crypto builtin keys" default y depends on !TFM_PROFILE_TYPE_MINIMAL + depends on !CRACEN_HW_PRESENT select PSA_WANT_ALG_HKDF select PSA_WANT_ALG_HMAC select PSA_WANT_ALG_SHA_256 @@ -114,19 +115,11 @@ config TFM_CRYPTO_PARTITION_STACK_SIZE hex prompt "TF-M Crypto Partition - Stack size" if !TFM_PROFILE_TYPE_MINIMAL default 0x800 if TFM_PROFILE_TYPE_MINIMAL - default 0x4000 if PSA_WANT_RSA_KEY_SIZE_4096 + default 0x4000 if PSA_WANT_RSA_KEY_SIZE_4096 || PSA_WANT_RSA_KEY_SIZE_3072 default 0x2000 help The stack size of the Crypto Secure Partition -config TFM_CRYPTO_NV_SEED - # Hidden option to set value based on TF-M minimal profile - bool - default y if !TFM_PROFILE_TYPE_MINIMAL - help - Prompt-less configuration controlling NV Seed support. - Not set when TFM_PROFILE_TYPE_MINIMAL is used - endmenu # Copied from secure_fw/partitions/initial_attestation/Kconfig, appended the TFM prefix @@ -295,6 +288,23 @@ config TFM_PROFILE_TYPE_MINIMAL and reproduce the desired configuration through kconfig fragments. endchoice +config TFM_NFCT_PINS_AS_GPIOS + bool + default y if !DT_HAS_NORDIC_NRF_NFCT_ENABLED + depends on SOC_NRF5340_CPUAPP + help + Two pins are usually reserved for NFC in SoCs that implement the + NFCT peripheral. This option switches them to normal GPIO mode. + HW enabling happens once in the device lifetime, during the first + system startup. Disabling this option will not switch back these + pins to NFCT mode. Doing this requires UICR erase prior to + flashing device using the image which has this option disabled. + + NFC pins in nRF5340: P0.02 and P0.03 + + TF-M configures these pins as GPIOS when the NFCT peripheral is not + enabled in the device-tree of the target. + config TFM_SECURE_UART bool "TF-M configure UART instance as secure peripheral" default y if !TFM_LOG_LEVEL_SILENCE @@ -318,7 +328,7 @@ config TFM_SECURE_UART_SHARE_INSTANCE choice TFM_SECURE_UART_INSTANCE prompt "TF-M logging UART instance" - default TFM_SECURE_UART22 if SOC_SERIES_NRF54LX + default TFM_SECURE_UART30 if SOC_SERIES_NRF54LX default TFM_SECURE_UART1 config TFM_SECURE_UART0 @@ -333,11 +343,11 @@ config TFM_SECURE_UART1 select NRF_UARTE1_SECURE select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE1 || HAS_HW_NRF_UARTE1 -config TFM_SECURE_UART22 - bool "TF-M logging will use UART22 instance" -#TODO: NCSDK-25009: Fix DT for secure UART22 depends on $(dt_nodelabel_has_prop,uart22,pinctrl-names) - select NRF_UARTE22_SECURE - select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE22 || HAS_HW_NRF_UARTE22 +config TFM_SECURE_UART30 + bool "TF-M logging will use UART30 instance" +#TODO: NCSDK-25009: Fix DT for secure UART30 depends on $(dt_nodelabel_has_prop,uart30,pinctrl-names) + select NRF_UARTE30_SECURE + select TFM_SECURE_UART_SHARE_INSTANCE if NRFX_UARTE30 || HAS_HW_NRF_UARTE30 endchoice diff --git a/modules/trusted-firmware-m/Kconfig.peripheral_secure b/modules/trusted-firmware-m/Kconfig.peripheral_secure index d7ce55454388..f0e195a44ba7 100644 --- a/modules/trusted-firmware-m/Kconfig.peripheral_secure +++ b/modules/trusted-firmware-m/Kconfig.peripheral_secure @@ -9,8 +9,8 @@ if BUILD_WITH_TFM menu "Peripheral Secure mapping" # TODO: NCSDK-22597: port this file (add peripherals) to 54L -peripheral=UARTE22 -peripheral_depends=$(dt_nodelabel_has_compat,uart22,$(DT_COMPAT_NORDIC_NRF_UARTE)) +peripheral=UARTE30 +peripheral_depends=$(dt_nodelabel_has_compat,uart30,$(DT_COMPAT_NORDIC_NRF_UARTE)) rsource "Kconfig.template.peripheral_secure" # end TODO diff --git a/modules/trusted-firmware-m/Kconfig.tfm.defconfig b/modules/trusted-firmware-m/Kconfig.tfm.defconfig index 8703540405da..2f176fa1b7f8 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.defconfig +++ b/modules/trusted-firmware-m/Kconfig.tfm.defconfig @@ -16,7 +16,7 @@ config TFM_BOARD if BUILD_WITH_TFM config TFM_ISOLATION_LEVEL - default 1 if SOC_FAMILY_NRF + default 1 if SOC_FAMILY_NORDIC_NRF config TFM_BL2 bool @@ -38,8 +38,8 @@ config TFM_LOG_LEVEL_SILENCE $(dt_nodelabel_has_prop,uart1,pinctrl-names) || \ SOC_SERIES_NRF54LX # TODO: NCSDK-25009: Use pin-ctrl-names for 54L - choice TFM_PROFILE_TYPE + default TFM_PROFILE_TYPE_NOT_SET if SOC_SERIES_NRF54LX default TFM_PROFILE_TYPE_MINIMAL endchoice @@ -60,7 +60,8 @@ config TFM_PARTITION_INITIAL_ATTESTATION # The identity key is a secp256r1 key pair. # The ECDSA algorithm and the cc3xx boot seed requires RNG. select PSA_WANT_ALG_SHA_256 - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT select PSA_WANT_ALG_ECDSA select PSA_WANT_ECC_SECP_R1_256 select PSA_WANT_GENERATE_RANDOM diff --git a/modules/trusted-firmware-m/Kconfig.tfm.pm b/modules/trusted-firmware-m/Kconfig.tfm.pm index bb8991d71645..48a58cfada5e 100644 --- a/modules/trusted-firmware-m/Kconfig.tfm.pm +++ b/modules/trusted-firmware-m/Kconfig.tfm.pm @@ -11,18 +11,15 @@ config PM_PARTITION_SIZE_TFM_SRAM prompt "Memory reserved for TFM_RAM" if !TFM_PROFILE_TYPE_MINIMAL default 0x8000 if TFM_PROFILE_TYPE_MINIMAL default 0x18000 if SOC_SERIES_NRF91X && TFM_REGRESSION_S + # It has been observed for 54L that when Matter is enabled, then + # assigning 0x16000 of RAM to TFM will not leave enough RAM for + # Matter. So we use 0x13000 of RAM on 54L. + default 0x13000 if SOC_SERIES_NRF54LX default 0x16000 if SOC_SERIES_NRF91X default 0x30000 help Memory set aside for the TFM_SRAM partition. -config PM_PARTITION_SIZE_BL2 - hex "Memory reserved for BL2" - default 0x8000 if TFM_BL2 - default 0 - help - Memory set aside for the BL2 partition. - config PM_PARTITION_SIZE_TFM hex prompt "Memory reserved for TFM" if !TFM_PROFILE_TYPE_MINIMAL diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/CMakeLists.txt b/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/CMakeLists.txt deleted file mode 100644 index bd4fbc16e289..000000000000 --- a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/CMakeLists.txt +++ /dev/null @@ -1,86 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -#------------------------------------------------------------------------------- - -cmake_policy(SET CMP0076 NEW) -set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(OOT_PLATFORM_PATH ${PSA_ARCH_TESTS_PATH}/../trusted-firmware-m/platform/ext/target/nordic_nrf) - -set(target nrf54l15) - -add_subdirectory(${OOT_PLATFORM_PATH}/common/core nrf_common) - -#========================= Platform common defs ===============================# - -#========================= Platform Secure ====================================# - -target_include_directories(platform_s - PUBLIC - . -) - -set(mdk_system_source_file ${HAL_NORDIC_PATH}/nrfx/mdk/system_nrf54l.c) - -target_sources(platform_s PRIVATE ${mdk_system_source_file}) - -target_compile_definitions(platform_s - PUBLIC - NRF_SKIP_FICR_NS_COPY_TO_RAM - $<$:TFM_ITS_ENCRYPTED> - $<$:TFM_ITS_ENC_NONCE_LENGTH=${TFM_ITS_ENC_NONCE_LENGTH}> - $<$:TFM_ITS_AUTH_TAG_LENGTH=${TFM_ITS_AUTH_TAG_LENGTH}> -) - -#========================= Platform Non-Secure ================================# - -target_include_directories(platform_ns - PUBLIC - . -) - -target_sources(platform_ns - PRIVATE - ${mdk_system_source_file} -) - -target_compile_definitions(platform_ns - PUBLIC - # TODO: Remove this CMake code when MLT-8314 is fixed in the MDK - NRF_SKIP_GLITCHDETECTOR_DISABLE - - NRF_TRUSTZONE_NONSECURE - DOMAIN_NS=1 -) - -#========================= Platform BL2 =======================================# - -if(BL2) - target_include_directories(platform_bl2 - PRIVATE - . - ) - - target_sources(platform_bl2 - PRIVATE - ${mdk_system_source_file} - ) -endif() - -#========================= Platform region defs ===============================# - -target_compile_definitions(platform_region_defs - INTERFACE - $<$:NRF_NS_STORAGE> - $<$:NRF_NS_SECONDARY> -) - -#========================= tfm_spm ============================================# - -target_sources(tfm_spm - PRIVATE - $<$,$>:${CMAKE_CURRENT_SOURCE_DIR}/tfm_interrupts.c> -) diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/config.cmake b/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/config.cmake deleted file mode 100644 index 688cee5f2c19..000000000000 --- a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/config.cmake +++ /dev/null @@ -1,16 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -#------------------------------------------------------------------------------- - -include(${PLATFORM_PATH}/common/core/config.cmake) - -set(SECURE_UART1 ON CACHE BOOL "Enable secure UART1") -set(PSA_API_TEST_TARGET "nrf54l15" CACHE STRING "PSA API test target") -set(NRF_NS_STORAGE OFF CACHE BOOL "Enable non-secure storage partition") -set(BL2 ON CACHE BOOL "Whether to build BL2") -set(NRF_NS_SECONDARY ${BL2} CACHE BOOL "Enable non-secure secondary partition") -set(TFM_ITS_ENC_NONCE_LENGTH "12" CACHE STRING "The size of the nonce used in ITS encryption in bytes") -set(TFM_ITS_AUTH_TAG_LENGTH "16" CACHE STRING "The size of the tag used in ITS encryption in bytes") diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/mmio_defs.h b/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/mmio_defs.h deleted file mode 100644 index 790a9433afcb..000000000000 --- a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/mmio_defs.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - * - */ - -#ifndef __MMIO_DEFS_H__ -#define __MMIO_DEFS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include "tfm_peripherals_def.h" -#include "tfm_peripherals_config.h" -#include "handle_attr.h" - -/* Allowed named MMIO of this platform */ -const uintptr_t partition_named_mmio_list[] = { - /* TODO: NCSDK-22597: Populate this list */ -}; - -#ifdef __cplusplus -} -#endif - -#endif /* __MMIO_DEFS_H__ */ diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/preload.cmake b/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/preload.cmake deleted file mode 100644 index b7a3ec9c6919..000000000000 --- a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/preload.cmake +++ /dev/null @@ -1,24 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -#------------------------------------------------------------------------------- - -# preload.cmake is used to set things that related to the platform that are both -# immutable and global, which is to say they should apply to any kind of project -# that uses this platform. In practise this is normally compiler definitions and -# variables related to hardware. - -# Set architecture and CPU -set(TFM_SYSTEM_PROCESSOR cortex-m33) -set(TFM_SYSTEM_ARCHITECTURE armv8-m.main) -set(TFM_SYSTEM_DSP OFF) -set(CONFIG_TFM_FP_ARCH "fpv5-sp-d16") - -add_compile_definitions( - NRF54L15_ENGA_XXAA # Required by nrf.h - NRF_APPLICATION - # SKIP configuring the SAU from the MDK as it does not fit TF-M's needs - NRF_SKIP_SAU_CONFIGURATION -) diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_peripherals_def.h b/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_peripherals_def.h deleted file mode 100644 index 0ed143cff4df..000000000000 --- a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_peripherals_def.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - * - */ - -#ifndef __TFM_PERIPHERALS_DEF_H__ -#define __TFM_PERIPHERALS_DEF_H__ - -#ifdef __cplusplus -extern "C" { -#endif - - /* TODO: NCSDK-22597: Define peripherals */ - -#include - -#ifdef __cplusplus -} -#endif - -#endif /* __TFM_PERIPHERALS_DEF_H__ */ diff --git a/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt b/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt index c4eb589556ca..9b0a91858bcb 100644 --- a/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/CMakeLists.txt @@ -77,17 +77,35 @@ if (${TFM_PARTITION_CRYPTO}) ${CMAKE_CURRENT_LIST_DIR}/common/crypto_keys.c ) - if (${CONFIG_HW_UNIQUE_KEY}) - target_compile_definitions(platform_s PUBLIC - CONFIG_HW_UNIQUE_KEY - $<$:CONFIG_HW_UNIQUE_KEY_RANDOM>) + target_link_libraries(platform_crypto_keys + PUBLIC + platform_s + # Link with mbedcrypto_common to get Oberon PSA headers instead of + # TF-M PSA headers + mbedcrypto_common + # Link with tfm_sprt to get the include path for tfm_sp_log.h + tfm_sprt + ) - 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 - ) - endif() + if (${CONFIG_HW_UNIQUE_KEY}) + target_compile_definitions(platform_s PUBLIC + CONFIG_HW_UNIQUE_KEY + $<$:CONFIG_HW_UNIQUE_KEY_RANDOM>) + + + if((NRF_SOC_VARIANT STREQUAL nrf54l15) OR (target STREQUAL nrf54l15)) + target_sources(platform_crypto_keys + PRIVATE + ${ZEPHYR_NRF_MODULE_DIR}/lib/hw_unique_key/hw_unique_key_cracen.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 + ) + endif() + endif() if (${TFM_PARTITION_INITIAL_ATTESTATION}) target_sources(platform_s @@ -96,8 +114,6 @@ if (${TFM_PARTITION_CRYPTO}) ) endif() - target_link_libraries(platform_crypto_keys PUBLIC platform_s) - if(EXISTS platform_cc3xx) target_link_libraries(platform_s PRIVATE platform_cc3xx) endif() @@ -137,7 +153,6 @@ if (CRYPTO_STORAGE_DISABLED AND TFM_PARTITION_CRYPTO AND NOT TFM_PARTITION_INTER TFM_INTERNAL_TRUSTED_STORAGE_SERVICE_SID=0x00000070) endif() - if(BL2) message(FATAL_ERROR "BL2 is not supported") endif() @@ -180,3 +195,9 @@ endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/common DESTINATION ${INSTALL_PLATFORM_NS_DIR}) + + +if((NRF_SOC_VARIANT STREQUAL nrf54l15) OR (target 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}) +endif() diff --git a/modules/trusted-firmware-m/tfm_boards/board/RTE_Device.h b/modules/trusted-firmware-m/tfm_boards/board/RTE_Device.h index 3458cbb46567..429b6d464f80 100644 --- a/modules/trusted-firmware-m/tfm_boards/board/RTE_Device.h +++ b/modules/trusted-firmware-m/tfm_boards/board/RTE_Device.h @@ -35,7 +35,7 @@ #else /* NRF_UARTE0 */ -#define RTE_USART22 1 +#define RTE_USART20 1 #endif /* NRF_UARTE0 */ @@ -54,9 +54,14 @@ #define RTE_USART1 1 #endif +#if defined(CONFIG_TFM_SECURE_UART20) /* TODO: NCSDK-25009: Support configuring which UART instance is enabled */ -#if defined(CONFIG_TFM_SECURE_UART22) -#define RTE_USART22 1 +#error "It is not yet supported to use UART20 from a secure TF-M image" +#endif + +/* TODO: NCSDK-25009: Support configuring which UART instance is enabled */ +#if defined(CONFIG_TFM_SECURE_UART30) +#define RTE_USART30 1 #endif /* @@ -68,11 +73,15 @@ #define RTE_USART1_PINS RTE_USART_PINS(1) /* TODO: NCSDK-25009: Note that we don't use the macro like the above - * defines do because this define does not use DT + * defines do because these defines don't use DT */ -#define RTE_USART22_PINS \ +#define RTE_USART20_PINS \ { \ NRF_PSEL(UART_TX, 1, 4), NRF_PSEL(UART_RX, 1, 5), \ } +#define RTE_USART30_PINS \ + { \ + NRF_PSEL(UART_TX, 0, 0), NRF_PSEL(UART_RX, 0, 1), \ + } #endif /* __RTE_DEVICE_H */ diff --git a/modules/trusted-firmware-m/tfm_boards/board/tfm_peripherals_config.h b/modules/trusted-firmware-m/tfm_boards/board/tfm_peripherals_config.h index 80a7f37ea55e..a3409bb41d49 100644 --- a/modules/trusted-firmware-m/tfm_boards/board/tfm_peripherals_config.h +++ b/modules/trusted-firmware-m/tfm_boards/board/tfm_peripherals_config.h @@ -70,7 +70,7 @@ extern "C" { #define TFM_PERIPHERAL_UARTE3_SECURE CONFIG_NRF_UARTE3_SECURE -#define TFM_PERIPHERAL_UARTE22_SECURE CONFIG_NRF_UARTE22_SECURE +#define TFM_PERIPHERAL_UARTE30_SECURE CONFIG_NRF_UARTE30_SECURE #define TFM_PERIPHERAL_SAADC_SECURE CONFIG_NRF_SAADC_SECURE 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 1f979143ef00..d54fed266b70 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 @@ -36,8 +36,8 @@ static enum tfm_hal_status_t crypto_platform_init(void) { int err = 0; -#ifdef CONFIG_HAS_HW_NRF_CC3XX +#ifdef CONFIG_HAS_HW_NRF_CC3XX /* Initialize the nrf_cc3xx runtime */ #if !CRYPTO_RNG_MODULE_ENABLED err = nrf_cc3xx_platform_init_no_rng(); @@ -65,7 +65,7 @@ static enum tfm_hal_status_t crypto_platform_init(void) SPMLOG_INFMSG("Success\r\n"); } #endif /* CONFIG_HW_UNIQUE_KEY_RANDOM */ - + (void)err; return TFM_HAL_SUCCESS; } #endif /* defined(TFM_PARTITION_CRYPTO) */ 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 539829c1d4a4..826642489d3a 100644 --- a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/CMakeLists.txt @@ -1,14 +1,26 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2023, Nordic Semiconductor ASA. +# +# Copyright (c) 2021, Nordic Semiconductor ASA. # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -#------------------------------------------------------------------------------- set(NRF_BOARD_SELECTED True) -set(OOT_PLATFORM_PATH ${NRF_DIR}/modules/trusted-firmware-m/platform/ext/target/nordic_nrf) - -add_subdirectory(${OOT_PLATFORM_PATH}/common/nrf54l15 nrf54l15) +add_subdirectory(${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/common/nrf54l15 nrf54l15) add_subdirectory(.. tfm_board) + + +install(FILES ${CMAKE_CURRENT_LIST_DIR}/ns/cpuarch_ns.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR} + RENAME cpuarch.cmake) + +install(FILES config.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR}) + +install(FILES ../common/config.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR}/../common/) + +install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf54l15dk_nrf54l15_cpuapp/tests + DESTINATION ${INSTALL_PLATFORM_NS_DIR} +) diff --git a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/config.cmake b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/config.cmake index 80f736cc248a..f63893e5df94 100644 --- a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/config.cmake +++ b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/config.cmake @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# Copyright (c) 2023, Nordic Semiconductor ASA. +# Copyright (c) 2024, Nordic Semiconductor ASA. # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # @@ -7,10 +7,9 @@ include(${CMAKE_CURRENT_LIST_DIR}/../common/config.cmake) -set(OOT_PLATFORM_PATH ${NRF_DIR}/modules/trusted-firmware-m/platform/ext/target/nordic_nrf) -set(PLATFORM_PATH platform/ext/target/nordic_nrf) +set(NRF_SOC_VARIANT nrf54l15 CACHE STRING "nRF SoC Variant") -include(${OOT_PLATFORM_PATH}/common/nrf54l15/config.cmake) +include(${PLATFORM_PATH}/common/${NRF_SOC_VARIANT}/config.cmake) -# Override the AEAD algorithm configuration -set(PS_CRYPTO_AEAD_ALG PSA_ALG_GCM CACHE STRING "The AEAD algorithm to use for authenticated encryption in Protected Storage") +# Override PS_CRYPTO_KDF_ALG +set(PS_CRYPTO_KDF_ALG PSA_ALG_SP800_108_COUNTER_CMAC CACHE STRING "KDF Algorithm to use") diff --git a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/cpuarch.cmake b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/cpuarch.cmake new file mode 100644 index 000000000000..6ae70dc698c8 --- /dev/null +++ b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/cpuarch.cmake @@ -0,0 +1,10 @@ +# +# Copyright (c) 2021, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(PLATFORM_PATH platform/ext/target/nordic_nrf) + +include(${PLATFORM_PATH}/common/nrf54l15/cpuarch.cmake) +add_compile_definitions(__NRF_TFM__) diff --git a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/ns/cpuarch_ns.cmake b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/ns/cpuarch_ns.cmake new file mode 100644 index 000000000000..6bec447213d9 --- /dev/null +++ b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/ns/cpuarch_ns.cmake @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024, Nordic Semiconductor ASA. +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR}) +set(PLATFORM_PATH ${CMAKE_CURRENT_LIST_DIR}) + +include(${CMAKE_CURRENT_LIST_DIR}/common/nrf54l15/cpuarch.cmake) diff --git a/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_interrupts.c b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_interrupts.c similarity index 100% rename from modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_interrupts.c rename to modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/platform/ext/target/nordic_nrf/common/nrf54l15/tfm_interrupts.c diff --git a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/preload.cmake b/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/preload.cmake deleted file mode 100644 index 725c0da9bf5b..000000000000 --- a/modules/trusted-firmware-m/tfm_boards/nrf54l15_cpuapp/preload.cmake +++ /dev/null @@ -1,14 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2023, Nordic Semiconductor ASA. -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# -#------------------------------------------------------------------------------- - -# preload.cmake is used to set things that related to the platform that are both -# immutable and global, which is to say they should apply to any kind of project -# that uses this platform. In practice this is normally compiler definitions and -# variables related to hardware. - -include(${NRF_DIR}/modules/trusted-firmware-m/platform/ext/target/nordic_nrf/common/nrf54l15/preload.cmake) -add_compile_definitions(__NRF_TFM__) diff --git a/modules/trusted-firmware-m/tfm_boards/nrf9120/CMakeLists.txt b/modules/trusted-firmware-m/tfm_boards/nrf9120/CMakeLists.txt index 71ffdb6ea597..069303984a42 100644 --- a/modules/trusted-firmware-m/tfm_boards/nrf9120/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/nrf9120/CMakeLists.txt @@ -19,6 +19,9 @@ install(FILES ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordi DESTINATION ${INSTALL_PLATFORM_NS_DIR}/common/nrf9120) install(FILES config.cmake + DESTINATION ${INSTALL_PLATFORM_NS_DIR}) + +install(FILES ../common/config.cmake DESTINATION ${INSTALL_PLATFORM_NS_DIR}/../common/) install(DIRECTORY ${Trusted\ Firmware\ M_SOURCE_DIR}/platform/ext/target/nordic_nrf/nrf9161dk_nrf9161/tests diff --git a/modules/trusted-firmware-m/tfm_boards/ns/CMakeLists.txt b/modules/trusted-firmware-m/tfm_boards/ns/CMakeLists.txt index 951aa5896814..b794e386c151 100644 --- a/modules/trusted-firmware-m/tfm_boards/ns/CMakeLists.txt +++ b/modules/trusted-firmware-m/tfm_boards/ns/CMakeLists.txt @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # - cmake_policy(SET CMP0076 NEW) set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}) set(NRF_BOARD_SELECTED True) diff --git a/modules/trusted-firmware-m/tfm_boards/partition/flash_layout.h b/modules/trusted-firmware-m/tfm_boards/partition/flash_layout.h index 36a3ef982e73..a0ad53009780 100644 --- a/modules/trusted-firmware-m/tfm_boards/partition/flash_layout.h +++ b/modules/trusted-firmware-m/tfm_boards/partition/flash_layout.h @@ -41,9 +41,6 @@ */ #define FLASH_TOTAL_SIZE (CONFIG_FLASH_SIZE * 1024) -/* Flash layout info for BL2 bootloader */ -#define FLASH_BASE_ADDRESS (0x00000000) - #if !defined(MCUBOOT_IMAGE_NUMBER) || (MCUBOOT_IMAGE_NUMBER == 1) /* Secure image primary slot */ #define FLASH_AREA_0_ID (1) @@ -104,7 +101,7 @@ #define NON_SECURE_IMAGE_OFFSET (SECURE_IMAGE_OFFSET + SECURE_IMAGE_MAX_SIZE) #define NON_SECURE_IMAGE_MAX_SIZE FLASH_NS_PARTITION_SIZE -/* Flash device name used by BL2 +/* * Name is defined in flash driver file: Driver_Flash.c */ #define FLASH_DEV_NAME Driver_FLASH0 diff --git a/modules/trusted-firmware-m/tfm_boards/partition/region_defs.h b/modules/trusted-firmware-m/tfm_boards/partition/region_defs.h index 4e2b2c7b143e..ecca2202bc19 100644 --- a/modules/trusted-firmware-m/tfm_boards/partition/region_defs.h +++ b/modules/trusted-firmware-m/tfm_boards/partition/region_defs.h @@ -9,9 +9,6 @@ #include "flash_layout.h" -#define BL2_HEAP_SIZE (0x00001000) -#define BL2_MSP_STACK_SIZE (0x00001800) - #ifdef ENABLE_HEAP #define S_HEAP_SIZE (0x00001000) #endif @@ -105,17 +102,6 @@ #define NRF_NS_STORAGE_PARTITION_SIZE (PM_NONSECURE_STORAGE_SIZE) #endif -#ifdef BL2 -/* Bootloader regions */ -#define BL2_CODE_START (FLASH_AREA_BL2_OFFSET) -#define BL2_CODE_SIZE (FLASH_AREA_BL2_SIZE) -#define BL2_CODE_LIMIT (BL2_CODE_START + BL2_CODE_SIZE - 1) - -#define BL2_DATA_START (PM_TFM_SRAM_ADDRESS) -#define BL2_DATA_SIZE (PM_TFM_SRAM_SIZE) -#define BL2_DATA_LIMIT (BL2_DATA_START + BL2_DATA_SIZE - 1) -#endif /* BL2 */ - /* Shared data area between bootloader and runtime firmware. * Shared data area is allocated at the beginning of the RAM, it is overlapping * with TF-M Secure code's MSP stack diff --git a/modules/trusted-firmware-m/tfm_boards/services/include/tfm_read_ranges.h b/modules/trusted-firmware-m/tfm_boards/services/include/tfm_read_ranges.h index 5d1b5a4c03ab..a11c412a358a 100644 --- a/modules/trusted-firmware-m/tfm_boards/services/include/tfm_read_ranges.h +++ b/modules/trusted-firmware-m/tfm_boards/services/include/tfm_read_ranges.h @@ -46,6 +46,11 @@ #endif /* NRF_FICR_S_BASE */ +#ifdef NRF_APPLICATION_CPUC_S_BASE +#define CPUC_CPUID_ADDR (NRF_APPLICATION_CPUC_S_BASE + offsetof(NRF_CPUC_Type, CPUID)) +#define CPUC_CPUID_SIZE (sizeof(uint32_t)) +#endif /* NRF_APPLICATION_CPUC_S_BASE */ + static const struct tfm_read_service_range ranges[] = { #ifdef PM_MCUBOOT_ADDRESS /* Allow reads of mcuboot metadata */ @@ -66,6 +71,9 @@ static const struct tfm_read_service_range ranges[] = { #if defined(FICR_SIPINFO_ADDR) {.start = FICR_SIPINFO_ADDR, .size = FICR_SIPINFO_SIZE}, #endif +#if defined(NRF_APPLICATION_CPUC_S) + {.start = CPUC_CPUID_ADDR, .size = CPUC_CPUID_SIZE}, +#endif }; #endif /* TFM_READ_RANGES_H__ */ diff --git a/modules/trusted-firmware-m/tfm_config.h.in b/modules/trusted-firmware-m/tfm_config.h.in index 770a2480cd5c..28c3314dbc95 100644 --- a/modules/trusted-firmware-m/tfm_config.h.in +++ b/modules/trusted-firmware-m/tfm_config.h.in @@ -51,6 +51,9 @@ /* Enable PSA Crypto Cipher module */ #cmakedefine01 CRYPTO_CIPHER_MODULE_ENABLED +/* Enable PSA Crypto PAKE module */ +#cmakedefine01 CRYPTO_PAKE_MODULE_ENABLED + /* Enable PSA Crypto asymmetric key signature module */ #cmakedefine01 CRYPTO_ASYM_SIGN_MODULE_ENABLED diff --git a/samples/app_event_manager/sample.yaml b/samples/app_event_manager/sample.yaml index 390215b1dba4..3684f3cdddd4 100644 --- a/samples/app_event_manager/sample.yaml +++ b/samples/app_event_manager/sample.yaml @@ -17,38 +17,38 @@ tests: build_only: false platform_allow: - qemu_cortex_m3 - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 integration_platforms: - qemu_cortex_m3 - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 sample.app_event_manager_shell: build_only: false platform_allow: - qemu_cortex_m3 - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 integration_platforms: - qemu_cortex_m3 - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 extra_configs: - CONFIG_SHELL=y platform_exclude: native_posix diff --git a/samples/app_event_manager_profiler_tracer/sample.yaml b/samples/app_event_manager_profiler_tracer/sample.yaml index 6db6067337a9..b6bd05fa08bc 100644 --- a/samples/app_event_manager_profiler_tracer/sample.yaml +++ b/samples/app_event_manager_profiler_tracer/sample.yaml @@ -6,13 +6,13 @@ tests: build_only: true platform_exclude: native_posix platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 tags: ci_build diff --git a/samples/benchmarks/coremark/CMakeLists.txt b/samples/benchmarks/coremark/CMakeLists.txt new file mode 100644 index 000000000000..6906474e773a --- /dev/null +++ b/samples/benchmarks/coremark/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# 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(coremark) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/benchmarks/coremark/Kconfig b/samples/benchmarks/coremark/Kconfig new file mode 100644 index 000000000000..039a2ca48396 --- /dev/null +++ b/samples/benchmarks/coremark/Kconfig @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "CoreMark sample" + +config APP_MODE_FLASH_AND_RUN + bool "Run CoreMark benchmark on start up" + default y if SOC_NRF54H20_CPUPPR + help + If enabled, CoreMark will start execution immediately after CPU start up. + It also disables LEDs and buttons. + Otherwise, it will wait button to be pressed. + +endmenu + +menu "Zephyr Kernel" + source "Kconfig.zephyr" +endmenu diff --git a/samples/benchmarks/coremark/Kconfig.sysbuild b/samples/benchmarks/coremark/Kconfig.sysbuild new file mode 100644 index 000000000000..e93b67a4b383 --- /dev/null +++ b/samples/benchmarks/coremark/Kconfig.sysbuild @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +rsource "boards/Kconfig.sysbuild_boards" +source "share/sysbuild/Kconfig" + +config IMAGE_2_BOARD + string + default "" + +config IMAGE_3_BOARD + string + default "" diff --git a/samples/benchmarks/coremark/README.rst b/samples/benchmarks/coremark/README.rst new file mode 100644 index 000000000000..9f29ea335637 --- /dev/null +++ b/samples/benchmarks/coremark/README.rst @@ -0,0 +1,183 @@ +.. _coremark_sample: + +CoreMark +######## + +.. contents:: + :local: + :depth: 2 + +The sample demonstrates how to run the `CoreMark®`_ benchmark to evaluate the performance of a core. +To get started with CoreMark integration in |NCS|, see :ref:`ug_coremark`. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +Overview +******** + +The sample runs the CoreMark benchmark on the target CPU. +CoreMark evaluates the CPU efficiency by performing different algorithms, such as state machine, CRC calculation, matrix manipulation, and list processing (find and sort). + +To run the CoreMark benchmark on the preferred core, press the corresponding button. +For the button assignment, see the :ref:`coremark_user_interface` section. +When the benchmark has completed, you can press the same button to restart it. +If you want to run the sample upon startup, enable the :ref:`CONFIG_APP_MODE_FLASH_AND_RUN ` Kconfig option. + +.. _coremark_user_interface: + +User interface +************** + +Each target CPU has an assigned button responsible for starting the benchmark and LED that indicates the ``test in progress`` state: + +Button 1: + Start the benchmark run on the application core. + +Button 2: + Start the benchmark run on the network or radio core. + +Button 3: + Start the benchmark run on the PPR core. + +LED 1: + Indicates ``test in progress`` on the application core. + +LED 2: + Indicates ``test in progress`` on the network or radio core. + +LED 3: + Indicates ``test in progress`` on the PPR core. + +.. _coremark_configuration: + +Configuration +************* + +|config| + +CoreMark runs tests multiple times. +You can define the number of iterations using the :kconfig:option:`CONFIG_COREMARK_ITERATIONS` Kconfig option. +By default, the iteration quantity is set to the minimum time required for valid results, which is 10 seconds. + +Additional configuration +======================== + +Check and configure the following configuration options that are used by the sample: + +Run types and data sizes +------------------------ + +CoreMark has the following predefined run types and data sizes that are used for data algorithms: + +* The :kconfig:option:`CONFIG_COREMARK_RUN_TYPE_PERFORMANCE` Kconfig option - Sets :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` to 2000 bytes. +* The :kconfig:option:`CONFIG_COREMARK_RUN_TYPE_PROFILE` Kconfig option - Sets :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` to 1200 bytes. +* The :kconfig:option:`CONFIG_COREMARK_RUN_TYPE_VALIDATION` Kconfig option - Sets :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` to 500 bytes. + +You can also specify a custom :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` value and submit your results by following the rules from the `CoreMark GitHub`_ repository. +Make sure that when setting the :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` Kconfig option the required memory space is available. + +Memory allocation methods +------------------------- + +You can select the following memory allocation methods: + +* The :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_STACK` Kconfig option uses the main thread stack for data allocation and is enabled by default. + You can change the main stack size by setting the :kconfig:option:`CONFIG_MAIN_STACK_SIZE` Kconfig option. +* The :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_MALLOC` Kconfig option uses Zephyr :c:func:`k_malloc` or :c:func:`k_free` functions to allocate the memory in the heap. + You can adjust the heap size using the :kconfig:option:`CONFIG_HEAP_MEM_POOL_SIZE` Kconfig option. +* The :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_STATIC` option allows data allocation in the RAM as a regular static variable. + In this case, you do not need to be aware of the main thread stack size or heap memory pool size. + +Multithread mode +---------------- + +CoreMark can also be executed in multithread mode. +To specify a number of threads, use the :kconfig:option:`CONFIG_COREMARK_THREADS_NUMBER` Kconfig option. +In multithread mode, CoreMark is executed in all threads simultaneously. +Each thread runs number of iterations equal to :kconfig:option:`CONFIG_COREMARK_ITERATIONS`. +By default, the :kconfig:option:`CONFIG_TIMESLICE_SIZE` Kconfig option is set to 10 ms, which imitates RTOS multithread usage. +However, in the final report, the thread execution is combined. +In the multithread mode, the :kconfig:option:`CONFIG_COREMARK_DATA_SIZE` Kconfig option is allocated for each thread separately. +Only the :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_STACK` and :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_MALLOC` memory methods can be used with multiple threads. +In case of the :kconfig:option:`CONFIG_COREMARK_MEMORY_METHOD_STACK` Kconfig option, the data for all threads is allocated to the main thread stack. + +Configuration options +===================== + +Check and configure the following Kconfig options: + +.. _CONFIG_APP_MODE_FLASH_AND_RUN: + +CONFIG_APP_MODE_FLASH_AND_RUN - Start CoreMark sample automatically after flashing + If enabled, CoreMark starts execution immediately after the CPU starts up. + It also disables LEDs and buttons. + Otherwise, it will wait for the button to be pressed. + +.. _SB_CONFIG_APP_CPUNET_RUN: + +SB_CONFIG_APP_CPUNET_RUN - Enable execution for the network core + Enable the benchmark execution also for the network core for targets with the nRF53 Series SoCs. + +Building and running +******************** + +When running the benchmark, an extra build flag (:kconfig:option:`CONFIG_COMPILER_OPT`) is set to ``-O3`` to achieve the best CoreMark results. + +.. |sample path| replace:: :file:`samples/benchmarks/coremark` + +.. include:: /includes/build_and_run_sb.txt + +After flashing, messages describing the benchmark state will appear in the console. + +Testing +======= + +After programming the sample to your development kit, complete the following steps to test it: + +1. |connect_terminal| +#. Reset your development kit. +#. To start the test, press the button assigned to the respective core. + For button assignment, refer to the :ref:`coremark_user_interface` section. + + All target cores work independently from each other, and it is possible to run the benchmark on several cores simultaneously. + Measurements running on a core are indicated by the corresponding LED. + If the :ref:`CONFIG_APP_MODE_FLASH_AND_RUN ` Kconfig option is enabled, the measurement will launch automatically on all available cores when starting the application. + In :ref:`CONFIG_APP_MODE_FLASH_AND_RUN ` mode LEDs and buttons are not used. + +#. Wait for all measurements to complete. + By default, the test takes approximately 11-13 seconds. +#. Wait for the console output for all tested cores. + The results will be similar to the following example: + + .. code-block:: console + + *** Booting Zephyr OS build bf606fc00ec1 *** + [00:00:00.502,166] app: Coremark sample for nrf52dk/nrf52832. Call address: 00007fa1 + [00:00:00.502,197] app: Press Push button switch 0 to start the test ... + [00:00:14.483,764] app: Push button switch 0 pressed! + [00:00:14.511,627] app: Coremark started! + [00:00:14.511,627] app: CPU FREQ: 64000000 Hz + [00:00:14.511,627] app: (threads: 1, data size: 2000; iterations: 2000) + + 2K performance run parameters for coremark. + CoreMark Size : 666 + Total ticks : 401312 + Total time (secs): 12.247070 + Iterations/Sec : 163.304366 + Iterations : 2000 + Compiler version : GCC10.3.0 + Compiler flags : -O3 + see compiler flags added by Zephyr + Memory location : STACK + seedcrc : 0xe9f5 + [0]crclist : 0xe714 + [0]crcmatrix : 0x1fd7 + [0]crcstate : 0x8e3a + [0]crcfinal : 0x4983 + Correct operation validated. See README.md for run and reporting rules. + CoreMark 1.0 : 163.304366 / GCC10.3.0 -O3 + see compiler flags added by Zephyr / STACK + [00:00:27.759,582] app: Coremark finished! Press Push button switch 0 to restart ... diff --git a/samples/benchmarks/coremark/app.overlay b/samples/benchmarks/coremark/app.overlay new file mode 100644 index 000000000000..6c1d3ebfade9 --- /dev/null +++ b/samples/benchmarks/coremark/app.overlay @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "boards/app_aliases_common.overlay" diff --git a/samples/benchmarks/coremark/boards/Kconfig.sysbuild_boards b/samples/benchmarks/coremark/boards/Kconfig.sysbuild_boards new file mode 100644 index 000000000000..c1c89e0f4d35 --- /dev/null +++ b/samples/benchmarks/coremark/boards/Kconfig.sysbuild_boards @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if BOARD_NRF5340DK_NRF5340_CPUAPP + +config APP_CPUNET_RUN + bool "Run the CoreMark benchmark on the nRF5340 Network Core" + default y + +config IMAGE_2_BOARD + default "nrf5340dk/nrf5340/cpunet" if APP_CPUNET_RUN + +endif diff --git a/samples/benchmarks/coremark/boards/app_aliases_common.overlay b/samples/benchmarks/coremark/boards/app_aliases_common.overlay new file mode 100644 index 000000000000..2b38ec87197e --- /dev/null +++ b/samples/benchmarks/coremark/boards/app_aliases_common.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + aliases { + button = &button0; + led = &led0; + }; + }; diff --git a/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..4e6c4aef68f7 --- /dev/null +++ b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +CONFIG_BOARD_ENABLE_CPUNET=y diff --git a/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000000..d63a8a55116d --- /dev/null +++ b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + #include "app_aliases_common.overlay" + +/ { + gpio_fwd: nrf-gpio-forwarder { + compatible = "nordic,nrf-gpio-forwarder"; + status = "okay"; + button_1 { + gpios = < &gpio0 0x18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW) >; + }; + led_1 { + gpios = < &gpio0 0x1d GPIO_ACTIVE_LOW >; + }; + }; +}; diff --git a/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpunet.overlay new file mode 100644 index 000000000000..c40d1412e3b5 --- /dev/null +++ b/samples/benchmarks/coremark/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + aliases { + button = &button1; + led = &led1; + }; + }; diff --git a/samples/benchmarks/coremark/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/benchmarks/coremark/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..304e69ba4645 --- /dev/null +++ b/samples/benchmarks/coremark/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +CONFIG_COREMARK_ITERATIONS=4000 diff --git a/samples/benchmarks/coremark/prj.conf b/samples/benchmarks/coremark/prj.conf new file mode 100644 index 000000000000..fc5721cb5493 --- /dev/null +++ b/samples/benchmarks/coremark/prj.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Common coremark configuration +CONFIG_COREMARK=y + +# Increse if number of threads increases. +CONFIG_MAIN_STACK_SIZE=4096 + +# Compiler options +CONFIG_COMPILER_OPT="-O3" + +# Config results output +CONFIG_LOG=y +CONFIG_PRINTK=y +CONFIG_CBPRINTF_FP_SUPPORT=y +CONFIG_CONSOLE=y + +CONFIG_GPIO=y + +CONFIG_MAIN_THREAD_PRIORITY=-1 diff --git a/samples/benchmarks/coremark/prj_heap_memory.conf b/samples/benchmarks/coremark/prj_heap_memory.conf new file mode 100644 index 000000000000..58f90d67fec2 --- /dev/null +++ b/samples/benchmarks/coremark/prj_heap_memory.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Choose memory method. +CONFIG_COREMARK_MEMORY_METHOD_MALLOC=y + +# Choose proper memory size based on memory method selected above. +# Increse if number of threads increases. +CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/benchmarks/coremark/prj_multiple_threads.conf b/samples/benchmarks/coremark/prj_multiple_threads.conf new file mode 100644 index 000000000000..fa6af1debbf2 --- /dev/null +++ b/samples/benchmarks/coremark/prj_multiple_threads.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Multiple thread execution. +CONFIG_COREMARK_THREADS_NUMBER=4 + +# Increse if number of threads increases. +CONFIG_TIMESLICE_SIZE=10 +CONFIG_MAIN_STACK_SIZE=14240 diff --git a/samples/benchmarks/coremark/prj_static_memory.conf b/samples/benchmarks/coremark/prj_static_memory.conf new file mode 100644 index 000000000000..83b3f0bf3701 --- /dev/null +++ b/samples/benchmarks/coremark/prj_static_memory.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +# Choose memory method +# Supported only for single thread. No stack or heap required +CONFIG_COREMARK_MEMORY_METHOD_STATIC=y diff --git a/samples/benchmarks/coremark/sample.yaml b/samples/benchmarks/coremark/sample.yaml new file mode 100644 index 000000000000..61d5a7f0e834 --- /dev/null +++ b/samples/benchmarks/coremark/sample.yaml @@ -0,0 +1,71 @@ +sample: + name: CoreMark Benchmark + description: CoreMark sample for the CPU performance evaluation. + Sample runs the CoreMark benchmark that measures the CPU efficiency + performing different algorithms like state machine, CRC calculation, + matrix manipulation and list processing (find and sort). +tests: + sample.benchmark.coremark: + sysbuild: true + build_only: false + platform_allow: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + tags: ci_build + harness: console + harness_config: + ordered: false + regex: + - "CoreMark started!" + - "Correct operation validated." + type: multi_line + extra_args: CONFIG_APP_MODE_FLASH_AND_RUN=y + sample.benchmark.coremark_heap_nrf53: + sysbuild: true + build_only: true + platform_allow: + - nrf5340dk/nrf5340/cpuapp + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + tags: ci_build + extra_args: EXTRA_CONF_FILE="prj_heap_memory.conf" + coremark_image_2_board_EXTRA_CONF_FILE="prj_heap_memory.conf" + sample.benchmark.coremark_static: + sysbuild: true + build_only: true + platform_allow: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + tags: ci_build + extra_args: EXTRA_CONF_FILE="prj_static_memory.conf" + sample.benchmark.coremark_multithread: + sysbuild: true + build_only: true + platform_allow: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + tags: ci_build + extra_args: EXTRA_CONF_FILE="prj_multiple_threads.conf" diff --git a/samples/benchmarks/coremark/src/main.c b/samples/benchmarks/coremark/src/main.c new file mode 100644 index 000000000000..108a07392b8e --- /dev/null +++ b/samples/benchmarks/coremark/src/main.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include "coremark_zephyr.h" + +LOG_MODULE_REGISTER(app, LOG_LEVEL_INF); + +#ifndef CONFIG_APP_MODE_FLASH_AND_RUN +/* + * Get button configuration from the devicetree. This is mandatory. + */ +#define BUTTON_NODE DT_ALIAS(button) +#define LED_NODE DT_ALIAS(led) + +#if !DT_NODE_HAS_STATUS(BUTTON_NODE, okay) + #error "Unsupported board: /"button/" alias is not defined." +#endif + +#if !DT_NODE_HAS_STATUS(LED_NODE, okay) + #error "Unsupported board: /"led/" alias is not defined." +#endif + +#define BUTTON_LABEL DT_PROP(DT_ALIAS(button), label) +#define LED_ON() (void)gpio_pin_set_dt(&status_led, 1) +#define LED_OFF() (void)gpio_pin_set_dt(&status_led, 0) + +static const struct gpio_dt_spec start_button = GPIO_DT_SPEC_GET(BUTTON_NODE, gpios); +static const struct gpio_dt_spec status_led = GPIO_DT_SPEC_GET(LED_NODE, gpios); + +#else + +#define BUTTON_LABEL "Reset" +#define LED_ON() +#define LED_OFF() + +static const struct gpio_dt_spec start_button; +static const struct gpio_dt_spec status_led; + +#endif + +static K_SEM_DEFINE(start_coremark, 0, 1); +static atomic_t coremark_in_progress; + +static void flush_log(void) +{ + if (IS_ENABLED(CONFIG_LOG_PROCESS_THREAD)) { + while (log_data_pending()) { + k_sleep(K_MSEC(10)); + } + k_sleep(K_MSEC(10)); + } else { + while (LOG_PROCESS()) { + } + } +} + +static void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins) +{ + if (gpio_pin_get_dt(&start_button) && atomic_cas(&coremark_in_progress, false, true)) { + LOG_INF("%s pressed!", BUTTON_LABEL); + k_sem_give(&start_coremark); + } +} + +static int led_init(void) +{ + int ret; + + if (!device_is_ready(status_led.port)) { + LOG_ERR("Error: led device %s is not ready", + status_led.port->name); + return -ENODEV; + } + + ret = gpio_pin_configure_dt(&status_led, GPIO_OUTPUT); + if (ret != 0) { + LOG_ERR("Error %d: failed to configure %s pin %d", + ret, status_led.port->name, status_led.pin); + return ret; + } + + LED_OFF(); + + return ret; +} + +static int button_init(void) +{ + int ret; + static struct gpio_callback button_cb_data; + + if (!device_is_ready(start_button.port)) { + LOG_ERR("Error: button1 device %s is not ready", + start_button.port->name); + return -ENODEV; + } + + ret = gpio_pin_configure_dt(&start_button, GPIO_INPUT); + if (ret != 0) { + LOG_ERR("Error %d: failed to configure %s pin %d", + ret, start_button.port->name, start_button.pin); + return ret; + } + + ret = gpio_pin_interrupt_configure_dt(&start_button, GPIO_INT_EDGE_TO_ACTIVE); + if (ret != 0) { + LOG_ERR("Error %d: failed to configure interrupt on %s pin %d", + ret, start_button.port->name, start_button.pin); + return ret; + } + + (void) gpio_init_callback(&button_cb_data, button_pressed, BIT(start_button.pin)); + (void) gpio_add_callback(start_button.port, &button_cb_data); + + return ret; +} + +int main(void) +{ + LOG_INF("CoreMark sample for %s", CONFIG_BOARD_TARGET); + + if (IS_ENABLED(CONFIG_APP_MODE_FLASH_AND_RUN)) { + (void)atomic_set(&coremark_in_progress, true); + k_sem_give(&start_coremark); + } else if (!IS_ENABLED(CONFIG_APP_MODE_FLASH_AND_RUN)) { + if (led_init()) { + k_panic(); + } + if (button_init()) { + k_panic(); + } + + LOG_INF("Press %s to start the test ...", BUTTON_LABEL); + } + + while (true) { + k_sem_take(&start_coremark, K_FOREVER); + LOG_INF("CoreMark started!"); + LOG_INF("CPU FREQ: %d Hz", SystemCoreClock); + LOG_INF("(threads: %d, data size: %d; iterations: %d)\n", + CONFIG_COREMARK_THREADS_NUMBER, + CONFIG_COREMARK_DATA_SIZE, + CONFIG_COREMARK_ITERATIONS); + flush_log(); + + LED_ON(); + coremark_run(); + LED_OFF(); + + if (!IS_ENABLED(CONFIG_APP_MODE_FLASH_AND_RUN)) { + LOG_INF("CoreMark finished! Push %s to restart ...\n", BUTTON_LABEL); + } + + (void)atomic_set(&coremark_in_progress, false); + }; + + return 0; +} diff --git a/samples/benchmarks/coremark/sysbuild.cmake b/samples/benchmarks/coremark/sysbuild.cmake new file mode 100644 index 000000000000..3df761ff472c --- /dev/null +++ b/samples/benchmarks/coremark/sysbuild.cmake @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +include_guard(GLOBAL) + +if(NOT SB_CONFIG_IMAGE_2_BOARD STREQUAL "") + + ExternalZephyrProject_Add( + APPLICATION coremark_image_2_board + SOURCE_DIR ${APP_DIR} + BOARD ${SB_CONFIG_IMAGE_2_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + +endif() + +if(NOT SB_CONFIG_IMAGE_3_BOARD STREQUAL "") + + ExternalZephyrProject_Add( + APPLICATION coremark_image_3_board + SOURCE_DIR ${APP_DIR} + BOARD ${SB_CONFIG_IMAGE_3_BOARD} + BOARD_REVISION ${BOARD_REVISION} + ) + +endif() diff --git a/samples/benchmarks/coremark/sysbuild.conf b/samples/benchmarks/coremark/sysbuild.conf new file mode 100644 index 000000000000..c29fadfa286c --- /dev/null +++ b/samples/benchmarks/coremark/sysbuild.conf @@ -0,0 +1,6 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +SB_CONFIG_PARTITION_MANAGER=n diff --git a/samples/bluetooth/central_and_peripheral_hr/sample.yaml b/samples/bluetooth/central_and_peripheral_hr/sample.yaml index f65b0adce10c..a70c13332420 100644 --- a/samples/bluetooth/central_and_peripheral_hr/sample.yaml +++ b/samples/bluetooth/central_and_peripheral_hr/sample.yaml @@ -5,10 +5,14 @@ tests: sample.bluetooth.central_and_peripheral_hr.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_bas/sample.yaml b/samples/bluetooth/central_bas/sample.yaml index de27c9e4d625..46dcb9c159a8 100644 --- a/samples/bluetooth/central_bas/sample.yaml +++ b/samples/bluetooth/central_bas/sample.yaml @@ -5,17 +5,18 @@ tests: sample.bluetooth.central_bas: harness: bluetooth integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth sample.bluetooth.central_bas.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_hids/prj.conf b/samples/bluetooth/central_hids/prj.conf index c85e49dba7e1..0274a0109bd9 100644 --- a/samples/bluetooth/central_hids/prj.conf +++ b/samples/bluetooth/central_hids/prj.conf @@ -9,7 +9,7 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_CENTRAL=y CONFIG_BT_SMP=y -CONFIG_BT_L2CAP_TX_BUF_COUNT=5 +CONFIG_BT_ATT_TX_COUNT=5 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_GATT_DM=y CONFIG_HEAP_MEM_POOL_SIZE=2048 diff --git a/samples/bluetooth/central_hids/sample.yaml b/samples/bluetooth/central_hids/sample.yaml index 867fbc17232b..b5a3728f4adc 100644 --- a/samples/bluetooth/central_hids/sample.yaml +++ b/samples/bluetooth/central_hids/sample.yaml @@ -5,17 +5,21 @@ tests: sample.bluetooth.central_hids: harness: bluetooth integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth sample.bluetooth.central_hids.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/central_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf index 7e79cf219a28..9462273685ad 100644 --- a/samples/bluetooth/central_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/central_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -4,5 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +# Application core does not have BLE controller. Disable controller related options. CONFIG_BT_CTLR_ADV_EXT=n CONFIG_BT_CTLR_PHY_CODED=n diff --git a/samples/bluetooth/central_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/central_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..680413f53d81 --- /dev/null +++ b/samples/bluetooth/central_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Application core does not have BLE controller. Disable controller related options. +CONFIG_BT_CTLR_ADV_EXT=n +CONFIG_BT_CTLR_PHY_CODED=n diff --git a/samples/bluetooth/central_hr_coded/sample.yaml b/samples/bluetooth/central_hr_coded/sample.yaml index 222fc0ebe2f5..26027444b79c 100644 --- a/samples/bluetooth/central_hr_coded/sample.yaml +++ b/samples/bluetooth/central_hr_coded/sample.yaml @@ -6,7 +6,8 @@ tests: sample.bluetooth.central_hr_coded: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_nfc_pairing/sample.yaml b/samples/bluetooth/central_nfc_pairing/sample.yaml index 4038e1f43679..7c07c9029456 100644 --- a/samples/bluetooth/central_nfc_pairing/sample.yaml +++ b/samples/bluetooth/central_nfc_pairing/sample.yaml @@ -5,8 +5,8 @@ tests: sample.bluetooth.central_nfc_pairing: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_smp_client/sample.yaml b/samples/bluetooth/central_smp_client/sample.yaml index 41fb82ff8e12..a64a98e0aadf 100644 --- a/samples/bluetooth/central_smp_client/sample.yaml +++ b/samples/bluetooth/central_smp_client/sample.yaml @@ -5,17 +5,17 @@ tests: sample.bluetooth.central_dfu_smp: harness: bluetooth integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth sample.bluetooth.central_dfu_smp.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns tags: bluetooth ci_build diff --git a/samples/bluetooth/central_uart/CMakeLists.txt b/samples/bluetooth/central_uart/CMakeLists.txt index 6409b34b7a28..7b4fa3691882 100644 --- a/samples/bluetooth/central_uart/CMakeLists.txt +++ b/samples/bluetooth/central_uart/CMakeLists.txt @@ -13,5 +13,3 @@ target_sources(app PRIVATE src/main.c ) # NORDIC SDK APP END - -zephyr_library_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/samples/bluetooth/central_uart/app.overlay b/samples/bluetooth/central_uart/app.overlay new file mode 100644 index 000000000000..223092559f83 --- /dev/null +++ b/samples/bluetooth/central_uart/app.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,nus-uart = &uart0; + }; +}; diff --git a/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..f75b773c2b75 --- /dev/null +++ b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..d888b3182fec --- /dev/null +++ b/samples/bluetooth/central_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + chosen { + nordic,nus-uart = &uart136; + }; +}; diff --git a/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..f75b773c2b75 --- /dev/null +++ b/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..816013d05d26 --- /dev/null +++ b/samples/bluetooth/central_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,nus-uart = &uart20; + }; +}; diff --git a/samples/bluetooth/central_uart/sample.yaml b/samples/bluetooth/central_uart/sample.yaml index 74c2b02226cb..b2a365dac1ca 100644 --- a/samples/bluetooth/central_uart/sample.yaml +++ b/samples/bluetooth/central_uart/sample.yaml @@ -5,11 +5,16 @@ tests: sample.bluetooth.central_uart: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/central_uart/src/main.c b/samples/bluetooth/central_uart/src/main.c index 756b8d13602c..14d4137a9f79 100644 --- a/samples/bluetooth/central_uart/src/main.c +++ b/samples/bluetooth/central_uart/src/main.c @@ -45,7 +45,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define UART_WAIT_FOR_BUF_DELAY K_MSEC(50) #define UART_RX_TIMEOUT 50000 /* Wait for RX complete event time in microseconds. */ -static const struct device *uart = DEVICE_DT_GET(DT_NODELABEL(uart0)); +static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart)); static struct k_work_delayable uart_work; K_SEM_DEFINE(nus_write_sem, 0, 1); @@ -66,6 +66,8 @@ static void ble_data_sent(struct bt_nus_client *nus, uint8_t err, const uint8_t *const data, uint16_t len) { ARG_UNUSED(nus); + ARG_UNUSED(data); + ARG_UNUSED(len); k_sem_give(&nus_write_sem); @@ -603,20 +605,40 @@ int main(void) LOG_INF("Scanning successfully started"); + struct uart_data_t nus_data = { + .len = 0, + }; + for (;;) { /* Wait indefinitely for data to be sent over Bluetooth */ struct uart_data_t *buf = k_fifo_get(&fifo_uart_rx_data, K_FOREVER); - err = bt_nus_client_send(&nus_client, buf->data, buf->len); - if (err) { - LOG_WRN("Failed to send data over BLE connection" - "(err %d)", err); - } + int plen = MIN(sizeof(nus_data.data) - nus_data.len, buf->len); + int loc = 0; + + while (plen > 0) { + memcpy(&nus_data.data[nus_data.len], &buf->data[loc], plen); + nus_data.len += plen; + loc += plen; + if (nus_data.len >= sizeof(nus_data.data) || + (nus_data.data[nus_data.len - 1] == '\n') || + (nus_data.data[nus_data.len - 1] == '\r')) { + err = bt_nus_client_send(&nus_client, nus_data.data, nus_data.len); + if (err) { + LOG_WRN("Failed to send data over BLE connection" + "(err %d)", err); + } + + err = k_sem_take(&nus_write_sem, NUS_WRITE_TIMEOUT); + if (err) { + LOG_WRN("NUS send timeout"); + } + + nus_data.len = 0; + } - err = k_sem_take(&nus_write_sem, NUS_WRITE_TIMEOUT); - if (err) { - LOG_WRN("NUS send timeout"); + plen = MIN(sizeof(nus_data.data), buf->len - loc); } k_free(buf); diff --git a/samples/bluetooth/connection_event_trigger/README.rst b/samples/bluetooth/connection_event_trigger/README.rst index 34bd45efb444..fe59f45bed1f 100644 --- a/samples/bluetooth/connection_event_trigger/README.rst +++ b/samples/bluetooth/connection_event_trigger/README.rst @@ -34,7 +34,7 @@ Testing After programming the sample to both development kits, test it by performing the following steps: -1. Connect to both kits with a terminal emulator (for example, nRF Connect Serial Terminal). +1. Connect to both kits with a terminal emulator (for example, `nRF Connect Serial Terminal`_). See :ref:`test_and_optimize` for the required settings and steps. #. Reset both kits. @@ -86,7 +86,7 @@ The sample displays the data in the following format:: Connection established. Press any key to switch to a 10ms connection interval and set up connection event trigger: Successfully configured connection event trigger - Connection parameters updated. New interval: 1.25 * 8 ms + Connection parameters updated. New interval: 10 ms Successfully configured connection event trigger Printing connection event trigger log. +-------------+----------------+----------------------------------+ diff --git a/samples/bluetooth/connection_event_trigger/sample.yaml b/samples/bluetooth/connection_event_trigger/sample.yaml index abb54e02afad..d7740741f78b 100644 --- a/samples/bluetooth/connection_event_trigger/sample.yaml +++ b/samples/bluetooth/connection_event_trigger/sample.yaml @@ -5,8 +5,8 @@ tests: sample.bluetooth.connection_event_trigger: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpunet + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build diff --git a/samples/bluetooth/connection_event_trigger/src/main.c b/samples/bluetooth/connection_event_trigger/src/main.c index 732c4d41104a..d4933da6680e 100644 --- a/samples/bluetooth/connection_event_trigger/src/main.c +++ b/samples/bluetooth/connection_event_trigger/src/main.c @@ -209,7 +209,8 @@ static void le_param_updated(struct bt_conn *conn, uint16_t interval, uint16_t l uint16_t timeout) { if (conn == active_conn) { - printk("Connection parameters updated. New interval: 1.25 * %u ms\n", interval); + printk("Connection parameters updated. New interval: %u ms\n", + interval * 1250 / 1000); } } diff --git a/samples/bluetooth/direct_test_mode/CMakeLists.txt b/samples/bluetooth/direct_test_mode/CMakeLists.txt index d3cdf039086e..8d42fd418af6 100644 --- a/samples/bluetooth/direct_test_mode/CMakeLists.txt +++ b/samples/bluetooth/direct_test_mode/CMakeLists.txt @@ -5,33 +5,16 @@ # cmake_minimum_required(VERSION 3.20.0) -if(DEFINED SHIELD AND "${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet") - string(REPLACE " " ";" SHIELD_LIST "${SHIELD}") - foreach(sh IN LISTS SHIELD_LIST) - if("${sh}" STREQUAL "nrf21540ek") - if(CONFIG_DTM_USB) - set(remote_shell_DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell/nrf21540ek_usb.overlay) - else() - set(remote_shell_DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell/nrf21540ek.overlay) - endif() - - break() - endif() - endforeach() +# Zephyr doesn't support application specific shield overlays. +# Therefore pass shiled information to the board overlay as a define so that +# so that the shield overlay is included if required by the board overlay. +string(REPLACE " " ";" shield_list "${SHIELD}") +if("nrf21540ek" IN_LIST shield_list) + set(remote_shell_DTS_EXTRA_CPPFLAGS "-DNRF21540EK") endif() -if(NOT DEFINED remote_shell_DTC_OVERLAY_FILE AND CONFIG_DTM_USB) - set(remote_shell_DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell/usb.overlay) -endif() - -if(CONFIG_DTM_USB) - set(remote_shell_CONF_FILE ${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell/prj_usb.conf) -endif() - -if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet") - if(NOT "${EXTRA_CONF_FILE}" STREQUAL "overlay-hci-nrf53.conf") - set(EXTRA_DTC_OVERLAY_FILE "${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell_nrf53.overlay") - endif() +if(DEFINED FILE_SUFFIX AND NOT DEFINED remote_shell_FILE_SUFFIX) + set(remote_shell_FILE_SUFFIX ${FILE_SUFFIX}) endif() find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/samples/bluetooth/direct_test_mode/README.rst b/samples/bluetooth/direct_test_mode/README.rst index 414d65387853..05686fd231c2 100644 --- a/samples/bluetooth/direct_test_mode/README.rst +++ b/samples/bluetooth/direct_test_mode/README.rst @@ -152,7 +152,7 @@ The behavior of the commands vary depending on the hardware configuration and Kc Additionally, you can use following vendor-specific commands: * The ``SET_TX_POWER`` command sets the SoC TX output power. - * The ``FEM_GAIN_SET`` command sets the front-end module gain. + * The ``FEM_TX_POWER_CONTROL_SET`` command sets the front-end module gain. Bluetooth Direction Finding support =================================== @@ -289,9 +289,10 @@ Vendor-specific commands can be divided into different categories as follows: * ``0`` - ANT1 enabled, ANT2 disabled * ``1`` - ANT1 disabled, ANT2 enabled -* If the **Length** field is set to ``4`` (symbol ``FEM_GAIN_SET``), the **Frequency** field sets the front-end module (FEM) TX gain value in arbitrary units. +* If the **Length** field is set to ``4`` (symbol ``FEM_TX_POWER_CONTROL_SET``), the **Frequency** field sets the front-end module (FEM) TX power control value and is specific to the FEM type in use. The valid gain values are specified in your product-specific front-end module (FEM). - For example, in the nRF21540 front-end module, the gain range is 0 - 31. + For example, in the nRF21540 front-end module with GPIO interface, the tx power control range is 0 (POUTA) to 1 (POUTB). + For example, in the nRF21540 front-end module with GPIO/SPI, the tx power control range is 0 - 31 and is the value of TX_GAIN field of CONFREG0 register. * If the **Length** field is set to ``5`` (symbol ``FEM_ACTIVE_DELAY_SET``), the **Frequency** field sets the front-end module (FEM) activation delay in microseconds relative to the radio start. By default, this value is set to ``radio ramp-up time - front-end module (FEM) TX/RX settling time``. * If the **Length** field is set to ``6`` (symbol ``FEM_DEFAULT_PARAMS_SET``) and the **Frequency** field to any value, the front-end module parameters, such as ``antenna output``, ``gain``, and ``delay``, are set to their default values. @@ -309,7 +310,7 @@ Vendor-specific commands can be divided into different categories as follows: When you build the DTM sample with support for front-end modules and the :ref:`CONFIG_DTM_POWER_CONTROL_AUTOMATIC ` Kconfig option is enabled, the following vendor-specific command are not available: * ``SET_TX_POWER`` - * ``FEM_GAIN_SET`` + * ``FEM_TX_POWER_CONTROL_SET`` You can disable the :ref:`CONFIG_DTM_POWER_CONTROL_AUTOMATIC ` Kconfig option if you want to set the SoC output power and the front-end module gain by separate commands. The official DTM command ``0x09`` for setting power level takes into account the SoC output power and the front-end module gain to set the total requested output power. @@ -384,13 +385,7 @@ To build the sample with an HCI interface, use the following command: .. code-block:: console - west build samples/bluetooth/direct_test_mode -b board_name -- -DEXTRA_CONF_FILE=overlay-hci.conf - -On the |nRF5340DKnoref| the sample with HCI interface can also be built with the `remote_hci` image using the following command: - -.. code-block:: console - - west build samples/bluetooth/direct_test_mode -b board_name -- -DEXTRA_CONF_FILE=overlay-hci-nrf53.conf + west build samples/bluetooth/direct_test_mode -b board_name -- -DFILE_SUFFIX=hci USB CDC ACM transport variant ============================= @@ -400,14 +395,14 @@ Use the following command: .. code-block:: console - west build samples/bluetooth/direct_test_mode -b nrf5340dk_nrf5340_cpunet -- -DCONFIG_DTM_USB=y + west build samples/bluetooth/direct_test_mode -b nrf5340dk/nrf5340/cpunet -- -DFILE_SUFFIX=usb You can also build this sample with support for the front-end module. Use the following command: .. code-block:: console - west build samples/bluetooth/direct_test_mode -b nrf5340dk_nrf5340_cpunet -- -DSHIELD=nrf21540ek -DCONFIG_DTM_USB=y + west build samples/bluetooth/direct_test_mode -b nrf5340dk/nrf5340/cpunet -- -DSHIELD=nrf21540ek -DFILE_SUFFIX=usb .. _dtm_testing: @@ -455,7 +450,7 @@ Testing with nRF Connect for Desktop ------------------------------------ 1. |connect_kit| -#. |connect_terminal| +#. Connect the kit with a terminal emulator that supports encoding and decoding in the HEX format. See `Direct Test Mode terminal connection`_ for the required settings. #. Start the ``TRANSMITTER_TEST`` by sending the ``0x80 0x96`` DTM command to the connected development kit. This command triggers TX activity on 2402 MHz frequency (1st channel) with ``10101010`` packet pattern and 37-byte packet length. diff --git a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.overlay b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.overlay index 373e538c5fd7..1efb596c95d1 100644 --- a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.overlay +++ b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet.overlay @@ -4,6 +4,20 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +/ { + chosen { + ncs,dtm-uart = &uart0; + }; +}; + +&uart0 { + status = "okay"; + compatible = "nordic,nrf-ipc-uart"; + ipc = <&ipc0>; + ept-name = "remote shell"; + current-speed = <19200>; +}; + &radio { status = "okay"; /* This is a number of antennas that are available on antenna matrix diff --git a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf new file mode 100644 index 000000000000..9b795d16a291 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2021 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_IPC_SERVICE=y +CONFIG_IPC_SERVICE_BACKEND_RPMSG=y +CONFIG_MBOX=y + +CONFIG_NRFX_DPPI=y + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +# Do not build Remote shell APP Core sample for the application core in hci mode +CONFIG_NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE=n + +CONFIG_NCS_SAMPLE_DTM_REMOTE_HCI_CHILD_IMAGE=y +CONFIG_NRF_RPC=y +CONFIG_NRF_RPC_CBOR=y + +CONFIG_DTM_TRANSPORT_HCI=y +CONFIG_NET_BUF=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.overlay b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.overlay new file mode 100644 index 000000000000..373e538c5fd7 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf5340dk_nrf5340_cpunet_hci.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&radio { + status = "okay"; + /* This is a number of antennas that are available on antenna matrix + * designed by Nordic. For more information see README.rst. + */ + dfe-antenna-num = <12>; + /* This is a setting that enables antenna 12 (in antenna matrix designed + * by Nordic) for PDU. For more information see README.rst. + */ + dfe-pdu-antenna = <0x0>; + + /* These are GPIO pin numbers that are provided to + * Radio peripheral. The pins will be acquired by Radio to + * drive antenna switching. + * Pin numbers are selected to drive switches on antenna matrix + * desinged by Nordic. For more information see README.rst. + */ + dfegpio0-gpios = <&gpio0 4 0>; + dfegpio1-gpios = <&gpio0 5 0>; + dfegpio2-gpios = <&gpio0 6 0>; + dfegpio3-gpios = <&gpio0 7 0>; +}; diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..f8c50a0c1958 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n +CONFIG_NRFX_TIMER1=n +CONFIG_NRFX_TIMER2=n + +# Use necessary peripherals +CONFIG_NRFX_TIMER020=y +CONFIG_NRFX_TIMER021=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..6c866568a15a --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + chosen { + ncs,dtm-uart = &uart136; + }; +}; + +&uart135 { + status = "disabled"; +}; + +&uart136 { + status = "okay"; + memory-regions = <&cpurad_dma_region>; + current-speed = <19200>; +}; + +&dppic020 { + status = "okay"; + source-channels = < 0 1 >; + sink-channels = < 2 3 >; +}; + +&radio { + status = "okay"; + /* This is a number of antennas that are available on antenna matrix + * designed by Nordic. For more information see README.rst. + */ + dfe-antenna-num = <12>; + /* This is a setting that enables antenna 12 (in antenna matrix designed + * by Nordic) for PDU. For more information see README.rst. + */ + dfe-pdu-antenna = <0x0>; + + /* These are GPIO pin numbers that are provided to + * Radio peripheral. The pins will be acquired by Radio to + * drive antenna switching. + * Pin numbers are selected to drive switches on antenna matrix + * desinged by Nordic. For more information see README.rst. + */ + dfegpio0-gpios = <&gpio0 4 0>; + dfegpio1-gpios = <&gpio0 5 0>; + dfegpio2-gpios = <&gpio0 6 0>; + dfegpio3-gpios = <&gpio0 7 0>; +}; diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..042fa8a9bf9b --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n +CONFIG_NRFX_TIMER1=n +CONFIG_NRFX_TIMER2=n + +# Use necessary peripherals +CONFIG_NRFX_TIMER20=y +CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_DPPI=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..495ae0a3f293 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + ncs,dtm-uart = &uart20; + }; +}; + +&uart20 { + status = "okay"; + current-speed = <19200>; +}; + +&radio { + status = "okay"; + /* This is a number of antennas that are available on antenna matrix + * designed by Nordic. For more information see README.rst. + */ + dfe-antenna-num = <12>; + /* This is a setting that enables antenna 12 (in antenna matrix designed + * by Nordic) for PDU. For more information see README.rst. + */ + dfe-pdu-antenna = <0x0>; + + /* These are GPIO pin numbers that are provided to + * Radio peripheral. The pins will be acquired by Radio to + * drive antenna switching. + * Pin numbers are selected to drive switches on antenna matrix + * desinged by Nordic. For more information see README.rst. + */ + dfegpio0-gpios = <&gpio0 4 0>; + dfegpio1-gpios = <&gpio0 5 0>; + dfegpio2-gpios = <&gpio0 6 0>; + dfegpio3-gpios = <&gpio0 7 0>; +}; diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/nrf21540ek.overlay b/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf21540ek.overlay similarity index 100% rename from samples/bluetooth/direct_test_mode/conf/remote_shell/nrf21540ek.overlay rename to samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf21540ek.overlay diff --git a/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay index 3bdcc7c0c416..9dac3c975011 100644 --- a/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -24,3 +24,7 @@ <&gpio0 7 0>; }; }; + +#if NRF21540EK +#include "nrf21540ek.overlay" +#endif diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/pin_fwd.dts b/samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/pin_fwd.dts similarity index 100% rename from samples/bluetooth/direct_test_mode/conf/remote_shell/pin_fwd.dts rename to samples/bluetooth/direct_test_mode/child_image/remote_shell/boards/pin_fwd.dts diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/prj_usb.conf b/samples/bluetooth/direct_test_mode/child_image/remote_shell/prj_usb.conf similarity index 100% rename from samples/bluetooth/direct_test_mode/conf/remote_shell/prj_usb.conf rename to samples/bluetooth/direct_test_mode/child_image/remote_shell/prj_usb.conf diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/usb.overlay b/samples/bluetooth/direct_test_mode/child_image/remote_shell_usb.overlay similarity index 100% rename from samples/bluetooth/direct_test_mode/conf/remote_shell/usb.overlay rename to samples/bluetooth/direct_test_mode/child_image/remote_shell_usb.overlay diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/usb.dts b/samples/bluetooth/direct_test_mode/child_image/usb.dts similarity index 100% rename from samples/bluetooth/direct_test_mode/conf/remote_shell/usb.dts rename to samples/bluetooth/direct_test_mode/child_image/usb.dts diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell/nrf21540ek_usb.overlay b/samples/bluetooth/direct_test_mode/conf/remote_shell/nrf21540ek_usb.overlay deleted file mode 100644 index 9d5409cf4c46..000000000000 --- a/samples/bluetooth/direct_test_mode/conf/remote_shell/nrf21540ek_usb.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "usb.dts" -#include "pin_fwd.dts" diff --git a/samples/bluetooth/direct_test_mode/conf/remote_shell_nrf53.overlay b/samples/bluetooth/direct_test_mode/conf/remote_shell_nrf53.overlay deleted file mode 100644 index 05eb2d5d9fe4..000000000000 --- a/samples/bluetooth/direct_test_mode/conf/remote_shell_nrf53.overlay +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - ncs,dtm-uart = &uart0; - }; -}; - -&uart0 { - status = "okay"; - compatible = "nordic,nrf-ipc-uart"; - ipc = <&ipc0>; - ept-name = "remote shell"; - current-speed = <19200>; -}; diff --git a/samples/bluetooth/direct_test_mode/overlay-hci-nrf53.conf b/samples/bluetooth/direct_test_mode/overlay-hci-nrf53.conf deleted file mode 100644 index 3dda4d3c8e83..000000000000 --- a/samples/bluetooth/direct_test_mode/overlay-hci-nrf53.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE=n -CONFIG_IPC_UART=n - -CONFIG_NCS_SAMPLE_DTM_REMOTE_HCI_CHILD_IMAGE=y -CONFIG_NRF_RPC=y -CONFIG_NRF_RPC_CBOR=y - -CONFIG_DTM_TRANSPORT_HCI=y -CONFIG_NET_BUF=y diff --git a/samples/bluetooth/direct_test_mode/overlay-hci.conf b/samples/bluetooth/direct_test_mode/overlay-hci.conf deleted file mode 100644 index 3c07dad787fb..000000000000 --- a/samples/bluetooth/direct_test_mode/overlay-hci.conf +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -CONFIG_DTM_TRANSPORT_HCI=y -CONFIG_NET_BUF=y -CONFIG_UART_ASYNC_API=y diff --git a/samples/bluetooth/direct_test_mode/prj_hci.conf b/samples/bluetooth/direct_test_mode/prj_hci.conf new file mode 100644 index 000000000000..3b00c98335d9 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/prj_hci.conf @@ -0,0 +1,31 @@ +# +# Copyright (c) 2020 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Configure assertions +CONFIG_ASSERT=y +CONFIG_ASSERT_NO_COND_INFO=y +CONFIG_ASSERT_NO_MSG_INFO=y + +CONFIG_HW_STACK_PROTECTION=y + +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n + +CONFIG_LOG=y +CONFIG_LOG_PRINTK=y +CONFIG_USE_SEGGER_RTT=y +CONFIG_LOG_BACKEND_RTT=y + +# Use necessary peripherals +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_TIMER2=y + +CONFIG_FEM_AL_LIB=y + +CONFIG_DTM_TRANSPORT_HCI=y +CONFIG_NET_BUF=y +CONFIG_UART_ASYNC_API=y diff --git a/samples/bluetooth/direct_test_mode/prj_usb.conf b/samples/bluetooth/direct_test_mode/prj_usb.conf new file mode 100644 index 000000000000..12d257fa3296 --- /dev/null +++ b/samples/bluetooth/direct_test_mode/prj_usb.conf @@ -0,0 +1,29 @@ +# +# Copyright (c) 2020 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Configure assertions +CONFIG_ASSERT=y +CONFIG_ASSERT_NO_COND_INFO=y +CONFIG_ASSERT_NO_MSG_INFO=y + +CONFIG_HW_STACK_PROTECTION=y + +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n + +CONFIG_LOG=y +CONFIG_LOG_PRINTK=y +CONFIG_USE_SEGGER_RTT=y +CONFIG_LOG_BACKEND_RTT=y + +# Use necessary peripherals +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_TIMER2=y + +CONFIG_FEM_AL_LIB=y + +CONFIG_DTM_USB=y diff --git a/samples/bluetooth/direct_test_mode/sample.yaml b/samples/bluetooth/direct_test_mode/sample.yaml index a18e142f688e..655e9fb1a8ac 100644 --- a/samples/bluetooth/direct_test_mode/sample.yaml +++ b/samples/bluetooth/direct_test_mode/sample.yaml @@ -5,34 +5,36 @@ tests: sample.bluetooth.direct_test_mode: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - - nrf21540dk_nrf52840 - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpunet nrf21540dk_nrf52840 nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpunet + - nrf21540dk/nrf52840 + - nrf52840dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpurad + platform_allow: nrf5340dk/nrf5340/cpunet nrf21540dk/nrf52840 nrf52840dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpurad tags: bluetooth ci_build sample.bluetooth.direct_test_mode.nrf5340_nrf21540: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build sample.bluetooth.direct_test_mode.nrf5340_usb: build_only: true - extra_configs: - - CONFIG_DTM_USB=y + extra_args: FILE_SUFFIX=usb integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build sample.bluetooth.direct_test_mode.nrf5340_nrf21540_usb: build_only: true - extra_args: SHIELD=nrf21540ek - extra_configs: - - CONFIG_DTM_USB=y + extra_args: SHIELD=nrf21540ek FILE_SUFFIX=usb integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build sample.bluetooth.direct_test_mode.nrf5340_nrf21540.no_automatic_power: build_only: true @@ -40,6 +42,6 @@ tests: extra_configs: - CONFIG_DTM_POWER_CONTROL_AUTOMATIC=n integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build diff --git a/samples/bluetooth/direct_test_mode/src/dtm.c b/samples/bluetooth/direct_test_mode/src/dtm.c index 735f04896960..4c30cfd884ee 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm.c +++ b/samples/bluetooth/direct_test_mode/src/dtm.c @@ -16,12 +16,16 @@ #endif /* CONFIG_FEM */ #include +#if defined(CONFIG_CLOCK_CONTROL_NRF) #include #include +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ #include +#if !(defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX)) +#include +#endif /* !defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) */ #include -#include #include #ifdef NRF53_SERIES @@ -32,8 +36,27 @@ #include #include +#if defined(CONFIG_SOC_SERIES_NRF54HX) + #define DEFAULT_TIMER_INSTANCE 020 + #define RADIO_IRQn RADIO_0_IRQn + #define DTM_EGU NRF_EGU020 + #define DTM_RADIO_SHORT_READY_START_MASK NRF_RADIO_SHORT_READY_START_MASK + #define DTM_RADIO_SHORT_END_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54LX) + #define DEFAULT_TIMER_INSTANCE 10 + #define RADIO_IRQn RADIO_0_IRQn + #define DTM_EGU NRF_EGU10 + #define DTM_RADIO_SHORT_READY_START_MASK NRF_RADIO_SHORT_READY_START_MASK + #define DTM_RADIO_SHORT_END_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK +#else + #define DEFAULT_TIMER_INSTANCE 0 + #define RADIO_IRQn RADIO_IRQn + #define DTM_EGU NRF_EGU0 + #define DTM_RADIO_SHORT_READY_START_MASK NRF_RADIO_SHORT_READY_START_MASK + #define DTM_RADIO_SHORT_END_DISABLE_MASK NRF_RADIO_SHORT_END_DISABLE_MASK +#endif /* defined(CONFIG_SOC_SERIES_NRF54HX) */ + /* Default timer used for timing. */ -#define DEFAULT_TIMER_INSTANCE 0 #define DEFAULT_TIMER_IRQ NRFX_CONCAT_3(TIMER, \ DEFAULT_TIMER_INSTANCE, \ _IRQn) @@ -66,10 +89,14 @@ BUILD_ASSERT(NRFX_TIMER_CONFIG_LABEL(ANOMALY_172_TIMER_INSTANCE) == 1, "Anomaly DTM timer needs additional KConfig configuration"); #endif /* NRF52_ERRATA_172_PRESENT */ -#define DTM_EGU NRF_EGU0 #define DTM_EGU_EVENT NRF_EGU_EVENT_TRIGGERED0 #define DTM_EGU_TASK NRF_EGU_TASK_TRIGGER0 +#define ENDPOINT_EGU_RADIO_TX BIT(1) +#define ENDPOINT_EGU_RADIO_RX BIT(2) +#define ENDPOINT_TIMER_RADIO_TX BIT(3) +#define ENDPOINT_FORK_EGU_TIMER BIT(4) + /* Values that for now are "constants" - they could be configured by a function * setting them, but most of these are set by the BLE DTM standard, so changing * them is not relevant. @@ -164,7 +191,7 @@ BUILD_ASSERT(NRFX_TIMER_CONFIG_LABEL(ANOMALY_172_TIMER_INSTANCE) == 1, /* Maximum number of valid channels in BLE. */ #define PHYS_CH_MAX 39 -#define FEM_USE_DEFAULT_GAIN 0xFF +#define FEM_USE_DEFAULT_TX_POWER_CONTROL 0xFF /* Minimum supported CTE length in 8 us units. */ #define CTE_LENGTH_MIN 0x02 @@ -273,8 +300,8 @@ enum dtm_vs_subcmd { /* Switch front-end module (FEM) antenna. */ FEM_ANTENNA_SELECT = 3, - /* Set front-end module (FEM) gain value. */ - FEM_GAIN_SET = 4, + /* Set front-end module (FEM) tx power control value. */ + FEM_TX_POWER_CONTROL_SET = 4, /* Set FEM ramp-up time. */ FEM_RAMP_UP_SET = 5, @@ -318,6 +345,7 @@ struct dtm_cte_info { dtm_iq_report_callback_t iq_rep_cb; }; +#if CONFIG_FEM struct fem_parameters { /* Front-end module ramp-up time in microseconds. */ uint32_t ramp_up_time; @@ -325,12 +353,13 @@ struct fem_parameters { /* Front-end module vendor ramp-up time in microseconds. */ uint32_t vendor_ramp_up_time; - /* Front-end module Tx gain in unit specific for used FEM. + /* Front-end module Tx power control in unit specific for used FEM. * For nRF21540 GPIO/SPI, this is a register value. * For nRF21540 GPIO, this is MODE pin value. */ - uint32_t gain; + fem_tx_power_control tx_power_control; }; +#endif /* CONFIG_FEM */ /* DTM instance definition */ static struct dtm_instance { @@ -379,16 +408,21 @@ static struct dtm_instance { nrf_radio_mode_t radio_mode; /* Radio output power. */ - nrf_radio_txpower_t txpower; + int8_t txpower; /* Constant Tone Extension configuration. */ struct dtm_cte_info cte_info; +#if CONFIG_FEM /* Front-end module (FEM) parameters. */ struct fem_parameters fem; +#endif /* Radio Enable PPI channel. */ uint8_t ppi_radio_start; + + /* PPI endpoint status.*/ + atomic_t endpoint_state; } dtm_inst = { .state = STATE_UNINITIALIZED, .packet_hdr_plen = NRF_RADIO_PREAMBLE_LENGTH_8BIT, @@ -398,8 +432,10 @@ static struct dtm_instance { .anomaly_timer = NRFX_TIMER_INSTANCE(ANOMALY_172_TIMER_INSTANCE), #endif /* NRF52_ERRATA_172_PRESENT */ .radio_mode = NRF_RADIO_MODE_BLE_1MBIT, - .txpower = NRF_RADIO_TXPOWER_0DBM, - .fem.gain = FEM_USE_DEFAULT_GAIN, + .txpower = 0, +#if CONFIG_FEM + .fem.tx_power_control = FEM_USE_DEFAULT_TX_POWER_CONTROL, +#endif }; /* The PRBS9 sequence used as packet payload. @@ -501,7 +537,7 @@ static const struct dtm_supp_features supported_features = { static void radio_gpio_pattern_clear(void) { - NRF_RADIO->CLEARPATTERN = RADIO_CLEARPATTERN_CLEARPATTERN_Clear; + nrf_radio_dfe_pattern_clear(NRF_RADIO); } static void antenna_radio_pin_config(void) @@ -598,6 +634,7 @@ static void anomaly_timer_handler(nrf_timer_event_t event_type, void *context); static void dtm_timer_handler(nrf_timer_event_t event_type, void *context); static void radio_handler(const void *context); +#if defined(CONFIG_CLOCK_CONTROL_NRF) static int clock_init(void) { int err; @@ -629,13 +666,14 @@ static int clock_init(void) return err; } +#endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */ static int timer_init(void) { nrfx_err_t err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1), - .mode = NRF_TIMER_MODE_TIMER, + .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_16, }; @@ -657,7 +695,7 @@ static int anomaly_timer_init(void) nrfx_err_t err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_KHZ_TO_HZ(125), - .mode = NRF_TIMER_MODE_TIMER, + .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_16, }; @@ -696,6 +734,156 @@ static int gppi_init(void) return 0; } +static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) +{ + + /* The tx_power is in dBm units and is converted + * to the appropriate radio register enumerator. + */ + switch (tx_power) { +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) + case -70: + return RADIO_TXPOWER_TXPOWER_Neg70dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) + case -46: + return RADIO_TXPOWER_TXPOWER_Neg46dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) + case -40: + return RADIO_TXPOWER_TXPOWER_Neg40dBm; +#endif /* RADIO_TXPOWER_TXPOWER_Neg40dBm */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) + case -30: + 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) */ + + case -20: + return RADIO_TXPOWER_TXPOWER_Neg20dBm; + + case -16: + return RADIO_TXPOWER_TXPOWER_Neg16dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) + case -14: + return RADIO_TXPOWER_TXPOWER_Neg14dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ + + case -12: + return RADIO_TXPOWER_TXPOWER_Neg12dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) + case -10: + return RADIO_TXPOWER_TXPOWER_Neg10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) + case -9: + return RADIO_TXPOWER_TXPOWER_Neg9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ + + case -8: + return RADIO_TXPOWER_TXPOWER_Neg8dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) + case -7: + return RADIO_TXPOWER_TXPOWER_Neg7dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) + case -6: + return RADIO_TXPOWER_TXPOWER_Neg6dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) + case -5: + return RADIO_TXPOWER_TXPOWER_Neg5dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) */ + + case -4: + return RADIO_TXPOWER_TXPOWER_Neg4dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg3dBm) + case -3: + return RADIO_TXPOWER_TXPOWER_Neg3dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg3dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg2dBm) + case -2: + return RADIO_TXPOWER_TXPOWER_Neg2dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg2dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg1dBm) + + case -1: + return RADIO_TXPOWER_TXPOWER_Neg1dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg1dBm) */ + + case 0: + return RADIO_TXPOWER_TXPOWER_0dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) + case 1: + return RADIO_TXPOWER_TXPOWER_Pos1dBm; +#endif /* RADIO_TXPOWER_TXPOWER_Pos1dBm */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) + case 2: + return RADIO_TXPOWER_TXPOWER_Pos2dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) + case 3: + return RADIO_TXPOWER_TXPOWER_Pos3dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) + case 4: + return RADIO_TXPOWER_TXPOWER_Pos4dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) + case 5: + return RADIO_TXPOWER_TXPOWER_Pos5dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) + case 6: + return RADIO_TXPOWER_TXPOWER_Pos6dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) + case 7: + return RADIO_TXPOWER_TXPOWER_Pos7dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) + case 8: + return RADIO_TXPOWER_TXPOWER_Pos8dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) + case 9: + return RADIO_TXPOWER_TXPOWER_Pos9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) + case 10: + return RADIO_TXPOWER_TXPOWER_Pos10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ + default: + __ASSERT_NO_MSG(0); + } +} + #if CONFIG_DTM_POWER_CONTROL_AUTOMATIC static int8_t dtm_radio_min_power_get(uint16_t frequency) { @@ -738,7 +926,7 @@ static int8_t dtm_radio_nearest_power_get(int8_t tx_power, uint16_t frequency) { int8_t output_power = INT8_MAX; const size_t size = dtm_hw_radio_power_array_size_get(); - const uint32_t *power = dtm_hw_radio_power_array_get(); + const int8_t *power = dtm_hw_radio_power_array_get(); ARG_UNUSED(frequency); @@ -805,11 +993,15 @@ static void radio_tx_power_set(uint8_t channel, int8_t tx_power) nrf_vreqctrl_radio_high_voltage_set(NRF_VREQCTRL, high_voltage_enable); #endif /* NRF53_SERIES */ - nrf_radio_txpower_set(NRF_RADIO, (nrf_radio_txpower_t)radio_power); + nrf_radio_txpower_set(NRF_RADIO, dbm_to_nrf_radio_txpower(radio_power)); } static void radio_reset(void) { + if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { + nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); + } + nrf_radio_shorts_set(NRF_RADIO, 0); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); @@ -890,10 +1082,12 @@ int dtm_init(dtm_iq_report_callback_t callback) { int err; +#if defined(CONFIG_CLOCK_CONTROL_NRF) err = clock_init(); if (err) { return err; } +#endif /* defined(CONFIG_CLOCK_CONTROL_NRF) */ err = timer_init(); if (err) { @@ -925,9 +1119,9 @@ int dtm_init(dtm_iq_report_callback_t callback) #if CONFIG_DTM_POWER_CONTROL_AUTOMATIC /* When front-end module is used, set output power to the front-end module - * default gain. + * default output power. */ - dtm_inst.txpower = fem_default_tx_gain_get(); + dtm_inst.txpower = fem_default_tx_output_power_get(); #endif /* CONFIG_DTM_POWER_CONTROL_AUTOMATIC */ /** Connect radio interrupts. */ @@ -956,7 +1150,9 @@ static void report_iq(void) iq_data.channel = dtm_inst.phys_ch; iq_data.rssi = -nrf_radio_rssi_sample_get(NRF_RADIO); +#if defined(RADIO_EVENTS_RSSIEND_EVENTS_RSSIEND_Msk) nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_RSSIEND); +#endif iq_data.rssi_ant = dtm_hw_radio_pdu_antenna_get(); @@ -1217,27 +1413,42 @@ static void errata_191_handle(bool enable) } } +static void endpoints_clear(void) +{ + if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_FORK_EGU_TIMER)) { + nrfx_gppi_fork_endpoint_clear(dtm_inst.ppi_radio_start, + nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); + } + if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_EGU_RADIO_TX)) { + nrfx_gppi_channel_endpoints_clear( + dtm_inst.ppi_radio_start, + nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + } + if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_EGU_RADIO_RX)) { + nrfx_gppi_channel_endpoints_clear( + dtm_inst.ppi_radio_start, + nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); + } + if (atomic_test_and_clear_bit(&dtm_inst.endpoint_state, ENDPOINT_TIMER_RADIO_TX)) { + nrfx_gppi_channel_endpoints_clear( + dtm_inst.ppi_radio_start, + nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + } +} + static void radio_ppi_clear(void) { - nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); + if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { + nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); + } + nrf_egu_event_clear(DTM_EGU, DTM_EGU_EVENT); /* Break connection from timer to radio to stop transmit loop */ - nrfx_gppi_event_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); - - if (dtm_inst.state == STATE_TRANSMITTER_TEST) { - nrfx_gppi_task_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); - } else if (dtm_inst.state == STATE_RECEIVER_TEST) { - nrfx_gppi_task_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); - } - - nrfx_gppi_event_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); - nrfx_gppi_fork_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); + endpoints_clear(); } static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) @@ -1247,8 +1458,13 @@ static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT), nrf_radio_task_address_get(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); + atomic_set_bit(&dtm_inst.endpoint_state, + (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); + nrfx_gppi_fork_endpoint_setup(dtm_inst.ppi_radio_start, nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); + atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_FORK_EGU_TIMER); + nrfx_gppi_channels_enable(BIT(dtm_inst.ppi_radio_start)); if (timer_short_mask) { @@ -1258,18 +1474,17 @@ static void radio_ppi_configure(bool rx, uint32_t timer_short_mask) static void radio_tx_ppi_reconfigure(void) { - nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); - nrfx_gppi_fork_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_timer_task_address_get(dtm_inst.timer.p_reg, NRF_TIMER_TASK_START)); - nrfx_gppi_event_endpoint_clear(dtm_inst.ppi_radio_start, - nrf_egu_event_address_get(DTM_EGU, DTM_EGU_EVENT)); - nrfx_gppi_event_endpoint_setup(dtm_inst.ppi_radio_start, - nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0)); + if (nrfx_gppi_channel_check(dtm_inst.ppi_radio_start)) { + nrfx_gppi_channels_disable(BIT(dtm_inst.ppi_radio_start)); + } + + endpoints_clear(); nrfx_gppi_channel_endpoints_setup( dtm_inst.ppi_radio_start, nrf_timer_event_address_get(dtm_inst.timer.p_reg, NRF_TIMER_EVENT_COMPARE0), nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + atomic_set_bit(&dtm_inst.endpoint_state, ENDPOINT_TIMER_RADIO_TX); nrfx_gppi_channels_enable(BIT(dtm_inst.ppi_radio_start)); } @@ -1338,15 +1553,16 @@ static void radio_prepare(bool rx) (dtm_inst.cte_info.iq_rep_cb ? NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK : 0) | (dtm_inst.cte_info.mode == DTM_CTE_MODE_OFF ? - NRF_RADIO_SHORT_END_DISABLE_MASK : + DTM_RADIO_SHORT_END_DISABLE_MASK : NRF_RADIO_SHORT_PHYEND_DISABLE_MASK)); #else nrf_radio_shorts_set(NRF_RADIO, - NRF_RADIO_SHORT_READY_START_MASK | - NRF_RADIO_SHORT_END_DISABLE_MASK); + DTM_RADIO_SHORT_READY_START_MASK | + DTM_RADIO_SHORT_END_DISABLE_MASK); #endif /* DIRECTION_FINDING_SUPPORTED */ + #if CONFIG_FEM if (dtm_inst.fem.vendor_ramp_up_time == 0) { dtm_inst.fem.ramp_up_time = @@ -1362,7 +1578,9 @@ static void radio_prepare(bool rx) nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_READY_MASK | NRF_RADIO_INT_ADDRESS_MASK | +#if defined(RADIO_EVENTS_RSSIEND_EVENTS_RSSIEND_Msk) NRF_RADIO_INT_RSSIEND_MASK | +#endif NRF_RADIO_INT_END_MASK); if (rx) { @@ -1408,7 +1626,7 @@ static bool dtm_set_txpower(uint32_t new_tx_power) /* radio->TXPOWER register is 32 bits, low octet a tx power value, * upper 24 bits zeroed. */ - uint8_t new_power8 = (uint8_t) (new_tx_power & 0xFF); + int8_t new_power8 = (int8_t)(new_tx_power & 0xFF); /* The two most significant bits are not sent in the 6 bit field of * the DTM command. These two bits are 1's if and only if the tx_power @@ -1446,18 +1664,16 @@ static int dtm_vendor_specific_pkt(uint32_t vendor_cmd, uint32_t vendor_option) * carrier signal should be transmitted by the radio. */ radio_prepare(TX_MODE); - - nrf_radio_modecnf0_set(NRF_RADIO, IS_ENABLED(CONFIG_DTM_FAST_RAMP_UP), - RADIO_MODECNF0_DTX_Center); + nrf_radio_fast_ramp_up_enable_set(NRF_RADIO, IS_ENABLED(CONFIG_DTM_FAST_RAMP_UP)); /* Shortcut between READY event and START task */ nrf_radio_shorts_set(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK); #if CONFIG_FEM - if ((dtm_inst.fem.gain != FEM_USE_DEFAULT_GAIN) && + if ((dtm_inst.fem.tx_power_control != FEM_USE_DEFAULT_TX_POWER_CONTROL) && (!IS_ENABLED(CONFIG_DTM_POWER_CONTROL_AUTOMATIC))) { - if (fem_tx_gain_set(dtm_inst.fem.gain) != 0) { + if (fem_tx_power_control_set(dtm_inst.fem.tx_power_control) != 0) { return -EINVAL; } } @@ -1489,8 +1705,8 @@ static int dtm_vendor_specific_pkt(uint32_t vendor_cmd, uint32_t vendor_option) break; #if !CONFIG_DTM_POWER_CONTROL_AUTOMATIC - case FEM_GAIN_SET: - dtm_inst.fem.gain = vendor_option; + case FEM_TX_POWER_CONTROL_SET: + dtm_inst.fem.tx_power_control = vendor_option; break; #endif /* !CONFIG_DTM_POWER_CONTROL_AUTOMATIC */ @@ -1501,7 +1717,7 @@ static int dtm_vendor_specific_pkt(uint32_t vendor_cmd, uint32_t vendor_option) break; case FEM_DEFAULT_PARAMS_SET: - dtm_inst.fem.gain = FEM_USE_DEFAULT_GAIN; + dtm_inst.fem.tx_power_control = FEM_USE_DEFAULT_TX_POWER_CONTROL; dtm_inst.fem.vendor_ramp_up_time = 0; if (fem_antenna_select(FEM_ANTENNA_1) != 0) { @@ -1893,6 +2109,8 @@ struct dtm_tx_power dtm_setup_set_transmit_power(enum dtm_tx_power_request power dtm_inst.txpower = dtm_radio_nearest_power_get(val, frequency); } + break; + default: return tmp; } @@ -2082,9 +2300,9 @@ int dtm_test_transmit(uint8_t channel, uint8_t length, enum dtm_packet pkt) NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false); #if CONFIG_FEM - if ((dtm_inst.fem.gain != FEM_USE_DEFAULT_GAIN) && + if ((dtm_inst.fem.tx_power_control != FEM_USE_DEFAULT_TX_POWER_CONTROL) && (!IS_ENABLED(CONFIG_DTM_POWER_CONTROL_AUTOMATIC))) { - if (fem_tx_gain_set(dtm_inst.fem.gain) != 0) { + if (fem_tx_power_control_set(dtm_inst.fem.tx_power_control) != 0) { return -EINVAL; } } @@ -2216,9 +2434,12 @@ static void radio_handler(const void *context) #endif /* NRF52_ERRATA_172_PRESENT */ } +#if defined(RADIO_EVENTS_RSSIEND_EVENTS_RSSIEND_Msk) if (nrf_radio_event_check(NRF_RADIO, NRF_RADIO_EVENT_RSSIEND)) { nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_RSSIEND); } +#endif + } static void dtm_timer_handler(nrf_timer_event_t event_type, void *context) diff --git a/samples/bluetooth/direct_test_mode/src/dtm_hw.c b/samples/bluetooth/direct_test_mode/src/dtm_hw.c index 6b4313e01c8a..705a1d73361c 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm_hw.c +++ b/samples/bluetooth/direct_test_mode/src/dtm_hw.c @@ -9,59 +9,86 @@ #include "dtm_hw.h" #include "dtm_hw_config.h" -const uint32_t nrf_power_value[] = { +/* All valid power levels (in dBm) supported by the SoC. */ +const int8_t nrf_power_value[] = { +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) + -70, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) + -46, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) - RADIO_TXPOWER_TXPOWER_Neg40dBm, + -40, #endif /* RADIO_TXPOWER_TXPOWER_Neg40dBm */ - RADIO_TXPOWER_TXPOWER_Neg30dBm, - RADIO_TXPOWER_TXPOWER_Neg20dBm, - RADIO_TXPOWER_TXPOWER_Neg16dBm, - RADIO_TXPOWER_TXPOWER_Neg12dBm, - RADIO_TXPOWER_TXPOWER_Neg8dBm, +#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) */ + -20, + -16, +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) + -14, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ + -12, +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) + -10, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) + -9, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ + -8, #if defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) - RADIO_TXPOWER_TXPOWER_Neg7dBm, + -7, #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) - RADIO_TXPOWER_TXPOWER_Neg6dBm, + -6, #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) - RADIO_TXPOWER_TXPOWER_Neg5dBm, + -5, #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) */ - RADIO_TXPOWER_TXPOWER_Neg4dBm, + -4, #if defined(RADIO_TXPOWER_TXPOWER_Neg3dBm) - RADIO_TXPOWER_TXPOWER_Neg3dBm, + -3, #endif /* defined (RADIO_TXPOWER_TXPOWER_Neg3dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg2dBm) - RADIO_TXPOWER_TXPOWER_Neg2dBm, + -2, #endif /* defined (RADIO_TXPOWER_TXPOWER_Neg2dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Neg1dBm) - RADIO_TXPOWER_TXPOWER_Neg1dBm, + -1, #endif /* defined (RADIO_TXPOWER_TXPOWER_Neg1dBm) */ - RADIO_TXPOWER_TXPOWER_0dBm, + 0, #if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) - RADIO_TXPOWER_TXPOWER_Pos1dBm, + 1, #endif /* RADIO_TXPOWER_TXPOWER_Pos1dBm */ #if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) - RADIO_TXPOWER_TXPOWER_Pos2dBm, + 2, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) - RADIO_TXPOWER_TXPOWER_Pos3dBm, + 3, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) - RADIO_TXPOWER_TXPOWER_Pos4dBm, + 4, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) - RADIO_TXPOWER_TXPOWER_Pos5dBm, + 5, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) - RADIO_TXPOWER_TXPOWER_Pos6dBm, + 6, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) - RADIO_TXPOWER_TXPOWER_Pos7dBm, + 7, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) - RADIO_TXPOWER_TXPOWER_Pos8dBm + 8, #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) + 9, +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) + 10 +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ }; #if DIRECTION_FINDING_SUPPORTED @@ -148,7 +175,7 @@ static const struct dtm_ant_cfg { }; #endif /* DIRECTION_FINDING_SUPPORTED */ -bool dtm_hw_radio_validate(nrf_radio_txpower_t tx_power, +bool dtm_hw_radio_validate(int8_t tx_power, nrf_radio_mode_t radio_mode) { /* Initializing code below is quite generic - for BLE, the values are @@ -207,7 +234,7 @@ size_t dtm_hw_radio_power_array_size_get(void) return ARRAY_SIZE(nrf_power_value); } -const uint32_t *dtm_hw_radio_power_array_get(void) +const int8_t *dtm_hw_radio_power_array_get(void) { return nrf_power_value; } diff --git a/samples/bluetooth/direct_test_mode/src/dtm_hw.h b/samples/bluetooth/direct_test_mode/src/dtm_hw.h index 61d3a3dd6951..0629395bb918 100644 --- a/samples/bluetooth/direct_test_mode/src/dtm_hw.h +++ b/samples/bluetooth/direct_test_mode/src/dtm_hw.h @@ -27,13 +27,13 @@ extern "C" { RADIO_PSEL_DFEGPIO_CONNECT_Pos) /**@brief Function for validating tx power and radio mode settings. - * @param[in] tx_power TX power for transmission test. + * @param[in] tx_power TX power for transmission test in dBm. * @param[in] radio_mode Radio mode value. * * @retval true If validation was successful * @retval false Otherwise */ -bool dtm_hw_radio_validate(nrf_radio_txpower_t tx_power, +bool dtm_hw_radio_validate(int8_t tx_power, nrf_radio_mode_t radio_mode); /**@brief Function for checking if Radio operates in Long Range mode. @@ -70,7 +70,7 @@ size_t dtm_hw_radio_power_array_size_get(void); * * @retval Size of the tx power array. */ -const uint32_t *dtm_hw_radio_power_array_get(void); +const int8_t *dtm_hw_radio_power_array_get(void); /**@brief Function for getting antenna pins array. This array contains * all antenna pins data. diff --git a/samples/bluetooth/direct_test_mode/src/transport/dtm_uart_wait.c b/samples/bluetooth/direct_test_mode/src/transport/dtm_uart_wait.c index 376770984490..c6ebf473cc03 100644 --- a/samples/bluetooth/direct_test_mode/src/transport/dtm_uart_wait.c +++ b/samples/bluetooth/direct_test_mode/src/transport/dtm_uart_wait.c @@ -14,7 +14,14 @@ LOG_MODULE_REGISTER(dtm_wait, CONFIG_DTM_TRANSPORT_LOG_LEVEL); /* Timer used for measuring UART poll cycle wait time. */ -#define WAIT_TIMER_INSTANCE 1 +#if defined(CONFIG_SOC_SERIES_NRF54HX) + #define WAIT_TIMER_INSTANCE 021 +#elif defined(CONFIG_SOC_SERIES_NRF54LX) + #define WAIT_TIMER_INSTANCE 20 +#else + #define WAIT_TIMER_INSTANCE 1 +#endif /* defined(CONFIG_SOC_SERIES_NRF54HX) */ + #define WAIT_TIMER_IRQ NRFX_CONCAT_3(TIMER, \ WAIT_TIMER_INSTANCE, \ _IRQn) @@ -59,7 +66,7 @@ int dtm_uart_wait_init(void) nrfx_err_t err; nrfx_timer_config_t timer_cfg = { .frequency = NRFX_MHZ_TO_HZ(1), - .mode = NRF_TIMER_MODE_TIMER, + .mode = NRF_TIMER_MODE_TIMER, .bit_width = NRF_TIMER_BIT_WIDTH_16, }; diff --git a/samples/bluetooth/direction_finding_central/README.rst b/samples/bluetooth/direction_finding_central/README.rst index dc34f2346e68..d96fb767d320 100644 --- a/samples/bluetooth/direction_finding_central/README.rst +++ b/samples/bluetooth/direction_finding_central/README.rst @@ -72,7 +72,7 @@ The following additional configuration files are available for the :ref:`nRF5340 Angle of departure mode ======================= -To build this sample with AoD mode only, set ``OVERLAY_CONFIG`` to the :file:`overlay-aod.conf` file. +To build this sample with AoD mode only, set ``EXTRA_CONF_FILE`` to the :file:`overlay-aod.conf` file. See :ref:`cmake_options` for instructions on how to add this option. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. diff --git a/samples/bluetooth/direction_finding_central/sample.yaml b/samples/bluetooth/direction_finding_central/sample.yaml index af2756f8d8cf..82e371d549c1 100644 --- a/samples/bluetooth/direction_finding_central/sample.yaml +++ b/samples/bluetooth/direction_finding_central/sample.yaml @@ -4,18 +4,18 @@ sample: tests: sample.bluetooth.direction_finding_central_nrf: build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp sample.bluetooth.direction_finding_central_nrf.aod: extra_args: OVERLAY_CONFIG="overlay-aod.conf" build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml index e7e482e3ea0a..0e5346c3261b 100644 --- a/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_rx/sample.yaml @@ -4,18 +4,18 @@ sample: tests: sample.bluetooth.direction_finding_connectionless_rx_nrf: build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp sample.bluetooth.direction_finding_connectionless_rx_nrf.aod: extra_args: OVERLAY_CONFIG="overlay-aod.conf" build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_connectionless_tx/README.rst b/samples/bluetooth/direction_finding_connectionless_tx/README.rst index 4a892c766f00..39ca3c08e54d 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/README.rst +++ b/samples/bluetooth/direction_finding_connectionless_tx/README.rst @@ -48,7 +48,7 @@ Configuration Angle of arrival mode ===================== -To build this sample with AoA mode only, set ``OVERLAY_CONFIG`` to the :file:`overlay-aoa.conf` file. +To build this sample with AoA mode only, set ``EXTRA_CONF_FILE`` to the :file:`overlay-aoa.conf` file. See :ref:`cmake_options` for instructions on how to add this option. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. diff --git a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml index 6c5976febff7..03212359356a 100644 --- a/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml +++ b/samples/bluetooth/direction_finding_connectionless_tx/sample.yaml @@ -4,18 +4,18 @@ sample: tests: sample.bluetooth.direction_finding_connectionless_nrf: build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp sample.bluetooth.direction_finding_connectionless_nrf.aoa: 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 integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/direction_finding_peripheral/sample.yaml b/samples/bluetooth/direction_finding_peripheral/sample.yaml index 29386d8aab7b..cb4586c00b71 100644 --- a/samples/bluetooth/direction_finding_peripheral/sample.yaml +++ b/samples/bluetooth/direction_finding_peripheral/sample.yaml @@ -4,18 +4,18 @@ sample: tests: sample.bluetooth.direction_finding_peripheral_nrf: build_only: true - platform_allow: nrf52833dk_nrf52833 nrf52833dk_nrf52820 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52833dk/nrf52820 nrf5340dk/nrf5340/cpuapp tags: bluetooth integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp sample.bluetooth.direction_finding_peripheral_nrf.aod: 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 integration_platforms: - - nrf52833dk_nrf52833 - - nrf52833dk_nrf52820 - - nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52833dk/nrf52820 + - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/enocean/sample.yaml b/samples/bluetooth/enocean/sample.yaml index ef914ec337d0..0d2161010682 100644 --- a/samples/bluetooth/enocean/sample.yaml +++ b/samples/bluetooth/enocean/sample.yaml @@ -5,7 +5,7 @@ tests: sample.bluetooth.enocean: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth ci_build diff --git a/samples/bluetooth/fast_pair/input_device/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/fast_pair/input_device/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index e1ae3a348dc7..000000000000 --- a/samples/bluetooth/fast_pair/input_device/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Workaround: -# The nRF54L15 PDK (PCA10156) revisions v0.2.0 AA0-ES2, v0.2.0 AA0-ES3, -# and v0.2.1 AB0-ES5 have Buttons 3 and 4 connected to the GPIO port -# which does not support interrupts. -CONFIG_DK_LIBRARY_BUTTON_NO_ISR=y diff --git a/samples/bluetooth/fast_pair/input_device/prj.conf b/samples/bluetooth/fast_pair/input_device/prj.conf index 179d7693c331..a2dc3505d498 100644 --- a/samples/bluetooth/fast_pair/input_device/prj.conf +++ b/samples/bluetooth/fast_pair/input_device/prj.conf @@ -42,9 +42,9 @@ CONFIG_BT_ADV_PROV_GAP_APPEARANCE_SD=y # Align the advertised TX power with Fast Pair expectations. # The value has been tailored for following DKs: -# * nrf52840dk_nrf52840 -# * nrf52dk_nrf52832 -# * nrf5340dk_nrf5340_cpuapp +# * nrf52840dk/nrf52840 +# * nrf52dk/nrf52832 +# * nrf5340dk/nrf5340/cpuapp CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-14 # Disable automatic initiation of PHY updates. diff --git a/samples/bluetooth/fast_pair/input_device/sample.yaml b/samples/bluetooth/fast_pair/input_device/sample.yaml index af51f56660c0..98d30c9e8968 100644 --- a/samples/bluetooth/fast_pair/input_device/sample.yaml +++ b/samples/bluetooth/fast_pair/input_device/sample.yaml @@ -5,23 +5,24 @@ tests: sample.bluetooth.fast_pair.input_device: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf54l15pdk_nrf54l15_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: bluetooth ci_build - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns nrf54l15pdk_nrf54l15_cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.bluetooth.fast_pair.input_device.sysbuild: build_only: true sysbuild: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf54l15pdk_nrf54l15_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns nrf54l15pdk_nrf54l15_cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp diff --git a/samples/bluetooth/hci_lpuart/README.rst b/samples/bluetooth/hci_lpuart/README.rst index de958731f7ee..02ebfc84998b 100644 --- a/samples/bluetooth/hci_lpuart/README.rst +++ b/samples/bluetooth/hci_lpuart/README.rst @@ -39,7 +39,7 @@ To program the nRF9160 development kit with the sample: 1. Set the **SW10** switch, marked as debug/prog, in the **NRF52** position. In nRF9160 DK v0.9.0 and earlier, the switch is called **SW5** -#. Build the :ref:`bluetooth-hci-lpuart-sample` sample for the ``nrf9160dk_nrf52840`` build target and program the development kit with it. +#. Build the :ref:`bluetooth-hci-lpuart-sample` sample for the ``nrf9160dk/nrf52840`` build target and program the development kit with it. Testing ======= diff --git a/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.overlay b/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.overlay index 65d206c01feb..971685d8dbd1 100644 --- a/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.overlay +++ b/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840.overlay @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include -#include +#include +#include &pinctrl { uart0_default_alt: uart0_default_alt { diff --git a/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay b/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay index 286b9b792711..f045e55acd78 100644 --- a/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay +++ b/samples/bluetooth/hci_lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay @@ -1,4 +1,4 @@ /* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ /* Use the reset line that is available starting from v0.14.0 of the DK. */ -#include +#include diff --git a/samples/bluetooth/hci_lpuart/sample.yaml b/samples/bluetooth/hci_lpuart/sample.yaml index c492602249cd..2c66af4ee80e 100644 --- a/samples/bluetooth/hci_lpuart/sample.yaml +++ b/samples/bluetooth/hci_lpuart/sample.yaml @@ -3,7 +3,7 @@ sample: name: TBD tests: sample.bluetooth.hci_lpuart: - platform_allow: nrf9160dk_nrf52840 + platform_allow: nrf9160dk/nrf52840 integration_platforms: - - nrf9160dk_nrf52840 + - nrf9160dk/nrf52840 tags: uart bluetooth diff --git a/samples/bluetooth/iso_combined_bis_and_cis/CMakeLists.txt b/samples/bluetooth/iso_combined_bis_and_cis/CMakeLists.txt new file mode 100644 index 000000000000..7488830df166 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/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(iso_time_sync) + +target_include_directories(app PRIVATE include) +target_sources(app PRIVATE src/main.c) +target_sources(app PRIVATE src/combined_bis_cis.c) +target_sources(app PRIVATE src/iso_tx.c) +target_sources(app PRIVATE src/iso_rx.c) diff --git a/samples/bluetooth/iso_combined_bis_and_cis/README.rst b/samples/bluetooth/iso_combined_bis_and_cis/README.rst new file mode 100644 index 000000000000..226d1d5a32bc --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/README.rst @@ -0,0 +1,160 @@ +.. _bluetooth_iso_combined_bis_cis: + +Bluetooth: ISO combined BIS and CIS +################################### + +.. contents:: + :local: + :depth: 2 + +The Bluetooth® ISO combined BIS and CIS sample demonstrates the capability of a Controller to support both Broadcast Isochronous Stream (BIS) and Connected Isochronous Stream (CIS) simultaneously when using the LE Isochronous Channels (ISO) feature. +It uses ISO-specific APIs to create a stream, and to receive and send data. +The sample acts as a Central device that receives data over CIS and forwards the received data to a BIS. + +.. note:: + The sample uses the Time of Arrival method to send data over ISO without using timestamps through a single stream (see the :ref:`nrfxlib:iso_providing_data` section in the SoftDevice Controller documentation for more information). + The :ref:`bluetooth_isochronous_time_synchronization` sample can be used to learn how to synchronize data using ISO channels. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +.. include:: /includes/tfm.txt + +To test the sample, you need two additional devices. +You can use any of the development kits listed above and mix different development kits. + +.. include:: /includes/hci_ipc_overlay.txt + +The sample also requires a connection to a computer with a serial terminal |ANSI| for each of the development kits. + +Overview +******** + +The sample demonstrates a device combining the CIS Central and BIS Source roles. +As a CIS Central, it only receives data from a CIS Peripheral. +The received data is then broadcasted over a BIS. +To provide the best performance and to minimize the number of conflicts between the CIS, BIS and ACL roles, the following measures are taken: + +* The same ISO interval is used for both CIS and BIS. + The value is set to 10 ms by default. +* ACL interval is set to an integer multiple of ISO interval to avoid collisions. + The value is set to 20 ms by default. +* Periodic advertising of the BIS is set to the same value as the ACL interval. +* The number of retransmissions is set to 10, to ensure that packets are retransmitted in case of collisions. +* The sample rejects incoming Connection Update requests from the peripheral to avoid changes to the ACL interval. +* The following optional Kconfig options specific to the SoftDevice Controller are used: + + * :kconfig:option:`CONFIG_BT_CTLR_SDC_CENTRAL_ACL_EVENT_SPACING_DEFAULT` is set to 10 ms to ensure that there is enough time available to place the periodic advertising packet between ACL packets. + * :kconfig:option:`CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT` is set to a small value 2.5 ms because the only data the sample sends over the ACL connection is Control procedures. + * :kconfig:option:`CONFIG_BT_CTLR_SDC_BIG_RESERVED_TIME_US` is set to half of the ISO interval to ensure the BIG parameters are selected in a way that leaves enough time for ACL and CIG. + * :kconfig:option:`CONFIG_BT_CTLR_SDC_CIG_RESERVED_TIME_US` is set to half of the ISO interval to ensure the CIG parameters are selected in a way that leaves enough time for ACL and BIG. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/bluetooth/iso_combined_bis_and_cis` + +.. include:: /includes/build_and_run_ns.txt + + +Testing +======= + +In addition to the device running this sample, two additional devices are required: + +* CIS Peripheral device that sends data over CIS. +* BIS Sink device that receives data over BIS. + +You can use other samples, such as the :ref:`bluetooth_isochronous_time_synchronization` sample, as the CIS Peripheral and BIS Sink. +The CIS Peripheral device should have the same name as the name set in the :kconfig:option:`CONFIG_BT_DEVICE_NAME` Kconfig option of this sample. +This name is used to connect to the correct device. + +After programming the sample to the development kit and programming other samples to the CIS Peripheral device and BIS sink device, perform the following steps to test it: + +1. |connect_terminal_specific| +#. Reset the kits. +#. Wait until the sample connects to CIS Peripheral device and establishes a CIS Peripheral device and established CIS connection. +#. Observe the packets transmitted by the CIS Peripheral being retransmitted over BIS and received by the BIS Sink. + + +Sample output +============= + +The serial output should look similar to the following output: + +.. code-block:: console + + [00:00:00.454,589] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) + [00:00:00.454,620] bt_hci_core: HW Variant: nRF53x (0x0003) + [00:00:00.454,650] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version ... Build ... + [00:00:00.456,329] bt_hci_core: Identity: FD:DD:D6:88:AF:D4 (random) + [00:00:00.456,359] bt_hci_core: HCI: version 5.4 (0x0d) revision ..., manufacturer 0x0059 + [00:00:00.456,390] bt_hci_core: LMP: version 5.4 (0x0d) subver ... + [00:00:00.456,390] app_main: + Bluetooth ISO Combined BIS and CIS sample + + The sample demonstrates data transfer over Bluetooth ISO + CIS and BIS using the following topology: + + ┌------┐ ┌-------┐ ┌--------┐ + | |ISO | CIS | ISO | | + | CIS ├----►|Central├-----►|BIS Sink| + |Periph|CIS |+ BIS | BIS | | + | | |Source | | | + └------┘ └-------┘ └--------┘ + (1) (2) (3) + The sample only operates as a device 2: Combined CIS Central + BIS Source + Please, use other samples as a CIS Peripheral (TX) and BIS Sink (RX) devices. + + [00:00:00.456,420] app_main: Starting combined CIS Central + BIS Source + [00:00:00.459,777] app_bis_cis: CIS central started scanning for peripheral(s) + [00:00:00.593,078] app_bis_cis: Connected: FB:DC:75:C0:18:0A (random) + [00:00:00.593,597] app_bis_cis: Connecting ISO channel + [00:00:00.600,189] app_bis_cis: BIS transmitter started + [00:00:00.607,879] app_iso_tx: ISO TX Channel connected + [00:00:00.608,459] app_iso_tx: Sent SDU, counter: 0 + [00:00:00.741,577] app_iso_rx: ISO RX Channel connected + [00:00:01.449,615] app_iso_tx: Sent SDU, counter: 100 + [00:00:01.731,140] app_iso_rx: Received SDU: 100, empty SDU: 0, missed SDU: 0 + [00:00:02.449,645] app_iso_tx: Sent SDU, counter: 200 + [00:00:02.731,140] app_iso_rx: Received SDU: 200, empty SDU: 0, missed SDU: 0 + [00:00:03.449,615] app_iso_tx: Sent SDU, counter: 300 + [00:00:03.731,140] app_iso_rx: Received SDU: 300, empty SDU: 0, missed SDU: 0 + [00:00:04.449,615] app_iso_tx: Sent SDU, counter: 400 + [00:00:04.731,140] app_iso_rx: Received SDU: 400, empty SDU: 0, missed SDU: 0 + [00:00:05.449,645] app_iso_tx: Sent SDU, counter: 500 + + +Dependencies +************ + +This sample uses the following `sdk-nrfxlib`_ library: + +* :ref:`nrfxlib:softdevice_controller` + +In addition, it uses the following Zephyr libraries: + +* :file:`include/console.h` +* :ref:`zephyr:kernel_api`: + + * :file:`include/kernel.h` + +* :file:`include/sys/printk.h` +* :file:`include/sys/ring_buffer.h` +* :file:`include/zephyr/types.h` +* :ref:`zephyr:bluetooth_api`: + + * :file:`include/bluetooth/bluetooth.h` + * :file:`include/bluetooth/iso.h` + * :file:`include/bluetooth/conn.h` + * :file:`include/bluetooth/hci.h` + * :file:`include/bluetooth/scan.h` + +References +********** + +For more information about the scheduling of different types of packets, refer to the :ref:`softdevice_controller_scheduling`. diff --git a/samples/bluetooth/iso_combined_bis_and_cis/child_image/hci_ipc.conf b/samples/bluetooth/iso_combined_bis_and_cis/child_image/hci_ipc.conf new file mode 100644 index 000000000000..2b645ac76db4 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/child_image/hci_ipc.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2021 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_BT=y +CONFIG_BT_ISO_BROADCASTER=y +CONFIG_BT_ISO_CENTRAL=y + +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 + +CONFIG_BT_ISO_MAX_CHAN=2 +CONFIG_BT_ISO_TX_BUF_COUNT=1 +CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=1 +CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=1 +CONFIG_BT_CTLR_CONN_ISO_STREAMS=1 + +CONFIG_BT_CTLR_SDC_CENTRAL_ACL_EVENT_SPACING_DEFAULT=10000 +CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=2500 +CONFIG_BT_CTLR_SDC_BIG_RESERVED_TIME_US=5000 +CONFIG_BT_CTLR_SDC_CIG_RESERVED_TIME_US=5000 diff --git a/samples/bluetooth/iso_combined_bis_and_cis/include/iso_combined_bis_and_cis.h b/samples/bluetooth/iso_combined_bis_and_cis/include/iso_combined_bis_and_cis.h new file mode 100644 index 000000000000..476056690364 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/include/iso_combined_bis_and_cis.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef ISO_COMBINED_BIS_AND_CIS_H_ +#define ISO_COMBINED_BIS_AND_CIS_H_ + +/** Type definition for a callback to set SDU data to be transmitted + * + */ +typedef void (*iso_tx_set_sdu_data_cb_t)(struct net_buf *); + +/** Type definition for a callback to process received SDU data + * + */ +typedef void (*iso_rx_process_sdu_data_cb_t)(struct net_buf *); + +/** Start combined CIS Central + BIS source + * + */ +void combined_cis_bis_start(void); + +/** Initialize RX path channel + * + * @param retransmission_number Requested retransmission number (if central) + * @param process_sdu_data_cb Callback to process received SDU + */ +void iso_rx_init(uint8_t retransmission_number, iso_rx_process_sdu_data_cb_t process_sdu_data_cb); + +/** Obtain pointer to RX channel + * + * @retval Pointer to the RX channel + */ +struct bt_iso_chan **iso_rx_channels_get(void); + +/** Initialize TX path channels + * + * @param retransmission_number Requested retransmission number (if central or broadcaster) + * @param set_sdu_data_cb Callback to set SDU data to be transmitted + */ +void iso_tx_init(uint8_t retransmission_number, iso_tx_set_sdu_data_cb_t set_sdu_data_cb); + +/** Obtain pointer to TX channel + * + * @retval Pointer to the TX channel + */ +struct bt_iso_chan **iso_tx_channels_get(void); +#endif /* ISO_COMBINED_BIS_AND_CIS_H_ */ diff --git a/samples/bluetooth/iso_combined_bis_and_cis/prj.conf b/samples/bluetooth/iso_combined_bis_and_cis/prj.conf new file mode 100644 index 000000000000..3cc708932774 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/prj.conf @@ -0,0 +1,27 @@ +CONFIG_LOG=y +CONFIG_LOG_BUFFER_SIZE=2048 + +CONFIG_ASSERT=y +CONFIG_RING_BUFFER=y + +CONFIG_BT=y +CONFIG_BT_ISO_BROADCASTER=y +CONFIG_BT_ISO_CENTRAL=y + +CONFIG_BT_DEVICE_NAME="Nordic_ISO" + +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_EXT_ADV_MAX_ADV_SET=1 +CONFIG_BT_ISO_MAX_CHAN=2 +CONFIG_BT_ISO_MAX_CIG=1 +CONFIG_BT_ISO_MAX_BIG=1 + +CONFIG_BT_ISO_TX_BUF_COUNT=1 +CONFIG_BT_ISO_RX_BUF_COUNT=1 + +CONFIG_BT_ISO_TX_MTU=5 + +CONFIG_BT_CTLR_SDC_CENTRAL_ACL_EVENT_SPACING_DEFAULT=10000 +CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=2500 +CONFIG_BT_CTLR_SDC_BIG_RESERVED_TIME_US=5000 +CONFIG_BT_CTLR_SDC_CIG_RESERVED_TIME_US=5000 diff --git a/samples/bluetooth/iso_combined_bis_and_cis/sample.yaml b/samples/bluetooth/iso_combined_bis_and_cis/sample.yaml new file mode 100644 index 000000000000..c73b21df78c9 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/sample.yaml @@ -0,0 +1,17 @@ +sample: + description: Bluetooth Low Energy combined BIS and CIS sample + name: BLE combined BIS and CIS +tests: + sample.bluetooth.iso_bis_cis: + build_only: true + integration_platforms: + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + tags: bluetooth ci_build diff --git a/samples/bluetooth/iso_combined_bis_and_cis/src/combined_bis_cis.c b/samples/bluetooth/iso_combined_bis_and_cis/src/combined_bis_cis.c new file mode 100644 index 000000000000..01dee30c6f0c --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/src/combined_bis_cis.c @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** CIS central implementation for the time sync sample + * + * This file implements a device that acts as a CIS central. + * The central can either be configured as a transmitter or a receiver. + * + * It connects to as many peripherals as it has available ISO channels. + */ + +#include +#include +#include +#include +#include + +#include "iso_combined_bis_and_cis.h" + +#include +LOG_MODULE_REGISTER(app_bis_cis, LOG_LEVEL_INF); + +#define ADV_NAME_STR_LEN (sizeof(CONFIG_BT_DEVICE_NAME)) + +#define SDU_INTERVAL_US (10000u) /* 10 ms */ +#define ACL_INTERVAL_BLE_UNITS (16u) /* 20 ms in 1.25 ms BLE units*/ +#define PERIODIC_ADV_INTERVAL_BLE_UNITS (16u) /* 20 ms in 1.25 ms BLE units*/ +#define RETRANSMISSION_NUMBER (10u) +#define MAX_TRANSPORT_LATENCY_MS (20u) +#define SDU_RING_BUFFER_SIZE (4u) + +/* Ring buffer contains length of SDU before each SDU, so allocate 1 additional byte */ +#define RING_BUF_ELEMENT_SIZE (1 + CONFIG_BT_ISO_TX_MTU) +RING_BUF_DECLARE(sdu_rb, SDU_RING_BUFFER_SIZE * (RING_BUF_ELEMENT_SIZE)); +static uint8_t rcvd_sdu_cnt; + +static void scan_start(void) +{ + int err; + + err = bt_le_scan_start( + BT_LE_SCAN_PARAM(BT_LE_SCAN_TYPE_ACTIVE, BT_LE_SCAN_OPT_FILTER_DUPLICATE, + BT_GAP_SCAN_FAST_INTERVAL, BT_GAP_SCAN_FAST_INTERVAL), + NULL); + if (err) { + LOG_ERR("Scanning failed to start (err %d)", err); + return; + } +} + +static struct bt_iso_chan *free_iso_chan_get(void) +{ + struct bt_iso_chan **iso_channels; + + iso_channels = iso_rx_channels_get(); + + struct bt_iso_chan *iso_chan = NULL; + + if (iso_channels[0]->state == BT_ISO_STATE_DISCONNECTED) { + iso_chan = iso_channels[0]; + } + + return iso_chan; +} + +static bool adv_data_parse_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, ADV_NAME_STR_LEN - 1); + memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_simple *buf) +{ + char name_str[ADV_NAME_STR_LEN] = {0}; + + bt_data_parse(buf, adv_data_parse_cb, name_str); + + if (strncmp(name_str, CONFIG_BT_DEVICE_NAME, ADV_NAME_STR_LEN) != 0) { + return; + } + + if (bt_le_scan_stop()) { + return; + } + + const struct bt_le_conn_param *conn_param = + BT_LE_CONN_PARAM(ACL_INTERVAL_BLE_UNITS, ACL_INTERVAL_BLE_UNITS, 0, 400); + + struct bt_conn *conn; + int err = bt_conn_le_create(info->addr, BT_CONN_LE_CREATE_CONN, conn_param, &conn); + + if (err) { + LOG_ERR("Create conn to %s failed (%d)", name_str, err); + } +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; + +static void process_rcvd_sdu_cb(struct net_buf *buf) +{ + uint8_t sdu_buffer[CONFIG_BT_ISO_TX_MTU]; + uint8_t sdu_len = (uint8_t)buf->len; + + memcpy(sdu_buffer, buf->data, sdu_len); + + /* write length of SDU to ring-buffer */ + uint32_t wrote = ring_buf_put(&sdu_rb, &sdu_len, 1); + + __ASSERT_NO_MSG(wrote == 1); + /* write SDU content to ring-buffer */ + wrote = ring_buf_put(&sdu_rb, sdu_buffer, sdu_len); + __ASSERT_NO_MSG(wrote == sdu_len); + if (rcvd_sdu_cnt < SDU_RING_BUFFER_SIZE) + rcvd_sdu_cnt++; +} + +static void set_sdu_data_cb(struct net_buf *buf) +{ + /* Start forwarding data when ring buffer is full. + * It is needed to avoid possible packets loss due to + * transport latency of CIS stream + */ + if (rcvd_sdu_cnt >= SDU_RING_BUFFER_SIZE) { + uint8_t sdu_len; + uint8_t sdu_buffer[CONFIG_BT_ISO_TX_MTU]; + + /* read length of SDU from ring-buffer */ + ring_buf_get(&sdu_rb, &sdu_len, 1); + /* read SDU content from ring-buffer */ + ring_buf_get(&sdu_rb, sdu_buffer, sdu_len); + memcpy(buf->data, sdu_buffer, sdu_len); + buf->len = sdu_len; + } +} + +void bis_transmitter_start(void) +{ + int err; + struct bt_le_ext_adv *adv; + struct bt_iso_big *big; + + /* Create a non-connectable non-scannable advertising set */ + err = bt_le_ext_adv_create(BT_LE_EXT_ADV_NCONN_NAME, NULL, &adv); + if (err) { + LOG_INF("Failed to create advertising set (err %d)", err); + return; + } + + /* Set periodic advertising parameters */ + err = bt_le_per_adv_set_param(adv, BT_LE_PER_ADV_PARAM(PERIODIC_ADV_INTERVAL_BLE_UNITS, + PERIODIC_ADV_INTERVAL_BLE_UNITS, + BT_LE_PER_ADV_OPT_NONE)); + if (err) { + LOG_INF("Failed to set periodic advertising parameters" + " (err %d)", + err); + return; + } + + /* Start extended advertising */ + err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); + if (err) { + LOG_INF("Failed to start extended advertising (err %d)", err); + return; + } + + /* Enable Periodic Advertising */ + err = bt_le_per_adv_start(adv); + if (err) { + LOG_INF("Failed to enable periodic advertising (err %d)", err); + return; + } + + struct bt_iso_big_create_param big_create_param = { + .num_bis = 1, + .bis_channels = iso_tx_channels_get(), + .interval = SDU_INTERVAL_US, + .latency = MAX_TRANSPORT_LATENCY_MS, + .packing = 0, /* 0 - sequential, 1 - interleaved */ + .framing = 0, /* 0 - unframed, 1 - framed */ + }; + + /* Create BIG */ + err = bt_iso_big_create(adv, &big_create_param, &big); + if (err) { + LOG_INF("Failed to create BIG (err %d)", err); + return; + } + + LOG_INF("BIS transmitter started"); +} + +static void connected(struct bt_conn *conn, uint8_t err) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + if (err) { + LOG_INF("Failed to connect to %s (%u)", addr, err); + + bt_conn_unref(conn); + + scan_start(); + return; + } + + LOG_INF("Connected: %s", addr); + + /* Find a free ISO channel */ + struct bt_iso_chan *iso_chan = free_iso_chan_get(); + + if (iso_chan == NULL) { + LOG_INF("No ISO channel available"); + return; + } + + struct bt_iso_connect_param connect_param; + + connect_param.acl = conn; + connect_param.iso_chan = iso_chan; + + LOG_INF("Connecting ISO channel"); + err = bt_iso_chan_connect(&connect_param, 1); + if (err) { + LOG_ERR("Failed to connect iso (%d)", err); + return; + } + + bis_transmitter_start(); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + LOG_INF("Disconnected: %s (reason 0x%02x)", addr, reason); + + bt_conn_unref(conn); + + scan_start(); +} + +/* Always reject connection parameter update requests in order to keep ACL interval aligned with CIS + * and BIS ISO-interval + */ +static bool le_param_req_reject(struct bt_conn *conn, struct bt_le_conn_param *param) +{ + return false; +} + +static struct bt_conn_cb conn_callbacks = { + .connected = connected, + .disconnected = disconnected, + .le_param_req = le_param_req_reject, +}; + +void combined_cis_bis_start(void) +{ + struct bt_iso_cig_param param; + struct bt_iso_cig *cig; + int err; + + iso_rx_init(RETRANSMISSION_NUMBER, process_rcvd_sdu_cb); + iso_tx_init(RETRANSMISSION_NUMBER, set_sdu_data_cb); + + bt_le_scan_cb_register(&scan_callbacks); + bt_conn_cb_register(&conn_callbacks); + + memset(¶m, 0, sizeof(param)); + param.cis_channels = iso_rx_channels_get(); + param.num_cis = 1; + param.sca = BT_GAP_SCA_UNKNOWN; + param.packing = 0; + param.framing = 0; + param.c_to_p_latency = MAX_TRANSPORT_LATENCY_MS; + param.p_to_c_latency = MAX_TRANSPORT_LATENCY_MS; + param.c_to_p_interval = SDU_INTERVAL_US; + param.p_to_c_interval = SDU_INTERVAL_US; + + err = bt_iso_cig_create(¶m, &cig); + if (err != 0) { + LOG_ERR("Failed to create CIG (%d)", err); + return; + } + + scan_start(); + + LOG_INF("CIS central started scanning for peripheral(s)"); +} diff --git a/samples/bluetooth/iso_combined_bis_and_cis/src/iso_rx.c b/samples/bluetooth/iso_combined_bis_and_cis/src/iso_rx.c new file mode 100644 index 000000000000..d44e2b791fe4 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/src/iso_rx.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + +#include +#include +#include +#include "iso_combined_bis_and_cis.h" + +#include +LOG_MODULE_REGISTER(app_iso_rx, LOG_LEVEL_INF); + +static iso_rx_process_sdu_data_cb_t process_rcvd_sdu; + +static uint32_t rcvd_sdu_cnt; +static uint32_t missed_sdu_cnt; +static uint32_t empty_sdu_cnt; + +static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, + struct net_buf *buf); +static void iso_connected(struct bt_iso_chan *chan); +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason); + +static struct bt_iso_chan_ops iso_ops = { + .recv = iso_recv, + .connected = iso_connected, + .disconnected = iso_disconnected, +}; + +static struct bt_iso_chan_io_qos iso_rx_qos = { + .sdu = CONFIG_BT_ISO_TX_MTU, + .phy = BT_GAP_LE_PHY_2M, +}; + +static struct bt_iso_chan_qos iso_qos = { + .rx = &iso_rx_qos, +}; + +static struct bt_iso_chan iso_chan[] = { + { + .ops = &iso_ops, + .qos = &iso_qos, + }, +}; + +static struct bt_iso_chan *iso_channels[] = { + &iso_chan[0], +}; + +static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, + struct net_buf *buf) +{ + if (info->flags & BT_ISO_FLAGS_VALID) { + if (process_rcvd_sdu) { + process_rcvd_sdu(buf); + } + rcvd_sdu_cnt++; + if (buf->len == 0) { + empty_sdu_cnt++; + } + } else { + missed_sdu_cnt++; + } + + uint32_t total_sdu_count = rcvd_sdu_cnt + missed_sdu_cnt; + + if (total_sdu_count % 100 == 0) { + LOG_INF("Received SDU: %d, empty SDU: %d, missed SDU: %d", rcvd_sdu_cnt, + empty_sdu_cnt, missed_sdu_cnt); + } +} + +static void iso_connected(struct bt_iso_chan *chan) +{ + int err; + struct bt_conn_info conn_info; + struct bt_iso_info iso_info; + + err = bt_iso_chan_get_info(chan, &iso_info); + if (err) { + LOG_ERR("Failed obtaining ISO info"); + return; + } + + err = bt_conn_get_info(chan->iso, &conn_info); + if (err) { + LOG_ERR("Failed obtaining conn info"); + return; + } + + LOG_INF("ISO RX Channel connected"); +} + +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) +{ + LOG_INF("ISO Channel disconnected with reason 0x%02x", reason); +} + +void iso_rx_init(uint8_t retransmission_number, iso_rx_process_sdu_data_cb_t process_sdu_data_cb) +{ + iso_rx_qos.rtn = retransmission_number; + process_rcvd_sdu = process_sdu_data_cb; +} + +struct bt_iso_chan **iso_rx_channels_get(void) +{ + return iso_channels; +} diff --git a/samples/bluetooth/iso_combined_bis_and_cis/src/iso_tx.c b/samples/bluetooth/iso_combined_bis_and_cis/src/iso_tx.c new file mode 100644 index 000000000000..7f4526edddf0 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/src/iso_tx.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#include "iso_combined_bis_and_cis.h" + +#include +LOG_MODULE_REGISTER(app_iso_tx, LOG_LEVEL_INF); + +static void iso_sent(struct bt_iso_chan *chan); +static void iso_connected(struct bt_iso_chan *chan); +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason); + +NET_BUF_POOL_FIXED_DEFINE(tx_pool, 1, BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), + CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); + +static uint32_t num_sdus_sent; +static iso_tx_set_sdu_data_cb_t set_sdu_data; + +static struct bt_iso_chan_ops iso_ops = { + .connected = iso_connected, + .sent = iso_sent, + .disconnected = iso_disconnected, +}; + +static struct bt_iso_chan_io_qos iso_tx_qos = { + .sdu = CONFIG_BT_ISO_TX_MTU, + .phy = BT_GAP_LE_PHY_2M, +}; + +static struct bt_iso_chan_qos iso_qos = { + .tx = &iso_tx_qos, +}; + +/* Create lists of ISO channels and pointers to ISO channels. */ +static struct bt_iso_chan iso_channels[] = {{.ops = &iso_ops, .qos = &iso_qos}}; + +static struct bt_iso_chan *iso_channel_pointers[] = {&iso_channels[0]}; + +/* Store info about the ISO channels in use. */ +static uint8_t roles[1]; +static struct bt_iso_info iso_infos[1]; + +static int send_next_sdu(struct bt_iso_chan *chan) +{ + struct net_buf *buf; + int ret = 0; + + buf = net_buf_alloc(&tx_pool, K_FOREVER); + if (!buf) { + LOG_ERR("Data buffer allocate timeout"); + ret = -ENOMEM; + } + + if (set_sdu_data && !ret) { + net_buf_reserve(buf, BT_ISO_CHAN_SEND_RESERVE); + set_sdu_data(buf); + ret = bt_iso_chan_send(chan, buf, 0); + if (ret < 0) { + LOG_ERR("Unable to send data"); + net_buf_unref(buf); + } + } + + return ret; +} + +static void send_next_sdu_on_a_channel(void) +{ + int err; + + if (iso_channels[0].state != BT_ISO_STATE_CONNECTED) { + LOG_ERR("Failed sending SDU, stream is not connected"); + return; + } + + err = send_next_sdu(&iso_channels[0]); + if (err) { + LOG_ERR("Failed sending SDU, counter %d", num_sdus_sent); + return; + } +} + +static void iso_connected(struct bt_iso_chan *chan) +{ + int err; + struct bt_conn_info conn_info; + uint8_t chan_index = ARRAY_INDEX(iso_channels, chan); + + err = bt_iso_chan_get_info(chan, &iso_infos[chan_index]); + if (err) { + LOG_ERR("Failed obtaining ISO info"); + return; + } + + err = bt_conn_get_info(chan->iso, &conn_info); + if (err) { + LOG_ERR("Failed obtaining conn info"); + return; + } + + roles[chan_index] = conn_info.role; + + /* Send the first SDU immediately. + */ + send_next_sdu_on_a_channel(); + LOG_INF("ISO TX Channel connected"); +} + +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) +{ + LOG_INF("ISO Channel index %d disconnected with reason 0x%02x", + ARRAY_INDEX(iso_channels, chan), reason); +} + +static void iso_sent(struct bt_iso_chan *chan) +{ + if (num_sdus_sent % 100 == 0) { + LOG_INF("Sent SDU, counter: %d", num_sdus_sent); + } + + num_sdus_sent++; + + send_next_sdu_on_a_channel(); +} + +void iso_tx_init(uint8_t retransmission_number, iso_tx_set_sdu_data_cb_t set_sdu_data_cb) +{ + iso_tx_qos.rtn = retransmission_number; + set_sdu_data = set_sdu_data_cb; +} + +struct bt_iso_chan **iso_tx_channels_get(void) +{ + return iso_channel_pointers; +} diff --git a/samples/bluetooth/iso_combined_bis_and_cis/src/main.c b/samples/bluetooth/iso_combined_bis_and_cis/src/main.c new file mode 100644 index 000000000000..2ebb96d19227 --- /dev/null +++ b/samples/bluetooth/iso_combined_bis_and_cis/src/main.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include "iso_combined_bis_and_cis.h" + +#include +LOG_MODULE_REGISTER(app_main, LOG_LEVEL_INF); + +void print_intro(void) +{ + LOG_INF("\r\nBluetooth ISO Combined BIS and CIS sample\r\n\r\n" + "The sample demonstrates data transfer over Bluetooth ISO\r\n" + "CIS and BIS using the following topology:\r\n\r\n" + "┌------┐ ┌-------┐ ┌--------┐\r\n" + "| |ISO | CIS | ISO | |\r\n" + "| CIS ├----►|Central├-----►|BIS Sink|\r\n" + "|Periph|CIS |+ BIS | BIS | |\r\n" + "| | |Source | | |\r\n" + "└------┘ └-------┘ └--------┘\r\n" + " (1) (2) (3) \r\n" + "The sample only operates as a device 2: Combined CIS Central + BIS Source\r\n" + "Please, use other samples as a CIS Peripheral (TX) and BIS Sink (RX) " + "devices.\r\n\r\n"); +} + +int main(void) +{ + int err; + + /* Initialize the Bluetooth Subsystem */ + err = bt_enable(NULL); + if (err) { + LOG_ERR("Bluetooth init failed (err %d)", err); + return 0; + } + + print_intro(); + + LOG_INF("Starting combined CIS Central + BIS Source"); + combined_cis_bis_start(); + + return 0; +} diff --git a/samples/bluetooth/iso_time_sync/CMakeLists.txt b/samples/bluetooth/iso_time_sync/CMakeLists.txt new file mode 100644 index 000000000000..9f3b7529cdcc --- /dev/null +++ b/samples/bluetooth/iso_time_sync/CMakeLists.txt @@ -0,0 +1,46 @@ +# +# 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(iso_time_sync) + +target_include_directories(app PRIVATE include) +target_sources(app PRIVATE src/main.c src/timed_led_toggle.c) + +if (CONFIG_BT_ISO_BROADCASTER) + target_sources(app PRIVATE src/bis_transmitter.c) +endif() + +if (CONFIG_BT_ISO_SYNC_RECEIVER) + target_sources(app PRIVATE src/bis_receiver.c) +endif() + +if (CONFIG_BT_ISO_CENTRAL) + target_sources(app PRIVATE src/cis_central.c) +endif() + +if (CONFIG_BT_ISO_PERIPHERAL) + target_sources(app PRIVATE src/cis_peripheral.c) +endif() + +if (CONFIG_BT_ISO_TX_BUF_COUNT) + target_sources(app PRIVATE src/iso_tx.c) +endif() + +if (CONFIG_BT_ISO_RX_BUF_COUNT) + target_sources(app PRIVATE src/iso_rx.c) +endif() + +if (CONFIG_SOC_COMPATIBLE_NRF52X) + target_sources(app PRIVATE src/controller_time_nrf52.c) +elseif (CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP) + target_sources(app PRIVATE src/controller_time_nrf53_app.c) +elseif (CONFIG_SOC_SERIES_NRF54LX) + target_sources(app PRIVATE src/controller_time_nrf54l.c) +else() + MESSAGE(FATAL_ERROR "Unsupported series") +endif() diff --git a/samples/bluetooth/iso_time_sync/Kconfig b/samples/bluetooth/iso_time_sync/Kconfig new file mode 100644 index 000000000000..f87867dc907c --- /dev/null +++ b/samples/bluetooth/iso_time_sync/Kconfig @@ -0,0 +1,37 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "Bluetooth ISO time sync sample" + +config SDU_INTERVAL_US + int "SDU interval to be used in microseconds" + default 10000 + help + The SDU interval determines how often the button + value will be transmitted to the receiving devices. + +config TIMED_LED_PRESENTATION_DELAY_US + int "The delay of presenting the new value of the LED" + default 5000 + help + The presentation delay of the LED represents the time + from the SDU synchronization reference until the value + is applied. + The application needs to ensure it can process the + received SDU within this amount of time. + The end-to-end latency will be at least the sum + of the configured transport latency and presentation delay + +config LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE + bool "Enable immediate LED toggling upon sending or receiving data" + help + Enable immediate toggling of LED2 when isochronous + data is sent or received. This allows for measurment + of the mimimum end-to-end latency. + +endmenu + +source "Kconfig.zephyr" diff --git a/samples/bluetooth/iso_time_sync/README.rst b/samples/bluetooth/iso_time_sync/README.rst new file mode 100644 index 000000000000..d8c25e8dee03 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/README.rst @@ -0,0 +1,397 @@ +.. _bluetooth_isochronous_time_synchronization: + +Bluetooth: ISO time synchronization +################################### + +.. contents:: + :local: + :depth: 2 + +The Bluetooth® isochronous time synchronization sample showcases time-synchronized processing of isochronous data. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +The sample also supports other development kits running SoftDevice Controller variants that support isochronous channels (see :ref:`SoftDevice Controller feature support `). +To demonstrate time synchronization between the transmitter and a receiver, you need two development kits. +To demonstrate time synchronization between the transmitter and multiple receivers, you need at least three development kits. +You can use any combination of the development kits mentioned above, mixing different development kits. + +Additionally, the sample requires a connection to a computer with a serial terminal for each development kit in use. + +To observe the toggling of the LEDs, use a logic analyzer or an oscilloscope. + +Overview +******** + +The sample demonstrates the following features: + + * How to send isochronous data on multiple streams so that the receiving devices and the sending device can process the data at the same time. + * How the receivers of the isochronous data can process the received data synchronously. + * How to provide the isochronous data to the controller right before it is sent on-air. + * How to achieve this for either broadcast (BIS) or over connections (CIS). + +This sample configures a single device as a transmitter of its **BUTTON1** state. +The transmitting and receiving devices toggle **LED1** synchronously with the accuracy of a few microseconds. +When the :ref:`CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE ` Kconfig option is enabled, **LED2** is toggled upon sending or receiving data. +This allows you to measure the minimal end-to-end latency. + +.. note:: + This sample requires less hardware resources when it is run on an nRF54L Series device compared to the nRF52 or nRF53 Series devices. + On an nRF54L Series device, only one GRTC channel and PPI channel is needed to set up accurate toggling of an LED. + On nRF52 and nRF53 Series devices, you also need one RTC peripheral, one TIMER peripheral, one EGU channel, three PPI channels, and one PPI group. + +Configuration +************* + +|config| + +Configuration options +===================== + +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 **LED2** when isochronous data is sent or received. + It allows for measurement of the minimum end-to-end latency. + +.. _CONFIG_SDU_INTERVAL_US: + +CONFIG_SDU_INTERVAL_US + This configuration option determines how often the button value is transmitted to the receiving devices. + +.. _CONFIG_TIMED_LED_PRESENTATION_DELAY_US: + +CONFIG_TIMED_LED_PRESENTATION_DELAY_US + This configuration option represents the time from the SDU synchronization reference until the value is applied. + The application needs to ensure it can process the received SDU within this amount of time. + The end-to-end latency will be at least the sum of the configured transport latency and presentation delay. + +Isochronous channels +******************** + +The Bluetooth LE Isochronous Channels feature is a way of using Bluetooth LE to transfer time-bounded data between devices. +It provides a mechanism that makes sure that multiple sink devices, receiving data from the same source, render it at the same time. +Data has a time-limited validity period, at the end of which it is said to expire. +Expired data that has not yet been transmitted, will be discarded. +This means that receiver devices only ever receive data that is valid with respect to rules regarding its age and acceptable latency. + +The key concepts of isochronous channels are the following: + +Topology + Isochronous channels can either be used for one-to-many (Broadcast) or one-to-one (Connected). + For both topologies, data may be processed simultaneously or time-synchronized on all transmitting and receiving devices. + Connected isochronous streams can either transfer data from central to peripheral, peripheral to central, or in both directions. + +SDU interval and size + The SDU interval specifies how often a service data unit (SDU) is transferred. + The SDU interval and size as well as the number of streams are limited by the bandwidth of the link layer. + In this sample, the SDU interval is configured with the :ref:`CONFIG_SDU_INTERVAL_US ` Kconfig option. + +Maximum transport latency and retransmission count + Upon setting up an isochronous stream as a central or a broadcaster, the application provides a maximum transport latency and retransmission count. + The Bluetooth controller uses the provided parameters to select link layer parameters that satisfy these constraints. + This involves selecting an isochronous interval, PDU sizes, and isochronous parameters, such as burst number (BN), number of subevents (NSE), and flush timeout (FT) or pretransmission offset (PTO). + For more details about how the SoftDevice Controller selects these parameters, see :ref:`Parameter selection `. + +Presentation delay + The receiver(s) of isochronous data may receive their data at different points in time, but need to render or present it synchronously. + Presentation delay represents the amount of time that is added to the received timestamp to obtain the presentation time of the data. + In this sample, the presentation delay is configured with the :ref:`CONFIG_TIMED_LED_PRESENTATION_DELAY_US ` Kconfig option. + +For more details about this feature, see `Bluetooth Core Specification Version 5.2 Feature Overview `_. + +This sample demonstrates the following: + +* Any of the possible isochronous topologies with unidirectional data transfer. + The topology is selected when the application starts. +* The transmitter of the data sends it over all configured and connected streams. + The number of streams is configured with the :kconfig:option:`CONFIG_BT_ISO_MAX_CHAN` Kconfig option. +* The receiver of the isochronous data receives data from one transmitter only. +* The maximum transport latency and retransmission count is configured when the application starts. + +Sample structure +**************** + +The sample code is divided into multiple source files, which makes it easier to compile in or out certain functionalities. + +``main.c`` + The main entry point of the sample allows you to select the role and parameters to be used. + +``bis_transmitter.c`` + This file implements a device that sets up a BIS transmitter with a configured number of streams. + That is: + + 1. Configure and start an extended advertiser. + The extended advertiser data contains the device name. + #. Configure and start a periodic advertiser. + #. Configure and start a broadcast isochronous group (BIG). + +``bis_receiver.c`` + This file implements a device that syncs to a BIS broadcaster with a given BIS index. + + 1. Scan for extended advertisers containing the device name. + #. Synchronize to the corresponding periodic advertiser. + #. Synchronize to the selected BIS. + + When the ISO channel is disconnected, it tries to sync to it again. + +``cis_central.c`` + This file implements a device that acts as a CIS central. + The central can be configured either as a transmitter or a receiver. + + 1. Configure a connected isochronous group (CIG). + #. Scan and connect to a device that contains the device name. + #. Set up a CIS to the connected device. + #. Continue to scanning for more peripherals, if there are more available isochronous streams. + +``cis_peripheral.c`` + This file implements a device that acts as a CIS peripheral. + The peripheral can be configured either as a transmitter or a receiver. + + 1. Set up an isochronous server so that it can later on accept the setup or a CIS. + #. Start advertising its device name. + #. Once a device has connected, accept the incoming CIS request. + +``iso_rx.c`` + This file handles receiving of isochronous data. + Once an isochronous stream is connected, the isochronous parameters are printed. + + 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, **LED2** 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 **LED1** :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`` + This file handles time-synchronized transmitting of isochronous data on all established streams. + Each SDU contains a counter and the current value of **BUTTON1**. + The implementation ensures the following: + + * The SDU is transmitted right before it is supposed to be sent on air. + This is achieved by setting up a timer to trigger right before the next TX timestamp. + * 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. + * **LED1** is configured to toggle synchronously with the **LED1** 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, **LED2** is toggled right before sending the SDU. + You can use this to observe the end-to-end latency. + +``timed_led_toggle.c`` + This file implements timed toggling a LED. + The ``GPIOTE`` peripheral is used together with ``PPI`` to achieve accurate timing. + +``controller_time_.c`` + The SDU timestamps sent to and received from the controller are based upon the controller clock. + These files allow the application to read the current timestamp and set up a PPI trigger at a given point in time. + + The implementation for nRF52 and nRF53 Series devices is implemented by shadowing an RTC peripheral combined with a timer peripheral. + The implementation for nRF54L Series devices uses the GRTC and is simpler to use. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/bluetooth/iso_time_sync` + +.. include:: /includes/build_and_run.txt + +Testing +******* + +The sample can demonstrate broadcast isochronous streams or connected isochronous streams. + +Testing broadcast isochronous streams +===================================== + +After programming the sample to the development kits, perform the following steps to test it: + +1. |connect_terminal_specific| +#. Reset the kits. +#. Configure one of the devices as an isochronous broadcaster by typing either ``b`` or ``c`` in the terminal emulator. +#. Configure the number of retransmissions and maximum transport latency. +#. Observe that the broadcaster starts and begins to transmit SDUs. +#. On the other terminal(s), type ``r`` to configure the device(s) as receivers of the broadcast isochronous stream. +#. Select which BIS the receiver should synchronize to. +#. Observe that the device(s) synchronize to the broadcaster and start receiving isochronous data. +#. Press **BUTTON1** on the broadcaster. +#. Observe that **LED1** toggles on both the broadcaster and the receivers. + +Testing connected isochronous streams +===================================== + +After programming the sample to the development kits, perform the following steps to test it: + +1. |connect_terminal_specific| +#. Reset the kits. +#. Configure one of the devices as a connected isochronous stream central by typing ``c`` in the terminal emulator. +#. Configure the number of retransmissions and the maximum transport latency. +#. Select data direction. + If the central is configured for transmission, it connects to multiple peripherals. +#. On the other terminal(s), type ``p`` to configure the device(s) as connected isochronous stream peripheral(s). +#. Select data direction. +#. Observe that the peripheral(s) connect to the central and start receiving isochronous data. +#. Press **BUTTON1** on the central device. +#. Observe that **LED1** toggles on both the central and peripheral devices. + +Observe time-synchronized ISO data processing +============================================= + +When you press **BUTTON1** on the transmitting device, you can observe that **LED1** toggles simultaneously on all devices. +To observe the accurate toggling, use a logic analyzer or an oscilloscope. + +Sample output +************* + +The result should look similar to the following output: + +* For the isochronous broadcaster:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : b + Choose retransmission number [0..30] : 2 + Choose max transport latency in ms [5..4000] : 20 + Starting BIS transmitter with BIS indices [1..4], RTN: 2, max transport latency 20 ms + BIS transmitter started + ISO channel index 0 connected: interval: 10 ms, NSE: 3, BN: 1, IRC: 2, PTO: 1, transport latency: 12418 us + ISO channel index 1 connected: interval: 10 ms, NSE: 3, BN: 1, IRC: 2, PTO: 1, transport latency: 12418 us + ISO channel index 2 connected: interval: 10 ms, NSE: 3, BN: 1, IRC: 2, PTO: 1, transport latency: 12418 us + Sent SDU counter 0 with timestamp 2329536 us, controller_time 2330444 us, btn_val: 0 LED will be set in 16510 us + ISO channel index 3 connected: interval: 10 ms, NSE: 3, BN: 1, IRC: 2, PTO: 1, transport latency: 12418 us + Sent SDU counter 100 with timestamp 3329536 us, controller_time 3331085 us, btn_val: 0 LED will be set in 15869 us + Sent SDU counter 200 with timestamp 4329536 us, controller_time 4331085 us, btn_val: 0 LED will be set in 15869 us + Sent SDU counter 300 with timestamp 5329536 us, controller_time 5331085 us, btn_val: 0 LED will be set in 15869 us + Sent SDU counter 400 with timestamp 6329536 us, controller_time 6331085 us, btn_val: 0 LED will be set in 15869 us + Sent SDU counter 500 with timestamp 7329536 us, controller_time 7331085 us, btn_val: 0 LED will be set in 15869 us + +* For the isochronous broadcast receiver:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : r + Choose bis index [1..31] : 2 + Starting BIS receiver, BIS index 2 + Scanning for periodic advertiser + Waiting for BigInfo + Synced to periodic advertiser + BigInfo received + Syncing to BIG index 2 + ISO Channel connected: interval: 10 ms, NSE: 3, BN: 1, IRC: 2, PTO: 1, transport latency: 12418 us + Recv SDU counter 1000 with timestamp 11851325 us, controller_time 11839813 us, btn_val: 0, LED will be set in 16512 us + Recv SDU counter 1100 with timestamp 12851327 us, controller_time 12839813 us, btn_val: 0, LED will be set in 16514 us + Recv SDU counter 1200 with timestamp 13851331 us, controller_time 13839813 us, btn_val: 0, LED will be set in 16518 us + Recv SDU counter 1300 with timestamp 14851334 us, controller_time 14839813 us, btn_val: 0, LED will be set in 16521 us + Recv SDU counter 1400 with timestamp 15851337 us, controller_time 15839813 us, btn_val: 0, LED will be set in 16524 us + Recv SDU counter 1500 with timestamp 16851342 us, controller_time 16839843 us, btn_val: 0, LED will be set in 16499 us + + +* For the connected isochronous stream central configured for transmission:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : c + Choose direction - TX (t) / RX (r) : t + Choose retransmission number [0..30] : 3 + Choose max transport latency in ms [5..4000] : 20 + Starting CIS central, dir: tx, RTN: 3, max transport latency 20 ms + CIS central started scanning for peripheral(s) + Connected: FA:BB:79:57:D6:45 (random) + Connecting ISO channel + ISO channel index 0 connected: interval: 10 ms, NSE: 2, BN: 1, FT: 2, transport latency: 13536 us + CIS Central started scanning + Sent SDU counter 0 with timestamp 3072152 us, controller_time 3070617 us, btn_val: 0 LED will be set in 20071 us + Connected: D2:52:1C:B7:DC:2A (random) + Connecting ISO channel + ISO channel index 1 connected: interval: 10 ms, NSE: 2, BN: 1, FT: 2, transport latency: 13536 us + CIS Central started scanning + Sent SDU counter 100 with timestamp 4072152 us, controller_time 4072753 us, btn_val: 0 LED will be set in 17935 us + Sent SDU counter 200 with timestamp 5072152 us, controller_time 5072631 us, btn_val: 0 LED will be set in 18057 us + Sent SDU counter 300 with timestamp 6072152 us, controller_time 6072784 us, btn_val: 0 LED will be set in 17904 us + Sent SDU counter 400 with timestamp 7072152 us, controller_time 7072631 us, btn_val: 0 LED will be set in 18057 us + Sent SDU counter 500 with timestamp 8072152 us, controller_time 8072937 us, btn_val: 0 LED will be set in 17751 us + +* For the connected isochronous stream peripheral configured for reception:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : p + Choose direction - TX (t) / RX (r) : r + Starting CIS peripheral, dir: rx + CIS peripheral started advertising + Connected: E8:DC:8D:B3:47:69 (random) + Incoming request from 0x20002440 + ISO Channel connected: interval: 10 ms, NSE: 2, BN: 1, FT: 2, transport latency: 13696 us + Recv SDU counter 100 with timestamp 3584552 us, controller_time 3573333 us, btn_val: 0, LED will be set in 16219 us + Recv SDU counter 200 with timestamp 4584555 us, controller_time 4573333 us, btn_val: 0, LED will be set in 16222 us + Recv SDU counter 300 with timestamp 5584559 us, controller_time 5573333 us, btn_val: 0, LED will be set in 16226 us + Recv SDU counter 400 with timestamp 6584562 us, controller_time 6573333 us, btn_val: 0, LED will be set in 16229 us + Recv SDU counter 500 with timestamp 7584567 us, controller_time 7573760 us, btn_val: 0, LED will be set in 15807 us + +* For the connected isochronous stream central configured for reception:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : c + Choose direction - TX (t) / RX (r) : r + Choose retransmission number [0..30] : 3 + Choose max transport latency in ms [5..4000] : 20 + Starting CIS peripheral, dir: rx, RTN: 3, max transport latency 20 ms + CIS central started scanning for peripheral(s) + Connected: FA:BB:79:57:D6:45 (random) + Connecting ISO channel + ISO Channel connected: interval: 10 ms, NSE: 2, BN: 1, FT: 2, transport latency: 10884 us + Recv SDU counter 0 with timestamp 2144246 us, controller_time 2144897 us, btn_val: 0, LED will be set in 4349 us + Recv SDU counter 100 with timestamp 3144246 us, controller_time 3144897 us, btn_val: 0, LED will be set in 4349 us + Recv SDU counter 200 with timestamp 4144246 us, controller_time 4144897 us, btn_val: 0, LED will be set in 4349 us + Recv SDU counter 300 with timestamp 5144246 us, controller_time 5144897 us, btn_val: 0, LED will be set in 4349 us + Recv SDU counter 400 with timestamp 6144246 us, controller_time 6144897 us, btn_val: 0, LED will be set in 4349 us + Recv SDU counter 500 with timestamp 7144246 us, controller_time 7144897 us, btn_val: 0, LED will be set in 4349 us + +* For the connected isochronous stream peripheral configured for transmission:: + + Bluetooth ISO Time Sync Demo + Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / bis_receiver (r) : p + Choose direction - TX (t) / RX (r) : t + Starting CIS peripheral, dir: tx + CIS peripheral started advertising + Connected: E8:DC:8D:B3:47:69 (random) + Incoming request from 0x20002440 + ISO channel index 0 connected: interval: 10 ms, NSE: 2, BN: 1, FT: 2, transport latency: 10884 us + Sent SDU counter 0 with timestamp 2649643 us, controller_time 2640289 us, btn_val: 0 LED will be set in 14354 us + Sent SDU counter 100 with timestamp 3649638 us, controller_time 3649627 us, btn_val: 0 LED will be set in 5011 us + Sent SDU counter 200 with timestamp 4649635 us, controller_time 4649627 us, btn_val: 0 LED will be set in 5008 us + Sent SDU counter 300 with timestamp 5649631 us, controller_time 5649627 us, btn_val: 0 LED will be set in 5004 us + Sent SDU counter 400 with timestamp 6649626 us, controller_time 6649627 us, btn_val: 0 LED will be set in 4999 us + Sent SDU counter 500 with timestamp 7649623 us, controller_time 7649627 us, btn_val: 0 LED will be set in 4996 us + +Dependencies +************* + +This sample uses the following `sdk-nrfxlib`_ library: + +* :ref:`nrfxlib:softdevice_controller` + +In addition, it uses the following Zephyr libraries: + +* :file:`include/console.h` +* :ref:`zephyr:kernel_api`: + + * :file:`include/kernel.h` + +* :file:`include/sys/printk.h` +* :file:`include/zephyr/types.h` +* :ref:`zephyr:bluetooth_api`: + + * :file:`include/bluetooth/bluetooth.h` + * :file:`include/bluetooth/iso.h` + * :file:`include/bluetooth/conn.h` + * :file:`include/bluetooth/hci.h` + * :file:`include/bluetooth/scan.h` + +References +*********** + +For more information about how to use isochronous channels with the SoftDevice Controller, see :ref:`Isochronous channels `. diff --git a/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 000000000000..7487f343e31f --- /dev/null +++ b/samples/bluetooth/iso_time_sync/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_RTC2=y +CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf b/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..7487f343e31f --- /dev/null +++ b/samples/bluetooth/iso_time_sync/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRFX_TIMER1=y +CONFIG_NRFX_RTC2=y +CONFIG_NRFX_PPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..5239e095884a --- /dev/null +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_RTC0=y +CONFIG_NRFX_DPPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 000000000000..5239e095884a --- /dev/null +++ b/samples/bluetooth/iso_time_sync/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRFX_TIMER0=y +CONFIG_NRFX_RTC0=y +CONFIG_NRFX_DPPI=y diff --git a/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1a90f4e08214 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NRFX_DPPI=y diff --git a/samples/bluetooth/iso_time_sync/child_image/hci_ipc.conf b/samples/bluetooth/iso_time_sync/child_image/hci_ipc.conf new file mode 100644 index 000000000000..1fcf9e403dad --- /dev/null +++ b/samples/bluetooth/iso_time_sync/child_image/hci_ipc.conf @@ -0,0 +1,28 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_BT=y +CONFIG_BT_ISO_BROADCASTER=y +CONFIG_BT_ISO_SYNC_RECEIVER=y +CONFIG_BT_ISO_CENTRAL=y +CONFIG_BT_ISO_PERIPHERAL=y +CONFIG_BT_OBSERVER=y + +CONFIG_BT_MAX_CONN=4 +CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 + +CONFIG_BT_ISO_MAX_CHAN=4 +CONFIG_BT_ISO_TX_BUF_COUNT=4 +CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_CONN_ISO_STREAMS=4 + +CONFIG_BT_ISO_TX_MTU=5 + +# To present the audio at the right point in time, we need the controller and +# audio clock to be synchronized +CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START=y +CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START_CHANNEL=4 diff --git a/samples/bluetooth/iso_time_sync/include/iso_time_sync.h b/samples/bluetooth/iso_time_sync/include/iso_time_sync.h new file mode 100644 index 000000000000..0a2aa1b47fa1 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/include/iso_time_sync.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef ISO_TIME_SYNC_H__ +#define ISO_TIME_SYNC_H__ + +/** Definitions for the ISO time sync sample. + * + * This file contains common definitions and API declarations + * used by the sample. + */ + +#include +#include +#include + +#define SDU_SIZE_BYTES 5 /* SDU = [btn_val, 4 byte sdu_counter]*/ + +/** Start BIS transmitter demo. + * + * @param retransmission_number Requested retransmission number. + * @param max_transport_latency_ms Requested maximum transport latency. + */ +void bis_transmitter_start(uint8_t retransmission_number, uint16_t max_transport_latency_ms); + +/** Start BIS receiver demo. + * + * @param bis_index_to_sync_to BIS index that it will sync to. + */ +void bis_receiver_start(uint8_t bis_index_to_sync_to); + +/** Start CIS central demo. + * + * @param do_tx Set to true to send SDUs, otherwise it will receive. + * @param retransmission_number Requested retransmission number. + * @param max_transport_latency_ms Requested maximum transport latency. + */ +void cis_central_start(bool do_tx, + uint8_t retransmission_number, + uint16_t max_transport_latency_ms); + +/** Start CIS peripheral demo. + * + * @param do_tx Set to true to send SDUs, otherwise it will receive. + */ +void cis_peripheral_start(bool do_tx); + +/** Initialize TX path channels. + * + * @param retransmission_number Requested retransmission number (if central or broadcaster). + * @param iso_connected_cb Callback that is triggered when the ISO channel connects. + * This can be set to NULL. + */ +void iso_tx_init(uint8_t retransmission_number, void (*iso_connected_cb)(void)); + +/** Initialize RX path channel. + * + * @param retransmission_number Requested retransmission number (if central). + * @param Callback that is triggered when an ISO RX channel disconnects. + * This can be set to NULL. + */ +void iso_rx_init(uint8_t retransmission_number, void (*iso_disconnected_cb)(void)); + +/** Obtain pointer to TX channels. + * + * @retval Pointer to the TX channels. + */ +struct bt_iso_chan **iso_tx_channels_get(void); + +/** Obtain pointer to RX channels. + * + * @retval Pointer to the RX channels. + */ +struct bt_iso_chan **iso_rx_channels_get(void); + +/** Print info ISO channel information. + * + * @param info ISO channel info. + * @param role The role of the ISO channel. + */ +void iso_chan_info_print(struct bt_iso_info *info, uint8_t role); + +/** Obtain the current Bluetooth controller time. + * + * The ISO timestamps are based upon this clock. + * + * @retval The current controller time. + */ +uint64_t controller_time_us_get(void); + +/** Sets the controller to trigger a PPI event at the given timestamp. + * + * @param timestamp_us The timestamp where it will trigger. + */ +void controller_time_trigger_set(uint64_t timestamp_us); + +/** Get the address of the event that will trigger. + * + * @retval The address of the event that will trigger. + */ +uint32_t controller_time_trigger_event_addr_get(void); + +/** Initialize the module handling timed toggling of an LED. + * + * @retval 0 on success, failure otherwise. + */ +int timed_led_toggle_init(void); + +/** Toggle the led to the give value at the given timestamp. + * + * @param value The LED value. + * @param timestamp_us The time when the led will be set. + * The time is specified in controller clock units. + */ +void timed_led_toggle_trigger_at(uint8_t value, uint32_t timestamp_us); + +#endif diff --git a/samples/bluetooth/iso_time_sync/prj.conf b/samples/bluetooth/iso_time_sync/prj.conf new file mode 100644 index 000000000000..e258d25e046e --- /dev/null +++ b/samples/bluetooth/iso_time_sync/prj.conf @@ -0,0 +1,24 @@ +CONFIG_BT=y +CONFIG_BT_ISO_BROADCASTER=y +CONFIG_BT_ISO_SYNC_RECEIVER=y +CONFIG_BT_ISO_CENTRAL=y +CONFIG_BT_ISO_PERIPHERAL=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_DEVICE_NAME="Nordic_ISO" + +CONFIG_BT_MAX_CONN=5 +CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1 + +CONFIG_BT_ISO_MAX_CHAN=4 +CONFIG_BT_ISO_TX_BUF_COUNT=4 +CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=4 +CONFIG_BT_CTLR_CONN_ISO_STREAMS=4 + +CONFIG_BT_ISO_TX_MTU=5 +CONFIG_BT_ISO_RX_MTU=23 + +CONFIG_CONSOLE=y +CONFIG_CONSOLE_SUBSYS=y +CONFIG_CONSOLE_HANDLER=y +CONFIG_CONSOLE_GETCHAR=y diff --git a/samples/bluetooth/iso_time_sync/sample.yaml b/samples/bluetooth/iso_time_sync/sample.yaml new file mode 100644 index 000000000000..e034f6c21106 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/sample.yaml @@ -0,0 +1,17 @@ +sample: + description: Bluetooth ISO time sync sample + name: Bluetooth ISO time sync +tests: + sample.bluetooth.iso_time_sync: + build_only: true + integration_platforms: + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + tags: bluetooth ci_build diff --git a/samples/bluetooth/iso_time_sync/src/bis_receiver.c b/samples/bluetooth/iso_time_sync/src/bis_receiver.c new file mode 100644 index 000000000000..e79d0ee6bf81 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/bis_receiver.c @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** BIS receiver implementation for the time sync sample + * + * This file implements a device that syncs to a given BIS index. + * When disconnected, it tries to sync to it again. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "iso_time_sync.h" + +#define ADV_NAME_STR_MAX_LEN (sizeof(CONFIG_BT_DEVICE_NAME)) + +static K_SEM_DEFINE(sem_per_adv_info_valid, 0, 1); +static K_SEM_DEFINE(sem_big_info_valid, 0, 1); +static K_SEM_DEFINE(sem_per_adv_sync_lost, 0, 1); + +static bool syncing_or_synced_to_periodic_adv; +static bool syncing_or_synced_to_big; + +static bt_addr_le_t adv_addr; +static uint8_t adv_set_id; + +static bool adv_data_parse_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, ADV_NAME_STR_MAX_LEN - 1); + memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_simple *buf) +{ + char name_str[ADV_NAME_STR_MAX_LEN] = {0}; + + bt_data_parse(buf, adv_data_parse_cb, name_str); + + if (strncmp(name_str, CONFIG_BT_DEVICE_NAME, ADV_NAME_STR_MAX_LEN) != 0) { + return; + } + + if (!syncing_or_synced_to_periodic_adv) { + bt_addr_le_copy(&adv_addr, info->addr); + adv_set_id = info->sid; + + syncing_or_synced_to_periodic_adv = true; + k_sem_give(&sem_per_adv_info_valid); + } +} + +static void synced_to_per_adv_cb(struct bt_le_per_adv_sync *sync, + struct bt_le_per_adv_sync_synced_info *info) +{ + printk("Synced to periodic advertiser\n"); +} + +static void sync_to_per_adv_lost_cb(struct bt_le_per_adv_sync *sync, + const struct bt_le_per_adv_sync_term_info *info) +{ + printk("Sync to periodic advertiser lost\n"); + k_sem_give(&sem_per_adv_sync_lost); +} + +static void biginfo_rcvd_cb(struct bt_le_per_adv_sync *sync, const struct bt_iso_biginfo *biginfo) +{ + if (!syncing_or_synced_to_big) { + printk("BigInfo received\n"); + syncing_or_synced_to_big = true; + k_sem_give(&sem_big_info_valid); + } +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; + +static struct bt_le_per_adv_sync_cb sync_callbacks = { + .synced = synced_to_per_adv_cb, + .term = sync_to_per_adv_lost_cb, + .biginfo = biginfo_rcvd_cb, +}; + +static void reset_state(void) +{ + k_sem_reset(&sem_per_adv_info_valid); + k_sem_reset(&sem_big_info_valid); + k_sem_reset(&sem_per_adv_sync_lost); + syncing_or_synced_to_periodic_adv = false; + syncing_or_synced_to_big = false; +} + +void bis_receiver_start(uint8_t bis_index_to_sync_to) +{ + struct bt_le_per_adv_sync_param sync_create_param; + struct bt_iso_big_sync_param big_sync_param; + struct bt_le_per_adv_sync *sync; + struct bt_iso_big *big; + int err; + + uint8_t unused_rtn = 0; + + iso_rx_init(unused_rtn, NULL); + + bt_le_scan_cb_register(&scan_callbacks); + bt_le_per_adv_sync_cb_register(&sync_callbacks); + + err = bt_le_scan_start(BT_LE_SCAN_PASSIVE_CONTINUOUS, NULL); + if (err) { + printk("Scan start failed (err %d)\n", err); + return; + } + + while (true) { + reset_state(); + + printk("Scanning for periodic advertiser\n"); + k_sem_take(&sem_per_adv_info_valid, K_FOREVER); + + syncing_or_synced_to_periodic_adv = true; + + memset(&sync_create_param, 0, sizeof(sync_create_param)); + bt_addr_le_copy(&sync_create_param.addr, &adv_addr); + sync_create_param.options = 0; + sync_create_param.sid = adv_set_id; + sync_create_param.skip = 0; + sync_create_param.timeout = 1000; + + err = bt_le_per_adv_sync_create(&sync_create_param, &sync); + if (err) { + printk("Sync create failed (err %d)\n", err); + return; + } + + printk("Waiting for BigInfo\n"); + err = k_sem_take(&sem_big_info_valid, K_MSEC(5000)); + if (err) { + printk("Failed obtaining BigInfo in time, starting over\n"); + + err = bt_le_per_adv_sync_delete(sync); + if (err) { + printk("Deleting periodic sync failed (err %d)\n", err); + return; + } + + continue; + } + + 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.mse = BT_ISO_SYNC_MSE_ANY; + big_sync_param.sync_timeout = 100; /* in 10 ms units */ + + printk("Syncing to BIG index %d\n", bis_index_to_sync_to); + err = bt_iso_big_sync(sync, &big_sync_param, &big); + if (err) { + printk("Creating BIG sync failed (err %d)\n", err); + return; + } + + k_sem_take(&sem_per_adv_sync_lost, K_FOREVER); + + err = bt_le_per_adv_sync_delete(sync); + if (err) { + printk("Deleting periodic sync failed (err %d)\n", err); + return; + } + } +} diff --git a/samples/bluetooth/iso_time_sync/src/bis_transmitter.c b/samples/bluetooth/iso_time_sync/src/bis_transmitter.c new file mode 100644 index 000000000000..cbfd5a9fd924 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/bis_transmitter.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** BIS transmitter implementation for the time sync sample + * + * This file implements a device that sets up a BIS transmitter + * with a configured number of streams. + */ + +#include +#include +#include + +#include "iso_time_sync.h" + +void bis_transmitter_start(uint8_t retransmission_number, uint16_t max_transport_latency_ms) +{ + int err; + struct bt_le_ext_adv *adv; + struct bt_iso_big *big; + + iso_tx_init(retransmission_number, NULL); + + /* Create a non-connectable non-scannable advertising set */ + err = bt_le_ext_adv_create(BT_LE_EXT_ADV_NCONN_NAME, NULL, &adv); + if (err) { + printk("Failed to create advertising set (err %d)\n", err); + return; + } + + /* Set periodic advertising parameters */ + err = bt_le_per_adv_set_param(adv, BT_LE_PER_ADV_PARAM(BT_GAP_PER_ADV_FAST_INT_MIN_2, + BT_GAP_PER_ADV_FAST_INT_MAX_2, + BT_LE_PER_ADV_OPT_NONE)); + if (err) { + printk("Failed to set periodic advertising parameters" + " (err %d)\n", + err); + return; + } + + /* Start extended advertising */ + err = bt_le_ext_adv_start(adv, BT_LE_EXT_ADV_START_DEFAULT); + if (err) { + printk("Failed to start extended advertising (err %d)\n", err); + return; + } + + /* Enable Periodic Advertising */ + err = bt_le_per_adv_start(adv); + if (err) { + printk("Failed to enable periodic advertising (err %d)\n", err); + return; + } + + struct bt_iso_big_create_param big_create_param = { + .num_bis = CONFIG_BT_ISO_MAX_CHAN, + .bis_channels = iso_tx_channels_get(), + .interval = CONFIG_SDU_INTERVAL_US, + .latency = max_transport_latency_ms, + .packing = 0, /* 0 - sequential, 1 - interleaved */ + .framing = 0, /* 0 - unframed, 1 - framed */ + }; + + /* Create BIG */ + err = bt_iso_big_create(adv, &big_create_param, &big); + if (err) { + printk("Failed to create BIG (err %d)\n", err); + return; + } + + printk("BIS transmitter started\n"); +} diff --git a/samples/bluetooth/iso_time_sync/src/cis_central.c b/samples/bluetooth/iso_time_sync/src/cis_central.c new file mode 100644 index 000000000000..98a1ffb8cbcf --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/cis_central.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** CIS central implementation for the time sync sample + * + * This file implements a device that acts as a CIS central. + * The central can either be configured as a transmitter or a receiver. + * + * It connects to as many peripherals as it has available ISO channels. + */ + +#include +#include +#include +#include + +#include "iso_time_sync.h" + +#define ADV_NAME_STR_MAX_LEN (sizeof(CONFIG_BT_DEVICE_NAME)) + +static bool configured_for_tx; + +static K_SEM_DEFINE(sem_connected, 0, 1); + +static void scan_start(void); + +static struct bt_iso_chan *free_iso_chan_find(void) +{ + const size_t max_channels = configured_for_tx ? CONFIG_BT_ISO_MAX_CHAN : 1; + + struct bt_iso_chan **iso_channels; + + if (configured_for_tx) { + iso_channels = iso_tx_channels_get(); + } else { + iso_channels = iso_rx_channels_get(); + } + + struct bt_iso_chan *iso_chan = NULL; + + for (size_t i = 0; i < max_channels; i++) { + if (iso_channels[i]->state == BT_ISO_STATE_DISCONNECTED) { + iso_chan = iso_channels[i]; + break; + } + } + + return iso_chan; +} + +static bool adv_data_parse_cb(struct bt_data *data, void *user_data) +{ + char *name = user_data; + uint8_t len; + + switch (data->type) { + case BT_DATA_NAME_SHORTENED: + case BT_DATA_NAME_COMPLETE: + len = MIN(data->data_len, ADV_NAME_STR_MAX_LEN - 1); + memcpy(name, data->data, len); + name[len] = '\0'; + return false; + default: + return true; + } +} + +static void scan_recv(const struct bt_le_scan_recv_info *info, struct net_buf_simple *buf) +{ + char name_str[ADV_NAME_STR_MAX_LEN] = {0}; + + bt_data_parse(buf, adv_data_parse_cb, name_str); + + if (strncmp(name_str, CONFIG_BT_DEVICE_NAME, ADV_NAME_STR_MAX_LEN) != 0) { + return; + } + + if (bt_le_scan_stop()) { + return; + } + + struct bt_conn *conn; + int err = bt_conn_le_create(info->addr, BT_CONN_LE_CREATE_CONN, BT_LE_CONN_PARAM_DEFAULT, + &conn); + if (err) { + printk("Create conn to %s failed (%d)\n", name_str, err); + } +} + +static struct bt_le_scan_cb scan_callbacks = { + .recv = scan_recv, +}; + +static void scan_start(void) +{ + int err; + + if (free_iso_chan_find()) { + err = bt_le_scan_start(BT_LE_SCAN_ACTIVE_CONTINUOUS, NULL); + if (err == -EALREADY) { + /** If the central is RXing, both the ISO and the ACL + * disconnection callbacks try to enable the scanner. + * If the ISO channel disconnects before the ACL + * connection, the application will attempt to enable + * the scanner again. + */ + printk("Scanning did not start because it has already started (err %d)\n", + err); + } else if (err) { + printk("Scanning failed to start (err %d)\n", err); + return; + } + + printk("CIS Central started scanning\n"); + } +} + +static void connected(struct bt_conn *conn, uint8_t err) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + if (err) { + printk("Failed to connect to %s (%u)\n", addr, err); + + bt_conn_unref(conn); + + scan_start(); + return; + } + + printk("Connected: %s\n", addr); + + /* Find a free ISO channel */ + struct bt_iso_chan *iso_chan = free_iso_chan_find(); + + if (iso_chan == NULL) { + printk("No ISO channel available\n"); + return; + } + + struct bt_iso_connect_param connect_param; + + connect_param.acl = conn; + connect_param.iso_chan = iso_chan; + + err = bt_iso_chan_connect(&connect_param, 1); + if (err) { + printk("Failed to connect iso (%d)\n", err); + return; + } + printk("Connecting ISO channel\n"); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + printk("Disconnected: %s (reason 0x%02x)\n", addr, reason); + + bt_conn_unref(conn); + + scan_start(); +} + +static struct bt_conn_cb conn_callbacks = { + .connected = connected, + .disconnected = disconnected, +}; + +void cis_central_start(bool do_tx, uint8_t retransmission_number, uint16_t max_transport_latency_ms) +{ + struct bt_iso_cig_param param; + struct bt_iso_cig *cig; + int err; + + configured_for_tx = do_tx; + if (do_tx) { + /** scan_start is registered as a callback that is triggered when an + * ISO channel connects to avoid a situation where the + * LE HCI Create CIS command is called while there is a pending CIS + * connection. The CIS central starts scanning for a new connection only after a + * pending CIS connection has completed. This must be done because the + * LE HCI Create CIS command is disallowed while a CIS connection is + * pending. See Core Specification Version 5.4, Vol 6, Part B, section 7.8.99. + */ + iso_tx_init(retransmission_number, &scan_start); + } else { + /** scan_start is registered as a callback that is triggered when an + * ISO channel disconnects. This is needed because the ISO channel might + * disconnect after the ACL has completed its disconnection callback. If + * this is the case, there are no RX ISO channels available during the + * ACL disconnection callback, which will prevent scanning from starting. + */ + iso_rx_init(retransmission_number, &scan_start); + } + + bt_le_scan_cb_register(&scan_callbacks); + bt_conn_cb_register(&conn_callbacks); + + memset(¶m, 0, sizeof(param)); + param.cis_channels = do_tx ? iso_tx_channels_get() : iso_rx_channels_get(); + param.num_cis = do_tx ? CONFIG_BT_ISO_MAX_CHAN : 1; + param.sca = BT_GAP_SCA_UNKNOWN; + param.packing = 0; + param.framing = 0; + param.c_to_p_latency = max_transport_latency_ms; + param.p_to_c_latency = max_transport_latency_ms; + param.c_to_p_interval = CONFIG_SDU_INTERVAL_US; + param.p_to_c_interval = CONFIG_SDU_INTERVAL_US; + + err = bt_iso_cig_create(¶m, &cig); + if (err != 0) { + printk("Failed to create CIG (%d)\n", err); + return; + } + + scan_start(); + + printk("CIS central started scanning for peripheral(s)\n"); +} diff --git a/samples/bluetooth/iso_time_sync/src/cis_peripheral.c b/samples/bluetooth/iso_time_sync/src/cis_peripheral.c new file mode 100644 index 000000000000..4047a7aa395b --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/cis_peripheral.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** CIS peripheral implementation for the time sync sample + * + * This file implements a device that acts as a CIS peripheral. + * The peripheral can either be configured as a transmitter or a receiver. + */ + +#include +#include +#include +#include + +#include "iso_time_sync.h" + +static bool configured_for_tx; + +static void connected(struct bt_conn *conn, uint8_t err) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + if (err) { + printk("Failed to connect to %s (%u)\n", addr, err); + return; + } + + printk("Connected: %s\n", addr); +} + +static void disconnected(struct bt_conn *conn, uint8_t reason) +{ + char addr[BT_ADDR_LE_STR_LEN]; + + bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); + + printk("Disconnected from %s (reason 0x%02x)\n", addr, reason); +} + +static struct bt_conn_cb conn_callbacks = { + .connected = connected, + .disconnected = disconnected, +}; + +static int iso_accept(const struct bt_iso_accept_info *info, struct bt_iso_chan **chan) +{ + printk("Incoming request from %p\n", (void *)info->acl); + + struct bt_iso_chan **iso_channels = + configured_for_tx ? iso_tx_channels_get() : iso_rx_channels_get(); + + if (iso_channels[0]->iso) { + printk("No channels available\n"); + return -ENOMEM; + } + + *chan = iso_channels[0]; + + return 0; +} + +static struct bt_iso_server iso_server = { +#if defined(CONFIG_BT_SMP) + .sec_level = BT_SECURITY_L1, +#endif /* CONFIG_BT_SMP */ + .accept = iso_accept, +}; + +void cis_peripheral_start(bool do_tx) +{ + int err; + uint8_t unused_rtn = 0; + + configured_for_tx = do_tx; + + /* It is the central that sets the RTN */ + if (do_tx) { + iso_tx_init(unused_rtn, NULL); + } else { + iso_rx_init(unused_rtn, NULL); + } + + bt_conn_cb_register(&conn_callbacks); + + err = bt_iso_server_register(&iso_server); + if (err) { + printk("Unable to register ISO server (err %d)\n", err); + return; + } + + err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, NULL, 0, NULL, 0); + if (err) { + printk("Advertising failed to start (err %d)\n", err); + return; + } + + printk("CIS peripheral started advertising\n"); +} diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c new file mode 100644 index 000000000000..0ae9d5e42255 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements controller time management for 52 Series devices + * + * As the controller clock is not directly accessible, the controller + * time is obtained using a mirrored RTC peripheral. + * To achieve microsecond accurate toggling, a timer peripheral is also used. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "iso_time_sync.h" + +static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(2); +static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(1); + +static volatile uint32_t num_rtc_overflows; + +static uint32_t offset_ticks_and_controller_to_app_rtc; + +static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) +{ + if (int_type == NRFX_RTC_INT_OVERFLOW) { + num_rtc_overflows++; + } +} + +static void unused_timer_isr_handler(nrf_timer_event_t event_type, void *ctx) +{ + ARG_UNUSED(event_type); + ARG_UNUSED(ctx); +} + +static int32_t rtc_diff_get(void) +{ + uint32_t controller_ticks = nrf_rtc_counter_get(NRF_RTC0); + uint32_t app_ticks = nrf_rtc_counter_get(app_rtc_instance.p_reg); + + return controller_ticks - app_ticks; +} + +static int rtc_config(void) +{ + int ret; + + const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; + + ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); + if (ret != NRFX_SUCCESS) { + printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + return -ENODEV; + } + +#ifndef BT_CTLR_SDC_BSIM_BUILD + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_RTC_INST_GET(2)), IRQ_PRIO_LOWEST, + NRFX_RTC_INST_HANDLER_GET(2), NULL, 0); +#else + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_RTC_INST_GET(2)), 0, + (void *)NRFX_RTC_INST_HANDLER_GET(2), NULL, 0); +#endif + + nrfx_rtc_overflow_enable(&app_rtc_instance, true); + nrfx_rtc_tick_enable(&app_rtc_instance, false); + nrfx_rtc_enable(&app_rtc_instance); + + /* To obtain the controller timestamp without modifying the state of RTC0, + * we find the offset between RTC0 and our mirrored RTC. + * We achieve this by reading out the counter value of both of them. + * When the diff between those two have been equal twice, we know the + * time difference in ticks. + */ + + uint32_t sync_attempts = 10; + + while (sync_attempts > 0) { + sync_attempts--; + + int32_t diff_measurement_1 = rtc_diff_get(); + + /* We need to wait half an RTC tick to ensure we are not measuring + * the diff between the two RTCs at the point in time where their + * values are transitioning. + */ + k_busy_wait(15); + + int32_t diff_measurement_2 = rtc_diff_get(); + + if (diff_measurement_1 == diff_measurement_2) { + offset_ticks_and_controller_to_app_rtc = diff_measurement_1; + return 0; + } + } + + printk("Controller time sync failure\n"); + offset_ticks_and_controller_to_app_rtc = 0; + return -EINVAL; +} + +static int timer_config(void) +{ + int ret; + uint8_t ppi_chan_timer_clear_on_rtc_tick; + const nrfx_timer_config_t timer_cfg = { + .frequency = NRFX_MHZ_TO_HZ(1UL), + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_8, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = NULL}; + + ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); + if (ret != NRFX_SUCCESS) { + printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + return -ENODEV; + } + + /* Clear the TIMER every RTC tick. */ + if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + printk("Failed allocating for clearing TIMER on RTC TICK\n"); + return -ENOMEM; + } + + nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, + nrfx_rtc_event_address_get(&app_rtc_instance, + NRF_RTC_EVENT_TICK), + nrfx_timer_task_address_get(&app_timer_instance, + NRF_TIMER_TASK_CLEAR)); + + nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); + + nrfx_timer_enable(&app_timer_instance); + + return 0; +} + +/** Configure the TIMER and RTC in such a way that microsecond accurate timing can be achieved. + * + * To get microsecond accurate toggling, we need to combine both the RTC and TIMER peripheral. + * That is, both a RTC CC value and TIMER CC value needs to be set. + * We should only trigger an EGU task when the TIMER CC value matches after the + * RTC CC value matched. + * This is achieved using a PPI group. The group is enabled when the RTC CC matches and disabled + * again then the TIMER CC matches. + */ +int config_egu_trigger_on_rtc_and_timer_match(void) +{ + uint8_t ppi_chan_on_rtc_match; + uint8_t ppi_chan_on_timer_match; + + if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { + printk("Failed allocating for RTC match\n"); + return -ENOMEM; + } + + if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { + printk("Failed allocating for TIMER match\n"); + return -ENOMEM; + } + + nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); + nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); + nrfx_gppi_channels_include_in_group(BIT(ppi_chan_on_timer_match), + NRFX_GPPI_CHANNEL_GROUP0); + + nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, + nrfx_rtc_event_address_get(&app_rtc_instance, + NRF_RTC_EVENT_COMPARE_0), + nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); + + nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, + nrfx_timer_event_address_get(&app_timer_instance, + NRF_TIMER_EVENT_COMPARE0), + nrf_egu_task_address_get(NRF_EGU0, + NRF_EGU_TASK_TRIGGER0)); + nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, + nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); + + nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + + return 0; +} + +int controller_time_init(void) +{ + int ret; + + ret = rtc_config(); + if (ret) { + return ret; + } + + ret = timer_config(); + if (ret) { + return ret; + } + + return config_egu_trigger_on_rtc_and_timer_match(); +} + +static uint64_t rtc_ticks_to_us(uint32_t rtc_ticks) +{ + const uint64_t rtc_ticks_in_femto_units = 30517578125UL; + + return (rtc_ticks * rtc_ticks_in_femto_units) / 1000000000UL; +} + +static uint32_t us_to_rtc_ticks(uint32_t timestamp_us) +{ + const uint64_t rtc_ticks_in_femto_units = 30517578125UL; + + return ((uint64_t)(timestamp_us) * 1000000000UL) / rtc_ticks_in_femto_units; +} + +uint64_t controller_time_us_get(void) +{ + const uint32_t rtc_overflow_time_us = 512000000UL; + + /* On the 52 series the RTC has to task to capture the current RTC value. + * Therefore we cannot capture the TIMER and RTC value simultaneously. + * Therefore we only use the RTC to read out the current time here. + * This will result in an error of maximum one RTC tick. + */ + + uint32_t rtc_ticks = nrf_rtc_counter_get(app_rtc_instance.p_reg); + + return rtc_ticks_to_us(rtc_ticks) + (num_rtc_overflows * rtc_overflow_time_us) + + rtc_ticks_to_us(offset_ticks_and_controller_to_app_rtc); +} + +void controller_time_trigger_set(uint64_t timestamp_us) +{ + uint32_t num_overflows = timestamp_us / 512000000UL; + uint64_t overflow_time_us = num_overflows * num_overflows; + + uint32_t rtc_remainder_time_us = timestamp_us - overflow_time_us; + uint32_t rtc_val = + us_to_rtc_ticks(rtc_remainder_time_us) - offset_ticks_and_controller_to_app_rtc; + + uint8_t timer_val = + timestamp_us - rtc_ticks_to_us(rtc_val + offset_ticks_and_controller_to_app_rtc); + + /* Ensure the timer value lies between 1 and 30 so that it will + * always be between two RTC ticks. + */ + timer_val = MAX(timer_val, 1); + timer_val = MIN(timer_val, 30); + + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + printk("Failed setting trigger\n"); + } + + nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); +} + +uint32_t controller_time_trigger_event_addr_get(void) +{ + return nrf_egu_event_address_get(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0); +} + +SYS_INIT(controller_time_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c new file mode 100644 index 000000000000..d81e4dff6b2a --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements controller time management for 53 Series devices + * + * As the controller clock is not directly accessible, the controller + * time is obtained using a mirrored RTC peripheral. + * The RTC is started upon starting the controller clock on the network core. + * To achieve microsecond accurate toggling, a timer peripheral is also used. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "iso_time_sync.h" + +static const nrfx_rtc_t app_rtc_instance = NRFX_RTC_INSTANCE(0); +static const nrfx_timer_t app_timer_instance = NRFX_TIMER_INSTANCE(0); + +static volatile uint32_t num_rtc_overflows; + +static void rtc_isr_handler(nrfx_rtc_int_type_t int_type) +{ + if (int_type == NRFX_RTC_INT_OVERFLOW) { + num_rtc_overflows++; + } +} + +static void unused_timer_isr_handler(nrf_timer_event_t event_type, void *ctx) +{ + ARG_UNUSED(event_type); + ARG_UNUSED(ctx); +} + +static int rtc_config(void) +{ + int ret; + uint8_t dppi_channel_rtc_start; + const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG; + + ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler); + if (ret != NRFX_SUCCESS) { + printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + return -ENODEV; + } + +#ifndef BT_CTLR_SDC_BSIM_BUILD + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_RTC_INST_GET(0)), IRQ_PRIO_LOWEST, + NRFX_RTC_INST_HANDLER_GET(0), NULL, 0); +#else + IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_RTC_INST_GET(0)), 0, + (void *)NRFX_RTC_INST_HANDLER_GET(0), NULL, 0); +#endif + + nrfx_rtc_overflow_enable(&app_rtc_instance, true); + nrfx_rtc_tick_enable(&app_rtc_instance, false); + nrfx_rtc_enable(&app_rtc_instance); + + + /* The application core RTC is started synchronously with the controller + * RTC using PPI over IPC. + */ + ret = nrfx_gppi_channel_alloc(&dppi_channel_rtc_start); + if (ret != NRFX_SUCCESS) { + printk("nrfx DPPI channel alloc error for starting RTC: %d", ret); + return -ENODEV; + } + + nrf_ipc_receive_config_set(NRF_IPC, 4, NRF_IPC_CHANNEL_4); + + nrfx_gppi_channel_endpoints_setup(dppi_channel_rtc_start, + nrfx_rtc_task_address_get(&app_rtc_instance, + NRF_RTC_TASK_CLEAR), + nrf_ipc_event_address_get(NRF_IPC, + NRF_IPC_EVENT_RECEIVE_4)); + + nrfx_gppi_channels_enable(BIT(dppi_channel_rtc_start)); + + return 0; +} + +static int timer_config(void) +{ + int ret; + uint8_t ppi_chan_timer_clear_on_rtc_tick; + const nrfx_timer_config_t timer_cfg = { + .frequency = NRFX_MHZ_TO_HZ(1UL), + .mode = NRF_TIMER_MODE_TIMER, + .bit_width = NRF_TIMER_BIT_WIDTH_8, + .interrupt_priority = NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY, + .p_context = NULL}; + + ret = nrfx_timer_init(&app_timer_instance, &timer_cfg, unused_timer_isr_handler); + if (ret != NRFX_SUCCESS) { + printk("Failed initializing timer (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + return -ENODEV; + } + + /* Clear the TIMER every RTC tick. */ + if (nrfx_gppi_channel_alloc(&ppi_chan_timer_clear_on_rtc_tick) != NRFX_SUCCESS) { + printk("Failed allocating for clearing TIMER on RTC TICK\n"); + return -ENOMEM; + } + + nrfx_gppi_channel_endpoints_setup(ppi_chan_timer_clear_on_rtc_tick, + nrfx_rtc_event_address_get(&app_rtc_instance, + NRF_RTC_EVENT_TICK), + nrfx_timer_task_address_get(&app_timer_instance, + NRF_TIMER_TASK_CLEAR)); + + nrfx_gppi_channels_enable(BIT(ppi_chan_timer_clear_on_rtc_tick)); + + nrfx_timer_enable(&app_timer_instance); + + return 0; +} + +/** Configure the TIMER and RTC in such a way that microsecond accurate timing can be achieved. + * + * To get microsecond accurate toggling, we need to combine both the RTC and TIMER peripheral. + * That is, both a RTC CC value and TIMER CC value needs to be set. + * We should only trigger an EGU task when the TIMER CC value + * matches after the RTC CC value matched. + * This is achieved using a PPI group. The group is enabled when the RTC CC matches and disabled + * again then the TIMER CC matches. + */ +int config_egu_trigger_on_rtc_and_timer_match(void) +{ + uint8_t ppi_chan_on_rtc_match; + uint8_t ppi_chan_on_timer_match; + + if (nrfx_gppi_channel_alloc(&ppi_chan_on_rtc_match) != NRFX_SUCCESS) { + printk("Failed allocating for RTC match\n"); + return -ENOMEM; + } + + if (nrfx_gppi_channel_alloc(&ppi_chan_on_timer_match) != NRFX_SUCCESS) { + printk("Failed allocating for TIMER match\n"); + return -ENOMEM; + } + + nrfx_gppi_group_clear(NRFX_GPPI_CHANNEL_GROUP0); + nrfx_gppi_group_disable(NRFX_GPPI_CHANNEL_GROUP0); + nrfx_gppi_channels_include_in_group(BIT(ppi_chan_on_timer_match), + NRFX_GPPI_CHANNEL_GROUP0); + + nrfx_gppi_channel_endpoints_setup(ppi_chan_on_rtc_match, + nrfx_rtc_event_address_get(&app_rtc_instance, + NRF_RTC_EVENT_COMPARE_0), + nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_EN)); + nrfx_gppi_channel_endpoints_setup(ppi_chan_on_timer_match, + nrfx_timer_event_address_get(&app_timer_instance, + NRF_TIMER_EVENT_COMPARE0), + nrfx_gppi_task_address_get(NRFX_GPPI_TASK_CHG0_DIS)); + nrfx_gppi_fork_endpoint_setup(ppi_chan_on_timer_match, + nrf_egu_task_address_get(NRF_EGU0, NRF_EGU_TASK_TRIGGER0)); + + nrfx_gppi_channels_enable(BIT(ppi_chan_on_rtc_match)); + + return 0; +} + +int controller_time_init(void) +{ + int ret; + + ret = rtc_config(); + if (ret) { + return ret; + } + + ret = timer_config(); + if (ret) { + return ret; + } + + return config_egu_trigger_on_rtc_and_timer_match(); +} + +static uint64_t rtc_ticks_to_us(uint32_t rtc_ticks) +{ + const uint64_t rtc_ticks_in_femto_units = 30517578125UL; + + return (rtc_ticks * rtc_ticks_in_femto_units) / 1000000000UL; +} + +static uint32_t us_to_rtc_ticks(uint32_t timestamp_us) +{ + const uint64_t rtc_ticks_in_femto_units = 30517578125UL; + + return ((uint64_t)(timestamp_us) * 1000000000UL) / rtc_ticks_in_femto_units; +} + +uint64_t controller_time_us_get(void) +{ + /* Simply use the RTC time here. + * It is possible to combine RTC and TIMER information here to get a more accurate + * timestamp. That requires setting up a PPI channel to capture both values simultaneously. + */ + + const uint32_t rtc_overflow_time_us = 512000000UL; + + uint32_t rtc_ticks = nrf_rtc_counter_get(app_rtc_instance.p_reg); + + return rtc_ticks_to_us(rtc_ticks) + (num_rtc_overflows * rtc_overflow_time_us); +} + +void controller_time_trigger_set(uint64_t timestamp_us) +{ + uint32_t num_overflows = timestamp_us / 512000000UL; + uint64_t overflow_time_us = num_overflows * num_overflows; + + uint32_t remainder_time_us = timestamp_us - overflow_time_us; + uint32_t rtc_val = us_to_rtc_ticks(remainder_time_us); + uint8_t timer_val = timestamp_us - rtc_ticks_to_us(rtc_val); + + /* Ensure the timer value lies between 1 and 30 so that it will + * always be between two RTC ticks. + */ + timer_val = MAX(timer_val, 1); + timer_val = MIN(timer_val, 30); + + if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) { + printk("Failed setting trigger\n"); + } + + nrfx_timer_compare(&app_timer_instance, 0, timer_val, false); +} + +uint32_t controller_time_trigger_event_addr_get(void) +{ + return nrf_egu_event_address_get(NRF_EGU0, NRF_EGU_EVENT_TRIGGERED0); +} + +/* The controller time initialization must happen before + * starting the network core. + */ +SYS_INIT(controller_time_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/samples/bluetooth/iso_time_sync/src/controller_time_nrf54l.c b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54l.c new file mode 100644 index 000000000000..440c1c3fbe2d --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/controller_time_nrf54l.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements controller time management for 54 Series devices + */ + +#include +#include +#include "iso_time_sync.h" + +static uint8_t grtc_channel; + +int controller_time_init(void) +{ + int ret; + + while (true) { + ret = nrfx_grtc_channel_alloc(&grtc_channel); + if (ret != NRFX_SUCCESS) { + printk("Failed allocating GRTC channel (ret: %d)\n", + ret - NRFX_ERROR_BASE_NUM); + return -ENODEV; + } + } + + nrf_grtc_sys_counter_compare_event_enable(NRF_GRTC, grtc_channel); + + return -0; +} + +uint64_t controller_time_us_get(void) +{ + int ret; + uint64_t current_time_us; + + ret = nrfx_grtc_syscounter_get(¤t_time_us); + if (ret != NRFX_SUCCESS) { + printk("Failed obtaining system time (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + return 0; + } + + return current_time_us; +} + +void controller_time_trigger_set(uint64_t timestamp_us) +{ + int ret; + + nrfx_grtc_channel_t chan_data = { + .channel = grtc_channel, + }; + + ret = nrfx_grtc_syscounter_cc_absolute_set(&chan_data, timestamp_us, false); + if (ret != NRFX_SUCCESS) { + printk("Failed setting CC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM); + } +} + +uint32_t controller_time_trigger_event_addr_get(void) +{ + return nrf_grtc_event_address_get(NRF_GRTC, + nrf_grtc_sys_counter_compare_event_get(grtc_channel)); +} + +SYS_INIT(controller_time_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/samples/bluetooth/iso_time_sync/src/iso_rx.c b/samples/bluetooth/iso_time_sync/src/iso_rx.c new file mode 100644 index 000000000000..0153bfa2472d --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/iso_rx.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements receiving SDUs for the time sync demo + * + * When a valid SDU is received two things are done: + * 1. A LED is toggled immediately + * 2. A timer trigger is configured to toggle another LED + * CONFIG_TIMED_LED_PRESENTATION_DELAY_US after the received timestamp. + * This will ensure that all receivers toggle it at the same time. + */ + +#include +#include +#include +#include +#include "iso_time_sync.h" + +static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, + struct net_buf *buf); +static void iso_connected(struct bt_iso_chan *chan); +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 bt_iso_chan_ops iso_ops = { + .recv = iso_recv, + .connected = iso_connected, + .disconnected = iso_disconnected, +}; + +static struct bt_iso_chan_io_qos iso_rx_qos = { + .sdu = SDU_SIZE_BYTES, + .phy = BT_GAP_LE_PHY_2M, +}; + +static struct bt_iso_chan_qos iso_qos = { + .rx = &iso_rx_qos, +}; + +static struct bt_iso_chan iso_chan[] = { + { + .ops = &iso_ops, + .qos = &iso_qos, + }, +}; + +static struct bt_iso_chan *iso_channels[] = { + &iso_chan[0], +}; + +static void iso_recv(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, + struct net_buf *buf) +{ + if ((info->flags & BT_ISO_FLAGS_VALID) == 0) { + /* The packet should be valid. */ + return; + } + + if ((info->flags & BT_ISO_FLAGS_TS) == 0) { + /* The packet should contain a timestamp */ + return; + } + + if (buf->len != SDU_SIZE_BYTES) { + return; + } + + uint32_t counter = net_buf_remove_le32(buf); + uint8_t btn_pressed = net_buf_remove_u8(buf); + + if (IS_ENABLED(CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE)) { + gpio_pin_set_dt(&led_sdu_received, btn_pressed); + } + + uint32_t trigger_time_us = info->ts + CONFIG_TIMED_LED_PRESENTATION_DELAY_US; + + timed_led_toggle_trigger_at(btn_pressed, trigger_time_us); + + if (counter % 100 == 0) { + uint32_t current_time_us = controller_time_us_get() & UINT32_MAX; + int32_t time_to_trigger = trigger_time_us - current_time_us; + + printk("Recv SDU counter %u with timestamp %u us, controller_time %u us, btn_val: %d, LED will be set in %d us\n", + counter, info->ts, current_time_us, btn_pressed, time_to_trigger); + } +} + +static void iso_connected(struct bt_iso_chan *chan) +{ + int err; + struct bt_conn_info conn_info; + struct bt_iso_info iso_info; + + err = bt_iso_chan_get_info(chan, &iso_info); + if (err) { + printk("Failed obtaining ISO info\n"); + return; + } + + err = bt_conn_get_info(chan->iso, &conn_info); + if (err) { + printk("Failed obtaining conn info\n"); + return; + } + + printk("ISO Channel connected: "); + iso_chan_info_print(&iso_info, conn_info.role); +} + +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) +{ + printk("ISO Channel disconnected with reason 0x%02x\n", reason); + + if (iso_chan_disconnected_cb) { + iso_chan_disconnected_cb(); + } +} + +void iso_rx_init(uint8_t retransmission_number, void (*iso_disconnected_cb)(void)) +{ + int err; + + iso_chan_disconnected_cb = iso_disconnected_cb; + + iso_rx_qos.rtn = retransmission_number; + + if (IS_ENABLED(CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE)) { + err = gpio_pin_configure_dt(&led_sdu_received, GPIO_OUTPUT_INACTIVE); + if (err != 0) { + printk("Error %d: failed to configure LED device %s pin %d\n", err, + led_sdu_received.port->name, led_sdu_received.pin); + } + } +} + +struct bt_iso_chan **iso_rx_channels_get(void) +{ + return iso_channels; +} diff --git a/samples/bluetooth/iso_time_sync/src/iso_tx.c b/samples/bluetooth/iso_time_sync/src/iso_tx.c new file mode 100644 index 000000000000..1b793657ddb1 --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/iso_tx.c @@ -0,0 +1,416 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements transmitting SDUs for the time sync demo + * + * Each SDU contains a counter and the current value of a button. + * The implementation ensures the following: + * + * 1. The SDU is transmitted right before it is supposed to be + * sent on air. + * 2. The SDU is transmitted on all the connected isochronous channels + * with the same timestamp. This ensures that all the receivers + * can toggle their corresponding LEDs at the same time. + * 3. A LED is toggled when the data is sent. This can be used + * to observe the end-to-end latency.s + * 4. A LED is toggled when the LED is supposed to be toggled on the + * receiving side. + */ + +#include +#include +#include +#include +#include +#include + +#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 void iso_sent(struct bt_iso_chan *chan); +static void iso_connected(struct bt_iso_chan *chan); +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason); + +static void (*iso_chan_connected_cb)(void); + +NET_BUF_POOL_FIXED_DEFINE(tx_pool, CONFIG_BT_ISO_MAX_CHAN, + BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), + CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); + +static bool first_sdu_sent; +static uint32_t tx_sdu_timestamp_us; +static uint32_t num_sdus_sent; + +static void sdu_timer_expired(struct k_timer *timer); +static K_TIMER_DEFINE(sdu_timer, sdu_timer_expired, NULL); + +static struct bt_iso_chan_ops iso_ops = { + .connected = iso_connected, + .sent = iso_sent, + .disconnected = iso_disconnected, +}; + +static struct bt_iso_chan_io_qos iso_tx_qos = { + .sdu = SDU_SIZE_BYTES, + .phy = BT_GAP_LE_PHY_2M, +}; + +static struct bt_iso_chan_qos iso_qos = { + .tx = &iso_tx_qos, +}; + +/* Create lists of ISO channels and pointers to ISO channels. */ +#define _ISO_CHANNEL(_n, _) {.ops = &iso_ops, .qos = &iso_qos} +static struct bt_iso_chan iso_channels[] = { + LISTIFY(CONFIG_BT_ISO_MAX_CHAN, _ISO_CHANNEL, (,)) +}; + +#define _ISO_CHANNEL_PTR(_n, _) &iso_channels[_n] +static struct bt_iso_chan *iso_channel_pointers[] = { + LISTIFY(CONFIG_BT_ISO_MAX_CHAN, _ISO_CHANNEL_PTR, (,)) +}; + +static bool iso_channels_awaiting_iso_sent_cb[CONFIG_BT_ISO_MAX_CHAN]; + +/* Store info about the ISO channels in use. */ +static uint8_t roles[CONFIG_BT_ISO_MAX_CHAN]; +static struct bt_iso_info iso_infos[CONFIG_BT_ISO_MAX_CHAN]; + +void iso_chan_info_print(struct bt_iso_info *info, uint8_t role) +{ + if (info->type == BT_ISO_CHAN_TYPE_CONNECTED) { + uint8_t bn; + uint32_t flush_timeout; + uint32_t transport_latency_us; + + if (role == BT_CONN_ROLE_CENTRAL) { + bn = info->can_send ? + info->unicast.central.bn : + info->unicast.peripheral.bn; + flush_timeout = info->can_send ? + info->unicast.central.flush_timeout : + info->unicast.peripheral.flush_timeout; + transport_latency_us = info->can_send ? + info->unicast.central.latency : + info->unicast.peripheral.latency; + } else { + bn = info->can_send ? + info->unicast.peripheral.bn : + info->unicast.central.bn; + flush_timeout = info->can_send ? + info->unicast.peripheral.flush_timeout : + info->unicast.central.flush_timeout; + transport_latency_us = info->can_send ? + info->unicast.peripheral.latency : + info->unicast.central.latency; + } + + printk("interval: %d ms, NSE: %d, BN: %d, FT: %d, transport latency: %d us\n", + info->iso_interval * 1250 / 1000, + info->max_subevent, + bn, + flush_timeout / info->iso_interval, + transport_latency_us); + } else if (info->type == BT_ISO_CHAN_TYPE_BROADCASTER) { + printk("interval: %d ms, NSE: %d, BN: %d, IRC: %d, PTO: %d, transport latency: %d us\n", + info->iso_interval * 1250 / 1000, + info->max_subevent, + info->broadcaster.bn, + info->broadcaster.irc, + info->broadcaster.pto / info->iso_interval, + info->broadcaster.latency); + } else if (info->type == BT_ISO_CHAN_TYPE_SYNC_RECEIVER) { + printk("interval: %d ms, NSE: %d, BN: %d, IRC: %d, PTO: %d, transport latency: %d us\n", + info->iso_interval * 1250 / 1000, + info->max_subevent, + info->sync_receiver.bn, + info->sync_receiver.irc, + info->sync_receiver.pto / info->iso_interval, + info->sync_receiver.latency); + } else { + printk("Unknown ISO channel type %d\n", info->type); + } +} + +static int iso_tx_time_stamp_get(struct bt_conn *conn, uint32_t *time_stamp) +{ + int err; + uint16_t conn_handle = 0; + struct net_buf *buf; + struct net_buf *rsp_buf; + sdc_hci_cmd_vs_iso_read_tx_timestamp_t *params; + sdc_hci_cmd_vs_iso_read_tx_timestamp_return_t *rsp; + + err = bt_hci_get_conn_handle(conn, &conn_handle); + if (err) { + printk("Failed to get conn_handle %d\n", err); + return err; + } + + buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_ISO_READ_TX_TIMESTAMP, sizeof(*params)); + if (!buf) { + printk("Unable to allocate buffer\n"); + return -ENOMEM; + } + + params = net_buf_add(buf, sizeof(*params)); + params->conn_handle = conn_handle; + + err = bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_ISO_READ_TX_TIMESTAMP, buf, &rsp_buf); + if (err) { + printk("Error while getting ISO Tx timestamp %d\n", err); + return err; + } + + rsp = (void *)&rsp_buf->data[1]; + *time_stamp = rsp->tx_time_stamp; + + net_buf_unref(rsp_buf); + + return 0; +} + +static int send_next_sdu(struct bt_iso_chan *chan, bool btn_pressed) +{ + struct net_buf *buf; + + buf = net_buf_alloc(&tx_pool, K_FOREVER); + if (!buf) { + printk("Data buffer allocate timeout\n"); + return -ENOMEM; + } + + net_buf_reserve(buf, BT_ISO_CHAN_SEND_RESERVE); + net_buf_add_u8(buf, btn_pressed); + net_buf_add_le32(buf, num_sdus_sent); + + if (first_sdu_sent) { + return bt_iso_chan_send_ts(chan, buf, 0, tx_sdu_timestamp_us); + } else { + return bt_iso_chan_send(chan, buf, 0); + } + + return 0; +} + +static void send_next_sdu_on_all_channels(void) +{ + int err; + bool btn_pressed = (bool)gpio_pin_get_dt(&button); + + if (IS_ENABLED(CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE)) { + gpio_pin_set_dt(&led_on_sdu_send, btn_pressed); + } + + for (size_t i = 0; i < CONFIG_BT_ISO_MAX_CHAN; i++) { + + if (iso_channels[i].state != BT_ISO_STATE_CONNECTED) { + continue; + } + + err = send_next_sdu(&iso_channels[i], btn_pressed); + if (err) { + printk("Failed sending SDU, counter %d, index %d\n", num_sdus_sent, i); + return; + } + + /* Toggle that we are awaiting iso_sent callback on this channel */ + iso_channels_awaiting_iso_sent_cb[i] = true; + + if (!first_sdu_sent) { + /* The first time we send an SDU, we send it without timestamp. + * After that we always send SDUs with timestamps to ensure they + * are time synchronized on all channels. + * + * To avoid reading the timestamp both after sending SDUs and after + * the first SDU, we break out early here the very first event. + */ + break; + } + } +} + +static void iso_connected(struct bt_iso_chan *chan) +{ + int err; + struct bt_conn_info conn_info; + uint8_t chan_index = ARRAY_INDEX(iso_channels, chan); + + err = bt_iso_chan_get_info(chan, &iso_infos[chan_index]); + if (err) { + printk("Failed obtaining ISO info\n"); + return; + } + + err = bt_conn_get_info(chan->iso, &conn_info); + if (err) { + printk("Failed obtaining conn info\n"); + return; + } + + roles[chan_index] = conn_info.role; + + printk("ISO channel index %d connected: ", chan_index); + iso_chan_info_print(&iso_infos[chan_index], roles[chan_index]); + + if (iso_chan_connected_cb) { + iso_chan_connected_cb(); + } + + if (!first_sdu_sent) { + /* Send the first SDU immediately. + * The following SDUs will be sent time-aligned with the controller clock. + */ + send_next_sdu_on_all_channels(); + } +} + +static void iso_disconnected(struct bt_iso_chan *chan, uint8_t reason) +{ + uint32_t chan_index = ARRAY_INDEX(iso_channels, chan); + + printk("ISO Channel index %d disconnected with reason 0x%02x\n", + chan_index, reason); + + iso_channels_awaiting_iso_sent_cb[chan_index] = false; +} + +static bool send_more_sdus_with_same_timestamp(struct bt_iso_chan *chan) +{ + if (first_sdu_sent) { + struct bt_iso_chan *last_chan = NULL; + + /** Check if this is the last ISO channel where we are awaiting + * an iso_sent callback. If that is the case, that callback will + * be used to send SDUs on all ISO channels. + */ + for (size_t i = 0; i < CONFIG_BT_ISO_MAX_CHAN; i++) { + if (iso_channels_awaiting_iso_sent_cb[i]) { + last_chan = &iso_channels[i]; + } + } + + if (chan != last_chan) { + return true; + } else { + return false; + } + } + + /* The very first SDU is sent on one channel only. */ + first_sdu_sent = true; + return false; +} + +static uint32_t trigger_time_us_get(uint32_t sdu_sync_ref, uint8_t chan_index) +{ + uint32_t trigger_time_us = sdu_sync_ref + CONFIG_TIMED_LED_PRESENTATION_DELAY_US; + + /* The ISO type determines when to trigger the LED + * because of how the SDU synchronization reference is defined. + * See Core_v5.4, Vol 6, Part G, Section 3.2. + */ + + if (iso_infos[chan_index].type == BT_ISO_CHAN_TYPE_CONNECTED) { + if (roles[chan_index] == BT_CONN_ROLE_CENTRAL) { + trigger_time_us += iso_infos[chan_index].unicast.central.latency; + } + } else { + trigger_time_us += iso_infos[chan_index].broadcaster.latency; + } + + return trigger_time_us; +} + +static void iso_sent(struct bt_iso_chan *chan) +{ + int err; + uint32_t assigned_timestamp; + + if (send_more_sdus_with_same_timestamp(chan)) { + return; + } + + err = iso_tx_time_stamp_get(chan->iso, &assigned_timestamp); + if (err) { + printk("Failed obtaining timestamp\n"); + return; + } + + uint8_t chan_index = ARRAY_INDEX(iso_channels, chan); + + /* Set the LED to toggle in sync with all the receivers. */ + bool btn_pressed = (bool)gpio_pin_get_dt(&button); + uint32_t trigger_time_us = trigger_time_us_get(assigned_timestamp, + chan_index); + timed_led_toggle_trigger_at(btn_pressed, trigger_time_us); + + /* Set up a timer to trigger right before the next set of SDUs are to be sent. */ + uint32_t controller_time_us = controller_time_us_get() & UINT32_MAX; + int32_t time_to_next_sdu_us = + assigned_timestamp + CONFIG_SDU_INTERVAL_US + - controller_time_us + - HCI_ISO_TX_SDU_ARRIVAL_MARGIN_US; + + /** Update the sent SDU counter before starting + * the timer that triggers when the next SDU is sent. + * This is done to ensure that counter is updated in time. + */ + uint32_t prev_sent_sdu = num_sdus_sent; + + num_sdus_sent++; + + iso_channels_awaiting_iso_sent_cb[chan_index] = false; + + k_timer_start(&sdu_timer, K_USEC(time_to_next_sdu_us), K_NO_WAIT); + + /* Increment the SDU timestamp with one SDU interval. */ + tx_sdu_timestamp_us = assigned_timestamp + CONFIG_SDU_INTERVAL_US; + + if (prev_sent_sdu % 100 == 0) { + int32_t time_to_trigger = trigger_time_us - controller_time_us; + + printk("Sent SDU counter %u with timestamp %u us, controller_time %u us, ", + prev_sent_sdu, assigned_timestamp, controller_time_us); + printk("btn_val: %d LED will be set in %d us\n", + btn_pressed, time_to_trigger); + } +} + +static void sdu_timer_expired(struct k_timer *timer) +{ + ARG_UNUSED(timer); + send_next_sdu_on_all_channels(); +} + +void iso_tx_init(uint8_t retransmission_number, void (*iso_connected_cb)(void)) +{ + int err; + iso_chan_connected_cb = iso_connected_cb; + + iso_tx_qos.rtn = retransmission_number; + + if (IS_ENABLED(CONFIG_LED_TOGGLE_IMMEDIATELY_ON_SEND_OR_RECEIVE)) { + err = gpio_pin_configure_dt(&led_on_sdu_send, GPIO_OUTPUT_INACTIVE); + if (err != 0) { + printk("Error %d: failed to configure LED device %s pin %d\n", err, + led_on_sdu_send.port->name, led_on_sdu_send.pin); + } + } + + err = gpio_pin_configure_dt(&button, GPIO_INPUT); + if (err != 0) { + printk("Error %d: failed to configure %s pin %d\n", err, button.port->name, + button.pin); + } +} + +struct bt_iso_chan **iso_tx_channels_get(void) +{ + return iso_channel_pointers; +} diff --git a/samples/bluetooth/iso_time_sync/src/main.c b/samples/bluetooth/iso_time_sync/src/main.c new file mode 100644 index 000000000000..6e86baff8e4a --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/main.c @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include "iso_time_sync.h" + +enum role { + CIS_CENTRAL = 'c', + CIS_PERIPHERAL = 'p', + BIS_TRANSMIT = 'b', + BIS_RECEIVER = 'r', +}; + +enum direction { + DIR_TX = 't', + DIR_RX = 'r' +}; + +#define CONSOLE_INTEGER_INVALID 0xFFFFFFFFU + +static enum role role_select(void) +{ + enum role role; + + while (true) { + printk("Choose role - cis_central (c) / cis_peripheral (p) / bis_transmitter (b) / " + "bis_receiver (r) : "); + role = console_getchar(); + printk("%c\n", role); + + switch (role) { + case CIS_CENTRAL: + case CIS_PERIPHERAL: + case BIS_TRANSMIT: + case BIS_RECEIVER: + return role; + default: + printk("Invalid role selected\n"); + } + } +} + +static enum direction direction_select(void) +{ + enum direction direction; + + while (true) { + printk("Choose direction - TX (t) / RX (r) : "); + direction = console_getchar(); + printk("%c\n", direction); + + switch (direction) { + case DIR_TX: + case DIR_RX: + return direction; + default: + printk("Invalid direction selected\n"); + break; + } + } +} + +static size_t get_chars(char *buffer, size_t max_size) +{ + size_t pos = 0; + + while (pos < max_size) { + char c = tolower(console_getchar()); + + if (c == '\n' || c == '\r') { + break; + } + printk("%c", c); + buffer[pos++] = c; + } + printk("\n"); + buffer[pos] = '\0'; + + return pos; +} + +static uint32_t console_integer_get(void) +{ + char buffer[9]; + size_t char_count; + + char_count = get_chars(buffer, sizeof(buffer) - 1); + if (char_count == 0) { + return CONSOLE_INTEGER_INVALID; + } + + return strtoul(buffer, NULL, 0); +} + +static uint8_t bis_index_select(void) +{ + uint32_t index; + + while (true) { + printk("Choose bis index [1..31] : "); + + index = console_integer_get(); + + if (index == CONSOLE_INTEGER_INVALID) { + /* Use default of 1. */ + return 1; + } else if (index >= 1 && index <= 31) { + return index; + } + + printk("Invalid index\n"); + } +} + +static uint8_t sdu_retransmission_number_get(void) +{ + uint32_t retransmission_number; + + while (true) { + printk("Choose retransmission number [0..30] : "); + + retransmission_number = console_integer_get(); + + if (retransmission_number == CONSOLE_INTEGER_INVALID) { + /* Use default of 1. */ + return 1; + } else if (retransmission_number <= 30) { + return retransmission_number; + } + + printk("Invalid retransmission number\n"); + } +} + +static uint8_t sdu_max_transport_latency_get(void) +{ + uint32_t max_transport_latency_ms; + + while (true) { + printk("Choose max transport latency in ms [5..4000] : "); + + max_transport_latency_ms = console_integer_get(); + + if (max_transport_latency_ms == CONSOLE_INTEGER_INVALID) { + /* Use default of 10. */ + return 10; + } else if (max_transport_latency_ms >= 5 && max_transport_latency_ms <= 4000) { + return max_transport_latency_ms; + } + + printk("Invalid latency\n"); + } +} + +int main(void) +{ + int err; + enum role role; + enum direction direction; + uint8_t retransmission_number; + uint16_t max_transport_latency_ms; + + console_init(); + + printk("Bluetooth ISO Time Sync Demo\n"); + + err = timed_led_toggle_init(); + if (err != 0) { + printk("Error failed to init LED device for toggling\n"); + return err; + } + + /* Initialize the Bluetooth Subsystem */ + err = bt_enable(NULL); + if (err) { + printk("Bluetooth init failed (err %d)\n", err); + return 0; + } + + role = role_select(); + if (role == BIS_TRANSMIT) { + retransmission_number = sdu_retransmission_number_get(); + max_transport_latency_ms = sdu_max_transport_latency_get(); + + printk("Starting BIS transmitter with BIS indices [1..%d], RTN: %d, max transport latency %d ms\n", + CONFIG_BT_ISO_MAX_CHAN, retransmission_number, max_transport_latency_ms); + bis_transmitter_start(retransmission_number, max_transport_latency_ms); + } else if (role == BIS_RECEIVER) { + uint8_t index = bis_index_select(); + + printk("Starting BIS receiver, BIS index %d\n", index); + bis_receiver_start(index); + } else { + direction = direction_select(); + + if (role == CIS_CENTRAL) { + retransmission_number = sdu_retransmission_number_get(); + max_transport_latency_ms = sdu_max_transport_latency_get(); + + printk("Starting CIS central, dir: %s, RTN: %d, max transport latency %d ms\n", + direction == DIR_TX ? "tx" : "rx", + retransmission_number, max_transport_latency_ms); + cis_central_start(direction == DIR_TX, + retransmission_number, max_transport_latency_ms); + } else { + printk("Starting CIS peripheral, dir: %s\n", + direction == DIR_TX ? "tx" : "rx"); + cis_peripheral_start(direction == DIR_TX); + } + } + + return 0; +} diff --git a/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c new file mode 100644 index 000000000000..9cd80019dd8f --- /dev/null +++ b/samples/bluetooth/iso_time_sync/src/timed_led_toggle.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** This file implements timed toggling a LED + * + * To achieve accurate toggling, it interacts with the controller + * clock using PPI. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "iso_time_sync.h" + +#define GPIOTE_INST NRF_DT_GPIOTE_INST(DT_ALIAS(led0), gpios) +#define GPIOTE_NODE DT_NODELABEL(_CONCAT(gpiote, GPIOTE_INST)) + +BUILD_ASSERT(IS_ENABLED(_CONCAT(CONFIG_, _CONCAT(NRFX_GPIOTE, GPIOTE_INST))), + "NRFX_GPIOTE" STRINGIFY(GPIOTE_INST) " must be enabled in Kconfig"); + +static const nrfx_gpiote_t gpiote = NRFX_GPIOTE_INSTANCE(GPIOTE_INST); +static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, {0}); + +static uint8_t previous_led_value; + +int timed_led_toggle_init(void) +{ + int err; + uint8_t ppi_chan_led_toggle; + uint8_t gpiote_chan_led_toggle; + + const nrfx_gpiote_output_config_t gpiote_output_cfg = NRFX_GPIOTE_DEFAULT_OUTPUT_CONFIG; + + err = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE); + if (err != 0) { + printk("Error %d: failed to configure LED device %s pin %d\n", err, led.port->name, + led.pin); + return err; + } + + if (nrfx_gpiote_channel_alloc(&gpiote, &gpiote_chan_led_toggle) != NRFX_SUCCESS) { + printk("Failed allocating GPIOTE chan for setting led\n"); + return -ENOMEM; + } + + 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, + }; + + if (nrfx_gpiote_output_configure(&gpiote, led.pin, &gpiote_output_cfg, + &task_cfg_led_toggle) != NRFX_SUCCESS) { + printk("Failed configuring GPIOTE chan for toggling led\n"); + return -ENOMEM; + } + + if (nrfx_gppi_channel_alloc(&ppi_chan_led_toggle) != NRFX_SUCCESS) { + printk("Failed allocating PPI chan for toggling led\n"); + return -ENOMEM; + } + + nrfx_gppi_channel_endpoints_setup(ppi_chan_led_toggle, + controller_time_trigger_event_addr_get(), + nrfx_gpiote_out_task_address_get(&gpiote, led.pin)); + + nrfx_gppi_channels_enable(BIT(ppi_chan_led_toggle)); + nrfx_gpiote_out_task_enable(&gpiote, led.pin); + + return 0; +} + +void timed_led_toggle_trigger_at(uint8_t value, uint32_t timestamp_us) +{ + if (value == previous_led_value) { + /* No need to set up trigger, as a trigger has already been configured. */ + return; + } + + /* First obtain the full 64-bit time. */ + const uint64_t current_time_us = controller_time_us_get(); + const uint64_t current_time_most_significant_word = current_time_us & 0xFFFFFFFF00000000UL; + + const uint64_t full_timestamp_us = current_time_most_significant_word | timestamp_us; + + controller_time_trigger_set(full_timestamp_us); + + previous_led_value = value; +} diff --git a/samples/bluetooth/llpm/README.rst b/samples/bluetooth/llpm/README.rst index bb8f43b4be8a..e8ae9ce42395 100644 --- a/samples/bluetooth/llpm/README.rst +++ b/samples/bluetooth/llpm/README.rst @@ -97,7 +97,7 @@ Testing After programming the sample to both development kits, test it by performing the following steps: -1. Connect to both kits with a terminal emulator (for example, nRF Connect Serial Terminal). +1. Connect to both kits with a terminal emulator (for example, `nRF Connect Serial Terminal`_). See :ref:`test_and_optimize` for the required settings and steps. #. Reset both kits. #. In one of the terminal emulators, type "c" to start the application on the connected board in the central (tester) role. diff --git a/samples/bluetooth/llpm/sample.yaml b/samples/bluetooth/llpm/sample.yaml index acb885896020..0a97b39cdc94 100644 --- a/samples/bluetooth/llpm/sample.yaml +++ b/samples/bluetooth/llpm/sample.yaml @@ -5,8 +5,8 @@ tests: sample.bluetooth.llpm: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52840dongle_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52840dongle/nrf52840 tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/sample.yaml b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/sample.yaml index 874ba13cdff9..79c055d92b6c 100644 --- a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/sample.yaml +++ b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/sample.yaml @@ -5,9 +5,11 @@ tests: sample.bluetooth.mesh.ble_and_mesh: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/main.c b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/main.c index 63d7be67ef34..ed8fdf2fd9d6 100644 --- a/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/main.c +++ b/samples/bluetooth/mesh/ble_peripheral_lbs_coex/src/main.c @@ -24,8 +24,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/chat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/chat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/chat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/chat/sample.yaml b/samples/bluetooth/mesh/chat/sample.yaml index 5f8914760370..c12f4ccb3404 100644 --- a/samples/bluetooth/mesh/chat/sample.yaml +++ b/samples/bluetooth/mesh/chat/sample.yaml @@ -5,8 +5,10 @@ tests: sample.bluetooth.mesh.chat: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/chat/src/main.c b/samples/bluetooth/mesh/chat/src/main.c index deb79d81e44b..d0d74b5cd2d2 100644 --- a/samples/bluetooth/mesh/chat/src/main.c +++ b/samples/bluetooth/mesh/chat/src/main.c @@ -25,8 +25,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/dfu/common/src/dfu_target.c b/samples/bluetooth/mesh/dfu/common/src/dfu_target.c index 78e796bcf47b..1dc58f262316 100644 --- a/samples/bluetooth/mesh/dfu/common/src/dfu_target.c +++ b/samples/bluetooth/mesh/dfu/common/src/dfu_target.c @@ -56,13 +56,13 @@ static bool is_firmware_newer(struct mcuboot_img_sem_ver *new, struct mcuboot_im if (new->minor > cur->minor) { return true; - } else if (new->minor > cur->minor) { + } else if (new->minor < cur->minor) { return false; } if (new->revision > cur->revision) { return true; - } else if (new->revision > cur->revision) { + } else if (new->revision < cur->revision) { return false; } diff --git a/samples/bluetooth/mesh/dfu/distributor/README.rst b/samples/bluetooth/mesh/dfu/distributor/README.rst index 7deca479d3b6..042a05ef0ba1 100644 --- a/samples/bluetooth/mesh/dfu/distributor/README.rst +++ b/samples/bluetooth/mesh/dfu/distributor/README.rst @@ -116,7 +116,7 @@ Building and running Testing ======= -This sample has been tested with the nRF52840 DK (nrf52840dk_nrf52840) board. +This sample has been tested with the nRF52840 DK (nrf52840dk/nrf52840) board. .. _ble_mesh_dfu_distributor_provisioning: @@ -170,7 +170,7 @@ The management subsystem uses the Simple Management Protocol (SMP), provided by This sample supports Bluetooth Low Energy and UART as the SMP transport. See :ref:`zephyr:device_mgmt` for more information about Mcumgr and SMP. -In this sample, the device flash is split into fixed partitions using devicetree as defined in :zephyr_file:`nrf52840dk_nrf52840.dts`. +In this sample, the device flash is split into fixed partitions using devicetree as defined in :zephyr_file:`nrf52840dk_nrf52840.dts`. The firmware image that is to be distributed over Bluetooth Mesh network should be stored at slot-1. The sample uses :ref:`zephyr:flash_map_api` to read the firmware image from slot-1 when distributes it to Target nodes. @@ -219,6 +219,8 @@ When the Distributor updates itself, the DFU transfer will end immediately after When this sample is used as a Target, it behaves as described in :ref:`ble_mesh_dfu_target_upgrade`. +This sample also provides support for :ref:`dfu_over_ble`, so it is possible to self-update using the Simple Management Protocol (SMP). + SMP over Bluetooth authentication ================================= @@ -230,7 +232,7 @@ See `Zephyr Bluetooth LE Security`_ for more details about securing the Bluetoot The sample supports the :ref:`bt_mesh_le_pair_resp_readme` model that allows sending a passkey over a mesh network when the Distributor has no means of displaying the passkey. When the model and the :kconfig:option:`CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN` option are enabled while a remote device tries to read the SMP characteristics, the pairing request will be initiated and the sample will require the remote device to enter the passkey generated by the model. -To enable the LE pairing authentication with the LE Pairing Responder model support, set :makevar:`OVERLAY_CONFIG` to :file:`overlay-smp-bt-auth.conf` file when building the sample. +To enable the LE pairing authentication with the LE Pairing Responder model support, set :makevar:`EXTRA_CONF_FILE` to :file:`overlay-smp-bt-auth.conf` file when building the sample. Logging ======= diff --git a/samples/bluetooth/mesh/dfu/distributor/sample.yaml b/samples/bluetooth/mesh/dfu/distributor/sample.yaml index dfc1eb185d18..c7643b31db28 100644 --- a/samples/bluetooth/mesh/dfu/distributor/sample.yaml +++ b/samples/bluetooth/mesh/dfu/distributor/sample.yaml @@ -4,13 +4,13 @@ tests: sample.bluetooth.mesh_dfu_distributor: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build sample.bluetooth.mesh_dfu_distributor.smp_bt_auth: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 extra_args: OVERLAY_CONFIG=overlay-smp-bt-auth.conf tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/dfu/distributor/src/main.c b/samples/bluetooth/mesh/dfu/distributor/src/main.c index ef18cd737354..87cf17165046 100644 --- a/samples/bluetooth/mesh/dfu/distributor/src/main.c +++ b/samples/bluetooth/mesh/dfu/distributor/src/main.c @@ -112,7 +112,11 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), &comp); if (err) { diff --git a/samples/bluetooth/mesh/dfu/target/CMakeLists.txt b/samples/bluetooth/mesh/dfu/target/CMakeLists.txt index 995bc10bad58..d3f49f12751d 100644 --- a/samples/bluetooth/mesh/dfu/target/CMakeLists.txt +++ b/samples/bluetooth/mesh/dfu/target/CMakeLists.txt @@ -6,8 +6,16 @@ project(mesh_dfu_target) set(dfu_common_dir ${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/dfu/common/src) -include_directories(${dfu_common_dir}) +include_directories( + ${dfu_common_dir} + ${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/common +) FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources} - ${dfu_common_dir}/dfu_target.c) + ${dfu_common_dir}/dfu_target.c +) + +target_sources_ifdef(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU app PRIVATE ${app_sources} + ${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/common/smp_bt.c +) diff --git a/samples/bluetooth/mesh/dfu/target/README.rst b/samples/bluetooth/mesh/dfu/target/README.rst index e9b91ff8a2f3..50873b6a9b78 100644 --- a/samples/bluetooth/mesh/dfu/target/README.rst +++ b/samples/bluetooth/mesh/dfu/target/README.rst @@ -29,6 +29,14 @@ For uploading an image to the Distributor, this sample also requires a smartphon * `nRF Device Manager mobile app for Android`_ * `nRF Device Manager mobile app for iOS`_ +Point-to-point DFU requirements +******************************* + +The configuration overlay :file:`overlay-ptp_dfu.conf` enables the :ref:`dfu_over_ble` feature. + +This feature can be used together with Bluetooth Mesh DFU. +If the Bluetooth Mesh DFU procedure is suspended, failing, or if the Bluetooth Mesh network is not available, the point-to-point DFU feature can be used as a backup option for the DFU process. + Overview ******** @@ -167,6 +175,9 @@ Only 2 options are supported by this sample: In this case, the device unprovisions itself before programming the new firmware. The unprovisioning happens before the device reboots, so if the MCUboot fails to validate the new firmware, the device will boot unprovisioned anyway. +.. note:: + To create the new Composition Data and see the :c:enum:`BT_MESH_DFU_EFFECT_UNPROV` effect, you can, for example, turn off the Friend feature in the :file:`prj.conf` file by setting the :kconfig:option:`CONFIG_BT_MESH_FRIEND` option to ``n``. + In this sample, the device flash is split into partitions using the :ref:`partition_manager`. When the DFU transfer starts, the sample stores the new firmware at the MCUboot secondary slot using the :ref:`zephyr:flash_map_api`. diff --git a/samples/bluetooth/mesh/dfu/target/overlay-ptp_dfu.conf b/samples/bluetooth/mesh/dfu/target/overlay-ptp_dfu.conf new file mode 100644 index 000000000000..f38ff9213103 --- /dev/null +++ b/samples/bluetooth/mesh/dfu/target/overlay-ptp_dfu.conf @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable point to point DFU over SMP +CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y +CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y + +# Increase Extended Advertiser Set to advertise BT SMP service +CONFIG_BT_EXT_ADV_MAX_ADV_SET=6 + +# One extra connection for mesh GATT/proxy and one for SMP BT. +CONFIG_BT_MAX_CONN=3 + +# One extra identity for SMP service +CONFIG_BT_ID_MAX=2 diff --git a/samples/bluetooth/mesh/dfu/target/sample.yaml b/samples/bluetooth/mesh/dfu/target/sample.yaml index 649e6865e5c7..426d20615e64 100644 --- a/samples/bluetooth/mesh/dfu/target/sample.yaml +++ b/samples/bluetooth/mesh/dfu/target/sample.yaml @@ -4,7 +4,7 @@ tests: sample.bluetooth.mesh_dfu_target: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52840dongle_nrf52840 + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52840dongle/nrf52840 tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/dfu/target/src/main.c b/samples/bluetooth/mesh/dfu/target/src/main.c index 07617235e1b3..ced4f83e8d88 100644 --- a/samples/bluetooth/mesh/dfu/target/src/main.c +++ b/samples/bluetooth/mesh/dfu/target/src/main.c @@ -14,6 +14,9 @@ #include #include #include "dfu_target.h" +#if defined(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU) +#include "smp_bt.h" +#endif static struct bt_mesh_blob_io_flash blob_flash_stream; @@ -97,7 +100,11 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), &comp); if (err) { @@ -113,6 +120,14 @@ static void bt_ready(int err) printk("Mesh initialized\n"); +#if defined(CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU) + /* Start advertising SMP BT service. */ + err = smp_dfu_init(); + if (err) { + printk("SMP initialization failed (err: %d)\n", err); + } +#endif + /* Confirm the image and mark it as applied after the mesh started. */ dfu_target_image_confirm(); } diff --git a/samples/bluetooth/mesh/light/README.rst b/samples/bluetooth/mesh/light/README.rst index 9d08f301ea1f..00a8aa4289a1 100644 --- a/samples/bluetooth/mesh/light/README.rst +++ b/samples/bluetooth/mesh/light/README.rst @@ -37,8 +37,9 @@ DFU requirements The configuration overlay :file:`overlay-dfu.conf` enables DFU support in the application, and applies for the following platforms: -* nrf52840dk_nrf52840 -* nrf21540dk_nrf52840 +* nrf52840dk/nrf52840 +* nrf21540dk/nrf52840 +* nrf54l15pdk/nrf54l15/cpuapp While this overlay configuration is only applicable for the mentioned platforms in this sample, DFU over Bluetooth Low Energy may be used on other platforms as well. @@ -131,12 +132,12 @@ This sample is split into the following source files: DFU configuration ================= -To enable the DFU feature for the supported nRF52 Series development kits, set :makevar:`OVERLAY_CONFIG` to :file:`overlay-dfu.conf` when building the sample. +To enable the DFU feature for the supported development kits, set :makevar:`EXTRA_CONF_FILE` to :file:`overlay-dfu.conf` when building the sample. For example, when building from the command line, use the following command: .. code-block:: console - west build -b -p -- -DOVERLAY_CONFIG="overlay-dfu.conf" + west build -b -p -- -DEXTRA_CONF_FILE="overlay-dfu.conf" The configuration overlay :file:`overlay-dfu.conf` enables the DFU feature. To review the required configuration alterations, open and inspect the :file:`overlay-dfu.conf` file. diff --git a/samples/bluetooth/mesh/light/VERSION b/samples/bluetooth/mesh/light/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/mesh/light/VERSION +++ b/samples/bluetooth/mesh/light/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/mesh/light/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/light/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..64c540fb556e --- /dev/null +++ b/samples/bluetooth/mesh/light/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n +CONFIG_SPI_NOR=n diff --git a/samples/bluetooth/mesh/light/sample.yaml b/samples/bluetooth/mesh/light/sample.yaml index 8df85866d32c..53eb85fc0921 100644 --- a/samples/bluetooth/mesh/light/sample.yaml +++ b/samples/bluetooth/mesh/light/sample.yaml @@ -5,22 +5,24 @@ tests: sample.bluetooth.mesh.light: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 nrf52833dk_nrf52833 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf52833dk/nrf52833 nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build sample.bluetooth.mesh.light.dfu: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf21540dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp extra_args: OVERLAY_CONFIG=overlay-dfu.conf tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/light/src/main.c b/samples/bluetooth/mesh/light/src/main.c index 86c59a9d3757..ef1aa956256e 100644 --- a/samples/bluetooth/mesh/light/src/main.c +++ b/samples/bluetooth/mesh/light/src/main.c @@ -23,8 +23,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/light_ctrl/README.rst b/samples/bluetooth/mesh/light_ctrl/README.rst index bdccd5f16401..fb6e7ba84cd5 100644 --- a/samples/bluetooth/mesh/light_ctrl/README.rst +++ b/samples/bluetooth/mesh/light_ctrl/README.rst @@ -174,7 +174,7 @@ FEM support Emergency data storage ====================== -To build this sample with support for emergency data storage (EMDS), set ``OVERLAY_CONFIG`` to :file:`overlay-emds.conf`. +To build this sample with support for emergency data storage (EMDS), set ``EXTRA_CONF_FILE`` to :file:`overlay-emds.conf`. This will save replay protection list (RPL) data and some of the :ref:`bt_mesh_lightness_srv_readme` data to the emergency data storage instead of to the :ref:`settings_api`. When using EMDS, certain considerations need to be taken regarding hardware choices in your application design. See :ref:`emds_readme_application_integration` in the EMDS documentation for more information. @@ -225,9 +225,10 @@ You should now see the following actions: #. The LED stays at 100% for three seconds **On**. #. The LED fades from 100% to :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG` over five seconds **On > Prolong**. #. The LED stays at :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG` for three seconds **Prolong**. -#. The LED fades from :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG` to 0% over five seconds **Prolong > Standby**. +#. The LED fades from :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG` to :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_STANDBY` over five seconds **Prolong > Standby**. The default value of :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG` is 10000 (~15%). +The default value of :kconfig:option:`CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_STANDBY` is 0 (0%). .. figure:: images/bt_mesh_light_ctrl_levels.svg :alt: Light level transitions over time @@ -249,6 +250,45 @@ Configure the Sensor Setup Server model on the **Mesh Sensor** node: The Sensor Setup Server model is now configured and able to receive sensor setting messages from the Sensor Client. +.. _bluetooth_mesh_light_lc_occupancy_mode: + +Occupancy mode +-------------- + +You can combine this sample with the :ref:`bluetooth_mesh_sensor_server` sample to trigger the :ref:`Occupancy On ` event on the Light LC Server by the Occupancy sensor. + +To do this, first configure the Light LC Server on the **Mesh Light Fixture** node: + +* Bind the model to **Application Key 1**. +* Set the subscription parameters: Create a dedicated group address. + +Prepare the :ref:`bluetooth_mesh_sensor_server` sample: + +* Build, run and provision the **Occupancy Sensor** node as described in the sample's documentation. + +Configure the Occupancy Sensor Server that is instantiated on the Element 2 of the :ref:`bluetooth_mesh_sensor_server` sample: + +* Bind the model to **Application Key 1**. +* Set the publication parameters: + + * Destination/publish address: Select the same group as the Light LC Server is subscribed to. + +To evaluate occupancy inputs when light is not in **Standby** state: + +* Open the **Mesh Light Fixture** node in the mobile app. +* Open the Generic OnOff Server in the second element, then tap :guilabel:`ON` at the bottom of the Generic On Off Controls. + This will bring the Light LC Server out of **Standby** state. +* Now, when the Light LC Server is not in the **Standby** state, press ``Button 2`` on the **Occupancy Sensor** node to keep the light in the **On** state. +* If the Light LC Server enters the **Standby** state, Occupancy sensor inputs will not have any effect because the default value of the Light LC Occupancy Mode state is ``0``. + +When using the `nRF Mesh mobile app for iOS`_, you can change the value of the Light LC Occupancy Mode state to ``1``, and see how Occupancy sensor inputs will turn the light ON from the **Standby** state. +Do this in the following way: + +* Open the **Mesh Light Fixture** node in the mobile app for iOS. +* Go to the Light LC Server configuration that is located on the Element 2. +* Scroll down to the **OCCUPANCY MODE** and tap :guilabel:`ON` to enable the Occupancy mode in the **Standby** state. +* When the Light LC Server is in the **Standby** state, press ``Button 2`` on the **Occupancy Sensor** node. + Dependencies ************ diff --git a/samples/bluetooth/mesh/light_ctrl/VERSION b/samples/bluetooth/mesh/light_ctrl/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/mesh/light_ctrl/VERSION +++ b/samples/bluetooth/mesh/light_ctrl/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/mesh/light_ctrl/sample.yaml b/samples/bluetooth/mesh/light_ctrl/sample.yaml index 5d80c2702139..7946434907e9 100644 --- a/samples/bluetooth/mesh/light_ctrl/sample.yaml +++ b/samples/bluetooth/mesh/light_ctrl/sample.yaml @@ -5,30 +5,30 @@ tests: sample.bluetooth.mesh.light_ctrl: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 - - nrf52840dongle_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 nrf52833dk_nrf52833 nrf52840dongle_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + - nrf52840dongle/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf52833dk/nrf52833 nrf52840dongle/nrf52840 tags: bluetooth ci_build sample.bluetooth.mesh.light_ctrl.emds: extra_args: OVERLAY_CONFIG="overlay-emds.conf" build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 nrf52833dk_nrf52833 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf52833dk/nrf52833 tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/light_ctrl/src/main.c b/samples/bluetooth/mesh/light_ctrl/src/main.c index fd98ce698d46..27d76ad1701d 100644 --- a/samples/bluetooth/mesh/light_ctrl/src/main.c +++ b/samples/bluetooth/mesh/light_ctrl/src/main.c @@ -66,8 +66,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } #ifdef CONFIG_EMDS static struct button_handler button_handler = { diff --git a/samples/bluetooth/mesh/light_dimmer/README.rst b/samples/bluetooth/mesh/light_dimmer/README.rst index 173ffcfe813b..4ee8aade3ada 100644 --- a/samples/bluetooth/mesh/light_dimmer/README.rst +++ b/samples/bluetooth/mesh/light_dimmer/README.rst @@ -54,8 +54,8 @@ This mobile application is also used to configure key bindings, and publication After provisioning and configuring the mesh models supported by the sample in the `nRF Mesh mobile app`_, **Button 1** on the Mesh Light Dimmer device can be used to control the configured network nodes' LEDs, while **Button 2** can be used to store and restore scenes on the network nodes. .. note:: - When running this sample on Thingy:53 or the :ref:`zephyr:nrf52840dongle_nrf52840`, the scene selection functionality will not be available as the device only has one button. - The single button of Thingy:53 and the dongle will be used for dimming and the on/off functionality as described for **Button 1** in this documentation. + When running this sample on the :ref:`zephyr:nrf52840dongle_nrf52840`, the scene selection functionality will not be available as the device only has one button. + The single button of the dongle will be used for dimming and the on/off functionality as described for **Button 1** in this documentation. Provisioning ============ @@ -116,15 +116,18 @@ Button 2: On long press and release, **Button 2** will publish a Scene Store message using the configured publication parameters of its model instance, and store the current LED state of all the targets under the scene with the most recently recalled scene number. -.. note:: - :ref:`zephyr:thingy53_nrf5340` and the :ref:`zephyr:nrf52840dongle_nrf52840` only support dimming and the on/off functionality, not the scene selection functionality. + .. note:: + On the :ref:`zephyr:nrf52840dongle_nrf52840`, the scene selection functionality will not be available as the device only has one button. + + .. tip:: + On Thingy:53, **Button 2** can be accessed by removing the top part of the casing. LEDs: Show the OOB authentication value during provisioning if the "Push button" OOB method is used. -.. note:: - :ref:`zephyr:thingy53_nrf5340` supports only one RGB LED. - Each RGB LED channel is used as separate LED. + .. note:: + :ref:`zephyr:thingy53_nrf5340` supports only one RGB LED. + Each RGB LED channel is used as separate LED. Configuration ************* diff --git a/samples/bluetooth/mesh/light_dimmer/VERSION b/samples/bluetooth/mesh/light_dimmer/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/mesh/light_dimmer/VERSION +++ b/samples/bluetooth/mesh/light_dimmer/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/mesh/light_dimmer/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/light_dimmer/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/light_dimmer/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/light_dimmer/sample.yaml b/samples/bluetooth/mesh/light_dimmer/sample.yaml index 7908fbac2b2a..cf6278ff32fa 100644 --- a/samples/bluetooth/mesh/light_dimmer/sample.yaml +++ b/samples/bluetooth/mesh/light_dimmer/sample.yaml @@ -5,15 +5,17 @@ tests: sample.bluetooth.mesh.light_dimmer: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 - - nrf52840dongle_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 nrf52833dk_nrf52833 nrf52840dongle_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf52833dk/nrf52833 nrf52840dongle/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/light_dimmer/src/main.c b/samples/bluetooth/mesh/light_dimmer/src/main.c index c9c9be5c6bef..7b7141023a7e 100644 --- a/samples/bluetooth/mesh/light_dimmer/src/main.c +++ b/samples/bluetooth/mesh/light_dimmer/src/main.c @@ -22,8 +22,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/light_switch/README.rst b/samples/bluetooth/mesh/light_switch/README.rst index 9cd9df6456b1..37f265b078f8 100644 --- a/samples/bluetooth/mesh/light_switch/README.rst +++ b/samples/bluetooth/mesh/light_switch/README.rst @@ -41,11 +41,11 @@ Low Power node requirements The configuration overlay :file:`overlay-lpn.conf` is optimized for the following boards: -* nrf52dk_nrf52832 +* nrf52dk/nrf52832 -* nrf52840dk_nrf52840 +* nrf52840dk/nrf52840 -* nrf52833dk_nrf52833 +* nrf52833dk/nrf52833 However, the same configuration can be applied to other platforms that support the Bluetooth Mesh Light Switch sample, as long as the device supports at least four buttons. @@ -137,9 +137,9 @@ The following table shows a list of the supported boards for the LPN configurati =================== ======================== ==================== Board Avg. consumption non-LPN Avg. consumption LPN =================== ======================== ==================== - nrf52dk_nrf52832 7.14 mA 13.69 µA - nrf52840dk_nrf52840 6.71 mA 14.63 µA - nrf52833dk_nrf52833 6.10 mA 14.43 µA + nrf52dk/nrf52832 7.14 mA 13.69 µA + nrf52840dk/nrf52840 6.71 mA 14.63 µA + nrf52833dk/nrf52833 6.10 mA 14.43 µA =================== ======================== ==================== The following applies to the LPN measurements presented in this table: @@ -206,12 +206,12 @@ The light switch sample is split into the following source files: LPN configuration ================= -To make the light switch run as an LPN, set :makevar:`OVERLAY_CONFIG` to :file:`overlay-lpn.conf` when building the sample. +To make the light switch run as an LPN, set :makevar:`EXTRA_CONF_FILE` to :file:`overlay-lpn.conf` when building the sample. For example, when building from the command line, use the following command: .. code-block:: console - west build -b -p -- -DOVERLAY_CONFIG="overlay-lpn.conf" + west build -b -p -- -DEXTRA_CONF_FILE="overlay-lpn.conf" The configuration overlay :file:`overlay-lpn.conf` enables the LPN feature, and alters certain configuration options to further lower the power consumption. To review the specific alterations, open and inspect the :file:`overlay-lpn.conf` file. diff --git a/samples/bluetooth/mesh/light_switch/VERSION b/samples/bluetooth/mesh/light_switch/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/mesh/light_switch/VERSION +++ b/samples/bluetooth/mesh/light_switch/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/mesh/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/light_switch/overlay-lpn.conf b/samples/bluetooth/mesh/light_switch/overlay-lpn.conf index a9072d1e2c5e..f69c95d9f94e 100644 --- a/samples/bluetooth/mesh/light_switch/overlay-lpn.conf +++ b/samples/bluetooth/mesh/light_switch/overlay-lpn.conf @@ -16,7 +16,9 @@ CONFIG_BT_MESH_ADV_EXT_GATT_SEPARATE=n # Serial communication consumes considerable power CONFIG_SERIAL=n +CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n +CONFIG_LOG=n # While enabled, secure beacons will be advertised periodically. # This consumes power, and is not required for an LPN node. diff --git a/samples/bluetooth/mesh/light_switch/sample.yaml b/samples/bluetooth/mesh/light_switch/sample.yaml index 4ffabbba6e4f..357912ba96c3 100644 --- a/samples/bluetooth/mesh/light_switch/sample.yaml +++ b/samples/bluetooth/mesh/light_switch/sample.yaml @@ -5,23 +5,26 @@ tests: sample.bluetooth.mesh.light_switch: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 nrf52833dk_nrf52833 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf52833dk/nrf52833 nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build sample.bluetooth.mesh.light_switch.lpn: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52833dk_nrf52833 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52833dk/nrf52833 + nrf54l15pdk/nrf54l15/cpuapp extra_args: OVERLAY_CONFIG=overlay-lpn.conf tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/light_switch/src/main.c b/samples/bluetooth/mesh/light_switch/src/main.c index f395526a0d22..4af0216e1609 100644 --- a/samples/bluetooth/mesh/light_switch/src/main.c +++ b/samples/bluetooth/mesh/light_switch/src/main.c @@ -22,8 +22,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/sensor_client/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/sensor_client/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/sensor_client/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/sensor_client/sample.yaml b/samples/bluetooth/mesh/sensor_client/sample.yaml index 892a76c7d64b..6baa8307493b 100644 --- a/samples/bluetooth/mesh/sensor_client/sample.yaml +++ b/samples/bluetooth/mesh/sensor_client/sample.yaml @@ -5,8 +5,10 @@ tests: sample.bluetooth.mesh.sensor_client: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/sensor_client/src/main.c b/samples/bluetooth/mesh/sensor_client/src/main.c index 189a293f3ae3..84f40367945a 100644 --- a/samples/bluetooth/mesh/sensor_client/src/main.c +++ b/samples/bluetooth/mesh/sensor_client/src/main.c @@ -22,8 +22,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/sensor_server/README.rst b/samples/bluetooth/mesh/sensor_server/README.rst index ff6a34857e29..f6ff9336cacc 100644 --- a/samples/bluetooth/mesh/sensor_server/README.rst +++ b/samples/bluetooth/mesh/sensor_server/README.rst @@ -113,7 +113,11 @@ The descriptor also specifies the temperature sensor's sampling type, which is : The :ref:`dk_buttons_and_leds_readme` library is used to detect button presses. -The :ref:`Zephyr settings API ` is used to persistently store the sensor range setting for the temperature sensor, given that :kconfig:option:`CONFIG_BT_SETTING` is enabled. +The :ref:`Zephyr settings API ` is used to persistently store the following settings given that :kconfig:option:`CONFIG_BT_SETTING` is enabled: + +* The temperature range used in the :c:var:`bt_mesh_sensor_present_dev_op_temp` sensor +* The presence motion threshold used in the :c:var:`bt_mesh_sensor_presence_detected` sensor +* The ambient light level gain used in the :c:var:`bt_mesh_sensor_present_amb_light_level` sensor User interface ************** @@ -125,14 +129,14 @@ Buttons: Once the provisioning procedure has completed, the buttons will have the following functionality: Button 1: + Simulates different ambient light sensor values. + These dummy values represent raw values coming from an ambient light sensor. + +Button 2: Simulates presence detected. For how long the button has to be pressed before the presence is detected depends on the motion threshold. The motion threshold has five steps from 0 % (representing 0 seconds) to 100 % (representing 10 seconds) separated by 25 %-steps. -Button 2: - Simulates different ambient light sensor values. - These dummy values represent raw values coming from an ambient light sensor. - Configuration ************* diff --git a/samples/bluetooth/mesh/sensor_server/VERSION b/samples/bluetooth/mesh/sensor_server/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/mesh/sensor_server/VERSION +++ b/samples/bluetooth/mesh/sensor_server/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/mesh/sensor_server/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/sensor_server/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/sensor_server/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/sensor_server/sample.yaml b/samples/bluetooth/mesh/sensor_server/sample.yaml index 3d24fece8e7a..78513711a8be 100644 --- a/samples/bluetooth/mesh/sensor_server/sample.yaml +++ b/samples/bluetooth/mesh/sensor_server/sample.yaml @@ -5,11 +5,12 @@ tests: sample.bluetooth.mesh.sensor_server: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - thingy53_nrf5340_cpuapp - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - thingy53/nrf5340/cpuapp + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp platform_allow: > - nrf52dk_nrf52832 nrf52840dk_nrf52840 thingy53_nrf5340_cpuapp - nrf21540dk_nrf52840 + nrf52dk/nrf52832 nrf52840dk/nrf52840 thingy53/nrf5340/cpuapp + nrf21540dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/sensor_server/src/main.c b/samples/bluetooth/mesh/sensor_server/src/main.c index 21900ad9f62f..1f3f3f70a0e0 100644 --- a/samples/bluetooth/mesh/sensor_server/src/main.c +++ b/samples/bluetooth/mesh/sensor_server/src/main.c @@ -22,8 +22,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - dk_leds_init(); - dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/mesh/sensor_server/src/model_handler.c b/samples/bluetooth/mesh/sensor_server/src/model_handler.c index 1b72d6a3abac..79c65c9d92dc 100644 --- a/samples/bluetooth/mesh/sensor_server/src/model_handler.c +++ b/samples/bluetooth/mesh/sensor_server/src/model_handler.c @@ -126,11 +126,14 @@ static int chip_temp_get(struct bt_mesh_sensor_srv *srv, err = sensor_channel_get(dev, SENSOR_DATA_TYPE, &channel_val); if (err) { printk("Error getting temperature sensor data (%d)\n", err); + return err; } + err = bt_mesh_sensor_value_from_sensor_value( sensor->type->channels[0].format, &channel_val, rsp); if (err) { printk("Error encoding temperature sensor data (%d)\n", err); + return err; } if (!BT_MESH_SENSOR_VALUE_IN_RANGE(rsp, &temp_range.start, &temp_range.end)) { @@ -146,7 +149,8 @@ static int chip_temp_get(struct bt_mesh_sensor_srv *srv, tot_temp_samps++; - return err; + printk("Chip temp: %s, total samples: %d\n", bt_mesh_sensor_ch_str(rsp), tot_temp_samps); + return 0; } /* Tolerance is based on the nRF52832's temperature sensor's accuracy and range (5/125 = 4%). */ @@ -409,7 +413,9 @@ static int presence_detected_get(struct bt_mesh_sensor_srv *srv, pres_detect * 1000000LL, rsp); if (err) { - printk("Error encoding presence detected (%d)", err); + printk("Error encoding presence detected (%d)\n", err); + } else { + printk("Presence detected: %d\n", pres_detect); } return err; }; @@ -439,6 +445,9 @@ static int time_since_presence_detected_get(struct bt_mesh_sensor_srv *srv, err = bt_mesh_sensor_value_from_micro(format, micro_since_detect, rsp); if (err == -ERANGE) { + printk("Warning: Time since presence detected (%u) is out of range and was" + " clamped to (%s)\n", (uint32_t)(k_uptime_get() - prev_detect), + bt_mesh_sensor_ch_str(rsp)); /* Ignore range error and respond with clamped value */ return 0; } @@ -451,7 +460,10 @@ static int time_since_presence_detected_get(struct bt_mesh_sensor_srv *srv, } if (err) { - printk("Error encoding time since presence detected (%d)", err); + printk("Error encoding time since presence detected (%d)\n", err); + } else { + printk("Time since presence detected(%d): %s\n", pres_detect, + bt_mesh_sensor_ch_str(rsp)); } return err; } @@ -506,7 +518,7 @@ static int amb_light_level_gain_set(struct bt_mesh_sensor_srv *srv, (void)bt_mesh_sensor_value_to_float(value, &value_f); amb_light_level_gain_store(value_f); - printk("Ambient light level gain: %s\n", bt_mesh_sensor_ch_str(value)); + printk("Ambient light level gain set: %s\n", bt_mesh_sensor_ch_str(value)); return 0; } @@ -535,14 +547,14 @@ static int amb_light_level_ref_set(struct bt_mesh_sensor_srv *srv, /* When using the a real ambient light sensor the sensor value should be * read and used instead of the dummy value. */ - if (dummy_ambient_light_value > 0.0) { + if (dummy_ambient_light_value > 0.0f) { amb_light_level_gain_store(ref_float / dummy_ambient_light_value); } else { amb_light_level_gain_store(FLT_MAX); } - printk("Ambient light level ref(%s) ", bt_mesh_sensor_ch_str(value)); - printk("gain(%f)\n", amb_light_level_gain); + printk("Ambient light level ref set: %s gain(%f)\n", bt_mesh_sensor_ch_str(value), + (double)amb_light_level_gain); return 0; } @@ -620,6 +632,7 @@ static int amb_light_level_get(struct bt_mesh_sensor_srv *srv, return err; } + printk("Ambient light level: %s\n", bt_mesh_sensor_ch_str(rsp)); return 0; } @@ -677,7 +690,9 @@ static void presence_detected(struct k_work *work) err = bt_mesh_sensor_srv_pub(&occupancy_sensor_srv, NULL, &presence_sensor, &val); if (err) { - printk("Error publishing end of presence (%d)\n", err); + printk("Error publishing presence (%d)\n", err); + } else { + printk("Publishing presence\n"); } pres_detect = 1; @@ -694,27 +709,58 @@ static const double dummy_amb_light_values[] = { 167772.13, }; +#define BUTTON_PRESSED(p, c, b) ((p & b) && (c & b)) +#define BUTTON_RELEASED(p, c, b) (!(p & b) && (c & b)) + static void button_handler_cb(uint32_t pressed, uint32_t changed) { if (!bt_mesh_is_provisioned()) { return; } - if (pressed & changed & BIT(0)) { + if (BUTTON_PRESSED(pressed, changed, BIT(0))) { + int err; + static int amb_light_idx; + struct bt_mesh_sensor_value val; + + dummy_ambient_light_value = dummy_amb_light_values[amb_light_idx++]; + amb_light_idx = amb_light_idx % ARRAY_SIZE(dummy_amb_light_values); + + err = bt_mesh_sensor_value_from_float( + present_amb_light_level.type->channels[0].format, + dummy_ambient_light_value, &val); + if (err) { + printk("Error getting ambient light level sensor data (%d)\n", err); + } + + err = bt_mesh_sensor_srv_pub(&ambient_light_sensor_srv, NULL, + &present_amb_light_level, &val); + if (err) { + printk("Error publishing present ambient light level (%d)\n", err); + } else { + printk("Publishing present ambient light level %s\n", + bt_mesh_sensor_ch_str(&val)); + } + } + + if (BUTTON_PRESSED(pressed, changed, BIT(1))) { int64_t thres_micros; enum bt_mesh_sensor_value_status status; status = bt_mesh_sensor_value_to_micro(&pres_mot_thres, &thres_micros); if (bt_mesh_sensor_value_status_is_numeric(status)) { k_work_reschedule(&presence_detected_work, K_MSEC(thres_micros / 10000)); + printk("Presence will be published in %d ms\n", + (uint16_t)(thres_micros / 10000)); } else { /* Value is not known, register presence immediately */ k_work_reschedule(&presence_detected_work, K_NO_WAIT); } } - if ((!pressed) & changed & BIT(0)) { + if (BUTTON_RELEASED(pressed, changed, BIT(1))) { if (!pres_detect) { + printk("Publishing presence is aborted\n"); k_work_cancel_delayable(&presence_detected_work); } else { int err; @@ -724,35 +770,15 @@ static void button_handler_cb(uint32_t pressed, uint32_t changed) &presence_sensor, &val); if (err) { - printk("Error publishing presence (%d)\n", err); + printk("Error publishing end of presence (%d)\n", err); + } else { + printk("Publishing end of presence\n"); } pres_detect = 0; prev_detect = k_uptime_get_32(); } } - - if (pressed & changed & BIT(1)) { - int err; - static int amb_light_idx; - struct bt_mesh_sensor_value val; - - dummy_ambient_light_value = dummy_amb_light_values[amb_light_idx++]; - amb_light_idx = amb_light_idx % ARRAY_SIZE(dummy_amb_light_values); - - err = bt_mesh_sensor_value_from_float( - present_amb_light_level.type->channels[0].format, - dummy_ambient_light_value, &val); - if (err) { - printk("Error getting ambient light level sensor data (%d)\n", err); - } - - err = bt_mesh_sensor_srv_pub(&ambient_light_sensor_srv, NULL, - &present_amb_light_level, &val); - if (err) { - printk("Error publishing present ambient light level (%d)\n", err); - } - } } static struct button_handler button_handler = { diff --git a/samples/bluetooth/mesh/silvair_enocean/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/mesh/silvair_enocean/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..6859400164de --- /dev/null +++ b/samples/bluetooth/mesh/silvair_enocean/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf54l15 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=n diff --git a/samples/bluetooth/mesh/silvair_enocean/sample.yaml b/samples/bluetooth/mesh/silvair_enocean/sample.yaml index 5d673ce0cd42..3268a4db697d 100644 --- a/samples/bluetooth/mesh/silvair_enocean/sample.yaml +++ b/samples/bluetooth/mesh/silvair_enocean/sample.yaml @@ -5,12 +5,14 @@ tests: sample.bluetooth.mesh.silvair_enocean: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns nrf21540dk_nrf52840 nrf52833dk_nrf52833 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf21540dk/nrf52840 nrf52833dk/nrf52833 + nrf54l15pdk/nrf54l15/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/mesh/silvair_enocean/src/main.c b/samples/bluetooth/mesh/silvair_enocean/src/main.c index 0c5873e142e1..8109354a9d55 100644 --- a/samples/bluetooth/mesh/silvair_enocean/src/main.c +++ b/samples/bluetooth/mesh/silvair_enocean/src/main.c @@ -22,8 +22,17 @@ static void bt_ready(int err) printk("Bluetooth initialized\n"); - (void) dk_leds_init(); - (void) dk_buttons_init(NULL); + err = dk_leds_init(); + if (err) { + printk("Initializing LEDs failed (err %d)\n", err); + return; + } + + err = dk_buttons_init(NULL); + if (err) { + printk("Initializing buttons failed (err %d)\n", err); + return; + } err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init()); if (err) { diff --git a/samples/bluetooth/multiple_adv_sets/sample.yaml b/samples/bluetooth/multiple_adv_sets/sample.yaml index 83e7d12aad38..9f64b175089d 100644 --- a/samples/bluetooth/multiple_adv_sets/sample.yaml +++ b/samples/bluetooth/multiple_adv_sets/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.multiple_adv_sets.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/nrf_dm/sample.yaml b/samples/bluetooth/nrf_dm/sample.yaml index 23335b56f0aa..45e0cc00d276 100644 --- a/samples/bluetooth/nrf_dm/sample.yaml +++ b/samples/bluetooth/nrf_dm/sample.yaml @@ -7,20 +7,20 @@ tests: extra_configs: - CONFIG_DM_HIGH_PRECISION_CALC=n integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp platform_allow: > - nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build sample.bluetooth.nrf_dm.timeslot.high_precision: build_only: true extra_configs: - CONFIG_DM_HIGH_PRECISION_CALC=y integration_platforms: - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52833dk_nrf52833 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/nrf_dm/src/peer.c b/samples/bluetooth/nrf_dm/src/peer.c index 5388ef11c6c1..861e754f102a 100644 --- a/samples/bluetooth/nrf_dm/src/peer.c +++ b/samples/bluetooth/nrf_dm/src/peer.c @@ -181,22 +181,22 @@ static void print_result(struct dm_result *result) printk("\tDistance estimates: "); if (result->ranging_mode == DM_RANGING_MODE_RTT) { - printk("rtt: rtt=%.2f\n", result->dist_estimates.rtt.rtt); + printk("rtt: rtt=%.2f\n", (double)result->dist_estimates.rtt.rtt); } else { #ifdef CONFIG_DM_HIGH_PRECISION_CALC printk("mcpd: high_precision=%.2f ifft=%.2f phase_slope=%.2f " "rssi_openspace=%.2f best=%.2f\n", - result->dist_estimates.mcpd.high_precision, - result->dist_estimates.mcpd.ifft, - result->dist_estimates.mcpd.phase_slope, - result->dist_estimates.mcpd.rssi_openspace, - result->dist_estimates.mcpd.best); + (double)result->dist_estimates.mcpd.high_precision, + (double)result->dist_estimates.mcpd.ifft, + (double)result->dist_estimates.mcpd.phase_slope, + (double)result->dist_estimates.mcpd.rssi_openspace, + (double)result->dist_estimates.mcpd.best); #else printk("mcpd: ifft=%.2f phase_slope=%.2f rssi_openspace=%.2f best=%.2f\n", - result->dist_estimates.mcpd.ifft, - result->dist_estimates.mcpd.phase_slope, - result->dist_estimates.mcpd.rssi_openspace, - result->dist_estimates.mcpd.best); + (double)result->dist_estimates.mcpd.ifft, + (double)result->dist_estimates.mcpd.phase_slope, + (double)result->dist_estimates.mcpd.rssi_openspace, + (double)result->dist_estimates.mcpd.best); #endif } } diff --git a/samples/bluetooth/peripheral_ams_client/sample.yaml b/samples/bluetooth/peripheral_ams_client/sample.yaml index 062d34bdda14..71f6f4f68d94 100644 --- a/samples/bluetooth/peripheral_ams_client/sample.yaml +++ b/samples/bluetooth/peripheral_ams_client/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.peripheral_ams_client.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_ancs_client/sample.yaml b/samples/bluetooth/peripheral_ancs_client/sample.yaml index 80268e6a340e..9f94f601b83d 100644 --- a/samples/bluetooth/peripheral_ancs_client/sample.yaml +++ b/samples/bluetooth/peripheral_ancs_client/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.peripheral_ancs_client.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_bms/CMakeLists.txt b/samples/bluetooth/peripheral_bms/CMakeLists.txt index 7dad911f5c7a..677ea228eb30 100644 --- a/samples/bluetooth/peripheral_bms/CMakeLists.txt +++ b/samples/bluetooth/peripheral_bms/CMakeLists.txt @@ -13,4 +13,3 @@ target_sources(app PRIVATE src/main.c ) # NORDIC SDK APP END -zephyr_library_include_directories(.) diff --git a/samples/bluetooth/peripheral_bms/sample.yaml b/samples/bluetooth/peripheral_bms/sample.yaml index e2c9e4972bfe..dce3327df859 100644 --- a/samples/bluetooth/peripheral_bms/sample.yaml +++ b/samples/bluetooth/peripheral_bms/sample.yaml @@ -5,8 +5,10 @@ tests: sample.bluetooth.peripheral_bms: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_cgms/CMakeLists.txt b/samples/bluetooth/peripheral_cgms/CMakeLists.txt index 88674cf82385..dfeaa6e6ad7f 100644 --- a/samples/bluetooth/peripheral_cgms/CMakeLists.txt +++ b/samples/bluetooth/peripheral_cgms/CMakeLists.txt @@ -11,5 +11,3 @@ project(peripheral_cgms) target_sources(app PRIVATE src/main.c ) - -zephyr_library_include_directories(.) diff --git a/samples/bluetooth/peripheral_cgms/sample.yaml b/samples/bluetooth/peripheral_cgms/sample.yaml index 1019451a940f..7a114bb7c356 100644 --- a/samples/bluetooth/peripheral_cgms/sample.yaml +++ b/samples/bluetooth/peripheral_cgms/sample.yaml @@ -5,11 +5,12 @@ tests: sample.bluetooth.peripheral_cgm: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_cgms/src/main.c b/samples/bluetooth/peripheral_cgms/src/main.c index a7e75835992a..227fbe682ae8 100644 --- a/samples/bluetooth/peripheral_cgms/src/main.c +++ b/samples/bluetooth/peripheral_cgms/src/main.c @@ -23,7 +23,7 @@ #define APP_GLUCOSE_MIN 88 #define APP_GLUCOSE_MAX 92 -#define APP_GLUCOSE_STEP 0.1 +#define APP_GLUCOSE_STEP 0.1f static bool session_state; diff --git a/samples/bluetooth/peripheral_cts_client/sample.yaml b/samples/bluetooth/peripheral_cts_client/sample.yaml index 0480aad4311c..fbc6eeed9f52 100644 --- a/samples/bluetooth/peripheral_cts_client/sample.yaml +++ b/samples/bluetooth/peripheral_cts_client/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.peripheral_cts_client.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_gatt_dm/CMakeLists.txt b/samples/bluetooth/peripheral_gatt_dm/CMakeLists.txt index df6b9fdbec78..54ed957c0991 100644 --- a/samples/bluetooth/peripheral_gatt_dm/CMakeLists.txt +++ b/samples/bluetooth/peripheral_gatt_dm/CMakeLists.txt @@ -13,4 +13,3 @@ target_sources(app PRIVATE src/main.c ) # NORDIC SDK APP END -zephyr_library_include_directories(.) diff --git a/samples/bluetooth/peripheral_gatt_dm/sample.yaml b/samples/bluetooth/peripheral_gatt_dm/sample.yaml index 6abadd95acaa..a7df195827f7 100644 --- a/samples/bluetooth/peripheral_gatt_dm/sample.yaml +++ b/samples/bluetooth/peripheral_gatt_dm/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.peripheral_gatt_dm: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_hids_keyboard/CMakeLists.txt b/samples/bluetooth/peripheral_hids_keyboard/CMakeLists.txt index 485fd3f049e9..5ea6224faab5 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/CMakeLists.txt +++ b/samples/bluetooth/peripheral_hids_keyboard/CMakeLists.txt @@ -12,5 +12,3 @@ FILE(GLOB app_sources src/*.c) # NORDIC SDK APP START target_sources(app PRIVATE ${app_sources}) # NORDIC SDK APP END - -zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) diff --git a/samples/bluetooth/peripheral_hids_keyboard/prj.conf b/samples/bluetooth/peripheral_hids_keyboard/prj.conf index 75e68851233c..8c71f4d16806 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/prj.conf +++ b/samples/bluetooth/peripheral_hids_keyboard/prj.conf @@ -10,7 +10,7 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_MAX_CONN=2 CONFIG_BT_MAX_PAIRED=2 CONFIG_BT_SMP=y -CONFIG_BT_L2CAP_TX_BUF_COUNT=5 +CONFIG_BT_ATT_TX_COUNT=5 CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Nordic_HIDS_keyboard" CONFIG_BT_DEVICE_APPEARANCE=961 diff --git a/samples/bluetooth/peripheral_hids_keyboard/sample.yaml b/samples/bluetooth/peripheral_hids_keyboard/sample.yaml index 555c72465549..66e3a57a11be 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/sample.yaml +++ b/samples/bluetooth/peripheral_hids_keyboard/sample.yaml @@ -5,17 +5,21 @@ tests: sample.bluetooth.peripheral_hids_keyboard: harness: bluetooth integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth sample.bluetooth.peripheral_hids_keyboard.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_hids_mouse/CMakeLists.txt b/samples/bluetooth/peripheral_hids_mouse/CMakeLists.txt index 485fd3f049e9..5ea6224faab5 100644 --- a/samples/bluetooth/peripheral_hids_mouse/CMakeLists.txt +++ b/samples/bluetooth/peripheral_hids_mouse/CMakeLists.txt @@ -12,5 +12,3 @@ FILE(GLOB app_sources src/*.c) # NORDIC SDK APP START target_sources(app PRIVATE ${app_sources}) # NORDIC SDK APP END - -zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) diff --git a/samples/bluetooth/peripheral_hids_mouse/README.rst b/samples/bluetooth/peripheral_hids_mouse/README.rst index 2b91e134eb46..a5d17cc0d7eb 100644 --- a/samples/bluetooth/peripheral_hids_mouse/README.rst +++ b/samples/bluetooth/peripheral_hids_mouse/README.rst @@ -66,14 +66,17 @@ Setup The HID service specification does not require encryption (:kconfig:option:`CONFIG_BT_HIDS_DEFAULT_PERM_RW_ENCRYPT`), but some systems disconnect from the HID devices that do not support security. +.. note:: + If you want to pair the device with a computer running MacOS, set the :kconfig:option:`CONFIG_BT_HIDS_DEFAULT_PERM_RW_AUTHEN` Kconfig option to ``y``. + Building and running ******************** -To build this sample with the :ref:`nrf_rpc_ipc_readme` library on the nRF5340 DK, set the :makevar:`OVERLAY_CONFIG` option to the :file:`overlay-nrf_rpc.conf` file. +To build this sample with the :ref:`nrf_rpc_ipc_readme` library on the nRF5340 DK, set the :makevar:`EXTRA_CONF_FILE` option to the :file:`overlay-nrf_rpc.conf` file. .. code-block:: - west build -b nrf5340dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-nrf_rpc.conf + west build -b nrf5340dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-nrf_rpc.conf .. |sample path| replace:: :file:`samples/bluetooth/peripheral_hids_mouse` diff --git a/samples/bluetooth/peripheral_hids_mouse/prj.conf b/samples/bluetooth/peripheral_hids_mouse/prj.conf index e4c7d47d237c..7575b840e44b 100644 --- a/samples/bluetooth/peripheral_hids_mouse/prj.conf +++ b/samples/bluetooth/peripheral_hids_mouse/prj.conf @@ -9,7 +9,7 @@ CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_MAX_CONN=2 CONFIG_BT_MAX_PAIRED=2 -CONFIG_BT_L2CAP_TX_BUF_COUNT=5 +CONFIG_BT_ATT_TX_COUNT=5 CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Nordic_HIDS_mouse" CONFIG_BT_DEVICE_APPEARANCE=962 diff --git a/samples/bluetooth/peripheral_hids_mouse/sample.yaml b/samples/bluetooth/peripheral_hids_mouse/sample.yaml index 471d4c0e82cc..432aac433f34 100644 --- a/samples/bluetooth/peripheral_hids_mouse/sample.yaml +++ b/samples/bluetooth/peripheral_hids_mouse/sample.yaml @@ -5,39 +5,43 @@ tests: sample.bluetooth.peripheral_hids_mouse: harness: bluetooth integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 tags: bluetooth sample.bluetooth.peripheral_hids_mouse.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_hids_mouse.ble_rpc: build_only: true extra_args: OVERLAY_CONFIG="overlay-nrf_rpc.conf" integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_hids_mouse.no_sec: build_only: true extra_configs: - CONFIG_BT_HIDS_SECURITY_ENABLED=n integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build # Build integration regression protection. sample.nrf_security.bluetooth.integration: - build_only: True - extra_args: CONFIG_NRF_SECURITY=y CONFIG_BOOTLOADER_MCUBOOT=y - platform_allow: nrf5340dk_nrf5340_cpuapp - integration_platforms: - - nrf5340dk_nrf5340_cpuapp + build_only: true + extra_args: CONFIG_NRF_SECURITY=y CONFIG_BOOTLOADER_MCUBOOT=y + platform_allow: nrf5340dk/nrf5340/cpuapp + integration_platforms: + - nrf5340dk/nrf5340/cpuapp diff --git a/samples/bluetooth/peripheral_hids_mouse/sysbuild/hci_ipc.conf b/samples/bluetooth/peripheral_hids_mouse/sysbuild/hci_ipc.conf new file mode 100644 index 000000000000..6991195c9c32 --- /dev/null +++ b/samples/bluetooth/peripheral_hids_mouse/sysbuild/hci_ipc.conf @@ -0,0 +1,33 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_IPC_SERVICE=y +CONFIG_MBOX=y + +CONFIG_HEAP_MEM_POOL_SIZE=8192 + +CONFIG_MAIN_STACK_SIZE=512 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 + +CONFIG_BT=y +CONFIG_BT_HCI_RAW=y +CONFIG_BT_HCI_RAW_RESERVE=1 +#CONFIG_BT_MAX_CONN=16 + + +# Workaround: Unable to allocate command buffer when using K_NO_WAIT since +# Host number of completed commands does not follow normal flow control. +CONFIG_BT_BUF_CMD_TX_COUNT=10 + +# Enable and adjust the below value as necessary +# CONFIG_BT_BUF_EVT_RX_COUNT=16 +# CONFIG_BT_BUF_EVT_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_RX_SIZE=255 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_BUF_CMD_TX_SIZE=255 + +CONFIG_BT_MAX_CONN=2 +CONFIG_BT_CENTRAL=n diff --git a/samples/bluetooth/peripheral_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/peripheral_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf index 8270e9f72d07..caf809b3da79 100644 --- a/samples/bluetooth/peripheral_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/peripheral_hr_coded/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -4,5 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +# Application core does not have BLE controller. Disable controller related options. CONFIG_BT_CTLR_PHY_CODED=n CONFIG_BT_CTLR_ADV_EXT=n diff --git a/samples/bluetooth/peripheral_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/peripheral_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..404775ebf004 --- /dev/null +++ b/samples/bluetooth/peripheral_hr_coded/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Application core does not have BLE controller. Disable controller related options. +CONFIG_BT_CTLR_PHY_CODED=n +CONFIG_BT_CTLR_ADV_EXT=n diff --git a/samples/bluetooth/peripheral_hr_coded/sample.yaml b/samples/bluetooth/peripheral_hr_coded/sample.yaml index da777bb84bc5..ec1a2e51254b 100644 --- a/samples/bluetooth/peripheral_hr_coded/sample.yaml +++ b/samples/bluetooth/peripheral_hr_coded/sample.yaml @@ -6,7 +6,9 @@ tests: sample.bluetooth.peripheral_hr_coded: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_lbs/CMakeLists.txt b/samples/bluetooth/peripheral_lbs/CMakeLists.txt index d5f0a7f5c721..c6b5c5a2b7a1 100644 --- a/samples/bluetooth/peripheral_lbs/CMakeLists.txt +++ b/samples/bluetooth/peripheral_lbs/CMakeLists.txt @@ -14,4 +14,3 @@ target_sources(app PRIVATE ) # NORDIC SDK APP END -zephyr_library_include_directories(.) diff --git a/samples/bluetooth/peripheral_lbs/README.rst b/samples/bluetooth/peripheral_lbs/README.rst index 880dfa9cbcf1..1e98f8ecb9a8 100644 --- a/samples/bluetooth/peripheral_lbs/README.rst +++ b/samples/bluetooth/peripheral_lbs/README.rst @@ -93,14 +93,14 @@ Building and running Minimal build ============= -You can build the sample with a minimum configuration as a demonstration of how to reduce code size and RAM usage, using the ``-DCONF_FILE='prj_minimal.conf'`` flag in your build. +You can build the sample with a minimum configuration as a demonstration of how to reduce code size and RAM usage, using the ``-DFILE_SUFFIX=minimal`` flag in your build. See :ref:`cmake_options` for instructions on how to add this option to your build. For example, when building on the command line, you can add the option as follows: .. code-block:: console - west build samples/bluetooth/peripheral_lbs -- -DCONF_FILE='prj_minimal.conf' + west build samples/bluetooth/peripheral_lbs -- -DFILE_SUFFIX=minimal .. _peripheral_lbs_testing: diff --git a/samples/bluetooth/peripheral_lbs/VERSION b/samples/bluetooth/peripheral_lbs/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/peripheral_lbs/VERSION +++ b/samples/bluetooth/peripheral_lbs/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/peripheral_lbs/sample.yaml b/samples/bluetooth/peripheral_lbs/sample.yaml index 647371ed09f4..26254d39001e 100644 --- a/samples/bluetooth/peripheral_lbs/sample.yaml +++ b/samples/bluetooth/peripheral_lbs/sample.yaml @@ -5,48 +5,54 @@ tests: sample.bluetooth.peripheral_lbs: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp + nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_lbs_minimal: build_only: true extra_args: OVERLAY_CONFIG=prj_minimal.conf integration_platforms: - - nrf52dk_nrf52810 - - nrf52840dk_nrf52811 - - nrf52833dk_nrf52820 - platform_allow: nrf52dk_nrf52810 nrf52840dk_nrf52811 nrf52833dk_nrf52820 + - nrf52dk/nrf52810 + - nrf52840dk/nrf52811 + - nrf52833dk/nrf52820 + platform_allow: nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 tags: bluetooth ci_build sample.bluetooth.peripheral_lbs_no_security: build_only: true extra_args: CONFIG_BT_LBS_SECURITY_ENABLED=n integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf54l15pdk/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_lbs_bt_ota_dfu: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns tags: bluetooth ci_build extra_configs: - CONFIG_BOOTLOADER_MCUBOOT=y @@ -54,8 +60,8 @@ tests: sample.bluetooth.peripheral_lbs_bt_ota_dfu.direct_xip: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: mcuboot_CONFIG_BOOT_DIRECT_XIP=y extra_configs: @@ -65,8 +71,8 @@ tests: sample.bluetooth.peripheral_lbs_bt_ota_dfu.direct_xip.revert: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build extra_args: mcuboot_CONFIG_BOOT_DIRECT_XIP=y mcuboot_CONFIG_BOOT_DIRECT_XIP_REVERT=y extra_configs: diff --git a/samples/bluetooth/peripheral_mds/sample.yaml b/samples/bluetooth/peripheral_mds/sample.yaml index 6fdeccb26881..340c6daaa16a 100644 --- a/samples/bluetooth/peripheral_mds/sample.yaml +++ b/samples/bluetooth/peripheral_mds/sample.yaml @@ -8,11 +8,11 @@ tests: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="dummy-key" - CONFIG_MEMFAULT_NCS_DEVICE_ID="dummy-device-id" integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_nfc_pairing/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/peripheral_nfc_pairing/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..a63e325b8db9 --- /dev/null +++ b/samples/bluetooth/peripheral_nfc_pairing/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + &nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/bluetooth/peripheral_nfc_pairing/sample.yaml b/samples/bluetooth/peripheral_nfc_pairing/sample.yaml index 0af8085620da..cdac9bdffae6 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/sample.yaml +++ b/samples/bluetooth/peripheral_nfc_pairing/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.peripheral_nfc_pairing: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_power_profiling/sample.yaml b/samples/bluetooth/peripheral_power_profiling/sample.yaml index cca6cfa52861..1fd38cccb011 100644 --- a/samples/bluetooth/peripheral_power_profiling/sample.yaml +++ b/samples/bluetooth/peripheral_power_profiling/sample.yaml @@ -5,11 +5,11 @@ tests: sample.bluetooth.peripheral_power_profiling: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_rscs/sample.yaml b/samples/bluetooth/peripheral_rscs/sample.yaml index 1775e09e54ae..11bc58407a4c 100644 --- a/samples/bluetooth/peripheral_rscs/sample.yaml +++ b/samples/bluetooth/peripheral_rscs/sample.yaml @@ -5,12 +5,13 @@ tests: sample.bluetooth.peripheral_rscs: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp platform_allow: > - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_status/VERSION b/samples/bluetooth/peripheral_status/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/peripheral_status/VERSION +++ b/samples/bluetooth/peripheral_status/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/peripheral_status/sample.yaml b/samples/bluetooth/peripheral_status/sample.yaml index 1e79268900cb..f73328fc0944 100644 --- a/samples/bluetooth/peripheral_status/sample.yaml +++ b/samples/bluetooth/peripheral_status/sample.yaml @@ -5,27 +5,29 @@ tests: sample.bluetooth.peripheral_nsms: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52dk/nrf52810 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_nsms_no_security: build_only: true extra_args: CONFIG_BT_STATUS_SECURITY_ENABLED=n integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52dk/nrf52810 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/peripheral_uart/CMakeLists.txt b/samples/bluetooth/peripheral_uart/CMakeLists.txt index 3a64f7c2a8cd..c6b5c5a2b7a1 100644 --- a/samples/bluetooth/peripheral_uart/CMakeLists.txt +++ b/samples/bluetooth/peripheral_uart/CMakeLists.txt @@ -13,11 +13,4 @@ target_sources(app PRIVATE src/main.c ) -# Include UART ASYNC API adapter -target_sources_ifdef(CONFIG_BT_NUS_UART_ASYNC_ADAPTER app PRIVATE - src/uart_async_adapter.c -) - # NORDIC SDK APP END - -zephyr_library_include_directories(.) diff --git a/samples/bluetooth/peripheral_uart/Kconfig b/samples/bluetooth/peripheral_uart/Kconfig index 200403dfddb1..4a87afb828b6 100644 --- a/samples/bluetooth/peripheral_uart/Kconfig +++ b/samples/bluetooth/peripheral_uart/Kconfig @@ -33,11 +33,4 @@ config BT_NUS_UART_RX_WAIT_TIME help Wait for RX complete event time in microseconds -config BT_NUS_UART_ASYNC_ADAPTER - bool "Enable UART async adapter" - select SERIAL_SUPPORT_ASYNC - help - Enables asynchronous adapter for UART drives that supports only - IRQ interface. - endmenu diff --git a/samples/bluetooth/peripheral_uart/README.rst b/samples/bluetooth/peripheral_uart/README.rst index 6cd4dc7b1a7f..db8e10b8d6b1 100644 --- a/samples/bluetooth/peripheral_uart/README.rst +++ b/samples/bluetooth/peripheral_uart/README.rst @@ -91,13 +91,11 @@ See :ref:`peripheral_uart_sample_activating_variants` for details about how to b Async adapter experimental module --------------------------------- -The default sample configuration uses the UART async API, which is an :ref:`experimental ` module. -The UART async adapter creates and initializes an instance of the async module. +The default sample configuration uses the UART async API. +The sample uses the :ref:`lib_uart_async_adapter` library to communicate with the USB CDC ACM driver. This is needed because the USB CDC ACM implementation provides only the interrupt interface. -The adapter uses data provided in the :c:struct:`uart_async_adapter_data` to connect to the UART device that does not use the asynchronous interface. -The module requires the :ref:`CONFIG_BT_NUS_UART_ASYNC_ADAPTER ` to be set to ``y``. -For more information about the adapter, see the :file:`uart_async_adapter` source files available in the :file:`peripheral_uart/src` directory. +To use the library, set the :kconfig:option:`CONFIG_UART_ASYNC_ADAPTER` Kconfig option to ``y``. MCUboot with serial recovery of the networking core image ========================================================= @@ -148,9 +146,9 @@ Configuration options Check and configure the following configuration options for the sample: -.. _CONFIG_BT_NUS_UART_ASYNC_ADAPTER: +.. _CONFIG_UART_ASYNC_ADAPTER: -CONFIG_BT_NUS_UART_ASYNC_ADAPTER - Enable UART async adapter +CONFIG_UART_ASYNC_ADAPTER - Enable UART async adapter Enables asynchronous adapter for UART drives that supports only IRQ interface. Building and running @@ -165,13 +163,13 @@ Building and running Activating sample extensions ============================ -To activate the optional extensions supported by this sample, modify :makevar:`OVERLAY_CONFIG` in the following manner: +To activate the optional extensions supported by this sample, modify :makevar:`EXTRA_CONF_FILE` in the following manner: * For the minimal build variant, set :file:`prj_minimal.conf`. * For the USB CDC ACM extension, set :file:`prj_cdc.conf`. Additionally, you need to set :makevar:`DTC_OVERLAY_FILE` to the :file:`usb.overlay` file. * For the MCUboot with serial recovery of the networking core image feature, set the :file:`nrf5340dk_app_sr_net.conf` file. - You also need to set the :makevar:`mcuboot_OVERLAY_CONFIG` variant to the :file:`nrf5340dk_mcuboot_sr_net.conf` file. + You also need to set the :makevar:`mcuboot_EXTRA_CONF_FILE` variant to the :file:`nrf5340dk_mcuboot_sr_net.conf` file. See :ref:`cmake_options` for instructions on how to add this option. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. @@ -210,12 +208,9 @@ After programming the sample to your development kit, complete the following ste Dependencies ************ -This sample uses the following sample-specific library: - -* :file:`uart_async_adapter` at :file:`peripheral_uart/src` - This sample uses the following |NCS| libraries: +* :ref:`lib_uart_async_adapter` * :ref:`nus_service_readme` * :ref:`dk_buttons_and_leds_readme` diff --git a/samples/bluetooth/peripheral_uart/VERSION b/samples/bluetooth/peripheral_uart/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/bluetooth/peripheral_uart/VERSION +++ b/samples/bluetooth/peripheral_uart/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..0623953b424b --- /dev/null +++ b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unspupported UART0 driver +CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..45dfe09952b7 --- /dev/null +++ b/samples/bluetooth/peripheral_uart/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,nus-uart = &uart136; + }; +}; diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..0623953b424b --- /dev/null +++ b/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unspupported UART0 driver +CONFIG_NRFX_UARTE0=n diff --git a/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..816013d05d26 --- /dev/null +++ b/samples/bluetooth/peripheral_uart/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,nus-uart = &uart20; + }; +}; diff --git a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf index 349e5d7777ef..4a243f5d6915 100644 --- a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf +++ b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp.conf @@ -20,7 +20,7 @@ CONFIG_USB_COMPOSITE_DEVICE=y # Enable back logging over UART as this sample config uses only RTT by default CONFIG_LOG_BACKEND_UART=y -CONFIG_BT_NUS_UART_ASYNC_ADAPTER=y +CONFIG_UART_ASYNC_ADAPTER=y CONFIG_UART_INTERRUPT_DRIVEN=y # Disable the UARTE0 enabled in default project configuration diff --git a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf index 349e5d7777ef..4a243f5d6915 100644 --- a/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf +++ b/samples/bluetooth/peripheral_uart/boards/thingy53_nrf5340_cpuapp_ns.conf @@ -20,7 +20,7 @@ CONFIG_USB_COMPOSITE_DEVICE=y # Enable back logging over UART as this sample config uses only RTT by default CONFIG_LOG_BACKEND_UART=y -CONFIG_BT_NUS_UART_ASYNC_ADAPTER=y +CONFIG_UART_ASYNC_ADAPTER=y CONFIG_UART_INTERRUPT_DRIVEN=y # Disable the UARTE0 enabled in default project configuration diff --git a/samples/bluetooth/peripheral_uart/prj_cdc.conf b/samples/bluetooth/peripheral_uart/prj_cdc.conf index cbea30c2c9de..858feb5f5d31 100644 --- a/samples/bluetooth/peripheral_uart/prj_cdc.conf +++ b/samples/bluetooth/peripheral_uart/prj_cdc.conf @@ -7,7 +7,7 @@ # Enable the UART driver CONFIG_UART_LINE_CTRL=y CONFIG_UART_INTERRUPT_DRIVEN=y -CONFIG_BT_NUS_UART_ASYNC_ADAPTER=y +CONFIG_UART_ASYNC_ADAPTER=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_REMOTE_WAKEUP=n CONFIG_USB_CDC_ACM=y diff --git a/samples/bluetooth/peripheral_uart/sample.yaml b/samples/bluetooth/peripheral_uart/sample.yaml index f76df48291e8..6f99022bac55 100644 --- a/samples/bluetooth/peripheral_uart/sample.yaml +++ b/samples/bluetooth/peripheral_uart/sample.yaml @@ -4,61 +4,66 @@ sample: tests: sample.bluetooth.peripheral_uart: build_only: true - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns nrf21540dk_nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf21540dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_uart.sysbuild: build_only: true sysbuild: true - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build sysbuild sample.bluetooth.peripheral_uart_cdc: build_only: true extra_args: OVERLAY_CONFIG=prj_cdc.conf DTC_OVERLAY_FILE="usb.overlay" integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 tags: bluetooth ci_build sample.bluetooth.peripheral_uart_minimal: build_only: true extra_args: OVERLAY_CONFIG=prj_minimal.conf integration_platforms: - - nrf52dk_nrf52810 - - nrf52840dk_nrf52811 - - nrf52833dk_nrf52820 - platform_allow: nrf52dk_nrf52810 nrf52840dk_nrf52811 nrf52833dk_nrf52820 + - nrf52dk/nrf52810 + - nrf52840dk/nrf52811 + - nrf52833dk/nrf52820 + platform_allow: nrf52dk/nrf52810 nrf52840dk/nrf52811 nrf52833dk/nrf52820 tags: bluetooth ci_build sample.bluetooth.peripheral_uart_ble_rpc: build_only: true extra_configs: - CONFIG_BT_RPC_STACK=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: bluetooth ci_build sample.bluetooth.peripheral_uart.security_disabled: build_only: true - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns nrf21540dk_nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns nrf21540dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: bluetooth ci_build extra_configs: - CONFIG_BT_NUS_SECURITY_ENABLED=n diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c index 7526fd65ddfd..baf1015e9eb2 100644 --- a/samples/bluetooth/peripheral_uart/src/main.c +++ b/samples/bluetooth/peripheral_uart/src/main.c @@ -7,7 +7,7 @@ /** @file * @brief Nordic UART Bridge Service (NUS) sample */ -#include "uart_async_adapter.h" +#include #include #include @@ -30,6 +30,7 @@ #include #include +#include #include @@ -80,10 +81,10 @@ static const struct bt_data sd[] = { BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL), }; -#if CONFIG_BT_NUS_UART_ASYNC_ADAPTER +#ifdef CONFIG_UART_ASYNC_ADAPTER UART_ASYNC_ADAPTER_INST_DEFINE(async_adapter); #else -static const struct device *const async_adapter; +#define async_adapter NULL #endif static void uart_cb(const struct device *dev, struct uart_event *evt, void *user_data) @@ -259,7 +260,7 @@ static int uart_init(void) k_work_init_delayable(&uart_work, uart_work_handler); - if (IS_ENABLED(CONFIG_BT_NUS_UART_ASYNC_ADAPTER) && !uart_test_async_api(uart)) { + if (IS_ENABLED(CONFIG_UART_ASYNC_ADAPTER) && !uart_test_async_api(uart)) { /* Implement API adapter */ uart_async_adapter_init(async_adapter, uart); uart = async_adapter; @@ -632,14 +633,33 @@ void ble_write_thread(void) { /* Don't go any further until BLE is initialized */ k_sem_take(&ble_init_ok, K_FOREVER); + struct uart_data_t nus_data = { + .len = 0, + }; for (;;) { /* Wait indefinitely for data to be sent over bluetooth */ struct uart_data_t *buf = k_fifo_get(&fifo_uart_rx_data, K_FOREVER); - if (bt_nus_send(NULL, buf->data, buf->len)) { - LOG_WRN("Failed to send data over BLE connection"); + int plen = MIN(sizeof(nus_data.data) - nus_data.len, buf->len); + int loc = 0; + + while (plen > 0) { + memcpy(&nus_data.data[nus_data.len], &buf->data[loc], plen); + nus_data.len += plen; + loc += plen; + + if (nus_data.len >= sizeof(nus_data.data) || + (nus_data.data[nus_data.len - 1] == '\n') || + (nus_data.data[nus_data.len - 1] == '\r')) { + if (bt_nus_send(NULL, nus_data.data, nus_data.len)) { + LOG_WRN("Failed to send data over BLE connection"); + } + nus_data.len = 0; + } + + plen = MIN(sizeof(nus_data.data), buf->len - loc); } k_free(buf); diff --git a/samples/bluetooth/radio_coex_1wire/sample.yaml b/samples/bluetooth/radio_coex_1wire/sample.yaml index 9458da997dcd..fc74f8fbc512 100644 --- a/samples/bluetooth/radio_coex_1wire/sample.yaml +++ b/samples/bluetooth/radio_coex_1wire/sample.yaml @@ -5,6 +5,6 @@ tests: sample.bluetooth.radio_coex_1wire: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build diff --git a/samples/bluetooth/rpc_host/README.rst b/samples/bluetooth/rpc_host/README.rst index cbe1457c45bc..58235ba7a605 100644 --- a/samples/bluetooth/rpc_host/README.rst +++ b/samples/bluetooth/rpc_host/README.rst @@ -43,14 +43,14 @@ You must program this sample to the nRF5340 network core. Debug build =========== -To build the sample with a debugging configuration, use the ``-DOVERLAY_CONFIG=overlay-debugging.conf'`` flag in your build. +To build the sample with a debugging configuration, use the ``-DEXTRA_CONF_FILE=overlay-debugging.conf'`` flag in your build. See :ref:`cmake_options` for instructions on how to add this option to your build. For example, when building on the command line, enter the following command: .. code-block:: console - west build samples/bluetooth/rpc_host -- -DOVERLAY_CONFIG=overlay-debugging.conf + west build samples/bluetooth/rpc_host -- -DEXTRA_CONF_FILE=overlay-debugging.conf .. _rpc_host_testing: @@ -72,7 +72,7 @@ See :ref:`configure_application` for information about how to configure a sample .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC_STACK=y + west build -b nrf5340dk/nrf5340/cpuapp -- -DCONFIG_BT_RPC_STACK=y You can also build the :ref:`peripheral_hids_mouse` sample using the above command. This sample requires some additional configuration in the :file:`samples/bluetooth/peripheral_hids_mouse/child_image/rpc_host.conf` file. diff --git a/samples/bluetooth/rpc_host/sample.yaml b/samples/bluetooth/rpc_host/sample.yaml index f994a1a42f10..901284e0a3aa 100644 --- a/samples/bluetooth/rpc_host/sample.yaml +++ b/samples/bluetooth/rpc_host/sample.yaml @@ -5,6 +5,6 @@ tests: sample.bluetooth.rpc_host: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: bluetooth ci_build diff --git a/samples/bluetooth/shell_bt_nus/CMakeLists.txt b/samples/bluetooth/shell_bt_nus/CMakeLists.txt index 9b9ff53aa6b0..c6b5c5a2b7a1 100644 --- a/samples/bluetooth/shell_bt_nus/CMakeLists.txt +++ b/samples/bluetooth/shell_bt_nus/CMakeLists.txt @@ -13,5 +13,4 @@ target_sources(app PRIVATE src/main.c ) -target_include_directories(app PRIVATE .) # NORDIC SDK APP END diff --git a/samples/bluetooth/shell_bt_nus/sample.yaml b/samples/bluetooth/shell_bt_nus/sample.yaml index c0b7c80b9856..b5c6b3c190d7 100644 --- a/samples/bluetooth/shell_bt_nus/sample.yaml +++ b/samples/bluetooth/shell_bt_nus/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.shell_bt_nus: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/throughput/CMakeLists.txt b/samples/bluetooth/throughput/CMakeLists.txt index 497355255e3e..dd29523bed3f 100644 --- a/samples/bluetooth/throughput/CMakeLists.txt +++ b/samples/bluetooth/throughput/CMakeLists.txt @@ -6,8 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -set(DTC_OVERLAY_FILE "dts.overlay") - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(NONE) @@ -17,5 +15,3 @@ target_sources(app PRIVATE ${app_sources} ) # NORDIC SDK APP END - -zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth) diff --git a/samples/bluetooth/throughput/app.overlay b/samples/bluetooth/throughput/app.overlay new file mode 100644 index 000000000000..3b430d119a00 --- /dev/null +++ b/samples/bluetooth/throughput/app.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart0 { + /delete-property/ hw-flow-control; +}; diff --git a/samples/bluetooth/throughput/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/bluetooth/throughput/boards/nrf5340dk_nrf5340_cpuapp.conf index 687e9e294b78..c33404423f0a 100644 --- a/samples/bluetooth/throughput/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/bluetooth/throughput/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -3,4 +3,6 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # + +# For better shell and logger coexistence. CONFIG_NCS_SAMPLES_DEFAULTS=n diff --git a/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..2ea17b6d5f6b --- /dev/null +++ b/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# For better shell and logger coexistence. +CONFIG_NCS_SAMPLES_DEFAULTS=n diff --git a/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..72a368d6dbcf --- /dev/null +++ b/samples/bluetooth/throughput/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,shell-uart = &uart136; + }; +}; + +&uart136 { + /delete-property/ hw-flow-control; +}; diff --git a/samples/bluetooth/throughput/dts.overlay b/samples/bluetooth/throughput/dts.overlay deleted file mode 100644 index 9ccc4e2be213..000000000000 --- a/samples/bluetooth/throughput/dts.overlay +++ /dev/null @@ -1,3 +0,0 @@ -&uart0 { - /delete-property/ hw-flow-control; -}; diff --git a/samples/bluetooth/throughput/prj.conf b/samples/bluetooth/throughput/prj.conf index 3ceafd626176..01e85f9b017c 100644 --- a/samples/bluetooth/throughput/prj.conf +++ b/samples/bluetooth/throughput/prj.conf @@ -32,7 +32,7 @@ CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n CONFIG_BT_BUF_ACL_RX_SIZE=502 CONFIG_BT_ATT_PREPARE_COUNT=2 -CONFIG_BT_L2CAP_TX_BUF_COUNT=10 +CONFIG_BT_ATT_TX_COUNT=10 CONFIG_BT_L2CAP_TX_MTU=498 CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_CONN_TX_MAX=10 diff --git a/samples/bluetooth/throughput/sample.yaml b/samples/bluetooth/throughput/sample.yaml index 2b20aae342e7..bf19e51311dc 100644 --- a/samples/bluetooth/throughput/sample.yaml +++ b/samples/bluetooth/throughput/sample.yaml @@ -5,10 +5,11 @@ tests: sample.bluetooth.throughput: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp tags: bluetooth ci_build diff --git a/samples/bluetooth/throughput/src/main.c b/samples/bluetooth/throughput/src/main.c index b812eeeed0ec..ce95c51080b4 100644 --- a/samples/bluetooth/throughput/src/main.c +++ b/samples/bluetooth/throughput/src/main.c @@ -40,7 +40,7 @@ static volatile bool data_length_req; static volatile bool test_ready; static struct bt_conn *default_conn; static struct bt_throughput throughput; -static struct bt_uuid *uuid128 = BT_UUID_THROUGHPUT; +static const struct bt_uuid *uuid128 = BT_UUID_THROUGHPUT; static struct bt_gatt_exchange_params exchange_params; static struct bt_le_conn_param *conn_param = BT_LE_CONN_PARAM(INTERVAL_MIN, INTERVAL_MAX, 0, 400); diff --git a/samples/bootloader/sample.yaml b/samples/bootloader/sample.yaml index dbbf57194b5e..d29f0c4db707 100644 --- a/samples/bootloader/sample.yaml +++ b/samples/bootloader/sample.yaml @@ -4,12 +4,12 @@ tests: sample.bootloader: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf21540dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf52840dk_nrf52840 - nrf52833dk_nrf52833 nrf52dk_nrf52832 nrf21540dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf21540dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf52840dk/nrf52840 + nrf52833dk/nrf52833 nrf52dk/nrf52832 nrf21540dk/nrf52840 tags: ci_build diff --git a/samples/caf/CMakeLists.txt b/samples/caf/CMakeLists.txt index cb62b9c6642b..74cb5f296115 100644 --- a/samples/caf/CMakeLists.txt +++ b/samples/caf/CMakeLists.txt @@ -16,7 +16,7 @@ target_sources(app PRIVATE # Add include directory for board specific CAF def files zephyr_include_directories( - configuration/${BOARD} + configuration/${NORMALIZED_BOARD_TARGET} ) target_sources_ifdef(CONFIG_CAF_SAMPLE_LED_STATE diff --git a/samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.conf b/samples/caf/boards/nrf54h20dk_nrf54h20_cpuapp.conf similarity index 100% rename from samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.conf rename to samples/caf/boards/nrf54h20dk_nrf54h20_cpuapp.conf diff --git a/samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.overlay b/samples/caf/boards/nrf54h20dk_nrf54h20_cpuapp.overlay similarity index 100% rename from samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.overlay rename to samples/caf/boards/nrf54h20dk_nrf54h20_cpuapp.overlay diff --git a/samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/buttons_def.h b/samples/caf/configuration/nrf54h20dk_nrf54h20_cpuapp/buttons_def.h similarity index 100% rename from samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/buttons_def.h rename to samples/caf/configuration/nrf54h20dk_nrf54h20_cpuapp/buttons_def.h diff --git a/samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/led_state_def.h b/samples/caf/configuration/nrf54h20dk_nrf54h20_cpuapp/led_state_def.h similarity index 100% rename from samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/led_state_def.h rename to samples/caf/configuration/nrf54h20dk_nrf54h20_cpuapp/led_state_def.h diff --git a/samples/caf/sample.yaml b/samples/caf/sample.yaml index e0533cec479f..35270913cb1b 100644 --- a/samples/caf/sample.yaml +++ b/samples/caf/sample.yaml @@ -5,7 +5,7 @@ tests: sample.caf: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: caf ci_build diff --git a/samples/caf_sensor_manager/CMakeLists.txt b/samples/caf_sensor_manager/CMakeLists.txt index 5af9dbe7c0ec..d3de2115db32 100644 --- a/samples/caf_sensor_manager/CMakeLists.txt +++ b/samples/caf_sensor_manager/CMakeLists.txt @@ -14,6 +14,7 @@ target_sources(app PRIVATE src/main.c) # Add include directory for board specific CAF def files zephyr_include_directories( configuration/ - configuration/${BOARD}) + configuration/${NORMALIZED_BOARD_TARGET} +) add_subdirectory(src/modules) diff --git a/samples/caf_sensor_manager/README.rst b/samples/caf_sensor_manager/README.rst index 25e456439a74..9f8089ec617a 100644 --- a/samples/caf_sensor_manager/README.rst +++ b/samples/caf_sensor_manager/README.rst @@ -48,7 +48,7 @@ To use this configuration, run the following command: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp_nrf5340_singlecore.conf + west build -b nrf5340dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=boards/nrf5340dk_nrf5340_cpuapp_nrf5340_singlecore.conf Building and running ******************** @@ -68,7 +68,7 @@ Complete the following steps to program the sample: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp + west build -b nrf5340dk/nrf5340/cpuapp #. Program both the cores: diff --git a/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.conf b/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_multicore.conf similarity index 100% rename from samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.conf rename to samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_multicore.conf diff --git a/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_multicore.overlay b/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_multicore.overlay new file mode 100644 index 000000000000..84631563a9b2 --- /dev/null +++ b/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_multicore.overlay @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + /* Replace default ipc0 instance */ +/delete-node/ &ipc0; + +/ { + sensor_stub: sensor_stub { + compatible = "nordic,sensor-stub"; + generator = "sensor_stub_gen"; + status = "okay"; + }; + + agg0: agg0 { + compatible = "caf,aggregator"; + sensor_descr = "accel_sim_xyz"; + buf_data_length = <240>; + sample_size = <3>; + }; +}; + +/* Enabled nodes required by IPC + * Two mboxes, one for each sides and one ipc instance + */ + +&cpuapp_bellboard { + status = "okay"; +}; + +&cpuppr_vevif { + status = "okay"; +}; + +ipc0: &cpuapp_cpuppr_ipc { + status = "okay"; +}; + +/* UART and RAM3 instance used by PPR should be enabled at build time + * using nordic-ppr snippet. + */ diff --git a/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.conf b/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.conf similarity index 100% rename from samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.conf rename to samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.conf diff --git a/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.overlay b/samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.overlay similarity index 100% rename from samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.overlay rename to samples/caf_sensor_manager/boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.overlay diff --git a/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.overlay b/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.overlay deleted file mode 100644 index 3e73f93eb111..000000000000 --- a/samples/caf_sensor_manager/boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.overlay +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - sensor_stub: sensor_stub { - compatible = "nordic,sensor-stub"; - generator = "sensor_stub_gen"; - status = "okay"; - }; - - agg0: agg0 { - compatible = "caf,aggregator"; - sensor_descr = "accel_sim_xyz"; - buf_data_length = <240>; - sample_size = <3>; - }; -}; - -/* Enabled nodes required by IPC - * Two mboxes, one for each sides and one ipc instance - */ - -&cpuapp_bellboard { - status = "okay"; -}; - -&cpuppr_vevif { - status = "okay"; -}; - -ipc0: &cpuapp_cpuppr_ipc { - status = "okay"; -}; - -/* UART and RAM3 instance used by PPR should be enabled at build time - * using nordic-ppr snippet. - */ diff --git a/samples/caf_sensor_manager/remote/CMakeLists.txt b/samples/caf_sensor_manager/remote/CMakeLists.txt index cdf0cdb5e459..8435a85e0847 100644 --- a/samples/caf_sensor_manager/remote/CMakeLists.txt +++ b/samples/caf_sensor_manager/remote/CMakeLists.txt @@ -17,6 +17,7 @@ target_sources(app PRIVATE src/main.c) # Add include directory for board specific CAF def files zephyr_include_directories( ../configuration/ - ../configuration/${BOARD}) + ../configuration/${NORMALIZED_BOARD_TARGET} +) add_subdirectory(../src/modules "${CMAKE_CURRENT_BINARY_DIR}/modules") diff --git a/samples/caf_sensor_manager/remote/boards/nrf54h20pdk_nrf54h20_cpuppr.conf b/samples/caf_sensor_manager/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf similarity index 100% rename from samples/caf_sensor_manager/remote/boards/nrf54h20pdk_nrf54h20_cpuppr.conf rename to samples/caf_sensor_manager/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf diff --git a/samples/caf_sensor_manager/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay b/samples/caf_sensor_manager/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay new file mode 100644 index 000000000000..2b21af96afc8 --- /dev/null +++ b/samples/caf_sensor_manager/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + sensor_stub: sensor_stub { + compatible = "nordic,sensor-stub"; + generator = "sensor_stub_gen"; + status = "okay"; + }; + + agg0: agg0 { + compatible = "caf,aggregator"; + sensor_descr = "accel_sim_xyz"; + buf_data_length = <240>; + sample_size = <3>; + memory-region = <&ram3x_agg_area0>; + }; +}; + +/* Place aggregator buffers in PPR memory region. */ + +&cpuppr_ram3x_region { + cpuppr_code_data: memory@0 { + reg = <0x0 0xf200>; + }; + + ram3x_agg_area0: memory@f200 { + reg = <0xf200 0x600>; + }; +}; + +/* Enabled nodes required by IPC + * Two mboxes, one for each sides and one ipc instance + */ + +&cpuppr_vevif { + status = "okay"; +}; + +&cpuapp_bellboard { + status = "okay"; +}; + +ipc0: &cpuapp_cpuppr_ipc { + status = "okay"; +}; diff --git a/samples/caf_sensor_manager/remote/boards/nrf54h20pdk_nrf54h20_cpuppr.overlay b/samples/caf_sensor_manager/remote/boards/nrf54h20pdk_nrf54h20_cpuppr.overlay deleted file mode 100644 index 2085a87ffbcf..000000000000 --- a/samples/caf_sensor_manager/remote/boards/nrf54h20pdk_nrf54h20_cpuppr.overlay +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - / { - chosen { - zephyr,sram = &cpuppr_code_data; - }; - - sensor_stub: sensor_stub { - compatible = "nordic,sensor-stub"; - generator = "sensor_stub_gen"; - status = "okay"; - }; - - agg0: agg0 { - compatible = "caf,aggregator"; - sensor_descr = "accel_sim_xyz"; - buf_data_length = <240>; - sample_size = <3>; - memory-region = <&ram3x_agg_area0>; - }; -}; - -/* Place aggregator buffers in PPR memory region. */ - -&cpuppr_ram3x_region { - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x2fc00000 0x7000>; - - cpuppr_code_data: memory@0 { - reg = <0x0 0x6a00>; - }; - - ram3x_agg_area0: memory@6a00 { - reg = <0x6a00 0x600>; - }; -}; - -/* Enabled nodes required by IPC - * Two mboxes, one for each sides and one ipc instance - */ - -&cpuppr_vevif { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; - -ipc0: &cpuapp_cpuppr_ipc { - status = "okay"; -}; diff --git a/samples/caf_sensor_manager/sample.yaml b/samples/caf_sensor_manager/sample.yaml index cdade32ea987..a72a4b40add6 100644 --- a/samples/caf_sensor_manager/sample.yaml +++ b/samples/caf_sensor_manager/sample.yaml @@ -6,10 +6,10 @@ tests: sample.caf_sensor_manager.correctness_test: build_only: false harness: console - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp qemu_cortex_m3 + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp qemu_cortex_m3 integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp - qemu_cortex_m3 harness_config: type: multi_line @@ -21,32 +21,32 @@ tests: - "sensor_data_aggregator_release_buffer_event" sample.caf_sensor_manager.nrf52840dk.power_consumption_test: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_SERIAL=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_LOG=n sample.caf_sensor_manager.multi_core.power_consumption_test: build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: > CONFIG_SERIAL=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_LOG=n remote_CONFIG_SERIAL=n remote_CONFIG_CONSOLE=n remote_CONFIG_UART_CONSOLE=n remote_CONFIG_LOG=n sample.caf_sensor_manager.nrf5340dk_singlecore.power_consumption_test: build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: > OVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp_singlecore.conf CONFIG_SERIAL=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_LOG=n DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_singlecore.overlay sample.caf_sensor_manager.nrf5340dk_singlecore.correctness_test: build_only: false - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: OVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp_singlecore.conf DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_singlecore.overlay harness: console @@ -62,23 +62,23 @@ tests: build_only: true sysbuild: true platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf caf_sensor_manager_SNIPPET=nordic-ppr - caf_sensor_manager_OVERLAY_CONFIG=boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.conf - caf_sensor_manager_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_multicore.overlay - remote_OVERLAY_CONFIG=boards/nrf54h20pdk_nrf54h20_cpuppr.conf - remote_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuppr.overlay + caf_sensor_manager_OVERLAY_CONFIG=boards/nrf54h20dk_nrf54h20_cpuapp_multicore.conf + caf_sensor_manager_DTC_OVERLAY_FILE=boards/nrf54h20dk_nrf54h20_cpuapp_multicore.overlay + remote_OVERLAY_CONFIG=boards/nrf54h20dk_nrf54h20_cpuppr.conf + remote_DTC_OVERLAY_FILE=boards/nrf54h20dk_nrf54h20_cpuppr.overlay sample.caf_sensor_manager.nrf54h20.singlecore: build_only: true sysbuild: true platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - caf_sensor_manager_OVERLAY_CONFIG=boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.conf - caf_sensor_manager_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_singlecore.overlay + caf_sensor_manager_OVERLAY_CONFIG=boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.conf + caf_sensor_manager_DTC_OVERLAY_FILE=boards/nrf54h20dk_nrf54h20_cpuapp_singlecore.overlay diff --git a/samples/caf_sensor_manager/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf b/samples/caf_sensor_manager/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..f50bc8553a01 --- /dev/null +++ b/samples/caf_sensor_manager/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpuppr" diff --git a/samples/caf_sensor_manager/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf b/samples/caf_sensor_manager/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf deleted file mode 100644 index e3ae1e6050b9..000000000000 --- a/samples/caf_sensor_manager/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20pdk_nrf54h20_cpuppr" diff --git a/samples/cellular/at_client/sample.yaml b/samples/cellular/at_client/sample.yaml index 202c5c2eb5f9..c09dc0ce3d4c 100644 --- a/samples/cellular/at_client/sample.yaml +++ b/samples/cellular/at_client/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.at_client: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/at_monitor/sample.yaml b/samples/cellular/at_monitor/sample.yaml index 832b4bf1bed9..35bb0f2d1542 100644 --- a/samples/cellular/at_monitor/sample.yaml +++ b/samples/cellular/at_monitor/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.at_monitor: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/battery/sample.yaml b/samples/cellular/battery/sample.yaml index c691a1551558..74e07a778f43 100644 --- a/samples/cellular/battery/sample.yaml +++ b/samples/cellular/battery/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.battery: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/ciphersuites/CMakeLists.txt b/samples/cellular/ciphersuites/CMakeLists.txt index 3118af1cddab..fd698a63501f 100644 --- a/samples/cellular/ciphersuites/CMakeLists.txt +++ b/samples/cellular/ciphersuites/CMakeLists.txt @@ -14,8 +14,8 @@ set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/certs) zephyr_include_directories(${gen_dir}) generate_inc_file_for_target( app - cert/DigiCertGlobalRootCA.pem - ${gen_dir}/DigiCertGlobalRootCA.pem.inc + cert/DigiCertGlobalG2.pem + ${gen_dir}/DigiCertGlobalG2.pem.inc ) # NORDIC SDK APP START diff --git a/samples/cellular/ciphersuites/cert/DigiCertGlobalG2.pem b/samples/cellular/ciphersuites/cert/DigiCertGlobalG2.pem new file mode 100644 index 000000000000..22e48e7f056d --- /dev/null +++ b/samples/cellular/ciphersuites/cert/DigiCertGlobalG2.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIEyDCCA7CgAwIBAgIQDPW9BitWAvR6uFAsI8zwZjANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH +MjAeFw0yMTAzMzAwMDAwMDBaFw0zMTAzMjkyMzU5NTlaMFkxCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxMzAxBgNVBAMTKkRpZ2lDZXJ0IEdsb2Jh +bCBHMiBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMz3EGJPprtjb+2QUlbFbSd7ehJWivH0+dbn4Y+9lavyYEEV +cNsSAPonCrVXOFt9slGTcZUOakGUWzUb+nv6u8W+JDD+Vu/E832X4xT1FE3LpxDy +FuqrIvAxIhFhaZAmunjZlx/jfWardUSVc8is/+9dCopZQ+GssjoP80j812s3wWPc +3kbW20X+fSP9kOhRBx5Ro1/tSUZUfyyIxfQTnJcVPAPooTncaQwywa8WV0yUR0J8 +osicfebUTVSvQpmowQTCd5zWSOTOEeAqgJnwQ3DPP3Zr0UxJqyRewg2C/Uaoq2yT +zGJSQnWS+Jr6Xl6ysGHlHx+5fwmY6D36g39HaaECAwEAAaOCAYIwggF+MBIGA1Ud +EwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHSFgMBmx9833s+9KTeqAx2+7c0XMB8G +A1UdIwQYMBaAFE4iVCAYlebjbuYP+vq5Eu0GF485MA4GA1UdDwEB/wQEAwIBhjAd +BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwdgYIKwYBBQUHAQEEajBoMCQG +CCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wQAYIKwYBBQUHMAKG +NGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEdsb2JhbFJvb3RH +Mi5jcnQwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQuY29t +L0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDA9BgNVHSAENjA0MAsGCWCGSAGG/WwC +ATAHBgVngQwBATAIBgZngQwBAgEwCAYGZ4EMAQICMAgGBmeBDAECAzANBgkqhkiG +9w0BAQsFAAOCAQEAkPFwyyiXaZd8dP3A+iZ7U6utzWX9upwGnIrXWkOH7U1MVl+t +wcW1BSAuWdH/SvWgKtiwla3JLko716f2b4gp/DA/JIS7w7d7kwcsr4drdjPtAFVS +slme5LnQ89/nD/7d+MS5EHKBCQRfz5eeLjJ1js+aWNJXMX43AYGyZm0pGrFmCW3R +bpD0ufovARTFXFZkAdl9h6g4U5+LXUZtXMYnhIHUfoyMo5tS58aI7Dd8KvvwVVo4 +chDYABPPTHPbqjc1qCmBaZx2vN4Ye5DUys/vZwP9BFohFrH/6j/f3IL16/RZkiMN +JCqVJUzKoZHm1Lesh3Sz8W2jmdv51b2EQJ8HmA== +-----END CERTIFICATE----- diff --git a/samples/cellular/ciphersuites/cert/DigiCertGlobalRootCA.pem b/samples/cellular/ciphersuites/cert/DigiCertGlobalRootCA.pem deleted file mode 100644 index fd4341df2663..000000000000 --- a/samples/cellular/ciphersuites/cert/DigiCertGlobalRootCA.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD -QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB -CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 -nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt -43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P -T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 -gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO -BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR -TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw -DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr -hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg -06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF -PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls -YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- diff --git a/samples/cellular/ciphersuites/sample.yaml b/samples/cellular/ciphersuites/sample.yaml index 04b4709d23e1..52e6f1cc356e 100644 --- a/samples/cellular/ciphersuites/sample.yaml +++ b/samples/cellular/ciphersuites/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.ciphersuites: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/ciphersuites/src/main.c b/samples/cellular/ciphersuites/src/main.c index 3fa8c03ac51d..bfe83bd8c0d6 100644 --- a/samples/cellular/ciphersuites/src/main.c +++ b/samples/cellular/ciphersuites/src/main.c @@ -21,7 +21,7 @@ /* Certificate for `example.com` */ static const char cert[] = { -#include "DigiCertGlobalRootCA.pem.inc" +#include "DigiCertGlobalG2.pem.inc" }; BUILD_ASSERT(sizeof(cert) < KB(4), "Certificate too large"); diff --git a/samples/cellular/fmfu_smp_svr/sample.yaml b/samples/cellular/fmfu_smp_svr/sample.yaml index 4d7cc3507087..4ad475779ceb 100644 --- a/samples/cellular/fmfu_smp_svr/sample.yaml +++ b/samples/cellular/fmfu_smp_svr/sample.yaml @@ -5,11 +5,11 @@ tests: sample.cellular.fmfu_smp_svr: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/gnss/sample.yaml b/samples/cellular/gnss/sample.yaml index 4772c8b8482b..d83085f978eb 100644 --- a/samples/cellular/gnss/sample.yaml +++ b/samples/cellular/gnss/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.gnss: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/gnss/src/factory_almanac_v2.h b/samples/cellular/gnss/src/factory_almanac_v2.h index 84bb10ce49ba..d1bdf0791c41 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-03-01 18:32:27. +/* Factory almanac generated on 2024-04-02 10:08:05. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V2 \ - "f0ea020031000900000000000000000000000000000000000000000000000000" \ - "000000000000000000003140840f00097f1047fd00510da100d0418cff3df6cd" \ - "fff9eb35000dfe020031202a0f0009521a61fd00cf0da1005d6dbaff3e622b00" \ - "c718a6fff1000600316c170f0009630e5afd00330ca100636ae6ff6b6487ff65" \ - "901e004101030031762e0f0009d71155fd00340ca1004361b8ffc9293200cdaf" \ - "370054ff000031b0190f0009f31e58fd00430ca100122f90ff3ba8e1ffa4a3d9" \ - "ff9201fcff31ed930f0009500550fd00d30ca1002bb00f00d58ca8ff89d7b5ff" \ - "b0fffeff311c4d0f0009cc0743fd00630ca100c8af6300577d0d00065b29001d" \ - "0008003167160f0009220a54fd00460da1006f04e4ff132d5200436a3b007500" \ - "040031504c0f00091d1a60fd00290da1007c52baff0b689fff23cd7a00010000" \ - "0031030a0f0009960f43fd00000da100809b91fff8ca9aff9ce3090090fdfdff" \ - "3184490f0009320d5afd002b0da100f1233d0064de390059c798ff05feffff31" \ - "12400f0009c5125ffd00d90ca10050b9eaff47162600bab31d0096020100312e" \ - "210f000957024afd00180da10005623b00646d87ff8d7f99ff66010300318c7e" \ - "0f0009eafa3dfd00740ca1003ee5deff3fb93400526d02008c00010031c8720f" \ - "0009e30c57fd00870da10056df3d0013c92100962f510091fe020031a26e0f00" \ - "0919124efd00180da100b77d67008dbdc9ff562d2b00ee02000031a51f0f0009" \ - "08154bfd009d0ca1001c6690ffe28284ff7a89d7ffacfdfeff31174e0f000992" \ - "114ffd00280da100724c6900e35d6500440c7e00d7010100313e1f0f00097306" \ - "43fd00770da1005430b3ff266695ffa87cedff940100003146cf0f0009c30c45" \ - "fd00590da10013fc8bfff2e9e6ff2e9926008b0000003196760f00096e0c56fd" \ - "00500da100c8013e00cb8ed1fff20f40001700feff31c9200f0009f3165bfd00" \ - "4f0da1005328b9ff418387ff118da9ffb100020031e87b0f0009b0fa3ffd004d" \ - "0da100a9cb0b0013812700013fe0ff32fefeff31ec600f0009500550fd00690c" \ - "a100b3a6390064fa2b00d70995ff020200003167480f0009cbf83cfd004f0ca1" \ - "00112b37002ccf15004d307400c100ffff312d660f0009ab0d4bfd000a0da100" \ - "2abc64003a331f00d29f2d00f7ffffff31ea040f0009920c59fd00630ca100ea" \ - "4c0e0088024700c6ad790061fffcff31be150f0009a91350fd00b60ca1000318" \ - "6800db98650009ea2a0085fd00003142380f00099ffb42fd00f30ca100abc30f" \ - "006a4799ff35fbb0ff43fe01003172560f0009ea0753fd000b0da100998c1000" \ - "04fa1a00cfff92ff11ff000031783e0f0009670c5afd00b90ca1007b99e4ff89" \ - "baa7ffd81b48007cfd0000000000000000000000000000000000000000000000" \ + "f0ea020031040900000000000000000000000000000000000000000000000000" \ + "00000000000000000000317d834e0409771052fd004f0da10090c27700f9b8ce" \ + "ff41245b001efe020031252b4e0409bd1a46fd00a10da100d2eea5ffc96e2b00" \ + "9295cbff3001060031fd164e0409420e57fd00c40da100ade9d1ff9ce687ff05" \ + "ce43005a01020031e82e4e040944123afd004e0ca100a4dea3ff3b4832004acd" \ + "5e0050ff00003154194e0409ff1e60fd006e0ca100ddb67b000000e3ff0b63ff" \ + "ff6301fbff31a6954e0409600554fd00c90ca1008e30fbffb4e8a8ff3b04dcff" \ + "98fffeff31774d4e040953074bfd007b0ca100a5284f00852c0e00bab64f0068" \ + "00070031eb154e0409080a4efd002b0da100f280cfff8edf510095d761009b00" \ + "040031364c4e0409871a46fd001e0da100f9d3a5ff82899fff01e1a0fffbffff" \ + "ff31ff094e0409a90f4bfd00220da100ff1b7d009b6699ff8b8a31006ffdfdff" \ + "313a494e04093d0d48fd00f10ca100f1a02800dd603a00378ebefffbfdffff31" \ + "90404e04099d125ffd00e80ca1007f3bd6ff7dcb2500028244009f0201003186" \ + "224e0409660238fd000d0da10007da26004def87ff9240bfff8101030031d87e" \ + "4e0409ddfa37fd009c0ca100d758caff97f634000e20290098000100318e724e" \ + "0409ea0c48fd00930da100ed5b29004e072200dca77600abfe030031136e4e04" \ + "099d1159fd003d0da10038fc520016edc9ff592e5100ea0200003137204e0409" \ + "171552fd00970ca1004be97b00230a84ff7dcdfeff98fdfeff31064f4e040917" \ + "115afd00350da100feca5400cd086600588da3ffe601010031621e4e0409e506" \ + "2afd009e0da100b5a89efff00896ff619612009001000031e0ce4e0409bb0c53" \ + "fd004c0da100e87a770017bbe7ff68c14b008700000031de754e0409760c47fd" \ + "00340da1005c7e290020a6d1ff130566000600feff3124214e04095f1742fd00" \ + "4a0da1005fa8a4fff07f87ffc795cfffca00020031457c4e0409b5fa42fd0051" \ + "0da1008c46f7ff5ba027009513060023feffff31bc604e040966053efd003a0c" \ + "a10034202500923f2c00c6e6bbff050200003175484e0409e4f82bfd00600ca1" \ + "00bf9e220086061600a2139bffb400ffff31d6664e0409310d52fd00090da100" \ + "fd37500080b81f0094715300efffffff3102044e04099c0c5efd00970ca100fd" \ + "d0f9ffcfb547002be09fff3afffcff3199164e04092f135efd00940ca1006697" \ + "5300f8c465002888510088fd00003155394e0409affb46fd00de0ca1004a3ffb" \ + "ff5a2d9aff3c7fd6ff52fe0100311a564e0409fb0756fd00300da100480efcff" \ + "50301b0044f6b8ff11ff000031403f4e0409490c52fd00df0ca1004f17d0ff24" \ + "7ea8ffa8f66d0078fd0000000000000000000000000000000000000000000000" \ "0000000000" #define FACTORY_ALMANAC_CHECKSUM_V2 \ - "4892cfdc52167cedd2673a20a1cdf6245f8afb8e51b631388b444cb12a35cd9a" + "b6f8f5730f5a9d1b4b5102ffd4e3d7ea64145cb2b285e27ba16280f75b23db18" #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 8c88bc1713a6..f4eeaf9949ea 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-03-02 19:19:41. +/* Factory almanac generated on 2024-04-02 09:22:49. * * Note, that the almanac gets more inaccurate with time and it should be updated periodically. */ #define FACTORY_ALMANAC_DATA_V3 \ - "f0ea030031000900000000000000000000000000000000000000000000000000" \ - "00000000000000000000313c842400097f1046fd00510da100813a8cffe6fdcd" \ - "ff570e35000dfe0200312a2a240009531a59fd00cd0da1004e66baff3e652b00" \ - "2e3ba5fff3000600316f17240009660e5ffd003a0ca1004c63e6ffc87487ff96" \ - "b41d0042010300317b2e240009d9114dfd00340ca100105ab8ff522d3200f2e0" \ - "360054ff000031ae19240009f31e54fd00430ca100fb2790ff3eb5e1ffa3cad8" \ - "ff9101fcff31f993240009510550fd00d00ca100eea80f00d98ea8ff3704b5ff" \ - "b0fffeff311f4d240009ca074dfd00670ca10074a8630021820d002089280020" \ - "000800315e16240009250a59fd004c0da10043fde3fff2305200bc903a007700" \ - "0400314f4c2400091e1a58fd00280da1006c4bbaff55699fff6cf77900010000" \ - "0031020a240009960f3ffd00000da1002e9491ffdfbd9affb81d09008ffdfdff" \ - "3185492400092f0d59fd00230da100cb1c3d0056e2390002ef97ff04feffff31" \ - "1140240009c71265fd00e00ca1004cb2eaffba112600a5e61c00960201003139" \ - "21240009530249fd00120da100b45a3b003d6e87fffdaa98ff67010300318b7e" \ - "240009ecfa42fd007c0ca100d0dddeff94ba34002f9e01008d00010031c97224" \ - "0009e00c57fd00820da1002ed83d00dfcb2100ec54500092fe0200319c6e2400" \ - "09171257fd001d0da1008976670089bfc9ff75572a00ee02000031a91f240009" \ - "091548fd009c0ca100df5e90ffdb7c84ff2dc0d6ffacfdfeff311e4e24000991" \ - "1158fd002d0da100414569002a65650087307d00d701010031371f2400097406" \ - "3afd00770da100ee28b3ffb66995ffc2a1ecff94010000314acf240009c40c45" \ - "fd00590da100b4f48bff95f0e6ff4dbc25008b000000318c762400096b0c56fd" \ - "004a0da1009efa3d00948fd1ff55393f001600feff31cd20240009f41653fd00" \ - "4e0da1003621b9fffc8087ff7bb9a8ffb200020031e77b240009b1fa3ffd004b" \ - "0da1003ec40b00bf8227007d67dfff31fefeff31ef602400094d054efd00610c" \ - "a1006b9f390045fd2b00c83994ff02020000316a48240009c8f83afd00490ca1" \ - "00962337006bd31500d75f7300c000ffff313266240009a90d54fd000e0da100" \ - "ecb4640068361f004bc92c00f6ffffff31e404240009920c58fd00620ca100cc" \ - "450e00151e470007c5780060fffcff31c415240009a71359fd00b90ca100db10" \ - "6800da9d6500ca142a0085fd0000314b38240009a0fb41fd00f00ca10045bc0f" \ - "003b4c99ffea23b0ff43fe0100316c56240009ea0751fd00090da10067851000" \ - "c4fc1a00ab2992ff11ff000031843e2400096a0c5ffd00c10ca1005a92e4ffd2" \ - "c1a7ff264447007cfd0000000000000000000000000000000000000000000000" \ - "00000000000000000000000000003104791500092ecf24ff0121ecca00b0e642" \ - "00741dc0ff1b046100fdff0000310b77150009a9cd33ff013be9ca00cd3189ff" \ - "aad4bfff0e8219000000000031e07a15000955961bff01a2e6ca0075ebceff1f" \ - "72bfff3a83cfff35000000000000000000000000000000000000000000000000" \ + "f0ea030031040900000000000000000000000000000000000000000000000000" \ + "00000000000000000000317d834e0409771052fd004f0da10090c27700f9b8ce" \ + "ff41245b001efe020031252b4e0409bd1a46fd00a10da100d2eea5ffc96e2b00" \ + "9295cbff3001060031fd164e0409420e57fd00c40da100ade9d1ff9ce687ff05" \ + "ce43005a01020031e82e4e040944123afd004e0ca100a4dea3ff3b4832004acd" \ + "5e0050ff00003154194e0409ff1e60fd006e0ca100ddb67b000000e3ff0b63ff" \ + "ff6301fbff31a6954e0409600554fd00c90ca1008e30fbffb4e8a8ff3b04dcff" \ + "98fffeff31774d4e040953074bfd007b0ca100a5284f00852c0e00bab64f0068" \ + "00070031eb154e0409080a4efd002b0da100f280cfff8edf510095d761009b00" \ + "040031364c4e0409871a46fd001e0da100f9d3a5ff82899fff01e1a0fffbffff" \ + "ff31ff094e0409a90f4bfd00220da100ff1b7d009b6699ff8b8a31006ffdfdff" \ + "313a494e04093d0d48fd00f10ca100f1a02800dd603a00378ebefffbfdffff31" \ + "90404e04099d125ffd00e80ca1007f3bd6ff7dcb2500028244009f0201003186" \ + "224e0409660238fd000d0da10007da26004def87ff9240bfff8101030031d87e" \ + "4e0409ddfa37fd009c0ca100d758caff97f634000e20290098000100318e724e" \ + "0409ea0c48fd00930da100ed5b29004e072200dca77600abfe030031136e4e04" \ + "099d1159fd003d0da10038fc520016edc9ff592e5100ea0200003137204e0409" \ + "171552fd00970ca1004be97b00230a84ff7dcdfeff98fdfeff31064f4e040917" \ + "115afd00350da100feca5400cd086600588da3ffe601010031621e4e0409e506" \ + "2afd009e0da100b5a89efff00896ff619612009001000031e0ce4e0409bb0c53" \ + "fd004c0da100e87a770017bbe7ff68c14b008700000031de754e0409760c47fd" \ + "00340da1005c7e290020a6d1ff130566000600feff3124214e04095f1742fd00" \ + "4a0da1005fa8a4fff07f87ffc795cfffca00020031457c4e0409b5fa42fd0051" \ + "0da1008c46f7ff5ba027009513060023feffff31bc604e040966053efd003a0c" \ + "a10034202500923f2c00c6e6bbff050200003175484e0409e4f82bfd00600ca1" \ + "00bf9e220086061600a2139bffb400ffff31d6664e0409310d52fd00090da100" \ + "fd37500080b81f0094715300efffffff3102044e04099c0c5efd00970ca100fd" \ + "d0f9ffcfb547002be09fff3afffcff3199164e04092f135efd00940ca1006697" \ + "5300f8c465002888510088fd00003155394e0409affb46fd00de0ca1004a3ffb" \ + "ff5a2d9aff3c7fd6ff52fe0100311a564e0409fb0756fd00300da100480efcff" \ + "50301b0044f6b8ff11ff000031403f4e0409490c52fd00df0ca1004f17d0ff24" \ + "7ea8ffa8f66d0078fd0000000000000000000000000000000000000000000000" \ + "000000000000000000000000000031be75550409e3cedbfe0125edca00caed2e" \ + "00f66ac0ff34827e00fcff0000310c7655040978cd38ff01d3eaca004b4e7500" \ + "780ec0ffa749380000000000311e7d550409d7960fff01a4e8ca0051ecbaff18" \ + "18c0ff200fefff35000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ - "000000000000000000310301150009c8005e0001a8ebca006f7b0f006e5e80ff" \ - "b30fcaff00000000000000000000000000000000000000000000000000000000" \ + "00000000000000000031e600550409170159000173ecca0059d5ddff4e1caeff" \ + "14b9d8ff00000000000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ "0000000000000000000000000000000000000000000000000000000000000000" \ "00000000000000000000000000000000000000000000000000000000000000" #define FACTORY_ALMANAC_CHECKSUM_V3 \ - "c961920be623093a5680cd282036daf672955684769faaf90ffab789fa1e5992" + "eac31efee639e54691ab81d9a62fdb0afe59956e637bcd2b28b3e3a888c56a92" #endif /* FACTORY_ALMANAC_V3_H_ */ diff --git a/samples/cellular/gnss/src/main.c b/samples/cellular/gnss/src/main.c index 481bce3cc2a1..dc9dfeb94258 100644 --- a/samples/cellular/gnss/src/main.c +++ b/samples/cellular/gnss/src/main.c @@ -653,11 +653,11 @@ static void print_fix_data(struct nrf_modem_gnss_pvt_data_frame *pvt_data) { printf("Latitude: %.06f\n", pvt_data->latitude); printf("Longitude: %.06f\n", pvt_data->longitude); - printf("Altitude: %.01f m\n", pvt_data->altitude); - printf("Accuracy: %.01f m\n", pvt_data->accuracy); - printf("Speed: %.01f m/s\n", pvt_data->speed); - printf("Speed accuracy: %.01f m/s\n", pvt_data->speed_accuracy); - printf("Heading: %.01f deg\n", pvt_data->heading); + printf("Altitude: %.01f m\n", (double)pvt_data->altitude); + printf("Accuracy: %.01f m\n", (double)pvt_data->accuracy); + printf("Speed: %.01f m/s\n", (double)pvt_data->speed); + printf("Speed accuracy: %.01f m/s\n", (double)pvt_data->speed_accuracy); + printf("Heading: %.01f deg\n", (double)pvt_data->heading); printf("Date: %04u-%02u-%02u\n", pvt_data->datetime.year, pvt_data->datetime.month, @@ -667,10 +667,10 @@ static void print_fix_data(struct nrf_modem_gnss_pvt_data_frame *pvt_data) pvt_data->datetime.minute, pvt_data->datetime.seconds, pvt_data->datetime.ms); - printf("PDOP: %.01f\n", pvt_data->pdop); - printf("HDOP: %.01f\n", pvt_data->hdop); - printf("VDOP: %.01f\n", pvt_data->vdop); - printf("TDOP: %.01f\n", pvt_data->tdop); + printf("PDOP: %.01f\n", (double)pvt_data->pdop); + printf("HDOP: %.01f\n", (double)pvt_data->hdop); + printf("VDOP: %.01f\n", (double)pvt_data->vdop); + printf("TDOP: %.01f\n", (double)pvt_data->tdop); } int main(void) diff --git a/samples/cellular/http_update/application_update/sample.yaml b/samples/cellular/http_update/application_update/sample.yaml index d5ec22618b0f..3bef81db8343 100644 --- a/samples/cellular/http_update/application_update/sample.yaml +++ b/samples/cellular/http_update/application_update/sample.yaml @@ -4,23 +4,23 @@ tests: sample.cellular.http_update.application_update: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.http_update.application_update.lwm2m_carrier: build_only: true extra_args: OVERLAY_CONFIG=overlay-carrier.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/http_update/modem_delta_update/boards/nrf9151dk_nrf9151_ns.conf b/samples/cellular/http_update/modem_delta_update/boards/nrf9151dk_nrf9151_ns.conf index 45729af2bb1b..95299153953b 100644 --- a/samples/cellular/http_update/modem_delta_update/boards/nrf9151dk_nrf9151_ns.conf +++ b/samples/cellular/http_update/modem_delta_update/boards/nrf9151dk_nrf9151_ns.conf @@ -4,6 +4,6 @@ # # Modem firmware version configuration -CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf91x1_2.0.0" -CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf91x1_update_from_2.0.0_to_2.0.0-FOTA-TEST.bin" -CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf91x1_update_from_2.0.0-FOTA-TEST_to_2.0.0.bin" +CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf91x1_2.0.1" +CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf91x1_update_from_2.0.1_to_2.0.1-FOTA-TEST.bin" +CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf91x1_update_from_2.0.1-FOTA-TEST_to_2.0.1.bin" diff --git a/samples/cellular/http_update/modem_delta_update/boards/nrf9160dk_nrf9160_ns.conf b/samples/cellular/http_update/modem_delta_update/boards/nrf9160dk_nrf9160_ns.conf index b72d0626cc99..b1d638ccb06d 100644 --- a/samples/cellular/http_update/modem_delta_update/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/cellular/http_update/modem_delta_update/boards/nrf9160dk_nrf9160_ns.conf @@ -4,6 +4,6 @@ # # Modem firmware version configuration -CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf9160_1.3.5" -CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf9160_update_from_1.3.5_to_1.3.5-FOTA-TEST.bin" -CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf9160_update_from_1.3.5-FOTA-TEST_to_1.3.5.bin" +CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf9160_1.3.6" +CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf9160_update_from_1.3.6_to_1.3.6-FOTA-TEST.bin" +CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf9160_update_from_1.3.6-FOTA-TEST_to_1.3.6.bin" diff --git a/samples/cellular/http_update/modem_delta_update/boards/nrf9161dk_nrf9161_ns.conf b/samples/cellular/http_update/modem_delta_update/boards/nrf9161dk_nrf9161_ns.conf index d37bea0cc24a..bc1082b3750f 100644 --- a/samples/cellular/http_update/modem_delta_update/boards/nrf9161dk_nrf9161_ns.conf +++ b/samples/cellular/http_update/modem_delta_update/boards/nrf9161dk_nrf9161_ns.conf @@ -4,6 +4,6 @@ # # Modem firmware version configuration -CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf91x1_2.0.0" -CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf91x1_update_from_2.0.0_to_2.0.0-FOTA-TEST.bin" -CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf91x1_update_from_2.0.0-FOTA-TEST_to_2.0.0.bin" +CONFIG_SUPPORTED_BASE_VERSION="mfw_nrf91x1_2.0.1" +CONFIG_DOWNLOAD_FILE_BASE_TO_FOTA_TEST="mfw_nrf91x1_update_from_2.0.1_to_2.0.1-FOTA-TEST.bin" +CONFIG_DOWNLOAD_FILE_FOTA_TEST_TO_BASE="mfw_nrf91x1_update_from_2.0.1-FOTA-TEST_to_2.0.1.bin" diff --git a/samples/cellular/http_update/modem_delta_update/sample.yaml b/samples/cellular/http_update/modem_delta_update/sample.yaml index c21b8ff199ed..648d94d4c420 100644 --- a/samples/cellular/http_update/modem_delta_update/sample.yaml +++ b/samples/cellular/http_update/modem_delta_update/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.http_update.modem_delta_update: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/http_update/modem_full_update/boards/nrf9151dk_nrf9151_ns.conf b/samples/cellular/http_update/modem_full_update/boards/nrf9151dk_nrf9151_ns.conf index 99415992e836..f0fb280c60a1 100644 --- a/samples/cellular/http_update/modem_full_update/boards/nrf9151dk_nrf9151_ns.conf +++ b/samples/cellular/http_update/modem_full_update/boards/nrf9151dk_nrf9151_ns.conf @@ -7,7 +7,7 @@ CONFIG_SPI=y CONFIG_SPI_NOR=y # Modem firmware version configuration -CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_2.0.0-77.beta.cbor" -CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf91x1_2.0.0-77" +CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_2.0.0.cbor" +CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf91x1_2.0.0" -CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_2.0.0.cbor" +CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_2.0.1.cbor" diff --git a/samples/cellular/http_update/modem_full_update/boards/nrf9160dk_nrf9160_ns.conf b/samples/cellular/http_update/modem_full_update/boards/nrf9160dk_nrf9160_ns.conf index 62f094f93483..2de7876851dc 100644 --- a/samples/cellular/http_update/modem_full_update/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/cellular/http_update/modem_full_update/boards/nrf9160dk_nrf9160_ns.conf @@ -7,7 +7,7 @@ CONFIG_SPI=y CONFIG_SPI_NOR=y # Modem firmware version configuration -CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_1.3.4.cbor" -CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf9160_1.3.4" +CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_1.3.5.cbor" +CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf9160_1.3.5" -CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_1.3.5.cbor" +CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_1.3.6.cbor" diff --git a/samples/cellular/http_update/modem_full_update/boards/nrf9161dk_nrf9161_ns.conf b/samples/cellular/http_update/modem_full_update/boards/nrf9161dk_nrf9161_ns.conf index 66c1c04d24f8..57f3d5a85132 100644 --- a/samples/cellular/http_update/modem_full_update/boards/nrf9161dk_nrf9161_ns.conf +++ b/samples/cellular/http_update/modem_full_update/boards/nrf9161dk_nrf9161_ns.conf @@ -7,7 +7,7 @@ CONFIG_SPI=y CONFIG_SPI_NOR=y # Modem firmware version configuration -CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_2.0.0-77.beta.cbor" -CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf91x1_2.0.0-77" +CONFIG_DOWNLOAD_MODEM_0_FILE="fmfu_2.0.0.cbor" +CONFIG_DOWNLOAD_MODEM_0_VERSION="mfw_nrf91x1_2.0.0" -CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_2.0.0.cbor" +CONFIG_DOWNLOAD_MODEM_1_FILE="fmfu_2.0.1.cbor" diff --git a/samples/cellular/http_update/modem_full_update/sample.yaml b/samples/cellular/http_update/modem_full_update/sample.yaml index 0a94d5e79dc7..6d942fdcc664 100644 --- a/samples/cellular/http_update/modem_full_update/sample.yaml +++ b/samples/cellular/http_update/modem_full_update/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.http_update.full_modem_update: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/location/README.rst b/samples/cellular/location/README.rst index ab102bc0bb22..202a5fb24158 100644 --- a/samples/cellular/location/README.rst +++ b/samples/cellular/location/README.rst @@ -53,9 +53,8 @@ The configuration files are in the |sample path| directory. The following files are available: -* :file:`nrf7002ek-wifi-scan-only.conf` - Config overlay for nRF7002 EK Wi-Fi chip support. -* :file:`esp_8266_nrf9160ns.overlay` - DTC overlay for ESP8266 Wi-Fi chip support. -* :file:`overlay-esp-wifi.conf` - Config overlay for ESP8266 Wi-Fi chip support. +* :file:`overlay-nrf700x-wifi-scan-only.conf` - Config overlay for nRF7002 Wi-Fi chip support. +* :file:`thingy91x-wifi.overlay` - DTC overlay for Thingy:91 X Wi-Fi support. * :file:`overlay-pgps.conf` - Config overlay for P-GPS support. .. include:: /libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst @@ -72,27 +71,27 @@ 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 ``-DOVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf`` options. +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. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DSHIELD=nrf7002ek -DOVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + west build -p -b *build_target* -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf |build_target| See :ref:`cmake_options` for more instructions on how to add these options. -ESP8266 Wi-Fi support -===================== +Thingy:91 X Wi-Fi support +========================= -To build the Location sample with ESP8266 Wi-Fi chip support, use the ``-DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay`` and ``-DOVERLAY_CONFIG=overlay-esp-wifi.conf`` options. +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. For example: .. code-block:: console - west build -p -b nrf9160dk_nrf9160_ns -- -DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay -DOVERLAY_CONFIG=overlay-esp-wifi.conf + west build -p -b thingy91x_nrf9151_ns -- -DDTC_OVERLAY_FILE=thingy91x_wifi.overlay -DEXTRA_CONF_FILE=overlay-nrf700x-wifi-scan-only.conf See :ref:`cmake_options` for more instructions on how to add these options. @@ -104,7 +103,7 @@ To build the Location sample with P-GPS support, use the following commands: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DOVERLAY_CONFIG=overlay-pgps.conf + west build -p -b *build_target* -- -DEXTRA_CONF_FILE=overlay-pgps.conf |build_target| diff --git a/samples/cellular/location/esp_8266_nrf9160ns.overlay b/samples/cellular/location/esp_8266_nrf9160ns.overlay deleted file mode 100644 index 6552f4543bd6..000000000000 --- a/samples/cellular/location/esp_8266_nrf9160ns.overlay +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2021-2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - /* - * DTS overlay to be used with connecting nRF9160DK with ESP8266-01 using - * esp_at driver. - * - * https://en.wikipedia.org/wiki/ESP8266 - * - * Wiring: - * - Slide (SW9) to enable 3V mode. - * - ESP8266 RX → DK P0.10 (TX) - * - ESP8266 TX → DK P0.16 (RX) - * - ESP8266 VCC → DK VDD - * - ESP8266 CH_PD → DK VDD - * - ESP8266 GND → DK GND. - * - * Compilation with SW overlay: - * 'west build -p -b nrf9160dk_nrf9160_ns -- -DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay -DOVERLAY_CONFIG=overlay-esp-wifi.conf' - */ - -&uart3 { - status = "okay"; - current-speed = <115200>; - - pinctrl-0 = <&uart3_default_alt>; - pinctrl-1 = <&uart3_sleep_alt>; - pinctrl-names = "default", "sleep"; - esp8266: esp8266 { - compatible = "espressif,esp-at"; - status = "okay"; - }; -}; - -&pinctrl { - uart3_default_alt: uart3_default_alt { - group1 { - psels = , - ; - }; - }; - - uart3_sleep_alt: uart3_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - -}; - -/ { - chosen { - ncs,location-wifi = &esp8266; - }; -}; diff --git a/samples/cellular/location/overlay-esp-wifi.conf b/samples/cellular/location/overlay-esp-wifi.conf deleted file mode 100644 index c0888c22d6bb..000000000000 --- a/samples/cellular/location/overlay-esp-wifi.conf +++ /dev/null @@ -1,16 +0,0 @@ -# ESP 8266 WIFI -CONFIG_WIFI=y -CONFIG_WIFI_LOG_LEVEL_DBG=y # optional -CONFIG_WIFI_OFFLOAD=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 - -CONFIG_NET_IPV4=y # must for ESP8266 to compile -CONFIG_NET_NATIVE=y # must for ESP8266 to compile - -CONFIG_WIFI_ESP_AT=y -CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS=y -CONFIG_WIFI_ESP_AT_SCAN_PASSIVE=n -CONFIG_WIFI_ESP_AT_VERSION_1_7=y -CONFIG_WIFI_ESP_AT_SCAN_RESULT_RSSI_ORDERED=y - -CONFIG_LOCATION_METHOD_WIFI=y diff --git a/samples/cellular/location/overlay-nrf7002ek-wifi-scan-only.conf b/samples/cellular/location/overlay-nrf7002ek-wifi-scan-only.conf deleted file mode 100644 index 8c8549845dc6..000000000000 --- a/samples/cellular/location/overlay-nrf7002ek-wifi-scan-only.conf +++ /dev/null @@ -1,66 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Overlay to use nRF7002 EK on top of nrf9160 DK for Wi-Fi scanning - -# Disable modem traces as UART1 is disabled -CONFIG_NRF_MODEM_LIB_TRACE=n - -CONFIG_LOCATION_METHOD_WIFI=y -CONFIG_LOCATION_SERVICE_NRF_CLOUD=y - -# Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT. -# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE. -CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=60 -CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 - -# Actual configs for the Wi-Fi -CONFIG_WIFI=y -CONFIG_WIFI_NRF700X=y -CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y -# Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT. -# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE. -CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=60 - -# System settings -CONFIG_NEWLIB_LIBC=y - -# Scan only using offload API -CONFIG_WPA_SUPP=n - -# For nRF9160 the default is socket interface -CONFIG_NET_DEFAULT_IF_ETHERNET=y -CONFIG_MBEDTLS=n -CONFIG_NORDIC_SECURITY_BACKEND=n - -# Networking -CONFIG_NET_L2_ETHERNET=y -CONFIG_NET_NATIVE=y -CONFIG_NET_IPV4=y -CONFIG_NET_DHCPV4=y -CONFIG_NET_STATISTICS=y -CONFIG_NET_STATISTICS_WIFI=y -CONFIG_NET_STATISTICS_USER_API=y -CONFIG_NET_CONTEXT_SYNC_RECV=y - -# Disable unused networking options -CONFIG_NET_IPV6=n - -# Memory configurations -CONFIG_NET_BUF_RX_COUNT=8 -CONFIG_NET_BUF_TX_COUNT=8 -CONFIG_NET_PKT_RX_COUNT=1 -CONFIG_NET_PKT_TX_COUNT=1 -CONFIG_NET_TX_STACK_SIZE=4096 -CONFIG_NET_RX_STACK_SIZE=4096 -CONFIG_NET_TC_TX_COUNT=1 -CONFIG_NET_MAX_CONTEXTS=5 -CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 - -# Wi-Fi shell sample has 25000 heap size. We need a bit more for location request purposes. -# Heap allocation should be changed when CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT -# and CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT (which should be the same value) are changed. -CONFIG_HEAP_MEM_POOL_SIZE=40000 diff --git a/samples/cellular/location/overlay-nrf700x-wifi-scan-only.conf b/samples/cellular/location/overlay-nrf700x-wifi-scan-only.conf new file mode 100644 index 000000000000..c18797a7a559 --- /dev/null +++ b/samples/cellular/location/overlay-nrf700x-wifi-scan-only.conf @@ -0,0 +1,69 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Overlay to use Wi-Fi scanning +# with one of the following configurations: +# * a nRF7002 EK on top of nrf9160 DK +# * a Thingy:91 X + +# Disable modem traces as UART1 is disabled +CONFIG_NRF_MODEM_LIB_TRACE=n + +CONFIG_LOCATION_METHOD_WIFI=y +CONFIG_LOCATION_SERVICE_NRF_CLOUD=y + +# Align this with CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT. +# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE. +CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=60 +CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192 + +# Actual configs for the Wi-Fi +CONFIG_WIFI=y +CONFIG_WIFI_NRF700X=y +CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y +# Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT. +# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE. +CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=60 + +# System settings +CONFIG_NEWLIB_LIBC=y + +# Scan only using offload API +CONFIG_WPA_SUPP=n + +# For nRF9160 the default is socket interface +CONFIG_NET_DEFAULT_IF_ETHERNET=y +CONFIG_MBEDTLS=n +CONFIG_NORDIC_SECURITY_BACKEND=n + +# Networking +CONFIG_NET_L2_ETHERNET=y +CONFIG_NET_NATIVE=y +CONFIG_NET_IPV4=y +CONFIG_NET_DHCPV4=y +CONFIG_NET_STATISTICS=y +CONFIG_NET_STATISTICS_WIFI=y +CONFIG_NET_STATISTICS_USER_API=y +CONFIG_NET_CONTEXT_SYNC_RECV=y + +# Disable unused networking options +CONFIG_NET_IPV6=n + +# Memory configurations +CONFIG_NET_BUF_RX_COUNT=8 +CONFIG_NET_BUF_TX_COUNT=8 +CONFIG_NET_PKT_RX_COUNT=1 +CONFIG_NET_PKT_TX_COUNT=1 +CONFIG_NET_TX_STACK_SIZE=4096 +CONFIG_NET_RX_STACK_SIZE=4096 +CONFIG_NET_TC_TX_COUNT=1 +CONFIG_NET_MAX_CONTEXTS=5 +CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 + +# Wi-Fi shell sample has 25000 heap size. We need a bit more for location request purposes. +# Heap allocation should be changed when CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT +# and CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT (which should be the same value) are changed. +CONFIG_HEAP_MEM_POOL_SIZE=40000 diff --git a/samples/cellular/location/sample.yaml b/samples/cellular/location/sample.yaml index 08f16c621125..a550acc65dae 100644 --- a/samples/cellular/location/sample.yaml +++ b/samples/cellular/location/sample.yaml @@ -4,73 +4,72 @@ tests: sample.cellular.location: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - tags: ci_build - sample.cellular.location.esp_wifi: - build_only: true - extra_args: > - OVERLAY_CONFIG=overlay-esp-wifi.conf DTC_OVERLAY_FILE="esp_8266_nrf9160ns.overlay" - integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.location.pgps: build_only: true extra_args: OVERLAY_CONFIG=overlay-pgps.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.location.nrf7002ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG=overlay-nrf700x-wifi-scan-only.conf tags: ci_build sample.cellular.location.nrf7000ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - extra_args: SHIELD=nrf7002ek_nrf7000 OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_args: SHIELD=nrf7002ek_nrf7000 OVERLAY_CONFIG=overlay-nrf700x-wifi-scan-only.conf CONFIG_WPA_SUPP=n tags: ci_build sample.cellular.location.nrf7001ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_args: SHIELD=nrf7002ek_nrf7001 OVERLAY_CONFIG=overlay-nrf700x-wifi-scan-only.conf + tags: ci_build + sample.cellular.location.thingy91x: + build_only: true + platform_allow: + - thingy91x/nrf9151/ns + tags: ci_build + sample.cellular.location.thingy91x_wifi: + build_only: true platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - extra_args: SHIELD=nrf7002ek_nrf7001 OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + - thingy91x/nrf9151/ns + extra_args: OVERLAY_CONFIG=overlay-nrf700x-wifi-scan-only.conf + DTC_OVERLAY_FILE=thingy91x_wifi.overlay tags: ci_build diff --git a/samples/cellular/location/src/main.c b/samples/cellular/location/src/main.c index deae19719a0e..1ca33050065a 100644 --- a/samples/cellular/location/src/main.c +++ b/samples/cellular/location/src/main.c @@ -46,7 +46,7 @@ static void location_event_handler(const struct location_event_data *event_data) printk(" method: %s\n", location_method_str(event_data->method)); printk(" latitude: %.06f\n", event_data->location.latitude); printk(" longitude: %.06f\n", event_data->location.longitude); - printk(" accuracy: %.01f m\n", event_data->location.accuracy); + printk(" accuracy: %.01f m\n", (double)event_data->location.accuracy); if (event_data->location.datetime.valid) { printk(" date: %04d-%02d-%02d\n", event_data->location.datetime.year, diff --git a/samples/cellular/location/thingy91x_wifi.overlay b/samples/cellular/location/thingy91x_wifi.overlay new file mode 100644 index 000000000000..3040aed18820 --- /dev/null +++ b/samples/cellular/location/thingy91x_wifi.overlay @@ -0,0 +1,6 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include diff --git a/samples/cellular/lte_ble_gateway/README.rst b/samples/cellular/lte_ble_gateway/README.rst index 575169b77242..3a76d75b8bf1 100644 --- a/samples/cellular/lte_ble_gateway/README.rst +++ b/samples/cellular/lte_ble_gateway/README.rst @@ -98,7 +98,7 @@ Program the board controller as follows: 1. Set the **SW10** switch, marked as *debug/prog*, in the **NRF52** position. On nRF9160 DK board version 0.9.0 and earlier versions, the switch was called **SW5**. -#. Build the :ref:`bluetooth-hci-lpuart-sample` sample for the nrf9160dk_nrf52840 build target and program the board controller with it. +#. Build the :ref:`bluetooth-hci-lpuart-sample` sample for the nrf9160dk/nrf52840 build target and program the board controller with it. .. note:: To build the sample successfully, you must specify the board version along with the build target. @@ -108,10 +108,10 @@ Program the board controller as follows: .. parsed-literal:: :class: highlight - west build --board nrf9160dk_nrf52840@1.1.0 + west build --board nrf9160dk@1.1.0/nrf52840 #. Verify that the programming was successful. - Use a terminal emulator, like nRF Connect Serial Terminal, to connect to the second serial port and check the output. + Use a terminal emulator, like `nRF Connect Serial Terminal`_, to connect to the second serial port and check the output. See :ref:`test_and_optimize` for the required settings and steps. After programming the board controller, you must program the main controller with the LTE Sensor Gateway sample. @@ -119,7 +119,7 @@ Program the main controller as follows: 1. Set the **SW10** switch, marked as *debug/prog*, in the **NRF91** position. On nRF9160 DK board version 0.9.0 and earlier versions, the switch was called **SW5**. -#. Build the LTE Sensor Gateway sample (this sample) for the nrf9160dk_nrf9160_ns build target and program the main controller with it. +#. Build the LTE Sensor Gateway sample (this sample) for the nrf9160dk/nrf9160/ns build target and program the main controller with it. .. note:: To build the sample successfully, you must specify the board version along with the build target. @@ -128,7 +128,7 @@ Program the main controller as follows: .. parsed-literal:: :class: highlight - west build --board nrf9160dk_nrf9160_ns@1.1.0 + west build --board nrf9160dk@1.1.0/nrf9160/ns #. Verify that the programming was successful. To do so, use a terminal emulator, like nRF Connect Serial Terminal, to connect to the first serial port and check the output. diff --git a/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay b/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay index 2794cb1b5087..ec88fa972168 100644 --- a/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay +++ b/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns.overlay @@ -1,4 +1,4 @@ -#include +#include / { chosen { diff --git a/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns_0_14_0.overlay b/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns_0_14_0.overlay index 3a51edb8015b..4b403f182c08 100644 --- a/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns_0_14_0.overlay +++ b/samples/cellular/lte_ble_gateway/boards/nrf9160dk_nrf9160_ns_0_14_0.overlay @@ -1,2 +1,2 @@ /* Use the reset line that is available starting from v0.14.0 of the DK. */ -#include +#include diff --git a/samples/cellular/lte_ble_gateway/sample.yaml b/samples/cellular/lte_ble_gateway/sample.yaml index 65c8ca56339b..023cf604048b 100644 --- a/samples/cellular/lte_ble_gateway/sample.yaml +++ b/samples/cellular/lte_ble_gateway/sample.yaml @@ -4,6 +4,6 @@ tests: sample.cellular.lte_ble_gateway: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build diff --git a/samples/cellular/lwm2m_carrier/provisioning.rst b/samples/cellular/lwm2m_carrier/provisioning.rst index 44c2570f81a3..e8f7dd306f04 100644 --- a/samples/cellular/lwm2m_carrier/provisioning.rst +++ b/samples/cellular/lwm2m_carrier/provisioning.rst @@ -40,7 +40,7 @@ To pre-program the certificates, use one of the following methods: Other samples and applications like :ref:`asset_tracker_v2` and :ref:`modem_shell_application` with the carrier library integration do not write any certificates in the application. -Pre-shared Key (PSK) +Pre-shared key (PSK) ******************** In live (production) environment, the correct PSK is generated and stored in the modem depending on which operator network the device is in. diff --git a/samples/cellular/lwm2m_carrier/sample.yaml b/samples/cellular/lwm2m_carrier/sample.yaml index 249134e22629..77d3a93c0a2d 100644 --- a/samples/cellular/lwm2m_carrier/sample.yaml +++ b/samples/cellular/lwm2m_carrier/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.lwm2m_carrier: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/lwm2m_carrier/sample_description.rst b/samples/cellular/lwm2m_carrier/sample_description.rst index bec4681df23f..72f7d3c1a8f7 100644 --- a/samples/cellular/lwm2m_carrier/sample_description.rst +++ b/samples/cellular/lwm2m_carrier/sample_description.rst @@ -86,7 +86,7 @@ Server options .. _CONFIG_CARRIER_APP_PSK: -CONFIG_CARRIER_APP_PSK - Configuration for Pre-Shared Key +CONFIG_CARRIER_APP_PSK - Configuration for a pre-shared key (PSK) The sample configuration is used to set the hexadecimal representation of the PSK used when registering the device with the server. The PSK is stored in the security tag specified in :kconfig:option:`CONFIG_LWM2M_CARRIER_SERVER_SEC_TAG`. @@ -120,12 +120,12 @@ Building and running Building with overlay ===================== -To build with a Kconfig overlay, pass it to the build system using the ``OVERLAY_CONFIG`` CMake variable, as shown in the following example: +To build with a Kconfig overlay, pass it to the build system using the ``EXTRA_CONF_FILE`` CMake variable, as shown in the following example: .. parsed-literal:: :class: highlight - west build -b *build_target* -- -DOVERLAY_CONFIG=overlay-shell.conf + west build -b *build_target* -- -DEXTRA_CONF_FILE=overlay-shell.conf |build_target| @@ -138,7 +138,9 @@ Testing After programming the sample and all prerequisites to the development kit, test it by performing the following steps: 1. Connect the USB cable and power on or reset your nRF91 Series DK. -#. Open a terminal emulator and observe that the kit prints the following information:: +#. Use a terminal emulator, like `nRF Connect Serial Terminal`_, to connect to the serial port. + See :ref:`test_and_optimize` for the required settings and steps. +#. Observe that the kit prints the following information:: LWM2M Carrier library sample. #. Observe that the application receives events from the :ref:`liblwm2m_carrier_readme` library using the registered event handler. If the client and server configuration is correct, the initial output looks similar to the following output: diff --git a/samples/cellular/lwm2m_client/fota.rst b/samples/cellular/lwm2m_client/fota.rst index 430c74f52cf3..b8ae4abfc160 100644 --- a/samples/cellular/lwm2m_client/fota.rst +++ b/samples/cellular/lwm2m_client/fota.rst @@ -97,9 +97,8 @@ Initializing The Advanced Firmware Update functionality is implemented in :file:`lwm2m_firmware.c` and :file:`lwm2m_adv_firmware.c`. The Advanced Firmware Update object shares the same API with the standard LwM2M Firmware Update object as implemented in the :ref:`lib_lwm2m_client_utils` library. -This object is initialized by calling the :c:func:`lwm2m_init_firmware` function and by confirming the currently booted application image as valid by calling the :c:func:`lwm2m_init_image` function. -The validation of the image marks the FOTA process as complete, and the result is reported to the server. -The modem FOTA process is automatically validated. +The image is automatically confirmed to be valid on the boot and that marks the FOTA process as completed. +The modem FOTA process is automatically validated during update; it does not reboot the device. LwM2M Client utilities library setup ==================================== @@ -287,7 +286,7 @@ Complete the following steps to test the advanced FOTA firmware update with the .. tabs:: - .. group-tab:: nRF9160 DK + .. group-tab:: nRF91x1 DK .. code-block:: console diff --git a/samples/cellular/lwm2m_client/fota_external_mcu.rst b/samples/cellular/lwm2m_client/fota_external_mcu.rst index f1dd4f4cef5f..816e10ca9f39 100644 --- a/samples/cellular/lwm2m_client/fota_external_mcu.rst +++ b/samples/cellular/lwm2m_client/fota_external_mcu.rst @@ -56,7 +56,7 @@ The following steps use generic MCUmgr client mode and Coiote without bootstrap. .. code-block:: console cd samples/cellular/smp_svr/ - west build --pristine -b nrf9160dk_nrf52840 -- -DEXTRA_CONF_FILE="overlay-serial.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_mcumgr_srv.overlay" + west build --pristine -b nrf9160dk/nrf52840 -- -DEXTRA_CONF_FILE="overlay-serial.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_mcumgr_srv.overlay" west flash --erase #. Open the :file:`prj.conf` file. @@ -94,7 +94,7 @@ The following steps use generic MCUmgr client mode and Coiote without bootstrap. .. code-block:: console cd lwm2m_client/ - west build --pristine -b nrf9160dk_nrf9160_ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" + west build --pristine -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" west flash --erase #. Wait for the device registration to complete. diff --git a/samples/cellular/lwm2m_client/overlay-avsystem-bootstrap.conf b/samples/cellular/lwm2m_client/overlay-avsystem-bootstrap.conf index 0fef3e148b6a..0e572faa7836 100644 --- a/samples/cellular/lwm2m_client/overlay-avsystem-bootstrap.conf +++ b/samples/cellular/lwm2m_client/overlay-avsystem-bootstrap.conf @@ -5,3 +5,7 @@ CONFIG_LWM2M_SECURITY_INSTANCE_COUNT=3 # Enable TLV, AVSystem uses this as a default. # Can be disabled once device dialect is changed from server side. CONFIG_LWM2M_RW_OMA_TLV_SUPPORT=y + +# AVSystem FOTA defaults to CoAPS so use the same security tag than where our +# DTLS credentials are stored. +CONFIG_LWM2M_CLIENT_UTILS_DOWNLOADER_SEC_TAG=35724861 diff --git a/samples/cellular/lwm2m_client/overlay-avsystem.conf b/samples/cellular/lwm2m_client/overlay-avsystem.conf index b0ccf8c5f21e..6463a75c4624 100644 --- a/samples/cellular/lwm2m_client/overlay-avsystem.conf +++ b/samples/cellular/lwm2m_client/overlay-avsystem.conf @@ -3,3 +3,7 @@ CONFIG_LWM2M_CLIENT_UTILS_SERVER="coaps://eu.iot.avsystem.cloud:5684" # Enable TLV, AVSystem uses this as a default. # Can be disabled once device dialect is changed from server side. CONFIG_LWM2M_RW_OMA_TLV_SUPPORT=y + +# AVSystem FOTA defaults to CoAPS so use the same security tag than where our +# DTLS credentials are stored. +CONFIG_LWM2M_CLIENT_UTILS_DOWNLOADER_SEC_TAG=35724861 diff --git a/samples/cellular/lwm2m_client/sample.yaml b/samples/cellular/lwm2m_client/sample.yaml index 5a6fc2318a4d..efbc9569aa5f 100644 --- a/samples/cellular/lwm2m_client/sample.yaml +++ b/samples/cellular/lwm2m_client/sample.yaml @@ -4,14 +4,14 @@ tests: sample.cellular.lwm2m_client: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns tags: ci_build diff --git a/samples/cellular/lwm2m_client/sample_description.rst b/samples/cellular/lwm2m_client/sample_description.rst index 228f3a1cbd8b..640f99910be4 100644 --- a/samples/cellular/lwm2m_client/sample_description.rst +++ b/samples/cellular/lwm2m_client/sample_description.rst @@ -164,7 +164,7 @@ You need to provide the following information to the LwM2M Server before you can * Client endpoint * Identity -* `Pre-Shared Key (PSK)`_ +* `Pre-shared key (PSK) `_ See :ref:`server setup ` for instructions on providing the information to the server. @@ -312,7 +312,7 @@ Server options .. _CONFIG_APP_LWM2M_PSK: -CONFIG_APP_LWM2M_PSK - Configuration for Pre-Shared Key +CONFIG_APP_LWM2M_PSK - Configuration for the PSK The sample configuration sets the hexadecimal representation of the PSK used when registering the device with the server. To prevent provisioning of the key to the modem, set this option to an empty string. @@ -658,7 +658,7 @@ Use one of the following build commands to evaluate external FOTA: .. code-block:: console - west build --pristine -b nrf9160dk_nrf9160_ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem-bootstrap.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf; overlay-mcumgr_reset.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay;nrf9160dk_recovery.overlay" + west build --pristine -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem-bootstrap.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf; overlay-mcumgr_reset.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay;nrf9160dk_recovery.overlay" .. group-tab:: MCUboot recovery mode without bootstrap @@ -666,7 +666,7 @@ Use one of the following build commands to evaluate external FOTA: .. code-block:: console - west build --pristine -b nrf9160dk_nrf9160_ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf; overlay-mcumgr_reset.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay;nrf9160dk_recovery.overlay" + west build --pristine -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf; overlay-mcumgr_reset.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay;nrf9160dk_recovery.overlay" .. group-tab:: MCUmgr client with bootstrap @@ -674,7 +674,7 @@ Use one of the following build commands to evaluate external FOTA: .. code-block:: console - west build --pristine -b nrf9160dk_nrf9160_ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem-bootstrap.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" + west build --pristine -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem-bootstrap.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" .. group-tab:: MCUmgr client without bootstrap @@ -682,7 +682,7 @@ Use one of the following build commands to evaluate external FOTA: .. code-block:: console - west build --pristine -b nrf9160dk_nrf9160_ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" + west build --pristine -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE="overlay-adv-firmware.conf;overlay-fota_helper.conf;overlay-avsystem.conf;overlay-lwm2m-1.1.conf;overlay-mcumgr_client.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_mcumgr_client_uart2.overlay" See :ref:`lwm2m_client_fota_external_mcu` for details. diff --git a/samples/cellular/lwm2m_client/scripts/device.py b/samples/cellular/lwm2m_client/scripts/device.py index b8b09ca80832..5bddcd3809bc 100755 --- a/samples/cellular/lwm2m_client/scripts/device.py +++ b/samples/cellular/lwm2m_client/scripts/device.py @@ -42,9 +42,9 @@ def wait_for_uart_string(self, string, timeout=10): def build_at_client(self): logging.info("Building AT client") if str(self.sid).startswith(SEGGER_HEADER_9161): - cmd = f"west build --board nrf9161dk_nrf9161_ns --build-dir build --pristine always {self.sample_path}" + cmd = f"west build --board nrf9161dk/nrf9161/ns --build-dir build --pristine always {self.sample_path}" else: - cmd = f"west build --board nrf9160dk_nrf9160_ns --build-dir build --pristine always {self.sample_path}" + cmd = f"west build --board nrf9160dk/nrf9160/ns --build-dir build --pristine always {self.sample_path}" logging.info(f"{cmd}") subprocess.run(cmd.split(), cwd=self.sample_path, check=True, capture_output=True) logging.info("Done!") diff --git a/samples/cellular/lwm2m_client/src/events/gnss_pvt_event.c b/samples/cellular/lwm2m_client/src/events/gnss_pvt_event.c index 175ea3e8f017..ae895ea2f407 100644 --- a/samples/cellular/lwm2m_client/src/events/gnss_pvt_event.c +++ b/samples/cellular/lwm2m_client/src/events/gnss_pvt_event.c @@ -12,7 +12,7 @@ static void log_gnss_event(const struct app_event_header *aeh) APP_EVENT_MANAGER_LOG(aeh, "gnss_pvt_event lat: %lf long: %lf alt: %lf", event->pvt.latitude, event->pvt.longitude, - event->pvt.altitude); + (double)event->pvt.altitude); } APP_EVENT_TYPE_DEFINE(gnss_pvt_event, diff --git a/samples/cellular/lwm2m_client/src/lwm2m/include/lwm2m_client_app.h b/samples/cellular/lwm2m_client/src/lwm2m/include/lwm2m_client_app.h index 02ab1333c816..f93b5adaece2 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/include/lwm2m_client_app.h +++ b/samples/cellular/lwm2m_client/src/lwm2m/include/lwm2m_client_app.h @@ -7,59 +7,12 @@ #ifndef LWM2M_CLIENT_APP_H__ #define LWM2M_CLIENT_APP_H__ -#include -#include - #ifdef __cplusplus extern "C" { #endif int lwm2m_app_init_device(char *serial_num); -#if defined(CONFIG_LWM2M_APP_LIGHT_CONTROL) -int lwm2m_init_light_control(void); -#endif - -#if defined(CONFIG_LWM2M_APP_TEMP_SENSOR) -int lwm2m_init_temp_sensor(void); -#endif - -#if defined(CONFIG_LWM2M_APP_PRESS_SENSOR) -int lwm2m_init_press_sensor(void); -#endif - -#if defined(CONFIG_LWM2M_APP_HUMID_SENSOR) -int lwm2m_init_humid_sensor(void); -#endif - -#if defined(CONFIG_LWM2M_APP_GAS_RES_SENSOR) -int lwm2m_init_gas_res_sensor(void); -#endif - -#if defined(CONFIG_LWM2M_APP_LIGHT_SENSOR) -int lwm2m_init_light_sensor(void); -#endif - -#if defined(CONFIG_LWM2M_APP_BUZZER) -int lwm2m_init_buzzer(void); -#endif - -#if defined(CONFIG_LWM2M_APP_PUSH_BUTTON) -int lwm2m_init_push_button(void); -#endif - -#if defined(CONFIG_LWM2M_APP_ONOFF_SWITCH) -int lwm2m_init_onoff_switch(void); -#endif - -#if defined(CONFIG_LWM2M_APP_ACCELEROMETER) -int lwm2m_init_accel(void); -#endif - -#if defined(CONFIG_LWM2M_PORTFOLIO_OBJ_SUPPORT) -int lwm2m_init_portfolio_object(void); -#endif - #ifdef __cplusplus } #endif diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_accelerometer.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_accelerometer.c index 9dac10e8ca96..c9dd4bac524a 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_accelerometer.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_accelerometer.c @@ -10,6 +10,7 @@ #include #include "accelerometer.h" #include "lwm2m_app_utils.h" +#include "lwm2m_engine.h" #if DT_NODE_HAS_STATUS(DT_NODELABEL(sensor_sim), okay) #define ACCEL_APP_TYPE "Simulated Accelerometer" @@ -39,7 +40,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_accel(void) +static int lwm2m_init_accel(void) { double min_range_val = MIN_RANGE_VALUE; double max_range_val = MAX_RANGE_VALUE; @@ -77,3 +78,5 @@ int lwm2m_init_accel(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_accel); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_buzzer.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_buzzer.c index 66909e8e1a36..72b2ee72b437 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_buzzer.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_buzzer.c @@ -7,7 +7,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "ui_buzzer.h" #include "lwm2m_app_utils.h" @@ -59,7 +59,7 @@ static int buzzer_intensity_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_buzzer(void) +static int lwm2m_init_buzzer(void) { int ret; double start_intensity = INTENSITY_START_VAL; @@ -97,3 +97,5 @@ int lwm2m_init_buzzer(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_buzzer); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_gas_res_sensor.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_gas_res_sensor.c index 7386bbcd78a4..61b10ec69c37 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_gas_res_sensor.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_gas_res_sensor.c @@ -7,7 +7,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "env_sensor.h" #include "lwm2m_app_utils.h" @@ -32,7 +32,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_gas_res_sensor(void) +static int lwm2m_init_gas_res_sensor(void) { double min_range_val = MIN_RANGE_VALUE; double max_range_val = MAX_RANGE_VALUE; @@ -66,3 +66,5 @@ int lwm2m_init_gas_res_sensor(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_gas_res_sensor); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_humid_sensor.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_humid_sensor.c index ee4aa8fa327a..5c2e346fcf11 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_humid_sensor.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_humid_sensor.c @@ -7,7 +7,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "env_sensor.h" #include "lwm2m_app_utils.h" @@ -31,7 +31,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_humid_sensor(void) +static int lwm2m_init_humid_sensor(void) { double min_range_val = MIN_RANGE_VALUE; double max_range_val = MAX_RANGE_VALUE; @@ -63,3 +63,5 @@ int lwm2m_init_humid_sensor(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_humid_sensor); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_control.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_control.c index c83cdcce8763..e1163b855993 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_control.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_control.c @@ -8,7 +8,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "lwm2m_app_utils.h" #include "ui_led.h" @@ -201,7 +201,7 @@ static int lc_dimmer_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t res_inst return 0; } -int lwm2m_init_light_control(void) +static int lwm2m_init_light_control(void) { int ret = 0; uint8_t intensity; @@ -263,3 +263,5 @@ int lwm2m_init_light_control(void) return ret; } + +LWM2M_APP_INIT(lwm2m_init_light_control); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_sensor.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_sensor.c index f88f48416c29..c48be3b57a80 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_sensor.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_light_sensor.c @@ -9,6 +9,7 @@ #include #include "light_sensor.h" #include "lwm2m_app_utils.h" +#include "lwm2m_engine.h" #define LIGHT_OBJ_INSTANCE_ID 0 #define COLOUR_OBJ_INSTANCE_ID 1 @@ -34,7 +35,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_light_sensor(void) +static int lwm2m_init_light_sensor(void) { light_sensor_init(); @@ -81,3 +82,5 @@ int lwm2m_init_light_sensor(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_light_sensor); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_onoff_switch.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_onoff_switch.c index 42da7068ad85..192f0dcc9e59 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_onoff_switch.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_onoff_switch.c @@ -11,6 +11,7 @@ #include "ui_input.h" #include "ui_input_event.h" #include "lwm2m_app_utils.h" +#include "lwm2m_engine.h" #include LOG_MODULE_DECLARE(app_lwm2m, CONFIG_APP_LOG_LEVEL); @@ -23,7 +24,7 @@ LOG_MODULE_DECLARE(app_lwm2m, CONFIG_APP_LOG_LEVEL); static time_t lwm2m_timestamp[2]; -int lwm2m_init_onoff_switch(void) +static int lwm2m_init_onoff_switch(void) { ui_input_init(); @@ -61,6 +62,7 @@ int lwm2m_init_onoff_switch(void) return 0; } +LWM2M_APP_INIT(lwm2m_init_onoff_switch); static bool app_event_handler(const struct app_event_header *aeh) { diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_portfolio_object.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_portfolio_object.c index 37a1a29c88fd..38e3bd780cb6 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_portfolio_object.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_portfolio_object.c @@ -8,13 +8,14 @@ #include #include #include "lwm2m_app_utils.h" +#include "lwm2m_engine.h" static char host_device_id[40] = "Host Device ID #1"; static char manufacturer_id[40] = "Host Develce Manufacturer #1"; static char device_model[40] = "Host Device Model #1"; static char software_version_id[40] = "Host Device Software Version #1"; -int lwm2m_init_portfolio_object(void) +static int lwm2m_init_portfolio_object(void) { /* create switch1 object */ lwm2m_create_object_inst(&LWM2M_OBJ(16, 0)); @@ -29,3 +30,5 @@ int lwm2m_init_portfolio_object(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_portfolio_object); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_press_sensor.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_press_sensor.c index 01df8983b6b0..002fd9c830db 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_press_sensor.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_press_sensor.c @@ -7,7 +7,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "env_sensor.h" #include "lwm2m_app_utils.h" @@ -31,7 +31,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_press_sensor(void) +static int lwm2m_init_press_sensor(void) { double min_range_val = MIN_RANGE_VALUE; double max_range_val = MAX_RANGE_VALUE; @@ -60,3 +60,5 @@ int lwm2m_init_press_sensor(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_press_sensor); diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_push_button.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_push_button.c index 82e90ebcec9e..96dd3105a511 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_push_button.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_push_button.c @@ -11,6 +11,7 @@ #include "ui_input.h" #include "ui_input_event.h" #include "lwm2m_app_utils.h" +#include "lwm2m_engine.h" #include LOG_MODULE_DECLARE(app_lwm2m, CONFIG_APP_LOG_LEVEL); @@ -24,7 +25,7 @@ LOG_MODULE_DECLARE(app_lwm2m, CONFIG_APP_LOG_LEVEL); static time_t lwm2m_timestamp[2]; -int lwm2m_init_push_button(void) +static int lwm2m_init_push_button(void) { ui_input_init(); @@ -67,6 +68,7 @@ int lwm2m_init_push_button(void) return 0; } +LWM2M_APP_INIT(lwm2m_init_push_button); static bool app_event_handler(const struct app_event_header *aeh) { diff --git a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_temp_sensor.c b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_temp_sensor.c index 52d5802ef4b2..b1a81be58c41 100644 --- a/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_temp_sensor.c +++ b/samples/cellular/lwm2m_client/src/lwm2m/lwm2m_temp_sensor.c @@ -7,7 +7,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include "env_sensor.h" #include "lwm2m_app_utils.h" @@ -31,7 +31,7 @@ static int update_timestamp_cb(uint16_t obj_inst_id, uint16_t res_id, uint16_t r return 0; } -int lwm2m_init_temp_sensor(void) +static int lwm2m_init_temp_sensor(void) { double min_range_val = MIN_RANGE_VALUE; double max_range_val = MAX_RANGE_VALUE; @@ -63,3 +63,5 @@ int lwm2m_init_temp_sensor(void) return 0; } + +LWM2M_APP_INIT(lwm2m_init_temp_sensor); diff --git a/samples/cellular/lwm2m_client/src/main.c b/samples/cellular/lwm2m_client/src/main.c index 5bcd438299c6..8f134049206e 100644 --- a/samples/cellular/lwm2m_client/src/main.c +++ b/samples/cellular/lwm2m_client/src/main.c @@ -24,7 +24,6 @@ LOG_MODULE_REGISTER(app_lwm2m_client, CONFIG_APP_LOG_LEVEL); #include "lwm2m_client_app.h" #include "lwm2m_app_utils.h" -#include "sensor_module.h" #include "gnss_module.h" #include "location_events.h" @@ -261,11 +260,8 @@ static int lwm2m_firmware_event_cb(struct lwm2m_fota_event *event) static int lwm2m_setup(void) { -#if defined(CONFIG_LWM2M_CLIENT_UTILS_DEVICE_OBJ_SUPPORT) - /* Manufacturer independent */ - lwm2m_init_device(); + /* Save power by not updating timestamp on device object */ lwm2m_update_device_service_period(0); -#endif /* Manufacturer dependent */ /* use IMEI as serial number */ @@ -283,45 +279,9 @@ static int lwm2m_setup(void) #if defined(CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT) lwm2m_init_firmware_cb(lwm2m_firmware_event_cb); #endif -#if defined(CONFIG_LWM2M_APP_LIGHT_CONTROL) - lwm2m_init_light_control(); -#endif -#if defined(CONFIG_LWM2M_APP_TEMP_SENSOR) - lwm2m_init_temp_sensor(); -#endif -#if defined(CONFIG_LWM2M_APP_PRESS_SENSOR) - lwm2m_init_press_sensor(); -#endif -#if defined(CONFIG_LWM2M_APP_HUMID_SENSOR) - lwm2m_init_humid_sensor(); -#endif -#if defined(CONFIG_LWM2M_APP_GAS_RES_SENSOR) - lwm2m_init_gas_res_sensor(); -#endif -#if defined(CONFIG_LWM2M_APP_BUZZER) - lwm2m_init_buzzer(); -#endif -#if defined(CONFIG_LWM2M_APP_PUSH_BUTTON) - lwm2m_init_push_button(); -#endif -#if defined(CONFIG_LWM2M_APP_ONOFF_SWITCH) - lwm2m_init_onoff_switch(); -#endif -#if defined(CONFIG_LWM2M_APP_ACCELEROMETER) - lwm2m_init_accel(); -#endif -#if defined(CONFIG_LWM2M_APP_LIGHT_SENSOR) - lwm2m_init_light_sensor(); -#endif -#if defined(CONFIG_LWM2M_PORTFOLIO_OBJ_SUPPORT) - lwm2m_init_portfolio_object(); -#endif #if defined(CONFIG_LWM2M_CLIENT_UTILS_LOCATION_ASSISTANCE) location_event_handler_init(&client); location_assistance_retry_init(true); -#endif -#if defined(CONFIG_LWM2M_CLIENT_UTILS_CELL_CONN_OBJ_SUPPORT) - lwm2m_init_cellular_connectivity_object(); #endif if (IS_ENABLED(CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS) || IS_ENABLED(CONFIG_LWM2M_CLIENT_UTILS_NEIGHBOUR_CELL_LISTENER)) { @@ -652,13 +612,13 @@ int main(void) return 0; } -#if defined(CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT) - ret = lwm2m_init_image(); - if (ret < 0) { - LOG_ERR("Failed to setup image properties (%d)", ret); - return 0; + if (IS_ENABLED(CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT)) { + ret = lwm2m_init_image(); + if (ret < 0) { + LOG_ERR("Failed to setup image properties (%d)", ret); + return 0; + } } -#endif modem_connect(); @@ -666,13 +626,6 @@ int main(void) initialise_gnss(); #endif -#ifdef CONFIG_SENSOR_MODULE - ret = sensor_module_init(); - if (ret) { - LOG_ERR("Could not initialize sensor module (%d)", ret); - } -#endif - #if defined(CONFIG_LWM2M_CLIENT_UTILS_SIGNAL_MEAS_INFO_OBJ_SUPPORT) k_work_init_delayable(&ncell_meas_work, ncell_meas_work_handler); k_work_schedule(&ncell_meas_work, K_SECONDS(1)); diff --git a/samples/cellular/lwm2m_client/src/modules/include/sensor_module.h b/samples/cellular/lwm2m_client/src/modules/include/sensor_module.h deleted file mode 100644 index af8c5af7ba92..000000000000 --- a/samples/cellular/lwm2m_client/src/modules/include/sensor_module.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef SENSOR_MODULE_H__ -#define SENSOR_MODULE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -int sensor_module_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* SENSOR_MODULE_H__ */ diff --git a/samples/cellular/lwm2m_client/src/modules/sensor_module.c b/samples/cellular/lwm2m_client/src/modules/sensor_module.c index 643e3bf2da4c..85c804e6d589 100644 --- a/samples/cellular/lwm2m_client/src/modules/sensor_module.c +++ b/samples/cellular/lwm2m_client/src/modules/sensor_module.c @@ -12,7 +12,7 @@ #include #include #include "lwm2m_app_utils.h" - +#include "lwm2m_engine.h" #include "accelerometer.h" #include "env_sensor.h" #include "light_sensor.h" @@ -184,7 +184,7 @@ static void pmic_work_cb(struct k_work *work) k_work_schedule(&pmic_work, PERIOD); } -int sensor_module_init(void) +static int sensor_module_init(void) { if (IS_ENABLED(CONFIG_SENSOR_MODULE_ACCEL)) { k_work_init_delayable(&accel_work, accel_work_cb); @@ -228,3 +228,5 @@ int sensor_module_init(void) return 0; } + +LWM2M_APP_INIT(sensor_module_init); diff --git a/samples/cellular/modem_callbacks/sample.yaml b/samples/cellular/modem_callbacks/sample.yaml index 4ac359d2a891..b60bc89f900e 100644 --- a/samples/cellular/modem_callbacks/sample.yaml +++ b/samples/cellular/modem_callbacks/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.modem_callbacks: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/modem_shell/README.rst b/samples/cellular/modem_shell/README.rst index 7b1ad7149faa..072234936f3b 100644 --- a/samples/cellular/modem_shell/README.rst +++ b/samples/cellular/modem_shell/README.rst @@ -957,17 +957,9 @@ Testing After programming the application and all prerequisites to your development kit, test it by performing the following steps: -1. Connect the development kit to the computer using a USB cable. - The development kit is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager. - -#. Create a serial connection to the development kit (J-Link COM port) with a terminal |ANSI| using the following settings: - - * Hardware flow control: disabled - * Baud rate: 115200 - * Parity bit: no - +1. |connect_kit| +#. |connect_terminal_ANSI| #. Reset the development kit. - #. Observe in the terminal window that the application starts. This is indicated by output similar to the following (there is also a lot of additional information about the LTE connection): @@ -1063,40 +1055,28 @@ To program the certificates and connect to nRF Cloud, complete the following ste nRF91 Series DK with nRF7002 EK Wi-Fi support ============================================= -To build the MoSh sample for an nRF91 Series DK with nRF7002 EK Wi-Fi support, use the ``-DSHIELD=nrf7002ek`` and ``-DOVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf`` options. +To build the MoSh sample for an nRF91 Series DK with nRF7002 EK Wi-Fi support, use the ``-DSHIELD=nrf7002ek`` and ``-DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf`` options. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DSHIELD=nrf7002ek -DOVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + west build -p -b *build_target* -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay-nrf7002ek-wifi-scan-only.conf |build_target| See :ref:`cmake_options` for more instructions on how to add these options. -ESP8266 Wi-Fi support -===================== - -To build the MoSh sample with ESP8266 Wi-Fi chip support, use the ``-DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay`` and ``-DOVERLAY_CONFIG=overlay-esp-wifi.conf`` options. -For example: - -.. code-block:: console - - west build -p -b nrf9160dk_nrf9160_ns -d build -- -DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay -DOVERLAY_CONFIG=overlay-esp-wifi.conf - -See :ref:`cmake_options` for more instructions on how to add these options. - PPP support =========== -To build the MoSh sample with PPP/dial up support, use the ``-DDTC_OVERLAY_FILE=ppp.overlay`` and ``-DOVERLAY_CONFIG=overlay-ppp.conf`` options. +To build the MoSh sample with PPP/dial up support, use the ``-DDTC_OVERLAY_FILE=ppp.overlay`` and ``-DEXTRA_CONF_FILE=overlay-ppp.conf`` options. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DDTC_OVERLAY_FILE=ppp.overlay -DOVERLAY_CONFIG=overlay-ppp.conf + west build -p -b *build_target* -- -DDTC_OVERLAY_FILE=ppp.overlay -DEXTRA_CONF_FILE=overlay-ppp.conf |build_target| @@ -1157,49 +1137,49 @@ After programming the development kit, test it in the Linux environment by perfo Application FOTA support ======================== -To build the MoSh sample with application FOTA support, use the ``-DOVERLAY_CONFIG=overlay-app_fota.conf`` option. +To build the MoSh sample with application FOTA support, use the ``-DEXTRA_CONF_FILE=overlay-app_fota.conf`` option. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-app_fota.conf + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-app_fota.conf |build_target| nRF91 Series DK with full modem FOTA support ============================================ -To build the MoSh sample for an nRF91 Series DK with full modem FOTA support, use the devicetree overlay for external flash corresponding to your device and the ``-DOVERLAY_CONFIG=overlay-modem_fota_full.conf`` option. +To build the MoSh sample for an nRF91 Series DK with full modem FOTA support, use the devicetree overlay for external flash corresponding to your device and the ``-DEXTRA_CONF_FILE=overlay-modem_fota_full.conf`` option. The following is an example for the nRF9161 DK: .. code-block:: console - west build -p -b nrf9161dk_nrf9161_ns -d build -- -DOVERLAY_CONFIG=overlay-modem_fota_full.conf -DDTC_OVERLAY_FILE=nrf9161dk_ext_flash.overlay + west build -p -b nrf9161dk/nrf9161/ns -d build -- -DEXTRA_CONF_FILE=overlay-modem_fota_full.conf -DDTC_OVERLAY_FILE=nrf9161dk_ext_flash.overlay LwM2M carrier library support ============================= -To build the MoSh sample with LwM2M carrier library support, use the ``-DOVERLAY_CONFIG=overlay-carrier.conf`` option. +To build the MoSh sample with LwM2M carrier library support, use the ``-DEXTRA_CONF_FILE=overlay-carrier.conf`` option. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-carrier.conf + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-carrier.conf |build_target| P-GPS support ============= -To build the MoSh sample with P-GPS support, use the ``-DOVERLAY_CONFIG=overlay-pgps.conf`` option. +To build the MoSh sample with P-GPS support, use the ``-DEXTRA_CONF_FILE=overlay-pgps.conf`` option. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-pgps.conf + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-pgps.conf |build_target| @@ -1208,26 +1188,26 @@ For example: Cloud over MQTT =============== -To build the MoSh sample with cloud connectivity over MQTT, use the ``-DOVERLAY_CONFIG=overlay-cloud_mqtt.conf`` option. +To build the MoSh sample with cloud connectivity over MQTT, use the ``-DEXTRA_CONF_FILE=overlay-cloud_mqtt.conf`` option. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-cloud_mqtt.conf + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-cloud_mqtt.conf |build_target| Cloud over CoAP =============== -To build the MoSh sample with cloud connectivity over CoAP, use the ``-DOVERLAY_CONFIG=overlay-cloud_coap.conf`` option. +To build the MoSh sample with cloud connectivity over CoAP, use the ``-DEXTRA_CONF_FILE=overlay-cloud_coap.conf`` option. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-cloud_coap.conf + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-cloud_coap.conf |build_target| @@ -1236,23 +1216,23 @@ Location service handled in application This sample is using cloud service for positioning through the :ref:`lib_location` library by default. To build the sample with location cloud services handled in the MoSh, -use the ``-DOVERLAY_CONFIG="overlay-cloud_mqtt.conf"`` and ``-DCONFIG_LOCATION_SERVICE_EXTERNAL=y`` options. +use the ``-DEXTRA_CONF_FILE="overlay-cloud_mqtt.conf"`` and ``-DCONFIG_LOCATION_SERVICE_EXTERNAL=y`` options. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG=overlay-cloud_mqtt.conf -DCONFIG_LOCATION_SERVICE_EXTERNAL=y + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE=overlay-cloud_mqtt.conf -DCONFIG_LOCATION_SERVICE_EXTERNAL=y |build_target| -To add P-GPS on top of that, use the ``-DOVERLAY_CONFIG="overlay-cloud_mqtt.conf;overlay-pgps.conf"``, ``-DCONFIG_LOCATION_SERVICE_EXTERNAL=y`` and ``-DCONFIG_NRF_CLOUD_PGPS_TRANSPORT_NONE=y`` options. +To add P-GPS on top of that, use the ``-DEXTRA_CONF_FILE="overlay-cloud_mqtt.conf;overlay-pgps.conf"``, ``-DCONFIG_LOCATION_SERVICE_EXTERNAL=y`` and ``-DCONFIG_NRF_CLOUD_PGPS_TRANSPORT_NONE=y`` options. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -d build -- -DOVERLAY_CONFIG="overlay-cloud_mqtt.conf;overlay-pgps.conf" -DCONFIG_LOCATION_SERVICE_EXTERNAL=y -DCONFIG_NRF_CLOUD_PGPS_TRANSPORT_NONE=y + west build -p -b *build_target* -d build -- -DEXTRA_CONF_FILE="overlay-cloud_mqtt.conf;overlay-pgps.conf" -DCONFIG_LOCATION_SERVICE_EXTERNAL=y -DCONFIG_NRF_CLOUD_PGPS_TRANSPORT_NONE=y |build_target| @@ -1264,28 +1244,28 @@ To enable the remote control feature, you need to build the sample with cloud co nRF91 Series DK with Zephyr native TCP/IP stack =============================================== -To build the MoSh sample for an nRF91 Series DK with the nRF91 device driver that does not offload the TCP/IP stack to modem, use the ``-DOVERLAY_CONFIG=overlay-non-offloading.conf`` option. +To build the MoSh sample for an nRF91 Series DK with the nRF91 device driver that does not offload the TCP/IP stack to modem, use the ``-DEXTRA_CONF_FILE=overlay-non-offloading.conf`` option. With this configuration, the configured MoSh commands, for example ``iperf3``, use the Zephyr native TCP/IP stack over the default LTE PDN context. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DOVERLAY_CONFIG=overlay-non-offloading.conf + west build -p -b *build_target* -- -DEXTRA_CONF_FILE=overlay-non-offloading.conf |build_target| BT shell support ================ -To build the MoSh sample with Zephyr BT shell command support, use the :file:`-DDTC_OVERLAY_FILE=bt.overlay` and :file:`-DOVERLAY_CONFIG=overlay-bt.conf` options. +To build the MoSh sample with Zephyr BT shell command support, use the :file:`-DDTC_OVERLAY_FILE=bt.overlay` and :file:`-DEXTRA_CONF_FILE=overlay-bt.conf` options. When running this configuration, you can perform BT scanning and advertising using the ``bt`` command. Compile as follows: .. code-block:: console - west build -p -b nrf9160dk_nrf9160_ns -- -DDTC_OVERLAY_FILE="bt.overlay" -DOVERLAY_CONFIG="overlay-bt.conf" + west build -p -b nrf9160dk/nrf9160/ns -- -DDTC_OVERLAY_FILE="bt.overlay" -DEXTRA_CONF_FILE="overlay-bt.conf" Additionally, you need to program the nRF52840 side of the nRF9160 DK as instructed in :ref:`lte_sensor_gateway`. @@ -1293,7 +1273,7 @@ Compile the :ref:`bluetooth-hci-lpuart-sample` sample as follows: .. code-block:: console - west build -p -b nrf9160dk_nrf52840 + west build -p -b nrf9160dk/nrf52840 The following example demonstrates how to use MoSh with two development kits, where one acts as a broadcaster and the other one as an observer. @@ -1342,14 +1322,14 @@ DK #2, where MoSh is used in observer (scanning) role: SEGGER RTT support ================== -To build the MoSh sample with SEGGER's Real Time Transfer (RTT) support, use the ``-DOVERLAY_CONFIG=overlay-rtt.conf`` option. +To build the MoSh sample with SEGGER's Real Time Transfer (RTT) support, use the ``-DEXTRA_CONF_FILE=overlay-rtt.conf`` option. When running this configuration, RTT is used as the shell backend instead of UART. For example: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DOVERLAY_CONFIG=overlay-rtt.conf + west build -p -b *build_target* -- -DEXTRA_CONF_FILE=overlay-rtt.conf |build_target| @@ -1367,7 +1347,7 @@ To know more about the AVSystem integration with |NCS|, see :ref:`ug_avsystem`. You can build the MoSh sample with different LwM2M configurations: - * To build the MoSh sample with the default LwM2M configuration, use the ``-DOVERLAY_CONFIG=overlay-lwm2m.conf`` option and set the used Pre-Shared-Key (PSK) using :kconfig:option:`CONFIG_MOSH_LWM2M_PSK` Kconfig option. + * To build the MoSh sample with the default LwM2M configuration, use the ``-DEXTRA_CONF_FILE=overlay-lwm2m.conf`` option and set the used Pre-Shared-Key (PSK) using :kconfig:option:`CONFIG_MOSH_LWM2M_PSK` Kconfig option. * To enable bootstrapping, use the optional overlay file :file:`overlay-lwm2m_bootstrap.conf`. * To enable P-GPS support, use the optional overlay files :file:`overlay-lwm2m_pgps.conf` and :file:`overlay-pgps.conf`. @@ -1376,7 +1356,7 @@ To build the sample with LwM2M support, use the following command: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DOVERLAY_CONFIG=overlay-lwm2m.conf -DCONFIG_MOSH_LWM2M_PSK=\"000102030405060708090a0b0c0d0e0f\" + west build -p -b *build_target* -- -DEXTRA_CONF_FILE=overlay-lwm2m.conf -DCONFIG_MOSH_LWM2M_PSK=\"000102030405060708090a0b0c0d0e0f\" To also enable P-GPS, use the following command: @@ -1384,7 +1364,7 @@ To also enable P-GPS, use the following command: .. parsed-literal:: :class: highlight - west build -p -b *build_target* -- -DOVERLAY_CONFIG="overlay-lwm2m.conf;overlay-lwm2m_pgps.conf;overlay-pgps.conf" -DCONFIG_MOSH_LWM2M_PSK=\"000102030405060708090a0b0c0d0e0f\" + west build -p -b *build_target* -- -DEXTRA_CONF_FILE="overlay-lwm2m.conf;overlay-lwm2m_pgps.conf;overlay-pgps.conf" -DCONFIG_MOSH_LWM2M_PSK=\"000102030405060708090a0b0c0d0e0f\" |build_target| diff --git a/samples/cellular/modem_shell/bt.overlay b/samples/cellular/modem_shell/bt.overlay index 75874c4d2b20..7b48802efbde 100644 --- a/samples/cellular/modem_shell/bt.overlay +++ b/samples/cellular/modem_shell/bt.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include / { chosen { diff --git a/samples/cellular/modem_shell/esp_8266_nrf9160ns.overlay b/samples/cellular/modem_shell/esp_8266_nrf9160ns.overlay deleted file mode 100644 index 33530ed3b20d..000000000000 --- a/samples/cellular/modem_shell/esp_8266_nrf9160ns.overlay +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2021-2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - - /* - * DTS overlay to be used when connecting nRF9160 DK with ESP8266-01 using - * the esp_at driver. - * - * https://en.wikipedia.org/wiki/ESP8266 - * - * Wiring: - * - Slide (SW9) to enable 3V mode. - * - ESP8266 RX → DK P0.10 (TX) - * - ESP8266 TX → DK P0.16 (RX) - * - ESP8266 VCC → DK VDD - * - ESP8266 CH_PD → DK VDD - * - ESP8266 GND → DK GND. - * - * Compilation with SW overlay: - * 'west build -p -b nrf9160dk_nrf9160_ns -- -DDTC_OVERLAY_FILE=esp_8266_nrf9160ns.overlay -DOVERLAY_CONFIG="overlay-esp-wifi.conf"' - */ - -&uart3 { - status = "okay"; - current-speed = <115200>; - - pinctrl-0 = <&uart3_default_alt>; - pinctrl-1 = <&uart3_sleep_alt>; - pinctrl-names = "default", "sleep"; - esp8266: esp8266 { - compatible = "espressif,esp-at"; - status = "okay"; - }; -}; - -&pinctrl { - uart3_default_alt: uart3_default_alt { - group1 { - psels = , - ; - }; - }; - - uart3_sleep_alt: uart3_sleep_alt { - group1 { - psels = , - ; - low-power-enable; - }; - }; - -}; - -/ { - chosen { - ncs,location-wifi = &esp8266; - }; -}; diff --git a/samples/cellular/modem_shell/overlay-esp-wifi.conf b/samples/cellular/modem_shell/overlay-esp-wifi.conf deleted file mode 100644 index 67bda4b0c70f..000000000000 --- a/samples/cellular/modem_shell/overlay-esp-wifi.conf +++ /dev/null @@ -1,37 +0,0 @@ -# Need to disable iper3 worker thread support to have more SRAM -CONFIG_MOSH_WORKER_THREADS=n - -# Extended memory heap size needed for encoding REST messages (including possible long ssid) to JSON -CONFIG_HEAP_MEM_POOL_SIZE=13312 - -# ESP 8266 Wi-Fi -CONFIG_WIFI=y -CONFIG_WIFI_OFFLOAD=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024 - -# Needed for ESP8266 to compile -CONFIG_NET_IPV4=y -CONFIG_NET_IPV6=y -CONFIG_NET_NATIVE=y - -CONFIG_NET_SHELL=y -# Wi-Fi subsystem uses Zephyr's getopt. -CONFIG_GETOPT_LIB=n -CONFIG_NET_L2_WIFI_SHELL=y -# Should be set when CONFIG_NET_L2_WIFI_SHELL is enabled. -# Printing 'wifi scan' command results puts pressure on queues in new locking design in net_mgmt. -# So, use a typical number of networks in a crowded environment as the queue depth. -CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=50 - -CONFIG_WIFI_ESP_AT=y -CONFIG_WIFI_ESP_AT_SCAN_MAC_ADDRESS=y -CONFIG_WIFI_ESP_AT_SCAN_PASSIVE=n -CONFIG_WIFI_ESP_AT_VERSION_1_7=y -CONFIG_WIFI_ESP_AT_SCAN_RESULT_RSSI_ORDERED=y - -CONFIG_LOCATION_METHOD_WIFI=y - -CONFIG_LOCATION_SERVICE_NRF_CLOUD=y - -#CONFIG_LOCATION_SERVICE_HERE=y -#CONFIG_LOCATION_SERVICE_HERE_API_KEY="Your api key" diff --git a/samples/cellular/modem_shell/prj.conf b/samples/cellular/modem_shell/prj.conf index 629e5092581a..1f07ff10d6ae 100644 --- a/samples/cellular/modem_shell/prj.conf +++ b/samples/cellular/modem_shell/prj.conf @@ -6,6 +6,8 @@ # General config CONFIG_MOSH_IPERF3=y +CONFIG_NRF_IPERF3_RESULTS_WAIT_TIME=180 + CONFIG_MOSH_SOCK=y CONFIG_MOSH_PING=y CONFIG_MOSH_CURL=y @@ -89,15 +91,14 @@ CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y # AT monitor library CONFIG_AT_MONITOR=y -# Increase AT monitor heap because of the two use cases: -# - %NCELLMEAS notifications can be closer to a kilobyte -# Note: with legacy NCELLMEAS types, 512 is enough, but with GCI search types -# it could be even longer: theoretical maximum of 4020 bytes. -# - When AT+COPS=? is used for network search, it'll block and at the same time AT notifications -# can be coming in, and some of them may trigger new AT commands which cannot be executed. -# All this will reserve notificatons from AT monitor heap. While there will always be a chance -# this heap is too small, 1kB has caused issues. -CONFIG_AT_MONITOR_HEAP_SIZE=2048 +# Increase AT monitor heap because %NCELLMEAS notifications can be long. +# Note: with legacy NCELLMEAS types, 512 is enough, but with GCI search types +# it could be even longer: theoretical maximum of 4020 bytes. +CONFIG_AT_MONITOR_HEAP_SIZE=1024 + +# Custom AT commands +CONFIG_AT_CMD_CUSTOM=y +CONFIG_AT_CMD_CUSTOM_LOG_LEVEL_OFF=y # PDN library CONFIG_PDN=y diff --git a/samples/cellular/modem_shell/sample.yaml b/samples/cellular/modem_shell/sample.yaml index 2dba14e6b776..67aff10c6944 100644 --- a/samples/cellular/modem_shell/sample.yaml +++ b/samples/cellular/modem_shell/sample.yaml @@ -4,37 +4,37 @@ tests: sample.cellular.modem_shell: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell_debug: build_only: true extra_args: OVERLAY_CONFIG=overlay-debug.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.cloud_mqtt_only: build_only: true extra_args: OVERLAY_CONFIG=overlay-cloud_mqtt.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.cloud_mqtt_rest: build_only: true @@ -42,142 +42,130 @@ tests: - CONFIG_MOSH_CLOUD_MQTT=y - CONFIG_MOSH_CLOUD_REST=y integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.cloud_coap_only: build_only: true extra_args: OVERLAY_CONFIG=overlay-cloud_coap.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.non_offloading_ip: build_only: true extra_args: OVERLAY_CONFIG=overlay-non-offloading.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.nrf7002ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build sample.cellular.modem_shell.nrf7000ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek_nrf7000 OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf CONFIG_WPA_SUPP=n tags: ci_build sample.cellular.modem_shell.nrf7001ek_wifi: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek_nrf7001 OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf tags: ci_build sample.cellular.modem_shell.nrf7002ek_wifi-debug: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG="overlay-nrf7002ek-wifi-scan-only.conf;overlay-debug.conf" tags: ci_build - sample.cellular.modem_shell.esp_wifi: - build_only: true - extra_args: OVERLAY_CONFIG=overlay-esp-wifi.conf DTC_OVERLAY_FILE="esp_8266_nrf9160ns.overlay" - 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 sample.cellular.modem_shell.app_fota: build_only: true extra_args: OVERLAY_CONFIG=overlay-app_fota.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.modem_fota_full.nrf9160: build_only: true extra_args: OVERLAY_CONFIG=overlay-modem_fota_full.conf DTC_OVERLAY_FILE="nrf9160dk_ext_flash.overlay" integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build sample.cellular.modem_shell.modem_fota_full.nrf91x1: build_only: true extra_args: OVERLAY_CONFIG=overlay-modem_fota_full.conf DTC_OVERLAY_FILE="nrf9161dk_ext_flash.overlay" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.carrier: build_only: true extra_args: OVERLAY_CONFIG=overlay-carrier.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.lwm2m: build_only: true @@ -185,13 +173,13 @@ tests: - CONFIG_MOSH_LWM2M_PSK="000102030405060708090a0b0c0d0e0f" extra_args: OVERLAY_CONFIG=overlay-lwm2m.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.lwm2m_bootstrap: build_only: true @@ -199,13 +187,13 @@ tests: - CONFIG_MOSH_LWM2M_PSK="000102030405060708090a0b0c0d0e0f" extra_args: OVERLAY_CONFIG="overlay-lwm2m.conf;overlay-lwm2m_bootstrap.conf" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.lwm2m_pgps: build_only: true @@ -213,25 +201,25 @@ tests: - CONFIG_MOSH_LWM2M_PSK="000102030405060708090a0b0c0d0e0f" extra_args: OVERLAY_CONFIG="overlay-lwm2m.conf;overlay-lwm2m_pgps.conf;overlay-pgps.conf" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.pgps: build_only: true extra_args: OVERLAY_CONFIG=overlay-pgps.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.location_service_ext: build_only: true @@ -239,13 +227,13 @@ tests: - CONFIG_LOCATION_SERVICE_EXTERNAL=y extra_args: OVERLAY_CONFIG=overlay-cloud_mqtt.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.location_service_ext_pgps_nrf7002ek_wifi: build_only: true @@ -255,63 +243,63 @@ tests: extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG="overlay-cloud_mqtt.conf;overlay-pgps.conf;overlay-nrf7002ek-wifi-scan-only.conf" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.ppp: build_only: true extra_args: OVERLAY_CONFIG=overlay-ppp.conf DTC_OVERLAY_FILE="ppp.overlay" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.bt: build_only: true extra_args: OVERLAY_CONFIG=overlay-bt.conf DTC_OVERLAY_FILE="bt.overlay" integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build sample.cellular.modem_shell.rtt: build_only: true extra_args: OVERLAY_CONFIG=overlay-rtt.conf integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.thingy91: build_only: true integration_platforms: - - thingy91_nrf9160_ns + - thingy91/nrf9160/ns platform_allow: - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns tags: ci_build sample.cellular.modem_shell.modem_trace_shell_ext_flash: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SNIPPET="nrf91-modem-trace-ext-flash" extra_configs: - CONFIG_NRF_MODEM_LIB_SHELL_TRACE=y @@ -319,13 +307,13 @@ tests: sample.cellular.modem_shell.modem_trace_ram: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: OVERLAY_CONFIG="overlay-modem-trace-ram.conf" tags: ci_build @@ -333,13 +321,13 @@ tests: sample.cellular.modem_shell.location_gnss_wifi_no_cellular: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_configs: - CONFIG_LOCATION_METHOD_GNSS=y - CONFIG_LOCATION_METHOD_CELLULAR=n @@ -349,13 +337,13 @@ tests: sample.cellular.modem_shell.location_wifi_cellular_no_gnss: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_configs: - CONFIG_LOCATION_METHOD_GNSS=n - CONFIG_LOCATION_METHOD_CELLULAR=y @@ -365,13 +353,13 @@ tests: sample.cellular.modem_shell.location_wifi_no_cellular_no_gnss: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_configs: - CONFIG_LOCATION_METHOD_GNSS=n - CONFIG_LOCATION_METHOD_CELLULAR=n @@ -381,13 +369,13 @@ tests: sample.cellular.modem_shell.location_gnss_no_wifi_no_cellular: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_configs: - CONFIG_LOCATION_METHOD_GNSS=y - CONFIG_LOCATION_METHOD_CELLULAR=n @@ -396,53 +384,121 @@ tests: sample.cellular.modem_shell.location_cellular_no_wifi_no_gnss: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_configs: - CONFIG_LOCATION_METHOD_GNSS=n - CONFIG_LOCATION_METHOD_CELLULAR=y - CONFIG_LOCATION_METHOD_WIFI=n tags: ci_build + # Configurations with location data details and some location method combinations + sample.cellular.modem_shell.location_gnss_wifi_cellular_details: + build_only: true + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_configs: + - CONFIG_LOCATION_DATA_DETAILS=y + - CONFIG_LOCATION_METHOD_GNSS=y + - CONFIG_LOCATION_METHOD_CELLULAR=y + - CONFIG_LOCATION_METHOD_WIFI=y + extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + tags: ci_build + sample.cellular.modem_shell.location_gnss_no_wifi_no_cellular_details: + build_only: true + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_configs: + - CONFIG_LOCATION_DATA_DETAILS=y + - CONFIG_LOCATION_METHOD_GNSS=y + - CONFIG_LOCATION_METHOD_CELLULAR=n + - CONFIG_LOCATION_METHOD_WIFI=n + tags: ci_build + sample.cellular.modem_shell.location_wifi_cellular_no_gnss_details: + build_only: true + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_configs: + - CONFIG_LOCATION_DATA_DETAILS=y + - CONFIG_LOCATION_METHOD_GNSS=n + - CONFIG_LOCATION_METHOD_CELLULAR=y + - CONFIG_LOCATION_METHOD_WIFI=y + extra_args: SHIELD=nrf7002ek OVERLAY_CONFIG=overlay-nrf7002ek-wifi-scan-only.conf + tags: ci_build + sample.cellular.modem_shell.location_gnss_cellular_no_wifi_details: + build_only: true + integration_platforms: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + platform_allow: + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + extra_configs: + - CONFIG_LOCATION_DATA_DETAILS=y + - CONFIG_LOCATION_METHOD_GNSS=y + - CONFIG_LOCATION_METHOD_CELLULAR=y + - CONFIG_LOCATION_METHOD_WIFI=n + tags: ci_build + # Configurations with modem UART traces to make sure they fit into image. # Basic UART trace configuration is tested in sample.cellular.modem_shell.integration_config. sample.cellular.modem_shell_modem_uart_trace: build_only: true extra_args: SNIPPET="nrf91-modem-trace-uart" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.non_offloading_ip_modem_uart_trace: build_only: true extra_args: OVERLAY_CONFIG=overlay-non-offloading.conf SNIPPET="nrf91-modem-trace-uart" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.cellular.modem_shell.thingy91_modem_uart_trace: build_only: true extra_args: SNIPPET="nrf91-modem-trace-uart" integration_platforms: - - thingy91_nrf9160_ns + - thingy91/nrf9160/ns platform_allow: - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns tags: ci_build # Configuration which will be used by the CI integration job to verify PRs @@ -453,10 +509,10 @@ tests: - CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL=y extra_args: SNIPPET="nrf91-modem-trace-uart" integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/modem_shell/src/at/CMakeLists.txt b/samples/cellular/modem_shell/src/at/CMakeLists.txt index 834775a7e7aa..0174129cb766 100644 --- a/samples/cellular/modem_shell/src/at/CMakeLists.txt +++ b/samples/cellular/modem_shell/src/at/CMakeLists.txt @@ -8,5 +8,4 @@ target_include_directories(app PRIVATE .) target_sources(app PRIVATE at_shell.c) target_sources_ifdef(CONFIG_MOSH_AT_CMD_MODE app PRIVATE at_cmd_mode.c) target_sources_ifdef(CONFIG_MOSH_AT_CMD_MODE app PRIVATE at_cmd_mode_sett.c) -target_sources_ifdef(CONFIG_MOSH_AT_CMD_MODE app PRIVATE at_cmd.c) -target_sources_ifdef(CONFIG_MOSH_AT_CMD_MODE app PRIVATE at_cmd_ping.c) +target_sources_ifdef(CONFIG_MOSH_AT_CMD_MODE app PRIVATE at_cmd_mode_custom.c) diff --git a/samples/cellular/modem_shell/src/at/at_cmd.c b/samples/cellular/modem_shell/src/at/at_cmd.c deleted file mode 100644 index 535da456c9b2..000000000000 --- a/samples/cellular/modem_shell/src/at/at_cmd.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include - -#include - -#include - -#include "mosh_defines.h" -#include "mosh_print.h" - -#include "at_cmd_ping.h" -#include "at_cmd.h" - -/* Globals */ -struct at_param_list at_param_list; /* For AT parser */ - -/**@brief AT command handler type. */ -typedef int (*mosh_at_handler_t) (enum at_cmd_type); - -/* MoSh specific AT commands */ -static struct mosh_at_cmd { - char *string; - mosh_at_handler_t handler; -} mosh_at_cmd_list[] = { - {"AT+NPING", at_cmd_ping_handle}, -}; - -#define MOSH_AT_CMD_MAX_PARAM 8 - -/** - * @brief Case insensitive string comparison between given at_cmd and supported mosh_cmd. - */ - -static bool at_cmd_mode_util_mosh_cmd(const char *at_cmd, const char *mosh_cmd) -{ - int i; - int mosh_cmd_len = strlen(mosh_cmd); - - if (strlen(at_cmd) < mosh_cmd_len) { - return false; - } - - for (i = 0; i < mosh_cmd_len; i++) { - if (toupper((int)*(at_cmd + i)) != toupper((int)*(mosh_cmd + i))) { - return false; - } - } -#if defined(CONFIG_MOSH_AT_CMD_MODE_CR_LF_TERMINATION) - if (strlen(at_cmd) > (mosh_cmd_len + 2)) { -#else - if (strlen(at_cmd) > (mosh_cmd_len + 1)) { -#endif - char ch = *(at_cmd + i); - /* With parameter, SET TEST, "="; READ, "?" */ - return ((ch == '=') || (ch == '?')); - } - - return true; -} - -int at_cmd_mosh_execute(const char *at_cmd) -{ - int ret; - int total = ARRAY_SIZE(mosh_at_cmd_list); - - ret = at_params_list_init(&at_param_list, MOSH_AT_CMD_MAX_PARAM); - if (ret) { - printk("Could not init AT params list, error: %d\n", ret); - return ret; - } - ret = -ENOENT; - for (int i = 0; i < total; i++) { - /* Check if given command is MoSh specific AT command */ - if (at_cmd_mode_util_mosh_cmd(at_cmd, mosh_at_cmd_list[i].string)) { - enum at_cmd_type type = at_parser_cmd_type_get(at_cmd); - - at_params_list_clear(&at_param_list); - ret = at_parser_params_from_str(at_cmd, NULL, &at_param_list); - if (ret) { - printk("Failed to parse AT command %d\n", ret); - ret = -EINVAL; - break; - } - ret = mosh_at_cmd_list[i].handler(type); - break; - } - } - at_params_list_free(&at_param_list); - return ret; -} diff --git a/samples/cellular/modem_shell/src/at/at_cmd.h b/samples/cellular/modem_shell/src/at/at_cmd.h deleted file mode 100644 index afb0fd4b04d1..000000000000 --- a/samples/cellular/modem_shell/src/at/at_cmd.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef MOSH_AT_CMD_H -#define MOSH_AT_CMD_H - -int at_cmd_mosh_execute(const char *at_cmd); - -#endif /* MOSH_AT_CMD_H */ diff --git a/samples/cellular/modem_shell/src/at/at_cmd_mode.c b/samples/cellular/modem_shell/src/at/at_cmd_mode.c index 33bc3a58adc0..deb1dcff4ca5 100644 --- a/samples/cellular/modem_shell/src/at/at_cmd_mode.c +++ b/samples/cellular/modem_shell/src/at/at_cmd_mode.c @@ -14,7 +14,6 @@ #include "mosh_defines.h" #include "mosh_print.h" -#include "at_cmd.h" #include "at_cmd_mode.h" extern struct k_work_q mosh_common_work_q; @@ -77,22 +76,11 @@ static void at_cmd_mode_send_at_cmd(const char *at_str, char *rsp_buf, int rsp_b { int err; - /* 1st: handle MoSh specific AT commands */ - err = at_cmd_mosh_execute(at_str); - if (err == 0) { - sprintf(rsp_buf, "OK\n"); - goto done; - } else if (err != -ENOENT) { - sprintf(rsp_buf, "ERROR\n"); - goto done; - } - - /* 2nd: modem at commands */ err = nrf_modem_at_cmd(rsp_buf, rsp_buf_len, "%s", at_str); if (err < 0) { sprintf(rsp_buf, "ERROR: AT command failed: %d\n", err); } /* else if (err > 0): print error from modem */ -done: + /* Response */ printk("%s", rsp_buf); } diff --git a/samples/cellular/modem_shell/src/at/at_cmd_mode_custom.c b/samples/cellular/modem_shell/src/at/at_cmd_mode_custom.c new file mode 100644 index 000000000000..d67023b49911 --- /dev/null +++ b/samples/cellular/modem_shell/src/at/at_cmd_mode_custom.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include "mosh_defines.h" +#include "mosh_print.h" + +#if defined(CONFIG_MOSH_PING) +#include "icmp_ping.h" +#endif + +#define MOSH_AT_CMD_MAX_PARAM 8 + +extern bool at_cmd_mode_dont_print; + +#if defined(CONFIG_MOSH_PING) + +AT_CMD_CUSTOM(nping_custom, "AT+NPING", nping_callback); + +/**@brief handle AT+NPING commands + * AT+NPING=,[,,[,[,]]] + * AT+NPING? READ command not supported + * AT+NPING=? TEST command not supported + */ +static int at_cmd_ping_handle(struct at_param_list *at_params, enum at_cmd_type cmd_type) +{ + int err; + int size = ICMP_MAX_ADDR; + bool dont_print_prev; + struct icmp_ping_shell_cmd_argv ping_args; + + if (cmd_type != AT_CMD_TYPE_SET_COMMAND) { + return -EINVAL; + } + + /* ping is an exception where we want to use mosh_print during AT command mode */ + dont_print_prev = at_cmd_mode_dont_print; + at_cmd_mode_dont_print = false; + + icmp_ping_cmd_defaults_set(&ping_args); + + err = at_params_string_get(at_params, 1, ping_args.target_name, &size); + if (err < 0 || size == 0) { + err = -EINVAL; + return err; + } + ping_args.target_name[size] = '\0'; + + if (at_params_valid_count_get(at_params) > 2) { + err = at_params_unsigned_int_get(at_params, 2, &ping_args.len); + if (err < 0) { + return err; + } + } + if (at_params_valid_count_get(at_params) > 3) { + err = at_params_unsigned_int_get(at_params, 3, &ping_args.timeout); + if (err < 0) { + return err; + } + } + if (at_params_valid_count_get(at_params) > 4) { + err = at_params_unsigned_int_get(at_params, 4, &ping_args.count); + if (err < 0) { + return err; + }; + } + if (at_params_valid_count_get(at_params) > 5) { + err = at_params_unsigned_int_get(at_params, 5, &ping_args.interval); + if (err < 0) { + return err; + }; + } + if (at_params_valid_count_get(at_params) > 6) { + err = at_params_int_get(at_params, 6, &ping_args.cid); + if (err < 0) { + return err; + }; + } + + err = icmp_ping_start(&ping_args); + + at_cmd_mode_dont_print = dont_print_prev; + + return err; +} + +static int nping_callback(char *buf, size_t len, char *at_cmd) +{ + int err; + struct at_param_list at_params; + + err = at_params_list_init(&at_params, MOSH_AT_CMD_MAX_PARAM); + if (err) { + printk("Could not init AT params list, error: %d\n", err); + goto exit; + } + + err = at_parser_params_from_str(at_cmd, NULL, &at_params); + if (err) { + printk("Failed to parse AT command %d\n", err); + err = -EINVAL; + goto exit; + } + + err = at_cmd_ping_handle(&at_params, at_parser_cmd_type_get(at_cmd)); + +exit: + at_params_list_free(&at_params); + + return at_cmd_custom_respond(buf, len, "%s", err ? "ERROR\r\n" : "OK\r\n"); +} + +#endif /* CONFIG_MOSH_PING*/ diff --git a/samples/cellular/modem_shell/src/at/at_cmd_ping.c b/samples/cellular/modem_shell/src/at/at_cmd_ping.c deleted file mode 100644 index b04ff42f280a..000000000000 --- a/samples/cellular/modem_shell/src/at/at_cmd_ping.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include - -#include -#include - -#include -#include -#include - -#include "mosh_defines.h" -#include "mosh_print.h" - -#if defined(CONFIG_MOSH_PING) -#include "icmp_ping.h" -#endif -#include "at_cmd_ping.h" - -extern struct at_param_list at_param_list; -extern bool at_cmd_mode_dont_print; - -#if defined(CONFIG_MOSH_PING) -static struct icmp_ping_shell_cmd_argv ping_args; -#endif - -/**@brief handle AT+NPING commands - * AT+NPING=,[,,[,[,]]] - * AT+NPING? READ command not supported - * AT+NPING=? TEST command not supported - */ -int at_cmd_ping_handle(enum at_cmd_type cmd_type) -{ - int err = -EINVAL; -#if defined(CONFIG_MOSH_PING) - int size = ICMP_MAX_URL; - - switch (cmd_type) { - case AT_CMD_TYPE_SET_COMMAND: - /* ping is an exception where we want to use mosh_print during AT command mode */ - at_cmd_mode_dont_print = false; - - icmp_ping_cmd_defaults_set(&ping_args); - - err = at_params_string_get(&at_param_list, 1, ping_args.target_name, &size); - if (err < 0 || size == 0) { - err = -EINVAL; - return err; - } - ping_args.target_name[size] = '\0'; - - if (at_params_valid_count_get(&at_param_list) > 2) { - err = at_params_unsigned_int_get(&at_param_list, 2, &ping_args.len); - if (err < 0) { - return err; - } - } - if (at_params_valid_count_get(&at_param_list) > 3) { - err = at_params_unsigned_int_get(&at_param_list, 3, &ping_args.timeout); - if (err < 0) { - return err; - } - } - if (at_params_valid_count_get(&at_param_list) > 4) { - err = at_params_unsigned_int_get(&at_param_list, 4, &ping_args.count); - if (err < 0) { - return err; - }; - } - if (at_params_valid_count_get(&at_param_list) > 5) { - err = at_params_unsigned_int_get(&at_param_list, 5, &ping_args.interval); - if (err < 0) { - return err; - }; - } - if (at_params_valid_count_get(&at_param_list) > 6) { - err = at_params_int_get(&at_param_list, 6, &ping_args.cid); - if (err < 0) { - return err; - }; - } - err = icmp_ping_start(&ping_args); - at_cmd_mode_dont_print = true; - break; - - default: - break; - } -#endif - return err; -} diff --git a/samples/cellular/modem_shell/src/at/at_cmd_ping.h b/samples/cellular/modem_shell/src/at/at_cmd_ping.h deleted file mode 100644 index e16e6d21bcb8..000000000000 --- a/samples/cellular/modem_shell/src/at/at_cmd_ping.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2022 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef MOSH_AT_CMD_ICMP -#define MOSH_AT_CMD_ICMP - -int at_cmd_ping_handle(enum at_cmd_type cmd_type); - -#endif /* MOSH_AT_CMD_ICMP */ diff --git a/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c b/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c index f64ceb0c6c5f..18e0ac525ea0 100644 --- a/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c +++ b/samples/cellular/modem_shell/src/cloud/cloud_lwm2m.c @@ -195,8 +195,6 @@ static void cloud_lwm2m_init(void) snprintk(endpoint_name, sizeof(endpoint_name), "%s%s", CONFIG_MOSH_LWM2M_ENDPOINT_PREFIX, imei_buf); - lwm2m_init_device(); - cloud_lwm2m_init_device(imei_buf); lwm2m_init_security(&client, endpoint_name, NULL); diff --git a/samples/cellular/modem_shell/src/cloud/cloud_rest_shell.c b/samples/cellular/modem_shell/src/cloud/cloud_rest_shell.c index 38cdb1072691..e57cce60ae0a 100644 --- a/samples/cellular/modem_shell/src/cloud/cloud_rest_shell.c +++ b/samples/cellular/modem_shell/src/cloud/cloud_rest_shell.c @@ -66,12 +66,6 @@ static int cmd_cloud_rest_shadow_device_status_update(const struct shell *shell, char **argv) { int err; - struct nrf_cloud_svc_info_ui ui_info = { - .gnss = IS_ENABLED(CONFIG_MOSH_LOCATION), /* Show map on nrf cloud */ - }; - struct nrf_cloud_svc_info service_info = { - .ui = &ui_info - }; struct nrf_cloud_modem_info modem_info = { .device = NRF_CLOUD_INFO_SET, .network = NRF_CLOUD_INFO_SET, @@ -80,7 +74,8 @@ static int cmd_cloud_rest_shadow_device_status_update(const struct shell *shell, }; struct nrf_cloud_device_status device_status = { .modem = &modem_info, - .svc = &service_info + /* Deprecated: The service info "ui" section is no longer used by nRF Cloud */ + .svc = NULL }; char device_id[NRF_CLOUD_CLIENT_ID_MAX_LEN + 1]; #define REST_RX_BUF_SZ 300 /* No payload in response, "just" headers */ diff --git a/samples/cellular/modem_shell/src/gnss/gnss.c b/samples/cellular/modem_shell/src/gnss/gnss.c index 9ce091a9a201..467410c0d6db 100644 --- a/samples/cellular/modem_shell/src/gnss/gnss.c +++ b/samples/cellular/modem_shell/src/gnss/gnss.c @@ -336,19 +336,19 @@ static void print_pvt(struct nrf_modem_gnss_pvt_data_frame *pvt) mosh_print("Latitude: %f", pvt->latitude); mosh_print("Longitude: %f", pvt->longitude); - mosh_print("Accuracy: %.1f m", pvt->accuracy); - mosh_print("Altitude: %.1f m", pvt->altitude); - mosh_print("Altitude accuracy: %.1f m", pvt->altitude_accuracy); - mosh_print("Speed: %.1f m/s", pvt->speed); - mosh_print("Speed accuracy: %.1f m/s", pvt->speed_accuracy); - mosh_print("V. speed: %.1f m/s", pvt->vertical_speed); - mosh_print("V. speed accuracy: %.1f m/s", pvt->vertical_speed_accuracy); - mosh_print("Heading: %.1f deg", pvt->heading); - mosh_print("Heading accuracy: %.1f deg", pvt->heading_accuracy); - mosh_print("PDOP: %.1f", pvt->pdop); - mosh_print("HDOP: %.1f", pvt->hdop); - mosh_print("VDOP: %.1f", pvt->vdop); - mosh_print("TDOP: %.1f", pvt->tdop); + mosh_print("Accuracy: %.1f m", (double)pvt->accuracy); + mosh_print("Altitude: %.1f m", (double)pvt->altitude); + mosh_print("Altitude accuracy: %.1f m", (double)pvt->altitude_accuracy); + mosh_print("Speed: %.1f m/s", (double)pvt->speed); + mosh_print("Speed accuracy: %.1f m/s", (double)pvt->speed_accuracy); + mosh_print("V. speed: %.1f m/s", (double)pvt->vertical_speed); + mosh_print("V. speed accuracy: %.1f m/s", (double)pvt->vertical_speed_accuracy); + mosh_print("Heading: %.1f deg", (double)pvt->heading); + mosh_print("Heading accuracy: %.1f deg", (double)pvt->heading_accuracy); + mosh_print("PDOP: %.1f", (double)pvt->pdop); + mosh_print("HDOP: %.1f", (double)pvt->hdop); + mosh_print("VDOP: %.1f", (double)pvt->vdop); + mosh_print("TDOP: %.1f", (double)pvt->tdop); mosh_print( "Google maps URL: https://maps.google.com/?q=%f,%f", diff --git a/samples/cellular/modem_shell/src/link/link.c b/samples/cellular/modem_shell/src/link/link.c index 0a80dfa1822e..81e8f1db4553 100644 --- a/samples/cellular/modem_shell/src/link/link.c +++ b/samples/cellular/modem_shell/src/link/link.c @@ -443,7 +443,7 @@ void link_ind_handler(const struct lte_lc_evt *const evt) len = snprintf( log_buf, sizeof(log_buf), "eDRX parameter update: eDRX: %f, PTW: %f", - evt->edrx_cfg.edrx, evt->edrx_cfg.ptw); + (double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw); if (len > 0) { mosh_print("%s", log_buf); } diff --git a/samples/cellular/modem_shell/src/link/link_shell.c b/samples/cellular/modem_shell/src/link/link_shell.c index cf5a3dbf7f27..d67cc80eee82 100644 --- a/samples/cellular/modem_shell/src/link/link_shell.c +++ b/samples/cellular/modem_shell/src/link/link_shell.c @@ -1256,7 +1256,7 @@ static int link_shell_edrx(const struct shell *shell, size_t argc, char **argv) mosh_print("eDRX LTE mode: %s, eDRX interval: %.2f s, PTW: %.2f s", edrx_cfg.mode == LTE_LC_LTE_MODE_LTEM ? "LTE-M" : "NB-IoT", - edrx_cfg.edrx, edrx_cfg.ptw); + (double)edrx_cfg.edrx, (double)edrx_cfg.ptw); } } } else { diff --git a/samples/cellular/modem_shell/src/link/link_shell_pdn.c b/samples/cellular/modem_shell/src/link/link_shell_pdn.c index 6d76d7c83298..ffb74df91d88 100644 --- a/samples/cellular/modem_shell/src/link/link_shell_pdn.c +++ b/samples/cellular/modem_shell/src/link/link_shell_pdn.c @@ -60,7 +60,12 @@ void link_pdn_event_handler(uint8_t cid, enum pdn_event event, int reason) /* Notify PPP side about the default PDN activation status */ if (event == PDN_EVENT_ACTIVATED) { ppp_ctrl_default_pdn_active(true); - } else if (event == PDN_EVENT_DEACTIVATED) { + } else if (event == PDN_EVENT_DEACTIVATED || + event == PDN_EVENT_NETWORK_DETACH) { + /* 3GPP 27.007 ch 10.1.19 for +CGEV: ME DETACH + * This implies that all active contexts have been deactivated. + * These are not reported separately. + */ ppp_ctrl_default_pdn_active(false); } #endif diff --git a/samples/cellular/modem_shell/src/location/CMakeLists.txt b/samples/cellular/modem_shell/src/location/CMakeLists.txt index ff47701a1dc0..4c64c4837b8e 100644 --- a/samples/cellular/modem_shell/src/location/CMakeLists.txt +++ b/samples/cellular/modem_shell/src/location/CMakeLists.txt @@ -8,6 +8,7 @@ target_include_directories(app PRIVATE .) target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/location_shell.c) target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/location_cmd_utils.c) +target_sources_ifdef(CONFIG_LOCATION_DATA_DETAILS app PRIVATE location_details.c) if(CONFIG_LOCATION_SERVICE_EXTERNAL) target_sources_ifdef(CONFIG_MOSH_CLOUD_MQTT app PRIVATE diff --git a/samples/cellular/modem_shell/src/location/location_cmd_utils.c b/samples/cellular/modem_shell/src/location/location_cmd_utils.c index 7876df50330d..81e619b73442 100644 --- a/samples/cellular/modem_shell/src/location/location_cmd_utils.c +++ b/samples/cellular/modem_shell/src/location/location_cmd_utils.c @@ -64,14 +64,14 @@ static int location_cmd_utils_generate_nmea(const struct location_data *location int location_cmd_utils_gnss_loc_to_cloud_payload_json_encode( enum nrf_cloud_gnss_type format, const struct location_data *location_data, - char **json_str_out) + int64_t timestamp_ms, char **json_str_out) { __ASSERT_NO_MSG(location_data != NULL); __ASSERT_NO_MSG(json_str_out != NULL); struct nrf_cloud_gnss_data gnss_data = { .type = format, - .ts_ms = NRF_CLOUD_NO_TIMESTAMP, + .ts_ms = timestamp_ms, .pvt = { .lon = location_data->longitude, .lat = location_data->latitude, @@ -90,14 +90,6 @@ int location_cmd_utils_gnss_loc_to_cloud_payload_json_encode( goto cleanup; } -#if defined(CONFIG_DATE_TIME) - /* Add the timestamp */ - err = date_time_now(&gnss_data.ts_ms); - if (err) { - mosh_error("Failed to create timestamp"); - goto cleanup; - } -#endif if (format == NRF_CLOUD_GNSS_TYPE_NMEA) { (void)location_cmd_utils_generate_nmea(location_data, nmea_buf, sizeof(nmea_buf)); gnss_data.nmea.sentence = nmea_buf; diff --git a/samples/cellular/modem_shell/src/location/location_cmd_utils.h b/samples/cellular/modem_shell/src/location/location_cmd_utils.h index a96b9356d377..73960b9e44be 100644 --- a/samples/cellular/modem_shell/src/location/location_cmd_utils.h +++ b/samples/cellular/modem_shell/src/location/location_cmd_utils.h @@ -11,6 +11,6 @@ enum location_cmd_cloud_data_gnss_format { CLOUD_GNSS_FORMAT_PVT, CLOUD_GNSS_FOR int location_cmd_utils_gnss_loc_to_cloud_payload_json_encode( enum nrf_cloud_gnss_type format, const struct location_data *location_data, - char **json_str_out); + int64_t timestamp_ms, char **json_str_out); #endif /* MOSH_LOCATION_CMD_UTILS_H */ diff --git a/samples/cellular/modem_shell/src/location/location_details.c b/samples/cellular/modem_shell/src/location/location_details.c new file mode 100644 index 000000000000..f590fb414b02 --- /dev/null +++ b/samples/cellular/modem_shell/src/location/location_details.c @@ -0,0 +1,714 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "mosh_print.h" +#include "link_api.h" +#include "link_shell_print.h" +#include "location_cmd_utils.h" +#include "location_details.h" + +static int json_add_num_cs(cJSON *parent, const char *str, double item) +{ + if (!parent || !str) { + return -EINVAL; + } + + return cJSON_AddNumberToObjectCS(parent, str, item) ? 0 : -ENOMEM; +} + +static const char *location_details_event_str(enum location_event_id event_id) +{ + const char *event_str = NULL; + + switch (event_id) { + case LOCATION_EVT_LOCATION: + event_str = "success"; + break; + case LOCATION_EVT_TIMEOUT: + event_str = "timeout"; + break; + case LOCATION_EVT_ERROR: + event_str = "error"; + break; + case LOCATION_EVT_RESULT_UNKNOWN: + event_str = "unknown"; + break; + case LOCATION_EVT_FALLBACK: + event_str = "fallback"; + break; + default: + event_str = "invalid"; + break; + } + + return event_str; +} + +static int location_details_position_encode(const struct location_data *location, cJSON *root_obj) +{ + cJSON *position_data_obj = NULL; + + position_data_obj = cJSON_CreateObject(); + if (position_data_obj == NULL) { + goto cleanup; + } + + if (json_add_num_cs(position_data_obj, "lng", location->longitude) || + json_add_num_cs(position_data_obj, "lat", location->latitude) || + json_add_num_cs(position_data_obj, "acc", location->accuracy)) { + goto cleanup; + } + + if (!cJSON_AddItemToObject(root_obj, "position", position_data_obj)) { + goto cleanup; + } + + return 0; +cleanup: + /* No need to delete others as they were added to here */ + cJSON_Delete(position_data_obj); + + return -ENOMEM; +} + +#if defined(CONFIG_LOCATION_METHOD_GNSS) + +static int location_details_pvt_data_encode( + const struct nrf_modem_gnss_pvt_data_frame *mdm_pvt, + cJSON *root_obj) +{ + cJSON *pvt_data_obj = NULL; + + pvt_data_obj = cJSON_CreateObject(); + if (pvt_data_obj == NULL) { + goto cleanup; + } + + /* Flags */ + if (json_add_num_cs(pvt_data_obj, "flags", mdm_pvt->flags) || + json_add_num_cs(pvt_data_obj, "execution_time", + (double)mdm_pvt->execution_time / 1000)) { + goto cleanup; + } + + /* GNSS fix data */ + if (mdm_pvt->flags & NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID) { + if (json_add_num_cs(pvt_data_obj, "lng", mdm_pvt->longitude) || + json_add_num_cs(pvt_data_obj, "lat", mdm_pvt->latitude) || + json_add_num_cs(pvt_data_obj, "acc", + round(mdm_pvt->accuracy * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "alt", + round(mdm_pvt->altitude * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "altAcc", + round(mdm_pvt->altitude_accuracy * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "spd", + round(mdm_pvt->speed * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "spdAcc", + round(mdm_pvt->speed_accuracy * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "verSpd", + round(mdm_pvt->vertical_speed * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "verSpdAcc", + round(mdm_pvt->vertical_speed_accuracy * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "hdg", + round(mdm_pvt->heading * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "hdgAcc", + round(mdm_pvt->heading_accuracy * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "pdop", + round(mdm_pvt->pdop * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "hdop", + round(mdm_pvt->hdop * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "vdop", + round(mdm_pvt->vdop * 1000) / 1000) || + json_add_num_cs(pvt_data_obj, "tdop", + round(mdm_pvt->tdop * 1000) / 1000)) { + goto cleanup; + } + } + + cJSON *sat_info_array = NULL; + cJSON *sat_info_obj = NULL; + + /* SV data */ + sat_info_array = cJSON_AddArrayToObjectCS(pvt_data_obj, "sv_info"); + if (!sat_info_array) { + goto cleanup; + } + for (uint32_t i = 0; i < NRF_MODEM_GNSS_MAX_SATELLITES; i++) { + if (mdm_pvt->sv[i].sv == 0) { + break; + } + sat_info_obj = cJSON_CreateObject(); + if (sat_info_obj == NULL) { + goto cleanup; + } + + if (!cJSON_AddItemToArray(sat_info_array, sat_info_obj)) { + cJSON_Delete(sat_info_obj); + goto cleanup; + } + if (json_add_num_cs(sat_info_obj, "sv", mdm_pvt->sv[i].sv) || + json_add_num_cs(sat_info_obj, "c_n0", (mdm_pvt->sv[i].cn0 * 0.1)) || + json_add_num_cs(sat_info_obj, "sig", mdm_pvt->sv[i].signal) || + json_add_num_cs(sat_info_obj, "elev", mdm_pvt->sv[i].elevation) || + json_add_num_cs(sat_info_obj, "az", mdm_pvt->sv[i].azimuth) || + json_add_num_cs( + sat_info_obj, "in_fix", + (mdm_pvt->sv[i].flags & NRF_MODEM_GNSS_SV_FLAG_USED_IN_FIX ? 1 : 0)) || + json_add_num_cs( + sat_info_obj, "unhealthy", + (mdm_pvt->sv[i].flags & NRF_MODEM_GNSS_SV_FLAG_UNHEALTHY ? 1 : 0))) { + goto cleanup; + } + } + + if (!cJSON_AddItemToObject(root_obj, "pvt_data", pvt_data_obj)) { + goto cleanup; + } + + return 0; +cleanup: + /* No need to delete others as they were added to here */ + cJSON_Delete(pvt_data_obj); + + return -ENOMEM; +} +#endif + +static int location_details_location_req_info_encode( + const char *mosh_cmd, + cJSON *root_obj) +{ + cJSON *location_req_info_obj = NULL; + + location_req_info_obj = cJSON_CreateObject(); + if (location_req_info_obj == NULL) { + goto cleanup; + } + + if (!cJSON_AddStringToObjectCS(location_req_info_obj, "mosh_cmd", mosh_cmd)) { + goto cleanup; + } + + if (!cJSON_AddItemToObject(root_obj, "location_req_info", location_req_info_obj)) { + goto cleanup; + } + + return 0; +cleanup: + /* No need to delete others as they were added to here */ + cJSON_Delete(location_req_info_obj); + return -ENOMEM; +} + +static int location_details_modem_details_encode(cJSON *root_obj) +{ + cJSON *modem_details_obj = NULL; + struct lte_xmonitor_resp_t xmonitor_resp; + enum lte_lc_system_mode sysmode; + int err; + char tmp_str[OP_FULL_NAME_STR_MAX_LEN + 1]; + int len; + + err = link_api_xmonitor_read(&xmonitor_resp); + if (err) { + mosh_error("link_api_xmonitor_read failed, err %d", err); + return err; + } + + modem_details_obj = cJSON_CreateObject(); + if (modem_details_obj == NULL) { + goto cleanup; + } + + memset(tmp_str, 0, sizeof(tmp_str)); + + /* Strip out the quotes from operator name */ + len = strlen(xmonitor_resp.full_name_str); + if (len > 2 && len <= OP_FULL_NAME_STR_MAX_LEN) { + strncpy(tmp_str, xmonitor_resp.full_name_str + 1, len - 2); + } + if (!cJSON_AddStringToObjectCS(modem_details_obj, "operator_full_name", tmp_str)) { + goto cleanup; + } + + /* Strip out the quotes from plmn str */ + memset(tmp_str, 0, sizeof(tmp_str)); + len = strlen(xmonitor_resp.plmn_str); + if (len > 2 && len <= OP_PLMN_STR_MAX_LEN) { + strncpy(tmp_str, xmonitor_resp.plmn_str + 1, len - 2); + } + if (!cJSON_AddStringToObjectCS(modem_details_obj, "plmn", tmp_str)) { + goto cleanup; + } + + if (json_add_num_cs(modem_details_obj, "cell_id", xmonitor_resp.cell_id) || + json_add_num_cs(modem_details_obj, "pci", xmonitor_resp.pci) || + json_add_num_cs(modem_details_obj, "band", xmonitor_resp.band) || + json_add_num_cs(modem_details_obj, "tac", xmonitor_resp.tac) || + json_add_num_cs(modem_details_obj, "rsrp_dbm", RSRP_IDX_TO_DBM(xmonitor_resp.rsrp)) || + json_add_num_cs(modem_details_obj, "snr_db", + xmonitor_resp.snr - LINK_SNR_OFFSET_VALUE)) { + goto cleanup; + } + + err = lte_lc_system_mode_get(&sysmode, NULL); + if (err) { + mosh_warn("lte_lc_system_mode_get failed with err %d", err); + } else { + if (!cJSON_AddStringToObjectCS(modem_details_obj, "sysmode", + link_shell_sysmode_to_string(sysmode, tmp_str))) { + goto cleanup; + } + } + + if (!cJSON_AddItemToObject(root_obj, "modem_details", modem_details_obj)) { + goto cleanup; + } + + return 0; + +cleanup: + /* No need to delete others as they were added to here */ + cJSON_Delete(modem_details_obj); + + return -ENOMEM; +} + +static int location_details_location_data_encode( + const struct location_event_data *loc_evt_data, + cJSON *root_obj) +{ + cJSON *location_data_obj = NULL; + cJSON *method_details_obj = NULL; + const struct location_data_details *details; + int err = -ENOMEM; + + details = location_details_get(loc_evt_data); + if (details == NULL) { + err = -EFAULT; + goto cleanup; + } + + location_data_obj = cJSON_CreateObject(); + if (location_data_obj == NULL) { + goto cleanup; + } + + if (!cJSON_AddStringToObjectCS(location_data_obj, "method", + location_method_str(loc_evt_data->method))) { + goto cleanup; + } + + if (!cJSON_AddStringToObjectCS(location_data_obj, "event", + location_details_event_str(loc_evt_data->id))) { + goto cleanup; + } + + if (!cJSON_AddNumberToObjectCS(location_data_obj, "elapsed_time_method_sec", + (double)details->elapsed_time_method / 1000)) { + goto cleanup; + } + + if (loc_evt_data->id == LOCATION_EVT_LOCATION) { + err = location_details_position_encode(&loc_evt_data->location, location_data_obj); + if (err) { + goto cleanup; + } + } + + method_details_obj = cJSON_CreateObject(); + if (method_details_obj == NULL) { + goto cleanup; + } + + if (!cJSON_AddItemToObject(location_data_obj, "method_details", method_details_obj)) { + cJSON_Delete(method_details_obj); + goto cleanup; + } + +#if defined(CONFIG_LOCATION_METHOD_GNSS) + if (loc_evt_data->method == LOCATION_METHOD_GNSS) { + if (json_add_num_cs(method_details_obj, "tracked_satellites", + details->gnss.satellites_tracked)) { + goto cleanup; + } + + if (json_add_num_cs(method_details_obj, "used_satellites", + details->gnss.satellites_used)) { + goto cleanup; + } + + if (json_add_num_cs(method_details_obj, "elapsed_time_gnss", + (double)details->gnss.elapsed_time_gnss / 1000)) { + goto cleanup; + } + + err = location_details_pvt_data_encode( + &details->gnss.pvt_data, + method_details_obj); + if (err) { + goto cleanup; + } + } +#endif +#if defined(CONFIG_LOCATION_METHOD_CELLULAR) + if (loc_evt_data->method == LOCATION_METHOD_CELLULAR || + loc_evt_data->method == LOCATION_METHOD_WIFI_CELLULAR) { + if (json_add_num_cs(method_details_obj, "cellular_ncells_count", + details->cellular.ncells_count)) { + goto cleanup; + } + if (json_add_num_cs(method_details_obj, "cellular_gci_cells_count", + details->cellular.gci_cells_count)) { + goto cleanup; + } + } +#endif +#if defined(CONFIG_LOCATION_METHOD_WIFI) + if (loc_evt_data->method == LOCATION_METHOD_WIFI || + loc_evt_data->method == LOCATION_METHOD_WIFI_CELLULAR) { + if (json_add_num_cs(method_details_obj, "wifi_ap_cnt", + details->wifi.ap_count)) { + goto cleanup; + } + } +#endif + if (!cJSON_AddItemToObject(root_obj, "location_data", location_data_obj)) { + goto cleanup; + } + + return 0; + +cleanup: + /* No need to delete others as they were added to here */ + cJSON_Delete(location_data_obj); + + return err; +} + +static int location_details_root_encode( + const struct location_event_data *loc_evt_data, + const char *mosh_cmd, + cJSON *root_obj) +{ + int err = 0; + + /* Fill location_req_info */ + err = location_details_location_req_info_encode(mosh_cmd, root_obj); + if (err) { + return err; + } + + /* Fill actual location_data */ + err = location_details_location_data_encode(loc_evt_data, root_obj); + if (err) { + return err; + } + + /* Fill common modem details */ + err = location_details_modem_details_encode(root_obj); + if (err) { + mosh_warn("Failed to encode modem_details data to json, err %d", err); + /* We didn't get modem_details, but we don't care. Let it be empty. */ + } + + return 0; +} + +/* + * Encode location details into JSON format to be sent to nRF Cloud. + * This is a MOSH specific custom data format. + * + * An example output in json_str_out for GNSS is as follows: + *{ + * "data": "5.087", + * "appId": "LOC_GNSS_TTF", + * "messageType": "DATA", + * "ts": 1669711208428, + * "location_req_info": { + * "mosh_cmd": "location get --mode all -m cellular -m wifi -m gnss + * --gnss_cloud_pvt --cloud_details --interval 15", + * }, + * "location_data": { + * "method": "GNSS", + * "event": "success", + * "elapsed_time_method_sec": 5.087, + * "position": { + * "lng": 23.775882648600284, + * "lat": 61.493788965179519, + * "acc": 4.484 + * }, + * "method_details": { + * "tracked_satellites": 10, + * "used_satellites": 9, + * "pvt_data": { + * "flags": 35, + * "lng": 23.775882648600284, + * "lat": 61.493788965179519, + * "acc": 4.484, + * "alt": 144.601, + * "altAcc": 7.932, + * "spd": 0.098, + * "spdAcc": 0.345, + * "hdg": 0, + * "hdgAcc": 180, + * "verSpd": 0.026, + * "verSpdAcc": 0.655, + * "pdop": 2.13, + * "hdop": 0.955, + * "vdop": 1.904, + * "tdop": 1.171, + * "sv_info": [ + * { + * "sv": 4, + * "c_n0": 47.2, + * "sig": 1, + * "elev": 52, + * "az": 93, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 6, + * "c_n0": 47.1, + * "sig": 1, + * "elev": 35, + * "az": 237, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 7, + * "c_n0": 48.4, + * "sig": 1, + * "elev": 33, + * "az": 191, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 9, + * "c_n0": 48.1, + * "sig": 1, + * "elev": 80, + * "az": 194, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 11, + * "c_n0": 47.5, + * "sig": 1, + * "elev": 39, + * "az": 284, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 16, + * "c_n0": 46.4, + * "sig": 1, + * "elev": 25, + * "az": 84, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 26, + * "c_n0": 42.7, + * "sig": 1, + * "elev": 25, + * "az": 48, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 29, + * "c_n0": 43.5, + * "sig": 1, + * "elev": 14, + * "az": 354, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 20, + * "c_n0": 42.9, + * "sig": 1, + * "elev": 27, + * "az": 302, + * "in_fix": 1, + * "unhealthy": 0 + * }, + * { + * "sv": 3, + * "c_n0": 42.2, + * "sig": 1, + * "elev": 9, + * "az": 137, + * "in_fix": 0, + * "unhealthy": 0 + * } + * ] + * } + * } + * }, + * "modem_details": { + * "operator_full_name": "ExampleOp", + * "plmn": "12398", + * "cell_id": 1234567, + * "pci": 110, + * "band": 20, + * "tac": 312, + * "rsrp_dbm": -85, + * "snr_db": 4, + * "sysmode": "LTE-M - GNSS" + * } + *} + * + * An example output in json_str_out for Wi-Fi and cellular positioning is as follows: + *{ + * "data": "6.804", + * "appId": "LOC_WIFI_CELLULAR_TTF", + * "messageType": "DATA", + * "ts": 1669711208428, + * "location_req_info": { + * "mosh_cmd": "location get -m gnss -m cellular -m wifi + * --cloud_details --interval 15", + * }, + * "location_data": { + * "method": "Wi-Fi + Cellular", + * "elapsed_time_method_sec": 6.804, + * "position": { + * "lng": 23.775882648600284, + * "lat": 61.493788965179519, + * "acc": 4.484 + * }, + * "method_details": { + * "cellular_ncells_count":4, + * "cellular_gci_cells_count":0, + * "wifi_ap_cnt":4 + * } + * }, + * "modem_details": { + * "operator_full_name": "ExampleOp", + * "plmn": "12398", + * "cell_id": 1234567, + * "pci": 110, + * "band": 20, + * "tac": 312, + * "rsrp_dbm": -85, + * "snr_db": 4, + * "sysmode": "LTE-M - GNSS" + * } + */ +int location_details_json_payload_encode( + const struct location_event_data *loc_evt_data, + int64_t timestamp_ms, + const char *mosh_cmd, + char **json_str_out) +{ + __ASSERT_NO_MSG(loc_evt_data != NULL); + __ASSERT_NO_MSG(json_str_out != NULL); + + int err = 0; + cJSON *root_obj = NULL; + char app_id_str[32]; + const struct location_data_details *details; + double elapsed_time_method_sec; + enum location_event_id event_id; + + details = location_details_get(loc_evt_data); + if (details == NULL) { + return -EFAULT; + } + elapsed_time_method_sec = (double)details->elapsed_time_method / 1000; + + /* Used time for a location request as a root "key" + * and custom appId based on used method. + */ + switch (loc_evt_data->method) { + case LOCATION_METHOD_GNSS: + strcpy(app_id_str, "LOC_GNSS_TTF"); + break; + case LOCATION_METHOD_CELLULAR: + strcpy(app_id_str, "LOC_CELL_TTF"); + break; + case LOCATION_METHOD_WIFI: + strcpy(app_id_str, "LOC_WIFI_TTF"); + break; + case LOCATION_METHOD_WIFI_CELLULAR: + strcpy(app_id_str, "LOC_WIFI_CELLULAR_TTF"); + break; + default: + __ASSERT_NO_MSG(false); + strcpy(app_id_str, "invalid"); + break; + } + + event_id = loc_evt_data->id; + if (loc_evt_data->id == LOCATION_EVT_FALLBACK) { + event_id = loc_evt_data->fallback.cause; + } + + /* Alter the time for timeout/error to pop out clearly in the card */ + if (event_id == LOCATION_EVT_TIMEOUT) { + elapsed_time_method_sec = -5; + } else if (event_id == LOCATION_EVT_ERROR) { + elapsed_time_method_sec = -1; + } + + /* This structure corresponds to the General Message Schema described in the + * application-protocols repo: + * https://github.com/nRFCloud/application-protocols + */ + + root_obj = cJSON_CreateObject(); + if (root_obj == NULL) { + err = -ENOMEM; + goto cleanup; + } + + if (!cJSON_AddNumberToObjectCS(root_obj, "data", elapsed_time_method_sec) || + !cJSON_AddStringToObjectCS(root_obj, "appId", app_id_str) || + !cJSON_AddStringToObjectCS(root_obj, "messageType", "DATA") || + !cJSON_AddNumberToObjectCS(root_obj, "ts", timestamp_ms)) { + err = -ENOMEM; + goto cleanup; + } + + err = location_details_root_encode(loc_evt_data, mosh_cmd, root_obj); + if (err) { + goto cleanup; + } + *json_str_out = cJSON_PrintUnformatted(root_obj); + if (*json_str_out == NULL) { + err = -ENOMEM; + } + +cleanup: + if (err != 0) { + mosh_error("JSON encoding for location details failed, err=%d", err); + } + + cJSON_Delete(root_obj); + + return err; +} diff --git a/samples/cellular/modem_shell/src/location/location_details.h b/samples/cellular/modem_shell/src/location/location_details.h new file mode 100644 index 000000000000..ad357d0775a0 --- /dev/null +++ b/samples/cellular/modem_shell/src/location/location_details.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOSH_LOCATION_DETAILS_H +#define MOSH_LOCATION_DETAILS_H + +int location_details_json_payload_encode( + const struct location_event_data *loc_evt_data, + int64_t timestamp_ms, + const char *mosh_cmd, + char **json_str_out); + +#endif /* MOSH_LOCATION_DETAILS_H */ diff --git a/samples/cellular/modem_shell/src/location/location_shell.c b/samples/cellular/modem_shell/src/location/location_shell.c index a48d8454b645..7b6cb478e287 100644 --- a/samples/cellular/modem_shell/src/location/location_shell.c +++ b/samples/cellular/modem_shell/src/location/location_shell.c @@ -17,49 +17,76 @@ #if defined(CONFIG_NRF_CLOUD_REST) #include #endif +#if defined(CONFIG_NRF_CLOUD_COAP) +#include +#endif #include #include +#include +#if defined(CONFIG_MOSH_CLOUD_LWM2M) +#include +#include "cloud_lwm2m.h" +#endif #include "mosh_print.h" #include "str_utils.h" #include "location_srv_ext.h" #include "location_cmd_utils.h" +#if defined(CONFIG_LOCATION_DATA_DETAILS) +#include "location_details.h" +#include "str_utils.h" +#endif #include "mosh_defines.h" extern struct k_work_q mosh_common_work_q; #define MOSH_LOC_SERVICE_NONE 0xFF -/* Work for sending acquired location to nRF Cloud */ -struct gnss_location_work_data { - struct k_work work; - - enum nrf_cloud_gnss_type format; - - /* Data from location event */ - struct location_event_data loc_evt_data; -}; -static struct gnss_location_work_data gnss_location_work_data; - /* Whether cloud location (cellular and Wi-Fi positioning) response is requested from the cloud. * Or whether it is not requested and MoSh indicates to Location library that positioning * result is unknown. */ -static bool cloud_resp_enabled; - -static bool gnss_location_to_cloud; -static enum nrf_cloud_gnss_type gnss_location_to_cloud_format; +static bool arg_cloud_resp_enabled; +/* Whether GNSS location is sent to cloud. */ +static bool arg_cloud_gnss; +/* Format of the GNSS location to be sent to cloud. */ +static enum nrf_cloud_gnss_type arg_cloud_gnss_format; +/* Whether location details are sent to cloud. */ +static bool arg_cloud_details; #if defined(CONFIG_DK_LIBRARY) -static struct k_work_delayable location_evt_led_work; +static struct k_work_delayable location_evt_led_off_work; #endif +#define LOCATION_DETAILS_CMD_STR_MAX_LEN 255 + +/* Work for location details to nRF Cloud */ +struct location_cloud_work_data { + struct k_work work; + + enum nrf_cloud_gnss_type format; + int64_t timestamp_ms; + struct location_event_data loc_evt_data; +#if defined(CONFIG_LOCATION_DATA_DETAILS) + char mosh_cmd[LOCATION_DETAILS_CMD_STR_MAX_LEN + 1]; +#endif + /* Whether GNSS location should be sent to cloud. */ + bool send_cloud_gnss; + /* Whether location details should be sent to cloud. */ + bool send_cloud_details; +}; + +static struct location_cloud_work_data location_cloud_work_data; + static const char location_get_usage_str[] = "Usage: location get [--mode ] [--method ]\n" " [--timeout ] [--interval ]\n" " [--gnss_accuracy ] [--gnss_num_fixes ]\n" " [--gnss_timeout ] [--gnss_visibility]\n" " [--gnss_priority] [--gnss_cloud_nmea] [--gnss_cloud_pvt]\n" +#if defined(CONFIG_LOCATION_DATA_DETAILS) + " [--cloud_details]\n" +#endif " [--cellular_timeout ] [--cellular_service ]\n" " [--cellular_cell_count ]\n" " [--wifi_timeout ] [--wifi_service ]\n" @@ -82,6 +109,8 @@ static const char location_get_usage_str[] = " --gnss_priority, Enables GNSS priority mode\n" " --gnss_cloud_nmea, Send acquired GNSS location to nRF Cloud formatted as NMEA\n" " --gnss_cloud_pvt, Send acquired GNSS location to nRF Cloud formatted as PVT\n" + " --cloud_details, Send detailed data to cloud.\n" + " Valid if CONFIG_LOCATION_DATA_DETAILS is set.\n" " --cellular_timeout, [float] Cellular timeout in seconds.\n" " Zero means timeout is disabled.\n" " --cellular_service, [str] Used cellular positioning service:\n" @@ -106,6 +135,7 @@ enum { LOCATION_SHELL_OPT_GNSS_PRIORITY_MODE, LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_NMEA, LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_PVT, + LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_DETAILS, LOCATION_SHELL_OPT_CELLULAR_TIMEOUT, LOCATION_SHELL_OPT_CELLULAR_SERVICE, LOCATION_SHELL_OPT_CELLULAR_CELL_COUNT, @@ -127,6 +157,7 @@ static struct option long_options[] = { { "gnss_priority", no_argument, 0, LOCATION_SHELL_OPT_GNSS_PRIORITY_MODE }, { "gnss_cloud_nmea", no_argument, 0, LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_NMEA }, { "gnss_cloud_pvt", no_argument, 0, LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_PVT }, + { "cloud_details", no_argument, 0, LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_DETAILS }, { "cellular_timeout", required_argument, 0, LOCATION_SHELL_OPT_CELLULAR_TIMEOUT }, { "cellular_service", required_argument, 0, LOCATION_SHELL_OPT_CELLULAR_SERVICE }, { "cellular_cell_count", required_argument, 0, LOCATION_SHELL_OPT_CELLULAR_CELL_COUNT }, @@ -152,74 +183,109 @@ static enum location_service location_shell_string_to_service(const char *servic return service; } -static void location_to_cloud_worker(struct k_work *work_item) +#if defined(CONFIG_DK_LIBRARY) +static void location_evt_led_off_work_fn(struct k_work *work_item) { - struct gnss_location_work_data *data = - CONTAINER_OF(work_item, struct gnss_location_work_data, work); - int ret; - char *body = NULL; + dk_set_led_off(LOCATION_STATUS_LED); +} +#endif - /* If the position update was acquired by using GNSS, send it to nRF Cloud. */ - if (data->loc_evt_data.method == LOCATION_METHOD_GNSS) { - /* Encode json payload in requested format, either NMEA or in PVT*/ - ret = location_cmd_utils_gnss_loc_to_cloud_payload_json_encode( - data->format, &data->loc_evt_data.location, &body); - if (ret) { - mosh_error("Failed to generate nrf cloud NMEA or PVT, err: %d", ret); - goto clean_up; - } +static int location_cloud_send(char *body) +{ + int ret; - /* Send the encoded message to the nRF Cloud using either MQTT or REST transport */ #if defined(CONFIG_NRF_CLOUD_MQTT) - struct nrf_cloud_tx_data mqtt_msg = { - .data.ptr = body, - .data.len = strlen(body), - .qos = MQTT_QOS_1_AT_LEAST_ONCE, - .topic_type = NRF_CLOUD_TOPIC_MESSAGE, - }; - mosh_print("Sending acquired GNSS location to nRF Cloud via MQTT, body: %s", body); - - ret = nrf_cloud_send(&mqtt_msg); - if (ret) { - mosh_error("MQTT: location sending failed"); - } + struct nrf_cloud_tx_data mqtt_msg = { + .data.ptr = body, + .data.len = strlen(body), + .qos = MQTT_QOS_1_AT_LEAST_ONCE, + .topic_type = NRF_CLOUD_TOPIC_MESSAGE, + }; + + ret = nrf_cloud_send(&mqtt_msg); + if (ret) { + mosh_error("MQTT: location data sending failed: %d", ret); + } +#elif defined(CONFIG_NRF_CLOUD_COAP) + ret = nrf_cloud_coap_json_message_send(body, false, true); + if (ret) { + mosh_error("CoAP: location data sending failed"); + } #elif defined(CONFIG_NRF_CLOUD_REST) -#define REST_RX_BUF_SZ 300 /* No payload in a response, "just" headers */ - static char rx_buf[REST_RX_BUF_SZ]; - static char device_id[NRF_CLOUD_CLIENT_ID_MAX_LEN + 1]; - static struct nrf_cloud_rest_context rest_ctx = { .connect_socket = -1, - .keep_alive = false, - .rx_buf = rx_buf, - .rx_buf_len = sizeof(rx_buf), - .fragment_size = 0 }; - - mosh_print("Sending acquired GNSS location to nRF Cloud via REST, body: %s", body); - - ret = nrf_cloud_client_id_get(device_id, sizeof(device_id)); +#define REST_DETAILS_RX_BUF_SZ 300 /* No payload in a response, "just" headers */ + static char rx_buf[REST_DETAILS_RX_BUF_SZ]; + static char device_id[NRF_CLOUD_CLIENT_ID_MAX_LEN + 1]; + static struct nrf_cloud_rest_context rest_ctx = { + .connect_socket = -1, + .keep_alive = false, + .rx_buf = rx_buf, + .rx_buf_len = sizeof(rx_buf), + .fragment_size = 0 + }; + + ret = nrf_cloud_client_id_get(device_id, sizeof(device_id)); + if (ret == 0) { + ret = nrf_cloud_rest_send_device_message(&rest_ctx, device_id, body, false, NULL); if (ret) { - mosh_error("Failed to get device ID, error: %d", ret); - goto clean_up; + mosh_error("REST: location data sending failed: %d", ret); } + } else { + mosh_error("Failed to get device ID, error: %d", ret); + } +#endif + return ret; +} - ret = nrf_cloud_rest_send_device_message(&rest_ctx, device_id, body, false, NULL); +static void location_cloud_work_fn(struct k_work *work_item) +{ + struct location_cloud_work_data *data = + CONTAINER_OF(work_item, struct location_cloud_work_data, work); + int ret; + char *body_gnss = NULL; + + if (data->send_cloud_gnss) { + /* Encode json payload in requested format, either NMEA or in PVT */ + ret = location_cmd_utils_gnss_loc_to_cloud_payload_json_encode( + data->format, + &data->loc_evt_data.location, + data->timestamp_ms, + &body_gnss); if (ret) { - mosh_error("REST: location sending failed: %d", ret); + mosh_error("Failed to generate nRF Cloud NMEA or PVT, err: %d", ret); + } else { + mosh_print( + "Sending acquired GNSS location to nRF Cloud, body: %s", + body_gnss); + location_cloud_send(body_gnss); + } + if (body_gnss) { + cJSON_free(body_gnss); } -#endif } -clean_up: - if (body) { - cJSON_free(body); +#if defined(CONFIG_LOCATION_DATA_DETAILS) + char *body_details = NULL; + + if (data->send_cloud_details) { + ret = location_details_json_payload_encode( + &data->loc_evt_data, + data->timestamp_ms, + data->mosh_cmd, + &body_details); + if (ret) { + mosh_error("location details json encoding failed: %d", ret); + } else { + mosh_print( + "Sending location related details to nRF Cloud, body: %s", + body_details); + location_cloud_send(body_details); + } + if (body_details) { + cJSON_free(body_details); + } } -} - -#if defined(CONFIG_DK_LIBRARY) -static void location_evt_led_worker(struct k_work *work_item) -{ - dk_set_led_off(LOCATION_STATUS_LED); -} #endif +} #if defined(CONFIG_LOCATION_DATA_DETAILS) static void location_print_data_details( @@ -251,8 +317,18 @@ static void location_print_data_details( void location_ctrl_event_handler(const struct location_event_data *event_data) { + int64_t ts_ms = NRF_CLOUD_NO_TIMESTAMP; + + location_cloud_work_data.send_cloud_details = false; + location_cloud_work_data.send_cloud_gnss = false; + +#if defined(CONFIG_DATE_TIME) + date_time_now(&ts_ms); +#endif + switch (event_data->id) { case LOCATION_EVT_LOCATION: + location_cloud_work_data.send_cloud_details = arg_cloud_details; mosh_print("Location:"); mosh_print( " used method: %s (%d)", @@ -260,7 +336,7 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) event_data->method); mosh_print(" latitude: %.06f", event_data->location.latitude); mosh_print(" longitude: %.06f", event_data->location.longitude); - mosh_print(" accuracy: %.01f m", event_data->location.accuracy); + mosh_print(" accuracy: %.01f m", (double)event_data->location.accuracy); if (event_data->location.datetime.valid) { mosh_print( " date: %04d-%02d-%02d", @@ -281,20 +357,18 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) #if defined(CONFIG_LOCATION_DATA_DETAILS) location_print_data_details(event_data->method, &event_data->location.details); #endif - if (gnss_location_to_cloud) { - gnss_location_work_data.loc_evt_data = *event_data; - gnss_location_work_data.format = gnss_location_to_cloud_format; - k_work_submit_to_queue(&mosh_common_work_q, &gnss_location_work_data.work); + if (event_data->method == LOCATION_METHOD_GNSS) { + location_cloud_work_data.send_cloud_gnss = arg_cloud_gnss; } #if defined(CONFIG_DK_LIBRARY) dk_set_led_on(LOCATION_STATUS_LED); - k_work_reschedule_for_queue(&mosh_common_work_q, &location_evt_led_work, - K_SECONDS(5)); + k_work_reschedule(&location_evt_led_off_work, K_SECONDS(5)); #endif break; case LOCATION_EVT_TIMEOUT: + location_cloud_work_data.send_cloud_details = arg_cloud_details; mosh_error("Location request timed out:"); mosh_print( " used method: %s (%d)", @@ -306,6 +380,7 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) break; case LOCATION_EVT_ERROR: + location_cloud_work_data.send_cloud_details = arg_cloud_details; mosh_error("Location request failed:"); mosh_print( " used method: %s (%d)", @@ -365,16 +440,20 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) } #endif location_srv_ext_cloud_location_handle( - &event_data->cloud_location_request, cloud_resp_enabled); + &event_data->cloud_location_request, arg_cloud_resp_enabled); break; #endif #endif /* defined(CONFIG_LOCATION_SERVICE_EXTERNAL) */ case LOCATION_EVT_RESULT_UNKNOWN: + location_cloud_work_data.send_cloud_details = arg_cloud_details; mosh_print("Location request completed, but the result is not known:"); mosh_print( " used method: %s (%d)", location_method_str(event_data->method), event_data->method); +#if defined(CONFIG_LOCATION_DATA_DETAILS) + location_print_data_details(event_data->method, &event_data->error.details); +#endif break; #if defined(CONFIG_LOCATION_DATA_DETAILS) case LOCATION_EVT_STARTED: @@ -385,6 +464,7 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) event_data->method); break; case LOCATION_EVT_FALLBACK: + location_cloud_work_data.send_cloud_details = arg_cloud_details; mosh_print("Location request fallback has occurred:"); mosh_print( " failed method: %s (%d)", @@ -406,16 +486,33 @@ void location_ctrl_event_handler(const struct location_event_data *event_data) mosh_warn("Unknown event from location library, id %d", event_data->id); break; } + + if (location_cloud_work_data.send_cloud_gnss || + location_cloud_work_data.send_cloud_details) { + + if (k_work_busy_get(&location_cloud_work_data.work) == 0) { + location_cloud_work_data.loc_evt_data = *event_data; + location_cloud_work_data.timestamp_ms = ts_ms; + location_cloud_work_data.format = arg_cloud_gnss_format; + /* location_cloud_work_data.mosh_cmd set when location command is issued */ + + k_work_submit_to_queue(&mosh_common_work_q, &location_cloud_work_data.work); + } else { + mosh_warn( + "Sending previous location data to cloud still ongoing. " + "New location data ignored."); + } + } } void location_ctrl_init(void) { int ret; - k_work_init(&gnss_location_work_data.work, location_to_cloud_worker); + k_work_init(&location_cloud_work_data.work, location_cloud_work_fn); #if defined(CONFIG_DK_LIBRARY) - k_work_init_delayable(&location_evt_led_work, location_evt_led_worker); + k_work_init_delayable(&location_evt_led_off_work, location_evt_led_off_work_fn); #endif ret = location_init(location_ctrl_event_handler); @@ -455,9 +552,10 @@ static int cmd_location_get(const struct shell *shell, size_t argc, char **argv) bool wifi_timeout_set = false; enum location_service wifi_service = LOCATION_SERVICE_ANY; - gnss_location_to_cloud_format = NRF_CLOUD_GNSS_TYPE_PVT; - gnss_location_to_cloud = false; - cloud_resp_enabled = true; + arg_cloud_gnss_format = NRF_CLOUD_GNSS_TYPE_PVT; + arg_cloud_gnss = false; + arg_cloud_details = false; + arg_cloud_resp_enabled = true; optreset = 1; optind = 1; @@ -475,16 +573,26 @@ static int cmd_location_get(const struct shell *shell, size_t argc, char **argv) gnss_num_fixes_set = true; break; case LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_NMEA: - gnss_location_to_cloud_format = NRF_CLOUD_GNSS_TYPE_NMEA; + arg_cloud_gnss_format = NRF_CLOUD_GNSS_TYPE_NMEA; /* flow-through */ case LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_PVT: - gnss_location_to_cloud = true; + arg_cloud_gnss = true; break; + case LOCATION_SHELL_OPT_GNSS_LOC_CLOUD_DETAILS: +#if defined(CONFIG_LOCATION_DATA_DETAILS) + arg_cloud_details = true; +#else + mosh_error( + "Option --cloud_details is not supported " + "when CONFIG_LOCATION_DATA_DETAILS is disabled"); + goto show_usage; +#endif + break; + case LOCATION_SHELL_OPT_CELLULAR_TIMEOUT: cellular_timeout = atof(optarg); cellular_timeout_set = true; break; - case LOCATION_SHELL_OPT_CELLULAR_SERVICE: cellular_service = location_shell_string_to_service(optarg); if (cellular_service == MOSH_LOC_SERVICE_NONE) { @@ -498,7 +606,7 @@ static int cmd_location_get(const struct shell *shell, size_t argc, char **argv) break; case LOCATION_SHELL_OPT_CLOUD_RESP_DISABLED: #if defined(CONFIG_LOCATION_SERVICE_EXTERNAL) - cloud_resp_enabled = false; + arg_cloud_resp_enabled = false; #else mosh_error( "Option --cloud_resp_disabled is not supported " @@ -660,6 +768,16 @@ static int cmd_location_get(const struct shell *shell, size_t argc, char **argv) return -1; } +#if defined(CONFIG_LOCATION_DATA_DETAILS) + /* Store current command */ + shell_command_str_from_argv( + argc, + argv, + "location ", + location_cloud_work_data.mosh_cmd, + LOCATION_DETAILS_CMD_STR_MAX_LEN + 1); +#endif + mosh_print("Started to get current location..."); return ret; @@ -672,8 +790,6 @@ static int cmd_location_cancel(const struct shell *shell, size_t argc, char **ar { int ret; - gnss_location_to_cloud = false; - k_work_cancel(&gnss_location_work_data.work); ret = location_request_cancel(); if (ret) { mosh_error("Canceling location request failed, err: %d", ret); diff --git a/samples/cellular/modem_shell/src/ping/icmp_ping.c b/samples/cellular/modem_shell/src/ping/icmp_ping.c index 541b881cc7d1..8039dce35608 100644 --- a/samples/cellular/modem_shell/src/ping/icmp_ping.c +++ b/samples/cellular/modem_shell/src/ping/icmp_ping.c @@ -23,6 +23,8 @@ #include +#include + #include "net_utils.h" #include "link_api.h" #include "mosh_defines.h" @@ -52,6 +54,16 @@ enum ping_rai { PING_RAI_LAST_PACKET }; +/* When LTE reg status was updated last time: + * used to detect the cases when we need to re-read + * PDN context info to update ping ip addresses in case of possible + * changes. + */ +static int64_t network_reg_status_updated_uptime; + +static bool icmp_ping_current_conn_info_set( + struct icmp_ping_shell_cmd_argv *ping_args, struct icmp_ping_shell_cmd_argv *ping_argv); + /*****************************************************************************/ static inline void setip(uint8_t *buffer, uint32_t ipaddr) @@ -501,10 +513,9 @@ static uint32_t send_ping_wait_reply(struct icmp_ping_shell_cmd_argv *ping_args, /*****************************************************************************/ -static void icmp_ping_tasks_execute(struct icmp_ping_shell_cmd_argv *ping_args) +int icmp_ping_start(struct icmp_ping_shell_cmd_argv *ping_args) { - struct addrinfo *si = ping_args->src; - struct addrinfo *di = ping_args->dest; + struct icmp_ping_shell_cmd_argv current_ping_args; uint32_t sum = 0; uint32_t count = 0; uint32_t rtt_min = 0xFFFFFFFF; @@ -512,23 +523,48 @@ static void icmp_ping_tasks_execute(struct icmp_ping_shell_cmd_argv *ping_args) int set, res; enum ping_rai rai; uint32_t ping_t; + int ret = 0; + + /* All good for ping_args, get the current connection info and start the ping */ + if (!icmp_ping_current_conn_info_set(ping_args, ¤t_ping_args)) { + return -1; + } - for (int i = 0; i < ping_args->count; i++) { + for (int i = 0; i < current_ping_args.count; i++) { rai = PING_RAI_NONE; - if (ping_args->rai) { - if (i == ping_args->count - 1) { + if (current_ping_args.rai) { + if (i == current_ping_args.count - 1) { /* For last packet */ rai = PING_RAI_LAST_PACKET; } else { rai = PING_RAI_ONGOING; } } - ping_t = send_ping_wait_reply(ping_args, rai); - k_poll_signal_check(ping_args->kill_signal, &set, &res); + if (current_ping_args.pdn_ctx_info_read_uptime < + network_reg_status_updated_uptime) { + /* Re-read PDN context info */ + ping_print(¤t_ping_args, "Re-reading PDN context info..."); + freeaddrinfo(current_ping_args.dest); + current_ping_args.dest = NULL; + freeaddrinfo(current_ping_args.src); + current_ping_args.src = NULL; + if (!icmp_ping_current_conn_info_set( + ¤t_ping_args, ¤t_ping_args)) { + ping_error( + ¤t_ping_args, + "Re-reading of PDN context info failed - exiting"); + ret = -1; + break; + } + } + + ping_t = send_ping_wait_reply(¤t_ping_args, rai); + + k_poll_signal_check(current_ping_args.kill_signal, &set, &res); if (set) { - k_poll_signal_reset(ping_args->kill_signal); - ping_error(ping_args, "KILL signal received - exiting"); + k_poll_signal_reset(current_ping_args.kill_signal); + ping_error(¤t_ping_args, "KILL signal received - exiting"); break; } @@ -538,31 +574,37 @@ static void icmp_ping_tasks_execute(struct icmp_ping_shell_cmd_argv *ping_args) rtt_max = MAX(rtt_max, ping_t); rtt_min = MIN(rtt_min, ping_t); } - k_sleep(K_MSEC(ping_args->interval)); + k_sleep(K_MSEC(current_ping_args.interval)); } - freeaddrinfo(si); - freeaddrinfo(di); - uint32_t lost = ping_args->count - count; + uint32_t lost = current_ping_args.count - count; - ping_print(ping_args, "Ping statistics for %s:", ping_args->target_name); + ping_print(¤t_ping_args, "Ping statistics for %s:", current_ping_args.target_name); ping_print( - ping_args, + ¤t_ping_args, " Packets: Sent = %d, Received = %d, Lost = %d (%d%% loss)", - ping_args->count, + current_ping_args.count, count, lost, - lost * 100 / ping_args->count); + lost * 100 / current_ping_args.count); if (count > 0) { - ping_print(ping_args, "Approximate round trip times in milli-seconds:"); + ping_print(¤t_ping_args, "Approximate round trip times in milli-seconds:"); ping_print( - ping_args, + ¤t_ping_args, " Minimum = %dms, Maximum = %dms, Average = %dms", rtt_min, rtt_max, sum / count); } - ping_print(ping_args, "Pinging DONE"); + + freeaddrinfo(current_ping_args.src); + current_ping_args.src = NULL; + freeaddrinfo(current_ping_args.dest); + current_ping_args.dest = NULL; + + ping_print(¤t_ping_args, "Pinging DONE"); + + return ret; } /*****************************************************************************/ @@ -613,10 +655,18 @@ void icmp_ping_cmd_defaults_set(struct icmp_ping_shell_cmd_argv *ping_args) ping_args->cid = MOSH_ARG_NOT_SET; ping_args->pdn_id_for_cid = MOSH_ARG_NOT_SET; } - /*****************************************************************************/ -int icmp_ping_start(struct icmp_ping_shell_cmd_argv *ping_args) +/** + * @brief Read and set current connection parameters. + * + * @param ping_args In: Current ping parameters. + * @param ping_argv Out: Ping parameters with updated connection parameters. + * + */ + +static bool icmp_ping_current_conn_info_set( + struct icmp_ping_shell_cmd_argv *ping_args, struct icmp_ping_shell_cmd_argv *ping_argv) { int st = -1; struct addrinfo *res; @@ -626,14 +676,13 @@ int icmp_ping_start(struct icmp_ping_shell_cmd_argv *ping_args) bool set_flags = false; int ret = 0; struct pdp_context_info_array pdp_context_info_tbl; - struct icmp_ping_shell_cmd_argv ping_argv; - /* All good for args, get the current connection info and start the ping: */ ret = link_api_pdp_contexts_read(&pdp_context_info_tbl); if (ret) { ping_error(ping_args, "cannot read current connection info: %d", ret); goto exit; } + ping_args->pdn_ctx_info_read_uptime = k_uptime_get(); if (pdp_context_info_tbl.size > 0) { /* Default context: */ if (ping_args->cid == MOSH_ARG_NOT_SET) { @@ -678,91 +727,120 @@ int icmp_ping_start(struct icmp_ping_shell_cmd_argv *ping_args) } /* Finally copy args in local storage here and start pinging */ - memcpy(&ping_argv, ping_args, sizeof(struct icmp_ping_shell_cmd_argv)); + memcpy(ping_argv, ping_args, sizeof(struct icmp_ping_shell_cmd_argv)); - ping_print(&ping_argv, "Initiating ping to: %s", ping_argv.target_name); + ping_print(ping_argv, "Initiating ping to: %s", ping_argv->target_name); /* Sets getaddrinfo hints by using current host address(es): */ struct addrinfo hints = { .ai_family = AF_INET, }; - if (ping_argv.cid != MOSH_ARG_NOT_SET) { - if (ping_argv.pdn_id_for_cid != MOSH_ARG_NOT_SET) { - snprintf(portstr, 6, "%d", ping_argv.pdn_id_for_cid); + if (ping_argv->cid != MOSH_ARG_NOT_SET) { + if (ping_argv->pdn_id_for_cid != MOSH_ARG_NOT_SET) { + snprintf(portstr, 6, "%d", ping_argv->pdn_id_for_cid); set_flags = true; service = portstr; hints.ai_flags = AI_PDNSERV; } } - inet_ntop(AF_INET, &(ping_argv.current_addr4), src_ipv_addr, + inet_ntop(AF_INET, &(ping_argv->current_addr4), src_ipv_addr, sizeof(src_ipv_addr)); - if (ping_argv.current_pdp_type == PDP_TYPE_IP4V6) { - if (ping_argv.force_ipv6) { + if (ping_argv->current_pdp_type == PDP_TYPE_IP4V6) { + if (ping_argv->force_ipv6) { hints.ai_family = AF_INET6; - inet_ntop(AF_INET6, &(ping_argv.current_addr6), + inet_ntop(AF_INET6, &(ping_argv->current_addr6), src_ipv_addr, sizeof(src_ipv_addr)); } } - if (ping_argv.current_pdp_type == PDP_TYPE_IPV6) { + if (ping_argv->current_pdp_type == PDP_TYPE_IPV6) { hints.ai_family = AF_INET6; - inet_ntop(AF_INET6, &(ping_argv.current_addr6), src_ipv_addr, + inet_ntop(AF_INET6, &(ping_argv->current_addr6), src_ipv_addr, sizeof(src_ipv_addr)); } st = getaddrinfo(src_ipv_addr, service, &hints, &res); if (st != 0) { - ping_error(&ping_argv, "getaddrinfo(src) error: %d", st); + ping_error(ping_argv, "getaddrinfo(src) error: %d", st); goto exit; } - ping_argv.src = res; + ping_argv->src = res; /* Get destination */ res = NULL; - st = getaddrinfo(ping_argv.target_name, service, &hints, &res); + st = getaddrinfo(ping_argv->target_name, service, &hints, &res); if (st != 0) { - ping_error(&ping_argv, "getaddrinfo(dest) error: %d", st); - ping_error(&ping_argv, "Cannot resolve remote host\r\n"); - freeaddrinfo(ping_argv.src); + ping_error(ping_argv, "getaddrinfo(dest) error: %d", st); + ping_error(ping_argv, "Cannot resolve remote host\r\n"); + freeaddrinfo(ping_argv->src); + ping_argv->src = NULL; goto exit; } - ping_argv.dest = res; - - if (ping_argv.src->ai_family != ping_argv.dest->ai_family) { - ping_error(&ping_argv, "Source/Destination address family error"); - freeaddrinfo(ping_argv.dest); - freeaddrinfo(ping_argv.src); + ping_argv->dest = res; + + if (ping_argv->src->ai_family != ping_argv->dest->ai_family) { + ping_error(ping_argv, "Source/Destination address family error"); + freeaddrinfo(ping_argv->dest); + ping_argv->dest = NULL; + freeaddrinfo(ping_argv->src); + ping_argv->src = NULL; goto exit; } struct sockaddr *sa; - sa = ping_argv.src->ai_addr; - ping_print(&ping_argv, "Source IP addr: %s", net_utils_sckt_addr_ntop(sa)); - sa = ping_argv.dest->ai_addr; - ping_print(&ping_argv, "Destination IP addr: %s", net_utils_sckt_addr_ntop(sa)); + sa = ping_argv->src->ai_addr; + ping_print(ping_argv, "Source IP addr: %s", net_utils_sckt_addr_ntop(sa)); + sa = ping_argv->dest->ai_addr; + ping_print(ping_argv, "Destination IP addr: %s", net_utils_sckt_addr_ntop(sa)); /* Now we can check the max payload len for IPv6: */ - uint32_t ipv6_max_payload_len = ping_argv.mtu - ICMP_IPV6_HDR_LEN - ICMP_HDR_LEN; + uint32_t ipv6_max_payload_len = ping_argv->mtu - ICMP_IPV6_HDR_LEN - ICMP_HDR_LEN; - if (ping_argv.src->ai_family == AF_INET6 && - ping_argv.len > ipv6_max_payload_len) { + if (ping_argv->src->ai_family == AF_INET6 && + ping_argv->len > ipv6_max_payload_len) { ping_warn( - &ping_argv, + ping_argv, "Payload size exceeds the link limits: MTU %d - headers %d = %d ", - ping_argv.mtu, (ICMP_IPV4_HDR_LEN - ICMP_HDR_LEN), + ping_argv->mtu, (ICMP_IPV4_HDR_LEN - ICMP_HDR_LEN), ipv6_max_payload_len); /* Continue still: */ } - - icmp_ping_tasks_execute(&ping_argv); - return 0; + return true; exit: if (pdp_context_info_tbl.array != NULL) { free(pdp_context_info_tbl.array); } - return -1; + return false; } + +/*****************************************************************************/ + +static void icmp_ping_lte_lc_evt_handler(const struct lte_lc_evt *const evt) +{ + if (evt->type != LTE_LC_EVT_NW_REG_STATUS) { + return; + } + + switch (evt->nw_reg_status) { + case LTE_LC_NW_REG_REGISTERED_HOME: + case LTE_LC_NW_REG_REGISTERED_ROAMING: + network_reg_status_updated_uptime = k_uptime_get(); + break; + default: + break; + } +} + +static int icmp_ping_init(void) +{ + network_reg_status_updated_uptime = k_uptime_get(); + lte_lc_register_handler(icmp_ping_lte_lc_evt_handler); + + return 0; +} + +SYS_INIT(icmp_ping_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/samples/cellular/modem_shell/src/ping/icmp_ping.h b/samples/cellular/modem_shell/src/ping/icmp_ping.h index b8a59c3ddf6c..5a565a9426f6 100644 --- a/samples/cellular/modem_shell/src/ping/icmp_ping.h +++ b/samples/cellular/modem_shell/src/ping/icmp_ping.h @@ -16,12 +16,12 @@ #include #include "mosh_defines.h" -#define ICMP_IPV4_HDR_LEN 20 -#define ICMP_IPV6_HDR_LEN 40 +#define ICMP_IPV4_HDR_LEN 20 +#define ICMP_IPV6_HDR_LEN 40 -#define ICMP_MAX_URL 128 +#define ICMP_MAX_ADDR 128 #define ICMP_DEFAULT_LINK_MTU 1500 -#define ICMP_HDR_LEN 8 +#define ICMP_HDR_LEN 8 /* Max payload lengths: */ #define ICMP_IPV4_MAX_LEN (ICMP_DEFAULT_LINK_MTU - ICMP_IPV4_HDR_LEN - ICMP_HDR_LEN) @@ -38,7 +38,7 @@ struct icmp_ping_shell_cmd_argv { char *print_buf; int print_buf_len; - char target_name[ICMP_MAX_URL + 1]; + char target_name[ICMP_MAX_ADDR + 1]; struct addrinfo *src; struct addrinfo *dest; struct in_addr current_addr4; @@ -55,6 +55,8 @@ struct icmp_ping_shell_cmd_argv { uint32_t interval; bool force_ipv6; bool rai; + + int64_t pdn_ctx_info_read_uptime; }; /** diff --git a/samples/cellular/modem_shell/src/ping/icmp_ping_shell.c b/samples/cellular/modem_shell/src/ping/icmp_ping_shell.c index 00f74d064675..9bcd55a10855 100644 --- a/samples/cellular/modem_shell/src/ping/icmp_ping_shell.c +++ b/samples/cellular/modem_shell/src/ping/icmp_ping_shell.c @@ -90,7 +90,7 @@ int icmp_ping_shell_th(const struct shell *shell, size_t argc, char **argv, switch (opt) { case 'd': /* destination */ dest_len = strlen(optarg); - if (dest_len > ICMP_MAX_URL) { + if (dest_len > ICMP_MAX_ADDR) { ping_error(&ping_args, "too long destination name"); goto show_usage; } diff --git a/samples/cellular/modem_shell/src/ppp/ppp_ctrl.c b/samples/cellular/modem_shell/src/ppp/ppp_ctrl.c index 7624a6bcf4e2..a65b315c3342 100644 --- a/samples/cellular/modem_shell/src/ppp/ppp_ctrl.c +++ b/samples/cellular/modem_shell/src/ppp/ppp_ctrl.c @@ -225,14 +225,6 @@ static void ppp_ctrl_net_mgmt_event_handler(struct net_mgmt_event_callback *cb, } break; } - case NET_EVENT_PPP_CARRIER_ON: { - mosh_print("PPP carrier ON"); - break; - } - case NET_EVENT_PPP_CARRIER_OFF: { - mosh_print("PPP carrier OFF"); - break; - } default: break; } @@ -283,8 +275,6 @@ static void ppp_ctrl_net_mgmt_events_subscribe(void) ppp_ctrl_net_mgmt_event_handler, (NET_EVENT_IF_UP | NET_EVENT_IF_DOWN | - NET_EVENT_PPP_CARRIER_ON | - NET_EVENT_PPP_CARRIER_OFF | NET_EVENT_PPP_PHASE_RUNNING | NET_EVENT_PPP_PHASE_DEAD)); @@ -511,9 +501,9 @@ int ppp_ctrl_start(void) void ppp_ctrl_stop(void) { + ppp_up = false; ppp_ctrl_stop_net_if(); ppp_ctrl_close_sckts(); mosh_print("PPP: stopped"); - ppp_up = false; } diff --git a/samples/cellular/modem_shell/src/sock/sock.c b/samples/cellular/modem_shell/src/sock/sock.c index 096dfdfef596..67c1a65ab4b8 100644 --- a/samples/cellular/modem_shell/src/sock/sock.c +++ b/samples/cellular/modem_shell/src/sock/sock.c @@ -686,7 +686,7 @@ static void print_throughput_summary(uint32_t data_len, int64_t time_ms) mosh_print("Summary:"); mosh_print(" Data length: %7u bytes", data_len); - mosh_print(" Time: %8.3f s", (float)time_ms / 1000); + mosh_print(" Time: %8.3f s", (double)time_ms / 1000.0); mosh_print(" Throughput: %7.0f bit/s", throughput); } @@ -836,7 +836,7 @@ static void sock_send_random_data_length(struct sock_info *socket_info) mosh_print( "%7u bytes, %6.2fs, %6.0f bit/s", socket_info->send_bytes_sent, - (float)ul_time_intermediate_ms / 1000, + (double)ul_time_intermediate_ms / 1000.0, throughput); socket_info->send_print_interval += 10; diff --git a/samples/cellular/modem_shell/src/th/th_ctrl.c b/samples/cellular/modem_shell/src/th/th_ctrl.c index 2ed92bc0008b..a3f667464129 100644 --- a/samples/cellular/modem_shell/src/th/th_ctrl.c +++ b/samples/cellular/modem_shell/src/th/th_ctrl.c @@ -49,23 +49,6 @@ struct th_ctrl_data { static struct th_ctrl_data th_work_data_1; static struct th_ctrl_data th_work_data_2; -static char *th_ctrl_get_command_str_from_argv(size_t argc, char **argv, - char *out_buf, - uint16_t out_buf_len) -{ - int i, total_len = 0, arg_len = 0; - - for (i = 0; i < argc; i++) { - arg_len = strlen(argv[i]); - if (total_len + arg_len > out_buf_len) { - break; - } - sprintf(out_buf + total_len, "%s ", argv[i]); - total_len = strlen(out_buf); - } - return out_buf; -} - static char **th_ctrl_util_duplicate_argv(int argc, char **argv) { char **ptr_array; @@ -187,8 +170,8 @@ static void th_ctrl_data_status_print(struct th_ctrl_data *data) if (print_buf != NULL) { mosh_print( " command: %s", - th_ctrl_get_command_str_from_argv( - data->argc, data->argv, + shell_command_str_from_argv( + data->argc, data->argv, NULL, print_buf, data->cmd_len + 1)); } else { diff --git a/samples/cellular/modem_shell/src/utils/str_utils.c b/samples/cellular/modem_shell/src/utils/str_utils.c index 20a6fc8d7fa8..3beff3c4e56a 100644 --- a/samples/cellular/modem_shell/src/utils/str_utils.c +++ b/samples/cellular/modem_shell/src/utils/str_utils.c @@ -14,6 +14,39 @@ #include #include "str_utils.h" +#include "mosh_print.h" + +char *shell_command_str_from_argv( + size_t argc, + char **argv, + const char *cmd_prefix, + char *out_buf, + uint16_t out_buf_len) +{ + int i, total_len = 0, arg_len = 0; + + if (cmd_prefix != NULL) { + strncpy(out_buf, cmd_prefix, out_buf_len); + total_len = strlen(cmd_prefix); + } + + for (i = 0; i < argc; i++) { + arg_len = strlen(argv[i]); + if (total_len + arg_len > out_buf_len) { + mosh_error("Converted shell command cut due to too short output buffer"); + break; + } + if (i == (argc - 1)) { + /* Do not put space to last one */ + sprintf(out_buf + total_len, "%s", argv[i]); + } else { + sprintf(out_buf + total_len, "%s ", argv[i]); + } + total_len = strlen(out_buf); + } + + return out_buf; +} int str_hex_to_bytes(char *str, uint32_t str_length, uint8_t *buf, uint16_t buf_length) { diff --git a/samples/cellular/modem_shell/src/utils/str_utils.h b/samples/cellular/modem_shell/src/utils/str_utils.h index 08df4665531a..53b9c311cac2 100644 --- a/samples/cellular/modem_shell/src/utils/str_utils.h +++ b/samples/cellular/modem_shell/src/utils/str_utils.h @@ -7,6 +7,17 @@ #ifndef MOSH_STR_UTILS_H #define MOSH_STR_UTILS_H +/* Generate shell command from argv. + * cmd_prefix is set into the out_buf first and then the generated string. + */ +char *shell_command_str_from_argv( + size_t argc, + char **argv, + const char *cmd_prefix, + char *out_buf, + uint16_t out_buf_len); + +/* Convert hexadecimal string to byte buffer. */ int str_hex_to_bytes(char *str, uint32_t str_length, uint8_t *buf, uint16_t buf_length); /* strdup() C-library function implemented here because there's no such function in newlibc. */ diff --git a/samples/cellular/modem_trace_backend/sample.yaml b/samples/cellular/modem_trace_backend/sample.yaml index 74a8fe60dfa5..5f25d6dbd51b 100644 --- a/samples/cellular/modem_trace_backend/sample.yaml +++ b/samples/cellular/modem_trace_backend/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.modem_trace_backend: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/modem_trace_flash/sample.yaml b/samples/cellular/modem_trace_flash/sample.yaml index 9884c7efa22c..f3bbf3981350 100644 --- a/samples/cellular/modem_trace_flash/sample.yaml +++ b/samples/cellular/modem_trace_flash/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.modem_trace_flash: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/nidd/sample.yaml b/samples/cellular/nidd/sample.yaml index acf9e8f3cfa0..7e125a157aa4 100644 --- a/samples/cellular/nidd/sample.yaml +++ b/samples/cellular/nidd/sample.yaml @@ -4,14 +4,14 @@ tests: samples.cellular.nidd: build_only: true platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - 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 + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns tags: ci_build diff --git a/samples/cellular/nrf_cloud_multi_service/CMakeLists.txt b/samples/cellular/nrf_cloud_multi_service/CMakeLists.txt index ed6b6dd35786..75563a53f7b3 100644 --- a/samples/cellular/nrf_cloud_multi_service/CMakeLists.txt +++ b/samples/cellular/nrf_cloud_multi_service/CMakeLists.txt @@ -22,6 +22,7 @@ target_sources(app PRIVATE src/temperature.c) target_sources(app PRIVATE src/fota_support.c) target_sources(app PRIVATE src/led_control.c) target_sources(app PRIVATE src/sample_reboot.c) +target_sources(app PRIVATE src/shadow_config.c) if(CONFIG_LOCATION_TRACKING) target_sources(app PRIVATE src/location_tracking.c) diff --git a/samples/cellular/nrf_cloud_multi_service/Kconfig b/samples/cellular/nrf_cloud_multi_service/Kconfig index c8ac239180df..67097c65a8f7 100644 --- a/samples/cellular/nrf_cloud_multi_service/Kconfig +++ b/samples/cellular/nrf_cloud_multi_service/Kconfig @@ -215,6 +215,8 @@ config GNSS_FIX_TIMEOUT_SECONDS config TEST_COUNTER bool "Sets whether the test counter is enabled" + help + When enabled, the test counter configuration setting in the shadow is ignored. config AT_CMD_REQUESTS depends on !NRF_CLOUD_COAP diff --git a/samples/cellular/nrf_cloud_multi_service/README.rst b/samples/cellular/nrf_cloud_multi_service/README.rst index 7a610102bcd9..075c23fc2540 100644 --- a/samples/cellular/nrf_cloud_multi_service/README.rst +++ b/samples/cellular/nrf_cloud_multi_service/README.rst @@ -181,17 +181,17 @@ This sample supports full modem FOTA for the nRF91 Series development kit. Version 0.14.0 or higher is required for nRF9160 DK. To enable full modem FOTA, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_full_modem_fota.conf`` +``-DEXTRA_CONF_FILE=overlay_full_modem_fota.conf`` Also, specify your development kit version by appending it to the board name. For example, if you are using an nRF9160 DK version 1.0.1, use the following board name in your build command: -``nrf9160dk_nrf9160_ns@1.0.1`` +``nrf9160dk@1.0.1/nrf9160/ns`` This sample also supports placement of the MCUboot secondary partition in external flash for the nRF91x1 DKs, and for nRF9160 DK version 0.14.0 and higher. To enable this, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_mcuboot_ext_flash.conf`` +``-DEXTRA_CONF_FILE=overlay_mcuboot_ext_flash.conf`` Then specify your development kit version as described earlier. @@ -204,7 +204,7 @@ Temperature sensing is mostly implemented in the :file:`src/temperature.c` file. This includes generation of false temperature readings on your nRF91 Series DK, which does not have a built-in temperature sensor. Using the built-in temperature sensor of the `Nordic Thingy:91`_ requires a `devicetree overlay `_ file, namely the :file:`boards/thingy91_nrf9160_ns.overlay` file, as well as enabling the Kconfig options :kconfig:option:`CONFIG_SENSOR` and :kconfig:option:`CONFIG_BME680`. -The devicetree overlay file is automatically applied during compilation whenever the ``thingy91_nrf9160_ns`` target is selected. +The devicetree overlay file is automatically applied during compilation whenever the ``thingy91/nrf9160/ns`` target is selected. The required Kconfig options are implicitly enabled by :ref:`CONFIG_TEMP_DATA_USE_SENSOR `. .. note:: @@ -238,12 +238,12 @@ This sample supports placing P-GPS data in external flash for the nRF91 Series d Version 0.14.0 or later is required for the nRF9160 DK. To enable this, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_pgps_ext_flash.conf`` +``-DEXTRA_CONF_FILE=overlay_pgps_ext_flash.conf`` Also, specify your development kit version by appending it to the board name. For example, if you are using an nRF9160 development kit version 1.0.1, use the following board name in your build command: -``nrf9160dk_nrf9160_ns@1.0.1`` +``nrf9160dk@1.0.1/nrf9160/ns`` .. _nrf_cloud_multi_service_remote_at: @@ -318,11 +318,23 @@ See :ref:`nrf_cloud_multi_service_led_third_party` for details on configuring LE Test counter ============ -You can enable a test counter by enabling the :ref:`CONFIG_TEST_COUNTER ` option. Every time a sensor sample is sent, this counter is incremented by one, and its current value is sent to `nRF Cloud`_. A plot of the value of the counter over time is automatically shown in the nRF Cloud portal. This plot is useful for tracking, visualizing, and debugging connection loss, resets, and re-establishment behavior. +You can enable or disable the test counter using the device shadow. +In the desired config section, set ``"counterEnable"`` to ``true`` to enable or ``false`` to disable the test counter. + +.. code-block:: json + + "desired": { + "config": { + "counterEnable": true + } + } + +You can perform the shadow update by clicking the :guilabel:`View Config` button on the **Device** page in the nRF Cloud portal or through the ``UpdateDeviceState`` endpoint in the `nRF Cloud Rest API`_. +To ignore the shadow setting so that the test counter is always active, enable the :ref:`CONFIG_TEST_COUNTER ` Kconfig option. .. _nrf_cloud_multi_service_device_message_formatting: @@ -428,9 +440,9 @@ To disable LED indication, enable the :ref:`CONFIG_LED_INDICATION_DISABLED ` for run-time credential installation. -If you are certain you understand the risks, you can configure your build to use Wi-Fi connectivity on the nRF5340 DK with the nRF7002 EK shield by using the ``--board nrf5340dk_nrf5340_cpuapp_ns`` target and the ``-DSHIELD=nrf7002ek`` and ``-DOVERLAY_CONFIG=overlay_nrf7002ek_wifi_no_lte.conf`` options. +If you are certain you understand the risks, you can configure your build to use Wi-Fi connectivity on the nRF5340 DK with the nRF7002 EK shield by using the ``--board nrf5340dk/nrf5340/cpuapp/ns`` target and the ``-DSHIELD=nrf7002ek`` and ``-DEXTRA_CONF_FILE=overlay_nrf7002ek_wifi_no_lte.conf`` options. You must also configure a (globally unique) device ID at build time by enabling the :kconfig:option:`CONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME` Kconfig option and setting :kconfig:option:`CONFIG_NRF_CLOUD_CLIENT_ID` to the device ID. @@ -831,13 +844,13 @@ For example, for a device with the device ID ``698d4c11-0ccc-4f04-89cd-6882724e3 .. code-block:: console - west build --board nrf5340dk_nrf5340_cpuapp_ns -p always -- -DSHIELD=nrf7002ek -DOVERLAY_CONFIG=overlay_nrf7002ek_wifi_no_lte.conf -DCONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y -DCONFIG_NRF_CLOUD_CLIENT_ID="698d4c11-0ccc-4f04-89cd-6882724e3f6f" + west build --board nrf5340dk/nrf5340/cpuapp/ns -p always -- -DSHIELD=nrf7002ek -DEXTRA_CONF_FILE=overlay_nrf7002ek_wifi_no_lte.conf -DCONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y -DCONFIG_NRF_CLOUD_CLIENT_ID="698d4c11-0ccc-4f04-89cd-6882724e3f6f" .. group-tab:: PowerShell .. code-block:: console - west build --board nrf5340dk_nrf5340_cpuapp_ns -p always -- -DSHIELD=nrf7002ek "-DOVERLAY_CONFIG=overlay_nrf7002ek_wifi_no_lte.conf" -DCONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y "-DCONFIG_NRF_CLOUD_CLIENT_ID=\`"698d4c11-0ccc-4f04-89cd-6882724e3f6f\`"" + west build --board nrf5340dk/nrf5340/cpuapp/ns -p always -- -DSHIELD=nrf7002ek "-DEXTRA_CONF_FILE=overlay_nrf7002ek_wifi_no_lte.conf" -DCONFIG_NRF_CLOUD_CLIENT_ID_SRC_COMPILE_TIME=y "-DCONFIG_NRF_CLOUD_CLIENT_ID=\`"698d4c11-0ccc-4f04-89cd-6882724e3f6f\`"" Once the sample is built and flashed, proceed to :ref:`nrf_cloud_multi_service_standard_onboarding` for instructions on how to onboard your device. @@ -920,7 +933,7 @@ Building with nRF Cloud logging support To enable transmission of `logs `_ to nRF Cloud using the :ref:`lib_nrf_cloud_log` library, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_nrfcloud_logging.conf`` +``-DEXTRA_CONF_FILE=overlay_nrfcloud_logging.conf`` This overlay enables transmission of `logs `_ to nRF Cloud. Set the :kconfig:option:`CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL` Kconfig option to the log level of messages to send to nRF Cloud, such as ``4`` for debug log messages. @@ -938,11 +951,11 @@ Building with minimal services To build the sample with only temperature tracking enabled for either MQTT or CoAP, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_min_mqtt.conf`` +``-DEXTRA_CONF_FILE=overlay_min_mqtt.conf`` or -``-DOVERLAY_CONFIG=overlay_min_coap.conf`` +``-DEXTRA_CONF_FILE=overlay_min_coap.conf`` These overlays show all the Kconfig settings changes needed to properly disable all but a single sensor. @@ -1139,7 +1152,7 @@ Then, complete the following steps for each device you wish to onboard: This script also installs any nRF Cloud root CA certificates required in a single chain to the :kconfig:option:`CONFIG_NRF_CLOUD_SEC_TAG` security tag (``sec_tag``). CoAP connections use one root CA certificate, whereas HTTPS and MQTT use another. - Devices using CoAP need both installed, since HTTPS is used for FOTA and PGPS on CoAP devices. + Devices using CoAP need both installed, since HTTPS is used for FOTA and P-GPS on CoAP devices. If the script succeeds, you should see the following output: diff --git a/samples/cellular/nrf_cloud_multi_service/overlay-nrf7002ek-wifi-scan-only.conf b/samples/cellular/nrf_cloud_multi_service/overlay-nrf7002ek-wifi-scan-only.conf index b2b5f803cec8..00ae4d811aca 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay-nrf7002ek-wifi-scan-only.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay-nrf7002ek-wifi-scan-only.conf @@ -22,6 +22,9 @@ CONFIG_WIFI_NRF700X_SKIP_LOCAL_ADMIN_MAC=y # Also see comments for CONFIG_HEAP_MEM_POOL_SIZE. CONFIG_NRF_WIFI_SCAN_MAX_BSS_CNT=20 CONFIG_NET_L2_ETHERNET=y +# We need 2 to ensure nrf91_socket gets an IP address regardless of order of net_if array +CONFIG_NET_IF_MAX_IPV4_COUNT=2 +CONFIG_NET_IF_MAX_IPV6_COUNT=2 # But disable the supplicant, since we don't need connectivity CONFIG_WPA_SUPP=n diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_coap_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_coap_no_lte.conf index f0e187046d63..6c5b7cce7985 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_coap_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_coap_no_lte.conf @@ -117,7 +117,6 @@ CONFIG_NRF_SECURITY=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_CONTEXT_SNDTIMEO=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_DHCPV4=y ## Configure native MBEDTLS @@ -158,7 +157,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=138000 ## Miscellaneous resource allocation tweaks needed to support Wi-Fi. CONFIG_MAIN_STACK_SIZE=2048 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=20 CONFIG_APPLICATION_THREAD_STACK_SIZE=3072 CONFIG_MESSAGE_THREAD_STACK_SIZE=3072 diff --git a/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_no_lte.conf b/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_no_lte.conf index b51127d5ad74..10f382d3d64f 100644 --- a/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_no_lte.conf +++ b/samples/cellular/nrf_cloud_multi_service/overlay_nrf7002ek_wifi_no_lte.conf @@ -119,7 +119,6 @@ CONFIG_NRF_SECURITY=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_CONTEXT_SNDTIMEO=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_DHCPV4=y ## Configure native MBEDTLS to support nRF Cloud MQTT @@ -156,7 +155,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=138000 ## Miscellaneous resource allocation tweaks needed to support Wi-Fi. CONFIG_MAIN_STACK_SIZE=2048 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD_STACK_SIZE=8192 CONFIG_APPLICATION_THREAD_STACK_SIZE=3072 CONFIG_MESSAGE_THREAD_STACK_SIZE=3072 diff --git a/samples/cellular/nrf_cloud_multi_service/sample.yaml b/samples/cellular/nrf_cloud_multi_service/sample.yaml index 45cc41739b8b..ed5d72734f4d 100644 --- a/samples/cellular/nrf_cloud_multi_service/sample.yaml +++ b/samples/cellular/nrf_cloud_multi_service/sample.yaml @@ -4,69 +4,69 @@ tests: sample.cellular.nrf_cloud_multi_service.mqtt: build_only: true platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - 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 + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns tags: ci_build sample.cellular.nrf_cloud_multi_service.mqtt.full: build_only: true - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: "EXTRA_CONF_FILE=\"overlay_full_modem_fota.conf;\ overlay_pgps_ext_flash.conf;overlay_mcuboot_ext_flash.conf\"" tags: ci_build sample.cellular.nrf_cloud_multi_service.mqtt.min: build_only: true - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay_min_mqtt.conf" tags: ci_build sample.cellular.nrf_cloud_multi_service.coap: build_only: true platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay_coap.conf" tags: ci_build sample.cellular.nrf_cloud_multi_service.coap.min: build_only: true - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: EXTRA_CONF_FILE="overlay_coap.conf;overlay_min_coap.conf" tags: ci_build sample.cellular.nrf7002ek_wifi.scan: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE="overlay-nrf7002ek-wifi-scan-only.conf" tags: ci_build sample.cellular.nrf7002ek_wifi.conn: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf5340dk_nrf5340_cpuapp_ns + - nrf5340dk/nrf5340/cpuapp/ns + platform_allow: nrf5340dk/nrf5340/cpuapp/ns extra_args: SHIELD=nrf7002ek EXTRA_CONF_FILE="overlay_nrf7002ek_wifi_no_lte.conf" tags: ci_build diff --git a/samples/cellular/nrf_cloud_multi_service/src/application.c b/samples/cellular/nrf_cloud_multi_service/src/application.c index 0f8596100208..0bc5651dd492 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/application.c +++ b/samples/cellular/nrf_cloud_multi_service/src/application.c @@ -25,6 +25,7 @@ #include "message_queue.h" #include "led_control.h" #include "at_commands.h" +#include "shadow_config.h" LOG_MODULE_REGISTER(application, CONFIG_MULTI_SERVICE_LOG_LEVEL); @@ -38,10 +39,13 @@ BUILD_ASSERT(CONFIG_AT_CMD_REQUEST_RESPONSE_BUFFER_LENGTH >= AT_CMD_REQUEST_ERR_ "Not enough AT command response buffer for printing error events."); /* Temperature alert limits. */ -#define TEMP_ALERT_LIMIT ((float)CONFIG_TEMP_ALERT_LIMIT) -#define TEMP_ALERT_HYSTERESIS 1.5f +#define TEMP_ALERT_LIMIT ((double)CONFIG_TEMP_ALERT_LIMIT) +#define TEMP_ALERT_HYSTERESIS 1.5 #define TEMP_ALERT_LOWER_LIMIT (TEMP_ALERT_LIMIT - TEMP_ALERT_HYSTERESIS) +/* State of the test counter. This can be changed using the configuration in the shadow */ +static bool test_counter_enabled; + /** * @brief Construct a device message object with automatically generated timestamp * @@ -183,7 +187,7 @@ static void on_location_update(const struct location_event_data * const location LOG_INF("Location Updated: %.06f N %.06f W, accuracy: %.01f m, Method: %s", location_data->location.latitude, location_data->location.longitude, - location_data->location.accuracy, + (double)location_data->location.accuracy, location_method_str(location_data->method)); /* If the position update was derived using GNSS, send it onward to nRF Cloud. */ @@ -371,7 +375,7 @@ void main_application_thread_fn(void) } } - if (IS_ENABLED(CONFIG_TEST_COUNTER)) { + if (test_counter_enable_get()) { LOG_INF("Sent test counter = %d", counter); (void)send_sensor_sample("COUNT", counter++); } @@ -380,3 +384,19 @@ void main_application_thread_fn(void) k_timer_status_sync(&sensor_sample_timer); } } + +void test_counter_enable_set(const bool enable) +{ + if (IS_ENABLED(CONFIG_TEST_COUNTER)) { + LOG_DBG("CONFIG_TEST_COUNTER is enabled, ignoring state change request"); + } else { + LOG_DBG("Test counter %s", enable ? "enabled" : "disabled"); + test_counter_enabled = enable; + } +} + +bool test_counter_enable_get(void) +{ + /* When CONFIG_TEST_COUNTER is enabled the test counter is always enabled */ + return (test_counter_enabled || IS_ENABLED(CONFIG_TEST_COUNTER)); +} diff --git a/samples/cellular/nrf_cloud_multi_service/src/application.h b/samples/cellular/nrf_cloud_multi_service/src/application.h index 4c685e6aa673..46c227f6c02a 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/application.h +++ b/samples/cellular/nrf_cloud_multi_service/src/application.h @@ -20,4 +20,7 @@ */ void main_application_thread_fn(void); +void test_counter_enable_set(const bool enable); +bool test_counter_enable_get(void); + #endif /* _APPLICATION_H_ */ 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 9095da21acc7..0dae086346b1 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c +++ b/samples/cellular/nrf_cloud_multi_service/src/cloud_connection.c @@ -22,6 +22,7 @@ #include "fota_support.h" #include "location_tracking.h" #include "led_control.h" +#include "shadow_config.h" LOG_MODULE_REGISTER(cloud_connection, CONFIG_MULTI_SERVICE_LOG_LEVEL); @@ -116,6 +117,8 @@ static void cloud_connected(void) { LOG_INF("Connected to nRF Cloud"); + shadow_config_cloud_connected(); + /* Notify that the nRF Cloud connection is established. */ k_event_post(&cloud_events, CLOUD_CONNECTED); } @@ -317,15 +320,26 @@ static void handle_shadow_event(struct nrf_cloud_obj_shadow_data *const shadow) int err; - if (shadow->type == NRF_CLOUD_OBJ_SHADOW_TYPE_DELTA) { + if ((shadow->type == NRF_CLOUD_OBJ_SHADOW_TYPE_DELTA) && shadow->delta) { LOG_DBG("Shadow: Delta - version: %d, timestamp: %lld", shadow->delta->ver, shadow->delta->ts); - /* Always accept since this sample, by default, - * doesn't have any application specific shadow handling - */ - err = nrf_cloud_obj_shadow_delta_response_encode(&shadow->delta->state, true); + bool accept = true; + + err = shadow_config_delta_process(&shadow->delta->state); + if (err == -EBADF) { + LOG_INF("Rejecting shadow delta"); + accept = false; + } else if (err == -ENOMEM) { + LOG_ERR("Error handling shadow delta"); + return; + } else if (err == -EAGAIN) { + LOG_ERR("Ignoring delta until accepted shadow is received"); + return; + } + + err = nrf_cloud_obj_shadow_delta_response_encode(&shadow->delta->state, accept); if (err) { LOG_ERR("Failed to encode shadow response: %d", err); return; @@ -335,8 +349,14 @@ static void handle_shadow_event(struct nrf_cloud_obj_shadow_data *const shadow) if (err) { LOG_ERR("Failed to send shadow response, error: %d", err); } - } else if (shadow->type == NRF_CLOUD_OBJ_SHADOW_TYPE_ACCEPTED) { + + } else if ((shadow->type == NRF_CLOUD_OBJ_SHADOW_TYPE_ACCEPTED) && shadow->accepted) { LOG_DBG("Shadow: Accepted"); + err = shadow_config_accepted_process(&shadow->accepted->config); + if (err) { + /* Send the config on an error */ + (void)shadow_config_reported_send(); + } } } diff --git a/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c new file mode 100644 index 000000000000..ec2313a6753a --- /dev/null +++ b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c @@ -0,0 +1,201 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include "shadow_config.h" +#if defined(CONFIG_NRF_CLOUD_COAP) +#include "shadow_support_coap.h" +#endif +#include "application.h" + +LOG_MODULE_REGISTER(shadow_config, CONFIG_MULTI_SERVICE_LOG_LEVEL); + +#define TEST_COUNTER_EN "counterEnable" + +/* Flag to indicate that the accepted shadow data has been received (MQTT only) */ +static bool accepted_rcvd; + +static int add_cfg_data(struct nrf_cloud_obj *const cfg_obj) +{ + /* Add the test counter state */ + return nrf_cloud_obj_bool_add(cfg_obj, TEST_COUNTER_EN, test_counter_enable_get(), false); +} + +static int process_cfg(struct nrf_cloud_obj *const cfg_obj) +{ + bool val; + int err = nrf_cloud_obj_bool_get(cfg_obj, TEST_COUNTER_EN, &val); + + if (err == 0) { + /* The expected key/value was found, set the test counter enable state */ + test_counter_enable_set(val); + } else if (err == -ENOMSG) { + /* The key was found, but the value was not a boolean */ + LOG_WRN("Invalid configuration value"); + /* Reject the config */ + err = -EBADF; + } else { + LOG_DBG("Expected data not found in config object"); + err = -ENOMSG; + } + + return err; +} + +static int send_config(void) +{ + int err; + + NRF_CLOUD_OBJ_JSON_DEFINE(root_obj); + NRF_CLOUD_OBJ_JSON_DEFINE(state_obj); + NRF_CLOUD_OBJ_JSON_DEFINE(reported_obj); + NRF_CLOUD_OBJ_JSON_DEFINE(cfg_obj); + + if (nrf_cloud_obj_init(&cfg_obj) || nrf_cloud_obj_init(&reported_obj) || + nrf_cloud_obj_init(&state_obj) || nrf_cloud_obj_init(&root_obj)) { + err = -ENOMEM; + goto cleanup; + } + + /* Add the supported configuration data */ + err = add_cfg_data(&cfg_obj); + if (err) { + goto cleanup; + } + +#if defined(CONFIG_NRF_CLOUD_MQTT) + + /* Add config to reported */ + err = nrf_cloud_obj_object_add(&reported_obj, NRF_CLOUD_JSON_KEY_CFG, &cfg_obj, false); + if (err) { + goto cleanup; + } + + /* Add reported to state */ + err = nrf_cloud_obj_object_add(&state_obj, NRF_CLOUD_JSON_KEY_REP, &reported_obj, false); + if (err) { + goto cleanup; + } + + /* Add state to the root object */ + err = nrf_cloud_obj_object_add(&root_obj, NRF_CLOUD_JSON_KEY_STATE, &state_obj, false); + if (err) { + goto cleanup; + } + + /* Send to the cloud */ + err = nrf_cloud_obj_shadow_update(&root_obj); +#else /* CONFIG_NRF_CLOUD_COAP */ + + /* Add config to root */ + err = nrf_cloud_obj_object_add(&root_obj, NRF_CLOUD_JSON_KEY_CFG, &cfg_obj, false); + if (err) { + goto cleanup; + } + + err = shadow_support_coap_obj_send(&root_obj, false); +#endif + +cleanup: + nrf_cloud_obj_free(&root_obj); + nrf_cloud_obj_free(&state_obj); + nrf_cloud_obj_free(&reported_obj); + nrf_cloud_obj_free(&cfg_obj); + return err; +} + +void shadow_config_cloud_connected(void) +{ + accepted_rcvd = false; +} + +int shadow_config_reported_send(void) +{ + LOG_INF("Sending reported configuration"); + + int err = send_config(); + + if (err) { + LOG_ERR("Failed to send configuration, error: %d", err); + } + + return err; +} + +int shadow_config_delta_process(struct nrf_cloud_obj *const delta_obj) +{ + if (!delta_obj) { + return -EINVAL; + } + + if ((delta_obj->type != NRF_CLOUD_OBJ_TYPE_JSON) || !delta_obj->json) { + /* No state JSON */ + return -ENOMSG; + } + + /* If there is a pending delta event when the device establishes a cloud connection + * it is possible that it will be received before the accepted shadow data. + * Do not process a delta event until the accepted shadow data has been received. + * This is only a concern for MQTT. + */ + if (!accepted_rcvd && IS_ENABLED(CONFIG_NRF_CLOUD_MQTT)) { + return -EAGAIN; + } + + int err; + + NRF_CLOUD_OBJ_JSON_DEFINE(cfg_obj); + + /* Get the config object */ + err = nrf_cloud_obj_object_detach(delta_obj, NRF_CLOUD_JSON_KEY_CFG, &cfg_obj); + if (err == -ENODEV) { + /* No config in the delta */ + return -ENOMSG; + } + + /* Process the configuration */ + err = process_cfg(&cfg_obj); + + if (err == -EBADF) { + /* Clear incoming config and replace it with a good one */ + nrf_cloud_obj_free(&cfg_obj); + nrf_cloud_obj_init(&cfg_obj); + if (add_cfg_data(&cfg_obj)) { + LOG_ERR("Failed to create delta response"); + } + } + + /* Add the config object back into the state so the response can be sent */ + if (nrf_cloud_obj_object_add(delta_obj, NRF_CLOUD_JSON_KEY_CFG, &cfg_obj, false)) { + nrf_cloud_obj_free(&cfg_obj); + return -ENOMEM; + } + + return err; +} + +int shadow_config_accepted_process(struct nrf_cloud_obj *const accepted_obj) +{ + if (!accepted_obj) { + return -EINVAL; + } + + if ((accepted_obj->type != NRF_CLOUD_OBJ_TYPE_JSON) || !accepted_obj->json) { + /* No config JSON */ + return -ENOMSG; + } + + int err = process_cfg(accepted_obj); + + if (err == 0) { + accepted_rcvd = true; + } + + return err; +} diff --git a/samples/cellular/nrf_cloud_multi_service/src/shadow_config.h b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.h new file mode 100644 index 000000000000..5ef2daef51d1 --- /dev/null +++ b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef _SHADOW_CONFIG_H_ +#define _SHADOW_CONFIG_H_ + +#include +#include + + +/** + * @brief For MQTT, this function should be called when the NRF_CLOUD_EVT_TRANSPORT_CONNECTED + * event is received. + */ +void shadow_config_cloud_connected(void); + +/** + * @brief Send the reported device configuration. + * + * @return 0 on success, otherwise negative on error. + */ +int shadow_config_reported_send(void); + +/** + * @brief Process an incoming delta event. + * + * @retval 0 Success, accept the delta. + * @retval -EBADF Invalid config data, reject the delta. + * @retval -ENOMSG The provided data did not contain JSON or a config section. + * @retval -EAGAIN Ignore delta event until the accepted shadow is received. MQTT only. + * @retval -EINVAL Error; Invalid parameter. + * @retval -ENOMEM Error; out of memory. + */ +int shadow_config_delta_process(struct nrf_cloud_obj *const delta_obj); + +/** + * @brief Process an incoming accepted shadow event. + * + * @retval 0 Success. + * @retval -EBADF Invalid config data. + * @retval -ENOMSG The provided data did not contain JSON or the expected config data. + * @retval -EINVAL Error; Invalid parameter. + * @return A negative value indicates an error, the device should send its current config to + * the reported section of the shadow. + */ +int shadow_config_accepted_process(struct nrf_cloud_obj *const accepted_obj); + +#endif /* _SHADOW_CONFIG_H_ */ diff --git a/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.c b/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.c index 2c296d367951..371792fd4d9b 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.c +++ b/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.c @@ -15,26 +15,67 @@ #include "cloud_connection.h" #include "shadow_support_coap.h" +#include "shadow_config.h" LOG_MODULE_REGISTER(shadow_support_coap, CONFIG_MULTI_SERVICE_LOG_LEVEL); #define COAP_SHADOW_MAX_SIZE 512 +static int process_delta(struct nrf_cloud_data *const delta) +{ + int err; + bool update_desired = false; + struct nrf_cloud_obj delta_obj = {0}; + + LOG_DBG("Shadow delta: len:%zd, %s", delta->len, (const char *)delta->ptr); + + err = nrf_cloud_coap_shadow_delta_process(delta, &delta_obj); + if (err < 0) { + LOG_ERR("Failed to process shadow delta, err: %d", err); + return -EIO; + } else if (err == 0) { + /* No application specific delta data */ + return -ENODATA; + } + + /* There is an application specific shadow delta to process. + * This application only needs to deal with the configuration section. + */ + err = shadow_config_delta_process(&delta_obj); + if (err == -EBADF) { + LOG_INF("Rejecting shadow delta"); + update_desired = true; + } else if (err == -ENOMEM) { + LOG_ERR("Error handling shadow delta"); + return err; + } + + /* Reject the delta by updating desired. + * Accept the delta by updating reported. + */ + err = shadow_support_coap_obj_send(&delta_obj, update_desired); + + if (err) { + LOG_ERR("Failed to send shadow delta update, err: %d", err); + err = -EFAULT; + } + + return err; +} + static int check_shadow(void) { + /* Ensure the config is sent once */ + static bool config_sent; + int err; - char buf[COAP_SHADOW_MAX_SIZE]; + char buf[COAP_SHADOW_MAX_SIZE] = {0}; struct nrf_cloud_data in_data = { .ptr = buf }; - struct nrf_cloud_obj delta_obj = {0}; - - /* Wait until we are able to communicate. */ - LOG_DBG("Waiting for valid connection before checking shadow"); - (void)await_cloud_ready(K_FOREVER); - buf[0] = '\0'; LOG_INF("Checking for shadow delta..."); + err = nrf_cloud_coap_shadow_get(buf, sizeof(buf), true); if (err == -EACCES) { LOG_DBG("Not connected yet."); @@ -45,49 +86,54 @@ static int check_shadow(void) } in_data.len = strlen(buf); - if (!in_data.len) { - LOG_INF("Checking again in %d seconds", - CONFIG_COAP_SHADOW_CHECK_RATE_SECONDS); - return -EAGAIN; + if (in_data.len) { + err = process_delta(&in_data); + if (err == -ENODATA) { + /* There was no application specific delta data to process. + * Return -EAGAIN so the thread sleeps for a longer duration. + */ + err = -EAGAIN; + } } - LOG_DBG("Shadow delta: len:%zd, %s", in_data.len, buf); - - err = nrf_cloud_coap_shadow_delta_process(&in_data, &delta_obj); - if (err == 1) { - /* There is an application specific shadow delta to process */ - - /* --- Process application's delta data here --- */ - - /* To clear the delta, we will just accept the delta by - * updating the shadow state with the received data. - * - * Encode the delta to send to the cloud + if (!config_sent) { + /* If the config needs to be sent, return so that the thread sleeps + * for a shorter duration. */ - err = nrf_cloud_obj_cloud_encode(&delta_obj); - - /* Free the object */ - (void)nrf_cloud_obj_free(&delta_obj); - - if (!err) { - /* Send the encoded data */ - err = nrf_cloud_coap_shadow_state_update(delta_obj.encoded_data.ptr); + if (shadow_config_reported_send() == 0) { + config_sent = true; + return 0; } else { - LOG_ERR("Failed to encode cloud data, err: %d", err); - return err; + return -EIO; } + } - if (err) { - LOG_ERR("Failed to send shadow delta update, err: %d", err); - } + return err; +} - /* Free the encoded data */ - (void)nrf_cloud_obj_cloud_encoded_free(&delta_obj); +int shadow_support_coap_obj_send(struct nrf_cloud_obj *const shadow_obj, const bool desired) +{ + /* Encode the data for the cloud */ + int err = nrf_cloud_obj_cloud_encode(shadow_obj); - } else if (err < 0) { - LOG_ERR("Failed to process shadow delta, err: %d", err); + /* Free the object */ + (void)nrf_cloud_obj_free(shadow_obj); + + if (!err) { + /* Send the encoded data */ + if (desired) { + err = nrf_cloud_coap_shadow_desired_update(shadow_obj->encoded_data.ptr); + } else { + err = nrf_cloud_coap_shadow_state_update(shadow_obj->encoded_data.ptr); + } + } else { + LOG_ERR("Failed to encode cloud data, err: %d", err); + return err; } + /* Free the encoded data */ + (void)nrf_cloud_obj_cloud_encoded_free(shadow_obj); + return err; } @@ -98,8 +144,16 @@ int coap_shadow_thread_fn(void) int err; while (1) { + /* Wait until we are able to communicate. */ + if (!await_cloud_ready(K_NO_WAIT)) { + LOG_DBG("Waiting for valid connection before checking shadow"); + (void)await_cloud_ready(K_FOREVER); + } + err = check_shadow(); if (err == -EAGAIN) { + LOG_INF("Checking shadow again in %d seconds", + CONFIG_COAP_SHADOW_CHECK_RATE_SECONDS); k_sleep(K_SECONDS(CONFIG_COAP_SHADOW_CHECK_RATE_SECONDS)); } else { k_sleep(K_SECONDS(SHADOW_THREAD_DELAY_S)); diff --git a/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.h b/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.h index d4c8210ad8d2..3ff7eab398e3 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.h +++ b/samples/cellular/nrf_cloud_multi_service/src/shadow_support_coap.h @@ -7,6 +7,8 @@ #ifndef SHADOW_SUPPORT_COAP_H #define SHADOW_SUPPORT_COAP_H +int shadow_support_coap_obj_send(struct nrf_cloud_obj *const shadow_obj, const bool desired); + int coap_shadow_thread_fn(void); #endif /* SHADOW_SUPPORT_COAP_H */ diff --git a/samples/cellular/nrf_cloud_rest_cell_location/Kconfig b/samples/cellular/nrf_cloud_rest_cell_location/Kconfig index f3b1b75bc39f..f743b5095f3d 100644 --- a/samples/cellular/nrf_cloud_rest_cell_location/Kconfig +++ b/samples/cellular/nrf_cloud_rest_cell_location/Kconfig @@ -41,6 +41,10 @@ config REST_CELL_DEFAULT_FALLBACK_VAL config REST_CELL_DEFAULT_HICONF_VAL bool "Default value for the hi_conf configuration flag" +config REST_CELL_SEND_DEVICE_STATUS + bool "Send device status to nRF Cloud on initial connection" + default y + endmenu menu "Zephyr Kernel" diff --git a/samples/cellular/nrf_cloud_rest_cell_location/README.rst b/samples/cellular/nrf_cloud_rest_cell_location/README.rst index d5519da085e9..43b3a14d8e0c 100644 --- a/samples/cellular/nrf_cloud_rest_cell_location/README.rst +++ b/samples/cellular/nrf_cloud_rest_cell_location/README.rst @@ -53,13 +53,6 @@ If you have the option :ref:`CONFIG_REST_CELL_LOCATION_DO_JITP ` Kconfig config value to try all combinations of the :c:struct:`nrf_cloud_location_config` structure values ``hi_conf`` and ``fallback``. @@ -100,6 +93,11 @@ CONFIG_REST_CELL_DEFAULT_FALLBACK_VAL - Enable fallback to coarse location CONFIG_REST_CELL_DEFAULT_HICONF_VAL - Enable high confidence result Enable a 95% confidence interval for the location, instead of the default 68%. +.. _CONFIG_REST_CELL_SEND_DEVICE_STATUS: + +CONFIG_REST_CELL_SEND_DEVICE_STATUS - Send device status + Send device status to nRF Cloud on initial connection. + .. 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 diff --git a/samples/cellular/nrf_cloud_rest_cell_location/sample.yaml b/samples/cellular/nrf_cloud_rest_cell_location/sample.yaml index 5af63fbbac39..38d1969c69ff 100644 --- a/samples/cellular/nrf_cloud_rest_cell_location/sample.yaml +++ b/samples/cellular/nrf_cloud_rest_cell_location/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.nrf_cloud_rest_cell_pos: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build 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 5b7a47156ee3..472b9b3b686a 100644 --- a/samples/cellular/nrf_cloud_rest_cell_location/src/main.c +++ b/samples/cellular/nrf_cloud_rest_cell_location/src/main.c @@ -114,11 +114,6 @@ static enum lte_lc_rrc_mode cur_rrc_mode = LTE_LC_RRC_MODE_IDLE; /* Flag to indicate that a neighbor cell measurement should be taken once RRC mode is idle */ static bool rrc_idle_wait; -/* Flag to indicate if the device shadow should be updated so that the location card - * is displayed on nrfcloud.com - */ -static bool location_card_enable; - #if defined(CONFIG_REST_CELL_LOCATION_DO_JITP) /* Flag to indicate if the user requested JITP to be performed */ static bool jitp_requested; @@ -334,8 +329,6 @@ static void request_jitp(void) if (err == 0) { jitp_requested = true; LOG_INF("JITP will be performed after network connection is obtained"); - /* Enable the location card for a newly JITP'd device */ - location_card_enable = true; } else { if (err != -EAGAIN) { LOG_ERR("k_sem_take error: %d", err); @@ -367,52 +360,10 @@ static void do_jitp(void) } #endif -#define REQ_CARD "---> Press button %d to enable the location card for this device on nrfcloud.com" -static void request_location_card_enable(void) -{ - if (!location_card_enable) { - int err; - - k_sem_reset(&button_press_sem); - - LOG_INF(REQ_CARD, BTN_NUM); - LOG_INF(" This only needs to be done once per device"); - LOG_INF(" Waiting %d seconds...", UI_REQ_WAIT_SEC); - - err = k_sem_take(&button_press_sem, K_SECONDS(UI_REQ_WAIT_SEC)); - - if (err == 0) { - location_card_enable = true; - } else { - if (err != -EAGAIN) { - LOG_ERR("k_sem_take error: %d", err); - } - } - } - - if (location_card_enable) { - LOG_INF("Location card will be enabled after network connection is obtained"); - } else { - LOG_INF("Location card will not be enabled"); - } -} - -static void do_location_card_enable(void) +static void send_device_status(void) { int err; - struct nrf_cloud_svc_info_ui ui = { - .gnss = 1, - .log = IS_ENABLED(CONFIG_NRF_CLOUD_LOG_BACKEND) && - IS_ENABLED(CONFIG_LOG_BACKEND_NRF_CLOUD_OUTPUT_TEXT), - .dictionary_log = IS_ENABLED(CONFIG_NRF_CLOUD_LOG_BACKEND) && - IS_ENABLED(CONFIG_LOG_BACKEND_NRF_CLOUD_OUTPUT_DICTIONARY) - }; - struct nrf_cloud_svc_info svc_inf = { - .fota = NULL, - .ui = &ui - }; - struct nrf_cloud_modem_info mdm_inf = { /* Include all available modem info. Change to NRF_CLOUD_INFO_NO_CHANGE to * reduce the volume of data transmitted. @@ -428,7 +379,8 @@ static void do_location_card_enable(void) struct nrf_cloud_device_status dev_status = { .modem = &mdm_inf, - .svc = &svc_inf, + /* Deprecated: The service info "ui" section is no longer used by nRF Cloud */ + .svc = NULL, .conn_inf = NRF_CLOUD_INFO_SET }; @@ -437,12 +389,11 @@ static void do_location_card_enable(void) */ rest_ctx.keep_alive = true; - LOG_INF("Enabling location card..."); err = nrf_cloud_rest_shadow_device_status_update(&rest_ctx, device_id, &dev_status); if (err) { - LOG_ERR("Failed to enable location card, error: %d", err); + LOG_ERR("Failed to send device status, error: %d", err); } else { - LOG_INF("Location card enabled in device shadow"); + LOG_INF("Device status sent to nRF Cloud"); } /* Set keep alive to false so the connection is closed after the initial @@ -610,9 +561,6 @@ static void connect_to_network(void) k_sleep(K_FOREVER); } - /* While waiting, ask about the location card */ - request_location_card_enable(); - err = k_sem_take(<e_connected_sem, K_MINUTES(NET_CONN_WAIT_MIN)); if (err == 0) { LOG_INF("Connected to network"); @@ -670,8 +618,12 @@ int main(void) do_jitp(); } #endif - if (location_card_enable) { - do_location_card_enable(); + + /* Send the device status which contains HW/FW version info and + * details about the network connection. + */ + if (IS_ENABLED(CONFIG_REST_CELL_SEND_DEVICE_STATUS)) { + send_device_status(); } /* Initialized, connected, and ready to send cellular location requests */ diff --git a/samples/cellular/nrf_cloud_rest_device_message/CMakeLists.txt b/samples/cellular/nrf_cloud_rest_device_message/CMakeLists.txt index bcb87c44c5c0..01e5843d2f52 100644 --- a/samples/cellular/nrf_cloud_rest_device_message/CMakeLists.txt +++ b/samples/cellular/nrf_cloud_rest_device_message/CMakeLists.txt @@ -15,7 +15,7 @@ zephyr_include_directories(include/) # NORDIC SDK APP START # Add include directory for board specific CAF def files zephyr_include_directories( - include/${BOARD} + include/${NORMALIZED_BOARD_TARGET} ) target_sources(app PRIVATE src/main.c) # NORDIC SDK APP END diff --git a/samples/cellular/nrf_cloud_rest_device_message/README.rst b/samples/cellular/nrf_cloud_rest_device_message/README.rst index e1adca74617c..11025eb077b4 100644 --- a/samples/cellular/nrf_cloud_rest_device_message/README.rst +++ b/samples/cellular/nrf_cloud_rest_device_message/README.rst @@ -134,7 +134,7 @@ nRF Cloud logging overlay To enable `Zephyr Logging`_ to nRF Cloud using the :ref:`lib_nrf_cloud_log` library, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_nrfcloud_logging.conf`` +``-DEXTRA_CONF_FILE=overlay_nrfcloud_logging.conf`` This overlay allows the sample and various subsystems that have logging enabled to send their logs to nRF Cloud. Set the :kconfig:option:`CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL` option to the log level of messages to send to nRF Cloud, such as ``4`` for debug log messages. @@ -148,7 +148,7 @@ Remote provisioning overlay This overlay is for use with nRF91x1-based devices only. To enable remote provisioning with the `nRF Cloud Provisioning Service`_ add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay-nrf_provisioning.conf`` +``-DEXTRA_CONF_FILE=overlay-nrf_provisioning.conf`` This overlay enables the :ref:`lib_nrf_provisioning` library and its provisioning shell. It configures the device ID to use the UUID format, not the legacy 'nrf-\ *IMEI*\ ' format. diff --git a/samples/cellular/nrf_cloud_rest_device_message/sample.yaml b/samples/cellular/nrf_cloud_rest_device_message/sample.yaml index 343ce6569c29..797c937375b0 100644 --- a/samples/cellular/nrf_cloud_rest_device_message/sample.yaml +++ b/samples/cellular/nrf_cloud_rest_device_message/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.nrf_cloud_rest_device_message: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/nrf_cloud_rest_fota/README.rst b/samples/cellular/nrf_cloud_rest_fota/README.rst index 9af04ae3d176..072e9be3bc51 100644 --- a/samples/cellular/nrf_cloud_rest_fota/README.rst +++ b/samples/cellular/nrf_cloud_rest_fota/README.rst @@ -104,14 +104,14 @@ See :ref:`configure_application` for information on how to configure the paramet To create a FOTA test version of this sample, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_fota_test.conf`` +``-DEXTRA_CONF_FILE=overlay_fota_test.conf`` To enable full modem FOTA, add the following parameter to your build command: -``-DOVERLAY_CONFIG=overlay_full_modem_fota.conf`` +``-DEXTRA_CONF_FILE=overlay_full_modem_fota.conf`` Also, if you are using an nRF9160 DK, specify your development kit version by appending it to the board name. -For example, if you are using version 1.0.1, use the board name ``nrf9160dk_nrf9160_ns@1_0_1`` in your build command. +For example, if you are using version 1.0.1, use the board name ``nrf9160dk@1.0.1/nrf9160/ns`` in your build command. Dependencies ************ diff --git a/samples/cellular/nrf_cloud_rest_fota/sample.yaml b/samples/cellular/nrf_cloud_rest_fota/sample.yaml index 76224cf1d8f2..e86b5fa760fa 100644 --- a/samples/cellular/nrf_cloud_rest_fota/sample.yaml +++ b/samples/cellular/nrf_cloud_rest_fota/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.nrf_cloud_rest_fota: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/nrf_cloud_rest_fota/src/main.c b/samples/cellular/nrf_cloud_rest_fota/src/main.c index 3d87bdc9f11e..81dc21a311eb 100644 --- a/samples/cellular/nrf_cloud_rest_fota/src/main.c +++ b/samples/cellular/nrf_cloud_rest_fota/src/main.c @@ -206,7 +206,7 @@ static void send_device_status(void) struct nrf_cloud_svc_info svc_inf = { .fota = &fota, - /* No UI components are required for this sample */ + /* Deprecated: The "ui" section is no longer used by nRF Cloud */ .ui = NULL }; diff --git a/samples/cellular/nrf_provisioning/sample.yaml b/samples/cellular/nrf_provisioning/sample.yaml index 356f6b4562c6..51130eb4b106 100644 --- a/samples/cellular/nrf_provisioning/sample.yaml +++ b/samples/cellular/nrf_provisioning/sample.yaml @@ -4,9 +4,9 @@ tests: sample.cellular.nrf_provisioning: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns diff --git a/samples/cellular/pdn/sample.yaml b/samples/cellular/pdn/sample.yaml index af73e3716057..ac0a70fb33c3 100644 --- a/samples/cellular/pdn/sample.yaml +++ b/samples/cellular/pdn/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.pdn: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/slm_shell/sample.yaml b/samples/cellular/slm_shell/sample.yaml index 8fd05f14d507..641c407a1a12 100644 --- a/samples/cellular/slm_shell/sample.yaml +++ b/samples/cellular/slm_shell/sample.yaml @@ -5,8 +5,8 @@ tests: sample.cellular.slm_shell: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/cellular/smp_svr/README.rst b/samples/cellular/smp_svr/README.rst index 77e9c5796ffb..cea969ed606a 100644 --- a/samples/cellular/smp_svr/README.rst +++ b/samples/cellular/smp_svr/README.rst @@ -73,14 +73,14 @@ MCUboot recovery mode .. code-block:: console - west build --pristine -b nrf9160dk_nrf52840 -- -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_recovery.overlay" + west build --pristine -b nrf9160dk/nrf52840 -- -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_recovery.overlay" MCUmgr server image management ============================== .. code-block:: console - west build --pristine -b nrf9160dk_nrf52840 -- -DOVERLAY_CONFIG="overlay-serial.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_mcumgr_srv.overlay" + west build --pristine -b nrf9160dk/nrf52840 -- -DEXTRA_CONF_FILE="overlay-serial.conf" -DEXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_mcumgr_srv.overlay" Testing ======= diff --git a/samples/cellular/smp_svr/child_image/mcuboot/boards/nrf9160dk_nrf52840_0_14_0.overlay b/samples/cellular/smp_svr/child_image/mcuboot/boards/nrf9160dk_nrf52840_0_14_0.overlay index 7e6adccaf708..15ee78895bdf 100644 --- a/samples/cellular/smp_svr/child_image/mcuboot/boards/nrf9160dk_nrf52840_0_14_0.overlay +++ b/samples/cellular/smp_svr/child_image/mcuboot/boards/nrf9160dk_nrf52840_0_14_0.overlay @@ -3,8 +3,8 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include -#include +#include +#include / { board-control { diff --git a/samples/cellular/smp_svr/nrf9160dk_nrf52840_mcumgr_srv.overlay b/samples/cellular/smp_svr/nrf9160dk_nrf52840_mcumgr_srv.overlay index e96421a1e680..e9d5eb497619 100644 --- a/samples/cellular/smp_svr/nrf9160dk_nrf52840_mcumgr_srv.overlay +++ b/samples/cellular/smp_svr/nrf9160dk_nrf52840_mcumgr_srv.overlay @@ -4,7 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include &pinctrl { uart1_default: uart1_default { diff --git a/samples/cellular/smp_svr/sample.yaml b/samples/cellular/smp_svr/sample.yaml index 75a3769e9271..2e224c2e3c7f 100644 --- a/samples/cellular/smp_svr/sample.yaml +++ b/samples/cellular/smp_svr/sample.yaml @@ -4,7 +4,7 @@ tests: sample.cellular.smp_svr: build_only: true integration_platforms: - - nrf9160dk_nrf52840 - platform_allow: nrf9160dk_nrf52840 + - nrf9160dk/nrf52840 + platform_allow: nrf9160dk/nrf52840 extra_args: EXTRA_DTC_OVERLAY_FILE="nrf9160dk_nrf52840_mcumgr_srv.overlay" tags: ci_build diff --git a/samples/cellular/sms/sample.yaml b/samples/cellular/sms/sample.yaml index ed657506c8f9..4ef284d7108c 100644 --- a/samples/cellular/sms/sample.yaml +++ b/samples/cellular/sms/sample.yaml @@ -4,11 +4,11 @@ tests: sample.cellular.sms: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build diff --git a/samples/cellular/udp/sample.yaml b/samples/cellular/udp/sample.yaml index 1c8d41090da7..e5fd7c413f94 100644 --- a/samples/cellular/udp/sample.yaml +++ b/samples/cellular/udp/sample.yaml @@ -4,14 +4,14 @@ tests: sample.cellular.udp: build_only: true integration_platforms: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns tags: ci_build diff --git a/samples/cellular/udp/src/main.c b/samples/cellular/udp/src/main.c index 92a6b5c63443..88710683151e 100644 --- a/samples/cellular/udp/src/main.c +++ b/samples/cellular/udp/src/main.c @@ -108,7 +108,7 @@ static void lte_handler(const struct lte_lc_evt *const evt) break; case LTE_LC_EVT_EDRX_UPDATE: printk("eDRX parameter update: eDRX: %.2f s, PTW: %.2f s\n", - evt->edrx_cfg.edrx, evt->edrx_cfg.ptw); + (double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw); break; case LTE_LC_EVT_RRC_UPDATE: printk("RRC mode: %s\n", diff --git a/samples/crypto/aes_cbc/sample.yaml b/samples/crypto/aes_cbc/sample.yaml index e17b1237f3f1..331a5ba4ecde 100644 --- a/samples/crypto/aes_cbc/sample.yaml +++ b/samples/crypto/aes_cbc/sample.yaml @@ -4,24 +4,35 @@ sample: using AES CBC mode name: AES CBC example tests: - sample.aes_cbc: + sample.aes_cbc.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.aes_cbc.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/aes_ccm/sample.yaml b/samples/crypto/aes_ccm/sample.yaml index cebb55e73743..43e77168ae76 100644 --- a/samples/crypto/aes_ccm/sample.yaml +++ b/samples/crypto/aes_ccm/sample.yaml @@ -4,24 +4,35 @@ sample: using AES CCM mode name: AES CCM example tests: - sample.aes_ccm: + sample.aes_ccm.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.aes_ccm.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/aes_ctr/sample.yaml b/samples/crypto/aes_ctr/sample.yaml index 9b8d8778e09f..cfb0bffc1121 100644 --- a/samples/crypto/aes_ctr/sample.yaml +++ b/samples/crypto/aes_ctr/sample.yaml @@ -4,24 +4,35 @@ sample: using AES CTR mode name: AES CTR example tests: - sample.aes_ctr: + sample.aes_ctr.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.aes_ctr.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/aes_gcm/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/aes_gcm/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index a9836ba44b36..000000000000 --- a/samples/crypto/aes_gcm/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -# Using hardware crypto accelerator -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y diff --git a/samples/crypto/aes_gcm/sample.yaml b/samples/crypto/aes_gcm/sample.yaml index 02e5d69f8b80..3957e9cf9603 100644 --- a/samples/crypto/aes_gcm/sample.yaml +++ b/samples/crypto/aes_gcm/sample.yaml @@ -7,37 +7,44 @@ tests: sample.aes_gcm.cc312: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp - nrf52840dk_nrf52840 nrf9160dk_nrf9160_ns nrf9160dk_nrf9160 nrf9161dk_nrf9161 - nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp harness: console harness_config: type: multi_line regex: - .*Example finished successfully!.* integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp sample.aes_gcm.oberon: tags: introduction psa oberon platform_allow: > - nrf54h20pdk_nrf54h20_cpuapp - nrf54l15pdk_nrf54l15_cpuapp - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp - nrf52840dk_nrf52840 nrf9160dk_nrf9160_ns nrf9160dk_nrf9160 - nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns + nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + nrf9160dk/nrf9160/ns nrf9160dk/nrf9160 harness: console harness_config: type: multi_line regex: - .*Example finished successfully!.* integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.aes_gcm.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - .*Example finished successfully!.* + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/chachapoly/sample.yaml b/samples/crypto/chachapoly/sample.yaml index 7e25ae287e4a..564152ea5ae8 100644 --- a/samples/crypto/chachapoly/sample.yaml +++ b/samples/crypto/chachapoly/sample.yaml @@ -4,26 +4,38 @@ sample: Chacha20-Poly1305 name: Chacha20-Poly1305 example tests: - sample.chacha_poly: + sample.chachapoly.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp - nrf54l15pdk_nrf54l15_cpuapp - nrf52840dk_nrf52840 + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + nrf52840dk/nrf52840 harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.chachapoly.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/ecdh/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/ecdh/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index a9836ba44b36..000000000000 --- a/samples/crypto/ecdh/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -# Using hardware crypto accelerator -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y diff --git a/samples/crypto/ecdh/prj.conf b/samples/crypto/ecdh/prj.conf index e44dfa6375a8..e112ca384f35 100644 --- a/samples/crypto/ecdh/prj.conf +++ b/samples/crypto/ecdh/prj.conf @@ -16,7 +16,9 @@ CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=8192 CONFIG_PSA_WANT_ALG_ECDH=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y CONFIG_PSA_WANT_ECC_SECP_R1_256=y # For key generation diff --git a/samples/crypto/ecdh/sample.yaml b/samples/crypto/ecdh/sample.yaml index 26e374053e09..c7172be343ea 100644 --- a/samples/crypto/ecdh/sample.yaml +++ b/samples/crypto/ecdh/sample.yaml @@ -4,24 +4,35 @@ sample: key echange which allows two parties to obtain a common secret name: ECDH example tests: - sample.ecdh: + sample.ecdh.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.ecdh.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/ecdsa/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/ecdsa/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index 04972de35a85..000000000000 --- a/samples/crypto/ecdsa/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -# Using hardware crypto accelerator -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y - -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n diff --git a/samples/crypto/ecdsa/prj.conf b/samples/crypto/ecdsa/prj.conf index 1eb141e4fe62..2d03d4cabc3f 100644 --- a/samples/crypto/ecdsa/prj.conf +++ b/samples/crypto/ecdsa/prj.conf @@ -16,7 +16,9 @@ CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=8192 CONFIG_PSA_WANT_ALG_ECDSA=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y CONFIG_PSA_WANT_ECC_SECP_R1_256=y CONFIG_PSA_WANT_ALG_SHA_256=y diff --git a/samples/crypto/ecdsa/sample.yaml b/samples/crypto/ecdsa/sample.yaml index 7a1d22550969..949b97e0b972 100644 --- a/samples/crypto/ecdsa/sample.yaml +++ b/samples/crypto/ecdsa/sample.yaml @@ -3,25 +3,37 @@ sample: This app provides an example of signing/verifying using ECDSA signatures name: ECDSA example tests: - sample.ecdsa: + sample.ecdsa.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp - nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.ecdsa.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/ecjpake/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/crypto/ecjpake/boards/nrf5340dk_nrf5340_cpuapp_ns.conf new file mode 100644 index 000000000000..516f4d9eb784 --- /dev/null +++ b/samples/crypto/ecjpake/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y diff --git a/samples/crypto/ecjpake/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/crypto/ecjpake/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 57d93ef22099..000000000000 --- a/samples/crypto/ecjpake/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG_PSA_CRYPTO_DRIVER_OBERON=y - -# Use Oberon until until NCSDK-26303 is complete diff --git a/samples/crypto/ecjpake/boards/nrf9160dk_nrf9160_ns.conf b/samples/crypto/ecjpake/boards/nrf9160dk_nrf9160_ns.conf new file mode 100644 index 000000000000..516f4d9eb784 --- /dev/null +++ b/samples/crypto/ecjpake/boards/nrf9160dk_nrf9160_ns.conf @@ -0,0 +1 @@ +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y diff --git a/samples/crypto/ecjpake/prj.conf b/samples/crypto/ecjpake/prj.conf index 54f7de0cff47..58804e001e66 100644 --- a/samples/crypto/ecjpake/prj.conf +++ b/samples/crypto/ecjpake/prj.conf @@ -6,6 +6,8 @@ CONFIG_PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS=y CONFIG_PSA_WANT_GENERATE_RANDOM=y CONFIG_PSA_WANT_ALG_SHA_256=y CONFIG_PSA_WANT_ECC_SECP_R1_256=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY=y +CONFIG_PSA_WANT_KEY_TYPE_PASSWORD=y CONFIG_NRF_SECURITY=y CONFIG_MBEDTLS_ENABLE_HEAP=y diff --git a/samples/crypto/ecjpake/sample.yaml b/samples/crypto/ecjpake/sample.yaml index 398544fad6ed..d4bdbdd3850f 100644 --- a/samples/crypto/ecjpake/sample.yaml +++ b/samples/crypto/ecjpake/sample.yaml @@ -2,23 +2,42 @@ sample: description: This app provides an example of EC J-PAKE name: EC J-PAKE example tests: - sample.ecjpake: + sample.ecjpake.oberon: tags: introduction psa oberon platform_allow: > - nrf5340dk_nrf5340_cpuapp - nrf9160dk_nrf9160 nrf52840dk_nrf52840 - nrf9161dk_nrf9161 - nrf54l15pdk_nrf54l15_cpuapp - nrf54h20pdk_nrf54h20_cpuapp + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160 + nrf9160dk/nrf9160/ns + nrf52840dk/nrf52840 + nrf9161dk/nrf9161 + nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - - nrf9161dk_nrf9161 - - nrf52840dk_nrf52840 - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + - nrf52840dk/nrf52840 + sample.ecjpake.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/eddsa/prj.conf b/samples/crypto/eddsa/prj.conf index 996d5821c686..eca669f412b5 100644 --- a/samples/crypto/eddsa/prj.conf +++ b/samples/crypto/eddsa/prj.conf @@ -15,7 +15,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y CONFIG_MBEDTLS_ENABLE_HEAP=y CONFIG_MBEDTLS_HEAP_SIZE=8192 -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_255=y CONFIG_PSA_WANT_ALG_SHA_512=y CONFIG_PSA_WANT_ALG_PURE_EDDSA=y diff --git a/samples/crypto/eddsa/sample.yaml b/samples/crypto/eddsa/sample.yaml index 68ca6eaf36a1..119f1d083d8c 100644 --- a/samples/crypto/eddsa/sample.yaml +++ b/samples/crypto/eddsa/sample.yaml @@ -3,21 +3,35 @@ sample: This app provides an example of signing/verifying using EdDSA signatures name: EdDSA example tests: - sample.eddsa: + sample.eddsa.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.eddsa.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/hkdf/prj.conf b/samples/crypto/hkdf/prj.conf index 7da14b142e92..f5ea528e054e 100644 --- a/samples/crypto/hkdf/prj.conf +++ b/samples/crypto/hkdf/prj.conf @@ -18,3 +18,4 @@ CONFIG_MBEDTLS_HEAP_SIZE=8192 CONFIG_PSA_WANT_ALG_HKDF=y CONFIG_PSA_WANT_ALG_HMAC=y CONFIG_PSA_WANT_ALG_SHA_256=y +CONFIG_PSA_WANT_KEY_TYPE_HMAC=y diff --git a/samples/crypto/hkdf/sample.yaml b/samples/crypto/hkdf/sample.yaml index 6bf65a78b3ff..d3464321a854 100644 --- a/samples/crypto/hkdf/sample.yaml +++ b/samples/crypto/hkdf/sample.yaml @@ -2,25 +2,36 @@ sample: description: HMAC key derivation function example name: HKDF example tests: - sample.hkdf: + sample.hkdf.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp - nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.hkdf.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/hmac/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/hmac/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index 04972de35a85..000000000000 --- a/samples/crypto/hmac/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -# Using hardware crypto accelerator -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y - -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n diff --git a/samples/crypto/hmac/prj.conf b/samples/crypto/hmac/prj.conf index 50aaf55452e1..681637643dce 100644 --- a/samples/crypto/hmac/prj.conf +++ b/samples/crypto/hmac/prj.conf @@ -20,3 +20,4 @@ CONFIG_PSA_WANT_GENERATE_RANDOM=y # This HMAC sample uses HMAC with SHA256 CONFIG_PSA_WANT_ALG_HMAC=y CONFIG_PSA_WANT_ALG_SHA_256=y +CONFIG_PSA_WANT_KEY_TYPE_HMAC=y diff --git a/samples/crypto/hmac/sample.yaml b/samples/crypto/hmac/sample.yaml index e082e0be7bac..fa5109003b05 100644 --- a/samples/crypto/hmac/sample.yaml +++ b/samples/crypto/hmac/sample.yaml @@ -4,24 +4,35 @@ sample: using the SHA256 hashing algorithm decryption using AES CBC mode name: HMAC example tests: - sample.hmac: + sample.hmac.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.hmac.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/pbkdf2/boards/nrf9161dk_nrf9161_ns.conf b/samples/crypto/pbkdf2/boards/nrf9161dk_nrf9161_ns.conf new file mode 100644 index 000000000000..f0169cb75580 --- /dev/null +++ b/samples/crypto/pbkdf2/boards/nrf9161dk_nrf9161_ns.conf @@ -0,0 +1,4 @@ +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y + +# Using hardware crypto accelerator +CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y diff --git a/samples/crypto/pbkdf2/sample.yaml b/samples/crypto/pbkdf2/sample.yaml index 1cc325f5cce8..28b844a4abfe 100644 --- a/samples/crypto/pbkdf2/sample.yaml +++ b/samples/crypto/pbkdf2/sample.yaml @@ -2,17 +2,35 @@ sample: description: HMAC key derivation function example name: PBKDF2 example tests: - sample.pbkdf2: + sample.pbkdf2.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 + nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 + nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.pbkdf2.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns diff --git a/samples/crypto/persistent_key_usage/sample.yaml b/samples/crypto/persistent_key_usage/sample.yaml index 8d3812350acd..544f755052a5 100644 --- a/samples/crypto/persistent_key_usage/sample.yaml +++ b/samples/crypto/persistent_key_usage/sample.yaml @@ -5,23 +5,34 @@ sample: to the PSA keystore. name: Persistent key example tests: - sample.persistent_key_usage: + sample.persistent_key_usage.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.persistent_key_usage.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns diff --git a/samples/crypto/persistent_key_usage/src/trusted_storage_init.c b/samples/crypto/persistent_key_usage/src/trusted_storage_init.c index 9d6bf914a54c..6e1e9de7531f 100644 --- a/samples/crypto/persistent_key_usage/src/trusted_storage_init.c +++ b/samples/crypto/persistent_key_usage/src/trusted_storage_init.c @@ -25,7 +25,6 @@ static int setup_settings_backend(void) SYS_INIT(setup_settings_backend, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); #ifdef CONFIG_TRUSTED_STORAGE_BACKEND_AEAD_KEY_DERIVE_FROM_HUK -#include #include #ifndef HUK_HAS_KMU diff --git a/samples/crypto/psa_tls/README.rst b/samples/crypto/psa_tls/README.rst index 87603b5755eb..9b0a21e389d3 100644 --- a/samples/crypto/psa_tls/README.rst +++ b/samples/crypto/psa_tls/README.rst @@ -11,7 +11,7 @@ The PSA TLS sample shows how to perform a TLS handshake and send encrypted messa .. note:: - Datagram Transport Layer Security (DTLS) and Pre-shared key (PSK) are currently not supported. + Datagram Transport Layer Security (DTLS) and pre-shared key (PSK) are currently not supported. For information about CMSE and the difference between the two environments, see :ref:`app_boards_spe_nspe`. diff --git a/samples/crypto/psa_tls/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/crypto/psa_tls/boards/nrf5340dk_nrf5340_cpuapp_ns.conf index 2c126abeffc5..2d7c77549279 100644 --- a/samples/crypto/psa_tls/boards/nrf5340dk_nrf5340_cpuapp_ns.conf +++ b/samples/crypto/psa_tls/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -1,7 +1,5 @@ CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_BL2=n CONFIG_NRF_ENABLE_ICACHE=n -CONFIG_PM_PARTITION_SIZE_BL2=0x0 CONFIG_MBEDTLS_USE_PSA_CRYPTO=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y diff --git a/samples/crypto/psa_tls/boards/nrf9160dk_nrf9160_ns.conf b/samples/crypto/psa_tls/boards/nrf9160dk_nrf9160_ns.conf index 4d2114c3c718..dea10a25f316 100644 --- a/samples/crypto/psa_tls/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/crypto/psa_tls/boards/nrf9160dk_nrf9160_ns.conf @@ -1,7 +1,5 @@ CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_BL2=n CONFIG_NRF_ENABLE_ICACHE=n -CONFIG_PM_PARTITION_SIZE_BL2=0x0 CONFIG_MBEDTLS_USE_PSA_CRYPTO=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y diff --git a/samples/crypto/psa_tls/boards/nrf9161dk_nrf9161_ns.conf b/samples/crypto/psa_tls/boards/nrf9161dk_nrf9161_ns.conf index 4d2114c3c718..dea10a25f316 100644 --- a/samples/crypto/psa_tls/boards/nrf9161dk_nrf9161_ns.conf +++ b/samples/crypto/psa_tls/boards/nrf9161dk_nrf9161_ns.conf @@ -1,7 +1,5 @@ CONFIG_TFM_PROFILE_TYPE_NOT_SET=y -CONFIG_TFM_BL2=n CONFIG_NRF_ENABLE_ICACHE=n -CONFIG_PM_PARTITION_SIZE_BL2=0x0 CONFIG_MBEDTLS_USE_PSA_CRYPTO=y CONFIG_MBEDTLS_PSA_CRYPTO_C=y diff --git a/samples/crypto/psa_tls/prj.conf b/samples/crypto/psa_tls/prj.conf index 09667dab425f..c670b82f65c5 100644 --- a/samples/crypto/psa_tls/prj.conf +++ b/samples/crypto/psa_tls/prj.conf @@ -78,7 +78,10 @@ CONFIG_PSA_WANT_ALG_ECDH=y CONFIG_PSA_WANT_ALG_ECDSA=y CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y CONFIG_PSA_WANT_ECC_SECP_R1_256=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y CONFIG_PSA_WANT_ALG_STREAM_CIPHER=y CONFIG_PSA_WANT_KEY_TYPE_CHACHA20=y CONFIG_PSA_WANT_ALG_TLS12_PSK_TO_MS=y diff --git a/samples/crypto/psa_tls/sample.yaml b/samples/crypto/psa_tls/sample.yaml index 39b0a969bb38..6f8b8e417194 100644 --- a/samples/crypto/psa_tls/sample.yaml +++ b/samples/crypto/psa_tls/sample.yaml @@ -11,60 +11,60 @@ tests: extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/cc3xx-oberon-psa.conf" platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns tags: ci_build cc3xx_oberon sample.psa_tls.dtls_server.ecdsa.cc3xx_oberon: build_only: true extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/cc3xx-oberon-psa.conf;overlays/dtls.conf" platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns tags: ci_build cc3xx_oberon dtls sample.psa_tls.tls_client.ecdsa.cc3xx_oberon: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/cc3xx-oberon-psa.conf" platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns - nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns + nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns tags: ci_build cc3xx_oberon sample.psa_tls.dtls_client.ecdsa.cc3xx_oberon: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/cc3xx-oberon-psa.conf;overlays/dtls.conf" platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns + nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns tags: ci_build cc3xx_oberon dtls ################################################################################ ## PSA APIs with Oberon @@ -74,18 +74,18 @@ tests: extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/oberon-psa.conf" platform_allow: > - nrf54l15pdk_nrf54l15_cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk_nrf54l15_cpuapp + - nrf54l15pdk/nrf54l15/cpuapp tags: ci_build oberon sample.psa_tls.client.ecdsa.oberon: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/oberon-psa.conf" platform_allow: > - nrf54l15pdk_nrf54l15_cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk_nrf54l15_cpuapp + - nrf54l15pdk/nrf54l15/cpuapp tags: ci_build oberon ################################################################################ ## PSA APIs with Cracen @@ -95,18 +95,18 @@ tests: extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/cracen-psa.conf" platform_allow: > - nrf54l15pdk_nrf54l15_cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk_nrf54l15_cpuapp + - nrf54l15pdk/nrf54l15/cpuapp tags: ci_build cracen sample.psa_tls.client.ecdsa.cracen: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/cracen-psa.conf" platform_allow: > - nrf54l15pdk_nrf54l15_cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf54l15pdk_nrf54l15_cpuapp + - nrf54l15pdk/nrf54l15/cpuapp tags: ci_build cracen ################################################################################ ## Legacy APIs with Cryptocell (secure-only) @@ -115,41 +115,41 @@ tests: build_only: true extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/rsa.conf;overlays/cc3xx-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy cc3xx_legacy sample.psa_tls.tls_client.rsa.cc3xx_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/rsa.conf;overlays/cc3xx-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy cc3xx_legacy sample.psa_tls.tls_server.ecdsa.cc3xx_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/cc3xx-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy cc3xx_legacy sample.psa_tls.tls_client.ecdsa.cc3xx_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/cc3xx-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy cc3xx_legacy ################################################################################ ## Legacy APIs with Oberon (secure-only) @@ -158,39 +158,39 @@ tests: build_only: true extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/rsa.conf;overlays/oberon-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy oberon_legacy sample.psa_tls.tls_client.rsa.oberon_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/rsa.conf;overlays/oberon-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy oberon_legacy sample.psa_tls.tls_server.ecdsa.oberon_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/server.conf;overlays/ecdsa.conf;overlays/oberon-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy oberon_legacy sample.psa_tls.tls_client.ecdsa.oberon_legacy: build_only: true extra_args: > OVERLAY_CONFIG="overlays/client.conf;overlays/ecdsa.conf;overlays/oberon-legacy.conf" - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 tags: ci_build legacy oberon_legacy diff --git a/samples/crypto/rng/sample.yaml b/samples/crypto/rng/sample.yaml index ea0e4d34a255..458479340d8f 100644 --- a/samples/crypto/rng/sample.yaml +++ b/samples/crypto/rng/sample.yaml @@ -2,24 +2,35 @@ sample: description: This app provides an example of how to produce random numbers name: RNG example tests: - sample.rng: + sample.rng.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf9161dk_nrf9161_ns - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.rng.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/rsa/sample.yaml b/samples/crypto/rsa/sample.yaml index aafcc15ab9f3..cde2e21ca9ed 100644 --- a/samples/crypto/rsa/sample.yaml +++ b/samples/crypto/rsa/sample.yaml @@ -3,23 +3,35 @@ sample: This app provides an example of performing RSA signing and verification name: RSA example tests: - sample.rsa: + sample.rsa.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf9161dk_nrf9161 - - nrf54l15pdk_nrf54l15_cpuapp - - nrf9161dk_nrf9161_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + sample.rsa.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/rsa/src/main.c b/samples/crypto/rsa/src/main.c index c5239098391a..3fca48fe526f 100644 --- a/samples/crypto/rsa/src/main.c +++ b/samples/crypto/rsa/src/main.c @@ -116,7 +116,7 @@ int import_rsa_keypair(void) /* After the key handle is acquired the attributes are not needed */ psa_reset_key_attributes(&key_attributes); - LOG_INF("RSA generated successfully!"); + LOG_INF("RSA private key imported successfully!"); return APP_SUCCESS; } @@ -144,6 +144,8 @@ int import_rsa_pub_key(void) /* After the key handle is acquired the attributes are not needed */ psa_reset_key_attributes(&key_attributes); + LOG_INF("RSA public key imported successfully!"); + return APP_SUCCESS; } diff --git a/samples/crypto/sha256/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/crypto/sha256/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index b8940fba382e..000000000000 --- a/samples/crypto/sha256/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_TFM_PROFILE_TYPE_NOT_SET=y - -CONFIG_PSA_CRYPTO_DRIVER_OBERON=n -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=y diff --git a/samples/crypto/sha256/sample.yaml b/samples/crypto/sha256/sample.yaml index 71d64cae1273..d0e42c3ddeaf 100644 --- a/samples/crypto/sha256/sample.yaml +++ b/samples/crypto/sha256/sample.yaml @@ -2,41 +2,52 @@ sample: description: This app provides an example of hashing using SHA256 name: SHA256 example tests: - sample.sha256: + sample.sha256.cc3xx: tags: introduction psa cc3xx platform_allow: > - nrf5340dk_nrf5340_cpuapp_ns nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf9161dk_nrf9161 nrf9161dk_nrf9161_ns - nrf54h20pdk_nrf54h20_cpuapp nrf54l15pdk_nrf54l15_cpuapp + nrf5340dk/nrf5340/cpuapp/ns nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf9161dk/nrf9161 nrf9161dk/nrf9161/ns harness: console harness_config: type: multi_line regex: - ".*Example finished successfully!.*" integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9160dk_nrf9160 - - nrf9161dk_nrf9161_ns - - nrf9161dk_nrf9161 - - nrf52840dk_nrf52840 - - nrf54h20pdk_nrf54h20_cpuapp - - nrf54l15pdk_nrf54l15_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9160dk/nrf9160 + - nrf9161dk/nrf9161/ns + - nrf9161dk/nrf9161 + - nrf52840dk/nrf52840 + sample.sha256.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54h20dk/nrf54h20/cpuapp nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk/nrf54l15/cpuapp/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns # Build integration regression protection. sample.nrf_security.sha256.integration: build_only: true extra_args: CONFIG_BOOTLOADER_MCUBOOT=y - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf52840dk_nrf52840 nrf52833dk_nrf52833 + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf52840dk/nrf52840 nrf52833dk/nrf52833 integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 sample.newlib_libc.sha256: build_only: true extra_args: CONFIG_NEWLIB_LIBC=y - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf52840dk_nrf52840 nrf54h20pdk_nrf54h20_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf52840dk/nrf52840 nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf52840dk_nrf52840 - - nrf54h20pdk_nrf54h20_cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf52840dk/nrf52840 + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/spake2p/CMakeLists.txt b/samples/crypto/spake2p/CMakeLists.txt new file mode 100644 index 000000000000..ad11557545dc --- /dev/null +++ b/samples/crypto/spake2p/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(spake2p) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/crypto/spake2p/README.rst b/samples/crypto/spake2p/README.rst new file mode 100644 index 000000000000..68fd8cf516cd --- /dev/null +++ b/samples/crypto/spake2p/README.rst @@ -0,0 +1,41 @@ +.. _crypto_spake2p: + +Crypto: Spake2+ +############### + +.. contents:: + :local: + :depth: 2 + +The Spake2+ sample demonstrates how to do a password-authenticated key exchange using the Spake2+ protocol. + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +Overview +******** + +The sample performs the following operations: + +1. Initializes the Platform Security Architecture (PSA) API. +#. Goes through the steps for Spake2+ on server and client sides. +#. Verifies that the derived keys are the same. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/crypto/spake2p` + + +Testing +======= + +After programming the sample to your development kit, complete the following steps to test it: + +1. |connect_terminal| +#. Compile and program the application. +#. Observe the logs from the application using a terminal emulator. diff --git a/samples/crypto/spake2p/boards/nrf5340dk_nrf5340_cpuapp_ns.conf b/samples/crypto/spake2p/boards/nrf5340dk_nrf5340_cpuapp_ns.conf new file mode 100644 index 000000000000..516f4d9eb784 --- /dev/null +++ b/samples/crypto/spake2p/boards/nrf5340dk_nrf5340_cpuapp_ns.conf @@ -0,0 +1 @@ +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y diff --git a/samples/crypto/spake2p/boards/nrf9160dk_nrf9160_ns.conf b/samples/crypto/spake2p/boards/nrf9160dk_nrf9160_ns.conf new file mode 100644 index 000000000000..516f4d9eb784 --- /dev/null +++ b/samples/crypto/spake2p/boards/nrf9160dk_nrf9160_ns.conf @@ -0,0 +1 @@ +CONFIG_TFM_PROFILE_TYPE_NOT_SET=y diff --git a/samples/crypto/spake2p/prj.conf b/samples/crypto/spake2p/prj.conf new file mode 100644 index 000000000000..849cb6f889b4 --- /dev/null +++ b/samples/crypto/spake2p/prj.conf @@ -0,0 +1,17 @@ +# Enable logging +CONFIG_LOG=y +CONFIG_CONSOLE=y + +CONFIG_MAIN_STACK_SIZE=16000 + +# Enable nordic security backend and PSA APIs +CONFIG_PSA_WANT_GENERATE_RANDOM=y +CONFIG_NRF_SECURITY=y +CONFIG_MBEDTLS_ENABLE_HEAP=y +CONFIG_MBEDTLS_HEAP_SIZE=8192 +CONFIG_PSA_WANT_ALG_SPAKE2P_HMAC=y +CONFIG_PSA_WANT_ALG_HKDF=y +CONFIG_PSA_WANT_ALG_HMAC=y +CONFIG_PSA_WANT_ALG_SHA_256=y +CONFIG_PSA_WANT_ECC_SECP_R1_256=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y diff --git a/samples/crypto/spake2p/sample.yaml b/samples/crypto/spake2p/sample.yaml new file mode 100644 index 000000000000..ce53f1c74de3 --- /dev/null +++ b/samples/crypto/spake2p/sample.yaml @@ -0,0 +1,40 @@ +sample: + description: This app provides an example of Spake2+ + name: Spake2+ example +tests: + sample.spake2p.oberon: + tags: introduction psa oberon + platform_allow: > + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160 nrf52840dk/nrf52840 + nrf9161dk/nrf9161 nrf9160dk/nrf9160/ns + nrf9161dk/nrf9161/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161 + - nrf9161dk/nrf9161/ns + - nrf52840dk/nrf52840 + sample.spake2p.cracen: + tags: introduction psa cracen + platform_allow: > + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk/nrf54l15/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + # nRF54H uses Oberon+fake entropy until crypto service is available from SDFW + - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/crypto/spake2p/src/main.c b/samples/crypto/spake2p/src/main.c new file mode 100644 index 000000000000..665c2a3858a5 --- /dev/null +++ b/samples/crypto/spake2p/src/main.c @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(spake2p, LOG_LEVEL_DBG); + +#define PRINT_HEX(p_label, p_text, len) \ + ({ \ + LOG_INF("---- %s (len: %u): ----", p_label, len); \ + LOG_HEXDUMP_INF(p_text, len, "Content:"); \ + LOG_INF("---- %s end ----", p_label); \ + }) + +#define APP_SUCCESS (0) +#define APP_ERROR (-1) +#define APP_SUCCESS_MESSAGE "Example finished successfully!" +#define APP_ERROR_MESSAGE "Example exited with error!" + +/* w0 || w1 */ +static const uint8_t key_pair[] = {0x54, 0x8E, 0xC1, 0x42, 0xE2, 0x27, 0x90, 0x23, 0x7C, 0x67, 0xA8, + 0x88, 0x49, 0xE8, 0x61, 0xD3, 0x77, 0x00, 0x5F, 0x0A, 0x5C, 0x33, + 0x88, 0xF9, 0xAF, 0xA1, 0xC2, 0xFA, 0x58, 0xC7, 0xDA, 0x51, 0x35, + 0x99, 0xF8, 0x67, 0x1D, 0xBB, 0x67, 0x04, 0xA2, 0xC6, 0x3A, 0x78, + 0x4F, 0xC9, 0x5C, 0xD2, 0x8E, 0xBC, 0x55, 0x2E, 0xA4, 0x79, 0x98, + 0xB9, 0x18, 0x69, 0x9A, 0xB9, 0x3F, 0x4F, 0x7A, 0xD7}; + +/* w0 || L */ +static const uint8_t public_key[] = { + 0x54, 0x8E, 0xC1, 0x42, 0xE2, 0x27, 0x90, 0x23, 0x7C, 0x67, 0xA8, 0x88, 0x49, 0xE8, + 0x61, 0xD3, 0x77, 0x00, 0x5F, 0x0A, 0x5C, 0x33, 0x88, 0xF9, 0xAF, 0xA1, 0xC2, 0xFA, + 0x58, 0xC7, 0xDA, 0x51, 0x04, 0x81, 0x43, 0x3D, 0xC5, 0x93, 0xC9, 0x46, 0xC9, 0x37, + 0xD9, 0x90, 0x26, 0xDD, 0x42, 0x14, 0x40, 0xE1, 0xC8, 0x7D, 0x0E, 0xC4, 0x94, 0x8B, + 0xFF, 0x59, 0xEA, 0xF4, 0x77, 0xE3, 0x35, 0xE5, 0x52, 0x49, 0x66, 0xB2, 0x03, 0x31, + 0x37, 0xD8, 0x4C, 0x65, 0x56, 0xDE, 0x07, 0x31, 0x57, 0x5C, 0xD2, 0x95, 0xC9, 0x75, + 0x12, 0x4F, 0x52, 0x13, 0x25, 0xF7, 0x80, 0x01, 0xEC, 0xBE, 0x67, 0xE8, 0xB7}; + +static psa_status_t send_message(psa_pake_operation_t *from, psa_pake_operation_t *to, + psa_pake_step_t step) +{ + uint8_t data[1024]; + size_t length; + + psa_status_t status = psa_pake_output(from, step, data, sizeof(data), &length); + + if (status) { + return status; + } + PRINT_HEX("send_message", data, length); + status = psa_pake_input(to, step, data, length); + return status; +} + +static psa_status_t pake_setup(psa_pake_operation_t *op, psa_pake_role_t role, psa_key_id_t key, + psa_pake_cipher_suite_t *cipher_suite) +{ + psa_status_t status; + + status = psa_pake_setup(op, key, cipher_suite); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_setup failed. (Error: %d)", status); + return status; + } + + status = psa_pake_set_role(op, role); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_set_role failed. (Error: %d)", status); + return status; + } + + if (role == PSA_PAKE_ROLE_SERVER) { + status = psa_pake_set_user(op, "client", strlen("client")); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_set_user failed. (Error: %d)", status); + return status; + } + + status = psa_pake_set_peer(op, "server", strlen("server")); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_set_peer failed. (Error: %d)", status); + return status; + } + } else { + status = psa_pake_set_user(op, "server", strlen("server")); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_set_user failed. (Error: %d)", status); + return status; + } + + status = psa_pake_set_peer(op, "client", strlen("client")); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_set_peer failed. (Error: %d)", status); + return status; + } + } + + return status; +} + +int main(void) +{ + /* For Matter-compatible Spake2+, this will be PSA_ALG_SPAKE2P_MATTER */ + psa_algorithm_t psa_spake_alg = PSA_ALG_SPAKE2P_HMAC(PSA_ALG_SHA_256); + psa_status_t status = psa_crypto_init(); + + if (status != PSA_SUCCESS) { + LOG_INF("psa_crypto_init failed. (Error: %d)", status); + } + + psa_pake_cipher_suite_t cipher_suite = PSA_PAKE_CIPHER_SUITE_INIT; + + psa_pake_cs_set_algorithm(&cipher_suite, psa_spake_alg); + psa_pake_cs_set_primitive(&cipher_suite, PSA_PAKE_PRIMITIVE(PSA_PAKE_PRIMITIVE_TYPE_ECC, + PSA_ECC_FAMILY_SECP_R1, 256)); + psa_pake_cs_set_key_confirmation(&cipher_suite, PSA_PAKE_CONFIRMED_KEY); + + psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_DERIVE); + psa_set_key_algorithm(&key_attributes, psa_spake_alg); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); + psa_set_key_bits(&key_attributes, 256); + + psa_key_id_t key; + + status = psa_import_key(&key_attributes, key_pair, sizeof(key_pair), &key); + if (status != PSA_SUCCESS) { + LOG_INF("psa_import_key failed. (Error: %d)", status); + goto error; + } + + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_DERIVE); + psa_set_key_algorithm(&key_attributes, psa_spake_alg); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)); + psa_set_key_bits(&key_attributes, 256); + + psa_key_id_t key_server; + + status = psa_import_key(&key_attributes, public_key, sizeof(public_key), &key_server); + if (status != PSA_SUCCESS) { + LOG_INF("psa_import_key failed. (Error: %d)", status); + goto error; + } + + psa_reset_key_attributes(&key_attributes); + + psa_pake_operation_t client_op = PSA_PAKE_OPERATION_INIT; + + status = pake_setup(&client_op, PSA_PAKE_ROLE_CLIENT, key, &cipher_suite); + if (status != PSA_SUCCESS) { + goto error; + } + + psa_pake_operation_t server_op = PSA_PAKE_OPERATION_INIT; + + status = pake_setup(&server_op, PSA_PAKE_ROLE_SERVER, key_server, &cipher_suite); + if (status != PSA_SUCCESS) { + goto error; + } + + /* Share P */ + status = send_message(&client_op, &server_op, PSA_PAKE_STEP_KEY_SHARE); + if (status != PSA_SUCCESS) { + LOG_INF("send_message failed. (Error: %d, step: %d)", status, + PSA_PAKE_STEP_KEY_SHARE); + goto error; + } + + /* Share V */ + status = send_message(&server_op, &client_op, PSA_PAKE_STEP_KEY_SHARE); + if (status != PSA_SUCCESS) { + LOG_INF("send_message failed. (Error: %d, step: %d)", status, + PSA_PAKE_STEP_KEY_SHARE); + goto error; + } + + /* Confirm P */ + status = send_message(&server_op, &client_op, PSA_PAKE_STEP_CONFIRM); + if (status != PSA_SUCCESS) { + LOG_INF("send_message failed. (Error: %d, step: %d)", status, + PSA_PAKE_STEP_CONFIRM); + goto error; + } + + /* Confirm V */ + status = send_message(&client_op, &server_op, PSA_PAKE_STEP_CONFIRM); + if (status != PSA_SUCCESS) { + LOG_INF("send_message failed. (Error: %d, step: %d)", status, + PSA_PAKE_STEP_CONFIRM); + goto error; + } + + psa_key_derivation_operation_t kdf = PSA_KEY_DERIVATION_OPERATION_INIT; + uint8_t client_secret[32] = {0}; + uint8_t server_secret[32] = {0}; + + psa_key_attributes_t shared_key_attributes = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_type(&shared_key_attributes, PSA_KEY_TYPE_DERIVE); + psa_set_key_usage_flags(&shared_key_attributes, PSA_KEY_USAGE_DERIVE); + psa_set_key_algorithm(&shared_key_attributes, PSA_ALG_HKDF(PSA_ALG_SHA_256)); + + struct { + psa_pake_operation_t *op; + uint8_t *secret; + } client_server[] = {{&client_op, client_secret}, {&server_op, server_secret}}; + + for (size_t i = 0; i < ARRAY_SIZE(client_server); i++) { + psa_key_id_t key; + + status = psa_pake_get_shared_key(client_server[i].op, &shared_key_attributes, &key); + if (status != PSA_SUCCESS) { + LOG_INF("psa_pake_get_shared_key failed. (Error: %d)", status); + goto error; + } + + status = psa_key_derivation_setup(&kdf, PSA_ALG_HKDF(PSA_ALG_SHA_256)); + if (status != PSA_SUCCESS) { + LOG_INF("psa_key_derivation_setup failed. (Error: %d)", status); + goto error; + } + + status = psa_key_derivation_input_key(&kdf, PSA_KEY_DERIVATION_INPUT_SECRET, key); + if (status != PSA_SUCCESS) { + LOG_INF("psa_key_derivation_input_key failed. (Error: %d)", status); + goto error; + } + + status = psa_key_derivation_input_bytes(&kdf, PSA_KEY_DERIVATION_INPUT_INFO, "Info", + 4); + if (status != PSA_SUCCESS) { + LOG_INF("psa_key_derivation_input_bytes failed. (Error: %d)", status); + goto error; + } + + status = psa_key_derivation_output_bytes(&kdf, client_server[i].secret, + sizeof(client_secret)); + if (status != PSA_SUCCESS) { + LOG_INF("psa_key_derivation_output_bytes failed. (Error: %d)", status); + goto error; + } + + status = psa_key_derivation_abort(&kdf); + if (status != PSA_SUCCESS) { + LOG_INF("psa_key_derivation_abort failed. (Error: %d)", status); + goto error; + } + + status = psa_destroy_key(key); + if (status != PSA_SUCCESS) { + LOG_INF("psa_destroy_key failed. (Error: %d)", status); + goto error; + } + } + + psa_reset_key_attributes(&shared_key_attributes); + PRINT_HEX("server_secret", client_secret, sizeof(client_secret)); + PRINT_HEX("client_secret", server_secret, sizeof(server_secret)); + + bool compare_eq = true; + + for (size_t i = 0; i < sizeof(server_secret); i++) { + if (server_secret[i] != client_secret[i]) { + compare_eq = false; + } + } + + if (!compare_eq) { + LOG_ERR("Derived keys for server and client are not equal."); + goto error; + } + + LOG_INF(APP_SUCCESS_MESSAGE); + return APP_SUCCESS; + +error: + LOG_INF(APP_ERROR_MESSAGE); + return APP_ERROR; +} diff --git a/samples/debug/memfault/README.rst b/samples/debug/memfault/README.rst index 548e878453b2..578f392eea0d 100644 --- a/samples/debug/memfault/README.rst +++ b/samples/debug/memfault/README.rst @@ -231,7 +231,7 @@ Before testing, ensure that your device is configured with the project key of yo Dependencies ************ -The sample requires the Memfault SDK, which is part of |NCS|'s West manifest, and will be downloaded automatically when ``west update`` is run. +The sample requires the Memfault SDK, which is part of |NCS|'s west manifest, and will be downloaded automatically when ``west update`` is run. This sample uses the following |NCS| libraries and drivers: diff --git a/samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.conf b/samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.conf index 127525d13e6a..099d87d9ce92 100644 --- a/samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.conf +++ b/samples/debug/memfault/boards/nrf7002dk_nrf5340_cpuapp.conf @@ -5,7 +5,6 @@ # # General -CONFIG_NEWLIB_LIBC=y CONFIG_POSIX_CLOCK=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 CONFIG_HEAP_MEM_POOL_SIZE=153600 @@ -26,12 +25,10 @@ CONFIG_NET_RX_STACK_SIZE=4096 CONFIG_NET_SOCKETS=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_SOCKETS_OFFLOAD=n CONFIG_NET_DHCPV4=y CONFIG_NET_CONTEXT_SNDTIMEO=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_STATISTICS=y CONFIG_NET_STATISTICS_WIFI=y diff --git a/samples/debug/memfault/prj.conf b/samples/debug/memfault/prj.conf index c679cbf4e101..3e25a4f3100d 100644 --- a/samples/debug/memfault/prj.conf +++ b/samples/debug/memfault/prj.conf @@ -5,7 +5,6 @@ # # General config -CONFIG_NEWLIB_LIBC=y CONFIG_FPU=y # Logging diff --git a/samples/debug/memfault/sample.yaml b/samples/debug/memfault/sample.yaml index fda798a0bf1c..54824d459523 100644 --- a/samples/debug/memfault/sample.yaml +++ b/samples/debug/memfault/sample.yaml @@ -6,18 +6,18 @@ tests: extra_configs: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="dummy-key" integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp tags: ci_build sample.debug.memfault.etb: build_only: true @@ -25,14 +25,14 @@ tests: - CONFIG_MEMFAULT_NCS_PROJECT_KEY="dummy-key" extra_args: OVERLAY_CONFIG=overlay-etb.conf integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns tags: ci_build diff --git a/samples/debug/ppi_trace/sample.yaml b/samples/debug/ppi_trace/sample.yaml index 912d20e3c5ae..cc79714cf3ba 100644 --- a/samples/debug/ppi_trace/sample.yaml +++ b/samples/debug/ppi_trace/sample.yaml @@ -5,7 +5,7 @@ tests: sample.debug.ppi_trace: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf21540dk/nrf52840 tags: ci_build diff --git a/samples/dect/dect_phy/hello_dect/CMakeLists.txt b/samples/dect/dect_phy/hello_dect/CMakeLists.txt new file mode 100644 index 000000000000..001ac71af9b3 --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/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(hello_dect) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/dect/dect_phy/hello_dect/Kconfig b/samples/dect/dect_phy/hello_dect/Kconfig new file mode 100644 index 000000000000..147be4c7edcf --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/Kconfig @@ -0,0 +1,52 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config CARRIER + int "Carrier to use" + default 0 + help + The availability of the channels and the exact regulation to use them varies in different countries. + See ETSI TS 103 636-2 5.4.2 for the calculation. + +config NETWORK_ID + int "Network ID" + range 1 4294967295 + default 91 + +config MCS + int "MCS" + default 1 + help + The MCS impacts how much data can fit into each subslot. + +config TX_POWER + int "TX power" + range 0 11 + default 11 + help + Transmission power, see table 6.2.1-3 of ETSI TS 103 636-4. + +config TX_TRANSMISSIONS + int "TX transmissions" + range 0 4294967295 + default 30 + help + Transmissions before sample exits, use 0 to transmit forever. + +config RX_PERIOD_S + int "RX period" + default 5 + help + Receive window period. + Time is given in seconds. + +module = DECT_PHY_HELLO +module-str = DECT NR+ PHY Hello +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +menu "Zephyr Kernel" +source "Kconfig.zephyr" +endmenu diff --git a/samples/dect/dect_phy/hello_dect/README.rst b/samples/dect/dect_phy/hello_dect/README.rst new file mode 100644 index 000000000000..a7cadea4df2c --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/README.rst @@ -0,0 +1,128 @@ +.. _nrf_modem_dect_phy_hello: + +nRF91x1: DECT NR+ PHY hello sample +################################## + +.. contents:: + :local: + :depth: 2 + +The sample demonstrates how to set up a simple DECT NR+ application with the DECT PHY modem firmware. + +Requirements +************ + +The sample needs at least two nRF91x1 Development Kits. + +See :ref:`nrf91x1_ug_intro` for more details. + +.. note:: + + The :ref:`nrf_modem_dect_phy_simple` sample requires the DECT NR+ PHY modem firmware to run on the nRF91x1 modem core. Please contact our sales department to know more. + +.. include:: /includes/tfm.txt + +Overview +******** + +The sample shows a simple broadcast and reception of DECT NR+ messages between devices on a hard-coded channel. + +After initialization the devices will run a loop, transmitting a counter value before listening for incoming receptions. The time to listen is given by the :kconfig:option:`CONFIG_RX_PERIOD_S` Kconfig option. +The loop is exited after a number of transmissions given by the :kconfig:option:`CONFIG_TX_TRANSMISSIONS` Kconfig option, or continue forever if the :kconfig:option:`CONFIG_TX_TRANSMISSIONS` Kconfig option is ``0``. + +Each device can be reset to run the sample again. + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/modem_trace_flash` + +.. include:: /includes/build_and_run_ns.txt + +.. important:: + + DECT NR+ operates on free but regulated radio channels. The regulations and availability of the channels varies by countries and regions. + It is your responsibility to operate the devices according to the local regulation, both at the development site and the device operating regions. + If you are in the EU and US, you can use the ``overlay-eu.conf`` and ``overlay-us.conf``Kconfig overlays respectively. + Otherwise set the carrier using the :kconfig:option:`CONFIG_CARRIER` Kconfig option. + +Testing +======= + +|test_sample| + +After programming the sample to your Development Kits, test it by performing the following steps: + +#. |connect_kit| +#. |connect_terminal| +#. Observe that the devices will transmit a counter value that is received by the other devices. +#. After a given number of transmissions, observe that the devices shut down and exit the sample. + +Sample output +============= + +The sample shows an output similar to the following: + +Device 1: + +.. code-block:: console + + *** Booting nRF Connect SDK v3.5.99-ncs1 *** + [00:00:00.378,784] app: Dect NR+ PHY Hello sample started + [00:00:00.691,375] app: Dect NR+ PHY initialized, device ID: 12345 + [00:00:00.691,406] app: Transmitting 0 + [00:00:05.697,784] app: Transmitting 1 + [00:00:10.704,193] app: Transmitting 2 + [00:00:14.186,553] app: Received header from device ID 67890 + [00:00:14.186,889] app: Received data (RSSI: -54.5): Hello DECT! 0 + [00:00:15.710,571] app: Transmitting 3 + [00:00:19.192,932] app: Received header from device ID 67890 + [00:00:19.193,267] app: Received data (RSSI: -54.5): Hello DECT! 1 + [00:00:20.716,949] app: Transmitting 4 + ... + [00:02:24.352,661] app: Received header from device ID 67890 + [00:02:24.352,996] app: Received data (RSSI: -54.5): Hello DECT! 26 + [00:02:25.876,739] app: Transmitting 29 + [00:02:25.876,831] app: Reached maximum number of transmissions (30) + [00:02:25.876,831] app: Shutting down + [00:02:25.893,554] app: Bye! + +Device 2: + +.. code-block:: console + + *** Booting nRF Connect SDK v3.5.99-ncs1 *** + [00:00:00.407,287] app: Dect NR+ PHY Hello sample started + [00:00:00.719,238] app: Dect NR+ PHY initialized, device ID: 67890 + [00:00:00.719,268] app: Transmitting 0 + [00:00:02.254,211] app: Received header from device ID 12345 + [00:00:02.254,547] app: Received data (RSSI: -54.5): Hello DECT! 3 + [00:00:05.725,646] app: Transmitting 1 + [00:00:07.260,620] app: Received header from device ID 12345 + [00:00:07.260,955] app: Received data (RSSI: -54.5): Hello DECT! 4 + ... + [00:02:10.885,284] app: Transmitting 26 + [00:02:12.420,318] app: Received header from device ID 12345 + [00:02:12.420,654] app: Received data (RSSI: -54.5): Hello DECT! 29 + [00:02:15.891,693] app: Transmitting 27 + [00:02:20.898,071] app: Transmitting 28 + [00:02:25.904,449] app: Transmitting 29 + [00:02:25.904,541] app: Reached maximum number of transmissions (30) + [00:02:25.904,571] app: Shutting down + [00:02:25.921,325] app: Bye! + +Dependencies +************ + +It uses the following `sdk-nrfxlib`_ libraries: + +* :ref:`nrfxlib:nrf_modem` + +It uses the following Zephyr libraries: + +* :ref:`zephyr:uart_api` + + +In addition, it uses the following secure firmware components: + +* :ref:`Trusted Firmware-M ` diff --git a/samples/dect/dect_phy/hello_dect/overlay-eu.conf b/samples/dect/dect_phy/hello_dect/overlay-eu.conf new file mode 100644 index 000000000000..fd71e5f1617d --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/overlay-eu.conf @@ -0,0 +1 @@ +CONFIG_CARRIER=1702 diff --git a/samples/dect/dect_phy/hello_dect/overlay-us.conf b/samples/dect/dect_phy/hello_dect/overlay-us.conf new file mode 100644 index 000000000000..321322186a17 --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/overlay-us.conf @@ -0,0 +1 @@ +CONFIG_CARRIER=1677 diff --git a/samples/dect/dect_phy/hello_dect/prj.conf b/samples/dect/dect_phy/hello_dect/prj.conf new file mode 100644 index 000000000000..ec004a088ed1 --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/prj.conf @@ -0,0 +1,6 @@ +CONFIG_NRF_MODEM_LIB=y + +CONFIG_NRF_MODEM_LINK_BINARY_DECT_PHY=y +CONFIG_HWINFO=y + +CONFIG_LOG=y diff --git a/samples/dect/dect_phy/hello_dect/sample.yaml b/samples/dect/dect_phy/hello_dect/sample.yaml new file mode 100644 index 000000000000..8d1f3595cd07 --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/sample.yaml @@ -0,0 +1,9 @@ +sample: + name: Dect NR+ PHY Hello +tests: + sample.nrf9161.dect_phy_hello: + build_only: true + integration_platforms: + - nrf9161dk_nrf9161_ns + platform_allow: nrf9161dk_nrf9161_ns + tags: ci_build diff --git a/samples/dect/dect_phy/hello_dect/src/main.c b/samples/dect/dect_phy/hello_dect/src/main.c new file mode 100644 index 000000000000..3222ca78e501 --- /dev/null +++ b/samples/dect/dect_phy/hello_dect/src/main.c @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(app); + +BUILD_ASSERT(CONFIG_CARRIER, "Carrier must be configured according to local regulations"); + +#define DATA_LEN_MAX 32 + +static bool exit; +static uint16_t device_id; + +/* Header type 1 */ +struct phy_ctrl_field_common { + uint32_t packet_length : 4; + uint32_t packet_length_type : 1; + uint32_t header_format : 3; + uint32_t short_network_id : 8; + uint32_t transmitter_id_hi : 8; + uint32_t transmitter_id_lo : 8; + uint32_t df_mcs : 3; + uint32_t reserved : 1; + uint32_t transmit_power : 4; + uint32_t pad : 24; +}; + +/* Semaphore to synchronize modem calls. */ +K_SEM_DEFINE(operation_sem, 0, 1); + +/* Callback after init operation. */ +static void init(const uint64_t *time, int16_t temp, enum nrf_modem_dect_phy_err err, + const struct nrf_modem_dect_phy_modem_cfg *cfg) +{ + if (err) { + LOG_ERR("Init failed, err %d", err); + exit = true; + return; + } + + k_sem_give(&operation_sem); +} + +/* Callback after deinit operation. */ +static void deinit(const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + if (err) { + LOG_ERR("Deinit failed, err %d", err); + return; + } + + k_sem_give(&operation_sem); +} + +/* Operation complete notification. */ +static void op_complete(const uint64_t *time, int16_t temperature, + enum nrf_modem_dect_phy_err err, uint32_t handle) +{ + LOG_DBG("Operation %d has completed with result %d", handle, err); + k_sem_give(&operation_sem); +} + +/* Callback after receive stop operation. */ +static void rx_stop(const uint64_t *time, enum nrf_modem_dect_phy_err err, uint32_t handle) +{ + LOG_DBG("operation_stop_cb Status %d Handle %d", err, handle); + k_sem_give(&operation_sem); +} + +/* Physical Control Channel reception notification. */ +static void pcc( + const uint64_t *time, + const struct nrf_modem_dect_phy_rx_pcc_status *status, + const union nrf_modem_dect_phy_hdr *hdr) +{ + struct phy_ctrl_field_common *header = (struct phy_ctrl_field_common *)hdr->type_1; + + LOG_INF("Received header from device ID %d", + header->transmitter_id_hi << 8 | header->transmitter_id_lo); +} + +/* Physical Control Channel CRC error notification. */ +static void pcc_crc_err(const uint64_t *time, + const struct nrf_modem_dect_phy_rx_pcc_crc_failure *crc_failure) +{ + LOG_DBG("PCC CRC error"); +} + +/* Physical Data Channel reception notification. */ +static void pdc(const uint64_t *time, + const struct nrf_modem_dect_phy_rx_pdc_status *status, + const void *data, uint32_t len) +{ + /* Received RSSI value is in fixed precision format Q14.1 */ + LOG_INF("Received data (RSSI: %d.%d): %s", + (status->rssi_2 / 2), (status->rssi_2 & 0b1) * 5, (char *)data); +} + +/* Physical Data Channel CRC error notification. */ +static void pdc_crc_err( + const uint64_t *time, const struct nrf_modem_dect_phy_rx_pdc_crc_failure *crc_failure) +{ + LOG_DBG("PDC CRC error"); +} + +/* RSSI measurement result notification. */ +static void rssi(const uint64_t *time, const struct nrf_modem_dect_phy_rssi_meas *status) +{ + LOG_DBG("RSSI measurement for carrier %d", status->carrier); +} + +/* Callback after link configuration operation. */ +static void link_config(const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + LOG_DBG("Link configuration callback"); +} + +/* Callback after time query operation. */ +static void time_get(const uint64_t *time, enum nrf_modem_dect_phy_err err) +{ + LOG_DBG("time_query_cb time %"PRIu64" Status %d", *time, err); +} + +/* Callback after capability get operation. */ +static void capability_get(const uint64_t *time, enum nrf_modem_dect_phy_err err, + const struct nrf_modem_dect_phy_capability *capability) +{ + LOG_DBG("capability_get time %"PRIu64" Status %d", *time, err); +} + +/* Dect PHY callbacks. */ +static struct nrf_modem_dect_phy_callbacks dect_phy_callbacks = { + .init = init, + .deinit = deinit, + .op_complete = op_complete, + .rx_stop = rx_stop, + .pcc = pcc, + .pcc_crc_err = pcc_crc_err, + .pdc = pdc, + .pdc_crc_err = pdc_crc_err, + .rssi = rssi, + .link_config = link_config, + .time_get = time_get, + .capability_get = capability_get, +}; + +/* Dect PHY init parameters. */ +static struct nrf_modem_dect_phy_init_params dect_phy_init_params = { + .harq_rx_expiry_time_us = 5000000, + .harq_rx_process_count = 4, +}; + +/* Send operation. */ +static int transmit(uint32_t handle, void *data, size_t data_len) +{ + int err; + + struct phy_ctrl_field_common header = { + .header_format = 0x0, + .packet_length_type = 0x0, + .packet_length = 0x01, + .short_network_id = (CONFIG_NETWORK_ID & 0xff), + .transmitter_id_hi = (device_id >> 8), + .transmitter_id_lo = (device_id & 0xff), + .transmit_power = CONFIG_TX_POWER, + .reserved = 0, + .df_mcs = CONFIG_MCS, + }; + + struct nrf_modem_dect_phy_tx_params tx_op_params = { + .start_time = 0, + .handle = handle, + .network_id = CONFIG_NETWORK_ID, + .phy_type = 0, + .lbt_rssi_threshold_max = 0, + .carrier = CONFIG_CARRIER, + .lbt_period = NRF_MODEM_DECT_LBT_PERIOD_MAX, + .phy_header = (union nrf_modem_dect_phy_hdr *)&header, + .data = data, + .data_size = data_len, + }; + + err = nrf_modem_dect_phy_tx(&tx_op_params); + if (err != 0) { + return err; + } + + return 0; +} + +/* Receive operation. */ +static int receive(uint32_t handle) +{ + int err; + + struct nrf_modem_dect_phy_rx_params rx_op_params = { + .start_time = 0, + .handle = handle, + .network_id = CONFIG_NETWORK_ID, + .mode = NRF_MODEM_DECT_PHY_RX_MODE_CONTINUOUS, + .rssi_interval = NRF_MODEM_DECT_PHY_RSSI_INTERVAL_OFF, + .link_id = NRF_MODEM_DECT_PHY_LINK_UNSPECIFIED, + .rssi_level = -60, + .carrier = CONFIG_CARRIER, + .duration = CONFIG_RX_PERIOD_S * MSEC_PER_SEC * + NRF_MODEM_DECT_MODEM_TIME_TICK_RATE_KHZ, + .filter.short_network_id = CONFIG_NETWORK_ID & 0xff, + .filter.is_short_network_id_used = 1, + /* listen for everything (broadcast mode used) */ + .filter.receiver_identity = 0, + }; + + err = nrf_modem_dect_phy_rx(&rx_op_params); + if (err != 0) { + return err; + } + + return 0; +} + +int main(void) +{ + int err; + uint32_t tx_handle = 0; + uint32_t rx_handle = 1; + uint32_t tx_counter_value = 0; + uint8_t tx_buf[DATA_LEN_MAX]; + size_t tx_len; + + LOG_INF("Dect NR+ PHY Hello sample started"); + + err = nrf_modem_lib_init(); + if (err) { + LOG_ERR("modem init failed, err %d", err); + return err; + } + + err = nrf_modem_dect_phy_callback_set(&dect_phy_callbacks); + if (err) { + LOG_ERR("nrf_modem_dect_phy_callback_set failed, err %d", err); + return err; + } + + err = nrf_modem_dect_phy_init(&dect_phy_init_params); + if (err) { + LOG_ERR("nrf_modem_dect_phy_init failed, err %d", err); + return err; + } + + k_sem_take(&operation_sem, K_FOREVER); + if (exit) { + return -EIO; + } + + hwinfo_get_device_id((void *)&device_id, sizeof(device_id)); + + LOG_INF("Dect NR+ PHY initialized, device ID: %d", device_id); + + while (1) { + /** Transmitting message */ + LOG_INF("Transmitting %d", tx_counter_value); + tx_len = sprintf(tx_buf, "Hello DECT! %d", tx_counter_value); + + err = transmit(tx_handle, tx_buf, tx_len); + if (err) { + LOG_ERR("Transmisstion failed, err %d", err); + return err; + } + + tx_counter_value++; + + if ((tx_counter_value >= CONFIG_TX_TRANSMISSIONS) && CONFIG_TX_TRANSMISSIONS) { + LOG_INF("Reached maximum number of transmissions (%d)", + CONFIG_TX_TRANSMISSIONS); + break; + } + + /* Wait for TX operation to complete. */ + k_sem_take(&operation_sem, K_FOREVER); + + /** Receiving messages for CONFIG_RX_PERIOD_S seconds. */ + err = receive(rx_handle); + if (err) { + LOG_ERR("Reception failed, err %d", err); + return err; + } + + /* Wait for RX operation to complete. */ + k_sem_take(&operation_sem, K_FOREVER); + } + + LOG_INF("Shutting down"); + + err = nrf_modem_dect_phy_deinit(); + if (err) { + LOG_ERR("nrf_modem_dect_phy_deinit() failed, err %d", err); + return err; + } + + k_sem_take(&operation_sem, K_FOREVER); + + err = nrf_modem_lib_shutdown(); + if (err) { + LOG_ERR("nrf_modem_lib_shutdown() failed, err %d", err); + return err; + } + + LOG_INF("Bye!"); + + return 0; +} diff --git a/samples/edge_impulse/data_forwarder/prj.conf b/samples/edge_impulse/data_forwarder/prj.conf index 8e616348f830..ad6b76360550 100644 --- a/samples/edge_impulse/data_forwarder/prj.conf +++ b/samples/edge_impulse/data_forwarder/prj.conf @@ -12,9 +12,5 @@ CONFIG_RTT_CONSOLE=y # Data forwarder uses UART async API CONFIG_UART_ASYNC_API=y -# snprintf is used with floating-point data -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y - # Enable simulated sensor CONFIG_SENSOR=y diff --git a/samples/edge_impulse/data_forwarder/sample.yaml b/samples/edge_impulse/data_forwarder/sample.yaml index 2e8bea7a6dde..d2dbf3b14a3c 100644 --- a/samples/edge_impulse/data_forwarder/sample.yaml +++ b/samples/edge_impulse/data_forwarder/sample.yaml @@ -5,17 +5,17 @@ tests: sample.ei_data_forwarder: build_only: true platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - thingy91x_nrf9151_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns platform_exclude: native_posix qemu_x86 qemu_cortex_m3 tags: ci_build diff --git a/samples/edge_impulse/wrapper/sample.yaml b/samples/edge_impulse/wrapper/sample.yaml index 2c7832409eef..3ca2c8f373c2 100644 --- a/samples/edge_impulse/wrapper/sample.yaml +++ b/samples/edge_impulse/wrapper/sample.yaml @@ -13,19 +13,19 @@ common: - "Anomaly: (-[0-9]+[.][0-9]+)|(0[.]0[0-9]+)" type: multi_line platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 - - thingy91x_nrf9151_ns + - thingy91x/nrf9151/ns integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 platform_exclude: native_posix qemu_x86 tests: diff --git a/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..78824bdc4033 --- /dev/null +++ b/samples/esb/esb_prx/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = < &gpio9 0 GPIO_ACTIVE_HIGH >; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = < &gpio9 1 GPIO_ACTIVE_HIGH >; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = < &gpio9 2 GPIO_ACTIVE_HIGH >; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = < &gpio9 3 GPIO_ACTIVE_HIGH >; + label = "Green LED 3"; + }; + }; + + aliases { + led0 = &led0; + led1 = &led1; + led2 = &led2; + led3 = &led3; + }; + + chosen { + zephyr,console = &uart136; + }; +}; + +&gpio9 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpiote130 { + owned-channels = <0 1 2 3 4 5 6 7>; + status = "okay"; +}; + +&uart136 { + status = "okay"; + memory-regions = <&cpurad_dma_region>; +}; + +&uart135 { + status = "disabled"; +}; + +&dppic020 { + status = "okay"; + source-channels = < 0 1 2 3 4 5 >; + sink-channels = < 6 7 8 9 10 11 >; +}; diff --git a/samples/esb/esb_prx/prj.conf b/samples/esb/esb_prx/prj.conf index 621266d17695..9681a0e5ae44 100644 --- a/samples/esb/esb_prx/prj.conf +++ b/samples/esb/esb_prx/prj.conf @@ -5,3 +5,4 @@ # CONFIG_NCS_SAMPLES_DEFAULTS=y CONFIG_ESB=y +CONFIG_DK_LIBRARY=y diff --git a/samples/esb/esb_prx/sample.yaml b/samples/esb/esb_prx/sample.yaml index d6cc8067fc40..fb3ddf8a2728 100644 --- a/samples/esb/esb_prx/sample.yaml +++ b/samples/esb/esb_prx/sample.yaml @@ -5,22 +5,33 @@ tests: filter: CONFIG_UART_CONSOLE and CONFIG_SERIAL_SUPPORT_INTERRUPT harness: keyboard integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52810 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52810 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52dk/nrf52810 tags: samples console sample.esb.prx.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52810 - - nrf5340dk_nrf5340_cpunet - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf52dk_nrf52810 nrf5340dk_nrf5340_cpunet nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52810 + - nrf5340dk/nrf5340/cpunet + - nrf21540dk/nrf52840 + - nrf54h20dk/nrf54h20/cpurad + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52dk/nrf52832 + nrf52833dk/nrf52833 + nrf52840dk/nrf52840 + nrf52dk/nrf52810 + nrf5340dk/nrf5340/cpunet + nrf21540dk/nrf52840 + nrf54h20dk/nrf54h20/cpurad + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: esb ci_build sample.esb.prx.dynamic_irq: build_only: true @@ -29,14 +40,24 @@ tests: - CONFIG_DYNAMIC_INTERRUPTS=y - CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y integration_platforms: - - nrf5340dk_nrf5340_cpunet - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpunet nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpunet + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpunet nrf52840dk/nrf52840 tags: esb ci_build sample.esb.prx.nrf5340_nrf21540: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet + tags: esb ci_build + sample.esb.prx.fast_switching: + build_only: true + extra_configs: + - CONFIG_ESB_FAST_SWITCHING=y + - CONFIG_ESB_FAST_CHANNEL_SWITCHING=y + integration_platforms: + - nrf54h20dk/nrf54h20/cpurad + platform_allow: > + nrf54h20dk/nrf54h20/cpurad tags: esb ci_build diff --git a/samples/esb/esb_prx/src/main.c b/samples/esb/esb_prx/src/main.c index b5478307ddac..7c950e66a78f 100644 --- a/samples/esb/esb_prx/src/main.c +++ b/samples/esb/esb_prx/src/main.c @@ -5,8 +5,10 @@ */ #include #include +#if defined(CONFIG_CLOCK_CONTROL_NRF) #include #include +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ #include #include #include @@ -14,63 +16,23 @@ #include #include #include +#include LOG_MODULE_REGISTER(esb_prx, CONFIG_ESB_PRX_APP_LOG_LEVEL); -static const struct gpio_dt_spec leds[] = { - GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led1), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led3), gpios), -}; - -BUILD_ASSERT(DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led1), gpios)) && - DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led2), gpios)) && - DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led3), gpios)), - "All LEDs must be on the same port"); - static struct esb_payload rx_payload; static struct esb_payload tx_payload = ESB_CREATE_PAYLOAD(0, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17); -static int leds_init(void) -{ - if (!device_is_ready(leds[0].port)) { - LOG_ERR("LEDs port not ready"); - return -ENODEV; - } - - for (size_t i = 0; i < ARRAY_SIZE(leds); i++) { - int err = gpio_pin_configure_dt(&leds[i], GPIO_OUTPUT); - - if (err) { - LOG_ERR("Unable to configure LED%u, err %d.", i, err); - return err; - } - } - - return 0; -} - static void leds_update(uint8_t value) { - bool led0_status = !(value % 8 > 0 && value % 8 <= 4); - bool led1_status = !(value % 8 > 1 && value % 8 <= 5); - bool led2_status = !(value % 8 > 2 && value % 8 <= 6); - bool led3_status = !(value % 8 > 3); + uint32_t leds_mask = + (!(value % 8 > 0 && value % 8 <= 4) ? DK_LED1_MSK : 0) | + (!(value % 8 > 1 && value % 8 <= 5) ? DK_LED2_MSK : 0) | + (!(value % 8 > 2 && value % 8 <= 6) ? DK_LED3_MSK : 0) | + (!(value % 8 > 3) ? DK_LED4_MSK : 0); - gpio_port_pins_t mask = BIT(leds[0].pin) | BIT(leds[1].pin) | - BIT(leds[2].pin) | BIT(leds[3].pin); - - gpio_port_value_t val = led0_status << leds[0].pin | - led1_status << leds[1].pin | - led2_status << leds[2].pin | - led3_status << leds[3].pin; - - gpio_port_set_masked_raw(leds[0].port, mask, val); + dk_set_leds(leds_mask); } void event_handler(struct esb_evt const *event) @@ -101,6 +63,7 @@ void event_handler(struct esb_evt const *event) } } +#if defined(CONFIG_CLOCK_CONTROL_NRF) int clocks_start(void) { int err; @@ -133,6 +96,7 @@ int clocks_start(void) LOG_DBG("HF clock started"); return 0; } +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ int esb_initialize(void) { @@ -151,6 +115,9 @@ int esb_initialize(void) config.mode = ESB_MODE_PRX; config.event_handler = event_handler; config.selective_auto_ack = true; + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + config.use_fast_ramp_up = true; + } err = esb_init(&config); if (err) { @@ -181,13 +148,16 @@ int main(void) LOG_INF("Enhanced ShockBurst prx sample"); +#if defined(CONFIG_CLOCK_CONTROL_NRF) err = clocks_start(); if (err) { return 0; } +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ - err = leds_init(); + err = dk_leds_init(); if (err) { + LOG_ERR("LEDs initialization failed, err %d", err); return 0; } diff --git a/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..78824bdc4033 --- /dev/null +++ b/samples/esb/esb_ptx/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + leds { + compatible = "gpio-leds"; + + led0: led_0 { + gpios = < &gpio9 0 GPIO_ACTIVE_HIGH >; + label = "Green LED 0"; + }; + + led1: led_1 { + gpios = < &gpio9 1 GPIO_ACTIVE_HIGH >; + label = "Green LED 1"; + }; + + led2: led_2 { + gpios = < &gpio9 2 GPIO_ACTIVE_HIGH >; + label = "Green LED 2"; + }; + + led3: led_3 { + gpios = < &gpio9 3 GPIO_ACTIVE_HIGH >; + label = "Green LED 3"; + }; + }; + + aliases { + led0 = &led0; + led1 = &led1; + led2 = &led2; + led3 = &led3; + }; + + chosen { + zephyr,console = &uart136; + }; +}; + +&gpio9 { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpiote130 { + owned-channels = <0 1 2 3 4 5 6 7>; + status = "okay"; +}; + +&uart136 { + status = "okay"; + memory-regions = <&cpurad_dma_region>; +}; + +&uart135 { + status = "disabled"; +}; + +&dppic020 { + status = "okay"; + source-channels = < 0 1 2 3 4 5 >; + sink-channels = < 6 7 8 9 10 11 >; +}; diff --git a/samples/esb/esb_ptx/prj.conf b/samples/esb/esb_ptx/prj.conf index 621266d17695..9681a0e5ae44 100644 --- a/samples/esb/esb_ptx/prj.conf +++ b/samples/esb/esb_ptx/prj.conf @@ -5,3 +5,4 @@ # CONFIG_NCS_SAMPLES_DEFAULTS=y CONFIG_ESB=y +CONFIG_DK_LIBRARY=y diff --git a/samples/esb/esb_ptx/sample.yaml b/samples/esb/esb_ptx/sample.yaml index 9f4725b55948..160a5a08b4ea 100644 --- a/samples/esb/esb_ptx/sample.yaml +++ b/samples/esb/esb_ptx/sample.yaml @@ -5,22 +5,33 @@ tests: filter: CONFIG_UART_CONSOLE and CONFIG_SERIAL_SUPPORT_INTERRUPT harness: keyboard integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52810 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf52dk_nrf52810 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52810 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf52dk/nrf52810 tags: samples console sample.esb.ptx.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52810 - - nrf5340dk_nrf5340_cpunet - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 - nrf52dk_nrf52810 nrf5340dk_nrf5340_cpunet nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52810 + - nrf5340dk/nrf5340/cpunet + - nrf21540dk/nrf52840 + - nrf54h20dk/nrf54h20/cpurad + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52dk/nrf52832 + nrf52833dk/nrf52833 + nrf52840dk/nrf52840 + nrf52dk/nrf52810 + nrf5340dk/nrf5340/cpunet + nrf21540dk/nrf52840 + nrf54h20dk/nrf54h20/cpurad + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: esb ci_build sample.esb.ptx.dynamic_irq: build_only: true @@ -29,14 +40,24 @@ tests: - CONFIG_DYNAMIC_INTERRUPTS=y - CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y integration_platforms: - - nrf5340dk_nrf5340_cpunet - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpunet nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpunet + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpunet nrf52840dk/nrf52840 tags: esb ci_build sample.esb.ptx.nrf5340_nrf21540: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet + tags: esb ci_build + sample.esb.ptx.fast_switching: + build_only: true + extra_configs: + - CONFIG_ESB_FAST_SWITCHING=y + - CONFIG_ESB_FAST_CHANNEL_SWITCHING=y + integration_platforms: + - nrf54h20dk/nrf54h20/cpurad + platform_allow: > + nrf54h20dk/nrf54h20/cpurad tags: esb ci_build diff --git a/samples/esb/esb_ptx/src/main.c b/samples/esb/esb_ptx/src/main.c index b64950ab7409..d274c239c371 100644 --- a/samples/esb/esb_ptx/src/main.c +++ b/samples/esb/esb_ptx/src/main.c @@ -3,8 +3,10 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +#if defined(CONFIG_CLOCK_CONTROL_NRF) #include #include +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ #include #include #include @@ -14,24 +16,10 @@ #include #include #include +#include LOG_MODULE_REGISTER(esb_ptx, CONFIG_ESB_PTX_APP_LOG_LEVEL); -static const struct gpio_dt_spec leds[] = { - GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led1), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios), - GPIO_DT_SPEC_GET(DT_ALIAS(led3), gpios), -}; - -BUILD_ASSERT(DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led1), gpios)) && - DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led2), gpios)) && - DT_SAME_NODE(DT_GPIO_CTLR(DT_ALIAS(led0), gpios), - DT_GPIO_CTLR(DT_ALIAS(led3), gpios)), - "All LEDs must be on the same port"); - static bool ready = true; static struct esb_payload rx_payload; static struct esb_payload tx_payload = ESB_CREATE_PAYLOAD(0, @@ -68,6 +56,7 @@ void event_handler(struct esb_evt const *event) } } +#if defined(CONFIG_CLOCK_CONTROL_NRF) int clocks_start(void) { int err; @@ -100,6 +89,7 @@ int clocks_start(void) LOG_DBG("HF clock started"); return 0; } +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ int esb_initialize(void) { @@ -119,6 +109,9 @@ int esb_initialize(void) config.event_handler = event_handler; config.mode = ESB_MODE_PTX; config.selective_auto_ack = true; + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + config.use_fast_ramp_up = true; + } err = esb_init(&config); @@ -144,41 +137,15 @@ int esb_initialize(void) return 0; } -static int leds_init(void) -{ - if (!device_is_ready(leds[0].port)) { - LOG_ERR("LEDs port not ready"); - return -ENODEV; - } - - for (size_t i = 0; i < ARRAY_SIZE(leds); i++) { - int err = gpio_pin_configure_dt(&leds[i], GPIO_OUTPUT); - - if (err) { - LOG_ERR("Unable to configure LED%u, err %d.", i, err); - return err; - } - } - - return 0; -} - static void leds_update(uint8_t value) { - bool led0_status = !(value % 8 > 0 && value % 8 <= 4); - bool led1_status = !(value % 8 > 1 && value % 8 <= 5); - bool led2_status = !(value % 8 > 2 && value % 8 <= 6); - bool led3_status = !(value % 8 > 3); - - gpio_port_pins_t mask = BIT(leds[0].pin) | BIT(leds[1].pin) | - BIT(leds[2].pin) | BIT(leds[3].pin); - - gpio_port_value_t val = led0_status << leds[0].pin | - led1_status << leds[1].pin | - led2_status << leds[2].pin | - led3_status << leds[3].pin; + uint32_t leds_mask = + (!(value % 8 > 0 && value % 8 <= 4) ? DK_LED1_MSK : 0) | + (!(value % 8 > 1 && value % 8 <= 5) ? DK_LED2_MSK : 0) | + (!(value % 8 > 2 && value % 8 <= 6) ? DK_LED3_MSK : 0) | + (!(value % 8 > 3) ? DK_LED4_MSK : 0); - (void)gpio_port_set_masked_raw(leds[0].port, mask, val); + dk_set_leds(leds_mask); } int main(void) @@ -187,13 +154,16 @@ int main(void) LOG_INF("Enhanced ShockBurst ptx sample"); +#if defined(CONFIG_CLOCK_CONTROL_NRF) err = clocks_start(); if (err) { return 0; } +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ - err = leds_init(); + err = dk_leds_init(); if (err) { + LOG_ERR("LEDs initialization failed, err %d", err); return 0; } diff --git a/samples/event_manager_proxy/CMakeLists.txt b/samples/event_manager_proxy/CMakeLists.txt index dd87beac072d..731ed7966d36 100644 --- a/samples/event_manager_proxy/CMakeLists.txt +++ b/samples/event_manager_proxy/CMakeLists.txt @@ -6,28 +6,11 @@ cmake_minimum_required(VERSION 3.20.0) -if(CONF_FILE) - if(${CONF_FILE} MATCHES "prj_(.*).conf") - set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) - - # At this stage, any revision attached to the board will not be available - # as BOARD_REVISION, just "@" in the board name. We clean up the - # path to reflect what the associated overlay/fragment paths are supposed to - # look like in sample/boards. - string(REPLACE "@" "_" SAMPLE_BOARD "${BOARD}") - - set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${SAMPLE_BOARD}_${CONF_FILE_BUILD_TYPE}.overlay") - endif() - set(remote_CONF_FILE ${CONF_FILE}) -endif() - set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(event_manager_proxy) -message(STATUS "Overlay set to: ${DTC_OVERLAY_FILE}") - add_subdirectory(common_events) add_subdirectory(modules) diff --git a/samples/event_manager_proxy/Kconfig b/samples/event_manager_proxy/Kconfig index 8c228a213b41..272693176604 100644 --- a/samples/event_manager_proxy/Kconfig +++ b/samples/event_manager_proxy/Kconfig @@ -21,7 +21,7 @@ config APP_EVENT_MANAGER_REMOTE_WAIT_TO config APP_INCLUDE_REMOTE_IMAGE bool "Include remote image as sub image" depends on SOC_NRF5340_CPUAPP || SOC_NRF54H20_CPUAPP - default y if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS || BOARD_NRF54H20PDK_NRF54H20_CPUAPP) + default y if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS || BOARD_NRF54H20DK_NRF54H20_CPUAPP) select PARTITION_MANAGER_ENABLED if SOC_NRF5340_CPUAPP select BOARD_ENABLE_CPUNET if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS) @@ -29,7 +29,7 @@ config APP_REMOTE_BOARD string "The name of the CORE to be used by remote image" depends on APP_INCLUDE_REMOTE_IMAGE default DOMAIN_CPUNET_BOARD if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS) - default "nrf54h20pdk_nrf54h20_cpuppr" if BOARD_NRF54H20PDK_NRF54H20_CPUAPP + default "nrf54h20dk/nrf54h20/cpuppr" if BOARD_NRF54H20DK_NRF54H20_CPUAPP rsource "common_events/Kconfig" rsource "modules/Kconfig" diff --git a/samples/event_manager_proxy/Kconfig.sysbuild b/samples/event_manager_proxy/Kconfig.sysbuild index e7b1f3abeb57..ae473e5f8baa 100644 --- a/samples/event_manager_proxy/Kconfig.sysbuild +++ b/samples/event_manager_proxy/Kconfig.sysbuild @@ -8,7 +8,7 @@ source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" config REMOTE_BOARD string "The board used for remote target" - default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" - default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" - default "nrf54h20pdk_nrf54h20_cpuppr" if $(BOARD) = "nrf54h20pdk_nrf54h20_cpuapp" + default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP + default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP_NS + default "nrf54h20dk/nrf54h20/cpuppr" if BOARD_NRF54H20DK_NRF54H20_CPUAPP default "UNKNOWN" diff --git a/samples/event_manager_proxy/README.rst b/samples/event_manager_proxy/README.rst index 28647aa0c40f..b2439f4ba23b 100644 --- a/samples/event_manager_proxy/README.rst +++ b/samples/event_manager_proxy/README.rst @@ -54,11 +54,11 @@ By default, the Event Manager Proxy sample uses the OpenAMP backend provided by You can instead select the ICMSG backend configuration, which has smaller memory requirements. The ICMSG backend configuration is provided in the :file:`prj_icmsg.conf` file. -To provide the ICMSG backend configuration, specify the ``-DCONF_FILE=prj_icmsg.conf`` parameter along with the build command when building the sample: +To provide the ICMSG backend configuration, specify the ``-DFILE_SUFFIX=icmsg`` parameter along with the build command when building the sample: .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -- -DCONF_FILE=prj_icmsg.conf + west build -p -b nrf5340dk/nrf5340/cpuapp -- -DFILE_SUFFIX=icmsg Building and running ******************** @@ -74,7 +74,7 @@ Complete the following steps to program the sample: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp + west build -b nrf5340dk/nrf5340/cpuapp #. Program both the cores: diff --git a/samples/event_manager_proxy/aci/CMakeLists.txt b/samples/event_manager_proxy/aci/CMakeLists.txt index 3ad208a289ec..2bff61e37abf 100644 --- a/samples/event_manager_proxy/aci/CMakeLists.txt +++ b/samples/event_manager_proxy/aci/CMakeLists.txt @@ -2,7 +2,8 @@ # be executed for all images in the build, also for the child image being # added below. -if (CONFIG_APP_INCLUDE_REMOTE_IMAGE) +if(CONFIG_APP_INCLUDE_REMOTE_IMAGE) + set(remote_FILE_SUFFIX ${FILE_SUFFIX}) add_child_image( NAME remote SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../remote diff --git a/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf b/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf index f22963a97252..d787f0b3716b 100644 --- a/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -5,4 +5,3 @@ # CONFIG_BOARD_ENABLE_CPUNET=y -CONFIG_APP_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" diff --git a/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf b/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf index f22963a97252..d787f0b3716b 100644 --- a/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf +++ b/samples/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf @@ -5,4 +5,3 @@ # CONFIG_BOARD_ENABLE_CPUNET=y -CONFIG_APP_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" diff --git a/samples/event_manager_proxy/boards/nrf54h20dk_nrf54h20_cpuapp_icmsg.overlay b/samples/event_manager_proxy/boards/nrf54h20dk_nrf54h20_cpuapp_icmsg.overlay new file mode 100644 index 000000000000..b02284045723 --- /dev/null +++ b/samples/event_manager_proxy/boards/nrf54h20dk_nrf54h20_cpuapp_icmsg.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Replace default ipc0 instance */ +/delete-node/ &ipc0; + +/* Enabled nodes required by IPC + * Two mboxes, one for each sides and one ipc instance + */ + +&cpuapp_bellboard { + status = "okay"; +}; + +&cpuppr_vevif { + status = "okay"; +}; + +ipc0: &cpuapp_cpuppr_ipc { + status = "okay"; +}; + +/* UART and RAM3 instance used by PPR should be enabled at build time + * using nordic-ppr snippet. + */ diff --git a/samples/event_manager_proxy/boards/nrf54h20pdk_nrf54h20_cpuapp_icmsg.overlay b/samples/event_manager_proxy/boards/nrf54h20pdk_nrf54h20_cpuapp_icmsg.overlay deleted file mode 100644 index d9d8ac9c44da..000000000000 --- a/samples/event_manager_proxy/boards/nrf54h20pdk_nrf54h20_cpuapp_icmsg.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* Enabled nodes required by IPC - * Two mboxes, one for each sides and one ipc instance - */ - -&cpuapp_bellboard { - status = "okay"; -}; - -&cpuppr_vevif { - status = "okay"; -}; - -ipc0: &cpuapp_cpuppr_ipc { - status = "okay"; -}; - -/* UART and RAM3 instance used by PPR should be enabled at build time - * using nordic-ppr snippet. - */ diff --git a/samples/event_manager_proxy/remote/CMakeLists.txt b/samples/event_manager_proxy/remote/CMakeLists.txt index fb32168a987f..c87da942feb3 100644 --- a/samples/event_manager_proxy/remote/CMakeLists.txt +++ b/samples/event_manager_proxy/remote/CMakeLists.txt @@ -6,20 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -if(CONF_FILE) - if(${CONF_FILE} MATCHES "prj_(.*).conf") - set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) - - # At this stage, any revision attached to the board will not be available - # as BOARD_REVISION, just "@" in the board name. We clean up the - # path to reflect what the associated overlay/fragment paths are supposed to - # look like in sample/boards. - string(REPLACE "@" "_" SAMPLE_BOARD "${BOARD}") - - set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${SAMPLE_BOARD}_${CONF_FILE_BUILD_TYPE}.overlay") - endif() -endif() - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(event_manager_proxy_remote) diff --git a/samples/event_manager_proxy/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.conf b/samples/event_manager_proxy/remote/boards/nrf54h20dk_nrf54h20_cpuppr_icmsg.conf similarity index 100% rename from samples/event_manager_proxy/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.conf rename to samples/event_manager_proxy/remote/boards/nrf54h20dk_nrf54h20_cpuppr_icmsg.conf diff --git a/samples/event_manager_proxy/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.overlay b/samples/event_manager_proxy/remote/boards/nrf54h20dk_nrf54h20_cpuppr_icmsg.overlay similarity index 100% rename from samples/event_manager_proxy/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.overlay rename to samples/event_manager_proxy/remote/boards/nrf54h20dk_nrf54h20_cpuppr_icmsg.overlay diff --git a/samples/event_manager_proxy/sample.yaml b/samples/event_manager_proxy/sample.yaml index acf053e2ad57..32996d5b2355 100644 --- a/samples/event_manager_proxy/sample.yaml +++ b/samples/event_manager_proxy/sample.yaml @@ -10,24 +10,21 @@ common: tests: sample.event_manager_proxy: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - sample.event_manager_proxy.nrf5340dk_nrf5340_cpuapp.icmsg: + - nrf5340dk/nrf5340/cpuapp + sample.event_manager_proxy.nrf5340dk/nrf5340/cpuapp.icmsg: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - extra_args: CONF_FILE=prj_icmsg.conf - sample.event_manager_proxy.nrf54h20pdk_cpuapp.icmsg: + - nrf5340dk/nrf5340/cpuapp + extra_args: + FILE_SUFFIX=icmsg + sample.event_manager_proxy.nrf54h20dk_cpuapp.icmsg: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: event_manager_proxy_SNIPPET=nordic-ppr - event_manager_proxy_CONF_FILE=prj_icmsg.conf - event_manager_proxy_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_icmsg.overlay - remote_CONF_FILE=prj_icmsg.conf - remote_OVERLAY_CONFIG=boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.conf - remote_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuppr_icmsg.overlay + FILE_SUFFIX=icmsg diff --git a/samples/gazell/gzll_ack_payload_device/sample.yaml b/samples/gazell/gzll_ack_payload_device/sample.yaml index 1d7285df8ac0..7c14c23fc232 100644 --- a/samples/gazell/gzll_ack_payload_device/sample.yaml +++ b/samples/gazell/gzll_ack_payload_device/sample.yaml @@ -4,8 +4,8 @@ tests: sample.gazell.gzll_ack_payload.device.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 tags: ci_build diff --git a/samples/gazell/gzll_ack_payload_host/sample.yaml b/samples/gazell/gzll_ack_payload_host/sample.yaml index cfa863d20f8c..57f0e8d7237a 100644 --- a/samples/gazell/gzll_ack_payload_host/sample.yaml +++ b/samples/gazell/gzll_ack_payload_host/sample.yaml @@ -4,8 +4,8 @@ tests: sample.gazell.gzll_ack_payload.host.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 tags: ci_build diff --git a/samples/gazell/gzp_dynamic_pairing_device/sample.yaml b/samples/gazell/gzp_dynamic_pairing_device/sample.yaml index 6b1bcde41299..404a11f2c593 100644 --- a/samples/gazell/gzp_dynamic_pairing_device/sample.yaml +++ b/samples/gazell/gzp_dynamic_pairing_device/sample.yaml @@ -4,8 +4,8 @@ tests: sample.gazell.gzp_dynamic_pairing.device.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 tags: ci_build diff --git a/samples/gazell/gzp_dynamic_pairing_host/sample.yaml b/samples/gazell/gzp_dynamic_pairing_host/sample.yaml index 06d76f50627c..8394320006d7 100644 --- a/samples/gazell/gzp_dynamic_pairing_host/sample.yaml +++ b/samples/gazell/gzp_dynamic_pairing_host/sample.yaml @@ -4,8 +4,8 @@ tests: sample.gazell.gzp_dynamic_pairing.host.build: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 tags: ci_build diff --git a/samples/hw_id/sample.yaml b/samples/hw_id/sample.yaml index 87c053fb2708..cef08ce3eac8 100644 --- a/samples/hw_id/sample.yaml +++ b/samples/hw_id/sample.yaml @@ -5,35 +5,35 @@ tests: sample.hw_id.device_id: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160 nrf9160dk_nrf9160_ns + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160 nrf9160dk/nrf9160/ns tags: ci_build sample.hw_id.uuid: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build extra_args: OVERLAY_CONFIG=overlay-uuid.conf sample.hw_id.imei: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build extra_args: OVERLAY_CONFIG=overlay-imei.conf sample.hw_id.ble: build_only: true integration_platforms: - - nrf51dk_nrf51422 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf51dk/nrf51822 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns platform_allow: > - nrf51dk_nrf51422 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns + nrf51dk/nrf51822 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns tags: ci_build extra_args: OVERLAY_CONFIG=overlay-ble-mac.conf diff --git a/samples/ipc/ipc_service/Kconfig b/samples/ipc/ipc_service/Kconfig index 8484fef6a51d..c0582e40095e 100644 --- a/samples/ipc/ipc_service/Kconfig +++ b/samples/ipc/ipc_service/Kconfig @@ -16,7 +16,7 @@ config APP_INCLUDE_REMOTE_IMAGE config APP_REMOTE_BOARD string "The name of the CORE to be used by remote image" - default "nrf5340dk_nrf5340_cpunet" + default "nrf5340dk/nrf5340/cpunet" depends on APP_INCLUDE_REMOTE_IMAGE endif # SOC_SERIES_NRF53X diff --git a/samples/ipc/ipc_service/README.rst b/samples/ipc/ipc_service/README.rst index bbb09f95475a..74f4cea34073 100644 --- a/samples/ipc/ipc_service/README.rst +++ b/samples/ipc/ipc_service/README.rst @@ -13,7 +13,16 @@ Overview ******** The sample application tests throughput of the IPC service with available backends. -Currently, the sample supports OpenAMP RPMSG and ICMSG backends. +Currently, the sample supports the following backends: + +* :ref:`zephyr:nrf5340dk_nrf5340` board: + + * `OpenAMP`_ library + * :ref:`zephyr:ipc_service_backend_icmsg` + +* :ref:`zephyr:nrf54h20dk_nrf54h20` board: + + * :ref:`zephyr:ipc_service_backend_icbmsg` Each core periodically prints out data throughput in bytes per second. @@ -60,8 +69,8 @@ You can build the sample using either the RPMsg or ICMSG backends, as follows: .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_default . - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_default . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_default . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_default . A set of overlays is available for the sample to verify the throughput when only one core is sending the data. Use these overlays when building the IPC sample to test the following scenarios: @@ -70,30 +79,29 @@ Use these overlays when building the IPC sample to test the following scenarios: .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpuapp_sending . - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpunet_sending . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpuapp_sending . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_rpmsg_cpunet_sending . -* Either the network or application core is sending data through the IPC service using the ICMSG backend: +* Either the network or application core is sending data through the IPC service using the :ref:`zephyr:ipc_service_backend_icmsg` backend: .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpuapp_sending . - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpunet_sending . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpuapp_sending . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.ipc.ipc_service.nrf5340dk_icmsg_cpunet_sending . -**nRF54H20 PDK** +**nRF54H20 DK** -You can build the sample to test IPC between the application and PPR core using the ICMSG backend, as follows: +You can build the sample to test IPC between the application and PPR core using the :ref:`zephyr:ipc_service_backend_icmsg` backend, as follows: .. code-block:: console - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpuppr_icmsg . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.ipc.ipc_service.nrf54h20dk_cpuapp_cpuppr_icmsg . -You can build the sample to test IPC between the application and radio domains using either the RPMsg or the ICMSG backend, as follows: +You can build the sample to test IPC between the application and radio domains using the :ref:`zephyr:ipc_service_backend_icbmsg` backend, as follows: .. code-block:: console - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpurad_rpmsg . - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpurad_icmsg . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.ipc.ipc_service.nrf54h20dk_cpuapp_cpurad_icmsg . Testing ======= @@ -111,7 +119,7 @@ After programming the sample to your development kit, test it by performing the .. code-block:: console *** Booting Zephyr OS build v3.0.99-ncs1 *** - IPC-service nrf5340dk_nrf5340_cpuapp demo started + IPC-service nrf5340dk/nrf5340/cpuapp demo started Δpkt: 9391 (100 B/pkt) | throughput: 7512800 bit/s Δpkt: 9389 (100 B/pkt) | throughput: 7511200 bit/s Δpkt: 9388 (100 B/pkt) | throughput: 7510400 bit/s @@ -123,7 +131,7 @@ After programming the sample to your development kit, test it by performing the .. code-block:: console *** Booting Zephyr OS build v3.0.99-ncs1 *** - IPC-service nrf5340dk_nrf5340_cpunet demo started + IPC-service nrf5340dk/nrf5340/cpunet demo started Δpkt: 6665 (100 B/pkt) | throughput: 5332000 bit/s Δpkt: 6664 (100 B/pkt) | throughput: 5331200 bit/s Δpkt: 6658 (100 B/pkt) | throughput: 5326400 bit/s diff --git a/samples/ipc/ipc_service/aci/CMakeLists.txt b/samples/ipc/ipc_service/aci/CMakeLists.txt deleted file mode 100644 index 3ad208a289ec..000000000000 --- a/samples/ipc/ipc_service/aci/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# This check is needed to avoid infinite recursion. This module code will -# be executed for all images in the build, also for the child image being -# added below. - -if (CONFIG_APP_INCLUDE_REMOTE_IMAGE) - add_child_image( - NAME remote - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../remote - DOMAIN remote - BOARD ${CONFIG_APP_REMOTE_BOARD} - ) -endif() diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.conf b/samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.conf similarity index 100% rename from samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.conf rename to samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.conf diff --git a/samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.overlay b/samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.overlay new file mode 100644 index 000000000000..748f97cb866c --- /dev/null +++ b/samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.overlay @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Replace default ipc0 instance */ +/delete-node/ &ipc0; + +ipc0: &cpuapp_cpuppr_ipc { + status = "okay"; +}; + +&cpuppr_vevif { + status = "okay"; +}; + +&cpuapp_bellboard { + status = "okay"; +}; diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.conf b/samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpurad_icmsg.conf similarity index 100% rename from samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.conf rename to samples/ipc/ipc_service/boards/nrf54h20dk_nrf54h20_cpuapp_cpurad_icmsg.conf diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.overlay b/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.overlay deleted file mode 100644 index fa2f8565cb29..000000000000 --- a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -ipc0: &cpuapp_cpurad_ipc { - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; -}; diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.conf b/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.conf deleted file mode 100644 index 9403bf77d116..000000000000 --- a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1000 -CONFIG_OPENAMP_WITH_DCACHE=y -CONFIG_IPC_SERVICE_STATIC_VRINGS_MEM_ALIGNMENT=32 diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.overlay b/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.overlay deleted file mode 100644 index ac896182465c..000000000000 --- a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -ipc0: &cpuapp_cpurad_ipc { - /* convert default IPC to zephyr,ipc-openamp-static-vrings */ - compatible = "zephyr,ipc-openamp-static-vrings"; - memory-region = <&cpuapp_cpurad_ram0x_region>; - role = "host"; - /delete-property/ tx-region; - /delete-property/ rx-region; - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; -}; diff --git a/samples/ipc/ipc_service/icmsg.conf b/samples/ipc/ipc_service/icmsg.conf index 6a6d697651ac..10b25503379e 100644 --- a/samples/ipc/ipc_service/icmsg.conf +++ b/samples/ipc/ipc_service/icmsg.conf @@ -1,2 +1 @@ -CONFIG_IPC_SERVICE_BACKEND_ICMSG=y CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=60 diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.conf b/samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.conf similarity index 100% rename from samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.conf rename to samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.conf diff --git a/samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.overlay b/samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.overlay similarity index 100% rename from samples/ipc/ipc_service/boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.overlay rename to samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.overlay diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.conf b/samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpurad_cpuapp_icmsg.conf similarity index 100% rename from samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.conf rename to samples/ipc/ipc_service/remote/boards/nrf54h20dk_nrf54h20_cpurad_cpuapp_icmsg.conf diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.overlay b/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.overlay deleted file mode 100644 index f56d8e2352a6..000000000000 --- a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.overlay +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -ipc0: &cpuapp_cpuppr_ipc { - status = "okay"; -}; - -&cpuppr_vevif { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.overlay b/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.overlay deleted file mode 100644 index 018d3bb3005f..000000000000 --- a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.overlay +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -ipc0: &cpuapp_cpurad_ipc { - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.conf b/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.conf deleted file mode 100644 index 9403bf77d116..000000000000 --- a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - -CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1000 -CONFIG_OPENAMP_WITH_DCACHE=y -CONFIG_IPC_SERVICE_STATIC_VRINGS_MEM_ALIGNMENT=32 diff --git a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.overlay b/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.overlay deleted file mode 100644 index 57cdf2f7dde2..000000000000 --- a/samples/ipc/ipc_service/remote/boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.overlay +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -ipc0: &cpuapp_cpurad_ipc { - /* convert default IPC to zephyr,ipc-openamp-static-vrings */ - compatible = "zephyr,ipc-openamp-static-vrings"; - memory-region = <&cpuapp_cpurad_ram0x_region>; - role = "remote"; - /delete-property/ tx-region; - /delete-property/ rx-region; - status = "okay"; -}; - -&cpuapp_cpurad_ram0x_region { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; diff --git a/samples/ipc/ipc_service/remote/icmsg.conf b/samples/ipc/ipc_service/remote/icmsg.conf index 2675da1bd7b3..db43bd648972 100644 --- a/samples/ipc/ipc_service/remote/icmsg.conf +++ b/samples/ipc/ipc_service/remote/icmsg.conf @@ -1,2 +1 @@ -CONFIG_IPC_SERVICE_BACKEND_ICMSG=y CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=25 diff --git a/samples/ipc/ipc_service/remote/rpmsg.conf b/samples/ipc/ipc_service/remote/rpmsg.conf index 421d52b75802..f38d9288ccaa 100644 --- a/samples/ipc/ipc_service/remote/rpmsg.conf +++ b/samples/ipc/ipc_service/remote/rpmsg.conf @@ -1,4 +1,2 @@ CONFIG_OPENAMP=y CONFIG_OPENAMP_MASTER=n - -CONFIG_IPC_SERVICE_BACKEND_RPMSG=y diff --git a/samples/ipc/ipc_service/rpmsg.conf b/samples/ipc/ipc_service/rpmsg.conf index 919417ff1a54..b5a31947e826 100644 --- a/samples/ipc/ipc_service/rpmsg.conf +++ b/samples/ipc/ipc_service/rpmsg.conf @@ -1,4 +1,2 @@ -CONFIG_IPC_SERVICE_BACKEND_RPMSG=y - CONFIG_OPENAMP=y CONFIG_OPENAMP_SLAVE=n diff --git a/samples/ipc/ipc_service/sample.yaml b/samples/ipc/ipc_service/sample.yaml index 49ab4a6122a2..f62d839d2d75 100644 --- a/samples/ipc/ipc_service/sample.yaml +++ b/samples/ipc/ipc_service/sample.yaml @@ -10,115 +10,101 @@ common: tests: sample.ipc.ipc_service.nrf5340dk_rpmsg_default: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=rpmsg.conf - remote_OVERLAY_CONFIG=rpmsg.conf + EXTRA_CONF_FILE=rpmsg.conf + remote_EXTRA_CONF_FILE=rpmsg.conf sample.ipc.ipc_service.nrf5340dk_rpmsg_cpuapp_sending: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - - ipc_service_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 - - remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 + - CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 extra_args: + remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=rpmsg.conf - remote_OVERLAY_CONFIG=rpmsg.conf + EXTRA_CONF_FILE=rpmsg.conf + remote_EXTRA_CONF_FILE=rpmsg.conf sample.ipc.ipc_service.nrf5340dk_rpmsg_cpunet_sending: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - - ipc_service_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 - - remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 + - CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 extra_args: + remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=rpmsg.conf - remote_OVERLAY_CONFIG=rpmsg.conf + EXTRA_CONF_FILE=rpmsg.conf + remote_EXTRA_CONF_FILE=rpmsg.conf sample.ipc.ipc_service.nrf5340dk_icmsg_default: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=icmsg.conf - ipc_service_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay + EXTRA_CONF_FILE=icmsg.conf + DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay remote_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpunet_icmsg.overlay - remote_OVERLAY_CONFIG=icmsg.conf + remote_EXTRA_CONF_FILE=icmsg.conf sample.ipc.ipc_service.nrf5340dk_icmsg_cpuapp_sending: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - - ipc_service_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=35 - - remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 + - CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=35 extra_args: + remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=icmsg.conf - ipc_service_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay + EXTRA_CONF_FILE=icmsg.conf + DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay remote_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpunet_icmsg.overlay - remote_OVERLAY_CONFIG=icmsg.conf + remote_EXTRA_CONF_FILE=icmsg.conf sample.ipc.ipc_service.nrf5340dk_icmsg_cpunet_sending: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - - ipc_service_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 - - remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 + - CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=200000000 extra_args: + remote_CONFIG_APP_IPC_SERVICE_SEND_INTERVAL=1 SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - ipc_service_OVERLAY_CONFIG=icmsg.conf - ipc_service_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay + EXTRA_CONF_FILE=icmsg.conf + DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay remote_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpunet_icmsg.overlay - remote_OVERLAY_CONFIG=icmsg.conf + remote_EXTRA_CONF_FILE=icmsg.conf - sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpurad_rpmsg: + sample.ipc.ipc_service.nrf54h20dk_cpuapp_cpuppr_icmsg: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf - ipc_service_OVERLAY_CONFIG="rpmsg.conf;boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.conf" - ipc_service_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_rpmsg.overlay - remote_OVERLAY_CONFIG="rpmsg.conf;boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.conf" - remote_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_rpmsg.overlay - - sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpuppr_icmsg: - platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp - integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp - extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf + EXTRA_CONF_FILE="icmsg.conf;boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.conf" + DTC_OVERLAY_FILE=boards/nrf54h20dk_nrf54h20_cpuapp_cpuppr.overlay ipc_service_SNIPPET=nordic-ppr - ipc_service_OVERLAY_CONFIG="icmsg.conf;boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.conf" - ipc_service_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_cpuppr.overlay - remote_OVERLAY_CONFIG="icmsg.conf;boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.conf" - remote_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuppr_cpuapp.overlay + remote_EXTRA_CONF_FILE="icmsg.conf;boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.conf" + remote_DTC_OVERLAY_FILE=boards/nrf54h20dk_nrf54h20_cpuppr_cpuapp.overlay - sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpurad_icmsg: + sample.ipc.ipc_service.nrf54h20dk_cpuapp_cpurad_icmsg: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf - ipc_service_OVERLAY_CONFIG="icmsg.conf;boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.conf" - ipc_service_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpuapp_cpurad_icmsg.overlay - remote_OVERLAY_CONFIG="icmsg.conf;boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.conf" - remote_DTC_OVERLAY_FILE=boards/nrf54h20pdk_nrf54h20_cpurad_cpuapp_icmsg.overlay + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf + EXTRA_CONF_FILE="icmsg.conf;boards/nrf54h20dk_nrf54h20_cpuapp_cpurad_icmsg.conf" + remote_EXTRA_CONF_FILE="icmsg.conf;boards/nrf54h20dk_nrf54h20_cpurad_cpuapp_icmsg.conf" diff --git a/samples/ipc/ipc_service/sysbuild/nrf5340dk_nrf5340_cpunet.conf b/samples/ipc/ipc_service/sysbuild/nrf5340dk_nrf5340_cpunet.conf index c387b552e656..b8ae05d4ef6f 100644 --- a/samples/ipc/ipc_service/sysbuild/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/ipc/ipc_service/sysbuild/nrf5340dk_nrf5340_cpunet.conf @@ -1 +1 @@ -SB_CONFIG_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" +SB_CONFIG_REMOTE_BOARD="nrf5340dk/nrf5340/cpunet" diff --git a/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf b/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..f50bc8553a01 --- /dev/null +++ b/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpuppr" diff --git a/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/samples/ipc/ipc_service/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf b/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf deleted file mode 100644 index e3ae1e6050b9..000000000000 --- a/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20pdk_nrf54h20_cpuppr" diff --git a/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf b/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf deleted file mode 100644 index d303e4934ea9..000000000000 --- a/samples/ipc/ipc_service/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20pdk_nrf54h20_cpurad" diff --git a/samples/ipc/ipc_service/zephyr/module.yml b/samples/ipc/ipc_service/zephyr/module.yml deleted file mode 100644 index de7491a23ec3..000000000000 --- a/samples/ipc/ipc_service/zephyr/module.yml +++ /dev/null @@ -1,2 +0,0 @@ -build: - cmake: aci diff --git a/samples/keys/hw_unique_key/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/keys/hw_unique_key/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..a837c4540d24 --- /dev/null +++ b/samples/keys/hw_unique_key/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2021 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MBEDTLS_PSA_CRYPTO_C=y +CONFIG_MAIN_STACK_SIZE=4096 +CONFIG_MBEDTLS_ENABLE_HEAP=y diff --git a/samples/keys/hw_unique_key/sample.yaml b/samples/keys/hw_unique_key/sample.yaml index 84c6391d7136..4fea44ac5069 100644 --- a/samples/keys/hw_unique_key/sample.yaml +++ b/samples/keys/hw_unique_key/sample.yaml @@ -4,15 +4,17 @@ sample: common: tags: huk platform_allow: > - nrf5340dk_nrf5340_cpuapp nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160 - nrf9160dk_nrf9160_ns nrf52840dk_nrf52840 nrf21540dk_nrf52840 + nrf5340dk/nrf5340/cpuapp nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160 + nrf9160dk/nrf9160/ns nrf52840dk/nrf52840 nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp harness: console harness_config: type: multi_line diff --git a/samples/keys/hw_unique_key/src/derive_key.c b/samples/keys/hw_unique_key/src/derive_key.c index 985a61fe0980..7e1605351189 100644 --- a/samples/keys/hw_unique_key/src/derive_key.c +++ b/samples/keys/hw_unique_key/src/derive_key.c @@ -29,7 +29,7 @@ LOG_MODULE_DECLARE(app, LOG_LEVEL_DBG); psa_status_t derive_key(psa_key_attributes_t *attributes, uint8_t *key_label, uint32_t label_size, psa_key_id_t *key_id_out) { - uint8_t key_out[HUK_SIZE_BYTES]; + uint8_t key_out[PSA_BITS_TO_BYTES(128)]; psa_key_id_t key_id; psa_status_t status; int err; diff --git a/samples/keys/hw_unique_key/src/derive_key_tfm.c b/samples/keys/hw_unique_key/src/derive_key_tfm.c index 7d7309cb0b73..277dc60f7f3a 100644 --- a/samples/keys/hw_unique_key/src/derive_key_tfm.c +++ b/samples/keys/hw_unique_key/src/derive_key_tfm.c @@ -15,6 +15,16 @@ #include "derive_key.h" +#if CONFIG_CRACEN_HW_PRESENT +/* On platforms with Cracen, the HUK is an AES key, suitable for CMAC KDF. */ +#define KDF_ALG PSA_ALG_SP800_108_COUNTER_CMAC +#define INPUT_STEP PSA_KEY_DERIVATION_INPUT_LABEL +#else +/* On nrf53 and nRF91 the HUK key is PSA_KEY_TYPE_RAW_DATA, suitable for HKDF. */ +#define KDF_ALG PSA_ALG_HKDF(PSA_ALG_SHA_256) +#define INPUT_STEP PSA_KEY_DERIVATION_INPUT_INFO +#endif + LOG_MODULE_DECLARE(app, LOG_LEVEL_DBG); psa_status_t derive_key(psa_key_attributes_t *attributes, uint8_t *key_label, @@ -26,7 +36,7 @@ psa_status_t derive_key(psa_key_attributes_t *attributes, uint8_t *key_label, *key_id_out = PSA_KEY_ID_NULL; - status = psa_key_derivation_setup(&op, PSA_ALG_HKDF(PSA_ALG_SHA_256)); + status = psa_key_derivation_setup(&op, KDF_ALG); if (status != PSA_SUCCESS) { LOG_INF("psa_key_derivation_setup returned error: %d", status); return status; @@ -41,9 +51,7 @@ psa_status_t derive_key(psa_key_attributes_t *attributes, uint8_t *key_label, } /* Supply the PS key label as an input to the key derivation */ - status = psa_key_derivation_input_bytes(&op, PSA_KEY_DERIVATION_INPUT_INFO, - key_label, - key_label_len); + status = psa_key_derivation_input_bytes(&op, INPUT_STEP, key_label, key_label_len); if (status != PSA_SUCCESS) { LOG_INF("psa_key_derivation_input_bytes returned error: %d", status); return status; diff --git a/samples/keys/hw_unique_key/src/main.c b/samples/keys/hw_unique_key/src/main.c index 6537568217df..c3cd96ffacf9 100644 --- a/samples/keys/hw_unique_key/src/main.c +++ b/samples/keys/hw_unique_key/src/main.c @@ -8,12 +8,14 @@ #include #include #include -#include #include #ifdef CONFIG_BUILD_WITH_TFM #include #else /* CONFIG_BUILD_WITH_TFM */ +#include +#ifdef CONFIG_HW_CC3XX #include +#endif #endif /* CONFIG_BUILD_WITH_TFM */ #if !defined(HUK_HAS_KMU) #include @@ -51,12 +53,16 @@ int crypto_init(void) psa_status_t status; #if !defined(CONFIG_BUILD_WITH_TFM) - int result = nrf_cc3xx_platform_init(); + int result; + +#if defined(HUK_HAS_CC310) || defined(HUK_HAS_CC312) + result = nrf_cc3xx_platform_init(); if (result != NRF_CC3XX_PLATFORM_SUCCESS) { LOG_INF("nrf_cc3xx_platform_init returned error: %d", result); return APP_ERROR; } +#endif if (!hw_unique_key_are_any_written()) { LOG_INF("Writing random keys to KMU"); @@ -109,7 +115,7 @@ int generate_key(void) (PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT)); psa_set_key_algorithm(&attributes, ENCRYPT_ALG); psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attributes, PSA_BYTES_TO_BITS(HUK_SIZE_BYTES)); + psa_set_key_bits(&attributes, 128); status = derive_key(&attributes, key_label, sizeof(key_label) - 1, &key_id); if (status != PSA_SUCCESS) { diff --git a/samples/keys/identity_key_generation/sample.yaml b/samples/keys/identity_key_generation/sample.yaml index 5bb97bd9986f..85a8f0496fa8 100644 --- a/samples/keys/identity_key_generation/sample.yaml +++ b/samples/keys/identity_key_generation/sample.yaml @@ -2,17 +2,17 @@ sample: description: Generate and write identity key. name: Identity Key Generate common: - tags: keys - platform_allow: nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - harness: console - harness_config: - type: multi_line - regex: - - "Writing the identity key to KMU" - - "Success!" + tags: keys + platform_allow: nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + harness: console + harness_config: + type: multi_line + regex: + - "Writing the identity key to KMU" + - "Success!" tests: sample.keys.identity_key_generate.random_key: tags: keys ci_build diff --git a/samples/keys/identity_key_usage/README.rst b/samples/keys/identity_key_usage/README.rst index 136bf4ea8c7c..a8aa43b8d334 100644 --- a/samples/keys/identity_key_usage/README.rst +++ b/samples/keys/identity_key_usage/README.rst @@ -56,19 +56,17 @@ Testing |test_sample| - 1. |connect_terminal_specific| - #. Reset the kit. - #. Observe the following output: +1. |connect_terminal_specific| +#. Reset the kit. +#. Observe the following output: - .. code-block:: console + .. code-block:: console - Initializing PSA crypto. - Reading the identity key. - Importing the identity key into PSA crypto. - Exporting the public key corresponding to the identity key. - Success! - - If an error occurs, the sample prints a message and raises a kernel panic. + Initializing PSA crypto. + Reading the identity key. + Importing the identity key into PSA crypto. + Exporting the public key corresponding to the identity key. + Success! If an error occurs, the sample prints a message and raises a kernel panic. diff --git a/samples/keys/identity_key_usage/prj.conf b/samples/keys/identity_key_usage/prj.conf index f3cd7281fdad..76a5d5e95a9b 100644 --- a/samples/keys/identity_key_usage/prj.conf +++ b/samples/keys/identity_key_usage/prj.conf @@ -30,4 +30,4 @@ CONFIG_LOG_BACKEND_UART=y CONFIG_LOG_BUFFER_SIZE=15360 CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=15360 -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y diff --git a/samples/keys/identity_key_usage/sample.yaml b/samples/keys/identity_key_usage/sample.yaml index 745b1c3940cd..db9b6fecda68 100644 --- a/samples/keys/identity_key_usage/sample.yaml +++ b/samples/keys/identity_key_usage/sample.yaml @@ -2,17 +2,17 @@ sample: description: Use a previously written identity key from KMU. name: Identity Key Usage common: - tags: keys - platform_allow: nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - harness: console - harness_config: - type: multi_line - regex: - - "Ciphertext \\(with authentication tag\\):" + tags: keys + platform_allow: nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + harness: console + harness_config: + type: multi_line + regex: + - "Ciphertext \\(with authentication tag\\):" tests: sample.keys.identity_key_usage: tags: keys ci_build - build_only: True + build_only: true diff --git a/samples/matter/common/cmake/source_common.cmake b/samples/matter/common/cmake/source_common.cmake index 185af9a8c56f..c5a2b61a87ee 100644 --- a/samples/matter/common/cmake/source_common.cmake +++ b/samples/matter/common/cmake/source_common.cmake @@ -44,3 +44,17 @@ endif() if(CONFIG_NCS_SAMPLE_MATTER_SETTINGS_SHELL) target_sources(app PRIVATE ${MATTER_COMMONS_SRC_DIR}/persistent_storage/persistent_storage_shell.cpp) endif() + +if(CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS) + target_sources(app PRIVATE ${MATTER_COMMONS_SRC_DIR}/event_triggers/event_triggers.cpp) + if(CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS) + target_sources(app PRIVATE ${MATTER_COMMONS_SRC_DIR}/event_triggers/default_event_triggers.cpp) + endif() +endif() + +if(CONFIG_NCS_SAMPLE_MATTER_PERSISTENT_STORAGE) + target_sources_ifdef(CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND app PRIVATE + ${MATTER_COMMONS_SRC_DIR}/persistent_storage/backends/persistent_storage_settings.cpp) + target_sources_ifdef(CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND app PRIVATE + ${MATTER_COMMONS_SRC_DIR}/persistent_storage/backends/persistent_storage_secure.cpp) +endif() diff --git a/samples/matter/common/src/Kconfig b/samples/matter/common/src/Kconfig index 569408e9ab71..2d76f4b9c74c 100644 --- a/samples/matter/common/src/Kconfig +++ b/samples/matter/common/src/Kconfig @@ -42,6 +42,7 @@ config NCS_SAMPLE_MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE config NCS_SAMPLE_MATTER_SETTINGS_SHELL bool "Settings shell for Matter purposes" + default y if CHIP_MEMORY_PROFILING depends on SHELL depends on NVS help @@ -52,3 +53,37 @@ config NCS_SAMPLE_MATTER_SETTINGS_SHELL get_size - to read the size of specific value. current - to read current settings usage. free - to read free settings space. + +config NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + bool "Test event triggers support" + default y + help + Enables support for test event triggers for the specific use-cases. + +config NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX + int "Maximum amount of event triggers" + default 5 + depends on NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + help + Defines the maximum amount of event triggers. + +config NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS + bool "Register default triggers for Matter sample" + depends on NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + default y + help + Automatically register default triggers such as factory reset, + device reboot, OTA start query. + +config NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX_TRIGGERS_DELEGATES + int "Maximum amount of the trigger delegates" + default 2 + depends on NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + help + Defines the maximum number for the TestEventTriggerDelegate implementations + to be registered in the nRF test event triggers class. + +config NCS_SAMPLE_MATTER_PERSISTENT_STORAGE + bool "Persistent storage support for Matter samples" + help + Matter persistent storage support with the configurable backend. diff --git a/samples/matter/common/src/app/matter_init.cpp b/samples/matter/common/src/app/matter_init.cpp index f76606fb1800..1691fc8d8ed7 100644 --- a/samples/matter/common/src/app/matter_init.cpp +++ b/samples/matter/common/src/app/matter_init.cpp @@ -21,6 +21,13 @@ #include "dfu/smp/dfu_over_smp.h" #endif +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS +#include "event_triggers/event_triggers.h" +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS +#include "event_triggers/default_event_triggers.h" +#endif +#endif + #include #include #include @@ -49,6 +56,7 @@ chip::Crypto::PSAOperationalKeystore Nrf::Matter::InitData::sOperationalKeystore #ifdef CONFIG_CHIP_FACTORY_DATA FactoryDataProvider Nrf::Matter::InitData::sFactoryDataProviderDefault{}; #endif + namespace { /* Local instance of the initialization data that is overwritten by an application. */ @@ -170,6 +178,20 @@ void DoInitChipServer(intptr_t /* unused */) SetDeviceInstanceInfoProvider(sLocalInitData.mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(sLocalInitData.mFactoryDataProvider); SetCommissionableDataProvider(sLocalInitData.mFactoryDataProvider); + +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + /* Read the enable key from the factory data set */ + uint8_t enableKeyData[chip::TestEventTriggerDelegate::kEnableKeyLength] = {}; + MutableByteSpan enableKey(enableKeyData); + sInitResult = sLocalInitData.mFactoryDataProvider->GetEnableKey(enableKey); + VerifyInitResultOrReturn(sInitResult, "GetEnableKey() failed"); + Nrf::Matter::TestEventTrigger::Instance().SetEnableKey(enableKey); + VerifyInitResultOrReturn(sInitResult, "SetEnableKey() failed"); +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS + sLocalInitData.mServerInitParams->testEventTriggerDelegate = &Nrf::Matter::TestEventTrigger::Instance(); + Nrf::Matter::DefaultTestEventTriggers::Register(); +#endif /* CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS */ +#endif /* CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS */ #else SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl()); SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); diff --git a/samples/matter/common/src/board/board.cpp b/samples/matter/common/src/board/board.cpp index c64f09cd3a4a..c46e2b47a1fa 100644 --- a/samples/matter/common/src/board/board.cpp +++ b/samples/matter/common/src/board/board.cpp @@ -298,34 +298,36 @@ void Board::StartBLEAdvertisement() void Board::DefaultMatterEventHandler(const ChipDeviceEvent *event, intptr_t /* unused */) { static bool isNetworkProvisioned = false; + static bool isBleConnected = false; switch (event->Type) { case DeviceEventType::kCHIPoBLEAdvertisingChange: - if (isNetworkProvisioned) { - sInstance.UpdateDeviceState(DeviceState::DeviceProvisioned); - } else if (ConnectivityMgr().NumBLEConnections() != 0) { - sInstance.UpdateDeviceState(DeviceState::DeviceConnectedBLE); - } else { - sInstance.UpdateDeviceState(DeviceState::DeviceAdvertisingBLE); - } + isBleConnected = ConnectivityMgr().NumBLEConnections() != 0; break; #if defined(CONFIG_NET_L2_OPENTHREAD) case DeviceEventType::kThreadStateChange: isNetworkProvisioned = ConnectivityMgr().IsThreadProvisioned() && ConnectivityMgr().IsThreadEnabled(); -#elif defined(CONFIG_CHIP_WIFI) + break; +#endif /* CONFIG_NET_L2_OPENTHREAD */ +#if defined(CONFIG_CHIP_WIFI) case DeviceEventType::kWiFiConnectivityChange: isNetworkProvisioned = ConnectivityMgr().IsWiFiStationProvisioned() && ConnectivityMgr().IsWiFiStationEnabled(); -#endif /* CONFIG_NET_L2_OPENTHREAD */ - if (isNetworkProvisioned) { - sInstance.UpdateDeviceState(DeviceState::DeviceProvisioned); - } else { - sInstance.UpdateDeviceState(DeviceState::DeviceDisconnected); - } break; +#endif /* CONFIG_CHIP_WIFI */ default: break; } + + if (isNetworkProvisioned) { + sInstance.UpdateDeviceState(DeviceState::DeviceProvisioned); + } else if (isBleConnected) { + sInstance.UpdateDeviceState(DeviceState::DeviceConnectedBLE); + } else if (ConnectivityMgr().IsBLEAdvertising()) { + sInstance.UpdateDeviceState(DeviceState::DeviceAdvertisingBLE); + } else { + sInstance.UpdateDeviceState(DeviceState::DeviceDisconnected); + } } } /* namespace Nrf */ diff --git a/samples/matter/common/src/bridge/Kconfig b/samples/matter/common/src/bridge/Kconfig index 3a0548e0f3c8..c95d6fcb923d 100644 --- a/samples/matter/common/src/bridge/Kconfig +++ b/samples/matter/common/src/bridge/Kconfig @@ -30,6 +30,14 @@ config BRIDGE_BT_RECOVERY_SCAN_TIMEOUT_MS int "Time (in ms) within which the Bridge will try to re-establish a connection to the lost BT LE device" default 2000 +config BRIDGE_BT_MAX_SCANNED_DEVICES + int "Maximum amount of scanned devices" + default 16 + +config BRIDGE_BT_SCAN_TIMEOUT_MS + int "Bluetooth scan timeout in milliseconds" + default 10000 + config BRIDGE_BT_MINIMUM_SECURITY_LEVEL int "Minimum Bluetooth security level of bridged devices that will be accepted by the bridge device" default 2 diff --git a/samples/matter/common/src/bridge/ble_bridged_device.h b/samples/matter/common/src/bridge/ble_bridged_device.h index 190257ba27e2..f272e7c218c7 100644 --- a/samples/matter/common/src/bridge/ble_bridged_device.h +++ b/samples/matter/common/src/bridge/ble_bridged_device.h @@ -37,7 +37,7 @@ class BLEBridgedDeviceProvider : public BridgedDeviceDataProvider { } ~BLEBridgedDeviceProvider() { BLEConnectivityManager::Instance().RemoveBLEProvider(GetBtAddress()); } - virtual bt_uuid *GetServiceUuid() = 0; + virtual const bt_uuid *GetServiceUuid() = 0; virtual int ParseDiscoveredData(bt_gatt_dm *discoveredData) = 0; BLEBridgedDevice &GetBLEBridgedDevice() { return mDevice; } diff --git a/samples/matter/common/src/bridge/ble_connectivity_manager.cpp b/samples/matter/common/src/bridge/ble_connectivity_manager.cpp index f5f3302b2c7d..d32c11d7d46e 100644 --- a/samples/matter/common/src/bridge/ble_connectivity_manager.cpp +++ b/samples/matter/common/src/bridge/ble_connectivity_manager.cpp @@ -404,7 +404,7 @@ void BLEConnectivityManager::DiscoveryError(bt_conn *conn, int err, void *contex Instance().UpdateRecovery(); } -CHIP_ERROR BLEConnectivityManager::Init(bt_uuid **serviceUuids, uint8_t serviceUuidsCount) +CHIP_ERROR BLEConnectivityManager::Init(const bt_uuid **serviceUuids, uint8_t serviceUuidsCount) { if (!serviceUuids || serviceUuidsCount > kMaxServiceUuids) { return CHIP_ERROR_INVALID_ARGUMENT; @@ -671,7 +671,7 @@ CHIP_ERROR BLEConnectivityManager::Reconnect(BLEBridgedDeviceProvider *provider) int err = bt_conn_le_create(&provider->GetBLEBridgedDevice().mAddr, create_param, connParams, &conn); if (err) { - LOG_ERR("Creating reconnection failed (err %d)", err); + LOG_ERR("Creating reconnection failed (err %d) to %s", err, addrStr); return System::MapErrorZephyr(err); } else { provider->SetConnectionObject(conn); @@ -883,8 +883,35 @@ BLEBridgedDeviceProvider *BLEConnectivityManager::Recovery::GetProvider(sys_slis return provider; } +bool BLEConnectivityManager::Recovery::EntryExists(BLEBridgedDeviceProvider *provider, sys_slist_t *list) +{ + sys_snode_t *node; + sys_snode_t *tmpNodeSafe; + + if (provider && list) { + SYS_SLIST_FOR_EACH_NODE_SAFE (list, node, tmpNodeSafe) { + ListItem *item = reinterpret_cast(node); + + if (!item) { + return false; + } + + bt_addr_le_t addr = provider->GetBtAddress(); + bt_addr_le_t storedAddr = item->mProvider->GetBtAddress(); + if (bt_addr_le_cmp(&addr, &storedAddr) == 0) { + return true; + } + } + } + return false; +} + bool BLEConnectivityManager::Recovery::PutProvider(BLEBridgedDeviceProvider *provider, sys_slist_t *list) { + if (EntryExists(provider, list)) { + return true; + } + if (sys_slist_len(list) >= kMaxConnectedDevices) { return false; } diff --git a/samples/matter/common/src/bridge/ble_connectivity_manager.h b/samples/matter/common/src/bridge/ble_connectivity_manager.h index e5aa7104aeb7..f389c534ce4c 100644 --- a/samples/matter/common/src/bridge/ble_connectivity_manager.h +++ b/samples/matter/common/src/bridge/ble_connectivity_manager.h @@ -26,8 +26,8 @@ struct BLEBridgedDeviceProvider; class BLEConnectivityManager { public: - static constexpr uint16_t kScanTimeoutMs = 10000; - static constexpr uint16_t kMaxScannedDevices = 16; + static constexpr uint16_t kScanTimeoutMs = CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS; + static constexpr uint16_t kMaxScannedDevices = CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES; /* One BT connection is reserved for the Matter service purposes. */ static constexpr uint16_t kMaxConnectedDevices = CONFIG_BT_MAX_CONN - 1; static constexpr uint8_t kMaxServiceUuids = CONFIG_BT_SCAN_UUID_CNT; @@ -86,8 +86,9 @@ class BLEConnectivityManager { void NotifyProviderToRecover(BLEBridgedDeviceProvider *provider); private: - BLEBridgedDeviceProvider *GetProvider(sys_slist_t *list); - bool PutProvider(BLEBridgedDeviceProvider *provider, sys_slist_t *list); + static bool EntryExists(BLEBridgedDeviceProvider *provider, sys_slist_t *list); + static BLEBridgedDeviceProvider *GetProvider(sys_slist_t *list); + static bool PutProvider(BLEBridgedDeviceProvider *provider, sys_slist_t *list); bool IsNeeded() { return !sys_slist_is_empty(&mListToRecover); } void StartTimer(); void CancelTimer() { k_timer_stop(&mRecoveryTimer); } @@ -124,7 +125,7 @@ class BLEConnectivityManager { * @return CHIP_NO_ERROR on success * @return other error code on failure */ - CHIP_ERROR Init(bt_uuid **serviceUuids, uint8_t serviceUuidsCount); + CHIP_ERROR Init(const bt_uuid **serviceUuids, uint8_t serviceUuidsCount); /** * @brief Start scanning for Bluetooth LE peripheral devices advertising service UUIDs passed in @ref Init diff --git a/samples/matter/common/src/bridge/bridge_manager.cpp b/samples/matter/common/src/bridge/bridge_manager.cpp index 0555ed893f1b..aa87df011a2d 100644 --- a/samples/matter/common/src/bridge/bridge_manager.cpp +++ b/samples/matter/common/src/bridge/bridge_manager.cpp @@ -5,6 +5,7 @@ */ #include "bridge_manager.h" +#include "bridge/bridge_storage_manager.h" #include "binding/binding_handler.h" @@ -44,6 +45,11 @@ CHIP_ERROR BridgeManager::Init(LoadStoredBridgedDevicesCallback loadStoredBridge emberAfEndpointEnableDisable(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1)), false); + if (!Nrf::BridgeStorageManager::Instance().Init()) { + LOG_INF("BridgeStorageManager initialization failed."); + return CHIP_ERROR_INTERNAL; + } + Nrf::Matter::BindingHandler::Init(); /* Invoke the callback to load stored devices in a proper moment. */ @@ -397,8 +403,12 @@ CHIP_ERROR BridgeManager::HandleWrite(uint16_t index, ClusterId clusterId, /* After updating MatterBridgedDevice state, forward request to the non-Matter device. */ if (err == CHIP_NO_ERROR) { - return Instance().mDevicesMap[index].mProvider->UpdateState(clusterId, attributeMetadata->attributeId, - buffer); + CHIP_ERROR updateError = Instance().mDevicesMap[index].mProvider->UpdateState( + clusterId, attributeMetadata->attributeId, buffer); + /* This is acceptable that not all writable attributes can be reflected in the provider device. */ + if (updateError != CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE) { + return updateError; + } } return err; } diff --git a/samples/matter/common/src/bridge/bridge_manager.h b/samples/matter/common/src/bridge/bridge_manager.h index 0fcbdb509d92..c2b78e5a9f8f 100644 --- a/samples/matter/common/src/bridge/bridge_manager.h +++ b/samples/matter/common/src/bridge/bridge_manager.h @@ -8,6 +8,7 @@ #include "binding/binding_handler.h" #include "bridge_util.h" +#include "util/finite_map.h" #include "bridged_device_data_provider.h" #include "matter_bridged_device.h" @@ -177,7 +178,7 @@ class BridgeManager { static constexpr uint8_t kMaxDataProviders = CONFIG_BRIDGE_MAX_BRIDGED_DEVICES_NUMBER; - using DeviceMap = FiniteMap; + using DeviceMap = FiniteMap; /** * @brief Add pair of single bridged device and its data provider using optional index and endpoint id. diff --git a/samples/matter/common/src/bridge/bridge_storage_manager.cpp b/samples/matter/common/src/bridge/bridge_storage_manager.cpp index 922e8cb99c48..77356e067e2e 100644 --- a/samples/matter/common/src/bridge/bridge_storage_manager.cpp +++ b/samples/matter/common/src/bridge/bridge_storage_manager.cpp @@ -5,6 +5,11 @@ */ #include "bridge_storage_manager.h" +#include "bridge_manager.h" + +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); namespace { @@ -12,7 +17,7 @@ template bool LoadDataToObject(Nrf::PersistentStorageNode *node, T &da { size_t readSize = 0; - bool result = Nrf::PersistentStorage::Instance().Load(node, &data, sizeof(T), readSize); + bool result = Nrf::GetPersistentStorage().NonSecureLoad(node, &data, sizeof(T), readSize); return result; } @@ -28,11 +33,94 @@ Nrf::PersistentStorageNode CreateIndexNode(uint8_t bridgedDeviceIndex, Nrf::Pers } /* namespace */ -namespace Nrf { +namespace Nrf +{ + +bool BridgeStorageManager::Init() +{ + bool result = Nrf::GetPersistentStorage().NonSecureInit(); + + if (!result) { + return result; + } + + /* Perform data migration from previous data structure versions if needed. */ + return MigrateData(); +} + +bool BridgeStorageManager::MigrateData() +{ + uint8_t version; + + /* Check if version key is present in settings to provide backward compatibility between post-2.6.0 releases and + * the previous one. If the version key is present it means that the new keys structure is used (only version + * equal to 1 is for now valid). Otherwise, the deprecated structure is used, so the migration has to be done. + */ + if (!LoadDataToObject(&mVersion, version)) { + uint8_t count; + uint8_t indexes[BridgeManager::kMaxBridgedDevices] = { 0 }; + size_t indexesCount = 0; + + if (LoadBridgedDevicesCount(count) && + LoadBridgedDevicesIndexes(indexes, BridgeManager::kMaxBridgedDevices, indexesCount)) { + /* Load all devices based on the read count number. */ + for (size_t i = 0; i < indexesCount; i++) { + BridgedDevice device; + if (!LoadBridgedDeviceEndpointId(device.mEndpointId, i)) { + return false; + } + + /* Ignore an error, as node label is optional, so it may not be found. */ + if (!LoadBridgedDeviceNodeLabel(device.mNodeLabel, sizeof(device.mNodeLabel), + device.mNodeLabelLength, i)) { + device.mNodeLabelLength = 0; + } + + if (!LoadBridgedDeviceType(device.mDeviceType, i)) { + return false; + } + +#ifdef CONFIG_BRIDGED_DEVICE_BT + bt_addr_le_t btAddr; + + if (!LoadBtAddress(btAddr, i)) { + return false; + } + + /* Insert Bluetooth LE address as a part of implementation specific user data. */ + device.mUserDataSize = sizeof(btAddr); + device.mUserData = reinterpret_cast(&btAddr); +#endif + + /* Store all information using a new scheme. */ + if (!StoreBridgedDevice(device, i)) { + return false; + } + + /* Remove all information described using an old scheme. */ + RemoveBridgedDeviceEndpointId(i); + RemoveBridgedDeviceNodeLabel(i); + RemoveBridgedDeviceType(i); + +#ifdef CONFIG_BRIDGED_DEVICE_BT + RemoveBtAddress(i); +#endif + } + } + + version = 1; + Nrf::GetPersistentStorage().NonSecureStore(&mVersion, &version, sizeof(version)); + + } else if (version != 1) { + /* Currently only no-version or version equal to 1 is supported. */ + return false; + } + return true; +} bool BridgeStorageManager::StoreBridgedDevicesCount(uint8_t count) { - return Nrf::PersistentStorage::Instance().Store(&mBridgedDevicesCount, &count, sizeof(count)); + return Nrf::GetPersistentStorage().NonSecureStore(&mBridgedDevicesCount, &count, sizeof(count)); } bool BridgeStorageManager::LoadBridgedDevicesCount(uint8_t &count) @@ -46,7 +134,7 @@ bool BridgeStorageManager::StoreBridgedDevicesIndexes(uint8_t *indexes, uint8_t return false; } - return Nrf::PersistentStorage::Instance().Store(&mBridgedDevicesIndexes, indexes, count); + return Nrf::GetPersistentStorage().NonSecureStore(&mBridgedDevicesIndexes, indexes, count); } bool BridgeStorageManager::LoadBridgedDevicesIndexes(uint8_t *indexes, uint8_t maxCount, size_t &count) @@ -55,14 +143,7 @@ bool BridgeStorageManager::LoadBridgedDevicesIndexes(uint8_t *indexes, uint8_t m return false; } - return Nrf::PersistentStorage::Instance().Load(&mBridgedDevicesIndexes, indexes, maxCount, count); -} - -bool BridgeStorageManager::StoreBridgedDeviceEndpointId(uint16_t endpointId, uint8_t bridgedDeviceIndex) -{ - Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceEndpointId); - - return Nrf::PersistentStorage::Instance().Store(&id, &endpointId, sizeof(endpointId)); + return Nrf::GetPersistentStorage().NonSecureLoad(&mBridgedDevicesIndexes, indexes, maxCount, count); } bool BridgeStorageManager::LoadBridgedDeviceEndpointId(uint16_t &endpointId, uint8_t bridgedDeviceIndex) @@ -76,15 +157,7 @@ bool BridgeStorageManager::RemoveBridgedDeviceEndpointId(uint8_t bridgedDeviceIn { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceEndpointId); - return Nrf::PersistentStorage::Instance().Remove(&id); -} - -bool BridgeStorageManager::StoreBridgedDeviceNodeLabel(const char *label, size_t labelLength, - uint8_t bridgedDeviceIndex) -{ - Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceNodeLabel); - - return Nrf::PersistentStorage::Instance().Store(&id, label, labelLength); + return Nrf::GetPersistentStorage().NonSecureRemove(&id); } bool BridgeStorageManager::LoadBridgedDeviceNodeLabel(char *label, size_t labelMaxLength, size_t &labelLength, @@ -92,21 +165,14 @@ bool BridgeStorageManager::LoadBridgedDeviceNodeLabel(char *label, size_t labelM { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceNodeLabel); - return Nrf::PersistentStorage::Instance().Load(&id, label, labelMaxLength, labelLength); + return Nrf::GetPersistentStorage().NonSecureLoad(&id, label, labelMaxLength, labelLength); } bool BridgeStorageManager::RemoveBridgedDeviceNodeLabel(uint8_t bridgedDeviceIndex) { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceNodeLabel); - return Nrf::PersistentStorage::Instance().Remove(&id); -} - -bool BridgeStorageManager::StoreBridgedDeviceType(uint16_t deviceType, uint8_t bridgedDeviceIndex) -{ - Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceType); - - return Nrf::PersistentStorage::Instance().Store(&id, &deviceType, sizeof(deviceType)); + return Nrf::GetPersistentStorage().NonSecureRemove(&id); } bool BridgeStorageManager::LoadBridgedDeviceType(uint16_t &deviceType, uint8_t bridgedDeviceIndex) @@ -120,34 +186,112 @@ bool BridgeStorageManager::RemoveBridgedDeviceType(uint8_t bridgedDeviceIndex) { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBridgedDeviceType); - return Nrf::PersistentStorage::Instance().Remove(&id); + return Nrf::GetPersistentStorage().NonSecureRemove(&id); } -bool BridgeStorageManager::StoreBridgedDevice(const MatterBridgedDevice *device, uint8_t index) +bool BridgeStorageManager::LoadBridgedDevice(BridgedDevice &device, uint8_t index) { - if (!device) { + Nrf::PersistentStorageNode id = CreateIndexNode(index, &mBridgedDevice); + size_t readSize = 0; + uint8_t buffer[sizeof(BridgedDevice) + kMaxUserDataSize]; + uint16_t counter = 0; + const uint8_t mandatoryItemsSize = sizeof(device.mEndpointId) + sizeof(device.mDeviceType) + sizeof(device.mNodeLabelLength); + + if (!Nrf::GetPersistentStorage().NonSecureLoad(&id, buffer, sizeof(BridgedDevice) + kMaxUserDataSize, readSize)) { + return false; + } + + /* Validate that read size is big enough to include mandatory data. */ + if (readSize < mandatoryItemsSize) { return false; } - if (!StoreBridgedDeviceEndpointId(device->GetEndpointId(), index)) { + /* Deserialize data and copy it from buffer into structure's fields. */ + memcpy(&device.mEndpointId, buffer, sizeof(device.mEndpointId)); + counter += sizeof(device.mEndpointId); + memcpy(&device.mDeviceType, buffer + counter, sizeof(device.mDeviceType)); + counter += sizeof(device.mDeviceType); + memcpy(&device.mNodeLabelLength, buffer + counter, sizeof(device.mNodeLabelLength)); + counter += sizeof(device.mNodeLabelLength); + + /* Validate that read size is big enough to include all expected data. */ + if (readSize < mandatoryItemsSize + device.mNodeLabelLength) { return false; } - if (!StoreBridgedDeviceNodeLabel(device->GetNodeLabel(), strlen(device->GetNodeLabel()), index)) { + memcpy(device.mNodeLabel, buffer + counter, device.mNodeLabelLength); + counter += device.mNodeLabelLength; + + /* Check if user prepared a buffer for reading user data. It can be nullptr if not needed. */ + if (!device.mUserData) { + device.mUserDataSize = 0; + return true; + } + + uint8_t inUserDataSize = device.mUserDataSize; + /* Validate if user buffer size is big enough to fit the stored user data size. */ + if (readSize < counter + sizeof(device.mUserDataSize)) { return false; } - return StoreBridgedDeviceType(device->GetDeviceType(), index); + memcpy(&device.mUserDataSize, buffer + counter, sizeof(device.mUserDataSize)); + counter += sizeof(device.mUserDataSize); + + /* Validate that user data size value read from the storage is not bigger than the one expected by the user. */ + if (inUserDataSize < device.mUserDataSize) { + return false; + } + + /* Validate that read size is big enough to include all expected data. */ + if (readSize < counter + device.mUserDataSize) { + return false; + } + + memcpy(device.mUserData, buffer + counter, device.mUserDataSize); + counter += device.mUserDataSize; + + return true; } -#ifdef CONFIG_BRIDGED_DEVICE_BT -bool BridgeStorageManager::StoreBtAddress(bt_addr_le_t addr, uint8_t bridgedDeviceIndex) +bool BridgeStorageManager::StoreBridgedDevice(BridgedDevice &device, uint8_t index) { - Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBtAddress); + uint8_t buffer[sizeof(BridgedDevice) + kMaxUserDataSize]; + uint16_t counter = 0; + Nrf::PersistentStorageNode id = CreateIndexNode(index, &mBridgedDevice); + + /* Serialize data structure and insert it into buffer. */ + memcpy(buffer, &device.mEndpointId, sizeof(device.mEndpointId)); + counter += sizeof(device.mEndpointId); + memcpy(buffer + counter, &device.mDeviceType, sizeof(device.mDeviceType)); + counter += sizeof(device.mDeviceType); + memcpy(buffer + counter, &device.mNodeLabelLength, sizeof(device.mNodeLabelLength)); + counter += sizeof(device.mNodeLabelLength); + memcpy(buffer + counter, device.mNodeLabel, device.mNodeLabelLength); + counter += device.mNodeLabelLength; + + /* Check if there are any user data to save. mUserData can be nullptr if not needed. */ + if (device.mUserData && device.mUserDataSize > 0) { + if (device.mUserDataSize > kMaxUserDataSize) { + return false; + } + + memcpy(buffer + counter, &device.mUserDataSize, sizeof(device.mUserDataSize)); + counter += sizeof(device.mUserDataSize); + memcpy(buffer + counter, device.mUserData, device.mUserDataSize); + counter += device.mUserDataSize; + } + + return Nrf::GetPersistentStorage().NonSecureStore(&id, buffer, counter); +} + +bool BridgeStorageManager::RemoveBridgedDevice(uint8_t index) +{ + Nrf::PersistentStorageNode id = CreateIndexNode(index, &mBridgedDevice); - return Nrf::PersistentStorage::Instance().Store(&id, &addr, sizeof(addr)); + return Nrf::GetPersistentStorage().NonSecureRemove(&id); } +#ifdef CONFIG_BRIDGED_DEVICE_BT bool BridgeStorageManager::LoadBtAddress(bt_addr_le_t &addr, uint8_t bridgedDeviceIndex) { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBtAddress); @@ -159,7 +303,7 @@ bool BridgeStorageManager::RemoveBtAddress(uint8_t bridgedDeviceIndex) { Nrf::PersistentStorageNode id = CreateIndexNode(bridgedDeviceIndex, &mBtAddress); - return Nrf::PersistentStorage::Instance().Remove(&id); + return Nrf::GetPersistentStorage().NonSecureRemove(&id); } #endif diff --git a/samples/matter/common/src/bridge/bridge_storage_manager.h b/samples/matter/common/src/bridge/bridge_storage_manager.h index c8f60cf3d3b4..ddf3878aa6d9 100644 --- a/samples/matter/common/src/bridge/bridge_storage_manager.h +++ b/samples/matter/common/src/bridge/bridge_storage_manager.h @@ -7,13 +7,14 @@ #pragma once #include "matter_bridged_device.h" -#include "persistent_storage/persistent_storage_util.h" +#include "persistent_storage/persistent_storage.h" #ifdef CONFIG_BRIDGED_DEVICE_BT #include #endif -namespace Nrf { +namespace Nrf +{ /* * The class implements the following key-values storage structure: @@ -22,40 +23,32 @@ namespace Nrf { * /brd_cnt/ // * /brd_ids/ // * /brd/ - * /eid/ - * /0/ // - * /1/ // - * . - * . - * /n/ // - * /label/ - * /0/ // - * /1/ // - * . - * . - * /n/ // - * /type/ - * /0/ // - * /1/ // - * . - * . - * /n/ // - * /bt/ - * /addr/ - * /0/ // - * /1/ // - * . - * . - * /n/ // + * /0/ // + * /1/ // + * . + * . + * /n/ // + * /ver/ */ class BridgeStorageManager { public: + static inline constexpr auto kMaxUserDataSize = 128u; + + struct BridgedDevice { + uint16_t mEndpointId; + uint16_t mDeviceType; + size_t mNodeLabelLength; + char mNodeLabel[MatterBridgedDevice::kNodeLabelSize] = { 0 }; + size_t mUserDataSize = 0; + uint8_t *mUserData = nullptr; + }; + static constexpr auto kMaxIndexLength = 3; BridgeStorageManager() : mBridge("br", strlen("br")), mBridgedDevicesCount("brd_cnt", strlen("brd_cnt"), &mBridge), mBridgedDevicesIndexes("brd_ids", strlen("brd_ids"), &mBridge), - mBridgedDevice("brd", strlen("brd"), &mBridge), + mBridgedDevice("brd", strlen("brd"), &mBridge), mVersion("ver", strlen("ver"), &mBridge), mBridgedDeviceEndpointId("eid", strlen("eid"), &mBridgedDevice), mBridgedDeviceNodeLabel("label", strlen("label"), &mBridgedDevice), mBridgedDeviceType("type", strlen("type"), &mBridgedDevice) @@ -78,7 +71,7 @@ class BridgeStorageManager { * @return true if module has been initialized successfully * @return false an error occurred */ - bool Init() { return Nrf::PersistentStorage::Instance().Init(); } + bool Init(); /** * @brief Store bridged devices count into settings @@ -120,14 +113,56 @@ class BridgeStorageManager { bool LoadBridgedDevicesIndexes(uint8_t *indexes, uint8_t maxCount, size_t &count); /** - * @brief Store bridged device endpoint id into settings + * @brief Load bridged device from settings * - * @param endpointId endpoint id value to be stored - * @param bridgedDeviceIndex index describing specific bridged device using given endpoint id + * If the caller wants to load the optional user data, the mUserData must be set to the valid buffer to store + * data and mUserDataSize must be set to this data size. On success, the method overrides mUserDataSize with + * the data size actually obtained from the storage. + * + * @param device instance of bridged device object to be filled with loaded data. + * @param index index describing specific bridged device + * @return true if key has been loaded successfully + * @return false an error occurred + */ + bool LoadBridgedDevice(BridgedDevice &device, uint8_t index); + + /** + * @brief Store bridged device into settings. Helper method allowing to store endpoint id, node label and device + * type of specific bridged device using a single call. + * + * @param device instance of bridged device object to be stored + * @param index index describing specific bridged device * @return true if key has been written successfully * @return false an error occurred */ - bool StoreBridgedDeviceEndpointId(uint16_t endpointId, uint8_t bridgedDeviceIndex); + bool StoreBridgedDevice(BridgedDevice &device, uint8_t index); + + /** + * @brief Remove bridged device entry from settings + * + * @param bridgedDeviceIndex index describing specific bridged device to be removed + * @return true if key entry has been removed successfully + * @return false an error occurred + */ + bool RemoveBridgedDevice(uint8_t bridgedDeviceIndex); + +private: + /** + * @brief Provides backward compatibility between non-compatible data scheme versions. + * + * It checks the used data scheme version based on version key value. + * If the version key is present it means that the new keys structure is used (only version + * equal to 1 is for now valid and means post nRF Connect SDK 2.6.0). + * Otherwise, the deprecated structure is used, so the migration has to be done. In such a case, method loads + * the data using key names from an old scheme, removes the old data and stores again using the new key names. + * + * @return true if migration was successful + * @return false an error occurred + */ + bool MigrateData(); + + /* The below methods are deprecated and used only for the migration purposes between the older scheme versions. + */ /** * @brief Load bridged device endpoint id from settings @@ -148,17 +183,6 @@ class BridgeStorageManager { */ bool RemoveBridgedDeviceEndpointId(uint8_t bridgedDeviceIndex); - /** - * @brief Store bridged device node label into settings - * - * @param label address of node label to be stored - * @param labelLength length of node label - * @param bridgedDeviceIndex index describing specific bridged device using given node label - * @return true if key has been written successfully - * @return false an error occurred - */ - bool StoreBridgedDeviceNodeLabel(const char *label, size_t labelLength, uint8_t bridgedDeviceIndex); - /** * @brief Load bridged device node label from settings * @@ -181,16 +205,6 @@ class BridgeStorageManager { */ bool RemoveBridgedDeviceNodeLabel(uint8_t bridgedDeviceIndex); - /** - * @brief Store bridged device Matter device type into settings - * - * @param deviceType Matter device type to be stored - * @param bridgedDeviceIndex index describing specific bridged device using given device type - * @return true if key has been written successfully - * @return false an error occurred - */ - bool StoreBridgedDeviceType(uint16_t deviceType, uint8_t bridgedDeviceIndex); - /** * @brief Load bridged device Matter device type from settings * @@ -210,29 +224,7 @@ class BridgeStorageManager { */ bool RemoveBridgedDeviceType(uint8_t bridgedDeviceIndex); - /** - * @brief Store bridged device into settings. Helper method allowing to store endpoint id, node label and device - * type of specific bridged device using a single call. - * - * @param device address of bridged device object to be stored - * @param index index describing specific bridged device - * @return true if key has been written successfully - * @return false an error occurred - */ - bool StoreBridgedDevice(const MatterBridgedDevice *device, uint8_t index); - #ifdef CONFIG_BRIDGED_DEVICE_BT - - /** - * @brief Store bridged device Bluetooth LE address into settings - * - * @param addr Bluetooth LE address to be stored - * @param bridgedDeviceIndex index describing specific bridged device using given address - * @return true if key has been written successfully - * @return false an error occurred - */ - bool StoreBtAddress(bt_addr_le_t addr, uint8_t bridgedDeviceIndex); - /** * @brief Load bridged device Bluetooth LE address from settings * @@ -253,11 +245,16 @@ class BridgeStorageManager { bool RemoveBtAddress(uint8_t bridgedDeviceIndex); #endif -private: + static constexpr auto kMaxBufferSize = sizeof(MatterBridgedDevice); + Nrf::PersistentStorageNode mBridge; Nrf::PersistentStorageNode mBridgedDevicesCount; Nrf::PersistentStorageNode mBridgedDevicesIndexes; Nrf::PersistentStorageNode mBridgedDevice; + Nrf::PersistentStorageNode mVersion; + + /* The below fields are deprecated and used only for the migration purposes between the older scheme versions. + */ Nrf::PersistentStorageNode mBridgedDeviceEndpointId; Nrf::PersistentStorageNode mBridgedDeviceNodeLabel; Nrf::PersistentStorageNode mBridgedDeviceType; diff --git a/samples/matter/common/src/bridge/bridged_device_data_provider.h b/samples/matter/common/src/bridge/bridged_device_data_provider.h index 5b27c557dbe7..55edf57a55ef 100644 --- a/samples/matter/common/src/bridge/bridged_device_data_provider.h +++ b/samples/matter/common/src/bridge/bridged_device_data_provider.h @@ -34,6 +34,8 @@ class BridgedDeviceDataProvider { virtual void Init() = 0; virtual void NotifyUpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, void *data, size_t dataSize) = 0; + + /* This method shall return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE for attributes that cannot be updated. */ virtual CHIP_ERROR UpdateState(chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t *buffer) = 0; CHIP_ERROR NotifyReachableStatusChange(bool isReachable); diff --git a/samples/matter/common/src/bridge/util/bridge_util.h b/samples/matter/common/src/bridge/util/bridge_util.h index 3c5644ec79f3..977e405ee9ba 100644 --- a/samples/matter/common/src/bridge/util/bridge_util.h +++ b/samples/matter/common/src/bridge/util/bridge_util.h @@ -12,7 +12,8 @@ #include #include -namespace Nrf { +namespace Nrf +{ /* DeviceFactory template container allows to instantiate a map which @@ -55,96 +56,4 @@ template class DeviceFactory CreationMap mCreationMap; }; -/* - FiniteMap template container allows to wrap mappings between uint16_t-type key and T-type value. - The size or the container is predefined at compilation time, therefore - the maximum number of stored elements must be well known. FiniteMap owns - inserted values, meaning that once the user inserts a value it will not longer - be valid outside of the container, i.e. FiniteMap cannot return stored object by copy. - FiniteMap's API offers basic operations like: - * inserting new values under provided key (Insert) - * erasing existing item under given key (Erase) - this operation takes care about the duplicated items, - meaning that pointer under given key is released only if the same address is not present elsewhere in the map - * retrieving values stored under provided key ([] operator) - * checking if the map contains a non-null value under given key (Contains) - * retrieving a number of free slots available in the map (FreeSlots) - * iterating though stored item via publicly available mMap member - Prerequisites: - * T must have move semantics and bool()/==operators implemented -*/ -template struct FiniteMap { - static constexpr uint16_t kInvalidKey{ N + 1 }; - struct Item { - /* Initialize with invalid key (0 is a valid key) */ - uint16_t key{ kInvalidKey }; - T value; - }; - - bool Insert(uint16_t key, T &&value) - { - if (Contains(key)) { - /* The key with sane value already exists in the map, return prematurely. */ - return false; - } else if (mElementsCount < N) { - mMap[key].key = key; - mMap[key].value = std::move(value); - mElementsCount++; - } - return true; - } - - bool Erase(uint16_t key) - { - const auto &it = std::find_if(std::begin(mMap), std::end(mMap), - [key](const Item &item) { return item.key == key; }); - if (it != std::end(mMap) && it->value) { - it->value = T{}; - it->key = kInvalidKey; - mElementsCount--; - return true; - } - return false; - } - - /* Always use Constains() before using operator[]. */ - T &operator[](uint16_t key) - { - static T dummyObject; - for (auto &it : mMap) { - if (key == it.key) - return it.value; - } - return dummyObject; - } - - bool Contains(uint16_t key) - { - for (auto &it : mMap) { - if (key == it.key) - return true; - } - return false; - } - std::size_t FreeSlots() { return N - mElementsCount; } - - uint8_t GetDuplicatesCount(const T &value, uint16_t *key) - { - /* Find the first duplicated item and return its key, - so that the application can handle the duplicate by itself. */ - *key = kInvalidKey; - uint8_t numberOfDuplicates = 0; - for (auto it = std::begin(mMap); it != std::end(mMap); ++it) { - if (it->value == value) { - *(key++) = it->key; - numberOfDuplicates++; - } - } - - return numberOfDuplicates; - } - - Item mMap[N]; - uint16_t mElementsCount{ 0 }; -}; - } /* namespace Nrf */ diff --git a/samples/matter/common/src/dfu/ota/ota_util.cpp b/samples/matter/common/src/dfu/ota/ota_util.cpp index 15fc29d2cc8a..3e0eadc480ed 100644 --- a/samples/matter/common/src/dfu/ota/ota_util.cpp +++ b/samples/matter/common/src/dfu/ota/ota_util.cpp @@ -22,7 +22,6 @@ using namespace chip; using namespace chip::DeviceLayer; #if CONFIG_CHIP_OTA_REQUESTOR - namespace { DefaultOTARequestorStorage sOTARequestorStorage; @@ -30,9 +29,12 @@ DefaultOTARequestorDriver sOTARequestorDriver; chip::BDXDownloader sBDXDownloader; chip::DefaultOTARequestor sOTARequestor; } /* namespace */ +#endif -namespace Nrf::Matter { +namespace Nrf::Matter +{ +#if CONFIG_CHIP_OTA_REQUESTOR /* compile-time factory method */ OTAImageProcessorImpl &GetOTAImageProcessor() { @@ -60,7 +62,6 @@ void InitBasicOTARequestor() void OtaConfirmNewImage() { - #ifndef CONFIG_SOC_SERIES_NRF53X /* Check if the image is run in the REVERT mode and eventually confirm it to prevent reverting on the next boot. @@ -70,13 +71,14 @@ void OtaConfirmNewImage() #endif OTAImageProcessorImpl &imageProcessor = GetOTAImageProcessor(); - if(!boot_is_img_confirmed()){ + if (!boot_is_img_confirmed()) { CHIP_ERROR err = System::MapErrorZephyr(boot_write_img_confirmed()); if (CHIP_NO_ERROR == err) { imageProcessor.SetImageConfirmed(); ChipLogProgress(SoftwareUpdate, "New firmware image confirmed"); } else { - ChipLogError(SoftwareUpdate, "Failed to confirm firmware image, it will be reverted on the next boot"); + ChipLogError(SoftwareUpdate, + "Failed to confirm firmware image, it will be reverted on the next boot"); } } } diff --git a/samples/matter/common/src/dfu/ota/ota_util.h b/samples/matter/common/src/dfu/ota/ota_util.h index 7a6a04668401..bb18db070af2 100644 --- a/samples/matter/common/src/dfu/ota/ota_util.h +++ b/samples/matter/common/src/dfu/ota/ota_util.h @@ -11,9 +11,12 @@ #if CONFIG_CHIP_OTA_REQUESTOR #include "ota_image_processor_base_impl.h" #include +#endif -namespace Nrf::Matter { +namespace Nrf::Matter +{ +#if CONFIG_CHIP_OTA_REQUESTOR /** * Select recommended OTA image processor implementation. * diff --git a/samples/matter/common/src/event_triggers/default_event_triggers.cpp b/samples/matter/common/src/event_triggers/default_event_triggers.cpp new file mode 100644 index 000000000000..d53461087770 --- /dev/null +++ b/samples/matter/common/src/event_triggers/default_event_triggers.cpp @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include "default_event_triggers.h" + +#include "event_triggers.h" +#include +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +using namespace Nrf::Matter; +using namespace chip; + +namespace +{ +k_timer sFactoryResetDelayTimer; + +void FactoryResetDelayTimerTimeoutCallback(k_timer *timer) +{ + Server::GetInstance().ScheduleFactoryReset(); +} + +CHIP_ERROR FactoryResetCallback(TestEventTrigger::TriggerValue delayMs) +{ + LOG_DBG("Called Factory Reset event trigger with delay %d ms", delayMs); + + k_timer_init(&sFactoryResetDelayTimer, &FactoryResetDelayTimerTimeoutCallback, nullptr); + k_timer_start(&sFactoryResetDelayTimer, K_MSEC(delayMs), K_NO_WAIT); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR RebootCallback(TestEventTrigger::TriggerValue delayMs) +{ + LOG_DBG("Called Reboot event trigger with delay %d ms", delayMs); + + return chip::DeviceLayer::SystemLayer().StartTimer( + chip::System::Clock::Milliseconds32(delayMs), + [](chip::System::Layer *, void * /* context */) { + chip::DeviceLayer::PlatformMgr().HandleServerShuttingDown(); + k_msleep(CHIP_DEVICE_CONFIG_SERVER_SHUTDOWN_ACTIONS_SLEEP_MS); + sys_reboot(SYS_REBOOT_WARM); + }, + nullptr /* context */); + + return CHIP_NO_ERROR; +} + +} // namespace + +namespace Nrf::Matter::DefaultTestEventTriggers +{ + +CHIP_ERROR Register() +{ + /* Register System events */ + ReturnErrorOnFailure(Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTrigger( + Ids::FactoryReset, + TestEventTrigger::EventTrigger{ ValueMasks::FactoryResetDelayMs, FactoryResetCallback })); + ReturnErrorOnFailure(Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTrigger( + Ids::Reboot, TestEventTrigger::EventTrigger{ ValueMasks::RebootDelayMs, RebootCallback })); + + /* Register OTA test events handler */ + static chip::OTATestEventTriggerHandler otaTestEventTrigger; + ReturnErrorOnFailure( + Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTriggerHandler(&otaTestEventTrigger)); + + return CHIP_NO_ERROR; +} + +} // namespace Nrf::Matter::DefaultTestEventTriggers diff --git a/samples/matter/common/src/event_triggers/default_event_triggers.h b/samples/matter/common/src/event_triggers/default_event_triggers.h new file mode 100644 index 000000000000..799eab52a11f --- /dev/null +++ b/samples/matter/common/src/event_triggers/default_event_triggers.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include "event_triggers.h" +#include + +#include +#include + +namespace Nrf::Matter::DefaultTestEventTriggers +{ +enum Ids : TestEventTrigger::EventTriggerId { + + /* System */ + FactoryReset = 0xF000'0000'0000'0000, + Reboot = 0xF000'0001'0000'0000, +}; + +enum ValueMasks : TestEventTrigger::TriggerValueMask { + /* System */ + FactoryResetDelayMs = 0xFFFF, + RebootDelayMs = 0xFFFF, +}; + +/** + * @brief Register all the default event triggers. + * + * @return CHIP_ERROR that refers to TestEventTrigger::RegisterTestEventTrigger method. + */ +CHIP_ERROR Register(); + +} // namespace Nrf::Matter::DefaultTestEventTriggers diff --git a/samples/matter/common/src/event_triggers/event_triggers.cpp b/samples/matter/common/src/event_triggers/event_triggers.cpp new file mode 100644 index 000000000000..af16260724c1 --- /dev/null +++ b/samples/matter/common/src/event_triggers/event_triggers.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "event_triggers.h" + +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +using namespace Nrf::Matter; +using namespace chip; + +CHIP_ERROR TestEventTrigger::RegisterTestEventTrigger(EventTriggerId id, EventTrigger trigger) +{ + VerifyOrReturnError(trigger.Callback != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(!mTriggersMap.Contains(id), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mTriggersMap.Insert(id, std::move(trigger)), CHIP_ERROR_NO_MEMORY); + + LOG_DBG("Registered new test event: 0x%llx", id); + + return CHIP_NO_ERROR; +} + +void TestEventTrigger::UnregisterTestEventTrigger(EventTriggerId id) +{ + if (mTriggersMap.Erase(id)) { + LOG_DBG("Unregistered test event: 0x%llx", id); + } else { + LOG_WRN("Cannot unregister test event: 0x%llx", id); + } +} + +CHIP_ERROR TestEventTrigger::RegisterTestEventTriggerHandler(chip::TestEventTriggerHandler *triggerDelegate) +{ + VerifyOrReturnError(triggerDelegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + for (size_t idx = 0; idx < kMaxEventTriggers; idx++) { + if (mHandlers[idx] == nullptr) { + mHandlers[idx] = triggerDelegate; + return CHIP_NO_ERROR; + } + } + + return CHIP_ERROR_NO_MEMORY; +} + +CHIP_ERROR TestEventTrigger::SetEnableKey(const chip::ByteSpan &newEnableKey) +{ + VerifyOrReturnError(newEnableKey.size() == chip::TestEventTriggerDelegate::kEnableKeyLength, + CHIP_ERROR_INVALID_ARGUMENT); + return CopySpanToMutableSpan(newEnableKey, mEnableKey); +} + +bool TestEventTrigger::DoesEnableKeyMatch(const chip::ByteSpan &enableKey) const +{ + return !mEnableKey.empty() && mEnableKey.data_equal(enableKey); +} + +CHIP_ERROR TestEventTrigger::HandleEventTriggers(uint64_t eventTrigger) +{ + /* Check if the Enable Key is set to the "disabled" value. */ + if (!IsEventTriggerEnabled()) { + return CHIP_ERROR_INCORRECT_STATE; + } + + EventTriggerId triggerID = eventTrigger & kEventTriggerMask; + + /* Check if the provided event trigger exists in Trigger map */ + if (mTriggersMap.Contains(triggerID)) { + VerifyOrReturnError(mTriggersMap[triggerID].Callback != nullptr, CHIP_ERROR_INCORRECT_STATE); + return mTriggersMap[triggerID].Callback(eventTrigger & mTriggersMap[triggerID].Mask); + } + + /* Event trigger has not been found in the Trigger map so check if one of the registered Event Trigger + * Handler Delegates can be called instead. + */ + for (size_t idx = 0; idx < kMaxEventTriggersHandlers; idx++) { + if (mHandlers[idx]) { + CHIP_ERROR status = mHandlers[idx]->HandleEventTrigger(eventTrigger); + if (status == CHIP_NO_ERROR) { + return CHIP_NO_ERROR; + } + } + } + + return CHIP_ERROR_INCORRECT_STATE; +} diff --git a/samples/matter/common/src/event_triggers/event_triggers.h b/samples/matter/common/src/event_triggers/event_triggers.h new file mode 100644 index 000000000000..d8cf7fc65c04 --- /dev/null +++ b/samples/matter/common/src/event_triggers/event_triggers.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include +#include + +#include "util/finite_map.h" + +#include +#include + +namespace Nrf::Matter +{ +class TestEventTrigger : public chip::TestEventTriggerDelegate { +public: + using EventTriggerId = uint64_t; + using TriggerValueMask = uint32_t; + using TriggerValue = uint32_t; + using TriggerSlot = uint16_t; + + /* A function callback recipe for handling the event triggers + To match the event trigger requirements, you can use the following CHIP_ERROR codes inside. + All error codes (except CHIP_NO_ERROR) send "INVALID_COMMAND" response to Matter Controller. + */ + using EventTriggerCallback = CHIP_ERROR (*)(TriggerValue); + + /* Define the maximum available event triggers that can be registered. */ + constexpr static TriggerSlot kMaxEventTriggers = CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX; + constexpr static TriggerSlot kInvalidTriggerSlot = CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX + 1; + constexpr static TriggerSlot kMaxEventTriggersHandlers = CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX_TRIGGERS_DELEGATES; + constexpr static uint8_t kDisableEventTriggersKey[chip::TestEventTriggerDelegate::kEnableKeyLength] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + constexpr static EventTriggerId kEventTriggerMask = 0xFFFFFFFF00000000; + + /** + * @brief Struct of event trigger + * + * The Id field represents an unique ID of the event trigger, and it should be provided as 64-bits value with + 32-bits right shift. For example 0xFFFFFFFF00000000 + * The Mask field represents a mask of specific event trigger value. It should be provided as a 32-bits mask + value. All values beyond this mask will be ignored. + * The Callback field represents a function callback that will be invoked when the appropriate event trigger ID + is received. + */ + struct EventTrigger { + TriggerValueMask Mask = 0; + EventTriggerCallback Callback = nullptr; + }; + + /** + * @brief Use Instance static method to reach TestEventTrigger class methods. + * + * @return TestEventTrigger& TestEventTrigger object. + */ + static TestEventTrigger &Instance() + { + static TestEventTrigger sInstance; + return sInstance; + } + + ~TestEventTrigger() = default; + + /** + * @brief Register new event trigger for a specific purpose + * + * The trigger.Callback function is called in not thread-safe manner. + * It means that you must ensure thread-safety and run all operations within the callback in the proper context. + * + * @param trigger The @ref EventTrigger structure that contains ID, value Mask and Callback of the new event + * trigger. + * @return CHIP_ERROR_INVALID_ARGUMENT if the trigger.Callback field is not assigned (nullptr) + * @return CHIP_ERROR_INVALID_ARGUMENT if the provided eventTrigger ID is already registered. + * @return CHIP_ERROR_NO_MEMORY if there is no memory for registering the new event trigger. + * @return CHIP_NO_ERROR on success. + */ + CHIP_ERROR RegisterTestEventTrigger(EventTriggerId id, EventTrigger trigger); + + /** + * @brief Unregister the existing event trigger. + * + * @param id the ID of the test event to be unregistered. + */ + void UnregisterTestEventTrigger(EventTriggerId id); + + /** + * @brief Register an implementation of the TestEventTriggerDelegate + * + * The implementation will be called if the received event trigger ID has not been found in + * mTriggersDict dictionary. + * + * @param triggerDelegate pointer to the TestEventTriggerDelegate implementation. + * @return CHIP_ERROR_INVALID_ARGUMENT if the triggerDelegate is NULL. + * @return CHIP_ERROR_NO_MEMORY if the triggerDelegate list is full. + * @return CHIP_NO_ERROR on success. + */ + CHIP_ERROR RegisterTestEventTriggerHandler(chip::TestEventTriggerHandler *triggerDelegate); + + /** + * @brief Set the new Enable Key read out from an external source. + * + * This method is required for all further operations. + * + * @param newEnableKey the new enable key to be set. + * @return CHIP_NO_ERROR on success. + */ + CHIP_ERROR SetEnableKey(const chip::ByteSpan &newEnableKey); + + /* TestEventTriggerDelegate implementations */ + bool DoesEnableKeyMatch(const chip::ByteSpan &enableKey) const override; + CHIP_ERROR HandleEventTriggers(uint64_t eventTrigger) override; + +private: + TestEventTrigger() = default; + + uint16_t GetTriggerSlot(uint64_t eventTrigger); + bool IsEventTriggerEnabled() + { + return memcmp(kDisableEventTriggersKey, mEnableKeyData, + chip::TestEventTriggerDelegate::kEnableKeyLength) != 0; + } + + uint8_t mEnableKeyData[chip::TestEventTriggerDelegate::kEnableKeyLength] = {}; + chip::MutableByteSpan mEnableKey{ mEnableKeyData }; + Nrf::FiniteMap mTriggersMap; + chip::TestEventTriggerHandler* mHandlers[kMaxEventTriggersHandlers]; +}; +}; // namespace Nrf::Matter diff --git a/samples/matter/common/src/persistent_storage/Kconfig b/samples/matter/common/src/persistent_storage/Kconfig new file mode 100644 index 000000000000..8cf3f3f2c3b0 --- /dev/null +++ b/samples/matter/common/src/persistent_storage/Kconfig @@ -0,0 +1,38 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if NCS_SAMPLE_MATTER_PERSISTENT_STORAGE + +config NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND + bool "Settings based storage implementation for Matter samples" + depends on SETTINGS + default y + +config NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND + bool "Secure storage implementation for Matter samples" + select TRUSTED_STORAGE + select PSA_PROTECTED_STORAGE + +config NCS_SAMPLE_MATTER_STORAGE_MAX_KEY_LEN + int "Maximum length (bytes) of the key under which the asset can be stored" + default 18 + +if NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND + +config NCS_SAMPLE_MATTER_SECURE_STORAGE_MAX_ENTRY_NUMBER + int "Maximum number of entries that can be stored securely" + default 30 + +config NCS_SAMPLE_MATTER_SECURE_STORAGE_PSA_KEY_VALUE_OFFSET + hex "The PSA key offset dedicated for Matter application" + default 0x40000 + +config TRUSTED_STORAGE_BACKEND_AEAD_MAX_DATA_SIZE + default 1024 + +endif + +endif diff --git a/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.cpp b/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.cpp new file mode 100644 index 000000000000..4de71f76fa32 --- /dev/null +++ b/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.cpp @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "persistent_storage_secure.h" + +namespace Nrf +{ + +PersistentStorageSecure::UidMap PersistentStorageSecure::sUidMap{}; +PersistentStorageSecure::Byte PersistentStorageSecure::sSerializedMapBuff[kMaxMapSerializationBufferSize]{}; + +PSErrorCode PersistentStorageSecure::_SecureInit() +{ + return LoadUIDMap(); +} + +PSErrorCode PersistentStorageSecure::_SecureStore(PersistentStorageNode *node, const void *data, size_t dataSize) +{ + /* Check if we can store more assets and return prematurely if the limit has been already reached. */ + if (kMaxEntriesNumber <= sUidMap.Size()) { + return PSErrorCode::Failure; + } + + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (node->GetKey(key)) { + psa_storage_uid_t uid = UIDFromString(key); + psa_status_t status = psa_ps_set(uid, dataSize, data, PSA_STORAGE_FLAG_NONE); + + if (status == PSA_SUCCESS) { + if (sUidMap.Insert(uid, StringWrapper(key))) { + /* The map has been updated, store it. */ + if (PSErrorCode::Success != StoreUIDMap()) { + /* We cannot store the updated UID map, so it's pointless to keep the data + * associated with calculated UID persistently. */ + psa_ps_remove(uid); + } else { + return PSErrorCode::Success; + } + } + /* It fine for the Insert() to fail, in case the given key is already present in the map. */ + return PSErrorCode::Success; + } + } + return PSErrorCode::Failure; +} + +PSErrorCode PersistentStorageSecure::_SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + psa_storage_uid_t uid; + if (HasEntry(node, uid)) { + psa_status_t status = psa_ps_get(uid, 0, dataMaxSize, data, &outSize); + return (status == PSA_SUCCESS ? PSErrorCode::Success : PSErrorCode::Failure); + } + return PSErrorCode::Failure; +} + +PSErrorCode PersistentStorageSecure::_SecureHasEntry(PersistentStorageNode *node) +{ + psa_storage_uid_t uid; + return (HasEntry(node, uid) ? PSErrorCode::Success : PSErrorCode::Failure); +} + +PSErrorCode PersistentStorageSecure::_SecureRemove(PersistentStorageNode *node) +{ + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (node->GetKey(key)) { + bool alreadyInTheMap{ false }; + psa_storage_uid_t uid = UIDFromString(key, &alreadyInTheMap); + if (!alreadyInTheMap) { + psa_status_t status = psa_ps_remove(uid); + + if (status == PSA_SUCCESS) { + sUidMap.Erase(uid); + return PSErrorCode::Success; + } + } + } + + return PSErrorCode::Failure; +} + +psa_storage_uid_t PersistentStorageSecure::UIDFromString(char *str, bool *alreadyInTheMap) +{ + for (auto &it : sUidMap.mMap) { + if (it.value == str) { + if (alreadyInTheMap) { + *alreadyInTheMap = true; + } + return static_cast(it.key); + } + } + + /* The first available UID under kKeyOffset is reserved for the UID Map, so we need to include that when storing + * regular keys by adding kMapUidRelativeOffset. */ + uint16_t slot = sUidMap.GetFirstFreeSlot(); + if (alreadyInTheMap) { + *alreadyInTheMap = false; + } + return static_cast(slot + kKeyOffset + kMapUidRelativeOffset); +} + +PSErrorCode PersistentStorageSecure::StoreUIDMap() +{ + size_t outSize{ 0 }; + if (PSErrorCode::Success == SerializeUIDMap(sSerializedMapBuff, kMaxMapSerializationBufferSize, outSize)) { + psa_status_t status = psa_ps_set(kKeyOffset, outSize, sSerializedMapBuff, PSA_STORAGE_FLAG_NONE); + if (status == PSA_SUCCESS) { + return PSErrorCode::Success; + } + } + return PSErrorCode::Failure; +} + +PSErrorCode PersistentStorageSecure::SerializeUIDMap(Byte *buff, size_t buffSize, size_t &outSize) +{ + size_t keySize{ sizeof(SerializedUIDType) }; + size_t valueSize{ 0 }; + UidMap::ElementCounterType offset{ 0 }; + UidMap::ElementCounterType mapSize = sUidMap.Size(); + + if (buffSize < kMaxMapSerializationBufferSize) { + return PSErrorCode::Failure; + } + + memcpy(buff + offset, &mapSize, sizeof(mapSize)); + offset += sizeof(mapSize); + + for (auto it = std::begin(sUidMap.mMap); it != std::end(sUidMap.mMap) - sUidMap.FreeSlots(); ++it) { + valueSize = strlen(it->value.mStr) + 1; + SerializedUIDType keyToSerialize = static_cast(it->key); + memcpy(buff + offset, &keyToSerialize, keySize); + offset += keySize; + memcpy(buff + offset, it->value.mStr, valueSize); + offset += valueSize; + } + outSize = offset; + return PSErrorCode::Success; +} + +PSErrorCode PersistentStorageSecure::LoadUIDMap() +{ + size_t outSize{ 0 }; + + psa_status_t status = psa_ps_get(kKeyOffset, 0, kMaxMapSerializationBufferSize, sSerializedMapBuff, &outSize); + + if (status == PSA_SUCCESS) { + if (PSErrorCode::Success == DeserializeUIDMap(sSerializedMapBuff, kMaxMapSerializationBufferSize)) { + return PSErrorCode::Success; + } + } + return PSErrorCode::Failure; +} + +PSErrorCode PersistentStorageSecure::DeserializeUIDMap(const Byte *buff, size_t buffSize) +{ + UidMap::ElementCounterType mapSize{ 0 }; + UidMap::ElementCounterType offset{ 0 }; + SerializedUIDType key{ 0 }; + char value[PersistentStorageNode::kMaxKeyNameLength] = { 0 }; + + memcpy(&mapSize, buff + offset, sizeof(mapSize)); + offset += sizeof(mapSize); + + for (uint16_t element = 0; element < mapSize; ++element) { + memcpy(&key, buff + offset, sizeof(key)); + offset += sizeof(key); + strcpy(value, buff + offset); + offset += strlen(value) + 1; + sUidMap.Insert(static_cast(key), StringWrapper(value)); + } + + /* The stored size shall equal the resulting size. */ + if (sUidMap.Size() != mapSize) { + return PSErrorCode::Failure; + } + + return PSErrorCode::Success; +} + +bool PersistentStorageSecure::HasEntry(PersistentStorageNode *node, psa_storage_uid_t &uid) +{ + char key[PersistentStorageNode::kMaxKeyNameLength]; + bool alreadyInTheMap{ false }; + + if (node->GetKey(key)) { + uid = UIDFromString(key, &alreadyInTheMap); + } + + return alreadyInTheMap; +} + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.h b/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.h new file mode 100644 index 000000000000..7592c3f92e8e --- /dev/null +++ b/samples/matter/common/src/persistent_storage/backends/persistent_storage_secure.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include "../persistent_storage_common.h" +#include "finite_map.h" + +#include + +namespace Nrf +{ +class PersistentStorageSecure { +protected: + PSErrorCode _NonSecureInit(); + PSErrorCode _NonSecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + PSErrorCode _NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + PSErrorCode _NonSecureHasEntry(PersistentStorageNode *node); + PSErrorCode _NonSecureRemove(PersistentStorageNode *node); + + PSErrorCode _SecureInit(); + PSErrorCode _SecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + PSErrorCode _SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + PSErrorCode _SecureHasEntry(PersistentStorageNode *node); + PSErrorCode _SecureRemove(PersistentStorageNode *node); + +private: + static constexpr size_t kMaxEntriesNumber = CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_MAX_ENTRY_NUMBER; + static constexpr psa_storage_uid_t kKeyOffset = CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_PSA_KEY_VALUE_OFFSET; + static constexpr uint8_t kMapUidRelativeOffset = 1; + + /* Needed to interface with FiniteMap. */ + struct StringWrapper { + static constexpr auto kSize = PersistentStorageNode::kMaxKeyNameLength; + StringWrapper() {} + StringWrapper(char *str) { strcpy(mStr, str); } + + ~StringWrapper() {} + + /* Disable copy semantics and implement move semantics. */ + StringWrapper(const StringWrapper &other) = delete; + StringWrapper &operator=(const StringWrapper &other) = delete; + + StringWrapper(StringWrapper &&other) + { + strcpy(mStr, other.mStr); + other.Clear(); + } + + StringWrapper &operator=(StringWrapper &&other) + { + if (this != &other) { + this->Clear(); + strcpy(mStr, other.mStr); + other.Clear(); + } + return *this; + } + + operator bool() const { return !strcmp(mStr, ""); } + /* This will work also when comparing against a raw string. */ + bool operator==(const StringWrapper &other) { return (strcmp(mStr, other.mStr) == 0); } + + void Clear() { memset(mStr, 0, kSize); } + + char mStr[kSize] = { 0 }; + }; + + using UidMap = FiniteMap; + using Byte = char; + /* We have the range of the UID [0x40000, 40000 + kMaxEntriesNumber], so 4 bytes is enough to store it. + Note that psa_storage_uid_t is 8 byte long.*/ + using SerializedUIDType = uint32_t; + + static PSErrorCode SerializeUIDMap(Byte *buff, size_t buffSize, size_t &outSize); + static PSErrorCode DeserializeUIDMap(const Byte *buff, size_t buffSize); + static PSErrorCode StoreUIDMap(); + static PSErrorCode LoadUIDMap(); + static bool HasEntry(PersistentStorageNode *node, psa_storage_uid_t &uid); + static psa_storage_uid_t UIDFromString(char *str, bool *alreadyInTheMap = nullptr); + + static constexpr size_t kMaxMapSerializationBufferSize = + (PersistentStorageNode::kMaxKeyNameLength + sizeof(SerializedUIDType)) * kMaxEntriesNumber + + sizeof(UidMap::ElementCounterType); + + static UidMap sUidMap; + static Byte sSerializedMapBuff[kMaxMapSerializationBufferSize]; +}; + +inline PSErrorCode PersistentStorageSecure::_NonSecureInit() +{ + return PSErrorCode::NotSupported; +}; + +inline PSErrorCode PersistentStorageSecure::_NonSecureStore(PersistentStorageNode *node, const void *data, + size_t dataSize) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSecure::_NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSecure::_NonSecureHasEntry(PersistentStorageNode *node) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSecure::_NonSecureRemove(PersistentStorageNode *node) +{ + return PSErrorCode::NotSupported; +} + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.cpp b/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.cpp new file mode 100644 index 000000000000..2de6e224e846 --- /dev/null +++ b/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "persistent_storage_settings.h" + +#include +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +namespace +{ +struct ReadEntry { + void *destination; + size_t destinationBufferSize; + size_t readSize; + bool result; +}; + +/* Random magic bytes to represent an empty value. + It is needed because Zephyr settings subsystem does not distinguish an empty value from no value. */ +constexpr uint8_t kEmptyValue[] = { 0x22, 0xa6, 0x54, 0xd1, 0x39 }; +constexpr size_t kEmptyValueSize = sizeof(kEmptyValue); + +int LoadEntryCallback(const char *name, size_t entrySize, settings_read_cb readCb, void *cbArg, void *param) +{ + ReadEntry &entry = *static_cast(param); + + /* name != nullptr -> If requested key X is empty, process the next one + name != '\0' -> process just node X and ignore all its descendants: X */ + if (name != nullptr && *name != '\0') { + return 0; + } + + if (!entry.destination || 0 == entry.destinationBufferSize) { + /* Just found the key, do not try to read value */ + entry.result = true; + return 1; + } + + uint8_t emptyValue[kEmptyValueSize]; + + if (entrySize == kEmptyValueSize && readCb(cbArg, emptyValue, kEmptyValueSize) == kEmptyValueSize && + memcmp(emptyValue, kEmptyValue, kEmptyValueSize) == 0) { + /* There are wrong bytes stored - the same as the magic ones defined above */ + entry.result = false; + return 1; + } + + const ssize_t bytesRead = readCb(cbArg, entry.destination, entry.destinationBufferSize); + entry.readSize = bytesRead > 0 ? bytesRead : 0; + + if (entrySize > entry.destinationBufferSize) { + entry.result = false; + } else { + entry.result = bytesRead > 0; + } + + return 1; +} +} /* namespace */ + +namespace Nrf +{ +PSErrorCode PersistentStorageSettings::_NonSecureInit() +{ + return settings_load() ? PSErrorCode::Failure : PSErrorCode::Success; +} + +PSErrorCode PersistentStorageSettings::_NonSecureStore(PersistentStorageNode *node, const void *data, size_t dataSize) +{ + if (!data || !node) { + return PSErrorCode::Failure; + } + + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (!node->GetKey(key)) { + return PSErrorCode::Failure; + } + + return (settings_save_one(key, data, dataSize) ? PSErrorCode::Failure : PSErrorCode::Success); +} + +PSErrorCode PersistentStorageSettings::_NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + if (!data || !node) { + return PSErrorCode::Failure; + } + + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (!node->GetKey(key)) { + return PSErrorCode::Failure; + } + + size_t resultSize; + + bool result = LoadEntry(key, data, dataMaxSize, &resultSize); + + if (result) { + outSize = resultSize; + } + + return (result ? PSErrorCode::Success : PSErrorCode::Failure); +} + +PSErrorCode PersistentStorageSettings::_NonSecureHasEntry(PersistentStorageNode *node) +{ + if (!node) { + return PSErrorCode::Failure; + } + + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (!node->GetKey(key)) { + return PSErrorCode::Failure; + } + + return (LoadEntry(key) ? PSErrorCode::Success : PSErrorCode::Failure); +} + +PSErrorCode PersistentStorageSettings::_NonSecureRemove(PersistentStorageNode *node) +{ + if (!node) { + return PSErrorCode::Failure; + } + + char key[PersistentStorageNode::kMaxKeyNameLength]; + + if (!node->GetKey(key)) { + return PSErrorCode::Failure; + } + + if (!LoadEntry(key)) { + return PSErrorCode::Failure; + } + + settings_delete(key); + + return PSErrorCode::Success; +} + +bool PersistentStorageSettings::LoadEntry(const char *key, void *data, size_t dataMaxSize, size_t *outSize) +{ + ReadEntry entry{ data, dataMaxSize, 0, false }; + settings_load_subtree_direct(key, LoadEntryCallback, &entry); + + if (!entry.result) { + return false; + } + + if (outSize != nullptr) { + *outSize = entry.readSize; + } + + return true; +} +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.h b/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.h new file mode 100644 index 000000000000..824783bf212d --- /dev/null +++ b/samples/matter/common/src/persistent_storage/backends/persistent_storage_settings.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include "../persistent_storage_common.h" + +namespace Nrf +{ +class PersistentStorageSettings { +protected: + PSErrorCode _NonSecureInit(); + PSErrorCode _NonSecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + PSErrorCode _NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + PSErrorCode _NonSecureHasEntry(PersistentStorageNode *node); + PSErrorCode _NonSecureRemove(PersistentStorageNode *node); + + PSErrorCode _SecureInit(); + PSErrorCode _SecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + PSErrorCode _SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + PSErrorCode _SecureHasEntry(PersistentStorageNode *node); + PSErrorCode _SecureRemove(PersistentStorageNode *node); + +private: + bool LoadEntry(const char *key, void *data = nullptr, size_t dataMaxSize = 0, size_t *outSize = nullptr); +}; + +inline PSErrorCode PersistentStorageSettings::_SecureInit() +{ + return PSErrorCode::NotSupported; +}; + +inline PSErrorCode PersistentStorageSettings::_SecureStore(PersistentStorageNode *node, const void *data, + size_t dataSize) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSettings::_SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSettings::_SecureHasEntry(PersistentStorageNode *node) +{ + return PSErrorCode::NotSupported; +} + +inline PSErrorCode PersistentStorageSettings::_SecureRemove(PersistentStorageNode *node) +{ + return PSErrorCode::NotSupported; +} + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/persistent_storage.h b/samples/matter/common/src/persistent_storage/persistent_storage.h new file mode 100644 index 000000000000..d4f65bba3f97 --- /dev/null +++ b/samples/matter/common/src/persistent_storage/persistent_storage.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include "persistent_storage_common.h" + +namespace Nrf +{ + +class PersistentStorageImpl; + +/** + * @brief Interface class to manage persistent storage using generic PersistentStorageNode data unit. + * + * PersistentStorage interface consists of NonSecure* and Secure* methods that implement the persistence related + * operations. The NonSecure* prefix indicates that the method does not provide additional security layer and keeps the + * raw material in a persistent storage. Secure* prefix indicates that the method shall leverage the additional security + * layer, like PSA Certified API, that typically causes extra computational overhead and memory usage. + */ +class PersistentStorage { +public: + /** + * @brief Perform the initialization required before using the storage. + * + * @return true if success. + * @return false otherwise. + */ + PSErrorCode NonSecureInit(); + + /** + * @brief Store data into the persistent storage. + * + * @param node address of the tree node containing information about the key. + * @param data data to store into a specific key. + * @param dataSize a size of input buffer. + * @return true if key has been written successfully. + * @return false an error occurred. + */ + PSErrorCode NonSecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + + /** + * @brief Load data from the persistent storage. + * + * @param node address of the tree node containing information about the key. + * @param data data buffer to load from a specific key. + * @param dataMaxSize a size of data buffer to load. + * @param outSize an actual size of read data. + * @return true if key has been loaded successfully. + * @return false an error occurred. + */ + PSErrorCode NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + + /** + * @brief Check if given key entry exists in the persistent storage. + * + * @param node address of the tree node containing information about the key. + * @return true if key entry exists. + * @return false if key entry does not exist. + */ + PSErrorCode NonSecureHasEntry(PersistentStorageNode *node); + + /** + * @brief Remove given key entry from the persistent storage. + * + * @param node address of the tree node containing information about the key. + * @return true if key entry has been removed successfully. + * @return false an error occurred. + */ + PSErrorCode NonSecureRemove(PersistentStorageNode *node); + + /* Secure storage API counterparts.*/ + PSErrorCode SecureInit(); + PSErrorCode SecureStore(PersistentStorageNode *node, const void *data, size_t dataSize); + PSErrorCode SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); + PSErrorCode SecureHasEntry(PersistentStorageNode *node); + PSErrorCode SecureRemove(PersistentStorageNode *node); + +protected: + PersistentStorage() = default; + ~PersistentStorage() = default; + + PersistentStorage(const PersistentStorage &) = delete; + PersistentStorage(PersistentStorage &&) = delete; + PersistentStorage &operator=(const PersistentStorage &) = delete; + PersistentStorage &operator=(PersistentStorage &&) = delete; + +private: + PersistentStorageImpl *Impl(); +}; + +/* This should be defined by the implementation class. */ +extern PersistentStorage &GetPersistentStorage(); + +} /* namespace Nrf */ + +#include "persistent_storage_impl.h" +namespace Nrf +{ + +inline PersistentStorageImpl *PersistentStorage::Impl() +{ + return static_cast(this); +} + +/* Non secure storage API. */ +inline PSErrorCode PersistentStorage::NonSecureInit() +{ + return Impl()->_NonSecureInit(); +}; + +inline PSErrorCode PersistentStorage::NonSecureStore(PersistentStorageNode *node, const void *data, size_t dataSize) +{ + return Impl()->_NonSecureStore(node, data, dataSize); +} + +inline PSErrorCode PersistentStorage::NonSecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + return Impl()->_NonSecureLoad(node, data, dataMaxSize, outSize); +} + +inline PSErrorCode PersistentStorage::NonSecureHasEntry(PersistentStorageNode *node) +{ + return Impl()->_NonSecureHasEntry(node); +} + +inline PSErrorCode PersistentStorage::NonSecureRemove(PersistentStorageNode *node) +{ + return Impl()->_NonSecureRemove(node); +} + +/* Secure storage API. */ +inline PSErrorCode PersistentStorage::SecureInit() +{ + return Impl()->_SecureInit(); +}; + +inline PSErrorCode PersistentStorage::SecureStore(PersistentStorageNode *node, const void *data, size_t dataSize) +{ + return Impl()->_SecureStore(node, data, dataSize); +} + +inline PSErrorCode PersistentStorage::SecureLoad(PersistentStorageNode *node, void *data, size_t dataMaxSize, + size_t &outSize) +{ + return Impl()->_SecureLoad(node, data, dataMaxSize, outSize); +} + +inline PSErrorCode PersistentStorage::SecureHasEntry(PersistentStorageNode *node) +{ + return Impl()->_SecureHasEntry(node); +} + +inline PSErrorCode PersistentStorage::SecureRemove(PersistentStorageNode *node) +{ + return Impl()->_SecureRemove(node); +} + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_common.h b/samples/matter/common/src/persistent_storage/persistent_storage_common.h new file mode 100644 index 000000000000..eb25096711db --- /dev/null +++ b/samples/matter/common/src/persistent_storage/persistent_storage_common.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include + +namespace Nrf +{ +enum PSErrorCode : uint8_t { Failure, Success, NotSupported }; + +/** + * @brief Class representing single tree node and containing information about its key. + */ +class PersistentStorageNode { +public: + static constexpr uint8_t kMaxKeyNameLength{ CONFIG_NCS_SAMPLE_MATTER_STORAGE_MAX_KEY_LEN }; + + /** + * @brief Constructor assigns name of a key for this node and sets parent node address in the tree + * hierarchy. The node does not need to have a parent (parent = nullptr), if it is a top level element. + */ + PersistentStorageNode(const char *keyName, size_t keyNameLength, PersistentStorageNode *parent = nullptr) + { + if (keyName && keyNameLength < kMaxKeyNameLength) { + memcpy(mKeyName, keyName, keyNameLength); + mKeyName[keyNameLength] = '\0'; + } + mParent = parent; + } + + /** + * @brief Gets complete key name for this node including its position in the tree hierarchy. The key + * name is a key name specific for this node concatenated with the names of all parents up to the top of the + * tree. + * + * @return true if the key has been created successfully + * @return false otherwise + */ + bool GetKey(char *key) + { + if (!key || mKeyName[0] == '\0') { + return false; + } + + /* Recursively call GetKey method for the parents until the full key name including all hierarchy levels + * will be created. */ + if (mParent != nullptr) { + char parentKey[kMaxKeyNameLength]; + + if (!mParent->GetKey(parentKey)) { + return false; + } + + int result = snprintf(key, kMaxKeyNameLength, "%s/%s", parentKey, mKeyName); + + /* snprintf() returns the number of characters written not counting the terminating null. */ + if (result < 0 || result + 1 > kMaxKeyNameLength) { + return false; + } + + } else { + /* In case of not having a parent, return only own key name. */ + strncpy(key, mKeyName, kMaxKeyNameLength); + } + + return true; + } + +private: + PersistentStorageNode *mParent = nullptr; + char mKeyName[kMaxKeyNameLength] = { 0 }; +}; + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_impl.h b/samples/matter/common/src/persistent_storage/persistent_storage_impl.h new file mode 100644 index 000000000000..259b9c625878 --- /dev/null +++ b/samples/matter/common/src/persistent_storage/persistent_storage_impl.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include "persistent_storage.h" + +#ifdef CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND +#include "backends/persistent_storage_settings.h" +#endif + +#ifdef CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND +#include "backends/persistent_storage_secure.h" +#endif + +namespace Nrf +{ +class PersistentStorageImpl : public PersistentStorage +#ifdef CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND + , + public PersistentStorageSettings +#endif +#ifdef CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND + , + public PersistentStorageSecure +#endif +{ + friend class PersistentStorage; + +#ifdef CONFIG_NCS_SAMPLE_MATTER_SETTINGS_STORAGE_BACKEND + + using PersistentStorageSettings::_NonSecureHasEntry; + using PersistentStorageSettings::_NonSecureInit; + using PersistentStorageSettings::_NonSecureLoad; + using PersistentStorageSettings::_NonSecureRemove; + using PersistentStorageSettings::_NonSecureStore; +#endif + +#ifdef CONFIG_NCS_SAMPLE_MATTER_SECURE_STORAGE_BACKEND + using PersistentStorageSecure::_SecureHasEntry; + using PersistentStorageSecure::_SecureInit; + using PersistentStorageSecure::_SecureLoad; + using PersistentStorageSecure::_SecureRemove; + using PersistentStorageSecure::_SecureStore; +#endif +}; + +/* Implementation of the generic PersistentStorage getter. */ +inline PersistentStorage &GetPersistentStorage() +{ + static PersistentStorageImpl sInstance; + return sInstance; +} + +} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_util.cpp b/samples/matter/common/src/persistent_storage/persistent_storage_util.cpp deleted file mode 100644 index c300dc087687..000000000000 --- a/samples/matter/common/src/persistent_storage/persistent_storage_util.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include "persistent_storage_util.h" - -#include - -LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); - -namespace -{ -struct ReadEntry { - void *destination; - size_t destinationBufferSize; - size_t readSize; - bool result; -}; - -/* Random magic bytes to represent an empty value. - It is needed because Zephyr settings subsystem does not distinguish an empty value from no value. -*/ -constexpr uint8_t kEmptyValue[] = { 0x22, 0xa6, 0x54, 0xd1, 0x39 }; -constexpr size_t kEmptyValueSize = sizeof(kEmptyValue); - -int LoadEntryCallback(const char *name, size_t entrySize, settings_read_cb readCb, void *cbArg, void *param) -{ - ReadEntry &entry = *static_cast(param); - - /* name != nullptr -> If requested key X is empty, process the next one - name != '\0' -> process just node X and ignore all its descendants: X */ - if (name != nullptr && *name != '\0') { - return 0; - } - - if (!entry.destination || 0 == entry.destinationBufferSize) { - /* Just found the key, do not try to read value */ - entry.result = true; - return 1; - } - - uint8_t emptyValue[kEmptyValueSize]; - - if (entrySize == kEmptyValueSize && readCb(cbArg, emptyValue, kEmptyValueSize) == kEmptyValueSize && - memcmp(emptyValue, kEmptyValue, kEmptyValueSize) == 0) { - /* There are wrong bytes stored - the same as the magic ones defined above */ - entry.result = false; - return 1; - } - - const ssize_t bytesRead = readCb(cbArg, entry.destination, entry.destinationBufferSize); - entry.readSize = bytesRead > 0 ? bytesRead : 0; - - if (entrySize > entry.destinationBufferSize) { - entry.result = false; - } else { - entry.result = bytesRead > 0; - } - - return 1; -} -} /* namespace */ - -namespace Nrf { - -bool PersistentStorage::Init() -{ - return settings_load() ? false : true; -} - -bool PersistentStorage::Store(PersistentStorageNode *node, const void *data, size_t dataSize) -{ - if (!data || !node) { - return false; - } - - char key[PersistentStorageNode::kMaxKeyNameLength]; - - if (!node->GetKey(key)) { - return false; - } - - return (0 == settings_save_one(key, data, dataSize)); -} - -bool PersistentStorage::Load(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize) -{ - if (!data || !node) { - return false; - } - - char key[PersistentStorageNode::kMaxKeyNameLength]; - - if (!node->GetKey(key)) { - return false; - } - - size_t resultSize; - - bool result = LoadEntry(key, data, dataMaxSize, &resultSize); - - if (result) { - outSize = resultSize; - } - - return result; -} - -bool PersistentStorage::HasEntry(PersistentStorageNode *node) -{ - if (!node) { - return false; - } - - char key[PersistentStorageNode::kMaxKeyNameLength]; - - if (!node->GetKey(key)) { - return false; - } - - return LoadEntry(key); -} - -bool PersistentStorage::Remove(PersistentStorageNode *node) -{ - if (!node) { - return false; - } - - char key[PersistentStorageNode::kMaxKeyNameLength]; - - if (!node->GetKey(key)) { - return false; - } - - if (!LoadEntry(key)) { - return false; - } - - settings_delete(key); - - return true; -} - -bool PersistentStorage::LoadEntry(const char *key, void *data, size_t dataMaxSize, size_t *outSize) -{ - ReadEntry entry{ data, dataMaxSize, 0, false }; - settings_load_subtree_direct(key, LoadEntryCallback, &entry); - - if (!entry.result) { - return false; - } - - if (outSize != nullptr) { - *outSize = entry.readSize; - } - - return true; -} - -bool PersistentStorageNode::GetKey(char *key) -{ - if (!key || mKeyName[0] == '\0') { - return false; - } - - /* Recursively call GetKey method for the parents until the full key name including all hierarchy levels will be - * created. */ - if (mParent != nullptr) { - char parentKey[kMaxKeyNameLength]; - - if (!mParent->GetKey(parentKey)) { - return false; - } - - int result = snprintf(key, kMaxKeyNameLength, "%s/%s", parentKey, mKeyName); - - if (result < 0 || result >= kMaxKeyNameLength) { - return false; - } - - } else { - /* In case of not having a parent, return only own key name. */ - strncpy(key, mKeyName, kMaxKeyNameLength); - } - - return true; -} - -} /* namespace Nrf */ diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_util.h b/samples/matter/common/src/persistent_storage/persistent_storage_util.h deleted file mode 100644 index 55ea3e028485..000000000000 --- a/samples/matter/common/src/persistent_storage/persistent_storage_util.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2023 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#pragma once - -#include -#include - -namespace Nrf { - -/** - * @brief Class representing single settings tree node and containing information about its key. - */ -class PersistentStorageNode { -public: - static constexpr auto kMaxKeyNameLength = (SETTINGS_MAX_NAME_LEN + 1); - - /** - * @brief Constructor assigns name of a key for this settings node and sets parent node address in the tree - * hierarchy. The node does not need to have a parent (parent = nullptr), if it is a top level element. - */ - PersistentStorageNode(const char *keyName, size_t keyNameLength, PersistentStorageNode *parent = nullptr) - { - if (keyName && keyNameLength < kMaxKeyNameLength) { - memcpy(mKeyName, keyName, keyNameLength); - mKeyName[keyNameLength] = '\0'; - } - mParent = parent; - } - - /** - * @brief Gets complete settings key name for this node including its position in the tree hierarchy. The key - * name is a key name specific for this node concatenated with the names of all parents up to the top of the - * tree. - * - * @return true if the key has been created successfully - * @return false otherwise - */ - bool GetKey(char *key); - -private: - PersistentStorageNode *mParent = nullptr; - char mKeyName[kMaxKeyNameLength] = { 0 }; -}; - -/** - * @brief Class to manage peristent storage using generic PersistentStorageNode data unit that wraps settings key - * information. - */ -class PersistentStorage { -public: - /** - * @brief Load all settings from persistent storage - * - * @return true if settings have been loaded - * @return false otherwise - */ - bool Init(); - - /** - * @brief Store data into settings - * - * @param node address of settings tree node containing information about the key - * @param data data to store into a specific settings key - * @param dataSize a size of input buffer - * @return true if key has been written successfully - * @return false an error occurred - */ - bool Store(PersistentStorageNode *node, const void *data, size_t dataSize); - - /** - * @brief Load data from settings - * - * @param node address of settings tree node containing information about the key - * @param data data buffer to load from a specific settings key - * @param dataMaxSize a size of data buffer to load - * @param outSize an actual size of read data - * @return true if key has been loaded successfully - * @return false an error occurred - */ - bool Load(PersistentStorageNode *node, void *data, size_t dataMaxSize, size_t &outSize); - - /** - * @brief Check if given key entry exists in settings - * - * @param node address of settings tree node containing information about the key - * @return true if key entry exists - * @return false if key entry does not exist - */ - bool HasEntry(PersistentStorageNode *node); - - /** - * @brief Remove given key entry from settings - * - * @param node address of settings tree node containing information about the key - * @return true if key entry has been removed successfully - * @return false an error occurred - */ - bool Remove(PersistentStorageNode *node); - - static PersistentStorage &Instance() - { - static PersistentStorage sInstance; - return sInstance; - } - -private: - bool LoadEntry(const char *key, void *data = nullptr, size_t dataMaxSize = 0, size_t *outSize = nullptr); -}; - -} /* namespace Nrf */ diff --git a/samples/matter/common/src/util/finite_map.h b/samples/matter/common/src/util/finite_map.h new file mode 100644 index 000000000000..7934c590fbd1 --- /dev/null +++ b/samples/matter/common/src/util/finite_map.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace Nrf +{ +/* + FiniteMap template container allows to wrap mappings between T1-type trivial key and T2-type value. + The size or the container is predefined at compilation time, therefore + the maximum number of stored elements must be well known. FiniteMap owns + inserted values, meaning that once the user inserts a value it will not longer + be valid outside of the container, i.e. FiniteMap cannot return stored object by copy. + FiniteMap's API offers basic operations like: + * inserting new values under provided key (Insert) + * erasing existing items under a given key (Erase) - this operation does not take care of the + duplicated items, meaning that the pointer under a given key is released unconditionally + and the responsibility for the duplications is on the application side. + * retrieving values stored under provided key ([] operator) + * checking if the map contains a non-null value under given key (Contains) + * retrieving a number of free slots available in the map (FreeSlots) + * iterating though stored item via publicly available mMap member + * retrieving the first free slot (GetFirstFreeSlot) + Prerequisites: + * T1 must be trivial and the maximum numeric limit for the T1-type value is reserved and assigned as an invalid + key. + * T2 must have move semantics and bool()/==operators implemented +*/ +template struct FiniteMap { + static_assert(std::is_trivial_v); + + static constexpr T1 kInvalidKey{ std::numeric_limits::max() }; + static constexpr std::size_t kNoSlotsFound{ N + 1 }; + using ElementCounterType = uint16_t; + + struct Item { + /* Initialize with invalid key (0 is a valid key) */ + T1 key{ kInvalidKey }; + T2 value; + }; + + bool Insert(T1 key, T2 &&value) + { + if (Contains(key)) { + /* The key already exists in the map, return prematurely. */ + return false; + } else if (mElementsCount < N) { + std::size_t slot = GetFirstFreeSlot(); + if (slot == kNoSlotsFound) { + return false; + } + mMap[slot].key = key; + mMap[slot].value = std::move(value); + mElementsCount++; + } + return true; + } + + bool Erase(T1 key) + { + const auto &it = std::find_if(std::begin(mMap), std::end(mMap), + [key](const Item &item) { return item.key == key; }); + if (it != std::end(mMap)) { + it->value = T2{}; + it->key = kInvalidKey; + mElementsCount--; + return true; + } + return false; + } + + /* Always use Contains() before using operator[]. */ + T2 &operator[](T1 key) + { + static T2 dummyObject; + for (auto &it : mMap) { + if (key == it.key) + return it.value; + } + return dummyObject; + } + + bool Contains(T1 key) + { + for (auto &it : mMap) { + if (key == it.key) + return true; + } + return false; + } + + ElementCounterType FreeSlots() { return N - mElementsCount; } + + ElementCounterType Size() { return mElementsCount; } + + ElementCounterType GetFirstFreeSlot() + { + ElementCounterType foundIndex = 0; + for (auto &it : mMap) { + if (kInvalidKey == it.key) + return foundIndex; + foundIndex++; + } + return kNoSlotsFound; + } + + uint8_t GetDuplicatesCount(const T2 &value, T1 *key) + { + /* Find the first duplicated item and return its key, + so that the application can handle the duplicate by itself. */ + *key = kInvalidKey; + uint8_t numberOfDuplicates = 0; + for (auto it = std::begin(mMap); it != std::end(mMap); ++it) { + if (it->value == value) { + *(key++) = it->key; + numberOfDuplicates++; + } + } + + return numberOfDuplicates; + } + + Item mMap[N]; + ElementCounterType mElementsCount{ 0 }; +}; + +} /* namespace Nrf */ diff --git a/samples/matter/light_bulb/CMakeLists.txt b/samples/matter/light_bulb/CMakeLists.txt index 98e3e1a86886..c4b51dc444ad 100644 --- a/samples/matter/light_bulb/CMakeLists.txt +++ b/samples/matter/light_bulb/CMakeLists.txt @@ -11,15 +11,6 @@ set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconn set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-light-bulb) diff --git a/samples/matter/light_bulb/Kconfig.sysbuild b/samples/matter/light_bulb/Kconfig.sysbuild index 8f357bf3c11f..1c231a4c9225 100644 --- a/samples/matter/light_bulb/Kconfig.sysbuild +++ b/samples/matter/light_bulb/Kconfig.sysbuild @@ -5,16 +5,26 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOARD_NRF21540DK + +config BOOTLOADER_MCUBOOT + default n + +config BOOTLOADER_NONE + default y + +endif + +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/light_bulb/README.rst b/samples/matter/light_bulb/README.rst index 030141cbb9a0..6da3b80c4d2c 100644 --- a/samples/matter/light_bulb/README.rst +++ b/samples/matter/light_bulb/README.rst @@ -39,8 +39,8 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, and ``nrf21540dk_nrf52840``. -* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk_nrf5340_cpuapp``. +* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, ``nrf21540dk/nrf52840``, and ``nrf54l15pdk/nrf54l15``. +* Matter over Wi-Fi is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk/nrf5340/cpuapp``. Overview ******** @@ -85,7 +85,7 @@ The sample does not use a single :file:`prj.conf` file. Configuration files are provided for different build types, and they are located in the sample root directory. Before you start testing the application, you can select one of the build types supported by the application. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The sample supports the following build types: @@ -105,10 +105,6 @@ The sample supports the following build types: - :file:`prj_release.conf` - All from `Requirements`_ - Release version of the application; can be used to enable only the necessary application functionalities to optimize its performance. - * - No DFU - - :file:`prj_no_dfu.conf` - - nRF52840 DK, nRF5340 DK, nRF7002 DK, and nRF21540 DK - - Debug version of the application without Device Firmware Upgrade feature support. .. matter_light_bulb_sample_configuration_file_types_end @@ -119,6 +115,10 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_build_with_dfu_start + :end-before: matter_template_nrf54l15_build_with_dfu_end + FEM support =========== @@ -171,7 +171,7 @@ To set up an AWS IoT instance and configure the sample, complete the following s .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG="overlay-aws-iot-integration.conf" + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE="overlay-aws-iot-integration.conf" #. Flash the firmware and boot the sample. #. |connect_kit| @@ -200,6 +200,10 @@ To set up an AWS IoT instance and configure the sample, complete the following s User interface ************** +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_0_3_0_interface_start + :end-before: matter_template_nrf54l15_0_3_0_interface_end + .. include:: ../lock/README.rst :start-after: matter_door_lock_sample_led1_start :end-before: matter_door_lock_sample_led1_end @@ -241,7 +245,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the :ref:`matter_light_bulb_build_types`. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Testing ======= @@ -276,7 +280,7 @@ After building the sample and programming it to your development kit, complete t I: Turn Off Action has been initiated I: Turn Off Action has been completed -#. Press **Button 1** to initiate the factory reset of the device. +#. Keep the **Button 1** pressed for more than six seconds to initiate factory reset of the device. .. _matter_light_bulb_sample_light_switch_tests: diff --git a/samples/matter/light_bulb/VERSION b/samples/matter/light_bulb/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/light_bulb/VERSION +++ b/samples/matter/light_bulb/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/light_bulb/boards/nrf21540dk_nrf52840.conf b/samples/matter/light_bulb/boards/nrf21540dk_nrf52840.conf new file mode 100644 index 000000000000..1ef521e9b19f --- /dev/null +++ b/samples/matter/light_bulb/boards/nrf21540dk_nrf52840.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Other settings +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_CHIP_LIB_SHELL=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# Disable Factory data feature +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1fd21a283a54 --- /dev/null +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,21 @@ +# +# 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 DFU and external flash will be supported on nRF54L. +CONFIG_CHIP_OTA_REQUESTOR=n +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay new file mode 100644 index 000000000000..10aee13b9346 --- /dev/null +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + + // Configure PWM module for led1 (LED2 on the board) + pwm-led1 = &pwm_led1; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_led1: pwm_led_1 { + pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm_default>; + pinctrl-1 = <&pwm_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pinctrl { + pwm_default: pwm_default { + group1 { + psels = ; + }; + }; + pwm_sleep: pwm_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay new file mode 100644 index 000000000000..8f8b02a79f4b --- /dev/null +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + + // Configure PWM module for led1 (LED2 on the board) + pwm-led1 = &pwm_led1; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_led1: pwm_led_1 { + pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm_default>; + pinctrl-1 = <&pwm_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pinctrl { + pwm_default: pwm_default { + group1 { + psels = ; + }; + }; + pwm_sleep: pwm_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..ad5fd560f555 --- /dev/null +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,20 @@ +# +# 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 external flash will be supported on nRF54L. +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf deleted file mode 100644 index d3deb11a1040..000000000000 --- a/samples/matter/light_bulb/child_image/hci_ipc/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_ipc.defaults to set options common for all -# samples using hci_ipc. This file should contain only options specific for this sample -# hci_ipc configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_bulb/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..da29968217bb --- /dev/null +++ b/samples/matter/light_bulb/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/light_bulb/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/light_bulb/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index e69edb5a2c0e..000000000000 --- a/samples/matter/light_bulb/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_bulb/overlay-aws-iot-integration.conf b/samples/matter/light_bulb/overlay-aws-iot-integration.conf index 7da6ce13140a..059b6b7a53c1 100644 --- a/samples/matter/light_bulb/overlay-aws-iot-integration.conf +++ b/samples/matter/light_bulb/overlay-aws-iot-integration.conf @@ -20,6 +20,7 @@ CONFIG_JSON_LIBRARY=y # MQTT helper library CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES=y +CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER="src/aws_iot_integration/certs" CONFIG_MQTT_HELPER_SEC_TAG=201 # MQTT - Maximum MQTT keepalive timeout specified by AWS IoT Core @@ -29,6 +30,7 @@ CONFIG_MQTT_CLEAN_SESSION=y # MBed TLS CONFIG_MBEDTLS_HEAP_SIZE=98304 CONFIG_MBEDTLS_RSA_C=y +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=1024 # PSA CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y @@ -41,6 +43,7 @@ CONFIG_NET_IPV4=y CONFIG_NET_TCP=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y CONFIG_NET_MAX_CONN=8 +CONFIG_POSIX_MAX_FDS=25 # Adjust NET configurations to reduce the likelyhood of congestion in the TCP stack when there are # multiple NET users in the system. diff --git a/samples/matter/light_bulb/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf52840dk_nrf52840.yml similarity index 100% rename from samples/matter/light_bulb/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf52840dk_nrf52840.yml diff --git a/samples/matter/light_switch/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf52840dk_nrf52840_release.yml similarity index 100% rename from samples/matter/light_switch/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf52840dk_nrf52840_release.yml diff --git a/samples/matter/light_switch/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf5340dk_nrf5340_cpuapp.yml similarity index 100% rename from samples/matter/light_switch/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf5340dk_nrf5340_cpuapp.yml diff --git a/samples/matter/template/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/template/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml diff --git a/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml new file mode 100644 index 000000000000..a28d1effed5f --- /dev/null +++ b/samples/matter/light_bulb/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml @@ -0,0 +1,51 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x7000 +mcuboot_pad: + address: 0x7000 + region: flash_primary + size: 0x800 +app: + address: 0x7800 + region: flash_primary + size: 0xb6000 +mcuboot_primary: + address: 0x7000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb6800 + span: *id001 +mcuboot_primary_app: + address: 0x7800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6000 + span: *id002 +mcuboot_secondary: + address: 0xbd800 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb6800 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbd800 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbe000 + size: 0xb6000 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 diff --git a/samples/matter/light_switch/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf7002dk_nrf5340_cpuapp.yml similarity index 100% rename from samples/matter/light_switch/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf7002dk_nrf5340_cpuapp.yml diff --git a/samples/matter/lock/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_bulb/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/lock/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_bulb/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml diff --git a/samples/matter/light_bulb/prj_no_dfu.conf b/samples/matter/light_bulb/prj_no_dfu.conf deleted file mode 100644 index a527d06aacb2..000000000000 --- a/samples/matter/light_bulb/prj_no_dfu.conf +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32773 == 0x8005 (example lighting-app) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 -CONFIG_STD_CPP17=y - -# Enable CHIP pairing automatically on application start. -CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y -CONFIG_PWM=y - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterLight" - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/light_bulb/sample.yaml b/samples/matter/light_bulb/sample.yaml index 05d560737088..e81d9fce9074 100644 --- a/samples/matter/light_bulb/sample.yaml +++ b/samples/matter/light_bulb/sample.yaml @@ -6,44 +6,62 @@ tests: build_only: true extra_args: CONF_FILE=prj_release.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.light_bulb.ffs: build_only: true extra_args: > CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE=y CONFIG_CHIP_ROTATING_DEVICE_ID=y CONFIG_CHIP_DEVICE_TYPE=257 integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.light_bulb.debug.nrf21540ek: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 sample.matter.light_bulb.debug.nrf21540ek_fwd: build_only: true extra_args: SHIELD=nrf21540ek_fwd multiprotocol_rpmsg_SHIELD=nrf21540ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp # Sample to execute load tests sample.matter.light_bulb.persistent_subscriptions: build_only: true extra_args: CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS=y - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp sample.matter.light_bulb.aws: build_only: true - extra_args: OVERLAY_CONFIG="overlay-aws-iot-integration.conf" - platform_allow: nrf7002dk_nrf5340_cpuapp + extra_args: EXTRA_CONF_FILE="overlay-aws-iot-integration.conf" + platform_allow: nrf7002dk/nrf5340/cpuapp integration_platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + sample.matter.light_bulb.memory_profiling: + build_only: true + extra_args: CONFIG_CHIP_MEMORY_PROFILING=y CONFIG_SHELL_MINIMAL=y + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + integration_platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp diff --git a/samples/matter/light_bulb/src/app_task.cpp b/samples/matter/light_bulb/src/app_task.cpp index dddb60914463..4d631b7df28c 100644 --- a/samples/matter/light_bulb/src/app_task.cpp +++ b/samples/matter/light_bulb/src/app_task.cpp @@ -12,7 +12,10 @@ #include "app/matter_init.h" #include "app/task_executor.h" + +#if defined(CONFIG_PWM) #include "pwm/pwm_device.h" +#endif #ifdef CONFIG_CHIP_OTA_REQUESTOR #include "dfu/ota/ota_util.h" @@ -47,7 +50,9 @@ Identify sIdentify = { kLightEndpointId, AppTask::IdentifyStartHandler, AppTask: bool sIsTriggerEffectActive = false; +#if defined(CONFIG_PWM) const struct pwm_dt_spec sLightPwmDevice = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led1)); +#endif // Define a custom attribute persister which makes actual write of the CurrentLevel attribute value // to the non-volatile storage only when it has remained constant for 5 seconds. This is to reduce @@ -73,7 +78,10 @@ void AppTask::IdentifyStopHandler(Identify *) { Nrf::PostTask([] { Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(false); + +#if defined(CONFIG_PWM) Instance().mPWMDevice.ApplyLevel(); +#endif }); } @@ -84,7 +92,10 @@ void AppTask::TriggerEffectTimerTimeoutCallback(k_timer *timer) sIsTriggerEffectActive = false; Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(false); + +#if defined(CONFIG_PWM) Instance().mPWMDevice.ApplyLevel(); +#endif } void AppTask::TriggerIdentifyEffectHandler(Identify *identify) @@ -103,7 +114,9 @@ void AppTask::TriggerIdentifyEffectHandler(Identify *identify) k_timer_stop(&sTriggerEffectTimer); k_timer_start(&sTriggerEffectTimer, K_MSEC(kTriggerEffectTimeout), K_NO_WAIT); +#if defined(CONFIG_PWM) Instance().mPWMDevice.SuppressOutput(); +#endif Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Blink(Nrf::LedConsts::kIdentifyBlinkRate_ms); break; @@ -119,7 +132,10 @@ void AppTask::TriggerIdentifyEffectHandler(Identify *identify) k_timer_stop(&sTriggerEffectTimer); Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(false); + +#if defined(CONFIG_PWM) Instance().mPWMDevice.ApplyLevel(); +#endif } break; default: @@ -130,12 +146,10 @@ void AppTask::TriggerIdentifyEffectHandler(Identify *identify) void AppTask::LightingActionEventHandler(const LightingEvent &event) { +#if defined(CONFIG_PWM) Nrf::PWMDevice::Action_t action = Nrf::PWMDevice::INVALID_ACTION; int32_t actor = 0; - if (event.Actor == LightingActor::Remote) { - action = static_cast(event.Action); - actor = static_cast(event.Actor); - } else if (event.Actor == LightingActor::Button) { + if (event.Actor == LightingActor::Button) { action = Instance().mPWMDevice.IsTurnedOn() ? Nrf::PWMDevice::OFF_ACTION : Nrf::PWMDevice::ON_ACTION; actor = static_cast(event.Actor); } @@ -143,6 +157,9 @@ void AppTask::LightingActionEventHandler(const LightingEvent &event) if (action == Nrf::PWMDevice::INVALID_ACTION || !Instance().mPWMDevice.InitiateAction(action, actor, NULL)) { LOG_INF("An action could not be initiated."); } +#else + Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(!Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).GetState()); +#endif } void AppTask::ButtonEventHandler(Nrf::ButtonState state, Nrf::ButtonMask hasChanged) @@ -186,6 +203,7 @@ bool AppTask::AWSIntegrationCallback(struct aws_iot_integration_cb_data *data) } #endif /* CONFIG_AWS_IOT_INTEGRATION */ +#if defined(CONFIG_PWM) void AppTask::ActionInitiated(Nrf::PWMDevice::Action_t action, int32_t actor) { if (action == Nrf::PWMDevice::ON_ACTION) { @@ -211,20 +229,34 @@ void AppTask::ActionCompleted(Nrf::PWMDevice::Action_t action, int32_t actor) Instance().UpdateClusterState(); } } +#endif /* CONFIG_PWM */ void AppTask::UpdateClusterState() { SystemLayer().ScheduleLambda([this] { +#if defined(CONFIG_PWM) /* write the new on/off value */ EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kLightEndpointId, mPWMDevice.IsTurnedOn()); - +#else + EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set( + kLightEndpointId, Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).GetState()); +#endif if (status != EMBER_ZCL_STATUS_SUCCESS) { LOG_ERR("Updating on/off cluster failed: %x", status); } +#if defined(CONFIG_PWM) /* write the current level */ status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, mPWMDevice.GetLevel()); +#else + /* write the current level */ + if (Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).GetState()) { + status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, 100); + } else { + status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kLightEndpointId, 0); + } +#endif if (status != EMBER_ZCL_STATUS_SUCCESS) { LOG_ERR("Updating level cluster failed: %x", status); @@ -249,12 +281,11 @@ CHIP_ERROR AppTask::Init() * state. */ ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0)); - int ret{}; #ifdef CONFIG_AWS_IOT_INTEGRATION - ret = aws_iot_integration_register_callback(AWSIntegrationCallback); - if (ret) { + int retAws = aws_iot_integration_register_callback(AWSIntegrationCallback); + if (retAws) { LOG_ERR("aws_iot_integration_register_callback() failed"); - return chip::System::MapErrorZephyr(ret); + return chip::System::MapErrorZephyr(retAws); } #endif @@ -268,11 +299,14 @@ CHIP_ERROR AppTask::Init() uint8_t maxLightLevel = kDefaultMaxLevel; Clusters::LevelControl::Attributes::MaxLevel::Get(kLightEndpointId, &maxLightLevel); - ret = mPWMDevice.Init(&sLightPwmDevice, minLightLevel, maxLightLevel, maxLightLevel); +#if defined(CONFIG_PWM) + int ret = mPWMDevice.Init(&sLightPwmDevice, minLightLevel, maxLightLevel, maxLightLevel); if (ret != 0) { return chip::System::MapErrorZephyr(ret); } + mPWMDevice.SetCallbacks(ActionInitiated, ActionCompleted); +#endif return Nrf::Matter::StartServer(); } diff --git a/samples/matter/light_bulb/src/aws_iot_integration/CMakeLists.txt b/samples/matter/light_bulb/src/aws_iot_integration/CMakeLists.txt index 4ce2a6e96b99..fdf7cfa92f22 100644 --- a/samples/matter/light_bulb/src/aws_iot_integration/CMakeLists.txt +++ b/samples/matter/light_bulb/src/aws_iot_integration/CMakeLists.txt @@ -7,10 +7,6 @@ target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) if (CONFIG_AWS_IOT_INTEGRATION) - zephyr_include_directories( - CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES certs - ) - target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/codec) target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/aws_iot_integration.c) diff --git a/samples/matter/light_bulb/src/aws_iot_integration/certs/ca-cert.pem b/samples/matter/light_bulb/src/aws_iot_integration/certs/ca-cert.pem deleted file mode 100644 index be90312467dd..000000000000 --- a/samples/matter/light_bulb/src/aws_iot_integration/certs/ca-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CERTIFICATE-----\n" -"-----certificate-----\n" -"-----END CERTIFICATE-----\n" diff --git a/samples/matter/light_bulb/src/aws_iot_integration/certs/client-cert.pem b/samples/matter/light_bulb/src/aws_iot_integration/certs/client-cert.pem deleted file mode 100644 index be90312467dd..000000000000 --- a/samples/matter/light_bulb/src/aws_iot_integration/certs/client-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CERTIFICATE-----\n" -"-----certificate-----\n" -"-----END CERTIFICATE-----\n" diff --git a/samples/matter/light_bulb/src/aws_iot_integration/certs/private-key.pem b/samples/matter/light_bulb/src/aws_iot_integration/certs/private-key.pem deleted file mode 100644 index 89729a333f92..000000000000 --- a/samples/matter/light_bulb/src/aws_iot_integration/certs/private-key.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN RSA PRIVATE KEY-----\n" -"-----key-----\n" -"-----END RSA PRIVATE KEY-----\n" diff --git a/samples/matter/light_bulb/src/chip_project_config.h b/samples/matter/light_bulb/src/chip_project_config.h index 109b4ad90254..9022812408ec 100644 --- a/samples/matter/light_bulb/src/chip_project_config.h +++ b/samples/matter/light_bulb/src/chip_project_config.h @@ -15,10 +15,11 @@ #pragma once -/* - * Switching from Thread child to router may cause a few second packet stall. - * Until this is improved in OpenThread we need to increase the retransmission - * interval to survive the stall. - */ -#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (1000_ms32) -#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (1000_ms32) +// Reduce some flash space when the CONFIG_CHIP_MEMORY_PROFILING is selected +#ifdef CONFIG_CHIP_MEMORY_PROFILING +#define CHIP_CONFIG_LOG_MODULE_SecureChannel_PROGRESS 0 +#define CHIP_CONFIG_LOG_MODULE_FabricProvisioning_PROGRESS 0 +#define CHIP_CONFIG_LOG_MODULE_InteractionModel_PROGRESS 0 +#define CHIP_CONFIG_LOG_MODULE_InteractionModel_DETAIL 0 +#define CHIP_CONFIG_LOG_MODULE_DataManagement_PROGRESS 0 +#endif diff --git a/samples/matter/light_bulb/src/zcl_callbacks.cpp b/samples/matter/light_bulb/src/zcl_callbacks.cpp index 84bc37a9e71f..5e27032d3a2e 100644 --- a/samples/matter/light_bulb/src/zcl_callbacks.cpp +++ b/samples/matter/light_bulb/src/zcl_callbacks.cpp @@ -29,8 +29,14 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &a if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) { ChipLogProgress(Zcl, "Cluster OnOff: attribute OnOff set to %" PRIu8 "", *value); - AppTask::Instance().GetPWMDevice().InitiateAction(*value ? Nrf::PWMDevice::ON_ACTION : Nrf::PWMDevice::OFF_ACTION, + +#if defined(CONFIG_PWM) + AppTask::Instance().GetPWMDevice().InitiateAction(*value ? Nrf::PWMDevice::ON_ACTION : + Nrf::PWMDevice::OFF_ACTION, static_cast(LightingActor::Remote), value); +#else + Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(*value); +#endif #ifdef CONFIG_AWS_IOT_INTEGRATION aws_iot_integration_attribute_set(ATTRIBUTE_ID_ONOFF, *value); @@ -38,12 +44,14 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &a } else if (clusterId == LevelControl::Id && attributeId == LevelControl::Attributes::CurrentLevel::Id) { ChipLogProgress(Zcl, "Cluster LevelControl: attribute CurrentLevel set to %" PRIu8 "", *value); +#if defined(CONFIG_PWM) if (AppTask::Instance().GetPWMDevice().IsTurnedOn()) { AppTask::Instance().GetPWMDevice().InitiateAction( Nrf::PWMDevice::LEVEL_ACTION, static_cast(LightingActor::Remote), value); } else { ChipLogDetail(Zcl, "LED is off. Try to use move-to-level-with-on-off instead of move-to-level"); } +#endif #ifdef CONFIG_AWS_IOT_INTEGRATION aws_iot_integration_attribute_set(ATTRIBUTE_ID_LEVEL_CONTROL, *value); @@ -75,9 +83,13 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint) status = Attributes::OnOff::Get(endpoint, &storedValue); if (status == EMBER_ZCL_STATUS_SUCCESS) { /* Set actual state to the cluster state that was last persisted */ +#if defined(CONFIG_PWM) AppTask::Instance().GetPWMDevice().InitiateAction( storedValue ? Nrf::PWMDevice::ON_ACTION : Nrf::PWMDevice::OFF_ACTION, static_cast(LightingActor::Remote), reinterpret_cast(&storedValue)); +#else + Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(storedValue); +#endif } AppTask::Instance().UpdateClusterState(); diff --git a/samples/matter/light_bulb/sysbuild.cmake b/samples/matter/light_bulb/sysbuild.cmake deleted file mode 100644 index ccb003b1ce2b..000000000000 --- a/samples/matter/light_bulb/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/light_bulb/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/light_bulb/sysbuild_no_dfu.conf b/samples/matter/light_bulb/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/light_bulb/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/matter/light_switch/CMakeLists.txt b/samples/matter/light_switch/CMakeLists.txt index 749151c89727..0f2383ed9db7 100644 --- a/samples/matter/light_switch/CMakeLists.txt +++ b/samples/matter/light_switch/CMakeLists.txt @@ -11,15 +11,6 @@ set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconn set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-light-switch) diff --git a/samples/matter/light_switch/Kconfig.sysbuild b/samples/matter/light_switch/Kconfig.sysbuild index 8f357bf3c11f..1c231a4c9225 100644 --- a/samples/matter/light_switch/Kconfig.sysbuild +++ b/samples/matter/light_switch/Kconfig.sysbuild @@ -5,16 +5,26 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOARD_NRF21540DK + +config BOOTLOADER_MCUBOOT + default n + +config BOOTLOADER_NONE + default y + +endif + +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/light_switch/README.rst b/samples/matter/light_switch/README.rst index ba49adb57fe6..55a51cc63df8 100644 --- a/samples/matter/light_switch/README.rst +++ b/samples/matter/light_switch/README.rst @@ -43,8 +43,8 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, and ``nrf21540dk_nrf52840``. -* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk_nrf5340_cpuapp``. +* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, ``nrf21540dk_nrf52840``, and ``nrf54l15pdk_nrf54l15``. +* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk/nrf5340/cpuapp``. Overview ******** @@ -127,6 +127,10 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_build_with_dfu_start + :end-before: matter_template_nrf54l15_build_with_dfu_end + Factory data support ==================== @@ -139,6 +143,10 @@ Factory data support User interface ************** +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_0_3_0_interface_start + :end-before: matter_template_nrf54l15_0_3_0_interface_end + .. include:: ../lock/README.rst :start-after: matter_door_lock_sample_led1_start :end-before: matter_door_lock_sample_led1_end @@ -174,7 +182,7 @@ NFC port with antenna attached: Matter CLI commands =================== -If you build the application using the ``debug`` or ``no_dfu`` build type, you can use a series of commands to control the light switch device. +If you build the application using the ``debug`` build type, you can use a series of commands to control the light switch device. These commands can be sent to one device (unicast) or a group of devices (groupcast). Unicast commands @@ -254,7 +262,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the `Matter light switch build types`_. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Testing ******* diff --git a/samples/matter/light_switch/VERSION b/samples/matter/light_switch/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/light_switch/VERSION +++ b/samples/matter/light_switch/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/light_switch/boards/nrf21540dk_nrf52840.conf b/samples/matter/light_switch/boards/nrf21540dk_nrf52840.conf new file mode 100644 index 000000000000..c7479bbdab30 --- /dev/null +++ b/samples/matter/light_switch/boards/nrf21540dk_nrf52840.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Other settings +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_CHIP_LIB_SHELL=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# Disable Factory data feature since the board doesn't have external flash memory. +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1fd21a283a54 --- /dev/null +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,21 @@ +# +# 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 DFU and external flash will be supported on nRF54L. +CONFIG_CHIP_OTA_REQUESTOR=n +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..adf625db8106 --- /dev/null +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..ad5fd560f555 --- /dev/null +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,20 @@ +# +# 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 external flash will be supported on nRF54L. +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf deleted file mode 100644 index d3deb11a1040..000000000000 --- a/samples/matter/light_switch/child_image/hci_ipc/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_ipc.defaults to set options common for all -# samples using hci_ipc. This file should contain only options specific for this sample -# hci_ipc configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/light_switch/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/light_switch/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..da29968217bb --- /dev/null +++ b/samples/matter/light_switch/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/light_switch/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/light_switch/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index e69edb5a2c0e..000000000000 --- a/samples/matter/light_switch/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf52840dk_nrf52840.yml similarity index 100% rename from samples/matter/lock/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf52840dk_nrf52840.yml diff --git a/samples/matter/template/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf52840dk_nrf52840_release.yml similarity index 100% rename from samples/matter/template/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf52840dk_nrf52840_release.yml diff --git a/samples/matter/thermostat/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf5340dk_nrf5340_cpuapp.yml similarity index 100% rename from samples/matter/thermostat/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf5340dk_nrf5340_cpuapp.yml diff --git a/samples/matter/window_covering/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/window_covering/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml diff --git a/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml new file mode 100644 index 000000000000..a28d1effed5f --- /dev/null +++ b/samples/matter/light_switch/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml @@ -0,0 +1,51 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x7000 +mcuboot_pad: + address: 0x7000 + region: flash_primary + size: 0x800 +app: + address: 0x7800 + region: flash_primary + size: 0xb6000 +mcuboot_primary: + address: 0x7000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb6800 + span: *id001 +mcuboot_primary_app: + address: 0x7800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6000 + span: *id002 +mcuboot_secondary: + address: 0xbd800 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb6800 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbd800 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbe000 + size: 0xb6000 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 diff --git a/samples/matter/template/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf7002dk_nrf5340_cpuapp.yml similarity index 100% rename from samples/matter/template/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf7002dk_nrf5340_cpuapp.yml diff --git a/samples/matter/thermostat/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/light_switch/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml similarity index 100% rename from samples/matter/thermostat/configuration/nrf7002dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/light_switch/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml diff --git a/samples/matter/light_switch/prj_no_dfu.conf b/samples/matter/light_switch/prj_no_dfu.conf deleted file mode 100644 index 11185d18defb..000000000000 --- a/samples/matter/light_switch/prj_no_dfu.conf +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32772 == 0x8004 (example light-switch-app) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 -CONFIG_STD_CPP17=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterSwitch" - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/light_switch/sample.yaml b/samples/matter/light_switch/sample.yaml index 20a2bfa2a35b..ab4cd83c63de 100644 --- a/samples/matter/light_switch/sample.yaml +++ b/samples/matter/light_switch/sample.yaml @@ -6,23 +6,31 @@ tests: build_only: true extra_args: CONF_FILE=prj_release.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.light_switch.debug: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp # Sample to execute load tests sample.matter.light_switch.persistent_subscriptions: build_only: true extra_args: CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS=y - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp diff --git a/samples/matter/light_switch/sysbuild.cmake b/samples/matter/light_switch/sysbuild.cmake deleted file mode 100644 index 84bee0d6a511..000000000000 --- a/samples/matter/light_switch/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/light_switch/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/light_switch/sysbuild_no_dfu.conf b/samples/matter/light_switch/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/light_switch/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/matter/lock/CMakeLists.txt b/samples/matter/lock/CMakeLists.txt index 915ab17aea74..610947446e84 100644 --- a/samples/matter/lock/CMakeLists.txt +++ b/samples/matter/lock/CMakeLists.txt @@ -16,12 +16,6 @@ if(CONF_FILE) get_filename_component(CONF_FILE_NAME ${CONF_FILE} NAME CACHE) endif() -if(CONF_FILE_NAME STREQUAL "prj_thread_wifi_switched.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu_wifi_ext_patch.yml) -elseif(NOT CONF_FILE_NAME STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-lock) diff --git a/samples/matter/lock/Kconfig.sysbuild b/samples/matter/lock/Kconfig.sysbuild index 8f357bf3c11f..1c231a4c9225 100644 --- a/samples/matter/lock/Kconfig.sysbuild +++ b/samples/matter/lock/Kconfig.sysbuild @@ -5,16 +5,26 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOARD_NRF21540DK + +config BOOTLOADER_MCUBOOT + default n + +config BOOTLOADER_NONE + default y + +endif + +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/lock/README.rst b/samples/matter/lock/README.rst index 42a43d078fa3..4160e76dd0aa 100644 --- a/samples/matter/lock/README.rst +++ b/samples/matter/lock/README.rst @@ -43,9 +43,9 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, and ``nrf21540dk_nrf52840``. -* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk_nrf5340_cpuapp``. -* :ref:`Switching between Matter over Thread and Matter over Wi-Fi ` is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached, using the ``thread_wifi_switched`` build type. +* Matter over Thread is supported for ``nrf52840dk/nrf52840``, ``nrf5340dk/nrf5340/cpuapp``, and ``nrf21540dk/nrf52840``. +* Matter over Wi-Fi is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached (2.4 GHz and 5 GHz), for ``nrf7002dk/nrf5340/cpuapp`` (2.4 GHz and 5 GHz), or for ``nrf7002dk/nrf5340/cpuapp/nrf7001`` (2.4 GHz only). +* :ref:`Switching between Matter over Thread and Matter over Wi-Fi ` is supported for ``nrf5340dk/nrf5340/cpuapp`` with the ``nrf7002ek`` shield attached, using the ``thread_wifi_switched`` build type. Overview ******** @@ -113,7 +113,7 @@ For example: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -p -- -DSHIELD=nrf7002ek -Dmultiprotocol_rpmsg_SHIELD=nrf7002ek_coex -DCONF_FILE=prj_thread_wifi_switched.conf -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 + west build -b nrf5340dk/nrf5340/cpuapp -p -- -DSHIELD=nrf7002ek -Dmultiprotocol_rpmsg_SHIELD=nrf7002ek_coex -DCONF_FILE=prj_thread_wifi_switched.conf -DCONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y -Dmcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 .. _matter_lock_sample_ble_nus: @@ -159,7 +159,7 @@ The sample does not use a single :file:`prj.conf` file. Configuration files are provided for different build types, and they are located in the sample root directory. Before you start testing the application, you can select one of the build types supported by the application. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The sample supports the following build types: @@ -183,10 +183,6 @@ The sample supports the following build types: - :file:`prj_thread_wifi_switched.conf` - nRF5340 DK with the nRF7002 EK shield attached - Debug version of the application with the ability to :ref:`switch between Thread and Wi-Fi network support ` in the field. - * - No DFU - - :file:`prj_no_dfu.conf` - - nRF52840 DK, nRF5340 DK, nRF7002 DK, and nRF21540 DK - - Debug version of the application without Device Firmware Upgrade feature support. .. matter_door_lock_sample_configuration_file_types_end @@ -214,7 +210,6 @@ The DFU over Matter is enabled by default. The following configuration arguments are available during the build process for configuring DFU: * To configure the sample to support the DFU over Matter and SMP, use the ``-DCONFIG_CHIP_DFU_OVER_BT_SMP=y`` build flag. -* To configure the sample to disable the DFU and the secure bootloader, use the ``-DCONF_FILE=prj_no_dfu.conf`` build flag. See :ref:`cmake_options` for instructions on how to add these options to your build. @@ -229,7 +224,7 @@ For example: .. code-block:: console - west build -b nrf52840dk_nrf52840 -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y + west build -b nrf52840dk/nrf52840 -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y .. matter_door_lock_sample_build_with_dfu_end @@ -269,7 +264,7 @@ Factory data support .. matter_door_lock_sample_factory_data_start -In this sample, the factory data support is enabled by default for all build types except for the ``no_dfu`` build type. +In this sample, the factory data support is enabled by default for all build types except for the target board nRF21540 DK. This means that a new factory data set will be automatically generated when building for the target board. To disable factory data support, set the following Kconfig options to ``n``: @@ -312,13 +307,19 @@ LED 2: Button 1: Depending on how long you press the button: - * If the device is not provisioned to the Matter network, it initiates the SMP server (Simple Management Protocol) and Bluetooth LE advertising for Matter commissioning. - After that, the Direct Firmware Update (DFU) over Bluetooth Low Energy can be started. - (See `Upgrading the device firmware`_.) - Bluetooth LE advertising makes the device discoverable over Bluetooth LE for the predefined period of time (15 minutes by default). - * If the device is already provisioned to the Matter network it re-enables the SMP server. - After that, the DFU over Bluetooth Low Energy can be started. - (See `Upgrading the device firmware`_.) + * If pressed for less than three seconds: + + * If the device is not provisioned to the Matter network, it initiates the SMP server (Simple Management Protocol) and Bluetooth LE advertising for Matter commissioning. + After that, the Device Firmware Update (DFU) over Bluetooth Low Energy can be started. + (See `Upgrading the device firmware`_.) + Bluetooth LE advertising makes the device discoverable over Bluetooth LE for the predefined period of time (15 minutes by default). + + * If the device is already provisioned to the Matter network it re-enables the SMP server. + After that, the DFU over Bluetooth Low Energy can be started. + (See `Upgrading the device firmware`_.) + + * If pressed for more than three seconds, it initiates the factory reset of the device. + Releasing the button within a 3-second window of the initiation cancels the factory reset procedure. .. matter_door_lock_sample_button1_end @@ -352,7 +353,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the :ref:`matter_lock_sample_configuration_build_types`. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Testing ======= @@ -381,7 +382,7 @@ After building the sample and programming it to your development kit, complete t I: Lock Action has been initiated I: Lock Action has been completed -#. Press **Button 1** to initiate factory reset of the device. +#. Keep the **Button 1** pressed for more than six seconds to initiate factory reset of the device. The device reboots after all its settings are erased. @@ -473,7 +474,7 @@ To test this feature, complete the following steps: .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp -- -DCONF_FILE=prj_thread_wifi_switched.conf -DSHIELD=nrf7002ek -Dmultiprotocol_rpmsg_SHIELD=nrf7002ek_coex + west build -b nrf5340dk/nrf5340/cpuapp -- -DCONF_FILE=prj_thread_wifi_switched.conf -DSHIELD=nrf7002ek -Dmultiprotocol_rpmsg_SHIELD=nrf7002ek_coex #. |connect_terminal_ANSI| #. Program the application to the kit using the following command: @@ -504,11 +505,11 @@ To test the :ref:`matter_lock_sample_ble_nus` feature, complete the following st #. Install `nRF Toolbox`_ on your Android (Android 11 or newer) or iOS smartphone (iOS 16.1 or newer). #. Build the door lock application for Matter over Thread with the :kconfig:option:`CONFIG_CHIP_NUS` set to ``y``. - For example, if you build from command line for the ``nrf52840dk_nrf52840``, use the following command: + For example, if you build from command line for the ``nrf52840dk/nrf52840``, use the following command: .. code-block:: console - west build -b nrf52840dk_nrf52840 -- -DCONFIG_CHIP_NUS=y + west build -b nrf52840dk/nrf52840 -- -DCONFIG_CHIP_NUS=y #. Program the application to the kit using the following command: diff --git a/samples/matter/lock/VERSION b/samples/matter/lock/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/lock/VERSION +++ b/samples/matter/lock/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/lock/boards/nrf21540dk_nrf52840.conf b/samples/matter/lock/boards/nrf21540dk_nrf52840.conf new file mode 100644 index 000000000000..c7479bbdab30 --- /dev/null +++ b/samples/matter/lock/boards/nrf21540dk_nrf52840.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Other settings +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_CHIP_LIB_SHELL=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# Disable Factory data feature since the board doesn't have external flash memory. +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay b/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay new file mode 100644 index 000000000000..6247bf1b07c5 --- /dev/null +++ b/samples/matter/lock/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf deleted file mode 100644 index d3deb11a1040..000000000000 --- a/samples/matter/lock/child_image/hci_ipc/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_ipc.defaults to set options common for all -# samples using hci_ipc. This file should contain only options specific for this sample -# hci_ipc configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.conf b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.conf new file mode 100644 index 000000000000..2c12b8f3af6e --- /dev/null +++ b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_GPIO=y +CONFIG_SPI_NOR=n + +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y diff --git a/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay new file mode 100644 index 000000000000..69bf975735e5 --- /dev/null +++ b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; diff --git a/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.conf b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.conf new file mode 100644 index 000000000000..2c12b8f3af6e --- /dev/null +++ b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_GPIO=y +CONFIG_SPI_NOR=n + +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y diff --git a/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.overlay b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.overlay new file mode 100644 index 000000000000..69bf975735e5 --- /dev/null +++ b/samples/matter/lock/child_image/mcuboot/boards/nrf7002dk_nrf5340_cpuapp_nrf7001_release.overlay @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; +}; diff --git a/samples/matter/lock/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/lock/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index e69edb5a2c0e..000000000000 --- a/samples/matter/lock/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/thermostat/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/lock/pm_static_nrf52840dk_nrf52840.yml similarity index 100% rename from samples/matter/thermostat/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/lock/pm_static_nrf52840dk_nrf52840.yml diff --git a/samples/matter/window_covering/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml b/samples/matter/lock/pm_static_nrf52840dk_nrf52840_release.yml similarity index 100% rename from samples/matter/window_covering/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml rename to samples/matter/lock/pm_static_nrf52840dk_nrf52840_release.yml diff --git a/samples/matter/lock/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml b/samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp.yml similarity index 100% rename from samples/matter/lock/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml rename to samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp.yml diff --git a/samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml b/samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/lock/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu_wifi_ext_patch.yml b/samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp_thread_wifi_switched.yml similarity index 100% rename from samples/matter/lock/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu_wifi_ext_patch.yml rename to samples/matter/lock/pm_static_nrf5340dk_nrf5340_cpuapp_thread_wifi_switched.yml diff --git a/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp.yml b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001.yml b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001_release.yml b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001_release.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_nrf7001_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/lock/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/lock/prj_no_dfu.conf b/samples/matter/lock/prj_no_dfu.conf deleted file mode 100644 index 97cf2b8a619d..000000000000 --- a/samples/matter/lock/prj_no_dfu.conf +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This sample uses Kconfig.defaults to set options common for all -# samples. This file should contain only options specific for this sample -# or overrides of default values. - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32774 == 0x8006 (example lock-app) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 -CONFIG_STD_CPP17=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterLock" - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/lock/sample.yaml b/samples/matter/lock/sample.yaml index e6bc2070efbd..ef212a26c11f 100644 --- a/samples/matter/lock/sample.yaml +++ b/samples/matter/lock/sample.yaml @@ -6,38 +6,40 @@ tests: build_only: true extra_args: CONF_FILE=prj_release.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf7002dk/nrf5340/cpuapp/nrf7001 sample.matter.lock.smp_dfu: build_only: true extra_args: CONFIG_CHIP_DFU_OVER_BT_SMP=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf7002dk/nrf5340/cpuapp/nrf7001 sample.matter.lock.no_dfu.no_fd: build_only: true - extra_args: CONF_FILE=prj_no_dfu.conf CONFIG_CHIP_FACTORY_DATA=n - CONFIG_CHIP_FACTORY_DATA_BUILD=n integration_platforms: - - nrf21540dk_nrf52840 + - nrf21540dk/nrf52840 platform_allow: > - nrf52840dk_nrf52840 nrf21540dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp - sample.matter.lock.thread_wifi_switched: + nrf21540dk/nrf52840 + sample.matter.lock.thread_wifi_switched.smp_dfu: build_only: true extra_args: SHIELD=nrf7002ek multiprotocol_rpmsg_SHIELD=nrf7002ek_coex CONF_FILE=prj_thread_wifi_switched.conf CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_STORE=y - mcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 + mcuboot_CONFIG_UPDATEABLE_IMAGE_NUMBER=3 CONFIG_CHIP_DFU_OVER_BT_SMP=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp sample.matter.lock.nus: build_only: true extra_args: CONFIG_CHIP_NUS=y CONFIG_BT_FIXED_PASSKEY=y CONFIG_CHIP_NUS_FIXED_PASSKEY=112233 integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp diff --git a/samples/matter/lock/src/app_task.cpp b/samples/matter/lock/src/app_task.cpp index 71e3ad35b8e6..bc1b0b6ac44f 100644 --- a/samples/matter/lock/src/app_task.cpp +++ b/samples/matter/lock/src/app_task.cpp @@ -214,6 +214,16 @@ void AppTask::NUSUnlockCallback(void *context) } #endif +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS +CHIP_ERROR AppTask::DoorLockJammedEventCallback(Nrf::Matter::TestEventTrigger::TriggerValue) +{ + VerifyOrReturnError(DoorLockServer::Instance().SendLockAlarmEvent(kLockEndpointId, AlarmCodeEnum::kLockJammed), + CHIP_ERROR_INTERNAL); + LOG_ERR("Event Trigger: Doorlock jammed."); + return CHIP_NO_ERROR; +} +#endif + CHIP_ERROR AppTask::Init() { /* Initialize Matter stack */ @@ -261,6 +271,13 @@ CHIP_ERROR AppTask::Init() /* Initialize lock manager */ BoltLockMgr().Init(LockStateChanged); + /* Register Door Lock test event trigger */ +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + ReturnErrorOnFailure(Nrf::Matter::TestEventTrigger::Instance().RegisterTestEventTrigger( + kDoorLockJammedEventTriggerId, + Nrf::Matter::TestEventTrigger::EventTrigger{ 0, DoorLockJammedEventCallback })); +#endif + return Nrf::Matter::StartServer(); } diff --git a/samples/matter/lock/src/app_task.h b/samples/matter/lock/src/app_task.h index 43790057c2eb..2038eb781772 100644 --- a/samples/matter/lock/src/app_task.h +++ b/samples/matter/lock/src/app_task.h @@ -17,6 +17,10 @@ struct Identify; enum class SwitchButtonAction : uint8_t { Pressed, Released }; #endif +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS +#include "event_triggers/event_triggers.h" +#endif + class AppTask { public: static AppTask &Instance() @@ -48,4 +52,9 @@ class AppTask { static void NUSLockCallback(void *context); static void NUSUnlockCallback(void *context); #endif + +#ifdef CONFIG_NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS + constexpr static Nrf::Matter::TestEventTrigger::EventTriggerId kDoorLockJammedEventTriggerId = 0x3277'4000'0000'0000; + static CHIP_ERROR DoorLockJammedEventCallback(Nrf::Matter::TestEventTrigger::TriggerValue); +#endif }; diff --git a/samples/matter/lock/sysbuild.cmake b/samples/matter/lock/sysbuild.cmake deleted file mode 100644 index c9d984983632..000000000000 --- a/samples/matter/lock/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/lock/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/lock/sysbuild_no_dfu.conf b/samples/matter/lock/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/lock/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/matter/template/CMakeLists.txt b/samples/matter/template/CMakeLists.txt index 4d3e4d8441bf..b24f5f6d20fb 100644 --- a/samples/matter/template/CMakeLists.txt +++ b/samples/matter/template/CMakeLists.txt @@ -11,15 +11,6 @@ set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconn set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-template) diff --git a/samples/matter/template/Kconfig.sysbuild b/samples/matter/template/Kconfig.sysbuild index 8f357bf3c11f..523175dbdd9f 100644 --- a/samples/matter/template/Kconfig.sysbuild +++ b/samples/matter/template/Kconfig.sysbuild @@ -5,16 +5,26 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPp choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOARD_NRF21540DK + +config BOOTLOADER_MCUBOOT + default n + +config BOOTLOADER_NONE + default y + +endif + +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/template/README.rst b/samples/matter/template/README.rst index 19038d35b621..5d7c2f4c76f8 100644 --- a/samples/matter/template/README.rst +++ b/samples/matter/template/README.rst @@ -32,8 +32,8 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, and ``nrf21540dk_nrf52840``. -* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk_nrf5340_cpuapp``. +* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, ``nrf21540dk_nrf52840``, and ``nrf54l15pdk_nrf54l15``. +* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002ek`` shield attached or for ``nrf7002dk/nrf5340/cpuapp``. Overview ******** @@ -113,6 +113,38 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end +.. matter_template_nrf54l15_build_with_dfu_start + +The Device Firmware Upgrade (DFU) for the nRF54L15 PDK is exclusively available for the ``release`` build configuration and is limited to using the internal MRAM for storage. +This means that both the currently running firmware and the new firmware to be updated must be stored within the device's internal flash memory. +Currently, there is no support for utilizing external flash memory for this purpose. + +To build the sample with DFU support, use the ``-DCONF_FILE=prj_release.conf`` flag in your CMake build command. + +The following is an example command to build the sample with support for OTA DFU only: + +.. code-block:: console + + west build -b nrf54l15pdk_nrf54l15_cpuapp -- -DCONF_FILE=prj_release.conf + +If you want to build the sample with support for both OTA DFU and SMP DFU, use the following command: + +.. code-block:: console + + west build -b nrf54l15pdk_nrf54l15_cpuapp -- -DCONF_FILE=prj_release.conf -DCONFIG_CHIP_DFU_OVER_BT_SMP=y + +You can disable DFU support for the ``release`` build configuration to double available application memory space. +Do this by setting the :kconfig:option:`CONFIG_CHIP_DFU_OVER_BT_SMP` and :kconfig:option:`CONFIG_CHIP_OTA_REQUESTOR` Kconfig options to ``n``, and removing the :file:`pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml` file. + +For example: + +.. code-block:: console + + west build -b nrf54l15pdk_nrf54l15_cpuapp -- -DCONF_FILE=prj_release.conf -DCONFIG_CHIP_DFU_OVER_BT_SMP=n -DCONFIG_CHIP_OTA_REQUESTOR=n + + +.. matter_template_nrf54l15_build_with_dfu_end + FEM support =========== @@ -128,6 +160,18 @@ Factory data support User interface ************** +.. matter_template_nrf54l15_0_3_0_interface_start + +.. note:: + + The nRF54L15 PDK revision v0.3.0 uses a different numbering system for buttons and LEDs compared to previous boards. + All numbers start from 0 instead of 1, as was the case previously. + This means that **LED1** in this documentation refers to **LED0** on the nRF54L15 PDK board, **LED2** refers to **LED1**, **Button 1** refers to **Button 0**, and so on. + + For the nRF54L15 PDK revision v0.2.1, the numbering of buttons and LEDs is the same as on the nRF52840 DK and nRF5340 DK boards. + +.. matter_template_nrf54l15_0_3_0_interface_end + .. include:: ../lock/README.rst :start-after: matter_door_lock_sample_led1_start :end-before: matter_door_lock_sample_led1_end @@ -151,7 +195,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the `Matter template build types`_. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Testing ======= @@ -181,7 +225,7 @@ To test the sample in a Matter-enabled Thread network, complete the following st At the end of this procedure, **LED 1** of the Matter device programmed with the sample starts flashing in the Short Flash Off state. This indicates that the device is fully provisioned, but does not yet have full IPv6 network connectivity. -#. Press **Button 1** for six seconds to initiate the factory reset of the device. +#. Keep the **Button 1** pressed for more than six seconds to initiate factory reset of the device. The device reboots after all its settings are erased. diff --git a/samples/matter/template/VERSION b/samples/matter/template/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/template/VERSION +++ b/samples/matter/template/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/template/boards/nrf21540dk_nrf52840.conf b/samples/matter/template/boards/nrf21540dk_nrf52840.conf new file mode 100644 index 000000000000..c7479bbdab30 --- /dev/null +++ b/samples/matter/template/boards/nrf21540dk_nrf52840.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Other settings +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_CHIP_LIB_SHELL=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# Disable Factory data feature since the board doesn't have external flash memory. +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1fd21a283a54 --- /dev/null +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,21 @@ +# +# 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 DFU and external flash will be supported on nRF54L. +CONFIG_CHIP_OTA_REQUESTOR=n +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..adf625db8106 --- /dev/null +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..ad5fd560f555 --- /dev/null +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,20 @@ +# +# 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 external flash will be supported on nRF54L. +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf deleted file mode 100644 index d3deb11a1040..000000000000 --- a/samples/matter/template/child_image/hci_ipc/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_ipc.defaults to set options common for all -# samples using hci_ipc. This file should contain only options specific for this sample -# hci_ipc configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/template/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..da29968217bb --- /dev/null +++ b/samples/matter/template/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/template/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/template/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index e69edb5a2c0e..000000000000 --- a/samples/matter/template/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/template/pm_static_nrf52840dk_nrf52840.yml b/samples/matter/template/pm_static_nrf52840dk_nrf52840.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/template/pm_static_nrf52840dk_nrf52840.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/template/pm_static_nrf52840dk_nrf52840_release.yml b/samples/matter/template/pm_static_nrf52840dk_nrf52840_release.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/template/pm_static_nrf52840dk_nrf52840_release.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp.yml b/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml b/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/template/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml new file mode 100644 index 000000000000..a28d1effed5f --- /dev/null +++ b/samples/matter/template/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml @@ -0,0 +1,51 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x7000 +mcuboot_pad: + address: 0x7000 + region: flash_primary + size: 0x800 +app: + address: 0x7800 + region: flash_primary + size: 0xb6000 +mcuboot_primary: + address: 0x7000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb6800 + span: *id001 +mcuboot_primary_app: + address: 0x7800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6000 + span: *id002 +mcuboot_secondary: + address: 0xbd800 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb6800 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbd800 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbe000 + size: 0xb6000 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 diff --git a/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp.yml b/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml b/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/template/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/template/prj_no_dfu.conf b/samples/matter/template/prj_no_dfu.conf deleted file mode 100644 index 309a0c1da4a2..000000000000 --- a/samples/matter/template/prj_no_dfu.conf +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This sample uses Kconfig.defaults to set options common for all -# samples. This file should contain only options specific for this sample -# or overrides of default values. - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32768 == 0x8000 (example Product ID added temporaly, -# but it must be changed with proper PID from the list: -# https://github.com/project-chip/connectedhomeip/blob/482e6fd03196a6de45465a90003947ef4b86e0b1/docs/examples/discussion/PID_allocation_for_example_apps.md) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32768 -CONFIG_STD_CPP17=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterTemplate" - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable NFC commissioning -CONFIG_CHIP_NFC_COMMISSIONING=n - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/template/sample.yaml b/samples/matter/template/sample.yaml index 57b9ea350f96..c8ba66e96276 100644 --- a/samples/matter/template/sample.yaml +++ b/samples/matter/template/sample.yaml @@ -6,33 +6,41 @@ tests: build_only: true extra_args: CONFIG_NCS_SAMPLE_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.template.release: build_only: true extra_args: CONF_FILE=prj_release.conf CONFIG_NCS_SAMPLE_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.template.smp_dfu: build_only: true extra_args: CONFIG_CHIP_DFU_OVER_BT_SMP=y CONFIG_NCS_SAMPLE_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp sample.matter.template.mgrt_dac: build_only: true extra_args: CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp diff --git a/samples/matter/template/sysbuild.cmake b/samples/matter/template/sysbuild.cmake deleted file mode 100644 index 6b357a726981..000000000000 --- a/samples/matter/template/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/template/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/template/sysbuild_no_dfu.conf b/samples/matter/template/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/template/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/matter/thermostat/CMakeLists.txt b/samples/matter/thermostat/CMakeLists.txt index 2600047553f5..32b6049f79b8 100644 --- a/samples/matter/thermostat/CMakeLists.txt +++ b/samples/matter/thermostat/CMakeLists.txt @@ -11,15 +11,6 @@ set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconn set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") set(hci_ipc_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_ipc.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT CONFIG_FILE_NAME STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-template) diff --git a/samples/matter/thermostat/Kconfig.sysbuild b/samples/matter/thermostat/Kconfig.sysbuild index 8f357bf3c11f..54acc99df3eb 100644 --- a/samples/matter/thermostat/Kconfig.sysbuild +++ b/samples/matter/thermostat/Kconfig.sysbuild @@ -5,16 +5,16 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/thermostat/README.rst b/samples/matter/thermostat/README.rst index dc46e88b1861..bc7202d7f7f6 100644 --- a/samples/matter/thermostat/README.rst +++ b/samples/matter/thermostat/README.rst @@ -35,8 +35,8 @@ IPv6 network support The development kits for this sample offer the following IPv6 network support for Matter: -* Matter over Thread is supported for ``nrf52840dk_nrf52840`` and ``nrf5340dk_nrf5340_cpuapp``. -* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002_ek`` shield attached or for ``nrf7002dk_nrf5340_cpuapp``. +* Matter over Thread is supported for ``nrf52840dk_nrf52840``, ``nrf5340dk_nrf5340_cpuapp``, and ``nrf54l15pdk_nrf54l15``. +* Matter over Wi-Fi is supported for ``nrf5340dk_nrf5340_cpuapp`` with the ``nrf7002_ek`` shield attached or for ``nrf7002dk/nrf5340/cpuapp``. Overview ******** @@ -110,7 +110,7 @@ The sample does not use a single :file:`prj.conf` file. Configuration files are provided for different build types, and they are located in the sample root directory. Before you start testing the application, you can select one of the build types supported by the application. -See :ref:`app_build_additions_build_types` and :ref:`modifying_build_types` for more information about this feature of the |NCS|. +See :ref:`app_build_additions_build_types` and :ref:`cmake_options` for more information. The sample supports the following build types: @@ -130,10 +130,6 @@ The sample supports the following build types: - :file:`prj_release.conf` - All from `Requirements`_ - Release version of the application; can be used to enable only the necessary application functionalities to optimize its performance. - * - No DFU - - :file:`prj_no_dfu.conf` - - nRF52840 DK, nRF5340 DK, and nRF7002 DK - - Debug version of the application without Device Firmware Upgrade feature support. Device Firmware Upgrade support =============================== @@ -142,6 +138,10 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_build_with_dfu_start + :end-before: matter_template_nrf54l15_build_with_dfu_end + .. _matter_thermostat_network_mode: Remote testing in a network @@ -161,6 +161,10 @@ Factory data support User interface ************** +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_0_3_0_interface_start + :end-before: matter_template_nrf54l15_0_3_0_interface_end + .. include:: ../lock/README.rst :start-after: matter_door_lock_sample_led1_start :end-before: matter_door_lock_sample_led1_end @@ -190,7 +194,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the `Matter thermostat build types`_, depending on your building method. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. .. _matter_thermostat_testing: @@ -213,7 +217,7 @@ After building the sample and programming it to your development kit, complete t #. Observe the UART terminal. The sample starts automatically printing the simulated temperature data to the terminal with 30-second intervals. #. Press **Button 2** to print the most recent temperature data to the terminal. -#. Press **Button 1** for six seconds to initiate the factory reset of the device. +#. Keep the **Button 1** pressed for more than six seconds to initiate factory reset of the device. The device reboots after all its settings are erased. diff --git a/samples/matter/thermostat/VERSION b/samples/matter/thermostat/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/thermostat/VERSION +++ b/samples/matter/thermostat/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1fd21a283a54 --- /dev/null +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,21 @@ +# +# 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 DFU and external flash will be supported on nRF54L. +CONFIG_CHIP_OTA_REQUESTOR=n +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..adf625db8106 --- /dev/null +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..ad5fd560f555 --- /dev/null +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,20 @@ +# +# 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 external flash will be supported on nRF54L. +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf b/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf deleted file mode 100644 index f01d35078743..000000000000 --- a/samples/matter/thermostat/child_image/hci_ipc/prj_no_dfu.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.hci_ipc.defaults to set options common for all -# samples using hci_ipc. This file should contain only options specific for this sample -# hci_ipc configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.hci_ipc.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/thermostat/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..da29968217bb --- /dev/null +++ b/samples/matter/thermostat/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/thermostat/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/thermostat/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index 0c2b74848d9b..000000000000 --- a/samples/matter/thermostat/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n diff --git a/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840.yml b/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840_release.yml b/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840_release.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf52840dk_nrf52840_release.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp.yml b/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml b/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml new file mode 100644 index 000000000000..a28d1effed5f --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml @@ -0,0 +1,51 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x7000 +mcuboot_pad: + address: 0x7000 + region: flash_primary + size: 0x800 +app: + address: 0x7800 + region: flash_primary + size: 0xb6000 +mcuboot_primary: + address: 0x7000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb6800 + span: *id001 +mcuboot_primary_app: + address: 0x7800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6000 + span: *id002 +mcuboot_secondary: + address: 0xbd800 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb6800 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbd800 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbe000 + size: 0xb6000 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 diff --git a/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp.yml b/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml b/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..ee56be2f4be4 --- /dev/null +++ b/samples/matter/thermostat/pm_static_nrf7002dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0xC000 + region: flash_primary +mcuboot_pad: + address: 0xC000 + size: 0x200 +app: + address: 0xC200 + size: 0xeae00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0xC000 + size: 0xeb000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0xC200 + size: 0xeae00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xeb000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xeb000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12b000 + size: 0x6D5000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/thermostat/prj_no_dfu.conf b/samples/matter/thermostat/prj_no_dfu.conf deleted file mode 100644 index c5da269f913e..000000000000 --- a/samples/matter/thermostat/prj_no_dfu.conf +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This sample uses Kconfig.defaults to set options common for all -# samples. This file should contain only options specific for this sample -# or overrides of default values. - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32782 == 0x800e (example thermostat product) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32782 -CONFIG_STD_CPP17=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterThermo" - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable NFC commissioning -CONFIG_CHIP_NFC_COMMISSIONING=n - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/thermostat/sample.yaml b/samples/matter/thermostat/sample.yaml index 9d4f0bf438ce..f435aa7ee6aa 100644 --- a/samples/matter/thermostat/sample.yaml +++ b/samples/matter/thermostat/sample.yaml @@ -5,15 +5,21 @@ tests: sample.matter.thermostat.debug: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.thermostat.release: build_only: true extra_args: CONF_FILE=prj_release.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp diff --git a/samples/matter/thermostat/src/thermostat.zap b/samples/matter/thermostat/src/thermostat.zap index 48b14abe5c67..927ee6ef3944 100644 --- a/samples/matter/thermostat/src/thermostat.zap +++ b/samples/matter/thermostat/src/thermostat.zap @@ -17,14 +17,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../../../../../zap/zap-linux-x64/resources/app.asar/zcl-builtin/silabs/zcl.json", - "type": "zcl-properties", - "category": "zigbee", - "version": 1, - "description": "ZigbeePro test data" - }, { "pathRelativity": "relativeToZap", "path": "../../../../../modules/lib/matter/src/app/zap-templates/app-templates.json", @@ -86,7 +78,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -102,7 +94,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -118,7 +110,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -134,7 +126,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -150,7 +142,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -166,7 +158,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -182,7 +174,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -214,7 +206,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -240,7 +232,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -256,7 +248,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -272,7 +264,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "4", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -288,7 +280,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -304,7 +296,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -320,7 +312,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -336,7 +328,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -352,7 +344,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -384,7 +376,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -410,7 +402,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "10", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -426,7 +418,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -442,7 +434,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -458,7 +450,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -474,7 +466,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -506,7 +498,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "XX", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -522,7 +514,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -538,7 +530,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -554,7 +546,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -570,7 +562,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -586,7 +578,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "20210614123456ZZ", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -602,7 +594,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -618,7 +610,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -634,7 +626,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -650,7 +642,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -666,7 +658,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -682,7 +674,7 @@ "storageOption": "External", "singleton": 1, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -857,7 +849,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -921,7 +913,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -937,7 +929,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -953,7 +945,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1100,7 +1092,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1116,7 +1108,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1132,7 +1124,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1148,7 +1140,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1164,7 +1156,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1180,7 +1172,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1196,7 +1188,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1344,7 +1336,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1456,7 +1448,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1472,7 +1464,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1488,7 +1480,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1556,7 +1548,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1572,7 +1564,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1588,7 +1580,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1604,7 +1596,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1620,7 +1612,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1652,7 +1644,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1668,7 +1660,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1684,7 +1676,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1742,7 +1734,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1758,7 +1750,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1774,7 +1766,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1790,7 +1782,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1806,7 +1798,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1822,7 +1814,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -1874,7 +1866,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1890,7 +1882,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1906,7 +1898,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1922,7 +1914,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1938,7 +1930,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1954,7 +1946,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1970,7 +1962,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -1986,7 +1978,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2002,7 +1994,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2018,7 +2010,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2034,7 +2026,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2050,7 +2042,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2066,7 +2058,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2082,7 +2074,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2098,7 +2090,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2114,7 +2106,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2130,7 +2122,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2146,7 +2138,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2162,7 +2154,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2178,7 +2170,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2194,7 +2186,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2210,7 +2202,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2226,7 +2218,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2242,7 +2234,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2258,7 +2250,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2274,7 +2266,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2290,7 +2282,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2306,7 +2298,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2322,7 +2314,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2338,7 +2330,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2354,7 +2346,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2370,7 +2362,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2386,7 +2378,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2402,7 +2394,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2418,7 +2410,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2434,7 +2426,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2450,7 +2442,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2466,7 +2458,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2482,7 +2474,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2498,7 +2490,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2514,7 +2506,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2530,7 +2522,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2546,7 +2538,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2562,7 +2554,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2578,7 +2570,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2594,7 +2586,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2610,7 +2602,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2626,7 +2618,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2642,7 +2634,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2658,7 +2650,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2674,7 +2666,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2690,7 +2682,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2706,7 +2698,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2722,7 +2714,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2738,7 +2730,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2754,7 +2746,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2770,7 +2762,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2786,7 +2778,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000000000000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2802,7 +2794,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2818,7 +2810,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2834,7 +2826,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2850,7 +2842,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2866,7 +2858,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2882,7 +2874,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2898,7 +2890,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2914,7 +2906,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2972,7 +2964,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2988,7 +2980,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3004,7 +2996,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3020,7 +3012,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3036,7 +3028,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3052,7 +3044,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3068,7 +3060,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3084,7 +3076,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3100,7 +3092,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3116,7 +3108,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x00000000", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3132,7 +3124,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3148,7 +3140,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3164,7 +3156,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3248,7 +3240,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3264,7 +3256,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3280,7 +3272,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3296,7 +3288,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3312,7 +3304,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3328,7 +3320,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3484,7 +3476,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3500,7 +3492,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3516,7 +3508,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3532,7 +3524,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3548,7 +3540,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -3564,7 +3556,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3580,7 +3572,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3596,7 +3588,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3612,7 +3604,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3720,7 +3712,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3736,7 +3728,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3752,7 +3744,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3768,7 +3760,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3784,7 +3776,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3800,7 +3792,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3816,7 +3808,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3832,7 +3824,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3848,7 +3840,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -3987,7 +3979,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4003,7 +3995,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4019,7 +4011,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4175,7 +4167,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4191,7 +4183,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4207,7 +4199,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4223,7 +4215,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4281,7 +4273,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4297,7 +4289,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4313,7 +4305,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4329,7 +4321,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4345,7 +4337,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4361,7 +4353,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4377,7 +4369,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4409,7 +4401,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4435,7 +4427,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4451,7 +4443,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4467,7 +4459,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4483,7 +4475,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4499,7 +4491,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4749,6 +4741,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "MinSetpointDeadBand", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "25", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ControlSequenceOfOperation", "code": 27, @@ -4791,7 +4799,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4807,7 +4815,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4823,7 +4831,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4839,7 +4847,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x3", + "defaultValue": "0x23", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4923,6 +4931,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/samples/matter/thermostat/src/zap-generated/access.h b/samples/matter/thermostat/src/zap-generated/access.h index e28ef8fcbd0c..7a5dbf174acc 100644 --- a/samples/matter/thermostat/src/zap-generated/access.h +++ b/samples/matter/thermostat/src/zap-generated/access.h @@ -49,6 +49,7 @@ /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: view */ \ + /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: view */ \ /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: view */ \ /* Cluster: Thermostat, Attribute: SystemMode, Privilege: view */ \ } @@ -75,6 +76,7 @@ /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: view */ \ + /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: view */ \ /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: view */ \ /* Cluster: Thermostat, Attribute: SystemMode, Privilege: view */ \ } @@ -101,6 +103,7 @@ /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: view */ \ /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: view */ \ + /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: view */ \ /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: view */ \ /* Cluster: Thermostat, Attribute: SystemMode, Privilege: view */ \ } @@ -121,6 +124,7 @@ 0x00000201, /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: manage */ \ + 0x00000201, /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Attribute: SystemMode, Privilege: manage */ \ } @@ -139,6 +143,7 @@ 0x00000016, /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: manage */ \ 0x00000017, /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: manage */ \ 0x00000018, /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: manage */ \ + 0x00000019, /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: manage */ \ 0x0000001B, /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: manage */ \ 0x0000001C, /* Cluster: Thermostat, Attribute: SystemMode, Privilege: manage */ \ } @@ -157,6 +162,7 @@ kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: MaxHeatSetpointLimit, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: MinCoolSetpointLimit, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: MaxCoolSetpointLimit, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: MinSetpointDeadBand, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: ControlSequenceOfOperation, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Thermostat, Attribute: SystemMode, Privilege: manage */ \ } diff --git a/samples/matter/thermostat/src/zap-generated/endpoint_config.h b/samples/matter/thermostat/src/zap-generated/endpoint_config.h index 96b955bfc6d8..0a80d871b9a7 100644 --- a/samples/matter/thermostat/src/zap-generated/endpoint_config.h +++ b/samples/matter/thermostat/src/zap-generated/endpoint_config.h @@ -49,7 +49,7 @@ #define GENERATED_DEFAULTS_COUNT (1) // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 8 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 9 #define GENERATED_MIN_MAX_DEFAULTS \ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -59,6 +59,7 @@ { (uint16_t)0xBB8, (uint16_t)-0x6AB3, (uint16_t)0x7FFF }, /* MaxHeatSetpointLimit */ \ { (uint16_t)0x640, (uint16_t)-0x6AB3, (uint16_t)0x7FFF }, /* MinCoolSetpointLimit */ \ { (uint16_t)0xC80, (uint16_t)-0x6AB3, (uint16_t)0x7FFF }, /* MaxCoolSetpointLimit */ \ + { (uint16_t)0x19, (uint16_t)0x0, (uint16_t)0x19 }, /* MinSetpointDeadBand */ \ { (uint16_t)0x4, (uint16_t)0x0, (uint16_t)0x5 }, /* ControlSequenceOfOperation */ \ { \ (uint16_t)0x1, (uint16_t)0x0, (uint16_t)0x7 \ @@ -66,7 +67,7 @@ } // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 193 +#define GENERATED_ATTRIBUTE_COUNT 194 #define GENERATED_ATTRIBUTES \ { \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ @@ -472,12 +473,14 @@ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ { ZAP_MIN_MAX_DEFAULTS_INDEX(5), 0x00000018, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x00000019, 1, ZAP_TYPE(INT8S), \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlSequenceOfOperation \ */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SystemMode */ \ - { ZAP_SIMPLE_DEFAULT(0x3), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(0x23), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ } @@ -867,8 +870,8 @@ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ .attributes = ZAP_ATTRIBUTE_INDEX(177), \ - .attributeCount = 16, \ - .clusterSize = 32, \ + .attributeCount = 17, \ + .clusterSize = 33, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ), \ @@ -879,7 +882,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(193), \ + .attributes = ZAP_ATTRIBUTE_INDEX(194), \ .attributeCount = 0, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(CLIENT), \ @@ -898,7 +901,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 14, 104 }, { ZAP_CLUSTER_INDEX(14), 7, 58 }, \ + { ZAP_CLUSTER_INDEX(0), 14, 104 }, { ZAP_CLUSTER_INDEX(14), 7, 59 }, \ } // Largest attribute size is needed for various buffers @@ -911,7 +914,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (35) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (162) +#define ATTRIBUTE_MAX_SIZE (163) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/samples/matter/thermostat/sysbuild.cmake b/samples/matter/thermostat/sysbuild.cmake deleted file mode 100644 index ccfe9e7cae78..000000000000 --- a/samples/matter/thermostat/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/thermostat/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/thermostat/sysbuild_no_dfu.conf b/samples/matter/thermostat/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/thermostat/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/matter/window_covering/CMakeLists.txt b/samples/matter/window_covering/CMakeLists.txt index 3b1688d39703..92d71bcac90a 100644 --- a/samples/matter/window_covering/CMakeLists.txt +++ b/samples/matter/window_covering/CMakeLists.txt @@ -10,15 +10,6 @@ cmake_minimum_required(VERSION 3.20.0) set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") -# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) -endif() - find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(matter-window-app) diff --git a/samples/matter/window_covering/Kconfig.sysbuild b/samples/matter/window_covering/Kconfig.sysbuild index 8f357bf3c11f..1c231a4c9225 100644 --- a/samples/matter/window_covering/Kconfig.sysbuild +++ b/samples/matter/window_covering/Kconfig.sysbuild @@ -5,16 +5,26 @@ # config NRF_DEFAULT_MULTIPROTOCOL - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp") + default y if BOARD_NRF5340DK_NRF5340_CPUAPP config NRF_DEFAULT_BLUETOOTH - default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default y if BOARD_NRF7002DK_NRF5340_CPUAPP choice BOOTLOADER default BOOTLOADER_MCUBOOT endchoice -if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")) +if BOARD_NRF21540DK + +config BOOTLOADER_MCUBOOT + default n + +config BOOTLOADER_NONE + default y + +endif + +if BOOTLOADER_MCUBOOT && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) config MCUBOOT_UPDATEABLE_IMAGES default 2 diff --git a/samples/matter/window_covering/README.rst b/samples/matter/window_covering/README.rst index 77b79f0e3030..5be38a33b1fb 100644 --- a/samples/matter/window_covering/README.rst +++ b/samples/matter/window_covering/README.rst @@ -98,6 +98,10 @@ Device Firmware Upgrade support :start-after: matter_door_lock_sample_build_with_dfu_start :end-before: matter_door_lock_sample_build_with_dfu_end +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_build_with_dfu_start + :end-before: matter_template_nrf54l15_build_with_dfu_end + FEM support =========== @@ -113,18 +117,29 @@ Factory data support User interface ************** +.. include:: ../template/README.rst + :start-after: matter_template_nrf54l15_0_3_0_interface_start + :end-before: matter_template_nrf54l15_0_3_0_interface_end + .. include:: ../lock/README.rst :start-after: matter_door_lock_sample_led1_start :end-before: matter_door_lock_sample_led1_end -LED 2: +LED 2 Indicates the lift position of the window cover, which is represented by the brightness of the LED. The brightness level ranges from ``0`` to ``255``, where the brightness level set to ``0`` (switched off LED) indicates a fully opened window cover (lifted) and the brightness level set to ``255`` indicates a fully closed window cover (lowered). Additionally, the LED starts blinking evenly (500 ms on/500 ms off) when the Identify command of the Identify cluster is received on the endpoint ``1``. The command's argument can be used to specify the duration of the effect. -LED 3: +LED 3 (nRF52840 DK and nRF5340 DK) + Indicates the tilt position of the window cover, which is represented by the brightness of the LED. + The brightness level ranges from ``0`` to ``255``, where the brightness level set to ``0`` (switched off LED) indicates a fully opened window cover (tilted to a horizontal position) and the brightness level set to ``255`` indicates a fully closed window cover (tilted to a vertical position). + +LED 4 (nRF54L15 PDK) + .. note:: + This is **LED 3** on the board revision v0.3.0. + Indicates the tilt position of the window cover, which is represented by the brightness of the LED. The brightness level ranges from ``0`` to ``255``, where the brightness level set to ``0`` (switched off LED) indicates a fully opened window cover (tilted to a horizontal position) and the brightness level set to ``255`` indicates a fully closed window cover (tilted to a vertical position). @@ -168,7 +183,7 @@ Selecting a build type ====================== Before you start testing the application, you can select one of the `Matter window covering build types`_. -See :ref:`modifying_build_types` for detailed steps how to select a build type. +See :ref:`cmake_options` for information about how to select a build type. Testing ======= @@ -188,7 +203,7 @@ After building the sample and programming it to your development kit, complete t **LED 3** light up and its brightness increases with each button press until it reaches full brightness. #. Press **Button 2** 20 times to fully tilt the cover into the open position. The brightness of **LED 3** decreases with each button press until the LED turns off. -#. Press **Button 1** to initiate the factory reset of the device. +#. Keep the **Button 1** pressed for more than six seconds to initiate factory reset of the device. The device reboots after all its settings are erased. diff --git a/samples/matter/window_covering/VERSION b/samples/matter/window_covering/VERSION index 8cb838926497..808984a04c51 100644 --- a/samples/matter/window_covering/VERSION +++ b/samples/matter/window_covering/VERSION @@ -1,5 +1,5 @@ VERSION_MAJOR = 2 VERSION_MINOR = 6 -PATCHLEVEL = 0 +PATCHLEVEL = 99 VERSION_TWEAK = 0 EXTRAVERSION = diff --git a/samples/matter/window_covering/boards/nrf21540dk_nrf52840.conf b/samples/matter/window_covering/boards/nrf21540dk_nrf52840.conf new file mode 100644 index 000000000000..c7479bbdab30 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf21540dk_nrf52840.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Other settings +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_CHIP_LIB_SHELL=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# Disable Factory data feature since the board doesn't have external flash memory. +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..1fd21a283a54 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,21 @@ +# +# 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 DFU and external flash will be supported on nRF54L. +CONFIG_CHIP_OTA_REQUESTOR=n +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay new file mode 100644 index 000000000000..cd0b6b67f701 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + + // Configure PWM module for led1 (LED2 on the board) + pwm-led1 = &pwm_led1; + pwm-led2 = &pwm_led2; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_led1: pwm_led_1 { + pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm20 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm_default>; + pinctrl-1 = <&pwm_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pinctrl { + pwm_default: pwm_default { + group1 { + psels = , ; + }; + }; + pwm_sleep: pwm_sleep { + group1 { + psels = , ; + low-power-enable; + }; + }; +}; diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay new file mode 100644 index 000000000000..a41c6db21880 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_0_3_0.overlay @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,console = &uart30; + zephyr,shell-uart = &uart30; + }; + + aliases { + factory-data = &factory_data; + factory-data-memory-region = &rram0; + + // Configure PWM module for led1 (LED2 on the board) + pwm-led1 = &pwm_led1; + pwm-led2 = &pwm_led2; + }; + + pwmleds { + compatible = "pwm-leds"; + pwm_led1: pwm_led_1 { + pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm20 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; +}; + +/delete-node/ &rram0; + +&rram_controller { + reg = < 0x5004b000 0x17d000 >; + + rram0: rram@0 { + compatible = "soc-nv-flash"; + erase-block-size = < 0x1000 >; + write-block-size = < 0x10 >; + reg = < 0x0 0x17d000 >; + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + slot0_partition: partition@0 { + label = "image-0"; + reg = < 0x0 0x174000 >; + }; + factory_data: partition@174000 { + label = "factory-data"; + reg = < 0x174000 0x1000 >; + }; + storage_partition: partition@175000 { + label = "storage"; + reg = < 0x175000 0x8000 >; + }; + }; + }; +}; + +&uart30 { + status = "okay"; +}; + +&pwm20 { + status = "okay"; + pinctrl-0 = <&pwm_default>; + pinctrl-1 = <&pwm_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&pinctrl { + pwm_default: pwm_default { + group1 { + psels = , ; + }; + }; + pwm_sleep: pwm_sleep { + group1 { + psels = , ; + low-power-enable; + }; + }; +}; diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..ad5fd560f555 --- /dev/null +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,20 @@ +# +# 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 external flash will be supported on nRF54L. +CONFIG_CHIP_QSPI_NOR=n + +CONFIG_FPU=n +CONFIG_PM=n +CONFIG_HWINFO_NRF=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n + +# TODO: Workaround to be removed once Zephyr's CONFIG_FPROTECT is supported on nRF54L +CONFIG_CHIP_FACTORY_DATA_WRITE_PROTECT=n diff --git a/samples/matter/window_covering/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf b/samples/matter/window_covering/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf new file mode 100644 index 000000000000..d2992aa2d8a1 --- /dev/null +++ b/samples/matter/window_covering/child_image/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp_release.conf @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# TODO: Workaround Fprotect is not supported on nRF54l15 yet. +CONFIG_FPROTECT=n +# TODO: Workaround, disable memory guard to avoid false faults in application after boot +CONFIG_HW_STACK_PROTECTION=n + +CONFIG_SPI_NOR=n +CONFIG_BOOT_WATCHDOG_FEED=n diff --git a/samples/matter/window_covering/child_image/multiprotocol_rpmsg/prj_no_dfu.conf b/samples/matter/window_covering/child_image/multiprotocol_rpmsg/prj_no_dfu.conf deleted file mode 100644 index e69edb5a2c0e..000000000000 --- a/samples/matter/window_covering/child_image/multiprotocol_rpmsg/prj_no_dfu.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all -# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample -# multiprotocol_rpmsg configuration or overrides of default values. - -# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding -# in board files. - -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840.yml b/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840_release.yml b/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840_release.yml new file mode 100644 index 000000000000..9c4aa3cdcac6 --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf52840dk_nrf52840_release.yml @@ -0,0 +1,42 @@ +mcuboot: + address: 0x0 + size: 0x7000 + region: flash_primary +mcuboot_pad: + address: 0x7000 + size: 0x200 +app: + address: 0x7200 + size: 0xefe00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x7000 + size: 0xf0000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x7200 + size: 0xefe00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_secondary: + address: 0x0 + size: 0xf0000 + device: MX25R64 + region: external_flash +external_flash: + address: 0xf0000 + size: 0x710000 + device: MX25R64 + region: external_flash diff --git a/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp.yml b/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml b/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml new file mode 100644 index 000000000000..3b0873d5ab3c --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf5340dk_nrf5340_cpuapp_release.yml @@ -0,0 +1,56 @@ +mcuboot: + address: 0x0 + size: 0x8000 + region: flash_primary +mcuboot_pad: + address: 0x8000 + size: 0x200 +app: + address: 0x8200 + size: 0xeee00 +mcuboot_primary: + orig_span: &id001 + - mcuboot_pad + - app + span: *id001 + address: 0x8000 + size: 0xef000 + region: flash_primary +mcuboot_primary_app: + orig_span: &id002 + - app + span: *id002 + address: 0x8200 + size: 0xeee00 +factory_data: + address: 0xf7000 + size: 0x1000 + region: flash_primary +settings_storage: + address: 0xf8000 + size: 0x8000 + region: flash_primary +mcuboot_primary_1: + address: 0x0 + size: 0x40000 + device: flash_ctrl + region: ram_flash +mcuboot_secondary: + address: 0x0 + size: 0xef000 + device: MX25R64 + region: external_flash +mcuboot_secondary_1: + address: 0xef000 + size: 0x40000 + device: MX25R64 + region: external_flash +external_flash: + address: 0x12f000 + size: 0x6D1000 + device: MX25R64 + region: external_flash +pcd_sram: + address: 0x20000000 + size: 0x2000 + region: sram_primary diff --git a/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml b/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml new file mode 100644 index 000000000000..a28d1effed5f --- /dev/null +++ b/samples/matter/window_covering/pm_static_nrf54l15pdk_nrf54l15_cpuapp_release.yml @@ -0,0 +1,51 @@ +mcuboot: + address: 0x0 + region: flash_primary + size: 0x7000 +mcuboot_pad: + address: 0x7000 + region: flash_primary + size: 0x800 +app: + address: 0x7800 + region: flash_primary + size: 0xb6000 +mcuboot_primary: + address: 0x7000 + orig_span: &id001 + - app + - mcuboot_pad + region: flash_primary + size: 0xb6800 + span: *id001 +mcuboot_primary_app: + address: 0x7800 + orig_span: &id002 + - app + region: flash_primary + size: 0xb6000 + span: *id002 +mcuboot_secondary: + address: 0xbd800 + orig_span: &id003 + - mcuboot_secondary_pad + - mcuboot_secondary_app + region: flash_primary + size: 0xb6800 + span: *id003 +mcuboot_secondary_pad: + region: flash_primary + address: 0xbd800 + size: 0x800 +mcuboot_secondary_app: + region: flash_primary + address: 0xbe000 + size: 0xb6000 +factory_data: + address: 0x174000 + region: flash_primary + size: 0x1000 +settings_storage: + address: 0x175000 + region: flash_primary + size: 0x8000 diff --git a/samples/matter/window_covering/prj_no_dfu.conf b/samples/matter/window_covering/prj_no_dfu.conf deleted file mode 100644 index e23c1594480b..000000000000 --- a/samples/matter/window_covering/prj_no_dfu.conf +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# This sample uses Kconfig.defaults to set options common for all -# samples. This file should contain only options specific for this sample -# or overrides of default values. - -# Enable CHIP -CONFIG_CHIP=y -CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h" -# 32784 == 0x8010 (example window-app) -CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 -CONFIG_STD_CPP17=y - -# Add support for LEDs and buttons on Nordic development kits -CONFIG_DK_LIBRARY=y - -# PWM support -CONFIG_PWM=y - -# OpenThread configs -CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y -CONFIG_OPENTHREAD_MTD=y -CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_ICD_SUPPORT=y -CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 -CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 - -# Bluetooth Low Energy configuration -CONFIG_BT_DEVICE_NAME="MatterWinCov" - -# Stack size settings -CONFIG_IEEE802154_NRF5_RX_STACK_SIZE=1024 - -# Other settings -CONFIG_THREAD_NAME=y -CONFIG_MPU_STACK_GUARD=y -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_CHIP_LIB_SHELL=y - -# Disable Matter OTA DFU -CONFIG_CHIP_OTA_REQUESTOR=n - -# Disable QSPI NOR -CONFIG_CHIP_QSPI_NOR=n - -# Reduce application size -CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/window_covering/sample.yaml b/samples/matter/window_covering/sample.yaml index 96668e3fd07a..3cd567537f5c 100644 --- a/samples/matter/window_covering/sample.yaml +++ b/samples/matter/window_covering/sample.yaml @@ -5,13 +5,19 @@ tests: sample.matter.window_cover.debug: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.matter.window_cover.release: build_only: true extra_args: CONF_FILE=prj_release.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp diff --git a/samples/matter/window_covering/sysbuild.cmake b/samples/matter/window_covering/sysbuild.cmake deleted file mode 100644 index 4aae32ea8af0..000000000000 --- a/samples/matter/window_covering/sysbuild.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -if(CONF_FILE) - get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) -endif() - -# Set the paritions configuration -if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf") - set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/window_covering/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE) -endif() diff --git a/samples/matter/window_covering/sysbuild_no_dfu.conf b/samples/matter/window_covering/sysbuild_no_dfu.conf deleted file mode 100644 index 32e0738aecd0..000000000000 --- a/samples/matter/window_covering/sysbuild_no_dfu.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2023 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -SB_CONFIG_BOOTLOADER_MCUBOOT=n -SB_CONFIG_BOOTLOADER_NONE=y diff --git a/samples/mpsl/timeslot/sample.yaml b/samples/mpsl/timeslot/sample.yaml index 0d4b38b51a50..5e912443c0ea 100644 --- a/samples/mpsl/timeslot/sample.yaml +++ b/samples/mpsl/timeslot/sample.yaml @@ -5,8 +5,8 @@ tests: sample.mpsl.timeslot: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpunet + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpunet tags: ci_build diff --git a/samples/multicore/hello_world/README.rst b/samples/multicore/hello_world/README.rst index 5c5f2950da1e..3a4d9dd362fb 100644 --- a/samples/multicore/hello_world/README.rst +++ b/samples/multicore/hello_world/README.rst @@ -46,30 +46,30 @@ nRF5340 DK .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp -T sample.multicore.hello_world.nrf5340dk_cpuapp_cpunet . + west build -p -b nrf5340dk/nrf5340/cpuapp -T sample.multicore.hello_world.nrf5340dk_cpuapp_cpunet . -nRF54H20 PDK +nRF54H20 DK You can build the sample for application and radio cores as follows: .. code-block:: console - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpurad . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.multicore.hello_world.nrf54h20dk_cpuapp_cpurad . You can build the sample for application and PPR cores as follows: .. code-block:: console - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.multicore.hello_world.nrf54h20dk_cpuapp_cpuppr . Note that :ref:`zephyr:nordic-ppr` is used in the configuration above to automatically launch PPR core from the application core. - An additional configuration setup is provided to execute code from RAM on the PPR core. - This configuration uses :ref:`zephyr:nordic-ppr-ram` and disables :kconfig:option:`CONFIG_XIP` on the PPR core. + An additional configuration setup is provided to execute code directly from MRAM on the PPR core. + This configuration uses :ref:`zephyr:nordic-ppr-xip` and enables :kconfig:option:`CONFIG_XIP` on the PPR core. It can be built as follows: .. code-block:: console - west build -p -b nrf54h20pdk_nrf54h20_cpuapp -T sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr_ram . + west build -p -b nrf54h20dk/nrf54h20/cpuapp -T sample.multicore.hello_world.nrf54h20dk_cpuapp_cpuppr_xip . Testing ======= @@ -85,8 +85,8 @@ After programming the sample to your development kit, complete the following ste .. code-block:: console *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 *** - Hello world from nrf5340dk_nrf5340_cpuapp - Hello world from nrf5340dk_nrf5340_cpuapp + Hello world from nrf5340dk/nrf5340/cpuapp + Hello world from nrf5340dk/nrf5340/cpuapp ... * For the remote core, the output should be as follows: @@ -94,6 +94,6 @@ After programming the sample to your development kit, complete the following ste .. code-block:: console *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 *** - Hello world from nrf5340dk_nrf5340_cpunet - Hello world from nrf5340dk_nrf5340_cpunet + Hello world from nrf5340dk/nrf5340/cpunet + Hello world from nrf5340dk/nrf5340/cpunet ... diff --git a/samples/multicore/hello_world/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_ram.conf b/samples/multicore/hello_world/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_ram.conf deleted file mode 100644 index e52e26e2a9b8..000000000000 --- a/samples/multicore/hello_world/remote/boards/nrf54h20pdk_nrf54h20_cpuppr_ram.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_XIP=n diff --git a/samples/multicore/hello_world/sample.yaml b/samples/multicore/hello_world/sample.yaml index c5f283337aa4..0fe06213dfa0 100644 --- a/samples/multicore/hello_world/sample.yaml +++ b/samples/multicore/hello_world/sample.yaml @@ -12,45 +12,44 @@ common: tests: sample.multicore.hello_world.nrf5340dk_cpuapp_cpunet: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf sample.multicore.hello_world.nrf5340dk_cpuapp_cpunet_mcuboot: platform_allow: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - CONFIG_BOOTLOADER_MCUBOOT=y extra_args: SB_CONF_FILE=sysbuild/nrf5340dk_nrf5340_cpunet.conf - sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr: + sample.multicore.hello_world.nrf54h20dk_cpuapp_cpuppr: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf hello_world_SNIPPET=nordic-ppr - sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr_ram: + sample.multicore.hello_world.nrf54h20dk_cpuapp_cpuppr_xip: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf - hello_world_SNIPPET=nordic-ppr-ram - remote_OVERLAY_CONFIG=boards/nrf54h20pdk_nrf54h20_cpuppr_ram.conf + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf + hello_world_SNIPPET=nordic-ppr-xip - sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpurad: + sample.multicore.hello_world.nrf54h20dk_cpuapp_cpurad: platform_allow: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - - nrf54h20pdk_nrf54h20_cpuapp + - nrf54h20dk/nrf54h20/cpuapp extra_args: - SB_CONF_FILE=sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf + SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/samples/multicore/hello_world/src/main.c b/samples/multicore/hello_world/src/main.c index 74536fd0c097..916410602402 100644 --- a/samples/multicore/hello_world/src/main.c +++ b/samples/multicore/hello_world/src/main.c @@ -15,7 +15,7 @@ int main(void) while (1) { LOG_INF("test %d", cnt++); - printk("Hello world from %s\n", CONFIG_BOARD); + printk("Hello world from %s\n", CONFIG_BOARD_TARGET); k_msleep(1000); } diff --git a/samples/multicore/hello_world/sysbuild/nrf5340dk_nrf5340_cpunet.conf b/samples/multicore/hello_world/sysbuild/nrf5340dk_nrf5340_cpunet.conf index c387b552e656..b8ae05d4ef6f 100644 --- a/samples/multicore/hello_world/sysbuild/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/multicore/hello_world/sysbuild/nrf5340dk_nrf5340_cpunet.conf @@ -1 +1 @@ -SB_CONFIG_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" +SB_CONFIG_REMOTE_BOARD="nrf5340dk/nrf5340/cpunet" diff --git a/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf new file mode 100644 index 000000000000..f50bc8553a01 --- /dev/null +++ b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpuppr" diff --git a/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf new file mode 100644 index 000000000000..270c92c09a4f --- /dev/null +++ b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpuppr_xip.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpuppr/xip" diff --git a/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..dd863e78d993 --- /dev/null +++ b/samples/multicore/hello_world/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1 @@ +SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf b/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf deleted file mode 100644 index e3ae1e6050b9..000000000000 --- a/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpuppr.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20pdk_nrf54h20_cpuppr" diff --git a/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf b/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf deleted file mode 100644 index d303e4934ea9..000000000000 --- a/samples/multicore/hello_world/sysbuild/nrf54h20pdk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20pdk_nrf54h20_cpurad" diff --git a/samples/net/aws_iot/CMakeLists.txt b/samples/net/aws_iot/CMakeLists.txt index 5f03edc40f76..1d0fde94e8b1 100644 --- a/samples/net/aws_iot/CMakeLists.txt +++ b/samples/net/aws_iot/CMakeLists.txt @@ -16,6 +16,3 @@ target_sources(app PRIVATE src/json_payload/json_payload.c) zephyr_include_directories(src) zephyr_include_directories(src/json_payload) - -# Make folder containing certificates global so that it can be located by the MQTT helper library. -zephyr_include_directories_ifdef(CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES certs) diff --git a/samples/net/aws_iot/README.rst b/samples/net/aws_iot/README.rst index f29638bccdff..6a715c275cfa 100644 --- a/samples/net/aws_iot/README.rst +++ b/samples/net/aws_iot/README.rst @@ -151,12 +151,12 @@ The sample includes pre-configured configuration files for the development kits * :file:`boards/nrf9161dk_nrf9161_ns.conf` - Configuration file for the nRF9161 DK. * :file:`boards/nrf9160dk_nrf9160_ns.conf` - Configuration file for the nRF9160 DK. * :file:`boards/thingy91_nrf9160_ns.conf` - Configuration file for the Thingy:91. -* :file:`boards/nrf7002dk_nrf5340_cpuapp.conf` - Configuration file for the nRF7002 DK. +* :file:`boards/nrf7002dk_nrf5340_cpuapp_ns.conf` - Configuration file for the nRF7002 DK. * :file:`boards/qemu_x86.conf` - Configuration file for QEMU x86. The following configuration and DTS overlay files are included to host the MCUboot secondary image slot on external flash for the nRF7002 DK: -* :file:`boards/nrf7002dk_nrf5340_cpuapp.overlay` - DTS overlay file for the application image. +* :file:`boards/nrf7002dk_nrf5340_cpuapp_ns.overlay` - DTS overlay file for the application image. * :file:`child_image/mcuboot/nrf7002dk_nrf5340_cpuapp.overlay` - DTS overlay file for the MCUboot child image. * :file:`child_image/mcuboot/nrf7002dk_nrf5340_cpuapp.conf` - Configuration file for the MCUboot child image. diff --git a/samples/net/aws_iot/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/aws_iot/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index 25ad29b903a7..eab54a2ad790 100644 --- a/samples/net/aws_iot/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/aws_iot/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -20,10 +20,6 @@ CONFIG_HW_ID_LIBRARY_SOURCE_NET_MAC=y CONFIG_NRF700X_RX_NUM_BUFS=16 CONFIG_NRF700X_MAX_TX_AGGREGATION=4 -# Set newlib C to prevent build error complaining that string.h is not supported -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y - # Wi-Fi CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y @@ -42,14 +38,12 @@ CONFIG_WPA_SUPP=y # NET sockets CONFIG_NET_L2_ETHERNET=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_TCP=y CONFIG_NET_SOCKETS_OFFLOAD=n CONFIG_NET_DHCPV4=y CONFIG_NET_CONTEXT_SNDTIMEO=y CONFIG_NET_CONTEXT_RCVTIMEO=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=2048 # DNS diff --git a/samples/net/aws_iot/boards/qemu_x86.conf b/samples/net/aws_iot/boards/qemu_x86.conf index 3845bb2b9d03..665e4c32b60c 100644 --- a/samples/net/aws_iot/boards/qemu_x86.conf +++ b/samples/net/aws_iot/boards/qemu_x86.conf @@ -7,10 +7,6 @@ # General config CONFIG_FPU=y -# NEWLIB C -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y - # AWS IoT library CONFIG_MQTT_HELPER_LAST_WILL=n CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=n diff --git a/samples/net/aws_iot/certs/ca-cert.pem b/samples/net/aws_iot/certs/ca-cert.pem deleted file mode 100644 index be90312467dd..000000000000 --- a/samples/net/aws_iot/certs/ca-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CERTIFICATE-----\n" -"-----certificate-----\n" -"-----END CERTIFICATE-----\n" diff --git a/samples/net/aws_iot/certs/client-cert.pem b/samples/net/aws_iot/certs/client-cert.pem deleted file mode 100644 index be90312467dd..000000000000 --- a/samples/net/aws_iot/certs/client-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CERTIFICATE-----\n" -"-----certificate-----\n" -"-----END CERTIFICATE-----\n" diff --git a/samples/net/aws_iot/certs/private-key.pem b/samples/net/aws_iot/certs/private-key.pem deleted file mode 100644 index 89729a333f92..000000000000 --- a/samples/net/aws_iot/certs/private-key.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN RSA PRIVATE KEY-----\n" -"-----key-----\n" -"-----END RSA PRIVATE KEY-----\n" diff --git a/samples/net/aws_iot/sample.yaml b/samples/net/aws_iot/sample.yaml index 86733bf571a3..a51c3590c57c 100644 --- a/samples/net/aws_iot/sample.yaml +++ b/samples/net/aws_iot/sample.yaml @@ -6,15 +6,15 @@ tests: build_only: true build_on_all: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - thingy91x_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - thingy91x/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns diff --git a/samples/net/azure_iot_hub/CMakeLists.txt b/samples/net/azure_iot_hub/CMakeLists.txt index 021c6e2ea8c2..0243bab660fc 100644 --- a/samples/net/azure_iot_hub/CMakeLists.txt +++ b/samples/net/azure_iot_hub/CMakeLists.txt @@ -15,7 +15,3 @@ target_sources(app PRIVATE src/main.c) # NORDIC SDK APP END zephyr_include_directories(src) - -# Make folder containing certificates global so that it can be located by -# the MQTT helper library. -zephyr_include_directories_ifdef(CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES certs) diff --git a/samples/net/azure_iot_hub/README.rst b/samples/net/azure_iot_hub/README.rst index 3b18689c9dd3..b5243e45d0d4 100644 --- a/samples/net/azure_iot_hub/README.rst +++ b/samples/net/azure_iot_hub/README.rst @@ -94,7 +94,7 @@ As an example, the following compiles with DPS for the nRF9160 DK: .. code-block:: console - west build -p -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-dps.conf + west build -p -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE=overlay-dps.conf * :kconfig:option:`CONFIG_AZURE_IOT_HUB_DPS` - Enables Azure IoT Hub DPS. * :kconfig:option:`CONFIG_AZURE_IOT_HUB_DPS_REG_ID` - Sets the Azure IoT Hub DPS registration ID. It can be provided at run time. By default, the sample uses the device ID as the registration ID and sets it at run time. diff --git a/samples/net/azure_iot_hub/boards/native_sim.conf b/samples/net/azure_iot_hub/boards/native_sim.conf index c164488d0487..c56923443d05 100644 --- a/samples/net/azure_iot_hub/boards/native_sim.conf +++ b/samples/net/azure_iot_hub/boards/native_sim.conf @@ -53,4 +53,3 @@ CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2" # Azure IoT Hub library CONFIG_MQTT_HELPER_SEC_TAG=201 -CONFIG_MQTT_HELPER_SECONDARY_SEC_TAG=-1 diff --git a/samples/net/azure_iot_hub/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/azure_iot_hub/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index 8bdc19c8ad42..dcf85bf99320 100644 --- a/samples/net/azure_iot_hub/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/azure_iot_hub/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -20,9 +20,6 @@ CONFIG_NET_RX_STACK_SIZE=2048 CONFIG_NRF700X_RX_NUM_BUFS=16 CONFIG_NRF700X_MAX_TX_AGGREGATION=4 -# Set newlib C to prevent build error complaining that string.h is not supported -CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y - # Wi-Fi CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y @@ -52,7 +49,6 @@ CONFIG_NET_SOCKETS_DNS_TIMEOUT=30000 CONFIG_NET_SOCKETS=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_SOCKETS_OFFLOAD=n CONFIG_NET_DHCPV4=y diff --git a/samples/net/azure_iot_hub/certs/ca-cert.pem b/samples/net/azure_iot_hub/certs/ca-cert.pem deleted file mode 100644 index 0d6eaa7df0b5..000000000000 --- a/samples/net/azure_iot_hub/certs/ca-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CA CERTIFICATE-----\n" -"-----CERTIFICATE-----\n" -"-----END CA CERTIFICATE-----\n" diff --git a/samples/net/azure_iot_hub/certs/client-cert.pem b/samples/net/azure_iot_hub/certs/client-cert.pem deleted file mode 100644 index 0ee47f337c82..000000000000 --- a/samples/net/azure_iot_hub/certs/client-cert.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN CLIENT CERTIFICATE-----\n" -"-----CERTIFICATE-----\n" -"-----END CLIENT CERTIFICATE-----\n" diff --git a/samples/net/azure_iot_hub/certs/private-key.pem b/samples/net/azure_iot_hub/certs/private-key.pem deleted file mode 100644 index 18bee64d9cb1..000000000000 --- a/samples/net/azure_iot_hub/certs/private-key.pem +++ /dev/null @@ -1,3 +0,0 @@ -"-----BEGIN PRIVATE KEY-----\n" -"-----KEY-----\n" -"-----END PRIVATE KEY-----\n" diff --git a/samples/net/azure_iot_hub/sample.yaml b/samples/net/azure_iot_hub/sample.yaml index c1536d5871bd..33abdf13b653 100644 --- a/samples/net/azure_iot_hub/sample.yaml +++ b/samples/net/azure_iot_hub/sample.yaml @@ -4,28 +4,28 @@ tests: sample.net.azure_iot_hub: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns tags: ci_build sample.net.azure_iot_hub.dps: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns extra_args: OVERLAY_CONFIG=overlay-dps.conf extra_configs: - CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE="test-scope" diff --git a/samples/net/coap_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/coap_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index fc329c4c7492..fea05a47d07e 100644 --- a/samples/net/coap_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/coap_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -41,6 +41,7 @@ CONFIG_SHELL_STACK_SIZE=6144 # WPA CONFIG_WPA_SUPP=y +CONFIG_MBEDTLS_HEAP_SIZE=16384 # NET sockets CONFIG_NET_L2_ETHERNET=y @@ -56,12 +57,3 @@ CONFIG_NET_SOCKETS_DNS_TIMEOUT=30000 CONFIG_L2_WIFI_CONNECTIVITY=y CONFIG_L2_WIFI_CONNECTIVITY_AUTO_DOWN=n CONFIG_L2_WIFI_CONNECTIVITY_AUTO_CONNECT=n - -# TLS -CONFIG_NRF_SECURITY=y -CONFIG_MBEDTLS=y -CONFIG_MBEDTLS_ENABLE_HEAP=y -CONFIG_MBEDTLS_HEAP_SIZE=16384 -CONFIG_MBEDTLS_RSA_C=y -CONFIG_MBEDTLS_SSL_SERVER_NAME_INDICATION=y -CONFIG_NET_SOCKETS_SOCKOPT_TLS=y diff --git a/samples/net/coap_client/sample.yaml b/samples/net/coap_client/sample.yaml index 0d1b2d3cbc31..317820c0cfa6 100644 --- a/samples/net/coap_client/sample.yaml +++ b/samples/net/coap_client/sample.yaml @@ -5,15 +5,15 @@ tests: build_only: true build_on_all: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns tags: ci_build diff --git a/samples/net/coap_client/src/main.c b/samples/net/coap_client/src/main.c index cd4ec92a3c76..ca85c296e080 100644 --- a/samples/net/coap_client/src/main.c +++ b/samples/net/coap_client/src/main.c @@ -6,6 +6,16 @@ #include #include + +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#else +#include +#endif /* CONFIG_POSIX_API */ + #include #include #include diff --git a/samples/net/download/README.rst b/samples/net/download/README.rst index 7b00526c1e2c..a9ccb6688de1 100644 --- a/samples/net/download/README.rst +++ b/samples/net/download/README.rst @@ -116,8 +116,10 @@ Testing After programming the sample to your development kit, test it by performing the following steps: -1. Connect the development kit to your PC using a USB cable and power on or reset the kit. -#. Open a terminal emulator |ANSI| and observe that the sample starts, provisions certificates, and starts to download. +1. |connect_kit| +#. Power on or reset the kit. +#. |connect_terminal_ANSI| +#. Observe that the sample starts, provisions certificates, and starts to download. #. Observe that the progress bar fills up as the download progresses. #. Observe that the sample displays the message "Download completed" on the terminal when the download completes. diff --git a/samples/net/download/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/download/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index eb542c8d8870..a54ae580caa8 100644 --- a/samples/net/download/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/download/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -38,12 +38,10 @@ CONFIG_WPA_SUPP_LOG_LEVEL_ERR=y # NET sockets CONFIG_NET_L2_ETHERNET=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_DHCPV4=y CONFIG_NET_CONTEXT_SNDTIMEO=y CONFIG_NET_CONTEXT_RCVTIMEO=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 CONFIG_NET_TCP=y CONFIG_NET_NATIVE=y CONFIG_NET_SOCKETS_SOCKOPT_TLS=y diff --git a/samples/net/download/sample.yaml b/samples/net/download/sample.yaml index 5b7208be5c07..c99afba6df2c 100644 --- a/samples/net/download/sample.yaml +++ b/samples/net/download/sample.yaml @@ -4,9 +4,9 @@ tests: sample.net.download_client: build_only: true integration_platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.net.download_client.ci: build_only: true @@ -16,13 +16,13 @@ tests: - CONFIG_DOWNLOAD_CLIENT_SHELL=y - CONFIG_SAMPLE_COMPUTE_HASH=y integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns tags: ci_build diff --git a/samples/net/http_server/CMakeLists.txt b/samples/net/http_server/CMakeLists.txt index 2e3bd8c3004b..17cec14a67d6 100644 --- a/samples/net/http_server/CMakeLists.txt +++ b/samples/net/http_server/CMakeLists.txt @@ -12,4 +12,33 @@ project(http_server) target_sources(app PRIVATE src/main.c) target_sources(app PRIVATE src/credentials_provision.c) target_include_directories(app PRIVATE src) -target_include_directories(app PRIVATE credentials) + +if (CONFIG_NET_SOCKETS_SOCKOPT_TLS) + message(WARNING "Credentials are exposed in non-secure memory. This should be avoided in production.") + + set(app_certs_binary_dir ${APPLICATION_BINARY_DIR}/credentials) + + # Function to process a certificate file and create a corresponding .inc file and compiler definition + # used to assign C variables that are used in main.c. + function(process_certificate definition_name file_name) + set(cert_file ${APPLICATION_SOURCE_DIR}/credentials/${file_name}) + if(EXISTS ${cert_file}) + message(STATUS "${file_name} found") + + get_filename_component(file_base_name ${file_name} NAME_WE) + set(inc_file_name ${file_base_name}.inc) + + set(inc_file_path ${app_certs_binary_dir}/${inc_file_name}) + generate_inc_file_for_target(app ${cert_file} ${inc_file_path}) + + # Define a compiler macro with the path to the generated .inc file, + # allowing it to be included in the source code. + add_definitions(-D${definition_name}="${inc_file_path}") + endif() + endfunction() + + # Process each certificate file by generating a .inc file and defining a corresponding macro. + process_certificate("HTTP_SERVER_CA_CERT" "server_certificate.pem") + process_certificate("HTTP_SERVER_PRIVATE_KEY" "server_private_key.pem") + +endif() diff --git a/samples/net/http_server/Kconfig b/samples/net/http_server/Kconfig index f068174dcd4b..2319b279246c 100644 --- a/samples/net/http_server/Kconfig +++ b/samples/net/http_server/Kconfig @@ -21,7 +21,7 @@ config HTTP_SERVER_SAMPLE_PORT config HTTP_SERVER_SAMPLE_CLIENTS_MAX int "Maximum clients" - default 2 + default 1 help This option sets the maximum number of concurrent clients. Increasing this option will impact the performance of the server and increase the diff --git a/samples/net/http_server/README.rst b/samples/net/http_server/README.rst index 553edd343790..cc0b82776893 100644 --- a/samples/net/http_server/README.rst +++ b/samples/net/http_server/README.rst @@ -137,14 +137,8 @@ To generate new credentials, run the following commands: # Sign the client's CSR with the server's private key and certificate, creating a client certificate. openssl x509 -req -in client.csr -CA server_certificate.pem -CAkey server_private_key.pem -CAcreateserial -out client.crt -days 365 -To provision the generated credentials to the server's TLS stack, the credentials need to be converted into C header files that are readable by the server code. -To do this, you can use the following script :file:`sdk-nrf/scripts/cert_to_header.py`. -Replace the generated header files with the pregenerated header files in the :file:`http_server/credentials` folder. - -.. code-block:: console - - python3 cert_to_header.py server_certificate.pem - python3 cert_to_header.py server_private_key.pem +To provision the generated credentials to the server's TLS stack, replace the pregenerated certificates with the newly generated one in the :file:`http_server/credentials` folder in PEM format. +Provisioning happens automatically after the firmware boots by the sample. Configuration ************* @@ -338,7 +332,7 @@ Modem traces can be enabled by providing a snippet with the west build command u .. code-block:: console - west build -p -b nrf9161dk_nrf9161_ns -S nrf91-modem-trace-uart + west build -p -b nrf9161dk/nrf9161/ns -S nrf91-modem-trace-uart Dependencies ************ diff --git a/samples/net/http_server/boards/native_sim.conf b/samples/net/http_server/boards/native_sim.conf new file mode 100644 index 000000000000..87df9e6695da --- /dev/null +++ b/samples/net/http_server/boards/native_sim.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# LED Control off +CONFIG_DK_LIBRARY=n + +# Network address config +CONFIG_NET_CONFIG_SETTINGS=y +CONFIG_NET_CONFIG_NEED_IPV4=y +CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1" +CONFIG_NET_HOSTNAME_ENABLE=y +CONFIG_NET_HOSTNAME_UNIQUE=n +CONFIG_NET_HOSTNAME="httpserver" +CONFIG_POSIX_UNAME=n diff --git a/samples/net/http_server/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/http_server/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index fa6fafef4d3f..2dbbe74ae62a 100644 --- a/samples/net/http_server/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/http_server/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -14,9 +14,6 @@ CONFIG_HEAP_MEM_POOL_SIZE=81920 CONFIG_NRF700X_RX_NUM_BUFS=16 CONFIG_NRF700X_MAX_TX_AGGREGATION=4 -# Newlib -CONFIG_NEWLIB_LIBC=y - # Wi-Fi CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y @@ -33,6 +30,7 @@ CONFIG_MDNS_RESPONDER_DNS_SD=y CONFIG_NET_HOSTNAME_ENABLE=y CONFIG_NET_HOSTNAME_UNIQUE=n CONFIG_NET_HOSTNAME="httpserver" +CONFIG_POSIX_UNAME=n # Zephyr NET Connection Manager connectivity layer CONFIG_L2_WIFI_CONNECTIVITY=y @@ -40,7 +38,7 @@ CONFIG_L2_WIFI_CONNECTIVITY_AUTO_CONNECT=n CONFIG_L2_WIFI_CONNECTIVITY_AUTO_DOWN=n # mbedTLS and sockets -CONFIG_POSIX_MAX_FDS=20 +CONFIG_POSIX_MAX_FDS=25 CONFIG_MBEDTLS_HEAP_SIZE=16384 # DHCPv4 diff --git a/samples/net/http_server/credentials/server_certificate.h b/samples/net/http_server/credentials/server_certificate.h deleted file mode 100644 index 2a82c1c64aa3..000000000000 --- a/samples/net/http_server/credentials/server_certificate.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -static const unsigned char server_certificate[] = - "-----BEGIN CERTIFICATE-----\n" - "MIIDmTCCAoGgAwIBAgIUNPeHg7DpZ5bXuQIi6Xb5+3QsLU8wDQYJKoZIhvcNAQEL\n" - "BQAwXDELMAkGA1UEBhMCTk8xDzANBgNVBAgMBk5vcndheTEhMB8GA1UECgwYSW50\n" - "ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRkwFwYDVQQDDBBodHRwc2VydmVyLmxvY2Fs\n" - "MB4XDTIzMDgyOTA5MDUxMVoXDTMzMDgyNjA5MDUxMVowXDELMAkGA1UEBhMCTk8x\n" - "DzANBgNVBAgMBk5vcndheTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkg\n" - "THRkMRkwFwYDVQQDDBBodHRwc2VydmVyLmxvY2FsMIIBIjANBgkqhkiG9w0BAQEF\n" - "AAOCAQ8AMIIBCgKCAQEAtu0duZvD2kDOg1Qqh9VxhC/kVpquO3C31w8J3CgI/tZA\n" - "hlOGxxjXySrQdHUUpQHjWk9LaQhD8TMag8hA+4Rxx+MJpvx6G29se9dbG7TRTswx\n" - "MdRweXjlygjl+2DJr5Fy7541ceRfBc2O2+AZWsCxxryVhEyIUSAIhEL7cEF2NV7m\n" - "3O5POSPSOe86s8REaRbnrEcVAXGgViNf2oQGLAS2ul8gzkIcU/7/foHNI8RL/9qD\n" - "arQrxyUrUzAnGxdaaVgajbHVGpGyKOuhEYwZlHZbJI+juHtw3iDaOb8oz1fXsoDo\n" - "mSO0Zzt4Q/pGvxgitbBKKHaM0juo2q81tto/pa82bwIDAQABo1MwUTAdBgNVHQ4E\n" - "FgQUfLgHfBTGAvqmcg/c7AhbLwaA5WUwHwYDVR0jBBgwFoAUfLgHfBTGAvqmcg/c\n" - "7AhbLwaA5WUwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAYieg\n" - "3NtCYNWAq0ASjMUIlN4xTWlWPvQMLcvaBWs27GB8dYR9uq450G1ADZqMWV7CWT5G\n" - "6QVVUj5XOCLhlmIfuBBdh5Yw9DSq7f6ALa+eUwsn/yC2pVrMYiWuSwAMB0XO06ip\n" - "p95K05lDFhjAzHTNJSXs0bHFNnxDwk687hfWQCsjPh2Gocg5OGJVq6b9KA9kv3FT\n" - "ndfNnVdyfBsKn/USf96kJ97qUkTWKwNNvPn9eBhP9T5FdTfv9bCjv3kqHTCSvF5/\n" - "Hv7J6UHlxNcWxBDq0FGj3jxKoxUyXuDi7curcCPPC/gy57NMyg0nyq/gE4alJKVH\n" - "8ticzSyJlz9rS7AbAg==\n" - "-----END CERTIFICATE-----\n"; diff --git a/samples/net/http_server/credentials/server_private_key.h b/samples/net/http_server/credentials/server_private_key.h deleted file mode 100644 index 125ae71bf308..000000000000 --- a/samples/net/http_server/credentials/server_private_key.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -static const unsigned char server_private_key[] = - "-----BEGIN PRIVATE KEY-----\n" - "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC27R25m8PaQM6D\n" - "VCqH1XGEL+RWmq47cLfXDwncKAj+1kCGU4bHGNfJKtB0dRSlAeNaT0tpCEPxMxqD\n" - "yED7hHHH4wmm/Hobb2x711sbtNFOzDEx1HB5eOXKCOX7YMmvkXLvnjVx5F8FzY7b\n" - "4BlawLHGvJWETIhRIAiEQvtwQXY1Xubc7k85I9I57zqzxERpFuesRxUBcaBWI1/a\n" - "hAYsBLa6XyDOQhxT/v9+gc0jxEv/2oNqtCvHJStTMCcbF1ppWBqNsdUakbIo66ER\n" - "jBmUdlskj6O4e3DeINo5vyjPV9eygOiZI7RnO3hD+ka/GCK1sEoodozSO6jarzW2\n" - "2j+lrzZvAgMBAAECggEATyh83H0TW7b/psUdQnqTDOjMns2A6Cf25hGT6rlIaz67\n" - "3WT3xeByQJNOcZbYwC74+3Ok5ma1QAMlTjGyLSU7N4x/+Mr47DZjc5PV0T+F89tY\n" - "zn9nzKkMh0kifI19uYPvgNGtvwNcO16gm3V2g1cvlxi0evPDaZe7F8EEnac2SBF0\n" - "p2rGvfma6aeZ4DTqiLOpCMXldCJqG2diZjR6lhjxKJxy8NoYsUh5HswJggeTFprU\n" - "KvKFTHqVDZXA2R8va1uK/gT07tyOEneXJB7fU5y5vM4Q83q3Ez7ujI7sJSrG2QGz\n" - "3y2o9zz9Nv8fgaMaAcH8FZLmpi2l4RMnvN1Lap8dAQKBgQDAHF1eOJGXsR28pze3\n" - "6m8BrfuGCzz4bjPXyrOvvJE/uuiP6bB9Yg40+QD6O6KbjPdvTnIX0VQJSMYtRU/h\n" - "jYLdh6dc7eMofIKb0wat5KT1J1VkwTvJqnB7JTGCrt+7Yr9h9g5FesaHupSSdz2t\n" - "4ZU1/IJboKPzHZxZlebgJS1VHwKBgQDzws9Z7Eact3I1sSLyVqpWiRnRmOfoacOA\n" - "I9PL+iSdCnYZw3L88A1wQpYNWHzHEX0WOYRL3Pnrlur3B2PiMlGtvHR0GJe+54Cx\n" - "ObNj3X47OXTChscasO07X/fMOBfQBN1bTOsKylFesyuVzKHOsQu3c9D8UrNCWfx3\n" - "UTd3+8EksQKBgQCqr4j1UeVplWAKYbfLnGsMXvx+2DVPtPoy3FJR7YRPz00ZsFOy\n" - "0xA0WJhZu+p5sgGVz2jnaID1zsblKhQTHpwLH5+/nUyaiCWzNQdWMTOu7UedwWHR\n" - "h7FweFdI+P6nitDnxKphaPhDV67xgyg1+ZuM39Eif9OrCcAEiH8c32srmQKBgHfG\n" - "8vJhunTJY3JknyJrWXn6Fli6hMHcLndpo2noeVM9T7jrJDaLkl7mKStXnsCGpGtm\n" - "Sc6pP5j26HAIDpmYVjBDmQlvCCmDQeZTzwU0UhGx8uCfL3i7FWcGihGsQm8x5L83\n" - "NYtwzLj222TZT2zr7DDx1PAXhwQEiZzrqJDpgQeRAoGAIxNw1Ls9aFIYvtp+5HgE\n" - "NJsqJrjiMmN+dTlBlurCsQVljEBwrTjeorbbvJxY/vvI03RLbJ3Rs3XR3OmvQofg\n" - "TQPVpzIq9Ue+JBh9C5etQ88e6k0VIDBe11BC+mD94Lo0AolUTsaBeysYP56T5X2A\n" - "2kr5GdJk6Rg+O5Auh6fbjXU=\n" - "-----END PRIVATE KEY-----\n"; diff --git a/samples/net/http_server/overlay-tls-nrf7002dk.conf b/samples/net/http_server/overlay-tls-nrf7002dk.conf index 8c5147df6d48..c4cb9f39004a 100644 --- a/samples/net/http_server/overlay-tls-nrf7002dk.conf +++ b/samples/net/http_server/overlay-tls-nrf7002dk.conf @@ -12,3 +12,6 @@ CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=3 CONFIG_NORDIC_SECURITY_BACKEND=y CONFIG_MBEDTLS_HEAP_SIZE=81920 CONFIG_MBEDTLS_RSA_C=y + +# TLS credentials +CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE=y diff --git a/samples/net/http_server/overlay-tls-nrf91.conf b/samples/net/http_server/overlay-tls-nrf91.conf index ed08f930f6d1..765f79c1a458 100644 --- a/samples/net/http_server/overlay-tls-nrf91.conf +++ b/samples/net/http_server/overlay-tls-nrf91.conf @@ -42,7 +42,7 @@ CONFIG_PSA_WANT_ALG_ECDSA=y CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y CONFIG_PSA_WANT_ALG_HMAC=y # dependency for DETERMINISTIC_ECDSA -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y # dependency for DETERMINISTIC_ECDSA +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y # dependency for DETERMINISTIC_ECDSA # Enable ECDH CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED=y @@ -57,6 +57,8 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED=y CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED=y CONFIG_MBEDTLS_PKCS1_V15=y CONFIG_MBEDTLS_MPI_MAX_SIZE=512 +CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y +CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y # Enable SHA CONFIG_MBEDTLS_SHA256_C=y diff --git a/samples/net/http_server/prj.conf b/samples/net/http_server/prj.conf index 0ebef0b21363..c85024c75b81 100644 --- a/samples/net/http_server/prj.conf +++ b/samples/net/http_server/prj.conf @@ -22,10 +22,9 @@ CONFIG_NET_IPV6=y CONFIG_NET_TCP=y CONFIG_NET_UDP=y CONFIG_NET_SOCKETS=y -CONFIG_NET_SOCKETS_POSIX_NAMES=y +CONFIG_POSIX_API=y CONFIG_NET_MAX_CONN=10 CONFIG_NET_MAX_CONTEXTS=20 -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 # Network buffers CONFIG_NET_PKT_RX_COUNT=64 diff --git a/samples/net/http_server/sample.yaml b/samples/net/http_server/sample.yaml index b4677745a9ae..7dc2c892ec72 100644 --- a/samples/net/http_server/sample.yaml +++ b/samples/net/http_server/sample.yaml @@ -4,40 +4,40 @@ tests: sample.net.http_server.wifi: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp_ns - platform_allow: nrf7002dk_nrf5340_cpuapp_ns + - nrf7002dk/nrf5340/cpuapp/ns + platform_allow: nrf7002dk/nrf5340/cpuapp/ns tags: ci_build sample.net.http_server.wifi.tls: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp_ns - platform_allow: nrf7002dk_nrf5340_cpuapp_ns + - nrf7002dk/nrf5340/cpuapp/ns + platform_allow: nrf7002dk/nrf5340/cpuapp/ns extra_args: OVERLAY_CONFIG=overlay-tls-nrf7002dk.conf tags: ci_build sample.net.http_server.lte: build_only: true integration_platforms: - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns tags: ci_build sample.net.http_server.lte.tls: build_only: true integration_platforms: - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns extra_args: OVERLAY_CONFIG=overlay-tls-nrf91.conf tags: ci_build diff --git a/samples/net/http_server/src/credentials_provision.c b/samples/net/http_server/src/credentials_provision.c index 4fa95b19be53..fd8c958048a5 100644 --- a/samples/net/http_server/src/credentials_provision.c +++ b/samples/net/http_server/src/credentials_provision.c @@ -9,11 +9,27 @@ #include #include -/* Include the server certificate and private key. These are intended for testing and should - * not be used for anything else. - */ -#include "server_certificate.h" -#include "server_private_key.h" +static const unsigned char server_certificate[] = { +#if defined(HTTP_SERVER_CA_CERT) +#include HTTP_SERVER_CA_CERT + +/* Null terminate certificate */ +(0x00) +#else +"" +#endif +}; + +static const unsigned char server_private_key[] = { +#if defined(HTTP_SERVER_PRIVATE_KEY) +#include HTTP_SERVER_PRIVATE_KEY + +/* Null terminate certificate */ +(0x00) +#else +"" +#endif +}; LOG_MODULE_REGISTER(http_server_credentials_provision, CONFIG_HTTP_SERVER_SAMPLE_LOG_LEVEL); @@ -25,7 +41,11 @@ int credentials_provision(void) TLS_CREDENTIAL_CA_CERTIFICATE, server_certificate, sizeof(server_certificate)); - if (ret < 0) { + + if (ret == -EEXIST) { + LOG_DBG("CA certificate already exists, sec tag: %d", + CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG); + } else if (ret < 0) { LOG_ERR("Failed to register CA certificate: %d", ret); return ret; } @@ -34,7 +54,10 @@ int credentials_provision(void) TLS_CREDENTIAL_SERVER_CERTIFICATE, server_certificate, sizeof(server_certificate)); - if (ret < 0) { + if (ret == -EEXIST) { + LOG_DBG("Public certificate already exists, sec tag: %d", + CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG); + } else if (ret < 0) { LOG_ERR("Failed to register public certificate: %d", ret); return ret; } @@ -42,7 +65,11 @@ int credentials_provision(void) ret = tls_credential_add(CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG, TLS_CREDENTIAL_PRIVATE_KEY, server_private_key, sizeof(server_private_key)); - if (ret < 0) { + + if (ret == -EEXIST) { + LOG_DBG("Private key already exists, sec tag: %d", + CONFIG_HTTP_SERVER_SAMPLE_SERVER_CERTIFICATE_SEC_TAG); + } else if (ret < 0) { LOG_ERR("Failed to register private key: %d", ret); return ret; } diff --git a/samples/net/http_server/src/main.c b/samples/net/http_server/src/main.c index 449ffd8d23ff..94f5308bfa8d 100644 --- a/samples/net/http_server/src/main.c +++ b/samples/net/http_server/src/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -24,7 +25,16 @@ #include #include +#if defined(CONFIG_DK_LIBRARY) #include +#endif /* defined(CONFIG_DK_LIBRARY) */ + +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif #include "credentials_provision.h" @@ -46,6 +56,12 @@ LOG_MODULE_REGISTER(http_server, CONFIG_HTTP_SERVER_SAMPLE_LOG_LEVEL); LOG_PANIC(); \ IF_ENABLED(CONFIG_REBOOT, (sys_reboot(0))) +#if defined(CONFIG_NET_HOSTNAME) +/* Register service */ +DNS_SD_REGISTER_TCP_SERVICE(http_server_sd, CONFIG_NET_HOSTNAME, "_http", "local", + DNS_SD_EMPTY_TXT, SERVER_PORT); +#endif /* CONFIG_NET_HOSTNAME */ + /* Zephyr NET management event callback structures. */ static struct net_mgmt_event_callback l4_cb; static struct net_mgmt_event_callback conn_cb; @@ -145,12 +161,14 @@ static int led_update(uint8_t index, uint8_t state) return -EBADMSG; } +#if defined(CONFIG_DK_LIBRARY) ret = dk_set_led(index, led_states[index]); if (ret) { LOG_ERR("Failed to update LED %d state to %d", index, led_states[index]); FATAL_ERROR(); return -EIO; } +#endif /* defined(CONFIG_DK_LIBRARY) */ LOG_INF("LED %d state updated to %d", index, led_states[index]); @@ -655,12 +673,14 @@ int main(void) parser_init(); +#if defined(CONFIG_DK_LIBRARY) ret = dk_leds_init(); if (ret) { LOG_ERR("dk_leds_init, error: %d", ret); FATAL_ERROR(); return ret; } +#endif /* defined(CONFIG_DK_LIBRARY) */ /* Setup handler for Zephyr NET Connection Manager events. */ net_mgmt_init_event_callback(&l4_cb, l4_event_handler, L4_EVENT_MASK); @@ -686,6 +706,16 @@ int main(void) return ret; } + /* Resend connection status if the sample is built for NATIVE_SIM. + * This is necessary because the network interface is automatically brought up + * at SYS_INIT() before main() is called. + * This means that NET_EVENT_L4_CONNECTED fires before the + * appropriate handler l4_event_handler() is registered. + */ + if (IS_ENABLED(CONFIG_BOARD_NATIVE_SIM)) { + conn_mgr_mon_resend_status(); + } + k_sem_take(&network_connected_sem, K_FOREVER); start_listener(); diff --git a/samples/net/https_client/README.rst b/samples/net/https_client/README.rst index f1f04a535ab4..ca5c1874b22f 100644 --- a/samples/net/https_client/README.rst +++ b/samples/net/https_client/README.rst @@ -75,7 +75,7 @@ To build the sample with Mbed TLS and TF-M for the nRF91 Series DKs, add the fol .. code-block:: none - -DOVERLAY_CONFIG=overlay-tfm-nrf91.conf + -DEXTRA_CONF_FILE=overlay-tfm-nrf91.conf The default packet data network (PDN) configuration is dual stack, which will use an IPv6 address if available (and IPv4 if not). @@ -83,15 +83,17 @@ On the nRF91 Series DKs, for testing IPv4 only, you might need to configure the .. code-block:: none - -DOVERLAY_CONFIG=overlay-pdn-nrf91-ipv4.conf + -DEXTRA_CONF_FILE=overlay-pdn-nrf91-ipv4.conf Testing ======= After programming the sample to your development kit, test it by performing the following steps: -1. Connect the USB cable and power on or reset your DK. -#. Open a terminal emulator and observe that the sample starts, provisions certificates, connects to the network and to example.com, and then sends an HTTP HEAD request. +1. |connect_kit| +#. Power on or reset the kit. +#. |connect_terminal| +#. Observe that the sample starts, provisions certificates, connects to the network and to example.com, and then sends an HTTP HEAD request. #. Observe that the HTTP HEAD request returns ``HTTP/1.1 200 OK``. Sample output diff --git a/samples/net/https_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/https_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index 9b3cdc5961fd..bd12d2ed3a83 100644 --- a/samples/net/https_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/https_client/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -42,7 +42,6 @@ CONFIG_NET_SOCKETS_DNS_TIMEOUT=30000 CONFIG_NET_NATIVE=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_SOCKETS_OFFLOAD=n CONFIG_NET_DHCPV4=y diff --git a/samples/net/https_client/prj.conf b/samples/net/https_client/prj.conf index e65e147cd172..365fc2dea54f 100644 --- a/samples/net/https_client/prj.conf +++ b/samples/net/https_client/prj.conf @@ -14,7 +14,7 @@ CONFIG_LOG=y # Network CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y -CONFIG_NET_SOCKETS_POSIX_NAMES=y +CONFIG_POSIX_API=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y CONFIG_NET_CONNECTION_MANAGER=y diff --git a/samples/net/https_client/sample.yaml b/samples/net/https_client/sample.yaml index 6077901ec024..d2fe3f40a4c5 100644 --- a/samples/net/https_client/sample.yaml +++ b/samples/net/https_client/sample.yaml @@ -4,36 +4,36 @@ tests: sample.net.https_client: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - nrf7002dk/nrf5340/cpuapp/ns tags: ci_build sample.net.https_client.lte.tfm-mbedtls: build_only: true extra_args: OVERLAY_CONFIG="overlay-tfm-nrf91.conf" integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns tags: ci_build sample.net.https_client.lte.pdn-ipv4: build_only: true extra_args: OVERLAY_CONFIG="overlay-pdn-nrf91-ipv4.conf" integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns tags: ci_build diff --git a/samples/net/https_client/src/main.c b/samples/net/https_client/src/main.c index 6031221a2c13..7f96dc81c71c 100644 --- a/samples/net/https_client/src/main.c +++ b/samples/net/https_client/src/main.c @@ -12,6 +12,13 @@ #include #include +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #if CONFIG_MODEM_KEY_MGMT #include #endif diff --git a/samples/net/mqtt/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/mqtt/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index b6aa314f79f9..5c51873853a3 100644 --- a/samples/net/mqtt/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/mqtt/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -22,9 +22,6 @@ CONFIG_DK_LIBRARY=y CONFIG_NRF700X_RX_NUM_BUFS=16 CONFIG_NRF700X_MAX_TX_AGGREGATION=4 -# Set newlib C to prevent build error complaining that string.h is not supported -CONFIG_NEWLIB_LIBC=y - # Wi-Fi CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y @@ -48,12 +45,10 @@ CONFIG_MBEDTLS_HEAP_SIZE=16384 # NET sockets CONFIG_NET_L2_ETHERNET=y -CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048 CONFIG_NET_UDP=y CONFIG_NET_SOCKETS_OFFLOAD=n CONFIG_NET_DHCPV4=y CONFIG_NET_CONTEXT_SNDTIMEO=y -CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096 # DNS CONFIG_DNS_RESOLVER=y diff --git a/samples/net/mqtt/doc/description.rst b/samples/net/mqtt/doc/description.rst index 8981c83ab122..f2744df39362 100644 --- a/samples/net/mqtt/doc/description.rst +++ b/samples/net/mqtt/doc/description.rst @@ -120,20 +120,20 @@ In addition, the sample provides the following overlay configuration files, whic They are located in :file:`samples/net/mqtt` folder. -To add a specific overlay configuration file to the build, add the ``-- -DOVERLAY_CONFIG=`` flag to your build. +To add a specific overlay configuration file to the build, add the ``-- -DEXTRA_CONF_FILE=`` flag to your build. See :ref:`cmake_options` for instructions on how to add this option to your build. For example, when building with the command line, the following commands can be used for the nRF9160 DK: .. code-block:: console - west build -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-tls-nrf91.conf + west build -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE=overlay-tls-nrf91.conf For Thingy:91, with TLS and debug logging enabled for the :ref:`lib_mqtt_helper` library (for more information, see the related :ref:`sample output `): .. code-block:: console - west build -b thingy91_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-tls-nrf91.conf -DCONFIG_MQTT_HELPER_LOG_LEVEL_DBG=y + west build -b thingy91/nrf9160/ns -- -DEXTRA_CONF_FILE=overlay-tls-nrf91.conf -DCONFIG_MQTT_HELPER_LOG_LEVEL_DBG=y .. include:: /libraries/modem/nrf_modem_lib/nrf_modem_lib_trace.rst :start-after: modem_lib_sending_traces_UART_start diff --git a/samples/net/mqtt/overlay-tls-native_posix.conf b/samples/net/mqtt/overlay-tls-native_posix.conf index e6aadc019c03..6ec4cd47c367 100644 --- a/samples/net/mqtt/overlay-tls-native_posix.conf +++ b/samples/net/mqtt/overlay-tls-native_posix.conf @@ -12,9 +12,10 @@ CONFIG_MQTT_HELPER_PORT=8883 CONFIG_MQTT_KEEPALIVE=30 # Credentials located under /src/modules/transport/credentials/ will be automatically -# provisioned prior to connecting to the server. +# provisioned prior to connecting to the server by the MQTT helper library. CONFIG_MQTT_HELPER_SEC_TAG=955 CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES=y +CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER="src/modules/transport/credentials" # Native network stack CONFIG_MBEDTLS=y diff --git a/samples/net/mqtt/overlay-tls-nrf70.conf b/samples/net/mqtt/overlay-tls-nrf70.conf index 9a7418b6fb49..cf71b6084289 100644 --- a/samples/net/mqtt/overlay-tls-nrf70.conf +++ b/samples/net/mqtt/overlay-tls-nrf70.conf @@ -12,9 +12,10 @@ CONFIG_MQTT_HELPER_PORT=8883 CONFIG_MQTT_KEEPALIVE=30 # Credentials located under /src/modules/transport/credentials/ will be automatically -# provisioned prior to connecting to the server. +# provisioned prior to connecting to the server by the MQTT helper library. CONFIG_MQTT_HELPER_SEC_TAG=955 CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES=y +CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER="src/modules/transport/credentials" # Native network stack CONFIG_NRF_SECURITY=y diff --git a/samples/net/mqtt/sample.yaml b/samples/net/mqtt/sample.yaml index 855762a9ef71..c49d8d7c5e32 100644 --- a/samples/net/mqtt/sample.yaml +++ b/samples/net/mqtt/sample.yaml @@ -5,40 +5,40 @@ tests: build_only: true build_on_all: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns - native_posix tags: ci_build sample.net.mqtt.nrf70.tls: build_only: true build_on_all: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp_ns - platform_allow: nrf7002dk_nrf5340_cpuapp_ns + - nrf7002dk/nrf5340/cpuapp/ns + platform_allow: nrf7002dk/nrf5340/cpuapp/ns tags: ci_build extra_args: EXTRA_CONF_FILE=overlay-tls-nrf70.conf sample.net.mqtt.nrf91.tls: build_only: true build_on_all: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns tags: ci_build extra_args: EXTRA_CONF_FILE=overlay-tls-nrf91.conf sample.net.mqtt.native_posix.tls: diff --git a/samples/net/mqtt/src/modules/transport/CMakeLists.txt b/samples/net/mqtt/src/modules/transport/CMakeLists.txt index 69b22d8f4db8..87dd57db7bd0 100644 --- a/samples/net/mqtt/src/modules/transport/CMakeLists.txt +++ b/samples/net/mqtt/src/modules/transport/CMakeLists.txt @@ -13,17 +13,3 @@ add_subdirectory(client_id) # The library provisions credentials placed in the src/transport/credentials/ folder to # the nRF91 modem. add_subdirectory_ifdef(CONFIG_MODEM_KEY_MGMT credentials_provision) - -# Make the folder that contains the CA certificate for "test.mosquitto.org" global so that it can -# be located by the MQTT helper library / local credential provision library. -# -# The MQTT helper library provisions the certificate -# to the Mbed TLS stack for Native Posix and nRF7 Series devices. -# -# The credential provision library provisions the certificate -# to the modem's network stack for nRF91 Series builds. -# -# CONFIG_MODEM_KEY_MGMT and CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES are mutually exclusive. -# -zephyr_include_directories_ifdef(CONFIG_MODEM_KEY_MGMT credentials) -zephyr_include_directories_ifdef(CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES credentials) diff --git a/samples/net/mqtt/src/modules/transport/credentials/ca-cert.pem b/samples/net/mqtt/src/modules/transport/credentials/ca-cert.pem index 7b0cbc7d6bba..e76dbd85598c 100644 --- a/samples/net/mqtt/src/modules/transport/credentials/ca-cert.pem +++ b/samples/net/mqtt/src/modules/transport/credentials/ca-cert.pem @@ -1,26 +1,24 @@ -/* Certificate Authority (CA) for mosquitto.org */ - -"-----BEGIN CERTIFICATE-----\n" -"MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL\n" -"BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG\n" -"A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU\n" -"BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv\n" -"by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE\n" -"BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES\n" -"MBAGA1UECgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVp\n" -"dHRvLm9yZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzCCASIwDQYJ\n" -"KoZIhvcNAQEBBQADggEPADCCAQoCggEBAME0HKmIzfTOwkKLT3THHe+ObdizamPg\n" -"UZmD64Tf3zJdNeYGYn4CEXbyP6fy3tWc8S2boW6dzrH8SdFf9uo320GJA9B7U1FW\n" -"Te3xda/Lm3JFfaHjkWw7jBwcauQZjpGINHapHRlpiCZsquAthOgxW9SgDgYlGzEA\n" -"s06pkEFiMw+qDfLo/sxFKB6vQlFekMeCymjLCbNwPJyqyhFmPWwio/PDMruBTzPH\n" -"3cioBnrJWKXc3OjXdLGFJOfj7pP0j/dr2LH72eSvv3PQQFl90CZPFhrCUcRHSSxo\n" -"E6yjGOdnz7f6PveLIB574kQORwt8ePn0yidrTC1ictikED3nHYhMUOUCAwEAAaNT\n" -"MFEwHQYDVR0OBBYEFPVV6xBUFPiGKDyo5V3+Hbh4N9YSMB8GA1UdIwQYMBaAFPVV\n" -"6xBUFPiGKDyo5V3+Hbh4N9YSMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL\n" -"BQADggEBAGa9kS21N70ThM6/Hj9D7mbVxKLBjVWe2TPsGfbl3rEDfZ+OKRZ2j6AC\n" -"6r7jb4TZO3dzF2p6dgbrlU71Y/4K0TdzIjRj3cQ3KSm41JvUQ0hZ/c04iGDg/xWf\n" -"+pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK\n" -"sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839\n" -"LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE\n" -"m/XriWr/Cq4h/JfB7NTsezVslgkBaoU=\n" -"-----END CERTIFICATE-----" +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL +BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG +A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU +BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv +by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE +BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES +MBAGA1UECgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVp +dHRvLm9yZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAME0HKmIzfTOwkKLT3THHe+ObdizamPg +UZmD64Tf3zJdNeYGYn4CEXbyP6fy3tWc8S2boW6dzrH8SdFf9uo320GJA9B7U1FW +Te3xda/Lm3JFfaHjkWw7jBwcauQZjpGINHapHRlpiCZsquAthOgxW9SgDgYlGzEA +s06pkEFiMw+qDfLo/sxFKB6vQlFekMeCymjLCbNwPJyqyhFmPWwio/PDMruBTzPH +3cioBnrJWKXc3OjXdLGFJOfj7pP0j/dr2LH72eSvv3PQQFl90CZPFhrCUcRHSSxo +E6yjGOdnz7f6PveLIB574kQORwt8ePn0yidrTC1ictikED3nHYhMUOUCAwEAAaNT +MFEwHQYDVR0OBBYEFPVV6xBUFPiGKDyo5V3+Hbh4N9YSMB8GA1UdIwQYMBaAFPVV +6xBUFPiGKDyo5V3+Hbh4N9YSMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBAGa9kS21N70ThM6/Hj9D7mbVxKLBjVWe2TPsGfbl3rEDfZ+OKRZ2j6AC +6r7jb4TZO3dzF2p6dgbrlU71Y/4K0TdzIjRj3cQ3KSm41JvUQ0hZ/c04iGDg/xWf ++pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK +sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839 +LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE +m/XriWr/Cq4h/JfB7NTsezVslgkBaoU= +-----END CERTIFICATE----- diff --git a/samples/net/udp/boards/nrf7002dk_nrf5340_cpuapp_ns.conf b/samples/net/udp/boards/nrf7002dk_nrf5340_cpuapp_ns.conf index 902d28b3bd63..ccdd2b1f86b3 100644 --- a/samples/net/udp/boards/nrf7002dk_nrf5340_cpuapp_ns.conf +++ b/samples/net/udp/boards/nrf7002dk_nrf5340_cpuapp_ns.conf @@ -7,7 +7,6 @@ # General CONFIG_POSIX_CLOCK=y CONFIG_HEAP_MEM_POOL_SIZE=81920 -CONFIG_NEWLIB_LIBC=y # Wi-Fi CONFIG_WIFI=y diff --git a/samples/net/udp/boards/nrf9151dk_nrf9151_ns.conf b/samples/net/udp/boards/nrf9151dk_nrf9151_ns.conf index ed967408596c..8a3650dd1496 100644 --- a/samples/net/udp/boards/nrf9151dk_nrf9151_ns.conf +++ b/samples/net/udp/boards/nrf9151dk_nrf9151_ns.conf @@ -39,4 +39,3 @@ CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="1001" ## RAI CONFIG_LTE_RAI_REQ=n -CONFIG_LTE_RAI_REQ_VALUE="4" diff --git a/samples/net/udp/boards/nrf9160dk_nrf9160_ns.conf b/samples/net/udp/boards/nrf9160dk_nrf9160_ns.conf index f3f20ec4fd48..b60cf688b3d4 100644 --- a/samples/net/udp/boards/nrf9160dk_nrf9160_ns.conf +++ b/samples/net/udp/boards/nrf9160dk_nrf9160_ns.conf @@ -39,4 +39,3 @@ CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="1001" ## RAI CONFIG_LTE_RAI_REQ=n -CONFIG_LTE_RAI_REQ_VALUE="4" diff --git a/samples/net/udp/boards/nrf9161dk_nrf9161_ns.conf b/samples/net/udp/boards/nrf9161dk_nrf9161_ns.conf index f3f20ec4fd48..b60cf688b3d4 100644 --- a/samples/net/udp/boards/nrf9161dk_nrf9161_ns.conf +++ b/samples/net/udp/boards/nrf9161dk_nrf9161_ns.conf @@ -39,4 +39,3 @@ CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="1001" ## RAI CONFIG_LTE_RAI_REQ=n -CONFIG_LTE_RAI_REQ_VALUE="4" diff --git a/samples/net/udp/boards/thingy91_nrf9160_ns.conf b/samples/net/udp/boards/thingy91_nrf9160_ns.conf index f3f20ec4fd48..b60cf688b3d4 100644 --- a/samples/net/udp/boards/thingy91_nrf9160_ns.conf +++ b/samples/net/udp/boards/thingy91_nrf9160_ns.conf @@ -39,4 +39,3 @@ CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="1001" ## RAI CONFIG_LTE_RAI_REQ=n -CONFIG_LTE_RAI_REQ_VALUE="4" diff --git a/samples/net/udp/prj.conf b/samples/net/udp/prj.conf index 436b40c250fe..c870b5f3fc62 100644 --- a/samples/net/udp/prj.conf +++ b/samples/net/udp/prj.conf @@ -12,6 +12,7 @@ CONFIG_NETWORKING=y CONFIG_NET_NATIVE=y CONFIG_NET_IPV4=y CONFIG_NET_SOCKETS=y +CONFIG_POSIX_API=y CONFIG_NET_CONNECTION_MANAGER=y # Heap and stacks diff --git a/samples/net/udp/sample.yaml b/samples/net/udp/sample.yaml index 4de13873f5e0..eb770e7b5203 100644 --- a/samples/net/udp/sample.yaml +++ b/samples/net/udp/sample.yaml @@ -4,17 +4,17 @@ tests: sample.net.udp: build_only: true integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns - - thingy91_nrf9160_ns - - nrf7002dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns + - thingy91/nrf9160/ns + - nrf7002dk/nrf5340/cpuapp/ns tags: ci_build sample.net.udp.emulation: build_only: true diff --git a/samples/net/udp/src/main.c b/samples/net/udp/src/main.c index e0ab907ef32f..f70ba5d11dab 100644 --- a/samples/net/udp/src/main.c +++ b/samples/net/udp/src/main.c @@ -13,6 +13,12 @@ #include #include +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#endif + LOG_MODULE_REGISTER(udp_sample, CONFIG_UDP_SAMPLE_LOG_LEVEL); #define UDP_IP_HEADER_SIZE 28 diff --git a/samples/nfc/record_launch_app/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/nfc/record_launch_app/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..fb628116bfe6 --- /dev/null +++ b/samples/nfc/record_launch_app/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/nfc/record_launch_app/sample.yaml b/samples/nfc/record_launch_app/sample.yaml index e9f41e9f2957..f2f5fe86e84f 100644 --- a/samples/nfc/record_launch_app/sample.yaml +++ b/samples/nfc/record_launch_app/sample.yaml @@ -5,10 +5,19 @@ tests: sample.nfc.launch_app: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nfc/record_text/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/nfc/record_text/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..fb628116bfe6 --- /dev/null +++ b/samples/nfc/record_text/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/nfc/record_text/sample.yaml b/samples/nfc/record_text/sample.yaml index c7377790981f..efb78319c029 100644 --- a/samples/nfc/record_text/sample.yaml +++ b/samples/nfc/record_text/sample.yaml @@ -5,10 +5,19 @@ tests: sample.nfc.record_text: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nfc/shell/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/nfc/shell/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..fb628116bfe6 --- /dev/null +++ b/samples/nfc/shell/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/nfc/shell/sample.yaml b/samples/nfc/shell/sample.yaml index 78de490e4205..ae8a56ff5da0 100644 --- a/samples/nfc/shell/sample.yaml +++ b/samples/nfc/shell/sample.yaml @@ -5,13 +5,19 @@ tests: sample.nfc.shell: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp platform_allow: > - nrf52840dk_nrf52840 - nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nfc/system_off/sample.yaml b/samples/nfc/system_off/sample.yaml index 6813ca5edd30..ce495b9384f4 100644 --- a/samples/nfc/system_off/sample.yaml +++ b/samples/nfc/system_off/sample.yaml @@ -5,10 +5,17 @@ tests: sample.nfc.system_off: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nfc/tag_reader/sample.yaml b/samples/nfc/tag_reader/sample.yaml index bd0121203014..2661716d1e18 100644 --- a/samples/nfc/tag_reader/sample.yaml +++ b/samples/nfc/tag_reader/sample.yaml @@ -5,8 +5,8 @@ tests: sample.nfc.tag_reader: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/nfc/tnep_poller/sample.yaml b/samples/nfc/tnep_poller/sample.yaml index 0ddb9a915b9e..45e3390bb8e4 100644 --- a/samples/nfc/tnep_poller/sample.yaml +++ b/samples/nfc/tnep_poller/sample.yaml @@ -5,8 +5,8 @@ tests: sample.nfc.tnep_poller: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/nfc/tnep_tag/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/nfc/tnep_tag/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..fb628116bfe6 --- /dev/null +++ b/samples/nfc/tnep_tag/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/nfc/tnep_tag/sample.yaml b/samples/nfc/tnep_tag/sample.yaml index e25d39e223e4..fc0b8d0168b5 100644 --- a/samples/nfc/tnep_tag/sample.yaml +++ b/samples/nfc/tnep_tag/sample.yaml @@ -5,10 +5,19 @@ tests: sample.nfc.tnep_tag: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nfc/writable_ndef_msg/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/nfc/writable_ndef_msg/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..fb628116bfe6 --- /dev/null +++ b/samples/nfc/writable_ndef_msg/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&nfct { + status = "okay"; + memory-regions = <&cpuapp_dma_region>; +}; diff --git a/samples/nfc/writable_ndef_msg/sample.yaml b/samples/nfc/writable_ndef_msg/sample.yaml index c545f6c7bbf6..260a0748fcdc 100644 --- a/samples/nfc/writable_ndef_msg/sample.yaml +++ b/samples/nfc/writable_ndef_msg/sample.yaml @@ -5,10 +5,19 @@ tests: sample.nfc.writable_ndef_msg: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54h20dk/nrf54h20/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + platform_allow: > + nrf52840dk/nrf52840 + nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54h20dk/nrf54h20/cpuapp + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp tags: ci_build diff --git a/samples/nrf5340/empty_app_core/sample.yaml b/samples/nrf5340/empty_app_core/sample.yaml index 4a6afaa16c3e..9329b1149c7b 100644 --- a/samples/nrf5340/empty_app_core/sample.yaml +++ b/samples/nrf5340/empty_app_core/sample.yaml @@ -5,7 +5,7 @@ tests: sample.nrf5340.empty_app_core.build: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp nrf7002dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp nrf7002dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/nrf5340/empty_net_core/sample.yaml b/samples/nrf5340/empty_net_core/sample.yaml index 33715ff26bcb..7ecbb2b46b98 100644 --- a/samples/nrf5340/empty_net_core/sample.yaml +++ b/samples/nrf5340/empty_net_core/sample.yaml @@ -5,7 +5,7 @@ tests: sample.nrf5340.empty_net_core.build: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - - thingy53_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + - thingy53/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet thingy53/nrf5340/cpunet tags: ci_build diff --git a/samples/nrf5340/extxip_smp_svr/linker_arm_extxip.ld b/samples/nrf5340/extxip_smp_svr/linker_arm_extxip.ld index 812ee60b07cb..48c2feab8739 100644 --- a/samples/nrf5340/extxip_smp_svr/linker_arm_extxip.ld +++ b/samples/nrf5340/extxip_smp_svr/linker_arm_extxip.ld @@ -19,6 +19,10 @@ #include #include + +/* Let SystemInit() be called in place of z_arm_platform_init() by default. */ +PROVIDE(z_arm_platform_init = SystemInit); + /* * nRF5340dk and thingy53 are shipping QSPI external flashes. * These memories are mapped beginning from 0x1000_0000 internal SoC memory diff --git a/samples/nrf5340/extxip_smp_svr/sample.yaml b/samples/nrf5340/extxip_smp_svr/sample.yaml index 8d512f4907bb..055e07957760 100644 --- a/samples/nrf5340/extxip_smp_svr/sample.yaml +++ b/samples/nrf5340/extxip_smp_svr/sample.yaml @@ -11,8 +11,8 @@ common: tests: sample.mcumgr.smp_svr.ext_xip: platform_allow: - - nrf5340dk_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp diff --git a/samples/nrf5340/multiprotocol_rpmsg/README.rst b/samples/nrf5340/multiprotocol_rpmsg/README.rst index dc5dd1f07020..44a8252bec9f 100644 --- a/samples/nrf5340/multiprotocol_rpmsg/README.rst +++ b/samples/nrf5340/multiprotocol_rpmsg/README.rst @@ -61,7 +61,7 @@ To see an example of this multi-image build on the command line, run the followi .. parsed-literal:: :class: highlight - west build -b nrf5340dk_nrf5340_cpuapp -p -- -DOVERLAY_CONFIG="overlay-802154.conf;overlay-bt.conf" + west build -b nrf5340dk/nrf5340/cpuapp -p -- -DEXTRA_CONF_FILE="overlay-802154.conf;overlay-bt.conf" .. include:: /includes/build_and_run.txt diff --git a/samples/nrf5340/multiprotocol_rpmsg/sample.yaml b/samples/nrf5340/multiprotocol_rpmsg/sample.yaml index e390a10442dd..8ae556a925fa 100644 --- a/samples/nrf5340/multiprotocol_rpmsg/sample.yaml +++ b/samples/nrf5340/multiprotocol_rpmsg/sample.yaml @@ -6,6 +6,6 @@ tests: sample.nrf5340.multiprotocol_rpmsg.build: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build diff --git a/samples/nrf5340/netboot/sample.yaml b/samples/nrf5340/netboot/sample.yaml index 33b260b5a036..f0baec5a585e 100644 --- a/samples/nrf5340/netboot/sample.yaml +++ b/samples/nrf5340/netboot/sample.yaml @@ -4,13 +4,13 @@ tests: sample.nrf5340.netboot: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build sample.nrf5340.netboot.minimal_size: build_only: true extra_args: OVERLAY_CONFIG=overlay-minimal-size.conf integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build diff --git a/samples/nrf5340/remote_shell/sample.yaml b/samples/nrf5340/remote_shell/sample.yaml index 4e069a947c28..d7390a1a1551 100644 --- a/samples/nrf5340/remote_shell/sample.yaml +++ b/samples/nrf5340/remote_shell/sample.yaml @@ -5,14 +5,14 @@ tests: sample.nrf5340.remote_ipc_shell.empty_app_core.build: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf5340.remote_ipc_shell.uart.build: build_only: true extra_args: > CONF_FILE=prj_uart.conf DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_uart.overlay integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/nrf_profiler/sample.yaml b/samples/nrf_profiler/sample.yaml index 99953c66c1b8..d83cc908a6dd 100644 --- a/samples/nrf_profiler/sample.yaml +++ b/samples/nrf_profiler/sample.yaml @@ -5,14 +5,16 @@ tests: sample.nrf_profiler: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf21540dk/nrf52840 platform_exclude: native_posix qemu_x86 qemu_cortex_m3 tags: ci_build diff --git a/samples/nrf_rpc/entropy_nrf53/cpuapp/sample.yaml b/samples/nrf_rpc/entropy_nrf53/cpuapp/sample.yaml index 66c67ef6c2b8..d869d3663209 100644 --- a/samples/nrf_rpc/entropy_nrf53/cpuapp/sample.yaml +++ b/samples/nrf_rpc/entropy_nrf53/cpuapp/sample.yaml @@ -5,5 +5,5 @@ tests: sample.nrf_rpc.entropy_cpuapp: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp diff --git a/samples/nrf_rpc/entropy_nrf53/cpunet/sample.yaml b/samples/nrf_rpc/entropy_nrf53/cpunet/sample.yaml index 16481a35a21f..265258b18182 100644 --- a/samples/nrf_rpc/entropy_nrf53/cpunet/sample.yaml +++ b/samples/nrf_rpc/entropy_nrf53/cpunet/sample.yaml @@ -5,5 +5,5 @@ tests: sample.nrf_rpc.entropy_cpunet: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet diff --git a/samples/openthread/cli/README.rst b/samples/openthread/cli/README.rst index 3e6c0f7e9419..7b03794255e5 100644 --- a/samples/openthread/cli/README.rst +++ b/samples/openthread/cli/README.rst @@ -466,7 +466,7 @@ To test the Thread 1.2 and Thread 1.3 features, complete the following steps: .. code-block:: console - uart:~$ ot csl period 3125 + uart:~$ ot csl period 500000 Done #. Send an ICMPv6 Echo Request from the leader kit to the link-local address of the router kit: diff --git a/samples/openthread/cli/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/openthread/cli/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..710341bbac45 --- /dev/null +++ b/samples/openthread/cli/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_GPIO_SHELL=n + +CONFIG_NRF_802154_TEMPERATURE_UPDATE=n diff --git a/samples/openthread/cli/prj.conf b/samples/openthread/cli/prj.conf index 3df5af3b7a53..a898279252c6 100644 --- a/samples/openthread/cli/prj.conf +++ b/samples/openthread/cli/prj.conf @@ -18,7 +18,4 @@ CONFIG_NET_L2_OPENTHREAD=y # Generic networking options CONFIG_NETWORKING=y -CONFIG_MBEDTLS_SHA1_C=n -CONFIG_FPU=y - CONFIG_GPIO_SHELL=y diff --git a/samples/openthread/cli/sample.yaml b/samples/openthread/cli/sample.yaml index 43b2343106bd..377abe1c2029 100644 --- a/samples/openthread/cli/sample.yaml +++ b/samples/openthread/cli/sample.yaml @@ -7,89 +7,101 @@ tests: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf52840dongle_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf52840dongle/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp extra_args: > SNIPPET="ci;logging;multiprotocol;tcp" integration_platforms: - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.openthread.cli.singleprotocol: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp extra_args: > SNIPPET="ci;logging;tcp" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.openthread.cli.usb: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET="ci;logging;multiprotocol;tcp;usb" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns sample.openthread.cli.low_power: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp + nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp extra_args: > SNIPPET="ci;low_power" integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp # Build integration regression protection. sample.nrf_security.openthread.integration: build_only: true platform_allow: > - nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET=ci CONFIG_NRF_SECURITY=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf52840dk/nrf52840 sample.openthread.cli.tcat: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp extra_args: > SNIPPET="ci;tcat;tcp" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp diff --git a/samples/openthread/coap_client/sample.yaml b/samples/openthread/coap_client/sample.yaml index d46902d14233..4a6d3a9a0155 100644 --- a/samples/openthread/coap_client/sample.yaml +++ b/samples/openthread/coap_client/sample.yaml @@ -7,46 +7,46 @@ tests: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET="ci;logging" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns sample.openthread.coap_client.mtd: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET="ci;logging;mtd" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns sample.openthread.coap_client.mtd.multiprotocol_ble: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET="ci;logging;mtd;multiprotocol_ble" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns diff --git a/samples/openthread/coap_server/sample.yaml b/samples/openthread/coap_server/sample.yaml index f866c08deddd..e4eec4ff8817 100644 --- a/samples/openthread/coap_server/sample.yaml +++ b/samples/openthread/coap_server/sample.yaml @@ -7,14 +7,14 @@ tests: build_only: true tags: ci_build platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpuapp - nrf5340dk_nrf5340_cpuapp_ns + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpuapp + nrf5340dk/nrf5340/cpuapp/ns extra_args: > SNIPPET="ci;logging" integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns diff --git a/samples/openthread/coprocessor/README.rst b/samples/openthread/coprocessor/README.rst index d1ee210c05db..0a836b4f83a1 100644 --- a/samples/openthread/coprocessor/README.rst +++ b/samples/openthread/coprocessor/README.rst @@ -43,7 +43,7 @@ The sample demonstrates using a co-processor target on the MCU to communicate wi According to the co-processor architecture, the MCU part must cooperate with user higher layer process to establish the complete full stack application. The sample shows how to set up the connection between the co-processor and the host. -This sample comes with the :ref:`full set of OpenThread functionalities ` enabled (:kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER`). +By default, this sample comes with the :ref:`RCP set of OpenThread functionalities ` enabled (:kconfig:option:`CONFIG_OPENTHREAD_NORDIC_LIBRARY_RCP`). .. _ot_coprocessor_sample_logging: @@ -160,4 +160,4 @@ This sample uses the following Zephyr libraries: * ``include/logging/log.h`` -* :ref:`zephyr:bluetooth-hci`: +* :ref:`zephyr:bluetooth-hci` diff --git a/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..63649eada92a --- /dev/null +++ b/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FPU=n diff --git a/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay new file mode 100644 index 000000000000..0d70d80472f4 --- /dev/null +++ b/samples/openthread/coprocessor/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay @@ -0,0 +1,16 @@ +/* Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart20 { + current-speed = <115200>; + status = "okay"; + hw-flow-control; +}; + + / { + chosen { + zephyr,ot-uart = &uart20; + }; +}; diff --git a/samples/openthread/coprocessor/prj.conf b/samples/openthread/coprocessor/prj.conf index 6224fa4dbffd..082b9623f149 100644 --- a/samples/openthread/coprocessor/prj.conf +++ b/samples/openthread/coprocessor/prj.conf @@ -8,12 +8,12 @@ CONFIG_OPENTHREAD_COPROCESSOR=y CONFIG_OPENTHREAD_COPROCESSOR_RCP=y +# Nordic feature set +CONFIG_OPENTHREAD_NORDIC_LIBRARY_RCP=y + # Increase logging thread stack size due to Spinel backend needs CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048 -# Enable OpenThread features set -CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y - CONFIG_NET_L2_OPENTHREAD=y # Generic networking options @@ -21,6 +21,3 @@ CONFIG_NETWORKING=y # Disable MAC key export using PSA crypto API on RCP platform CONFIG_OPENTHREAD_CRYPTO_PSA=n - -CONFIG_MBEDTLS_SHA1_C=n -CONFIG_FPU=y diff --git a/samples/openthread/coprocessor/sample.yaml b/samples/openthread/coprocessor/sample.yaml index 1d2b0222c4e5..2b18c7bc5905 100644 --- a/samples/openthread/coprocessor/sample.yaml +++ b/samples/openthread/coprocessor/sample.yaml @@ -7,31 +7,35 @@ tests: build_only: true tags: ci_build platform_allow: > - nrf52833dk_nrf52833 - nrf52840dk_nrf52840 - nrf52840dongle_nrf52840 - nrf21540dk_nrf52840 + nrf52833dk/nrf52833 + nrf52840dk/nrf52840 + nrf52840dongle/nrf52840 + nrf21540dk/nrf52840 + nrf54l15pdk/nrf54l15/cpuapp + nrf54l15pdk@0.3.0/nrf54l15/cpuapp extra_args: > SNIPPET="ci;logging;vendor_hook" integration_platforms: - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf52840dongle_nrf52840 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp sample.openthread.coprocessor.usb: build_only: true tags: ci_build platform_allow: > - nrf52833dk_nrf52833 - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 + nrf52833dk/nrf52833 + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 extra_args: > SNIPPET="ci;usb" integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf21540dk/nrf52840 sample.openthread.coprocessor.hci: build_only: true @@ -39,7 +43,7 @@ tests: extra_args: > SNIPPET="ci;hci" platform_allow: > - nrf52840dk_nrf52840 - nrf21540dk_nrf52840 + nrf52840dk/nrf52840 + nrf21540dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 diff --git a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf index 381867f8be5d..4829f8918764 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf21540dk_nrf52840.conf @@ -5,3 +5,11 @@ # CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf new file mode 100644 index 000000000000..4829f8918764 --- /dev/null +++ b/samples/peripheral/802154_phy_test/boards/nrf52833dk_nrf52833.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf index 381867f8be5d..4829f8918764 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf52840dk_nrf52840.conf @@ -5,3 +5,11 @@ # CONFIG_SHELL_PROMPT_UART=">" + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 + +# Allow sharing the RTC between IEEE 802.15.4 and Zephyr +CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 diff --git a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf index 8e1acc035f03..e28fb1557a77 100644 --- a/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf +++ b/samples/peripheral/802154_phy_test/boards/nrf5340dk_nrf5340_cpunet.conf @@ -26,3 +26,8 @@ CONFIG_NCS_SAMPLE_REMOTE_SHELL_CHILD_IMAGE=y CONFIG_APP_RPC=y CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2 + +# nrfx drivers configuration: +CONFIG_NRFX_POWER=y # enable DC/DC support +CONFIG_NRFX_RNG=y # enable RNG +CONFIG_NRFX_TIMER2=y # enable TIMER2 diff --git a/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..f6b0c2b8180c --- /dev/null +++ b/samples/peripheral/802154_phy_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SHELL_PROMPT_UART=">" + +# currently unsupported for nRF54L15 +CONFIG_PTT_CACHE_MGMT=n + +# nrfx drivers configuration: +CONFIG_NRFX_TIMER20=y # enable TIMER2 +CONFIG_NRFX_DPPI=y # enable DPPIC diff --git a/samples/peripheral/802154_phy_test/prj.conf b/samples/peripheral/802154_phy_test/prj.conf index df6e49c139aa..05b6bfae2721 100644 --- a/samples/peripheral/802154_phy_test/prj.conf +++ b/samples/peripheral/802154_phy_test/prj.conf @@ -11,23 +11,12 @@ CONFIG_LOG_BACKEND_UART=n # Enable temperature sensor CONFIG_NRFX_TEMP=y -# Enable DC/DC Support -CONFIG_NRFX_POWER=y - -# Enable RNG -CONFIG_NRFX_RNG=y # Use XOSHIRO PRNG CONFIG_XOSHIRO_RANDOM_GENERATOR=y -# Enable Timer -CONFIG_NRFX_TIMER2=y - # Enabling radio driver CONFIG_NRF_802154_RADIO_DRIVER=y -# Allow sharing the RTC between IEEE 802.15.4 and Zephyr -CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=3 - # Enable ring buffers CONFIG_RING_BUFFER=y diff --git a/samples/peripheral/802154_phy_test/sample.yaml b/samples/peripheral/802154_phy_test/sample.yaml index 316bf413b363..ccf1af5ea398 100644 --- a/samples/peripheral/802154_phy_test/sample.yaml +++ b/samples/peripheral/802154_phy_test/sample.yaml @@ -5,26 +5,27 @@ tests: sample.peripheral.802154_phy_test: build_only: true integration_platforms: - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf52833dk_nrf52833 nrf52840dk_nrf52840 nrf21540dk_nrf52840 - nrf5340dk_nrf5340_cpunet + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpunet + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf52833dk/nrf52833 nrf52840dk/nrf52840 nrf21540dk/nrf52840 + nrf5340dk/nrf5340/cpunet nrf54l15pdk/nrf54l15/cpuapp tags: ci_build ci_rs_build ci_rs_weekly sample.peripheral.802154_phy_test.ant_div_mode_auto: build_only: true integration_platforms: - - nrf21540dk_nrf52840 - platform_allow: nrf21540dk_nrf52840 + - nrf21540dk/nrf52840 + platform_allow: nrf21540dk/nrf52840 tags: ci_build ci_rs_build ci_rs_weekly extra_args: CONFIG_PTT_ANTENNA_DIVERSITY=y CONFIG_PTT_ANT_MODE_AUTO=y sample.peripheral.802154_phy_test.ant_div_mode_manual: build_only: true integration_platforms: - - nrf21540dk_nrf52840 - platform_allow: nrf21540dk_nrf52840 + - nrf21540dk/nrf52840 + platform_allow: nrf21540dk/nrf52840 tags: ci_build ci_rs_build ci_rs_weekly ci_rs_integration extra_args: CONFIG_PTT_ANTENNA_DIVERSITY=y CONFIG_PTT_ANT_MODE_MANUAL=y diff --git a/samples/peripheral/802154_phy_test/src/comm_proc.c b/samples/peripheral/802154_phy_test/src/comm_proc.c index 21f2b6e47ec0..9a2f4b2ffc37 100644 --- a/samples/peripheral/802154_phy_test/src/comm_proc.c +++ b/samples/peripheral/802154_phy_test/src/comm_proc.c @@ -41,7 +41,7 @@ static int cmd_custom(const struct shell *shell_inst, size_t argc, char **argv) strncat(cmd_buf, argv[i], max_append_len); if (i < (argc - 1)) { - strncat(cmd_buf, " ", 1); + strcat(cmd_buf, " "); } } diff --git a/samples/peripheral/802154_phy_test/src/periph_proc.c b/samples/peripheral/802154_phy_test/src/periph_proc.c index c9df4e1ec738..f32026257a0c 100644 --- a/samples/peripheral/802154_phy_test/src/periph_proc.c +++ b/samples/peripheral/802154_phy_test/src/periph_proc.c @@ -41,7 +41,11 @@ LOG_MODULE_REGISTER(periph); #if IS_ENABLED(CONFIG_PTT_CLK_OUT) /* Timer instance used for HFCLK output */ +#if defined(NRF52_SERIES) || defined(NRF53_SERIES) #define PTT_CLK_TIMER 2 +#elif defined(NRF54L_SERIES) +#define PTT_CLK_TIMER 20 +#endif static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(PTT_CLK_TIMER); @@ -50,12 +54,22 @@ static nrfx_timer_t clk_timer = NRFX_TIMER_INSTANCE(PTT_CLK_TIMER); [DT_PROP(gpio_node, port)] = \ NRFX_GPIOTE_INSTANCE(DT_PROP(GPIOTE_NODE(gpio_node), instance)), +#define COND_GPIOTE_INST_AND_COMMA(gpio_node) \ + COND_CODE_1(DT_NODE_HAS_PROP(gpio_node, gpiote_instance), \ + (GPIOTE_INST_AND_COMMA(gpio_node)), \ + ()) + static const nrfx_gpiote_t gpiote_inst[GPIO_COUNT] = { - DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, GPIOTE_INST_AND_COMMA) + DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio, COND_GPIOTE_INST_AND_COMMA) }; #define NRF_GPIOTE_FOR_GPIO(idx) &gpiote_inst[idx] #define NRF_GPIOTE_FOR_PSEL(psel) &gpiote_inst[psel >> 5] + +static inline bool gpiote_is_valid(const nrfx_gpiote_t *gpiote) +{ + return gpiote->p_reg != NULL; +} #endif /* IS_ENABLED(CONFIG_PTT_CLK_OUT) */ static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios); @@ -94,6 +108,10 @@ void periph_init(void) for (int i = 0; i < GPIO_COUNT; ++i) { const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_GPIO(i); + if (!gpiote_is_valid(gpiote)) { + continue; + } + if (!nrfx_gpiote_init_check(gpiote)) { err_code = nrfx_gpiote_init(gpiote, 0); NRFX_ASSERT(err_code); @@ -127,7 +145,7 @@ bool ptt_clk_out_ext(uint8_t pin, bool mode) nrfx_err_t err; const nrfx_gpiote_t *gpiote = NRF_GPIOTE_FOR_PSEL(pin); - if (!nrf_gpio_pin_present_check(pin)) { + if (!nrf_gpio_pin_present_check(pin) || !gpiote_is_valid(gpiote)) { return false; } diff --git a/samples/peripheral/802154_sniffer/sample.yaml b/samples/peripheral/802154_sniffer/sample.yaml index e1100b9e705d..c014b1d18b64 100644 --- a/samples/peripheral/802154_sniffer/sample.yaml +++ b/samples/peripheral/802154_sniffer/sample.yaml @@ -5,8 +5,8 @@ tests: sample.peripheral.802154_sniffer: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52840dongle_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52840dongle_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52840dongle/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/peripheral/lpuart/sample.yaml b/samples/peripheral/lpuart/sample.yaml index 2fb4cdb159a2..9e5cafd5fc43 100644 --- a/samples/peripheral/lpuart/sample.yaml +++ b/samples/peripheral/lpuart/sample.yaml @@ -5,35 +5,35 @@ tests: sample.peripheral.lpuart: build_only: true platform_allow: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 platform_exclude: native_posix sample.peripheral.lpuart_nrf52840_debug: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: OVERLAY_CONFIG=debug.conf DTC_OVERLAY_FILE="boards/nrf52840dk_nrf52840.overlay;debug.overlay" tags: ci_build sample.peripheral.lpuart_nrf9160dk_debug: build_only: true - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns extra_args: OVERLAY_CONFIG=debug.conf DTC_OVERLAY_FILE="boards/nrf9160dk_nrf9160_ns.overlay;debug.overlay" tags: ci_build @@ -43,12 +43,12 @@ tests: extra_configs: - CONFIG_NRF_SW_LPUART_INT_DRIVEN=y integration_platforms: - - nrf52dk_nrf52832 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52dk_nrf52832 nrf52833dk_nrf52833 nrf52840dk_nrf52840 nrf9160dk_nrf9160_ns - nrf5340dk_nrf5340_cpuapp nrf21540dk_nrf52840 + - nrf52dk/nrf52832 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52dk/nrf52832 nrf52833dk/nrf52833 nrf52840dk/nrf52840 nrf9160dk/nrf9160/ns + nrf5340dk/nrf5340/cpuapp nrf21540dk/nrf52840 tags: ci_build diff --git a/samples/peripheral/radio_test/README.rst b/samples/peripheral/radio_test/README.rst index 4b0b54ca93ab..f805569a1846 100644 --- a/samples/peripheral/radio_test/README.rst +++ b/samples/peripheral/radio_test/README.rst @@ -43,7 +43,7 @@ nRF21540 front-end module .. include:: /includes/sample_dtm_radio_test_fem.txt -You can configure the nRF21540 front-end module (FEM) transmitted power gain, antenna output and activation delay using the main shell commands of the :ref:`radio_test_ui`. +You can configure the nRF21540 front-end module (FEM) transmitted power control, antenna output and activation delay using the main shell commands of the :ref:`radio_test_ui`. Skyworks front-end module ========================= @@ -58,7 +58,7 @@ Overview To run the tests, connect to the development kit through the serial port and send shell commands. Zephyr's :ref:`zephyr:shell_api` module is used to handle the commands. At any time during the tests, you can dynamically set the radio parameters, such as output power, bit rate, and channel. -In sweep mode, you can set the time for which the radio scans each channel from 1 millisecond to 99 milliseconds, in steps of 1 millisecond. +In sweep mode, you can set the time for which the radio scans each channel from one millisecond to 99 milliseconds, in steps of one millisecond. The sample also allows you to send a data pattern to another development kit. The sample first enables the high frequency crystal oscillator and configures the shell. @@ -95,7 +95,7 @@ User interface * - output_power - - Output power set. - If a front-end module is attached and the :kconfig:option:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC` Kconfig option is enabled, it has the same effect as the ``total_output_power`` command. + If a front-end module is attached and the :ref:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC ` Kconfig option is enabled, it has the same effect as the ``total_output_power`` command. * - parameters_print - - Print current delay, channel, and other parameters. @@ -137,7 +137,7 @@ User interface - Set total output power in dBm. This value includes SoC output power and front-end module gain. -Tx output power +TX output power =============== This sample has a few commands that you can use to test the device output power. @@ -148,21 +148,45 @@ The behavior of the commands vary depending on the hardware configuration and Kc * The ``output_power`` command sets the SoC output command with a subcommand set. The output power is set directly in the radio peripheral. -* Radio Test with front-end module support in default configuration (the :kconfig:option:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC` Kconfig option is enabled): +* Radio Test with front-end module support in default configuration (the :ref:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC ` Kconfig option is enabled): * The ``output_power`` command sets the total output power, including front-end module gain. * The ``total_output_power`` command sets the total output power, including front-end module gain with a value in dBm unit provided by user. - * For these commands, the radio peripheral and FEM gain is calculated and set automatically to meet your requirements. + * For these commands, the radio peripheral and FEM transmit power control is calculated and set automatically to meet your requirements. * If an exact output power value cannot be set, a lower value is used. -* Radio Test with front-end module support and manual Tx output power control (the :kconfig:option:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC` Kconfig option is disabled): +* Radio Test with front-end module support and manual TX output power control (the :ref:`CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC ` Kconfig option is disabled): * The ``output_power`` command sets the SoC output command with a subcommands set. - * The ``fem`` command with the ``tx_gain`` subcommand sets the front-end module gain to an arbitrary value for given front-end module. + * The ``fem`` command with the ``tx_power_control`` subcommand sets the front-end module transmit power control to a value for given specific front-end module. * You can use this configuration to perform tests on your hardware design. +Configuration +************* + +|config| + +Configuration options +===================== + +Check and configure the following Kconfig options: + +.. _CONFIG_RADIO_TEST_USB: + +CONFIG_RADIO_TEST_USB + Selects USB instead of UART as the Radio Test shell transport. + For nRF5340 the USB from application core is used as the communication interface. + +.. _CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC: + +CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC + Sets the SoC output power and front-end module gain to achieve the requested TX output power. + If the exact value cannot be achieved, power is set to closest value that does not exceed the limits. + If this option is disabled, set the SoC output power and FEM gain with separate commands. + Building and running ******************** + .. |sample path| replace:: :file:`samples/peripheral/radio_test` .. include:: /includes/build_and_run.txt @@ -176,21 +200,21 @@ Remote USB CDC ACM Shell variant ================================ This sample can run the remote IPC Service Shell through the USB on the nRF5340 DK application core. -For example, when building on the command line, you can do so as follows: +For example, when building on the command line, use the following command: .. code-block:: console - west build samples/peripheral/radio_test -b nrf5340dk_nrf5340_cpunet -- -DCONFIG_RADIO_TEST_USB=y + west build samples/peripheral/radio_test -b nrf5340dk/nrf5340/cpunet -- -DCONFIG_RADIO_TEST_USB=y You can also build this sample with the remote IPC Service Shell and support for the front-end module. You can use the following command: .. code-block:: console - west build samples/peripheral/radio_test -b nrf5340dk_nrf5340_cpunet -- -DSHIELD=nrf21540ek -DCONFIG_RADIO_TEST_USB=y + west build samples/peripheral/radio_test -b nrf5340dk/nrf5340/cpunet -- -DSHIELD=nrf21540ek -DCONFIG_RADIO_TEST_USB=y .. note:: - You can also build the sample with the remote IPC Service Shell for the |nRF7002DKnoref| using the ``nrf7002dk_nrf5340_cpunet`` build target in the commands. + You can also build the sample with the remote IPC Service Shell for the |nRF7002DKnoref| using the ``nrf7002dk_nrf5340_cpunet`` build target in the commands. .. _radio_test_testing: diff --git a/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf new file mode 100644 index 000000000000..40e6dcdd55f0 --- /dev/null +++ b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n + +CONFIG_CONSOLE_HANDLER=y +CONFIG_SHELL=y + +CONFIG_DYNAMIC_INTERRUPTS=y + +CONFIG_NRFX_TIMER020=y + +CONFIG_ENTROPY_GENERATOR=y diff --git a/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..80cd952d6b11 --- /dev/null +++ b/samples/peripheral/radio_test/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + /{ + chosen { + zephyr,console = &uart136; + zephyr,shell-uart = &uart136; + }; +}; + +&uart135 { + status = "disabled"; +}; + +&uart136 { + status = "okay"; + memory-regions = <&cpurad_dma_region>; +}; + +&dppic020 { + status = "okay"; + source-channels = < 0 1 >; + sink-channels = < 2 3 >; +}; diff --git a/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..35ec907203d2 --- /dev/null +++ b/samples/peripheral/radio_test/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n + +# Enable the necessary drivers +CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_DPPI=y diff --git a/samples/peripheral/radio_test/prj.conf b/samples/peripheral/radio_test/prj.conf index d2b43d791eb0..60a0629b60ca 100644 --- a/samples/peripheral/radio_test/prj.conf +++ b/samples/peripheral/radio_test/prj.conf @@ -12,5 +12,6 @@ CONFIG_DYNAMIC_INTERRUPTS=y CONFIG_NRFX_TIMER0=y CONFIG_ENTROPY_GENERATOR=y +CONFIG_NRF_SECURITY=y CONFIG_FEM_AL_LIB=y diff --git a/samples/peripheral/radio_test/sample.yaml b/samples/peripheral/radio_test/sample.yaml index fd161d5d373f..4c785b53da6a 100644 --- a/samples/peripheral/radio_test/sample.yaml +++ b/samples/peripheral/radio_test/sample.yaml @@ -5,27 +5,31 @@ tests: sample.peripheral.radio_test: build_only: true integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet - - nrf7002dk_nrf5340_cpunet + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet + - nrf7002dk/nrf5340/cpunet + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpurad platform_allow: > - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpunet nrf7002dk_nrf5340_cpunet + nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpunet nrf7002dk/nrf5340/cpunet + nrf54l15pdk/nrf54l15/cpuapp nrf54l15pdk@0.3.0/nrf54l15/cpuapp nrf54h20dk/nrf54h20/cpurad tags: ci_build sample.peripheral.radio_test.nrf5340_nrf21540: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build sample.peripheral.radio_test.nrf5340_usb: build_only: true extra_configs: - CONFIG_RADIO_TEST_USB=y integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build sample.peripheral.radio_test.nrf5340_nrf21540_usb: build_only: true @@ -33,8 +37,8 @@ tests: extra_configs: - CONFIG_RADIO_TEST_USB=y integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build sample.peripheral.radio_test.nrf5340_nrf21540.no_automatic_power: build_only: true @@ -42,6 +46,6 @@ tests: extra_configs: - CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC=n integration_platforms: - - nrf5340dk_nrf5340_cpunet - platform_allow: nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet + platform_allow: nrf5340dk/nrf5340/cpunet tags: ci_build diff --git a/samples/peripheral/radio_test/src/main.c b/samples/peripheral/radio_test/src/main.c index 3bc26f7cc7b8..17283dc9e5fb 100644 --- a/samples/peripheral/radio_test/src/main.c +++ b/samples/peripheral/radio_test/src/main.c @@ -5,9 +5,13 @@ */ #include +#if defined(CONFIG_CLOCK_CONTROL_NRF) #include #include +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ + +#if defined(CONFIG_CLOCK_CONTROL_NRF) static void clock_init(void) { int err; @@ -39,12 +43,15 @@ static void clock_init(void) printk("Clock has started\n"); } +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ int main(void) { printk("Starting Radio Test example\n"); +#if defined(CONFIG_CLOCK_CONTROL_NRF) clock_init(); +#endif /* #if defined(CONFIG_CLOCK_CONTROL_NRF) */ return 0; } diff --git a/samples/peripheral/radio_test/src/radio_cmd.c b/samples/peripheral/radio_test/src/radio_cmd.c index 5fc15df0931b..06d14b20b70c 100644 --- a/samples/peripheral/radio_test/src/radio_cmd.c +++ b/samples/peripheral/radio_test/src/radio_cmd.c @@ -10,7 +10,9 @@ #include #include #include +#if !defined(CONFIG_SOC_SERIES_NRF54HX) #include +#endif /* !defined(CONFIG_SOC_SERIES_NRF54HX) */ #if CONFIG_FEM #include "fem_al/fem_al.h" @@ -66,7 +68,7 @@ static struct radio_param_config { .delay_ms = 10, .duty_cycle = 50, #if CONFIG_FEM - .fem.gain = FEM_USE_DEFAULT_GAIN + .fem.tx_power_control = FEM_USE_DEFAULT_TX_POWER_CONTROL #endif /* CONFIG_FEM */ }; @@ -224,8 +226,7 @@ static int cmd_tx_carrier_start(const struct shell *shell, size_t argc, test_config.params.unmodulated_tx.txpower = config.txpower; test_config.params.unmodulated_tx.channel = config.channel_start; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ radio_test_start(&test_config); @@ -263,8 +264,7 @@ static int cmd_tx_modulated_carrier_start(const struct shell *shell, test_config.params.modulated_tx.channel = config.channel_start; test_config.params.modulated_tx.pattern = config.tx_pattern; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ if (argc == 2) { @@ -316,8 +316,7 @@ static int cmd_duty_cycle_set(const struct shell *shell, size_t argc, test_config.params.modulated_tx_duty_cycle.duty_cycle = config.duty_cycle; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ radio_test_start(&test_config); @@ -423,6 +422,23 @@ static int cmd_print(const struct shell *shell, size_t argc, char **argv) break; #endif /* defined(RADIO_MODE_MODE_Nrf_250Kbit) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + case NRF_RADIO_MODE_NRF_4MBIT_H_0_5: + shell_print(shell, + "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_H_0_5)); + 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: + shell_print(shell, + "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_H_0_25)); + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ + case NRF_RADIO_MODE_NRF_1MBIT: shell_print(shell, "Data rate: %s", @@ -527,8 +543,7 @@ static int cmd_rx_sweep_start(const struct shell *shell, size_t argc, test_config.params.rx_sweep.channel_end = config.channel_end; test_config.params.rx_sweep.delay_ms = config.delay_ms; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ radio_test_start(&test_config); @@ -550,8 +565,7 @@ static int cmd_tx_sweep_start(const struct shell *shell, size_t argc, test_config.params.tx_sweep.delay_ms = config.delay_ms; test_config.params.tx_sweep.txpower = config.txpower; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ radio_test_start(&test_config); @@ -579,8 +593,7 @@ static int cmd_rx_start(const struct shell *shell, size_t argc, char **argv) test_config.params.rx.channel = config.channel_start; test_config.params.rx.pattern = config.tx_pattern; #if CONFIG_FEM - test_config.fem.ramp_up_time = config.fem.ramp_up_time; - test_config.fem.gain = config.fem.gain; + test_config.fem = config.fem; #endif /* CONFIG_FEM */ radio_test_start(&test_config); @@ -588,6 +601,22 @@ static int cmd_rx_start(const struct shell *shell, size_t argc, char **argv) return 0; } +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) +static void cmd_pos10dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = 10; + shell_print(shell, "TX power: %d", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) +static void cmd_pos9dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = 9; + shell_print(shell, "TX power: %d", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ + #if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) static void cmd_pos8dbm(const struct shell *shell, size_t argc, char **argv) { @@ -644,6 +673,14 @@ static void cmd_pos2dbm(const struct shell *shell, size_t argc, char **argv) } #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) +static void cmd_pos1dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = 1; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) */ + static void cmd_pos0dbm(const struct shell *shell, size_t argc, char **argv) { config.txpower = 0; @@ -710,12 +747,36 @@ static void cmd_neg8dbm(const struct shell *shell, size_t argc, char **argv) shell_print(shell, "TX power : %d dBm", config.txpower); } +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) +static void cmd_neg9dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -9; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) +static void cmd_neg10dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -10; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ + static void cmd_neg12dbm(const struct shell *shell, size_t argc, char **argv) { config.txpower = -12; shell_print(shell, "TX power : %d dBm", config.txpower); } +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) +static void cmd_neg14dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -14; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ + static void cmd_neg16dbm(const struct shell *shell, size_t argc, char **argv) { config.txpower = -16; @@ -728,11 +789,21 @@ static void cmd_neg20dbm(const struct shell *shell, size_t argc, char **argv) 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) +{ + config.txpower = -26; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg26dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) static void cmd_neg30dbm(const struct shell *shell, size_t argc, char **argv) { config.txpower = -30; shell_print(shell, "TX power : %d dBm", config.txpower); } +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ static void cmd_neg40dbm(const struct shell *shell, size_t argc, char **argv) { @@ -740,6 +811,22 @@ static void cmd_neg40dbm(const struct shell *shell, size_t argc, char **argv) shell_print(shell, "TX power : %d dBm", config.txpower); } +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) +static void cmd_neg46dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -46; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) +static void cmd_neg70dbm(const struct shell *shell, size_t argc, char **argv) +{ + config.txpower = -70; + shell_print(shell, "TX power : %d dBm", config.txpower); +} +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ + static int cmd_nrf_1mbit(const struct shell *shell, size_t argc, char **argv) { config.mode = NRF_RADIO_MODE_NRF_1MBIT; @@ -770,6 +857,30 @@ static int cmd_nrf_250kbit(const struct shell *shell, size_t argc, } #endif /* defined(RADIO_MODE_MODE_Nrf_250Kbit) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) +static int cmd_nrf_4mbit_h_0_5(const struct shell *shell, size_t argc, + char **argv) +{ + config.mode = NRF_RADIO_MODE_NRF_4MBIT_H_0_5; + shell_print(shell, "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_H_0_5)); + + return 0; +} +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) +static int cmd_nrf_4mbit_h_0_25(const struct shell *shell, size_t argc, + char **argv) +{ + config.mode = NRF_RADIO_MODE_NRF_4MBIT_H_0_25; + shell_print(shell, "Data rate: %s", + STRINGIFY(NRF_RADIO_MODE_NRF_4MBIT_H_0_25)); + + return 0; +} +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ + static int cmd_ble_1mbit(const struct shell *shell, size_t argc, char **argv) { config.mode = NRF_RADIO_MODE_BLE_1MBIT; @@ -866,6 +977,18 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_data_rate, cmd_nrf_250kbit), #endif /* defined(RADIO_MODE_MODE_Nrf_250Kbit) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + SHELL_CMD(nrf_4Mbit0_5, NULL, + "4 Mbit/s Nordic proprietary radio mode (BT=0.5/h=0.5)", + cmd_nrf_4mbit_h_0_5), +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) + SHELL_CMD(nrf_4Mbit0_25, NULL, + "4 Mbit/s Nordic proprietary radio mode (BT=0.5/h=0.25)", + cmd_nrf_4mbit_h_0_25), +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ + 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", @@ -928,10 +1051,10 @@ static int cmd_fem(const struct shell *shell, size_t argc, char **argv) } #if !CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC -static int cmd_fem_gain_set(const struct shell *shell, size_t argc, +static int cmd_fem_tx_power_control_set(const struct shell *shell, size_t argc, char **argv) { - uint32_t gain; + uint32_t tx_power_control; if (argc == 1) { shell_help(shell); @@ -943,11 +1066,11 @@ static int cmd_fem_gain_set(const struct shell *shell, size_t argc, return -EINVAL; } - gain = atoi(argv[1]); + tx_power_control = atoi(argv[1]); - config.fem.gain = gain; + config.fem.tx_power_control = tx_power_control; - shell_print(shell, "Front-end module (FEM) Tx gain set to %d", gain); + shell_print(shell, "Front-end module (FEM) Tx power control set to %u", tx_power_control); return 0; } @@ -1015,6 +1138,12 @@ static int cmd_fem_ramp_up_set(const struct shell *shell, size_t argc, char **ar #endif /* CONFIG_FEM */ SHELL_STATIC_SUBCMD_SET_CREATE(sub_output_power, +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) + SHELL_CMD(pos10dBm, NULL, "TX power: +10 dBm", cmd_pos10dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) + SHELL_CMD(pos9dBm, NULL, "TX power: +9 dBm", cmd_pos9dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ #if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) SHELL_CMD(pos8dBm, NULL, "TX power: +8 dBm", cmd_pos8dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) */ @@ -1036,6 +1165,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_output_power, #if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) SHELL_CMD(pos2dBm, NULL, "TX power: +2 dBm", cmd_pos2dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) + SHELL_CMD(pos1dBm, NULL, "TX power: +1 dBm", cmd_pos1dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) */ SHELL_CMD(pos0dBm, NULL, "TX power: 0 dBm", cmd_pos0dbm), #if defined(RADIO_TXPOWER_TXPOWER_Neg1dBm) SHELL_CMD(neg1dBm, NULL, "TX power: -1 dBm", cmd_neg1dbm), @@ -1057,11 +1189,31 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_output_power, SHELL_CMD(neg7dBm, NULL, "TX power: -7 dBm", cmd_neg7dbm), #endif /* defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) */ SHELL_CMD(neg8dBm, NULL, "TX power: -8 dBm", cmd_neg8dbm), +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) + SHELL_CMD(neg9dBm, NULL, "TX power: -9 dBm", cmd_neg9dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) + SHELL_CMD(neg10dBm, NULL, "TX power: -10 dBm", cmd_neg10dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ SHELL_CMD(neg12dBm, NULL, "TX power: -12 dBm", cmd_neg12dbm), +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) + 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), 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_Neg30dBm) SHELL_CMD(neg30dBm, NULL, "TX power: -30 dBm", cmd_neg30dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) */ SHELL_CMD(neg40dBm, NULL, "TX power: -40 dBm", cmd_neg40dbm), +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) + SHELL_CMD(neg46dBm, NULL, "TX power: -46 dBm", cmd_neg46dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) + SHELL_CMD(neg70dBm, NULL, "TX power: -70 dBm", cmd_neg70dbm), +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ SHELL_SUBCMD_SET_END ); @@ -1091,9 +1243,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_fem_antenna, SHELL_STATIC_SUBCMD_SET_CREATE(sub_fem, #if !CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC - SHELL_CMD(tx_gain, NULL, - "Set the front-end module (FEM) Tx gain in an arbitrary units ", - cmd_fem_gain_set), + SHELL_CMD(tx_power_control, NULL, + "Set the front-end module (FEM) Tx power control specific to the FEM in use .", + cmd_fem_tx_power_control_set), #endif /* !CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC */ SHELL_CMD(antenna, &sub_fem_antenna, "Select the front-end module (FEM) antenna ", @@ -1195,9 +1347,9 @@ static int radio_cmd_init(void) #if CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC /* When front-end module is used, set output power to the front-end module - * default gain. + * default output power. */ - config.txpower = fem_default_tx_gain_get(); + config.txpower = fem_default_tx_output_power_get(); #endif /* CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC */ return radio_test_init(&test_config); diff --git a/samples/peripheral/radio_test/src/radio_test.c b/samples/peripheral/radio_test/src/radio_test.c index 7dbb491618a3..39dc626d1d75 100644 --- a/samples/peripheral/radio_test/src/radio_test.c +++ b/samples/peripheral/radio_test/src/radio_test.c @@ -9,7 +9,9 @@ #include #include +#if !(defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX)) #include +#endif /* !(defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX)) */ #ifdef NRF53_SERIES #include @@ -31,9 +33,6 @@ /* Length on air of the LENGTH field. */ #define RADIO_LENGTH_LENGTH_FIELD (8UL) -#define RADIO_TEST_TIMER_INSTANCE 0 - -#define RADIO_TEST_EGU NRF_EGU0 #define RADIO_TEST_EGU_EVENT NRF_EGU_EVENT_TRIGGERED0 #define RADIO_TEST_EGU_TASK NRF_EGU_TASK_TRIGGER0 @@ -46,6 +45,34 @@ /* Frequency calculation for a given channel. */ #define CHAN_TO_FREQ(_channel) (2400 + _channel) +#if defined(CONFIG_SOC_SERIES_NRF54HX) + #define RADIO_TEST_EGU NRF_EGU020 + #define RADIO_TEST_TIMER_INSTANCE 020 + #define RADIO_TEST_TIMER_IRQn TIMER020_IRQn + #define RADIO_TEST_RADIO_IRQn RADIO_0_IRQn + #define NRF_RADIO_SHORT_END_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK +#elif defined(CONFIG_SOC_SERIES_NRF54LX) + #define RADIO_TEST_EGU NRF_EGU10 + #define RADIO_TEST_TIMER_INSTANCE 10 + #define RADIO_TEST_TIMER_IRQn TIMER10_IRQn + #define RADIO_TEST_RADIO_IRQn RADIO_0_IRQn + #define NRF_RADIO_SHORT_END_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK +#else + #define RADIO_TEST_EGU NRF_EGU0 + #define RADIO_TEST_TIMER_INSTANCE 0 + #define RADIO_TEST_TIMER_IRQn TIMER0_IRQn + #define RADIO_TEST_RADIO_IRQn RADIO_IRQn +#endif /* defined(CONFIG_SOC_SERIES_NRF54HX) */ + +#define RADIO_TEST_TIMER_IRQ_HANDLER NRFX_CONCAT_3(nrfx_timer_, \ + RADIO_TEST_TIMER_INSTANCE, \ + _irq_handler) + +#define ENDPOINT_EGU_RADIO_TX BIT(1) +#define ENDPOINT_EGU_RADIO_RX BIT(2) +#define ENDPOINT_TIMER_RADIO_TX BIT(3) +#define ENDPOINT_FORK_EGU_TIMER BIT(4) + /* Buffer for the radio TX packet */ static uint8_t tx_packet[RADIO_MAX_PAYLOAD_LEN]; /* Buffer for the radio RX packet. */ @@ -69,6 +96,9 @@ static uint16_t total_payload_size; /* PPI channel for starting radio */ static uint8_t ppi_radio_start; +/* PPI endpoint status.*/ +static atomic_t endpoint_state; + #if CONFIG_FEM static struct radio_test_fem fem; #endif /* CONFIG_FEM */ @@ -94,11 +124,28 @@ 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_Neg70dBm) + case -70: + return RADIO_TXPOWER_TXPOWER_Neg70dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) + case -46: + return RADIO_TXPOWER_TXPOWER_Neg46dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ + case -40: return RADIO_TXPOWER_TXPOWER_Neg40dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) case -30: 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) */ case -20: return RADIO_TXPOWER_TXPOWER_Neg20dBm; @@ -106,9 +153,24 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) case -16: return RADIO_TXPOWER_TXPOWER_Neg16dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) + case -14: + return RADIO_TXPOWER_TXPOWER_Neg14dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ + case -12: return RADIO_TXPOWER_TXPOWER_Neg12dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) + case -10: + return RADIO_TXPOWER_TXPOWER_Neg10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) + case -9: + return RADIO_TXPOWER_TXPOWER_Neg9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ + case -8: return RADIO_TXPOWER_TXPOWER_Neg8dBm; @@ -148,6 +210,11 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) case 0: return RADIO_TXPOWER_TXPOWER_0dBm; +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) + case 1: + return RADIO_TXPOWER_TXPOWER_Pos1dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) */ + #if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) case 2: return RADIO_TXPOWER_TXPOWER_Pos2dBm; @@ -183,6 +250,16 @@ static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) return RADIO_TXPOWER_TXPOWER_Pos8dBm; #endif /* defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) */ +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) + case 9: + return RADIO_TXPOWER_TXPOWER_Pos9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) + case 10: + return RADIO_TXPOWER_TXPOWER_Pos10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ + default: printk("TX power to enumerator conversion failed, defaulting to 0 dBm\n"); return RADIO_TXPOWER_TXPOWER_0dBm; @@ -227,26 +304,59 @@ static void radio_power_set(nrf_radio_mode_t mode, uint8_t channel, int8_t power } } +static void endpoints_clear(void) +{ + if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_FORK_EGU_TIMER)) { + nrfx_gppi_fork_endpoint_clear(ppi_radio_start, + nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); + } + if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_EGU_RADIO_TX)) { + nrfx_gppi_channel_endpoints_clear(ppi_radio_start, + nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + } + if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_EGU_RADIO_RX)) { + nrfx_gppi_channel_endpoints_clear(ppi_radio_start, + nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); + } + if (atomic_test_and_clear_bit(&endpoint_state, ENDPOINT_TIMER_RADIO_TX)) { + nrfx_gppi_channel_endpoints_clear(ppi_radio_start, + nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE0), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + } +} + static void radio_ppi_config(bool rx) { + endpoints_clear(); + nrfx_gppi_channel_endpoints_setup(ppi_radio_start, nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT), nrf_radio_task_address_get(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN)); + atomic_set_bit(&endpoint_state, (rx ? ENDPOINT_EGU_RADIO_RX : ENDPOINT_EGU_RADIO_TX)); + nrfx_gppi_fork_endpoint_setup(ppi_radio_start, nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); + atomic_set_bit(&endpoint_state, ENDPOINT_FORK_EGU_TIMER); + nrfx_gppi_channels_enable(BIT(ppi_radio_start)); } static void radio_ppi_tx_reconfigure(void) { - nrfx_gppi_channels_disable(BIT(ppi_radio_start)); - nrfx_gppi_fork_endpoint_clear(ppi_radio_start, - nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); - nrfx_gppi_event_endpoint_clear(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); - nrfx_gppi_event_endpoint_setup(ppi_radio_start, - nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1)); + if (nrfx_gppi_channel_check(ppi_radio_start)) { + nrfx_gppi_channels_disable(BIT(ppi_radio_start)); + } + + endpoints_clear(); + + nrfx_gppi_channel_endpoints_setup(ppi_radio_start, + nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1), + nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); + atomic_set_bit(&endpoint_state, ENDPOINT_TIMER_RADIO_TX); + nrfx_gppi_channels_enable(BIT(ppi_radio_start)); } @@ -286,12 +396,12 @@ static int fem_configure(bool rx, nrf_radio_mode_t mode, } if ((!IS_ENABLED(CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC)) && - (fem->gain != FEM_USE_DEFAULT_GAIN) && + (fem->tx_power_control != FEM_USE_DEFAULT_TX_POWER_CONTROL) && !sweep_processing) { - err = fem_tx_gain_set(fem->gain); + err = fem_tx_power_control_set(fem->tx_power_control); if (err) { - printk("%d: out of range FEM gain value or setting gain is not supported\n", - fem->gain); + printk("%u: out of range FEM Tx power control value or setting Tx power control is not supported\n", + fem->tx_power_control); return err; } } @@ -329,7 +439,12 @@ static void radio_config(nrf_radio_mode_t mode, enum transmit_pattern pattern) nrf_radio_packet_conf_t packet_conf; /* Set fast ramp-up time. */ +#if defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) + nrf_radio_fast_ramp_up_enable_set(NRF_RADIO, true); +#else nrf_radio_modecnf0_set(NRF_RADIO, true, RADIO_MODECNF0_DTX_Center); +#endif /* defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) */ + /* Disable CRC. */ nrf_radio_crc_configure(NRF_RADIO, RADIO_CRCCNF_LEN_Disabled, NRF_RADIO_CRC_ADDR_INCLUDE, 0); @@ -583,6 +698,12 @@ static void radio_modulated_tx_carrier(uint8_t mode, int8_t txpower, uint8_t cha #if defined(RADIO_MODE_MODE_Nrf_250Kbit) case NRF_RADIO_MODE_NRF_250KBIT: #endif /* defined(RADIO_MODE_MODE_Nrf_250Kbit) */ +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + case NRF_RADIO_MODE_NRF_4MBIT_H_0_5: +#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: +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_25) */ nrf_radio_shorts_enable(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_END_START_MASK); @@ -613,6 +734,7 @@ static void radio_rx(uint8_t mode, uint8_t channel, enum transmit_pattern patter radio_disable(); radio_mode_set(NRF_RADIO, mode); + nrf_radio_shorts_enable(NRF_RADIO, NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_END_START_MASK); @@ -644,8 +766,8 @@ static void radio_sweep_start(uint8_t channel, uint32_t delay_ms) (void)fem_power_up(); if ((!IS_ENABLED(CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC)) && - fem.gain != FEM_USE_DEFAULT_GAIN) { - (void)fem_tx_gain_set(fem.gain); + fem.tx_power_control != FEM_USE_DEFAULT_TX_POWER_CONTROL) { + (void)fem_tx_power_control_set(fem.tx_power_control); } #endif /* CONFIG_FEM */ @@ -725,8 +847,7 @@ static void radio_modulated_tx_carrier_duty_cycle(uint8_t mode, int8_t txpower, void radio_test_start(const struct radio_test_config *config) { #if CONFIG_FEM - fem.ramp_up_time = config->fem.ramp_up_time; - fem.gain = config->fem.gain; + fem = config->fem; #endif /* CONFIG_FEM */ switch (config->type) { @@ -772,18 +893,11 @@ void radio_test_cancel(void) sweep_processing = false; - nrfx_gppi_channels_disable(BIT(ppi_radio_start)); - nrfx_gppi_event_endpoint_clear(ppi_radio_start, - nrf_egu_event_address_get(RADIO_TEST_EGU, RADIO_TEST_EGU_EVENT)); - nrfx_gppi_task_endpoint_clear(ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_TXEN)); - nrfx_gppi_task_endpoint_clear(ppi_radio_start, - nrf_radio_task_address_get(NRF_RADIO, NRF_RADIO_TASK_RXEN)); - nrfx_gppi_fork_endpoint_clear(ppi_radio_start, - nrf_timer_task_address_get(timer.p_reg, NRF_TIMER_TASK_START)); - nrfx_gppi_event_endpoint_clear(ppi_radio_start, - nrf_timer_event_address_get(timer.p_reg, NRF_TIMER_EVENT_COMPARE1)); + if (nrfx_gppi_channel_check(ppi_radio_start)) { + nrfx_gppi_channels_disable(BIT(ppi_radio_start)); + } + endpoints_clear(); radio_disable(); } @@ -913,11 +1027,11 @@ int radio_test_init(struct radio_test_config *config) nrfx_err_t nrfx_err; timer_init(config); - IRQ_CONNECT(TIMER0_IRQn, IRQ_PRIO_LOWEST, - nrfx_timer_0_irq_handler, NULL, 0); + IRQ_CONNECT(RADIO_TEST_TIMER_IRQn, IRQ_PRIO_LOWEST, + RADIO_TEST_TIMER_IRQ_HANDLER, NULL, 0); - irq_connect_dynamic(RADIO_IRQn, IRQ_PRIO_LOWEST, radio_handler, config, 0); - irq_enable(RADIO_IRQn); + irq_connect_dynamic(RADIO_TEST_RADIO_IRQn, IRQ_PRIO_LOWEST, radio_handler, config, 0); + irq_enable(RADIO_TEST_RADIO_IRQn); nrfx_err = nrfx_gppi_channel_alloc(&ppi_radio_start); if (nrfx_err != NRFX_SUCCESS) { diff --git a/samples/peripheral/radio_test/src/radio_test.h b/samples/peripheral/radio_test/src/radio_test.h index 007e36a1f704..a040c8d1910b 100644 --- a/samples/peripheral/radio_test/src/radio_test.h +++ b/samples/peripheral/radio_test/src/radio_test.h @@ -9,6 +9,7 @@ #include #include +#include #ifdef NRF53_SERIES #ifndef RADIO_TXPOWER_TXPOWER_Pos3dBm @@ -33,7 +34,7 @@ /** IEEE 802.15.4 maximum channel. */ #define IEEE_MAX_CHANNEL 26 -#define FEM_USE_DEFAULT_GAIN 0xFF +#define FEM_USE_DEFAULT_TX_POWER_CONTROL 0xFF /**@brief Radio transmit and address pattern. */ enum transmit_pattern { @@ -73,11 +74,11 @@ struct radio_test_fem { /* Front-end module radio ramp-up time in microseconds. */ uint32_t ramp_up_time; - /* Front-end module TX gain in arbitrary unit specific to given front-end module. + /* Front-end module TX power control specific to given front-end module. * For nRF21540 GPIO/SPI, this is a register value. * For nRF21540 GPIO, this is MODE pin value. */ - uint8_t gain; + fem_tx_power_control tx_power_control; }; /**@brief Radio test configuration. */ diff --git a/samples/pmic/native/npm1300_fuel_gauge/README.rst b/samples/pmic/native/npm1300_fuel_gauge/README.rst index 02d9ccb78548..e469fdcfaca9 100644 --- a/samples/pmic/native/npm1300_fuel_gauge/README.rst +++ b/samples/pmic/native/npm1300_fuel_gauge/README.rst @@ -16,7 +16,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -The sample also requires an nPM1300 EK. +The sample also requires an `nPM1300 EK `_. Overview ******** diff --git a/samples/pmic/native/npm1300_fuel_gauge/sample.yaml b/samples/pmic/native/npm1300_fuel_gauge/sample.yaml index ce27298a9fb7..108317bcd67e 100644 --- a/samples/pmic/native/npm1300_fuel_gauge/sample.yaml +++ b/samples/pmic/native/npm1300_fuel_gauge/sample.yaml @@ -5,16 +5,16 @@ sample: common: integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 tags: pmic tests: samples.npm1300_fuel_gauge: - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp harness: console harness_config: fixture: nPM1300_setup_eng_b @@ -26,7 +26,7 @@ tests: - "SoC: [0-9.]+, TTE: ([0-9.]+|nan), TTF: ([0-9.]+|nan)" samples.compile: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 harness: shield tags: shield extra_args: SHIELD=npm1300_ek diff --git a/samples/pmic/native/npm1300_fuel_gauge/src/fuel_gauge.c b/samples/pmic/native/npm1300_fuel_gauge/src/fuel_gauge.c index b20c1a256250..62183ab931ca 100644 --- a/samples/pmic/native/npm1300_fuel_gauge/src/fuel_gauge.c +++ b/samples/pmic/native/npm1300_fuel_gauge/src/fuel_gauge.c @@ -107,8 +107,8 @@ int fuel_gauge_update(const struct device *charger) tte = nrf_fuel_gauge_tte_get(); ttf = nrf_fuel_gauge_ttf_get(cc_charging, -term_charge_current); - printk("V: %.3f, I: %.3f, T: %.2f, ", voltage, current, temp); - printk("SoC: %.2f, TTE: %.0f, TTF: %.0f\n", soc, tte, ttf); + printk("V: %.3f, I: %.3f, T: %.2f, ", (double)voltage, (double)current, (double)temp); + printk("SoC: %.2f, TTE: %.0f, TTF: %.0f\n", (double)soc, (double)tte, (double)ttf); return 0; } diff --git a/samples/pmic/native/npm1300_one_button/README.rst b/samples/pmic/native/npm1300_one_button/README.rst index d27ba8056de0..69cce0551cef 100644 --- a/samples/pmic/native/npm1300_one_button/README.rst +++ b/samples/pmic/native/npm1300_one_button/README.rst @@ -8,7 +8,7 @@ nPM1300: One button :depth: 2 The One button sample demonstrates how to support wake-up, shutdown and user interactions through -a single button connected to the nPM1300. +a single button connected to the `nPM1300 `_. Requirements ************ @@ -17,7 +17,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -The sample also requires an nPM1300 EK. +The sample also requires an `nPM1300 EK `_. Overview ******** diff --git a/samples/pmic/native/npm1300_one_button/sample.yaml b/samples/pmic/native/npm1300_one_button/sample.yaml index 5f0ab9ddcc8d..c588327f2ad2 100644 --- a/samples/pmic/native/npm1300_one_button/sample.yaml +++ b/samples/pmic/native/npm1300_one_button/sample.yaml @@ -5,16 +5,16 @@ sample: common: integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 tags: pmic tests: samples.npm1300_one_button: - platform_allow: nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp harness: console harness_config: fixture: nPM1300_setup_eng_b @@ -24,7 +24,7 @@ tests: - "PMIC device ok" samples.npm1300_one_button_compile: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 harness: shield tags: shield extra_args: SHIELD=npm1300_ek diff --git a/samples/sdfw/ssf_client/CMakeLists.txt b/samples/sdfw/ssf_client/CMakeLists.txt new file mode 100644 index 000000000000..9b4520241a4a --- /dev/null +++ b/samples/sdfw/ssf_client/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.13.1) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(ssf_client_sample) + +# NORDIC SDK APP START +target_sources(app PRIVATE src/main.c) +# NORDIC SDK APP END diff --git a/samples/sdfw/ssf_client/Kconfig b/samples/sdfw/ssf_client/Kconfig new file mode 100644 index 000000000000..4e5743f6bb9b --- /dev/null +++ b/samples/sdfw/ssf_client/Kconfig @@ -0,0 +1,56 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SSF_CLIENT_SAMPLE + bool "SDFW Service Framework Client Sample" + help + "Enable sample-specific configurations." + +if SSF_CLIENT_SAMPLE + +config ENABLE_ECHO_REQUEST + bool "Enable SSF dummy request service(s)" + depends on SSF_ECHO_SERVICE_ENABLED + default y + +config ENABLE_PRNG_REQUEST + bool "Enable the PRNG request service" + depends on SSF_PRNG_SERVICE_ENABLED + default y + +config ENABLE_RESET_EVT_SUBSCRIBE_REQUEST + bool "Enable the reset event subscription service" + depends on SSF_RESET_EVT_SERVICE_ENABLED + default y + +config ENABLE_SDFW_UPDATE_REQUEST + bool "Enable the SDFW update service" + depends on SSF_SDFW_UPDATE_SERVICE_ENABLED + help + Prompt a firmware update of SDFW based on downloaded update data. + This data can be "downloaded" in the sense that it was programmed into + MRAM manually for local testing. + +config UPDATE_REQUEST_CHECK_DATA + bool "Abort update if no data exists" + depends on ENABLE_SDFW_UPDATE_REQUEST + default y + help + Safety option to abort the update request if the download data is invalid + or not programmed at all. + +config PRNG_BYTES_TO_GET + int "Number of PRNG bytes to request" + range 1 100 + default 32 + +module = SSF_CLIENT_SAMPLE +module-str = SSF Client Sample +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif # SSF_CLIENT_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/sdfw/ssf_client/README.rst b/samples/sdfw/ssf_client/README.rst new file mode 100644 index 000000000000..90ce0173c024 --- /dev/null +++ b/samples/sdfw/ssf_client/README.rst @@ -0,0 +1,60 @@ +.. _sdfw_ssf_client_sample: + +SDFW: Service Framework Client +############################## + +.. contents:: + :local: + :depth: 2 + +The sample demonstrates how Application and Radio core can request Secure Domain services. +It uses the SDFW Service Framework (SSF). + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-rows:: /includes/sample_board_rows.txt + :header: heading + :rows: nrf54h20dk_nrf54h20_cpuapp, nrf54h20dk_nrf54h20_cpurad + +Overview +******** + +The sample shows how to use Secure Domain services by invoking some of the available services. +Available Secure Domain Services can be found in :file:`nrf/include/sdfw/sdfw_services`. +The service source files are located in :file:`nrf/subsys/sdfw_services/services`. + + + +Building and running +******************** + +.. |sample path| replace:: :file:`samples/sdfw/ssf_client` + +.. include:: /includes/build_and_run.txt + +Testing +======= + +|test_sample| + +#. |connect_kit| +#. |connect_terminal| +#. In the terminal, observe the responses to the different requests. + +Dependencies +************ + +It sample uses the following `sdk-nrfxlib`_ library: + +* :ref:`nrfxlib:nrf_rpc` + +It uses the following Zephyr library: + +* :ref:`zephyr:ipc_service_backend_icmsg` +* :ref:`zephyr:logging_api` +* :ref:`zephyr:kernel_api`: + +The sample also uses drivers from `nrfx`_. diff --git a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..1ca688cf9792 --- /dev/null +++ b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&cpusec_cpuapp_ipc { + status = "okay"; +}; + +&cpuapp_ram0x_region { + status = "okay"; +}; + +&cpusec_bellboard { + status = "okay"; +}; + +&cpuapp_bellboard { + status = "okay"; +}; diff --git a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay new file mode 100644 index 000000000000..4a04725908a9 --- /dev/null +++ b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&cpusec_cpurad_ipc { + status = "okay"; +}; + +&cpurad_ram0x_region { + status = "okay"; +}; + +&cpusec_bellboard { + status = "okay"; +}; + +&cpurad_bellboard { + status = "okay"; +}; diff --git a/samples/sdfw/ssf_client/prj.conf b/samples/sdfw/ssf_client/prj.conf new file mode 100644 index 000000000000..e4dfd071ee42 --- /dev/null +++ b/samples/sdfw/ssf_client/prj.conf @@ -0,0 +1 @@ +CONFIG_SSF_CLIENT_SAMPLE=y diff --git a/samples/sdfw/ssf_client/sample.yaml b/samples/sdfw/ssf_client/sample.yaml new file mode 100644 index 000000000000..192444f3c693 --- /dev/null +++ b/samples/sdfw/ssf_client/sample.yaml @@ -0,0 +1,23 @@ +sample: + name: SSF Client Sample + description: | + Sample demonstrating how to build application with sdfw service framework + enabled and how to request services from secure domain. + +common: + build_only: true + tags: ci_build + +tests: + samples.sdfw.ssf_client: + platform_allow: nrf54h20dk/nrf54h20/cpuapp nrf54h20dk/nrf54h20/cpurad + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + + samples.sdfw.ssf_client.logging.uart: + platform_allow: nrf54h20dk/nrf54h20/cpuapp nrf54h20dk/nrf54h20/cpurad + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad + extra_args: EXTRA_CONF_FILE=uart_logging.conf diff --git a/samples/sdfw/ssf_client/src/main.c b/samples/sdfw/ssf_client/src/main.c new file mode 100644 index 000000000000..22854545dfd6 --- /dev/null +++ b/samples/sdfw/ssf_client/src/main.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +#include +LOG_MODULE_REGISTER(ssf_client_sample, CONFIG_SSF_CLIENT_SAMPLE_LOG_LEVEL); + +#if CONFIG_IMPRIMATUR_ENABLED +#define IMPRIMATUR_UPDATE_IMAGE_OFFSET CONFIG_IMPRIMATUR_UPDATE_IMAGE_OFFSET +#else +#define IMPRIMATUR_UPDATE_IMAGE_OFFSET (0xe155000) +#endif + +static void echo_request(void) +{ + int err; + char req_str[] = "Hello " CONFIG_BOARD; + char rsp_str[sizeof(req_str) + 1]; + + LOG_INF("Calling ssf_echo, str: \"%s\"", req_str); + + err = ssf_echo(req_str, rsp_str, sizeof(rsp_str)); + if (err != 0) { + LOG_ERR("ssf_echo failed"); + } else { + LOG_INF("ssf_echo response: %s", rsp_str); + } +} + +static void prng_request(void) +{ + int err; + uint8_t rng_buf[CONFIG_PRNG_BYTES_TO_GET]; + + err = ssf_prng_get_random(rng_buf, sizeof(rng_buf)); + if (err != 0) { + LOG_ERR("PRNG failed, err %d", err); + return; + } + + LOG_HEXDUMP_INF(rng_buf, CONFIG_PRNG_BYTES_TO_GET, "PRNG data:"); +} + +static int reset_evt_callback(uint32_t domains, uint32_t delay_ms, void *user_data) +{ + LOG_INF("reset_evt: domains 0x%x will reset in %d ms", domains, delay_ms); + + return 0; +} + +static void reset_evt_subscribe(void) +{ + int err; + + err = ssf_reset_evt_subscribe(reset_evt_callback, NULL); + if (err != 0) { + LOG_ERR("Unable to subscribe to reset_evt, err: %d", err); + return; + } +} + +static void sdfw_update(void) +{ + int err; + + uintptr_t *image_data = (uintptr_t *)IMPRIMATUR_UPDATE_IMAGE_OFFSET; + + if (IS_ENABLED(CONFIG_UPDATE_REQUEST_CHECK_DATA) && *image_data == 0xFFFFFFFF) { + LOG_WRN("No update download data."); + return; + } + + err = ssf_sdfw_update(IMPRIMATUR_UPDATE_IMAGE_OFFSET); + if (err != 0) { + LOG_ERR("Unable to perform sdfw update, err: %d", err); + return; + } +} + +int main(void) +{ + LOG_INF("ssf client sample (%s)", CONFIG_BOARD); + + if (IS_ENABLED(CONFIG_ENABLE_ECHO_REQUEST)) { + echo_request(); + } + + if (IS_ENABLED(CONFIG_ENABLE_PRNG_REQUEST)) { + prng_request(); + } + + if (IS_ENABLED(CONFIG_ENABLE_RESET_EVT_SUBSCRIBE_REQUEST)) { + reset_evt_subscribe(); + } + + if (IS_ENABLED(CONFIG_ENABLE_SDFW_UPDATE_REQUEST)) { + sdfw_update(); + } + + return 0; +} diff --git a/samples/sdfw/ssf_client/uart_logging.conf b/samples/sdfw/ssf_client/uart_logging.conf new file mode 100644 index 000000000000..bdd802ffac2a --- /dev/null +++ b/samples/sdfw/ssf_client/uart_logging.conf @@ -0,0 +1,14 @@ +# Enable serial printing via UART +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_PRINTK=y + +# Show function names for errors only +CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y +CONFIG_LOG_FUNC_NAME_PREFIX_WRN=n +CONFIG_LOG_FUNC_NAME_PREFIX_INF=n +CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n diff --git a/samples/sensor/bh1749/sample.yaml b/samples/sensor/bh1749/sample.yaml index 16ebeb74c128..902d9183dca5 100644 --- a/samples/sensor/bh1749/sample.yaml +++ b/samples/sensor/bh1749/sample.yaml @@ -5,6 +5,6 @@ tests: depends_on: i2c harness: sensor integration_platforms: - - thingy91_nrf9160 - platform_allow: thingy91_nrf9160 + - thingy91/nrf9160 + platform_allow: thingy91/nrf9160 tags: sensors diff --git a/samples/sensor/bme68x_iaq/prj.conf b/samples/sensor/bme68x_iaq/prj.conf index 44c5b45bf4ed..0eb690f06a65 100644 --- a/samples/sensor/bme68x_iaq/prj.conf +++ b/samples/sensor/bme68x_iaq/prj.conf @@ -20,9 +20,6 @@ CONFIG_FLASH_MAP=y CONFIG_STREAM_FLASH=y CONFIG_MPU_ALLOW_FLASH_WRITE=y -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y - CONFIG_LOG=y CONFIG_CONSOLE=y diff --git a/samples/sensor/bme68x_iaq/sample.yaml b/samples/sensor/bme68x_iaq/sample.yaml index 1753ff4855a2..6e5d32332768 100644 --- a/samples/sensor/bme68x_iaq/sample.yaml +++ b/samples/sensor/bme68x_iaq/sample.yaml @@ -5,29 +5,29 @@ tests: depends_on: i2c harness: sensor integration_platforms: - - thingy91_nrf9160 - - thingy91_nrf9160_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns + - thingy91/nrf9160 + - thingy91/nrf9160/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns platform_allow: >- - thingy91_nrf9160 - thingy91_nrf9160_ns - thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + thingy91/nrf9160 + thingy91/nrf9160/ns + thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns tags: sensors sample.sensor.bme68x.polling: depends_on: i2c integration_platforms: - - thingy91_nrf9160 - - thingy91_nrf9160_ns - - thingy53_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp_ns + - thingy91/nrf9160 + - thingy91/nrf9160/ns + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns extra_args: CONFIG_APP_TRIGGER=n platform_allow: >- - thingy91_nrf9160 - thingy91_nrf9160_ns - thingy53_nrf5340_cpuapp - thingy53_nrf5340_cpuapp_ns + thingy91/nrf9160 + thingy91/nrf9160/ns + thingy53/nrf5340/cpuapp + thingy53/nrf5340/cpuapp/ns tags: sensors harness: console harness_config: @@ -39,5 +39,5 @@ tests: depends_on: spi harness: sensor platform_allow: >- - nrf9160dk_nrf9160_ns + nrf9160dk/nrf9160/ns tags: sensors diff --git a/samples/suit/smp_transfer/CMakeLists.txt b/samples/suit/smp_transfer/CMakeLists.txt new file mode 100644 index 000000000000..29fc0d4921d0 --- /dev/null +++ b/samples/suit/smp_transfer/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.13.1) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +project(suit_smp_transfer) + +target_sources(app PRIVATE src/main.c) + +# This project uses orginal sdk-zephyr C source code +target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src) +target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE $ENV{ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c) diff --git a/samples/suit/smp_transfer/Kconfig b/samples/suit/smp_transfer/Kconfig new file mode 100644 index 000000000000..3982c990dd59 --- /dev/null +++ b/samples/suit/smp_transfer/Kconfig @@ -0,0 +1,11 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_ENVELOPE_SEQUENCE_NUM + int "Sequence number of the SUIT envelopes" + default 1 + +source "Kconfig.zephyr" diff --git a/samples/suit/smp_transfer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/suit/smp_transfer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..0285aacc42c9 --- /dev/null +++ b/samples/suit/smp_transfer/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,entropy = &psa_rng; + zephyr,uart_mcumgr = &uart136; + zephyr,bt-hci-ipc = &ipc0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +/delete-node/ &cpuapp_rx_partitions; +/delete-node/ &cpuapp_rw_partitions; + +&mram1x { + erase-block-size = < 0x10 >; + /* Hardcoded inside the soc_flash_nrf_mram.c (MRAM_WORD_SIZE) */ + write-block-size = < 0x10 >; + + cpuapp_rx_partitions: cpuapp-rx-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-execute; + perm-secure; + #address-cells = <1>; + #size-cells = <1>; + + cpuapp_slot0_partition: partition@a6000 { + reg = <0xa6000 DT_SIZE_K(448)>; + }; + + companion_partition: partition@116000 { + reg = <0x116000 DT_SIZE_K(64)>; + }; + + cpuppr_code_partition: partition@126000 { + reg = <0x126000 DT_SIZE_K(64)>; + }; + }; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@136000 { + reg = < 0x136000 DT_SIZE_K(656) >; + }; + + storage_partition: partition@1da000 { + reg = < 0x1da000 DT_SIZE_K(24) >; + }; + }; +}; + +&cpusec_cpuapp_ipc { + status = "okay"; +}; + +&cpuapp_ram0x_region { + status = "okay"; +}; + +&cpusec_bellboard { + status = "okay"; +}; + +ipc0: &cpuapp_cpurad_ipc { + status = "okay"; +}; + +&cpuapp_cpurad_ram0x_region { + status = "okay"; +}; + +&cpurad_bellboard { + status = "okay"; +}; + +&cpuapp_bellboard { + status = "okay"; +}; diff --git a/samples/suit/smp_transfer/prj.conf b/samples/suit/smp_transfer/prj.conf new file mode 100644 index 000000000000..7cd2e43dca92 --- /dev/null +++ b/samples/suit/smp_transfer/prj.conf @@ -0,0 +1,33 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable DK LED library +CONFIG_DK_LIBRARY=y + +# Enable mcumgr +CONFIG_NET_BUF=y +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y +CONFIG_MCUMGR=y +CONFIG_MCUMGR_SMP_LEGACY_RC_BEHAVIOUR=y +CONFIG_CRC=y + +# Enable the serial mcumgr transport +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_BASE64=y +CONFIG_MCUMGR_TRANSPORT_UART=y + +# Enable SUIT services +CONFIG_SUIT=y +CONFIG_MGMT_SUITFU=y +CONFIG_FLASH=y + +# Enable SUIT envelope creation +CONFIG_SUIT_ENVELOPE=y + +# Extended SUIT commands over USER group +CONFIG_MGMT_SUITFU_GRP_SUIT=y diff --git a/samples/suit/smp_transfer/sample.yaml b/samples/suit/smp_transfer/sample.yaml new file mode 100644 index 000000000000..4d45d45f1fe8 --- /dev/null +++ b/samples/suit/smp_transfer/sample.yaml @@ -0,0 +1,63 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +sample: + name: SUIT update through SMP sample + description: Sample application that updates firmware using SUIT and SMP protocol +common: + extra_configs: + - CONFIG_SUIT_ENVELOPE_EDITABLE_TEMPLATES_LOCATION="./" + platform_allow: nrf54h20dk/nrf54h20/cpuapp + build_only: true + sysbuild: true +tests: + subsys.suit.smp_transfer.v1: + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=1 + tags: suit + + subsys.suit.smp_transfer.bt.v1: + extra_args: FILE_SUFFIX=bt + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=1 + tags: suit bluetooth + + subsys.suit.smp_transfer.v2: + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=2 + tags: suit + + subsys.suit.smp_transfer.bt.v2: + extra_args: FILE_SUFFIX=bt + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=2 + tags: suit bluetooth + + subsys.suit.smp_transfer.full.v1: + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=1 + - CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL=y + tags: suit + + subsys.suit.smp_transfer.full.v2: + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=2 + - CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL=y + tags: suit + + subsys.suit.smp_transfer.full.bt.v1: + extra_args: FILE_SUFFIX=bt + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=1 + - CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL=y + tags: suit bluetooth + + subsys.suit.smp_transfer.full.bt.v2: + extra_args: FILE_SUFFIX=bt + extra_configs: + - CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM=2 + - CONFIG_SUIT_DFU_CANDIDATE_PROCESSING_FULL=y + tags: suit bluetooth diff --git a/samples/suit/smp_transfer/src/main.c b/samples/suit/smp_transfer/src/main.c new file mode 100644 index 000000000000..31afa47dbb4e --- /dev/null +++ b/samples/suit/smp_transfer/src/main.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#ifdef CONFIG_MGMT_SUITFU +#include +#endif /* CONFIG_MGMT_SUITFU */ +#include +#include "common.h" + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(dfu_partition) +#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(dfu_partition) +#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) + +int main(void) +{ + int ret = dk_leds_init(); + + if (ret) { + printk("Cannot init LEDs (err: %d)\r\n", ret); + } + + printk("Hello world from %s version: %d\r\n", CONFIG_BOARD, + CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM); + +#if (CONFIG_SSF_SUIT_SERVICE_ENABLED) && (CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM == 1) && \ + (!CONFIG_MGMT_SUITFU) + suit_plat_mreg_t update_candidate[] = { + { + .mem = DFU_PARTITION_ADDRESS, + .size = DFU_PARTITION_SIZE, + }, + }; + + printk("Validate candidate: %p (0x%x)\r\n", update_candidate[0].mem, + update_candidate[0].size); + bool dfu_partition_valid = + suit_validate_candidate(update_candidate[0].mem, update_candidate[0].size); + + printk("DFU update candidate found in DFU partition: %d\r\n", dfu_partition_valid); + if (dfu_partition_valid) { + int ret = suit_trigger_update(update_candidate, ARRAY_SIZE(update_candidate)); + + printk("DFU triggered with status: %d\r\n", ret); + } +#endif + +#ifdef CONFIG_MCUMGR_TRANSPORT_BT + start_smp_bluetooth_adverts(); +#endif + + while (1) { + for (int i = 0; i < CONFIG_SUIT_ENVELOPE_SEQUENCE_NUM; i++) { + dk_set_led_on(DK_LED1); + k_msleep(250); + dk_set_led_off(DK_LED1); + k_msleep(250); + } + + k_msleep(5000); + } + + return 0; +} diff --git a/samples/suit/smp_transfer/sysbuild/hci_ipc.conf b/samples/suit/smp_transfer/sysbuild/hci_ipc.conf new file mode 100644 index 000000000000..2528a1a2679c --- /dev/null +++ b/samples/suit/smp_transfer/sysbuild/hci_ipc.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=502 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Disable logs over UART +CONFIG_LOG=n +CONFIG_LOG_PRINTK=n +CONFIG_UART_CONSOLE=n diff --git a/samples/suit/smp_transfer/sysbuild/hci_ipc.overlay b/samples/suit/smp_transfer/sysbuild/hci_ipc.overlay new file mode 100644 index 000000000000..db0a3089b80c --- /dev/null +++ b/samples/suit/smp_transfer/sysbuild/hci_ipc.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&uart135 { + status = "disabled"; +}; diff --git a/samples/suit/smp_transfer/sysbuild/smp_transfer_bt.conf b/samples/suit/smp_transfer/sysbuild/smp_transfer_bt.conf new file mode 100644 index 000000000000..f84178d875fb --- /dev/null +++ b/samples/suit/smp_transfer/sysbuild/smp_transfer_bt.conf @@ -0,0 +1,34 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +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 + +# Enable the Bluetooth mcumgr transport (unauthenticated). +CONFIG_MCUMGR_TRANSPORT_BT=y +CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n +CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y + +# Disable SMP over UART +CONFIG_MCUMGR_TRANSPORT_UART=n +# Enable logs over UART +CONFIG_LOG=y +CONFIG_LOG_PRINTK=y +CONFIG_UART_CONSOLE=y + +# 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_TRANSPORT_WORKQUEUE_STACK_SIZE=4096 + +CONFIG_BT_DEVICE_NAME="SUIT SMP Sample" diff --git a/samples/suit/smp_transfer/sysbuild_bt.conf b/samples/suit/smp_transfer/sysbuild_bt.conf new file mode 100644 index 000000000000..40b47c0375de --- /dev/null +++ b/samples/suit/smp_transfer/sysbuild_bt.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_NETCORE_HCI_IPC=y diff --git a/samples/tfm/provisioning_image/README.rst b/samples/tfm/provisioning_image/README.rst index 319eb00d9a46..a592ac9353af 100644 --- a/samples/tfm/provisioning_image/README.rst +++ b/samples/tfm/provisioning_image/README.rst @@ -13,7 +13,7 @@ This sample does not include a TF-M image, it is a Zephyr image intended to be f 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). -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). +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. Requirements diff --git a/samples/tfm/provisioning_image/sample.yaml b/samples/tfm/provisioning_image/sample.yaml index 8353c41d444a..7aa5758a2501 100644 --- a/samples/tfm/provisioning_image/sample.yaml +++ b/samples/tfm/provisioning_image/sample.yaml @@ -2,17 +2,17 @@ sample: description: Initiates the provisioning of a TF-M image. name: Provisioning Image common: - tags: keys - platform_allow: nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160 - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 - harness: console - harness_config: - type: multi_line - regex: - - "Writing the identity key to KMU" - - "Success!" + tags: keys + platform_allow: nrf5340dk/nrf5340/cpuapp nrf9160dk/nrf9160 + integration_platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + harness: console + harness_config: + type: multi_line + regex: + - "Writing the identity key to KMU" + - "Success!" tests: sample.tfm.provisioning_image: tags: keys ci_build diff --git a/samples/tfm/provisioning_image_net_core/sample.yaml b/samples/tfm/provisioning_image_net_core/sample.yaml index f3fddc146e85..ffb4ba3d17ef 100644 --- a/samples/tfm/provisioning_image_net_core/sample.yaml +++ b/samples/tfm/provisioning_image_net_core/sample.yaml @@ -5,6 +5,6 @@ tests: sample.tfm.provisioning_image_net_core.build: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/tfm/tfm_hello_world/README.rst b/samples/tfm/tfm_hello_world/README.rst index cd914c0463b8..01350cb8a0b8 100644 --- a/samples/tfm/tfm_hello_world/README.rst +++ b/samples/tfm/tfm_hello_world/README.rst @@ -36,13 +36,13 @@ After programming the sample, the following output is displayed in the console: .. code-block:: console - Hello World! nrf5340dk_nrf5340_cpuapp + Hello World! nrf5340dk/nrf5340/cpuapp Generating random number 0x8aefe6b7473f2e2c170bbd3eb39aa7679bc1e7693a11030b0a4c1c8ba41eb457 Reading some secure memory that NS is allowed to read FICR->INFO.PART: 0x00005340 FICR->INFO.VARIANT: 0x514b4141 - Hashing 'Hello World! nrf5340dk_nrf5340_cpuapp' + Hashing 'Hello World! nrf5340dk/nrf5340/cpuapp' SHA256 digest: 0x12f0c84eecba8497cc0bec1ebc5a785df2ae027a2545921d6cdc0920c5aaefd7 Finished diff --git a/samples/tfm/tfm_hello_world/prj.conf b/samples/tfm/tfm_hello_world/prj.conf index e18d45e550a8..7ed229a5a6fb 100644 --- a/samples/tfm/tfm_hello_world/prj.conf +++ b/samples/tfm/tfm_hello_world/prj.conf @@ -5,5 +5,4 @@ # CONFIG_TFM_PROFILE_TYPE_MINIMAL=y -CONFIG_TFM_BL2=n CONFIG_PSA_WANT_GENERATE_RANDOM=y diff --git a/samples/tfm/tfm_hello_world/sample.yaml b/samples/tfm/tfm_hello_world/sample.yaml index 050bafbc58c7..5f36fd143f76 100644 --- a/samples/tfm/tfm_hello_world/sample.yaml +++ b/samples/tfm/tfm_hello_world/sample.yaml @@ -3,23 +3,16 @@ sample: application, with TF-M enabled name: hello world TFM common: - tags: tfm - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - harness: console - harness_config: - type: multi_line - regex: - - "Hello World! .*" - - "Reading some secure memory that NS is allowed to read" - - ".*" - - "FICR->INFO.RAM: 0x[0-9a-f]{8}" - - "FICR->INFO.FLASH: 0x[0-9a-f]{8}" - - "Generating random number" - - "0x[0-9a-f]{64}" - - "MCU selection .*" + tags: tfm + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns nrf54l15pdk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + harness: console + harness_config: + type: multi_line + regex: + - ".*Example finished successfully!.*" tests: sample.tfm.helloworld: tags: tfm ci_build @@ -27,16 +20,21 @@ tests: sample.tfm.hello_world.bootloaders: tags: tfm ci_build extra_args: CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_SECURE_BOOT=y + CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION=y + platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.bootloaders_debug: build_only: true tags: tfm ci_build extra_args: CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_SECURE_BOOT=y CONFIG_DEBUG_OPTIMIZATIONS=y + platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.full: tags: tfm ci_build extra_args: CONFIG_TFM_PROFILE_TYPE_NOT_SET=y CONFIG_NRF_SECURITY=y + platform_exclude: nrf54l15pdk/nrf54l15/cpuapp/ns sample.tfm.hello_world.lvl2: tags: tfm ci_build 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_hello_world/src/main.c b/samples/tfm/tfm_hello_world/src/main.c index 69463dfb88fd..ae99bc54e4de 100644 --- a/samples/tfm/tfm_hello_world/src/main.c +++ b/samples/tfm/tfm_hello_world/src/main.c @@ -18,24 +18,19 @@ #define HELLO_PATTERN "Hello World! %s" -#define PIN_XL1 0 -#define PIN_XL2 1 +/* + * The samples require a timer mapped as non-secure: + * For nRF91 and nRF53 TIMER1 can be mapped as non-secure + * For nRF54L TIMER1 doesn't exist so we use TIMER00 instead + */ +#if defined(NRF_TIMER1_NS) +#define SAMPLE_NS_TIMER NRF_TIMER1_NS +#elif defined(NRF_TIMER00_NS) +#define SAMPLE_NS_TIMER NRF_TIMER00_NS +#else +#endif #if defined(CONFIG_TFM_PARTITION_PLATFORM) -/* Check if MCU selection is required */ -#if NRF_GPIO_HAS_SEL -static void gpio_pin_control_select(uint32_t pin_number, nrf_gpio_pin_sel_t mcu) -{ - uint32_t err; - enum tfm_platform_err_t plt_err; - - plt_err = tfm_platform_gpio_pin_mcu_select(pin_number, mcu, &err); - if (plt_err != TFM_PLATFORM_ERR_SUCCESS || err != 0) { - printk("tfm_..._gpio_pin_mcu_select failed: plt_err: 0x%x, err: 0x%x\n", - plt_err, err); - } -} -#endif /* NRF_GPIO_HAS_SEL */ static uint32_t secure_read_word(intptr_t ptr) { @@ -52,6 +47,36 @@ static uint32_t secure_read_word(intptr_t ptr) return val; } + +#if defined(NRF_FICR_S) +void demonstrate_secure_memory_access(void) +{ + uint32_t info_ram; + + SAMPLE_NS_TIMER->TASKS_START = 1; + info_ram = secure_read_word((intptr_t)&NRF_FICR_S->INFO.RAM); + SAMPLE_NS_TIMER->TASKS_CAPTURE[0] = 1; + printk("Approximate IPC overhead us: %d\n", SAMPLE_NS_TIMER->CC[0]); + + printk("FICR->INFO.FLASH: 0x%08x\n", + secure_read_word((intptr_t)&NRF_FICR_S->INFO.FLASH)); +} +#elif defined(NRF_APPLICATION_CPUC_S) +void demonstrate_secure_memory_access(void) +{ + uint32_t cpu_id; + + SAMPLE_NS_TIMER->TASKS_START = 1; + cpu_id = secure_read_word((intptr_t)&NRF_APPLICATION_CPUC_S->CPUID); + SAMPLE_NS_TIMER->TASKS_CAPTURE[0] = 1; + printk("Approximate IPC overhead us: %d\n", SAMPLE_NS_TIMER->CC[0]); + printk("NRF_APPLICATION_CPUC_S->CPUID: 0x%08x\n", cpu_id); +} +#else +#error "The samples requires either FICR or the CPUC peripheral mapped as \ + secure to demonstrate secure memory access" +#endif + #endif /* defined(CONFIG_TFM_PARTITION_PLATFORM) */ static void print_hex_number(uint8_t *num, size_t len) @@ -74,18 +99,9 @@ int main(void) printk("%s\n", hello_string); #if defined(CONFIG_TFM_PARTITION_PLATFORM) - uint32_t info_ram; - printk("Reading some secure memory that NS is allowed to read\n"); + demonstrate_secure_memory_access(); - NRF_TIMER1_NS->TASKS_START = 1; - info_ram = secure_read_word((intptr_t)&NRF_FICR_S->INFO.RAM); - NRF_TIMER1_NS->TASKS_CAPTURE[0] = 1; - printk("Approximate IPC overhead us: %d\n", NRF_TIMER1_NS->CC[0]); - - printk("FICR->INFO.RAM: 0x%08x\n", info_ram); - printk("FICR->INFO.FLASH: 0x%08x\n", - secure_read_word((intptr_t)&NRF_FICR_S->INFO.FLASH)); #endif /* defined(CONFIG_TFM_PARTITION_PLATFORM) */ if (IS_ENABLED(CONFIG_TFM_CRYPTO_RNG_MODULE_ENABLED)) { @@ -123,18 +139,6 @@ int main(void) } #if defined(CONFIG_TFM_PARTITION_PLATFORM) -#if NRF_GPIO_HAS_SEL - /* Configure properly the XL1 and XL2 pins so that the low-frequency crystal - * oscillator (LFXO) can be used. - * This configuration has already been done by TF-M so this is redundant. - */ - gpio_pin_control_select(PIN_XL1, NRF_GPIO_PIN_SEL_PERIPHERAL); - gpio_pin_control_select(PIN_XL2, NRF_GPIO_PIN_SEL_PERIPHERAL); - printk("MCU selection configured\n"); -#else - printk("MCU selection skipped\n"); -#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */ - #ifdef PM_S1_ADDRESS bool s0_active = false; int ret; @@ -148,7 +152,7 @@ int main(void) #endif /* PM_S1_ADDRESS */ #endif /* defined(CONFIG_TFM_PARTITION_PLATFORM) */ - printk("Finished\n"); + printk("Example finished successfully!\n"); return 0; } diff --git a/samples/tfm/tfm_psa_template/README.rst b/samples/tfm/tfm_psa_template/README.rst index 1764a10a1248..bede0ef4f1f6 100644 --- a/samples/tfm/tfm_psa_template/README.rst +++ b/samples/tfm/tfm_psa_template/README.rst @@ -37,7 +37,7 @@ Build and flash the provisioning image sample to provision the device with the P .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp nrf/samples/tfm/provisioning_image -d build_provisioning_image + west build -b nrf5340dk/nrf5340/cpuapp nrf/samples/tfm/provisioning_image -d build_provisioning_image west flash --erase -d build_provisioning_image Build and flash the TF-M PSA template sample. @@ -45,7 +45,7 @@ Do not flash with ``--erase`` as this will erase the PSA platform security param .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp_ns nrf/samples/tfm/tfm_psa_template + west build -b nrf5340dk/nrf5340/cpuapp/ns nrf/samples/tfm/tfm_psa_template west flash Testing @@ -160,7 +160,7 @@ To upload a new application image, build an application with an updated image ve .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp_ns nrf/samples/tfm/tfm_psa_template -d build_update \ + west build -b nrf5340dk/nrf5340/cpuapp/ns nrf/samples/tfm/tfm_psa_template -d build_update \ -DCONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION=\"1.2.3\" Then upload the new application image to the device. @@ -194,7 +194,7 @@ The bootloader is placed in slot 0 by default, so enable building of the slot 1 .. code-block:: console - west build -b nrf5340dk_nrf5340_cpuapp_ns nrf/samples/tfm/tfm_psa_template \ + west build -b nrf5340dk/nrf5340/cpuapp/ns nrf/samples/tfm/tfm_psa_template \ -DCONFIG_BUILD_S1_VARIANT=y \ -Dmcuboot_CONFIG_FW_INFO_FIRMWARE_VERSION=2 diff --git a/samples/tfm/tfm_psa_template/child_image/mcuboot/prj.conf b/samples/tfm/tfm_psa_template/child_image/mcuboot/prj.conf index 3be9e0a19b4d..63bf953fdbf0 100644 --- a/samples/tfm/tfm_psa_template/child_image/mcuboot/prj.conf +++ b/samples/tfm/tfm_psa_template/child_image/mcuboot/prj.conf @@ -24,3 +24,6 @@ CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y CONFIG_BOOT_SIGNATURE_TYPE_RSA=n ### Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y + +### Make MCUboot 0x200 smaller to make it fit inside an SPU region +CONFIG_PM_PARTITION_SIZE_MCUBOOT=0xbe00 diff --git a/samples/tfm/tfm_psa_template/sample.yaml b/samples/tfm/tfm_psa_template/sample.yaml index 3e5995d2bac4..0161cc33d571 100644 --- a/samples/tfm/tfm_psa_template/sample.yaml +++ b/samples/tfm/tfm_psa_template/sample.yaml @@ -2,11 +2,11 @@ sample: description: TF-M PSA Template name: TF-M PSA Template common: - tags: tfm - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + tags: tfm + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns tests: sample.tfm.psa_template: tags: tfm ci_build diff --git a/samples/tfm/tfm_secure_peripheral/sample.yaml b/samples/tfm/tfm_secure_peripheral/sample.yaml index 50af0f70918a..3e632d8d2a5a 100644 --- a/samples/tfm/tfm_secure_peripheral/sample.yaml +++ b/samples/tfm/tfm_secure_peripheral/sample.yaml @@ -1,19 +1,19 @@ sample: - name: TF-M Secure Peripheral Sample - description: TF-M sample demonstrating use of secure peripherals in a - secure partition + name: TF-M Secure Peripheral Sample + description: | + TF-M sample demonstrating use of secure peripherals in a secure partition common: - tags: tfm - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - harness: console - harness_config: - type: multi_line - regex: - - "SPP: sending message: Success" - - "SPP: processing signals: Success" + tags: tfm + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + harness: console + harness_config: + type: multi_line + regex: + - "SPP: sending message: Success" + - "SPP: processing signals: Success" tests: - sample.tfm.secure_peripheral: - tags: tfm ci_build + sample.tfm.secure_peripheral: + tags: tfm ci_build diff --git a/samples/wifi/ble_coex/Kconfig b/samples/wifi/ble_coex/Kconfig index 2a5761841cfb..102917c653c3 100644 --- a/samples/wifi/ble_coex/Kconfig +++ b/samples/wifi/ble_coex/Kconfig @@ -42,42 +42,6 @@ config TEST_TYPE_BLE help Enable BLE -config STA_SAMPLE_SSID - string "SSID" - default "coex_24" - help - Specify the SSID to connect - -choice STA_KEY_MGMT_SELECT - prompt "Security Option" - default STA_KEY_MGMT_NONE - -config STA_KEY_MGMT_NONE - bool "Open Security" - help - Enable for Open Security - -config STA_KEY_MGMT_WPA2 - bool "WPA2 Security" - help - Enable for WPA2 Security - -config STA_KEY_MGMT_WPA2_256 - bool "WPA2 SHA 256 Security" - help - Enable for WPA2-PSK-256 Security - -config STA_KEY_MGMT_WPA3 - bool "WPA3 Security" - help - Enable for WPA3 Security -endchoice - -config STA_SAMPLE_PASSWORD - string "Passphrase (WPA2) or password (WPA3)" - help - Specify the Password to connect - config NET_CONFIG_PEER_IPV4_ADDR string "Peer IPv4 address" default "192.168.1.253" diff --git a/samples/wifi/ble_coex/README.rst b/samples/wifi/ble_coex/README.rst index cdd741f1dd1e..2147a1cadb8d 100644 --- a/samples/wifi/ble_coex/README.rst +++ b/samples/wifi/ble_coex/README.rst @@ -72,113 +72,50 @@ Configuration options The following sample-specific Kconfig options are used in this sample (located in :file:`samples/wifi/ble_coex/Kconfig`): -.. _CONFIG_COEX_SEP_ANTENNAS: +.. options-from-kconfig:: + :show-type: -CONFIG_COEX_SEP_ANTENNAS - This option specifies whether the antennas are shared or separate for Bluetooth and WLAN. - -.. _CONFIG_TEST_TYPE_WLAN_ONLY: - -CONFIG_TEST_TYPE_WLAN_ONLY - This option enables the WLAN test type. - -.. _CONFIG_TEST_TYPE_BLE_ONLY: - -CONFIG_TEST_TYPE_BLE_ONLY - This option enables the Bluetooth LE test type. - -.. _CONFIG_TEST_TYPE_WLAN_BLE: - -CONFIG_TEST_TYPE_WLAN_BLE - This option enables concurrent WLAN and Bluetooth LE tests. - -.. _CONFIG_WIFI_TEST_DURATION: - -CONFIG_WIFI_TEST_DURATION - This option sets the Wi-Fi test duration in milliseconds. - -.. _CONFIG_BLE_TEST_DURATION: - -CONFIG_BLE_TEST_DURATION - This option sets the Bluetooth test duration in milliseconds. - -.. _CONFIG_INTERVAL_MIN: - -CONFIG_INTERVAL_MIN - This option sets the Bluetooth minimum connection interval (each unit is 1.25 milliseconds). - -.. _CONFIG_INTERVAL_MAX: - -CONFIG_INTERVAL_MAX - This option sets the Bluetooth maximum connection interval (each unit is 1.25 milliseconds). - -.. _CONFIG_STA_SAMPLE_SSID: - -CONFIG_STA_SAMPLE_SSID - This option specifies the SSID to connect. - -.. _CONFIG_STA_SAMPLE_PASSWORD: - -CONFIG_STA_SAMPLE_PASSWORD - This option specifies the passphrase (WPA2) or password WPA3 to connect. - -.. _CONFIG_STA_KEY_MGMT_*: - -CONFIG_STA_KEY_MGMT_* - These options specify the key security option. - -.. _CONFIG_BT_THROUGHPUT_FILE: - -CONFIG_BT_THROUGHPUT_FILE - This option selects the type of the throughput test. - -.. _CONFIG_BT_THROUGHPUT_DURATION: - -CONFIG_BT_THROUGHPUT_DURATION - This option sets the Bluetooth throughput test duration in milliseconds. - -Configuration files -=================== +Additional configuration +======================== To enable different test modes, set up the following configuration parameters in the :file:`prj.conf` file: -* Antenna configuration: Use the :ref:`CONFIG_COEX_SEP_ANTENNAS ` Kconfig option to select the antenna configuration. +* Antenna configuration: Use the :kconfig:option:`CONFIG_COEX_SEP_ANTENNAS` Kconfig option to select the antenna configuration. Set it to ``y`` to enable separate antennas and ``n`` to enable shared antenna. * Test modes: Use the following Kconfig options to select the required test case: - * :ref:`CONFIG_TEST_TYPE_WLAN_ONLY ` for Wi-Fi only test - * :ref:`CONFIG_TEST_TYPE_BLE_ONLY ` for Bluetooth LE only test - * :ref:`CONFIG_TEST_TYPE_WLAN_BLE ` for concurrent Wi-Fi and Bluetooth LE test. + * :kconfig:option:`CONFIG_TEST_TYPE_WLAN_ONLY` for Wi-Fi only test + * :kconfig:option:`CONFIG_TEST_TYPE_BLE_ONLY` for Bluetooth LE only test + * :kconfig:option:`CONFIG_TEST_TYPE_WLAN_BLE` for concurrent Wi-Fi and Bluetooth LE test. Based on the required test, set only one of these to ``y``. -* Test duration: Use the :ref:`CONFIG_WIFI_TEST_DURATION ` Kconfig option to set the duration of the Wi-Fi test and :ref:`CONFIG_BLE_TEST_DURATION ` for the Bluetooth LE test. +* Test duration: Use the :kconfig:option:`CONFIG_WIFI_TEST_DURATION` Kconfig option to set the duration of the Wi-Fi test and :kconfig:option:`CONFIG_BLE_TEST_DURATION` for the Bluetooth LE test. The units are in milliseconds. For example, to set the tests for 20 seconds, set the respective values to ``20000``. For the concurrent Wi-Fi and Bluetooth LE test, make sure that both are set to the same duration to ensure maximum overlap. -* Bluetooth LE configuration: Set the Bluetooth LE connection interval limits using the :ref:`CONFIG_INTERVAL_MIN ` and :ref:`CONFIG_INTERVAL_MAX ` Kconfig options. +* Bluetooth LE configuration: Set the Bluetooth LE connection interval limits using the :kconfig:option:`CONFIG_INTERVAL_MIN` and :kconfig:option:`CONFIG_INTERVAL_MAX` Kconfig options. The units are 1.25 milliseconds. For example, ``CONFIG_INTERVAL_MIN=80`` corresponds to an interval of 100 ms (80 x 1.25). -* Wi-Fi connection: Set the following options appropriately as per the credentials of the access point used for this testing: +* Wi-Fi connection: Use the :kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV4_ADDR` Kconfig option to establish a connection to a peer host. + +You must configure the following Wi-Fi credentials in the :file:`prj.conf` file: - * :ref:`CONFIG_STA_SAMPLE_SSID ` - * :ref:`CONFIG_STA_SAMPLE_PASSWORD ` - * :ref:`CONFIG_STA_KEY_MGMT_* ` - * :kconfig:option:`CONFIG_NET_CONFIG_PEER_IPV4_ADDR` +.. include:: /includes/wifi_credentials_static.txt .. note:: - ``menuconfig`` can also be used to enable the ``Key management`` option. + 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``. Set up the following configuration parameters in the :file:`prj_nrf5340dk_nrf5340_cpuapp.conf` file: -* File or time-based throughput: Use :ref:`CONFIG_BT_THROUGHPUT_FILE ` to select file or time-based throughput test. +* File or time-based throughput: Use :kconfig:option:`CONFIG_BT_THROUGHPUT_FILE` to select file or time-based throughput test. Set it to ``n`` to enable time-based throughput test only when running Bluetooth LE throughput in central role. -* Test duration: Use :ref:`CONFIG_BT_THROUGHPUT_DURATION ` to set the duration of the Bluetooth LE throughput test only when running Bluetooth LE throughput in central role. +* Test duration: Use :kconfig:option:`CONFIG_BT_THROUGHPUT_DURATION` to set the duration of the Bluetooth LE throughput test only when running Bluetooth LE throughput in central role. The units are in milliseconds. .. note:: - Use the same test duration value for :ref:`CONFIG_WIFI_TEST_DURATION `, :ref:`CONFIG_BLE_TEST_DURATION `, and :ref:`CONFIG_BT_THROUGHPUT_DURATION `. + Use the same test duration value for :kconfig:option:`CONFIG_WIFI_TEST_DURATION`, :kconfig:option:`CONFIG_BLE_TEST_DURATION`, and :kconfig:option:`CONFIG_BT_THROUGHPUT_DURATION`. Building and running ******************** @@ -193,14 +130,14 @@ The sample can be built for the following configurations: * Bluetooth LE throughput only * Concurrent Wi-Fi and Bluetooth LE throughput (with coexistence enabled and disabled mode) -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following are examples of the CLI commands: * Build with coexistence disabled: .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=n -Dhci_ipc_CONFIG_MPSL_CX=n + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_MPSL_CX=n -Dhci_ipc_CONFIG_MPSL_CX=n Use this command for Wi-Fi throughput only, Bluetooth LE throughput only, or concurrent Wi-Fi and Bluetooth LE throughput with coexistence disabled tests. @@ -208,7 +145,7 @@ Use this command for Wi-Fi throughput only, Bluetooth LE throughput only, or con .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_MPSL_CX=y -Dhci_ipc_CONFIG_MPSL_CX=y + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_MPSL_CX=y -Dhci_ipc_CONFIG_MPSL_CX=y Use this command for concurrent Wi-Fi and Bluetooth LE throughput with coexistence enabled test. @@ -218,13 +155,13 @@ Change the build target as given below for the nRF7001 DK, nRF7002 EK and nRF700 .. code-block:: console - nrf7002dk_nrf7001_nrf5340_cpuapp + nrf7002dk/nrf5340/cpuapp/nrf7001 * Build target for nRF7002 EK and nRF7001 EK: .. code-block:: console - nrf5340dk_nrf5340_cpuapp + nrf5340dk/nrf5340/cpuapp Add the following SHIELD options for the nRF7002 EK and nRF7001 EK. @@ -248,7 +185,7 @@ Build for the nRF5340 DK: .. code-block:: console - west build -p -b nrf5340dk_nrf5340_cpuapp + west build -p -b nrf5340dk/nrf5340/cpuapp The generated HEX file to be used is :file:`throughput/build/zephyr/merged_domains.hex`. diff --git a/samples/wifi/ble_coex/prj.conf b/samples/wifi/ble_coex/prj.conf index ac3f0d6045d2..55d4871c488b 100644 --- a/samples/wifi/ble_coex/prj.conf +++ b/samples/wifi/ble_coex/prj.conf @@ -10,10 +10,6 @@ CONFIG_WIFI_NRF700X=y # WPA supplicant CONFIG_WPA_SUPP=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - # Networking CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y @@ -39,7 +35,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -70,13 +65,11 @@ CONFIG_NET_BUF_TX_COUNT=48 CONFIG_HEAP_MEM_POOL_SIZE=200000 CONFIG_NET_BUF_DATA_SIZE=1100 -# Below configs need to be modified based on security -# CONFIG_STA_KEY_MGMT_NONE=y -# CONFIG_STA_KEY_MGMT_WPA2=y -# CONFIG_STA_KEY_MGMT_WPA2_256=y -# CONFIG_STA_KEY_MGMT_WPA3=y -CONFIG_STA_SAMPLE_SSID="Myssid" -CONFIG_STA_SAMPLE_PASSWORD="Mypassword" +CONFIG_WIFI_MGMT_EXT=y +CONFIG_WIFI_CREDENTIALS=y +CONFIG_WIFI_CREDENTIALS_STATIC=y +CONFIG_WIFI_CREDENTIALS_STATIC_SSID="Myssid" +CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="Mypassword" CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99" CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0" diff --git a/samples/wifi/ble_coex/sample.yaml b/samples/wifi/ble_coex/sample.yaml index 7854584cb7d7..14795d97a548 100644 --- a/samples/wifi/ble_coex/sample.yaml +++ b/samples/wifi/ble_coex/sample.yaml @@ -6,51 +6,51 @@ tests: sample.nrf7002.ble_coex_sep_ant: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y - platform_allow: nrf7002dk_nrf5340_cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.ble_coex_sha_ant: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=n - platform_allow: nrf7002dk_nrf5340_cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.ble_coex: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 extra_args: CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build # Daughter boards (EK's/EB's) do not have a shared antenna sample.nrf7002ek.ble_coex: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: SHIELD=nrf7002ek hci_ipc_SHIELD=nrf7002ek_coex CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001ek.ble_coex: build_only: true integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_args: SHIELD=nrf7002ek_nrf7001 hci_ipc_SHIELD=nrf7002ek_nrf7001_coex CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp sample.nrf7002_eb.thingy53.ble_coex: build_only: true extra_args: SHIELD=nrf7002eb hci_ipc_SHIELD=nrf7002eb_coex CONFIG_MPSL_CX=y hci_ipc_CONFIG_MPSL_CX=y CONFIG_COEX_SEP_ANTENNAS=y integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/ble_coex/src/bt_throughput_test.c b/samples/wifi/ble_coex/src/bt_throughput_test.c index 4299b6528986..a12698c3f93c 100644 --- a/samples/wifi/ble_coex/src/bt_throughput_test.c +++ b/samples/wifi/ble_coex/src/bt_throughput_test.c @@ -41,7 +41,7 @@ static volatile bool data_length_req; static volatile bool test_ready; static struct bt_conn *default_conn; static struct bt_throughput throughput; -static struct bt_uuid *uuid128 = BT_UUID_THROUGHPUT; +static const struct bt_uuid *uuid128 = BT_UUID_THROUGHPUT; static struct bt_gatt_exchange_params exchange_params; static struct bt_le_conn_param *conn_param = diff --git a/samples/wifi/ble_coex/src/main.c b/samples/wifi/ble_coex/src/main.c index 826efe515655..4f25232a356a 100644 --- a/samples/wifi/ble_coex/src/main.c +++ b/samples/wifi/ble_coex/src/main.c @@ -34,6 +34,8 @@ LOG_MODULE_REGISTER(coex, CONFIG_LOG_DEFAULT_LEVEL); #include #include +#include + /* For net_sprint_ll_addr_buf */ #include "net_private.h" @@ -189,47 +191,11 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, } } -static int __wifi_args_to_params(struct wifi_connect_req_params *params) -{ - params->timeout = SYS_FOREVER_MS; - - /* Defaults */ - params->band = WIFI_FREQ_BAND_UNKNOWN; - params->channel = WIFI_CHANNEL_ANY; - params->security = WIFI_SECURITY_TYPE_NONE; - params->mfp = WIFI_MFP_OPTIONAL; - - /* SSID */ - params->ssid = CONFIG_STA_SAMPLE_SSID; - params->ssid_length = strlen(params->ssid); - -#if defined(CONFIG_STA_KEY_MGMT_WPA2) - params->security = 1; -#elif defined(CONFIG_STA_KEY_MGMT_WPA2_256) - params->security = 2; -#elif defined(CONFIG_STA_KEY_MGMT_WPA3) - params->security = 3; -#else - params->security = 0; -#endif - -#if !defined(CONFIG_STA_KEY_MGMT_NONE) - params->psk = CONFIG_STA_SAMPLE_PASSWORD; - params->psk_length = strlen(params->psk); -#endif - - return 0; -} - static int wifi_connect(void) { - struct net_if *iface = net_if_get_default(); - static struct wifi_connect_req_params cnx_params; - - __wifi_args_to_params(&cnx_params); + struct net_if *iface = net_if_get_first_wifi(); - if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, - &cnx_params, sizeof(struct wifi_connect_req_params))) { + if (net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0)) { LOG_ERR("Connection request failed"); return -ENOEXEC; @@ -327,7 +293,7 @@ static void udp_upload_results_cb(enum zperf_status status, } /* print results */ LOG_INF("Upload results:"); - LOG_INF("%u bytes in %u ms", + LOG_INF("%u bytes in %llu ms", (result->nb_packets_sent * result->packet_size), (result->client_time_in_us / USEC_PER_MSEC)); LOG_INF("%u packets sent", result->nb_packets_sent); @@ -399,14 +365,14 @@ int main(void) LOG_INF("test_wlan = %d and test_ble = %d\n", test_wlan, test_ble); -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH /* Configure SR side (nRF5340 side) switch for nRF700x DK */ ret = nrf_wifi_config_sr_switch(separate_antennas); if (ret != 0) { LOG_ERR("Unable to configure SR side switch: %d\n", ret); goto err; } -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ if (test_wlan) { /* Wi-Fi connection */ diff --git a/samples/wifi/monitor/README.rst b/samples/wifi/monitor/README.rst index 208d55f51dd3..38ae0a6c9e00 100644 --- a/samples/wifi/monitor/README.rst +++ b/samples/wifi/monitor/README.rst @@ -43,18 +43,18 @@ Building and running .. include:: /includes/build_and_run_ns.txt -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp Change the build target as given below for the nRF7002 EK. .. code-block:: console - nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf7002ek + nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek Testing ======= diff --git a/samples/wifi/monitor/prj.conf b/samples/wifi/monitor/prj.conf index ca50692b729e..608e38b6926d 100644 --- a/samples/wifi/monitor/prj.conf +++ b/samples/wifi/monitor/prj.conf @@ -13,10 +13,6 @@ CONFIG_NRF700X_RAW_DATA_RX=y # WPA supplicant CONFIG_WPA_SUPP=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - # Networking CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y @@ -32,7 +28,7 @@ CONFIG_NET_PKT_TX_COUNT=3 CONFIG_NET_BUF_RX_COUNT=60 CONFIG_NET_BUF_TX_COUNT=6 CONFIG_NET_BUF_DATA_SIZE=1500 -CONFIG_HEAP_MEM_POOL_SIZE=156000 +CONFIG_HEAP_MEM_POOL_SIZE=200000 CONFIG_NET_TC_TX_COUNT=1 CONFIG_INIT_STACKS=y @@ -42,7 +38,6 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2560 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -50,6 +45,7 @@ CONFIG_NET_RX_STACK_SIZE=4096 CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_POSIX_CLOCK=y +CONFIG_POSIX_API=y # printing of scan results puts pressure on queues in new locking # design in net_mgmt. So, use a higher timeout for a crowded diff --git a/samples/wifi/monitor/sample.yaml b/samples/wifi/monitor/sample.yaml index fcba72c959c1..9cafe78559ae 100644 --- a/samples/wifi/monitor/sample.yaml +++ b/samples/wifi/monitor/sample.yaml @@ -6,27 +6,27 @@ tests: sample.nrf7002.monitor: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eks.monitor: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7000.monitor: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.monitor: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build diff --git a/samples/wifi/monitor/src/main.c b/samples/wifi/monitor/src/main.c index 6405f006ee53..e287a764a24e 100644 --- a/samples/wifi/monitor/src/main.c +++ b/samples/wifi/monitor/src/main.c @@ -8,6 +8,13 @@ * @brief Wi-Fi Monitor sample */ +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #include #include #include @@ -488,7 +495,8 @@ static int wifi_net_capture(void) int main(void) { #ifdef CONFIG_USB_DEVICE_STACK - struct in_addr addr; + struct in_addr addr = { 0 }; + struct in_addr mask; #endif int ret; @@ -513,10 +521,10 @@ int main(void) if (sizeof(CONFIG_NET_CONFIG_USB_IPV4_MASK) > 1) { /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_USB_IPV4_MASK, &addr)) { + if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_USB_IPV4_MASK, &mask)) { printk("Invalid netmask: %s", CONFIG_NET_CONFIG_USB_IPV4_MASK); } else { - net_if_ipv4_set_netmask(iface, &addr); + net_if_ipv4_set_netmask_by_addr(iface, &addr, &mask); } } #endif @@ -535,6 +543,8 @@ int main(void) net_config_init_app(dev, "Initializing network"); #endif + /* TODO: Add proper synchronization to wait for WPA supplicant initialization */ + k_sleep(K_SECONDS(2)); ret = wifi_set_mode(); if (ret) { diff --git a/samples/wifi/provisioning/prj.conf b/samples/wifi/provisioning/prj.conf index 2310ec86bff3..a31ca1ea07cf 100644 --- a/samples/wifi/provisioning/prj.conf +++ b/samples/wifi/provisioning/prj.conf @@ -9,10 +9,6 @@ CONFIG_WIFI_NRF700X=y # WPA supplicant CONFIG_WPA_SUPP=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - # Networking CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y @@ -55,7 +51,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/provisioning/sample.yaml b/samples/wifi/provisioning/sample.yaml index b61f32ad18a8..cb2e9d14aef2 100644 --- a/samples/wifi/provisioning/sample.yaml +++ b/samples/wifi/provisioning/sample.yaml @@ -6,34 +6,34 @@ tests: sample.nrf7002.provisioning: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.provisioning: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build skip: true sample.nrf7002_eks.provisioning: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001_eks.provisioning: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eb.thingy53.provisioning: build_only: true extra_args: SHIELD=nrf7002eb integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/radio_test/prj.conf b/samples/wifi/radio_test/prj.conf index 4afe72a3dbd9..5039b7c6d249 100644 --- a/samples/wifi/radio_test/prj.conf +++ b/samples/wifi/radio_test/prj.conf @@ -7,16 +7,11 @@ CONFIG_WIFI=y CONFIG_WIFI_NRF700X=y CONFIG_NRF700X_RADIO_TEST=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - #CONFIG_INIT_STACKS=y # Memories CONFIG_MAIN_STACK_SIZE=4096 CONFIG_SHELL_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 #64K memory needed for IQ sample captures. CONFIG_HEAP_MEM_POOL_SIZE=98304 diff --git a/samples/wifi/radio_test/radio_test_subcommands.rst b/samples/wifi/radio_test/radio_test_subcommands.rst index f7a3633ea5e7..0b6a8c01f5c3 100644 --- a/samples/wifi/radio_test/radio_test_subcommands.rst +++ b/samples/wifi/radio_test/radio_test_subcommands.rst @@ -88,10 +88,10 @@ Wi-Fi radio test subcommands - Configuration - Enable/Disable Short guard interval (GI) while transmitting the packet. * - tx_pkt_preamble - - | 0 - Short Preamble - | 1 - Long Preamble + - | 0 - Long Preamble + | 1 - Short Preamble | 2 - Mixed Preamble - - 1 + - 0 - Configuration - Type of preamble to be used for each packet. Short/Long Preamble are applicable only when tx_pkt_tput_mode is set to Legacy and Mixed Preamble is applicable only when tx_pkt_tput_mode is set to HT/VHT. * - tx_pkt_mcs diff --git a/samples/wifi/radio_test/sample.yaml b/samples/wifi/radio_test/sample.yaml index 9c6605b1f29c..5d9050a4afc5 100644 --- a/samples/wifi/radio_test/sample.yaml +++ b/samples/wifi/radio_test/sample.yaml @@ -6,54 +6,54 @@ tests: sample.nrf7002.radio_test: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.radio_test: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build skip: true sample.nrf7002.radio_test_combo: build_only: true extra_args: CONFIG_NRF700X_RADIO_TEST_COMBO=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eks.radio_test: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.nrf7001_eks.radio_test: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.nrf7000_eks.radio_test: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build sample.nrf7002_eb.thingy53.radio_test: build_only: true extra_args: SHIELD=nrf7002eb integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build sample.thingy91x_nrf7002.radio_test: build_only: true - platform_allow: thingy91x_nrf9151_ns + platform_allow: thingy91x/nrf9151/ns tags: ci_build diff --git a/samples/wifi/radio_test/sample_description.rst b/samples/wifi/radio_test/sample_description.rst index c3af518670be..e16972f65e9b 100644 --- a/samples/wifi/radio_test/sample_description.rst +++ b/samples/wifi/radio_test/sample_description.rst @@ -57,19 +57,19 @@ Currently, the following configurations are supported: * nRF7002 EK + SPIM -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp -To build for the nRF7002 EK and nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. +To build for the nRF7002 EK and nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build 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 + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek See also :ref:`cmake_options` for instructions on how to provide CMake options. @@ -169,7 +169,7 @@ Testing .. note:: Edge backoff and antenna gain are configured in the Kconfig file. - To overwrite these backoffs with user-specified backoffs, use the``set_edge_bo`` and ``set_ant_gain`` commands. + To overwrite these backoffs with user-specified backoffs, use the ``set_edge_bo`` and ``set_ant_gain`` commands. These backoffs are applied only when the ``bypass_reg_domain`` is set to ``0``. diff --git a/samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c b/samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c index 11eee77a1230..c0ba97ab2c58 100644 --- a/samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c +++ b/samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c @@ -320,7 +320,7 @@ enum nrf_wifi_status nrf_wifi_radio_test_conf_init(struct rpu_conf_params *conf_ conf_params->tx_mode = 1; conf_params->tx_pkt_num = -1; conf_params->tx_pkt_len = 1400; - conf_params->tx_pkt_preamble = 1; + conf_params->tx_pkt_preamble = 0; conf_params->tx_pkt_rate = 6; conf_params->he_ltf = 2; conf_params->he_gi = 2; @@ -1352,7 +1352,7 @@ static int nrf_wifi_radio_test_set_rx(const struct shell *shell, return 0; } -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH static int nrf_wifi_radio_test_sr_ant_switch_ctrl(const struct shell *shell, size_t argc, const char *argv[]) @@ -1370,7 +1370,7 @@ static int nrf_wifi_radio_test_sr_ant_switch_ctrl(const struct shell *shell, return sr_ant_switch(val); } -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ static int nrf_wifi_radio_test_rx_cap(const struct shell *shell, @@ -1938,7 +1938,7 @@ static int nrf_wifi_radio_test_show_cfg(const struct shell *shell, shell_fprintf(shell, SHELL_INFO, - "rx_lna_gain = %d\n", + "rx_bb_gain = %d\n", conf_params->bb_gain); shell_fprintf(shell, @@ -1973,6 +1973,17 @@ static int nrf_wifi_radio_test_show_cfg(const struct shell *shell, SHELL_INFO, "bypass_reg_domain = %d\n", conf_params->bypass_regulatory); + + shell_fprintf(shell, + SHELL_INFO, + "ru_tone = %d\n", + conf_params->ru_tone); + + shell_fprintf(shell, + SHELL_INFO, + "ru_index = %d\n", + conf_params->ru_index); + return 0; } @@ -2234,8 +2245,8 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 0), SHELL_CMD_ARG(tx_pkt_preamble, NULL, - "0 - Short preamble\n" - "1 - Long preamble\n" + "0 - Long preamble\n" + "1 - Short preamble\n" "2 - Mixed preamble ", nrf_wifi_radio_test_set_tx_pkt_preamble, 2, @@ -2316,7 +2327,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_radio_test_set_rx, 2, 0), -#ifdef CONFIG_NRF700X_RADIO_COEX +#ifdef CONFIG_NRF700X_SR_COEX_RF_SWITCH SHELL_CMD_ARG(sr_ant_switch_ctrl, NULL, "0 - Switch set to use the BLE antenna\n" @@ -2324,7 +2335,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_radio_test_sr_ant_switch_ctrl, 2, 0), -#endif /* CONFIG_NRF700X_RADIO_COEX */ +#endif /* CONFIG_NRF700X_SR_COEX_RF_SWITCH */ SHELL_CMD_ARG(rx_lna_gain, NULL, " - LNA gain to be configured.\n" @@ -2399,7 +2410,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 0), SHELL_CMD_ARG(compute_optimal_xo_val, NULL, - "Experimental", + "Compute optimal XO trim value", nrf_wifi_radio_comp_opt_xo_val, 1, 0), @@ -2445,13 +2456,13 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 0), SHELL_CMD_ARG(set_ant_gain, NULL, - " - Value in dB", + " - Antenna gain in dB (Min: 0, Max: 6)", nrf_wifi_radio_test_set_ant_gain, 2, 0), SHELL_CMD_ARG(set_edge_bo, NULL, - " - Value in dB", + " - Edge backoff in dB (Min: 0, Max: 10)", nrf_wifi_radio_test_set_edge_bo, 2, 0), diff --git a/samples/wifi/raw_tx_packet/Kconfig b/samples/wifi/raw_tx_packet/Kconfig index 14f2e00182ed..e0a9b1404236 100644 --- a/samples/wifi/raw_tx_packet/Kconfig +++ b/samples/wifi/raw_tx_packet/Kconfig @@ -8,45 +8,13 @@ source "Kconfig.zephyr" menu "Nordic Raw Tx Packet sample" -config CONNECTION_TIMEOUT +config RAW_TX_PKT_SAMPLE_CONNECTION_TIMEOUT int "Time to wait for a station to connect" default 30 -config RAW_TX_PKT_SAMPLE_SSID - string "SSID" - help - Specify the SSID to establish a wireless connection with - an Access point in Connected Station mode. - -choice RAW_TX_PKT_SAMPLE_KEY_MGMT_SELECT - prompt "Security Option" - default RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA3 - -config RAW_TX_PKT_SAMPLE_KEY_MGMT_NONE - bool "Open Security" - help - Enable for Open Security - -config RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2 - bool "WPA2 Security" - help - Enable for WPA2 Security - -config RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2_256 - bool "WPA2 SHA 256 Security" - help - Enable for WPA2-PSK-256 Security - -config RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA3 - bool "WPA3 Security" - help - Enable for WPA3 Security -endchoice - -config RAW_TX_PKT_SAMPLE_PASSWORD - string "Passphrase (WPA2) or password (WPA3)" - help - Specify the Password to connect +config RAW_TX_PKT_SAMPLE_DHCP_TIMEOUT_S + int "DHCP timeout in seconds" + default 20 config RAW_TX_PKT_SAMPLE_STA_ONLY_MODE bool "Set Wi-Fi Station mode" diff --git a/samples/wifi/raw_tx_packet/README.rst b/samples/wifi/raw_tx_packet/README.rst index f913afafe89b..469ea30b2430 100644 --- a/samples/wifi/raw_tx_packet/README.rst +++ b/samples/wifi/raw_tx_packet/README.rst @@ -52,17 +52,12 @@ By using the following Kconfig options, you can configure the sample for differe To configure the sample in connected Station mode, you must configure the following Wi-Fi credentials in the :file:`prj.conf` file: - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_SSID`: Sets the name of your Wi-Fi network. - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_NONE`: Selects open security. - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2`: Selects PSK security. - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2_256`: Selects PSK-256 security. - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA3`: Selects SAE security (default). - * :kconfig:option:`CONFIG_RAW_TX_PKT_SAMPLE_PASSWORD`: Sets the password of your Wi-Fi network. +.. include:: /includes/wifi_credentials_static.txt - .. note:: - You can also use ``menuconfig`` to enable the ``Key management`` option. +.. 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``. +See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run ``menuconfig``. * For non-connected Station mode @@ -116,38 +111,38 @@ The sample can be built for the following configurations: * Continuous raw 802.11 packet transmission in the non-connected Station mode. * Fixed number of raw 802.11 packet transmission in the non-connected Station mode. -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following are examples of the CLI commands: * Continuous raw 802.11 packet transmission in the connected Station mode: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_CONNECTION_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_CONTINUOUS=y + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_CONNECTION_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_CONTINUOUS=y * Fixed number of raw 802.11 packet transmission in the connected Station mode: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_CONNECTION_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_FIXED=y -DCONFIG_RAW_TX_PKT_SAMPLE_FIXED_NUM_PACKETS= + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_CONNECTION_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_FIXED=y -DCONFIG_RAW_TX_PKT_SAMPLE_FIXED_NUM_PACKETS= * Continuous raw 802.11 packet transmission in the non-connected Station mode: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_NON_CONNECTED_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_CONTINUOUS=y + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_NON_CONNECTED_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_CONTINUOUS=y * Fixed number of raw 802.11 packet transmission in the non-connected Station mode: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_NON_CONNECTED_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_FIXED=y -DCONFIG_RAW_TX_PKT_SAMPLE_FIXED_NUM_PACKETS= + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_RAW_TX_PKT_SAMPLE_NON_CONNECTED_MODE=y -DCONFIG_RAW_TX_PKT_SAMPLE_TX_MODE_FIXED=y -DCONFIG_RAW_TX_PKT_SAMPLE_FIXED_NUM_PACKETS= Change the build target as given below for the nRF7002 EK. .. code-block:: console - nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf7002ek + nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek Testing ======= @@ -168,7 +163,7 @@ Testing [00:00:00.618,713] net_config: Waiting interface 1 (0x20001570) to be up... [00:00:00.618,835] net_config: IPv4 address: 192.168.1.99 [00:00:00.618,896] net_config: Running dhcpv4 client... - [00:00:00.619,140] raw_tx_packet: Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 64 MHz + [00:00:00.619,140] raw_tx_packet: Starting nrf7002dk/nrf5340/cpuapp with CPU frequency: 64 MHz [00:00:01.619,293] raw_tx_packet: Static IP address (overridable): 192.168.1.99/255.255.255.0 -> 192.168.1.1 [00:00:01.632,507] raw_tx_packet: Wi-Fi channel set to 6 [00:00:01.632,598] raw_tx_packet: Sending 25 number of raw tx packets diff --git a/samples/wifi/raw_tx_packet/prj.conf b/samples/wifi/raw_tx_packet/prj.conf index 1729310d9f60..2ae5594c39d8 100644 --- a/samples/wifi/raw_tx_packet/prj.conf +++ b/samples/wifi/raw_tx_packet/prj.conf @@ -11,17 +11,11 @@ CONFIG_NRF700X_RAW_DATA_TX=y # WPA supplicant CONFIG_WPA_SUPP=y -# Below configs need to be modified based on security -# CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_NONE=y -# CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2=y -# CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2_256=y -# CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA3=y -CONFIG_RAW_TX_PKT_SAMPLE_SSID="Myssid" -CONFIG_RAW_TX_PKT_SAMPLE_PASSWORD="Mypassword" - -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n +CONFIG_WIFI_MGMT_EXT=y +CONFIG_WIFI_CREDENTIALS=y +CONFIG_WIFI_CREDENTIALS_STATIC=y +CONFIG_WIFI_CREDENTIALS_STATIC_SSID="Myssid" +CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="Mypassword" # Networking CONFIG_NETWORKING=y @@ -58,7 +52,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -77,6 +70,7 @@ CONFIG_ENTROPY_GENERATOR=y CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_POSIX_CLOCK=y +CONFIG_POSIX_API=y CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99" CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0" diff --git a/samples/wifi/raw_tx_packet/sample.yaml b/samples/wifi/raw_tx_packet/sample.yaml index dccbee51c25e..ac3f74f2b7de 100644 --- a/samples/wifi/raw_tx_packet/sample.yaml +++ b/samples/wifi/raw_tx_packet/sample.yaml @@ -6,27 +6,27 @@ tests: sample.nrf7002.raw_tx_packet: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eks.raw_tx_packet: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7000.raw_tx_packet: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.raw_tx_packet: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build diff --git a/samples/wifi/raw_tx_packet/src/main.c b/samples/wifi/raw_tx_packet/src/main.c index 79fd9617d1da..10f73c575396 100644 --- a/samples/wifi/raw_tx_packet/src/main.c +++ b/samples/wifi/raw_tx_packet/src/main.c @@ -11,6 +11,13 @@ #include LOG_MODULE_REGISTER(raw_tx_packet, CONFIG_LOG_DEFAULT_LEVEL); +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #include #include diff --git a/samples/wifi/raw_tx_packet/src/wifi_connection.c b/samples/wifi/raw_tx_packet/src/wifi_connection.c index b78c6c5cdd9e..621960d49132 100644 --- a/samples/wifi/raw_tx_packet/src/wifi_connection.c +++ b/samples/wifi/raw_tx_packet/src/wifi_connection.c @@ -15,14 +15,15 @@ LOG_MODULE_REGISTER(wifi_connect, CONFIG_LOG_DEFAULT_LEVEL); #include #include "net_private.h" +#include + #define WIFI_SHELL_MGMT_EVENTS (NET_EVENT_WIFI_CONNECT_RESULT | \ NET_EVENT_WIFI_DISCONNECT_RESULT) #define MAX_SSID_LEN 32 -#define DHCP_TIMEOUT 70 -#define CONNECTION_TIMEOUT 100 #define STATUS_POLLING_MS 300 +K_SEM_DEFINE(wait_for_dhcp, 0, 1); static struct net_mgmt_event_callback wifi_shell_mgmt_cb; static struct net_mgmt_event_callback net_shell_mgmt_cb; @@ -149,6 +150,7 @@ static void print_dhcp_ip(struct net_mgmt_event_callback *cb) net_addr_ntop(AF_INET, addr, dhcp_info, sizeof(dhcp_info)); LOG_INF("DHCP IP address: %s", dhcp_info); + k_sem_give(&wait_for_dhcp); } static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, @@ -163,42 +165,9 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, } } -static int __wifi_args_to_params(struct wifi_connect_req_params *params) -{ - params->timeout = SYS_FOREVER_MS; - - /* Defaults */ - params->band = WIFI_FREQ_BAND_UNKNOWN; - params->channel = WIFI_CHANNEL_ANY; - params->security = WIFI_SECURITY_TYPE_NONE; - params->mfp = WIFI_MFP_OPTIONAL; - - /* SSID */ - params->ssid = CONFIG_RAW_TX_PKT_SAMPLE_SSID; - params->ssid_length = strlen(params->ssid); - -#if defined(CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2) - params->security = 1; -#elif defined(CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA2_256) - params->security = 2; -#elif defined(CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_WPA3) - params->security = 3; -#else - params->security = 0; -#endif - -#if !defined(CONFIG_RAW_TX_PKT_SAMPLE_KEY_MGMT_NONE) - params->psk = CONFIG_RAW_TX_PKT_SAMPLE_PASSWORD; - params->psk_length = strlen(params->psk); -#endif - - return 0; -} - static int wifi_connect(void) { struct net_if *iface = NULL; - static struct wifi_connect_req_params cnx_params; iface = net_if_get_first_wifi(); if (!iface) { @@ -208,10 +177,8 @@ static int wifi_connect(void) context.connected = false; context.connect_result = WIFI_STATUS_CONN_FAIL; - __wifi_args_to_params(&cnx_params); - if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, - &cnx_params, sizeof(struct wifi_connect_req_params))) { + if (net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0)) { LOG_ERR("Connection request failed"); return -ENOEXEC; @@ -254,6 +221,8 @@ int try_wifi_connect(void) } if (context.connected) { + k_sem_take(&wait_for_dhcp, + K_SECONDS(CONFIG_RAW_TX_PKT_SAMPLE_DHCP_TIMEOUT_S)); break; } else if (context.connect_result) { LOG_ERR("Connection unsuccessful with reason (%d)", context.connect_result); diff --git a/samples/wifi/scan/README.rst b/samples/wifi/scan/README.rst index a7decaf94633..e334656bb900 100644 --- a/samples/wifi/scan/README.rst +++ b/samples/wifi/scan/README.rst @@ -55,26 +55,26 @@ Building and running .. include:: /includes/build_and_run_ns.txt -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following are examples of the CLI commands: * Build to fetch only Device scan results .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp * Build to fetch only Raw scan results .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY=y + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY=y * Build to fetch both Raw and Device scan results .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y + west build -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y Testing ======= diff --git a/samples/wifi/scan/prj.conf b/samples/wifi/scan/prj.conf index 2689df0d91df..fd70bfa2487a 100644 --- a/samples/wifi/scan/prj.conf +++ b/samples/wifi/scan/prj.conf @@ -9,7 +9,6 @@ CONFIG_NET_L2_WIFI_MGMT=y CONFIG_HEAP_MEM_POOL_SIZE=25000 # System settings -CONFIG_NEWLIB_LIBC=y CONFIG_ASSERT=y # Networking diff --git a/samples/wifi/scan/sample.yaml b/samples/wifi/scan/sample.yaml index a2906b97a9e7..8f7c33b39f0a 100644 --- a/samples/wifi/scan/sample.yaml +++ b/samples/wifi/scan/sample.yaml @@ -6,65 +6,65 @@ tests: sample.nrf7002.scan: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.scan: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build skip: true sample.nrf7002_eks.scan: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns tags: ci_build sample.nrf7002_eks.raw_scan: build_only: true extra_args: SHIELD=nrf7002ek CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns tags: ci_build sample.nrf7000_eks.scan: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 CONFIG_WPA_SUPP=n integration_platforms: - - nrf9160dk_nrf9160_ns - platform_allow: nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns + platform_allow: nrf9160dk/nrf9160/ns tags: ci_build sample.nrf7001_eks.scan: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 nrf9160dk/nrf9160/ns tags: ci_build sample.nrf7002_eb.thingy53.scan: build_only: true extra_args: SHIELD=nrf7002eb integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build sample.thingy91x_nrf7002.scan: build_only: true - platform_allow: thingy91x_nrf9151_ns + platform_allow: thingy91x/nrf9151/ns tags: ci_build diff --git a/samples/wifi/scan/src/main.c b/samples/wifi/scan/src/main.c index d29a0af865e0..1738895be478 100644 --- a/samples/wifi/scan/src/main.c +++ b/samples/wifi/scan/src/main.c @@ -327,11 +327,6 @@ int main(void) net_mgmt_add_event_callback(&wifi_shell_mgmt_cb); -#if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M - /* For now hardcode to 128MHz */ - nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, - NRF_CLOCK_HFCLK_DIV_1); -#endif k_sleep(K_SECONDS(1)); printk("Starting %s with CPU frequency: %d MHz\n", CONFIG_BOARD, SystemCoreClock / MHZ(1)); diff --git a/samples/wifi/shell/README.rst b/samples/wifi/shell/README.rst index 26e06de76b5e..e6be153245e0 100644 --- a/samples/wifi/shell/README.rst +++ b/samples/wifi/shell/README.rst @@ -37,46 +37,46 @@ Currently, the following configurations are supported: * nRF91 Series DK + SPIM -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp -To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. +To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build 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 + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek -To build with ``raw_tx`` shell support for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target and raw TX overlay configuration. +To build with ``raw_tx`` shell support for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target and raw TX overlay configuration. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-raw-tx.conf + west build -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-raw-tx.conf .. tabs:: .. group-tab:: nRF9161 DK - To build for the nRF9161 DK, use the ``nrf9161dk_nrf9161_ns`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek`` and a scan-only overlay configuration. + To build for the nRF9161 DK, use the ``nrf9161dk/nrf9161/ns`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek`` and a scan-only overlay configuration. The following is an example of the CLI command: .. code-block:: console - west build -p -b nrf9161dk_nrf9161_ns -- -DOVERLAY_CONFIG=overlay-scan-only.conf -DSHIELD=nrf7002ek + west build -p -b nrf9161dk/nrf9161/ns -- -DEXTRA_CONF_FILE=overlay-scan-only.conf -DSHIELD=nrf7002ek .. group-tab:: nRF9160 DK - To build for the nRF9160 DK, use the ``nrf9160dk_nrf9160_ns`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek`` and a scan-only overlay configuration. + To build for the nRF9160 DK, use the ``nrf9160dk/nrf9160/ns`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek`` and a scan-only overlay configuration. The following is an example of the CLI command: .. code-block:: console - west build -b nrf9160dk_nrf9160_ns -- -DOVERLAY_CONFIG=overlay-scan-only.conf -DSHIELD=nrf7002ek + west build -b nrf9160dk/nrf9160/ns -- -DEXTRA_CONF_FILE=overlay-scan-only.conf -DSHIELD=nrf7002ek See also :ref:`cmake_options` for instructions on how to provide CMake options. @@ -114,16 +114,18 @@ Supported CLI commands | 2:1,6-11,14_5:36,149-165,44 | [-h, --help] : Print out the help for the scan command. * - connect - - | Connect to a Wi-Fi AP with the following parameters: - | "" - | [channel number/band: > 0:Channel, 0:any channel, - | < 0:band (-2:2.4GHz, -5:5GHz, -6:6GHz] - | [PSK: valid only for secure SSIDs] - | [Security type: valid only for secure SSIDs] - | 0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE, 4:WAPI, 5:EAP, 6:WEP, 7: - | WPA-PSK - | [MFP (optional: needs security type to be specified)] + - | Connect to a Wi-Fi AP + | <-s --ssid \"\">: SSID. + | [-c --channel]: Channel that needs to be scanned for connection. 0:any channel + | [-b, --band] 0: any band (2:2.4GHz, 5:5GHz, 6:6GHz) + | [-p, --psk]: Passphrase (valid only for secure SSIDs) + | [-k, --key-mgmt]: Key management type. + | 0:None, 1:WPA2-PSK, 2:WPA2-PSK-256, 3:SAE, 4:WAPI, 5:EAP, 6:WEP, + | 7:WPA-PSK, 8: WPA-Auto-Personal + | [-w, --ieee-80211w]: MFP (optional: needs security type to be specified) | : 0:Disable, 1:Optional, 2:Required. + | [-m, --bssid]: MAC address of the AP (BSSID). + | [-h, --help]: Print out the help for the connect command. * - disconnect - Disconnect from the Wi-Fi AP * - status @@ -424,7 +426,7 @@ To test the SAP mode, the sample must be built using the configuration overlay : wifi reg_domain - For example, to set the regulatory domain to US, use the following command: + For example, to set the regulatory domain to IN, use the following command: .. code-block:: console diff --git a/samples/wifi/shell/overlay-openthread.conf b/samples/wifi/shell/overlay-openthread.conf index b6526cd6c985..9cd67784db69 100644 --- a/samples/wifi/shell/overlay-openthread.conf +++ b/samples/wifi/shell/overlay-openthread.conf @@ -31,6 +31,3 @@ CONFIG_LOG_MAX_LEVEL=1 # Consumes more memory CONFIG_WIFI_CREDENTIALS=n -CONFIG_FLASH=n -CONFIG_NVS=n -CONFIG_SETTINGS=n diff --git a/samples/wifi/shell/overlay-sap.conf b/samples/wifi/shell/overlay-sap.conf index 62f2c265266d..7d1bdc32b529 100644 --- a/samples/wifi/shell/overlay-sap.conf +++ b/samples/wifi/shell/overlay-sap.conf @@ -32,3 +32,6 @@ CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1" CONFIG_NET_DHCPV4=n # Enable DHCPv4 server CONFIG_NET_DHCPV4_SERVER=y + +# Temporarily enable FS support so that linking succeeds. +CONFIG_FILE_SYSTEM=y diff --git a/samples/wifi/shell/prj.conf b/samples/wifi/shell/prj.conf index 950839e86390..6fe5a6254f4f 100644 --- a/samples/wifi/shell/prj.conf +++ b/samples/wifi/shell/prj.conf @@ -10,10 +10,6 @@ CONFIG_WIFI_NRF700X=y CONFIG_WPA_SUPP=y CONFIG_NET_L2_WIFI_SHELL=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - # Networking CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y @@ -54,8 +50,9 @@ CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SHELL=y # Memories -CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SHELL_STACK_SIZE=4096 +CONFIG_MAIN_STACK_SIZE=4200 +CONFIG_SHELL_STACK_SIZE=4400 + CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -80,6 +77,7 @@ CONFIG_DEVICE_SHELL=y CONFIG_POSIX_CLOCK=y CONFIG_DATE_SHELL=y CONFIG_NET_CONFIG_AUTO_INIT=n +CONFIG_POSIX_API=y CONFIG_WIFI_MGMT_EXT=y CONFIG_WIFI_CREDENTIALS=y @@ -94,3 +92,4 @@ CONFIG_SETTINGS_NVS=y # design in net_mgmt. So, use a higher timeout for a crowded # environment. CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000 +CONFIG_NET_SOCKETS_POLL_MAX=10 diff --git a/samples/wifi/shell/sample.yaml b/samples/wifi/shell/sample.yaml index b8547b87d84e..500a6b83981c 100644 --- a/samples/wifi/shell/sample.yaml +++ b/samples/wifi/shell/sample.yaml @@ -6,137 +6,137 @@ tests: sample.nrf7002.shell: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build # Disable optional features to reduce memory usage sample.nrf7002.shell.disable_adv_features: build_only: true extra_args: -DCONFIG_WPA_SUPP_ADVANCED_FEATURES=n integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.shell: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build sample.nrf7002_eks.shell: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.nrf7001_eks.shell: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.nrf7002_eks_cpunet.shell: build_only: true extra_args: SHIELD=nrf7002ek CONFIG_BOARD_ENABLE_CPUNET=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7000_eks_cpunet.shell: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 CONFIG_BOARD_ENABLE_CPUNET=y CONFIG_WPA_SUPP=n integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001_eks_cpunet.shell: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 CONFIG_BOARD_ENABLE_CPUNET=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.shell.zperf: build_only: true extra_args: OVERLAY_CONFIG=overlay-zperf.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.shell.zperf: build_only: true extra_args: OVERLAY_CONFIG=overlay-zperf.conf integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build sample.nrf7002.shell.wpa_cli: build_only: true extra_args: CONFIG_WPA_CLI=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.shell.wpa_cli: build_only: true extra_args: CONFIG_WPA_CLI=y integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build sample.nrf7002.shell.scan_only_7002: build_only: true extra_args: OVERLAY_CONFIG=overlay-scan-only.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7000.shell.scan_only_91: build_only: true extra_args: OVERLAY_CONFIG=overlay-scan-only.conf SHIELD=nrf7002ek_nrf7000 CONFIG_WPA_SUPP=n integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns tags: ci_build sample.nrf7002.shell.scan_only_thingy91x: build_only: true extra_args: OVERLAY_CONFIG=overlay-scan-only.conf CONFIG_WPA_SUPP=n platform_allow: - - thingy91x_nrf9151_ns + - thingy91x/nrf9151/ns tags: ci_build sample.nrf7002.shell.otbr: build_only: true extra_args: OVERLAY_CONFIG=overlay-openthread.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.shell.posix_names: build_only: true extra_args: CONFIG_POSIX_API=n CONIFG_NET_SOCKETS_POSIX_NAMES=y integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_ns.shell: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp_ns - platform_allow: nrf7002dk_nrf5340_cpuapp_ns + - nrf7002dk/nrf5340/cpuapp/ns + platform_allow: nrf7002dk/nrf5340/cpuapp/ns sample.nrf7002_eb.thingy53.shell: build_only: true extra_args: SHIELD=nrf7002eb CONFIG_BOARD_ENABLE_CPUNET=y integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build sample.qspi.ext_flash_xip: build_only: true @@ -144,9 +144,9 @@ tests: SHIELD=nrf7002ek CONFIG_NRF_WIFI_PATCHES_EXT_FLASH_XIP=y integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.qspi.ext_flash_store: build_only: true @@ -154,10 +154,16 @@ tests: SHIELD=nrf7002ek SNIPPET=nrf70-fw-patch-ext-flash integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build + sample.nrf54h20dk_nrf7002ek.shell: + build_only: true + extra_args: SHIELD=nrf700x_nrf54h20dk + integration_platforms: + - nrf54h20dk/nrf54h20/cpuapp + platform_allow: nrf54h20dk/nrf54h20/cpuapp # Used by QA and also acts as a memory stress test sample.nrf7001.superset: build_only: true @@ -168,8 +174,8 @@ tests: CONFIG_NET_IPV4_FRAGMENT=y CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=24 integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build_superset # Used by QA and also acts as a memory stress test sample.nrf7001_ek.superset: @@ -182,8 +188,8 @@ tests: CONFIG_NET_IPV4_FRAGMENT=y CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=24 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build_superset # Used by QA and also acts as a memory stress test sample.nrf7002.superset: @@ -195,8 +201,8 @@ tests: CONFIG_NET_IPV4_FRAGMENT=y CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=24 integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build_superset # Used by QA and also acts as a memory stress test sample.nrf7002_ek.superset: @@ -209,8 +215,8 @@ tests: CONFIG_NET_IPV4_FRAGMENT=y CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=24 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build_superset sample.nrf7002.superset.debug: build_only: true @@ -222,41 +228,48 @@ tests: CONFIG_NET_IPV4_FRAGMENT=y CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=24 integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build_superset sample.nrf7002.ap: build_only: true extra_args: OVERLAY_CONFIG=overlay-sap.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.with_overlay_raw_tx_packet: build_only: true extra_args: OVERLAY_CONFIG=overlay-raw-tx.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.with_overlay_monitor: build_only: true extra_args: OVERLAY_CONFIG=overlay-monitor-mode.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.promiscuous_mode: build_only: true extra_args: OVERLAY_CONFIG=overlay-promiscuous-mode.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.promiscuous_mode_7001: build_only: true extra_args: OVERLAY_CONFIG=overlay-promiscuous-mode.conf integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 + tags: ci_build + sample.nrf7002eb.nrf54l15pdk.shell: + build_only: true + extra_args: SHIELD=nrf700x_nrf54l15pdk + integration_platforms: + - nrf54l15pdk/nrf54l15/cpuapp + platform_allow: nrf54l15pdk/nrf54l15/cpuapp tags: ci_build diff --git a/samples/wifi/shell/src/main.c b/samples/wifi/shell/src/main.c index 6024a9340230..23f1edba92be 100644 --- a/samples/wifi/shell/src/main.c +++ b/samples/wifi/shell/src/main.c @@ -10,29 +10,21 @@ #include #include -#if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M +#if NRFX_CLOCK_ENABLED && defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) && NRF_CLOCK_HAS_HFCLK192M #include #endif #include #include - -#ifdef CONFIG_SLIP -/* Fixed address as the static IP given from Kconfig will be - * applied to Wi-Fi interface. - */ -#define CONFIG_NET_CONFIG_SLIP_IPV4_ADDR "192.0.2.1" -#define CONFIG_NET_CONFIG_SLIP_IPV4_MASK "255.255.255.0" -#endif /* CONFIG_SLIP */ - #ifdef CONFIG_USB_DEVICE_STACK #include +#endif -/* Fixed address as the static IP given from Kconfig will be - * applied to Wi-Fi interface. - */ -#define CONFIG_NET_CONFIG_USB_IPV4_ADDR "192.0.2.1" -#define CONFIG_NET_CONFIG_USB_IPV4_MASK "255.255.255.0" +#if defined(CONFIG_USB_DEVICE_STACK) || defined(CONFIG_SLIP) +static struct in_addr addr = { { { 192, 0, 2, 1 } } }; +static struct in_addr mask = { { { 255, 255, 255, 0 } } }; +#endif /* CONFIG_USB_DEVICE_STACK || CONFIG_SLIP */ +#ifdef CONFIG_USB_DEVICE_STACK int init_usb(void) { int ret; @@ -50,11 +42,7 @@ int init_usb(void) int main(void) { -#if defined(CONFIG_USB_DEVICE_STACK) || defined(CONFIG_SLIP) - struct in_addr addr; -#endif - -#if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M +#if NRFX_CLOCK_ENABLED && defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) && NRF_CLOCK_HAS_HFCLK192M /* For now hardcode to 128MHz */ nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1); @@ -72,22 +60,9 @@ int main(void) printk("Cannot find network interface: %s", "eth_netusb"); return -1; } - if (sizeof(CONFIG_NET_CONFIG_USB_IPV4_ADDR) > 1) { - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_USB_IPV4_ADDR, &addr)) { - printk("Invalid address: %s", CONFIG_NET_CONFIG_USB_IPV4_ADDR); - return -1; - } - net_if_ipv4_addr_add(iface, &addr, NET_ADDR_MANUAL, 0); - } - if (sizeof(CONFIG_NET_CONFIG_USB_IPV4_MASK) > 1) { - /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_USB_IPV4_MASK, &addr)) { - printk("Invalid netmask: %s", CONFIG_NET_CONFIG_USB_IPV4_MASK); - } else { - net_if_ipv4_set_netmask(iface, &addr); - } - } + net_if_ipv4_addr_add(iface, &addr, NET_ADDR_MANUAL, 0); + net_if_ipv4_set_netmask_by_addr(iface, &addr, &mask); #endif #ifdef CONFIG_SLIP @@ -99,22 +74,8 @@ int main(void) return -1; } - if (sizeof(CONFIG_NET_CONFIG_SLIP_IPV4_ADDR) > 1) { - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_SLIP_IPV4_ADDR, &addr)) { - printk("Invalid address: %s", CONFIG_NET_CONFIG_SLIP_IPV4_ADDR); - return -1; - } - net_if_ipv4_addr_add(slip_iface, &addr, NET_ADDR_MANUAL, 0); - } - - if (sizeof(CONFIG_NET_CONFIG_SLIP_IPV4_MASK) > 1) { - /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_SLIP_IPV4_MASK, &addr)) { - printk("Invalid netmask: %s", CONFIG_NET_CONFIG_SLIP_IPV4_MASK); - } else { - net_if_ipv4_set_netmask(slip_iface, &addr); - } - } + net_if_ipv4_addr_add(slip_iface, &addr, NET_ADDR_MANUAL, 0); + net_if_ipv4_set_netmask_by_addr(slip_iface, &addr, &mask); #endif /* CONFIG_SLIP */ #ifdef CONFIG_NET_CONFIG_SETTINGS diff --git a/samples/wifi/shell/src/wifi_raw_tx_pkt_shell.c b/samples/wifi/shell/src/wifi_raw_tx_pkt_shell.c index 7d3f891503ef..a58d9ce5bfde 100644 --- a/samples/wifi/shell/src/wifi_raw_tx_pkt_shell.c +++ b/samples/wifi/shell/src/wifi_raw_tx_pkt_shell.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include LOG_MODULE_REGISTER(raw_tx_pkt, CONFIG_LOG_DEFAULT_LEVEL); diff --git a/samples/wifi/shutdown/README.rst b/samples/wifi/shutdown/README.rst index 4e9d96375d57..129f951742fe 100644 --- a/samples/wifi/shutdown/README.rst +++ b/samples/wifi/shutdown/README.rst @@ -50,12 +50,12 @@ Building and running .. include:: /includes/build_and_run_ns.txt -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command to demonstrate Wi-Fi shutdown: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp Disable auto-start of the Wi-Fi driver -------------------------------------- @@ -65,7 +65,7 @@ You can disable it by setting the :kconfig:option:`CONFIG_NRF_WIFI_IF_AUTO_START .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -DCONFIG_NRF_WIFI_IF_AUTO_START=n + west build -b nrf7002dk/nrf5340/cpuapp -DCONFIG_NRF_WIFI_IF_AUTO_START=n With this configuration, the Wi-Fi network interface is not automatically brought up by the Zephyr networking stack. You must press **Button 1** to bring up the Wi-Fi network interface. diff --git a/samples/wifi/shutdown/prj.conf b/samples/wifi/shutdown/prj.conf index 9db67a6689f8..36864978b084 100644 --- a/samples/wifi/shutdown/prj.conf +++ b/samples/wifi/shutdown/prj.conf @@ -8,9 +8,6 @@ CONFIG_WIFI_NRF700X=y CONFIG_NET_L2_WIFI_MGMT=y CONFIG_HEAP_MEM_POOL_SIZE=25000 -# System settings -CONFIG_NEWLIB_LIBC=y - # Networking CONFIG_NETWORKING=y CONFIG_NET_L2_ETHERNET=y @@ -21,7 +18,6 @@ CONFIG_INIT_STACKS=y # Memories CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # Debugging CONFIG_STACK_SENTINEL=y diff --git a/samples/wifi/shutdown/sample.yaml b/samples/wifi/shutdown/sample.yaml index 86e44076b9c5..3879f3c8e759 100644 --- a/samples/wifi/shutdown/sample.yaml +++ b/samples/wifi/shutdown/sample.yaml @@ -6,32 +6,32 @@ tests: sample.nrf7002.shutdown: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.shutdown: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build skip: true sample.nrf7002_eks.shutdown: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 tags: ci_build sample.nrf7000_location.shutdown: build_only: true extra_args: SHIELD=nrf7002ek_nrf7000 integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns platform_allow: - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns - - nrf9151dk_nrf9151_ns + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns + - nrf9151dk/nrf9151/ns tags: ci_build diff --git a/samples/wifi/softap/README.rst b/samples/wifi/softap/README.rst index 3dc1fd1c8d4b..f2b28e826fbc 100644 --- a/samples/wifi/softap/README.rst +++ b/samples/wifi/softap/README.rst @@ -66,14 +66,14 @@ Building and running .. include:: /includes/build_and_run_ns.txt -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp -To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. +To build for the nRF7002 EK with nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. Testing ======= diff --git a/samples/wifi/softap/prj.conf b/samples/wifi/softap/prj.conf index e4f4cf91b763..a8371123119b 100644 --- a/samples/wifi/softap/prj.conf +++ b/samples/wifi/softap/prj.conf @@ -15,10 +15,6 @@ CONFIG_WPA_SUPP_AP=y CONFIG_WPA_SUPP_LOG_LEVEL_INF=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n - # Networking CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y @@ -53,7 +49,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -81,3 +76,6 @@ CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1" # design in net_mgmt. So, use a higher timeout for a crowded # environment. CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000 + +# Temporarily enable FS support so that linking succeeds. +CONFIG_FILE_SYSTEM=y diff --git a/samples/wifi/softap/sample.yaml b/samples/wifi/softap/sample.yaml index 3fe3df2c1531..92500b4be72a 100644 --- a/samples/wifi/softap/sample.yaml +++ b/samples/wifi/softap/sample.yaml @@ -6,26 +6,26 @@ tests: sample.nrf7002.softap: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eks.softap: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.softap: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build sample.nrf7001_eks.softap: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/softap/src/main.c b/samples/wifi/softap/src/main.c index c60f24566401..4afda429f33a 100644 --- a/samples/wifi/softap/src/main.c +++ b/samples/wifi/softap/src/main.c @@ -187,7 +187,7 @@ static int __wifi_args_to_params(struct wifi_connect_req_params *params) return 0; } -static int cmd_wifi_status(void) +static void cmd_wifi_status(void) { struct net_if *iface; struct wifi_iface_status status = { 0 }; @@ -195,13 +195,13 @@ static int cmd_wifi_status(void) iface = net_if_get_first_wifi(); if (!iface) { LOG_ERR("Failed to get Wi-FI interface"); - return -ENOEXEC; + return; } if (net_mgmt(NET_REQUEST_WIFI_IFACE_STATUS, iface, &status, sizeof(struct wifi_iface_status))) { LOG_ERR("Status request failed"); - return -ENOEXEC; + return; } LOG_INF("Status: successful"); @@ -227,30 +227,28 @@ static int cmd_wifi_status(void) LOG_INF("TWT: %s", status.twt_capable ? "Supported" : "Not supported"); } - - return 0; } -static void wifi_softap_enable(void) +static int wifi_softap_enable(void) { struct net_if *iface; static struct wifi_connect_req_params cnx_params; - int ret; + int ret = -1; iface = net_if_get_first_wifi(); if (!iface) { LOG_ERR("Failed to get Wi-Fi iface"); - return; + goto out; } if (__wifi_args_to_params(&cnx_params)) { - return; + goto out; } if (!wifi_utils_validate_chan(cnx_params.band, cnx_params.channel)) { LOG_ERR("Invalid channel %d in %d band", cnx_params.channel, cnx_params.band); - return; + goto out; } ret = net_mgmt(NET_REQUEST_WIFI_AP_ENABLE, iface, &cnx_params, @@ -260,18 +258,21 @@ static void wifi_softap_enable(void) } else { LOG_INF("AP mode enabled"); } + +out: + return ret; } -static void wifi_set_reg_domain(void) +static int wifi_set_reg_domain(void) { struct net_if *iface; struct wifi_reg_domain regd = {0}; - int ret; + int ret = -1; iface = net_if_get_first_wifi(); if (!iface) { LOG_ERR("Failed to get Wi-Fi iface"); - return; + return ret; } regd.oper = WIFI_MGMT_SET; @@ -285,23 +286,25 @@ static void wifi_set_reg_domain(void) } else { LOG_INF("Regulatory domain set to %s", CONFIG_SOFTAP_SAMPLE_REG_DOMAIN); } + + return ret; } -static void configure_dhcp_server(void) +static int configure_dhcp_server(void) { struct net_if *iface; struct in_addr pool_start; - int ret; + int ret = -1; iface = net_if_get_first_wifi(); if (!iface) { LOG_ERR("Failed to get Wi-Fi interface"); - return; + goto out; } if (net_addr_pton(AF_INET, CONFIG_SOFTAP_SAMPLE_DHCPV4_POOL_START, &pool_start.s_addr)) { LOG_ERR("Invalid address: %s", CONFIG_SOFTAP_SAMPLE_DHCPV4_POOL_START); - return; + goto out; } ret = net_dhcpv4_server_start(iface, &pool_start); @@ -313,21 +316,37 @@ static void configure_dhcp_server(void) LOG_INF("DHCPv4 server started and pool address starts from %s", CONFIG_SOFTAP_SAMPLE_DHCPV4_POOL_START); } +out: + return ret; } +#define CHECK_RET(func, ...) \ + do { \ + ret = func(__VA_ARGS__); \ + if (ret) { \ + LOG_ERR("Failed to configure %s", #func); \ + return -1; \ + } \ + } while (0) + int main(void) { + int ret; + net_mgmt_init_event_callback(&wifi_sap_mgmt_cb, wifi_mgmt_event_handler, WIFI_SAP_MGMT_EVENTS); net_mgmt_add_event_callback(&wifi_sap_mgmt_cb); - wifi_set_reg_domain(); + /* TODO: Add proper synchronization to wait for WPA supplicant initialization */ + k_sleep(K_SECONDS(2)); + + CHECK_RET(wifi_set_reg_domain); - configure_dhcp_server(); + CHECK_RET(configure_dhcp_server); - wifi_softap_enable(); + CHECK_RET(wifi_softap_enable); cmd_wifi_status(); diff --git a/samples/wifi/sta/Kconfig b/samples/wifi/sta/Kconfig index 8b7c04bba40a..dcef2b3d5e11 100644 --- a/samples/wifi/sta/Kconfig +++ b/samples/wifi/sta/Kconfig @@ -12,41 +12,6 @@ config CONNECTION_IDLE_TIMEOUT int "Time to be waited for a station to connect" default 30 -config STA_SAMPLE_SSID - string "SSID" - help - Specify the SSID to connect - -choice STA_KEY_MGMT_SELECT - prompt "Security Option" - default STA_KEY_MGMT_WPA3 - -config STA_KEY_MGMT_NONE - bool "Open Security" - help - Enable for Open Security - -config STA_KEY_MGMT_WPA2 - bool "WPA2 Security" - help - Enable for WPA2 Security - -config STA_KEY_MGMT_WPA2_256 - bool "WPA2 SHA 256 Security" - help - Enable for WPA2-PSK-256 Security - -config STA_KEY_MGMT_WPA3 - bool "WPA3 Security" - help - Enable for WPA3 Security -endchoice - -config STA_SAMPLE_PASSWORD - string "Passphrase (WPA2) or password (WPA3)" - help - Specify the Password to connect - config NRF700X_QSPI_ENCRYPTION_KEY string "16 bytes QSPI encryption key, only for testing purposes" depends on BOARD_NRF7002DK_NRF5340_CPUAPP diff --git a/samples/wifi/sta/README.rst b/samples/wifi/sta/README.rst index e1d71304b95a..bbbcae28fac8 100644 --- a/samples/wifi/sta/README.rst +++ b/samples/wifi/sta/README.rst @@ -38,32 +38,28 @@ Configuration |config| -You must configure the following Wi-Fi credentials in the :file:`prj.conf` file: - -* Network name (SSID) -* Key management -* Password +Configuration options +===================== -.. note:: - You can also use ``menuconfig`` to enable ``Key management`` option. +The following sample-specific Kconfig options are used in this sample (located in :file:`samples/wifi/sta/Kconfig`): -See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run ``menuconfig``. +.. options-from-kconfig:: + :show-type: -Configuration options -===================== +You must configure the following Wi-Fi credentials in the :file:`prj.conf` file: -The following sample-specific Kconfig option is used in this sample (located in :file:`samples/wifi/sta/Kconfig`): +.. include:: /includes/wifi_credentials_static.txt -.. _CONFIG_NRF700X_QSPI_ENCRYPTION_KEY: +.. note:: + You can also use ``menuconfig`` to configure ``Wi-Fi credentials``. -CONFIG_NRF700X_QSPI_ENCRYPTION_KEY - This option specifies the QSPI encryption key. +See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run ``menuconfig``. Quad Serial Peripheral Interface (QSPI) encryption ************************************************** This sample demonstrates QSPI encryption API usage. -You can set the key using the :ref:`CONFIG_NRF700X_QSPI_ENCRYPTION_KEY ` Kconfig option. +You can set the key using the :kconfig:option:`CONFIG_NRF700X_QSPI_ENCRYPTION_KEY` Kconfig option. If encryption of the QSPI traffic is required for the production devices, matching keys must be programmed in both the nRF7002 OTP and non-volatile storage associated with the host. The key from non-volatile storage must be set as the encryption key using the APIs. @@ -97,12 +93,12 @@ Building and running Currently, only the nRF7002 DK is supported. -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp Testing ======= diff --git a/samples/wifi/sta/prj.conf b/samples/wifi/sta/prj.conf index 0c9f56023f92..ba3a789b443d 100644 --- a/samples/wifi/sta/prj.conf +++ b/samples/wifi/sta/prj.conf @@ -9,17 +9,11 @@ CONFIG_WIFI_NRF700X=y # WPA supplicant CONFIG_WPA_SUPP=y -# Below configs need to be modified based on security -# CONFIG_STA_KEY_MGMT_NONE=y -# CONFIG_STA_KEY_MGMT_WPA2=y -# CONFIG_STA_KEY_MGMT_WPA2_256=y -# CONFIG_STA_KEY_MGMT_WPA3=y -CONFIG_STA_SAMPLE_SSID="Myssid" -CONFIG_STA_SAMPLE_PASSWORD="Mypassword" - -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n +CONFIG_WIFI_MGMT_EXT=y +CONFIG_WIFI_CREDENTIALS=y +CONFIG_WIFI_CREDENTIALS_STATIC=y +CONFIG_WIFI_CREDENTIALS_STATIC_SSID="Myssid" +CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="Mypassword" # Networking CONFIG_NETWORKING=y @@ -56,7 +50,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/sta/sample.yaml b/samples/wifi/sta/sample.yaml index 2c927a8a471e..53f1fd86b954 100644 --- a/samples/wifi/sta/sample.yaml +++ b/samples/wifi/sta/sample.yaml @@ -6,36 +6,42 @@ tests: sample.nrf7002.sta: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7001.sta: build_only: true integration_platforms: - - nrf7002dk_nrf7001_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf7001_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp/nrf7001 + platform_allow: nrf7002dk/nrf5340/cpuapp/nrf7001 tags: ci_build skip: true sample.nrf7002_eks.sta: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 + extra_configs: + - CONFIG_NET_TX_STACK_SIZE=3700 + - CONFIG_NET_RX_STACK_SIZE=3700 tags: ci_build sample.nrf7001_eks.sta: build_only: true extra_args: SHIELD=nrf7002ek_nrf7001 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 + extra_configs: + - CONFIG_NET_TX_STACK_SIZE=3700 + - CONFIG_NET_RX_STACK_SIZE=3700 tags: ci_build sample.nrf7002_eb.thingy53.sta: build_only: true extra_args: SHIELD=nrf7002eb integration_platforms: - - thingy53_nrf5340_cpuapp - platform_allow: thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp + platform_allow: thingy53/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/sta/src/main.c b/samples/wifi/sta/src/main.c index 83ccd49843fb..c18c40b3c8bf 100644 --- a/samples/wifi/sta/src/main.c +++ b/samples/wifi/sta/src/main.c @@ -24,6 +24,8 @@ LOG_MODULE_REGISTER(sta, CONFIG_LOG_DEFAULT_LEVEL); #include #include +#include + #include #include "net_private.h" @@ -207,54 +209,14 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, } } -static int __wifi_args_to_params(struct wifi_connect_req_params *params) -{ - - params->timeout = CONFIG_STA_CONN_TIMEOUT_SEC * MSEC_PER_SEC; - - if (params->timeout == 0) { - params->timeout = SYS_FOREVER_MS; - } - - /* Defaults */ - params->band = WIFI_FREQ_BAND_UNKNOWN; - params->channel = WIFI_CHANNEL_ANY; - params->security = WIFI_SECURITY_TYPE_NONE; - params->mfp = WIFI_MFP_OPTIONAL; - - /* SSID */ - params->ssid = CONFIG_STA_SAMPLE_SSID; - params->ssid_length = strlen(params->ssid); - -#if defined(CONFIG_STA_KEY_MGMT_WPA2) - params->security = 1; -#elif defined(CONFIG_STA_KEY_MGMT_WPA2_256) - params->security = 2; -#elif defined(CONFIG_STA_KEY_MGMT_WPA3) - params->security = 3; -#else - params->security = 0; -#endif - -#if !defined(CONFIG_STA_KEY_MGMT_NONE) - params->psk = CONFIG_STA_SAMPLE_PASSWORD; - params->psk_length = strlen(params->psk); -#endif - - return 0; -} - static int wifi_connect(void) { - struct net_if *iface = net_if_get_default(); - static struct wifi_connect_req_params cnx_params; + struct net_if *iface = net_if_get_first_wifi(); context.connected = false; context.connect_result = false; - __wifi_args_to_params(&cnx_params); - if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, - &cnx_params, sizeof(struct wifi_connect_req_params))) { + if (net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0)) { LOG_ERR("Connection request failed"); return -ENOEXEC; diff --git a/samples/wifi/throughput/README.rst b/samples/wifi/throughput/README.rst index 1c84f1677c53..840f3dba2014 100644 --- a/samples/wifi/throughput/README.rst +++ b/samples/wifi/throughput/README.rst @@ -52,12 +52,12 @@ Building and running .. note:: The sample is supported on the nRF7002 DK with QSPI as the interface between the nRF5340 host and the nRF7002 device. -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp To build for the nRF7002 DK with different profiles for Station mode, use the following CLI commands: @@ -69,7 +69,7 @@ To build for the nRF7002 DK with different profiles for Station mode, use the fo .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-iot-devices.conf + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-iot-devices.conf .. group-tab:: Memory-optimized @@ -77,7 +77,7 @@ To build for the nRF7002 DK with different profiles for Station mode, use the fo .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-memory-optimized.conf + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-memory-optimized.conf .. group-tab:: High performance @@ -85,7 +85,7 @@ To build for the nRF7002 DK with different profiles for Station mode, use the fo .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-high-performance.conf + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-high-performance.conf .. group-tab:: TX prioritized @@ -93,7 +93,7 @@ To build for the nRF7002 DK with different profiles for Station mode, use the fo .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-tx-prio.conf + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-tx-prio.conf .. group-tab:: RX prioritized @@ -101,7 +101,7 @@ To build for the nRF7002 DK with different profiles for Station mode, use the fo .. code-block:: console - west build -p -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-rx-prio.conf + west build -p -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-rx-prio.conf Supported CLI commands ====================== diff --git a/samples/wifi/throughput/overlay-high-performance.conf b/samples/wifi/throughput/overlay-high-performance.conf index c435ddb04968..2afdde3bb7a6 100644 --- a/samples/wifi/throughput/overlay-high-performance.conf +++ b/samples/wifi/throughput/overlay-high-performance.conf @@ -1,4 +1,3 @@ -CONFIG_NET_ZPERF=y CONFIG_NRF700X_AP_MODE=n CONFIG_NRF700X_P2P_MODE=n CONFIG_NET_PKT_TX_COUNT=30 diff --git a/samples/wifi/throughput/overlay-iot-devices.conf b/samples/wifi/throughput/overlay-iot-devices.conf index b7bcfe0fa8ca..9e4ccaa5260d 100644 --- a/samples/wifi/throughput/overlay-iot-devices.conf +++ b/samples/wifi/throughput/overlay-iot-devices.conf @@ -1,4 +1,3 @@ -CONFIG_NET_ZPERF=y CONFIG_NRF700X_AP_MODE=n CONFIG_NRF700X_P2P_MODE=n CONFIG_NET_PKT_TX_COUNT=6 diff --git a/samples/wifi/throughput/overlay-memory-optimized.conf b/samples/wifi/throughput/overlay-memory-optimized.conf index 6d13dbc80c21..8fc1a31db7ff 100644 --- a/samples/wifi/throughput/overlay-memory-optimized.conf +++ b/samples/wifi/throughput/overlay-memory-optimized.conf @@ -1,4 +1,3 @@ -CONFIG_NET_ZPERF=y CONFIG_NRF700X_AP_MODE=n CONFIG_NRF700X_P2P_MODE=n CONFIG_NET_PKT_TX_COUNT=6 diff --git a/samples/wifi/throughput/overlay-rx-prio.conf b/samples/wifi/throughput/overlay-rx-prio.conf index 7029bcd222c1..ee326c0a11c2 100644 --- a/samples/wifi/throughput/overlay-rx-prio.conf +++ b/samples/wifi/throughput/overlay-rx-prio.conf @@ -1,4 +1,3 @@ -CONFIG_NET_ZPERF=y CONFIG_NRF700X_AP_MODE=n CONFIG_NRF700X_P2P_MODE=n CONFIG_NET_PKT_TX_COUNT=5 diff --git a/samples/wifi/throughput/overlay-tx-prio.conf b/samples/wifi/throughput/overlay-tx-prio.conf index 6021b3837cff..38cc59dcb3fd 100644 --- a/samples/wifi/throughput/overlay-tx-prio.conf +++ b/samples/wifi/throughput/overlay-tx-prio.conf @@ -1,4 +1,3 @@ -CONFIG_NET_ZPERF=y CONFIG_NRF700X_AP_MODE=n CONFIG_NRF700X_P2P_MODE=n CONFIG_NET_PKT_TX_COUNT=32 diff --git a/samples/wifi/throughput/overlay-zperf.conf b/samples/wifi/throughput/overlay-zperf.conf deleted file mode 100644 index c03341e0ce9d..000000000000 --- a/samples/wifi/throughput/overlay-zperf.conf +++ /dev/null @@ -1,22 +0,0 @@ -CONFIG_NET_ZPERF=y -CONFIG_POSIX_MAX_FDS=16 -# Optimized networking settings for performance -CONFIG_NET_PKT_RX_COUNT=30 -CONFIG_NET_PKT_TX_COUNT=30 -CONFIG_NET_BUF_RX_COUNT=30 -CONFIG_NET_BUF_TX_COUNT=60 -CONFIG_HEAP_MEM_POOL_SIZE=230000 -CONFIG_NET_BUF_DATA_SIZE=1100 -CONFIG_NRF700X_QSPI_LOW_POWER=n -#CONFIG_SPEED_OPTIMIZATIONS=y - -# Necessary for zperf_tcp_receiver.c -CONFIG_NET_CONFIG_SETTINGS=y -CONFIG_NET_CONFIG_INIT_TIMEOUT=0 - -# Consumes more memory -CONFIG_WIFI_CREDENTIALS=n -CONFIG_FLASH=n -CONFIG_NVS=n -CONFIG_SETTINGS=n -CONFIG_NRF700X_UTIL=y diff --git a/samples/wifi/throughput/prj.conf b/samples/wifi/throughput/prj.conf index b5f9953fe514..5ff3383f5d68 100644 --- a/samples/wifi/throughput/prj.conf +++ b/samples/wifi/throughput/prj.conf @@ -10,9 +10,7 @@ CONFIG_WIFI_NRF700X=y CONFIG_WPA_SUPP=y CONFIG_NET_L2_WIFI_SHELL=y -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n +CONFIG_NET_ZPERF=y # Networking CONFIG_NETWORKING=y @@ -52,11 +50,11 @@ CONFIG_INIT_STACKS=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_SHELL=y +CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories -CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SHELL_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 +CONFIG_MAIN_STACK_SIZE=4200 +CONFIG_SHELL_STACK_SIZE=4400 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/throughput/sample.yaml b/samples/wifi/throughput/sample.yaml index 88c6bf9a6b55..90ee8624aa54 100644 --- a/samples/wifi/throughput/sample.yaml +++ b/samples/wifi/throughput/sample.yaml @@ -6,42 +6,42 @@ tests: sample.nrf7002.throughput: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build # Used by QA to measure memory footprints sample.nrf7002.iot_devices: build_only: true extra_args: OVERLAY_CONFIG=overlay-iot-devices.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.high_performance: build_only: true extra_args: OVERLAY_CONFIG=overlay-high-performance.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.memory_optimized: build_only: true extra_args: OVERLAY_CONFIG=overlay-memory-optimized.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.rx_prioritized: build_only: true extra_args: OVERLAY_CONFIG=overlay-rx-prio.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002.tx_prioritized: build_only: true extra_args: OVERLAY_CONFIG=overlay-tx-prio.conf integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/twt/Kconfig b/samples/wifi/twt/Kconfig index 488f35420b82..bd9541cf607b 100644 --- a/samples/wifi/twt/Kconfig +++ b/samples/wifi/twt/Kconfig @@ -15,41 +15,6 @@ config CONNECTION_IDLE_TIMEOUT int "Time to be waited for a station to connect" default 30 -config TWT_SAMPLE_SSID - string "SSID" - help - Specify the SSID to connect - -choice TWT_STA_KEY_MGMT_SELECT - prompt "Security Option" - default TWT_STA_KEY_MGMT_WPA3 - -config TWT_STA_KEY_MGMT_NONE - bool "Open Security" - help - Enable for Open Security - -config TWT_STA_KEY_MGMT_WPA2 - bool "WPA2 Security" - help - Enable for WPA2 Security - -config TWT_STA_KEY_MGMT_WPA2_256 - bool "WPA2 SHA 256 Security" - help - Enable for WPA2-PSK-256 Security - -config TWT_STA_KEY_MGMT_WPA3 - bool "WPA3 Security" - help - Enable for WPA3 Security -endchoice - -config TWT_SAMPLE_PASSWORD - string "Passphrase (WPA2) or password (WPA3)" - help - Specify the Password to connect - config STA_CONN_TIMEOUT_SEC int "Overall Connection timeout (time to be waited for a station to connect and get an IP address)" # Zephyr DHCP retry is 1 minute, so set the default to 70 seconds diff --git a/samples/wifi/twt/README.rst b/samples/wifi/twt/README.rst index 724e31ae9dc8..ff1069293110 100644 --- a/samples/wifi/twt/README.rst +++ b/samples/wifi/twt/README.rst @@ -48,17 +48,6 @@ Configuration |config| -You must configure the following Wi-Fi credentials in the :file:`prj.conf` file: - -* Network name (SSID) -* Key management -* Password - -.. note:: - You can also use ``menuconfig`` to enable ``Key management`` option. - -See :ref:`zephyr:menuconfig` in the Zephyr documentation for instructions on how to run ``menuconfig``. - Configuration options ===================== @@ -67,6 +56,15 @@ The following sample-specific Kconfig options are used in this sample (located i .. options-from-kconfig:: :show-type: +You must configure the following Wi-Fi credentials in the :file:`prj.conf` file: + +.. include:: /includes/wifi_credentials_static.txt + +.. 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``. + IP addressing ************* The sample uses DHCP to obtain an IP address for the Wi-Fi interface. @@ -90,12 +88,12 @@ Building and running Currently, only the nRF7002 DK is supported. -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp Testing ======= diff --git a/samples/wifi/twt/modules/traffic_gen/src/main.c b/samples/wifi/twt/modules/traffic_gen/src/main.c index c582d98d7af2..35159d33ee33 100644 --- a/samples/wifi/twt/modules/traffic_gen/src/main.c +++ b/samples/wifi/twt/modules/traffic_gen/src/main.c @@ -11,6 +11,13 @@ #include LOG_MODULE_REGISTER(traffic_gen, CONFIG_TRAFFIC_GEN_LOG_LEVEL); +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #include #include #include diff --git a/samples/wifi/twt/modules/traffic_gen/src/tcp.c b/samples/wifi/twt/modules/traffic_gen/src/tcp.c index b320ff9815ff..2a6cb547adb0 100644 --- a/samples/wifi/twt/modules/traffic_gen/src/tcp.c +++ b/samples/wifi/twt/modules/traffic_gen/src/tcp.c @@ -11,6 +11,13 @@ #include LOG_MODULE_DECLARE(traffic_gen, CONFIG_TRAFFIC_GEN_LOG_LEVEL); +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #include #include #include diff --git a/samples/wifi/twt/prj.conf b/samples/wifi/twt/prj.conf index 911d8812f4bc..ed9f94313223 100644 --- a/samples/wifi/twt/prj.conf +++ b/samples/wifi/twt/prj.conf @@ -9,18 +9,11 @@ CONFIG_WIFI_NRF700X=y # WPA supplicant CONFIG_WPA_SUPP=y -# Below configs need to be modified based on security -# CONFIG_TWT_STA_KEY_MGMT_NONE=y -# CONFIG_TWT_STA_KEY_MGMT_WPA2=y -# CONFIG_TWT_STA_KEY_MGMT_WPA2_256=y -# CONFIG_TWT_STA_KEY_MGMT_WPA3=y -CONFIG_TWT_SAMPLE_SSID="Myssid" -CONFIG_TWT_SAMPLE_PASSWORD="Mypassword" - - -# System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n +CONFIG_WIFI_MGMT_EXT=y +CONFIG_WIFI_CREDENTIALS=y +CONFIG_WIFI_CREDENTIALS_STATIC=y +CONFIG_WIFI_CREDENTIALS_STATIC_SSID="Myssid" +CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="Mypassword" # Networking CONFIG_NETWORKING=y @@ -65,7 +58,6 @@ CONFIG_NET_SOCKETS_POLL_MAX=10 # Memories CONFIG_MAIN_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 @@ -84,6 +76,7 @@ CONFIG_ENTROPY_GENERATOR=y CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_POSIX_CLOCK=y +CONFIG_POSIX_API=y CONFIG_PM=y diff --git a/samples/wifi/twt/sample.yaml b/samples/wifi/twt/sample.yaml index 118a53f1a1f8..da6f31c938a4 100644 --- a/samples/wifi/twt/sample.yaml +++ b/samples/wifi/twt/sample.yaml @@ -6,8 +6,8 @@ tests: sample.wifi.twt: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp # Dummy IP address for building the sample extra_args: CONFIG_TRAFFIC_GEN_REMOTE_IPV4_ADDR="1.2.3.4" tags: ci_build diff --git a/samples/wifi/twt/src/main.c b/samples/wifi/twt/src/main.c index 18bac8f28dee..9d18c94290f3 100644 --- a/samples/wifi/twt/src/main.c +++ b/samples/wifi/twt/src/main.c @@ -11,6 +11,13 @@ #include LOG_MODULE_REGISTER(twt, CONFIG_LOG_DEFAULT_LEVEL); +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#include +#endif + #include #include #include @@ -24,6 +31,8 @@ LOG_MODULE_REGISTER(twt, CONFIG_LOG_DEFAULT_LEVEL); #include #include +#include + #include "net_private.h" #include "traffic_gen.h" @@ -338,53 +347,14 @@ static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, } } -static int __wifi_args_to_params(struct wifi_connect_req_params *params) -{ - params->timeout = CONFIG_STA_CONN_TIMEOUT_SEC * MSEC_PER_SEC; - - if (params->timeout == 0) { - params->timeout = SYS_FOREVER_MS; - } - - /* Defaults */ - params->band = WIFI_FREQ_BAND_UNKNOWN; - params->channel = WIFI_CHANNEL_ANY; - params->security = WIFI_SECURITY_TYPE_NONE; - params->mfp = WIFI_MFP_OPTIONAL; - - /* SSID */ - params->ssid = CONFIG_TWT_SAMPLE_SSID; - params->ssid_length = strlen(params->ssid); - -#if defined(CONFIG_TWT_STA_KEY_MGMT_WPA2) - params->security = 1; -#elif defined(CONFIG_TWT_STA_KEY_MGMT_WPA2_256) - params->security = 2; -#elif defined(CONFIG_TWT_STA_KEY_MGMT_WPA3) - params->security = 3; -#else - params->security = 0; -#endif - -#if !defined(CONFIG_TWT_STA_KEY_MGMT_NONE) - params->psk = CONFIG_TWT_SAMPLE_PASSWORD; - params->psk_length = strlen(params->psk); -#endif - - return 0; -} - static int wifi_connect(void) { - struct net_if *iface = net_if_get_default(); - static struct wifi_connect_req_params cnx_params; + struct net_if *iface = net_if_get_first_wifi(); context.connected = false; context.connect_result = false; - __wifi_args_to_params(&cnx_params); - if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface, - &cnx_params, sizeof(struct wifi_connect_req_params))) { + if (net_mgmt(NET_REQUEST_WIFI_CONNECT_STORED, iface, NULL, 0)) { LOG_ERR("Connection request failed"); return -ENOEXEC; diff --git a/samples/wifi/wfa_qt_app/README.rst b/samples/wifi/wfa_qt_app/README.rst index 880234691762..83b36a7173a8 100644 --- a/samples/wifi/wfa_qt_app/README.rst +++ b/samples/wifi/wfa_qt_app/README.rst @@ -66,33 +66,33 @@ Currently, the following configurations are supported: * nRF7002 DK + QSPI * nRF7002 EK + SPI -To build for the nRF7002 DK, use the ``nrf7002dk_nrf5340_cpuapp`` build target. +To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` build target. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp + west build -b nrf7002dk/nrf5340/cpuapp -To build for the nRF7002 EK with the nRF5340 DK, use the ``nrf5340dk_nrf5340_cpuapp`` build target with the ``SHIELD`` CMake option set to ``nrf7002ek``. +To build for the nRF7002 EK with the nRF5340 DK, use the ``nrf5340dk/nrf5340/cpuapp`` build 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 + west build -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek -To build for the nRF7002 DK with the netusb support, use the ``nrf7002dk_nrf5340_cpuapp`` build target with the configuration overlay :file:`overlay-netusb.conf`. +To build for the nRF7002 DK with the netusb support, use the ``nrf7002dk/nrf5340/cpuapp`` build target with the configuration overlay :file:`overlay-netusb.conf`. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-netusb.conf + west build -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-netusb.conf -To build for the nRF7002 DK with the Serial Line Internet Protocol (SLIP) support, use the ``nrf7002dk_nrf5340_cpuapp`` build target with the configuration overlay :file:`overlay-slip.conf` and DTC overlay :file:`nrf7002_uart_pipe.overlay`. +To build for the nRF7002 DK with the Serial Line Internet Protocol (SLIP) support, use the ``nrf7002dk/nrf5340/cpuapp`` build target with the configuration overlay :file:`overlay-slip.conf` and DTC overlay :file:`nrf7002_uart_pipe.overlay`. The following is an example of the CLI command: .. code-block:: console - west build -b nrf7002dk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-slip.conf -DDTC_OVERLAY_FILE=nrf7002_uart_pipe.overlay + west build -b nrf7002dk/nrf5340/cpuapp -- -DEXTRA_CONF_FILE=overlay-slip.conf -DDTC_OVERLAY_FILE=nrf7002_uart_pipe.overlay See also :ref:`cmake_options` for instructions on how to provide CMake options. @@ -147,7 +147,7 @@ After programming, the sample shows the following output: .. code-block:: console *** Booting nRF Connect SDK 48f33c9870f1 *** - Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 128 MHz + Starting nrf7002dk/nrf5340/cpuapp with CPU frequency: 128 MHz [00:00:00.330,932] net_config: Initializing network [00:00:00.330,932] net_config: Waiting interface 2 (0x20007a58) to be up... [00:00:00.331,085] wpa_supp: Successfully initialized wpa_supplicant diff --git a/samples/wifi/wfa_qt_app/prj.conf b/samples/wifi/wfa_qt_app/prj.conf index 1c4763ea76db..268983e5b174 100644 --- a/samples/wifi/wfa_qt_app/prj.conf +++ b/samples/wifi/wfa_qt_app/prj.conf @@ -16,8 +16,6 @@ CONFIG_WPA_SUPP=y CONFIG_NET_L2_WIFI_SHELL=y # System settings -CONFIG_NEWLIB_LIBC=y -CONFIG_NEWLIB_LIBC_NANO=n CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=100000 CONFIG_NET_CONFIG_INIT_TIMEOUT=0 @@ -61,7 +59,6 @@ CONFIG_NET_SHELL=y # Memories CONFIG_MAIN_STACK_SIZE=4096 CONFIG_SHELL_STACK_SIZE=4096 -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NET_TX_STACK_SIZE=4096 CONFIG_NET_RX_STACK_SIZE=4096 diff --git a/samples/wifi/wfa_qt_app/sample.yaml b/samples/wifi/wfa_qt_app/sample.yaml index 15faae879803..c0960a86910c 100644 --- a/samples/wifi/wfa_qt_app/sample.yaml +++ b/samples/wifi/wfa_qt_app/sample.yaml @@ -5,13 +5,13 @@ tests: sample.nrf7002.wfa_qt_app: build_only: true integration_platforms: - - nrf7002dk_nrf5340_cpuapp - platform_allow: nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + platform_allow: nrf7002dk/nrf5340/cpuapp tags: ci_build sample.nrf7002_eks.wfa_qt_app: build_only: true extra_args: SHIELD=nrf7002ek integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp tags: ci_build diff --git a/samples/wifi/wfa_qt_app/src/qt_app_main.c b/samples/wifi/wfa_qt_app/src/qt_app_main.c index 904b5c024a3e..5538222b03dd 100644 --- a/samples/wifi/wfa_qt_app/src/qt_app_main.c +++ b/samples/wifi/wfa_qt_app/src/qt_app_main.c @@ -35,7 +35,8 @@ int init_usb(void) int main(void) { - struct in_addr addr; + struct in_addr addr = {0}; + struct in_addr mask; #if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M /* For now hardcode to 128MHz */ @@ -63,10 +64,10 @@ int main(void) } if (sizeof(CONFIG_NET_CONFIG_MY_IPV4_NETMASK) > 1) { /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_NETMASK, &addr)) { + if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_NETMASK, &mask)) { printk("Invalid netmask: %s", CONFIG_NET_CONFIG_MY_IPV4_NETMASK); } else { - net_if_ipv4_set_netmask(iface, &addr); + net_if_ipv4_set_netmask_by_addr(iface, &addr, &mask); } } #endif /* CONFIG_USB_DEVICE_STACK */ @@ -90,10 +91,10 @@ int main(void) if (sizeof(CONFIG_NET_CONFIG_SLIP_IPV4_MASK) > 1) { /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_SLIP_IPV4_MASK, &addr)) { + if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_SLIP_IPV4_MASK, &mask)) { printk("Invalid netmask: %s", CONFIG_NET_CONFIG_SLIP_IPV4_MASK); } else { - net_if_ipv4_set_netmask(slip_iface, &addr); + net_if_ipv4_set_netmask_by_addr(slip_iface, &addr, &mask); } } #endif /* CONFIG_SLIP */ @@ -120,10 +121,10 @@ int main(void) } if (sizeof(CONFIG_NET_CONFIG_MY_IPV4_NETMASK) > 1) { /* If not empty */ - if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_NETMASK, &addr)) { + if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_NETMASK, &mask)) { printk("Invalid netmask: %s", CONFIG_NET_CONFIG_MY_IPV4_NETMASK); } else { - net_if_ipv4_set_netmask(wifi_iface, &addr); + net_if_ipv4_set_netmask_by_addr(wifi_iface, &addr, &mask); } } diff --git a/samples/zigbee/light_bulb/sample.yaml b/samples/zigbee/light_bulb/sample.yaml index 4b7fe73bc936..1cd690b74a34 100644 --- a/samples/zigbee/light_bulb/sample.yaml +++ b/samples/zigbee/light_bulb/sample.yaml @@ -5,12 +5,12 @@ tests: sample.zigbee.light_bulb: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build smoke sample.zigbee.light_bulb.with_shell: build_only: true @@ -18,10 +18,10 @@ tests: CONFIG_ZIGBEE_SHELL=y CONFIG_ZIGBEE_SHELL_DEBUG_CMD=y CONFIG_ZIGBEE_LOGGER_EP=n CONFIG_ZIGBEE_SHELL_ENDPOINT=10 CONFIG_LOG_MODE_DEFERRED=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build shell diff --git a/samples/zigbee/light_switch/README.rst b/samples/zigbee/light_switch/README.rst index 7cc6cca2ae19..c9a9bfce6340 100644 --- a/samples/zigbee/light_switch/README.rst +++ b/samples/zigbee/light_switch/README.rst @@ -110,22 +110,22 @@ For example, when building from the command line, use the following command: .. code-block:: console - west build samples/zigbee/light_switch -b nrf52840dk_nrf52840 -- -DCONF_FILE='prj_fota.conf' + west build samples/zigbee/light_switch -b nrf52840dk/nrf52840 -- -DFILE_SUFFIX=fota Alternatively, you can :ref:`configure Zigbee FOTA manually `. .. note:: You can use the :file:`prj_fota.conf` file only with a development kit that contains the nRF52840 or nRF5340 SoC. -To activate the Multiprotocol Bluetooth LE extension, set :makevar:`OVERLAY_CONFIG` to the :file:`overlay-multiprotocol_ble.conf`. +To activate the Multiprotocol Bluetooth LE extension, set :makevar:`EXTRA_CONF_FILE` to the :file:`overlay-multiprotocol_ble.conf`. For example, when building from the command line, use the following command: .. code-block:: console - west build samples/zigbee/light_switch -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG='overlay-multiprotocol_ble.conf' + west build samples/zigbee/light_switch -b nrf52840dk/nrf52840 -- -DEXTRA_CONF_FILE='overlay-multiprotocol_ble.conf' -For the board name to use instead of the ``nrf52840dk_nrf52840``, see :ref:`programming_board_names`. +For the board name to use instead of the ``nrf52840dk/nrf52840``, see :ref:`programming_board_names`. See :ref:`cmake_options` for instructions on how to add flags to your build. For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation. diff --git a/samples/zigbee/light_switch/sample.yaml b/samples/zigbee/light_switch/sample.yaml index b5594b1b0360..ac1c0de1cee1 100644 --- a/samples/zigbee/light_switch/sample.yaml +++ b/samples/zigbee/light_switch/sample.yaml @@ -5,47 +5,47 @@ tests: sample.zigbee.light_switch: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build smoke sample.zigbee.light_switch.current_measurement: build_only: true extra_args: CONFIG_SERIAL=n integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: ci_build current_measurement sample.zigbee.light_switch.fota: build_only: true extra_args: CONF_FILE=prj_fota.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf21540dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf21540dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build smoke sample.zigbee.light_switch.fota_and_multiprotocol: build_only: true extra_args: CONF_FILE=prj_fota.conf OVERLAY_CONFIG=overlay-multiprotocol_ble.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build sample.zigbee.light_switch.multiprotocol: build_only: true extra_args: OVERLAY_CONFIG=overlay-multiprotocol_ble.conf integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: ci_build sample.zigbee.light_switch.with_shell: build_only: true @@ -53,10 +53,10 @@ tests: CONFIG_ZIGBEE_SHELL=y CONFIG_ZIGBEE_SHELL_DEBUG_CMD=y CONFIG_ZIGBEE_LOGGER_EP=n CONFIG_ZIGBEE_SHELL_ENDPOINT=1 CONFIG_LOG_MODE_DEFERRED=y integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build shell diff --git a/samples/zigbee/ncp/CMakeLists.txt b/samples/zigbee/ncp/CMakeLists.txt index eec294c3f93e..6791046efd3f 100644 --- a/samples/zigbee/ncp/CMakeLists.txt +++ b/samples/zigbee/ncp/CMakeLists.txt @@ -6,11 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -# Set USB as default transport when nRF52 Dongle board is selected -if("${BOARD}" STREQUAL "nrf52840dongle_nrf52840") - set(CONF_FILE "prj_usb.conf") -endif() - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project("ZBOSS NCP SoC firmware") diff --git a/samples/zigbee/ncp/README.rst b/samples/zigbee/ncp/README.rst index d2d38b2636e5..4ba0ba15547d 100644 --- a/samples/zigbee/ncp/README.rst +++ b/samples/zigbee/ncp/README.rst @@ -21,7 +21,7 @@ The sample supports the following development kits: .. table-from-sample-yaml:: -The nRF5340 DK (``nrf5340dk_nrf5340_cpuapp``) is supported only for development. +The nRF5340 DK (``nrf5340dk/nrf5340/cpuapp``) is supported only for development. You can use any of the development kits listed above. @@ -91,13 +91,13 @@ The ``uart0`` pins are configured by devicetree overlay files for each supported Communication through USB ------------------------- -To change the communication channel from the default UART to nRF USB CDC ACM ``cdc_acm_uart0``, use the :file:`prj_usb.conf` configuration file and add the ``-DCONF_FILE='prj_usb.conf'`` flag to the build command. +To change the communication channel from the default UART to nRF USB CDC ACM ``cdc_acm_uart0``, use the :file:`prj_usb.conf` configuration file and add the ``-DFILE_SUFFIX=usb`` flag to the build command. See :ref:`cmake_options` for instructions on how to add this flag to your build. For example, when building from the command line, use the following command: .. code-block:: console - west build samples/zigbee/ncp -b nrf52840dk_nrf52840 -- -DCONF_FILE='prj_usb.conf' + west build samples/zigbee/ncp -b nrf52840dk/nrf52840 -- -DFILE_SUFFIX=usb The USB device VID and PID are configured by the sample's Kconfig file. @@ -169,8 +169,8 @@ Bootloader support The bootloader support in the NCP sample depends on the development kit, its respective build target, and `Serial communication setup`_: -* For the ``nrf52840dongle_nrf52840`` build target, the `nRF5 SDK Bootloader`_ is used by default because the dongle comes with this bootloader preinstalled. -* For the ``nrf52840dk_nrf52840``, ``nrf52833dk_nrf52833``, and ``nrf21540dk_nrf52840`` build targets, the following scenarios are possible when building for them: +* For the ``nrf52840dongle/nrf52840`` build target, the `nRF5 SDK Bootloader`_ is used by default because the dongle comes with this bootloader preinstalled. +* For the ``nrf52840dk/nrf52840``, ``nrf52833dk/nrf52833``, and ``nrf21540dk/nrf52840`` build targets, the following scenarios are possible when building for them: * If you select `Communication through USB`_, `MCUboot`_ is enabled by default. * If you use the default UART serial communication channel, the bootloader support is not enabled, but you can enable MCUboot. @@ -193,7 +193,7 @@ See the following command-line instruction for an example: .. code-block:: console - west build samples/zigbee/ncp -b nrf52840dk_nrf52840 -- -DCONFIG_BOOTLOADER_MCUBOOT=y -Dmcuboot_CONFIG_MULTITHREADING=y -Dmcuboot_CONFIG_BOOT_USB_DFU_WAIT=y -Dmcuboot_CONFIG_SINGLE_APPLICATION_SLOT=y -DPM_STATIC_YML_FILE=samples/zigbee/ncp/configuration/nrf52840dk_nrf52840/pm_static.yml + west build samples/zigbee/ncp -b nrf52840dk/nrf52840 -- -DCONFIG_BOOTLOADER_MCUBOOT=y -Dmcuboot_CONFIG_MULTITHREADING=y -Dmcuboot_CONFIG_BOOT_USB_DFU_WAIT=y -Dmcuboot_CONFIG_SINGLE_APPLICATION_SLOT=y -DPM_STATIC_YML_FILE=samples/zigbee/ncp/configuration/nrf52840dk_nrf52840/pm_static.yml When building the sample, the build system also generates the signed :file:`app_update.bin` image file in the :file:`build` directory. You can use this file to upgrade a device. @@ -208,7 +208,7 @@ To learn more about configuring bootloader for an application in |NCS|, see the nRF5 SDK Bootloader ------------------- -When the sample is built for ``nrf52840dongle_nrf52840``, the build system does not produce an upgrade image. +When the sample is built for ``nrf52840dongle/nrf52840``, the build system does not produce an upgrade image. To upgrade the dongle, you can use one of the following options: * nRF Connect Programmer application (part of `nRF Connect for Desktop`_). diff --git a/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840.conf b/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840.conf new file mode 100644 index 000000000000..31bb4d084861 --- /dev/null +++ b/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840.conf @@ -0,0 +1,31 @@ +# +# Copyright (c) 2021 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Enable nRF ECB driver +CONFIG_CRYPTO=y +CONFIG_CRYPTO_NRF_ECB=y +CONFIG_CRYPTO_INIT_PRIORITY=80 + +# Inform application that CDC ACM requires the line control signals to be configured. +CONFIG_ZIGBEE_UART_SUPPORTS_FLOW_CONTROL=y + +# Configure NCP sample to print ZBOSS stack logs in binary format using uart1 device +# CONFIG_ZBOSS_TRACE_BINARY_LOGGING=y + +#### Use this configuration to print ZBOSS stack logs in binary format using USB cdc_acm_uart1 device +# CONFIG_ZBOSS_TRACE_BINARY_LOGGING=y +# CONFIG_ZBOSS_TRACE_USB_CDC_LOGGING=y + +# Two USB CDC ACM instances configured for this sample: cdc_acm_uart0 and cdc_acm_uart1 +# CONFIG_USB_COMPOSITE_DEVICE=y +#### + +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_REMOTE_WAKEUP=n +CONFIG_USB_DEVICE_PRODUCT="Zigbee NCP" +CONFIG_USB_CDC_ACM=y +CONFIG_UART_LINE_CTRL=y +CONFIG_USB_DEVICE_PID=0x0001 diff --git a/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840_usb.conf b/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840_usb.conf deleted file mode 100644 index 839e16fd3301..000000000000 --- a/samples/zigbee/ncp/boards/nrf52840dongle_nrf52840_usb.conf +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Enable nRF ECB driver -CONFIG_CRYPTO=y -CONFIG_CRYPTO_NRF_ECB=y -CONFIG_CRYPTO_INIT_PRIORITY=80 diff --git a/samples/zigbee/ncp/sample.yaml b/samples/zigbee/ncp/sample.yaml index b93dded38099..89f81ba8375b 100644 --- a/samples/zigbee/ncp/sample.yaml +++ b/samples/zigbee/ncp/sample.yaml @@ -5,57 +5,30 @@ tests: sample.zigbee.ncp: build_only: true platform_allow: > - nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf21540dk_nrf52840 nrf5340dk_nrf5340_cpuapp + nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf21540dk/nrf52840 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf21540dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf21540dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp - sample.zigbee.ncp.usb.nrf52840dk_nrf52840: + sample.zigbee.ncp.usb: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf21540dk/nrf52840 + nrf52840dongle/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build ncp - extra_args: CONF_FILE=prj_usb.conf DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840_usb.overlay + extra_args: FILE_SUFFIX=usb mcuboot_FILE_SUFFIX=usb integration_platforms: - - nrf52840dk_nrf52840 - - sample.zigbee.ncp.usb.nrf52833dk_nrf52833: - build_only: true - platform_allow: nrf52833dk_nrf52833 - tags: ci_build ncp - extra_args: CONF_FILE=prj_usb.conf DTC_OVERLAY_FILE=boards/nrf52833dk_nrf52833_usb.overlay - integration_platforms: - - nrf52833dk_nrf52833 - - sample.zigbee.ncp.usb.nrf21540dk_nrf52840: - build_only: true - platform_allow: nrf21540dk_nrf52840 - tags: ci_build ncp - extra_args: CONF_FILE=prj_usb.conf DTC_OVERLAY_FILE=boards/nrf21540dk_nrf52840_usb.overlay - integration_platforms: - - nrf21540dk_nrf52840 - - sample.zigbee.ncp.usb.nrf52840dongle_nrf52840: - build_only: true - platform_allow: nrf52840dongle_nrf52840 - tags: ci_build ncp - extra_args: CONF_FILE=prj_usb.conf DTC_OVERLAY_FILE=boards/nrf52840dongle_nrf52840_usb.overlay - integration_platforms: - - nrf52840dongle_nrf52840 - - sample.zigbee.ncp.usb.nrf5340dk_nrf5340_cpuapp: - build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp - tags: ci_build ncp - extra_args: CONF_FILE=prj_usb.conf DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_usb.overlay - integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf21540dk/nrf52840 + - nrf52840dongle/nrf52840 + - nrf5340dk/nrf5340/cpuapp sample.zigbee.ncp.with_nrf21540ek: build_only: true extra_args: SHIELD=nrf21540ek integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: ci_build diff --git a/samples/zigbee/network_coordinator/sample.yaml b/samples/zigbee/network_coordinator/sample.yaml index 5a2b0d9ab566..5a60d4e90170 100644 --- a/samples/zigbee/network_coordinator/sample.yaml +++ b/samples/zigbee/network_coordinator/sample.yaml @@ -5,10 +5,10 @@ tests: sample.zigbee.network_coordinator: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build smoke diff --git a/samples/zigbee/shell/CMakeLists.txt b/samples/zigbee/shell/CMakeLists.txt index 371aa70ad09b..5a3af55ec026 100644 --- a/samples/zigbee/shell/CMakeLists.txt +++ b/samples/zigbee/shell/CMakeLists.txt @@ -6,16 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -# Set USB as default transport when sample is built for the nRF52 Dongle -if("${BOARD}" STREQUAL "nrf52840dongle_nrf52840") - set(CONF_FILE "prj_usb.conf") -endif() - -# Include app_usb.overlay when sample is built with prj_usb.conf -if("${CONF_FILE}" STREQUAL "prj_usb.conf") - set(DTC_OVERLAY_FILE "app_usb.overlay") -endif() - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project("Zigbee application with Zigbee shell") diff --git a/samples/zigbee/shell/README.rst b/samples/zigbee/shell/README.rst index 8cb3c1b42bd0..e7c0353fb8c9 100644 --- a/samples/zigbee/shell/README.rst +++ b/samples/zigbee/shell/README.rst @@ -56,7 +56,7 @@ These interfaces are completely independent one from another and can be used sim For information about setup, see :ref:`testing`. The Zigbee Shell sample uses UART as the default shell backend. -To change the shell backend from the default UART to the nRF USB CDC ACM, use the :file:`prj_usb.conf` configuration file and add the ``-DCONF_FILE='prj_usb.conf'`` flag when building the sample. +To change the shell backend from the default UART to the nRF USB CDC ACM, use the :file:`prj_usb.conf` configuration file and add the ``-DFILE_SUFFIX=usb`` flag when building the sample. With such configuration, Zephyr logs are printed only to the backend that the shell is using. You can enable the UART backend for the logger, so that Zephyr logs are printed to both the shell backend and the UART. To do this, enable the :kconfig:option:`CONFIG_LOG_BACKEND_UART` Kconfig option. diff --git a/samples/zigbee/shell/boards/nrf21540dk_nrf52840_usb.overlay b/samples/zigbee/shell/boards/nrf21540dk_nrf52840_usb.overlay new file mode 100644 index 000000000000..9d71e35a0f66 --- /dev/null +++ b/samples/zigbee/shell/boards/nrf21540dk_nrf52840_usb.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf21540dk_nrf52840.overlay" +#include "../app_usb.overlay" diff --git a/samples/zigbee/shell/boards/nrf52833dk_nrf52833_usb.overlay b/samples/zigbee/shell/boards/nrf52833dk_nrf52833_usb.overlay new file mode 100644 index 000000000000..6991186f2d11 --- /dev/null +++ b/samples/zigbee/shell/boards/nrf52833dk_nrf52833_usb.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf52833dk_nrf52833.overlay" +#include "../app_usb.overlay" diff --git a/samples/zigbee/shell/boards/nrf52840dk_nrf52840_usb.overlay b/samples/zigbee/shell/boards/nrf52840dk_nrf52840_usb.overlay new file mode 100644 index 000000000000..2d32556a246a --- /dev/null +++ b/samples/zigbee/shell/boards/nrf52840dk_nrf52840_usb.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf52840dk_nrf52840.overlay" +#include "../app_usb.overlay" diff --git a/samples/zigbee/shell/boards/nrf52840dongle_nrf52840_usb.overlay b/samples/zigbee/shell/boards/nrf52840dongle_nrf52840_usb.overlay new file mode 100644 index 000000000000..490475d06ea6 --- /dev/null +++ b/samples/zigbee/shell/boards/nrf52840dongle_nrf52840_usb.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf52840dongle_nrf52840.overlay" +#include "../app_usb.overlay" diff --git a/samples/zigbee/shell/boards/nrf5340dk_nrf5340_cpuapp_usb.overlay b/samples/zigbee/shell/boards/nrf5340dk_nrf5340_cpuapp_usb.overlay new file mode 100644 index 000000000000..8c6d4b07bce6 --- /dev/null +++ b/samples/zigbee/shell/boards/nrf5340dk_nrf5340_cpuapp_usb.overlay @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrf5340dk_nrf5340_cpuapp.overlay" +#include "../app_usb.overlay" diff --git a/samples/zigbee/shell/sample.yaml b/samples/zigbee/shell/sample.yaml index f232c9728709..213f9c1e4dff 100644 --- a/samples/zigbee/shell/sample.yaml +++ b/samples/zigbee/shell/sample.yaml @@ -5,63 +5,31 @@ tests: sample.zigbee.shell: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build shell sample.zigbee.shell.sysbuild: build_only: true sysbuild: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build shell sysbuild - sample.zigbee.shell.usb.nrf52840dk_nrf52840: + sample.zigbee.shell.usb: build_only: true extra_args: - CONF_FILE=prj_usb.conf - DTC_OVERLAY_FILE="app_usb.overlay;boards/nrf52840dk_nrf52840.overlay" + FILE_SUFFIX=usb integration_platforms: - - nrf52840dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 - tags: ci_build shell - sample.zigbee.shell.usb.nrf21540dk_nrf52840: - build_only: true - extra_args: - CONF_FILE=prj_usb.conf - DTC_OVERLAY_FILE="app_usb.overlay;boards/nrf21540dk_nrf52840.overlay" - integration_platforms: - - nrf21540dk_nrf52840 - platform_allow: nrf21540dk_nrf52840 - tags: ci_build shell - sample.zigbee.shell.usb.nrf52833dk_nrf52833: - build_only: true - extra_args: - CONF_FILE=prj_usb.conf - DTC_OVERLAY_FILE="app_usb.overlay;boards/nrf52833dk_nrf52833.overlay" - integration_platforms: - - nrf52833dk_nrf52833 - platform_allow: nrf52833dk_nrf52833 - tags: ci_build shell - sample.zigbee.shell.usb.nrf52840dongle_nrf52840: - build_only: true - extra_args: - CONF_FILE=prj_usb.conf - DTC_OVERLAY_FILE="app_usb.overlay;boards/nrf52840dongle_nrf52840.overlay" - integration_platforms: - - nrf52840dongle_nrf52840 - platform_allow: nrf52840dongle_nrf52840 - tags: ci_build shell - sample.zigbee.shell.usb.nrf5340dk_nrf5340_cpuapp: - build_only: true - extra_args: - CONF_FILE=prj_usb.conf - DTC_OVERLAY_FILE="app_usb.overlay;boards/nrf5340dk_nrf5340_cpuapp.overlay" - integration_platforms: - - nrf5340dk_nrf5340_cpuapp - platform_allow: nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf52840dongle/nrf52840 + - nrf5340dk/nrf5340/cpuapp + platform_allow: nrf52840dk/nrf52840 nrf21540dk/nrf52840 nrf52833dk/nrf52833 + nrf52840dongle/nrf52840 nrf5340dk/nrf5340/cpuapp tags: ci_build shell diff --git a/samples/zigbee/template/sample.yaml b/samples/zigbee/template/sample.yaml index 5e043a05d1ef..3d56cb5a9952 100644 --- a/samples/zigbee/template/sample.yaml +++ b/samples/zigbee/template/sample.yaml @@ -5,10 +5,10 @@ tests: sample.zigbee.template: build_only: true integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp - - nrf21540dk_nrf52840 - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp - nrf21540dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf21540dk/nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp + nrf21540dk/nrf52840 tags: ci_build smoke diff --git a/scripts/bluetooth/mesh/mesh_dfu_metadata.py b/scripts/bluetooth/mesh/mesh_dfu_metadata.py index 29861d2047d5..72b9131a32f2 100644 --- a/scripts/bluetooth/mesh/mesh_dfu_metadata.py +++ b/scripts/bluetooth/mesh/mesh_dfu_metadata.py @@ -226,7 +226,7 @@ def find_comp_data_from_dwarf(elf_path): elf_path (ELFFile): ELFFile instance Returns: - addr: Address of the found composition data instances in the firmware. + List(addr): Addresses of the found composition data instances in the firmware. """ DW_OP_addr = 0x3 @@ -246,6 +246,18 @@ def find_comp_data_from_dwarf(elf_path): opcode = location.value[0] if opcode != DW_OP_addr: continue + + addr = int.from_bytes(die.attributes.get('DW_AT_location').value[1:5], 'little') + + if 'DW_AT_abstract_origin' in die.attributes and \ + die.attributes.get('DW_AT_abstract_origin').form == 'DW_FORM_ref_addr': + # If address is moved to another die, find original variable through the + # reference and continue with the new die. + value = die.attributes.get('DW_AT_abstract_origin').value + die = dwarf_info.get_DIE_from_refaddr(value) + if die is None: + continue + # Check that the variable type is either `const struct bt_mesh_comp` or # `const struct bt_mesh_comp[]`. exp_tags = [ @@ -260,9 +272,8 @@ def find_comp_data_from_dwarf(elf_path): if type_die_type is None: raise Exception('DW_AT_type is missing') type_die = type_die.get_DIE_from_attribute('DW_AT_type') - for j, _ in enumerate(exp_tags): - if len(exp_tags[j]) > i and\ - type_die.tag == exp_tags[j][i]: + for tags in exp_tags: + if len(tags) > i and type_die.tag == tags[i]: break else: raise Exception('Wrong DW_AT_type') @@ -274,16 +285,13 @@ def find_comp_data_from_dwarf(elf_path): except Exception: continue - addr = int.from_bytes(die.attributes.get('DW_AT_location').value[1:5], 'little') comp_data_arr.append(addr) if comp_data_arr is None or len(comp_data_arr) == 0: raise Exception("Could not find composition data in .elf file") - if len(comp_data_arr) > 1: - raise Exception("Multiple instances of composition data found in .elf file") + return comp_data_arr - return comp_data_arr[0] def read_comp_data(elf_path, addr, kconfigs): """ @@ -308,38 +316,39 @@ def read_comp_data(elf_path, addr, kconfigs): # The format of an element is defined by `struct bt_mesh_elem` type. # The format of a model is defined by `struct bt_mesh_model` type. # All types are declared in `zephyr/include/zephyr/bluetooth/mesh/access.h`. - cid, pid, vid, _, elems_count, elems_ptr = struct.unpack('HHHHII', cdp0_value) - - comp = Comp0(cid, pid, vid, kconfigs) - - elems_value = read_symbol_data(elf, elems_ptr) - elems_iter = struct.iter_unpack('IHBBII', elems_value) - i = 0 - - for elem in elems_iter: - i += 1 - if i > elems_count: - raise Exception('Extracted more elems than \'elem_count\'') - __rt, loc, sig_count, vnd_count, sig_ptr, vnd_ptr = elem - elem_item = comp.elem_add(loc) - - def models_unpack(ptr, elem_item, vnd): - models_value = read_symbol_data(elf, ptr) - model_format = 'HHIIIHHIHH' + ('I' if label_cnt > 0 else '') + 'II' + ('I' if lcd_srv else '') - models_iter = struct.iter_unpack(model_format, models_value) - - for model in models_iter: - id1, id2, __rt, __pub, __keys, __keys_cnt, _, __groups, __groups_cnt, _, __uuids, __op, __cb = model - if not vnd: - elem_item.sig_model_add(id1) - else: - elem_item.vnd_model_add(id1, id2) + for comp_data_entry in struct.iter_unpack('HHHHII', cdp0_value): + cid, pid, vid, _, elems_count, elems_ptr = comp_data_entry + + comp = Comp0(cid, pid, vid, kconfigs) + + elems_value = read_symbol_data(elf, elems_ptr) + elems_iter = struct.iter_unpack('IHBBII', elems_value) + i = 0 + + for elem in elems_iter: + i += 1 + if i > elems_count: + raise Exception('Extracted more elems than \'elem_count\'') + __rt, loc, sig_count, vnd_count, sig_ptr, vnd_ptr = elem + elem_item = comp.elem_add(loc) + + def models_unpack(ptr, elem_item, vnd): + models_value = read_symbol_data(elf, ptr) + model_format = 'HHIIIHHIHH' + ('I' if label_cnt > 0 else '') + 'II' + ('I' if lcd_srv else '') + models_iter = struct.iter_unpack(model_format, models_value) + + for model in models_iter: + id1, id2, __rt, __pub, __keys, __keys_cnt, _, __groups, __groups_cnt, _, __uuids, __op, __cb = model + if not vnd: + elem_item.sig_model_add(id1) + else: + elem_item.vnd_model_add(id1, id2) - if sig_count > 0: - models_unpack(sig_ptr, elem_item, False) - if vnd_count > 0: - models_unpack(vnd_ptr, elem_item, True) - return comp + if sig_count > 0: + models_unpack(sig_ptr, elem_item, False) + if vnd_count > 0: + models_unpack(vnd_ptr, elem_item, True) + yield comp def parse_comp_data(elf_path, kconfigs): """ @@ -348,16 +357,17 @@ def parse_comp_data(elf_path, kconfigs): Parameters: kconfigs (KConfig): A KCoonfig object representing Kconfig options used for the firmware to compile with Returns: - Parsed Composition data + List of parsed composition data """ try: - addr = find_comp_data_from_dwarf(elf_path) - return read_comp_data(elf_path, addr, kconfigs) - except Exception as err : + addrs = find_comp_data_from_dwarf(elf_path) + return [comp + for addr in addrs + for comp in read_comp_data(elf_path, addr, kconfigs)] + except Exception as err: raise Exception("Failed to extract composition data from .elf file") from err -def encoded_metadata_get(version, comp, binary_size): - core_type = 1 # FIX ME: For now, hardcoded to application core +def encoded_metadata_get(version, comp, binary_size, core_type): elem_cnt = len(comp.elems) bytestring = bytearray() @@ -369,7 +379,6 @@ def encoded_metadata_get(version, comp, binary_size): bytestring.append(core_type) bytestring.extend(comp.hash_generate().to_bytes(4, 'little')) bytestring.extend(elem_cnt.to_bytes(2, 'little')) - # FIX ME: Support user data return bytestring def input_parse(): @@ -405,26 +414,35 @@ def existing_metadata_print(path): sys.exit(0) kconfigs = KConfig.from_file(config_path) - comp = parse_comp_data(elf_path, kconfigs) + comps = parse_comp_data(elf_path, kconfigs) version = kconfigs.version_parse() binary_size = os.path.getsize(os.path.join(args.bin_path, 'app_update.bin')) - encoded_metadata = encoded_metadata_get(version, comp, binary_size) - - j_dict = { - "sign_version": version, - "binary_size": binary_size, - "composition_data": comp.dict_generate(), - "composition_hash": str(hex(comp.hash_generate())), - "encoded_metadata": str(encoded_metadata.hex()), - } + core_type = 1 + + json_data = [] + + for comp in comps: + encoded_metadata = encoded_metadata_get(version, comp, binary_size, core_type) + json_data.append({ + "sign_version": version, + "binary_size": binary_size, + "core_type": core_type, + "composition_data": comp.dict_generate(), + "composition_hash": str(hex(comp.hash_generate())), + "encoded_metadata": str(encoded_metadata.hex()), + }) with open(metadata_path, "w") as outfile: - outfile.write(json.dumps(j_dict, indent=4)) + outfile.write(json.dumps(json_data if len(json_data) > 1 else json_data[0], indent=4)) zip.write(metadata_path, FILE_NAME_IN_ZIP) zip.close() print("Bluetooth Mesh Composition metadata generated:") - print(f"\tEncoded metadata: {j_dict['encoded_metadata']}") - print(f"\tFull metadata written to: {zip_path}") + if len(json_data) > 1: + print(f"\t{len(json_data)} composition data instances found.") + print(f"\tAll metadata variants written to: {zip_path}") + else: + print(f"\tEncoded metadata: {json_data[0]['encoded_metadata']}") + print(f"\tFull metadata written to: {zip_path}") except Exception: exit_with_error_msg() diff --git a/scripts/cert_to_header.py b/scripts/cert_to_header.py deleted file mode 100644 index f426e29d78df..000000000000 --- a/scripts/cert_to_header.py +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -import sys -import os - -cer_file_name = sys.argv[1] -cer_file = cer_file_name -header_file = os.path.splitext(cer_file_name)[0] + ".h" - -key = open(cer_file, "r") -c_file = open(header_file, "w") - -c_file.write("static const unsigned char " + os.path.splitext(cer_file_name)[0] + "[] = \n") - -for line in key: - line = line.replace("\n", "") - c_line = "\t\"" + line + "\\n\"\n" - c_file.write(c_line) - -c_file.write(";\n") -print('Certificate converted to C header file in:', header_file) -key.close() -c_file.close() diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index 451e878d5587..dd2e7275c502 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -18,14 +18,21 @@ LABEL org.opencontainers.image.source=https://github.com/nrfconnect/sdk-nrf LABEL org.opencontainers.image.description="This image contains toolchain for sdk-nrf." RUN apt-get update && apt-get install -y \ - ca-certificates \ + ca-certificates qemu-system-arm libffi7 git \ && rm -rf /var/lib/apt/lists/* # Copy toolchain COPY --from=nrfutil-builder /opt/ncs/toolchains /opt/ncs/toolchains COPY --from=nrfutil-builder /opt/toolchain-env.sh /opt/toolchain-env.sh -# Add entrypoint which calls toolchain-env.sh +## Add entrypoint which calls toolchain-env.sh COPY entrypoint.sh /opt/entrypoint.sh ENTRYPOINT ["/opt/entrypoint.sh"] + +RUN cat /opt/entrypoint.sh >> /tmp.sh +RUN cat /etc/bash.bashrc >> /tmp.sh +RUN cat /tmp.sh > /etc/bash.bashrc +ENV BASH_ENV=/etc/bash.bashrc + +SHELL ["/bin/bash", "-c"] CMD ["bin/bash"] diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh index 368c6558f331..24cb5e3a6e4b 100755 --- a/scripts/docker/entrypoint.sh +++ b/scripts/docker/entrypoint.sh @@ -1,4 +1,6 @@ #! /bin/bash -source /opt/toolchain-env.sh +if [ -z "${ZEPHYR_SDK_INSTALL_DIR}" ]; then + source /opt/toolchain-env.sh +fi exec "$@" diff --git a/scripts/hid_configurator/NrfHidManager.py b/scripts/hid_configurator/NrfHidManager.py index 548e9989dce2..b10f98fc0ba3 100644 --- a/scripts/hid_configurator/NrfHidManager.py +++ b/scripts/hid_configurator/NrfHidManager.py @@ -9,7 +9,7 @@ class NrfHidManager(): TYPE2BOARDLIST = { - 'gaming_mouse' : ['nrf52840gmouse', 'nrf52840dk'], + 'gaming_mouse' : ['nrf52840gmouse', 'nrf52840dk', 'nrf54l15pdk'], 'dongle' : ['nrf52840dongle', 'nrf52833dongle', 'nrf52820dongle', 'nrf5340dk'], 'keyboard' : ['nrf52kbd'], 'desktop_mouse' : ['nrf52dmouse', 'nrf52810dmouse'], diff --git a/scripts/memory-threshold-list.yaml b/scripts/memory-threshold-list.yaml index 81a527df57d0..79193c61cbda 100644 --- a/scripts/memory-threshold-list.yaml +++ b/scripts/memory-threshold-list.yaml @@ -1,44 +1,81 @@ - scenarios: - - sample.matter.lock.release - - sample.matter.light_bulb.release + - sample.matter.template.release platforms: - - nrf52840dk_nrf52840 - ram_size: 241664 - rom_size: 778240 + - nrf52840dk/nrf52840 + ram_size: 196608 # 25% free + rom_size: 828928 # 150kB free + rom_related_usage: 1024 + ram_related_usage: 512 codeowners: - kkasperczyk-no - ArekBalysNordic + - markaj-nordic - scenarios: - - sample.matter.lock.debug - - sample.matter.light_bulb.debug + - sample.matter.template.debug platforms: - - nrf52840dk_nrf52840 - ram_size: 241664 - rom_size: 931840 + - nrf52840dk/nrf52840 + ram_size: 196608 # 25% free + rom_size: 880128 # 100kB free + rom_related_usage: 2048 + ram_related_usage: 1024 codeowners: - kkasperczyk-no - ArekBalysNordic + - markaj-nordic - scenarios: - - sample.matter.lock.release + - sample.matter.template.release platforms: - - nrf7002dk_nrf5340_cpuapp - ram_size: 503808 - rom_size: 778240 + - nrf5340dk/nrf5340/cpuapp + ram_size: 393216 # 25% free + rom_size: 824832 # 150kB free + rom_related_usage: 1024 + ram_related_usage: 512 codeowners: - kkasperczyk-no - ArekBalysNordic + - markaj-nordic - scenarios: - - sample.matter.lock.debug + - sample.matter.template.debug platforms: - - nrf7002dk_nrf5340_cpuapp - ram_size: 503808 - rom_size: 942080 + - nrf5340dk/nrf5340/cpuapp + ram_size: 393216 # 25% free + rom_size: 876032 # 100kB free + rom_related_usage: 2048 + ram_related_usage: 1024 codeowners: - kkasperczyk-no - ArekBalysNordic + - markaj-nordic + + +- scenarios: + - sample.matter.template.release + platforms: + - nrf7002dk/nrf5340/cpuapp + ram_size: 393216 # 25% free + rom_size: 808448 # 150kB free + rom_related_usage: 1024 + ram_related_usage: 512 + codeowners: + - kkasperczyk-no + - ArekBalysNordic + - markaj-nordic + +- scenarios: + - sample.matter.template.debug + platforms: + - nrf7002dk/nrf5340/cpuapp + ram_size: 393216 # 25% free + rom_size: 910848 # 50kB free + rom_related_usage: 2048 + ram_related_usage: 1024 + codeowners: + - kkasperczyk-no + - ArekBalysNordic + - markaj-nordic - scenarios: - applications.nrf_desktop.z.* @@ -52,7 +89,7 @@ - scenarios: - sample.nrf5340.multiprotocol_rpmsg platforms: - - nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpunet ram_size: 55296 rom_size: 235929 codeowners: diff --git a/scripts/partition_manager/partition_manager.rst b/scripts/partition_manager/partition_manager.rst index 467a363f9525..3795d0272701 100644 --- a/scripts/partition_manager/partition_manager.rst +++ b/scripts/partition_manager/partition_manager.rst @@ -745,8 +745,8 @@ The sizes of each partition are determined by the associated :file:`pm.yml` file .. _ug_pm_static: -Static configuration -******************** +Static and dynamic configuration +******************************** By default, the Partition Manager dynamically places the partitions in memory. However, there are cases where a deployed product can consist of multiple images, and only a subset of these images can be upgraded through a firmware update mechanism. @@ -774,21 +774,23 @@ You can set ``PM_STATIC_YML_FILE`` to contain exactly the static configuration y If you do not set ``PM_STATIC_YML_FILE``, the build system will use the following order to look for files in your application source directory to use as a static configuration layout: -* If build type is used (see :ref:`modifying_build_types`), the following order applies: +* If a :ref:`file suffix ` is used, the following order applies: - 1. If the file :file:`pm_static___.yml` exists, it will be used. - #. Otherwise, if the file :file:`pm_static__.yml` exists, it will be used. - #. Otherwise, if the file :file:`pm_static_.yml` exists, it will be used. + 1. If the file :file:`pm_static___.yml` exists, it will be used. + #. Otherwise, if the file :file:`pm_static__.yml` exists, it will be used. + #. Otherwise, if the file :file:`pm_static__.yml` exists, it will be used. + #. Otherwise, if the file :file:`pm_static_.yml` exists, it will be used. + #. Otherwise, if the file :file:`pm_static_.yml` exists, it will be used. #. Otherwise, if the file :file:`pm_static.yml` exists, it will be used. -* If build type is not used, then the same order as above applies, except that ** is not part of the file name: +* If a suffixed configuration is not used, then the same order as above applies, except that ** is not part of the file name: 1. If the file :file:`pm_static__.yml` exists, it will be used. #. Otherwise, if the file :file:`pm_static_.yml` exists, it will be used. #. Otherwise, if the file :file:`pm_static.yml` exists, it will be used. For :ref:`ug_multi_image` where the image targets a different domain, :ref:`ug_multi_image_build_scripts` uses the same search algorithm, but a domain specific configuration file is also searched. -For example, :file:`pm_static___.yml` or :file:`pm_static__.yml`. +For example, :file:`pm_static___.yml` or :file:`pm_static__.yml`. Use a static partition layout to ensure consistency between builds, as the settings storage will be at the same location after the DFU. @@ -809,6 +811,37 @@ You can add or remove partitions as described in the following sections. .. note:: If the static configuration contains an entry for the ``app`` partition, this entry is ignored. +.. _ug_pm_config_dynamic: + +Configuring dynamic partitions +============================== + +For child images that use dynamic partition sizing, the Partition Manager allows you to use the ``CONFIG_PM_PARTITION_SIZE_`` Kconfig option to adjust the partition size. +This is particularly useful when you want to optimize the memory usage of MCUboot to the smallest possible size by enabling cryptographic functionalities. + +.. note:: + To match the reduced size, you need to set the ``CONFIG_PM_PARTITION_SIZE_`` Kconfig option in the child image's configuration. + For example, ``CONFIG_PM_PARTITION_SIZE_MCUBOOT`` must be set for the MCUboot child image. + +The ``CONFIG_PM_PARTITION_SIZE_`` Kconfig option allows you to specify the memory size for each child image's partition directly in the Kconfig file. +This allows for precise control over memory allocation which is crucial for system performance optimization. + +Common variants of this Kconfig's option include the following: + +* ``CONFIG_PM_PARTITION_SIZE_MCUBOOT`` - Sets the partition size for the MCUboot image, and only used for dynamic partition maps. + You can read more about this option in the `MCUboot Kconfig option documentation`_. + +* :kconfig:option:`CONFIG_PM_PARTITION_SIZE_PROVISION` - Allocates space for the provision partition used in secure boot scenarios. + +* :kconfig:option:`CONFIG_PM_PARTITION_SIZE_SETTINGS` - Defines the size of the settings storage partition, typically used for persistent configuration data. + +* :kconfig:option:`CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE` - Sets the size of the settings storage partition. + +* :kconfig:option:`CONFIG_PM_PARTITION_SIZE_NVS_STORAGE` - Configures the size of the non-volatile storage partition. + +You must adjust each variant according to the specific requirements and memory constraints of the project, ensuring optimal usage of available flash memory. +For a full list of the ``CONFIG_PM_PARTITION_SIZE`` variants, see the related `Kconfig search results`_. + .. _ug_pm_static_add_dynamic: Adding a dynamic partition diff --git a/scripts/quarantine_integration.yaml b/scripts/quarantine_integration.yaml index 20fb3a46934e..953b9dbcd54a 100644 --- a/scripts/quarantine_integration.yaml +++ b/scripts/quarantine_integration.yaml @@ -9,35 +9,34 @@ - sample.matter.light_switch.persistent_subscriptions - sample.matter.light_bulb.release - sample.matter.light_switch.release - - sample.matter.template.release - sample.matter.thermostat.release - sample.matter.window_cover.release - sample.matter.thermostat.ext_temp + - sample.matter.light_bulb.memory_profiling platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.matter.lock.nus - sample.matter.window_cover.debug - - sample.matter.template.debug - sample.matter.light_bulb.ffs - sample.matter.light_bulb.persistent_subscriptions - sample.matter.light_switch.persistent_subscriptions - sample.matter.light_bulb.release - sample.matter.light_switch.release - - sample.matter.template.release - sample.matter.thermostat.release - sample.matter.window_cover.release - sample.matter.thermostat.ext_temp + - sample.matter.light_bulb.memory_profiling platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - applications.matter_weather_station.release platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -46,12 +45,29 @@ - sample.matter.light_switch.persistent_subscriptions - sample.matter.light_bulb.release - sample.matter.light_switch.release - - sample.matter.template.release - sample.matter.thermostat.release - applications.matter_bridge.release - sample.matter.thermostat.ext_temp + - applications.matter_bridge.memory_profiling + - sample.matter.light_bulb.memory_profiling platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.matter.light_bulb.persistent_subscriptions + - sample.matter.light_switch.persistent_subscriptions + - sample.matter.light_bulb.release + - sample.matter.light_switch.release + - sample.matter.light_switch.debug + - sample.matter.template.mgrt_dac + - sample.matter.thermostat.debug + - sample.matter.thermostat.release + - sample.matter.window_cover.release + - sample.matter.window_cover.debug + platforms: + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk@0.3.0/nrf54l15/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -61,57 +77,57 @@ - sample.nrf7002.rx_prioritized - sample.nrf7002.tx_prioritized platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp comment: "To save CI-Integration time, these are part of Wi-Fi nighlty" - scenarios: - sample.bluetooth.audio_unicast_server.bt_ll_sw_split - sample.bluetooth.audio_unicast_client.bt_ll_sw_split platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.bluetooth.mesh.light_switch - sample.bluetooth.mesh.light_switch.lpn platforms: - - nrf21540dk_nrf52840 - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 + - nrf21540dk/nrf52840 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.bluetooth.mesh.light - sample.bluetooth.mesh.light_dimmer platforms: - - nrf21540dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - thingy53_nrf5340_cpuapp + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.bluetooth.mesh.light.dfu platforms: - - nrf21540dk_nrf52840 + - nrf21540dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.bluetooth.mesh.silvair_enocean platforms: - - nrf21540dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf52840dk_nrf52840 + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.bluetooth.mesh.ble_and_mesh platforms: - - nrf21540dk_nrf52840 - - nrf52833dk_nrf52833 + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -119,8 +135,8 @@ - sample.bluetooth.mesh.chat - sample.bluetooth.mesh.sensor_client platforms: - - nrf21540dk_nrf52840 - - nrf52840dk_nrf52840 + - nrf21540dk/nrf52840 + - nrf52840dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -155,7 +171,7 @@ - sample.cellular.modem_shell_debug - sample.cellular.modem_shell_modem_uart_trace platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -171,7 +187,7 @@ - sample.cellular.modem_shell.nrf7002ek_wifi - sample.cellular.modem_shell_debug platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -181,7 +197,7 @@ - sample.cellular.location.nrf7002ek_wifi - sample.cellular.location.pgps platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -189,7 +205,7 @@ - sample.cellular.location.nrf7000ek_wifi - sample.cellular.location.nrf7001ek_wifi platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -198,22 +214,22 @@ - sample.cellular.http_update.full_modem_update - sample.cellular.http_update.modem_delta_update platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.cellular.slm_shell platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf7002dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - nrf7002dk/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - samples.cellular.nidd - sample.cellular.udp platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -222,88 +238,87 @@ - sample.cellular.battery - sample.cellular.modem_callbacks platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.net.azure_iot_hub platforms: - - nrf7002dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns - - nrf9161dk_nrf9161_ns + - nrf7002dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - nrf9161dk/nrf9161/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.net.azure_iot_hub.dps platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.net.coap_client platforms: - - nrf7002dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf7002dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - - sample.matter.template.debug - sample.matter.template.smp_dfu platforms: - - nrf52840dk_nrf52840 - - nrf7002dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf7002dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.matter.thermostat.debug platforms: - - nrf7002dk_nrf5340_cpuapp + - nrf7002dk/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - samples.npm1300_fuel_gauge - samples.npm1300_one_button platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.hw_id.device_id platforms: - - 9160dk_nrf9160 + - nrf9160dk/nrf9160 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.debug.memfault - sample.debug.memfault.etb platforms: - - nrf9160dk_nrf9160_ns - - thingy91_nrf9160_ns + - nrf9160dk/nrf9160/ns + - thingy91/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.debug.memfault platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.sensor.bme68x.i2c - sample.sensor.bme68x.polling platforms: - - thingy53_nrf5340_cpuapp_ns - - thingy91_nrf9160 + - thingy53/nrf5340/cpuapp/ns + - thingy91/nrf9160 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.sensor.bme68x.i2c platforms: - - thingy91_nrf9160_ns + - thingy91/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -316,32 +331,855 @@ - applications.serial_lte_modem - applications.serial_lte_modem.lwm2m_carrier platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - applications.serial_lte_modem - applications.serial_lte_modem.native_tls platforms: - - nrf9161dk_nrf9161_ns + - nrf9161dk/nrf9161/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - applications.serial_lte_modem.lwm2m_carrier - applications.serial_lte_modem.native_tls platforms: - - thingy91_nrf9160_ns + - thingy91/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - applications.matter_weather_station.debug.no_fd platforms: - - thingy53_nrf5340_cpuapp + - thingy53/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - nrf5340_audio.sw_codec_lc3_test platforms: - - nrf5340_audio_dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp + - nrf5340_audio_dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - dfu.dfu_target.mcuboot + - mcuboot.direct_xip + platforms: + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf_profiler + platforms: + - nrf21540dk/nrf52840 + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - fast_pair.storage.factory_reset.6keys + - fast_pair.storage.factory_reset.7keys + - fast_pair.storage.factory_reset.8keys + - fast_pair.storage.factory_reset.9keys + - fast_pair.storage.factory_reset.default + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - fast_pair.storage.account_key_storage.6keys + - fast_pair.storage.account_key_storage.7keys + - fast_pair.storage.account_key_storage.8keys + - fast_pair.storage.account_key_storage.9keys + platforms: + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - fast_pair.storage.account_key_storage.default + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - fast_pair.crypto.mbedtls + - fast_pair.crypto.oberon + - fast_pair.crypto.tinycrypt + - fast_pair.crypto.psa + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - nrf_profiler.core + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.nrf_desktop.zrelease + platforms: + - nrf52810dmouse/nrf52810 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf52833dongle/nrf52833 + - nrf52dmouse/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.nrf_desktop.zdebugwithshell + platforms: + - nrf52833dk/nrf52833 + - nrf52833dongle/nrf52833 + - nrf52kbd/nrf52832 + - nrf52840dongle/nrf52840 + - nrf52840gmouse/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.nrf_desktop.zdebug_fast_pair.gmouse + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.nrf_desktop.zdebug_3bleconn + - applications.nrf_desktop.zrelease_4llpmconn + platforms: + - nrf52840dongle/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.nrf_desktop.zdebug_mcuboot_smp + - applications.nrf_desktop.zrelease_fast_pair.gmouse + platforms: + - nrf52840gmouse/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.coexistence.debug + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.benchmark.coremark + platforms: + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.benchmark.coremark_static + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.benchmark.coremark_multithread + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.coexistence.release + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.qualification.release + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.qualification.debug + platforms: + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.simple.release + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.find_my.simple.debug + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - application.find_my.thingy.release + platforms: + - thingy53/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf7002ek_wifi.scan + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf_cloud_multi_service.mqtt + platforms: + - nrf9161dk/nrf9161/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf_cloud_multi_service.coap + platforms: + - thingy91/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf_cloud_rest_device_message + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf_cloud_rest_cell_pos + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.cellular.nrf_cloud_rest_fota + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_temp.blocking + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpunet + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_temp.non_blocking + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_spim.blocking + - examples.nrfx_pwm.common_mode + - examples.nrfx_gppi.fork + platforms: + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_spim.non_blocking + - examples.nrfx_pwm.grouped_mode + - examples.nrfx_gppi.one_to_one + - examples.nrfx_twim_twis.blocking + platforms: + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_spim_spis.non_blocking + - examples.nrfx_saadc.simple_blocking + - examples.nrfx_saadc.simple_non_blocking + - examples.nrfx_twim_twis.txtx + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_twim_twis.txrx + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - examples.nrfx_twim_twis.non_blocking + platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.gazell.gzp_dynamic_pairing.device.build + - sample.gazell.gzll_ack_payload.host.build + - sample.gazell.gzll_ack_payload.device.build + - sample.gazell.gzp_dynamic_pairing.host.build + platforms: + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_lbs_minimal + platforms: + - nrf52833dk/nrf52820 + - nrf52dk/nrf52810 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_lbs_no_security + platforms: + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_lbs + - sample.bluetooth.peripheral_lbs_bt_ota_dfu + - sample.bluetooth.peripheral_lbs_no_security + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_lbs + - sample.bluetooth.peripheral_lbs_no_security + platforms: + - thingy53/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_uart + platforms: + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp/ns + - thingy53/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_uart_minimal + platforms: + - nrf52833dk/nrf52820 + - nrf52840dk/nrf52811 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_uart_cdc + platforms: + - nrf52833dk/nrf52833 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_uart.sysbuild + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_hids_mouse.build + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_hids_keyboard.build + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_hids.build + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_dfu_smp.build + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_dfu_smp + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_bas.build + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_uart + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_mds + platforms: + - nrf52833dk/nrf52833 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_cgm + platforms: + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_power_profiling + platforms: + - nrf52833dk/nrf52833 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_rscs + platforms: + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_gatt_dm + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_cts_client.build + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.throughput + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_nfc_pairing + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_ancs_client.build + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.multiple_adv_sets.build + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_ams_client.build + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_and_peripheral_hr.build + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.central_nfc_pairing + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.bluetooth.peripheral_bms + platforms: + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.asset_tracker_v2.aws + - applications.asset_tracker_v2.azure + - applications.asset_tracker_v2.debug + - applications.asset_tracker_v2.nrf_cloud + platforms: + - native_sim + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.asset_tracker_v2.aws + - applications.asset_tracker_v2.aws-all + - applications.asset_tracker_v2.aws-pgps + - applications.asset_tracker_v2.aws-pgps.sysbuild + - applications.asset_tracker_v2.aws.sysbuild + - applications.asset_tracker_v2.azure + - applications.asset_tracker_v2.debug + - applications.asset_tracker_v2.debug-memfault + - applications.asset_tracker_v2.debug.sysbuild + - applications.asset_tracker_v2.low-power + - applications.asset_tracker_v2.low-power.sysbuild + - applications.asset_tracker_v2.lwm2m.debug + - applications.asset_tracker_v2.lwm2m.low-power.sysbuild + - applications.asset_tracker_v2.lwm2m.memfault + - applications.asset_tracker_v2.memfault + - applications.asset_tracker_v2.memfault-low-power + - applications.asset_tracker_v2.memfault.sysbuild + - applications.asset_tracker_v2.nrf7002ek_wifi-debug.sysbuild + - applications.asset_tracker_v2.nrf7002ek_wifi.nrf9160dk + - applications.asset_tracker_v2.nrf7002ek_wifi.nrf9160dk.sysbuild + - applications.asset_tracker_v2.nrf_cloud + - applications.asset_tracker_v2.nrf_cloud-no-agnss + - applications.asset_tracker_v2.nrf_cloud-no-agnss.sysbuild + - applications.asset_tracker_v2.nrf_cloud-pgps + - applications.asset_tracker_v2.nrf_cloud.sysbuild + - applications.asset_tracker_v2.nrf7002ek_wifi-debug + - applications.asset_tracker_v2.nrf7002ek_wifi.nrf9161dk + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.asset_tracker_v2.aws + - applications.asset_tracker_v2.aws-all + - applications.asset_tracker_v2.aws-pgps + - applications.asset_tracker_v2.aws-pgps.sysbuild + - applications.asset_tracker_v2.aws.sysbuild + - applications.asset_tracker_v2.azure + - applications.asset_tracker_v2.debug + - applications.asset_tracker_v2.debug-memfault + - applications.asset_tracker_v2.debug.sysbuild + - applications.asset_tracker_v2.low-power + - applications.asset_tracker_v2.low-power.sysbuild + - applications.asset_tracker_v2.lwm2m.debug + - applications.asset_tracker_v2.lwm2m.low-power.sysbuild + - applications.asset_tracker_v2.lwm2m.memfault + - applications.asset_tracker_v2.memfault + - applications.asset_tracker_v2.memfault-low-power + - applications.asset_tracker_v2.memfault.sysbuild + - applications.asset_tracker_v2.nrf_cloud + - applications.asset_tracker_v2.nrf_cloud-no-agnss + - applications.asset_tracker_v2.nrf_cloud-no-agnss.sysbuild + - applications.asset_tracker_v2.nrf_cloud-pgps + - applications.asset_tracker_v2.nrf_cloud.sysbuild + platforms: + - thingy91/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - applications.asset_tracker_v2.cloud.cloud_codec.json_common.aws + - applications.asset_tracker_v2.cloud.cloud_codec.json_common.azure + platforms: + - nrf9160dk/nrf9160 + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - asset_tracker_v2.location_module_test.tester + - asset_tracker_v2.lwm2m_codec + - asset_tracker_v2.nrf_cloud_codec_test + - asset_tracker_v2.debug_module_test.tester + - asset_tracker_v2.lwm2m_integration + - asset_tracker_v2.ui_module_test.tester + platforms: + - nrf9160dk/nrf9160/ns + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - asset_tracker_v2.nrf_cloud_codec_mocked_cjson_test + platforms: + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nfc.record_text + - sample.nfc.tnep_tag + - sample.nfc.system_off + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nfc.writable_ndef_msg + - sample.nfc.launch_app + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nfc.shell + platforms: + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nfc.tag_reader + platforms: + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nfc.tnep_poller + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.esb.prx.build + - sample.esb.ptx.build + platforms: + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52810 + - nrf52dk/nrf52832 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.peripheral.lpuart + - sample.peripheral.lpuart_int_driven + - sample.peripheral.lpuart_nrf52840_debug + platforms: + - nrf21540dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - tfm.psa_test_initial_attestation_lvl1 + - tfm.psa_test_internal_trusted_storage_lvl1 + - tfm.psa_test_protected_storage_lvl1 + - tfm.psa_test_storage_lvl1 + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - tfm.psa_test_crypto_lvl2 + - tfm.psa_test_initial_attestation_lvl2 + - tfm.psa_test_internal_trusted_storage_lvl2 + - tfm.psa_test_protected_storage_lvl2 + - tfm.psa_test_storage_lvl2 + platforms: + - nrf5340dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - tfm.regression_fp_hardabi + - tfm.regression_ipc_lvl1 + - tfm.regression_ipc_lvl2.cc3xx + - tfm.regression_ipc_lvl2.oberon + - tfm.regression_sfn_lvl1 + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.net.mqtt + - sample.net.http_server.lte + - sample.net.http_server.lte.tls + - sample.net.udp + platforms: + - nrf9161dk/nrf9161/ns + - thingy91/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.net.udp.emulation + platforms: + - qemu_x86 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.net.https_client + - sample.net.https_client.lte.tfm-mbedtls + - sample.net.download_client + - sample.net.download_client.ci + platforms: + - nrf9161dk/nrf9161/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.net.aws_iot + platforms: + - thingy91/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - net.lib.aws_fota.aws_fota_json + platforms: + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - net.lib.mqtt_helper + platforms: + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - lib.fprotect.sys_init_fprotect + - drivers.fprotect.positive + - drivers.fprotect.negative + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - fw_info.core + platforms: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - flash_patch.flash_patch_off + - flash_patch.flash_patch_on + platforms: + - nrf52833dk/nrf52833 + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - lpuart.two_chip_test_busy_sim + - lpuart.two_chip_test_debug + platforms: + - nrf9160dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - lpuart.loopback_busy_sim + - lpuart.loopback_busy_sim_no_hfxo + - lpuart.loopback_no_hfxo + - lpuart.two_chip_test_busy_sim + - lpuart.two_chip_test_debug + platforms: + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7001_eks.shell + - sample.nrf7001_eks_cpunet.shell + - sample.nrf7002_eks.shell + - sample.nrf7002_eks_cpunet.shell + platforms: + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7002.shell + - sample.nrf7002.shell.disable_adv_features + - sample.nrf7002.shell.otbr + - sample.nrf7002.shell.posix_names + - sample.nrf7002.shell.scan_only_7002 + - sample.nrf7002.shell.wpa_cli + - sample.nrf7002.shell.zperf + platforms: + - nrf7002dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7001.shell + - sample.nrf7001.shell.wpa_cli + - sample.nrf7001.shell.zperf + platforms: + - nrf7002dk/nrf7001/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7002_ns.shell + platforms: + - nrf7002dk/nrf5340/cpuapp/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7001_eks.scan + - sample.nrf7002_eks.raw_scan + - sample.nrf7002_eks.scan + platforms: + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7002_eks.raw_scan + platforms: + - nrf9161dk/nrf9161/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7002_eks.radio_test + - sample.nrf7002_eks.sta + - sample.nrf7002_eks.scan + platforms: + - nrf52840dk/nrf52840 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.nrf7001_eks.radio_test + - sample.nrf7001_eks.sta + - sample.nrf7001_eks.scan + - sample.nrf7001_eks.provisioning + platforms: + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - dfu.target_stream + - dfu.target_stream.store_progress + platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160 comment: "Configurations excluded to limit resources usage in integration builds" diff --git a/scripts/quarantine_windows_mac.yaml b/scripts/quarantine_windows_mac.yaml index 28951839546b..7ca8199e495e 100644 --- a/scripts/quarantine_windows_mac.yaml +++ b/scripts/quarantine_windows_mac.yaml @@ -29,29 +29,5 @@ - scenarios: - applications.asset_tracker_v2.*.sysbuild platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "https://nordicsemi.atlassian.net/browse/NCSDK-26461" - -- scenarios: - - applications.matter_bridge.smp_dfu.br_ble - platforms: - - nrf7002dk_nrf5340_cpuapp - comment: "https://nordicsemi.atlassian.net/browse/SHEL-2579" - -- scenarios: - - applications.matter_bridge.nrf70ek - - sample.matter.lock.thread_wifi_switched - platforms: - - nrf5340dk_nrf5340_cpuapp - comment: "https://nordicsemi.atlassian.net/browse/NCSDK-26462" - -- scenarios: - - sample.caf_sensor_manager.nrf54h20.multicore - - sample.cellular.modem_shell.modem_trace_shell_ext_flash - - sample.event_manager_proxy.nrf54h20pdk_cpuapp.icmsg - - sample.ipc.ipc_service.nrf54h20pdk_cpuapp_cpuppr_icmsg - - sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr - - sample.multicore.hello_world.nrf54h20pdk_cpuapp_cpuppr_ram - platforms: - - all - comment: "https://nordicsemi.atlassian.net/browse/NCSDK-26460" diff --git a/scripts/quarantine_zephyr.yaml b/scripts/quarantine_zephyr.yaml index fd21b47905fb..a0655480a9bf 100644 --- a/scripts/quarantine_zephyr.yaml +++ b/scripts/quarantine_zephyr.yaml @@ -7,50 +7,61 @@ - scenarios: - drivers.flash.common.tfm_ns platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24917" - scenarios: - libraries.hash_map.newlib.cxx_unordered_map.djb2 platforms: - - nrf52dk_nrf52832 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160/ns - mps2_an521 - qemu_cortex_m3 - - nrf5340dk_nrf5340_cpuapp_ns - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpunet + - nrf5340dk/nrf5340/cpuapp/ns + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpunet comment: "https://nordicsemi.atlassian.net/browse/NCSDK-21219" - scenarios: - mcuboot.recovery.retention - mcuboot.recovery.retention.mem platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24920" - scenarios: - mgmt.mcumgr.all.options - mgmt.mcumgr.all.options.other platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24921" - scenarios: - sample.bluetooth.central.multilink - sample.bluetooth.peripheral_identity platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24923" - scenarios: + - drivers.display.default + - drivers.display.read_write.sdl.argb8888 + - drivers.display.read_write.sdl.bgr565 + - drivers.display.read_write.sdl.mono01 + - drivers.display.read_write.sdl.mono01.lsbfirst + - drivers.display.read_write.sdl.mono10 + - drivers.display.read_write.sdl.mono10.lsbfirst + - drivers.display.read_write.sdl.rgb565 + - drivers.display.read_write.sdl.rgb888 + - sample.display.builtin - sample.display.lvgl.gui - sample.modules.lvgl.accelerometer_chart - sample.modules.lvgl.demo_music - sample.modules.lvgl.demo_benchmark - sample.modules.lvgl.demo_stress + - sample.modules.lvgl.demo_widgets platforms: - native_posix comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24924" @@ -58,7 +69,7 @@ - scenarios: - sample.drivers.flash.soc_flash_nrf platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24925" - scenarios: @@ -70,22 +81,24 @@ - scenarios: - sample.mcumgr.smp_svr.mcuboot_flags.direct_xip_withrevert platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24927" - scenarios: - sample.mgmt.osdp.control_panel + - sample.mgmt.osdp.control_panel_sc - sample.mgmt.osdp.peripheral_device + - sample.mgmt.osdp.peripheral_device_sc platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "https://nordicsemi.atlassian.net/browse/NCSDK-24928" - scenarios: - sample.bindesc platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "https://nordicsemi.atlassian.net/browse/NCSDK-25551" - scenarios: @@ -95,32 +108,32 @@ - scenarios: - examples.nrfx_uarte.tx_rx_non_blocking platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 comment: "https://nordicsemi.atlassian.net/browse/NRFX-3395" - scenarios: - examples.nrfx_uarte.rx_double_buffered platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp - - nrf52833dk_nrf52833 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp + - nrf52833dk/nrf52833 comment: "https://nordicsemi.atlassian.net/browse/NRFX-3468" - scenarios: - examples.nrfx_uarte.tx_rx_non_blocking platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52833dk_nrf52833 + - nrf5340dk/nrf5340/cpuapp + - nrf52833dk/nrf52833 comment: "https://nordicsemi.atlassian.net/browse/NRFX-3468" - scenarios: - examples.nrfx_saadc.maximum_performance platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf9160dk/nrf9160 comment: "https://nordicsemi.atlassian.net/browse/NRFX-3813" # --------------------------------- Won't fix section ----------------------------------- @@ -128,22 +141,22 @@ - scenarios: - libraries.encoding.jwt platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-15508" - scenarios: - net.mqtt.tls platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-24922" - scenarios: - net.socket.register.tls platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-18853" - scenarios: @@ -163,20 +176,20 @@ - scenarios: - sample.drivers.crypto.mbedtls platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-15306" - scenarios: - sample.net.sockets.websocket_client platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-24929" - scenarios: - sample.psa_crypto platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "Won't be fixed - https://nordicsemi.atlassian.net/browse/NCSDK-22771" diff --git a/scripts/quarantine_zephyr_integration.yaml b/scripts/quarantine_zephyr_integration.yaml index 0fe9d0c557d7..0344eaf2a600 100644 --- a/scripts/quarantine_zephyr_integration.yaml +++ b/scripts/quarantine_zephyr_integration.yaml @@ -24,7 +24,7 @@ - net.lwm2m.lwm2m_registry - net.lwm2m.block_transfer platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 - native_posix comment: "Configurations excluded to limit resources usage in integration builds" @@ -37,10 +37,10 @@ - scenarios: - net.coap.simple platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -95,13 +95,13 @@ platforms: - mps2_an521 - native_posix - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpunet - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 comment: "Configurations excluded to limit resources usage in integration builds" @@ -116,23 +116,23 @@ - sample.net.openthread.coprocessor.usb - sample.openthread.coprocessor.rcp platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.net.lwm2m_client.bt - sample.net.lwm2m_client.wnc_m14a2a platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - sample.sensor.iaqcore platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -140,16 +140,16 @@ - sample.tfm.secure_partition - sample.tfm_ipc platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp/ns comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: - net.conn_mgr.conn platforms: - native_posix - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp comment: "Configurations excluded to limit resources usage in integration builds" - scenarios: @@ -157,6 +157,87 @@ - net.conn_mgr.nodad platforms: - native_posix - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - libraries.cmsis_dsp.* + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - mgmt.mcumgr.os.info + - mgmt.mcumgr.os.info.build_date + - mgmt.mcumgr.os.info.limited_size + - mgmt.mcumgr.os.info.no_hooks + platforms: + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpunet + - nrf9160dk/nrf9160 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - mgmt.mcumgr.os.info + - mgmt.mcumgr.os.info.build_date + - mgmt.mcumgr.os.info.limited_size + - mgmt.mcumgr.os.info.net + - mgmt.mcumgr.os.info.no_hooks + platforms: + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - mgmt.mcumgr.fs.mgmt.hash.supported.all + - mgmt.mcumgr.fs.mgmt.hash.supported.crc32 + - mgmt.mcumgr.fs.mgmt.hash.supported.sha256 + platforms: + - mps2_an521 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - mgmt.mcumgr.smp.version + - mgmt.mcumgr.smp.version_no_legacy + platforms: + - mps2_an521 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - mgmt.mcumgr.os.echo + platforms: + - mps2_an521 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - qemu_cortex_m3 + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.usb.dfu + - sample.usb.dfu.permanent.download + platforms: + - nrf5340dk/nrf5340/cpuapp + comment: "Configurations excluded to limit resources usage in integration builds" + +- scenarios: + - sample.mcumgr.smp_svr.bt + platforms: + - nrf52dk/nrf52832 comment: "Configurations excluded to limit resources usage in integration builds" diff --git a/scripts/requirements-build.txt b/scripts/requirements-build.txt index 2acf13bdf9cc..1560513300ec 100644 --- a/scripts/requirements-build.txt +++ b/scripts/requirements-build.txt @@ -6,4 +6,4 @@ imagesize>=1.2.0 intelhex pylint zcbor~=0.8.0 -nrf-regtool~=5.1.0 +nrf-regtool~=5.2.0 diff --git a/scripts/requirements-extra.txt b/scripts/requirements-extra.txt index 2df755b089a3..2b41ec4c5ccd 100644 --- a/scripts/requirements-extra.txt +++ b/scripts/requirements-extra.txt @@ -1,7 +1,8 @@ pygit2<=1.10 -Pillow>=10.2.0 +Pillow>=10.3.0 # https://github.com/advisories/GHSA-44wm-f244-xhp3 editdistance>=0.5.0 PyGithub -jinja2>=3.1.3 +jinja2>=3.1.4 # https://github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj zcbor>=0.8.0 nrfcredstore>=1.0.0,<2 +idna>=3.7 # https://github.com/advisories/GHSA-jjg7-2v4v-x38h diff --git a/scripts/requirements-fixed.txt b/scripts/requirements-fixed.txt index fc010969c13a..efc0c422f6ca 100644 --- a/scripts/requirements-fixed.txt +++ b/scripts/requirements-fixed.txt @@ -11,6 +11,7 @@ arrow==1.2.1 # via gitlint-core astroid==2.15.6 # via pylint attrs==23.1.0 # via jsonschema, referencing bitarray==2.8.1 # via -r nrf/scripts/requirements-ci.txt +bz==1.0 # via -r zephyr/scripts/requirements-run-test.txt canopen==2.1.0 # via -r zephyr/scripts/requirements-base.txt capstone==4.0.2 # via pyocd cbor==1.0.0 # via -r zephyr/scripts/requirements-run-test.txt @@ -41,16 +42,16 @@ gitpython==3.1.41 # via -r nrf/scripts/requirements-ci.txt graphviz==0.20.1 # via -r zephyr/scripts/requirements-extras.txt grpcio==1.58.0 # via grpcio-tools grpcio-tools==1.58.0 # via -r zephyr/scripts/requirements-extras.txt -idna==3.4 # via requests +idna==3.7 # via -r nrf/scripts/requirements-extra.txt, requests imagesize==1.4.1 # via -r nrf/scripts/requirements-build.txt -imgtool==1.10.0 # via -r zephyr/scripts/requirements-extras.txt +imgtool==2.0.0 # via -r zephyr/scripts/requirements-extras.txt importlib-metadata==6.8.0 # via pyocd importlib-resources==6.1.0 # via libusb-package, pyocd iniconfig==2.0.0 # via pytest intelhex==2.3.0 # via -r bootloader/mcuboot/scripts/requirements.txt, -r nrf/scripts/requirements-build.txt, -r zephyr/scripts/requirements-base.txt, imgtool, lpc-checksum, nrf-regtool, pyocd intervaltree==3.1.0 # via pyocd isort==5.12.0 # via pylint -jinja2==3.1.3 # via -r nrf/scripts/requirements-extra.txt, gcovr, junit2html +jinja2==3.1.4 # via -r nrf/scripts/requirements-extra.txt, gcovr, junit2html jsonschema==4.19.1 # via -r nrf/scripts/requirements-ci.txt jsonschema-specifications==2023.7.1 # via jsonschema junit2html==30.1.3 # via -r zephyr/scripts/requirements-extras.txt @@ -69,12 +70,12 @@ msgpack==1.0.5 # via python-can mypy==1.5.1 # via -r zephyr/scripts/requirements-build-test.txt mypy-extensions==1.0.0 # via mypy natsort==8.4.0 # via pyocd -nrf-regtool==5.1.0 # via -r nrf/scripts/requirements-build.txt +nrf-regtool==5.2.0 # via -r nrf/scripts/requirements-build.txt nrfcredstore==1.0.0 # via -r nrf/scripts/requirements-extra.txt numpy==1.26.4 # via svada packaging==23.1 # via -r zephyr/scripts/requirements-base.txt, pytest, python-can, setuptools-scm, west pathspec==0.11.2 # via yamllint -pillow==10.2.0 # via -r nrf/scripts/requirements-extra.txt, -r zephyr/scripts/requirements-extras.txt +pillow==10.3.0 # via -r nrf/scripts/requirements-extra.txt, -r zephyr/scripts/requirements-extras.txt platformdirs==3.10.0 # via pylint pluggy==1.3.0 # via pytest ply==3.11 # via -r zephyr/scripts/requirements-build-test.txt @@ -104,7 +105,7 @@ python-magic==0.4.27 # via -r zephyr/scripts/requirements-compliance.txt python-stdnum==1.19 # via -r nrf/scripts/requirements-ci.txt pytz==2023.3.post1 # via -r nrf/scripts/requirements-ci.txt pyusb==1.2.1 # via -r nrf/scripts/requirements-ci.txt, pyocd -pyyaml==6.0.1 # via -r zephyr/scripts/requirements-base.txt, cmsis-pack-manager, devicetree, pyocd, west, yamllint, zcbor +pyyaml==6.0.1 # via -r bootloader/mcuboot/scripts/requirements.txt, -r zephyr/scripts/requirements-base.txt, cmsis-pack-manager, devicetree, pyocd, west, yamllint, zcbor qrcode==7.4.2 # via -r nrf/scripts/requirements-ci.txt referencing==0.30.2 # via jsonschema, jsonschema-specifications regex==2023.8.8 # via zcbor diff --git a/scripts/tools-versions-darwin.yml b/scripts/tools-versions-darwin.yml index 4cde7380c8ed..770bf91587cf 100644 --- a/scripts/tools-versions-darwin.yml +++ b/scripts/tools-versions-darwin.yml @@ -15,8 +15,8 @@ west: nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.5 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5 + version: 0.16.5-1 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5-1 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/scripts/tools-versions-linux.yml b/scripts/tools-versions-linux.yml index c4e22452fb2e..e664b3e0c69c 100644 --- a/scripts/tools-versions-linux.yml +++ b/scripts/tools-versions-linux.yml @@ -17,8 +17,8 @@ gn: nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.5 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5 + version: 0.16.5-1 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5-1 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/scripts/tools-versions-win10.yml b/scripts/tools-versions-win10.yml index d0de2a27c614..1b91f410090d 100644 --- a/scripts/tools-versions-win10.yml +++ b/scripts/tools-versions-win10.yml @@ -15,8 +15,8 @@ west: nanopb: version: 0.4.6 zephyr-sdk: - version: 0.16.5 - architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5 + version: 0.16.5-1 + architectures: # https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.16.5-1 - aarch64-zephyr-elf - x86_64-zephyr-elf - arm-zephyr-eabi diff --git a/scripts/west_commands/ncs_commands.py b/scripts/west_commands/ncs_commands.py index 80ac86d116f1..8297bc81515f 100644 --- a/scripts/west_commands/ncs_commands.py +++ b/scripts/west_commands/ncs_commands.py @@ -724,13 +724,16 @@ def upmerge(self, name: str, project: Project, z_project: Project) -> None: _BLOCKED_PROJECTS: set[Path] = set( Path(p) for p in ['modules/audio/sof', + 'modules/debug/percepio', 'modules/hal/altera', + 'modules/hal/ambiq', 'modules/hal/atmel', 'modules/hal/cypress', 'modules/hal/espressif', 'modules/hal/ethos_u', 'modules/hal/gigadevice', 'modules/hal/infineon', + 'modules/hal/intel', 'modules/hal/microchip', 'modules/hal/nuvoton', 'modules/hal/nxp', @@ -744,7 +747,22 @@ def upmerge(self, name: str, project: Project, z_project: Project) -> None: 'modules/hal/telink', 'modules/hal/ti', 'modules/hal/xtensa', + 'modules/lib/acpica', + 'modules/crypto/mbedtls', 'modules/lib/tflite-micro', 'modules/lib/thrift', 'modules/tee/tf-a/trusted-firmware-a', + 'modules/tee/tf-m/trusted-firmware-m', + 'tools/bsim', + 'tools/bsim/components', + 'tools/bsim/components/ext_2G4_libPhyComv1', + 'tools/bsim/components/ext_2G4_phy_v1', + 'tools/bsim/components/ext_2G4_channel_NtNcable', + 'tools/bsim/components/ext_2G4_channel_multiatt', + 'tools/bsim/components/ext_2G4_modem_magic', + 'tools/bsim/components/ext_2G4_modem_BLE_simple', + 'tools/bsim/components/ext_2G4_device_burst_interferer', + 'tools/bsim/components/ext_2G4_device_WLAN_actmod', + 'tools/bsim/components/ext_2G4_device_playback', + 'tools/bsim/components/ext_libCryptov1', ]) diff --git a/snippets/nrf70-debug/overlay-debug.conf b/snippets/nrf70-debug/overlay-debug.conf index 184d0bd4fca0..0d14b1791c0e 100644 --- a/snippets/nrf70-debug/overlay-debug.conf +++ b/snippets/nrf70-debug/overlay-debug.conf @@ -5,7 +5,7 @@ # CONFIG_SHELL=y -CONFIG_SHELL_STACK_SIZE=4096 +CONFIG_SHELL_STACK_SIZE=4200 CONFIG_NET_SHELL=y CONFIG_SHELL_GETOPT=y CONFIG_SHELL_CMDS_RESIZE=n diff --git a/snippets/nrf91-modem-trace-ext-flash/snippet.yml b/snippets/nrf91-modem-trace-ext-flash/snippet.yml index ad8354ff399d..1389cfaec5b2 100644 --- a/snippets/nrf91-modem-trace-ext-flash/snippet.yml +++ b/snippets/nrf91-modem-trace-ext-flash/snippet.yml @@ -3,9 +3,9 @@ append: EXTRA_CONF_FILE: modem-trace-ext-flash.conf EXTRA_DTC_OVERLAY_FILE: modem-trace-uart.overlay boards: - nrf9160dk_nrf9160_ns: + nrf9160dk/nrf9160/ns: append: EXTRA_DTC_OVERLAY_FILE: nrf9160dk-ext-flash.overlay - /nrf91[356]1[de]k_nrf91[356]1_ns/: + /nrf91[356]1[de]k\/nrf91[356]1\/ns/: append: EXTRA_DTC_OVERLAY_FILE: gd25wb256-ext-flash.overlay diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index e95d68b59d8e..511d55a538f4 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -68,3 +68,7 @@ add_subdirectory_ifdef(CONFIG_NRF_DM dm) add_subdirectory_ifdef(CONFIG_EMDS emds) add_subdirectory_ifdef(CONFIG_NET_CORE_MONITOR net_core_monitor) add_subdirectory_ifdef(CONFIG_AUDIO_MODULE audio_module) +add_subdirectory_ifdef(CONFIG_UART_ASYNC_ADAPTER uart_async_adapter) +add_subdirectory_ifdef(CONFIG_SDFW_SERVICES_ENABLED sdfw_services) +add_subdirectory(suit) +add_subdirectory_ifdef(CONFIG_MGMT_SUITFU mgmt/suitfu) diff --git a/subsys/Kconfig b/subsys/Kconfig index be9a2f89b1d6..3e4a8b35836d 100644 --- a/subsys/Kconfig +++ b/subsys/Kconfig @@ -27,11 +27,15 @@ rsource "partition_manager/Kconfig" rsource "nrf_rpc/Kconfig" rsource "zigbee/Kconfig" rsource "mgmt/fmfu/Kconfig" +rsource "mgmt/suitfu/Kconfig" rsource "caf/Kconfig" rsource "ieee802154/Kconfig" rsource "dm/Kconfig" rsource "nrf_security/Kconfig" rsource "net_core_monitor/Kconfig" rsource "audio_module/Kconfig" +rsource "uart_async_adapter/Kconfig" rsource "trusted_storage/Kconfig" +rsource "sdfw_services/Kconfig" +rsource "suit/Kconfig" endmenu diff --git a/subsys/app_event_manager/Kconfig b/subsys/app_event_manager/Kconfig index 76589647f600..0cf77e43cc8c 100644 --- a/subsys/app_event_manager/Kconfig +++ b/subsys/app_event_manager/Kconfig @@ -12,6 +12,16 @@ menuconfig APP_EVENT_MANAGER if APP_EVENT_MANAGER +config APP_EVENT_MANAGER_REBOOT_ON_EVENT_ALLOC_FAIL + bool "Reboot on event allocation failure" + depends on REBOOT + default y + help + The default event allocator triggers assertion failure on event + allocation failure. Then, depending on the value of this Kconfig + option, the default allocator either triggers a system reboot or + kernel panic. + config APP_EVENT_MANAGER_SHOW_EVENTS bool "Show events" depends on LOG diff --git a/subsys/app_event_manager/app_event_manager.c b/subsys/app_event_manager/app_event_manager.c index 2921f76efaab..b02dd7c7f93d 100644 --- a/subsys/app_event_manager/app_event_manager.c +++ b/subsys/app_event_manager/app_event_manager.c @@ -121,7 +121,7 @@ void * __weak app_event_manager_alloc(size_t size) if (unlikely(!event)) { LOG_ERR("Application Event Manager OOM error\n"); __ASSERT_NO_MSG(false); - if (IS_ENABLED(CONFIG_REBOOT)) { + if (IS_ENABLED(CONFIG_APP_EVENT_MANAGER_REBOOT_ON_EVENT_ALLOC_FAIL)) { sys_reboot(SYS_REBOOT_WARM); } else { k_panic(); diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 7deec4fcf012..e3426968d508 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -11,7 +11,7 @@ choice BT_LL_CHOICE config BT_LL_SOFTDEVICE bool "SoftDevice Link Layer" select MPSL - select ZERO_LATENCY_IRQS + select ZERO_LATENCY_IRQS if !SOC_SERIES_BSIM_NRFXX select BT_CTLR_LE_ENC_SUPPORT select BT_CTLR_ECDH_SUPPORT select BT_CTLR_EXT_REJ_IND_SUPPORT @@ -39,7 +39,7 @@ config BT_LL_SOFTDEVICE select BT_CTLR_DF_SUPPORT if HAS_HW_NRF_RADIO_DFE select BT_CTLR_LE_POWER_CONTROL_SUPPORT depends on (SOC_SERIES_BSIM_NRFXX || SOC_SERIES_NRF52X || SOC_COMPATIBLE_NRF5340_CPUNET ||\ - SOC_NRF54H20_ENGA_CPURAD || SOC_SERIES_NRF54LX) + SOC_NRF54H20_CPURAD || SOC_SERIES_NRF54LX) help Use SoftDevice Link Layer implementation. @@ -82,7 +82,7 @@ config BT_HCI_TX_STACK_SIZE config BT_RX_STACK_SIZE int - depends on BT_HCI_HOST || BT_RECV_BLOCKING + depends on BT_HCI_HOST default 512 if BT_HCI_RAW default 2600 if BT_MESH default 2200 if BT_SETTINGS @@ -120,6 +120,13 @@ config BT_CTLR_SDC_QOS_CHANNEL_SURVEY help Channel survey feature support +config BT_CTLR_SDC_ALLOW_PARALLEL_SCANNING_AND_INITIATING + bool "Allow scanning and initiating at the same time" + select EXPERIMENTAL + depends on BT_CENTRAL + help + Enables support for scanning and initiating at the same time + config BT_CTLR_SDC_PERIPHERAL_COUNT int "Number of concurrent peripheral roles" default BT_MAX_CONN if (BT_PERIPHERAL && !BT_CENTRAL) @@ -303,7 +310,7 @@ choice BT_LL_SOFTDEVICE_VARIANT BT_CTLR_SDC_PAWR_SYNC || \ BT_ISO || \ SOC_COMPATIBLE_NRF5340_CPUNET || \ - SOC_NRF54H20_ENGA_CPURAD || \ + SOC_NRF54H20_CPURAD || \ SOC_NRF54L15_ENGA_CPUAPP) default BT_LL_SOFTDEVICE_CENTRAL if BT_OBSERVER default BT_LL_SOFTDEVICE_PERIPHERAL if BT_BROADCASTER @@ -347,9 +354,6 @@ choice BT_CTLR_ECDH_LIB config BT_CTLR_ECDH_LIB_OBERON select NRF_OBERON - # TODO: Fix ocrypto header not available in these configurations - depends on !BUILD_WITH_TFM - depends on !OBERON_BACKEND depends on !SOC_SERIES_BSIM_NRFXX bool "nRF Oberon (SW)" @@ -370,6 +374,7 @@ config BT_CTLR_ECDH_STACK_SIZE config BT_CTLR_ECDH_IN_MPSL_WORK bool "ECDH processing in MPSL workqueue" depends on BT_CTLR_ECDH_LIB_OBERON + default y if !BT_SMP help Run the ECDH processing in the MPSL workqueue instead of in a dedicated pre-emptible thread. @@ -456,7 +461,7 @@ config BT_CTLR_SDC_PAWR_ADV_COUNT config BT_CTLR_SDC_PERIODIC_ADV_RSP_TX_BUFFER_COUNT int "Number of PAwR advertiser TX buffers" range 1 128 - default 1 + default 3 help Maximum number of subevent indications that can be buffered at a time. When using a larger value the controller will send data requests for more diff --git a/subsys/bluetooth/controller/crypto.c b/subsys/bluetooth/controller/crypto.c index 72eed9cbb4ba..46aa4f8016d3 100644 --- a/subsys/bluetooth/controller/crypto.c +++ b/subsys/bluetooth/controller/crypto.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "nrf_errno.h" @@ -36,30 +36,12 @@ int bt_encrypt_le(const uint8_t key[BT_ECB_BLOCK_SIZE], const uint8_t plaintext[BT_ECB_BLOCK_SIZE], uint8_t enc_data[BT_ECB_BLOCK_SIZE]) { - uint8_t key_le[BT_ECB_BLOCK_SIZE]; - uint8_t plaintext_le[BT_ECB_BLOCK_SIZE]; - uint8_t enc_data_le[BT_ECB_BLOCK_SIZE]; - LOG_HEXDUMP_DBG(key, BT_ECB_BLOCK_SIZE, "key"); LOG_HEXDUMP_DBG(plaintext, BT_ECB_BLOCK_SIZE, "plaintext"); - - sys_memcpy_swap(key_le, key, BT_ECB_BLOCK_SIZE); - sys_memcpy_swap(plaintext_le, plaintext, BT_ECB_BLOCK_SIZE); - - int errcode = MULTITHREADING_LOCK_ACQUIRE(); - - if (!errcode) { - errcode = sdc_soc_ecb_block_encrypt(key_le, plaintext_le, enc_data_le); - MULTITHREADING_LOCK_RELEASE(); - } - - if (!errcode) { - sys_memcpy_swap(enc_data, enc_data_le, BT_ECB_BLOCK_SIZE); - - LOG_HEXDUMP_DBG(enc_data, BT_ECB_BLOCK_SIZE, "enc_data"); - } - - return errcode; + mpsl_ecb_block_encrypt_extended(key, plaintext, enc_data, + MPSL_ECB_INPUT_LE | MPSL_ECB_OUTPUT_LE); + LOG_HEXDUMP_DBG(enc_data, BT_ECB_BLOCK_SIZE, "enc_data"); + return 0; } int bt_encrypt_be(const uint8_t key[BT_ECB_BLOCK_SIZE], @@ -68,17 +50,7 @@ int bt_encrypt_be(const uint8_t key[BT_ECB_BLOCK_SIZE], { LOG_HEXDUMP_DBG(key, BT_ECB_BLOCK_SIZE, "key"); LOG_HEXDUMP_DBG(plaintext, BT_ECB_BLOCK_SIZE, "plaintext"); - - int errcode = MULTITHREADING_LOCK_ACQUIRE(); - - if (!errcode) { - errcode = sdc_soc_ecb_block_encrypt(key, plaintext, enc_data); - MULTITHREADING_LOCK_RELEASE(); - } - - if (!errcode) { - LOG_HEXDUMP_DBG(enc_data, BT_ECB_BLOCK_SIZE, "enc_data"); - } - - return errcode; + mpsl_ecb_block_encrypt_extended(key, plaintext, enc_data, MPSL_ECB_NO_FLAGS); + LOG_HEXDUMP_DBG(enc_data, BT_ECB_BLOCK_SIZE, "enc_data"); + return 0; } diff --git a/subsys/bluetooth/controller/hci_driver.c b/subsys/bluetooth/controller/hci_driver.c index 65bdb2d3d852..22c9344c83a0 100644 --- a/subsys/bluetooth/controller/hci_driver.c +++ b/subsys/bluetooth/controller/hci_driver.c @@ -127,14 +127,20 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || #if defined(CONFIG_BT_OBSERVER) #if defined(CONFIG_BT_CTLR_ADV_EXT) - #define SDC_SCAN_BUF_SIZE \ - SDC_MEM_SCAN_BUFFER_EXT(CONFIG_BT_CTLR_SDC_SCAN_BUFFER_COUNT) + #define SDC_SCAN_SIZE \ + SDC_MEM_SCAN_EXT(CONFIG_BT_CTLR_SDC_SCAN_BUFFER_COUNT) #else - #define SDC_SCAN_BUF_SIZE \ - SDC_MEM_SCAN_BUFFER(CONFIG_BT_CTLR_SDC_SCAN_BUFFER_COUNT) + #define SDC_SCAN_SIZE \ + SDC_MEM_SCAN(CONFIG_BT_CTLR_SDC_SCAN_BUFFER_COUNT) #endif #else - #define SDC_SCAN_BUF_SIZE 0 + #define SDC_SCAN_SIZE 0 +#endif + +#if defined(CONFIG_BT_CTLR_SDC_ALLOW_PARALLEL_SCANNING_AND_INITIATING) + #define SDC_INITIATOR_SIZE SDC_MEM_INITIATOR +#else + #define SDC_INITIATOR_SIZE 0 #endif #ifdef CONFIG_BT_CTLR_DATA_LENGTH_MAX @@ -163,11 +169,18 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || #define SDC_FAL_MEM_SIZE SDC_MEM_FAL(CONFIG_BT_CTLR_FAL_SIZE) +#if defined(CONFIG_BT_CTLR_LE_POWER_CONTROL) +#define SDC_LE_POWER_CONTROL_MEM_SIZE SDC_MEM_LE_POWER_CONTROL(SDC_CENTRAL_COUNT + PERIPHERAL_COUNT) +#else +#define SDC_LE_POWER_CONTROL_MEM_SIZE 0 +#endif + #if defined(CONFIG_BT_CTLR_CONN_ISO) #define SDC_MEM_CIG SDC_MEM_PER_CIG(CONFIG_BT_CTLR_CONN_ISO_GROUPS) #define SDC_MEM_CIS \ SDC_MEM_PER_CIS(CONFIG_BT_CTLR_CONN_ISO_STREAMS) + \ - SDC_MEM_ISO_RX_SDU_POOL_SIZE(CONFIG_BT_CTLR_CONN_ISO_STREAMS) + SDC_MEM_ISO_RX_SDU_POOL_SIZE(CONFIG_BT_CTLR_CONN_ISO_STREAMS, \ + CONFIG_BT_ISO_RX_MTU) #define SDC_CIS_COUNT CONFIG_BT_CTLR_CONN_ISO_STREAMS #else #define SDC_MEM_CIG 0 @@ -179,7 +192,8 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || #define SDC_MEM_BIS_SINK \ SDC_MEM_PER_BIG(CONFIG_BT_CTLR_SCAN_SYNC_ISO_SET) + \ SDC_MEM_PER_BIS(CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT) + \ - SDC_MEM_ISO_RX_SDU_POOL_SIZE(CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT) + SDC_MEM_ISO_RX_SDU_POOL_SIZE(CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT, \ + CONFIG_BT_ISO_RX_MTU) #define SDC_BIS_SINK_COUNT CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT #else #define SDC_MEM_BIS_SINK 0 @@ -208,23 +222,34 @@ BUILD_ASSERT(!IS_ENABLED(CONFIG_BT_PERIPHERAL) || #if defined(CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT) && \ defined(CONFIG_BT_CTLR_SDC_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT) #define SDC_MEM_ISO_TX_POOL \ - SDC_MEM_ISO_TX_POOL_SIZE(CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT, \ + SDC_MEM_ISO_TX_PDU_POOL_SIZE( \ CONFIG_BT_CTLR_SDC_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT, \ SDC_CIS_COUNT, \ - SDC_BIS_SOURCE_COUNT) + SDC_BIS_SOURCE_COUNT) + \ + SDC_MEM_ISO_TX_SDU_POOL_SIZE(CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT, \ + CONFIG_BT_ISO_TX_MTU) #else #define SDC_MEM_ISO_TX_POOL 0 #endif +#if defined(CONFIG_BT_CTLR_SDC_QOS_CHANNEL_SURVEY) +#define SDC_MEM_CHAN_SURV SDC_MEM_QOS_CHANNEL_SURVEY +#else +#define SDC_MEM_CHAN_SURV 0 +#endif + #define MEMPOOL_SIZE ((PERIPHERAL_COUNT * PERIPHERAL_MEM_SIZE) + \ (SDC_CENTRAL_COUNT * CENTRAL_MEM_SIZE) + \ (SDC_ADV_SET_MEM_SIZE) + \ + (SDC_LE_POWER_CONTROL_MEM_SIZE) + \ (SDC_PERIODIC_ADV_MEM_SIZE) + \ (SDC_PERIODIC_ADV_RSP_MEM_SIZE) + \ (SDC_PERIODIC_SYNC_MEM_SIZE) + \ (SDC_PERIODIC_ADV_LIST_MEM_SIZE) + \ - (SDC_SCAN_BUF_SIZE) + \ + (SDC_SCAN_SIZE) + \ + (SDC_INITIATOR_SIZE) + \ (SDC_FAL_MEM_SIZE) + \ + (SDC_MEM_CHAN_SURV) + \ (SDC_MEM_CIG) + \ (SDC_MEM_CIS) + \ (SDC_MEM_BIS_SINK) + \ @@ -828,6 +853,13 @@ static int configure_supported_features(void) } } +#if defined(CONFIG_BT_CTLR_SDC_ALLOW_PARALLEL_SCANNING_AND_INITIATING) + err = sdc_support_parallel_scanning_and_initiating(); + if (err) { + return -ENOTSUP; + } +#endif + return 0; } @@ -1059,30 +1091,26 @@ static int configure_memory_usage(void) #endif /* CONFIG_BT_CTLR_SYNC_ISO */ #endif /* CONFIG_BT_CTLR_BROADCAST_ISO */ +#if defined(CONFIG_BT_CTLR_SDC_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT) || \ + (defined(CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT) && \ + defined(CONFIG_BT_CTLR_SDC_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT)) + memset(&cfg.iso_buffer_cfg, 0, sizeof(cfg.iso_buffer_cfg)); +#endif + #if defined(CONFIG_BT_CTLR_SDC_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT) cfg.iso_buffer_cfg.rx_pdu_buffer_per_stream_count = CONFIG_BT_CTLR_SDC_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT; cfg.iso_buffer_cfg.rx_sdu_buffer_count = iso_rx_paths; - cfg.iso_buffer_cfg.rx_sdu_buffer_size = SDC_DEFAULT_ISO_RX_SDU_BUFFER_SIZE; -#else - cfg.iso_buffer_cfg.rx_pdu_buffer_per_stream_count = - SDC_DEFAULT_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT; - cfg.iso_buffer_cfg.rx_sdu_buffer_count = SDC_DEFAULT_ISO_RX_SDU_BUFFER_COUNT; - cfg.iso_buffer_cfg.rx_sdu_buffer_size = SDC_DEFAULT_ISO_RX_SDU_BUFFER_SIZE; + cfg.iso_buffer_cfg.rx_sdu_buffer_size = CONFIG_BT_ISO_RX_MTU; #endif #if defined(CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT) && \ defined(CONFIG_BT_CTLR_SDC_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT) - cfg.iso_buffer_cfg.tx_hci_buffer_count = CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT; - cfg.iso_buffer_cfg.tx_hci_buffer_size = SDC_DEFAULT_ISO_TX_HCI_BUFFER_SIZE; + cfg.iso_buffer_cfg.tx_sdu_buffer_count = CONFIG_BT_CTLR_SDC_ISO_TX_HCI_BUFFER_COUNT; + cfg.iso_buffer_cfg.tx_sdu_buffer_size = CONFIG_BT_ISO_TX_MTU; cfg.iso_buffer_cfg.tx_pdu_buffer_per_stream_count = CONFIG_BT_CTLR_SDC_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT; -#else - cfg.iso_buffer_cfg.tx_hci_buffer_count = SDC_DEFAULT_ISO_TX_HCI_BUFFER_COUNT; - cfg.iso_buffer_cfg.tx_hci_buffer_size = SDC_DEFAULT_ISO_TX_HCI_BUFFER_SIZE; - cfg.iso_buffer_cfg.tx_pdu_buffer_per_stream_count - = SDC_DEFAULT_ISO_TX_PDU_BUFFER_PER_STREAM_COUNT; #endif #if defined(CONFIG_BT_CTLR_SDC_ISO_RX_PDU_BUFFER_PER_STREAM_COUNT) || \ @@ -1309,42 +1337,25 @@ static const struct bt_hci_driver drv = { #if !defined(CONFIG_BT_HCI_VS_EXT) uint8_t bt_read_static_addr(struct bt_hci_vs_static_addr addrs[], uint8_t size) { - /* only one supported */ - ARG_UNUSED(size); - - if (((NRF_FICR->DEVICEADDR[0] != UINT32_MAX) || - ((NRF_FICR->DEVICEADDR[1] & UINT16_MAX) != UINT16_MAX)) && - (NRF_FICR->DEVICEADDRTYPE & 0x01)) { - sys_put_le32(NRF_FICR->DEVICEADDR[0], &addrs[0].bdaddr.val[0]); - sys_put_le16(NRF_FICR->DEVICEADDR[1], &addrs[0].bdaddr.val[4]); - - /* The FICR value is a just a random number, with no knowledge - * of the Bluetooth Specification requirements for random - * static addresses. - */ - BT_ADDR_SET_STATIC(&addrs[0].bdaddr); - - /* If no public address is provided and a static address is - * available, then it is recommended to return an identity root - * key (if available) from this command. - */ - if ((NRF_FICR->IR[0] != UINT32_MAX) && - (NRF_FICR->IR[1] != UINT32_MAX) && - (NRF_FICR->IR[2] != UINT32_MAX) && - (NRF_FICR->IR[3] != UINT32_MAX)) { - sys_put_le32(NRF_FICR->IR[0], &addrs[0].ir[0]); - sys_put_le32(NRF_FICR->IR[1], &addrs[0].ir[4]); - sys_put_le32(NRF_FICR->IR[2], &addrs[0].ir[8]); - sys_put_le32(NRF_FICR->IR[3], &addrs[0].ir[12]); - } else { - /* Mark IR as invalid */ - (void)memset(addrs[0].ir, 0x00, sizeof(addrs[0].ir)); - } + uint8_t retval; + uint8_t return_buffer[sizeof(sdc_hci_cmd_vs_zephyr_read_static_addresses_return_t) + + sizeof(sdc_hci_vs_zephyr_static_address_t)]; - return 1; + sdc_hci_cmd_vs_zephyr_read_static_addresses_return_t *return_params = + (sdc_hci_cmd_vs_zephyr_read_static_addresses_return_t *)return_buffer; + + retval = sdc_hci_cmd_vs_zephyr_read_static_addresses( + (sdc_hci_cmd_vs_zephyr_read_static_addresses_return_t *)return_buffer); + __ASSERT(retval == 0, "Expect command to succeed"); + __ASSERT(return_params->num_addresses <= 1, "Avoid buffer overflow"); + + if (return_params->num_addresses == 1 && size >= 1) { + BUILD_ASSERT(sizeof(sdc_hci_vs_zephyr_static_address_t) == + sizeof(struct bt_hci_vs_static_addr)); + memcpy(&addrs[0], return_params->addresses, sizeof(struct bt_hci_vs_static_addr)); } - return 0; + return return_params->num_addresses; } #endif /* !defined(CONFIG_BT_HCI_VS_EXT) */ diff --git a/subsys/bluetooth/controller/hci_internal.c b/subsys/bluetooth/controller/hci_internal.c index cda77e81a7fd..592ca8108b3c 100644 --- a/subsys/bluetooth/controller/hci_internal.c +++ b/subsys/bluetooth/controller/hci_internal.c @@ -539,6 +539,8 @@ void hci_internal_supported_commands(sdc_hci_ip_supported_commands_t *cmds) cmds->hci_le_enhanced_read_transmit_power_level = 1; cmds->hci_le_read_remote_transmit_power_level = 1; cmds->hci_le_set_transmit_power_reporting_enable = 1; + cmds->hci_le_set_path_loss_reporting_parameters = 1; + cmds->hci_le_set_path_loss_reporting_enable = 1; /* NOTE: The DTM commands are *not* supported by the SoftDevice * controller. See doc/nrf/known_issues.rst. */ @@ -675,6 +677,11 @@ static void vs_supported_commands(sdc_hci_vs_supported_vs_commands_t *cmds) cmds->cig_reserved_time_set = 1; cmds->cis_subevent_length_set = 1; #endif + +#if defined(CONFIG_BT_OBSERVER) + cmds->scan_channel_map_set = 1; + cmds->scan_accept_ext_adv_packets_set = 1; +#endif } #endif /* CONFIG_BT_HCI_VS */ @@ -739,6 +746,7 @@ void hci_internal_le_supported_features( #if defined(CONFIG_BT_CTLR_LE_POWER_CONTROL) features->params.le_power_control_request = 1; features->params.le_power_change_indication = 1; + features->params.le_path_loss_monitoring = 1; #endif #if defined(CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT) @@ -787,9 +795,11 @@ static void le_read_supported_states(uint8_t *buf) #define ST_SCA (BIT(4) | BIT(5) | BIT(8) | BIT(9) | BIT(10) | \ BIT(11) | BIT(12) | BIT(13) | BIT(14) | BIT(15) | \ - BIT(22) | BIT(23) | BIT(24) | BIT(25) | BIT(26) | \ + BIT(24) | BIT(25) | BIT(26) | \ BIT(27) | BIT(30) | BIT(31)) +#define ST_SCA_INI (BIT(22) | BIT(23)) + #define ST_SLA (BIT(2) | BIT(3) | BIT(7) | BIT(10) | BIT(11) | \ BIT(14) | BIT(15) | BIT(20) | BIT(21) | BIT(26) | \ BIT(27) | BIT(29) | BIT(30) | BIT(31)) @@ -829,11 +839,13 @@ static void le_read_supported_states(uint8_t *buf) states1 &= ~ST_MAS; states2 &= ~ST_MAS2; #endif - /* All states and combinations supported except: - * Initiating State + Passive Scanning - * Initiating State + Active Scanning - */ - states1 &= ~(BIT(22) | BIT(23)); + +#if defined(CONFIG_BT_CTLR_SDC_ALLOW_PARALLEL_SCANNING_AND_INITIATING) + states1 |= ST_SCA_INI; +#else + states1 &= ~ST_SCA_INI; +#endif + *buf = states1; *(buf + 4) = states2; } @@ -1294,6 +1306,16 @@ static uint8_t le_controller_cmd_put(uint8_t const * const cmd, sizeof(sdc_hci_cmd_le_set_transmit_power_reporting_enable_return_t); return sdc_hci_cmd_le_set_transmit_power_reporting_enable((void *)cmd_params, (void *)event_out_params); + + case SDC_HCI_OPCODE_CMD_LE_SET_PATH_LOSS_REPORTING_PARAMS: + *param_length_out += sizeof(sdc_hci_cmd_le_set_path_loss_reporting_params_return_t); + return sdc_hci_cmd_le_set_path_loss_reporting_params((void *)cmd_params, + (void *)event_out_params); + + case SDC_HCI_OPCODE_CMD_LE_SET_PATH_LOSS_REPORTING_ENABLE: + *param_length_out += sizeof(sdc_hci_cmd_le_set_path_loss_reporting_enable_return_t); + return sdc_hci_cmd_le_set_path_loss_reporting_enable((void *)cmd_params, + (void *)event_out_params); #endif #if defined(CONFIG_BT_CTLR_LE_POWER_CONTROL) || defined(CONFIG_BT_CTLR_ADV_EXT) @@ -1636,6 +1658,18 @@ static uint8_t vs_cmd_put(uint8_t const *const cmd, uint8_t *const raw_event_out return sdc_hci_cmd_vs_cis_subevent_length_set( (sdc_hci_cmd_vs_cis_subevent_length_set_t const *)cmd_params); #endif + +#if defined(CONFIG_BT_OBSERVER) + case SDC_HCI_OPCODE_CMD_VS_SCAN_CHANNEL_MAP_SET: + return sdc_hci_cmd_vs_scan_channel_map_set( + (sdc_hci_cmd_vs_scan_channel_map_set_t const *)cmd_params); + case SDC_HCI_OPCODE_CMD_VS_SCAN_ACCEPT_EXT_ADV_PACKETS_SET: + return sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set( + (sdc_hci_cmd_vs_scan_accept_ext_adv_packets_set_t const *)cmd_params); +#endif + case SDC_HCI_OPCODE_CMD_VS_SET_ROLE_PRIORITY: + return sdc_hci_cmd_vs_set_role_priority( + (sdc_hci_cmd_vs_set_role_priority_t const *) cmd_params); default: return BT_HCI_ERR_UNKNOWN_CMD; } diff --git a/subsys/bluetooth/enocean.c b/subsys/bluetooth/enocean.c index d9d2e75f4ec2..9ca1805167ff 100644 --- a/subsys/bluetooth/enocean.c +++ b/subsys/bluetooth/enocean.c @@ -28,6 +28,9 @@ LOG_MODULE_REGISTER(bt_enocean); #define DATA_TYPE_LIGHT_LEVEL_SOLAR_CELL 0x04 #define DATA_TYPE_OPTIONAL_DATA 0x3c +#define DEVICE_TYPE_SWITCH 0xe215 +#define DEVICE_TYPE_SENSOR 0xe500 + #define FLAG_ACTIVE BIT(0) #define FLAG_DIRTY BIT(1) @@ -142,18 +145,22 @@ static int auth(const struct bt_enocean_device *dev, uint32_t seq, return 0; } -static int handle_switch_commissioning(const struct bt_le_scan_recv_info *info, - struct net_buf_simple *buf, - bool has_short_name) +static void handle_switch_commissioning(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf, + bool has_short_name) { + if (!commissioning) { + return; + } + uint32_t seq = net_buf_simple_pull_le32(buf); const uint8_t *key = net_buf_simple_pull_mem(buf, 16); if (!has_short_name && buf->len != 6) { - return -EINVAL; + return; } - return bt_enocean_commission(info->addr, key, seq); + (void)bt_enocean_commission(info->addr, key, seq); } static void handle_switch_data(const struct bt_le_scan_recv_info *info, @@ -217,6 +224,24 @@ static void handle_switch_data(const struct bt_le_scan_recv_info *info, cb->button(dev, action, status >> 1, opt_data, opt_data_len); } +static void handle_switch_payload(const struct bt_le_scan_recv_info *info, + struct net_buf_simple *buf, const uint8_t *payload, uint8_t len, + bool has_shortened_name) +{ + /* The data format is decided by a mix of lengths and bitfields */ + if (len == 29 || (has_shortened_name && len == 23)) { + handle_switch_commissioning(info, buf, has_shortened_name); + return; + } + + if (!has_shortened_name && !(payload[8] & (BIT_MASK(3) << 5)) && len >= 12 && len <= 16) { + handle_switch_data(info, buf, payload); + return; + } + + LOG_DBG("Unknown switch payload"); +} + struct data_entry { uint8_t type; uint8_t len; @@ -378,13 +403,15 @@ static void adv_recv(const struct bt_le_scan_recv_info *info, uint8_t len = net_buf_simple_pull_u8(buf); uint8_t type = net_buf_simple_pull_u8(buf); bool has_shortened_name = (type == BT_DATA_NAME_SHORTENED); + /* Upper two bytes of address indicate device type */ + uint16_t device_type = sys_get_le16(&info->addr->a.val[4]); /* An old version of EnOcean firmware would include the shortened name * AD type, skip this. */ if (has_shortened_name) { - if (buf->len < ((len - 1) + 2)) { + if (buf->len < ((len - 1) + 2) || device_type != DEVICE_TYPE_SWITCH) { return; } @@ -404,41 +431,16 @@ static void adv_recv(const struct bt_le_scan_recv_info *info, return; } - /* The data format is decided by a mix of lengths and bitfields */ - - if (has_shortened_name) { - if (len == 23 && commissioning) { - handle_switch_commissioning(info, buf, true); - } - - return; - } - - if (!(payload[8] & (BIT_MASK(3) << 5)) && len >= 12 && len <= 16) { - handle_switch_data(info, buf, payload); - return; - } - - /* Format is ambiguous, have to rely on trial and error: */ - struct net_buf_simple_state state; - int err; - - if (len == 29 && commissioning) { - net_buf_simple_save(buf, &state); - err = handle_switch_commissioning(info, buf, false); - if (!err) { - /* Doing the opposite of the normal error checking - * pattern on purpose here: If the message *wasn't* - * switch commissioning, it could be sensor data, so we - * should keep parsing. - */ - return; - } - - net_buf_simple_restore(buf, &state); + switch (device_type) { + case DEVICE_TYPE_SENSOR: + handle_sensor_data(info, buf, payload, len + 1 - SIGNATURE_LEN); + break; + case DEVICE_TYPE_SWITCH: + handle_switch_payload(info, buf, payload, len, has_shortened_name); + break; + default: + break; } - - handle_sensor_data(info, buf, payload, len + 1 - SIGNATURE_LEN); } static void store_dirty(struct k_work *work) diff --git a/subsys/bluetooth/host_extensions/CMakeLists.txt b/subsys/bluetooth/host_extensions/CMakeLists.txt index 770fb3d7b05c..c459dc1846cd 100644 --- a/subsys/bluetooth/host_extensions/CMakeLists.txt +++ b/subsys/bluetooth/host_extensions/CMakeLists.txt @@ -4,4 +4,4 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -zephyr_sources_ifdef(CONFIG_BT_TRANSMIT_POWER_CONTROL host_extensions.c) +zephyr_sources(host_extensions.c) diff --git a/subsys/bluetooth/host_extensions/host_extensions.c b/subsys/bluetooth/host_extensions/host_extensions.c index dcb2ac4b0472..fa39812d6330 100644 --- a/subsys/bluetooth/host_extensions/host_extensions.c +++ b/subsys/bluetooth/host_extensions/host_extensions.c @@ -9,16 +9,22 @@ * Adding them in nrf is better maintainable. */ -#if defined(CONFIG_BT_TRANSMIT_POWER_CONTROL) +#include #include #include #include #include <../subsys/bluetooth/host/conn_internal.h> +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#endif /* CONFIG_BT_LL_SOFTDEVICE */ + #include "hci_types_host_extensions.h" #include +#if defined(CONFIG_BT_TRANSMIT_POWER_CONTROL) + /* Write Remote Transmit Power Level HCI command */ int bt_conn_set_remote_tx_power_level(struct bt_conn *conn, enum bt_conn_le_tx_power_phy phy, int8_t delta) @@ -72,3 +78,27 @@ int bt_conn_set_power_control_request_params(struct bt_conn_set_pcr_params *para return bt_hci_cmd_send_sync(BT_HCI_OP_SET_POWER_CONTROL_REQUEST_PARAMS, buf, NULL); } #endif /* CONFIG_BT_TRANSMIT_POWER_CONTROL */ + +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#if defined(CONFIG_BT_CTLR_ADV_EXT) +int bt_nrf_host_extension_reduce_initator_aux_channel_priority(bool reduce) +{ + sdc_hci_cmd_vs_set_role_priority_t *cmd; + struct net_buf *buf; + + buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_SET_ROLE_PRIORITY, sizeof(*cmd)); + if (!buf) { + return -ENOBUFS; + } + + cmd = net_buf_add(buf, sizeof(*cmd)); + *cmd = (sdc_hci_cmd_vs_set_role_priority_t) { + .handle_type = SDC_HCI_VS_SET_ROLE_PRIORITY_HANDLE_TYPE_INITIATOR_SECONDARY_CHANNEL, + .handle = 0x0, + .priority = reduce ? 5 : 0xff + }; + + return bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_SET_ROLE_PRIORITY, buf, NULL); +} +#endif /* CONFIG_BT_CTLR_ADV_EXT */ +#endif /* CONFIG_BT_LL_SOFTDEVICE */ diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index bcce38854cc9..41071f4e1be4 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -120,7 +120,9 @@ config BT_MESH_USES_TFM_PSA select PSA_WANT_ALG_HMAC select PSA_WANT_ALG_ECDH select PSA_WANT_ECC_SECP_R1_256 - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT choice TFM_PROFILE_TYPE depends on BT_MESH_USES_TFM_PSA @@ -129,9 +131,8 @@ endchoice config BT_MESH_DFU_METADATA_ON_BUILD bool "Generate DFU metadata on build" - default y if BT_MESH_DFU_SRV || BT_MESH_DFU_CLI + default y if BT_MESH_DFU_SRV depends on SIGN_IMAGES - depends on BT_MESH_DFU_METADATA help Generate a JSON file containing all DFU related metadata upon application build. The JSON will be added to dfu application zip diff --git a/subsys/bluetooth/mesh/light_temp_srv.c b/subsys/bluetooth/mesh/light_temp_srv.c index 415b4687d017..5fbe1ca71009 100644 --- a/subsys/bluetooth/mesh/light_temp_srv.c +++ b/subsys/bluetooth/mesh/light_temp_srv.c @@ -179,9 +179,10 @@ static void lvl_set(struct bt_mesh_lvl_srv *lvl_srv, struct bt_mesh_light_temp_srv *srv = CONTAINER_OF(lvl_srv, struct bt_mesh_light_temp_srv, lvl); struct bt_mesh_light_temp_status status = { 0 }; + uint16_t temp = lvl_to_temp(srv, lvl_set->lvl); struct bt_mesh_light_temp_set set = { .params = { - .temp = lvl_to_temp(srv, lvl_set->lvl), + .temp = temp, .delta_uv = srv->transient.last.delta_uv, }, .transition = lvl_set->transition, @@ -194,8 +195,15 @@ static void lvl_set(struct bt_mesh_lvl_srv *lvl_srv, } if (rsp) { - rsp->current = temp_to_lvl(srv, status.current.temp); - rsp->target = temp_to_lvl(srv, status.target.temp); + /* This helps to avoid weird situation when client sets exact level value + * but after conversion to temperature and back from temperature to level, + * the level value is changed in Status. + * It happens due to the division results rounding in both conversions. + */ + rsp->current = temp == status.current.temp ? lvl_set->lvl + : temp_to_lvl(srv, status.current.temp); + rsp->target = temp == status.target.temp ? lvl_set->lvl + : temp_to_lvl(srv, status.target.temp); rsp->remaining_time = status.remaining_time; } } diff --git a/subsys/bluetooth/mesh/sensor.c b/subsys/bluetooth/mesh/sensor.c index c92f48b5654e..4ea8870e4b94 100644 --- a/subsys/bluetooth/mesh/sensor.c +++ b/subsys/bluetooth/mesh/sensor.c @@ -127,6 +127,10 @@ bool bt_mesh_sensor_delta_threshold(const struct bt_mesh_sensor *sensor, bool bt_mesh_sensor_delta_threshold(const struct bt_mesh_sensor *sensor, const struct bt_mesh_sensor_value *curr) { + if (!sensor->state.prev.format) { + /* prev is uninitialized, return true as this is the first pub. */ + return true; + } return curr->format->cb->delta_check(curr, &sensor->state.prev, &sensor->state.threshold.deltas); } @@ -785,6 +789,11 @@ bool bt_mesh_sensor_value_in_column(const struct bt_mesh_sensor_value *value, void sensor_cadence_update(struct bt_mesh_sensor *sensor, const sensor_value_type *value) { + if (!sensor->state.configured) { + /* Ignore any update before cadence is configured. */ + return; + } + enum bt_mesh_sensor_cadence new; new = sensor_cadence(&sensor->state.threshold, value); @@ -836,11 +845,11 @@ int bt_mesh_sensor_ch_to_str(const struct bt_mesh_sensor_value *ch, char *str, switch (status) { case BT_MESH_SENSOR_VALUE_NUMBER: - return snprintk(str, len, "%g", float_val); + return snprintk(str, len, "%g", (double)float_val); case BT_MESH_SENSOR_VALUE_MAX_OR_GREATER: - return snprintk(str, len, ">=%g", float_val); + return snprintk(str, len, ">=%g", (double)float_val); case BT_MESH_SENSOR_VALUE_MIN_OR_LESS: - return snprintk(str, len, "<=%g", float_val); + return snprintk(str, len, "<=%g", (double)float_val); case BT_MESH_SENSOR_VALUE_UNKNOWN: return snprintk(str, len, "%s", ""); case BT_MESH_SENSOR_VALUE_INVALID: @@ -985,7 +994,7 @@ int bt_mesh_sensor_value_from_sensor_value( enum bt_mesh_sensor_value_status bt_mesh_sensor_value_get_status(const struct bt_mesh_sensor_value *sensor_val) { - return sensor_val->format->cb->to_float(sensor_val, NULL); + return bt_mesh_sensor_value_to_float(sensor_val, NULL); } int bt_mesh_sensor_value_from_special_status( diff --git a/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c b/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c index b53d3e959531..2c528cc303b3 100644 --- a/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c +++ b/subsys/bluetooth/mesh/shell/shell_ctrl_cli.c @@ -284,7 +284,7 @@ static int cmd_prop_set_unack(const struct shell *shell, size_t argc, char *argv static void coeff_print(const struct shell *shell, int err, float rsp) { if (!err) { - shell_print(shell, "Regulator Coefficient: %f", rsp); + shell_print(shell, "Regulator Coefficient: %f", (double)rsp); } } diff --git a/subsys/bluetooth/rpc/CMakeLists.txt b/subsys/bluetooth/rpc/CMakeLists.txt index 2a46b6ac88ff..aee92ed15045 100644 --- a/subsys/bluetooth/rpc/CMakeLists.txt +++ b/subsys/bluetooth/rpc/CMakeLists.txt @@ -8,8 +8,6 @@ zephyr_interface_library_named(subsys_bluetooth_rpc) target_include_directories(subsys_bluetooth_rpc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common) -zephyr_include_directories(include) - add_subdirectory(common) add_subdirectory_ifdef(CONFIG_BT_RPC_CLIENT client) add_subdirectory_ifdef(CONFIG_BT_RPC_HOST host) diff --git a/subsys/bluetooth/rpc/Kconfig b/subsys/bluetooth/rpc/Kconfig index 55ac182f17f5..b9e31efc1408 100644 --- a/subsys/bluetooth/rpc/Kconfig +++ b/subsys/bluetooth/rpc/Kconfig @@ -20,7 +20,7 @@ config BT_RPC depends on !BT_OTS depends on !NET_L2_BT depends on !NET_L2_BT_SHELL - depends on !BT_BREDR + depends on !BT_CLASSIC help Enables Bluetooth serialization over RPC diff --git a/subsys/bluetooth/rpc/include/bt_rpc.h b/subsys/bluetooth/rpc/include/bt_rpc.h deleted file mode 100644 index fa4cd782bf7b..000000000000 --- a/subsys/bluetooth/rpc/include/bt_rpc.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef BT_RPC_H_ -#define BT_RPC_H_ - -#include - -/** - * @file - * @defgroup bt_rpc RPC bluetooth API additions - * @{ - * @brief API additions for the bluetooth over RPC. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Set flag in the @a flags field of the @ref bt_gatt_subscribe_params structure. - * - * This function must be used instead of @ref atomic_set_bit() if you are using - * BLE API over RPC. - * - * @param params Subscribe parameters. - * @param flags_bit Index of bit to set. - * - * @return Previos flag value (retrived non-atomically) in case of success or negative value - * in case of error. - */ -int bt_rpc_gatt_subscribe_flag_set(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); - -/** @brief Clear flag in the @a flags field of the @ref bt_gatt_subscribe_params structure. - * - * This function must be used instead of @ref atomic_clear_bit() if you are using - * BLE API over RPC. - * - * @param params Subscribe parameters. - * @param flags_bit Index of bit to clear. - * - * @return Previos flag value (retrived non-atomically) in case of success or negative value - * in case of error. - */ -int bt_rpc_gatt_subscribe_flag_clear(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); - -/** @brief Get flag value from the @a flags field of the @ref bt_gatt_subscribe_params structure. - * - * This function must be used instead of @ref atomic_test_bit() if you are using - * BLE API over RPC. - * - * @param params Subscribe parameters. - * @param flags_bit Index of bit to test. - * - * @return Flag value in case of success or negative value in case of error. - */ -int bt_rpc_gatt_subscribe_flag_get(struct bt_gatt_subscribe_params *params, uint32_t flags_bit); - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#endif /* BT_RPC_H_ */ diff --git a/subsys/bluetooth/services/fast_pair/fp_crypto/CMakeLists.txt b/subsys/bluetooth/services/fast_pair/fp_crypto/CMakeLists.txt index 3a0d3017c375..67b67c766899 100644 --- a/subsys/bluetooth/services/fast_pair/fp_crypto/CMakeLists.txt +++ b/subsys/bluetooth/services/fast_pair/fp_crypto/CMakeLists.txt @@ -19,6 +19,9 @@ endif() if(CONFIG_BT_FAST_PAIR_CRYPTO_TINYCRYPT) target_sources(fp_crypto PRIVATE fp_crypto_tinycrypt.c) endif() +if(CONFIG_BT_FAST_PAIR_CRYPTO_PSA) + target_sources(fp_crypto PRIVATE fp_crypto_psa.c) +endif() target_include_directories(fp_crypto PUBLIC include) target_include_directories(fp_crypto PUBLIC ../include/common) diff --git a/subsys/bluetooth/services/fast_pair/fp_crypto/Kconfig.fp_crypto b/subsys/bluetooth/services/fast_pair/fp_crypto/Kconfig.fp_crypto index 48bb7efea274..6facdb4578f3 100644 --- a/subsys/bluetooth/services/fast_pair/fp_crypto/Kconfig.fp_crypto +++ b/subsys/bluetooth/services/fast_pair/fp_crypto/Kconfig.fp_crypto @@ -33,6 +33,8 @@ config BT_FAST_PAIR_CRYPTO_MBEDTLS select NORDIC_SECURITY_BACKEND select MBEDTLS_ENABLE_HEAP select ENTROPY_GENERATOR + depends on !SOC_SERIES_NRF54LX && !SOC_SERIES_NRF54HX + depends on !TRUSTED_EXECUTION_NONSECURE help Select MbedTLS cryptographic backend for Fast Pair. @@ -42,6 +44,24 @@ config BT_FAST_PAIR_CRYPTO_OBERON help Select Oberon cryptographic backend for Fast Pair. +config BT_FAST_PAIR_CRYPTO_PSA + bool "Fast Pair with PSA cryptographic backend [EXPERIMENTAL]" + select EXPERIMENTAL + select NRF_SECURITY + select MBEDTLS_PSA_CRYPTO_C + select MBEDTLS_ENABLE_HEAP + select PSA_WANT_ALG_SHA_256 + select PSA_WANT_ALG_HMAC + select PSA_WANT_ALG_ECDH + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_ECC_SECP_R1_256 + select PSA_WANT_KEY_TYPE_AES + select PSA_WANT_ALG_ECB_NO_PADDING + depends on !TFM_PROFILE_TYPE_MINIMAL + help + Select PSA cryptographic backend for Fast Pair. The backend relies on + PSA crypto APIs for cryptographical operations. + endchoice module = FP_CRYPTO diff --git a/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_psa.c b/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_psa.c new file mode 100644 index 000000000000..09cf07f2f798 --- /dev/null +++ b/subsys/bluetooth/services/fast_pair/fp_crypto/fp_crypto_psa.c @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +LOG_MODULE_DECLARE(fp_crypto, CONFIG_FP_CRYPTO_LOG_LEVEL); + +#include "fp_crypto.h" + +int fp_crypto_sha256(uint8_t *out, const uint8_t *in, size_t data_len) +{ + size_t hash_len = 0; + psa_status_t status = psa_hash_compute(PSA_ALG_SHA_256, in, data_len, + out, FP_CRYPTO_SHA256_HASH_LEN, &hash_len); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_hash_compute failed (err: %d)", status); + return -EIO; + } + + if (hash_len != FP_CRYPTO_SHA256_HASH_LEN) { + LOG_ERR("Invalid psa_hash_compute output len: %zu", hash_len); + return -EIO; + } + + return 0; +} + +static psa_key_id_t import_hmac_sha256_key(const uint8_t *data, size_t len) +{ + psa_status_t status; + psa_key_id_t key_id = PSA_KEY_ID_NULL; + psa_key_attributes_t key_attr = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_usage_flags(&key_attr, PSA_KEY_USAGE_SIGN_HASH); + psa_set_key_lifetime(&key_attr, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attr, PSA_ALG_HMAC(PSA_ALG_SHA_256)); + psa_set_key_type(&key_attr, PSA_KEY_TYPE_HMAC); + psa_set_key_bits(&key_attr, len * CHAR_BIT); + + status = psa_import_key(&key_attr, data, len, &key_id); + psa_reset_key_attributes(&key_attr); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_import_key failed (err: %d)", status); + key_id = PSA_KEY_ID_NULL; + } + + return key_id; +} + +static int fp_crypto_psa_hmac_sha256(uint8_t *out, const uint8_t *in, size_t data_len, + psa_key_id_t key_id) +{ + size_t olen = 0; + psa_status_t status = psa_mac_compute(key_id, PSA_ALG_HMAC(PSA_ALG_SHA_256), in, data_len, + out, FP_CRYPTO_SHA256_HASH_LEN, &olen); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_mac_compute failed (err: %d)", status); + return -EIO; + } + + if (olen != FP_CRYPTO_SHA256_HASH_LEN) { + LOG_ERR("Invalid psa_mac_compute output length: %zu", olen); + return -EIO; + } + + return 0; +} + +int fp_crypto_hmac_sha256(uint8_t *out, const uint8_t *in, size_t data_len, const uint8_t *hmac_key, + size_t hmac_key_len) +{ + int err = 0; + psa_key_id_t hmac_key_id; + psa_status_t status; + + hmac_key_id = import_hmac_sha256_key(hmac_key, hmac_key_len); + if (hmac_key_id == PSA_KEY_ID_NULL) { + LOG_ERR("import_hmac_sha256_key failed"); + return -EIO; + } + + err = fp_crypto_psa_hmac_sha256(out, in, data_len, hmac_key_id); + + status = psa_destroy_key(hmac_key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_destroy_key failed (err: %d)", status); + /* Overwrite error code to forward information about psa_destroy_key failure. */ + err = -ECANCELED; + } + + return err; +} + +static psa_key_id_t import_aes128_key(const uint8_t *data) +{ + static const size_t len = FP_CRYPTO_AES128_KEY_LEN; + + psa_status_t status; + psa_key_id_t key_id = PSA_KEY_ID_NULL; + psa_key_attributes_t key_attr = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_usage_flags(&key_attr, PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT); + psa_set_key_lifetime(&key_attr, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attr, PSA_ALG_ECB_NO_PADDING); + psa_set_key_type(&key_attr, PSA_KEY_TYPE_AES); + psa_set_key_bits(&key_attr, len * CHAR_BIT); + + status = psa_import_key(&key_attr, data, len, &key_id); + psa_reset_key_attributes(&key_attr); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_import_key failed (err: %d)", status); + key_id = PSA_KEY_ID_NULL; + } + + return key_id; +} + +static int fp_crypto_psa_aes128_ecb_crypt(uint8_t *out, const uint8_t *in, psa_key_id_t key_id, + bool encrypt) +{ + size_t olen = 0; + psa_status_t status; + + if (encrypt) { + status = psa_cipher_encrypt(key_id, PSA_ALG_ECB_NO_PADDING, + in, FP_CRYPTO_AES128_BLOCK_LEN, + out, FP_CRYPTO_AES128_BLOCK_LEN, &olen); + } else { + status = psa_cipher_decrypt(key_id, PSA_ALG_ECB_NO_PADDING, + in, FP_CRYPTO_AES128_BLOCK_LEN, + out, FP_CRYPTO_AES128_BLOCK_LEN, &olen); + } + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_cipher_%scrypt failed (err: %d)", encrypt ? "en" : "de", status); + return -EIO; + } + + if (olen != FP_CRYPTO_AES128_BLOCK_LEN) { + LOG_ERR("Invalid psa_cipher_%scrypt output length: %zu", + encrypt ? "en" : "de", olen); + return -EIO; + } + + return 0; +} + +static int fp_crypto_aes128_ecb_crypt(uint8_t *out, const uint8_t *in, const uint8_t *k, + bool encrypt) +{ + int err = 0; + psa_key_id_t key_id; + psa_status_t status; + + key_id = import_aes128_key(k); + if (key_id == PSA_KEY_ID_NULL) { + LOG_ERR("import_aes128_key failed"); + return -EIO; + } + + err = fp_crypto_psa_aes128_ecb_crypt(out, in, key_id, encrypt); + + status = psa_destroy_key(key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_destroy_key failed (err: %d)", status); + /* Overwrite error code to forward information about psa_destroy_key failure. */ + err = -ECANCELED; + } + + return err; +} + +int fp_crypto_aes128_ecb_encrypt(uint8_t *out, const uint8_t *in, const uint8_t *k) +{ + return fp_crypto_aes128_ecb_crypt(out, in, k, true); +} + +int fp_crypto_aes128_ecb_decrypt(uint8_t *out, const uint8_t *in, const uint8_t *k) +{ + return fp_crypto_aes128_ecb_crypt(out, in, k, false); +} + +static psa_key_id_t import_ecdh_priv_key(const uint8_t *data) +{ + static const size_t len = 32; + + psa_status_t status; + psa_key_id_t key_id = PSA_KEY_ID_NULL; + psa_key_attributes_t key_attr = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_usage_flags(&key_attr, PSA_KEY_USAGE_DERIVE); + psa_set_key_lifetime(&key_attr, PSA_KEY_LIFETIME_VOLATILE); + psa_set_key_algorithm(&key_attr, PSA_ALG_ECDH); + psa_set_key_type(&key_attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); + psa_set_key_bits(&key_attr, len * CHAR_BIT); + + status = psa_import_key(&key_attr, data, len, &key_id); + psa_reset_key_attributes(&key_attr); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_import_key failed (err: %d)", status); + key_id = PSA_KEY_ID_NULL; + } + + return key_id; +} + +int fp_crypto_psa_ecdh_shared_secret(uint8_t *secret_key, const uint8_t *public_key, + psa_key_handle_t priv_key_id) +{ + /* Marker of the uncompressed binary format for a point on an elliptic curve. */ + static const uint8_t uncompressed_format_marker = 0x04; + + uint8_t public_key_uncompressed[sizeof(uncompressed_format_marker) + + FP_CRYPTO_ECDH_PUBLIC_KEY_LEN]; + size_t olen = 0; + psa_status_t status; + + /* Use the uncompressed binary format [0x04 X Y] for the public key point. */ + public_key_uncompressed[0] = uncompressed_format_marker; + memcpy(&public_key_uncompressed[1], public_key, FP_CRYPTO_ECDH_PUBLIC_KEY_LEN); + + status = psa_raw_key_agreement(PSA_ALG_ECDH, priv_key_id, + public_key_uncompressed, sizeof(public_key_uncompressed), + secret_key, FP_CRYPTO_ECDH_SHARED_KEY_LEN, &olen); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_raw_key_agreement failed (err: %d)", status); + return -EIO; + } + + if (olen != FP_CRYPTO_ECDH_SHARED_KEY_LEN) { + LOG_ERR("Invalid psa_raw_key_agreement output len: %zu", olen); + return -EIO; + } + + return 0; +} + +int fp_crypto_ecdh_shared_secret(uint8_t *secret_key, const uint8_t *public_key, + const uint8_t *private_key) +{ + + int err = 0; + psa_key_handle_t priv_key_id; + psa_status_t status; + + priv_key_id = import_ecdh_priv_key(private_key); + if (priv_key_id == PSA_KEY_ID_NULL) { + LOG_ERR("import_ecdh_shared_secret_key failed"); + return -EIO; + } + + err = fp_crypto_psa_ecdh_shared_secret(secret_key, public_key, priv_key_id); + + status = psa_destroy_key(priv_key_id); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_destroy_key failed (err: %d)", status); + /* Overwrite error code to forward information about psa_destroy_key failure. */ + err = -ECANCELED; + } + + return err; +} + +static int fp_crypto_psa_init(void) +{ + psa_status_t status = psa_crypto_init(); + + if (status != PSA_SUCCESS) { + LOG_ERR("psa_crypto_init failed (err: %d)", status); + k_panic(); + return -EIO; + } + + return 0; +} + +SYS_INIT(fp_crypto_psa_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/subsys/bluetooth/services/fast_pair/fp_storage/CMakeLists.txt b/subsys/bluetooth/services/fast_pair/fp_storage/CMakeLists.txt index 9b1c4e0bad1a..d21b4f6c149d 100644 --- a/subsys/bluetooth/services/fast_pair/fp_storage/CMakeLists.txt +++ b/subsys/bluetooth/services/fast_pair/fp_storage/CMakeLists.txt @@ -27,3 +27,6 @@ if(CONFIG_BT_FAST_PAIR_STORAGE_EXPOSE_PRIV_API) else() target_include_directories(fp_storage PRIVATE include_priv) endif() + +# For strnlen() +zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L) diff --git a/subsys/bluetooth/services/wifi_prov/wifi_prov_handler.c b/subsys/bluetooth/services/wifi_prov/wifi_prov_handler.c index 14ccef995d1a..86addc12e2dd 100644 --- a/subsys/bluetooth/services/wifi_prov/wifi_prov_handler.c +++ b/subsys/bluetooth/services/wifi_prov/wifi_prov_handler.c @@ -125,7 +125,7 @@ static void prov_get_status_handler(Request *req, Response *rsp) rsp->device_status.has_connection_info = true; rsp->device_status.connection_info.has_ip4_addr = true; memcpy(rsp->device_status.connection_info.ip4_addr.bytes, - ipv4->unicast[0].address.in_addr.s4_addr, 4); + ipv4->unicast[0].ipv4.address.in_addr.s4_addr, 4); rsp->device_status.connection_info.ip4_addr.size = 4; } else { rsp->device_status.state = ConnectionState_DISCONNECTED; diff --git a/subsys/dfu/dfu_target/Kconfig b/subsys/dfu/dfu_target/Kconfig index 812bb570a5db..e71e53c4da9c 100644 --- a/subsys/dfu/dfu_target/Kconfig +++ b/subsys/dfu/dfu_target/Kconfig @@ -60,6 +60,7 @@ config DFU_TARGET_STREAM_SAVE_PROGRESS depends on DFU_TARGET_STREAM || ZTEST # ZTEST for testing purposes depends on SETTINGS depends on !SETTINGS_NONE + depends on !DFU_MULTI_IMAGE help Enable this option to cause dfu_target_stream to store the current write progress to flash. In case of power failure or device reset, diff --git a/subsys/emds/emds.c b/subsys/emds/emds.c index 0b1d9d354b6d..69c00ee6d3ed 100644 --- a/subsys/emds/emds.c +++ b/subsys/emds/emds.c @@ -75,16 +75,16 @@ static int emds_entries_size(uint32_t *size) *size = 0; STRUCT_SECTION_FOREACH(emds_entry, ch) { - *size += NRFX_CEIL_DIV(ch->len, block_size) * block_size; - *size += NRFX_CEIL_DIV(emds_flash.ate_size, block_size) * block_size; + *size += DIV_ROUND_UP(ch->len, block_size) * block_size; + *size += DIV_ROUND_UP(emds_flash.ate_size, block_size) * block_size; entries++; } struct emds_dynamic_entry *ch; SYS_SLIST_FOR_EACH_CONTAINER(&emds_dynamic_entries, ch, node) { - *size += NRFX_CEIL_DIV(ch->entry.len, block_size) * block_size; - *size += NRFX_CEIL_DIV(emds_flash.ate_size, block_size) * block_size; + *size += DIV_ROUND_UP(ch->entry.len, block_size) * block_size; + *size += DIV_ROUND_UP(emds_flash.ate_size, block_size) * block_size; entries++; } @@ -269,9 +269,9 @@ uint32_t emds_store_time_get(void) STRUCT_SECTION_FOREACH(emds_entry, ch) { - store_time_us += NRFX_CEIL_DIV(ch->len, block_size) * + store_time_us += DIV_ROUND_UP(ch->len, block_size) * CONFIG_EMDS_FLASH_TIME_WRITE_ONE_WORD_US - + NRFX_CEIL_DIV(emds_flash.ate_size, block_size) * + + DIV_ROUND_UP(emds_flash.ate_size, block_size) * CONFIG_EMDS_FLASH_TIME_WRITE_ONE_WORD_US + CONFIG_EMDS_FLASH_TIME_ENTRY_OVERHEAD_US; } @@ -279,9 +279,9 @@ uint32_t emds_store_time_get(void) struct emds_dynamic_entry *ch; SYS_SLIST_FOR_EACH_CONTAINER(&emds_dynamic_entries, ch, node) { - store_time_us += NRFX_CEIL_DIV(ch->entry.len, block_size) * + store_time_us += DIV_ROUND_UP(ch->entry.len, block_size) * CONFIG_EMDS_FLASH_TIME_WRITE_ONE_WORD_US - + NRFX_CEIL_DIV(emds_flash.ate_size, block_size) * + + DIV_ROUND_UP(emds_flash.ate_size, block_size) * CONFIG_EMDS_FLASH_TIME_WRITE_ONE_WORD_US + CONFIG_EMDS_FLASH_TIME_ENTRY_OVERHEAD_US; } diff --git a/subsys/emds/emds_flash.c b/subsys/emds/emds_flash.c index 0e768a38e59c..b63b79206373 100644 --- a/subsys/emds/emds_flash.c +++ b/subsys/emds/emds_flash.c @@ -11,13 +11,25 @@ #include #include #include "emds_flash.h" -#include #include +#if defined CONFIG_SOC_FLASH_NRF_RRAM +#include +#include +#define RRAM DT_INST(0, soc_nv_flash) +#define RRAM_START DT_REG_ADDR(RRAM) +#define RRAM_SIZE DT_REG_SIZE(RRAM) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(RRAM, write_block_size) +#define WRITE_BUFFER_SIZE NRF_RRAMC_CONFIG_WRITE_BUFF_SIZE_MAX +#else +#include +#define FLASH DT_INST(0, soc_nv_flash) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(FLASH, write_block_size) +#endif + LOG_MODULE_REGISTER(emds_flash, CONFIG_EMDS_LOG_LEVEL); #define ADDR_OFFS_MASK 0x0000FFFF -#define EMDS_FLASH_BLOCK_SIZE 4 /* Allocation Table Entry */ struct emds_ate { @@ -107,19 +119,46 @@ static inline bool is_within_bounds(off_t addr, size_t len, off_t boundary_start static inline bool is_regular_addr_valid(off_t addr, size_t len) { +#if defined CONFIG_SOC_FLASH_NRF_RRAM + return is_within_bounds(addr, len, RRAM_START, RRAM_START + RRAM_SIZE); +#else return is_within_bounds(addr, len, 0, nrfx_nvmc_flash_size_get()); +#endif } static void nvmc_wait_ready(void) { +#if defined CONFIG_SOC_FLASH_NRF_RRAM + while (!nrf_rramc_ready_check(NRF_RRAMC)) { + } +#else while (!nrfx_nvmc_write_done_check()) { } +#endif +} + +#if defined CONFIG_SOC_FLASH_NRF_RRAM +static void commit_changes(size_t len) +{ + if (nrf_rramc_empty_buffer_check(NRF_RRAMC)) { + /* The internal write-buffer has been committed to RRAM and is now empty. */ + return; + } + + if ((len % WRITE_BUFFER_SIZE) == 0) { + /* Our last operation was buffer size-aligned, so we're done. */ + return; + } + + nrf_rramc_task_trigger(NRF_RRAMC, NRF_RRAMC_TASK_COMMIT_WRITEBUF); + + barrier_dmem_fence_full(); } +#endif static int flash_direct_write(const struct device *dev, off_t offset, const void *data, size_t len) { uint32_t flash_addr = offset; - uint32_t data_addr = (uint32_t)data; ARG_UNUSED(dev); @@ -143,6 +182,20 @@ static int flash_direct_write(const struct device *dev, off_t offset, const void return -ECANCELED; } +#if defined CONFIG_SOC_FLASH_NRF_RRAM + nrf_rramc_config_t config = {.mode_write = true, .write_buff_size = WRITE_BUFFER_SIZE}; + + nrf_rramc_config_set(NRF_RRAMC, &config); + memcpy((void *)flash_addr, data, len); + + barrier_dmem_fence_full(); /* Barrier following our last write. */ + commit_changes(len); + + config.mode_write = false; + nrf_rramc_config_set(NRF_RRAMC, &config); +#else + uint32_t data_addr = (uint32_t)data; + while (len >= sizeof(uint32_t)) { nrfx_nvmc_word_write(flash_addr, UNALIGNED_GET((uint32_t *)data_addr)); @@ -150,6 +203,7 @@ static int flash_direct_write(const struct device *dev, off_t offset, const void data_addr += sizeof(uint32_t); len -= sizeof(uint32_t); } +#endif RESUME_POFWARN(); @@ -170,7 +224,9 @@ static size_t align_size(struct emds_fs *fs, size_t len) static int ate_wrt(struct emds_fs *fs, const struct emds_ate *entry) { - if (sizeof(struct emds_ate) % fs->flash_params->write_block_size) { + size_t ate_size = align_size(fs, sizeof(struct emds_ate)); + + if (ate_size % fs->flash_params->write_block_size) { return -EINVAL; } @@ -180,7 +236,7 @@ static int ate_wrt(struct emds_fs *fs, const struct emds_ate *entry) return rc; } - fs->ate_wra -= fs->ate_size; + fs->ate_wra -= ate_size; return 0; } @@ -282,23 +338,24 @@ static int entry_wrt(struct emds_fs *fs, uint16_t id, const void *data, size_t l static enum ate_type ate_check(struct emds_fs *fs, uint32_t addr, struct emds_ate *entry) { - uint8_t cmp_buf[fs->ate_size]; - int rc = flash_read(fs->flash_dev, addr, entry, fs->ate_size); + uint8_t read_buf[fs->ate_size]; + int rc = flash_read(fs->flash_dev, addr, read_buf, fs->ate_size); if (rc) { return ATE_TYPE_UNKNOWN; } - memset(cmp_buf, 0, sizeof(cmp_buf)); - if (!memcmp(entry, cmp_buf, fs->ate_size)) { + memset(entry, 0, sizeof(struct emds_ate)); + if (!memcmp(entry, read_buf, sizeof(struct emds_ate))) { return ATE_TYPE_INVALIDATED; } - memset(cmp_buf, fs->flash_params->erase_value, sizeof(cmp_buf)); - if (!memcmp(entry, cmp_buf, fs->ate_size)) { + memset(entry, fs->flash_params->erase_value, sizeof(struct emds_ate)); + if (!memcmp(entry, read_buf, sizeof(struct emds_ate))) { return ATE_TYPE_ERASED; } + memcpy(entry, read_buf, sizeof(struct emds_ate)); if (is_ate_valid(entry)) { return ATE_TYPE_VALID; } @@ -308,7 +365,7 @@ static enum ate_type ate_check(struct emds_fs *fs, uint32_t addr, struct emds_at static int ate_last_recover(struct emds_fs *fs) { - struct emds_ate end_ate = { 0 }; + struct emds_ate end_ate; enum ate_type type = 0; uint8_t expect_field = 0xFF; @@ -402,7 +459,7 @@ int emds_flash_init(struct emds_fs *fs) if (fs->flash_params->write_block_size > EMDS_FLASH_BLOCK_SIZE || fs->flash_params->write_block_size == 0) { - LOG_ERR("Unsupported write block size"); + LOG_ERR("Unsupported write block size: %i", fs->flash_params->write_block_size); return -EINVAL; } @@ -426,7 +483,7 @@ int emds_flash_init(struct emds_fs *fs) k_mutex_lock(&fs->emds_lock, K_FOREVER); fs->ate_size = align_size(fs, sizeof(struct emds_ate)); - __ASSERT(fs->ate_size == 8, "ATE size not aligned with documented value"); + rc = ate_last_recover(fs); k_mutex_unlock(&fs->emds_lock); if (rc) { diff --git a/subsys/esb/CMakeLists.txt b/subsys/esb/CMakeLists.txt index 89bb9700fdb5..41aafa7a7573 100644 --- a/subsys/esb/CMakeLists.txt +++ b/subsys/esb/CMakeLists.txt @@ -8,4 +8,4 @@ zephyr_library() zephyr_library_sources(esb.c) zephyr_library_sources_ifdef(CONFIG_HAS_HW_NRF_PPI esb_ppi.c) -zephyr_library_sources_ifdef(CONFIG_HAS_HW_NRF_DPPIC esb_dppi.c) +zephyr_library_sources_ifndef(CONFIG_HAS_HW_NRF_PPI esb_dppi.c) diff --git a/subsys/esb/Kconfig b/subsys/esb/Kconfig index 941ba4c3cb7a..e8bc2ce24ac2 100644 --- a/subsys/esb/Kconfig +++ b/subsys/esb/Kconfig @@ -60,6 +60,8 @@ config ESB_EVENT_IRQ_PRIORITY menu "Hardware selection (alter with care)" choice ESB_SYS_TIMER + default ESB_SYS_TIMER021 if $(dt_nodelabel_has_compat,timer021,$(DT_COMPAT_NORDIC_NRF_TIMER)) + default ESB_SYS_TIMER10 if $(dt_nodelabel_has_compat,timer10,$(DT_COMPAT_NORDIC_NRF_TIMER)) default ESB_SYS_TIMER2 prompt "Timer to use for the ESB system timer" @@ -88,6 +90,26 @@ config ESB_SYS_TIMER4 depends on $(dt_nodelabel_has_compat,timer4,$(DT_COMPAT_NORDIC_NRF_TIMER)) select NRFX_TIMER4 +config ESB_SYS_TIMER10 + bool "TIMER10" + depends on $(dt_nodelabel_has_compat,timer10,$(DT_COMPAT_NORDIC_NRF_TIMER)) + select NRFX_TIMER10 + +config ESB_SYS_TIMER020 + bool "TIMER020" + depends on $(dt_nodelabel_has_compat,timer020,$(DT_COMPAT_NORDIC_NRF_TIMER)) + select NRFX_TIMER020 + +config ESB_SYS_TIMER021 + bool "TIMER021" + depends on $(dt_nodelabel_has_compat,timer021,$(DT_COMPAT_NORDIC_NRF_TIMER)) + select NRFX_TIMER021 + +config ESB_SYS_TIMER022 + bool "TIMER022" + depends on $(dt_nodelabel_has_compat,timer022,$(DT_COMPAT_NORDIC_NRF_TIMER)) + select NRFX_TIMER022 + endchoice config ESB_SYS_TIMER_INSTANCE @@ -97,6 +119,14 @@ config ESB_SYS_TIMER_INSTANCE default 2 if ESB_SYS_TIMER2 default 3 if ESB_SYS_TIMER3 default 4 if ESB_SYS_TIMER4 + default 10 if ESB_SYS_TIMER10 + default 20 if ESB_SYS_TIMER020 + default 21 if ESB_SYS_TIMER021 + default 22 if ESB_SYS_TIMER022 + +config ESB_SYS_TIMER_INSTANCE_LEADING_ZERO + bool + default y if ESB_SYS_TIMER020 || ESB_SYS_TIMER021 || ESB_SYS_TIMER022 endmenu @@ -118,6 +148,29 @@ config ESB_NEVER_DISABLE_TX the radio emitter needs to be turned off to enable the radio receiver. This reduces delay between consecutive transmissions but consumes more energy. +config ESB_FAST_SWITCHING + select EXPERIMENTAL + depends on !ESB_NEVER_DISABLE_TX && SOC_NRF54H20_CPURAD + bool "Fast radio TX/RX and RX/TX switching [EXPERIMENTAL]" + help + This option enables fast switching between transmit (TX) and receive (RX) modes + and vice versa for ESB configurations. + For the PTX node, this switching occurs after transmitting a packet and before waiting + for acknowledgment (TX -> RX). + For the PRX node, this switching occurs after receiving a packet and before + transmitting an acknowledgment (RX -> TX). + Enabling this feature can improve the responsiveness and efficiency of the radio + communication system by reducing the latency. + +config ESB_FAST_CHANNEL_SWITCHING + select EXPERIMENTAL + depends on SOC_NRF54H20_CPURAD + bool "Fast radio channel switching [EXPERIMENTAL]" + help + This option enables fast radio channel switching. + Allows the radio channel to be changed in RX radio state + without the need to switch the radio to DISABLE state. + module=ESB module-str=ESB source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/subsys/esb/esb.c b/subsys/esb/esb.c index 4a175fa1bde8..ea86fa6d0b6b 100644 --- a/subsys/esb/esb.c +++ b/subsys/esb/esb.c @@ -43,6 +43,8 @@ LOG_MODULE_REGISTER(esb, CONFIG_ESB_LOG_LEVEL); #define RX_ACK_TIMEOUT_US_250KBPS 300 /* 1 Mb RX wait for acknowledgment time-out (combined with BLE). */ #define RX_ACK_TIMEOUT_US_1MBPS_BLE 300 +/* 4 Mb RX wait for acknowledgment time-out value. */ +#define RX_ACK_TIMEOUT_US_4MBPS 160 /* Minimum retransmit time */ #define RETRANSMIT_DELAY_MIN 435 @@ -85,9 +87,28 @@ LOG_MODULE_REGISTER(esb, CONFIG_ESB_LOG_LEVEL); /* NRF5340 Radio high voltage gain. */ #define NRF5340_HIGH_VOLTAGE_GAIN 3 -#define RADIO_SHORTS_COMMON \ - (NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_END_DISABLE_MASK | \ - NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | NRF_RADIO_SHORT_DISABLED_RSSISTOP_MASK) +/* Fast switching is available for the nRF54H20 SoC. + * The nRF54H20 is a non-RSSISTOP device. + */ +#if defined(RADIO_SHORTS_DISABLED_RSSISTOP_Msk) +#define RADIO_SHORTS_COMMON \ + (NRF_RADIO_SHORT_READY_START_MASK | ESB_SHORT_DISABLE_MASK | \ + NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | NRF_RADIO_SHORT_DISABLED_RSSISTOP_MASK) +#else +/* Devices without RSSISTOP task will stop RSSI measurement after specific period. */ +#define RADIO_SHORTS_FAST_SWITCHING_NO_RSSISTOP \ + (NRF_RADIO_SHORT_READY_START_MASK | NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK) +#define RADIO_SHORTS_NO_FAST_SWITCHING_NO_RSSISTOP \ + (NRF_RADIO_SHORT_READY_START_MASK | ESB_SHORT_DISABLE_MASK | \ + NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK) + +#define RADIO_SHORTS_COMMON \ + (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING) ? RADIO_SHORTS_FAST_SWITCHING_NO_RSSISTOP : \ + RADIO_SHORTS_NO_FAST_SWITCHING_NO_RSSISTOP) +#endif /* !defined(RADIO_SHORTS_DISABLED_RSSISTOP_Msk) */ + +/* Flag for changing radio channel. */ +#define RF_CHANNEL_UPDATE_FLAG 0 /* Internal Enhanced ShockBurst module state. */ enum esb_state { @@ -202,9 +223,10 @@ struct esb_address { uint8_t addr_length; /* Length of the address plus the prefix. */ uint8_t rx_pipes_enabled; /* Bitfield for enabled pipes. */ uint8_t rf_channel; /* Channel to use (between 0 and 100). */ + atomic_t rf_channel_flags; /* Flags for setting the channel. */ }; -static nrfx_timer_t esb_timer = ESB_TIMER_INSTANCE; +static nrfx_timer_t esb_timer = ESB_NRFX_TIMER_INSTANCE; static bool esb_initialized; static struct esb_config esb_cfg; @@ -564,15 +586,163 @@ static void update_radio_addresses(uint8_t update_mask) #endif } +#if defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) +static nrf_radio_txpower_t dbm_to_nrf_radio_txpower(int8_t tx_power) +{ + switch (tx_power) { +#if defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) + case -70: + return RADIO_TXPOWER_TXPOWER_Neg70dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg70dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) + case -46: + return RADIO_TXPOWER_TXPOWER_Neg46dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg46dBm) */ + + case -40: + return RADIO_TXPOWER_TXPOWER_Neg40dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg30dBm) + case -30: + 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) */ + + case -20: + return RADIO_TXPOWER_TXPOWER_Neg20dBm; + + case -16: + return RADIO_TXPOWER_TXPOWER_Neg16dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) + case -14: + return RADIO_TXPOWER_TXPOWER_Neg14dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg14dBm) */ + + case -12: + return RADIO_TXPOWER_TXPOWER_Neg12dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) + case -10: + return RADIO_TXPOWER_TXPOWER_Neg10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg10dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) + case -9: + return RADIO_TXPOWER_TXPOWER_Neg9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg9dBm) */ + + case -8: + return RADIO_TXPOWER_TXPOWER_Neg8dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) + case -7: + return RADIO_TXPOWER_TXPOWER_Neg7dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg7dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) + case -6: + return RADIO_TXPOWER_TXPOWER_Neg6dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg6dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) + case -5: + return RADIO_TXPOWER_TXPOWER_Neg5dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Neg5dBm) */ + + case -4: + return RADIO_TXPOWER_TXPOWER_Neg4dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Neg3dBm) + case -3: + return RADIO_TXPOWER_TXPOWER_Neg3dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg3dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg2dBm) + case -2: + return RADIO_TXPOWER_TXPOWER_Neg2dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg2dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Neg1dBm) + case -1: + return RADIO_TXPOWER_TXPOWER_Neg1dBm; +#endif /* defined (RADIO_TXPOWER_TXPOWER_Neg1dBm) */ + + case 0: + return RADIO_TXPOWER_TXPOWER_0dBm; + +#if defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) + case 1: + return RADIO_TXPOWER_TXPOWER_Pos1dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos1dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) + case 2: + return RADIO_TXPOWER_TXPOWER_Pos2dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) + case 3: + return RADIO_TXPOWER_TXPOWER_Pos3dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) + case 4: + return RADIO_TXPOWER_TXPOWER_Pos4dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos4dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) + case 5: + return RADIO_TXPOWER_TXPOWER_Pos5dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) + case 6: + return RADIO_TXPOWER_TXPOWER_Pos6dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) + case 7: + return RADIO_TXPOWER_TXPOWER_Pos7dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) + case 8: + return RADIO_TXPOWER_TXPOWER_Pos8dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) + case 9: + return RADIO_TXPOWER_TXPOWER_Pos9dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos9dBm) */ + +#if defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) + case 10: + return RADIO_TXPOWER_TXPOWER_Pos10dBm; +#endif /* defined(RADIO_TXPOWER_TXPOWER_Pos10dBm) */ + + default: + printk("TX power to enumerator conversion failed, defaulting to 0 dBm\n"); + return RADIO_TXPOWER_TXPOWER_0dBm; + } +} +#endif /* defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) */ + static void update_radio_tx_power(void) { +#if !(defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX)) int32_t err; mpsl_tx_power_split_t tx_power; (void)mpsl_fem_tx_power_split(esb_cfg.tx_output_power, &tx_power, (RADIO_BASE_FREQUENCY + esb_addr.rf_channel), false); - err = mpsl_fem_pa_gain_set(&tx_power.fem); + err = mpsl_fem_pa_power_control_set(tx_power.fem_pa_power_control); if (err) { /* Should not happen. */ __ASSERT_NO_MSG(false); @@ -590,6 +760,9 @@ static void update_radio_tx_power(void) #endif /* NRF53_SERIES */ nrf_radio_txpower_set(NRF_RADIO, tx_power.radio_tx_power); +#else + nrf_radio_txpower_set(NRF_RADIO, dbm_to_nrf_radio_txpower(esb_cfg.tx_output_power)); +#endif /* !(defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX)) */ } static bool update_radio_bitrate(void) @@ -597,6 +770,13 @@ static bool update_radio_bitrate(void) nrf_radio_mode_set(NRF_RADIO, esb_cfg.bitrate); switch (esb_cfg.bitrate) { + +#if defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) + case ESB_BITRATE_4MBPS: + wait_for_ack_timeout_us = RX_ACK_TIMEOUT_US_4MBPS; + break; +#endif /* defined(RADIO_MODE_MODE_Nrf_4Mbit0_5) */ + case ESB_BITRATE_2MBPS: #if defined(RADIO_MODE_MODE_Ble_2Mbit) @@ -841,8 +1021,13 @@ static void start_tx_transaction(void) memcpy(pdu->data, current_payload->data, current_payload->length); - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); + } else { + nrf_radio_shorts_set(NRF_RADIO, + (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + } nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_DISABLED_MASK); /* Configure the retransmit counter */ @@ -865,8 +1050,13 @@ static void start_tx_transaction(void) * selective auto ack is turned off */ if (ack) { - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); + } else { + nrf_radio_shorts_set(NRF_RADIO, + (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + } /* Configure the retransmit counter */ retransmits_remaining = esb_cfg.retransmit_count; @@ -875,7 +1065,7 @@ static void start_tx_transaction(void) nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_DISABLED_MASK); } else if (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX)) { nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common & - ~RADIO_SHORTS_END_DISABLE_Msk); + ~ESB_SHORT_DISABLE_MASK); nrf_timer_shorts_set(esb_timer.p_reg, (NRF_TIMER_SHORT_COMPARE1_STOP_MASK | NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK)); @@ -911,18 +1101,19 @@ static void start_tx_transaction(void) nrf_radio_txaddress_set(NRF_RADIO, current_payload->pipe); nrf_radio_rxaddresses_set(NRF_RADIO, BIT(current_payload->pipe)); nrf_radio_frequency_set(NRF_RADIO, (RADIO_BASE_FREQUENCY + esb_addr.rf_channel)); + atomic_clear_bit(&esb_addr.rf_channel_flags, RF_CHANNEL_UPDATE_FLAG); update_radio_tx_power(); nrf_radio_packetptr_set(NRF_RADIO, pdu); - NVIC_ClearPendingIRQ(RADIO_IRQn); - irq_enable(RADIO_IRQn); + NVIC_ClearPendingIRQ(ESB_RADIO_IRQ_NUMBER); + irq_enable(ESB_RADIO_IRQ_NUMBER); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); - nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_END); + nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); /* Trigger different radio event if radio is disabled or idle */ if (is_tx_idle) { @@ -935,6 +1126,15 @@ static void start_tx_transaction(void) } } +static void set_evt_interrupt(void) +{ + if (IS_ENABLED(ESB_EVT_USING_EGU)) { + nrf_egu_task_trigger(ESB_EGU, ESB_EGU_EVT_TASK); + } else { + NVIC_SetPendingIRQ(ESB_EVT_IRQ_NUMBER); + } +} + static void on_radio_end_tx_noack(void) { /* Timer compare is cleared by PPI - we still need to disable Interrupt flag */ @@ -946,9 +1146,9 @@ static void on_radio_end_tx_noack(void) if (tx_fifo.count == 0) { esb_state = ESB_STATE_PTX_TXIDLE; - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); } else { - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); start_tx_transaction(); } } @@ -963,9 +1163,9 @@ static void on_radio_disabled_tx_noack(void) if (tx_fifo.count == 0) { esb_state = ESB_STATE_IDLE; - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); } else { - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); start_tx_transaction(); } } @@ -1003,7 +1203,7 @@ static void on_radio_disabled_tx(void) esb_ppi_for_wait_for_ack_set(); esb_ppi_for_retransmission_clear(); - nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_END); + nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); if (esb_cfg.protocol == ESB_PROTOCOL_ESB) { update_rf_payload_format(0); @@ -1029,7 +1229,7 @@ static void on_radio_disabled_tx_wait_for_ack(void) mpsl_fem_disable(); /* If the radio has received a packet and the CRC status is OK */ - if (nrf_radio_event_check(NRF_RADIO, NRF_RADIO_EVENT_END) && + if (nrf_radio_event_check(NRF_RADIO, ESB_RADIO_EVENT_END) && nrf_radio_crc_status_check(NRF_RADIO)) { interrupt_flags |= INT_TX_SUCCESS_MSK; last_tx_attempts = esb_cfg.retransmit_count - retransmits_remaining + 1; @@ -1045,9 +1245,9 @@ static void on_radio_disabled_tx_wait_for_ack(void) if ((tx_fifo.count == 0) || (esb_cfg.tx_mode == ESB_TXMODE_MANUAL)) { esb_state = ESB_STATE_IDLE; - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); } else { - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); start_tx_transaction(); } } else { @@ -1061,7 +1261,7 @@ static void on_radio_disabled_tx_wait_for_ack(void) interrupt_flags |= INT_TX_FAILED_MSK; esb_state = ESB_STATE_IDLE; - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); } else { bool radio_started = true; @@ -1071,8 +1271,12 @@ static void on_radio_disabled_tx_wait_for_ack(void) * be entered again as soon as the system timer reaches * CC[1]. */ - nrf_radio_shorts_set(NRF_RADIO, - (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + } else { + nrf_radio_shorts_set(NRF_RADIO, + (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + } update_rf_payload_format(current_payload->length); nrf_radio_packetptr_set(NRF_RADIO, tx_payload_buffer); @@ -1223,8 +1427,12 @@ static void on_radio_disabled_rx(void) if ((esb_cfg.selective_auto_ack == false) || rx_pdu->type.dpl_pdu.no_ack) { esb_fem_for_tx_ack(); - nrf_radio_shorts_set(NRF_RADIO, + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + } else { + nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_RXEN_MASK)); + } switch (esb_cfg.protocol) { case ESB_PROTOCOL_ESB_DPL: @@ -1259,7 +1467,7 @@ static void on_radio_disabled_rx(void) */ if (rx_fifo_push_rfbuf(nrf_radio_rxmatch_get(NRF_RADIO), pipe_info->pid)) { interrupt_flags |= INT_RX_DATA_RECEIVED_MSK; - NVIC_SetPendingIRQ(ESB_EVT_IRQ); + set_evt_interrupt(); } } } @@ -1268,7 +1476,14 @@ static void on_radio_disabled_rx_ack(void) { esb_fem_for_ack_rx(); - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_RXEN); + } else { + nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | + NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + } + update_rf_payload_format(esb_cfg.payload_length); nrf_radio_packetptr_set(NRF_RADIO, rx_payload_buffer); @@ -1277,6 +1492,13 @@ static void on_radio_disabled_rx_ack(void) esb_state = ESB_STATE_PRX; } +static void fast_switchinng_set_channel(uint8_t channel) +{ + *(volatile uint32_t *)((uint8_t *)(NRF_RADIO) + 0x70C) &= ~(1 << 31); + nrf_radio_frequency_set(NRF_RADIO, (RADIO_BASE_FREQUENCY + channel)); + *(volatile uint32_t *)((uint8_t *)(NRF_RADIO) + 0x07C) = 1; +} + /* Retrieve interrupt flags and reset them. * * @param[out] interrupts Interrupt flags. @@ -1305,6 +1527,28 @@ static void radio_irq_handler(void) on_radio_disabled(); } } + + if (nrf_radio_int_enable_check(NRF_RADIO, ESB_RADIO_INT_END_MASK) && + nrf_radio_event_check(NRF_RADIO, ESB_RADIO_EVENT_END)) { + /* The PHYEND event is called when fast switching is enabled + * instead of the DISABLE event. + * This event is handled in the analogous way to the disable event. + */ + if (on_radio_disabled) { + on_radio_disabled(); + } + nrf_radio_event_clear(NRF_RADIO, ESB_RADIO_EVENT_END); + } + +#if defined(CONFIG_ESB_FAST_CHANNEL_SWITCHING) + if (nrf_radio_int_enable_check(NRF_RADIO, NRF_RADIO_INT_RXREADY_MASK) && + nrf_radio_event_check(NRF_RADIO, NRF_RADIO_EVENT_RXREADY)) { + nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_RXREADY); + if (atomic_test_and_clear_bit(&esb_addr.rf_channel_flags, RF_CHANNEL_UPDATE_FLAG)) { + fast_switchinng_set_channel(esb_addr.rf_channel); + } + } +#endif /* defined(CONFIG_ESB_FAST_CHANNEL_SWITCHING) */ } static void esb_evt_irq_handler(void) @@ -1333,21 +1577,24 @@ static void esb_evt_irq_handler(void) #if IS_ENABLED(CONFIG_ESB_DYNAMIC_INTERRUPTS) -void RADIO_IRQHandler(const void *args) +static void radio_dynamic_irq_handler(const void *args) { ARG_UNUSED(args); radio_irq_handler(); ISR_DIRECT_PM(); } -void ESB_EVT_IRQHandler(const void *args) +static void evt_dynamic_irq_handler(const void *args) { ARG_UNUSED(args); + if (IS_ENABLED(ESB_EVT_USING_EGU)) { + nrf_egu_event_clear(ESB_EGU, ESB_EGU_EVT_TASK); + } esb_evt_irq_handler(); ISR_DIRECT_PM(); } -void ESB_TIMER_IRQHandler(const void *args) +static void timer_dynamic_irq_handler(const void *args) { ARG_UNUSED(args); ESB_TIMER_IRQ_HANDLER(); @@ -1356,7 +1603,7 @@ void ESB_TIMER_IRQHandler(const void *args) #else /* !IS_ENABLED(CONFIG_ESB_DYNAMIC_INTERRUPTS) */ -ISR_DIRECT_DECLARE(RADIO_IRQHandler) +ISR_DIRECT_DECLARE(esb_radio_direct_irq_handler) { radio_irq_handler(); @@ -1365,9 +1612,12 @@ ISR_DIRECT_DECLARE(RADIO_IRQHandler) return 1; } - -ISR_DIRECT_DECLARE(ESB_EVT_IRQHandler) +ISR_DIRECT_DECLARE(esb_evt_direct_irq_handler) { + if (IS_ENABLED(ESB_EVT_USING_EGU)) { + nrf_egu_event_clear(ESB_EGU, ESB_EGU_EVT_EVENT); + } + esb_evt_irq_handler(); ISR_DIRECT_PM(); @@ -1386,8 +1636,8 @@ ISR_DIRECT_DECLARE(ESB_SYS_TIMER_IRQHandler) static void esb_irq_disable(void) { - irq_disable(RADIO_IRQn); - irq_disable(ESB_EVT_IRQ); + irq_disable(ESB_RADIO_IRQ_NUMBER); + irq_disable(ESB_EVT_IRQ_NUMBER); irq_disable(ESB_TIMER_IRQ); } @@ -1407,6 +1657,12 @@ int esb_init(const struct esb_config *config) memcpy(&esb_cfg, config, sizeof(esb_cfg)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + if (!esb_cfg.use_fast_ramp_up) { + return -EINVAL; + } + } + interrupt_flags = 0; memset(rx_pipe_info, 0, sizeof(rx_pipe_info)); @@ -1436,41 +1692,47 @@ int esb_init(const struct esb_config *config) disable_event.event.generic.event = esb_ppi_radio_disabled_get(); - nrf_radio_modecnf0_set(NRF_RADIO, esb_cfg.use_fast_ramp_up, - nrf_radio_modecnf0_dtx_get(NRF_RADIO)); + nrf_radio_fast_ramp_up_enable_set(NRF_RADIO, esb_cfg.use_fast_ramp_up); + +#if defined(CONFIG_ESB_FAST_CHANNEL_SWITCHING) + nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_RXREADY_MASK); +#endif /* defined(CONFIG_ESB_FAST_CHANNEL_SWITCHING) */ #if IS_ENABLED(CONFIG_ESB_DYNAMIC_INTERRUPTS) /* Ensure IRQs are disabled before attaching. */ esb_irq_disable(); - ARM_IRQ_DIRECT_DYNAMIC_CONNECT(RADIO_IRQn, CONFIG_ESB_RADIO_IRQ_PRIORITY, + ARM_IRQ_DIRECT_DYNAMIC_CONNECT(ESB_RADIO_IRQ_NUMBER, CONFIG_ESB_RADIO_IRQ_PRIORITY, 0, reschedule); - ARM_IRQ_DIRECT_DYNAMIC_CONNECT(ESB_EVT_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, + ARM_IRQ_DIRECT_DYNAMIC_CONNECT(ESB_EVT_IRQ_NUMBER, CONFIG_ESB_EVENT_IRQ_PRIORITY, 0, reschedule); ARM_IRQ_DIRECT_DYNAMIC_CONNECT(ESB_TIMER_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, 0, reschedule); - irq_connect_dynamic(RADIO_IRQn, CONFIG_ESB_RADIO_IRQ_PRIORITY, - RADIO_IRQHandler, NULL, 0); - irq_connect_dynamic(ESB_EVT_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, - ESB_EVT_IRQHandler, NULL, 0); + irq_connect_dynamic(ESB_RADIO_IRQ_NUMBER, CONFIG_ESB_RADIO_IRQ_PRIORITY, + radio_dynamic_irq_handler, NULL, 0); + irq_connect_dynamic(ESB_EVT_IRQ_NUMBER, CONFIG_ESB_EVENT_IRQ_PRIORITY, + evt_dynamic_irq_handler, NULL, 0); irq_connect_dynamic(ESB_TIMER_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, - ESB_TIMER_IRQHandler, NULL, 0); + timer_dynamic_irq_handler, NULL, 0); #else /* !IS_ENABLED(CONFIG_ESB_DYNAMIC_INTERRUPTS) */ - IRQ_DIRECT_CONNECT(RADIO_IRQn, CONFIG_ESB_RADIO_IRQ_PRIORITY, - RADIO_IRQHandler, 0); - IRQ_DIRECT_CONNECT(ESB_EVT_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, - ESB_EVT_IRQHandler, 0); + IRQ_DIRECT_CONNECT(ESB_RADIO_IRQ_NUMBER, CONFIG_ESB_RADIO_IRQ_PRIORITY, + esb_radio_direct_irq_handler, 0); + IRQ_DIRECT_CONNECT(ESB_EVT_IRQ_NUMBER, CONFIG_ESB_EVENT_IRQ_PRIORITY, + esb_evt_direct_irq_handler, 0); IRQ_DIRECT_CONNECT(ESB_TIMER_IRQ, CONFIG_ESB_EVENT_IRQ_PRIORITY, ESB_TIMER_IRQ_HANDLER, 0); #endif /* IS_ENABLED(CONFIG_ESB_DYNAMIC_INTERRUPTS) */ - irq_enable(RADIO_IRQn); - irq_enable(ESB_EVT_IRQ); + irq_enable(ESB_RADIO_IRQ_NUMBER); + irq_enable(ESB_EVT_IRQ_NUMBER); + if (IS_ENABLED(ESB_EVT_USING_EGU)) { + nrf_egu_int_enable(ESB_EGU, ESB_EGU_EVT_INT); + } irq_enable(ESB_TIMER_IRQ); esb_state = ESB_STATE_IDLE; @@ -1508,7 +1770,7 @@ void esb_disable(void) esb_ppi_deinit(); /* Radio ramp-up time to default mode */ - nrf_radio_modecnf0_set(NRF_RADIO, false, nrf_radio_modecnf0_dtx_get(NRF_RADIO)); + nrf_radio_fast_ramp_up_enable_set(NRF_RADIO, false); esb_state = ESB_STATE_IDLE; esb_initialized = false; @@ -1672,17 +1934,25 @@ int esb_start_rx(void) on_radio_disabled = on_radio_disabled_rx; - nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_shorts_set(NRF_RADIO, radio_shorts_common); + nrf_radio_int_enable(NRF_RADIO, ESB_RADIO_INT_END_MASK); + } else { + nrf_radio_shorts_set(NRF_RADIO, (radio_shorts_common | + NRF_RADIO_SHORT_DISABLED_TXEN_MASK)); + } + nrf_radio_int_enable(NRF_RADIO, NRF_RADIO_INT_DISABLED_MASK); esb_state = ESB_STATE_PRX; nrf_radio_rxaddresses_set(NRF_RADIO, esb_addr.rx_pipes_enabled); nrf_radio_frequency_set(NRF_RADIO, (RADIO_BASE_FREQUENCY + esb_addr.rf_channel)); + atomic_clear_bit(&esb_addr.rf_channel_flags, RF_CHANNEL_UPDATE_FLAG); nrf_radio_packetptr_set(NRF_RADIO, rx_payload_buffer); - NVIC_ClearPendingIRQ(RADIO_IRQn); - irq_enable(RADIO_IRQn); + NVIC_ClearPendingIRQ(ESB_RADIO_IRQ_NUMBER); + irq_enable(ESB_RADIO_IRQ_NUMBER); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS); nrf_radio_event_clear(NRF_RADIO, NRF_RADIO_EVENT_PAYLOAD); @@ -1889,13 +2159,22 @@ int esb_enable_pipes(uint8_t enable_mask) int esb_set_rf_channel(uint32_t channel) { - if (esb_state != ESB_STATE_IDLE) { - return -EBUSY; - } if (channel > 100) { return -EINVAL; } + if (esb_state != ESB_STATE_IDLE) { + if (IS_ENABLED(CONFIG_ESB_FAST_CHANNEL_SWITCHING)) { + if (esb_state == ESB_STATE_PRX) { + fast_switchinng_set_channel(channel); + } else { + atomic_set_bit(&esb_addr.rf_channel_flags, RF_CHANNEL_UPDATE_FLAG); + } + } else { + return -EBUSY; + } + } + esb_addr.rf_channel = channel; return 0; diff --git a/subsys/esb/esb_dppi.c b/subsys/esb/esb_dppi.c index dce5c74214bb..293d6b2734d9 100644 --- a/subsys/esb/esb_dppi.c +++ b/subsys/esb/esb_dppi.c @@ -20,7 +20,7 @@ LOG_MODULE_DECLARE(esb, CONFIG_ESB_LOG_LEVEL); static uint8_t radio_address_timer_stop; static uint8_t timer_compare0_radio_disable; static uint8_t timer_compare1_radio_txen; -static uint8_t disabled_egu; +static uint8_t disabled_phy_end_egu; static uint8_t egu_timer_start; static uint8_t egu_ramp_up; static uint8_t radio_end_timer_start; @@ -37,15 +37,21 @@ void esb_ppi_for_txrx_set(bool rx, bool timer_start) nrf_egu_publish_set(ESB_EGU, ESB_EGU_EVENT, egu_timer_start); nrf_egu_publish_set(ESB_EGU, ESB_EGU_DPPI_EVENT, egu_ramp_up); - nrf_dppi_channels_include_in_group(NRF_DPPIC, BIT(egu_ramp_up), ramp_up_dppi_group); + nrf_dppi_channels_include_in_group(ESB_DPPIC, BIT(egu_ramp_up), ramp_up_dppi_group); nrf_egu_subscribe_set(ESB_EGU, ESB_EGU_DPPI_TASK, egu_timer_start); nrf_radio_subscribe_set(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN, egu_ramp_up); - nrf_dppi_subscribe_set(NRF_DPPIC, + nrf_dppi_subscribe_set(ESB_DPPIC, nrf_dppi_group_disable_task_get((uint8_t)ramp_up_dppi_group), egu_ramp_up); - nrf_egu_subscribe_set(ESB_EGU, ESB_EGU_TASK, disabled_egu); + + nrf_egu_subscribe_set(ESB_EGU, ESB_EGU_TASK, disabled_phy_end_egu); + + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_subscribe_set(NRF_RADIO, rx ? NRF_RADIO_TASK_TXEN : NRF_RADIO_TASK_RXEN, + disabled_phy_end_egu); + } if (timer_start) { nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START, @@ -55,7 +61,7 @@ void esb_ppi_for_txrx_set(bool rx, bool timer_start) channels_mask = (BIT(egu_timer_start) | BIT(egu_ramp_up)); - nrf_dppi_channels_enable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_enable(ESB_DPPIC, channels_mask); } void esb_ppi_for_txrx_clear(bool rx, bool timer_start) @@ -65,19 +71,23 @@ void esb_ppi_for_txrx_clear(bool rx, bool timer_start) channels_mask = (BIT(egu_timer_start) | BIT(egu_ramp_up)); - nrf_dppi_channels_disable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_disable(ESB_DPPIC, channels_mask); nrf_egu_publish_clear(ESB_EGU, ESB_EGU_EVENT); nrf_egu_publish_clear(ESB_EGU, ESB_EGU_DPPI_EVENT); nrf_egu_subscribe_clear(ESB_EGU, ESB_EGU_DPPI_TASK); nrf_radio_subscribe_clear(NRF_RADIO, rx ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN); - nrf_dppi_subscribe_clear(NRF_DPPIC, + nrf_dppi_subscribe_clear(ESB_DPPIC, nrf_dppi_group_disable_task_get((uint8_t)ramp_up_dppi_group)); nrf_egu_subscribe_clear(ESB_EGU, ESB_EGU_TASK); - nrf_dppi_channels_remove_from_group(NRF_DPPIC, BIT(egu_ramp_up), ramp_up_dppi_group); + nrf_dppi_channels_remove_from_group(ESB_DPPIC, BIT(egu_ramp_up), ramp_up_dppi_group); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_subscribe_clear(NRF_RADIO, rx ? NRF_RADIO_TASK_TXEN : + NRF_RADIO_TASK_RXEN); + } if (timer_start) { nrf_timer_subscribe_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START); @@ -90,12 +100,12 @@ void esb_ppi_for_fem_set(void) nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START, egu_timer_start); - nrf_dppi_channels_enable(NRF_DPPIC, BIT(egu_timer_start)); + nrf_dppi_channels_enable(ESB_DPPIC, BIT(egu_timer_start)); } void esb_ppi_for_fem_clear(void) { - nrf_dppi_channels_disable(NRF_DPPIC, BIT(egu_timer_start)); + nrf_dppi_channels_disable(ESB_DPPIC, BIT(egu_timer_start)); nrf_egu_publish_clear(ESB_EGU, ESB_EGU_EVENT); nrf_timer_subscribe_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START); @@ -109,19 +119,27 @@ void esb_ppi_for_retransmission_set(void) timer_compare1_radio_txen); nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_TXEN, timer_compare1_radio_txen); - nrf_egu_subscribe_set(ESB_EGU, ESB_EGU_TASK, disabled_egu); + nrf_egu_subscribe_set(ESB_EGU, ESB_EGU_TASK, disabled_phy_end_egu); + + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_subscribe_set(NRF_RADIO, NRF_RADIO_TASK_RXEN, disabled_phy_end_egu); + } - nrf_dppi_channels_enable(NRF_DPPIC, BIT(timer_compare1_radio_txen)); + nrf_dppi_channels_enable(ESB_DPPIC, BIT(timer_compare1_radio_txen)); } void esb_ppi_for_retransmission_clear(void) { - nrf_dppi_channels_disable(NRF_DPPIC, BIT(timer_compare1_radio_txen)); + nrf_dppi_channels_disable(ESB_DPPIC, BIT(timer_compare1_radio_txen)); nrf_timer_publish_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE1); nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_TXEN); nrf_egu_subscribe_clear(ESB_EGU, ESB_EGU_TASK); + + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_subscribe_clear(NRF_RADIO, NRF_RADIO_TASK_RXEN); + } } void esb_ppi_for_wait_for_ack_set(void) @@ -139,7 +157,7 @@ void esb_ppi_for_wait_for_ack_set(void) channels_mask = (BIT(radio_address_timer_stop) | BIT(timer_compare0_radio_disable)); - nrf_dppi_channels_enable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_enable(ESB_DPPIC, channels_mask); } void esb_ppi_for_wait_for_ack_clear(void) @@ -149,7 +167,7 @@ void esb_ppi_for_wait_for_ack_clear(void) channels_mask = (BIT(radio_address_timer_stop) | BIT(timer_compare0_radio_disable)); - nrf_dppi_channels_disable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_disable(ESB_DPPIC, channels_mask); nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_ADDRESS); nrf_timer_publish_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0); @@ -162,13 +180,13 @@ void esb_ppi_for_wait_for_rx_set(void) { uint32_t channels_mask; - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_END, radio_end_timer_start); + nrf_radio_publish_set(NRF_RADIO, ESB_RADIO_EVENT_END, radio_end_timer_start); nrf_timer_subscribe_set(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START, radio_end_timer_start); channels_mask = (BIT(radio_end_timer_start)); - nrf_dppi_channels_enable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_enable(ESB_DPPIC, channels_mask); } void esb_ppi_for_wait_for_rx_clear(void) @@ -177,21 +195,36 @@ void esb_ppi_for_wait_for_rx_clear(void) channels_mask = (BIT(radio_end_timer_start)); - nrf_dppi_channels_disable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_disable(ESB_DPPIC, channels_mask); - nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_END); + nrf_radio_publish_clear(NRF_RADIO, ESB_RADIO_EVENT_END); nrf_timer_subscribe_clear(ESB_NRF_TIMER_INSTANCE, NRF_TIMER_TASK_START); } uint32_t esb_ppi_radio_disabled_get(void) { - return disabled_egu; + return disabled_phy_end_egu; } int esb_ppi_init(void) { nrfx_err_t err; +#if defined(ESB_DPPI_FIXED) + + radio_address_timer_stop = ESB_DPPI_FIRST_FIXED_CHANNEL + 0; + timer_compare0_radio_disable = ESB_DPPI_FIRST_FIXED_CHANNEL + 1; + timer_compare1_radio_txen = ESB_DPPI_FIRST_FIXED_CHANNEL + 2; + disabled_phy_end_egu = ESB_DPPI_FIRST_FIXED_CHANNEL + 3; + egu_timer_start = ESB_DPPI_FIRST_FIXED_CHANNEL + 4; + egu_ramp_up = ESB_DPPI_FIRST_FIXED_CHANNEL + 5; + radio_end_timer_start = ESB_DPPI_FIRST_FIXED_CHANNEL + 6; + ramp_up_dppi_group = ESB_DPPI_FIRST_FIXED_GROUP + 0; + + ARG_UNUSED(err); + +#else + err = nrfx_dppi_channel_alloc(&radio_address_timer_stop); if (err != NRFX_SUCCESS) { goto error; @@ -207,7 +240,7 @@ int esb_ppi_init(void) goto error; } - err = nrfx_dppi_channel_alloc(&disabled_egu); + err = nrfx_dppi_channel_alloc(&disabled_phy_end_egu); if (err != NRFX_SUCCESS) { goto error; } @@ -235,20 +268,27 @@ int esb_ppi_init(void) return -ENODEV; } - nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED, disabled_egu); - nrf_dppi_channels_enable(NRF_DPPIC, BIT(disabled_egu)); +#endif /* defined(ESB_DPPI_FIXED) */ + + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_DISABLED, disabled_phy_end_egu); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_publish_set(NRF_RADIO, NRF_RADIO_EVENT_PHYEND, disabled_phy_end_egu); + } + nrf_dppi_channels_enable(ESB_DPPIC, BIT(disabled_phy_end_egu)); return 0; +#if !defined(ESB_DPPI_FIXED) error: LOG_ERR("gppi_channel_alloc failed with: %d\n", err); return -ENODEV; +#endif /* !defined(ESB_DPPI_FIXED) */ } void esb_ppi_disable_all(void) { uint32_t channels_mask = (BIT(egu_ramp_up) | - BIT(disabled_egu) | + BIT(disabled_phy_end_egu) | BIT(egu_timer_start) | BIT(radio_address_timer_stop) | BIT(timer_compare0_radio_disable) | @@ -256,15 +296,24 @@ void esb_ppi_disable_all(void) (IS_ENABLED(CONFIG_ESB_NEVER_DISABLE_TX) ? BIT(timer_compare1_radio_txen) : 0)); - nrf_dppi_channels_disable(NRF_DPPIC, channels_mask); + nrf_dppi_channels_disable(ESB_DPPIC, channels_mask); } void esb_ppi_deinit(void) { nrfx_err_t err; - nrf_dppi_channels_disable(NRF_DPPIC, BIT(disabled_egu)); + nrf_dppi_channels_disable(ESB_DPPIC, BIT(disabled_phy_end_egu)); nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_DISABLED); + if (IS_ENABLED(CONFIG_ESB_FAST_SWITCHING)) { + nrf_radio_publish_clear(NRF_RADIO, NRF_RADIO_EVENT_PHYEND); + } + +#if defined(ESB_DPPI_FIXED) + + ARG_UNUSED(err); + +#else err = nrfx_dppi_channel_free(radio_address_timer_stop); if (err != NRFX_SUCCESS) { @@ -281,7 +330,7 @@ void esb_ppi_deinit(void) goto error; } - err = nrfx_dppi_channel_free(disabled_egu); + err = nrfx_dppi_channel_free(disabled_phy_end_egu); if (err != NRFX_SUCCESS) { goto error; } @@ -308,9 +357,13 @@ void esb_ppi_deinit(void) goto error; } +#endif /* defined(ESB_DPPI_FIXED) */ + return; +#if !defined(ESB_DPPI_FIXED) /* Should not happen. */ error: __ASSERT(false, "Failed to free DPPI resources"); +#endif } diff --git a/subsys/esb/esb_peripherals.h b/subsys/esb/esb_peripherals.h index c7c8669fb9ba..a52e1fd67a04 100644 --- a/subsys/esb/esb_peripherals.h +++ b/subsys/esb/esb_peripherals.h @@ -16,13 +16,76 @@ extern "C" { #include -/** The ESB event IRQ number when running on an nRF5 device. */ -#define ESB_EVT_IRQ SWI0_IRQn -/** The handler for @ref ESB_EVT_IRQ when running on an nRF5 device. */ -#define ESB_EVT_IRQHandler SWI0_IRQHandler + +#if defined(CONFIG_SOC_SERIES_NRF54HX) + + /** The ESB EVT IRQ is using EGU on nRF54 devices. */ + #define ESB_EVT_IRQ_NUMBER EGU020_IRQn + #define ESB_EVT_USING_EGU 1 + + /** The ESB Radio interrupt number. */ + #define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn + + /** DPPIC instance used by ESB. */ + #define ESB_DPPIC NRF_DPPIC020 + + /** ESB EGU instance configuration. */ + #define ESB_EGU NRF_EGU020 + + /** Use end of packet send/received over the air for nRF54 devices. */ + #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_PHYEND + #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK + + #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_PHYEND_MASK + +#elif defined(CONFIG_SOC_SERIES_NRF54LX) + + /** The ESB EVT IRQ is using EGU on nRF54 devices. */ + #define ESB_EVT_IRQ_NUMBER EGU10_IRQn + #define ESB_EVT_USING_EGU 1 + + /** The ESB Radio interrupt number. */ + #define ESB_RADIO_IRQ_NUMBER RADIO_0_IRQn + + /** DPPIC instance used by ESB. */ + #define ESB_DPPIC NRF_DPPIC10 + + /** ESB EGU instance configuration. */ + #define ESB_EGU NRF_EGU10 + + /** Use end of packet send/received over the air for nRF54 devices. */ + #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_PHYEND + #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_PHYEND_DISABLE_MASK + + #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_PHYEND_MASK +#else + + /** The ESB event IRQ number when running on the nRF52 and nRF53 device. */ + #define ESB_EVT_IRQ_NUMBER SWI0_IRQn + + /** The ESB Radio interrupt number. */ + #define ESB_RADIO_IRQ_NUMBER RADIO_IRQn + + /** DPPIC instance used by ESB. */ + #define ESB_DPPIC NRF_DPPIC + + /** ESB EGU instance configuration. */ + #define ESB_EGU NRF_EGU0 + + /** nRF52 and nRF53 device has just one kind of end event. */ + #define ESB_RADIO_EVENT_END NRF_RADIO_EVENT_END + #define ESB_SHORT_DISABLE_MASK NRF_RADIO_SHORT_END_DISABLE_MASK + + #define ESB_RADIO_INT_END_MASK NRF_RADIO_INT_END_MASK + +#endif /** ESB timer instance number. */ +#if defined(CONFIG_ESB_SYS_TIMER_INSTANCE_LEADING_ZERO) +#define ESB_TIMER_INSTANCE_NO NRFX_CONCAT_2(0, CONFIG_ESB_SYS_TIMER_INSTANCE) +#else #define ESB_TIMER_INSTANCE_NO CONFIG_ESB_SYS_TIMER_INSTANCE +#endif #define ESB_TIMER_IRQ NRFX_CONCAT_3(TIMER, ESB_TIMER_INSTANCE_NO, _IRQn) #define ESB_TIMER_IRQ_HANDLER NRFX_CONCAT_3(nrfx_timer_, \ @@ -34,10 +97,18 @@ extern "C" { NRFX_CONCAT_2(NRF_TIMER, ESB_TIMER_INSTANCE_NO) /** ESB nrfx timer instance. */ -#define ESB_TIMER_INSTANCE NRFX_TIMER_INSTANCE(ESB_TIMER_INSTANCE_NO) +#define ESB_NRFX_TIMER_INSTANCE NRFX_TIMER_INSTANCE(ESB_TIMER_INSTANCE_NO) -/** ESB EGU instance, events and tasks configuration. */ -#define ESB_EGU NRF_EGU0 +#if !defined(CONFIG_NRFX_DPPI) +/** Use fixed DPPI channels and groups if nrfx_dppi is not available. */ +#define ESB_DPPI_FIXED +/** First fixed DPPI channel, total used channels: 7. */ +#define ESB_DPPI_FIRST_FIXED_CHANNEL 0 +/** First fixed DPPI group, total used groups: 1. */ +#define ESB_DPPI_FIRST_FIXED_GROUP 0 +#endif + +/** ESB EGU events and tasks configuration. */ #define ESB_EGU_EVENT NRF_EGU_EVENT_TRIGGERED6 #define ESB_EGU_TASK NRF_EGU_TASK_TRIGGER6 @@ -45,6 +116,11 @@ extern "C" { #define ESB_EGU_DPPI_EVENT NRF_EGU_EVENT_TRIGGERED7 #define ESB_EGU_DPPI_TASK NRF_EGU_TASK_TRIGGER7 +/** Use additional EGU channel if SWI0 is unavailable. */ +#define ESB_EGU_EVT_EVENT NRF_EGU_EVENT_TRIGGERED8 +#define ESB_EGU_EVT_TASK NRF_EGU_TASK_TRIGGER8 +#define ESB_EGU_EVT_INT NRF_EGU_INT_TRIGGERED8 + #ifdef __cplusplus } #endif diff --git a/subsys/esb/esb_ppi_api.h b/subsys/esb/esb_ppi_api.h index 4328012d52c5..e26c9f28ef63 100644 --- a/subsys/esb/esb_ppi_api.h +++ b/subsys/esb/esb_ppi_api.h @@ -35,6 +35,10 @@ extern "C" { * | * \----> self disable * + * if (fast_switching) + * 1 + * RADIO_PHYEND ---> RADIO_TASK_TXEN/RXEN + * * @param[in] rx Radio Rx mode, otherwise Tx mode. * @param[in] timer_start Indicates whether the timer is to be started on the EGU event. */ diff --git a/subsys/mgmt/suitfu/CMakeLists.txt b/subsys/mgmt/suitfu/CMakeLists.txt new file mode 100644 index 000000000000..0fbbe3aab783 --- /dev/null +++ b/subsys/mgmt/suitfu/CMakeLists.txt @@ -0,0 +1,28 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_include_directories( + include +) + +zephyr_library() + +if(CONFIG_SSF_SUIT_SERVICE_ENABLED) + zephyr_library_link_libraries(suit_utils) +endif() + +zephyr_library_sources( + src/suitfu_mgmt.c +) + + +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_SUIT 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 new file mode 100644 index 000000000000..29e5ee112544 --- /dev/null +++ b/subsys/mgmt/suitfu/Kconfig @@ -0,0 +1,93 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "SUIT-based Firmware Update Management" + +config MGMT_SUITFU + bool "Serial SUIT Firmware Update support" + depends on MCUMGR + depends on SSF_SUIT_SERVICE_ENABLED + depends on FLASH + depends on MCUMGR_SMP_LEGACY_RC_BEHAVIOUR + select MCUMGR_SMP_CBOR_MIN_DECODING_LEVEL_5 + select MCUMGR_SMP_CBOR_MIN_ENCODING_LEVEL_3 + + +config MGMT_SUITFU_TRIGGER_UPDATE_RESET_DELAY_MS + int "Delay between update trigger and the last firmware chunk, in ms" + default 100 + help + The delay allows the application to send the SMP response before the update is triggered. + +config MGMT_SUITFU_AUTO_REGISTER_HANDLERS + bool "Automatically register SUIT Firmware Update handlers during boot" + default y + help + Use MCUMGR_HANDLER_DEFINE to automatically register SUIT Firmware + Update handlers during boot. + +config MGMT_SUITFU_GRP_IMG + bool "SUIT over Application, software image management group" + default y + # The IMG MGMT group is substituted, not extended by the SUIT variant + depends on !MCUMGR_GRP_IMG + + +if MGMT_SUITFU_GRP_IMG + +config MGMT_SUITFU_IMAGE_NUMBER + int "Image number representing SUIT envelope" + default 0 + +endif # MGMT_SUITFU_GRP_IMG + + +config MGMT_SUITFU_GRP_SUIT + bool "Extended SUIT commands over USER group" + default n + +if MGMT_SUITFU_GRP_SUIT + +config MGMT_GROUP_ID_SUIT + int "SUIT Management Group ID" + default 66 + +config MGMT_SUITFU_GRP_SUIT_MFSTS_STATE + bool "Manifests state get" + default y + help + Gets information about UUIDs of manifests supported by the device + and selected attributes of installed manifests. + +config MGMT_SUITFU_GRP_SUIT_MFSTS_STATE_MFSTS_COUNT + int "Amount manifest entries for Manifests state get" + default 15 + help + Shall not be lower than amount of manifests supported by the device + +config MGMT_SUITFU_GRP_SUIT_CAND_ENV_UPLOAD + bool "Candidate envelope upload" + default y + +config MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH + bool "Candidate image fetch" + depends on SUIT_STREAM_FETCH_SOURCE_MGR + default y + +config MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH_TIMEOUT_MS + int "Inter-chunk timeout for image fetching, in ms" + default 5000 + + +endif # MGMT_SUITFU_GRP_SUIT + + +module=MGMT_SUITFU +module-dep=LOG +module-str=SUIT-based Firmware Update Management +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endmenu diff --git a/subsys/mgmt/suitfu/include/suitfu_mgmt.h b/subsys/mgmt/suitfu/include/suitfu_mgmt.h new file mode 100644 index 000000000000..1fd2ccc9e809 --- /dev/null +++ b/subsys/mgmt/suitfu/include/suitfu_mgmt.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUITFU_MGMT_H_ +#define SUITFU_MGMT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Registers the SUIT-based update management command group handler. + */ +void img_mgmt_register_group(void); + +/** + * @brief Unregisters the SUIT-based update management command group handler. + */ +void img_mgmt_unregister_group(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SUITFU_MGMT_H_ */ diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt.c b/subsys/mgmt/suitfu/src/suitfu_mgmt.c new file mode 100644 index 000000000000..a1a8801d1c18 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt.c @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include "suitfu_mgmt_priv.h" +#include + +#include +#include + +#include + +#include + +LOG_MODULE_REGISTER(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +#if (!(DT_NODE_EXISTS(DT_NODELABEL(dfu_partition)))) +#error DFU Partition not defined in devicetree +#endif + +#define FIXED_PARTITION_ERASE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), erase_block_size) +#define FIXED_PARTITION_WRITE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), write_block_size) + +#define DFU_PARTITION_LABEL dfu_partition +#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(DFU_PARTITION_LABEL) +#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_EB_SIZE FIXED_PARTITION_ERASE_BLOCK_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_WRITE_SIZE FIXED_PARTITION_WRITE_BLOCK_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) + +#define SYSTEM_UPDATE_WORKER_STACK_SIZE 2048 + +K_THREAD_STACK_DEFINE(system_update_stack_area, SYSTEM_UPDATE_WORKER_STACK_SIZE); + +struct system_update_work { + struct k_work_delayable work; + /* Other data to pass to the workqueue might go here */ +}; + +struct k_work_q system_update_work_queue; + +static void update_failure(void) +{ + if (suit_dfu_cleanup() < 0) { + LOG_ERR("Error while cleaning up the SUIT DFU module!"); + } +} + +static void schedule_system_update(struct k_work *item) +{ + int ret = suit_dfu_candidate_preprocess(); + + if (ret < 0) { + LOG_ERR("Envelope processing error"); + update_failure(); + return; + } + k_msleep(CONFIG_MGMT_SUITFU_TRIGGER_UPDATE_RESET_DELAY_MS); + + ret = suit_dfu_update_start(); + if (ret < 0) { + LOG_ERR("Failed to start firmware upgrade!"); + update_failure(); + return; + } +} + +int suitfu_mgmt_candidate_envelope_stored(size_t image_size) +{ + int rc = MGMT_ERR_EOK; + int ret = 0; + + ret = suit_dfu_candidate_envelope_stored(); + if (ret < 0) { + LOG_ERR("Envelope decoding error"); + update_failure(); + return MGMT_ERR_EBUSY; + } + + static struct system_update_work suw; + + LOG_INF("Schedule system reboot"); + k_work_init_delayable(&suw.work, schedule_system_update); + ret = k_work_schedule_for_queue(&system_update_work_queue, &suw.work, + K_MSEC(CONFIG_MGMT_SUITFU_TRIGGER_UPDATE_RESET_DELAY_MS)); + if (ret < 0) { + LOG_ERR("Unable to process the envelope"); + update_failure(); + rc = MGMT_ERR_EBUSY; + } + + return rc; +} + +int suitfu_mgmt_is_dfu_partition_ready(void) +{ + const struct device *fdev = DFU_PARTITION_DEVICE; + + if (!device_is_ready(fdev)) { + return MGMT_ERR_EBADSTATE; + } + + return MGMT_ERR_EOK; +} + +size_t suitfu_mgmt_get_dfu_partition_size(void) +{ + return DFU_PARTITION_SIZE; +} + +int suitfu_mgmt_erase_dfu_partition(size_t num_bytes) +{ + const struct device *fdev = DFU_PARTITION_DEVICE; + size_t erase_size = DIV_ROUND_UP(num_bytes, DFU_PARTITION_EB_SIZE) * DFU_PARTITION_EB_SIZE; + + if (erase_size > DFU_PARTITION_SIZE) { + return MGMT_ERR_ENOMEM; + } + + LOG_INF("Erasing %p - %p (%d bytes)", (void *)DFU_PARTITION_ADDRESS, + (void *)((size_t)DFU_PARTITION_ADDRESS + erase_size), erase_size); + + int rc = flash_erase(fdev, DFU_PARTITION_OFFSET, erase_size); + + if (rc < 0) { + return MGMT_ERR_EUNKNOWN; + } + + return MGMT_ERR_EOK; +} + +int suitfu_mgmt_write_dfu_image_data(unsigned int req_offset, const void *addr, unsigned int size, + bool flush) +{ + const struct device *fdev = DFU_PARTITION_DEVICE; + static uint8_t write_buf[DFU_PARTITION_WRITE_SIZE]; + static uint8_t buf_fill_level; + static size_t offset; + int err = 0; + + /* Allow to reset the write procedure if the offset is equal to zero. */ + if (req_offset == 0) { + buf_fill_level = 0; + offset = 0; + } + + LOG_DBG("Writing %d bytes (cache fill: %d)", size, buf_fill_level); + + /* Check if cache is continuous with the input buffer. */ + if ((offset + buf_fill_level) != req_offset) { + LOG_ERR("Write request corrupted. Last offset: %p requested " + "offset: %p", + (void *)(DFU_PARTITION_OFFSET + offset + buf_fill_level), + (void *)(DFU_PARTITION_OFFSET + req_offset)); + return MGMT_ERR_EUNKNOWN; + } + + /* Fill the write buffer to flush non-aligned bytes from the previous + * call. + */ + if (buf_fill_level) { + size_t len = sizeof(write_buf) - buf_fill_level; + + len = MIN(len, size); + memcpy(&write_buf[buf_fill_level], addr, len); + + buf_fill_level += len; + addr = ((uint8_t *)addr) + len; + size -= len; + + /* If write buffer is full - write it into the memory. */ + if (buf_fill_level == sizeof(write_buf)) { + LOG_DBG("Write continuous %d cache bytes (address: %p)", sizeof(write_buf), + (void *)(DFU_PARTITION_OFFSET + offset)); + err = flash_write(fdev, DFU_PARTITION_OFFSET + offset, write_buf, + sizeof(write_buf)); + + buf_fill_level = 0; + offset += sizeof(write_buf); + } + } + + /* Write aligned data directly from input buffer. */ + if ((err == 0) && (size >= sizeof(write_buf))) { + size_t write_size = ((size / sizeof(write_buf)) * sizeof(write_buf)); + + LOG_DBG("Write continuous %d image bytes (address: %p)", write_size, + (void *)(DFU_PARTITION_OFFSET + offset)); + err = flash_write(fdev, DFU_PARTITION_OFFSET + offset, addr, write_size); + + size -= write_size; + offset += write_size; + addr = ((uint8_t *)addr + write_size); + } + + LOG_DBG("Cache %d bytes (address: %p)", size, (void *)(DFU_PARTITION_OFFSET + offset)); + + /* Store remaining bytes into the write buffer. */ + if ((err == 0) && (size > 0)) { + memcpy(&write_buf[0], addr, size); + buf_fill_level += size; + } + + /* Flush buffer if requested. */ + if ((err == 0) && (flush) && (buf_fill_level > 0)) { + /* Do not leak information about the previous requests. */ + memset(&write_buf[buf_fill_level], 0xFF, sizeof(write_buf) - buf_fill_level); + + LOG_DBG("Flush %d bytes (address: %p)", sizeof(write_buf), + (void *)(DFU_PARTITION_OFFSET + offset)); + err = flash_write(fdev, DFU_PARTITION_OFFSET + offset, write_buf, + sizeof(write_buf)); + + buf_fill_level = 0; + offset += sizeof(write_buf); + } + + if (flush) { + const uint8_t *addr = DFU_PARTITION_ADDRESS; + + LOG_INF("Last Chunk Written"); + LOG_INF("Partition address: %p (size: 0x%x), data: %02X %02X " + "%02X " + "%02X ...", + (void *)addr, offset, addr[0], addr[1], addr[2], addr[3]); + } + + return (err == 0 ? MGMT_ERR_EOK : MGMT_ERR_EUNKNOWN); +} + +int suitfu_mgmt_init(void) +{ + k_work_queue_init(&system_update_work_queue); + 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); + return suit_dfu_initialize(); +} + +SYS_INIT(suitfu_mgmt_init, APPLICATION, 0); diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c new file mode 100644 index 000000000000..f7555b44ea24 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_img.c @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#include +#include +#include "suitfu_mgmt_priv.h" + +#include +LOG_MODULE_DECLARE(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +#include + +#define ENCODE_FLAG(zse, flag, value) (zcbor_tstr_put_lit(zse, flag) && zcbor_bool_put(zse, value)) + +/** Represents an individual upload request. */ +typedef struct { + uint32_t image; /* 0 by default. */ + size_t off; /* SIZE_MAX if unspecified. */ + size_t size; /* SIZE_MAX if unspecified. */ + struct zcbor_string img_data; + struct zcbor_string data_sha; + bool upgrade; /* Only allow greater version numbers. */ +} suitfu_mgmt_image_upload_req_t; + +static int suitfu_mgmt_img_upload(struct smp_streamer *ctx) +{ + zcbor_state_t *zsd = ctx->reader->zs; + zcbor_state_t *zse = ctx->writer->zs; + static size_t image_size; + static size_t offset_in_image; + + size_t decoded = 0; + suitfu_mgmt_image_upload_req_t req = { + .off = SIZE_MAX, + .size = SIZE_MAX, + .img_data = {0}, + .data_sha = {0}, + .upgrade = false, + .image = 0, + }; + + int rc = suitfu_mgmt_is_dfu_partition_ready(); + + if (rc != MGMT_ERR_EOK) { + LOG_ERR("DFU Partition in not ready"); + return rc; + } + + struct zcbor_map_decode_key_val image_upload_decode[] = { + ZCBOR_MAP_DECODE_KEY_VAL(image, zcbor_uint32_decode, &req.image), + ZCBOR_MAP_DECODE_KEY_VAL(data, zcbor_bstr_decode, &req.img_data), + ZCBOR_MAP_DECODE_KEY_VAL(len, zcbor_size_decode, &req.size), + ZCBOR_MAP_DECODE_KEY_VAL(off, zcbor_size_decode, &req.off), + ZCBOR_MAP_DECODE_KEY_VAL(sha, zcbor_bstr_decode, &req.data_sha), + ZCBOR_MAP_DECODE_KEY_VAL(upgrade, zcbor_bool_decode, &req.upgrade)}; + + if (zcbor_map_decode_bulk(zsd, image_upload_decode, ARRAY_SIZE(image_upload_decode), + &decoded) != 0) { + LOG_ERR("Decoding image upload request failed"); + return MGMT_ERR_EINVAL; + } + + if (req.off == 0) { + LOG_INF("New image transfer started (image number: %d)", req.image); + image_size = 0; + offset_in_image = 0; + + if (req.size == 0) { + LOG_ERR("Candidate image empty"); + return MGMT_ERR_EINVAL; + } + + if (req.image != CONFIG_MGMT_SUITFU_IMAGE_NUMBER) { + LOG_ERR("Incorrect image number"); + return MGMT_ERR_EACCESSDENIED; + } + + rc = suitfu_mgmt_erase_dfu_partition(req.size); + if (rc != MGMT_ERR_EOK) { + LOG_ERR("Erasing DFU partition failed"); + return rc; + } + + image_size = req.size; + } + + bool last = false; + + if (image_size == 0) { + LOG_ERR("No transfer in progress"); + return MGMT_ERR_EBADSTATE; + } + + if (req.off + req.img_data.len > image_size) { + LOG_ERR("Image boundaries reached"); + image_size = 0; + return MGMT_ERR_ENOMEM; + } + + if (req.off != offset_in_image) { + LOG_WRN("Wrong offset in image, expected: %p, received: %p", + (void *)offset_in_image, (void *)req.off); + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, MGMT_ERR_EUNKNOWN) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + } + + if ((req.off + req.img_data.len) == image_size) { + last = true; + } + + rc = suitfu_mgmt_write_dfu_image_data(req.off, req.img_data.value, req.img_data.len, last); + + if (rc == MGMT_ERR_EOK) { + + offset_in_image += req.img_data.len; + if (last) { + rc = suitfu_mgmt_candidate_envelope_stored(image_size); + image_size = 0; + } + } + + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, rc) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + + return MGMT_ERR_EMSGSIZE; +} + +static int suitfu_mgmt_img_state_read(struct smp_streamer *ctx) +{ + zcbor_state_t *zse = ctx->writer->zs; + char installed_vers_str[IMG_MGMT_VER_MAX_STR_LEN] = "<\?\?\?>"; + uint8_t hash[IMG_MGMT_HASH_LEN] = {0}; + struct zcbor_string zhash = {.value = hash, .len = IMG_MGMT_HASH_LEN}; + bool ok; + + /* Let's assume we have 1 'image' with slot 0 that represents installed + * envelope. + */ + ok = zcbor_tstr_put_lit(zse, "images") && zcbor_list_start_encode(zse, 2); + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED + unsigned int seq_num = 0; + int alg_id = 0; + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_root') */ + const suit_manifest_class_id_t manifest_class_id = {{0x3f, 0x6a, 0x3a, 0x4d, 0xcd, 0xfa, + 0x58, 0xc5, 0xac, 0xce, 0xf9, 0xf5, + 0x84, 0xc4, 0x11, 0x24}}; + suit_plat_mreg_t hash_mreg = {.mem = hash, .size = IMG_MGMT_HASH_LEN}; + + if (ok) { + /* Let's proceed installed envelope */ + int err = suit_get_installed_manifest_info( + (suit_manifest_class_id_t *)&manifest_class_id, &seq_num, NULL, NULL, + &alg_id, &hash_mreg); + if (err != 0) { + LOG_ERR("Unable to read the current manifest data: %d", err); + ok = false; + } + + zhash.value = hash_mreg.mem; + zhash.len = hash_mreg.size; + } + + if (ok) { + int err = snprintf(installed_vers_str, sizeof(installed_vers_str), "%d", seq_num); + + if (err < 0) { + LOG_ERR("Unable to create manifest version string: %d", err); + ok = false; + } + } +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + + if (ok) { + ok = zcbor_map_start_encode(zse, MAX_IMG_CHARACTERISTICS) && + zcbor_tstr_put_lit(zse, "slot") && zcbor_int32_put(zse, 0) && + zcbor_tstr_put_lit(zse, "version"); + LOG_DBG("Manifest slot encoded: %d", ok); + } + + if (ok) { + installed_vers_str[sizeof(installed_vers_str) - 1] = '\0'; + ok = zcbor_tstr_put_term(zse, installed_vers_str, sizeof(installed_vers_str)); + LOG_DBG("Manifest version encoded: %d", ok); + } + + if (ok) { + ok = zcbor_tstr_put_lit(zse, "hash") && zcbor_bstr_encode(zse, &zhash); + LOG_DBG("Manifest hash encoded: %d", ok); + } + + if (ok) { + ok = ENCODE_FLAG(zse, "bootable", 1) && ENCODE_FLAG(zse, "confirmed", 1) && + ENCODE_FLAG(zse, "active", 1) && ENCODE_FLAG(zse, "permanent", 1); + LOG_DBG("Manifest flags encoded: %d", ok); + } + + if (ok) { + ok = zcbor_map_end_encode(zse, MAX_IMG_CHARACTERISTICS); + LOG_DBG("Image map encoded: %d", ok); + } + + ok = ok && zcbor_list_end_encode(zse, 2); + + return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; +} + +static int suitfu_mgmt_img_erase(struct smp_streamer *ctx) +{ + int rc = suit_dfu_cleanup(); + + if (rc != 0) { + LOG_ERR("Erasing DFU partition failed"); + return MGMT_ERR_EBADSTATE; + } + + return MGMT_ERR_EOK; +} + +static const struct mgmt_handler img_mgmt_handlers[] = { + [IMG_MGMT_ID_STATE] = {.mh_read = suitfu_mgmt_img_state_read, .mh_write = NULL}, + [IMG_MGMT_ID_UPLOAD] = {.mh_read = NULL, .mh_write = suitfu_mgmt_img_upload}, + [IMG_MGMT_ID_ERASE] = {.mh_read = NULL, .mh_write = suitfu_mgmt_img_erase}, +}; + +static struct mgmt_group img_mgmt_group = { + .mg_handlers = (struct mgmt_handler *)img_mgmt_handlers, + .mg_handlers_count = ARRAY_SIZE(img_mgmt_handlers), + .mg_group_id = MGMT_GROUP_ID_IMAGE, +}; + +void img_mgmt_register_group(void) +{ + mgmt_register_group(&img_mgmt_group); +} + +void img_mgmt_unregister_group(void) +{ + mgmt_unregister_group(&img_mgmt_group); +} + +#ifdef CONFIG_MGMT_SUITFU_AUTO_REGISTER_HANDLERS +MCUMGR_HANDLER_DEFINE(suitfu_mgmt_img, img_mgmt_register_group); +#endif diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h b/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h new file mode 100644 index 000000000000..03d985fe59a6 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_priv.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUITFU_MGMT_PRIV_H_ +#define SUITFU_MGMT_PRIV_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define IMG_MGMT_VER_MAX_STR_LEN 32 +/* The value here sets how many "characteristics" that describe image is + * encoded into a map per each image (like bootable flags, and so on). + * This value is only used for zcbor to predict map size and map encoding + * and does not affect memory allocation. + * In case when more "characteristics" are added to image map then + * zcbor_map_end_encode may fail it this value does not get updated. + */ +#define MAX_IMG_CHARACTERISTICS 15 +#define IMG_MGMT_HASH_STR 48 +#define IMG_MGMT_HASH_LEN 64 /* SHA512 */ + +/* + * Command IDs for image management group. + */ +#define IMG_MGMT_ID_STATE 0 +#define IMG_MGMT_ID_UPLOAD 1 +#define IMG_MGMT_ID_FILE 2 +#define IMG_MGMT_ID_CORELIST 3 +#define IMG_MGMT_ID_CORELOAD 4 +#define IMG_MGMT_ID_ERASE 5 + +/* + * Command IDs for suit management group. + */ +#define SUIT_MGMT_ID_MANIFESTS_LIST 0 +#define SUIT_MGMT_ID_MANIFEST_STATE 1 +#define SUIT_MGMT_ID_ENVELOPE_UPLOAD 2 +#define SUIT_MGMT_ID_MISSING_IMAGE_STATE 3 +#define SUIT_MGMT_ID_MISSING_IMAGE_UPLOAD 4 + +/** + * @brief Verifies if the device associated to DFU partition is ready for use + * + * @return MGMT_ERR_EOK on success + * MGMT_ERR_EBADSTATE if the device is not ready for use + * + */ +int suitfu_mgmt_is_dfu_partition_ready(void); + +/** + * @brief Returns size of DFU partition, in bytes + * + */ +size_t suitfu_mgmt_get_dfu_partition_size(void); + +/** + * @brief Erases first num_bytes of DFU partition rounded up to the end of erase + * block size + * + * @return MGMT_ERR_EOK on success + * MGMT_ERR_ENOMEM if DFU partition is smaller than num_bytes + * MGMT_ERR_EUNKNOWN if erase operation has failed + */ +int suitfu_mgmt_erase_dfu_partition(size_t num_bytes); + +/** + * @brief Writes image chunk to DFU partition + * + * @return MGMT_ERR_EOK on success + * MGMT_ERR_EUNKNOWN if write operation has failed + */ +int suitfu_mgmt_write_dfu_image_data(unsigned int req_offset, const void *addr, unsigned int size, + bool flush); + +/** + * @brief Called once entire update candidate is written to DFU partition + * Implementation triggers further processing of the candidate + * + * @return MGMT_ERR_EOK on success + * MGMT_ERR_EBUSY on candidate processing error + */ +int suitfu_mgmt_candidate_envelope_stored(size_t image_size); + +/** + * @brief Process Manifests List Get Request + * + */ +int suitfu_mgmt_suit_manifests_list(struct smp_streamer *ctx); + +/** + * @brief Process Manifest State Get Request + * + */ +int suitfu_mgmt_suit_manifest_state_read(struct smp_streamer *ctx); + +/** + * @brief Process Candidate Envelope Upload Request + * + */ +int suitfu_mgmt_suit_envelope_upload(struct smp_streamer *ctx); + +/** + * @brief Initialization of Image Fetch functionality + * + */ +void suitfu_mgmt_suit_image_fetch_init(void); + +/** + * @brief Process Get Missing Image State Request. + * + * @note SMP Client sends that request periodically, + * getting requested image identifier (i.e. image name) + * as response + * + */ +int suitfu_mgmt_suit_missing_image_state_read(struct smp_streamer *ctx); + +/** + * @brief Process Image Upload Request + * + * @note Executed as result of Get Missing Image State Request. + * It delivers chunks of image requested by the device + * + */ +int suitfu_mgmt_suit_missing_image_upload(struct smp_streamer *ctx); + +/** + * @brief Returns SUIT bootloader info + * + */ +int suitfu_mgmt_suit_bootloader_info_read(struct smp_streamer *ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* __IMG_PRIV_H */ diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit.c new file mode 100644 index 000000000000..3ac1208a7500 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#include +#include +#include "suitfu_mgmt_priv.h" + +#include +LOG_MODULE_DECLARE(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +#define OS_MGMT_ID_BOOTLOADER_INFO 8 + +static const struct mgmt_handler suit_mgmt_handlers[] = { + +#ifdef CONFIG_MGMT_SUITFU_GRP_SUIT_MFSTS_STATE + [SUIT_MGMT_ID_MANIFESTS_LIST] = {.mh_read = suitfu_mgmt_suit_manifests_list, + .mh_write = NULL}, + + [SUIT_MGMT_ID_MANIFEST_STATE] = {.mh_read = suitfu_mgmt_suit_manifest_state_read, + .mh_write = NULL}, +#endif + +#ifdef CONFIG_MGMT_SUITFU_GRP_SUIT_CAND_ENV_UPLOAD + [SUIT_MGMT_ID_ENVELOPE_UPLOAD] = {.mh_read = NULL, + .mh_write = suitfu_mgmt_suit_envelope_upload}, +#endif + +#ifdef CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH + [SUIT_MGMT_ID_MISSING_IMAGE_STATE] = {.mh_read = suitfu_mgmt_suit_missing_image_state_read, + .mh_write = NULL}, + [SUIT_MGMT_ID_MISSING_IMAGE_UPLOAD] = {.mh_read = NULL, + .mh_write = suitfu_mgmt_suit_missing_image_upload}, +#endif +}; + +static const struct mgmt_handler suit_mgmt_os_handlers[] = { + [OS_MGMT_ID_BOOTLOADER_INFO] = {.mh_read = suitfu_mgmt_suit_bootloader_info_read, + .mh_write = NULL}, +}; + +static struct mgmt_group suit_mgmt_group = { + .mg_handlers = (struct mgmt_handler *)suit_mgmt_handlers, + .mg_handlers_count = ARRAY_SIZE(suit_mgmt_handlers), + .mg_group_id = CONFIG_MGMT_GROUP_ID_SUIT, +}; + +static struct mgmt_group suit_mgmt_os_group = { + .mg_handlers = (struct mgmt_handler *)suit_mgmt_os_handlers, + .mg_handlers_count = ARRAY_SIZE(suit_mgmt_os_handlers), + .mg_group_id = MGMT_GROUP_ID_OS, +}; + +void suit_mgmt_register_group(void) +{ +#ifdef CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH + suitfu_mgmt_suit_image_fetch_init(); +#endif + mgmt_register_group(&suit_mgmt_group); + mgmt_register_group(&suit_mgmt_os_group); +} + +void suit_mgmt_unregister_group(void) +{ + mgmt_unregister_group(&suit_mgmt_group); + mgmt_unregister_group(&suit_mgmt_os_group); +} + +#ifdef CONFIG_MGMT_SUITFU_AUTO_REGISTER_HANDLERS +MCUMGR_HANDLER_DEFINE(suitfu_mgmt_suit, suit_mgmt_register_group); +#endif diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_cand_env_upload.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_cand_env_upload.c new file mode 100644 index 000000000000..ef90e9023ecc --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_cand_env_upload.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#include +#include +#include "suitfu_mgmt_priv.h" + +#include +LOG_MODULE_DECLARE(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +/** Represents an individual upload request. */ +typedef struct { + size_t off; /* SIZE_MAX if unspecified. */ + size_t size; /* SIZE_MAX if unspecified. */ + struct zcbor_string img_data; +} suitfu_mgmt_envelope_upload_req_t; + +int suitfu_mgmt_suit_envelope_upload(struct smp_streamer *ctx) +{ + zcbor_state_t *zsd = ctx->reader->zs; + zcbor_state_t *zse = ctx->writer->zs; + static size_t image_size; + static size_t offset_in_image; + + size_t decoded = 0; + suitfu_mgmt_envelope_upload_req_t req = { + .off = SIZE_MAX, + .size = SIZE_MAX, + .img_data = {0}, + }; + + int rc = suitfu_mgmt_is_dfu_partition_ready(); + + if (rc != MGMT_ERR_EOK) { + LOG_ERR("DFU Partition in not ready"); + return rc; + } + + struct zcbor_map_decode_key_val envelope_upload_decode[] = { + ZCBOR_MAP_DECODE_KEY_VAL(data, zcbor_bstr_decode, &req.img_data), + ZCBOR_MAP_DECODE_KEY_VAL(len, zcbor_size_decode, &req.size), + ZCBOR_MAP_DECODE_KEY_VAL(off, zcbor_size_decode, &req.off)}; + + if (zcbor_map_decode_bulk(zsd, envelope_upload_decode, ARRAY_SIZE(envelope_upload_decode), + &decoded) != 0) { + LOG_ERR("Decoding envelope upload request failed"); + return MGMT_ERR_EINVAL; + } + + if (req.off == 0) { + LOG_INF("New envelope transfer started"); + image_size = 0; + offset_in_image = 0; + + if (req.size == 0) { + LOG_ERR("Candidate envelope empty"); + return MGMT_ERR_EINVAL; + } + + rc = suitfu_mgmt_erase_dfu_partition(req.size); + if (rc != MGMT_ERR_EOK) { + LOG_ERR("Erasing DFU partition failed"); + return rc; + } + + image_size = req.size; + } + + bool last = false; + + if (image_size == 0) { + LOG_ERR("No transfer in progress"); + return MGMT_ERR_EBADSTATE; + } + + if (req.off + req.img_data.len > image_size) { + LOG_ERR("Image boundaries reached"); + image_size = 0; + return MGMT_ERR_ENOMEM; + } + + if (req.off != offset_in_image) { + LOG_WRN("Wrong offset in image, expected: %p, received: %p", + (void *)offset_in_image, (void *)req.off); + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, MGMT_ERR_EUNKNOWN) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + } + + if ((req.off + req.img_data.len) == image_size) { + last = true; + } + + rc = suitfu_mgmt_write_dfu_image_data(req.off, req.img_data.value, req.img_data.len, last); + + if (rc == MGMT_ERR_EOK) { + + req.off += req.img_data.len; + offset_in_image += req.img_data.len; + if (last) { + rc = suitfu_mgmt_candidate_envelope_stored(image_size); + image_size = 0; + } + } + + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, rc) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + + return MGMT_ERR_EMSGSIZE; +} diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_image_fetch.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_image_fetch.c new file mode 100644 index 000000000000..14832c19debd --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_image_fetch.c @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#include "dfu/suit_dfu_fetch_source.h" + +#include +#include +#include "suitfu_mgmt_priv.h" + +#include +LOG_MODULE_DECLARE(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +static K_MUTEX_DEFINE(component_state_mutex); +static K_CONDVAR_DEFINE(transfer_completed_cvar); + +static inline void component_lock(void) +{ + k_mutex_lock(&component_state_mutex, K_FOREVER); +} + +static inline void component_unlock(void) +{ + k_mutex_unlock(&component_state_mutex); +} + +typedef struct { + + const uint8_t *uri; + size_t uri_length; + uint32_t session_id; + uint32_t fetch_src_session_id; + + int64_t last_notify_ts; + suit_plat_err_t return_code; + struct k_condvar *transfer_completed_cvar; + +} stream_session_t; + +static stream_session_t stream_session; + +static suit_plat_err_t suitfu_mgmt_suit_missing_image_request(const uint8_t *uri, size_t uri_length, + uint32_t session_id) +{ + static uint32_t last_session_id; + stream_session_t *session = &stream_session; + int64_t current_ts = k_uptime_get(); + + LOG_INF("Request for image: %s", uri); + + if (strncmp(uri, "file://", strlen("file://"))) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + component_lock(); + if (session->uri) { + /* Seems that there is a streaming in progress + */ + component_unlock(); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + last_session_id++; + if (last_session_id == 0) { + last_session_id++; + } + + session->uri = uri; + session->uri_length = uri_length; + session->session_id = last_session_id; + session->fetch_src_session_id = session_id; + session->last_notify_ts = current_ts; + session->return_code = SUIT_PLAT_ERR_TIME; + session->transfer_completed_cvar = &transfer_completed_cvar; + + while (true) { + /* Looping till timeout or transfer completion + */ + uint32_t sleep_period_ms = session->last_notify_ts + + CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH_TIMEOUT_MS - + current_ts; + + k_condvar_wait(&transfer_completed_cvar, &component_state_mutex, + K_MSEC(sleep_period_ms)); + + current_ts = k_uptime_get(); + + if (current_ts - session->last_notify_ts >= + CONFIG_MGMT_SUITFU_GRP_SUIT_IMAGE_FETCH_TIMEOUT_MS || + session->return_code != SUIT_PLAT_ERR_TIME) { + break; + } + } + + /* Cleanup + */ + int rc = session->return_code; + + session->uri = NULL; + session->uri_length = 0; + session->session_id = 0; + session->fetch_src_session_id = 0; + session->last_notify_ts = 0; + session->return_code = SUIT_PLAT_SUCCESS; + session->transfer_completed_cvar = NULL; + + component_unlock(); + + return rc; +} + +/** Represents an individual upload request. */ +typedef struct { + uint32_t stream_session_id; + size_t off; /* SIZE_MAX if unspecified. */ + size_t size; /* SIZE_MAX if unspecified. */ + struct zcbor_string img_data; +} suitfu_mgmt_missing_img_upload_req_t; + +int suitfu_mgmt_suit_missing_image_upload(struct smp_streamer *ctx) +{ + stream_session_t *session = &stream_session; + zcbor_state_t *zsd = ctx->reader->zs; + zcbor_state_t *zse = ctx->writer->zs; + static size_t image_size; + static size_t offset_in_image; + + size_t decoded = 0; + suitfu_mgmt_missing_img_upload_req_t req = { + .stream_session_id = 0, + .off = SIZE_MAX, + .size = SIZE_MAX, + .img_data = {0}, + }; + + int rc = 0; + + struct zcbor_map_decode_key_val image_upload_decode[] = { + + ZCBOR_MAP_DECODE_KEY_VAL(stream_session_id, zcbor_uint32_decode, + &req.stream_session_id), + ZCBOR_MAP_DECODE_KEY_VAL(data, zcbor_bstr_decode, &req.img_data), + ZCBOR_MAP_DECODE_KEY_VAL(len, zcbor_size_decode, &req.size), + ZCBOR_MAP_DECODE_KEY_VAL(off, zcbor_size_decode, &req.off)}; + + if (zcbor_map_decode_bulk(zsd, image_upload_decode, ARRAY_SIZE(image_upload_decode), + &decoded) != 0) { + LOG_ERR("Decoding image upload request failed"); + return MGMT_ERR_EINVAL; + } + + if (req.off == 0) { + LOG_INF("New image transfer started, stream_session_id: %d", req.stream_session_id); + image_size = 0; + offset_in_image = 0; + + if (req.size == 0) { + LOG_ERR("Candidate image empty"); + return MGMT_ERR_EINVAL; + } + + image_size = req.size; + } + + if (image_size == 0) { + LOG_ERR("No transfer in progress"); + return MGMT_ERR_EBADSTATE; + } + + if (req.off + req.img_data.len > image_size) { + LOG_ERR("Image boundaries reached"); + image_size = 0; + return MGMT_ERR_ENOMEM; + } + + if (req.off != offset_in_image) { + LOG_WRN("Wrong offset in image, expected: %p, received: %p", + (void *)offset_in_image, (void *)req.off); + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, MGMT_ERR_EUNKNOWN) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + } + + bool last = false; + + if ((req.off + req.img_data.len) == image_size) { + last = true; + } + + size_t chunk_size = req.img_data.len; + + component_lock(); + if (session->transfer_completed_cvar && session->uri && session->uri_length && + session->session_id == req.stream_session_id) { + + session->last_notify_ts = k_uptime_get(); + + component_unlock(); + } else { + component_unlock(); + return MGMT_ERR_EBADSTATE; + } + + rc = suit_dfu_fetch_source_seek(session->fetch_src_session_id, req.off); + + if (rc == 0) { + rc = suit_dfu_fetch_source_write_fetched_data(session->fetch_src_session_id, + req.img_data.value, chunk_size); + } + + if (rc == 0) { + offset_in_image += req.img_data.len; + } + + component_lock(); + if (session->transfer_completed_cvar && session->uri && session->uri_length && + session->session_id == req.stream_session_id) { + if (rc != 0) { + session->return_code = SUIT_PLAT_ERR_IO; + k_condvar_signal(session->transfer_completed_cvar); + component_unlock(); + image_size = 0; + return MGMT_ERR_EUNKNOWN; + } + + if (last) { + session->return_code = SUIT_PLAT_SUCCESS; + k_condvar_signal(session->transfer_completed_cvar); + } + + component_unlock(); + + } else { + component_unlock(); + image_size = 0; + return MGMT_ERR_EBADSTATE; + } + + rc = MGMT_ERR_EOK; + if (zcbor_tstr_put_lit(zse, "rc") && zcbor_int32_put(zse, rc) && + zcbor_tstr_put_lit(zse, "off") && zcbor_size_put(zse, offset_in_image)) { + return MGMT_ERR_EOK; + } + + return MGMT_ERR_EMSGSIZE; +} + +int suitfu_mgmt_suit_missing_image_state_read(struct smp_streamer *ctx) +{ + stream_session_t *session = &stream_session; + zcbor_state_t *zse = ctx->writer->zs; + bool ok; + struct zcbor_string zcs; + + component_lock(); + if (session->uri && session->uri_length) { + ok = zcbor_tstr_put_lit(zse, "stream_session_id") && + zcbor_uint32_put(zse, session->session_id); + if (!ok) { + component_unlock(); + return MGMT_ERR_EMSGSIZE; + } + + zcs.value = session->uri; + zcs.len = session->uri_length; + ok = zcbor_tstr_put_lit(zse, "resource_id") && zcbor_bstr_encode(zse, &zcs); + if (!ok) { + component_unlock(); + return MGMT_ERR_EMSGSIZE; + } + } + component_unlock(); + + return MGMT_ERR_EOK; +} + +void suitfu_mgmt_suit_image_fetch_init(void) +{ + suit_dfu_fetch_source_register(suitfu_mgmt_suit_missing_image_request); +} diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_mfsts_state.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_mfsts_state.c new file mode 100644 index 000000000000..89fd4ee84915 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_mfsts_state.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +#include +#include +#include "suitfu_mgmt_priv.h" + +#include +LOG_MODULE_DECLARE(suitfu_mgmt, CONFIG_MGMT_SUITFU_LOG_LEVEL); + +int suitfu_mgmt_suit_manifests_list(struct smp_streamer *ctx) +{ + zcbor_state_t *zse = ctx->writer->zs; + bool ok; + + suit_plat_err_t rc; + suit_manifest_role_t roles[CONFIG_MGMT_SUITFU_GRP_SUIT_MFSTS_STATE_MFSTS_COUNT] = {0}; + + size_t class_info_count = ARRAY_SIZE(roles); + + rc = suit_get_supported_manifest_roles(roles, &class_info_count); + if (rc != SUIT_PLAT_SUCCESS) { + return MGMT_ERR_EBADSTATE; + } + + ok = zcbor_tstr_put_lit(zse, "manifests") && zcbor_list_start_encode(zse, class_info_count); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + for (int mfst_idx = 0; mfst_idx < class_info_count; mfst_idx++) { + + ok = zcbor_map_start_encode(zse, 2); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "role") && zcbor_uint32_put(zse, roles[mfst_idx]); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_map_end_encode(zse, 2); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + } + + ok = zcbor_list_end_encode(zse, class_info_count); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + return MGMT_ERR_EOK; +} + +int suitfu_mgmt_suit_manifest_state_read(struct smp_streamer *ctx) +{ + zcbor_state_t *zsd = ctx->reader->zs; + zcbor_state_t *zse = ctx->writer->zs; + bool ok; + size_t decoded = 0; + struct zcbor_string zcs = {0}; + int rc = 0; + + suit_manifest_role_t role = 0; + suit_ssf_manifest_class_info_t class_info = {0}; + unsigned int seq_num = 0; + suit_semver_raw_t semver_raw = {0}; + suit_digest_status_t digest_status = SUIT_DIGEST_UNKNOWN; + int digest_alg_id = 0; + uint8_t digest_buf[IMG_MGMT_HASH_LEN] = {0}; + suit_plat_mreg_t digest; + + struct zcbor_map_decode_key_val manifest_state_read_decode[] = { + ZCBOR_MAP_DECODE_KEY_VAL(role, zcbor_int_decode, &role)}; + + if (zcbor_map_decode_bulk(zsd, manifest_state_read_decode, + ARRAY_SIZE(manifest_state_read_decode), &decoded) != 0) { + LOG_ERR("Decoding manifest state read request failed"); + return MGMT_ERR_EINVAL; + } + + rc = suit_get_supported_manifest_info(role, &class_info); + if (rc != SUIT_PLAT_SUCCESS) { + return MGMT_ERR_EBADSTATE; + } + + zcs.value = class_info.class_id.raw; + zcs.len = sizeof(class_info.class_id.raw); + + ok = zcbor_tstr_put_lit(zse, "class_id") && zcbor_bstr_encode(zse, &zcs); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + zcs.value = class_info.vendor_id.raw; + zcs.len = sizeof(class_info.vendor_id.raw); + + ok = zcbor_tstr_put_lit(zse, "vendor_id") && zcbor_bstr_encode(zse, &zcs); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "downgrade_prevention_policy") && + zcbor_uint32_put(zse, class_info.downgrade_prevention_policy); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "independent_updateability_policy") && + zcbor_uint32_put(zse, class_info.independent_updateability_policy); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "signature_verification_policy") && + zcbor_uint32_put(zse, class_info.signature_verification_policy); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + digest.mem = digest_buf; + digest.size = sizeof(digest_buf); + + rc = suit_get_installed_manifest_info(&class_info.class_id, &seq_num, &semver_raw, + &digest_status, &digest_alg_id, &digest); + + if (rc == SUIT_PLAT_SUCCESS) { + zcs.value = digest.mem; + zcs.len = digest.size; + + ok = zcbor_tstr_put_lit(zse, "digest") && zcbor_bstr_encode(zse, &zcs); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "digest_algorithm") && + zcbor_int32_put(zse, digest_alg_id); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "signature_check") && + zcbor_uint32_put(zse, digest_status); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + ok = zcbor_tstr_put_lit(zse, "sequence_number") && zcbor_uint32_put(zse, seq_num); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + if (semver_raw.len > 0 && semver_raw.len <= 5) { + + ok = zcbor_tstr_put_lit(zse, "semantic_version") && + zcbor_list_start_encode(zse, semver_raw.len); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + + for (size_t semver_idx = 0; semver_idx < semver_raw.len; semver_idx++) { + + ok = zcbor_int32_put(zse, semver_raw.raw[semver_idx]); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + } + + ok = zcbor_list_end_encode(zse, semver_raw.len); + if (!ok) { + return MGMT_ERR_EMSGSIZE; + } + } + } + + return MGMT_ERR_EOK; +} diff --git a/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c new file mode 100644 index 000000000000..cd2d1d3bf1b5 --- /dev/null +++ b/subsys/mgmt/suitfu/src/suitfu_mgmt_suit_os.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +#include +#include "suitfu_mgmt_priv.h" + +int suitfu_mgmt_suit_bootloader_info_read(struct smp_streamer *ctxt) +{ + 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; + } + + /* 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"); + } else { + return MGMT_ERR_ENOTSUP; + } + + return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE; +} diff --git a/subsys/mpsl/fem/CMakeLists.txt b/subsys/mpsl/fem/CMakeLists.txt index b02f85212a12..8ea692cc9db8 100644 --- a/subsys/mpsl/fem/CMakeLists.txt +++ b/subsys/mpsl/fem/CMakeLists.txt @@ -14,10 +14,15 @@ if (CONFIG_MPSL_FEM_NCS_SUPPORTED_FEM_USED) zephyr_library_include_directories_ifdef(CONFIG_MPSL_FEM common/include) zephyr_library_sources_ifdef(CONFIG_MPSL_FEM common/mpsl_fem_utils.c) + zephyr_library_sources_ifdef(CONFIG_MPSL_FEM_USE_TWIM_STUB common/nrfx_twim_stub.c) zephyr_library_sources_ifdef(CONFIG_MPSL_FEM_NRF21540_GPIO nrf21540_gpio/mpsl_fem_nrf21540_gpio.c) add_subdirectory_ifdef(CONFIG_MPSL_FEM_NRF21540_GPIO_SPI nrf21540_gpio_spi) zephyr_library_sources_ifdef(CONFIG_MPSL_FEM_SIMPLE_GPIO simple_gpio/mpsl_fem_simple_gpio.c) + + add_subdirectory_ifdef(CONFIG_MPSL_FEM_NRF2220 nrf2220) + + add_subdirectory_ifdef(CONFIG_MPSL_FEM_NRF2240 nrf2240) endif() diff --git a/subsys/mpsl/fem/Kconfig b/subsys/mpsl/fem/Kconfig index 8a1ff36ec5ed..7cf12057f1cb 100644 --- a/subsys/mpsl/fem/Kconfig +++ b/subsys/mpsl/fem/Kconfig @@ -6,6 +6,8 @@ DT_COMPAT_NORDIC_NRF21540_GPIO := nordic,nrf21540-fem DT_COMPAT_GENERIC_FEM_2_CTRL_PIN := generic-fem-two-ctrl-pins +DT_COMPAT_NORDIC_NRF2220 := nordic,nrf2220-fem +DT_COMPAT_NORDIC_NRF2240 := nordic,nrf2240-fem config MPSL_FEM_ANY_SUPPORT bool @@ -24,6 +26,24 @@ config MPSL_FEM_GENERIC_TWO_CTRL_PINS_SUPPORT bool default $(dt_nodelabel_has_compat,nrf_radio_fem,$(DT_COMPAT_GENERIC_FEM_2_CTRL_PIN)) +config MPSL_FEM_NRF2220_SUPPORT + bool + default $(dt_nodelabel_has_compat,nrf_radio_fem,$(DT_COMPAT_NORDIC_NRF2220)) + +config MPSL_FEM_NRF2220_TWI_SUPPORT + bool + depends on MPSL_FEM_NRF2220_SUPPORT + default $(dt_nodelabel_has_prop,nrf_radio_fem,twi-if) + +config MPSL_FEM_NRF2240_SUPPORT + bool + default $(dt_nodelabel_has_compat,nrf_radio_fem,$(DT_COMPAT_NORDIC_NRF2240)) + +config MPSL_FEM_NRF2240_TWI_SUPPORT + bool + depends on MPSL_FEM_NRF2240_SUPPORT + default $(dt_nodelabel_has_prop,nrf_radio_fem,twi-if) + config MPSL_FEM_NCS_SUPPORTED_FEM_USED bool default n @@ -96,6 +116,32 @@ config MPSL_FEM_SIMPLE_GPIO but is potentially compatible with other devices with the same control method. +config MPSL_FEM_NRF2220 + depends on MPSL_FEM_NRF2220_SUPPORT + select EXPERIMENTAL + select NRFX_GPIOTE + select NRFX_PPI if SOC_SERIES_NRF52X + select NRFX_DPPI if SOC_SERIES_NRF53X + select NRFX_TWIM0 if MPSL_FEM_NRF2220_TWI_SUPPORT + select PINCTRL + select MPSL_FEM_NCS_SUPPORTED_FEM_USED + bool "nRF2220 front-end module" + help + FEM device is nRF2220. + +config MPSL_FEM_NRF2240 + depends on MPSL_FEM_NRF2240_SUPPORT + select EXPERIMENTAL + select NRFX_GPIOTE + select NRFX_PPI if SOC_SERIES_NRF52X + select NRFX_DPPI if SOC_SERIES_NRF53X + select NRFX_TWIM0 if MPSL_FEM_NRF2240_TWI_SUPPORT + select PINCTRL + select MPSL_FEM_NCS_SUPPORTED_FEM_USED + bool "nRF2240 front-end module" + help + FEM device is nRF2240. + endchoice # MPSL_FEM_CHOICE if (MPSL_FEM_NRF21540_GPIO || MPSL_FEM_NRF21540_GPIO_SPI) && MPSL_FEM @@ -224,6 +270,20 @@ config MPSL_FEM_DEVICE_CONFIG_254 Device configuration 254 may be required to improve RX blocking, especially when an external LNA is present. +config MPSL_FEM_USE_TWIM_STUB + bool + depends on !NRFX_TWIM + depends on (MPSL_FEM_NRF2220 && !MPSL_FEM_NRF2220_TWI_SUPPORT) || \ + (MPSL_FEM_NRF2240 && !MPSL_FEM_NRF2240_TWI_SUPPORT) + default y + +config MPSL_FEM_INIT_PRIORITY + int "Init priority of the Front-End Module support code" + depends on MPSL_FEM + default 49 if (MPSL_FEM_NRF2220 && MPSL_FEM_NRF2220_TWI_SUPPORT) || \ + (MPSL_FEM_NRF2240 && MPSL_FEM_NRF2240_TWI_SUPPORT) + default KERNEL_INIT_PRIORITY_DEVICE + module=MPSL_FEM module-str=MPSL_FEM source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/subsys/mpsl/fem/common/nrfx_twim_stub.c b/subsys/mpsl/fem/common/nrfx_twim_stub.c new file mode 100644 index 000000000000..621152f1c88b --- /dev/null +++ b/subsys/mpsl/fem/common/nrfx_twim_stub.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "nrfx_twim.h" +#include + +nrfx_err_t nrfx_twim_init(nrfx_twim_t const *p_instance, + nrfx_twim_config_t const *p_config, + nrfx_twim_evt_handler_t event_handler, + void *p_context) +{ + ARG_UNUSED(p_instance); + ARG_UNUSED(p_config); + ARG_UNUSED(event_handler); + ARG_UNUSED(p_context); + + __ASSERT_NO_MSG(false); + + return NRFX_ERROR_NOT_SUPPORTED; +} + +void nrfx_twim_enable(nrfx_twim_t const *p_instance) +{ + ARG_UNUSED(p_instance); + + __ASSERT_NO_MSG(false); +} + +void nrfx_twim_disable(nrfx_twim_t const *p_instance) +{ + ARG_UNUSED(p_instance); + + __ASSERT_NO_MSG(false); +} + +nrfx_err_t nrfx_twim_xfer(nrfx_twim_t const *p_instance, + nrfx_twim_xfer_desc_t const *p_xfer_desc, + uint32_t flags) +{ + ARG_UNUSED(p_instance); + ARG_UNUSED(p_xfer_desc); + ARG_UNUSED(flags); + + __ASSERT_NO_MSG(false); + + return NRFX_ERROR_NOT_SUPPORTED; +} diff --git a/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c b/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c index 071895f5baf2..baf301ed15f5 100644 --- a/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c +++ b/subsys/mpsl/fem/nrf21540_gpio/mpsl_fem_nrf21540_gpio.c @@ -224,7 +224,7 @@ static int mpsl_fem_init(void) return fem_nrf21540_gpio_configure(); } -SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); +SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_MPSL_FEM_INIT_PRIORITY); #else /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ diff --git a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c index 06d6147f8739..ba4e26cf2e14 100644 --- a/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c +++ b/subsys/mpsl/fem/nrf21540_gpio_spi/mpsl_fem_nrf21540_gpio_spi.c @@ -291,6 +291,6 @@ static int mpsl_fem_init(void) return fem_nrf21540_gpio_spi_configure(); } -SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); +SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_MPSL_FEM_INIT_PRIORITY); #endif /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ diff --git a/subsys/mpsl/fem/nrf2220/CMakeLists.txt b/subsys/mpsl/fem/nrf2220/CMakeLists.txt new file mode 100644 index 000000000000..a52b2c04d873 --- /dev/null +++ b/subsys/mpsl/fem/nrf2220/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library_sources(mpsl_fem_nrf2220.c) diff --git a/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c new file mode 100644 index 000000000000..c966ca7c0874 --- /dev/null +++ b/subsys/mpsl/fem/nrf2220/mpsl_fem_nrf2220.c @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_MPSL_FEM_NRF2220) + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#if IS_ENABLED(CONFIG_HAS_HW_NRF_PPI) +#include +#elif IS_ENABLED(CONFIG_HAS_HW_NRF_DPPIC) +#include +#endif + +#include + +#if IS_ENABLED(CONFIG_PINCTRL) +#include +#endif + +#if !defined(CONFIG_PINCTRL) +#error "The nRF2220 driver must be used with CONFIG_PINCTRL! Set CONFIG_PINCTRL=y" +#endif + +#if defined(CONFIG_EARLY_CONSOLE) +#error "The nRF2220 driver cannot be used with CONFIG_EARLY_CONSOLE! \ + Set CONFIG_BOOT_BANNER=n, CONFIG_EARLY_CONSOLE=n" +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +#define MPSL_FEM_TWI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), twi_if) +#define MPSL_FEM_TWI_BUS DT_BUS(MPSL_FEM_TWI_IF) +#define MPSL_FEM_TWI_REG ((NRF_TWIM_Type *) DT_REG_ADDR(MPSL_FEM_TWI_BUS)) +#define MPSL_FEM_TWI_ADDR ((uint8_t) DT_REG_ADDR(MPSL_FEM_TWI_IF)) +#define MPSL_FEM_TWI_FREQ DT_PROP(MPSL_FEM_TWI_BUS, clock_frequency) +static nrfx_twim_t m_twim = NRFX_TWIM_INSTANCE(0); +#endif + +#define FEM_OUTPUT_POWER_DBM DT_PROP(DT_NODELABEL(nrf_radio_fem), output_power_dbm) + +#define PIN_NUM(node_id, prop, idx) NRF_GET_PIN(DT_PROP_BY_IDX(node_id, prop, idx)), +#define PIN_FUNC(node_id, prop, idx) NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx)), + +#define NRF2220_OUTPUT_POWER_DBM_MIN 7 +#define NRF2220_OUTPUT_POWER_DBM_MAX 14 + +BUILD_ASSERT( + (FEM_OUTPUT_POWER_DBM >= NRF2220_OUTPUT_POWER_DBM_MIN) && + (FEM_OUTPUT_POWER_DBM <= NRF2220_OUTPUT_POWER_DBM_MAX), + "Value of output-power-dbm property out of range."); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +#if DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) +static void fem_nrf2220_twi_init_regs_configure(mpsl_fem_nrf2220_interface_config_t *cfg) +{ + const int32_t fem_twi_init_regs[] = DT_PROP(MPSL_FEM_TWI_IF, init_regs); + + for (uint32_t i = 0; i < cfg->twi_regs_init_map.nb_regs; i++) { + cfg->twi_regs_init_map.p_regs[i].addr = (uint8_t)fem_twi_init_regs[2 * i]; + cfg->twi_regs_init_map.p_regs[i].val = (uint8_t)fem_twi_init_regs[2 * i + 1]; + } +} +#endif /* DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) */ + +static void fem_nrf2220_twi_configure(mpsl_fem_nrf2220_interface_config_t *cfg) +{ + cfg->twi_config = (mpsl_fem_twi_config_t) { + .p_twim = MPSL_FEM_TWI_REG, + .freq_hz = MPSL_FEM_TWI_FREQ, + .address = MPSL_FEM_TWI_ADDR, + }; + + static const uint8_t fem_twi_pin_nums[] = { + DT_FOREACH_CHILD_VARGS( + DT_PINCTRL_BY_NAME(MPSL_FEM_TWI_BUS, default, 0), + DT_FOREACH_PROP_ELEM, psels, PIN_NUM + ) + }; + + static const uint8_t fem_twi_pin_funcs[] = { + DT_FOREACH_CHILD_VARGS( + DT_PINCTRL_BY_NAME(MPSL_FEM_TWI_BUS, default, 0), + DT_FOREACH_PROP_ELEM, psels, PIN_FUNC + ) + }; + + for (size_t i = 0U; i < ARRAY_SIZE(fem_twi_pin_nums); i++) { + switch (fem_twi_pin_funcs[i]) { + case NRF_FUN_TWIM_SCL: + mpsl_fem_extended_pin_to_mpsl_fem_pin(fem_twi_pin_nums[i], + &cfg->twi_config.scl); + break; + case NRF_FUN_TWIM_SDA: + mpsl_fem_extended_pin_to_mpsl_fem_pin(fem_twi_pin_nums[i], + &cfg->twi_config.sda); + break; + default: + break; + } + } +} + +#else /* DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) */ + +static void fem_nrf2220_twi_configure_disabled(mpsl_fem_nrf2220_interface_config_t *cfg) +{ + cfg->twi_config.p_twim = NULL; +} +#endif /* DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) */ + +/* Required for testing only. */ +static uint8_t cs_gpiote_channel; +static uint8_t md_gpiote_channel; + +uint8_t nrf2220_cs_gpiote_channel_get(void) +{ + return cs_gpiote_channel; +} + +uint8_t nrf2220_md_gpiote_channel_get(void) +{ + return md_gpiote_channel; +} + +static int fem_nrf2220_configure(void) +{ + int err; + + const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), cs_gpios)); + if (nrfx_gpiote_channel_alloc(&cs_gpiote, &cs_gpiote_channel) != NRFX_SUCCESS) { + return -ENOMEM; + } + + const nrfx_gpiote_t md_gpiote = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), md_gpios)); + if (nrfx_gpiote_channel_alloc(&md_gpiote, &md_gpiote_channel) != NRFX_SUCCESS) { + return -ENOMEM; + } + + mpsl_fem_nrf2220_interface_config_t cfg = { + .fem_config = { + .output_power_dbm = FEM_OUTPUT_POWER_DBM, + .bypass_gain_db = DT_PROP(DT_NODELABEL(nrf_radio_fem), bypass_gain_db), + }, + .cs_pin_config = { + .gpio_pin = { + .p_port = MPSL_FEM_GPIO_PORT_REG(cs_gpios), + .port_no = MPSL_FEM_GPIO_PORT_NO(cs_gpios), + .port_pin = MPSL_FEM_GPIO_PIN_NO(cs_gpios), + }, + .enable = true, + .active_high = MPSL_FEM_GPIO_POLARITY_GET(cs_gpios), + .gpiote_ch_id = cs_gpiote_channel + }, + .md_pin_config = { + .gpio_pin = { + .p_port = MPSL_FEM_GPIO_PORT_REG(md_gpios), + .port_no = MPSL_FEM_GPIO_PORT_NO(md_gpios), + .port_pin = MPSL_FEM_GPIO_PIN_NO(md_gpios), + }, + .enable = true, + .active_high = MPSL_FEM_GPIO_POLARITY_GET(md_gpios), + .gpiote_ch_id = md_gpiote_channel + } + }; + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) + fem_nrf2220_twi_configure(&cfg); +#else + fem_nrf2220_twi_configure_disabled(&cfg); +#endif + +#if DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) + const int32_t fem_twi_init_regs[] = DT_PROP(MPSL_FEM_TWI_IF, init_regs); + const uint8_t nb_regs = ARRAY_SIZE(fem_twi_init_regs) / 2; + + BUILD_ASSERT(ARRAY_SIZE(fem_twi_init_regs) % 2 == 0, + "The number of specified nRF2220 TWI initialization registers to write differs from" + " the number of values specified for those registers."); + + mpsl_fem_twi_reg_val_t init_regs[nb_regs]; + + cfg.twi_regs_init_map.p_regs = init_regs; + cfg.twi_regs_init_map.nb_regs = nb_regs; + + fem_nrf2220_twi_init_regs_configure(&cfg); +#endif /* DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) */ + + IF_ENABLED(CONFIG_HAS_HW_NRF_PPI, + (err = mpsl_fem_utils_ppi_channel_alloc(cfg.ppi_channels, + ARRAY_SIZE(cfg.ppi_channels));)); + IF_ENABLED(CONFIG_HAS_HW_NRF_DPPIC, + (err = mpsl_fem_utils_ppi_channel_alloc(cfg.dppi_channels, + ARRAY_SIZE(cfg.dppi_channels));)); + if (err) { + return err; + } + + err = mpsl_fem_nrf2220_interface_config_set(&cfg); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) + nrfx_twim_uninit(&m_twim); +#endif + + return err; +} + +static int mpsl_fem_init(void) +{ + mpsl_fem_device_config_254_apply_set(IS_ENABLED(CONFIG_MPSL_FEM_DEVICE_CONFIG_254)); + + return fem_nrf2220_configure(); +} + +#if defined(CONFIG_I2C) && \ + DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +BUILD_ASSERT(CONFIG_MPSL_FEM_INIT_PRIORITY < CONFIG_I2C_INIT_PRIORITY, + "The initialization of nRF2220 Front-End Module must happen before initialization of I2C"); +#endif + +SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_MPSL_FEM_INIT_PRIORITY); + +#endif /* defined(CONFIG_MPSL_FEM_NRF2220) */ diff --git a/subsys/mpsl/fem/nrf2240/CMakeLists.txt b/subsys/mpsl/fem/nrf2240/CMakeLists.txt new file mode 100644 index 000000000000..e771cc81585a --- /dev/null +++ b/subsys/mpsl/fem/nrf2240/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library_sources(mpsl_fem_nrf2240.c) diff --git a/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c new file mode 100644 index 000000000000..bff238205842 --- /dev/null +++ b/subsys/mpsl/fem/nrf2240/mpsl_fem_nrf2240.c @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_MPSL_FEM_NRF2240) + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#if IS_ENABLED(CONFIG_HAS_HW_NRF_PPI) +#include +#elif IS_ENABLED(CONFIG_HAS_HW_NRF_DPPIC) +#include +#endif + +#include + +#if IS_ENABLED(CONFIG_PINCTRL) +#include +#endif + +#if !defined(CONFIG_PINCTRL) +#error "The nRF2240 driver must be used with CONFIG_PINCTRL! Set CONFIG_PINCTRL=y" +#endif + +#if defined(CONFIG_EARLY_CONSOLE) +#error "The nRF2240 driver cannot be used with CONFIG_EARLY_CONSOLE! \ + Set CONFIG_BOOT_BANNER=n, CONFIG_EARLY_CONSOLE=n" +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +#define MPSL_FEM_TWI_IF DT_PHANDLE(DT_NODELABEL(nrf_radio_fem), twi_if) +#define MPSL_FEM_TWI_BUS DT_BUS(MPSL_FEM_TWI_IF) +#define MPSL_FEM_TWI_REG ((NRF_TWIM_Type *) DT_REG_ADDR(MPSL_FEM_TWI_BUS)) +#define MPSL_FEM_TWI_ADDR ((uint8_t) DT_REG_ADDR(MPSL_FEM_TWI_IF)) +#define MPSL_FEM_TWI_FREQ DT_PROP(MPSL_FEM_TWI_BUS, clock_frequency) +static nrfx_twim_t m_twim = NRFX_TWIM_INSTANCE(0); +#endif + +#define FEM_OUTPUT_POWER_DBM DT_PROP(DT_NODELABEL(nrf_radio_fem), output_power_dbm) +#define FEM_OUTPUT_POWER_ALT_DBM DT_PROP(DT_NODELABEL(nrf_radio_fem), output_power_alt_dbm) + +#define PIN_NUM(node_id, prop, idx) NRF_GET_PIN(DT_PROP_BY_IDX(node_id, prop, idx)), +#define PIN_FUNC(node_id, prop, idx) NRF_GET_FUN(DT_PROP_BY_IDX(node_id, prop, idx)), + +#define NRF2240_OUTPUT_POWER_DBM_MIN 7 +#define NRF2240_OUTPUT_POWER_DBM_MAX 21 + +BUILD_ASSERT( + (FEM_OUTPUT_POWER_DBM >= NRF2240_OUTPUT_POWER_DBM_MIN) && + (FEM_OUTPUT_POWER_DBM <= NRF2240_OUTPUT_POWER_DBM_MAX), + "Value of output-power-dbm property out of range."); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pwrmd_gpios) +BUILD_ASSERT( + (FEM_OUTPUT_POWER_ALT_DBM >= NRF2240_OUTPUT_POWER_DBM_MIN) && + (FEM_OUTPUT_POWER_ALT_DBM <= NRF2240_OUTPUT_POWER_DBM_MAX), + "Value of output-power-alt-dbm property out of range."); +#endif /* DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pwrmd_gpios) */ + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +#if DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) +static void fem_nrf2240_twi_init_regs_configure(mpsl_fem_nrf2240_interface_config_t *cfg) +{ + const int32_t fem_twi_init_regs[] = DT_PROP(MPSL_FEM_TWI_IF, init_regs); + + for (uint32_t i = 0; i < cfg->twi_regs_init_map.nb_regs; i++) { + cfg->twi_regs_init_map.p_regs[i].addr = (uint8_t)fem_twi_init_regs[2 * i]; + cfg->twi_regs_init_map.p_regs[i].val = (uint8_t)fem_twi_init_regs[2 * i + 1]; + } +} +#endif /* DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) */ + +static void fem_nrf2240_twi_configure(mpsl_fem_nrf2240_interface_config_t *cfg) +{ + cfg->twi_config = (mpsl_fem_twi_config_t) { + .p_twim = MPSL_FEM_TWI_REG, + .freq_hz = MPSL_FEM_TWI_FREQ, + .address = MPSL_FEM_TWI_ADDR, + }; + + static const uint8_t fem_twi_pin_nums[] = { + DT_FOREACH_CHILD_VARGS( + DT_PINCTRL_BY_NAME(MPSL_FEM_TWI_BUS, default, 0), + DT_FOREACH_PROP_ELEM, psels, PIN_NUM + ) + }; + + static const uint8_t fem_twi_pin_funcs[] = { + DT_FOREACH_CHILD_VARGS( + DT_PINCTRL_BY_NAME(MPSL_FEM_TWI_BUS, default, 0), + DT_FOREACH_PROP_ELEM, psels, PIN_FUNC + ) + }; + + for (size_t i = 0U; i < ARRAY_SIZE(fem_twi_pin_nums); i++) { + switch (fem_twi_pin_funcs[i]) { + case NRF_FUN_TWIM_SCL: + mpsl_fem_extended_pin_to_mpsl_fem_pin(fem_twi_pin_nums[i], + &cfg->twi_config.scl); + break; + case NRF_FUN_TWIM_SDA: + mpsl_fem_extended_pin_to_mpsl_fem_pin(fem_twi_pin_nums[i], + &cfg->twi_config.sda); + break; + default: + break; + } + } +} +#else /* DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) */ + +static void fem_nrf2240_twi_configure_disabled(mpsl_fem_nrf2240_interface_config_t *cfg) +{ + cfg->twi_config.p_twim = NULL; +} +#endif /* DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) */ + +/* Required for testing only. */ +static uint8_t cs_gpiote_channel; +static uint8_t md_gpiote_channel; + +uint8_t nrf2240_cs_gpiote_channel_get(void) +{ + return cs_gpiote_channel; +} + +uint8_t nrf2240_md_gpiote_channel_get(void) +{ + return md_gpiote_channel; +} + +static int fem_nrf2240_configure(void) +{ + int err; + + const nrfx_gpiote_t cs_gpiote = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), cs_gpios)); + if (nrfx_gpiote_channel_alloc(&cs_gpiote, &cs_gpiote_channel) != NRFX_SUCCESS) { + return -ENOMEM; + } + + const nrfx_gpiote_t md_gpiote = NRFX_GPIOTE_INSTANCE( + NRF_DT_GPIOTE_INST(DT_NODELABEL(nrf_radio_fem), md_gpios)); + if (nrfx_gpiote_channel_alloc(&md_gpiote, &md_gpiote_channel) != NRFX_SUCCESS) { + return -ENOMEM; + } + + mpsl_fem_nrf2240_interface_config_t cfg = { + .fem_config = { + .output_power_dbm = FEM_OUTPUT_POWER_DBM, +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pwrmd_gpios) + .output_power_alt_dbm = FEM_OUTPUT_POWER_ALT_DBM, +#else + .output_power_alt_dbm = FEM_OUTPUT_POWER_DBM, +#endif + .bypass_gain_db = DT_PROP(DT_NODELABEL(nrf_radio_fem), bypass_gain_db), + }, + .cs_pin_config = { + .gpio_pin = { + .p_port = MPSL_FEM_GPIO_PORT_REG(cs_gpios), + .port_no = MPSL_FEM_GPIO_PORT_NO(cs_gpios), + .port_pin = MPSL_FEM_GPIO_PIN_NO(cs_gpios), + }, + .enable = true, + .active_high = MPSL_FEM_GPIO_POLARITY_GET(cs_gpios), + .gpiote_ch_id = cs_gpiote_channel + }, + .md_pin_config = { + .gpio_pin = { + .p_port = MPSL_FEM_GPIO_PORT_REG(md_gpios), + .port_no = MPSL_FEM_GPIO_PORT_NO(md_gpios), + .port_pin = MPSL_FEM_GPIO_PIN_NO(md_gpios), + }, + .enable = true, + .active_high = MPSL_FEM_GPIO_POLARITY_GET(md_gpios), + .gpiote_ch_id = md_gpiote_channel + }, +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), pwrmd_gpios) + .pwrmd_pin_config = { + .gpio_pin = { + .p_port = MPSL_FEM_GPIO_PORT_REG(pwrmd_gpios), + .port_no = MPSL_FEM_GPIO_PORT_NO(pwrmd_gpios), + .port_pin = MPSL_FEM_GPIO_PIN_NO(pwrmd_gpios), + }, + .enable = true, + .active_high = MPSL_FEM_GPIO_POLARITY_GET(pwrmd_gpios), + } +#endif + }; + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) + fem_nrf2240_twi_configure(&cfg); +#else + fem_nrf2240_twi_configure_disabled(&cfg); +#endif + +#if DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) + const int32_t fem_twi_init_regs[] = DT_PROP(MPSL_FEM_TWI_IF, init_regs); + const uint8_t nb_regs = ARRAY_SIZE(fem_twi_init_regs) / 2; + + BUILD_ASSERT(ARRAY_SIZE(fem_twi_init_regs) % 2 == 0, + "The number of specified nRF2240 TWI initialization registers to write differs from" + " the number of values specified for those registers."); + + mpsl_fem_twi_reg_val_t init_regs[nb_regs]; + + cfg.twi_regs_init_map.p_regs = init_regs; + cfg.twi_regs_init_map.nb_regs = nb_regs; + + fem_nrf2240_twi_init_regs_configure(&cfg); +#endif /* DT_NODE_HAS_PROP(MPSL_FEM_TWI_IF, init_regs) */ + + IF_ENABLED(CONFIG_HAS_HW_NRF_PPI, + (err = mpsl_fem_utils_ppi_channel_alloc(cfg.ppi_channels, + ARRAY_SIZE(cfg.ppi_channels));)); + IF_ENABLED(CONFIG_HAS_HW_NRF_DPPIC, + (err = mpsl_fem_utils_ppi_channel_alloc(cfg.dppi_channels, + ARRAY_SIZE(cfg.dppi_channels));)); + if (err) { + return err; + } + + err = mpsl_fem_nrf2240_interface_config_set(&cfg); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) + nrfx_twim_uninit(&m_twim); +#endif + + return err; +} + +static int mpsl_fem_init(void) +{ + mpsl_fem_device_config_254_apply_set(IS_ENABLED(CONFIG_MPSL_FEM_DEVICE_CONFIG_254)); + + return fem_nrf2240_configure(); +} + +#if defined(CONFIG_I2C) && \ + DT_NODE_HAS_PROP(DT_NODELABEL(nrf_radio_fem), twi_if) +BUILD_ASSERT(CONFIG_MPSL_FEM_INIT_PRIORITY < CONFIG_I2C_INIT_PRIORITY, + "The initialization of nRF2240 Front-End Module must happen before initialization of I2C"); +#endif + +SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_MPSL_FEM_INIT_PRIORITY); + +#endif /* defined(CONFIG_MPSL_FEM_NRF2240) */ diff --git a/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c b/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c index afbea75a9880..2d2a50c29566 100644 --- a/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c +++ b/subsys/mpsl/fem/simple_gpio/mpsl_fem_simple_gpio.c @@ -140,7 +140,7 @@ static int mpsl_fem_init(void) return fem_simple_gpio_configure(); } -SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); +SYS_INIT(mpsl_fem_init, POST_KERNEL, CONFIG_MPSL_FEM_INIT_PRIORITY); #else /* !defined(CONFIG_MPSL_FEM_PIN_FORWARDER) */ diff --git a/subsys/mpsl/init/mpsl_init.c b/subsys/mpsl/init/mpsl_init.c index 7962d8776429..eb8813ef6b16 100644 --- a/subsys/mpsl/init/mpsl_init.c +++ b/subsys/mpsl/init/mpsl_init.c @@ -14,6 +14,7 @@ #include #include #include "multithreading_lock.h" +#include #if defined(CONFIG_NRFX_DPPI) #include #endif @@ -48,18 +49,22 @@ extern void rtc_pretick_rtc0_isr_hook(void); #define MPSL_RADIO_IRQn RADIO_IRQn #elif defined(CONFIG_SOC_SERIES_NRF54LX) #define MPSL_TIMER_IRQn TIMER10_IRQn -#define MPSL_RTC_IRQn GRTC_3_IRQn +#define MPSL_RTC_IRQn GRTC_3_IRQn #define MPSL_RADIO_IRQn RADIO_0_IRQn #elif defined(CONFIG_SOC_SERIES_NRF54HX) #define MPSL_TIMER_IRQn TIMER020_IRQn -#define MPSL_RTC_IRQn GRTC_0_IRQn /* non-secure GRTC IRQ. */ +#define MPSL_RTC_IRQn GRTC_2_IRQn #define MPSL_RADIO_IRQn RADIO_0_IRQn +#endif +#if defined(CONFIG_SOC_SERIES_NRF54HX) /* Basic build time sanity checking */ #define MPSL_RESERVED_GRTC_CHANNELS ((1U << 8) | (1U << 9) | (1U << 10) | (1U << 11) | (1U << 12)) -#define MPSL_RESERVED_DPPI_SOURCE_CHANNELS (1U << 0) -#define MPSL_RESERVED_DPPI_SINK_CHANNELS (1U << 0) -#define MPSL_RESERVED_IPCT_SOURCE_CHANNELS (1U << 0) +#elif defined(CONFIG_SOC_SERIES_NRF54LX) +#define MPSL_RESERVED_GRTC_CHANNELS ((1U << 7) | (1U << 8) | (1U << 9) | (1U << 10) | (1U << 11)) +#endif + +#if defined(CONFIG_SOC_SERIES_NRF54HX) || defined(CONFIG_SOC_SERIES_NRF54LX) BUILD_ASSERT(MPSL_RTC_IRQn != DT_IRQN(DT_NODELABEL(grtc)), "MPSL requires a dedicated GRTC IRQ"); @@ -72,10 +77,15 @@ BUILD_ASSERT(MPSL_RTC_IRQn != DT_IRQN(DT_NODELABEL(grtc)), "MPSL requires a dedi BUILD_ASSERT(MPSL_IRQ_IN_DT, "The MPSL GRTC IRQ is not in the device tree"); -BUILD_ASSERT((NRFX_CONFIG_GRTC_MASK_DT(child_owned_channels) & MPSL_RESERVED_GRTC_CHANNELS) == - MPSL_RESERVED_GRTC_CHANNELS, +BUILD_ASSERT((NRFX_CONFIG_MASK_DT(DT_NODELABEL(grtc), child_owned_channels) & + MPSL_RESERVED_GRTC_CHANNELS) == MPSL_RESERVED_GRTC_CHANNELS, "The GRTC channels used by MPSL must not be used by zephyr"); +#endif +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#define MPSL_RESERVED_IPCT_SOURCE_CHANNELS (1U << 0) +#define MPSL_RESERVED_DPPI_SOURCE_CHANNELS (1U << 0) +#define MPSL_RESERVED_DPPI_SINK_CHANNELS (1U << 0) /* check the GRTC source channels. * i.e. ensure something similar to this is present in the DT * &dppic132 { diff --git a/subsys/net/lib/aws_iot/src/aws_iot.c b/subsys/net/lib/aws_iot/src/aws_iot.c index 30aab6c1e00f..12a4570c5f81 100644 --- a/subsys/net/lib/aws_iot/src/aws_iot.c +++ b/subsys/net/lib/aws_iot/src/aws_iot.c @@ -126,6 +126,7 @@ static K_SEM_DEFINE(subs_acked_sem, 0, 1); * not included by default. */ extern void *memmem(const void *haystack, size_t hs_len, const void *needle, size_t ne_len); +extern size_t strnlen(const char *s, size_t maxlen); static char *strnstr(const char *haystack, const char *needle, size_t haystack_len) { if (!haystack || !needle) { diff --git a/subsys/net/lib/download_client/CMakeLists.txt b/subsys/net/lib/download_client/CMakeLists.txt index ee2fd3785683..81e303db5e3f 100644 --- a/subsys/net/lib/download_client/CMakeLists.txt +++ b/subsys/net/lib/download_client/CMakeLists.txt @@ -20,3 +20,5 @@ zephyr_library_sources_ifdef( CONFIG_DOWNLOAD_CLIENT_SHELL src/shell.c ) + +zephyr_include_directories(./include) diff --git a/subsys/net/lib/download_client/include/download_client_internal.h b/subsys/net/lib/download_client/include/download_client_internal.h new file mode 100644 index 000000000000..b6cd3b3d23a9 --- /dev/null +++ b/subsys/net/lib/download_client/include/download_client_internal.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DOWNLOAD_CLIENT_INTERNAL_H +#define DOWNLOAD_CLIENT_INTERNAL_H + +#include + +int url_parse_port(const char *url, uint16_t *port); +int url_parse_proto(const char *url, int *proto, int *type); +int url_parse_host(const char *url, char *host, size_t len); +int url_parse_file(const char *url, char *file, size_t len); +int http_parse(struct download_client *client, size_t len); +int http_get_request_send(struct download_client *client); + +int coap_block_init(struct download_client *client, size_t from); +int coap_get_recv_timeout(struct download_client *dl); +int coap_initiate_retransmission(struct download_client *dl); +int coap_parse(struct download_client *client, size_t len); +int coap_request_send(struct download_client *client); + +int socket_send(const struct download_client *client, size_t len, int timeout); + +#endif /* DOWNLOAD_CLIENT_INTERNAL_H */ diff --git a/subsys/net/lib/download_client/src/download_client.c b/subsys/net/lib/download_client/src/download_client.c index 006c4aa9cc8e..e4794ec15af2 100644 --- a/subsys/net/lib/download_client/src/download_client.c +++ b/subsys/net/lib/download_client/src/download_client.c @@ -22,6 +22,7 @@ #include #include #include +#include "download_client_internal.h" LOG_MODULE_REGISTER(download_client, CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL); @@ -30,19 +31,6 @@ LOG_MODULE_REGISTER(download_client, CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL); #define HOSTNAME_SIZE CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE -int url_parse_port(const char *url, uint16_t *port); -int url_parse_proto(const char *url, int *proto, int *type); -int url_parse_host(const char *url, char *host, size_t len); - -int http_parse(struct download_client *client, size_t len); -int http_get_request_send(struct download_client *client); - -int coap_block_init(struct download_client *client, size_t from); -int coap_get_recv_timeout(struct download_client *dl); -int coap_initiate_retransmission(struct download_client *dl); -int coap_parse(struct download_client *client, size_t len); -int coap_request_send(struct download_client *client); - static int handle_disconnect(struct download_client *client); static int error_evt_send(const struct download_client *dl, int error); @@ -264,7 +252,7 @@ static int host_lookup(const char *host, int family, uint8_t pdn_id, } if (err) { - LOG_WRN("Failed to resolve hostname %s on %s", + LOG_DBG("Failed to resolve hostname %s on %s", hostname, str_family(family)); return -EHOSTUNREACH; } @@ -381,11 +369,12 @@ static int client_socket_connect(struct download_client *dl, int type, uint16_t static int client_connect(struct download_client *dl) { int err; + int ns_err; int type; uint16_t port; err = url_parse_proto(dl->host, &dl->proto, &type); - if (err) { + if (err == -EINVAL) { LOG_DBG("Protocol not specified, defaulting to HTTP(S)"); type = SOCK_STREAM; if (dl->config.sec_tag_list && (dl->config.sec_tag_count > 0)) { @@ -393,6 +382,8 @@ static int client_connect(struct download_client *dl) } else { dl->proto = IPPROTO_TCP; } + } else if (err) { + goto cleanup; } if (dl->proto == IPPROTO_UDP || dl->proto == IPPROTO_DTLS_1_2) { @@ -441,20 +432,27 @@ static int client_connect(struct download_client *dl) type |= SOCK_NATIVE_TLS; } + err = -1; + ns_err = -1; + /* Attempt IPv6 connection if configured, fallback to IPv4 on error */ if ((dl->config.family == AF_UNSPEC) || (dl->config.family == AF_INET6)) { - err = host_lookup(dl->host, AF_INET6, dl->config.pdn_id, &dl->remote_addr); - if (!err) { + ns_err = host_lookup(dl->host, AF_INET6, dl->config.pdn_id, &dl->remote_addr); + if (!ns_err) { err = client_socket_connect(dl, type, port); } } if (((dl->config.family == AF_UNSPEC) && err) || (dl->config.family == AF_INET)) { - err = host_lookup(dl->host, AF_INET, dl->config.pdn_id, &dl->remote_addr); - if (!err) { + ns_err = host_lookup(dl->host, AF_INET, dl->config.pdn_id, &dl->remote_addr); + if (!ns_err) { err = client_socket_connect(dl, type, port); } } + if (ns_err) { + LOG_ERR("DNS lookup failed %s", dl->host); + err = ns_err; + } cleanup: if (err) { diff --git a/subsys/net/lib/download_client/src/http.c b/subsys/net/lib/download_client/src/http.c index 51645ced0e95..4445dd851b4e 100644 --- a/subsys/net/lib/download_client/src/http.c +++ b/subsys/net/lib/download_client/src/http.c @@ -11,6 +11,7 @@ #include #include #include +#include "download_client_internal.h" LOG_MODULE_DECLARE(download_client, CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL); @@ -42,10 +43,6 @@ LOG_MODULE_DECLARE(download_client, CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL); extern char *strnstr(const char *haystack, const char *needle, size_t haystack_sz); -int url_parse_host(const char *url, char *host, size_t len); -int url_parse_file(const char *url, char *file, size_t len); -int socket_send(const struct download_client *client, size_t len, int timeout); - int http_get_request_send(struct download_client *client) { int err; diff --git a/subsys/net/lib/download_client/src/parse.c b/subsys/net/lib/download_client/src/parse.c index 90ffc7477bd2..e38abe3178a0 100644 --- a/subsys/net/lib/download_client/src/parse.c +++ b/subsys/net/lib/download_client/src/parse.c @@ -25,18 +25,20 @@ static int swallow(const char **str, const char *swallow) int url_parse_proto(const char *url, int *proto, int *type) { - if (strncmp(url, "https", 5) == 0) { + if (strncmp(url, "https://", 8) == 0) { *proto = IPPROTO_TLS_1_2; *type = SOCK_STREAM; - } else if (strncmp(url, "http", 4) == 0) { + } else if (strncmp(url, "http://", 7) == 0) { *proto = IPPROTO_TCP; *type = SOCK_STREAM; - } else if (strncmp(url, "coaps", 5) == 0) { + } else if (strncmp(url, "coaps://", 8) == 0) { *proto = IPPROTO_DTLS_1_2; *type = SOCK_DGRAM; - } else if (strncmp(url, "coap", 4) == 0) { + } else if (strncmp(url, "coap://", 7) == 0) { *proto = IPPROTO_UDP; *type = SOCK_DGRAM; + } else if (strstr(url, "://")) { + return -EPROTONOSUPPORT; } else { return -EINVAL; } diff --git a/subsys/net/lib/fota_download/CMakeLists.txt b/subsys/net/lib/fota_download/CMakeLists.txt index bb4e152ab3fc..5f11d17efd40 100644 --- a/subsys/net/lib/fota_download/CMakeLists.txt +++ b/subsys/net/lib/fota_download/CMakeLists.txt @@ -28,3 +28,5 @@ zephyr_library_sources_ifdef(CONFIG_DFU_TARGET_SMP zephyr_include_directories(./include) zephyr_include_directories_ifdef(CONFIG_SECURE_BOOT ${ZEPHYR_NRF_MODULE_DIR}/subsys/dfu/include) +zephyr_include_directories_ifdef(CONFIG_DOWNLOAD_CLIENT + ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/include) diff --git a/subsys/net/lib/fota_download/src/util/fota_download_util.c b/subsys/net/lib/fota_download/src/util/fota_download_util.c index f96031518e9c..824af65e4f55 100644 --- a/subsys/net/lib/fota_download/src/util/fota_download_util.c +++ b/subsys/net/lib/fota_download/src/util/fota_download_util.c @@ -32,6 +32,8 @@ #include "fota_download_smp.h" #endif +#include "download_client_internal.h" + LOG_MODULE_REGISTER(fota_download_util, CONFIG_FOTA_DOWNLOAD_LOG_LEVEL); /** @@ -120,7 +122,7 @@ static void fota_download_callback(const struct fota_download_evt *evt) static int fota_download_client_url_parse(const char *uri, struct fota_download_client_url_data *parsed_uri) { - int len; + int len, err, proto, type; char *e, *s; len = strlen(uri); @@ -134,6 +136,12 @@ static int fota_download_client_url_parse(const char *uri, } s += strlen("://"); + /* Verify that download client knows the protocol */ + err = url_parse_proto(uri, &proto, &type); + if (err) { + return err; + } + /* Find the end of host name, which is start of path */ e = strchr(s, '/'); @@ -238,8 +246,9 @@ int fota_download_util_download_start(const char *download_uri, return -EBUSY; } - if (download_url_parse(download_uri, sec_tag)) { - return -EINVAL; + ret = download_url_parse(download_uri, sec_tag); + if (ret) { + return ret; } LOG_INF("Download Path %s host %s", fota_path, fota_host); diff --git a/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt b/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt index 4ce0eb646d4e..f938f4859559 100644 --- a/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt +++ b/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt @@ -31,3 +31,6 @@ zephyr_library_sources_ifdef(CONFIG_LWM2M_CLIENT_UTILS_WIFI_AP_SCANNER location/ zephyr_library_sources_ifdef(CONFIG_LWM2M_CLIENT_UTILS_VISIBLE_WIFI_AP_OBJ_SUPPORT lwm2m/visible_wifi_ap.c) zephyr_library_sources_ifdef(CONFIG_LWM2M_CLIENT_UTILS_LTE_CONNEVAL lwm2m/lwm2m_conneval.c) zephyr_include_directories(lwm2m/include) + +# For strnlen() +zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L) diff --git a/subsys/net/lib/lwm2m_client_utils/location/location_assistance.c b/subsys/net/lib/lwm2m_client_utils/location/location_assistance.c index 3d2a387cd56e..35da99741964 100644 --- a/subsys/net/lib/lwm2m_client_utils/location/location_assistance.c +++ b/subsys/net/lib/lwm2m_client_utils/location/location_assistance.c @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include - +#include "lwm2m_engine.h" #include "gnss_assistance_obj.h" #include "ground_fix_obj.h" #include "location_assistance.h" @@ -471,4 +471,4 @@ static int location_assistance_init(void) return 0; } -SYS_INIT(location_assistance_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +LWM2M_APP_INIT(location_assistance_init); diff --git a/subsys/net/lib/lwm2m_client_utils/location/location_wifi_ap_scanner.c b/subsys/net/lib/lwm2m_client_utils/location/location_wifi_ap_scanner.c index 3bbc013f10d1..9feedcb7aa80 100644 --- a/subsys/net/lib/lwm2m_client_utils/location/location_wifi_ap_scanner.c +++ b/subsys/net/lib/lwm2m_client_utils/location/location_wifi_ap_scanner.c @@ -18,6 +18,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include #include #include +#include "lwm2m_engine.h" #define VISIBLE_WIFI_AP_MAC_ADDRESS_ID 0 #define VISIBLE_WIFI_AP_CHANNEL_ID 1 @@ -134,4 +135,4 @@ static int lwm2m_wifi_scan_init(void) return 0; } -SYS_INIT(lwm2m_wifi_scan_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); +LWM2M_APP_INIT(lwm2m_wifi_scan_init); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/ecid_signal_meas_info.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/ecid_signal_meas_info.c index 0fc3034ba84e..e4337c743191 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/ecid_signal_meas_info.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/ecid_signal_meas_info.c @@ -231,4 +231,4 @@ static int lwm2m_signal_meas_info_init(void) return 0; } -SYS_INIT(lwm2m_signal_meas_info_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); +LWM2M_OBJ_INIT(lwm2m_signal_meas_info_init); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/gnss_assistance_obj.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/gnss_assistance_obj.c index a95ae704d49c..b0501550e9a9 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/gnss_assistance_obj.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/gnss_assistance_obj.c @@ -402,4 +402,4 @@ static int lwm2m_gnss_assist_init(void) return 0; } -SYS_INIT(lwm2m_gnss_assist_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +LWM2M_OBJ_INIT(lwm2m_gnss_assist_init); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/ground_fix_obj.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/ground_fix_obj.c index be1b5a4e5e27..50c1f1bfadbb 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/ground_fix_obj.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/ground_fix_obj.c @@ -17,6 +17,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include "lwm2m_engine.h" #include #include "ground_fix_obj.h" +#include "lwm2m_engine.h" #define GROUND_FIX_VERSION_MAJOR 1 #define GROUND_FIX_VERSION_MINOR 0 @@ -33,7 +34,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define LOCATION_LATITUDE_ID 0 #define LOCATION_LONGITUDE_ID 1 #define LOCATION_RADIUS_ID 3 - +#define LOCATION_TIMESTAMP_ID 5 static bool send_location_back; @@ -98,6 +99,12 @@ static int forward_to_location_obj(uint16_t obj_inst_id, switch (res_id) { case GROUND_FIX_LATITUDE: + if (IS_ENABLED(CONFIG_POSIX_CLOCK)) { + /* Update timestamp as well */ + lwm2m_set_time( + &LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LOCATION_TIMESTAMP_ID), + time(NULL)); + } path = LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID, 0, LOCATION_LATITUDE_ID); break; case GROUND_FIX_LONGITUDE: @@ -169,7 +176,7 @@ static int lwm2m_ground_fix_init(void) return 0; } -SYS_INIT(lwm2m_ground_fix_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +LWM2M_OBJ_INIT(lwm2m_ground_fix_init); void ground_fix_set_report_back(bool report_back) { diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_adv_firmware.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_adv_firmware.c index e9981a4a3fb2..d5508ddeb02f 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_adv_firmware.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_adv_firmware.c @@ -597,4 +597,4 @@ static int lwm2m_adv_firmware_init(void) return 0; } -SYS_INIT(lwm2m_adv_firmware_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +LWM2M_OBJ_INIT(lwm2m_adv_firmware_init); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_cellconn_obj.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_cellconn_obj.c index 8563012138d7..be194d6b9002 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_cellconn_obj.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_cellconn_obj.c @@ -150,22 +150,6 @@ static struct lwm2m_engine_obj_inst *cellconn_create(uint16_t obj_inst_id) return &inst; } -static int lwm2m_cellconn_init(void) -{ - cellconn.obj_id = LWM2M_OBJECT_CELLULAR_CONNECTIVITY_ID; - cellconn.version_major = CELLCONN_VERSION_MAJOR; - cellconn.version_minor = CELLCONN_VERSION_MINOR; - cellconn.is_core = false; - cellconn.fields = fields; - cellconn.field_count = ARRAY_SIZE(fields); - cellconn.max_instance_count = 1U; - cellconn.create_cb = cellconn_create; - lwm2m_register_obj(&cellconn); - - LOG_DBG("Init LwM2M cellular connectivity instance"); - return 0; -} - #define PSM_ONLY_MODE 1 #define EDRX_ONLY_MODE 2 #define PSM_AND_EDRX_MODE 3 @@ -564,8 +548,8 @@ static void edrx_update(struct lte_lc_edrx_cfg edrx_cfg) /* The eDRX value is a multiple of 10.24 seconds, except for the * special case of idx == 0 for LTE-M, where the value is 5.12 seconds. */ - if (edrx_cfg.edrx > 10.0) { - val = round(edrx_cfg.edrx / 10.24); + if (edrx_cfg.edrx > 10.0f) { + val = round(edrx_cfg.edrx / 10.24f); for (int i = 1; i < 16; i++) { if (val == multipliers[i]) { idx = i; @@ -578,10 +562,10 @@ static void edrx_update(struct lte_lc_edrx_cfg edrx_cfg) * [3GPP-TS_24.008, clause 10.5.5.32] */ if (edrx_cfg.mode == LTE_LC_LTE_MODE_LTEM) { - ptw = round(edrx_cfg.ptw / 1.28) - 1; + ptw = round(edrx_cfg.ptw / 1.28f) - 1; edrx = edrx_lookup_ltem[idx]; } else { - ptw = round(edrx_cfg.ptw / 2.56) - 1; + ptw = round(edrx_cfg.ptw / 2.56f) - 1; edrx = edrx_lookup_nbiot[idx]; } @@ -623,8 +607,8 @@ static void lte_event_handler(const struct lte_lc_evt *const evt) break; case LTE_LC_EVT_EDRX_UPDATE: LOG_DBG("LTE EDRX update: mode %s, edrx %.2f s, Paging time %.2f s", - (evt->edrx_cfg.mode == 7 ? "LTE" : "NBIOT"), evt->edrx_cfg.edrx, - evt->edrx_cfg.ptw); + (evt->edrx_cfg.mode == 7 ? "LTE" : "NBIOT"), + (double)evt->edrx_cfg.edrx, (double)evt->edrx_cfg.ptw); edrx_update(evt->edrx_cfg); break; case LTE_LC_EVT_LTE_MODE_UPDATE: @@ -643,7 +627,7 @@ static int lwm2m_lte_handler_register(void) return 0; } -int lwm2m_init_cellular_connectivity_object(void) +static int lwm2m_cellular_connectivity_init(void) { uint16_t data_len; uint8_t data_flags; @@ -697,4 +681,21 @@ int lwm2m_init_cellular_connectivity_object(void) return 0; } -SYS_INIT(lwm2m_cellconn_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +static int lwm2m_cellconn_obj_init(void) +{ + cellconn.obj_id = LWM2M_OBJECT_CELLULAR_CONNECTIVITY_ID; + cellconn.version_major = CELLCONN_VERSION_MAJOR; + cellconn.version_minor = CELLCONN_VERSION_MINOR; + cellconn.is_core = false; + cellconn.fields = fields; + cellconn.field_count = ARRAY_SIZE(fields); + cellconn.max_instance_count = 1U; + cellconn.create_cb = cellconn_create; + lwm2m_register_obj(&cellconn); + + LOG_DBG("Init LwM2M cellular connectivity object"); + return 0; +} + +LWM2M_OBJ_INIT(lwm2m_cellconn_obj_init); +LWM2M_APP_INIT(lwm2m_cellular_connectivity_init); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_connmon.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_connmon.c index dce5319ef68c..0977937d5bcb 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_connmon.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_connmon.c @@ -9,9 +9,9 @@ #include #include #include - #include #include +#include "lwm2m_engine.h" #include LOG_MODULE_REGISTER(lwm2m_connmon, CONFIG_LWM2M_CLIENT_UTILS_LOG_LEVEL); @@ -30,7 +30,8 @@ LOG_MODULE_REGISTER(lwm2m_connmon, CONFIG_LWM2M_CLIENT_UTILS_LOG_LEVEL); #define CONNMON_CELLID 8 #define CONNMON_SMNC 9 #define CONNMON_SMCC 10 -#if defined(CONFIG_LWM2M_CONNMON_OBJECT_VERSION_1_2) +#if defined(CONFIG_LWM2M_CONNMON_OBJECT_VERSION_1_2) || \ + defined(CONFIG_LWM2M_CONNMON_OBJECT_VERSION_1_3) #define CONNMON_SIGNAL_SNR 11 #define CONNMON_LAC 12 #endif @@ -106,7 +107,7 @@ static void modem_data_update(struct k_work *work) modem_param.network.mnc.value); lwm2m_set_u16(&LWM2M_OBJ(LWM2M_OBJECT_CONNECTIVITY_MONITORING_ID, 0, CONNMON_SMCC), modem_param.network.mcc.value); -#if defined(CONFIG_LWM2M_CONNMON_OBJECT_VERSION_1_2) +#if defined(CONNMON_LAC) lwm2m_set_u16(&LWM2M_OBJ(LWM2M_OBJECT_CONNECTIVITY_MONITORING_ID, 0, CONNMON_LAC), modem_param.network.area_code.value); #endif @@ -194,7 +195,7 @@ static void connmon_lte_notify_handler(const struct lte_lc_evt *const evt) } } -int lwm2m_init_connmon(void) +static int lwm2m_init_connmon_cb(void) { int ret; @@ -218,4 +219,4 @@ int lwm2m_init_connmon(void) return 0; } -SYS_INIT(lwm2m_init_connmon, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); +LWM2M_APP_INIT(lwm2m_init_connmon_cb); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_device.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_device.c index e26a4fc43a8d..c3f2cde63627 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_device.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_device.c @@ -9,7 +9,7 @@ #include #include #include - +#include "lwm2m_engine.h" #include LOG_MODULE_REGISTER(lwm2m_device, CONFIG_LWM2M_CLIENT_UTILS_LOG_LEVEL); @@ -45,7 +45,9 @@ int lwm2m_device_reboot_cb(uint16_t obj_inst_id, uint8_t *args, return k_work_schedule(&reboot_work, REBOOT_DELAY); } -int lwm2m_init_device(void) +static int lwm2m_init_reboot_cb(void) { return lwm2m_register_exec_callback(&LWM2M_OBJ(3, 0, 4), lwm2m_device_reboot_cb); } + +LWM2M_APP_INIT(lwm2m_init_reboot_cb); diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_firmware.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_firmware.c index 363b95e99b4e..07d87eedb0c5 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_firmware.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/lwm2m_firmware.c @@ -307,7 +307,7 @@ static int write_resource_to_settings(uint16_t inst, uint16_t res, uint8_t *data return 0; } -static int write_image_type_to_settings(uint16_t inst, uint16_t img_type) +static int write_image_type_to_settings(uint16_t inst, int img_type) { char path[SETTINGS_FIRM_PATH_LEN]; @@ -409,6 +409,9 @@ static int firmware_target_reset(uint16_t obj_inst_id) int dfu_image_type; dfu_image_type = target_image_type_get(obj_inst_id); + if (dfu_image_type == DFU_TARGET_IMAGE_TYPE_NONE) { + return 0; + } return fota_download_util_image_reset(dfu_image_type); } @@ -643,6 +646,7 @@ static int firmware_update_state(uint16_t obj_inst_id, uint16_t res_id, uint16_t if (ret < 0) { LOG_ERR("Failed to reset DFU target, err: %d", ret); } + target_image_type_store(obj_inst_id, DFU_TARGET_IMAGE_TYPE_NONE); init_firmware_variables(); } if (update_data.object_instance == obj_inst_id) { @@ -824,10 +828,9 @@ static void fota_download_callback(const struct fota_download_evt *evt) LOG_INF("FOTA download failed, target %d", dfu_image_type); target_image_type_store(ongoing_obj_id, dfu_image_type); switch (evt->cause) { - /* No error, used when event ID is not FOTA_DOWNLOAD_EVT_ERROR. */ - case FOTA_DOWNLOAD_ERROR_CAUSE_NO_ERROR: - set_result(ongoing_obj_id, RESULT_CONNECTION_LOST); - break; + /* Connecting to the FOTA server failed. */ + case FOTA_DOWNLOAD_ERROR_CAUSE_CONNECT_FAILED: + /* FALLTHROUGH */ /* Downloading the update failed. The download may be retried. */ case FOTA_DOWNLOAD_ERROR_CAUSE_DOWNLOAD_FAILED: set_result(ongoing_obj_id, RESULT_CONNECTION_LOST); @@ -891,6 +894,9 @@ static void lwm2m_start_download_image(uint8_t *data, uint16_t obj_instance) case -EINVAL: set_result(obj_instance, RESULT_INVALID_URI); break; + case -EPROTONOSUPPORT: + set_result(obj_instance, RESULT_UNSUP_PROTO); + break; case -EBUSY: /* Failed to init MCUBoot or download client */ set_result(obj_instance, RESULT_NO_STORAGE); @@ -943,10 +949,10 @@ static int write_dl_uri(uint16_t obj_inst_id, uint16_t res_id, uint16_t res_inst LOG_DBG("write URI: %s", package_uri); - state = get_state(obj_inst_id); + bool empty_uri = data_len == 0 || strnlen(data, data_len) == 0; - if (state == STATE_IDLE && data_len > 0) { + if (state == STATE_IDLE && !empty_uri) { set_state(obj_inst_id, STATE_DOWNLOADING); if (ongoing_obj_id == UNUSED_OBJ_ID) { @@ -957,7 +963,7 @@ static int write_dl_uri(uint16_t obj_inst_id, uint16_t res_id, uint16_t res_inst set_result(obj_inst_id, RESULT_ADV_CONFLICT_STATE); } } - } else if (data_len == 0) { + } else if (empty_uri) { if (ongoing_obj_id == UNUSED_OBJ_ID || ongoing_obj_id == obj_inst_id) { ongoing_obj_id = obj_inst_id; /* reset to state idle and result default */ @@ -1006,12 +1012,12 @@ static void lwm2m_firmware_object_pull_protocol_init(int instance_id) #endif } -static bool modem_has_credentials(int sec_tag) +static bool modem_has_credentials(int sec_tag, enum modem_key_mgmt_cred_type cred_type) { bool exist; int ret; - ret = modem_key_mgmt_exists(sec_tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN, &exist); + ret = modem_key_mgmt_exists(sec_tag, cred_type, &exist); if (ret < 0) { return false; } @@ -1028,12 +1034,22 @@ static void lwm2m_firware_pull_protocol_support_resource_init(int instance_id) lwm2m_firmware_object_pull_protocol_init(instance_id); } - if (modem_has_credentials(CONFIG_LWM2M_CLIENT_UTILS_DOWNLOADER_SEC_TAG)) { - /* Enable non-security & Security protocols for download client */ - supported_protocol_count = 4; + int tag = CONFIG_LWM2M_CLIENT_UTILS_DOWNLOADER_SEC_TAG; + + /* Check which protocols from pull_protocol_support[] may work. + * Order in that list is CoAP, HTTP, CoAPS, HTTPS. + * So unsecure protocols are first, those should always work. + */ + + if (modem_has_credentials(tag, MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN)) { + /* CA chain means that HTTPS and CoAPS might work, support all */ + supported_protocol_count = ARRAY_SIZE(pull_protocol_support); + } else if (modem_has_credentials(tag, MODEM_KEY_MGMT_CRED_TYPE_PSK)) { + /* PSK might work on CoAPS, not HTTPS. Drop it from the list */ + supported_protocol_count = ARRAY_SIZE(pull_protocol_support) - 1; } else { - /* Enable non-security protocols for download client */ - supported_protocol_count = 2; + /* Drop both secure protocols from list as we don't have credentials */ + supported_protocol_count = ARRAY_SIZE(pull_protocol_support) - 2; } for (int i = 0; i < supported_protocol_count; i++) { @@ -1294,10 +1310,6 @@ int lwm2m_init_firmware_cb(lwm2m_firmware_event_cb_t cb) return 0; } -int lwm2m_init_firmware(void) -{ - return lwm2m_init_firmware_cb(NULL); -} int lwm2m_init_image(void) { diff --git a/subsys/net/lib/lwm2m_client_utils/lwm2m/visible_wifi_ap.c b/subsys/net/lib/lwm2m_client_utils/lwm2m/visible_wifi_ap.c index 5b676e133e07..acdea0a41ba4 100644 --- a/subsys/net/lib/lwm2m_client_utils/lwm2m/visible_wifi_ap.c +++ b/subsys/net/lib/lwm2m_client_utils/lwm2m/visible_wifi_ap.c @@ -133,4 +133,4 @@ static int lwm2m_visible_wifi_ap_init(void) return 0; } -SYS_INIT(lwm2m_visible_wifi_ap_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +LWM2M_OBJ_INIT(lwm2m_visible_wifi_ap_init); diff --git a/subsys/net/lib/mqtt_helper/CMakeLists.txt b/subsys/net/lib/mqtt_helper/CMakeLists.txt index 2d0e483d7694..08068bf85e7a 100644 --- a/subsys/net/lib/mqtt_helper/CMakeLists.txt +++ b/subsys/net/lib/mqtt_helper/CMakeLists.txt @@ -6,8 +6,39 @@ zephyr_library() zephyr_library_sources(mqtt_helper.c) -zephyr_include_directories_ifdef(CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES cert) if (CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES) message(WARNING "Credentials are exposed in non-secure memory. This should be avoided in production.") + + # Define the directory where certificate include files will be stored. + set(app_certs_binary_dir ${APPLICATION_BINARY_DIR}/certs) + zephyr_include_directories(cert) + + # Function to process a certificate file and create a corresponding .inc file and compiler definition + # used in certs/mqtt-certs.h to assign C variables that are used in mqtt_helper.c. + function(process_certificate definition_name file_name) + set(cert_file ${APPLICATION_SOURCE_DIR}/${CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER}/${file_name}) + if(EXISTS ${cert_file}) + message(STATUS "${file_name} found") + + get_filename_component(file_base_name ${file_name} NAME_WE) + set(inc_file_name ${file_base_name}.inc) + + set(inc_file_path ${app_certs_binary_dir}/${inc_file_name}) + generate_inc_file_for_target(app ${cert_file} ${inc_file_path}) + + # Define a compiler macro with the path to the generated .inc file, + # allowing it to be included in the source code. + add_definitions(-D${definition_name}="${inc_file_path}") + endif() + endfunction() + + # Process each certificate file by generating a .inc file and defining a corresponding macro. + process_certificate("MQTT_HELPER_CA_CERT" "ca-cert.pem") + process_certificate("MQTT_HELPER_CLIENT_CERT" "client-cert.pem") + process_certificate("MQTT_HELPER_PRIVATE_KEY" "private-key.pem") + process_certificate("MQTT_HELPER_CA_CERT_2" "ca-cert-2.pem") + process_certificate("MQTT_HELPER_CLIENT_CERT_2" "client-cert-2.pem") + process_certificate("MQTT_HELPER_PRIVATE_KEY_2" "private-key-2.pem") + endif() diff --git a/subsys/net/lib/mqtt_helper/Kconfig b/subsys/net/lib/mqtt_helper/Kconfig index ce32f9d4200c..f59c935886d0 100644 --- a/subsys/net/lib/mqtt_helper/Kconfig +++ b/subsys/net/lib/mqtt_helper/Kconfig @@ -89,23 +89,20 @@ config MQTT_HELPER_PROVISION_CERTIFICATES default y imply MBEDTLS_PEM_CERTIFICATE_FORMAT if MBEDTLS help - Enable run-time provisioning of certificates from the - certificates header file selected by using MQTT_HELPER_CERTIFICATES_FILE - This option is only available for emulation build targets, - such as QEMU x86 or Native Posix. + Enable run-time provisioning of certificates located in the folder path + set by CONFIG_MQTT_HELPER_CERTIFICATES_FOLDER. This option is only intended for testing and should not be used in a production scenario. Enabling this option means that the credentials used in the TLS communication towards the server will be exposed in flash memory. -config MQTT_HELPER_CERTIFICATES_FILE - string "TLS certificates" +config MQTT_HELPER_CERTIFICATES_FOLDER + string "TLS certificates folder" depends on MQTT_HELPER_PROVISION_CERTIFICATES - default "../cert/mqtt-certs.h" + default "certs" help - The default path for a header file that contains definitions for certificates that are - used during run-time provisioning of TLS credentials. + The default path for the folder that contains credentials, relative to the application source directory. By default, the library expects the credentials to be in - Privacy Enhanced Mail (PEM) format. See "mqtt-certs.h" for a template. + Privacy Enhanced Mail (PEM) format. config MQTT_HELPER_LAST_WILL bool "Last will" diff --git a/subsys/net/lib/mqtt_helper/cert/mqtt-certs.h b/subsys/net/lib/mqtt_helper/cert/mqtt-certs.h index 7e0526f315d0..7270539b288b 100644 --- a/subsys/net/lib/mqtt_helper/cert/mqtt-certs.h +++ b/subsys/net/lib/mqtt_helper/cert/mqtt-certs.h @@ -4,40 +4,30 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -/* - * "-----BEGIN CA CERTIFICATE-----\n" - * "-----CERTIFICATE-----\n" - * "-----END CA CERTIFICATE-----\n" - */ static const unsigned char ca_certificate[] = { -#if __has_include("ca-cert.pem") -#include "ca-cert.pem" +#if defined(MQTT_HELPER_CA_CERT) +#include MQTT_HELPER_CA_CERT + +/* Null terminate certificate */ +(0x00) #else "" #endif }; -/* - * "-----BEGIN PRIVATE KEY-----\n" - * "-----KEY-----\n" - * "-----END PRIVATE KEY-----\n" - */ static const unsigned char private_key[] = { -#if __has_include("private-key.pem") -#include "private-key.pem" +#if defined(MQTT_HELPER_PRIVATE_KEY) +#include MQTT_HELPER_PRIVATE_KEY +(0x00) #else "" #endif }; -/* - * "-----BEGIN CLIENT CERTIFICATE-----\n" - * "-----CERTIFICATE-----\n" - * "-----END CLIENT CERTIFICATE-----\n" - */ static const unsigned char device_certificate[] = { -#if __has_include("client-cert.pem") -#include "client-cert.pem" +#if defined(MQTT_HELPER_CLIENT_CERT) +#include MQTT_HELPER_CLIENT_CERT +(0x00) #else "" #endif @@ -45,40 +35,28 @@ static const unsigned char device_certificate[] = { #if CONFIG_MQTT_HELPER_SECONDARY_SEC_TAG != -1 -/* - * "-----BEGIN CA CERTIFICATE-----\n" - * "-----CERTIFICATE-----\n" - * "-----END CA CERTIFICATE-----\n" - */ static const unsigned char ca_certificate_2[] = { -#if __has_include("ca-cert-2.pem") -#include "ca-cert-2.pem" +#if defined(MQTT_HELPER_CA_CERT_2) +#include MQTT_HELPER_CA_CERT_2 +(0x00) #else "" #endif }; -/* - * "-----BEGIN PRIVATE KEY-----\n" - * "-----KEY-----\n" - * "-----END PRIVATE KEY-----\n" - */ static const unsigned char private_key_2[] = { -#if __has_include("private-key-2.pem") -#include "private-key-2.pem" +#if defined(MQTT_HELPER_PRIVATE_KEY_2) +#include MQTT_HELPER_PRIVATE_KEY_2 +(0x00) #else "" #endif }; -/* - * "-----BEGIN CLIENT CERTIFICATE-----\n" - * "-----CERTIFICATE-----\n" - * "-----END CLIENT CERTIFICATE-----\n" - */ static const unsigned char device_certificate_2[] = { -#if __has_include("client-cert-2.pem") -#include "client-cert-2.pem" +#if defined(MQTT_HELPER_CLIENT_CERT_2) +#include MQTT_HELPER_CLIENT_CERT_2 +(0x00) #else "" #endif diff --git a/subsys/net/lib/mqtt_helper/mqtt_helper.c b/subsys/net/lib/mqtt_helper/mqtt_helper.c index 9321e981a5c9..e9755309b069 100644 --- a/subsys/net/lib/mqtt_helper/mqtt_helper.c +++ b/subsys/net/lib/mqtt_helper/mqtt_helper.c @@ -17,11 +17,11 @@ #include #include +#include #if defined(CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES) -#include CONFIG_MQTT_HELPER_CERTIFICATES_FILE -#endif /* CONFIG_MQTT_HELPER_PROVISION_CERTIFICATES */ -#include +#include "mqtt-certs.h" +#endif LOG_MODULE_REGISTER(mqtt_helper, CONFIG_MQTT_HELPER_LOG_LEVEL); diff --git a/subsys/net/lib/nrf_cloud/CMakeLists.txt b/subsys/net/lib/nrf_cloud/CMakeLists.txt index f5ce00d214ae..b2fc32155bdb 100644 --- a/subsys/net/lib/nrf_cloud/CMakeLists.txt +++ b/subsys/net/lib/nrf_cloud/CMakeLists.txt @@ -9,8 +9,7 @@ zephyr_library_sources( src/nrf_cloud_log.c src/nrf_cloud_codec.c src/nrf_cloud_mem.c - src/nrf_cloud_client_id.c - src/nrf_cloud_fota_common.c) + src/nrf_cloud_client_id.c) zephyr_library_sources_ifdef( CONFIG_NRF_CLOUD_ALERT src/nrf_cloud_alert.c) @@ -45,11 +44,13 @@ zephyr_library_sources_ifdef( zephyr_library_sources_ifdef( CONFIG_NRF_CLOUD_FOTA src/nrf_cloud_fota.c + src/nrf_cloud_fota_common.c src/nrf_cloud_download.c) zephyr_library_sources_ifdef( - CONFIG_NRF_CLOUD_FOTA_POLL - src/nrf_cloud_download.c - src/nrf_cloud_fota_poll.c) + CONFIG_NRF_CLOUD_FOTA_POLL + src/nrf_cloud_download.c + src/nrf_cloud_fota_common.c + src/nrf_cloud_fota_poll.c) zephyr_library_sources_ifdef( CONFIG_NRF_CLOUD_REST src/nrf_cloud_rest.c) diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap index ee32fc684a19..c046f491de08 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_coap @@ -11,7 +11,7 @@ menuconfig NRF_CLOUD_COAP select COAP_EXTENDED_OPTIONS_LEN select COAP_CLIENT select EXPERIMENTAL - select LTE_PROPRIETARY_PSM_REQ if SOC_NRF9161_LACA + select LTE_PROPRIETARY_PSM_REQ if (SOC_NRF9161_LACA || SOC_NRF9151_LACA || SOC_NRF9131_LACA) if NRF_CLOUD_COAP diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location index 76eec4c787e2..7f8f36319506 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_location @@ -8,3 +8,23 @@ config NRF_CLOUD_LOCATION imply FPU depends on NRF_CLOUD_MQTT select CJSON_LIB + +config NRF_CLOUD_LOCATION_ANCHOR_LIST + bool "Include the list of anchor names when receiving location results from the callback" + depends on NRF_CLOUD_LOCATION + depends on WIFI + select NRF_CLOUD_LOCATION_PARSE_ANCHORS + +config NRF_CLOUD_LOCATION_ANCHOR_LIST_BUFFER_SIZE + int "Size of the buffer to contain the anchor name list" + depends on NRF_CLOUD_LOCATION_ANCHOR_LIST + default 185 + help + The maximum length of an anchor name is 32 characters. + Anchor names are returned to the user in a singly-linked list, + which requires 37 bytes for each anchor name on a 32-bit system. + +config NRF_CLOUD_LOCATION_PARSE_ANCHORS + bool "Parse anchor data in location result" + help + If enabled, the anchor buffer in the result structure must be properly initialized. diff --git a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info index 2c3f33ba623e..d62c96e75b76 100644 --- a/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info +++ b/subsys/net/lib/nrf_cloud/Kconfig.nrf_cloud_shadow_info @@ -50,44 +50,54 @@ config NRF_CLOUD_SEND_SERVICE_INFO_FOTA NRF_CLOUD_FOTA_TYPE_MODEM_FULL_SUPPORTED menuconfig NRF_CLOUD_SEND_SERVICE_INFO_UI - bool "Send UI service info initial connection" + bool "Send UI service info initial connection [DEPRECATED]" + select DEPRECATED help - Add supported UI types to the "serviceInfo" section. - The UI types control which cards are displayed on nRF Cloud in the device page. - Common types are enabled by default. + This option is deprecated. + nRF Cloud no longer uses the UI section in the shadow. + Cards are displayed based on the messages sent by the device. if NRF_CLOUD_SEND_SERVICE_INFO_UI config NRF_CLOUD_ENABLE_SVC_INF_UI_MAP - bool "Enable map card on nRF Cloud" + bool "Enable map card on nRF Cloud [DEPRECATED]" + select DEPRECATED default y config NRF_CLOUD_ENABLE_SVC_INF_UI_RSRP - bool "Enable RSRP card on nRF Cloud" + bool "Enable RSRP card on nRF Cloud [DEPRECATED]" + select DEPRECATED default y if NRF_MODEM_LIB config NRF_CLOUD_ENABLE_SVC_INF_UI_LOGS - bool "Enable log card on nRF Cloud" + bool "Enable log card on nRF Cloud [DEPRECATED]" + select DEPRECATED default y if NRF_CLOUD_LOG_TEXT_LOGGING_ENABLED config NRF_CLOUD_ENABLE_SVC_INF_UI_BIN_LOGS - bool "Enable binary (dictionary-based) log card on nRF Cloud" + bool "Enable binary (dictionary-based) log card on nRF Cloud [DEPRECATED]" + select DEPRECATED default y if NRF_CLOUD_LOG_DICTIONARY_LOGGING_ENABLED config NRF_CLOUD_ENABLE_SVC_INF_UI_TEMP - bool "Enable temperature card on nRF Cloud" + bool "Enable temperature card on nRF Cloud [DEPRECATED]" + select DEPRECATED config NRF_CLOUD_ENABLE_SVC_INF_UI_HUMID - bool "Enable humidity card on nRF Cloud" + bool "Enable humidity card on nRF Cloud [DEPRECATED]" + select DEPRECATED config NRF_CLOUD_ENABLE_SVC_INF_UI_AIR_PRESSURE - bool "Enable air pressure card on nRF Cloud" + bool "Enable air pressure card on nRF Cloud [DEPRECATED]" + select DEPRECATED config NRF_CLOUD_ENABLE_SVC_INF_UI_AIR_QUALITY - bool "Enable air quality card on nRF Cloud" + bool "Enable air quality card on nRF Cloud [DEPRECATED]" + select DEPRECATED config NRF_CLOUD_ENABLE_SVC_INF_UI_ORIENTATION - bool "Enable orientation (flip) card on nRF Cloud" + bool "Enable orientation (flip) card on nRF Cloud [DEPRECATED]" + select DEPRECATED endif # NRF_CLOUD_SEND_SERVICE_INFO_UI @@ -99,8 +109,7 @@ config NRF_CLOUD_SEND_SHADOW_INFO NRF_CLOUD_SEND_DEVICE_STATUS_NETWORK || \ NRF_CLOUD_SEND_DEVICE_STATUS_SIM || \ NRF_CLOUD_SEND_DEVICE_STATUS_CONN_INF || \ - NRF_CLOUD_SEND_SERVICE_INFO_FOTA || \ - NRF_CLOUD_SEND_SERVICE_INFO_UI) + NRF_CLOUD_SEND_SERVICE_INFO_FOTA) help This symbol is y when at least one option to send an info section is enabled. diff --git a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c index 61e73cf06d30..bd299b2515ad 100644 --- a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c +++ b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c @@ -33,6 +33,8 @@ LOG_MODULE_REGISTER(nrf_cloud_coap, CONFIG_NRF_CLOUD_COAP_LOG_LEVEL); #define COAP_GND_FIX_RSC "loc/ground-fix" #define COAP_FOTA_GET_RSC "fota/exec/current" #define COAP_SHDW_RSC "state" +#define COAP_SHDW_REP_RSC "state/reported" +#define COAP_SHDW_DES_RSC "state/desired" #define COAP_D2C_RSC "msg/d2c" #define COAP_D2C_BULK_RSC "msg/d/%s/d2c/bulk" #define COAP_D2C_RSC_MAX_LEN MAX(sizeof(COAP_D2C_RSC), sizeof(COAP_D2C_BULK_RSC)) @@ -629,7 +631,7 @@ int nrf_cloud_coap_shadow_get(char *buf, size_t buf_len, bool delta) return err; } -int nrf_cloud_coap_shadow_state_update(const char * const shadow_json) +static int shadow_update(const char * const resource, const char * const shadow_json) { int err; @@ -638,7 +640,7 @@ int nrf_cloud_coap_shadow_state_update(const char * const shadow_json) return -EACCES; } - err = nrf_cloud_coap_patch(COAP_SHDW_RSC, NULL, (uint8_t *)shadow_json, + err = nrf_cloud_coap_patch(resource, NULL, (uint8_t *)shadow_json, strlen(shadow_json), COAP_CONTENT_FORMAT_APP_JSON, true, NULL, NULL); if (err < 0) { @@ -649,6 +651,16 @@ int nrf_cloud_coap_shadow_state_update(const char * const shadow_json) return err; } +int nrf_cloud_coap_shadow_state_update(const char * const shadow_json) +{ + return shadow_update(COAP_SHDW_REP_RSC, shadow_json); +} + +int nrf_cloud_coap_shadow_desired_update(const char * const shadow_json) +{ + return shadow_update(COAP_SHDW_DES_RSC, shadow_json); +} + int nrf_cloud_coap_shadow_device_status_update(const struct nrf_cloud_device_status *const dev_status) { @@ -736,22 +748,28 @@ int nrf_cloud_coap_shadow_delta_process(const struct nrf_cloud_data *in_data, err = nrf_cloud_shadow_control_process(&shadow_data, &out_data); if ((err == -ENODATA) || (err == -ENOMSG)) { /* No control data in the delta or no reply is needed */ - } else if (err) { - LOG_ERR("Failed to process device control shadow update, error: %d", err); - } else { - LOG_DBG("Ack delta: len:%zd, %s", out_data.len, (const char *)out_data.ptr); + } else if ((err == -EINVAL) || (err == 0)) { + const char *action = err ? "reject" : "acknowledge"; - /* Acknowledge it so we do not receive it again. */ - err = nrf_cloud_coap_shadow_state_update(out_data.ptr); + LOG_DBG("delta: len:%zd, %s", out_data.len, (const char *)out_data.ptr); + + /* Acknowledge it or reject it so we do not receive it again. */ + if (!err) { + err = nrf_cloud_coap_shadow_state_update(out_data.ptr); + } else { + err = nrf_cloud_coap_shadow_desired_update(out_data.ptr); + } if (err) { - LOG_ERR("Failed to acknowledge control delta: %d", err); + LOG_ERR("Failed to %s control delta: %d", action, err); } else { - LOG_DBG("Control delta acknowledged"); + LOG_DBG("Control delta: %s", action); } nrf_cloud_free((void *)out_data.ptr); out_data.ptr = NULL; out_data.len = 0; + } else { + LOG_ERR("Failed to process device control shadow update, error: %d", err); } /* Check if there is delta data to give to the caller */ @@ -762,7 +780,8 @@ int nrf_cloud_coap_shadow_delta_process(const struct nrf_cloud_data *in_data, err = 1; } else { nrf_cloud_obj_free(&shadow_delta.state); + err = 0; } - return 0; + return err; } diff --git a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c index 185a74341d29..921a408a263d 100644 --- a/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c +++ b/subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap_transport.c @@ -317,7 +317,7 @@ int nrf_cloud_coap_connect(const char * const app_ver) } err = nrf_cloud_coap_authenticate(); - if (err < 0) { + if (err) { goto fail; } diff --git a/subsys/net/lib/nrf_cloud/include/nrf_cloud_codec_internal.h b/subsys/net/lib/nrf_cloud/include/nrf_cloud_codec_internal.h index 58e515856473..963312e80206 100644 --- a/subsys/net/lib/nrf_cloud/include/nrf_cloud_codec_internal.h +++ b/subsys/net/lib/nrf_cloud/include/nrf_cloud_codec_internal.h @@ -324,6 +324,10 @@ int get_string_from_obj(const cJSON * const obj, const char * const key, int get_num_from_obj(const cJSON *const obj, const char *const key, double *num_out); +/** @brief Get the boolean value of the specified key in the cJSON object. */ +int get_bool_from_obj(const cJSON * const obj, const char * const key, + bool *bool_out); + /** @brief Send the cJSON object to nRF Cloud on the d2c topic */ int json_send_to_cloud(cJSON * const request); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c index 9fbabae7edf2..a92ba81fc1b2 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_agnss.c @@ -465,6 +465,13 @@ static size_t get_next_agnss_element(struct nrf_cloud_agnss_element *element, * each element. */ if (elements_left_to_process == 0) { + element_type = NRF_CLOUD_AGNSS__TYPE_INVALID; + + if (buf_len == 0) { + /* No more data to parse. */ + return 0; + } + /* Check that there's enough data for type and count. */ if (buf_len < NRF_CLOUD_AGNSS_BIN_TYPE_SIZE + NRF_CLOUD_AGNSS_BIN_COUNT_SIZE) { LOG_ERR("Unexpected end of data"); @@ -532,6 +539,7 @@ static size_t get_next_agnss_element(struct nrf_cloud_agnss_element *element, default: LOG_DBG("Unhandled A-GNSS data type: %d", element->type); elements_left_to_process = 0; + element_type = NRF_CLOUD_AGNSS__TYPE_INVALID; return 0; } @@ -539,6 +547,7 @@ static size_t get_next_agnss_element(struct nrf_cloud_agnss_element *element, if (buf_len < len) { LOG_ERR("Unexpected end of data"); elements_left_to_process = 0; + element_type = NRF_CLOUD_AGNSS__TYPE_INVALID; return 0; } @@ -594,12 +603,15 @@ int nrf_cloud_agnss_process(const char *buf, size_t buf_len) LOG_DBG("A-GNSS_injection_active LOCKED"); - while (parsed_len < buf_len) { + while (parsed_len <= buf_len) { + /* get_next_agnss_element() is called once more when the data ends to detect + * that parsing has been finished. + */ size_t element_size = get_next_agnss_element(&element, &buf[parsed_len], buf_len - parsed_len); if (element_size == 0) { - LOG_DBG("Parsing finished\n"); + LOG_DBG("Parsing finished"); break; } 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 6765720148ce..9ac7d5de6634 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_alert.c @@ -43,7 +43,7 @@ static int alert_prepare(struct nrf_cloud_data *output, } LOG_DBG("Alert! type: %d, value: %f, description: %s, ts: %lld, seq: %d", - alert.type, alert.value, alert.description ? alert.description : "", + alert.type, (double)alert.value, alert.description ? alert.description : "", alert.ts_ms, alert.sequence); return nrf_cloud_alert_encode(&alert, output); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c index 100c243de076..3951ab49a0f3 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_codec.c @@ -133,6 +133,25 @@ int nrf_cloud_obj_str_get(const struct nrf_cloud_obj *const obj, const char *con return -ENOTSUP; } +int nrf_cloud_obj_bool_get(const struct nrf_cloud_obj *const obj, const char *const key, + bool *val) +{ + if (!obj || !key || !val) { + return -EINVAL; + } + + switch (obj->type) { + case NRF_CLOUD_OBJ_TYPE_JSON: + { + return get_bool_from_obj(obj->json, key, val); + } + default: + break; + } + + return -ENOTSUP; +} + int nrf_cloud_obj_object_detach(struct nrf_cloud_obj *const obj, const char *const key, struct nrf_cloud_obj *const obj_out) { 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 317501fe9019..c8a1dc5e103c 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 @@ -350,7 +350,6 @@ static int enabled_info_sections_get(struct nrf_cloud_device_status *const ds) struct nrf_cloud_modem_info *modem = ds->modem; struct nrf_cloud_svc_info_fota *fota = ds->svc ? ds->svc->fota : NULL; - struct nrf_cloud_svc_info_ui *ui = ds->svc ? ds->svc->ui : NULL; /* Modem info */ if (modem) { @@ -378,19 +377,6 @@ static int enabled_info_sections_get(struct nrf_cloud_device_status *const ds) fota->modem_full = IS_ENABLED(CONFIG_NRF_CLOUD_FOTA_TYPE_MODEM_FULL_SUPPORTED); } - /* Service info: UI */ - if (ui && IS_ENABLED(CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_UI)) { - ui->temperature = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_TEMP); - ui->gnss = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_MAP); - ui->flip = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_ORIENTATION); - ui->humidity = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_HUMID); - ui->air_pressure = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_AIR_PRESSURE); - ui->rsrp = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_RSRP); - ui->log = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_LOGS); - ui->dictionary_log = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_BIN_LOGS); - ui->air_quality = IS_ENABLED(CONFIG_NRF_CLOUD_ENABLE_SVC_INF_UI_AIR_QUALITY); - } - return 0; } @@ -1106,79 +1092,8 @@ static int nrf_cloud_encode_service_info_ui(const struct nrf_cloud_svc_info_ui * return -EINVAL; } - if (ui == NULL) { - if (json_add_null_cs(svc_inf_obj, NRF_CLOUD_JSON_KEY_SRVC_INFO_UI) != 0) { - return -ENOMEM; - } - } else { - int item_cnt = 0; - cJSON *array = cJSON_AddArrayToObjectCS(svc_inf_obj, - NRF_CLOUD_JSON_KEY_SRVC_INFO_UI); - - if (!array) { - return -ENOMEM; - } - if (ui->air_pressure) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_AIR_PRESS])); - ++item_cnt; - } - if (ui->air_quality) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_AIR_QUAL])); - ++item_cnt; - } - if (ui->gnss) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_GNSS])); - ++item_cnt; - } - if (ui->flip) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_FLIP])); - ++item_cnt; - } - if (ui->button) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_BUTTON])); - ++item_cnt; - } - if (ui->temperature) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_TEMP])); - ++item_cnt; - } - if (ui->humidity) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_HUMID])); - ++item_cnt; - } - if (ui->light_sensor) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_LIGHT])); - ++item_cnt; - } - if (ui->rsrp) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_LTE_LINK_RSRP])); - ++item_cnt; - } - if (ui->log) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_LOG])); - ++item_cnt; - } - if (ui->dictionary_log) { - cJSON_AddItemToArray(array, - cJSON_CreateString(sensor_type_str[NRF_CLOUD_DICTIONARY_LOG])); - ++item_cnt; - } - - if (cJSON_GetArraySize(array) != item_cnt) { - cJSON_DeleteItemFromObject(svc_inf_obj, NRF_CLOUD_JSON_KEY_SRVC_INFO_UI); - return -ENOMEM; - } - } + /* The UI section is no longer used by the cloud, remove it */ + (void)json_add_null_cs(svc_inf_obj, NRF_CLOUD_JSON_KEY_SRVC_INFO_UI); return 0; } @@ -1666,10 +1581,9 @@ int nrf_cloud_modem_info_json_encode(const struct nrf_cloud_modem_info *const mo int nrf_cloud_enabled_info_sections_json_encode(cJSON * const obj, const char * const app_ver) { struct nrf_cloud_svc_info_fota fota = {0}; - struct nrf_cloud_svc_info_ui ui = {0}; - /* Only set service info items if they are enabled */ + /* Only set FOTA service info if enabled */ struct nrf_cloud_svc_info svc_inf = { - .ui = IS_ENABLED(CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_UI) ? &ui : NULL, + .ui = NULL, .fota = IS_ENABLED(CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_FOTA) ? &fota : NULL }; struct nrf_cloud_modem_info mdm_inf = { @@ -1708,8 +1622,8 @@ int nrf_cloud_enabled_info_sections_json_encode(cJSON * const obj, const char * ret = shadow_connection_info_update(device_obj); } - /* Encode FOTA/UI service info if set */ - if ((ds.svc->fota || ds.svc->ui)) { + /* Encode FOTA service info if set */ + if (ds.svc->fota) { cJSON *svc_inf_obj = cJSON_AddObjectToObjectCS(device_obj, NRF_CLOUD_JSON_KEY_SRVC_INFO); @@ -1724,11 +1638,9 @@ int nrf_cloud_enabled_info_sections_json_encode(cJSON * const obj, const char * return -ENOMEM; } - if (ds.svc->ui) { - ret = nrf_cloud_encode_service_info_ui(ds.svc->ui, svc_inf_obj); - } - if (ret) { - return -ENOMEM; + /* The UI section is no longer used by the cloud, remove it */ + if (IS_ENABLED(CONFIG_NRF_CLOUD_SEND_SERVICE_INFO_UI)) { + (void)nrf_cloud_encode_service_info_ui(NULL, svc_inf_obj); } } @@ -1742,13 +1654,9 @@ int nrf_cloud_service_info_json_encode(const struct nrf_cloud_svc_info *const sv return -EINVAL; } - int err = nrf_cloud_encode_service_info_fota(svc_inf->fota, svc_inf_obj); - - if (err) { - return err; - } + (void)nrf_cloud_encode_service_info_ui(NULL, svc_inf_obj); - return nrf_cloud_encode_service_info_ui(svc_inf->ui, svc_inf_obj); + return nrf_cloud_encode_service_info_fota(svc_inf->fota, svc_inf_obj); } void nrf_cloud_device_status_free(struct nrf_cloud_data *status) @@ -2449,6 +2357,26 @@ int get_num_from_obj(const cJSON *const obj, const char *const key, return 0; } +int get_bool_from_obj(const cJSON * const obj, const char * const key, + bool *bool_out) +{ + __ASSERT_NO_MSG(bool_out != NULL); + + if (!obj) { + return -ENOENT; + } + + cJSON * item = cJSON_GetObjectItem(obj, key); + + if (!cJSON_IsBool(item)) { + return item ? -ENOMSG : -ENODEV; + } + + *bool_out = (bool)cJSON_IsTrue(item); + + return 0; +} + static int add_ncells(cJSON * const lte_obj, const uint8_t ncells_count, const struct lte_lc_ncell *const neighbor_cells) { @@ -2815,6 +2743,69 @@ static bool json_item_string_exists(const cJSON *const obj, const char *const ke return (strcmp(str_val, val) == 0); } +static void nrf_cloud_parse_location_anchors_json(const cJSON * const loc_obj, + struct nrf_cloud_location_result * const location_out) +{ + cJSON *anchors, *mac, *name; + size_t buf_idx = 0; + size_t node_sz; + size_t name_sz; + bool buf_exists = location_out->anchor_buf_sz && location_out->anchor_buf; + + /* Init anchor output */ + sys_slist_init(&location_out->anchor_list); + if (buf_exists) { + location_out->anchor_buf[0] = '\0'; + } + + /* Anchor info is provided in an array of objects */ + anchors = cJSON_GetObjectItem(loc_obj, NRF_CLOUD_LOCATION_JSON_KEY_ANCHORS); + location_out->anchor_cnt = (uint32_t)cJSON_GetArraySize(anchors); + + for (int idx = 0; idx < location_out->anchor_cnt; ++idx) { + struct nrf_cloud_anchor_list_node *node; + cJSON *anc = cJSON_GetArrayItem(anchors, idx); + + mac = cJSON_GetObjectItem(anc, NRF_CLOUD_LOCATION_JSON_KEY_ANC_MAC); + name = cJSON_GetObjectItem(anc, NRF_CLOUD_LOCATION_JSON_KEY_ANC_NAME); + + if (cJSON_IsString(mac)) { + LOG_DBG("Wi-Fi anchor MAC: %s", mac->valuestring); + } + + if (cJSON_IsString(name)) { + LOG_DBG("Wi-Fi anchor name: %s", name->valuestring); + } else { + continue; + } + + if (!buf_exists) { + /* No anchor buffer provided */ + continue; + } + + /* Get the size of the anchor name and node container */ + name_sz = strlen(name->valuestring) + 1; + node_sz = sizeof(*node) + name_sz; + + /* Ensure node will fit in buffer */ + if ((buf_idx + node_sz) > location_out->anchor_buf_sz) { + LOG_WRN("Anchor does not fit in provided buffer"); + continue; + } + + /* Get a node pointer from the anchor buffer */ + node = (struct nrf_cloud_anchor_list_node *)&location_out->anchor_buf[buf_idx]; + node->node.next = NULL; + /* Copy the anchor name */ + memcpy(node->name, name->valuestring, name_sz); + /* Update the buffer index */ + buf_idx += node_sz; + /* Add node to list */ + sys_slist_append(&location_out->anchor_list, &node->node); + } +} + static int nrf_cloud_parse_location_json(const cJSON *const loc_obj, struct nrf_cloud_location_result *const location_out) { @@ -2826,12 +2817,9 @@ static int nrf_cloud_parse_location_json(const cJSON *const loc_obj, bool anchor = false; char *type; - lat = cJSON_GetObjectItem(loc_obj, - NRF_CLOUD_LOCATION_JSON_KEY_LAT); - lon = cJSON_GetObjectItem(loc_obj, - NRF_CLOUD_LOCATION_JSON_KEY_LON); - unc = cJSON_GetObjectItem(loc_obj, - NRF_CLOUD_LOCATION_JSON_KEY_UNCERT); + lat = cJSON_GetObjectItem(loc_obj, NRF_CLOUD_LOCATION_JSON_KEY_LAT); + lon = cJSON_GetObjectItem(loc_obj, NRF_CLOUD_LOCATION_JSON_KEY_LON); + unc = cJSON_GetObjectItem(loc_obj, NRF_CLOUD_LOCATION_JSON_KEY_UNCERT); if (!cJSON_IsNumber(lat) || !cJSON_IsNumber(lon) || !cJSON_IsNumber(unc)) { return -EBADMSG; @@ -2860,29 +2848,9 @@ static int nrf_cloud_parse_location_json(const cJSON *const loc_obj, LOG_WRN("Location type not found in message"); } - /* Print anchor info */ - if (anchor) { - cJSON *anchors, *mac, *name; - int anc_cnt; - - /* Anchor info is provided in an array of objects */ - anchors = cJSON_GetObjectItem(loc_obj, NRF_CLOUD_LOCATION_JSON_KEY_ANCHORS); - anc_cnt = cJSON_GetArraySize(anchors); - - for (int idx = 0; idx < anc_cnt; ++idx) { - cJSON *anc = cJSON_GetArrayItem(anchors, idx); - - mac = cJSON_GetObjectItem(anc, NRF_CLOUD_LOCATION_JSON_KEY_ANC_MAC); - name = cJSON_GetObjectItem(anc, NRF_CLOUD_LOCATION_JSON_KEY_ANC_NAME); - - if (cJSON_IsString(mac)) { - LOG_DBG("Wi-Fi anchor MAC: %s", mac->valuestring); - } + if (anchor && IS_ENABLED(CONFIG_NRF_CLOUD_LOCATION_PARSE_ANCHORS)) { + nrf_cloud_parse_location_anchors_json(loc_obj, location_out); - if (cJSON_IsString(name)) { - LOG_INF("Wi-Fi anchor name: %s", name->valuestring); - } - } } return 0; @@ -4017,9 +3985,7 @@ int nrf_cloud_coap_shadow_default_process(struct nrf_cloud_obj_shadow_data *cons int nrf_cloud_shadow_control_process(struct nrf_cloud_obj_shadow_data *const input, struct nrf_cloud_data *const response_out) { - if (!input) { - return -EINVAL; - } + __ASSERT_NO_MSG(input != NULL); NRF_CLOUD_OBJ_JSON_DEFINE(ctrl_obj); enum nrf_cloud_ctrl_status ctrl_status = NRF_CLOUD_CTRL_NOT_PRESENT; @@ -4085,6 +4051,9 @@ int nrf_cloud_shadow_control_process(struct nrf_cloud_obj_shadow_data *const inp LOG_ERR("nrf_cloud_shadow_control_response_encode failed %d", err); return -EIO; } + if (ctrl_status == NRF_CLOUD_CTRL_REJECT) { + return -EINVAL; + } } return 0; 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 03ae7d975394..af192a8742b8 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota.c @@ -59,12 +59,12 @@ static void send_event(const enum nrf_cloud_fota_evt_id id, const struct nrf_cloud_fota_job *const job); static void cleanup_job(struct nrf_cloud_fota_job *const job); static int start_job(struct nrf_cloud_fota_job *const job, const bool send_evt); -static int send_job_update(struct nrf_cloud_fota_job *const job); +static int publish_job_status(struct nrf_cloud_fota_job *const job); static int publish(const struct mqtt_publish_param *const pub); static int save_validate_status(const char *const job_id, const enum nrf_cloud_fota_type job_type, const enum nrf_cloud_fota_validate_status status); -static int report_validated_job_status(void); +static int publish_validated_job_status(void); static void reset_topics(void); static struct mqtt_client *client_mqtt; @@ -99,6 +99,11 @@ static bool fota_dl_initialized; /** Flag to indicate that a pending FOTA job was validated and a reboot is required */ static bool reboot_on_init; +/** Flag to indicate that the device is waiting on an ACK after sending a job status + * update to the cloud + */ +static bool fota_report_ack_pending; + static void send_fota_done_event_if_done(void) { /* This event should cause reboot or modem-reinit. @@ -238,6 +243,8 @@ int nrf_cloud_fota_init(nrf_cloud_fota_callback_t cb) LOG_ERR("Failed to process pending FOTA job, error: %d", ret); } + fota_report_ack_pending = false; + initialized = true; return ret; } @@ -271,7 +278,7 @@ int nrf_cloud_modem_fota_completed(const bool fota_success) (void)save_validate_status(saved_job.id, saved_job.type, fota_success ? NRF_CLOUD_FOTA_VALIDATE_PASS : NRF_CLOUD_FOTA_VALIDATE_FAIL); - return report_validated_job_status(); + return publish_validated_job_status(); } static void reset_topic(struct mqtt_utf8 *const topic) @@ -331,7 +338,7 @@ static int build_topic(const char *const client_id, return 0; } -static int report_validated_job_status(void) +static int publish_validated_job_status(void) { int ret = 0; @@ -381,7 +388,8 @@ static int report_validated_job_status(void) } if (job.info.type != NRF_CLOUD_FOTA_TYPE__INVALID) { - ret = send_job_update(&job); + LOG_DBG("Sending job update for validated (%d) job", saved_job.validate); + ret = publish_job_status(&job); if (ret) { LOG_ERR("Error sending job update: %d", ret); } @@ -403,14 +411,18 @@ int nrf_cloud_fota_endpoint_set_and_report(struct mqtt_client *const client, if ((current_fota.status == NRF_CLOUD_FOTA_IN_PROGRESS) && (saved_job.validate == NRF_CLOUD_FOTA_VALIDATE_PENDING)) { /* In case of a prior disconnection from nRF Cloud during the - * FOTA update, send a job update to the cloud + * FOTA update, publish job status to the cloud */ - ret = send_job_update(¤t_fota); + ret = publish_job_status(¤t_fota); if (ret < 0) { + /* If the job update fails to be sent here, proceed to inform + * the application of a complete job so it can be validated. + * Job update will be sent on reboot/re-init. + */ send_fota_done_event_if_done(); } } else { - ret = report_validated_job_status(); + ret = publish_validated_job_status(); /* Positive value indicates no job exists, ignore */ if (ret > 0) { ret = 0; @@ -598,7 +610,7 @@ static void http_fota_handler(const struct fota_download_evt *evt) current_fota.dl_progress = 100; current_fota.sent_dl_progress = 100; send_event(NRF_CLOUD_FOTA_EVT_DL_PROGRESS, ¤t_fota); - (void)send_job_update(¤t_fota); + (void)publish_job_status(¤t_fota); } /* MCUBOOT or MODEM full: download finished, update job status and install/reboot */ @@ -606,7 +618,7 @@ static void http_fota_handler(const struct fota_download_evt *evt) save_validate_status(current_fota.info.id, current_fota.info.type, NRF_CLOUD_FOTA_VALIDATE_PENDING); - ret = send_job_update(¤t_fota); + ret = publish_job_status(¤t_fota); break; case FOTA_DOWNLOAD_EVT_ERASE_PENDING: @@ -630,6 +642,8 @@ static void http_fota_handler(const struct fota_download_evt *evt) break; case FOTA_DOWNLOAD_EVT_ERROR: + LOG_DBG("FOTA_DOWNLOAD_EVT_ERROR cause: %d", evt->cause); + nrf_cloud_download_end(); current_fota.status = NRF_CLOUD_FOTA_FAILED; @@ -642,17 +656,14 @@ static void http_fota_handler(const struct fota_download_evt *evt) current_fota.error = NRF_CLOUD_FOTA_ERROR_DOWNLOAD; } - /* Save as ERROR status in case send_job_update() fails - * so that the job status can be updated later. + /* Save validate status as ERROR in case the cloud does not + * receive the job status update; it can be sent later. */ save_validate_status(current_fota.info.id, current_fota.info.type, NRF_CLOUD_FOTA_VALIDATE_ERROR); - ret = send_job_update(¤t_fota); + ret = publish_job_status(¤t_fota); send_event(NRF_CLOUD_FOTA_EVT_ERROR, ¤t_fota); - if (ret == 0) { - cleanup_job(¤t_fota); - } break; case FOTA_DOWNLOAD_EVT_PROGRESS: @@ -684,14 +695,14 @@ static void http_fota_handler(const struct fota_download_evt *evt) current_fota.sent_dl_progress = current_fota.dl_progress; send_event(NRF_CLOUD_FOTA_EVT_DL_PROGRESS, ¤t_fota); - ret = send_job_update(¤t_fota); + ret = publish_job_status(¤t_fota); break; default: break; } if (ret) { - LOG_ERR("Failed to send job update to cloud: %d", ret); + LOG_ERR("Failed to send job status to cloud: %d", ret); /* The done event is normally sent on the MQTT ACK, but if the * status update fails there will be no ACK. Send the done event * so the device can proceed to install the FOTA update. @@ -819,12 +830,7 @@ static int start_job(struct nrf_cloud_fota_job *const job, const bool send_evt) } /* Send job status to the cloud */ - (void)send_job_update(job); - - /* Cleanup if the job failed to start */ - if (ret) { - cleanup_job(job); - } + (void)publish_job_status(job); return ret; } @@ -898,6 +904,11 @@ static int publish_and_free_obj(struct nrf_cloud_obj *const pub_data, pub_param->message.payload.data = (uint8_t *)pub_data->encoded_data.ptr; pub_param->message.payload.len = pub_data->encoded_data.len; err = publish(pub_param); + + if ((!err) && (pub_param->message_id == NCT_MSG_ID_FOTA_REPORT)) { + fota_report_ack_pending = true; + } + (void)nrf_cloud_obj_cloud_encoded_free(pub_data); } @@ -918,7 +929,7 @@ static bool is_job_status_terminal(const enum nrf_cloud_fota_status status) } } -static int send_job_update(struct nrf_cloud_fota_job *const job) +static int publish_job_status(struct nrf_cloud_fota_job *const job) { /* ensure shell-invoked fota doesn't crash below */ if ((job == NULL) || (job->info.id == NULL)) { @@ -942,14 +953,7 @@ static int send_job_update(struct nrf_cloud_fota_job *const job) return -ENOMEM; } - ret = publish_and_free_obj(&update_obj, &topic_updt, ¶m); - if (ret == 0 && is_job_status_terminal(job->status)) { - /* If job was updated to terminal status, save job ID */ - strncpy(last_job, job->info.id, sizeof(last_job) - 1); - last_job[sizeof(last_job) - 1] = '\0'; - } - - return ret; + return publish_and_free_obj(&update_obj, &topic_updt, ¶m); } int nrf_cloud_fota_update_check(void) @@ -1076,7 +1080,7 @@ static int handle_mqtt_evt_publish(const struct mqtt_evt *evt) } else if (reject_job) { current_fota.error = NRF_CLOUD_FOTA_ERROR_BAD_JOB_INFO; current_fota.status = NRF_CLOUD_FOTA_REJECTED; - (void)send_job_update(¤t_fota); + (void)publish_job_status(¤t_fota); cleanup_job(¤t_fota); } @@ -1116,12 +1120,31 @@ int nrf_cloud_fota_mqtt_evt_handler(const struct mqtt_evt *evt) } case MQTT_EVT_SUBACK: { + int ret = -1; + if (evt->param.suback.message_id != NCT_MSG_ID_FOTA_SUB) { return 1; } LOG_DBG("MQTT_EVT_SUBACK"); - nrf_cloud_fota_update_check(); + if (fota_report_ack_pending) { + if (current_fota.info.type != NRF_CLOUD_FOTA_TYPE__INVALID) { + LOG_DBG("Sending job updated due to missing ACK"); + ret = publish_job_status(¤t_fota); + } else { + /* No current job info, check for a validated job */ + ret = publish_validated_job_status(); + if (ret == 1) { + /* No validated job either, clear flag */ + fota_report_ack_pending = false; + } + } + } + + if (ret != 0) { + /* Check for an update if job status was not published */ + nrf_cloud_fota_update_check(); + } break; } @@ -1135,11 +1158,11 @@ int nrf_cloud_fota_mqtt_evt_handler(const struct mqtt_evt *evt) } case MQTT_EVT_PUBACK: { - bool do_update_check = false; + bool fota_report_ack = false; switch (evt->param.puback.message_id) { case NCT_MSG_ID_FOTA_REPORT: - do_update_check = true; + fota_report_ack = true; case NCT_MSG_ID_FOTA_REQUEST: case NCT_MSG_ID_FOTA_BLE_REPORT: case NCT_MSG_ID_FOTA_BLE_REQUEST: @@ -1151,18 +1174,28 @@ int nrf_cloud_fota_mqtt_evt_handler(const struct mqtt_evt *evt) LOG_DBG("MQTT_EVT_PUBACK: msg id %d", evt->param.puback.message_id); - if (!do_update_check) { + if (!fota_report_ack) { /* Nothing to do */ break; } + /* Job status updated on the cloud, now process the local saved status */ + fota_report_ack_pending = false; + + /* If job was updated to terminal status, save job ID and cleanup*/ + if (is_job_status_terminal(current_fota.status)) { + strncpy(last_job, current_fota.info.id, sizeof(last_job) - 1); + last_job[sizeof(last_job) - 1] = '\0'; + cleanup_job(¤t_fota); + } + switch (saved_job.validate) { + case NRF_CLOUD_FOTA_VALIDATE_ERROR: case NRF_CLOUD_FOTA_VALIDATE_PASS: case NRF_CLOUD_FOTA_VALIDATE_UNKNOWN: case NRF_CLOUD_FOTA_VALIDATE_FAIL: - case NRF_CLOUD_FOTA_VALIDATE_ERROR: save_validate_status(saved_job.id, saved_job.type, - NRF_CLOUD_FOTA_VALIDATE_DONE); + NRF_CLOUD_FOTA_VALIDATE_DONE); break; case NRF_CLOUD_FOTA_VALIDATE_PENDING: send_fota_done_event_if_done(); @@ -1170,6 +1203,7 @@ int nrf_cloud_fota_mqtt_evt_handler(const struct mqtt_evt *evt) default: break; } + break; } case MQTT_EVT_DISCONNECT: diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fsm.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fsm.c index 972f46040def..52fda150eaea 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_fsm.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_fsm.c @@ -120,6 +120,9 @@ static bool c2d_topic_modified; static bool add_shadow_info = IS_ENABLED(CONFIG_NRF_CLOUD_SEND_SHADOW_INFO); #if defined(CONFIG_NRF_CLOUD_LOCATION) && defined(CONFIG_NRF_CLOUD_MQTT) +#if defined(CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST) +static char anchor_list_buf[CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST_BUFFER_SIZE]; +#endif static nrf_cloud_location_response_t location_cb; void nfsm_set_location_response_cb(nrf_cloud_location_response_t cb) { @@ -668,9 +671,16 @@ static int location_process(const char * const buf) { #if defined(CONFIG_NRF_CLOUD_LOCATION) && defined(CONFIG_NRF_CLOUD_MQTT) if (location_cb) { - struct nrf_cloud_location_result res; - int ret = nrf_cloud_location_process(buf, &res); + int ret; + struct nrf_cloud_location_result res = {0}; + +#if defined(CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST) + res.anchor_buf = anchor_list_buf; + res.anchor_buf_sz = sizeof(anchor_list_buf); +#endif + + ret = nrf_cloud_location_process(buf, &res); if (ret <= 0) { /* A location response was received, send to callback */ location_cb(&res); diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_location.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_location.c index 3544d7763c19..0e9f48b5b2c5 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_location.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_location.c @@ -17,6 +17,11 @@ LOG_MODULE_REGISTER(nrf_cloud_location, CONFIG_NRF_CLOUD_LOG_LEVEL); +#if defined(CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST) +BUILD_ASSERT(CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST_BUFFER_SIZE >= NRF_CLOUD_ANCHOR_LIST_BUF_MIN_SZ, + "CONFIG_NRF_CLOUD_LOCATION_ANCHOR_LIST_BUFFER_SIZE is not large enough"); +#endif + int nrf_cloud_location_request(const struct lte_lc_cells_info *const cells_inf, const struct wifi_scan_info *const wifi_inf, const struct nrf_cloud_location_config *const config, diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c index b0c689681c2d..cf3bf939924f 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c @@ -120,6 +120,7 @@ static void cache_pgps_header(const struct nrf_cloud_pgps_header *header); static int consume_pgps_data(uint8_t pnum, const char *buf, size_t buf_len); static void prediction_work_handler(struct k_work *work); static void prediction_timer_handler(struct k_timer *dummy); +static bool prediction_timer_is_running(void); void agnss_print_enable(bool enable); static void print_time_details(const char *info, int64_t sec, uint16_t day, uint32_t time_of_day); @@ -492,7 +493,7 @@ int nrf_cloud_pgps_notify_prediction(void) */ int err; int pnum; - struct nrf_cloud_pgps_prediction *prediction; + struct nrf_cloud_pgps_prediction *prediction = NULL; struct nrf_cloud_pgps_event evt = { .type = PGPS_EVT_AVAILABLE, }; @@ -501,6 +502,11 @@ int nrf_cloud_pgps_notify_prediction(void) LOG_ERR("P-GPS subsystem is not initialized."); return -EINVAL; } + + if (prediction_timer_is_running()) { + LOG_INF("Not time to find next prediction yet."); + return 0; + } LOG_DBG("num_predictions:%d, replacement threshold:%d", NUM_PREDICTIONS, REPLACEMENT_THRESHOLD); @@ -529,7 +535,7 @@ int nrf_cloud_pgps_notify_prediction(void) /* the application should now send data to modem with * nrf_cloud_pgps_inject() */ - if (evt_handler) { + if (evt_handler && prediction) { evt.prediction = prediction; evt_handler(&evt); } @@ -539,12 +545,12 @@ int nrf_cloud_pgps_notify_prediction(void) static void prediction_work_handler(struct k_work *work) { - struct nrf_cloud_pgps_prediction *p; + struct nrf_cloud_pgps_prediction *p = NULL; int ret; LOG_DBG("Prediction is expiring; finding next"); ret = nrf_cloud_pgps_find_prediction(&p); - if (ret >= 0) { + if ((ret >= 0) && p) { LOG_DBG("found prediction %d; injecting to modem", ret); ret = nrf_cloud_pgps_inject(p, NULL); if (ret) { @@ -583,6 +589,11 @@ static void start_expiration_timer(int pnum, int64_t cur_gps_sec) } } +static bool prediction_timer_is_running(void) +{ + return k_timer_remaining_ticks(&prediction_timer) > 0; +} + static void print_time_details(const char *info, int64_t sec, uint16_t day, uint32_t time_of_day) { @@ -660,14 +671,14 @@ int nrf_cloud_pgps_find_prediction(struct nrf_cloud_pgps_prediction **prediction * falls before the first valid prediction; default to * first entry and day and time for it */ - LOG_WRN("cannot find prediction; real time not known"); + LOG_WRN("Cannot find prediction; real time not known"); return -ETIMEUNKNOWN; } else if (cur_gps_sec > end_sec) { if ((cur_gps_sec - end_sec) > PGPS_MARGIN_SEC) { index.cur_pnum = 0xff; state = PGPS_EXPIRED; loading_in_progress = false; /* make sure we request it */ - LOG_WRN("data expired!"); + LOG_WRN("Data expired!"); return -ETIMEDOUT; } margin = true; @@ -676,7 +687,7 @@ int nrf_cloud_pgps_find_prediction(struct nrf_cloud_pgps_prediction **prediction } else { pnum = offset_sec / (SEC_PER_MIN * period_min); if (pnum >= index.header.prediction_count) { - LOG_WRN("prediction num:%d -- too large", pnum); + LOG_WRN("Prediction num:%d -- too large", pnum); pnum = index.header.prediction_count - 1; } } @@ -1778,10 +1789,11 @@ int nrf_cloud_pgps_init(struct nrf_cloud_pgps_init_param *param) if (num_valid) { LOG_INF("Checking if P-GPS data is expired..."); err = nrf_cloud_pgps_find_prediction(&found_prediction); - if (err == -ETIMEDOUT) { - LOG_WRN("Predictions expired. Requesting predictions..."); + if (err < 0) { + LOG_ERR("Find prediction returned err: %d", err); + LOG_WRN("Requesting predictions..."); num_valid = 0; - } else if (err >= 0) { + } else { LOG_INF("Found valid prediction, day:%u, time:%u", found_prediction->time.date_day, found_prediction->time.time_full_s); @@ -1833,7 +1845,7 @@ int nrf_cloud_pgps_init(struct nrf_cloud_pgps_init_param *param) } else { state = PGPS_READY; LOG_INF("P-GPS data is up to date."); - if (evt_handler) { + if (evt_handler && found_prediction) { evt.type = PGPS_EVT_AVAILABLE; evt.prediction = found_prediction; evt_handler(&evt); 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 3012334aa2ff..301b02b3fe3c 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 @@ -483,6 +483,15 @@ int npgps_download_start(const char *host, const char *file, int sec_tag, return -EINVAL; } +#if defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) + int family = AF_UNSPEC; +#elif defined(CONFIG_NET_IPV6) + int family = AF_INET6; +#elif defined(CONFIG_NET_IPV4) + int family = AF_INET; +#else + int family = AF_UNSPEC; +#endif /* defined(CONFIG_NET_IPV6) && defined(CONFIG_NET_IPV4) */ int err; struct nrf_cloud_download_data dl = { .type = NRF_CLOUD_DL_TYPE_DL_CLIENT, @@ -494,7 +503,7 @@ int npgps_download_start(const char *host, const char *file, int sec_tag, .pdn_id = pdn_id, .frag_size_override = fragment_size, .set_tls_hostname = false, - .family = AF_INET + .family = family }, .dlc = &dlc }; diff --git a/subsys/net/lib/nrf_cloud/src/nrf_cloud_transport.c b/subsys/net/lib/nrf_cloud/src/nrf_cloud_transport.c index d57cfaa6460c..9d3b80fdb760 100644 --- a/subsys/net/lib/nrf_cloud/src/nrf_cloud_transport.c +++ b/subsys/net/lib/nrf_cloud/src/nrf_cloud_transport.c @@ -1026,6 +1026,7 @@ int nct_connect(void) .ai_socktype = SOCK_STREAM }; + LOG_DBG("Connecting to host: %s", NRF_CLOUD_HOSTNAME); err = getaddrinfo(NRF_CLOUD_HOSTNAME, NULL, &hints, &result); if (err) { LOG_DBG("getaddrinfo failed %d", err); @@ -1102,6 +1103,11 @@ int nct_cc_connect(void) .message_id = NCT_MSG_ID_CC_SUB }; + LOG_DBG("Subscribing to:"); + for (int i = 0; i < subscription_list.list_count; i++) { + LOG_DBG("%.*s", subscription_list.list[i].topic.size, + (const char *)subscription_list.list[i].topic.utf8); + } return mqtt_subscribe(&nct.client, &subscription_list); } @@ -1249,6 +1255,11 @@ int nct_dc_connect(void) .message_id = NCT_MSG_ID_DC_SUB }; + LOG_DBG("Subscribing to:"); + for (int i = 0; i < subscription_list.list_count; i++) { + LOG_DBG("%.*s", subscription_list.list[i].topic.size, + (const char *)subscription_list.list[i].topic.utf8); + } return mqtt_subscribe(&nct.client, &subscription_list); } diff --git a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c index a31dc7c8306d..7228b5cb43b9 100644 --- a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c +++ b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning.c @@ -45,7 +45,7 @@ K_CONDVAR_DEFINE(np_cond); #define SETTINGS_STORAGE_PREFIX CONFIG_NRF_PROVISIONING_SETTINGS_STORAGE_PATH static bool nw_connected = true; - +static bool reschedule; /* nRF Provisioning context */ static struct nrf_provisioning_http_context rest_ctx = { @@ -494,6 +494,8 @@ int nrf_provisioning_schedule(void) retry_s += spread_s; LOG_DBG("Connecting in %llds", retry_s); + reschedule = false; + return retry_s; } @@ -512,6 +514,42 @@ static void commit_latest_cmd_id(void) } } +void nrf_provisioning_set_interval(int interval) +{ + LOG_DBG("Provisioning interval set to %d", interval); + + if (interval != nxt_provisioning) { + char time_str[sizeof(STRINGIFY(2147483647))] = {0}; + int ret; + + nxt_provisioning = interval; + reschedule = true; + + ret = k_mutex_lock(&np_mtx, K_NO_WAIT); + if (ret < 0) { + LOG_ERR("Unable to lock mutex, err: %d", ret); + return; + } + /* Let the provisioning thread run */ + k_condvar_signal(&np_cond); + k_mutex_unlock(&np_mtx); + + ret = snprintf(time_str, sizeof(time_str), "%d", interval); + if (ret < 0) { + LOG_ERR("Unable to convert interval to string"); + return; + } + + ret = settings_save_one(SETTINGS_STORAGE_PREFIX "/interval-sec", + time_str, strlen(time_str) + 1); + if (ret) { + LOG_ERR("Unable to store interval, err: %d", ret); + return; + } + LOG_DBG("Stored interval: \"%s\"", time_str); + } +} + int nrf_provisioning_req(void) { int ret; @@ -535,7 +573,7 @@ int nrf_provisioning_req(void) k_condvar_wait(&np_cond, &np_mtx, K_SECONDS(ret)); k_mutex_unlock(&np_mtx); - } while (!nw_connected); + } while (!nw_connected || reschedule); dm.cb(NRF_PROVISIONING_EVENT_START, dm.user_data); if (IS_ENABLED(CONFIG_NRF_PROVISIONING_HTTP)) { diff --git a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_coap.c b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_coap.c index 935034fa255c..29df08f597c9 100644 --- a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_coap.c +++ b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_coap.c @@ -134,7 +134,7 @@ static int dtls_setup(int fd) } /* Enable connection ID */ - uint32_t dtls_cid = TLS_DTLS_CID_ENABLED; + uint32_t dtls_cid = TLS_DTLS_CID_SUPPORTED; err = zsock_setsockopt(fd, SOL_TLS, TLS_DTLS_CID, &dtls_cid, sizeof(dtls_cid)); if (err) { diff --git a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_shell.c b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_shell.c index 7e6a30f59063..0cc134292b05 100644 --- a/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_shell.c +++ b/subsys/net/lib/nrf_provisioning/src/nrf_provisioning_shell.c @@ -23,6 +23,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define NRF_PROVISIONING_HELP_INIT "Start the client" #define NRF_PROVISIONING_HELP_TOKEN "Get the attestation token" #define NRF_PROVISIONING_HELP_UUID "Get device UUID" +#define NRF_PROVISIONING_HELP_INTERVAL "Set provisioning interval" static int cmd_now(const struct shell *sh, size_t argc, char **argv) { @@ -73,12 +74,29 @@ static int cmd_uuid(const struct shell *sh, size_t argc, char **argv) return 0; } +static int cmd_interval(const struct shell *sh, size_t argc, char **argv) +{ + ARG_UNUSED(sh); + ARG_UNUSED(argc); + + if (argc < 2) { + shell_error(sh, "No interval provided"); + shell_print(sh, "Usage: nrf_provisioning interval "); + return -EINVAL; + } + + nrf_provisioning_set_interval(atoi(argv[1])); + + return 0; +} + SHELL_STATIC_SUBCMD_SET_CREATE( sub_nrf_provisioning, SHELL_CMD(init, NULL, NRF_PROVISIONING_HELP_INIT, cmd_init), SHELL_CMD(now, NULL, NRF_PROVISIONING_HELP_NOW, cmd_now), SHELL_CMD(token, NULL, NRF_PROVISIONING_HELP_TOKEN, cmd_token), SHELL_CMD(uuid, NULL, NRF_PROVISIONING_HELP_UUID, cmd_uuid), + SHELL_CMD(interval, NULL, NRF_PROVISIONING_HELP_INTERVAL, cmd_interval), SHELL_SUBCMD_SET_END); diff --git a/subsys/net/lib/wifi_credentials/Kconfig b/subsys/net/lib/wifi_credentials/Kconfig index cc6ca2efbbae..ee95d01ff9fe 100644 --- a/subsys/net/lib/wifi_credentials/Kconfig +++ b/subsys/net/lib/wifi_credentials/Kconfig @@ -101,6 +101,9 @@ config WIFI_CREDENTIALS_STATIC_TYPE_PSK_SHA256 config WIFI_CREDENTIALS_STATIC_TYPE_SAE bool "SAE" +config WIFI_CREDENTIALS_STATIC_TYPE_WPA_PSK + bool "WPA-PSK" + endchoice endif diff --git a/subsys/net/lib/wifi_credentials/wifi_credentials.c b/subsys/net/lib/wifi_credentials/wifi_credentials.c index 35d7e2058d24..a0a93bf15cb8 100644 --- a/subsys/net/lib/wifi_credentials/wifi_credentials.c +++ b/subsys/net/lib/wifi_credentials/wifi_credentials.c @@ -135,7 +135,8 @@ int wifi_credentials_get_by_ssid_personal_struct(const char *ssid, size_t ssid_l if (buf->header.type != WIFI_SECURITY_TYPE_NONE && buf->header.type != WIFI_SECURITY_TYPE_PSK && buf->header.type != WIFI_SECURITY_TYPE_PSK_SHA256 && - buf->header.type != WIFI_SECURITY_TYPE_SAE) { + buf->header.type != WIFI_SECURITY_TYPE_SAE && + buf->header.type != WIFI_SECURITY_TYPE_WPA_PSK) { LOG_ERR("Requested WiFi credentials entry is corrupted"); ret = -EPROTO; goto exit; @@ -191,7 +192,7 @@ int wifi_credentials_set_personal_struct(const struct wifi_credentials_personal int wifi_credentials_set_personal(const char *ssid, size_t ssid_len, enum wifi_security_type type, const uint8_t *bssid, size_t bssid_len, const char *password, - size_t password_len, uint32_t flags) + size_t password_len, uint32_t flags, uint8_t channel) { int ret = 0; uint8_t buf[ENTRY_MAX_LEN] = { 0 }; @@ -219,6 +220,7 @@ int wifi_credentials_set_personal(const char *ssid, size_t ssid_len, enum wifi_s memcpy(header->ssid, ssid, ssid_len); header->ssid_len = ssid_len; header->flags = flags; + header->channel = channel; if (flags & WIFI_CREDENTIALS_FLAG_BSSID) { memcpy(header->bssid, bssid, WIFI_MAC_ADDR_LEN); @@ -229,6 +231,7 @@ int wifi_credentials_set_personal(const char *ssid, size_t ssid_len, enum wifi_s break; case WIFI_SECURITY_TYPE_PSK: case WIFI_SECURITY_TYPE_PSK_SHA256: + case WIFI_SECURITY_TYPE_WPA_PSK: case WIFI_SECURITY_TYPE_SAE: { struct wifi_credentials_personal *header_personal = (struct wifi_credentials_personal *)buf; @@ -253,7 +256,7 @@ int wifi_credentials_get_by_ssid_personal(const char *ssid, size_t ssid_len, enum wifi_security_type *type, uint8_t *bssid_buf, size_t bssid_buf_len, char *password_buf, size_t password_buf_len, size_t *password_len, - uint32_t *flags) + uint32_t *flags, uint8_t *channel) { int ret = 0; uint8_t buf[ENTRY_MAX_LEN] = { 0 }; @@ -285,6 +288,7 @@ int wifi_credentials_get_by_ssid_personal(const char *ssid, size_t ssid_len, *type = header->type; *flags = header->flags; + *channel = header->channel; if (header->flags & WIFI_CREDENTIALS_FLAG_BSSID) { memcpy(bssid_buf, header->bssid, WIFI_MAC_ADDR_LEN); @@ -295,6 +299,7 @@ int wifi_credentials_get_by_ssid_personal(const char *ssid, size_t ssid_len, break; case WIFI_SECURITY_TYPE_PSK: case WIFI_SECURITY_TYPE_PSK_SHA256: + case WIFI_SECURITY_TYPE_WPA_PSK: case WIFI_SECURITY_TYPE_SAE: { struct wifi_credentials_personal *header_personal = (struct wifi_credentials_personal *)buf; @@ -353,4 +358,38 @@ void wifi_credentials_for_each_ssid(wifi_credentials_ssid_cb cb, void *cb_arg) k_mutex_unlock(&wifi_credentials_mutex); } +bool wifi_credentials_is_empty(void) +{ + k_mutex_lock(&wifi_credentials_mutex, K_FOREVER); + for (size_t i = 0; i < CONFIG_WIFI_CREDENTIALS_MAX_ENTRIES; ++i) { + if (is_entry_used(i)) { + k_mutex_unlock(&wifi_credentials_mutex); + return false; + } + } + k_mutex_unlock(&wifi_credentials_mutex); + return true; +} + +int wifi_credentials_delete_all(void) +{ + int ret = 0; + + k_mutex_lock(&wifi_credentials_mutex, K_FOREVER); + for (size_t i = 0; i < CONFIG_WIFI_CREDENTIALS_MAX_ENTRIES; ++i) { + if (is_entry_used(i)) { + ret = wifi_credentials_delete_entry(i); + if (ret) { + LOG_ERR("Failed to delete WiFi credentials index %d, err: %d", + i, ret); + break; + } + wifi_credentials_uncache_ssid(i); + } + } + + k_mutex_unlock(&wifi_credentials_mutex); + return ret; +} + SYS_INIT(init, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c index f41499fbcd70..24835490af2b 100644 --- a/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c +++ b/subsys/net/lib/wifi_credentials/wifi_credentials_shell.c @@ -45,7 +45,8 @@ static void print_network_info(void *cb_arg, const char *ssid, size_t ssid_len) if (creds.header.type == WIFI_SECURITY_TYPE_PSK || creds.header.type == WIFI_SECURITY_TYPE_PSK_SHA256 || - creds.header.type == WIFI_SECURITY_TYPE_SAE) { + creds.header.type == WIFI_SECURITY_TYPE_SAE || + creds.header.type == WIFI_SECURITY_TYPE_WPA_PSK) { shell_fprintf(shell, SHELL_VT100_COLOR_DEFAULT, ", password: \"%.*s\", password_len: %d", creds.password_len, creds.password, creds.password_len); @@ -66,6 +67,11 @@ static void print_network_info(void *cb_arg, const char *ssid, size_t ssid_len) shell_fprintf(shell, SHELL_VT100_COLOR_DEFAULT, ", band: 5GHz"); } + if (creds.header.channel) { + shell_fprintf(shell, SHELL_VT100_COLOR_DEFAULT, ", channel: %d", + creds.header.channel); + } + if (creds.header.flags & WIFI_CREDENTIALS_FLAG_FAVORITE) { shell_fprintf(shell, SHELL_VT100_COLOR_DEFAULT, ", favorite"); } @@ -94,6 +100,9 @@ static enum wifi_security_type parse_sec_type(const char *s) if (strcmp("WPA3-SAE", s) == 0) { return WIFI_SECURITY_TYPE_SAE; } + if (strcmp("WPA-PSK", s) == 0) { + return WIFI_SECURITY_TYPE_WPA_PSK; + } return WIFI_SECURITY_TYPE_UNKNOWN; } @@ -140,7 +149,8 @@ static int cmd_add_network(const struct shell *shell, size_t argc, char *argv[]) if (creds.header.type == WIFI_SECURITY_TYPE_PSK || creds.header.type == WIFI_SECURITY_TYPE_PSK_SHA256 || - creds.header.type == WIFI_SECURITY_TYPE_SAE) { + creds.header.type == WIFI_SECURITY_TYPE_SAE || + creds.header.type == WIFI_SECURITY_TYPE_WPA_PSK) { /* parse passphrase */ if (argc < 4) { shell_error(shell, "Missing password"); @@ -186,6 +196,16 @@ static int cmd_add_network(const struct shell *shell, size_t argc, char *argv[]) } } + if (arg_idx < argc) { + /* look for channel */ + char *end; + + creds.header.channel = strtol(argv[arg_idx], &end, 10); + if (*end == '\0') { + ++arg_idx; + } + } + if (arg_idx < argc) { /* look for favorite flag */ if (strncmp("favorite", argv[arg_idx], strlen("favorite")) == 0) { @@ -214,10 +234,11 @@ static int cmd_add_network(const struct shell *shell, size_t argc, char *argv[]) return wifi_credentials_set_personal_struct(&creds); help: shell_print(shell, "Usage: wifi_cred add \"network name\"" - " {OPEN, WPA2-PSK, WPA2-PSK-SHA256, WPA3-SAE}" + " {OPEN, WPA2-PSK, WPA2-PSK-SHA256, WPA3-SAE, WPA-PSK}" " [psk/password]" " [bssid]" " [{2.4GHz, 5GHz}]" + " [channel]" " [favorite]" " [mfp_disabled|mfp_required]"); return -EINVAL; diff --git a/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c b/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c index c101dbdce350..407fabeffc33 100644 --- a/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c +++ b/subsys/net/lib/wifi_mgmt_ext/wifi_mgmt_ext.c @@ -70,7 +70,9 @@ static int __stored_creds_to_params(struct wifi_credentials_personal *creds, /* Defaults */ params->security = creds->header.type; - params->channel = WIFI_CHANNEL_ANY; + + /* If channel is set to 0 we default to ANY. 0 is not a valid Wi-Fi channel. */ + params->channel = (creds->header.channel != 0) ? creds->header.channel : WIFI_CHANNEL_ANY; params->timeout = CONFIG_WIFI_MGMT_EXT_CONNECTION_TIMEOUT; /* Security type (optional) */ @@ -204,6 +206,8 @@ static int add_static_network_config(struct net_if *iface) creds.header.type = WIFI_SECURITY_TYPE_PSK_SHA256; #elif defined(CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_SAE) creds.header.type = WIFI_SECURITY_TYPE_SAE; +#elif defined(CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_WPA_PSK) + creds.header.type = WIFI_SECURITY_TYPE_WPA_PSK; #else #error "invalid CONFIG_WIFI_CREDENTIALS_STATIC_TYPE" #endif diff --git a/subsys/net/openthread/Kconfig b/subsys/net/openthread/Kconfig index 559baa6c6211..ecd59db8e2fb 100644 --- a/subsys/net/openthread/Kconfig +++ b/subsys/net/openthread/Kconfig @@ -42,6 +42,7 @@ config OPENTHREAD_NRF_SECURITY_PSA select PSA_WANT_ALG_ECB_NO_PADDING select PSA_WANT_ALG_SHA_224 select PSA_WANT_ALG_SHA_256 + select PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 select PSA_WANT_ALG_GCM if OPENTHREAD_BLE_TCAT select PSA_WANT_ALG_JPAKE if (OPENTHREAD_JOINER || OPENTHREAD_COMMISSIONER) select PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS if (OPENTHREAD_JOINER || OPENTHREAD_COMMISSIONER) @@ -51,7 +52,10 @@ config OPENTHREAD_NRF_SECURITY_PSA select PSA_WANT_ECC_SECP_R1_256 select PSA_WANT_GENERATE_RANDOM select PSA_WANT_KEY_TYPE_AES - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE imply OPENTHREAD_CRYPTO_PSA help Enables nrf_security module for use by OpenThread with PSA Crypto enabled. diff --git a/subsys/net/openthread/Kconfig.defconfig b/subsys/net/openthread/Kconfig.defconfig index df1cf4c4bdc1..32e2a4c1ab1c 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 y + default n depends on OPENTHREAD_THREAD_VERSION_1_3 depends on (OPENTHREAD_NORDIC_LIBRARY_MASTER && SOC_NRF52840) || \ OPENTHREAD_NORDIC_LIBRARY_FTD || OPENTHREAD_NORDIC_LIBRARY_MTD @@ -31,25 +31,7 @@ choice OPENTHREAD_IMPLEMENTATION default OPENTHREAD_LIBRARY if OPENTHREAD_LIBRARY_AVAILABLE endchoice -if SOC_SERIES_NRF54LX - -#To be removed -config OBERON_BACKEND - bool - default y - -#To be removed -config PSA_CRYPTO_DRIVER_OBERON - bool - default y - -#To be removed -config PSA_CRYPTO_DRIVER_CRACEN - bool - default y - -endif -if SOC_NRF54H20_ENGA_CPUAPP +if SOC_NRF54H20_CPUAPP #To be removed config ENTROPY_TEST_PRNG @@ -122,7 +104,7 @@ config OPENTHREAD_MANUAL_START default y choice OPENTHREAD_SECURITY - default OPENTHREAD_NRF_SECURITY_PSA_CHOICE if SOC_FAMILY_NRF + default OPENTHREAD_NRF_SECURITY_PSA_CHOICE if SOC_FAMILY_NORDIC_NRF endchoice config MBEDTLS_SSL_PROTO_DTLS @@ -240,11 +222,12 @@ config NET_PKT_TIMESTAMP # CSL Transmitter configuration config OPENTHREAD_PLATFORM_CSL_UNCERT int + default 30 if BOARD_NRF54L15PDK_NRF54L15_CPUAPP default 12 config IEEE802154_NRF5_DELAY_TRX_ACC int - default 50 if BOARD_NRF52840DONGLE_NRF52840 + default 50 if BOARD_NRF52840DONGLE_NRF52840 || BOARD_NRF54L15PDK_NRF54L15_CPUAPP default 20 if OPENTHREAD_CSL_RECEIVER @@ -269,6 +252,10 @@ config OPENTHREAD_CSL_TIMEOUT int default 20 +config OPENTHREAD_CSL_RECEIVER_LOCAL_TIME_SYNC + bool + default y if NRF_802154_SER_HOST + endif # OPENTHREAD_CSL_RECEIVER endif # !OPENTHREAD_THREAD_VERSION_1_1 diff --git a/subsys/nfc/lib/Kconfig b/subsys/nfc/lib/Kconfig index 483db38b6bd0..0c9e4eeb8123 100644 --- a/subsys/nfc/lib/Kconfig +++ b/subsys/nfc/lib/Kconfig @@ -83,7 +83,6 @@ endif# NFC_OWN_THREAD config NFC_LOW_LATENCY_IRQ bool "Use low latency IRQ for NFC" - default y # NFC low latency interrupt requires software interrupt being supported. default y if $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_EGU)) || \ $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_SWI)) @@ -111,25 +110,25 @@ choice NFC_SWI config NFC_SWI0 bool "SWI0" - depends on HAS_HW_NRF_EGU0 || HAS_HW_NRF_SWI0 + depends on HAS_HW_NRF_EGU0 || HAS_HW_NRF_SWI0 || SOC_SERIES_NRF54LX help Use SWI0 for NFC. config NFC_SWI1 bool "SWI1" - depends on HAS_HW_NRF_EGU1 || HAS_HW_NRF_SWI1 + depends on HAS_HW_NRF_EGU1 || HAS_HW_NRF_SWI1 || SOC_SERIES_NRF54LX help Use SWI1 for NFC. config NFC_SWI2 bool "SWI2" - depends on HAS_HW_NRF_EGU2 || HAS_HW_NRF_SWI2 + depends on HAS_HW_NRF_EGU2 || HAS_HW_NRF_SWI2 || SOC_SERIES_NRF54LX help Use SWI2 for NFC. config NFC_SWI3 bool "SWI3" - depends on HAS_HW_NRF_EGU3 || HAS_HW_NRF_SWI3 + depends on HAS_HW_NRF_EGU3 || HAS_HW_NRF_SWI3 || SOC_SERIES_NRF54LX help Use SWI3 for NFC. diff --git a/subsys/nfc/lib/platform_internal_thread.c b/subsys/nfc/lib/platform_internal_thread.c index c07b9fb12b40..d07d3a269ee5 100644 --- a/subsys/nfc/lib/platform_internal_thread.c +++ b/subsys/nfc/lib/platform_internal_thread.c @@ -13,8 +13,10 @@ LOG_MODULE_DECLARE(nfc_platform, CONFIG_NFC_PLATFORM_LOG_LEVEL); #ifdef CONFIG_NFC_LOW_LATENCY_IRQ #define SWI_NAME(number) SWI_NAME2(number) -#ifdef CONFIG_SOC_SERIES_NRF53X +#if defined(CONFIG_SOC_SERIES_NRF53X) #define SWI_NAME2(number) EGU ## number ## _IRQn +#elif defined(CONFIG_SOC_SERIES_NRF54LX) +#define SWI_NAME2(number) SWI0 ## number ## _IRQn #else #define SWI_NAME2(number) SWI ## number ## _IRQn #endif diff --git a/subsys/nrf_rpc/Kconfig b/subsys/nrf_rpc/Kconfig index 719837ff3de3..942690799c9f 100644 --- a/subsys/nrf_rpc/Kconfig +++ b/subsys/nrf_rpc/Kconfig @@ -36,6 +36,7 @@ config HEAP_MEM_POOL_SIZE config NRF_RPC_IPC_SERVICE_BIND_TIMEOUT_MS int "Timeout while waiting for the endpoint to bind in ms" range 1 1000 + default 500 if SOC_SERIES_NRF54HX default 100 help Time in miliseconds to wait for endpoint binding. diff --git a/subsys/nrf_rpc/nrf_rpc_ipc.c b/subsys/nrf_rpc/nrf_rpc_ipc.c index b83b247515f9..7ff1fe1778d7 100644 --- a/subsys/nrf_rpc/nrf_rpc_ipc.c +++ b/subsys/nrf_rpc/nrf_rpc_ipc.c @@ -9,14 +9,16 @@ #include #include +#if CONFIG_OPENAMP #include +#endif /* CONFIG_OPENAMP */ #include #include LOG_MODULE_REGISTER(nrf_rpc_ipc, CONFIG_NRF_RPC_TR_LOG_LEVEL); -#define EPT_BIND_TIMEOUT K_MSEC(CONFIG_NRF_RPC_IPC_SERVICE_BIND_TIMEOUT_MS) +#define EPT_BIND_TIMEOUT_MS (CONFIG_NRF_RPC_IPC_SERVICE_BIND_TIMEOUT_MS) /* Utility macro for dumping content of the packets with limit of 32 bytes * to prevent overflowing the logs. @@ -30,6 +32,18 @@ do { \ } \ } while (0) +/* Endpoint states */ +enum { + /* Endpoint is uninitialized */ + NRF_RPC_IPC_STATE_UNINITIALIZED, + /* Waiting for bond */ + NRF_RPC_IPC_STATE_WAITING, + /* Endpoint is bonded and ready for transmission */ + NRF_RPC_IPC_STATE_READY, + /* Error on endpoint, -EPIPE should be returned */ + NRF_RPC_IPC_STATE_ERROR +}; + /* Translates error code from the lower layer to nRF RPC error code. */ static int translate_error(int ll_err) { @@ -43,6 +57,7 @@ static int translate_error(int ll_err) case -EBADMSG: return -NRF_EBADMSG; +#if CONFIG_OPENAMP case RPMSG_ERR_BUFF_SIZE: case RPMSG_ERR_NO_MEM: case RPMSG_ERR_NO_BUFF: @@ -53,6 +68,7 @@ static int translate_error(int ll_err) case RPMSG_ERR_INIT: case RPMSG_ERR_ADDR: return -NRF_EIO; +#endif /* CONFIG_OPENAMP */ default: if (ll_err < 0) { @@ -101,7 +117,7 @@ static int init(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t struct nrf_rpc_ipc_endpoint *endpoint = &ipc_config->endpoint; struct ipc_ept_cfg *cfg = &ipc_config->endpoint.ept_cfg; - if (ipc_config->used) { + if (ipc_config->state != NRF_RPC_IPC_STATE_UNINITIALIZED) { return 0; } @@ -113,6 +129,7 @@ static int init(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t err = ipc_service_open_instance(ipc_config->ipc); if (err && err != -EALREADY) { LOG_ERR("IPC service instance initialization failed: %d\n", err); + ipc_config->state = NRF_RPC_IPC_STATE_ERROR; return translate_error(err); } @@ -129,31 +146,40 @@ static int init(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t err = ipc_service_register_endpoint(ipc_config->ipc, &endpoint->ept, cfg); if (err) { LOG_ERR("Registering endpoint failed with %d", err); + ipc_config->state = NRF_RPC_IPC_STATE_ERROR; return translate_error(err); } - ipc_config->used = true; - - if (!k_event_wait(&endpoint->ept_bond, 0x01, false, - EPT_BIND_TIMEOUT)) { - ipc_config->used = false; - - LOG_ERR("IPC endpoint bond timeout"); - return -NRF_EPIPE; - } + ipc_config->endpoint.timeout = K_TIMEOUT_ABS_MS(k_uptime_get() + EPT_BIND_TIMEOUT_MS); + ipc_config->state = NRF_RPC_IPC_STATE_WAITING; return 0; } -int send(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length) +static int send(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length) { int err; struct nrf_rpc_ipc *ipc_config = transport->ctx; struct nrf_rpc_ipc_endpoint *endpoint = &ipc_config->endpoint; - if (!ipc_config->used) { + switch (ipc_config->state) { + case NRF_RPC_IPC_STATE_UNINITIALIZED: LOG_ERR("nRF RPC transport is not initialized"); return -NRF_EFAULT; + case NRF_RPC_IPC_STATE_WAITING: + if (!k_event_wait(&endpoint->ept_bond, 0x01, false, + ipc_config->endpoint.timeout)) { + ipc_config->state = NRF_RPC_IPC_STATE_ERROR; + LOG_ERR("IPC endpoint bond timeout"); + return -NRF_EPIPE; + } + ipc_config->state = NRF_RPC_IPC_STATE_READY; + break; + case NRF_RPC_IPC_STATE_READY: + break; + case NRF_RPC_IPC_STATE_ERROR: + LOG_ERR("IPC endpoint error"); + return -NRF_EPIPE; } LOG_DBG("Sending %u bytes", length); @@ -172,12 +198,12 @@ int send(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length) return translate_error(err); } -void *tx_buf_alloc(const struct nrf_rpc_tr *transport, size_t *size) +static void *tx_buf_alloc(const struct nrf_rpc_tr *transport, size_t *size) { void *data = NULL; struct nrf_rpc_ipc *ipc_config = transport->ctx; - if (!ipc_config->used) { + if (ipc_config->state == NRF_RPC_IPC_STATE_UNINITIALIZED) { LOG_ERR("nRF RPC transport is not initialized"); goto error; } @@ -197,11 +223,11 @@ void *tx_buf_alloc(const struct nrf_rpc_tr *transport, size_t *size) return NULL; } -void tx_buf_free(const struct nrf_rpc_tr *transport, void *buf) +static void tx_buf_free(const struct nrf_rpc_tr *transport, void *buf) { struct nrf_rpc_ipc *ipc_config = transport->ctx; - if (!ipc_config->used) { + if (ipc_config->state == NRF_RPC_IPC_STATE_UNINITIALIZED) { LOG_ERR("nRF RPC transport is not initialized"); return; } diff --git a/subsys/nrf_rpc/nrf_rpc_os.c b/subsys/nrf_rpc/nrf_rpc_os.c index a58c79218ad0..6e6b8c84f95d 100644 --- a/subsys/nrf_rpc/nrf_rpc_os.c +++ b/subsys/nrf_rpc/nrf_rpc_os.c @@ -8,6 +8,7 @@ #include #include "nrf_rpc_os.h" +#include /* Maximum number of remote thread that this implementation allows. */ #define MAX_REMOTE_THREADS 255 @@ -126,7 +127,7 @@ uint32_t nrf_rpc_os_ctx_pool_reserve(void) do { old_mask = atomic_get(&context_mask); - number = __CLZ(old_mask); + number = u32_count_leading_zeros(old_mask); new_mask = old_mask & ~(0x80000000u >> number); } while (!atomic_cas(&context_mask, old_mask, new_mask)); diff --git a/subsys/nrf_security/Kconfig b/subsys/nrf_security/Kconfig index 35736344de71..4fa0bdaebe2d 100644 --- a/subsys/nrf_security/Kconfig +++ b/subsys/nrf_security/Kconfig @@ -19,7 +19,7 @@ config NORDIC_SECURITY_BACKEND prompt "Use nRF Security with Mbed TLS legacy crypto APIs support" \ if !NORDIC_SECURITY_PROMPTLESS default y if BUILD_WITH_TFM - depends on SOC_FAMILY_NRF + depends on SOC_FAMILY_NORDIC_NRF select NRF_SECURITY select MBEDTLS_LEGACY_CRYPTO_C select OBERON_BACKEND if BUILD_WITH_TFM @@ -33,17 +33,53 @@ config NORDIC_SECURITY_BACKEND config NRF_SECURITY bool prompt "Enable nRF Security" if !PSA_PROMPTLESS - depends on SOC_FAMILY_NRF + depends on SOC_FAMILY_NORDIC_NRF default y if BUILD_WITH_TFM # entropy is provided by PSA and NRF_SECURITY on NRF54LX default y if ENTROPY_PSA_CRYPTO_RNG && SOC_SERIES_NRF54LX select DISABLE_MBEDTLS_BUILTIN if MBEDTLS # Generating random requires a CRACEN PSA Crypto driver on nrf54L select PSA_CRYPTO_DRIVER_CRACEN if PSA_WANT_GENERATE_RANDOM && SOC_SERIES_NRF54LX + # NCS does not use TF-M's BL2 bootloader, but uses it's own fork + # of MCUBoot instead (CONFIG_BOOTLOADER_MCUBOOT). + # + # Select TFM_BL2_NOT_SUPPORTED to prevent users from enabling + # CONFIG_TFM_BL2. + select TFM_BL2_NOT_SUPPORTED if BUILD_WITH_TFM help Set this configuration to enable nRF Security. This provides Arm PSA cryptography APIs with RNG support (optionally). +config NRF_SECURITY_LEGACY_AND_PSA + bool + default y + select EXPERIMENTAL + depends on MBEDTLS_LEGACY_CRYPTO_C && MBEDTLS_PSA_CRYPTO_C + # This configuration doesn't affect TF-M builds since the PSA + # APIs are provided by TF-M. + # When this configuration is enabled we manually enable + # some symbols in the build_config.h file in the Oberon PSA core. + # This requires only the Oberon PSA crypto driver to be enabled, + # it requires the CC3XX platform library to get random data and + # the trusted storage for ITS support. The depenedencies here + # match what we enable in the build_config.h file so if we need to + # modify the dependencies here we also need to modify the build_config.h. + depends on PSA_CRYPTO_DRIVER_OBERON && !PSA_CRYPTO_DRIVER_CC3XX + depends on NRF_CC3XX_PLATFORM + depends on TRUSTED_STORAGE + depends on !BUILD_WITH_TFM + help + This is an option to support legacy mbedTLS and PSA crypto APIs + at the same time. This is not recommended as it is not fully + supported in our system. This feature might get changed/removed at + any time in the future. You are advised to use the PSA APIs + for any new developments. + + This option doesn't use the nrf_security for the internal + PSA configuration. It always use the Oberon PSA driver + for all the crypto operations expect for the PRNG which + uses the nrf_cc3xx_platform library. + config PSA_PROMPTLESS bool @@ -171,7 +207,10 @@ config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED config MBEDTLS_ECP_ALL_ENABLED bool "Enable all available elliptic curves" - select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE select PSA_WANT_ECC_SECP_R1_192 select PSA_WANT_ECC_SECP_R1_224 select PSA_WANT_ECC_SECP_R1_256 diff --git a/subsys/nrf_security/cmake/config_to_tf-m.cmake b/subsys/nrf_security/cmake/config_to_tf-m.cmake index 980cd16fc418..604915b3544f 100644 --- a/subsys/nrf_security/cmake/config_to_tf-m.cmake +++ b/subsys/nrf_security/cmake/config_to_tf-m.cmake @@ -37,13 +37,6 @@ if(NOT ${CONFIG_MBEDTLS_USER_CONFIG_FILE} STREQUAL "nrf-config-user-empty.h" ) ) endif() -if(CONFIG_TFM_BL2) - set_property(TARGET zephyr_property_target - APPEND PROPERTY TFM_CMAKE_OPTIONS - -DMCUBOOT_MBEDCRYPTO_CONFIG_FILEPATH:STRING=${CONFIG_MBEDTLS_CFG_FILE} - ) -endif() - if(CONFIG_PSA_ITS_ENCRYPTED) set_property(TARGET zephyr_property_target APPEND PROPERTY TFM_CMAKE_OPTIONS diff --git a/subsys/nrf_security/cmake/psa_crypto_config.cmake b/subsys/nrf_security/cmake/psa_crypto_config.cmake index 7ce0c918e348..cdb87d107ef2 100644 --- a/subsys/nrf_security/cmake/psa_crypto_config.cmake +++ b/subsys/nrf_security/cmake/psa_crypto_config.cmake @@ -78,40 +78,171 @@ kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_256) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_384) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SHA3_512) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_HASH_DRIVER) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_RSA_KEY_SIZE_2048) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_RSA_KEY_SIZE_3072) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_RSA_KEY_SIZE_4096) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_192) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_224) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_256) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_320) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_384) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_512) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_192) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_224) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_256) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_384) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_521) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_255) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_448) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_255) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_192) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_256) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC) + +# Key management driver configurations +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY) + + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255) + + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_SECP_R1_256) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SRP_6_PUBLIC_KEY_3072) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_SRP_6_3072) + +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_GENERATE) + kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER) + +# MAC driver configurations kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_HMAC) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_CMAC) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_MAC_DRIVER) -kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_CTR_DRBG_DRIVER) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SRP_6) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_CTR_DRBG_DRIVER) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256) +kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_ECJPAKE) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_SPAKE2P) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_PAKE_DRIVER) kconfig_check_and_set_base_to_one(PSA_NEED_CRACEN_HKDF) diff --git a/subsys/nrf_security/cmake/psa_crypto_want_config.cmake b/subsys/nrf_security/cmake/psa_crypto_want_config.cmake index 3938fb5165c3..1dbd8b951fe0 100644 --- a/subsys/nrf_security/cmake/psa_crypto_want_config.cmake +++ b/subsys/nrf_security/cmake/psa_crypto_want_config.cmake @@ -153,6 +153,8 @@ kconfig_check_and_set_base_to_one(PSA_WANT_RSA_KEY_SIZE_3072) kconfig_check_and_set_base_to_one(PSA_WANT_RSA_KEY_SIZE_4096) kconfig_check_and_set_base_to_one(PSA_WANT_RSA_KEY_SIZE_6144) kconfig_check_and_set_base_to_one(PSA_WANT_RSA_KEY_SIZE_8192) +kconfig_check_and_set_base_to_one(PSA_WANT_ALG_SP800_108_COUNTER_CMAC) +kconfig_check_and_set_base_to_one(PSA_WANT_ALG_SP800_108_COUNTER_HMAC) kconfig_check_and_set_base_int(PSA_MAX_RSA_KEY_BITS) diff --git a/subsys/nrf_security/configs/nrf-config.h.template b/subsys/nrf_security/configs/nrf-config.h.template index a2ebb43e6214..1f2d9d5c5599 100644 --- a/subsys/nrf_security/configs/nrf-config.h.template +++ b/subsys/nrf_security/configs/nrf-config.h.template @@ -31,6 +31,10 @@ extern "C" { #define MBEDTLS_ASN1_PARSE_C #endif +#if defined(CONFIG_PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER) +#define MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS +#endif + /****************************************************************/ /* Require built-in implementations based on PSA requirements * @@ -74,13 +78,6 @@ extern "C" { #define MBEDTLS_SHA256_C #endif -/* Required for OPENTHREAD_NRF_SECURITY_PSA_CHOICE (KRKNWK-18015) */ -#if defined(PSA_WANT_ALG_CMAC) -#define MBEDTLS_CMAC_C -#define MBEDTLS_CIPHER_C -#define MBEDTLS_AES_C -#endif - /* Required for MBEDTLS_HAS_CBC_CIPHERSUITE_REQUIREMENTS */ #if defined(PSA_WANT_ALG_CBC_PKCS7) /* NB: check_config does not do any checks for CBC. */ diff --git a/subsys/nrf_security/configs/psa_crypto_config.h.template b/subsys/nrf_security/configs/psa_crypto_config.h.template index 4d8734cac02a..0effe3ad3c0e 100644 --- a/subsys/nrf_security/configs/psa_crypto_config.h.template +++ b/subsys/nrf_security/configs/psa_crypto_config.h.template @@ -284,37 +284,147 @@ #cmakedefine PSA_NEED_CRACEN_SHA3_256 @PSA_NEED_CRACEN_SHA3_256@ #cmakedefine PSA_NEED_CRACEN_SHA3_384 @PSA_NEED_CRACEN_SHA3_384@ #cmakedefine PSA_NEED_CRACEN_SHA3_512 @PSA_NEED_CRACEN_SHA3_512@ -#cmakedefine PSA_NEED_CRACEN_RSA_KEY_SIZE_2048 @PSA_NEED_CRACEN_RSA_KEY_SIZE_2048@ -#cmakedefine PSA_NEED_CRACEN_RSA_KEY_SIZE_3072 @PSA_NEED_CRACEN_RSA_KEY_SIZE_3072@ -#cmakedefine PSA_NEED_CRACEN_RSA_KEY_SIZE_4096 @PSA_NEED_CRACEN_RSA_KEY_SIZE_4096@ -#cmakedefine PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE @PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_192@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_224@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_256@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_320@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_384@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_512@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1 @PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_192 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_192@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_224 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_224@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_256 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_256@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_384 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_384@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_521 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_521@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_255@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_448@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY @PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_255@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS @PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_192 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_192@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_256 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_256@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1 @PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1@ -#cmakedefine PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC @PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC@ + +/* Key management driver configurations */ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1 @PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY @PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255 @PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448 @PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS @PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1 @PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY @PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE @PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_SECP_R1_256 @PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_SECP_R1_256@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 @PSA_NEED_CRACEN_KEY_TYPE_SRP_6_PUBLIC_KEY_3072@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 @PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 @PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_SRP_6_3072 @PSA_NEED_CRACEN_KEY_TYPE_SRP_6_3072@ + +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY @PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT @PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT @PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT@ +#cmakedefine PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_GENERATE @PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_GENERATE@ + #cmakedefine PSA_NEED_CRACEN_HMAC @PSA_NEED_CRACEN_HMAC@ #cmakedefine PSA_NEED_CRACEN_CMAC @PSA_NEED_CRACEN_CMAC@ #cmakedefine PSA_NEED_CRACEN_SRP_6 @PSA_NEED_CRACEN_SRP_6@ #cmakedefine PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256 @PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256@ +#cmakedefine PSA_NEED_CRACEN_ECJPAKE @PSA_NEED_CRACEN_ECJPAKE@ #cmakedefine PSA_NEED_CRACEN_SPAKE2P @PSA_NEED_CRACEN_SPAKE2P@ #cmakedefine PSA_NEED_CRACEN_HKDF @PSA_NEED_CRACEN_HKDF@ #cmakedefine PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC @PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC@ diff --git a/subsys/nrf_security/configs/psa_crypto_want_config.h.template b/subsys/nrf_security/configs/psa_crypto_want_config.h.template index 2e924ba9af25..0994899c41c2 100644 --- a/subsys/nrf_security/configs/psa_crypto_want_config.h.template +++ b/subsys/nrf_security/configs/psa_crypto_want_config.h.template @@ -162,6 +162,8 @@ #cmakedefine PSA_WANT_RSA_KEY_SIZE_4096 @PSA_WANT_RSA_KEY_SIZE_4096@ #cmakedefine PSA_WANT_RSA_KEY_SIZE_6144 @PSA_WANT_RSA_KEY_SIZE_6144@ #cmakedefine PSA_WANT_RSA_KEY_SIZE_8192 @PSA_WANT_RSA_KEY_SIZE_8192@ +#cmakedefine PSA_WANT_ALG_SP800_108_COUNTER_CMAC @PSA_WANT_ALG_SP800_108_COUNTER_CMAC@ +#cmakedefine PSA_WANT_ALG_SP800_108_COUNTER_HMAC @PSA_WANT_ALG_SP800_108_COUNTER_HMAC@ /* The Adjusting is done in this file */ #define PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H diff --git a/subsys/nrf_security/src/CMakeLists.txt b/subsys/nrf_security/src/CMakeLists.txt index b245facaedd1..192ac82a6b87 100644 --- a/subsys/nrf_security/src/CMakeLists.txt +++ b/subsys/nrf_security/src/CMakeLists.txt @@ -16,7 +16,7 @@ # For NCS the nrf_security/CMakeLists.txt file will execute this file. BUILD_INSIDE_TFM=False # -set(OBERON_PSA_PATH ${ZEPHYR_NRF_MODULE_DIR}/ext/oberon/psa) +set(OBERON_PSA_PATH ${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}) # Library for mbedcrypto includes and configurations add_library(mbedcrypto_common INTERFACE) diff --git a/subsys/nrf_security/src/core/nrf_oberon/CMakeLists.txt b/subsys/nrf_security/src/core/nrf_oberon/CMakeLists.txt index 8ae5420f153a..885bebe85257 100644 --- a/subsys/nrf_security/src/core/nrf_oberon/CMakeLists.txt +++ b/subsys/nrf_security/src/core/nrf_oberon/CMakeLists.txt @@ -12,30 +12,48 @@ target_include_directories(mbedcrypto_common # Add regular includes # Note, the order of include matters +if(CONFIG_BUILD_WITH_TFM) + # It is not supported to have a PSA core in the non-secure + # image. PSA should be provided by TF-M, not an Oberon core inside + # the non-secure image. + # + # But it is supported to have legacy mbedtls in the non-secure + # image. We therefore need to add the legacy mbedtls header files to + # the build. The TF-M PSA header files will be added elsewhere. +target_include_directories(mbedcrypto_common + INTERFACE + # Nordic PSA headers + ${NRF_SECURITY_ROOT}/include + # Mbed TLS (mbedcrypto) PSA headers + ${ARM_MBEDTLS_PATH}/library + ${ARM_MBEDTLS_PATH}/include + ${ARM_MBEDTLS_PATH}/include/library +) +else() target_include_directories(mbedcrypto_common INTERFACE # Nordic PSA headers ${NRF_SECURITY_ROOT}/include # Oberon PSA headers - ${OBERON_PSA_PATH}/core/include - ${OBERON_PSA_PATH}/core/library + ${OBERON_PSA_PATH}/include + ${OBERON_PSA_PATH}/library # Mbed TLS (mbedcrypto) PSA headers ${ARM_MBEDTLS_PATH}/include ${ARM_MBEDTLS_PATH}/library ) +endif() -append_with_prefix(src_crypto_core_oberon ${OBERON_PSA_PATH}/core/library/ +append_with_prefix(src_crypto_core_oberon ${OBERON_PSA_PATH}/library/ platform.c platform_util.c ) if (COMPILE_PSA_APIS) - append_with_prefix(src_crypto_core_oberon ${OBERON_PSA_PATH}/core/library/ + append_with_prefix(src_crypto_core_oberon ${OBERON_PSA_PATH}/library/ psa_crypto.c psa_crypto_client.c psa_crypto_slot_management.c psa_crypto_storage.c - psa_its_file.c ) endif() diff --git a/subsys/nrf_security/src/drivers/Kconfig b/subsys/nrf_security/src/drivers/Kconfig index d2ea7865286c..a3ebaf5dd7eb 100644 --- a/subsys/nrf_security/src/drivers/Kconfig +++ b/subsys/nrf_security/src/drivers/Kconfig @@ -154,33 +154,36 @@ endmenu menu "CRACEN PSA Driver Configuration" if PSA_CRYPTO_DRIVER_CRACEN -config PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER - bool "Cracen key management driver" +config PSA_USE_CRACEN_CIPHER_DRIVER + bool "Cracen cipher driver" default y config PSA_USE_CRACEN_AEAD_DRIVER bool "Cracen AEAD driver" default y -config PSA_USE_CRACEN_CIPHER_DRIVER - bool "Cracen cipher driver" +config PSA_USE_CRACEN_HASH_DRIVER + bool "Cracen hash driver" + default y + +config PSA_USE_CRACEN_MAC_DRIVER + bool "Cracen MAC driver" default y config PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER bool "Cracen key agreement driver" default y -config PSA_USE_CRACEN_ASYMMETRIC_ENCRYPTION_DRIVER - bool "Cracen asymmetric encryption driver" +config PSA_USE_CRACEN_ASYMMETRIC_DRIVER + bool "Cracen asymmetric encryption and signature driver" default y -config PSA_USE_CRACEN_HASH_DRIVER - bool "Cracen hash driver" +config PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER + bool "Cracen key management driver" default y + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER || \ + PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER -config PSA_USE_CRACEN_MAC_DRIVER - bool "Cracen MAC driver" - default y if PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER @@ -202,11 +205,6 @@ config PSA_USE_CRACEN_CTR_DRBG_DRIVER bool default y -# CTR DRBG is needed for AES counter measurements -config PSA_NEED_CRACEN_CTR_DRBG_DRIVER - bool - default y - endif endmenu diff --git a/subsys/nrf_security/src/drivers/cracen/CMakeLists.txt b/subsys/nrf_security/src/drivers/cracen/CMakeLists.txt index 869c361651dd..30887ffe6b39 100644 --- a/subsys/nrf_security/src/drivers/cracen/CMakeLists.txt +++ b/subsys/nrf_security/src/drivers/cracen/CMakeLists.txt @@ -45,7 +45,7 @@ target_compile_options( -Wno-pointer-sign ) -if(BUILD_FROM_TFM) +if(BUILD_INSIDE_TFM) # Add an empty interface library called zephyr_interface so that we # can use the zephyr_library_* API's in both the TF-M and Zephyr # build. diff --git a/subsys/nrf_security/src/drivers/cracen/Kconfig b/subsys/nrf_security/src/drivers/cracen/Kconfig index bafb06908c3e..e0f8666cd33e 100644 --- a/subsys/nrf_security/src/drivers/cracen/Kconfig +++ b/subsys/nrf_security/src/drivers/cracen/Kconfig @@ -41,24 +41,6 @@ config CRACEN_LOAD_KMU_SEED If there is no seed in KMU, it is expected to be generated. Note that this is not required to be used if a bootloader is loading KMU seed. -config CRACEN_GENERATE_KMU_SEED - bool - prompt "Generate CRACEN IKG seed in KMU" - depends on CRACEN_LIB_KMU - depends on CRACEN_LOAD_KMU_SEED - default y - help - This configuration enables generation of the CRACEN IKG seed value used for - IKG support. The generated seed is written into KMU (write once). - If the seed is already generated and written in KMU, this configuration - will have no effect. - -#TODO: NCSDK-26142 Remove once available in zephyr -config PSA_WANT_ALG_SP800_108_COUNTER_CMAC - bool - prompt "Add PSA SP800-108r1 CTR CMAC KBKDF support" - help - Temp fix until this symbol is offically in zephyr rsource 'psa_driver.Kconfig' diff --git a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/membarriers.h b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/membarriers.h index 0c2ef301eb5b..cce7528a6057 100644 --- a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/membarriers.h +++ b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/membarriers.h @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2019 Silex Insight sa - * Copyright (c) 2018 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/statuscodes.h b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/statuscodes.h index ae725b62770b..23b306f96b79 100644 --- a/subsys/nrf_security/src/drivers/cracen/common/include/cracen/statuscodes.h +++ b/subsys/nrf_security/src/drivers/cracen/common/include/cracen/statuscodes.h @@ -1,7 +1,5 @@ /* * Copyright (c) 2023 Nordic Semiconductor ASA - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake b/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake index fc306224bc46..77168b8ee47a 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake @@ -63,7 +63,7 @@ if(CONFIG_PSA_NEED_CRACEN_MAC_DRIVER) ) endif() -if(CONFIG_PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER) +if(CONFIG_PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER OR CONFIG_PSA_NEED_CRACEN_KMU_DRIVER) list(APPEND cracen_driver_sources ${CMAKE_CURRENT_LIST_DIR}/src/key_management.c ) diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h index d1f5c9294ddc..0125920d1df0 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa.h @@ -14,6 +14,7 @@ #include #include "cracen_psa_primitives.h" #include "cracen_psa_kmu.h" +#include "cracen_psa_key_ids.h" #include "sxsymcrypt/keyref.h" #ifdef __NRF_TFM__ @@ -24,16 +25,6 @@ * See "PSA Cryptography API" for documentation. */ -#define CRACEN_BUILTIN_IDENTITY_KEY_ID ((psa_key_id_t)0x7ffff001) -#define CRACEN_BUILTIN_MKEK_ID ((psa_key_id_t)0x7ffff002) -#define CRACEN_BUILTIN_MEXT_ID ((psa_key_id_t)0x7ffff003) - -#define CRACEN_IDENTITY_KEY_SLOT_NUMBER 0 -#define CRACEN_MKEK_SLOT_NUMBER 1 -#define CRACEN_MEXT_SLOT_NUMBER 2 - -#define PSA_KEY_LOCATION_CRACEN (PSA_KEY_LOCATION_VENDOR_FLAG | ('N' << 8)) - psa_status_t cracen_sign_message(const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *signature, size_t signature_size, diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_key_ids.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_key_ids.h new file mode 100644 index 000000000000..028e5f607705 --- /dev/null +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_key_ids.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef CRACEN_PSA_KEY_IDS_H +#define CRACEN_PSA_KEY_IDS_H + +#define CRACEN_BUILTIN_IDENTITY_KEY_ID ((uint32_t)0x7fffc001) +#define CRACEN_BUILTIN_MKEK_ID ((uint32_t)0x7fffc002) +#define CRACEN_BUILTIN_MEXT_ID ((uint32_t)0x7fffc003) + +#define CRACEN_IDENTITY_KEY_SLOT_NUMBER 0 +#define CRACEN_MKEK_SLOT_NUMBER 1 +#define CRACEN_MEXT_SLOT_NUMBER 2 + +#define PSA_KEY_LOCATION_CRACEN ((psa_key_location_t)(0x800000 | ('N' << 8))) + +#endif diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h index cea2752cf132..2694bb191e6e 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_kmu.h @@ -31,4 +31,16 @@ #define CRACEN_KMU_KEY_USAGE_SCHEME_ENCRYPTED 2 #define CRACEN_KMU_KEY_USAGE_SCHEME_RAW 3 +/** + * @brief Retrieves the slot number for a given key handle. + * + * @param[in] key_id Key handler. + * @param[out] lifetime Lifetime for key. + * @param[out] slot_number The key's slot number. + * + * @return psa_status_t + */ +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); + #endif /* CRACEN_PSA_KMU_H */ diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h index a8d20423eed7..c11eb03f7b22 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h @@ -36,7 +36,7 @@ #define CRACEN_MAX_AEAD_KEY_SIZE (32u) /* - * The Silex driver only supports a key size of exactly 32 bytes for + * The low level driver only supports a key size of exactly 32 bytes for * CHACHA20 (and for CHACHAPOLY for that sake). */ #define CRACEN_MAX_CHACHA20_KEY_SIZE (32u) @@ -355,9 +355,15 @@ typedef struct cracen_spake2p_operation cracen_spake2p_operation_t; struct cracen_pake_operation { psa_algorithm_t alg; union { +#ifdef CONFIG_PSA_NEED_CRACEN_SRP_6 cracen_srp_operation_t cracen_srp_ctx; +#endif /* CONFIG_PSA_NEED_CRACEN_SRP_6 */ +#ifdef CONFIG_PSA_NEED_CRACEN_ECJPAKE cracen_jpake_operation_t cracen_jpake_ctx; +#endif /* CONFIG_PSA_NEED_CRACEN_ECJPAKE */ +#ifdef CONFIG_PSA_NEED_CRACEN_SPAKE2P cracen_spake2p_operation_t cracen_spake2p_ctx; +#endif /* CONFIG_PSA_NEED_CRACEN_SPAKE2P */ }; }; typedef struct cracen_pake_operation cracen_pake_operation_t; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/aead.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/aead.c index 40e2c765fac5..c8c2b04ca4f4 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/aead.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/aead.c @@ -1,8 +1,7 @@ -/** PSA cryptographic AEAD driver for Silex Insight offload hardware. +/** * * @file * - * @copyright Copyright (c) 2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -391,6 +390,12 @@ static psa_status_t cracen_aead_update_internal(cracen_aead_operation_t *operati memcpy(operation->unprocessed_input + operation->unprocessed_input_bytes, input, input_length); operation->unprocessed_input_bytes += input_length; + /* The output_length can be NULL when we process the additional data because + * the value is not needed by any of the supported algorithms. + */ + if (output_length != NULL) { + *output_length = 0; + } return PSA_SUCCESS; } 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 f0abce9bc276..a7a90e3f8a91 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/blkcipher.c @@ -1,8 +1,7 @@ -/** PSA cryptographic Block Cipher driver for Silex Insight offload hardware. +/** * * @file * - * @copyright Copyright (c) 2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -548,7 +547,6 @@ psa_status_t cracen_cipher_update(cracen_cipher_operation_t *operation, const ui psa_status_t cracen_cipher_finish(cracen_cipher_operation_t *operation, uint8_t *output, size_t output_size, size_t *output_length) { - __ASSERT_NO_MSG(output != NULL); __ASSERT_NO_MSG(output_length != NULL); int sx_status; @@ -559,6 +557,8 @@ psa_status_t cracen_cipher_finish(cracen_cipher_operation_t *operation, uint8_t return PSA_SUCCESS; } + __ASSERT_NO_MSG(output != NULL); + sx_status = SX_ERR_UNINITIALIZED_OBJ; /* sxsymcrypt doesn't support context saving for ECB, as each encrypted block is diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c index cdb238cece07..5f17ebbf1714 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.c @@ -5,8 +5,11 @@ */ #include "common.h" + +#include #include #include +#include #include #include #include @@ -25,6 +28,20 @@ #define NOT_ENABLED_CURVE (0) #define NOT_ENABLED_HASH_ALG (0) +#ifdef NRF54H_SERIES +/* NCSDK-27273: These defines will come from an external header file. */ +#define DOMAIN_NONE 0x00 +#define DOMAIN_SECURE 0x01 +#define DOMAIN_APPLICATION 0x02 +#define DOMAIN_RADIO 0x03 +#define DOMAIN_CELL 0x04 +#define DOMAIN_ISIM 0x05 +#define DOMAIN_WIFI 0x06 +#define DOMAIN_SYSCTRL 0x08 + +#define DEVICE_SECRET_LENGTH 4 +#endif + static const uint8_t RSA_ALGORITHM_IDENTIFIER[] = {0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00}; @@ -128,27 +145,27 @@ static psa_status_t get_sx_brainpool_curve(size_t curve_bits, const struct sx_pk switch (curve_bits) { case 192: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192, (selected_curve = &sx_curve_brainpoolP192r1)); break; case 224: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224, (selected_curve = &sx_curve_brainpoolP224r1)); break; case 256: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_256, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256, (selected_curve = &sx_curve_brainpoolP256r1)); break; case 320: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320, (selected_curve = &sx_curve_brainpoolP320r1)); break; case 384: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_384, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384, (selected_curve = &sx_curve_brainpoolP384r1)); break; case 512: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_512, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512, (selected_curve = &sx_curve_brainpoolP512r1)); break; default: @@ -169,23 +186,23 @@ static psa_status_t get_sx_secp_r1_curve(size_t curve_bits, const struct sx_pk_e switch (curve_bits) { case 192: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_192, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192, (selected_curve = &sx_curve_nistp192)); break; case 224: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_224, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224, (selected_curve = &sx_curve_nistp224)); break; case 256: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_256, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256, (selected_curve = &sx_curve_nistp256)); break; case 384: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_384, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384, (selected_curve = &sx_curve_nistp384)); break; case 521: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_521, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521, (selected_curve = &sx_curve_nistp521)); break; default: @@ -206,13 +223,13 @@ static psa_status_t get_sx_secp_k1_curve(size_t curve_bits, const struct sx_pk_e switch (curve_bits) { case 192: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_192, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192, (selected_curve = &sx_curve_secp192k1)); break; case 225: return PSA_ERROR_NOT_SUPPORTED; case 256: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_256, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256, (selected_curve = &sx_curve_secp256k1)); break; } @@ -231,11 +248,11 @@ static psa_status_t get_sx_montgomery_curve(size_t curve_bits, const struct sx_p switch (curve_bits) { case 255: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_255, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255, (selected_curve = &sx_curve_x25519)); break; case 448: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_448, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448, (selected_curve = &sx_curve_x448)); break; default: @@ -256,11 +273,11 @@ static psa_status_t get_sx_edwards_curve(size_t curve_bits, const struct sx_pk_e switch (curve_bits) { case 255: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255, (selected_curve = &sx_curve_ed25519)); break; case 448: - IF_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448, + IF_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448, (selected_curve = &sx_curve_ed448)); break; default: @@ -413,7 +430,7 @@ int cracen_signature_asn1_get_operand(unsigned char **p, const unsigned char *en struct sx_buf *op) { int ret; - size_t len; + size_t len = 0; size_t i = 0; ret = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_INTEGER); @@ -421,6 +438,10 @@ int cracen_signature_asn1_get_operand(unsigned char **p, const unsigned char *en return SX_ERR_INVALID_PARAM; } + if (*p + len > end) { + return SX_ERR_INVALID_PARAM; + } + /* Drop starting zeros, if any */ for (i = 0; i < len; i++) { if ((*p)[i] != 0) { @@ -556,15 +577,70 @@ int cracen_signature_get_rsa_key(struct si_rsa_key *rsa, bool extract_pubkey, bo static int cracen_prepare_ik_key(const uint8_t *user_data) { - return sx_pk_ik_derive_keys(NULL); +#ifdef CONFIG_CRACEN_LOAD_KMU_SEED + if (!nrf_cracen_seedram_lock_check(NRF_CRACEN)) { + if (lib_kmu_push_slot(0) || lib_kmu_push_slot(1) || lib_kmu_push_slot(2)) { + return SX_ERR_INVALID_KEYREF; + } + nrf_cracen_seedram_lock_enable_set(NRF_CRACEN, true); + } +#endif + + struct sx_pk_config_ik cfg = {}; + +#ifdef NRF54H_SERIES + /* NCSDK-27273: Fetch device secret from persistent storage. */ + uint32_t device_secret[DEVICE_SECRET_LENGTH] = {}; + + cfg.device_secret = device_secret; + cfg.device_secret_sz = DEVICE_SECRET_LENGTH; + + switch (user_data[1]) { + /* Helper macro to set up an array containing the personalization string. + * The array is a multiple of 4, since the IKG takes a number of uint32_t + * as personalization string. + */ +#define SET_STR(x) \ + { \ + static const char lstr_##x[((sizeof(#x) + 3) / 4) * 4] = #x; \ + cfg.key_bundle = (uint32_t *)lstr_##x; \ + cfg.key_bundle_sz = sizeof(lstr_##x) / sizeof(uint32_t); \ + } + case DOMAIN_NONE: + SET_STR(NONE); + break; + case DOMAIN_SECURE: + SET_STR(SECURE); + break; + case DOMAIN_APPLICATION: + SET_STR(APPLICATION); + break; + case DOMAIN_RADIO: + SET_STR(RADIO); + break; + case DOMAIN_CELL: + SET_STR(CELL); + break; + case DOMAIN_ISIM: + SET_STR(ISIM); + break; + case DOMAIN_WIFI: + SET_STR(WIFI); + break; + case DOMAIN_SYSCTRL: + SET_STR(SYSCTRL); + break; + + default: + return SX_ERR_INVALID_KEYREF; + } +#endif + + return sx_pk_ik_derive_keys(&cfg); } static int cracen_clean_ik_key(const uint8_t *user_data) { - /* We should call sx_pk_ik_mode_exit(NULL) here, but it hangs. - * Currently Cracen is powered off after each operation, so in - * any case Cracen is not in IK-mode for the next operation. - */ return SX_OK; } @@ -606,6 +682,7 @@ psa_status_t cracen_load_keyref(const psa_key_attributes_t *attributes, const ui k->prepare_key = cracen_prepare_ik_key; k->clean_key = cracen_clean_ik_key; + k->user_data = key_buffer; switch (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes))) { case CRACEN_BUILTIN_MKEK_ID: diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h index e0fbaf643b45..2ed84bd6b84d 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/common.h @@ -95,7 +95,7 @@ psa_status_t cracen_ecc_check_public_key(const struct sx_pk_ecurve *curve, const sx_pk_affine_point *in_pnt); /** - * \brief Tries to extract a Silex RSA key from ASN.1. + * \brief Tries to extract an RSA key from ASN.1. * * \param[out] rsa Resulting RSA key. * \param[in] extract_pubkey true to extract public key. false to extract private key. diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c index a8a3a11ed158..1dc31da2e215 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen.c @@ -15,9 +15,6 @@ #include "common.h" #include "microcode_binary.h" -/* The KMU slot that is used for the CRACEN->SEED. */ -#define SLOT_OFFSET 0 - static int users; K_MUTEX_DEFINE(cracen_mutex); @@ -45,108 +42,6 @@ static void cracen_load_microcode(void) } } -/** - * @brief Function to check if the KMU seed slot is empty - * - * This will check three slots from a given slot_ofset to see - * that they are filled. - * - * @param[in] slot_offset Offset for the KMU seed slot - * - * @retval true if empty, otherwise false. - */ -static bool cracen_is_kmu_seed_empty(uint32_t slot_offset) -{ - for (size_t i = 0; i < 3; i++) { - if (!lib_kmu_is_slot_empty(slot_offset + i)) { - return false; - } - } - - return true; -} - -/** - * @brief Function to load the CRACEN IKG seed - * - * Use the KMU peripheral to load a seed from KMU slot "slot_offset", - * "slot_offset+1", and "slot_offset+2" into the CRACEN IKG seed registers. - * - * These KMU slots must first have been provisioned with an appropriate seed. - */ -static int cracen_load_kmu_seed(uint32_t slot_offset) -{ - for (size_t i = 0; i < 3; i++) { - LOG_DBG("Pushing KMU slot %d\n", slot_offset + i); - - int err = lib_kmu_push_slot(slot_offset + i); - - if (err) { - LOG_ERR("Failed to push KMU slot %d\n", slot_offset + i); - return err; - } - } - - return 0; -} - -static psa_status_t cracen_prng_init_kmu_seed(uint32_t slot_offset) -{ - psa_status_t status; - int err; - - LOG_DBG("Generating KMU seed\n"); - - /* If the IKG seed is already loaded (and locked). New seed can't be - * generated! - */ - bool is_locked = nrf_cracen_seedram_lock_check(NRF_CRACEN); - - if (is_locked) { - LOG_DBG("CRACEN IKG seed is already loaded!\n"); - return PSA_SUCCESS; - } - - /* Initialize CRACEN PRNG */ - status = cracen_init_random(NULL); - if (status != PSA_SUCCESS) { - LOG_DBG("Unable to initialize PRNG: %d\n", status); - return status; - } - - for (size_t i = 0; i < IKG_SEED_KMU_SLOT_NUM; i++) { - struct kmu_src_t src; - - /* Check that the KMU slot is empty before generation. */ - if (!lib_kmu_is_slot_empty(slot_offset + i)) { - LOG_DBG("KMU isn't empty (slot %d). Can't generate CRACEN IKG seed!\n", - slot_offset + i); - return PSA_ERROR_BAD_STATE; - } - - /* Populate src.value using the random data */ - status = cracen_get_random(NULL, (char *)src.value, sizeof(src.value)); - if (status != PSA_SUCCESS) { - return status; - } - - src.rpolicy = LIB_KMU_REV_POLICY_LOCKED; - src.dest = (uint64_t *)(&(NRF_CRACEN->SEED[i * 4])); - - /* There is no significance to the metadata value yet */ - src.metadata = 0x5EB0; - - err = lib_kmu_provision_slot(slot_offset + i, &src); - if (err) { - return PSA_ERROR_GENERIC_ERROR; - } - - LOG_DBG("Provisioned KMU slot %d\n", i); - } - - return PSA_SUCCESS; -} - void cracen_acquire(void) { k_mutex_lock(&cracen_mutex, K_FOREVER); @@ -235,49 +130,6 @@ int cracen_init(void) goto exit; } - if (IS_ENABLED(CONFIG_CRACEN_LOAD_KMU_SEED)) { - /** - * Check that the KMU contains the CRACEN IKG seed value. - */ - if (cracen_is_kmu_seed_empty(SLOT_OFFSET)) { - if (IS_ENABLED(CONFIG_CRACEN_GENERATE_KMU_SEED)) { - err = cracen_prng_init_kmu_seed(SLOT_OFFSET); - if (err != 0) { - goto exit; - } - } else { - /** - * Mismatch in configuration. We have enabled - * CONFIG_CRACEN_LOAD_KMU_SEED but we have no KMU stored and no way - * to generate it. - */ - LOG_ERR("CRACEN IKG seed is not in KMU, and we have no way to " - "generate it!"); - k_panic(); - } - } - - /* Try to push the CRACEN IKG seed from KMU */ - LOG_DBG("Loading CRACEN IKG seed from KMU..."); - if (cracen_load_kmu_seed(SLOT_OFFSET) != 0) { - LOG_ERR("Unable to load CRACEN IKG seed!"); - err = -ENODATA; - goto exit; - } - - if (IS_ENABLED(CONFIG_SOC_SERIES_NRF54LX)) { - /** - * Lock the CRACEN seed RAM. - * - * This must be done before the IKG engine is started. - * - * We only lock it on 54L because on 54H the SDROM locks the - * Seed RAM for us. - */ - nrf_cracen_seedram_lock_enable_set(NRF_CRACEN, true); - } - } - exit: cracen_release(); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ctr_drbg.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ctr_drbg.c index cc94f0eb8ab1..7f05dee6fc81 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ctr_drbg.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/ctr_drbg.c @@ -1,4 +1,4 @@ -/** PSA cryptographic message random driver for Silex Insight offload hardware. +/** * * @file * @@ -169,7 +169,11 @@ psa_status_t cracen_get_random(cracen_prng_context_t *context, uint8_t *output, } if (prng.initialized != CRACEN_PRNG_INITIALIZED) { - return PSA_ERROR_BAD_STATE; + psa_status_t status = cracen_init_random(context); + + if (status != PSA_SUCCESS) { + return status; + } } k_mutex_lock(&cracen_prng_context_mutex, K_FOREVER); diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/hash.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/hash.c index 23f514b5ff8d..fdd35afa6e29 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/hash.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/hash.c @@ -1,8 +1,6 @@ -/** PSA cryptographic message hashing driver for Silex Insight offload hardware. - * +/** * @file * - * @copyright Copyright (c) 2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c index f4d20389f6a8..cbc461295dd1 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_derivation.c @@ -22,7 +22,7 @@ #include #define uint32_to_be(i) \ - ((((i) & 0xFF) << 24) | ((((i) >> 8) & 0xFF) << 16) | ((((i) >> 16) & 0xFF) << 8) | \ + ((((i)&0xFF) << 24) | ((((i) >> 8) & 0xFF) << 16) | ((((i) >> 16) & 0xFF) << 8) | \ (((i) >> 24) & 0xFF)) static psa_status_t ecc_key_agreement_check_alg(psa_algorithm_t alg) @@ -646,7 +646,8 @@ psa_status_t cracen_key_derivation_input_key(cracen_key_derivation_operation_t * psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; if (operation->alg != PSA_ALG_SP800_108_COUNTER_CMAC) { - return PSA_ERROR_NOT_SUPPORTED; + return cracen_key_derivation_input_bytes(operation, step, key_buffer, + key_buffer_size); } if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) { @@ -668,7 +669,7 @@ psa_status_t cracen_key_derivation_input_key(cracen_key_derivation_operation_t * memcpy(operation->cmac_ctr.key_buffer, key_buffer, PSA_BITS_TO_BYTES(psa_get_key_bits(attributes))); - status = cracen_load_keyref(attributes, key_buffer, key_buffer_size, + status = cracen_load_keyref(attributes, operation->cmac_ctr.key_buffer, key_buffer_size, &operation->cmac_ctr.keyref); if (status != PSA_SUCCESS) { return status; @@ -1085,7 +1086,8 @@ psa_status_t cracen_key_derivation_output_bytes(cracen_key_derivation_operation_ if (IS_ENABLED(PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC) && (operation->alg == PSA_ALG_SP800_108_COUNTER_CMAC)) { - if (operation->state == CRACEN_KD_STATE_CMAC_CTR_INPUT_LABEL || + if (operation->state == CRACEN_KD_STATE_CMAC_CTR_KEY_LOADED || + operation->state == CRACEN_KD_STATE_CMAC_CTR_INPUT_LABEL || operation->state == CRACEN_KD_STATE_CMAC_CTR_INPUT_CONTEXT || operation->state == CRACEN_KD_STATE_CMAC_CTR_OUTPUT) { if (operation->state != CRACEN_KD_STATE_CMAC_CTR_OUTPUT) { diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c index f0014a0c961b..597ff720c262 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/key_management.c @@ -139,27 +139,27 @@ static psa_status_t check_ecc_key_attributes(const psa_key_attributes_t *attribu switch (curve) { case PSA_ECC_FAMILY_BRAINPOOL_P_R1: - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1)) { status = check_brainpool_alg_and_key_bits(key_alg, key_bits); } break; case PSA_ECC_FAMILY_SECP_K1: - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1)) { status = check_secp_k1_alg_and_key_bits(key_alg, key_bits); } break; case PSA_ECC_FAMILY_SECP_R1: - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1)) { status = check_secp_r1_alg_and_key_bits(key_alg, key_bits); } break; case PSA_ECC_FAMILY_MONTGOMERY: - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY)) { status = check_montgmr_alg_and_key_bits(key_alg, key_bits); } break; case PSA_ECC_FAMILY_TWISTED_EDWARDS: - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS)) { status = check_edwards_alg_and_key_bits(key_alg, key_bits); } break; @@ -436,15 +436,20 @@ static psa_status_t import_spake2p_key(const psa_key_attributes_t *attributes, c size_t bits = psa_get_key_bits(attributes); psa_key_type_t type = psa_get_key_type(attributes); + /* Check for invalid key bits*/ + if (bits != 0 && (bits != 256)) { + return PSA_ERROR_INVALID_ARGUMENT; + } + + /* We only support 256 bit keys and they PSA APIs does not enforce setting the key bits. */ + bits = 256; + switch (type) { case PSA_KEY_TYPE_SPAKE2P_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1): /* These keys contains w0 and w1. */ if (data_length != CRACEN_P256_KEY_SIZE * 2) { return PSA_ERROR_NOT_SUPPORTED; } - if (bits != 0 && (bits != 256)) { - return PSA_ERROR_INVALID_ARGUMENT; - } /* Do not allow w0 to be 0. */ if (constant_memcmp_is_zero(data, CRACEN_P256_KEY_SIZE)) { return PSA_ERROR_INVALID_ARGUMENT; @@ -461,9 +466,6 @@ static psa_status_t import_spake2p_key(const psa_key_attributes_t *attributes, c if (data_length != CRACEN_P256_KEY_SIZE + CRACEN_P256_POINT_SIZE + 1) { return PSA_ERROR_NOT_SUPPORTED; } - if (bits != 0 && (bits != 256)) { - return PSA_ERROR_INVALID_ARGUMENT; - } /* Do not allow w0 to be 0. */ if (constant_memcmp_is_zero(data, CRACEN_P256_KEY_SIZE)) { @@ -854,7 +856,7 @@ psa_status_t cracen_export_public_key(const psa_key_attributes_t *attributes, return PSA_ERROR_INVALID_ARGUMENT; } - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT)) { if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) { return export_ecc_public_key_from_keypair(attributes, key_buffer, key_buffer_size, data, data_size, @@ -865,15 +867,14 @@ psa_status_t cracen_export_public_key(const psa_key_attributes_t *attributes, } } - if (IS_ENABLED(PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE)) { - if (key_type == PSA_KEY_TYPE_RSA_KEY_PAIR) { - return export_rsa_public_key_from_keypair(attributes, key_buffer, - key_buffer_size, data, data_size, - data_length); - } else if (key_type == PSA_KEY_TYPE_RSA_PUBLIC_KEY) { - return rsa_export_public_key(attributes, key_buffer, key_buffer_size, data, - data_size, data_length); - } + if (key_type == PSA_KEY_TYPE_RSA_KEY_PAIR && + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT)) { + return export_rsa_public_key_from_keypair(attributes, key_buffer, key_buffer_size, + data, data_size, data_length); + } else if (key_type == PSA_KEY_TYPE_RSA_PUBLIC_KEY && + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY)) { + return rsa_export_public_key(attributes, key_buffer, key_buffer_size, data, + data_size, data_length); } return PSA_ERROR_NOT_SUPPORTED; @@ -899,7 +900,8 @@ psa_status_t cracen_import_key(const psa_key_attributes_t *attributes, const uin PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); #ifdef CONFIG_PSA_NEED_CRACEN_KMU_DRIVER if (location == PSA_KEY_LOCATION_CRACEN_KMU) { - int slot_id = CRACEN_PSA_GET_KMU_SLOT(psa_get_key_id(attributes)); + int slot_id = CRACEN_PSA_GET_KMU_SLOT( + MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes))); psa_key_attributes_t stored_attributes; if (key_buffer_size < cracen_get_opaque_size(attributes)) { @@ -928,7 +930,7 @@ psa_status_t cracen_import_key(const psa_key_attributes_t *attributes, const uin return PSA_ERROR_NOT_SUPPORTED; } - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC)) { + if (IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT)) { if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) { return import_ecc_private_key(attributes, data, data_length, key_buffer, key_buffer_size, key_buffer_length, key_bits); @@ -938,11 +940,10 @@ psa_status_t cracen_import_key(const psa_key_attributes_t *attributes, const uin } } - if (IS_ENABLED(PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE)) { - if (PSA_KEY_TYPE_IS_RSA(key_type)) { - return import_rsa_key(attributes, data, data_length, key_buffer, - key_buffer_size, key_buffer_length, key_bits); - } + if (PSA_KEY_TYPE_IS_RSA(key_type) && + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT)) { + return import_rsa_key(attributes, data, data_length, key_buffer, key_buffer_size, + key_buffer_length, key_bits); } if (PSA_KEY_TYPE_IS_SPAKE2P(key_type) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { @@ -1114,6 +1115,9 @@ psa_status_t cracen_generate_key(const psa_key_attributes_t *attributes, uint8_t if (location == PSA_KEY_LOCATION_CRACEN_KMU) { uint8_t key[CRACEN_KMU_MAX_KEY_SIZE]; size_t key_bits; + if (PSA_BITS_TO_BYTES(psa_get_key_bits(attributes) > sizeof(key))) { + return PSA_ERROR_NOT_SUPPORTED; + } psa_status_t status = psa_generate_random(key, PSA_BITS_TO_BYTES(psa_get_key_bits(attributes))); if (status != PSA_SUCCESS) { @@ -1133,18 +1137,16 @@ psa_status_t cracen_generate_key(const psa_key_attributes_t *attributes, uint8_t return PSA_ERROR_INVALID_ARGUMENT; } - if (IS_ENABLED(PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC)) { - if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) { - return generate_ecc_private_key(attributes, key_buffer, key_buffer_size, - key_buffer_length); - } + if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type) && + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE)) { + return generate_ecc_private_key(attributes, key_buffer, key_buffer_size, + key_buffer_length); } - if (IS_ENABLED(PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE)) { - if (key_type == PSA_KEY_TYPE_RSA_KEY_PAIR) { - return generate_rsa_private_key(attributes, key_buffer, key_buffer_size, - key_buffer_length); - } + if (key_type == PSA_KEY_TYPE_RSA_KEY_PAIR && + IS_ENABLED(PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_GENERATE)) { + return generate_rsa_private_key(attributes, key_buffer, key_buffer_size, + key_buffer_length); } return PSA_ERROR_NOT_SUPPORTED; @@ -1158,12 +1160,13 @@ size_t cracen_get_opaque_size(const psa_key_attributes_t *attributes) case CRACEN_BUILTIN_IDENTITY_KEY_ID: if (psa_get_key_type(attributes) == PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)) { - return 1; + return 2; } + break; case CRACEN_BUILTIN_MEXT_ID: case CRACEN_BUILTIN_MKEK_ID: if (psa_get_key_type(attributes) == PSA_KEY_TYPE_AES) { - return 1; + return 2; } } } @@ -1200,7 +1203,8 @@ psa_status_t cracen_get_builtin_key(psa_drv_slot_number_t slot_number, */ if (key_buffer_size >= cracen_get_opaque_size(attributes)) { *key_buffer_length = cracen_get_opaque_size(attributes); - *key_buffer = slot_number; + key_buffer[0] = slot_number; + key_buffer[1] = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(attributes)); return PSA_SUCCESS; } else { return PSA_ERROR_BUFFER_TOO_SMALL; @@ -1214,7 +1218,7 @@ psa_status_t cracen_get_builtin_key(psa_drv_slot_number_t slot_number, PSA_KEY_LOCATION_CRACEN)); psa_set_key_type(attributes, PSA_KEY_TYPE_AES); psa_set_key_bits(attributes, 256); - psa_set_key_algorithm(attributes, PSA_ALG_CMAC); + psa_set_key_algorithm(attributes, PSA_ALG_SP800_108_COUNTER_CMAC); psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_DERIVE | PSA_KEY_USAGE_VERIFY_DERIVATION); @@ -1223,7 +1227,8 @@ psa_status_t cracen_get_builtin_key(psa_drv_slot_number_t slot_number, */ if (key_buffer_size >= cracen_get_opaque_size(attributes)) { *key_buffer_length = cracen_get_opaque_size(attributes); - *key_buffer = slot_number; + key_buffer[0] = slot_number; + key_buffer[1] = MBEDTLS_SVC_KEY_ID_GET_OWNER_ID(psa_get_key_id(attributes)); return PSA_SUCCESS; } else { return PSA_ERROR_BUFFER_TOO_SMALL; @@ -1304,7 +1309,8 @@ psa_status_t cracen_destroy_key(const psa_key_attributes_t *attributes) PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)); if (location == PSA_KEY_LOCATION_CRACEN_KMU) { - uint32_t slot_id = CRACEN_PSA_GET_KMU_SLOT(psa_get_key_id(attributes)); + uint32_t slot_id = CRACEN_PSA_GET_KMU_SLOT( + MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(attributes))); psa_status_t status = cracen_kmu_revoke_key_slot(slot_id++); if (status != PSA_SUCCESS) { @@ -1316,8 +1322,8 @@ psa_status_t cracen_destroy_key(const psa_key_attributes_t *attributes) if (status != PSA_SUCCESS) { return status; } - if (CRACEN_PSA_GET_KEY_USAGE_SCHEME(psa_get_key_id(attributes)) == - KMU_METADATA_SCHEME_ENCRYPTED) { + if (CRACEN_PSA_GET_KEY_USAGE_SCHEME(MBEDTLS_SVC_KEY_ID_GET_KEY_ID( + psa_get_key_id(attributes))) == KMU_METADATA_SCHEME_ENCRYPTED) { status = cracen_kmu_revoke_key_slot(slot_id++); if (status == PSA_SUCCESS) { status = cracen_kmu_revoke_key_slot(slot_id++); 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 04fbd296fc4f..deddeb278bd6 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c @@ -16,10 +16,9 @@ #include "cracen_psa.h" #include "kmu.h" -#include "zephyr/sys/__assert.h" /* NCSDK-25121: Ensure address of this array is at a fixed address. */ -uint8_t kmu_push_area[64] __aligned(8); +uint8_t kmu_push_area[64] __aligned(16); typedef struct kmu_metadata { uint32_t metadata_version: 4; @@ -72,7 +71,7 @@ static psa_status_t get_encryption_key(const uint8_t *context, uint8_t *key) psa_status_t status; psa_key_attributes_t mkek_attr = PSA_KEY_ATTRIBUTES_INIT; - psa_set_key_id(&mkek_attr, CRACEN_BUILTIN_MKEK_ID); + psa_set_key_id(&mkek_attr, mbedtls_svc_key_id_make(0, CRACEN_BUILTIN_MKEK_ID)); psa_set_key_lifetime(&mkek_attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( PSA_KEY_PERSISTENCE_READ_ONLY, PSA_KEY_LOCATION_CRACEN)); @@ -242,6 +241,12 @@ psa_status_t convert_to_psa_attributes(kmu_metadata *metadata, psa_key_attribute psa_set_key_lifetime(key_attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( readonly, PSA_KEY_LOCATION_CRACEN_KMU)); + if (metadata->key_usage_scheme == KMU_METADATA_SCHEME_SEED) { + psa_set_key_type(key_attr, PSA_KEY_TYPE_RAW_DATA); + psa_set_key_bits(key_attr, 384); + return PSA_SUCCESS; + } + switch (metadata->algorithm) { case METADATA_ALG_CHACHA20: psa_set_key_type(key_attr, PSA_KEY_TYPE_CHACHA20); @@ -303,7 +308,7 @@ psa_status_t convert_to_psa_attributes(kmu_metadata *metadata, psa_key_attribute for (size_t i = 0; metadata_usage_flags; i++) { if (metadata_usage_flags & 1) { - if (i > ARRAY_SIZE(metadata_usage_flags_mapping)) { + if (i >= ARRAY_SIZE(metadata_usage_flags_mapping)) { return PSA_ERROR_GENERIC_ERROR; } usage_flags |= metadata_usage_flags_mapping[i]; @@ -342,6 +347,34 @@ psa_status_t convert_from_psa_attributes(const psa_key_attributes_t *key_attr, memset(metadata, 0, sizeof(*metadata)); metadata->metadata_version = 0; + metadata->key_usage_scheme = CRACEN_PSA_GET_KEY_USAGE_SCHEME( + MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(key_attr))); + + switch (metadata->key_usage_scheme) { + case KMU_METADATA_SCHEME_PROTECTED: + case KMU_METADATA_SCHEME_SEED: + case KMU_METADATA_SCHEME_ENCRYPTED: + case KMU_METADATA_SCHEME_RAW: + break; + default: + return PSA_ERROR_INVALID_ARGUMENT; + } + + if (metadata->key_usage_scheme == KMU_METADATA_SCHEME_PROTECTED) { + if (psa_get_key_usage_flags(key_attr) & PSA_KEY_USAGE_EXPORT) { + return PSA_ERROR_INVALID_ARGUMENT; + } + if (psa_get_key_usage_flags(key_attr) & PSA_KEY_USAGE_COPY) { + return PSA_ERROR_INVALID_ARGUMENT; + } + } + + if (metadata->key_usage_scheme == KMU_METADATA_SCHEME_SEED) { + metadata->rpolicy = LIB_KMU_REV_POLICY_LOCKED; + metadata->size = METADATA_ALG_KEY_BITS_384_SEED; + return PSA_SUCCESS; + } + switch (psa_get_key_algorithm(key_attr)) { case PSA_ALG_STREAM_CIPHER: metadata->algorithm = METADATA_ALG_CHACHA20; @@ -430,10 +463,8 @@ psa_status_t convert_from_psa_attributes(const psa_key_attributes_t *key_attr, return PSA_ERROR_NOT_SUPPORTED; } - metadata->key_usage_scheme = CRACEN_PSA_GET_KEY_USAGE_SCHEME(psa_get_key_id(key_attr)); - if (metadata->key_usage_scheme > KMU_METADATA_SCHEME_RAW) { - return PSA_ERROR_INVALID_ARGUMENT; - } + metadata->key_usage_scheme = CRACEN_PSA_GET_KEY_USAGE_SCHEME( + MBEDTLS_SVC_KEY_ID_GET_KEY_ID(psa_get_key_id(key_attr))); if (metadata->key_usage_scheme == KMU_METADATA_SCHEME_PROTECTED) { if (psa_get_key_usage_flags(key_attr) & PSA_KEY_USAGE_EXPORT) { @@ -466,11 +497,6 @@ psa_status_t cracen_kmu_provision(const psa_key_attributes_t *key_attr, int slot uint8_t encrypted_workmem[CRACEN_KMU_SLOT_KEY_SIZE * 4]; size_t encrypted_outlen = 0; - /* Only 128, 192 and 256 bit keys are supported. */ - if (key_buffer_size != 16 && key_buffer_size != 24 && key_buffer_size != 32) { - return PSA_ERROR_INVALID_ARGUMENT; - } - psa_status_t status = convert_from_psa_attributes(key_attr, &metadata); if (status) { @@ -480,10 +506,23 @@ psa_status_t cracen_kmu_provision(const psa_key_attributes_t *key_attr, int slot switch (metadata.key_usage_scheme) { case KMU_METADATA_SCHEME_PROTECTED: 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) { + return PSA_ERROR_INVALID_ARGUMENT; + } break; case KMU_METADATA_SCHEME_ENCRYPTED: case KMU_METADATA_SCHEME_RAW: push_address = (uint8_t *)kmu_push_area; + if (key_buffer_size != 16 && key_buffer_size != 24 && key_buffer_size != 32) { + return PSA_ERROR_INVALID_ARGUMENT; + } + break; + case KMU_METADATA_SCHEME_SEED: + push_address = (uint8_t *)NRF_CRACEN->SEED; + if (key_buffer_size != 16 * 3) { + return PSA_ERROR_INVALID_ARGUMENT; + } break; default: return PSA_ERROR_INVALID_ARGUMENT; @@ -594,10 +633,12 @@ psa_status_t cracen_kmu_get_builtin_key(psa_drv_slot_number_t slot_number, psa_status_t status = PSA_SUCCESS; - if (attributes) { - status = convert_to_psa_attributes(&metadata, attributes); + if (!attributes) { + return PSA_ERROR_INVALID_ARGUMENT; } + status = convert_to_psa_attributes(&metadata, attributes); + if (status != PSA_SUCCESS) { return status; } @@ -607,10 +648,25 @@ psa_status_t cracen_kmu_get_builtin_key(psa_drv_slot_number_t slot_number, kmu_opaque_key_buffer *key = (kmu_opaque_key_buffer *)key_buffer; key->key_usage_scheme = metadata.key_usage_scheme; - key->number_of_slots = metadata.size > METADATA_ALG_KEY_BITS_128 ? 2 : 1; + switch (metadata.size) { + case METADATA_ALG_KEY_BITS_128: + key->number_of_slots = 1; + break; + case METADATA_ALG_KEY_BITS_192: + case METADATA_ALG_KEY_BITS_256: + key->number_of_slots = 2; + break; + case METADATA_ALG_KEY_BITS_384_SEED: + key->number_of_slots = 3; + break; + default: + return PSA_ERROR_DATA_INVALID; + } + if (key->key_usage_scheme == KMU_METADATA_SCHEME_ENCRYPTED) { key->number_of_slots += 2; } + key->slot_id = slot_number; return PSA_SUCCESS; } else { diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.h b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.h index 0b1b226b0d49..7c7648172da6 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.h +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.h @@ -15,11 +15,12 @@ enum kmu_metadata_key_bits { METADATA_ALG_KEY_BITS_128 = 1, METADATA_ALG_KEY_BITS_192 = 2, METADATA_ALG_KEY_BITS_256 = 3, + METADATA_ALG_KEY_BITS_384_SEED = 4, }; typedef struct { uint8_t key_usage_scheme: 2; /* value of @ref kmu_metadata_key_usage_scheme. */ - uint8_t number_of_slots: 2; /* Number of slots to push. */ + uint8_t number_of_slots: 3; /* Number of slots to push. */ uint8_t slot_id; /* KMU slot number. */ } kmu_opaque_key_buffer; @@ -51,7 +52,7 @@ extern uint8_t kmu_push_area[64]; * @brief Callback function that prepares a key for usage by Cracen. * * @param[in] user_data - * @return Silex status code. + * @return sxsymcrypt status code. */ int cracen_kmu_prepare_key(const uint8_t *user_data); @@ -59,22 +60,10 @@ int cracen_kmu_prepare_key(const uint8_t *user_data); * @brief Callback function that clears transient buffers related to key handling. * * @param[in] user_data - * @return Silex status code. + * @return sxsymcrypt status code. */ int cracen_kmu_clean_key(const uint8_t *user_data); -/** - * @brief Retrieves the slot number for a given key handle. - * - * @param[in] key_id Key handler. - * @param[out] lifetime Lifetime for key. - * @param[out] slot_number The key's slot number. - * - * @return psa_status_t - */ -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); - /** * @brief Retrieves attributes and opaque key buffer for key. * diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/pake.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/pake.c index b6a99ccb02c2..9f515d6673e1 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/pake.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/pake.c @@ -20,19 +20,21 @@ psa_status_t cracen_pake_setup(cracen_pake_operation_t *operation, psa_status_t status = PSA_ERROR_NOT_SUPPORTED; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_setup(&operation->cracen_jpake_ctx, attributes, password, password_length, cipher_suite); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_setup(&operation->cracen_srp_ctx, attributes, password, password_length, cipher_suite); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_setup(&operation->cracen_spake2p_ctx, attributes, password, password_length, cipher_suite); - } - - if (status != PSA_SUCCESS) { - return status; +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -43,13 +45,19 @@ psa_status_t cracen_pake_set_user(cracen_pake_operation_t *operation, const uint { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_set_user(&operation->cracen_jpake_ctx, user_id, user_id_len); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_set_user(&operation->cracen_srp_ctx, user_id, user_id_len); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_set_user(&operation->cracen_spake2p_ctx, user_id, user_id_len); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -59,10 +67,14 @@ psa_status_t cracen_pake_set_peer(cracen_pake_operation_t *operation, const uint size_t peer_id_len) { if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE return cracen_jpake_set_peer(&operation->cracen_jpake_ctx, peer_id, peer_id_len); +#endif /* PSA_NEED_CRACEN_ECJPAKE */ } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P return cracen_spake2p_set_peer(&operation->cracen_spake2p_ctx, peer_id, peer_id_len); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } else { return PSA_ERROR_NOT_SUPPORTED; } @@ -73,13 +85,15 @@ psa_status_t cracen_pake_set_context(cracen_pake_operation_t *operation, const u { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { return PSA_ERROR_NOT_SUPPORTED; - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { return PSA_ERROR_NOT_SUPPORTED; - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_set_context(&operation->cracen_spake2p_ctx, context, context_length); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -89,12 +103,24 @@ psa_status_t cracen_pake_set_role(cracen_pake_operation_t *operation, psa_pake_r { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_set_role(&operation->cracen_jpake_ctx, role); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#else + status = PSA_ERROR_NOT_SUPPORTED; +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_set_role(&operation->cracen_srp_ctx, role); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#else + status = PSA_ERROR_NOT_SUPPORTED; +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_set_role(&operation->cracen_spake2p_ctx, role); +#else + status = PSA_ERROR_NOT_SUPPORTED; +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -105,15 +131,21 @@ psa_status_t cracen_pake_output(cracen_pake_operation_t *operation, psa_pake_ste { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_output(&operation->cracen_jpake_ctx, step, output, output_size, output_length); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_output(&operation->cracen_srp_ctx, step, output, output_size, output_length); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_output(&operation->cracen_spake2p_ctx, step, output, output_size, output_length); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -124,14 +156,20 @@ psa_status_t cracen_pake_input(cracen_pake_operation_t *operation, psa_pake_step { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_input(&operation->cracen_jpake_ctx, step, input, input_length); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_input(&operation->cracen_srp_ctx, step, input, input_length); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_input(&operation->cracen_spake2p_ctx, step, input, input_length); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -143,17 +181,23 @@ psa_status_t cracen_pake_get_shared_key(cracen_pake_operation_t *operation, { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_get_shared_key(&operation->cracen_jpake_ctx, attributes, key_buffer, key_buffer_size, key_buffer_length); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_get_shared_key(&operation->cracen_srp_ctx, attributes, key_buffer, key_buffer_size, key_buffer_length); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_get_shared_key(&operation->cracen_spake2p_ctx, attributes, key_buffer, key_buffer_size, key_buffer_length); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; @@ -163,12 +207,18 @@ psa_status_t cracen_pake_abort(cracen_pake_operation_t *operation) { psa_status_t status = PSA_ERROR_BAD_STATE; - if (PSA_ALG_IS_JPAKE(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256)) { + if (PSA_ALG_IS_JPAKE(operation->alg)) { +#ifdef PSA_NEED_CRACEN_ECJPAKE status = cracen_jpake_abort(&operation->cracen_jpake_ctx); - } else if (PSA_ALG_IS_SRP_6(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SRP_6)) { +#endif /* PSA_NEED_CRACEN_ECJPAKE */ + } else if (PSA_ALG_IS_SRP_6(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SRP_6 status = cracen_srp_abort(&operation->cracen_srp_ctx); - } else if (PSA_ALG_IS_SPAKE2P(operation->alg) && IS_ENABLED(PSA_NEED_CRACEN_SPAKE2P)) { +#endif /* PSA_NEED_CRACEN_SRP_6 */ + } else if (PSA_ALG_IS_SPAKE2P(operation->alg)) { +#ifdef PSA_NEED_CRACEN_SPAKE2P status = cracen_spake2p_abort(&operation->cracen_spake2p_ctx); +#endif /* PSA_NEED_CRACEN_SPAKE2P */ } return status; diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c index 9773e3c0ebdb..759074a2e0ca 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/sign.c @@ -1,8 +1,6 @@ -/** PSA cryptographic message sign driver for Silex Insight offload hardware. - * +/** * @file * - * @copyright Copyright (c) 2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c index 8d10ae9bfca4..1f401405eaca 100644 --- a/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c +++ b/subsys/nrf_security/src/drivers/cracen/cracenpsa/src/spake2p.c @@ -24,8 +24,6 @@ #include #include #include -#include -#include #define MAKE_SX_POINT(name, ptr, point_size) \ sx_pk_affine_point name = {{.bytes = (ptr), .sz = (point_size) / 2}, \ @@ -302,8 +300,8 @@ static psa_status_t cracen_get_confirmation(cracen_spake2p_operation_t *operatio size_t length; return psa_driver_wrapper_mac_compute( - &attributes, kconf, CRACEN_SPAKE2P_HASH_LEN, PSA_ALG_HMAC(PSA_ALG_SHA_256), share, - CRACEN_P256_POINT_SIZE, confirmation, CRACEN_SPAKE2P_HASH_LEN, &length); + &attributes, kconf, operation->shared_len, PSA_ALG_HMAC(PSA_ALG_SHA_256), share, + CRACEN_P256_POINT_SIZE + 1, confirmation, CRACEN_SPAKE2P_HASH_LEN, &length); } static psa_status_t cracen_p256_reduce(cracen_spake2p_operation_t *operation, @@ -467,6 +465,10 @@ static psa_status_t cracen_write_confirm(cracen_spake2p_operation_t *operation, if (operation->role == PSA_PAKE_ROLE_SERVER) { status = cracen_get_confirmation_keys(operation, operation->KconfVP, operation->KconfPV); + + if (status) { + return status; + } } status = cracen_get_confirmation(operation, operation->KconfPV, operation->YX, output); @@ -605,8 +607,26 @@ psa_status_t cracen_spake2p_set_context(cracen_spake2p_operation_t *operation, return cracen_update_hash_with_length(&operation->hash_op, context, context_len, 0); } +static psa_status_t cracen_spake2p_get_L_from_w1(cracen_spake2p_operation_t *operation, + uint8_t *w1_buf, uint8_t *L_buf) +{ + int sx_status; + + struct sx_buf w1 = {.sz = operation->curve->sz, .bytes = w1_buf}; + + sx_pk_affine_point L_pnt = {.x = {.sz = w1.sz, .bytes = L_buf}, + .y = {.sz = w1.sz, .bytes = L_buf + w1.sz}}; + + sx_status = sx_ecp_ptmult(operation->curve, &w1, SX_PTMULT_CURVE_GENERATOR, &L_pnt); + + return silex_statuscodes_to_psa(sx_status); +} + psa_status_t cracen_spake2p_set_role(cracen_spake2p_operation_t *operation, psa_pake_role_t role) { + psa_status_t status; + const size_t L_half_len = sizeof(operation->w1_or_L) / 2; + switch (role) { case PSA_PAKE_ROLE_CLIENT: operation->MN = SPAKE2P_POINT_M; @@ -615,6 +635,18 @@ psa_status_t cracen_spake2p_set_role(cracen_spake2p_operation_t *operation, psa_ case PSA_PAKE_ROLE_SERVER: operation->MN = SPAKE2P_POINT_N; operation->NM = SPAKE2P_POINT_M; + + /* When the password contains "w0 || w1" we need to generate L based on w1. */ + if (constant_memcmp_is_zero(&operation->w1_or_L[L_half_len], L_half_len)) { + /* We can reuse the w1_or_L buffer since the server role doesn't use w1 + * afterwards. + */ + status = cracen_spake2p_get_L_from_w1(operation, operation->w1_or_L, + operation->w1_or_L); + if (status != PSA_SUCCESS) { + return status; + } + } break; default: return PSA_ERROR_NOT_SUPPORTED; diff --git a/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig b/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig index fcc7162b8466..f36f7231d282 100644 --- a/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig +++ b/subsys/nrf_security/src/drivers/cracen/psa_driver.Kconfig @@ -12,2688 +12,1831 @@ visible if 0 config PSA_NEED_CRACEN_CCM_AES bool default y + select PSA_ACCEL_CCM_AES_128 + select PSA_ACCEL_CCM_AES_192 + select PSA_ACCEL_CCM_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_CCM + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_AEAD_DRIVER config PSA_NEED_CRACEN_GCM_AES bool default y + select PSA_ACCEL_GCM_AES_128 + select PSA_ACCEL_GCM_AES_192 + select PSA_ACCEL_GCM_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_GCM + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_AEAD_DRIVER config PSA_NEED_CRACEN_CHACHA20_POLY1305 bool default y + select PSA_ACCEL_CHACHA20_POLY1305 + depends on PSA_WANT_ALG_CHACHA20_POLY1305 + depends on PSA_USE_CRACEN_AEAD_DRIVER config PSA_NEED_CRACEN_AEAD_DRIVER bool default y + depends on PSA_NEED_CRACEN_CCM_AES || PSA_NEED_CRACEN_GCM_AES || PSA_NEED_CRACEN_CHACHA20_POLY1305 # CRACEN Cipher Driver config PSA_NEED_CRACEN_CTR_AES bool default y + select PSA_ACCEL_CTR_AES_128 + select PSA_ACCEL_CTR_AES_192 + select PSA_ACCEL_CTR_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_CTR + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_CIPHER_DRIVER config PSA_NEED_CRACEN_CBC_PKCS7_AES bool default y + select PSA_ACCEL_CBC_PKCS7_AES_128 + select PSA_ACCEL_CBC_PKCS7_AES_192 + select PSA_ACCEL_CBC_PKCS7_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_CBC_PKCS7 + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_CIPHER_DRIVER config PSA_NEED_CRACEN_CBC_NO_PADDING_AES bool default y + select PSA_ACCEL_CBC_NO_PADDING_AES_128 + select PSA_ACCEL_CBC_NO_PADDING_AES_192 + select PSA_ACCEL_CBC_NO_PADDING_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_CBC_NO_PADDING + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_CIPHER_DRIVER config PSA_NEED_CRACEN_ECB_NO_PADDING_AES bool default y + select PSA_ACCEL_ECB_NO_PADDING_AES_128 + select PSA_ACCEL_ECB_NO_PADDING_AES_192 + select PSA_ACCEL_ECB_NO_PADDING_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_ECB_NO_PADDING + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_CIPHER_DRIVER config PSA_NEED_CRACEN_OFB_AES bool default y + select PSA_ACCEL_OFB_AES_128 + select PSA_ACCEL_OFB_AES_192 + select PSA_ACCEL_OFB_AES_256 + depends on PSA_WANT_AES_KEY_SIZE_128 || PSA_WANT_AES_KEY_SIZE_192 || PSA_WANT_AES_KEY_SIZE_256 + depends on PSA_WANT_ALG_OFB + depends on PSA_WANT_KEY_TYPE_AES + depends on PSA_USE_CRACEN_CIPHER_DRIVER config PSA_NEED_CRACEN_STREAM_CIPHER_CHACHA20 bool default y + select PSA_ACCEL_STREAM_CIPHER_CHACHA20 + depends on PSA_WANT_ALG_STREAM_CIPHER + depends on PSA_WANT_KEY_TYPE_CHACHA20 + depends on PSA_USE_CRACEN_CIPHER_DRIVER + config PSA_NEED_CRACEN_CIPHER_DRIVER bool default y + depends on PSA_NEED_CRACEN_CTR_AES || \ + PSA_NEED_CRACEN_CBC_PKCS7_AES || \ + PSA_NEED_CRACEN_CBC_NO_PADDING_AES || \ + PSA_NEED_CRACEN_ECB_NO_PADDING_AES || \ + PSA_NEED_CRACEN_OFB_AES || \ + PSA_NEED_CRACEN_STREAM_CIPHER_CHACHA20 # CRACEN Key Agreement Driver config PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_256 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_384 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_512 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1 bool default y + depends on PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1_512 config PSA_NEED_CRACEN_ECDH_SECP_R1_192 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_R1_224 bool default y + select PSA_ACCEL_ECDH_SECP_R1_224 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_R1_256 bool default y + select PSA_ACCEL_ECDH_SECP_R1_256 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_R1_384 bool default y + select PSA_ACCEL_ECDH_SECP_R1_384 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER + config PSA_NEED_CRACEN_ECDH_SECP_R1_521 bool default y + select PSA_ACCEL_ECDH_SECP_R1_521 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_R1 bool default y + depends on PSA_NEED_CRACEN_ECDH_SECP_R1_192 || \ + PSA_NEED_CRACEN_ECDH_SECP_R1_224 || \ + PSA_NEED_CRACEN_ECDH_SECP_R1_256 || \ + PSA_NEED_CRACEN_ECDH_SECP_R1_384 || \ + PSA_NEED_CRACEN_ECDH_SECP_R1_521 config PSA_NEED_CRACEN_ECDH_MONTGOMERY_255 bool default y + select PSA_ACCEL_ECDH_MONTGOMERY_255 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_MONTGOMERY_448 bool default y + select PSA_ACCEL_ECDH_MONTGOMERY_448 + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_MONTGOMERY bool default y + depends on PSA_NEED_CRACEN_ECDH_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_ECDH_MONTGOMERY_448 config PSA_NEED_CRACEN_ECDH_SECP_K1_192 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_K1_256 bool default y + depends on PSA_WANT_ALG_ECDH + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER config PSA_NEED_CRACEN_ECDH_SECP_K1 bool default y + depends on PSA_NEED_CRACEN_ECDH_SECP_K1_192 || \ + PSA_NEED_CRACEN_ECDH_SECP_K1_256 config PSA_NEED_CRACEN_KEY_AGREEMENT_DRIVER bool default y + depends on PSA_NEED_CRACEN_ECDH_BRAINPOOL_P_R1 || \ + PSA_NEED_CRACEN_ECDH_SECP_R1 || \ + PSA_NEED_CRACEN_ECDH_MONTGOMERY || \ + PSA_NEED_CRACEN_ECDH_SECP_K1 # CRACEN Signature Driver config PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_256 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER config PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_384 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER config PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_512 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER config PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1 bool default y + depends on PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1_512 config PSA_NEED_CRACEN_ECDSA_SECP_R1_192 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_R1_224 bool default y + select PSA_ACCEL_ECDSA_SECP_R1_224_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_ECDSA_SECP_R1_224_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_ECDSA_SECP_R1_224_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_ECDSA_SECP_R1_224_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_ECDSA_SECP_R1_224_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_R1_256 bool default y + select PSA_ACCEL_ECDSA_SECP_R1_256_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_ECDSA_SECP_R1_256_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_ECDSA_SECP_R1_256_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_ECDSA_SECP_R1_256_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_ECDSA_SECP_R1_256_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_R1_384 bool default y + select PSA_ACCEL_ECDSA_SECP_R1_384_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_ECDSA_SECP_R1_384_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_ECDSA_SECP_R1_384_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_ECDSA_SECP_R1_384_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_ECDSA_SECP_R1_384_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_R1_521 bool default y + select PSA_ACCEL_ECDSA_SECP_R1_521_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_ECDSA_SECP_R1_521_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_ECDSA_SECP_R1_521_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_ECDSA_SECP_R1_521_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_ECDSA_SECP_R1_521_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_R1 bool default y + depends on PSA_NEED_CRACEN_ECDSA_SECP_R1_192 || \ + PSA_NEED_CRACEN_ECDSA_SECP_R1_224 || \ + PSA_NEED_CRACEN_ECDSA_SECP_R1_256 || \ + PSA_NEED_CRACEN_ECDSA_SECP_R1_384 || \ + PSA_NEED_CRACEN_ECDSA_SECP_R1_521 config PSA_NEED_CRACEN_ECDSA_SECP_K1_192 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_K1_256 bool default y + depends on PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ECDSA_SECP_K1 bool default y + depends on PSA_NEED_CRACEN_ECDSA_SECP_K1_192 || \ + PSA_NEED_CRACEN_ECDSA_SECP_K1_256 config PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_PURE_EDDSA_TWISTED_EDWARDS_255 + depends on PSA_WANT_ALG_PURE_EDDSA + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_PURE_EDDSA_TWISTED_EDWARDS_448 + depends on PSA_WANT_ALG_PURE_EDDSA + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS bool default y + depends on PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS_448 config PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_ECC bool default y + depends on PSA_NEED_CRACEN_ECDSA_BRAINPOOL_P_R1 || \ + PSA_NEED_CRACEN_ECDSA_SECP_R1 || \ + PSA_NEED_CRACEN_ECDSA_SECP_K1 || \ + PSA_NEED_CRACEN_PURE_EDDSA_TWISTED_EDWARDS config PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN bool default y + select PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_RSA_KEY_SIZE_2048 || PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 + depends on PSA_WANT_ALG_RSA_PKCS1V15_SIGN + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_RSA_PSS bool default y + select PSA_ACCEL_RSA_PSS_2048_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PSS_2048_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PSS_2048_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PSS_2048_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PSS_2048_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_PSS_3072_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PSS_3072_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PSS_3072_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PSS_3072_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PSS_3072_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_PSS_4096_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_PSS_4096_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_PSS_4096_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_PSS_4096_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_PSS_4096_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_RSA_KEY_SIZE_2048 || PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 + depends on PSA_WANT_ALG_RSA_PSS + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_RSA bool default y + depends on PSA_NEED_CRACEN_RSA_PKCS1V15_SIGN || PSA_NEED_CRACEN_RSA_PSS config PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER bool default y + depends on PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_ECC || \ + PSA_NEED_CRACEN_ASYMMETRIC_SIGNATURE_ANY_RSA # CRACEN Asymmetric Encryption Driver config PSA_NEED_CRACEN_RSA_OAEP bool default y + select PSA_ACCEL_RSA_OAEP_2048_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_OAEP_2048_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_OAEP_2048_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_OAEP_2048_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_OAEP_2048_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_OAEP_3072_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_OAEP_3072_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_OAEP_3072_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_OAEP_3072_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_OAEP_3072_SHA_512 if PSA_WANT_ALG_SHA_512 + select PSA_ACCEL_RSA_OAEP_4096_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_RSA_OAEP_4096_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_RSA_OAEP_4096_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_RSA_OAEP_4096_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_RSA_OAEP_4096_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_RSA_KEY_SIZE_2048 || PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 + depends on PSA_WANT_ALG_RSA_OAEP + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_RSA_PKCS1V15_CRYPT bool default y + select PSA_ACCEL_RSA_PKCS1V15_CRYPT_2048 + select PSA_ACCEL_RSA_PKCS1V15_CRYPT_3072 + select PSA_ACCEL_RSA_PKCS1V15_CRYPT_4096 + depends on PSA_WANT_RSA_KEY_SIZE_2048 || PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 + depends on PSA_WANT_ALG_RSA_PKCS1V15_CRYPT + depends on PSA_USE_CRACEN_ASYMMETRIC_DRIVER config PSA_NEED_CRACEN_ASYMMETRIC_ENCRYPTION_DRIVER bool default y + depends on PSA_NEED_CRACEN_RSA_OAEP || PSA_NEED_CRACEN_RSA_PKCS1V15_CRYPT # CRACEN Hash Driver config PSA_NEED_CRACEN_SHA_1 bool default y + select PSA_ACCEL_SHA_1 + depends on PSA_WANT_ALG_SHA_1 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA_224 bool default y + select PSA_ACCEL_SHA_224 + depends on PSA_WANT_ALG_SHA_224 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA_256 bool default y + select PSA_ACCEL_SHA_256 + depends on PSA_WANT_ALG_SHA_256 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA_384 bool default y + select PSA_ACCEL_SHA_384 + depends on PSA_WANT_ALG_SHA_384 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA_512 bool default y - + select PSA_ACCEL_SHA_512 + depends on PSA_WANT_ALG_SHA_512 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA3_224 bool default y - + select PSA_ACCEL_SHA3_224 + depends on PSA_WANT_ALG_SHA3_224 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA3_256 bool default y + select PSA_ACCEL_SHA3_256 + depends on PSA_WANT_ALG_SHA3_256 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA3_384 bool default y + select PSA_ACCEL_SHA3_384 + depends on PSA_WANT_ALG_SHA3_384 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_SHA3_512 bool default y + select PSA_ACCEL_SHA3_512 + depends on PSA_WANT_ALG_SHA3_512 + depends on PSA_USE_CRACEN_HASH_DRIVER config PSA_NEED_CRACEN_HASH_DRIVER bool default y + depends on PSA_NEED_CRACEN_SHA_1 || \ + PSA_NEED_CRACEN_SHA_224 || \ + PSA_NEED_CRACEN_SHA_256 || \ + PSA_NEED_CRACEN_SHA_384 || \ + PSA_NEED_CRACEN_SHA_512 || \ + PSA_NEED_CRACEN_SHA3_224 || \ + PSA_NEED_CRACEN_SHA3_256 || \ + PSA_NEED_CRACEN_SHA3_384 || \ + PSA_NEED_CRACEN_SHA3_512 # CRACEN Key Generation Driver -config PSA_NEED_CRACEN_RSA_KEY_SIZE_2048 - bool - default y - -config PSA_NEED_CRACEN_RSA_KEY_SIZE_3072 - bool - default y - -config PSA_NEED_CRACEN_RSA_KEY_SIZE_4096 - bool - default y - -config PSA_NEED_CRACEN_ANY_RSA_KEY_SIZE - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_256 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_384 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1_512 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_BRAINPOOL_P_R1 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_192 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_224 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_256 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_384 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1_521 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_R1 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_255 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY_448 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_MONTGOMERY - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_255 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS_448 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_TWISTED_EDWARDS - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_192 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1_256 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_SECP_K1 - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_ANY_ECC - bool - default y - -config PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER - bool - default y - -# CRACEN MAC Driver - -config PSA_NEED_CRACEN_HMAC - bool - default y - -config PSA_NEED_CRACEN_CMAC - bool - default y - -config PSA_NEED_CRACEN_MAC_DRIVER - bool - default y - -# CRACEN Entropy Driver - -config PSA_NEED_CRACEN_CTR_DRBG_DRIVER - bool - default y - -# CRACEN PAKE Driver - -config PSA_NEED_CRACEN_SRP_6 - bool - default y - -config PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256 - bool - default y - -config PSA_NEED_CRACEN_SPAKE2P - bool - default y - -config PSA_NEED_CRACEN_PAKE_DRIVER - bool - default y - -# CRACEN Key derivation Driver - -config PSA_NEED_CRACEN_HKDF - bool - default y - -config PSA_NEED_CRACEN_TLS12_ECJPAKE_TO_PMS - bool - default y - -config PSA_NEED_CRACEN_TLS12_PRF - bool - default y - -config PSA_NEED_CRACEN_TLS12_PSK_TO_MS - bool - default y - -config PSA_NEED_CRACEN_PBKDF2_HMAC - bool - default y - -config PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC - bool - default y - -config PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER - bool - default y - -config PSA_NEED_CRACEN_KMU_DRIVER - bool - default y - -# NCSDK-26303: We assume all features are accelerated until we have -# configurability. It is not clear if it can be problematic to enable -# a PSA_ACCEL symbol for something that is not actually supported by -# CRACEN. -config PSA_ACCEL_CBC_MAC_AES_128 - bool - default y - -config PSA_ACCEL_CBC_MAC_AES_192 - bool - default y - -config PSA_ACCEL_CBC_MAC_AES_256 - bool - default y - -config PSA_ACCEL_CBC_MAC_ARIA - bool - default y - -config PSA_ACCEL_CBC_MAC_CAMELLIA - bool - default y - -config PSA_ACCEL_CBC_MAC_DES - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_AES_128 - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_AES_192 - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_AES_256 - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_ARIA - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_CAMELLIA - bool - default y - -config PSA_ACCEL_CBC_NO_PADDING_DES - bool - default y - -config PSA_ACCEL_CBC_PKCS7_AES_128 - bool - default y - -config PSA_ACCEL_CBC_PKCS7_AES_192 - bool - default y - -config PSA_ACCEL_CBC_PKCS7_AES_256 - bool - default y - -config PSA_ACCEL_CBC_PKCS7_ARIA - bool - default y - -config PSA_ACCEL_CBC_PKCS7_CAMELLIA - bool - default y - -config PSA_ACCEL_CBC_PKCS7_DES - bool - default y - -config PSA_ACCEL_CCM_AES_128 - bool - default y - -config PSA_ACCEL_CCM_AES_192 - bool - default y - -config PSA_ACCEL_CCM_AES_256 - bool - default y - -config PSA_ACCEL_CCM_ARIA - bool - default y - -config PSA_ACCEL_CCM_CAMELLIA +# SECP_R1_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CCM_STAR_NO_TAG_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CCM_STAR_NO_TAG_AES_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CCM_STAR_NO_TAG_AES_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CFB_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 + depends on PSA_WANT_ECC_SECP_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CFB_AES_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 -config PSA_ACCEL_CFB_AES_256 +# SECP_R1_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CFB_ARIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CFB_CAMELLIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CFB_DES +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CHACHA20_POLY1305 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 + depends on PSA_WANT_ECC_SECP_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CMAC_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 -config PSA_ACCEL_CMAC_AES_192 +# SECP_R1_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CMAC_AES_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CMAC_ARIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CMAC_CAMELLIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CMAC_DES +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CTR_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 -config PSA_ACCEL_CTR_AES_192 +# SECP_R1_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CTR_AES_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CTR_ARIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CTR_CAMELLIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_CTR_DES +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 + depends on PSA_WANT_ECC_SECP_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECB_NO_PADDING_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 -config PSA_ACCEL_ECB_NO_PADDING_AES_192 +# SECP_R1_521 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECB_NO_PADDING_AES_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECB_NO_PADDING_ARIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECB_NO_PADDING_CAMELLIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECB_NO_PADDING_DES +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 + depends on PSA_WANT_ECC_SECP_R1_521 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDH_MONTGOMERY_255 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 -config PSA_ACCEL_ECDH_MONTGOMERY_448 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_R1_521 -config PSA_ACCEL_ECDH_SECP_R1_224 +# SECP_K1_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDH_SECP_R1_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDH_SECP_R1_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDH_SECP_R1_521 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 + depends on PSA_WANT_ECC_SECP_K1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA_256 +# SECP_K1_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA3_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA3_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA3_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA3_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 + depends on PSA_WANT_ECC_SECP_K1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 -config PSA_ACCEL_ECDSA_SECP_R1_224_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_SECP_K1_256 -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA_1 +# MONTGOMERY_255 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA3_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA3_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 + depends on PSA_WANT_ECC_MONTGOMERY_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA3_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA3_512 +# MONTGOMERY_448 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_256_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 + depends on PSA_WANT_ECC_MONTGOMERY_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA3_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_MONTGOMERY_448 -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA3_256 +# TWISTED_EDWARDS_255 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA3_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA3_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_384_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_255 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA_224 +# TWISTED_EDWARDS_448 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA3_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA3_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA3_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 + depends on PSA_WANT_ECC_TWISTED_EDWARDS_448 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA3_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_TWISTED_EDWARDS_448 -config PSA_ACCEL_ECDSA_SECP_R1_521_SHA_512 +# BRAINPOOL_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_192 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 -config PSA_ACCEL_ED25519PH +# BRAINPOOL_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_ED448PH +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_FFDH_2048 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_FFDH_3072 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_FFDH_4096 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_224 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_FFDH_6144 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 -config PSA_ACCEL_FFDH_8192 +# BRAINPOOL_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GCM_AES_128 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GCM_AES_192 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GCM_AES_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GCM_ARIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GCM_CAMELLIA +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 -config PSA_ACCEL_GENERATE_RANDOM +# BRAINPOOL_320 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_320 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_GET_ENTROPY +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_320 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXPAND_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_320 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXPAND_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_320 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXPAND_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_320 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXPAND_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 -config PSA_ACCEL_HKDF_EXPAND_SHA_512 +# BRAINPOOL_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXTRACT_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXTRACT_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXTRACT_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXTRACT_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_384 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_EXTRACT_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 -config PSA_ACCEL_HKDF_SHA_1 +# BRAINPOOL_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_SHA_256 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_SHA_384 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HKDF_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 bool default y + select PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 + depends on PSA_WANT_ECC_BRAINPOOL_P_R1_512 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_HMAC_SHA_1 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 -config PSA_ACCEL_HMAC_SHA_224 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_BRAINPOOL_P_R1_512 -config PSA_ACCEL_HMAC_SHA_256 - bool - default y +# Combined ECC keys +config PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY + bool + default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 ||\ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 + +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT + bool + default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 -config PSA_ACCEL_HMAC_SHA_384 - bool - default y +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT + bool + default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 -config PSA_ACCEL_HMAC_SHA_512 +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 + +config PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE + bool + default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 + +#SPAKE2P +config PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 + bool + default y + select PSA_ACCEL_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_160 +config PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_192 +config PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_224 +config PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 bool default y + select PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 + depends on PSA_WANT_ECC_SECP_R1_256 + depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_256 +config PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_SECP_R1_256 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_320 +# SRP6 +config PSA_NEED_CRACEN_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 bool default y + select PSA_ACCEL_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 + depends on PSA_WANT_KEY_TYPE_SRP_PUBLIC_KEY + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_384 +config PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 bool default y + select PSA_ACCEL_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 + depends on PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_IMPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_BRAINPOOL_P_R1_512 +config PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 bool default y + select PSA_ACCEL_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 + depends on PSA_WANT_KEY_TYPE_SRP_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_255 +config PSA_NEED_CRACEN_KEY_TYPE_SRP_6_3072 bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 || \ + PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 || \ + PSA_NEED_CRACEN_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_MONTGOMERY_448 +# RSA key types +config PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY bool default y + select PSA_ACCEL_KEY_TYPE_RSA_2048_PUBLIC_KEY + select PSA_ACCEL_KEY_TYPE_RSA_3072_PUBLIC_KEY + # PSA_ACCEL_KEY_TYPE_RSA_4096_XXX doesn't exist + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER + depends on PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY + depends on PSA_WANT_RSA_KEY_SIZE_2048 || \ + PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_192 - bool - default y -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_224 +config PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT bool default y + select PSA_ACCEL_KEY_TYPE_RSA_2048_KEY_PAIR_IMPORT + select PSA_ACCEL_KEY_TYPE_RSA_3072_KEY_PAIR_IMPORT + # PSA_ACCEL_KEY_TYPE_RSA_4096_XXX doesn't exist + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER + depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT + depends on PSA_WANT_RSA_KEY_SIZE_2048 || \ + PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_K1_256 +config PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT bool default y + select PSA_ACCEL_KEY_TYPE_RSA_2048_KEY_PAIR_EXPORT + select PSA_ACCEL_KEY_TYPE_RSA_3072_KEY_PAIR_EXPORT + depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER + depends on PSA_WANT_RSA_KEY_SIZE_2048 || \ + PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_192 +config PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_GENERATE bool default y + depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE + depends on PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER + depends on PSA_WANT_RSA_KEY_SIZE_2048 || \ + PSA_WANT_RSA_KEY_SIZE_3072 || \ + PSA_WANT_RSA_KEY_SIZE_4096 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_224 - bool - default y -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_256 +config PSA_NEED_CRACEN_KEY_MANAGEMENT_DRIVER bool default y + depends on PSA_NEED_CRACEN_KEY_TYPE_ECC_PUBLIC_KEY || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_IMPORT || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_EXPORT || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_GENERATE || \ + PSA_NEED_CRACEN_KEY_TYPE_ECC_KEY_PAIR_DERIVE || \ + PSA_NEED_CRACEN_KEY_TYPE_SPAKE2P_SECP_R1_256 || \ + PSA_NEED_CRACEN_KEY_TYPE_SRP_6_3072 || \ + PSA_NEED_CRACEN_KEY_TYPE_RSA_PUBLIC_KEY || \ + PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \ + PSA_NEED_CRACEN_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \ + PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_384 - bool - default y +# CRACEN MAC Driver -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECP_R1_521 +config PSA_NEED_CRACEN_HMAC bool default y + select PSA_ACCEL_HMAC_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_HMAC_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_HMAC_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_HMAC_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_HMAC_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_HMAC + depends on PSA_USE_CRACEN_MAC_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_163 +config PSA_NEED_CRACEN_CMAC bool default y + select PSA_ACCEL_CMAC_AES_128 + select PSA_ACCEL_CMAC_AES_192 + select PSA_ACCEL_CMAC_AES_256 + depends on PSA_WANT_ALG_CMAC + depends on PSA_USE_CRACEN_MAC_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_233 +config PSA_NEED_CRACEN_MAC_DRIVER bool default y + depends on PSA_NEED_CRACEN_HMAC || PSA_NEED_CRACEN_CMAC -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_239 - bool - default y +# CRACEN Entropy Driver -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_283 +config PSA_NEED_CRACEN_CTR_DRBG_DRIVER bool default y + select PSA_ACCEL_GENERATE_RANDOM + # Is needed for AES counter measurements + depends on (PSA_WANT_ALG_CTR_DRBG && \ + PSA_USE_CRACEN_CTR_DRBG_DRIVER) || \ + PSA_USE_CRACEN_CIPHER_DRIVER || \ + PSA_USE_CRACEN_AEAD_DRIVER || \ + PSA_USE_CRACEN_MAC_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_409 - bool - default y +# CRACEN PAKE Driver -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_K1_571 +config PSA_NEED_CRACEN_SRP_6 bool default y + select PSA_ACCEL_SRP_6_3072_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_SRP_6 + depends on PSA_USE_CRACEN_PAKE_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_R1_163 +config PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256 bool default y + select PSA_ACCEL_ECJPAKE_SECP_R1_256_SHA_256 if PSA_WANT_ALG_SHA_256 + depends on PSA_WANT_ALG_JPAKE + depends on PSA_USE_CRACEN_PAKE_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_R1_233 +# Collection symbol for EC-JPAKE support with different curves and hash functions +config PSA_NEED_CRACEN_ECJPAKE bool default y + depends on PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_R1_283 +config PSA_NEED_CRACEN_SPAKE2P bool default y + select PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_SPAKE2P_MATTER + depends on PSA_WANT_ALG_SPAKE2P_HMAC || \ + PSA_WANT_ALG_SPAKE2P_CMAC || \ + PSA_WANT_ALG_SPAKE2P_MATTER + depends on PSA_USE_CRACEN_PAKE_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_R1_409 +config PSA_NEED_CRACEN_PAKE_DRIVER bool default y + depends on PSA_NEED_CRACEN_SRP_6 || \ + PSA_NEED_CRACEN_SPAKE2P || \ + PSA_NEED_CRACEN_ECJPAKE_SECP_R1_256 -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_SECT_R1_571 - bool - default y +# CRACEN Key derivation Driver -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_255 +config PSA_NEED_CRACEN_HKDF bool default y + select PSA_ACCEL_HKDF_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_HKDF_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_HKDF_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_HKDF_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_HKDF_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_HKDF + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE_TWISTED_EDWARDS_448 +config PSA_NEED_CRACEN_TLS12_ECJPAKE_TO_PMS bool default y + select PSA_ACCEL_TLS12_ECJPAKE_TO_PMS + depends on PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_160 +config PSA_NEED_CRACEN_TLS12_PRF bool default y + select PSA_ACCEL_TLS12_PRF_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_TLS12_PRF_SHA_384 if PSA_WANT_ALG_SHA_384 + depends on PSA_WANT_ALG_TLS12_PRF + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_192 +config PSA_NEED_CRACEN_TLS12_PSK_TO_MS bool default y + select PSA_ACCEL_TLS12_PRF_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_TLS12_PRF_SHA_384 if PSA_WANT_ALG_SHA_384 + depends on PSA_WANT_ALG_TLS12_PSK_TO_MS + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_224 +config PSA_NEED_CRACEN_PBKDF2_HMAC bool default y + select PSA_ACCEL_PBKDF2_HMAC_SHA_1 if PSA_WANT_ALG_SHA_1 + select PSA_ACCEL_PBKDF2_HMAC_SHA_224 if PSA_WANT_ALG_SHA_224 + select PSA_ACCEL_PBKDF2_HMAC_SHA_256 if PSA_WANT_ALG_SHA_256 + select PSA_ACCEL_PBKDF2_HMAC_SHA_384 if PSA_WANT_ALG_SHA_384 + select PSA_ACCEL_PBKDF2_HMAC_SHA_512 if PSA_WANT_ALG_SHA_512 + depends on PSA_WANT_ALG_PBKDF2_HMAC + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_256 +config PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC bool default y + depends on PSA_WANT_ALG_SP800_108_COUNTER_CMAC + depends on PSA_USE_CRACEN_KEY_DERIVATION_DRIVER -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_320 +config PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER bool default y + depends on PSA_NEED_CRACEN_HKDF || \ + PSA_NEED_CRACEN_TLS12_ECJPAKE_TO_PMS || \ + PSA_NEED_CRACEN_PBKDF2_HMAC || \ + PSA_NEED_CRACEN_SP800_108_COUNTER_CMAC -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_384 +config PSA_NEED_CRACEN_KMU_DRIVER bool default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_BRAINPOOL_P_R1_512 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_MONTGOMERY_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_K1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECP_R1_521 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_239 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_K1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_R1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_R1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_R1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_R1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_SECT_R1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT_TWISTED_EDWARDS_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_160 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_320 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_BRAINPOOL_P_R1_512 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_MONTGOMERY_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_K1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECP_R1_521 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_239 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_K1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_R1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_R1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_R1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_R1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_SECT_R1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE_TWISTED_EDWARDS_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_160 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_320 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_BRAINPOOL_P_R1_512 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_MONTGOMERY_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_K1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECP_R1_521 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_239 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_K1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_R1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_R1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_R1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_R1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_SECT_R1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT_TWISTED_EDWARDS_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_160 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_320 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_BRAINPOOL_P_R1_512 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_MONTGOMERY_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_K1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_192 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_224 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_384 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECP_R1_521 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_239 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_K1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_R1_163 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_R1_233 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_R1_283 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_R1_409 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_SECT_R1_571 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_255 - bool - default y - -config PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY_TWISTED_EDWARDS_448 - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1024_KEY_PAIR_EXPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1024_KEY_PAIR_IMPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1024_PUBLIC_KEY - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1536_KEY_PAIR_EXPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1536_KEY_PAIR_IMPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_1536_PUBLIC_KEY - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_2048_KEY_PAIR_EXPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_2048_KEY_PAIR_IMPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_2048_PUBLIC_KEY - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_3072_KEY_PAIR_EXPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_3072_KEY_PAIR_IMPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_3072_PUBLIC_KEY - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT - bool - default y - -config PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY - bool - default y - -config PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SPAKE2P_PUBLIC_KEY_SECP_R1_256 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SRP_6_KEY_PAIR_EXPORT_3072 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SRP_6_KEY_PAIR_IMPORT_3072 - bool - default y - -config PSA_ACCEL_KEY_TYPE_SRP_6_PUBLIC_KEY_3072 - bool - default y - -config PSA_ACCEL_MD5 - bool - default y - -config PSA_ACCEL_OFB_AES_128 - bool - default y - -config PSA_ACCEL_OFB_AES_192 - bool - default y - -config PSA_ACCEL_OFB_AES_256 - bool - default y - -config PSA_ACCEL_OFB_ARIA - bool - default y - -config PSA_ACCEL_OFB_CAMELLIA - bool - default y - -config PSA_ACCEL_OFB_DES - bool - default y - -config PSA_ACCEL_PBKDF2_AES_CMAC_PRF_128 - bool - default y - -config PSA_ACCEL_PBKDF2_HMAC_SHA_1 - bool - default y - -config PSA_ACCEL_PBKDF2_HMAC_SHA_224 - bool - default y - -config PSA_ACCEL_PBKDF2_HMAC_SHA_256 - bool - default y - -config PSA_ACCEL_PBKDF2_HMAC_SHA_384 - bool - default y - -config PSA_ACCEL_PBKDF2_HMAC_SHA_512 - bool - default y - -config PSA_ACCEL_PURE_EDDSA_TWISTED_EDWARDS_255 - bool - default y - -config PSA_ACCEL_PURE_EDDSA_TWISTED_EDWARDS_448 - bool - default y - -config PSA_ACCEL_RIPEMD160 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1024_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_1536_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_2048_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_3072_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_4096_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_6144_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_OAEP_8192_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_1024 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_1536 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_2048 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_3072 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_4096 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_6144 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_CRYPT_8192 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1024_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_1536_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_2048_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_3072_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_4096_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_6144_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PKCS1V15_SIGN_8192_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_1024_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_1536_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_2048_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_3072_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_4096_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_6144_SHA_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA_1 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA3_224 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA3_256 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA3_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA3_512 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA_384 - bool - default y - -config PSA_ACCEL_RSA_PSS_8192_SHA_512 - bool - default y - -config PSA_ACCEL_SHA_1 - bool - default y - -config PSA_ACCEL_SHA_224 - bool - default y - -config PSA_ACCEL_SHA_256 - bool - default y - -config PSA_ACCEL_SHA3_224 - bool - default y - -config PSA_ACCEL_SHA3_256 - bool - default y - -config PSA_ACCEL_SHA3_384 - bool - default y - -config PSA_ACCEL_SHA3_512 - bool - default y - -config PSA_ACCEL_SHA_384 - bool - default y - -config PSA_ACCEL_SHA_512 - bool - default y - -config PSA_ACCEL_SHA_512_224 - bool - default y - -config PSA_ACCEL_SHA_512_256 - bool - default y - -config PSA_ACCEL_SHAKE256_512 - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_CMAC - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_HMA_SHA_1 - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_HMA_SHA_224 - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_HMA_SHA_256 - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_HMA_SHA_384 - bool - default y - -config PSA_ACCEL_SP800_108_COUNTER_HMA_SHA_512 - bool - default y - -config PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_1 - bool - default y - -config PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_224 - bool - default y - -config PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_256 - bool - default y - -config PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_384 - bool - default y - -config PSA_ACCEL_SPAKE2P_CMAC_SECP_R1_256_SHA_512 - bool - default y - -config PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_1 - bool - default y - -config PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_224 - bool - default y - -config PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_256 - bool - default y - -config PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_384 - bool - default y - -config PSA_ACCEL_SPAKE2P_HMAC_SECP_R1_256_SHA_512 - bool - default y - -config PSA_ACCEL_SPAKE2P_MATTER - bool - default y - -config PSA_ACCEL_SRP_6_3072_SHA_1 - bool - default y - -config PSA_ACCEL_SRP_6_3072_SHA_224 - bool - default y - -config PSA_ACCEL_SRP_6_3072_SHA_256 - bool - default y - -config PSA_ACCEL_SRP_6_3072_SHA_384 - bool - default y - -config PSA_ACCEL_SRP_6_3072_SHA_512 - bool - default y - -config PSA_ACCEL_SRP_PASSWORD_HASH - bool - default y - -config PSA_ACCEL_STREAM_CIPHER_CHACHA20 - bool - default y - -config PSA_ACCEL_TLS12_ECJPAKE_TO_PMS - bool - default y - -config PSA_ACCEL_TLS12_PRF_SHA_256 - bool - default y - -config PSA_ACCEL_TLS12_PRF_SHA_384 - bool - default y - -config PSA_ACCEL_TLS12_PSK_TO_MS_SHA_256 - bool - default y - -config PSA_ACCEL_TLS12_PSK_TO_MS_SHA_384 - bool - default y - -config PSA_ACCEL_XTS_AES_128 - bool - default y - -config PSA_ACCEL_XTS_AES_192 - bool - default y - -config PSA_ACCEL_XTS_AES_256 - bool - default y - -config PSA_ACCEL_XTS_ARIA - bool - default y - -config PSA_ACCEL_XTS_CAMELLIA - bool - default y - -config PSA_ACCEL_XTS_DES - bool - default y - + depends on PSA_NEED_CRACEN_GCM_AES && \ + PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER && \ + CRACEN_LIB_KMU endmenu diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/README.md b/subsys/nrf_security/src/drivers/cracen/sicrypto/README.md deleted file mode 100644 index d6d34479ccea..000000000000 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# SiCrypto - -A high level crypto library for Silex Insight hardware offload. - - -## Introduction - -Silex Insight provides powerful hardware offload for symmetric cryptography -and for asymmetric (public-key) cryptography. The sxsymcrypt and SilexPK -libraries provide convenient and asynchronous software interfaces to those -offload modules. - -The hardware offload works at a very low level. The sxsymcrypt and -SilexPK libraries give a simple access to that hardware offload. But -often, that offload does not perform all the steps required by the -cryptographic protocols and standards. Sometimes, a single operation -involves multiple types of hardware offloads, for example signing a -message involves hashing and mathematical computations with the private -key. - -This library, called sicrypto, complements and builds upon SilexPK and -sxsymcrypt to provide higher level interfaces to perform popular crypto -operations. - -The API has a native asynchronous non-blocking interface. But it can -also be used very easily in a blocking synchronous way. diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbgctr.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbgctr.h index 407e4944aee7..a4a3b14aa4a8 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbgctr.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbgctr.h @@ -5,7 +5,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbghash.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbghash.h index 39077904ae77..d1050262b83f 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbghash.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/drbghash.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecc.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecc.h index 5f900c3df60e..06bda28aab98 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecc.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecc.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecdsa.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecdsa.h index 42c08f1925c1..d81db2f699dd 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecdsa.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ecdsa.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed25519.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed25519.h index f60df7ddeba8..594369b3b78a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed25519.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed25519.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed448.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed448.h index fcd0c48cd47a..a1c0f8a4ea40 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed448.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ed448.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hash.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hash.h index fbdfd9398ceb..2d328e2b3226 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hash.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hash.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hkdf.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hkdf.h index ebac67992f6a..99daa859c057 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hkdf.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hkdf.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hmac.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hmac.h index c3fd2058357e..d2131a7383f9 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hmac.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/hmac.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ik.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ik.h index 18837f5cb71b..eb3a28c79d6b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ik.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/ik.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/internal.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/internal.h index 2ab377858a7f..cf94789f6e27 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/internal.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/internal.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/kdf2.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/kdf2.h index 8300d76c37d5..500e8c1d1400 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/kdf2.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/kdf2.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/mem.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/mem.h index d4f7a0261832..2f90ffd7fef7 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/mem.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/mem.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/pbkdf2.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/pbkdf2.h index 2109290ab33f..ceb0f54bfb84 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/pbkdf2.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/pbkdf2.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keygen.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keygen.h index 17264857e4a5..115508dce69d 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keygen.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keygen.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keys.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keys.h index f2adaf7e3bd5..7c2fa4c86450 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keys.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsa_keys.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_oaep.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_oaep.h index fb2b8cb1351c..eb3d48b183f1 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_oaep.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_oaep.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_pkcs1v15.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_pkcs1v15.h index 7e3fc756621f..75a6a801f5a0 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_pkcs1v15.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsaes_pkcs1v15.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsapss.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsapss.h index 83e36f08a972..eaff1b0d15d6 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsapss.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsapss.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsassa_pkcs1v15.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsassa_pkcs1v15.h index 2792342a9ceb..c8472bcfe93b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsassa_pkcs1v15.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/rsassa_pkcs1v15.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sicrypto.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sicrypto.h index 48d2431e781d..a1b011ee3ff4 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sicrypto.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sicrypto.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sig.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sig.h index 06580aba108a..62b5816abdc8 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sig.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/sig.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/util.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/util.h index 4d3d601c6fbf..c56e96c8e93f 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/util.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/include/sicrypto/util.h @@ -1,7 +1,6 @@ /* * @file * - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/sicrypto.cmake b/subsys/nrf_security/src/drivers/cracen/sicrypto/sicrypto.cmake index 5baf987df69d..79e6aaacedc7 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/sicrypto.cmake +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/sicrypto.cmake @@ -4,7 +4,7 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -# Silex High-level Crypto API library +# High-level Crypto API library list(APPEND cracen_driver_sources ${CMAKE_CURRENT_LIST_DIR}/src/coprime_check.c ${CMAKE_CURRENT_LIST_DIR}/src/drbgctr.c diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.c index 164b6f66c38a..cec79dc1f42b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.h index 2c4a0fa62d41..e036b761902b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/coprime_check.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbgctr.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbgctr.c index 7f64adce78dd..6755af365f99 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbgctr.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbgctr.c @@ -1,6 +1,5 @@ /* DRBG AES CTR without derivation function, based on NIST SP 800-90A Rev. 1. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbghash.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbghash.c index 37d2cc6eec7f..e5944f61f1b7 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbghash.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/drbghash.c @@ -1,6 +1,5 @@ /* DRBG Hash, based on NIST SP 800-90A Rev. 1. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecc.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecc.c index 7b130027b61b..61ec3d7b3fe9 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecc.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecc.c @@ -2,7 +2,6 @@ * Based on FIPS 186-4, section B.4.2 "Key Pair Generation by Testing * Candidates". * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecdsa.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecdsa.c index 102b6d11729c..857fa1214c35 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecdsa.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ecdsa.c @@ -1,6 +1,5 @@ /* ECDSA signature generation and verification. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed25519.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed25519.c index 314857bb3f0a..8b6042c80ebd 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed25519.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed25519.c @@ -1,7 +1,6 @@ /** Ed25519 signature generation/verification and public key * computation. Based on RFC 8032. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed448.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed448.c index 0ecedf8323b5..1f5dd2c1fcca 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed448.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/ed448.c @@ -1,6 +1,5 @@ /** Ed448 signature scheme and public key computation. Based on RFC 8032. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/final.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/final.h index bfdb1dede94e..033725381e91 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/final.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/final.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hash.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hash.c index dc7644d3c5c5..5d073dc3c690 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hash.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hash.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hkdf.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hkdf.c index 4d94fd2553c8..68c505fe4693 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hkdf.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hkdf.c @@ -3,7 +3,6 @@ * Based on RFC 5869 "HMAC-based Extract-and-Expand Key Derivation * Function (HKDF)" and https://en.wikipedia.org/wiki/HKDF. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hmac.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hmac.c index e4bf7ce461d3..e3475dc976ec 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hmac.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/hmac.c @@ -1,6 +1,5 @@ /* HMAC implementation, based on FIPS 198-1. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/iksig.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/iksig.c index cf8cf4f30583..4ddbd04a596b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/iksig.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/iksig.c @@ -1,6 +1,5 @@ /* Isolated key operations (signature generation, ...) * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/mem.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/mem.c index 555219f4597a..02ae38bad3d0 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/mem.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/mem.c @@ -1,6 +1,5 @@ /* Sicrypto memory utility functions. * - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/montgomery.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/montgomery.c index a74631026072..b8077040e23a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/montgomery.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/montgomery.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/partialrun.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/partialrun.h index 18c25d6d77f7..75e786f72a26 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/partialrun.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/partialrun.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/pbkdf2.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/pbkdf2.c index 056be69051f8..b788edf2b7d6 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/pbkdf2.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/pbkdf2.c @@ -1,6 +1,5 @@ /* PBKDF2 key derivation function with HMAC as PRF, based on RFC 8018. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.c index d09b8b35a033..b169a2b5d15d 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.c @@ -1,7 +1,6 @@ /* Generation of a random number in the range from 1 to a given n (excluded). * Based on FIPS 186-4 (sections B.1.2, B.2.2, B.4.2 and B.5.2). * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.h index 935e7b7ac43c..8490eb9fb521 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rndinrange.h @@ -1,6 +1,5 @@ /* Generation of a random integer in a given range. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsa_keygen.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsa_keygen.c index 1cf289a758e2..d942eaaa33d3 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsa_keygen.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsa_keygen.c @@ -1,6 +1,5 @@ /* RSA key generation, based on FIPS 186-4. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_oaep.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_oaep.c index 6a86cd0cf54c..951dde607c3b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_oaep.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_oaep.c @@ -1,6 +1,5 @@ /* Encryption scheme RSAES-OAEP, based on RFC 8017. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_pkcs1v15.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_pkcs1v15.c index b4a26123d5f3..d6614aa490dd 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_pkcs1v15.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsaes_pkcs1v15.c @@ -1,6 +1,5 @@ /* Encryption scheme RSAES-PKCS1-v1_5, based on RFC 8017. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsakey.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsakey.h index c8d290c3737d..1ed58ac5f47b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsakey.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsakey.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.c index caaf552b98b2..043476cbf6f3 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.c @@ -1,6 +1,5 @@ /* MGF1 mask computation and bitwise xor, based on RFC 8017. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.h index 298e77ff1db9..f29ac35a2196 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsamgf1xor.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsapss.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsapss.c index 1dc2392c9225..2245b3fdaa7d 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsapss.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsapss.c @@ -1,6 +1,5 @@ /* Signature scheme RSASSA-PSS, based on RFC 8017. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsassa_pkcs1v15.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsassa_pkcs1v15.c index 2e90937337a2..b9808540a4fb 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsassa_pkcs1v15.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/rsassa_pkcs1v15.c @@ -1,6 +1,5 @@ /* Signature scheme RSASSA-PKCS1-v1_5, based on RFC 8017. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sicrypto.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sicrypto.c index 7ea2b0503679..deb238eec949 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sicrypto.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sicrypto.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sig.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sig.c index 880d661a19fa..73bddee1755f 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sig.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sig.c @@ -1,6 +1,5 @@ /** Signature generation and verification and public key generation. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sigdefs.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sigdefs.h index 734974e1f477..19c0c85fe914 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sigdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/sigdefs.h @@ -1,6 +1,5 @@ /** Definitions for signature related keys. * - * Copyright (c) 2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.c b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.c index 5a185dcb1995..851695e59a87 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.c +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.c @@ -1,6 +1,5 @@ /* Sicrypto utility functions. * - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.h index 9950de933a63..5ae9e3871e3a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/util.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/waitqueue.h b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/waitqueue.h index de03e6894451..2cd39c9f2fee 100644 --- a/subsys/nrf_security/src/drivers/cracen/sicrypto/src/waitqueue.h +++ b/subsys/nrf_security/src/drivers/cracen/sicrypto/src/waitqueue.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/blinding.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/blinding.h index 747a4825c181..b7b0482a4871 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/blinding.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/blinding.h @@ -2,8 +2,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/dsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/dsa.h index 33ebc4241e98..0ece0c82e598 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/dsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/dsa.h @@ -3,8 +3,6 @@ * @file */ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecc.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecc.h index 62f2d148a0a1..91bee8f9329e 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecc.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecc.h @@ -1,10 +1,5 @@ /** Elliptic curve cryptographic command definitions * - * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecjpake.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecjpake.h index 0e8e43db8885..696d515087b8 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecjpake.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/ecjpake.h @@ -1,10 +1,5 @@ /** EC J-Pake command definitions * - * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/edwards.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/edwards.h index 6c9cc308af23..effc3dec0a9c 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/edwards.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/edwards.h @@ -1,10 +1,5 @@ /** Edwards curve command definitions * - * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modexp.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modexp.h index c76b2b93a2d1..d1dcfab0cb16 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modexp.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modexp.h @@ -1,9 +1,5 @@ /** Modular exponentiation command definitions * - * @file - * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modmath.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modmath.h index 6976c39f7bc5..971d02c4bdfd 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modmath.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/modmath.h @@ -1,10 +1,5 @@ /** Modular math command definitions * - * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/rsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/rsa.h index a166304fb77c..a94fbcdc7c99 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/rsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/rsa.h @@ -1,10 +1,6 @@ /** RSA command definitions * * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/sm9.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/sm9.h index f5b852e10101..00d3b6a5598f 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/sm9.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/sm9.h @@ -1,8 +1,6 @@ /** SM9 command definitions * * @file - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/srp.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/srp.h index 3fcadf23f1b2..9d21110d2cba 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/srp.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/cmddefs/srp.h @@ -1,10 +1,6 @@ /** SRP command definitions * * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/core.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/core.h index 6bf277df8d8f..4d4209184ea8 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/core.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/core.h @@ -3,8 +3,6 @@ * @file */ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -276,7 +274,7 @@ const char **sx_pk_get_output_ops(sx_pk_req *req); void sx_pk_release_req(sx_pk_req *req); /** - * @brief Clear interrupt for Silex PK Engine. + * @brief Clear interrupt for Cracen PK Engine. * * @param[in,out] req The acceleration request obtained */ diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ec_curves.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ec_curves.h index bbc99b538756..bcaa86210826 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ec_curves.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ec_curves.h @@ -3,8 +3,6 @@ * @file */ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed25519.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed25519.h index 282cca92188e..5f0a48e62c5b 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed25519.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed25519.h @@ -1,10 +1,4 @@ -/** Simpler functions for base ED25519 operations - * - * @file - */ -/* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs +/** * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed448.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed448.h index a7b5402b611f..91f30e32e2da 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed448.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ed448.h @@ -3,7 +3,6 @@ * @file */ /* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ik.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ik.h index 296b0dccaa55..b0cf633d12c8 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ik.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/ik.h @@ -1,10 +1,4 @@ -/** Isolated Keys support - * - * @file - */ /* - * Copyright (c) 2020 Silex Insight sa - * Copyright (c) 2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/iomem.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/iomem.h index 318d30014942..729f53d4e10b 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/iomem.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/iomem.h @@ -1,10 +1,4 @@ -/** Memory operation functions - * - * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs +/** * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/montgomery.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/montgomery.h index aef8ecfb2dd9..b43dccd23efe 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/montgomery.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/montgomery.h @@ -1,10 +1,6 @@ /** Simpler functions for base Montgomery elliptic curve operations * * @file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h index 4baf5abdaf47..d8a8d699446d 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxbuf/sxbufop.h @@ -2,8 +2,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h index 72f608214aef..2bbad70d4911 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/adapter.h @@ -2,8 +2,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h index ae3ca4c0c2f6..7b50063619f1 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/dsa.h @@ -9,9 +9,6 @@ * the "sx_op" type. * * @file - */ -/* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h index fe75280fd756..5325b2d3ee64 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/eccweierstrass.h @@ -10,8 +10,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h index 507711f2471b..42efd380be52 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/ecjpake.h @@ -10,7 +10,6 @@ * * @file * - * Copyright (c) 2020-2021 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/impl.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/impl.h index d68a1cf8394c..0694a25d80be 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/impl.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/impl.h @@ -3,8 +3,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h index 8173aa14b486..7aa8b8149b2f 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/rsa.h @@ -9,10 +9,6 @@ * the "sx_op" type. * * @file - */ -/* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h index 2524929388ac..8a0d7d07ad89 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/sm9.h @@ -10,7 +10,6 @@ * * @file * - * Copyright (c) 2018-2021 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h index da3fddd8feff..fa879abf570f 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/srp.h @@ -9,9 +9,6 @@ * the "sx_op" type. * * @file - */ -/* - * Copyright (c) 2019-2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/version.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/version.h index 63e710772468..3e90831ed0b8 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/version.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/sxops/version.h @@ -4,9 +4,6 @@ * https://semver.org/. * * @file - */ -/* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/version.h b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/version.h index 1c1b5cafb880..8b3c2eaf0909 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/version.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/include/silexpk/version.h @@ -6,8 +6,6 @@ * @file */ /* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2014-2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c b/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c index 3dad06e14436..087ce97b2a18 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/interface/sxbuf/sxbufops.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed25519.c b/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed25519.c index 31aca190a7e7..8833db801671 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed25519.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed25519.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2019 Silex Insight sa - * Copyright (c) 2018 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed448.c b/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed448.c index 40bfc0da032c..237f02574c06 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed448.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/ed448.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/iomem.c b/subsys/nrf_security/src/drivers/cracen/silexpk/src/iomem.c index 1eff0d4de10f..8f61190fe778 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/iomem.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/iomem.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/montgomery.c b/subsys/nrf_security/src/drivers/cracen/silexpk/src/montgomery.c index 421942373a57..8a9702010563 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/montgomery.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/montgomery.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2019-2021 Silex Insight sa - * Copyright (c) 2019-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/regs_curves.h b/subsys/nrf_security/src/drivers/cracen/silexpk/src/regs_curves.h index bfa47a91e47f..cb50e90fff3f 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/regs_curves.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/regs_curves.h @@ -1,10 +1,4 @@ -/** - * \brief BA414ep hardware command register flags for elliptic curves - * \file - */ /* - * Copyright (c) 2018-2019 Silex Insight sa - * Copyright (c) 2018 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/src/statuscodes.c b/subsys/nrf_security/src/drivers/cracen/silexpk/src/statuscodes.c index ac0716dd37e8..8803820c5bbb 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/src/statuscodes.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/src/statuscodes.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/internal.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/internal.h index 1034dfe0f69f..7ed7cb22891c 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/internal.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/internal.h @@ -1,6 +1,4 @@ /* - * Copyright (c) 2021 Silex Insight sa - * Copyright (c) 2021 Beerten Engineering * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/pk_baremetal.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/pk_baremetal.c index 2cb85cff986d..e09c49e6b209 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/pk_baremetal.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/pk_baremetal.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2014-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -53,6 +51,8 @@ struct sx_pk_cnx { struct sx_pk_cnx silex_pk_engine; +K_MUTEX_DEFINE(cracen_mutex_asymmetric); + bool ba414ep_is_busy(sx_pk_req *req) { return (bool)(sx_pk_rdreg(&req->regs, PK_REG_STATUS) & PK_BUSY_MASK_BA414EP); @@ -180,13 +180,14 @@ struct sx_pk_acq_req sx_pk_acquire_req(const struct sx_pk_cmd_def *cmd) { struct sx_pk_acq_req req = {NULL, SX_OK}; - cracen_acquire(); - nrf_cracen_int_enable(NRF_CRACEN, NRF_CRACEN_INT_PKE_IKG_MASK); - + k_mutex_lock(&cracen_mutex_asymmetric, K_FOREVER); req.req = &silex_pk_engine.instance; req.req->cmd = cmd; req.req->cnx = &silex_pk_engine; + cracen_acquire(); + nrf_cracen_int_enable(NRF_CRACEN, NRF_CRACEN_INT_PKE_IKG_MASK); + /* Wait until initialized. */ while (ba414ep_is_busy(req.req) || ik_is_busy(req.req)) { cracen_wait_for_pke_interrupt(); @@ -216,6 +217,7 @@ void sx_pk_release_req(sx_pk_req *req) cracen_release(); req->cmd = NULL; req->userctxt = NULL; + k_mutex_unlock(&cracen_mutex_asymmetric); } struct sx_regs *sx_pk_get_regs(void) diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.c index 810acbbae6b9..cc4356a92def 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.h index 05ebdb3ccdf5..e706be95102f 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ba414_status.h @@ -3,8 +3,6 @@ * \file */ /* - * Copyright (c) 2018-2019 Silex Insight sa - * Copyright (c) 2018 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecc.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecc.c index a64600c513c5..6b774391364e 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecc.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecc.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecjpake.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecjpake.c index 26ee5173e6e7..6beb2e7f8db5 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecjpake.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_ecjpake.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_modmath.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_modmath.c index bca3feca3bb0..b3eea10ba48c 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_modmath.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_modmath.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_srp.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_srp.c index d5daafddb82c..ae1d0aff3315 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_srp.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/cmddefs_srp.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ec_curves.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ec_curves.c index d7a6b4d3fc36..e27c5fb138ff 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ec_curves.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/ec_curves.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2014-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/op_slots.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/op_slots.h index 5f94d3e30f1b..9ee1fb120b24 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/op_slots.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/op_slots.h @@ -1,10 +1,6 @@ /** * \brief BA414ep hardware operand slot indexes for each command - * \file - */ -/* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs + * * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.c index 0d984709aec0..4ad60009ec9a 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2018-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.h index c7be5a1c4802..bf6470a8f351 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.h @@ -1,10 +1,5 @@ /** * \brief Internal definitions for BA414ep targets. - * \file - */ -/* - * Copyright (c) 2018-2021 Silex Insight sa - * Copyright (c) 2014-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_addr.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_addr.h index 766b45a0c91c..f7c2e81d1879 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_addr.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_addr.h @@ -1,10 +1,6 @@ /** * \brief BA414ep hardware register addresses - * \file - */ -/* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2014-2020 Beerten Engineering scs + * * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_commands.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_commands.h index f99d72598e0a..6edb2894a099 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_commands.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/regs_commands.h @@ -1,10 +1,6 @@ /** * \brief BA414ep public key command codes and flags * \file - */ -/* - * Copyright (c) 2018-2020 Silex Insight sa - * Copyright (c) 2018-2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/cmddefs_ik.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/cmddefs_ik.c index 9f786417b243..3a838ef19cf9 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/cmddefs_ik.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/cmddefs_ik.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c index 4345a4e6bd53..bdaec1f6ffb3 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.c @@ -1,6 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight sa - * Copyright (c) 2020-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -226,6 +224,8 @@ void sx_pk_read_ik_capabilities(struct sx_regs *regs, struct sx_pk_capabilities int sx_pk_ik_derive_keys(struct sx_pk_config_ik *cfg) { + /* Acquire a dummy req to ensure Cracen is powered on, and ready to be used. */ + struct sx_pk_acq_req pkreq = sx_pk_acquire_req(NULL); struct sx_regs *regs = sx_pk_get_regs(); int r = sx_ik_gen_keys(regs, cfg); @@ -234,6 +234,9 @@ int sx_pk_ik_derive_keys(struct sx_pk_config_ik *cfg) sx_pk_read_ik_capabilities(regs, caps); } + + sx_pk_release_req(pkreq.req); + return r; } diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.h index aa9bbd04a029..0a5e56d39e28 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/ikhardware.h @@ -1,6 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight sa - * Copyright (c) 2020-2021 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_addr.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_addr.h index d8d4abd62f0e..3058c96ee751 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_addr.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_addr.h @@ -1,10 +1,6 @@ /** * \brief Isolated Key hardware register addresses * \file - */ -/* - * Copyright (c) 2020 Silex Insight sa - * Copyright (c) 2020 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_commands.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_commands.h index cb672e29004d..2807851b05d1 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_commands.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ik/regs_commands.h @@ -1,9 +1,6 @@ /** * \brief BA414ep public key command codes and flags for IK * \file - */ -/* - * Copyright (c) 2020 Silex Insight sa * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/silexpk/target/include/sx_regs.h b/subsys/nrf_security/src/drivers/cracen/silexpk/target/include/sx_regs.h index 67851a0cbbde..1d67e9eb956e 100644 --- a/subsys/nrf_security/src/drivers/cracen/silexpk/target/include/sx_regs.h +++ b/subsys/nrf_security/src/drivers/cracen/silexpk/target/include/sx_regs.h @@ -1,6 +1,4 @@ /* - * Copyright (c) 2018-2019 Silex Insight sa - * Copyright (c) 2018 Beerten Engineering scs * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aead.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aead.h index c9022f9a192c..8d44fe7fa469 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aead.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aead.h @@ -1,7 +1,6 @@ /** Authenticated encryption with associated data(AEAD). * * @file - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aes.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aes.h index f084143125d0..2dbe0ad6b5e0 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aes.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/aes.h @@ -1,7 +1,6 @@ /** Common simple block cipher modes with AES. * * @file - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/blkcipher.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/blkcipher.h index 1f195c28b143..d31f7f5b7d27 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/blkcipher.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/blkcipher.h @@ -4,7 +4,6 @@ * without any authentication. * * @file - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/chachapoly.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/chachapoly.h index c8a48a0fb470..c0dfc7dda3d3 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/chachapoly.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/chachapoly.h @@ -11,7 +11,6 @@ * * * @file - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmac.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmac.h index e02530510a9a..35b53b030d93 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmac.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmac.h @@ -1,7 +1,6 @@ /** Message Authentication Code AES CMAC. * * @file - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmmask.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmmask.h index c85a68516028..d9098f8956ad 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmmask.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/cmmask.h @@ -1,7 +1,6 @@ /** AES counter-measures mask load * * @file - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hash.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hash.h index 3e4a13375dfa..3db6b4bfe1a4 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hash.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hash.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hmac.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hmac.h index 2d21d64121d4..75d33721fe33 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hmac.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/hmac.h @@ -6,7 +6,6 @@ * The current implementation of HMAC does not support context-saving. * * @file - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/internal.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/internal.h index 6d1f11e12f1a..a42f863af6d8 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/internal.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/internal.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/keyref.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/keyref.h index 5de3ec88691f..1bd67d1c8c2f 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/keyref.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/keyref.h @@ -1,7 +1,6 @@ /** Common function definitions for keys. * * @file - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/mac.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/mac.h index 1b11fdedbff7..3f6007afe09a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/mac.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/mac.h @@ -1,7 +1,6 @@ /** Common functions used for generation a MAC (message authentication code). * * @file - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/memdiff.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/memdiff.h index b24362bd466c..7e6cd1042417 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/memdiff.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/memdiff.h @@ -1,7 +1,6 @@ /** * * @file - * @copyright Copyright (c) 2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha1.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha1.h index 6878445e8342..840e485ebed2 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha1.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha1.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha2.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha2.h index 88098e18d119..891a6060e1b4 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha2.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha2.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha3.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha3.h index 39ea2ea675d2..84ca7e809c49 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha3.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sha3.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm3.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm3.h index e96ea5aef928..951ec401ff2f 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm3.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm3.h @@ -2,7 +2,6 @@ * * @file * - * @copyright Copyright (c) 2019-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm4.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm4.h index 9731de330be7..55d465a115f6 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm4.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/sm4.h @@ -6,7 +6,6 @@ * sx_blkcipher_status() and sx_blkcipher_wait(). * * @file - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h index a3b0538b1d62..5503a9bf54ba 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trng.h @@ -1,7 +1,6 @@ /** True Random Number Generator (TRNG). * * @file - * @copyright Copyright (c) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trnginternal.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trnginternal.h index 3de27a524c0c..af4f792481cc 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trnginternal.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/trnginternal.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/version.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/version.h index 745e49e57666..122bdfe29b62 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/version.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/include/sxsymcrypt/version.h @@ -4,7 +4,6 @@ * https://semver.org/. * * @file - * @copyright Copyright (c) 2020 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aead.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aead.c index b9ad22a7207d..8fca5332e76a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aead.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aead.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aeaddefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aeaddefs.h index 31b50700f4f4..80346fa26896 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aeaddefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/aeaddefs.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/ba431regs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/ba431regs.h index 03a91d4afa30..636f64f949f1 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/ba431regs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/ba431regs.h @@ -1,7 +1,6 @@ /** BA431 TRNG registers defines. * * @file - * @copyright Copyright (cu) 2020-2021 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipher.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipher.c index 984858bed066..b340d272387c 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipher.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipher.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipherdefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipherdefs.h index 46b8d2327cd6..d4f448466a72 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipherdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/blkcipherdefs.h @@ -1,7 +1,6 @@ /** Block cipher common defines and structures used by AES, SM4, TDES. * * @file - * @copyright Copyright (c) 2020 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/chachapoly.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/chachapoly.c index 1da8a6af2a73..50ffafd940c1 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/chachapoly.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/chachapoly.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmac.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmac.c index d3a340463f68..14225ff58d8c 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmac.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmac.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmaes.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmaes.h index 09c494d2113b..ec8f2ef81ea3 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmaes.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmaes.h @@ -1,6 +1,5 @@ /** Common definitions for Cryptomaster AES modules * - * Copyright (c) 2019 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.c index 4a5f45276139..e5333018e549 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.h index cdcc0fff9f2d..e8ce122b9730 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmdma.h @@ -1,6 +1,5 @@ /** Cryptomaster DMA (descriptors and control) and hardware detection * - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmmask.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmmask.c index 7cbe902316bd..57d7603897b7 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmmask.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/cmmask.c @@ -1,5 +1,4 @@ /* - * @copyright Copyright (c) 2019 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/crypmasterregs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/crypmasterregs.h index 1e186048dd35..62b06ccc14fa 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/crypmasterregs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/crypmasterregs.h @@ -1,6 +1,5 @@ /** CryptoMaster register definitions * - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hash.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hash.c index ae17d7f2b9d8..32bd249e4f32 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hash.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hash.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hashdefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hashdefs.h index 6051347e1838..d6e85ac7c71a 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hashdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hashdefs.h @@ -1,8 +1,5 @@ -/** HASH common defines and structures. - * - * @file - * @copyright Copyright (c) 2020-2021 Silex Insight - * @copyright Copyright (c) 2023 Nordic Semiconductor ASA +/* + * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hmac.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hmac.c index 9835f22a8002..821f0996fed5 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hmac.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hmac.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h index fb151be4f6fa..074b758013dc 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/hw.h @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyref.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyref.c index 43ae9e06c73c..d931dc67059b 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyref.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyref.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -16,6 +15,7 @@ struct sxkeyref sx_keyref_load_material(size_t keysz, const char *keymaterial) k.cfg = 0; k.prepare_key = 0; k.clean_key = 0; + k.user_data = 0; return k; } diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyrefdefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyrefdefs.h index 98fb393711ce..daa005d34ed7 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyrefdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/keyrefdefs.h @@ -1,7 +1,6 @@ /** Key reference common defines used by AES, SM4 and AEAD. * * @file - * @copyright Copyright (c) 2020 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/mac.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/mac.c index a75b5d2a245f..d974a1f203cf 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/mac.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/mac.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/macdefs.h b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/macdefs.h index d80181faed60..2aa4687d6081 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/macdefs.h +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/macdefs.h @@ -1,7 +1,6 @@ /** MAC common defines and structures. * * @file - * @copyright Copyright (c) 2020 Silex Insight * @copyright Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/cmdma_hw.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/cmdma_hw.c index 4a96c82f931c..7f28e4cc9b9e 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/cmdma_hw.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/cmdma_hw.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2019-2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause @@ -12,6 +11,7 @@ #include "../../cmdma.h" #include #include +#include /* Enable interrupts showing that an operation finished or aborted. * For that, we're interested in : @@ -22,9 +22,12 @@ */ #define CMDMA_INTMASK_EN ((1 << 2) | (1 << 5) | (1 << 4)) +K_MUTEX_DEFINE(cracen_mutex_symmetric); + void sx_hw_reserve(struct sx_dmactl *dma) { cracen_acquire(); + k_mutex_lock(&cracen_mutex_symmetric, K_FOREVER); dma->hw_acquired = true; /* Enable CryptoMaster interrupts. */ @@ -40,6 +43,7 @@ void sx_cmdma_release_hw(struct sx_dmactl *dma) { if (dma->hw_acquired) { cracen_release(); + k_mutex_unlock(&cracen_mutex_symmetric); dma->hw_acquired = false; } } diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/interrupts.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/interrupts.c index 0a7703717576..4eee616585af 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/interrupts.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/platform/baremetal/interrupts.c @@ -54,7 +54,6 @@ void cracen_isr_handler(void *i) k_event_set(&cracen_irq_event_for_cryptomaster, crypto_master_status); } else if (nrf_cracen_event_check(NRF_CRACEN, NRF_CRACEN_EVENT_PKE_IKG)) { - /* Clear interrupts in PKE. */ sx_clear_interrupt(sx_get_current_req()); diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c index 0f7067333f2b..1e2886614a69 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sha3.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sm4.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sm4.c index 4aef3bb1598a..6749feb66114 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sm4.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/sm4.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c index 4da153b20d8b..eafb64f64ed9 100644 --- a/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c +++ b/subsys/nrf_security/src/drivers/cracen/sxsymcrypt/src/trng.c @@ -1,5 +1,4 @@ /* - * Copyright (c) 2020-2021 Silex Insight * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause diff --git a/subsys/nrf_security/src/drivers/nrf_oberon/CMakeLists.txt b/subsys/nrf_security/src/drivers/nrf_oberon/CMakeLists.txt index 35721b858add..0d0f7d6c0384 100644 --- a/subsys/nrf_security/src/drivers/nrf_oberon/CMakeLists.txt +++ b/subsys/nrf_security/src/drivers/nrf_oberon/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -set(drivers_path ${OBERON_PSA_PATH}/drivers) +set(drivers_path ${OBERON_PSA_PATH}/oberon/drivers) # Link to libraries if(CONFIG_MBEDTLS_PSA_CRYPTO_C) @@ -24,6 +24,8 @@ if(CONFIG_MBEDTLS_PSA_CRYPTO_C) ) endif() +if (COMPILE_PSA_APIS OR CONFIG_NRF_SECURITY_LEGACY_AND_PSA) + if (COMPILE_PSA_APIS) list(APPEND src_crypto_oberon ${drivers_path}/oberon_helpers.c @@ -55,6 +57,35 @@ if (COMPILE_PSA_APIS) append_with_prefix_ifdef(CONFIG_PSA_NEED_OBERON_CTR_DRBG_DRIVER src_crypto_oberon ${drivers_path} oberon_ctr_drbg.c) append_with_prefix_ifdef(CONFIG_PSA_NEED_OBERON_HMAC_DRBG_DRIVER src_crypto_oberon ${drivers_path} oberon_hmac_drbg.c) + +elseif(CONFIG_NRF_SECURITY_LEGACY_AND_PSA) + # When legacy and PSA are enabled, we need to include all the oberon drivers + # since we don't have PSA_NEED_* symbols in Kconfig. + list(APPEND src_crypto_oberon + ${drivers_path}/oberon_helpers.c + ${drivers_path}/oberon_ecdh.c + ${drivers_path}/oberon_ecdsa.c + ${drivers_path}/oberon_ec_keys.c + ${drivers_path}/oberon_jpake.c + ${drivers_path}/oberon_spake2p.c + ${drivers_path}/oberon_srp.c + ${drivers_path}/oberon_rsa.c + ${drivers_path}/oberon_key_management.c + ${drivers_path}/oberon_aead.c + ${drivers_path}/oberon_key_derivation.c + ${drivers_path}/oberon_mac.c + ${drivers_path}/oberon_cipher.c + ${drivers_path}/oberon_hash.c + ${drivers_path}/oberon_key_agreement.c + ${drivers_path}/oberon_pake.c + ${drivers_path}/oberon_asymmetric_signature.c + ${drivers_path}/oberon_asymmetric_encrypt.c + ${drivers_path}/oberon_ctr_drbg.c + ${drivers_path}/oberon_hmac_drbg.c) + + +endif() + target_sources(${mbedcrypto_target} PRIVATE ${src_crypto_oberon}) # Turn off warnings that Oberon are systematically @@ -66,4 +97,5 @@ if (COMPILE_PSA_APIS) -Wno-uninitialized -Wno-maybe-uninitialized ) + endif() diff --git a/subsys/nrf_security/src/legacy/CMakeLists.txt b/subsys/nrf_security/src/legacy/CMakeLists.txt index e1d2ef0d0977..69d9901544ef 100644 --- a/subsys/nrf_security/src/legacy/CMakeLists.txt +++ b/subsys/nrf_security/src/legacy/CMakeLists.txt @@ -192,8 +192,8 @@ if(NOT is_getting_includes) target_include_directories(${mbedcrypto_target} INTERFACE ${NRF_SECURITY_ROOT}/include - ${OBERON_PSA_PATH}/core/include - ${OBERON_PSA_PATH}/core/library + ${OBERON_PSA_PATH}/include + ${OBERON_PSA_PATH}/library ${ARM_MBEDTLS_PATH}/include ${ARM_MBEDTLS_PATH}/library ) diff --git a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c index 407d669787d2..2145d8abd964 100644 --- a/subsys/nrf_security/src/psa_crypto_driver_wrappers.c +++ b/subsys/nrf_security/src/psa_crypto_driver_wrappers.c @@ -2199,6 +2199,31 @@ psa_driver_wrapper_key_derivation_input_bytes(psa_key_derivation_operation_t *op } } +psa_status_t psa_driver_wrapper_key_derivation_input_key(psa_key_derivation_operation_t *operation, + psa_key_derivation_step_t step, + psa_key_attributes_t *attributes, + const uint8_t *data, size_t data_length) +{ + switch (operation->id) { +#if defined(PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER) + case PSA_CRYPTO_CRACEN_DRIVER_ID: + return cracen_key_derivation_input_key(&operation->ctx.cracen_kdf_ctx, step, + attributes, data, data_length); +#endif /* PSA_NEED_CRACEN_KEY_DERIVATION_DRIVER */ +#if defined(PSA_NEED_OBERON_KEY_DERIVATION_DRIVER) + case PSA_CRYPTO_OBERON_DRIVER_ID: + return oberon_key_derivation_input_bytes(&operation->ctx.oberon_kdf_ctx, step, data, + data_length); +#endif /* PSA_NEED_OBERON_KEY_DERIVATION_DRIVER */ + + default: + (void)step; + (void)data; + (void)data_length; + return PSA_ERROR_BAD_STATE; + } +} + psa_status_t psa_driver_wrapper_key_derivation_input_integer(psa_key_derivation_operation_t *operation, psa_key_derivation_step_t step, uint64_t value) @@ -2721,7 +2746,7 @@ psa_status_t psa_driver_wrapper_get_random(psa_driver_random_context_t *context, #elif defined(PSA_NEED_CC3XX_HMAC_DRBG_DRIVER) err = nrf_cc3xx_platform_hmac_drbg_get(NULL, output, output_size, &output_length); #endif - if (err != NRF_CC3XX_PLATFORM_SUCCESS) { + if (err != 0) { return PSA_ERROR_HARDWARE_FAILURE; } diff --git a/subsys/nrf_security/tfm/CMakeLists.txt b/subsys/nrf_security/tfm/CMakeLists.txt index 0d6ab0936934..72d6ce7c1b3c 100644 --- a/subsys/nrf_security/tfm/CMakeLists.txt +++ b/subsys/nrf_security/tfm/CMakeLists.txt @@ -7,9 +7,13 @@ # This file is nrf_security's entry-point for the TF-M build system set(BUILD_INSIDE_TFM True) -set(NRFXLIB_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../../nrfxlib) +set(west_root_dir ${CMAKE_CURRENT_LIST_DIR}/../../../..) + +set(NRFXLIB_DIR ${west_root_dir}/nrfxlib) set(NRF_SECURITY_ROOT ${CMAKE_CURRENT_LIST_DIR}/..) + set(ZEPHYR_NRF_MODULE_DIR ${NRF_DIR}) +set(ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR ${west_root_dir}/modules/crypto/oberon-psa-crypto) include(${NRF_SECURITY_ROOT}/cmake/extensions.cmake) diff --git a/subsys/pcd/src/pcd.c b/subsys/pcd/src/pcd.c index 30532498726a..b75f6e29770b 100644 --- a/subsys/pcd/src/pcd.c +++ b/subsys/pcd/src/pcd.c @@ -10,7 +10,9 @@ #include #ifdef CONFIG_PCD_NET +#ifdef CONFIG_PCD_READ_NETCORE_APP_VERSION #include +#endif #include #endif diff --git a/subsys/sdfw_services/CMakeLists.txt b/subsys/sdfw_services/CMakeLists.txt new file mode 100644 index 000000000000..16705b3fc2c2 --- /dev/null +++ b/subsys/sdfw_services/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_include_directories(os) + +zephyr_sources(ssf_client.c) +zephyr_sources(ssf_client_notif.c) +zephyr_sources(os/ssf_client_zephyr.c) + +add_subdirectory(zcbor) +add_subdirectory(services) +add_subdirectory(transport) diff --git a/subsys/sdfw_services/Kconfig b/subsys/sdfw_services/Kconfig new file mode 100644 index 000000000000..f3e31a3c7a3c --- /dev/null +++ b/subsys/sdfw_services/Kconfig @@ -0,0 +1,67 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +rsource "services/Kconfig" + +config SSF_CLIENT + def_bool $(dt_nodelabel_enabled_with_compat,cpusec_cpuapp_ipc,$(DT_COMPAT_ZEPHYR_IPC_ICMSG)) \ + || $(dt_nodelabel_enabled_with_compat,cpusec_cpurad_ipc,$(DT_COMPAT_ZEPHYR_IPC_ICMSG)) + +config SDFW_SERVICES_ENABLED + bool + default y + depends on SSF_CLIENT + imply ZCBOR + help + Enable SDFW Service Framework (SSF) + +menu "SDFW Service Framework" + depends on SDFW_SERVICES_ENABLED + +config SSF_CLIENT_DOMAIN_ID + int + default 2 if SOC_NRF54H20_CPUAPP + default 3 if SOC_NRF54H20_CPURAD + default 0 + +config SSF_CLIENT_NRF_RPC_GROUP_NAME + string + default "app" if SOC_NRF54H20_CPUAPP + default "rad" if SOC_NRF54H20_CPURAD + default "" + +config SSF_CLIENT_SYS_INIT + bool "Start SDFW Service Framework client on boot" + default y + +config SSF_CLIENT_REGISTERED_LISTENERS_MAX + int "Maximum number of simultaneous registered listeners" + default 1 + +config SSF_CLIENT_ZCBOR_MAX_BACKUPS + int "The maximum number of ZCBOR encoder/decoder backups" + default 1 + help + Backups are needed for decoding if there are any lists, maps, or CBOR-encoded + strings in the data. + Backups are needed for encoding if there are any lists or maps and you are using + canonical encoding (ZCBOR_CANONICAL), or when using the CBOR-encoded strings in the data. + +config SSF_ZCBOR_GENERATE + bool "Re-generate CBOR parsers from CDDL using zcbor" + help + If enabled, generate and use parsers from CDDL. + Install the generated parsers by running target 'ssf_parser_files_install'. + If disabled, use already installed parsers. + Generated parsers are found under the 'zcbor_generated' directories. + +rsource "transport/Kconfig" + +module = SSF_CLIENT +module-str = SSF Client +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endmenu # "SDFW Service Framework" diff --git a/subsys/sdfw_services/os/ssf_client_os.h b/subsys/sdfw_services/os/ssf_client_os.h new file mode 100644 index 000000000000..9bb6723e7b68 --- /dev/null +++ b/subsys/sdfw_services/os/ssf_client_os.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_CLIENT_OS_H__ +#define SSF_CLIENT_OS_H__ + +#include + +#if defined(__ZEPHYR__) +#include "ssf_client_zephyr.h" +#else +#error "Unsupported ssf os" + +/** + * @brief Logging wrappers to be implemented for each OS. + */ +#define SSF_CLIENT_LOG_REGISTER(module, log_lvl_cfg) +#define SSF_CLIENT_LOG_DECLARE(module, log_lvl_cfg) +#define SSF_CLIENT_LOG_ERR(...) +#define SSF_CLIENT_LOG_WRN(...) +#define SSF_CLIENT_LOG_INF(...) +#define SSF_CLIENT_LOG_DBG(...) + +#endif + +#define SSF_CLIENT_MIN(a, b) (((a) < (b)) ? (a) : (b)) + +#define SSF_CLIENT_SEM_WAIT_FOREVER -1 +#define SSF_CLIENT_SEM_NO_WAIT 0 + +/** + * @brief Wrapper for an OS specific binary semaphore context. + */ +struct ssf_client_sem; + +/** + * @brief Initialize binary semaphore prior to first use. + * + * @param[in] sem A pointer to the semaphore. + * + * @return 0 on success, otherwise a negative SSF errno. + */ +int ssf_client_sem_init(struct ssf_client_sem *sem); + +/** + * @brief Take semaphore. + * + * @param[in] sem A pointer to the semaphore. + * @param[in] timeout Waiting period to take the semaphore, or one of the special + * values SSF_CLIENT_SEM_WAIT_FOREVER and SSF_CLIENT_SEM_NO_WAIT. + * + * @return 0 on success, otherwise a negative SSF errno. + */ +int ssf_client_sem_take(struct ssf_client_sem *sem, int timeout); + +/** + * @brief Give semaphore. + * + * @param[in] sem A pointer to the semaphore. + */ +void ssf_client_sem_give(struct ssf_client_sem *sem); + +#endif /* SSF_CLIENT_OS_H__ */ diff --git a/subsys/sdfw_services/os/ssf_client_zephyr.c b/subsys/sdfw_services/os/ssf_client_zephyr.c new file mode 100644 index 000000000000..4d1f30cc7e32 --- /dev/null +++ b/subsys/sdfw_services/os/ssf_client_zephyr.c @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "ssf_client_zephyr.h" + +#include +#include +#include "ssf_client_os.h" + +#include +#include +#include + +int ssf_client_sem_init(struct ssf_client_sem *sem) +{ + int err; + + err = k_sem_init(&sem->sem, 1, 1); + if (err != 0) { + return -SSF_EINVAL; + } + + return 0; +} + +int ssf_client_sem_take(struct ssf_client_sem *sem, int timeout) +{ + int err; + + err = k_sem_take(&sem->sem, + (timeout == SSF_CLIENT_SEM_WAIT_FOREVER) ? K_FOREVER : K_MSEC(timeout)); + if (err != 0) { + return (err == -EAGAIN) ? -SSF_EAGAIN : SSF_EBUSY; + } + + return 0; +} + +void ssf_client_sem_give(struct ssf_client_sem *sem) +{ + k_sem_give(&sem->sem); +} + +#if CONFIG_SSF_CLIENT_SYS_INIT +static int client_init(void) +{ + return ssf_client_init(); +} + +SYS_INIT(client_init, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY); +#endif diff --git a/subsys/sdfw_services/os/ssf_client_zephyr.h b/subsys/sdfw_services/os/ssf_client_zephyr.h new file mode 100644 index 000000000000..be4f7a85a40a --- /dev/null +++ b/subsys/sdfw_services/os/ssf_client_zephyr.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_CLIENT_ZEPHYR_H__ +#define SSF_CLIENT_ZEPHYR_H__ + +#include "ssf_client_os.h" + +#include +#include + +#define SSF_CLIENT_LOG_REGISTER(module, log_lvl_cfg) LOG_MODULE_REGISTER(module, log_lvl_cfg) +#define SSF_CLIENT_LOG_DECLARE(module, log_lvl_cfg) LOG_MODULE_DECLARE(module, log_lvl_cfg) + +#define SSF_CLIENT_LOG_ERR(...) LOG_ERR(__VA_ARGS__) +#define SSF_CLIENT_LOG_WRN(...) LOG_WRN(__VA_ARGS__) +#define SSF_CLIENT_LOG_INF(...) LOG_INF(__VA_ARGS__) +#define SSF_CLIENT_LOG_DBG(...) LOG_DBG(__VA_ARGS__) + +struct ssf_client_sem { + struct k_sem sem; +}; + +#endif /* SSF_CLIENT_ZEPHYR_H__ */ diff --git a/subsys/sdfw_services/services/CMakeLists.txt b/subsys/sdfw_services/services/CMakeLists.txt new file mode 100644 index 000000000000..f7ee6b1b391f --- /dev/null +++ b/subsys/sdfw_services/services/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Services +add_subdirectory_ifdef(CONFIG_SSF_ECHO_SERVICE_ENABLED echo) +add_subdirectory_ifdef(CONFIG_SSF_ENC_FW_SERVICE_ENABLED enc_fw) +add_subdirectory_ifdef(CONFIG_SSF_EXTMEM_SERVICE_ENABLED extmem) +add_subdirectory_ifdef(CONFIG_SSF_PRNG_SERVICE_ENABLED prng) +add_subdirectory_ifdef(CONFIG_SSF_RESET_EVT_SERVICE_ENABLED reset_evt) +add_subdirectory_ifdef(CONFIG_SSF_SDFW_UPDATE_SERVICE_ENABLED sdfw_update) +add_subdirectory_ifdef(CONFIG_SSF_SUIT_SERVICE_ENABLED suit_service) diff --git a/subsys/sdfw_services/services/Kconfig b/subsys/sdfw_services/services/Kconfig new file mode 100644 index 000000000000..66bda5852449 --- /dev/null +++ b/subsys/sdfw_services/services/Kconfig @@ -0,0 +1,14 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Services +rsource "echo/Kconfig" +rsource "enc_fw/Kconfig" +rsource "extmem/Kconfig" +rsource "prng/Kconfig" +rsource "reset_evt/Kconfig" +rsource "sdfw_update/Kconfig" +rsource "suit_service/Kconfig" diff --git a/subsys/sdfw_services/services/Kconfig.template.service b/subsys/sdfw_services/services/Kconfig.template.service new file mode 100644 index 000000000000..2dbe37cd238b --- /dev/null +++ b/subsys/sdfw_services/services/Kconfig.template.service @@ -0,0 +1,49 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Template for defining service options for SSF services. +# +# Set the following variables before sourcing this file: +# +# service_name - Short uppercase name for use in the service's Kconfig options. +# service_default_enabled - 'y' to enable service by default, +# 'n' if service should not be enabled by default. +# service_id - Hexadecimal Service ID. To identify service when exchanging request +# and notification messages. All services should have unique IDs. +# service_version - Service version number. +# service_buffer_size - Size of buffer to allocate when sending request, response or +# notification messages in connection with the service. +# service_name_str - Printable name for the service. +# +menuconfig SSF_$(service_name)_SERVICE_ENABLED + bool "$(service_name_str) service" + default y if $(service_default_enabled) + depends on SDFW_SERVICES_ENABLED + +if SSF_$(service_name)_SERVICE_ENABLED + +config SSF_$(service_name)_SERVICE_ID + hex + default $(service_id) + help + Service ID for $(service_name_str) service + +config SSF_$(service_name)_SERVICE_VERSION + int + default $(service_version) + help + Version of $(service_name_str) service + +config SSF_$(service_name)_SERVICE_BUFFER_SIZE + int "Buffer size for $(service_name_str) service handler" + default $(service_buffer_size) + +module = SSF_$(service_name)_SERVICE +module-str = $(service_name_str) service +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif diff --git a/subsys/sdfw_services/services/echo/CMakeLists.txt b/subsys/sdfw_services/services/echo/CMakeLists.txt new file mode 100644 index 000000000000..f1c7fc92ec45 --- /dev/null +++ b/subsys/sdfw_services/services/echo/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(echo_service.c) + +generate_and_add_cbor_files(echo_service.cddl zcbor_generated + echo_service_req + echo_service_rsp +) diff --git a/subsys/sdfw_services/services/echo/Kconfig b/subsys/sdfw_services/services/echo/Kconfig new file mode 100644 index 000000000000..9e95af0ac003 --- /dev/null +++ b/subsys/sdfw_services/services/echo/Kconfig @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +service_name = ECHO +service_default_enabled = y +service_id = 0x64 +service_version = 1 +service_buffer_size = 128 +service_name_str = Echo +rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/echo/echo_service.c b/subsys/sdfw_services/services/echo/echo_service.c new file mode 100644 index 000000000000..f74399cbf26a --- /dev/null +++ b/subsys/sdfw_services/services/echo/echo_service.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** .. include_startingpoint_echo_source_rst */ +#include +#include +#include + +#include + +#include "echo_service_decode.h" +#include "echo_service_encode.h" +#include "echo_service_types.h" +#include +#include "ssf_client_os.h" + +SSF_CLIENT_SERVICE_DEFINE(echo_srvc, ECHO, cbor_encode_echo_service_req, + cbor_decode_echo_service_rsp); + +int ssf_echo(char *str_in, char *str_out, size_t str_out_size) +{ + int err; + int ret; + struct zcbor_string req_data; + struct echo_service_rsp rsp_data; + const uint8_t *rsp_pkt; /* For freeing response packet after copying rsp_str. */ + + const uint8_t *rsp_str; + size_t rsp_str_len; + + req_data.value = (uint8_t *)str_in; + req_data.len = strlen(str_in); + + err = ssf_client_send_request(&echo_srvc, &req_data, &rsp_data, &rsp_pkt); + if (err != 0) { + return err; + } + + ret = rsp_data.echo_service_rsp_ret; + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + rsp_str = rsp_data.echo_service_rsp_str_out.value; + rsp_str_len = rsp_data.echo_service_rsp_str_out.len; + memcpy(str_out, rsp_str, SSF_CLIENT_MIN(str_out_size, rsp_str_len)); + + ssf_client_decode_done(rsp_pkt); + return 0; +} +/** .. include_endpoint_echo_source_rst */ diff --git a/subsys/sdfw_services/services/echo/echo_service.cddl b/subsys/sdfw_services/services/echo/echo_service.cddl new file mode 100644 index 000000000000..5103e140374c --- /dev/null +++ b/subsys/sdfw_services/services/echo/echo_service.cddl @@ -0,0 +1,18 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +; .. include_startingpoint_echo_cddl_rst +; Echo service request payload. +echo_service_req = [ + str_in: tstr, +] + +; Echo service response payload. +echo_service_rsp = [ + ret: int, + str_out: tstr, +] +; .. include_endpoint_echo_cddl_rst diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..6775bb9108f8 --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + echo_service_decode.c + echo_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c new file mode 100644 index 000000000000..682fa3afb16c --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "echo_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result); +static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result); + +static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) && + ((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_tstr_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, + struct zcbor_string *result, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_echo_service_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, + struct echo_service_rsp *result, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_echo_service_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h new file mode 100644 index 000000000000..284b67ff2716 --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ECHO_SERVICE_DECODE_H__ +#define ECHO_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "echo_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, + struct zcbor_string *result, size_t *payload_len_out); + +int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, + struct echo_service_rsp *result, size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* ECHO_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c new file mode 100644 index 000000000000..a0cf04d2482e --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "echo_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input); +static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input); + +static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((zcbor_list_start_encode(state, 2) && + ((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) && + ((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_tstr_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, + const struct zcbor_string *input, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_echo_service_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, + const struct echo_service_rsp *input, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_echo_service_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h new file mode 100644 index 000000000000..08002595be0e --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ECHO_SERVICE_ENCODE_H__ +#define ECHO_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "echo_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, + const struct zcbor_string *input, size_t *payload_len_out); + +int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, + const struct echo_service_rsp *input, size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* ECHO_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h new file mode 100644 index 000000000000..8b89ebb3c067 --- /dev/null +++ b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ECHO_SERVICE_TYPES_H__ +#define ECHO_SERVICE_TYPES_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct echo_service_rsp { + int32_t echo_service_rsp_ret; + struct zcbor_string echo_service_rsp_str_out; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* ECHO_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/enc_fw/CMakeLists.txt b/subsys/sdfw_services/services/enc_fw/CMakeLists.txt new file mode 100644 index 000000000000..f11f4a8a0806 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/CMakeLists.txt @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +generate_and_add_cbor_files(enc_fw_service.cddl zcbor_generated + enc_fw_req + enc_fw_rsp +) diff --git a/subsys/sdfw_services/services/enc_fw/Kconfig b/subsys/sdfw_services/services/enc_fw/Kconfig new file mode 100644 index 000000000000..2cb273d13d76 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/Kconfig @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +service_name = ENC_FW +service_default_enabled = n +service_id = 0x6A +service_version = 1 +service_buffer_size = 64 +service_name_str = Encrypted firmware +rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/enc_fw/enc_fw_service.cddl b/subsys/sdfw_services/services/enc_fw/enc_fw_service.cddl new file mode 100644 index 000000000000..2d2c31453dc3 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/enc_fw_service.cddl @@ -0,0 +1,37 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +init_req_id = 0 +chunk_req_id = 1 + +init = ( + init_req_id, ; Request ID + aad: bstr .size 8, ; Additional authentication data + nonce: bstr .size 12, ; The nonce + tag: bstr .size 16, ; The mac tag + buffer_addr: uint, ; The address of the buffer to use for transport of encrypted data + buffer_len: uint, ; The length of buffer used to transport encrypted data + image_addr: uint, ; The address where to store the unencrypted image + image_len: uint, ; The size of the unencrypted image +) + +chunk = ( + chunk_req_id, ; Request ID + length: uint, ; Length of the chunk + last: bool, ; This chunk is the last, used to trigger verification +) + +enc_fw_req = [ + ; Union of different requests. + msg: ( + init / + chunk + ), +] + +enc_fw_rsp = [ + status: int, +] diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/enc_fw/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..fe72d342ebdc --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + enc_fw_service_decode.c + enc_fw_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c new file mode 100644 index 000000000000..62472160f58d --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "enc_fw_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_init(zcbor_state_t *state, struct init *result); +static bool decode_chunk(zcbor_state_t *state, struct chunk *result); +static bool decode_enc_fw_rsp(zcbor_state_t *state, int32_t *result); +static bool decode_enc_fw_req(zcbor_state_t *state, struct enc_fw_req *result); + +static bool decode_init(zcbor_state_t *state, struct init *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (0)))) && + ((zcbor_bstr_decode(state, (&(*result).init_aad))) && + ((((*result).init_aad.len >= 8) && ((*result).init_aad.len <= 8)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_bstr_decode(state, (&(*result).init_nonce))) && + ((((*result).init_nonce.len >= 12) && ((*result).init_nonce.len <= 12)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_bstr_decode(state, (&(*result).init_tag))) && + ((((*result).init_tag.len >= 16) && ((*result).init_tag.len <= 16)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false))) && + ((zcbor_uint32_decode(state, (&(*result).init_buffer_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).init_buffer_len)))) && + ((zcbor_uint32_decode(state, (&(*result).init_image_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).init_image_len))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_chunk(zcbor_state_t *state, struct chunk *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, (&(*result).chunk_length)))) && + ((zcbor_bool_decode(state, (&(*result).chunk_last))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_enc_fw_rsp(zcbor_state_t *state, int32_t *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_enc_fw_req(zcbor_state_t *state, struct enc_fw_req *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = + (((zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = ((((decode_init(state, (&(*result).enc_fw_req_msg_init_m)))) && + (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_init_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_chunk(state, (&(*result).enc_fw_req_msg_chunk_m)))) && + (((*result).enc_fw_req_msg_choice = enc_fw_req_msg_chunk_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, struct enc_fw_req *result, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_enc_fw_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_enc_fw_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h new file mode 100644 index 000000000000..b1dbbd53ab87 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_decode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ENC_FW_SERVICE_DECODE_H__ +#define ENC_FW_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "enc_fw_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_enc_fw_req(const uint8_t *payload, size_t payload_len, struct enc_fw_req *result, + size_t *payload_len_out); + +int cbor_decode_enc_fw_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* ENC_FW_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c new file mode 100644 index 000000000000..c094cae07aeb --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "enc_fw_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_init(zcbor_state_t *state, const struct init *input); +static bool encode_chunk(zcbor_state_t *state, const struct chunk *input); +static bool encode_enc_fw_rsp(zcbor_state_t *state, const int32_t *input); +static bool encode_enc_fw_req(zcbor_state_t *state, const struct enc_fw_req *input); + +static bool encode_init(zcbor_state_t *state, const struct init *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (0)))) && + (((((*input).init_aad.len >= 8) && ((*input).init_aad.len <= 8)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_aad)))) && + (((((*input).init_nonce.len >= 12) && ((*input).init_nonce.len <= 12)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_nonce)))) && + (((((*input).init_tag.len >= 16) && ((*input).init_tag.len <= 16)) || + (zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) && + (zcbor_bstr_encode(state, (&(*input).init_tag)))) && + ((zcbor_uint32_encode(state, (&(*input).init_buffer_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).init_buffer_len)))) && + ((zcbor_uint32_encode(state, (&(*input).init_image_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).init_image_len))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_chunk(zcbor_state_t *state, const struct chunk *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, (&(*input).chunk_length)))) && + ((zcbor_bool_encode(state, (&(*input).chunk_last))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_enc_fw_rsp(zcbor_state_t *state, const int32_t *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_enc_fw_req(zcbor_state_t *state, const struct enc_fw_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 8) && + ((((((*input).enc_fw_req_msg_choice == enc_fw_req_msg_init_m_c) + ? ((encode_init(state, (&(*input).enc_fw_req_msg_init_m)))) + : (((*input).enc_fw_req_msg_choice == enc_fw_req_msg_chunk_m_c) + ? ((encode_chunk(state, (&(*input).enc_fw_req_msg_chunk_m)))) + : false)))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 8)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, const struct enc_fw_req *input, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_enc_fw_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_enc_fw_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h new file mode 100644 index 000000000000..4fec1b3d0352 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_encode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ENC_FW_SERVICE_ENCODE_H__ +#define ENC_FW_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "enc_fw_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_enc_fw_req(uint8_t *payload, size_t payload_len, const struct enc_fw_req *input, + size_t *payload_len_out); + +int cbor_encode_enc_fw_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* ENC_FW_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h new file mode 100644 index 000000000000..c39dbb499309 --- /dev/null +++ b/subsys/sdfw_services/services/enc_fw/zcbor_generated/enc_fw_service_types.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef ENC_FW_SERVICE_TYPES_H__ +#define ENC_FW_SERVICE_TYPES_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct init { + struct zcbor_string init_aad; + struct zcbor_string init_nonce; + struct zcbor_string init_tag; + uint32_t init_buffer_addr; + uint32_t init_buffer_len; + uint32_t init_image_addr; + uint32_t init_image_len; +}; + +struct chunk { + uint32_t chunk_length; + bool chunk_last; +}; + +struct enc_fw_req { + union { + struct init enc_fw_req_msg_init_m; + struct chunk enc_fw_req_msg_chunk_m; + }; + enum { + enc_fw_req_msg_init_m_c, + enc_fw_req_msg_chunk_m_c, + } enc_fw_req_msg_choice; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* ENC_FW_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/extmem/CMakeLists.txt b/subsys/sdfw_services/services/extmem/CMakeLists.txt new file mode 100644 index 000000000000..c52c6b26b622 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(extmem_remote.c) + +generate_and_add_cbor_files(extmem_service.cddl zcbor_generated + extmem_req + extmem_rsp + extmem_nfy +) diff --git a/subsys/sdfw_services/services/extmem/Kconfig b/subsys/sdfw_services/services/extmem/Kconfig new file mode 100644 index 000000000000..c164e32a0979 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/Kconfig @@ -0,0 +1,51 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SSF_EXTMEM_SERVICE_ENABLED + bool "EXTMEM Update service" + default n + depends on SDFW_SERVICES_ENABLED + +if SSF_EXTMEM_SERVICE_ENABLED + +config SSF_EXTMEM_SERVICE_ID + hex + default 0x54 + help + Service ID for EXTMEM service + +config SSF_EXTMEM_SERVICE_VERSION + int + default 1 + help + Version of EXTMEM service + +config SSF_EXTMEM_SERVICE_BUFFER_SIZE + int "Buffer size for EXTMEM service handler" + default 128 + +config SSF_EXTMEM_READ_BUFFER_SIZE + int "Read buffer size" + default 4096 + help + The size of the memory buffer owned by the remote side that will be used to store data + read from external memory device. This determines the largest single read chunk size. + +config SSF_EXTMEM_BASE_ADDRESS + hex "External memory base address" + default 0x60000000 + help + Base address is used when memory mapping feature of the external memory is available. + This allows the SDFW to calculate the absolute memory address without communicating with + the EXTMEM service provider. The EXTMEM service provider can adjust this value to point + into the XIP or EXMEE memory regions. The SDFW will validate if the base + address does not belong to memory ranges owned by other domains to prevent data leaks. + +module = SSF_EXTMEM_SERVICE +module-str = EXTMEM Update service +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif diff --git a/subsys/sdfw_services/services/extmem/extmem_remote.c b/subsys/sdfw_services/services/extmem/extmem_remote.c new file mode 100644 index 000000000000..71ad7ba5a3e6 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/extmem_remote.c @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include +#include +#include "extmem_service_decode.h" +#include "extmem_service_encode.h" +#include "extmem_service_types.h" + +#include +#include +#include +#include + +#include +LOG_MODULE_REGISTER(extmem_srvc, CONFIG_SSF_EXTMEM_SERVICE_LOG_LEVEL); + +#define FLASH_DEVICE DEVICE_DT_GET(DT_ALIAS(spi_flash0)) + +#define SSF_CLIENT_SERVICE_DEFINE_GLOBAL(_name, _srvc_name, _req_encode, _rsp_decode) \ + const struct ssf_client_srvc _name = { \ + .id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \ + .version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \ + .req_encode = (request_encoder)_req_encode, \ + .rsp_decode = (response_decoder)_rsp_decode, \ + .req_buf_size = (CONFIG_SSF_##_srvc_name##_SERVICE_BUFFER_SIZE) \ + } + +SSF_CLIENT_SERVICE_DEFINE_GLOBAL(extmem_srvc, EXTMEM, cbor_encode_extmem_req, + cbor_decode_extmem_rsp); +SSF_CLIENT_NOTIF_LISTENER_DEFINE(extmem_evt_listener, EXTMEM, cbor_decode_extmem_nfy, + notify_evt_handler); + +enum server_action { + ACTION_CAPABILITIES, + ACTION_READ, + ACTION_WRITE, + ACTION_ERASE, +}; + +struct server_state { + struct k_work action_worker; + enum server_action action; + union { + struct { + int request_id; + } capabilities; + struct { + off_t offset; + size_t len; + int request_id; + } read; + struct { + off_t offset; + size_t len; + int request_id; + } write; + struct { + off_t offset; + size_t len; + int request_id; + } erase; + } action_data; +}; + +static uint8_t flash_op_buffer[CONFIG_SSF_EXTMEM_READ_BUFFER_SIZE]; + +static struct server_state server; + +static void handle_extmem_read_fn(struct server_state *state, + struct extmem_read_pending_notify *data) +{ + state->action = ACTION_READ; + state->action_data.read.len = data->extmem_read_pending_notify_size; + state->action_data.read.offset = data->extmem_read_pending_notify_offset; + state->action_data.read.request_id = data->extmem_read_pending_notify_request_id; + k_work_submit(&state->action_worker); +} + +static void handle_extmem_write_fn(struct server_state *state, + struct extmem_write_pending_notify *data) +{ + state->action = ACTION_WRITE; + state->action_data.write.len = data->extmem_write_pending_notify_size; + state->action_data.write.offset = data->extmem_write_pending_notify_offset; + state->action_data.write.request_id = data->extmem_write_pending_notify_request_id; + k_work_submit(&state->action_worker); +} + +static void handle_extmem_erase_fn(struct server_state *state, + struct extmem_erase_pending_notify *data) +{ + state->action = ACTION_ERASE; + state->action_data.erase.len = data->extmem_erase_pending_notify_size; + state->action_data.erase.offset = data->extmem_erase_pending_notify_offset; + state->action_data.erase.request_id = data->extmem_erase_pending_notify_request_id; + k_work_submit(&state->action_worker); +} + +static void handle_extmem_capabilities_fn(struct server_state *state, + struct extmem_get_capabilities_notify_pending *data) +{ + state->action = ACTION_CAPABILITIES; + state->action_data.capabilities.request_id = + data->extmem_get_capabilities_notify_pending_request_id; + k_work_submit(&state->action_worker); +} + +static void read_worker_fn(struct server_state *state, struct extmem_req *req) +{ + const struct device *fdev = FLASH_DEVICE; + int result = EXTMEM_RESULT_REMOTE_ERROR; + + int err = flash_read(fdev, state->action_data.read.offset, flash_op_buffer, + state->action_data.read.len); + if (err == 0) { + result = EXTMEM_RESULT_SUCCESS; + } + + LOG_HEXDUMP_DBG(flash_op_buffer, state->action_data.read.len, "Read data"); + + req->extmem_req_msg_choice = extmem_req_msg_extmem_read_done_req_m_c; + req->extmem_req_msg_extmem_read_done_req_m.extmem_read_done_req_addr = + (uintptr_t)flash_op_buffer; + req->extmem_req_msg_extmem_read_done_req_m.extmem_read_done_req_error = result; + req->extmem_req_msg_extmem_read_done_req_m.extmem_read_done_req_request_id = + state->action_data.read.request_id; +} + +static void write_worker_fn(struct server_state *state, struct extmem_req *req) +{ + const struct device *fdev = FLASH_DEVICE; + int result = EXTMEM_RESULT_REMOTE_ERROR; + + struct extmem_rsp rsp; + + req->extmem_req_msg_choice = extmem_req_msg_extmem_write_setup_req_m_c; + req->extmem_req_msg_extmem_write_setup_req_m.extmem_write_setup_req_addr = + (uintptr_t)flash_op_buffer; + req->extmem_req_msg_extmem_write_setup_req_m.extmem_write_setup_req_error = + EXTMEM_RESULT_SUCCESS; + req->extmem_req_msg_extmem_write_setup_req_m.extmem_write_setup_req_request_id = + state->action_data.write.request_id; + + int ret = ssf_client_send_request(&extmem_srvc, req, &rsp, NULL); + + if (ret == 0) { + ret = flash_write(fdev, state->action_data.write.offset, flash_op_buffer, + state->action_data.write.len); + } + + if (ret == 0) { + result = EXTMEM_RESULT_SUCCESS; + } + + LOG_HEXDUMP_DBG(flash_op_buffer, state->action_data.write.len, "Write data"); + + req->extmem_req_msg_choice = extmem_req_msg_extmem_write_done_req_m_c; + req->extmem_req_msg_extmem_write_done_req_m.extmem_write_done_req_error = result; + req->extmem_req_msg_extmem_write_done_req_m.extmem_write_done_req_request_id = + state->action_data.write.request_id; +} + +static void erase_worker_fn(struct server_state *state, struct extmem_req *req) +{ + const struct device *fdev = FLASH_DEVICE; + int result = EXTMEM_RESULT_REMOTE_ERROR; + + int err = flash_erase(fdev, state->action_data.erase.offset, state->action_data.erase.len); + + if (err == 0) { + result = EXTMEM_RESULT_SUCCESS; + } + + LOG_HEXDUMP_DBG(flash_op_buffer, state->action_data.erase.len, "erase data"); + + req->extmem_req_msg_choice = extmem_req_msg_extmem_erase_done_req_m_c; + req->extmem_req_msg_extmem_erase_done_req_m.extmem_erase_done_req_error = result; + req->extmem_req_msg_extmem_erase_done_req_m.extmem_erase_done_req_request_id = + state->action_data.erase.request_id; +} + +static void capabilities_worker_fn(struct server_state *state, struct extmem_req *req) +{ + const struct device *fdev = FLASH_DEVICE; + const struct flash_driver_api *api = fdev->api; + + const struct flash_pages_layout *layout; + size_t capacity = 0; + size_t count = 0; + size_t erase_size = 0; + + api->page_layout(fdev, &layout, &count); + + for (; count > 0; count--, layout += 1) { + capacity += layout->pages_count * layout->pages_size; + erase_size = MAX(erase_size, layout->pages_size); + } + + req->extmem_req_msg_choice = extmem_req_msg_extmem_get_capabilities_req_m_c; + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_base_addr = + CONFIG_SSF_EXTMEM_BASE_ADDRESS; + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_capacity = + capacity; + req->extmem_req_msg_extmem_get_capabilities_req_m + .extmem_get_capabilities_req_memory_mapped = false; + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_erase_size = + erase_size; + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_write_size = + flash_get_write_block_size(fdev); + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_chunk_size = + sizeof(flash_op_buffer); + req->extmem_req_msg_extmem_get_capabilities_req_m.extmem_get_capabilities_req_request_id = + state->action_data.capabilities.request_id; +} + +static void action_handler(struct k_work *work) +{ + struct server_state *state = CONTAINER_OF(work, struct server_state, action_worker); + + struct extmem_req req; + struct extmem_rsp rsp; + + switch (state->action) { + case ACTION_READ: + read_worker_fn(state, &req); + break; + + case ACTION_CAPABILITIES: + capabilities_worker_fn(state, &req); + break; + + case ACTION_WRITE: + write_worker_fn(state, &req); + break; + + case ACTION_ERASE: + erase_worker_fn(state, &req); + break; + + default: + __ASSERT_NO_MSG(false); + } + + (void)ssf_client_send_request(&extmem_srvc, &req, &rsp, NULL); +} + +static int notify_evt_handler(struct ssf_notification *notif, void *handler_user_data) +{ + ARG_UNUSED(handler_user_data); + + struct extmem_nfy notification; + + int err = ssf_client_notif_decode(notif, ¬ification); + + if (err != 0) { + LOG_ERR("Decoding notification failed: %d", err); + return err; + } + + switch (notification.extmem_nfy_msg_choice) { + case extmem_nfy_msg_extmem_read_pending_notify_m_c: + LOG_DBG("Read notification"); + struct extmem_read_pending_notify *extmem_read_data = + ¬ification.extmem_nfy_msg_extmem_read_pending_notify_m; + + handle_extmem_read_fn(&server, extmem_read_data); + break; + + case extmem_nfy_msg_extmem_write_pending_notify_m_c: + LOG_DBG("Write notification"); + struct extmem_write_pending_notify *extmem_write_data = + ¬ification.extmem_nfy_msg_extmem_write_pending_notify_m; + + handle_extmem_write_fn(&server, extmem_write_data); + break; + + case extmem_nfy_msg_extmem_erase_pending_notify_m_c: + LOG_DBG("Erase notification"); + struct extmem_erase_pending_notify *extmem_erase_data = + ¬ification.extmem_nfy_msg_extmem_erase_pending_notify_m; + + handle_extmem_erase_fn(&server, extmem_erase_data); + break; + + case extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c: + LOG_DBG("Capabilities notification"); + struct extmem_get_capabilities_notify_pending *extmem_capabilities_data = + ¬ification.extmem_nfy_msg_extmem_get_capabilities_notify_pending_m; + + handle_extmem_capabilities_fn(&server, extmem_capabilities_data); + break; + + default: + break; + } + ssf_client_notif_decode_done(notif); + return err; +} + +int extmem_remote_init(void) +{ + int err = 0; + + k_work_init(&server.action_worker, action_handler); + + err = ssf_client_notif_register(&extmem_evt_listener, NULL); + if (err != 0) { + LOG_ERR("Failed to register for notifications: %d", err); + return -EIO; + } + + return err; +} diff --git a/subsys/sdfw_services/services/extmem/extmem_service.cddl b/subsys/sdfw_services/services/extmem/extmem_service.cddl new file mode 100644 index 000000000000..4531319803e1 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/extmem_service.cddl @@ -0,0 +1,121 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +extmem_read_done_req = ( + 1, + request_id: uint, + error: uint, + addr: uint, +) + +extmem_read_done_rsp = ( + 1, +) + +extmem_read_pending_notify = ( + 2, + request_id: uint, + offset: uint, + size: uint, +) + +extmem_write_setup_req = ( + 3, + request_id: uint, + error: uint, + addr: uint, +) + +extmem_write_setup_rsp = ( + 3, +) + +extmem_write_done_req = ( + 5, + request_id: uint, + error: uint, +) + +extmem_write_done_rsp = ( + 5, +) + +extmem_write_pending_notify = ( + 6, + request_id: uint, + offset: uint, + size: uint, +) + +extmem_erase_done_req = ( + 7, + request_id: uint, + error: uint, +) + +extmem_erase_done_rsp = ( + 7, +) + +extmem_erase_pending_notify = ( + 8, + request_id: uint, + offset: uint, + size: uint, +) + +extmem_get_capabilities_req = ( + 9, + request_id: uint, + error: uint, + base_addr: uint, + capacity: uint, + erase_size: uint, + write_size: uint, + chunk_size: uint, + memory_mapped: bool, +) + +extmem_get_capabilities_rsp = ( + 9, +) + +extmem_get_capabilities_notify_pending = ( + 10, + request_id: uint, +) + +extmem_req = [ + ; Union of different requests + msg: ( + extmem_read_done_req / + extmem_write_setup_req / + extmem_write_done_req / + extmem_erase_done_req / + extmem_get_capabilities_req + ), +] + +extmem_rsp = [ + ; Union of different responses + msg: ( + extmem_read_done_rsp / + extmem_write_setup_rsp / + extmem_write_done_rsp / + extmem_erase_done_rsp / + extmem_get_capabilities_rsp + ), +] + +extmem_nfy = [ + ; Union of different notifications + msg: ( + extmem_read_pending_notify / + extmem_write_pending_notify / + extmem_erase_pending_notify / + extmem_get_capabilities_notify_pending + ), +] diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/extmem/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..f8d5c99d6e6b --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + extmem_service_decode.c + extmem_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c new file mode 100644 index 000000000000..bb16407ee17b --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.c @@ -0,0 +1,407 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "extmem_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_extmem_read_done_req(zcbor_state_t *state, struct extmem_read_done_req *result); +static bool decode_extmem_write_setup_req(zcbor_state_t *state, + struct extmem_write_setup_req *result); +static bool decode_extmem_write_done_req(zcbor_state_t *state, + struct extmem_write_done_req *result); +static bool decode_extmem_erase_done_req(zcbor_state_t *state, + struct extmem_erase_done_req *result); +static bool decode_extmem_get_capabilities_req(zcbor_state_t *state, + struct extmem_get_capabilities_req *result); +static bool decode_extmem_read_pending_notify(zcbor_state_t *state, + struct extmem_read_pending_notify *result); +static bool decode_extmem_write_pending_notify(zcbor_state_t *state, + struct extmem_write_pending_notify *result); +static bool decode_extmem_erase_pending_notify(zcbor_state_t *state, + struct extmem_erase_pending_notify *result); +static bool decode_extmem_get_capabilities_notify_pending( + zcbor_state_t *state, struct extmem_get_capabilities_notify_pending *result); +static bool decode_extmem_nfy(zcbor_state_t *state, struct extmem_nfy *result); +static bool decode_extmem_rsp(zcbor_state_t *state, struct extmem_rsp *result); +static bool decode_extmem_req(zcbor_state_t *state, struct extmem_req *result); + +static bool decode_extmem_read_done_req(zcbor_state_t *state, struct extmem_read_done_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_error)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_done_req_addr))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_write_setup_req(zcbor_state_t *state, + struct extmem_write_setup_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (3)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_error)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_setup_req_addr))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_write_done_req(zcbor_state_t *state, struct extmem_write_done_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (5)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_done_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_done_req_error))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_erase_done_req(zcbor_state_t *state, struct extmem_erase_done_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (7)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_erase_done_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_erase_done_req_error))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_get_capabilities_req(zcbor_state_t *state, + struct extmem_get_capabilities_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (9)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_get_capabilities_req_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_get_capabilities_req_error)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_get_capabilities_req_base_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_get_capabilities_req_capacity)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_get_capabilities_req_erase_size)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_get_capabilities_req_write_size)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_get_capabilities_req_chunk_size)))) && + ((zcbor_bool_decode(state, + (&(*result).extmem_get_capabilities_req_memory_mapped))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_read_pending_notify(zcbor_state_t *state, + struct extmem_read_pending_notify *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (2)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_read_pending_notify_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_pending_notify_offset)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_read_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_write_pending_notify(zcbor_state_t *state, + struct extmem_write_pending_notify *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (6)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_write_pending_notify_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_pending_notify_offset)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_write_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_erase_pending_notify(zcbor_state_t *state, + struct extmem_erase_pending_notify *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (8)))) && + ((zcbor_uint32_decode(state, + (&(*result).extmem_erase_pending_notify_request_id)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_erase_pending_notify_offset)))) && + ((zcbor_uint32_decode(state, (&(*result).extmem_erase_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_extmem_get_capabilities_notify_pending(zcbor_state_t *state, + struct extmem_get_capabilities_notify_pending *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (10)))) && + ((zcbor_uint32_decode( + state, (&(*result).extmem_get_capabilities_notify_pending_request_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_nfy(zcbor_state_t *state, struct extmem_nfy *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = (((zcbor_list_start_decode(state) && ((((zcbor_union_start_code(state) && + (int_res = ((((decode_extmem_read_pending_notify( + state, (&(*result).extmem_nfy_msg_extmem_read_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_read_pending_notify_m_c), true)) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_pending_notify( + state, (&(*result).extmem_nfy_msg_extmem_write_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_write_pending_notify_m_c), true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_erase_pending_notify( + state, (&(*result).extmem_nfy_msg_extmem_erase_pending_notify_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_erase_pending_notify_m_c), true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_get_capabilities_notify_pending( + state, + (&(*result).extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) && + (((*result).extmem_nfy_msg_choice = + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c), true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_rsp(zcbor_state_t *state, struct extmem_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((((zcbor_uint_decode(state, &(*result).extmem_rsp_msg_choice, + sizeof((*result).extmem_rsp_msg_choice)))) && + ((((((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_read_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_setup_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_erase_done_rsp_m_c) && + ((1))) || + (((*result).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) && + ((1)))) || + (zcbor_error(state, ZCBOR_ERR_WRONG_VALUE), false)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_extmem_req(zcbor_state_t *state, struct extmem_req *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_extmem_read_done_req( + state, + (&(*result).extmem_req_msg_extmem_read_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_read_done_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_setup_req( + state, + (&(*result).extmem_req_msg_extmem_write_setup_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_write_setup_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_write_done_req( + state, + (&(*result).extmem_req_msg_extmem_write_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_write_done_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_erase_done_req( + state, + (&(*result).extmem_req_msg_extmem_erase_done_req_m)))) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_erase_done_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_extmem_get_capabilities_req( + state, + (&(*result) + .extmem_req_msg_extmem_get_capabilities_req_m))) + ) && + (((*result).extmem_req_msg_choice = + extmem_req_msg_extmem_get_capabilities_req_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, struct extmem_req *result, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, struct extmem_rsp *result, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, struct extmem_nfy *result, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_extmem_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h new file mode 100644 index 000000000000..b4e7887df8d7 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_decode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef EXTMEM_SERVICE_DECODE_H__ +#define EXTMEM_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "extmem_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_extmem_req(const uint8_t *payload, size_t payload_len, struct extmem_req *result, + size_t *payload_len_out); + +int cbor_decode_extmem_rsp(const uint8_t *payload, size_t payload_len, struct extmem_rsp *result, + size_t *payload_len_out); + +int cbor_decode_extmem_nfy(const uint8_t *payload, size_t payload_len, struct extmem_nfy *result, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c new file mode 100644 index 000000000000..2eee86cb577b --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.c @@ -0,0 +1,383 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "extmem_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_extmem_read_done_req(zcbor_state_t *state, + const struct extmem_read_done_req *input); +static bool encode_extmem_write_setup_req(zcbor_state_t *state, + const struct extmem_write_setup_req *input); +static bool encode_extmem_write_done_req(zcbor_state_t *state, + const struct extmem_write_done_req *input); +static bool encode_extmem_erase_done_req(zcbor_state_t *state, + const struct extmem_erase_done_req *input); +static bool encode_extmem_get_capabilities_req(zcbor_state_t *state, + const struct extmem_get_capabilities_req *input); +static bool encode_extmem_read_pending_notify(zcbor_state_t *state, + const struct extmem_read_pending_notify *input); +static bool encode_extmem_write_pending_notify(zcbor_state_t *state, + const struct extmem_write_pending_notify *input); +static bool encode_extmem_erase_pending_notify(zcbor_state_t *state, + const struct extmem_erase_pending_notify *input); +static bool encode_extmem_get_capabilities_notify_pending( + zcbor_state_t *state, const struct extmem_get_capabilities_notify_pending *input); +static bool encode_extmem_nfy(zcbor_state_t *state, const struct extmem_nfy *input); +static bool encode_extmem_rsp(zcbor_state_t *state, const struct extmem_rsp *input); +static bool encode_extmem_req(zcbor_state_t *state, const struct extmem_req *input); + +static bool encode_extmem_read_done_req(zcbor_state_t *state, + const struct extmem_read_done_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_error)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_done_req_addr))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_write_setup_req(zcbor_state_t *state, + const struct extmem_write_setup_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (3)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_error)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_setup_req_addr))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_write_done_req(zcbor_state_t *state, + const struct extmem_write_done_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (5)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_done_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_done_req_error))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_erase_done_req(zcbor_state_t *state, + const struct extmem_erase_done_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (7)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_erase_done_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_erase_done_req_error))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_get_capabilities_req(zcbor_state_t *state, + const struct extmem_get_capabilities_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (9)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_get_capabilities_req_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_error)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_base_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_get_capabilities_req_capacity)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_get_capabilities_req_erase_size)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_get_capabilities_req_write_size)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_get_capabilities_req_chunk_size)))) && + ((zcbor_bool_encode(state, + (&(*input).extmem_get_capabilities_req_memory_mapped))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_read_pending_notify(zcbor_state_t *state, + const struct extmem_read_pending_notify *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (2)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_offset)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_read_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_write_pending_notify(zcbor_state_t *state, + const struct extmem_write_pending_notify *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (6)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_write_pending_notify_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_pending_notify_offset)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_write_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_erase_pending_notify(zcbor_state_t *state, + const struct extmem_erase_pending_notify *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (8)))) && + ((zcbor_uint32_encode(state, + (&(*input).extmem_erase_pending_notify_request_id)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_erase_pending_notify_offset)))) && + ((zcbor_uint32_encode(state, (&(*input).extmem_erase_pending_notify_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_get_capabilities_notify_pending( + zcbor_state_t *state, const struct extmem_get_capabilities_notify_pending *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_put(state, (10)))) && + ((zcbor_uint32_encode( + state, (&(*input).extmem_get_capabilities_notify_pending_request_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_nfy(zcbor_state_t *state, const struct extmem_nfy *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 4) && + ((((((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_read_pending_notify_m_c) + ? ((encode_extmem_read_pending_notify( + state, (&(*input).extmem_nfy_msg_extmem_read_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_write_pending_notify_m_c) + ? ((encode_extmem_write_pending_notify( + state, (&(*input).extmem_nfy_msg_extmem_write_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_erase_pending_notify_m_c) + ? ((encode_extmem_erase_pending_notify( + state, (&(*input).extmem_nfy_msg_extmem_erase_pending_notify_m)))) + : (((*input).extmem_nfy_msg_choice == + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c) + ? ((encode_extmem_get_capabilities_notify_pending( + state, + (&(*input).extmem_nfy_msg_extmem_get_capabilities_notify_pending_m)))) + : false)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 4)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_rsp(zcbor_state_t *state, const struct extmem_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 1) && + ((((((*input).extmem_rsp_msg_choice == extmem_rsp_msg_extmem_read_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (1)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_setup_rsp_m_c) + ? ((zcbor_uint32_put(state, (3)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_write_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (5)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_erase_done_rsp_m_c) + ? ((zcbor_uint32_put(state, (7)))) + : (((*input).extmem_rsp_msg_choice == + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c) + ? ((zcbor_uint32_put(state, (9)))) + : false))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_extmem_req(zcbor_state_t *state, const struct extmem_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 9) && + ((((((*input).extmem_req_msg_choice == extmem_req_msg_extmem_read_done_req_m_c) + ? ((encode_extmem_read_done_req( + state, (&(*input).extmem_req_msg_extmem_read_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_write_setup_req_m_c) + ? ((encode_extmem_write_setup_req( + state, (&(*input).extmem_req_msg_extmem_write_setup_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_write_done_req_m_c) + ? ((encode_extmem_write_done_req( + state, (&(*input).extmem_req_msg_extmem_write_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_erase_done_req_m_c) + ? ((encode_extmem_erase_done_req( + state, (&(*input).extmem_req_msg_extmem_erase_done_req_m)))) + : (((*input).extmem_req_msg_choice == + extmem_req_msg_extmem_get_capabilities_req_m_c) + ? ((encode_extmem_get_capabilities_req( + state, (&(*input).extmem_req_msg_extmem_get_capabilities_req_m)))) + : false))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 9)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, const struct extmem_req *input, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, const struct extmem_rsp *input, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, const struct extmem_nfy *input, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_extmem_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h new file mode 100644 index 000000000000..689b5f1087fd --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_encode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef EXTMEM_SERVICE_ENCODE_H__ +#define EXTMEM_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "extmem_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_extmem_req(uint8_t *payload, size_t payload_len, const struct extmem_req *input, + size_t *payload_len_out); + +int cbor_encode_extmem_rsp(uint8_t *payload, size_t payload_len, const struct extmem_rsp *input, + size_t *payload_len_out); + +int cbor_encode_extmem_nfy(uint8_t *payload, size_t payload_len, const struct extmem_nfy *input, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h new file mode 100644 index 000000000000..adaa70c696a6 --- /dev/null +++ b/subsys/sdfw_services/services/extmem/zcbor_generated/extmem_service_types.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef EXTMEM_SERVICE_TYPES_H__ +#define EXTMEM_SERVICE_TYPES_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct extmem_read_done_req { + uint32_t extmem_read_done_req_request_id; + uint32_t extmem_read_done_req_error; + uint32_t extmem_read_done_req_addr; +}; + +struct extmem_write_setup_req { + uint32_t extmem_write_setup_req_request_id; + uint32_t extmem_write_setup_req_error; + uint32_t extmem_write_setup_req_addr; +}; + +struct extmem_write_done_req { + uint32_t extmem_write_done_req_request_id; + uint32_t extmem_write_done_req_error; +}; + +struct extmem_erase_done_req { + uint32_t extmem_erase_done_req_request_id; + uint32_t extmem_erase_done_req_error; +}; + +struct extmem_get_capabilities_req { + uint32_t extmem_get_capabilities_req_request_id; + uint32_t extmem_get_capabilities_req_error; + uint32_t extmem_get_capabilities_req_base_addr; + uint32_t extmem_get_capabilities_req_capacity; + uint32_t extmem_get_capabilities_req_erase_size; + uint32_t extmem_get_capabilities_req_write_size; + uint32_t extmem_get_capabilities_req_chunk_size; + bool extmem_get_capabilities_req_memory_mapped; +}; + +struct extmem_req { + union { + struct extmem_read_done_req extmem_req_msg_extmem_read_done_req_m; + struct extmem_write_setup_req extmem_req_msg_extmem_write_setup_req_m; + struct extmem_write_done_req extmem_req_msg_extmem_write_done_req_m; + struct extmem_erase_done_req extmem_req_msg_extmem_erase_done_req_m; + struct extmem_get_capabilities_req extmem_req_msg_extmem_get_capabilities_req_m; + }; + enum { + extmem_req_msg_extmem_read_done_req_m_c, + extmem_req_msg_extmem_write_setup_req_m_c, + extmem_req_msg_extmem_write_done_req_m_c, + extmem_req_msg_extmem_erase_done_req_m_c, + extmem_req_msg_extmem_get_capabilities_req_m_c, + } extmem_req_msg_choice; +}; + +struct extmem_rsp { + enum { + extmem_rsp_msg_extmem_read_done_rsp_m_c = 1, + extmem_rsp_msg_extmem_write_setup_rsp_m_c = 3, + extmem_rsp_msg_extmem_write_done_rsp_m_c = 5, + extmem_rsp_msg_extmem_erase_done_rsp_m_c = 7, + extmem_rsp_msg_extmem_get_capabilities_rsp_m_c = 9, + } extmem_rsp_msg_choice; +}; + +struct extmem_read_pending_notify { + uint32_t extmem_read_pending_notify_request_id; + uint32_t extmem_read_pending_notify_offset; + uint32_t extmem_read_pending_notify_size; +}; + +struct extmem_write_pending_notify { + uint32_t extmem_write_pending_notify_request_id; + uint32_t extmem_write_pending_notify_offset; + uint32_t extmem_write_pending_notify_size; +}; + +struct extmem_erase_pending_notify { + uint32_t extmem_erase_pending_notify_request_id; + uint32_t extmem_erase_pending_notify_offset; + uint32_t extmem_erase_pending_notify_size; +}; + +struct extmem_get_capabilities_notify_pending { + uint32_t extmem_get_capabilities_notify_pending_request_id; +}; + +struct extmem_nfy { + union { + struct extmem_read_pending_notify extmem_nfy_msg_extmem_read_pending_notify_m; + struct extmem_write_pending_notify extmem_nfy_msg_extmem_write_pending_notify_m; + struct extmem_erase_pending_notify extmem_nfy_msg_extmem_erase_pending_notify_m; + struct extmem_get_capabilities_notify_pending + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m; + }; + enum { + extmem_nfy_msg_extmem_read_pending_notify_m_c, + extmem_nfy_msg_extmem_write_pending_notify_m_c, + extmem_nfy_msg_extmem_erase_pending_notify_m_c, + extmem_nfy_msg_extmem_get_capabilities_notify_pending_m_c, + } extmem_nfy_msg_choice; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/prng/CMakeLists.txt b/subsys/sdfw_services/services/prng/CMakeLists.txt new file mode 100644 index 000000000000..0a12e08893ee --- /dev/null +++ b/subsys/sdfw_services/services/prng/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(prng_service.c) + +generate_and_add_cbor_files(prng_service.cddl zcbor_generated + prng_req + prng_rsp +) diff --git a/subsys/sdfw_services/services/prng/Kconfig b/subsys/sdfw_services/services/prng/Kconfig new file mode 100644 index 000000000000..8eb0d48f6e61 --- /dev/null +++ b/subsys/sdfw_services/services/prng/Kconfig @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +service_name = PRNG +service_default_enabled = y +service_id = 0x70 +service_version = 1 +service_buffer_size = 128 +service_name_str = PRNG Service +rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/prng/prng_service.c b/subsys/sdfw_services/services/prng/prng_service.c new file mode 100644 index 000000000000..4a6e53ffff0f --- /dev/null +++ b/subsys/sdfw_services/services/prng/prng_service.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include "prng_service_decode.h" +#include "prng_service_encode.h" +#include "prng_service_types.h" +#include +#include "ssf_client_os.h" + +SSF_CLIENT_SERVICE_DEFINE(prng_srvc, PRNG, cbor_encode_prng_req, cbor_decode_prng_rsp); + +int ssf_prng_get_random(uint8_t *buffer, size_t length) +{ + int err; + int32_t ret; + uint32_t req; + struct prng_rsp decoded_rsp; + const uint8_t *rsp_pkt; + + if (buffer == NULL) { + return -SSF_EINVAL; + } + + req = length; + + err = ssf_client_send_request(&prng_srvc, &req, &decoded_rsp, &rsp_pkt); + if (err != 0) { + return -SSF_EIO; + } + + ret = decoded_rsp.prng_rsp_status; + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + /* Fail if the received number of random bytes is not enough to fill the output buffer. */ + if (decoded_rsp.prng_rsp_buffer.len < length) { + ssf_client_decode_done(rsp_pkt); + return -SSF_EMSGSIZE; + } + + memcpy(buffer, decoded_rsp.prng_rsp_buffer.value, length); + + ssf_client_decode_done(rsp_pkt); + return 0; +} diff --git a/subsys/sdfw_services/services/prng/prng_service.cddl b/subsys/sdfw_services/services/prng/prng_service.cddl new file mode 100644 index 000000000000..4ae7eee15743 --- /dev/null +++ b/subsys/sdfw_services/services/prng/prng_service.cddl @@ -0,0 +1,16 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +; PRNG random number request. +prng_req = [ + length: uint, +] + +; PRNG random number response. +prng_rsp = [ + status: int, + buffer: bstr, +] diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/prng/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..4a74830cf1e7 --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + prng_service_decode.c + prng_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.c b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.c new file mode 100644 index 000000000000..70c51da7d27c --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "prng_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_prng_rsp(zcbor_state_t *state, struct prng_rsp *result); +static bool decode_prng_req(zcbor_state_t *state, uint32_t *result); + +static bool decode_prng_rsp(zcbor_state_t *state, struct prng_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result).prng_rsp_status)))) && + ((zcbor_bstr_decode(state, (&(*result).prng_rsp_buffer))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_prng_req(zcbor_state_t *state, uint32_t *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_prng_req(const uint8_t *payload, size_t payload_len, uint32_t *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_prng_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_prng_rsp(const uint8_t *payload, size_t payload_len, struct prng_rsp *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_prng_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.h b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.h new file mode 100644 index 000000000000..f17ff1e92ed2 --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_decode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef PRNG_SERVICE_DECODE_H__ +#define PRNG_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "prng_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_prng_req(const uint8_t *payload, size_t payload_len, uint32_t *result, + size_t *payload_len_out); + +int cbor_decode_prng_rsp(const uint8_t *payload, size_t payload_len, struct prng_rsp *result, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* PRNG_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.c b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.c new file mode 100644 index 000000000000..ae37e850bfde --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "prng_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_prng_rsp(zcbor_state_t *state, const struct prng_rsp *input); +static bool encode_prng_req(zcbor_state_t *state, const uint32_t *input); + +static bool encode_prng_rsp(zcbor_state_t *state, const struct prng_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 2) && + ((((zcbor_int32_encode(state, (&(*input).prng_rsp_status)))) && + ((zcbor_bstr_encode(state, (&(*input).prng_rsp_buffer))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_prng_req(zcbor_state_t *state, const uint32_t *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_uint32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_prng_req(uint8_t *payload, size_t payload_len, const uint32_t *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_prng_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_prng_rsp(uint8_t *payload, size_t payload_len, const struct prng_rsp *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_prng_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.h b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.h new file mode 100644 index 000000000000..53c1a929b640 --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_encode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef PRNG_SERVICE_ENCODE_H__ +#define PRNG_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "prng_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_prng_req(uint8_t *payload, size_t payload_len, const uint32_t *input, + size_t *payload_len_out); + +int cbor_encode_prng_rsp(uint8_t *payload, size_t payload_len, const struct prng_rsp *input, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* PRNG_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_types.h b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_types.h new file mode 100644 index 000000000000..8567fabad22c --- /dev/null +++ b/subsys/sdfw_services/services/prng/zcbor_generated/prng_service_types.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef PRNG_SERVICE_TYPES_H__ +#define PRNG_SERVICE_TYPES_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct prng_rsp { + int32_t prng_rsp_status; + struct zcbor_string prng_rsp_buffer; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* PRNG_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/CMakeLists.txt b/subsys/sdfw_services/services/reset_evt/CMakeLists.txt new file mode 100644 index 000000000000..75d0c7f7cff8 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(reset_evt_service.c) + +generate_and_add_cbor_files(reset_evt_service.cddl zcbor_generated + reset_evt_sub_req + reset_evt_sub_rsp + reset_evt_notif +) diff --git a/subsys/sdfw_services/services/reset_evt/Kconfig b/subsys/sdfw_services/services/reset_evt/Kconfig new file mode 100644 index 000000000000..36c5854e0cf8 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/Kconfig @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +service_name = RESET_EVT +service_default_enabled = y +service_id = 0x68 +service_version = 1 +service_buffer_size = 32 +service_name_str = Reset Event Notification +rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/reset_evt/reset_evt_service.c b/subsys/sdfw_services/services/reset_evt/reset_evt_service.c new file mode 100644 index 000000000000..303e74359ead --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/reset_evt_service.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include "reset_evt_service_decode.h" +#include "reset_evt_service_encode.h" +#include "reset_evt_service_types.h" +#include +#include +#include +#include "ssf_client_os.h" + +SSF_CLIENT_LOG_REGISTER(reset_evt_service, CONFIG_SSF_RESET_EVT_SERVICE_LOG_LEVEL); + +SSF_CLIENT_SERVICE_DEFINE(reset_evt_srvc, RESET_EVT, cbor_encode_reset_evt_sub_req, + cbor_decode_reset_evt_sub_rsp); + +SSF_CLIENT_NOTIF_LISTENER_DEFINE(reset_evt_listener, RESET_EVT, cbor_decode_reset_evt_notif, + reset_evt_handler); + +static ssf_reset_evt_callback user_callback; + +static int reset_evt_handler(struct ssf_notification *notif, void *handler_user_data) +{ + int err; + struct reset_evt_notif notification; + + if (user_callback == NULL) { + SSF_CLIENT_LOG_WRN("No user callback set"); + return -SSF_EFAULT; + } + + err = ssf_client_notif_decode(notif, ¬ification); + ssf_client_notif_decode_done(notif); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Decoding notification failed: %d", err); + return err; + } + + err = user_callback(notification.reset_evt_notif_domains, + notification.reset_evt_notif_delay_ms, handler_user_data); + + return err; +} + +int ssf_reset_evt_subscribe(ssf_reset_evt_callback callback, void *context) +{ + int err; + bool req_subscribe; + int32_t rsp_status; + + if (user_callback != NULL || callback == NULL) { + return -SSF_EINVAL; + } + + err = ssf_client_notif_register(&reset_evt_listener, context); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to register for notifications: %d", err); + return err; + } + + req_subscribe = true; + err = ssf_client_send_request(&reset_evt_srvc, &req_subscribe, &rsp_status, NULL); + if (err != 0) { + return err; + } + + if (rsp_status != 0) { + SSF_CLIENT_LOG_ERR("Failed to subscribe to server notifications: %d", err); + err = ssf_client_notif_deregister(&reset_evt_listener); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to deregister from notifications: %d", err); + } + + return -SSF_EFAULT; + } + + user_callback = callback; + + return err; +} + +int ssf_reset_evt_unsubscribe(void) +{ + int err; + bool req_subscribe; + int32_t rsp_status; + + req_subscribe = false; + + err = ssf_client_send_request(&reset_evt_srvc, &req_subscribe, &rsp_status, NULL); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to issue unsubscribe message to server: %d", err); + return err; + } + + if (rsp_status != 0) { + SSF_CLIENT_LOG_ERR("Server returned error when unsubscribing: %d", err); + return -SSF_EFAULT; + } + + err = ssf_client_notif_deregister(&reset_evt_listener); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to de-register from notifications: %d", err); + return err; + } + + user_callback = NULL; + + return err; +} diff --git a/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl b/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl new file mode 100644 index 000000000000..56e27b984dc9 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl @@ -0,0 +1,21 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +; Subscribe to reset events +reset_evt_sub_req = [ + subscribe: bool, ; True for subscribe, false for unsubscribe +] + +; Response from subscribing to reset event service. +reset_evt_sub_rsp = [ + status: int, +] + +; Reset event notification message. +reset_evt_notif = [ + domains: uint, ; Bitfield of domains that will be reset + delay_ms: uint, ; Delay in milliseconds before the incoming reset +] diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..ba5122c76dfb --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + reset_evt_service_decode.c + reset_evt_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c new file mode 100644 index 000000000000..0ec42dfada5e --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "reset_evt_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result); +static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result); +static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result); + +static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_domains)))) && + ((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_delay_ms))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_bool_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_sub_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_sub_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, + struct reset_evt_notif *result, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_reset_evt_notif, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h new file mode 100644 index 000000000000..73ebfb26e965 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef RESET_EVT_SERVICE_DECODE_H__ +#define RESET_EVT_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "reset_evt_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, + size_t *payload_len_out); + +int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out); + +int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, + struct reset_evt_notif *result, size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* RESET_EVT_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c new file mode 100644 index 000000000000..f3d096c77f07 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "reset_evt_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input); +static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input); +static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input); + +static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((zcbor_list_start_encode(state, 2) && + ((((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_domains)))) && + ((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_delay_ms))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 2)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_bool_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_sub_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_sub_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, + const struct reset_evt_notif *input, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_reset_evt_notif, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h new file mode 100644 index 000000000000..5892b17ea8f5 --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef RESET_EVT_SERVICE_ENCODE_H__ +#define RESET_EVT_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "reset_evt_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, + size_t *payload_len_out); + +int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out); + +int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, + const struct reset_evt_notif *input, size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* RESET_EVT_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h new file mode 100644 index 000000000000..e7b9b242189a --- /dev/null +++ b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef RESET_EVT_SERVICE_TYPES_H__ +#define RESET_EVT_SERVICE_TYPES_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct reset_evt_notif { + uint32_t reset_evt_notif_domains; + uint32_t reset_evt_notif_delay_ms; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* RESET_EVT_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt b/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt new file mode 100644 index 000000000000..a0bc40fa1a30 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(sdfw_update_service.c) + +generate_and_add_cbor_files(sdfw_update_service.cddl zcbor_generated + sdfw_update_req + sdfw_update_rsp +) diff --git a/subsys/sdfw_services/services/sdfw_update/Kconfig b/subsys/sdfw_services/services/sdfw_update/Kconfig new file mode 100644 index 000000000000..55e872a2df81 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/Kconfig @@ -0,0 +1,47 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +service_name = SDFW_UPDATE +service_default_enabled = y +service_id = 0x69 +service_version = 1 +service_buffer_size = 64 +service_name_str = SDFW Update +rsource "../Kconfig.template.service" + +if SSF_SDFW_UPDATE_SERVICE_ENABLED + +config SSF_SDFW_UPDATE_TBS_OFFSET + hex + default 0x10 + help + Offset of TBS data inside the update blob. + +config SSF_SDFW_UPDATE_PUBLIC_KEY_OFFSET + hex + default 0x110 + help + Offset of public key inside the update blob. + +config SSF_SDFW_UPDATE_SIGNATURE_OFFSET + hex + default 0x130 + help + Offset of signature inside the update blob. + +config SSF_SDFW_UPDATE_FIRMWARE_OFFSET + hex + default 0x170 + help + Offset of firmware inside the update blob. + +config SSF_SDFW_UPDATE_DOWNLOAD_MAX + hex + default 0xf0000 + help + Max size of update. + +endif # SSF_SDFW_UPDATE_SERVICE_ENABLED diff --git a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c new file mode 100644 index 000000000000..ee4075bb555f --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include + +#include "sdfw_update_service_decode.h" +#include "sdfw_update_service_encode.h" +#include "sdfw_update_service_types.h" +#include +#include "ssf_client_os.h" + +SSF_CLIENT_LOG_REGISTER(sdfw_update_service, CONFIG_SSF_SDFW_UPDATE_SERVICE_LOG_LEVEL); + +SSF_CLIENT_SERVICE_DEFINE(sdfw_update_srvc, SDFW_UPDATE, cbor_encode_sdfw_update_req, + cbor_decode_sdfw_update_rsp); + +int ssf_sdfw_update(uintptr_t blob_addr) +{ + int err; + struct sdfw_update_req req_data; + int32_t rsp_status; + + req_data.sdfw_update_req_tbs_addr = blob_addr + CONFIG_SSF_SDFW_UPDATE_TBS_OFFSET; + req_data.sdfw_update_req_dl_max = CONFIG_SSF_SDFW_UPDATE_DOWNLOAD_MAX; + req_data.sdfw_update_req_dl_addr_fw = blob_addr + CONFIG_SSF_SDFW_UPDATE_FIRMWARE_OFFSET; + req_data.sdfw_update_req_dl_addr_pk = blob_addr + CONFIG_SSF_SDFW_UPDATE_PUBLIC_KEY_OFFSET; + req_data.sdfw_update_req_dl_addr_signature = + blob_addr + CONFIG_SSF_SDFW_UPDATE_SIGNATURE_OFFSET; + + err = ssf_client_send_request(&sdfw_update_srvc, &req_data, &rsp_status, NULL); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Error while sending request: %d", err); + return err; + } + + if (rsp_status != 0) { + SSF_CLIENT_LOG_ERR("Error in response: %d", rsp_status); + } + + return err; +} diff --git a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl new file mode 100644 index 000000000000..da6cd3c031aa --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl @@ -0,0 +1,17 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + +sdfw_update_req = [ + tbs_addr: uint, ; Address of data to be stored in SICR.UROT.UPDATE.SM.TBS + dl_max: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.MAX + dl_addr_fw: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.FIRMWARE + dl_addr_pk: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.PUBKEY + dl_addr_signature: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.SIGNATURE +] + +sdfw_update_rsp = [ + status: int, +] diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..0f96d2b36685 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + sdfw_update_service_decode.c + sdfw_update_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c new file mode 100644 index 000000000000..25640e21ae7e --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "sdfw_update_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result); +static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result); + +static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_decode(state) && + ((((zcbor_int32_decode(state, (&(*result)))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_decode(state) && + ((((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_tbs_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_max)))) && + ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_fw)))) && + ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_pk)))) && + ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_signature))))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, + struct sdfw_update_req *result, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_sdfw_update_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_sdfw_update_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h new file mode 100644 index 000000000000..a869f949d749 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SDFW_UPDATE_SERVICE_DECODE_H__ +#define SDFW_UPDATE_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "sdfw_update_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, + struct sdfw_update_req *result, size_t *payload_len_out); + +int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* SDFW_UPDATE_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c new file mode 100644 index 000000000000..be58fb2e1a5c --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "sdfw_update_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input); +static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input); + +static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((zcbor_list_start_encode(state, 1) && + ((((zcbor_int32_encode(state, (&(*input)))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 1)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (zcbor_list_start_encode(state, 5) && + ((((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_tbs_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_max)))) && + ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_fw)))) && + ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_pk)))) && + ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_signature))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, + const struct sdfw_update_req *input, size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_sdfw_update_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out) +{ + zcbor_state_t states[3]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_sdfw_update_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h new file mode 100644 index 000000000000..94f0d7b477f5 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SDFW_UPDATE_SERVICE_ENCODE_H__ +#define SDFW_UPDATE_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "sdfw_update_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, + const struct sdfw_update_req *input, size_t *payload_len_out); + +int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* SDFW_UPDATE_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h new file mode 100644 index 000000000000..ecf3d6c40239 --- /dev/null +++ b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SDFW_UPDATE_SERVICE_TYPES_H__ +#define SDFW_UPDATE_SERVICE_TYPES_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct sdfw_update_req { + uint32_t sdfw_update_req_tbs_addr; + uint32_t sdfw_update_req_dl_max; + uint32_t sdfw_update_req_dl_addr_fw; + uint32_t sdfw_update_req_dl_addr_pk; + uint32_t sdfw_update_req_dl_addr_signature; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* SDFW_UPDATE_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/ssf_header.cddl b/subsys/sdfw_services/services/ssf_header.cddl new file mode 100644 index 000000000000..7c65e421ae86 --- /dev/null +++ b/subsys/sdfw_services/services/ssf_header.cddl @@ -0,0 +1,13 @@ +; +; Copyright (c) 2024 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + + +; The SSF Header +ssf_header_req = [ + remote_id: int, + service_id: int, + service_version: int, +] diff --git a/subsys/sdfw_services/services/suit_service/CMakeLists.txt b/subsys/sdfw_services/services/suit_service/CMakeLists.txt new file mode 100644 index 000000000000..6194bc9fb070 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library() + +zephyr_library_sources(suit_service.c) +zephyr_library_sources(suit_update.c) +zephyr_library_sources(suit_mci.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_PROCESSOR suit_auth.c) + +zephyr_library_link_libraries(suit_utils) + +if(CONFIG_SUIT_STREAM_SOURCE_IPC) + zephyr_library_link_libraries(suit_stream_sources_interface) + zephyr_library_link_libraries(suit_stream_sinks_interface) +endif() + +generate_and_add_cbor_files(suit_service.cddl zcbor_generated + suit_req + suit_rsp + suit_nfy +) diff --git a/subsys/sdfw_services/services/suit_service/Kconfig b/subsys/sdfw_services/services/suit_service/Kconfig new file mode 100644 index 000000000000..147d6d96d47c --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/Kconfig @@ -0,0 +1,36 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SSF_SUIT_SERVICE_ENABLED + bool "SUIT Update service" + depends on SDFW_SERVICES_ENABLED + depends on SUIT_UTILS + depends on SUIT_METADATA + depends on ZCBOR_CANONICAL + +if SSF_SUIT_SERVICE_ENABLED + +config SSF_SUIT_SERVICE_ID + hex + default 0x53 + help + Service ID for SUIT Update service + +config SSF_SUIT_SERVICE_VERSION + int + default 1 + help + Version of SUIT Update service + +config SSF_SUIT_SERVICE_BUFFER_SIZE + int "Buffer size for SUIT Update service handler" + default 128 + +module = SSF_SUIT_SERVICE +module-str = SUIT Update service +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif # SSF_SUIT_SERVICE_ENABLED diff --git a/subsys/sdfw_services/services/suit_service/suit_auth.c b/subsys/sdfw_services/services/suit_service/suit_auth.c new file mode 100644 index 000000000000..9ebf79ebd66b --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_auth.c @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include "suit_service_types.h" +#include "suit_service_utils.h" + +#include +LOG_MODULE_REGISTER(suit_srvc_auth, CONFIG_SSF_SUIT_SERVICE_LOG_LEVEL); + +extern const struct ssf_client_srvc suit_srvc; + +int suit_plat_authenticate_manifest(struct zcbor_string *manifest_component_id, + enum suit_cose_alg alg_id, struct zcbor_string *key_id, + struct zcbor_string *signature, struct zcbor_string *data) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_authenticate_manifest_req *req_data; + + if (manifest_component_id == NULL || key_id == NULL || signature == NULL || data == NULL) { + return SUIT_ERR_DECODING; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(authenticate_manifest); + + req_data = &req.SSF_SUIT_REQ(authenticate_manifest); + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, manifest_component_id) = + *manifest_component_id; + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, alg_id) = alg_id; + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, key_id) = *key_id; + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, signature) = *signature; + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, data_addr) = (uintptr_t)data->value; + req_data->SSF_SUIT_REQ_ARG(authenticate_manifest, data_size) = data->len; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_ERR_CRASH; + } + + struct suit_authenticate_manifest_rsp *rsp_data = &rsp.SSF_SUIT_RSP(authenticate_manifest); + + return rsp_data->SSF_SUIT_RSP_ARG(authenticate_manifest, ret); +} + +int suit_plat_authorize_unsigned_manifest(struct zcbor_string *manifest_component_id) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_authorize_unsigned_manifest_req *req_data; + + if (manifest_component_id == NULL) { + return SUIT_ERR_DECODING; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(authorize_unsigned_manifest); + + req_data = &req.SSF_SUIT_REQ(authorize_unsigned_manifest); + req_data->SSF_SUIT_REQ_ARG(authorize_unsigned_manifest, manifest_component_id) = + *manifest_component_id; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_ERR_CRASH; + } + + return rsp.SSF_SUIT_RSP(authorize_unsigned_manifest) + .SSF_SUIT_RSP_ARG(authorize_unsigned_manifest, ret); +} + +int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_check_component_compatibility_req *req_data; + + if (class_id == NULL || component_id == NULL) { + return SUIT_ERR_DECODING; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(check_component_compatibility); + + req_data = &req.SSF_SUIT_REQ(check_component_compatibility); + req_data->SSF_SUIT_REQ_ARG(check_component_compatibility, manifest_class_id).value = + (const uint8_t *)class_id; + req_data->SSF_SUIT_REQ_ARG(check_component_compatibility, manifest_class_id).len = + sizeof(*class_id); + req_data->SSF_SUIT_REQ_ARG(check_component_compatibility, component_id) = *component_id; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_ERR_CRASH; + } + + return rsp.SSF_SUIT_RSP(check_component_compatibility) + .SSF_SUIT_RSP_ARG(check_component_compatibility, ret); +} + +int suit_plat_authorize_sequence_num(enum suit_command_sequence seq_name, + struct zcbor_string *manifest_component_id, + unsigned int seq_num) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_authorize_seq_num_req *req_data; + + if (manifest_component_id == NULL) { + return SUIT_ERR_DECODING; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(authorize_seq_num); + + req_data = &req.SSF_SUIT_REQ(authorize_seq_num); + req_data->SSF_SUIT_REQ_ARG(authorize_seq_num, manifest_component_id) = + *manifest_component_id; + req_data->SSF_SUIT_REQ_ARG(authorize_seq_num, seq_num) = seq_num; + req_data->SSF_SUIT_REQ_ARG(authorize_seq_num, command_seq) = (uint32_t)seq_name; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_ERR_CRASH; + } + + return rsp.SSF_SUIT_RSP(authorize_seq_num).SSF_SUIT_RSP_ARG(authorize_seq_num, ret); +} diff --git a/subsys/sdfw_services/services/suit_service/suit_mci.c b/subsys/sdfw_services/services/suit_service/suit_mci.c new file mode 100644 index 000000000000..3bd23aaccc3f --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_mci.c @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include "suit_service_types.h" +#include +#include "suit_service_utils.h" + +#include +LOG_MODULE_REGISTER(suit_srvc_mci, CONFIG_SSF_SUIT_SERVICE_LOG_LEVEL); + +extern const struct ssf_client_srvc suit_srvc; + +suit_ssf_err_t suit_get_supported_manifest_roles(suit_manifest_role_t *roles, size_t *size) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_get_supported_manifest_roles_rsp *rsp_data; + const uint8_t *rsp_pkt; + + if (roles == NULL || size == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(get_supported_manifest_roles); + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, &rsp_pkt); + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(get_supported_manifest_roles); + ret = rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_roles, ret); + if (ret != SUIT_PLAT_SUCCESS) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + const size_t cnt = + rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_roles, roles_int_count); + uint32_t *roles_array = rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_roles, roles_int); + + if (cnt > *size) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_SIZE; + } + + for (size_t i = 0; i < cnt; i++) { + /* Manifest role encoded as two nibbles: , + * so it cannot exceed 0xFF + */ + if (roles_array[i] > 0xFF) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + roles[i] = (suit_manifest_role_t)roles_array[i]; + } + + *size = cnt; + ssf_client_decode_done(rsp_pkt); + + return ret; +} + +suit_ssf_err_t suit_get_supported_manifest_info(suit_manifest_role_t role, + suit_ssf_manifest_class_info_t *class_info) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_get_supported_manifest_info_req *req_data; + struct suit_get_supported_manifest_info_rsp *rsp_data; + const uint8_t *rsp_pkt; + + if (class_info == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(get_supported_manifest_info); + + req_data = &req.SSF_SUIT_REQ(get_supported_manifest_info); + req_data->SSF_SUIT_REQ_ARG(get_supported_manifest_info, role) = role; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, &rsp_pkt); + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(get_supported_manifest_info); + ret = rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_info, ret); + if (ret != SUIT_PLAT_SUCCESS) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + if (rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_info, role) != role) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + struct zcbor_string *class_id_str = + &rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_info, class_id); + if (class_id_str->len != sizeof(class_info->class_id)) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + struct zcbor_string *vendor_id_str = + &rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_info, vendor_id); + if (vendor_id_str->len != sizeof(class_info->vendor_id)) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + int32_t downgrade_prevention_policy = rsp_data->SSF_SUIT_RSP_ARG( + get_supported_manifest_info, downgrade_prevention_policy); + + if (downgrade_prevention_policy != SUIT_DOWNGRADE_PREVENTION_DISABLED && + downgrade_prevention_policy != SUIT_DOWNGRADE_PREVENTION_ENABLED) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + int32_t independent_updateability_policy = rsp_data->SSF_SUIT_RSP_ARG( + get_supported_manifest_info, independent_updateability_policy); + if (independent_updateability_policy != SUIT_INDEPENDENT_UPDATE_DENIED && + independent_updateability_policy != SUIT_INDEPENDENT_UPDATE_ALLOWED) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + int32_t signature_verification_policy = rsp_data->SSF_SUIT_RSP_ARG( + get_supported_manifest_info, signature_verification_policy); + if (signature_verification_policy != SUIT_SIGNATURE_CHECK_DISABLED && + signature_verification_policy != SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE && + signature_verification_policy != SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + memcpy(&class_info->class_id, class_id_str->value, class_id_str->len); + memcpy(&class_info->vendor_id, vendor_id_str->value, vendor_id_str->len); + class_info->role = + (suit_manifest_role_t)rsp_data->SSF_SUIT_RSP_ARG(get_supported_manifest_info, role); + class_info->downgrade_prevention_policy = + (suit_downgrade_prevention_policy_t)downgrade_prevention_policy; + class_info->independent_updateability_policy = + (suit_independent_updateability_policy_t)independent_updateability_policy; + class_info->signature_verification_policy = + (suit_signature_verification_policy_t)signature_verification_policy; + + ssf_client_decode_done(rsp_pkt); + + return ret; +} diff --git a/subsys/sdfw_services/services/suit_service/suit_service.c b/subsys/sdfw_services/services/suit_service/suit_service.c new file mode 100644 index 000000000000..ea92cd72d3ed --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_service.c @@ -0,0 +1,369 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include +#include +#include "suit_service_decode.h" +#include "suit_service_encode.h" +#include "suit_service_types.h" +#include "suit_service_utils.h" + +#include +#include + +#include +LOG_MODULE_REGISTER(suit_srvc, CONFIG_SSF_SUIT_SERVICE_LOG_LEVEL); + +/* Define the SSF service client as global variable, so it is possible to implement service using + * multiple files. + */ +#define SSF_CLIENT_SERVICE_DEFINE_GLOBAL(_name, _srvc_name, _req_encode, _rsp_decode) \ + const struct ssf_client_srvc _name = { \ + .id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \ + .version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \ + .req_encode = (request_encoder)_req_encode, \ + .rsp_decode = (response_decoder)_rsp_decode, \ + .req_buf_size = (CONFIG_SSF_##_srvc_name##_SERVICE_BUFFER_SIZE) \ + } + +SSF_CLIENT_SERVICE_DEFINE_GLOBAL(suit_srvc, SUIT, cbor_encode_suit_req, cbor_decode_suit_rsp); + +#if defined(CONFIG_SUIT_STREAM_IPC_PROVIDER) + +#include + +SSF_CLIENT_NOTIF_LISTENER_DEFINE(suit_evt_listener, SUIT, cbor_decode_suit_nfy, notify_evt_handler); + +/** + * @brief Function pointer and private data (context) registered by streamer provider. + * Utilized to inform about image chunk status change. + * + * @note Streamer requestor notifies its peer that the status of some of image chunks + * has been changed. This happens when image chunk is processed by streamer requestor. + * Once such notification is received by streamer requestor proxy (this code) + * it can be populated (called back) to streamer provider, using registered function + * pointer. See suit_ipc_streamer_chunk_status_evt_subscribe. + * Only one streamer provider per local domain can be registered at time. + */ +static suit_ipc_streamer_chunk_status_notify_fn chunk_status_notify_fn; +static void *chunk_status_notify_context; + +/** + * @brief Function pointer and private data (context) registered by streamer provider. + * Utilized to inform that the image is missing by the streamer requestor. + * + * @note Streamer requestor notifies its peer about pending request for the image. + * Once such notification is received by streamer requestor proxy (this code) + * it can be populated (called back) to streamer provider, using registered function + * pointer. See suit_ipc_streamer_missing_image_evt_subscribe. + * Only one streamer provider per local domain can be registered at time. + */ +static suit_ipc_streamer_missing_image_notify_fn missing_image_notify_fn; +static void *missing_image_notify_context; + +/** + * @brief Initializes notification channel between server (executed in Secure Domain) + * and client (this code, local domain) + * + * @note This function shall be executed once, during the system initialization, + * in case if there is a need to support server-sent notifications. + */ +static int evt_listener_init(void) +{ + int err; + void *context = NULL; + + err = ssf_client_notif_register(&suit_evt_listener, context); + if (err != 0) { + LOG_ERR("Failed to register for notifications: %d", err); + return err; + } + + struct suit_req req = { 0 }; + struct suit_rsp rsp = { 0 }; + struct suit_evt_sub_req *req_data = { 0 }; + struct suit_evt_sub_rsp *rsp_data = { 0 }; + + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(evt_sub); + req_data = &req.SSF_SUIT_REQ(evt_sub); + req_data->SSF_SUIT_REQ_ARG(evt_sub, subscribe) = true; + + err = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (err != 0) { + LOG_ERR("Failed to send request: %d", err); + + int dreg_err = ssf_client_notif_deregister(&suit_evt_listener); + + if (dreg_err) { + LOG_ERR("Failed to deregister from notifications: %d", dreg_err); + } + + return err; + } + + rsp_data = &rsp.SSF_SUIT_RSP(evt_sub); + err = rsp_data->SSF_SUIT_RSP_ARG(evt_sub, ret); + if (err != 0) { + LOG_ERR("Failed to subscribe: %d", err); + + int dreg_err = ssf_client_notif_deregister(&suit_evt_listener); + + if (dreg_err) { + LOG_ERR("Failed to deregister from notifications: %d", dreg_err); + } + + return err; + } + + LOG_INF("%s success", __func__); + return 0; +} + +/** + * @brief Passes notification about missing image from event handler to + * registered client (streamer provider). + */ +static int handle_missing_image_notify_fn(const struct suit_missing_image_evt_nfy *nfy_data) +{ + int err = 0; + suit_ipc_streamer_missing_image_notify_fn notify_fn = missing_image_notify_fn; + + if (notify_fn != NULL) { + void *context = missing_image_notify_context; + const uint8_t *resource_id = nfy_data->suit_missing_image_evt_nfy_resource_id.value; + size_t resource_id_length = nfy_data->suit_missing_image_evt_nfy_resource_id.len; + uint32_t stream_session_id = nfy_data->suit_missing_image_evt_nfy_stream_session_id; + + err = notify_fn(resource_id, resource_id_length, stream_session_id, context); + } + + return err; +} + +/** + * @brief Passes notification about chunk status update from event handler to + * registered client (streamer provider). + */ +static int handle_chunk_status_notify_fn(const struct suit_chunk_status_evt_nfy *nfy_data) +{ + int err = 0; + suit_ipc_streamer_chunk_status_notify_fn notify_fn = chunk_status_notify_fn; + + if (notify_fn != NULL) { + void *context = chunk_status_notify_context; + uint32_t stream_session_id = nfy_data->suit_chunk_status_evt_nfy_stream_session_id; + + err = notify_fn(stream_session_id, context); + } + + return err; +} + +/** + * @brief Decodes notification message and calls respective + * notification handler + */ +static int notify_evt_handler(struct ssf_notification *notif, void *handler_user_data) +{ + ARG_UNUSED(handler_user_data); + + struct suit_nfy notification; + + int err = ssf_client_notif_decode(notif, ¬ification); + + if (err != 0) { + LOG_ERR("Decoding notification failed: %d", err); + return err; + } + + switch (notification.suit_nfy_msg_choice) { + case suit_nfy_msg_suit_missing_image_evt_nfy_m_c: + LOG_INF("Missing image notification"); + struct suit_missing_image_evt_nfy *missing_image_evt_nfy_data = + ¬ification.suit_nfy_msg_suit_missing_image_evt_nfy_m; + + err = handle_missing_image_notify_fn(missing_image_evt_nfy_data); + break; + + case suit_nfy_msg_suit_chunk_status_evt_nfy_m_c: + LOG_INF("Chunk status update notification"); + struct suit_chunk_status_evt_nfy *chunk_status_evt_nfy_data = + ¬ification.suit_nfy_msg_suit_chunk_status_evt_nfy_m; + + err = handle_chunk_status_notify_fn(chunk_status_evt_nfy_data); + break; + + default: + break; + } + ssf_client_notif_decode_done(notif); + return err; +} + +suit_plat_err_t suit_ipc_streamer_chunk_enqueue(uint32_t stream_session_id, uint32_t chunk_id, + uint32_t offset, uint8_t *address, uint32_t size, + bool last_chunk) +{ + int err; + struct suit_req req = { 0 }; + struct suit_rsp rsp = { 0 }; + struct suit_chunk_enqueue_req *req_data = { 0 }; + struct suit_chunk_enqueue_rsp *rsp_data = { 0 }; + + LOG_INF("Chunk enqueue, stream_session_id: %d, chunk_id: %d, offset: %d," + " address: 0x%08X, size: %d, last_chunk: %d", + stream_session_id, chunk_id, offset, (uint32_t)address, size, last_chunk); + + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(chunk_enqueue); + req_data = &req.SSF_SUIT_REQ(chunk_enqueue); + + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, stream_session_id) = stream_session_id; + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, chunk_id) = chunk_id; + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, offset) = offset; + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, last_chunk) = last_chunk; + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, addr) = (uint32_t)address; + req_data->SSF_SUIT_REQ_ARG(chunk_enqueue, size) = size; + + err = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (err != 0) { + LOG_ERR("Chunk enqueue, ssf_client_send_request failed"); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(chunk_enqueue); + err = rsp_data->SSF_SUIT_RSP_ARG(chunk_enqueue, ret); + + LOG_INF("Chunk enqueue, ssf_client_send_request return code: %d", err); + return err; +} + +suit_plat_err_t suit_ipc_streamer_chunk_status_req(uint32_t stream_session_id, + suit_ipc_streamer_chunk_info_t *chunk_info, + size_t *chunk_info_count) +{ + int err; + struct suit_req req = { 0 }; + struct suit_rsp rsp = { 0 }; + struct suit_chunk_status_req *req_data = { 0 }; + struct suit_chunk_status_rsp *rsp_data = { 0 }; + + LOG_INF("Chunk status request, stream_session_id: %d", stream_session_id); + + if (chunk_info == NULL || chunk_info_count == NULL) { + LOG_INF("Chunk status request, invalid arguments"); + return SUIT_PLAT_ERR_NOMEM; + } + + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(chunk_status); + req_data = &req.SSF_SUIT_REQ(chunk_status); + req_data->SSF_SUIT_REQ_ARG(chunk_status, stream_session_id) = stream_session_id; + + err = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (err != 0) { + LOG_ERR("Chunk status request, ssf_client_send_request failed"); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(chunk_status); + err = rsp_data->SSF_SUIT_RSP_ARG(chunk_status, ret); + LOG_INF("Chunk status request, ssf_client_send_request return code: %d", err); + + if (err == SUIT_PLAT_SUCCESS) { + size_t count = rsp_data->SSF_SUIT_RSP_ARG(chunk_status, + chunk_info_suit_chunk_info_entry_m_count); + + if (count > *chunk_info_count) { + *chunk_info_count = 0; + LOG_ERR("Chunk status request, not enough space to store response"); + return SUIT_PLAT_ERR_NOMEM; + } + + for (int i = 0; i < count; ++i) { + struct suit_chunk_info_entry *in_entry = &rsp_data->SSF_SUIT_RSP_ARG( + chunk_status, chunk_info_suit_chunk_info_entry_m)[i]; + + suit_ipc_streamer_chunk_info_t *tgt_entry = &chunk_info[i]; + + tgt_entry->chunk_id = in_entry->suit_chunk_info_entry_chunk_id; + tgt_entry->status = in_entry->suit_chunk_info_entry_status; + } + + *chunk_info_count = count; + } + + return err; +} + +suit_plat_err_t +suit_ipc_streamer_chunk_status_evt_subscribe(suit_ipc_streamer_chunk_status_notify_fn notify_fn, + void *context) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + /* Just one client (ipc streamer provider) can be subscribed for notification at time */ + if (chunk_status_notify_fn == NULL) { + chunk_status_notify_fn = notify_fn; + chunk_status_notify_context = context; + LOG_INF("Subscribed for chunk status update"); + } else { + err = SUIT_PLAT_ERR_NO_RESOURCES; + LOG_ERR("Failed to subscribe for chunk status update"); + } + + return err; +} + +void suit_ipc_streamer_chunk_status_evt_unsubscribe(void) +{ + chunk_status_notify_fn = NULL; + chunk_status_notify_context = NULL; + LOG_INF("Unsubscribed from chunk status update"); +} + +suit_plat_err_t +suit_ipc_streamer_missing_image_evt_subscribe(suit_ipc_streamer_missing_image_notify_fn notify_fn, + void *context) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + /* Just one client (ipc streamer provider) can be subscribed for notification at time */ + if (missing_image_notify_fn == NULL) { + missing_image_notify_fn = notify_fn; + missing_image_notify_context = context; + LOG_INF("Subscribed for image request"); + } else { + err = SUIT_PLAT_ERR_NO_RESOURCES; + LOG_ERR("Failed to subscribe for image request"); + } + + return err; +} + +void suit_ipc_streamer_missing_image_evt_unsubscribe(void) +{ + missing_image_notify_fn = NULL; + missing_image_notify_context = NULL; + LOG_INF("Unsubscribed from image request"); +} + +suit_plat_err_t suit_ipc_streamer_requestor_init(void) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + err = evt_listener_init(); + if (err != 0) { + return SUIT_PLAT_ERR_IPC; + } + + return SUIT_PLAT_SUCCESS; +} +#endif /*CONFIG_SUIT_STREAM_IPC_PROVIDER*/ diff --git a/subsys/sdfw_services/services/suit_service/suit_service.cddl b/subsys/sdfw_services/services/suit_service/suit_service.cddl new file mode 100644 index 000000000000..7bb5eedb9ab4 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_service.cddl @@ -0,0 +1,358 @@ +; +; Copyright (c) 2023 Nordic Semiconductor ASA +; +; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +; + + +; Cache info structure, represented as a list +suit_cache_info_entry = ( + addr: uint, + size: uint, +) + +; Trigger update request +suit_trigger_update_req = ( + 1, + addr: uint, + size: uint, + ; The maximum number of allowed cache info entries should be aligned + ; with the update candidate structure in SUIT storage. + caches: [ 0*6 suit_cache_info_entry ], +) + +; Trigger update response +suit_trigger_update_rsp = ( + 1, + ret: int, +) + + +; Validate component ID and digest request +suit_check_installed_component_digest_req = ( + 2, + component_id: bstr, + alg_id: int, + digest: bstr, +) + +; Validate component ID and digest response +suit_check_installed_component_digest_rsp = ( + 2, + ret: int, +) + + +; Get installed manifest info request +suit_get_installed_manifest_info_req = ( + 3, + ; Changed to use manifest class ID. + ; For end-user it is easier to manage Class IDs than construct component + ; IDs, based on Class IDs. + ; Right now, we do not see a valid case, in which a manifest with the + ; same class ID should be installed using two, different component IDs, + ; so passing Class ID is sufficient to locate the manifest within + ; the SUIT storage. + manifest_class_id: bstr, +) + +; Get installed manifest info response +suit_get_installed_manifest_info_rsp = ( + 3, + ret: int, + seq_num: uint, + ; Semantic versioning, encoded the same way as proposed in + ; suit-update-management. + ; At this moment, it is allowed to use values larger than 255. + ; Negative numbers are used to represent pre-release indicators. + ; If the array length is zero, the manifest does not define semantic + ; version. + semver: [ 0*5 int ], + ; Digest verification status. + ; This value may be calculated inside the request handler. + ; This field was added to inform if the digest value was + ; cryptographically verified. + ; Represented states: + ; - Digest value does not match + ; - Digest value match, signature verification skipped (not required) + ; - Digest value match, signature verification failed + ; - Digest value match, signature verification passed + digest_status: int, + ; Algorithm ID, used to calculated the manifest digest. + ; Set to zero if digest value does not match. + alg_id: int, + ; Digest of the manifest. + ; The value is set (non-empty byte string) only if the digest value + ; match. + digest: bstr, +) + + +; Get install candidate info request +suit_get_install_candidate_info_req = ( + 4, +) + +; Get install candidate info response +suit_get_install_candidate_info_rsp = ( + 4, + ret: int, + ; Changed to the Class ID to use the same type of identification as the + ; suit_get_installed_manifest_info_rsp. + manifest_class_id: bstr, + seq_num: uint, + ; Semantic versioning, encoded the same way as proposed in + ; suit-update-management. + ; If the array length is zero, the manifest does not define semantic + ; version. + semver: [ 0*5 int ], + alg_id: int, + digest: bstr, +) + + +; Authenticate manifest request +suit_authenticate_manifest_req = ( + 10, + ; Left as component ID since this value is a part of the manifest, + ; which signature is authenticated. + ; It is incorrect to authenticate any component ID with the same + ; class ID. + manifest_component_id: bstr, + alg_id: uint, + key_id: bstr, + signature: bstr, + data_addr: uint, + data_size: uint, +) + +; Authenticate manifest response +suit_authenticate_manifest_rsp = ( + 10, + ret: int, +) + +; Authorize unsigned manifest request +suit_authorize_unsigned_manifest_req = ( + 11, + ; Left as component ID since this value is a part of the manifest, + ; which is authorized. + ; It is incorrect to authorize any component ID with the same + ; class ID. + manifest_component_id: bstr, +) + +; Authorize unsigned manifest response +suit_authorize_unsigned_manifest_rsp = ( + 11, + ret: int, +) + + +; Authorize sequence number request +suit_authorize_seq_num_req = ( + 12, + manifest_component_id: bstr, + command_seq: uint, + seq_num: uint, +) + +; Authorize sequence number response +suit_authorize_seq_num_rsp = ( + 12, + ret: int, +) + + +; Check component compatibility request +suit_check_component_compatibility_req = ( + 13, + ; API changed for a more generic one, so both VID/CID as well as + ; component list validation may be implemented using this function. + manifest_class_id: bstr, + component_id: bstr, +) + +; Check component compatibility response +suit_check_component_compatibility_rsp = ( + 13, + ret: int, +) + +; Get supported manifest roles request +suit_get_supported_manifest_roles_req = ( + 18, +) + +; Get supported manifest roles response +suit_get_supported_manifest_roles_rsp = ( + 18, + ret: int, + roles: [ 0*20 int ] +) + +; Get supported manifest info based on manifest role request +suit_get_supported_manifest_info_req = ( + 19, + role: int, +) + +; Get supported manifest info based on manifest role response +suit_get_supported_manifest_info_rsp = ( + 19, + ret: int, + role: int, + vendor_id: bstr, + class_id: bstr, + downgrade_prevention_policy: int, + independent_updateability_policy: int, + signature_verification_policy: int, +) + +; Removed the API to get the parent manifest class ID. +; In current proposal, it is not sufficient to authorize one static manifest +; topology. + +; The static topology - which describes which manifests may be defined as +; dependency components can be verified through suit_plat_authorize_component_id + +; The dynamic topology (separate for update and boot scenarios) needs to be +; extended with the information about currently processed SUIT sequence. +; This data allows to use different policies for update and boot scenarios. +; The authorization should be a part of suit-directive-process-dependency, +; because that's the first moment, in which the dependent manifest contents +; (and the class ID) is known. + +; Authorize processing a dependency manifest request +suit_authorize_process_dependency_req = ( + 21, + ; Dependee (parent) manifest Class ID. + dependee_class_id: bstr, + ; Dependent (child) manifest Class ID. + dependent_class_id: bstr, + ; ID of executed SUIT sequence, with the suit-directive-process-dependency. + seq_id: int, +) + +; Authorize processing a dependency manifest response +suit_authorize_process_dependency_rsp = ( + 21, + ret: int, +) + + +; Missing image event notification message +suit_evt_sub_req = ( + 40, + subscribe: bool, ; True for subscribe, false for unsubscribe +) + +suit_evt_sub_rsp = ( + 40, + ret: int, +) + + +suit_missing_image_evt_nfy = ( + 41, + resource_id: bstr, + stream_session_id: uint, +) + + +suit_chunk_status_evt_nfy = ( + 42, + stream_session_id: uint, +) + + +; Image chunk enqueue request +suit_chunk_enqueue_req = ( + 43, + stream_session_id: uint, + chunk_id: uint, + offset: uint, + last_chunk: bool, + addr: uint, + size: uint, +) + +; Image chunk enqueue response +suit_chunk_enqueue_rsp = ( + 43, + ret: int, +) + + +; Image chunk info structure, represented as a list +suit_chunk_info_entry = ( + chunk_id: uint, + status: uint, ; 0-pending, 1-successfully processed, 2-refused +) + +suit_chunk_status_req = ( + 44, + stream_session_id: uint, +) + +suit_chunk_status_rsp = ( + 44, + ret: int, + chunk_info: [ 0*3 suit_chunk_info_entry], +) + + +suit_req = [ + ; Union of different requests + msg: ( + suit_trigger_update_req / + suit_check_installed_component_digest_req / + suit_get_installed_manifest_info_req / + suit_get_install_candidate_info_req / + + suit_authenticate_manifest_req / + suit_authorize_unsigned_manifest_req / + suit_authorize_seq_num_req / + suit_check_component_compatibility_req / + + suit_get_supported_manifest_roles_req / + suit_get_supported_manifest_info_req / + suit_authorize_process_dependency_req / + + suit_evt_sub_req / + suit_chunk_enqueue_req / + suit_chunk_status_req + ), +] + +suit_rsp = [ + ; Union of different responses + msg: ( + suit_trigger_update_rsp / + suit_check_installed_component_digest_rsp / + suit_get_installed_manifest_info_rsp / + suit_get_install_candidate_info_rsp / + + suit_authenticate_manifest_rsp / + suit_authorize_unsigned_manifest_rsp / + suit_authorize_seq_num_rsp / + suit_check_component_compatibility_rsp / + + suit_get_supported_manifest_roles_rsp / + suit_get_supported_manifest_info_rsp / + suit_authorize_process_dependency_rsp / + + suit_evt_sub_rsp / + suit_chunk_enqueue_rsp / + suit_chunk_status_rsp + ), +] + + +suit_nfy = [ + ; Union of different notifications + msg: ( + suit_missing_image_evt_nfy / + suit_chunk_status_evt_nfy + ), +] diff --git a/subsys/sdfw_services/services/suit_service/suit_service_utils.h b/subsys/sdfw_services/services/suit_service/suit_service_utils.h new file mode 100644 index 000000000000..059b69a4c9ef --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_service_utils.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_SERVICE_UTILS_H__ +#define SUIT_SERVICE_UTILS_H__ + +/** + * @brief Macro to generate SUIT SSF request choice field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * request structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_REQ_CHOICE(name) suit_req_msg_suit_##name##_req_m_c + +/** + * @brief Macro to generate SUIT SSF request field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * request structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_REQ(name) suit_req_msg_suit_##name##_req_m + +/** + * @brief Macro to generate SUIT SSF request argument field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * request structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_REQ_ARG(name, arg) suit_##name##_req_##arg + +/** + * @brief Macro to generate SUIT SSF response choice field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * response structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_RSP_CHOICE(name) suit_rsp_msg_suit_##name##_rsp_m_c + +/** + * @brief Macro to generate SUIT SSF response field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * response structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_RSP(name) suit_rsp_msg_suit_##name##_rsp_m + +/** + * @brief Macro to generate SUIT SSF response argument field name. + * + * @details It is expected to be used inside test vector definition, so filling an SSF + * response structure will fit within the maximum line length limits. + */ +#define SSF_SUIT_RSP_ARG(name, arg) suit_##name##_rsp_##arg + +#endif /* SUIT_SERVICE_UTILS_H__ */ diff --git a/subsys/sdfw_services/services/suit_service/suit_update.c b/subsys/sdfw_services/services/suit_service/suit_update.c new file mode 100644 index 000000000000..fdb7fb1624ed --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/suit_update.c @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include "suit_service_decode.h" +#include "suit_service_encode.h" +#include "suit_service_types.h" +#include "suit_service_utils.h" + +#include +#include + +#include +LOG_MODULE_REGISTER(suit_srvc_update, CONFIG_SSF_SUIT_SERVICE_LOG_LEVEL); + +extern const struct ssf_client_srvc suit_srvc; + +suit_ssf_err_t suit_trigger_update(suit_plat_mreg_t *regions, size_t len) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_trigger_update_req *req_data; + + if (regions == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (len == 0) { + return SUIT_PLAT_ERR_INVAL; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(trigger_update); + req_data = &req.SSF_SUIT_REQ(trigger_update); + const size_t cache_count = len - 1; + + /* The update candidate consists of two things: + * - The SUIT envelope, describing the update and boot process. + * - A list of payloads, that were fetched in addition to the envelope, + * as a result of payload-fetch SUIT manifest sequence execution. + * The payloads are passed as an array of SUIT cache structures. + */ + if (cache_count > ARRAY_SIZE(req_data->SSF_SUIT_REQ_ARG(trigger_update, + caches_suit_cache_info_entry_m))) { + return SUIT_PLAT_ERR_NOMEM; + } + + req_data->SSF_SUIT_REQ_ARG(trigger_update, addr) = (uintptr_t)regions[0].mem; + req_data->SSF_SUIT_REQ_ARG(trigger_update, size) = regions[0].size; + req_data->SSF_SUIT_REQ_ARG(trigger_update, caches_suit_cache_info_entry_m_count) = + cache_count; + struct suit_cache_info_entry *cache_entries = + (struct suit_cache_info_entry *)&req_data->SSF_SUIT_REQ_ARG( + trigger_update, caches_suit_cache_info_entry_m); + + for (size_t i = 0; i < cache_count; i++) { + /* Skip regions[0] as it contains the SUIT envelope. + * SUIT caches starts from index 1. + */ + cache_entries[i].suit_cache_info_entry_addr = (uintptr_t)regions[i + 1].mem; + cache_entries[i].suit_cache_info_entry_size = regions[i + 1].size; + } + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_PLAT_ERR_IPC; + } + + return rsp.SSF_SUIT_RSP(trigger_update).SSF_SUIT_RSP_ARG(trigger_update, ret); +} + +suit_ssf_err_t suit_check_installed_component_digest(suit_plat_mreg_t *component_id, int alg_id, + suit_plat_mreg_t *digest) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_check_installed_component_digest_req *req_data; + + if (component_id == NULL || digest == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(check_installed_component_digest); + req_data = &req.SSF_SUIT_REQ(check_installed_component_digest); + req_data->SSF_SUIT_REQ_ARG(check_installed_component_digest, component_id).value = + component_id->mem; + req_data->SSF_SUIT_REQ_ARG(check_installed_component_digest, component_id).len = + component_id->size; + req_data->SSF_SUIT_REQ_ARG(check_installed_component_digest, alg_id) = alg_id; + req_data->SSF_SUIT_REQ_ARG(check_installed_component_digest, digest).value = digest->mem; + req_data->SSF_SUIT_REQ_ARG(check_installed_component_digest, digest).len = digest->size; + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, NULL); + if (ret != 0) { + return SUIT_PLAT_ERR_IPC; + } + + return rsp.SSF_SUIT_RSP(check_installed_component_digest) + .SSF_SUIT_RSP_ARG(check_installed_component_digest, ret); +} + +suit_ssf_err_t suit_get_installed_manifest_info(suit_manifest_class_id_t *manifest_class_id, + unsigned int *seq_num, suit_semver_raw_t *version, + suit_digest_status_t *status, int *alg_id, + suit_plat_mreg_t *digest) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_get_installed_manifest_info_rsp *rsp_data; + const uint8_t *rsp_pkt; + struct suit_get_installed_manifest_info_req *req_data; + + if (seq_num == NULL || manifest_class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((digest != NULL) || (alg_id != NULL)) { + if (alg_id == NULL || digest == NULL || digest->mem == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(get_installed_manifest_info); + req_data = &req.SSF_SUIT_REQ(get_installed_manifest_info); + req_data->SSF_SUIT_REQ_ARG(get_installed_manifest_info, manifest_class_id).value = + (uint8_t *)manifest_class_id; + req_data->SSF_SUIT_REQ_ARG(get_installed_manifest_info, manifest_class_id).len = + sizeof(suit_manifest_class_id_t); + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, &rsp_pkt); + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(get_installed_manifest_info); + ret = rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, ret); + if (ret != SUIT_PLAT_SUCCESS) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + *seq_num = rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, seq_num); + + if (version != NULL) { + if (rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, semver_int_count) > + ARRAY_SIZE(version->raw)) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_SIZE; + } + + version->len = + rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, semver_int_count); + for (size_t i = 0; i < version->len; i++) { + version->raw[i] = rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, + semver_int)[i]; + } + } + + if (status != NULL) { + *status = (suit_digest_status_t)rsp_data->SSF_SUIT_RSP_ARG( + get_installed_manifest_info, digest_status); + } + + if ((alg_id != NULL) && (digest != NULL)) { + const size_t manifest_digest_len = + rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, digest).len; + if (manifest_digest_len > digest->size) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_NOMEM; + } + + *alg_id = rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, alg_id); + memcpy((uint8_t *)digest->mem, + rsp_data->SSF_SUIT_RSP_ARG(get_installed_manifest_info, digest).value, + manifest_digest_len); + digest->size = manifest_digest_len; + } + + ssf_client_decode_done(rsp_pkt); + return ret; +} + +suit_ssf_err_t suit_get_install_candidate_info(suit_manifest_class_id_t *manifest_class_id, + unsigned int *seq_num, suit_semver_raw_t *version, + int *alg_id, suit_plat_mreg_t *digest) +{ + int ret; + struct suit_req req; + struct suit_rsp rsp; + struct suit_get_install_candidate_info_rsp *rsp_data; + const uint8_t *rsp_pkt; + + if (seq_num == NULL || manifest_class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((digest != NULL) || (alg_id != NULL)) { + if (alg_id == NULL || digest == NULL || digest->mem == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + } + + memset(&req, 0, sizeof(struct suit_req)); + req.suit_req_msg_choice = SSF_SUIT_REQ_CHOICE(get_install_candidate_info); + + ret = ssf_client_send_request(&suit_srvc, &req, &rsp, &rsp_pkt); + if (ret != 0) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_IPC; + } + + rsp_data = &rsp.SSF_SUIT_RSP(get_install_candidate_info); + ret = rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, ret); + if (ret != SUIT_PLAT_SUCCESS) { + ssf_client_decode_done(rsp_pkt); + return ret; + } + + const size_t manifest_digest_len = + rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, digest).len; + *seq_num = rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, seq_num); + if (manifest_digest_len > digest->size) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_NOMEM; + } + + if (version != NULL) { + if (rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, semver_int_count) > + ARRAY_SIZE(version->raw)) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_SIZE; + } + + version->len = + rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, semver_int_count); + for (size_t i = 0; i < version->len; i++) { + version->raw[i] = rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, + semver_int)[i]; + } + } + + if ((alg_id != NULL) && (digest != NULL)) { + *alg_id = rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, alg_id), + memcpy((uint8_t *)digest->mem, + rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, digest).value, + manifest_digest_len); + digest->size = manifest_digest_len; + } + + const size_t manifest_class_id_len = + rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, manifest_class_id).len; + if (manifest_class_id_len != sizeof(suit_manifest_class_id_t)) { + ssf_client_decode_done(rsp_pkt); + return SUIT_PLAT_ERR_NOMEM; + } + + memcpy(manifest_class_id, + rsp_data->SSF_SUIT_RSP_ARG(get_install_candidate_info, manifest_class_id).value, + manifest_class_id_len); + + ssf_client_decode_done(rsp_pkt); + return ret; +} diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/suit_service/zcbor_generated/CMakeLists.txt new file mode 100644 index 000000000000..d5496cb83920 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + suit_service_decode.c + suit_service_encode.c +) + +zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c new file mode 100644 index 000000000000..759d65071ac1 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.c @@ -0,0 +1,1109 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "suit_service_decode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool decode_suit_missing_image_evt_nfy(zcbor_state_t *state, + struct suit_missing_image_evt_nfy *result); +static bool decode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + struct suit_chunk_status_evt_nfy *result); +static bool decode_suit_cache_info_entry(zcbor_state_t *state, + struct suit_cache_info_entry *result); +static bool decode_suit_trigger_update_req(zcbor_state_t *state, + struct suit_trigger_update_req *result); +static bool decode_suit_check_installed_component_digest_req( + zcbor_state_t *state, struct suit_check_installed_component_digest_req *result); +static bool +decode_suit_get_installed_manifest_info_req(zcbor_state_t *state, + struct suit_get_installed_manifest_info_req *result); +static bool decode_suit_authenticate_manifest_req(zcbor_state_t *state, + struct suit_authenticate_manifest_req *result); +static bool +decode_suit_authorize_unsigned_manifest_req(zcbor_state_t *state, + struct suit_authorize_unsigned_manifest_req *result); +static bool decode_suit_authorize_seq_num_req(zcbor_state_t *state, + struct suit_authorize_seq_num_req *result); +static bool decode_suit_check_component_compatibility_req( + zcbor_state_t *state, struct suit_check_component_compatibility_req *result); +static bool +decode_suit_get_supported_manifest_info_req(zcbor_state_t *state, + struct suit_get_supported_manifest_info_req *result); +static bool +decode_suit_authorize_process_dependency_req(zcbor_state_t *state, + struct suit_authorize_process_dependency_req *result); +static bool decode_suit_evt_sub_req(zcbor_state_t *state, struct suit_evt_sub_req *result); +static bool decode_suit_chunk_enqueue_req(zcbor_state_t *state, + struct suit_chunk_enqueue_req *result); +static bool decode_suit_chunk_status_req(zcbor_state_t *state, + struct suit_chunk_status_req *result); +static bool decode_suit_trigger_update_rsp(zcbor_state_t *state, + struct suit_trigger_update_rsp *result); +static bool decode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, struct suit_check_installed_component_digest_rsp *result); +static bool +decode_suit_get_installed_manifest_info_rsp(zcbor_state_t *state, + struct suit_get_installed_manifest_info_rsp *result); +static bool +decode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, + struct suit_get_install_candidate_info_rsp *result); +static bool decode_suit_authenticate_manifest_rsp(zcbor_state_t *state, + struct suit_authenticate_manifest_rsp *result); +static bool +decode_suit_authorize_unsigned_manifest_rsp(zcbor_state_t *state, + struct suit_authorize_unsigned_manifest_rsp *result); +static bool decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + struct suit_authorize_seq_num_rsp *result); +static bool decode_suit_check_component_compatibility_rsp( + zcbor_state_t *state, struct suit_check_component_compatibility_rsp *result); +static bool +decode_suit_get_supported_manifest_roles_rsp(zcbor_state_t *state, + struct suit_get_supported_manifest_roles_rsp *result); +static bool +decode_suit_get_supported_manifest_info_rsp(zcbor_state_t *state, + struct suit_get_supported_manifest_info_rsp *result); +static bool +decode_suit_authorize_process_dependency_rsp(zcbor_state_t *state, + struct suit_authorize_process_dependency_rsp *result); +static bool decode_suit_evt_sub_rsp(zcbor_state_t *state, struct suit_evt_sub_rsp *result); +static bool decode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + struct suit_chunk_enqueue_rsp *result); +static bool decode_suit_chunk_info_entry(zcbor_state_t *state, + struct suit_chunk_info_entry *result); +static bool decode_suit_chunk_status_rsp(zcbor_state_t *state, + struct suit_chunk_status_rsp *result); +static bool decode_suit_nfy(zcbor_state_t *state, struct suit_nfy *result); +static bool decode_suit_rsp(zcbor_state_t *state, struct suit_rsp *result); +static bool decode_suit_req(zcbor_state_t *state, struct suit_req *result); + +static bool decode_suit_missing_image_evt_nfy(zcbor_state_t *state, + struct suit_missing_image_evt_nfy *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (41)))) && + ((zcbor_bstr_decode(state, (&(*result).suit_missing_image_evt_nfy_resource_id)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_missing_image_evt_nfy_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + struct suit_chunk_status_evt_nfy *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (42)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_chunk_status_evt_nfy_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_cache_info_entry(zcbor_state_t *state, struct suit_cache_info_entry *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_decode(state, (&(*result).suit_cache_info_entry_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_cache_info_entry_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_trigger_update_req(zcbor_state_t *state, + struct suit_trigger_update_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (1)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_trigger_update_req_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_trigger_update_req_size)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 6, + &(*result).suit_trigger_update_req_caches_suit_cache_info_entry_m_count, + (zcbor_decoder_t *)decode_suit_cache_info_entry, state, + (&(*result).suit_trigger_update_req_caches_suit_cache_info_entry_m), + sizeof(struct suit_cache_info_entry))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_check_installed_component_digest_req( + zcbor_state_t *state, struct suit_check_installed_component_digest_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (2)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_check_installed_component_digest_req_component_id)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_check_installed_component_digest_req_alg_id)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_check_installed_component_digest_req_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_installed_manifest_info_req(zcbor_state_t *state, + struct suit_get_installed_manifest_info_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (3)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_get_installed_manifest_info_req_manifest_class_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_authenticate_manifest_req(zcbor_state_t *state, + struct suit_authenticate_manifest_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (10)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_authenticate_manifest_req_manifest_component_id)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_authenticate_manifest_req_alg_id)))) && + ((zcbor_bstr_decode(state, (&(*result).suit_authenticate_manifest_req_key_id)))) && + ((zcbor_bstr_decode(state, + (&(*result).suit_authenticate_manifest_req_signature)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_authenticate_manifest_req_data_addr)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_authenticate_manifest_req_data_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_authorize_unsigned_manifest_req(zcbor_state_t *state, + struct suit_authorize_unsigned_manifest_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (11)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_authorize_unsigned_manifest_req_manifest_component_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_authorize_seq_num_req(zcbor_state_t *state, + struct suit_authorize_seq_num_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (12)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_authorize_seq_num_req_manifest_component_id)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_authorize_seq_num_req_command_seq)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_authorize_seq_num_req_seq_num))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_check_component_compatibility_req(zcbor_state_t *state, + struct suit_check_component_compatibility_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (13)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_check_component_compatibility_req_manifest_class_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_check_component_compatibility_req_component_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_supported_manifest_info_req(zcbor_state_t *state, + struct suit_get_supported_manifest_info_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (19)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_supported_manifest_info_req_role))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_authorize_process_dependency_req(zcbor_state_t *state, + struct suit_authorize_process_dependency_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (21)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_authorize_process_dependency_req_dependee_class_id)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_authorize_process_dependency_req_dependent_class_id)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authorize_process_dependency_req_seq_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_evt_sub_req(zcbor_state_t *state, struct suit_evt_sub_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (40)))) && + ((zcbor_bool_decode(state, (&(*result).suit_evt_sub_req_subscribe))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_enqueue_req(zcbor_state_t *state, + struct suit_chunk_enqueue_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (43)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_chunk_enqueue_req_stream_session_id)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_chunk_id)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_offset)))) && + ((zcbor_bool_decode(state, (&(*result).suit_chunk_enqueue_req_last_chunk)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_addr)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_chunk_enqueue_req_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_status_req(zcbor_state_t *state, struct suit_chunk_status_req *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (44)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_chunk_status_req_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_trigger_update_rsp(zcbor_state_t *state, + struct suit_trigger_update_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (1)))) && + ((zcbor_int32_decode(state, (&(*result).suit_trigger_update_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, struct suit_check_installed_component_digest_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (2)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_check_installed_component_digest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_installed_manifest_info_rsp(zcbor_state_t *state, + struct suit_get_installed_manifest_info_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (3)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_installed_manifest_info_rsp_ret)))) && + ((zcbor_uint32_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_seq_num)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 5, &(*result).suit_get_installed_manifest_info_rsp_semver_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (&(*result).suit_get_installed_manifest_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state))) && + ((zcbor_int32_decode( + state, (&(*result).suit_get_installed_manifest_info_rsp_digest_status)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_installed_manifest_info_rsp_alg_id)))) && + ((zcbor_bstr_decode(state, + (&(*result).suit_get_installed_manifest_info_rsp_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, + struct suit_get_install_candidate_info_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (4)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_install_candidate_info_rsp_ret)))) && + ((zcbor_bstr_decode( + state, + (&(*result).suit_get_install_candidate_info_rsp_manifest_class_id)))) && + ((zcbor_uint32_decode(state, + (&(*result).suit_get_install_candidate_info_rsp_seq_num)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 5, &(*result).suit_get_install_candidate_info_rsp_semver_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (&(*result).suit_get_install_candidate_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_install_candidate_info_rsp_alg_id)))) && + ((zcbor_bstr_decode(state, + (&(*result).suit_get_install_candidate_info_rsp_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_authenticate_manifest_rsp(zcbor_state_t *state, + struct suit_authenticate_manifest_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (10)))) && + ((zcbor_int32_decode(state, (&(*result).suit_authenticate_manifest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_authorize_unsigned_manifest_rsp(zcbor_state_t *state, + struct suit_authorize_unsigned_manifest_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (11)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_authorize_unsigned_manifest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + struct suit_authorize_seq_num_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (12)))) && + ((zcbor_int32_decode(state, (&(*result).suit_authorize_seq_num_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_check_component_compatibility_rsp(zcbor_state_t *state, + struct suit_check_component_compatibility_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (13)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_check_component_compatibility_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_supported_manifest_roles_rsp(zcbor_state_t *state, + struct suit_get_supported_manifest_roles_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_expect(state, (18)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_supported_manifest_roles_rsp_ret)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 20, &(*result).suit_get_supported_manifest_roles_rsp_roles_int_count, + (zcbor_decoder_t *)zcbor_int32_decode, state, + (&(*result).suit_get_supported_manifest_roles_rsp_roles_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_get_supported_manifest_info_rsp(zcbor_state_t *state, + struct suit_get_supported_manifest_info_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (19)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_supported_manifest_info_rsp_ret)))) && + ((zcbor_int32_decode(state, + (&(*result).suit_get_supported_manifest_info_rsp_role)))) && + ((zcbor_bstr_decode( + state, (&(*result).suit_get_supported_manifest_info_rsp_vendor_id)))) && + ((zcbor_bstr_decode(state, + (&(*result).suit_get_supported_manifest_info_rsp_class_id)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && + ((zcbor_int32_decode( + state, + (&(*result) + .suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +decode_suit_authorize_process_dependency_rsp(zcbor_state_t *state, + struct suit_authorize_process_dependency_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (21)))) && + ((zcbor_int32_decode( + state, (&(*result).suit_authorize_process_dependency_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_evt_sub_rsp(zcbor_state_t *state, struct suit_evt_sub_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((((zcbor_uint32_expect(state, (40)))) && + ((zcbor_int32_decode(state, (&(*result).suit_evt_sub_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + struct suit_chunk_enqueue_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_expect(state, (43)))) && + ((zcbor_int32_decode(state, (&(*result).suit_chunk_enqueue_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_info_entry(zcbor_state_t *state, struct suit_chunk_info_entry *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_decode(state, (&(*result).suit_chunk_info_entry_chunk_id)))) && + ((zcbor_uint32_decode(state, (&(*result).suit_chunk_info_entry_status))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_chunk_status_rsp(zcbor_state_t *state, struct suit_chunk_status_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_expect(state, (44)))) && + ((zcbor_int32_decode(state, (&(*result).suit_chunk_status_rsp_ret)))) && + ((zcbor_list_start_decode(state) && + ((zcbor_multi_decode( + 0, 3, + &(*result).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, + (zcbor_decoder_t *)decode_suit_chunk_info_entry, state, + (&(*result).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), + sizeof(struct suit_chunk_info_entry))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_nfy(zcbor_state_t *state, struct suit_nfy *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = (( + (zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_suit_missing_image_evt_nfy( + state, + (&(*result).suit_nfy_msg_suit_missing_image_evt_nfy_m)))) && + (((*result).suit_nfy_msg_choice = + suit_nfy_msg_suit_missing_image_evt_nfy_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_evt_nfy( + state, + (&(*result).suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) && + (((*result).suit_nfy_msg_choice = + suit_nfy_msg_suit_chunk_status_evt_nfy_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_rsp(zcbor_state_t *state, struct suit_rsp *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_suit_trigger_update_rsp( + state, + (&(*result).suit_rsp_msg_suit_trigger_update_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_trigger_update_rsp_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_installed_component_digest_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_installed_manifest_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_install_candidate_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authenticate_manifest_rsp( + state, + (&(*result).suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_unsigned_manifest_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_seq_num_rsp( + state, + (&(*result).suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_component_compatibility_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_check_component_compatibility_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_supported_manifest_roles_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_supported_manifest_info_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_process_dependency_rsp( + state, + (&(*result) + .suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_evt_sub_rsp( + state, (&(*result).suit_rsp_msg_suit_evt_sub_rsp_m)))) && + (((*result).suit_rsp_msg_choice = suit_rsp_msg_suit_evt_sub_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_enqueue_rsp( + state, (&(*result).suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_chunk_enqueue_rsp_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_rsp( + state, (&(*result).suit_rsp_msg_suit_chunk_status_rsp_m)))) && + (((*result).suit_rsp_msg_choice = + suit_rsp_msg_suit_chunk_status_rsp_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool decode_suit_req(zcbor_state_t *state, struct suit_req *result) +{ + zcbor_log("%s\r\n", __func__); + bool int_res; + + bool tmp_result = ((( + zcbor_list_start_decode(state) && + ((((zcbor_union_start_code(state) && + (int_res = + ((((decode_suit_trigger_update_req( + state, + (&(*result).suit_req_msg_suit_trigger_update_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_trigger_update_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_installed_component_digest_req( + state, + (&(*result) + .suit_req_msg_suit_check_installed_component_digest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_check_installed_component_digest_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_installed_manifest_info_req( + state, + (&(*result) + .suit_req_msg_suit_get_installed_manifest_info_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_installed_manifest_info_req_m_c), + true))) || + (((zcbor_uint32_expect_union(state, (4)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_install_candidate_info_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_authenticate_manifest_req( + state, + (&(*result).suit_req_msg_suit_authenticate_manifest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authenticate_manifest_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_unsigned_manifest_req( + state, + (&(*result) + .suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_seq_num_req( + state, + (&(*result).suit_req_msg_suit_authorize_seq_num_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_seq_num_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_check_component_compatibility_req( + state, + (&(*result) + .suit_req_msg_suit_check_component_compatibility_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_check_component_compatibility_req_m_c), + true))) || + (((zcbor_uint32_expect_union(state, (18)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_supported_manifest_roles_req_m_c), + true)) || + (zcbor_union_elem_code(state) && + (((decode_suit_get_supported_manifest_info_req( + state, + (&(*result) + .suit_req_msg_suit_get_supported_manifest_info_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_get_supported_manifest_info_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_authorize_process_dependency_req( + state, + (&(*result) + .suit_req_msg_suit_authorize_process_dependency_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_authorize_process_dependency_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_evt_sub_req( + state, (&(*result).suit_req_msg_suit_evt_sub_req_m)))) && + (((*result).suit_req_msg_choice = suit_req_msg_suit_evt_sub_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_enqueue_req( + state, (&(*result).suit_req_msg_suit_chunk_enqueue_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_chunk_enqueue_req_m_c), + true))) || + (zcbor_union_elem_code(state) && + (((decode_suit_chunk_status_req( + state, (&(*result).suit_req_msg_suit_chunk_status_req_m)))) && + (((*result).suit_req_msg_choice = + suit_req_msg_suit_chunk_status_req_m_c), + true)))), + zcbor_union_end_code(state), int_res)))) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_decode_suit_req(const uint8_t *payload, size_t payload_len, struct suit_req *result, + size_t *payload_len_out) +{ + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_suit_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, struct suit_rsp *result, + size_t *payload_len_out) +{ + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_suit_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, struct suit_nfy *result, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, + (zcbor_decoder_t *)decode_suit_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h new file mode 100644 index 000000000000..b997a4b31857 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_decode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SUIT_SERVICE_DECODE_H__ +#define SUIT_SERVICE_DECODE_H__ + +#include +#include +#include +#include +#include "suit_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_decode_suit_req(const uint8_t *payload, size_t payload_len, struct suit_req *result, + size_t *payload_len_out); + +int cbor_decode_suit_rsp(const uint8_t *payload, size_t payload_len, struct suit_rsp *result, + size_t *payload_len_out); + +int cbor_decode_suit_nfy(const uint8_t *payload, size_t payload_len, struct suit_nfy *result, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c new file mode 100644 index 000000000000..9aba74cb7adc --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.c @@ -0,0 +1,1015 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include "suit_service_encode.h" +#include "zcbor_print.h" + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +static bool encode_suit_missing_image_evt_nfy(zcbor_state_t *state, + const struct suit_missing_image_evt_nfy *input); +static bool encode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + const struct suit_chunk_status_evt_nfy *input); +static bool encode_suit_cache_info_entry(zcbor_state_t *state, + const struct suit_cache_info_entry *input); +static bool encode_suit_trigger_update_req(zcbor_state_t *state, + const struct suit_trigger_update_req *input); +static bool encode_suit_check_installed_component_digest_req( + zcbor_state_t *state, const struct suit_check_installed_component_digest_req *input); +static bool encode_suit_get_installed_manifest_info_req( + zcbor_state_t *state, const struct suit_get_installed_manifest_info_req *input); +static bool +encode_suit_authenticate_manifest_req(zcbor_state_t *state, + const struct suit_authenticate_manifest_req *input); +static bool encode_suit_authorize_unsigned_manifest_req( + zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_req *input); +static bool encode_suit_authorize_seq_num_req(zcbor_state_t *state, + const struct suit_authorize_seq_num_req *input); +static bool encode_suit_check_component_compatibility_req( + zcbor_state_t *state, const struct suit_check_component_compatibility_req *input); +static bool encode_suit_get_supported_manifest_info_req( + zcbor_state_t *state, const struct suit_get_supported_manifest_info_req *input); +static bool encode_suit_authorize_process_dependency_req( + zcbor_state_t *state, const struct suit_authorize_process_dependency_req *input); +static bool encode_suit_evt_sub_req(zcbor_state_t *state, const struct suit_evt_sub_req *input); +static bool encode_suit_chunk_enqueue_req(zcbor_state_t *state, + const struct suit_chunk_enqueue_req *input); +static bool encode_suit_chunk_status_req(zcbor_state_t *state, + const struct suit_chunk_status_req *input); +static bool encode_suit_trigger_update_rsp(zcbor_state_t *state, + const struct suit_trigger_update_rsp *input); +static bool encode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, const struct suit_check_installed_component_digest_rsp *input); +static bool encode_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, const struct suit_get_installed_manifest_info_rsp *input); +static bool +encode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, + const struct suit_get_install_candidate_info_rsp *input); +static bool +encode_suit_authenticate_manifest_rsp(zcbor_state_t *state, + const struct suit_authenticate_manifest_rsp *input); +static bool encode_suit_authorize_unsigned_manifest_rsp( + zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_rsp *input); +static bool encode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + const struct suit_authorize_seq_num_rsp *input); +static bool encode_suit_check_component_compatibility_rsp( + zcbor_state_t *state, const struct suit_check_component_compatibility_rsp *input); +static bool encode_suit_get_supported_manifest_roles_rsp( + zcbor_state_t *state, const struct suit_get_supported_manifest_roles_rsp *input); +static bool encode_suit_get_supported_manifest_info_rsp( + zcbor_state_t *state, const struct suit_get_supported_manifest_info_rsp *input); +static bool encode_suit_authorize_process_dependency_rsp( + zcbor_state_t *state, const struct suit_authorize_process_dependency_rsp *input); +static bool encode_suit_evt_sub_rsp(zcbor_state_t *state, const struct suit_evt_sub_rsp *input); +static bool encode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + const struct suit_chunk_enqueue_rsp *input); +static bool encode_suit_chunk_info_entry(zcbor_state_t *state, + const struct suit_chunk_info_entry *input); +static bool encode_suit_chunk_status_rsp(zcbor_state_t *state, + const struct suit_chunk_status_rsp *input); +static bool encode_suit_nfy(zcbor_state_t *state, const struct suit_nfy *input); +static bool encode_suit_rsp(zcbor_state_t *state, const struct suit_rsp *input); +static bool encode_suit_req(zcbor_state_t *state, const struct suit_req *input); + +static bool encode_suit_missing_image_evt_nfy(zcbor_state_t *state, + const struct suit_missing_image_evt_nfy *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_put(state, (41)))) && + ((zcbor_bstr_encode(state, (&(*input).suit_missing_image_evt_nfy_resource_id)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_missing_image_evt_nfy_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_status_evt_nfy(zcbor_state_t *state, + const struct suit_chunk_status_evt_nfy *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (42)))) && + ((zcbor_uint32_encode( + state, (&(*input).suit_chunk_status_evt_nfy_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_cache_info_entry(zcbor_state_t *state, + const struct suit_cache_info_entry *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_cache_info_entry_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_trigger_update_req(zcbor_state_t *state, + const struct suit_trigger_update_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_put(state, (1)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_trigger_update_req_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_trigger_update_req_size)))) && + ((zcbor_list_start_encode(state, 12) && + ((zcbor_multi_encode_minmax( + 0, 6, + &(*input).suit_trigger_update_req_caches_suit_cache_info_entry_m_count, + (zcbor_encoder_t *)encode_suit_cache_info_entry, state, + (&(*input).suit_trigger_update_req_caches_suit_cache_info_entry_m), + sizeof(struct suit_cache_info_entry))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 12)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_check_installed_component_digest_req( + zcbor_state_t *state, const struct suit_check_installed_component_digest_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_put(state, (2)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_check_installed_component_digest_req_component_id)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_check_installed_component_digest_req_alg_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_check_installed_component_digest_req_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_get_installed_manifest_info_req( + zcbor_state_t *state, const struct suit_get_installed_manifest_info_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (3)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_get_installed_manifest_info_req_manifest_class_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +encode_suit_authenticate_manifest_req(zcbor_state_t *state, + const struct suit_authenticate_manifest_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (10)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_authenticate_manifest_req_manifest_component_id)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_authenticate_manifest_req_alg_id)))) && + ((zcbor_bstr_encode(state, (&(*input).suit_authenticate_manifest_req_key_id)))) && + ((zcbor_bstr_encode(state, (&(*input).suit_authenticate_manifest_req_signature)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_authenticate_manifest_req_data_addr)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_authenticate_manifest_req_data_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_unsigned_manifest_req( + zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (11)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_authorize_unsigned_manifest_req_manifest_component_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_seq_num_req(zcbor_state_t *state, + const struct suit_authorize_seq_num_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (12)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_authorize_seq_num_req_manifest_component_id)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_authorize_seq_num_req_command_seq)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_authorize_seq_num_req_seq_num))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_check_component_compatibility_req( + zcbor_state_t *state, const struct suit_check_component_compatibility_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (13)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_check_component_compatibility_req_manifest_class_id)))) && + ((zcbor_bstr_encode( + state, (&(*input).suit_check_component_compatibility_req_component_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_get_supported_manifest_info_req( + zcbor_state_t *state, const struct suit_get_supported_manifest_info_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (19)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_supported_manifest_info_req_role))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_process_dependency_req( + zcbor_state_t *state, const struct suit_authorize_process_dependency_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (21)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_authorize_process_dependency_req_dependee_class_id)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_authorize_process_dependency_req_dependent_class_id)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_authorize_process_dependency_req_seq_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_evt_sub_req(zcbor_state_t *state, const struct suit_evt_sub_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (40)))) && + ((zcbor_bool_encode(state, (&(*input).suit_evt_sub_req_subscribe))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_enqueue_req(zcbor_state_t *state, + const struct suit_chunk_enqueue_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (43)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_chunk_enqueue_req_stream_session_id)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_chunk_id)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_offset)))) && + ((zcbor_bool_encode(state, (&(*input).suit_chunk_enqueue_req_last_chunk)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_addr)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_enqueue_req_size))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_status_req(zcbor_state_t *state, + const struct suit_chunk_status_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (44)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_chunk_status_req_stream_session_id))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_trigger_update_rsp(zcbor_state_t *state, + const struct suit_trigger_update_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (1)))) && + ((zcbor_int32_encode(state, (&(*input).suit_trigger_update_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_check_installed_component_digest_rsp( + zcbor_state_t *state, const struct suit_check_installed_component_digest_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (2)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_check_installed_component_digest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_get_installed_manifest_info_rsp( + zcbor_state_t *state, const struct suit_get_installed_manifest_info_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (3)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_installed_manifest_info_rsp_ret)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_get_installed_manifest_info_rsp_seq_num)))) && + ((zcbor_list_start_encode(state, 5) && + ((zcbor_multi_encode_minmax( + 0, 5, &(*input).suit_get_installed_manifest_info_rsp_semver_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (&(*input).suit_get_installed_manifest_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5))) && + ((zcbor_int32_encode( + state, (&(*input).suit_get_installed_manifest_info_rsp_digest_status)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_installed_manifest_info_rsp_alg_id)))) && + ((zcbor_bstr_encode(state, + (&(*input).suit_get_installed_manifest_info_rsp_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +encode_suit_get_install_candidate_info_rsp(zcbor_state_t *state, + const struct suit_get_install_candidate_info_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (4)))) && + ((zcbor_int32_encode(state, (&(*input).suit_get_install_candidate_info_rsp_ret)))) && + ((zcbor_bstr_encode( + state, + (&(*input).suit_get_install_candidate_info_rsp_manifest_class_id)))) && + ((zcbor_uint32_encode(state, + (&(*input).suit_get_install_candidate_info_rsp_seq_num)))) && + ((zcbor_list_start_encode(state, 5) && + ((zcbor_multi_encode_minmax( + 0, 5, &(*input).suit_get_install_candidate_info_rsp_semver_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (&(*input).suit_get_install_candidate_info_rsp_semver_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 5))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_install_candidate_info_rsp_alg_id)))) && + ((zcbor_bstr_encode(state, + (&(*input).suit_get_install_candidate_info_rsp_digest))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool +encode_suit_authenticate_manifest_rsp(zcbor_state_t *state, + const struct suit_authenticate_manifest_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (10)))) && + ((zcbor_int32_encode(state, (&(*input).suit_authenticate_manifest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_unsigned_manifest_rsp( + zcbor_state_t *state, const struct suit_authorize_unsigned_manifest_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (11)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_authorize_unsigned_manifest_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_seq_num_rsp(zcbor_state_t *state, + const struct suit_authorize_seq_num_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (12)))) && + ((zcbor_int32_encode(state, (&(*input).suit_authorize_seq_num_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_check_component_compatibility_rsp( + zcbor_state_t *state, const struct suit_check_component_compatibility_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (13)))) && + ((zcbor_int32_encode( + state, (&(*input).suit_check_component_compatibility_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_get_supported_manifest_roles_rsp( + zcbor_state_t *state, const struct suit_get_supported_manifest_roles_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (( + (((zcbor_uint32_put(state, (18)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_supported_manifest_roles_rsp_ret)))) && + ((zcbor_list_start_encode(state, 20) && + ((zcbor_multi_encode_minmax( + 0, 20, &(*input).suit_get_supported_manifest_roles_rsp_roles_int_count, + (zcbor_encoder_t *)zcbor_int32_encode, state, + (&(*input).suit_get_supported_manifest_roles_rsp_roles_int), + sizeof(int32_t))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 20)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_get_supported_manifest_info_rsp( + zcbor_state_t *state, const struct suit_get_supported_manifest_info_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (19)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_supported_manifest_info_rsp_ret)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_get_supported_manifest_info_rsp_role)))) && + ((zcbor_bstr_encode(state, + (&(*input).suit_get_supported_manifest_info_rsp_vendor_id)))) && + ((zcbor_bstr_encode(state, + (&(*input).suit_get_supported_manifest_info_rsp_class_id)))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_get_supported_manifest_info_rsp_downgrade_prevention_policy)))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_get_supported_manifest_info_rsp_independent_updateability_policy)))) && + ((zcbor_int32_encode( + state, + (&(*input).suit_get_supported_manifest_info_rsp_signature_verification_policy))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_authorize_process_dependency_rsp( + zcbor_state_t *state, const struct suit_authorize_process_dependency_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (21)))) && + ((zcbor_int32_encode(state, + (&(*input).suit_authorize_process_dependency_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_evt_sub_rsp(zcbor_state_t *state, const struct suit_evt_sub_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = (((((zcbor_uint32_put(state, (40)))) && + ((zcbor_int32_encode(state, (&(*input).suit_evt_sub_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_enqueue_rsp(zcbor_state_t *state, + const struct suit_chunk_enqueue_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_put(state, (43)))) && + ((zcbor_int32_encode(state, (&(*input).suit_chunk_enqueue_rsp_ret))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_info_entry(zcbor_state_t *state, + const struct suit_chunk_info_entry *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = + (((((zcbor_uint32_encode(state, (&(*input).suit_chunk_info_entry_chunk_id)))) && + ((zcbor_uint32_encode(state, (&(*input).suit_chunk_info_entry_status))))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_chunk_status_rsp(zcbor_state_t *state, + const struct suit_chunk_status_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + ((zcbor_uint32_put(state, (44)))) && + ((zcbor_int32_encode(state, (&(*input).suit_chunk_status_rsp_ret)))) && + ((zcbor_list_start_encode(state, 6) && + ((zcbor_multi_encode_minmax( + 0, 3, + &(*input).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count, + (zcbor_encoder_t *)encode_suit_chunk_info_entry, state, + (&(*input).suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m), + sizeof(struct suit_chunk_info_entry))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 6)))))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_nfy(zcbor_state_t *state, const struct suit_nfy *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 3) && + ((((((*input).suit_nfy_msg_choice == suit_nfy_msg_suit_missing_image_evt_nfy_m_c) ? + ((encode_suit_missing_image_evt_nfy( + state, (&(*input).suit_nfy_msg_suit_missing_image_evt_nfy_m)))) : + (((*input).suit_nfy_msg_choice == + suit_nfy_msg_suit_chunk_status_evt_nfy_m_c) ? + ((encode_suit_chunk_status_evt_nfy( + state, + (&(*input).suit_nfy_msg_suit_chunk_status_evt_nfy_m)))) : + false)))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 3)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_rsp(zcbor_state_t *state, const struct suit_rsp *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 8) && + ((((((*input).suit_rsp_msg_choice == suit_rsp_msg_suit_trigger_update_rsp_m_c) ? + ((encode_suit_trigger_update_rsp( + state, (&(*input).suit_rsp_msg_suit_trigger_update_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c) ? + ((encode_suit_check_installed_component_digest_rsp( + state, + (&(*input).suit_rsp_msg_suit_check_installed_component_digest_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c) ? + ((encode_suit_get_installed_manifest_info_rsp( + state, + (&(*input).suit_rsp_msg_suit_get_installed_manifest_info_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c) ? + ((encode_suit_get_install_candidate_info_rsp( + state, + (&(*input).suit_rsp_msg_suit_get_install_candidate_info_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c) ? + ((encode_suit_authenticate_manifest_rsp( + state, + (&(*input).suit_rsp_msg_suit_authenticate_manifest_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c) ? + ((encode_suit_authorize_unsigned_manifest_rsp( + state, + (&(*input).suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c) ? + ((encode_suit_authorize_seq_num_rsp( + state, + (&(*input).suit_rsp_msg_suit_authorize_seq_num_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_check_component_compatibility_rsp_m_c) ? + ((encode_suit_check_component_compatibility_rsp( + state, + (&(*input).suit_rsp_msg_suit_check_component_compatibility_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c) ? + ((encode_suit_get_supported_manifest_roles_rsp( + state, + (&(*input).suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c) ? + ((encode_suit_get_supported_manifest_info_rsp( + state, + (&(*input).suit_rsp_msg_suit_get_supported_manifest_info_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c) ? + ((encode_suit_authorize_process_dependency_rsp( + state, + (&(*input).suit_rsp_msg_suit_authorize_process_dependency_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_evt_sub_rsp_m_c) ? + ((encode_suit_evt_sub_rsp( + state, + (&(*input).suit_rsp_msg_suit_evt_sub_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_chunk_enqueue_rsp_m_c) ? + ((encode_suit_chunk_enqueue_rsp( + state, + (&(*input).suit_rsp_msg_suit_chunk_enqueue_rsp_m)))) : + (((*input).suit_rsp_msg_choice == + suit_rsp_msg_suit_chunk_status_rsp_m_c) ? + ((encode_suit_chunk_status_rsp( + state, + (&(*input).suit_rsp_msg_suit_chunk_status_rsp_m)))) : + false)))))))))))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 8)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +static bool encode_suit_req(zcbor_state_t *state, const struct suit_req *input) +{ + zcbor_log("%s\r\n", __func__); + + bool tmp_result = ((( + zcbor_list_start_encode(state, 7) && + ((((((*input).suit_req_msg_choice == suit_req_msg_suit_trigger_update_req_m_c) ? + ((encode_suit_trigger_update_req( + state, (&(*input).suit_req_msg_suit_trigger_update_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_check_installed_component_digest_req_m_c) ? + ((encode_suit_check_installed_component_digest_req( + state, + (&(*input).suit_req_msg_suit_check_installed_component_digest_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_installed_manifest_info_req_m_c) ? + ((encode_suit_get_installed_manifest_info_req( + state, + (&(*input).suit_req_msg_suit_get_installed_manifest_info_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_install_candidate_info_req_m_c) ? + ((zcbor_uint32_put(state, (4)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_authenticate_manifest_req_m_c) ? + ((encode_suit_authenticate_manifest_req( + state, + (&(*input).suit_req_msg_suit_authenticate_manifest_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c) ? + ((encode_suit_authorize_unsigned_manifest_req( + state, + (&(*input).suit_req_msg_suit_authorize_unsigned_manifest_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_authorize_seq_num_req_m_c) ? + ((encode_suit_authorize_seq_num_req( + state, + (&(*input).suit_req_msg_suit_authorize_seq_num_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_check_component_compatibility_req_m_c) ? + ((encode_suit_check_component_compatibility_req( + state, + (&(*input).suit_req_msg_suit_check_component_compatibility_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_supported_manifest_roles_req_m_c) ? + ((zcbor_uint32_put( + state, + (18)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_get_supported_manifest_info_req_m_c) ? + ((encode_suit_get_supported_manifest_info_req( + state, + (&(*input).suit_req_msg_suit_get_supported_manifest_info_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_authorize_process_dependency_req_m_c) ? + ((encode_suit_authorize_process_dependency_req( + state, + (&(*input).suit_req_msg_suit_authorize_process_dependency_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_evt_sub_req_m_c) ? + ((encode_suit_evt_sub_req( + state, + (&(*input).suit_req_msg_suit_evt_sub_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_chunk_enqueue_req_m_c) ? + ((encode_suit_chunk_enqueue_req( + state, + (&(*input).suit_req_msg_suit_chunk_enqueue_req_m)))) : + (((*input).suit_req_msg_choice == + suit_req_msg_suit_chunk_status_req_m_c) ? + ((encode_suit_chunk_status_req( + state, + (&(*input).suit_req_msg_suit_chunk_status_req_m)))) : + false)))))))))))))))) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 7)))); + + if (!tmp_result) { + zcbor_trace_file(state); + zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); + } else { + zcbor_log("%s success\r\n", __func__); + } + + return tmp_result; +} + +int cbor_encode_suit_req(uint8_t *payload, size_t payload_len, const struct suit_req *input, + size_t *payload_len_out) +{ + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_suit_req, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, const struct suit_rsp *input, + size_t *payload_len_out) +{ + zcbor_state_t states[5]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_suit_rsp, + sizeof(states) / sizeof(zcbor_state_t), 1); +} + +int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, const struct suit_nfy *input, + size_t *payload_len_out) +{ + zcbor_state_t states[4]; + + return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, + (zcbor_decoder_t *)encode_suit_nfy, + sizeof(states) / sizeof(zcbor_state_t), 1); +} diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h new file mode 100644 index 000000000000..2a7fbee1c648 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_encode.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SUIT_SERVICE_ENCODE_H__ +#define SUIT_SERVICE_ENCODE_H__ + +#include +#include +#include +#include +#include "suit_service_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEFAULT_MAX_QTY != 3 +#error "The type file was generated with a different default_max_qty than this file" +#endif + +int cbor_encode_suit_req(uint8_t *payload, size_t payload_len, const struct suit_req *input, + size_t *payload_len_out); + +int cbor_encode_suit_rsp(uint8_t *payload, size_t payload_len, const struct suit_rsp *input, + size_t *payload_len_out); + +int cbor_encode_suit_nfy(uint8_t *payload, size_t payload_len, const struct suit_nfy *input, + size_t *payload_len_out); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h new file mode 100644 index 000000000000..acd90121b9c0 --- /dev/null +++ b/subsys/sdfw_services/services/suit_service/zcbor_generated/suit_service_types.h @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* + * Generated using zcbor version 0.8.1 + * https://github.com/NordicSemiconductor/zcbor + * Generated with a --default-max-qty of 3 + */ + +#ifndef SUIT_SERVICE_TYPES_H__ +#define SUIT_SERVICE_TYPES_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Which value for --default-max-qty this file was created with. + * + * The define is used in the other generated file to do a build-time + * compatibility check. + * + * See `zcbor --help` for more information about --default-max-qty + */ +#define DEFAULT_MAX_QTY 3 + +struct suit_missing_image_evt_nfy { + struct zcbor_string suit_missing_image_evt_nfy_resource_id; + uint32_t suit_missing_image_evt_nfy_stream_session_id; +}; + +struct suit_chunk_status_evt_nfy { + uint32_t suit_chunk_status_evt_nfy_stream_session_id; +}; + +struct suit_nfy { + union { + struct suit_missing_image_evt_nfy suit_nfy_msg_suit_missing_image_evt_nfy_m; + struct suit_chunk_status_evt_nfy suit_nfy_msg_suit_chunk_status_evt_nfy_m; + }; + enum { + suit_nfy_msg_suit_missing_image_evt_nfy_m_c, + suit_nfy_msg_suit_chunk_status_evt_nfy_m_c, + } suit_nfy_msg_choice; +}; + +struct suit_cache_info_entry { + uint32_t suit_cache_info_entry_addr; + uint32_t suit_cache_info_entry_size; +}; + +struct suit_trigger_update_req { + uint32_t suit_trigger_update_req_addr; + uint32_t suit_trigger_update_req_size; + struct suit_cache_info_entry suit_trigger_update_req_caches_suit_cache_info_entry_m[6]; + size_t suit_trigger_update_req_caches_suit_cache_info_entry_m_count; +}; + +struct suit_check_installed_component_digest_req { + struct zcbor_string suit_check_installed_component_digest_req_component_id; + int32_t suit_check_installed_component_digest_req_alg_id; + struct zcbor_string suit_check_installed_component_digest_req_digest; +}; + +struct suit_get_installed_manifest_info_req { + struct zcbor_string suit_get_installed_manifest_info_req_manifest_class_id; +}; + +struct suit_authenticate_manifest_req { + struct zcbor_string suit_authenticate_manifest_req_manifest_component_id; + uint32_t suit_authenticate_manifest_req_alg_id; + struct zcbor_string suit_authenticate_manifest_req_key_id; + struct zcbor_string suit_authenticate_manifest_req_signature; + uint32_t suit_authenticate_manifest_req_data_addr; + uint32_t suit_authenticate_manifest_req_data_size; +}; + +struct suit_authorize_unsigned_manifest_req { + struct zcbor_string suit_authorize_unsigned_manifest_req_manifest_component_id; +}; + +struct suit_authorize_seq_num_req { + struct zcbor_string suit_authorize_seq_num_req_manifest_component_id; + uint32_t suit_authorize_seq_num_req_command_seq; + uint32_t suit_authorize_seq_num_req_seq_num; +}; + +struct suit_check_component_compatibility_req { + struct zcbor_string suit_check_component_compatibility_req_manifest_class_id; + struct zcbor_string suit_check_component_compatibility_req_component_id; +}; + +struct suit_get_supported_manifest_info_req { + int32_t suit_get_supported_manifest_info_req_role; +}; + +struct suit_authorize_process_dependency_req { + struct zcbor_string suit_authorize_process_dependency_req_dependee_class_id; + struct zcbor_string suit_authorize_process_dependency_req_dependent_class_id; + int32_t suit_authorize_process_dependency_req_seq_id; +}; + +struct suit_evt_sub_req { + bool suit_evt_sub_req_subscribe; +}; + +struct suit_chunk_enqueue_req { + uint32_t suit_chunk_enqueue_req_stream_session_id; + uint32_t suit_chunk_enqueue_req_chunk_id; + uint32_t suit_chunk_enqueue_req_offset; + bool suit_chunk_enqueue_req_last_chunk; + uint32_t suit_chunk_enqueue_req_addr; + uint32_t suit_chunk_enqueue_req_size; +}; + +struct suit_chunk_status_req { + uint32_t suit_chunk_status_req_stream_session_id; +}; + +struct suit_req { + union { + struct suit_trigger_update_req suit_req_msg_suit_trigger_update_req_m; + struct suit_check_installed_component_digest_req + suit_req_msg_suit_check_installed_component_digest_req_m; + struct suit_get_installed_manifest_info_req + suit_req_msg_suit_get_installed_manifest_info_req_m; + struct suit_authenticate_manifest_req suit_req_msg_suit_authenticate_manifest_req_m; + struct suit_authorize_unsigned_manifest_req + suit_req_msg_suit_authorize_unsigned_manifest_req_m; + struct suit_authorize_seq_num_req suit_req_msg_suit_authorize_seq_num_req_m; + struct suit_check_component_compatibility_req + suit_req_msg_suit_check_component_compatibility_req_m; + struct suit_get_supported_manifest_info_req + suit_req_msg_suit_get_supported_manifest_info_req_m; + struct suit_authorize_process_dependency_req + suit_req_msg_suit_authorize_process_dependency_req_m; + struct suit_evt_sub_req suit_req_msg_suit_evt_sub_req_m; + struct suit_chunk_enqueue_req suit_req_msg_suit_chunk_enqueue_req_m; + struct suit_chunk_status_req suit_req_msg_suit_chunk_status_req_m; + }; + enum { + suit_req_msg_suit_trigger_update_req_m_c, + suit_req_msg_suit_check_installed_component_digest_req_m_c, + suit_req_msg_suit_get_installed_manifest_info_req_m_c, + suit_req_msg_suit_get_install_candidate_info_req_m_c, + suit_req_msg_suit_authenticate_manifest_req_m_c, + suit_req_msg_suit_authorize_unsigned_manifest_req_m_c, + suit_req_msg_suit_authorize_seq_num_req_m_c, + suit_req_msg_suit_check_component_compatibility_req_m_c, + suit_req_msg_suit_get_supported_manifest_roles_req_m_c, + suit_req_msg_suit_get_supported_manifest_info_req_m_c, + suit_req_msg_suit_authorize_process_dependency_req_m_c, + suit_req_msg_suit_evt_sub_req_m_c, + suit_req_msg_suit_chunk_enqueue_req_m_c, + suit_req_msg_suit_chunk_status_req_m_c, + } suit_req_msg_choice; +}; + +struct suit_trigger_update_rsp { + int32_t suit_trigger_update_rsp_ret; +}; + +struct suit_check_installed_component_digest_rsp { + int32_t suit_check_installed_component_digest_rsp_ret; +}; + +struct suit_get_installed_manifest_info_rsp { + int32_t suit_get_installed_manifest_info_rsp_ret; + uint32_t suit_get_installed_manifest_info_rsp_seq_num; + int32_t suit_get_installed_manifest_info_rsp_semver_int[5]; + size_t suit_get_installed_manifest_info_rsp_semver_int_count; + int32_t suit_get_installed_manifest_info_rsp_digest_status; + int32_t suit_get_installed_manifest_info_rsp_alg_id; + struct zcbor_string suit_get_installed_manifest_info_rsp_digest; +}; + +struct suit_get_install_candidate_info_rsp { + int32_t suit_get_install_candidate_info_rsp_ret; + struct zcbor_string suit_get_install_candidate_info_rsp_manifest_class_id; + uint32_t suit_get_install_candidate_info_rsp_seq_num; + int32_t suit_get_install_candidate_info_rsp_semver_int[5]; + size_t suit_get_install_candidate_info_rsp_semver_int_count; + int32_t suit_get_install_candidate_info_rsp_alg_id; + struct zcbor_string suit_get_install_candidate_info_rsp_digest; +}; + +struct suit_authenticate_manifest_rsp { + int32_t suit_authenticate_manifest_rsp_ret; +}; + +struct suit_authorize_unsigned_manifest_rsp { + int32_t suit_authorize_unsigned_manifest_rsp_ret; +}; + +struct suit_authorize_seq_num_rsp { + int32_t suit_authorize_seq_num_rsp_ret; +}; + +struct suit_check_component_compatibility_rsp { + int32_t suit_check_component_compatibility_rsp_ret; +}; + +struct suit_get_supported_manifest_roles_rsp { + int32_t suit_get_supported_manifest_roles_rsp_ret; + int32_t suit_get_supported_manifest_roles_rsp_roles_int[20]; + size_t suit_get_supported_manifest_roles_rsp_roles_int_count; +}; + +struct suit_get_supported_manifest_info_rsp { + int32_t suit_get_supported_manifest_info_rsp_ret; + int32_t suit_get_supported_manifest_info_rsp_role; + struct zcbor_string suit_get_supported_manifest_info_rsp_vendor_id; + struct zcbor_string suit_get_supported_manifest_info_rsp_class_id; + int32_t suit_get_supported_manifest_info_rsp_downgrade_prevention_policy; + int32_t suit_get_supported_manifest_info_rsp_independent_updateability_policy; + int32_t suit_get_supported_manifest_info_rsp_signature_verification_policy; +}; + +struct suit_authorize_process_dependency_rsp { + int32_t suit_authorize_process_dependency_rsp_ret; +}; + +struct suit_evt_sub_rsp { + int32_t suit_evt_sub_rsp_ret; +}; + +struct suit_chunk_enqueue_rsp { + int32_t suit_chunk_enqueue_rsp_ret; +}; + +struct suit_chunk_info_entry { + uint32_t suit_chunk_info_entry_chunk_id; + uint32_t suit_chunk_info_entry_status; +}; + +struct suit_chunk_status_rsp { + int32_t suit_chunk_status_rsp_ret; + struct suit_chunk_info_entry suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m[3]; + size_t suit_chunk_status_rsp_chunk_info_suit_chunk_info_entry_m_count; +}; + +struct suit_rsp { + union { + struct suit_trigger_update_rsp suit_rsp_msg_suit_trigger_update_rsp_m; + struct suit_check_installed_component_digest_rsp + suit_rsp_msg_suit_check_installed_component_digest_rsp_m; + struct suit_get_installed_manifest_info_rsp + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m; + struct suit_get_install_candidate_info_rsp + suit_rsp_msg_suit_get_install_candidate_info_rsp_m; + struct suit_authenticate_manifest_rsp suit_rsp_msg_suit_authenticate_manifest_rsp_m; + struct suit_authorize_unsigned_manifest_rsp + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m; + struct suit_authorize_seq_num_rsp suit_rsp_msg_suit_authorize_seq_num_rsp_m; + struct suit_check_component_compatibility_rsp + suit_rsp_msg_suit_check_component_compatibility_rsp_m; + struct suit_get_supported_manifest_roles_rsp + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m; + struct suit_get_supported_manifest_info_rsp + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m; + struct suit_authorize_process_dependency_rsp + suit_rsp_msg_suit_authorize_process_dependency_rsp_m; + struct suit_evt_sub_rsp suit_rsp_msg_suit_evt_sub_rsp_m; + struct suit_chunk_enqueue_rsp suit_rsp_msg_suit_chunk_enqueue_rsp_m; + struct suit_chunk_status_rsp suit_rsp_msg_suit_chunk_status_rsp_m; + }; + enum { + suit_rsp_msg_suit_trigger_update_rsp_m_c, + suit_rsp_msg_suit_check_installed_component_digest_rsp_m_c, + suit_rsp_msg_suit_get_installed_manifest_info_rsp_m_c, + suit_rsp_msg_suit_get_install_candidate_info_rsp_m_c, + suit_rsp_msg_suit_authenticate_manifest_rsp_m_c, + suit_rsp_msg_suit_authorize_unsigned_manifest_rsp_m_c, + suit_rsp_msg_suit_authorize_seq_num_rsp_m_c, + suit_rsp_msg_suit_check_component_compatibility_rsp_m_c, + suit_rsp_msg_suit_get_supported_manifest_roles_rsp_m_c, + suit_rsp_msg_suit_get_supported_manifest_info_rsp_m_c, + suit_rsp_msg_suit_authorize_process_dependency_rsp_m_c, + suit_rsp_msg_suit_evt_sub_rsp_m_c, + suit_rsp_msg_suit_chunk_enqueue_rsp_m_c, + suit_rsp_msg_suit_chunk_status_rsp_m_c, + } suit_rsp_msg_choice; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/ssf_client.c b/subsys/sdfw_services/ssf_client.c new file mode 100644 index 000000000000..e713233903ab --- /dev/null +++ b/subsys/sdfw_services/ssf_client.c @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include "ssf_client_os.h" +#include "ssf_client_transport.h" + +#include +#include + +SSF_CLIENT_LOG_REGISTER(ssf_client, CONFIG_SSF_CLIENT_LOG_LEVEL); + +int ssf_client_notif_init(void); +void ssf_client_notif_handler(const uint8_t *pkt, size_t pkt_len); + +struct service_context { + const struct ssf_client_srvc *srvc; + size_t hdr_len; + size_t pl_len; + uint8_t *req_pkt; + size_t req_pkt_len; + const uint8_t *rsp_pkt; + size_t rsp_pkt_len; + int32_t ssf_err; +}; + +static int raw_payload_copy(uint8_t *dest, size_t dest_len, const uint8_t *src, size_t src_len, + size_t *bytes_written) +{ + if (dest_len < src_len) { + return -SSF_ENOMEM; + } + + if (dest == NULL || src == NULL) { + return -SSF_EFAULT; + } + + memcpy(dest, src, src_len); + if (bytes_written != NULL) { + *bytes_written = src_len; + } + + return 0; +} + +static int encode_header(struct service_context *ctx) +{ + const struct ssf_client_srvc *srvc = ctx->srvc; + + ZCBOR_STATE_E(state, CONFIG_SSF_CLIENT_ZCBOR_MAX_BACKUPS, ctx->req_pkt, srvc->req_buf_size, + 1); + + /* Header proceeding all ssf service requests: + * - remote ID of requesting remote + * - service ID of the requested service + * - service version of the requested service + */ + bool success = zcbor_list_start_encode(state, 3) && + ((zcbor_uint32_put(state, CONFIG_SSF_CLIENT_DOMAIN_ID) && + zcbor_uint32_put(state, (uint32_t)srvc->id) && + zcbor_uint32_put(state, (uint32_t)srvc->version)) || + (zcbor_list_map_end_force_encode(state), false)) && + zcbor_list_end_encode(state, 3); + + if (!success) { + return -SSF_EPROTO; + } + + ctx->hdr_len = state->payload - ctx->req_pkt; + + return 0; +} + +static int encode_payload(struct service_context *ctx, void *req, bool is_raw_data) +{ + int err; + + if (is_raw_data) { + struct ssf_client_raw_data *raw = (struct ssf_client_raw_data *)req; + + err = raw_payload_copy(&ctx->req_pkt[ctx->hdr_len], + ctx->srvc->req_buf_size - ctx->hdr_len, raw->data, raw->len, + &ctx->pl_len); + } else { + err = ctx->srvc->req_encode(&ctx->req_pkt[ctx->hdr_len], + ctx->srvc->req_buf_size - ctx->hdr_len, req, + &ctx->pl_len); + } + + return err; +} + +static int send_request(struct service_context *ctx) +{ + int err; + + ctx->req_pkt_len = ctx->hdr_len + ctx->pl_len; + + SSF_CLIENT_LOG_DBG("Sending request: id 0x%x, remote %d, pkt-len %d", ctx->srvc->id, + CONFIG_SSF_CLIENT_DOMAIN_ID, ctx->req_pkt_len); + + err = ssf_client_transport_request_send(ctx->req_pkt, ctx->req_pkt_len, &ctx->rsp_pkt, + &ctx->rsp_pkt_len); + if (err != 0) { + if (err == -SSF_EMSGSIZE) { + return err; + } + return -SSF_EIO; + } + + return err; +} + +static int decode_header(struct service_context *ctx) +{ + ZCBOR_STATE_D(state, CONFIG_SSF_CLIENT_ZCBOR_MAX_BACKUPS, ctx->rsp_pkt, ctx->rsp_pkt_len, + 1, 0); + + /* Header proceeding all ssf service responses + * - ssf error: zero on success, otherwise an errno + * indicating an ssf error on the server side. + */ + bool success = zcbor_list_start_decode(state) && + (zcbor_int32_decode(state, &ctx->ssf_err) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state); + + if (!success) { + return -SSF_EPROTO; + } + + /* Previously used for request header length. Reuse for response header length. */ + ctx->hdr_len = state->payload - ctx->rsp_pkt; + + return 0; +} + +static int decode_payload(struct service_context *ctx, void *rsp, bool is_raw_data) +{ + int err; + + if (is_raw_data) { + struct ssf_client_raw_data *raw = (struct ssf_client_raw_data *)rsp; + + err = raw_payload_copy(raw->data, raw->len, &ctx->rsp_pkt[ctx->hdr_len], + ctx->rsp_pkt_len - ctx->hdr_len, &raw->len); + } else { + err = ctx->srvc->rsp_decode(&ctx->rsp_pkt[ctx->hdr_len], + ctx->rsp_pkt_len - ctx->hdr_len, rsp, NULL); + } + + if (err != 0) { + return -SSF_EPROTO; + } + + SSF_CLIENT_LOG_DBG("Received response: id 0x%x, remote %d, pkt-len 0x%x", ctx->srvc->id, + CONFIG_SSF_CLIENT_DOMAIN_ID, ctx->rsp_pkt_len); + + return err; +} + +static int process_request(const struct ssf_client_srvc *srvc, void *req, void *rsp, + const uint8_t **rsp_pkt, bool is_raw_data) +{ + int err; + struct service_context ctx; + + ctx.srvc = srvc; + + err = ssf_client_transport_alloc_tx_buf(&ctx.req_pkt, srvc->req_buf_size); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to allocate request buffer, err %d", err); + return err; + } + + err = encode_header(&ctx); + if (err != 0) { + ssf_client_transport_free_tx_buf(ctx.req_pkt); + SSF_CLIENT_LOG_ERR("Failed to encode request header, zcbor err %d", err); + return -SSF_EPROTO; + } + + err = encode_payload(&ctx, req, is_raw_data); + if (err != 0) { + ssf_client_transport_free_tx_buf(ctx.req_pkt); + SSF_CLIENT_LOG_ERR("Failed to encode request payload, err %d", err); + return -SSF_EPROTO; + } + + err = send_request(&ctx); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to send request with id 0x%x, err %d", srvc->id, err); + return err; + } + + err = decode_header(&ctx); + if (err != 0) { + ssf_client_transport_decoding_done(ctx.rsp_pkt); + SSF_CLIENT_LOG_ERR("Failed decode header, zcbor err %d", err); + return -SSF_EPROTO; + } + + if (ctx.ssf_err != 0) { + ssf_client_transport_decoding_done(ctx.rsp_pkt); + SSF_CLIENT_LOG_ERR("Request with id 0x%x failed, rsp %d", srvc->id, ctx.ssf_err); + return ctx.ssf_err; + } + + err = decode_payload(&ctx, rsp, is_raw_data); + if (err != 0) { + ssf_client_transport_decoding_done(ctx.rsp_pkt); + SSF_CLIENT_LOG_ERR("Failed to decode response payload, err %d", err); + return err; + } + + if (rsp_pkt == NULL) { + ssf_client_transport_decoding_done(ctx.rsp_pkt); + } else { + *rsp_pkt = ctx.rsp_pkt; + } + + return 0; +} + +int ssf_client_init(void) +{ + int err; + + err = ssf_client_notif_init(); + if (err != 0) { + return -SSF_EINVAL; + } + + err = ssf_client_transport_init(ssf_client_notif_handler); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Failed to initialize transport"); + return -SSF_EINVAL; + } + + return 0; +} + +int ssf_client_send_request(const struct ssf_client_srvc *srvc, void *req, void *decoded_rsp, + const uint8_t **rsp_pkt) +{ + if (srvc == NULL || req == NULL || decoded_rsp == NULL) { + return -SSF_EINVAL; + } + if (srvc->req_encode == NULL || srvc->rsp_decode == NULL) { + return -SSF_EPROTO; + } + + return process_request(srvc, req, decoded_rsp, rsp_pkt, false); +} + +int ssf_client_send_raw_request(const struct ssf_client_srvc *srvc, + struct ssf_client_raw_data raw_req, + struct ssf_client_raw_data *raw_rsp) +{ + int err; + + if (srvc == NULL || raw_rsp == NULL) { + return -SSF_EINVAL; + } + + err = process_request(srvc, (void *)&raw_req, (void *)raw_rsp, NULL, true); + + return err; +} + +void ssf_client_decode_done(const uint8_t *rsp_pkt) +{ + ssf_client_transport_decoding_done(rsp_pkt); +} diff --git a/subsys/sdfw_services/ssf_client_notif.c b/subsys/sdfw_services/ssf_client_notif.c new file mode 100644 index 000000000000..c4a3d7b17f61 --- /dev/null +++ b/subsys/sdfw_services/ssf_client_notif.c @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +#include +#include "ssf_client_os.h" +#include "ssf_client_transport.h" + +#include + +SSF_CLIENT_LOG_DECLARE(ssf_client, CONFIG_SSF_CLIENT_LOG_LEVEL); + +static struct ssf_client_notif_listener *listeners[CONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX]; +static struct ssf_client_sem listeners_sem; + +static int decode_header(const uint8_t *buf, size_t buf_size, uint16_t *service_id, + uint16_t *service_version, struct ssf_notification *notif) +{ + uint32_t id; + uint32_t version; + + ZCBOR_STATE_D(state, CONFIG_SSF_CLIENT_ZCBOR_MAX_BACKUPS, buf, buf_size, 1, 0); + + bool success = zcbor_list_start_decode(state) && + ((zcbor_uint32_decode(state, &id) && zcbor_uint32_decode(state, &version)) || + (zcbor_list_map_end_force_decode(state), false)) && + zcbor_list_end_decode(state); + + if (!success) { + return -SSF_EPROTO; + } + + notif->data = state->payload; + notif->data_len = buf_size - (state->payload - buf); + notif->pkt = buf; + + *service_id = (uint16_t)id; + *service_version = (uint16_t)version; + + return 0; +} + +int ssf_client_notif_init(void) +{ + return ssf_client_sem_init(&listeners_sem); +} + +void ssf_client_notif_handler(const uint8_t *pkt, size_t pkt_len) +{ + int err; + uint16_t service_id; + uint16_t server_service_version; + struct ssf_notification notif; + struct ssf_client_notif_listener *listener = NULL; + + err = decode_header(pkt, pkt_len, &service_id, &server_service_version, ¬if); + if (err != 0) { + ssf_client_transport_decoding_done(pkt); + return; + } + + ssf_client_sem_take(&listeners_sem, SSF_CLIENT_SEM_WAIT_FOREVER); + + for (int i = 0; i < CONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX; i++) { + if (listeners[i] != NULL && listeners[i]->id == service_id) { + listener = listeners[i]; + break; + } + } + + ssf_client_sem_give(&listeners_sem); + + if (listener == NULL) { + ssf_client_transport_decoding_done(pkt); + SSF_CLIENT_LOG_ERR("No listener for service 0x%x is registered", service_id); + return; + } + + if (listener->handler == NULL) { + ssf_client_transport_decoding_done(pkt); + SSF_CLIENT_LOG_ERR("Handler missing for listener, service 0x%x", listener->id); + return; + } + + if (listener->version != server_service_version) { + ssf_client_transport_decoding_done(pkt); + SSF_CLIENT_LOG_ERR("Notification version number mismatch: service 0x%x, " + "client ver %d, server ver %d", + listener->id, listener->version, server_service_version); + return; + } + + notif.notif_decode = listener->notif_decode; + + err = listener->handler(¬if, listener->context); + if (err != 0) { + SSF_CLIENT_LOG_ERR("Notification handler failed, service 0x%x, err %d", + listener->id, err); + } +} + +int ssf_client_notif_decode(const struct ssf_notification *notif, void *decoded_notif) +{ + int err; + + if (notif == NULL || notif->data == NULL || notif->notif_decode == NULL || + decoded_notif == NULL) { + return -SSF_EINVAL; + } + + err = notif->notif_decode(notif->data, notif->data_len, decoded_notif, NULL); + if (err != 0) { + return -SSF_EPROTO; + } + + return 0; +} + +void ssf_client_notif_decode_done(struct ssf_notification *notif) +{ + if (notif == NULL || notif->pkt == NULL) { + SSF_CLIENT_LOG_ERR("Failed to free notif buffer"); + return; + } + + ssf_client_transport_decoding_done((uint8_t *)notif->pkt); +} + +int ssf_client_notif_register(struct ssf_client_notif_listener *listener, void *context) +{ + int err; + + if (listener == NULL || listener->handler == NULL || listener->notif_decode == NULL) { + return -SSF_EINVAL; + } + + ssf_client_sem_take(&listeners_sem, SSF_CLIENT_SEM_WAIT_FOREVER); + + if (listener->is_registered) { + err = -SSF_EALREADY; + goto clean_exit; + } + + for (int i = 0; i < CONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX; i++) { + if (listeners[i] == NULL) { + listener->is_registered = true; + listener->context = context; + listeners[i] = listener; + + err = 0; + goto clean_exit; + } + } + + err = -SSF_ENOBUFS; + +clean_exit: + ssf_client_sem_give(&listeners_sem); + return err; +} + +int ssf_client_notif_deregister(struct ssf_client_notif_listener *listener) +{ + int err; + + if (listener == NULL) { + return -SSF_EINVAL; + } + + ssf_client_sem_take(&listeners_sem, SSF_CLIENT_SEM_WAIT_FOREVER); + + for (int i = 0; i < CONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX; i++) { + if (listeners[i] == listener) { + listeners[i] = NULL; + listener->context = NULL; + listener->is_registered = false; + + err = 0; + goto clean_exit; + } + } + + err = -SSF_ENXIO; + +clean_exit: + ssf_client_sem_give(&listeners_sem); + return err; +} diff --git a/subsys/sdfw_services/transport/CMakeLists.txt b/subsys/sdfw_services/transport/CMakeLists.txt new file mode 100644 index 000000000000..49961f194e01 --- /dev/null +++ b/subsys/sdfw_services/transport/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_include_directories(include) + +add_subdirectory_ifdef(CONFIG_SSF_NRF_RPC nrf_rpc) diff --git a/subsys/sdfw_services/transport/Kconfig b/subsys/sdfw_services/transport/Kconfig new file mode 100644 index 000000000000..efc5cc1964b1 --- /dev/null +++ b/subsys/sdfw_services/transport/Kconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SSF_NRF_RPC + bool + default y + imply NRF_RPC + imply MBOX_NRFX_IDS + +if SSF_NRF_RPC +rsource "nrf_rpc/Kconfig" +endif diff --git a/subsys/sdfw_services/transport/include/ssf_client_transport.h b/subsys/sdfw_services/transport/include/ssf_client_transport.h new file mode 100644 index 000000000000..d391275fb21d --- /dev/null +++ b/subsys/sdfw_services/transport/include/ssf_client_transport.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_CLIENT_TRANSPORT_H__ +#define SSF_CLIENT_TRANSPORT_H__ + +#include +#include + +/** + * @brief Notification handler prototype. + */ +typedef void (*ssf_client_transport_notif_handler)(const uint8_t *packet, size_t len); + +/** + * @brief Initialize underlying transport. + * + * @param[in] notif_handler Function to be invoked when receiving notifications. + * + * @return 0 on success, otherwise a negative errno. + */ +int ssf_client_transport_init(ssf_client_transport_notif_handler notif_handler); + +/** + * @brief Allocate send buffer in underlying transport. + * + * @param[out] buf A pointer to the allocated tx buffer. + * @param[in] len Size of tx buffer to allocate. + * + * @return 0 on success, otherwise a negative errno. + */ +int ssf_client_transport_alloc_tx_buf(uint8_t **buf, size_t len); + +/** + * @brief Free a send buffer previously allocated with ssf_client_transport_alloc_tx_buf. + * + * @param[in] buf A pointer to the tx buffer to release. + */ +void ssf_client_transport_free_tx_buf(uint8_t *buf); + +/** + * @brief Free a receive buffer with data from underlying transport. + * + * @param[in] packet A pointer to the rx buffer to release. + */ +void ssf_client_transport_decoding_done(const uint8_t *packet); + +/** + * @brief Send a request packet and wait for response to be received. Return response packet. + * + * @note Request packet must be allocated with ssf_client_transport_alloc_tx_buf. + * Response packet must be released with ssf_client_transport_decoding_done + * after packet have been processed. + * + * @param[in] pkt A pointer to the request packet to send. + * @param[in] pkt_len Length of the request packet. + * @param[out] rsp_pkt A pointer to the response packet to be receive. + * @param[out] rsp_pkt_len Length of the received response packet. + * + * @return 0 on success, otherwise a negative errno. + */ +int ssf_client_transport_request_send(uint8_t *pkt, size_t pkt_len, const uint8_t **rsp_pkt, + size_t *rsp_pkt_len); + +#endif /* SSF_CLIENT_TRANSPORT_H__ */ diff --git a/subsys/sdfw_services/transport/nrf_rpc/CMakeLists.txt b/subsys/sdfw_services/transport/nrf_rpc/CMakeLists.txt new file mode 100644 index 000000000000..84346843aabc --- /dev/null +++ b/subsys/sdfw_services/transport/nrf_rpc/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(ssf_client_nrf_rpc.c) diff --git a/subsys/sdfw_services/transport/nrf_rpc/Kconfig b/subsys/sdfw_services/transport/nrf_rpc/Kconfig new file mode 100644 index 000000000000..bdcd32749c3e --- /dev/null +++ b/subsys/sdfw_services/transport/nrf_rpc/Kconfig @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SSF_NRF_RPC_CMD_ID + hex + default 0x42 + help + nRF_RPC Command ID to use for SDFW Service Framework + +config SSF_NRF_RPC_NOTIF_ID + hex + default 0x43 + help + nRF_RPC Event ID to use for notifications diff --git a/subsys/sdfw_services/transport/nrf_rpc/ssf_client_nrf_rpc.c b/subsys/sdfw_services/transport/nrf_rpc/ssf_client_nrf_rpc.c new file mode 100644 index 000000000000..89337fddc556 --- /dev/null +++ b/subsys/sdfw_services/transport/nrf_rpc/ssf_client_nrf_rpc.c @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include "ssf_client_transport.h" + +#include +#include "ssf_client_os.h" +#include "ssf_nrf_rpc_common.h" +#include +#include + +SSF_CLIENT_LOG_DECLARE(ssf_client, CONFIG_SSF_CLIENT_LOG_LEVEL); + +#if CONFIG_SSF_CLIENT_DOMAIN_ID == 2 +NRF_RPC_IPC_TRANSPORT(ssf_transport, DEVICE_DT_GET(DT_NODELABEL(cpusec_cpuapp_ipc)), "ssf_ept"); +#elif CONFIG_SSF_CLIENT_DOMAIN_ID == 3 +NRF_RPC_IPC_TRANSPORT(ssf_transport, DEVICE_DT_GET(DT_NODELABEL(cpusec_cpurad_ipc)), "ssf_ept"); +#else +#error Unsupported domain +#endif +NRF_RPC_GROUP_DEFINE(ssf_group, "ssf_" CONFIG_SSF_CLIENT_NRF_RPC_GROUP_NAME, &ssf_transport, NULL, + NULL, NULL); + +static bool transport_initialized; +static ssf_client_transport_notif_handler notif_handler; + +static void ssf_notification_handler(const struct nrf_rpc_group *group, const uint8_t *packet, + size_t len, void *handler_data) +{ + ARG_UNUSED(group); + ARG_UNUSED(handler_data); + + if (notif_handler != NULL && packet != NULL) { + notif_handler(packet, len); + } +} + +NRF_RPC_EVT_DECODER(ssf_group, ssf_notif_decoder, CONFIG_SSF_NRF_RPC_NOTIF_ID, + ssf_notification_handler, NULL); + +static void err_handler(const struct nrf_rpc_err_report *report) +{ + SSF_CLIENT_LOG_ERR("nRF RPC error %d ocurred. See nRF RPC logs for more details.", + report->code); +} + +int ssf_client_transport_init(ssf_client_transport_notif_handler handler) +{ + int err; + + if (handler == NULL) { + return -SSF_EINVAL; + } + notif_handler = handler; + + transport_initialized = false; + + err = nrf_rpc_init(err_handler); + if (err != 0) { + return -SSF_EINVAL; + } + + transport_initialized = true; + + return 0; +} + +int ssf_client_transport_alloc_tx_buf(uint8_t **buf, size_t len) +{ + if (buf == NULL) { + return -SSF_EINVAL; + } + + if (!transport_initialized) { + return -SSF_EBUSY; + } + + nrf_rpc_alloc_tx_buf(&ssf_group, buf, len); + if (*buf == NULL) { + return -SSF_ENOMEM; + } + + return 0; +} + +void ssf_client_transport_free_tx_buf(uint8_t *buf) +{ + if (!transport_initialized) { + return; + } + + nrf_rpc_free_tx_buf(&ssf_group, buf); +} + +void ssf_client_transport_decoding_done(const uint8_t *packet) +{ + if (!transport_initialized) { + return; + } + + nrf_rpc_decoding_done(&ssf_group, packet); +} + +int ssf_client_transport_request_send(uint8_t *pkt, size_t pkt_len, const uint8_t **rsp_pkt, + size_t *rsp_pkt_len) +{ + int err; + + if (pkt == NULL) { + return -SSF_EINVAL; + } + + if (rsp_pkt == NULL || rsp_pkt_len == NULL) { + err = -SSF_EINVAL; + goto free_request_and_exit; + } + + if (!transport_initialized) { + err = -SSF_EBUSY; + goto free_request_and_exit; + } + + err = ssf_translate_error(nrf_rpc_cmd_rsp(&ssf_group, CONFIG_SSF_NRF_RPC_CMD_ID, pkt, + pkt_len, rsp_pkt, rsp_pkt_len)); + if (err == -SSF_EFAULT) { + goto free_request_and_exit; + } + + return err; + +free_request_and_exit: + nrf_rpc_free_tx_buf(&ssf_group, pkt); + return err; +} diff --git a/subsys/sdfw_services/transport/nrf_rpc/ssf_nrf_rpc_common.h b/subsys/sdfw_services/transport/nrf_rpc/ssf_nrf_rpc_common.h new file mode 100644 index 000000000000..848448bdaafc --- /dev/null +++ b/subsys/sdfw_services/transport/nrf_rpc/ssf_nrf_rpc_common.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SSF_NRF_RPC_COMMON_H__ +#define SSF_NRF_RPC_COMMON_H__ + +#include + +#include + +static int ssf_translate_error(int nrf_rpc_err) +{ + switch (nrf_rpc_err) { + case -NRF_EIO: + return -SSF_EIO; + case -NRF_EFAULT: + return -SSF_EFAULT; + case -NRF_EINVAL: + return -SSF_EINVAL; + case -NRF_EBADMSG: + return -SSF_EBADMSG; + case -NRF_EALREADY: + return -SSF_EALREADY; + default: + if (nrf_rpc_err != 0) { + return -SSF_EIO; + } + break; + } + + return 0; +} + +#endif /* SSF_NRF_RPC_COMMON_H__ */ diff --git a/subsys/sdfw_services/zcbor/CMakeLists.txt b/subsys/sdfw_services/zcbor/CMakeLists.txt new file mode 100644 index 000000000000..8b595c6d0978 --- /dev/null +++ b/subsys/sdfw_services/zcbor/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +include(gen_cbor_parsers.cmake) diff --git a/subsys/sdfw_services/zcbor/gen_cbor_parsers.cmake b/subsys/sdfw_services/zcbor/gen_cbor_parsers.cmake new file mode 100644 index 000000000000..2aedbeb901fc --- /dev/null +++ b/subsys/sdfw_services/zcbor/gen_cbor_parsers.cmake @@ -0,0 +1,141 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# This file adds the macro `generate_and_add_cbor_files()` for +# generating CBOR parsers from CDDL files with zcbor, or +# adding already generated and installed CBOR parsers to the build. +# +# To (re-)generate CBOR parser files, and use the generated files, +# add -DCONFIG_SSF_ZCBOR_GENERATE=y when building. +# This config is needed for the generation process to run. +# +# To install the generated CBOR parser files, build/run target +# 'ssf_parser_files_install'. CBOR parser files will be installed +# into relative directory specified by the second argument of +# `generate_and_add_cbor_files()`. +# + +find_program( + CLANG_FORMAT_EXECUTABLE + NAMES + clang-format + clang-format-15 + clang-format-14 +) + +# Empty target that will depend on other install targets. +add_custom_target(ssf_parser_files_install) + +function(generate_cbor_files cddl_file install_dir) + set(license ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/license.cmake) + set(gen_cmake_list ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/gen_cmake_list.cmake) + + cmake_path(GET install_dir FILENAME bin_dir) + cmake_path(REMOVE_EXTENSION bin_dir) + + set(src_out ${ZEPHYR_BINARY_DIR}/source/${bin_dir}) + set(include_out ${ZEPHYR_BINARY_DIR}/include/${bin_dir}) + file(MAKE_DIRECTORY ${src_out}) + + cmake_path(GET cddl_file FILENAME cddl_name) + cmake_path(REMOVE_EXTENSION cddl_name) + + set(encode_c_name ${cddl_name}_encode.c) + set(decode_c_name ${cddl_name}_decode.c) + set(encode_h_name ${cddl_name}_encode.h) + set(decode_h_name ${cddl_name}_decode.h) + set(types_h_name ${cddl_name}_types.h) + + set(encode_c ${src_out}/${encode_c_name}) + set(decode_c ${src_out}/${decode_c_name}) + set(encode_h ${include_out}/${encode_h_name}) + set(decode_h ${include_out}/${decode_h_name}) + set(types_h ${include_out}/${types_h_name}) + + set(out_files "") + list(APPEND out_files ${encode_c} ${decode_c} ${encode_h} ${decode_h} ${types_h}) + + set(entry_types ${ARGN}) + + # Ensures correct passing of list argument to ${license} file. + string(REPLACE ";" "\;" out_files_cmd_arg "${out_files}") + + if (CLANG_FORMAT_EXECUTABLE) + set(CLANG_FORMAT_COMMAND COMMAND ${CLANG_FORMAT_EXECUTABLE} -i "${out_files}") + endif() + + add_custom_command( + OUTPUT ${out_files} + COMMAND ${CMAKE_COMMAND} -E echo "Generating files from ${cddl_file}" + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_ZCBOR_MODULE_DIR}/zcbor/zcbor.py code + --decode --encode + --cddl ${cddl_file} + --entry-types ${entry_types} + --output-c ${src_out}/${cddl_name}.c # When both '-d' and '-e' are specified, zcbor automatically + --output-h ${include_out}/${cddl_name}.h # adds '_encode' and '_decode' to filenames. + --output-h-types ${include_out}/${types_h_name} + COMMAND ${CMAKE_COMMAND} -DFILES=${out_files_cmd_arg} -P ${license} + ${CLANG_FORMAT_COMMAND} + DEPENDS ${license} ${cddl_file} + VERBATIM + ) + + zephyr_library_sources(${encode_c} ${decode_c}) + zephyr_include_directories(${include_out}) + + # Create install target which installs the generated ${cddl_name} + # parser files into the working tree when target + # 'ssf_parser_files_install' is built. + set(parser_files_install parser_files_install_${cddl_name}) + add_custom_target(${parser_files_install} + COMMAND ${CMAKE_COMMAND} -E echo "Installing files generated from ${cddl_file} in ${install_dir}" + COMMAND ${CMAKE_COMMAND} -E copy ${encode_c} ${install_dir}/${encode_c_name} + COMMAND ${CMAKE_COMMAND} -E copy ${decode_c} ${install_dir}/${decode_c_name} + COMMAND ${CMAKE_COMMAND} -E copy ${encode_h} ${install_dir}/${encode_h_name} + COMMAND ${CMAKE_COMMAND} -E copy ${decode_h} ${install_dir}/${decode_h_name} + COMMAND ${CMAKE_COMMAND} -E copy ${types_h} ${install_dir}/${types_h_name} + COMMAND ${CMAKE_COMMAND} -DCDDL_NAME=${cddl_name} -DINSTALL_DIR=${install_dir} -P ${gen_cmake_list} + DEPENDS ${out_files} + ) + add_dependencies(ssf_parser_files_install ${parser_files_install}) + +endfunction() + +# +# Function for generating CBOR parsers from CDDL files with zcbor, or +# adding already generated and installed CBOR parsers to the build. +# +# `cddl_file` Path to a .cddl file. +# `install_dir ` Path of the directory where installed CBOR parser +# files can be found. Or, in case target `ssf_parser_files_install` +# is run, the directory to install the CBOR parsers. +# OPTIONAL List of entry types to create parsers for. +# +function(generate_and_add_cbor_files cddl_file install_dir) + cmake_path(ABSOLUTE_PATH cddl_file + BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NORMALIZE + OUTPUT_VARIABLE cddl_file + ) + cmake_path(ABSOLUTE_PATH install_dir + BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} NORMALIZE + OUTPUT_VARIABLE install_dir + ) + + cmake_path(GET install_dir FILENAME bin_dir) + cmake_path(REMOVE_EXTENSION bin_dir) + + if (CONFIG_SSF_ZCBOR_GENERATE) + zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) + if (NOT TARGET ${lib_name}) + zephyr_library() + endif() + generate_cbor_files(${cddl_file} ${install_dir} ${ARGN}) + else() + add_subdirectory(${install_dir} ${bin_dir}) + endif() + +endfunction() diff --git a/subsys/sdfw_services/zcbor/gen_cmake_list.cmake b/subsys/sdfw_services/zcbor/gen_cmake_list.cmake new file mode 100644 index 000000000000..c8cd0ab39a00 --- /dev/null +++ b/subsys/sdfw_services/zcbor/gen_cmake_list.cmake @@ -0,0 +1,31 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(cddl_name ${CDDL_NAME}) +set(install_dir ${INSTALL_DIR}) + +set(CMAKE_LISTS_FILE ${install_dir}/CMakeLists.txt) +string(TIMESTAMP current_year "%Y" UTC) +set(CMAKE_LISTS_CONTENT "\ +# +# Copyright (c) ${current_year} Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# Generated using cmake macro generate_and_add_cbor_files. +# + +zephyr_sources( + ${cddl_name}_decode.c + ${cddl_name}_encode.c +) + +zephyr_include_directories(.) +") + +file(WRITE ${CMAKE_LISTS_FILE} "${CMAKE_LISTS_CONTENT}") diff --git a/subsys/sdfw_services/zcbor/license.cmake b/subsys/sdfw_services/zcbor/license.cmake new file mode 100644 index 000000000000..dc52fb1f0f09 --- /dev/null +++ b/subsys/sdfw_services/zcbor/license.cmake @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +string(TIMESTAMP current_year "%Y" UTC) +set(LICENSE "\ +/* + * Copyright (c) ${current_year} Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +") + +foreach(file ${FILES}) + file(READ ${file} SOURCE_CONTENT) + file(WRITE ${file} "${LICENSE}${SOURCE_CONTENT}") +endforeach() diff --git a/subsys/suit/CMakeLists.txt b/subsys/suit/CMakeLists.txt new file mode 100644 index 000000000000..21dcfd264140 --- /dev/null +++ b/subsys/suit/CMakeLists.txt @@ -0,0 +1,21 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +add_subdirectory(provisioning) +add_subdirectory_ifdef(CONFIG_SUIT plat_err) +add_subdirectory_ifdef(CONFIG_SUIT memory_layout) +add_subdirectory_ifdef(CONFIG_SUIT_ORCHESTRATOR orchestrator) +add_subdirectory_ifdef(CONFIG_SUIT_PLATFORM platform) +add_subdirectory_ifdef(CONFIG_SUIT_MEMPTR_STORAGE memptr_storage) +add_subdirectory_ifdef(CONFIG_SUIT_STORAGE storage) +add_subdirectory_ifdef(CONFIG_SUIT_STREAM stream) +add_subdirectory_ifdef(CONFIG_SUIT_MCI mci) +add_subdirectory_ifdef(CONFIG_SUIT_METADATA metadata) +add_subdirectory_ifdef(CONFIG_SUIT_UTILS utils) +add_subdirectory_ifdef(CONFIG_SUIT_CACHE cache) +add_subdirectory_ifdef(CONFIG_SUIT_DFU orchestrator_app) +add_subdirectory_ifdef(CONFIG_SUIT_ENVELOPE_INFO envelope_info) +add_subdirectory_ifdef(CONFIG_SUIT_EXECUTION_MODE execution_mode) diff --git a/subsys/suit/Kconfig b/subsys/suit/Kconfig new file mode 100644 index 000000000000..43da505d26d2 --- /dev/null +++ b/subsys/suit/Kconfig @@ -0,0 +1,183 @@ +# +# Copyright (c) 2020 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +rsource "provisioning/Kconfig" + +menuconfig SUIT + bool "Enable SUIT modules" + +if SUIT + +config SUIT_DFU + bool "Enable SUIT DFU - the interface for SUIT for the user application" + depends on !SUIT_PLATFORM_VARIANT_SDFW + default y if !ZTEST + +choice SUIT_PLATFORM_VARIANT + prompt "SUIT platform implementation variant" + default SUIT_PLATFORM_VARIANT_APP if !ZTEST + +config SUIT_PLATFORM_VARIANT_SDFW + bool "Set SUIT platform variant to Secure domain" + +config SUIT_PLATFORM_VARIANT_APP + bool "Set SUIT platform variant to application domain" + +endchoice # SUIT_PLATFORM_VARIANT + +if SUIT_DFU + +choice SUIT_DFU_CANDIDATE_PROCESSING_LEVEL + prompt "Select the level of SUIT candidate processing inside the user application" + +config SUIT_DFU_CANDIDATE_PROCESSING_MINIMAL + bool "Application defaults for minimal SUIT candidate processing" + help + This configuration can be used to allow update using SUIT when no interpretation + of the SUIT envelope is needed by the local domain apart from basic format checking. + This is equivalent to a situation where it is known that none of the manifests + (the top manifest nor its dependencies) contains a suit-payload-fetch sequence. + The only role of the application core is store the SUIT candidate envelope + followed by passing the control to the Secure Domain. + imply SUIT_ORCHESTRATOR_APP + imply SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + imply SUIT_ENVELOPE_INFO + imply SUIT_UTILS + imply SUIT_METADATA + imply SSF_SUIT_SERVICE_ENABLED + imply SUIT_MPI_GENERATE + +config SUIT_DFU_CANDIDATE_PROCESSING_FULL + bool "Application defaults for support of full SUIT envelope processing by the local domain" + help + This configuration can be used if processing of the SUIT envelope is needed by the + local domain. This is equivalent to a situation where one of the manifests + (the top manifest or its dependencies) may contain a suit-payload-fetch sequence. + Before passing control to the Secure Domain, the local domain implementation of + the SUIT DFU module processes the envelope and fetches any additional needed + data using the registered fetch sources. + imply SUIT_ORCHESTRATOR_APP + imply SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + imply SUIT_ENVELOPE_INFO + imply SUIT_UTILS + imply SUIT_DIGEST + imply SUIT_CRYPTO + imply SSF_SUIT_SERVICE_ENABLED + imply SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + imply SUIT_PLAT_CHECK_CLASSES + imply SUIT_METADATA + imply SUIT_CHECK_IMAGE_MATCH + imply SUIT_STREAM + imply SUIT_STREAM_FETCH_SOURCE_MGR + imply SUIT_STREAM_SOURCE_CACHE + imply SUIT_STREAM_SOURCE_MEMPTR + imply SUIT_STREAM_SINK_DIGEST + imply SUIT_STREAM_SINK_MEMPTR + imply SUIT_CACHE + imply SUIT_CACHE_RW + imply SUIT_STREAM_SINK_CACHE + imply SUIT_STREAM_SINK_FLASH + imply SUIT_MEMPTR_STORAGE + imply SUIT_PLATFORM + imply SUIT_PROCESSOR + imply SUIT_MPI_GENERATE + imply SUIT_SINK_SELECTOR + +config SUIT_DFU_CANDIDATE_PROCESSING_NONE + bool "Disable any processing of the SUIT candidate envelope" + help + If this configuration is used no processing of the SUIT envelope will be performed. + It will not be possible to start the update from inside the application using the + SUIT DFU API. + In a general use case this Kconfig option will only be use for companion images + used by the Secure Domain to fetch additional data with the use of the application + core. + imply SUIT_ORCHESTRATOR_APP + imply SUIT_MPI_GENERATE + +endchoice # SUIT_APP_ENVELOPE_PROCESSING_LEVEL + +config SUIT_STREAMING_REQUESTS_FROM_SDFW_SUPPORT + bool "Enable support for streaming requests coming from SDFW" + help + In some cases when the Secure Domain processes the SUIT manifests may need to fetch + additional data from outside the device. As the Secure Domain does not have access + to any transport it needs to communicate with an application (a "companion image") + running on one of the local domains to fetch data. + Setting this Kconfig option will enable all the modules needed for + such a local domain application. + The implementer of this application needs to initialize the needed subsystems + using suit_dfu_initialize and register transports as fetch sources. + imply SUIT_ORCHESTRATOR_APP + imply SUIT_UTILS + imply SUIT_METADATA + imply SSF_SUIT_SERVICE_ENABLED + imply SUIT_STREAM_FETCH_SOURCE_MGR + imply SUIT_STREAM_SOURCE_IPC + imply SUIT_STREAM + imply SUIT_STREAM_IPC_PROVIDER + +endif # SUIT_DFU + +config SUIT_ENABLE_DEFAULTS_SDFW + bool "SDFW SUIT defaults" + imply SUIT_CRYPTO + imply SUIT_DEVCONFIG + imply SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + imply SUIT_PLAT_CHECK_CLASSES + imply SUIT_AUTHENTICATE + imply SUIT_DIGEST + imply SUIT_DIGEST_CACHE + imply SUIT_CHECK_IMAGE_MATCH + imply SUIT_MCI + imply SUIT_METADATA + imply SUIT_ORCHESTRATOR + imply SUIT_PLATFORM + imply SUIT_STREAM + imply SUIT_STREAM_SINK_MEMPTR + imply SUIT_STREAM_SINK_FLASH + imply SUIT_STREAM_SINK_DIGEST + imply SUIT_STREAM_SINK_RAM + imply SUIT_STREAM_SINK_SDFW + imply SUIT_STREAM_SOURCE_CACHE + imply SUIT_STREAM_SOURCE_MEMPTR + imply SUIT_STREAM_SOURCE_IPC + imply SUIT_STREAM_IPC_REQUESTOR + imply SUIT_MEMPTR_STORAGE + imply SUIT_UTILS + imply SUIT_CACHE + imply SUIT_STORAGE + imply SUIT_SINK_SELECTOR + imply SUIT_EXECUTION_MODE + imply SUIT_UPDATE_REBOOT_ENABLED + imply SUIT_BOOT_RECOVERY_REBOOT_ENABLED + +config SUIT_ENABLE_DEFAULTS_SDFW_EXTMEM + bool "SDFW SUIT defaults with external flash support" + depends on SUIT_PLATFORM_VARIANT_SDFW + imply SUIT_STREAM_SOURCE_EXTMEM + imply SSF_EXTMEM_SERVICE_ENABLED + +rsource "cache/Kconfig" +rsource "mci/Kconfig" +rsource "metadata/Kconfig" +rsource "storage/Kconfig" +rsource "orchestrator/Kconfig" +rsource "orchestrator_app/Kconfig" +rsource "memptr_storage/Kconfig" +rsource "platform/Kconfig" +rsource "stream/Kconfig" +rsource "utils/Kconfig" +rsource "envelope_info/Kconfig" +rsource "execution_mode/Kconfig" +rsource "memory_layout/Kconfig" + +# Configure SUIT_LOG_LEVEL +module = SUIT +module-str = Software Updates for Internet of Things +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif # SUIT diff --git a/subsys/suit/cache/CMakeLists.txt b/subsys/suit/cache/CMakeLists.txt new file mode 100644 index 000000000000..9c048820724e --- /dev/null +++ b/subsys/suit/cache/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_cache_interface) +target_include_directories(suit_cache_interface INTERFACE include) +target_link_libraries(suit_cache_interface INTERFACE suit_platform_err) + +zephyr_library() +zephyr_library_sources(src/suit_dfu_cache.c) +zephyr_library_sources(src/suit_dfu_cache_helpers.c) +zephyr_library_sources(src/zcbor_noncanonical_decode.c) + +zephyr_library_sources_ifdef(CONFIG_SUIT_CACHE_RW src/suit_dfu_cache_rw.c) + +zephyr_library_link_libraries(suit_cache_interface) + +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_CACHE_RW suit_utils) + +zephyr_library_link_libraries(suit_stream_sources_interface) +zephyr_library_link_libraries(suit_source_selector_interface) +zephyr_library_link_libraries(suit_memory_layout_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/subsys/suit/cache/Kconfig b/subsys/suit/cache/Kconfig new file mode 100644 index 000000000000..b7eb76b407f8 --- /dev/null +++ b/subsys/suit/cache/Kconfig @@ -0,0 +1,62 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_CACHE + bool "Enable SUIT cache support library" + depends on ZCBOR + imply SUIT_STREAM_SINK_RAM + imply SUIT_STREAM + +if SUIT_CACHE + +config SUIT_CACHE_MAX_CACHES + int "The maximum number of caches that will be handled" + range 1 16 + help + The maximum number of user-defined caches is limited to 15. + User defined cache partitions names start at index 1 as suit_cache_0 is predefined. + The default value is 8, and the minimum is 1. + default 8 + +config APP_LINK_WITH_SUIT_CACHE_INTERFACE + bool + default y + +config SUIT_MAX_URI_LENGTH + int "The maximum number of characters in uri used in fetch operations" + range 1 512 + default 128 + help + This option determines the longest URI that can be read or written from + the cache. + +config SUIT_CACHE_RW + bool "Enable write mode for SUIT cache" + depends on FLASH + depends on SUIT_UTILS + depends on !SUIT_PLATFORM_VARIANT_SDFW + +config SUIT_CACHE0_ERASE_ON_ENVELOPE_STORED + bool "Always erase the DFU cache partition 0 after the envelope is stored" + help + If this option is set then after the SUIT envelope is stored (more + precisely: when calling the suit_dfu_cache_rw_initialize function) + then Cache0 will be erased and reinitialized regardless of its previous + state. If this option is not set, the SUIT subsystem will check the + partition and only erase it if its broken and needs recovery. + If this option is not set it is up to the user to ensure that the + contents of cache0 are appropriate after the envelope is stored. + depends on SUIT_CACHE_RW + default y + +config SUIT_CACHEX_ERASE_BLOCK_SIZE + int "Erase block size" + default 4096 + help + Erase block size of cache partitions 1 .. n. + This configuration does not affect cache partition 0. + +endif # SUIT_CACHE diff --git a/subsys/suit/cache/include/suit_dfu_cache.h b/subsys/suit/cache/include/suit_dfu_cache.h new file mode 100644 index 000000000000..6f4e965541ca --- /dev/null +++ b/subsys/suit/cache/include/suit_dfu_cache.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DFU_CACHE_H__ +#define DFU_CACHE_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* This header has no restrictions on the context in which it can be used. + * Contains functions allowing searching and reading from cache. + * + * ___________________________ ___________________________ ___________________________ + * | dfu_partition | | dfu_cache_partition_1 | | dfu_cache_partition_3 | + * | _______________________ | | _______________________ | | _______________________ | + * | | Envelope | | | | dfu_cache_pool_1 | | | | dfu_cache_pool_3 | | + * | | | | | | (Indefinite CBOR map) | | | | (Indefinite CBOR map) | | + * | | | | | | _____________________ | | | | _____________________ | | + * | | | | | || DFU CACHE SLOT || | | || DFU CACHE SLOT || | + * | | | | | || (entry in CBOR map) || | | || (entry in CBOR map) || | + * | | | | | || ___________________ || | | || ___________________ || | + * | | | | | ||| UNIQUE URI_0 ||| | | ||| UNIQUE URI_2 ||| | + * | | | | | |||___________________||| | | |||___________________||| | + * | | | | | || ___________________ || | | || ___________________ || | + * | |_______________________| | | ||| DATA ||| | | ||| DATA ||| | + * | _______________________ | | |||___________________||| | | |||___________________||| | + * | | dfu_cache_pool_0 | | | ||_____________________|| | | ||_____________________|| | + * | | (Indefinite CBOR map) | | | | | | | | | | + * | | _____________________ | | | | _____________________ | | | | _____________________ | | + * | || DFU CACHE SLOT || | | || DFU CACHE SLOT || | | || DFU CACHE SLOT || | + * | || (entry in CBOR map) || | | || (entry in CBOR map) || | | || (entry in CBOR map) || | + * | || ___________________ || | | || ___________________ || | | || ___________________ || | + * | ||| UNIQUE URI_4 ||| | | ||| UNIQUE URI_1 ||| | | ||| UNIQUE URI_3 ||| | + * | |||___________________||| | | |||___________________||| | | |||___________________||| | + * | || ___________________ || | | || ___________________ || | | || ___________________ || | + * | ||| DATA ||| | | ||| DATA ||| | | ||| DATA ||| | + * | |||___________________||| | | |||___________________||| | | |||___________________||| | + * | ||_____________________|| | | ||_____________________|| | | ||_____________________|| | + * | |_______________________| | | |_______________________| | | |_______________________| | + * |___________________________| |___________________________| |___________________________| + */ + +/* DFU cache is meant as a storage used during update process. It can be used to fetch + * payloads from external sources. DFU cache consists of cache partitions that can be defined + * across all available nonvolatile memories. Each cache partition can hold multiple images. DFU + * cache slot represents area occupied by single image with its identifier (URI stored as CBOR + * tstring). In short, DFU cache consists of partitions, partition contains cache pool (CBOR map), + * cache pool contains slots and one slot holds one "image". As a rule, dfu_cache_pool_0 is + * predefined and occupies free space on the DFU partition, right after the envelope. If there's no + * envelope in DFU partition, suit_cache_0 initialization will fail and it will be unavailable. + * suit_cache_0 size is variable. Other caches can be defined by the user via device tree and must + * follow the naming convention: dfu_cache_partition_N where N is a ordinal number starting at 1. + * It is allowed for the ordinals to skip numbers in the sequence as in example above. + * + * Slot allocation creates initial entry in cache map with tstr uri as key, followed by header + * byte 0x5A and 4 bytes of size. Size is left unwritten. + * Slot closing takes size of data that was written and updates byte string size with that value. + * The indefinite end tag (0xFF), which determines the end of the partition, is written + * at the end. + * + * suit_cache_slot: Describes new allocated/open slot in cache + * - slot_offset: Absolute offset of the slot in the memory. Where the slot header + * starts. + * - size: It follows how much data is written and that value is used to update size in + * cache + * - slot header when the slot is being closed + * - size_offset: offset from slot_offset, points to where size value in header should + * be written + * - data_offset: offset from slot_offset, points to where data begins in slot + * - fdev: pointer to driver associated with cache partition on which slot lays + * + * dfu_cache_pool: Describes single cache pool + * - size: Maximum size of cache, SUIT cache partition size + * - offset: offset were cache begins + * + * dfu_cache: Contains list of all registered cache partitions - cache pool + * - pools_count: Number of registered cache partitions + * - pools: List containing registered partitions + */ + +/* IPC contract */ +struct dfu_cache_pool { /* Structure describing single cache partition */ + size_t size; + uint8_t *address; +}; + +struct dfu_cache { + uint8_t pools_count; + struct dfu_cache_pool pools[CONFIG_SUIT_CACHE_MAX_CACHES]; +}; + +/** + * @brief Initializes SUIT cache in readonly mode for use in contexts other than APP + * + * @param cache Pointer to the SUIT cache structure. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_initialize(struct dfu_cache *cache); + +/** + * @brief Deinitialize SUIT cache + */ +void suit_dfu_cache_deinitialize(void); + +/** + * @brief Clear SUIT cache. + * + * @param cache Pointer to the SUIT cache structure. + */ +void suit_dfu_cache_clear(struct dfu_cache *cache); + +/** + * @brief Search registered caches for data with equal uri key. + * + * @param uri Pointer to URI key value to look for. + * @param uri_size URI size + * @param payload Return pointer to data object if found. + * @param payload_size Return pointer to size of returned payload. + * @return suit_plat_err_t SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_search(const uint8_t *uri, size_t uri_size, const uint8_t **payload, + size_t *payload_size); + +#ifdef __cplusplus +} +#endif + +#endif /* DFU_CACHE_H__ */ diff --git a/subsys/suit/cache/include/suit_dfu_cache_rw.h b/subsys/suit/cache/include/suit_dfu_cache_rw.h new file mode 100644 index 000000000000..8b121e442b26 --- /dev/null +++ b/subsys/suit/cache/include/suit_dfu_cache_rw.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DFU_CACHE_RW_H__ +#define DFU_CACHE_RW_H__ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* This header is meant to be used only from APP core context. + * It extends dfu_cache by adding to cache write and erase capabilities. + */ + +struct suit_cache_slot { + uint8_t *slot_address; + size_t size; + size_t size_offset; + size_t data_offset; + size_t eb_size; +}; + +/** + * @brief Initialize cache in R/W mode for APP context + * + * @note dfu_cache structure is initialized based on dfu_partitions_ext which in turn is + * initialized using SUIT cache partitions information from Device Tree. + * + * @param addr Address of the envelope in DFU partition + * @param size Size of the envelope + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_rw_initialize(void *addr, size_t size); + +/** + * @brief Deinitialize SUIT cache. This will also erase all the cache partitions. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_rw_deinitialize(void); + +/** + * @brief Retrieve information about the address and size of a given cache + * partition. + * + * @param cache_partition_id ID of the cache partition + * @param address address of the cache partition + * @param size size of the cache partition + * + * @return SUIT_PLAT_SUCCESS in case of success + * @return SUIT_PLAT_ERR_NOT_FOUND if the given partition does not exist + */ +suit_plat_err_t suit_dfu_cache_rw_partition_info_get(uint8_t cache_partition_id, + const uint8_t **address, size_t *size); + +/** + * @brief Function tries to allocate slot in cache pointed by ID + * + * @param cache_partition_id ID of the cache partition in which slot should be allocated + * @param slot Pointer to structure that will be filled with allocated slot info + * @param uri URI that will be used as a key in cache cbor map + * @param uri_size URI size + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_rw_slot_create(uint8_t cache_partition_id, + struct suit_cache_slot *slot, + const uint8_t *uri, size_t uri_size); + +/** + * @brief Commits changes written to slot by updating cbor header for the cache slot + * + * @param slot Pointer to opened cache slot + * @param size_used Number of bytes written + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_rw_slot_close(struct suit_cache_slot *slot, size_t size_used); + +/** + * @brief Drop data written to slot and revert slot allocation + * + * @param slot Pointer to slot that should be dropped + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_rw_slot_drop(struct suit_cache_slot *slot); + +#ifdef __cplusplus +} +#endif + +#endif /* DFU_CACHE_RW_H__ */ diff --git a/subsys/suit/cache/src/suit_dfu_cache.c b/subsys/suit/cache/src/suit_dfu_cache.c new file mode 100644 index 000000000000..69209cc445b3 --- /dev/null +++ b/subsys/suit/cache/src/suit_dfu_cache.c @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include "zcbor_encode.h" +#include +#include +#include +#include + +#include "suit_dfu_cache_internal.h" + +LOG_MODULE_REGISTER(dfu_cache, CONFIG_SUIT_LOG_LEVEL); + +static bool init_done; +struct dfu_cache dfu_cache; + +/** + * @brief Check if current_key is same as uri + * + * @param current_key Current key decoded from cache slot + * @param uri Desired uri + * @return true + * @return false + */ +static bool uricmp(const struct zcbor_string *current_key, const struct zcbor_string *uri) +{ + /* Check what type of string is uri */ + if (uri->value[uri->len - 1] == '\0') { + /* uri is null terminated string */ + if ((uri->len - 1) != current_key->len) { + return false; + } + } else { + /* uri is zcbor tstr */ + if (uri->len != current_key->len) { + return false; + } + } + + return !strncmp(current_key->value, uri->value, current_key->len); +} + +/* Match callback context. */ +struct match_uri_ctx { + const struct zcbor_string *uri; + uintptr_t payload_offset; + size_t payload_size; + bool match; +}; + +/** + * @brief Foreach callback for matching. + */ +static bool match_uri(struct dfu_cache_pool *cache_pool, zcbor_state_t *state, + const struct zcbor_string *uri, uintptr_t payload_offset, size_t payload_size, + void *ctx) +{ + struct match_uri_ctx *cb_ctx = ctx; + + cb_ctx->match = uricmp(uri, cb_ctx->uri); + + if (cb_ctx->match) { + cb_ctx->payload_offset = payload_offset; + cb_ctx->payload_size = payload_size; + } + + /* Stop further iteration if URI matches. */ + return !cb_ctx->match; +} + +/** + * @brief Check if cache_pool contains slot with key equal to uri and if true get data + * + * @param cache_pool Cache pool to be searched + * @param uri Desired URI + * @param payload Output pointer to data in slot + * @return suit_plat_err_t SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +static suit_plat_err_t search_cache_pool(struct dfu_cache_pool *cache_pool, + const struct zcbor_string *uri, + struct zcbor_string *payload) +{ + suit_plat_err_t res = SUIT_PLAT_ERR_NOT_FOUND; + + if ((cache_pool != NULL) && (uri != NULL) && (payload != NULL) && + (cache_pool->address != NULL) && (uri->len <= CONFIG_SUIT_MAX_URI_LENGTH)) { + struct match_uri_ctx ctx = { + .match = false, + .uri = uri, + }; + res = suit_dfu_cache_partition_slot_foreach(cache_pool, match_uri, &ctx); + + if (ctx.match) { + payload->value = (uint8_t *)ctx.payload_offset; + payload->len = ctx.payload_size; + res = SUIT_PLAT_SUCCESS; + } else { + res = SUIT_PLAT_ERR_NOT_FOUND; + } + + return res; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_search(const uint8_t *uri, size_t uri_size, const uint8_t **payload, + size_t *payload_size) +{ + if ((uri != NULL) && (uri_size != 0)) { + struct zcbor_string tmp_payload = {.len = 0, .value = NULL}; + struct zcbor_string tmp_uri = {.len = uri_size, .value = uri}; + + for (size_t i = 0; i < dfu_cache.pools_count; i++) { + suit_plat_err_t ret = + search_cache_pool(&dfu_cache.pools[i], &tmp_uri, &tmp_payload); + + if (ret == SUIT_PLAT_SUCCESS) { + *payload = tmp_payload.value; + *payload_size = tmp_payload.len; + + return ret; + } + } + + return SUIT_PLAT_ERR_NOT_FOUND; + } + + return SUIT_PLAT_ERR_INVAL; +} + +void suit_dfu_cache_clear(struct dfu_cache *cache) +{ + if (cache == NULL) { + return; + } + + for (size_t i = 0; i < cache->pools_count; i++) { + cache->pools[i].address = NULL; + cache->pools[i].size = 0; + } +} + +/** + * @brief Copy the pointers between SUIT cache structures. + * + * @note This operation does not make a copy of the data, pointed by the caches. + * It copies the pointers to the data, so the contents may be referred from both of the + * structures. + * + * @param dst_cache Destination cache to be aligned. + * @param src_cache Source cache to be copied. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +static suit_plat_err_t suit_dfu_cache_copy(struct dfu_cache *dst_cache, + const struct dfu_cache *src_cache) +{ + if (src_cache->pools_count > CONFIG_SUIT_CACHE_MAX_CACHES) { + return SUIT_PLAT_ERR_NOMEM; + } + + dst_cache->pools_count = src_cache->pools_count; + memcpy(&(dst_cache->pools), src_cache->pools, + src_cache->pools_count * sizeof(struct dfu_cache_pool)); + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_dfu_cache_initialize(struct dfu_cache *cache) +{ + if (init_done) { + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + suit_plat_err_t ret = suit_dfu_cache_copy(&dfu_cache, cache); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Copying cache from storage, failed: %i", ret); + return ret; + } + + init_done = true; + + return SUIT_PLAT_SUCCESS; +} + +void suit_dfu_cache_deinitialize(void) +{ + suit_dfu_cache_clear(&dfu_cache); + init_done = false; +} diff --git a/subsys/suit/cache/src/suit_dfu_cache_helpers.c b/subsys/suit/cache/src/suit_dfu_cache_helpers.c new file mode 100644 index 000000000000..32fabdec85e4 --- /dev/null +++ b/subsys/suit/cache/src/suit_dfu_cache_helpers.c @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include "zcbor_encode.h" +#include + +#include +#include "suit_dfu_cache_internal.h" +#include "suit_ram_sink.h" +#include "zcbor_noncanonical_decode.h" + +LOG_MODULE_REGISTER(dfu_cache_helpers, CONFIG_SUIT_LOG_LEVEL); + +suit_plat_err_t suit_dfu_cache_partition_slot_foreach(struct dfu_cache_pool *cache_pool, + partition_slot_foreach_cb cb, void *ctx) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + zcbor_state_t states[4]; + struct zcbor_string uri; + struct zcbor_string_fragment data_fragment; + bool first_iteration = true; + bool result = true; + uintptr_t current_offset = 0; + uint8_t partition_header_storage[CACHE_METADATA_MAX_LENGTH]; + + LOG_DBG("Foreach on cache %p(size:%u)", (void *)cache_pool->address, cache_pool->size); + + zcbor_new_decode_state(states, ZCBOR_ARRAY_SIZE(states), NULL, 0, 1, NULL, 0); + + do { + uintptr_t current_address = (uintptr_t)cache_pool->address + current_offset; + size_t cache_remaining_size = cache_pool->size - current_offset; + size_t read_size = MIN(sizeof(partition_header_storage), cache_remaining_size); + + if (cache_remaining_size == 0) { + /* If the end of cache partition is reached and the last element was + * decoded correctly, end with a success (even though no end of marker + * is present). Handling such a case separately is necessary, as padding + * always ends at an address aligned to the erase block size, and the + * partition size also should aligned to the eb size, thus not leaving + * space for the single byte end of map marker. + */ + break; + } + + err = suit_dfu_cache_memcpy(partition_header_storage, current_address, read_size); + + if (err != SUIT_PLAT_SUCCESS) { + break; + } + + LOG_HEXDUMP_DBG(partition_header_storage, MIN(read_size, 16), "Memory content"); + + /* The CBOR on the cache is processed in parts. + * The partition_header_storage is large enough to store the indefinite map header + * at the beginning of the cache partition, an URI TSTR, and a BSTR header of the + * payload. + * + * The zcbor state is first initialized to where the indefinite map header + * is supposed to be. If there is not indefinite map header tag, then the + * partition is corrupted and no further processing is done. + * + * At the start of each iteration, it is detected if the end of the map was reached + * by checking if the next byte is 0xFF. For an indefinite length map, this is + * the map end indicator, for a definite length map, this means that the rest of + * the memory is erased, so the map is considered to be ended. + * If the end of the map is detected, the loop is exited and the function succeeds. + * + * In second step the TSTR is parsed. If a correct TSTR is found, we move to the + * next step. Otherwise we bail. + * + * In third step the BSTR header is decoded. The zcbor_bstr_start_decode_fragment + * pushes a zcbor backup. Since we won't be decoding any further BSTR fragments, + * the backup is immediately restored (zcbor_process_backup). + * + * If correct URI and payload was found, a user-provided callback is executed. + * + * Lastly, we calculate the next address at which the next URI TSTR is supposed + * to be and repeat the whole process. + */ + + zcbor_update_state(states, partition_header_storage, read_size); + if (first_iteration) { + result = zcbor_noncanonical_map_start_decode(states); + first_iteration = false; + if (!result) { + err = SUIT_PLAT_ERR_CBOR_DECODING; + } + } + + if (partition_header_storage[0] == 0xFF) { + break; + } + + if (result) { + result = zcbor_tstr_decode(states, &uri); + } + + if (result) { + LOG_HEXDUMP_DBG(uri.value, uri.len, "Currently iterated URI"); + result = zcbor_noncanonical_bstr_start_decode_fragment(states, + &data_fragment); + result = result && + zcbor_process_backup(states, + ZCBOR_FLAG_RESTORE | ZCBOR_FLAG_CONSUME | + ZCBOR_FLAG_KEEP_PAYLOAD, + ZCBOR_MAX_ELEM_COUNT); + } + + if (!result) { + err = SUIT_PLAT_ERR_CBOR_DECODING; + break; + } + + off_t bstr_data_offset = data_fragment.fragment.value - partition_header_storage; + + if (data_fragment.total_len > cache_remaining_size - bstr_data_offset) { + /* The bstr data would exceed the remaining size of the cache partition */ + err = SUIT_PLAT_ERR_CBOR_DECODING; + break; + } + + if (cb) { + uintptr_t data_address = current_address + bstr_data_offset; + + result = cb(cache_pool, states, &uri, data_address, data_fragment.total_len, + ctx); + } + + current_offset += (data_fragment.total_len + bstr_data_offset); + } while (result); + + return err; +} + +suit_plat_err_t suit_dfu_cache_partition_is_initialized(struct dfu_cache_pool *partition) +{ + suit_plat_err_t err; + + if (partition != NULL) { + err = suit_dfu_cache_partition_slot_foreach(partition, NULL, NULL); + if (err == SUIT_PLAT_ERR_CBOR_DECODING) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_partition_is_empty(struct dfu_cache_pool *cache_pool) +{ + uint8_t *address = cache_pool->address; + size_t remaining = cache_pool->size; + uint8_t buffer[128]; + const size_t chunk_size = sizeof(buffer); + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + + while (remaining > 0) { + size_t read_size = MIN(chunk_size, remaining); + + ret = suit_dfu_cache_memcpy(buffer, (uintptr_t)address, read_size); + if (ret != SUIT_PLAT_SUCCESS) { + break; + } + + for (int i = 0; i < read_size; i++) { + if (buffer[i] != 0xFF) { + return SUIT_PLAT_ERR_NOMEM; + } + } + + remaining -= read_size; + } + + return ret; +} + +static bool find_free_address(struct dfu_cache_pool *cache_pool, zcbor_state_t *state, + const struct zcbor_string *uri, uintptr_t payload_offset, + size_t payload_size, void *ctx) +{ + uintptr_t *ret = ctx; + *ret = payload_offset + payload_size; + + return true; +} + +suit_plat_err_t suit_dfu_cache_partition_find_free_space(struct dfu_cache_pool *partition, + uintptr_t *free_address, bool *needs_erase) +{ + uintptr_t address = (uintptr_t)partition->address; + suit_plat_err_t ret; + uint8_t partition_buffer[2]; + + *free_address = 0; + *needs_erase = false; + + ret = suit_dfu_cache_partition_slot_foreach(partition, find_free_address, &address); + + if (ret == SUIT_PLAT_SUCCESS) { + ret = suit_dfu_cache_memcpy(partition_buffer, address, sizeof(partition_buffer)); + } + + if (ret == SUIT_PLAT_SUCCESS) { + if (partition_buffer[0] == 0xBF) { + address++; + } + if (partition_buffer[1] != 0xFF) { + *needs_erase = true; + } + *free_address = address; + } + + return ret; +} + +suit_plat_err_t suit_dfu_cache_memcpy(uint8_t *destination, uintptr_t source, size_t size) +{ + suit_plat_err_t ret; + suit_address_streamer stream_fn; + struct stream_sink sink; + + if (size == 0) { + return SUIT_PLAT_SUCCESS; + } + + ret = suit_ram_sink_get(&sink, destination, size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Could not acquire RAM sink: %d", ret); + return ret; + } + + stream_fn = suit_address_streamer_select_by_address((uint8_t *)source); + if (stream_fn == NULL) { + LOG_ERR("Could not find streamer for address: %p", (void *)source); + ret = SUIT_PLAT_ERR_IO; + } + + if (ret == SUIT_PLAT_SUCCESS) { + ret = stream_fn((uint8_t *)source, size, &sink); + } + + if (sink.release) { + suit_plat_err_t ret2 = sink.release(sink.ctx); + + if (ret2 != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to release sink: %d", ret2); + } + + /* Prevent result of sink.release from obscuring previous errors. */ + ret = ret == SUIT_PLAT_SUCCESS ? ret2 : ret; + } + + return ret; +} diff --git a/subsys/suit/cache/src/suit_dfu_cache_internal.h b/subsys/suit/cache/src/suit_dfu_cache_internal.h new file mode 100644 index 000000000000..99b5a0dc616b --- /dev/null +++ b/subsys/suit/cache/src/suit_dfu_cache_internal.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DFU_CACHE_INTERNAL_H__ +#define DFU_CACHE_INTERNAL_H__ + +#include +#include +#include +#include +#include +#include + +/* Adding 5 bytes for bstring header and 1 byte for indefinite map header and + * 9 bytes for tstr + */ +#define CACHE_METADATA_MAX_LENGTH (CONFIG_SUIT_MAX_URI_LENGTH + 5 + 1 + 9) + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Callback to be passed to the @ref suit_dfu_cache_partition_slot_foreach function + * + * @param cache_pool Pointer to the SUIT cache pool structure. + * @param state zcbor state of the current slot. + * @param uri URI of the current slot + * @param payload_offset Offset of the payload. May be located in external storage area. + * @param payload_size Size of the payload. + * @param ctx Additional callback context. + * + * @return True continues iteration, false causes the caller to stop subsequent iterations. + */ +typedef bool (*partition_slot_foreach_cb)(struct dfu_cache_pool *cache_pool, zcbor_state_t *state, + const struct zcbor_string *uri, uintptr_t payload_offset, + size_t payload_size, void *ctx); + +/** + * @brief Iterates over cache slots and executes a provided callback. + * + * The foreach operation reads the URI of each slot in the cache partition, acquires the + * payload address and size and executes a provided callback. The callback may be NULL. + * In such case, the function can be used to validate that the cache partition is not + * corrupted. If the callback returns false, further iteration is stopped and the + * function returns success. + * + * @param cache_pool Pointer to the SUIT cache structure. + * @param cb Callback pointer. May be NULL. + * @param ctx Additional callback context. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_partition_slot_foreach(struct dfu_cache_pool *cache_pool, + partition_slot_foreach_cb cb, void *ctx); + +/** + * @brief Check if cache partition is initialized. + * + * @param cache_pool Pointer to the SUIT cache pool structure. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_partition_is_initialized(struct dfu_cache_pool *cache_pool); + +/** + * @brief Check if cache partition content is erased. + * + * @param cache_pool Pointer to the SUIT cache structure. + * + * @return SUIT_PLAT_SUCCESS in case of success, SUIT_PLAT_ERR_NOMEM if partition is not empty, + * otherwise an error code + */ +suit_plat_err_t suit_dfu_cache_partition_is_empty(struct dfu_cache_pool *cache_pool); + +/** + * @brief Find a free slot in the cache partition. + * + * @param cache_pool Pointer to the SUIT cache pool structure. + * @param address Return value pointing to free space within the cache partition. + * @param needs_erase Indicates that the memory must be erased before it's written to. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_partition_find_free_space(struct dfu_cache_pool *cache_pool, + uintptr_t *address, + bool *needs_erase); + +/** + * @brief Memcpy-like helper for writing streamable data into a memory buffer. + * + * @param destination Destination address. + * @param source Source address that can map into MCU RAM/ROM memory or into external memory + * region. + * @param size Read size. + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_memcpy(uint8_t *destination, uintptr_t source, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* DFU_CACHE_INTERNAL_H__ */ diff --git a/subsys/suit/cache/src/suit_dfu_cache_rw.c b/subsys/suit/cache/src/suit_dfu_cache_rw.c new file mode 100644 index 000000000000..881876f41e09 --- /dev/null +++ b/subsys/suit/cache/src/suit_dfu_cache_rw.c @@ -0,0 +1,820 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include "zcbor_encode.h" +#include +#include +#include +#include +#include + +#include "suit_dfu_cache_internal.h" +#include + +LOG_MODULE_REGISTER(suit_cache_rw, CONFIG_SUIT_LOG_LEVEL); + +#ifndef BSWAP_32 +#define BSWAP_32 __bswap_32 +#endif + +#ifndef BSWAP_16 +#define BSWAP_16 __bswap_16 +#endif + +#define SUCCESS 0 +#define INDEFINITE_MAP_HEADER 0xBF + +/* BF + * tstr_header - max 9 bytes 0x7b UTF-8 string (eight-byte uint64_t for n, and then n bytes follow) + * CONFIG_SUIT_MAX_URI_LENGTH + * 5A 0 0 0 0 + * FF + */ +#define MIN_VALID_PARTITION_SIZE (CONFIG_SUIT_MAX_URI_LENGTH + 16) + +#define ENCODING_OUTPUT_BUFFER_LENGTH CACHE_METADATA_MAX_LENGTH + +/* Adding 9 bytes for max length tstr header*/ +#define MAX_URI_ENCODE_BUFFER_LENGTH (CONFIG_SUIT_MAX_URI_LENGTH + 9) + +extern struct dfu_cache dfu_cache; +static bool prevent_second_init; + +struct dfu_cache_partition_ext { /* Extended structure describing single cache partition */ + const struct device *fdev; + size_t size; + uint8_t *address; + size_t eb_size; + uint8_t id; +}; + +#define PARTITION_INIT(index, label) \ + { \ + .fdev = FIXED_PARTITION_DEVICE(label), \ + .address = (uint8_t *)FIXED_PARTITION_OFFSET(label), \ + .size = FIXED_PARTITION_SIZE(label), \ + .eb_size = CONFIG_SUIT_CACHEX_ERASE_BLOCK_SIZE, \ + .id = index, \ + }, + +#define INDEX_IN_RAGE(index) IN_RANGE(index, 1, (CONFIG_SUIT_CACHE_MAX_CACHES - 1)) +#define PARTITION_IS_USABLE(label) \ + UTIL_AND(FIXED_PARTITION_EXISTS(label), \ + DT_NODE_HAS_STATUS(DT_MTD_FROM_FIXED_PARTITION(DT_NODELABEL(label)), okay)) + +#define PARTITION_INIT_IF_INDEX_OK(label, index) \ + IF_ENABLED(UTIL_BOOL(INDEX_IN_RANGE(index)), (PARTITION_INIT(index, label))) + +#define PARTITION_DEFINE_(index, label) \ + IF_ENABLED(PARTITION_IS_USABLE(label), (PARTITION_INIT_IF_INDEX_OK(label, index))) + +#define PARTITION_DEFINE(index, prefix) PARTITION_DEFINE_(index, prefix##index) + +static struct dfu_cache_partition_ext dfu_partitions_ext[] = { + { + .fdev = FIXED_PARTITION_DEVICE(dfu_partition), + .address = (uint8_t *)FIXED_PARTITION_OFFSET(dfu_partition), + .size = FIXED_PARTITION_SIZE(dfu_partition), + .eb_size = FLASH_AREA_ERASE_BLOCK_SIZE(dfu_partition), + .id = 0, + }, + LISTIFY(CONFIG_SUIT_CACHE_MAX_CACHES, PARTITION_DEFINE, (), dfu_cache_partition_)}; + +static suit_plat_err_t partition_initialize(struct dfu_cache_partition_ext *part); +static suit_plat_err_t cache_0_update(uint8_t *address, size_t size); +static struct dfu_cache_partition_ext *cache_partition_get(uint8_t partition_id); +static suit_plat_err_t slot_in_cache_partition_allocate(const struct zcbor_string *uri, + struct suit_cache_slot *slot, + struct dfu_cache_partition_ext *part); +static suit_plat_err_t cache_free_space_check(struct dfu_cache_partition_ext *part, + struct suit_cache_slot *slot); +static suit_plat_err_t erase_on_sink(uint8_t *address, size_t size); + +/** + * @brief Get cache partition of specified id + * + * @param partition_id Integer from partition label from dts. + * For example if partition label is dfu_cache_partition_3 than 3 is partition id. + * @return struct dfu_cache_partition_ext* In case of success pointer to partition or + * NULL if requested partition was not found + */ +static struct dfu_cache_partition_ext *cache_partition_get(uint8_t partition_id) +{ + for (size_t i = 0; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + if (dfu_partitions_ext[i].id == partition_id) { + return &dfu_partitions_ext[i]; + } + } + + return NULL; +} + +/** + * @brief Get the cache partition containing offset + * + * @param offset Offset in desired partition + * @return struct dfu_cache_partition_ext* or NULL in case of error + */ +static struct dfu_cache_partition_ext *cache_partition_get_by_address(uint8_t *address) +{ + for (size_t i = 0; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + if ((address >= dfu_partitions_ext[i].address) && + (address < (dfu_partitions_ext[i].address + dfu_partitions_ext[i].size))) { + return &dfu_partitions_ext[i]; + } + } + + return NULL; +} + +static bool translate_partition_start_address(struct dfu_cache_partition_ext *part) +{ + struct nvm_address addr = { + .fdev = part->fdev, + .offset = (uintptr_t)part->address, + }; + + uintptr_t ret; + + if (!suit_memory_nvm_address_to_global_address(&addr, &ret)) { + LOG_ERR("Address not translated: %p(dev):%lX", (void *)addr.fdev, addr.offset); + return false; + } + + LOG_DBG("Address translated: %p(dev):%lX -> %p", (void *)addr.fdev, addr.offset, + (void *)ret); + part->address = (uint8_t *)ret; + + return true; +} + +static bool setup_partition_addresses(void) +{ + for (size_t i = 0; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + if (!translate_partition_start_address(&dfu_partitions_ext[i])) { + return false; + } + } + + return true; +} + +suit_plat_err_t suit_dfu_cache_rw_initialize(void *addr, size_t size) +{ + if (prevent_second_init) { + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + prevent_second_init = true; + + suit_plat_err_t ret = cache_0_update(addr, size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + dfu_cache.pools_count = ARRAY_SIZE(dfu_partitions_ext); + + for (size_t i = 1; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + /* Check if partition already has valid cache and if not initialize */ + ret = partition_initialize(&dfu_partitions_ext[i]); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_WRN("suit_cache_%u initialization failed: %i", dfu_partitions_ext[i].id, + ret); + } + } + + for (size_t i = 0; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + dfu_cache.pools[i].size = dfu_partitions_ext[i].size; + dfu_cache.pools[i].address = dfu_partitions_ext[i].address; + LOG_INF("Found partition %d: id: %u, (addr: %p, size: 0x%x)", i, + dfu_partitions_ext[i].id, (void *)dfu_cache.pools[i].address, + dfu_cache.pools[i].size); + } + + return suit_dfu_cache_initialize(&dfu_cache); +} + +suit_plat_err_t suit_dfu_cache_rw_deinitialize(void) +{ + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + + suit_dfu_cache_deinitialize(); + suit_dfu_cache_clear(&dfu_cache); + + /* Erase all cache partitions */ + for (size_t i = 0; i < ARRAY_SIZE(dfu_partitions_ext); i++) { + suit_plat_err_t ret2; + + struct dfu_cache_pool cache_pool = { + .address = dfu_partitions_ext[i].address, + .size = dfu_partitions_ext[i].size, + }; + + ret2 = suit_dfu_cache_partition_is_empty(&cache_pool); + + if (ret2 == SUIT_PLAT_ERR_NOMEM) { + ret2 = erase_on_sink(dfu_partitions_ext[i].address, + dfu_partitions_ext[i].size); + } + + if (ret2 != SUIT_PLAT_SUCCESS) { + ret = ret2; + } + } + + /* Reset cache pool 0 to its initial state */ + dfu_partitions_ext[0].address = (uint8_t *)FIXED_PARTITION_OFFSET(dfu_partition); + dfu_partitions_ext[0].size = FIXED_PARTITION_SIZE(dfu_partition); + if (!translate_partition_start_address(&dfu_partitions_ext[0])) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + prevent_second_init = false; + + return ret; +} + +suit_plat_err_t suit_dfu_cache_rw_partition_info_get(uint8_t cache_partition_id, + const uint8_t **address, size_t *size) +{ + struct dfu_cache_partition_ext *partition = cache_partition_get(cache_partition_id); + + if (partition == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + *address = partition->address; + *size = partition->size; + + return SUIT_PLAT_SUCCESS; +} + +/** + * @brief Write to nvm via flash_sink + * + * @param address Target address + * @param data Data to be written + * @param size Size of data to be written + * @return suit_plat_err_t SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +static suit_plat_err_t write_to_sink(uint8_t *address, uint8_t *data, size_t size) +{ + struct stream_sink sink; + + suit_plat_err_t ret = suit_flash_sink_get(&sink, address, size); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting flash_sink failed. %i", ret); + return SUIT_PLAT_ERR_IO; + } + + ret = sink.write(sink.ctx, data, size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Writing to sink failed. %i", ret); + + if (sink.release(sink.ctx) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + } + + return SUIT_PLAT_ERR_IO; + } + + ret = sink.release(sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + return ret; + } + + return SUIT_PLAT_SUCCESS; +} + +/** + * @brief Use flash_sink to erase nvm region + * + * @param offset Target offset in NVM + * @param size Size of region to be erased + * @return suit_plat_err_t SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +static suit_plat_err_t erase_on_sink(uint8_t *address, size_t size) +{ + struct stream_sink sink; + + LOG_DBG("Erasing memory: %p(size:%u)", (void *)address, size); + + suit_plat_err_t ret = suit_flash_sink_get(&sink, address, size); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting flash_sink failed. %i", ret); + return SUIT_PLAT_ERR_IO; + } + + ret = sink.erase(sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Erasing on sink failed. %i", ret); + + if (sink.release(sink.ctx) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + } + + return SUIT_PLAT_ERR_IO; + } + + ret = sink.release(sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + return ret; + } + + return SUIT_PLAT_SUCCESS; +} + +/** + * @brief Creates indefinite map at given offset by adding appropriate header and end marker + * + * @param part Pointer to cache partition structure + * @return SUIT_PLAT_SUCCESS on success, otherwise error code + */ +static suit_plat_err_t partition_initialize(struct dfu_cache_partition_ext *part) +{ + struct dfu_cache_pool cache_pool = { + .address = part->address, + .size = part->size, + }; + + if (part != NULL) { + if (part->size >= MIN_VALID_PARTITION_SIZE) { + LOG_INF("Partition %u: address(%p) size(%u)", part->id, + (void *)part->address, part->size); + + suit_plat_err_t ret = suit_dfu_cache_partition_is_empty(&cache_pool); + + if (ret == SUIT_PLAT_ERR_CRASH) { + return ret; + } + + if (ret == SUIT_PLAT_ERR_NOMEM) { + ret = suit_dfu_cache_partition_is_initialized(&cache_pool); + + if (ret == SUIT_PLAT_SUCCESS) { + return ret; + } + + LOG_INF("Erasing partition %p(size:%d) on init", + (void *)part->address, part->size); + ret = erase_on_sink(part->address, part->size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Partition too small to fit CBOR headers (%d)", part->size); + return SUIT_PLAT_ERR_NOMEM; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +/** + * @brief Check size of available free space in given cache and get allocable slot info + * + * @param cache Pointer to structure with information about single cache + * @param slot Pointer to structure that will contain allocable slot info + * @return SUIT_PLAT_SUCCESS on success, otherwise error code + */ +static suit_plat_err_t cache_free_space_check(struct dfu_cache_partition_ext *part, + struct suit_cache_slot *slot) +{ + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + uintptr_t part_tmp_address; + bool needs_erase = false; + + struct dfu_cache_pool cache_pool = { + .address = part->address, + .size = part->size, + }; + + if ((part != NULL) && (slot != NULL)) { + part_tmp_address = (uintptr_t)part->address; + if (suit_dfu_cache_partition_is_empty(&cache_pool) != SUIT_PLAT_SUCCESS) { + ret = suit_dfu_cache_partition_find_free_space( + &cache_pool, &part_tmp_address, &needs_erase); + if (ret == SUIT_PLAT_ERR_CBOR_DECODING) { + part_tmp_address = (uintptr_t)part->address; + ret = SUIT_PLAT_SUCCESS; + } + } + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Free space was not found: %d", ret); + return ret; + } + + LOG_INF("partition address %p", (void *)part->address); + LOG_INF("partition size: %X", part->size); + LOG_INF("partition tmp address: %lX", part_tmp_address); + + /* Subtract additional 1 byte to account for required indefinite map end marker + * which needs to fit within cache partition boundary. + */ + slot->size = (((uintptr_t)part->address + part->size) > part_tmp_address) + ? (size_t)part->address + part->size - part_tmp_address - 1 + : 0; + + if ((part->address == slot->slot_address) && (slot->size > 0)) { + /* This is a first slot at the beginning of the partition so we have to + * take into account required indefinite map header that will be added. + * We subtract its size. + */ + slot->size--; + } + + slot->slot_address = (uint8_t *)part_tmp_address; + + if (!needs_erase) { + return SUIT_PLAT_SUCCESS; + } + + /* Clear corrupted slot */ + if (suit_dfu_cache_rw_slot_drop(slot) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Clearing corrupted cache pool failed"); + return SUIT_PLAT_ERR_CRASH; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument. NULL pointer."); + return SUIT_PLAT_ERR_INVAL; +} + +/** + * @brief If possible allocate new slot in given cache partition + * + * @param uri URI that will be used as a key in cache map + * @param slot Pointer to structure containing allocated slot inforamation + * @param cache_index Index of cache in which slot shall be allocated + * @return SUIT_PLAT_SUCCESS on success, otherwise error code + */ +static suit_plat_err_t slot_in_cache_partition_allocate(const struct zcbor_string *uri, + struct suit_cache_slot *slot, + struct dfu_cache_partition_ext *part) +{ + size_t encoded_size = 0; + uint8_t output[ENCODING_OUTPUT_BUFFER_LENGTH]; + uint8_t *output_ptr = output; + zcbor_state_t states[3]; + + if ((uri != NULL) && (slot != NULL) && (part != NULL)) { + if (uri->len > CONFIG_SUIT_MAX_URI_LENGTH) { + LOG_ERR("URI longer than defined maximum CONFIG_SUIT_MAX_URI_LENGTH: %u", + CONFIG_SUIT_MAX_URI_LENGTH); + return SUIT_PLAT_ERR_NOMEM; + } + + /* Check if uri is not a duplicate */ + const uint8_t *payload = NULL; + size_t payload_size = 0; + + suit_plat_err_t ret = + suit_dfu_cache_search(uri->value, uri->len, &payload, &payload_size); + + if (ret == SUIT_PLAT_SUCCESS) { + /* Key URI is a duplicate */ + LOG_ERR("Key URI already exists."); + return SUIT_PLAT_ERR_EXISTS; + } + + /* Check how much free space is in given cache pool*/ + ret = cache_free_space_check(part, slot); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Insufficient free space in cache"); + return ret; + } + + if (slot->slot_address == part->address) { + output[0] = INDEFINITE_MAP_HEADER; + output_ptr++; + } + + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), output_ptr, + MAX_URI_ENCODE_BUFFER_LENGTH, 1, NULL, 0); + + if (!zcbor_tstr_encode(states, uri)) { + return SUIT_PLAT_ERR_CRASH; + } + + encoded_size = (size_t)states[0].payload - (size_t)output; + + /* 0x5A - byte string (four-byte uint32_t for n, and then n bytes follow) */ + output[encoded_size++] = 0x5A; + slot->size_offset = encoded_size; + + /* Fill 4 size bytes to 0xFF so that they can be written later during slot closing + */ + memset(&output[encoded_size], 0xFF, 4); + encoded_size += 4; + + if (slot->size < encoded_size) { + LOG_ERR("Not enough free space in slot to write header."); + return SUIT_PLAT_ERR_NOMEM; + } + + ret = write_to_sink(slot->slot_address, output, encoded_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Writing slot header failed. %i", ret); + return SUIT_PLAT_ERR_IO; + } + + slot->data_offset = encoded_size; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +/** + * @brief Update size and offset of suit_cache_0 partition based of envelope location + * + * @param address DFU partition address + * @param size DFU partition size + * + * @return SUIT_PLAT_SUCCESS on success, otherwise error code + */ +static suit_plat_err_t cache_0_update(uint8_t *address, size_t size) + +{ + if ((address == NULL) || (size == 0)) { + LOG_WRN("Initialized with empty DFU partition"); + dfu_partitions_ext[0].size = 0; + return SUIT_PLAT_SUCCESS; + } + + uint8_t *cache_0_end = dfu_partitions_ext[0].address + dfu_partitions_ext[0].size; + + /* Check if update address is in dfu_partition range */ + if ((address < dfu_partitions_ext[0].address) || (address >= cache_0_end)) { + LOG_ERR("Envelope address doesn't match dfu_partition"); + return SUIT_PLAT_ERR_INVAL; + } + + if (((uint8_t *)address + size > cache_0_end)) { + LOG_ERR("Envelope exceeds dfu_partition"); + return SUIT_PLAT_ERR_INVAL; + } + + uint8_t *tmp_offset = address + size; + /* Align to nearest erase block */ + tmp_offset = + (uint8_t *)(DIV_ROUND_UP((uintptr_t)tmp_offset, dfu_partitions_ext[0].eb_size) * + dfu_partitions_ext[0].eb_size); + + if (tmp_offset >= cache_0_end) { + LOG_WRN("No free space for cache"); + dfu_partitions_ext[0].size = 0; + } else { + /* Set offset to the end of the envelope */ + dfu_partitions_ext[0].address = tmp_offset; + + /* Calculate remaining free space in dfu_partition */ + dfu_partitions_ext[0].size = cache_0_end - tmp_offset; + } + + if (dfu_partitions_ext[0].size > 0) { + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; +#if CONFIG_SUIT_CACHE0_ERASE_ON_ENVELOPE_STORED + ret = erase_on_sink(dfu_partitions_ext[0].address, dfu_partitions_ext[0].size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } +#endif /* CONFIG_SUIT_CACHE0_ERASE_ON_ENVELOPE_STORED */ + + return partition_initialize(&dfu_partitions_ext[0]); + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_dfu_cache_rw_slot_create(uint8_t cache_partition_id, + struct suit_cache_slot *slot, const uint8_t *uri, + size_t uri_size) +{ + if ((slot != NULL) && (uri != NULL) && (uri_size > 0)) { + struct zcbor_string tmp_uri = {.value = uri, .len = uri_size}; + + if (uri[uri_size - 1] == '\0') { + tmp_uri.len--; + } + + struct dfu_cache_partition_ext *part = cache_partition_get(cache_partition_id); + + if (part == NULL) { + LOG_ERR("Partition not found"); + return SUIT_PLAT_ERR_NOT_FOUND; + } + + slot->eb_size = part->eb_size; + suit_plat_err_t ret = slot_in_cache_partition_allocate(&tmp_uri, slot, part); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Allocating slot in cache failed: %d", ret); + return ret; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument. NULL pointer."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_rw_slot_close(struct suit_cache_slot *slot, size_t size_used) +{ + if ((slot != NULL) && (slot->size >= size_used)) { + uint32_t tmp = BSWAP_32(size_used); + size_t tmp_size = sizeof(uint32_t); + size_t end_address = (size_t)slot->slot_address + slot->data_offset + size_used; + + /* Update byte string size */ + if (write_to_sink(slot->slot_address + slot->size_offset, (uint8_t *)&tmp, + tmp_size) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Updating cache slot size in header failed."); + return SUIT_PLAT_ERR_IO; + } + + struct dfu_cache_partition_ext *part = + cache_partition_get_by_address(slot->slot_address); + if (part == NULL) { + LOG_ERR("Couldn't find partition matching slot offset"); + return SUIT_PLAT_ERR_IO; + } + + tmp_size = (slot->data_offset + size_used); + size_t padding_size = ROUND_UP(tmp_size, slot->eb_size) - tmp_size; + + /* Minimal size of an entry in the map is 2: + * 0x60 - empty uri "" + * 0x40 - empty byte string h'' + */ + if (padding_size == 1) { + padding_size += slot->eb_size; + } + + if ((size_used + padding_size) > slot->size) { + LOG_ERR("Padding (header + bytes) would overflow slot boundaries"); + return SUIT_PLAT_ERR_NOMEM; + } + + LOG_DBG("Number of padding bytes required: %u", padding_size); + + if (padding_size > 0) { + /* Assumed worst case scenario is that padding size is not bigger than + * uint16 + */ + uint8_t header[] = {0x60, 0, 0, 0}; + size_t header_size = 0; + + if (padding_size <= 23) { + header_size = 2; + padding_size -= header_size; + header[1] = + 0x40 + + padding_size; /* byte string (0x00..0x17 bytes follow) */ + } else if (padding_size <= UINT16_MAX) { + header_size = 4; + padding_size -= header_size; + /* byte string (two-byte uint16_t for n, and then n bytes follow) */ + header[1] = 0x59; + *(uint16_t *)(&header[2]) = BSWAP_16(padding_size); + } else { + LOG_ERR("Number of required padding bytes exceeds assumed max size " + "0xFFFF"); + return SUIT_PLAT_ERR_INVAL; + } + + if (write_to_sink((uint8_t *)end_address, header, header_size)) { + LOG_ERR("Writing CBOR cache slot header for padding failed."); + return SUIT_PLAT_ERR_IO; + } + + end_address += header_size; + + tmp_size = 1; + for (size_t i = 0; i < padding_size; i++) { + if (write_to_sink((uint8_t *)(end_address + i), &(uint8_t){0}, + tmp_size)) { + LOG_ERR("Writing padding byte failed."); + return SUIT_PLAT_ERR_IO; + } + } + + end_address += padding_size; + } + + /* To be used as end marker */ + tmp = 0xFFFFFFFF; + tmp_size = 1; + + /* Add indefinite map, end marker 0xFF */ + if (write_to_sink((uint8_t *)end_address, (uint8_t *)&tmp, tmp_size) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Writing CBOR map end marker to cache partition failed."); + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument. NULL pointer or invalid size."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_rw_slot_drop(struct suit_cache_slot *slot) +{ + LOG_INF("DROPPING SLOT"); + uint8_t map_header; + + if (slot != NULL) { + struct dfu_cache_partition_ext *part = + cache_partition_get_by_address(slot->slot_address); + + if (part == NULL) { + LOG_ERR("Couldn't find partition matching slot offset"); + return SUIT_PLAT_ERR_IO; + } + + uint8_t *erase_address = slot->slot_address; + size_t erase_size = (part->address + part->size) - slot->slot_address; + size_t write_size = 1; + + LOG_INF("Erase area: (addr: %p, size: 0x%x)", slot->slot_address, part->size); + if (erase_size < slot->eb_size) { + LOG_ERR("Unable to erase area: (addr: %p, size: 0x%x)", slot->slot_address, + erase_size); + return SUIT_PLAT_ERR_IO; + } + + suit_plat_err_t ret = suit_dfu_cache_memcpy( + &map_header, (uintptr_t)slot->slot_address, sizeof(map_header)); + + if (ret > 0) { + LOG_ERR("Read from cache failed: %d", ret); + return ret; + } + + bool add_map_header = false; + + if (map_header == INDEFINITE_MAP_HEADER) { + add_map_header = true; + } + + ret = erase_on_sink(erase_address, erase_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Erasing cache failed: %i", ret); + return SUIT_PLAT_ERR_IO; + } + + if (add_map_header) { + LOG_DBG("Restore map header (%p)", slot->slot_address); + int ret = write_to_sink(erase_address, &(uint8_t){INDEFINITE_MAP_HEADER}, + write_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to restore slot after erase: %i", ret); + return SUIT_PLAT_ERR_IO; + } + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument. NULL pointer."); + return SUIT_PLAT_ERR_INVAL; +} + +static int preinitialize(void) +{ + if (!setup_partition_addresses()) { + return -EIO; + } + + return 0; +} + +SYS_INIT(preinitialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/subsys/suit/cache/src/zcbor_noncanonical_decode.c b/subsys/suit/cache/src/zcbor_noncanonical_decode.c new file mode 100644 index 000000000000..d5aad3dc27f7 --- /dev/null +++ b/subsys/suit/cache/src/zcbor_noncanonical_decode.c @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include "zcbor_decode.h" +#include "zcbor_common.h" +#include "zcbor_print.h" +#include "zcbor_noncanonical_decode.h" + +/** Return value length from additional value. + */ +static size_t additional_len(uint8_t additional) +{ + if (additional <= ZCBOR_VALUE_IN_HEADER) { + return 0; + } else if (ZCBOR_VALUE_IS_1_BYTE <= additional && additional <= ZCBOR_VALUE_IS_8_BYTES) { + /* 24 => 1 + * 25 => 2 + * 26 => 4 + * 27 => 8 + */ + return 1U << (additional - ZCBOR_VALUE_IS_1_BYTE); + } + return 0xF; +} + +static bool initial_checks(zcbor_state_t *state) +{ + ZCBOR_CHECK_ERROR(); + ZCBOR_CHECK_PAYLOAD(); + return true; +} + +static bool type_check(zcbor_state_t *state, zcbor_major_type_t exp_major_type) +{ + if (!initial_checks(state)) { + ZCBOR_FAIL(); + } + zcbor_major_type_t major_type = ZCBOR_MAJOR_TYPE(*state->payload); + + if (major_type != exp_major_type) { + ZCBOR_ERR(ZCBOR_ERR_WRONG_TYPE); + } + return true; +} + +#define INITIAL_CHECKS() \ + do { \ + if (!initial_checks(state)) { \ + ZCBOR_FAIL(); \ + } \ + } while (0) + +#define INITIAL_CHECKS_WITH_TYPE(exp_major_type) \ + do { \ + if (!type_check(state, exp_major_type)) { \ + ZCBOR_FAIL(); \ + } \ + } while (0) + +static void err_restore(zcbor_state_t *state, int err) +{ + state->payload = state->payload_bak; + state->elem_count++; + zcbor_error(state, err); +} + +#define ERR_RESTORE(err) \ + do { \ + err_restore(state, err); \ + ZCBOR_FAIL(); \ + } while (0) + +#define FAIL_RESTORE() \ + do { \ + state->payload = state->payload_bak; \ + state->elem_count++; \ + ZCBOR_FAIL(); \ + } while (0) + +#define PRINT_FUNC() zcbor_log("%s ", __func__); + +static void endian_copy(uint8_t *dst, const uint8_t *src, size_t src_len) +{ +#ifdef ZCBOR_BIG_ENDIAN + memcpy(dst, src, src_len); +#else + for (size_t i = 0; i < src_len; i++) { + dst[i] = src[src_len - 1 - i]; + } +#endif /* ZCBOR_BIG_ENDIAN */ +} + +/** Get a single value. + * + * @details @p ppayload must point to the header byte. This function will + * retrieve the value (either from within the additional info, or from + * the subsequent bytes) and return it in the result. The result can + * have arbitrary length. + * + * The function will also validate + * - Min/max constraints on the value. + * - That @p payload doesn't overrun past @p payload_end. + * - That @p elem_count has not been exhausted. + * + * @p ppayload and @p elem_count are updated if the function + * succeeds. If not, they are left unchanged. + * + * CBOR values are always big-endian, so this function converts from + * big to little-endian if necessary (@ref ZCBOR_BIG_ENDIAN). + */ +static bool value_extract(zcbor_state_t *state, void *const result, size_t result_len) +{ + zcbor_trace(state, "value_extract"); + zcbor_assert_state(result_len != 0, "0-length result not supported.\r\n"); + zcbor_assert_state(result_len <= 8, "result sizes above 8 bytes not supported.\r\n"); + zcbor_assert_state(result != NULL, "result cannot be NULL.\r\n"); + + INITIAL_CHECKS(); + ZCBOR_ERR_IF((state->elem_count == 0), ZCBOR_ERR_LOW_ELEM_COUNT); + + uint8_t additional = ZCBOR_ADDITIONAL(*state->payload); + size_t len = additional_len(additional); + uint8_t *result_offs = (uint8_t *)result + ZCBOR_ECPY_OFFS(result_len, MAX(1, len)); + + ZCBOR_ERR_IF(additional > ZCBOR_VALUE_IS_8_BYTES, ZCBOR_ERR_ADDITIONAL_INVAL); + ZCBOR_ERR_IF(len > result_len, ZCBOR_ERR_INT_SIZE); + ZCBOR_ERR_IF((state->payload + len + 1) > state->payload_end, ZCBOR_ERR_NO_PAYLOAD); + + memset(result, 0, result_len); + + if (len == 0) { + *result_offs = additional; + } else { + endian_copy(result_offs, state->payload + 1, len); + } + + state->payload_bak = state->payload; + (state->payload) += len + 1; + (state->elem_count)--; + return true; +} + +static bool str_start_decode(zcbor_state_t *state, struct zcbor_string *result, + zcbor_major_type_t exp_major_type) +{ + INITIAL_CHECKS_WITH_TYPE(exp_major_type); + + if (!value_extract(state, &result->len, sizeof(result->len))) { + ZCBOR_FAIL(); + } + + result->value = state->payload; + return true; +} + +static void partition_fragment(const zcbor_state_t *state, struct zcbor_string_fragment *result) +{ + result->fragment.len = + MIN(result->fragment.len, (size_t)state->payload_end - (size_t)state->payload); +} + +static bool start_decode_fragment(zcbor_state_t *state, struct zcbor_string_fragment *result, + zcbor_major_type_t exp_major_type) +{ + PRINT_FUNC(); + if (!str_start_decode(state, &result->fragment, exp_major_type)) { + ZCBOR_FAIL(); + } + + result->offset = 0; + result->total_len = result->fragment.len; + partition_fragment(state, result); + state->payload_end = state->payload + result->fragment.len; + + return true; +} + +bool zcbor_noncanonical_bstr_start_decode_fragment(zcbor_state_t *state, + struct zcbor_string_fragment *result) +{ + PRINT_FUNC(); + if (!start_decode_fragment(state, result, ZCBOR_MAJOR_TYPE_BSTR)) { + ZCBOR_FAIL(); + } + if (!zcbor_new_backup(state, ZCBOR_MAX_ELEM_COUNT)) { + FAIL_RESTORE(); + } + return true; +} + +static bool list_map_start_decode(zcbor_state_t *state, zcbor_major_type_t exp_major_type) +{ + size_t new_elem_count; + bool indefinite_length_array = false; + + INITIAL_CHECKS_WITH_TYPE(exp_major_type); + + if (ZCBOR_ADDITIONAL(*state->payload) == ZCBOR_VALUE_IS_INDEFINITE_LENGTH) { + /* Indefinite length array. */ + new_elem_count = ZCBOR_LARGE_ELEM_COUNT; + ZCBOR_ERR_IF(state->elem_count == 0, ZCBOR_ERR_LOW_ELEM_COUNT); + indefinite_length_array = true; + state->payload_bak = state->payload++; + state->elem_count--; + } else { + if (!value_extract(state, &new_elem_count, sizeof(new_elem_count))) { + ZCBOR_FAIL(); + } + } + + if (!zcbor_new_backup(state, new_elem_count)) { + FAIL_RESTORE(); + } + + state->decode_state.indefinite_length_array = indefinite_length_array; + + return true; +} + +bool zcbor_noncanonical_map_start_decode(zcbor_state_t *state) +{ + PRINT_FUNC(); + bool ret = list_map_start_decode(state, ZCBOR_MAJOR_TYPE_MAP); + + if (ret && !state->decode_state.indefinite_length_array) { + if (state->elem_count >= (ZCBOR_MAX_ELEM_COUNT / 2)) { + /* The new elem_count is too large. */ + ERR_RESTORE(ZCBOR_ERR_INT_SIZE); + } + state->elem_count *= 2; + } + return ret; +} diff --git a/subsys/suit/cache/src/zcbor_noncanonical_decode.h b/subsys/suit/cache/src/zcbor_noncanonical_decode.h new file mode 100644 index 000000000000..af0574d5ab5d --- /dev/null +++ b/subsys/suit/cache/src/zcbor_noncanonical_decode.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef ZCBOR_NONCANONICAL_DECODE_H__ +#define ZCBOR_NONCANONICAL_DECODE_H__ + +/** Decode and consume a noncanonical bstr header, assuming the payload does not contain the whole + * bstr. + * + * The rest of the string can be decoded as CBOR. + * A state backup is created to keep track of the element count. + * Call @ref zcbor_update_state followed by @ref zcbor_bstr_next_fragment when + * the current payload has been exhausted. + */ +bool zcbor_noncanonical_bstr_start_decode_fragment(zcbor_state_t *state, + struct zcbor_string_fragment *result); + +/** Decode and consume a noncanonical map header. + * + * The contents of the map can be decoded via subsequent function calls. + * A state backup is created to keep track of the element count. + * + * @retval true Header decoded correctly + * @retval false Header decoded incorrectly, or backup failed. + */ +bool zcbor_noncanonical_map_start_decode(zcbor_state_t *state); + +#endif /* ZCBOR_NONCANONICAL_DECODE_H__ */ diff --git a/subsys/suit/envelope_info/CMakeLists.txt b/subsys/suit/envelope_info/CMakeLists.txt new file mode 100644 index 000000000000..3d1c5483b4e1 --- /dev/null +++ b/subsys/suit/envelope_info/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Module for usage in local domain to get information about the currently installed envelope + +zephyr_interface_library_named(suit_envelope_info) +target_include_directories(suit_envelope_info INTERFACE include) + +zephyr_library() +zephyr_library_sources(src/suit_envelope_info.c) + +zephyr_library_link_libraries(suit_envelope_info) +zephyr_library_link_libraries(suit_platform_err) +zephyr_library_link_libraries(suit_utils) diff --git a/subsys/suit/envelope_info/Kconfig b/subsys/suit/envelope_info/Kconfig new file mode 100644 index 000000000000..00a6c198d4d9 --- /dev/null +++ b/subsys/suit/envelope_info/Kconfig @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_ENVELOPE_INFO + bool "Enable SUIT envelope info module" diff --git a/subsys/suit/envelope_info/include/suit_envelope_info.h b/subsys/suit/envelope_info/include/suit_envelope_info.h new file mode 100644 index 000000000000..e373d78e18a0 --- /dev/null +++ b/subsys/suit/envelope_info/include/suit_envelope_info.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_ENVELOPE_INFO_H__ +#define SUIT_ENVELOPE_INFO_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Inform the module that the SUIT candidate envelope was stored. + * This will extract the information such as the size of the envelope. + * If after calling this function the envelope is modified, the + * state of this module must be reset using @ref suit_envelope_info_reset + * and this function must be called again when the modifications to the + * candidate envelope are finished. + * + * @param[in] address The address of the stored envelope. + * @param[in] max_size The maximum supported envelope size (larger envelope will cause an error). + * + * @return suit_plat_success on success, error code otherwise. + */ +suit_plat_err_t suit_envelope_info_candidate_stored(const uint8_t *address, size_t max_size); + +/** + * @brief Resets the module. + * + */ +void suit_envelope_info_reset(void); + +/** + * @brief Gets information about the stored candidate envelope. + * + * @param[out] address The address of the stored envelope. + * @param[out] size The size of the stored envelope. + * + * @return suit_plat_success on success, error code otherwise. + */ +suit_plat_err_t suit_envelope_info_get(const uint8_t **address, size_t *size); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_ENVELOPE_INFO_H__ */ diff --git a/subsys/suit/envelope_info/src/suit_envelope_info.c b/subsys/suit/envelope_info/src/suit_envelope_info.c new file mode 100644 index 000000000000..0f88dbbcd7c8 --- /dev/null +++ b/subsys/suit/envelope_info/src/suit_envelope_info.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "suit_envelope_info.h" + +#include +#include +#include /* TODO: delete when calculating size is added*/ + +#include + +#include + +#define EMPTY_STORAGE_VALUE 0xFFFFFFFF + +LOG_MODULE_REGISTER(suit_envelope_info, CONFIG_SUIT_LOG_LEVEL); + +static const uint8_t *envelope_address; +static size_t envelope_size; + +static suit_plat_err_t update_candidate_address_and_size_validate(const uint8_t *addr, size_t size) +{ + if (addr == NULL || *((uint32_t *)addr) == EMPTY_STORAGE_VALUE) { + LOG_DBG("Invalid update candidate address: %p", (void *)addr); + return SUIT_PLAT_ERR_INVAL; + } + + if (size == 0) { + LOG_DBG("Invalid update candidate size: %d", size); + return SUIT_PLAT_ERR_INVAL; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_envelope_info_candidate_stored(const uint8_t *address, size_t max_size) +{ + zcbor_state_t states[3]; + + if (address == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), address, max_size, 1, NULL, + 0); + + /* Expect SUIT envelope tag (107) and skip until the end of the envelope */ + if (!zcbor_tag_expect(states, 107) || !zcbor_any_skip(states, NULL)) { + LOG_DBG("Malformed envelope"); + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + envelope_size = MIN(max_size, (size_t)states[0].payload - (size_t)address); + envelope_address = address; + + return SUIT_PLAT_SUCCESS; +} + +void suit_envelope_info_reset(void) +{ + envelope_size = 0; + envelope_address = NULL; +} + +suit_plat_err_t suit_envelope_info_get(const uint8_t **address, size_t *size) +{ + suit_plat_err_t ret = SUIT_PLAT_ERR_INVAL; + + ret = update_candidate_address_and_size_validate(envelope_address, envelope_size); + + if (ret == SUIT_PLAT_SUCCESS) { + *address = envelope_address; + *size = envelope_size; + } + + return ret; +} diff --git a/subsys/suit/execution_mode/CMakeLists.txt b/subsys/suit/execution_mode/CMakeLists.txt new file mode 100644 index 000000000000..010bf7b21a96 --- /dev/null +++ b/subsys/suit/execution_mode/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Module holding current SUIT execution mode +zephyr_interface_library_named(suit_execution_mode) +target_include_directories(suit_execution_mode INTERFACE include) +target_link_libraries(suit_execution_mode INTERFACE suit_platform_err) + +zephyr_library() +zephyr_library_sources(src/suit_execution_mode.c) + +zephyr_library_link_libraries(suit_execution_mode) diff --git a/subsys/suit/execution_mode/Kconfig b/subsys/suit/execution_mode/Kconfig new file mode 100644 index 000000000000..2a851db38455 --- /dev/null +++ b/subsys/suit/execution_mode/Kconfig @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_EXECUTION_MODE + bool "Enable SUIT execution mode module" diff --git a/subsys/suit/execution_mode/include/suit_execution_mode.h b/subsys/suit/execution_mode/include/suit_execution_mode.h new file mode 100644 index 000000000000..509aee573e4b --- /dev/null +++ b/subsys/suit/execution_mode/include/suit_execution_mode.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_EXECUTION_MODE_H__ +#define SUIT_EXECUTION_MODE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + EXECUTION_MODE_STARTUP = 0, + EXECUTION_MODE_INVOKE, + EXECUTION_MODE_INVOKE_RECOVERY, + EXECUTION_MODE_INSTALL, + EXECUTION_MODE_INSTALL_RECOVERY, + EXECUTION_MODE_POST_INVOKE, + EXECUTION_MODE_POST_INVOKE_RECOVERY, + EXECUTION_MODE_FAIL_NO_MPI, + EXECUTION_MODE_FAIL_MPI_INVALID, + EXECUTION_MODE_FAIL_MPI_INVALID_MISSING, + EXECUTION_MODE_FAIL_MPI_UNSUPPORTED, +} suit_execution_mode_t; + +/** + * @brief Return current execution mode set in module + * + * @return suit_execution_mode_t Current value + */ +suit_execution_mode_t suit_execution_mode_get(void); + +/** + * @brief Set new execution mode + * + * @param mode Valid execution mode + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid mode + */ +suit_plat_err_t suit_execution_mode_set(suit_execution_mode_t mode); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_EXECUTION_H__ */ diff --git a/subsys/suit/execution_mode/src/suit_execution_mode.c b/subsys/suit/execution_mode/src/suit_execution_mode.c new file mode 100644 index 000000000000..cb1611ac2d4b --- /dev/null +++ b/subsys/suit/execution_mode/src/suit_execution_mode.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +static suit_execution_mode_t current_execution_mode = EXECUTION_MODE_STARTUP; + +suit_execution_mode_t suit_execution_mode_get(void) +{ + return current_execution_mode; +} + +suit_plat_err_t suit_execution_mode_set(suit_execution_mode_t mode) +{ + if ((mode > EXECUTION_MODE_STARTUP) && (mode <= EXECUTION_MODE_FAIL_MPI_UNSUPPORTED)) { + current_execution_mode = mode; + + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/mci/CMakeLists.txt b/subsys/suit/mci/CMakeLists.txt new file mode 100644 index 000000000000..3281a1a95ed4 --- /dev/null +++ b/subsys/suit/mci/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT Manifest Configuration Information API +zephyr_interface_library_named(suit_mci) +target_include_directories(suit_mci INTERFACE include) +target_link_libraries(suit_mci INTERFACE suit_platform_err) +target_link_libraries(suit_mci INTERFACE suit_metadata) + +zephyr_library() +zephyr_library_sources_ifdef(CONFIG_SUIT_MCI_IMPL_NRF54H20_SDFW src/suit_mci_nrf54h20.c) +zephyr_library_sources(src/suit_generic_ids.c) + +zephyr_library_link_libraries(suit_mci) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STORAGE suit_storage_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/subsys/suit/mci/Kconfig b/subsys/suit/mci/Kconfig new file mode 100644 index 000000000000..b5bc4589a2b3 --- /dev/null +++ b/subsys/suit/mci/Kconfig @@ -0,0 +1,26 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_MCI + bool "Enable SUIT Manifest Configuration Information module" + depends on SUIT_METADATA + +if SUIT_MCI + +choice SUIT_MCI_IMPL + prompt "MCI implementation" + +config SUIT_MCI_IMPL_NRF54H20_SDFW + bool "nRF54H20: Secure domain" + depends on SOC_SERIES_NRF54HX + depends on SUIT_PLATFORM_VARIANT_SDFW + +config SUIT_MCI_IMPL_CUSTOM + bool "custom" + +endchoice #MCI implementation + +endif # SUIT_MCI diff --git a/subsys/suit/mci/include/suit_mci.h b/subsys/suit/mci/include/suit_mci.h new file mode 100644 index 000000000000..50b0eab3acb5 --- /dev/null +++ b/subsys/suit/mci/include/suit_mci.h @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_MCI_H__ +#define SUIT_MCI_H__ + +/* + * SUIT (Software Updates for Internet of Things) installation and booting processes are described + * in manifests as a sequences of instructions. That enables customization of update and booting + * process at level of manifest. Aim of this API is to represent set of device constrains which + * shall be applied to manifest processing. + * + * Manifests topology: Device images are described by one or more SUIT manifests, grouped in a tree + * structures. Each of those manifests supported by the device is identified by UUID based + * suit_manifest_class_id_t + * + * Boot order: SUIT manifest contains booting instructions (suit-invoke command sequence), + * effectively controlling the booting order for components it covers. As manifests are grouped in + * tree structures, parent manifest controls the order of invocation of its children suit-invoke + * command sequences. Having multiple manifests in the device - there should be a mechanism which + * would allow bootloader to chose a specific manifest or list of manifests to process its + * suit-invoke in desired order. + * + * Downgrade prevention policy: Product requirements may enforce different downgrade prevention + * policies attached to different components (i.e. cellular and application firmware). + * Each manifest supported by the device has its downgrade prevention policy attached. + * When update candidate is delivered to the device, update may be proceeded or be refused based + * on sequence number in candidate manifest, sequence number of relevant manifest installed + * in the device and respective downgrade prevention policy + * + * Key ID: Key id value can be utilized to encode purpose/signing authority associated with the key. + * This may be utilized to detect the situation that manifest is signed with valid key, but + * associated to authority which does not hold rights to sign this manifest. Definition of key id + * semantic is out of scope of MCI, MCI just enables validation of value of selected bits of key id. + * + * Manifest access rights: malicious or unintentionally defective manifests may operate on + * resources (i.e. memory ranges, cpu and others) they are not entitled to. There should be a + * mechanism which would allow to check whether manifest operates on resources it is entitled to. + * Such checking shall be applied before actual manifest processing starts, as detection of access + * violation in the middle of update procedure may lead to unbootable state of the device. Memory + * range checks do not differentiate between read and write access, as distinct manifest is + * typically responsible both for installation and verification and eventual invocation of specific + * suit component. + * + */ +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int mci_err_t; + +/**< Invalid or unsupported manifest class id */ +#define MCI_ERR_MANIFESTCLASSID 1 +/**< Manifest is not entitled to operate on resource */ +#define MCI_ERR_NOACCESS 2 +/**< Provided key ID is invalid for desired operation */ +#define MCI_ERR_WRONGKEYID 3 + +/** + * @brief Gets Nordic vendor id + * + * @param[out] vendor_id Nordic vendor id + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + */ +mci_err_t suit_mci_nordic_vendor_id_get(const suit_uuid_t **vendor_id); + +/** + * @brief Gets an array of supported manifest class_info struct containing class_id. + * + * @param[out] class_id Array of manifest class ids and roles + * @param[in,out] size as input - maximal amount of elements an array can hold, + * as output - amount of stored elements + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_SIZE too small to store all information + */ +mci_err_t suit_mci_supported_manifest_class_ids_get(suit_manifest_class_info_t *class_info, + size_t *size); + +/** + * @brief Gets an array of manifest class ids in invocation order. + * + * @param[out] class_id Array of manifest class ids + * @param[in,out] size as input - maximal amount of elements an array can hold, + * as output - amount of stored elements + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_SIZE too small to store all information + * @retval SUIT_PLAT_ERR_NOT_FOUND no class_id with given role + * @retval SUIT_PLAT_ERR_INCORRECT_STATE unsupported execution mode + */ +mci_err_t suit_mci_invoke_order_get(const suit_manifest_class_id_t **class_id, size_t *size); + +/** + * @brief Gets downgrade prevention policy for manifest class id + * + * @param[in] class_id Manifest class id + * @param[out] policy Downgrade prevention policy value + * + * @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 SUIT_PLAT_ERR_OUT_OF_BOUNDS data provisioned for downgrade prevention policy is invalid + */ +mci_err_t suit_mci_downgrade_prevention_policy_get(const suit_manifest_class_id_t *class_id, + suit_downgrade_prevention_policy_t *policy); + +/** + * @brief Gets independent updateability policy for manifest class id + * + * @param[in] class_id Manifest class id + * @param[out] policy Independent updateability policy value + * + * @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 SUIT_PLAT_ERR_OUT_OF_BOUNDS data provisioned for independent updateability policy + * is invalid + */ +mci_err_t suit_mci_independent_update_policy_get(const suit_manifest_class_id_t *class_id, + suit_independent_updateability_policy_t *policy); + +/** + * @brief Validates if manifest class id is supported in the device. + * + * @param[in] class_id Manifest class id + * + * @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 + */ +mci_err_t suit_mci_manifest_class_id_validate(const suit_manifest_class_id_t *class_id); + +/** + * @brief Verifying whether specific key_id is valid for signing/checking signature of specific + *manifest class + * + * @param[in] class_id Manifest class id + * @param[in] key_id Identifier of key utilized for manifest signing. key_id may be equal + * to 0. In that case function returns success if manifest class id + * does not require 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_validate(const suit_manifest_class_id_t *class_id, + uint32_t key_id); + +/** + * @brief Verifies if manifest with specific class id is entitled to start (invoke) code on specific + * processor + * + * @param[in] class_id Manifest class id + * @param[in] processor_id Processor id. Refer to Product Specification + * + * @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_NOACCESS manifest is not entitled to operate on cpu + */ +mci_err_t suit_mci_processor_start_rights_validate(const suit_manifest_class_id_t *class_id, + int processor_id); + +/** + * @brief Verifies if manifest with specific class id is entitled to operate on memory range + * + * @param[in] class_id Manifest class id + * @param[in] address + * @param[in] mem_size size of access area + * + * @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_NOACCESS manifest is not entitled to operate on + * memory range + */ +mci_err_t suit_mci_memory_access_rights_validate(const suit_manifest_class_id_t *class_id, + void *address, size_t mem_size); + +/** + * @brief Verifies if manifest with specific class id is entitled to operate on non-memory platform + * component + * + * @param[in] class_id Manifest class id + * @param[in] platform_specific_component_number + * + * @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_NOACCESS manifest is not entitled to operate on + * non-memory platform component + */ +mci_err_t +suit_mci_platform_specific_component_rights_validate(const suit_manifest_class_id_t *class_id, + int platform_specific_component_number); + +/** + * @brief Gets vendor id for provided manifest class id + * + * @param[in] class_id Component/manifest class id + * @param[out] vendor_id Vendor id for the class id + * + * @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 + */ +mci_err_t suit_mci_vendor_id_for_manifest_class_id_get(const suit_manifest_class_id_t *class_id, + const suit_uuid_t **vendor_id); + +/** + * @brief Verifies whether parent-child relationship for selected manifests is valid + * + * @param[in] parent_class_id Parent manifest class id + * @param[in] child_class_id Child manifest class id + * + * @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_NOACCESS parent-child relation for selected + * manifests is invalid + */ +mci_err_t +suit_mci_manifest_parent_child_declaration_validate(const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id); + +/** + * @brief Verifies whether parent-child relationship for selected manifests is valid in the context + * of the current execution_mode + * + * @param[in] parent_class_id Parent manifest class id + * @param[in] child_class_id Child manifest class id + * + * @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_NOACCESS parent-child relation for selected + * manifests is invalid + */ +mci_err_t +suit_mci_manifest_process_dependency_validate(const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id); + +/** + * @brief Initializes MCI + * + * @return SUIT_PLAT_SUCCESS + * + */ +mci_err_t suit_mci_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_MCI_H__ */ diff --git a/subsys/suit/mci/src/suit_generic_ids.c b/subsys/suit/mci/src/suit_generic_ids.c new file mode 100644 index 000000000000..8cc00aba9ad1 --- /dev/null +++ b/subsys/suit/mci/src/suit_generic_ids.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include + +/* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') + */ +static const suit_uuid_t nordic_vendor_id = {{0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, + 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4}}; + +mci_err_t suit_mci_nordic_vendor_id_get(const suit_uuid_t **vendor_id) +{ + if (NULL == vendor_id) { + return SUIT_PLAT_ERR_INVAL; + } + *vendor_id = &nordic_vendor_id; + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/mci/src/suit_mci_nrf54h20.c b/subsys/suit/mci/src/suit_mci_nrf54h20.c new file mode 100644 index 000000000000..e89e796a126f --- /dev/null +++ b/subsys/suit/mci/src/suit_mci_nrf54h20.c @@ -0,0 +1,629 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include +#include +#include +#include + +#define MANIFEST_PUBKEY_NRF_TOP_GEN0 0x4000BB00 +#define MANIFEST_PUBKEY_SYSCTRL_GEN0 0x40082100 +#define MANIFEST_PUBKEY_OEM_ROOT_GEN0 0x4000AA00 +#define MANIFEST_PUBKEY_APPLICATION_GEN0 0x40022100 +#define MANIFEST_PUBKEY_RADIO_GEN0 0x40032100 +#define MANIFEST_PUBKEY_GEN_RANGE 2 + +LOG_MODULE_REGISTER(suit_mci_nrf54h20, CONFIG_SUIT_LOG_LEVEL); + +mci_err_t suit_mci_supported_manifest_class_ids_get(suit_manifest_class_info_t *class_info, + size_t *size) +{ + if (class_info == NULL || size == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + return suit_storage_mpi_class_ids_get(class_info, size); +} + +mci_err_t suit_mci_invoke_order_get(const suit_manifest_class_id_t **class_id, size_t *size) +{ + if (class_id == NULL || size == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + size_t output_max_size = *size; + size_t output_size = 2; /* Current number of elements on invocation order list */ + + if (output_size > output_max_size) { + return SUIT_PLAT_ERR_SIZE; + } + + suit_execution_mode_t execution_mode = suit_execution_mode_get(); + + switch (execution_mode) { + case EXECUTION_MODE_INVOKE: + if (suit_storage_mpi_class_get(SUIT_MANIFEST_SEC_TOP, &class_id[0]) != + SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + if (suit_storage_mpi_class_get(SUIT_MANIFEST_APP_ROOT, &class_id[1]) != + SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + break; + + case EXECUTION_MODE_INVOKE_RECOVERY: + if (suit_storage_mpi_class_get(SUIT_MANIFEST_SEC_TOP, &class_id[0]) != + SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + suit_plat_err_t ret = + suit_storage_mpi_class_get(SUIT_MANIFEST_APP_RECOVERY, &class_id[1]); + + /* If recovery class ID is not configured, use application root manifest + * as the recovery manifest. + */ + if (ret == SUIT_PLAT_ERR_NOT_FOUND) { + ret = suit_storage_mpi_class_get(SUIT_MANIFEST_APP_ROOT, &class_id[1]); + } + + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + break; + + default: + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + *size = output_size; + return SUIT_PLAT_SUCCESS; +} + +mci_err_t suit_mci_downgrade_prevention_policy_get(const suit_manifest_class_id_t *class_id, + suit_downgrade_prevention_policy_t *policy) +{ + suit_storage_mpi_t *mpi = NULL; + + if (class_id == NULL || policy == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (suit_storage_mpi_get(class_id, &mpi) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + *policy = + suit_mpi_downgrade_prevention_policy_to_metadata(mpi->downgrade_prevention_policy); + if (*policy == SUIT_DOWNGRADE_PREVENTION_UNKNOWN) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + return SUIT_PLAT_SUCCESS; +} + +mci_err_t suit_mci_independent_update_policy_get(const suit_manifest_class_id_t *class_id, + suit_independent_updateability_policy_t *policy) +{ + suit_storage_mpi_t *mpi = NULL; + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + + if (class_id == NULL || policy == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (suit_storage_mpi_get(class_id, &mpi) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + *policy = suit_mpi_independent_updateability_policy_to_metadata( + mpi->independent_updateability_policy); + if (*policy == SUIT_INDEPENDENT_UPDATE_UNKNOWN) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + /* Override independent updateability policy in recovery scenarios: + * If the update candidate was delivered by the recovery firmware, + * it must not update the recovery firmware. + * Invoke modes included, so the recovery firmware may reject the incorrect + * update candidate before resetting the SoC. + */ + switch (suit_execution_mode_get()) { + case EXECUTION_MODE_INVOKE_RECOVERY: + case EXECUTION_MODE_INSTALL_RECOVERY: + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + if ((role == SUIT_MANIFEST_APP_RECOVERY) || (role == SUIT_MANIFEST_RAD_RECOVERY)) { + *policy = SUIT_INDEPENDENT_UPDATE_DENIED; + } + break; + default: + break; + } + + return SUIT_PLAT_SUCCESS; +} + +mci_err_t suit_mci_manifest_class_id_validate(const suit_manifest_class_id_t *class_id) +{ + if (class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + suit_plat_err_t ret = suit_storage_mpi_role_get(class_id, &role); + + if (ret != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + return SUIT_PLAT_SUCCESS; +} + +static bool skip_validation(suit_manifest_role_t role) +{ +#ifdef CONFIG_SDFW_LCS + /* Read the domain-specific LCS value. */ + enum lcs current_lcs = LCS_DISCARDED; + + switch (role) { + case SUIT_MANIFEST_SEC_TOP: + case SUIT_MANIFEST_SEC_SDFW: + case SUIT_MANIFEST_SEC_SYSCTRL: + current_lcs = lcs_get(LCS_DOMAIN_ID_SECURE); + + /* TODO: + * NCSDK-26255 + * Once keys are provisioned, validation skip for Secure domain should be disabled. + * return false; + */ + + LOG_WRN("SUIT: Validation skip is enabled for Secure domain."); + break; + + case SUIT_MANIFEST_APP_ROOT: + case SUIT_MANIFEST_APP_RECOVERY: + case SUIT_MANIFEST_APP_LOCAL_1: + case SUIT_MANIFEST_APP_LOCAL_2: + case SUIT_MANIFEST_APP_LOCAL_3: + current_lcs = lcs_get(LCS_DOMAIN_ID_APPLICATION); + break; + + case SUIT_MANIFEST_RAD_RECOVERY: + case SUIT_MANIFEST_RAD_LOCAL_1: + case SUIT_MANIFEST_RAD_LOCAL_2: + current_lcs = lcs_get(LCS_DOMAIN_ID_RADIOCORE); + break; + + default: + return false; + } + + if ((current_lcs == LCS_ROT) || (current_lcs == LCS_ROT_DEBUG) || + (current_lcs == LCS_EMPTY)) { + return true; + } +#endif /* CONFIG_SDFW_LCS */ + + return false; +} + +mci_err_t suit_mci_signing_key_id_validate(const suit_manifest_class_id_t *class_id, + uint32_t key_id) +{ + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + + if (class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + if (key_id == 0) { + suit_storage_mpi_t *mpi = NULL; + + if (skip_validation(role)) { + return SUIT_PLAT_SUCCESS; + } + + if (suit_storage_mpi_get(class_id, &mpi) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + if (mpi->signature_verification_policy == SUIT_MPI_SIGNATURE_CHECK_DISABLED) { + return SUIT_PLAT_SUCCESS; + } else if ((mpi->signature_verification_policy == + SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE) && + (suit_execution_mode_get() == EXECUTION_MODE_INVOKE)) { + /* By allowing key_id == 0 in the invoke path, the platform will verify + * the signature only during updates. + */ + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_WRONGKEYID; + } + + switch (role) { + case SUIT_MANIFEST_SEC_TOP: + case SUIT_MANIFEST_SEC_SDFW: + if (key_id >= MANIFEST_PUBKEY_NRF_TOP_GEN0 && + key_id <= MANIFEST_PUBKEY_NRF_TOP_GEN0 + MANIFEST_PUBKEY_GEN_RANGE) { + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_SEC_SYSCTRL: + if (key_id >= MANIFEST_PUBKEY_SYSCTRL_GEN0 && + key_id <= MANIFEST_PUBKEY_SYSCTRL_GEN0 + MANIFEST_PUBKEY_GEN_RANGE) { + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_APP_ROOT: + if (key_id >= MANIFEST_PUBKEY_OEM_ROOT_GEN0 && + key_id <= MANIFEST_PUBKEY_OEM_ROOT_GEN0 + MANIFEST_PUBKEY_GEN_RANGE) { + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_APP_RECOVERY: + case SUIT_MANIFEST_APP_LOCAL_1: + case SUIT_MANIFEST_APP_LOCAL_2: + case SUIT_MANIFEST_APP_LOCAL_3: + if (key_id >= MANIFEST_PUBKEY_APPLICATION_GEN0 && + key_id <= MANIFEST_PUBKEY_APPLICATION_GEN0 + MANIFEST_PUBKEY_GEN_RANGE) { + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_RAD_RECOVERY: + case SUIT_MANIFEST_RAD_LOCAL_1: + case SUIT_MANIFEST_RAD_LOCAL_2: + if (key_id >= MANIFEST_PUBKEY_RADIO_GEN0 && + key_id <= MANIFEST_PUBKEY_RADIO_GEN0 + MANIFEST_PUBKEY_GEN_RANGE) { + return SUIT_PLAT_SUCCESS; + } + break; + + default: + break; + } + + return MCI_ERR_WRONGKEYID; +} + +mci_err_t suit_mci_processor_start_rights_validate(const suit_manifest_class_id_t *class_id, + int processor_id) +{ + if (class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + switch (role) { + case SUIT_MANIFEST_UNKNOWN: + return MCI_ERR_MANIFESTCLASSID; + + case SUIT_MANIFEST_SEC_TOP: + case SUIT_MANIFEST_APP_ROOT: + case SUIT_MANIFEST_SEC_SDFW: + break; + + case SUIT_MANIFEST_SEC_SYSCTRL: + /* Sys manifest */ + if (processor_id == NRF_PROCESSOR_SYSCTRL) { + /* SysCtrl */ + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_APP_RECOVERY: + case SUIT_MANIFEST_APP_LOCAL_1: + case SUIT_MANIFEST_APP_LOCAL_2: + case SUIT_MANIFEST_APP_LOCAL_3: + /* App manifest */ + if (processor_id == NRF_PROCESSOR_APPLICATION) { + /* Appcore */ + return SUIT_PLAT_SUCCESS; + } + break; + + case SUIT_MANIFEST_RAD_RECOVERY: + case SUIT_MANIFEST_RAD_LOCAL_1: + case SUIT_MANIFEST_RAD_LOCAL_2: + /* Rad manifest */ + if (processor_id == NRF_PROCESSOR_RADIOCORE) { + /* Radiocore */ + return SUIT_PLAT_SUCCESS; + } + break; + + default: + break; + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t suit_mci_memory_access_rights_validate(const suit_manifest_class_id_t *class_id, + void *address, size_t mem_size) +{ + if (class_id == NULL || address == NULL || mem_size == 0) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + switch (role) { + case SUIT_MANIFEST_UNKNOWN: + return MCI_ERR_MANIFESTCLASSID; + + case SUIT_MANIFEST_SEC_TOP: + /* Nordic top manifest - ability to operate on memory ranges intentionally blocked + */ + return MCI_ERR_NOACCESS; + + case SUIT_MANIFEST_SEC_SDFW: + /* Sec manifest - TODO - implement checks based on UICR/SICR + */ + return SUIT_PLAT_SUCCESS; + + case SUIT_MANIFEST_SEC_SYSCTRL: + /* Sysctrl manifest - TODO - implement checks based on UICR/SICR + */ + return SUIT_PLAT_SUCCESS; + + case SUIT_MANIFEST_APP_ROOT: + /* Root manifest - ability to operate on memory ranges intentionally blocked + */ + return MCI_ERR_NOACCESS; + + case SUIT_MANIFEST_APP_RECOVERY: + case SUIT_MANIFEST_APP_LOCAL_1: + case SUIT_MANIFEST_APP_LOCAL_2: + case SUIT_MANIFEST_APP_LOCAL_3: + /* App manifest - TODO - implement checks based on UICR + */ + return SUIT_PLAT_SUCCESS; + + case SUIT_MANIFEST_RAD_RECOVERY: + case SUIT_MANIFEST_RAD_LOCAL_1: + case SUIT_MANIFEST_RAD_LOCAL_2: + /* Rad manifest - TODO - implement checks based on UICR + */ + return SUIT_PLAT_SUCCESS; + + default: + break; + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t +suit_mci_platform_specific_component_rights_validate(const suit_manifest_class_id_t *class_id, + int platform_specific_component_number) +{ + if (class_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_manifest_role_t role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(class_id, &role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + if (role == SUIT_MANIFEST_SEC_SDFW) { + /* The only manifest with ability to control platform specific components is secdom. + * 1 - SDFW + * 2 - SDFW Recovery + */ + if (platform_specific_component_number == 1 || + platform_specific_component_number == 2) { + return SUIT_PLAT_SUCCESS; + } + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t suit_mci_vendor_id_for_manifest_class_id_get(const suit_manifest_class_id_t *class_id, + const suit_uuid_t **vendor_id) +{ + suit_storage_mpi_t *mpi = NULL; + + if (class_id == NULL || vendor_id == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (suit_storage_mpi_get(class_id, &mpi) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + /* Casting is done as a temporary solution until mpi refactoring */ + *vendor_id = (const suit_uuid_t *)mpi->vendor_id; + return SUIT_PLAT_SUCCESS; +} + +mci_err_t +suit_mci_manifest_parent_child_declaration_validate(const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + if ((parent_class_id == NULL) || (child_class_id == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_manifest_role_t parent_role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(parent_class_id, &parent_role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + suit_manifest_role_t child_role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(child_class_id, &child_role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)) || + (child_role == SUIT_MANIFEST_SEC_TOP))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_RECOVERY) && + ((child_role == SUIT_MANIFEST_RAD_RECOVERY) || + ((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)))) { + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t +suit_mci_manifest_process_dependency_validate(const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + if ((parent_class_id == NULL) || (child_class_id == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_execution_mode_t execution_mode = suit_execution_mode_get(); + + suit_manifest_role_t parent_role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(parent_class_id, &parent_role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + suit_manifest_role_t child_role = SUIT_MANIFEST_UNKNOWN; + + if (suit_storage_mpi_role_get(child_class_id, &child_role) != SUIT_PLAT_SUCCESS) { + return MCI_ERR_MANIFESTCLASSID; + } + + switch (execution_mode) { + case EXECUTION_MODE_INVOKE: + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || + (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)))) { + return SUIT_PLAT_SUCCESS; + } + break; + + case EXECUTION_MODE_INSTALL: + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || + (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)) || + (child_role == SUIT_MANIFEST_SEC_TOP))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_RECOVERY) && + (child_role == SUIT_MANIFEST_RAD_RECOVERY)) { + return SUIT_PLAT_SUCCESS; + } + break; + + case EXECUTION_MODE_INSTALL_RECOVERY: + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || + (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)) || + (child_role == SUIT_MANIFEST_SEC_TOP))) { + return SUIT_PLAT_SUCCESS; + } + break; + + case EXECUTION_MODE_INVOKE_RECOVERY: + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || + (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_RECOVERY) && + ((child_role == SUIT_MANIFEST_RAD_RECOVERY) || + ((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)))) { + return SUIT_PLAT_SUCCESS; + } + + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)))) { + return SUIT_PLAT_SUCCESS; + } + break; + + default: + break; + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t suit_mci_init(void) +{ + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/memory_layout/CMakeLists.txt b/subsys/suit/memory_layout/CMakeLists.txt new file mode 100644 index 000000000000..460675f8a7f2 --- /dev/null +++ b/subsys/suit/memory_layout/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_memory_layout_interface) +target_include_directories(suit_memory_layout_interface INTERFACE include) + +zephyr_library() +zephyr_library_sources(src/suit_memory_layout.c) + +zephyr_library_link_libraries(suit_memory_layout_interface) diff --git a/subsys/suit/memory_layout/Kconfig b/subsys/suit/memory_layout/Kconfig new file mode 100644 index 000000000000..71f211f421f4 --- /dev/null +++ b/subsys/suit/memory_layout/Kconfig @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_START + hex + default 0x60000000 if SOC_SERIES_NRF54HX + default 0x12000000 if SOC_NRF52840 + default 0x0 if BOARD_NATIVE_POSIX + help + Start address of the extended memory range. + This value is SOC specific and is not meant to be changed. + +config SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_SIZE + hex + default 0x40000000 if SOC_SERIES_NRF54HX + default 0x8000000 if SOC_NRF52840 + default 0x0 if BOARD_NATIVE_POSIX + help + Size of the extended memory range. + This value is SOC specific and is not meant to be changed. diff --git a/subsys/suit/memory_layout/include/suit_memory_layout.h b/subsys/suit/memory_layout/include/suit_memory_layout.h new file mode 100644 index 000000000000..0b5c75a4291e --- /dev/null +++ b/subsys/suit/memory_layout/include/suit_memory_layout.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_MEMORY_LAYOUT_H__ +#define SUIT_MEMORY_LAYOUT_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* NVM address consisting of flash device handle and offset. */ +struct nvm_address { + const struct device *fdev; + uintptr_t offset; +}; + +/** + * @brief Convert global address to NVM address. + * + * @param address Global address pointer. + * @param result Non-volatile memory address. + * + * @return True if global address pointer belongs to NVM region, false otherwise. + */ +bool suit_memory_global_address_to_nvm_address(uintptr_t address, struct nvm_address *result); + +/** + * @brief Convert NVM address to global address pointer. + * + * @param address Non-volatile memory address. + * @param result Global address pointer. + * + * @return True if conversion was successful, false otherwise. + */ +bool suit_memory_nvm_address_to_global_address(struct nvm_address *address, uintptr_t *result); + +/** + * @brief Check if global address pointer is in NVM region. + * + * @param address Global address pointer. + * + * @return True if global address pointer belongs to NVM region, false otherwise. + */ +bool suit_memory_global_address_is_in_nvm(uintptr_t address); + +/** + * @brief Check if global address range is in the same NVM region. + * + * @param address Global address pointer. + * @param size Region size. + * + * @return True if global address pointer belongs to NVM region, false otherwise. + */ +bool suit_memory_global_address_range_is_in_nvm(uintptr_t address, size_t size); + +/** + * @brief Check if global address pointer is in RAM region. + * + * @param address Global address pointer. + * + * @return True if global address pointer belongs to RAM region, false otherwise. + */ +bool suit_memory_global_address_is_in_ram(uintptr_t address); + +/** + * @brief Convert global address to RAM address. + * + * This function is relevant only on simulated platforms. Otherwise its an identity. + * + * @param address Global address pointer. + * + * @return RAM address. + */ +uintptr_t suit_memory_global_address_to_ram_address(uintptr_t address); + +/** + * @brief Check if global address range is in the same RAM region. + * + * @param address Global address pointer. + * @param size Region size. + * + * @return True if global address pointer belongs to RAM region, false otherwise. + */ +bool suit_memory_global_address_range_is_in_ram(uintptr_t address, size_t size); + +/** + * @brief Check if global address is in external memory region. + * + * @param address Global address pointer. + * + * @return True if address is in external memory region, false otherwise. + */ +bool suit_memory_global_address_is_in_external_memory(uintptr_t address); + +/** + * @brief Check if global address range is in external memory region. + * + * @param address Global address pointer. + * + * @return True if address range is in external memory region, false otherwise. + */ +bool suit_memory_global_address_range_is_in_external_memory(uintptr_t address, size_t size); + +/** + * @brief Check if address points to a region readable through regular bus transactions. + * + * Directly readable regions can be read directly by the CPU with regular bus transactions. + * Such regions are the RAM and NVM memory integrated into the SoC. + * + * @param address Global address pointer. + * + * @return True if address points to directly readable region, false otherwise. + */ +bool suit_memory_global_address_is_directly_readable(uintptr_t address); + +/** + * @brief Convert global address to an offset within an external storage. + * + * @param address Global address pointer. + * + * @return Offset within external storage. + */ +bool suit_memory_global_address_to_external_memory_offset(uintptr_t address, uintptr_t *offset); + +/** + * @brief Get external memory controller flash_api instance. + * + * @return External memory controller flash_api instance. + */ +const struct device *suit_memory_external_memory_device_get(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_MEMORY_LAYOUT_H__ */ diff --git a/subsys/suit/memory_layout/src/suit_memory_layout.c b/subsys/suit/memory_layout/src/suit_memory_layout.c new file mode 100644 index 000000000000..75b792a99542 --- /dev/null +++ b/subsys/suit/memory_layout/src/suit_memory_layout.c @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +/* Definitions for SOC internal nonvolatile memory */ +#if (DT_NODE_EXISTS(DT_NODELABEL(mram1x))) /* nrf54H20 */ +#define INTERNAL_NVM_START (DT_REG_ADDR(DT_NODELABEL(mram1x))) +#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(mram1x)) +#elif (DT_NODE_EXISTS(DT_NODELABEL(mram10))) /* nrf54H20 */ +#define INTERNAL_NVM_START (DT_REG_ADDR(DT_NODELABEL(mram10))) +#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(mram10)) + DT_REG_SIZE(DT_NODELABEL(mram11)) +#elif (DT_NODE_EXISTS(DT_NODELABEL(flash0))) /* nrf52 or flash simulator */ +#define INTERNAL_NVM_START DT_REG_ADDR(DT_NODELABEL(flash0)) +#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(flash0)) +#elif (DT_NODE_EXISTS(DT_NODELABEL(rram0))) /* nrf54l15 */ +#define INTERNAL_NVM_START DT_REG_ADDR(DT_NODELABEL(rram0)) +#define INTERNAL_NVM_SIZE DT_REG_SIZE(DT_NODELABEL(rram0)) +#else +#error "No recognizable internal nvm nodes found." +#endif + +#if IS_ENABLED(CONFIG_FLASH) +#if (DT_NODE_EXISTS(DT_CHOSEN(zephyr_flash_controller))) +#define SUIT_PLAT_INTERNAL_NVM_DEV DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)) +#else +#define SUIT_PLAT_INTERNAL_NVM_DEV DEVICE_DT_GET(DT_CHOSEN(zephyr_flash)) +#endif +#else +#define SUIT_PLAT_INTERNAL_NVM_DEV NULL +#endif + +#if (DT_NODE_EXISTS(DT_ALIAS(spi_flash0))) +#define EXTERNAL_NVM_DEV DEVICE_DT_GET(DT_ALIAS(spi_flash0)) +#else +#define EXTERNAL_NVM_DEV NULL +#endif + +struct nvm_area { + uintptr_t na_start; + size_t na_size; + const struct device *na_fdev; +}; + +/* List of nonvolatile memory regions. */ +static const struct nvm_area nvm_area_map[] = { + { + .na_start = INTERNAL_NVM_START, + .na_size = INTERNAL_NVM_SIZE, + .na_fdev = SUIT_PLAT_INTERNAL_NVM_DEV, + }, + { + .na_start = CONFIG_SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_START, + .na_size = CONFIG_SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_SIZE, + .na_fdev = EXTERNAL_NVM_DEV, + }, +}; + +struct ram_area { + uintptr_t ra_start; + size_t ra_size; +}; + +/* List of RAM memories accessible for ram_sink */ +static struct ram_area ram_area_map[] = { +#if (DT_NODE_EXISTS(DT_NODELABEL(ram0x))) /* nrf54H20 */ + { + .ra_start = DT_REG_ADDR(DT_NODELABEL(ram0x)), + .ra_size = DT_REG_SIZE(DT_NODELABEL(ram0x)), + }, +#endif /* ram0x */ +#if (DT_NODE_EXISTS(DT_NODELABEL(ram20))) /* nrf54H20 */ + { + .ra_start = DT_REG_ADDR(DT_NODELABEL(ram20)), + .ra_size = DT_REG_SIZE(DT_NODELABEL(ram20)), + }, +#endif /* ram20 */ +#if (DT_NODE_EXISTS(DT_NODELABEL(cpuapp_ram0x_region))) /* nrf54H20 */ + { + .ra_start = DT_REG_ADDR(DT_NODELABEL(cpuapp_ram0x_region)), + .ra_size = DT_REG_SIZE(DT_NODELABEL(cpuapp_ram0x_region)), + }, +#endif /* ram0x */ +#if (DT_NODE_EXISTS(DT_NODELABEL(shared_ram20_region))) /* nrf54H20 */ + { + .ra_start = DT_REG_ADDR(DT_NODELABEL(shared_ram20_region)), + .ra_size = DT_REG_SIZE(DT_NODELABEL(shared_ram20_region)), + }, +#endif /* ram20 */ +#if (DT_NODE_EXISTS(DT_NODELABEL(sram0))) /* nrf52 or simulator */ + { + .ra_start = DT_REG_ADDR(DT_NODELABEL(sram0)), + .ra_size = DT_REG_SIZE(DT_NODELABEL(sram0)), + }, +#endif /* sram0 */ +}; + +/* In case of tests on native_posix RAM emulation is used and visible below + * mem_for_sim_ram is used as the buffer for emulation. It is here to allow not only + * write but also read operations with emulated RAM. Address is translated to point to + * the buffer. Size is taken from dts so it is required that the sram0 node is defined. + */ +#if (DT_NODE_EXISTS(DT_NODELABEL(sram0))) && defined(CONFIG_BOARD_NATIVE_POSIX) +#define SIM_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(sram0)) +#else +#define SIM_RAM_SIZE 0 +#endif + +static uint8_t mem_for_sim_ram[SIM_RAM_SIZE]; + +static uintptr_t area_address_get(const struct nvm_area *area) +{ + if (IS_ENABLED(CONFIG_FLASH_SIMULATOR)) { + size_t size; + + return (uintptr_t)flash_simulator_get_memory(area->na_fdev, &size); + } + + return area->na_start; +} + +static bool address_in_area(uintptr_t address, uintptr_t area_start, size_t area_size) +{ + uintptr_t area_end = area_start + area_size; + + return area_start <= address && address < area_end; +} + +static const struct nvm_area *find_area(uintptr_t address) +{ + for (int i = 0; i < ARRAY_SIZE(nvm_area_map); i++) { + if (address_in_area(address, area_address_get(&nvm_area_map[i]), + nvm_area_map[i].na_size)) { + return &nvm_area_map[i]; + } + } + + return NULL; +} + +static const struct ram_area *find_ram_area(uintptr_t address) +{ + for (int i = 0; i < ARRAY_SIZE(ram_area_map); i++) { + if (address_in_area(address, (uintptr_t)ram_area_map[i].ra_start, + ram_area_map[i].ra_size)) { + return &ram_area_map[i]; + } + } + + return NULL; +} + +static const struct nvm_area *find_area_by_device(const struct device *fdev) +{ + for (int i = 0; i < ARRAY_SIZE(nvm_area_map); i++) { + if (nvm_area_map[i].na_fdev == fdev) { + return &nvm_area_map[i]; + } + } + + return NULL; +} + +bool suit_memory_global_address_to_nvm_address(uintptr_t address, struct nvm_address *result) +{ + const struct nvm_area *area = find_area(address); + + if (result == NULL) { + return false; + } + + if (area == NULL) { + return false; + } + + result->fdev = area->na_fdev; + result->offset = address - area_address_get(area); + return true; +} + +bool suit_memory_nvm_address_to_global_address(struct nvm_address *address, uintptr_t *result) +{ + if (address == NULL || result == NULL) { + return false; + } + + const struct nvm_area *area = find_area_by_device(address->fdev); + + if (area == NULL) { + return false; + } + + *result = area_address_get(area) + address->offset; + + return true; +} + +bool suit_memory_global_address_is_in_nvm(uintptr_t address) +{ + return find_area(address) != NULL; +} + +bool suit_memory_global_address_range_is_in_nvm(uintptr_t address, size_t size) +{ + const struct nvm_area *start = find_area(address); + const struct nvm_area *end = find_area(address + size); + + return start != NULL && start == end; +} + +bool suit_memory_global_address_is_in_ram(uintptr_t address) +{ + if (IS_ENABLED(CONFIG_BOARD_NATIVE_POSIX)) { + return !suit_memory_global_address_is_in_nvm(address); + } + + return find_ram_area(address) != NULL; +} + +uintptr_t suit_memory_global_address_to_ram_address(uintptr_t address) +{ + if (IS_ENABLED(CONFIG_BOARD_NATIVE_POSIX) && DT_NODE_EXISTS(DT_NODELABEL(sram0))) { + const struct ram_area *area = find_ram_area(address); + + if (area) { + uintptr_t offset = address - area->ra_start; + + return (uintptr_t)mem_for_sim_ram + offset; + } + } + + return address; +} + +bool suit_memory_global_address_range_is_in_ram(uintptr_t address, size_t size) +{ + if (IS_ENABLED(CONFIG_BOARD_NATIVE_POSIX)) { + return !suit_memory_global_address_range_is_in_nvm(address, size); + } + + const struct ram_area *start = find_ram_area(address); + const struct ram_area *end = find_ram_area(address + size); + + return start != NULL && start == end; +} + +bool suit_memory_global_address_is_directly_readable(uintptr_t address) +{ + return !suit_memory_global_address_is_in_external_memory(address); +} + +bool suit_memory_global_address_is_in_external_memory(uintptr_t address) +{ + return address_in_area(address, CONFIG_SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_START, + CONFIG_SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_SIZE); +} + +bool suit_memory_global_address_range_is_in_external_memory(uintptr_t address, size_t size) +{ + uintptr_t end_addr = address + size; + + return suit_memory_global_address_is_in_external_memory(address) && + suit_memory_global_address_is_in_external_memory(end_addr) && + end_addr >= address; /* Overflow check. */ +} + +bool suit_memory_global_address_to_external_memory_offset(uintptr_t address, uintptr_t *offset) +{ + if (!suit_memory_global_address_is_in_external_memory(address)) { + return false; + } + + if (offset == NULL) { + return false; + } + + *offset = address - CONFIG_SUIT_MEMORY_LAYOUT_EXTMEM_ADDRESS_RANGE_START; + return true; +} + +const struct device *suit_memory_external_memory_device_get(void) +{ + return EXTERNAL_NVM_DEV; +} diff --git a/subsys/suit/memptr_storage/CMakeLists.txt b/subsys/suit/memptr_storage/CMakeLists.txt new file mode 100644 index 000000000000..8539d83c86b7 --- /dev/null +++ b/subsys/suit/memptr_storage/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_memptr_storage_interface) +target_include_directories(suit_memptr_storage_interface INTERFACE include) +target_link_libraries(suit_memptr_storage_interface INTERFACE suit_platform_err) + +zephyr_library() + +zephyr_library_sources(src/suit_memptr_storage.c) + +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/subsys/suit/memptr_storage/Kconfig b/subsys/suit/memptr_storage/Kconfig new file mode 100644 index 000000000000..9cd00b242cd6 --- /dev/null +++ b/subsys/suit/memptr_storage/Kconfig @@ -0,0 +1,20 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_MEMPTR_STORAGE + bool "Enable module for holding pointer to the memory" + +if SUIT_MEMPTR_STORAGE + +config SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS + int "The maximum number of envelope reference components that will be handled" + range 0 255 + help + Index is of type uint8_t, which restricts number of components of this type to 255. + Default value is 8 and minimal 0. Where 0 means that Envelope Reference component is disabled. + default 8 + +endif # SUIT_MEMPTR_STORAGE diff --git a/subsys/suit/memptr_storage/include/suit_memptr_storage.h b/subsys/suit/memptr_storage/include/suit_memptr_storage.h new file mode 100644 index 000000000000..e55c99f1d797 --- /dev/null +++ b/subsys/suit/memptr_storage/include/suit_memptr_storage.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_MEMPTR_STORAGE_H__ +#define SUIT_MEMPTR_STORAGE_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int suit_memptr_storage_err_t; + +/**< Invalid record */ +#define SUIT_MEMPTR_STORAGE_ERR_INVALID_RECORD 1 +/**< Write to unallocated record */ +#define SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD 2 + +typedef void *memptr_storage_handle_t; + +/** + * @brief Get the memptr storage object + * + * @param handle Memptr storage handle + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_NOMEM no free records were found + */ +suit_memptr_storage_err_t suit_memptr_storage_get(memptr_storage_handle_t *handle); + +/** + * @brief Release storage record + * + * @param handle Memptr storage handle + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + */ +suit_memptr_storage_err_t suit_memptr_storage_release(memptr_storage_handle_t handle); + +/** + * @brief + * + * @param handle Memptr storage handle + * @param payload_ptr Payload data pointer to be stored + * @param payload_size Payload data size + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD Attempt to write to unallocated record. + */ +suit_memptr_storage_err_t suit_memptr_storage_ptr_store(memptr_storage_handle_t handle, + const uint8_t *payload_ptr, + size_t payload_size); + +/** + * @brief Get the memptr ptr object + * + * @param handle Memptr storage handle + * @param payload_ptr Pointer to payload pointer + * @param payload_size Pointer to payload size + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD Attempt to read from unallocated record. + */ +suit_memptr_storage_err_t suit_memptr_storage_ptr_get(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_MEMPTR_STORAGE_H__ */ diff --git a/subsys/suit/memptr_storage/src/suit_memptr_storage.c b/subsys/suit/memptr_storage/src/suit_memptr_storage.c new file mode 100644 index 000000000000..fa67930e2534 --- /dev/null +++ b/subsys/suit/memptr_storage/src/suit_memptr_storage.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_memptr_storage, CONFIG_SUIT_LOG_LEVEL); + +struct memptr_storage { + const uint8_t *payload_ptr; + size_t payload_size; + bool in_use; +}; + +static struct memptr_storage records[CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS]; + +suit_memptr_storage_err_t suit_memptr_storage_get(memptr_storage_handle_t *handle) +{ + if (handle != NULL) { + for (size_t i = 0; i < CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS; i++) { + if (!records[i].in_use) { + records[i].in_use = true; + records[i].payload_size = 0; + records[i].payload_ptr = NULL; + + *handle = &records[i]; + + return SUIT_PLAT_SUCCESS; + }; + } + + LOG_ERR("No free records where found."); + return SUIT_PLAT_ERR_NOMEM; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_memptr_storage_err_t suit_memptr_storage_ptr_store(memptr_storage_handle_t handle, + const uint8_t *payload_ptr, + size_t payload_size) +{ + if (handle != NULL) { + struct memptr_storage *record = (struct memptr_storage *)handle; + + if (record->in_use) { + record->payload_ptr = payload_ptr; + record->payload_size = payload_size; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Write to unallocated record"); + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_memptr_storage_err_t suit_memptr_storage_ptr_get(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + if ((handle != NULL) && (payload_ptr != NULL) && (payload_size != NULL)) { + struct memptr_storage *record = (struct memptr_storage *)handle; + + if (record->in_use) { + *payload_ptr = record->payload_ptr; + *payload_size = record->payload_size; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid record."); + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +suit_memptr_storage_err_t suit_memptr_storage_release(memptr_storage_handle_t handle) +{ + if (handle != NULL) { + struct memptr_storage *record = (struct memptr_storage *)handle; + + record->in_use = false; + record->payload_size = 0; + record->payload_ptr = NULL; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/metadata/CMakeLists.txt b/subsys/suit/metadata/CMakeLists.txt new file mode 100644 index 000000000000..23840a5314b2 --- /dev/null +++ b/subsys/suit/metadata/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT Manifest Metadata types and conversion utilities +zephyr_interface_library_named(suit_metadata) +target_include_directories(suit_metadata INTERFACE include) +target_link_libraries(suit_metadata INTERFACE suit_platform_err) + +zephyr_library() +zephyr_library_sources(src/suit_metadata.c) + +zephyr_library_link_libraries(suit_metadata) diff --git a/subsys/suit/metadata/Kconfig b/subsys/suit/metadata/Kconfig new file mode 100644 index 000000000000..7c04b1952e6e --- /dev/null +++ b/subsys/suit/metadata/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_METADATA + bool "Enable SUIT Manifest Metadata types and conversion utilities" + +if SUIT_METADATA + +config APP_LINK_WITH_SUIT_METADATA + bool + default y + +endif # SUIT_METADATA diff --git a/subsys/suit/metadata/include/suit_metadata.h b/subsys/suit/metadata/include/suit_metadata.h new file mode 100644 index 000000000000..254ea8de9064 --- /dev/null +++ b/subsys/suit/metadata/include/suit_metadata.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_METADATA_H__ +#define SUIT_METADATA_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int suit_metadata_err_t; + +/**< Content of compared suit_uuid_t structures differs */ +#define METADATA_ERR_COMPARISON_FAILED 1 + +/* Define constant values for backward compatibility purposes. */ +typedef enum { + /** Digest status value uninitialized (invalid). */ + SUIT_DIGEST_UNKNOWN = 0, + /** Digest value does not match. */ + SUIT_DIGEST_MISMATCH = 1, + /** Digest value match, but was not checked for authenticity. */ + SUIT_DIGEST_UNAUTHENTICATED = 2, + /** Digest value match, but signature verification failed. */ + SUIT_DIGEST_INCORRECT_SIGNATURE = 3, + /** Digest value match and authenticated. */ + SUIT_DIGEST_AUTHENTICATED = 4, +} suit_digest_status_t; + +/* Values aligned with suit-update-management encoding. */ +typedef enum { + /** Regular release. */ + SUIT_VERSION_RELEASE_NORMAL = 0, + /** Release candidate. */ + SUIT_VERSION_RELEASE_RC = -1, + /** Beta pre-release. */ + SUIT_VERSION_RELEASE_BETA = -2, + /** Alpha pre-release. */ + SUIT_VERSION_RELEASE_ALPHA = -3, +} suit_version_release_type_t; + +/* Semantic version of the manifest. */ +typedef struct { + /** Type of the release. */ + suit_version_release_type_t type; + /* Major number. */ + int32_t major; + /* Minor number. */ + int32_t minor; + /* Patch number.*/ + int32_t patch; + /* Pre-release number. Always set to zero for regular releases. */ + int32_t pre_release_number; +} suit_version_t; + +/* Raw semantic version, as defined by the SUIT specification. */ +typedef struct { + int32_t raw[5]; + size_t len; +} suit_semver_raw_t; + +/* Manifest role encoded as two nibbles: . */ +typedef enum { + /** Manifest role uninitialized (invalid). */ + SUIT_MANIFEST_UNKNOWN = 0x00, + + /** Manifest describes the entry-point for all Nordic-controlled manifests. */ + SUIT_MANIFEST_SEC_TOP = 0x10, + /** Manifest describes SDFW firmware and recovery updates. */ + SUIT_MANIFEST_SEC_SDFW = 0x11, + /** Manifest describes SYSCTRL firmware update and boot procedures. */ + SUIT_MANIFEST_SEC_SYSCTRL = 0x12, + + /** Manifest describes the entry-point for all OEM-controlled manifests. */ + SUIT_MANIFEST_APP_ROOT = 0x20, + /** Manifest describes OEM-specific recovery procedure. */ + SUIT_MANIFEST_APP_RECOVERY = 0x21, + /** Manifest describes OEM-specific binaries, specific for application core. */ + SUIT_MANIFEST_APP_LOCAL_1 = 0x22, + /** Manifest describes OEM-specific binaries, specific for application core. */ + SUIT_MANIFEST_APP_LOCAL_2 = 0x23, + /** Manifest describes OEM-specific binaries, specific for application core. */ + SUIT_MANIFEST_APP_LOCAL_3 = 0x24, + + /** Manifest describes radio part of OEM-specific recovery procedure. */ + SUIT_MANIFEST_RAD_RECOVERY = 0x30, + /** Manifest describes OEM-specific binaries, specific for radio core. */ + SUIT_MANIFEST_RAD_LOCAL_1 = 0x31, + /** Manifest describes OEM-specific binaries, specific for radio core. */ + SUIT_MANIFEST_RAD_LOCAL_2 = 0x32, +} suit_manifest_role_t; + +/** The 128-bit UUID, used for identifying vendors as well as classes. */ +typedef struct { + uint8_t raw[16]; +} suit_uuid_t; + +/** The 128-bit UUID, identifying the SUIT manifest class. */ +typedef suit_uuid_t suit_manifest_class_id_t; + +/** Downgrade prevention policy for the manifest */ +typedef enum { + /** No downgrade prevention. */ + SUIT_DOWNGRADE_PREVENTION_DISABLED = 1, + /** Update forbidden if candidate version is lower than installed version */ + SUIT_DOWNGRADE_PREVENTION_ENABLED = 2, + /** Unknown downgrade prevention policy */ + SUIT_DOWNGRADE_PREVENTION_UNKNOWN = 3, +} suit_downgrade_prevention_policy_t; + +/** Policy determining if the manifest can be updated independently from its parent */ +typedef enum { + /** Independent update is forbidden. */ + SUIT_INDEPENDENT_UPDATE_DENIED = 1, + /** Independent update is allowed. */ + SUIT_INDEPENDENT_UPDATE_ALLOWED = 2, + /** Unknown independent updateability policy. */ + SUIT_INDEPENDENT_UPDATE_UNKNOWN = 3, +} suit_independent_updateability_policy_t; + +/** Manifest signature verification policy */ +typedef enum { + /** Do not verify the manifest signature */ + SUIT_SIGNATURE_CHECK_DISABLED = 1, + /** Verify the manifest signature only when performing update */ + SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE = 2, + /** Verify the manifest signature only both when performing update and when booting */ + SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT = 3, + /** Unknown signature verification policy */ + SUIT_SIGNATURE_CHECK_UNKNOWN = 4, +} suit_signature_verification_policy_t; + +typedef struct { + const suit_uuid_t *vendor_id; + const suit_manifest_class_id_t *class_id; + suit_manifest_role_t role; +} suit_manifest_class_info_t; + +/** + * @brief Checks if two suit_uuid_t structures hold the same uuid value + * + * @param[in] uuid1 UUID to compare. + * @param[in] uuid2 UUID to compare with. + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval METADATA_ERR_COMPARISON_FAILED content of UUIDs differs + */ +suit_metadata_err_t suit_metadata_uuid_compare(const suit_uuid_t *uuid1, const suit_uuid_t *uuid2); + +/** @brief Convert semantic version, encoded as array of integers into structure. + * + * @details The meaning of array elements is defined in suit-update-management extension. + * + * @param[out] version Pointer to the semantic version structure to be filled. + * @param[in] array The input array with integers. + * @param[in] array_len Length of the input array. + * + * @retval SUIT_PLAT_ERR_INVAL If one of the input parameters is NULL. + * @retval SUIT_PLAT_ERR_SIZE If the input array is too short to hold semantic version. + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS If version is negative or the release type is not supported. + * @retval SUIT_PLAT_SUCCESS If conversion was successful. + */ +suit_metadata_err_t suit_metadata_version_from_array(suit_version_t *version, int32_t *array, + size_t array_len); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_METADATA_H__ */ diff --git a/subsys/suit/metadata/src/suit_metadata.c b/subsys/suit/metadata/src/suit_metadata.c new file mode 100644 index 000000000000..4af0dc6fa49e --- /dev/null +++ b/subsys/suit/metadata/src/suit_metadata.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +suit_metadata_err_t suit_metadata_uuid_compare(const suit_uuid_t *uuid1, const suit_uuid_t *uuid2) +{ + if (NULL == uuid1 || NULL == uuid2) { + return SUIT_PLAT_ERR_INVAL; + } + + if (0 == memcmp(uuid1->raw, uuid2->raw, sizeof(((suit_uuid_t *)0)->raw))) { + return SUIT_PLAT_SUCCESS; + } + + return METADATA_ERR_COMPARISON_FAILED; +} + +suit_metadata_err_t suit_metadata_version_from_array(suit_version_t *version, int32_t *array, + size_t array_len) +{ + if ((version == NULL) || (array == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (array_len == 0) { + return SUIT_PLAT_ERR_SIZE; + } + + if (array[0] < 0) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + memset(version, 0, sizeof(*version)); + version->type = SUIT_VERSION_RELEASE_NORMAL; + + for (int i = 0; i < array_len; i++) { + if (array[i] >= 0) { + switch (i) { + case 0: + version->major = array[i]; + break; + case 1: + version->minor = array[i]; + break; + case 2: + version->patch = array[i]; + break; + default: + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + } else if (array[i] >= SUIT_VERSION_RELEASE_ALPHA) { + version->type = (suit_version_release_type_t)array[i]; + if ((array_len == (i + 2)) && (array[i + 1] >= 0)) { + version->pre_release_number = array[i + 1]; + return SUIT_PLAT_SUCCESS; + } else if (array_len == (i + 1)) { + return SUIT_PLAT_SUCCESS; + } + + /* If negative integer is found - the processing is finished. */ + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } else { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + } + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/orchestrator/CMakeLists.txt b/subsys/suit/orchestrator/CMakeLists.txt new file mode 100644 index 000000000000..16c1d2ef207d --- /dev/null +++ b/subsys/suit/orchestrator/CMakeLists.txt @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT Orchestrator API +zephyr_interface_library_named(suit_orchestrator_interface) +target_include_directories(suit_orchestrator_interface INTERFACE include) + +# SUIT Orchestrator implementation for SDFW +zephyr_library() +zephyr_library_sources(src/suit_orchestrator_sdfw.c) + +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_orchestrator_interface) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_mci) +zephyr_library_link_libraries(suit_platform_err) +zephyr_library_link_libraries(suit_execution_mode) +zephyr_library_link_libraries(suit_cache_interface) diff --git a/subsys/suit/orchestrator/Kconfig b/subsys/suit/orchestrator/Kconfig new file mode 100644 index 000000000000..fae9d2800e03 --- /dev/null +++ b/subsys/suit/orchestrator/Kconfig @@ -0,0 +1,31 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_ORCHESTRATOR + bool "Enable SUIT orchestrator module" + depends on SUIT_CRYPTO + depends on SUIT_PROCESSOR + depends on SUIT_STORAGE + depends on SUIT_UTILS + depends on SUIT_MCI + depends on SUIT_METADATA + depends on SUIT_PLATFORM_VARIANT_SDFW + +if SUIT_ORCHESTRATOR + +config SUIT_UPDATE_REBOOT_ENABLED + bool "Reboot the system after successful execution of the update path" + depends on REBOOT + +config SUIT_BOOT_RECOVERY_REBOOT_ENABLED + bool "Reboot the system after unsuccessful execution of the boot path" + depends on REBOOT + +config APP_LINK_WITH_SUIT_ORCHESTRATOR_INTERFACE + bool + default y + +endif # SUIT_ORCHESTRATOR diff --git a/subsys/suit/orchestrator/include/suit_orchestrator.h b/subsys/suit/orchestrator/include/suit_orchestrator.h new file mode 100644 index 000000000000..75d5669aa08b --- /dev/null +++ b/subsys/suit/orchestrator/include/suit_orchestrator.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_ORCHESTRATOR_H__ +#define SUIT_ORCHESTRATOR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the SUIT orchestrator before it can be used. + * + * @return 0 on success, non-zero value otherwise. + */ +int suit_orchestrator_init(void); + +/** + * @brief Main function of the orchestrator, starting boot or update. + * + * @return 0 on success, negative value otherwise. + */ +int suit_orchestrator_entry(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_ORCHESTRATOR_H__ */ diff --git a/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c b/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c new file mode 100644 index 000000000000..17d1cbf2f254 --- /dev/null +++ b/subsys/suit/orchestrator/src/suit_orchestrator_sdfw.c @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "suit_plat_err.h" +#include +#include + +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 { + STATE_STARTUP, + STATE_INVOKE, + STATE_INVOKE_RECOVERY, + STATE_INSTALL, + STATE_INSTALL_RECOVERY, + STATE_POST_INVOKE, + STATE_POST_INVOKE_RECOVERY, + STATE_POST_INSTALL, + STATE_ENTER_RECOVERY, +}; + +static suit_plat_err_t storage_emergency_flag_get(bool *flag) +{ + const uint8_t *fail_report; + size_t fail_report_len; + suit_plat_err_t ret = suit_storage_report_read(0, &fail_report, &fail_report_len); + + if (flag == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (ret == SUIT_PLAT_ERR_NOT_FOUND) { + *flag = false; + } else if (ret == SUIT_PLAT_SUCCESS) { + *flag = true; + } else { + LOG_ERR("Unable to read recovery flag: %d", ret); + *flag = true; + return ret; + } + + return SUIT_PLAT_SUCCESS; +} + +static int enter_emergency_recovery(void) +{ + /* TODO: Report boot status */ + suit_plat_err_t ret = suit_storage_report_save(0, NULL, 0); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to set recovery flag: %d", ret); + return -EIO; + } + + return 0; +} + +static void leave_emergency_recovery(void) +{ + suit_plat_err_t ret = suit_storage_report_clear(0); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to clear recovery flag: %d", ret); + } +} + +static int validate_update_candidate_address_and_size(const uint8_t *addr, size_t size) +{ + if (addr == NULL || addr == (void *)EMPTY_STORAGE_VALUE) { + LOG_DBG("Invalid update candidate address: %p", (void *)addr); + return -EFAULT; + } + + if (size == 0 || size == EMPTY_STORAGE_VALUE) { + LOG_DBG("Invalid update candidate size: %d", size); + return -EFAULT; + } + + return 0; +} + +static int initialize_dfu_cache(const suit_plat_mreg_t *update_regions, size_t update_regions_len) +{ + struct dfu_cache cache = {0}; + + if (update_regions == NULL || update_regions_len < 1) { + return -EINVAL; + } + + if ((update_regions_len - 1) > ARRAY_SIZE(cache.pools)) { + return -EINVAL; + } + + cache.pools_count = update_regions_len - 1; + + for (size_t i = 1; i < update_regions_len; i++) { + cache.pools[i - 1].address = (uint8_t *)update_regions[i].mem; + cache.pools[i - 1].size = update_regions[i].size; + } + + return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(suit_dfu_cache_initialize(&cache)); +} + +static int validate_update_candidate_manifest(uint8_t *manifest_address, size_t manifest_size) +{ + suit_independent_updateability_policy_t policy = SUIT_INDEPENDENT_UPDATE_DENIED; + suit_manifest_class_id_t *manifest_class_id = NULL; + struct zcbor_string manifest_component_id = { + .value = NULL, + .len = 0, + }; + + int err = suit_processor_get_manifest_metadata(manifest_address, manifest_size, true, + &manifest_component_id, NULL, 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); + } + + 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); + } + + 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); + } + + 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); + } + + 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 0; +} + +static int clear_update_candidate(void) +{ + int err = 0; + + 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); + } + + LOG_DBG("Update candidate cleared"); + + return 0; +} + +static int update_path(void) +{ + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + int err = suit_storage_update_cand_get(&update_regions, &update_regions_len); + + 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); + } + + LOG_DBG("Update candidate address: %p", (void *)update_regions[0].mem); + LOG_DBG("Update candidate size: %d", update_regions[0].size); + + err = validate_update_candidate_address_and_size(update_regions[0].mem, + update_regions[0].size); + if (err != 0) { + LOG_INF("Invalid update candidate: %d", err); + return err; + } + + err = initialize_dfu_cache(update_regions, update_regions_len); + + if (err != 0) { + LOG_ERR("Failed to initialize DFU cache pools: %d", err); + return err; + } + + err = validate_update_candidate_manifest((uint8_t *)update_regions[0].mem, + update_regions[0].size); + if (err != 0) { + LOG_ERR("Failed to validate update candidate manifest: %d", err); + return err; + } + LOG_INF("Manifest validated"); + + err = suit_process_sequence((uint8_t *)update_regions[0].mem, update_regions[0].size, + SUIT_SEQ_CAND_VERIFICATION); + if (err != SUIT_SUCCESS) { + if (err == SUIT_ERR_UNAVAILABLE_COMMAND_SEQ) { + LOG_DBG("Command sequence suit-candidate-verification not available - skip " + "it"); + err = 0; + } else { + LOG_ERR("Failed to execute suit-candidate-verification: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + } + LOG_DBG("suit-candidate-verification successful"); + + err = suit_process_sequence((uint8_t *)update_regions[0].mem, update_regions[0].size, + SUIT_SEQ_INSTALL); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to execute suit-install: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + + LOG_INF("suit-install successful"); + + return err; +} + +static int boot_envelope(const suit_manifest_class_id_t *class_id) +{ + const uint8_t *installed_envelope_address = NULL; + size_t installed_envelope_size = 0; + + suit_plat_err_t err = suit_storage_installed_envelope_get( + class_id, &installed_envelope_address, &installed_envelope_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get installed envelope data: %d", err); + return -ENOENT; + } + if (installed_envelope_address == NULL) { + LOG_ERR("Invalid envelope address"); + return -ENOENT; + } + if (installed_envelope_size == 0) { + LOG_ERR("Invalid envelope size"); + return -ENOENT; + } + LOG_DBG("Found installed envelope"); + + err = suit_process_sequence(installed_envelope_address, installed_envelope_size, + SUIT_SEQ_PARSE); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to validate installed root manifest: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + LOG_DBG("Validated installed root manifest"); + + unsigned int seq_num; + + err = suit_processor_get_manifest_metadata(installed_envelope_address, + installed_envelope_size, true, NULL, 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); + } + LOG_INF("Booting from manifest version: 0x%x", seq_num); + + err = suit_process_sequence(installed_envelope_address, installed_envelope_size, + SUIT_SEQ_VALIDATE); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to execute suit-validate: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + + LOG_INF("Processed suit-validate"); + + err = suit_process_sequence(installed_envelope_address, installed_envelope_size, + SUIT_SEQ_LOAD); + if (err != SUIT_SUCCESS) { + if (err == SUIT_ERR_UNAVAILABLE_COMMAND_SEQ) { + LOG_DBG("Command sequence suit-load not available - skip it"); + err = 0; + } else { + LOG_ERR("Failed to execute suit-load: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + } + LOG_INF("Processed suit-load"); + + err = suit_process_sequence(installed_envelope_address, installed_envelope_size, + SUIT_SEQ_INVOKE); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to execute suit-invoke: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + LOG_INF("Processed suit-invoke"); + + return 0; +} + +static int boot_path(bool emergency) +{ + const suit_manifest_class_id_t *class_ids_to_boot[CONFIG_SUIT_STORAGE_N_ENVELOPES] = {NULL}; + size_t class_ids_to_boot_len = ARRAY_SIZE(class_ids_to_boot); + int ret = 0; + + mci_err_t mci_ret = suit_mci_invoke_order_get( + (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); + } + + for (size_t i = 0; i < class_ids_to_boot_len; i++) { + ret = boot_envelope((const suit_manifest_class_id_t *)class_ids_to_boot[i]); + if (ret != 0) { + LOG_ERR("Booting %d manifest failed (%d)", i, ret); + if (emergency) { + /* Conditionally continue booting other envelopes. + * Recovery FW shall discover which parts of the system + * are available. + */ + continue; + } + return ret; + } + + LOG_DBG("Manifest %d booted", i); + } + + return ret; +} + +int suit_orchestrator_init(void) +{ + bool emergency_flag = true; + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + int err = suit_processor_init(); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to initialize suit processor: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + + suit_plat_err_t plat_err = suit_storage_init(); + + if (plat_err != SUIT_PLAT_SUCCESS) { + switch (plat_err) { + case SUIT_PLAT_ERR_AUTHENTICATION: + LOG_ERR("Failed to load MPI: invalid digest"); + plat_err = suit_execution_mode_set(EXECUTION_MODE_FAIL_NO_MPI); + break; + case SUIT_PLAT_ERR_NOT_FOUND: + LOG_ERR("Failed to load MPI: essential (Nordic, root) roles unconfigured"); + plat_err = suit_execution_mode_set(EXECUTION_MODE_FAIL_MPI_INVALID_MISSING); + break; + case SUIT_PLAT_ERR_OUT_OF_BOUNDS: + LOG_ERR("Failed to load MPI: invalid MPI format (i.e. version, values)"); + plat_err = suit_execution_mode_set(EXECUTION_MODE_FAIL_MPI_INVALID); + break; + case SUIT_PLAT_ERR_UNSUPPORTED: + LOG_ERR("Failed to load MPI: unsupported configuration"); + plat_err = suit_execution_mode_set(EXECUTION_MODE_FAIL_MPI_UNSUPPORTED); + break; + default: + LOG_ERR("Failed to init suit storage: %d", plat_err); + return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + } + + 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); + } + + LOG_WRN("Execution mode in a FAILED state"); + return SUIT_PLAT_SUCCESS; + } + + 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); + } + + plat_err = suit_storage_update_cand_get(&update_regions, &update_regions_len); + if (plat_err == SUIT_PLAT_ERR_NOT_FOUND) { + LOG_DBG("No update candidate provided"); + update_regions_len = 0; + } else if (plat_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Reading update candidate info failed: %d", plat_err); + update_regions_len = 0; + } + + plat_err = storage_emergency_flag_get(&emergency_flag); + if (plat_err != SUIT_PLAT_SUCCESS) { + LOG_WRN("Unable to read emergency flag: %d", plat_err); + emergency_flag = true; + } + + if (update_regions_len > 0) { + if (emergency_flag == false) { + plat_err = suit_execution_mode_set(EXECUTION_MODE_INSTALL); + } else { + plat_err = suit_execution_mode_set(EXECUTION_MODE_INSTALL_RECOVERY); + } + } else { + if (emergency_flag == false) { + plat_err = suit_execution_mode_set(EXECUTION_MODE_INVOKE); + } else { + plat_err = suit_execution_mode_set(EXECUTION_MODE_INVOKE_RECOVERY); + } + } + + if (plat_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Setting execution mode failed: %d", plat_err); + return SUIT_PLAT_ERR_TO_ZEPHYR_ERR(plat_err); + } + + LOG_DBG("SUIT orchestrator init ok"); + return 0; +} + +static int suit_orchestrator_run(void) +{ + enum suit_orchestrator_state state = STATE_STARTUP; + int ret = -EFAULT; + + /* Set the default state, based on the execution mode. */ + switch (suit_execution_mode_get()) { + case EXECUTION_MODE_INVOKE: + state = STATE_INVOKE; + break; + case EXECUTION_MODE_INVOKE_RECOVERY: + state = STATE_INVOKE_RECOVERY; + break; + case EXECUTION_MODE_INSTALL: + state = STATE_INSTALL; + break; + case EXECUTION_MODE_INSTALL_RECOVERY: + state = STATE_INSTALL_RECOVERY; + break; + + case EXECUTION_MODE_FAIL_NO_MPI: + case EXECUTION_MODE_FAIL_MPI_INVALID: + case EXECUTION_MODE_FAIL_MPI_INVALID_MISSING: + case EXECUTION_MODE_FAIL_MPI_UNSUPPORTED: + return -EFAULT; + + case EXECUTION_MODE_STARTUP: + case EXECUTION_MODE_POST_INVOKE: + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + default: + break; + } + + while (true) { + switch (state) { + case STATE_INSTALL: + LOG_INF("Update path"); + ret = update_path(); + state = STATE_POST_INSTALL; + break; + + case STATE_INSTALL_RECOVERY: + LOG_INF("Recovery update path"); + ret = update_path(); + if (ret == 0) { + leave_emergency_recovery(); + } + + state = STATE_POST_INSTALL; + break; + + case STATE_POST_INSTALL: + LOG_INF("Update finished: %d", ret); + + /* TODO: Report update status */ + + int clear_ret = clear_update_candidate(); + + if (clear_ret != 0) { + LOG_WRN("Unable to clear update candidate info: %d", clear_ret); + } + + if (IS_ENABLED(CONFIG_SUIT_UPDATE_REBOOT_ENABLED)) { + LOG_INF("Reboot the system after update: %d", ret); + LOG_PANIC(); + + sys_reboot(SYS_REBOOT_COLD); + } + return ret; + + case STATE_INVOKE: + LOG_INF("Boot path"); + ret = boot_path(false); + if (ret == 0) { + state = STATE_POST_INVOKE; + } else { + state = STATE_ENTER_RECOVERY; + } + break; + + case STATE_INVOKE_RECOVERY: + LOG_INF("Recovery boot path"); + ret = boot_path(true); + if (ret == 0) { + state = STATE_POST_INVOKE_RECOVERY; + } else { + return ret; + } + break; + + case STATE_ENTER_RECOVERY: + LOG_INF("Enter recovery mode"); + + ret = enter_emergency_recovery(); + if (ret != 0) { + LOG_WRN("Unable to enter emergency recovery: %d", ret); + } + + if (IS_ENABLED(CONFIG_SUIT_BOOT_RECOVERY_REBOOT_ENABLED)) { + LOG_INF("Reboot the system after unsuccessful boot: %d", ret); + LOG_PANIC(); + sys_reboot(SYS_REBOOT_COLD); + } + return -ENOTSUP; + + case STATE_POST_INVOKE: + if (suit_execution_mode_set(EXECUTION_MODE_POST_INVOKE) != + SUIT_PLAT_SUCCESS) { + LOG_WRN("Unable to change execution mode to INVOKE"); + } + return ret; + + case STATE_POST_INVOKE_RECOVERY: + if (suit_execution_mode_set(EXECUTION_MODE_POST_INVOKE_RECOVERY) != + SUIT_PLAT_SUCCESS) { + LOG_WRN("Unable to change execution mode to INVOKE RECOVERY"); + } + return ret; + + default: + LOG_ERR("Invalid state: %d", state); + return -EINVAL; + } + } + + return -EFAULT; +} + +int suit_orchestrator_entry(void) +{ +#if CONFIG_SUIT_DIGEST_CACHE + if (suit_plat_digest_cache_remove_all() != SUIT_SUCCESS) { + LOG_WRN("Unable to clear digest cache. Digest cache state corrupted."); + } +#endif + + int ret = suit_orchestrator_run(); + +#ifdef CONFIG_SUIT_LOG_SECDOM_VERSION + LOG_INF("Secdom version: %s", CONFIG_SUIT_SECDOM_VERSION); +#endif /* CONFIG_SUIT_LOG_SECDOM_VERSION */ + + return ret; +} diff --git a/subsys/suit/orchestrator_app/CMakeLists.txt b/subsys/suit/orchestrator_app/CMakeLists.txt new file mode 100644 index 000000000000..d3fdeb1db4c0 --- /dev/null +++ b/subsys/suit/orchestrator_app/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_library() +zephyr_library_sources(src/suit_orchestrator_app.c) + +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_PROCESSOR suit) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_IPC_PROVIDER suit_stream_sources_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_CACHE_RW suit_cache_interface) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_envelope_info) +zephyr_library_link_libraries(suit_platform_err) diff --git a/subsys/suit/orchestrator_app/Kconfig b/subsys/suit/orchestrator_app/Kconfig new file mode 100644 index 000000000000..81edcf7310ab --- /dev/null +++ b/subsys/suit/orchestrator_app/Kconfig @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_ORCHESTRATOR_APP + bool "Enable SUIT application orchestrator" + depends on SUIT_PLATFORM_VARIANT_APP + +if SUIT_ORCHESTRATOR_APP + +config SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + bool "Enable processing of the candidate envelope by the SUIT application orchestrator" + depends on SUIT_ENVELOPE_INFO + +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 new file mode 100644 index 000000000000..5fced8294689 --- /dev/null +++ b/subsys/suit/orchestrator_app/src/suit_orchestrator_app.c @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include + +#include +#include + +#if CONFIG_SUIT_PROCESSOR +#include +#endif +#include +#include +#include +#if CONFIG_SUIT_CACHE_RW +#include +#endif + +#if CONFIG_SUIT_STREAM_IPC_PROVIDER +#include +#endif + +#define FIXED_PARTITION_ERASE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), erase_block_size) + +#define DFU_PARTITION_LABEL dfu_partition +#define DFU_PARTITION_ADDRESS suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET) +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(DFU_PARTITION_LABEL) +#define DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_EB_SIZE FIXED_PARTITION_ERASE_BLOCK_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_WRITE_SIZE FIXED_PARTITION_WRITE_BLOCK_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) + +LOG_MODULE_REGISTER(suit_dfu, CONFIG_SUIT_LOG_LEVEL); + +#define SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err) ((err) == SUIT_SUCCESS ? 0 : -EACCES) + +#if CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + +static int dfu_partition_erase(void) +{ + const struct device *fdev = DFU_PARTITION_DEVICE; + + if (!device_is_ready(fdev)) { + return -ENODEV; + } + + /* Division is used to round down so that erase_size is aligned to DFU_PARTITION_EB_SIZE */ + size_t erase_size = (DFU_PARTITION_SIZE / DFU_PARTITION_EB_SIZE) * DFU_PARTITION_EB_SIZE; + + LOG_INF("Erasing dfu partition"); + + int rc = flash_erase(fdev, DFU_PARTITION_OFFSET, erase_size); + + if (rc < 0) { + return -EIO; + } + + return 0; +} + +#endif /* CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING */ + +int suit_dfu_initialize(void) +{ +#if CONFIG_SUIT_STREAM_IPC_PROVIDER + suit_ipc_streamer_provider_init(); +#endif + +#if CONFIG_SUIT_PROCESSOR + int err = suit_processor_init(); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to initialize suit processor: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } +#endif /* CONFIG_SUIT_PROCESSOR */ + + LOG_DBG("SUIT DFU module init ok"); + + return 0; +} + +#if CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING + +int suit_dfu_cleanup(void) +{ + int err = 0; + + suit_envelope_info_reset(); + + err = dfu_partition_erase(); + if (err != 0) { + return err; + } + +#if CONFIG_SUIT_CACHE_RW + if (suit_dfu_cache_rw_deinitialize() != SUIT_PLAT_SUCCESS) { + return -EIO; + } +#endif + + return 0; +} + +int suit_dfu_candidate_envelope_stored(void) +{ + suit_plat_err_t err; + + err = suit_envelope_info_candidate_stored((const uint8_t *)DFU_PARTITION_ADDRESS, + DFU_PARTITION_SIZE); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Invalid update candidate: %d", err); + + return -ENOTSUP; + } + +#if CONFIG_SUIT_CACHE_RW + /* All data to initialize cache partitions is present - initialize DFU cache. */ + const uint8_t *envelope_address = NULL; + size_t envelope_size = 0; + + err = suit_envelope_info_get(&envelope_address, &envelope_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Error when getting envelope address and size: %d", err); + return -EPIPE; + } + + err = suit_dfu_cache_rw_initialize((void *)envelope_address, envelope_size); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Error when initializing DFU cache: %d", err); + return -EIO; + } +#endif /* CONFIG_SUIT_CACHE_RW */ + + return 0; +} + +int suit_dfu_candidate_preprocess(void) +{ +#if CONFIG_SUIT_PROCESSOR + uint8_t *candidate_envelope_address; + size_t candidate_envelope_size; + + int err = suit_envelope_info_get((const uint8_t **)&candidate_envelope_address, + &candidate_envelope_size); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Invalid update candidate: %d", err); + + return -ENOTSUP; + } + + LOG_DBG("Update candidate address: %p", candidate_envelope_address); + LOG_DBG("Update candidate size: %d", candidate_envelope_size); + + err = suit_process_sequence(candidate_envelope_address, candidate_envelope_size, + SUIT_SEQ_DEP_RESOLUTION); + if (err == SUIT_SUCCESS) { + LOG_DBG("suit-dependency-resolution successful"); + } else if (err == SUIT_ERR_UNAVAILABLE_COMMAND_SEQ) { + LOG_DBG("suit-dependency-resolution sequence unavailable"); + } else { + LOG_ERR("Failed to execute suit-dependency-resolution: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + + err = suit_process_sequence(candidate_envelope_address, candidate_envelope_size, + SUIT_SEQ_PAYLOAD_FETCH); + if (err == SUIT_SUCCESS) { + LOG_DBG("suit-payload-fetch successful"); + } else if (err == SUIT_ERR_UNAVAILABLE_COMMAND_SEQ) { + LOG_DBG("suit-payload-fetch sequence unavailable"); + } else { + LOG_ERR("Failed to execute suit-payload-fetch: %d", err); + return SUIT_PROCESSOR_ERR_TO_ZEPHYR_ERR(err); + } + +#endif /* CONFIG_SUIT_PROCESSOR */ + + return 0; +} + +int suit_dfu_update_start(void) +{ + const uint8_t *region_address; + size_t region_size; + size_t update_regions_count = 1; + + int err = suit_envelope_info_get((const uint8_t **)®ion_address, ®ion_size); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Invalid update candidate: %d", err); + + return -ENOTSUP; + } + + LOG_INF("Reboot the system and trigger the update"); + + LOG_PANIC(); + +#if CONFIG_SUIT_CACHE_RW + suit_plat_mreg_t update_candidate[CONFIG_SUIT_CACHE_MAX_CACHES + 1]; +#else + suit_plat_mreg_t update_candidate[1]; +#endif + + update_candidate[0].mem = region_address; + update_candidate[0].size = region_size; + +#if CONFIG_SUIT_CACHE_RW + for (size_t i = 0; i < CONFIG_SUIT_CACHE_MAX_CACHES; i++) { + if (suit_dfu_cache_rw_partition_info_get(i, ®ion_address, ®ion_size) == + SUIT_PLAT_SUCCESS) { + update_candidate[update_regions_count].mem = region_address; + update_candidate[update_regions_count].size = region_size; + update_regions_count++; + } + } +#endif + + return suit_trigger_update(update_candidate, update_regions_count); +} + +#endif /* CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING */ diff --git a/subsys/suit/plat_err/CMakeLists.txt b/subsys/suit/plat_err/CMakeLists.txt new file mode 100644 index 000000000000..7786697e499d --- /dev/null +++ b/subsys/suit/plat_err/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT Platform Errors +zephyr_interface_library_named(suit_platform_err) +target_include_directories(suit_platform_err INTERFACE include) diff --git a/subsys/suit/plat_err/include/suit_plat_err.h b/subsys/suit/plat_err/include/suit_plat_err.h new file mode 100644 index 000000000000..7371edd95149 --- /dev/null +++ b/subsys/suit/plat_err/include/suit_plat_err.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_ERR_H__ +#define SUIT_PLAT_ERR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* This file contains the definitions needed for error codes handling + * by the SUIT platform. + * + * Rules for error codes in the SUIT platform: + * + * The rules are split into two categories: Rules for the SUIT orchestrator and + * rules for the SUIT platform. + * + * Rules for the SUIT orchestrator: + * 1) The orchestrator functions return an int error code, taken from the error code + * pool defined by zephyr (in errno.h) as negative error codes. + * 2) The orchestrator converts any error code returned by a function from a SUIT + * platform/SUIT processor to a Zephyr error code. + * 3) Before the conversion of a SUIT error code to a Zephyr error code, the + * SUIT error code must be logged so that the information about the error is not + * lost. + * + * Rules for the SUIT platform: + * 1) The platform uses a set of common error codes as well as module error codes. + * The common error codes are integer lesser or equal to 0, the module error codes + * are positive integers. Additionally, if a common error has an equivalent + * in the zephyr errno.h then if possible the value of the error should be equal to the negative + * value of the corresponding error in errno.h if possible to make integration easier. + * For example SUIT_PLAT_ERR_INVAL should have the value of -EINVAL. + * 2) Values of error codes which do not have their equivalent in errno.h should start with -2000 + * (__ELASTERROR) + * 3) The suit_plat_err.h file defines the pool of common error codes, which must be understood + * by all modules in the SUIT platform. + * 4) Any function that is called by the SUIT processor MUST convert the platform error codes + * to error codes which are defined by the SUIT processor in suit_types.h. All other public + * functions defined in the platform directory should also do this. They can use + * the suit_plat_err_to_processor_err_convert function to do so, however they can also choose + * to convert the error differently. + * 5) Specific modules can extend the error codes pool. Error codes for a module must be positive + * integers to avoid collisions with common error code pool values. + * Note that error codes for modules might overlap. + * 6) If a module extends the error code pool it should define a type _err_t which + * is resolved to int and should use it as a return type. This does not have a functional + * value, however it indicates the meaning of the error codes. + * 7) A module dependent on a module which extends the common error code pool must understand + * the error codes of all its direct dependencies. + * 8) The public functions of a module must convert all of the error codes coming from its + * dependencies either to errors from its own error code pool or to errors from the common + * platform error pool. + * In other words, there is no "error code inheritance" from lower level modues. + * 9) If a dependent does not use the error codes of its dependency as its return values + * it must convert them. There is no single conversion function, as the resulting error + * code of the dependent might differ depending on the context. However helper macros + * such as SUIT_RETURN_IF_SUIT_PLAT_ERR_CODE which have usage for many cases can be used. + * 10) Modules might define their own, internal error code pools not exported outside of the + * module. These error codes must be positive integers to avoid collisions with common error + * code pool values. + * 11) It is recommended to use the error codes from the common error code pool unless it is + * really necessary - the main reason for adding module specific error codes should be + * the need of a higher layer module to control its flow based on lower level module + * error codes, NOT the need of precise logging/debugging. + */ + +typedef int suit_plat_err_t; + +/** Common error codes for the SUIT platform. + * + * This error code list should contain generic errors. + * It is recommended to avoid extending it unless really necessary. + */ +#define SUIT_PLAT_SUCCESS 0 +#define SUIT_PLAT_ERR_IO -5 /**< I/O error */ +#define SUIT_PLAT_ERR_NOMEM -12 /**< Not enough space */ +#define SUIT_PLAT_ERR_ACCESS -13 /**< Permission denied */ +#define SUIT_PLAT_ERR_BUSY -16 /**< Resource is busy */ +#define SUIT_PLAT_ERR_EXISTS -17 /**< Element already exists */ +#define SUIT_PLAT_ERR_INVAL -22 /**< Invalid parameter value */ +#define SUIT_PLAT_ERR_TIME -62 /**< Timeout */ + +#define SUIT_PLAT_ERR_CRASH -2001 /**< Execution crashed */ +#define SUIT_PLAT_ERR_SIZE -2002 /**< Invalid parameter size */ +#define SUIT_PLAT_ERR_OUT_OF_BOUNDS -2003 /**< Out of bounds */ +#define SUIT_PLAT_ERR_NOT_FOUND -2004 /**< Entity not found */ +#define SUIT_PLAT_ERR_INCORRECT_STATE -2005 /**< Incorrect state to perform the operation */ +#define SUIT_PLAT_ERR_HW_NOT_READY -2006 /**< Hardware is not ready */ +#define SUIT_PLAT_ERR_AUTHENTICATION -2007 /**< Authentication failed */ +#define SUIT_PLAT_ERR_UNREACHABLE_PATH -2008 /**< Firmware executed an unreachable path */ +#define SUIT_PLAT_ERR_CBOR_DECODING -2009 /**< CBOR string decoding error */ +#define SUIT_PLAT_ERR_UNSUPPORTED -2010 /**< Attempt to perform an unsupported operation */ +#define SUIT_PLAT_ERR_IPC -2011 /**< IPC error */ +#define SUIT_PLAT_ERR_NO_RESOURCES -2012 /**< Not enough resources */ + +/** + * If the error code is a common platform error code return it. + */ +#define SUIT_RETURN_IF_SUIT_PLAT_COMMON_ERR_CODE(err) \ + if ((err) < 0) { \ + return err; \ + } + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_ERR_H__ */ diff --git a/subsys/suit/platform/CMakeLists.txt b/subsys/suit/platform/CMakeLists.txt new file mode 100644 index 000000000000..4a5e081024a0 --- /dev/null +++ b/subsys/suit/platform/CMakeLists.txt @@ -0,0 +1,45 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT Platform API +zephyr_interface_library_named(suit_platform_interface) +target_include_directories(suit_platform_interface INTERFACE include) + +# SUIT Platform implementation +zephyr_library() + +zephyr_library_sources(src/suit_plat_components.c) +zephyr_library_sources(src/suit_plat_commands.c) +zephyr_library_sources(src/suit_plat_fetch.c) +zephyr_library_sources(src/suit_plat_retrieve_manifest.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_CHECK_IMAGE_MATCH src/suit_plat_check_image_match.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_MEMPTR_STORAGE src/suit_plat_memptr_size_update.c) +zephyr_library_sources(src/suit_plat_error_convert.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_DIGEST src/suit_plat_digest.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_PLAT_CHECK_CLASSES src/suit_plat_class_check.c) + +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_platform_err) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memory_layout_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sinks_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sources_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_MEMPTR_STORAGE suit_memptr_storage_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_SINK_SELECTOR suit_sink_selector_interface) + +if(CONFIG_SUIT_PLATFORM_VARIANT_APP) + add_subdirectory(app) +elseif(CONFIG_SUIT_PLATFORM_VARIANT_SDFW) + add_subdirectory(sdfw) +else() + message(FATAL_ERROR "Please select one of the supported SUIT platform variants") +endif() + +add_subdirectory_ifdef(CONFIG_SUIT_SINK_SELECTOR sink_selector) + +# SUIT common library definition (backward compatibility) +zephyr_interface_library_named(suit_common) diff --git a/subsys/suit/platform/Kconfig b/subsys/suit/platform/Kconfig new file mode 100644 index 000000000000..e37af087937e --- /dev/null +++ b/subsys/suit/platform/Kconfig @@ -0,0 +1,88 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_PLATFORM + bool "Enable SUIT component implementations" + depends on SUIT_PROCESSOR + depends on SUIT_UTILS + depends on SUIT_MEMPTR_STORAGE + +if SUIT_PLATFORM + +config SUIT_DEVCONFIG + bool "Enable manifest authorization and installation" + depends on SUIT_STORAGE + depends on SUIT_MCI + depends on SUIT_METADATA + +config SUIT_DIGEST + bool "Enable digest calculation" + depends on SUIT_STREAM_SINK_DIGEST + +config MAX_NUMBER_OF_MANIFEST_CLASS_IDS + int "Maximum number of supported manifest class IDs that can be handled" + range 1 200 + default 11 if SOC_SERIES_NRF54HX + default 5 if SOC_NRF52840 + default 5 if SOC_POSIX + help + Check SUIT_STORAGE_N_ENVELOPES + +if SUIT_PLATFORM_VARIANT_SDFW +rsource "sdfw/Kconfig" +endif # SUIT_PLATFORM_VARIANT_SDFW + +rsource "sink_selector/Kconfig" +endif # SUIT_PLATFORM + +config SUIT_CRYPTO + bool "Enable crypto backend, suitable for SUIT components" + imply MBEDTLS if !SOC_FAMILY_NORDIC_NRF + imply NRF_SECURITY if SOC_FAMILY_NORDIC_NRF + imply MBEDTLS_ENABLE_HEAP if SOC_FAMILY_NORDIC_NRF + imply ENTROPY_GENERATOR + imply PSA_CRYPTO_DRIVER_CRACEN + imply PSA_WANT_ALG_PURE_EDDSA + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC if SOC_FAMILY_NORDIC_NRF + imply PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT if SOC_FAMILY_NORDIC_NRF + imply PSA_WANT_ECC_TWISTED_EDWARDS_255 if SOC_FAMILY_NORDIC_NRF + + +if MBEDTLS + +# Make sure that PSA API compatibility layer is enabled +config MBEDTLS_PSA_CRYPTO_C + default y + +# Instruct mbedTLS to use Zephyr entropy +config MBEDTLS_ZEPHYR_ENTROPY + default y + +config SUIT_DEFAULT_MBEDTLS_CONFIG + bool "Use default mbedTLS configuration file" + default y + select MBEDTLS_USER_CONFIG_ENABLE + +config MBEDTLS_USER_CONFIG_FILE + default "user-tls-conf.h" if SUIT_DEFAULT_MBEDTLS_CONFIG +endif + +config SUIT_CHECK_IMAGE_MATCH + bool "Enable image digest verification" + depends on SUIT_CRYPTO + depends on SUIT_DIGEST + depends on SUIT_STREAM + depends on SUIT_STREAM_SINK_DIGEST + depends on SUIT_STREAM_SOURCE_MEMPTR + +config SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + bool "Enable component ID check against supported manifest class IDs" + depends on SUIT_UTILS + depends on SUIT_METADATA + +config SUIT_PLAT_CHECK_CLASSES + bool "Enable vendor/class/device class ID checks" + depends on SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY diff --git a/subsys/suit/platform/app/CMakeLists.txt b/subsys/suit/platform/app/CMakeLists.txt new file mode 100644 index 000000000000..cb458fed153e --- /dev/null +++ b/subsys/suit/platform/app/CMakeLists.txt @@ -0,0 +1,32 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT APP Platform API +zephyr_interface_library_named(suit_app_platform) +target_include_directories(suit_app_platform INTERFACE include) +target_link_libraries(suit_app_platform INTERFACE suit) + +zephyr_library() + +zephyr_library_sources(src/suit_plat_swap.c) +zephyr_library_sources(src/suit_plat_fetch_app_specific.c) +zephyr_library_sources(src/suit_plat_copy.c) +zephyr_library_sources(src/suit_plat_write.c) +zephyr_library_sources(src/suit_plat_retrieve_manifest_app_specific.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_CHECK_IMAGE_MATCH src/suit_plat_check_image_match_app_specific.c) +zephyr_library_sources(src/suit_plat_authenticate.c) +zephyr_library_sources(src/suit_plat_devconfig.c) +zephyr_library_sources(src/suit_plat_check_content.c) +zephyr_library_sources(src/suit_plat_manifest_info.c) +zephyr_library_sources(src/suit_plat_invoke.c) + +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sinks_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sources_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_SINK_SELECTOR suit_sink_selector_interface) + +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/subsys/suit/platform/app/src/suit_plat_authenticate.c b/subsys/suit/platform/app/src/suit_plat_authenticate.c new file mode 100644 index 000000000000..d7c2bedfb5eb --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_authenticate.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +LOG_MODULE_REGISTER(suit_plat_authenticate, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_authorize_component_id(struct zcbor_string *manifest_component_id, + struct zcbor_string *component_id) +{ + suit_manifest_class_id_t *class_id = NULL; + + if ((manifest_component_id == NULL) || (component_id == NULL) || + (manifest_component_id->value == NULL) || (manifest_component_id->len == 0) || + (component_id->value == NULL) || (component_id->len == 0)) { + return SUIT_ERR_DECODING; + } + + /* Check if component ID is a manifest class */ + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Component ID is not a manifest class"); + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + + return suit_plat_component_compatibility_check(class_id, component_id); +} + +int suit_plat_authorize_process_dependency(struct zcbor_string *parent_component_id, + struct zcbor_string *child_component_id, + enum suit_command_sequence seq_name) +{ + suit_manifest_class_id_t *parent_class_id = NULL; + suit_manifest_class_id_t *child_class_id = NULL; + suit_manifest_role_t parent_role = SUIT_MANIFEST_UNKNOWN; + suit_manifest_role_t child_role = SUIT_MANIFEST_UNKNOWN; + + suit_plat_err_t err = + suit_plat_decode_manifest_class_id(parent_component_id, &parent_class_id); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to parse parent manifest class ID (err: %i)", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + err = suit_plat_decode_manifest_class_id(child_component_id, &child_class_id); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to parse child manifest class ID (err: %i)", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + int ret = suit_plat_manifest_role_get(parent_class_id, &parent_role); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Unable to find parent manifest role (err: %i)", err); + return ret; + } + + ret = suit_plat_manifest_role_get(child_class_id, &child_role); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Unable to find child manifest role (err: %i)", err); + return ret; + } + + /* Nordic top is allowed to fetch SCFW and SDFW manifests. */ + if ((parent_role == SUIT_MANIFEST_SEC_TOP) && + ((child_role == SUIT_MANIFEST_SEC_SYSCTRL) || (child_role == SUIT_MANIFEST_SEC_SDFW))) { + return SUIT_SUCCESS; + } + + /* Application root is allowed to fetch any local as well as Nordic top manifest. */ + if ((parent_role == SUIT_MANIFEST_APP_ROOT) && + (((child_role >= SUIT_MANIFEST_APP_LOCAL_1) && + (child_role <= SUIT_MANIFEST_APP_LOCAL_3)) || + ((child_role >= SUIT_MANIFEST_RAD_LOCAL_1) && + (child_role <= SUIT_MANIFEST_RAD_LOCAL_2)) || + (child_role == SUIT_MANIFEST_SEC_TOP))) { + return SUIT_SUCCESS; + } + + /* Application recovery may fetch only the radio recovery manifest. */ + if ((parent_role == SUIT_MANIFEST_APP_RECOVERY) && + (child_role == SUIT_MANIFEST_RAD_RECOVERY)) { + return SUIT_SUCCESS; + } + + LOG_INF("Manifest dependency link unauthorized for sequence %d (err: %i)", seq_name, ret); + + return SUIT_ERR_UNAUTHORIZED_COMPONENT; +} diff --git a/subsys/suit/platform/app/src/suit_plat_check_content.c b/subsys/suit/platform/app/src/suit_plat_check_content.c new file mode 100644 index 000000000000..ebc4b7a35085 --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_check_content.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +LOG_MODULE_REGISTER(suit_plat_check_content, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_content(suit_component_t component, struct zcbor_string *content) +{ + (void) component; + (void) content; + + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/app/src/suit_plat_check_image_match_app_specific.c b/subsys/suit/platform/app/src/suit_plat_check_image_match_app_specific.c new file mode 100644 index 000000000000..c3cd1d90c30f --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_check_image_match_app_specific.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +#include +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +LOG_MODULE_REGISTER(suit_plat_check_image_match_app, CONFIG_SUIT_LOG_LEVEL); + +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED +static int suit_plat_check_image_match_ssf(struct zcbor_string *component_id, + enum suit_cose_alg alg_id, struct zcbor_string *digest) +{ + suit_plat_mreg_t component_id_mreg = { + .mem = component_id->value, + .size = component_id->len, + }; + + suit_plat_mreg_t digest_mreg = { + .mem = digest->value, + .size = digest->len, + }; + + suit_ssf_err_t ret = suit_check_installed_component_digest(&component_id_mreg, (int)alg_id, + &digest_mreg); + + switch (ret) { + case SUIT_PLAT_SUCCESS: + return SUIT_SUCCESS; + case SUIT_SSF_FAIL_CONDITION: + return SUIT_FAIL_CONDITION; + case SUIT_SSF_MISSING_COMPONENT: + return SUIT_FAIL_CONDITION; + case SUIT_PLAT_ERR_UNSUPPORTED: + return SUIT_ERR_UNSUPPORTED_PARAMETER; + default: + break; + } + + return SUIT_ERR_CRASH; +} +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + +int suit_plat_check_image_match_domain_specific(suit_component_t component, + enum suit_cose_alg alg_id, + struct zcbor_string *digest, + struct zcbor_string *component_id, + suit_component_type_t component_type) +{ + int err = SUIT_SUCCESS; + + switch (component_type) { + case SUIT_COMPONENT_TYPE_INSTLD_MFST: + case SUIT_COMPONENT_TYPE_MEM: + case SUIT_COMPONENT_TYPE_SOC_SPEC: { +#ifdef CONFIG_SSF_SUIT_SERVICE_ENABLED + err = suit_plat_check_image_match_ssf(component_id, alg_id, digest); +#else + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +#endif /* CONFIG_SSF_SUIT_SERVICE_ENABLED */ + break; + } + default: + /* Should never get here */ + err = SUIT_ERR_TAMP; + break; + } + + return err; +} diff --git a/subsys/suit/platform/app/src/suit_plat_copy.c b/subsys/suit/platform/app/src/suit_plat_copy.c new file mode 100644 index 000000000000..884037f8d55c --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_copy.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_plat_copy, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_copy(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_copy(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/app/src/suit_plat_devconfig.c b/subsys/suit/platform/app/src/suit_plat_devconfig.c new file mode 100644 index 000000000000..6d53ada07648 --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_devconfig.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +LOG_MODULE_REGISTER(suit_plat_devconfig, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_sequence_completed(enum suit_command_sequence seq_name, + struct zcbor_string *manifest_component_id, + const uint8_t *envelope_str, size_t envelope_len) +{ + return SUIT_SUCCESS; +} diff --git a/subsys/suit/platform/app/src/suit_plat_fetch_app_specific.c b/subsys/suit/platform/app/src/suit_plat_fetch_app_specific.c new file mode 100644 index 000000000000..c75b48ad89dc --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_fetch_app_specific.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM + +#include +#include + +#ifdef CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR +#include "suit_fetch_source_streamer.h" +#endif /* CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR */ +#ifdef CONFIG_SUIT_STREAM_SOURCE_CACHE +#include +#endif /* CONFIG_SUIT_STREAM_SOURCE_CACHE */ + +LOG_MODULE_REGISTER(suit_plat_fetch_app, CONFIG_SUIT_LOG_LEVEL); + +bool suit_plat_fetch_domain_specific_is_type_supported(suit_component_type_t component_type) +{ + if ((component_type == SUIT_COMPONENT_TYPE_CAND_IMG) || + (component_type == SUIT_COMPONENT_TYPE_CAND_MFST) || + (component_type == SUIT_COMPONENT_TYPE_CACHE_POOL)) { + return true; + } + + return false; +} + +bool suit_plat_fetch_integrated_domain_specific_is_type_supported( + suit_component_type_t component_type) +{ + if ((component_type == SUIT_COMPONENT_TYPE_CAND_IMG) || + (component_type == SUIT_COMPONENT_TYPE_CAND_MFST)) { + return true; + } + + return false; +} + +int suit_plat_fetch_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink, struct zcbor_string *uri) +{ + int ret = SUIT_SUCCESS; + /* Select streamer */ + switch (dst_component_type) { +#ifdef CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR + case SUIT_COMPONENT_TYPE_CACHE_POOL: + case SUIT_COMPONENT_TYPE_MEM: { + ret = suit_fetch_source_stream(uri->value, uri->len, dst_sink); + ret = suit_plat_err_to_processor_err_convert(ret); + } break; +#endif /* SUIT_STREAM_FETCH_SOURCE_MGR */ +#if defined(CONFIG_SUIT_CACHE_RW) || defined(SUIT_CACHE) + case SUIT_COMPONENT_TYPE_CAND_MFST: + case SUIT_COMPONENT_TYPE_CAND_IMG: { + ret = suit_dfu_cache_streamer_stream(uri->value, uri->len, dst_sink); + ret = suit_plat_err_to_processor_err_convert(ret); + } break; +#endif + default: + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + if (ret == SUIT_SUCCESS && dst_component_type == SUIT_COMPONENT_TYPE_CACHE_POOL) { + suit_dfu_cache_sink_commit(dst_sink->ctx); + } + + return ret; +} + +int suit_plat_fetch_integrated_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink) +{ + (void)dst_handle; + (void)dst_component_type; + (void)dst_sink; + return SUIT_SUCCESS; +} + +#endif /* CONFIG_SUIT_STREAM */ diff --git a/subsys/suit/platform/app/src/suit_plat_invoke.c b/subsys/suit/platform/app/src/suit_plat_invoke.c new file mode 100644 index 000000000000..dc596b95a797 --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_invoke.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_plat_invoke, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_invoke(suit_component_t image_handle, struct zcbor_string *invoke_args) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_invoke(suit_component_t image_handle, struct zcbor_string *invoke_args) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/app/src/suit_plat_manifest_info.c b/subsys/suit/platform/app/src/suit_plat_manifest_info.c new file mode 100644 index 000000000000..90b9081ac19e --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_manifest_info.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +static int supported_manifest_class_infos_get(const suit_ssf_manifest_class_info_t **class_info, + size_t *out_size) +{ + static suit_ssf_manifest_class_info_t + manifest_class_infos_list[CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS] = {0}; + static size_t size = CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS; + static bool initialized; + + suit_manifest_role_t manifest_roles_list[CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS] = {0}; + + if (!initialized) { + suit_ssf_err_t ret = suit_get_supported_manifest_roles(manifest_roles_list, &size); + + if (ret != SUIT_PLAT_SUCCESS) { + return suit_plat_err_to_processor_err_convert(ret); + } + + for (size_t i = 0; i < size; i++) { + ret = suit_get_supported_manifest_info(manifest_roles_list[i], + &manifest_class_infos_list[i]); + + if (ret != SUIT_PLAT_SUCCESS) { + return suit_plat_err_to_processor_err_convert(ret); + } + } + + initialized = true; + } + + if (NULL == class_info || NULL == out_size) { + return SUIT_ERR_CRASH; + } + + if (*out_size < size) { + return SUIT_ERR_CRASH; + } + + *class_info = manifest_class_infos_list; + + *out_size = size; + + return SUIT_SUCCESS; +} + +int suit_plat_supported_manifest_class_infos_get(suit_manifest_class_info_t *class_info, + size_t *size) +{ + const suit_ssf_manifest_class_info_t *manifest_class_infos_list = NULL; + + if (NULL == class_info || NULL == size) { + return SUIT_ERR_CRASH; + } + + int ret = supported_manifest_class_infos_get(&manifest_class_infos_list, size); + + if (ret != SUIT_SUCCESS) { + return ret; + } + + for (size_t i = 0; i < *size; i++) { + class_info[i].role = manifest_class_infos_list[i].role; + class_info[i].class_id = &manifest_class_infos_list[i].class_id; + class_info[i].vendor_id = &manifest_class_infos_list[i].vendor_id; + } + + return SUIT_SUCCESS; +} + +int suit_plat_manifest_role_get(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + const suit_ssf_manifest_class_info_t *manifest_class_infos_list = NULL; + size_t size = CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS; + + if (role == NULL) { + return SUIT_ERR_CRASH; + } + + int ret = supported_manifest_class_infos_get(&manifest_class_infos_list, &size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + for (size_t i = 0; i < size; i++) { + if (suit_metadata_uuid_compare(class_id, &manifest_class_infos_list[i].class_id) == + SUIT_PLAT_SUCCESS) { + *role = manifest_class_infos_list[i].role; + return SUIT_SUCCESS; + } + } + + *role = SUIT_MANIFEST_UNKNOWN; + + return SUIT_ERR_CRASH; +} diff --git a/subsys/suit/platform/app/src/suit_plat_retrieve_manifest_app_specific.c b/subsys/suit/platform/app/src/suit_plat_retrieve_manifest_app_specific.c new file mode 100644 index 000000000000..75297f21c03e --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_retrieve_manifest_app_specific.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +int suit_plat_retrieve_manifest_domain_specific(struct zcbor_string *component_id, + suit_component_type_t component_type, + const uint8_t **envelope_str, size_t *envelope_len) +{ + (void)component_id; + (void)component_type; + (void)envelope_str; + (void)envelope_len; + + /* suit_plat_retrieve will only set the return value to success if some + * component type in the higher layer will be processed successfully. + */ + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} diff --git a/subsys/suit/platform/app/src/suit_plat_swap.c b/subsys/suit/platform/app/src/suit_plat_swap.c new file mode 100644 index 000000000000..563c300a44a1 --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_swap.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +int suit_plat_check_swap(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_swap(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/app/src/suit_plat_write.c b/subsys/suit/platform/app/src/suit_plat_write.c new file mode 100644 index 000000000000..42cca5d57205 --- /dev/null +++ b/subsys/suit/platform/app/src/suit_plat_write.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_plat_write, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_write(suit_component_t dst_handle, struct zcbor_string *content) +{ + LOG_ERR("SUIT directive write is not supported for app"); + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_write(suit_component_t dst_handle, struct zcbor_string *content) +{ + LOG_ERR("SUIT directive write is not supported for app"); + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/include/suit_plat_check_image_match_common.h b/subsys/suit/platform/include/suit_plat_check_image_match_common.h new file mode 100644 index 000000000000..bca357378c7b --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_check_image_match_common.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_CHECK_IMAGE_MATCH_COMMON_H__ +#define SUIT_PLAT_CHECK_IMAGE_MATCH_COMMON_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief suit_plat_check_image_match for "memory mapped" components. + * Calculates the digest of the memory area represented by @p component + * and compares it to the digest in @p digest. + */ +int suit_plat_check_image_match_mem_mapped(suit_component_t component, + enum suit_cose_alg alg_id, + struct zcbor_string *digest); + +/** + * @brief suit_plat_check_image_match for manifest components. + * Retrieves the envelope from the implementation data of @p component, + * extracts the manifest digest from the envelope, + * and compares it to the digest in @p digest. + */ +int suit_plat_check_image_match_mfst(suit_component_t component, enum suit_cose_alg alg_id, + struct zcbor_string *digest); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_CHECK_IMAGE_MATCH_COMMON_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_check_image_match_domain_specific.h b/subsys/suit/platform/include/suit_plat_check_image_match_domain_specific.h new file mode 100644 index 000000000000..5ae9c1ba6818 --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_check_image_match_domain_specific.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_CHECK_IMAGE_MATCH_DOMAIN_SPECIFIC_H__ +#define SUIT_PLAT_CHECK_IMAGE_MATCH_DOMAIN_SPECIFIC_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Domain specific part of the of the suit_plat_check_image_match function + */ +int suit_plat_check_image_match_domain_specific(suit_component_t component, + enum suit_cose_alg alg_id, + struct zcbor_string *digest, + struct zcbor_string *component_id, + suit_component_type_t component_type); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_CHECK_IMAGE_MATCH_DOMAIN_SPECIFIC_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_component_compatibility.h b/subsys/suit/platform/include/suit_plat_component_compatibility.h new file mode 100644 index 000000000000..10d3bb8a7531 --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_component_compatibility.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ +#define SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Check component ID and manifest class ID against supported manifests + * + * @param class_id Class ID to be checked + * @param component_id Component ID to be checked + * @return int ) in case of success, otherwise error code + */ +int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_digest_cache.h b/subsys/suit/platform/include/suit_plat_digest_cache.h new file mode 100644 index 000000000000..edca26e6211b --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_digest_cache.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @brief Module that contains a cache holding pointers to digests. + * + * In some cases the firmware needs to quickly access the digests for images + * which have already been verified. To avoid having to go through the execution + * of the whole manifest in order to obtain these digests caching was added. + * + * Instead of copying whole digests into the cache pointers to the digests present in the + * envelope kept in the non volatile memory are kept in the cache. + * This can be done under one assumption - the memory holding the given digests + * MUST NOT be changed as long as the pointer to this digest is kept in the cache. + * This assumption is currently met, as the memory which holds the envelope + * during normal operation is only changed after the firmware update starts + * - at the start of these procedure the cache should be cleared and during this + * procedure caching of digests should be disabled. + */ + +#ifndef SUIT_PLAT_DIGEST_CACHE_H__ +#define SUIT_PLAT_DIGEST_CACHE_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Add a (component_id, digest) pair to the cache. + * If the given component_id is already present in the cache, update the cached digest. + * + * @note Neither the component_id nor the digest bytes will be copied. + * Instead links to the memory area pointed by the .value fields of the zbor_string + * structures will be added to the cache. + * The user of this API must make sure that the contents of the memory to which these + * parameters point are not changed as long as the entry is present in the cache. + * + * @param[in] component_id CBOR string containing the Component ID data. + * @param[in] alg_id The algorithm used to calculate the digest. + * @param[in] digest CBOR string containing the digest for the given Component ID. + * + * @retval SUIT_SUCCESS Entry added or updated successfully + * @retval SUIT_ERR_UNSUPPORTED_PARAMETER One of the parameters is not a valid pointer + * @retval SUIT_ERR_OVERFLOW The cache is full + * @retval SUIT_ERR_CRASH Crash - failed to acquire mutex to store data + */ +int suit_plat_digest_cache_add(struct zcbor_string *component_id, enum suit_cose_alg alg_id, + struct zcbor_string *digest); + +/** + * @brief Invalidate element in the cache + * + * @param[in] component_id CBOR string containing the Component ID data. + * + * @retval SUIT_SUCCESS Invalidating the element was successful + * @retval SUIT_ERR_CRASH Crash - failed to acquire mutex to store data + */ +int suit_plat_digest_cache_remove(struct zcbor_string *component_id); + +/** + * @brief Check if the digest stored in the cache for a given component is matching + * the provided digest. + * + * @param[in] component_id The Component ID. + * @param[in] alg_id The algorithm used to calculate the digest. + * @param[out] digest The CBOR string containing the digest to compare against. + * + * @retval SUIT_SUCCESS The provided digest and the digest stored for the + * given Component ID are matching + * @retval SUIT_FAIL_CONDITION The provided digest does not match the digest stored + * for the given Component ID + * @retval SUIT_ERR_MISSING_COMPONENT The given Component ID was not found in the cache + * @retval SUIT_ERR_CRASH Crash - failed to acquire mutex to store data + */ +int suit_plat_digest_cache_compare(const struct zcbor_string *component_id, + enum suit_cose_alg alg_id, const struct zcbor_string *digest); + +/** + * @brief Invalidate all elements in the cache, + * + * @retval SUIT_SUCCESS Invalidating the cache was successful + * @retval SUIT_ERR_CRASH Crash - failed to acquire mutex to store data + */ +int suit_plat_digest_cache_remove_all(void); + +/** + * @brief This is an additional utility function which takes a component handle + * and removes the entry corresponding to a given component. + * + * @param[in] handle The component handle + * + * @retval SUIT_SUCCESS Invalidating the element was successful + * @retval SUIT_ERR_UNSUPPORTED_COMPONENT_ID The handle does not correspond to a valid + * Component ID. + * @retval SUIT_ERR_CRASH Crash - failed to acquire mutex to store data + */ +int suit_plat_digest_cache_remove_by_handle(suit_component_t handle); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_DIGEST_CACHE_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_driver_com.h b/subsys/suit/platform/include/suit_plat_driver_com.h new file mode 100644 index 000000000000..3045feb1504e --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_driver_com.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_DRIVER_COM_H__ +#define SUIT_PLAT_DRIVER_COM_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Validate component vid against expected value + * + * @param handle Component handle + * @param vid_uuid Component vid + * @return int Error code + */ +int suit_plat_com_vid_check(suit_component_t handle, struct zcbor_string *vid_uuid); + +/** + * @brief Validate component cid against expected value + * + * @param handle Component handle + * @param cid_uuid Component cid + * @return int Error code + */ +int suit_plat_com_cid_check(suit_component_t handle, struct zcbor_string *cid_uuid); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_DRIVER_COM_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_error_convert.h b/subsys/suit/platform/include/suit_plat_error_convert.h new file mode 100644 index 000000000000..7c5f074ede9d --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_error_convert.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_ERROR_CONVERT_H__ +#define SUIT_PLAT_ERROR_CONVERT_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Convert an error code used by the SUIT platform to an error used by + * the SUIT processor. + * + * @param plat_err A SUIT platform error code. This may be also an error + * code from a SUIT module extending the common platform error + * code pool. In this case it will be converted to SUIT_ERR_CRASH. + */ +int suit_plat_err_to_processor_err_convert(suit_plat_err_t plat_err); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_ERROR_CONVERT_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_fetch_domain_specific.h b/subsys/suit/platform/include/suit_plat_fetch_domain_specific.h new file mode 100644 index 000000000000..f20a1fcbebee --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_fetch_domain_specific.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_FETCH_DOMAIN_SPECIFIC_H__ +#define SUIT_PLAT_FETCH_DOMAIN_SPECIFIC_H__ + +#include +#include +#include +#ifdef CONFIG_SUIT_STREAM +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Return destination component type supported by suit_plat_fetch for the current domain + */ +bool suit_plat_fetch_domain_specific_is_type_supported(suit_component_type_t component_type); + +/** @brief Return destination component type supported by suit_plat_fetch_integrated + * for the current domain + */ +bool suit_plat_fetch_integrated_domain_specific_is_type_supported( + suit_component_type_t component_type); + +/** + * @brief Domain specific part of the core part of the suit_plat_fetch function. + */ +int suit_plat_fetch_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink, struct zcbor_string *uri); + +/** + * @brief Domain specific part of the core part of the suit_plat_fetch_integrated function + */ +int suit_plat_fetch_integrated_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink); + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_SUIT_STREAM */ +#endif /* SUIT_PLAT_FETCH_DOMAIN_SPECIFIC_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_manifest_info_internal.h b/subsys/suit/platform/include/suit_plat_manifest_info_internal.h new file mode 100644 index 000000000000..9dd13349368e --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_manifest_info_internal.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_MANIFEST_INFO_INTERNAL_H__ +#define SUIT_PLAT_MANIFEST_INFO_INTERNAL_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Gets an array of supported manifest class_info struct. This is + * a function which shall be supported on all domains. + * + * @param[out] class_info An array of `suit_manifest_class_info_t` structures to store the + * supported manifest class information. + * @param[in,out] size as input - maximal amount of elements an array can hold, + * as output - amount of stored elements + * @return SUIT_SUCCESS on success, error code otherwise. + * + */ +int suit_plat_supported_manifest_class_infos_get(suit_manifest_class_info_t *class_info, + size_t *size); + +/** + * @brief Find a role for a manifest with given class ID. + * + * @param[in] class_id Manifest class ID. + * @param[out] role Pointer to the role variable. + * + * @return SUIT_SUCCESS on success, error code otherwise. + */ +int suit_plat_manifest_role_get(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_MANIFEST_INFO_INTERNAL_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_memptr_size_update.h b/subsys/suit/platform/include/suit_plat_memptr_size_update.h new file mode 100644 index 000000000000..c068b191de4a --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_memptr_size_update.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_MEMPTR_SIZE_UPDATE_H__ +#define SUIT_PLAT_MEMPTR_SIZE_UPDATE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Update size in memptr attached to supplied handle + * + * @param handle Handle to component with attached memptr + * @param size New size to be set in memptr + * @return int SUIT_SUCCESS in case of success, otherwise error code + */ +int suit_plat_memptr_size_update(suit_component_t handle, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_MEMPTR_SIZE_UPDATE_H__ */ diff --git a/subsys/suit/platform/include/suit_plat_retrieve_manifest_domain_specific.h b/subsys/suit/platform/include/suit_plat_retrieve_manifest_domain_specific.h new file mode 100644 index 000000000000..9cbc37ae0f45 --- /dev/null +++ b/subsys/suit/platform/include/suit_plat_retrieve_manifest_domain_specific.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_RETRIEVE_MANIFEST_DOMAIN_SPECIFIC_H__ +#define SUIT_PLAT_RETRIEVE_MANIFEST_DOMAIN_SPECIFIC_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Domain specific part of the of the suit_plat_retrieve_manifest function + */ +int suit_plat_retrieve_manifest_domain_specific(struct zcbor_string *component_id, + suit_component_type_t component_type, + const uint8_t **envelope_str, size_t *envelope_len); + + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_RETRIEVE_MANIFEST_DOMAIN_SPECIFIC_H__ */ diff --git a/subsys/suit/platform/include/suit_platform_internal.h b/subsys/suit/platform/include/suit_platform_internal.h new file mode 100644 index 000000000000..03d95f5e2abc --- /dev/null +++ b/subsys/suit/platform/include/suit_platform_internal.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLATFORM_INTERNAL_H__ +#define SUIT_PLATFORM_INTERNAL_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief SUIT component type. + * + * @details To provide a better flexibility in the component ID definitions, + * it is advised to use the decoding function and the type defined below + * to evaluate which type of the component is being processed. + */ +typedef enum { + /** Reserved value, indicating that component type is not defined by any of the known + * values. + */ + SUIT_COMPONENT_TYPE_UNSUPPORTED, + + /** MCU memory-mapped slot (MRAM, RAM, external flash). */ + SUIT_COMPONENT_TYPE_MEM, + + /** Reference to dependency candidate envelope in candidate envelope or in the download + * cache. + */ + SUIT_COMPONENT_TYPE_CAND_MFST, + + /** Reference to integrated payload in candidate envelope or payload in the download cache. + */ + SUIT_COMPONENT_TYPE_CAND_IMG, + + /** Installed envelope, holding severed manifest and its authentication block. */ + SUIT_COMPONENT_TYPE_INSTLD_MFST, + + /** SOC-Specific component. Necessary in case if installation to or reading from this + * component type goes beyond 'memcpy-like' operations. + */ + SUIT_COMPONENT_TYPE_SOC_SPEC, + + /** SUIT Cache pool, where images downloaded during 'payload-fetch' sequence execution can + * be stored, ready for installation. + */ + SUIT_COMPONENT_TYPE_CACHE_POOL, +} suit_component_type_t; + +/** Set the pointer to the implementation-specific data. */ +int suit_plat_component_impl_data_set(suit_component_t handle, void *impl_data); + +/** Return the pointer to the implementation-specific data. */ +int suit_plat_component_impl_data_get(suit_component_t handle, void **impl_data); + +/** Return the full component ID associated with the component. */ +int suit_plat_component_id_get(suit_component_t handle, struct zcbor_string **component_id); + +/** Return component type based on component handle */ +int suit_plat_component_type_get(suit_component_t handle, suit_component_type_t *component_type); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLATFORM_INTERNAL_H__ */ diff --git a/subsys/suit/platform/sdfw/CMakeLists.txt b/subsys/suit/platform/sdfw/CMakeLists.txt new file mode 100644 index 000000000000..3583073eaed3 --- /dev/null +++ b/subsys/suit/platform/sdfw/CMakeLists.txt @@ -0,0 +1,47 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT SDFW Platform API +zephyr_interface_library_named(suit_sdfw_platform) +target_include_directories(suit_sdfw_platform INTERFACE include) +target_link_libraries(suit_sdfw_platform INTERFACE suit) + +zephyr_library() + +zephyr_library_sources(src/suit_plat_swap.c) +zephyr_library_sources(src/suit_plat_fetch_sdfw_specific.c) +zephyr_library_sources(src/suit_plat_copy.c) +zephyr_library_sources(src/suit_plat_write.c) +zephyr_library_sources(src/suit_plat_retrieve_manifest_sdfw_specific.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_DIGEST_CACHE src/suit_plat_digest_cache.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_CHECK_IMAGE_MATCH src/suit_plat_check_image_match_sdfw_specific.c) +zephyr_library_sources(src/suit_plat_check_content.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_DEVCONFIG src/suit_plat_devconfig.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_AUTHENTICATE src/suit_plat_authenticate.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY src/suit_plat_component_compatibility.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_PLAT_CHECK_CLASSES src/suit_plat_manifest_info.c) + +zephyr_library_sources(src/suit_plat_invoke.c) +if(${CONFIG_ZTEST}) + zephyr_library_sources(src/runners/suit_run_posix.c) +else () + zephyr_library_sources_ifdef(CONFIG_SUIT_PLATFORM_VARIANT_SDFW src/runners/suit_run_nrf54h20.c) +endif () + +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sinks_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM suit_stream_sources_interface) +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_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) + + +zephyr_library_link_libraries(suit_sdfw_platform) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/subsys/suit/platform/sdfw/Kconfig b/subsys/suit/platform/sdfw/Kconfig new file mode 100644 index 000000000000..bcee6c5a74c1 --- /dev/null +++ b/subsys/suit/platform/sdfw/Kconfig @@ -0,0 +1,35 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_DEVCONFIG + bool "Enable manifest authorization and installation" + depends on SUIT_STORAGE + depends on SUIT_MCI + depends on SUIT_METADATA + +config SUIT_DIGEST_CACHE + bool "Enable digest caching" + depends on SUIT_DIGEST + +if SUIT_DIGEST_CACHE + +config SUIT_DIGEST_CACHE_SIZE + int "Maximum number of entries in the digest cache" + default 16 + +endif + +config SUIT_AUTHENTICATE + bool "Enable message/data authentication" + depends on SUIT_CRYPTO + depends on SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + select PSA_WANT_ALG_SHA_256 if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_ALG_SHA_512 if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_ALG_ECDSA if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_ECC_SECP_R1_256 if SOC_FAMILY_NORDIC_NRF + select PSA_WANT_ECC_TWISTED_EDWARDS_255 if SOC_FAMILY_NORDIC_NRF diff --git a/subsys/suit/platform/sdfw/include/suit_cpu_run.h b/subsys/suit/platform/sdfw/include/suit_cpu_run.h new file mode 100644 index 000000000000..9bc006b599b4 --- /dev/null +++ b/subsys/suit/platform/sdfw/include/suit_cpu_run.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_RUN_CPU_H__ +#define SUIT_PLAT_RUN_CPU_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Run specified CPU. + * @note Implementation depends on SoC on which it's built. + * + * @param cpu_id ID of CPU to be started + * @param run_address Start address for given CPU + * @return int 0 in case of success, otherwise error code + */ +int suit_plat_cpu_run(uint8_t cpu_id, intptr_t run_address); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_RUN_CPU_H__ */ diff --git a/subsys/suit/platform/sdfw/src/runners/suit_run_nrf54h20.c b/subsys/suit/platform/sdfw/src/runners/suit_run_nrf54h20.c new file mode 100644 index 000000000000..8eef10d3a43e --- /dev/null +++ b/subsys/suit/platform/sdfw/src/runners/suit_run_nrf54h20.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#ifdef CONFIG_SDFW_RESET_HANDLING_ENABLED +#include +#endif /* CONFIG_SDFW_RESET_HANDLING_ENABLED */ + +LOG_MODULE_REGISTER(suit_plat_run, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_cpu_run(uint8_t cpu_id, intptr_t run_address) +{ + switch (cpu_id) { + case NRF_PROCESSOR_APPLICATION: /* AppCore */ + case NRF_PROCESSOR_RADIOCORE: { /* RadioCore */ +#ifdef CONFIG_SDFW_RESET_HANDLING_ENABLED + /* Single run address implies no NSVTOR, so keep at reset value of 0x0. */ + return reset_mgr_init_and_boot_processor(cpu_id, run_address, 0); +#else + return SUIT_SUCCESS; +#endif /* CONFIG_SDFW_RESET_HANDLING_ENABLED */ + } break; + + case NRF_PROCESSOR_BBPR: { /* BBPR - Baseband Processor */ + LOG_ERR("No implementation for BBPR invoke"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } break; + + case NRF_PROCESSOR_SYSCTRL: { /* SysCtrl */ + LOG_INF("Starting SysCtrl from address 0x%lx", run_address); + return vprs_sysctrl_start((uintptr_t)run_address); + } break; + + case NRF_PROCESSOR_PPR: /* PPR(VPR) */ + case NRF_PROCESSOR_FLPR: { /* FLPR(VPR) */ + LOG_ERR("No implementation for VPR invoke"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } break; + + default: { + LOG_ERR("Unsupported CPU ID"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + } +} diff --git a/subsys/suit/platform/sdfw/src/runners/suit_run_posix.c b/subsys/suit/platform/sdfw/src/runners/suit_run_posix.c new file mode 100644 index 000000000000..a6e4170e4b9c --- /dev/null +++ b/subsys/suit/platform/sdfw/src/runners/suit_run_posix.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +/* + * Meant to be used in integration tests on posix. + * May require changes to accommodate other cpu_ids + */ + +#define NRF_PROCESSORPOSIX_1 0 /* Secure Domain Processor */ +#define NRF_PROCESSORPOSIX_2 1 /* Application Core Processor */ + +LOG_MODULE_REGISTER(suit_plat_run, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_cpu_run(uint8_t cpu_id, intptr_t run_address) +{ + switch (cpu_id) { + case NRF_PROCESSORPOSIX_1: + case NRF_PROCESSORPOSIX_2: { + LOG_INF("Mock AppCore/RadioCore run"); + return SUIT_SUCCESS; + } break; + + default: { + LOG_ERR("Unsupported CPU ID (%d)", cpu_id); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + } +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c b/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c new file mode 100644 index 000000000000..92231bc16272 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_authenticate.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_SDFW_BUILTIN_KEYS +#include +#endif /* CONFIG_SDFW_BUILTIN_KEYS */ + +LOG_MODULE_REGISTER(suit_plat_authenticate, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_authenticate_manifest(struct zcbor_string *manifest_component_id, + enum suit_cose_alg alg_id, struct zcbor_string *key_id, + struct zcbor_string *signature, struct zcbor_string *data) +{ + psa_algorithm_t psa_alg; + psa_key_id_t public_key_id = 0; + suit_manifest_class_id_t *class_id = NULL; + + switch (alg_id) { + case suit_cose_es256: + psa_alg = PSA_ALG_ECDSA(PSA_ALG_SHA_256); + break; + case suit_cose_EdDSA: + psa_alg = PSA_ALG_PURE_EDDSA; /* ed25519/curve25519 without internal hashing */ + break; + default: + return SUIT_ERR_DECODING; + } + + if ((manifest_component_id == NULL) || (key_id == NULL) || (signature == NULL) || + (data == NULL) || (key_id->value == NULL) || (key_id->len == 0) || + (signature->value == NULL) || (signature->len == 0) || (data->value == NULL) || + (data->len == 0)) { + return SUIT_ERR_DECODING; + } + + /* Check if signature verification should be skipped. */ + int err = suit_plat_authorize_unsigned_manifest(manifest_component_id); + + if (err == SUIT_SUCCESS) { + LOG_WRN("Signature verification skipped due to MCI configuration."); + return err; + } + + /* Check if component ID is a manifest class */ + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Component ID is not a manifest class"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Validate manifest class ID against supported manifests */ + mci_err_t ret = suit_mci_manifest_class_id_validate(class_id); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Manifest class ID validation failed: MCI err %i", ret); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Try to get uint32_t key_id from zcbor_string */ + if (suit_plat_decode_key_id(key_id, &public_key_id) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Decoding key ID failed"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + /* Validate KEY ID */ + ret = suit_mci_signing_key_id_validate(class_id, public_key_id); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Signing key validation failed: MCI err %i", ret); + return SUIT_ERR_AUTHENTICATION; + } + + /* Verify data */ +#ifdef CONFIG_SDFW_BUILTIN_KEYS + if (sdfw_builtin_keys_is_builtin(public_key_id)) { + if (sdfw_builtin_keys_verify_message(public_key_id, psa_alg, data->value, data->len, + signature->value, + signature->len) == PSA_SUCCESS) { + return SUIT_SUCCESS; + } + + LOG_ERR("Signature verification failed."); + return SUIT_ERR_AUTHENTICATION; + } +#endif /* CONFIG_SDFW_BUILTIN_KEYS */ + + if (psa_verify_message(public_key_id, psa_alg, data->value, data->len, signature->value, + signature->len) == PSA_SUCCESS) { + return SUIT_SUCCESS; + } + + LOG_ERR("Signature verification failed."); + + return SUIT_ERR_AUTHENTICATION; +} + +int suit_plat_authorize_unsigned_manifest(struct zcbor_string *manifest_component_id) +{ + suit_manifest_class_id_t *class_id = NULL; + + if ((manifest_component_id == NULL) || (manifest_component_id->value == NULL) || + (manifest_component_id->len == 0)) { + return SUIT_ERR_DECODING; + } + + /* Check if component ID is a manifest class */ + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Component ID is not a manifest class"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Validate manifest class ID against supported manifests */ + mci_err_t ret = suit_mci_manifest_class_id_validate(class_id); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Manifest class ID validation failed: MCI err %i", ret); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Check if unsigned manifest is allowed - pass key_id == 0*/ + ret = suit_mci_signing_key_id_validate(class_id, 0); + + if (ret == SUIT_PLAT_SUCCESS) { + return SUIT_SUCCESS; + } + + LOG_INF("Signature verification required."); + + return SUIT_ERR_AUTHENTICATION; +} + +int suit_plat_authorize_component_id(struct zcbor_string *manifest_component_id, + struct zcbor_string *component_id) +{ + suit_manifest_class_id_t *class_id = NULL; + + if ((manifest_component_id == NULL) || (component_id == NULL) || + (manifest_component_id->value == NULL) || (manifest_component_id->len == 0) || + (component_id->value == NULL) || (component_id->len == 0)) { + return SUIT_ERR_DECODING; + } + + /* Check if component ID is a manifest class */ + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Component ID is not a manifest class"); + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + + return suit_plat_component_compatibility_check(class_id, component_id); +} + +int suit_plat_authorize_process_dependency(struct zcbor_string *parent_component_id, + struct zcbor_string *child_component_id, + enum suit_command_sequence seq_name) +{ + suit_manifest_class_id_t *parent_class_id = NULL; + suit_manifest_class_id_t *child_class_id = NULL; + + suit_plat_err_t err = + suit_plat_decode_manifest_class_id(parent_component_id, &parent_class_id); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to parse parent manifest class ID (err: %i)", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + err = suit_plat_decode_manifest_class_id(child_component_id, &child_class_id); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to parse child manifest class ID (err: %i)", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + mci_err_t ret = + suit_mci_manifest_process_dependency_validate(parent_class_id, child_class_id); + if (ret == SUIT_PLAT_SUCCESS) { + return SUIT_SUCCESS; + } + + LOG_INF("Manifest dependency link unauthorized for sequence %d (err: %i)", seq_name, ret); + + return SUIT_ERR_UNAUTHORIZED_COMPONENT; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_check_content.c b/subsys/suit/platform/sdfw/src/suit_plat_check_content.c new file mode 100644 index 000000000000..1d7de575a28a --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_check_content.c @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#include +LOG_MODULE_REGISTER(suit_plat_check_content, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_content_mem_mapped(suit_component_t component, struct zcbor_string *content) +{ + void *impl_data = NULL; + int err = suit_plat_component_impl_data_get(component, &impl_data); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get implementation data: %d", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + const uint8_t *data = NULL; + size_t size = 0; + const uint8_t *content_data = content->value; + + err = suit_memptr_storage_ptr_get((memptr_storage_handle_t)impl_data, &data, &size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get memptr ptr: %d", err); + return SUIT_ERR_CRASH; + } + + if (size != content->len) { + return SUIT_FAIL_CONDITION; + } + + uint8_t residual = 0; + + for (size_t i = 0; i < size; i++) { + residual |= content_data[i] ^ data[i]; + } + + if (residual != 0) { + return SUIT_FAIL_CONDITION; + } + + return SUIT_SUCCESS; +} + +int suit_plat_check_content(suit_component_t component, struct zcbor_string *content) +{ + struct zcbor_string *component_id = NULL; + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + int err = suit_plat_component_id_get(component, &component_id); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get component id: %d", err); + return err; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to decode component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + switch (component_type) { + case SUIT_COMPONENT_TYPE_UNSUPPORTED: { + LOG_ERR("Unsupported component type"); + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + case SUIT_COMPONENT_TYPE_MEM: { + err = suit_plat_check_content_mem_mapped(component, content); + break; + } + default: { + LOG_ERR("Unhandled component type: %d", component_type); + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + } + + return err; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_check_image_match_sdfw_specific.c b/subsys/suit/platform/sdfw/src/suit_plat_check_image_match_sdfw_specific.c new file mode 100644 index 000000000000..67bf4f254c9e --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_check_image_match_sdfw_specific.c @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include + +#include +LOG_MODULE_REGISTER(suit_plat_check_image_match_sdfw, CONFIG_SUIT_LOG_LEVEL); + +static int suit_plat_check_image_match_soc_spec_sdfw(struct zcbor_string *component_id, + enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ +#ifdef CONFIG_SOC_SERIES_NRF54HX + if (suit_cose_sha512 != alg_id) { + LOG_ERR("Unsupported digest algorithm: %d", alg_id); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + uint8_t *current_sdfw_digest = (uint8_t *)(NRF_SICR->UROT.SM.TBS.FW.DIGEST); + + if (PSA_HASH_LENGTH(PSA_ALG_SHA_512) != digest->len) { + LOG_ERR("Digest length mismatch: %d instead of %d", digest->len, + PSA_HASH_LENGTH(PSA_ALG_SHA_512)); + return SUIT_FAIL_CONDITION; + } + + if (memcmp((void *)current_sdfw_digest, (void *)digest->value, + PSA_HASH_LENGTH(PSA_ALG_SHA_512))) { + LOG_INF("Digest mismatch"); + return SUIT_FAIL_CONDITION; + } + + return SUIT_SUCCESS; +#else /* CONFIG_SOC_SERIES_NRF54HX */ + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +#endif /* CONFIG_SOC_SERIES_NRF54HX */ +} + +static int suit_plat_check_image_match_soc_spec(struct zcbor_string *component_id, + enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ + uint32_t number = 0; + + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Missing component id number"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + LOG_DBG("Component id number: %d", number); + + int err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + + if (number == 1) { + /* SDFW */ + err = suit_plat_check_image_match_soc_spec_sdfw(component_id, alg_id, digest); + } else if (number == 2) { + /* SDFW recovery */ + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } else { + /* Unsupported */ + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + return err; +} + +int suit_plat_check_image_match_domain_specific(suit_component_t component, + enum suit_cose_alg alg_id, + struct zcbor_string *digest, + struct zcbor_string *component_id, + suit_component_type_t component_type) +{ + int err = SUIT_SUCCESS; + + switch (component_type) { + case SUIT_COMPONENT_TYPE_MEM: + err = suit_plat_check_image_match_mem_mapped(component, alg_id, digest); + break; + case SUIT_COMPONENT_TYPE_SOC_SPEC: { + err = suit_plat_check_image_match_soc_spec(component_id, alg_id, digest); + break; + } + case SUIT_COMPONENT_TYPE_INSTLD_MFST: + err = suit_plat_check_image_match_mfst(component, alg_id, digest); + break; + + default: { + /* Should never get here */ + err = SUIT_ERR_TAMP; + break; + } + } + +#if CONFIG_SUIT_DIGEST_CACHE + if (err == SUIT_SUCCESS) { + int ret; + + switch (component_type) { + case SUIT_COMPONENT_TYPE_MEM: + case SUIT_COMPONENT_TYPE_SOC_SPEC: { + ret = suit_plat_digest_cache_add(component_id, alg_id, digest); + + if (ret != SUIT_SUCCESS) { + LOG_WRN("Failed to cache digest for component type %d, err %d", + component_type, ret); + } + } + default: { + break; + } + } + } +#endif /* CONFIG_SUIT_DIGEST_CACHE */ + + return err; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c new file mode 100644 index 000000000000..42932a1d79d1 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +/* -1 indicates no boot capability for given cpu id */ +#define NO_BOOT_CAPABILITY_CPU_ID 255 + +int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + suit_manifest_class_id_t *decoded_class_id; + suit_component_type_t type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + intptr_t address; + uint32_t number; + uint8_t cpu_id; + size_t size; + + if ((class_id == NULL) || (component_id == NULL) || (component_id->value == NULL) || + (component_id->len == 0)) { + return SUIT_ERR_DECODING; + } + + /* Validate manifest class ID against supported manifests */ + mci_err_t ret = suit_mci_manifest_class_id_validate(class_id); + + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, &type) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + switch (type) { + case SUIT_COMPONENT_TYPE_MEM: + /* Decode component_id */ + if (suit_plat_decode_component_id(component_id, &cpu_id, &address, &size) != + SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (NO_BOOT_CAPABILITY_CPU_ID != cpu_id) { + ret = suit_mci_processor_start_rights_validate(class_id, cpu_id); + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + } + + ret = suit_mci_memory_access_rights_validate(class_id, (void *)address, size); + if (ret != SUIT_PLAT_SUCCESS) { + 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; + } + + ret = suit_mci_platform_specific_component_rights_validate(class_id, number); + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + break; + case SUIT_COMPONENT_TYPE_CAND_MFST: + case SUIT_COMPONENT_TYPE_CAND_IMG: + case SUIT_COMPONENT_TYPE_CACHE_POOL: + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + break; + + case SUIT_COMPONENT_TYPE_INSTLD_MFST: + /* Decode manifest class id */ + if (suit_plat_decode_manifest_class_id(component_id, &decoded_class_id) != + SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Validate parent-child declarative relationship */ + ret = suit_mci_manifest_parent_child_declaration_validate(class_id, + decoded_class_id); + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNAUTHORIZED_COMPONENT; + } + + break; + default: + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + return SUIT_SUCCESS; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_copy.c b/subsys/suit/platform/sdfw/src/suit_plat_copy.c new file mode 100644 index 000000000000..5c7e4ae49d55 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_copy.c @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM +#include +#include +#include +#endif /* CONFIG_SUIT_STREAM */ + +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR +#include +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + +LOG_MODULE_REGISTER(suit_plat_copy, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_copy(suit_component_t dst_handle, suit_component_t src_handle) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + const uint8_t *payload_ptr; + size_t payload_size; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + suit_component_type_t src_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + /* Get destination component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode destination component type"); + return ret; + } + + /* Check if destination component type is supported */ + if ((dst_component_type != SUIT_COMPONENT_TYPE_MEM) && + (dst_component_type != SUIT_COMPONENT_TYPE_SOC_SPEC)) { + LOG_ERR("Unsupported destination component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Get source component type based on component handle*/ + ret = suit_plat_component_type_get(src_handle, &src_component_type); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode source component type"); + return ret; + } + + /* Check if source component type is supported */ + if ((src_component_type != SUIT_COMPONENT_TYPE_MEM) && + (src_component_type != SUIT_COMPONENT_TYPE_CAND_IMG)) { + LOG_ERR("Unsupported source component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_sink_select failed - error %i", ret); + return ret; + } + + /* Here other parts of pipe will be instantiated. + * Like decryption and/or decompression sinks. + */ + + /* Select source based on component type */ + switch (src_component_type) { +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + case SUIT_COMPONENT_TYPE_MEM: + case SUIT_COMPONENT_TYPE_CAND_IMG: { + memptr_storage_handle_t handle = NULL; + + ret = suit_plat_component_impl_data_get(src_handle, &handle); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_impl_data_get failed - error %i", ret); + release_sink(&dst_sink); + return ret; + } + + ret = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + ret = suit_plat_err_to_processor_err_convert(ret); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_memptr_storage_ptr_get failed - error %i", ret); + release_sink(&dst_sink); + return ret; + } + } break; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + + default: + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + ret = release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); +#else /* CONFIG_SUIT_STREAM */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} + +int suit_plat_copy(suit_component_t dst_handle, suit_component_t src_handle) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + const uint8_t *payload_ptr; + size_t payload_size; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + suit_component_type_t src_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + /* Get destination component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode destination component type"); + return ret; + } + + /* Check if destination component type is supported */ + if ((dst_component_type != SUIT_COMPONENT_TYPE_MEM) && + (dst_component_type != SUIT_COMPONENT_TYPE_SOC_SPEC)) { + LOG_ERR("Unsupported destination component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Get source component type based on component handle*/ + ret = suit_plat_component_type_get(src_handle, &src_component_type); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode source component type"); + return ret; + } + + /* Check if source component type is supported */ + if ((src_component_type != SUIT_COMPONENT_TYPE_MEM) && + (src_component_type != SUIT_COMPONENT_TYPE_CAND_IMG)) { + LOG_ERR("Unsupported source component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Select destination */ + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_sink_select failed - error %i", ret); + return ret; + } + + /* Here other parts of pipe will be instantiated. + * Like decryption and/or decompression sinks. + */ + +#if CONFIG_SUIT_DIGEST_CACHE + /* Invalidate the cache entry of the digest for the destination. */ + ret = suit_plat_digest_cache_remove_by_handle(dst_handle); + + if (ret != SUIT_SUCCESS) { + return ret; + } +#endif + + /* Select source based on component type */ + switch (src_component_type) { +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + case SUIT_COMPONENT_TYPE_MEM: + case SUIT_COMPONENT_TYPE_CAND_IMG: { + memptr_storage_handle_t handle = NULL; + + ret = suit_plat_component_impl_data_get(src_handle, &handle); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_impl_data_get failed - error %i", ret); + release_sink(&dst_sink); + return ret; + } + + ret = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_memptr_storage_ptr_get failed - error %i", ret); + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + if (dst_sink.erase != NULL) { + ret = dst_sink.erase(dst_sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to erase destination sink: %d", ret); + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + LOG_DBG("dst_sink erased"); + } + + ret = suit_generic_address_streamer_stream(payload_ptr, payload_size, &dst_sink); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("memptr_streamer failed - error %i", ret); + } + + ret = suit_plat_err_to_processor_err_convert(ret); + } break; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + + default: + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + if (ret == SUIT_SUCCESS) { + /* Update size in memptr for MEM component */ + if (dst_component_type == SUIT_COMPONENT_TYPE_MEM) { + size_t new_size = 0; + + ret = dst_sink.used_storage(dst_sink.ctx, &new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting used storage on destination sink failed"); + release_sink(&dst_sink); + + return suit_plat_err_to_processor_err_convert(ret); + } + + ret = suit_plat_memptr_size_update(dst_handle, new_size); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to update destination MEM component size: %i", ret); + release_sink(&dst_sink); + + return ret; + } + } + + ret = release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); +#else /* CONFIG_SUIT_STREAM */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_devconfig.c b/subsys/suit/platform/sdfw/src/suit_plat_devconfig.c new file mode 100644 index 000000000000..81a6c0cb7e15 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_devconfig.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(plat_devconfig, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_sequence_completed(enum suit_command_sequence seq_name, + struct zcbor_string *manifest_component_id, + const uint8_t *envelope_str, size_t envelope_len) +{ + suit_manifest_class_id_t *class_id = NULL; + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + if ((manifest_component_id == NULL) || (manifest_component_id->value == NULL)) { + LOG_ERR("Manifest class ID not specified"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to decode manifest class ID"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + err = suit_mci_manifest_class_id_validate(class_id); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to validate manifest class ID (MCI err: %d)", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (seq_name == SUIT_SEQ_INSTALL) { + err = suit_storage_install_envelope(class_id, (uint8_t *)envelope_str, + envelope_len); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to save envelope (platform err: %d)", err); + } else { + LOG_DBG("Envelope saved"); + } + } + + return suit_plat_err_to_processor_err_convert(err); +} + +int suit_plat_authorize_sequence_num(enum suit_command_sequence seq_name, + struct zcbor_string *manifest_component_id, + unsigned int seq_num) +{ + const uint8_t *envelope_addr; + size_t envelope_size; + uint32_t current_seq_num; + suit_manifest_class_id_t *class_id = NULL; + suit_downgrade_prevention_policy_t policy; + suit_plat_err_t ret = SUIT_PLAT_ERR_CRASH; + + if ((manifest_component_id == NULL) || (manifest_component_id->value == NULL)) { + LOG_ERR("Manifest class ID not specified"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_manifest_class_id(manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to decode manifest class ID"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + ret = suit_mci_manifest_class_id_validate(class_id); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unsupported manifest class ID (MCI err: %d)", ret); + return SUIT_ERR_AUTHENTICATION; + } + + ret = suit_storage_installed_envelope_get(class_id, &envelope_addr, &envelope_size); + if ((ret == SUIT_PLAT_ERR_NOT_FOUND) || (ret == SUIT_PLAT_ERR_OUT_OF_BOUNDS)) { + LOG_ERR("Unable to find a role or slot for envelope (ret: %d)", ret); + return SUIT_ERR_AUTHENTICATION; + } + + if (ret != SUIT_PLAT_SUCCESS) { + if ((seq_name == SUIT_SEQ_VALIDATE) || (seq_name == SUIT_SEQ_LOAD) || + (seq_name == SUIT_SEQ_INVOKE)) { + /* It is not allowed to boot from update candidate. */ + LOG_ERR("Unable to get installed envelope (ret: %d)", ret); + return SUIT_ERR_AUTHENTICATION; + } + + LOG_DBG("Envelope with given class ID not installed. Continue update."); + return SUIT_SUCCESS; + } + + ret = suit_processor_get_manifest_metadata(envelope_addr, envelope_size, false, NULL, NULL, + NULL, ¤t_seq_num); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Unable to read manifest metadata (ret: %d)", ret); + return SUIT_ERR_AUTHENTICATION; + } + + if ((seq_name == SUIT_SEQ_VALIDATE) || (seq_name == SUIT_SEQ_LOAD) || + (seq_name == SUIT_SEQ_INVOKE)) { + if (current_seq_num == seq_num) { + /* Allow to use installed manifest during boot procedure. */ + LOG_DBG("Manifest sequence number %d authorized to boot", seq_num); + return SUIT_SUCCESS; + } + + /* It is not allowed to boot from update candidate. */ + LOG_ERR("Manifest sequence number %d unauthorized to boot (current: %d)", + seq_num, current_seq_num); + return SUIT_ERR_AUTHENTICATION; + } + + ret = suit_mci_downgrade_prevention_policy_get(class_id, &policy); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to get downgrade prevention policy (MCI err: %d)", ret); + return SUIT_ERR_AUTHENTICATION; + } + + if (policy == SUIT_DOWNGRADE_PREVENTION_DISABLED) { + LOG_DBG("Manifest sequence number %d for sequence %d authorized (current: %d, " + "policy: %d)", + seq_num, seq_name, current_seq_num, policy); + return SUIT_SUCCESS; + } else if (policy != SUIT_DOWNGRADE_PREVENTION_ENABLED) { + LOG_ERR("Unsupported downgrade prevention policy value: %d", policy); + return SUIT_ERR_AUTHENTICATION; + } else if (current_seq_num <= seq_num) { + return SUIT_SUCCESS; + } + + LOG_ERR("Manifest sequence number %d for sequence %d unauthorized (current: %d, policy: " + "%d)", + seq_num, seq_name, current_seq_num, policy); + + return SUIT_ERR_AUTHENTICATION; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_digest_cache.c b/subsys/suit/platform/sdfw/src/suit_plat_digest_cache.c new file mode 100644 index 000000000000..57f0bcaa7a8e --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_digest_cache.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "suit_plat_digest_cache.h" +#include +#include + +#define MAX_MUTEX_LOCK_TIME_MS (100U) + +typedef struct { + struct zcbor_string component_id; + enum suit_cose_alg alg_id; + struct zcbor_string digest; +} suit_plat_digest_cache_entry_t; + +static suit_plat_digest_cache_entry_t cache[CONFIG_SUIT_DIGEST_CACHE_SIZE]; + +K_MUTEX_DEFINE(cache_mutex); + +/** + * @brief Get the cache entry index for the given component id + */ +static int find_entry(const struct zcbor_string *component_id, + suit_plat_digest_cache_entry_t **p_entry) +{ + size_t i; + + for (i = 0; i < CONFIG_SUIT_DIGEST_CACHE_SIZE; i++) { + if (suit_compare_zcbor_strings(component_id, &cache[i].component_id)) { + *p_entry = &cache[i]; + return SUIT_SUCCESS; + } + } + + return SUIT_ERR_MISSING_COMPONENT; +} + +int suit_plat_digest_cache_add(struct zcbor_string *component_id, enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ + size_t i; + + if (component_id == NULL || digest == NULL) { + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + /* It may seem a waste to lock the mutex for the whole duration of the loop, + * however the probability of functions from this file being reentered from a different + * thread is low (IPC request from two different cores in a very short time gap) + * and could only occur a few times after the system is booted up. + * On the other hand there are multiple potential ways of memory corruption by another + * thread, including for example changing the entry for a given component just before + * the mutex is locked. + * Taking this to account, it does not seem beneficial to complicate the code in order + * to shorten the time when the mutex is locked. + */ + if (k_mutex_lock(&cache_mutex, K_MSEC(MAX_MUTEX_LOCK_TIME_MS)) != 0) { + return SUIT_ERR_CRASH; + } + + for (i = 0; i < CONFIG_SUIT_DIGEST_CACHE_SIZE; i++) { + if (cache[i].component_id.value == NULL || + suit_compare_zcbor_strings(component_id, &cache[i].component_id)) { + cache[i].component_id.len = component_id->len; + cache[i].component_id.value = component_id->value; + cache[i].alg_id = alg_id; + cache[i].digest.len = digest->len; + cache[i].digest.value = digest->value; + + k_mutex_unlock(&cache_mutex); + return SUIT_SUCCESS; + } + } + + k_mutex_unlock(&cache_mutex); + + return SUIT_ERR_OVERFLOW; +} + +int suit_plat_digest_cache_remove(struct zcbor_string *component_id) +{ + suit_plat_digest_cache_entry_t *entry; + + if (k_mutex_lock(&cache_mutex, K_MSEC(MAX_MUTEX_LOCK_TIME_MS)) != 0) { + return SUIT_ERR_CRASH; + } + + if (find_entry(component_id, &entry) == SUIT_SUCCESS) { + entry->component_id.len = 0; + entry->component_id.value = NULL; + entry->alg_id = 0; + entry->digest.len = 0; + entry->digest.value = NULL; + } + + k_mutex_unlock(&cache_mutex); + + return SUIT_SUCCESS; +} + +int suit_plat_digest_cache_compare(const struct zcbor_string *component_id, + enum suit_cose_alg alg_id, const struct zcbor_string *digest) +{ + int ret; + suit_plat_digest_cache_entry_t *entry; + + if (k_mutex_lock(&cache_mutex, K_MSEC(MAX_MUTEX_LOCK_TIME_MS)) != 0) { + return SUIT_ERR_CRASH; + } + + ret = find_entry(component_id, &entry); + + if (ret == SUIT_SUCCESS) { + if (entry->alg_id == alg_id && suit_compare_zcbor_strings(digest, &entry->digest)) { + ret = SUIT_SUCCESS; + } else { + ret = SUIT_FAIL_CONDITION; + } + } + + k_mutex_unlock(&cache_mutex); + + return ret; +} + +int suit_plat_digest_cache_remove_all(void) +{ + size_t i; + + if (k_mutex_lock(&cache_mutex, K_MSEC(MAX_MUTEX_LOCK_TIME_MS)) != 0) { + return SUIT_ERR_CRASH; + } + + for (i = 0; i < CONFIG_SUIT_DIGEST_CACHE_SIZE; i++) { + cache[i].component_id.len = 0; + cache[i].component_id.value = NULL; + cache[i].digest.len = 0; + cache[i].digest.value = NULL; + } + + k_mutex_unlock(&cache_mutex); + + return SUIT_SUCCESS; +} + +int suit_plat_digest_cache_remove_by_handle(suit_component_t handle) +{ + struct zcbor_string *component_id; + + int ret = suit_plat_component_id_get(handle, &component_id); + + if (ret != SUIT_SUCCESS) { + return ret; + } + + return suit_plat_digest_cache_remove(component_id); +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_fetch_sdfw_specific.c b/subsys/suit/platform/sdfw/src/suit_plat_fetch_sdfw_specific.c new file mode 100644 index 000000000000..d6184f36bde1 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_fetch_sdfw_specific.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM + +#ifdef CONFIG_SUIT_STREAM_SOURCE_CACHE +#include +#endif /* CONFIG_SUIT_STREAM_SOURCE_CACHE */ +#ifdef CONFIG_SUIT_STREAM_IPC_REQUESTOR +#include +#endif /* CONFIG_SUIT_STREAM_IPC_REQUESTOR */ + +LOG_MODULE_REGISTER(suit_plat_fetch_sdfw, CONFIG_SUIT_LOG_LEVEL); + +static bool is_type_supported(suit_component_type_t component_type) +{ + if ((component_type == SUIT_COMPONENT_TYPE_CAND_IMG) || + (component_type == SUIT_COMPONENT_TYPE_CAND_MFST) || + (component_type == SUIT_COMPONENT_TYPE_SOC_SPEC) || + (component_type == SUIT_COMPONENT_TYPE_MEM)) { + return true; + } + + return false; +} + +static bool is_type_supported_by_ipc(suit_component_type_t component_type) +{ + if (component_type == SUIT_COMPONENT_TYPE_MEM) { + return true; + } + + return false; +} + +bool suit_plat_fetch_domain_specific_is_type_supported(suit_component_type_t component_type) +{ + if (IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_CACHE) || + (IS_ENABLED(CONFIG_SUIT_STREAM_IPC_REQUESTOR) && + is_type_supported_by_ipc(component_type))) { + return is_type_supported(component_type); + } + + return false; +} + +bool suit_plat_fetch_integrated_domain_specific_is_type_supported( + suit_component_type_t component_type) +{ + return is_type_supported(component_type); +} + +int suit_plat_fetch_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink, struct zcbor_string *uri) +{ + /* If cache is disabled, act as thou uri was not found in cache */ + suit_plat_err_t ret = SUIT_PLAT_ERR_NOT_FOUND; + +#ifdef CONFIG_SUIT_STREAM_SOURCE_CACHE + /* Check if requested uri exists in cache and get streamer */ + ret = suit_dfu_cache_streamer_stream(uri->value, uri->len, dst_sink); +#endif /* CONFIG_SUIT_STREAM_SOURCE_CACHE */ + +#ifdef CONFIG_SUIT_STREAM_IPC_REQUESTOR + if ((ret == SUIT_PLAT_ERR_NOT_FOUND) && /* URI was not found in cache */ + is_type_supported_by_ipc(dst_component_type)) { /* component type is supported */ + /* Request uri through ipc streamer */ + ret = suit_ipc_streamer_stream(uri->value, uri->len, dst_sink, + CONFIG_SUIT_STREAM_IPC_STREAMER_CHUNK_TIMEOUT, + CONFIG_SUIT_STREAM_IPC_STREAMER_REQUESTING_PERIOD); + } +#endif /* CONFIG_SUIT_STREAM_IPC_REQUESTOR */ + + if (ret == SUIT_PLAT_SUCCESS) { + /* Update size in memptr for MEM component */ + if (dst_component_type == SUIT_COMPONENT_TYPE_MEM) { + size_t new_size = 0; + + ret = dst_sink->used_storage(dst_sink->ctx, &new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting used storage on destination sink failed"); + + return suit_plat_err_to_processor_err_convert(ret); + } + + ret = suit_plat_memptr_size_update(dst_handle, new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update destination MEM component size: %i", ret); + + return suit_plat_err_to_processor_err_convert(ret); + ; + } + } + } + + return suit_plat_err_to_processor_err_convert(ret); +} + +int suit_plat_fetch_integrated_domain_specific(suit_component_t dst_handle, + suit_component_type_t dst_component_type, + struct stream_sink *dst_sink) +{ + suit_plat_err_t ret = SUIT_SUCCESS; + + /* Update size in memptr for MEM component */ + if (dst_component_type == SUIT_COMPONENT_TYPE_MEM) { + size_t new_size = 0; + + ret = dst_sink->used_storage(dst_sink->ctx, &new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting used storage on destination sink failed"); + + return suit_plat_err_to_processor_err_convert(ret); + } + + ret = suit_plat_memptr_size_update(dst_handle, new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update destination MEM component size: %i", ret); + + return suit_plat_err_to_processor_err_convert(ret); + } + } + + return suit_plat_err_to_processor_err_convert(ret); +} + +#endif /* CONFIG_SUIT_STREAM */ diff --git a/subsys/suit/platform/sdfw/src/suit_plat_invoke.c b/subsys/suit/platform/sdfw/src/suit_plat_invoke.c new file mode 100644 index 000000000000..d9fcd06af7ed --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_invoke.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_plat_invoke, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_invoke(suit_component_t image_handle, struct zcbor_string *invoke_args) +{ + struct zcbor_string *component_id; + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + intptr_t run_address; + uint8_t cpu_id; + size_t size; + + if (suit_plat_component_id_get(image_handle, &component_id) != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_id_get failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_id(component_id, &cpu_id, &run_address, &size) + != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_id failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_type failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Check if component type supports invocation */ + switch (component_type) { + case SUIT_COMPONENT_TYPE_MEM: + /* memory-mapped */ + return SUIT_SUCCESS; + default: + LOG_ERR("Unsupported component type"); + break; + } + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +int suit_plat_invoke(suit_component_t image_handle, struct zcbor_string *invoke_args) +{ + struct zcbor_string *component_id; + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + intptr_t run_address; + uint8_t cpu_id; + size_t size; + + if (suit_plat_component_id_get(image_handle, &component_id) != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_id_get failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_id(component_id, &cpu_id, &run_address, &size) + != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_id failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_type failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Check if component type supports invocation */ + switch (component_type) { + case SUIT_COMPONENT_TYPE_MEM: + /* memory-mapped */ + return suit_plat_cpu_run(cpu_id, run_address); + default: + LOG_ERR("Unsupported component type"); + break; + } + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_manifest_info.c b/subsys/suit/platform/sdfw/src/suit_plat_manifest_info.c new file mode 100644 index 000000000000..0adf84531de9 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_manifest_info.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +int suit_plat_supported_manifest_class_infos_get(suit_manifest_class_info_t *class_info, + size_t *size) +{ + return suit_plat_err_to_processor_err_convert( + suit_mci_supported_manifest_class_ids_get(class_info, size)); +} + +int suit_plat_manifest_role_get(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + (void)class_id; + (void)role; + + /* Function used only by the application domain version of the platform */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_retrieve_manifest_sdfw_specific.c b/subsys/suit/platform/sdfw/src/suit_plat_retrieve_manifest_sdfw_specific.c new file mode 100644 index 000000000000..50e351db1de0 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_retrieve_manifest_sdfw_specific.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#ifdef CONFIG_SUIT_STORAGE +#include +#endif /* CONFIG_SUIT_STORAGE */ + +#include + +LOG_MODULE_REGISTER(suit_plat_retr_mfst_sdfw, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_retrieve_manifest_domain_specific(struct zcbor_string *component_id, + suit_component_type_t component_type, + const uint8_t **envelope_str, size_t *envelope_len) +{ + int ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + +#ifdef CONFIG_SUIT_STORAGE + switch (component_type) { + case SUIT_COMPONENT_TYPE_INSTLD_MFST: { + suit_manifest_class_id_t *class_id; + + if (suit_plat_decode_manifest_class_id(component_id, &class_id) + != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to decode manifest class ID"); + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + ret = suit_storage_installed_envelope_get(class_id, envelope_str, envelope_len); + if ((ret != SUIT_PLAT_SUCCESS) || (*envelope_str == NULL) || (*envelope_len == 0)) { + LOG_ERR("Unable to find installed envelope (err: %d)", ret); + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + ret = SUIT_SUCCESS; + } break; + default: { + break; + } + } +#endif /* CONFIG_SUIT_STORAGE */ + + return ret; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_swap.c b/subsys/suit/platform/sdfw/src/suit_plat_swap.c new file mode 100644 index 000000000000..563c300a44a1 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_swap.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +int suit_plat_check_swap(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_swap(suit_component_t dst_handle, suit_component_t src_handle) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/sdfw/src/suit_plat_write.c b/subsys/suit/platform/sdfw/src/suit_plat_write.c new file mode 100644 index 000000000000..1dce12265c81 --- /dev/null +++ b/subsys/suit/platform/sdfw/src/suit_plat_write.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM +#include +#include +#endif /* CONFIG_SUIT_STREAM */ + +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR +#include +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + +LOG_MODULE_REGISTER(suit_plat_write, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_write(suit_component_t dst_handle, struct zcbor_string *content) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + /* Get destination component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode destination component type"); + return ret; + } + + /* Check if destination component type is supported */ + if ((dst_component_type != SUIT_COMPONENT_TYPE_MEM) && + (dst_component_type != SUIT_COMPONENT_TYPE_SOC_SPEC)) { + LOG_ERR("Unsupported destination component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Select destination */ + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_sink_select failed - error %i", ret); + return ret; + } + + ret = suit_plat_err_to_processor_err_convert(ret); + + if (ret == SUIT_SUCCESS) { + ret = release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); +#else /* CONFIG_SUIT_STREAM */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} + +int suit_plat_write(suit_component_t dst_handle, struct zcbor_string *content) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + if (content == NULL) { + return suit_plat_err_to_processor_err_convert(SUIT_PLAT_ERR_INVAL); + } + + /* Get destination component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode destination component type"); + return ret; + } + + /* Check if destination component type is supported */ + if ((dst_component_type != SUIT_COMPONENT_TYPE_MEM) && + (dst_component_type != SUIT_COMPONENT_TYPE_SOC_SPEC)) { + LOG_ERR("Unsupported destination component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + +#ifndef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + + /* Select destination */ + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_sink_select failed - error %i", ret); + return ret; + } + +#if CONFIG_SUIT_DIGEST_CACHE + /* Invalidate the cache entry of the digest for the destination. */ + ret = suit_plat_digest_cache_remove_by_handle(dst_handle); + + if (ret != SUIT_SUCCESS) { + return ret; + } +#endif + + if (dst_sink.erase != NULL) { + ret = dst_sink.erase(dst_sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to erase destination sink: %d", ret); + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + LOG_DBG("dst_sink erased"); + } + +#ifdef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + ret = suit_memptr_streamer_stream(content->value, content->len, &dst_sink); +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("memptr_streamer failed - error %i", ret); + } + + ret = suit_plat_err_to_processor_err_convert(ret); + + if (ret == SUIT_SUCCESS) { + /* Update size in memptr for MEM component */ + if (dst_component_type == SUIT_COMPONENT_TYPE_MEM) { + size_t new_size = 0; + + ret = dst_sink.used_storage(dst_sink.ctx, &new_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting used storage on destination sink failed"); + release_sink(&dst_sink); + + return suit_plat_err_to_processor_err_convert(ret); + } + + ret = suit_plat_memptr_size_update(dst_handle, new_size); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to update destination MEM component size: %i", ret); + release_sink(&dst_sink); + + return ret; + } + } + + ret = release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); + } + + release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); +#else /* CONFIG_SUIT_STREAM */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} diff --git a/subsys/suit/platform/sink_selector/CMakeLists.txt b/subsys/suit/platform/sink_selector/CMakeLists.txt new file mode 100644 index 000000000000..97557ec3f6be --- /dev/null +++ b/subsys/suit/platform/sink_selector/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_sink_selector_interface) +target_include_directories(suit_sink_selector_interface INTERFACE include) + +zephyr_library() +zephyr_library_sources(src/suit_sdfw_sink_selector.c) + +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_sink_selector_interface) diff --git a/subsys/suit/platform/sink_selector/Kconfig b/subsys/suit/platform/sink_selector/Kconfig new file mode 100644 index 000000000000..7a4cc6396f85 --- /dev/null +++ b/subsys/suit/platform/sink_selector/Kconfig @@ -0,0 +1,9 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_SINK_SELECTOR + bool "Enable SUIT sink_selector module" + depends on SUIT_STREAM diff --git a/subsys/suit/platform/sink_selector/include/suit_sink_selector.h b/subsys/suit/platform/sink_selector/include/suit_sink_selector.h new file mode 100644 index 000000000000..ee0bb9d7a18e --- /dev/null +++ b/subsys/suit/platform/sink_selector/include/suit_sink_selector.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SINK_SELECTOR_H__ +#define SINK_SELECTOR_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get sink based on component handle + * + * @param dst_handle Component handle + * @param sink Pointer to sink structure to be filled + * @return int 0 in case of success, otherwise error code + */ +int suit_sink_select(suit_component_t dst_handle, struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* SINK_SELECTOR_H__ */ diff --git a/subsys/suit/platform/sink_selector/src/suit_sdfw_sink_selector.c b/subsys/suit/platform/sink_selector/src/suit_sdfw_sink_selector.c new file mode 100644 index 000000000000..adf10904a893 --- /dev/null +++ b/subsys/suit/platform/sink_selector/src/suit_sdfw_sink_selector.c @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM_SINK_MEMPTR +#include +#endif /* CONFIG_SUIT_STREAM_SINK_MEMPTR */ +#ifdef CONFIG_SUIT_STREAM_SINK_FLASH +#include +#endif /* CONFIG_SUIT_STREAM_SINK_FLASH */ +#ifdef CONFIG_SUIT_STREAM_SINK_RAM +#include +#endif /* CONFIG_SUIT_STREAM_SINK_RAM */ +#ifdef CONFIG_SUIT_STREAM_SINK_SDFW +#include +#endif /* CONFIG_SUIT_STREAM_SINK_SDFW */ +#ifdef CONFIG_SUIT_STREAM_SINK_EXTMEM +#include +#endif /* CONFIG_SUIT_STREAM_SINK_EXTMEM */ + +LOG_MODULE_REGISTER(suit_plat_sink_selector, CONFIG_SUIT_LOG_LEVEL); + +int suit_sink_select(suit_component_t dst_handle, struct stream_sink *sink) +{ + struct zcbor_string *component_id; + int ret = SUIT_SUCCESS; +#if defined(CONFIG_SUIT_STREAM_SINK_MEMPTR) || defined(CONFIG_SUIT_STREAM_SINK_FLASH) || \ + defined(CONFIG_SUIT_STREAM_SINK_SDFW) + suit_plat_err_t sink_get_err = SUIT_PLAT_SUCCESS; +#endif + + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + ret = suit_plat_component_id_get(dst_handle, &component_id); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_id_get failed: %i", ret); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_type failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Select sink based on component type */ + switch (component_type) { +#ifdef CONFIG_SUIT_STREAM_SINK_MEMPTR + case SUIT_COMPONENT_TYPE_CAND_IMG: + case SUIT_COMPONENT_TYPE_CAND_MFST: { /* memptr_sink */ + uint32_t number; + memptr_storage_handle_t handle; + + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Missing component id number in candidate image component"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + ret = suit_plat_component_impl_data_get(dst_handle, &handle); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Unable to get component data for candidate image (err: %d)", ret); + return ret; + } + + sink_get_err = suit_memptr_sink_get(sink, handle); + return suit_plat_err_to_processor_err_convert(sink_get_err); + } break; +#endif /* CONFIG_SUIT_STREAM_SINK_MEMPTR */ + +#ifdef CONFIG_SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED + case SUIT_COMPONENT_TYPE_MEM: { /* flash_sink or ram_sink */ + intptr_t run_address; + size_t size; + + if (suit_plat_decode_address_size(component_id, &run_address, &size) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_address_size failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Based on address span given by run_address-(run_address + size), check what type + *memory configuration we're working with. Possible cases include: + * - Internal MRAM on single controller + * - Internal MRAM spanning between two memory controllers + * - RAM + * - External Flash + * - ... + * + * Select sink based on detected memory configuration. + */ + +#ifdef CONFIG_SUIT_STREAM_SINK_FLASH + /* Internal MRAM/Flash on single controller */ + if (suit_flash_sink_is_address_supported((uint8_t *)run_address)) { + sink_get_err = suit_flash_sink_get(sink, (uint8_t *)run_address, size); + if (sink_get_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get flash sink: %i", sink_get_err); + return suit_plat_err_to_processor_err_convert(sink_get_err); + } + + return SUIT_SUCCESS; + } + + LOG_INF("Address not in Flash"); +#endif /* CONFIG_SUIT_STREAM_SINK_FLASH */ + +#ifdef CONFIG_SUIT_STREAM_SINK_RAM + /* Internal RAM */ + if (suit_ram_sink_is_address_supported((uint8_t *)run_address)) { + sink_get_err = suit_ram_sink_get(sink, (uint8_t *)run_address, size); + if (sink_get_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get RAM sink: %i", sink_get_err); + return suit_plat_err_to_processor_err_convert(sink_get_err); + } + + return SUIT_SUCCESS; + } + + LOG_INF("Address not in RAM"); +#endif /* CONFIG_SUIT_STREAM_SINK_RAM */ + +#ifdef CONFIG_SUIT_STREAM_SINK_EXTMEM + /* External memory */ + if (suit_extmem_sink_is_address_supported((uint8_t *)run_address)) { + sink_get_err = suit_extmem_sink_get(sink, (uint8_t *)run_address, size); + if (sink_get_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get external memory sink: %i", sink_get_err); + return suit_plat_err_to_processor_err_convert(sink_get_err); + } + + return SUIT_SUCCESS; + } + + LOG_INF("Address not in external memory"); +#endif /* CONFIG_SUIT_STREAM_SINK_EXTMEM */ + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } break; +#endif /* CONFIG_SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED */ +#ifdef CONFIG_SUIT_STREAM_SINK_SDFW + case SUIT_COMPONENT_TYPE_SOC_SPEC: { /* sdfw_sink */ + uint32_t number; + + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Missing component id number"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (number == 1) { + if (IS_ENABLED(CONFIG_SUIT_STREAM_SINK_SDFW)) { + sink_get_err = suit_sdfw_sink_get(sink); + return suit_plat_err_to_processor_err_convert(sink_get_err); + } + + LOG_ERR("SDFW sink not enabled"); + } + + LOG_ERR("Unsupported special component %d", number); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } break; +#endif /* CONFIG_SUIT_STREAM_SINK_SDFW */ + default: { + LOG_ERR("Unsupported component type: %d", component_type); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + } + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} diff --git a/subsys/suit/platform/src/suit_plat_check_image_match.c b/subsys/suit/platform/src/suit_plat_check_image_match.c new file mode 100644 index 000000000000..7d6b3daed3ab --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_check_image_match.c @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_STREAM_SINK_DIGEST +#include +#include +#include + +#include +#endif /* CONFIG_SUIT_STREAM_SINK_DIGEST */ + +#include +LOG_MODULE_REGISTER(suit_plat_check_image_match, CONFIG_SUIT_LOG_LEVEL); + +#ifdef CONFIG_SUIT_STREAM_SINK_DIGEST +int suit_plat_check_image_match_mem_mapped(suit_component_t component, + enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ + void *impl_data = NULL; + int err = suit_plat_component_impl_data_get(component, &impl_data); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get implementation data: %d", err); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + const uint8_t *data = NULL; + size_t size = 0; + + err = suit_memptr_storage_ptr_get((memptr_storage_handle_t)impl_data, &data, &size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get memptr ptr: %d", err); + return SUIT_ERR_CRASH; + } + + psa_algorithm_t psa_alg; + + if (suit_cose_sha512 == alg_id) { + psa_alg = PSA_ALG_SHA_512; + } else if (suit_cose_sha256 == alg_id) { + psa_alg = PSA_ALG_SHA_256; + } else { + LOG_ERR("Unsupported hash algorithm: %d", alg_id); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + struct stream_sink digest_sink; + + err = suit_digest_sink_get(&digest_sink, psa_alg, digest->value); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get digest sink: %d", err); + return suit_plat_err_to_processor_err_convert(err); + } + + err = suit_generic_address_streamer_stream(data, size, &digest_sink); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to stream to digest sink: %d", err); + err = suit_plat_err_to_processor_err_convert(err); + } else { + err = suit_digest_sink_digest_match(digest_sink.ctx); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to check digest: %d", err); + /* Translate error code to allow entering another branches in try-each + * sequence + */ + err = SUIT_FAIL_CONDITION; + } else { + err = SUIT_SUCCESS; + } + } + + suit_plat_err_t release_err = digest_sink.release(digest_sink.ctx); + + if (release_err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to release digest sink: %d", release_err); + if (err != SUIT_SUCCESS) { + err = suit_plat_err_to_processor_err_convert(release_err); + } + } + + return err; +} +#endif /* CONFIG_SUIT_STREAM_SINK_DIGEST */ + +int suit_plat_check_image_match_mfst(suit_component_t component, enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ + int ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + + const uint8_t *envelope_str; + size_t envelope_len; + struct zcbor_string manifest_digest; + enum suit_cose_alg alg; + + ret = suit_plat_retrieve_manifest(component, &envelope_str, &envelope_len); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to check image digest: unable to retrieve manifest contents " + "(handle: %p)\r\n", + (void *)component); + return ret; + } + + ret = suit_processor_get_manifest_metadata(envelope_str, envelope_len, false, NULL, + &manifest_digest, &alg, NULL); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to check image digest: unable to read manifest digest (handle: " + "%p)\r\n", + (void *)component); + return ret; + } + + if (alg_id != alg) { + LOG_ERR("Manifest digest check failed: digest algorithm does not match (handle: " + "%p)\r\n", + (void *)component); + ret = SUIT_FAIL_CONDITION; + } else if (!suit_compare_zcbor_strings(digest, &manifest_digest)) { + LOG_ERR("Manifest digest check failed: digest values does not match (handle: " + "%p)\r\n", + (void *)component); + ret = SUIT_FAIL_CONDITION; + } + + return ret; +} + +int suit_plat_check_image_match(suit_component_t component, enum suit_cose_alg alg_id, + struct zcbor_string *digest) +{ + struct zcbor_string *component_id = NULL; + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + int err = suit_plat_component_id_get(component, &component_id); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get component id: %d", err); + return err; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to decode component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + LOG_DBG("Component type: %d", component_type); + + switch (component_type) { + case SUIT_COMPONENT_TYPE_UNSUPPORTED: + LOG_ERR("Unsupported component type"); + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + case SUIT_COMPONENT_TYPE_CAND_IMG: + err = suit_plat_check_image_match_mem_mapped(component, alg_id, digest); + break; + case SUIT_COMPONENT_TYPE_CAND_MFST: + err = suit_plat_check_image_match_mfst(component, alg_id, digest); + break; + + case SUIT_COMPONENT_TYPE_MEM: + case SUIT_COMPONENT_TYPE_SOC_SPEC: + case SUIT_COMPONENT_TYPE_INSTLD_MFST: + /* Handling of these component types is domain specific */ + err = suit_plat_check_image_match_domain_specific(component, alg_id, digest, + component_id, component_type); + break; + case SUIT_COMPONENT_TYPE_CACHE_POOL: + default: { + LOG_ERR("Unhandled component type: %d", component_type); + err = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + } + + return err; +} diff --git a/subsys/suit/platform/src/suit_plat_class_check.c b/subsys/suit/platform/src/suit_plat_class_check.c new file mode 100644 index 000000000000..e697b035d6b9 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_class_check.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_plat_class_check, CONFIG_SUIT_LOG_LEVEL); + +static const suit_uuid_t *validate_and_get_uuid(struct zcbor_string *in_uuid) +{ + if ((in_uuid == NULL) || (in_uuid->value == NULL) || + (in_uuid->len != sizeof(suit_uuid_t))) { + return NULL; + } + + return (const suit_uuid_t *)in_uuid->value; +} + +int suit_plat_check_cid(suit_component_t component_handle, struct zcbor_string *cid_uuid) +{ + suit_manifest_class_info_t + manifest_class_info_list[CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS] = {NULL}; + size_t size = CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS; + struct zcbor_string *component_id; + const suit_uuid_t *cid = validate_and_get_uuid(cid_uuid); + + if (cid == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + int ret = suit_plat_supported_manifest_class_infos_get(manifest_class_info_list, &size); + + if (ret != SUIT_SUCCESS) { + return ret; + } + + /* Get component ID from component_handle */ + if (suit_plat_component_id_get(component_handle, &component_id) != SUIT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + for (size_t i = 0; i < size; i++) { + if ((suit_plat_component_compatibility_check(manifest_class_info_list[i].class_id, + component_id) == SUIT_SUCCESS) && + (suit_metadata_uuid_compare(cid, manifest_class_info_list[i].class_id) == + SUIT_PLAT_SUCCESS)) { + return SUIT_SUCCESS; + } + } + + return SUIT_FAIL_CONDITION; +} + +int suit_plat_check_vid(suit_component_t component_handle, struct zcbor_string *vid_uuid) +{ + suit_manifest_class_info_t + manifest_class_info_list[CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS] = {NULL}; + size_t size = CONFIG_MAX_NUMBER_OF_MANIFEST_CLASS_IDS; + struct zcbor_string *component_id; + const suit_uuid_t *vid = validate_and_get_uuid(vid_uuid); + + if (vid == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + int ret = suit_plat_supported_manifest_class_infos_get(manifest_class_info_list, &size); + + if (ret != SUIT_SUCCESS) { + return ret; + } + + /* Get component ID from component_handle */ + if (suit_plat_component_id_get(component_handle, &component_id) != SUIT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + for (size_t i = 0; i < size; i++) { + if ((suit_plat_component_compatibility_check(manifest_class_info_list[i].class_id, + component_id) == SUIT_SUCCESS) && + (suit_metadata_uuid_compare(vid, manifest_class_info_list[i].vendor_id) == + SUIT_PLAT_SUCCESS)) { + return SUIT_SUCCESS; + } + } + + return SUIT_FAIL_CONDITION; +} + +int suit_plat_check_did(suit_component_t component_handle, struct zcbor_string *did_uuid) +{ + const suit_uuid_t *did = validate_and_get_uuid(did_uuid); + + if (did == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/src/suit_plat_commands.c b/subsys/suit/platform/src/suit_plat_commands.c new file mode 100644 index 000000000000..d81c76038958 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_commands.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +int suit_plat_check_slot(suit_component_t component_handle, unsigned int slot) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +/** File a report on a command result. */ +int suit_plat_report(unsigned int rep_policy, struct suit_report *report) +{ + return SUIT_ERR_UNSUPPORTED_COMMAND; +} diff --git a/subsys/suit/platform/src/suit_plat_components.c b/subsys/suit/platform/src/suit_plat_components.c new file mode 100644 index 000000000000..ef347ffc0771 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_components.c @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(plat_components, CONFIG_SUIT_LOG_LEVEL); + +struct suit_plat_component { + /** Slot to store the implementation-specific private data. */ + void *impl_data; + /** Slot to store the component ID. The implementation + * may use it instead of building full internal context. + */ + struct zcbor_string component_id; + bool in_use; +}; + +/** Platform component list, populated as a result of successful SUIT manifest validation. */ +static struct suit_plat_component components[SUIT_MAX_NUM_COMPONENT_PARAMS]; + +static inline bool is_mem_mapped(suit_component_type_t component_type) +{ + return (SUIT_COMPONENT_TYPE_CAND_IMG == component_type) || + (SUIT_COMPONENT_TYPE_CAND_MFST == component_type) || + (SUIT_COMPONENT_TYPE_MEM == component_type); +} + +/** Resolve pointer to the component structure into component handle. + */ +static inline suit_component_t handle_from_component(const struct suit_plat_component *component) +{ + return (suit_component_t)component; +} + +/** Resolve component handle into component structure. + * + * @details The component handle is considered as valid if its value + * points to the component array element and the element has + * an implementation assigned. + */ +static struct suit_plat_component *component_from_handle(suit_component_t handle) +{ + const suit_component_t first_component = (suit_component_t)(&components[0]); + struct suit_plat_component *component = (struct suit_plat_component *)handle; + + if ((handle < (intptr_t)&components[0]) || + (handle > (intptr_t)&components[SUIT_MAX_NUM_COMPONENT_PARAMS - 1]) || + ((handle - first_component) % (sizeof(struct suit_plat_component)) != 0) || + (!component->in_use)) { + return NULL; + } + + return component; +} + +int suit_plat_release_component_handle(suit_component_t handle) +{ + struct suit_plat_component *component = component_from_handle(handle); + + if (component == NULL) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + if (suit_plat_decode_component_type(&component->component_id, &component_type) != + SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (is_mem_mapped(component_type)) { + suit_memptr_storage_err_t ret = suit_memptr_storage_release(component->impl_data); + + if (ret != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_CRASH; + } + + component->impl_data = NULL; + } + + component->in_use = false; + + return SUIT_SUCCESS; +} + +int suit_plat_create_component_handle(struct zcbor_string *component_id, + suit_component_t *component_handle) +{ + suit_memptr_storage_err_t err; + struct suit_plat_component *component = NULL; + + if (component_id == NULL || component_handle == NULL) { + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + for (size_t i = 0; i < SUIT_MAX_NUM_COMPONENT_PARAMS; i++) { + if (components[i].in_use == false) { + component = &components[i]; + break; + } + } + + if (component == NULL) { + LOG_ERR("component is NULL"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + *component_handle = (intptr_t)component; + memset(component, 0, sizeof(struct suit_plat_component)); + + /* Store component ID and keys, so the selected implementation can use it in the future. */ + component->component_id.value = component_id->value; + component->component_id.len = component_id->len; + + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Error decoding component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if ((component_type == SUIT_COMPONENT_TYPE_CAND_IMG) || + (component_type == SUIT_COMPONENT_TYPE_CAND_MFST)) { + err = suit_memptr_storage_get(&component->impl_data); + if (err != SUIT_PLAT_SUCCESS) { + return suit_plat_err_to_processor_err_convert(err); + } + } + + if (component_type == SUIT_COMPONENT_TYPE_MEM) { + /* Get address and size of the component from its id */ + intptr_t address = (intptr_t)NULL; + size_t size = 0; + + if (suit_plat_decode_address_size(&component->component_id, &address, &size) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to decode address and size"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Associate memptr_storage with component's implementation data */ + err = suit_memptr_storage_get(&component->impl_data); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get memptr_storage: %d", err); + + return suit_plat_err_to_processor_err_convert(err); + } + + /* Set the address as in component id but set size with 0 */ + size = 0; + suit_memptr_storage_err_t err = suit_memptr_storage_ptr_store( + component->impl_data, (uint8_t *)address, size); + if (err != SUIT_PLAT_SUCCESS) { + suit_memptr_storage_release(component->impl_data); + component->impl_data = NULL; + LOG_ERR("Failed to store memptr ptr: %d", err); + return SUIT_ERR_CRASH; + } + } + + component->in_use = true; + return SUIT_SUCCESS; +} + +int suit_plat_component_impl_data_set(suit_component_t handle, void *impl_data) +{ + struct suit_plat_component *component = component_from_handle(handle); + + if (component == NULL) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + component->impl_data = impl_data; + return SUIT_SUCCESS; +} + +int suit_plat_component_impl_data_get(suit_component_t handle, void **impl_data) +{ + const struct suit_plat_component *component = component_from_handle(handle); + + if (component == NULL) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + *impl_data = component->impl_data; + return SUIT_SUCCESS; +} + +int suit_plat_component_id_get(suit_component_t handle, struct zcbor_string **component_id) +{ + struct suit_plat_component *component = component_from_handle(handle); + + if (component == NULL) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + *component_id = &(component->component_id); + return SUIT_SUCCESS; +} + +int suit_plat_override_image_size(suit_component_t handle, size_t size) +{ + struct zcbor_string *component_id = NULL; + + int err = suit_plat_component_id_get(handle, &component_id); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get component id: %i", err); + return err; + } + + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to decode component type: %i", err); + return SUIT_ERR_DECODING; + } + + /* Size override is done only for MEM type component */ + if (component_type == SUIT_COMPONENT_TYPE_MEM) { + intptr_t run_address; + size_t component_size; + + if (suit_plat_decode_address_size(component_id, &run_address, &component_size) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_address_size failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + LOG_DBG("%s, component size: %u, input size %u", __func__, component_size, size); + + if (size > component_size) { + LOG_ERR("Input size exceeds component size"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + void *impl_data = NULL; + + err = suit_plat_component_impl_data_get(handle, &impl_data); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get implementation data: %i", err); + return err; + } + + const uint8_t *payload_ptr = NULL; + size_t payload_size = 0; + + err = suit_memptr_storage_ptr_get(impl_data, &payload_ptr, &payload_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get memptr: %i", err); + return SUIT_ERR_CRASH; + } + + payload_size = size; + err = suit_memptr_storage_ptr_store(impl_data, payload_ptr, payload_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update memptr: %i", err); + return SUIT_ERR_CRASH; + } + + return SUIT_SUCCESS; + } + + LOG_ERR("%s does not support component type %d", __func__, component_type); + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_component_type_get(suit_component_t handle, suit_component_type_t *component_type) +{ + struct zcbor_string *component_id; + + int ret = suit_plat_component_id_get(handle, &component_id); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_id_get failed: %i", ret); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_component_type failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + return SUIT_SUCCESS; +} diff --git a/subsys/suit/platform/src/suit_plat_digest.c b/subsys/suit/platform/src/suit_plat_digest.c new file mode 100644 index 000000000000..7427469f43ee --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_digest.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include + +LOG_MODULE_REGISTER(suit_plat_digest, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_check_digest(enum suit_cose_alg alg_id, struct zcbor_string *digest, + struct zcbor_string *payload) +{ + psa_algorithm_t psa_alg; + + /* Find the PSA hash ID */ + switch (alg_id) { + case suit_cose_sha256: + psa_alg = PSA_ALG_SHA_256; + break; + default: + LOG_ERR("Unsupported digest algorithm: %d", alg_id); + return SUIT_ERR_DECODING; + } + + if ((digest == NULL) || (payload == NULL)) { + LOG_ERR("Invalid argument"); + return SUIT_FAIL_CONDITION; + } + + if ((payload->value == NULL) || (payload->len == 0)) { + LOG_ERR("Invalid payload"); + return SUIT_ERR_DECODING; + } + + size_t expected_hash_len = PSA_HASH_LENGTH(psa_alg); + + if (digest->len != expected_hash_len) { + LOG_ERR("Unexpected hash length: %d instead of %d", digest->len, expected_hash_len); + return SUIT_ERR_DECODING; + } + + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, psa_alg, digest->value); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get digest sink: %d", err); + return suit_plat_err_to_processor_err_convert(err); + } + + err = digest_sink.write(digest_sink.ctx, (uint8_t *)payload->value, payload->len); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to write to stream: %d", err); + return suit_plat_err_to_processor_err_convert(err); + } + + digest_sink_err_t ret = suit_digest_sink_digest_match(digest_sink.ctx); + + err = digest_sink.release(digest_sink.ctx); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to release stream: %d", err); + if (ret == SUIT_PLAT_SUCCESS) { + return suit_plat_err_to_processor_err_convert(err); + } + } + + if (ret == DIGEST_SINK_ERR_DIGEST_MISMATCH) { + return SUIT_FAIL_CONDITION; + } + + return suit_plat_err_to_processor_err_convert(err); +} diff --git a/subsys/suit/platform/src/suit_plat_error_convert.c b/subsys/suit/platform/src/suit_plat_error_convert.c new file mode 100644 index 000000000000..c1b0d1e20189 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_error_convert.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "suit_plat_error_convert.h" + +int suit_plat_err_to_processor_err_convert(suit_plat_err_t plat_err) +{ + int proc_err = SUIT_ERR_CRASH; + + switch (plat_err) { + case SUIT_PLAT_SUCCESS: + proc_err = SUIT_SUCCESS; + break; + case SUIT_PLAT_ERR_NOMEM: + case SUIT_PLAT_ERR_NO_RESOURCES: + proc_err = SUIT_ERR_OVERFLOW; + break; + case SUIT_PLAT_ERR_AUTHENTICATION: + proc_err = SUIT_ERR_AUTHENTICATION; + break; + case SUIT_PLAT_ERR_CBOR_DECODING: + proc_err = SUIT_ERR_DECODING; + break; + /* To be extended */ + default: + /* Return SUIT_ERR_CRASH */ + break; + } + + return proc_err; +} diff --git a/subsys/suit/platform/src/suit_plat_fetch.c b/subsys/suit/platform/src/suit_plat_fetch.c new file mode 100644 index 000000000000..6ac4c0f516b1 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_fetch.c @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#if CONFIG_SUIT_DIGEST_CACHE +#include +#endif /* CONFIG_SUIT_DIGEST_CACHE */ + +#ifdef CONFIG_SUIT_STREAM +#include +#include +#include +#endif /* CONFIG_SUIT_STREAM */ + +#ifdef CONFIG_SUIT_STREAM_SINK_MEMPTR +#include +#endif /* CONFIG_SUIT_STREAM_SINK_MEMPTR */ +#ifdef CONFIG_SUIT_CACHE_RW +#include +#endif + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_plat_fetch, CONFIG_SUIT_LOG_LEVEL); + +#ifdef CONFIG_SUIT_STREAM + +static int verify_and_get_sink(suit_component_t dst_handle, struct stream_sink *sink, + struct zcbor_string *uri, suit_component_type_t *component_type, + bool write_enabled) +{ + int ret = suit_plat_component_type_get(dst_handle, component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode component type: %i", ret); + return ret; + } + if (!suit_plat_fetch_domain_specific_is_type_supported(*component_type)) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Select sink */ +#ifdef CONFIG_SUIT_CACHE_RW + if (*component_type == SUIT_COMPONENT_TYPE_CACHE_POOL) { + uint32_t number; + struct zcbor_string *component_id; + + int ret = suit_plat_component_id_get(dst_handle, &component_id); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("suit_plat_component_id_get failed: %i", ret); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Missing component id number in candidate image component"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + ret = suit_dfu_cache_sink_get(sink, number, uri->value, uri->len, write_enabled); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting cache sink failed"); + } + + return suit_plat_err_to_processor_err_convert(ret); + } +#else + (void)write_enabled; +#endif /* CONFIG_SUIT_CACHE_RW */ + + return suit_sink_select(dst_handle, sink); +} +#endif /* CONFIG_SUIT_STREAM */ + +int suit_plat_check_fetch(suit_component_t dst_handle, struct zcbor_string *uri) +{ +#ifdef CONFIG_SUIT_STREAM + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + struct stream_sink dst_sink = {0}; + + int ret = verify_and_get_sink(dst_handle, &dst_sink, uri, &dst_component_type, false); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to verify component and get end sink"); + } + + ret = release_sink(&dst_sink); + if (ret != SUIT_PLAT_SUCCESS) { + return suit_plat_err_to_processor_err_convert(ret); + } + + return SUIT_SUCCESS; +#endif /* CONFIG_SUIT_STREAM */ + + return SUIT_ERR_UNSUPPORTED_COMMAND; +} + +int suit_plat_fetch(suit_component_t dst_handle, struct zcbor_string *uri) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink = {0}; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + int ret = SUIT_SUCCESS; + +#if CONFIG_SUIT_DIGEST_CACHE + ret = suit_plat_digest_cache_remove_by_handle(dst_handle); + + if (ret != SUIT_SUCCESS) { + return ret; + } +#endif + + ret = verify_and_get_sink(dst_handle, &dst_sink, uri, &dst_component_type, true); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to verify component end get end sink"); + return ret; + } + + /* Here other parts of pipe will be instantiated. + * Like decryption and/or decompression sinks. + */ + if (dst_sink.erase != NULL) { + ret = dst_sink.erase(dst_sink.ctx); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink mem erase failed: %i", ret); + return suit_plat_err_to_processor_err_convert(ret); + } + } + + ret = suit_plat_fetch_domain_specific(dst_handle, dst_component_type, &dst_sink, uri); + suit_plat_err_t release_ret = release_sink(&dst_sink); + + if (ret == SUIT_SUCCESS) { + ret = suit_plat_err_to_processor_err_convert(release_ret); + } + + return ret; +#else + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} + +int suit_plat_check_fetch_integrated(suit_component_t dst_handle, struct zcbor_string *payload) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + /* Get component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode component type: %i", ret); + return ret; + } + + if (!suit_plat_fetch_integrated_domain_specific_is_type_supported(dst_component_type)) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + +#ifndef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + + /* Get dst_sink - final destination sink */ + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Selecting sink failed: %i", ret); + return ret; + } + + /* Here other parts of pipe will be instantiated. + * Like decryption and/or decompression sinks. + */ + + ret = release_sink(&dst_sink); + return suit_plat_err_to_processor_err_convert(ret); +#else + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} + +int suit_plat_fetch_integrated(suit_component_t dst_handle, struct zcbor_string *payload) +{ +#ifdef CONFIG_SUIT_STREAM + struct stream_sink dst_sink; + suit_component_type_t dst_component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + /* Get component type based on component handle*/ + int ret = suit_plat_component_type_get(dst_handle, &dst_component_type); + + if (ret != SUIT_SUCCESS) { + LOG_ERR("Failed to decode component type: %i", ret); + return ret; + } + + if (!suit_plat_fetch_integrated_domain_specific_is_type_supported(dst_component_type)) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + +#ifndef CONFIG_SUIT_STREAM_SOURCE_MEMPTR + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM_SOURCE_MEMPTR */ + +#if CONFIG_SUIT_DIGEST_CACHE + ret = suit_plat_digest_cache_remove_by_handle(dst_handle); + + if (ret != SUIT_SUCCESS) { + return ret; + } +#endif + + /* Get dst_sink - final destination sink */ + ret = suit_sink_select(dst_handle, &dst_sink); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Selecting sink failed: %i", ret); + return ret; + } + + /* Here other parts of pipe will be instantiated. + * Like decryption and/or decompression sinks. + */ + + if (dst_sink.erase != NULL) { + ret = dst_sink.erase(dst_sink.ctx); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink mem erase failed, err code: %d", ret); + return suit_plat_err_to_processor_err_convert(ret); + } + } + + ret = suit_generic_address_streamer_stream(payload->value, payload->len, &dst_sink); + ret = suit_plat_err_to_processor_err_convert(ret); + + if (ret == SUIT_SUCCESS) { + ret = suit_plat_fetch_integrated_domain_specific(dst_handle, dst_component_type, + &dst_sink); + } + + suit_plat_err_t release_ret = release_sink(&dst_sink); + + if (ret == SUIT_SUCCESS) { + ret = suit_plat_err_to_processor_err_convert(release_ret); + } + + return ret; +#else /* CONFIG_SUIT_STREAM */ + return SUIT_ERR_UNSUPPORTED_COMMAND; +#endif /* CONFIG_SUIT_STREAM */ +} diff --git a/subsys/suit/platform/src/suit_plat_memptr_size_update.c b/subsys/suit/platform/src/suit_plat_memptr_size_update.c new file mode 100644 index 000000000000..e3aa1de4266b --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_memptr_size_update.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_plat_memptr_update_size, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_memptr_size_update(suit_component_t handle, size_t size) +{ + struct zcbor_string *component_id = NULL; + intptr_t run_address; + size_t component_size; + void *impl_data = NULL; + const uint8_t *payload_ptr = NULL; + size_t payload_size = 0; + + int err = suit_plat_component_id_get(handle, &component_id); + + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get component id: %i", err); + return err; + } + + if (suit_plat_decode_address_size(component_id, &run_address, &component_size) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("suit_plat_decode_address_size failed"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (size > component_size) { + LOG_ERR("Input size exceeds component size"); + return SUIT_ERR_UNSUPPORTED_PARAMETER; + } + + err = suit_plat_component_impl_data_get(handle, &impl_data); + if (err != SUIT_SUCCESS) { + LOG_ERR("Failed to get implementation data: %i", err); + return err; + } + + err = suit_memptr_storage_ptr_get(impl_data, &payload_ptr, &payload_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get memptr: %i", err); + return SUIT_ERR_CRASH; + } + + payload_size = size; + err = suit_memptr_storage_ptr_store(impl_data, payload_ptr, payload_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update memptr: %i", err); + return SUIT_ERR_CRASH; + } + + return SUIT_SUCCESS; +} diff --git a/subsys/suit/platform/src/suit_plat_retrieve_manifest.c b/subsys/suit/platform/src/suit_plat_retrieve_manifest.c new file mode 100644 index 000000000000..228fe1463c70 --- /dev/null +++ b/subsys/suit/platform/src/suit_plat_retrieve_manifest.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#ifdef CONFIG_SUIT_MEMPTR_STORAGE +#include +#endif /* CONFIG_SUIT_MEMPTR_STORAGE */ + +LOG_MODULE_REGISTER(suit_plat_retr_mfst, CONFIG_SUIT_LOG_LEVEL); + +int suit_plat_retrieve_manifest(suit_component_t component_handle, const uint8_t **envelope_str, + size_t *envelope_len) +{ + suit_component_type_t component_type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + int ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + struct zcbor_string *component_id; + + if ((envelope_str == NULL) || (envelope_len == NULL)) { + return SUIT_ERR_CRASH; + } + + /* Verify that the component ID has the correct format. */ + if (suit_plat_component_id_get(component_handle, &component_id) != SUIT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + if (suit_plat_decode_component_type(component_id, &component_type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Error decoding component type"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + switch (component_type) { +#ifdef CONFIG_SUIT_MEMPTR_STORAGE + case SUIT_COMPONENT_TYPE_CAND_MFST: { + memptr_storage_handle_t handle = NULL; + + ret = suit_plat_component_impl_data_get(component_handle, &handle); + if (ret != SUIT_SUCCESS) { + LOG_ERR("Unable to get data for manifest candidate (err: %d)", ret); + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + ret = suit_memptr_storage_ptr_get(handle, envelope_str, envelope_len); + if ((ret != SUIT_PLAT_SUCCESS) || (*envelope_str == NULL) || (*envelope_len == 0)) { + LOG_ERR("Unable to fetch pointer to manifest candidate" + "(memptr storage err: %d)", + ret); + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + if (suit_memory_global_address_is_in_external_memory((uintptr_t)*envelope_str) == + true) { + LOG_ERR("Manifest candidate is in external memory - this is not supported"); + ret = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + break; + } + + ret = SUIT_SUCCESS; + } break; +#endif /* CONFIG_SUIT_MEMPTR_STORAGE */ + default: + ret = suit_plat_retrieve_manifest_domain_specific(component_id, component_type, + envelope_str, envelope_len); + break; + } + + return ret; +} diff --git a/subsys/suit/provisioning/CMakeLists.txt b/subsys/suit/provisioning/CMakeLists.txt new file mode 100644 index 000000000000..bc29faba6739 --- /dev/null +++ b/subsys/suit/provisioning/CMakeLists.txt @@ -0,0 +1,165 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +set(SUIT_GENERATOR_CLI_SCRIPT "${ZEPHYR_SUIT_GENERATOR_MODULE_DIR}/suit_generator/cli.py") + +# Usage: +# generate_mpi_hex() +# +# Will generate HEX file for a single manifest role, based on Kconfigs defined by the template. +# +# : The role that was used to generate a set of Kconfigs, defined by the +# Kconfig.template.manifest_config. +# +# Required Kconfigs: +# - SUIT_MPI__VENDOR_NAME +# - SUIT_MPI__CLASS_NAME +# - SUIT_MPI__ADDRESS +# - SUIT_MPI__PATH +# - SUIT_MPI_SLOT_SIZE +# +function(generate_mpi_hex MANIFEST_ROLE) + set(GENERATE_ARGS "") + set(DESCR_ARGS "") + + if (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}) + return() + endif() + + if ((NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME) OR + (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME) OR + (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_ADDRESS) OR + (NOT DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH) OR + (NOT DEFINED CONFIG_SUIT_MPI_SLOT_SIZE) + ) + message(FATAL_ERROR "Malformed configuration for: ${MANIFEST_ROLE}") + return() + endif() + + list(APPEND GENERATE_ARGS + --vendor-name ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME} + --class-name ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME} + --address ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_ADDRESS} + --size ${CONFIG_SUIT_MPI_SLOT_SIZE} + --output-file ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH} + ) + + list(APPEND DESCR_ARGS + ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_PATH} + ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_VENDOR_NAME} + ${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_CLASS_NAME} + "address=${CONFIG_SUIT_MPI_${MANIFEST_ROLE}_ADDRESS}" + ) + + if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_DOWNGRADE_PREVENTION) + list(APPEND GENERATE_ARGS + --downgrade-prevention-enabled + ) + list(APPEND DESCR_ARGS + downgrade-prevention-enabled + ) + endif() + + if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_INDEPENDENT_UPDATE) + list(APPEND GENERATE_ARGS + --independent-updates + ) + list(APPEND DESCR_ARGS + "independent updates" + ) + endif() + + if(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_SIGNATURE_CHECK_ENABLED_ON_UPDATE) + list(APPEND GENERATE_ARGS + --signature-verification update + ) + list(APPEND DESCR_ARGS + "signed updates" + ) + elseif(DEFINED CONFIG_SUIT_MPI_${MANIFEST_ROLE}_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT) + list(APPEND GENERATE_ARGS + --signature-verification update-and-boot + ) + list(APPEND DESCR_ARGS + "signed updates" + "signed boot" + ) + endif() + + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} + mpi + generate + ${GENERATE_ARGS} + ) + + message(INFO " Generate MPI for ${MANIFEST_ROLE} manifest (${DESCR_ARGS})") +endfunction() + +# Usage: +# generate_mpi_area( [...]) +# +# Will generate HEX file for an MPI area attached to a single domain. +# At the end of the merging process, a digest of the resulting binary will be +# calculated and appended at the end of it. +# +# : Name of the area. A valid area must define output file path, address and size. +# : The role that was used to generate a set of Kconfigs, defined by the +# Kconfig.template.manifest_config. +# Used to extract the HEX file path containing the MPI configuration. +# +# Required Kconfigs: +# - SUIT_MPI__PATH +# - SUIT_MPI__ADDRESS +# - SUIT_MPI__SIZE +# - SUIT_MPI__PATH +# +function (generate_mpi_area area) + set(MERGE_ARGS "") + + if ((NOT DEFINED CONFIG_SUIT_MPI_${area}_PATH) OR + (NOT DEFINED CONFIG_SUIT_MPI_${area}_ADDRESS) OR + (NOT DEFINED CONFIG_SUIT_MPI_${area}_SIZE) + ) + message(FATAL_ERROR "Malformed configuration for: ${area}") + return() + endif() + + set(output ${CONFIG_SUIT_MPI_${area}_PATH}) + set(address ${CONFIG_SUIT_MPI_${area}_ADDRESS}) + set(size ${CONFIG_SUIT_MPI_${area}_SIZE}) + + list(APPEND MERGE_ARGS + --output-file ${output} + --address ${address} + --size ${size} + ) + + foreach(role ${ARGN}) + if(NOT DEFINED CONFIG_SUIT_MPI_${role}_PATH) + continue() + endif() + + list(APPEND MERGE_ARGS "--file" "${CONFIG_SUIT_MPI_${role}_PATH}") + endforeach() + + set_property(GLOBAL APPEND PROPERTY extra_post_build_commands + COMMAND ${PYTHON_EXECUTABLE} ${SUIT_GENERATOR_CLI_SCRIPT} + mpi + merge + ${MERGE_ARGS} + ) + + message(INFO " Generate merged MPI for ${area} (${output})") +endfunction() + +if(DEFINED CONFIG_SUIT_MPI_GENERATE) + +if(DEFINED CONFIG_SUIT_MPI_SOC_NRF54H20) +include(soc/nrf54h20.cmake) +endif() # CONFIG_SUIT_MPI_SOC_NRF54H20 + +endif() # CONFIG_SUIT_MPI_GENERATE diff --git a/subsys/suit/provisioning/Kconfig b/subsys/suit/provisioning/Kconfig new file mode 100644 index 000000000000..9199b64fe013 --- /dev/null +++ b/subsys/suit/provisioning/Kconfig @@ -0,0 +1,18 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menu "SUIT provisioning" + +config SUIT_MPI_GENERATE + bool "Generate SUIT Manifest Provisioning Information binary" + +if SUIT_MPI_GENERATE + +rsource "soc/Kconfig.nrf54h20" + +endif # SUIT_MPI_GENERATE + +endmenu diff --git a/subsys/suit/provisioning/soc/Kconfig.nrf54h20 b/subsys/suit/provisioning/soc/Kconfig.nrf54h20 new file mode 100644 index 000000000000..0f587b27a114 --- /dev/null +++ b/subsys/suit/provisioning/soc/Kconfig.nrf54h20 @@ -0,0 +1,165 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# +# WARNING: +# All addresses and sizes in this file must be sunchronized with the SUIT storage address +# defined in the Device Tree. +# Any modification of those values require alignment in the SDFW. +# Contents of the MPI (vendor name, class name, policies) may be modified by the +# product vendor. +# + +config SUIT_MPI_SOC_NRF54H20 + bool + default y if SOC_SERIES_NRF54HX + +if SUIT_MPI_SOC_NRF54H20 + +manifest=ROOT +manifest-class=nRF54H20_sample_root +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=y +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e9000 + +menu "Root manifest configuration" + +# Define as a regular config, so it is impossible to disable generation of the +# ROOT manifest configuration. +config SUIT_MPI_$(manifest) + bool + default y + +rsource "Kconfig.template.manifest_config" + +endmenu + +manifest=APP_RECOVERY +manifest-class=nRF54H20_sample_app_recovery +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=y +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e9030 + +menuconfig SUIT_MPI_$(manifest) + bool "Application recovery manifest configuration" + +rsource "Kconfig.template.manifest_config" + +manifest=APP_LOCAL_1 +manifest-class=nRF54H20_sample_app +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e9060 + +menuconfig SUIT_MPI_$(manifest) + bool "Application local (1) manifest configuration" + default y + +rsource "Kconfig.template.manifest_config" + +manifest=APP_LOCAL_2 +manifest-class=nRF54H20_sample_app_local_2 +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e9090 + +menuconfig SUIT_MPI_$(manifest) + bool "Application local (2) manifest configuration" + +rsource "Kconfig.template.manifest_config" + +manifest=APP_LOCAL_3 +manifest-class=nRF54H20_sample_app_local_3 +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e90c0 + +menuconfig SUIT_MPI_$(manifest) + bool "Application local (3) manifest configuration" + +rsource "Kconfig.template.manifest_config" + +config SUIT_MPI_APP_AREA_PATH + string "Path to the file with all application domain MPI configurations" + default "suit_mpi_application_merged.hex" + +config SUIT_MPI_APP_AREA_ADDRESS + hex + default 0xe1e9000 + help + Address of the application domain MPI configurations + +config SUIT_MPI_APP_AREA_SIZE + hex + default 0x0f0 + help + Size of the application domain MPI configurations + +manifest=RAD_RECOVERY +manifest-class=nRF54H20_sample_rad_recovery +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e8000 + +menuconfig SUIT_MPI_$(manifest) + bool "Radio recovery manifest configuration" + +rsource "Kconfig.template.manifest_config" + +manifest=RAD_LOCAL_1 +manifest-class=nRF54H20_sample_rad +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e8030 + +menuconfig SUIT_MPI_$(manifest) + bool "Radio local (1) manifest configuration" + default y + +rsource "Kconfig.template.manifest_config" + +manifest=RAD_LOCAL_2 +manifest-class=nRF54H20_sample_rad_local_2 +manifest-downgrade-prevention-enabled=n +manifest-independent-updates=n +manifest-signature-check=DISABLED +manifest-mpi-address=0xe1e8060 + +menuconfig SUIT_MPI_$(manifest) + bool "Radio local (2) manifest configuration" + +rsource "Kconfig.template.manifest_config" + +config SUIT_MPI_RAD_AREA_PATH + string "Path to the file with all radio domain MPI configurations" + default "suit_mpi_radio_merged.hex" + +config SUIT_MPI_RAD_AREA_ADDRESS + hex + default 0xe1e8000 + help + Address of the radio domain MPI configurations + +config SUIT_MPI_RAD_AREA_SIZE + hex + default 0x90 + help + Size of the radio domain MPI configurations + +config SUIT_MPI_SLOT_SIZE + hex + default 0x30 + help + Size of each MPI configuration slot + +endif # SUIT_MPI_SOC_NRF54H20 diff --git a/subsys/suit/provisioning/soc/Kconfig.template.manifest_config b/subsys/suit/provisioning/soc/Kconfig.template.manifest_config new file mode 100644 index 000000000000..66641b2ae957 --- /dev/null +++ b/subsys/suit/provisioning/soc/Kconfig.template.manifest_config @@ -0,0 +1,54 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if SUIT_MPI_$(manifest) + +config SUIT_MPI_$(manifest)_VENDOR_NAME + string "Vendor name to generate vendor UUID" + default "nordicsemi.com" + +config SUIT_MPI_$(manifest)_CLASS_NAME + string "Vendor name to generate class UUID" + default "$(manifest-class)" + +config SUIT_MPI_$(manifest)_DOWNGRADE_PREVENTION + bool "Enable downgrade prevention policy" + default $(manifest-downgrade-prevention-enabled) + +config SUIT_MPI_$(manifest)_INDEPENDENT_UPDATE + bool "Enable independent updateability policy" + default $(manifest-independent-updates) + +choice "SUIT_MPI_$(manifest)_SIGNATURE_CHECK" + prompt "Manifest digest signature check" + default SUIT_MPI_$(manifest)_SIGNATURE_CHECK_$(manifest-signature-check) + +config SUIT_MPI_$(manifest)_SIGNATURE_CHECK_DISABLED + bool "Disabled" + help + Do not require or verify manifest digest signature check + +config SUIT_MPI_$(manifest)_SIGNATURE_CHECK_ENABLED_ON_UPDATE + bool "Enabled on update" + help + Require and verify manifest digest signature check on update + +config SUIT_MPI_$(manifest)_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT + bool "Enabled on update and boot" + help + Require and verify manifest digest signature check on update and boot + +endchoice # SUIT_MPI_$(manifest)_SIGNATURE_CHECK + +config SUIT_MPI_$(manifest)_ADDRESS + hex # Constant for all devices using Nordic's SDFW + default $(manifest-mpi-address) + +config SUIT_MPI_$(manifest)_PATH + string "Path to the output MPI HEX file" + default "suit_mpi_$(manifest).hex" + +endif # SUIT_MPI_$(manifest) diff --git a/subsys/suit/provisioning/soc/nrf54h20.cmake b/subsys/suit/provisioning/soc/nrf54h20.cmake new file mode 100644 index 000000000000..3ab5ec5c4024 --- /dev/null +++ b/subsys/suit/provisioning/soc/nrf54h20.cmake @@ -0,0 +1,33 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# List all manifest roles. +# The function internally checks if the enabling symbol is defined. +# If role is enabled, the function verifies if all required options are defined. + +generate_mpi_hex(ROOT) +generate_mpi_hex(APP_RECOVERY) +generate_mpi_hex(APP_LOCAL_1) +generate_mpi_hex(APP_LOCAL_2) +generate_mpi_hex(APP_LOCAL_3) +generate_mpi_area( + APP_AREA + ROOT + APP_RECOVERY + APP_LOCAL_1 + APP_LOCAL_2 + APP_LOCAL_3 +) + +generate_mpi_hex(RAD_RECOVERY) +generate_mpi_hex(RAD_LOCAL_1) +generate_mpi_hex(RAD_LOCAL_2) +generate_mpi_area( + RAD_AREA + RAD_RECOVERY + RAD_LOCAL_1 + RAD_LOCAL_2 +) diff --git a/subsys/suit/storage/CMakeLists.txt b/subsys/suit/storage/CMakeLists.txt new file mode 100644 index 000000000000..ee1b63e8de69 --- /dev/null +++ b/subsys/suit/storage/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +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) + +zephyr_library() +zephyr_library_sources_ifdef(CONFIG_SUIT_STORAGE_LAYOUT_TEST src/suit_storage_test.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20 src/suit_storage_nrf54h20.c) +zephyr_library_sources(src/suit_storage_update.c) +zephyr_library_sources(src/suit_storage_encode.c) +zephyr_library_sources(src/suit_storage_envelope.c) +zephyr_library_sources(src/suit_storage_mpi.c) +zephyr_library_sources(src/suit_storage_nvv.c) +zephyr_library_sources(src/suit_storage_report.c) + +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) diff --git a/subsys/suit/storage/Kconfig b/subsys/suit/storage/Kconfig new file mode 100644 index 000000000000..1f711f3a3a2a --- /dev/null +++ b/subsys/suit/storage/Kconfig @@ -0,0 +1,80 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_STORAGE + bool "Enable SUIT storage module" + depends on ZCBOR + depends on ZCBOR_CANONICAL + depends on SUIT_METADATA + depends on SUIT_UTILS + depends on FLASH + depends on SUIT_PLATFORM_VARIANT_SDFW + +if SUIT_STORAGE + +choice SUIT_STORAGE_LAYOUT + prompt "MCU-specific layout of the SUIT storage" + default SUIT_STORAGE_LAYOUT_NRF54H20 if SOC_SERIES_NRF54HX + default SUIT_STORAGE_LAYOUT_TEST if !SOC_SERIES_NRF54HX + +config SUIT_STORAGE_LAYOUT_NRF54H20 + bool "nRF54H20" + depends on SUIT_CRYPTO + select PSA_WANT_ALG_SHA_256 + +config SUIT_STORAGE_LAYOUT_TEST + bool "tests" + help + Configuration to be used for running SUIT tests + +endchoice # SUIT_STORAGE_LAYOUT + +config SUIT_STORAGE_N_UPDATE_REGIONS + int "Maximum number of memory regions, describing the update candidate" + default 7 + help + The memory region may describe SUIT envelope as well as the SUIT cache. + +config SUIT_STORAGE_N_ENVELOPES + int "Number of envelopes, possible to store in SUIT storage" + default 11 if SOC_SERIES_NRF54HX + default 5 if SOC_NRF52840 + default 5 if SOC_POSIX + help + Since it is not supported to reserve more memory after the device + is deployed, use larger value than it is necessary. + + For nRF54H20 the following envelopes may be defined: + - Nordic Top + - SecDom: firmware + recovery + - SysCtlr: firmware + - Radio: recovery + * Radio: firmware (A) + * Radio: firmware (B) + - ROOT + - Application: recovery + - Application: firmware (A) + - Application: firmware (B) + * Application: user data + + Manifests marked with (*) are not available in legacy SUIT storage format. + + For debug and test platforms (POSIX, nRF52840) the following envelopes may be defined: + - ROOT + - Application: recovery + - Application: firmware (A) + - Application: firmware (B) + - Application: user data + +config SUIT_STORAGE_ENVELOPE_SIZE + int "The maximum size of envelope that can be stored in a single SUIT storage slot" + default 2048 + +config SUIT_STORAGE_CONFIG_SIZE + int "The size of the SUIT configuration area, stored inside the SUIT storage partition" + default 128 + +endif # SUIT_STORAGE diff --git a/subsys/suit/storage/include/suit_storage.h b/subsys/suit/storage/include/suit_storage.h new file mode 100644 index 000000000000..43521218e91f --- /dev/null +++ b/subsys/suit/storage/include/suit_storage.h @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief SUIT storage module. + * + * @details This module is responsible for providing access to installed manifests, + * allows to install them as well as read Manifest Provisioning Information + * and manipulate Non-volatile variables accessible by the OEM manifests. + */ + +#ifndef SUIT_STORAGE_H__ +#define SUIT_STORAGE_H__ + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the SUIT storage. + * + * @retval SUIT_PLAT_SUCCESS if module is successfully initialized. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + */ +suit_plat_err_t suit_storage_init(void); + +/** + * @brief Get the memory regions, containing update candidate. + * + * @param[out] regions List of update candidate memory regions (envelope, caches). + * By convention, the first region holds the SUIT envelope. + * @param[out] len Length of the memory regions list. + * + * @retval SUIT_PLAT_SUCCESS if pointer to the update candidate info successfully returned. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if update candidate area has incorrect size. + * @retval SUIT_PLAT_ERR_NOT_FOUND if update candidate is not set. + */ +suit_plat_err_t suit_storage_update_cand_get(const suit_plat_mreg_t **regions, size_t *len); + +/** + * @brief Save the information about update candidate. + * + * @param[in] regions List of update candidate memory regions (envelope, caches). + * By convention, the first region holds the SUIT envelope. + * @param[in] len Length of the memory regions list. + * + * @retval SUIT_PLAT_SUCCESS if update candidate info successfully saved. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if update candidate area has incorrect size or the number + * of update regions is too big. + * @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_update_cand_set(suit_plat_mreg_t *regions, size_t len); + +/** + * @brief Get the address and size of the envelope, stored inside the SUIT partition. + * + * @param[in] id Class ID of the manifest inside the envelope. + * @param[out] addr SUIT envelope address. + * @param[out] size SUIT envelope size. + * + * @retval SUIT_PLAT_SUCCESS if the envelope was successfully returned. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode envelope. + */ +suit_plat_err_t suit_storage_installed_envelope_get(const suit_manifest_class_id_t *id, + const uint8_t **addr, size_t *size); + +/** + * @brief Install the authentication block and manifest of the envelope inside the SUIT storage. + * + * @note This API removes all severable elements of the SUIT envelope, such as integrated + * payloads, text fields, etc. + * + * @param[in] id Class ID of the manifest inside the envelope. + * @param[in] addr SUIT envelope address. + * @param[in] size SUIT envelope size. + * + * @retval SUIT_PLAT_SUCCESS if the envelope was successfully insatlled. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode input or encode severed envelope. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid + * (i.e. NULL, buffer length, incorrect class ID). + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + * @retval SUIT_PLAT_ERR_INCORRECT_STATE if the previous installation was unexpectedly aborted. + */ +suit_plat_err_t suit_storage_install_envelope(const suit_manifest_class_id_t *id, uint8_t *addr, + size_t size); + +/** + * @brief Get the value of manifest non-volatile variable. + * + * @param[in] index Index of the variable. + * @param[out] value Pointer to store the value. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully read. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE unable to read NVVs from the provided area. + * @retval SUIT_PLAT_ERR_NOT_FOUND if the index value is too big. + */ +suit_plat_err_t suit_storage_var_get(size_t index, uint32_t *value); + +/** + * @brief Set the value of manifest non-volatile variable. + * + * @param[in] index Index of the variable. + * @param[in] value Value to set. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully updated. + * @retval SUIT_PLAT_ERR_SIZE unable to store NVVs inside the configured area. + * @retval SUIT_PLAT_ERR_NOT_FOUND if the index value is too big. + * @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_var_set(size_t index, uint32_t value); + +/** + * @brief Erase the report area. + * + * @param[in] index Index of the report slot. + * + * @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_OUT_OF_BOUNDS if the index value is too big. + * @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_report_clear(size_t index); + +/** + * @brief Save the binary data representing the processing report. + * + * @param[in] index Index of the report slot. + * @param[in] buf Binary data representing report to save. + * @param[in] len Length of the binary data. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully saved. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if binary data is too long. + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS if the index value is too big. + * @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_report_save(size_t index, const uint8_t *buf, size_t len); + +/** + * @brief Read the binary data representing the processing report. + * + * @param[in] index Index of the report slot. + * @param[out] buf Pointer to the binary data representing the report. + * @param[out] len Length of the report. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully read. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS if the index value is too big. + * @retval SUIT_PLAT_ERR_NOT_FOUND if update report is not saved. + */ +suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size_t *len); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_STORAGE_H__ */ diff --git a/subsys/suit/storage/include/suit_storage_internal.h b/subsys/suit/storage/include/suit_storage_internal.h new file mode 100644 index 000000000000..297ac441b691 --- /dev/null +++ b/subsys/suit/storage/include/suit_storage_internal.h @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief Internal SUIT storage submodules, types and constants. + * + * @details The SUIT storage module has been divided into several submodules, depending on the type + * of data they modify: + * - Manifest Provisioning Information submodule (exposed through dedicated header file) + * - Envelope submodule, responsible for parsing and installing envelopes. + * - Update candidate submodule, responsible for parsing and storing memory regions, + * containing update candidate envelope and caches. + * - Non-volatile variables, responsible to parsing and modifying persistent variables, + * accessible by the OEM manifests. + */ + +#ifndef SUIT_STORAGE_INTERNAL_H__ +#define SUIT_STORAGE_INTERNAL_H__ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SUIT_STORAGE_NVM_NODE \ + COND_CODE_1(DT_NODE_EXISTS(DT_NODELABEL(secdom_nvs)), (DT_NODELABEL(secdom_nvs)), \ + (DT_CHOSEN(zephyr_flash))) +#define SUIT_STORAGE_WRITE_SIZE DT_PROP(SUIT_STORAGE_NVM_NODE, write_block_size) +#define SUIT_STORAGE_EB_SIZE DT_PROP(SUIT_STORAGE_NVM_NODE, erase_block_size) +#define SUIT_STORAGE_ACCESS_BLOCK_SIZE \ + (COND_CODE_1(DT_NODE_EXISTS(DT_NODELABEL(mpc110)), \ + (COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(mpc110), override_granularity), \ + (DT_PROP(DT_NODELABEL(mpc110), override_granularity)), \ + (SUIT_STORAGE_EB_SIZE))), \ + (SUIT_STORAGE_EB_SIZE))) + +#define CEIL_DIV(a, b) ((((a)-1) / (b)) + 1) +#define EB_ALIGN(size) (CEIL_DIV(size, SUIT_STORAGE_EB_SIZE) * SUIT_STORAGE_EB_SIZE) +#define WRITE_ALIGN(size) (CEIL_DIV(size, SUIT_STORAGE_WRITE_SIZE) * SUIT_STORAGE_WRITE_SIZE) +#define EB_SIZE(type) (EB_ALIGN(sizeof(type))) +#define ACCESS_SIZE(type) \ + (CEIL_DIV(sizeof(type), SUIT_STORAGE_ACCESS_BLOCK_SIZE) * SUIT_STORAGE_ACCESS_BLOCK_SIZE) + +/* Values defined in the SUIT manifest specification. */ +#define SUIT_AUTHENTICATION_WRAPPER_TAG 2 +#define SUIT_MANIFEST_TAG 3 +#define SUIT_MANIFEST_COMPONENT_ID_TAG 5 + +/* The maximum length of the encoded CBOR key-value pair header with integer key and bstr value. */ +#define SUIT_STORAGE_ENCODED_BSTR_HDR_LEN_MAX 6 + +/* The maximum length of the encoded SUIT storage header with envelope header. */ +#define SUIT_STORAGE_ENCODED_ENVELOPE_HDR_LEN_MAX \ + (1 /* CBOR MAP */ + 4 /* CBOR keys (3 bytes) and version (1 byte) */ + \ + 3 /* class ID offset */ + 3 /* SUIT envelope length */ + 3 /* SUIT envelope tag */) + +/* The length of CBOR tag and SUIT envelope header. */ +#define SUIT_STORAGE_ENCODED_ENVELOPE_TAG_LEN 3 + +/* Decoded SUIT storage envelope slot. */ +typedef struct { + suit_plat_mreg_t envelope; + size_t class_id_offset; +} suit_envelope_hdr_t; + +/* Decoded severed SUIT envelope with the manifest component ID field. + * + * This representation is used to construct the severed SUIT envelope as well as + * additional fields, stored inside SUIT storage envelope slot map. + */ +struct SUIT_Envelope_severed { + struct zcbor_string suit_authentication_wrapper; + struct zcbor_string suit_manifest; + struct zcbor_string suit_manifest_component_id; +}; + +/* Update candidate metadata. */ +struct update_candidate_info { + uint32_t update_magic_value; + size_t update_regions_len; + suit_plat_mreg_t update_regions[CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS]; +}; + +/** @defgroup suit_storage_encode Internal CBOR structure encoding and decoding + * @{ + */ + +/** @brief Calculate the value of encoded key-value CBOR map header. + * + * @details All values (key, length) are limited to 0xFFFF (16-bit). + * + * @param[in] key CBOR map key value. + * @param[in] bstr_len CBOR bstr length to be encoded inside the header. + * @param[out] p_len Header length + * + * @retval SUIT_PLAT_SUCCESS if the length was successfully calculated. + * @retval SUIT_PLAT_ERR_INVAL if invalid input argument was provided (i.e. NULL). + */ +suit_plat_err_t suit_storage_bstr_kv_header_len(uint32_t key, size_t bstr_len, size_t *p_len); + +/** @brief Encode key-value CBOR map header. + * + * @details All values (key, length) are limited to 0xFFFF (16-bit). + * + * @param[in] key CBOR map key value. + * @param[in] bstr_len CBOR bstr length to be encoded inside the header. + * @param[out] buf Buffer to fill. + * @param[inout] len As input - length of the buffer, + * as output - number of bytes consumed. + * + * @retval SUIT_PLAT_SUCCESS if the header was successfully encoded. + * @retval SUIT_PLAT_ERR_INVAL if invalid input argument was provided (i.e. NULL, buffer length). + */ +suit_plat_err_t suit_storage_encode_bstr_kv_header(uint32_t key, size_t bstr_len, uint8_t *buf, + size_t *len); + +/** @brief Decode SUIT storage entry. + * + * @param[in] buf Buffer to prase. + * @param[in] len Length of the buffer. + * @param[out] envelope Decoded entry. + * + * @retval SUIT_PLAT_SUCCESS if the entry was successfully decoded. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode entry. + */ +suit_plat_err_t suit_storage_decode_envelope_header(const uint8_t *buf, size_t len, + suit_envelope_hdr_t *envelope); + +/** @brief Encode SUIT storage entry with SUIT envelope header. + * + * @param[in] envelope Envelope header to encode. + * @param[out] buf Buffer to fill. + * @param[inout] len As input - length of the buffer, + * as output - number of bytes consumed. + * + * @retval SUIT_PLAT_SUCCESS if the entry was successfully encoded. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to encode entry. + */ +suit_plat_err_t suit_storage_encode_envelope_header(suit_envelope_hdr_t *envelope, uint8_t *buf, + size_t *len); + +/** @brief Decode SUIT envelope. + * + * @param[in] buf Buffer to prase. + * @param[in] len Length of the buffer. + * @param[out] envelope Decoded envelope. + * @param[out] envelope_len Decoded envelope length. + * + * @retval SUIT_PLAT_SUCCESS if the envelope was successfully decoded. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode envelope. + */ +suit_plat_err_t suit_storage_decode_suit_envelope_severed(const uint8_t *buf, size_t len, + struct SUIT_Envelope_severed *envelope, + size_t *envelope_len); + +/** @} */ + +/** @defgroup suit_storage_update_candidate Update candidate submodule + * @{ + */ + +/** + * @brief Initialize the SUIT storage submodule, responsible for storing/returning + * update candidate info. + * + * @retval SUIT_PLAT_SUCCESS if module is successfully initialized. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + */ +suit_plat_err_t suit_storage_update_init(void); + +/** + * @brief Get the memory regions, containing update candidate. + * + * @param[in] addr Address of erase-block aligned memory containing update candidate info. + * @param[in] size Size of erase-block aligned memory, containing update candidate info. + * @param[out] regions List of update candidate memory regions (envelope, caches). + * By convention, the first region holds the SUIT envelope. + * @param[out] len Length of the memory regions list. + * + * @retval SUIT_PLAT_SUCCESS if pointer to the update candidate info successfully returned. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if update candidate area has incorrect size. + * @retval SUIT_PLAT_ERR_NOT_FOUND if update candidate is not set. + */ +suit_plat_err_t suit_storage_update_get(const uint8_t *addr, size_t size, + const suit_plat_mreg_t **regions, size_t *len); + +/** + * @brief Save the information about update candidate. + * + * @param[in] addr Address of erase-block aligned memory containing update candidate info. + * @param[in] size Size of erase-block aligned memory, containing update candidate info. + * @param[in] regions List of update candidate memory regions (envelope, caches). + * By convention, the first region holds the SUIT envelope. + * @param[in] len Length of the memory regions list. + * + * @retval SUIT_PLAT_SUCCESS if update candidate info successfully saved. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if update candidate area has incorrect size or the number + * of update regions is too big. + * @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_update_set(uint8_t *addr, size_t size, const suit_plat_mreg_t *regions, + size_t len); + +/** @} */ + +/** @defgroup suit_storage_envelope Envelope submodule + * @{ + */ + +/** + * @brief Get the address and size of the envelope, stored inside the SUIT partition. + * + * @param[in] area_addr Address of erase-block aligned memory containing envelope. + * @param[in] area_size Size of erase-block aligned memory, containing envelope. + * @param[in] id Class ID of the manifest inside the envelope. + * @param[out] addr SUIT envelope address. + * @param[out] size SUIT envelope size. + * + * @retval SUIT_PLAT_SUCCESS if the envelope was successfully returned. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode envelope. + */ +suit_plat_err_t suit_storage_envelope_get(const uint8_t *area_addr, size_t area_size, + const suit_manifest_class_id_t *id, const uint8_t **addr, + size_t *size); + +/** + * @brief Install the authentication block and manifest of the envelope inside the SUIT storage. + * + * @note This API removes all severable elements of the SUIT envelope, such as integrated + * payloads, text fields, etc. + * + * @param[in] area_addr Address of erase-block aligned memory containing envelope. + * @param[in] area_size Size of erase-block aligned memory, containing envelope. + * @param[in] id Class ID of the manifest inside the envelope. + * @param[in] addr SUIT envelope address. + * @param[in] size SUIT envelope size. + * + * @retval SUIT_PLAT_SUCCESS if the envelope was successfully insatlled. + * @retval SUIT_PLAT_ERR_CBOR_DECODING if failed to decode input or encode severed envelope. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid + * (i.e. NULL, buffer length, incorrect class ID). + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + * @retval SUIT_PLAT_ERR_INCORRECT_STATE if the previous installation was unexpectedly aborted. + */ +suit_plat_err_t suit_storage_envelope_install(uint8_t *area_addr, size_t area_size, + const suit_manifest_class_id_t *id, + const uint8_t *addr, size_t size); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_STORAGE_INTERNAL_H__ */ diff --git a/subsys/suit/storage/include/suit_storage_mpi.h b/subsys/suit/storage/include/suit_storage_mpi.h new file mode 100644 index 000000000000..7f7dee7f1385 --- /dev/null +++ b/subsys/suit/storage/include/suit_storage_mpi.h @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief Manifest Provisioning Information storage + * + * @details This module implements a SUIT storage submodule, responsible for interpreting + * the Manifest Provisioning Information (MPI). + * This data should be programmed into the device during the device setup phase as it is + * essential for the SUIT modules to identify the manifest(s) to boot. + * Additionally, it configures the list of manifest class and vendor ID pairs that will + * be accepted to be processed. + * For each supported manifest, the MPI defines update, downgrade and signature + * verification policy. + * The location of the MPI structure inside the NVM memory is provided by the main SUIT + * storage module and passed to this module as part of the initialization procedure. + */ + +#ifndef SUIT_STORAGE_MPI_H__ +#define SUIT_STORAGE_MPI_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SUIT_MPI_INFO_VERSION 1 + +#define SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED 1 +#define SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED 2 + +#define SUIT_MPI_INDEPENDENT_UPDATE_DENIED 1 +#define SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED 2 + +#define SUIT_MPI_SIGNATURE_CHECK_DISABLED 1 +#define SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE 2 +#define SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT 3 + +typedef const struct { + uint8_t version; + uint8_t downgrade_prevention_policy; + uint8_t independent_updateability_policy; + uint8_t signature_verification_policy; + + uint8_t reserved[12]; + + uint8_t vendor_id[16]; + uint8_t class_id[16]; +} suit_storage_mpi_t; + +/** + * @brief Initialize the SUIT storage module managing Manifest Provisioning Information. + * + * @details This function will clear all data configured by @ref suit_storage_mpi_configuration_load + * + * @retval SUIT_PLAT_SUCCESS if successfully initialized. + */ +suit_plat_err_t suit_storage_mpi_init(void); + +/** + * @brief Add a configuration for a manifest with the given role. + * + * @param[in] role Role of the manifest in the system. + * @param[in] addr NVM address, under which the MPI information structure is stored. + * @param[in] size Size of the NVM area, reserved to store MPI information structure + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_EXISTS manifest with given role already configured. + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS unsupported manifest provisioning structure format. + * @retval SUIT_PLAT_ERR_SIZE unable to store more MPI configurations. + * @retval SUIT_PLAT_ERR_NOT_FOUND manifest provisioning structure erased (0xFF). + * @retval SUIT_PLAT_ERR_UNSUPPORTED MPI values are not supported in the provided role. + */ +suit_plat_err_t suit_storage_mpi_configuration_load(suit_manifest_role_t role, const uint8_t *addr, + size_t size); + +/** + * @brief Find a role for a manifest with given class ID. + * + * @param[in] class_id Manifest class ID. + * @param[out] role Pointer to the role variable. + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_NOT_FOUND manifest with given manifest class ID not configured. + */ +suit_plat_err_t suit_storage_mpi_role_get(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role); + +/** + * @brief Find a manifest class ID with the given role. + * + * @param[in] role Role of the manifest. + * @param[out] class_id Pointer to the manifest class ID to set. + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_NOT_FOUND manifest with given role not configured. + */ +suit_plat_err_t suit_storage_mpi_class_get(suit_manifest_role_t role, + const suit_manifest_class_id_t **class_id); + +/** + * @brief Find a manifest provisioning information for a manifest with given class ID. + * + * @param[in] class_id Manifest class ID. + * @param[out] mpi Pointer to the MPI structure to fill. + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_NOT_FOUND manifest with given manifest class ID not configured. + */ +suit_plat_err_t suit_storage_mpi_get(const suit_manifest_class_id_t *class_id, + suit_storage_mpi_t **mpi); + +/** + * @brief Gets an array of configured manifest class ids. + * + * @param[out] class_info Array of manifest class ids and roles + * @param[in,out] size as input - maximal amount of elements an array can hold, + * as output - amount of stored elements + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_SIZE array too small to store all information + */ +suit_plat_err_t suit_storage_mpi_class_ids_get(suit_manifest_class_info_t *class_info, + size_t *size); + +/** + * @brief Convert value representing the downgrade prevention policy stored in MPI + * to the corresponding value of the suit_downgrade_prevention_policy_t enum. + * + * @param[in] mpi_policy The value stored in the MPI storage + * + * @retval Value of the suit_downgrade_prevention_policy_t enum + */ +suit_downgrade_prevention_policy_t suit_mpi_downgrade_prevention_policy_to_metadata(int mpi_policy); + +/** + * @brief Convert value representing the independent updateability policy stored in MPI + * to the corresponding value of the suit_independent_updateability_policy_t enum. + * + * @param[in] mpi_policy The value stored in the MPI storage + * + * @retval Value of the suit_independent_updateability_policy_t enum + */ +suit_independent_updateability_policy_t +suit_mpi_independent_updateability_policy_to_metadata(int mpi_policy); + +/** + * @brief Convert value representing the signature verification policy stored in MPI + * to the corresponding value of the suit_signature_verification_policy_t enum. + * + * @param[in] mpi_policy The value stored in the MPI storage + * + * @retval Value of the suit_signature_verification_policy_t enum + */ +suit_signature_verification_policy_t +suit_mpi_signature_verification_policy_to_metadata(int mpi_policy); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_STORAGE_MPI_H__ */ diff --git a/subsys/suit/storage/include/suit_storage_nvv.h b/subsys/suit/storage/include/suit_storage_nvv.h new file mode 100644 index 000000000000..5d41808f3e0c --- /dev/null +++ b/subsys/suit/storage/include/suit_storage_nvv.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief Manifest Non-volatile variables storage + * + * @details This module implements a SUIT storage submodule, allowing to access non-volatile + * variables (NVV) from the SUIT manifest sequences. + * This module implements a functionality to initialize the area with variables. + * There is no need to configure this area as part of the device setup procedure. + * The location of the NVV structure inside the NVM memory is provided by the main SUIT + * storage module and passed to this module as part of the initialization procedure. + */ + +#ifndef SUIT_STORAGE_NVV_H__ +#define SUIT_STORAGE_NVV_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SUIT_STORAGE_NVV_N_VARS 8 + +typedef uint32_t suit_storage_nvv_t[SUIT_STORAGE_NVV_N_VARS]; + +/** + * @brief Initialize the SUIT storage module managing Manifest Non-volatile variables. + * + * @details If the memory is erased or invalid, this function will not initialize it with default + * values. The area can be filled with default values using @ref suit_storage_nvv_erase + * + * @retval SUIT_PLAT_SUCCESS if successfully initialized. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + */ +suit_plat_err_t suit_storage_nvv_init(void); + +/** + * @brief Erase the NVV area. + * + * @param[in] area_addr Address of erase-block aligned memory containing variables. + * @param[in] area_size Size of erase-block aligned memory, containing variables. + * + * @retval SUIT_PLAT_SUCCESS if NVVs were successfully erased. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE unable to initialize NVVs inside the provided area. + * @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_nvv_erase(uint8_t *area_addr, size_t area_size); + +/** + * @brief Get the value of manifest non-volatile variable. + * + * @param[in] area_addr Address of erase-block aligned memory containing variables. + * @param[in] area_size Size of erase-block aligned memory, containing variables. + * @param[in] index Index of the variable. + * @param[out] value Pointer to store the value. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully read. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE unable to read NVVs from the provided area. + * @retval SUIT_PLAT_ERR_NOT_FOUND if the index value is too big. + */ +suit_plat_err_t suit_storage_nvv_get(const uint8_t *area_addr, size_t area_size, size_t index, + uint32_t *value); + +/** + * @brief Set the value of manifest non-volatile variable. + * + * @param[in] area_addr Address of erase-block aligned memory containing variables. + * @param[in] area_size Size of erase-block aligned memory, containing variables. + * @param[in] index Index of the variable. + * @param[in] value Value to set. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully updated. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE unable to store NVVs inside the provided area. + * @retval SUIT_PLAT_ERR_NOT_FOUND if the index value is too big. + * @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_nvv_set(uint8_t *area_addr, size_t area_size, size_t index, + uint32_t value); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_STORAGE_NVV_H__ */ diff --git a/subsys/suit/storage/include/suit_storage_report_internal.h b/subsys/suit/storage/include/suit_storage_report_internal.h new file mode 100644 index 000000000000..8c6517a97696 --- /dev/null +++ b/subsys/suit/storage/include/suit_storage_report_internal.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief SUIT processing reports storage + * + * @details This module implements a SUIT storage submodule, allowing to save and read binary + * data, that represent SUIT processing report. + * This module does not interpret or validate the report data format. + * The main purpose is to detect if the report is present, and return the raw binary + * if found. + * The boot report presence can be interpreted as the recovery flag, thus it is allowed to + * store empty reports. In such case - report read will succeed and can be interpreted as + * indication of set recovery flag. + * There is no need to configure this area as part of the device setup procedure. + * The location of the report binaries inside the NVM memory is provided by the main SUIT + * storage module and passed to this module as part of the initialization procedure. + */ + +#ifndef SUIT_STORAGE_REPORT_INTERNAL_H__ +#define SUIT_STORAGE_REPORT_INTERNAL_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize the SUIT storage module managing processing reports. + * + * @retval SUIT_PLAT_SUCCESS if successfully initialized. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + */ +suit_plat_err_t suit_storage_report_internal_init(void); + +/** + * @brief Erase the report area. + * + * @param[in] area_addr Address of erase-block aligned memory containing report binary. + * @param[in] area_size Size of erase-block aligned memory, containing report binary. + * + * @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_report_internal_clear(uint8_t *area_addr, size_t area_size); + +/** + * @brief Save the binary data representing the processing report. + * + * @param[in] area_addr Address of erase-block aligned memory containing report binary. + * @param[in] area_size Size of erase-block aligned memory, containing report binary. + * @param[in] buf Binary data representing report to save. + * @param[in] len Length of the binary data. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully saved. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_SIZE if binary data is too long. + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS if the index value is too big. + * @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_report_internal_save(uint8_t *area_addr, size_t area_size, + const uint8_t *buf, size_t len); + +/** + * @brief Read the binary data representing the processing report. + * + * @param[in] area_addr Address of erase-block aligned memory containing report binary. + * @param[in] area_size Size of erase-block aligned memory, containing report binary. + * @param[in] index Index of the report slot. + * @param[out] buf Pointer to the binary data representing the report. + * @param[out] len Length of the report. + * + * @retval SUIT_PLAT_SUCCESS if the value was successfully read. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is invalid (i.e. NULL). + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS if the index value is too big. + * @retval SUIT_PLAT_ERR_NOT_FOUND if update report is not found. + */ +suit_plat_err_t suit_storage_report_internal_read(const uint8_t *area_addr, size_t area_size, + const uint8_t **buf, size_t *len); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_STORAGE_REPORT_INTERNAL_H__ */ diff --git a/subsys/suit/storage/src/suit_storage_encode.c b/subsys/suit/storage/src/suit_storage_encode.c new file mode 100644 index 000000000000..9d1bae8f77fe --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_encode.c @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#define SUIT_STORAGE_ENVELOPE_VERSION 1 +#define SUIT_STORAGE_ENVELOPE_TAG_VERSION 0 +#define SUIT_STORAGE_ENVELOPE_TAG_CLASS_ID_OFFSET 1 +#define SUIT_STORAGE_ENVELOPE_TAG_ENVELOPE_BSTR 2 + +LOG_MODULE_REGISTER(suit_storage_env, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t encode_bstr_header(size_t bstr_len, uint8_t *buf, size_t *len) +{ + size_t bytes_used = 0; + + if ((buf == NULL) || (len == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((bstr_len > 0x0000FFFF) || (*len < 3)) { + return SUIT_PLAT_ERR_INVAL; + } + + /* Encode bstr header */ + if (bstr_len < 24) { + buf[bytes_used++] = 0x40 + bstr_len; + } else if (bstr_len < 0x100) { + buf[bytes_used++] = 0x58; + buf[bytes_used++] = bstr_len; + } else { + buf[bytes_used++] = 0x59; + buf[bytes_used++] = bstr_len / 0x100; + buf[bytes_used++] = bstr_len % 0x100; + } + + *len = bytes_used; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_bstr_kv_header_len(uint32_t key, size_t bstr_len, size_t *p_len) +{ + if ((p_len == NULL) || (key > 0x0000FFFF) || (bstr_len > 0x0000FFFF)) { + return SUIT_PLAT_ERR_INVAL; + } + + *p_len = 0; + + /* Find key length */ + if (key < 24) { + *p_len += 1; + } else if (key < 0x100) { + *p_len += 2; + } else { + *p_len += 3; + } + + /* Find bstr header length */ + if (bstr_len < 24) { + *p_len += 1; + } else if (bstr_len < 0x100) { + *p_len += 2; + } else { + *p_len += 3; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_encode_bstr_kv_header(uint32_t key, size_t bstr_len, uint8_t *buf, + size_t *len) +{ + size_t bytes_used = 0; + + if ((buf == NULL) || (len == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((key > 0x0000FFFF) || (bstr_len > 0x0000FFFF) || (*len < 6)) { + return SUIT_PLAT_ERR_INVAL; + } + + /* Encode key */ + if (key < 24) { + buf[bytes_used++] = key; + } else if (key < 0x100) { + buf[bytes_used++] = 0x18; + buf[bytes_used++] = key; + } else { + buf[bytes_used++] = 0x19; + buf[bytes_used++] = key / 0x100; + buf[bytes_used++] = key % 0x100; + } + + /* Encode bstr header */ + size_t bstr_hdr_len = *len - bytes_used; + suit_plat_err_t err = encode_bstr_header(bstr_len, &buf[bytes_used], &bstr_hdr_len); + + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + bytes_used += bstr_hdr_len; + *len = bytes_used; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_decode_envelope_header(const uint8_t *buf, size_t len, + suit_envelope_hdr_t *envelope) +{ + bool ok = false; + zcbor_state_t states[3]; + struct zcbor_string envelope_bstr; + uint32_t class_id_offset; + + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), buf, len, 1, NULL, 0); + + ok = (zcbor_map_start_decode(states) && + zcbor_uint32_expect(states, SUIT_STORAGE_ENVELOPE_TAG_VERSION) && + zcbor_uint32_expect(states, SUIT_STORAGE_ENVELOPE_VERSION) && + zcbor_uint32_expect(states, SUIT_STORAGE_ENVELOPE_TAG_CLASS_ID_OFFSET) && + zcbor_uint32_decode(states, &class_id_offset) && + zcbor_uint32_expect(states, SUIT_STORAGE_ENVELOPE_TAG_ENVELOPE_BSTR) && + zcbor_bstr_decode(states, &envelope_bstr) && zcbor_list_map_end_force_decode(states)); + + if (!ok) { + int err = zcbor_pop_error(states); + + /* Use this error code if additional logging is needed: + * LOG_INF("Decoding of envelope header failed:, ZCBOR error %d", err); + * This isn't done normally as it would print lots of logs as this + * function is called in a loop and most envelope slots are invalid. + */ + (void)err; + + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + /* Validate the class ID offset value */ + if ((class_id_offset < 1) || (envelope_bstr.len < class_id_offset)) { + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + /* Extract pointers to the SUIT envelope */ + envelope->envelope.mem = envelope_bstr.value; + envelope->envelope.size = envelope_bstr.len; + envelope->class_id_offset = class_id_offset; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_encode_envelope_header(suit_envelope_hdr_t *envelope, uint8_t *buf, + size_t *len) +{ + const uint8_t envelope_tag[SUIT_STORAGE_ENCODED_ENVELOPE_TAG_LEN] = { + 0xD8, 0x6B, /* SUIT envelope tag (107) */ + 0xA2, /* map with 2 elements */ + }; + bool ok = false; + zcbor_state_t states[3]; + + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), buf, *len, 1, NULL, 0); + + ok = (zcbor_map_start_encode(states, 3) && + zcbor_uint32_put(states, SUIT_STORAGE_ENVELOPE_TAG_VERSION) && + zcbor_uint32_put(states, SUIT_STORAGE_ENVELOPE_VERSION) && + zcbor_uint32_put(states, SUIT_STORAGE_ENVELOPE_TAG_CLASS_ID_OFFSET) && + zcbor_uint32_put(states, envelope->class_id_offset) && + zcbor_uint32_put(states, SUIT_STORAGE_ENVELOPE_TAG_ENVELOPE_BSTR)); + + if (ok) { + /* Get the number of bytes filled inside the output buffer. */ + size_t mem_used = (size_t)states[0].payload - (size_t)buf; + size_t bstr_hdr_len = (*len - (mem_used + sizeof(envelope_tag))); + + if ((*len < (mem_used + 3 + sizeof(envelope_tag))) || + (envelope->envelope.size > 0x0000FFFF)) { + LOG_ERR("Unable to fit SUIT envelope header using %d bytes. Needs %d bytes", + *len, mem_used + 3 + sizeof(envelope_tag)); + return SUIT_PLAT_ERR_NOMEM; + } + + /* Encode bstr header and length */ + suit_plat_err_t err = + encode_bstr_header(envelope->envelope.size, &buf[mem_used], &bstr_hdr_len); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Encoding of envelope bstr header failed: %d", err); + return err; + } + mem_used += bstr_hdr_len; + + /* Encode SUIT envelope tag and map header. */ + memcpy(&buf[mem_used], envelope_tag, sizeof(envelope_tag)); + mem_used += sizeof(envelope_tag); + + *len = mem_used; + } + + if (!ok) { + int err = zcbor_pop_error(states); + + LOG_ERR("Encoding of envelope header failed, ZCBOR error %d", err); + + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_decode_suit_envelope_severed(const uint8_t *buf, size_t len, + struct SUIT_Envelope_severed *envelope, + size_t *envelope_len) +{ + bool ok = false; + zcbor_state_t states[3]; + + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), buf, len, 1, NULL, 0); + + if (zcbor_tag_expect(states, 107) && zcbor_map_start_decode(states) == true) { + /* Parse authentication wrapper and manifest. */ + ok = (zcbor_uint32_expect(states, SUIT_AUTHENTICATION_WRAPPER_TAG) && + zcbor_bstr_decode(states, &(envelope->suit_authentication_wrapper)) && + zcbor_uint32_expect(states, SUIT_MANIFEST_TAG) && + zcbor_bstr_decode(states, &(envelope->suit_manifest))); + + /* Ignore remaining items, consume backups and finish decoding.*/ + if (zcbor_list_map_end_force_decode(states) == false) { + ok = false; + }; + } + + if (ok && (envelope_len != NULL)) { + *envelope_len = MIN(len, (size_t)states[0].payload - (size_t)buf); + } + + /* Decode the manifest class id value */ + envelope->suit_manifest_component_id.value = NULL; + envelope->suit_manifest_component_id.len = 0; + + if (ok) { + zcbor_new_state(states, sizeof(states) / sizeof(zcbor_state_t), + envelope->suit_manifest.value, envelope->suit_manifest.len, 1, NULL, + 0); + ok = zcbor_map_start_decode(states); + + while (ok) { + uint32_t manifest_map_tag; + + ok = zcbor_uint32_decode(states, &manifest_map_tag); + if (!ok) { + break; + } + + if (manifest_map_tag == SUIT_MANIFEST_COMPONENT_ID_TAG) { + const uint8_t *component_id_start = states[0].payload; + + ok = zcbor_any_skip(states, NULL); + + const uint8_t *component_id_end = states[0].payload; + + if (ok) { + envelope->suit_manifest_component_id.value = + component_id_start; + envelope->suit_manifest_component_id.len = + component_id_end - component_id_start; + break; + } + } else { + ok = zcbor_any_skip(states, NULL); + } + } + + if (zcbor_list_map_end_force_decode(states) == false) { + ok = false; + }; + } + + if (!ok) { + int err = zcbor_pop_error(states); + + LOG_ERR("Decoding of envelope severed elements failed:, ZCBOR error %d", err); + + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/storage/src/suit_storage_envelope.c b/subsys/suit/storage/src/suit_storage_envelope.c new file mode 100644 index 000000000000..d35e87a06ba9 --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_envelope.c @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_storage_envelope, CONFIG_SUIT_LOG_LEVEL); + +/** @brief Save the next part of the envelope. + * + * @details Since the SUIT envelope must be modified, to remove parts like integrated payloads, + * the save functionality cannot be done in a single transaction. + * This function allows to pass unaligned buffers and trigger only aligned transactions + * on the flash driver. + * + * @param[in] area_addr Address of erase-block aligned memory containing envelope. + * @param[in] area_size Size of erase-block aligned memory, containing envelope. + * @param[in] addr Address of a buffer (part of SUIT envelope) to append. + * @param[in] size Size of a buffer (part of SUIT envelope) to append. + * @param[in] reset Erase envelope storage before writing. + * @param[in] flush Write all remaining, unaligned data into the envelope storage. + * + * @retval SUIT_PLAT_SUCCESS if the next part of envelope successfully saved. + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + * @retval SUIT_PLAT_ERR_INVAL if the area is too small to save the provided data. + * @retval SUIT_PLAT_ERR_INCORRECT_STATE if the destination envelope address was changed without + * reset. + */ +static suit_plat_err_t save_envelope_partial(uint8_t *area_addr, size_t area_size, const void *addr, + size_t size, bool reset, bool flush) +{ + int err = 0; + static uint8_t write_buf[SUIT_STORAGE_WRITE_SIZE]; + static uint8_t buf_fill_level; + static size_t offset; + static uint8_t *current_area_addr; + static size_t envelope_offset = -1; + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + fdev = NULL; + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + if (size >= (area_size - offset)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (reset) { + buf_fill_level = 0; + offset = 0; + current_area_addr = area_addr; + envelope_offset = suit_plat_mem_nvm_offset_get(area_addr); + + err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(area_addr), area_size); + } + + /* Require to set reset flag before changing envelope index. */ + if ((current_area_addr == NULL) || (area_addr != current_area_addr)) { + LOG_ERR("It is required to set reset flag to change the write address."); + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + LOG_DBG("Writing %d bytes (cache fill: %d)", size, buf_fill_level); + + /* Fill the write buffer to flush non-aligned bytes from the previous call. */ + if ((err == 0) && buf_fill_level) { + size_t len = sizeof(write_buf) - buf_fill_level; + + len = MIN(len, size); + memcpy(&write_buf[buf_fill_level], addr, len); + + buf_fill_level += len; + addr = ((uint8_t *)addr) + len; + size -= len; + + /* If write buffer is full - write it into the memory. */ + if (buf_fill_level == sizeof(write_buf)) { + LOG_DBG("Write continuous %d cache bytes (address: %p)", sizeof(write_buf), + (void *)(envelope_offset + offset)); + err = flash_write(fdev, envelope_offset + offset, write_buf, + sizeof(write_buf)); + + buf_fill_level = 0; + offset += sizeof(write_buf); + } + } + + /* Write aligned data directly from input buffer. */ + if ((err == 0) && (size >= sizeof(write_buf))) { + size_t write_size = ((size / sizeof(write_buf)) * sizeof(write_buf)); + + LOG_DBG("Write continuous %d image bytes (address: %p)", write_size, + (void *)(envelope_offset + offset)); + err = flash_write(fdev, envelope_offset + offset, addr, write_size); + + size -= write_size; + offset += write_size; + addr = ((uint8_t *)addr + write_size); + } + + /* Store remaining bytes into the write buffer. */ + if ((err == 0) && (size > 0)) { + LOG_DBG("Cache %d bytes (address: %p)", size, (void *)(envelope_offset + offset)); + + memcpy(&write_buf[buf_fill_level], addr, size); + buf_fill_level += size; + } + + /* Flush buffer if requested. */ + if ((err == 0) && (flush) && (buf_fill_level > 0) && (sizeof(write_buf) > 1)) { + /* Do not leak information about the previous requests. */ + memset(&write_buf[buf_fill_level], 0xFF, sizeof(write_buf) - buf_fill_level); + + LOG_DBG("Flush %d bytes (address: %p)", sizeof(write_buf), + (void *)(envelope_offset + offset)); + err = flash_write(fdev, envelope_offset + offset, write_buf, sizeof(write_buf)); + + buf_fill_level = 0; + offset += sizeof(write_buf); + } + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} + +/** @brief Append the next CBOR map element with payload encoded as byte string. + * + * @param[in] area_addr Address of erase-block aligned memory containing envelope. + * @param[in] area_size Size of erase-block aligned memory, containing envelope. + * @param[in] key The CBOR map key value. + * @param[in] bstr The byte string to append. + * @param[in] flush Write all remaining, unaligned data into the envelope storage. + * + * @retval SUIT_PLAT_SUCCESS if the CBOR map element successfully encoded. + * @retval SUIT_PLAT_ERR_INVAL if invalid input argument was provided + * (i.e. NULL, buffer length). + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + * @retval SUIT_PLAT_ERR_INCORRECT_STATE if the destination envelope address was changed without + * reset. + */ +static suit_plat_err_t save_envelope_partial_bstr(uint8_t *area_addr, size_t area_size, + uint16_t key, struct zcbor_string *bstr, + bool flush) +{ + uint8_t kv_hdr_buf[SUIT_STORAGE_ENCODED_BSTR_HDR_LEN_MAX]; + size_t hdr_len = sizeof(kv_hdr_buf); + + suit_plat_err_t err = + suit_storage_encode_bstr_kv_header(key, bstr->len, kv_hdr_buf, &hdr_len); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + err = save_envelope_partial(area_addr, area_size, kv_hdr_buf, hdr_len, false, false); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + return save_envelope_partial(area_addr, area_size, bstr->value, bstr->len, false, flush); +} + +suit_plat_err_t suit_storage_envelope_get(const uint8_t *area_addr, size_t area_size, + const suit_manifest_class_id_t *id, const uint8_t **addr, + size_t *size) +{ + struct SUIT_Envelope_severed envelope; + suit_envelope_hdr_t envelope_hdr; + + suit_plat_err_t err = + suit_storage_decode_envelope_header(area_addr, area_size, &envelope_hdr); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + *addr = (void *)(envelope_hdr.envelope.mem); + + /* Validate stored data by parsing buffer as SUIT envelope. + * Set the size variable value to the decoded envelope size, + * that does not contain severable elements. + */ + err = suit_storage_decode_suit_envelope_severed( + envelope_hdr.envelope.mem, envelope_hdr.envelope.size, &envelope, size); + + return err; +} + +suit_plat_err_t suit_storage_envelope_install(uint8_t *area_addr, size_t area_size, + const suit_manifest_class_id_t *id, + const uint8_t *addr, size_t size) +{ + uint8_t envelope_hdr_buf[SUIT_STORAGE_ENCODED_ENVELOPE_HDR_LEN_MAX]; + size_t envelope_hdr_buf_len = sizeof(envelope_hdr_buf); + suit_envelope_hdr_t envelope_hdr; + suit_manifest_class_id_t *class_id; + struct SUIT_Envelope_severed envelope; + suit_plat_err_t err; + + if ((addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + /* Validate input data by parsing buffer as SUIT envelope. + * Additionally change the size variable value from envelope size to + * the decoded envelope size, that does not contain severable elements. + */ + err = suit_storage_decode_suit_envelope_severed(addr, size, &envelope, &size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to install envelope: decode failed (%d)", err); + return err; + } + + if (suit_plat_decode_manifest_class_id(&envelope.suit_manifest_component_id, &class_id) != + SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to install envelope: class ID not decoded"); + return SUIT_PLAT_ERR_INVAL; + } + + if (SUIT_PLAT_SUCCESS != suit_metadata_uuid_compare(id, class_id)) { + LOG_ERR("Unable to install envelope: class ID does not match"); + return SUIT_PLAT_ERR_INVAL; + } + + size_t class_id_offset = (size_t)class_id - (size_t)envelope.suit_manifest.value + + envelope.suit_authentication_wrapper.len; + /* Move offset and size by: + * - SUIT envelope tag + * - Authentication wrapper bstr header + * - Manifest bstr header + */ + size_t encoding_overhead = SUIT_STORAGE_ENCODED_ENVELOPE_TAG_LEN; + size_t header_len = 0; + + err = suit_storage_bstr_kv_header_len(SUIT_AUTHENTICATION_WRAPPER_TAG, + envelope.suit_authentication_wrapper.len, + &header_len); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + encoding_overhead += header_len; + + err = suit_storage_bstr_kv_header_len(SUIT_MANIFEST_TAG, envelope.suit_manifest.len, + &header_len); + + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + encoding_overhead += header_len; + + envelope_hdr.class_id_offset = encoding_overhead + class_id_offset; + envelope_hdr.envelope.mem = addr; + envelope_hdr.envelope.size = encoding_overhead + envelope.suit_manifest.len + + envelope.suit_authentication_wrapper.len; + + if (envelope_hdr_buf_len + envelope_hdr.envelope.size > area_size) { + LOG_ERR("Unable to install envelope: envelope too big (%d)", + envelope_hdr.envelope.size); + return SUIT_PLAT_ERR_INVAL; + } + + err = suit_storage_encode_envelope_header(&envelope_hdr, envelope_hdr_buf, + &envelope_hdr_buf_len); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to encode envelope header (%d)", err); + return err; + } + + err = save_envelope_partial(area_addr, area_size, envelope_hdr_buf, envelope_hdr_buf_len, + true, false); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to save envelope header (%d)", err); + return err; + } + + err = save_envelope_partial_bstr(area_addr, area_size, SUIT_AUTHENTICATION_WRAPPER_TAG, + &envelope.suit_authentication_wrapper, false); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to save authentication wrapper (%d)", err); + return err; + } + + err = save_envelope_partial_bstr(area_addr, area_size, SUIT_MANIFEST_TAG, + &envelope.suit_manifest, true); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to save manifest (%d)", err); + return err; + } + + LOG_INF("Envelope saved."); + + return err; +} diff --git a/subsys/suit/storage/src/suit_storage_mpi.c b/subsys/suit/storage/src/suit_storage_mpi.c new file mode 100644 index 000000000000..4753b66c990b --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_mpi.c @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_storage_mpi, CONFIG_SUIT_LOG_LEVEL); + +typedef struct { + suit_manifest_role_t role; + const uint8_t *addr; + size_t size; +} suit_storage_mpi_entry_t; + +static suit_storage_mpi_entry_t entries[CONFIG_SUIT_STORAGE_N_ENVELOPES]; +static size_t entries_len; + +/** @brief Detect if UUID contains only zeros or ones. + * + * @retval SUIT_PLAT_ERR_OUT_OF_BOUNDS if the UUID contains only zeros or ones. + * @retval SUIT_PLAT_SUCCESS if the UUID contains at least two different bits. + */ +static suit_plat_err_t uuid_validate(const uint8_t *uuid) +{ + bool zeros = true; + bool ones = true; + + for (size_t i = 0; i < sizeof(suit_uuid_t); i++) { + if (uuid[i] != 0xFF) { + ones = false; + } + + if (uuid[i] != 0x00) { + zeros = false; + } + } + + if (zeros || ones) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_mpi_init(void) +{ + memset(entries, 0, sizeof(entries)); + entries_len = 0; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_mpi_configuration_load(suit_manifest_role_t role, const uint8_t *addr, + size_t size) +{ + const suit_manifest_class_id_t *new_class_id = NULL; + suit_storage_mpi_t *mpi = (suit_storage_mpi_t *)addr; + + if ((role == SUIT_MANIFEST_UNKNOWN) || (addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (mpi->version != SUIT_MPI_INFO_VERSION) { + /* Detect if the area is erased. */ + for (size_t i = 0; i < size; i++) { + if (addr[i] != 0xFF) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + } + + /* Use the dedicated error code - in some cases, the caller may decide to continue + * loading the MPI structures. + */ + return SUIT_PLAT_ERR_NOT_FOUND; + } + + new_class_id = (const suit_manifest_class_id_t *)mpi->class_id; + + for (size_t i = 0; i < entries_len; i++) { + const suit_storage_mpi_t *ex_mpi = (suit_storage_mpi_t *)entries[i].addr; + const suit_manifest_class_id_t *ex_class_id = + (const suit_manifest_class_id_t *)ex_mpi->class_id; + + if (entries[i].role == role) { + LOG_ERR("Manifest with role 0x%x already configured at index %d", role, i); + return SUIT_PLAT_ERR_EXISTS; + } + + if (suit_metadata_uuid_compare(new_class_id, ex_class_id) == SUIT_PLAT_SUCCESS) { + LOG_ERR("Manifest with given class ID already configured with different " + "role at index %d", + i); + return SUIT_PLAT_ERR_EXISTS; + } + } + + if (ARRAY_SIZE(entries) <= entries_len) { + LOG_ERR("Too small Manifest Provisioning Information array."); + return SUIT_PLAT_ERR_SIZE; + } + + /* Validate downgrade prevention policy value. */ + switch (mpi->downgrade_prevention_policy) { + case SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED: + case SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED: + break; + default: + LOG_ERR("Invalid downgrade prevention policy value for role 0x%x: %d", role, + mpi->downgrade_prevention_policy); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + /* Validate independent updateability policy value. */ + switch (mpi->independent_updateability_policy) { + case SUIT_MPI_INDEPENDENT_UPDATE_DENIED: + if ((role == SUIT_MANIFEST_APP_ROOT) || (role == SUIT_MANIFEST_APP_RECOVERY)) { + LOG_ERR("It is incorrect to block independent updates for role %d", role); + return SUIT_PLAT_ERR_UNSUPPORTED; + } + break; + case SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED: + break; + default: + LOG_ERR("Invalid independent updateability policy value for role 0x%x: %d", role, + mpi->independent_updateability_policy); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + /* Validate signature verification policy value. */ + switch (mpi->signature_verification_policy) { + case SUIT_MPI_SIGNATURE_CHECK_DISABLED: + case SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE: + case SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT: + break; + default: + LOG_ERR("Invalid signature verification policy value for role 0x%x: %d", role, + mpi->signature_verification_policy); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + /* Validate reserved field value. */ + for (size_t i = 0; i < ARRAY_SIZE(mpi->reserved); i++) { + if (mpi->reserved[i] != 0xFF) { + LOG_ERR("Invalid value inside reserved field at index %d for role 0x%x " + "(0x%x)", + i, role, mpi->reserved[i]); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + } + + /* Validate vendor ID value. */ + if (uuid_validate(mpi->vendor_id) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Invalid vendor UUID configured for role 0x%x", role); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + /* Validate class ID value. */ + if (uuid_validate(mpi->class_id) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Invalid class UUID configured for role 0x%x", role); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + LOG_INF("Add manifest with role 0x%x and class ID at index %d:", role, entries_len); + LOG_INF("\t%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + new_class_id->raw[0], new_class_id->raw[1], new_class_id->raw[2], + new_class_id->raw[3], new_class_id->raw[4], new_class_id->raw[5], + new_class_id->raw[6], new_class_id->raw[7], new_class_id->raw[8], + new_class_id->raw[9], new_class_id->raw[10], new_class_id->raw[11], + new_class_id->raw[12], new_class_id->raw[13], new_class_id->raw[14], + new_class_id->raw[15]); + + entries[entries_len].role = role; + entries[entries_len].addr = addr; + entries[entries_len].size = size; + entries_len++; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_mpi_role_get(const suit_manifest_class_id_t *class_id, + suit_manifest_role_t *role) +{ + if ((class_id == NULL) || (role == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + for (size_t i = 0; i < entries_len; i++) { + if (entries[i].role != SUIT_MANIFEST_UNKNOWN) { + suit_storage_mpi_t *mpi = (suit_storage_mpi_t *)entries[i].addr; + + if (suit_metadata_uuid_compare( + (const suit_manifest_class_id_t *)mpi->class_id, class_id) == + SUIT_PLAT_SUCCESS) { + *role = entries[i].role; + return SUIT_PLAT_SUCCESS; + } + } + } + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +suit_plat_err_t suit_storage_mpi_class_get(suit_manifest_role_t role, + const suit_manifest_class_id_t **class_id) +{ + if ((role == SUIT_MANIFEST_UNKNOWN) || (class_id == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + for (size_t i = 0; i < entries_len; i++) { + if (entries[i].role == role) { + suit_storage_mpi_t *mpi = (suit_storage_mpi_t *)entries[i].addr; + + *class_id = (const suit_manifest_class_id_t *)mpi->class_id; + + return SUIT_PLAT_SUCCESS; + } + } + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +suit_plat_err_t suit_storage_mpi_get(const suit_manifest_class_id_t *class_id, + suit_storage_mpi_t **mpi) +{ + if ((class_id == NULL) || (mpi == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + for (size_t i = 0; i < entries_len; i++) { + if (entries[i].role != SUIT_MANIFEST_UNKNOWN) { + *mpi = (suit_storage_mpi_t *)entries[i].addr; + + if (suit_metadata_uuid_compare( + (const suit_manifest_class_id_t *)(*mpi)->class_id, class_id) == + SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_SUCCESS; + } + } + } + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +suit_plat_err_t suit_storage_mpi_class_ids_get(suit_manifest_class_info_t *class_info, size_t *size) +{ + if ((class_info == NULL) || (size == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (*size < entries_len) { + return SUIT_PLAT_ERR_SIZE; + } + + for (size_t i = 0; i < entries_len; i++) { + suit_storage_mpi_t *mpi = (suit_storage_mpi_t *)entries[i].addr; + + class_info[i].vendor_id = (const suit_manifest_class_id_t *)mpi->vendor_id; + class_info[i].class_id = (const suit_manifest_class_id_t *)mpi->class_id; + class_info[i].role = entries[i].role; + } + + *size = entries_len; + + return SUIT_PLAT_SUCCESS; +} + +suit_downgrade_prevention_policy_t suit_mpi_downgrade_prevention_policy_to_metadata(int mpi_policy) +{ + switch (mpi_policy) { + case SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED: + return SUIT_DOWNGRADE_PREVENTION_DISABLED; + case SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED: + return SUIT_DOWNGRADE_PREVENTION_ENABLED; + default: + return SUIT_DOWNGRADE_PREVENTION_UNKNOWN; + } +} + +suit_independent_updateability_policy_t +suit_mpi_independent_updateability_policy_to_metadata(int mpi_policy) +{ + switch (mpi_policy) { + case SUIT_MPI_INDEPENDENT_UPDATE_DENIED: + return SUIT_INDEPENDENT_UPDATE_DENIED; + case SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED: + return SUIT_INDEPENDENT_UPDATE_ALLOWED; + default: + return SUIT_INDEPENDENT_UPDATE_UNKNOWN; + } +} + +suit_signature_verification_policy_t +suit_mpi_signature_verification_policy_to_metadata(int mpi_policy) +{ + switch (mpi_policy) { + case SUIT_MPI_SIGNATURE_CHECK_DISABLED: + return SUIT_SIGNATURE_CHECK_DISABLED; + case SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE: + return SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE; + case SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT: + return SUIT_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT; + default: + return SUIT_SIGNATURE_CHECK_UNKNOWN; + } +} diff --git a/subsys/suit/storage/src/suit_storage_nrf54h20.c b/subsys/suit/storage/src/suit_storage_nrf54h20.c new file mode 100644 index 000000000000..0f5ab9163c4e --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_nrf54h20.c @@ -0,0 +1,1036 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_storage, CONFIG_SUIT_LOG_LEVEL); + +#define SUIT_STORAGE_NORDIC_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_NORDIC_OFFSET) +#define SUIT_STORAGE_NORDIC_OFFSET FIXED_PARTITION_OFFSET(cpusec_suit_storage) +#define SUIT_STORAGE_NORDIC_SIZE FIXED_PARTITION_SIZE(cpusec_suit_storage) +#define SUIT_STORAGE_RAD_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_RAD_OFFSET) +#define SUIT_STORAGE_RAD_OFFSET FIXED_PARTITION_OFFSET(cpurad_suit_storage) +#define SUIT_STORAGE_RAD_SIZE FIXED_PARTITION_SIZE(cpurad_suit_storage) +#define SUIT_STORAGE_APP_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_APP_OFFSET) +#define SUIT_STORAGE_APP_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_APP_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) + +typedef uint8_t suit_storage_digest_t[32]; + +struct suit_storage_nvv { + /* Manifest Runtime Non Volatile Variables. */ + uint8_t var[EB_SIZE(suit_storage_nvv_t)]; + /* Manifest Runtime Non Volatile Variables digest. */ + uint8_t digest[EB_SIZE(suit_storage_digest_t)]; +}; + +struct suit_storage_mpi_rad { + /* Radio recovery manifest MPI. */ + uint8_t recovery[EB_SIZE(suit_storage_mpi_t)]; + /* Radio local A manifest MPI. */ + uint8_t local_a[EB_SIZE(suit_storage_mpi_t)]; + /* Radio local B manifest MPI. */ + uint8_t local_b[EB_SIZE(suit_storage_mpi_t)]; + /* Radio MPI digest. */ + uint8_t digest[EB_SIZE(suit_storage_digest_t)]; +}; + +struct suit_storage_mpi_app { + /* Application root manifest MPI. */ + uint8_t root[EB_SIZE(suit_storage_mpi_t)]; + /* Application recovery manifest MPI. */ + uint8_t recovery[EB_SIZE(suit_storage_mpi_t)]; + /* Application local A manifest MPI. */ + uint8_t local_a[EB_SIZE(suit_storage_mpi_t)]; + /* Application local B manifest MPI. */ + uint8_t local_b[EB_SIZE(suit_storage_mpi_t)]; + /* Application local spare manifest MPI. */ + uint8_t local_spare[EB_SIZE(suit_storage_mpi_t)]; + /* Application MPI digest. */ + uint8_t digest[EB_SIZE(suit_storage_digest_t)]; +}; + +/* SUIT storage structure, that can be used to parse the NVM contents. */ +struct suit_storage_nordic { + /* Area accessible by the SECURE core debugger. */ + union { + struct suit_storage_area_nordic { + /* Radio MPI Backup and digest. */ + struct suit_storage_mpi_rad rad_mpi_bak; + /* Application MPI Backup and digest. */ + struct suit_storage_mpi_app app_mpi_bak; + + /* The last SUIT update report. */ + uint8_t report_0[160]; + + /* Reserved for Future Use. */ + uint8_t reserved[160]; + + /* Installed envelope: Nordic Top */ + uint8_t top[EB_ALIGN(1280)]; + /* Installed envelope: Secure Domain Firmware (update) */ + uint8_t sdfw[EB_ALIGN(1024)]; + /* Installed envelope: System Controller Firmware */ + uint8_t scfw[EB_ALIGN(1024)]; + } nordic; + uint8_t nordic_area[ACCESS_SIZE(struct suit_storage_area_nordic)]; + }; +}; + +struct suit_storage_rad { + /* Area accessible by the RADIO core debugger. */ + union { + struct suit_storage_area_rad { + /* Radio manifests provisioning information. */ + struct suit_storage_mpi_rad mpi; + + /* Reserved for Future Use. */ + uint8_t reserved[848]; + + /* Installed envelope: Recovery */ + uint8_t recovery[EB_ALIGN(1024)]; + /* Installed envelope: Local A */ + uint8_t local_a[EB_ALIGN(1024)]; + /* Installed envelope: Local B */ + uint8_t local_b[EB_ALIGN(1024)]; + } rad; + uint8_t rad_area[ACCESS_SIZE(struct suit_storage_area_rad)]; + }; +}; + +struct suit_storage_app { + /* Area accessible by the APP core debugger. */ + union { + struct suit_storage_area_app { + /* Application manifests provisioning information. */ + struct suit_storage_mpi_app mpi; + + /* Reserved for Future Use. */ + uint8_t reserved[560]; + + /** Update candidate information. */ + uint8_t update_cand[EB_SIZE(struct update_candidate_info)]; + + /* Manifest Runtime Non Volatile Variables Area */ + struct suit_storage_nvv nvv; + struct suit_storage_nvv nvv_bak; + + /* Installed envelope: ROOT */ + uint8_t root[EB_ALIGN(2048)]; + /* Installed envelope: Recovery */ + uint8_t recovery[EB_ALIGN(2048)]; + /* Installed envelope: Local A */ + uint8_t local_a[EB_ALIGN(1024)]; + /* Installed envelope: Local B */ + uint8_t local_b[EB_ALIGN(1024)]; + /* Installed envelope: Local Spare RFU */ + uint8_t local_spare[EB_ALIGN(1024)]; + } app; + uint8_t app_area[ACCESS_SIZE(struct suit_storage_area_app)]; + }; +}; + +static const suit_storage_mpi_t mpi_nordic[] = { + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED, + .signature_verification_policy = + SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_nordic_top') */ + .class_id = {0xf0, 0x3d, 0x38, 0x5e, 0xa7, 0x31, 0x56, 0x05, 0xb1, 0x5d, 0x03, 0x7f, + 0x6d, 0xa6, 0x09, 0x7f}, + }, + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_DENIED, + .signature_verification_policy = + SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sec') */ + .class_id = {0xd9, 0x6b, 0x40, 0xb7, 0x09, 0x2b, 0x5c, 0xd1, 0xa5, 0x9f, 0x9a, 0xf8, + 0x0c, 0x33, 0x7e, 0xba}, + }, + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_ENABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_DENIED, + .signature_verification_policy = + SUIT_MPI_SIGNATURE_CHECK_ENABLED_ON_UPDATE_AND_BOOT, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sys') */ + .class_id = {0xc0, 0x8a, 0x25, 0xd7, 0x35, 0xe6, 0x59, 0x2c, 0xb7, 0xad, 0x43, 0xac, + 0xc8, 0xd1, 0xd1, 0xc8}, + }}; + +static suit_plat_err_t find_manifest_area(suit_manifest_role_t role, const uint8_t **addr, + size_t *size) +{ + 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; + + switch (role) { + case SUIT_MANIFEST_SEC_TOP: + *addr = nordic_storage->nordic.top; + *size = sizeof(nordic_storage->nordic.top); + break; + case SUIT_MANIFEST_SEC_SDFW: + *addr = nordic_storage->nordic.sdfw; + *size = sizeof(nordic_storage->nordic.sdfw); + break; + case SUIT_MANIFEST_SEC_SYSCTRL: + *addr = nordic_storage->nordic.scfw; + *size = sizeof(nordic_storage->nordic.scfw); + break; + case SUIT_MANIFEST_RAD_RECOVERY: + *addr = rad_storage->rad.recovery; + *size = sizeof(rad_storage->rad.recovery); + break; + case SUIT_MANIFEST_RAD_LOCAL_1: + *addr = rad_storage->rad.local_a; + *size = sizeof(rad_storage->rad.local_a); + break; + case SUIT_MANIFEST_RAD_LOCAL_2: + *addr = rad_storage->rad.local_b; + *size = sizeof(rad_storage->rad.local_b); + break; + case SUIT_MANIFEST_APP_ROOT: + *addr = app_storage->app.root; + *size = sizeof(app_storage->app.root); + break; + case SUIT_MANIFEST_APP_RECOVERY: + *addr = app_storage->app.recovery; + *size = sizeof(app_storage->app.recovery); + break; + case SUIT_MANIFEST_APP_LOCAL_1: + *addr = app_storage->app.local_a; + *size = sizeof(app_storage->app.local_a); + break; + case SUIT_MANIFEST_APP_LOCAL_2: + *addr = app_storage->app.local_b; + *size = sizeof(app_storage->app.local_b); + break; + case SUIT_MANIFEST_APP_LOCAL_3: + *addr = app_storage->app.local_spare; + *size = sizeof(app_storage->app.local_spare); + break; + default: + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + return SUIT_PLAT_SUCCESS; +} + +/** @brief Verify digest of the area. + * + * @param[in] addr Address of the area to hash. + * @param[in] size Size of the area to hash. + * @param[in] digest Pointer to the structure with the digest value. + * + * @retval SUIT_PLAT_SUCCESS if the digest was successfully verified. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is not correct (i.e. NULL). + * @retval SUIT_PLAT_ERR_AUTHENTICATION if the digest value does not match with the area contents. + * @retval SUIT_PLAT_ERR_CRASH if failed to calculate digest value. + */ +static suit_plat_err_t sha256_check(const uint8_t *addr, size_t size, + const suit_storage_digest_t *exp_digest) +{ + 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)) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + if (exp_digest_length != sizeof(*exp_digest)) { + LOG_ERR("Invalid digest algorithm"); + return SUIT_PLAT_ERR_INVAL; + } + + psa_status_t status = psa_crypto_init(); + + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to init psa crypto: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_setup(&operation, psa_alg); + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to setup hash algorithm: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_update(&operation, addr, size); + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to calculate hash value: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_verify(&operation, *exp_digest, exp_digest_length); + if (status == PSA_SUCCESS) { + /* Digest calculation successful; expected digest matches calculated one */ + err = SUIT_PLAT_SUCCESS; + } else { + if (status == PSA_ERROR_INVALID_SIGNATURE) { + /* Digest calculation successful but expected digest does not match + * calculated one + */ + err = SUIT_PLAT_ERR_AUTHENTICATION; + } else { + LOG_ERR("psa_hash_verify error: %d", status); + err = SUIT_PLAT_ERR_CRASH; + } + /* In both cases psa_hash_verify enters error state and must be aborted */ + status = psa_hash_abort(&operation); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_hash_abort error %d", status); + if (err == SUIT_PLAT_SUCCESS) { + err = SUIT_PLAT_ERR_CRASH; + } + } + } + + return err; +} + +/** @brief Calculate digest of the area. + * + * @param[in] addr Address of the area to hash. + * @param[in] size Size of the area to hash. + * @param[out] digest Pointer to the output structure to store the digest value. + * + * @retval SUIT_PLAT_SUCCESS if the digest was successfully calculated. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is not correct (i.e. NULL). + * @retval SUIT_PLAT_ERR_CRASH if failed to calculate digest value. + */ +static suit_plat_err_t sha256_get(const uint8_t *addr, size_t size, suit_storage_digest_t *digest) +{ + 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)) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + if (digest_length != sizeof(*digest)) { + LOG_ERR("Invalid digest algorithm"); + return SUIT_PLAT_ERR_INVAL; + } + + psa_status_t status = psa_crypto_init(); + + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to init psa crypto: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_setup(&operation, psa_alg); + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to setup hash algorithm: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_update(&operation, addr, size); + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to calculate hash value: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_finish(&operation, *digest, digest_length, &digest_length); + if (status == PSA_SUCCESS) { + /* Digest calculation successful; expected digest matches calculated one */ + err = SUIT_PLAT_SUCCESS; + } else { + LOG_ERR("psa_hash_finish error: %d", status); + err = SUIT_PLAT_ERR_CRASH; + + /* psa_hash_finish enters error state and must be aborted */ + status = psa_hash_abort(&operation); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_hash_abort error %d", status); + } + } + + return err; +} + +/** @brief Helper function to override destination area with source contents. + * + * @param[in] dst_addr Address of the destination area. + * @param[in] src_addr Address of the source area. + * @param[in] size Size of the area. + * + * @retval SUIT_PLAT_SUCCESS if area is successfully copied. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if the flash controller device is not available. + * @retval SUIT_PLAT_ERR_IO if unable to modify the destination area. + */ +static suit_plat_err_t flash_cpy(uint8_t *dst_addr, uint8_t *src_addr, size_t size) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(dst_addr), size); + + if (err == 0) { + err = flash_write(fdev, suit_plat_mem_nvm_offset_get(dst_addr), src_addr, size); + } + + if (err == 0) { + return SUIT_PLAT_SUCCESS; + } else { + return SUIT_PLAT_ERR_IO; + } +} + +/** @brief Select the digest-protected area with valid sigest. + * + * @param[in,out] area_addr Address of the area. + * @param[in,out] backup_addr Address of the backup. + * @param[in] area_size Size of the area. + * + * @retval NULL if area and backup are invalid. + * @retval area_addr if area is valid. + * @retval backup_addr if area is invalid, but backup is valid. + */ +static uint8_t *digest_struct_find(uint8_t *area_addr, uint8_t *backup_addr, size_t area_size) +{ + const suit_storage_digest_t *area_digest = NULL; + const suit_storage_digest_t *backup_digest = NULL; + suit_plat_err_t area_status = SUIT_PLAT_ERR_CRASH; + suit_plat_err_t backup_status = SUIT_PLAT_ERR_CRASH; + + if ((area_addr == NULL) || (backup_addr == NULL) || (area_size == 0) || + (area_size != EB_ALIGN(area_size))) { + LOG_ERR("Invalid argument"); + return NULL; + } + + area_digest = (suit_storage_digest_t *)&area_addr[area_size]; + area_status = sha256_check(area_addr, area_size, area_digest); + + if (area_status == SUIT_PLAT_SUCCESS) { + return area_addr; + } + + backup_digest = (suit_storage_digest_t *)&backup_addr[area_size]; + backup_status = sha256_check(backup_addr, area_size, backup_digest); + + if (backup_status == SUIT_PLAT_SUCCESS) { + return backup_addr; + } + + return NULL; +} + +/** @brief Validate the integrity of the digest-protected area in NVM. + * + * @details This function calculates and compares digests of the area and the assigned backup. + * It is assumed, that the digest value of type @ref suit_storage_digest_t is stored right + * after the data. + * If the area are valid, the backup is updated. + * If the area is invalid, but a valid backup is found, the backup is copied into the area. + * If backup is invalid, but the area is valid, the area is copied into the backup. + * If both the area and the backup are invalid, this function will fail. + * + * @param[in,out] area_addr Address of the area. + * @param[in,out] backup_addr Address of the backup. + * @param[in] area_size Size of the area. + * + * @retval SUIT_PLAT_SUCCESS if area is successfully verified or fixed. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is not correct (i.e. NULL). + * @retval SUIT_PLAT_ERR_HW_NOT_READY if the flash controller device is not available. + * @retval SUIT_PLAT_ERR_IO if unable to modify the area or the backup using flash + * controller device. + * @retval SUIT_PLAT_ERR_CRASH if failed to calculate digest value. + * @retval SUIT_PLAT_ERR_AUTHENTICATION if both the area and the backup are invalid. + */ +static suit_plat_err_t digest_struct_validate(uint8_t *area_addr, uint8_t *backup_addr, + size_t area_size) +{ + const size_t area_with_digest_size = area_size + EB_SIZE(suit_storage_digest_t); + const suit_storage_digest_t *area_digest = NULL; + const suit_storage_digest_t *backup_digest = NULL; + suit_plat_err_t area_status = SUIT_PLAT_ERR_CRASH; + suit_plat_err_t backup_status = SUIT_PLAT_ERR_CRASH; + + if ((area_addr == NULL) || (backup_addr == NULL) || (area_size == 0) || + (area_size != EB_ALIGN(area_size))) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + area_digest = (suit_storage_digest_t *)&area_addr[area_size]; + backup_digest = (suit_storage_digest_t *)&backup_addr[area_size]; + + area_status = sha256_check(area_addr, area_size, area_digest); + backup_status = sha256_check(backup_addr, area_size, backup_digest); + + if (area_status == SUIT_PLAT_SUCCESS) { + if (backup_status == SUIT_PLAT_SUCCESS) { + if (memcmp(area_digest, backup_digest, sizeof(suit_storage_digest_t)) == + 0) { + return SUIT_PLAT_SUCCESS; + } + } + + /* We have a valid entry and backup digest does not match or differ. */ + LOG_INF("Backup area 0x%lx -> 0x%lx", (uintptr_t)area_addr, (uintptr_t)backup_addr); + + return flash_cpy(backup_addr, area_addr, area_with_digest_size); + } else if (backup_status == SUIT_PLAT_SUCCESS) { + /* Regular entry broken - restore from backup. */ + LOG_INF("Use backup 0x%lx -> 0x%lx", (uintptr_t)backup_addr, (uintptr_t)area_addr); + + return flash_cpy(area_addr, backup_addr, area_with_digest_size); + } + + /* Both regular and backup entries broken - fail. */ + return SUIT_PLAT_ERR_AUTHENTICATION; +} + +/** @brief Update the area digest value and create a new backup of the digest-protected area in NVM. + * + * @param[in,out] area_addr Address of the area. + * @param[in,out] backup_addr Address of the backup. + * @param[in] area_size Size of the area. + * + * @retval SUIT_PLAT_SUCCESS if area is successfully updated. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is not correct (i.e. NULL). + * @retval SUIT_PLAT_ERR_HW_NOT_READY if the flash controller device is not available. + * @retval SUIT_PLAT_ERR_IO if unable to modify the area or the backup using flash + * controller device. + * @retval SUIT_PLAT_ERR_CRASH if both the area and the backup are invalid. + */ +static suit_plat_err_t digest_struct_commit(uint8_t *area_addr, uint8_t *backup_addr, + size_t area_size) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + const suit_storage_digest_t *area_digest = NULL; + suit_storage_digest_t digest; + + if ((area_addr == NULL) || (backup_addr == NULL) || (area_size == 0) || + (area_size != EB_ALIGN(area_size))) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + area_digest = (suit_storage_digest_t *)&area_addr[area_size]; + + if (!device_is_ready(fdev)) { + fdev = NULL; + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + suit_plat_err_t ret = sha256_get(area_addr, area_size, &digest); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + /* Override regular entry. */ + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get((uint8_t *)(*area_digest)), + EB_SIZE(suit_storage_digest_t)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + err = flash_write(fdev, suit_plat_mem_nvm_offset_get((uint8_t *)(*area_digest)), digest, + sizeof(digest)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + /* Verify the new area value and backup if digest is correct. */ + err = digest_struct_validate(area_addr, backup_addr, area_size); + if (err == SUIT_PLAT_ERR_AUTHENTICATION) { + err = SUIT_PLAT_ERR_CRASH; + } + + return err; +} + +/** @brief Initialize NVV area with default values. + * + * @details Ideally, the SUIT storage NVV module should place the default values (0xFF) and this + * function should append the correct digest at the end of it. + * + * @param[out] area_addr Address of the NVV area to initialize. + * @param[out] backup_addr Address of the NVV backup area to initialize. + * + * @retval SUIT_PLAT_SUCCESS if area is successfully initialized. + * @retval SUIT_PLAT_ERR_INVAL if one of the input arguments is not correct (i.e. NULL). + * @retval SUIT_PLAT_ERR_HW_NOT_READY if the flash controller device is not available. + * @retval SUIT_PLAT_ERR_CRASH if failed to calculate digest value. + * @retval SUIT_PLAT_ERR_IO if unable to modify the area using flash controller device. + */ +static suit_plat_err_t nvv_init(uint8_t *area_addr, uint8_t *backup_addr) +{ + size_t area_size = offsetof(struct suit_storage_nvv, digest); + suit_plat_err_t ret = suit_storage_nvv_erase(area_addr, area_size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + /* Update digest and backup. */ + return digest_struct_commit(area_addr, backup_addr, area_size); +} + +static suit_plat_err_t find_mpi_area(suit_manifest_role_t role, uint8_t **addr, size_t *size) +{ + 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; + struct suit_storage_mpi_app *app_mpi = (struct suit_storage_mpi_app *)digest_struct_find( + (uint8_t *)&app_storage->app.mpi, (uint8_t *)&nordic_storage->nordic.app_mpi_bak, + offsetof(struct suit_storage_mpi_app, digest)); + struct suit_storage_mpi_rad *rad_mpi = (struct suit_storage_mpi_rad *)digest_struct_find( + (uint8_t *)&rad_storage->rad.mpi, (uint8_t *)&nordic_storage->nordic.rad_mpi_bak, + offsetof(struct suit_storage_mpi_rad, digest)); + + switch (role) { + case SUIT_MANIFEST_SEC_TOP: + *addr = (uint8_t *)&mpi_nordic[0]; + *size = sizeof(mpi_nordic[0]); + break; + case SUIT_MANIFEST_SEC_SDFW: + *addr = (uint8_t *)&mpi_nordic[1]; + *size = sizeof(mpi_nordic[1]); + break; + case SUIT_MANIFEST_SEC_SYSCTRL: + *addr = (uint8_t *)&mpi_nordic[2]; + *size = sizeof(mpi_nordic[2]); + break; + case SUIT_MANIFEST_RAD_RECOVERY: + if (rad_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = rad_mpi->recovery; + *size = sizeof(rad_mpi->recovery); + break; + case SUIT_MANIFEST_RAD_LOCAL_1: + if (rad_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = rad_mpi->local_a; + *size = sizeof(rad_mpi->local_a); + break; + case SUIT_MANIFEST_RAD_LOCAL_2: + if (rad_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = rad_mpi->local_b; + *size = sizeof(rad_mpi->local_b); + break; + case SUIT_MANIFEST_APP_ROOT: + if (app_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = app_mpi->root; + *size = sizeof(app_mpi->root); + break; + case SUIT_MANIFEST_APP_RECOVERY: + if (app_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = app_mpi->recovery; + *size = sizeof(app_mpi->recovery); + break; + case SUIT_MANIFEST_APP_LOCAL_1: + if (app_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = app_mpi->local_a; + *size = sizeof(app_mpi->local_a); + break; + case SUIT_MANIFEST_APP_LOCAL_2: + if (app_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = app_mpi->local_b; + *size = sizeof(app_mpi->local_b); + break; + case SUIT_MANIFEST_APP_LOCAL_3: + if (app_mpi == NULL) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + *addr = app_mpi->local_spare; + *size = sizeof(app_mpi->local_spare); + break; + default: + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + return SUIT_PLAT_SUCCESS; +} + +/** @brief Iterate through roles and try to initialize MPI areas. + */ +static suit_plat_err_t configure_manifests(suit_manifest_role_t *roles, size_t num_roles, + bool ignore_missing) +{ + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + uint8_t *mpi_addr; + size_t mpi_size; + + for (size_t i = 0; i < num_roles; i++) { + ret = find_mpi_area(roles[i], &mpi_addr, &mpi_size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to locate MPI area for role 0x%x: %d", roles[i], ret); + return ret; + } + + ret = suit_storage_mpi_configuration_load(roles[i], mpi_addr, mpi_size); + if (ret != SUIT_PLAT_SUCCESS) { + if ((ret == SUIT_PLAT_ERR_NOT_FOUND) && (ignore_missing)) { + LOG_INF("Skip MPI area for role 0x%x. Area load failed.", roles[i]); + continue; + } else { + LOG_WRN("Failed to load MPI configuration for role 0x%x: %d", + roles[i], ret); + return ret; + } + } + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t find_report_area(size_t index, uint8_t **addr, size_t *size) +{ + struct suit_storage_nordic *nordic_storage = + (struct suit_storage_nordic *)SUIT_STORAGE_NORDIC_ADDRESS; + + switch (index) { + case 0: + *addr = nordic_storage->nordic.report_0; + *size = ARRAY_SIZE(nordic_storage->nordic.report_0); + break; + default: + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_init(void) +{ + 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; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + suit_manifest_role_t nordic_roles[] = { + SUIT_MANIFEST_SEC_TOP, + SUIT_MANIFEST_SEC_SDFW, + SUIT_MANIFEST_SEC_SYSCTRL, + }; + + if ((sizeof(struct suit_storage_nordic) > SUIT_STORAGE_NORDIC_SIZE) || + (sizeof(struct suit_storage_rad) > SUIT_STORAGE_RAD_SIZE) || + (sizeof(struct suit_storage_app) > SUIT_STORAGE_APP_SIZE)) { + return SUIT_PLAT_ERR_NOMEM; + } + + if ((EB_ALIGN(SUIT_STORAGE_NORDIC_SIZE) != SUIT_STORAGE_NORDIC_SIZE) || + (EB_ALIGN(SUIT_STORAGE_RAD_SIZE) != SUIT_STORAGE_RAD_SIZE) || + (EB_ALIGN(SUIT_STORAGE_APP_SIZE) != SUIT_STORAGE_APP_SIZE)) { + return SUIT_PLAT_ERR_CRASH; + } + + ret = suit_storage_mpi_init(); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize MPI submodule: %d", ret); + return ret; + } + + ret = suit_storage_report_internal_init(); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize report submodule: %d", ret); + return ret; + } + + ret = suit_storage_nvv_init(); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to init NVV: %d", ret); + return ret; + } + + ret = digest_struct_validate((uint8_t *)&app_storage->app.nvv, + (uint8_t *)&app_storage->app.nvv_bak, + offsetof(struct suit_storage_nvv, digest)); + if (ret == SUIT_PLAT_ERR_AUTHENTICATION) { + LOG_WRN("Failed to verify NVV (%d), load default values", ret); + ret = nvv_init((uint8_t *)&app_storage->app.nvv, + (uint8_t *)&app_storage->app.nvv_bak); + } + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize NVV with default values: %d", ret); + return ret; + } + + /* Bootstrap Nordic MPI entries. */ + ret = configure_manifests(nordic_roles, ARRAY_SIZE(nordic_roles), false); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize Nordic MPIs: %d", ret); + return ret; + } + + ret = digest_struct_validate((uint8_t *)&rad_storage->rad.mpi, + (uint8_t *)&nordic_storage->nordic.rad_mpi_bak, + offsetof(struct suit_storage_mpi_rad, digest)); + if (ret == SUIT_PLAT_SUCCESS) { + suit_manifest_role_t roles[] = { + SUIT_MANIFEST_RAD_RECOVERY, + SUIT_MANIFEST_RAD_LOCAL_1, + SUIT_MANIFEST_RAD_LOCAL_2, + }; + + ret = configure_manifests(roles, ARRAY_SIZE(roles), true); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize Radio MPIs: %d", ret); + return ret; + } + } else { + LOG_WRN("Failed to verify radio MPI: %d", ret); + } + + ret = digest_struct_validate((uint8_t *)&app_storage->app.mpi, + (uint8_t *)&nordic_storage->nordic.app_mpi_bak, + offsetof(struct suit_storage_mpi_app, digest)); + if (ret == SUIT_PLAT_SUCCESS) { + suit_manifest_role_t essential_roles[] = { + SUIT_MANIFEST_APP_ROOT, + }; + suit_manifest_role_t optional_roles[] = { + SUIT_MANIFEST_APP_RECOVERY, + SUIT_MANIFEST_APP_LOCAL_1, + SUIT_MANIFEST_APP_LOCAL_2, + SUIT_MANIFEST_APP_LOCAL_3, + }; + + ret = configure_manifests(essential_roles, ARRAY_SIZE(essential_roles), false); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize essential Application MPIs: %d", ret); + return ret; + } + + ret = configure_manifests(optional_roles, ARRAY_SIZE(optional_roles), true); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to initialize non-essential Application MPIs: %d", ret); + return ret; + } + } else { + LOG_ERR("Failed to verify application MPI: %d", ret); + /* Lack of application MPI means lack of ROOT as well as recovery class IDs. + * In such case, the system is unable to boot anything except manifests controlled + * by Nordic. + */ + return ret; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_update_cand_get(const suit_plat_mreg_t **regions, size_t *len) +{ + struct suit_storage_app *app_storage = (struct suit_storage_app *)SUIT_STORAGE_APP_ADDRESS; + uint8_t *addr = app_storage->app.update_cand; + size_t size = sizeof(app_storage->app.update_cand); + + return suit_storage_update_get(addr, size, regions, len); +} + +suit_plat_err_t suit_storage_update_cand_set(suit_plat_mreg_t *regions, size_t len) +{ + struct suit_storage_app *app_storage = (struct suit_storage_app *)SUIT_STORAGE_APP_ADDRESS; + uint8_t *addr = app_storage->app.update_cand; + size_t size = sizeof(app_storage->app.update_cand); + + return suit_storage_update_set(addr, size, regions, len); +} + +suit_plat_err_t suit_storage_installed_envelope_get(const suit_manifest_class_id_t *id, + const uint8_t **addr, size_t *size) +{ + suit_manifest_role_t role; + + if ((id == NULL) || (addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_plat_err_t err = suit_storage_mpi_role_get(id, &role); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find role for given class ID."); + return err; + } + + err = find_manifest_area(role, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for envelope with role 0x%x.", role); + return err; + } + + LOG_DBG("Decode envelope with role: 0x%x address: 0x%lx", role, (intptr_t)(*addr)); + + err = suit_storage_envelope_get(*addr, *size, id, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_WRN("Unable to parse envelope with role 0x%x", role); + return err; + } + + LOG_DBG("Valid envelope with given class ID and role 0x%x found", role); + + return err; +} + +suit_plat_err_t suit_storage_install_envelope(const suit_manifest_class_id_t *id, uint8_t *addr, + size_t size) +{ + suit_plat_err_t err; + suit_manifest_role_t role; + uint8_t *area_addr = NULL; + size_t area_size = 0; + + err = suit_storage_mpi_role_get(id, &role); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find role for given class ID."); + return err; + } + + if ((addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + err = find_manifest_area(role, (const uint8_t **)&area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for envelope with role 0x%x.", role); + return err; + } + + err = suit_storage_envelope_install(area_addr, area_size, id, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Failed to install envelope with role 0x%x.", role); + return err; + } + + LOG_INF("Envelope with role 0x%x saved.", role); + + return err; +} + +suit_plat_err_t suit_storage_var_get(size_t index, uint32_t *value) +{ + struct suit_storage_app *app_storage = (struct suit_storage_app *)SUIT_STORAGE_APP_ADDRESS; + size_t area_size = offsetof(struct suit_storage_nvv, digest); + uint8_t *area_addr = (uint8_t *)digest_struct_find( + (uint8_t *)&app_storage->app.nvv, (uint8_t *)&app_storage->app.nvv_bak, + offsetof(struct suit_storage_nvv, digest)); + + return suit_storage_nvv_get(area_addr, area_size, index, value); +} + +suit_plat_err_t suit_storage_var_set(size_t index, uint32_t value) +{ + struct suit_storage_app *app_storage = (struct suit_storage_app *)SUIT_STORAGE_APP_ADDRESS; + size_t area_size = offsetof(struct suit_storage_nvv, digest); + uint8_t *backup_addr = (uint8_t *)&app_storage->app.nvv_bak; + uint8_t *area_addr = + (uint8_t *)digest_struct_find((uint8_t *)&app_storage->app.nvv, backup_addr, + offsetof(struct suit_storage_nvv, digest)); + + /* It is not allowed to update NVVs if the area has incorrect digest. */ + if (area_addr == backup_addr) { + return SUIT_PLAT_ERR_IO; + } + + suit_plat_err_t err = suit_storage_nvv_set(area_addr, area_size, index, value); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Failed to update NVV at index %d", index); + return err; + } + + /* Update digest and backup. */ + return digest_struct_commit(area_addr, backup_addr, area_size); +} + +suit_plat_err_t suit_storage_report_clear(size_t index) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find report area at index %d.", index); + return err; + } + + return suit_storage_report_internal_clear(area_addr, area_size); +} + +suit_plat_err_t suit_storage_report_save(size_t index, const uint8_t *buf, size_t len) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for report at index %d.", index); + return err; + } + + return suit_storage_report_internal_save(area_addr, area_size, buf, len); +} + +suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size_t *len) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area with report at index %d.", index); + return err; + } + + return suit_storage_report_internal_read(area_addr, area_size, buf, len); +} diff --git a/subsys/suit/storage/src/suit_storage_nvv.c b/subsys/suit/storage/src/suit_storage_nvv.c new file mode 100644 index 000000000000..cf8d64a9d141 --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_nvv.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +LOG_MODULE_REGISTER(suit_storage_nvv, CONFIG_SUIT_LOG_LEVEL); + +typedef struct { + uint8_t *addr; + size_t size; +} suit_storage_nvv_entry_t; + +suit_plat_err_t suit_storage_nvv_init(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_nvv_erase(uint8_t *area_addr, size_t area_size) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + uint8_t nvv_buf[EB_SIZE(suit_storage_nvv_t)]; + + if (area_addr == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (EB_SIZE(suit_storage_nvv_t) > area_size) { + return SUIT_PLAT_ERR_SIZE; + } + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + /* Override regular entry. */ + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(area_addr), area_size); + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + memset(nvv_buf, 0xFF, sizeof(nvv_buf)); + + err = flash_write(fdev, suit_plat_mem_nvm_offset_get(area_addr), nvv_buf, sizeof(nvv_buf)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_nvv_get(const uint8_t *area_addr, size_t area_size, size_t index, + uint32_t *value) +{ + suit_storage_nvv_t *vars = (suit_storage_nvv_t *)area_addr; + + if (area_addr == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (EB_SIZE(suit_storage_nvv_t) > area_size) { + return SUIT_PLAT_ERR_SIZE; + } + + if (value == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (ARRAY_SIZE(*vars) <= index) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + *value = (*vars)[index]; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_nvv_set(uint8_t *area_addr, size_t area_size, size_t index, + uint32_t value) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + uint8_t nvv_buf[EB_SIZE(suit_storage_nvv_t)]; + suit_storage_nvv_t *vars = (suit_storage_nvv_t *)&nvv_buf; + + if (area_addr == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (EB_SIZE(suit_storage_nvv_t) > area_size) { + return SUIT_PLAT_ERR_SIZE; + } + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + if (ARRAY_SIZE(*vars) <= index) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + memcpy(nvv_buf, area_addr, sizeof(nvv_buf)); + (*vars)[index] = value; + + /* Override regular entry. */ + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(area_addr), area_size); + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + err = flash_write(fdev, suit_plat_mem_nvm_offset_get(area_addr), nvv_buf, sizeof(nvv_buf)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/storage/src/suit_storage_report.c b/subsys/suit/storage/src/suit_storage_report.c new file mode 100644 index 000000000000..0ee99b1bda24 --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_report.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_storage_report, CONFIG_SUIT_LOG_LEVEL); + +/* Magic value, indicating that the report area is erased. */ +#define REPORT_SLOT_MAGIC_EMPTY 0xFFFFFFFF +/* Magic value, indicating that an empty report was saved. + * This value may be used as a recovery flag indication. + */ +#define REPORT_SLOT_MAGIC_FLAG 0x2a17644c +/* Magic value, indicating that the report slot contains report data. + * In such case, a pointer to the whole area is returned. + */ +#define REPORT_SLOT_MAGIC_BINARY 0x713cf9c6 + +suit_plat_err_t suit_storage_report_internal_init(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_report_internal_clear(uint8_t *area_addr, size_t area_size) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (area_addr == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + /* Override report entry. */ + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(area_addr), area_size); + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_report_internal_read(const uint8_t *area_addr, size_t area_size, + const uint8_t **buf, size_t *len) +{ + uint32_t *slot_magic = (uint32_t *)area_addr; + + if ((area_addr == NULL) || (buf == NULL) || (len == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (*slot_magic == REPORT_SLOT_MAGIC_FLAG) { + *buf = NULL; + *len = 0; + + return SUIT_PLAT_SUCCESS; + } else if (*slot_magic == REPORT_SLOT_MAGIC_BINARY) { + *buf = (const uint8_t *)&slot_magic[1]; + *len = area_size - sizeof(*slot_magic); + ; + + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +suit_plat_err_t suit_storage_report_internal_save(uint8_t *area_addr, size_t area_size, + const uint8_t *buf, size_t len) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + uint32_t magic = REPORT_SLOT_MAGIC_EMPTY; + uint8_t report_magic_buf[WRITE_ALIGN(sizeof(magic))]; + size_t buffered_size = MIN(len, sizeof(report_magic_buf) - sizeof(magic)); + + if ((area_addr == NULL) || ((buf == NULL) && (len != 0)) || + (len > (area_size - sizeof(magic)))) { + return SUIT_PLAT_ERR_INVAL; + } + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + memset(report_magic_buf, 0xFF, sizeof(report_magic_buf)); + + if (len > 0) { + magic = REPORT_SLOT_MAGIC_BINARY; + if (buffered_size > 0) { + memcpy(&report_magic_buf[sizeof(magic)], buf, buffered_size); + } + } else { + magic = REPORT_SLOT_MAGIC_FLAG; + } + + memcpy(report_magic_buf, &magic, sizeof(magic)); + + /* Override report entry. */ + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(area_addr), area_size); + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + err = flash_write(fdev, suit_plat_mem_nvm_offset_get(area_addr), report_magic_buf, + sizeof(report_magic_buf)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + if (len > buffered_size) { + size_t remaining_size = len - buffered_size; + size_t write_size = + (WRITE_ALIGN(remaining_size) == remaining_size + ? remaining_size + : WRITE_ALIGN(remaining_size) - SUIT_STORAGE_WRITE_SIZE); + + if (write_size > 0) { + err = flash_write(fdev, + suit_plat_mem_nvm_offset_get(area_addr) + + sizeof(report_magic_buf), + &buf[buffered_size], write_size); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + } + + if (remaining_size > write_size) { + memset(report_magic_buf, 0xFF, SUIT_STORAGE_WRITE_SIZE); + memcpy(report_magic_buf, &buf[buffered_size + write_size], + remaining_size - write_size); + + err = flash_write(fdev, + suit_plat_mem_nvm_offset_get(area_addr) + + sizeof(report_magic_buf) + write_size, + report_magic_buf, SUIT_STORAGE_WRITE_SIZE); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + } + } + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/storage/src/suit_storage_test.c b/subsys/suit/storage/src/suit_storage_test.c new file mode 100644 index 000000000000..678688a417cb --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_test.c @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +LOG_MODULE_REGISTER(suit_storage, CONFIG_SUIT_LOG_LEVEL); + +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#define SUIT_REPORT_SIZE 4096 /**< Size of a single SUIT report slot. */ +#define SUIT_N_REPORTS 2 /**< Number of SUIT report slots. */ + +/* Update candidate metadata, aligned to the erase block size. */ +union suit_update_candidate_entry { + struct update_candidate_info update; + uint8_t erase_block[EB_SIZE(struct update_candidate_info)]; +}; + +/* SUIT envelope slot. + * + * Each slot contains a CBOR-encoded map with severed SUIT envelope. + */ +typedef uint8_t suit_envelope_encoded_t[CONFIG_SUIT_STORAGE_ENVELOPE_SIZE]; + +/* SUIT envelope slot, aligned to the erase block size. */ +union suit_envelope_entry { + suit_envelope_encoded_t envelope_encoded; + uint8_t erase_block[EB_SIZE(suit_envelope_encoded_t)]; +}; + +/* SUIT configuration area, set by application (i.e. thorough IPC service) and + * checked using suit-condition-check-content. + * + * Currently both the service and the directive is not supported. + * This definition allows to implement up to three 32-bit configuration values. + * It is defined here, so the system will not be repartitioned once this feature + * will be introduced in the future. + */ +typedef uint8_t suit_config_t[CONFIG_SUIT_STORAGE_CONFIG_SIZE]; + +/* SUIT configuration area, aligned to the erase block size. */ +union suit_config_entry { + suit_config_t config; + uint8_t erase_block[EB_SIZE(suit_config_t)]; +}; + +/* SUIT report binary. */ +typedef uint8_t suit_report_t[SUIT_REPORT_SIZE]; + +/* SUIT rebort area, aligned to the erase block size. */ +union suit_report_entry { + suit_report_t report; + uint8_t erase_block[EB_SIZE(suit_report_t)]; +}; + +/* SUIT storage structure, that can be used to parse the NVM contents. */ +struct suit_storage { + /** Update candidate information. */ + union suit_update_candidate_entry update; + /** SUIT configuration area */ + union suit_config_entry config; + /** A copy of the configuration area to protect against random resets. */ + union suit_config_entry config_backup; + /** The main storage for the SUIT envelopes. */ + union suit_envelope_entry envelopes[CONFIG_SUIT_STORAGE_N_ENVELOPES]; + /** Storage for the SUIT reports. */ + union suit_report_entry reports[SUIT_N_REPORTS]; +}; + +static const suit_storage_mpi_t mpi_test_sample[] = { + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED, + .signature_verification_policy = SUIT_MPI_SIGNATURE_CHECK_DISABLED, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + .class_id = {0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, 0x89, 0x86, 0xa5, 0x46, + 0x60, 0xa1, 0x4b, 0x0a}, + }, + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_DENIED, + .signature_verification_policy = SUIT_MPI_SIGNATURE_CHECK_DISABLED, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'test_sample_app') */ + .class_id = {0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, 0x53, 0x9c, 0xa3, 0x18, 0x68, 0x1b, + 0x03, 0x69, 0x5e, 0x36}, + }, + { + .version = SUIT_MPI_INFO_VERSION, + .downgrade_prevention_policy = SUIT_MPI_DOWNGRADE_PREVENTION_DISABLED, + .independent_updateability_policy = SUIT_MPI_INDEPENDENT_UPDATE_ALLOWED, + .signature_verification_policy = SUIT_MPI_SIGNATURE_CHECK_DISABLED, + .reserved = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF}, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + .vendor_id = {0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, 0xe2, + 0x8d, 0x73, 0x5c, 0xe9, 0xf4}, + /* RFC4122 uuid5(nordic_vid, 'test_sample_recovery') */ + .class_id = {0x74, 0xa0, 0xc6, 0xe7, 0xa9, 0x2a, 0x56, 0x00, 0x9c, 0x5d, 0x30, 0xee, + 0x87, 0x8b, 0x06, 0xba}, + }}; + +static suit_plat_err_t find_mpi_area(suit_manifest_role_t role, uint8_t **addr, size_t *size) +{ + int index = -1; + + const suit_storage_mpi_t *mpi_config = mpi_test_sample; + + switch (role) { + case SUIT_MANIFEST_APP_ROOT: + index = 0; + break; + case SUIT_MANIFEST_APP_LOCAL_1: + index = 1; + break; + case SUIT_MANIFEST_APP_RECOVERY: + index = 2; + break; + default: + index = -1; + break; + } + + if (index == -1) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + *addr = (uint8_t *)&mpi_config[index]; + *size = sizeof(mpi_config[index]); + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t find_manifest_area(suit_manifest_role_t role, const uint8_t **addr, + size_t *size) +{ + struct suit_storage *storage = (struct suit_storage *)SUIT_STORAGE_ADDRESS; + int index = -1; + + switch (role) { + case SUIT_MANIFEST_APP_ROOT: + index = 0; + break; + case SUIT_MANIFEST_APP_LOCAL_1: + index = 1; + break; + case SUIT_MANIFEST_APP_RECOVERY: + index = 2; + break; + default: + index = -1; + break; + } + + if (index == -1) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + *addr = storage->envelopes[index].erase_block; + *size = sizeof(storage->envelopes[index].erase_block); + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t find_report_area(size_t index, uint8_t **addr, size_t *size) +{ + struct suit_storage *storage = (struct suit_storage *)SUIT_STORAGE_ADDRESS; + + if (index >= SUIT_N_REPORTS) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + *addr = storage->reports[index].erase_block; + *size = sizeof(storage->reports[index].erase_block); + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_init(void) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + suit_manifest_role_t roles[] = { + SUIT_MANIFEST_APP_ROOT, + SUIT_MANIFEST_APP_LOCAL_1, + SUIT_MANIFEST_APP_RECOVERY, + }; + + if (sizeof(struct suit_storage) > SUIT_STORAGE_SIZE) { + return SUIT_PLAT_ERR_NOMEM; + } + + if (CEIL_DIV(SUIT_STORAGE_SIZE, SUIT_STORAGE_EB_SIZE) * SUIT_STORAGE_EB_SIZE != + SUIT_STORAGE_SIZE) { + return SUIT_PLAT_ERR_CRASH; + } + + err = suit_storage_mpi_init(); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + err = suit_storage_report_internal_init(); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + err = suit_storage_update_init(); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unable to initialize update candidate staging area (err: %d)", err); + } + + /* Bootstrap MPI entries. */ + for (size_t i = 0; i < ARRAY_SIZE(roles); i++) { + uint8_t *mpi_addr; + size_t mpi_size; + + err = find_mpi_area(roles[i], &mpi_addr, &mpi_size); + if (err != SUIT_PLAT_SUCCESS) { + continue; + } + + err = suit_storage_mpi_configuration_load(roles[i], mpi_addr, mpi_size); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_update_cand_get(const suit_plat_mreg_t **regions, size_t *len) +{ + struct suit_storage *storage = (struct suit_storage *)SUIT_STORAGE_ADDRESS; + uint8_t *addr = storage->update.erase_block; + size_t size = sizeof(storage->update.erase_block); + + return suit_storage_update_get(addr, size, regions, len); +} + +suit_plat_err_t suit_storage_update_cand_set(suit_plat_mreg_t *regions, size_t len) +{ + struct suit_storage *storage = (struct suit_storage *)SUIT_STORAGE_ADDRESS; + uint8_t *addr = storage->update.erase_block; + size_t size = sizeof(storage->update.erase_block); + + return suit_storage_update_set(addr, size, regions, len); +} + +suit_plat_err_t suit_storage_installed_envelope_get(const suit_manifest_class_id_t *id, + const uint8_t **addr, size_t *size) +{ + suit_manifest_role_t role; + + if ((id == NULL) || (addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + suit_plat_err_t err = suit_storage_mpi_role_get(id, &role); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find role for given class ID."); + return err; + } + + err = find_manifest_area(role, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for envelope with role 0x%x.", role); + return err; + } + + LOG_DBG("Decode envelope with role: 0x%x address: 0x%lx", role, (intptr_t)(*addr)); + + err = suit_storage_envelope_get(*addr, *size, id, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_WRN("Unable to parse envelope with role 0x%x", role); + return err; + } + + LOG_DBG("Valid envelope with given class ID and role 0x%x found", role); + + return err; +} + +suit_plat_err_t suit_storage_install_envelope(const suit_manifest_class_id_t *id, uint8_t *addr, + size_t size) +{ + suit_plat_err_t err; + suit_manifest_role_t role; + uint8_t *area_addr = NULL; + size_t area_size = 0; + + err = suit_storage_mpi_role_get(id, &role); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find role for given class ID."); + return err; + } + + if ((addr == NULL) || (size == 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + err = find_manifest_area(role, (const uint8_t **)&area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for envelope with role 0x%x.", role); + return err; + } + + err = suit_storage_envelope_install(area_addr, area_size, id, addr, size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Failed to install envelope with role 0x%x.", role); + return err; + } + + LOG_INF("Envelope with role 0x%x saved.", role); + + return err; +} + +suit_plat_err_t suit_storage_report_clear(size_t index) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find report area at index %d.", index); + return err; + } + + return suit_storage_report_internal_clear(area_addr, area_size); +} + +suit_plat_err_t suit_storage_report_save(size_t index, const uint8_t *buf, size_t len) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area for report at index %d.", index); + return err; + } + + return suit_storage_report_internal_save(area_addr, area_size, buf, len); +} + +suit_plat_err_t suit_storage_report_read(size_t index, const uint8_t **buf, size_t *len) +{ + uint8_t *area_addr = NULL; + size_t area_size = 0; + suit_plat_err_t err; + + err = find_report_area(index, &area_addr, &area_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_INF("Unable to find area with report at index %d.", index); + return err; + } + + return suit_storage_report_internal_read(area_addr, area_size, buf, len); +} diff --git a/subsys/suit/storage/src/suit_storage_update.c b/subsys/suit/storage/src/suit_storage_update.c new file mode 100644 index 000000000000..f1edc6bf7521 --- /dev/null +++ b/subsys/suit/storage/src/suit_storage_update.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define UPDATE_MAGIC_VALUE_AVAILABLE_RAW 0x5555AAAA +#define UPDATE_MAGIC_VALUE_AVAILABLE_CBOR 0x55AA55AA +#define UPDATE_MAGIC_VALUE_EMPTY 0xFFFFFFFF + +LOG_MODULE_REGISTER(suit_storage_update, CONFIG_SUIT_LOG_LEVEL); + +/** @brief Update the candidate info structure. + * + * @param[in] info Update candidate info to write. + * @param[in] addr Address of erase-block aligned memory containing update candidate info. + * @param[in] size Size of erase-block aligned memory, containing update candidate info. + * + * @retval SUIT_PLAT_SUCCESS if update candidate successfully updated. + * @retval SUIT_PLAT_ERR_IO if unable to change NVM contents. + * @retval SUIT_PLAT_ERR_HW_NOT_READY if NVM controller is unavailable. + */ +static suit_plat_err_t save_update_info(const struct update_candidate_info *info, uint8_t *addr, + size_t size) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + int err = flash_erase(fdev, suit_plat_mem_nvm_offset_get(addr), size); + + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + err = flash_write(fdev, suit_plat_mem_nvm_offset_get(addr), info, sizeof(*info)); + if (err != 0) { + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_update_init(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + if (!device_is_ready(fdev)) { + fdev = NULL; + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_update_get(const uint8_t *addr, size_t size, + const suit_plat_mreg_t **regions, size_t *len) +{ + struct update_candidate_info *info = (struct update_candidate_info *)addr; + + if ((addr == NULL) || (regions == NULL) || (len == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + if (size < sizeof(struct update_candidate_info)) { + LOG_ERR("Incorrect update candidate area size (%d != %d)", size, + sizeof(struct update_candidate_info)); + return SUIT_PLAT_ERR_SIZE; + } + + if ((info->update_magic_value != UPDATE_MAGIC_VALUE_AVAILABLE_CBOR) || + (info->update_regions_len < 1) || (info->update_regions[0].mem == NULL) || + (info->update_regions[0].size == 0)) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + *len = info->update_regions_len; + *regions = (const suit_plat_mreg_t *)&(info->update_regions); + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_storage_update_set(uint8_t *addr, size_t size, const suit_plat_mreg_t *regions, + size_t len) +{ + struct update_candidate_info info; + + memset(&info, 0, sizeof(info)); + + if ((addr == NULL) || ((len != 0) && (regions == NULL))) { + return SUIT_PLAT_ERR_INVAL; + } + + if (size < sizeof(struct update_candidate_info)) { + LOG_ERR("Incorrect update candidate area size (%d != %d)", size, + sizeof(struct update_candidate_info)); + return SUIT_PLAT_ERR_SIZE; + } + + if ((regions != NULL) && ((regions[0].mem == NULL) || (regions[0].size == 0))) { + LOG_ERR("Invalid update candidate regions provided (%p)", (void *)regions); + return SUIT_PLAT_ERR_INVAL; + } + + if (len > CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS) { + LOG_ERR("Too many update regions (%d > %d)", len, + CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS); + return SUIT_PLAT_ERR_SIZE; + } + + info.update_magic_value = UPDATE_MAGIC_VALUE_AVAILABLE_CBOR; + info.update_regions_len = len; + if (len != 0) { + memcpy(&info.update_regions, regions, sizeof(regions[0]) * len); + } + + return save_update_info(&info, addr, size); +} diff --git a/subsys/suit/stream/CMakeLists.txt b/subsys/suit/stream/CMakeLists.txt new file mode 100644 index 000000000000..b166c69038a8 --- /dev/null +++ b/subsys/suit/stream/CMakeLists.txt @@ -0,0 +1,9 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +add_subdirectory(stream_sinks) +add_subdirectory(stream_sources) +add_subdirectory(address_streamer_selector) diff --git a/subsys/suit/stream/Kconfig b/subsys/suit/stream/Kconfig new file mode 100644 index 000000000000..3a3e46d08952 --- /dev/null +++ b/subsys/suit/stream/Kconfig @@ -0,0 +1,153 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig SUIT_STREAM + bool "Enable SUIT stream module" + +if SUIT_STREAM + +config SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED + bool + help + Helper symbol indicating that a sink backend + for MEM component is implemented. + +config SUIT_STREAM_SINK_CACHE + bool "Enable SUIT cache sink" + depends on SUIT_CACHE_RW + depends on SUIT_STREAM_SINK_FLASH + +config SUIT_STREAM_SINK_MEMPTR + bool "Enable memory pointer storage sink" + depends on SUIT_MEMPTR_STORAGE + +config SUIT_STREAM_SINK_FLASH + bool "Enable NVM storage sink" + depends on FLASH + depends on SUIT_UTILS + depends on SUIT_MEMPTR_STORAGE + select SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED + +config SUIT_STREAM_SINK_RAM + bool "Enable RAM buffer sink" + select SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED + +config SUIT_STREAM_SINK_EXTMEM + bool "Enable external memory sink" + depends on SSF_EXTMEM_SERVICE_ENABLED + select SUIT_STREAM_SINK_COMPONENT_MEM_SUPPORTED + +menuconfig SUIT_STREAM_SINK_SDFW + bool "Enable SDFW sink" + depends on SUIT_UTILS + depends on SOC_SERIES_NRF54HX + select PSA_WANT_ALG_SHA_512 + select SUIT_STREAM_SINK_DIGEST + +if SUIT_STREAM_SINK_SDFW + +config SUIT_SDFW_UPDATE_SIGNED_MANIFEST_OFFSET + hex "Offset between start of the SDFW update candidate image and Signed Manifest section" + default 0 + +config SUIT_SDFW_UPDATE_DIGEST_OFFSET + hex "Offset between start of the SDFW update candidate image and SM.TBS.FW.DIGEST section" + default 0x20 + +config SUIT_SDFW_UPDATE_PUBLIC_KEY_OFFSET + hex "Offset between start of the SDFW update candidate image and Public Key section" + default 0x100 + +config SUIT_SDFW_UPDATE_SIGNATURE_OFFSET + hex "Offset between start of the SDFW update candidate image and Signature section" + default 0x120 + +config SUIT_SDFW_UPDATE_FIRMWARE_OFFSET + hex "Offset between start of the SDFW update candidate image and Firmware section" + default 0x160 + +config SUIT_SDFW_UPDATE_MAX_SIZE + hex "Maximum size of SDFW update" + range 0x00000080 0x000FD000 + default 0x000FD000 + help + Range is based on documentation of register UROT.SM.TBS.LAYOUT.USLOT.MAX + +endif # SUIT_STREAM_SINK_SDFW + +config SUIT_STREAM_SINK_DIGEST + bool "Enable digest sink" + select PSA_WANT_ALG_SHA_256 if SOC_FAMILY_NORDIC_NRF + +if SUIT_STREAM_SINK_DIGEST + config SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT + int "Maximum number of contexts" + default 1 +endif # SUIT_STREAM_SINK_DIGEST + +config SUIT_STREAM_SOURCE_CACHE + bool "Enable SUIT cache source" + depends on SUIT_CACHE + +config SUIT_STREAM_SOURCE_MEMPTR + bool "Enable memory pointer storage source" + +config SUIT_STREAM_FETCH_SOURCE_MGR + bool "Fetch source manager" + +config SUIT_STREAM_FETCH_MAX_SOURCES + int "The maximum number of fetch sources to be able to be registered by fetch source manager" + default 3 + depends on SUIT_STREAM_FETCH_SOURCE_MGR + +config SUIT_STREAM_SOURCE_EXTMEM + bool "Enable external memory storage source" + depends on SSF_EXTMEM_SERVICE_ENABLED + +config SUIT_STREAM_SOURCE_FLASH + bool "Enable flash memory storage source" + depends on FLASH + +menuconfig SUIT_STREAM_SOURCE_IPC + bool "Enable feeding images from external sources to SDFW" + +if SUIT_STREAM_SOURCE_IPC + +config SUIT_STREAM_IPC_REQUESTOR + bool "Part of functionality executed in SDFW" + +config SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS + int "The maximum number of image chunks simultaneously enqueable by requestor" + default 3 + depends on SUIT_STREAM_IPC_REQUESTOR + +config SUIT_STREAM_IPC_PROVIDER + bool "Part of functionality executed on App Core" + depends on SUIT_STREAM_FETCH_SOURCE_MGR + +config SUIT_STREAM_IPC_PROVIDER_BUFFERS + int "The number of buffers supported by provider. For optimal performance should be equal to CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS" + default 3 + depends on SUIT_STREAM_IPC_PROVIDER + +config SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE + int "Size of single buffer in bytes" + default 8192 + depends on SUIT_STREAM_IPC_PROVIDER + +config SUIT_STREAM_IPC_STREAMER_REQUESTING_PERIOD + int "Image request repetition period in milliseconds" + range 100 10000 + default 1000 + +config SUIT_STREAM_IPC_STREAMER_CHUNK_TIMEOUT + int "Max streamer provider inactivity before timeout in milliseconds" + range 1000 60000 + default 10000 + +endif # SUIT_STREAM_SOURCE_IPC + +endif # SUIT_STREAM diff --git a/subsys/suit/stream/address_streamer_selector/CMakeLists.txt b/subsys/suit/stream/address_streamer_selector/CMakeLists.txt new file mode 100644 index 000000000000..ef307e1a77af --- /dev/null +++ b/subsys/suit/stream/address_streamer_selector/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_source_selector_interface) +target_include_directories(suit_source_selector_interface INTERFACE include) + +zephyr_library() +zephyr_library_sources(src/suit_address_streamer_selector.c) + +zephyr_library_link_libraries(suit_stream_sources_interface) +zephyr_library_link_libraries(suit_source_selector_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/subsys/suit/stream/address_streamer_selector/include/suit_address_streamer_selector.h b/subsys/suit/stream/address_streamer_selector/include/suit_address_streamer_selector.h new file mode 100644 index 000000000000..70f226854522 --- /dev/null +++ b/subsys/suit/stream/address_streamer_selector/include/suit_address_streamer_selector.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_ADDRESS_STREAMER_SELECTOR_H__ +#define SUIT_ADDRESS_STREAMER_SELECTOR_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Stream data into the sink. + * + * @param payload Global memory address pointing to the payload. + * @param payload_size Size of the data to stream. + * @param sink Sink object to write the data to. + * + * @return 0 if success, error code otherwise. + */ +typedef suit_plat_err_t (*suit_address_streamer)(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink); + +/** + * @brief Get sink based on address + * + * @param address Address to stream data from + * @param ifaces Null-terminated list of source interfaces + * + * @return int 0 in case of success, otherwise error code + */ +suit_address_streamer suit_address_streamer_select_by_address(const uint8_t *address); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_ADDRESS_STREAMER_SELECTOR_H__ */ diff --git a/subsys/suit/stream/address_streamer_selector/src/suit_address_streamer_selector.c b/subsys/suit/stream/address_streamer_selector/src/suit_address_streamer_selector.c new file mode 100644 index 000000000000..290195bb17cf --- /dev/null +++ b/subsys/suit/stream/address_streamer_selector/src/suit_address_streamer_selector.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_EXTMEM) +#include +#endif + +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_FLASH) +#include +#endif + +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_MEMPTR) +#include +#endif + +LOG_MODULE_REGISTER(suit_plat_source_selector, CONFIG_SUIT_LOG_LEVEL); + +/** + * @brief Check if stream source handles given address. + * + * @param address Global memory address pointing to the payload. + * + * @return True if the source can stream data from the address, false otherwise. + */ +typedef bool (*suit_address_check)(const uint8_t *address); + +/* Stream interface object. */ +struct stream_iface { + suit_address_streamer stream; + suit_address_check address_check; +}; + +const struct stream_iface ifaces[] = { +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_EXTMEM) + { + .stream = suit_extmem_streamer_stream, + .address_check = suit_extmem_streamer_address_in_range + }, +#endif +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_FLASH) + { + .stream = suit_flash_streamer_stream, + .address_check = suit_flash_streamer_address_in_range + }, +#endif +#if IS_ENABLED(CONFIG_SUIT_STREAM_SOURCE_MEMPTR) + { + .stream = suit_memptr_streamer_stream, + .address_check = suit_memptr_streamer_address_in_range + }, +#endif +}; + +suit_address_streamer suit_address_streamer_select_by_address(const uint8_t *address) +{ + for (int i = 0; i < ARRAY_SIZE(ifaces); i++) { + if (ifaces[i].address_check((uint8_t *)address)) { + return ifaces[i].stream; + } + } + LOG_ERR("No streamer found for address %p", (void *) address); + + return NULL; +} diff --git a/subsys/suit/stream/stream_sinks/CMakeLists.txt b/subsys/suit/stream/stream_sinks/CMakeLists.txt new file mode 100644 index 000000000000..be86147ab7eb --- /dev/null +++ b/subsys/suit/stream/stream_sinks/CMakeLists.txt @@ -0,0 +1,31 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_stream_sinks_interface) +target_include_directories(suit_stream_sinks_interface INTERFACE include) +if(CONFIG_SUIT_STREAM_SINK_MEMPTR OR CONFIG_SUIT_STREAM_SINK_FLASH) +target_link_libraries(suit_stream_sinks_interface INTERFACE suit_memptr_storage_interface) +endif() # CONFIG_SUIT_STREAM_SINK_MEMPTR +target_link_libraries(suit_stream_sinks_interface INTERFACE suit_platform_err) + + + +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_CACHE src/suit_dfu_cache_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_RAM src/suit_ram_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_FLASH src/suit_flash_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_MEMPTR src/suit_memptr_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_SDFW src/suit_sdfw_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_DIGEST src/suit_digest_sink.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SINK_EXTMEM src/suit_extmem_sink.c) + +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_memory_layout_interface) + +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_SINK_SELECTOR suit_sink_selector_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_SINK_CACHE suit_cache_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_SINK_SDFW suit_utils) diff --git a/subsys/suit/stream/stream_sinks/include/suit_dfu_cache_sink.h b/subsys/suit/stream/stream_sinks/include/suit_dfu_cache_sink.h new file mode 100644 index 000000000000..4c1b558fcc23 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_dfu_cache_sink.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef CACHE_SINK_H__ +#define CACHE_SINK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get cache sink object + * + * @param sink Pointer to sink_stream to be filled + * @param cache_partition_id SUIT cache partition index (suit_cache_2 => id == 2) + * @param uri Pointer to URI that will be used as a key in cache + * @param uri_size Size of URI + * @param write_enabled Enable modifying the cache. Set to @c false during dry run. + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_dfu_cache_sink_get(struct stream_sink *sink, uint8_t cache_partition_id, + const uint8_t *uri, size_t uri_size, bool write_enabled); + +/** + * @brief Commits written data to cache + * + * @param ctx Pointer to sink context + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_sink_commit(void *ctx); + +/** + * @brief Created slot is removed along with any data written to it. + * + * @param ctx Pointer to sink context + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_dfu_cache_sink_drop(void *ctx); + +#ifdef __cplusplus +} +#endif + +/* No release for cache */ +#endif /* CACHE_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_digest_sink.h b/subsys/suit/stream/stream_sinks/include/suit_digest_sink.h new file mode 100644 index 000000000000..2a54f1a508ea --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_digest_sink.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef DIGEST_SINK_H__ +#define DIGEST_SINK_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int digest_sink_err_t; + + /**< The compared digests do not match */ +#define DIGEST_SINK_ERR_DIGEST_MISMATCH 1 + +/** + * @brief Get the digest_sink object + * + * @note This function has to be called prior to calling suit_digest_sink_digest_match function + * + * @param[in] sink Pointer to sink_stream to be filled + * @param[in] algorithm Algorithm to be used for digest calculation + * @param[in] expected_digest digest to be used for comparison against calculated digest value + * @return int SUIT_PLAT_SUCCESS if success, error code otherwise + */ +suit_plat_err_t suit_digest_sink_get(struct stream_sink *sink, psa_algorithm_t algorithm, + const uint8_t *expected_digest); + +/** + * @brief Check if digest matches expected digest value + * + * @note A sink has to be initialized with suit_digest_sink_get function call. + * @note Then data intended for digest calculation has to be fed in using sink's write API function + * call(s). + * @note Finally this function can be called to finilize digest calculation and perform its + * verification. + * + * @param[in] ctx Context of a sink used for digest calculation + * + * @return SUIT_PLAT_SUCCESS Digest calculation was successful and it matches expected digest + * @return DIGEST_SINK_ERR_DIGEST_MISMATCH Digest calculation was successful but it does + * not match expected digest + * @return SUIT_PLAT_ERR_CRASH Digest could not be calculated or crash during cleanup + * @return SUIT_PLAT_ERR_INVAL @ctx is NULL + * @return SUIT_PLAT_ERR_INCORRECT_STATE A sink was not initialized + * using suit_digest_sink_get function + */ +digest_sink_err_t suit_digest_sink_digest_match(void *ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* DIGEST_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_extmem_sink.h b/subsys/suit/stream/stream_sinks/include/suit_extmem_sink.h new file mode 100644 index 000000000000..428aef2ac4a8 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_extmem_sink.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef EXTMEM_SINK_H__ +#define EXTMEM_SINK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the extmem_sink object + * + * @param sink Pointer to sink_stream to be filled + * @param dst Destination address - start of write area + * @param size Write area size + * @return SUIT_PLAT_SUCCESS if success otherwise error code. + */ +suit_plat_err_t suit_extmem_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size); + +/** + * @brief Check if given address lays in external memory area. + * + * @param address Address to be checked + * @return true If given address lays in external memory area. + * @return false If given address is out of bounds of external memory area. + */ +bool suit_extmem_sink_is_address_supported(uint8_t *address); + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_flash_sink.h b/subsys/suit/stream/stream_sinks/include/suit_flash_sink.h new file mode 100644 index 000000000000..a7e0e6810ff8 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_flash_sink.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef FLASH_SINK_H__ +#define FLASH_SINK_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the flash_sink object + * + * @param sink Pointer to sink_stream to be filled + * @param dst Destination address - start of write area + * @param size Write area size + * @return SUIT_PLAT_SUCCESS if success otherwise error code. + */ +suit_plat_err_t suit_flash_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size); + +/** + * @brief Check if given address lays in nvm + * + * @param address Address to be checked + * @return true If given address lays in nvm + * @return false If given address is out of bounds of nvm + */ +bool suit_flash_sink_is_address_supported(uint8_t *address); + +#ifdef __cplusplus +} +#endif + +#endif /* FLASH_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_memptr_sink.h b/subsys/suit/stream/stream_sinks/include/suit_memptr_sink.h new file mode 100644 index 000000000000..ba73d3c70ad0 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_memptr_sink.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MEMPTR_SINK_H__ +#define MEMPTR_SINK_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the memptr sink object + * + * @param sink Pointer to sink_stream to be filled + * @param handle Handle to storage object + * @return SUIT_PLAT_SUCCESS if success otherwise error code. + */ +suit_plat_err_t suit_memptr_sink_get(struct stream_sink *sink, memptr_storage_handle_t handle); + +#ifdef __cplusplus +} +#endif + +#endif /* MEMPTR_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_ram_sink.h b/subsys/suit/stream/stream_sinks/include/suit_ram_sink.h new file mode 100644 index 000000000000..7d4e62d8990f --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_ram_sink.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef RAM_SINK_H__ +#define RAM_SINK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the ram_sink object + * + * @param sink Pointer to sink_stream to be filled + * @param dst Destination address - start of write area + * @param size Write area size + * @return SUIT_PLAT_SUCCESS if success otherwise error code. + */ +suit_plat_err_t suit_ram_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size); + +/** + * @brief Check if given address lays in assigned RAM + * + * @param address Address to be checked + * @return true If given address lays in RAM + * @return false If given address is out of bounds of assigned RAM + */ +bool suit_ram_sink_is_address_supported(uint8_t *address); + +#ifdef __cplusplus +} +#endif + +#endif /* RAM_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_sdfw_sink.h b/subsys/suit/stream/stream_sinks/include/suit_sdfw_sink.h new file mode 100644 index 000000000000..be8a644796ba --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_sdfw_sink.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SDFW_SINK_H__ +#define SDFW_SINK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the sdfw_sink object + * + * @param sink Pointer to sink_stream to be filled + * @return SUIT_PLAT_SUCCESS if success, error code otherwise + */ +suit_plat_err_t suit_sdfw_sink_get(struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* SDFW_SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/include/suit_sink.h b/subsys/suit/stream/stream_sinks/include/suit_sink.h new file mode 100644 index 000000000000..c902608765f3 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/include/suit_sink.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SINK_H__ +#define SINK_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef suit_plat_err_t (*erase_ptr)(void *ctx); +typedef suit_plat_err_t (*write_ptr)(void *ctx, const uint8_t *buf, size_t size); +typedef suit_plat_err_t (*seek_ptr)(void *ctx, size_t offset); +typedef suit_plat_err_t (*flush_ptr)(void *ctx); +typedef suit_plat_err_t (*used_storage_ptr)(void *ctx, size_t *size); +typedef suit_plat_err_t (*release_ptr)(void *ctx); + +/** + * @brief Structure represents node that is a target for data. + * The idea is to be able to create chain of such links/filters to process and write data. + * Structure can represent for example: + * - decrypting or decompressing entity and being an intermediate block. + * - a writer, presumably a final block. + */ +struct stream_sink { + erase_ptr erase; + write_ptr write; + seek_ptr seek; + flush_ptr flush; + used_storage_ptr used_storage; + release_ptr release; + + void *ctx; /* context used by specific sink implementation */ +}; + +/** + * @brief Helper function for releasing sink + * + * @param sink Sink to be released + * @return suit_plat_err_t + */ +static inline suit_plat_err_t release_sink(struct stream_sink *sink) +{ + if (sink != NULL) { + if (sink->release != NULL) { + return sink->release(sink->ctx); + } + + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_INVAL; +} + +#ifdef __cplusplus +} +#endif + +#endif /* SINK_H__ */ diff --git a/subsys/suit/stream/stream_sinks/src/suit_dfu_cache_sink.c b/subsys/suit/stream/stream_sinks/src/suit_dfu_cache_sink.c new file mode 100644 index 000000000000..e118ad83e38c --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_dfu_cache_sink.c @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_cache_sink, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size); +static suit_plat_err_t seek(void *ctx, size_t offset); +static suit_plat_err_t flush(void *ctx); +static suit_plat_err_t used_storage(void *ctx, size_t *size); +static suit_plat_err_t release(void *ctx); + +struct cache_ctx { + struct suit_cache_slot slot; + size_t size_used; + size_t offset; + size_t offset_limit; + bool in_use; + bool write_enabled; +}; + +static struct cache_ctx ctx; + +suit_plat_err_t suit_dfu_cache_sink_get(struct stream_sink *sink, uint8_t cache_partition_id, + const uint8_t *uri, size_t uri_size, bool write_enabled) +{ + if ((sink != NULL) && (uri != NULL) && (uri_size > 0)) { + + if (ctx.in_use) { + LOG_ERR("Cache is busy"); + return SUIT_PLAT_ERR_BUSY; + } + + const uint8_t *dfu_partition_address; + size_t dfu_partition_size; + + (void)dfu_partition_address; + (void)dfu_partition_size; + if (suit_dfu_cache_rw_partition_info_get(cache_partition_id, &dfu_partition_address, + &dfu_partition_size) != + SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + + if (write_enabled) { + ret = suit_dfu_cache_rw_slot_create(cache_partition_id, &ctx.slot, uri, + uri_size); + } + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting slot in cache failed"); + return ret; + } + + ctx.offset = 0; + ctx.offset_limit = ctx.slot.size - ctx.slot.data_offset; + ctx.in_use = true; + ctx.write_enabled = write_enabled; + + sink->erase = NULL; + sink->write = write; + sink->seek = seek; + sink->flush = flush; + sink->used_storage = used_storage; + sink->release = release; + sink->ctx = &ctx; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +/* Actual write offset = data_offset + offset */ +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + if ((ctx != NULL) && (buf != NULL) && (size != 0)) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + struct stream_sink sink; + + if (cache_ctx->write_enabled) { + /* Check if data will fit */ + if ((size + cache_ctx->offset) < cache_ctx->offset_limit) { + suit_plat_err_t ret = suit_flash_sink_get( + &sink, + cache_ctx->slot.slot_address + cache_ctx->slot.data_offset + + cache_ctx->offset, + size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Getting flash_sink failed. %i", ret); + return SUIT_PLAT_ERR_IO; + } + + ret = sink.write(sink.ctx, buf, size); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Writing data to cache slot failed, Flash err: %d.", + ret); + + if (sink.release(sink.ctx) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + return SUIT_PLAT_ERR_INVAL; + } + + return SUIT_PLAT_ERR_IO; + } + + cache_ctx->offset += size; + + if (sink.release(sink.ctx) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink release failed"); + return SUIT_PLAT_ERR_INVAL; + } + + if (cache_ctx->offset > cache_ctx->size_used) { + cache_ctx->size_used = cache_ctx->offset; + } + + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_NOMEM; + } + + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t seek(void *ctx, size_t offset) +{ + if (ctx != NULL) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + + if (cache_ctx->write_enabled) { + if (offset < cache_ctx->offset_limit) { + cache_ctx->offset = offset; + return SUIT_PLAT_SUCCESS; + } + } + + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t flush(void *ctx) +{ + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t used_storage(void *ctx, size_t *size) +{ + if ((ctx != NULL) && (size != NULL)) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + + *size = cache_ctx->size_used; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx != NULL) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + + if (cache_ctx->write_enabled) { + LOG_INF("Changes were not committed and will be dropped"); + cache_ctx->write_enabled = false; + + ret = suit_dfu_cache_rw_slot_drop(&cache_ctx->slot); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + } + + cache_ctx->in_use = false; + cache_ctx->size_used = 0; + return ret; + } + + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_sink_commit(void *ctx) +{ + if (ctx != NULL) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + + if (cache_ctx->write_enabled) { + suit_plat_err_t ret = suit_dfu_cache_rw_slot_close(&cache_ctx->slot, + cache_ctx->size_used); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Commit to cache failed."); + return ret; + } + + cache_ctx->write_enabled = false; + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_dfu_cache_sink_drop(void *ctx) +{ + if (ctx != NULL) { + struct cache_ctx *cache_ctx = (struct cache_ctx *)ctx; + + if (cache_ctx->write_enabled) { + suit_plat_err_t ret = suit_dfu_cache_rw_slot_drop(&cache_ctx->slot); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Drop changes to cache failed."); + return ret; + } + + cache_ctx->write_enabled = false; + cache_ctx->size_used = 0; + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_digest_sink.c b/subsys/suit/stream/stream_sinks/src/suit_digest_sink.c new file mode 100644 index 000000000000..230db42d77f8 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_digest_sink.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include + +LOG_MODULE_REGISTER(suit_digest_sink, CONFIG_SUIT_LOG_LEVEL); + +struct digest_sink_context { + bool in_use; + psa_hash_operation_t operation; + const uint8_t *expected_digest; + size_t expected_digest_length; +}; + +static struct digest_sink_context digest_contexts[CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT]; + +static struct digest_sink_context *get_new_context(void) +{ + for (size_t i = 0; i < CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT; ++i) { + if (!digest_contexts[i].in_use) { + return &digest_contexts[i]; + } + } + + return NULL; +} + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + if ((ctx == NULL) || (buf == NULL) || (size == 0)) { + LOG_ERR("Invalid arguments"); + return SUIT_PLAT_ERR_INVAL; + } + + LOG_DBG("buf: %p", (void *)buf); + LOG_DBG("size: %d", size); + + struct digest_sink_context *digest_ctx = (struct digest_sink_context *)ctx; + + if (!digest_ctx->in_use) { + LOG_ERR("Writing to uninitialized sink"); + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + psa_status_t status = psa_hash_update(&digest_ctx->operation, buf, size); + + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to update digest: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + struct digest_sink_context *digest_ctx = (struct digest_sink_context *)ctx; + + memset(digest_ctx, 0, sizeof(struct digest_sink_context)); + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_digest_sink_get(struct stream_sink *sink, psa_algorithm_t algorithm, + const uint8_t *expected_digest) +{ + if (sink == NULL || expected_digest == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + struct digest_sink_context *digest_ctx = get_new_context(); + + if (digest_ctx == NULL) { + LOG_ERR("Failed to get a new context"); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + memset((void *)digest_ctx, 0, sizeof(struct digest_sink_context)); + + psa_status_t status = psa_crypto_init(); + + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to init psa crypto: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + status = psa_hash_setup(&digest_ctx->operation, algorithm); + if (status != PSA_SUCCESS) { + LOG_ERR("Failed to setup hash algorithm: %d", status); + return SUIT_PLAT_ERR_CRASH; + } + + digest_ctx->in_use = true; + digest_ctx->expected_digest = expected_digest; + digest_ctx->expected_digest_length = PSA_HASH_LENGTH(algorithm); + + sink->erase = NULL; + sink->write = write; + sink->seek = NULL; + sink->flush = NULL; + sink->used_storage = NULL; + sink->release = release; + sink->ctx = digest_ctx; + + return SUIT_PLAT_SUCCESS; +} + +digest_sink_err_t suit_digest_sink_digest_match(void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + struct digest_sink_context *digest_ctx = (struct digest_sink_context *)ctx; + + if (!digest_ctx->in_use) { + LOG_ERR("Sink not initialized"); + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + psa_status_t status = psa_hash_verify(&digest_ctx->operation, digest_ctx->expected_digest, + digest_ctx->expected_digest_length); + digest_sink_err_t err = SUIT_PLAT_SUCCESS; + + if (status == PSA_SUCCESS) { + /* Digest calculation successful; expected digest matches calculated one */ + err = SUIT_PLAT_SUCCESS; + } else { + if (status == PSA_ERROR_INVALID_SIGNATURE) { + /* Digest calculation successful but expected digest does not match + * calculated one + */ + err = DIGEST_SINK_ERR_DIGEST_MISMATCH; + } else { + LOG_ERR("psa_hash_verify error: %d", status); + err = SUIT_PLAT_ERR_CRASH; + } + /* In both cases psa_hash_verify enters error state and must be aborted */ + status = psa_hash_abort(&digest_ctx->operation); + if (status != PSA_SUCCESS) { + LOG_ERR("psa_hash_abort error %d", status); + err = SUIT_PLAT_ERR_CRASH; + } + } + + return err; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_extmem_sink.c b/subsys/suit/stream/stream_sinks/src/suit_extmem_sink.c new file mode 100644 index 000000000000..3a94bfc9137e --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_extmem_sink.c @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define SUIT_MAX_EXTMEM_COMPONENTS 1 + +LOG_MODULE_REGISTER(suit_extmem_sink, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t erase(void *ctx); +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size); +static suit_plat_err_t seek(void *ctx, size_t offset); +static suit_plat_err_t used_storage(void *ctx, size_t *size); +static suit_plat_err_t release(void *ctx); + +struct extmem_ctx { + uintptr_t start_offset; + uintptr_t end_offset; + size_t bytes_written; + size_t size; + size_t max_storage_used; + uint8_t *ptr; +}; + +static struct extmem_ctx ctx[SUIT_MAX_EXTMEM_COMPONENTS]; + +SYS_BITARRAY_DEFINE_STATIC(ctx_bitarray, SUIT_MAX_EXTMEM_COMPONENTS); + +/** + * @brief Get the new ctx object + * + * @return struct extmem_ctx* or NULL if no free ctx was found + */ +static struct extmem_ctx *alloc_ctx(void) +{ + size_t offset; + + if (sys_bitarray_alloc(&ctx_bitarray, 1, &offset) < 0) { + return NULL; + } + + return &ctx[offset]; +} + +/** + * @brief Free ctx object + */ +static void free_ctx(struct extmem_ctx *ctx_to_free) +{ + int err; + + err = sys_bitarray_free(&ctx_bitarray, 1, ctx_to_free - ctx); + __ASSERT(err == 0, "Wrong context was freed"); +} + +static bool is_address_supported(uintptr_t address, struct extmem_capabilities *capabilities) +{ + uintptr_t extmem_area_start = capabilities->base_addr; + size_t extmem_area_size = capabilities->capacity; + uintptr_t extmem_area_end = extmem_area_start + extmem_area_size; + + return suit_memory_global_address_range_is_in_external_memory(extmem_area_start, + extmem_area_size); +} + +bool suit_extmem_sink_is_address_supported(uint8_t *address) +{ + struct extmem_capabilities capabilities; + int err; + + if (address == NULL) { + return false; + } + + err = extmem_capabilities_get(&capabilities); + if (err) { + LOG_INF("Extmem remote error %d. External memory not accessible", err); + return false; + } + + return is_address_supported((uintptr_t)address, &capabilities); +} + +suit_plat_err_t suit_extmem_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size) +{ + struct extmem_capabilities capabilities; + int err; + + err = extmem_capabilities_get(&capabilities); + if (err) { + LOG_ERR("Extmem remote error %d. External memory not accessible", err); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + if ((dst != NULL) && (size > 0)) { + struct extmem_ctx *ctx = alloc_ctx(); + uintptr_t start_addr = (uintptr_t)dst; + uintptr_t end_addr = (uintptr_t)dst + size; + + /* Check if requested area fits in external memory area */ + if (!is_address_supported(start_addr, &capabilities) || + !is_address_supported(end_addr, &capabilities)) { + LOG_ERR("Requested memory area (%p) out of bounds", (dst + size)); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + if (ctx != NULL) { + ctx->start_offset = start_addr - capabilities.base_addr; + ctx->end_offset = end_addr - capabilities.base_addr; + ctx->ptr = dst; + ctx->bytes_written = 0; + ctx->size = size; + ctx->max_storage_used = 0; + + sink->erase = erase; + sink->write = write; + sink->seek = seek; + sink->flush = NULL; + sink->used_storage = used_storage; + sink->release = release; + sink->ctx = ctx; + + return SUIT_PLAT_SUCCESS; /* SUCCESS */ + } + + LOG_ERR("ERROR - SUIT_MAX_RAM_COMPONENTS reached."); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t erase(void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; + } + + struct extmem_ctx *extmem_ctx = (struct extmem_ctx *)ctx; + + LOG_DBG("Erasing external memory at offset: %lu size: %u", extmem_ctx->start_offset, + extmem_ctx->size); + int err = extmem_erase(extmem_ctx->start_offset, extmem_ctx->size); + + if (err) { + LOG_ERR("Could not erase external memory: %d", err); + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + if (ctx == NULL || buf == NULL || size == 0) { + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; + } + + struct extmem_ctx *extmem_ctx = (struct extmem_ctx *)ctx; + uintptr_t current_offset = extmem_ctx->start_offset + extmem_ctx->bytes_written; + uintptr_t write_end = current_offset + size; + + if (current_offset >= extmem_ctx->end_offset || write_end > extmem_ctx->end_offset) { + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + LOG_DBG("Writing data at offset: %lu size: %u", current_offset, size); + int err = extmem_write(current_offset, buf, size); + + if (err) { + LOG_ERR("Could not erase external memory: %d", err); + return SUIT_PLAT_ERR_IO; + } + + extmem_ctx->bytes_written += size; + extmem_ctx->max_storage_used = MAX(extmem_ctx->bytes_written, extmem_ctx->max_storage_used); + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t seek(void *ctx, size_t offset) +{ + if (ctx == NULL) { + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; + } + + struct extmem_ctx *extmem_ctx = (struct extmem_ctx *)ctx; + + if (!(extmem_ctx->start_offset <= offset && offset < extmem_ctx->end_offset)) { + LOG_ERR("Offset out of bounds (%lu <= %u < %lu)", extmem_ctx->start_offset, offset, + extmem_ctx->end_offset); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + extmem_ctx->bytes_written = offset; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t used_storage(void *ctx, size_t *size) +{ + if (ctx == NULL || size == NULL) { + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; + } + + struct extmem_ctx *extmem_ctx = (struct extmem_ctx *)ctx; + + *size = extmem_ctx->max_storage_used; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; + } + + free_ctx(ctx); + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_flash_sink.c b/subsys/suit/stream/stream_sinks/src/suit_flash_sink.c new file mode 100644 index 000000000000..c44763ab4a85 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_flash_sink.c @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#define SWAP_BUFFER_SIZE 16 +#define WRITE_OFFSET(a) (a->ptr + a->offset) + +/* Set to more than one to allow multiple contexts in case of parallel execution */ +#define SUIT_MAX_FLASH_COMPONENTS 1 + +#define IS_COND_TRUE(c) ((c) ? "True" : "False") + +LOG_MODULE_REGISTER(suit_flash_sink, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t erase(void *ctx); +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size); +static suit_plat_err_t seek(void *ctx, size_t offset); +static suit_plat_err_t flush(void *ctx); +static suit_plat_err_t used_storage(void *ctx, size_t *size); +static suit_plat_err_t release(void *ctx); + +struct flash_ctx { + size_t size_used; + size_t offset; + size_t offset_limit; + uintptr_t ptr; + const struct device *fdev; + size_t flash_write_size; + bool in_use; +}; + +static struct flash_ctx ctx[SUIT_MAX_FLASH_COMPONENTS]; + +/** + * @brief Get the new, free ctx object + * + * @return struct flash_ctx* or NULL if no free ctx was found + */ +static struct flash_ctx *new_ctx_get(void) +{ + for (size_t i = 0; i < SUIT_MAX_FLASH_COMPONENTS; i++) { + if (!ctx[i].in_use) { + return &ctx[i]; + } + } + + return NULL; /* No free ctx */ +} + +/** + * @brief Register write by updating appropriate offsets and sizes + * + * @param flash_ctx Flash sink context pointer + * @param write_size Size of written data + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +static suit_plat_err_t register_write(struct flash_ctx *flash_ctx, size_t write_size) +{ + flash_ctx->offset += write_size; + + if (flash_ctx->offset > flash_ctx->size_used) { + flash_ctx->size_used = flash_ctx->offset; + } + + return SUIT_PLAT_SUCCESS; +} + +/** + * @brief Get the flash write size for given flash driver + * + * @param fdev Flash driver to get the size from + * @return size_t Write block size retrieved from driver + */ +static size_t flash_write_size_get(const struct device *fdev) +{ + const struct flash_parameters *parameters = flash_get_parameters(fdev); + + return parameters->write_block_size; +} + +bool suit_flash_sink_is_address_supported(uint8_t *address) +{ + if (!suit_memory_global_address_is_in_nvm((uintptr_t)address)) { + LOG_INF("Failed to find nvm area corresponding to address: %p", address); + return false; + } + + return true; +} + +suit_plat_err_t erase(void *ctx) +{ + if (ctx != NULL) { + struct flash_ctx *flash_ctx = (struct flash_ctx *)ctx; + size_t size = flash_ctx->offset_limit - (size_t)flash_ctx->ptr; + + LOG_DBG("flash_sink_init_mem size %u", size); + + /* Erase requested area in preparation for data. */ + int res = flash_erase(flash_ctx->fdev, flash_ctx->ptr, size); + + if (res != 0) { + LOG_ERR("Failed to erase requested memory area: %i", res); + return SUIT_PLAT_ERR_IO; + } + + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_INVAL; +} + +suit_plat_err_t suit_flash_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size) +{ + if ((dst != NULL) && (size > 0) && (sink != NULL)) { + struct flash_ctx *ctx = new_ctx_get(); + + if (ctx != NULL) { + struct nvm_address nvm_address; + + if (!suit_memory_global_address_to_nvm_address((uintptr_t)dst, + &nvm_address)) { + LOG_ERR("Failed to find nvm area corresponding to requested " + "address."); + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + if (!device_is_ready(nvm_address.fdev)) { + LOG_ERR("Flash device not ready."); + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + /* Check if requested area fits in found nvm */ + if (!suit_memory_global_address_range_is_in_nvm((uintptr_t)dst, size)) { + LOG_ERR("Requested memory area out of bounds of corresponding nvm"); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + memset(ctx, 0, sizeof(*ctx)); + ctx->flash_write_size = flash_write_size_get(nvm_address.fdev); + ctx->fdev = nvm_address.fdev; + ctx->offset = 0; + ctx->offset_limit = nvm_address.offset + size; /* max address */ + ctx->size_used = 0; + ctx->ptr = nvm_address.offset; + ctx->in_use = true; + + if (ctx->flash_write_size > SWAP_BUFFER_SIZE) { + + memset(ctx, 0, sizeof(*ctx)); + LOG_ERR("Write block size exceeds set safety limits"); + return SUIT_PLAT_ERR_INVAL; + } + + sink->erase = erase; + sink->write = write; + sink->seek = seek; + sink->flush = flush; + sink->used_storage = used_storage; + sink->release = release; + sink->ctx = ctx; + + return SUIT_PLAT_SUCCESS; /* SUCCESS */ + } + + LOG_ERR("ERROR - SUIT_MAX_FLASH_COMPONENTS reached."); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + LOG_ERR("%s: Invalid arguments: %s, %s, %s", __func__, IS_COND_TRUE(dst != NULL), + IS_COND_TRUE(size > 0), IS_COND_TRUE(sink != NULL)); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t write_unaligned_start(struct flash_ctx *flash_ctx, size_t *size_left, + const uint8_t **buf) +{ + uint8_t edit_buffer[SWAP_BUFFER_SIZE]; + + size_t start_offset = 0; + size_t block_start = 0; + size_t write_size = 0; + + block_start = ((size_t)(WRITE_OFFSET(flash_ctx) / flash_ctx->flash_write_size)) * + flash_ctx->flash_write_size; + start_offset = WRITE_OFFSET(flash_ctx) - block_start; + write_size = 0; + + if (flash_read(flash_ctx->fdev, block_start, edit_buffer, flash_ctx->flash_write_size) != + 0) { + LOG_ERR("Flash read failed."); + return SUIT_PLAT_ERR_IO; + } + + /* write_size - how much data from buf will be written */ + write_size = MIN(*size_left, flash_ctx->flash_write_size - start_offset); + + memcpy(edit_buffer + start_offset, *buf, write_size); + + /* Write back edit_buffer that now contains unaligned bytes from the start of buf */ + if (flash_write(flash_ctx->fdev, block_start, edit_buffer, flash_ctx->flash_write_size) != + 0) { + LOG_ERR("Writing initial unaligned data failed."); + return SUIT_PLAT_ERR_IO; + } + + /* Move offset for bytes written */ + suit_plat_err_t ret = register_write(flash_ctx, write_size); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update size after write"); + return ret; + } + + /* Move input buffer ptr */ + *buf += write_size; + + /* Decrease size by the number of bytes written */ + *size_left -= write_size; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t write_aligned(struct flash_ctx *flash_ctx, size_t *size_left, + const uint8_t **buf, size_t write_size) +{ + size_t block_start = 0; + + /* Write part that is aligned */ + block_start = ((size_t)(WRITE_OFFSET(flash_ctx) / flash_ctx->flash_write_size)) * + flash_ctx->flash_write_size; + + if (flash_write(flash_ctx->fdev, block_start, *buf, write_size) != 0) { + LOG_ERR("Writing aligned blocks failed."); + return SUIT_PLAT_ERR_IO; + } + + write_size = *size_left >= write_size ? write_size : *size_left; + + /* Move offset for bytes written */ + suit_plat_err_t ret = register_write(flash_ctx, write_size); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update size after write"); + return ret; + } + + /* Move input buffer ptr */ + *buf += write_size; + + /* Decrease size by the number of bytes written */ + *size_left -= write_size; + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t write_remaining(struct flash_ctx *flash_ctx, size_t *size_left, + const uint8_t **buf) +{ + uint8_t edit_buffer[SWAP_BUFFER_SIZE]; + size_t block_start = 0; + + /* Write remaining data */ + block_start = ((size_t)(WRITE_OFFSET(flash_ctx) / flash_ctx->flash_write_size)) * + flash_ctx->flash_write_size; + + if (flash_read(flash_ctx->fdev, block_start, edit_buffer, flash_ctx->flash_write_size) == + 0) { + memcpy(edit_buffer, *buf, *size_left); + + /* Write back edit_buffer that now contains unaligned bytes from the start of buf */ + if (flash_write(flash_ctx->fdev, block_start, edit_buffer, + flash_ctx->flash_write_size) != 0) { + LOG_ERR("Writing remaining unaligned data failed."); + return SUIT_PLAT_ERR_IO; + } + + /* Move offset for bytes written */ + suit_plat_err_t ret = register_write(flash_ctx, *size_left); + + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update size after write"); + return ret; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Flash read failed."); + return SUIT_PLAT_ERR_IO; +} + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + size_t size_left = size; + + if ((ctx != NULL) && (buf != NULL) && (size_left > 0)) { + struct flash_ctx *flash_ctx = (struct flash_ctx *)ctx; + + if (!flash_ctx->in_use) { + LOG_ERR("flash_sink not initialized."); + return SUIT_PLAT_ERR_INVAL; + } + + if (flash_ctx->fdev == NULL) { + LOG_ERR("%s: fdev is NULL.", __func__); + return SUIT_PLAT_ERR_INVAL; + } + + if ((flash_ctx->offset_limit - (size_t)flash_ctx->ptr) >= size_left) { + if (flash_ctx->flash_write_size == 1) { + int ret = flash_write(flash_ctx->fdev, WRITE_OFFSET(flash_ctx), buf, + size_left); + + if (ret == 0) { + ret = register_write(flash_ctx, size_left); + if (ret != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to update size after write"); + return ret; + } + } else { + ret = SUIT_PLAT_ERR_IO; + } + + return ret; + } + + size_t write_size = 0; + suit_plat_err_t err = 0; + + if (WRITE_OFFSET(flash_ctx) % flash_ctx->flash_write_size) { + /* Write offset is not aligned with start of block */ + err = write_unaligned_start(flash_ctx, &size_left, &buf); + + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (size_left == 0) { + /* All data written */ + return SUIT_PLAT_SUCCESS; + } + } + + /* Number of bytes to be written in context of whole blocks */ + write_size = (size_left / flash_ctx->flash_write_size) * + flash_ctx->flash_write_size; + + if (write_size > 0) { + err = write_aligned(flash_ctx, &size_left, &buf, write_size); + + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (size_left == 0) { + /* All data written */ + return SUIT_PLAT_SUCCESS; + } + } + + return write_remaining(flash_ctx, &size_left, &buf); + + } else { + LOG_ERR("Write out of bounds."); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + } + + LOG_ERR("%s: Invalid arguments. %s, %s, %s", __func__, IS_COND_TRUE(ctx != NULL), + IS_COND_TRUE(buf != NULL), IS_COND_TRUE(size_left > 0)); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t seek(void *ctx, size_t offset) +{ + if (ctx != NULL) { + struct flash_ctx *flash_ctx = (struct flash_ctx *)ctx; + + if (offset < (flash_ctx->offset_limit - (size_t)flash_ctx->ptr)) { + flash_ctx->offset = offset; + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument - offset value out of range"); + return SUIT_PLAT_ERR_INVAL; + } + + LOG_ERR("%s: Invalid arguments - ctx is NULL", __func__); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t flush(void *ctx) +{ + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t used_storage(void *ctx, size_t *size) +{ + if ((ctx != NULL) && (size != NULL)) { + struct flash_ctx *flash_ctx = (struct flash_ctx *)ctx; + + *size = flash_ctx->size_used; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("%s: Invalid arguments. %s, %s", __func__, IS_COND_TRUE(ctx != NULL), + IS_COND_TRUE(size != NULL)); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx != NULL) { + struct flash_ctx *flash_ctx = (struct flash_ctx *)ctx; + + flash_ctx->offset = 0; + flash_ctx->offset_limit = 0; + flash_ctx->size_used = 0; + flash_ctx->ptr = 0; + flash_ctx->fdev = NULL; + flash_ctx->in_use = false; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("%s: Invalid arguments - ctx is NULL", __func__); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_memptr_sink.c b/subsys/suit/stream/stream_sinks/src/suit_memptr_sink.c new file mode 100644 index 000000000000..4d8cf176bbf9 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_memptr_sink.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +LOG_MODULE_REGISTER(suit_memptr_sink, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size); +static suit_plat_err_t used_storage(void *ctx, size_t *size); + +suit_plat_err_t suit_memptr_sink_get(struct stream_sink *sink, memptr_storage_handle_t handle) +{ + if ((sink != NULL) && (handle != NULL)) { + sink->erase = NULL; + sink->write = write; + sink->seek = NULL; + sink->flush = NULL; + sink->used_storage = used_storage; + sink->release = NULL; + sink->ctx = handle; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +}; + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + suit_memptr_storage_err_t err; + + if ((ctx != NULL) && (buf != NULL) && (size != 0)) { + err = suit_memptr_storage_ptr_store(ctx, buf, size); + if (err != SUIT_PLAT_SUCCESS) { + /* In the current conditions suit_memptr_storage_ptr_store will only + * fail with SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD + */ + return SUIT_PLAT_ERR_NOT_FOUND; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t used_storage(void *ctx, size_t *size) +{ + if ((ctx != NULL) && (size != NULL)) { + const uint8_t *payload_ptr; + size_t payload_size; + + if (suit_memptr_storage_ptr_get(ctx, &payload_ptr, &payload_size) == + SUIT_PLAT_SUCCESS) { + if (payload_ptr != NULL) { + *size = payload_size; + } else { + *size = 0; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Storage get failed"); + return SUIT_PLAT_ERR_NOT_FOUND; + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_ram_sink.c b/subsys/suit/stream/stream_sinks/src/suit_ram_sink.c new file mode 100644 index 000000000000..df741a803053 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_ram_sink.c @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +/* Set to more than one to allow multiple contexts in case of parallel execution */ +#define SUIT_MAX_RAM_COMPONENTS 1 + +LOG_MODULE_REGISTER(suit_ram_sink, CONFIG_SUIT_LOG_LEVEL); + +static suit_plat_err_t erase(void *ctx); +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size); +static suit_plat_err_t seek(void *ctx, size_t offset); +static suit_plat_err_t used_storage(void *ctx, size_t *size); +static suit_plat_err_t release(void *ctx); + +struct ram_ctx { + size_t size_used; + size_t offset; + size_t offset_limit; + uint8_t *ptr; + bool in_use; +}; + +static struct ram_ctx ctx[SUIT_MAX_RAM_COMPONENTS]; + +/** + * @brief Get the new, free ctx object + * + * @return struct ram_ctx* or NULL if no free ctx was found + */ +static struct ram_ctx *get_new_ctx(void) +{ + for (size_t i = 0; i < SUIT_MAX_RAM_COMPONENTS; i++) { + if (!ctx[i].in_use) { + return &ctx[i]; + } + } + + return NULL; /* No free ctx */ +} + +bool suit_ram_sink_is_address_supported(uint8_t *address) +{ + if ((address == NULL) || !suit_memory_global_address_is_in_ram((uintptr_t)address)) { + LOG_INF("Failed to find RAM area corresponding to address: %p", address); + return false; + } + + return true; +} + +suit_plat_err_t suit_ram_sink_get(struct stream_sink *sink, uint8_t *dst, size_t size) +{ + if ((dst != NULL) && (size > 0)) { + struct ram_ctx *ctx = get_new_ctx(); + + /* Check if requested area fits in found RAM */ + if (!suit_memory_global_address_range_is_in_ram((uintptr_t)dst, size)) { + LOG_ERR("Requested memory area (%p) is not within RAM", (void *)dst); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + if (ctx != NULL) { + ctx->offset = 0; + ctx->offset_limit = (size_t)dst + size; + ctx->size_used = 0; + ctx->ptr = dst; + ctx->in_use = true; + + sink->erase = erase; + sink->write = write; + sink->seek = seek; + sink->flush = NULL; + sink->used_storage = used_storage; + sink->release = release; + sink->ctx = ctx; + + return SUIT_PLAT_SUCCESS; /* SUCCESS */ + } + + LOG_ERR("ERROR - SUIT_MAX_RAM_COMPONENTS reached."); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t erase(void *ctx) +{ + if (ctx != NULL) { + struct ram_ctx *ram_ctx = (struct ram_ctx *)ctx; + size_t size = ram_ctx->offset_limit - (size_t)ram_ctx->ptr; + + uint8_t *dst = (uint8_t *)suit_memory_global_address_to_ram_address( + (uintptr_t)ram_ctx->ptr); + + if (dst == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + memset(dst, 0, size); + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + if ((ctx != NULL) && (buf != NULL) && (size > 0)) { + struct ram_ctx *ram_ctx = (struct ram_ctx *)ctx; + + if ((ram_ctx->offset_limit - (size_t)ram_ctx->ptr) >= size) { + uint8_t *dst = (uint8_t *)suit_memory_global_address_to_ram_address( + (uintptr_t)ram_ctx->ptr); + + if (dst == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + memcpy(dst, buf, size); + ram_ctx->offset += size; + + if (ram_ctx->offset > ram_ctx->size_used) { + ram_ctx->size_used = ram_ctx->offset; + } + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Write out of bounds."); + return SUIT_PLAT_ERR_OUT_OF_BOUNDS; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t seek(void *ctx, size_t offset) +{ + if (ctx != NULL) { + struct ram_ctx *ram_ctx = (struct ram_ctx *)ctx; + + if (offset < (ram_ctx->offset_limit - (size_t)ram_ctx->ptr)) { + ram_ctx->offset = offset; + return SUIT_PLAT_SUCCESS; + } + } + + LOG_ERR("Invalid argument."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t used_storage(void *ctx, size_t *size) +{ + if ((ctx != NULL) && (size != NULL)) { + struct ram_ctx *ram_ctx = (struct ram_ctx *)ctx; + + *size = ram_ctx->offset; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx != NULL) { + struct ram_ctx *ram_ctx = (struct ram_ctx *)ctx; + + ram_ctx->offset = 0; + ram_ctx->offset_limit = 0; + ram_ctx->size_used = 0; + ram_ctx->ptr = NULL; + ram_ctx->in_use = false; + + return SUIT_PLAT_SUCCESS; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sinks/src/suit_sdfw_sink.c b/subsys/suit/stream/stream_sinks/src/suit_sdfw_sink.c new file mode 100644 index 000000000000..529ea03ba812 --- /dev/null +++ b/subsys/suit/stream/stream_sinks/src/suit_sdfw_sink.c @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define SUIT_MAX_SDFW_COMPONENTS 1 + +#define SDFW_SINK_ERR_AGAIN 1 /* Reboot is needed before proceeding. Call the API again. */ + +LOG_MODULE_REGISTER(suit_sdfw_sink, CONFIG_SUIT_LOG_LEVEL); + +typedef int sdf_sink_err_t; + +struct sdfw_sink_context { + bool in_use; + bool write_called; +}; + +static struct sdfw_sink_context sdfw_contexts[SUIT_MAX_SDFW_COMPONENTS]; + +static struct sdfw_sink_context *get_new_context(void) +{ + for (size_t i = 0; i < SUIT_MAX_SDFW_COMPONENTS; ++i) { + if (!sdfw_contexts[i].in_use) { + return &sdfw_contexts[i]; + } + } + + return NULL; +} + +static digest_sink_err_t verify_digest(uint8_t *buf, size_t buf_size, psa_algorithm_t algorithm, + uint8_t *expected_digest) +{ + struct stream_sink digest_sink; + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, algorithm, expected_digest); + + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to get digest sink: %d", err); + return err; + } + + err = digest_sink.write(digest_sink.ctx, buf, buf_size); + if (err != SUIT_PLAT_SUCCESS) { + LOG_ERR("Failed to write to stream: %d", err); + return err; + } + + digest_sink_err_t ret = suit_digest_sink_digest_match(digest_sink.ctx); + + err = digest_sink.release(digest_sink.ctx); + if (err != SUIT_PLAT_SUCCESS) { + LOG_WRN("Failed to release stream: %d", err); + } + + return ret; +} + +static suit_plat_err_t clear_urot_update_status(void) +{ + mram_erase((uintptr_t)&NRF_SICR->UROT.UPDATE, + sizeof(NRF_SICR->UROT.UPDATE) / CONFIG_SDFW_MRAM_WORD_SIZE); + + /* Clearing the registers is crucial for correct handling by SecROM. */ + /* Incorrect mram_erase behavior was observed on FPGA. */ + /* Since mram_erase returns void, there is a need for extra check and returning error code + * to handle such case. + */ + if (NRF_SICR->UROT.UPDATE.STATUS == SICR_UROT_UPDATE_STATUS_CODE_None && + NRF_SICR->UROT.UPDATE.OPERATION == SICR_UROT_UPDATE_OPERATION_OPCODE_Nop) { + return SUIT_PLAT_SUCCESS; + } else { + return SUIT_PLAT_ERR_IO; + } +} + +static suit_plat_err_t schedule_sdfw_update(const uint8_t *buf, size_t size) +{ + int err = 0; + + const struct sdfw_update_blob update_blob = { + .manifest_addr = (uintptr_t)(buf + CONFIG_SUIT_SDFW_UPDATE_SIGNED_MANIFEST_OFFSET), + .pubkey_addr = (uintptr_t)(buf + CONFIG_SUIT_SDFW_UPDATE_PUBLIC_KEY_OFFSET), + .signature_addr = (uintptr_t)(buf + CONFIG_SUIT_SDFW_UPDATE_SIGNATURE_OFFSET), + .firmware_addr = (uintptr_t)(buf + CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET), + .max_size = CONFIG_SUIT_SDFW_UPDATE_MAX_SIZE, + }; + + LOG_DBG("update_candidate: 0x%08lX", (uintptr_t)buf); + LOG_DBG("signed_manifest: 0x%08lX", update_blob.manifest_addr); + LOG_DBG("public_key: 0x%08lX", update_blob.pubkey_addr); + LOG_DBG("signature: 0x%08lX", update_blob.signature_addr); + LOG_DBG("firmware: 0x%08lX", update_blob.firmware_addr); + LOG_DBG("max update size: 0x%08X", update_blob.max_size); + LOG_DBG("firmware size: 0x%08X (%d)", size, size); + + /* NOTE: SecROM does not use the actual size of new SDFW during update process. + * However, if SDFW is flashed for the first time, the value is used to limit the + * future maximum SDFW size. Hence, use the maximum allowed size for safety. + */ + err = sdfw_update(&update_blob); + + if (err) { + LOG_ERR("Failed to schedule SDFW update: %d", err); + return SUIT_PLAT_ERR_CRASH; + } + + LOG_INF("SDFW update scheduled"); + + return SUIT_PLAT_SUCCESS; +} + +static sdf_sink_err_t check_update_candidate(const uint8_t *buf, size_t size) +{ + uint8_t *candidate_binary_start = + (uint8_t *)(buf + CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET); + uint8_t *candidate_digest_in_manifest = + (uint8_t *)(buf + CONFIG_SUIT_SDFW_UPDATE_DIGEST_OFFSET); + uint8_t *current_sdfw_digest = (uint8_t *)(NRF_SICR->UROT.SM.TBS.FW.DIGEST); + + /* First check if calculated digest of candidate matches the digest from Signed Manifest */ + digest_sink_err_t err = verify_digest( + candidate_binary_start, size - (size_t)CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET, + PSA_ALG_SHA_512, candidate_digest_in_manifest); + + if (err != SUIT_PLAT_SUCCESS) { + if (err == DIGEST_SINK_ERR_DIGEST_MISMATCH) { + LOG_ERR("Candidate inconsistent"); + } else { + LOG_ERR("Failed to calculate digest: %d", err); + } + + return SUIT_PLAT_ERR_CRASH; + } + + LOG_DBG("Candidate consistent"); + + /* Then compare candidate's digest with current SDFW digest */ + err = verify_digest(candidate_binary_start, + size - (size_t)CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET, PSA_ALG_SHA_512, + current_sdfw_digest); + if (err == SUIT_PLAT_SUCCESS) { + LOG_INF("Same candidate - skip update"); + return SUIT_PLAT_SUCCESS; + } else if (err == DIGEST_SINK_ERR_DIGEST_MISMATCH) { + LOG_INF("Different candidate"); + err = schedule_sdfw_update(buf, size); + if (err == SUIT_PLAT_SUCCESS) { + LOG_DBG("Update scheduled"); + err = SDFW_SINK_ERR_AGAIN; + } + return err; + } + + LOG_ERR("Failed to calculate digest: %d", err); + return SUIT_PLAT_ERR_CRASH; +} + +static void reboot_to_continue(void) +{ + if (IS_ENABLED(CONFIG_SUIT_UPDATE_REBOOT_ENABLED)) { + LOG_INF("Reboot the system to continue SDFW update"); + + LOG_PANIC(); + + sys_reboot(SYS_REBOOT_COLD); + } else { + LOG_DBG("Reboot disabled - perform manually"); + } +} + +static suit_plat_err_t check_urot_none(const uint8_t *buf, size_t size) +{ + /* Detect update candidate. */ + /* It is enough to check Public Key Size field which occupies first 4B of Signed Manifest. + */ + if (*((uint32_t *)buf) == EMPTY_STORAGE_VALUE) { + LOG_INF("Update candidate not found"); + return SUIT_PLAT_ERR_NOT_FOUND; + } + + LOG_INF("Update candidate found"); + + suit_plat_err_t err = check_update_candidate(buf, size); + + if (err == SDFW_SINK_ERR_AGAIN) { + /* Update scheduled, continue after reboot */ + reboot_to_continue(); + if (IS_ENABLED(CONFIG_SUIT_UPDATE_REBOOT_ENABLED)) { + /* If this code is reached, it means that reboot did not work. */ + /* In such case report an error and convert the error code. */ + LOG_ERR("Expected reboot did not happen"); + err = SUIT_PLAT_ERR_UNREACHABLE_PATH; + } + } + + return err; +} + +static suit_plat_err_t check_urot_activated(const uint8_t *buf, size_t size) +{ + uint8_t *candidate_binary_start = + (uint8_t *)(buf + CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET); + uint8_t *current_sdfw_digest = (uint8_t *)(NRF_SICR->UROT.SM.TBS.FW.DIGEST); + + /* Compare candidate's digest with current SDFW digest */ + digest_sink_err_t err = verify_digest( + candidate_binary_start, size - (size_t)CONFIG_SUIT_SDFW_UPDATE_FIRMWARE_OFFSET, + PSA_ALG_SHA_512, current_sdfw_digest); + if (err != SUIT_PLAT_SUCCESS) { + if (err == DIGEST_SINK_ERR_DIGEST_MISMATCH) { + LOG_ERR("Digest mismatch - update failure"); + return SUIT_PLAT_ERR_AUTHENTICATION; + } + + LOG_ERR("Failed to calculate digest: %d", err); + return SUIT_PLAT_ERR_CRASH; + } + + LOG_DBG("Digest match - update success"); + return SUIT_PLAT_SUCCESS; +} + +/* NOTE: Size means size of the SDFW binary to be updated, + * excluding Signed Manifest preceding it within update candidate + */ +static suit_plat_err_t write(void *ctx, const uint8_t *buf, size_t size) +{ + if (NULL == ctx || NULL == buf || 0 == size) { + LOG_ERR("NULL argument"); + return SUIT_PLAT_ERR_INVAL; + } + + LOG_DBG("buf: %p", (void *)buf); + LOG_DBG("size: %d", size); + + struct sdfw_sink_context *context = (struct sdfw_sink_context *)ctx; + + if (context->write_called) { + LOG_ERR("Multiple write calls not allowed"); + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + context->write_called = true; + + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + bool clear_registers = true; + + switch (NRF_SICR->UROT.UPDATE.STATUS) { + case SICR_UROT_UPDATE_STATUS_CODE_None: { + err = check_urot_none(buf, size); + /* Potential start of update process - SecROM needs the registers to be set */ + clear_registers = false; + break; + } + + case SICR_UROT_UPDATE_STATUS_CODE_UROTActivated: { + err = check_urot_activated(buf, size); + clear_registers = true; + break; + } + + case SICR_UROT_UPDATE_STATUS_CODE_VerifyOK: + case SICR_UROT_UPDATE_STATUS_CODE_RecoveryActivated: + case SICR_UROT_UPDATE_STATUS_CODE_AROTRecovery: { + LOG_ERR("Unsupported UROT update status: 0x%08X", NRF_SICR->UROT.UPDATE.STATUS); + err = SUIT_PLAT_ERR_INCORRECT_STATE; + clear_registers = true; + break; + } + + default: { + LOG_ERR("SDFW update failure: 0x%08X", NRF_SICR->UROT.UPDATE.STATUS); + err = NRF_SICR->UROT.UPDATE.STATUS; + clear_registers = true; + break; + } + } + + if (clear_registers) { + suit_plat_err_t clear_err = clear_urot_update_status(); + + if (clear_err) { + LOG_ERR("Failed to clear UROT update status"); + /* If the only error was during register clearing - report it. */ + /* Otherwise report the original cause of failure. */ + if (err == SUIT_PLAT_SUCCESS) { + err = clear_err; + } + } else { + LOG_DBG("UROT update status cleared"); + } + } + + return err; +} + +static suit_plat_err_t release(void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("Invalid argument"); + return SUIT_PLAT_ERR_INVAL; + } + + struct sdfw_sink_context *context = (struct sdfw_sink_context *)ctx; + + memset(context, 0, sizeof(struct sdfw_sink_context)); + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_sdfw_sink_get(struct stream_sink *sink) +{ + if (sink == NULL) { + LOG_ERR("Invalid arguments"); + return SUIT_PLAT_ERR_INVAL; + } + + struct sdfw_sink_context *ctx = get_new_context(); + + if (ctx == NULL) { + LOG_ERR("Failed to get a new context"); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + memset((void *)ctx, 0, sizeof(struct sdfw_sink_context)); + ctx->in_use = true; + ctx->write_called = false; + + sink->erase = NULL; + sink->write = write; + sink->seek = NULL; + sink->flush = NULL; + sink->used_storage = NULL; + sink->release = release; + sink->ctx = ctx; + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/stream/stream_sources/CMakeLists.txt b/subsys/suit/stream/stream_sources/CMakeLists.txt new file mode 100644 index 000000000000..7f89782ef45f --- /dev/null +++ b/subsys/suit/stream/stream_sources/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_interface_library_named(suit_stream_sources_interface) +target_include_directories(suit_stream_sources_interface INTERFACE include) +target_link_libraries(suit_stream_sources_interface INTERFACE suit_platform_err) +target_link_libraries(suit_stream_sources_interface INTERFACE suit_stream_sinks_interface) + +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SOURCE_CACHE src/suit_dfu_cache_streamer.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SOURCE_MEMPTR src/suit_memptr_streamer.c) + +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_IPC_REQUESTOR src/suit_ipc_streamer_requestor.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_IPC_PROVIDER src/suit_ipc_streamer_provider.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR src/suit_fetch_source_mgr.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SOURCE_EXTMEM src/suit_extmem_streamer.c) +zephyr_library_sources_ifdef(CONFIG_SUIT_STREAM_SOURCE_FLASH src/suit_flash_streamer.c) +zephyr_library_sources(src/suit_generic_address_streamer.c) + +zephyr_library_link_libraries(suit_stream_sources_interface) +zephyr_library_link_libraries(suit_memory_layout_interface) +zephyr_library_link_libraries(suit_source_selector_interface) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_SOURCE_CACHE suit_cache_interface) diff --git a/subsys/suit/stream/stream_sources/include/suit_dfu_cache_streamer.h b/subsys/suit/stream/stream_sources/include/suit_dfu_cache_streamer.h new file mode 100644 index 000000000000..8805b208d383 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_dfu_cache_streamer.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef CACHE_FETCH_H__ +#define CACHE_FETCH_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Stream payload from cache to sink + * + * @param cache Pointer to SUIT cache + * @param uri URI to be found in cache - source + * @param uri_size Uri size + * @param sink Pointer to sink that will write payload - target + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_dfu_cache_streamer_stream(const uint8_t *uri, size_t uri_size, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* CACHE_FETCH_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_extmem_streamer.h b/subsys/suit/stream/stream_sources/include/suit_extmem_streamer.h new file mode 100644 index 000000000000..2dc93b15ceb7 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_extmem_streamer.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef EXTMEM_STREAMER_H__ +#define EXTMEM_STREAMER_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Check if address can be be used as a source address for streaming from external memory. + * + * @param address Pointer to the streamable payload + * + * @return True if data under the address can be streamed from external memory, false otherwise. + */ +bool suit_extmem_streamer_address_in_range(const uint8_t *address); + +/** + * @brief Stream payload from pointer to sink + * + * @param payload Pointer to the streamable payload + * @param payload_size Size of the payload + * @param sink Pointer to sink to write the data to + * + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_extmem_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* EXTMEM_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_fetch_source_streamer.h b/subsys/suit/stream/stream_sources/include/suit_fetch_source_streamer.h new file mode 100644 index 000000000000..881b7a0d98fd --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_fetch_source_streamer.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef FETCH_SOURCE_STREAMER_H__ +#define FETCH_SOURCE_STREAMER_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Streams an image from source to sink + * + * @param[in] resource_id Resource identifier, typically in form of URI. + * + * @param[in] resource_id_length Length of resource_id, in bytes + * + * @param[in] sink Function pointers to pass image chunk to next chunk + *processing element. Non-'null' write_ptr is always required. Non-'null' seek_ptr may be required + *by selected fetch sources + * + * @return SUIT_PLAT_SUCCESS on success, error code otherwise + */ +suit_plat_err_t suit_fetch_source_stream(const uint8_t *resource_id, size_t resource_id_length, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* FETCH_SOURCE_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_flash_streamer.h b/subsys/suit/stream/stream_sources/include/suit_flash_streamer.h new file mode 100644 index 000000000000..e92d0f2a86d8 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_flash_streamer.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef FLASH_STREAMER_H__ +#define FLASH_STREAMER_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Check if address can be streamed from flash memory. + * + * @param address Pointer to the streamable payload + * + * @return True if address can be streamed from flash memory, false otherwise. + */ +bool suit_flash_streamer_address_in_range(const uint8_t *address); + +/** + * @brief Stream payload from pointer to sink + * + * @param payload Pointer to the streamable payload + * @param payload_size Size of the payload + * @param sink Pointer to sink to write the data to + * + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_flash_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* FLASH_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_generic_address_streamer.h b/subsys/suit/stream/stream_sources/include/suit_generic_address_streamer.h new file mode 100644 index 000000000000..98b759563479 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_generic_address_streamer.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef GENERIC_ADDRESS_STREAMER_H__ +#define GENERIC_ADDRESS_STREAMER_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Stream payload from pointer to sink + * + * @param payload Pointer to payload - source + * @param payload_size Size of payload + * @param sink Pointer to sink that will write payload - target + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_generic_address_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* GENERIC_ADDRESS_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_ipc_streamer.h b/subsys/suit/stream/stream_sources/include/suit_ipc_streamer.h new file mode 100644 index 000000000000..af7604a923f2 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_ipc_streamer.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef IPC_STREAMER_H__ +#define IPC_STREAMER_H__ + +/* + * SDFW (Secure Domain Firmware) is unable to fetch images from external sources on its own. + * Instead - it is able to invoke companion image(s) on MCU(s) belonging to other domain(s), + * typically Application MCU. Such companion image contains instructions to fetch required + * image from image source and deliver it to SDFW via IPC (Inter-processor communication) + * in form of image chunks. + * + * Implementation choice about supported protocols (i.e. http, ftp) is delegated out of SDFW, + * allowing to keep SDFW image size and security risks manageable. + * + * Solution is composed of two parts - ipc streamer requestor executed on Secure Domain MCU and + * ipc streamer provider executed on local Domain MCU, typically Application Domain + * + * Once image chunk is delivered to streamer requestor, information about chunk is enqueued + * for future processing. This enables simultonous processing (i.e. writing to NVM) of previously + * obtained chunk by the streamer requestor and preparing (i.e. receiving) new chunk + * by the streamer provider + */ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Provided by streamer requestor to its clients, i.e. SUIT fetch directive implementation. + * Streams an image from source to sink + * + * @param[in] resource_id Resource identifier, typically in form of URI. Not + *interpreted by streamer requestor but just passed to streamer provider + * + * @param[in] resource_id_length Length of resource_id, in bytes + * + * @param[in] sink Function pointers to pass image chunk to next chunk + *processing element. Non-'null' write_ptr is always required. Non-'null' seek_ptr is required if + *streamer provider delivers image in non-continuous chunks. In event of failure of any sink-related + *operations suit_ipc_streamer_stream will fail as well. + * + * @param[in] inter_chunk_timeout_ms Function will fail (timeout) in case of streamer provider + *inactivity period longer then this parameter value + * + * @param[in] requesting_period_ms streamer requestor will notify streamer provider + *periodically about pending image request. It will do this till first response from streamer + *provider or till inter-chunk timeout is triggered. + * + * @return SUIT_PLAT_SUCCESS on success + * SUIT_PLAT_ERR_NOMEM not enough resources to open new session + * SUIT_PLAT_ERR_CRASH one of sink operations, i.e. write, seek, failed + * SUIT_PLAT_ERR_TIME timeout error. streamer provider did not respond or stopped + *to respond + */ +suit_plat_err_t suit_ipc_streamer_stream(const uint8_t *resource_id, size_t resource_id_length, + struct stream_sink *sink, uint32_t inter_chunk_timeout_ms, + uint32_t requesting_period_ms); + +/** + * @brief Initialization function for streamer requestor (when executed in SDFW) or streamer + * requestor proxy (when executed on local Domain MCU). In case of execution on local Domain MCU - + * It is called directly from suit_ipc_streamer_provider_init implementation. + * + * @return SUIT_PLAT_SUCCESS on success, error code in case of failure + */ +suit_plat_err_t suit_ipc_streamer_requestor_init(void); + +/** + * @brief Initialization function for streamer provider. + * + * @return SUIT_PLAT_SUCCESS on success, error code in case of failure + */ +suit_plat_err_t suit_ipc_streamer_provider_init(void); + +typedef enum { + PENDING = 0, + PROCESSED = 1, + REFUSED = 2 +} suit_ipc_streamer_chunk_status_t; + +typedef struct { + uint32_t chunk_id; + suit_ipc_streamer_chunk_status_t status; + +} suit_ipc_streamer_chunk_info_t; + +/** + * @brief Enqueues image chunk for future processing. Implemented by streamer requestor and exposed + *as streamer requestor proxy to local Domain MCU. Attention! Return code SUIT_PLAT_ERR_BUSY + *does not mean irrecoverable failure. One of chunks will eventually be processed by streamer + *requestor and necessary space will be reclaimed + * + * + * @param[in] stream_session_id Session identifier - see + *suit_ipc_streamer_missing_image_notify_fn + * + * @param[in] chunk_id Chunk identifier assigned by streamer provider, not + *interpreted by streamer requestor, but provided back as output of + *suit_ipc_streamer_chunk_status_req + *Non-zero value assigned by streamer provider, unique for chunk in space of stream_session_id. It + *is utilized by streamer provider for buffer mananagment. + * + * @param[in] offset Chunk offset in image. + * + * @param[in] address Location of memory buffer where image chunk is stored. Once + *passed to streamer requestor + * - its content shall not be modified by streamer provider + *till the end of processing by streamer requestor. See suit_ipc_streamer_chunk_status_req. + *It is allowed *to pass 'null' address and 0 bytes size, to signalize seeking operation or + *to report end of stream. + * + * @param[in] size Size of image chunk, in bytes + * + * @param[in] last_chunk 'true' signalizes end of stream. Once end of stream is + *signalized - streamer requestor will not accept any new chunks. It will process remaining enqueued + *chunks and close session + * + * @return SUIT_PLAT_SUCCESS on success + * SUIT_PLAT_ERR_INVAL invalid parameter + * SUIT_PLAT_ERR_INCORRECT_STATE there is no open session identified by + * stream_session_id or session is closing, and another chunk cannot be accepted + * SUIT_PLAT_ERR_BUSY not enough space to enqueue this chunk. Try again later + */ +suit_plat_err_t suit_ipc_streamer_chunk_enqueue(uint32_t stream_session_id, uint32_t chunk_id, + uint32_t offset, uint8_t *address, uint32_t size, + bool last_chunk); + +/** + * @brief Returns information about chunks enqueued by streamer requestor. Implemented by streamer + *requestor and exposed as streamer requestor proxy to local Domain MCU. Attention! Return code + *SUIT_PLAT_ERR_BUSY does not mean irrecoverable failure. Every execution of this function + *causes that streamer requestor releases information about 'PROCESSED' or 'REFUSED' chunks, so + *function will succeed eventually. + * + * @param[in] stream_session_id Session identifier - see + *suit_ipc_streamer_missing_image_notify_fn + * + * @param[out] chunk_info An array, holding information about chunks enqueued by + *streamer requestor. At time when chunk is passed to streamer requestor - see + *suit_ipc_streamer_chunk_enqueue, its status is set to 'PENDING' + *- see suit_ipc_streamer_chunk_status_t. + *Once *chunk processing is completed, its status is set to 'PROCESSED' or 'REFUSED' based on + *processing results. + * + * + * @param[in,out] chunk_info_count as input - maximal amount of elements an chunk_info array + *can hold, as output - amount of stored elements + * + * + * @retval SUIT_PLAT_SUCCESS on success + * @retval SUIT_PLAT_ERR_INVAL invalid parameter, i.e. null pointer + * @retval SUIT_PLAT_ERR_INCORRECT_STATE there is no open session identified by stream_session_id + * @retval SUIT_PLAT_ERR_BUSY chunk_info array is too small + * + */ +suit_plat_err_t suit_ipc_streamer_chunk_status_req(uint32_t stream_session_id, + suit_ipc_streamer_chunk_info_t *chunk_info, + size_t *chunk_info_count); + +/** + * @brief Chunk status update notification function prototype + * + * @param[in] stream_session_id Session identifier. Non-zero value assigned by streamer + *requestor, unique for image request. + * + * @param[in] context parameter of suit_ipc_streamer_chunk_status_evt_subscribe + *provided by streamer requestor or streamer requestor proxy + * + * @return SUIT_PLAT_ERR_INCORRECT_STATE on success, error code in case of failure + */ +typedef suit_plat_err_t (*suit_ipc_streamer_chunk_status_notify_fn)(uint32_t stream_session_id, + void *context); + +/** + * @brief Registers chunk status update notification function. Implemented individually by streamer + *requestor and streamer requestor proxy. + * + * @param[in] notify_fn see suit_ipc_streamer_chunk_status_notify_fn + * + * @param[in] context parameter not interpreted by streamer requestor or streamer + *requestor proxy, provided back to suit_ipc_streamer_chunk_status_notify_fn + * + * @return SUIT_PLAT_SUCCESS on success, + * SUIT_PLAT_ERR_NOMEM not enough space to register another notification function + * + */ +suit_plat_err_t suit_ipc_streamer_chunk_status_evt_subscribe( + suit_ipc_streamer_chunk_status_notify_fn notify_fn, + void *context); + +/** + * @brief Unregisters chunk status update notification function. Implemented individually by + * streamer requestor and streamer requestor proxy. + * + */ +void suit_ipc_streamer_chunk_status_evt_unsubscribe(void); + +/** + * @brief Missing image notification function prototype + * + * @param[in] resource_id requested resource identifier, typically URI. See + *suit_ipc_streamer_stream + * + * @param[in] resource_id_length Length of resource_id, in bytes + * + * @param[in] stream_session_id Session identifier. Non-zero value assigned by streamer + *requestor, unique for image request, as result of suit_ipc_streamer_stream call + * + * @param[in] context parameter of suit_ipc_streamer_missing_image_evt_subscribe + *provided by streamer requestor or streamer requestor proxy + * + * @return SUIT_PLAT_SUCCESS on success, error code in case of failure + */ +typedef suit_plat_err_t (*suit_ipc_streamer_missing_image_notify_fn)(const uint8_t *resource_id, + size_t resource_id_length, + uint32_t stream_session_id, + void *context); + +/** + * @brief Registers missing image notification function. Implemented individually by streamer + *requestor and streamer requestor proxy. + * + * @param[in] notify_fn see suit_ipc_streamer_missing_image_notify_fn + * + * @param[in] context parameter not interpreted by streamer requestor or streamer + *requestor proxy, provided back to suit_ipc_streamer_missing_image_notify_fn + * + * @return SUIT_PLAT_SUCCESS on success, + * SUIT_PLAT_ERR_NOMEM not enough space to register another notification function + * + */ +suit_plat_err_t suit_ipc_streamer_missing_image_evt_subscribe( + suit_ipc_streamer_missing_image_notify_fn notify_fn, + void *context); + +/** + * @brief Unregisters missing image notification function. Implemented individually by streamer + * requestor and streamer requestor proxy. + * + */ +void suit_ipc_streamer_missing_image_evt_unsubscribe(void); + +#ifdef __cplusplus +} +#endif + +#endif /* IPC_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/include/suit_memptr_streamer.h b/subsys/suit/stream/stream_sources/include/suit_memptr_streamer.h new file mode 100644 index 000000000000..f1ed1d0b9dd6 --- /dev/null +++ b/subsys/suit/stream/stream_sources/include/suit_memptr_streamer.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MEMPTR_STREAMER_H__ +#define MEMPTR_STREAMER_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Check if address can be streamed from readable memory. + * + * @param address Pointer to the payload + * + * @return True if address can be read from memory, false otherwise. + */ +bool suit_memptr_streamer_address_in_range(const uint8_t *address); + +/** + * @brief Stream payload from pointer to sink + * + * @param payload Pointer to payload - source + * @param payload_size Size of payload + * @param sink Pointer to sink that will write payload - target + * @return SUIT_PLAT_SUCCESS if success otherwise error code + */ +suit_plat_err_t suit_memptr_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink); + +#ifdef __cplusplus +} +#endif + +#endif /* MEMPTR_STREAMER_H__ */ diff --git a/subsys/suit/stream/stream_sources/src/suit_dfu_cache_streamer.c b/subsys/suit/stream/stream_sources/src/suit_dfu_cache_streamer.c new file mode 100644 index 000000000000..39f6bc290e7c --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_dfu_cache_streamer.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(dfu_cache_streamer, CONFIG_SUIT_LOG_LEVEL); + +suit_plat_err_t suit_dfu_cache_streamer_stream(const uint8_t *uri, size_t uri_size, + struct stream_sink *sink) +{ + LOG_HEXDUMP_DBG(uri, uri_size, "Running suit_dfu_cache_streamer_stream function"); + if ((uri != NULL) && (sink != NULL) && (sink->write != NULL) && (uri_size > 0)) { + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + const uint8_t *payload = NULL; + size_t payload_size = 0; + + err = suit_dfu_cache_search(uri, uri_size, &payload, &payload_size); + + if (err == SUIT_PLAT_SUCCESS) { + return sink->write(sink->ctx, payload, payload_size); + } + + return SUIT_PLAT_ERR_NOT_FOUND; + } + + LOG_ERR("Invalid arguments."); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_extmem_streamer.c b/subsys/suit/stream/stream_sources/src/suit_extmem_streamer.c new file mode 100644 index 000000000000..ea537ecc8cfa --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_extmem_streamer.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_extmem_streamer, CONFIG_SUIT_LOG_LEVEL); + +struct extmem_streamer_ctx { + struct stream_sink *sink; + suit_plat_err_t result; +}; + +static void read_cb(void *data, uintptr_t offset, size_t data_size, void *ctx) +{ + if (ctx == NULL) { + LOG_ERR("read_cb failed: ctx == NULL"); + return; + } + + struct extmem_streamer_ctx *extmem_ctx = ctx; + struct stream_sink *sink = extmem_ctx->sink; + + if (extmem_ctx->result != SUIT_PLAT_SUCCESS) { + LOG_ERR("Write skipped due to previous errors"); + return; + } + + extmem_ctx->result = sink->write(sink->ctx, data, data_size); + + if (extmem_ctx->result != SUIT_PLAT_SUCCESS) { + LOG_ERR("Sink error: %d", extmem_ctx->result); + } +} + +static bool is_address_supported(uintptr_t address, struct extmem_capabilities *capabilities) +{ + if (!suit_memory_global_address_range_is_in_external_memory(capabilities->base_addr, + capabilities->capacity) || + !suit_memory_global_address_is_in_external_memory(address)) { + LOG_INF("Address does not belong to extmem area: %p", (void *)address); + return false; + } + + return true; +} + +bool suit_extmem_streamer_address_in_range(const uint8_t *address) +{ + struct extmem_capabilities capabilities; + + int err = extmem_capabilities_get(&capabilities); + + if (err != EXTMEM_RESULT_SUCCESS) { + return false; + } + + return is_address_supported((uintptr_t)address, &capabilities); +} + +suit_plat_err_t suit_extmem_streamer_stream(const uint8_t *payload, + size_t payload_size, + struct stream_sink *sink) +{ + struct extmem_capabilities capabilities; + + int err = extmem_capabilities_get(&capabilities); + + if (err != EXTMEM_RESULT_SUCCESS) { + return SUIT_PLAT_ERR_IO; + } + + uintptr_t offset = (uintptr_t)payload - capabilities.base_addr; + + if ((payload != NULL) && (sink != NULL) && (sink->write != NULL) && (payload_size > 0)) { + struct extmem_streamer_ctx ctx = { + .sink = sink, + .result = SUIT_PLAT_SUCCESS, + }; + + int ret = extmem_read(offset, payload_size, read_cb, &ctx); + + if (ret != EXTMEM_RESULT_SUCCESS) { + LOG_ERR("Read from external memory failed: %d", ret); + return SUIT_PLAT_ERR_IO; + } + + return ctx.result; + } + + LOG_ERR("Invalid arguments"); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_fetch_source_mgr.c b/subsys/suit/stream/stream_sources/src/suit_fetch_source_mgr.c new file mode 100644 index 000000000000..61a508200e49 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_fetch_source_mgr.c @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include "suit_fetch_source_streamer.h" +#include +#include +#include + +typedef enum { + STAGE_IDLE, + STAGE_PENDING_FIRST_RESPONSE, + STAGE_IN_PROGRESS +} session_stage_t; + +typedef struct { + suit_dfu_fetch_source_request_fn request_fn; +} fetch_source_t; + +typedef struct { + session_stage_t stage; + struct stream_sink client_sink; + uint32_t session_id; + +} stream_session_t; + +static stream_session_t stream_session = {.stage = STAGE_IDLE}; + +static fetch_source_t sources[CONFIG_SUIT_STREAM_FETCH_MAX_SOURCES] = {0}; + +static uint32_t last_used_session_id; + +static K_MUTEX_DEFINE(component_state_mutex); + +static inline void component_lock(void) +{ + k_mutex_lock(&component_state_mutex, K_FOREVER); +} + +static inline void component_unlock(void) +{ + k_mutex_unlock(&component_state_mutex); +} + +static inline stream_session_t *open_session(const uint8_t *uri, size_t uri_length, + struct stream_sink *sink) +{ + component_lock(); + stream_session_t *session = &stream_session; + + if (session->stage != STAGE_IDLE) { + component_unlock(); + return NULL; + } + + session->stage = STAGE_PENDING_FIRST_RESPONSE; + session->client_sink = *sink; + session->session_id = 0; + + component_unlock(); + return session; +} + +static inline void close_session(stream_session_t *session) +{ + component_lock(); + session->stage = STAGE_IDLE; + session->session_id = 0; + component_unlock(); +} + +static stream_session_t *find_session(uint32_t session_id) +{ + if (session_id == 0) { + return NULL; + } + + component_lock(); + stream_session_t *session = &stream_session; + + if (session->stage == STAGE_IDLE || session_id != session->session_id) { + component_unlock(); + return NULL; + } + + component_unlock(); + return session; +} + +int suit_dfu_fetch_source_write_fetched_data(uint32_t session_id, const uint8_t *data, size_t len) +{ + component_lock(); + stream_session_t *session = find_session(session_id); + + if (session == NULL) { + component_unlock(); + return -ENOENT; + } + + if (session->stage == STAGE_PENDING_FIRST_RESPONSE) { + session->stage = STAGE_IN_PROGRESS; + } + + int err = session->client_sink.write(session->client_sink.ctx, data, len); + + if (err == SUIT_PLAT_SUCCESS) { + err = 0; + } else { + err = -EIO; + } + + component_unlock(); + return err; +} + +int suit_dfu_fetch_source_seek(uint32_t session_id, size_t offset) +{ + component_lock(); + stream_session_t *session = find_session(session_id); + + if (session == NULL) { + component_unlock(); + return -ENOENT; + } + + if (session->stage == STAGE_PENDING_FIRST_RESPONSE) { + session->stage = STAGE_IN_PROGRESS; + } + + if (session->client_sink.seek == NULL) { + return -EACCES; + } + + suit_plat_err_t err = session->client_sink.seek(session->client_sink.ctx, offset); + + if (err == SUIT_PLAT_SUCCESS) { + err = 0; + } else { + err = -EIO; + } + + component_unlock(); + return err; +} + +int suit_dfu_fetch_source_register(suit_dfu_fetch_source_request_fn request_fn) +{ + component_lock(); + + for (int i = 0; i < sizeof(sources) / sizeof(fetch_source_t); i++) { + fetch_source_t *source = &sources[i]; + + if (source->request_fn == NULL) { + source->request_fn = request_fn; + component_unlock(); + return SUIT_PLAT_SUCCESS; + } + } + + component_unlock(); + return SUIT_PLAT_ERR_NO_RESOURCES; +} + +suit_plat_err_t suit_fetch_source_stream(const uint8_t *uri, size_t uri_length, + struct stream_sink *sink) +{ + if (uri == NULL || uri_length == 0 || sink == NULL || sink->write == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + stream_session_t *session = open_session(uri, uri_length, sink); + + if (session == NULL) { + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + for (int i = 0; i < sizeof(sources) / sizeof(fetch_source_t); i++) { + component_lock(); + + fetch_source_t *source = &sources[i]; + + suit_dfu_fetch_source_request_fn request_fn = source->request_fn; + + if (0 == ++last_used_session_id) { + ++last_used_session_id; + } + + session->session_id = last_used_session_id; + + component_unlock(); + + if (request_fn != NULL) { + int err = request_fn(uri, uri_length, last_used_session_id); + + if (err == 0) { + close_session(session); + return SUIT_PLAT_SUCCESS; + + } else if (session->stage != STAGE_PENDING_FIRST_RESPONSE) { + /* error while transfer has arleady started, unrecoverable + */ + close_session(session); + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + /* fetch source signalized an error immediately, means it does not + * support fetching from provided URI, let's try next fetch source + */ + } + } + + close_session(session); + return SUIT_PLAT_ERR_CRASH; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_flash_streamer.c b/subsys/suit/stream/stream_sources/src/suit_flash_streamer.c new file mode 100644 index 000000000000..5dcb295ba074 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_flash_streamer.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +LOG_MODULE_REGISTER(suit_flash_streamer, CONFIG_SUIT_LOG_LEVEL); + +#define READ_CHUNK_SIZE 256 + +bool suit_flash_streamer_address_in_range(const uint8_t *address) +{ + return suit_memory_global_address_is_in_external_memory((uintptr_t)address); +} + +suit_plat_err_t suit_flash_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink) +{ + const struct device *fdev = suit_memory_external_memory_device_get(); + uintptr_t offset; + size_t bytes_read = 0; + uint8_t read_buffer[READ_CHUNK_SIZE]; + + if (fdev == NULL) { + return SUIT_PLAT_ERR_IO; + } + + if (!device_is_ready(fdev)) { + return SUIT_PLAT_ERR_HW_NOT_READY; + } + + if (!suit_memory_global_address_to_external_memory_offset((uintptr_t)payload, &offset)) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((payload == NULL) || (sink == NULL) || (sink->write == NULL) || (payload_size <= 0)) { + return SUIT_PLAT_ERR_INVAL; + } + + do { + size_t bytes_remaining = payload_size - bytes_read; + size_t read_size = MIN(bytes_remaining, READ_CHUNK_SIZE); + + int result = flash_read(fdev, offset, read_buffer, read_size); + + if (result != 0) { + return SUIT_PLAT_ERR_IO; + } + + suit_plat_err_t ret = sink->write(sink->ctx, read_buffer, read_size); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + bytes_read += read_size; + } while (bytes_read < payload_size); + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_generic_address_streamer.c b/subsys/suit/stream/stream_sources/src/suit_generic_address_streamer.c new file mode 100644 index 000000000000..20a73d20a772 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_generic_address_streamer.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +LOG_MODULE_REGISTER(suit_generic_address_streamer, CONFIG_SUIT_LOG_LEVEL); + +suit_plat_err_t suit_generic_address_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink) +{ + if ((payload != NULL) && (sink != NULL) && (sink->write != NULL) && (payload_size > 0)) { + suit_address_streamer streamer = suit_address_streamer_select_by_address(payload); + + if (streamer == NULL) { + LOG_ERR("Streamer source not found for address: %p", (void *)payload); + return SUIT_PLAT_ERR_NOT_FOUND; + } else { + return streamer(payload, payload_size, sink); + } + } + + LOG_ERR("Invalid arguments"); + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_provider.c b/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_provider.c new file mode 100644 index 000000000000..39174d3841e8 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_provider.c @@ -0,0 +1,447 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include +#include + +#define IMG_REQUEST_THREAD_STACK_SIZE 2048 +#define IMG_REQUEST_THREAD_PRIORITY 5 + +static K_THREAD_STACK_DEFINE(img_request_thread_stack_area, IMG_REQUEST_THREAD_STACK_SIZE); +static struct k_work_q img_request_work_q; + +typedef enum { + FREE = 0, + READY_TO_ENQUEUE = 1, + ENQUEUED = 2 +} buffer_state_t; + +typedef struct { + buffer_state_t buffer_state; + uint32_t offset_in_image; + uint32_t chunk_size; + uint32_t chunk_id; +} buffer_metadata_t; + +typedef struct { + buffer_metadata_t buffer_metadata[CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS]; + uint8_t buffer[CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS] + [CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE]; +} buffer_info_t; + +typedef struct { + struct k_work work; + uint32_t stream_session_id; + size_t current_image_offset; + size_t requested_image_offset; + uint32_t last_chunk_id; + + buffer_info_t buffer_info; +} image_request_info_t; + +static image_request_info_t request_info = { + .stream_session_id = 0, +}; + +static K_SEM_DEFINE(chunk_status_changed_sem, 0, 1); + +static bool chunk_released_check(image_request_info_t *ri, + suit_ipc_streamer_chunk_info_t *injected_chunks, + size_t chunk_info_count) +{ + bool chunk_released = false; + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS; i++) { + buffer_metadata_t *bm = &ri->buffer_info.buffer_metadata[i]; + + if (bm->buffer_state == ENQUEUED) { + bool still_enqueued = false; + + for (int j = 0; j < chunk_info_count; j++) { + suit_ipc_streamer_chunk_info_t *ci = &injected_chunks[j]; + + if (ci->chunk_id == bm->chunk_id && ci->status == PENDING) { + still_enqueued = true; + break; + } + } + + if (!still_enqueued) { + bm->buffer_state = FREE; + chunk_released = true; + } + } + } + + return chunk_released; +} + +static suit_plat_err_t wait_for_buffer_state_change(image_request_info_t *ri) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + suit_ipc_streamer_chunk_info_t injected_chunks[CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS]; + size_t chunk_info_count = CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS; + + while (true) { + err = suit_ipc_streamer_chunk_status_req(ri->stream_session_id, injected_chunks, + &chunk_info_count); + if (err == SUIT_PLAT_ERR_BUSY) { + /* not enough space in injected_chunks. This is not a problem, + * stream requestor most probably just released its space and + * one of next calls will be successful. + */ + } else if (err == SUIT_PLAT_SUCCESS) { + bool chunk_released = + chunk_released_check(ri, injected_chunks, chunk_info_count); + + if (chunk_released) { + return SUIT_PLAT_SUCCESS; + } + } else { + return err; + } + + /* timeout is a guard against chunk status notification miss. + * 20 ms limits amount of IPC calls and at the same time it does not + * affect operation duration significantly + */ + k_sem_take(&chunk_status_changed_sem, K_MSEC(20)); + } + + return err; +} + +static suit_plat_err_t find_buffer_for_enqueue(image_request_info_t *ri, buffer_metadata_t **bm, + uint8_t **buffer) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + *bm = NULL; + *buffer = NULL; + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS; i++) { + buffer_metadata_t *current = &ri->buffer_info.buffer_metadata[i]; + + if (current->buffer_state == READY_TO_ENQUEUE) { + /* READY_TO_ENQUEUE- means that new data shall be concatenated to this one + */ + *bm = current; + *buffer = ri->buffer_info.buffer[i]; + return SUIT_PLAT_SUCCESS; + } + } + + while (*bm == NULL) { + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS; i++) { + buffer_metadata_t *current = &ri->buffer_info.buffer_metadata[i]; + + if (current->buffer_state == FREE) { + *bm = current; + *buffer = ri->buffer_info.buffer[i]; + break; + } + } + + if (*bm == NULL) { + err = wait_for_buffer_state_change(ri); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + } + } + + return err; +} + +static suit_plat_err_t chunk_enqueue(image_request_info_t *ri, buffer_metadata_t *bm, + uint8_t *buffer_address, bool last_chunk) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + while (true) { + err = suit_ipc_streamer_chunk_enqueue(ri->stream_session_id, bm->chunk_id, + bm->offset_in_image, buffer_address, + bm->chunk_size, last_chunk); + if (err == SUIT_PLAT_ERR_BUSY) { + /* Not enough space in requestor, try again later + */ + err = wait_for_buffer_state_change(ri); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + } else { + return err; + } + } + + /* UNREACHABLE */ +} + +static suit_plat_err_t end_of_stream(image_request_info_t *ri) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + buffer_metadata_t *bm = NULL; + uint8_t *buffer = NULL; + + err = find_buffer_for_enqueue(ri, &bm, &buffer); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (FREE == bm->buffer_state) { + bm->offset_in_image = ri->requested_image_offset; + bm->chunk_size = 0; + bm->chunk_id = ++ri->last_chunk_id; + bm->buffer_state = READY_TO_ENQUEUE; + } + + if (READY_TO_ENQUEUE != bm->buffer_state) { + /* This shall not happen. There must be a flaw in design. concurrency issue? + */ + return SUIT_PLAT_ERR_UNREACHABLE_PATH; + } + + err = chunk_enqueue(ri, bm, buffer, true); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + ri->requested_image_offset = bm->offset_in_image + bm->chunk_size; + bm->buffer_state = ENQUEUED; + + /* Let's wait till all buffers are given back or there is a + * 'unrecognized stream_session_id' error + */ + while (true) { + bm = NULL; + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFERS; i++) { + buffer_metadata_t *current = &ri->buffer_info.buffer_metadata[i]; + + if (current->buffer_state == ENQUEUED) { + bm = current; + break; + } + } + + if (bm == NULL) { + return SUIT_PLAT_SUCCESS; + } + + err = wait_for_buffer_state_change(ri); + if (err != SUIT_PLAT_SUCCESS) { + return SUIT_PLAT_SUCCESS; + } + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t write_proxy(void *ctx, const uint8_t *source_buffer, size_t size) +{ + + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + uint32_t stream_session_id = (uintptr_t)ctx; + image_request_info_t *ri = &request_info; + + size_t source_offset = 0; + size_t source_remaining = size; + + while (source_remaining) { + + if (ri->stream_session_id != stream_session_id) { + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + buffer_metadata_t *bm = NULL; + uint8_t *buffer = NULL; + + err = find_buffer_for_enqueue(ri, &bm, &buffer); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (FREE == bm->buffer_state) { + bm->offset_in_image = ri->requested_image_offset; + bm->chunk_size = 0; + bm->chunk_id = ++ri->last_chunk_id; + bm->buffer_state = READY_TO_ENQUEUE; + } + + if (READY_TO_ENQUEUE != bm->buffer_state) { + /* This shall not happen. There must be a flaw in design. concurrency issue? + */ + return SUIT_PLAT_ERR_UNREACHABLE_PATH; + } + + size_t to_be_copied = CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE - bm->chunk_size; + + if (source_remaining < to_be_copied) { + to_be_copied = source_remaining; + } + + memcpy(buffer + bm->chunk_size, source_buffer + source_offset, to_be_copied); + source_offset += to_be_copied; + source_remaining -= to_be_copied; + bm->chunk_size += to_be_copied; + + if (CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE == bm->chunk_size) { + /* buffer full, it is time to enqueue + */ + err = chunk_enqueue(ri, bm, buffer, false); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + ri->requested_image_offset = bm->offset_in_image + bm->chunk_size; + bm->buffer_state = ENQUEUED; + } + } + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t seek_proxy(void *ctx, size_t offset) +{ + + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + uint32_t stream_session_id = (uintptr_t)ctx; + image_request_info_t *ri = &request_info; + + if (ri->stream_session_id != stream_session_id) { + return SUIT_PLAT_ERR_INCORRECT_STATE; + } + + buffer_metadata_t *bm = NULL; + uint8_t *buffer = NULL; + + err = find_buffer_for_enqueue(ri, &bm, &buffer); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (READY_TO_ENQUEUE == bm->buffer_state) { + + if (bm->offset_in_image + bm->chunk_size == offset) { + /* this operation moves write pointer exactly to location next to + * last byte of this chunk, so there is no need to do anything + */ + return SUIT_PLAT_SUCCESS; + + } else { + err = chunk_enqueue(ri, bm, buffer, false); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + ri->requested_image_offset = bm->offset_in_image + bm->chunk_size; + bm->buffer_state = ENQUEUED; + } + } + + if (ri->requested_image_offset != offset) { + err = find_buffer_for_enqueue(ri, &bm, &buffer); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + if (FREE != bm->buffer_state) { + /* This shall not happen. There must be a flaw in design. concurrency issue? + * as max one buffer can be READY_TO_ENQUEUE + */ + return SUIT_PLAT_ERR_UNREACHABLE_PATH; + } + + bm->offset_in_image = offset; + bm->chunk_size = 0; + bm->chunk_id = ++ri->last_chunk_id; + bm->buffer_state = READY_TO_ENQUEUE; + } + + return SUIT_PLAT_SUCCESS; +} + +static void image_request_worker(struct k_work *item) +{ + image_request_info_t *ri = CONTAINER_OF(item, image_request_info_t, work); + + struct stream_sink sink = {.write = write_proxy, + .seek = seek_proxy, + .flush = NULL, + .used_storage = NULL, + .release = NULL, + .ctx = (void *)(uintptr_t)ri->stream_session_id}; + + uint8_t *resource_id = ri->buffer_info.buffer[0]; + suit_plat_err_t err = suit_fetch_source_stream(resource_id, strlen(resource_id), &sink); + + if (err == SUIT_PLAT_SUCCESS) { + err = end_of_stream(ri); + } + + ri->stream_session_id = 0; +} + +static suit_plat_err_t missing_image_notify_fn(const uint8_t *resource_id, + size_t resource_id_length, + uint32_t stream_session_id, void *context) +{ + image_request_info_t *ri = &request_info; + + if (0 == ri->stream_session_id) { + + ri->current_image_offset = 0; + ri->requested_image_offset = 0; + ri->last_chunk_id = 0; + memset(&ri->buffer_info, 0, sizeof(buffer_info_t)); + + /* Buffer 0 is utilized to pass the URI + */ + strncpy(ri->buffer_info.buffer[0], resource_id, + (resource_id_length < CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE + ? resource_id_length + : CONFIG_SUIT_STREAM_IPC_PROVIDER_BUFFER_SIZE - 1)); + + ri->stream_session_id = stream_session_id; + k_work_submit_to_queue(&img_request_work_q, &ri->work); + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t chunk_status_notify_fn(uint32_t stream_session_id, void *context) +{ + k_sem_give(&chunk_status_changed_sem); + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_ipc_streamer_provider_init(void) +{ + + k_work_queue_init(&img_request_work_q); + k_work_queue_start(&img_request_work_q, img_request_thread_stack_area, + K_THREAD_STACK_SIZEOF(img_request_thread_stack_area), + IMG_REQUEST_THREAD_PRIORITY, NULL); + + image_request_info_t *ri = &request_info; + + k_work_init(&ri->work, image_request_worker); + + suit_plat_err_t err = suit_ipc_streamer_requestor_init(); + + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + err = suit_ipc_streamer_chunk_status_evt_subscribe(chunk_status_notify_fn, (void *)NULL); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + err = suit_ipc_streamer_missing_image_evt_subscribe(missing_image_notify_fn, (void *)NULL); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_requestor.c b/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_requestor.c new file mode 100644 index 000000000000..c84f825f0db9 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_ipc_streamer_requestor.c @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include + +typedef enum { + STAGE_IDLE, + STAGE_PENDING_FIRST_RESPONSE, + STAGE_IN_PROGRESS, + STAGE_CLOSING + +} image_request_stage_t; + +typedef enum { + CHUNK_SLOT_EMPTY = 0, + CHUNK_PENDING = 1, + CHUNK_PROCESSED_SUCCESS = 2, + CHUNK_PROCESSED_FAIL = 3 +} chunk_processing_status_t; + +/** + * @brief Metadata for image chunk + * + * @var chunk_id Chunk Identifier assigned and provided by ipc streamer provider. + * Not interpreted by ipc streamer requestor + * + * @var offset Offset (in bytes) in target image where chunk shall be placed, + * provided by ipc streamer provider + * + * @var address Address in RAM, where chunk raw data is placed. + * + * @var size Size of chunk raw data in bytes. + * + * @var arrival_number Assigned by ipc streamer requestor upon chunk arrival. Utilized by + * ipc streamer provider to pass chunks to sink in arrival order. + * + */ +typedef struct { + /* Initialized with CHUNK_SLOT_EMPTY at image request and modified during image download + */ + chunk_processing_status_t status; + + /* Filled in at time of chunk arrival + */ + uint32_t chunk_id; + uint32_t offset; + uint8_t *address; + size_t size; + + uint32_t arrival_number; + +} chunk_processing_state_t; + +typedef struct { + + struct k_sem *data_loop_kick_sem; + + /* Initialized with STAGE_IDLE at image request and modified during image download + */ + image_request_stage_t stage; + + /*Initialized at image request, stay unmodified till image request is completed + */ + const uint8_t *resource_id; + size_t resource_id_length; + struct stream_sink *sink; + uint32_t inter_chunk_timeout_ms; + uint32_t requesting_period_ms; + uint32_t stream_session_id; + + /*Initialized at image request and modified during image download + */ + int64_t last_request_ts; + int64_t last_response_ts; + uint32_t last_arrival_number; + uint32_t last_processed_number; + uint32_t current_sink_write_offset; + uint32_t last_chunk_arrival_number; + suit_plat_err_t completion_error_code; + + chunk_processing_state_t + chunk_processing_state[CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS]; +} image_request_state_t; + +static uint32_t last_used_stream_session_id; +static K_MUTEX_DEFINE(image_request_state_mutex); +static K_SEM_DEFINE(image_request_data_loop_kick_sem, 0, 1); + +static image_request_state_t image_request_state = { + .data_loop_kick_sem = &image_request_data_loop_kick_sem, + .stage = STAGE_IDLE, +}; + +static suit_ipc_streamer_chunk_status_notify_fn chunk_status_notify_fn; +static void *chunk_status_notify_context; + +static suit_ipc_streamer_missing_image_notify_fn missing_image_notify_fn; +static void *missing_image_notify_context; + +static inline void image_request_state_lock(void) +{ + k_mutex_lock(&image_request_state_mutex, K_FOREVER); +} + +static inline void image_request_state_unlock(void) +{ + k_mutex_unlock(&image_request_state_mutex); +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static chunk_processing_state_t *pending_chunk_get_next(image_request_state_t *irs) +{ + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + if (cps->status == CHUNK_PENDING && + cps->arrival_number == irs->last_processed_number + 1) { + return cps; + } + } + return NULL; +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static chunk_processing_state_t *empty_chunk_slot_get(image_request_state_t *irs) +{ + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + if (cps->status == CHUNK_SLOT_EMPTY) { + return cps; + } + } + return NULL; +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static chunk_processing_state_t *non_empty_chunk_slot_get_next(image_request_state_t *irs, + uint32_t min_arrival_number) +{ + + chunk_processing_state_t *found_cps = NULL; + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + if (cps->status != CHUNK_SLOT_EMPTY) { + if (cps->arrival_number >= min_arrival_number) { + if (found_cps == NULL || + found_cps->arrival_number > cps->arrival_number) { + found_cps = cps; + } + } + } + } + return found_cps; +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static int non_empty_chunk_slot_count_get(image_request_state_t *irs) +{ + + int count = 0; + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + if (cps->status != CHUNK_SLOT_EMPTY) { + count++; + } + } + return count; +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static void chunk_status_notify(image_request_state_t *irs) +{ + + suit_ipc_streamer_chunk_status_notify_fn notify_fn = chunk_status_notify_fn; + void *context = chunk_status_notify_context; + uint32_t stream_session_id = irs->stream_session_id; + + if (NULL == notify_fn) { + return; + } + + image_request_state_unlock(); + notify_fn(stream_session_id, context); + image_request_state_lock(); +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static void missing_image_notify(image_request_state_t *irs) +{ + suit_ipc_streamer_missing_image_notify_fn notify_fn = missing_image_notify_fn; + void *context = missing_image_notify_context; + const uint8_t *resource_id = irs->resource_id; + size_t resource_id_length = irs->resource_id_length; + uint32_t stream_session_id = irs->stream_session_id; + + if (NULL != notify_fn) { + image_request_state_unlock(); + notify_fn(resource_id, resource_id_length, stream_session_id, context); + image_request_state_lock(); + } +} + +static suit_plat_err_t irs_seek(image_request_state_t *irs, size_t offset) +{ + suit_plat_err_t sink_error = SUIT_PLAT_SUCCESS; + + if (irs->sink->seek != NULL) { + image_request_state_unlock(); + sink_error = irs->sink->seek(irs->sink->ctx, offset); + image_request_state_lock(); + + if (sink_error == SUIT_PLAT_SUCCESS) { + irs->current_sink_write_offset = offset; + } + } else { + /* seek is necessary but sink does not support it + */ + sink_error = SUIT_PLAT_ERR_UNSUPPORTED; + } + + return sink_error; +} + +/* Assumption - function is called with access to image_request_state initially locked. + * image_request_state will also be locked on function exit. + * Function will release image_request_state for blocking operation + * and get it back once blocking operation is over. This is to avoid blocking + * suit_ipc_streamer_chunk_enqueue while other chunk is being processed, i.e. decrypting, + * storing in non-volatile memory, and also to avoid potential deadlock between + * suit_ipc_streamer_chunk_enqueue, + * and suit_ipc_streamer_missing_image_notify_fn, suit_ipc_streamer_chunk_status_notify_fn + */ +static suit_plat_err_t data_loop(image_request_state_t *irs) +{ + uint32_t sleep_period_ms = 0; + struct k_sem *data_loop_kick_sem = irs->data_loop_kick_sem; + + while (true) { + + image_request_state_unlock(); + k_sem_take(data_loop_kick_sem, K_MSEC(sleep_period_ms)); + image_request_state_lock(); + + int64_t current_ts = k_uptime_get(); + + /* longest possible sleep time, will be decreased eventually + */ + sleep_period_ms = irs->inter_chunk_timeout_ms; + + /* Pushing the chunk to sink - if chunk is available + */ + if (irs->stage == STAGE_IN_PROGRESS) { + chunk_processing_state_t *cps = pending_chunk_get_next(irs); + + if (cps != NULL) { + suit_plat_err_t sink_error = SUIT_PLAT_SUCCESS; + + bool seek_needed = (irs->current_sink_write_offset != cps->offset) + ? true + : false; + + if (seek_needed) { + sink_error = irs_seek(irs, cps->offset); + } + + if (sink_error == SUIT_PLAT_SUCCESS && cps->address != NULL && + cps->size != 0) { + + image_request_state_unlock(); + sink_error = irs->sink->write(irs->sink->ctx, cps->address, + cps->size); + image_request_state_lock(); + + if (sink_error == SUIT_PLAT_SUCCESS) { + irs->current_sink_write_offset = + cps->offset + cps->size; + } + } + + if (sink_error == SUIT_PLAT_SUCCESS) { + + irs->last_processed_number = cps->arrival_number; + + /* Let's check if it is time to transit to STAGE_CLOSING */ + if (irs->last_chunk_arrival_number == cps->arrival_number) { + irs->stage = STAGE_CLOSING; + } + cps->status = CHUNK_PROCESSED_SUCCESS; + } else { + irs->completion_error_code = SUIT_PLAT_ERR_CRASH; + irs->stage = STAGE_CLOSING; + cps->status = CHUNK_PROCESSED_FAIL; + } + + chunk_status_notify(irs); + sleep_period_ms = 0; + } + } + + /* Let's check if it is time to transit to complete + */ + if (irs->stage == STAGE_CLOSING) { + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + if (cps->status == CHUNK_PENDING) { + cps->status = CHUNK_PROCESSED_FAIL; + } + } + + chunk_status_notify(irs); + + suit_plat_err_t retval = irs->completion_error_code; + + irs->stage = STAGE_IDLE; + return retval; + } + + /* Managing image request notifications + */ + if (irs->stage == STAGE_PENDING_FIRST_RESPONSE) { + if (irs->last_request_ts == 0 || + current_ts - irs->last_request_ts >= irs->requesting_period_ms) { + missing_image_notify(irs); + irs->last_request_ts = current_ts; + } + + uint32_t sleep_period_ms_candidate = + irs->last_request_ts + irs->requesting_period_ms - current_ts; + + sleep_period_ms = (sleep_period_ms_candidate < sleep_period_ms) + ? sleep_period_ms_candidate + : sleep_period_ms; + } + + /* Managing inter-chunk timeout + */ + if (current_ts - irs->last_response_ts >= irs->inter_chunk_timeout_ms) { + irs->stage = STAGE_IDLE; + return SUIT_PLAT_ERR_TIME; + } + + uint32_t sleep_period_ms_candidate = + irs->last_response_ts + irs->inter_chunk_timeout_ms - current_ts; + + sleep_period_ms = (sleep_period_ms_candidate < sleep_period_ms) + ? sleep_period_ms_candidate + : sleep_period_ms; + } + + return SUIT_PLAT_ERR_UNREACHABLE_PATH; +} + +/* Assumption - access to image_request_state locked on entry/exit + */ +static image_request_state_t *image_request_state_allocate(const uint8_t *resource_id, + size_t resource_id_length, + struct stream_sink *sink, + uint32_t inter_chunk_timeout_ms, + uint32_t requesting_period_ms) +{ + image_request_state_t *irs = &image_request_state; + + if (irs->stage != STAGE_IDLE) { + return NULL; + } + + irs->stage = STAGE_PENDING_FIRST_RESPONSE; + irs->resource_id = resource_id; + irs->resource_id_length = resource_id_length; + irs->sink = sink; + irs->inter_chunk_timeout_ms = inter_chunk_timeout_ms; + irs->requesting_period_ms = requesting_period_ms; + + if (0 == ++last_used_stream_session_id) { + ++last_used_stream_session_id; + } + + irs->stream_session_id = last_used_stream_session_id; + + /* Initialized with 0 so suit_ssf_server_missing_image_notify will be executed immediately + */ + irs->last_request_ts = 0; + /* Initialized with current time stamp to avoid immediate inter-chunk timeout + */ + irs->last_response_ts = k_uptime_get(); + irs->last_arrival_number = 0; + irs->last_processed_number = 0; + irs->current_sink_write_offset = 0; + irs->last_chunk_arrival_number = 0; + irs->completion_error_code = SUIT_PLAT_SUCCESS; + + for (int i = 0; i < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS; i++) { + chunk_processing_state_t *cps = &irs->chunk_processing_state[i]; + + cps->status = CHUNK_SLOT_EMPTY; + } + + return irs; +} + +suit_plat_err_t suit_ipc_streamer_stream(const uint8_t *resource_id, size_t resource_id_length, + struct stream_sink *sink, uint32_t inter_chunk_timeout_ms, + uint32_t requesting_period_ms) +{ + if (resource_id == NULL || resource_id_length == 0 || sink == NULL || sink->write == NULL) { + return SUIT_PLAT_ERR_INVAL; + } + + image_request_state_lock(); + image_request_state_t *irs = + image_request_state_allocate(resource_id, resource_id_length, sink, + inter_chunk_timeout_ms, requesting_period_ms); + if (irs == NULL) { + image_request_state_unlock(); + return SUIT_PLAT_ERR_NO_RESOURCES; + } + + suit_plat_err_t err = data_loop(irs); + + image_request_state_unlock(); + + return err; +} + +suit_plat_err_t suit_ipc_streamer_chunk_enqueue(uint32_t stream_session_id, uint32_t chunk_id, + uint32_t offset, uint8_t *address, uint32_t size, + bool last_chunk) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + if (address != NULL && size != 0) { + + /* TODO!!! + * Memory range shall be valid for caller, i.e App Domain, to make sure that + * the data belonging to other domain is not leaked out. + */ + + } else if (address == NULL && size == 0) { + + /* that combination of partameters is valid, caller may use it to + * signalize the last chunk or to 'seek' to new offset in target image + */ + + } else { + err = SUIT_PLAT_ERR_INVAL; + } + + image_request_state_lock(); + + image_request_state_t *irs = &image_request_state; + + if (err == SUIT_PLAT_SUCCESS) { + if (irs->stage == STAGE_IDLE || irs->stream_session_id != stream_session_id) { + err = SUIT_PLAT_ERR_INCORRECT_STATE; + } + } + + if (err == SUIT_PLAT_SUCCESS) { + if (irs->stage == STAGE_CLOSING || irs->last_chunk_arrival_number != 0) { + /* connection is closing, no new chunks will be accepted + */ + err = SUIT_PLAT_ERR_INCORRECT_STATE; + } + } + + if (err == SUIT_PLAT_SUCCESS) { + + if (irs->stage == STAGE_PENDING_FIRST_RESPONSE) { + irs->stage = STAGE_IN_PROGRESS; + } + + irs->last_response_ts = k_uptime_get(); + + chunk_processing_state_t *cps = empty_chunk_slot_get(irs); + + if (cps == NULL) { + /* not enough space to store chunk info. Try again later + */ + err = SUIT_PLAT_ERR_BUSY; + } else { + cps->status = CHUNK_PENDING; + cps->chunk_id = chunk_id; + cps->offset = offset; + cps->address = address; + cps->size = size; + + cps->arrival_number = ++irs->last_arrival_number; + + if (last_chunk) { + irs->last_chunk_arrival_number = cps->arrival_number; + } + + struct k_sem *data_loop_kick_sem = irs->data_loop_kick_sem; + + k_sem_give(data_loop_kick_sem); + } + } + + image_request_state_unlock(); + + return err; +} + +suit_plat_err_t suit_ipc_streamer_chunk_status_req(uint32_t stream_session_id, + suit_ipc_streamer_chunk_info_t *chunk_info, + size_t *chunk_info_count) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + if (chunk_info == NULL || chunk_info_count == NULL) { + err = SUIT_PLAT_ERR_INVAL; + } + + image_request_state_lock(); + + image_request_state_t *irs = &image_request_state; + + if (err == SUIT_PLAT_SUCCESS) { + if (irs->stage == STAGE_IDLE || irs->stream_session_id != stream_session_id) { + err = SUIT_PLAT_ERR_INCORRECT_STATE; + } + } + + uint32_t count = 0; + + if (err == SUIT_PLAT_SUCCESS) { + + uint32_t min_arrival_number = 1; + + count = non_empty_chunk_slot_count_get(irs); + if (count > *chunk_info_count) { + err = SUIT_PLAT_ERR_BUSY; + } + + count = 0; + while (count < CONFIG_SUIT_STREAM_IPC_REQUESTOR_MAX_CHUNKS) { + + chunk_processing_state_t *cps = + non_empty_chunk_slot_get_next(irs, min_arrival_number); + if (cps != NULL) { + + min_arrival_number = cps->arrival_number + 1; + + if (err == SUIT_PLAT_SUCCESS) { + suit_ipc_streamer_chunk_info_t *entry = &chunk_info[count]; + *chunk_info_count = count + 1; + entry->chunk_id = cps->chunk_id; + + if (cps->status == CHUNK_PENDING) { + entry->status = PENDING; + + } else if (cps->status == CHUNK_PROCESSED_SUCCESS) { + entry->status = PROCESSED; + + } else { + entry->status = REFUSED; + } + } + + if (cps->status != CHUNK_PENDING) { + cps->status = CHUNK_SLOT_EMPTY; + } + + count++; + } else { + break; + } + } + } + + image_request_state_unlock(); + + return err; +} + +suit_plat_err_t +suit_ipc_streamer_chunk_status_evt_subscribe(suit_ipc_streamer_chunk_status_notify_fn notify_fn, + void *context) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + image_request_state_lock(); + + if (NULL == chunk_status_notify_fn) { + chunk_status_notify_fn = notify_fn; + chunk_status_notify_context = context; + } else { + err = SUIT_PLAT_ERR_NO_RESOURCES; + } + + image_request_state_unlock(); + + return err; +} + +void suit_ipc_streamer_chunk_status_evt_unsubscribe(void) +{ + image_request_state_lock(); + chunk_status_notify_fn = NULL; + chunk_status_notify_context = 0; + image_request_state_unlock(); +} + +suit_plat_err_t +suit_ipc_streamer_missing_image_evt_subscribe(suit_ipc_streamer_missing_image_notify_fn notify_fn, + void *context) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + image_request_state_lock(); + + if (NULL == missing_image_notify_fn) { + missing_image_notify_fn = notify_fn; + missing_image_notify_context = context; + } else { + err = SUIT_PLAT_ERR_NO_RESOURCES; + } + + image_request_state_unlock(); + + return err; +} + +void suit_ipc_streamer_missing_image_evt_unsubscribe(void) +{ + image_request_state_lock(); + missing_image_notify_fn = NULL; + missing_image_notify_context = 0; + image_request_state_unlock(); +} + +suit_plat_err_t suit_ipc_streamer_requestor_init(void) +{ + return SUIT_PLAT_SUCCESS; +} diff --git a/subsys/suit/stream/stream_sources/src/suit_memptr_streamer.c b/subsys/suit/stream/stream_sources/src/suit_memptr_streamer.c new file mode 100644 index 000000000000..896c6fea5965 --- /dev/null +++ b/subsys/suit/stream/stream_sources/src/suit_memptr_streamer.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +LOG_MODULE_REGISTER(suit_memptr_streamer, CONFIG_SUIT_LOG_LEVEL); + +bool suit_memptr_streamer_address_in_range(const uint8_t *address) +{ + return suit_memory_global_address_is_directly_readable((uintptr_t)address); +} + +suit_plat_err_t suit_memptr_streamer_stream(const uint8_t *payload, size_t payload_size, + struct stream_sink *sink) +{ + if ((payload != NULL) && (sink != NULL) && (sink->write != NULL) && (payload_size > 0)) { + return sink->write(sink->ctx, (uint8_t *)payload, payload_size); + } + + LOG_ERR("payload is %s", payload == NULL ? "NULL" : "OK"); + LOG_ERR("sink is %s", sink == NULL ? "NULL" : "OK"); + + if (sink != NULL) { + LOG_ERR("sink->write is %s", sink->write == NULL ? "NULL" : "OK"); + } + + LOG_ERR("payload_size: %u", payload_size); + + return SUIT_PLAT_ERR_INVAL; +} diff --git a/subsys/suit/utils/CMakeLists.txt b/subsys/suit/utils/CMakeLists.txt new file mode 100644 index 000000000000..5110529741d5 --- /dev/null +++ b/subsys/suit/utils/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# SUIT utilities +zephyr_interface_library_named(suit_utils) +target_include_directories(suit_utils INTERFACE include) +if(CONFIG_SUIT_METADATA) +target_link_libraries(suit_utils INTERFACE suit_metadata) +endif() # CONFIG_SUIT_METADATA +if(CONFIG_SUIT_PLATFORM) +target_link_libraries(suit_utils INTERFACE suit_platform_interface) +target_link_libraries(suit_utils INTERFACE suit) +endif() # CONFIG_SUIT_PLATFORM +target_link_libraries(suit_utils INTERFACE suit_platform_err) + +zephyr_library() +zephyr_library_sources(src/suit_plat_decode_util.c) +zephyr_library_sources(src/suit_plat_mem_util.c) + +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_METADATA suit_metadata) diff --git a/subsys/suit/utils/Kconfig b/subsys/suit/utils/Kconfig new file mode 100644 index 000000000000..844e70af5de0 --- /dev/null +++ b/subsys/suit/utils/Kconfig @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_UTILS + bool "Enable SUIT utilities" + depends on ZCBOR + depends on ZCBOR_CANONICAL + +if SUIT_UTILS + +config APP_LINK_WITH_SUIT_UTILS + bool + default y if SUIT + +endif # SUIT_UTILS diff --git a/subsys/suit/utils/include/suit_mreg.h b/subsys/suit/utils/include/suit_mreg.h new file mode 100644 index 000000000000..914317c6d1d5 --- /dev/null +++ b/subsys/suit/utils/include/suit_mreg.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_MREG_H__ +#define SUIT_MREG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @brief A generic memory region representation. + * + * This type is similar to the zcbor string structure and was introduced in order to decouple + * SUIT module interfaces from ZCBOR library. + */ +typedef struct { + /** @brief Pointer to the memory region. */ + const uint8_t *mem; + /** @brief Size of the memory region. */ + size_t size; +} suit_plat_mreg_t; + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_MREG_H__ */ diff --git a/subsys/suit/utils/include/suit_plat_decode_util.h b/subsys/suit/utils/include/suit_plat_decode_util.h new file mode 100644 index 000000000000..75a235ac2e41 --- /dev/null +++ b/subsys/suit/utils/include/suit_plat_decode_util.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_DECODE_UTIL_H__ +#define SUIT_PLAT_DECODE_UTIL_H__ + +#include +#ifdef CONFIG_SUIT_METADATA +#include +#endif /* CONFIG_SUIT_METaDATA */ +#ifdef CONFIG_SUIT_PLATFORM +#include +#endif /* CONFIG_SUIT_PLATFORM*/ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS \ + 5 /**< The maximum number of bytestrings in a component ID. */ + +/** + * @brief Decode params from component_id + * + * @param component_id Input component id + * @param cpu_id Decoded CPU id + * @param run_address Decoded start/run address + * @param size Decoded component size + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_component_id(struct zcbor_string *component_id, uint8_t *cpu_id, + intptr_t *run_address, size_t *size); + +#ifdef CONFIG_SUIT_PLATFORM +/** + * @brief Decode component type from component_id + * + * @param component_id Input component_id + * @param type Decoded component type + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_component_type(struct zcbor_string *component_id, + suit_component_type_t *type); + +#endif /* CONFIG_SUIT_PLATFORM */ + +/** + * @brief Decode params from component_id + * + * @param component_id Input component id + * @param run_address Decoded start/run address + * @param size Decoded component size + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_address_size(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size); + +/** + * @brief Decode number from component_id + * + * @param component_id Input component id + * @param number Decoded component number + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_component_number(struct zcbor_string *component_id, + uint32_t *number); + +/** + * @brief Decode uint32_t key_id from zcbor_string + * + * @param key_id Input zcbor_string key ID + * @param integer_key_id Output key ID in uint32 + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_key_id(struct zcbor_string *key_id, uint32_t *integer_key_id); + +#ifdef CONFIG_SUIT_METADATA +/** + * @brief Decode manifest class ID from component_id + * + * @param component_id Input component id + * @param class_id Decoded class ID + * + * @return SUIT_PLAT_SUCCESS in case of success, otherwise error code + */ +suit_plat_err_t suit_plat_decode_manifest_class_id(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id); +#endif /* CONFIG_SUIT_METADATA */ + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_DECODE_UTIL_H__ */ diff --git a/subsys/suit/utils/include/suit_plat_mem_util.h b/subsys/suit/utils/include/suit_plat_mem_util.h new file mode 100644 index 000000000000..3170a2c53470 --- /dev/null +++ b/subsys/suit/utils/include/suit_plat_mem_util.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef SUIT_PLAT_MEM_UTIL_H__ +#define SUIT_PLAT_MEM_UTIL_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define FLASH_AREA_ERASE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), erase_block_size) +#define FLASH_AREA_WRITE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), write_block_size) + +#ifdef CONFIG_SDFW_MRAM_ERASE_VALUE +#define EMPTY_STORAGE_VALUE \ + ((((uint32_t)(CONFIG_SDFW_MRAM_ERASE_VALUE)) << 24) | \ + (((uint32_t)(CONFIG_SDFW_MRAM_ERASE_VALUE)) << 16) | \ + (((uint32_t)(CONFIG_SDFW_MRAM_ERASE_VALUE)) << 8) | \ + (((uint32_t)(CONFIG_SDFW_MRAM_ERASE_VALUE)))) +#else +#define EMPTY_STORAGE_VALUE 0xFFFFFFFF +#endif + +#if IS_ENABLED(CONFIG_FLASH) +#if (DT_NODE_EXISTS(DT_CHOSEN(zephyr_flash_controller))) +#define SUIT_PLAT_INTERNAL_NVM_DEV DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)) +#else +#define SUIT_PLAT_INTERNAL_NVM_DEV DEVICE_DT_GET(DT_CHOSEN(zephyr_flash)) +#endif +#else +#define SUIT_PLAT_INTERNAL_NVM_DEV NULL +#endif + +/** @brief Convert address from SUIT component ID to memory pointer. + * + * @note This function is used to hide the fact that on POSIX platform the flash + * memory is mapped to a different address than specified by the component ID + * + * @param[in] address Address from the SUIT component ID + * + * @returns Pointer to the memory. + */ +uint8_t *suit_plat_mem_ptr_get(uintptr_t address); + +/** @brief Convert pointer to the memory to address compatible with SUIT component ID. + * + * @note This function is used to hide the fact that on POSIX platform the flash + * memory is mapped to a different address than specified by the component ID + * + * @param[in] ptr Pointer to the memory + * + * @returns Address compatible with the SUIT component ID. + */ +uintptr_t suit_plat_mem_address_get(uint8_t *ptr); + +/** @brief Convert pointer to the memory to the offset in the area, managed by the default flash + * controller. + * + * @note The flash controller API requires to pass the offset inside the memory, not just + * the address. + * + * @param[in] ptr Pointer to the memory + * + * @returns Offset in the NVM area, managed by the flash controller. + */ +uintptr_t suit_plat_mem_nvm_offset_get(uint8_t *ptr); + +/** @brief Convert the offset in the area, managed by the default flash controller to pointer to the + * memory. + * + * @note The flash controller API requires to pass the offset inside the memory, not just + * the address. + * + * @param[in] offset Offset in the NVM area, managed by the flash controller + * + * @returns Pointer to the memory. + */ +uint8_t *suit_plat_mem_nvm_ptr_get(uintptr_t offset); + +#ifdef __cplusplus +} +#endif + +#endif /* SUIT_PLAT_MEM_UTIL_H__ */ diff --git a/subsys/suit/utils/src/suit_plat_decode_util.c b/subsys/suit/utils/src/suit_plat_decode_util.c new file mode 100644 index 000000000000..b227511f379c --- /dev/null +++ b/subsys/suit/utils/src/suit_plat_decode_util.c @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +suit_plat_err_t suit_plat_decode_component_id(struct zcbor_string *component_id, uint8_t *cpu_id, + intptr_t *run_address, size_t *size) +{ + if ((component_id == NULL) || (cpu_id == NULL) || (run_address == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + ZCBOR_STATE_D(state, 2, component_id->value, component_id->len, + SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS, 0); + struct zcbor_string component_type; + bool res; + + res = zcbor_list_start_decode(state); + res = res && zcbor_bstr_decode(state, &component_type); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_int_decode(state, cpu_id, 1); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_size_decode(state, (size_t *)run_address); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_size_decode(state, (size_t *)size); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_list_end_decode(state); + + if (res) { + *run_address = (intptr_t)suit_plat_mem_ptr_get(*run_address); + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CBOR_DECODING; +} + +#ifdef CONFIG_SUIT_PLATFORM +suit_plat_err_t suit_plat_decode_component_type(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + if ((type == NULL) || (component_id == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + ZCBOR_STATE_D(state, 2, component_id->value, component_id->len, + SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS, 0); + struct zcbor_string tmp; + bool res; + + res = zcbor_list_start_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_tstr_decode(state, &tmp); + res = res && zcbor_bstr_end_decode(state); + + if (!res) { + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + if ((tmp.len == strlen("MEM")) && (memcmp(tmp.value, "MEM", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_MEM; + } else if ((tmp.len == strlen("CAND_IMG")) && + (memcmp(tmp.value, "CAND_IMG", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_CAND_IMG; + } else if ((tmp.len == strlen("CAND_MFST")) && + (memcmp(tmp.value, "CAND_MFST", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_CAND_MFST; + } else if ((tmp.len == strlen("INSTLD_MFST")) && + (memcmp(tmp.value, "INSTLD_MFST", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_INSTLD_MFST; + } else if ((tmp.len == strlen("SOC_SPEC")) && + (memcmp(tmp.value, "SOC_SPEC", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_SOC_SPEC; + } else if ((tmp.len == strlen("CACHE_POOL")) && + (memcmp(tmp.value, "CACHE_POOL", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_CACHE_POOL; + } else { + *type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + return SUIT_PLAT_ERR_CBOR_DECODING; + } + + return SUIT_PLAT_SUCCESS; +} +#endif /* CONFIG_SUIT_PLATFORM */ + +suit_plat_err_t suit_plat_decode_address_size(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size) +{ + if ((component_id == NULL) || (size == NULL) || (run_address == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + ZCBOR_STATE_D(state, 2, component_id->value, component_id->len, + SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS, 0); + struct zcbor_string component_type; + bool res; + uint8_t cpu_id; + + res = zcbor_list_start_decode(state); + res = res && zcbor_bstr_decode(state, &component_type); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_int_decode(state, &cpu_id, 1); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_size_decode(state, (size_t *)run_address); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_size_decode(state, (size_t *)size); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_list_end_decode(state); + + if (res) { + *run_address = (intptr_t)suit_plat_mem_ptr_get(*run_address); + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CBOR_DECODING; +} + +suit_plat_err_t suit_plat_decode_component_number(struct zcbor_string *component_id, + uint32_t *number) +{ + if ((component_id == NULL) || (number == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + ZCBOR_STATE_D(state, 2, component_id->value, component_id->len, + SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS, 0); + struct zcbor_string component_type; + + bool res = zcbor_list_start_decode(state); + + res = res && zcbor_bstr_decode(state, &component_type); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_uint32_decode(state, number); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_list_end_decode(state); + + if (res) { + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CBOR_DECODING; +} + +suit_plat_err_t suit_plat_decode_key_id(struct zcbor_string *key_id, uint32_t *integer_key_id) +{ + if ((key_id == NULL) || (key_id->value == NULL) || (key_id->len == 0) || + (integer_key_id == NULL)) { + return SUIT_PLAT_SUCCESS; + } + + ZCBOR_STATE_D(state, 2, key_id->value, key_id->len, 1, 0); + + if (zcbor_uint32_decode(state, integer_key_id)) { + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CBOR_DECODING; +} + +#ifdef CONFIG_SUIT_METADATA +suit_plat_err_t suit_plat_decode_manifest_class_id(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + struct zcbor_string component_type; + struct zcbor_string class_id_bstr; + bool res; + + if ((component_id == NULL) || (class_id == NULL)) { + return SUIT_PLAT_ERR_INVAL; + } + + ZCBOR_STATE_D(state, 2, component_id->value, component_id->len, + SUIT_PLAT_MAX_NUM_COMPONENT_ID_PARTS, 0); + + res = zcbor_list_start_decode(state); + res = res && zcbor_bstr_start_decode(state, NULL); + res = res && zcbor_tstr_decode(state, &component_type); + res = res && zcbor_bstr_end_decode(state); + res = res && zcbor_bstr_decode(state, &class_id_bstr); + res = res && zcbor_list_end_decode(state); + + if (res) { + if ((component_type.len != strlen("INSTLD_MFST")) || + (memcmp(component_type.value, "INSTLD_MFST", component_type.len) != 0)) { + res = false; + } + } + + if (res) { + if (class_id_bstr.len != sizeof(suit_manifest_class_id_t)) { + res = false; + } else { + *class_id = (suit_uuid_t *)class_id_bstr.value; + } + } + + if (res) { + return SUIT_PLAT_SUCCESS; + } + + return SUIT_PLAT_ERR_CBOR_DECODING; +} +#endif /* CONFIG_SUIT_METADATA */ diff --git a/subsys/suit/utils/src/suit_plat_mem_util.c b/subsys/suit/utils/src/suit_plat_mem_util.c new file mode 100644 index 000000000000..cb6b335ee8f2 --- /dev/null +++ b/subsys/suit/utils/src/suit_plat_mem_util.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#ifdef CONFIG_FLASH_SIMULATOR +#include +#endif /* CONFIG_FLASH_SIMULATOR */ + +uint8_t *suit_plat_mem_ptr_get(uintptr_t address) +{ +#ifdef CONFIG_FLASH_SIMULATOR + static uint8_t *f_base_address; + + if (f_base_address == NULL) { + size_t f_size = 0; + static const struct device *fdev = + DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); + + f_base_address = flash_simulator_get_memory(fdev, &f_size); + } + + /* Address is validated against range defined in dts for flash0 and for that range + * it is translated to the emulated flash address range. + * Address in the range defined for sram0 is not translated. + * Address that do not fit in any of the mentioned ranges is treated as invalid. + */ +#if DT_NODE_EXISTS(DT_NODELABEL(flash0)) + if ((address >= DT_REG_ADDR(DT_NODELABEL(flash0))) && + (address < (DT_REG_ADDR(DT_NODELABEL(flash0)) + DT_REG_SIZE(DT_NODELABEL(flash0))))) { + return (uint8_t *)(address + (uintptr_t)f_base_address); + } +#endif /* DT_NODE_EXISTS(DT_NODELABEL(flash0)) */ + +#if DT_NODE_EXISTS(DT_NODELABEL(sram0)) + if ((address >= (DT_REG_ADDR(DT_NODELABEL(sram0)))) && + (address < (DT_REG_ADDR(DT_NODELABEL(sram0)) + DT_REG_SIZE(DT_NODELABEL(sram0))))) { + return (uint8_t *)address; + } +#endif /* DT_NODE_EXISTS(DT_NODELABEL(sram0)) */ + + return NULL; +#else /* CONFIG_FLASH_SIMULATOR */ + return (uint8_t *)address; +#endif /* CONFIG_FLASH_SIMULATOR */ +} + +uintptr_t suit_plat_mem_address_get(uint8_t *ptr) +{ +#ifdef CONFIG_FLASH_SIMULATOR + static uint8_t *f_base_address; + + if (f_base_address == NULL) { + size_t f_size; + static const struct device *fdev = + DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); + + f_base_address = flash_simulator_get_memory(fdev, &f_size); + } + + return (uintptr_t)(ptr - f_base_address); +#else /* CONFIG_FLASH_SIMULATOR */ + return (uintptr_t)ptr; +#endif /* CONFIG_FLASH_SIMULATOR */ +} + +uintptr_t suit_plat_mem_nvm_offset_get(uint8_t *ptr) +{ + uintptr_t address = suit_plat_mem_address_get(ptr); + +#if (DT_NODE_EXISTS(DT_NODELABEL(mram1x))) + address = (((address)&0xEFFFFFFFUL) - (DT_REG_ADDR(DT_NODELABEL(mram1x)) & 0xEFFFFFFFUL)); +#elif (DT_NODE_EXISTS(DT_NODELABEL(mram10))) + address = (((address)&0xEFFFFFFFUL) - (DT_REG_ADDR(DT_NODELABEL(mram10)) & 0xEFFFFFFFUL)); +#endif + + return address; +} + +uint8_t *suit_plat_mem_nvm_ptr_get(uintptr_t offset) +{ + uintptr_t address; + +#if (DT_NODE_EXISTS(DT_NODELABEL(mram1x))) + address = (((offset)&0xEFFFFFFFUL) + (DT_REG_ADDR(DT_NODELABEL(mram1x)) & 0xEFFFFFFFUL)); +#elif (DT_NODE_EXISTS(DT_NODELABEL(mram10))) + address = (((offset)&0xEFFFFFFFUL) + (DT_REG_ADDR(DT_NODELABEL(mram10)) & 0xEFFFFFFFUL)); +#else + address = offset; +#endif + + return suit_plat_mem_ptr_get(address); +} diff --git a/subsys/trusted_storage/Kconfig b/subsys/trusted_storage/Kconfig index fd35949fa55d..f40f52cbc0b9 100644 --- a/subsys/trusted_storage/Kconfig +++ b/subsys/trusted_storage/Kconfig @@ -162,6 +162,11 @@ config TRUSTED_STORAGE_STORAGE_BACKEND_SETTINGS help Use the Settings subsystem with NVS to store the assets +config TRUSTED_STORAGE_STORAGE_BACKEND_CUSTOM + bool "Custom storage backend" + help + Use a custom-made backend to store data in the non-volatile memory. + endchoice # CONFIG_TRUSTED_STORAGE_STORAGE_BACKEND endif # TRUSTED_STORAGE diff --git a/subsys/trusted_storage/src/aead/aead_key_huk.c b/subsys/trusted_storage/src/aead/aead_key_huk.c index 3622fc449d08..d0d704a8f0f4 100644 --- a/subsys/trusted_storage/src/aead/aead_key_huk.c +++ b/subsys/trusted_storage/src/aead/aead_key_huk.c @@ -5,7 +5,6 @@ */ #include -#include #include #include "aead_key.h" diff --git a/subsys/trusted_storage/src/storage_backend_settings.c b/subsys/trusted_storage/src/storage_backend_settings.c index 1a9422eccc15..e2621a3343fd 100644 --- a/subsys/trusted_storage/src/storage_backend_settings.c +++ b/subsys/trusted_storage/src/storage_backend_settings.c @@ -70,6 +70,8 @@ static psa_status_t error_to_psa_error(int errorno) switch (errorno) { case 0: return PSA_SUCCESS; + case -ENOSPC: + return PSA_ERROR_INSUFFICIENT_STORAGE; case -ENOENT: return PSA_ERROR_DOES_NOT_EXIST; case -ENODATA: diff --git a/subsys/uart_async_adapter/CMakeLists.txt b/subsys/uart_async_adapter/CMakeLists.txt new file mode 100644 index 000000000000..2a391becb5f2 --- /dev/null +++ b/subsys/uart_async_adapter/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +zephyr_sources(uart_async_adapter.c) diff --git a/subsys/uart_async_adapter/Kconfig b/subsys/uart_async_adapter/Kconfig new file mode 100644 index 000000000000..5148fb511933 --- /dev/null +++ b/subsys/uart_async_adapter/Kconfig @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig UART_ASYNC_ADAPTER + bool "Enable UART async adapter [EXPERIMENTAL]" + select EXPERIMENTAL + select SERIAL_SUPPORT_ASYNC + depends on SERIAL_SUPPORT_INTERRUPT + help + Enables asynchronous adapter for UART drives that supports only + IRQ interface. + +if UART_ASYNC_ADAPTER + +module = UART_ASYNC_ADAPTER +module-str = UART Async Adapter +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + +endif diff --git a/samples/bluetooth/peripheral_uart/src/uart_async_adapter.c b/subsys/uart_async_adapter/uart_async_adapter.c similarity index 99% rename from samples/bluetooth/peripheral_uart/src/uart_async_adapter.c rename to subsys/uart_async_adapter/uart_async_adapter.c index 2749a7e3b8f1..ceefb947a417 100644 --- a/samples/bluetooth/peripheral_uart/src/uart_async_adapter.c +++ b/subsys/uart_async_adapter/uart_async_adapter.c @@ -7,12 +7,12 @@ /** @file * @brief UART asynchronous API adapter implementation */ -#include "uart_async_adapter.h" +#include #include #include #include -LOG_MODULE_REGISTER(uart_async_adapter); +LOG_MODULE_REGISTER(uart_async_adapter, CONFIG_UART_ASYNC_ADAPTER_LOG_LEVEL); #if !IS_ENABLED(CONFIG_UART_ASYNC_API) diff --git a/subsys/zigbee/Kconfig b/subsys/zigbee/Kconfig index 6570cd39d190..48a4da5f5024 100644 --- a/subsys/zigbee/Kconfig +++ b/subsys/zigbee/Kconfig @@ -20,7 +20,6 @@ menuconfig ZIGBEE imply FLASH_PAGE_LAYOUT imply FLASH_MAP imply MPU_ALLOW_FLASH_WRITE - imply NRF_STORE_REBOOT_TYPE_GPREGRET depends on (SOC_NRF52840 || SOC_NRF52833 || SOC_NRF5340_CPUAPP) if ZIGBEE diff --git a/subsys/zigbee/lib/zigbee_fota/Kconfig b/subsys/zigbee/lib/zigbee_fota/Kconfig index f85be5b50980..9db271cb239a 100644 --- a/subsys/zigbee/lib/zigbee_fota/Kconfig +++ b/subsys/zigbee/lib/zigbee_fota/Kconfig @@ -9,7 +9,6 @@ menuconfig ZIGBEE_FOTA imply BOOTLOADER_MCUBOOT imply MCUMGR imply DFU_TARGET - imply DFU_TARGET_STREAM_SAVE_PROGRESS imply DFU_MULTI_IMAGE imply DFU_MULTI_IMAGE_PACKAGE_BUILD if !ZIGBEE_FOTA_GENERATE_LEGACY_IMAGE_TYPE diff --git a/subsys/zigbee/lib/zigbee_fota/src/dfu_multi_target.c b/subsys/zigbee/lib/zigbee_fota/src/dfu_multi_target.c index c0f6cd75a68f..b492b4b09a0d 100644 --- a/subsys/zigbee/lib/zigbee_fota/src/dfu_multi_target.c +++ b/subsys/zigbee/lib/zigbee_fota/src/dfu_multi_target.c @@ -91,9 +91,10 @@ static int dfu_multi_target_done_0(bool success) if (success) { images_to_download &= ~(1 << 0); + return dfu_target_done(success); + } else { + return dfu_target_reset(); } - - return dfu_target_done(success); } #if CONFIG_UPDATEABLE_IMAGE_NUMBER > 1 @@ -103,9 +104,10 @@ static int dfu_multi_target_done_1(bool success) if (success) { images_to_download &= ~(1 << 1); + return dfu_target_done(success); + } else { + return dfu_target_reset(); } - - return dfu_target_done(success); } #endif @@ -116,9 +118,10 @@ static int dfu_multi_target_done_2(bool success) if (success) { images_to_download &= ~(1 << 2); + return dfu_target_done(success); + } else { + return dfu_target_reset(); } - - return dfu_target_done(success); } #endif diff --git a/subsys/zigbee/osif/zb_nrf_platform.c b/subsys/zigbee/osif/zb_nrf_platform.c index 949822025aa1..2f4a43a804d9 100644 --- a/subsys/zigbee/osif/zb_nrf_platform.c +++ b/subsys/zigbee/osif/zb_nrf_platform.c @@ -555,7 +555,7 @@ void zb_osif_init(void) } platform_inited = true; -#ifdef CONFIG_ZB_HAVE_SERIAL +#ifdef CONFIG_ZIGBEE_HAVE_SERIAL /* Initialise serial trace */ zb_osif_serial_init(); #endif @@ -578,8 +578,10 @@ void zb_osif_abort(void) LOG_ERR("ZBOSS fatal error occurred"); LOG_PANIC(); +#ifdef CONFIG_ZIGBEE_HAVE_SERIAL /* Flush ZBOSS trace logs. */ ZB_OSIF_SERIAL_FLUSH(); +#endif /* By default reset device or halt if so configured. */ if (IS_ENABLED(CONFIG_ZBOSS_RESET_ON_ASSERT)) { @@ -600,12 +602,7 @@ void zb_reset(zb_uint8_t param) reas = (uint8_t)SYS_REBOOT_NCP; #endif /* CONFIG_ZIGBEE_LIBRARY_NCP_DEV */ -/* For nRF5340DK sys_reboot() does not set reset reason. - * Do it manually in this case - NCP samples require this. - */ -#ifdef CONFIG_SOC_NRF5340_CPUAPP nrf_power_gpregret_set(NRF_POWER, 0, reas); -#endif /* CONFIG_SOC_NRF5340_CPUAPP */ /* Power on unused sections of RAM to allow MCUboot to use it. */ if (IS_ENABLED(CONFIG_RAM_POWER_DOWN_LIBRARY)) { diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 3814701ff7bf..140363031844 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -55,6 +55,10 @@ function(include_provision_hex) include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/provision_hex.cmake) endfunction() +function(include_suit) + include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/suit.cmake) +endfunction() + function(include_packaging) include(${ZEPHYR_NRF_MODULE_DIR}/cmake/sysbuild/b0_mcuboot_signing.cmake) include(${ZEPHYR_NRF_MODULE_DIR}/subsys/bootloader/cmake/packaging.cmake) @@ -98,28 +102,41 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) endif() endforeach() - if(BOARD STREQUAL "nrf9160dk_nrf9160_ns") - set(board_secure nrf9160dk_nrf9160) - elseif(BOARD STREQUAL "thingy91_nrf9160_ns") - set(board_secure thingy91_nrf9160) - elseif(BOARD STREQUAL "thingy91x_nrf9151_ns") - set(board_secure thingy91x_nrf9151) - elseif(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp_ns") - set(board_secure nrf5340dk_nrf5340_cpuapp) - elseif(BOARD STREQUAL "thingy53_nrf5340_cpuapp_ns") - set(board_secure thingy53_nrf5340_cpuapp) - elseif(BOARD STREQUAL "nrf7002dk_nrf5340_cpuapp_ns") - set(board_secure nrf7002dk_nrf5340_cpuapp) + if(SB_CONFIG_BOARD_NRF9160DK_NRF9160_NS) + set(board_secure "nrf9160dk") + set(board_qualifiers_secure "nrf9160") + elseif(SB_CONFIG_BOARD_THINGY91_NRF9160_NS) + set(board_secure "thingy91") + set(board_qualifiers_secure "nrf9160") + elseif(SB_CONFIG_BOARD_THINGY91X_NRF9151_NS) + set(board_secure "thingy91x") + set(board_qualifiers_secure "nrf9151") + elseif(SB_CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) + set(board_secure "nrf5340dk") + set(board_qualifiers_secure "nrf5340/cpuapp") + elseif(SB_CONFIG_BOARD_THINGY53_NRF5340_CPUAPP_NS) + set(board_secure "thingy53") + set(board_qualifiers_secure "nrf5340/cpuapp") + elseif(SB_CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS) + set(board_secure "nrf7002dk") + set(board_qualifiers_secure "nrf5340/cpuapp") endif() - if(DEFINED board_secure AND DEFINED BOARD_REVISION) - set(board_secure ${board_secure}@${BOARD_REVISION}) + if(DEFINED board_secure AND DEFINED board_qualifiers_secure) + if(DEFINED BOARD_REVISION) + set(board_target_secure "${board_secure}@${BOARD_REVISION}/${board_qualifiers_secure}") + else() + set(board_target_secure "${board_secure}/${board_qualifiers_secure}") + endif() endif() if(SB_CONFIG_BOOTLOADER_MCUBOOT) - # Make mcuboot a build only target as the main application will flash this from the - # merged hex file - set_target_properties(mcuboot PROPERTIES BUILD_ONLY true) + if(SB_CONFIG_PARTITION_MANAGER) + # Make mcuboot a build only target as the main application will flash this from the + # merged hex file + set_target_properties(mcuboot PROPERTIES BUILD_ONLY true) + endif() + set_property(TARGET mcuboot APPEND_STRING PROPERTY CONFIG "CONFIG_UPDATEABLE_IMAGE_NUMBER=${SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES}\n") set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG "CONFIG_UPDATEABLE_IMAGE_NUMBER=${SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES}\n") @@ -166,12 +183,9 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) endif() endforeach() - # Check if the board is a non-secure one - string(LENGTH "${BOARD}" board_len) - math(EXPR board_len "${board_len} - 3") - string(SUBSTRING "${BOARD}" ${board_len} 3 ns_board_check) - - if("${ns_board_check}" STREQUAL "_ns") + # A v1 board doesn't define board qualifiers, thus below test will just test the pure board + # name for a v1 board. A v2 board will match agains the board qualifier. + if("${BOARD}${BOARD_QUALIFIER}" MATCHES "(_|/)ns$") # Configure MCUboot before application so that TF-M can read MCUboot configuration sysbuild_add_dependencies(CONFIGURE ${DEFAULT_IMAGE} mcuboot) @@ -207,9 +221,9 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) ) endif() - if(NOT DEFINED mcuboot_BOARD AND DEFINED board_secure) + if(NOT DEFINED mcuboot_BOARD AND DEFINED board_target_secure) # MCUboot must run in secure mode on the nRF9160/nRF5340 - set_target_properties(mcuboot PROPERTIES BOARD ${board_secure}) + set_target_properties(mcuboot PROPERTIES BOARD ${board_target_secure}) endif() endif() @@ -220,12 +234,12 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) endif() if(SB_CONFIG_SECURE_BOOT_APPCORE) - if(NOT DEFINED b0_BOARD AND DEFINED board_secure) + if(NOT DEFINED b0_BOARD AND DEFINED board_target_secure) # b0 must run in secure mode on the nRF9160/nRF5340 - set_target_properties(b0 PROPERTIES BOARD ${board_secure}) + set_target_properties(b0 PROPERTIES BOARD ${board_target_secure}) if(SB_CONFIG_BOOTLOADER_MCUBOOT) - set_target_properties(s1_image PROPERTIES BOARD ${board_secure}) + set_target_properties(s1_image PROPERTIES BOARD ${board_target_secure}) endif() endif() @@ -285,6 +299,7 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake) set_property(GLOBAL PROPERTY DOMAIN_APP_APP ${DEFAULT_IMAGE}) include_packaging() + include_suit() if(SB_CONFIG_SECURE_BOOT OR SB_CONFIG_MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION) include_provision_hex() @@ -303,7 +318,6 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake) get_property(PM_MCUBOOT_PRIMARY_1_SIZE TARGET partition_manager PROPERTY PM_MCUBOOT_PRIMARY_1_SIZE) endif() endif() - foreach(image ${IMAGES}) configure_cache(IMAGE ${image}) endforeach() diff --git a/sysbuild/Kconfig.mcuboot b/sysbuild/Kconfig.mcuboot index ea747d263966..bf1a360c339c 100644 --- a/sysbuild/Kconfig.mcuboot +++ b/sysbuild/Kconfig.mcuboot @@ -83,7 +83,7 @@ endchoice menuconfig MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION bool "Downgrade prevention using hardware security counters" - depends on ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf9160dk_nrf9160" || $(BOARD) = "nrf9160dk_nrf9160_ns" || $(BOARD) = "thingy91_nrf9160" || $(BOARD) = "thingy91_nrf9160_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") + depends on (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS || BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160_NS || BOARD_THINGY91_NRF9160 || BOARD_THINGY91_NRF9160_NS || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS) help This option can be enabled by the application and will ensure that the MCUBOOT_HW_DOWNGRADE_PREVENTION Kconfig option is diff --git a/sysbuild/Kconfig.netcore b/sysbuild/Kconfig.netcore index 8043c5191d91..5e4bdcfcc7f5 100644 --- a/sysbuild/Kconfig.netcore +++ b/sysbuild/Kconfig.netcore @@ -5,19 +5,20 @@ config EXTERNAL_CONFIGURED_NETCORE bool default y - select NETCORE_REMOTE_NRF5340_CPUNET if NET_CORE_BOARD = "nrf5340dk_nrf5340_cpunet" + select NETCORE_REMOTE_NRF5340_CPUNET if NET_CORE_BOARD = "nrf5340dk/nrf5340/cpunet" depends on NET_CORE_IMAGE_HCI_IPC # Zephyr Kconfig enabling HCI IPC on netcore config SUPPORT_NETCORE bool - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp_ns") + default y if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF54H20DK_NRF54H20_CPUAPP) config NETCORE_REMOTE_BOARD_NAME string - default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp" - default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" - default "thingy53_nrf5340_cpunet" if $(BOARD) = "thingy53_nrf5340_cpuapp" - default "thingy53_nrf5340_cpunet" if $(BOARD) = "thingy53_nrf5340_cpuapp_ns" + default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP + default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP_NS + default "thingy53/nrf5340/cpunet" if BOARD_THINGY53_NRF5340_CPUAPP + default "thingy53/nrf5340/cpunet" if BOARD_THINGY53_NRF5340_CPUAPP_NS + default "nrf54h20dk/nrf54h20/cpurad" if BOARD_NRF54H20DK_NRF54H20_CPUAPP config NETCORE_REMOTE_DOMAIN string diff --git a/sysbuild/Kconfig.secureboot b/sysbuild/Kconfig.secureboot index 36b700f28acd..bd4bc5053237 100644 --- a/sysbuild/Kconfig.secureboot +++ b/sysbuild/Kconfig.secureboot @@ -23,9 +23,9 @@ config SECURE_BOOT_NETCORE config SECURE_BOOT_NETWORK_BOARD string - default "nrf5340dk_nrf5340_cpunet" if SECURE_BOOT_NETCORE && ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns") - default "thingy53_nrf5340_cpunet" if SECURE_BOOT_NETCORE && ($(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns") - default "nrf7002dk_nrf5340_cpunet" if SECURE_BOOT_NETCORE && ($(BOARD) = "nrf7002dk_nrf5340_cpuapp" || $(BOARD) = "nrf7002dk_nrf5340_cpuapp") + default "nrf5340dk/nrf5340/cpunet" if SECURE_BOOT_NETCORE && (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS) + default "thingy53/nrf5340/cpunet" if SECURE_BOOT_NETCORE && (BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) + default "nrf7002dk/nrf5340/cpunet" if SECURE_BOOT_NETCORE && (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP) depends on SECURE_BOOT_NETCORE help Remote board when building this sample. diff --git a/sysbuild/Kconfig.sysbuild b/sysbuild/Kconfig.sysbuild index ad1ba23c90c4..b67eb66a7e92 100644 --- a/sysbuild/Kconfig.sysbuild +++ b/sysbuild/Kconfig.sysbuild @@ -8,21 +8,24 @@ menuconfig PARTITION_MANAGER bool "Partition Manager" - default y if ($(BOARD) != "qemu_cortex_m0" && \ - $(BOARD) != "qemu_cortex_m3" && \ - $(BOARD) != "native_posix" && \ - $(BOARD) != "native_posix_64" && \ - $(BOARD) != "mps2_an521" && \ - $(BOARD) != "qemu_x86" && \ - $(BOARD) != "nrf52_bsim" && \ - $(BOARD) != "nrf5340bsim_nrf5340_cpuapp" && \ - $(BOARD) != "nrf5340bsim_nrf5340_cpunet" && \ - $(BOARD) != "nrf54h20pdk_nrf54h20_cpuapp") + default y if (!BOARD_QEMU_CORTEX_M0 && \ + !BOARD_QEMU_CORTEX_M3 && \ + !BOARD_NATIVE_POSIX && \ + !BOARD_NATIVE_POSIX_NATIVE_64 && \ + !BOARD_NATIVE_SIM && \ + !BOARD_NATIVE_SIM_NATIVE_64 && \ + !BOARD_MPS2 && \ + !BOARD_QEMU_X86 && \ + !BOARD_QEMU_X86_64 && \ + !BOARD_QEMU_X86_TINY && \ + !BOARD_NRF52_BSIM && \ + !BOARD_NRF5340BSIM && \ + !BOARD_NRF54H20DK_NRF54H20_CPUAPP) depends on !EXTERNAL_CONFIGURED_NETCORE config PM_MCUBOOT_PAD hex "Memory reserved for MCUBOOT_PAD" - default 0x800 if $(BOARD) = "nrf54l15pdk_nrf54l15_cpuapp" + default 0x800 if BOARD_NRF54L15PDK_NRF54L15_CPUAPP default 0x200 depends on BOOTLOADER_MCUBOOT depends on PARTITION_MANAGER diff --git a/sysbuild/Kconfig.xip b/sysbuild/Kconfig.xip index 26c23c400ebe..cb1ab441e51b 100644 --- a/sysbuild/Kconfig.xip +++ b/sysbuild/Kconfig.xip @@ -4,7 +4,7 @@ config SUPPORT_QSPI_XIP bool - default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp" || $(BOARD) = "nrf5340dk_nrf5340_cpuapp_ns" || $(BOARD) = "thingy53_nrf5340_cpuapp" || $(BOARD) = "thingy53_nrf5340_cpuapp_ns") + default y if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS || BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) menuconfig QSPI_XIP_SUPPORT bool "QSPI XIP support" diff --git a/sysbuild/extensions.cmake b/sysbuild/extensions.cmake index bccff04aefce..4df8810c99b4 100644 --- a/sysbuild/extensions.cmake +++ b/sysbuild/extensions.cmake @@ -30,10 +30,10 @@ endfunction() # Convenience macro to add configuration overlays to image. macro(add_overlay_config image overlay_file) - add_overlay(${image} ${overlay_file} OVERLAY_CONFIG) + add_overlay(${image} ${overlay_file} EXTRA_CONF_FILE) endmacro() # Convenience macro to add device tree overlays to image. macro(add_overlay_dts image overlay_file) - add_overlay(${image} ${overlay_file} DTC_OVERLAY_FILE) + add_overlay(${image} ${overlay_file} EXTRA_DTC_OVERLAY_FILE) endmacro() diff --git a/tests/bluetooth/iso/modules/iso_broadcast_src.c b/tests/bluetooth/iso/modules/iso_broadcast_src.c index 7f9ea66d6e0f..25584040f9cf 100644 --- a/tests/bluetooth/iso/modules/iso_broadcast_src.c +++ b/tests/bluetooth/iso/modules/iso_broadcast_src.c @@ -142,8 +142,7 @@ static void broadcaster_t(void *arg1, void *arg2, void *arg3) net_buf_reserve(buf, BT_ISO_CHAN_SEND_RESERVE); sys_put_le32(iso_send_count, iso_data); net_buf_add_mem(buf, iso_data, iso_tx_qos.sdu); - ret = bt_iso_chan_send(&bis_iso_chan[chan], buf, seq_num, - BT_ISO_TIMESTAMP_NONE); + ret = bt_iso_chan_send(&bis_iso_chan[chan], buf, seq_num); if (ret < 0) { LOG_ERR("Unable to broadcast data on channel %u" " : %d", diff --git a/tests/bluetooth/iso/testcase.yaml b/tests/bluetooth/iso/testcase.yaml index 05008e1d43df..6f4936fcc202 100644 --- a/tests/bluetooth/iso/testcase.yaml +++ b/tests/bluetooth/iso/testcase.yaml @@ -1,9 +1,9 @@ tests: bluetooth.bis_and_acl: build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp nrf5340_audio_dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp nrf5340_audio_dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340_audio_dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - nrf5340_audio_dk/nrf5340/cpuapp tags: bis_and_acl timeout: 20 diff --git a/tests/bluetooth/tester/testcase.yaml b/tests/bluetooth/tester/testcase.yaml index 44d3e1f768a9..b237c063a045 100644 --- a/tests/bluetooth/tester/testcase.yaml +++ b/tests/bluetooth/tester/testcase.yaml @@ -1,7 +1,7 @@ tests: bluetooth.general.tester.build: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 diff --git a/tests/crypto/README.rst b/tests/crypto/README.rst index 4f81d58c2712..bbaeb970a0ab 100644 --- a/tests/crypto/README.rst +++ b/tests/crypto/README.rst @@ -154,7 +154,7 @@ You can use the following configuration files to build the test in a specific se * :file:`overlay-multi.conf` uses a combination of hardware acceleration, using the Arm CryptoCell, and vanilla Mbed TLS and Oberon software implementations to support functionalities not supported by the CryptoCell. This setup uses hardware acceleration as much as possible. -You can use one of the listed overlay configurations by adding the ``-- -DOVERLAY_CONFIG=`` flag to your build. Also see :ref:`cmake_options` for instructions on how to add this option. +You can use one of the listed overlay configurations by adding the ``-- -DEXTRA_CONF_FILE=`` flag to your build. Also see :ref:`cmake_options` for instructions on how to add this option. .. _crypto_test_ztest_custom: @@ -172,7 +172,9 @@ Testing ======= 1. Compile and program the application. -#. Observe the result of the different test vectors in the log using :ref:`RTT Viewer ` or a terminal emulator. +#. |connect_kit| +#. |connect_terminal| +#. Observe the result of the different test vectors in the terminal emulator log. The last line of the output indicates the test result:: PROJECT EXECUTION SUCCESSFUL diff --git a/tests/crypto/test_cases/test_vectors.c b/tests/crypto/test_cases/test_vectors.c index 7e33ac6b8989..eb7596e00db9 100644 --- a/tests/crypto/test_cases/test_vectors.c +++ b/tests/crypto/test_cases/test_vectors.c @@ -20,7 +20,7 @@ /* * Use this file to only run a small set of test vectors. * This file will only be relevant if the correct option is set with cmake: - * cmake -GNinja -DBOARD=nrf52840dk_nrf52840 -DREDUCED_TEST_SUITE=1 .. + * cmake -GNinja -DBOARD=nrf52840dk/nrf52840 -DREDUCED_TEST_SUITE=1 .. */ #if defined(MBEDTLS_CCM_C) diff --git a/tests/crypto/testcase.yaml b/tests/crypto/testcase.yaml index ac361914681a..3e5b2595fb94 100644 --- a/tests/crypto/testcase.yaml +++ b/tests/crypto/testcase.yaml @@ -1,11 +1,11 @@ tests: crypto.builtin: extra_args: OVERLAY_CONFIG=overlay-builtin.conf - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp tags: crypto ci_build legacy builtin_legacy harness_config: type: multi_line @@ -14,11 +14,11 @@ tests: timeout: 600 crypto.cc3xx: extra_args: OVERLAY_CONFIG=overlay-cc3xx.conf - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp tags: crypto ci_build legacy cc3xx_legacy harness_config: type: multi_line @@ -27,11 +27,11 @@ tests: timeout: 200 crypto.oberon: extra_args: OVERLAY_CONFIG=overlay-oberon.conf - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp tags: crypto ci_build legacy oberon_legacy harness_config: type: multi_line diff --git a/tests/drivers/flash_patch/testcase.yaml b/tests/drivers/flash_patch/testcase.yaml index c159ef877eb1..1802f71cf34e 100644 --- a/tests/drivers/flash_patch/testcase.yaml +++ b/tests/drivers/flash_patch/testcase.yaml @@ -1,14 +1,14 @@ tests: flash_patch.flash_patch_off: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 tags: flash_patch extra_args: CONFIG_DISABLE_FLASH_PATCH=n flash_patch.flash_patch_on: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 tags: flash_patch diff --git a/tests/drivers/fprotect/app/testcase.yaml b/tests/drivers/fprotect/app/testcase.yaml index c06194a5a6bf..6cfb39b3392b 100644 --- a/tests/drivers/fprotect/app/testcase.yaml +++ b/tests/drivers/fprotect/app/testcase.yaml @@ -1,10 +1,10 @@ tests: lib.fprotect.sys_init_fprotect: - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp tags: b0 fprotect diff --git a/tests/drivers/fprotect/negative/testcase.yaml b/tests/drivers/fprotect/negative/testcase.yaml index 2b9461e57568..6c956a56ace9 100644 --- a/tests/drivers/fprotect/negative/testcase.yaml +++ b/tests/drivers/fprotect/negative/testcase.yaml @@ -1,10 +1,10 @@ tests: drivers.fprotect.negative: - platform_allow: nrf9160dk_nrf9160 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + platform_allow: nrf9160dk/nrf9160 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 integration_platforms: - - nrf9160dk_nrf9160 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 tags: b0 fprotect ignore_faults diff --git a/tests/drivers/fprotect/positive/testcase.yaml b/tests/drivers/fprotect/positive/testcase.yaml index dfc9b769ee34..b871b2903689 100644 --- a/tests/drivers/fprotect/positive/testcase.yaml +++ b/tests/drivers/fprotect/positive/testcase.yaml @@ -1,10 +1,10 @@ tests: drivers.fprotect.positive: - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp tags: b0 fprotect diff --git a/tests/drivers/lpuart/boards/nrf9160dk_nrf52840.overlay b/tests/drivers/lpuart/boards/nrf9160dk_nrf52840.overlay index 43675e10c83b..344ac9b01ff0 100644 --- a/tests/drivers/lpuart/boards/nrf9160dk_nrf52840.overlay +++ b/tests/drivers/lpuart/boards/nrf9160dk_nrf52840.overlay @@ -4,9 +4,9 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include -#include +#include &pinctrl { uart1_default_alt: uart1_default_alt { diff --git a/tests/drivers/lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay b/tests/drivers/lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay index dafa0edc9b71..e85fc79d2ec4 100644 --- a/tests/drivers/lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay +++ b/tests/drivers/lpuart/boards/nrf9160dk_nrf52840_0_14_0.overlay @@ -6,4 +6,4 @@ /* Use the reset line that is available starting from v0.14.0 of the DK. */ -#include +#include diff --git a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160.overlay b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160.overlay index 458063400df4..d72e9f1273a1 100644 --- a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160.overlay +++ b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160.overlay @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include &gpiote { interrupts = <13 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_0_14_0.overlay b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_0_14_0.overlay index baee66790db7..273bfea9fce9 100644 --- a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_0_14_0.overlay +++ b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_0_14_0.overlay @@ -5,4 +5,4 @@ */ /* Use the reset line that is available starting from v0.14.0 of the DK. */ -#include +#include diff --git a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_loopback.overlay b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_loopback.overlay index d6260ff97a95..e865db5a4e93 100644 --- a/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_loopback.overlay +++ b/tests/drivers/lpuart/boards/nrf9160dk_nrf9160_loopback.overlay @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ -#include +#include &gpiote { interrupts = <13 NRF_DEFAULT_IRQ_PRIORITY>; diff --git a/tests/drivers/lpuart/testcase.yaml b/tests/drivers/lpuart/testcase.yaml index ddd2c6c23712..db578e465233 100644 --- a/tests/drivers/lpuart/testcase.yaml +++ b/tests/drivers/lpuart/testcase.yaml @@ -1,8 +1,8 @@ tests: lpuart.loopback_busy_sim: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 tags: lpuart extra_args: DTC_OVERLAY_FILE="boards/nrf9160dk_nrf9160_loopback.overlay" extra_configs: @@ -10,9 +10,9 @@ tests: - CONFIG_TEST_BUSY_SIM=y lpuart.loopback_busy_sim_no_hfxo: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 tags: lpuart extra_args: DTC_OVERLAY_FILE="boards/nrf9160dk_nrf9160_loopback.overlay" extra_configs: @@ -21,18 +21,18 @@ tests: - CONFIG_TEST_BUSY_SIM=y lpuart.loopback: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 tags: lpuart extra_configs: - CONFIG_TEST_LPUART_LOOPBACK=y extra_args: DTC_OVERLAY_FILE="boards/nrf9160dk_nrf9160_loopback.overlay" lpuart.loopback_no_hfxo: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 tags: lpuart extra_args: DTC_OVERLAY_FILE="boards/nrf9160dk_nrf9160_loopback.overlay" extra_configs: @@ -40,33 +40,33 @@ tests: - CONFIG_TEST_LPUART_LOOPBACK=y lpuart.two_chip_test: - platform_allow: nrf9160dk_nrf9160 nrf9160dk_nrf52840 + platform_allow: nrf9160dk/nrf9160 nrf9160dk/nrf52840 integration_platforms: - - nrf9160dk_nrf9160 - - nrf9160dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf52840 tags: lpuart - build_only: True + build_only: true extra_configs: - CONFIG_TEST_LPUART_TIMEOUT=10 lpuart.two_chip_test_busy_sim: - platform_allow: nrf9160dk_nrf9160 nrf9160dk_nrf52840 + platform_allow: nrf9160dk/nrf9160 nrf9160dk/nrf52840 integration_platforms: - - nrf9160dk_nrf9160 - - nrf9160dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf52840 tags: lpuart - build_only: True + build_only: true extra_configs: - CONFIG_TEST_LPUART_TIMEOUT=10 - CONFIG_TEST_BUSY_SIM=y lpuart.two_chip_test_debug: - platform_allow: nrf9160dk_nrf9160 nrf9160dk_nrf52840 + platform_allow: nrf9160dk/nrf9160 nrf9160dk/nrf52840 integration_platforms: - - nrf9160dk_nrf9160 - - nrf9160dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf52840 tags: lpuart - build_only: True + build_only: true extra_args: OVERLAY_CONFIG=dbg.conf extra_configs: - CONFIG_TEST_LPUART_TIMEOUT=10 diff --git a/tests/drivers/nrfx_integration_test/testcase.yaml b/tests/drivers/nrfx_integration_test/testcase.yaml index 2362075d8a26..285c10b4c175 100644 --- a/tests/drivers/nrfx_integration_test/testcase.yaml +++ b/tests/drivers/nrfx_integration_test/testcase.yaml @@ -4,25 +4,25 @@ tests: filter: CONFIG_HAS_NRFX tags: drivers ci_build platform_allow: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpunet - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp - - nrf54h20pdk_nrf54h20_cpurad + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp - - nrf5340dk_nrf5340_cpuapp_ns - - nrf5340dk_nrf5340_cpunet - - nrf54l15pdk_nrf54l15_cpuapp - - nrf54h20pdk_nrf54h20_cpuapp - - nrf54h20pdk_nrf54h20_cpurad + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpunet + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp + - nrf54h20dk/nrf54h20/cpurad nrfx_integration_test.build.bt.softdevice: build_only: true filter: CONFIG_HAS_NRFX and CONFIG_BT_LL_SOFTDEVICE @@ -30,11 +30,11 @@ tests: extra_configs: - CONFIG_NRFX_AND_BT_LL_SOFTDEVICE=y platform_allow: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet nrfx_integration_test.build.bt.sw_split: build_only: true filter: CONFIG_HAS_NRFX and CONFIG_BT_LL_SW_SPLIT @@ -42,8 +42,8 @@ tests: extra_configs: - CONFIG_NRFX_AND_BT_LL_SW_SPLIT=y platform_allow: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpunet + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpunet diff --git a/tests/lib/at_cmd_custom/testcase.yaml b/tests/lib/at_cmd_custom/testcase.yaml index 773bfc69fc93..7c6e25f4ac7e 100644 --- a/tests/lib/at_cmd_custom/testcase.yaml +++ b/tests/lib/at_cmd_custom/testcase.yaml @@ -1,6 +1,6 @@ tests: at_cmd_custom.functionality_test: - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: at_cmd_custom diff --git a/tests/lib/date_time/testcase.yaml b/tests/lib/date_time/testcase.yaml index 3b128ef246f0..4e2e56a31bdf 100644 --- a/tests/lib/date_time/testcase.yaml +++ b/tests/lib/date_time/testcase.yaml @@ -1,7 +1,7 @@ tests: date_time.functionality_test: - platform_allow: nrf9160dk_nrf9160 qemu_x86 qemu_cortex_m3 + platform_allow: nrf9160dk/nrf9160 qemu_x86 qemu_cortex_m3 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 - qemu_cortex_m3 tags: date_time diff --git a/tests/lib/edge_impulse/testcase.yaml b/tests/lib/edge_impulse/testcase.yaml index 64f588fc507a..4f5b6d7300d1 100644 --- a/tests/lib/edge_impulse/testcase.yaml +++ b/tests/lib/edge_impulse/testcase.yaml @@ -2,14 +2,14 @@ tests: edge_impulse.ei_wrapper: platform_exclude: native_posix qemu_x86 platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 tags: edge_impulse timeout: 420 diff --git a/tests/lib/gcf_sms/testcase.yaml b/tests/lib/gcf_sms/testcase.yaml index e4705af7d650..8dfb4db87d67 100644 --- a/tests/lib/gcf_sms/testcase.yaml +++ b/tests/lib/gcf_sms/testcase.yaml @@ -1,6 +1,6 @@ tests: gcf_sms.functionality_test: - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: gcf_sms diff --git a/tests/lib/hw_unique_key/testcase.yaml b/tests/lib/hw_unique_key/testcase.yaml index 25e53454f455..4d449cd7f9f7 100644 --- a/tests/lib/hw_unique_key/testcase.yaml +++ b/tests/lib/hw_unique_key/testcase.yaml @@ -1,8 +1,8 @@ tests: lib.hw_unique_key: - platform_allow: nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 + platform_allow: nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 integration_platforms: - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 tags: huk diff --git a/tests/lib/hw_unique_key_tfm/README.txt b/tests/lib/hw_unique_key_tfm/README.txt index 5bd61f6f50d6..a463d888af84 100644 --- a/tests/lib/hw_unique_key_tfm/README.txt +++ b/tests/lib/hw_unique_key_tfm/README.txt @@ -14,4 +14,4 @@ This means that the SEGGER id of the development kit must be passed both to west Here is an example of passing the id to the build: - west build -b nrf9160dk_nrf9160_ns -- -DCONFIG_HUK_TEST_BOARD_SNR=\"901234567\" + west build -b nrf9160dk/nrf9160/ns -- -DCONFIG_HUK_TEST_BOARD_SNR=\"901234567\" diff --git a/tests/lib/hw_unique_key_tfm/testcase.yaml b/tests/lib/hw_unique_key_tfm/testcase.yaml index 453c544baaf0..03fc739de36a 100644 --- a/tests/lib/hw_unique_key_tfm/testcase.yaml +++ b/tests/lib/hw_unique_key_tfm/testcase.yaml @@ -1,8 +1,8 @@ tests: lib.hw_unique_key_tfm: - platform_allow: nrf9160dk_nrf9160_ns nrf5340dk_nrf5340_cpuapp_ns + platform_allow: nrf9160dk/nrf9160/ns nrf5340dk/nrf5340/cpuapp/ns integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp/ns tags: huk build_only: true diff --git a/tests/lib/location/CMakeLists.txt b/tests/lib/location/CMakeLists.txt index f1bf7e422213..d60da0974d42 100644 --- a/tests/lib/location/CMakeLists.txt +++ b/tests/lib/location/CMakeLists.txt @@ -33,6 +33,9 @@ cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/net_if.h FUNC_EXCLUDE ".*net_if_register_timestamp_cb" FUNC_EXCLUDE ".*net_if_call_timestamp_cb" FUNC_EXCLUDE ".*net_if_add_tx_timestamp" + FUNC_EXCLUDE ".*net_if_ipv4_get_netmask" + FUNC_EXCLUDE ".*net_if_ipv4_set_netmask" + WORD_EXCLUDE ".*deprecated.*" WORD_EXCLUDE ".*struct net_pkt.*") cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/net_mgmt.h FUNC_EXCLUDE ".*net_mgmt_event_notify" @@ -40,7 +43,9 @@ cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/net_mgmt.h FUNC_EXCLUDE ".*net_mgmt_event_wait_on_iface" WORD_EXCLUDE ".*struct net_if.*") cmock_handle(${ZEPHYR_BASE}/include/zephyr/net/wifi_mgmt.h - FUNC_EXCLUDE "NET_MGMT_DEFINE_REQUEST_HANDLER") + FUNC_EXCLUDE "NET_MGMT_DEFINE_REQUEST_HANDLER" + FUNC_EXCLUDE "BUILD_ASSERT" + FUNC_EXCLUDE "offsetof") cmock_handle(${ZEPHYR_BASE}/include/zephyr/device.h FUNC_EXCLUDE ".*DEVICE_DT_NAME_GET" WORD_EXCLUDE ".*device_visitor_callback_t.*") diff --git a/tests/lib/location/src/location_test.c b/tests/lib/location/src/location_test.c index ce90b794d729..347fbbd58d51 100644 --- a/tests/lib/location/src/location_test.c +++ b/tests/lib/location/src/location_test.c @@ -879,7 +879,7 @@ void cellular_rest_req_resp_handle(int test_event_data_index) sprintf(http_resp_body, http_resp_body_fmt, test_location_event_data[test_event_data_index].location.latitude, test_location_event_data[test_event_data_index].location.longitude, - test_location_event_data[test_event_data_index].location.accuracy); + (double)test_location_event_data[test_event_data_index].location.accuracy); sprintf(http_resp, "%s%s", http_resp_header_ok, http_resp_body); diff --git a/tests/lib/lte_lc/src/main.c b/tests/lib/lte_lc/src/main.c index 4a2196182d5e..a401882e092b 100644 --- a/tests/lib/lte_lc/src/main.c +++ b/tests/lib/lte_lc/src/main.c @@ -89,86 +89,86 @@ void test_parse_cereg(void) /* For CEREG reads, we only check the network status, as that's the only * functionality that is exposed. */ - err = parse_cereg(at_response_0, false, &status, NULL, NULL); + err = parse_cereg(at_response_0, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_NOT_REGISTERED, status); - err = parse_cereg(at_response_1, false, &status, &cell, &mode); + err = parse_cereg(at_response_1, false, &status, &cell, &mode, NULL); 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); - err = parse_cereg(at_response_2, false, &status, NULL, NULL); + err = parse_cereg(at_response_2, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_SEARCHING, status); - err = parse_cereg(at_response_3, false, &status, NULL, NULL); + err = parse_cereg(at_response_3, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTRATION_DENIED, status); - err = parse_cereg(at_response_4, false, &status, NULL, NULL); + err = parse_cereg(at_response_4, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UNKNOWN, status); - err = parse_cereg(at_response_5, false, &status, NULL, NULL); + err = parse_cereg(at_response_5, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTERED_ROAMING, status); - err = parse_cereg(at_response_90, false, &status, NULL, NULL); + err = parse_cereg(at_response_90, false, &status, NULL, NULL, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UICC_FAIL, status); - err = parse_cereg(at_response_wrong, false, &status, NULL, NULL); + err = parse_cereg(at_response_wrong, false, &status, NULL, NULL, NULL); TEST_ASSERT_NOT_EQUAL_MESSAGE(0, err, "parse_cereg should have failed"); /* For CEREG notifications, we test the parser function, which * implicitly also tests parse_nw_reg_status() for notifications. */ - err = parse_cereg(at_notif_0, true, &status, &cell, &mode); + err = parse_cereg(at_notif_0, true, &status, &cell, &mode, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_NOT_REGISTERED, status); - err = parse_cereg(at_notif_1, true, &status, &cell, &mode); + err = parse_cereg(at_notif_1, true, &status, &cell, &mode, NULL); 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(9, mode); - err = parse_cereg(at_notif_2, true, &status, &cell, &mode); + err = parse_cereg(at_notif_2, true, &status, &cell, &mode, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_SEARCHING, status); TEST_ASSERT_EQUAL(0x01020304, cell.id); TEST_ASSERT_EQUAL(0x0A0B, cell.tac); TEST_ASSERT_EQUAL(9, mode); - err = parse_cereg(at_notif_3, true, &status, &cell, &mode); + err = parse_cereg(at_notif_3, true, &status, &cell, &mode, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_REGISTRATION_DENIED, status); TEST_ASSERT_EQUAL(0x01020304, cell.id); TEST_ASSERT_EQUAL(0x0A0B, cell.tac); TEST_ASSERT_EQUAL(9, mode); - err = parse_cereg(at_notif_4, true, &status, &cell, &mode); + err = parse_cereg(at_notif_4, true, &status, &cell, &mode, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UNKNOWN, status); TEST_ASSERT_EQUAL(0xFFFFFFFF, cell.id); TEST_ASSERT_EQUAL(0xFFFF, cell.tac); TEST_ASSERT_EQUAL(9, mode); - err = parse_cereg(at_notif_5, true, &status, &cell, &mode); + err = parse_cereg(at_notif_5, true, &status, &cell, &mode, NULL); 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(9, mode); - err = parse_cereg(at_notif_90, true, &status, &cell, &mode); + err = parse_cereg(at_notif_90, true, &status, &cell, &mode, NULL); TEST_ASSERT_EQUAL(0, err); TEST_ASSERT_EQUAL(LTE_LC_NW_REG_UICC_FAIL, status); - err = parse_cereg(at_notif_wrong, true, &status, &cell, &mode); + err = parse_cereg(at_notif_wrong, true, &status, &cell, &mode, NULL); TEST_ASSERT_NOT_EQUAL_MESSAGE(0, err, "parse_cereg should have failed"); } diff --git a/tests/lib/lte_lc/testcase.yaml b/tests/lib/lte_lc/testcase.yaml index 7061726bcc0e..982bbd89620d 100644 --- a/tests/lib/lte_lc/testcase.yaml +++ b/tests/lib/lte_lc/testcase.yaml @@ -1,8 +1,8 @@ tests: lte_lc.functionality_test: - platform_allow: nrf9160dk_nrf9160 qemu_x86 native_posix qemu_cortex_m3 + platform_allow: nrf9160dk/nrf9160 qemu_x86 native_posix qemu_cortex_m3 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 - native_posix - qemu_cortex_m3 tags: lte_lc 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 758941265e00..b9053a3b7707 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 @@ -313,16 +313,6 @@ void test_lte_lc_connect_success(void) __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CSCON=1", 0); __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=1", 0); - static const char xmonitor_resp[] = - "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"002F\",7,20,\"0012BEEF\"," - "334,6200,66,44,\"\"," - "\"00000101\",\"00010011\",\"01001001\""; - __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 commands triggered by lte_lc_offline() */ __mock_nrf_modem_at_printf_ExpectAndReturn("AT+CFUN=4", 0); @@ -355,7 +345,7 @@ void test_lte_lc_connect_success(void) test_event_data[6].lte_mode = LTE_LC_LTE_MODE_NONE; /* Schedule +CEREG notification to be dispatched while lte_lc_connect() blocks */ - strcpy(at_notif, "+CEREG: 1,\"002F\",\"0012BEEF\",7\r\n"); + strcpy(at_notif, "+CEREG: 1,\"002F\",\"0012BEEF\",7,,,\"00000101\",\"00010011\"\r\n"); k_work_schedule(&at_notif_dispatch_work, K_MSEC(1)); ret = lte_lc_connect(); @@ -405,7 +395,7 @@ void test_lte_lc_connect_fallback(void) static const char xmonitor_resp[] = "%XMONITOR: 5,\"Operator\",\"OP\",\"20065\",\"003F\",9,20,\"0013BEEF\"," "334,6200,66,44,\"\"," - "\"11100000\",\"00101000\",\"11100000\""; + "\"11100000\",\"11100000\",\"00111000\""; __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(); @@ -429,7 +419,7 @@ void test_lte_lc_connect_fallback(void) test_event_data[2].lte_mode = LTE_LC_LTE_MODE_NBIOT; test_event_data[3].type = LTE_LC_EVT_PSM_UPDATE; - test_event_data[3].psm_cfg.tau = 28800; + test_event_data[3].psm_cfg.tau = 1440; test_event_data[3].psm_cfg.active_time = -1; /* De-registration */ @@ -449,12 +439,12 @@ void test_lte_lc_connect_fallback(void) TEST_ASSERT_EQUAL(0, ret); /* Schedule +CEREG notification to be dispatched after timeout to trigger fallback */ - strcpy(at_notif, "+CEREG: 5,\"003F\",\"0013BEEF\",9\r\n"); + strcpy(at_notif, "+CEREG: 5,\"003F\",\"0013BEEF\",9,,,\"11100000\",\"11100000\"\r\n"); k_work_schedule(&at_notif_dispatch_work, K_MSEC(1100)); ret = lte_lc_connect(); TEST_ASSERT_EQUAL(0, ret); - + k_sleep(K_MSEC(1)); ret = lte_lc_offline(); TEST_ASSERT_EQUAL(0, ret); @@ -1045,11 +1035,6 @@ void test_lte_lc_cereg(void) { strcpy(at_notif, "+CEREG: 1,\"4321\",\"12345678\",7,,,\"11100000\",\"00010011\"\r\n"); - static const char xmonitor_resp[] = - "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"4321\",7,20,\"12345678\"," - "334,6200,66,44,\"\"," - "\"11100000\",\"00010011\",\"01001001\""; - lte_lc_callback_count_expected = 4; test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; @@ -1075,6 +1060,43 @@ void test_lte_lc_cereg(void) test_event_data[3].psm_cfg.tau = 11400; test_event_data[3].psm_cfg.active_time = -1; + at_monitor_dispatch(at_notif); +} + +void test_lte_lc_cereg_with_xmonitor(void) +{ + strcpy(at_notif, "+CEREG: 5,\"4321\",\"87654321\",9,,,\"11100000\",\"11100000\"\r\n"); + + static const char xmonitor_resp[] = + "%XMONITOR: 1,\"Operator\",\"OP\",\"20065\",\"4321\",9,20,\"12345678\"," + "334,6200,66,44,\"\"," + "\"11100000\",\"11100000\",\"01001001\""; + + lte_lc_callback_count_expected = 4; + + test_event_data[0].type = LTE_LC_EVT_NW_REG_STATUS; + test_event_data[0].nw_reg_status = LTE_LC_NW_REG_REGISTERED_ROAMING; + + 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 = 0x4321; + 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; + + test_event_data[2].type = LTE_LC_EVT_LTE_MODE_UPDATE; + test_event_data[2].lte_mode = LTE_LC_LTE_MODE_NBIOT; + + test_event_data[3].type = LTE_LC_EVT_PSM_UPDATE; + test_event_data[3].psm_cfg.tau = 3240; + test_event_data[3].psm_cfg.active_time = -1; + __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(); @@ -1082,6 +1104,7 @@ void test_lte_lc_cereg(void) (char *)xmonitor_resp, sizeof(xmonitor_resp)); at_monitor_dispatch(at_notif); + k_sleep(K_MSEC(1)); } /* Test the following CEREG syntax: diff --git a/tests/lib/nrf_fuel_gauge/testcase.yaml b/tests/lib/nrf_fuel_gauge/testcase.yaml index 114371744c70..90a58ef06133 100644 --- a/tests/lib/nrf_fuel_gauge/testcase.yaml +++ b/tests/lib/nrf_fuel_gauge/testcase.yaml @@ -1,20 +1,20 @@ tests: unity.nrf_fuel_gauge_no_fpu: - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf52dk_nrf52810 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf52dk/nrf52810 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf52dk_nrf52810 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf52dk/nrf52810 tags: nrf_fuel_gauge build_only: true extra_args: CONFIG_FPU=n unity.nrf_fuel_gauge_fpu: - platform_allow: nrf5340dk_nrf5340_cpuapp nrf52840dk_nrf52840 nrf52dk_nrf52832 + platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840 nrf52dk/nrf52832 integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 tags: nrf_fuel_gauge build_only: true extra_args: CONFIG_FPU=y diff --git a/tests/lib/nrf_modem_lib/nrf91_sockets/prj.conf b/tests/lib/nrf_modem_lib/nrf91_sockets/prj.conf index 8b07b67148e9..45f2e81aa3af 100644 --- a/tests/lib/nrf_modem_lib/nrf91_sockets/prj.conf +++ b/tests/lib/nrf_modem_lib/nrf91_sockets/prj.conf @@ -11,7 +11,6 @@ CONFIG_MAIN_STACK_SIZE=2048 CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y -CONFIG_NET_SOCKETS_POSIX_NAMES=y CONFIG_NET_NATIVE=n CONFIG_NET_TEST=y diff --git a/tests/lib/nrf_modem_lib/nrf91_sockets/src/nrf91_sockets_test.c b/tests/lib/nrf_modem_lib/nrf91_sockets/src/nrf91_sockets_test.c index df14a9beea81..c202d6386bf3 100644 --- a/tests/lib/nrf_modem_lib/nrf91_sockets/src/nrf91_sockets_test.c +++ b/tests/lib/nrf_modem_lib/nrf91_sockets/src/nrf91_sockets_test.c @@ -57,7 +57,7 @@ static int nrf_getaddrinfo_stub(const char *p_node, const char *p_service, return test_state_nrf_getaddrinfo.ret; } -static int nrf_accept_stub(int socket, struct nrf_sockaddr *address, +static int nrf_accept_stub(int zsock_socket, struct nrf_sockaddr *address, nrf_socklen_t *address_len, int cmock_num_calls) { *address = test_state_nrf_accept.nrf_addr; @@ -73,7 +73,7 @@ static void nrf_freeaddrinfo_stub(struct nrf_addrinfo *p_res, int cmock_num_call } } -static ssize_t nrf_recvfrom_stub(int socket, void *buffer, size_t length, +static ssize_t nrf_recvfrom_stub(int zsock_socket, void *buffer, size_t length, int flags, struct nrf_sockaddr *address, nrf_socklen_t *address_len, int cmock_num_calls) @@ -92,8 +92,8 @@ static ssize_t nrf_recvfrom_stub(int socket, void *buffer, size_t length, void test_nrf91_socket_offload_getaddrinfo_errors(void) { int ret; - struct addrinfo *res; - struct addrinfo hints = { + struct zsock_addrinfo *res; + struct zsock_addrinfo hints = { .ai_family = AF_INET, .ai_socktype = SOCK_STREAM, }; @@ -128,7 +128,7 @@ void test_nrf91_socket_offload_getaddrinfo_errors(void) __cmock_nrf_getaddrinfo_IgnoreArg_hints(); __cmock_nrf_getaddrinfo_IgnoreArg_res(); - ret = getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); + ret = zsock_getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); TEST_ASSERT_EQUAL(ret, dns_errors[i]); } @@ -137,8 +137,8 @@ void test_nrf91_socket_offload_getaddrinfo_errors(void) void test_nrf91_socket_offload_getaddrinfo_eai_family(void) { int ret; - struct addrinfo *res; - struct addrinfo hints = { + struct zsock_addrinfo *res; + struct zsock_addrinfo hints = { .ai_family = AF_INET, .ai_socktype = SOCK_STREAM, }; @@ -153,7 +153,7 @@ void test_nrf91_socket_offload_getaddrinfo_eai_family(void) __cmock_nrf_getaddrinfo_Stub(nrf_getaddrinfo_stub); __cmock_nrf_freeaddrinfo_Stub(nrf_freeaddrinfo_stub); - ret = getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); + ret = zsock_getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); TEST_ASSERT_EQUAL(ret, DNS_EAI_FAMILY); } @@ -161,8 +161,8 @@ void test_nrf91_socket_offload_getaddrinfo_eai_family(void) void test_nrf91_socket_offload_getaddrinfo_ipv4_success(void) { int ret; - struct addrinfo *res; - struct addrinfo hints = { + struct zsock_addrinfo *res; + struct zsock_addrinfo hints = { .ai_family = AF_INET, .ai_socktype = SOCK_STREAM, .ai_canonname = "name", @@ -178,7 +178,7 @@ void test_nrf91_socket_offload_getaddrinfo_ipv4_success(void) __cmock_nrf_getaddrinfo_Stub(nrf_getaddrinfo_stub); __cmock_nrf_freeaddrinfo_Stub(nrf_freeaddrinfo_stub); - ret = getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); + ret = zsock_getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); TEST_ASSERT_EQUAL(ret, 0); TEST_ASSERT_EQUAL(res->ai_family, AF_INET); @@ -189,8 +189,8 @@ void test_nrf91_socket_offload_getaddrinfo_ipv4_success(void) void test_nrf91_socket_offload_getaddrinfo_ipv6_success(void) { int ret; - struct addrinfo *res; - struct addrinfo hints = { + struct zsock_addrinfo *res; + struct zsock_addrinfo hints = { .ai_family = AF_INET6, .ai_socktype = SOCK_STREAM, }; @@ -205,7 +205,7 @@ void test_nrf91_socket_offload_getaddrinfo_ipv6_success(void) __cmock_nrf_getaddrinfo_Stub(nrf_getaddrinfo_stub); __cmock_nrf_freeaddrinfo_Stub(nrf_freeaddrinfo_stub); - ret = getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); + ret = zsock_getaddrinfo(HTTPS_HOSTNAME, NULL, &hints, &res); TEST_ASSERT_EQUAL(ret, 0); @@ -218,7 +218,7 @@ void test_nrf91_socket_offload_close_ebadf(void) { int ret; - ret = close(-1); + ret = zsock_close(-1); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -235,13 +235,13 @@ void test_nrf91_socket_offload_create_close_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -255,7 +255,7 @@ void test_nrf91_socket_offload_socket_error(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, -1); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, -1); } @@ -267,7 +267,7 @@ void test_nrf91_socket_create_native_socket_eafnosupport(void) int type = SOCK_STREAM | SOCK_NATIVE; int proto = IPPROTO_TCP; - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(errno, EAFNOSUPPORT); TEST_ASSERT_EQUAL(fd, -1); @@ -280,7 +280,7 @@ void test_nrf91_socket_create_native_socket_tls_eafnosupport(void) int type = SOCK_STREAM | SOCK_NATIVE_TLS; int proto = IPPROTO_TLS_1_2; - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(errno, EAFNOSUPPORT); TEST_ASSERT_EQUAL(fd, -1); @@ -296,13 +296,13 @@ void test_nrf91_socket_offload_create_close_proto_zero_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(family, type, 0); + fd = zsock_socket(family, type, 0); TEST_ASSERT_EQUAL(fd, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -312,7 +312,7 @@ void test_nrf91_socket_offload_connect_ebadf(void) int ret; struct sockaddr address = { 0 }; - ret = connect(-1, &address, sizeof(address)); + ret = zsock_connect(-1, &address, sizeof(address)); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -333,20 +333,20 @@ void test_nrf91_socket_offload_connect_ipv4_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); __cmock_nrf_connect_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in), 0); __cmock_nrf_connect_IgnoreArg_address(); - ret = connect(fd, &address, sizeof(address)); + ret = zsock_connect(fd, &address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -366,20 +366,20 @@ void test_nrf91_socket_offload_connect_ipv6_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET6, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); __cmock_nrf_connect_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in6), 0); __cmock_nrf_connect_IgnoreArg_address(); - ret = connect(fd, &address, sizeof(address)); + ret = zsock_connect(fd, &address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -396,25 +396,25 @@ void test_nrf91_socket_offload_connect_non_ip_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_PACKET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); __cmock_nrf_connect_ExpectAndReturn(nrf_fd, NULL, sizeof(address), 0); __cmock_nrf_connect_IgnoreArg_address(); - ret = connect(fd, &address, sizeof(address)); + ret = zsock_connect(fd, &address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } -/* The check for wrong socket is done in Zephyr before calling the offloading layer. +/* The check for wrong zsock_socket is done in Zephyr before calling the offloading layer. * Still keeping this test since it proves that this case is being handled no matter the * Zephyr implementation. */ @@ -427,7 +427,7 @@ void test_nrf91_socket_offload_bind_ebadf(void) address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(PORT); - ret = bind(-1, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(-1, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -441,20 +441,20 @@ void test_nrf91_socket_offload_bind_eafnosupport(void) struct sockaddr_in address; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET, SOCK_STREAM, 0); address.sin_family = WRONG_VALUE; address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(PORT); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EAFNOSUPPORT); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -467,7 +467,7 @@ void test_nrf91_socket_offload_bind_ipv4_success(void) struct sockaddr_in address; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET, SOCK_STREAM, 0); address.sin_family = AF_INET; address.sin_addr.s_addr = INADDR_ANY; @@ -476,13 +476,13 @@ void test_nrf91_socket_offload_bind_ipv4_success(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -495,7 +495,7 @@ void test_nrf91_socket_offload_bind_ipv6_success(void) struct sockaddr_in address; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET6, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET6, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET6, SOCK_STREAM, 0); address.sin_family = AF_INET6; address.sin_addr.s_addr = INADDR_ANY; @@ -504,13 +504,13 @@ void test_nrf91_socket_offload_bind_ipv6_success(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in6), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -519,7 +519,7 @@ void test_nrf91_socket_offload_listen_ebadf(void) { int ret; - ret = listen(-1, 1); + ret = zsock_listen(-1, 1); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -534,7 +534,7 @@ void test_nrf91_socket_offload_listen_success(void) int backlog = 1; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET6, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET6, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET6, SOCK_STREAM, 0); address.sin_family = AF_INET6; address.sin_addr.s_addr = INADDR_ANY; @@ -543,19 +543,19 @@ void test_nrf91_socket_offload_listen_success(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in6), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_listen_ExpectAndReturn(nrf_fd, backlog, 0); - ret = listen(fd, backlog); + ret = zsock_listen(fd, backlog); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -570,7 +570,7 @@ void test_nrf91_socket_offload_accept_ebadf(void) address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(PORT); - ret = accept(-1, (struct sockaddr *)&address, (socklen_t *)&addrlen); + ret = zsock_accept(-1, (struct sockaddr *)&address, (socklen_t *)&addrlen); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -585,7 +585,7 @@ void test_nrf91_socket_offload_accept_addr_null_addrlen_null_error(void) int backlog = 1; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET, SOCK_STREAM, 0); address.sin_family = AF_INET; address.sin_addr.s_addr = INADDR_ANY; @@ -594,25 +594,25 @@ void test_nrf91_socket_offload_accept_addr_null_addrlen_null_error(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_listen_ExpectAndReturn(nrf_fd, backlog, 0); - ret = listen(fd, backlog); + ret = zsock_listen(fd, backlog); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_accept_ExpectAndReturn(nrf_fd, NULL, NULL, -2); - ret = accept(fd, NULL, NULL); + ret = zsock_accept(fd, NULL, NULL); TEST_ASSERT_EQUAL(ret, -1); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -629,7 +629,7 @@ void test_nrf91_socket_offload_accept_addr_not_null_addrlen_not_null_enotsup(voi int backlog = 1; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET, SOCK_STREAM, 0); address.sin_family = AF_INET; address.sin_addr.s_addr = INADDR_ANY; @@ -638,13 +638,13 @@ void test_nrf91_socket_offload_accept_addr_not_null_addrlen_not_null_enotsup(voi __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_listen_ExpectAndReturn(nrf_fd, backlog, 0); - ret = listen(fd, backlog); + ret = zsock_listen(fd, backlog); TEST_ASSERT_EQUAL(ret, 0); @@ -655,7 +655,7 @@ void test_nrf91_socket_offload_accept_addr_not_null_addrlen_not_null_enotsup(voi __cmock_nrf_accept_Stub(nrf_accept_stub); __cmock_nrf_close_ExpectAndReturn(accept_fd, 0); - ret = accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); + ret = zsock_accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, ENOTSUP); @@ -663,7 +663,7 @@ void test_nrf91_socket_offload_accept_addr_not_null_addrlen_not_null_enotsup(voi __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -682,7 +682,7 @@ void test_nrf91_socket_offload_accept_ipv4_success(void) int z_fd = 1; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET, SOCK_STREAM, 0); address.sin_family = AF_INET; address.sin_port = htons(PORT); @@ -690,13 +690,13 @@ void test_nrf91_socket_offload_accept_ipv4_success(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_listen_ExpectAndReturn(nrf_fd, backlog, 0); - ret = listen(fd, backlog); + ret = zsock_listen(fd, backlog); TEST_ASSERT_EQUAL(ret, 0); @@ -705,14 +705,14 @@ void test_nrf91_socket_offload_accept_ipv4_success(void) __cmock_nrf_accept_Stub(nrf_accept_stub); - ret = accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); + ret = zsock_accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); TEST_ASSERT_EQUAL(ret, z_fd); TEST_ASSERT_EQUAL(addrlen, addrlen_unchanged); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); @@ -733,7 +733,7 @@ void test_nrf91_socket_offload_accept_ipv6_success(void) int z_fd = 1; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET6, NRF_SOCK_STREAM, 0, nrf_fd); - fd = socket(AF_INET6, SOCK_STREAM, 0); + fd = zsock_socket(AF_INET6, SOCK_STREAM, 0); address.sin6_family = AF_INET6; address.sin6_port = htons(PORT); @@ -741,13 +741,13 @@ void test_nrf91_socket_offload_accept_ipv6_success(void) __cmock_nrf_bind_ExpectAndReturn(nrf_fd, NULL, sizeof(struct nrf_sockaddr_in6), 0); __cmock_nrf_bind_IgnoreArg_address(); - ret = bind(fd, (struct sockaddr *)&address, sizeof(address)); + ret = zsock_bind(fd, (struct sockaddr *)&address, sizeof(address)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_listen_ExpectAndReturn(nrf_fd, backlog, 0); - ret = listen(fd, backlog); + ret = zsock_listen(fd, backlog); TEST_ASSERT_EQUAL(ret, 0); @@ -756,14 +756,14 @@ void test_nrf91_socket_offload_accept_ipv6_success(void) __cmock_nrf_accept_Stub(nrf_accept_stub); - ret = accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); + ret = zsock_accept(fd, (struct sockaddr *)&address, (socklen_t *)&addrlen); TEST_ASSERT_EQUAL(ret, z_fd); TEST_ASSERT_EQUAL(addrlen, addrlen_unchanged); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); @@ -774,7 +774,7 @@ void test_nrf91_socket_offload_setsockopt_ebadf(void) { int ret; - ret = setsockopt(-1, 0, 0, NULL, 0); + ret = zsock_setsockopt(-1, 0, 0, NULL, 0); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -792,17 +792,17 @@ void test_nrf91_socket_offload_setsockopt_bindtodevice_eopnotsup(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - ret = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &data, sizeof(data)); + ret = zsock_setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &data, sizeof(data)); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EOPNOTSUPP); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -819,7 +819,7 @@ void test_nrf91_socket_offload_setsockopt_rcvtimeo_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -827,12 +827,12 @@ void test_nrf91_socket_offload_setsockopt_rcvtimeo_success(void) NULL, sizeof(struct nrf_timeval), 0); __cmock_nrf_setsockopt_IgnoreArg_option_value(); - ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, sizeof(data)); + ret = zsock_setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, sizeof(data)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -849,7 +849,7 @@ void test_nrf91_socket_offload_setsockopt_sndtimeo_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -857,13 +857,13 @@ void test_nrf91_socket_offload_setsockopt_sndtimeo_success(void) NULL, sizeof(struct nrf_timeval), 0); __cmock_nrf_setsockopt_IgnoreArg_option_value(); - ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, sizeof(data)); + ret = zsock_setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, sizeof(data)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -880,7 +880,7 @@ void test_nrf91_socket_offload_setsockopt_tls_session_cache_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -888,13 +888,13 @@ void test_nrf91_socket_offload_setsockopt_tls_session_cache_success(void) NULL, sizeof(int), 0); __cmock_nrf_setsockopt_IgnoreArg_option_value(); - ret = setsockopt(fd, SOL_TLS, TLS_SESSION_CACHE, &data, sizeof(data)); + ret = zsock_setsockopt(fd, SOL_TLS, TLS_SESSION_CACHE, &data, sizeof(data)); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -903,7 +903,7 @@ void test_nrf91_socket_offload_getsockopt_ebadf(void) { int ret; - ret = getsockopt(-1, 0, 0, NULL, NULL); + ret = zsock_getsockopt(-1, 0, 0, NULL, NULL); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -922,7 +922,7 @@ void test_nrf91_socket_offload_getsockopt_rcvtimeo_error(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -931,13 +931,13 @@ void test_nrf91_socket_offload_getsockopt_rcvtimeo_error(void) __cmock_nrf_getsockopt_IgnoreArg_option_value(); __cmock_nrf_getsockopt_IgnoreArg_option_len(); - ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, &data_len); + ret = zsock_getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, &data_len); TEST_ASSERT_EQUAL(ret, -1); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -955,7 +955,7 @@ void test_nrf91_socket_offload_getsockopt_sndtimeo_error(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -964,13 +964,13 @@ void test_nrf91_socket_offload_getsockopt_sndtimeo_error(void) __cmock_nrf_getsockopt_IgnoreArg_option_value(); __cmock_nrf_getsockopt_IgnoreArg_option_len(); - ret = getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, &data_len); + ret = zsock_getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, &data_len); TEST_ASSERT_EQUAL(ret, -1); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -988,7 +988,7 @@ void test_nrf91_socket_offload_getsockopt_rcvtimeo_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -1002,14 +1002,14 @@ void test_nrf91_socket_offload_getsockopt_rcvtimeo_success(void) */ data_len = data_len + 1; - ret = getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, &data_len); + ret = zsock_getsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &data, &data_len); TEST_ASSERT_EQUAL(ret, 0); TEST_ASSERT_EQUAL(data_len, sizeof(struct timeval)); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1027,7 +1027,7 @@ void test_nrf91_socket_offload_getsockopt_sndtimeo_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -1041,14 +1041,14 @@ void test_nrf91_socket_offload_getsockopt_sndtimeo_success(void) */ data_len = data_len + 1; - ret = getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, &data_len); + ret = zsock_getsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &data, &data_len); TEST_ASSERT_EQUAL(ret, 0); TEST_ASSERT_EQUAL(data_len, sizeof(struct timeval)); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1066,7 +1066,7 @@ void test_nrf91_socket_offload_getsockopt_so_error_success(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); @@ -1075,14 +1075,14 @@ void test_nrf91_socket_offload_getsockopt_so_error_success(void) __cmock_nrf_getsockopt_IgnoreArg_option_len(); __cmock_nrf_modem_os_errno_set_Expect(data); - ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &data, &data_len); + ret = zsock_getsockopt(fd, SOL_SOCKET, SO_ERROR, &data, &data_len); TEST_ASSERT_EQUAL(ret, 0); TEST_ASSERT_EQUAL(data, errno); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1091,7 +1091,7 @@ void test_nrf91_socket_offload_recvfrom_ebadf(void) { int ret; - ret = recvfrom(-1, NULL, 0, 0, NULL, NULL); + ret = zsock_recvfrom(-1, NULL, 0, 0, NULL, NULL); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -1107,17 +1107,17 @@ void test_nrf91_socket_offload_recvfrom_from_null_error(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_WAITALL; + int flags = ZSOCK_MSG_WAITALL; socklen_t fromlen = 0; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Expect that with `from` NULL the modem library call receives a forced @@ -1126,13 +1126,13 @@ void test_nrf91_socket_offload_recvfrom_from_null_error(void) __cmock_nrf_recvfrom_ExpectAndReturn(nrf_fd, data, data_len, NRF_MSG_WAITALL, NULL, NULL, -1); - ret = recvfrom(fd, data, data_len, flags, NULL, &fromlen); + ret = zsock_recvfrom(fd, data, data_len, flags, NULL, &fromlen); TEST_ASSERT_EQUAL(ret, -1); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1147,17 +1147,17 @@ void test_nrf91_socket_offload_recvfrom_from_null_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_WAITALL; + int flags = ZSOCK_MSG_WAITALL; socklen_t fromlen = 0; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Expect that with `from` NULL the modem library call receives a forced @@ -1166,13 +1166,13 @@ void test_nrf91_socket_offload_recvfrom_from_null_success(void) __cmock_nrf_recvfrom_ExpectAndReturn(nrf_fd, data, data_len, NRF_MSG_WAITALL, NULL, NULL, 8); - ret = recvfrom(fd, data, data_len, flags, NULL, &fromlen); + ret = zsock_recvfrom(fd, data, data_len, flags, NULL, &fromlen); TEST_ASSERT_EQUAL(ret, 8); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1187,18 +1187,18 @@ void test_nrf91_socket_offload_recvfrom_ipv4_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_WAITALL; + int flags = ZSOCK_MSG_WAITALL; struct sockaddr from = { 0 }; socklen_t fromlen = 0; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ test_state_nrf_recvfrom.cliaddr.sa_family = NRF_AF_INET; @@ -1207,7 +1207,7 @@ void test_nrf91_socket_offload_recvfrom_ipv4_success(void) __cmock_nrf_recvfrom_Stub(nrf_recvfrom_stub); - ret = recvfrom(fd, data, data_len, flags, &from, &fromlen); + ret = zsock_recvfrom(fd, data, data_len, flags, &from, &fromlen); TEST_ASSERT_EQUAL(ret, 8); TEST_ASSERT_EQUAL(from.sa_family, AF_INET); @@ -1215,7 +1215,7 @@ void test_nrf91_socket_offload_recvfrom_ipv4_success(void) __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1230,18 +1230,18 @@ void test_nrf91_socket_offload_recvfrom_ipv6_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_WAITALL; + int flags = ZSOCK_MSG_WAITALL; struct sockaddr from = { 0 }; socklen_t fromlen = 0; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ test_state_nrf_recvfrom.cliaddr.sa_family = NRF_AF_INET6; @@ -1250,7 +1250,7 @@ void test_nrf91_socket_offload_recvfrom_ipv6_success(void) __cmock_nrf_recvfrom_Stub(nrf_recvfrom_stub); - ret = recvfrom(fd, data, data_len, flags, &from, &fromlen); + ret = zsock_recvfrom(fd, data, data_len, flags, &from, &fromlen); TEST_ASSERT_EQUAL(ret, 8); TEST_ASSERT_EQUAL(from.sa_family, AF_INET6); @@ -1258,7 +1258,7 @@ void test_nrf91_socket_offload_recvfrom_ipv6_success(void) __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1267,7 +1267,7 @@ void test_nrf91_socket_offload_sendto_ebadf(void) { int ret; - ret = sendto(-1, NULL, 0, 0, NULL, 0); + ret = zsock_sendto(-1, NULL, 0, 0, NULL, 0); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -1283,16 +1283,16 @@ void test_nrf91_socket_offload_sendto_to_null_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Observe that the `tolen` parameter will be changed to zero when @@ -1300,13 +1300,13 @@ void test_nrf91_socket_offload_sendto_to_null_success(void) */ __cmock_nrf_sendto_ExpectAndReturn(nrf_fd, data, data_len, NRF_MSG_DONTWAIT, NULL, 0, 8); - ret = sendto(fd, data, data_len, flags, NULL, 42); + ret = zsock_sendto(fd, data, data_len, flags, NULL, 42); TEST_ASSERT_EQUAL(ret, 8); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1321,17 +1321,17 @@ void test_nrf91_socket_offload_sendto_ipv4_error(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct sockaddr to = { .sa_family = family }; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Observe that the `tolen` parameter will be changed to size of struct @@ -1343,13 +1343,13 @@ void test_nrf91_socket_offload_sendto_ipv4_error(void) sizeof(struct nrf_sockaddr_in), -1); __cmock_nrf_sendto_IgnoreArg_dest_addr(); - ret = sendto(fd, data, data_len, flags, &to, 42); + ret = zsock_sendto(fd, data, data_len, flags, &to, 42); TEST_ASSERT_EQUAL(ret, -1); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1364,17 +1364,17 @@ void test_nrf91_socket_offload_sendto_ipv4_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct sockaddr to = { .sa_family = family }; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Observe that the `tolen` parameter will be changed to size of struct @@ -1386,13 +1386,13 @@ void test_nrf91_socket_offload_sendto_ipv4_success(void) sizeof(struct nrf_sockaddr_in), 8); __cmock_nrf_sendto_IgnoreArg_dest_addr(); - ret = sendto(fd, data, data_len, flags, &to, 42); + ret = zsock_sendto(fd, data, data_len, flags, &to, 42); TEST_ASSERT_EQUAL(ret, 8); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1407,17 +1407,17 @@ void test_nrf91_socket_offload_sendto_ipv6_success(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct sockaddr to = { .sa_family = family }; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET6, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ /* Observe that the `tolen` parameter will be changed to size of struct @@ -1429,13 +1429,13 @@ void test_nrf91_socket_offload_sendto_ipv6_success(void) sizeof(struct nrf_sockaddr_in6), 8); __cmock_nrf_sendto_IgnoreArg_dest_addr(); - ret = sendto(fd, data, data_len, flags, &to, 42); + ret = zsock_sendto(fd, data, data_len, flags, &to, 42); TEST_ASSERT_EQUAL(ret, 8); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1450,27 +1450,27 @@ void test_nrf91_socket_offload_sendto_not_ipv4_not_ipv6_eafnosupport(void) int proto = IPPROTO_TCP; uint8_t data[8] = { 1 }; size_t data_len = sizeof(data); - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct sockaddr to = { 0 }; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ - ret = sendto(fd, data, data_len, flags, &to, 42); + ret = zsock_sendto(fd, data, data_len, flags, &to, 42); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EAFNOSUPPORT); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1479,7 +1479,7 @@ void test_nrf91_socket_offload_sendmsg_ebadf(void) { int ret; - ret = sendmsg(-1, NULL, 0); + ret = zsock_sendmsg(-1, NULL, 0); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EBADF); @@ -1493,26 +1493,26 @@ void test_nrf91_socket_offload_sendmsg_msg_null_einval(void) int family = AF_INET; int type = SOCK_STREAM; int proto = IPPROTO_TCP; - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ - ret = sendmsg(fd, NULL, flags); + ret = zsock_sendmsg(fd, NULL, flags); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EINVAL); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1525,7 +1525,7 @@ void test_nrf91_socket_offload_sendmsg_fits_buf(void) int family = AF_INET; int type = SOCK_STREAM; int proto = IPPROTO_TCP; - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct msghdr msg = { 0 }; struct iovec chunks[2] = { 0 }; int chunk_1 = 42; @@ -1533,12 +1533,12 @@ void test_nrf91_socket_offload_sendmsg_fits_buf(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ chunks[0].iov_base = &chunk_1; @@ -1553,13 +1553,13 @@ void test_nrf91_socket_offload_sendmsg_fits_buf(void) NULL, 0, 2 * sizeof(int)); __cmock_nrf_sendto_IgnoreArg_message(); - ret = sendmsg(fd, &msg, flags); + ret = zsock_sendmsg(fd, &msg, flags); TEST_ASSERT_EQUAL(ret, 2 * sizeof(int)); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1572,7 +1572,7 @@ void test_nrf91_socket_offload_sendmsg_not_fits_buf(void) int family = AF_INET; int type = SOCK_STREAM; int proto = IPPROTO_TCP; - int flags = MSG_DONTWAIT; + int flags = ZSOCK_MSG_DONTWAIT; struct msghdr msg = { 0 }; struct iovec chunks[3] = { 0 }; @@ -1585,12 +1585,12 @@ void test_nrf91_socket_offload_sendmsg_not_fits_buf(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ chunks[0].iov_base = &chunk_1; @@ -1618,13 +1618,13 @@ void test_nrf91_socket_offload_sendmsg_not_fits_buf(void) NULL, 0, sizeof(int)); __cmock_nrf_sendto_IgnoreArg_message(); - ret = sendmsg(fd, &msg, flags); + ret = zsock_sendmsg(fd, &msg, flags); TEST_ASSERT_EQUAL(ret, 3 * sizeof(int)); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1641,22 +1641,22 @@ void test_nrf91_socket_offload_fcntl_einval(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ - ret = fcntl(fd, wrong_command); + ret = zsock_fcntl(fd, wrong_command); TEST_ASSERT_EQUAL(ret, -1); TEST_ASSERT_EQUAL(errno, EINVAL); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1672,23 +1672,23 @@ void test_nrf91_socket_offload_fcntl_f_setfl(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ __cmock_nrf_fcntl_ExpectAndReturn(nrf_fd, NRF_F_SETFL, NRF_O_NONBLOCK, 0); - ret = fcntl(fd, F_SETFL, O_NONBLOCK); + ret = zsock_fcntl(fd, F_SETFL, O_NONBLOCK); TEST_ASSERT_EQUAL(ret, 0); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1704,23 +1704,23 @@ void test_nrf91_socket_offload_fcntl_f_getfl(void) __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_STREAM, NRF_IPPROTO_TCP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); - /* Skip connect, etc. since for testing we just - * need a working socket + /* Skip zsock_connect, etc. since for testing we just + * need a working zsock_socket */ __cmock_nrf_fcntl_ExpectAndReturn(nrf_fd, NRF_F_GETFL, 0, NRF_O_NONBLOCK); - ret = fcntl(fd, F_GETFL); + ret = zsock_fcntl(fd, F_GETFL); TEST_ASSERT_EQUAL(ret, O_NONBLOCK); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } @@ -1753,31 +1753,31 @@ void test_nrf91_socket_offload_poll(void) int family = AF_INET; int type = SOCK_DGRAM; int proto = IPPROTO_UDP; - struct pollfd fds[3] = { 0 }; + struct zsock_pollfd fds[3] = { 0 }; __cmock_nrf_socket_ExpectAndReturn(NRF_AF_INET, NRF_SOCK_DGRAM, NRF_IPPROTO_UDP, nrf_fd); - fd = socket(family, type, proto); + fd = zsock_socket(family, type, proto); TEST_ASSERT_EQUAL(fd, 0); fds[0].fd = fd; - fds[0].events = POLLOUT; + fds[0].events = ZSOCK_POLLOUT; fds[1].fd = 42; - fds[1].events = POLLOUT; + fds[1].events = ZSOCK_POLLOUT; fds[2].fd = 43; - fds[2].events = POLLOUT; + fds[2].events = ZSOCK_POLLOUT; __cmock_nrf_setsockopt_Stub(stub_nrf_setsockopt_pollcb); - ret = poll(fds, 3, 0); + ret = zsock_poll(fds, 3, 0); TEST_ASSERT_EQUAL(3, ret); - TEST_ASSERT_EQUAL(POLLOUT, fds[0].revents); - TEST_ASSERT_EQUAL(POLLNVAL, fds[1].revents); - TEST_ASSERT_EQUAL(POLLNVAL, fds[2].revents); + TEST_ASSERT_EQUAL(ZSOCK_POLLOUT, fds[0].revents); + TEST_ASSERT_EQUAL(ZSOCK_POLLNVAL, fds[1].revents); + TEST_ASSERT_EQUAL(ZSOCK_POLLNVAL, fds[2].revents); __cmock_nrf_close_ExpectAndReturn(nrf_fd, 0); - ret = close(fd); + ret = zsock_close(fd); TEST_ASSERT_EQUAL(ret, 0); } diff --git a/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c b/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c index 36892c4f575e..b69a456c3ac5 100644 --- a/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c +++ b/tests/lib/nrf_modem_lib/nrf_modem_lib_trace/src/main.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/tests/lib/ram_pwrdn/testcase.yaml b/tests/lib/ram_pwrdn/testcase.yaml index df3b1da3d7cc..c426a7f04343 100644 --- a/tests/lib/ram_pwrdn/testcase.yaml +++ b/tests/lib/ram_pwrdn/testcase.yaml @@ -1,6 +1,6 @@ tests: ram_pwrdn.functionality_test: - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: ram_pwrdn diff --git a/tests/lib/sfloat/src/main.c b/tests/lib/sfloat/src/main.c index c93758a05169..acfa7a286120 100644 --- a/tests/lib/sfloat/src/main.c +++ b/tests/lib/sfloat/src/main.c @@ -109,6 +109,6 @@ ZTEST(sfloat_suite, test_sfloat_from_float) res = sfloat_from_float(in_float); zassert_true(res.val == out_sfloat.val, "comparison failed for the sample[%d] equal to %f: 0x%04X != 0x%04X", - i, in_float, res.val, out_sfloat.val); + i, (double)in_float, res.val, out_sfloat.val); } } diff --git a/tests/lib/sfloat/testcase.yaml b/tests/lib/sfloat/testcase.yaml index 40727755852c..6f420a62eb76 100644 --- a/tests/lib/sfloat/testcase.yaml +++ b/tests/lib/sfloat/testcase.yaml @@ -1,9 +1,9 @@ tests: lib.sfloat: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + nrf52dk/nrf52832 nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp tags: sfloat diff --git a/tests/modules/mcuboot/direct_xip/testcase.yaml b/tests/modules/mcuboot/direct_xip/testcase.yaml index 0c68e1c6f0a2..cc2ca7486a72 100644 --- a/tests/modules/mcuboot/direct_xip/testcase.yaml +++ b/tests/modules/mcuboot/direct_xip/testcase.yaml @@ -1,10 +1,10 @@ tests: mcuboot.direct_xip: tags: mcuboot direct_xip - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/modules/mcuboot/external_flash/testcase.yaml b/tests/modules/mcuboot/external_flash/testcase.yaml index 8e4b5e84052a..4c8baf4d3a0c 100644 --- a/tests/modules/mcuboot/external_flash/testcase.yaml +++ b/tests/modules/mcuboot/external_flash/testcase.yaml @@ -1,8 +1,8 @@ tests: mcuboot.external_flash: - platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp thingy53_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp thingy53/nrf5340/cpuapp tags: mcuboot external_flash integration_platforms: - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - thingy53_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp diff --git a/tests/nrf5340_audio/sw_codec_lc3/readme.txt b/tests/nrf5340_audio/sw_codec_lc3/readme.txt index 7c662c26b9c2..72ab62119df4 100644 --- a/tests/nrf5340_audio/sw_codec_lc3/readme.txt +++ b/tests/nrf5340_audio/sw_codec_lc3/readme.txt @@ -3,4 +3,4 @@ This test can only be run on nRF5340 Audio application because the `qemu_cortex_ To run the test on target, run the following command, with the COM port (here, `/dev/ttyACM2`) set to the APP port of your development kit: -zephyr/scripts/twister --device-testing --device-serial /dev/ttyACM2 --platform nrf5340dk_nrf5340_cpuapp -T nrf/tests/nrf5340_audio/sw_codec_lc3 -v +zephyr/scripts/twister --device-testing --device-serial /dev/ttyACM2 --platform nrf5340dk/nrf5340/cpuapp -T nrf/tests/nrf5340_audio/sw_codec_lc3 -v diff --git a/tests/nrf5340_audio/sw_codec_lc3/testcase.yaml b/tests/nrf5340_audio/sw_codec_lc3/testcase.yaml index e5d0071e2563..82afe6f6c71b 100644 --- a/tests/nrf5340_audio/sw_codec_lc3/testcase.yaml +++ b/tests/nrf5340_audio/sw_codec_lc3/testcase.yaml @@ -1,8 +1,8 @@ tests: nrf5340_audio.sw_codec_lc3_test: - platform_allow: nrf5340dk_nrf5340_cpuapp nrf5340_audio_dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp nrf5340_audio_dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp - - nrf5340_audio_dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp + - nrf5340_audio_dk/nrf5340/cpuapp tags: sw_codec_lc3 timeout: 20 diff --git a/tests/subsys/app_event_manager/testcase.yaml b/tests/subsys/app_event_manager/testcase.yaml index 7f7fe626dfe0..7d5fc70fb7f5 100644 --- a/tests/subsys/app_event_manager/testcase.yaml +++ b/tests/subsys/app_event_manager/testcase.yaml @@ -1,26 +1,26 @@ tests: app_event_manager.core: platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 tags: app_event_manager app_event_manager.size_enabled: extra_args: OVERLAY_CONFIG=overlay-event_size.conf platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 tags: app_event_manager diff --git a/tests/subsys/audio_module/src/bad_param_test.c b/tests/subsys/audio_module/src/bad_param_test.c index ef18fcf60a9e..1439aae03332 100644 --- a/tests/subsys/audio_module/src/bad_param_test.c +++ b/tests/subsys/audio_module/src/bad_param_test.c @@ -63,7 +63,7 @@ static void test_initialize_handle(struct audio_module_handle *test_handle, char enum audio_module_state state, struct data_fifo *fifo_tx, struct data_fifo *fifo_rx) { - memcpy(&test_handle->name[0], instance_name, CONFIG_AUDIO_MODULE_NAME_SIZE); + strncpy(&test_handle->name[0], instance_name, CONFIG_AUDIO_MODULE_NAME_SIZE); test_handle->name[CONFIG_AUDIO_MODULE_NAME_SIZE] = '\0'; test_handle->description = description; test_handle->state = state; diff --git a/tests/subsys/audio_module/src/functional_test.c b/tests/subsys/audio_module/src/functional_test.c index 8483083c2068..fa6e459a9061 100644 --- a/tests/subsys/audio_module/src/functional_test.c +++ b/tests/subsys/audio_module/src/functional_test.c @@ -403,7 +403,7 @@ static void test_connections(bool connect, enum audio_module_type from_type, } test_initialize_handle(&handle_from, &test_from_description, NULL, NULL); - memcpy(&handle_from.name, test_inst_from_name, CONFIG_AUDIO_MODULE_NAME_SIZE); + strncpy(handle_from.name, test_inst_from_name, CONFIG_AUDIO_MODULE_NAME_SIZE); handle_from.state = from_state; sys_slist_init(&handle_from.handle_dest_list); k_mutex_init(&handle_from.dest_mutex); diff --git a/tests/subsys/audio_module/testcase.yaml b/tests/subsys/audio_module/testcase.yaml index d2e513b60c1f..f21ac9ed5b7f 100644 --- a/tests/subsys/audio_module/testcase.yaml +++ b/tests/subsys/audio_module/testcase.yaml @@ -1,7 +1,7 @@ tests: nrf5340_audio.audio_module_test: - platform_allow: qemu_cortex_m3 nrf5340dk_nrf5340_cpuapp + platform_allow: qemu_cortex_m3 nrf5340dk/nrf5340/cpuapp integration_platforms: - qemu_cortex_m3 - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp tags: audio_module nrf5340_audio_unit_tests diff --git a/tests/subsys/bluetooth/fast_pair/crypto/Kconfig b/tests/subsys/bluetooth/fast_pair/crypto/Kconfig index 3d29c69ab100..fc1772682d7c 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/Kconfig +++ b/tests/subsys/bluetooth/fast_pair/crypto/Kconfig @@ -4,6 +4,31 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +config TEST_BT_FAST_PAIR_CRYPTO_PSA + bool "Enable PSA backend and dependencies" + help + The helper Kconfig option is used by the test to enable PSA backend + and set proper TFM build profile. Used to avoid board-specific Kconfig + overlays. + +if TEST_BT_FAST_PAIR_CRYPTO_PSA + +choice BT_FAST_PAIR_CRYPTO_BACKEND + default BT_FAST_PAIR_CRYPTO_PSA +endchoice + +if BUILD_WITH_TFM + +choice TFM_PROFILE_TYPE + default TFM_PROFILE_TYPE_NOT_SET + help + The minimal TFM build profile is not configurable and cannot be used. +endchoice + +endif # BUILD_WITH_TFM + +endif # TEST_BT_FAST_PAIR_CRYPTO_PSA + menu "Test configuration" source "$(ZEPHYR_NRF_MODULE_DIR)/subsys/bluetooth/services/fast_pair/fp_crypto/Kconfig.fp_crypto" endmenu diff --git a/tests/subsys/bluetooth/fast_pair/crypto/prj_psa.conf b/tests/subsys/bluetooth/fast_pair/crypto/prj_psa.conf new file mode 100644 index 000000000000..5d13b8466ac7 --- /dev/null +++ b/tests/subsys/bluetooth/fast_pair/crypto/prj_psa.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y +CONFIG_ZTEST_SHUFFLE=y +CONFIG_ZTEST_SHUFFLE_SUITE_REPEAT_COUNT=1 +CONFIG_ZTEST_SHUFFLE_TEST_REPEAT_COUNT=2 +# Set crypto backend through a helper option to enable dependencies too. +CONFIG_TEST_BT_FAST_PAIR_CRYPTO_PSA=y diff --git a/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml b/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml index 377df8f41b52..62affdee5306 100644 --- a/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml +++ b/tests/subsys/bluetooth/fast_pair/crypto/testcase.yaml @@ -1,28 +1,56 @@ tests: fast_pair.crypto.mbedtls: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp extra_args: CONF_FILE=prj_mbedtls.conf fast_pair.crypto.oberon: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + fast_pair.crypto.psa: + platform_allow: + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - nrf54l15pdk/nrf54l15/cpuapp/ns + extra_args: CONF_FILE=prj_psa.conf fast_pair.crypto.tinycrypt: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns - qemu_cortex_m3 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp + - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp - qemu_cortex_m3 extra_args: CONF_FILE=prj_tinycrypt.conf diff --git a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/testcase.yaml b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/testcase.yaml index 8adafee68a0b..e767d43604d2 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/testcase.yaml +++ b/tests/subsys/bluetooth/fast_pair/storage/account_key_storage/testcase.yaml @@ -1,16 +1,18 @@ tests: fast_pair.storage.account_key_storage.default: platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp - qemu_cortex_m3 fast_pair.storage.account_key_storage.6keys: platform_allow: diff --git a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/CMakeLists.txt b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/CMakeLists.txt index 206d9a4081ac..04fcfb46a166 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/CMakeLists.txt +++ b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/CMakeLists.txt @@ -20,3 +20,6 @@ target_include_directories(app PRIVATE ../common/include) set(NCS_FAST_PAIR_BASE ${ZEPHYR_NRF_MODULE_DIR}/subsys/bluetooth/services/fast_pair) add_subdirectory(${NCS_FAST_PAIR_BASE}/fp_storage fp_storage) target_link_libraries(app PRIVATE fp_storage) + +# For strnlen() +target_compile_definitions(app PRIVATE _POSIX_C_SOURCE=200809L) 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 0f215f2cf262..6b658cda6a4b 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 @@ -477,5 +477,5 @@ void test_main(void) (test_stage == RESET_TEST_STAGE_INTERRUPTED), "Invalid test stage"); - ztest_run_all(NULL); + ztest_run_all(NULL, false, 1, 1); } diff --git a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/testcase.yaml b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/testcase.yaml index 202972283348..581cf6ed9e22 100644 --- a/tests/subsys/bluetooth/fast_pair/storage/factory_reset/testcase.yaml +++ b/tests/subsys/bluetooth/fast_pair/storage/factory_reset/testcase.yaml @@ -2,55 +2,57 @@ tests: fast_pair.storage.factory_reset.default: platform_exclude: native_posix platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf5340dk/nrf5340/cpuapp/ns + - nrf54l15pdk/nrf54l15/cpuapp fast_pair.storage.factory_reset.no_reboot: platform_allow: - native_posix - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - native_posix - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_REBOOT=n fast_pair.storage.factory_reset.6keys: platform_exclude: native_posix platform_allow: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX=6 fast_pair.storage.factory_reset.7keys: platform_exclude: native_posix platform_allow: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX=7 fast_pair.storage.factory_reset.8keys: platform_exclude: native_posix platform_allow: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX=8 fast_pair.storage.factory_reset.9keys: platform_exclude: native_posix platform_allow: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX=9 fast_pair.storage.factory_reset.10keys: platform_exclude: native_posix platform_allow: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 extra_args: CONFIG_BT_FAST_PAIR_STORAGE_ACCOUNT_KEY_MAX=10 diff --git a/tests/subsys/bluetooth/gatt_dm/testcase.yaml b/tests/subsys/bluetooth/gatt_dm/testcase.yaml index 54005225b3a2..e51fb422ebe2 100644 --- a/tests/subsys/bluetooth/gatt_dm/testcase.yaml +++ b/tests/subsys/bluetooth/gatt_dm/testcase.yaml @@ -1,7 +1,7 @@ tests: bluetooth.gatt_dm: - platform_allow: native_posix nrf52840dk_nrf52840 + platform_allow: native_posix nrf52840dk/nrf52840 integration_platforms: - native_posix - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tags: discovery_manager diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt b/tests/subsys/bluetooth/mesh/metadata_extraction/CMakeLists.txt new file mode 100644 index 000000000000..a431997dd9f8 --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/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(bt_mesh_metadata_extraction_test) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) + +set(script_args ${PROJECT_BINARY_DIR}) + +if(CONFIG_COMP_DATA_LAYOUT_SINGLE) + list(PREPEND script_args --single) +else() + list(PREPEND script_args --multiple) +endif() + +add_custom_target(verify_metadata ALL + ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/verify_metadata.py ${script_args} + DEPENDS parse_mesh_metadata +) diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/Kconfig b/tests/subsys/bluetooth/mesh/metadata_extraction/Kconfig new file mode 100644 index 000000000000..4cb961a7dbe9 --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/Kconfig @@ -0,0 +1,16 @@ +choice COMP_DATA_LAYOUT + prompt "Composition data layout" + default COMP_DATA_LAYOUT_SINGLE + +config COMP_DATA_LAYOUT_SINGLE + bool "Single composition data" + +config COMP_DATA_LAYOUT_MULTIPLE + bool "Multiple composition data as separate variables" + +config COMP_DATA_LAYOUT_ARRAY + bool "Multiple composition data as an array" + +endchoice + +source "Kconfig.zephyr" diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf b/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf new file mode 100644 index 000000000000..e118e010754d --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/prj.conf @@ -0,0 +1,29 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Bootloader configuration +CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="1.2.3+4" + +# Bluetooth configuration +CONFIG_BT=y +CONFIG_BT_OBSERVER=y +CONFIG_BT_PERIPHERAL=y + +# Bluetooth Mesh configuration +CONFIG_BT_MESH=y +CONFIG_BT_MESH_DFU_METADATA_ON_BUILD=y + +# Set to something other than default to check that it is parsed correctly +CONFIG_BT_MESH_CRPL=64 + +# Enable extra mesh features to check that the features field is parsed correctly +CONFIG_BT_MESH_RELAY=y +CONFIG_BT_MESH_FRIEND=y + +# Bluetooth Mesh models +CONFIG_BT_MESH_LVL_CLI=y +CONFIG_BT_MESH_ONOFF_CLI=y diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/src/main.c b/tests/subsys/bluetooth/mesh/metadata_extraction/src/main.c new file mode 100644 index 000000000000..7edc096e8588 --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/src/main.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** @file + * @brief Bluetooth Mesh DFU Target role sample + */ +#include +#include +#include +#include + + +static struct bt_mesh_health_srv health_srv; + +BT_MESH_HEALTH_PUB_DEFINE(health_pub, 0); + +static struct bt_mesh_model models[] = { + BT_MESH_MODEL_CFG_SRV, + BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub), +}; + +static struct bt_mesh_elem elements[] = { + BT_MESH_ELEM(1, models, BT_MESH_MODEL_NONE), +}; + +#ifndef CONFIG_COMP_DATA_LAYOUT_SINGLE +static struct bt_mesh_onoff_cli onoff_cli; +static struct bt_mesh_lvl_cli lvl_cli; + +static struct bt_mesh_model extra_models[] = { + BT_MESH_MODEL_ONOFF_CLI(&onoff_cli), + BT_MESH_MODEL_LVL_CLI(&lvl_cli), +}; + +static struct bt_mesh_elem elements_alt[] = { + BT_MESH_ELEM(1, models, BT_MESH_MODEL_NONE), + BT_MESH_ELEM(2, extra_models, BT_MESH_MODEL_NONE), +}; +#endif + +#ifdef CONFIG_COMP_DATA_LAYOUT_ARRAY +const struct bt_mesh_comp comp[2] = { + { + .cid = 1, + .pid = 2, + .vid = 3, + .elem = elements, + .elem_count = ARRAY_SIZE(elements), + }, + { + .cid = 4, + .pid = 5, + .vid = 6, + .elem = elements_alt, + .elem_count = ARRAY_SIZE(elements_alt), + }, +}; +#else /* defined(COMP_DATA_LAYOUT_SINGLE) || defined(COMP_DATA_LAYOUT_MULTIPLE) */ +static const struct bt_mesh_comp comp = { + .cid = 1, + .pid = 2, + .vid = 3, + .elem = elements, + .elem_count = ARRAY_SIZE(elements), +}; +#ifdef CONFIG_COMP_DATA_LAYOUT_MULTIPLE +static const struct bt_mesh_comp comp_alt = { + .cid = 4, + .pid = 5, + .vid = 6, + .elem = elements_alt, + .elem_count = ARRAY_SIZE(elements_alt), +}; +#endif /* CONFIG_COMP_DATA_LAYOUT_MULTIPLE */ +#endif /* defined(COMP_DATA_LAYOUT_SINGLE) || defined(COMP_DATA_LAYOUT_MULTIPLE) */ + +static const uint8_t dev_uuid[16]; + +static const struct bt_mesh_prov prov = { + .uuid = dev_uuid, +}; + +#ifndef CONFIG_COMP_DATA_LAYOUT_SINGLE +/* Since the value of this variable is never changed by the code, the compiler + * might optimize it out, including any conditions that depend on it (and by + * by extension, the entire alternate composition data structure). To prevent + * this, the `volatile` qualifier is used. + */ +volatile bool use_alt; +#endif + +static void bt_ready(int err) +{ + if (err) { + return; + } + +#ifdef CONFIG_COMP_DATA_LAYOUT_ARRAY + if (use_alt) { + bt_mesh_init(&prov, &comp[1]); + } else { + bt_mesh_init(&prov, &comp[0]); + } +#else /* defined(COMP_DATA_LAYOUT_SINGLE) || defined(COMP_DATA_LAYOUT_MULTIPLE) */ +#ifdef CONFIG_COMP_DATA_LAYOUT_MULTIPLE + if (use_alt) { + bt_mesh_init(&prov, &comp_alt); + } else +#endif /* CONFIG_COMP_DATA_LAYOUT_MULTIPLE */ + { + bt_mesh_init(&prov, &comp); + } +#endif /* defined(COMP_DATA_LAYOUT_SINGLE) || defined(COMP_DATA_LAYOUT_MULTIPLE) */ +} + +int main(void) +{ + bt_enable(bt_ready); + + return 0; +} diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/testcase.yaml b/tests/subsys/bluetooth/mesh/metadata_extraction/testcase.yaml new file mode 100644 index 000000000000..c3b62e08b391 --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/testcase.yaml @@ -0,0 +1,21 @@ +common: + build_only: true + platform_allow: nrf52840dk/nrf52840 + tags: bluetooth ci_build + integration_platforms: + - nrf52840dk/nrf52840 +tests: + bluetooth.mesh.metadata_extraction_single: + extra_configs: + - CONFIG_COMP_DATA_LAYOUT_SINGLE=y + bluetooth.mesh.metadata_extraction_multiple: + extra_configs: + - CONFIG_COMP_DATA_LAYOUT_MULTIPLE=y + bluetooth.mesh.metadata_extraction_array: + extra_configs: + - CONFIG_COMP_DATA_LAYOUT_ARRAY=y + bluetooth.mesh.metadata_extraction_single_lto: + extra_configs: + - CONFIG_COMP_DATA_LAYOUT_SINGLE=y + - CONFIG_ISR_TABLES_LOCAL_DECLARATION=y + - CONFIG_LTO=y diff --git a/tests/subsys/bluetooth/mesh/metadata_extraction/verify_metadata.py b/tests/subsys/bluetooth/mesh/metadata_extraction/verify_metadata.py new file mode 100644 index 000000000000..3a85f824e88a --- /dev/null +++ b/tests/subsys/bluetooth/mesh/metadata_extraction/verify_metadata.py @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +import json +import os +import sys +from zipfile import ZipFile + + +def assert_metadata_equal(json_data, expected, msg="Metadata not equal to expected"): + """ + Check metadata instance for equality, printing diff on error + """ + diff_lines = [msg] + + def list_diff(json, expected, path=''): + if len(json) != len(expected): + diff_lines.append(f"Expected {path} to have length {len(expected)} but got {len(json)}") + else: + for i, json_item in enumerate(json): + diff(json_item, expected[i], f"{path}[{i}]") + + def dict_diff(json, expected, path=''): + for key in set(json) | set(expected): + full_path = path + key + if key not in expected: + diff_lines.append(f"Unexpected key {full_path} in JSON") + elif key not in json: + diff_lines.append(f"Key {full_path} missing from JSON") + else: + diff(json[key], expected[key], full_path) + + def diff(json, expected, path=''): + if json != expected: + if isinstance(json, dict) and isinstance(expected, dict): + dict_diff(json, expected, f"{path}.") + elif isinstance(json, list) and isinstance(expected, list): + list_diff(json, expected, path) + else: + diff_lines.append(f"Expected {path} == {expected} but got {json}") + + if json_data != expected: + dict_diff(json_data, expected) + raise AssertionError('\n'.join(diff_lines)) + + +def expected_metadata(size): + encoded_size = size.to_bytes(3, 'little').hex() + return [ + { + 'sign_version': {'major': 1, 'minor': 2, 'revision': 3, 'build_number': 4}, + 'binary_size': size, + 'core_type': 1, + 'composition_data': { + 'cid': 1, + 'pid': 2, + 'vid': 3, + 'crpl': 64, + 'features': 5, + 'elements': [ + {'location': 1, 'sig_models': [0, 2], 'vendor_models': []} + ] + }, + 'composition_hash': '0x587a2fb', + 'encoded_metadata': f'0102030004000000{encoded_size}01fba287050100' + }, + { + 'sign_version': {'major': 1, 'minor': 2, 'revision': 3, 'build_number': 4}, + 'binary_size': size, + 'core_type': 1, + 'composition_data': { + 'cid': 4, + 'pid': 5, + 'vid': 6, + 'crpl': 64, + 'features': 5, + 'elements': [ + {'location': 1, 'sig_models': [0, 2], 'vendor_models': []}, + {'location': 2, 'sig_models': [4097, 4099], 'vendor_models': []} + ] + }, + 'composition_hash': '0x13f1a143', + 'encoded_metadata': f'0102030004000000{encoded_size}0143a1f1130200' + } + ] + + +if __name__ == '__main__': + comp_data_layout = sys.argv[1] + bin_dir = sys.argv[2] + zip_path = os.path.join(bin_dir, "zephyr", "dfu_application.zip") + + binary_size = os.path.getsize(os.path.join(bin_dir, "zephyr", "app_update.bin")) + expected = expected_metadata(binary_size) + + with ZipFile(zip_path) as zip_file: + json_string = zip_file.read('ble_mesh_metadata.json').decode() + + json_data = json.loads(json_string) + + if comp_data_layout == '--single': + assert not isinstance(json_data, list), "Expected single metadata but got multiple." + assert_metadata_equal(json_data, expected[0]) + elif comp_data_layout == '--multiple': + assert not isinstance(json_data, dict), "Expected multiple metadata but got one." + assert len(json_data) == len(expected), (f"Expected {len(expected)} metadatas " + f"but got {len(json_data)}") + for i, data in enumerate(json_data): + assert_metadata_equal(data, expected[i], f"Metadata[{i}] not equal to expected") + else: + raise ValueError('Unknown comp data layout') diff --git a/tests/subsys/bluetooth/mesh/models/testcase.yaml b/tests/subsys/bluetooth/mesh/models/testcase.yaml index c7310beb0f79..ec84c54e6ac2 100644 --- a/tests/subsys/bluetooth/mesh/models/testcase.yaml +++ b/tests/subsys/bluetooth/mesh/models/testcase.yaml @@ -1,9 +1,9 @@ common: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 tags: bluetooth ci_build integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 tests: bluetooth.mesh.build_models: extra_args: diff --git a/tests/subsys/bluetooth/mesh/sensor_subsys_new/src/main.c b/tests/subsys/bluetooth/mesh/sensor_subsys_new/src/main.c index 5da6370573cd..c2a7aa5f2e8a 100644 --- a/tests/subsys/bluetooth/mesh/sensor_subsys_new/src/main.c +++ b/tests/subsys/bluetooth/mesh/sensor_subsys_new/src/main.c @@ -193,7 +193,7 @@ static float biggest_float_leq(double limit) { float val = limit; - return val <= limit ? val : nextafterf(val, -INFINITY); + return (double)val <= limit ? val : nextafterf(val, -INFINITY); } /** Finds the smallest float greater than or equal to @c limit. */ @@ -201,7 +201,7 @@ static float smallest_float_geq(double limit) { float val = limit; - return val >= limit ? val : nextafterf(val, INFINITY); + return (double)val >= limit ? val : nextafterf(val, INFINITY); } static void check_scalar_format(const struct bt_mesh_sensor_format *format, diff --git a/tests/subsys/bootloader/bl_crypto/testcase.yaml b/tests/subsys/bootloader/bl_crypto/testcase.yaml index 1d8fdda46ecb..f71a980f8b50 100644 --- a/tests/subsys/bootloader/bl_crypto/testcase.yaml +++ b/tests/subsys/bootloader/bl_crypto/testcase.yaml @@ -1,11 +1,11 @@ tests: bootloader.bl_crypto: - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf9160dk_nrf9160 - nrf5340dk_nrf5340_cpuapp nrf52833dk_nrf52833 + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 nrf9160dk/nrf9160 + nrf5340dk/nrf5340/cpuapp nrf52833dk/nrf52833 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp - - nrf52833dk_nrf52833 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp + - nrf52833dk/nrf52833 tags: b0 diff --git a/tests/subsys/bootloader/bl_storage/testcase.yaml b/tests/subsys/bootloader/bl_storage/testcase.yaml index bf88462ae742..eac5fab3a275 100644 --- a/tests/subsys/bootloader/bl_storage/testcase.yaml +++ b/tests/subsys/bootloader/bl_storage/testcase.yaml @@ -1,9 +1,9 @@ tests: bootloader.bl_storage: - platform_allow: nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp tags: b0 harness: console harness_config: diff --git a/tests/subsys/bootloader/bl_validation/testcase.yaml b/tests/subsys/bootloader/bl_validation/testcase.yaml index 43c69b28d39b..35d10b7acc58 100644 --- a/tests/subsys/bootloader/bl_validation/testcase.yaml +++ b/tests/subsys/bootloader/bl_validation/testcase.yaml @@ -1,11 +1,11 @@ tests: bootloader.bl_validation: - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp nrf52833dk_nrf52833 + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp nrf52833dk/nrf52833 integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp - - nrf52833dk_nrf52833 + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp + - nrf52833dk/nrf52833 tags: b0 bl_validation diff --git a/tests/subsys/bootloader/bl_validation_ff_key/testcase.yaml b/tests/subsys/bootloader/bl_validation_ff_key/testcase.yaml index 944b19c1ef69..389dfaefad39 100644 --- a/tests/subsys/bootloader/bl_validation_ff_key/testcase.yaml +++ b/tests/subsys/bootloader/bl_validation_ff_key/testcase.yaml @@ -1,12 +1,12 @@ tests: bootloader.bl_validation.ff_key: - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp tags: b0 bl_validation ff_key harness: console harness_config: diff --git a/tests/subsys/bootloader/bl_validation_neg/testcase.yaml b/tests/subsys/bootloader/bl_validation_neg/testcase.yaml index 595ddc6a0f6f..f382d1261908 100644 --- a/tests/subsys/bootloader/bl_validation_neg/testcase.yaml +++ b/tests/subsys/bootloader/bl_validation_neg/testcase.yaml @@ -1,10 +1,10 @@ tests: bootloader.bl_validation.negative: - platform_allow: nrf9160dk_nrf9160 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp tags: b0 bl_validation negative bl_validation_negative harness: console harness_config: @@ -27,10 +27,10 @@ tests: - "Failed to validate, permanently invalidating!" - "No bootable image found. Aborting boot." bootloader.bl_validation.negative.nrf52: - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 + platform_allow: nrf52840dk/nrf52840 nrf52dk/nrf52832 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 tags: b0 bl_validation negative bl_validation_negative harness: console harness_config: diff --git a/tests/subsys/bootloader/boot_chains/testcase.yaml b/tests/subsys/bootloader/boot_chains/testcase.yaml index 754315460e97..a9599cd8c0bf 100644 --- a/tests/subsys/bootloader/boot_chains/testcase.yaml +++ b/tests/subsys/bootloader/boot_chains/testcase.yaml @@ -1,7 +1,7 @@ common: platform_allow: - nrf52840dk_nrf52840 - nrf5340dk_nrf5340_cpuapp + nrf52840dk/nrf52840 + nrf5340dk/nrf5340/cpuapp # NB: It's not yet supported to boot TF-M from NSIB without # MCUBoot enabled as well harness: console @@ -18,15 +18,15 @@ tests: extra_args: CONFIG_BOOTLOADER_MCUBOOT=y platform_allow: - nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns boot_chains.secure_boot_and_bootloader_mcuboot: extra_args: CONFIG_SECURE_BOOT=y CONFIG_BOOTLOADER_MCUBOOT=y platform_allow: - nrf5340dk_nrf5340_cpuapp_ns - nrf9160dk_nrf9160_ns + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns boot_chains.bootloader_mcuboot_and_nv_counters: extra_args: CONFIG_BOOTLOADER_MCUBOOT=y diff --git a/tests/subsys/caf/sensor_data_aggregator/testcase.yaml b/tests/subsys/caf/sensor_data_aggregator/testcase.yaml index 5b1b5fdb8f76..80c1445b999d 100644 --- a/tests/subsys/caf/sensor_data_aggregator/testcase.yaml +++ b/tests/subsys/caf/sensor_data_aggregator/testcase.yaml @@ -1,10 +1,14 @@ tests: caf_sensor_aggregator.core: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns qemu_cortex_m3 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 diff --git a/tests/subsys/caf/sensor_manager/testcase.yaml b/tests/subsys/caf/sensor_manager/testcase.yaml index a148a0edcb61..c25f974ab2d9 100644 --- a/tests/subsys/caf/sensor_manager/testcase.yaml +++ b/tests/subsys/caf/sensor_manager/testcase.yaml @@ -1,10 +1,14 @@ tests: caf_sensor_manager.core: platform_allow: - nrf52dk_nrf52832 nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf9160dk_nrf9160_ns qemu_cortex_m3 + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns + - qemu_cortex_m3 integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf5340dk_nrf5340_cpuapp - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp + - nrf9160dk/nrf9160/ns - qemu_cortex_m3 diff --git a/tests/subsys/debug/cpu_load/testcase.yaml b/tests/subsys/debug/cpu_load/testcase.yaml index 4be0f614d906..6d7d1fcd764e 100644 --- a/tests/subsys/debug/cpu_load/testcase.yaml +++ b/tests/subsys/debug/cpu_load/testcase.yaml @@ -1,15 +1,15 @@ tests: debug.cpu_load: - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 build_only: true tags: ci_build debug debug.cpu_load.shared_dppi: - platform_allow: nrf9160dk_nrf9160 + platform_allow: nrf9160dk/nrf9160 integration_platforms: - - nrf9160dk_nrf9160 + - nrf9160dk/nrf9160 build_only: true tags: ci_build debug extra_configs: diff --git a/tests/subsys/dfu/dfu_target/mcuboot/testcase.yaml b/tests/subsys/dfu/dfu_target/mcuboot/testcase.yaml index 727533a4e787..a775745e81ea 100644 --- a/tests/subsys/dfu/dfu_target/mcuboot/testcase.yaml +++ b/tests/subsys/dfu/dfu_target/mcuboot/testcase.yaml @@ -1,10 +1,15 @@ tests: dfu.dfu_target.mcuboot: - platform_allow: nrf52840dk_nrf52840 nrf52dk_nrf52832 nrf9160dk_nrf9160 native_posix qemu_cortex_m3 + platform_allow: + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160 + - native_posix + - qemu_cortex_m3 integration_platforms: - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf9160dk/nrf9160 - native_posix - qemu_cortex_m3 tags: dfu mcuboot diff --git a/tests/subsys/dfu/dfu_target_stream/testcase.yaml b/tests/subsys/dfu/dfu_target_stream/testcase.yaml index 855ba222cd1d..e5391ed7c557 100644 --- a/tests/subsys/dfu/dfu_target_stream/testcase.yaml +++ b/tests/subsys/dfu/dfu_target_stream/testcase.yaml @@ -2,20 +2,20 @@ tests: dfu.target_stream: tags: target_stream - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp native_posix + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp native_posix integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp - native_posix dfu.target_stream.store_progress: tags: target_stream extra_args: OVERLAY_CONFIG=overlay-store-progress.conf # Since we need the storage partition (and hence PM) allow some nRF devices # only. - platform_allow: nrf52840dk_nrf52840 nrf9160dk_nrf9160 nrf5340dk_nrf5340_cpuapp native_posix + platform_allow: nrf52840dk/nrf52840 nrf9160dk/nrf9160 nrf5340dk/nrf5340/cpuapp native_posix integration_platforms: - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 + - nrf5340dk/nrf5340/cpuapp - native_posix diff --git a/tests/subsys/emds/emds_api/boards/nrf52840dk_nrf52840.conf b/tests/subsys/emds/emds_api/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..c0769cedc2b4 --- /dev/null +++ b/tests/subsys/emds/emds_api/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf52840dk_nrf52840 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=y +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE_MS=2 diff --git a/tests/subsys/emds/emds_api/prj.conf b/tests/subsys/emds/emds_api/prj.conf index 6d599942cdd1..af1b0a1ee7e2 100644 --- a/tests/subsys/emds/emds_api/prj.conf +++ b/tests/subsys/emds/emds_api/prj.conf @@ -14,6 +14,4 @@ CONFIG_REBOOT=y CONFIG_SETTINGS=y CONFIG_NVS=y CONFIG_BT=y -CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=y -CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE_MS=2 CONFIG_EMDS_FLASH_TIME_BASE_OVERHEAD_US=6000 diff --git a/tests/subsys/emds/emds_api/src/main.c b/tests/subsys/emds/emds_api/src/main.c index 61e4281d10a6..5a489a76d095 100644 --- a/tests/subsys/emds/emds_api/src/main.c +++ b/tests/subsys/emds/emds_api/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include #if CONFIG_SETTINGS #include #include @@ -17,6 +18,23 @@ #include #endif +#if defined CONFIG_SOC_FLASH_NRF_RRAM +#define RRAM DT_INST(0, soc_nv_flash) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(RRAM, write_block_size) +#else +#define FLASH DT_INST(0, soc_nv_flash) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(FLASH, write_block_size) +#endif + +/* Allocation Table Entry */ +struct test_ate { + uint16_t id; /* data id */ + uint16_t offset; /* data offset within sector */ + uint16_t len; /* data len within sector */ + uint8_t crc8_data; /* crc8 check of the entry */ + uint8_t crc8; /* crc8 check of the entry */ +} __packed; + enum test_states { EMDS_TS_EMPTY_FLASH, EMDS_TS_STORE_DATA, @@ -81,6 +99,11 @@ static void app_store_cb(void) #endif } +static inline size_t align_size(size_t len) +{ + return (len + (EMDS_FLASH_BLOCK_SIZE - 1U)) & ~(EMDS_FLASH_BLOCK_SIZE - 1U); +} + /** Mocks ******************************************/ @@ -106,12 +129,16 @@ static void init(void) static void add_d_entries(void) { int err; - uint32_t store_expected = NRFX_CEIL_DIV(sizeof(s_data), 4) * 4 + 8; + int ate_size = align_size(sizeof(struct test_ate)); + uint32_t store_expected = + DIV_ROUND_UP(sizeof(s_data), EMDS_FLASH_BLOCK_SIZE) * EMDS_FLASH_BLOCK_SIZE + + ate_size; for (int i = 0; i < ARRAY_SIZE(d_entries); i++) { err = emds_entry_add(&d_entries[i]); - store_expected += NRFX_CEIL_DIV(d_entries[i].entry.len, 4) * 4; - store_expected += 8; + store_expected += DIV_ROUND_UP(d_entries[i].entry.len, EMDS_FLASH_BLOCK_SIZE) * + EMDS_FLASH_BLOCK_SIZE; + store_expected += ate_size; zassert_equal(err, 0, "Add entry failed"); err = emds_entry_add(&d_entries[i]); @@ -120,7 +147,8 @@ static void add_d_entries(void) uint32_t store_used = emds_store_size_get(); - zassert_equal(store_used, store_expected, "Wrong storage size"); + zassert_equal(store_used, store_expected, "Wrong storage size: expected: %i, got: %i", + store_expected, store_used); } static void load_empty_flash(void) @@ -189,9 +217,11 @@ static void store(void) uint32_t estimate_store_time_us = emds_store_time_get(); - zassert_true((store_time_us < estimate_store_time_us), "Store takes to long time"); printf("Store time: Actual %lldus, Worst case: %dus\n", store_time_us, estimate_store_time_us); +#if !defined CONFIG_SOC_FLASH_NRF_RRAM /* TODO: Fix it with NCSDK-26922 */ + zassert_true((store_time_us < estimate_store_time_us), "Store takes to long time"); +#endif } static void clear(void) @@ -345,7 +375,7 @@ void test_main(void) printk("********** Test run: %s (%d) **********\n", print_state(run_state), iteration); - ztest_run_all(&run_state); + ztest_run_all(&run_state, false, 1, 1); #if CONFIG_SETTINGS iteration++; diff --git a/tests/subsys/emds/emds_api/testcase.yaml b/tests/subsys/emds/emds_api/testcase.yaml index e02b95a6a9e7..2d72e103a53d 100644 --- a/tests/subsys/emds/emds_api/testcase.yaml +++ b/tests/subsys/emds/emds_api/testcase.yaml @@ -1,6 +1,7 @@ tests: emds.api: - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp tags: emds integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp diff --git a/tests/subsys/emds/emds_flash/boards/nrf52840dk_nrf52840.conf b/tests/subsys/emds/emds_flash/boards/nrf52840dk_nrf52840.conf new file mode 100644 index 000000000000..c0769cedc2b4 --- /dev/null +++ b/tests/subsys/emds/emds_flash/boards/nrf52840dk_nrf52840.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application overlay - nrf52840dk_nrf52840 + +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=y +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE_MS=2 diff --git a/tests/subsys/emds/emds_flash/src/main.c b/tests/subsys/emds/emds_flash/src/main.c index d7c215dffdb9..bad132c0e5fe 100644 --- a/tests/subsys/emds/emds_flash/src/main.c +++ b/tests/subsys/emds/emds_flash/src/main.c @@ -18,6 +18,14 @@ #include #endif +#if defined CONFIG_SOC_FLASH_NRF_RRAM +#define RRAM DT_INST(0, soc_nv_flash) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(RRAM, write_block_size) +#else +#define FLASH DT_INST(0, soc_nv_flash) +#define EMDS_FLASH_BLOCK_SIZE DT_PROP(FLASH, write_block_size) +#endif + #define ADDR_OFFS_MASK 0x0000FFFF static struct { @@ -96,7 +104,7 @@ static int flash_cmp_const(uint32_t addr, uint8_t value, size_t len) static inline size_t align_size(size_t len) { - return (len + (4 - 1U)) & ~(4 - 1U); + return (len + (EMDS_FLASH_BLOCK_SIZE - 1U)) & ~(EMDS_FLASH_BLOCK_SIZE - 1U); } static int data_write(const void *data, size_t len) @@ -177,7 +185,8 @@ static void *fs_init(void) m_test_fd.fd = m_fa->fa_dev; m_test_fd.offset = m_fa->fa_off; m_test_fd.size = hw_flash_sector.fs_size; - m_test_fd.ate_idx_start = m_fa->fa_off + hw_flash_sector.fs_size - sizeof(struct test_ate); + m_test_fd.ate_idx_start = + m_fa->fa_off + hw_flash_sector.fs_size - align_size(sizeof(struct test_ate)); m_test_fd.data_wra_offset = 0; return NULL; @@ -312,7 +321,7 @@ ZTEST(emds_flash_tests, test_flash_recovery) */ idx = m_test_fd.ate_idx_start; entry_write(idx, 1, data_in1, sizeof(data_in1)); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); zassert_false(emds_flash_init(&ctx), "Error when initializing"); zassert_true(emds_flash_read(&ctx, 1, data_out, sizeof(data_in1)) > 0, "Could not read"); (void)emds_flash_read(&ctx, 1, data_out, sizeof(data_in1)); @@ -333,9 +342,9 @@ ZTEST(emds_flash_tests, test_flash_recovery) */ idx = m_test_fd.ate_idx_start; ate_invalidate_write(idx); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); entry_write(idx, 2, data_in2, sizeof(data_in2)); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); zassert_false(emds_flash_init(&ctx), "Error when initializing"); zassert_false(ctx.force_erase, "Expected false"); zassert_equal(idx, ctx.ate_wra, "Addr not equal"); @@ -354,9 +363,9 @@ ZTEST(emds_flash_tests, test_flash_recovery) * Expect: Unexpected behavior */ ate_invalidate_write(idx); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); entry_write(idx, 3, data_in3, sizeof(data_in3)); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); zassert_false(emds_flash_init(&ctx), "Error when initializing"); zassert_true(ctx.force_erase, "Expected true"); zassert_equal(idx, ctx.ate_wra, "Addr not equal"); @@ -381,12 +390,12 @@ ZTEST(emds_flash_tests, test_flash_recovery) idx = m_test_fd.ate_idx_start; for (size_t i = 0; i < 3; i++) { ate_invalidate_write(idx); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); } - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); ate_corrupt_write(idx); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); zassert_false(emds_flash_init(&ctx), "Error when initializing"); zassert_true(ctx.force_erase, "Expected true"); zassert_equal(idx, ctx.ate_wra, "Addr not equal"); @@ -420,7 +429,7 @@ ZTEST(emds_flash_tests, test_invalidate_on_prepare) for (size_t i = 0; i < 5; i++) { entry_write(idx, i, data_in, sizeof(data_in)); - idx -= sizeof(struct test_ate); + idx -= align_size(sizeof(struct test_ate)); } zassert_false(emds_flash_init(&ctx), "Error when initializing"); @@ -554,7 +563,9 @@ ZTEST(emds_flash_tests, test_overflow) zassert_false(memcmp(data_out, data_in, sizeof(data_out)), "Retrived wrong value"); zassert_equal(emds_flash_free_space_get(&ctx), - m_test_fd.size - (sizeof(data_out) + sizeof(struct test_ate) * 2), ""); + m_test_fd.size - (align_size(sizeof(data_out)) + + align_size(sizeof(struct test_ate)) * 2), + ""); } @@ -581,8 +592,8 @@ ZTEST(emds_flash_tests, test_full_corrupt_recovery) zassert_equal(0, emds_flash_free_space_get(&ctx), "Expected no free space"); zassert_false(emds_flash_prepare(&ctx, 0), "Prepare failed"); - zassert_equal(m_test_fd.size - sizeof(struct test_ate), emds_flash_free_space_get(&ctx), - "Expected no free space"); + zassert_equal(m_test_fd.size - align_size(sizeof(struct test_ate)), + emds_flash_free_space_get(&ctx), "Expected no free space"); zassert_false(flash_cmp_const(m_test_fd.offset, 0xff, m_test_fd.size), "Flash not cleared"); device_reset(); @@ -657,7 +668,9 @@ ZTEST(emds_flash_tests, test_write_speed) toc = k_uptime_ticks(); store_time_us = k_ticks_to_us_ceil64(toc - tic); printk("Storing 1024 bytes took: %lldus\n", store_time_us); +#if !defined CONFIG_SOC_FLASH_NRF_RRAM /* TODO: Fix it with NCSDK-26922 */ zassert_true(store_time_us < 13000, "Storing 1024 bytes took to long time"); +#endif } ZTEST_SUITE(emds_flash_tests, NULL, fs_init, NULL, NULL, NULL); diff --git a/tests/subsys/emds/emds_flash/testcase.yaml b/tests/subsys/emds/emds_flash/testcase.yaml index 2e36e3e572fb..e561a88d1b12 100644 --- a/tests/subsys/emds/emds_flash/testcase.yaml +++ b/tests/subsys/emds/emds_flash/testcase.yaml @@ -1,6 +1,7 @@ tests: emds.flash: - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp tags: emds integration_platforms: - - nrf52840dk_nrf52840 + - nrf52840dk/nrf52840 + - nrf54l15pdk/nrf54l15/cpuapp diff --git a/tests/subsys/event_manager_proxy/CMakeLists.txt b/tests/subsys/event_manager_proxy/CMakeLists.txt index fea75ca7f2e0..5437e69eeda6 100644 --- a/tests/subsys/event_manager_proxy/CMakeLists.txt +++ b/tests/subsys/event_manager_proxy/CMakeLists.txt @@ -6,21 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -if(CONF_FILE) - if(${CONF_FILE} MATCHES "prj_(.*).conf") - set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) - - # At this stage, any revision attached to the board will not be available - # as BOARD_REVISION, just "@" in the board name. We clean up the - # path to reflect what the associated overlay/fragment paths are supposed to - # look like in sample/boards. - string(REPLACE "@" "_" SAMPLE_BOARD "${BOARD}") - - set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${SAMPLE_BOARD}_${CONF_FILE_BUILD_TYPE}.overlay") - endif() - set(remote_CONF_FILE ${CONF_FILE}) -endif() - set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_LIST_DIR}) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) diff --git a/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf index f22963a97252..0a426acd43e4 100644 --- a/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -5,4 +5,4 @@ # CONFIG_BOARD_ENABLE_CPUNET=y -CONFIG_APP_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" +CONFIG_APP_REMOTE_BOARD="nrf5340dk/nrf5340/cpunet" diff --git a/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf b/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf index f22963a97252..0a426acd43e4 100644 --- a/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf +++ b/tests/subsys/event_manager_proxy/boards/nrf5340dk_nrf5340_cpuapp_icmsg.conf @@ -5,4 +5,4 @@ # CONFIG_BOARD_ENABLE_CPUNET=y -CONFIG_APP_REMOTE_BOARD="nrf5340dk_nrf5340_cpunet" +CONFIG_APP_REMOTE_BOARD="nrf5340dk/nrf5340/cpunet" diff --git a/tests/subsys/event_manager_proxy/remote/CMakeLists.txt b/tests/subsys/event_manager_proxy/remote/CMakeLists.txt index 6d3f217cf549..483186f17dd0 100644 --- a/tests/subsys/event_manager_proxy/remote/CMakeLists.txt +++ b/tests/subsys/event_manager_proxy/remote/CMakeLists.txt @@ -6,20 +6,6 @@ cmake_minimum_required(VERSION 3.20.0) -if(CONF_FILE) - if(${CONF_FILE} MATCHES "prj_(.*).conf") - set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) - - # At this stage, any revision attached to the board will not be available - # as BOARD_REVISION, just "@" in the board name. We clean up the - # path to reflect what the associated overlay/fragment paths are supposed to - # look like in sample/boards. - string(REPLACE "@" "_" SAMPLE_BOARD "${BOARD}") - - set(DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${SAMPLE_BOARD}_${CONF_FILE_BUILD_TYPE}.overlay") - endif() -endif() - find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(event_manager_proxy_remote) message(STATUS "ZEPHYR_BASE: $ENV{ZEPHYR_BASE}") diff --git a/tests/subsys/event_manager_proxy/src/data.c b/tests/subsys/event_manager_proxy/src/data.c index 5dc6896e524e..09e5de0882ec 100644 --- a/tests/subsys/event_manager_proxy/src/data.c +++ b/tests/subsys/event_manager_proxy/src/data.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ #include +#include #include #include diff --git a/tests/subsys/event_manager_proxy/testcase.yaml b/tests/subsys/event_manager_proxy/testcase.yaml index 874c8675124d..3cac21723965 100644 --- a/tests/subsys/event_manager_proxy/testcase.yaml +++ b/tests/subsys/event_manager_proxy/testcase.yaml @@ -1,12 +1,16 @@ tests: event_manager_proxy.openamp: - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp tags: event_manager_proxy event_manager_proxy.icmsg: - extra_args: CONF_FILE=prj_icmsg.conf - platform_allow: nrf5340dk_nrf5340_cpuapp + extra_args: + CONF_FILE=prj_icmsg.conf + remote_CONF_FILE=prj_icmsg.conf + DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpuapp_icmsg.overlay + remote_DTC_OVERLAY_FILE=boards/nrf5340dk_nrf5340_cpunet_icmsg.overlay + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp tags: event_manager_proxy diff --git a/tests/subsys/fw_info/testcase.yaml b/tests/subsys/fw_info/testcase.yaml index bc2446b135f0..723f506dae31 100644 --- a/tests/subsys/fw_info/testcase.yaml +++ b/tests/subsys/fw_info/testcase.yaml @@ -1,10 +1,10 @@ tests: fw_info.core: - platform_allow: nrf9160dk_nrf9160 nrf52840dk_nrf52840 nrf52dk_nrf52832 - nrf5340dk_nrf5340_cpuapp + platform_allow: nrf9160dk/nrf9160 nrf52840dk/nrf52840 nrf52dk/nrf52832 + nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf9160dk_nrf9160 - - nrf52840dk_nrf52840 - - nrf52dk_nrf52832 - - nrf5340dk_nrf5340_cpuapp + - nrf9160dk/nrf9160 + - nrf52840dk/nrf52840 + - nrf52dk/nrf52832 + - nrf5340dk/nrf5340/cpuapp tags: b0 fw_info diff --git a/tests/subsys/net/lib/aws_fota/aws_fota_json/testcase.yaml b/tests/subsys/net/lib/aws_fota/aws_fota_json/testcase.yaml index 3f723e07cc42..a8f42435b830 100644 --- a/tests/subsys/net/lib/aws_fota/aws_fota_json/testcase.yaml +++ b/tests/subsys/net/lib/aws_fota/aws_fota_json/testcase.yaml @@ -1,9 +1,9 @@ tests: net.lib.aws_fota.aws_fota_json: - platform_allow: native_posix nrf52840dk_nrf52840 nrf9160dk_nrf9160 qemu_cortex_m3 + platform_allow: native_posix nrf52840dk/nrf52840 nrf9160dk/nrf9160 qemu_cortex_m3 integration_platforms: - native_posix - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160 + - nrf52840dk/nrf52840 + - nrf9160dk/nrf9160 - qemu_cortex_m3 tags: aws fota json diff --git a/tests/subsys/net/lib/download_client/CMakeLists.txt b/tests/subsys/net/lib/download_client/CMakeLists.txt index 95764e73efa1..4de489336c72 100644 --- a/tests/subsys/net/lib/download_client/CMakeLists.txt +++ b/tests/subsys/net/lib/download_client/CMakeLists.txt @@ -24,6 +24,10 @@ add_library(download_client STATIC ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/src/download_client.c ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/src/parse.c ) +target_include_directories(download_client + PRIVATE + ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/include + ) target_link_libraries(download_client PUBLIC zephyr_interface) target_link_libraries(app PRIVATE download_client) diff --git a/tests/subsys/net/lib/download_client/boards/native_posix.conf b/tests/subsys/net/lib/download_client/boards/native_posix.conf deleted file mode 100644 index a4b504ea7617..000000000000 --- a/tests/subsys/net/lib/download_client/boards/native_posix.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ASAN=y diff --git a/tests/subsys/net/lib/download_client/boards/native_sim.conf b/tests/subsys/net/lib/download_client/boards/native_sim.conf new file mode 100644 index 000000000000..be6932dcefe1 --- /dev/null +++ b/tests/subsys/net/lib/download_client/boards/native_sim.conf @@ -0,0 +1,5 @@ +CONFIG_ASAN=y +CONFIG_NET_TCP=y +CONFIG_NET_TCP_ISN_RFC6528=n +CONFIG_NET_UDP=y +CONFIG_MBEDTLS=n diff --git a/tests/subsys/net/lib/download_client/boards/qemu_cortex_m3.conf b/tests/subsys/net/lib/download_client/boards/qemu_cortex_m3.conf new file mode 100644 index 000000000000..5901b68d74da --- /dev/null +++ b/tests/subsys/net/lib/download_client/boards/qemu_cortex_m3.conf @@ -0,0 +1,5 @@ +CONFIG_NET_TCP=y +CONFIG_NET_TCP_ISN_RFC6528=n +CONFIG_NET_UDP=y +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_NET_SLIP_TAP=n diff --git a/tests/subsys/net/lib/download_client/prj.conf b/tests/subsys/net/lib/download_client/prj.conf index b609998988f5..5efcf4c5ba4c 100644 --- a/tests/subsys/net/lib/download_client/prj.conf +++ b/tests/subsys/net/lib/download_client/prj.conf @@ -16,6 +16,7 @@ CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_OFFLOAD=y CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=2048 CONFIG_PIPES=y +CONFIG_POSIX_API=y CONFIG_COAP=n diff --git a/tests/subsys/net/lib/download_client/src/main.c b/tests/subsys/net/lib/download_client/src/main.c index f82a2ba7adc7..2e14f3357add 100644 --- a/tests/subsys/net/lib/download_client/src/main.c +++ b/tests/subsys/net/lib/download_client/src/main.c @@ -15,6 +15,16 @@ K_PIPE_DEFINE(event_pipe, 10, _Alignof(struct download_client_evt)); static struct download_client client; +static const struct sockaddr_in addr_coap_me_http = { + .sin_family = AF_INET, + .sin_port = htons(80), + .sin_addr.s4_addr = {134, 102, 218, 18}, +}; +static const struct sockaddr_in addr_example_com = { + .sin_family = AF_INET, + .sin_port = htons(5683), + .sin_addr.s4_addr = {93, 184, 216, 34}, +}; static int download_client_callback(const struct download_client_evt *event) { @@ -90,7 +100,7 @@ static void init(void) static void dl_coap_start(void) { - static const char host[] = "coap://10.1.0.10"; + static const char host[] = "coap://example.com"; int err; init(); @@ -110,7 +120,8 @@ ZTEST(download_client, test_download_simple) int32_t recvfrom_params[] = {25, 25, 25}; int32_t sendto_params[] = {20, 20, 20}; - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -127,7 +138,8 @@ ZTEST(download_client, test_download_simple) ZTEST(download_client, test_connection_failed) { - z_ztest_returns_value("mock_socket_offload_connect", ENETUNREACH); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, ENETUNREACH); dl_coap_init(75, 20); @@ -141,29 +153,79 @@ ZTEST(download_client, test_connection_failed) de_init(&client); } +ZTEST(download_client, test_getaddr_failed) +{ + int err; + struct download_client_evt evt; + + init(); + + err = download_client_get(&client, "http://unknown_domain.com/file..bin", &config, NULL, 0); + zassert_ok(err, NULL); + evt = get_next_event(K_FOREVER); + + zassert_equal(evt.id, DOWNLOAD_CLIENT_EVT_ERROR); + zassert_equal(evt.error, -EHOSTUNREACH); + + de_init(&client); +} + +ZTEST(download_client, test_default_proto_http) +{ + int err; + struct download_client_evt evt; + + init(); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_coap_me_http); + ztest_returns_value(mock_socket_offload_connect, EHOSTUNREACH); + err = download_client_get(&client, "coap.me/file..bin", &config, NULL, 0); + zassert_ok(err, NULL); + evt = get_next_event(K_FOREVER); + + zassert_equal(evt.id, DOWNLOAD_CLIENT_EVT_ERROR); + zassert_equal(evt.error, -EHOSTUNREACH); + + de_init(&client); +} + ZTEST(download_client, test_wrong_address) { int err; + struct download_client_evt evt; init(); + /* No host or config */ err = download_client_get(&client, NULL, NULL, NULL, 0); zassert_equal(err, -EINVAL); + /* Host, but no config */ err = download_client_get(&client, "host", NULL, NULL, 0); zassert_equal(err, -EINVAL); + /* Try twice to see client does not go into unusable mode */ err = download_client_get(&client, "host", NULL, NULL, 0); zassert_equal(err, -EINVAL); + /* Correct host+config buf fails to resolve */ err = download_client_get(&client, "host", &config, NULL, 0); zassert_equal(err, 0); - wait_for_event(DOWNLOAD_CLIENT_EVT_ERROR, K_SECONDS(1)); + evt = wait_for_event(DOWNLOAD_CLIENT_EVT_ERROR, K_SECONDS(1)); + zassert_equal(evt.error, -EHOSTUNREACH); de_init(&client); + /* IP that fails to convert */ err = download_client_get(&client, "0.0.a", &config, NULL, 0); zassert_equal(err, 0); - wait_for_event(DOWNLOAD_CLIENT_EVT_ERROR, K_SECONDS(1)); + evt = wait_for_event(DOWNLOAD_CLIENT_EVT_ERROR, K_SECONDS(1)); + zassert_equal(evt.error, -EHOSTUNREACH); + de_init(&client); + + /* Unsupported protocol */ + err = download_client_get(&client, "telnet://192.0.0.1/file.bin", &config, NULL, 0); + zassert_equal(err, 0); + evt = wait_for_event(DOWNLOAD_CLIENT_EVT_ERROR, K_SECONDS(1)); + zassert_equal(evt.error, -EPROTONOSUPPORT); de_init(&client); } @@ -174,8 +236,10 @@ ZTEST(download_client, test_download_reconnect_on_socket_error) int32_t sendto_params[] = {20, 20, 20, 20}; struct download_client_evt evt; - z_ztest_returns_value("mock_socket_offload_connect", 0); - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -201,8 +265,10 @@ ZTEST(download_client, test_download_reconnect_on_peer_close) int32_t sendto_params[] = {20, 20, 20, 20}; struct download_client_evt evt; - z_ztest_returns_value("mock_socket_offload_connect", 0); - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -231,7 +297,8 @@ ZTEST(download_client, test_download_ignore_duplicate_block) int32_t coap_parse_retv[] = {0, 0, 1, 0}; struct download_client_evt evt; - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -258,7 +325,8 @@ ZTEST(download_client, test_download_abort_on_invalid_block) int32_t sendto_params[] = {20, 20, 20}; int32_t coap_parse_retv[] = {0, 0, -1}; - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -281,7 +349,8 @@ ZTEST(download_client, test_get) int32_t recvfrom_params[] = {25, 25, 25}; int32_t sendto_params[] = {20, 20, 20}; - z_ztest_returns_value("mock_socket_offload_connect", 0); + ztest_expect_data(mock_socket_offload_connect, addr, &addr_example_com); + ztest_returns_value(mock_socket_offload_connect, 0); dl_coap_init(75, 20); @@ -289,7 +358,7 @@ ZTEST(download_client, test_get) ARRAY_SIZE(recvfrom_params)); mock_return_values("mock_socket_offload_sendto", sendto_params, ARRAY_SIZE(sendto_params)); - err = download_client_get(&client, "coap://192.168.1.2/large", &config, NULL, 0); + err = download_client_get(&client, "coap://example.com/large", &config, NULL, 0); zassert_ok(err, NULL); wait_for_event(DOWNLOAD_CLIENT_EVT_DONE, K_SECONDS(1)); wait_for_event(DOWNLOAD_CLIENT_EVT_CLOSED, K_SECONDS(1)); diff --git a/tests/subsys/net/lib/download_client/src/mock/socket.c b/tests/subsys/net/lib/download_client/src/mock/socket.c index 6f6601b6a06e..22a719af6f47 100644 --- a/tests/subsys/net/lib/download_client/src/mock/socket.c +++ b/tests/subsys/net/lib/download_client/src/mock/socket.c @@ -91,6 +91,7 @@ static int mock_socket_offload_bind(void *obj, const struct sockaddr *addr, sock static int mock_socket_offload_connect(void *obj, const struct sockaddr *addr, socklen_t addrlen) { + ztest_check_expected_data(addr, addrlen); k_sleep(K_MSEC(50)); errno = ztest_get_return_value(); return errno ? -1 : 0; @@ -203,17 +204,25 @@ static int mock_socket_offload_getaddrinfo(const char *node, const char *service ai_addr->sin_family = ai->ai_family; ai_addr->sin_port = htons(port); + ai->ai_addrlen = sizeof(*ai_addr); + ai->ai_addr = (struct sockaddr *)ai_addr; - if (!net_ipaddr_parse(node, strlen(node), (struct sockaddr *)ai_addr)) { - free(ai_addr); - free(*res); - return -1; + if (net_ipaddr_parse(node, strlen(node), (struct sockaddr *)ai_addr)) { + return 0; + } + if (strncmp(node, "example.com", 11) == 0) { + ai_addr->sin_addr = (struct in_addr){.s4_addr = {93, 184, 216, 34}}; + return 0; + } + if (strncmp(node, "coap.me", 7) == 0) { + ai_addr->sin_addr = (struct in_addr){.s4_addr = {134, 102, 218, 18}}; + return 0; } - ai->ai_addrlen = sizeof(*ai_addr); - ai->ai_addr = (struct sockaddr *)ai_addr; - return 0; + free(ai_addr); + free(*res); + return -1; } static void mock_socket_offload_freeaddrinfo(struct zsock_addrinfo *res) diff --git a/tests/subsys/net/lib/download_client/testcase.yaml b/tests/subsys/net/lib/download_client/testcase.yaml index 744208052e1c..ec9b456352c3 100644 --- a/tests/subsys/net/lib/download_client/testcase.yaml +++ b/tests/subsys/net/lib/download_client/testcase.yaml @@ -1,6 +1,6 @@ tests: net.lib.download_client: tags: fota - platform_allow: native_posix nrf9160dk_nrf9160 nrf9160dk_nrf9160_ns + platform_allow: native_sim qemu_cortex_m3 integration_platforms: - - native_posix + - native_sim diff --git a/tests/subsys/net/lib/fota_download/CMakeLists.txt b/tests/subsys/net/lib/fota_download/CMakeLists.txt index d52eb27f324a..16cf827e0597 100644 --- a/tests/subsys/net/lib/fota_download/CMakeLists.txt +++ b/tests/subsys/net/lib/fota_download/CMakeLists.txt @@ -25,6 +25,7 @@ target_include_directories(app ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/fota_download/include ${ZEPHYR_NRF_MODULE_DIR}/include/net/ ${ZEPHYR_NRF_MODULE_DIR}/subsys/dfu/include + ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/include . # To get 'pm_config.h' ) diff --git a/tests/subsys/net/lib/fota_download/testcase.yaml b/tests/subsys/net/lib/fota_download/testcase.yaml index 0ee88d35e5e4..d3aff247ffea 100644 --- a/tests/subsys/net/lib/fota_download/testcase.yaml +++ b/tests/subsys/net/lib/fota_download/testcase.yaml @@ -1,7 +1,7 @@ tests: net.lib.fota_download: tags: aws fota - platform_allow: nrf9160dk_nrf9160 nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160 nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160 - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160 + - nrf9160dk/nrf9160/ns diff --git a/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt b/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt index b91b1b8a4fbc..ac18685afa80 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt +++ b/tests/subsys/net/lib/lwm2m_client_utils/CMakeLists.txt @@ -14,6 +14,7 @@ target_sources(app ${app_sources} ${ZEPHYR_BASE}/subsys/net/lib/lwm2m/lwm2m_util.c ) +zephyr_linker_sources(SECTIONS src/iterables.ld) set(options -DCONFIG_LWM2M_ENGINE_MAX_PENDING=5 diff --git a/tests/subsys/net/lib/lwm2m_client_utils/boards/native_posix.overlay b/tests/subsys/net/lib/lwm2m_client_utils/boards/native_sim.overlay similarity index 100% rename from tests/subsys/net/lib/lwm2m_client_utils/boards/native_posix.overlay rename to tests/subsys/net/lib/lwm2m_client_utils/boards/native_sim.overlay diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/cellconn.c b/tests/subsys/net/lib/lwm2m_client_utils/src/cellconn.c index 4c3e8cfea627..6449409bcb59 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/cellconn.c +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/cellconn.c @@ -11,6 +11,9 @@ #include #include "stubs.h" #include "lwm2m_object.h" +#include "lwm2m_engine.h" + +static int copy_uri_write_cb(const struct lwm2m_obj_path *path, lwm2m_engine_set_data_cb_t cb); static lwm2m_engine_set_data_cb_t set_uri_cb; static lwm2m_engine_set_data_cb_t set_uri_cb_psm; @@ -26,6 +29,9 @@ static void setup(void) /* reset common FFF internal structures */ FFF_RESET_HISTORY(); + + lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; + call_lwm2m_init_callbacks(); } static int copy_uri_write_cb(const struct lwm2m_obj_path *path, lwm2m_engine_set_data_cb_t cb) @@ -47,29 +53,8 @@ static int copy_uri_write_cb(const struct lwm2m_obj_path *path, lwm2m_engine_set return 0; } -static lte_lc_evt_handler_t handler; - -static void copy_event_handler(lte_lc_evt_handler_t hd) -{ - handler = hd; -} - ZTEST_SUITE(lwm2m_client_utils_cellconn, NULL, NULL, NULL, NULL, NULL); -ZTEST(lwm2m_client_utils_cellconn, test_init_cellconn) -{ - int rc; - - setup(); - - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - zassert_equal(lwm2m_register_post_write_callback_fake.call_count, 7, - "Callbacks not registered"); - zassert_equal(lwm2m_set_res_buf_fake.call_count, 9, - "Data buffers not set"); -} - ZTEST(lwm2m_client_utils_cellconn, test_disable_radio_period_cb) { int rc; @@ -77,10 +62,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_disable_radio_period_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb(10, 0, 1, (uint8_t *)&period, sizeof(period), true, sizeof(period)); zassert_equal(rc, 0, "Wrong return value"); k_sleep(K_SECONDS(70)); /* Wait for timer */ @@ -93,10 +74,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_psm_time_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb_psm(10, 0, 4, (uint8_t *)&time, sizeof(time), true, sizeof(time)); zassert_equal(rc, 0, "Wrong return value"); } @@ -108,10 +85,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_active_time_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb_active_time(10, 0, 5, (uint8_t *)&time, sizeof(time), true, sizeof(time)); zassert_equal(rc, 0, "Wrong return value"); } @@ -123,10 +96,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_edrx_update_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb_edrx(10, 0, 8, &data, sizeof(data), true, sizeof(data)); zassert_equal(rc, 0, "Wrong return value"); } @@ -138,10 +107,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_active_psm_update_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb_psm_update(10, 0, 13, &psm, sizeof(psm), true, sizeof(psm)); zassert_equal(rc, 0, "Wrong return value"); } @@ -153,10 +118,6 @@ ZTEST(lwm2m_client_utils_cellconn, test_rai_update_cb) setup(); - lwm2m_register_post_write_callback_fake.custom_fake = copy_uri_write_cb; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - rc = set_uri_cb_rai(10, 0, 14, &rai, sizeof(rai), true, sizeof(rai)); zassert_equal(rc, 0, "Wrong return value"); rai = 6; @@ -169,44 +130,34 @@ ZTEST(lwm2m_client_utils_cellconn, test_rai_update_cb) ZTEST(lwm2m_client_utils_cellconn, test_psm_update) { - int rc; struct lte_lc_evt evt = {0}; setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - evt.type = LTE_LC_EVT_PSM_UPDATE; evt.psm_cfg.tau = 600; evt.psm_cfg.active_time = 30; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_notify_observer_fake.call_count, 3, "Incorrect number of lwm2m_notify_observer() calls"); } ZTEST(lwm2m_client_utils_cellconn, test_edrx_update) { - int rc; struct lte_lc_evt evt = {0}; setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; - rc = lwm2m_init_cellular_connectivity_object(); - zassert_equal(rc, 0, "Wrong return value"); - evt.type = LTE_LC_EVT_LTE_MODE_UPDATE; evt.lte_mode = LTE_LC_LTE_MODE_LTEM; - handler(&evt); + call_lte_handlers(&evt); evt.type = LTE_LC_EVT_EDRX_UPDATE; evt.edrx_cfg.edrx = 20; evt.edrx_cfg.mode = LTE_LC_LTE_MODE_LTEM; - handler(&evt); + call_lte_handlers(&evt); evt.edrx_cfg.mode = LTE_LC_LTE_MODE_NBIOT; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_notify_observer_fake.call_count, 3, "Incorrect number of lwm2m_notify_observer() calls"); } diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/connmon.c b/tests/subsys/net/lib/lwm2m_client_utils/src/connmon.c index f6b1d6e935ae..828803d541a9 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/connmon.c +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/connmon.c @@ -27,8 +27,6 @@ static int16_t modem_rsrp_resource; static enum lte_lc_lte_mode lte_mode; -static lte_lc_evt_handler_t handler; - static struct modem_param_info modem_param = { .network.ip_address.value_string = "192.168.0.2", .network.apn.value_string = "nat.iot.no", @@ -89,11 +87,6 @@ static int set_u8_custom_fake(const struct lwm2m_obj_path *path, uint8_t value) return 0; } -static void copy_event_handler(lte_lc_evt_handler_t hd) -{ - handler = hd; -} - static int copy_modem_info(struct modem_param_info *params) { params = &modem_param; @@ -123,34 +116,20 @@ static void setup(void) */ ZTEST(lwm2m_client_utils_connmon, test_modem_info_init_fail) { - int rc; - setup(); modem_info_init_fake.return_val = -1; - rc = lwm2m_init_connmon(); + call_lwm2m_init_callbacks(); zassert_equal(modem_info_init_fake.call_count, 1, "Modem info init not called"); - zassert_equal(rc, modem_info_init_fake.return_val, "wrong return value"); } ZTEST(lwm2m_client_utils_connmon, test_modem_info_params_init_fail) { - int rc; - setup(); modem_info_params_init_fake.return_val = -2; - rc = lwm2m_init_connmon(); + call_lwm2m_init_callbacks(); zassert_equal(modem_info_params_init_fake.call_count, 1, "Info params init not called"); - zassert_equal(rc, modem_info_params_init_fake.return_val, "wrong return value"); -} - -ZTEST(lwm2m_client_utils_connmon, test_init_connmon) -{ - setup(); - - lwm2m_init_connmon(); - zassert_equal(lte_lc_register_handler_fake.call_count, 1); } ZTEST(lwm2m_client_utils_connmon, test_connected) @@ -160,15 +139,14 @@ ZTEST(lwm2m_client_utils_connmon, test_connected) setup(); modem_rsrp_resource = 50; - lte_lc_register_handler_fake.custom_fake = copy_event_handler; lwm2m_set_string_fake.custom_fake = set_string_custom_fake; lwm2m_set_s16_fake.custom_fake = set_s16_custom_fake; modem_info_params_get_fake.custom_fake = copy_modem_info; modem_info_rsrp_register_fake.custom_fake = copy_rsrp_handler; - lwm2m_init_connmon(); + call_lwm2m_init_callbacks(); evt.type = LTE_LC_EVT_NW_REG_STATUS; evt.nw_reg_status = LTE_LC_NW_REG_REGISTERED_HOME; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 1, "Info params get not called"); zassert_equal(lwm2m_set_string_fake.call_count, 3, "Strings not set"); @@ -176,7 +154,7 @@ ZTEST(lwm2m_client_utils_connmon, test_connected) k_sleep(K_MSEC(100)); zassert_equal(lwm2m_set_s16_fake.call_count, 1, "RSRP not set"); evt.nw_reg_status = LTE_LC_NW_REG_NOT_REGISTERED; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 1, "Info params called"); zassert_equal(lwm2m_set_string_fake.call_count, 3, "Strings set"); @@ -188,12 +166,10 @@ ZTEST(lwm2m_client_utils_connmon, test_update_disconnected) setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; lwm2m_set_string_fake.custom_fake = set_string_custom_fake; modem_info_params_get_fake.custom_fake = copy_modem_info; - lwm2m_init_connmon(); evt.type = LTE_LC_EVT_CELL_UPDATE; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 0, "Info params called"); zassert_equal(lwm2m_set_string_fake.call_count, 0, "Strings set"); @@ -205,24 +181,22 @@ ZTEST(lwm2m_client_utils_connmon, test_update) setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; lwm2m_set_string_fake.custom_fake = set_string_custom_fake; modem_info_params_get_fake.custom_fake = copy_modem_info; - lwm2m_init_connmon(); evt.type = LTE_LC_EVT_NW_REG_STATUS; evt.nw_reg_status = LTE_LC_NW_REG_REGISTERED_HOME; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 1, "Info params get not called"); zassert_equal(lwm2m_set_string_fake.call_count, 3, "Strings not set"); evt.type = LTE_LC_EVT_CELL_UPDATE; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 2, "Info params called"); zassert_equal(lwm2m_set_string_fake.call_count, 6, "Strings set"); evt.type = LTE_LC_EVT_NW_REG_STATUS; evt.nw_reg_status = LTE_LC_NW_REG_NOT_REGISTERED; - handler(&evt); + call_lte_handlers(&evt); k_sleep(K_MSEC(100)); zassert_equal(modem_info_params_get_fake.call_count, 2, "Info params called"); zassert_equal(lwm2m_set_string_fake.call_count, 6, "Strings set"); @@ -235,11 +209,9 @@ ZTEST(lwm2m_client_utils_connmon, test_lte_mode_update) setup(); lte_mode = LTE_LC_LTE_MODE_LTEM; - lte_lc_register_handler_fake.custom_fake = copy_event_handler; lwm2m_set_u8_fake.custom_fake = set_u8_custom_fake; - lwm2m_init_connmon(); evt.type = LTE_LC_EVT_LTE_MODE_UPDATE; evt.lte_mode = lte_mode; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_set_u8_fake.call_count, 1, "LTE mode not set"); } diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/device.c b/tests/subsys/net/lib/lwm2m_client_utils/src/device.c index dc10b560f974..c950f7ad7984 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/device.c +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/device.c @@ -55,13 +55,10 @@ static void setup(void) ZTEST(lwm2m_client_utils_device, test_init_device) { - int rc; - setup(); lwm2m_register_exec_callback_fake.custom_fake = lwm2m_register_exec_callback_copy; - rc = lwm2m_init_device(); - zassert_equal(rc, 0, "wrong return value"); + call_lwm2m_init_callbacks(); zassert_not_null(reboot_cb, "NULL"); } diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/iterables.ld b/tests/subsys/net/lib/lwm2m_client_utils/src/iterables.ld new file mode 100644 index 000000000000..83ce9070ef02 --- /dev/null +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/iterables.ld @@ -0,0 +1 @@ +ITERABLE_SECTION_ROM(lwm2m_init_func, 4) diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/notification.c b/tests/subsys/net/lib/lwm2m_client_utils/src/notification.c index bd8047ca74fe..c19451f9832a 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/notification.c +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/notification.c @@ -45,13 +45,6 @@ static void setup(void) FFF_RESET_HISTORY(); } -static lte_lc_evt_handler_t handler; - -static void copy_event_handler(lte_lc_evt_handler_t hd) -{ - handler = hd; -} - ZTEST_SUITE(lwm2m_client_utils_lte_notification, NULL, NULL, NULL, NULL, NULL); @@ -64,16 +57,15 @@ ZTEST(lwm2m_client_utils_lte_notification, test_ncell_schedule_measurement) lwm2m_ncell_schedule_measurement(); zassert_equal(lte_lc_neighbor_cell_measurement_fake.call_count, 0, "Cell_measurement call count should be 0"); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; rc = lwm2m_ncell_handler_register(); zassert_equal(rc, 0, "Wrong return value"); evt.type = LTE_LC_EVT_RRC_UPDATE; evt.rrc_mode = LTE_LC_RRC_MODE_CONNECTED; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lte_lc_neighbor_cell_measurement_fake.call_count, 0, "No call to lte_lc_neighbor_cell_measurement()"); evt.rrc_mode = LTE_LC_RRC_MODE_IDLE; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lte_lc_neighbor_cell_measurement_fake.call_count, 1, "No call to lte_lc_neighbor_cell_measurement()"); lwm2m_ncell_schedule_measurement(); @@ -87,16 +79,15 @@ ZTEST(lwm2m_client_utils_lte_notification, test_tau_prewarning) setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; rc = lwm2m_ncell_handler_register(); zassert_equal(rc, 0, "Wrong return value"); evt.type = LTE_LC_EVT_TAU_PRE_WARNING; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_rd_client_update_fake.call_count, 0, "LwM2M RD client update call count should be 0"); lwm2m_rd_client_ctx_fake.return_val = &ctx; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_rd_client_update_fake.call_count, 1, "LwM2M RD client not updated"); } @@ -110,11 +101,10 @@ ZTEST(lwm2m_client_utils_lte_notification, test_neighbor_cell_meas) setup(); - lte_lc_register_handler_fake.custom_fake = copy_event_handler; rc = lwm2m_ncell_handler_register(); zassert_equal(rc, 0, "Wrong return value"); evt.type = LTE_LC_EVT_NEIGHBOR_CELL_MEAS; - handler(&evt); + call_lte_handlers(&evt); zassert_equal(lwm2m_set_s32_fake.call_count, 15, "Cell info not updated, was %d", lwm2m_set_s32_fake.call_count); diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.c b/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.c index de22e2696bf5..ebbd65c36147 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.c +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.c @@ -6,13 +6,14 @@ #include #include - +#include #include #include #include #include #include #include +#include "lwm2m_engine.h" #include "stubs.h" /* @@ -68,7 +69,6 @@ DEFINE_FAKE_VALUE_FUNC(int, lte_lc_edrx_param_set, enum lte_lc_lte_mode, const c DEFINE_FAKE_VALUE_FUNC(int, lte_lc_edrx_req, bool); DEFINE_FAKE_VALUE_FUNC(int, lte_lc_neighbor_cell_measurement, struct lte_lc_ncellmeas_params *); DEFINE_FAKE_VALUE_FUNC(int, lte_lc_psm_param_set_seconds, int, int); -DEFINE_FAKE_VOID_FUNC(lte_lc_register_handler, lte_lc_evt_handler_t); DEFINE_FAKE_VALUE_FUNC(int, nrf_cloud_agnss_process, const char *, size_t); DEFINE_FAKE_VALUE_FUNC(int, nrf_cloud_pgps_begin_update); DEFINE_FAKE_VALUE_FUNC(int, nrf_cloud_pgps_process_update, uint8_t *, size_t); @@ -111,3 +111,44 @@ DEFINE_FAKE_VALUE_FUNC_VARARG(int, nrf_modem_at_cmd_async, nrf_modem_at_resp_han DEFINE_FAKE_VALUE_FUNC(int, at_params_list_init, struct at_param_list *, size_t); DEFINE_FAKE_VALUE_FUNC(int, z_impl_zsock_setsockopt, int, int, int, const void *, socklen_t); DEFINE_FAKE_VOID_FUNC(lwm2m_utils_rai_event_cb, struct lwm2m_ctx *, enum lwm2m_rd_client_event *); +DEFINE_FAKE_VALUE_FUNC(uint8_t, lwm2m_firmware_get_update_state_inst, uint16_t); +DEFINE_FAKE_VOID_FUNC(lwm2m_firmware_set_update_result_inst, uint16_t, uint8_t); +DEFINE_FAKE_VOID_FUNC(lwm2m_registry_lock); +DEFINE_FAKE_VOID_FUNC(lwm2m_registry_unlock); +DEFINE_FAKE_VOID_FUNC(boot_is_img_confirmed); +DEFINE_FAKE_VOID_FUNC(boot_write_img_confirmed); + +static lte_lc_evt_handler_t lte_handlers[10]; +void lte_lc_register_handler(lte_lc_evt_handler_t handler) +{ + for (int i = 0; i < ARRAY_SIZE(lte_handlers); i++) { + if (!lte_handlers[i] || lte_handlers[i] == handler) { + lte_handlers[i] = handler; + return; + } + } +} + +void call_lte_handlers(const struct lte_lc_evt *const evt) +{ + for (int i = 0; i < ARRAY_SIZE(lte_handlers); i++) { + if (lte_handlers[i]) { + lte_handlers[i](evt); + } + } +} + +int call_lwm2m_init_callbacks(void) +{ + STRUCT_SECTION_FOREACH(lwm2m_init_func, init) + { + int ret = init->f(); + + if (ret) { + printf("Init function %p returned %d\n", init, ret); + } + } + return 0; +} + +SYS_INIT(call_lwm2m_init_callbacks, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.h b/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.h index 4ed81d1b42ff..7a1033a0dee7 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.h +++ b/tests/subsys/net/lib/lwm2m_client_utils/src/stubs.h @@ -62,7 +62,6 @@ DECLARE_FAKE_VALUE_FUNC(int, lte_lc_edrx_param_set, enum lte_lc_lte_mode, const DECLARE_FAKE_VALUE_FUNC(int, lte_lc_edrx_req, bool); DECLARE_FAKE_VALUE_FUNC(int, lte_lc_neighbor_cell_measurement, struct lte_lc_ncellmeas_params *); DECLARE_FAKE_VALUE_FUNC(int, lte_lc_psm_param_set_seconds, int, int); -DECLARE_FAKE_VOID_FUNC(lte_lc_register_handler, lte_lc_evt_handler_t); DECLARE_FAKE_VALUE_FUNC(int, nrf_cloud_agnss_process, const char *, size_t); DECLARE_FAKE_VALUE_FUNC(int, nrf_cloud_pgps_begin_update); DECLARE_FAKE_VALUE_FUNC(int, nrf_cloud_pgps_process_update, uint8_t *, size_t); @@ -105,7 +104,13 @@ DECLARE_FAKE_VALUE_FUNC_VARARG(int, nrf_modem_at_cmd_async, nrf_modem_at_resp_ha const char *, ...); DECLARE_FAKE_VALUE_FUNC(int, at_params_list_init, struct at_param_list *, size_t); DECLARE_FAKE_VALUE_FUNC(int, z_impl_zsock_setsockopt, int, int, int, const void *, socklen_t); -DECLARE_FAKE_VOID_FUNC(lwm2m_utils_rai_event_cb, struct lwm2m_ctx *, enum lwm2m_rd_client_event *) +DECLARE_FAKE_VOID_FUNC(lwm2m_utils_rai_event_cb, struct lwm2m_ctx *, enum lwm2m_rd_client_event *); +DECLARE_FAKE_VALUE_FUNC(uint8_t, lwm2m_firmware_get_update_state_inst, uint16_t); +DECLARE_FAKE_VOID_FUNC(lwm2m_firmware_set_update_result_inst, uint16_t, uint8_t); +DECLARE_FAKE_VOID_FUNC(lwm2m_registry_lock); +DECLARE_FAKE_VOID_FUNC(lwm2m_registry_unlock); +DECLARE_FAKE_VOID_FUNC(boot_is_img_confirmed); +DECLARE_FAKE_VOID_FUNC(boot_write_img_confirmed); /* List of fakes used by this unit tester */ #define DO_FOREACH_FAKE(FUNC) do { \ @@ -153,7 +158,6 @@ DECLARE_FAKE_VOID_FUNC(lwm2m_utils_rai_event_cb, struct lwm2m_ctx *, enum lwm2m_ FUNC(lte_lc_edrx_param_set) \ FUNC(lte_lc_edrx_req) \ FUNC(lte_lc_neighbor_cell_measurement) \ - FUNC(lte_lc_register_handler) \ FUNC(lte_lc_psm_param_set_seconds) \ FUNC(nrf_cloud_agnss_process) \ FUNC(nrf_cloud_pgps_begin_update) \ @@ -180,6 +184,15 @@ DECLARE_FAKE_VOID_FUNC(lwm2m_utils_rai_event_cb, struct lwm2m_ctx *, enum lwm2m_ FUNC(at_params_list_init) \ FUNC(z_impl_zsock_setsockopt) \ FUNC(lwm2m_utils_rai_event_cb) \ + FUNC(lwm2m_firmware_get_update_state_inst) \ + FUNC(lwm2m_firmware_set_update_result_inst) \ + FUNC(lwm2m_registry_lock) \ + FUNC(lwm2m_registry_unlock) \ + FUNC(boot_is_img_confirmed) \ + FUNC(boot_write_img_confirmed) \ } while (0) +int call_lwm2m_init_callbacks(void); +void call_lte_handlers(const struct lte_lc_evt *const evt); + #endif diff --git a/tests/subsys/net/lib/lwm2m_client_utils/testcase.yaml b/tests/subsys/net/lib/lwm2m_client_utils/testcase.yaml index 0346f8a0f8f3..325aecf261c3 100644 --- a/tests/subsys/net/lib/lwm2m_client_utils/testcase.yaml +++ b/tests/subsys/net/lib/lwm2m_client_utils/testcase.yaml @@ -1,6 +1,6 @@ tests: subsys.net.lib.lwm2m_client_utils.unittest: tags: unittest - platform_allow: native_posix + platform_allow: native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt b/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt index 0be91453597f..4f4d20dbffd5 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt +++ b/tests/subsys/net/lib/lwm2m_fota_utils/CMakeLists.txt @@ -41,6 +41,7 @@ set(options -DCONFIG_FOTA_DOWNLOAD_MCUBOOT_FLASH_BUF_SZ=512 -DCONFIG_LWM2M_VERSION_1_0=y -DCONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=43200 + -D_POSIX_C_SOURCE=200809L ) target_compile_options(app @@ -73,3 +74,5 @@ target_include_directories(app PRIVATE ${includes} ) + +zephyr_linker_sources(SECTIONS src/iterables.ld) diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf b/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf index adfd2083f63b..881b99488e96 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf +++ b/tests/subsys/net/lib/lwm2m_fota_utils/prj_obj5.conf @@ -7,6 +7,5 @@ CONFIG_ZTEST=y CONFIG_LWM2M_CLIENT_UTILS=y CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT=y -CONFIG_LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT=y CONFIG_LWM2M_CLIENT_UTILS_LOCATION_OBJ_SUPPORT=n CONFIG_HEAP_MEM_POOL_SIZE=1024 diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/src/firmware.c b/tests/subsys/net/lib/lwm2m_fota_utils/src/firmware.c index 1e49fde55907..247dddddbc54 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/src/firmware.c +++ b/tests/subsys/net/lib/lwm2m_fota_utils/src/firmware.c @@ -338,12 +338,12 @@ static void *init_firmware(void) settings_register_fake.custom_fake = NULL; settings_subsys_init_fake.return_val = -1; - rc = lwm2m_init_firmware(); + rc = lwm2m_init_firmware_cb(NULL); zassert_equal(rc, -1, "wrong return value"); settings_subsys_init_fake.return_val = 0; settings_register_fake.return_val = -1; - rc = lwm2m_init_firmware(); + rc = lwm2m_init_firmware_cb(NULL); zassert_equal(rc, -1, "wrong return value"); init_firmware_success(); return NULL; @@ -543,7 +543,7 @@ ZTEST(lwm2m_client_utils_firmware, test_firmware_pull_failures_cb) printf("State %d\r\n", state); zassert_equal(state, STATE_DOWNLOADING, "wrong result value"); zassert_not_null(firmware_fota_download_cb, "Fota client cb is NULL"); - pull_callback_event_stub(FOTA_DOWNLOAD_EVT_ERROR, FOTA_DOWNLOAD_ERROR_CAUSE_NO_ERROR); + pull_callback_event_stub(FOTA_DOWNLOAD_EVT_ERROR, FOTA_DOWNLOAD_ERROR_CAUSE_CONNECT_FAILED); result = get_app_result(); state = get_app_state(); zassert_equal(result, RESULT_CONNECTION_LOST, "wrong result value"); diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/src/iterables.ld b/tests/subsys/net/lib/lwm2m_fota_utils/src/iterables.ld new file mode 100644 index 000000000000..83ce9070ef02 --- /dev/null +++ b/tests/subsys/net/lib/lwm2m_fota_utils/src/iterables.ld @@ -0,0 +1 @@ +ITERABLE_SECTION_ROM(lwm2m_init_func, 4) diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/src/stubs.c b/tests/subsys/net/lib/lwm2m_fota_utils/src/stubs.c index b8e49155de0e..0ff828c432a4 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/src/stubs.c +++ b/tests/subsys/net/lib/lwm2m_fota_utils/src/stubs.c @@ -96,3 +96,24 @@ DEFINE_FAKE_VALUE_FUNC(int, fota_download_util_download_cancel); DEFINE_FAKE_VALUE_FUNC(int, fota_download_util_image_schedule, enum dfu_target_image_type); DEFINE_FAKE_VALUE_FUNC(int, fota_download_util_image_reset, enum dfu_target_image_type); DEFINE_FAKE_VALUE_FUNC(int, fota_download_util_apply_update, enum dfu_target_image_type); + +static int lwm2m_engine_init(void) +{ + STRUCT_SECTION_FOREACH(lwm2m_init_func, init) { + int ret = init->f(); + + if (ret) { + printf("Init function %p returned %d\n", init, ret); + } + } + return 0; +} + +SYS_INIT(lwm2m_engine_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); + +FUNC_NORETURN void sys_reboot(int types) +{ + while (1) { + k_sleep(K_SECONDS(1)); + } +} diff --git a/tests/subsys/net/lib/lwm2m_fota_utils/testcase.yaml b/tests/subsys/net/lib/lwm2m_fota_utils/testcase.yaml index b363de394904..f47f1760a40a 100644 --- a/tests/subsys/net/lib/lwm2m_fota_utils/testcase.yaml +++ b/tests/subsys/net/lib/lwm2m_fota_utils/testcase.yaml @@ -1,12 +1,12 @@ tests: subsys.net.lib.lwm2m_fota_utils.unittest_adv: tags: unittest - platform_allow: native_posix + platform_allow: native_sim integration_platforms: - - native_posix + - native_sim subsys.net.lib.lwm2m_fota_utils.unittest_obj5: extra_args: CONF_FILE="prj_obj5.conf" tags: unittest - platform_allow: native_posix + platform_allow: native_sim integration_platforms: - - native_posix + - native_sim diff --git a/tests/subsys/net/lib/mcumgr_smp_client/CMakeLists.txt b/tests/subsys/net/lib/mcumgr_smp_client/CMakeLists.txt index 96f82df4061d..d97350fb1c75 100644 --- a/tests/subsys/net/lib/mcumgr_smp_client/CMakeLists.txt +++ b/tests/subsys/net/lib/mcumgr_smp_client/CMakeLists.txt @@ -17,10 +17,12 @@ target_sources(app ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/mcumgr_smp_client/src/mcumgr_smp_client.c ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/fota_download/src/util/fota_download_util.c ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/fota_download/src/util/fota_download_smp.c + ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/src/parse.c ) set(includes "src/" +${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/download_client/include ) target_include_directories(app diff --git a/tests/subsys/net/lib/nrf_cloud/cloud/testcase.yaml b/tests/subsys/net/lib/nrf_cloud/cloud/testcase.yaml index 9856e3c24bb3..41b379b3dfeb 100644 --- a/tests/subsys/net/lib/nrf_cloud/cloud/testcase.yaml +++ b/tests/subsys/net/lib/nrf_cloud/cloud/testcase.yaml @@ -1,8 +1,8 @@ tests: net.lib.nrf_cloud.cloud: - platform_allow: nrf9160dk_nrf9160_ns native_posix qemu_cortex_m3 + platform_allow: nrf9160dk/nrf9160/ns native_posix qemu_cortex_m3 integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns - native_posix - qemu_cortex_m3 tags: nrf_cloud_test nrf_cloud_lib diff --git a/tests/subsys/net/lib/nrf_cloud/fota_common/CMakeLists.txt b/tests/subsys/net/lib/nrf_cloud/fota_common/CMakeLists.txt index 7f7a34e8425e..12c15775ce90 100644 --- a/tests/subsys/net/lib/nrf_cloud/fota_common/CMakeLists.txt +++ b/tests/subsys/net/lib/nrf_cloud/fota_common/CMakeLists.txt @@ -18,6 +18,13 @@ FILE(GLOB app_sources src/main.c) endif() target_sources(app PRIVATE ${app_sources}) +if (NOT CONFIG_NRF_CLOUD_FOTA) + target_sources(app + PRIVATE + ${ZEPHYR_NRF_MODULE_DIR}/subsys/net/lib/nrf_cloud/src/nrf_cloud_fota_common.c + ) +endif() + target_include_directories(app PRIVATE src diff --git a/tests/subsys/net/lib/nrf_cloud/fota_common/testcase.yaml b/tests/subsys/net/lib/nrf_cloud/fota_common/testcase.yaml index f802d288a3fe..4c0724614705 100644 --- a/tests/subsys/net/lib/nrf_cloud/fota_common/testcase.yaml +++ b/tests/subsys/net/lib/nrf_cloud/fota_common/testcase.yaml @@ -1,7 +1,7 @@ common: - platform_allow: nrf9160dk_nrf9160_ns + platform_allow: nrf9160dk/nrf9160/ns integration_platforms: - - nrf9160dk_nrf9160_ns + - nrf9160dk/nrf9160/ns tags: ci_build nrf_cloud_test nrf_cloud_lib tests: net.lib.nrf_cloud.fota_common: diff --git a/tests/subsys/net/lib/wifi_credentials/src/main.c b/tests/subsys/net/lib/wifi_credentials/src/main.c index 7ffe99ac6a1e..8c03ca3da9c5 100644 --- a/tests/subsys/net/lib/wifi_credentials/src/main.c +++ b/tests/subsys/net/lib/wifi_credentials/src/main.c @@ -55,21 +55,25 @@ void setUp(void) #define SECURITY1 WIFI_SECURITY_TYPE_PSK #define BSSID1 "abcdef" #define FLAGS1 WIFI_CREDENTIALS_FLAG_BSSID +#define CHANNEL1 1 #define SSID2 "test2" #define SECURITY2 WIFI_SECURITY_TYPE_NONE #define FLAGS2 0 +#define CHANNEL2 2 #define SSID3 "test3" #define PSK3 "extremely secret" #define SECURITY3 WIFI_SECURITY_TYPE_SAE #define FLAGS3 0 +#define CHANNEL3 3 #define SSID4 "\0what's\0null\0termination\0anyway" #define PSK4 PSK1 #define SECURITY4 SECURITY1 #define BSSID4 BSSID1 #define FLAGS4 FLAGS1 +#define CHANNEL4 4 void tearDown(void) { @@ -89,10 +93,11 @@ void test_get_non_existing(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; err = wifi_credentials_get_by_ssid_personal(SSID1, sizeof(SSID1), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(-ENOENT, err); } @@ -103,7 +108,7 @@ void test_single_no_bssid(void) /* set network credentials without BSSID */ err = wifi_credentials_set_personal(SSID1, sizeof(SSID1), SECURITY1, NULL, 0, - PSK1, sizeof(PSK1), 0); + PSK1, sizeof(PSK1), 0, 0); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); enum wifi_security_type security = -1; @@ -111,14 +116,16 @@ void test_single_no_bssid(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; /* retrieve network credentials without BSSID */ err = wifi_credentials_get_by_ssid_personal(SSID1, sizeof(SSID1), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(0, strncmp(PSK1, psk_buf, ARRAY_SIZE(psk_buf))); TEST_ASSERT_EQUAL(0, flags); + TEST_ASSERT_EQUAL(0, channel); TEST_ASSERT_EQUAL(SECURITY1, security); err = wifi_credentials_delete_by_ssid(SSID1, sizeof(SSID1)); @@ -132,7 +139,7 @@ void test_single_with_bssid(void) /* set network credentials with BSSID */ err = wifi_credentials_set_personal(SSID1, sizeof(SSID1), SECURITY1, BSSID1, 6, - PSK1, sizeof(PSK1), FLAGS1); + PSK1, sizeof(PSK1), FLAGS1, CHANNEL1); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); enum wifi_security_type security = -1; @@ -140,16 +147,18 @@ void test_single_with_bssid(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; /* retrieve network credentials with BSSID */ err = wifi_credentials_get_by_ssid_personal(SSID1, sizeof(SSID1), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(0, strncmp(PSK1, psk_buf, ARRAY_SIZE(psk_buf))); TEST_ASSERT_EQUAL(sizeof(PSK1), psk_len); TEST_ASSERT_EQUAL(0, strncmp(BSSID1, bssid_buf, ARRAY_SIZE(bssid_buf))); TEST_ASSERT_EQUAL(WIFI_CREDENTIALS_FLAG_BSSID, flags); + TEST_ASSERT_EQUAL(CHANNEL1, channel); TEST_ASSERT_EQUAL(SECURITY1, security); err = wifi_credentials_delete_by_ssid(SSID1, sizeof(SSID1)); @@ -163,7 +172,7 @@ void test_single_without_psk(void) /* set network credentials without PSK/BSSID */ err = wifi_credentials_set_personal(SSID2, sizeof(SSID2), SECURITY2, NULL, 6, - NULL, 0, FLAGS2); + NULL, 0, FLAGS2, CHANNEL2); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); enum wifi_security_type security = -1; @@ -171,14 +180,16 @@ void test_single_without_psk(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; /* retrieve network credentials without PSK/BSSID */ err = wifi_credentials_get_by_ssid_personal(SSID2, sizeof(SSID2), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(0, psk_len); TEST_ASSERT_EQUAL(0, flags); + TEST_ASSERT_EQUAL(CHANNEL2, channel); err = wifi_credentials_delete_by_ssid(SSID2, sizeof(SSID2)); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); @@ -190,7 +201,7 @@ void test_single_without_ssid(void) int err; err = wifi_credentials_set_personal("", 0, SECURITY1, BSSID1, 6, - PSK1, sizeof(PSK1), FLAGS1); + PSK1, sizeof(PSK1), FLAGS1, CHANNEL1); TEST_ASSERT_EQUAL(-EINVAL, err); enum wifi_security_type security = -1; @@ -198,10 +209,11 @@ void test_single_without_ssid(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; err = wifi_credentials_get_by_ssid_personal("", 0, &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(-EINVAL, err); err = wifi_credentials_delete_by_ssid("", 0); @@ -214,7 +226,7 @@ void test_single_garbled_ssid(void) int err; err = wifi_credentials_set_personal(SSID4, sizeof(SSID4), SECURITY4, BSSID4, 6, - PSK4, sizeof(PSK4), FLAGS4); + PSK4, sizeof(PSK4), FLAGS4, CHANNEL4); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); enum wifi_security_type security = -1; @@ -222,16 +234,18 @@ void test_single_garbled_ssid(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; err = wifi_credentials_get_by_ssid_personal(SSID4, sizeof(SSID4), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(0, strncmp(PSK4, psk_buf, ARRAY_SIZE(psk_buf))); TEST_ASSERT_EQUAL(sizeof(PSK4), psk_len); TEST_ASSERT_EQUAL(0, strncmp(BSSID4, bssid_buf, ARRAY_SIZE(bssid_buf))); TEST_ASSERT_EQUAL(SECURITY4, security); TEST_ASSERT_EQUAL(FLAGS4, flags); + TEST_ASSERT_EQUAL(CHANNEL4, channel); err = wifi_credentials_delete_by_ssid(SSID4, sizeof(SSID4)); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); @@ -245,6 +259,7 @@ void verify_ssid_cache_cb(void *cb_arg, const char *ssid, size_t ssid_len) TEST_ASSERT_EQUAL(0, strncmp(ssids[call_count++], ssid, ssid_len)); TEST_ASSERT_EQUAL_PTR(NULL, cb_arg); + } /* Verify that wifi_credentials behaves correctly when the storage limit is reached. */ @@ -254,11 +269,11 @@ void test_storage_limit(void) /* Set two networks */ err = wifi_credentials_set_personal(SSID1, sizeof(SSID1), SECURITY1, BSSID1, 6, - PSK1, sizeof(PSK1), FLAGS1); + PSK1, sizeof(PSK1), FLAGS1, CHANNEL1); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); err = wifi_credentials_set_personal(SSID2, sizeof(SSID2), SECURITY2, NULL, 6, - NULL, 0, FLAGS2); + NULL, 0, FLAGS2, CHANNEL2); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); enum wifi_security_type security = -1; @@ -266,48 +281,72 @@ void test_storage_limit(void) char psk_buf[WIFI_CREDENTIALS_MAX_PASSWORD_LEN] = ""; size_t psk_len = 0; uint32_t flags = 0; + uint8_t channel = 0; /* Get two networks */ err = wifi_credentials_get_by_ssid_personal(SSID1, sizeof(SSID1), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(0, strncmp(PSK1, psk_buf, ARRAY_SIZE(psk_buf))); TEST_ASSERT_EQUAL(sizeof(PSK1), psk_len); TEST_ASSERT_EQUAL(0, strncmp(BSSID1, bssid_buf, ARRAY_SIZE(bssid_buf))); TEST_ASSERT_EQUAL(SECURITY1, security); TEST_ASSERT_EQUAL(FLAGS1, flags); + TEST_ASSERT_EQUAL(CHANNEL1, channel); err = wifi_credentials_get_by_ssid_personal(SSID2, sizeof(SSID2), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(SECURITY2, security); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(FLAGS2, flags); + TEST_ASSERT_EQUAL(CHANNEL2, channel); /* Set third network */ err = wifi_credentials_set_personal(SSID3, sizeof(SSID3), SECURITY3, NULL, 6, - PSK3, sizeof(PSK3), FLAGS3); + PSK3, sizeof(PSK3), FLAGS3, CHANNEL3); TEST_ASSERT_EQUAL(-ENOBUFS, err); /* Not enough space? Delete the first one. */ wifi_credentials_delete_by_ssid(SSID1, ARRAY_SIZE(SSID1)); err = wifi_credentials_set_personal(SSID3, sizeof(SSID3), SECURITY3, NULL, 6, - PSK3, sizeof(PSK3), FLAGS3); + PSK3, sizeof(PSK3), FLAGS3, CHANNEL3); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); err = wifi_credentials_get_by_ssid_personal(SSID3, sizeof(SSID3), &security, bssid_buf, ARRAY_SIZE(bssid_buf), - psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags); + psk_buf, ARRAY_SIZE(psk_buf), &psk_len, &flags, &channel); TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); TEST_ASSERT_EQUAL(SECURITY3, security); TEST_ASSERT_EQUAL(sizeof(PSK3), psk_len); TEST_ASSERT_EQUAL(0, strncmp(PSK3, psk_buf, ARRAY_SIZE(psk_buf))); TEST_ASSERT_EQUAL(FLAGS3, flags); + TEST_ASSERT_EQUAL(CHANNEL3, channel); wifi_credentials_for_each_ssid(verify_ssid_cache_cb, NULL); } +/* Verify that all entries are deleted. */ +void test_delete_all_entries(void) +{ + /* Set two networks */ + int err = wifi_credentials_set_personal(SSID1, sizeof(SSID1), SECURITY1, BSSID1, 6, + PSK1, sizeof(PSK1), FLAGS1, CHANNEL1); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); + + err = wifi_credentials_set_personal(SSID2, sizeof(SSID2), SECURITY2, NULL, 6, + NULL, 0, FLAGS2, CHANNEL2); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); + + /* Delete all networks */ + err = wifi_credentials_delete_all(); + TEST_ASSERT_EQUAL(EXIT_SUCCESS, err); + + /* Verify that the storage is empty */ + TEST_ASSERT_TRUE(wifi_credentials_is_empty()); +} + /* 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). diff --git a/tests/subsys/nrf_profiler/testcase.yaml b/tests/subsys/nrf_profiler/testcase.yaml index 370108a0aee3..a907d51d0ce8 100644 --- a/tests/subsys/nrf_profiler/testcase.yaml +++ b/tests/subsys/nrf_profiler/testcase.yaml @@ -2,11 +2,13 @@ tests: nrf_profiler.core: platform_exclude: native_posix qemu_x86 qemu_cortex_m3 platform_allow: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns integration_platforms: - - nrf52dk_nrf52832 - - nrf52840dk_nrf52840 - - nrf9160dk_nrf9160_ns + - nrf52dk/nrf52832 + - nrf52840dk/nrf52840 + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns tags: nrf_profiler diff --git a/tests/subsys/partition_manager/region/testcase.yaml b/tests/subsys/partition_manager/region/testcase.yaml index 5567b83a662e..19bd6ca7c33d 100644 --- a/tests/subsys/partition_manager/region/testcase.yaml +++ b/tests/subsys/partition_manager/region/testcase.yaml @@ -3,32 +3,32 @@ common: tags: partition_manager tests: regions.little_fs: - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - CONFIG_FILE_SYSTEM_LITTLEFS=y - CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL=y regions.nvs_storage: - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - CONFIG_NVS=y - CONFIG_PM_PARTITION_REGION_NVS_STORAGE_EXTERNAL=y regions.settings_storage: - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp extra_configs: - CONFIG_FCB=y - CONFIG_SETTINGS=y - CONFIG_SETTINGS_FCB=y - CONFIG_PM_PARTITION_REGION_SETTINGS_STORAGE_EXTERNAL=y regions.settings_storage_tfm: - platform_allow: nrf5340dk_nrf5340_cpuapp_ns + platform_allow: nrf5340dk/nrf5340/cpuapp/ns integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns + - nrf5340dk/nrf5340/cpuapp/ns extra_configs: - CONFIG_FCB=y - CONFIG_SETTINGS=y diff --git a/tests/subsys/pcd/testcase.yaml b/tests/subsys/pcd/testcase.yaml index 6163ca12e149..3efc4dff3d4c 100644 --- a/tests/subsys/pcd/testcase.yaml +++ b/tests/subsys/pcd/testcase.yaml @@ -1,6 +1,6 @@ tests: dfu.pcd: - platform_allow: nrf5340dk_nrf5340_cpuapp + platform_allow: nrf5340dk/nrf5340/cpuapp integration_platforms: - - nrf5340dk_nrf5340_cpuapp + - nrf5340dk/nrf5340/cpuapp tags: pcd diff --git a/tests/subsys/sdfw_services/client/CMakeLists.txt b/tests/subsys/sdfw_services/client/CMakeLists.txt new file mode 100644 index 000000000000..ef194fe9c37b --- /dev/null +++ b/tests/subsys/sdfw_services/client/CMakeLists.txt @@ -0,0 +1,43 @@ +# +# 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(ssf_client_test) + +set(SSF_DIR ${ZEPHYR_NRF_MODULE_DIR}/subsys/sdfw_services) + +# generate runner for the test +test_runner_generate(src/ssf_client_test.c) + +# create mocks +cmock_handle(${SSF_DIR}/transport/include/ssf_client_transport.h) + +# add test file +target_sources(app PRIVATE src/ssf_client_test.c) + +# add file under test +target_sources(app + PRIVATE + ${SSF_DIR}/ssf_client.c + ${SSF_DIR}/ssf_client_notif.c + ${SSF_DIR}/os/ssf_client_zephyr.c +) + +target_include_directories(app + PRIVATE + ${SSF_DIR}/os + ${NRFXLIB_DIR}/nrf_rpc/include +) + +target_compile_options(app + PRIVATE + -DCONFIG_SSF_CLIENT_DOMAIN_ID=2 + -DCONFIG_SSF_CLIENT_LOG_LEVEL=2 + -DCONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX=2 + -DCONFIG_SSF_CLIENT_ZCBOR_MAX_BACKUPS=1 +) diff --git a/tests/subsys/sdfw_services/client/Kconfig b/tests/subsys/sdfw_services/client/Kconfig new file mode 100644 index 000000000000..2cb445215094 --- /dev/null +++ b/tests/subsys/sdfw_services/client/Kconfig @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" diff --git a/tests/subsys/sdfw_services/client/prj.conf b/tests/subsys/sdfw_services/client/prj.conf new file mode 100644 index 000000000000..288f549d2a1f --- /dev/null +++ b/tests/subsys/sdfw_services/client/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_UNITY=y + +CONFIG_HEAP_MEM_POOL_SIZE=2048 + +CONFIG_ZCBOR=y diff --git a/tests/subsys/sdfw_services/client/src/ssf_client_test.c b/tests/subsys/sdfw_services/client/src/ssf_client_test.c new file mode 100644 index 000000000000..d49a21758dd1 --- /dev/null +++ b/tests/subsys/sdfw_services/client/src/ssf_client_test.c @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include "cmock_ssf_client_transport.h" + +#define CBOR_INF_ARRAY_START 0x9F +#define CBOR_INF_ARRAY_END 0xFF + +void ssf_client_notif_handler(const uint8_t *pkt, size_t pkt_len); + +const uint8_t CLIENT_DOMAIN = 2; +static uint8_t *req_hdr_expected; +static size_t req_hdr_len_expected; +static int32_t srvc1_req_expected; +static size_t srvc1_req_len_expected; +static uint8_t *srvc2_req_expected; +static size_t srvc2_req_len_expected; + +static int srvc1_encode_req(uint8_t *payload, size_t payload_len, int32_t *input, + size_t *payload_len_out) +{ + if (payload_len < sizeof(int32_t)) { + return ZCBOR_ERR_UNKNOWN; + } + memcpy(payload, (void *)input, sizeof(int32_t)); + + if (payload_len_out != NULL) { + *payload_len_out = sizeof(int32_t); + } + + return ZCBOR_SUCCESS; +} + +static int srvc1_decode_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, + size_t *payload_len_out) +{ + if (payload_len < sizeof(int32_t)) { + return ZCBOR_ERR_UNKNOWN; + } + memcpy((void *)result, payload, sizeof(int32_t)); + + if (payload_len_out != NULL) { + *payload_len_out = sizeof(int32_t); + } + + return ZCBOR_SUCCESS; +} + +#define CONFIG_SSF_SRVC1_SERVICE_ID 0x10 +#define CONFIG_SSF_SRVC1_SERVICE_VERSION 1 +#define CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE 32 +SSF_CLIENT_SERVICE_DEFINE(srvc1, SRVC1, srvc1_encode_req, srvc1_decode_rsp); + +#define CONFIG_SSF_SRVC2_SERVICE_ID 0x20 +#define CONFIG_SSF_SRVC2_SERVICE_VERSION 5 +#define CONFIG_SSF_SRVC2_SERVICE_BUFFER_SIZE 32 +SSF_CLIENT_SERVICE_DEFINE(srvc2, SRVC2, NULL, NULL); + +#define CONFIG_SSF_SRVC3_SERVICE_ID 0x3 +#define CONFIG_SSF_SRVC3_SERVICE_VERSION 3 +#define CONFIG_SSF_SRVC3_SERVICE_BUFFER_SIZE 3 +SSF_CLIENT_SERVICE_DEFINE(srvc3, SRVC3, srvc1_encode_req, srvc1_decode_rsp); + +#define CONFIG_SSF_SRVC4_SERVICE_ID 0x5 +#define CONFIG_SSF_SRVC4_SERVICE_VERSION 5 +#define CONFIG_SSF_SRVC4_SERVICE_BUFFER_SIZE 7 +SSF_CLIENT_SERVICE_DEFINE(srvc4, SRVC4, srvc1_encode_req, srvc1_decode_rsp); + +static int stub_srvc1_transport_request_send(uint8_t *pkt, size_t pkt_len, const uint8_t **rsp_pkt, + size_t *rsp_pkt_len, int cmock_num_calls) +{ + ARG_UNUSED(rsp_pkt); + ARG_UNUSED(rsp_pkt_len); + ARG_UNUSED(cmock_num_calls); + + TEST_ASSERT_EQUAL(req_hdr_len_expected + srvc1_req_len_expected, pkt_len); + TEST_ASSERT_EQUAL_UINT8_ARRAY(req_hdr_expected, pkt, req_hdr_len_expected); + + int32_t *req_ptr = (int32_t *)&pkt[req_hdr_len_expected]; + + TEST_ASSERT_EQUAL(srvc1_req_expected, *req_ptr); + + return 0; +} + +static int stub_srvc2_transport_request_send(uint8_t *pkt, size_t pkt_len, const uint8_t **rsp_pkt, + size_t *rsp_pkt_len, int cmock_num_calls) +{ + ARG_UNUSED(rsp_pkt); + ARG_UNUSED(rsp_pkt_len); + ARG_UNUSED(cmock_num_calls); + + TEST_ASSERT_EQUAL(req_hdr_len_expected + srvc2_req_len_expected, pkt_len); + TEST_ASSERT_EQUAL_UINT8_ARRAY(req_hdr_expected, pkt, req_hdr_len_expected); + + uint8_t *req_ptr = &pkt[req_hdr_len_expected]; + size_t req_len = pkt_len - req_hdr_len_expected; + + TEST_ASSERT_EQUAL(srvc2_req_len_expected, req_len); + TEST_ASSERT_EQUAL_UINT8_ARRAY(srvc2_req_expected, req_ptr, req_len); + + return 0; +} + +static void init_client(void) +{ + __cmock_ssf_client_transport_init_ExpectAndReturn(ssf_client_notif_handler, 0); + + int err = ssf_client_init(); + + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_init_success(void) +{ + init_client(); +} + +void test_client_init_transport_init_error(void) +{ + __cmock_ssf_client_transport_init_ExpectAndReturn(ssf_client_notif_handler, -NRF_EINVAL); + + int err = ssf_client_init(); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_send_request_success(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc1_req_expected = req; + srvc1_req_len_expected = sizeof(req); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc1_transport_request_send); + + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_START, 0x00, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx_ptr); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(0xBEEF, rsp); +} + +void test_client_send_request_success_free_rsp_later(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + const uint8_t *rsp_pkt; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc1_req_expected = req; + srvc1_req_len_expected = sizeof(req); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc1_transport_request_send); + + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_START, 0x00, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, &rsp_pkt); + + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(0xBEEF, rsp); + TEST_ASSERT_EQUAL_PTR(shmem_rx_ptr, rsp_pkt); +} + +void test_client_send_request_srvc_null(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + + int err = ssf_client_send_request(NULL, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_send_request_req_null(void) +{ + int32_t rsp; + + int err = ssf_client_send_request(&srvc1, NULL, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_send_request_rsp_null(void) +{ + int32_t req = 0xCACE; + + int err = ssf_client_send_request(&srvc1, &req, NULL, NULL); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_send_request_encode_and_decode_func_null(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + + int err = ssf_client_send_request(&srvc2, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_send_request_alloc_tx_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, -SSF_ENOMEM); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_ENOMEM, err); +} + +void test_client_send_request_encode_hdr_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + + /* Have encoding of request header fail by allocating less memory than needed by header. */ + uint8_t shmem_tx[CONFIG_SSF_SRVC3_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC3_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + __cmock_ssf_client_transport_free_tx_buf_Expect(shmem_tx_ptr); + + int err = ssf_client_send_request(&srvc3, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_send_request_encode_req_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC4_SERVICE_ID, + CONFIG_SSF_SRVC4_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + /* + * Have encoding of request payload fail by allocating enough memory for + * header, but not for the payload. + */ + uint8_t shmem_tx[CONFIG_SSF_SRVC4_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC4_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + __cmock_ssf_client_transport_free_tx_buf_Expect(shmem_tx_ptr); + + int err = ssf_client_send_request(&srvc4, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL_UINT8_ARRAY(hdr_expected, shmem_tx, sizeof(hdr_expected)); + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_send_request_send_pkt_too_large(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + /* Have underlying transport return -SSF_EMSGSIZE, indicating a too big package. */ + __cmock_ssf_client_transport_request_send_ExpectAnyArgsAndReturn(-SSF_EMSGSIZE); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EMSGSIZE, err); +} + +void test_client_send_request_send_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + const uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, + CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + const uint8_t pl_expected[] = { 0xCE, 0xCA, 0x00, 0x00 }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + __cmock_ssf_client_transport_request_send_ExpectAnyArgsAndReturn(-NRF_EIO); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EIO, err); + TEST_ASSERT_EQUAL_UINT8_ARRAY(hdr_expected, &shmem_tx[0], sizeof(hdr_expected)); + TEST_ASSERT_EQUAL_UINT8_ARRAY(pl_expected, &shmem_tx[sizeof(hdr_expected)], + sizeof(pl_expected)); +} + +void test_client_send_request_decode_rsp_hdr_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc1_req_expected = req; + srvc1_req_len_expected = sizeof(req); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc1_transport_request_send); + + /* Have header decoding fail by passing CBOR_INF_ARRAY_END instead + * of CBOR_INF_ARRAY_START. + */ + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_END, 0x0, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx_ptr); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_send_request_rsp_is_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc1_req_expected = req; + srvc1_req_len_expected = sizeof(req); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc1_transport_request_send); + + const uint8_t ret_err = 0x24; /* Return -5 (0x24 with CBOR) as error. */ + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_START, ret_err, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx_ptr); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-5, err); +} + +void test_client_send_request_decode_rsp_error(void) +{ + int32_t req = 0xCACE; + int32_t rsp; + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC1_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc1_req_expected = req; + srvc1_req_len_expected = sizeof(req); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc1_transport_request_send); + + /* Have payload decoding fail by giving fewer bytes than is necessary for an int32_t. */ + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_START, 0x0, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx_ptr); + + int err = ssf_client_send_request(&srvc1, &req, &rsp, NULL); + + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_send_raw_request_success(void) +{ + uint8_t req_data[] = { 0xCE, 0xCA, 0x00, 0x00 }; + const uint8_t rsp_data_expected[] = { 0xEF, 0xBE, 0x00, 0x00 }; + uint8_t rsp_data[sizeof(rsp_data_expected)]; + struct ssf_client_raw_data req = { .data = req_data, .len = sizeof(req_data) }; + struct ssf_client_raw_data rsp = { .data = rsp_data, .len = sizeof(rsp_data) }; + + /* 0x18 0x20 is cbor for 0x20 */ + uint8_t hdr_expected[] = { CBOR_INF_ARRAY_START, CLIENT_DOMAIN, 0x18, 0x20, 0x5, + CBOR_INF_ARRAY_END }; + + uint8_t shmem_tx[CONFIG_SSF_SRVC2_SERVICE_BUFFER_SIZE]; + uint8_t *shmem_tx_ptr = &shmem_tx[0]; + + __cmock_ssf_client_transport_alloc_tx_buf_ExpectAndReturn( + NULL, CONFIG_SSF_SRVC2_SERVICE_BUFFER_SIZE, 0); + __cmock_ssf_client_transport_alloc_tx_buf_IgnoreArg_buf(); + __cmock_ssf_client_transport_alloc_tx_buf_ReturnThruPtr_buf(&shmem_tx_ptr); + + req_hdr_expected = hdr_expected; + req_hdr_len_expected = sizeof(hdr_expected); + srvc2_req_expected = req_data; + srvc2_req_len_expected = sizeof(req_data); + __cmock_ssf_client_transport_request_send_AddCallback(stub_srvc2_transport_request_send); + + const uint8_t shmem_rx[] = { + CBOR_INF_ARRAY_START, 0x00, CBOR_INF_ARRAY_END, 0xEF, 0xBE, 0x00, 0x00 + }; + const uint8_t *shmem_rx_ptr = &shmem_rx[0]; + size_t shmem_rx_len = sizeof(shmem_rx); + + __cmock_ssf_client_transport_request_send_ExpectAndReturn( + shmem_tx_ptr, sizeof(hdr_expected) + sizeof(req_data), NULL, NULL, 0); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt(); + __cmock_ssf_client_transport_request_send_IgnoreArg_rsp_pkt_len(); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt(&shmem_rx_ptr); + __cmock_ssf_client_transport_request_send_ReturnThruPtr_rsp_pkt_len(&shmem_rx_len); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx_ptr); + + int err = ssf_client_send_raw_request(&srvc2, req, &rsp); + + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL_UINT8_ARRAY(rsp_data_expected, rsp.data, rsp.len); +} + +void test_client_send_raw_request_srvc_null(void) +{ + uint8_t req_data[] = { 0xCE, 0xCA, 0x00, 0x00 }; + uint8_t rsp_data[sizeof(req_data)]; + struct ssf_client_raw_data req = { .data = req_data, .len = sizeof(req_data) }; + struct ssf_client_raw_data rsp = { .data = rsp_data, .len = sizeof(rsp_data) }; + + int err = ssf_client_send_raw_request(NULL, req, &rsp); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_send_raw_request_rsp_null(void) +{ + uint8_t req_data[] = { 0xCE, 0xCA, 0x00, 0x00 }; + struct ssf_client_raw_data req = { .data = req_data, .len = sizeof(req_data) }; + + int err = ssf_client_send_raw_request(&srvc2, req, NULL); + + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_decode_done_success(void) +{ + const uint8_t rsp_pkt[] = { 0xFF }; + + __cmock_ssf_client_transport_decoding_done_Expect(rsp_pkt); + + ssf_client_decode_done(rsp_pkt); +} + +extern int unity_main(void); + +int main(void) +{ + (void)unity_main(); + + return 0; +} diff --git a/tests/subsys/sdfw_services/client/testcase.yaml b/tests/subsys/sdfw_services/client/testcase.yaml new file mode 100644 index 000000000000..93a37d2df70a --- /dev/null +++ b/tests/subsys/sdfw_services/client/testcase.yaml @@ -0,0 +1,6 @@ +tests: + ssf.client: + platform_allow: native_posix + integration_platforms: + - native_posix + tags: ssf diff --git a/tests/subsys/sdfw_services/client_notif/CMakeLists.txt b/tests/subsys/sdfw_services/client_notif/CMakeLists.txt new file mode 100644 index 000000000000..0423cdae902f --- /dev/null +++ b/tests/subsys/sdfw_services/client_notif/CMakeLists.txt @@ -0,0 +1,42 @@ +# +# 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(ssf_client_notif_test) + +set(SSF_DIR ${ZEPHYR_NRF_MODULE_DIR}/subsys/sdfw_services) + +# generate runner for the test +test_runner_generate(src/ssf_client_notif_test.c) + +# create mocks +cmock_handle(${SSF_DIR}/transport/include/ssf_client_transport.h) + +# add test file +target_sources(app PRIVATE src/ssf_client_notif_test.c) + +# add file under test +target_sources(app + PRIVATE + ${SSF_DIR}/ssf_client.c + ${SSF_DIR}/ssf_client_notif.c + ${SSF_DIR}/os/ssf_client_zephyr.c +) + +target_include_directories(app + PRIVATE + ${SSF_DIR}/os +) + +target_compile_options(app + PRIVATE + -DCONFIG_SSF_CLIENT_DOMAIN_ID=2 + -DCONFIG_SSF_CLIENT_LOG_LEVEL=2 + -DCONFIG_SSF_CLIENT_REGISTERED_LISTENERS_MAX=2 + -DCONFIG_SSF_CLIENT_ZCBOR_MAX_BACKUPS=1 +) diff --git a/tests/subsys/sdfw_services/client_notif/Kconfig b/tests/subsys/sdfw_services/client_notif/Kconfig new file mode 100644 index 000000000000..2cb445215094 --- /dev/null +++ b/tests/subsys/sdfw_services/client_notif/Kconfig @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" diff --git a/tests/subsys/sdfw_services/client_notif/prj.conf b/tests/subsys/sdfw_services/client_notif/prj.conf new file mode 100644 index 000000000000..288f549d2a1f --- /dev/null +++ b/tests/subsys/sdfw_services/client_notif/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_UNITY=y + +CONFIG_HEAP_MEM_POOL_SIZE=2048 + +CONFIG_ZCBOR=y diff --git a/tests/subsys/sdfw_services/client_notif/src/ssf_client_notif_test.c b/tests/subsys/sdfw_services/client_notif/src/ssf_client_notif_test.c new file mode 100644 index 000000000000..cbdc14dde8c6 --- /dev/null +++ b/tests/subsys/sdfw_services/client_notif/src/ssf_client_notif_test.c @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "cmock_ssf_client_transport.h" + +#define CBOR_INF_ARRAY_START 0x9F +#define CBOR_INF_ARRAY_END 0xFF + +static ssf_client_transport_notif_handler notification_handler; +static struct ssf_notification notif1_expected; +static int notif1_return_val; +static int notif1_context = 0x15; +static int notif2_context = 0x25; +static int notif3_context = 0x35; + +static int stub_client_transport_init(ssf_client_transport_notif_handler notif_handler, + int cmock_num_calls) +{ + ARG_UNUSED(cmock_num_calls); + + notification_handler = notif_handler; + return 0; +} + +static int notif1_decode(const uint8_t *payload, size_t payload_len, void *result, + size_t *payload_len_out) +{ + ARG_UNUSED(payload_len_out); + + if (payload_len != 4) { + return ZCBOR_ERR_NO_PAYLOAD; + } + + memcpy(result, payload, payload_len); + return 0; +} + +static int notif1_handler(struct ssf_notification *notif, void *context) +{ + TEST_ASSERT_EQUAL_PTR(notif1_expected.data, notif->data); + TEST_ASSERT_EQUAL(notif1_expected.data_len, notif->data_len); + TEST_ASSERT_EQUAL_PTR(notif1_expected.pkt, notif->pkt); + TEST_ASSERT_EQUAL_PTR(notif1_expected.notif_decode, notif->notif_decode); + TEST_ASSERT_EQUAL(notif1_context, *(int *)context); + return notif1_return_val; +} + +static int notif_common_decode(const uint8_t *payload, size_t payload_len, void *result, + size_t *payload_len_out) +{ + ARG_UNUSED(payload); + ARG_UNUSED(payload_len); + ARG_UNUSED(result); + ARG_UNUSED(payload_len_out); + + return ZCBOR_ERR_NO_PAYLOAD; +} + +static int notif_common_handler(struct ssf_notification *notif, void *context) +{ + ARG_UNUSED(context); + + ssf_client_transport_decoding_done(notif->pkt); + return -SSF_EFAULT; +} + +#define CONFIG_SSF_SRVC1_SERVICE_ID 0x01 +#define CONFIG_SSF_SRVC1_SERVICE_VERSION 1 +SSF_CLIENT_NOTIF_LISTENER_DEFINE(notif1, SRVC1, notif1_decode, notif1_handler); + +#define CONFIG_SSF_SRVC2_SERVICE_ID 0x04 +#define CONFIG_SSF_SRVC2_SERVICE_VERSION 2 +SSF_CLIENT_NOTIF_LISTENER_DEFINE(notif2, SRVC2, notif_common_decode, notif_common_handler); + +#define CONFIG_SSF_SRVC3_SERVICE_ID 0x07 +#define CONFIG_SSF_SRVC3_SERVICE_VERSION 3 +SSF_CLIENT_NOTIF_LISTENER_DEFINE(notif3, SRVC3, notif_common_decode, notif_common_handler); + +#define CONFIG_SSF_SRVC4_SERVICE_ID 0x0A +#define CONFIG_SSF_SRVC4_SERVICE_VERSION 4 +SSF_CLIENT_NOTIF_LISTENER_DEFINE(notif4, SRVC4, notif_common_decode, notif_common_handler); + +#define CONFIG_SSF_SRVC5_SERVICE_ID 0x0D +#define CONFIG_SSF_SRVC5_SERVICE_VERSION 5 +SSF_CLIENT_NOTIF_LISTENER_DEFINE(notif5, SRVC5, NULL, notif_common_handler); + +void setUp(void) +{ + int ssf_client_notif_init(void); + + int err = ssf_client_notif_init(); + + TEST_ASSERT_EQUAL(err, 0); +} + +void test_client_notif_register_unregister_success(void) +{ + int err; + + /* Check that listener 1 and 2 are unregistered */ + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + TEST_ASSERT_EQUAL(false, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif2.context); + + /* Register listener 1 and 2 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + err = ssf_client_notif_register(¬if2, (void *)¬if2_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if2_context, notif2.context); + + /* Deregister listener 1 and 2 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + + err = ssf_client_notif_deregister(¬if2); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif2.context); +} + +void test_client_notif_register_max_listeners_registered(void) +{ + int err; + + /* Check that listener 1, 2 and 3 are unregistered */ + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + TEST_ASSERT_EQUAL(false, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif2.context); + TEST_ASSERT_EQUAL(false, notif3.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif3.context); + + /* Register listener 1 and 2 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + err = ssf_client_notif_register(¬if2, (void *)¬if2_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if2_context, notif2.context); + + /* Registering listener 3 is expected to fail since SSF_CLIENT_REGISTERED_LISTENERS_MAX=2 */ + err = ssf_client_notif_register(¬if3, (void *)¬if3_context); + TEST_ASSERT_EQUAL(-SSF_ENOBUFS, err); + TEST_ASSERT_EQUAL(false, notif3.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif3.context); + + /* Deregister listener 1 and 2 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + + err = ssf_client_notif_deregister(¬if2); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif2.context); +} + +void test_client_notif_register_params_invalid(void) +{ + int err; + + /* Unspecified listener */ + err = ssf_client_notif_register(NULL, NULL); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); + + /* Listener with missing handler */ + notif4.handler = NULL; + err = ssf_client_notif_register(¬if4, NULL); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); + notif4.handler = notif_common_handler; + + /* Listener with missing decoder */ + err = ssf_client_notif_register(¬if5, NULL); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_notif_register_already_registered(void) +{ + int err; + + /* Check that listener 1 is unregistered */ + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Attempt to register listener 1 again. Expect it to fail. */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(-SSF_EALREADY, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); +} + +void test_client_notif_deregister_params_invalid(void) +{ + int err; + + /* Check that listener 1 is unregistered */ + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Expect deregistering with NULL to fail */ + err = ssf_client_notif_deregister(NULL); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); +} + +void test_client_notif_deregister_not_already_registered(void) +{ + int err; + + /* Check that listener 1 is unregistered */ + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Attempt to deregister listener 2. Expect it to fail. */ + err = ssf_client_notif_deregister(¬if2); + TEST_ASSERT_EQUAL(-SSF_ENXIO, err); + TEST_ASSERT_EQUAL(false, notif2.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif2.context); + TEST_ASSERT_EQUAL(true, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR((void *)¬if1_context, notif1.context); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(false, notif1.is_registered); + TEST_ASSERT_EQUAL_PTR(NULL, notif1.context); +} + +void test_client_notif_decode_success(void) +{ + int err; + + const uint8_t data[] = { 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA }; + const struct ssf_notification notif = { .data = &data[2], + .data_len = sizeof(data) - 2, + .pkt = data, + .notif_decode = notif1.notif_decode }; + int decoded_notif; + const int decoded_notif_expected = 0xAABBCCDD; + + err = ssf_client_notif_decode(¬if, &decoded_notif); + TEST_ASSERT_EQUAL(0, err); + TEST_ASSERT_EQUAL(decoded_notif_expected, decoded_notif); +} + +void test_client_notif_decode_params_invalid(void) +{ + int err; + + const uint8_t data[] = { 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA }; + const struct ssf_notification notif = { .data = &data[2], + .data_len = sizeof(data) - 2, + .pkt = data, + .notif_decode = notif1.notif_decode }; + int decoded_notif; + + err = ssf_client_notif_decode(NULL, &decoded_notif); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); + + err = ssf_client_notif_decode(¬if, NULL); + TEST_ASSERT_EQUAL(-SSF_EINVAL, err); +} + +void test_client_notif_decode_func_error(void) +{ + int err; + + const uint8_t data[] = { 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA }; + const struct ssf_notification notif = { .data = &data[2], + .data_len = sizeof(data) - 2, + .pkt = data, + .notif_decode = notif2.notif_decode }; + int decoded_notif; + + err = ssf_client_notif_decode(¬if, &decoded_notif); + TEST_ASSERT_EQUAL(-SSF_EPROTO, err); +} + +void test_client_notif_decode_done_success(void) +{ + const uint8_t data[] = { 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA }; + struct ssf_notification notif = { .data = &data[2], + .data_len = sizeof(data) - 2, + .pkt = data, + .notif_decode = notif1.notif_decode }; + + __cmock_ssf_client_transport_decoding_done_Expect(data); + + ssf_client_notif_decode_done(¬if); +} + +void test_client_notif_decode_done_param_invalid(void) +{ + struct ssf_notification notif = { + .data = NULL, .data_len = 0, .pkt = NULL, .notif_decode = notif1.notif_decode + }; + + ssf_client_notif_decode_done(NULL); + + ssf_client_notif_decode_done(¬if); +} + +void test_client_notif_receive_success(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_START, + CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + size_t hdr_len = 4; + + notif1_expected.data = &shmem_rx[hdr_len]; + notif1_expected.data_len = sizeof(shmem_rx) - hdr_len; + notif1_expected.pkt = shmem_rx; + notif1_expected.notif_decode = notif1.notif_decode; + notif1_return_val = 0; + + /* Function under test */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_notif_receive_decode_hdr_error(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_END, + CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + notif1_expected.data = NULL; + notif1_expected.data_len = 0; + notif1_expected.pkt = NULL; + notif1_expected.notif_decode = NULL; + notif1_return_val = -SSF_EFAULT; + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* Function under test */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_notif_receive_listener_not_registered(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_START, + CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + notif1_expected.data = NULL; + notif1_expected.data_len = 0; + notif1_expected.pkt = NULL; + notif1_expected.notif_decode = NULL; + notif1_return_val = -SSF_EFAULT; + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* + * Function under test. Expect listener to not be found and handler not be invoked. + * Expect call to decoding_done. + */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Register listener 2. Expect this listener to not receive the notification. */ + err = ssf_client_notif_register(¬if2, (void *)¬if2_context); + TEST_ASSERT_EQUAL(0, err); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* + * Function under test. With another listener registered, expect listener + * to not be found and handler not be invoked. Expect call to decoding_done. + */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Deregister listener 2 */ + err = ssf_client_notif_deregister(¬if2); + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_notif_receive_handler_missing(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Register listener 4. Remove handler after successfully registering the listener. */ + err = ssf_client_notif_register(¬if4, NULL); + TEST_ASSERT_EQUAL(0, err); + notif4.handler = NULL; + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_START, + CONFIG_SSF_SRVC4_SERVICE_ID, + CONFIG_SSF_SRVC4_SERVICE_VERSION, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* + * Function under test. Expect it to fail because handler is missing + * for listener 4. Expect call to decoding_done. + */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Restore handler, then deregister listener 4 */ + notif4.handler = notif_common_handler; + err = ssf_client_notif_deregister(¬if4); + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_notif_receive_version_mismatch(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_START, + CONFIG_SSF_SRVC1_SERVICE_ID, + CONFIG_SSF_SRVC1_SERVICE_VERSION + 1, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + notif1_expected.data = NULL; + notif1_expected.data_len = 0; + notif1_expected.pkt = NULL; + notif1_expected.notif_decode = NULL; + notif1_return_val = -SSF_EFAULT; + + /* Register listener 1 */ + err = ssf_client_notif_register(¬if1, (void *)¬if1_context); + TEST_ASSERT_EQUAL(0, err); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* + * Function under test. Expect version number in incoming packet to + * not be equal to the version number for the listener. + */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Deregister listener 1 */ + err = ssf_client_notif_deregister(¬if1); + TEST_ASSERT_EQUAL(0, err); +} + +void test_client_notif_receive_listener_handler_error(void) +{ + int err; + + /* Get "notif receive" handler to be able to invoke it later. */ + __cmock_ssf_client_transport_init_Stub(stub_client_transport_init); + ssf_client_init(); + TEST_ASSERT_NOT_NULL(notification_handler); + + /* Define incoming package */ + const uint8_t shmem_rx[] = { CBOR_INF_ARRAY_START, + CONFIG_SSF_SRVC3_SERVICE_ID, + CONFIG_SSF_SRVC3_SERVICE_VERSION, + CBOR_INF_ARRAY_END, + 0xCE, + 0xCA }; + + /* Register listener 3 */ + err = ssf_client_notif_register(¬if3, NULL); + TEST_ASSERT_EQUAL(0, err); + + __cmock_ssf_client_transport_decoding_done_Expect(shmem_rx); + + /* + * Function under test. Expect version number in incoming packet to + * not be equal to the version number for the listener. + */ + notification_handler(shmem_rx, sizeof(shmem_rx)); + + /* Deregister listener 3 */ + err = ssf_client_notif_deregister(¬if3); + TEST_ASSERT_EQUAL(0, err); +} + +extern int unity_main(void); + +int main(void) +{ + (void)unity_main(); + + return 0; +} diff --git a/tests/subsys/sdfw_services/client_notif/testcase.yaml b/tests/subsys/sdfw_services/client_notif/testcase.yaml new file mode 100644 index 000000000000..78f4ebdd0149 --- /dev/null +++ b/tests/subsys/sdfw_services/client_notif/testcase.yaml @@ -0,0 +1,6 @@ +tests: + ssf.client_notif: + platform_allow: native_posix + integration_platforms: + - native_posix + tags: ssf diff --git a/tests/subsys/suit/cache/CMakeLists.txt b/tests/subsys/suit/cache/CMakeLists.txt new file mode 100644 index 000000000000..bd920eef2a1b --- /dev/null +++ b/tests/subsys/suit/cache/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 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(integration_test_suit_cache) +include(../cmake/test_template.cmake) diff --git a/tests/subsys/suit/cache/prj.conf b/tests/subsys/suit/cache/prj.conf new file mode 100644 index 000000000000..cd44135617d7 --- /dev/null +++ b/tests/subsys/suit/cache/prj.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/cache/src/main.c b/tests/subsys/suit/cache/src/main.c new file mode 100644 index 000000000000..026fbbd51873 --- /dev/null +++ b/tests/subsys/suit/cache/src/main.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/* + * { + * "http://source1.com": h'4235623423462346456234623487723572702975', + * "http://source2.com.no": h'25672519384710', + * "ftp://altsource.com": h'92384859284720' + * } + */ +static const uint8_t cache[] = { + 0xBF, 0x72, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, + 0x31, 0x2E, 0x63, 0x6F, 0x6D, 0x54, 0x42, 0x35, 0x62, 0x34, 0x23, 0x46, 0x23, 0x46, 0x45, + 0x62, 0x34, 0x62, 0x34, 0x87, 0x72, 0x35, 0x72, 0x70, 0x29, 0x75, 0x75, 0x68, 0x74, 0x74, + 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x32, 0x2E, 0x63, 0x6F, 0x6D, + 0x2E, 0x6E, 0x6F, 0x47, 0x25, 0x67, 0x25, 0x19, 0x38, 0x47, 0x10, 0x73, 0x66, 0x74, 0x70, + 0x3A, 0x2F, 0x2F, 0x61, 0x6C, 0x74, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x2E, 0x63, 0x6F, + 0x6D, 0x47, 0x92, 0x38, 0x48, 0x59, 0x28, 0x47, 0x20, 0xFF}; +static const size_t cache_len = sizeof(cache); + +/* + * { + * "http://databucket.com": h'4360021135853785764409444542662512368400086117', + * "http://storagehole.com": h'053714514299994946548928821768209760220451452304', + * "#file.bin": h'12358902317049812091623890476012378490701892365192830986701923' + * } + */ +static const uint8_t cache2[] = { + 0xBF, 0x75, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x75, 0x63, 0x6B, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x57, 0x43, 0x60, 0x02, 0x11, + 0x35, 0x85, 0x37, 0x85, 0x76, 0x44, 0x09, 0x44, 0x45, 0x42, 0x66, 0x25, 0x12, 0x36, + 0x84, 0x00, 0x08, 0x61, 0x17, 0x76, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, + 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65, 0x68, 0x6F, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, + 0x58, 0x18, 0x05, 0x37, 0x14, 0x51, 0x42, 0x99, 0x99, 0x49, 0x46, 0x54, 0x89, 0x28, + 0x82, 0x17, 0x68, 0x20, 0x97, 0x60, 0x22, 0x04, 0x51, 0x45, 0x23, 0x04, 0x69, 0x23, + 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x58, 0x1F, 0x12, 0x35, 0x89, 0x02, + 0x31, 0x70, 0x49, 0x81, 0x20, 0x91, 0x62, 0x38, 0x90, 0x47, 0x60, 0x12, 0x37, 0x84, + 0x90, 0x70, 0x18, 0x92, 0x36, 0x51, 0x92, 0x83, 0x09, 0x86, 0x70, 0x19, 0x23, 0xFF}; +static const size_t cache2_len = sizeof(cache2); + +static void test_suite_before(void *f) +{ + struct dfu_cache dfu_caches; + + zassert_between_inclusive(2, 1, CONFIG_SUIT_CACHE_MAX_CACHES, + "Failed to prepare test fixture: cache istoo small"); + + dfu_caches.pools[0].address = (uint8_t *)cache; + dfu_caches.pools[0].size = (size_t)cache_len; + + dfu_caches.pools[1].address = (uint8_t *)cache2; + dfu_caches.pools[1].size = (size_t)cache2_len; + dfu_caches.pools_count = 2; + + suit_plat_err_t rc = suit_dfu_cache_initialize(&dfu_caches); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Failed to initialize cache: %i", rc); +} + +static void test_suite_after(void *f) +{ + suit_dfu_cache_deinitialize(); +} + +ZTEST_SUITE(cache_tests, NULL, NULL, test_suite_before, test_suite_after, NULL); + +ZTEST(cache_tests, test_suit_dfu_cache_search_ok) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://databucket.com"; + size_t uri_size = sizeof("http://databucket.com"); + + int ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_hash_ok) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "#file.bin"; + size_t uri_size = sizeof("#file.bin"); + + int ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_nok) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t nok_uri[] = "http://data123.com"; + size_t uri_size = sizeof("http://data123.com"); + + int ret = suit_dfu_cache_search(nok_uri, uri_size, &payload, &payload_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache should have failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_nok_uri_null) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + + int ret = suit_dfu_cache_search(NULL, 10, &payload, &payload_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache should have failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_nok_uri_size_zero) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "#file.bin"; + size_t uri_size = 0; + + int ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache should have failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_key_is_substring) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://databucket.com/subdir/"; + size_t uri_size = sizeof("http://databucket.com/subdir/"); + + int ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache should have failed"); +} + +ZTEST(cache_tests, test_suit_dfu_cache_search_empty) +{ + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://databucket.com"; + size_t uri_size = sizeof("http://databucket.com"); + + suit_dfu_cache_deinitialize(); + + int ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache should have failed"); +} diff --git a/tests/subsys/suit/cache/testcase.yaml b/tests/subsys/suit/cache/testcase.yaml new file mode 100644 index 000000000000..cfd56231b4d7 --- /dev/null +++ b/tests/subsys/suit/cache/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.suit_cache: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit suit_cache + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/cache_fetch/CMakeLists.txt b/tests/subsys/suit/cache_fetch/CMakeLists.txt new file mode 100644 index 000000000000..f95dd64709c6 --- /dev/null +++ b/tests/subsys/suit/cache_fetch/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_cache_streamer) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_stream_sources_interface) diff --git a/tests/subsys/suit/cache_fetch/prj.conf b/tests/subsys/suit/cache_fetch/prj.conf new file mode 100644 index 000000000000..fe5ef895c083 --- /dev/null +++ b/tests/subsys/suit/cache_fetch/prj.conf @@ -0,0 +1,24 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/cache_fetch/src/main.c b/tests/subsys/suit/cache_fetch/src/main.c new file mode 100644 index 000000000000..ceed7dc45091 --- /dev/null +++ b/tests/subsys/suit/cache_fetch/src/main.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +/* + * { + * "http://source1.com": h'4235623423462346456234623487723572702975', + * "http://source2.com.no": h'25672519384710', + * "ftp://altsource.com": h'92384859284720' + * } + */ +static const uint8_t cache[] = { + 0xBF, 0x72, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, + 0x31, 0x2E, 0x63, 0x6F, 0x6D, 0x54, 0x42, 0x35, 0x62, 0x34, 0x23, 0x46, 0x23, 0x46, 0x45, + 0x62, 0x34, 0x62, 0x34, 0x87, 0x72, 0x35, 0x72, 0x70, 0x29, 0x75, 0x75, 0x68, 0x74, 0x74, + 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x32, 0x2E, 0x63, 0x6F, 0x6D, + 0x2E, 0x6E, 0x6F, 0x47, 0x25, 0x67, 0x25, 0x19, 0x38, 0x47, 0x10, 0x73, 0x66, 0x74, 0x70, + 0x3A, 0x2F, 0x2F, 0x61, 0x6C, 0x74, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x2E, 0x63, 0x6F, + 0x6D, 0x47, 0x92, 0x38, 0x48, 0x59, 0x28, 0x47, 0x20, 0xFF}; +static const size_t cache_len = sizeof(cache); + +/* + * { + * "http://databucket.com": h'4360021135853785764409444542662512368400086117', + * "http://storagehole.com": h'053714514299994946548928821768209760220451452304', + * "#file.bin": h'12358902317049812091623890476012378490701892365192830986701923' + * } + */ +static const uint8_t cache2[] = { + 0xA3, 0x75, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x75, 0x63, 0x6B, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x57, 0x43, 0x60, 0x02, 0x11, + 0x35, 0x85, 0x37, 0x85, 0x76, 0x44, 0x09, 0x44, 0x45, 0x42, 0x66, 0x25, 0x12, 0x36, + 0x84, 0x00, 0x08, 0x61, 0x17, 0x76, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, + 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65, 0x68, 0x6F, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, + 0x58, 0x18, 0x05, 0x37, 0x14, 0x51, 0x42, 0x99, 0x99, 0x49, 0x46, 0x54, 0x89, 0x28, + 0x82, 0x17, 0x68, 0x20, 0x97, 0x60, 0x22, 0x04, 0x51, 0x45, 0x23, 0x04, 0x69, 0x23, + 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x58, 0x1F, 0x12, 0x35, 0x89, 0x02, + 0x31, 0x70, 0x49, 0x81, 0x20, 0x91, 0x62, 0x38, 0x90, 0x47, 0x60, 0x12, 0x37, 0x84, + 0x90, 0x70, 0x18, 0x92, 0x36, 0x51, 0x92, 0x83, 0x09, 0x86, 0x70, 0x19, 0x23}; +static const size_t cache2_len = sizeof(cache2); + +static void test_suite_before(void *f) +{ + struct dfu_cache dfu_caches; + + zassert_between_inclusive(2, 1, CONFIG_SUIT_CACHE_MAX_CACHES, + "Failed to prepare test fixture: cache istoo small"); + + dfu_caches.pools[0].address = (uint8_t *)cache; + dfu_caches.pools[0].size = (size_t)cache_len; + + dfu_caches.pools[1].address = (uint8_t *)cache2; + dfu_caches.pools[1].size = (size_t)cache2_len; + dfu_caches.pools_count = 2; + + int rc = suit_dfu_cache_initialize(&dfu_caches); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Failed to initialize cache: %i", rc); +} + +static void test_suite_after(void *f) +{ + suit_dfu_cache_deinitialize(); +} + +ZTEST_SUITE(cache_streamer_tests, NULL, NULL, test_suite_before, test_suite_after, NULL); + +ZTEST(cache_streamer_tests, test_cache_streamer_ok) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + const uint8_t ok_uri[] = "http://databucket.com"; + size_t ok_uri_len = sizeof("http://databucket.com"); + const uint8_t *payload_ptr; + size_t payload_size = 0; + + int ret = suit_memptr_storage_get(&handle); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", ret); + + ret = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", ret); + + ret = suit_dfu_cache_streamer_stream(ok_uri, ok_uri_len, &memptr_sink); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_dfu_cache_streamer_stream failed - error %i", + ret); + + ret = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage.get failed - error %i", ret); + + ret = suit_memptr_storage_release(handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", ret); +} + +ZTEST(cache_streamer_tests, test_cache_streamer_nok) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + char ok_uri[] = "http://databucket.com"; + size_t ok_uri_len = sizeof("http://databucket.com"); + char nok_uri[] = "http://data123.com"; + size_t nok_uri_len = sizeof("http://data123.com"); + + int ret = suit_memptr_storage_get(&handle); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", ret); + + ret = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", ret); + + ret = suit_dfu_cache_streamer_stream(NULL, ok_uri_len, &memptr_sink); + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, + "suit_dfu_cache_streamer_stream should have failed - uri == NULL"); + + ret = suit_dfu_cache_streamer_stream(ok_uri, 0, &memptr_sink); + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, + "suit_dfu_cache_streamer_stream should have failed - uri_len == 0"); + + ret = suit_dfu_cache_streamer_stream(ok_uri, ok_uri_len, NULL); + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, + "suit_dfu_cache_streamer_stream should have failed - sink == NULL"); + + ret = suit_dfu_cache_streamer_stream(nok_uri, nok_uri_len, &memptr_sink); + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, + "suit_dfu_cache_streamer_stream failed - error %i", ret); + + ret = suit_memptr_storage_release(handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", ret); +} diff --git a/tests/subsys/suit/cache_fetch/testcase.yaml b/tests/subsys/suit/cache_fetch/testcase.yaml new file mode 100644 index 000000000000..aa1bef5d7a2b --- /dev/null +++ b/tests/subsys/suit/cache_fetch/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.cache_streamer: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_cache suit_stream + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/cache_pool_digest/CMakeLists.txt b/tests/subsys/suit/cache_pool_digest/CMakeLists.txt new file mode 100644 index 000000000000..37944ba861cc --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/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}) + +project(integration_test_cache_pool_digest) +include(../cmake/test_template.cmake) + + +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_execution_mode) +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/tests/subsys/suit/cache_pool_digest/boards/native_posix.conf b/tests/subsys/suit/cache_pool_digest/boards/native_posix.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/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/cache_pool_digest/boards/native_posix.overlay b/tests/subsys/suit/cache_pool_digest/boards/native_posix.overlay new file mode 100644 index 000000000000..653a331bc970 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * 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@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/cache_pool_digest/boards/native_posix_64.conf b/tests/subsys/suit/cache_pool_digest/boards/native_posix_64.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/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/cache_pool_digest/boards/native_posix_64.overlay b/tests/subsys/suit/cache_pool_digest/boards/native_posix_64.overlay new file mode 100644 index 000000000000..653a331bc970 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/boards/native_posix_64.overlay @@ -0,0 +1,32 @@ +/* + * 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@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..7de29844c000 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +#Logging and printk is using standard UART. +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=8192 +CONFIG_SUIT_CACHEX_ERASE_BLOCK_SIZE=128 diff --git a/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..09b3df8fe8ec --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,47 @@ +/* + * 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"; + }; +}; + +&mram1x { + erase-block-size = < 0x10 >; + /* Hardcoded inside the soc_flash_nrf_mram.c (MRAM_WORD_SIZE) */ + write-block-size = < 0x10 >; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@19d000 { + reg = < 0x19d000 DT_SIZE_K(1) >; + }; + + dfu_cache_partition_1: partition@19d400 { + reg = <0x19d400 DT_SIZE_K(1)>; + }; + + dfu_cache_partition_3: partition@19d800 { + reg = <0x19d800 DT_SIZE_K(1)>; + }; + + __mpc_override_align: partition@19dc00 { + reg = <0x19dc00 DT_SIZE_K(1)>; + }; + }; +}; diff --git a/tests/subsys/suit/cache_pool_digest/prj.conf b/tests/subsys/suit/cache_pool_digest/prj.conf new file mode 100644 index 000000000000..105c4182d3fb --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/prj.conf @@ -0,0 +1,41 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT_PLATFORM_VARIANT_APP=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_CACHE_RW=y +CONFIG_SUIT_STREAM_SINK_CACHE=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y + +CONFIG_SUIT_EXECUTION_MODE=y + +CONFIG_SUIT_MCI=y +CONFIG_SUIT_METADATA=y + +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y diff --git a/tests/subsys/suit/cache_pool_digest/src/main.c b/tests/subsys/suit/cache_pool_digest/src/main.c new file mode 100644 index 000000000000..a35b970d9905 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/src/main.c @@ -0,0 +1,141 @@ +/* + * 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_FFF_GLOBALS; + +static uint8_t uri[] = "http://databucket.com"; +static uint8_t data[] = {0x43, 0x60, 0x02, 0x11, 0x35, 0x85, 0x37, 0x85, 0x76, + 0x44, 0x09, 0xDE, 0xAD, 0x44, 0x45, 0x42, 0x66, 0x25, + 0x12, 0x36, 0x84, 0x00, 0x08, 0x61, 0x17}; +static uint8_t valid_digest[] = {0x0c, 0xfd, 0xd2, 0x46, 0xb1, 0x84, 0x77, 0x9e, 0xc0, 0xb5, 0x0b, + 0xca, 0xf1, 0xea, 0x0d, 0xaf, 0x2b, 0x18, 0xa5, 0xbe, 0x5b, 0x61, + 0x24, 0xc2, 0x65, 0x1c, 0xa9, 0xd7, 0x29, 0x96, 0x37, 0xa8}; +static struct zcbor_string exp_digest = { + .value = valid_digest, + .len = sizeof(valid_digest), +}; + +static uint8_t invalid_digest[] = { + 0x0c, 0xfd, 0xd2, 0x46, 0xb1, 0x84, 0x77, 0x9e, 0xc0, 0xb5, 0x0b, + 0xca, 0xf1, 0xea, 0x0d, 0xaf, 0x2b, 0x18, 0xa5, 0xbe, 0x5b, 0x61, + 0x24, 0xc2, 0x65, 0x1c, 0xa9, 0xd7, 0x29, 0x96, 0x37, 0xa7}; /* Last byte changed */ +static struct zcbor_string unexp_digest = { + .value = invalid_digest, + .len = sizeof(invalid_digest), +}; + +/* Mocks of functions provided via SSF services */ +FAKE_VALUE_FUNC(int, suit_plat_component_compatibility_check, suit_manifest_class_id_t *, + struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authorize_sequence_num, enum suit_command_sequence, + struct zcbor_string *, unsigned int); +FAKE_VALUE_FUNC(int, suit_plat_authorize_unsigned_manifest, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authenticate_manifest, struct zcbor_string *, enum suit_cose_alg, + struct zcbor_string *, struct zcbor_string *, struct zcbor_string *); + +void setup_dfu_test_cache(void *f) +{ + int ret = suit_dfu_cache_rw_initialize(NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to initialize cache: %i", ret); +} + +void clear_dfu_test_partitions(void *f) +{ + /* Erase the area, to meet the preconditions in the next test. */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase area"); + + int rc = flash_erase(fdev, FIXED_PARTITION_OFFSET(dfu_cache_partition_1), + FIXED_PARTITION_SIZE(dfu_cache_partition_1)); + + zassert_equal(rc, 0, "Unable to erase dfu__cache_partition_1 before test execution: %i", + rc); + + rc = flash_erase(fdev, FIXED_PARTITION_OFFSET(dfu_cache_partition_3), + FIXED_PARTITION_SIZE(dfu_cache_partition_3)); + zassert_equal(rc, 0, "Unable to erase dfu_cache_partition_3 before test execution: %i", rc); + + suit_dfu_cache_rw_deinitialize(); +} + +ZTEST_SUITE(cache_pool_digest_tests, NULL, NULL, setup_dfu_test_cache, clear_dfu_test_partitions, + NULL); + +ZTEST(cache_pool_digest_tests, test_cache_get_slot_ok) +{ + struct stream_sink sink; + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri, sizeof(uri), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data, sizeof(data)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://databucket.com"; + size_t uri_size = sizeof("http://databucket.com"); + + ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed: %i", ret); + zassert_equal(payload_size, sizeof(data), + "Invalid data size for retrieved payload. payload(%u) data(%u)", payload_size, + sizeof(data)); + + /* Valid id value for cand_img component */ + static uint8_t valid_cand_img_component_id_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x00}; + /* Valid cand_img component id */ + struct zcbor_string valid_cand_img_component_id = { + .value = valid_cand_img_component_id_value, + .len = sizeof(valid_cand_img_component_id_value), + }; + + suit_component_t dst_component; + + ret = suit_plat_create_component_handle(&valid_cand_img_component_id, &dst_component); + zassert_equal(SUIT_SUCCESS, ret, "test error - create_component_handle failed: %d", ret); + + struct zcbor_string src_uri = { + .value = uri, + .len = sizeof(uri), + }; + + ret = suit_plat_fetch(dst_component, &src_uri); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_check_image_match(dst_component, suit_cose_sha256, &exp_digest); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_check_image_match failed - error %i", ret); + + ret = suit_plat_check_image_match(dst_component, suit_cose_sha256, &unexp_digest); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_check_image_match should have failed - digest invalid"); + + ret = suit_plat_release_component_handle(dst_component); + zassert_equal(SUIT_SUCCESS, ret, "test error - failed to cleanup component handle: %d", + ret); +}; diff --git a/tests/subsys/suit/cache_pool_digest/testcase.yaml b/tests/subsys/suit/cache_pool_digest/testcase.yaml new file mode 100644 index 000000000000..e6d1dec8e9d4 --- /dev/null +++ b/tests/subsys/suit/cache_pool_digest/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-platform.integration.cache_pool_digest: + platform_allow: nrf54h20dk/nrf54h20/cpuapp native_posix native_posix/native/64 + tags: suit suit_cache digest + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/cache_sink/CMakeLists.txt b/tests/subsys/suit/cache_sink/CMakeLists.txt new file mode 100644 index 000000000000..dcf21ff0c8e7 --- /dev/null +++ b/tests/subsys/suit/cache_sink/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_cache_fetch) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_utils) diff --git a/tests/subsys/suit/cache_sink/boards/native_posix.conf b/tests/subsys/suit/cache_sink/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/cache_sink/boards/native_posix.overlay b/tests/subsys/suit/cache_sink/boards/native_posix.overlay new file mode 100644 index 000000000000..1d27121b77eb --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/cache_sink/boards/native_posix_64.conf b/tests/subsys/suit/cache_sink/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/cache_sink/boards/native_posix_64.overlay b/tests/subsys/suit/cache_sink/boards/native_posix_64.overlay new file mode 100644 index 000000000000..1d27121b77eb --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/native_posix_64.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..66ed3f4e2a2a --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +#Logging and printk is using standard UART. +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=8192 +CONFIG_SUIT_CACHEX_ERASE_BLOCK_SIZE=128 diff --git a/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..d3be04285a9f --- /dev/null +++ b/tests/subsys/suit/cache_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&mram1x { + erase-block-size = < 0x10 >; + /* Hardcoded inside the soc_flash_nrf_mram.c (MRAM_WORD_SIZE) */ + write-block-size = < 0x10 >; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@19d000 { + reg = < 0x19d000 DT_SIZE_K(1) >; + }; + + dfu_cache_partition_1: partition@19d400 { + reg = <0x19d400 DT_SIZE_K(1)>; + }; + + dfu_cache_partition_3: partition@19d800 { + reg = <0x19d800 DT_SIZE_K(1)>; + }; + + __mpc_override_align: partition@19dc00 { + reg = <0x19dc00 DT_SIZE_K(1)>; + }; + }; +}; diff --git a/tests/subsys/suit/cache_sink/prj.conf b/tests/subsys/suit/cache_sink/prj.conf new file mode 100644 index 000000000000..ffe7e1d555d7 --- /dev/null +++ b/tests/subsys/suit/cache_sink/prj.conf @@ -0,0 +1,25 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PLATFORM_VARIANT_APP=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_CACHE=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_CACHE_RW=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y diff --git a/tests/subsys/suit/cache_sink/src/main.c b/tests/subsys/suit/cache_sink/src/main.c new file mode 100644 index 000000000000..651c3b8f5ef2 --- /dev/null +++ b/tests/subsys/suit/cache_sink/src/main.c @@ -0,0 +1,415 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef CONFIG_BOARD_NATIVE_POSIX +static const uint8_t corrupted_cache_header_ok_size_nok[] = { + 0xBF, /* map(*) */ + 0x75, /* text(21) */ + 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x75, 0x63, 0x6B, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, /* "http://databucket.com" */ + 0x5A, 0x00, 0x00, 0x00, 0x17, /* bytes(23) */ + 0x43, 0x60, 0x02, 0x11, 0x35, 0x85, 0x37, 0x85, 0x76, 0x44, 0x09, 0x44, + 0x45, 0x42, 0x66, 0x25, 0x12, 0x36, 0x84, 0x00, 0x08, 0x61, 0x17, /* payload(23) */ + 0x60, /* Empty padding uri */ + 0x4B, /* bytes(11) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* padding bytes */ + 0x69, /* text(9) */ + 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, /* "#file.bin" */ + 0x5A, 0xFF, 0xFF, 0xFF, 0xFF, /* not updated, corrupted value */ + 0x12, 0x35, 0x89, 0x02, 0x31, 0x70, 0x49, 0x81, 0x20, 0x91, 0x62, 0x38, + 0x90, 0x47, 0x60, 0x12, 0x37, 0x84, 0x90, 0x70, 0x18, 0x92, 0x36, 0x51, + 0x92, 0x83, 0x09, 0x86, 0x70, 0x19, 0x23, /* payload(31) */ + 0xFF, /* primitive(*) - end marker */ + 0xFF}; /* Alignment to erase block size (16 bytes) */ + +static const uint8_t corrupted_cache_malformed_zcbor[] = { + 0xBF, /* map(*) */ + 0x75, /* text(21) */ + 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x75, 0x63, 0x6B, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, /* "http://databucket.com" */ + 0x5A, 0x00, 0x00, 0x00, 0x17, /* bytes(23) */ + 0x43, 0x60, 0x02, 0x11, 0x35, 0x85, 0x37, 0x85, 0x76, 0x44, 0x09, 0x44, + 0x45, 0x42, 0x66, 0x25, 0x12, 0x36, 0x84, 0x00, 0x08, 0x61, 0x17, /* payload(23) */ + 0x60, /* Empty padding uri */ + 0x4B, /* bytes(11) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* padding bytes */ + 0x69, /* text(9) */ + 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, /* "#file.bin" */ + 0x5A, 0x00, 0x00, 0x00, 0x1E, /* bytes(30) - mismatched with real size (31) */ + 0x12, 0x35, 0x89, 0x02, 0x31, 0x70, 0x49, 0x81, 0x20, 0x91, 0x62, 0x38, + 0x90, 0x47, 0x60, 0x12, 0x37, 0x84, 0x90, 0x70, 0x18, 0x92, 0x36, 0x51, + 0x92, 0x83, 0x09, 0x86, 0x70, 0x19, 0x23, /* payload(31) */ + 0xFF, /* primitive(*) - end marker */ + 0xFF}; /* Alignment to erase block size (16 bytes) */ +#endif + +static uint8_t uri[] = "http://databucket.com"; +static uint8_t data[] = {0x43, 0x60, 0x02, 0x11, 0x35, 0x85, 0x37, 0x85, 0x76, + 0x44, 0x09, 0xDE, 0xAD, 0x44, 0x45, 0x42, 0x66, 0x25, + 0x12, 0x36, 0x84, 0x00, 0x08, 0x61, 0x17}; + +static uint8_t uri2[] = "http://storagehole.com"; +static uint8_t data2[] = {0x05, 0x37, 0x14, 0x51, 0x42, 0x99, 0x99, 0x49, 0x46, 0x54, 0x89, 0x28, + 0x82, 0x17, 0x68, 0x20, 0x97, 0x60, 0x22, 0x04, 0x51, 0x45, 0x23, 0x04}; + +static uint8_t uri3[] = "#file.bin"; +static uint8_t uri4[] = "#file2.bin"; +static uint8_t data3[] = { + 0x3b, 0xd1, 0x84, 0x20, 0x54, 0xae, 0x42, 0x71, 0xe2, 0x9e, 0xef, 0x1c, 0xe1, 0x63, 0x96, + 0x75, 0x2d, 0x45, 0xb3, 0x38, 0xd6, 0x2f, 0x31, 0xa9, 0xe9, 0x55, 0xc8, 0x43, 0x61, 0xb7, + 0xbc, 0xc4, 0xa2, 0xf6, 0x5c, 0xb1, 0x8c, 0xc8, 0xe6, 0xf1, 0xf4, 0x2d, 0xce, 0xd3, 0xc9, + 0x8a, 0x30, 0x32, 0x5f, 0x8d, 0xb1, 0x28, 0x4a, 0x3a, 0x7f, 0x2c, 0x9b, 0x6f, 0x67, 0x1e, + 0xbd, 0xb1, 0x71, 0x09, 0xaa, 0x01, 0x89, 0x51, 0x7d, 0xf0, 0xbf, 0xd8, 0xb5, 0x4c, 0x37, + 0xcb, 0xc8, 0xd6, 0x2b, 0xa4, 0xfa, 0x67, 0xa8, 0x3e, 0x21, 0x40, 0xa0, 0xe0, 0x95, 0xfe, + 0x75, 0xc9, 0xb1, 0xa5, 0x26, 0x46, 0x24, 0x7d, 0x6d, 0x8b, 0x24, 0x7e, 0xfb, 0xaa, 0xcf, + 0x8d, 0x7f, 0xcd, 0x9d, 0xef, 0x08, 0x40, 0x7e, 0x9c, 0x47, 0x06, 0xbe, 0x16, 0x50, 0x7c, + 0xfb, 0x7d, 0x91, 0x58, 0x57, 0xf9, 0x37, 0xbe, 0xf1, 0x09, 0x9d, 0x53, 0x64, 0x7e, 0x49, + 0x74, 0x70, 0xe5, 0xc6, 0x2d, 0xac, 0x96, 0x0e, 0xc1, 0x4a, 0x9a, 0xcb, 0x29, 0x92, 0x29, + 0xb5, 0xd2, 0xaf, 0x3f, 0xb7, 0xa5, 0x32, 0x5f, 0xe0, 0x54, 0x6c, 0x3d, 0x05, 0xed, 0x17, + 0xb1, 0xa6, 0xfc, 0xd9, 0xc4, 0x54, 0xc9, 0x4d, 0x6b, 0x28, 0x26, 0xe2, 0x7f, 0xa0, 0x85, + 0x79, 0x4b, 0x1c, 0x72, 0x2e, 0xe7, 0x6f, 0x0e, 0x2b, 0x31, 0x58, 0x92, 0xa5, 0x8a, 0xcf, + 0x44, 0x88, 0x5e, 0x2f, 0xf4, 0x3e, 0xce, 0x7a, 0xf5, 0x93, 0x22, 0x39, 0x38, 0x14, 0xc5, + 0x65, 0xba, 0xb0, 0x8c, 0x3c, 0x06, 0x44, 0x0b, 0x67, 0x47, 0x72, 0x54, 0xf4, 0x8a, 0x06, + 0x58, 0x8a, 0x43, 0x8d, 0xe6, 0xf9, 0xbd, 0xae, 0x43, 0xaa, 0xf2, 0x09, 0xc6, 0x0d, 0x68, + 0x26, 0xa4, 0xef, 0xfd, 0xee, 0xf9, 0x94, 0x3b, 0x4f, 0x8b, 0x2e, 0x73, 0x97, 0x6b, 0x5f, + 0xd5, 0x27, 0x22, 0x94, 0x03, 0x1a, 0x39, 0xbf, 0xb3, 0x77, 0x68, 0x99, 0x54, 0x75, 0xc6, + 0x5b, 0xbd, 0x03, 0x18, 0xb1, 0x85, 0xad, 0xeb, 0x43, 0x04, 0x0d, 0xb1, 0x80, 0xba, 0x51, + 0xa1, 0xda, 0xbb, 0x94, 0x09, 0x80, 0xf9, 0x49, 0x23, 0xec, 0x3d, 0x13, 0x0d, 0x81, 0xeb, + 0x49, 0x00, 0x5d, 0xad, 0xf1, 0xad, 0xb9, 0x7b, 0xa8, 0xfe, 0x65, 0x78, 0xd4, 0x93, 0xa5, + 0x5f, 0x2e, 0x11, 0x9c, 0x0c, 0xbe, 0x37, 0xa0, 0xd5, 0x87, 0xc0, 0x1d, 0xc6, 0xbf, 0x80, + 0x78, 0xc2, 0x75, 0x91, 0x6f, 0xd0, 0x99, 0xb1, 0x84, 0x40, 0x14, 0xb6, 0x78, 0x8c, 0x07, + 0x0b, 0x5d, 0x6c, 0xc0, 0x6e, 0xab, 0x68, 0xb7, 0x39, 0x8e, 0x4c, 0xef, 0xdb, 0xac, 0xfc, + 0x31, 0x3d, 0x46, 0x12, 0x4a, 0x4c, 0xe2, 0x54, 0x83, 0x7c, 0xc6, 0xb3, 0x77, 0xfc, 0x35, + 0xba, 0xc6, 0x57, 0x4d, 0x68, 0xe5, 0x44, 0xa4, 0x8e, 0xb4, 0x70, 0xc4, 0xf9, 0xb5, 0xd4, + 0xad, 0xbe, 0xfa, 0x58, 0x76, 0xb3, 0xb2, 0x21, 0x14, 0x4f, 0xf9, 0xfc, 0x48, 0x2c, 0xba, + 0x1a, 0x20, 0xf4, 0x13, 0x23, 0x53, 0x38, 0x9e, 0x3a, 0xd0, 0x7e, 0x38, 0x68, 0x21, 0x9d, + 0x98, 0x52, 0x3b, 0x60, 0xb3, 0xcc, 0x70, 0x9c, 0xf9, 0x08, 0xa1, 0x33, 0xaa, 0x69, 0xe1, + 0x0f, 0x7a, 0x73, 0xf4, 0x1a, 0xef, 0x55, 0xb7, 0x90, 0xf9, 0x7d, 0x00, 0xec, 0xb4, 0x8c, + 0x29, 0x1d, 0x50, 0xa9, 0x3e, 0x15, 0x24, 0x26, 0xe9, 0x1c, 0xde, 0x41, 0xed, 0xd4, 0x55, + 0x96, 0xe7, 0x15, 0x55, 0x5e, 0xd8, 0x0c, 0xfd, 0xe0, 0x4c, 0xa7, 0xa1, 0xb4, 0xd6, 0xee, + 0x6d, 0x0e, 0x0d, 0x42, 0x79, 0x93, 0xe2, 0x87, 0x2d, 0x0f, 0xee, 0x73, 0xaf, 0x6b, 0x4e, + 0x2e, 0x09, 0x7d, 0xf0, 0x5c, 0x0c, 0xa9, 0xa5, 0x9a, 0x8a, 0xe0, 0xa3, 0xa8, 0x23, 0xc1, + 0x41, 0x4e, 0x5e, 0x3f, 0xf7, 0x39, 0xa4, 0xc5, 0x5b, 0xec}; + +void setup_dfu_test_cache(void *f) +{ + int ret = suit_dfu_cache_rw_initialize(NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to initialize cache: %i", ret); +} + +#ifndef CONFIG_BOARD_NATIVE_POSIX +void setup_dfu_test_corrupted_cache(const uint8_t *corrupted_cache, size_t corrupted_cache_size) +{ + /* Erase the area, to met the preconditions in the next test. */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase area"); + + int rc = flash_write(fdev, FIXED_PARTITION_OFFSET(dfu_cache_partition_1), corrupted_cache, + corrupted_cache_size); + zassert_equal(rc, 0, "Unable to write corrupted_cache before test execution: %i", rc); + + printk("dfu_cache_partition_1 address: %p\n", + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_cache_partition_1))); + + int res = memcmp(corrupted_cache, + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_cache_partition_1)), + corrupted_cache_size); + zassert_equal(res, 0, "Mem compare after write failed"); + + setup_dfu_test_cache(NULL); +} +#endif + +void clear_dfu_test_partitions(void *f) +{ + /* Erase the area, to meet the preconditions in the next test. */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase area"); + + int rc = flash_erase(fdev, FIXED_PARTITION_OFFSET(dfu_cache_partition_1), + FIXED_PARTITION_SIZE(dfu_cache_partition_1)); + + zassert_equal(rc, 0, "Unable to erase dfu__cache_partition_1 before test execution: %i", + rc); + + rc = flash_erase(fdev, FIXED_PARTITION_OFFSET(dfu_cache_partition_3), + FIXED_PARTITION_SIZE(dfu_cache_partition_3)); + zassert_equal(rc, 0, "Unable to erase dfu_cache_partition_3 before test execution: %i", rc); + + suit_dfu_cache_rw_deinitialize(); +} + +bool is_cache_partition_1_empty(void) +{ + const uint8_t *partition_address = + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_cache_partition_1)); + const size_t partition_size = FIXED_PARTITION_SIZE(dfu_cache_partition_1); + + for (size_t i = 0; i < partition_size; i++) { + if (partition_address[i] != 0xFF) { + return false; + } + } + + return true; +} + +ZTEST_SUITE(cache_rw_initialization_tests, NULL, NULL, NULL, clear_dfu_test_partitions, NULL); + +ZTEST(cache_rw_initialization_tests, test_cache_initialization_size_nok) +{ + uint8_t *envelope_address = + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_partition)) + 256; + size_t envelope_size = FIXED_PARTITION_SIZE(dfu_partition); + + int ret = suit_dfu_cache_rw_initialize(envelope_address, envelope_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Initialization should have failed: size out of bounds"); +} + +ZTEST(cache_rw_initialization_tests, test_cache_initialization_address_nok) +{ + uint8_t *envelope_address = + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_partition)) - 256; + size_t envelope_size = FIXED_PARTITION_SIZE(dfu_partition); + + int ret = suit_dfu_cache_rw_initialize(envelope_address, envelope_size); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Initialization should have failed: address out of bounds"); +} + +ZTEST(cache_rw_initialization_tests, test_cache_initialization_ok) +{ + uint8_t *envelope_address = + suit_plat_mem_nvm_ptr_get(FIXED_PARTITION_OFFSET(dfu_partition)) + 256; + size_t envelope_size = FIXED_PARTITION_SIZE(dfu_partition) - 1024; + + int ret = suit_dfu_cache_rw_initialize(envelope_address, envelope_size); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Initialization failed: %i", ret); +} + +#ifndef CONFIG_BOARD_NATIVE_POSIX +ZTEST_SUITE(cache_sink_recovery_tests, NULL, NULL, NULL, + clear_dfu_test_partitions, NULL); + +ZTEST(cache_sink_recovery_tests, test_cache_recovery_header_ok_size_nok) +{ + struct stream_sink sink; + + setup_dfu_test_corrupted_cache(corrupted_cache_header_ok_size_nok, + sizeof(corrupted_cache_header_ok_size_nok)); + + zassert_true(is_cache_partition_1_empty(), "Corrupted cache partition was not recovered"); + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri3, sizeof(uri3), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data, sizeof(data)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); +} + +ZTEST(cache_sink_recovery_tests, test_cache_recovery_malformed_zcbor) +{ + setup_dfu_test_corrupted_cache(corrupted_cache_malformed_zcbor, + sizeof(corrupted_cache_malformed_zcbor)); + + zassert_true(is_cache_partition_1_empty(), "Corrupted cache partition was not recovered"); +} + +#endif + +ZTEST_SUITE(cache_sink_tests, NULL, NULL, setup_dfu_test_cache, clear_dfu_test_partitions, NULL); + +ZTEST(cache_sink_tests, test_cache_drop_slot_ok) +{ + struct stream_sink sink; + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri, sizeof(uri), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data, sizeof(data)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_drop(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to drop cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + ret = suit_dfu_cache_sink_get(&sink, 1, uri2, sizeof(uri2), true); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data2, sizeof(data2)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://storagehole.com"; + size_t uri_size = sizeof("http://storagehole.com"); + + ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed: %i", ret); + zassert_equal(payload_size, sizeof(data2), + "Invalid data size for retrieved payload. payload(%u) data(%u)", payload_size, + sizeof(data)); +} + +ZTEST(cache_sink_tests, test_cache_get_slot_ok) +{ + struct stream_sink sink; + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri, sizeof(uri), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data, sizeof(data)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + const uint8_t *payload = NULL; + size_t payload_size = 0; + const uint8_t ok_uri[] = "http://databucket.com"; + size_t uri_size = sizeof("http://databucket.com"); + + ret = suit_dfu_cache_search(ok_uri, uri_size, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed: %i", ret); + zassert_equal(payload_size, sizeof(data), + "Invalid data size for retrieved payload. payload(%u) data(%u)", payload_size, + sizeof(data)); + + ret = suit_dfu_cache_sink_get(&sink, 3, uri2, sizeof(uri2), true); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data2, sizeof(data2)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + const uint8_t *ok_uri2 = "http://storagehole.com"; + size_t uri_size2 = sizeof("http://storagehole.com"); + + ret = suit_dfu_cache_search(ok_uri2, uri_size2, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "\nGet from cache failed: %i", ret); + zassert_equal(payload_size, sizeof(data2), + "Invalid data size for retrieved payload. payload(%u) data(%u)", payload_size, + sizeof(data)); +} + +ZTEST(cache_sink_tests, test_cache_get_slot_nok_uri_exists) +{ + struct stream_sink sink; + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri, sizeof(uri), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data, sizeof(data)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + + /* Request sink for dfu_cache_partition_3 but it should fail because dfu_cache_partition_1 + * already has same uri written + */ + ret = suit_dfu_cache_sink_get(&sink, 3, uri, sizeof(uri), true); + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Get cache sink should have failed, uri already should be in cache: %i", + ret); +} + +ZTEST(cache_sink_tests, test_cache_get_slot_nok_no_requested_cache) +{ + struct stream_sink sink; + + /* Request sink for suit_cache_4, which should fail because suit_cache_4 was not defined */ + int ret = suit_dfu_cache_sink_get(&sink, 4, uri, sizeof(uri), false); + + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Get cache sink should have failed, suit_cache_4 not defined: %i", ret); + + ret = suit_dfu_cache_sink_get(&sink, 4, uri, sizeof(uri), true); + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Get cache sink should have failed, suit_cache_4 not defined: %i", ret); +} + +ZTEST(cache_sink_tests, test_cache_get_slot_nok_not_enough_space) +{ + struct stream_sink sink; + + int ret = suit_dfu_cache_sink_get(&sink, 1, uri3, sizeof(uri3), true); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + for (size_t i = 0x10 + sizeof(data3); i < FIXED_PARTITION_SIZE(dfu_cache_partition_1); + i += sizeof(data3)) { + ret = sink.write(sink.ctx, data3, sizeof(data3)); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to write to sink: %i", ret); + } + + ret = suit_dfu_cache_sink_commit(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to commit to cache: %i", ret); + + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); + +#ifdef CONFIG_BOARD_NATIVE_POSIX + ret = suit_dfu_cache_sink_get(&sink, 1, uri4, sizeof(uri4), true); + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Get sink should have failed due to lack of free space: %i", ret); +#else + ret = suit_dfu_cache_sink_get(&sink, 1, uri4, sizeof(uri4), true); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to get sink: %i", ret); + + ret = sink.write(sink.ctx, data3, sizeof(data3)); + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "Write to sink should fail due to lack of space: %i", ret); +#endif /* CONFIG_BOARD_NATIVE_POSIX */ + + printk("\nReleasing sink\n"); + ret = sink.release(sink.ctx); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to release sink: %i", ret); +} diff --git a/tests/subsys/suit/cache_sink/testcase.yaml b/tests/subsys/suit/cache_sink/testcase.yaml new file mode 100644 index 000000000000..1e39c9cca0f9 --- /dev/null +++ b/tests/subsys/suit/cache_sink/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-platform.integration.cache_sink: + platform_allow: nrf54h20dk/nrf54h20/cpuapp native_posix native_posix/native/64 + tags: suit suit_cache + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/check_content/CMakeLists.txt b/tests/subsys/suit/check_content/CMakeLists.txt new file mode 100644 index 000000000000..23469e896089 --- /dev/null +++ b/tests/subsys/suit/check_content/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_suit_plat_check_content) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/check_content/prj.conf b/tests/subsys/suit/check_content/prj.conf new file mode 100644 index 000000000000..56cf1b4e4928 --- /dev/null +++ b/tests/subsys/suit/check_content/prj.conf @@ -0,0 +1,29 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_CRYPTO=y + +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_LOG_LEVEL_DBG=y diff --git a/tests/subsys/suit/check_content/src/main.c b/tests/subsys/suit/check_content/src/main.c new file mode 100644 index 000000000000..a74975920fb9 --- /dev/null +++ b/tests/subsys/suit/check_content/src/main.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include +#include + +/* Data used as component content for a MEM component */ +static uint8_t data_mem[] = {0xde, 0xad, 0xbe, 0xef}; + +/* Matching value of the content parameter for a MEM component. + * Note it has the same value as @ref data, however it is kept + * as a separate value to ensure comparison is done byte by + * byte, not via pointer comparison. + */ +static uint8_t matching_content_value_mem[] = {0xde, 0xad, 0xbe, 0xef}; + +/* Matching content parameter for a MEM component. */ +static struct zcbor_string matching_content_mem = { + .value = matching_content_value_mem, + .len = sizeof(matching_content_value_mem), +}; + +/* Not matching value of the content parameter for a MEM component. */ +static uint8_t not_matching_content_value_mem[] = {0xde, 0xad, 0xbe, 0xed}; + +/* Not matching content parameter for a MEM component. */ +static struct zcbor_string not_matching_content_mem = { + .value = not_matching_content_value_mem, + .len = sizeof(not_matching_content_value_mem), +}; + +ZTEST_SUITE(suit_check_content_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_check_content_tests, test_mem_matching) +{ + /* GIVEN a MEM component pointing to the data */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string matching_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + + suit_component_t component; + int err = suit_plat_create_component_handle(&matching_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + void *impl_data = NULL; + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data_mem, + sizeof(data_mem)); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check content function is called */ + err = suit_plat_check_content(component, &matching_content_mem); + + /* THEN the component contents match its content parameter */ + zassert_equal(SUIT_SUCCESS, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(suit_check_content_tests, test_mem_different_size) +{ + /* GIVEN a MEM component pointing to the data... */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string valid_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + + suit_component_t component; + int err = suit_plat_create_component_handle(&valid_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + void *impl_data = NULL; + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + /* ... but indicating wrong data size */ + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data_mem, + sizeof(data_mem) - 1); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check content function is called */ + err = suit_plat_check_content(component, &matching_content_mem); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_FAIL_CONDITION, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(suit_check_content_tests, test_mem_not_matching) +{ + /* GIVEN a MEM component pointing to the data */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string not_matching_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + + suit_component_t component; + int err = suit_plat_create_component_handle(¬_matching_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + void *impl_data = NULL; + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data_mem, + sizeof(data_mem)); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check content function is called */ + err = suit_plat_check_content(component, ¬_matching_content_mem); + + /* THEN the component contents match its content parameter */ + zassert_equal(SUIT_FAIL_CONDITION, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} diff --git a/tests/subsys/suit/check_content/testcase.yaml b/tests/subsys/suit/check_content/testcase.yaml new file mode 100644 index 000000000000..8cdafb57119a --- /dev/null +++ b/tests/subsys/suit/check_content/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.integration.check_content: + platform_allow: nrf52840dk/nrf52840 native_posix + tags: suit suit_plat_check_content + timeout: 240 + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/check_image_match/CMakeLists.txt b/tests/subsys/suit/check_image_match/CMakeLists.txt new file mode 100644 index 000000000000..330dce5392b4 --- /dev/null +++ b/tests/subsys/suit/check_image_match/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_suit_plat_check_image_match) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/check_image_match/prj.conf b/tests/subsys/suit/check_image_match/prj.conf new file mode 100644 index 000000000000..f38ed5f7964c --- /dev/null +++ b/tests/subsys/suit/check_image_match/prj.conf @@ -0,0 +1,37 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_CHECK_IMAGE_MATCH=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_CRYPTO=y + +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_LOG_LEVEL_DBG=y + +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_AUTHENTICATE=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_METADATA=y +CONFIG_SUIT_EXECUTION_MODE=y diff --git a/tests/subsys/suit/check_image_match/src/main.c b/tests/subsys/suit/check_image_match/src/main.c new file mode 100644 index 000000000000..593aa23c8206 --- /dev/null +++ b/tests/subsys/suit/check_image_match/src/main.c @@ -0,0 +1,404 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include +#include + +/* Data for digest calculation */ +static uint8_t data[] = {0xde, 0xad, 0xbe, 0xef}; + +/* Valid sha-256 hash of the data */ +static uint8_t valid_digest_value[] = {0x5f, 0x78, 0xc3, 0x32, 0x74, 0xe4, 0x3f, 0xa9, + 0xde, 0x56, 0x59, 0x26, 0x5c, 0x1d, 0x91, 0x7e, + 0x25, 0xc0, 0x37, 0x22, 0xdc, 0xb0, 0xb8, 0xd2, + 0x7d, 0xb8, 0xd5, 0xfe, 0xaa, 0x81, 0x39, 0x53}; + +/* Valid digest of the data */ +static struct zcbor_string valid_digest = { + .value = valid_digest_value, + .len = sizeof(valid_digest_value), +}; + +/* Invalid sha-256 of the data */ +static uint8_t invalid_digest_value[32] = {0x00}; + +/* Invalid digest of the data */ +static struct zcbor_string invalid_digest = { + .value = invalid_digest_value, + .len = sizeof(invalid_digest_value), +}; + +/* Valid id value for cand_img component */ +static uint8_t valid_cand_img_component_id_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + +/* Valid cand_img component id */ +static struct zcbor_string valid_cand_img_component_id = { + .value = valid_cand_img_component_id_value, + .len = sizeof(valid_cand_img_component_id_value), +}; + +ZTEST_SUITE(check_image_match_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(check_image_match_tests, test_mem_valid) +{ + /* GIVEN a MEM component pointing to the data */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string valid_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data, sizeof(data)); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check image match function is called */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN calculated digest matches valid digest value */ + zassert_equal(SUIT_SUCCESS, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_mem_wrong_size) +{ + /* GIVEN a MEM component pointing to the data... */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string valid_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + /* ... but indicating wrong data size */ + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data, + sizeof(data) - 1); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check image match function is called */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_FAIL_CONDITION, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_mem_wrong_digest) +{ + /* GIVEN a MEM component pointing to the data */ + uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + + struct zcbor_string valid_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, "test error - suit_plat_component_impl_data_get: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data, sizeof(data)); + zassert_equal(SUIT_PLAT_SUCCESS, err, "test error - suit_memptr_storage_ptr_store: %d", + err); + + /* WHEN a check image match function is called with invalid digest */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &invalid_digest); + + /* THEN appropriate error is returned */ + zassert_equal(SUIT_FAIL_CONDITION, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_mem_invalid_component) +{ + /* GIVEN a MEM component with invalid component id, pointing to the data */ + uint8_t invalid_component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, + 0x41, 0x00, 0x45, 0xFF, 0x00, 0x00, 0x00, 0x00}; + + struct zcbor_string invalid_src_component_id = { + .value = invalid_component_id_value, + .len = sizeof(invalid_component_id_value), + }; + + suit_component_t component; + + /* WHEN a component handle is created */ + int err = suit_plat_create_component_handle(&invalid_src_component_id, &component); + + /* THEN it is not supported */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, + "test error - create_component_handle failed: %d", err); +} + +ZTEST(check_image_match_tests, test_cand_img_match) +{ + void *impl_data = NULL; + + /* GIVEN CAND_IMG component pointing to the data */ + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_cand_img_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data, sizeof(data)); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "test error - suit_memptr_storage_ptr_store failed: %d", err); + + /* WHEN a check image match function is called */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN calculated digest matches valid digest value */ + zassert_equal(SUIT_SUCCESS, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_cand_img_mismatch) +{ + void *impl_data = NULL; + /* GIVEN CAND_IMG component pointing to the data */ + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_cand_img_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + err = suit_memptr_storage_ptr_store((memptr_storage_handle_t)impl_data, data, sizeof(data)); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "test error - suit_memptr_storage_ptr_store failed: %d", err); + + /* WHEN a check image match function is called with invalid digest */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &invalid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_FAIL_CONDITION, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +#ifndef CONFIG_SOC_SERIES_NRF54HX +ZTEST(check_image_match_tests, test_soc_spec_1) +{ + /* GIVEN SOC_SPEC component 1 - SDFW */ + uint8_t component_id_value[] = {0x82, 0x49, 0x68, 'S', 'O', 'C', '_', + 'S', 'P', 'E', 'C', 0x41, 0x01}; + struct zcbor_string component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + /* WHEN a check image match function is called on a a non-nrf54h20 platform */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_soc_spec_2) +{ + /* SOC_SPEC component 2 - SDFW recovery*/ + uint8_t component_id_value[] = {0x82, 0x49, 0x68, 'S', 'O', 'C', '_', + 'S', 'P', 'E', 'C', 0x41, 0x02}; + struct zcbor_string component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + /* WHEN a check image match function is called on a a non-nrf54h20 platform*/ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_soc_spec_3) +{ + /* SOC_SPEC component 3 - not supported */ + uint8_t component_id_value[] = {0x82, 0x49, 0x68, 'S', 'O', 'C', '_', + 'S', 'P', 'E', 'C', 0x41, 0x03}; + struct zcbor_string component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + /* WHEN a check image match function is called on a a non-nrf54h20 platform*/ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} + +ZTEST(check_image_match_tests, test_soc_spec_none) +{ + /* SOC_SPEC component without an index - not supported */ + uint8_t component_id_value[] = {0x81, 0x49, 0x68, 'S', 'O', 'C', '_', 'S', 'P', 'E', 'C'}; + struct zcbor_string component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + void *impl_data = NULL; + suit_component_t component; + + int err = suit_plat_create_component_handle(&component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + err = suit_plat_component_impl_data_get(component, &impl_data); + zassert_equal(SUIT_SUCCESS, err, + "test error - suit_plat_component_impl_data_get failed: %d", err); + + /* WHEN a check image match function is called on a a non-nrf54h20 platform*/ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} +#endif /* CONFIG_SOC_SERIES_NRF54HX */ + +ZTEST(check_image_match_tests, test_unhandled_component) +{ + /* NOTE: This test will need to be reworked once the installed manifest component will be + * handled + */ + + /* GIVEN unhandled component */ + uint8_t component_id_value[] = {0x82, 0x4c, 0x6b, 'I', 'N', 'S', 'T', 'L', + 'D', '_', 'M', 'F', 'S', 'T', 0x50, 0x56, + 0xdc, 0x9a, 0x14, 0x28, 0xd8, 0x52, 0xd3, 0xbd, + 0x62, 0xe7, 0x7a, 0x08, 0xbc, 0x8b, 0x91}; + + struct zcbor_string valid_src_component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), + }; + suit_component_t component; + + int err = suit_plat_create_component_handle(&valid_src_component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test error - create_component_handle failed: %d", err); + + /* WHEN a check image match function is called */ + err = suit_plat_check_image_match(component, suit_cose_sha256, &valid_digest); + + /* THEN appropriate error code is returned */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, err, "unexpected error code: %d", err); + + /* Cleanup */ + err = suit_plat_release_component_handle(component); + zassert_equal(SUIT_SUCCESS, err, "test error - failed to cleanup component handle: %d", + err); +} diff --git a/tests/subsys/suit/check_image_match/testcase.yaml b/tests/subsys/suit/check_image_match/testcase.yaml new file mode 100644 index 000000000000..a947400fb47a --- /dev/null +++ b/tests/subsys/suit/check_image_match/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.integration.check_image_match: + platform_allow: nrf52840dk/nrf52840 native_posix + tags: suit suit_plat_check_image_match + timeout: 240 + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/cmake/test_template.cmake b/tests/subsys/suit/cmake/test_template.cmake new file mode 100644 index 000000000000..61df828d5878 --- /dev/null +++ b/tests/subsys/suit/cmake/test_template.cmake @@ -0,0 +1,26 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE + ${app_sources} + ) + +if (VERBOSE) + zephyr_compile_definitions(ZCBOR_VERBOSE) +endif() + +if (ASSERTS) + zephyr_compile_definitions(ZCBOR_ASSERTS) +endif() + +zephyr_compile_options(-Werror) + +if (CONFIG_64BIT) + set(bit_arg -b 64) +endif() + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../common" "${PROJECT_BINARY_DIR}/test_common") diff --git a/tests/subsys/suit/common/CMakeLists.txt b/tests/subsys/suit/common/CMakeLists.txt new file mode 100644 index 000000000000..a0dd07cf1b5c --- /dev/null +++ b/tests/subsys/suit/common/CMakeLists.txt @@ -0,0 +1,37 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +add_subdirectory(mci_test) +zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/include) + +if (CONFIG_MBEDTLS) +if (CONFIG_SUIT_PLATFORM) +# Link SUIT platform (incl. crypto) module with mbedTLS library, that provides PSA crypto APIs. +target_link_libraries(suit_platform_interface INTERFACE mbedTLS) +endif() # CONFIG_SUIT_PLATFORM + +if (CONFIG_SUIT_STREAM_SINK_DIGEST) +target_link_libraries(suit_stream_sinks_interface INTERFACE mbedTLS) +endif() + +if (CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20) +target_link_libraries(suit_storage_interface INTERFACE mbedTLS) +endif() + +# Fix the mbedTLS build scripts: +# The "mbedtls/library/psa_crypto_cipher.c" file includes "", +# but this header is not a part of mbedTLS public API, thus it is not found and +# the compiler reports this as an error. +target_include_directories(mbedTLS INTERFACE ${ZEPHYR_MBEDTLS_MODULE_DIR}/library) +endif() + +if (CONFIG_SUIT_DEFAULT_MBEDTLS_CONFIG) +# Add include path for the default, customized mbedTLS configuration header. +zephyr_include_directories(${CMAKE_CURRENT_LIST_DIR}/tls_config) +endif() + +zephyr_interface_library_named(suit_update_magic_values) +target_include_directories(suit_update_magic_values INTERFACE .) diff --git a/tests/subsys/suit/common/mci_test/CMakeLists.txt b/tests/subsys/suit/common/mci_test/CMakeLists.txt new file mode 100644 index 000000000000..c891bdf26413 --- /dev/null +++ b/tests/subsys/suit/common/mci_test/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +if (CONFIG_SUIT_MCI_IMPL_CUSTOM) + zephyr_library_named(mci_test) + zephyr_library_sources(mci_test.c) + zephyr_library_link_libraries(suit_mci) + zephyr_library_link_libraries(suit_metadata) + zephyr_library_link_libraries(suit_execution_mode) + + if (CONFIG_MBEDTLS) + # Link MCI (incl. crypto) module with mbedTLS library, that provides PSA crypto APIs. + zephyr_library_link_libraries(mbedTLS) + endif() # CONFIG_MBEDTLS + + target_link_libraries(app PUBLIC mci_test) +endif() diff --git a/tests/subsys/suit/common/mci_test/mci_test.c b/tests/subsys/suit/common/mci_test/mci_test.c new file mode 100644 index 000000000000..358c421f6d7a --- /dev/null +++ b/tests/subsys/suit/common/mci_test/mci_test.c @@ -0,0 +1,424 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#if defined(CONFIG_MBEDTLS) || defined(CONFIG_NRF_SECURITY) +#include +#endif /* CONFIG_MBEDTLS || CONFIG_NRF_SECURITY*/ + +/* Test topology: Root Manifest orchestrating application domain. + * Summarizing - Single Root Manifest and one local manifest. + */ + +/* RFC4122 uuid5(nordic_vid, 'test_sample_root') + */ +static const suit_manifest_class_id_t nordic_root_manifest_class_id = { + {0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, + 0x0a}}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_app') + */ +static const suit_manifest_class_id_t nordic_app_manifest_class_id = { + {0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, 0x53, 0x9c, 0xa3, 0x18, 0x68, 0x1b, 0x03, 0x69, 0x5e, + 0x36}}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_recovery') + */ +static const suit_manifest_class_id_t nordic_recovery_manifest_class_id = { + {0x74, 0xa0, 0xc6, 0xe7, 0xa9, 0x2a, 0x56, 0x00, 0x9c, 0x5d, 0x30, 0xee, 0x87, 0x8b, 0x06, + 0xba}}; + +typedef struct { + const suit_manifest_class_id_t *manifest_class_id; + const suit_manifest_class_id_t *parent_manifest_class_id; + suit_downgrade_prevention_policy_t downgrade_prevention_policy; + suit_independent_updateability_policy_t independent_update_policy; + uint32_t signing_key_bits; + uint32_t signing_key_mask; +} manifest_config_t; + +static manifest_config_t supported_manifests[] = { + {&nordic_root_manifest_class_id, NULL, SUIT_DOWNGRADE_PREVENTION_DISABLED, + SUIT_INDEPENDENT_UPDATE_ALLOWED, + /* signing_key_mask equal to -1 means signing with specified key is required + */ + 0x00000000, 0xFFFFFFFF}, + {&nordic_app_manifest_class_id, &nordic_root_manifest_class_id, + SUIT_DOWNGRADE_PREVENTION_DISABLED, SUIT_INDEPENDENT_UPDATE_DENIED, + /* signing_key_mask equal to -1 means signing with specified key is required + */ + 0x00000000, 0xFFFFFFFF}, + {&nordic_recovery_manifest_class_id, NULL, SUIT_DOWNGRADE_PREVENTION_DISABLED, + SUIT_INDEPENDENT_UPDATE_ALLOWED, + /* signing_key_mask equal to -1 means signing with specified key is required + */ + 0x00000000, 0xFFFFFFFF}}; + +static const manifest_config_t * +find_manifest_config(const suit_manifest_class_id_t *manifest_class_id) +{ + for (int i = 0; i < sizeof(supported_manifests) / sizeof(manifest_config_t); ++i) { + const manifest_config_t *manifest_config = &supported_manifests[i]; + + if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(manifest_config->manifest_class_id, + manifest_class_id)) { + return manifest_config; + } + } + return NULL; +} + +#if defined(CONFIG_MBEDTLS) || defined(CONFIG_NRF_SECURITY) +static suit_plat_err_t load_keys(uint32_t *key_id) +{ + const uint8_t public_key[] = { + 0x04, /* POINT_CONVERSION_UNCOMPRESSED */ + 0xed, 0xd0, 0x9e, 0xa5, 0xec, 0xe4, 0xed, 0xbe, 0x6c, 0x08, 0xe7, 0x47, 0x09, + 0x55, 0x9a, 0x38, 0x29, 0xc5, 0x31, 0x33, 0x22, 0x7b, 0xf4, 0xf0, 0x11, 0x6e, + 0x8c, 0x05, 0x2d, 0x02, 0x0e, 0x0e, 0xc3, 0xe0, 0xd8, 0x37, 0xf4, 0xc2, 0x6f, + 0xc1, 0x28, 0x80, 0x2f, 0x45, 0x38, 0x1a, 0x23, 0x2b, 0x6d, 0xd5, 0xda, 0x28, + 0x60, 0x00, 0x5d, 0xab, 0xe2, 0xa0, 0x83, 0xdb, 0xef, 0x38, 0x55, 0x13}; + psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR; + + /* Initialize PSA Crypto */ + psa_status = psa_crypto_init(); + if (psa_status != PSA_SUCCESS) { + return SUIT_PLAT_ERR_CRASH; + } + + /* Add keys */ + psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT; + + psa_set_key_usage_flags(&key_attributes, PSA_KEY_USAGE_VERIFY_HASH); + psa_set_key_algorithm(&key_attributes, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); + psa_set_key_type(&key_attributes, PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)); + + psa_status = psa_import_key(&key_attributes, public_key, sizeof(public_key), key_id); + if (psa_status != PSA_SUCCESS) { + return SUIT_PLAT_ERR_CRASH; + } + + return SUIT_PLAT_SUCCESS; +} +#endif /* CONFIG_MBEDTLS || CONFIG_NRF_SECURITY */ + +int suit_mci_supported_manifest_class_ids_get(suit_manifest_class_info_t *class_info, size_t *size) +{ + if (NULL == class_info || NULL == size) { + return SUIT_PLAT_ERR_INVAL; + } + + size_t output_max_size = *size; + size_t output_size = sizeof(supported_manifests) / sizeof(manifest_config_t); + + if (output_size > output_max_size) { + return SUIT_PLAT_ERR_SIZE; + } + + for (int i = 0; i < output_size; ++i) { + class_info[i].class_id = supported_manifests[i].manifest_class_id; + suit_mci_nordic_vendor_id_get(&class_info[i].vendor_id); + } + + *size = output_size; + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_invoke_order_get(const suit_manifest_class_id_t **class_id, size_t *size) +{ + if (NULL == class_id || NULL == size) { + return SUIT_PLAT_ERR_INVAL; + } + size_t output_max_size = *size; + + /* In this implementation the only manifest which shall be utilized to initiate + * system bringup is a root manifest + */ + size_t output_size = 1; + + if (output_size > output_max_size) { + return SUIT_PLAT_ERR_SIZE; + } + + switch (suit_execution_mode_get()) { + case EXECUTION_MODE_INVOKE: + class_id[0] = &nordic_root_manifest_class_id; + *size = output_size; + break; + case EXECUTION_MODE_INVOKE_RECOVERY: + class_id[0] = &nordic_recovery_manifest_class_id; + *size = output_size; + break; + default: + *size = 0; + break; + } + + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_downgrade_prevention_policy_get(const suit_manifest_class_id_t *class_id, + suit_downgrade_prevention_policy_t *policy) +{ + if (NULL == class_id || NULL == policy) { + return SUIT_PLAT_ERR_INVAL; + } + + const manifest_config_t *manifest_config = find_manifest_config(class_id); + + if (NULL == manifest_config) { + return MCI_ERR_MANIFESTCLASSID; + } + *policy = manifest_config->downgrade_prevention_policy; + return SUIT_PLAT_SUCCESS; +} + +mci_err_t suit_mci_independent_update_policy_get(const suit_manifest_class_id_t *class_id, + suit_independent_updateability_policy_t *policy) +{ + if (NULL == class_id || NULL == policy) { + return SUIT_PLAT_ERR_INVAL; + } + + const manifest_config_t *manifest_config = find_manifest_config(class_id); + + if (NULL == manifest_config) { + return MCI_ERR_MANIFESTCLASSID; + } + *policy = manifest_config->independent_update_policy; + + /* Override independent updateability policy in recovery scenarios: + * If the update candidate was delivered by the recovery firmware, + * it must not update the recovery firmware. + * Invoke modes included, so the recovery firmware may reject the incorrect + * update candidate before resetting the SoC. + */ + switch (suit_execution_mode_get()) { + case EXECUTION_MODE_INVOKE_RECOVERY: + case EXECUTION_MODE_INSTALL_RECOVERY: + case EXECUTION_MODE_POST_INVOKE_RECOVERY: + if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_recovery_manifest_class_id, class_id)) { + *policy = SUIT_INDEPENDENT_UPDATE_DENIED; + } + break; + default: + break; + } + + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_manifest_class_id_validate(const suit_manifest_class_id_t *class_id) +{ + if (NULL == class_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; + } + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_signing_key_id_validate(const suit_manifest_class_id_t *class_id, uint32_t key_id) +{ + if (NULL == class_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 ((manifest_config->signing_key_bits & manifest_config->signing_key_mask) != + (key_id & manifest_config->signing_key_mask)) { + return MCI_ERR_WRONGKEYID; + } + + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_processor_start_rights_validate(const suit_manifest_class_id_t *class_id, + int processor_id) +{ + if (NULL == class_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 (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_root_manifest_class_id, class_id)) { + /* Root manifest - ability to start any cpu are intentionally blocked + */ + return MCI_ERR_NOACCESS; + + } else if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, class_id)) { + /* Application manifest. Use "0" as CPU ID in tests + */ + if (0 == processor_id) { + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; + } else if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_recovery_manifest_class_id, class_id)) { + /* Application recovery manifest. Use "0" as CPU ID in tests + */ + if (0 == processor_id) { + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; + } + + return MCI_ERR_NOACCESS; +} + +int suit_mci_memory_access_rights_validate(const suit_manifest_class_id_t *class_id, void *address, + size_t mem_size) +{ + if (NULL == class_id || NULL == address || 0 == mem_size) { + 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 (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_root_manifest_class_id, class_id)) { + /* Root manifest - ability to operate on memory ranges intentionally blocked + */ + return MCI_ERR_NOACCESS; + + } else if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, class_id)) { + /* Application manifest - allow to overwrite any address + */ + return SUIT_PLAT_SUCCESS; + } else if (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_recovery_manifest_class_id, class_id)) { + /* Application recovery manifest - allow to overwrite any address + */ + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; +} + +int suit_mci_platform_specific_component_rights_validate(const suit_manifest_class_id_t *class_id, + int platform_specific_component_number) +{ + if (NULL == class_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; + } + + return MCI_ERR_NOACCESS; +} + +int suit_mci_vendor_id_for_manifest_class_id_get(const suit_manifest_class_id_t *class_id, + const suit_uuid_t **vendor_id) +{ + if (NULL == class_id || NULL == vendor_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; + } + + return suit_mci_nordic_vendor_id_get(vendor_id); +} + +int suit_mci_manifest_parent_child_declaration_validate( + const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + if (NULL == parent_class_id || NULL == child_class_id) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_root_manifest_class_id, parent_class_id)) && + (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, child_class_id))) { + return SUIT_PLAT_SUCCESS; + } + + if ((SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_recovery_manifest_class_id, parent_class_id)) && + (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, child_class_id))) { + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; +} + +mci_err_t +suit_mci_manifest_process_dependency_validate(const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + if (NULL == parent_class_id || NULL == child_class_id) { + return SUIT_PLAT_ERR_INVAL; + } + + if ((SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_root_manifest_class_id, parent_class_id)) && + (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, child_class_id))) { + return SUIT_PLAT_SUCCESS; + } + + if ((SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_recovery_manifest_class_id, parent_class_id)) && + (SUIT_PLAT_SUCCESS == + suit_metadata_uuid_compare(&nordic_app_manifest_class_id, child_class_id))) { + return SUIT_PLAT_SUCCESS; + } + + return MCI_ERR_NOACCESS; +} + +int suit_mci_init(void) +{ +#if defined(CONFIG_MBEDTLS) || defined(CONFIG_NRF_SECURITY) + if (supported_manifests[0].signing_key_bits == 0) { + int ret = load_keys(&supported_manifests[0].signing_key_bits); + + if (ret != SUIT_PLAT_SUCCESS) { + return ret; + } + + supported_manifests[1].signing_key_bits = supported_manifests[0].signing_key_bits; + supported_manifests[2].signing_key_bits = supported_manifests[0].signing_key_bits; + } +#endif /* CONFIG_MBEDTLS || CONFIG_NRF_SECURITY */ + + return SUIT_PLAT_SUCCESS; +} diff --git a/tests/subsys/suit/common/tls_config/user-tls-conf.h b/tests/subsys/suit/common/tls_config/user-tls-conf.h new file mode 100644 index 000000000000..a5ddd011dee8 --- /dev/null +++ b/tests/subsys/suit/common/tls_config/user-tls-conf.h @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of mbed TLS (https://tls.mbed.org) + */ + +/* + * NOTICE: This file has been modified by Nordic Semiconductor ASA. + */ + +#ifndef USER_MBEDTLS_CONFIG_H +#define USER_MBEDTLS_CONFIG_H + +/** + * \def MBEDTLS_ENTROPY_C + * + * Enable the platform-specific entropy code. + * + * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C + * + * This module provides a generic entropy pool + */ +#define MBEDTLS_ENTROPY_C + +/** + * \def MBEDTLS_TEST_NULL_ENTROPY + * + * Enables testing and use of mbed TLS without any configured entropy sources. + * This permits use of the library on platforms before an entropy source has + * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the + * MBEDTLS_ENTROPY_NV_SEED switches). + * + * WARNING! This switch MUST be disabled in production builds, and is suitable + * only for development. + * Enabling the switch negates any security provided by the library. + * + * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + * + */ +/* #define MBEDTLS_TEST_NULL_ENTROPY */ + +/** + * \def MBEDTLS_NO_PLATFORM_ENTROPY + * + * Do not use built-in platform entropy functions. + * This is useful if your platform does not support + * standards like the /dev/urandom or Windows CryptoAPI. + * + * Uncomment this macro to disable the built-in platform entropy functions. + */ +#undef MBEDTLS_NO_PLATFORM_ENTROPY + +/** + * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + * + * Do not add default entropy sources. These are the platform specific, + * mbedtls_timing_hardclock and HAVEGE based poll functions. + * + * This is useful to have more control over the added entropy sources in an + * application. + * + * Uncomment this macro to prevent loading of default entropy functions. + */ +#undef MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + +/** + * \def MBEDTLS_PSA_CRYPTO_C + * + * Enable the Platform Security Architecture cryptography API. + * + * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C + */ +#define MBEDTLS_PSA_CRYPTO_C + +/** + * \def MBEDTLS_ASN1_WRITE_C + * + * Enable the generic ASN1 writer. + */ +#define MBEDTLS_ASN1_WRITE_C + +/** + * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED + * + * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve + * module. + */ +#define MBEDTLS_ECP_DP_SECP256R1_ENABLED + +/** + * \def MBEDTLS_ECP_C + * + * Enable the elliptic curve over GF(p) library. + * + * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED + */ +#define MBEDTLS_ECP_C + +/** + * \def MBEDTLS_ECDSA_C + * + * Enable the elliptic curve DSA library. + * + * This module is used by the following key exchanges: + * ECDHE-ECDSA + * + * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C + */ +#define MBEDTLS_ECDSA_C + +/* Verify that the assigned volatile key ID will match with the key ID used + * inside the authentication wrappers. + */ +#if ((defined MBEDTLS_PSA_KEY_SLOT_COUNT) && (MBEDTLS_PSA_KEY_SLOT_COUNT > 32)) +#undef MBEDTLS_PSA_KEY_SLOT_COUNT +#define MBEDTLS_PSA_KEY_SLOT_COUNT 32 +#elif ((defined MBEDTLS_PSA_KEY_SLOT_COUNT) && (MBEDTLS_PSA_KEY_SLOT_COUNT != 32)) +#error "Key ID ranges will not match" +#endif + +#endif /* USER_MBEDTLS_CONFIG_H */ diff --git a/tests/subsys/suit/common/update_magic_values.h b/tests/subsys/suit/common/update_magic_values.h new file mode 100644 index 000000000000..192e24561825 --- /dev/null +++ b/tests/subsys/suit/common/update_magic_values.h @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#define UPDATE_MAGIC_VALUE_AVAILABLE 0x55AA55AA +#define UPDATE_MAGIC_VALUE_EMPTY 0xFFFFFFFF diff --git a/tests/subsys/suit/copy/CMakeLists.txt b/tests/subsys/suit/copy/CMakeLists.txt new file mode 100644 index 000000000000..db01516cc590 --- /dev/null +++ b/tests/subsys/suit/copy/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 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(integration_test_copy) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) +zephyr_library_link_libraries(suit_sink_selector_interface) diff --git a/tests/subsys/suit/copy/boards/native_posix.conf b/tests/subsys/suit/copy/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/copy/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/copy/boards/native_posix.overlay b/tests/subsys/suit/copy/boards/native_posix.overlay new file mode 100644 index 000000000000..6ce400395592 --- /dev/null +++ b/tests/subsys/suit/copy/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/copy/boards/native_posix_64.conf b/tests/subsys/suit/copy/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/copy/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/copy/boards/native_posix_64.overlay b/tests/subsys/suit/copy/boards/native_posix_64.overlay new file mode 100644 index 000000000000..6ce400395592 --- /dev/null +++ b/tests/subsys/suit/copy/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/copy/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/copy/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..ba570a2d4ae9 --- /dev/null +++ b/tests/subsys/suit/copy/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; diff --git a/tests/subsys/suit/copy/prj.conf b/tests/subsys/suit/copy/prj.conf new file mode 100644 index 000000000000..10af2de52e30 --- /dev/null +++ b/tests/subsys/suit/copy/prj.conf @@ -0,0 +1,26 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y diff --git a/tests/subsys/suit/copy/src/main.c b/tests/subsys/suit/copy/src/main.c new file mode 100644 index 000000000000..beff1621158e --- /dev/null +++ b/tests/subsys/suit/copy/src/main.c @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define WRITE_ADDR 0x1A00080000 + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7}; + +ZTEST_SUITE(copy_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(copy_tests, test_integrated_fetch_to_memptr_and_copy_to_msink_OK) +{ + memptr_storage_handle_t handle; + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + suit_component_t src_handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_src_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_src_component_id = { + .value = valid_src_value, + .len = sizeof(valid_src_value), + }; + + int ret = suit_plat_create_component_handle(&valid_src_component_id, &src_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(src_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_component_impl_data_get(src_handle, &handle); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_component_impl_data_get failed - error %i", + ret); + + const uint8_t *payload; + size_t payload_size = 0; + + ret = suit_memptr_storage_ptr_get(handle, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "storage.get failed - error %i", ret); + zassert_equal_ptr(test_data, payload, "Retrieved payload doesn't mach test_data"); + zassert_equal(sizeof(test_data), payload_size, + "Retrieved payload_size doesn't mach size of test_data"); + zassert_not_null(payload, "Retrieved payload is NULL"); + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A00080000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_copy(dst_handle, src_handle); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_copy failed - error %i", ret); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); + + ret = suit_plat_release_component_handle(src_handle); + zassert_equal(ret, SUIT_SUCCESS, "src_handle release failed - error %i", ret); + + ret = suit_memptr_storage_release(handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage handle release failed - error %i", + ret); +} + +/**************************************************************************************************/ +ZTEST(copy_tests, test_integrated_fetch_to_memptr_and_copy_to_msink_NOK_dst_handle_released) +{ + memptr_storage_handle_t handle = NULL; + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + suit_component_t src_handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_src_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_src_component_id = { + .value = valid_src_value, + .len = sizeof(valid_src_value), + }; + + int ret = suit_plat_create_component_handle(&valid_src_component_id, &src_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(src_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_component_impl_data_get(src_handle, &handle); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_component_impl_data_get failed - error %i", + ret); + + const uint8_t *payload; + size_t payload_size = 0; + + ret = suit_memptr_storage_ptr_get(handle, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "storage.get failed - error %i", ret); + zassert_equal_ptr(test_data, payload, "Retrieved payload doesn't mach test_data"); + zassert_equal(sizeof(test_data), payload_size, + "Retrieved payload_size doesn't mach size of test_data"); + zassert_not_null(payload, "Retrieved payload is NULL"); + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A00080000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); + + ret = suit_plat_copy(dst_handle, src_handle); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_copy should have failed - dst_handle released"); + + ret = suit_plat_release_component_handle(src_handle); + zassert_equal(ret, SUIT_SUCCESS, "src_handle release failed - error %i", ret); + + ret = suit_memptr_storage_release(handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage handle release failed - error %i", + ret); +} + +ZTEST(copy_tests, test_integrated_fetch_to_memptr_and_copy_to_msink_NOK_src_handle_released) +{ + memptr_storage_handle_t handle = NULL; + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + suit_component_t src_handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_src_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_src_component_id = { + .value = valid_src_value, + .len = sizeof(valid_src_value), + }; + + int ret = suit_plat_create_component_handle(&valid_src_component_id, &src_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(src_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_component_impl_data_get(src_handle, &handle); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_component_impl_data_get failed - error %i", + ret); + + const uint8_t *payload; + size_t payload_size = 0; + + ret = suit_memptr_storage_ptr_get(handle, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "storage.get failed - error %i", ret); + zassert_equal_ptr(test_data, payload, "Retrieved payload doesn't mach test_data"); + zassert_equal(sizeof(test_data), payload_size, + "Retrieved payload_size doesn't mach size of test_data"); + zassert_not_null(payload, "Retrieved payload is NULL"); + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A00080000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_release_component_handle(src_handle); + zassert_equal(ret, SUIT_SUCCESS, "src_handle release failed - error %i", ret); + + ret = suit_plat_copy(dst_handle, src_handle); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_copy should have failed - src_handle released"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "src_handle release failed - error %i", ret); + + ret = suit_memptr_storage_release(handle); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "memptr_storage handle release failed - error %i", + ret); +} + +ZTEST(copy_tests, test_integrated_fetch_to_memptr_and_copy_to_msink_NOK_memptr_empty) +{ + suit_component_t src_handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_src_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_src_component_id = { + .value = valid_src_value, + .len = sizeof(valid_src_value), + }; + + int ret = suit_plat_create_component_handle(&valid_src_component_id, &src_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A00080000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_copy(dst_handle, src_handle); + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_copy should have failed - memptr empty"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); + + ret = suit_plat_release_component_handle(src_handle); + zassert_equal(ret, SUIT_SUCCESS, "src_handle release failed - error %i", ret); +} diff --git a/tests/subsys/suit/copy/testcase.yaml b/tests/subsys/suit/copy/testcase.yaml new file mode 100644 index 000000000000..9225b7a975e3 --- /dev/null +++ b/tests/subsys/suit/copy/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit-platform.integration.copy: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix + - native_posix/native/64 diff --git a/tests/subsys/suit/digest/CMakeLists.txt b/tests/subsys/suit/digest/CMakeLists.txt new file mode 100644 index 000000000000..446d60db9f1e --- /dev/null +++ b/tests/subsys/suit/digest/CMakeLists.txt @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 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(integration_test_suit_digest) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_platform_interface) diff --git a/tests/subsys/suit/digest/prj.conf b/tests/subsys/suit/digest/prj.conf new file mode 100644 index 000000000000..b7bd1d839a6c --- /dev/null +++ b/tests/subsys/suit/digest/prj.conf @@ -0,0 +1,26 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_CRYPTO=y + +CONFIG_SUIT_SINK_SELECTOR=y diff --git a/tests/subsys/suit/digest/src/main.c b/tests/subsys/suit/digest/src/main.c new file mode 100644 index 000000000000..f38438b852c5 --- /dev/null +++ b/tests/subsys/suit/digest/src/main.c @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include + +const static uint8_t valid_payload_value[] = {0xde, 0xad, 0xbe, 0xef}; + +static struct zcbor_string payload_valid = { + .value = valid_payload_value, + .len = sizeof(valid_payload_value), +}; + +static struct zcbor_string payload_invalid_null_value = { + .value = NULL, + .len = sizeof(valid_payload_value), +}; + +static struct zcbor_string payload_invalid_zero_length = { + .value = valid_payload_value, + .len = 0, +}; + +const static uint8_t valid_digest_value[] = {0x5f, 0x78, 0xc3, 0x32, 0x74, 0xe4, 0x3f, 0xa9, + 0xde, 0x56, 0x59, 0x26, 0x5c, 0x1d, 0x91, 0x7e, + 0x25, 0xc0, 0x37, 0x22, 0xdc, 0xb0, 0xb8, 0xd2, + 0x7d, 0xb8, 0xd5, 0xfe, 0xaa, 0x81, 0x39, 0x53}; + +const static uint8_t invalid_digest_value[] = {0x5f, 0x78, 0xc3, 0x32, 0x74, 0xe4, 0x3f, 0xa9, + 0xde, 0x56, 0x59, 0x26, 0x5c, 0x1d, 0x91, 0x7e, + 0x25, 0xc0, 0x37, 0x22, 0xdc, 0xb0, 0xb8, 0xd2, + 0x7d, 0xb8, 0xd5, 0xfe, 0xaa, 0x81, 0x39, 0x54}; + +static struct zcbor_string digest_valid = { + .value = valid_digest_value, + .len = sizeof(valid_digest_value), +}; + +static struct zcbor_string digest_invalid = { + .value = invalid_digest_value, + .len = sizeof(invalid_digest_value), +}; + +static struct zcbor_string digest_wrong_length = { + .value = valid_digest_value, + .len = sizeof(valid_digest_value) - 1, +}; + +static const enum suit_cose_alg valid_algorithm = suit_cose_sha256; +static const enum suit_cose_alg invalid_algorithm = (enum suit_cose_alg)0; + +ZTEST_SUITE(digest_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(digest_tests, test_unsupported_algorithm) +{ + /* GIVEN unsupported digest algorithm... */ + const enum suit_cose_alg algorithm = invalid_algorithm; + + /* ...valid expected digest... */ + struct zcbor_string *expected_digest = &digest_valid; + + /* ...and valid payload */ + struct zcbor_string *payload = &payload_valid; + + /* WHEN digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_ERR_DECODING, "Unexpected error code"); +} + +ZTEST(digest_tests, test_digest_null) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...NULL expected digest */ + struct zcbor_string *expected_digest = NULL; + + /* ...and a valid payload */ + struct zcbor_string *payload = &payload_valid; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_FAIL_CONDITION, "Unexpected error code"); +} + +ZTEST(digest_tests, test_payload_null) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...valid expected digest */ + struct zcbor_string *expected_digest = &digest_valid; + + /* ...and a NULL payload */ + struct zcbor_string *payload = NULL; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_FAIL_CONDITION, "Unexpected error code"); +} + +ZTEST(digest_tests, test_payload_value_null) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...valid expected digest */ + struct zcbor_string *expected_digest = &digest_valid; + + /* ...and a payload which has a NULL value */ + struct zcbor_string *payload = &payload_invalid_null_value; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_ERR_DECODING, "Unexpected error code"); +} + +ZTEST(digest_tests, test_payload_length_zero) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...valid expected digest */ + struct zcbor_string *expected_digest = &digest_valid; + + /* ...and a payload which has a NULL value */ + struct zcbor_string *payload = &payload_invalid_zero_length; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_ERR_DECODING, "Unexpected error code"); +} + +ZTEST(digest_tests, test_digest_wrong_length) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...expected digest with wrong length */ + struct zcbor_string *expected_digest = &digest_wrong_length; + + /* ...and a valid payload */ + struct zcbor_string *payload = &payload_valid; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN appropriate error code is returned */ + zassert_equal(err, SUIT_ERR_DECODING, "Unexpected error code"); +} + +ZTEST(digest_tests, test_digest_match) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...a valid digest */ + struct zcbor_string *expected_digest = &digest_valid; + + /* ...and a valid payload */ + struct zcbor_string *payload = &payload_valid; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN operation ends with success */ + zassert_equal(err, SUIT_SUCCESS, "Unexpected error code"); +} + +ZTEST(digest_tests, test_digest_mismatch) +{ + /* GIVEN supported digest algorithm... */ + enum suit_cose_alg algorithm = valid_algorithm; + + /* ...an invalid digest */ + struct zcbor_string *expected_digest = &digest_invalid; + + /* ...and a valid payload */ + struct zcbor_string *payload = &payload_valid; + + /* WHEN a digest is checked */ + int err = suit_plat_check_digest(algorithm, expected_digest, payload); + + /* THEN operation ends with condition failure */ + zassert_equal(err, SUIT_FAIL_CONDITION, "Unexpected error code"); +} diff --git a/tests/subsys/suit/digest/testcase.yaml b/tests/subsys/suit/digest/testcase.yaml new file mode 100644 index 000000000000..4bef13f3323e --- /dev/null +++ b/tests/subsys/suit/digest/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.integration.digest: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit suit_digest + timeout: 240 + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/digest_sink/CMakeLists.txt b/tests/subsys/suit/digest_sink/CMakeLists.txt new file mode 100644 index 000000000000..55d71aa1f1cb --- /dev/null +++ b/tests/subsys/suit/digest_sink/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_suit_digest_sink) +include(../cmake/test_template.cmake) + + +# link with the cmake target, that includes suit platform internal apis header +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/digest_sink/prj.conf b/tests/subsys/suit/digest_sink/prj.conf new file mode 100644 index 000000000000..70f5c42b6a70 --- /dev/null +++ b/tests/subsys/suit/digest_sink/prj.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_CRYPTO=y diff --git a/tests/subsys/suit/digest_sink/src/main.c b/tests/subsys/suit/digest_sink/src/main.c new file mode 100644 index 000000000000..7e45f54bdc65 --- /dev/null +++ b/tests/subsys/suit/digest_sink/src/main.c @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include + +static const uint8_t valid_payload[] = {0xde, 0xad, 0xbe, 0xef}; + +const static uint8_t valid_digest[] = {0x5f, 0x78, 0xc3, 0x32, 0x74, 0xe4, 0x3f, 0xa9, + 0xde, 0x56, 0x59, 0x26, 0x5c, 0x1d, 0x91, 0x7e, + 0x25, 0xc0, 0x37, 0x22, 0xdc, 0xb0, 0xb8, 0xd2, + 0x7d, 0xb8, 0xd5, 0xfe, 0xaa, 0x81, 0x39, 0x53}; + +const static uint8_t invalid_digest[] = {0x5f, 0x78, 0xc3, 0x32, 0x74, 0xe4, 0x3f, 0xa9, + 0xde, 0x56, 0x59, 0x26, 0x5c, 0x1d, 0x91, 0x7e, + 0x25, 0xc0, 0x37, 0x22, 0xdc, 0xb0, 0xb8, 0xd2, + 0x7d, 0xb8, 0xd5, 0xfe, 0xaa, 0x81, 0x39, 0x54}; + +static const psa_algorithm_t valid_algorithm = PSA_ALG_SHA_256; +static const psa_algorithm_t invalid_algorithm = (psa_algorithm_t)0; + +ZTEST_SUITE(digest_sink_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(digest_sink_tests, test_digest_sink_get_OK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, valid_algorithm, valid_digest); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.release(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); +} + +ZTEST(digest_sink_tests, test_digest_sink_get_NOK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(NULL, valid_algorithm, valid_digest); + + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_digest_sink_get should have failed - sink == null"); + + err = suit_digest_sink_get(&digest_sink, valid_algorithm, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_digest_sink_get should have failed - digest == null"); + + err = suit_digest_sink_get(&digest_sink, invalid_algorithm, valid_digest); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_digest_sink_get should have failed - invalid algorithm"); +} + +ZTEST(digest_sink_tests, test_digest_sink_get_out_of_contexts) +{ + struct stream_sink digest_sinks[CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT + 1]; + suit_plat_err_t err; + + for (size_t i = 0; i < CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT; i++) { + err = suit_digest_sink_get(&digest_sinks[i], valid_algorithm, valid_digest); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + } + + err = suit_digest_sink_get(&digest_sinks[CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT], + valid_algorithm, valid_digest); + + zassert_equal(err, SUIT_PLAT_ERR_NO_RESOURCES, "Unexpected error code"); + + for (size_t i = 0; i < CONFIG_SUIT_STREAM_SINK_DIGEST_CONTEXT_COUNT; i++) { + err = digest_sinks[i].release(digest_sinks[i].ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); + } +} + +ZTEST(digest_sink_tests, test_digest_sink_write_NOK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, valid_algorithm, valid_digest); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.write(NULL, valid_payload, sizeof(valid_payload)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "digest_sink.write should have failed - ctx == NULL"); + + err = digest_sink.write(digest_sink.ctx, NULL, sizeof(valid_payload)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "digest_sink.write should have failed - payload == NULL"); + + err = digest_sink.write(digest_sink.ctx, valid_payload, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "digest_sink.write should have failed - size == 0"); + + err = digest_sink.release(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); + + err = digest_sink.write(digest_sink.ctx, valid_payload, sizeof(valid_payload)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "digest_sink.write should have failed - ctx released"); +} + +ZTEST(digest_sink_tests, test_digest_sink_match_OK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, valid_algorithm, valid_digest); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.write(digest_sink.ctx, valid_payload, sizeof(valid_payload)); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = suit_digest_sink_digest_match(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.release(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); +} + +ZTEST(digest_sink_tests, test_digest_sink_match_NOK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, valid_algorithm, valid_digest); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.write(digest_sink.ctx, valid_payload, sizeof(valid_payload)); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = suit_digest_sink_digest_match(NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_digest_sink_digest_match should have failed - ctx == NULL"); + + err = digest_sink.release(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); + + err = suit_digest_sink_digest_match(digest_sink.ctx); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_digest_sink_digest_match should have failed - ctx released"); +} + +ZTEST(digest_sink_tests, test_digest_sink_release_NOK) +{ + struct stream_sink digest_sink; + + suit_plat_err_t err = suit_digest_sink_get(&digest_sink, valid_algorithm, invalid_digest); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + + err = digest_sink.release(NULL); + zassert_equal(err, SUIT_PLAT_ERR_INVAL, "Unexpected error code"); + + err = digest_sink.release(digest_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "digest_sink.release failed - error %i", err); +} diff --git a/tests/subsys/suit/digest_sink/testcase.yaml b/tests/subsys/suit/digest_sink/testcase.yaml new file mode 100644 index 000000000000..578579bf078f --- /dev/null +++ b/tests/subsys/suit/digest_sink/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.integration.digest_sink: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit suit_digest_sink + timeout: 240 + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/envelope_decoder/CMakeLists.txt b/tests/subsys/suit/envelope_decoder/CMakeLists.txt new file mode 100644 index 000000000000..3780a533ee39 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2022 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(integration_test_envelope_decoder) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/envelope_decoder/boards/native_posix.conf b/tests/subsys/suit/envelope_decoder/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/envelope_decoder/boards/native_posix.overlay b/tests/subsys/suit/envelope_decoder/boards/native_posix.overlay new file mode 100644 index 000000000000..a55032502da4 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/boards/native_posix.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 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)>; + }; + + /* Use the second half of NVM as DFU partition. */ + dfu_partition: partition@80000 { + reg = <0x80000 DT_SIZE_K(472)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/envelope_decoder/boards/native_posix_64.conf b/tests/subsys/suit/envelope_decoder/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/envelope_decoder/boards/native_posix_64.overlay b/tests/subsys/suit/envelope_decoder/boards/native_posix_64.overlay new file mode 100644 index 000000000000..a55032502da4 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/boards/native_posix_64.overlay @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2022 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)>; + }; + + /* Use the second half of NVM as DFU partition. */ + dfu_partition: partition@80000 { + reg = <0x80000 DT_SIZE_K(472)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/envelope_decoder/prj.conf b/tests/subsys/suit/envelope_decoder/prj.conf new file mode 100644 index 000000000000..d5916a09f8b7 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/prj.conf @@ -0,0 +1,47 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_LOG_LEVEL_DBG=y + +CONFIG_SUIT_DEVCONFIG=y +CONFIG_SUIT_STORAGE=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_MCI_IMPL_CUSTOM=y +CONFIG_SUIT_METADATA=y +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_PLAT_CHECK_CLASSES=y +CONFIG_SUIT_AUTHENTICATE=y + +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y + +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y + +CONFIG_SUIT_EXECUTION_MODE=y diff --git a/tests/subsys/suit/envelope_decoder/src/main.c b/tests/subsys/suit/envelope_decoder/src/main.c new file mode 100644 index 000000000000..bd5326003ef3 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/src/main.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define DFU_PARTITION_ADDRESS (suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET)) +#define DFU_PARTITION_OFFSET ((size_t)FIXED_PARTITION_OFFSET(dfu_partition)) +#define DFU_PARTITION_SIZE ((size_t)FIXED_PARTITION_SIZE(dfu_partition)) + +static void *test_suit_setup(void) +{ + int err = suit_storage_init(); + + zassert_equal(err, 0, "Unable to initialize storage module"); + + err = suit_mci_init(); + zassert_equal(err, 0, "Unable to initialize MCI module"); + + err = suit_processor_init(); + zassert_equal(err, 0, "Unable to initialise SUIT processor (err: %d)", err); + + return NULL; +} + +ZTEST_SUITE(envelope_decoder, NULL, test_suit_setup, NULL, NULL, NULL); + +ZTEST(envelope_decoder, test_get_manifest_authenticated_metadata) +{ + int err = suit_processor_get_manifest_metadata(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE, + false, NULL, NULL, NULL, NULL); + + zassert_equal(err, 0, "Reading authenticated envelope failed (err: %d)", err); +} + +ZTEST(envelope_decoder, test_get_manifest_unauthenticated_metadata) +{ + int err = suit_processor_get_manifest_metadata(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE, + true, NULL, NULL, NULL, NULL); + + zassert_equal(err, 0, "Reading unauthenticated envelope failed (err: %d)", err); +} + +ZTEST(envelope_decoder, test_process_sequence_parse) +{ + int err = suit_process_sequence(DFU_PARTITION_ADDRESS, DFU_PARTITION_SIZE, SUIT_SEQ_PARSE); + + zassert_equal(err, 0, "Parsing SUIT envelope failed (err: %d)", err); +} diff --git a/tests/subsys/suit/envelope_decoder/testcase.yaml b/tests/subsys/suit/envelope_decoder/testcase.yaml new file mode 100644 index 000000000000..249c06a87084 --- /dev/null +++ b/tests/subsys/suit/envelope_decoder/testcase.yaml @@ -0,0 +1,5 @@ +tests: + suit-processor.integration.envelope_decoder: + platform_allow: native_posix native_posix/native/64 + build_only: true + tags: suit-processor envelope-decoder diff --git a/tests/subsys/suit/execution_mode/CMakeLists.txt b/tests/subsys/suit/execution_mode/CMakeLists.txt new file mode 100644 index 000000000000..01ccccfe68ca --- /dev/null +++ b/tests/subsys/suit/execution_mode/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# 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(integration_test_suit_execution_mode) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/execution_mode/prj.conf b/tests/subsys/suit/execution_mode/prj.conf new file mode 100644 index 000000000000..b9303b49d890 --- /dev/null +++ b/tests/subsys/suit/execution_mode/prj.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_EXECUTION_MODE=y diff --git a/tests/subsys/suit/execution_mode/src/main.c b/tests/subsys/suit/execution_mode/src/main.c new file mode 100644 index 000000000000..08c255206c2f --- /dev/null +++ b/tests/subsys/suit/execution_mode/src/main.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +ZTEST_SUITE(suit_execution_mode_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_execution_mode_tests, test_suit_execution_mode_get_before_set) +{ + suit_execution_mode_t mode = suit_execution_mode_get(); + + zassert_equal(mode, EXECUTION_MODE_STARTUP, + "suit_execution_mode_get returned unexpected value: %i", mode); +} + +ZTEST(suit_execution_mode_tests, test_suit_execution_mode_set_NOK) +{ + suit_plat_err_t err = suit_execution_mode_set(EXECUTION_MODE_STARTUP - 1); + + zassert_equal(err, SUIT_PLAT_ERR_INVAL, + "suit_execution_mode_set should have failed - invalid input"); + + err = suit_execution_mode_set(EXECUTION_MODE_FAIL_MPI_UNSUPPORTED + 1); + zassert_equal(err, SUIT_PLAT_ERR_INVAL, + "suit_execution_mode_set should have failed - invalid input"); +} + +ZTEST(suit_execution_mode_tests, test_suit_execution_mode_set_OK) +{ + suit_plat_err_t err = suit_execution_mode_set(EXECUTION_MODE_INVOKE); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_execution_mode_set failed: %i", err); + + suit_execution_mode_t mode = suit_execution_mode_get(); + + zassert_equal(mode, EXECUTION_MODE_INVOKE, + "suit_execution_mode_get returned unexpected value: %i", mode); +} diff --git a/tests/subsys/suit/execution_mode/testcase.yaml b/tests/subsys/suit/execution_mode/testcase.yaml new file mode 100644 index 000000000000..de5de1011a0c --- /dev/null +++ b/tests/subsys/suit/execution_mode/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.common.execution_mode: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform suit_execution_mode + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/fetch/CMakeLists.txt b/tests/subsys/suit/fetch/CMakeLists.txt new file mode 100644 index 000000000000..b7545f8f23b0 --- /dev/null +++ b/tests/subsys/suit/fetch/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 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(integration_test_fetch) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_memptr_storage_interface) +zephyr_library_link_libraries(suit_platform_interface) diff --git a/tests/subsys/suit/fetch/prj.conf b/tests/subsys/suit/fetch/prj.conf new file mode 100644 index 000000000000..9bca7c560bef --- /dev/null +++ b/tests/subsys/suit/fetch/prj.conf @@ -0,0 +1,24 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/fetch/src/main.c b/tests/subsys/suit/fetch/src/main.c new file mode 100644 index 000000000000..077b6feb7689 --- /dev/null +++ b/tests/subsys/suit/fetch/src/main.c @@ -0,0 +1,284 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +#define TEST_DATA_SIZE 64 +#define WRITE_ADDR 0x1A00080000 + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +/* + * { + * "http://source1.com": h'4235623423462346456234623487723572702975', + * "http://source2.com.no": h'25672519384710', + * "ftp://altsource.com": h'92384859284720' + * } + */ +static const uint8_t cache[] = { + 0xBF, 0x72, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, + 0x31, 0x2E, 0x63, 0x6F, 0x6D, 0x54, 0x42, 0x35, 0x62, 0x34, 0x23, 0x46, 0x23, 0x46, 0x45, + 0x62, 0x34, 0x62, 0x34, 0x87, 0x72, 0x35, 0x72, 0x70, 0x29, 0x75, 0x75, 0x68, 0x74, 0x74, + 0x70, 0x3A, 0x2F, 0x2F, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x32, 0x2E, 0x63, 0x6F, 0x6D, + 0x2E, 0x6E, 0x6F, 0x47, 0x25, 0x67, 0x25, 0x19, 0x38, 0x47, 0x10, 0x73, 0x66, 0x74, 0x70, + 0x3A, 0x2F, 0x2F, 0x61, 0x6C, 0x74, 0x73, 0x6F, 0x75, 0x72, 0x63, 0x65, 0x2E, 0x63, 0x6F, + 0x6D, 0x47, 0x92, 0x38, 0x48, 0x59, 0x28, 0x47, 0x20, 0xFF}; +static const size_t cache_len = sizeof(cache); + +/* + * { + * "http://databucket.com": h'4360021135853785764409444542662512368400086117', + * "http://storagehole.com": h'053714514299994946548928821768209760220451452304', + * "#file.bin": h'12358902317049812091623890476012378490701892365192830986701923' + * } + */ +static const uint8_t cache2[] = { + 0xA3, 0x75, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x75, 0x63, 0x6B, 0x65, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x57, 0x43, 0x60, 0x02, 0x11, + 0x35, 0x85, 0x37, 0x85, 0x76, 0x44, 0x09, 0x44, 0x45, 0x42, 0x66, 0x25, 0x12, 0x36, + 0x84, 0x00, 0x08, 0x61, 0x17, 0x76, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x73, + 0x74, 0x6F, 0x72, 0x61, 0x67, 0x65, 0x68, 0x6F, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, + 0x58, 0x18, 0x05, 0x37, 0x14, 0x51, 0x42, 0x99, 0x99, 0x49, 0x46, 0x54, 0x89, 0x28, + 0x82, 0x17, 0x68, 0x20, 0x97, 0x60, 0x22, 0x04, 0x51, 0x45, 0x23, 0x04, 0x69, 0x23, + 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, 0x6E, 0x58, 0x1F, 0x12, 0x35, 0x89, 0x02, + 0x31, 0x70, 0x49, 0x81, 0x20, 0x91, 0x62, 0x38, 0x90, 0x47, 0x60, 0x12, 0x37, 0x84, + 0x90, 0x70, 0x18, 0x92, 0x36, 0x51, 0x92, 0x83, 0x09, 0x86, 0x70, 0x19, 0x23}; +static const size_t cache2_len = sizeof(cache2); + +static void setup_cache_with_sample_entries(void) +{ + struct dfu_cache dfu_caches; + + zassert_between_inclusive(2, 1, CONFIG_SUIT_CACHE_MAX_CACHES, + "Failed to prepare test fixture: cache istoo small"); + + dfu_caches.pools[0].address = (uint8_t *)cache; + dfu_caches.pools[0].size = (size_t)cache_len; + + dfu_caches.pools[1].address = (uint8_t *)cache2; + dfu_caches.pools[1].size = (size_t)cache2_len; + dfu_caches.pools_count = 2; + + suit_plat_err_t rc = suit_dfu_cache_initialize(&dfu_caches); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Failed to initialize cache: %i", rc); +} + +ZTEST_SUITE(fetch_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(fetch_tests, test_integrated_fetch_to_memptr_OK) +{ + suit_component_t component_handle; + memptr_storage_handle_t handle = NULL; + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(component_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_component_impl_data_get(component_handle, &handle); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_component_impl_data_get failed - error %i", + ret); + + const uint8_t *payload; + size_t payload_size = 0; + + ret = suit_memptr_storage_ptr_get(handle, &payload, &payload_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "storage.get failed - error %i", ret); + zassert_equal(test_data, payload, "Retrieved payload doesn't mach test_data"); + zassert_equal(sizeof(test_data), payload_size, + "Retrieved payload_size doesn't mach size of test_data"); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); +} + +ZTEST(fetch_tests, test_fetch_to_memptr_OK) +{ + suit_component_t component_handle; + struct zcbor_string uri = {.value = "http://databucket.com", + .len = sizeof("http://databucket.com")}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + setup_cache_with_sample_entries(); + + ret = suit_plat_fetch(component_handle, &uri); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); + + suit_dfu_cache_deinitialize(); +} + +ZTEST(fetch_tests, test_fetch_to_memptr_NOK_uri_not_in_cache) +{ + suit_component_t component_handle; + struct zcbor_string uri = {.value = "http://databucket.no", + .len = sizeof("http://databucket.no")}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + setup_cache_with_sample_entries(); + + ret = suit_plat_fetch(component_handle, &uri); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_fetch should fail - supplied uri is not in cache", ret); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); + + suit_dfu_cache_deinitialize(); +} + +ZTEST(fetch_tests, test_fetch_to_memptr_NOK_invalid_component_id) +{ + suit_component_t component_handle; + struct zcbor_string uri = {.value = "http://databucket.com", + .len = sizeof("http://databucket.com")}; + /* [h'MEM', h'01', h'1A00080000', h'08'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x01, + 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x08}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + setup_cache_with_sample_entries(); + + ret = suit_plat_fetch(component_handle, &uri); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_fetch should have failed - invalid component_id"); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); + + suit_dfu_cache_deinitialize(); +} + +ZTEST(fetch_tests, test_integrated_fetch_to_memptr_NOK_data_ptr_NULL) +{ + suit_component_t component_handle; + struct zcbor_string source = {.value = NULL, .len = sizeof(test_data)}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(component_handle, &source); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_fetch should have failed - NULL data pointer"); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); +} + +ZTEST(fetch_tests, test_integrated_fetch_to_memptr_NOK_data_size_zero) +{ + suit_component_t component_handle; + struct zcbor_string source = {.value = test_data, .len = 0}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(component_handle, &source); + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_fetch should have failed - data size 0"); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); +} + +ZTEST(fetch_tests, test_integrated_fetch_to_memptr_NOK_handle_NULL) +{ + suit_component_t component_handle; + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &component_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_fetch_integrated(component_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_fetch failed - error %i", ret); + + const uint8_t *payload; + size_t payload_size = 0; + + ret = suit_memptr_storage_ptr_get(NULL, &payload, &payload_size); + zassert_not_equal(ret, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_get should failed - handle NULL"); + + ret = suit_plat_release_component_handle(component_handle); + zassert_equal(ret, SUIT_SUCCESS, "Handle release failed - error %i", ret); +} diff --git a/tests/subsys/suit/fetch/testcase.yaml b/tests/subsys/suit/fetch/testcase.yaml new file mode 100644 index 000000000000..1979604215d2 --- /dev/null +++ b/tests/subsys/suit/fetch/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit-platform.integration.fetch: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix + - native_posix/native/64 diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/CMakeLists.txt b/tests/subsys/suit/fetch_integrated_payload_flash/CMakeLists.txt new file mode 100644 index 000000000000..0c5da1eeeb4e --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2022 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(integration_test_fetch_integrated_payload_flash) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix.conf b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/fetch_integrated_payload_flash/boards/native_posix.overlay b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix.overlay new file mode 100644 index 000000000000..8e0acfe05a16 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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/fetch_integrated_payload_flash/boards/native_posix_64.conf b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/fetch_integrated_payload_flash/boards/native_posix_64.overlay b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix_64.overlay new file mode 100644 index 000000000000..8e0acfe05a16 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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/fetch_integrated_payload_flash/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/fetch_integrated_payload_flash/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..e796eb83bd34 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 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/fetch_integrated_payload_flash/manifest/manifest_52.yaml b/tests/subsys/suit/fetch_integrated_payload_flash/manifest/manifest_52.yaml new file mode 100644 index 000000000000..fb123fff7ae1 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/manifest/manifest_52.yaml @@ -0,0 +1,99 @@ +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: + - - MEM + - 0x00 + - 0x80000 + - 0x1000 + - - CAND_IMG + - 0 + suit-shared-sequence: + - suit-directive-set-component-index: 0 # Only MEM + - suit-directive-override-parameters: + suit-parameter-vendor-identifier: + RFC4122_UUID: nordicsemi.com + suit-parameter-class-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + 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-directive-set-component-index: true # For all + - suit-directive-override-parameters: + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: "file.bin" + + suit-validate: + - suit-directive-set-component-index: 0 + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + + suit-invoke: + - suit-directive-set-component-index: 0 + - suit-directive-invoke: + - suit-send-record-failure + + suit-install: + - suit-directive-set-component-index: 1 + - 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-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-source-component: 1 + - suit-directive-copy: + - 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/manifest/manifest_54.yaml b/tests/subsys/suit/fetch_integrated_payload_flash/manifest/manifest_54.yaml new file mode 100644 index 000000000000..800ab28df402 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/manifest/manifest_54.yaml @@ -0,0 +1,99 @@ +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: + - - MEM + - 0x00 + - 0x0E0AA000 + - 0x0007f800 + - - CAND_IMG + - 0 + suit-shared-sequence: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-vendor-identifier: + RFC4122_UUID: nordicsemi.com + suit-parameter-class-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + 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-directive-set-component-index: true + - suit-directive-override-parameters: + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: "file.bin" + + suit-validate: + - suit-directive-set-component-index: 0 + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + + suit-invoke: + - suit-directive-set-component-index: 0 + - suit-directive-invoke: + - suit-send-record-failure + + suit-install: + - suit-directive-set-component-index: 1 + - 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-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-source-component: 1 + - suit-directive-copy: + - 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 235577344, 522240]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf b/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf new file mode 100644 index 000000000000..6075a5bd01ae --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/prj.conf @@ -0,0 +1,45 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_LOG_LEVEL_DBG=y + +CONFIG_SUIT_DEVCONFIG=y +CONFIG_SUIT_STORAGE=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_MCI_IMPL_CUSTOM=y +CONFIG_SUIT_METADATA=y +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_PLAT_CHECK_CLASSES=y +CONFIG_SUIT_AUTHENTICATE=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y + +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y + +CONFIG_SUIT_EXECUTION_MODE=y diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/src/main.c b/tests/subsys/suit/fetch_integrated_payload_flash/src/main.c new file mode 100644 index 000000000000..69eeb5cfadf3 --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/src/main.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#include +#include +#include +#include + +#ifdef CONFIG_ARCH_POSIX +#include +#define SOC_NV_FLASH_NODE DT_CHILD(DT_INST(0, zephyr_sim_flash), flash_0) +#define FLASH_SIMULATOR_BASE_OFFSET DT_REG_ADDR(SOC_NV_FLASH_NODE) +#define FLASH_SIMULATOR_FLASH_SIZE DT_REG_SIZE(SOC_NV_FLASH_NODE) +#endif /* CONFIG_ARCH_POSIX */ + +/* The SUIT envelope is defined inside the board-specific manfest_*.c file. */ +extern uint8_t manifest_buf[]; +extern const size_t manifest_len; + +static void *test_suit_setup(void) +{ + int err = suit_mci_init(); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unable to initialize MCI module"); + +#ifdef CONFIG_ARCH_POSIX + static const struct device *const flash_dev = + DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); + + err = flash_erase(flash_dev, FLASH_SIMULATOR_BASE_OFFSET, FLASH_SIMULATOR_FLASH_SIZE); + zassert_equal(0, err, "Unable to erase flash area before test execution"); +#endif /* CONFIG_ARCH_POSIX */ + + return NULL; +} + +ZTEST_SUITE(fetch_integrated_payload_flash_tests, NULL, test_suit_setup, NULL, NULL, NULL); + +/** @brief Authenticate, validate and execute all command sequences from the sample SUIT envelope. + * + * @details The main purpose of this test is to give an entry point for SUIT processor platform + * implementation. If the platform design requires it, please update the envelope payload, defined + * at the beginning of this file. + */ +ZTEST(fetch_integrated_payload_flash_tests, test_suit_process) +{ + int err = SUIT_SUCCESS; + + err = suit_processor_init(); + zassert_equal(err, SUIT_SUCCESS, "Unable to initialise SUIT processor (err: %d)", err); + + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init suit storage (%d)", err); + + err = suit_process_sequence(manifest_buf, manifest_len, SUIT_SEQ_PARSE); + zassert_equal(err, SUIT_SUCCESS, "Parsing SUIT envelope failed (err: %d)", err); + + for (enum suit_command_sequence i = SUIT_SEQ_PARSE + 1; + (i < SUIT_SEQ_MAX) && (err == SUIT_SUCCESS); i++) { + err = suit_process_sequence(manifest_buf, manifest_len, i); + if (err == SUIT_ERR_UNAVAILABLE_COMMAND_SEQ) { + err = SUIT_SUCCESS; + } + zassert_equal(err, SUIT_SUCCESS, "Processing SUIT sequence %d failed with error %i", + i, err); + } +} 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 new file mode 100644 index 000000000000..0c4aba744b2b --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_52.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include + +/** @brief SUIT envelope generated using the manifest/manifest_52.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, + 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x0E, 0x19, 0x01, 0x00, 0x01, 0x0F, 0x02, 0x0F, + 0x0C, 0xF5, 0x14, 0xA1, 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, 0x07, 0x45, + 0x84, 0x0C, 0x00, 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x00, 0x17, 0x02, 0x11, 0x58, 0x1E, + 0x90, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, 0x62, 0x69, + 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x0C, 0x00, 0x14, 0xA1, 0x16, 0x01, 0x16, 0x02, 0x03, 0x0F, + 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD0, 0x80, 0xD7, 0xEE, 0x16, 0x27, 0x88, 0xBD, 0xF7, 0x43, + 0x28, 0xC8, 0xC6, 0xD7, 0xA8, 0x86, 0xA4, 0xB4, 0x59, 0x83, 0x28, 0xFE, 0xA2, 0xD9, 0xAB, + 0xC3, 0x21, 0xDC, 0xB5, 0x5E, 0xC5, 0x1B, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, + 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, + 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, + 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, + 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, + 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, + 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, + 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_buf); +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..8b7c8b55d11d --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/src/manifest_54.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include + +/** @brief SUIT envelope generated using the manifest/manifest_54.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, + 0x00, 0x14, 0xA3, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, + 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, + 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x0E, 0x19, 0x01, 0x00, 0x01, 0x0F, + 0x02, 0x0F, 0x0C, 0xF5, 0x14, 0xA1, 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, + 0x07, 0x45, 0x84, 0x0C, 0x00, 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x00, 0x17, 0x02, 0x11, + 0x58, 0x1E, 0x90, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x0C, 0x00, 0x14, 0xA1, 0x16, 0x01, 0x16, 0x02, + 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x37, 0xD1, 0xAD, 0xE5, 0x6F, 0xDF, 0xE8, 0xA1, + 0xDC, 0x0A, 0x40, 0xB4, 0x16, 0xE7, 0xD7, 0xE1, 0xE0, 0xA1, 0x85, 0xB7, 0x10, 0x73, 0xA4, + 0xC2, 0x89, 0xC3, 0x81, 0x07, 0x28, 0xBB, 0x4F, 0x57, 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, 0x17, 0x58, 0x88, 0xA1, + 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, + 0x0A, 0xA0, 0x00, 0x45, 0x1A, 0x00, 0x07, 0xF8, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, + 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, + 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, + 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, + 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, + 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, + 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_buf); +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/fetch_integrated_payload_flash/testcase.yaml b/tests/subsys/suit/fetch_integrated_payload_flash/testcase.yaml new file mode 100644 index 000000000000..005ca7828ace --- /dev/null +++ b/tests/subsys/suit/fetch_integrated_payload_flash/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-processor.integration.fetch_integrated_payload_flash: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor integrated-payload fetch MRAM + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/fetch_source_mgr/CMakeLists.txt b/tests/subsys/suit/fetch_source_mgr/CMakeLists.txt new file mode 100644 index 000000000000..253a75add9b6 --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(platform_test) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sources_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/fetch_source_mgr/prj.conf b/tests/subsys/suit/fetch_source_mgr/prj.conf new file mode 100644 index 000000000000..0f907a404d78 --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/prj.conf @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SOURCE_IPC=y +CONFIG_SUIT_STREAM_IPC_REQUESTOR=y +CONFIG_SUIT_STREAM_IPC_PROVIDER=y +CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/fetch_source_mgr/src/full_stack_test.c b/tests/subsys/suit/fetch_source_mgr/src/full_stack_test.c new file mode 100644 index 000000000000..0917f1d5e6e7 --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/src/full_stack_test.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include +#include + +static uint32_t received_bytes; +static uint32_t received_checksum; +static uint32_t expected_bytes; +static uint32_t expected_checksum; + +/* Intentionally missaligned buffer size + */ +static uint8_t test_buf[32 * 1024 - 3]; +#define ITERATIONS 16 + +static const char *requested_resource_id = "ExampleImageName.img"; +static void *stream_sink_requested_ctx = (void *)0xabcd0001; + +static K_SEM_DEFINE(delay_simulator_sem_1, 0, 1); +static K_SEM_DEFINE(delay_simulator_sem_2, 0, 1); +static suit_plat_err_t ipc_stream_write_chunk(void *ctx, const uint8_t *buf, size_t size) +{ + received_bytes += size; + + for (int i = 0; i < size; ++i) { + received_checksum += buf[i]; + } + + /* let's simulate 10 ms lasting operation. + * cannot use k_sleep in posix tests! + */ + k_sem_take(&delay_simulator_sem_1, K_MSEC(10)); + return SUIT_PLAT_SUCCESS; +} + +typedef struct { + size_t chunk_size; + uint32_t sleep_ms; + +} access_pattern_t; + +int fetch_request_fn(const uint8_t *uri, size_t uri_length, uint32_t session_id) +{ + zassert_equal(uri_length, strlen(requested_resource_id), "uri_length (%d)", uri_length); + zassert_mem_equal(uri, requested_resource_id, strlen(requested_resource_id)); + + access_pattern_t ap_table[] = { + {.chunk_size = 16000, .sleep_ms = 40}, {.chunk_size = 3, .sleep_ms = 10}, + {.chunk_size = 7000, .sleep_ms = 50}, {.chunk_size = 120, .sleep_ms = 10}, + {.chunk_size = 8192, .sleep_ms = 100}, {.chunk_size = 4096, .sleep_ms = 200}, + {.chunk_size = 4096, .sleep_ms = 10}, {.chunk_size = 4096, .sleep_ms = 10}}; + + int rc = 0; + int pattern_idx = 0; + + for (int buf_iter = 0; buf_iter < ITERATIONS; buf_iter++) { + + size_t offset_in_buffer = 0; + + while (offset_in_buffer < sizeof(test_buf)) { + access_pattern_t *ap = &ap_table[pattern_idx]; + + size_t to_be_copied = sizeof(test_buf) - offset_in_buffer; + + if (ap->chunk_size < to_be_copied) { + to_be_copied = ap->chunk_size; + } + + rc = suit_dfu_fetch_source_write_fetched_data( + session_id, test_buf + offset_in_buffer, to_be_copied); + if (rc != 0) { + return SUIT_PLAT_ERR_CRASH; + } + + offset_in_buffer += to_be_copied; + + /* cannot use k_sleep in posix tests! + */ + k_sem_take(&delay_simulator_sem_2, K_MSEC(ap->sleep_ms)); + + pattern_idx++; + pattern_idx = pattern_idx % (sizeof(ap_table) / sizeof(access_pattern_t)); + } + } + + return 0; +} + +void test_full_stack(void) +{ + + for (int i = 0; i < sizeof(test_buf); ++i) { + test_buf[i] = (uint8_t)i; + } + + for (int buf_iter = 0; buf_iter < ITERATIONS; buf_iter++) { + + for (int i = 0; i < sizeof(test_buf); ++i) { + expected_bytes++; + expected_checksum += test_buf[i]; + } + } + + suit_ipc_streamer_chunk_status_evt_unsubscribe(); + suit_ipc_streamer_missing_image_evt_unsubscribe(); + + suit_plat_err_t rc = SUIT_PLAT_SUCCESS; + + rc = suit_ipc_streamer_provider_init(); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_ipc_streamer_provider_init returned (%d)", rc); + + rc = suit_dfu_fetch_source_register(fetch_request_fn); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "fetch_source_register returned (%d)", rc); + + struct stream_sink test_sink = { + .write = ipc_stream_write_chunk, + .seek = NULL, + .flush = NULL, + .used_storage = NULL, + .release = NULL, + .ctx = stream_sink_requested_ctx, + }; + + uint32_t inter_chunk_timeout_ms = 10000; + uint32_t requesting_period_ms = 1000; + + rc = suit_ipc_streamer_stream(requested_resource_id, strlen(requested_resource_id), + &test_sink, inter_chunk_timeout_ms, requesting_period_ms); + + zassert_equal(expected_bytes, received_bytes, "%d vs %d", expected_bytes, received_bytes); + zassert_equal(expected_checksum, received_checksum, "%d vs %d", expected_checksum, + received_checksum); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_ipc_streamer_stream returned (%d)", rc); +} diff --git a/tests/subsys/suit/fetch_source_mgr/src/main.c b/tests/subsys/suit/fetch_source_mgr/src/main.c new file mode 100644 index 000000000000..2dce3aff0e87 --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/src/main.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include + +void test_ipc_streamer_requestor_no_response(void); +void test_ipc_streamer_requestor(void); +void test_full_stack(void); + +ZTEST_SUITE(test_fetch_source_mgr, NULL, NULL, NULL, NULL, NULL); + +ZTEST(test_fetch_source_mgr, test_ipc_streamer_requestor_no_response) +{ + test_ipc_streamer_requestor_no_response(); +} + +ZTEST(test_fetch_source_mgr, test_ipc_streamer_requestor) +{ + test_ipc_streamer_requestor(); +} + +ZTEST(test_fetch_source_mgr, test_full_stack) +{ + test_full_stack(); +} diff --git a/tests/subsys/suit/fetch_source_mgr/src/no_response_test.c b/tests/subsys/suit/fetch_source_mgr/src/no_response_test.c new file mode 100644 index 000000000000..32598e9a7906 --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/src/no_response_test.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include + +static uint32_t write_chunk_count; +static uint32_t missing_image_notify_count; + +static const char *requested_resource_id = "ExampleImageName.img"; +static void *stream_sink_requested_ctx = (void *)0xabcd0001; +static void *missing_image_notify_requested_ctx = (void *)0xabcd0002; + +static suit_plat_err_t ipc_stream_write_chunk(void *ctx, const uint8_t *buf, size_t size) +{ + write_chunk_count++; + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t missing_image_notify_fn(const uint8_t *resource_id, + size_t resource_id_length, + uint32_t stream_session_id, void *context) +{ + zassert_equal(context, missing_image_notify_requested_ctx, + "missing_image_notify_fn context (%08x)", context); + zassert_equal(resource_id_length, strlen(requested_resource_id), "resource_id_length (%d)", + resource_id_length); + zassert_mem_equal(resource_id, requested_resource_id, strlen(requested_resource_id)); + + missing_image_notify_count++; + return SUIT_PLAT_SUCCESS; +} + +void test_ipc_streamer_requestor_no_response(void) +{ + + struct stream_sink test_sink = { + .write = ipc_stream_write_chunk, + .seek = NULL, + .flush = NULL, + .used_storage = NULL, + .release = NULL, + .ctx = stream_sink_requested_ctx, + }; + + uint32_t inter_chunk_timeout_ms = 10000; + uint32_t requesting_period_ms = 1000; + int rc = 0; + + suit_ipc_streamer_missing_image_evt_unsubscribe(); + rc = suit_ipc_streamer_missing_image_evt_subscribe(missing_image_notify_fn, + missing_image_notify_requested_ctx); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_ipc_streamer_missing_image_evt_subscribe returned (%d)", rc); + + rc = suit_ipc_streamer_stream(requested_resource_id, strlen(requested_resource_id), + &test_sink, inter_chunk_timeout_ms, requesting_period_ms); + zassert_equal(rc, SUIT_PLAT_ERR_TIME, "suit_ipc_streamer_stream returned (%d)", rc); + zassert_equal(write_chunk_count, 0, "write_chunk_count (%d)", write_chunk_count); + + /* taking requesting_period_ms = 1s and inter_chunk_timeout_ms = 10s + * ~10 missing_image_notify_fn() calls is expected. + */ + zassert_between_inclusive(missing_image_notify_count, 9, 11, + "missing_image_notify_count (%d)", missing_image_notify_count); +} diff --git a/tests/subsys/suit/fetch_source_mgr/src/requestor_test.c b/tests/subsys/suit/fetch_source_mgr/src/requestor_test.c new file mode 100644 index 000000000000..992cda58734f --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/src/requestor_test.c @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include + +static K_THREAD_STACK_DEFINE(injector_stack, 1024); +static struct k_thread injector_thread; +#define INJECTOR_THREAD_PRIORITY 5 + +static uint32_t missing_image_notify_count; + +static const char *requested_resource_id = "ExampleImageName.img"; +static void *stream_sink_requested_ctx = (void *)0xabcd0001; +static void *missing_image_notify_requested_ctx = (void *)0xabcd0002; +static void *chunk_status_notify_requested_ctx = (void *)0xabcd0003; + +/* Intentionally missaligned buffer size + */ +static uint8_t test_buf[32 * 1024 - 3]; +#define ITERATIONS 16 + +static uint32_t received_bytes; +static uint32_t received_checksum; +static uint32_t expected_bytes; +static uint32_t expected_checksum; + +#define BUFFER_SIZE 2048 +#define BUFFER_COUNT 3 + +typedef enum { + FREE = 0, + READY_TO_ENQUEUE = 1, + ENQUEUED = 2 +} buffer_state_t; + +typedef struct { + buffer_state_t buffer_state; + uint32_t offset_in_image; + uint32_t chunk_size; + uint32_t chunk_id; +} buffer_metadata_t; + +typedef struct { + buffer_metadata_t buffer_metadata[BUFFER_COUNT]; + uint8_t buffer[BUFFER_COUNT][BUFFER_SIZE]; +} buffer_info_t; + +typedef struct { + uint32_t stream_session_id; + size_t current_image_offset; + size_t requested_image_offset; + uint32_t last_chunk_id; + buffer_info_t buffer_info; +} image_request_info_t; + +static K_SEM_DEFINE(chunk_status_changed_sem, 0, 1); +static image_request_info_t request_info; + +static bool chunk_released_check(image_request_info_t *ri, + suit_ipc_streamer_chunk_info_t *injected_chunks, + size_t chunk_info_count) +{ + bool chunk_released = false; + + for (int i = 0; i < BUFFER_COUNT; i++) { + buffer_metadata_t *bm = &ri->buffer_info.buffer_metadata[i]; + + if (bm->buffer_state == ENQUEUED) { + bool still_enqueued = false; + + for (int j = 0; j < chunk_info_count; j++) { + suit_ipc_streamer_chunk_info_t *ci = &injected_chunks[j]; + + if (ci->chunk_id == bm->chunk_id && ci->status == PENDING) { + still_enqueued = true; + break; + } + } + + if (!still_enqueued) { + bm->buffer_state = FREE; + chunk_released = true; + } + } + } + + return chunk_released; +} + +static suit_plat_err_t wait_for_buffer_state_change(image_request_info_t *ri) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + suit_ipc_streamer_chunk_info_t injected_chunks[BUFFER_COUNT]; + size_t chunk_info_count = BUFFER_COUNT; + + while (true) { + err = suit_ipc_streamer_chunk_status_req(ri->stream_session_id, injected_chunks, + &chunk_info_count); + if (err == SUIT_PLAT_ERR_BUSY) { + /* not enough space in injected_chunks. This is not a problem, + * stream requestor most probably just released its space and + * one of next calls will be successful. + */ + + } else if (err == SUIT_PLAT_SUCCESS) { + bool chunk_released = + chunk_released_check(ri, injected_chunks, chunk_info_count); + + if (chunk_released) { + return SUIT_PLAT_SUCCESS; + } + } else { + return err; + } + + /* 20 seconds to catch eventual timeout due to missing notification + */ + k_sem_take(&chunk_status_changed_sem, K_MSEC(20000)); + } + + return err; +} + +static suit_plat_err_t find_buffer_for_enqueue(image_request_info_t *ri, buffer_metadata_t **bm, + uint8_t **buffer) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + *bm = NULL; + *buffer = NULL; + + while (*bm == NULL) { + for (int i = 0; i < BUFFER_COUNT; i++) { + buffer_metadata_t *current = &ri->buffer_info.buffer_metadata[i]; + + if (current->buffer_state == FREE) { + *bm = current; + *buffer = ri->buffer_info.buffer[i]; + break; + } + } + + if (*bm == NULL) { + err = wait_for_buffer_state_change(ri); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + } + } + + return err; +} + +static suit_plat_err_t chunk_enqueue(image_request_info_t *ri, uint32_t chunk_id, uint32_t offset, + uint8_t *address, uint32_t size, bool last_chunk) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + + while (true) { + err = suit_ipc_streamer_chunk_enqueue(ri->stream_session_id, chunk_id, offset, + address, size, last_chunk); + if (err == SUIT_PLAT_ERR_BUSY) { + /* Not enough space in requestor, try again later + */ + err = wait_for_buffer_state_change(ri); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + } else { + return err; + } + } +} + +static suit_plat_err_t chunk_enqueue_and_push(void *ctx, uint8_t *source_buffer, size_t *size) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + size_t source_offset = 0; + size_t source_remaining = *size; + image_request_info_t *ri = &request_info; + + if (ri->stream_session_id != (uintptr_t)ctx) { + return SUIT_PLAT_ERR_CRASH; + } + + while (source_remaining) { + buffer_metadata_t *bm = NULL; + uint8_t *buffer = NULL; + + err = find_buffer_for_enqueue(ri, &bm, &buffer); + if (err != SUIT_PLAT_SUCCESS) { + return err; + } + + bm->offset_in_image = ri->requested_image_offset; + bm->chunk_size = 0; + bm->chunk_id = ++ri->last_chunk_id; + + size_t to_be_copied = BUFFER_SIZE - bm->chunk_size; + + if (source_remaining < to_be_copied) { + to_be_copied = source_remaining; + } + + memcpy(buffer + bm->chunk_size, source_buffer + source_offset, to_be_copied); + source_offset += to_be_copied; + source_remaining -= to_be_copied; + bm->chunk_size += to_be_copied; + bm->buffer_state = READY_TO_ENQUEUE; + + err = chunk_enqueue(ri, bm->chunk_id, bm->offset_in_image, buffer, bm->chunk_size, + false); + if (err != SUIT_PLAT_SUCCESS) { + break; + } + ri->requested_image_offset += bm->chunk_size; + bm->buffer_state = ENQUEUED; + } + + return err; +} + +static suit_plat_err_t last_chunk_enqueue_and_push(void *ctx) +{ + suit_plat_err_t err = SUIT_PLAT_SUCCESS; + image_request_info_t *ri = &request_info; + + if (ri->stream_session_id != (uintptr_t)ctx) { + return SUIT_PLAT_ERR_CRASH; + } + + err = chunk_enqueue(ri, 0, ri->requested_image_offset, 0, 0, true); + return err; +} + +static void injector_entry_point(void *stream_session_id, void *p2, void *p3) +{ + for (int i = 0; i < sizeof(test_buf); ++i) { + test_buf[i] = (uint8_t)i; + } + + for (int buf_iter = 0; buf_iter < ITERATIONS; buf_iter++) { + + for (int i = 0; i < sizeof(test_buf); ++i) { + expected_bytes++; + expected_checksum += test_buf[i]; + } + } + + for (int buf_iter = 0; buf_iter < ITERATIONS; buf_iter++) { + size_t size = sizeof(test_buf); + + chunk_enqueue_and_push(stream_session_id, test_buf, &size); + } + + last_chunk_enqueue_and_push(stream_session_id); +} + +static K_SEM_DEFINE(delay_simulator_sem, 0, 1); +static suit_plat_err_t ipc_stream_write_chunk(void *ctx, const uint8_t *buf, size_t size) +{ + received_bytes += size; + + for (int i = 0; i < size; ++i) { + received_checksum += buf[i]; + } + + /* let's simulate 10 ms lasting operation. + * cannot use k_sleep in posix tests! + */ + k_sem_take(&delay_simulator_sem, K_MSEC(10)); + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t missing_image_notify_fn(const uint8_t *resource_id, + size_t resource_id_length, + uint32_t stream_session_id, void *context) +{ + zassert_equal(context, missing_image_notify_requested_ctx, "context (%08x)", context); + zassert_equal(resource_id_length, strlen(requested_resource_id), "resource_id_length (%d)", + resource_id_length); + zassert_mem_equal(resource_id, requested_resource_id, strlen(requested_resource_id)); + + if (0 == missing_image_notify_count) { + + image_request_info_t *ri = &request_info; + + ri->stream_session_id = stream_session_id; + + k_thread_create(&injector_thread, injector_stack, + K_THREAD_STACK_SIZEOF(injector_stack), injector_entry_point, + (void *)(uintptr_t)stream_session_id, NULL, NULL, + INJECTOR_THREAD_PRIORITY, 0, K_NO_WAIT); + } + missing_image_notify_count++; + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t chunk_status_notify_fn(uint32_t stream_session_id, void *context) +{ + zassert_equal(context, chunk_status_notify_requested_ctx, "context (%08x)", context); + k_sem_give(&chunk_status_changed_sem); + return SUIT_PLAT_SUCCESS; +} + +void test_ipc_streamer_requestor(void) +{ + + struct stream_sink test_sink = { + .write = ipc_stream_write_chunk, + .seek = NULL, + .flush = NULL, + .used_storage = NULL, + .release = NULL, + .ctx = stream_sink_requested_ctx, + }; + + uint32_t inter_chunk_timeout_ms = 10000; + uint32_t requesting_period_ms = 1000; + suit_plat_err_t rc = SUIT_PLAT_SUCCESS; + + rc = suit_ipc_streamer_requestor_init(); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_ipc_streamer_requestor_init returned (%d)", rc); + + suit_ipc_streamer_chunk_status_evt_unsubscribe(); + rc = suit_ipc_streamer_chunk_status_evt_subscribe(chunk_status_notify_fn, + chunk_status_notify_requested_ctx); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_ipc_streamer_chunk_status_evt_subscribe returned (%d)", rc); + + suit_ipc_streamer_missing_image_evt_unsubscribe(); + rc = suit_ipc_streamer_missing_image_evt_subscribe(missing_image_notify_fn, + missing_image_notify_requested_ctx); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_ipc_streamer_missing_image_evt_unsubscribe returned (%d)", rc); + + rc = suit_ipc_streamer_stream(requested_resource_id, strlen(requested_resource_id), + &test_sink, inter_chunk_timeout_ms, requesting_period_ms); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_ipc_streamer_stream returned (%d)", rc); + zassert_equal(expected_bytes, received_bytes, "%d vs %d", expected_bytes, received_bytes); + zassert_equal(expected_checksum, received_checksum, "%d vs %d", expected_checksum, + received_checksum); +} diff --git a/tests/subsys/suit/fetch_source_mgr/testcase.yaml b/tests/subsys/suit/fetch_source_mgr/testcase.yaml new file mode 100644 index 000000000000..0983fb93a48d --- /dev/null +++ b/tests/subsys/suit/fetch_source_mgr/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-platform.integration.fetch_source_mgr: + platform_allow: native_posix native_posix/native/64 + tags: suit_platform + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/flash_sink/CMakeLists.txt b/tests/subsys/suit/flash_sink/CMakeLists.txt new file mode 100644 index 000000000000..feff47afe6bc --- /dev/null +++ b/tests/subsys/suit/flash_sink/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(integration_test_flash_sink) +include(../cmake/test_template.cmake) + +# link with the cmake target, that includes suit platform internal apis header +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/flash_sink/boards/native_posix.conf b/tests/subsys/suit/flash_sink/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/flash_sink/boards/native_posix.overlay b/tests/subsys/suit/flash_sink/boards/native_posix.overlay new file mode 100644 index 000000000000..799dfbd81926 --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 32KB of NVM as dfu_partition. */ + dfu_partition: partition@f8000 { + reg = <0xf8000 DT_SIZE_K(32)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/flash_sink/boards/native_posix_64.conf b/tests/subsys/suit/flash_sink/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/flash_sink/boards/native_posix_64.overlay b/tests/subsys/suit/flash_sink/boards/native_posix_64.overlay new file mode 100644 index 000000000000..799dfbd81926 --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 32KB of NVM as dfu_partition. */ + dfu_partition: partition@f8000 { + reg = <0xf8000 DT_SIZE_K(32)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/flash_sink/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/flash_sink/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..f412ac23b6af --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 32KB of NVM as dfu partition. */ + dfu_partition: partition@f8000 { + reg = <0xf8000 DT_SIZE_K(32)>; + }; + }; +}; diff --git a/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..ce5d010c9c03 --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +#Logging and printk is using standard UART. +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=8192 diff --git a/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..c5bda80fd610 --- /dev/null +++ b/tests/subsys/suit/flash_sink/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&mram1x { + erase-block-size = < 0x400 >; + /* Hardcoded inside the soc_flash_nrf_mram.c (MRAM_WORD_SIZE) */ + write-block-size = < 0x10 >; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + perm-read; + perm-write; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@19d000 { + reg = < 0x19d000 DT_SIZE_K(1) >; + }; + + dfu_cache_partition_1: partition@19d400 { + reg = <0x19d400 DT_SIZE_K(1)>; + }; + + dfu_cache_partition_3: partition@19d800 { + reg = <0x19d800 DT_SIZE_K(1)>; + }; + + __mpc_override_align: partition@19dc00 { + reg = <0x19dc00 DT_SIZE_K(1)>; + }; + }; +}; diff --git a/tests/subsys/suit/flash_sink/prj.conf b/tests/subsys/suit/flash_sink/prj.conf new file mode 100644 index 000000000000..764a1d3c2d79 --- /dev/null +++ b/tests/subsys/suit/flash_sink/prj.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_SUIT_UTILS=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y diff --git a/tests/subsys/suit/flash_sink/src/main.c b/tests/subsys/suit/flash_sink/src/main.c new file mode 100644 index 000000000000..1b959d87f1f2 --- /dev/null +++ b/tests/subsys/suit/flash_sink/src/main.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +#define TEST_ARBITRARY_WRITE_SIZE 21 +#define TEST_REQUESTED_AREA 0x1000 +#define WRITE_ADDR suit_plat_mem_nvm_ptr_get(SUIT_DFU_PARTITION_OFFSET) + +#define SUIT_DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(dfu_partition) +#define SUIT_DFU_PARTITION_SIZE FIXED_PARTITION_SIZE(dfu_partition) + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +static void test_setup_flash(void *arg) +{ + /* Erase the area, to met the preconditions in the next test. */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase area"); + + int rc = flash_erase(fdev, SUIT_DFU_PARTITION_OFFSET, SUIT_DFU_PARTITION_SIZE); + + zassert_equal(rc, 0, "Unable to erase memory before test execution"); +} + +ZTEST_SUITE(flash_sink_tests, NULL, NULL, test_setup_flash, NULL, NULL); + +ZTEST(flash_sink_tests, test_suit_flash_sink_get_OK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + zassert_not_equal(flash_sink.ctx, NULL, "suit_flash_sink_get failed - ctx is NULL"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_suit_flash_sink_get_NOK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, NULL, TEST_REQUESTED_AREA); + + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_flash_sink_get should have failed - dst == NULL"); + + err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_flash_sink_get should have failed - offset_limit == 0"); +} + +ZTEST(flash_sink_tests, test_flash_sink_release_NOK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.release(NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.release should have failed - ctx == NULL"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_seek_OK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.seek(flash_sink.ctx, 0); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.seek failed - error %i", err); + + err = flash_sink.seek(flash_sink.ctx, 9); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.seek failed - error %i", err); + + err = flash_sink.seek(flash_sink.ctx, 63); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.seek failed - error %i", err); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_seek_NOK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.seek(flash_sink.ctx, TEST_REQUESTED_AREA); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.seek should have failed - passed arg == offset_limit"); + + err = flash_sink.seek(flash_sink.ctx, TEST_REQUESTED_AREA + 1); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.seek should have failed - passed arg > offset_limit"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_used_storage_OK) +{ + struct stream_sink flash_sink; + size_t used_storage = 0; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.used_storage(flash_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.use_storage failed - error %i", err); + zassert_equal(used_storage, 0, "flash_sink.use_storage failed - not initialized to 0"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_used_storage_NOK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.used_storage(flash_sink.ctx, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.use_storage should have failed - arg size == NULL"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_write_OK) +{ + struct stream_sink flash_sink; + size_t used_storage = 0; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.write(flash_sink.ctx, test_data, TEST_ARBITRARY_WRITE_SIZE); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.write failed - error %i", err); + + err = flash_sink.used_storage(flash_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.use_storage failed - error %i", err); + zassert_equal(used_storage, TEST_ARBITRARY_WRITE_SIZE, + "flash_sink.use_storage failed - value %d", used_storage); + + err = flash_sink.seek(flash_sink.ctx, TEST_ARBITRARY_WRITE_SIZE + 7); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.seek failed - error %i", err); + + err = flash_sink.used_storage(flash_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.use_storage failed - error %i", err); + + err = flash_sink.write(flash_sink.ctx, &test_data[TEST_ARBITRARY_WRITE_SIZE], + TEST_ARBITRARY_WRITE_SIZE); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.write failed - error %i", err); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} + +ZTEST(flash_sink_tests, test_flash_sink_write_NOK) +{ + struct stream_sink flash_sink; + + int err = suit_flash_sink_get(&flash_sink, WRITE_ADDR, TEST_REQUESTED_AREA); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_flash_sink_get failed - error %i", err); + + err = flash_sink.write(flash_sink.ctx, test_data, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.write should have failed - size == 0"); + + err = flash_sink.write(NULL, test_data, TEST_ARBITRARY_WRITE_SIZE); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.write should have failed - ctx == NULL"); + + err = flash_sink.write(flash_sink.ctx, NULL, TEST_ARBITRARY_WRITE_SIZE); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "flash_sink.write should have failed - buf == NULL"); + + err = flash_sink.release(flash_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "flash_sink.release failed - error %i", err); +} diff --git a/tests/subsys/suit/flash_sink/testcase.yaml b/tests/subsys/suit/flash_sink/testcase.yaml new file mode 100644 index 000000000000..e48c56b6e02d --- /dev/null +++ b/tests/subsys/suit/flash_sink/testcase.yaml @@ -0,0 +1,11 @@ +tests: + suit-platform.integration.flash_sink: + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp + - nrf52840dk/nrf52840 + - native_posix + - native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/integrated_fetch/CMakeLists.txt b/tests/subsys/suit/integrated_fetch/CMakeLists.txt new file mode 100644 index 000000000000..d9fee4c2f942 --- /dev/null +++ b/tests/subsys/suit/integrated_fetch/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 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(integration_test_cache_streamer) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_stream_sources_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/tests/subsys/suit/integrated_fetch/prj.conf b/tests/subsys/suit/integrated_fetch/prj.conf new file mode 100644 index 000000000000..44ded7c4da29 --- /dev/null +++ b/tests/subsys/suit/integrated_fetch/prj.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/integrated_fetch/src/main.c b/tests/subsys/suit/integrated_fetch/src/main.c new file mode 100644 index 000000000000..17c04487d8ac --- /dev/null +++ b/tests/subsys/suit/integrated_fetch/src/main.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include + +#define TEST_DATA_SIZE 64 + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +ZTEST_SUITE(memptr_streamer_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(memptr_streamer_tests, test_memptr_streamer_OK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = suit_memptr_streamer_stream(test_data, TEST_DATA_SIZE, &memptr_sink); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_streamer failed - error %i", err); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", err); +} + +ZTEST(memptr_streamer_tests, test_memptr_streamer_NOK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = suit_memptr_streamer_stream(NULL, TEST_DATA_SIZE, &memptr_sink); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_streamer should have failed - payload == NULL"); + + err = suit_memptr_streamer_stream(test_data, 0, &memptr_sink); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, "memptr_streamer should have failed - size == 0"); + + err = suit_memptr_streamer_stream(test_data, TEST_DATA_SIZE, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_streamer should have failed - sink == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", err); +} diff --git a/tests/subsys/suit/integrated_fetch/testcase.yaml b/tests/subsys/suit/integrated_fetch/testcase.yaml new file mode 100644 index 000000000000..79be45ae32ba --- /dev/null +++ b/tests/subsys/suit/integrated_fetch/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.memptr_streamer: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/invoke/CMakeLists.txt b/tests/subsys/suit/invoke/CMakeLists.txt new file mode 100644 index 000000000000..6b24ac6e6fb6 --- /dev/null +++ b/tests/subsys/suit/invoke/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 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(integration_test_suit_invoke) +include(../cmake/test_template.cmake) diff --git a/tests/subsys/suit/invoke/prj.conf b/tests/subsys/suit/invoke/prj.conf new file mode 100644 index 000000000000..e74e9527008d --- /dev/null +++ b/tests/subsys/suit/invoke/prj.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/invoke/src/main.c b/tests/subsys/suit/invoke/src/main.c new file mode 100644 index 000000000000..7d3d811e890a --- /dev/null +++ b/tests/subsys/suit/invoke/src/main.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +ZTEST_SUITE(invoke_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(invoke_tests, test_invoke_OK) +{ + suit_component_t handle; +#ifdef CONFIG_SOC_SERIES_NRF54HX + /* [h'MEM', h'02', h'1A00080000', h'09'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x00, + 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x08}; +#else /* CONFIG_SOC_SERIES_NRF54HX */ + /* [h'MEM', h'00', h'1A00080000', h'08'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x00, + 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x08}; +#endif /* CONFIG_SOC_SERIES_NRF54HX */ + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_invoke(handle, NULL); + zassert_not_equal(ret, SUIT_ERR_UNSUPPORTED_PARAMETER, "suit_plat_invoke failed - error %i", + ret); + zassert_not_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "suit_plat_invoke failed - error %i", ret); +} + +ZTEST(invoke_tests, test_invoke_NOK_unsupported_component_type) +{ + suit_component_t handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_invoke(handle, NULL); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "suit_plat_invoke should have failed - unsupported component type"); +} + +ZTEST(invoke_tests, test_invoke_NOK_unsupported_cpu_id) +{ + suit_component_t handle; + /* [h'MEM', h'06', h'1A00080000', h'08'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x06, + 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x08}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_invoke(handle, NULL); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_PARAMETER, + "suit_plat_invoke should have failed - unsupported cpu_id"); +} diff --git a/tests/subsys/suit/invoke/testcase.yaml b/tests/subsys/suit/invoke/testcase.yaml new file mode 100644 index 000000000000..319307eb4282 --- /dev/null +++ b/tests/subsys/suit/invoke/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.invoke: + platform_allow: native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - native_posix + - native_posix/native/64 diff --git a/tests/subsys/suit/manifest_common/regenerate.sh b/tests/subsys/suit/manifest_common/regenerate.sh new file mode 100755 index 000000000000..4ea7a7d8d38d --- /dev/null +++ b/tests/subsys/suit/manifest_common/regenerate.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +generated_files=() + +SUIT_PROCESSOR_DIR="../../../../../modules/lib/suit-processor" +SUIT_GENERATOR_DIR="../../../../../modules/lib/suit-generator" +SIGN_SCRIPT=${SUIT_GENERATOR_DIR}/ncs/sign_script.py +KEYS_DIR=${SUIT_GENERATOR_DIR}/ncs + +if [ -z "$1" ] + then + echo "regenerate.sh: path to yaml file required" + exit -1 +fi + +### Key generation ### +pushd ${KEYS_DIR} 1>/dev/null 2>/dev/null +if [ ! -f key_private.pem ]; then + echo "Generating private and public keys..." + rm key_public.c + suit-generator keys --output-file key + mv key_priv.pem key_private.pem + mv key_pub.pem key_public.pem + generated_files+=("\tprivate key:\t\t$PWD/key_private.pem") + generated_files+=("\tpublic key:\t\t$PWD/key_public.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 + generated_files+=("\tpublic key C file:\t$PWD/key_public.c") +fi +popd 1>/dev/null 2>/dev/null + +### Manifest generation ### +echo "Generating SUIT envelope for $1 input file ..." +suit-generator create --input-file $1 --output-file sample.suit +generated_files+=("\tunsigned binary envelope:\t\t$PWD/sample.suit") +echo "Signing SUIT envelope using key_priv.pem ..." +python3 ${SIGN_SCRIPT} --input-file sample.suit --output-file sample_signed.suit +generated_files+=("\tsigned binary envelope:\t\t\t$PWD/sample_signed.suit") +echo "Converting binary envelope into C code ..." +zcbor convert \ + -c ${SUIT_PROCESSOR_DIR}/cddl/manifest.cddl \ + -c ${SUIT_PROCESSOR_DIR}/cddl/trust_domains.cddl \ + -c ${SUIT_PROCESSOR_DIR}/cddl/update_management.cddl \ + -i ./sample_signed.suit \ + --input-as cbor \ + -t SUIT_Envelope_Tagged \ + -o sample_signed.suit.c \ + --c-code-var-name manifest \ + --c-code-columns 15 +generated_files+=("\tsigned binary envelope as C code:\t$PWD/sample_signed.suit.c") +echo "Done, following files have been created:" +for file in "${generated_files[@]}" +do + echo -e "$file" +done diff --git a/tests/subsys/suit/manifest_common/regenerate_all.sh b/tests/subsys/suit/manifest_common/regenerate_all.sh new file mode 100755 index 000000000000..daab173e4cdc --- /dev/null +++ b/tests/subsys/suit/manifest_common/regenerate_all.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +declare -A envelopes=( + ["../orchestrator/manifest/sample_unsupported_component_54.yaml"]=" + ../orchestrator/manifest/src/manifest_unsupported_component_54.c" + ["../orchestrator/manifest/sample_unsupported_component.yaml"]=" + ../orchestrator/manifest/src/manifest_unsupported_component.c" + ["../orchestrator/manifest/sample_zero_54.yaml"]=" + ../orchestrator/manifest/src/manifest_zero_size_54.c" + ["../orchestrator/manifest/sample_zero.yaml"]=" + ../orchestrator/manifest/src/manifest_zero_size.c" + ["../fetch_integrated_payload_flash/manifest/manifest_52.yaml"]=" + ../fetch_integrated_payload_flash/src/manifest_52.c" + ["../fetch_integrated_payload_flash/manifest/manifest_54.yaml"]=" + ../fetch_integrated_payload_flash/src/manifest_54.c" + ["../orchestrator/manifest/sample_valid_root_payload_fetch.yaml"]=" + ../orchestrator/manifest/src/manifest_valid_payload_fetch.c" + ["../orchestrator/manifest/sample_valid_app_payload_fetch.yaml"]=" + ../orchestrator/manifest/src/manifest_valid_payload_fetch_app.c" + ["../orchestrator/manifest/root_no_validate.yaml"]=" + ../orchestrator/manifest/src/manifest_root_no_validate.c" + ["../orchestrator/manifest/root_validate_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_root_validate_fail.c" + ["../orchestrator/manifest/root_validate_load_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_root_validate_load_fail.c" + ["../orchestrator/manifest/root_validate_load_no_invoke.yaml"]=" + ../orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c" + ["../orchestrator/manifest/root_validate_load_invoke_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c" + ["../orchestrator/manifest/root_validate_load_invoke.yaml"]=" + ../orchestrator/manifest/src/manifest_root_validate_load_invoke.c" + ["../orchestrator/manifest/sample_valid_recovery.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery.c" + ["../orchestrator/manifest/sample_valid_recovery_54.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_54.c" + ["../orchestrator/manifest/recovery_no_validate.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_no_validate.c" + ["../orchestrator/manifest/recovery_validate_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_validate_fail.c" + ["../orchestrator/manifest/recovery_validate_load_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_validate_load_fail.c" + ["../orchestrator/manifest/recovery_validate_load_no_invoke.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c" + ["../orchestrator/manifest/recovery_validate_load_invoke_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c" + ["../orchestrator/manifest/recovery_validate_load_invoke.yaml"]=" + ../orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c" + ["../orchestrator/manifest/root_unsupported_command.yaml"]=" + ../orchestrator/manifest/src/manifest_root_unsupported_command.c" + ["../orchestrator/manifest/root_candidate_verification_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_root_candidate_verification_fail.c" + ["../orchestrator/manifest/root_candidate_verification_no_install.yaml"]=" + ../orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c" + ["../orchestrator/manifest/root_candidate_verification_install_fail.yaml"]=" + ../orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c" + ["../orchestrator/manifest/root_candidate_verification_install.yaml"]=" + ../orchestrator/manifest/src/manifest_root_candidate_verification_install.c" +) + +declare -A envelopes_v2=( + ["../orchestrator/manifest/sample_wrong_manifest_version_54.yaml"]=" + ../orchestrator/manifest/src/manifest_wrong_version_54.c" + ["../orchestrator/manifest/sample_wrong_manifest_version.yaml"]=" + ../orchestrator/manifest/src/manifest_wrong_version.c" +) + +declare -A envelopes_wrong_key=( + ["../orchestrator/manifest/sample_valid_54.yaml"]=" + ../orchestrator/manifest/src/manifest_different_key_54.c" + ["../orchestrator/manifest/sample_valid.yaml"]=" + ../orchestrator/manifest/src/manifest_different_key.c" +) + +declare -A dependency_envelopes=( + ["../storage/manifest/manifest_app.yaml"]=" + ../storage/src/manifest_app.c" + ["../storage/manifest/manifest_app_posix.yaml"]=" + ../storage/src/manifest_app_posix.c" + ["../storage/manifest/manifest_app_posix_v2.yaml"]=" + ../storage/src/manifest_app_posix_v2.c" + ["../storage/manifest/manifest_rad.yaml"]=" + ../storage/src/manifest_rad.c" + ["../orchestrator/manifest/sample_valid_54.yaml"]=" + ../orchestrator/manifest/src/manifest_valid_app_54.c" + ["../orchestrator/manifest/sample_valid.yaml"]=" + ../orchestrator/manifest/src/manifest_valid_app.c" +) +declare -A root_envelopes=( + ["../storage/manifest/manifest_root.yaml"]=" + ../storage/src/manifest_root.c" + ["../storage/manifest/manifest_root_posix.yaml"]=" + ../storage/src/manifest_root_posix.c" + ["../storage/manifest/manifest_root_posix_v2.yaml"]=" + ../storage/src/manifest_root_posix_v2.c" + ["../orchestrator/manifest/sample_valid_root_54.yaml"]=" + ../orchestrator/manifest/src/manifest_valid_54.c" + ["../orchestrator/manifest/sample_valid_root.yaml"]=" + ../orchestrator/manifest/src/manifest_valid.c" +) +declare -A envelope_dependency_names=( + ["../storage/manifest/manifest_app.yaml"]="app.suit" + ["../storage/manifest/manifest_app_posix.yaml"]="app_posix.suit" + ["../storage/manifest/manifest_app_posix_v2.yaml"]="app_posix_v2.suit" + ["../storage/manifest/manifest_rad.yaml"]="rad.suit" + ["../storage/manifest/manifest_root.yaml"]="root.suit" + ["../storage/manifest/manifest_root_posix.yaml"]="root_posix.suit" + ["../storage/manifest/manifest_root_posix_v2.yaml"]="root_posix_v2.suit" + ["../orchestrator/manifest/sample_valid_54.yaml"]="sample_app.suit" + ["../orchestrator/manifest/sample_valid.yaml"]="sample_app_posix.suit" + ["../orchestrator/manifest/sample_valid_root_54.yaml"]="sample_root.suit" + ["../orchestrator/manifest/sample_valid_root.yaml"]="sample_root_posix.suit" +) + + +# Regenerate regular envelopes +for envelope_yaml in "${!envelopes[@]}"; do + envelope_c=${envelopes[$envelope_yaml]} + echo "### Regenerate: ${envelope_yaml} ###" + ./regenerate.sh ${envelope_yaml} || exit 1 + python3 replace_manifest.py ${envelope_c} sample_signed.suit || exit 2 +done + + +# Regenerate hierarchical manifests for the SUIT storage test +for envelope_yaml in "${!dependency_envelopes[@]}"; do + envelope_c=${dependency_envelopes[$envelope_yaml]} + envelope_name=${envelope_dependency_names[$envelope_yaml]} + echo "### Regenerate: ${envelope_yaml} ###" + ./regenerate.sh ${envelope_yaml} || exit 1 + if [ -e ${envelope_c} ]; then + python3 replace_manifest.py ${envelope_c} sample_signed.suit || exit 2 + fi + mv sample_signed.suit ${envelope_name} +done +for envelope_yaml in "${!root_envelopes[@]}"; do + envelope_c=${root_envelopes[$envelope_yaml]} + envelope_name=${envelope_dependency_names[$envelope_yaml]} + echo "### Regenerate: ${envelope_yaml} ###" + ./regenerate.sh ${envelope_yaml} || exit 1 + python3 replace_manifest.py ${envelope_c} sample_signed.suit || exit 2 + mv sample_signed.suit ${envelope_name} +done + + +# Manually manipulate some of the generated envelopes to match test description +MANIPULATION=" * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF" +cp "../orchestrator/manifest/src/manifest_valid_54.c" \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" +sed -i 's/0xD8, 0x6B, \(.*\)0x58/0xD8, 0x6B, \10xFF/g' \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" +sed -i 's/Valid SUIT envelope/Manipulated SUIT envelope/g' \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" +sed -i "s/.yaml/.yaml\n *\n$MANIPULATION/g" \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" +sed -i 's/manifest_valid_buf/manifest_manipulated_buf/g' \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" +sed -i 's/manifest_valid_len/manifest_manipulated_len/g' \ + "../orchestrator/manifest/src/manifest_manipulated_54.c" + +cp "../orchestrator/manifest/src/manifest_valid.c" \ + "../orchestrator/manifest/src/manifest_manipulated.c" +sed -i 's/0xD8, 0x6B, \(.*\)0x58/0xD8, 0x6B, \10xFF/g' \ + "../orchestrator/manifest/src/manifest_manipulated.c" +sed -i 's/Valid SUIT envelope/Manipulated SUIT envelope/g' \ + "../orchestrator/manifest/src/manifest_manipulated.c" +sed -i "s/.yaml/.yaml\n *\n$MANIPULATION/g" \ + "../orchestrator/manifest/src/manifest_manipulated.c" +sed -i 's/manifest_valid_buf/manifest_manipulated_buf/g' \ + "../orchestrator/manifest/src/manifest_manipulated.c" +sed -i 's/manifest_valid_len/manifest_manipulated_len/g' \ + "../orchestrator/manifest/src/manifest_manipulated.c" + +cp "../orchestrator/manifest/src/manifest_recovery.c" \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" +sed -i 's/0xD8, 0x6B, \(.*\)0x58/0xD8, 0x6B, \10xFF/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" +sed -i 's/Valid SUIT envelope/Manipulated SUIT envelope/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" +sed -i "s/.yaml/.yaml\n *\n$MANIPULATION/g" \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" +sed -i 's/manifest_valid_recovery_buf/manifest_manipulated_recovery_buf/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" +sed -i 's/manifest_valid_recovery_len/manifest_manipulated_recovery_len/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated.c" + +cp "../orchestrator/manifest/src/manifest_recovery_54.c" \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" +sed -i 's/0xD8, 0x6B, \(.*\)0x58/0xD8, 0x6B, \10xFF/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" +sed -i 's/Valid SUIT envelope/Manipulated SUIT envelope/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" +sed -i "s/.yaml/.yaml\n *\n$MANIPULATION/g" \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" +sed -i 's/manifest_valid_recovery_buf/manifest_manipulated_recovery_buf/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" +sed -i 's/manifest_valid_recovery_len/manifest_manipulated_recovery_len/g' \ + "../orchestrator/manifest/src/manifest_recovery_manipulated_54.c" + +# Generate envelopes with modified manifest version number +sed -i 's/suit-manifest-version => 1,/suit-manifest-version => 2,/g' \ + "../../../../../modules/lib/suit-processor/cddl/manifest.cddl" +for envelope_yaml in "${!envelopes_v2[@]}"; do + envelope_c=${envelopes_v2[$envelope_yaml]} + echo "### Regenerate: ${envelope_yaml} ###" + ./regenerate.sh ${envelope_yaml} || exit 1 + python3 replace_manifest.py ${envelope_c} sample_signed.suit || exit 2 +done +sed -i 's/suit-manifest-version => 2,/suit-manifest-version => 1,/g' \ + "../../../../../modules/lib/suit-processor/cddl/manifest.cddl" + +SUIT_GENERATOR_DIR="../../../../../modules/lib/suit-generator" +KEYS_DIR=${SUIT_GENERATOR_DIR}/ncs + +# Generate envelopes and sign them with new, temporary key +suit-generator keys --output-file key +mv ${KEYS_DIR}/key_private.pem ${KEYS_DIR}/key_private.pem.bak +mv key_priv.pem ${KEYS_DIR}/key_private.pem + +for envelope_yaml in "${!envelopes_wrong_key[@]}"; do + envelope_c=${envelopes_wrong_key[$envelope_yaml]} + echo "### Regenerate: ${envelope_yaml} ###" + ./regenerate.sh ${envelope_yaml} || exit 1 + python3 replace_manifest.py ${envelope_c} sample_signed.suit || exit 2 +done + +mv ${KEYS_DIR}/key_private.pem.bak ${KEYS_DIR}/key_private.pem diff --git a/tests/subsys/suit/manifest_common/replace_manifest.py b/tests/subsys/suit/manifest_common/replace_manifest.py new file mode 100644 index 000000000000..578b66b09c46 --- /dev/null +++ b/tests/subsys/suit/manifest_common/replace_manifest.py @@ -0,0 +1,47 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +import argparse +import subprocess +from re import match + +def dump_binary(binary): + return ", ".join([f"0x{b:02X}" for b in binary]) + +def replace_manifest(source_file, binary_file): + with open(source_file, 'r') as source: + source_contents = source.readlines() + + with open(binary_file, 'rb') as binary: + binary_contents = binary.read() + + collect = True + dumped = False + output_contents = "" + for line in source_contents: + if collect: + output_contents += line + if not dumped and match(r".*uint8_t.*\[.*\].*", line): + collect = False + output_contents += dump_binary(binary_contents) + dumped = True + if '};' in line: + collect = True + output_contents += "};\r\n" + + with open(source_file, 'w') as output_source: + output_source.write(output_contents) + + subprocess.run(["clang-format", "-i", source_file]) + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + prog='replace_manifest', + description='Replace const array contents with binary file, serialized as C array', + allow_abbrev=False) + parser.add_argument('source_file', help="C source file to be modified") + parser.add_argument('binary_file', help="Binary file to be serialized") + args = parser.parse_args() + replace_manifest(args.source_file, args.binary_file) diff --git a/tests/subsys/suit/mci/CMakeLists.txt b/tests/subsys/suit/mci/CMakeLists.txt new file mode 100644 index 000000000000..362805f958f4 --- /dev/null +++ b/tests/subsys/suit/mci/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 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(integration_test_suit_mci) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_mci) +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STORAGE suit_storage_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/mci/prj.conf b/tests/subsys/suit/mci/prj.conf new file mode 100644 index 000000000000..7dac2b41b3ce --- /dev/null +++ b/tests/subsys/suit/mci/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_EXECUTION_MODE=y +CONFIG_SUIT_METADATA=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/mci/src/api_positive_scenarios.c b/tests/subsys/suit/mci/src/api_positive_scenarios.c new file mode 100644 index 000000000000..c8e2434f97dc --- /dev/null +++ b/tests/subsys/suit/mci/src/api_positive_scenarios.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#ifdef CONFIG_SUIT_STORAGE +#include +#endif /* CONFIG_SUIT_STORAGE */ +#ifdef CONFIG_SUIT_EXECUTION_MODE +#include +#endif /* CONFIG_SUIT_EXECUTION_MODE */ + +#define OUTPUT_MAX_SIZE 32 +static const suit_uuid_t *result_uuid[OUTPUT_MAX_SIZE]; +static suit_manifest_class_info_t result_class_info[OUTPUT_MAX_SIZE]; + +static void *test_suit_setup(void) +{ + suit_plat_err_t ret = 0; + +#ifdef CONFIG_SUIT_STORAGE + ret = suit_storage_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize SUIT storage"); +#endif /* CONFIG_SUIT_STORAGE */ + +#ifdef CONFIG_SUIT_EXECUTION_MODE + ret = suit_execution_mode_set(EXECUTION_MODE_INVOKE); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to set execution mode"); +#endif /* CONFIG_SUIT_EXECUTION_MODE */ + + ret = suit_mci_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize MCI module"); + + return NULL; +} + +ZTEST_SUITE(mci_api_positive_scenarios_tests, NULL, test_suit_setup, NULL, NULL, NULL); + +ZTEST(mci_api_positive_scenarios_tests, test_supported_manifest_class_ids_get) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); +} + +ZTEST(mci_api_positive_scenarios_tests, test_invoke_order_get) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_mci_invoke_order_get returned (%d)", rc); +} + +ZTEST(mci_api_positive_scenarios_tests, test_downgrade_prevention_policy_get) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + suit_downgrade_prevention_policy_t policy; + + rc = suit_mci_downgrade_prevention_policy_get(result_class_info[i].class_id, + &policy); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_downgrade_prevention_policy_get returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_independent_update_policy_get) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + suit_independent_updateability_policy_t policy; + + rc = suit_mci_independent_update_policy_get(result_class_info[i].class_id, &policy); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_independent_update_policy_get returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_manifest_class_id_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + rc = suit_mci_manifest_class_id_validate(result_class_info[i].class_id); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_manifest_class_id_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_signing_key_id_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + uint32_t key_id = 0; + + rc = suit_mci_signing_key_id_validate(result_class_info[i].class_id, key_id); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS || + rc == MCI_ERR_WRONGKEYID), + "suit_mci_signing_key_id_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_processor_start_rights_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + int processor_id = 0; + + rc = suit_mci_processor_start_rights_validate(result_class_info[i].class_id, + processor_id); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS), + "suit_mci_processor_start_rights_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_memory_access_rights_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + void *address = &address; + size_t mem_size = sizeof(void *); + + rc = suit_mci_memory_access_rights_validate(result_class_info[i].class_id, address, + mem_size); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS), + "suit_mci_memory_access_rights_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_platform_specific_component_rights_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + int platform_specific_component_number = 0; + + rc = suit_mci_platform_specific_component_rights_validate( + result_class_info[i].class_id, platform_specific_component_number); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS), + "suit_mci_platform_specific_component_rights_validate returned (%d)", + rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_manifest_parent_child_declaration_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + rc = suit_mci_manifest_parent_child_declaration_validate( + result_class_info[0].class_id, result_class_info[i].class_id); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS), + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_manifest_process_dependency_validate) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + rc = suit_mci_manifest_process_dependency_validate(result_class_info[0].class_id, + result_class_info[i].class_id); + zassert_true((rc == MCI_ERR_NOACCESS || rc == SUIT_PLAT_SUCCESS), + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + } +} + +ZTEST(mci_api_positive_scenarios_tests, test_vendor_id_for_manifest_class_id_get) +{ + int rc = 0; + size_t output_size = OUTPUT_MAX_SIZE; + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + for (int i = 0; i < output_size; ++i) { + const suit_uuid_t *vendor_id = NULL; + + rc = suit_mci_vendor_id_for_manifest_class_id_get(result_class_info[i].class_id, + &vendor_id); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_vendor_id_for_manifest_class_id_get returned (%d)", rc); + } +} diff --git a/tests/subsys/suit/mci/src/generic_ids.c b/tests/subsys/suit/mci/src/generic_ids.c new file mode 100644 index 000000000000..4e3d6e093fcc --- /dev/null +++ b/tests/subsys/suit/mci/src/generic_ids.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#ifdef CONFIG_SUIT_STORAGE +#include +#endif /* CONFIG_SUIT_STORAGE */ + +static void *test_suit_setup(void) +{ + int ret = 0; + +#ifdef CONFIG_SUIT_STORAGE + ret = suit_storage_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize SUIT storage"); +#endif /* CONFIG_SUIT_STORAGE */ + + ret = suit_mci_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize MCI module"); + + return NULL; +} + +ZTEST_SUITE(mci_generic_ids_tests, NULL, test_suit_setup, NULL, NULL, NULL); + +ZTEST(mci_generic_ids_tests, test_nordic_vendor_id_value) +{ + + suit_uuid_t expected_vid = {{0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, 0x94, + 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4}}; + + const suit_uuid_t *obtained_vid = NULL; + mci_err_t rc = SUIT_PLAT_SUCCESS; + + rc = suit_mci_nordic_vendor_id_get(&obtained_vid); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_mci_nordic_vendor_id_get returned (%d)", rc); + zassert_not_null(obtained_vid, "obtained_vid points to NULL"); + zassert_mem_equal(obtained_vid->raw, expected_vid.raw, sizeof(((suit_uuid_t *)0)->raw), + "unexpected vendor_id"); +} diff --git a/tests/subsys/suit/mci/src/sanity.c b/tests/subsys/suit/mci/src/sanity.c new file mode 100644 index 000000000000..0d525b5ee776 --- /dev/null +++ b/tests/subsys/suit/mci/src/sanity.c @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#include +#ifdef CONFIG_SUIT_STORAGE +#include +#endif /* CONFIG_SUIT_STORAGE */ + +#define OUTPUT_MAX_SIZE 32 +static const suit_uuid_t *result_uuid[OUTPUT_MAX_SIZE]; +static suit_manifest_class_info_t result_class_info[OUTPUT_MAX_SIZE]; + +static void *test_suit_setup(void) +{ + int ret = 0; + +#ifdef CONFIG_SUIT_STORAGE + ret = suit_storage_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize SUIT storage"); +#endif /* CONFIG_SUIT_STORAGE */ + + ret = suit_mci_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize MCI module"); + + return NULL; +} + +ZTEST_SUITE(mci_snity_tests, NULL, test_suit_setup, NULL, NULL, NULL); + +ZTEST(mci_snity_tests, test_null_pointers) +{ + const suit_manifest_class_id_t unsupported_manifest_class_id = { + {'u', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', '!', '!', '!', ' ', ' '}}; + size_t output_size = OUTPUT_MAX_SIZE; + uint32_t key_id = 0; + int processor_id = 0; + void *mem_address = &mem_address; + size_t mem_size = sizeof(mem_address); + int platform_specific_component_number = 0; + suit_downgrade_prevention_policy_t policy; + suit_independent_updateability_policy_t update_policy; + int rc = SUIT_PLAT_SUCCESS; + + rc = suit_mci_nordic_vendor_id_get(NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, "suit_mci_nordic_vendor_id_get returned (%d)", rc); + + output_size = OUTPUT_MAX_SIZE; + rc = suit_mci_supported_manifest_class_ids_get(NULL, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + output_size = OUTPUT_MAX_SIZE; + rc = suit_mci_invoke_order_get(NULL, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, "suit_mci_invoke_order_get returned (%d)", rc); + + rc = suit_mci_invoke_order_get(result_uuid, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, "suit_mci_invoke_order_get returned (%d)", rc); + + rc = suit_mci_downgrade_prevention_policy_get(NULL, &policy); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_downgrade_prevention_policy_get returned (%d)", rc); + + rc = suit_mci_downgrade_prevention_policy_get(&unsupported_manifest_class_id, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_downgrade_prevention_policy_get returned (%d)", rc); + + rc = suit_mci_independent_update_policy_get(NULL, &update_policy); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_independent_update_policy_get returned (%d)", rc); + + rc = suit_mci_independent_update_policy_get(&unsupported_manifest_class_id, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_independent_update_policy_get returned (%d)", rc); + + rc = suit_mci_signing_key_id_validate(NULL, key_id); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, "suit_mci_signing_key_id_validate returned (%d)", + rc); + + rc = suit_mci_manifest_class_id_validate(NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, "suit_mci_manifest_class_id_validate returned (%d)", + rc); + + rc = suit_mci_processor_start_rights_validate(NULL, processor_id); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_processor_start_rights_validate returned (%d)", rc); + + rc = suit_mci_memory_access_rights_validate(NULL, mem_address, mem_size); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_memory_access_rights_validate returned (%d)", rc); + + rc = suit_mci_memory_access_rights_validate(&unsupported_manifest_class_id, NULL, mem_size); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_memory_access_rights_validate returned (%d)", rc); + + rc = suit_mci_platform_specific_component_rights_validate( + NULL, platform_specific_component_number); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_platform_specific_component_rights_validate returned (%d)", rc); + + rc = suit_mci_manifest_parent_child_declaration_validate(&unsupported_manifest_class_id, + NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + + rc = suit_mci_manifest_parent_child_declaration_validate(NULL, + &unsupported_manifest_class_id); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + + rc = suit_mci_manifest_process_dependency_validate(&unsupported_manifest_class_id, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + + rc = suit_mci_manifest_process_dependency_validate(NULL, &unsupported_manifest_class_id); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_manifest_parent_child_validate returned (%d)", rc); + + rc = suit_mci_vendor_id_for_manifest_class_id_get(NULL, result_uuid); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_vendor_id_for_manifest_class_id_get returned (%d)", rc); + + rc = suit_mci_vendor_id_for_manifest_class_id_get(&unsupported_manifest_class_id, NULL); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_vendor_id_for_manifest_class_id_get returned (%d)", rc); +} + +ZTEST(mci_snity_tests, test_invalid_params) +{ + void *mem_address = &mem_address; + size_t mem_size = sizeof(mem_address); + int rc = SUIT_PLAT_SUCCESS; + + rc = suit_mci_memory_access_rights_validate(NULL, mem_address, mem_size); + zassert_equal(rc, SUIT_PLAT_ERR_INVAL, + "suit_mci_memory_access_rights_validate returned (%d)", rc); +} + +ZTEST(mci_snity_tests, test_output_buffer_too_small) +{ + size_t output_size = OUTPUT_MAX_SIZE; + size_t supported_manifest_count = 0; + size_t invokable_manifest_count = 0; + int rc = SUIT_PLAT_SUCCESS; + + output_size = OUTPUT_MAX_SIZE; + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d), isn't %d manifests " + "enough?!", + rc, OUTPUT_MAX_SIZE); + supported_manifest_count = output_size; + + output_size = supported_manifest_count; + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + + if (supported_manifest_count > 1) { + output_size = supported_manifest_count - 1; + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_SIZE, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + } + + if (supported_manifest_count > 0) { + output_size = 0; + rc = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_SIZE, + "suit_mci_supported_manifest_class_ids_get returned (%d)", rc); + } + + suit_execution_mode_set(EXECUTION_MODE_INVOKE); + output_size = OUTPUT_MAX_SIZE; + rc = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "suit_mci_invoke_order_get returned (%d), isn't %d manifests enough?!", rc, + OUTPUT_MAX_SIZE); + invokable_manifest_count = output_size; + + output_size = invokable_manifest_count; + rc = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "suit_mci_invoke_order_get returned (%d)", rc); + + if (invokable_manifest_count > 1) { + output_size = invokable_manifest_count - 1; + rc = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_SIZE, "suit_mci_invoke_order_get returned (%d)", + rc); + } + + if (invokable_manifest_count > 0) { + output_size = 0; + rc = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(rc, SUIT_PLAT_ERR_SIZE, "suit_mci_invoke_order_get returned (%d)", + rc); + } +} diff --git a/tests/subsys/suit/mci/src/topology.c b/tests/subsys/suit/mci/src/topology.c new file mode 100644 index 000000000000..7f9e59a882df --- /dev/null +++ b/tests/subsys/suit/mci/src/topology.c @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ +#include +#include +#ifdef CONFIG_SUIT_STORAGE +#include +#endif /* CONFIG_SUIT_STORAGE */ +#ifdef CONFIG_SUIT_EXECUTION_MODE +#include +#endif /* CONFIG_SUIT_EXECUTION_MODE */ + +#define OUTPUT_MAX_SIZE 32 +static const suit_uuid_t *result_uuid[OUTPUT_MAX_SIZE]; +static suit_manifest_class_info_t result_class_info[OUTPUT_MAX_SIZE]; + +static int compare_manifest_class_id(const suit_manifest_class_id_t *manifest_class_id1, + const suit_manifest_class_id_t *manifest_class_id2) +{ + return memcmp(manifest_class_id1->raw, manifest_class_id2->raw, + sizeof(((suit_manifest_class_id_t *)0)->raw)); +} + +static void *test_suit_setup(void) +{ + suit_plat_err_t ret = 0; + +#ifdef CONFIG_SUIT_STORAGE + ret = suit_storage_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize SUIT storage"); +#endif /* CONFIG_SUIT_STORAGE */ + +#ifdef CONFIG_SUIT_EXECUTION_MODE + ret = suit_execution_mode_set(EXECUTION_MODE_INVOKE); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to set execution mode"); +#endif /* CONFIG_SUIT_EXECUTION_MODE */ + + ret = suit_mci_init(); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to initialize MCI module"); + + return NULL; +} + +ZTEST_SUITE(mci_topology_tests, NULL, test_suit_setup, NULL, NULL, NULL); + +ZTEST(mci_topology_tests, test_duplicate_ids_in_supported_manifest) +{ + int rc = 0; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + size_t output_size = OUTPUT_MAX_SIZE; + + ret = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", ret); + + for (int i = 0; i < output_size; ++i) { + for (int j = i + 1; j < output_size; ++j) { + rc = compare_manifest_class_id(result_class_info[i].class_id, + result_class_info[j].class_id); + zassert_true((rc != 0), "the same uuid used for two manifests"); + } + } + +#ifdef CONFIG_SUIT_EXECUTION_MODE + ret = suit_execution_mode_set(EXECUTION_MODE_INVOKE_RECOVERY); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to change execution mode"); + + output_size = OUTPUT_MAX_SIZE; + ret = suit_mci_supported_manifest_class_ids_get(result_class_info, &output_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "suit_mci_supported_manifest_class_ids_get returned (%d)", ret); + + for (int i = 0; i < output_size; ++i) { + for (int j = i + 1; j < output_size; ++j) { + rc = compare_manifest_class_id(result_class_info[i].class_id, + result_class_info[j].class_id); + zassert_true((rc != 0), "the same uuid used for two manifests"); + } + } +#endif /* CONFIG_SUIT_EXECUTION_MODE */ +} + +ZTEST(mci_topology_tests, test_duplicate_ids_in_invoke_order) +{ + int rc = 0; + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + size_t output_size = OUTPUT_MAX_SIZE; + + ret = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_mci_invoke_order_get returned (%d)", ret); + + for (int i = 0; i < output_size; ++i) { + for (int j = i + 1; j < output_size; ++j) { + rc = compare_manifest_class_id(result_uuid[i], result_uuid[j]); + zassert_true((rc != 0), "the same uuid used for two manifests"); + } + } + +#ifdef CONFIG_SUIT_EXECUTION_MODE + ret = suit_execution_mode_set(EXECUTION_MODE_INVOKE_RECOVERY); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Unable to change execution mode"); + + output_size = OUTPUT_MAX_SIZE; + ret = suit_mci_invoke_order_get(result_uuid, &output_size); + zassert_equal(ret, SUIT_PLAT_SUCCESS, "suit_mci_invoke_order_get returned (%d)", ret); + + for (int i = 0; i < output_size; ++i) { + for (int j = i + 1; j < output_size; ++j) { + rc = compare_manifest_class_id(result_uuid[i], result_uuid[j]); + zassert_true((rc != 0), "the same uuid used for two manifests"); + } + } +#endif /* CONFIG_SUIT_EXECUTION_MODE */ +} diff --git a/tests/subsys/suit/mci/testcase.yaml b/tests/subsys/suit/mci/testcase.yaml new file mode 100644 index 000000000000..3c799c0852fa --- /dev/null +++ b/tests/subsys/suit/mci/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-processor.integration.suit_mci: + platform_allow: native_posix native_posix/native/64 + tags: suit-mci + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/memptr_sink/CMakeLists.txt b/tests/subsys/suit/memptr_sink/CMakeLists.txt new file mode 100644 index 000000000000..67d7b686c5fc --- /dev/null +++ b/tests/subsys/suit/memptr_sink/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 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(integration_test_memptr_sink) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/memptr_sink/prj.conf b/tests/subsys/suit/memptr_sink/prj.conf new file mode 100644 index 000000000000..86fb2e4740e5 --- /dev/null +++ b/tests/subsys/suit/memptr_sink/prj.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y + +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/memptr_sink/src/main.c b/tests/subsys/suit/memptr_sink/src/main.c new file mode 100644 index 000000000000..d2a1f070d121 --- /dev/null +++ b/tests/subsys/suit/memptr_sink/src/main.c @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +ZTEST_SUITE(memptr_sink_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(memptr_sink_tests, test_suit_memptr_sink_get_OK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", err); +} + +ZTEST(memptr_sink_tests, test_suit_memptr_sink_get_NOK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(NULL, handle); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_sink_get should have failed - memptr_sink == NULL"); + + err = suit_memptr_sink_get(&memptr_sink, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_sink_get should have failed - storage == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", err); +} + +ZTEST(memptr_sink_tests, test_memptr_sink_write_OK) +{ + struct stream_sink memptr_sink; + const uint8_t *payload_ptr; + size_t payload_size = 0; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = memptr_sink.write(memptr_sink.ctx, test_data, sizeof(test_data)); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.save failed - error %i", err); + + err = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.get failed - error %i", err); + zassert_equal(payload_ptr, test_data, + "memptr_storage.get, payload_ptr and data address mismatch"); + zassert_equal(payload_size, sizeof(test_data), + "memptr_storage.get, payload_size and data size mismatch"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.release failed - error %i", err); +} + +ZTEST(memptr_sink_tests, test_memptr_sink_write_NOK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = memptr_sink.write(NULL, test_data, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.write should have failed - ctx == NULL"); + + err = memptr_sink.write(memptr_sink.ctx, NULL, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.write should have failed - payload_ptr == NULL"); + + err = memptr_sink.write(memptr_sink.ctx, test_data, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.write should have failed - payload_size == 0"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_sink.release failed - error %i", err); + + err = memptr_sink.write(memptr_sink.ctx, test_data, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.write should have failed - storage released"); +} + +ZTEST(memptr_sink_tests, test_memptr_sink_used_storage_OK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + size_t size = 0; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = memptr_sink.used_storage(memptr_sink.ctx, &size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_sink.used_storage failed - error %i", err); + zassert_equal(size, 0, "used_storage should return 0 if nothing was written to storage"); + + err = memptr_sink.write(memptr_sink.ctx, test_data, sizeof(test_data)); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_storage.save failed - error %i", err); + + err = memptr_sink.used_storage(memptr_sink.ctx, &size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_sink.used_storage failed - error %i", err); + zassert_equal(size, sizeof(test_data), + "used_storage should return 1 if something was written to storage"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_sink.release failed - error %i", err); +} + +ZTEST(memptr_sink_tests, test_memptr_sink_used_storage_NOK) +{ + struct stream_sink memptr_sink; + memptr_storage_handle_t handle = NULL; + size_t size = 0; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_sink_get(&memptr_sink, handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_sink_get failed - error %i", err); + + err = memptr_sink.used_storage(NULL, &size); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.used_storage should have failed - ctx == NULL"); + + err = memptr_sink.used_storage(memptr_sink.ctx, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.used_storage should have failed - size == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "memptr_sink.release failed - error %i", err); + + err = memptr_sink.used_storage(memptr_sink.ctx, &size); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_sink.used_storage should have failed - storage released"); +} diff --git a/tests/subsys/suit/memptr_sink/testcase.yaml b/tests/subsys/suit/memptr_sink/testcase.yaml new file mode 100644 index 000000000000..0985e0e3d8c2 --- /dev/null +++ b/tests/subsys/suit/memptr_sink/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.memptr_sink: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_no_validate.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_no_validate.yaml new file mode 100644 index 000000000000..199e06cc7aa7 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_no_validate.yaml @@ -0,0 +1,31 @@ +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 + 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: test_sample_recovery + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_validate_fail.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_validate_fail.yaml new file mode 100644 index 000000000000..f3fffc786a7d --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_validate_fail.yaml @@ -0,0 +1,39 @@ +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 + 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: test_sample_recovery + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_fail.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_fail.yaml new file mode 100644 index 000000000000..a1cb88d75632 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_fail.yaml @@ -0,0 +1,42 @@ +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 + 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: test_sample_recovery + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke.yaml new file mode 100644 index 000000000000..efce3c11b6f2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke.yaml @@ -0,0 +1,37 @@ +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 + 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: test_sample_recovery + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke_fail.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke_fail.yaml new file mode 100644 index 000000000000..c2ffa11b1595 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_invoke_fail.yaml @@ -0,0 +1,42 @@ +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 + 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: test_sample_recovery + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-invoke: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_no_invoke.yaml b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_no_invoke.yaml new file mode 100644 index 000000000000..5ce431cc19b2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/recovery_validate_load_no_invoke.yaml @@ -0,0 +1,34 @@ +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 + 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: test_sample_recovery + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_recovery diff --git a/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_fail.yaml b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_fail.yaml new file mode 100644 index 000000000000..9b1fc6fbc288 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_fail.yaml @@ -0,0 +1,39 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-install: + - suit-directive-set-component-index: 0 + + suit-candidate-verification: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install.yaml b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install.yaml new file mode 100644 index 000000000000..be949f51f289 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install.yaml @@ -0,0 +1,38 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-install: + - suit-directive-set-component-index: 0 + + suit-candidate-verification: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install_fail.yaml b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install_fail.yaml new file mode 100644 index 000000000000..5929ae35633b --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_install_fail.yaml @@ -0,0 +1,39 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-install: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-candidate-verification: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_no_install.yaml b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_no_install.yaml new file mode 100644 index 000000000000..aaacb85100dc --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_candidate_verification_no_install.yaml @@ -0,0 +1,35 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-candidate-verification: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_no_validate.yaml b/tests/subsys/suit/orchestrator/manifest/root_no_validate.yaml new file mode 100644 index 000000000000..fad8fa9ffc29 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_no_validate.yaml @@ -0,0 +1,31 @@ +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 + 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: test_sample_root + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_unsupported_command.yaml b/tests/subsys/suit/orchestrator/manifest/root_unsupported_command.yaml new file mode 100644 index 000000000000..baf905eff128 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_unsupported_command.yaml @@ -0,0 +1,32 @@ +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 + 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: test_sample_root + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-install: + - suit-directive-set-component-index: 0 + - suit-directive-invoke: [] + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_validate_fail.yaml b/tests/subsys/suit/orchestrator/manifest/root_validate_fail.yaml new file mode 100644 index 000000000000..3604529b1a23 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_validate_fail.yaml @@ -0,0 +1,39 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_validate_load_fail.yaml b/tests/subsys/suit/orchestrator/manifest/root_validate_load_fail.yaml new file mode 100644 index 000000000000..baf98712b711 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_validate_load_fail.yaml @@ -0,0 +1,42 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke.yaml b/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke.yaml new file mode 100644 index 000000000000..95bb7964e774 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke.yaml @@ -0,0 +1,37 @@ +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 + 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: test_sample_root + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-invoke: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke_fail.yaml b/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke_fail.yaml new file mode 100644 index 000000000000..407adda8d4c2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_validate_load_invoke_fail.yaml @@ -0,0 +1,42 @@ +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 + 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: test_sample_root + suit-parameter-device-identifier: + RFC4122_UUID: + namespace: nordicsemi.com + name: unsupported_device_identifier_value + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-invoke: + - suit-directive-set-component-index: 0 + - suit-condition-device-identifier: [] + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/root_validate_load_no_invoke.yaml b/tests/subsys/suit/orchestrator/manifest/root_validate_load_no_invoke.yaml new file mode 100644 index 000000000000..cef8729fe929 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/root_validate_load_no_invoke.yaml @@ -0,0 +1,34 @@ +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 + 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: test_sample_root + suit-dependencies: + # Key is the index of suit-components that describe the dependency manifest + "0": {} + + suit-validate: + - suit-directive-set-component-index: 0 + + suit-load: + - suit-directive-set-component-index: 0 + + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root diff --git a/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component.yaml b/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component.yaml new file mode 100644 index 000000000000..c6e9ede37088 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component.yaml @@ -0,0 +1,72 @@ +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: + - - X + - 2 + - 524288 + - 256 + 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: test_sample_app + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["X", 2, 524288, 256]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component_54.yaml new file mode 100644 index 000000000000..f07f020a94e8 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_unsupported_component_54.yaml @@ -0,0 +1,72 @@ +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: + - - X + - 0 + - 0x0E0AA000 + - 256 + 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: test_sample_app + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["X", 0, 235577344, 256]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid.yaml new file mode 100644 index 000000000000..d5bf90155c20 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0 + - 524288 + - 4096 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_54.yaml new file mode 100644 index 000000000000..587c7e4eb8dc --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_54.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0 + - 0x0E0AA000 + - 4096 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 235577344, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_app_payload_fetch.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_app_payload_fetch.yaml new file mode 100644 index 000000000000..1031e505f59f --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_app_payload_fetch.yaml @@ -0,0 +1,104 @@ +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: + - - MEM + - 0 + - 524288 + - 4096 + - - CAND_IMG + - 0 + - - CACHE_POOL + - 0 + - - CACHE_POOL + - 1 + - - CACHE_POOL + - 3 + suit-shared-sequence: + - suit-directive-set-component-index: 0 + - 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-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-directive-set-component-index: 0 + - suit-condition-image-match: + - suit-send-record-success + - suit-send-record-failure + - suit-send-sysinfo-success + - suit-send-sysinfo-failure + suit-invoke: + - suit-directive-set-component-index: 0 + - suit-directive-invoke: + - suit-send-record-failure + suit-payload-fetch: + - suit-directive-set-component-index: 2 + - suit-directive-override-parameters: + suit-parameter-uri: 'payload1.bin' + - suit-directive-fetch: + - suit-send-record-failure + - suit-directive-set-component-index: 3 + - suit-directive-override-parameters: + suit-parameter-uri: 'payload2.bin' + - suit-directive-fetch: + - suit-send-record-failure + - suit-directive-set-component-index: 4 + - suit-directive-override-parameters: + suit-parameter-uri: 'payload3.bin' + - suit-directive-fetch: + - suit-send-record-failure + suit-install: + - suit-directive-set-component-index: 1 + - suit-directive-override-parameters: + suit-parameter-uri: 'payload1.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-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-source-component: 1 + - suit-directive-copy: + - 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_app + suit-text: + en: + '["MEM", 2, 235560960, 458752]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: nRF54H20_cpuapp + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The nRF54H20 application core + suit-text-component-description: Sample application core FW + suit-text-component-version: v1.0.0 diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery.yaml new file mode 100644 index 000000000000..4876f1c38c38 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery.yaml @@ -0,0 +1,96 @@ +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_IMG + - 0 + - - MEM + - 0 + - 528384 + - 4096 + 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: test_sample_recovery + 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-directive-set-component-index: 1 + - suit-condition-image-match: + - 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-directive-invoke: + - suit-send-record-failure + suit-current-version: [1, 0, 0] + suit-install: + - suit-directive-set-component-index: 1 + - 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-candidate-verification: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: '#file.bin' + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: 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_recovery + suit-text: + en: + '["MEM", 0, 528384, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test recovery application + suit-text-component-description: Sample recovery application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery_54.yaml new file mode 100644 index 000000000000..cccd2c9d4bb2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_recovery_54.yaml @@ -0,0 +1,96 @@ +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_IMG + - 0 + - - MEM + - 0 + - 0x0E0AB000 + - 4096 + 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: test_sample_recovery + 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-directive-set-component-index: 1 + - suit-condition-image-match: + - 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-directive-invoke: + - suit-send-record-failure + suit-current-version: [1, 0, 0] + suit-install: + - suit-directive-set-component-index: 1 + - 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-candidate-verification: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: '#file.bin' + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: 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_recovery + suit-text: + en: + '["MEM", 0, 235581440, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test recovery application + suit-text-component-description: Sample recovery application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_root.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_root.yaml new file mode 100644 index 000000000000..dad6fceb79e4 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_root.yaml @@ -0,0 +1,112 @@ +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: test_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: test_sample_root + + - 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: + envelope: sample_app_posix.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 + # Manifest copied to I/APP s a result of sequence completion + + # Manifest copied to I/ROOT s a result of sequence completion + suit-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 + suit-integrated-dependencies: + '#app.suit': sample_app_posix.suit diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_root_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_root_54.yaml new file mode 100644 index 000000000000..76ba4105caad --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_root_54.yaml @@ -0,0 +1,112 @@ +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: test_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: test_sample_root + + - 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: + envelope: sample_app.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 + # Manifest copied to I/APP s a result of sequence completion + + # Manifest copied to I/ROOT s a result of sequence completion + suit-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 + suit-integrated-dependencies: + '#app.suit': sample_app.suit diff --git a/tests/subsys/suit/orchestrator/manifest/sample_valid_root_payload_fetch.yaml b/tests/subsys/suit/orchestrator/manifest/sample_valid_root_payload_fetch.yaml new file mode 100644 index 000000000000..1a6f9deb7b61 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_valid_root_payload_fetch.yaml @@ -0,0 +1,119 @@ +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 + - - CACHE_POOL + - 0 + 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_root + - 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-payload-fetch: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: 'app.suit' + - suit-directive-fetch: + - suit-send-record-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-install: + - suit-directive-set-component-index: 0 + - suit-directive-override-parameters: + suit-parameter-uri: 'app.suit' + - suit-directive-fetch: + - suit-send-record-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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-dependency-resolution: + - suit-directive-set-component-index: 2 + - suit-directive-override-parameters: + suit-parameter-uri: 'app.suit' + - suit-directive-fetch: + - suit-send-record-failure + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: nRF54H20 + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The nRF54H20 root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 diff --git a/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version.yaml b/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version.yaml new file mode 100644 index 000000000000..497d31183ae9 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version.yaml @@ -0,0 +1,74 @@ +SUIT_Envelope_Tagged: + suit-authentication-wrapper: + SuitDigest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest: + suit-manifest-version: 2 + suit-manifest-sequence-number: 1 + suit-common: + suit-components: + - - MEM + - 0 + - 524288 + - 256 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 256]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for test + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version_54.yaml new file mode 100644 index 000000000000..be529041320b --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_wrong_manifest_version_54.yaml @@ -0,0 +1,74 @@ +SUIT_Envelope_Tagged: + suit-authentication-wrapper: + SuitDigest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest: + suit-manifest-version: 2 + suit-manifest-sequence-number: 1 + suit-common: + suit-components: + - - MEM + - 0 + - 0x0E0AA000 + - 256 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 235577344, 256]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_zero.yaml b/tests/subsys/suit/orchestrator/manifest/sample_zero.yaml new file mode 100644 index 000000000000..6319066c06b5 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_zero.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0 + - 524288 + - 0 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for test + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/sample_zero_54.yaml b/tests/subsys/suit/orchestrator/manifest/sample_zero_54.yaml new file mode 100644 index 000000000000..02d6abb88890 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/sample_zero_54.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0 + - 0x0E0AA000 + - 0 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 235577344, 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: test_cpuapp + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The test application + suit-text-component-description: Sample application for tests + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c new file mode 100644 index 000000000000..c7c5bf05b8c6 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope but signed using different private key + * + * @details New, temporary private key was created and used for signing. + * Signature won't pass verification with a private key used in our tests. + */ +const 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD0, + 0x80, 0xD7, 0xEE, 0x16, 0x27, 0x88, 0xBD, 0xF7, 0x43, 0x28, 0xC8, 0xC6, 0xD7, 0xA8, 0x86, + 0xA4, 0xB4, 0x59, 0x83, 0x28, 0xFE, 0xA2, 0xD9, 0xAB, 0xC3, 0x21, 0xDC, 0xB5, 0x5E, 0xC5, + 0x1B, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_different_key_len = sizeof(manifest_different_key_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..cd7aeb935450 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_different_key_54.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Valid SUIT envelope but signed using different private key + * + * @details New, temporary private key was created and used for signing. + * Signature won't pass verification with a private key used in our tests. + */ +const 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xDA, + 0x63, 0x90, 0xBE, 0x10, 0xC5, 0x38, 0xC5, 0x4E, 0x8A, 0x09, 0x3B, 0xBD, 0xD5, 0xDC, 0x9A, + 0x10, 0x22, 0xCB, 0xE3, 0x89, 0x23, 0x3A, 0x03, 0xFD, 0xE9, 0x59, 0x6B, 0x28, 0x9A, 0x61, + 0x6B, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_different_key_len = sizeof(manifest_different_key_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c new file mode 100644 index 000000000000..84a5bb5c65b9 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Manipulated SUIT envelope, based on ../manifest/sample_valid.yaml + * + * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF + * + */ +const 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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2D, 0x88, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, 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, 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, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0xC4, 0x03, 0xBD, 0x94, 0x5F, 0xB2, 0xAF, 0xBD, 0x75, 0x82, 0x40, 0xF0, 0x92, 0x2C, + 0xAB, 0xE4, 0x19, 0xA8, 0x80, 0x52, 0xCC, 0x8B, 0xA3, 0xF2, 0x31, 0x5D, 0xB7, 0xCD, 0x0A, + 0x99, 0x65, 0x95, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, + 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x82, 0x4A, + 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, + 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, + 0x6F, 0x6D, 0x04, 0x76, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x72, 0x6F, + 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, + 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x69, 0x23, 0x61, 0x70, + 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF2, 0xD8, 0x6B, 0xA4, 0x02, 0xFF, 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, 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, + 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, + 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, + 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD0, 0x80, 0xD7, 0xEE, 0x16, 0x27, 0x88, + 0xBD, 0xF7, 0x43, 0x28, 0xC8, 0xC6, 0xD7, 0xA8, 0x86, 0xA4, 0xB4, 0x59, 0x83, 0x28, 0xFE, + 0xA2, 0xD9, 0xAB, 0xC3, 0x21, 0xDC, 0xB5, 0x5E, 0xC5, 0x1B, 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, 0x17, 0x58, 0x86, + 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, + 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, + 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, + 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, + 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_manipulated_len = sizeof(manifest_manipulated_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c new file mode 100644 index 000000000000..f8b095e5e14a --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_manipulated_54.c @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Manipulated SUIT envelope, based on ../manifest/sample_valid_54.yaml + * + * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF + * + */ +const 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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2D, 0x88, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, 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, 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, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0xC4, 0x03, 0xBD, 0x94, 0x5F, 0xB2, 0xAF, 0xBD, 0x75, 0x82, 0x40, 0xF0, 0x92, 0x2C, + 0xAB, 0xE4, 0x19, 0xA8, 0x80, 0x52, 0xCC, 0x8B, 0xA3, 0xF2, 0x31, 0x5D, 0xB7, 0xCD, 0x0A, + 0x99, 0x65, 0x95, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, + 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x82, 0x4A, + 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, + 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, + 0x6F, 0x6D, 0x04, 0x76, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x72, 0x6F, + 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, + 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x69, 0x23, 0x61, 0x70, + 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF2, 0xD8, 0x6B, 0xA4, 0x02, 0xFF, 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, 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, + 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, + 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, + 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xDA, 0x63, 0x90, 0xBE, 0x10, 0xC5, 0x38, + 0xC5, 0x4E, 0x8A, 0x09, 0x3B, 0xBD, 0xD5, 0xDC, 0x9A, 0x10, 0x22, 0xCB, 0xE3, 0x89, 0x23, + 0x3A, 0x03, 0xFD, 0xE9, 0x59, 0x6B, 0x28, 0x9A, 0x61, 0x6B, 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, 0x17, 0x58, 0x86, + 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, + 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, + 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, + 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, + 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_manipulated_len = sizeof(manifest_manipulated_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c new file mode 100644 index 000000000000..2ed5300b46ef --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_recovery.yaml + * + */ +const 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, + 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, + 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, + 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA, 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, 0x45, 0x84, 0x0C, 0x01, + 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x01, 0x17, 0x02, 0x06, 0x44, 0x83, 0x01, 0x00, 0x00, + 0x11, 0x54, 0x88, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x40, 0xC7, 0x42, + 0x3A, 0x21, 0x73, 0x28, 0xA8, 0x0B, 0x75, 0x71, 0xF0, 0xCD, 0xF3, 0x35, 0xE5, 0xF8, 0x51, + 0x54, 0x13, 0xAC, 0x67, 0x52, 0x07, 0x91, 0xC9, 0x2B, 0x5F, 0xA7, 0x42, 0x6B, 0x04, 0x12, + 0x58, 0x3B, 0x88, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 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, 0x15, 0x02, 0x03, + 0x0F, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x17, 0x58, 0x99, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x10, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x25, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_recovery_len = sizeof(manifest_valid_recovery_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c new file mode 100644 index 000000000000..ad571885641e --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_54.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_recovery_54.yaml + * + */ +const 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, + 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, + 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, + 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA, 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, 0x45, 0x84, 0x0C, 0x01, + 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x01, 0x17, 0x02, 0x06, 0x44, 0x83, 0x01, 0x00, 0x00, + 0x11, 0x54, 0x88, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x9E, 0x8A, 0x36, + 0x2C, 0xB9, 0xD9, 0x60, 0xA8, 0x54, 0x89, 0x2F, 0x7C, 0xE6, 0x82, 0x1A, 0x65, 0x41, 0x2C, + 0xEF, 0x13, 0xB8, 0x66, 0x4D, 0x5B, 0x91, 0x3A, 0x00, 0xAB, 0xE7, 0x31, 0x5B, 0xCB, 0x12, + 0x58, 0x3B, 0x88, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 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, 0x15, 0x02, 0x03, + 0x0F, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x17, 0x58, 0x99, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xB0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x25, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_recovery_len = sizeof(manifest_valid_recovery_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c new file mode 100644 index 000000000000..cee042885da4 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Manipulated SUIT envelope, based on ../manifest/sample_valid_recovery.yaml + * + * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF + * + */ +const 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, + 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, + 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, + 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA, 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, 0x45, 0x84, 0x0C, 0x01, + 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x01, 0x17, 0x02, 0x06, 0x44, 0x83, 0x01, 0x00, 0x00, + 0x11, 0x54, 0x88, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x40, 0xC7, 0x42, + 0x3A, 0x21, 0x73, 0x28, 0xA8, 0x0B, 0x75, 0x71, 0xF0, 0xCD, 0xF3, 0x35, 0xE5, 0xF8, 0x51, + 0x54, 0x13, 0xAC, 0x67, 0x52, 0x07, 0x91, 0xC9, 0x2B, 0x5F, 0xA7, 0x42, 0x6B, 0x04, 0x12, + 0x58, 0x3B, 0x88, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 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, 0x15, 0x02, 0x03, + 0x0F, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x17, 0x58, 0x99, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x10, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x25, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_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 new file mode 100644 index 000000000000..0c6b50d4b0c0 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_manipulated_54.c @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Manipulated SUIT envelope, based on ../manifest/sample_valid_recovery_54.yaml + * + * @details The manipulation is done on byte of index 11, from value 0x58 to 0xFF + * + */ +const 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, + 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, + 0x14, 0xA4, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, + 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA, 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, 0x45, 0x84, 0x0C, 0x01, + 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x01, 0x17, 0x02, 0x06, 0x44, 0x83, 0x01, 0x00, 0x00, + 0x11, 0x54, 0x88, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x9E, 0x8A, 0x36, + 0x2C, 0xB9, 0xD9, 0x60, 0xA8, 0x54, 0x89, 0x2F, 0x7C, 0xE6, 0x82, 0x1A, 0x65, 0x41, 0x2C, + 0xEF, 0x13, 0xB8, 0x66, 0x4D, 0x5B, 0x91, 0x3A, 0x00, 0xAB, 0xE7, 0x31, 0x5B, 0xCB, 0x12, + 0x58, 0x3B, 0x88, 0x0C, 0x00, 0x14, 0xA2, 0x15, 0x69, 0x23, 0x66, 0x69, 0x6C, 0x65, 0x2E, + 0x62, 0x69, 0x6E, 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, 0x15, 0x02, 0x03, + 0x0F, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x17, 0x58, 0x99, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xB0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x25, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x72, 0x65, 0x63, 0x6F, 0x76, 0x65, 0x72, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_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 new file mode 100644 index 000000000000..3793e4f97852 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_no_validate.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_no_validate.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x01, 0xA1, 0x00, 0xA0, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, + 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x74, 0xA0, + 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA}; + +const size_t manifest_recovery_no_validate_len = sizeof(manifest_recovery_no_validate_buf); 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 new file mode 100644 index 000000000000..dca44019067a --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_fail.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_validate_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x46, 0x84, 0x0C, + 0x00, 0x18, 0x18, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, + 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, + 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA}; + +const size_t manifest_recovery_validate_fail_len = sizeof(manifest_recovery_validate_fail_buf); 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 new file mode 100644 index 000000000000..d85de0246005 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_fail.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_validate_load_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, + 0x00, 0x08, 0x46, 0x84, 0x0C, 0x00, 0x18, 0x18, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, + 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, + 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, + 0xBA}; + +const size_t manifest_recovery_validate_load_fail_len = + sizeof(manifest_recovery_validate_load_fail_buf); 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 new file mode 100644 index 000000000000..a4522265d31d --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_validate_load_invoke.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, 0x00, 0x08, 0x43, 0x82, + 0x0C, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, + 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, + 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, 0xBA}; + +const size_t manifest_recovery_validate_load_invoke_len = + sizeof(manifest_recovery_validate_load_invoke_buf); 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 new file mode 100644 index 000000000000..df1c1bc05efa --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_invoke_fail.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_validate_load_invoke_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, + 0x00, 0x08, 0x43, 0x82, 0x0C, 0x00, 0x09, 0x46, 0x84, 0x0C, 0x00, 0x18, 0x18, 0x00, 0x05, + 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, + 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, 0x8B, 0x06, + 0xBA}; + +const size_t manifest_recovery_validate_load_invoke_fail_len = + sizeof(manifest_recovery_validate_load_invoke_fail_buf); 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 new file mode 100644 index 000000000000..c8f3028b2468 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_recovery_validate_load_no_invoke.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../recovery_validate_load_no_invoke.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, 0x87, + 0x8B, 0x06, 0xBA, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, 0x00, 0x08, 0x43, 0x82, + 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, + 0x53, 0x54, 0x50, 0x74, 0xA0, 0xC6, 0xE7, 0xA9, 0x2A, 0x56, 0x00, 0x9C, 0x5D, 0x30, 0xEE, + 0x87, 0x8B, 0x06, 0xBA}; + +const size_t manifest_recovery_validate_load_no_invoke_len = + sizeof(manifest_recovery_validate_load_no_invoke_buf); 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 new file mode 100644 index 000000000000..a521deb1b6fd --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_fail.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_candidate_verification_fail.yaml + * + */ +const 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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x11, 0x43, 0x82, 0x0C, + 0x00, 0x12, 0x46, 0x84, 0x0C, 0x00, 0x18, 0x18, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, + 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, + 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_candidate_verification_fail_len = + sizeof(manifest_root_candidate_verification_fail_buf); 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 new file mode 100644 index 000000000000..e3386ebf53d7 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_candidate_verification_install.yaml + * + */ +const 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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x11, 0x43, 0x82, 0x0C, + 0x00, 0x12, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, + 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, + 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_candidate_verification_install_len = + sizeof(manifest_root_candidate_verification_install_buf); 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 new file mode 100644 index 000000000000..cb5cc98057c6 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_install_fail.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_candidate_verification_install_fail.yaml + * + */ +const 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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x11, 0x46, 0x84, 0x0C, + 0x00, 0x18, 0x18, 0x00, 0x12, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, + 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, + 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_candidate_verification_install_fail_len = + sizeof(manifest_root_candidate_verification_install_fail_buf); 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 new file mode 100644 index 000000000000..ee82359645ec --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_candidate_verification_no_install.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_candidate_verification_no_install.yaml + * + */ +const 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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x12, 0x43, 0x82, 0x0C, + 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_candidate_verification_no_install_len = + sizeof(manifest_root_candidate_verification_no_install_buf); 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 new file mode 100644 index 000000000000..1cfd46568201 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_no_validate.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_no_validate.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x01, 0xA1, 0x00, 0xA0, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, + 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, + 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_no_validate_len = sizeof(manifest_root_no_validate_buf); 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 new file mode 100644 index 000000000000..92b38bbbbe1c --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_unsupported_command.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_unsupported_command.yaml + * + */ +const 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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x01, 0xA1, 0x00, 0xA0, 0x11, 0x45, 0x84, 0x0C, 0x00, 0x17, 0x00, 0x05, + 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, + 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, + 0x0A}; + +const size_t manifest_root_unsupported_command_len = sizeof(manifest_root_unsupported_command_buf); 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 new file mode 100644 index 000000000000..df9e3031bc38 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_fail.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_validate_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x46, 0x84, 0x0C, + 0x00, 0x18, 0x18, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, + 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, + 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_validate_fail_len = sizeof(manifest_root_validate_fail_buf); 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 new file mode 100644 index 000000000000..7aba051392a5 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_fail.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_validate_load_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, + 0x00, 0x08, 0x46, 0x84, 0x0C, 0x00, 0x18, 0x18, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, + 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, + 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, + 0x0A}; + +const size_t manifest_root_validate_load_fail_len = sizeof(manifest_root_validate_load_fail_buf); 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 new file mode 100644 index 000000000000..0e554c54dcc0 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_validate_load_invoke.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, 0x00, 0x08, 0x43, 0x82, + 0x0C, 0x00, 0x09, 0x43, 0x82, 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, + 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, + 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_validate_load_invoke_len = + sizeof(manifest_root_validate_load_invoke_buf); 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 new file mode 100644 index 000000000000..4b84fb71691f --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_invoke_fail.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_validate_load_invoke_fail.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x18, 0x18, 0x50, 0x9C, 0x1B, 0x1E, 0x37, 0x2C, 0xB4, 0x5C, 0x33, 0x92, + 0xDD, 0x49, 0x56, 0x6B, 0x18, 0x31, 0x93, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, + 0x00, 0x08, 0x43, 0x82, 0x0C, 0x00, 0x09, 0x46, 0x84, 0x0C, 0x00, 0x18, 0x18, 0x00, 0x05, + 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, + 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, + 0x0A}; + +const size_t manifest_root_validate_load_invoke_fail_len = + sizeof(manifest_root_validate_load_invoke_fail_buf); 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 new file mode 100644 index 000000000000..8958a39eb9b0 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_root_validate_load_no_invoke.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief Valid SUIT envelope, based on ../root_validate_load_no_invoke.yaml + * + */ +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, + 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, + 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, 0x60, + 0xA1, 0x4B, 0x0A, 0x01, 0xA1, 0x00, 0xA0, 0x07, 0x43, 0x82, 0x0C, 0x00, 0x08, 0x43, 0x82, + 0x0C, 0x00, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, + 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, 0x46, + 0x60, 0xA1, 0x4B, 0x0A}; + +const size_t manifest_root_validate_load_no_invoke_len = + sizeof(manifest_root_validate_load_no_invoke_buf); diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c new file mode 100644 index 000000000000..e941cffd2361 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_unsupported_component.yaml + * + * @note Component type is set to "X" + */ +const 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, + 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, + 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, + 0x03, 0x69, 0x5E, 0x36, 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, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x09, 0xBD, 0x47, 0xE0, 0xA4, 0xF8, 0xB3, 0x33, + 0x5B, 0xC4, 0x0D, 0xE8, 0x2D, 0xA0, 0x5D, 0x82, 0xBD, 0x39, 0xAA, 0x96, 0xEE, 0xBC, 0x87, + 0x85, 0x04, 0x3D, 0xC7, 0xC8, 0x5E, 0x91, 0xD6, 0xEF, 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, 0x17, 0x58, 0x83, 0xA1, + 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x41, 0x58, 0x41, 0x02, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, + 0x43, 0x19, 0x01, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, + 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, + 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, + 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, + 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, + 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, + 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_unsupported_component_len = sizeof(manifest_unsupported_component_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..b382535deac9 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_unsupported_component_54.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_unsupported_component_54.yaml + * + * @note Component type is set to "X" + */ +const 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, + 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, + 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, + 0x03, 0x69, 0x5E, 0x36, 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, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x60, 0xD4, 0xB6, 0x96, 0x69, 0xE8, 0x2B, 0x64, + 0x63, 0x59, 0x6E, 0xD0, 0x97, 0x2C, 0xA3, 0xFE, 0x61, 0x9E, 0xB0, 0x38, 0xC0, 0xA6, 0xEF, + 0x90, 0x83, 0x66, 0x60, 0x96, 0x57, 0xF3, 0x03, 0x5F, 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, 0x17, 0x58, 0x83, 0xA1, + 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x41, 0x58, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, + 0x43, 0x19, 0x01, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, + 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, + 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, + 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, + 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, + 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, + 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_unsupported_component_len = sizeof(manifest_unsupported_component_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c new file mode 100644 index 000000000000..69ff0bc39a2f --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid.yaml + * + */ +const 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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2D, 0x88, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, 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, 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, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0xC4, 0x03, 0xBD, 0x94, 0x5F, 0xB2, 0xAF, 0xBD, 0x75, 0x82, 0x40, 0xF0, 0x92, 0x2C, + 0xAB, 0xE4, 0x19, 0xA8, 0x80, 0x52, 0xCC, 0x8B, 0xA3, 0xF2, 0x31, 0x5D, 0xB7, 0xCD, 0x0A, + 0x99, 0x65, 0x95, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, + 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x82, 0x4A, + 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, + 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, + 0x6F, 0x6D, 0x04, 0x76, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x72, 0x6F, + 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, + 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x69, 0x23, 0x61, 0x70, + 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF2, 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, 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, + 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, + 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, + 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD0, 0x80, 0xD7, 0xEE, 0x16, 0x27, 0x88, + 0xBD, 0xF7, 0x43, 0x28, 0xC8, 0xC6, 0xD7, 0xA8, 0x86, 0xA4, 0xB4, 0x59, 0x83, 0x28, 0xFE, + 0xA2, 0xD9, 0xAB, 0xC3, 0x21, 0xDC, 0xB5, 0x5E, 0xC5, 0x1B, 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, 0x17, 0x58, 0x86, + 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, + 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, + 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, + 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, + 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_len = sizeof(manifest_valid_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c new file mode 100644 index 000000000000..cdd4b0b30311 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_54.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_54.yaml + * + */ +const 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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2D, 0x88, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, 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, 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, 0x15, 0x02, 0x03, 0x0F, 0x07, 0x0F, 0x0B, 0x0F, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0xC4, 0x03, 0xBD, 0x94, 0x5F, 0xB2, 0xAF, 0xBD, 0x75, 0x82, 0x40, 0xF0, 0x92, 0x2C, + 0xAB, 0xE4, 0x19, 0xA8, 0x80, 0x52, 0xCC, 0x8B, 0xA3, 0xF2, 0x31, 0x5D, 0xB7, 0xCD, 0x0A, + 0x99, 0x65, 0x95, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, 0x86, 0xA5, + 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x82, 0x4A, + 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, + 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, + 0x6F, 0x6D, 0x04, 0x76, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x72, 0x6F, + 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, + 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x69, 0x23, 0x61, 0x70, + 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF2, 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, 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, + 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, + 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, + 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xDA, 0x63, 0x90, 0xBE, 0x10, 0xC5, 0x38, + 0xC5, 0x4E, 0x8A, 0x09, 0x3B, 0xBD, 0xD5, 0xDC, 0x9A, 0x10, 0x22, 0xCB, 0xE3, 0x89, 0x23, + 0x3A, 0x03, 0xFD, 0xE9, 0x59, 0x6B, 0x28, 0x9A, 0x61, 0x6B, 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, 0x17, 0x58, 0x86, + 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, + 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, + 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, + 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, + 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_len = sizeof(manifest_valid_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c new file mode 100644 index 000000000000..3a6a27937752 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid.yaml + * + */ +const 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD0, + 0x80, 0xD7, 0xEE, 0x16, 0x27, 0x88, 0xBD, 0xF7, 0x43, 0x28, 0xC8, 0xC6, 0xD7, 0xA8, 0x86, + 0xA4, 0xB4, 0x59, 0x83, 0x28, 0xFE, 0xA2, 0xD9, 0xAB, 0xC3, 0x21, 0xDC, 0xB5, 0x5E, 0xC5, + 0x1B, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_app_len = sizeof(manifest_valid_app_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..89dbf3034234 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_app_54.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_54.yaml + * + */ +const 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xDA, + 0x63, 0x90, 0xBE, 0x10, 0xC5, 0x38, 0xC5, 0x4E, 0x8A, 0x09, 0x3B, 0xBD, 0xD5, 0xDC, 0x9A, + 0x10, 0x22, 0xCB, 0xE3, 0x89, 0x23, 0x3A, 0x03, 0xFD, 0xE9, 0x59, 0x6B, 0x28, 0x9A, 0x61, + 0x6B, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_valid_app_len = sizeof(manifest_valid_app_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ 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 new file mode 100644 index 000000000000..a8119157ce3d --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_root_payload_fetch.yaml + * + */ +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, + 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, + 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 0x82, 0x4B, 0x6A, 0x43, 0x41, 0x43, 0x48, + 0x45, 0x5F, 0x50, 0x4F, 0x4F, 0x4C, 0x41, 0x00, 0x04, 0x58, 0x30, 0x8A, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x3F, 0x6A, 0x3A, 0x4D, 0xCD, 0xFA, 0x58, 0xC5, 0xAC, + 0xCE, 0xF9, 0xF5, 0x84, 0xC4, 0x11, 0x24, 0x0C, 0x81, 0x01, 0x01, 0x0F, 0x02, 0x0F, 0x01, + 0xA2, 0x00, 0xA0, 0x01, 0xA0, 0x07, 0x48, 0x86, 0x0C, 0x81, 0x01, 0x07, 0x0F, 0x0B, 0x0F, + 0x09, 0x48, 0x86, 0x0C, 0x81, 0x01, 0x07, 0x0F, 0x0B, 0x0F, 0x10, 0x55, 0x8A, 0x0C, 0x00, + 0x14, 0xA1, 0x15, 0x68, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x15, 0x02, 0x07, + 0x0F, 0x0B, 0x0F, 0x11, 0x55, 0x8A, 0x0C, 0x00, 0x14, 0xA1, 0x15, 0x68, 0x61, 0x70, 0x70, + 0x2E, 0x73, 0x75, 0x69, 0x74, 0x15, 0x02, 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, 0x0F, 0x51, 0x86, 0x0C, 0x02, 0x14, 0xA1, 0x15, 0x68, 0x61, 0x70, 0x70, + 0x2E, 0x73, 0x75, 0x69, 0x74, 0x15, 0x02, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, + 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x3F, 0x6A, 0x3A, 0x4D, 0xCD, 0xFA, 0x58, + 0xC5, 0xAC, 0xCE, 0xF9, 0xF5, 0x84, 0xC4, 0x11, 0x24, 0x17, 0x58, 0x84, 0xA1, 0x62, 0x65, + 0x6E, 0xA1, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, + 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, + 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, + 0x68, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, + 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1A, 0x54, 0x68, + 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x20, 0x72, 0x6F, 0x6F, 0x74, + 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, 0x6D, 0x70, + 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, + 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30}; + +const size_t manifest_valid_payload_fetch_len = sizeof(manifest_valid_payload_fetch_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..a8d08ba43007 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_valid_payload_fetch_app.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Valid SUIT envelope, based on ../manifest/sample_valid_app_payload_fetch.yaml + * + */ +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, + 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, + 0x48, 0x45, 0x5F, 0x50, 0x4F, 0x4F, 0x4C, 0x41, 0x00, 0x82, 0x4B, 0x6A, 0x43, 0x41, 0x43, + 0x48, 0x45, 0x5F, 0x50, 0x4F, 0x4F, 0x4C, 0x41, 0x01, 0x82, 0x4B, 0x6A, 0x43, 0x41, 0x43, + 0x48, 0x45, 0x5F, 0x50, 0x4F, 0x4F, 0x4C, 0x41, 0x03, 0x04, 0x58, 0x2D, 0x88, 0x0C, 0x00, + 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, + 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 0x01, 0x0F, 0x02, 0x0F, 0x07, 0x45, 0x84, + 0x0C, 0x00, 0x03, 0x0F, 0x09, 0x45, 0x84, 0x0C, 0x00, 0x17, 0x02, 0x10, 0x58, 0x3D, 0x92, + 0x0C, 0x02, 0x14, 0xA1, 0x15, 0x6C, 0x70, 0x61, 0x79, 0x6C, 0x6F, 0x61, 0x64, 0x31, 0x2E, + 0x62, 0x69, 0x6E, 0x15, 0x02, 0x0C, 0x03, 0x14, 0xA1, 0x15, 0x6C, 0x70, 0x61, 0x79, 0x6C, + 0x6F, 0x61, 0x64, 0x32, 0x2E, 0x62, 0x69, 0x6E, 0x15, 0x02, 0x0C, 0x04, 0x14, 0xA1, 0x15, + 0x6C, 0x70, 0x61, 0x79, 0x6C, 0x6F, 0x61, 0x64, 0x33, 0x2E, 0x62, 0x69, 0x6E, 0x15, 0x02, + 0x11, 0x58, 0x21, 0x90, 0x0C, 0x01, 0x14, 0xA1, 0x15, 0x6C, 0x70, 0x61, 0x79, 0x6C, 0x6F, + 0x61, 0x64, 0x31, 0x2E, 0x62, 0x69, 0x6E, 0x15, 0x02, 0x03, 0x0F, 0x0C, 0x00, 0x14, 0xA1, + 0x16, 0x01, 0x16, 0x02, 0x03, 0x0F, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xD9, 0x69, 0x63, 0x0E, + 0x7A, 0xDE, 0x6A, 0x15, 0xF1, 0x38, 0x28, 0xB0, 0x60, 0xC2, 0x05, 0x17, 0x63, 0x9C, 0x3E, + 0x44, 0x21, 0x86, 0x8B, 0xF7, 0xD4, 0x0F, 0xDC, 0x71, 0xB2, 0xA5, 0x64, 0xD6, 0x05, 0x82, + 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x08, + 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, + 0x17, 0x58, 0x9B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, + 0x02, 0x45, 0x1A, 0x0E, 0x0A, 0x60, 0x00, 0x45, 0x1A, 0x00, 0x07, 0x00, 0x00, 0xA6, 0x01, + 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, + 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x6F, 0x6E, 0x52, + 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x5F, 0x63, 0x70, 0x75, 0x61, 0x70, 0x70, 0x03, 0x6E, + 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, + 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x63, 0x6F, 0x72, + 0x65, 0x05, 0x78, 0x1A, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x20, 0x46, 0x57, + 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30}; + +const size_t manifest_valid_payload_fetch_app_len = sizeof(manifest_valid_payload_fetch_app_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c new file mode 100644 index 000000000000..0911671232af --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_wrong_version.yaml + * + * @note Manifest version 2 instead of 1 is used. + */ +const 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, + 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, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x12, + 0xE8, 0x75, 0xC0, 0x80, 0xC6, 0xAA, 0x56, 0xDF, 0x3C, 0x98, 0x17, 0x5E, 0xA1, 0xB2, 0x19, + 0xCA, 0xB6, 0xAF, 0x45, 0x37, 0xC9, 0x98, 0x5E, 0xEF, 0xDF, 0x16, 0x5E, 0xD0, 0x9A, 0x2F, + 0x28, 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, 0x17, 0x58, 0x85, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x01, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1B, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, + 0x2E, 0x30, 0x2E, 0x30, 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_wrong_version_len = sizeof(manifest_wrong_version_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..5ed74fe1b376 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_wrong_version_54.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_wrong_version_54.yaml + * + * @note Manifest version 2 instead of 1 is used. + */ +const 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, + 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, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x85, + 0x22, 0xB5, 0xE5, 0x21, 0x18, 0xD2, 0x98, 0xA1, 0xA8, 0x17, 0x5A, 0xBE, 0x55, 0x6F, 0xEA, + 0x4F, 0xAA, 0x01, 0x06, 0xDA, 0x14, 0x50, 0xD6, 0x2A, 0x76, 0xE5, 0x0F, 0xAB, 0xF7, 0x69, + 0x74, 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, 0x17, 0x58, 0x86, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x43, 0x19, 0x01, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, + 0x65, 0x73, 0x74, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_wrong_version_len = sizeof(manifest_wrong_version_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c new file mode 100644 index 000000000000..13548ebbdbd8 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_NRF52840) || defined(CONFIG_BOARD_NATIVE_POSIX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_zero.yaml + * + * @details The component id size field in input file was set to zero. + */ +const 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, + 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, + 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, + 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xC6, 0x1A, 0x58, + 0x47, 0xF3, 0xE8, 0xB3, 0xDF, 0x97, 0xBF, 0x02, 0x9E, 0x5D, 0xE0, 0x29, 0xCF, 0xA3, 0x9C, + 0x78, 0x2A, 0x05, 0x1D, 0xB1, 0x4E, 0x7B, 0x34, 0xFE, 0xE0, 0x7B, 0xFF, 0x0E, 0x32, 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, 0x17, 0x58, 0x83, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, + 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x41, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, + 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x64, 0x74, 0x65, 0x73, 0x74, 0x03, + 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, + 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1B, 0x53, 0x61, 0x6D, 0x70, 0x6C, + 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, + 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, + 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_zero_size_len = sizeof(manifest_zero_size_buf); + +#endif /* CONFIG_SOC_NRF52840 || CONFIG_BOARD_NATIVE_POSIX */ 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 new file mode 100644 index 000000000000..8fb1e1b5c4b2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/manifest_zero_size_54.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#include +#include + +/** @brief Invalid SUIT envelope, based on ../manifest/sample_zero_54.yaml + * + * @details The component id size field in input file was set to zero. + */ +const 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, + 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, + 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, + 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x2E, 0x47, 0xD9, + 0xE7, 0x8E, 0x54, 0x8B, 0x50, 0x12, 0x67, 0xC3, 0x7A, 0x67, 0x31, 0x58, 0xC1, 0x15, 0xD5, + 0xC8, 0x62, 0x1D, 0x43, 0xC5, 0x02, 0x86, 0x83, 0x08, 0xD7, 0x34, 0x59, 0x2A, 0xD4, 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, 0x17, 0x58, 0x8B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, + 0x41, 0x00, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x41, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, + 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x6B, 0x74, 0x65, 0x73, 0x74, 0x5F, + 0x63, 0x70, 0x75, 0x61, 0x70, 0x70, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, + 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x74, 0x54, 0x68, 0x65, 0x20, 0x74, 0x65, + 0x73, 0x74, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, + 0x78, 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, + 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_zero_size_len = sizeof(manifest_zero_size_buf); + +#endif /* CONFIG_SOC_SERIES_NRF54HX */ diff --git a/tests/subsys/suit/orchestrator/manifest/src/sample_fw.c b/tests/subsys/suit/orchestrator/manifest/src/sample_fw.c new file mode 100644 index 000000000000..5e68d28debde --- /dev/null +++ b/tests/subsys/suit/orchestrator/manifest/src/sample_fw.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +#if defined(CONFIG_SOC_SERIES_NRF54HX) +#define SAMPLE_FW_ADDRESS 0x0E0AA000 +#define SAMPLE_RECOVERY_FW_ADDRESS 0x0E0AB000 +#else /* CONFIG_SOC_SERIES_NRF54HX */ +#define SAMPLE_FW_ADDRESS 0x80000 +#define SAMPLE_RECOVERY_FW_ADDRESS 0x81000 +#endif /* CONFIG_SOC_SERIES_NRF54HX */ + +/** @brief Sample firmware payload, attached as file.bin during manifest generation. + * + * @details This is a bunch of random bytes. Do not try to interpret it as a valid ARM code. + */ +const uint8_t sample_fw_buf[] = { + 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 sample_fw_len = sizeof(sample_fw_buf); +const uintptr_t sample_fw_address = SAMPLE_FW_ADDRESS; +const uintptr_t sample_recovery_fw_address = SAMPLE_RECOVERY_FW_ADDRESS; diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/CMakeLists.txt b/tests/subsys/suit/orchestrator/orchestrator_app/CMakeLists.txt new file mode 100644 index 000000000000..87d12d6c5481 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# 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(integration_test_suit_orchestrator_app) +include(../../cmake/test_template.cmake) + +FILE(GLOB manifest_sources ../manifest/src/*.c) +target_sources(app PRIVATE + ${manifest_sources} + ) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_utils) +if(CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING) + zephyr_library_link_libraries(suit_cache_interface) + zephyr_library_link_libraries(suit_stream_sources_interface) +endif() diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/Kconfig b/tests/subsys/suit/orchestrator/orchestrator_app/Kconfig new file mode 100644 index 000000000000..d5f0c86e501e --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/Kconfig @@ -0,0 +1,15 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig TESTS_SUIT_ORCHESTRATOR_APP_MINIMAL_PROCESSING + bool "Run tests for minimal envelope processing by the SUIT application orchestrator" + default n + +menuconfig TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING + bool "Run tests for full envelope processing by the SUIT application orchestrator" + default n + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/boards/native_posix.conf b/tests/subsys/suit/orchestrator/orchestrator_app/boards/native_posix.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/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/orchestrator/orchestrator_app/boards/native_posix.overlay b/tests/subsys/suit/orchestrator/orchestrator_app/boards/native_posix.overlay new file mode 100644 index 000000000000..49ae2466782f --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * 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 32KB of NVM as dfu_partition. */ + dfu_partition: partition@f6000 { + reg = <0xf8000 DT_SIZE_K(32)>; + }; + dfu_cache_partition_1: partition@fe000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@ff000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/full_processing.conf b/tests/subsys/suit/orchestrator/orchestrator_app/full_processing.conf new file mode 100644 index 000000000000..ea4b7eaf991c --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/full_processing.conf @@ -0,0 +1,32 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING=y + +CONFIG_SUIT_ORCHESTRATOR_APP=y +CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING=y +CONFIG_SUIT_ENVELOPE_INFO=y +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_PLATFORM_VARIANT_APP=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_CACHE_RW=y +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_STREAM_SINK_CACHE=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_FETCH_SOURCE_MGR=y +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_PLAT_CHECK_CLASSES=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/minimal_processing.conf b/tests/subsys/suit/orchestrator/orchestrator_app/minimal_processing.conf new file mode 100644 index 000000000000..0b5eb939cfbe --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/minimal_processing.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_MINIMAL_PROCESSING=y + +CONFIG_SUIT_ORCHESTRATOR_APP=y +CONFIG_SUIT_ORCHESTRATOR_APP_CANDIDATE_PROCESSING=y +CONFIG_SUIT_ENVELOPE_INFO=y +CONFIG_SUIT_UTILS=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/prj.conf b/tests/subsys/suit/orchestrator/orchestrator_app/prj.conf new file mode 100644 index 000000000000..9a093f96083c --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PLATFORM_VARIANT_APP=y +CONFIG_SUIT_DFU=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/src/common.c b/tests/subsys/suit/orchestrator/orchestrator_app/src/common.c new file mode 100644 index 000000000000..d30db55a24de --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/src/common.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "orchestrator_app_tests_common.h" + +/* Mocks - ssf services have to be mocked, as real communication with secure domain + * cannot take place in these tests. This is for two reasons: + * - native_posix and nrf52 platforms do not have the secure domain to communicate with + * - on nRF54H calling suit_trigger_update would reset a device, which would stop the tests + */ +DEFINE_FFF_GLOBALS; + +DEFINE_FAKE_VALUE_FUNC(int, suit_trigger_update, suit_plat_mreg_t *, size_t); + +void fill_dfu_partition_with_data(const uint8_t *data_address, size_t data_size) +{ + const struct device *fdev = DFU_PARTITION_DEVICE; + static uint8_t write_buf[DFU_PARTITION_WRITE_SIZE]; + + zassert_true(data_size < DFU_PARTITION_SIZE, "Envelope size exceeds DFU partition size"); + + size_t bytes_remaining = data_size; + size_t data_offset = 0; + int err; + + while (bytes_remaining >= DFU_PARTITION_WRITE_SIZE) { + memcpy(write_buf, &data_address[data_offset], DFU_PARTITION_WRITE_SIZE); + + err = flash_write(fdev, DFU_PARTITION_OFFSET + data_offset, write_buf, + DFU_PARTITION_WRITE_SIZE); + + zassert_equal(0, err, "Flash write failed"); + + bytes_remaining -= DFU_PARTITION_WRITE_SIZE; + data_offset += DFU_PARTITION_WRITE_SIZE; + } + + zassert_true(data_offset + DFU_PARTITION_WRITE_SIZE <= DFU_PARTITION_SIZE, + "Envelope aligned to flash write size exceeds dfu_partition"); + + memset(write_buf, 0xFF, DFU_PARTITION_WRITE_SIZE); + memcpy(write_buf, &data_address[data_offset], bytes_remaining); + err = flash_write(fdev, DFU_PARTITION_OFFSET + data_offset, write_buf, + DFU_PARTITION_WRITE_SIZE); +} + +void ssf_fakes_reset(void) +{ + RESET_FAKE(suit_trigger_update); +} diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/src/main_full_processing.c b/tests/subsys/suit/orchestrator/orchestrator_app/src/main_full_processing.c new file mode 100644 index 000000000000..039bf5a2e177 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/src/main_full_processing.c @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "orchestrator_app_tests_common.h" + +#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)) + +/* valid envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +/* Envelope with unknown component type. */ +extern const uint8_t manifest_unsupported_component_buf[]; +extern const size_t manifest_unsupported_component_len; + +/* Valid root envelope for testing dependency-resolution + payload-fetch sequences. */ +extern const uint8_t manifest_valid_payload_fetch_buf[]; +extern const size_t manifest_valid_payload_fetch_len; + +/* Valid app envelope for testing payload-fetch sequences */ +extern const uint8_t manifest_valid_payload_fetch_app_buf[]; +extern const size_t manifest_valid_payload_fetch_app_len; + +static const uint8_t payload1[16] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, + 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x11}; +static const uint8_t payload2[30] = {0x1c, 0xf2, 0x76, 0xbd, 0x54, 0xc0, 0xb6, 0x82, 0xaf, 0xeb, + 0xe9, 0x89, 0xb4, 0x5f, 0x96, 0xde, 0x0f, 0x81, 0x6a, 0xd7, + 0xf6, 0x04, 0xcb, 0xe4, 0x94, 0xef, 0xa4, 0x3b, 0xf0, 0x4f}; +static const uint8_t payload3[10] = {0xfa, 0xcd, 0x2d, 0x86, 0x5b, 0x6c, 0xf3, 0xea, 0x7a, 0xa9}; + +/* Mocks of functions provided via SSF services */ +FAKE_VALUE_FUNC(int, suit_plat_component_compatibility_check, suit_manifest_class_id_t *, + struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authorize_sequence_num, enum suit_command_sequence, + struct zcbor_string *, unsigned int); +FAKE_VALUE_FUNC(int, suit_plat_authorize_unsigned_manifest, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authenticate_manifest, struct zcbor_string *, enum suit_cose_alg, + struct zcbor_string *, struct zcbor_string *, struct zcbor_string *); + +FAKE_VALUE_FUNC(suit_ssf_err_t, suit_check_installed_component_digest, suit_plat_mreg_t *, int, + suit_plat_mreg_t *); +FAKE_VALUE_FUNC(suit_ssf_err_t, suit_get_supported_manifest_roles, suit_manifest_role_t *, + size_t *); +FAKE_VALUE_FUNC(suit_ssf_err_t, suit_get_supported_manifest_info, suit_manifest_role_t, + suit_ssf_manifest_class_info_t *); + +static const suit_manifest_role_t supported_roles[] = {SUIT_MANIFEST_APP_ROOT, + SUIT_MANIFEST_APP_LOCAL_1}; + +/* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ +static const suit_uuid_t nordic_vendor_id = {{0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, + 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4}}; + +/* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_root') */ +static const suit_uuid_t sample_root_class_id = {{0x3f, 0x6a, 0x3a, 0x4d, 0xcd, 0xfa, 0x58, 0xc5, + 0xac, 0xce, 0xf9, 0xf5, 0x84, 0xc4, 0x11, 0x24}}; + +/* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_app') */ +static const suit_uuid_t sample_app_class_id = {{0x08, 0xc1, 0xb5, 0x99, 0x55, 0xe8, 0x5f, 0xbc, + 0x9e, 0x76, 0x7b, 0xc2, 0x9c, 0xe1, 0xb0, 0x4d}}; + +#define MAX_UPDATE_REGIONS 10 +suit_plat_mreg_t requested_update_regions[MAX_UPDATE_REGIONS]; + +static int fetch_source_fn(const uint8_t *uri, size_t uri_length, uint32_t session_id) +{ + const uint8_t *data = NULL; + size_t len = 0; + + zassert_not_null(uri); + + if (memcmp(uri, "app.suit", MIN(sizeof("app.suit"), uri_length)) == 0) { + /* Fetch application envelope */ + data = manifest_valid_payload_fetch_app_buf; + len = manifest_valid_payload_fetch_app_len; + } else if (memcmp(uri, "payload1.bin", MIN(sizeof("payload1.bin"), uri_length)) == 0) { + data = payload1; + len = sizeof(payload1); + } else if (memcmp(uri, "payload2.bin", MIN(sizeof("payload2.bin"), uri_length)) == 0) { + data = payload2; + len = sizeof(payload2); + } else if (memcmp(uri, "payload3.bin", MIN(sizeof("payload3.bin"), uri_length)) == 0) { + data = payload3; + len = sizeof(payload3); + } else { + return -1; + } + + return suit_dfu_fetch_source_write_fetched_data(session_id, data, len); +} + +suit_ssf_err_t suit_get_supported_manifest_roles_custom_fake(suit_manifest_role_t *roles, + size_t *size) +{ + zassert_not_null(roles, "get supported roles - NULL roles argument"); + zassert_not_null(size, "get supported roles - NULL size argument"); + zassert_true(*size >= ARRAY_SIZE(supported_roles), + "Not enough space for storing supported roles"); + + memcpy(roles, supported_roles, sizeof(supported_roles)); + *size = 2; + + return SUIT_PLAT_SUCCESS; +} + +suit_ssf_err_t +suit_get_supported_manifest_info_custom_fake(suit_manifest_role_t role, + suit_ssf_manifest_class_info_t *class_info) +{ + zassert_not_null(class_info, "get supported manifest info - NULL info argument"); + + if (role == SUIT_MANIFEST_APP_ROOT) { + memcpy(&class_info->class_id, &sample_root_class_id, sizeof(sample_root_class_id)); + } else if (role == SUIT_MANIFEST_APP_LOCAL_1) { + memcpy(&class_info->class_id, &sample_app_class_id, sizeof(sample_app_class_id)); + } else { + return SUIT_PLAT_ERR_NOT_FOUND; + } + + memcpy(&class_info->vendor_id, &nordic_vendor_id, sizeof(nordic_vendor_id)); + class_info->role = role; + + return SUIT_PLAT_SUCCESS; +} + +int suit_update_trigger_custom_fake_correct_function(suit_plat_mreg_t *regions, size_t len) +{ + len = (len <= MAX_UPDATE_REGIONS) ? len : MAX_UPDATE_REGIONS; + + memcpy(requested_update_regions, regions, len * sizeof(suit_plat_mreg_t)); + + return 0; +} + +static void *setup_suite(void) +{ + zassert_equal(0, suit_dfu_initialize(), "SUIT DFU module not initialized correctly"); + + zassert_true(device_is_ready(DFU_PARTITION_DEVICE), "Flash device not ready"); + + zassert_equal(SUIT_PLAT_SUCCESS, suit_dfu_fetch_source_register(fetch_source_fn), + "Failed to register fetch source"); + + return NULL; +} + +static void cleanup_all_and_verify_empty(void) +{ + /* This function should perform all needed cleanup */ + /* Note - this will clear part of the flash before each test and cause possible + * quick wearing off of the flash memory. + */ + zassert_equal(0, suit_dfu_cleanup(), "SUIT DFU cleanup failed"); + + uint8_t *partition_address = (uint8_t *)DFU_PARTITION_ADDRESS; + bool partition_empty = true; + + for (size_t i = 0; i < DFU_PARTITION_SIZE; i++) { + if (partition_address[i] != 0xFF) { + partition_empty = false; + break; + } + } + + zassert_true(partition_empty, "DFU partition is not empty after cleanup"); + + /* Check if cache partitions have been cleared */ + partition_address = (uint8_t *)CACHE_PARTITION_ADDRESS(1); + partition_empty = true; + for (size_t i = 0; i < CACHE_PARTITION_SIZE(1); i++) { + if (partition_address[i] != 0xFF) { + partition_empty = false; + break; + } + } + zassert_true(partition_empty, "Cache partition 1 is not empty after cleanup"); + + /* Check if cache partitions have been cleared */ + partition_address = (uint8_t *)CACHE_PARTITION_ADDRESS(3); + partition_empty = true; + for (size_t i = 0; i < CACHE_PARTITION_SIZE(3); i++) { + if (partition_address[i] != 0xFF) { + partition_empty = false; + break; + } + } + zassert_true(partition_empty, "Cache partition 3 is not empty after cleanup"); +} + +static void setup_test(void *f) +{ + (void)f; + + ssf_fakes_reset(); + RESET_FAKE(suit_get_supported_manifest_roles); + RESET_FAKE(suit_get_supported_manifest_info); + + memset(requested_update_regions, 0XFF, sizeof(requested_update_regions)); + + cleanup_all_and_verify_empty(); +} + +ZTEST_SUITE(orchestrator_app_full_processing_tests, NULL, setup_suite, setup_test, NULL, NULL); + +ZTEST(orchestrator_app_full_processing_tests, test_valid_envelope) +{ + suit_trigger_update_fake.custom_fake = suit_update_trigger_custom_fake_correct_function; + + fill_dfu_partition_with_data(manifest_valid_buf, manifest_valid_len); + + zassert_equal(0, suit_dfu_candidate_envelope_stored(), "Unexpected error code"); + zassert_equal(0, suit_dfu_candidate_preprocess(), "Unexpected error code"); + zassert_equal(0, suit_dfu_update_start(), "Unexpected error code"); + + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_trigger_update() calls"); + /* Regions count argument - value of 4 because we have: + * - update candidate (always present) + * - cache pool 0 (always present if the dfu cache module is enabled) + * - cache pools 1 and 3 - defined in the devicetree overlay + */ + zassert_equal(suit_trigger_update_fake.arg1_val, 4, + "Incorrect number of regions passed to suit_trigger_update()"); + + zassert_equal(requested_update_regions[0].mem, DFU_PARTITION_ADDRESS); + zassert_equal(requested_update_regions[0].size, manifest_valid_len); +} + +ZTEST(orchestrator_app_full_processing_tests, test_unsupported_component) +{ + fill_dfu_partition_with_data(manifest_unsupported_component_buf, + manifest_unsupported_component_len); + + zassert_equal(0, suit_dfu_candidate_envelope_stored(), "Unexpected error code"); + zassert_not_equal(0, suit_dfu_candidate_preprocess(), + "Processing envelope should have failed"); +} + +static void check_cache_slot_content(uint8_t cache_partition_id, const uint8_t *uri, size_t uri_len, + const uint8_t *expected_data, size_t expected_size) +{ + suit_plat_err_t ret = SUIT_PLAT_SUCCESS; + const uint8_t *partition_address; + size_t partition_size; + const uint8_t *result_data; + size_t result_len; + + ret = suit_dfu_cache_rw_partition_info_get(cache_partition_id, &partition_address, + &partition_size); + zassert_equal(SUIT_PLAT_SUCCESS, ret, "Getting cache partition %d info failed", + cache_partition_id); + + /* Find the given slot in cache */ + ret = suit_dfu_cache_search(uri, uri_len, &result_data, &result_len); + zassert_equal(SUIT_PLAT_SUCCESS, ret, "Finding slot for URI in cache failed!"); + + zassert_true(result_data >= partition_address && + (result_data + result_len) < (partition_address + partition_size), + "Slot for the URI is not in partition %d", cache_partition_id); + + zassert_equal(result_len, expected_size, "Incorrect cache slot size"); + zassert_mem_equal(result_data, expected_data, expected_size, + "Incorrect cache slot contents"); +} + +ZTEST(orchestrator_app_full_processing_tests, test_valid_envelope_payload_fetch) +{ + suit_trigger_update_fake.custom_fake = suit_update_trigger_custom_fake_correct_function; + suit_get_supported_manifest_roles_fake.custom_fake = + suit_get_supported_manifest_roles_custom_fake; + suit_get_supported_manifest_info_fake.custom_fake = + suit_get_supported_manifest_info_custom_fake; + + fill_dfu_partition_with_data(manifest_valid_payload_fetch_buf, + manifest_valid_payload_fetch_len); + + zassert_equal(0, suit_dfu_candidate_envelope_stored(), "Unexpected error code"); + zassert_equal(0, suit_dfu_candidate_preprocess(), "Unexpected error code"); + zassert_equal(0, suit_dfu_update_start(), "Unexpected error code"); + + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_trigger_update() calls"); + /* Regions count argument - value of 4 because we have: + * - update candidate (always present) + * - cache pool 0 (always present if the dfu cache module is enabled) + * - cache pools 1 and 3 - defined in the devicetree overlay + */ + zassert_equal(suit_trigger_update_fake.arg1_val, 4, + "Incorrect number of regions passed to suit_trigger_update()"); + + zassert_equal(requested_update_regions[0].mem, DFU_PARTITION_ADDRESS); + zassert_equal(requested_update_regions[0].size, manifest_valid_payload_fetch_len); + + check_cache_slot_content(0, "payload1.bin", sizeof("payload1.bin"), payload1, + sizeof(payload1)); + check_cache_slot_content(1, "payload2.bin", sizeof("payload2.bin"), payload2, + sizeof(payload2)); + check_cache_slot_content(3, "payload3.bin", sizeof("payload3.bin"), payload3, + sizeof(payload3)); + cleanup_all_and_verify_empty(); +} + +#endif /* CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_FULL_PROCESSING */ diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/src/main_minimal_processing.c b/tests/subsys/suit/orchestrator/orchestrator_app/src/main_minimal_processing.c new file mode 100644 index 000000000000..241cf46801fc --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/src/main_minimal_processing.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#if CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_MINIMAL_PROCESSING + +#include + +#include "orchestrator_app_tests_common.h" + +/* Valid envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +#define MAX_UPDATE_REGIONS 10 +suit_plat_mreg_t requested_update_regions[MAX_UPDATE_REGIONS]; + +int suit_trigger_custom_fake_correct_function(suit_plat_mreg_t *regions, size_t len) +{ + len = (len <= MAX_UPDATE_REGIONS) ? len : MAX_UPDATE_REGIONS; + + memcpy(requested_update_regions, regions, len * sizeof(suit_plat_mreg_t)); + + return 0; +} + +static void *setup_suite(void) +{ + zassert_equal(0, suit_dfu_initialize(), "SUIT DFU module not initialized correctly"); + + zassert_true(device_is_ready(DFU_PARTITION_DEVICE), "Flash device not ready"); + + return NULL; +} + +static void setup_test(void *f) +{ + (void)f; + + ssf_fakes_reset(); + memset(requested_update_regions, 0XFF, sizeof(requested_update_regions)); + + /* This function should perform all needed cleanup */ + /* Note - this will clear part of the flash before each test and cause possible + * quick wearing off of the flash memory. + */ + zassert_equal(0, suit_dfu_cleanup(), "SUIT DFU cleanup failed"); + + uint8_t *partition_address = (uint8_t *)DFU_PARTITION_ADDRESS; + bool partition_empty = true; + + for (size_t i = 0; i < DFU_PARTITION_SIZE; i++) { + if (partition_address[i] != 0xFF) { + partition_empty = false; + break; + } + } + + zassert_true(partition_empty, "DFU partition is not empty after cleanup"); +} + +ZTEST_SUITE(orchestrator_app_minimal_processing_tests, NULL, setup_suite, setup_test, NULL, NULL); + +ZTEST(orchestrator_app_minimal_processing_tests, test_valid_envelope) +{ + suit_trigger_update_fake.custom_fake = suit_trigger_custom_fake_correct_function; + + fill_dfu_partition_with_data(manifest_valid_buf, manifest_valid_len); + + zassert_equal(0, suit_dfu_candidate_envelope_stored(), "Unexpected error code"); + zassert_equal(0, suit_dfu_candidate_preprocess(), "Unexpected error code"); + zassert_equal(0, suit_dfu_update_start(), "Unexpected error code"); + + zassert_equal(suit_trigger_update_fake.call_count, 1, + "Incorrect number of suit_trigger_update() calls"); + zassert_equal(suit_trigger_update_fake.arg1_val, 1, + "Incorrect number of regions passed to suit_trigger_update()"); + + zassert_equal(requested_update_regions[0].mem, DFU_PARTITION_ADDRESS); + zassert_equal(requested_update_regions[0].size, manifest_valid_len); +} + +ZTEST(orchestrator_app_minimal_processing_tests, test_malformed_envelope) +{ + uint8_t malformed_envelope[256] = {0}; + + fill_dfu_partition_with_data(malformed_envelope, sizeof(malformed_envelope)); + + zassert_not_equal(0, suit_dfu_candidate_envelope_stored(), + "suit_dfu_candidate_envelope_stored should have failed"); + zassert_not_equal(0, suit_dfu_update_start(), "suit_dfu_update_start should have failed"); + + zassert_equal(suit_trigger_update_fake.call_count, 0, + "Incorrect number of suit_trigger_update() calls"); +} + +#endif /* CONFIG_TESTS_SUIT_ORCHESTRATOR_APP_MINIMAL_PROCESSING */ diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/src/orchestrator_app_tests_common.h b/tests/subsys/suit/orchestrator/orchestrator_app/src/orchestrator_app_tests_common.h new file mode 100644 index 000000000000..309771e51adc --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/src/orchestrator_app_tests_common.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef ORCHESTRATOR_APP_TESTS_COMMON_H__ +#define ORCHESTRATOR_APP_TESTS_COMMON_H__ + +#include +#include +#include +#include + +#include +#include + +#define FIXED_PARTITION_WRITE_BLOCK_SIZE(label) \ + DT_PROP(DT_GPARENT(DT_NODELABEL(label)), write_block_size) + +#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_WRITE_SIZE FIXED_PARTITION_WRITE_BLOCK_SIZE(DFU_PARTITION_LABEL) +#define DFU_PARTITION_DEVICE FIXED_PARTITION_DEVICE(DFU_PARTITION_LABEL) + +void fill_dfu_partition_with_data(const uint8_t *data_address, size_t data_size); + +void ssf_fakes_reset(void); + +DECLARE_FAKE_VALUE_FUNC(int, suit_trigger_update, suit_plat_mreg_t *, size_t); + +#endif /* ORCHESTRATOR_APP_TESTS_COMMON_H__ */ diff --git a/tests/subsys/suit/orchestrator/orchestrator_app/testcase.yaml b/tests/subsys/suit/orchestrator/orchestrator_app/testcase.yaml new file mode 100644 index 000000000000..6cf899a9ac0e --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_app/testcase.yaml @@ -0,0 +1,16 @@ +tests: + suit.integration.orchestrator_app.minimal: + platform_allow: native_posix + tags: suit suit_orchestrator_app suit_orchestrator_app_minimal + timeout: 240 + extra_args: OVERLAY_CONFIG=minimal_processing.conf + integration_platforms: + - native_posix + + suit.integration.orchestrator_app.full: + platform_allow: native_posix + tags: suit suit_orchestrator_app suit_orchestrator_app_full + timeout: 240 + extra_args: OVERLAY_CONFIG=full_processing.conf + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/CMakeLists.txt b/tests/subsys/suit/orchestrator/orchestrator_sdfw/CMakeLists.txt new file mode 100644 index 000000000000..d39c2ac91cd9 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# Copyright (c) 2023 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(integration_test_suit_orchestrator) +include(../../cmake/test_template.cmake) + +FILE(GLOB manifest_sources ../manifest/src/*.c) +target_sources(app PRIVATE + ${manifest_sources} + ) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_orchestrator_interface) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_update_magic_values) +zephyr_library_link_libraries(suit_cache_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/orchestrator/orchestrator_sdfw/boards/native_posix.overlay b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix.overlay new file mode 100644 index 000000000000..8e0acfe05a16 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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/orchestrator/orchestrator_sdfw/boards/native_posix_64.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/orchestrator/orchestrator_sdfw/boards/native_posix_64.overlay b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix_64.overlay new file mode 100644 index 000000000000..8e0acfe05a16 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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/orchestrator/orchestrator_sdfw/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..e796eb83bd34 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 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/orchestrator/orchestrator_sdfw/prj.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf new file mode 100644 index 000000000000..3a331bb27d72 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/prj.conf @@ -0,0 +1,50 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y +CONFIG_ZTEST_STACK_SIZE=4096 + +CONFIG_SUIT=y +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_MCI_IMPL_CUSTOM=y +CONFIG_SUIT_METADATA=y +CONFIG_SUIT_ORCHESTRATOR=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_LOG_LEVEL_DBG=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +# Use lower value to verify overflows +CONFIG_SUIT_CACHE_MAX_CACHES=5 +CONFIG_SUIT_STORAGE=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_EXECUTION_MODE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y + +CONFIG_SUIT_DEVCONFIG=y +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_PLAT_CHECK_CLASSES=y +CONFIG_SUIT_AUTHENTICATE=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y + +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_FLASH_MAP=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_boot_mode.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_boot_mode.c new file mode 100644 index 000000000000..a4590d6bf72b --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_boot_mode.c @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) +#define ZEPHYR_FLASH_EB_SIZE DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size) + +/* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ +static const suit_manifest_class_id_t root_class_id = {{0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, + 0xa1, 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, + 0x4b, 0x0a}}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_app') */ +static const suit_manifest_class_id_t app_class_id = {{0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, 0x53, + 0x9c, 0xa3, 0x18, 0x68, 0x1b, 0x03, 0x69, + 0x5e, 0x36}}; + +/* Empty root envelope with invoke sequence */ +extern const uint8_t manifest_root_no_validate_buf[]; +extern const size_t manifest_root_no_validate_len; + +/* Empty root envelope with invoke and failig validate sequences */ +extern const uint8_t manifest_root_validate_fail_buf[]; +extern const size_t manifest_root_validate_fail_len; + +/* Empty root envelope with validate, invoke and failing load sequences */ +extern const uint8_t manifest_root_validate_load_fail_buf[]; +extern const size_t manifest_root_validate_load_fail_len; + +/* Empty root envelope with validate and load sequences */ +extern const uint8_t manifest_root_validate_load_no_invoke_buf[]; +extern const size_t manifest_root_validate_load_no_invoke_len; + +/* Empty root envelope with validate, load and failing invoke sequences */ +extern const uint8_t manifest_root_validate_load_invoke_fail_buf[]; +extern const size_t manifest_root_validate_load_invoke_fail_len; + +/* Empty root envelope with validate, load and invoke sequences */ +extern const uint8_t manifest_root_validate_load_invoke_buf[]; +extern const size_t manifest_root_validate_load_invoke_len; + +/* Valid root envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +/* Valid application envelope */ +extern const uint8_t manifest_valid_app_buf[]; +extern const size_t manifest_valid_app_len; + +/* Originally valid envelope with manipulated single byte */ +extern const uint8_t manifest_manipulated_buf[]; +extern const size_t manifest_manipulated_len; + +/* Random bytes, attached to the envelopes as FW. */ +extern const uint8_t sample_fw_buf[]; +extern const size_t sample_fw_len; +extern const uintptr_t sample_fw_address; + +static void *setup_install_fw(void) +{ + int err = 0; + uint8_t *sample_fw_ptr = suit_plat_mem_ptr_get(sample_fw_address); + uintptr_t sample_fw_offset = suit_plat_mem_nvm_offset_get(sample_fw_ptr); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + if (sample_fw_len > ZEPHYR_FLASH_EB_SIZE) { + err = flash_erase(fdev, sample_fw_offset, sample_fw_len); + } else { + err = flash_erase(fdev, sample_fw_offset, ZEPHYR_FLASH_EB_SIZE); + } + zassert_equal(0, err, "Unable to erase test FW area before test execution"); + + err = flash_write(fdev, sample_fw_offset, sample_fw_buf, sample_fw_len); + zassert_equal(0, err, "Unable to write test FW area before test execution"); + + return NULL; +} + +static void setup_erased_flash(void) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); + + /* Recover MPI area from the backup region. */ + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to recover MPI area from backup (%d)", err); +} + +static void setup_install_envelope(const suit_manifest_class_id_t *class_id, const uint8_t *buf, + size_t len) +{ + suit_plat_err_t err = suit_storage_install_envelope(class_id, (uint8_t *)buf, len); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to install envelope before test execution (0x%x, %d)", buf, len); +} + +ZTEST_SUITE(orchestrator_boot_tests, NULL, setup_install_fw, NULL, NULL, NULL); + +ZTEST(orchestrator_boot_tests, test_invalid_exec_mode) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to post mode */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_execution_mode_set(EXECUTION_MODE_POST_INVOKE), + "Unable to override execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails... */ + zassert_equal(-EINVAL, err, "Orchestrator did not fail"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_POST_INVOKE, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_no_root_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_invalid_root_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope is installed... */ + setup_install_envelope(&root_class_id, manifest_manipulated_buf, manifest_manipulated_len); + /* ... and application envelope is installed... */ + setup_install_envelope(&app_class_id, manifest_valid_app_buf, manifest_valid_app_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_valid_root_without_app_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope is installed... */ + setup_install_envelope(&root_class_id, manifest_valid_buf, manifest_valid_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_valid_root_app_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope is installed... */ + setup_install_envelope(&root_class_id, manifest_valid_buf, manifest_valid_len); + /* ... and application envelope is installed... */ + setup_install_envelope(&app_class_id, manifest_valid_app_buf, manifest_valid_app_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator succeeds... */ + zassert_equal(0, err, "Orchestrator not initialized"); + /* ... and the emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Emergency flag set"); + /* ... and the execution mode is set to the POST INVOKE */ + zassert_equal(EXECUTION_MODE_POST_INVOKE, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_no_validate) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope without suit-validate sequence is installed... */ + setup_install_envelope(&root_class_id, manifest_root_no_validate_buf, + manifest_root_no_validate_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_validate_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope with failing suit-validate sequence is installed... */ + setup_install_envelope(&root_class_id, manifest_root_validate_fail_buf, + manifest_root_validate_fail_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_validate_load_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope with failing suit-load sequence is installed... */ + setup_install_envelope(&root_class_id, manifest_root_validate_load_fail_buf, + manifest_root_validate_load_fail_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_validate_load_no_invoke) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope without suit-invoke sequence is installed... */ + setup_install_envelope(&root_class_id, manifest_root_validate_load_no_invoke_buf, + manifest_root_validate_load_no_invoke_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_validate_load_invoke_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope with failing suit-invoke sequence is installed... */ + setup_install_envelope(&root_class_id, manifest_root_validate_load_invoke_fail_buf, + manifest_root_validate_load_invoke_fail_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(-ENOTSUP, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), "Execution mode modified"); +} + +ZTEST(orchestrator_boot_tests, test_seq_validate_load_invoke) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and root envelope without dependencies is installed... */ + setup_install_envelope(&root_class_id, manifest_root_validate_load_invoke_buf, + manifest_root_validate_load_invoke_len); + /* ... and application envelope is not installed... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Unexpected emergency recovery flag before test execution"); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to regular boot */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (no support for reboots)... */ + zassert_equal(0, err, "Orchestrator not initialized"); + /* ... and the emergency flag is not set... */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Emergency flag not set"); + /* ... and the execution mode is set to the POST INVOKE */ + zassert_equal(EXECUTION_MODE_POST_INVOKE, suit_execution_mode_get(), + "Execution mode modified"); +} diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_init.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_init.c new file mode 100644 index 000000000000..611bd02c86b5 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_init.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) + +/* Valid envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +static void setup_erased_flash(void) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); + + /* Recover MPI area from the backup region. */ + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to recover MPI area from backup (%d)", err); +} + +static void setup_update_candidate(const uint8_t *buf, size_t len) +{ + zassert_not_null(buf, "NULL buf"); + + suit_plat_mreg_t update_candidate[1] = {{ + .mem = buf, + .size = len, + }}; + + suit_plat_err_t err = + suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set update candidate before test execution (0x%x, %d)", buf, len); +} + +static void setup_boot_report(uint8_t *buf, size_t len) +{ + suit_plat_err_t err = suit_storage_report_save(0, buf, len); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set boot report (emergency flag) before test execution (0x%x, %d)", + buf, len); +} + +ZTEST_SUITE(orchestrator_init_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(orchestrator_init_tests, test_empty_storage) +{ + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN regular boot is triggered... */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Regular boot not triggered"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_init_tests, test_empty_storage_with_update_flag) +{ + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN regular update is triggered... */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Regular update not triggered"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_init_tests, test_empty_storage_with_recovery_flag) +{ + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set */ + setup_boot_report(NULL, 0); + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN emergency recovery is triggered... */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Recovery mode not triggered"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_init_tests, test_empty_storage_with_update_recovery_flag) +{ + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and emergency flag is set */ + setup_boot_report(NULL, 0); + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN emergency recovery update is triggered... */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Emergency recovery update not triggered"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} 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 new file mode 100644 index 000000000000..2607e0d0b0e0 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_boot_mode.c @@ -0,0 +1,431 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) +#define ZEPHYR_FLASH_EB_SIZE DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size) + +/* RFC4122 uuid5(nordic_vid, 'test_sample_recovery') + */ +static const suit_manifest_class_id_t recovery_class_id = {{0x74, 0xa0, 0xc6, 0xe7, 0xa9, 0x2a, + 0x56, 0x00, 0x9c, 0x5d, 0x30, 0xee, + 0x87, 0x8b, 0x06, 0xba}}; + +/* Empty recovery envelope with invoke sequence */ +extern const uint8_t manifest_recovery_no_validate_buf[]; +extern const size_t manifest_recovery_no_validate_len; + +/* Empty recovery envelope with invoke and failig validate sequences */ +extern const uint8_t manifest_recovery_validate_fail_buf[]; +extern const size_t manifest_recovery_validate_fail_len; + +/* Empty recovery envelope with validate, invoke and failing load sequences */ +extern const uint8_t manifest_recovery_validate_load_fail_buf[]; +extern const size_t manifest_recovery_validate_load_fail_len; + +/* Empty recovery envelope with validate and load sequences */ +extern const uint8_t manifest_recovery_validate_load_no_invoke_buf[]; +extern const size_t manifest_recovery_validate_load_no_invoke_len; + +/* Empty recovery envelope with validate, load and failing invoke sequences */ +extern const uint8_t manifest_recovery_validate_load_invoke_fail_buf[]; +extern const size_t manifest_recovery_validate_load_invoke_fail_len; + +/* Empty recovery envelope with validate, load and invoke sequences */ +extern const uint8_t manifest_recovery_validate_load_invoke_buf[]; +extern const size_t manifest_recovery_validate_load_invoke_len; + +/* Valid recovery envelope */ +extern const uint8_t manifest_valid_recovery_buf[]; +extern const size_t manifest_valid_recovery_len; + +/* Originally valid recovery envelope with manipulated single byte */ +extern const uint8_t manifest_manipulated_recovery_buf[]; +extern const size_t manifest_manipulated_recovery_len; + +/* Random bytes, attached to the envelopes as FW. */ +extern const uint8_t sample_fw_buf[]; +extern const size_t sample_fw_len; +extern const uintptr_t sample_recovery_fw_address; + +static void *setup_install_recovery_fw(void) +{ + int err = 0; + uint8_t *sample_recovery_fw_ptr = suit_plat_mem_ptr_get(sample_recovery_fw_address); + uintptr_t sample_recovery_fw_offset = suit_plat_mem_nvm_offset_get(sample_recovery_fw_ptr); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + if (sample_fw_len > ZEPHYR_FLASH_EB_SIZE) { + err = flash_erase(fdev, sample_recovery_fw_offset, sample_fw_len); + } else { + err = flash_erase(fdev, sample_recovery_fw_offset, ZEPHYR_FLASH_EB_SIZE); + } + zassert_equal(0, err, "Unable to erase test FW area before test execution"); + + err = flash_write(fdev, sample_recovery_fw_offset, sample_fw_buf, sample_fw_len); + zassert_equal(0, err, "Unable to write test FW area before test execution"); + + return NULL; +} + +static void setup_erased_flash(void) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); + + /* Recover MPI area from the backup region. */ + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to recover MPI area from backup (%d)", err); +} + +static void setup_install_envelope(const suit_manifest_class_id_t *class_id, const uint8_t *buf, + size_t len) +{ + suit_plat_err_t err = suit_storage_install_envelope(class_id, (uint8_t *)buf, len); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to install envelope before test execution (0x%x, %d)", buf, len); +} + +static void setup_boot_report(uint8_t *buf, size_t len) +{ + suit_plat_err_t err = suit_storage_report_save(0, buf, len); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set boot report (emergency flag) before test execution (0x%x, %d)", + buf, len); +} + +ZTEST_SUITE(orchestrator_recovery_boot_tests, NULL, setup_install_recovery_fw, NULL, NULL, NULL); + +ZTEST(orchestrator_recovery_boot_tests, test_no_recovery_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-ENOENT, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_invalid_recovery_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope is installed... */ + setup_install_envelope(&recovery_class_id, manifest_manipulated_recovery_buf, + manifest_manipulated_recovery_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_valid_recovery_envelope) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope is installed... */ + setup_install_envelope(&recovery_class_id, manifest_valid_recovery_buf, + manifest_valid_recovery_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails succeeds... */ + zassert_equal(0, err, "Orchestrator not initialized"); + /* ... and the emergency flag is set... */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), + "Emergency flag not set"); + /* ... and the execution mode is set to the POST INVOKE RECOVERY */ + zassert_equal(EXECUTION_MODE_POST_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode not changed to the POST INVOKE RECOVERY"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_no_validate) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_no_validate_buf, + manifest_recovery_no_validate_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_validate_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope with failing suit-validate sequence is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_validate_fail_buf, + manifest_recovery_validate_fail_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_validate_load_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope with failing suit-load sequence is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_validate_load_fail_buf, + manifest_recovery_validate_load_fail_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_validate_load_no_invoke) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope without suit-invoke sequence is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_validate_load_no_invoke_buf, + manifest_recovery_validate_load_no_invoke_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_validate_load_invoke_fail) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope with failing suit-invoke sequence is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_validate_load_invoke_fail_buf, + manifest_recovery_validate_load_invoke_fail_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails (hard)... */ + zassert_equal(-EACCES, 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"); + /* ... and the execution mode remains unchanged */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +ZTEST(orchestrator_recovery_boot_tests, test_seq_validate_load_invoke) +{ + const uint8_t *buf; + size_t len; + + /* GIVEN empty flash (suit storage is erased)... */ + setup_erased_flash(); + /* ... and recovery envelope without dependencies is installed... */ + setup_install_envelope(&recovery_class_id, manifest_recovery_validate_load_invoke_buf, + manifest_recovery_validate_load_invoke_len); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is set... */ + setup_boot_report(NULL, 0); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), + "Orchestrator not initialized before test execution"); + /* ... and the execution mode is set to emergency boot */ + zassert_equal(EXECUTION_MODE_INVOKE_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is executed */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator fails succeeds... */ + zassert_equal(0, err, "Orchestrator not initialized"); + /* ... and the emergency flag is set... */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), + "Emergency flag not set"); + /* ... and the execution mode is set to the POST INVOKE RECOVERY */ + zassert_equal(EXECUTION_MODE_POST_INVOKE_RECOVERY, suit_execution_mode_get(), + "Execution mode not changed to the POST INVOKE RECOVERY"); +} 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 new file mode 100644 index 000000000000..afef334d1006 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_recovery_update_mode.c @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif + +/* RFC4122 uuid5(nordic_vid, 'test_sample_app') */ +static const suit_manifest_class_id_t supported_class_id = {{0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, + 0x53, 0x9c, 0xa3, 0x18, 0x68, 0x1b, + 0x03, 0x69, 0x5e, 0x36}}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ +static const suit_manifest_class_id_t root_class_id = {{0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, + 0xa1, 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, + 0x4b, 0x0a}}; + +/* Valid root envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +/* Valid recovery envelope */ +extern const uint8_t manifest_valid_recovery_buf[]; +extern const size_t manifest_valid_recovery_len; + +static void setup_erased_flash(void) +{ + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + int err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + + zassert_equal(0, err, "Unable to erase storage before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); + + /* Recover MPI area from the backup region. */ + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to recover MPI area from backup (%d)", err); +} + +static void setup_update_candidate(const uint8_t *buf, size_t len) +{ + zassert_not_null(buf, "NULL buf"); + + suit_plat_mreg_t update_candidate[1] = {{ + .mem = buf, + .size = len, + }}; + + int err = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set update candidate before test execution (0x%x, %d)", buf, len); +} + +static void assert_post_recovery_install_state(void) +{ + const suit_plat_mreg_t *regions = NULL; + const uint8_t *buf = NULL; + size_t len = 0; + + /* Each install attempt must at the end: */ + /* - clear the candidate availability flag */ + suit_plat_err_t ret = suit_storage_update_cand_get(®ions, &len); + + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, ret, "Update candidate presence not cleared"); + /* - do not modify the emergency flag */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Emergency flag changed"); + /* - do not modify the execution mode */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +static void assert_post_recovery_install_failed_state(void) +{ + const suit_plat_mreg_t *regions = NULL; + const uint8_t *buf = NULL; + size_t len = 0; + + /* Each install attempt must at the end: */ + /* - clear the candidate availability flag */ + suit_plat_err_t ret = suit_storage_update_cand_get(®ions, &len); + + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, ret, "Update candidate presence not cleared"); + /* - do not modify the emergency flag */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_storage_report_read(0, &buf, &len), + "Emergency flag changed"); + /* - do not modify the execution mode */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Execution mode modified"); +} + +static void orchestrator_tests_cleanup(void *fixture) +{ + (void)fixture; + suit_dfu_cache_deinitialize(); +} + +static void enter_recovery_mode(void *fixture) +{ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + setup_erased_flash(); + + suit_plat_err_t ret = suit_storage_report_save(0, NULL, 0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to set boot report (emergency flag) before test execution"); +} + +ZTEST_SUITE(orchestrator_recovery_update_tests, NULL, NULL, enter_recovery_mode, + orchestrator_tests_cleanup, NULL); + +ZTEST(orchestrator_recovery_update_tests, test_successful_update) +{ + const uint8_t *addr; + size_t size; + + /* GIVEN valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and suit orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install recovery mode */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN installation is performed successfully... */ + /* ... and orchestrator exits without an error... */ + zassert_equal(0, err, "Unexpected error code"); + /* ... and the application envelope get installed... */ + err = suit_storage_installed_envelope_get(&supported_class_id, &addr, &size); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The application envelope was not installed after successful update"); + /* ... and the root envelope get installed... */ + err = suit_storage_installed_envelope_get(&root_class_id, &addr, &size); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The root envelope was not installed after successful update"); + /* ... and the candidate availability flag is cleared */ + assert_post_recovery_install_state(); +} + +ZTEST(orchestrator_recovery_update_tests, test_successful_update_and_boot) +{ + const uint8_t *addr_boot; + size_t size_boot; + const uint8_t *addr_update; + size_t size_update; + + /* GIVEN valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and suit orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized first time"); + /* ... and the execution mode is set to install recovery mode... */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test preparation"); + /* ... and orchestrator is launched first time to perform successful update... */ + zassert_equal(0, suit_orchestrator_entry(), "Unsuccessful first orchestrator launch"); + /* ... and the root envelope is installed... */ + int err = suit_storage_installed_envelope_get(&root_class_id, &addr_boot, &size_boot); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The root envelope was not installed after successful update"); + /* ... and the application envelope is installed... */ + err = suit_storage_installed_envelope_get(&supported_class_id, &addr_boot, &size_boot); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The application envelope was not installed after successful update"); + /* ... and the candidate availability flag is cleared */ + assert_post_recovery_install_state(); + + /* WHEN when orchestrator is initialized again (reboot simulation)... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized second time"); + /* ... and the execution mode is set to invoke mode */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + /* ... and orchestrator is launched again */ + err = suit_orchestrator_entry(); + + /* THEN installed SW is invoked successfully (orchestrator returns no error)... */ + zassert_equal(0, err, "Unexpected error code"); + /* ... and the root envelope remains installed... */ + err = suit_storage_installed_envelope_get(&root_class_id, &addr_update, &size_update); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The root envelope was not installed after successful update"); + /* ... and the envelope remains installed... */ + err = suit_storage_installed_envelope_get(&supported_class_id, &addr_update, &size_update); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The application envelope was not installed after successful update"); + /* .. and the same index in SUIT storage is used... */ + zassert_equal(addr_boot, addr_update, + "The envelope was not installed in the same SUIT storage slot"); + /* ... and the execution mode is set to post invoke mode */ + zassert_equal(EXECUTION_MODE_POST_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode after test execution"); +} + +ZTEST(orchestrator_recovery_update_tests, test_invalid_exec_mode) +{ + /* GIVEN suit storage does not indicate presence of update candidate... */ + setup_erased_flash(); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is forced to install recovery mode */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_execution_mode_set(EXECUTION_MODE_INSTALL_RECOVERY), + "Unable to override execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag remains cleared */ + assert_post_recovery_install_state(); +} + +ZTEST(orchestrator_recovery_update_tests, test_independent_updates_denied) +{ + /* GIVEN suit storage contains recovery FW update... */ + setup_update_candidate(manifest_valid_recovery_buf, manifest_valid_recovery_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install recovery mode */ + zassert_equal(EXECUTION_MODE_INSTALL_RECOVERY, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_recovery_install_failed_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 new file mode 100644 index 000000000000..08881515de6f --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/src/test_update_mode.c @@ -0,0 +1,564 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) + +/* RFC4122 uuid5(nordic_vid, 'test_sample_app') */ +static const suit_manifest_class_id_t supported_class_id = {{0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, + 0x53, 0x9c, 0xa3, 0x18, 0x68, 0x1b, + 0x03, 0x69, 0x5e, 0x36}}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ +static const suit_manifest_class_id_t root_class_id = {{0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, + 0xa1, 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, + 0x4b, 0x0a}}; + +/* Valid root envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +/* Valid application envelope */ +extern const uint8_t manifest_valid_app_buf[]; +extern const size_t manifest_valid_app_len; + +/* Manifest generated using component id with size field set to zero */ +extern const uint8_t manifest_zero_size_buf[]; +extern const size_t manifest_zero_size_len; + +/* Originally valid envelope with manipulated single byte */ +extern const uint8_t manifest_manipulated_buf[]; +extern const size_t manifest_manipulated_len; + +/* Envelope generated with "UNSUPPORTED!" as a component type */ +extern const uint8_t manifest_unsupported_component_buf[]; +extern const size_t manifest_unsupported_component_len; + +/* Envelope with manifest version set to 2 */ +extern const uint8_t manifest_wrong_version_buf[]; +extern const size_t manifest_wrong_version_len; + +/* Envelope signed with a different private key */ +extern const uint8_t manifest_different_key_buf[]; +extern const size_t manifest_different_key_len; + +/* Empty root envelope with unsupported command (invoke on CAND_MFST) inside install sequence */ +extern const uint8_t manifest_root_unsupported_command_buf[]; +extern const size_t manifest_root_unsupported_command_len; + +/* Empty root envelope with install and failing candidate-verification sequences */ +extern const uint8_t manifest_root_candidate_verification_fail_buf[]; +extern const size_t manifest_root_candidate_verification_fail_len; + +/* Empty root envelope with candidate-verification sequence */ +extern const uint8_t manifest_root_candidate_verification_no_install_buf[]; +extern const size_t manifest_root_candidate_verification_no_install_len; + +/* Empty root envelope with candidate-verification and failing install sequences */ +extern const uint8_t manifest_root_candidate_verification_install_fail_buf[]; +extern const size_t manifest_root_candidate_verification_install_fail_len; + +/* Empty root envelope with candidate-verification and install sequences */ +extern const uint8_t manifest_root_candidate_verification_install_buf[]; +extern const size_t manifest_root_candidate_verification_install_len; + +static void setup_erased_flash(void) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); + + /* Recover MPI area from the backup region. */ + err = suit_storage_init(); + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to recover MPI area from backup (%d)", err); +} + +static void setup_update_candidate(const uint8_t *buf, size_t len) +{ + zassert_not_null(buf, "NULL buf"); + + suit_plat_mreg_t update_candidate[1] = {{ + .mem = buf, + .size = len, + }}; + + setup_erased_flash(); + + int err = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set update candidate before test execution (0x%x, %d)", buf, len); +} + +static void assert_post_install_state(void) +{ + const suit_plat_mreg_t *regions = NULL; + const uint8_t *buf = NULL; + size_t len = 0; + + /* Each install attempt must at the end: */ + /* - clear the candidate availability flag */ + suit_plat_err_t ret = suit_storage_update_cand_get(®ions, &len); + + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, ret, "Update candidate presence not cleared"); + /* - do not modify the emergency flag */ + zassert_equal(SUIT_PLAT_ERR_NOT_FOUND, suit_storage_report_read(0, &buf, &len), + "Emergency flag changed"); + /* - do not modify the execution mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), "Execution mode modified"); +} + +static void orchestrator_tests_cleanup(void *fixture) +{ + (void)fixture; + suit_dfu_cache_deinitialize(); +} + +ZTEST_SUITE(orchestrator_update_tests, NULL, NULL, NULL, orchestrator_tests_cleanup, NULL); + +ZTEST(orchestrator_update_tests, test_successful_update) +{ + const uint8_t *addr; + size_t size; + + /* GIVEN valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and suit orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN installation is performed successfully... */ + /* ... and orchestrator exits without an error... */ + zassert_equal(0, err, "Unexpected error code"); + /* ... and the envelope get installed... */ + err = suit_storage_installed_envelope_get(&supported_class_id, &addr, &size); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The envelope was not installed after successful update"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_successful_update_and_boot) +{ + const uint8_t *addr_boot; + size_t size_boot; + const uint8_t *addr_update; + size_t size_update; + + /* GIVEN valid update candidate in suit storage... */ + setup_update_candidate(manifest_valid_buf, manifest_valid_len); + /* ... and suit orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized first time"); + /* ... and the execution mode is set to install mode... */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test preparation"); + /* ... and orchestrator is launched first time to perform successful update... */ + zassert_equal(0, suit_orchestrator_entry(), "Unsuccessful first orchestrator launch"); + /* ... and the bootable envelope is installed... */ + int err = suit_storage_installed_envelope_get(&supported_class_id, &addr_boot, &size_boot); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The envelope was not installed after successful update"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); + + /* WHEN when orchestrator is initialized again (reboot simulation)... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized second time"); + /* ... and the execution mode is set to invoke mode */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + /* ... and orchestrator is launched again */ + err = suit_orchestrator_entry(); + + /* THEN installed SW is invoked successfully (orchestrator returns no error)... */ + zassert_equal(0, err, "Unexpected error code"); + /* ... and the envelope remains installed... */ + err = suit_storage_installed_envelope_get(&supported_class_id, &addr_update, &size_update); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The envelope was not installed after successful update"); + /* .. and the same index in SUIT storage is used... */ + zassert_equal(addr_boot, addr_update, + "The envelope was not installed in the same SUIT storage slot"); + /* ... and the execution mode is set to post invoke mode */ + zassert_equal(EXECUTION_MODE_POST_INVOKE, suit_execution_mode_get(), + "Unexpected execution mode after test execution"); +} + +ZTEST(orchestrator_update_tests, test_envelope_size_zero) +{ + /* GIVEN suit storage contains envelope with component id's size field set to zero... */ + setup_update_candidate(manifest_zero_size_buf, manifest_zero_size_len); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Failed to setup test"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_manipulated_envelope) +{ + /* GIVEN suit storage contains envelope with one of its byte changed to different value... + */ + setup_update_candidate(manifest_manipulated_buf, manifest_manipulated_len); + /* ... and suit orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_invalid_exec_mode) +{ + /* GIVEN suit storage does not indicate presence of update candidate... */ + setup_erased_flash(); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is forced to install mode */ + zassert_equal(SUIT_PLAT_SUCCESS, suit_execution_mode_set(EXECUTION_MODE_INSTALL), + "Unable to override execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag remains cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_invalid_address_and_size) +{ + /* GIVEN suit storage indicates presence of update candidate... */ + /* ... but has empty address field...*/ + const uint8_t *buf = (const uint8_t *)UPDATE_MAGIC_VALUE_EMPTY; + /* ... and has empty size field... */ + size_t len = (size_t)UPDATE_MAGIC_VALUE_EMPTY; + + setup_update_candidate(buf, len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EFAULT, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_candidate_empty_size) +{ + /* GIVEN suit storage has update candidate flag set... */ + /* ...and some non-empty and non-zero address field...*/ + const uint8_t *buf = (const uint8_t *)0xDEADBEEF; + /* ... but empty size field... */ + size_t len = (size_t)UPDATE_MAGIC_VALUE_EMPTY; + + setup_update_candidate(buf, len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EFAULT, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_candidate_too_many_caches) +{ + suit_plat_mreg_t update_candidate[CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS] = {0}; + + for (size_t i = 0; i < ARRAY_SIZE(update_candidate); i++) { + update_candidate[i].mem = (const uint8_t *)i; + update_candidate[i].size = 0; + } + + /* GIVEN suit storage has update candidate flag set... */ + setup_erased_flash(); + /* ...and contains a valid envelope address and size...*/ + update_candidate[0].mem = manifest_valid_buf; + update_candidate[0].size = manifest_valid_len; + + int err = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(SUIT_PLAT_SUCCESS, err, + "Unable to set update candidate before test execution (length: %d)", + ARRAY_SIZE(update_candidate)); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EINVAL, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_unsupported_component) +{ + /* GIVEN suit storage contains update candidate with unsupported component... */ + setup_update_candidate(manifest_unsupported_component_buf, + manifest_unsupported_component_len); + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_wrong_manifest_version) +{ + /* GIVEN suit storage contains update candidate with invalid manifest version... */ + setup_update_candidate(manifest_wrong_version_buf, manifest_wrong_version_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_signed_with_different_key) +{ + /* GIVEN suit storage contains update candidate with invalid manifest version... */ + setup_update_candidate(manifest_different_key_buf, manifest_different_key_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_independent_updates_denied) +{ + /* GIVEN suit storage contains update candidate that cannot be independently updated... */ + setup_update_candidate(manifest_valid_app_buf, manifest_valid_app_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_unsupported_command) +{ + /* GIVEN suit storage contains update candidate with unsupported command... */ + setup_update_candidate(manifest_root_unsupported_command_buf, + manifest_root_unsupported_command_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_seq_cand_varification_fail) +{ + /* GIVEN suit storage contains update candidate with failing candidate-verification + * sequence... + */ + setup_update_candidate(manifest_root_candidate_verification_fail_buf, + manifest_root_candidate_verification_fail_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_seq_cand_varification_no_install) +{ + /* GIVEN suit storage contains update candidate without suit-install sequence... */ + setup_update_candidate(manifest_root_candidate_verification_no_install_buf, + manifest_root_candidate_verification_no_install_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_seq_cand_varification_install_fail) +{ + /* GIVEN suit storage contains update candidate with failing suit-install sequence... */ + setup_update_candidate(manifest_root_candidate_verification_install_fail_buf, + manifest_root_candidate_verification_install_fail_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN orchestrator returns error code... */ + zassert_equal(-EACCES, err, "Unexpected error code"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} + +ZTEST(orchestrator_update_tests, test_seq_cand_varification_install) +{ + const uint8_t *addr; + size_t size; + + /* GIVEN suit storage contains update candidate and suit-install sequence... */ + setup_update_candidate(manifest_root_candidate_verification_install_buf, + manifest_root_candidate_verification_install_len); + + /* ... and orchestrator is initialized... */ + zassert_equal(0, suit_orchestrator_init(), "Orchestrator not initialized"); + /* ... and the execution mode is set to install mode */ + zassert_equal(EXECUTION_MODE_INSTALL, suit_execution_mode_get(), + "Unexpected execution mode before test execution"); + + /* WHEN orchestrator is launched */ + int err = suit_orchestrator_entry(); + + /* THEN installation is performed successfully... */ + /* ... and orchestrator exits without an error... */ + zassert_equal(0, err, "Unexpected error code"); + /* ... and the envelope get installed... */ + err = suit_storage_installed_envelope_get(&root_class_id, &addr, &size); + zassert_equal(SUIT_PLAT_SUCCESS, err, + "The envelope was not installed after successful update"); + /* ... and the candidate availability flag is cleared */ + assert_post_install_state(); +} diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw/testcase.yaml b/tests/subsys/suit/orchestrator/orchestrator_sdfw/testcase.yaml new file mode 100644 index 000000000000..6612bc26e7de --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.integration.orchestrator: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit suit_orchestrator + timeout: 240 + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/CMakeLists.txt b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/CMakeLists.txt new file mode 100644 index 000000000000..611976c33cc2 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# 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(integration_test_suit_orchestrator) +include(../../cmake/test_template.cmake) + +FILE(GLOB manifest_sources ../manifest/src/*.c) +target_sources(app PRIVATE + ${manifest_sources} + ) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_orchestrator_interface) +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_update_magic_values) +zephyr_library_link_libraries(suit_cache_interface) +zephyr_library_link_libraries(suit_execution_mode) diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.conf new file mode 100644 index 000000000000..dc4d24129d14 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.overlay b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.overlay new file mode 100644 index 000000000000..85fa29b5f28a --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + /* Align erase block size with the nRF54H20 MRAM definition. */ + erase-block-size = <16>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 32 kB of SecDom SUIT NVM storage. */ + /* Use the first 4kB as area reserved for Secure domain. */ + cpusec_suit_storage: partition@1e7000 { + reg = <0x1e7000 DT_SIZE_K(4)>; + }; + + /* Use the next 4kB as area reserved for Radio domain. */ + cpurad_suit_storage: partition@1e8000 { + reg = <0x1e8000 DT_SIZE_K(4)>; + }; + + /* Use the next 8kB as area reserved for Application domain. */ + cpuapp_suit_storage: partition@1e9000 { + reg = <0x1e9000 DT_SIZE_K(8)>; + }; + }; +}; diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/prj.conf b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/prj.conf new file mode 100644 index 000000000000..cbb5054fabdf --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/prj.conf @@ -0,0 +1,54 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y +CONFIG_ZTEST_STACK_SIZE=4096 + +CONFIG_SUIT=y +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_MCI=y +CONFIG_SUIT_MCI_IMPL_CUSTOM=y +CONFIG_SUIT_METADATA=y +CONFIG_SUIT_ORCHESTRATOR=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_LOG_LEVEL_DBG=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_CACHE=y +# Use lower value to verify overflows +CONFIG_SUIT_CACHE_MAX_CACHES=5 +CONFIG_SUIT_STORAGE=y +# Force SUIT storage memory layout to match nRF54H20-specific implementation. +CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y +# nRF54H20 storage uses SHA-256 to protect MPI and NVVs: +CONFIG_SUIT_CRYPTO=y +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_EXECUTION_MODE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y + +CONFIG_SUIT_DEVCONFIG=y +CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_SUIT_PLAT_CHECK_CLASSES=y +CONFIG_SUIT_AUTHENTICATE=y + +CONFIG_SUIT_DIGEST=y +CONFIG_SUIT_DIGEST_CACHE=y +CONFIG_SUIT_SINK_SELECTOR=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_DIGEST=y +CONFIG_SUIT_CHECK_IMAGE_MATCH=y + +CONFIG_SUIT_STREAM_SINK_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_FLASH_MAP=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SOURCE_CACHE=y diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/src/test_init.c b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/src/test_init.c new file mode 100644 index 000000000000..63e2b6a3e718 --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/src/test_init.c @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include +#include +#include + +#include +#include +#include + +#define SUIT_STORAGE_APP_MPI_SIZE 0xf0 +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#define SUIT_BACKUP_OFFSET FIXED_PARTITION_OFFSET(cpusec_suit_storage) +#define SUIT_BACKUP_SIZE FIXED_PARTITION_SIZE(cpusec_suit_storage) + +/* Valid envelope */ +extern const uint8_t manifest_valid_buf[]; +extern const size_t manifest_valid_len; + +static void setup_erased_flash(void *f) +{ + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + int err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + + zassert_equal(0, err, "Unable to erase storage before test execution"); + + err = flash_erase(fdev, SUIT_BACKUP_OFFSET, SUIT_BACKUP_SIZE); + zassert_equal(0, err, "Unable to erase storage backup before test execution"); + + suit_plat_err_t ret = suit_storage_report_clear(0); + + zassert_equal(SUIT_PLAT_SUCCESS, ret, + "Unable to clear recovery flag before test execution"); +} + +static void write_empty_mpi_area_app(void) +{ + /* Digest of the content defined in assert_empty_mpi_area_app(). */ + uint8_t app_digest[] = { + 0xd6, 0xc4, 0x94, 0x17, 0xb1, 0xca, 0x0a, 0x67, + 0x14, 0xdc, 0xde, 0x2b, 0x40, 0x01, 0x0c, 0xb7, + 0x49, 0x6d, 0x05, 0xdf, 0x7f, 0x8c, 0x8b, 0x1b, + 0x98, 0x14, 0x09, 0x7e, 0x9d, 0x62, 0xc8, 0xe1, + }; + + /* Write the digest of application area filled with 0xFF */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +static void write_mpi_area_app_root(void) +{ + uint8_t mpi_root[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + /* Digest of the content defined in assert_valid_mpi_area_app(). */ + uint8_t app_digest[] = { + 0xa9, 0xa0, 0xee, 0x40, 0x5f, 0xad, 0x2b, 0xeb, + 0x66, 0x50, 0xdd, 0xa9, 0x97, 0x11, 0x72, 0x98, + 0x2b, 0x17, 0x45, 0x90, 0x16, 0xe1, 0xc7, 0xf5, + 0xc1, 0xdc, 0x3f, 0xb4, 0x58, 0x96, 0x1e, 0x44, + }; + + /* Write the sample application area (just the root MPI) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_OFFSET, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application root MPI contents before test execution"); + + err = flash_write(fdev, SUIT_STORAGE_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +static void write_mpi_area_app_unupdateable_root(void) +{ + uint8_t mpi_root[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x01, /* Independent update disabled */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + /* Digest of the content defined in assert_valid_mpi_area_app() and + * modified independent updateability policy value. + */ + uint8_t app_digest[] = { + 0xae, 0x12, 0x12, 0x86, 0xdb, 0x15, 0x34, 0x99, + 0xa4, 0x6d, 0xcf, 0xfc, 0x7c, 0x73, 0x4f, 0xf9, + 0x2e, 0x67, 0xcb, 0xfc, 0x30, 0xdd, 0xb1, 0x65, + 0xa3, 0x9e, 0x72, 0x41, 0xd3, 0x1b, 0x4a, 0x91, + }; + + /* Write the sample application area (just the root MPI) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_OFFSET, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application root MPI contents before test execution"); + + err = flash_write(fdev, SUIT_STORAGE_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +static void write_mpi_area_app_unsupported_version(void) +{ + uint8_t mpi_root[] = { + 0x02, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + /* Digest of the content defined in assert_valid_mpi_area_app() and + * modified mpi structure version value. + */ + uint8_t app_digest[] = { + 0x97, 0xcf, 0x84, 0xc1, 0xc8, 0x5e, 0x1c, 0x83, + 0xbe, 0xd3, 0xb5, 0xe0, 0x03, 0x66, 0xc7, 0xfb, + 0x5f, 0xa6, 0x9f, 0x69, 0xa1, 0xaa, 0xf9, 0xc3, + 0x1f, 0x6d, 0xa4, 0x6f, 0x50, 0xb0, 0x5f, 0x6c, + }; + + /* Write the sample application area (just the root MPI) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_OFFSET, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application root MPI contents before test execution"); + + err = flash_write(fdev, SUIT_STORAGE_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +ZTEST_SUITE(orchestrator_nrf54h20_init_tests, NULL, NULL, setup_erased_flash, NULL, NULL); + +ZTEST(orchestrator_nrf54h20_init_tests, test_no_mpi) +{ + /* GIVEN empty flash (suit storage and backup is erased)... */ + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN failed state is triggered... */ + zassert_equal(EXECUTION_MODE_FAIL_NO_MPI, suit_execution_mode_get(), + "Lack of MPIs not detected"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_nrf54h20_init_tests, test_no_root_mpi) +{ + /* GIVEN empty flash (suit storage and empty MPI area with digest)... */ + write_empty_mpi_area_app(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN failed state is triggered... */ + zassert_equal(EXECUTION_MODE_FAIL_MPI_INVALID_MISSING, suit_execution_mode_get(), + "Lack of ROOT MPIs not detected"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_nrf54h20_init_tests, test_invalid_mpi_version) +{ + /* GIVEN empty flash (suit storage and root MPI with incorrect version... */ + write_mpi_area_app_unsupported_version(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN failed state is triggered... */ + zassert_equal(EXECUTION_MODE_FAIL_MPI_INVALID, suit_execution_mode_get(), + "Malformed ROOT MPI not detected"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_nrf54h20_init_tests, test_unupdateable_root) +{ + /* GIVEN empty flash (suit storage and root MPI without updateability flag set... */ + write_mpi_area_app_unupdateable_root(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN failed state is triggered... */ + zassert_equal(EXECUTION_MODE_FAIL_MPI_UNSUPPORTED, suit_execution_mode_get(), + "Non-updateable ROOT MPI not detected"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} + +ZTEST(orchestrator_nrf54h20_init_tests, test_valid_root) +{ + /* GIVEN empty flash (suit storage and valid root MPI... */ + write_mpi_area_app_root(); + /* ... and update candidate flag is not set... */ + /* ... and emergency flag is not set */ + + /* WHEN orchestrator is initialized */ + int err = suit_orchestrator_init(); + + /* THEN failed state is triggered... */ + zassert_equal(EXECUTION_MODE_INVOKE, suit_execution_mode_get(), + "Non-updateable ROOT MPI not detected"); + /* ... and orchestrator is initialized */ + zassert_equal(0, err, "Orchestrator not initialized"); +} diff --git a/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/testcase.yaml b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/testcase.yaml new file mode 100644 index 000000000000..0cee743930aa --- /dev/null +++ b/tests/subsys/suit/orchestrator/orchestrator_sdfw_nrf54h20/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit.integration.orchestrator.nrf54h20: + platform_allow: native_posix + tags: suit suit_orchestrator nrf54h20 + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/ram_sink/CMakeLists.txt b/tests/subsys/suit/ram_sink/CMakeLists.txt new file mode 100644 index 000000000000..f6a7f178089e --- /dev/null +++ b/tests/subsys/suit/ram_sink/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(platform_test) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_stream_sinks_interface) +zephyr_library_link_libraries(suit_utils) diff --git a/tests/subsys/suit/ram_sink/boards/native_posix.overlay b/tests/subsys/suit/ram_sink/boards/native_posix.overlay new file mode 100644 index 000000000000..3afef70f0762 --- /dev/null +++ b/tests/subsys/suit/ram_sink/boards/native_posix.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/ram_sink/boards/native_posix_64.overlay b/tests/subsys/suit/ram_sink/boards/native_posix_64.overlay new file mode 100644 index 000000000000..45dbbddc4a1f --- /dev/null +++ b/tests/subsys/suit/ram_sink/boards/native_posix_64.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/ram_sink/prj.conf b/tests/subsys/suit/ram_sink/prj.conf new file mode 100644 index 000000000000..054e34d84940 --- /dev/null +++ b/tests/subsys/suit/ram_sink/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_STREAM_SINK_RAM=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/ram_sink/src/main.c b/tests/subsys/suit/ram_sink/src/main.c new file mode 100644 index 000000000000..241cd7c6c0bb --- /dev/null +++ b/tests/subsys/suit/ram_sink/src/main.c @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +static uint8_t test_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +#define SUIT_MAX_RAM_COMPONENTS 1 /* Currently only one component allowed */ + +#if (DT_NODE_EXISTS(DT_NODELABEL(ram0x))) /* nrf54H20, nrf54l15(?) */ + #define TEST_DST ((uint8_t *)DT_REG_ADDR(DT_NODELABEL(ram20))) +#elif (DT_NODE_EXISTS(DT_NODELABEL(ram20))) /* nrf54H20, nrf54l15(?) */ + #define TEST_DST_SPECIAL ((uint8_t *)DT_REG_ADDR(DT_NODELABEL(ram20))) +#elif (DT_NODE_EXISTS(DT_NODELABEL(sram0))) + #if defined(CONFIG_BOARD_NATIVE_POSIX) + #define TEST_DST ((uint8_t *)DT_REG_ADDR(DT_NODELABEL(sram0))) + #else + uint8_t test_mem[sizeof(test_data)]; + #define TEST_DST test_mem + #endif +#else + printk("Unrecognized platform"); + #define TEST_DST NULL +#endif + +ZTEST_SUITE(ram_sink_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(ram_sink_tests, test_suit_ram_sink_get_OK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + zassert_not_equal(ram_sink.ctx, NULL, "suit_ram_sink_get failed - ctx is NULL"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +#if (DT_NODE_EXISTS(DT_NODELABEL(ram20))) /* nrf54H20, nrf54l15(?) */ +ZTEST(ram_sink_tests, test_suit_ram_sink_get_OK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST_SPECIAL, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + zassert_not_equal(ram_sink.ctx, NULL, "suit_ram_sink_get failed - ctx is NULL"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} +#endif + +ZTEST(ram_sink_tests, test_suit_ram_sink_get_NOK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, NULL, sizeof(test_data)); + + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_ram_sink_get should have failed - dst == NULL"); + + err = suit_ram_sink_get(&ram_sink, TEST_DST, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_ram_sink_get should have failed - offset_limit == 0"); +} + +ZTEST(ram_sink_tests, test_suit_ram_sink_get_out_of_contexts) +{ + struct stream_sink ram_sinks[SUIT_MAX_RAM_COMPONENTS + 1]; + suit_plat_err_t err; + + for (size_t i = 0; i < SUIT_MAX_RAM_COMPONENTS; i++) { + err = suit_ram_sink_get(&ram_sinks[i], TEST_DST, sizeof(test_data)); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Unexpected error code"); + } + + err = suit_ram_sink_get(&ram_sinks[SUIT_MAX_RAM_COMPONENTS], TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_ERR_NO_RESOURCES, "Unexpected error code"); + + for (size_t i = 0; i < SUIT_MAX_RAM_COMPONENTS; i++) { + err = ram_sinks[i].release(ram_sinks[i].ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); + } +} + +ZTEST(ram_sink_tests, test_ram_sink_release_NOK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.release(NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.release should have failed - ctx == NULL"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_seek_OK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.seek(ram_sink.ctx, 0); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.seek failed - error %i", err); + + err = ram_sink.seek(ram_sink.ctx, 9); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.seek failed - error %i", err); + + err = ram_sink.seek(ram_sink.ctx, 63); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.seek failed - error %i", err); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_seek_NOK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.seek(ram_sink.ctx, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.seek should have failed - passed arg == offset_limit"); + + err = ram_sink.seek(ram_sink.ctx, sizeof(test_data) + 1); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.seek should have failed - passed arg > offset_limit"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_used_storage_OK) +{ + struct stream_sink ram_sink; + size_t used_storage = 0; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.used_storage(ram_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.use_storage failed - error %i", err); + zassert_equal(used_storage, 0, "ram_sink.use_storage failed - not initialized to 0"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_used_storage_NOK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.used_storage(ram_sink.ctx, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.use_storage should have failed - arg size == NULL"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_write_OK) +{ + struct stream_sink ram_sink; + size_t used_storage = 0; + size_t input_size = 21; /* Arbitrary value, chosen to be unaligned */ + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.write(ram_sink.ctx, test_data, input_size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.write failed - error %i", err); + + err = ram_sink.used_storage(ram_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.use_storage failed - error %i", err); + zassert_equal(used_storage, input_size, "ram_sink.use_storage failed - value %d", + used_storage); + + err = ram_sink.seek(ram_sink.ctx, input_size + 7); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.seek failed - error %i", err); + + err = ram_sink.used_storage(ram_sink.ctx, &used_storage); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.use_storage failed - error %i", err); + + err = ram_sink.write(ram_sink.ctx, &test_data[input_size], input_size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.write failed - error %i", err); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_write_NOK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.write(ram_sink.ctx, test_data, 0); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.write should have failed - size == 0"); + + err = ram_sink.write(NULL, test_data, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.write should have failed - ctx == NULL"); + + err = ram_sink.write(ram_sink.ctx, NULL, sizeof(test_data)); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.write should have failed - buf == NULL"); + + err = ram_sink.write(ram_sink.ctx, test_data, sizeof(test_data) + 1); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "ram_sink.write should have failed - size out of bounds"); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} + +ZTEST(ram_sink_tests, test_ram_sink_erase_OK) +{ + struct stream_sink ram_sink; + + int err = suit_ram_sink_get(&ram_sink, TEST_DST, sizeof(test_data)); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_ram_sink_get failed - error %i", err); + + err = ram_sink.erase(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.erase failed - error %i", err); + + err = ram_sink.erase(NULL); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.erase failed - error %i", err); + + err = ram_sink.release(ram_sink.ctx); + zassert_equal(err, SUIT_PLAT_SUCCESS, "ram_sink.release failed - error %i", err); +} diff --git a/tests/subsys/suit/ram_sink/testcase.yaml b/tests/subsys/suit/ram_sink/testcase.yaml new file mode 100644 index 000000000000..c15e2ce03bae --- /dev/null +++ b/tests/subsys/suit/ram_sink/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.ram_sink: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/sink_selector/CMakeLists.txt b/tests/subsys/suit/sink_selector/CMakeLists.txt new file mode 100644 index 000000000000..67332911f5c3 --- /dev/null +++ b/tests/subsys/suit/sink_selector/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 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(platform_test) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit_sink_selector_interface) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_stream_sinks_interface) diff --git a/tests/subsys/suit/sink_selector/boards/native_posix.conf b/tests/subsys/suit/sink_selector/boards/native_posix.conf new file mode 100644 index 000000000000..4951a341e12a --- /dev/null +++ b/tests/subsys/suit/sink_selector/boards/native_posix.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y diff --git a/tests/subsys/suit/sink_selector/boards/native_posix.overlay b/tests/subsys/suit/sink_selector/boards/native_posix.overlay new file mode 100644 index 000000000000..c1d030e42e64 --- /dev/null +++ b/tests/subsys/suit/sink_selector/boards/native_posix.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + + /* Use the last 8KB of NVM as suit storage. */ + suit_storage: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/sink_selector/boards/native_posix_64.conf b/tests/subsys/suit/sink_selector/boards/native_posix_64.conf new file mode 100644 index 000000000000..4951a341e12a --- /dev/null +++ b/tests/subsys/suit/sink_selector/boards/native_posix_64.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y diff --git a/tests/subsys/suit/sink_selector/boards/native_posix_64.overlay b/tests/subsys/suit/sink_selector/boards/native_posix_64.overlay new file mode 100644 index 000000000000..c1d030e42e64 --- /dev/null +++ b/tests/subsys/suit/sink_selector/boards/native_posix_64.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = < 0x1 >; + #size-cells = < 0x1 >; + + dfu_partition: partition@f5000 { + reg = < 0xf5000 DT_SIZE_K(4) >; + }; + + dfu_cache_partition_1: partition@f6000 { + reg = <0xf6000 DT_SIZE_K(4)>; + }; + + dfu_cache_partition_3: partition@f7000 { + reg = <0xf7000 DT_SIZE_K(4)>; + }; + + /* Use the last 8KB of NVM as suit storage. */ + suit_storage: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/sink_selector/prj.conf b/tests/subsys/suit/sink_selector/prj.conf new file mode 100644 index 000000000000..e327647dc6ff --- /dev/null +++ b/tests/subsys/suit/sink_selector/prj.conf @@ -0,0 +1,32 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y +CONFIG_SUIT_PLATFORM_VARIANT_APP=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SINK_RAM=y + +CONFIG_FLASH=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_FLASH_MAP=y + +CONFIG_SUIT_CACHE=y +CONFIG_SUIT_CACHE_RW=y +CONFIG_SUIT_STREAM_SINK_CACHE=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y + +CONFIG_SUIT_MEMPTR_STORAGE=y +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_METADATA=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y diff --git a/tests/subsys/suit/sink_selector/src/main.c b/tests/subsys/suit/sink_selector/src/main.c new file mode 100644 index 000000000000..697b433bc3a6 --- /dev/null +++ b/tests/subsys/suit/sink_selector/src/main.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +ZTEST_SUITE(sink_selector_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(sink_selector_tests, test_select_memptr_sink_OK) +{ + suit_component_t handle; + /* [h'CAND_IMG', h'02'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + struct stream_sink sink; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + int err = suit_sink_select(handle, &sink); + + zassert_equal(err, SUIT_SUCCESS, "sink_selector: selecting memptr_sink failed - error %i", + err); +} + +ZTEST(sink_selector_tests, test_select_flash_sink_OK) +{ + suit_component_t handle; + /* [h'MEM', h'02', h'1A00080000', h'191000'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + struct stream_sink sink; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + int err = suit_sink_select(handle, &sink); + + zassert_equal(err, SUIT_SUCCESS, "sink_selector: selecting flash_sink failed - error %i", + err); +} + +ZTEST(sink_selector_tests, test_select_ram_sink_OK) +{ + suit_component_t handle; + + /* ['MEM', h'02', h'1A20000000', h'191000'] */ + uint8_t valid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x20, 0x00, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + struct stream_sink sink; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + int err = suit_sink_select(handle, &sink); + + zassert_equal(err, SUIT_SUCCESS, "sink_selector: selecting flash_sink failed - error %i", + err); +} + +#if CONFIG_SUIT_STREAM_SINK_SDFW +ZTEST(sink_selector_tests, test_select_sdfw_sink_OK) +{ + suit_component_t handle; + /* [h'SOC_SPEC', h'01'] */ + uint8_t valid_value[] = {0x82, 0x49, 0x68, 'S', 'O', 'C', '_', + 'S', 'P', 'E', 'C', 0x41, 0x01}; + struct zcbor_string valid_component_id = { + .value = valid_value, + .len = sizeof(valid_value), + }; + struct stream_sink sink; + + int ret = suit_plat_create_component_handle(&valid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + int err = suit_sink_select(handle, &sink); + + zassert_equal(err, SUIT_SUCCESS, "sink_selector: selecting swdf_sink failed - error %i", + err); +} +#endif + +/* Invalid component_id - zcbor wise */ +ZTEST(sink_selector_tests, test_select_invalid_component_id) +{ + suit_component_t handle; + /* [h'MEM', h'02', h'1000080000', h'08'] */ + uint8_t invalid_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, + 0x45, 0x10, 0x00, 0x08, 0x00, 0x00, 0x41, 0x08}; + struct zcbor_string invalid_component_id = { + .value = invalid_value, + .len = sizeof(invalid_value), + }; + + int ret = suit_plat_create_component_handle(&invalid_component_id, &handle); + + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "create_component_handle unexpected error %i", ret); +} + +/* Invalid component */ +ZTEST(sink_selector_tests, test_select_unsupported_component) +{ + suit_component_t handle; + /* [h'INSTLD_MFST', h'56dc9a1428d852d3bd62e77a08bc8b91'] */ + uint8_t invalid_value[] = {0x82, 0x4c, 0x6b, 'I', 'N', 'S', 'T', 'L', 'D', '_', 'M', + 'F', 'S', 'T', 0x50, 0x56, 0xdc, 0x9a, 0x14, 0x28, 0xd8, 0x52, + 0xd3, 0xbd, 0x62, 0xe7, 0x7a, 0x08, 0xbc, 0x8b, 0x91}; + struct zcbor_string invalid_component_id = { + .value = invalid_value, + .len = sizeof(invalid_value), + }; + struct stream_sink sink; + + int ret = suit_plat_create_component_handle(&invalid_component_id, &handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + int err = suit_sink_select(handle, &sink); + + zassert_not_equal(err, SUIT_SUCCESS, + "sink_selector should have failed - unsupported component"); +} + +ZTEST(sink_selector_tests, test_suit_sink_select_invalid_handle) +{ + suit_component_t handle = 0; + struct stream_sink sink; + + int err = suit_sink_select(handle, &sink); + + zassert_not_equal(err, SUIT_SUCCESS, "sink_selector should have failed - invalid handle"); +} diff --git a/tests/subsys/suit/sink_selector/testcase.yaml b/tests/subsys/suit/sink_selector/testcase.yaml new file mode 100644 index 000000000000..0d62c0b4cd79 --- /dev/null +++ b/tests/subsys/suit/sink_selector/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-platform.integration.sink_selector: + platform_allow: native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/storage/CMakeLists.txt b/tests/subsys/suit/storage/CMakeLists.txt new file mode 100644 index 000000000000..0c2a8ec4ae7a --- /dev/null +++ b/tests/subsys/suit/storage/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2022 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(integration_test_suit_storage) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_update_magic_values) diff --git a/tests/subsys/suit/storage/boards/native_posix.conf b/tests/subsys/suit/storage/boards/native_posix.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/storage/boards/native_posix.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/storage/boards/native_posix.overlay b/tests/subsys/suit/storage/boards/native_posix.overlay new file mode 100644 index 000000000000..f2701aab236d --- /dev/null +++ b/tests/subsys/suit/storage/boards/native_posix.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 44KB of NVM as suit storage. */ + suit_storage: partition@f5000 { + reg = <0xf5000 DT_SIZE_K(44)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/storage/boards/native_posix_64.conf b/tests/subsys/suit/storage/boards/native_posix_64.conf new file mode 100644 index 000000000000..f467dcbaec6b --- /dev/null +++ b/tests/subsys/suit/storage/boards/native_posix_64.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2023 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/storage/boards/native_posix_64.overlay b/tests/subsys/suit/storage/boards/native_posix_64.overlay new file mode 100644 index 000000000000..f2701aab236d --- /dev/null +++ b/tests/subsys/suit/storage/boards/native_posix_64.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 44KB of NVM as suit storage. */ + suit_storage: partition@f5000 { + reg = <0xf5000 DT_SIZE_K(44)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/storage/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/storage/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..900f7f3d633a --- /dev/null +++ b/tests/subsys/suit/storage/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 44KB of NVM as suit storage. */ + suit_storage: partition@f5000 { + reg = <0xf5000 DT_SIZE_K(44)>; + }; + }; +}; diff --git a/tests/subsys/suit/storage/manifest/manifest_app.yaml b/tests/subsys/suit/storage/manifest/manifest_app.yaml new file mode 100644 index 000000000000..81f8ccb95fd3 --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_app.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0x02 + - 0x0E0AA000 + - 0x0007f800 + 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: nRF54H20_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_app + suit-text: + en: + '["MEM", 2, 235577344, 522240]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: nRF54H20_cpuapp + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The nRF54H20 application core + suit-text-component-description: Sample application core FW + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/storage/manifest/manifest_app_posix.yaml b/tests/subsys/suit/storage/manifest/manifest_app_posix.yaml new file mode 100644 index 000000000000..3579b4c6c41e --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_app_posix.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0x00 + - 0x80000 + - 0x1000 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: posix + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The POSIX application + suit-text-component-description: Sample application for POSIX + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/storage/manifest/manifest_app_posix_v2.yaml b/tests/subsys/suit/storage/manifest/manifest_app_posix_v2.yaml new file mode 100644 index 000000000000..f237faf25268 --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_app_posix_v2.yaml @@ -0,0 +1,74 @@ +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: 2 + suit-common: + suit-components: + - - MEM + - 0x00 + - 0x80000 + - 0x1000 + 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: test_sample_app + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_app + suit-text: + en: + '["MEM", 0, 524288, 4096]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: posix + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The POSIX application + suit-text-component-description: Sample application for POSIX + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/storage/manifest/manifest_rad.yaml b/tests/subsys/suit/storage/manifest/manifest_rad.yaml new file mode 100644 index 000000000000..5c4122353cb4 --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_rad.yaml @@ -0,0 +1,74 @@ +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: + - - MEM + - 0x03 + - 0x0E054000 + - 0x00055800 + 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: nRF54H20_sample_rad + 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-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_rad + suit-text: + en: + '["MEM", 3, 235225088, 350208]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: nRF54H20_cpurad + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The nRF54H20 radio core + suit-text-component-description: Sample radio core FW + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#file.bin': file.bin diff --git a/tests/subsys/suit/storage/manifest/manifest_root.yaml b/tests/subsys/suit/storage/manifest/manifest_root.yaml new file mode 100644 index 000000000000..14c97b710c44 --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_root.yaml @@ -0,0 +1,153 @@ +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_rad + - - 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_rad + + - suit-directive-set-component-index: 2 + - 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, 2] + - 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": {} + "2": {} + + suit-validate: + - suit-directive-set-component-index: [1, 2] + - 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, 2] + - 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: '#rad.suit' + suit-parameter-image-digest: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-digest-bytes: + file: rad.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 + # Manifest copied to I/RAD s a result of sequence completion + + - 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: app.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 + # Manifest copied to I/APP s a result of sequence completion + + # Manifest copied to I/ROOT s a result of sequence completion + suit-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: nRF54H20_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: nRF54H20 + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The nRF54H20 root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#rad.suit': rad.suit + '#app.suit': app.suit diff --git a/tests/subsys/suit/storage/manifest/manifest_root_posix.yaml b/tests/subsys/suit/storage/manifest/manifest_root_posix.yaml new file mode 100644 index 000000000000..ad36d89fb2a2 --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_root_posix.yaml @@ -0,0 +1,113 @@ +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: test_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: test_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: app_posix.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 + # Manifest copied to I/APP s a result of sequence completion + + # Manifest copied to I/ROOT s a result of sequence completion + suit-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: posix + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The POSIX root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#app.suit': app_posix.suit diff --git a/tests/subsys/suit/storage/manifest/manifest_root_posix_v2.yaml b/tests/subsys/suit/storage/manifest/manifest_root_posix_v2.yaml new file mode 100644 index 000000000000..c07c4dcc2bbd --- /dev/null +++ b/tests/subsys/suit/storage/manifest/manifest_root_posix_v2.yaml @@ -0,0 +1,113 @@ +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: 2 + suit-common: + suit-components: + - - CAND_MFST + - 0 + - - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_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: test_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: app_posix_v2.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 + # Manifest copied to I/APP s a result of sequence completion + + # Manifest copied to I/ROOT s a result of sequence completion + suit-text: + suit-digest-algorithm-id: cose-alg-sha-256 + suit-manifest-component-id: + - INSTLD_MFST + - RFC4122_UUID: + namespace: nordicsemi.com + name: test_sample_root + suit-text: + en: + '["CAND_MFST", 0]': + suit-text-vendor-name: Nordic Semiconductor ASA + suit-text-model-name: posix + suit-text-vendor-domain: nordicsemi.com + suit-text-model-info: The POSIX root manifest + suit-text-component-description: Sample root manifest + suit-text-component-version: v1.0.0 + suit-integrated-payloads: + '#app.suit': app_posix_v2.suit diff --git a/tests/subsys/suit/storage/prj.conf b/tests/subsys/suit/storage/prj.conf new file mode 100644 index 000000000000..244f3b7bd90d --- /dev/null +++ b/tests/subsys/suit/storage/prj.conf @@ -0,0 +1,18 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_STORAGE=y +CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS=3 +CONFIG_SUIT_METADATA=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y diff --git a/tests/subsys/suit/storage/src/manifest_app.c b/tests/subsys/suit/storage/src/manifest_app.c new file mode 100644 index 000000000000..510ac5439fba --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_app.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_app.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, + 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, + 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 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, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0x47, 0x37, 0x59, 0x1A, 0x1E, 0x62, 0xE1, 0x47, 0xD3, 0x22, 0x73, 0xA9, 0x14, 0x4C, + 0x55, 0xD9, 0x90, 0xA8, 0x51, 0x41, 0x8C, 0x82, 0x68, 0x30, 0x4C, 0xE1, 0x6F, 0x23, 0x6F, + 0x26, 0x5D, 0x13, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, 0x9E, 0x76, 0x7B, + 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 0x17, 0x58, 0x9B, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, + 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, 0x45, 0x1A, 0x0E, 0x0A, 0xA0, 0x00, 0x45, 0x1A, 0x00, + 0x07, 0xF8, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, + 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, + 0x41, 0x02, 0x6F, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x5F, 0x63, 0x70, 0x75, + 0x61, 0x70, 0x70, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, + 0x34, 0x48, 0x32, 0x30, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, + 0x6E, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x05, 0x78, 0x1A, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, + 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x63, 0x6F, + 0x72, 0x65, 0x20, 0x46, 0x57, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_app_len = sizeof(manifest_app_buf); diff --git a/tests/subsys/suit/storage/src/manifest_app_posix.c b/tests/subsys/suit/storage/src/manifest_app_posix.c new file mode 100644 index 000000000000..0bf6df790c4e --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_app_posix.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_app_posix.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x62, + 0x2B, 0x04, 0x96, 0xCA, 0x8F, 0x04, 0xCF, 0x83, 0x2F, 0x65, 0x90, 0xD2, 0x2A, 0x16, 0x52, + 0x51, 0xB5, 0xA9, 0xFB, 0x08, 0xF6, 0xE4, 0x35, 0x3D, 0x01, 0xE3, 0x3E, 0xA7, 0xCA, 0xC5, + 0x86, 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, 0x17, 0x58, 0x88, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, + 0x6F, 0x73, 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, + 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x75, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, + 0x58, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, + 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x06, + 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_app_posix_len = sizeof(manifest_app_posix_buf); diff --git a/tests/subsys/suit/storage/src/manifest_app_posix_v2.c b/tests/subsys/suit/storage/src/manifest_app_posix_v2.c new file mode 100644 index 000000000000..ad3cff2940d1 --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_app_posix_v2.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_app_posix_v2.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x62, + 0x2B, 0x04, 0x96, 0xCA, 0x8F, 0x04, 0xCF, 0x83, 0x2F, 0x65, 0x90, 0xD2, 0x2A, 0x16, 0x52, + 0x51, 0xB5, 0xA9, 0xFB, 0x08, 0xF6, 0xE4, 0x35, 0x3D, 0x01, 0xE3, 0x3E, 0xA7, 0xCA, 0xC5, + 0x86, 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, 0x17, 0x58, 0x88, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, + 0x45, 0x4D, 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, + 0x6F, 0x73, 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, + 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x75, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, + 0x58, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, + 0x1C, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x06, + 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_app_posix_v2_len = sizeof(manifest_app_posix_v2_buf); diff --git a/tests/subsys/suit/storage/src/manifest_rad.c b/tests/subsys/suit/storage/src/manifest_rad.c new file mode 100644 index 000000000000..661b72a384b2 --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_rad.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_rad.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @note Please use the manifest_common/regenerate.sh script for regenerating payloads. + */ +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, + 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, 0x02, 0x50, 0x81, 0x6A, 0xA0, 0xA0, 0xAF, 0x11, 0x5E, + 0xF2, 0x85, 0x8A, 0xFE, 0xB6, 0x68, 0xB2, 0xE9, 0xC9, 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, 0x17, 0x82, 0x2F, 0x58, + 0x20, 0xCB, 0xAC, 0xBD, 0x31, 0x77, 0xE4, 0x07, 0x2A, 0xAB, 0x23, 0xE7, 0xED, 0x4B, 0x4B, + 0x25, 0x76, 0x85, 0x87, 0xCE, 0xBB, 0xD7, 0x53, 0xCD, 0x25, 0x68, 0x36, 0x51, 0xD0, 0x7B, + 0x40, 0x3D, 0x98, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, + 0x46, 0x53, 0x54, 0x50, 0x81, 0x6A, 0xA0, 0xA0, 0xAF, 0x11, 0x5E, 0xF2, 0x85, 0x8A, 0xFE, + 0xB6, 0x68, 0xB2, 0xE9, 0xC9, 0x17, 0x58, 0x8D, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, + 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x03, 0x45, 0x1A, 0x0E, 0x05, 0x40, 0x00, 0x45, 0x1A, 0x00, + 0x05, 0x58, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, + 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, + 0x41, 0x02, 0x6F, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x5F, 0x63, 0x70, 0x75, + 0x72, 0x61, 0x64, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, + 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x77, 0x54, 0x68, 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, + 0x48, 0x32, 0x30, 0x20, 0x72, 0x61, 0x64, 0x69, 0x6F, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x05, + 0x74, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x61, 0x64, 0x69, 0x6F, 0x20, 0x63, + 0x6F, 0x72, 0x65, 0x20, 0x46, 0x57, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_rad_len = sizeof(manifest_rad_buf); diff --git a/tests/subsys/suit/storage/src/manifest_root.c b/tests/subsys/suit/storage/src/manifest_root.c new file mode 100644 index 000000000000..7cbf143d15f5 --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_root.c @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_root.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @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, + 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, + 0x85, 0x8A, 0xFE, 0xB6, 0x68, 0xB2, 0xE9, 0xC9, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, 0x54, + 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, + 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 0x04, 0x58, 0x59, 0x8E, 0x0C, 0x01, + 0x14, 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, + 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x81, 0x6A, 0xA0, 0xA0, 0xAF, 0x11, 0x5E, 0xF2, + 0x85, 0x8A, 0xFE, 0xB6, 0x68, 0xB2, 0xE9, 0xC9, 0x0C, 0x02, 0x14, 0xA2, 0x01, 0x50, 0x76, + 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, + 0x02, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, + 0xE1, 0xB0, 0x4D, 0x0C, 0x82, 0x01, 0x02, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA3, 0x00, 0xA0, + 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, + 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, + 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, + 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x3F, 0x6A, 0x3A, 0x4D, 0xCD, + 0xFA, 0x58, 0xC5, 0xAC, 0xCE, 0xF9, 0xF5, 0x84, 0xC4, 0x11, 0x24, 0x17, 0x58, 0x84, 0xA1, + 0x62, 0x65, 0x6E, 0xA1, 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, + 0x54, 0x41, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, + 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, + 0x41, 0x02, 0x68, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x03, 0x6E, 0x6E, 0x6F, + 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1A, + 0x54, 0x68, 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x20, 0x72, 0x6F, + 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x05, 0x74, 0x53, 0x61, + 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 0x69, 0x23, 0x72, 0x61, + 0x64, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xFB, 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, 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, + 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, + 0x02, 0x50, 0x81, 0x6A, 0xA0, 0xA0, 0xAF, 0x11, 0x5E, 0xF2, 0x85, 0x8A, 0xFE, 0xB6, 0x68, + 0xB2, 0xE9, 0xC9, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0xCB, 0xAC, 0xBD, 0x31, 0x77, + 0xE4, 0x07, 0x2A, 0xAB, 0x23, 0xE7, 0xED, 0x4B, 0x4B, 0x25, 0x76, 0x85, 0x87, 0xCE, 0xBB, + 0xD7, 0x53, 0xCD, 0x25, 0x68, 0x36, 0x51, 0xD0, 0x7B, 0x40, 0x3D, 0x98, 0x05, 0x82, 0x4C, + 0x6B, 0x49, 0x4E, 0x53, 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x81, 0x6A, + 0xA0, 0xA0, 0xAF, 0x11, 0x5E, 0xF2, 0x85, 0x8A, 0xFE, 0xB6, 0x68, 0xB2, 0xE9, 0xC9, 0x17, + 0x58, 0x8D, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x03, + 0x45, 0x1A, 0x0E, 0x05, 0x40, 0x00, 0x45, 0x1A, 0x00, 0x05, 0x58, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x6F, 0x6E, 0x52, 0x46, + 0x35, 0x34, 0x48, 0x32, 0x30, 0x5F, 0x63, 0x70, 0x75, 0x72, 0x61, 0x64, 0x03, 0x6E, 0x6E, + 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x77, + 0x54, 0x68, 0x65, 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x20, 0x72, 0x61, + 0x64, 0x69, 0x6F, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x05, 0x74, 0x53, 0x61, 0x6D, 0x70, 0x6C, + 0x65, 0x20, 0x72, 0x61, 0x64, 0x69, 0x6F, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x20, 0x46, 0x57, + 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, 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, 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, + 0x69, 0x74, 0x59, 0x03, 0x09, 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, 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, + 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, 0xE2, 0x8D, 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x08, 0xC1, + 0xB5, 0x99, 0x55, 0xE8, 0x5F, 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x47, 0x37, 0x59, 0x1A, 0x1E, 0x62, 0xE1, 0x47, 0xD3, + 0x22, 0x73, 0xA9, 0x14, 0x4C, 0x55, 0xD9, 0x90, 0xA8, 0x51, 0x41, 0x8C, 0x82, 0x68, 0x30, + 0x4C, 0xE1, 0x6F, 0x23, 0x6F, 0x26, 0x5D, 0x13, 0x05, 0x82, 0x4C, 0x6B, 0x49, 0x4E, 0x53, + 0x54, 0x4C, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x08, 0xC1, 0xB5, 0x99, 0x55, 0xE8, + 0x5F, 0xBC, 0x9E, 0x76, 0x7B, 0xC2, 0x9C, 0xE1, 0xB0, 0x4D, 0x17, 0x58, 0x9B, 0xA1, 0x62, + 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, 0x41, 0x02, 0x45, 0x1A, 0x0E, 0x0A, + 0xA0, 0x00, 0x45, 0x1A, 0x00, 0x07, 0xF8, 0x00, 0xA6, 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, + 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, + 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x6F, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, + 0x30, 0x5F, 0x63, 0x70, 0x75, 0x61, 0x70, 0x70, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, + 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x78, 0x1D, 0x54, 0x68, 0x65, + 0x20, 0x6E, 0x52, 0x46, 0x35, 0x34, 0x48, 0x32, 0x30, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x05, 0x78, 0x1A, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x20, 0x46, 0x57, 0x06, 0x66, 0x76, 0x31, 0x2E, + 0x30, 0x2E, 0x30, 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_root_len = sizeof(manifest_root_buf); diff --git a/tests/subsys/suit/storage/src/manifest_root_posix.c b/tests/subsys/suit/storage/src/manifest_root_posix.c new file mode 100644 index 000000000000..f5af7391a1f1 --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_root_posix.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_root_posix.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2F, 0x8A, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x0C, 0x01, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, + 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, 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, + 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7D, 0xA1, 0x62, 0x65, 0x6E, 0xA1, + 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, + 0x6F, 0x73, 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, + 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x77, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, + 0x58, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x05, 0x74, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, + 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, + 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF4, 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, 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, + 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x62, 0x2B, 0x04, + 0x96, 0xCA, 0x8F, 0x04, 0xCF, 0x83, 0x2F, 0x65, 0x90, 0xD2, 0x2A, 0x16, 0x52, 0x51, 0xB5, + 0xA9, 0xFB, 0x08, 0xF6, 0xE4, 0x35, 0x3D, 0x01, 0xE3, 0x3E, 0xA7, 0xCA, 0xC5, 0x86, 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, 0x17, 0x58, 0x88, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, + 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, 0x6F, 0x73, + 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, + 0x63, 0x6F, 0x6D, 0x04, 0x75, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_root_posix_len = sizeof(manifest_root_posix_buf); diff --git a/tests/subsys/suit/storage/src/manifest_root_posix_v2.c b/tests/subsys/suit/storage/src/manifest_root_posix_v2.c new file mode 100644 index 000000000000..672f3f4aebf2 --- /dev/null +++ b/tests/subsys/suit/storage/src/manifest_root_posix_v2.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include + +/** @brief SUIT envelope generated using the manifest/manifest_root_posix_v2.yaml input file. + * + * @details This envelope contains 256-byte random numbers attached as an integrated + * payload and fetched directly into the memory-mapped region during install step. + * The envelope has been signed using the manifest/key_private.pem key. + * + * @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, + 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, + 0xA3, 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x04, 0x58, 0x2F, 0x8A, 0x0C, 0x01, 0x14, + 0xA2, 0x01, 0x50, 0x76, 0x17, 0xDA, 0xA5, 0x71, 0xFD, 0x5A, 0x85, 0x8F, 0x94, 0xE2, 0x8D, + 0x73, 0x5C, 0xE9, 0xF4, 0x02, 0x50, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, + 0x18, 0x68, 0x1B, 0x03, 0x69, 0x5E, 0x36, 0x0C, 0x01, 0x01, 0x0F, 0x02, 0x0F, 0x01, 0xA2, + 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, 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, + 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x50, 0x97, 0x05, 0x48, 0x23, 0x4C, 0x3D, 0x59, 0xA1, 0x89, + 0x86, 0xA5, 0x46, 0x60, 0xA1, 0x4B, 0x0A, 0x17, 0x58, 0x7D, 0xA1, 0x62, 0x65, 0x6E, 0xA1, + 0x82, 0x4A, 0x69, 0x43, 0x41, 0x4E, 0x44, 0x5F, 0x4D, 0x46, 0x53, 0x54, 0x41, 0x00, 0xA6, + 0x01, 0x78, 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, + 0x6F, 0x6E, 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, + 0x6F, 0x73, 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, + 0x69, 0x2E, 0x63, 0x6F, 0x6D, 0x04, 0x77, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, + 0x58, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x05, 0x74, 0x53, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x72, 0x6F, 0x6F, 0x74, 0x20, 0x6D, + 0x61, 0x6E, 0x69, 0x66, 0x65, 0x73, 0x74, 0x06, 0x66, 0x76, 0x31, 0x2E, 0x30, 0x2E, 0x30, + 0x69, 0x23, 0x61, 0x70, 0x70, 0x2E, 0x73, 0x75, 0x69, 0x74, 0x59, 0x02, 0xF4, 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, 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, + 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, 0x5B, 0x46, 0x9F, 0xD1, 0x90, 0xEE, 0x53, 0x9C, 0xA3, 0x18, 0x68, + 0x1B, 0x03, 0x69, 0x5E, 0x36, 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, 0x17, 0x82, 0x2F, 0x58, 0x20, 0x62, 0x2B, 0x04, + 0x96, 0xCA, 0x8F, 0x04, 0xCF, 0x83, 0x2F, 0x65, 0x90, 0xD2, 0x2A, 0x16, 0x52, 0x51, 0xB5, + 0xA9, 0xFB, 0x08, 0xF6, 0xE4, 0x35, 0x3D, 0x01, 0xE3, 0x3E, 0xA7, 0xCA, 0xC5, 0x86, 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, 0x17, 0x58, 0x88, 0xA1, 0x62, 0x65, 0x6E, 0xA1, 0x84, 0x44, 0x63, 0x4D, 0x45, 0x4D, + 0x41, 0x00, 0x45, 0x1A, 0x00, 0x08, 0x00, 0x00, 0x43, 0x19, 0x10, 0x00, 0xA6, 0x01, 0x78, + 0x18, 0x4E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x20, 0x53, 0x65, 0x6D, 0x69, 0x63, 0x6F, 0x6E, + 0x64, 0x75, 0x63, 0x74, 0x6F, 0x72, 0x20, 0x41, 0x53, 0x41, 0x02, 0x65, 0x70, 0x6F, 0x73, + 0x69, 0x78, 0x03, 0x6E, 0x6E, 0x6F, 0x72, 0x64, 0x69, 0x63, 0x73, 0x65, 0x6D, 0x69, 0x2E, + 0x63, 0x6F, 0x6D, 0x04, 0x75, 0x54, 0x68, 0x65, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x20, + 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x05, 0x78, 0x1C, 0x53, + 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6F, 0x6E, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x50, 0x4F, 0x53, 0x49, 0x58, 0x06, 0x66, 0x76, + 0x31, 0x2E, 0x30, 0x2E, 0x30, 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_root_posix_v2_len = sizeof(manifest_root_posix_v2_buf); diff --git a/tests/subsys/suit/storage/src/test_envelopes.c b/tests/subsys/suit/storage/src/test_envelopes.c new file mode 100644 index 000000000000..91a51a6a7e91 --- /dev/null +++ b/tests/subsys/suit/storage/src/test_envelopes.c @@ -0,0 +1,291 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) + +/* The SUIT envelopes are defined inside the respective manfest_*.c files. */ +extern uint8_t manifest_root_buf[]; +extern const size_t manifest_root_len; +extern uint8_t manifest_app_buf[]; +extern const size_t manifest_app_len; +extern uint8_t manifest_rad_buf[]; +extern const size_t manifest_rad_len; + +extern uint8_t manifest_app_posix_buf[]; +extern const size_t manifest_app_posix_len; +extern uint8_t manifest_root_posix_buf[]; +extern const size_t manifest_root_posix_len; + +extern uint8_t manifest_app_posix_v2_buf[]; +extern const size_t manifest_app_posix_v2_len; +extern uint8_t manifest_root_posix_v2_buf[]; +extern const size_t manifest_root_posix_v2_len; + +static const suit_manifest_class_id_t classes[] = { + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_root') */ + {{0x3f, 0x6a, 0x3a, 0x4d, 0xcd, 0xfa, 0x58, 0xc5, 0xac, 0xce, 0xf9, 0xf5, 0x84, 0xc4, 0x11, + 0x24}}, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_app') */ + {{0x08, 0xc1, 0xb5, 0x99, 0x55, 0xe8, 0x5f, 0xbc, 0x9e, 0x76, 0x7b, 0xc2, 0x9c, 0xe1, 0xb0, + 0x4d}}, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_sample_rad') */ + {{0x81, 0x6a, 0xa0, 0xa0, 0xaf, 0x11, 0x5e, 0xf2, 0x85, 0x8a, 0xfe, 0xb6, 0x68, 0xb2, 0xe9, + 0xc9}}, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + {{0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, + 0x0a}}, + /* RFC4122 uuid5(nordic_vid, 'test_sample_app') */ + {{0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, 0x53, 0x9c, 0xa3, 0x18, 0x68, 0x1b, 0x03, 0x69, 0x5e, + 0x36}}, +}; + +static const suit_manifest_class_id_t *unsupported_classes[] = { + &classes[0], + &classes[1], + &classes[2], +}; + +static const suit_manifest_class_id_t *supported_classes[] = { + &classes[3], + &classes[4], +}; + +static void test_suite_before(void *f) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + err = suit_storage_init(); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to initialize SUIT storage module (%d).", + err); +} + +ZTEST_SUITE(suit_storage_envelopes_tests, NULL, NULL, test_suite_before, NULL, NULL); + +ZTEST(suit_storage_envelopes_tests, test_empty_envelope_get) +{ + const uint8_t *addr; + size_t size; + int rc = 0; + + for (size_t i = 0; i < ARRAY_SIZE(classes); i++) { + rc = suit_storage_installed_envelope_get(NULL, NULL, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received", i); + + rc = suit_storage_installed_envelope_get(NULL, NULL, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received (%d)", i, + size); + + rc = suit_storage_installed_envelope_get(NULL, &addr, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received (0x%x)", i, + addr); + + rc = suit_storage_installed_envelope_get(&classes[i], NULL, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received", i); + + rc = suit_storage_installed_envelope_get(&classes[i], NULL, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received (%d)", i, + size); + + rc = suit_storage_installed_envelope_get(&classes[i], &addr, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Arguments are incorrect, but %d envelope was received (0x%x)", i, + addr); + + rc = suit_storage_installed_envelope_get(&classes[i], &addr, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Suit storage is empty, but %d envelope was received (0x%x, %d)", + i, addr, size); + } +} + +ZTEST(suit_storage_envelopes_tests, test_empty_envelope_set) +{ + const uint8_t *addr; + size_t size; + int rc = 0; + + suit_plat_mreg_t envelopes[] = { + { + .mem = manifest_root_posix_buf, + .size = manifest_root_posix_len, + }, + { + .mem = manifest_app_posix_buf, + .size = manifest_app_posix_len, + }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(envelopes); i++) { + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was not installed, but was returned (0x%x, %d)", i, + addr, size); + + rc = suit_storage_install_envelope(supported_classes[i], + (uint8_t *)envelopes[i].mem, envelopes[i].size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to install envelope %d", i); + + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was installed, but was not returned (0x%x, %d)", i, addr, + size); + zassert_true(size < (envelopes[i].size - 256), + "Envelope %d was installed, but the size was not reduced (%d >= %d)", + i, size, envelopes[i].size); + } +} + +ZTEST(suit_storage_envelopes_tests, test_empty_envelope_override) +{ + const uint8_t *addr; + size_t size; + int rc = 0; + + suit_plat_mreg_t envelopes[] = { + { + .mem = manifest_root_posix_buf, + .size = manifest_root_posix_len, + }, + { + .mem = manifest_app_posix_buf, + .size = manifest_app_posix_len, + }, + }; + + /* Verify that envelopes are not installed. */ + for (size_t i = 0; i < ARRAY_SIZE(envelopes); i++) { + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was not installed, but was returned (0x%x, %d)", i, + addr, size); + } + + /* Install envelopes for the first time. */ + for (size_t i = 0; i < ARRAY_SIZE(envelopes); i++) { + rc = suit_storage_install_envelope(supported_classes[i], + (uint8_t *)envelopes[i].mem, envelopes[i].size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to install envelope %d", i); + + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was installed, but was not returned (0x%x, %d)", i, addr, + size); + } + + /* Install new version of the envelopes. */ + suit_plat_mreg_t envelopes_v2[] = { + { + .mem = manifest_root_posix_v2_buf, + .size = manifest_root_posix_v2_len, + }, + { + .mem = manifest_app_posix_v2_buf, + .size = manifest_app_posix_v2_len, + }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(envelopes_v2); i++) { + rc = suit_storage_install_envelope( + supported_classes[i], (uint8_t *)envelopes_v2[i].mem, envelopes_v2[i].size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to install envelope %d", i); + + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was installed, but was not returned (0x%x, %d)", i, addr, + size); + } +} + +ZTEST(suit_storage_envelopes_tests, test_empty_envelope_set_unsupported_classes) +{ + const uint8_t *addr; + size_t size; + int rc = 0; + + suit_plat_mreg_t envelopes[] = { + { + .mem = manifest_root_buf, + .size = manifest_root_len, + }, + { + .mem = manifest_app_buf, + .size = manifest_app_len, + }, + { + .mem = manifest_rad_buf, + .size = manifest_rad_len, + }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(envelopes); i++) { + rc = suit_storage_install_envelope(unsupported_classes[i], + (uint8_t *)envelopes[i].mem, envelopes[i].size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope with unsupported class ID shall fail %d", i); + + rc = suit_storage_installed_envelope_get(unsupported_classes[i], &addr, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was not installed, but was returned (0x%x, %d)", i, + addr, size); + } +} + +ZTEST(suit_storage_envelopes_tests, test_empty_envelope_set_class_mismatch) +{ + const uint8_t *addr; + size_t size; + int rc = 0; + + suit_plat_mreg_t envelopes[] = { + { + .mem = manifest_root_buf, + .size = manifest_root_len, + }, + { + .mem = manifest_app_buf, + .size = manifest_app_len, + }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(envelopes); i++) { + rc = suit_storage_install_envelope(supported_classes[i], + (uint8_t *)envelopes[i].mem, envelopes[i].size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope with unmatched class ID shall fail %d", i); + + rc = suit_storage_installed_envelope_get(supported_classes[i], &addr, &size); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Envelope %d was not installed, but was returned (0x%x, %d)", i, + addr, size); + } +} diff --git a/tests/subsys/suit/storage/src/test_report.c b/tests/subsys/suit/storage/src/test_report.c new file mode 100644 index 000000000000..9dda01b41f00 --- /dev/null +++ b/tests/subsys/suit/storage/src/test_report.c @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpusec_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpusec_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpusec_suit_storage) +#define SUIT_STORAGE_REPORT_SLOTS 1 +#define SUIT_STORAGE_REPORT_SLOT_SIZE (160 - SUIT_STORAGE_REPORT_FLAG_SIZE) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#define SUIT_STORAGE_REPORT_SLOTS 2 +#define SUIT_STORAGE_REPORT_SLOT_SIZE (0x1000 - SUIT_STORAGE_REPORT_FLAG_SIZE) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) +#define SUIT_STORAGE_REPORT_FLAG_SIZE sizeof(uint32_t) + +static uint8_t sample_report[SUIT_STORAGE_REPORT_SLOT_SIZE + 1]; + +static void test_suite_before(void *f) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole nordic area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + err = suit_storage_init(); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to initialize SUIT storage module (%d).", + err); +} + +ZTEST_SUITE(suit_storage_report_tests, NULL, NULL, test_suite_before, NULL, NULL); + +ZTEST(suit_storage_report_tests, test_empty_report_read) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, + "Storage is empty, but report availability is reported (0x%x, %d).", + buf, len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_index_range) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + suit_plat_err_t ret = suit_storage_report_clear(SUIT_STORAGE_REPORT_SLOTS + 1); + + zassert_equal(ret, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "Out of bounds report clear not handled correctly (%d).", ret); + + ret = suit_storage_report_save(SUIT_STORAGE_REPORT_SLOTS + 1, NULL, 0); + + zassert_equal(ret, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "Out of bounds report save not handled correctly (%d).", ret); + + ret = suit_storage_report_read(SUIT_STORAGE_REPORT_SLOTS + 1, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "Out of bounds report read not handled correctly (%d).", ret); +} + +ZTEST(suit_storage_report_tests, test_empty_report_read_invalid_arg) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + suit_plat_err_t ret = suit_storage_report_read(0, NULL, NULL); + + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, + "Invalid arguments (0, NULL, NULL) not detected (%d).", ret); + + ret = suit_storage_report_read(0, &buf, NULL); + + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, "Invalid arguments (0, _, NULL) not detected (%d).", + ret); + + ret = suit_storage_report_read(0, NULL, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, "Invalid arguments (0, NULL, _) not detected (%d).", + ret); +} + +ZTEST(suit_storage_report_tests, test_empty_report_readback_flag) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_clear(i); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to clear report slot %d (%d).", i, + ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, "Failed to clear slot %d (%d).", i, + ret); + + ret = suit_storage_report_save(i, NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set empty report flag for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read empty report flag for slot %d (%d).", i, ret); + zassert_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", i, + buf); + zassert_equal(len, 0, "Invalid buffer length for slot %d returned (0x%lx).", i, + len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_readback_data) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Fill buffer with sample data */ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOT_SIZE; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_clear(i); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to clear report slot %d (%d).", i, + ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, "Failed to clear slot %d (%d).", i, + ret); + + ret = suit_storage_report_save(i, sample_report, SUIT_STORAGE_REPORT_SLOT_SIZE); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_readback_short_data) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Set the buffer with default values */ + memset(sample_report, 0xff, SUIT_STORAGE_REPORT_SLOT_SIZE); + + /* Fill buffer with sample data */ + for (size_t i = 0; i < 0x16; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_clear(i); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to clear report slot %d (%d).", i, + ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, "Failed to clear slot %d (%d).", i, + ret); + + ret = suit_storage_report_save(i, sample_report, 0x16); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_save_overflow) +{ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = + suit_storage_report_save(i, sample_report, sizeof(sample_report)); + + zassert_equal(ret, SUIT_PLAT_ERR_INVAL, "Failed to detect slot %d overflow (%d).", + i, ret); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_overwrite_flag) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Fill buffer with sample data */ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOT_SIZE; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = + suit_storage_report_save(i, sample_report, SUIT_STORAGE_REPORT_SLOT_SIZE); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + + ret = suit_storage_report_save(i, NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set empty report flag for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read empty report flag for slot %d (%d).", i, ret); + zassert_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", i, + buf); + zassert_equal(len, 0, "Invalid buffer length for slot %d returned (0x%lx).", i, + len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_overwrite_data) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Fill buffer with sample data */ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOT_SIZE; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_save(i, NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set empty report flag for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read empty report flag for slot %d (%d).", i, ret); + zassert_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", i, + buf); + zassert_equal(len, 0, "Invalid buffer length for slot %d returned (0x%lx).", i, + len); + + ret = suit_storage_report_save(i, sample_report, SUIT_STORAGE_REPORT_SLOT_SIZE); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_overwrite_short_data) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Fill buffer with sample data */ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOT_SIZE; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = + suit_storage_report_save(i, sample_report, SUIT_STORAGE_REPORT_SLOT_SIZE); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + + /* Set the buffer with default values */ + memset(sample_report, 0xff, SUIT_STORAGE_REPORT_SLOT_SIZE); + + /* Fill buffer with sample short data */ + for (size_t i = 0; i < 0x16; i++) { + sample_report[i] = i % 0x100; + } + + /* Overwrite the buffer partially to verify that the remaining part gets erased. */ + ret = suit_storage_report_save(i, sample_report, 0x16); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_clear_flag) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = suit_storage_report_save(i, NULL, 0); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set empty report flag for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read empty report flag for slot %d (%d).", i, ret); + zassert_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", i, + buf); + zassert_equal(len, 0, "Invalid buffer length for slot %d returned (0x%lx).", i, + len); + + ret = suit_storage_report_clear(i); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to clear report slot %d (%d).", i, + ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, "Failed to clear slot %d (%d).", i, + ret); + } +} + +ZTEST(suit_storage_report_tests, test_empty_report_clear_data) +{ + const uint8_t *buf = NULL; + size_t len = 0; + + /* Fill buffer with sample data */ + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOT_SIZE; i++) { + sample_report[i] = i % 0x100; + } + + for (size_t i = 0; i < SUIT_STORAGE_REPORT_SLOTS; i++) { + suit_plat_err_t ret = + suit_storage_report_save(i, sample_report, SUIT_STORAGE_REPORT_SLOT_SIZE); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to set report with data for slot %d (%d).", i, ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, + "Failed to read report with data for slot %d (%d).", i, ret); + + zassert_mem_equal(sample_report, buf, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Corrupted report data received"); + zassert_not_equal(buf, NULL, "Invalid buffer value for slot %d returned (0x%lx).", + i, buf); + zassert_equal(len, SUIT_STORAGE_REPORT_SLOT_SIZE, + "Invalid buffer length for slot %d returned (0x%lx).", i, len); + + ret = suit_storage_report_clear(i); + + zassert_equal(ret, SUIT_PLAT_SUCCESS, "Failed to clear report slot %d (%d).", i, + ret); + + ret = suit_storage_report_read(i, &buf, &len); + + zassert_equal(ret, SUIT_PLAT_ERR_NOT_FOUND, "Failed to clear slot %d (%d).", i, + ret); + } +} diff --git a/tests/subsys/suit/storage/src/test_update.c b/tests/subsys/suit/storage/src/test_update.c new file mode 100644 index 000000000000..f8dbc7dd725d --- /dev/null +++ b/tests/subsys/suit/storage/src/test_update.c @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#if DT_NODE_EXISTS(DT_NODELABEL(cpuapp_suit_storage)) +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) +#else +#define SUIT_STORAGE_OFFSET FIXED_PARTITION_OFFSET(suit_storage) +#define SUIT_STORAGE_SIZE FIXED_PARTITION_SIZE(suit_storage) +#endif +#define SUIT_STORAGE_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_OFFSET) + +static void test_suite_before(void *f) +{ + /* Execute SUIT storage init, so the MPI area is copied into a backup region. */ + int err = suit_storage_init(); + + zassert_equal(SUIT_PLAT_SUCCESS, err, "Failed to init and backup suit storage (%d)", err); + + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to erase storage area"); + + err = flash_erase(fdev, SUIT_STORAGE_OFFSET, SUIT_STORAGE_SIZE); + zassert_equal(0, err, "Unable to erase storage before test execution"); + + err = suit_storage_init(); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to initialize SUIT storage module (%d).", + err); +} + +ZTEST_SUITE(suit_storage_update_tests, NULL, NULL, test_suite_before, NULL, NULL); + +ZTEST(suit_storage_update_tests, test_empty_update_available) +{ + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + int rc = suit_storage_update_cand_get(&update_regions, &update_regions_len); + + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Storage is empty, but update availability is reported (0x%x, %d).", + update_regions, update_regions_len); +} + +ZTEST(suit_storage_update_tests, test_empty_update_get) +{ + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + int rc = SUIT_PLAT_SUCCESS; + + rc = suit_storage_update_cand_get(NULL, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Storage is empty, but update candidate was received"); + + rc = suit_storage_update_cand_get(NULL, &update_regions_len); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Storage is empty, but update candidate was received (%d)", + update_regions_len); + + rc = suit_storage_update_cand_get(&update_regions, NULL); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Storage is empty, but update candidate was received (0x%x)", + update_regions); + + rc = suit_storage_update_cand_get(&update_regions, &update_regions_len); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Storage is empty, but update candidate was received (0x%x, %d)", + update_regions, update_regions_len); +} + +ZTEST(suit_storage_update_tests, test_empty_update_clear) +{ + int rc = suit_storage_update_cand_set(NULL, 0); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to clear empty partition (%d)", rc); +} + +void verify_storage_updates(void) +{ + void *addresses[] = {NULL, (void *)0xCAFEFECA}; + size_t sizes[] = {0, SUIT_STORAGE_SIZE + 1, SUIT_STORAGE_SIZE, 0x2048, 2044}; + int rc = SUIT_PLAT_SUCCESS; + suit_plat_mreg_t update_candidate[1]; + + for (int addr_i = 0; addr_i < ARRAY_SIZE(addresses); addr_i++) { + for (int size_i = 0; size_i < ARRAY_SIZE(sizes); size_i++) { + update_candidate[0].mem = addresses[addr_i]; + update_candidate[0].size = sizes[size_i]; + + if ((update_candidate[0].mem != NULL) && (update_candidate[0].size > 0)) { + rc = suit_storage_update_cand_set(update_candidate, + ARRAY_SIZE(update_candidate)); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Setting correct DFU partition failed (0x%x, %d).", + update_candidate[0].mem, update_candidate[0].size); + + /* Verify set values */ + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + rc = suit_storage_update_cand_get(&update_regions, + &update_regions_len); + zassert_equal( + rc, SUIT_PLAT_SUCCESS, + "Set succeeded, but update availability is not reported."); + zassert_equal(update_regions_len, 1, + "Set succeeded, but length of update candidate " + "regions is invalid (%d).", + update_regions_len); + zassert_equal(update_regions[0].mem, addresses[addr_i], + "Update set with wrong address (%p != %p)", + update_regions[0].mem, addresses[addr_i]); + zassert_equal(update_regions[0].size, sizes[size_i], + "Update set with wrong size (0x%x != 0x%x)", + update_regions[0].size, sizes[size_i]); + } else { + rc = suit_storage_update_cand_set(update_candidate, + ARRAY_SIZE(update_candidate)); + zassert_not_equal( + rc, SUIT_PLAT_SUCCESS, + "Setting incorrect DFU partition should fail (0x%x, %d).", + addresses[addr_i], sizes[size_i]); + + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + rc = suit_storage_update_cand_get(&update_regions, + &update_regions_len); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Set not succeeded, but update availability is " + "reported (0x%x, %d).", + update_regions, update_regions_len); + } + } + } +} + +ZTEST(suit_storage_update_tests, test_empty_update_set) +{ + verify_storage_updates(); +} + +ZTEST(suit_storage_update_tests, test_cleared_update_set) +{ + int rc = suit_storage_update_cand_set(NULL, 0); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to clear empty partition (%d)", rc); + + verify_storage_updates(); +} + +ZTEST(suit_storage_update_tests, test_cleared_update_clear) +{ + int rc = suit_storage_update_cand_set(NULL, 0); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to clear empty partition (%d)", rc); + + rc = suit_storage_update_cand_set(NULL, 0); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to clear cleared partition (%d)", rc); +} + +ZTEST(suit_storage_update_tests, test_valid_update_clear) +{ + suit_plat_mreg_t update_candidate[1] = {{ + .mem = (uint8_t *)0xCAFEFECA, + .size = 2044, + }}; + int rc = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Unable to set correct DFU before test execution (0x%x, %d).", 0xCAFEFECA, + 2044); + + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + rc = suit_storage_update_cand_get(&update_regions, &update_regions_len); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Set succeeded, but update availability is not reported."); + zassert_equal(update_regions_len, 1, + "Set succeeded, but length of update candidate regions is invalid (%d).", + update_regions_len); + + rc = suit_storage_update_cand_set(NULL, 0); + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to clear empty partition (%d)", rc); +} + +ZTEST(suit_storage_update_tests, test_update_with_caches) +{ + suit_plat_mreg_t update_candidate[3] = { + { + .mem = (uint8_t *)0xCAFEFECA, + .size = 2044, + }, + { + .mem = (uint8_t *)0x000CA52E, + .size = 123, + }, + { + .mem = (uint8_t *)0xB16CA52E, + .size = 65543, + }, + }; + int rc = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_equal(rc, SUIT_PLAT_SUCCESS, "Unable to set complex update candidate info"); + + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + rc = suit_storage_update_cand_get(&update_regions, &update_regions_len); + zassert_equal(rc, SUIT_PLAT_SUCCESS, + "Set succeeded, but update availability is not reported."); + zassert_equal(update_regions_len, 3, + "Set succeeded, but length of update candidate regions is invalid (%d).", + update_regions_len); + for (size_t i = 0; i < ARRAY_SIZE(update_candidate); i++) { + zassert_equal(update_regions[i].mem, update_candidate[i].mem, + "Update region %d set with wrong address (%p != %p)", i, + update_regions[i].mem, update_candidate[i].mem); + zassert_equal(update_regions[i].size, update_candidate[i].size, + "Update region %d set with wrong size (0x%x != 0x%x)", i, + update_regions[i].size, update_candidate[i].size); + } +} + +ZTEST(suit_storage_update_tests, test_update_with_too_many_caches) +{ + suit_plat_mreg_t update_candidate[CONFIG_SUIT_STORAGE_N_UPDATE_REGIONS + 1]; + + for (size_t i = 0; i < ARRAY_SIZE(update_candidate); i++) { + update_candidate[i].mem = (uint8_t *)0xCAFEFECA; + update_candidate[i].size = 2044; + } + + int rc = suit_storage_update_cand_set(update_candidate, ARRAY_SIZE(update_candidate)); + + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Too long complex update candidate info set shall fail"); + + const suit_plat_mreg_t *update_regions = NULL; + size_t update_regions_len = 0; + + rc = suit_storage_update_cand_get(&update_regions, &update_regions_len); + zassert_not_equal(rc, SUIT_PLAT_SUCCESS, + "Set not succeeded, but update availability is reported (0x%x, %d).", + update_regions, update_regions_len); +} diff --git a/tests/subsys/suit/storage/testcase.yaml b/tests/subsys/suit/storage/testcase.yaml new file mode 100644 index 000000000000..760557ee166b --- /dev/null +++ b/tests/subsys/suit/storage/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-processor.integration.suit_storage: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_storage + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/storage_nrf54h20/CMakeLists.txt b/tests/subsys/suit/storage_nrf54h20/CMakeLists.txt new file mode 100644 index 000000000000..04a4471f1755 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# 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(integration_test_suit_storage_nrf54h20) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_utils) +zephyr_library_link_libraries(suit_storage_interface) +zephyr_library_link_libraries(suit_update_magic_values) diff --git a/tests/subsys/suit/storage_nrf54h20/boards/native_posix.conf b/tests/subsys/suit/storage_nrf54h20/boards/native_posix.conf new file mode 100644 index 000000000000..dc4d24129d14 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/boards/native_posix.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_FLASH_SIMULATOR=y diff --git a/tests/subsys/suit/storage_nrf54h20/boards/native_posix.overlay b/tests/subsys/suit/storage_nrf54h20/boards/native_posix.overlay new file mode 100644 index 000000000000..85fa29b5f28a --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/boards/native_posix.overlay @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&flash0 { + /* Align erase block size with the nRF54H20 MRAM definition. */ + erase-block-size = <16>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Use the last 32 kB of SecDom SUIT NVM storage. */ + /* Use the first 4kB as area reserved for Secure domain. */ + cpusec_suit_storage: partition@1e7000 { + reg = <0x1e7000 DT_SIZE_K(4)>; + }; + + /* Use the next 4kB as area reserved for Radio domain. */ + cpurad_suit_storage: partition@1e8000 { + reg = <0x1e8000 DT_SIZE_K(4)>; + }; + + /* Use the next 8kB as area reserved for Application domain. */ + cpuapp_suit_storage: partition@1e9000 { + reg = <0x1e9000 DT_SIZE_K(8)>; + }; + }; +}; diff --git a/tests/subsys/suit/storage_nrf54h20/prj.conf b/tests/subsys/suit/storage_nrf54h20/prj.conf new file mode 100644 index 000000000000..b57baf2bd685 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/prj.conf @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_STORAGE=y +# Force SUIT storage memory layout to match nRF54H20-specific implementation. +CONFIG_SUIT_STORAGE_LAYOUT_NRF54H20=y +CONFIG_SUIT_METADATA=y +# nRF54H20 storage uses SHA-256 to protect MPI and NVVs: +CONFIG_SUIT_CRYPTO=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y diff --git a/tests/subsys/suit/storage_nrf54h20/src/test_common.c b/tests/subsys/suit/storage_nrf54h20/src/test_common.c new file mode 100644 index 000000000000..79cd950b9a00 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/src/test_common.c @@ -0,0 +1,715 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include "test_common.h" + +/* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ +static uint8_t nordic_vid[] = { + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4 +}; + +/* RFC4122 uuid5(nordic_vid, 'nRF54H20_nordic_top') */ +static uint8_t nordic_top_cid[] = { + 0xf0, 0x3d, 0x38, 0x5e, 0xa7, 0x31, 0x56, 0x05, + 0xb1, 0x5d, 0x03, 0x7f, 0x6d, 0xa6, 0x09, 0x7f +}; + +/* RFC4122 uuid5(nordic_vid, 'nRF54H20_sec') */ +static uint8_t nordic_sdfw_cid[] = { + 0xd9, 0x6b, 0x40, 0xb7, 0x09, 0x2b, 0x5c, 0xd1, + 0xa5, 0x9f, 0x9a, 0xf8, 0x0c, 0x33, 0x7e, 0xba +}; + +/* RFC4122 uuid5(nordic_vid, 'nRF54H20_sys') */ +static uint8_t nordic_scfw_cid[] = { + 0xc0, 0x8a, 0x25, 0xd7, 0x35, 0xe6, 0x59, 0x2c, + 0xb7, 0xad, 0x43, 0xac, 0xc8, 0xd1, 0xd1, 0xc8 +}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ +static uint8_t app_root_cid[] = { + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, +}; + +/* RFC4122 uuid5(nordic_vid, 'test_sample_rad') */ +static uint8_t rad_cid[] = { + 0xf3, 0xe2, 0xb4, 0xe0, 0xd3, 0x73, 0x51, 0xdd, + 0x99, 0x2b, 0xba, 0x1d, 0x84, 0xf1, 0x16, 0x9a, +}; + +uint8_t nvv_empty[64] = { + /* 0xFF * 32 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0xAF, 0x96, 0x13, 0x76, 0x0F, 0x72, 0x63, 0x5F, + 0xBD, 0xB4, 0x4A, 0x5A, 0x0A, 0x63, 0xC3, 0x9F, + 0x12, 0xAF, 0x30, 0xF9, 0x50, 0xA6, 0xEE, 0x5C, + 0x97, 0x1B, 0xE1, 0x88, 0xE8, 0x9C, 0x40, 0x51, +}; + +uint8_t nvv_sample[64] = { + /* sample 8 values */ + 0x00, 0x00, 0x00, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0x55, 0xAA, 0x55, 0x00, 0x00, 0x00, 0x01, + 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xAB, 0xCD, 0xEF, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0x73, 0xb4, 0x25, 0x20, 0xdf, 0x43, 0x7e, 0xc7, + 0x63, 0xfb, 0xb6, 0x05, 0x70, 0x23, 0x2f, 0xb3, + 0x6a, 0x65, 0xbe, 0x14, 0xcb, 0x2e, 0x83, 0x6a, + 0x3b, 0xc9, 0xfd, 0x87, 0xf6, 0xde, 0x79, 0x05, +}; + +void erase_area_nordic(void) +{ + /* Clear the whole nordic area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_erase(fdev, SUIT_STORAGE_NORDIC_OFFSET, SUIT_STORAGE_NORDIC_SIZE); + + zassert_equal(0, err, "Unable to erase nordic area before test execution"); +} + +void erase_area_rad(void) +{ + /* Clear the whole radio area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_erase(fdev, SUIT_STORAGE_RAD_OFFSET, SUIT_STORAGE_RAD_SIZE); + + zassert_equal(0, err, "Unable to erase radio core area before test execution"); +} + +void erase_area_app(void) +{ + /* Clear the whole application area */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_erase(fdev, SUIT_STORAGE_APP_OFFSET, SUIT_STORAGE_APP_SIZE); + + zassert_equal(0, err, "Unable to erase application area before test execution"); +} + +void erase_area_app_nvv(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_erase(fdev, SUIT_STORAGE_APP_NVV_OFFSET, SUIT_STORAGE_APP_NVV_SIZE / 2); + + zassert_equal(0, err, "Unable to erase NNV area before test execution"); +} + +void erase_area_app_nvv_backup(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_erase(fdev, SUIT_STORAGE_APP_NVV_OFFSET + SUIT_STORAGE_APP_NVV_SIZE / 2, + SUIT_STORAGE_APP_NVV_SIZE / 2); + + zassert_equal(0, err, "Unable to erase NNV backup before test execution"); +} + +void write_area_app_empty_nvv_backup(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_APP_NVV_OFFSET + SUIT_STORAGE_APP_NVV_SIZE / 2, + nvv_empty, sizeof(nvv_empty)); + + zassert_equal(0, err, "Unable to store empty NVV contents before test execution"); +} + +void write_area_app_nvv_backup(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_APP_NVV_OFFSET + SUIT_STORAGE_APP_NVV_SIZE / 2, + nvv_sample, sizeof(nvv_sample)); + + zassert_equal(0, err, "Unable to store empty NVV contents before test execution"); +} + +void write_area_app_nvv(void) +{ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_APP_NVV_OFFSET, nvv_sample, sizeof(nvv_sample)); + + zassert_equal(0, err, "Unable to store sample NVV contents before test execution"); +} + +void write_empty_area_app(void) +{ + /* Digest of the content defined in assert_empty_mpi_area_app(). */ + uint8_t app_digest[] = { + 0xd6, 0xc4, 0x94, 0x17, 0xb1, 0xca, 0x0a, 0x67, + 0x14, 0xdc, 0xde, 0x2b, 0x40, 0x01, 0x0c, 0xb7, + 0x49, 0x6d, 0x05, 0xdf, 0x7f, 0x8c, 0x8b, 0x1b, + 0x98, 0x14, 0x09, 0x7e, 0x9d, 0x62, 0xc8, 0xe1, + }; + + /* Write the digest of application area filled with 0xFF */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_APP_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +void write_empty_area_rad(void) +{ + /* Digest of the content defined in assert_empty_mpi_area_rad(). */ + uint8_t rad_digest[] = { + 0xd1, 0x69, 0xf6, 0x75, 0x42, 0x29, 0xc2, 0x00, + 0xba, 0x48, 0x38, 0xa3, 0x8e, 0x48, 0x94, 0xc0, + 0x3c, 0x47, 0xce, 0x89, 0x39, 0xdb, 0x4b, 0x7a, + 0x11, 0xc2, 0x24, 0x92, 0x1b, 0x98, 0x25, 0x21, + }; + + /* Write the digest of radio area filled with 0xFF */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_RAD_OFFSET + SUIT_STORAGE_RAD_MPI_SIZE, rad_digest, + sizeof(rad_digest)); + + zassert_equal(0, err, "Unable to store radio MPI digest before test execution"); +} + +void write_area_app_root(void) +{ + uint8_t mpi_root[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + /* Digest of the content defined in assert_valid_mpi_area_app(). */ + uint8_t app_digest[] = { + 0xa9, 0xa0, 0xee, 0x40, 0x5f, 0xad, 0x2b, 0xeb, + 0x66, 0x50, 0xdd, 0xa9, 0x97, 0x11, 0x72, 0x98, + 0x2b, 0x17, 0x45, 0x90, 0x16, 0xe1, 0xc7, 0xf5, + 0xc1, 0xdc, 0x3f, 0xb4, 0x58, 0x96, 0x1e, 0x44, + }; + + /* Write the sample application area (just the root MPI) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_APP_OFFSET, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application root MPI contents before test execution"); + + err = flash_write(fdev, SUIT_STORAGE_APP_OFFSET + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, "Unable to store application MPI digest before test execution"); +} + +void write_area_rad(void) +{ + uint8_t mpi_rad[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_rad') */ + 0xf3, 0xe2, 0xb4, 0xe0, 0xd3, 0x73, 0x51, 0xdd, + 0x99, 0x2b, 0xba, 0x1d, 0x84, 0xf1, 0x16, 0x9a, + }; + /* Digest of the content defined in assert_valid_mpi_area_rad(). */ + uint8_t rad_digest[] = { + 0x29, 0x8b, 0x7b, 0x01, 0x42, 0x24, 0xcf, 0x2f, + 0x48, 0xe5, 0xf3, 0x6d, 0x0f, 0xa5, 0x66, 0x6d, + 0x17, 0x42, 0x32, 0xf7, 0x03, 0x9f, 0xf8, 0xa4, + 0x8d, 0x52, 0xc6, 0x8d, 0xea, 0xdc, 0x33, 0x3b, + }; + + /* Write the sample radio area (just one MPI entry) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, SUIT_STORAGE_RAD_OFFSET, mpi_rad, sizeof(mpi_rad)); + + zassert_equal(0, err, "Unable to store radio root MPI contents before test execution"); + + err = flash_write(fdev, SUIT_STORAGE_RAD_OFFSET + SUIT_STORAGE_RAD_MPI_SIZE, rad_digest, + sizeof(rad_digest)); + zassert_equal(0, err, "Unable to store radio MPI digest before test execution"); +} + +void write_area_nordic_root(void) +{ + uintptr_t mpi_root_backup_offset = + SUIT_STORAGE_NORDIC_OFFSET + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE; + uint8_t mpi_root[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + /* Digest of the content defined in assert_valid_mpi_area_app(). */ + uint8_t app_digest[] = { + 0xa9, 0xa0, 0xee, 0x40, 0x5f, 0xad, 0x2b, 0xeb, + 0x66, 0x50, 0xdd, 0xa9, 0x97, 0x11, 0x72, 0x98, + 0x2b, 0x17, 0x45, 0x90, 0x16, 0xe1, 0xc7, 0xf5, + 0xc1, 0xdc, 0x3f, 0xb4, 0x58, 0x96, 0x1e, 0x44, + }; + + /* Write the sample application backup area (just the root MPI) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, mpi_root_backup_offset, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application backup root MPI contents before test execution"); + + err = flash_write(fdev, mpi_root_backup_offset + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, + "Unable to store application backup MPI digest before test execution"); +} + +void write_area_nordic_rad(void) +{ + uintptr_t mpi_rad_backup_offset = SUIT_STORAGE_NORDIC_OFFSET; + uint8_t mpi_rad[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_rad') */ + 0xf3, 0xe2, 0xb4, 0xe0, 0xd3, 0x73, 0x51, 0xdd, + 0x99, 0x2b, 0xba, 0x1d, 0x84, 0xf1, 0x16, 0x9a, + }; + /* Digest of the content defined in assert_valid_mpi_area_rad(). */ + uint8_t rad_digest[] = { + 0x29, 0x8b, 0x7b, 0x01, 0x42, 0x24, 0xcf, 0x2f, + 0x48, 0xe5, 0xf3, 0x6d, 0x0f, 0xa5, 0x66, 0x6d, + 0x17, 0x42, 0x32, 0xf7, 0x03, 0x9f, 0xf8, 0xa4, + 0x8d, 0x52, 0xc6, 0x8d, 0xea, 0xdc, 0x33, 0x3b, + }; + + /* Write the sample radio backup area (just one MPI entry) and corresponding digest */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, mpi_rad_backup_offset, mpi_rad, sizeof(mpi_rad)); + + zassert_equal(0, err, + "Unable to store radio backup root MPI contents before test execution"); + + err = flash_write(fdev, mpi_rad_backup_offset + SUIT_STORAGE_RAD_MPI_SIZE, rad_digest, + sizeof(rad_digest)); + zassert_equal(0, err, "Unable to store radio backup MPI digest before test execution"); +} + +void write_area_nordic_old_root(void) +{ + uintptr_t mpi_root_backup_offset = + SUIT_STORAGE_NORDIC_OFFSET + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE; + uint8_t mpi_root[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* 0xAA * 16 */ + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + }; + uint8_t app_digest[] = { + 0xca, 0x4f, 0x80, 0xdc, 0xd1, 0x9b, 0xb2, 0x24, + 0x8e, 0x2b, 0x13, 0xeb, 0x6c, 0xf2, 0xae, 0xd0, + 0x96, 0x28, 0xc2, 0x0c, 0x69, 0xe5, 0xf5, 0x23, + 0x0c, 0x92, 0xd6, 0x2d, 0x36, 0x69, 0x27, 0x58, + }; + + /* Write the sample application backup area (just the root MPI with altered class) and + * corresponding digest + */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, mpi_root_backup_offset, mpi_root, sizeof(mpi_root)); + + zassert_equal(0, err, + "Unable to store application backup root MPI contents before test execution"); + + err = flash_write(fdev, mpi_root_backup_offset + SUIT_STORAGE_APP_MPI_SIZE, app_digest, + sizeof(app_digest)); + zassert_equal(0, err, + "Unable to store application backup MPI digest before test execution"); +} + +void write_area_nordic_old_rad(void) +{ + uintptr_t mpi_rad_backup_offset = SUIT_STORAGE_NORDIC_OFFSET; + uint8_t mpi_rad[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* 0xBB * 16 */ + 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, + }; + uint8_t rad_digest[] = { + 0x7a, 0x07, 0x30, 0x81, 0xea, 0x7b, 0x3b, 0x08, + 0xca, 0x55, 0xbe, 0x48, 0x8d, 0x75, 0x22, 0x35, + 0x6f, 0x1f, 0x82, 0x16, 0x28, 0xae, 0x68, 0x71, + 0xc3, 0xc1, 0x8e, 0x5b, 0xb9, 0xf0, 0x2f, 0xdd, + }; + + /* Write the sample radio backup area (just the sample MPI with altered class) and + * corresponding digest + */ + const struct device *fdev = SUIT_PLAT_INTERNAL_NVM_DEV; + + zassert_not_null(fdev, "Unable to find a driver to modify MPI area"); + + int err = flash_write(fdev, mpi_rad_backup_offset, mpi_rad, sizeof(mpi_rad)); + + zassert_equal(0, err, + "Unable to store radio backup sample MPI contents before test execution"); + + err = flash_write(fdev, mpi_rad_backup_offset + SUIT_STORAGE_APP_MPI_SIZE, rad_digest, + sizeof(rad_digest)); + zassert_equal(0, err, "Unable to store radio backup MPI digest before test execution"); +} + +void assert_nordic_classes(void) +{ + suit_manifest_class_info_t class_infos[CONFIG_SUIT_STORAGE_N_ENVELOPES]; + size_t class_infos_len = CONFIG_SUIT_STORAGE_N_ENVELOPES; + + /* ASSERT that it is possible to fetch list of supported manifest classes and roles */ + int err = suit_storage_mpi_class_ids_get(class_infos, &class_infos_len); + + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Failed to fetch list of supported manifest classes (%d).", err); + /* ... and MPI reports at least 3 class IDs */ + zassert_true(class_infos_len >= 3, + "Invalid number of supported manifest classes (%d < %d).", class_infos_len, 3); + /* ... and the Nordic top manifest class is supported */ + zassert_mem_equal(class_infos[0].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[0].class_id, nordic_top_cid, sizeof(nordic_top_cid)); + zassert_equal(class_infos[0].role, SUIT_MANIFEST_SEC_TOP, "Invalid class role returned: %d", + class_infos[0].role); + /* ... and the Nordic secure domain update & recovery manifest class is supported */ + zassert_mem_equal(class_infos[1].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[1].class_id, nordic_sdfw_cid, sizeof(nordic_sdfw_cid)); + zassert_equal(class_infos[1].role, SUIT_MANIFEST_SEC_SDFW, + "Invalid class role returned: %d", class_infos[3].role); + /* ... and the Nordic system controller manifest class is supported */ + zassert_mem_equal(class_infos[2].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[2].class_id, nordic_scfw_cid, sizeof(nordic_scfw_cid)); + zassert_equal(class_infos[2].role, SUIT_MANIFEST_SEC_SYSCTRL, + "Invalid class role returned: %d", class_infos[3].role); +} + +void assert_sample_root_class(void) +{ + suit_manifest_class_info_t class_infos[CONFIG_SUIT_STORAGE_N_ENVELOPES]; + size_t class_infos_len = CONFIG_SUIT_STORAGE_N_ENVELOPES; + + /* ASSERT that it is possible to fetch list of supported manifest classes and roles */ + int err = suit_storage_mpi_class_ids_get(class_infos, &class_infos_len); + + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Failed to fetch list of supported manifest classes (%d).", err); + /* ... and MPI reports 4 supported class IDs */ + zassert_equal(class_infos_len, 4, + "Invalid number of supported manifest classes (%d != %d).", class_infos_len, + 4); + /* ... and the sample application root manifest class is supported */ + zassert_mem_equal(class_infos[3].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[3].class_id, app_root_cid, sizeof(app_root_cid)); + zassert_equal(class_infos[3].role, SUIT_MANIFEST_APP_ROOT, + "Invalid class role returned: %d", class_infos[3].role); +} + +void assert_sample_root_rad_class(void) +{ + suit_manifest_class_info_t class_infos[CONFIG_SUIT_STORAGE_N_ENVELOPES]; + size_t class_infos_len = CONFIG_SUIT_STORAGE_N_ENVELOPES; + + /* ASSERT that it is possible to fetch list of supported manifest classes and roles */ + int err = suit_storage_mpi_class_ids_get(class_infos, &class_infos_len); + + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Failed to fetch list of supported manifest classes (%d).", err); + /* ... and MPI reports 5 supported class IDs */ + zassert_equal(class_infos_len, 5, + "Invalid number of supported manifest classes (%d != %d).", class_infos_len, + 5); + /* ... and the sample application root manifest class is supported */ + zassert_mem_equal(class_infos[3].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[3].class_id, rad_cid, sizeof(rad_cid)); + zassert_equal(class_infos[3].role, SUIT_MANIFEST_RAD_RECOVERY, + "Invalid class role returned: %d", class_infos[3].role); + /* ... and the sample application root manifest class is supported */ + zassert_mem_equal(class_infos[4].vendor_id, nordic_vid, sizeof(nordic_vid)); + zassert_mem_equal(class_infos[4].class_id, app_root_cid, sizeof(app_root_cid)); + zassert_equal(class_infos[4].role, SUIT_MANIFEST_APP_ROOT, + "Invalid class role returned: %d", class_infos[4].role); +} + +void assert_empty_mpi_area_app(uint8_t *addr, size_t size) +{ + uint8_t empty_mpi_app[] = { + /* 0xFF * 240 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0xd6, 0xc4, 0x94, 0x17, 0xb1, 0xca, 0x0a, 0x67, + 0x14, 0xdc, 0xde, 0x2b, 0x40, 0x01, 0x0c, 0xb7, + 0x49, 0x6d, 0x05, 0xdf, 0x7f, 0x8c, 0x8b, 0x1b, + 0x98, 0x14, 0x09, 0x7e, 0x9d, 0x62, 0xc8, 0xe1, + }; + + zassert_equal(size, sizeof(empty_mpi_app), "Incorrect application area size (0x%x != 0x%x)", + size, sizeof(empty_mpi_app)); + zassert_mem_equal(addr, empty_mpi_app, sizeof(empty_mpi_app), + "MPI application area does not match empty contents (addr: 0x%lx)", + (uintptr_t)addr); +} + +void assert_valid_mpi_area_app(uint8_t *addr, size_t size) +{ + uint8_t valid_mpi_app[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + /* 0xFF * 192 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0xa9, 0xa0, 0xee, 0x40, 0x5f, 0xad, 0x2b, 0xeb, + 0x66, 0x50, 0xdd, 0xa9, 0x97, 0x11, 0x72, 0x98, + 0x2b, 0x17, 0x45, 0x90, 0x16, 0xe1, 0xc7, 0xf5, + 0xc1, 0xdc, 0x3f, 0xb4, 0x58, 0x96, 0x1e, 0x44, + }; + + zassert_equal(size, sizeof(valid_mpi_app), "Incorrect application area size (0x%x != 0x%x)", + size, sizeof(valid_mpi_app)); + zassert_mem_equal(addr, valid_mpi_app, sizeof(valid_mpi_app), + "MPI application area does not match empty contents (addr: 0x%lx)", + (uintptr_t)addr); +} + +void assert_empty_mpi_area_rad(uint8_t *addr, size_t size) +{ + uint8_t empty_mpi_rad[] = { + /* 0xFF * 144 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0xd1, 0x69, 0xf6, 0x75, 0x42, 0x29, 0xc2, 0x00, + 0xba, 0x48, 0x38, 0xa3, 0x8e, 0x48, 0x94, 0xc0, + 0x3c, 0x47, 0xce, 0x89, 0x39, 0xdb, 0x4b, 0x7a, + 0x11, 0xc2, 0x24, 0x92, 0x1b, 0x98, 0x25, 0x21, + }; + + zassert_equal(size, sizeof(empty_mpi_rad), "Incorrect radio area size (0x%x != 0x%x)", size, + sizeof(empty_mpi_rad)); + zassert_mem_equal(addr, empty_mpi_rad, sizeof(empty_mpi_rad), + "MPI radio area does not match empty contents (addr: 0x%lx)", + (uintptr_t)addr); +} + +void assert_valid_mpi_area_rad(uint8_t *addr, size_t size) +{ + uint8_t valid_mpi_rad[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_rad') */ + 0xf3, 0xe2, 0xb4, 0xe0, 0xd3, 0x73, 0x51, 0xdd, + 0x99, 0x2b, 0xba, 0x1d, 0x84, 0xf1, 0x16, 0x9a, + /* 0xFF * 96 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* SHA-256 */ + 0x29, 0x8b, 0x7b, 0x01, 0x42, 0x24, 0xcf, 0x2f, + 0x48, 0xe5, 0xf3, 0x6d, 0x0f, 0xa5, 0x66, 0x6d, + 0x17, 0x42, 0x32, 0xf7, 0x03, 0x9f, 0xf8, 0xa4, + 0x8d, 0x52, 0xc6, 0x8d, 0xea, 0xdc, 0x33, 0x3b, + }; + + zassert_equal(size, sizeof(valid_mpi_rad), "Incorrect radio area size (0x%x != 0x%x)", size, + sizeof(valid_mpi_rad)); + zassert_mem_equal(addr, valid_mpi_rad, sizeof(valid_mpi_rad), + "MPI radio area does not match empty contents (addr: 0x%lx)", + (uintptr_t)addr); +} diff --git a/tests/subsys/suit/storage_nrf54h20/src/test_common.h b/tests/subsys/suit/storage_nrf54h20/src/test_common.h new file mode 100644 index 000000000000..565625e42821 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/src/test_common.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#ifndef TEST_COMMON_H__ +#define TEST_COMMON_H__ + +#define SUIT_STORAGE_NORDIC_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_NORDIC_OFFSET) +#define SUIT_STORAGE_NORDIC_OFFSET FIXED_PARTITION_OFFSET(cpusec_suit_storage) +#define SUIT_STORAGE_NORDIC_SIZE FIXED_PARTITION_SIZE(cpusec_suit_storage) +#define SUIT_STORAGE_RAD_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_RAD_OFFSET) +#define SUIT_STORAGE_RAD_OFFSET FIXED_PARTITION_OFFSET(cpurad_suit_storage) +#define SUIT_STORAGE_RAD_SIZE FIXED_PARTITION_SIZE(cpurad_suit_storage) +#define SUIT_STORAGE_APP_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_APP_OFFSET) +#define SUIT_STORAGE_APP_OFFSET FIXED_PARTITION_OFFSET(cpuapp_suit_storage) +#define SUIT_STORAGE_APP_SIZE FIXED_PARTITION_SIZE(cpuapp_suit_storage) + +#define SUIT_STORAGE_APP_NVV_ADDRESS suit_plat_mem_nvm_ptr_get(SUIT_STORAGE_APP_NVV_OFFSET) +#define SUIT_STORAGE_APP_NVV_OFFSET (SUIT_STORAGE_APP_OFFSET + 0x380) +#define SUIT_STORAGE_APP_NVV_SIZE 0x80 +#define SUIT_STORAGE_APP_MPI_SIZE 0xf0 +#define SUIT_STORAGE_RAD_MPI_SIZE 0x90 +#define SUIT_STORAGE_DIGEST_SIZE 0x20 + +extern uint8_t nvv_empty[64]; +extern uint8_t nvv_sample[64]; + +/** @brief Erase MPI area, assigned for Nordic-controlled manifests. + */ +void erase_area_nordic(void); + +/** @brief Erase MPI area, assigned for radio core manifests. + */ +void erase_area_rad(void); + +/** @brief Erase MPI area, assigned for application manifests. + */ +void erase_area_app(void); + +/** @brief Erase part of MPI area, holding NVV values. + */ +void erase_area_app_nvv(void); + +/** @brief Erase part of MPI area, holding NVV backup. + */ +void erase_area_app_nvv_backup(void); + +/** @brief Populate part of MPI area, holding NVV backup with initial values. + */ +void write_area_app_empty_nvv_backup(void); + +/** @brief Populate part of MPI area, holding NVV backup with sample values. + */ +void write_area_app_nvv_backup(void); + +/** @brief Populate part of MPI area, holding NVV values with sample values. + */ +void write_area_app_nvv(void); + +/** @brief Populate application MPI area, with ones and the correct digest. + */ +void write_empty_area_app(void); + +/** @brief Populate radio MPI area, with ones and the correct digest. + */ +void write_empty_area_rad(void); + +/** @brief Populate part of application MPI area, with sample root MPI. + */ +void write_area_app_root(void); + +/** @brief Populate part of radio MPI area, with sample MPI entry. + */ +void write_area_rad(void); + +/** @brief Populate part of Nordic MPI area, with sample root MPI backup. + */ +void write_area_nordic_root(void); + +/** @brief Populate part of Nordic MPI area, with sample radio MPI entry backup. + */ +void write_area_nordic_rad(void); + +/** @brief Populate part of Nordic MPI area, with sample outdated root MPI backup. + */ +void write_area_nordic_old_root(void); + +/** @brief Populate part of Nordic MPI area, with sample outdated radio MPI backup. + */ +void write_area_nordic_old_rad(void); + +/** @brief Assert that all Nordic-controlled MPIs are provisioned. + */ +void assert_nordic_classes(void); + +/** @brief Assert that root MPI is provisioned. + */ +void assert_sample_root_class(void); + +/** @brief Assert that root and sample radio MPI are provisioned. + */ +void assert_sample_root_rad_class(void); + +/** @brief Assert that the area contains empty application MPI. + * + * @param[in] addr Address of the area. + * @param[in] size Size of the area. + */ +void assert_empty_mpi_area_app(uint8_t *addr, size_t size); + +/** @brief Assert that the area contains valid root MPI. + * + * @param[in] addr Address of the area. + * @param[in] size Size of the area. + */ +void assert_valid_mpi_area_app(uint8_t *addr, size_t size); + +/** @brief Assert that the area contains empty radio MPI. + * + * @param[in] addr Address of the area. + * @param[in] size Size of the area. + */ +void assert_empty_mpi_area_rad(uint8_t *addr, size_t size); + +/** @brief Assert that the area contains valid sample radio MPI entry. + * + * @param[in] addr Address of the area. + * @param[in] size Size of the area. + */ +void assert_valid_mpi_area_rad(uint8_t *addr, size_t size); + +#endif /* TEST_COMMON_H__ */ diff --git a/tests/subsys/suit/storage_nrf54h20/src/test_mpi_load.c b/tests/subsys/suit/storage_nrf54h20/src/test_mpi_load.c new file mode 100644 index 000000000000..f4ddc840f994 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/src/test_mpi_load.c @@ -0,0 +1,409 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include "test_common.h" + +static void test_suite_before(void *f) +{ + /* Reinitialize MPI, so it clears all internal state variables. */ + suit_plat_err_t err = suit_storage_mpi_init(); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to init SUIT MPI module (%d)", err); +} + +ZTEST_SUITE(suit_storage_nrf54h20_mpi_load_tests, NULL, NULL, test_suite_before, NULL, NULL); + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_vid_uuid_zeros) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* 0x00 * 16 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "MPI with UUID filled with zeros should fail to load"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_vid_uuid_ones) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* 0xFF * 16 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "MPI with UUID filled with ones should fail to load"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_cid_uuid_zeros) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* 0x00 * 16 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "MPI with UUID filled with zeros should fail to load"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_cid_uuid_ones) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* 0xFF * 16 */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "MPI with UUID filled with ones should fail to load"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_recovery_without_updates) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x01, /* Independent update disabled */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_RECOVERY, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_UNSUPPORTED, + "It should not be possible to block application recovery updates"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_root_without_updates) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x01, /* Independent update disabled */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_UNSUPPORTED, + "It should not be possible to block application root updates"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_nonerased_reserved) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "It should not be possible to load MPI with nonerase reserved fields"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_empty_new_version) +{ + uint8_t mpi[] = { + 0x02, /* unsupported version */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "It should not be possible to load MPI with unsupported version"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_downgrade_prevention_zero) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x00, /* unknown downgrade prevention policy */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal( + err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "It should not be possible to load MPI with unknown downgrade prevention policy"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_independent_updateability_zero) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x00, /* unknown independent update policy */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal( + err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "It should not be possible to load MPI with unknown independent update policy"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_signature_check_zero) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x00, /* unknown signature check policy */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_ERR_OUT_OF_BOUNDS, + "It should not be possible to load MPI with unknown signature check policy"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_fake_nordic_top_manifest) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'nRF54H20_nordic_top') */ + 0xf0, 0x3d, 0x38, 0x5e, 0xa7, 0x31, 0x56, 0x05, + 0xb1, 0x5d, 0x03, 0x7f, 0x6d, 0xa6, 0x09, 0x7f, + }; + + /* GIVEN the Nordic top manifest is already loaded */ + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_SEC_TOP, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Unable to load Nordic top manifest prior test execution (err: %d)", err); + + /* WHEN application loads ROOT manifest with Nordic top class ID */ + err = suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + + /* THEN application slot is not loaded */ + zassert_equal(err, SUIT_PLAT_ERR_EXISTS, + "It should not be possible to load root MPI with Nordic top class ID"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_two_root_manifests) +{ + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + + /* GIVEN the ROOT manifest is already loaded */ + suit_plat_err_t err = + suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Unable to load root manifest prior test execution (err: %d)", err); + + /* WHEN application loads ROOT manifest from a different slot */ + err = suit_storage_mpi_configuration_load(SUIT_MANIFEST_APP_ROOT, mpi, sizeof(mpi)); + + /* THEN the second slot is not loaded */ + zassert_equal(err, SUIT_PLAT_ERR_EXISTS, + "It should not be possible to load root MPI twice"); +} + +ZTEST(suit_storage_nrf54h20_mpi_load_tests, test_too_many_roles) +{ + suit_manifest_role_t roles[] = { + SUIT_MANIFEST_SEC_TOP, + SUIT_MANIFEST_SEC_SDFW, + SUIT_MANIFEST_SEC_SYSCTRL, + SUIT_MANIFEST_APP_ROOT, + SUIT_MANIFEST_APP_RECOVERY, + SUIT_MANIFEST_APP_LOCAL_1, + SUIT_MANIFEST_APP_LOCAL_2, + SUIT_MANIFEST_APP_LOCAL_3, + SUIT_MANIFEST_RAD_RECOVERY, + SUIT_MANIFEST_RAD_LOCAL_1, + SUIT_MANIFEST_RAD_LOCAL_2, + }; + uint8_t mpi[] = { + 0x01, /* version */ + 0x01, /* downgrade prevention disabled */ + 0x02, /* Independent update allowed */ + 0x01, /* signature check disabled */ + /* reserved (12) */ + 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + /* RFC4122 uuid5(uuid.NAMESPACE_DNS, 'nordicsemi.com') */ + 0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, + 0x8f, 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4, + /* RFC4122 uuid5(nordic_vid, 'test_sample_root') */ + 0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, 0x0a, + }; + uint8_t mpi_array[sizeof(mpi) * ARRAY_SIZE(roles)]; + + for (size_t i = 0; i < ARRAY_SIZE(roles); i++) { + /* Fake CID so each entry is different */ + memcpy(&mpi_array[i * sizeof(mpi)], mpi, sizeof(mpi)); + mpi_array[i * sizeof(mpi) + sizeof(mpi) - 1] = roles[i]; + } + + /* Check that the test will not exceed the array with roles. */ + zassert_true(ARRAY_SIZE(roles) > CONFIG_SUIT_STORAGE_N_ENVELOPES, + "Unable to execute test: role list does not exceed MPI limits (%d >= %d)", + CONFIG_SUIT_STORAGE_N_ENVELOPES, ARRAY_SIZE(roles)); + + /* GIVEN all slots in MPI are used */ + for (size_t i = 0; i < CONFIG_SUIT_STORAGE_N_ENVELOPES; i++) { + suit_plat_err_t err = suit_storage_mpi_configuration_load( + roles[i], &mpi_array[i * sizeof(mpi)], sizeof(mpi)); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "Unable to load manifest with role %d at index %d prior test " + "execution (err: %d)", + roles[i], i, err); + } + + for (size_t i = CONFIG_SUIT_STORAGE_N_ENVELOPES; i < ARRAY_SIZE(roles); i++) { + /* WHEN application loads next manifest */ + suit_plat_err_t err = suit_storage_mpi_configuration_load( + roles[i], &mpi_array[i * sizeof(mpi)], sizeof(mpi)); + + /* THEN the it is not loaded */ + zassert_equal( + err, SUIT_PLAT_ERR_SIZE, + "It should not be possible to load more MPIs than configured (index: %d)", + i); + } +} diff --git a/tests/subsys/suit/storage_nrf54h20/src/test_nvv_load.c b/tests/subsys/suit/storage_nrf54h20/src/test_nvv_load.c new file mode 100644 index 000000000000..8ad72ebd20e9 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/src/test_nvv_load.c @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include "test_common.h" + +ZTEST_SUITE(suit_storage_nrf54h20_nvv_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_read) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + uint32_t constants[SUIT_STORAGE_NVV_N_VARS] = { + 0x00000000, 0xAAAAAAAA, 0x55AA55AA, 0x01000000, + 0x00000001, 0xFFFFFFFF, 0x98EFCDAB, 0xFFFFFFFF, + }; + for (size_t i = 0; i < SUIT_STORAGE_NVV_N_VARS; i++) { + uint32_t value; + + /* WHEN the NVV value is read */ + err = suit_storage_var_get(i, &value); + /* THEN the NVV read succeeds */ + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to read NVV at index: %d (%d).", i, + err); + /* ... and values in NVV area matches the preconfigured constants */ + zassert_equal(value, constants[i], "Invalid NVV value at index: %d (0x%X != 0x%X).", + i, value, constants[i]); + } +} + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_write) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + /* .. and NVV area is erased */ + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does not match */ + /* ... and NVV area is initialized with default values (0xFF) and digest */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_empty, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area is copied into NVV backup area */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_empty, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + /* ... and NVV is set with initial values */ + for (size_t i = 0; i < SUIT_STORAGE_NVV_N_VARS; i++) { + uint32_t value; + + err = suit_storage_var_get(i, &value); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to read NVV at index: %d (%d).", i, + err); + zassert_equal(value, 0xFFFFFFFF, + "Invalid initial NVV value at index: %d (0x%X != 0x%X).", i, value, + 0xFFFFFFFF); + } + + /* WHEN NVV variables are updated */ + uint32_t constants[SUIT_STORAGE_NVV_N_VARS] = { + 0x00000000, 0xAAAAAAAA, 0x55AA55AA, 0x01000000, + 0x00000001, 0xFFFFFFFF, 0x98EFCDAB, 0xFFFFFFFF, + }; + for (size_t i = 0; i < SUIT_STORAGE_NVV_N_VARS; i++) { + err = suit_storage_var_set(i, constants[i]); + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to write NVV at index: %d (%d).", i, + err); + } + + /* THEN value of NVV area matches the preconfigured constants */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and value of NVV area backup is updated */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); +} + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_ro_backup_read) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + /* ... and NVV backup is corrupted after initialization*/ + erase_area_app_nvv_backup(); + + uint32_t constants[SUIT_STORAGE_NVV_N_VARS] = { + 0x00000000, 0xAAAAAAAA, 0x55AA55AA, 0x01000000, + 0x00000001, 0xFFFFFFFF, 0x98EFCDAB, 0xFFFFFFFF, + }; + for (size_t i = 0; i < SUIT_STORAGE_NVV_N_VARS; i++) { + uint32_t value; + + /* WHEN the NVV value is read */ + err = suit_storage_var_get(i, &value); + /* THEN the NVV read succeeds */ + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to read NVV at index: %d (%d).", i, + err); + /* ... and values in NVV area matches the preconfigured constants */ + zassert_equal(value, constants[i], "Invalid NVV value at index: %d (0x%X != 0x%X).", + i, value, constants[i]); + } +} + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_ro_backup_write) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + /* ... and NVV backup is corrupted after initialization*/ + erase_area_app_nvv_backup(); + + /* WHEN NVV variable is updated */ + err = suit_storage_var_set(0, 0x00000000); + + /* THEN the NVV update succeeds */ + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to write NVV at index: 0 (%d).", err); + + /* ... and NVV area backup is recovered */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); +} + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_ro_read) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + /* ... and NVV area is corrupted after initialization*/ + erase_area_app_nvv(); + + uint32_t constants[SUIT_STORAGE_NVV_N_VARS] = { + 0x00000000, 0xAAAAAAAA, 0x55AA55AA, 0x01000000, + 0x00000001, 0xFFFFFFFF, 0x98EFCDAB, 0xFFFFFFFF, + }; + for (size_t i = 0; i < SUIT_STORAGE_NVV_N_VARS; i++) { + uint32_t value; + + /* WHEN the NVV value is read */ + err = suit_storage_var_get(i, &value); + /* THEN the NVV read succeeds */ + zassert_equal(err, SUIT_PLAT_SUCCESS, "Failed to read NVV at index: %d (%d).", i, + err); + /* ... and NVV backup area is used */ + /* ... and values in NVV area matches the preconfigured constants */ + zassert_equal(value, constants[i], "Invalid NVV value at index: %d (0x%X != 0x%X).", + i, value, constants[i]); + } +} + +ZTEST(suit_storage_nrf54h20_nvv_tests, test_app_nvv_ro_write) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* ... and storage module is initialized */ + int err = suit_storage_init(); + + /* ... and digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); + + /* ... and NVV area is corrupted after initialization*/ + erase_area_app_nvv(); + + /* WHEN NVV variable is updated */ + err = suit_storage_var_set(0, 0xABABABAB); + + /* THEN the NVV update fails */ + zassert_equal(err, SUIT_PLAT_ERR_IO, "NVV corrupted by writing to the read-only area"); + + /* ... and NVV backup is not updated */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); +} diff --git a/tests/subsys/suit/storage_nrf54h20/src/test_storage_init.c b/tests/subsys/suit/storage_nrf54h20/src/test_storage_init.c new file mode 100644 index 000000000000..12c747b82e2e --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/src/test_storage_init.c @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include "test_common.h" + +ZTEST_SUITE(suit_storage_nrf54h20_init_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_storage_nrf54h20_init_tests, test_empty_storage) +{ + /* GIVEN the whole SUIT storage area is erased (unprovisioned device) */ + erase_area_nordic(); + erase_area_rad(); + erase_area_app(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI and it's backup does not match... */ + int exp_err = SUIT_PLAT_ERR_AUTHENTICATION; + /* ... and an error code is returned */ + zassert_equal(err, exp_err, "Unexpected error code returned (%d).", err); + /* ... and NVV area digest does not match */ + /* ... and NVV area is initialized with default values (0xFF) and digest */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_empty, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area is copied into NVV backup area */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_empty, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_empty_app_rad_with_digest) +{ + /* GIVEN the device is provisioned with empty application and radio MPI */ + erase_area_nordic(); + erase_area_rad(); + erase_area_app(); + write_empty_area_app(); + write_empty_area_rad(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is copied into application backup area */ + assert_empty_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_empty_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and digest of the radio MPI matches... */ + /* ... and the radio MPI is copied into radio backup area */ + assert_empty_mpi_area_rad(SUIT_STORAGE_RAD_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_empty_mpi_area_rad(SUIT_STORAGE_NORDIC_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI entry fails */ + int exp_err = SUIT_PLAT_ERR_NOT_FOUND; + /* ... and an error code is returned */ + zassert_equal(err, exp_err, "Unexpected error code returned (%d).", err); + /* ... and NVV area digest does not match */ + /* ... and NVV area is initialized with default values (0xFF) and digest */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_empty, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area is copied into NVV backup area */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_empty, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_with_root_rad) +{ + /* GIVEN the device is provisioned with application MPI with root config and sample radio + * MPI entry + */ + erase_area_nordic(); + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + write_area_rad(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is copied into application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and digest of the radio MPI matches... */ + /* ... and the radio MPI is copied into radio backup area */ + assert_valid_mpi_area_rad(SUIT_STORAGE_RAD_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_rad(SUIT_STORAGE_NORDIC_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does not match */ + /* ... and NVV area is initialized with default values (0xFF) and digest */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_empty, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area is copied into NVV backup area */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_empty, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root and radio classes are supported */ + assert_sample_root_rad_class(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_with_root_rad_backup) +{ + /* GIVEN the device was provisioned with application and radio MPI with root and sample + * radio config + */ + erase_area_nordic(); + write_area_nordic_root(); + write_area_nordic_rad(); + /* .. and the application and radio area was erased after the backup was created */ + erase_area_rad(); + erase_area_app(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI does not match... */ + /* ... and the application MPI is copied from backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and digest of the radio MPI does not match... */ + /* ... and the radio MPI is copied from backup area */ + assert_valid_mpi_area_rad(SUIT_STORAGE_RAD_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_rad(SUIT_STORAGE_NORDIC_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does not match */ + /* ... and NVV area is initialized with default values (0xFF) and digest */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_empty, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area is copied into NVV backup area */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_empty, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root and radio classes are supported */ + assert_sample_root_rad_class(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_with_old_root_rad_backup) +{ + /* GIVEN the device was provisioned with application MPI with old root and sample radio + * config + */ + erase_area_nordic(); + write_area_nordic_old_root(); + write_area_nordic_old_rad(); + /* .. and the device is provisioned with new application MPI with root config without radio + * config + */ + erase_area_rad(); + erase_area_app(); + write_area_app_empty_nvv_backup(); + write_area_app_nvv(); + write_area_app_root(); + write_area_rad(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is copied into application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and digest of the radio MPI matches... */ + /* ... and the radio MPI is copied into radio backup area */ + assert_valid_mpi_area_rad(SUIT_STORAGE_RAD_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_rad(SUIT_STORAGE_NORDIC_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is updated */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root and radio classes are supported */ + assert_sample_root_rad_class(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_app_with_old_root_new_rad_nvv_backup) +{ + /* GIVEN the device was provisioned with application MPI with old root and sample radio + * config + */ + erase_area_nordic(); + write_area_nordic_old_root(); + write_area_nordic_rad(); + /* .. and the device is provisioned with new application MPI with root config without radio + * config + */ + erase_area_rad(); + erase_area_app(); + write_area_app_empty_nvv_backup(); + write_area_app_nvv(); + write_area_app_root(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is copied into application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and digest of the radio MPI does not match... */ + /* ... and the radio MPI is copied from backup area */ + assert_valid_mpi_area_rad(SUIT_STORAGE_RAD_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_rad(SUIT_STORAGE_NORDIC_ADDRESS, + SUIT_STORAGE_RAD_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is updated */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root and radio classes are supported */ + assert_sample_root_rad_class(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_app_corrupted_nvv) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + /* .. and NVV area is erased */ + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV backup is present */ + write_area_app_nvv_backup(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest does not match */ + /* ... and NVV area is recovered from backup */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); +} + +ZTEST(suit_storage_nrf54h20_init_tests, test_app_corrupted_nvv_backup) +{ + /* GIVEN the device is provisioned with application MPI with root config */ + erase_area_nordic(); + write_area_nordic_root(); + /* .. and NVV backup is erased */ + erase_area_rad(); + erase_area_app(); + write_area_app_root(); + /* .. and NVV is present */ + write_area_app_nvv(); + + /* WHEN storage module is initialized */ + int err = suit_storage_init(); + + /* THEN digest of the application MPI matches... */ + /* ... and the application MPI is the same as application backup area */ + assert_valid_mpi_area_app(SUIT_STORAGE_APP_ADDRESS, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + assert_valid_mpi_area_app(SUIT_STORAGE_NORDIC_ADDRESS + SUIT_STORAGE_RAD_MPI_SIZE + + SUIT_STORAGE_DIGEST_SIZE, + SUIT_STORAGE_APP_MPI_SIZE + SUIT_STORAGE_DIGEST_SIZE); + /* ... and parsing of the root MPI succeeds */ + int exp_err = SUIT_PLAT_SUCCESS; + /* ... and NVV area digest matches */ + /* ... and NVV area is not modified */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS, nvv_sample, SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and NVV area backup is updated */ + zassert_mem_equal(SUIT_STORAGE_APP_NVV_ADDRESS + SUIT_STORAGE_APP_NVV_SIZE / 2, nvv_sample, + SUIT_STORAGE_APP_NVV_SIZE / 2); + /* ... and initialization succeeds */ + zassert_equal(err, exp_err, "Failed to initialize SUIT storage (%d).", err); + /* ... and Nordic class IDs are supported */ + assert_nordic_classes(); + /* ... and sample root class is supported */ + assert_sample_root_class(); +} diff --git a/tests/subsys/suit/storage_nrf54h20/testcase.yaml b/tests/subsys/suit/storage_nrf54h20/testcase.yaml new file mode 100644 index 000000000000..3bb0e1895c73 --- /dev/null +++ b/tests/subsys/suit/storage_nrf54h20/testcase.yaml @@ -0,0 +1,6 @@ +tests: + suit-processor.integration.suit_storage_nrf54h20: + platform_allow: native_posix + tags: suit-processor suit_storage + integration_platforms: + - native_posix diff --git a/tests/subsys/suit/suit_memptr_storage/CMakeLists.txt b/tests/subsys/suit/suit_memptr_storage/CMakeLists.txt new file mode 100644 index 000000000000..bdd30bf44122 --- /dev/null +++ b/tests/subsys/suit/suit_memptr_storage/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (c) 2023 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(integration_test_suit_memptr_storage) +include(../cmake/test_template.cmake) + +# Link with the CMake target, that includes SUIT platform internal APIs header +zephyr_library_link_libraries(suit_memptr_storage_interface) diff --git a/tests/subsys/suit/suit_memptr_storage/prj.conf b/tests/subsys/suit/suit_memptr_storage/prj.conf new file mode 100644 index 000000000000..10ed01c0dbfe --- /dev/null +++ b/tests/subsys/suit/suit_memptr_storage/prj.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_MEMPTR_STORAGE=y diff --git a/tests/subsys/suit/suit_memptr_storage/src/main.c b/tests/subsys/suit/suit_memptr_storage/src/main.c new file mode 100644 index 000000000000..bda2e257796c --- /dev/null +++ b/tests/subsys/suit/suit_memptr_storage/src/main.c @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define TEST_DATA_SIZE 64 + +static uint8_t test_data[TEST_DATA_SIZE] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; + +ZTEST_SUITE(suit_memptr_storage_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_memptr_storage_tests, test_suit_memptr_storage_get_OK) +{ + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "get_new_memptr_record failed - error %i", err); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); +} + +ZTEST(suit_memptr_storage_tests, test_suit_memptr_storage_get_NOK) +{ + memptr_storage_handle_t handles[CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS + 1]; + int err = SUIT_PLAT_SUCCESS; + + for (size_t i = 0; i < CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS; i++) { + err = suit_memptr_storage_get(&handles[i]); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", + err); + } + + err = suit_memptr_storage_get(NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_get should have failed - handle == NULL"); + + err = suit_memptr_storage_get(&handles[CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS]); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_get %u should have failed - max number or memptr " + "records reached", + CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS); + + for (size_t i = 0; i < CONFIG_SUIT_MAX_NUMBER_OF_INTEGRATED_PAYLOADS; i++) { + err = suit_memptr_storage_release(handles[i]); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "memptr_storage[%u].release failed - error %i", i, err); + } +} + +ZTEST(suit_memptr_storage_tests, test_memptr_storage_release_NOK) +{ + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_storage_release(NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_release should have failed - ctx == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); +} + +ZTEST(suit_memptr_storage_tests, test_memptr_storage_save_OK) +{ + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_storage_ptr_store(handle, test_data, TEST_DATA_SIZE); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "memptr_suit_memptr_storage_ptr_store failed - error %i", err); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); +} + +ZTEST(suit_memptr_storage_tests, test_memptr_storage_save_NOK) +{ + memptr_storage_handle_t handle = NULL; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_storage_ptr_store(NULL, test_data, TEST_DATA_SIZE); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "memptr_suit_memptr_storage_ptr_store should have failed - ctx == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); + + err = suit_memptr_storage_ptr_store(handle, test_data, TEST_DATA_SIZE); + zassert_not_equal( + err, SUIT_PLAT_SUCCESS, + "memptr_suit_memptr_storage_ptr_store should have failed - unallocated record"); +} + +ZTEST(suit_memptr_storage_tests, test_memptr_storage_get_OK) +{ + memptr_storage_handle_t handle = NULL; + const uint8_t *payload_ptr; + size_t payload_size; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_storage_ptr_store(handle, test_data, TEST_DATA_SIZE); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "memptr_suit_memptr_storage_ptr_store failed - error %i", err); + + err = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_ptr_get failed - error %i", err); + zassert_equal(payload_ptr, test_data, + "suit_memptr_storage_ptr_get, payload_ptr and data address mismatch"); + zassert_equal(payload_size, TEST_DATA_SIZE, + "suit_memptr_storage_ptr_get, payload_size and data size mismatch"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); +} + +ZTEST(suit_memptr_storage_tests, test_memptr_storage_get_NOK) +{ + memptr_storage_handle_t handle = NULL; + const uint8_t *payload_ptr; + size_t payload_size; + + int err = suit_memptr_storage_get(&handle); + + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_get failed - error %i", err); + + err = suit_memptr_storage_ptr_store(handle, test_data, TEST_DATA_SIZE); + zassert_equal(err, SUIT_PLAT_SUCCESS, + "memptr_suit_memptr_storage_ptr_store failed - error %i", err); + + err = suit_memptr_storage_ptr_get(NULL, &payload_ptr, &payload_size); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_ptr_get should have failed - ctx == NULL"); + + err = suit_memptr_storage_ptr_get(handle, NULL, &payload_size); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_ptr_get should have failed - *payload_ptr == NULL"); + + err = suit_memptr_storage_ptr_get(handle, &payload_ptr, NULL); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_ptr_get should have failed - payload_size == NULL"); + + err = suit_memptr_storage_release(handle); + zassert_equal(err, SUIT_PLAT_SUCCESS, "suit_memptr_storage_release failed - error %i", err); + + err = suit_memptr_storage_ptr_get(handle, &payload_ptr, &payload_size); + zassert_not_equal(err, SUIT_PLAT_SUCCESS, + "suit_memptr_storage_ptr_get should have failed - unallocated record"); +} diff --git a/tests/subsys/suit/suit_memptr_storage/testcase.yaml b/tests/subsys/suit/suit_memptr_storage/testcase.yaml new file mode 100644 index 000000000000..55d52fd0fb11 --- /dev/null +++ b/tests/subsys/suit/suit_memptr_storage/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit-platform.integration.common.memptr_storage: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform suit_memptr_storage + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix diff --git a/tests/subsys/suit/unit/app_specific/cmake/test_template.cmake b/tests/subsys/suit/unit/app_specific/cmake/test_template.cmake new file mode 100644 index 000000000000..ab2c31597d59 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/cmake/test_template.cmake @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Override board, since all tests must use unit test board +set(BOARD unit_testing) + +# Find the path to the Zephyr directory +find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +# Define common paths +set(SUIT_SUBSYS_DIR ${ZEPHYR_NRF_MODULE_DIR}/subsys/suit) + +# Link manifest library, required by suit_types.h, suit_processor.h and suit_seq_exec.h +target_link_libraries(testbinary PRIVATE manifest) + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../mocks" "${PROJECT_BINARY_DIR}/test_mocks") diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/CMakeLists.txt b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/CMakeLists.txt new file mode 100644 index 000000000000..2da5e453bf3b --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/CMakeLists.txt @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(plat_fetch_app) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/app/src/suit_plat_fetch_app_specific.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/Kconfig b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/Kconfig new file mode 100644 index 000000000000..236ad3171445 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/prj.conf b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/prj.conf new file mode 100644 index 000000000000..5af6a106addb --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y +CONFIG_MOCK_DFU_CACHE_STREAMER=y +CONFIG_MOCK_DFU_CACHE_SINK=y +CONFIG_MOCK_FETCH_SOURCE_STREAMER=y diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/src/main.c b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/src/main.c new file mode 100644 index 000000000000..a7d2d75cf742 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/src/main.c @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +#define TEST_COMPONENT_HANDLE ((suit_component_t)0x123) + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +ZTEST_SUITE(suit_platform_app_fetch_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_platform_app_fetch_tests, test_fetch_type_supported) +{ + zassert_true( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_CAND_IMG), + "suit_plat_fetch_domain_specific_is_type_supported returned false for supported " + "type"); + zassert_true( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_CAND_MFST), + "suit_plat_fetch_domain_specific_is_type_supported returned false for supported " + "type"); + zassert_true( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_CACHE_POOL), + "suit_plat_fetch_domain_specific_is_type_supported returned false for supported " + "type"); + + zassert_false( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_UNSUPPORTED), + "suit_plat_fetch_domain_specific_is_type_supported returned true for unsupported " + "type"); + zassert_false(suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_MEM), + "suit_plat_fetch_domain_specific_is_type_supported returned true for " + "unsupported type"); + zassert_false( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_INSTLD_MFST), + "suit_plat_fetch_domain_specific_is_type_supported returned true for unsupported " + "type"); + zassert_false( + suit_plat_fetch_domain_specific_is_type_supported(SUIT_COMPONENT_TYPE_SOC_SPEC), + "suit_plat_fetch_domain_specific_is_type_supported returned true for unsupported " + "type"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_integrated_type_supported) +{ + zassert_true(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_CAND_IMG), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned false " + "for supported type"); + zassert_true(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_CAND_MFST), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned false " + "for supported type"); + + zassert_false(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_CACHE_POOL), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned true " + "for unsupported type"); + zassert_false(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_UNSUPPORTED), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned true " + "for unsupported type"); + zassert_false(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_MEM), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned true " + "for unsupported type"); + zassert_false(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_INSTLD_MFST), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned true " + "for unsupported type"); + zassert_false(suit_plat_fetch_integrated_domain_specific_is_type_supported( + SUIT_COMPONENT_TYPE_SOC_SPEC), + "suit_plat_fetch_integrated_domain_specific_is_type_supported returned true " + "for unsupported type"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_unsupported_component_type) +{ + struct stream_sink dummy_sink = {0}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, + SUIT_COMPONENT_TYPE_UNSUPPORTED, &dummy_sink, + &dummy_uri), + SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Unsupported component type returned incorrect error code"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_dfu_cache_streamer_fail) +{ + struct stream_sink dummy_sink = {0}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + suit_dfu_cache_streamer_stream_fake.return_val = SUIT_PLAT_ERR_IO; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, + SUIT_COMPONENT_TYPE_CAND_IMG, &dummy_sink, + &dummy_uri), + SUIT_ERR_CRASH, "Failed to return correct error code"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.call_count, 1, + "Incorrect number of suit_dfu_cache_streamer_stream() calls"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg0_val, dummy_uri.value, + "Incorrect value streamer argument"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg1_val, dummy_uri.len, + "Incorrect value of streamer argument"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg2_val, &dummy_sink, + "Incorrect value of streamer argument"); + + zassert_equal(suit_dfu_cache_sink_commit_fake.call_count, 0, + "Incorrect number of suit_dfu_cache_sink_commit() calls"); + zassert_equal(suit_fetch_source_stream_fake.call_count, 0, + "Incorrect number of suit_fetch_source_stream() calls"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_dfu_cache_streamer_success) +{ + struct stream_sink dummy_sink = {0}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + suit_component_type_t types[] = {SUIT_COMPONENT_TYPE_CAND_IMG, + SUIT_COMPONENT_TYPE_CAND_MFST}; + + for (size_t i = 0; i < ARRAY_SIZE(types); i++) { + mocks_reset(); + FFF_RESET_HISTORY(); + + suit_dfu_cache_streamer_stream_fake.return_val = SUIT_PLAT_SUCCESS; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, types[i], + &dummy_sink, &dummy_uri), + SUIT_SUCCESS, "suit_plat_fetch_domain_specific() failed"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.call_count, 1, + "Incorrect number of suit_dfu_cache_streamer_stream() calls"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg0_val, dummy_uri.value, + "Incorrect value streamer argument"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg1_val, dummy_uri.len, + "Incorrect value of streamer argument"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.arg2_val, &dummy_sink, + "Incorrect value of streamer argument"); + + zassert_equal(suit_dfu_cache_sink_commit_fake.call_count, 0, + "Incorrect number of suit_dfu_cache_sink_commit() calls"); + zassert_equal(suit_fetch_source_stream_fake.call_count, 0, + "Incorrect number of suit_fetch_source_stream() calls"); + } +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_fetch_source_streamer_fail) +{ + struct stream_sink dummy_sink = {0}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + suit_fetch_source_stream_fake.return_val = SUIT_PLAT_ERR_IO; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, + SUIT_COMPONENT_TYPE_CACHE_POOL, &dummy_sink, + &dummy_uri), + SUIT_ERR_CRASH, "Failed to return correct error code"); + zassert_equal(suit_fetch_source_stream_fake.call_count, 1, + "Incorrect number of suit_fetch_source_stream() calls"); + zassert_equal(suit_fetch_source_stream_fake.arg0_val, dummy_uri.value, + "Incorrect value streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg1_val, dummy_uri.len, + "Incorrect value of streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg2_val, &dummy_sink, + "Incorrect value of streamer argument"); + + zassert_equal(suit_dfu_cache_sink_commit_fake.call_count, 0, + "Incorrect number of suit_dfu_cache_sink_commit() calls"); + zassert_equal(suit_dfu_cache_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_fetch_source_stream() calls"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_cache_pool_type) +{ + uint8_t dummy_ctx = 0; + struct stream_sink dummy_sink = {.ctx = &dummy_ctx}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + suit_fetch_source_stream_fake.return_val = SUIT_PLAT_SUCCESS; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, + SUIT_COMPONENT_TYPE_CACHE_POOL, &dummy_sink, + &dummy_uri), + SUIT_SUCCESS, "Failed to return correct error code"); + zassert_equal(suit_fetch_source_stream_fake.call_count, 1, + "Incorrect number of suit_fetch_source_stream() calls"); + zassert_equal(suit_fetch_source_stream_fake.arg0_val, dummy_uri.value, + "Incorrect value streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg1_val, dummy_uri.len, + "Incorrect value of streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg2_val, &dummy_sink, + "Incorrect value of streamer argument"); + + zassert_equal(suit_dfu_cache_sink_commit_fake.call_count, 1, + "Incorrect number of suit_dfu_cache_sink_commit() calls"); + zassert_equal(suit_dfu_cache_sink_commit_fake.arg0_val, &dummy_ctx, + "Incorrect value suit_dfu_cache_sink_commit argument"); + + zassert_equal(suit_dfu_cache_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_fetch_source_stream() calls"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_mem_type) +{ + uint8_t dummy_ctx = 0; + struct stream_sink dummy_sink = {.ctx = &dummy_ctx}; + struct zcbor_string dummy_uri = {.value = (const uint8_t *)"test", .len = 4}; + + suit_fetch_source_stream_fake.return_val = SUIT_PLAT_SUCCESS; + + zassert_equal(suit_plat_fetch_domain_specific(TEST_COMPONENT_HANDLE, + SUIT_COMPONENT_TYPE_MEM, &dummy_sink, + &dummy_uri), + SUIT_SUCCESS, "Failed to return correct error code"); + zassert_equal(suit_fetch_source_stream_fake.call_count, 1, + "Incorrect number of suit_fetch_source_stream() calls"); + zassert_equal(suit_fetch_source_stream_fake.arg0_val, dummy_uri.value, + "Incorrect value streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg1_val, dummy_uri.len, + "Incorrect value of streamer argument"); + zassert_equal(suit_fetch_source_stream_fake.arg2_val, &dummy_sink, + "Incorrect value of streamer argument"); + + zassert_equal(suit_dfu_cache_sink_commit_fake.call_count, 0, + "Incorrect number of suit_dfu_cache_sink_commit() calls"); + + zassert_equal(suit_dfu_cache_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_fetch_source_stream() calls"); +} + +ZTEST(suit_platform_app_fetch_tests, test_fetch_integrated_domain_specific) +{ + struct stream_sink dummy_sink = {0}; + + /* Simply return success unconditionally */ + zassert_equal(suit_plat_fetch_integrated_domain_specific( + TEST_COMPONENT_HANDLE, SUIT_COMPONENT_TYPE_CACHE_POOL, &dummy_sink), + SUIT_SUCCESS, "suit_plat_fetch_integrated_domain_specific failed"); +} diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/testcase.yaml b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/testcase.yaml new file mode 100644 index 000000000000..5a4086c82686 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_fetch_app/testcase.yaml @@ -0,0 +1,11 @@ +tests: + suit.unit.platform_app.fetch: + type: unit + tags: >- + suit + suit_platform + suit_platform_app_specific + suit_plat_fetch_domain_specific_is_type_supported + suit_plat_fetch_integrated_domain_specific_is_type_supported + suit_plat_fetch_domain_specific + suit_plat_fetch_integrated_domain_specific diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/CMakeLists.txt b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/CMakeLists.txt new file mode 100644 index 000000000000..6e207bd728f3 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(plat_retrieve_manifest_app) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/app/src/suit_plat_retrieve_manifest_app_specific.c +) diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/Kconfig b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/Kconfig new file mode 100644 index 000000000000..236ad3171445 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/prj.conf b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/prj.conf new file mode 100644 index 000000000000..201c8d02e03f --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/prj.conf @@ -0,0 +1,8 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/src/main.c b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/src/main.c new file mode 100644 index 000000000000..225b338f1661 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/src/main.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +ZTEST_SUITE(suit_platform_retrieve_manifest_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(suit_platform_retrieve_manifest_tests, test_retrieve_manifest_app_specific) +{ + struct zcbor_string dummy_component_id = {0}; + uint8_t *envelope = NULL; + size_t envelope_len = 0; + + /* Simply return SUIT_ERR_UNSUPPORTED_COMPONENT_ID unconditionally */ + zassert_equal(suit_plat_retrieve_manifest_domain_specific(&dummy_component_id, + SUIT_COMPONENT_TYPE_INSTLD_MFST, + envelope, envelope_len), + SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "suit_plat_retrieve_manifest_domain_specific returned incorrect error code"); +} diff --git a/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/testcase.yaml b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/testcase.yaml new file mode 100644 index 000000000000..04767747a187 --- /dev/null +++ b/tests/subsys/suit/unit/app_specific/suit_plat_retrieve_manifest_app/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.unit.platform_app.retreve_manifest: + type: unit + tags: >- + suit + suit_platform + suit_plat_app + suit_plat_retrieve_manifest_domain_specific diff --git a/tests/subsys/suit/unit/cmake/test_template.cmake b/tests/subsys/suit/unit/cmake/test_template.cmake new file mode 100644 index 000000000000..1b903393c699 --- /dev/null +++ b/tests/subsys/suit/unit/cmake/test_template.cmake @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Override board, since all tests must use unit test board +set(BOARD unit_testing) + +# Find the path to the Zephyr directory +find_package(Zephyr COMPONENTS unittest REQUIRED HINTS $ENV{ZEPHYR_BASE}) + +# Define common paths +set(SUIT_SUBSYS_DIR ${ZEPHYR_NRF_MODULE_DIR}/subsys/suit) + +# Link manifest library, required by suit_types.h, suit_processor.h and suit_seq_exec.h +target_link_libraries(testbinary PRIVATE manifest) + +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../mocks" "${PROJECT_BINARY_DIR}/test_mocks") diff --git a/tests/subsys/suit/unit/mocks/CMakeLists.txt b/tests/subsys/suit/unit/mocks/CMakeLists.txt new file mode 100644 index 000000000000..569e03cb1108 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/CMakeLists.txt @@ -0,0 +1,123 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +target_include_directories(testbinary PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/include +) + +if (CONFIG_MOCK_SUIT_PROCESSOR) + # Include suit-processor directory, so manifest and cose libraries get generated. + add_subdirectory(${ZEPHYR_SUIT_PROCESSOR_MODULE_DIR} suit_processor) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PROCESSOR) + target_include_directories(testbinary PRIVATE + ${ZEPHYR_SUIT_PROCESSOR_MODULE_DIR}/include + ) +endif() + +target_include_directories(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/plat_err/include +) + +if (CONFIG_MOCK_SUIT_MCI) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_MCI) + target_include_directories(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/mci/include + ) + + if (NOT CONFIG_MOCK_SUIT_MCI_UTILS) + target_sources(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/mci/src/utils.c + ) + endif() +endif() + +if (CONFIG_MOCK_SUIT_METADATA) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_METADATA) + target_include_directories(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/metadata/include + ) +endif() + +if (CONFIG_MOCK_SUIT_STORAGE) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STORAGE) + target_include_directories(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/storage/include + ) +endif() + +if (CONFIG_MOCK_SUIT_UTILS) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_UTILS) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/utils/include) + target_include_directories(testbinary PRIVATE ${ZEPHYR_ZCBOR_MODULE_DIR}/include) + + if (NOT CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL) + target_sources(testbinary PRIVATE + ${SUIT_SUBSYS_DIR}/utils/src/suit_plat_decode_util.c) + endif() +endif() + +if (CONFIG_MOCK_SUIT_LOG) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_LOG_LEVEL) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_LOG_LEVEL_DBG) + target_compile_options(test_interface INTERFACE -include ztest.h) + target_sources(testbinary PRIVATE $ENV{ZEPHYR_BASE}/subsys/logging/log_minimal.c) +endif() + +if (CONFIG_MOCK_SUIT_CRYPTO) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_CRYPTO) + target_include_directories(testbinary PRIVATE ${ZEPHYR_MBEDTLS_MODULE_DIR}/include) +endif() + +if (CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLAT_CHECK_COMPONENT_ID) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) +endif() + +if (CONFIG_MOCK_SUIT_MEMPTR_STORAGE) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_MEMPTR_STORAGE) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/memptr_storage/include) +endif() + +if (CONFIG_MOCK_SUIT_PLATFORM_INTERNAL) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLATFORM) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) +endif() + +if (CONFIG_MOCK_SUIT_PLATFORM) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLATFORM) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) +endif() + +if (CONFIG_MOCK_DIGEST_SINK) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STREAM) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/stream/stream_sinks/include) +endif() + +if (CONFIG_MOCK_GENERIC_ADDRESS_STREAMER) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STREAM) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/stream/stream_sources/include) +endif() + +if (CONFIG_MOCK_DFU_CACHE_STREAMER) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STREAM -DCONFIG_SUIT_CACHE_RW) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/stream/stream_sources/include) +endif() + +if (CONFIG_MOCK_DFU_CACHE_SINK) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STREAM) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/stream/stream_sinks/include) +endif() + +if (CONFIG_MOCK_FETCH_SOURCE_STREAMER) + target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_STREAM -DCONFIG_SUIT_STREAM_FETCH_SOURCE_MGR) + target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/stream/stream_sources/include) +endif() + +if (CONFIG_MOCK_SDFW_BUILTIN_KEYS) + target_compile_options(test_interface INTERFACE -DCONFIG_SDFW_BUILTIN_KEYS) + target_include_directories(testbinary PRIVATE ${ZEPHYR_MBEDTLS_MODULE_DIR}/include) + target_include_directories(testbinary PRIVATE ${ZEPHYR_SECDOM_MODULE_DIR}/include) +endif() diff --git a/tests/subsys/suit/unit/mocks/Kconfig b/tests/subsys/suit/unit/mocks/Kconfig new file mode 100644 index 000000000000..8c368dbf164d --- /dev/null +++ b/tests/subsys/suit/unit/mocks/Kconfig @@ -0,0 +1,86 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +menuconfig MOCK_SUIT_MCI + bool "Include SUIT MCI mocks" + +if MOCK_SUIT_MCI +config MOCK_SUIT_MCI_GENERIC_IDS + bool "Mock suit_generic_ids.c implementation" + default y + help + If not enabled, the module implementation will be included. + +config MOCK_SUIT_MCI_UTILS + bool "Mock utils.c implementation" + default y + help + If not enabled, the module implementation will be included. +endif # MOCK_SUIT_MCI + +config MOCK_SUIT_STORAGE + bool "Include SUIT storage mocks" + +menuconfig MOCK_SUIT_UTILS + bool "Include SUIT utils mocks" + +if MOCK_SUIT_UTILS +config MOCK_SUIT_PLAT_DECODE_UTIL + bool "Mock suit_plat_decode_util.c implementation" + default y + help + If not enabled, the module implementation will be included. + +endif # MOCK_SUIT_UTILS + +config MOCK_SUIT_METADATA + bool "Include SUIT manifest metadata types and conversion mocks" + +config MOCK_SUIT_PROCESSOR + bool "Include SUIT processor mocks" + +config MOCK_SUIT_LOG + bool "Include minimal logging support in SUIT components" + default y if LOG + +config MOCK_SUIT_CRYPTO + bool "Mock PSA crypto API" + +config MOCK_SUIT_KERNEL + bool "Mock zephyr kernel API" + +config MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + bool "Mock suit_plat_component_compatibility_check" + +config MOCK_SUIT_MEMPTR_STORAGE + bool "Include memory pointer storage headers" + +config MOCK_SUIT_PLATFORM_INTERNAL + bool "Mock suit_platform_internal" + +config MOCK_SUIT_PLATFORM + bool "Mock suit_plat_retrieve_manifest" + +config MOCK_DIGEST_SINK + bool "Mock stream sinks" + +config MOCK_GENERIC_ADDRESS_STREAMER + bool "Mock stream sources" + +config MOCK_DFU_CACHE_STREAMER + bool "Mock dfu cache streamer" + +config MOCK_FETCH_SOURCE_STREAMER + bool "Mock fetch source streamer" + +config MOCK_DFU_CACHE_SINK + bool "Mock dfu cache sink" + +config MOCK_SDFW_BUILTIN_KEYS + bool "Mock SDFW builtin keys handling" + +config MOCK_SUIT_MEMORY_LAYOUT + bool "Mock SUIT memory layout module" diff --git a/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_sink.h b/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_sink.h new file mode 100644 index 000000000000..b20bece12a8e --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_sink.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_DFU_CACHE_SINK_H__ +#define MOCK_DFU_CACHE_SINK_H__ + + +#include +#include + +#include + +FAKE_VALUE_FUNC(suit_plat_err_t, suit_dfu_cache_sink_get, struct stream_sink*, uint8_t, + const uint8_t*, size_t, bool); +FAKE_VALUE_FUNC(suit_plat_err_t, suit_dfu_cache_sink_commit, void*); + +static inline void mock_dfu_cache_sink_reset(void) +{ + RESET_FAKE(suit_dfu_cache_sink_get); + RESET_FAKE(suit_dfu_cache_sink_commit); +} + +#endif /* MOCK_DFU_CACHE_SINK_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_streamer.h b/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_streamer.h new file mode 100644 index 000000000000..8cf60b8bfd9b --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_dfu_cache_streamer.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_DFU_CACHE_STREAMER_H__ +#define MOCK_DFU_CACHE_STREAMER_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(suit_plat_err_t, suit_dfu_cache_streamer_stream, const uint8_t *, size_t, + struct stream_sink *); + +static inline void mock_dfu_cache_streamer_reset(void) +{ + RESET_FAKE(suit_dfu_cache_streamer_stream); +} + +#endif /* MOCK_DFU_CACHE_STREAMER_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_digest_sink.h b/tests/subsys/suit/unit/mocks/include/mock_digest_sink.h new file mode 100644 index 000000000000..11b2f075e1f0 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_digest_sink.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_DIGEST_SINK_H__ +#define MOCK_DIGEST_SINK_H__ + +#include +#include + +#include +#include + +FAKE_VALUE_FUNC(suit_plat_err_t, suit_digest_sink_get, struct stream_sink *, psa_algorithm_t, + const uint8_t *); +FAKE_VALUE_FUNC(digest_sink_err_t, suit_digest_sink_digest_match, void *); + +static inline void mock_digest_sink_reset(void) +{ + RESET_FAKE(suit_digest_sink_get); + RESET_FAKE(suit_digest_sink_digest_match); +} +#endif /* MOCK_DIGEST_SINK_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_fetch_source_streamer.h b/tests/subsys/suit/unit/mocks/include/mock_fetch_source_streamer.h new file mode 100644 index 000000000000..9d89516e8ce0 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_fetch_source_streamer.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_FETCH_SOURCE_STREAMER_H__ +#define MOCK_FETCH_SOURCE_STREAMER_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(suit_plat_err_t, suit_fetch_source_stream, const uint8_t *, size_t, + struct stream_sink *); + +static inline void mock_fetch_source_streamer_reset(void) +{ + RESET_FAKE(suit_fetch_source_stream); +} + +#endif /* MOCK_FETCH_SOURCE_STREAMER_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_generic_address_streamer.h b/tests/subsys/suit/unit/mocks/include/mock_generic_address_streamer.h new file mode 100644 index 000000000000..51241654ba11 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_generic_address_streamer.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_GENERIC_ADDRESS_STREAMER_H__ +#define MOCK_GENERIC_ADDRESS_STREAMER_H__ + +#include +#include + +#include +#include + +FAKE_VALUE_FUNC(suit_plat_err_t, suit_generic_address_streamer_stream, const uint8_t *, size_t, + struct stream_sink *); + +static inline void mock_generic_address_streamer_reset(void) +{ + RESET_FAKE(suit_generic_address_streamer_stream); +} +#endif /* MOCK_GENERIC_ADDRESS_STREAMER_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_globals.h b/tests/subsys/suit/unit/mocks/include/mock_globals.h new file mode 100644 index 000000000000..fab0c058ae18 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_globals.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_GLOBALS_H__ +#define MOCK_GLOBALS_H__ + +#include + +DEFINE_FFF_GLOBALS; + +#endif /* MOCK_GLOBALS_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_sdfw_builtin_keys.h b/tests/subsys/suit/unit/mocks/include/mock_sdfw_builtin_keys.h new file mode 100644 index 000000000000..c41384f66137 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_sdfw_builtin_keys.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SDFW_BUILTIN_KEYS_H__ +#define MOCK_SDFW_BUILTIN_KEYS_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(bool, sdfw_builtin_keys_is_builtin, mbedtls_svc_key_id_t); +FAKE_VALUE_FUNC(int, sdfw_builtin_keys_verify_message, mbedtls_svc_key_id_t, psa_algorithm_t, + const uint8_t *, size_t, const uint8_t *, size_t); + +static inline void mock_sdfw_builtin_keys_reset(void) +{ + RESET_FAKE(sdfw_builtin_keys_is_builtin); + sdfw_builtin_keys_is_builtin_fake.return_val = false; + RESET_FAKE(sdfw_builtin_keys_verify_message); +} +#endif /* MOCK_SDFW_BUILTIN_KEYS_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit.h b/tests/subsys/suit/unit/mocks/include/mock_suit.h new file mode 100644 index 000000000000..22ed4eb294dc --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_H__ +#define MOCK_SUIT_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(int, suit_processor_init); +FAKE_VALUE_FUNC(int, suit_process_sequence, const uint8_t *, size_t, enum suit_command_sequence); +FAKE_VALUE_FUNC(int, suit_processor_get_manifest_metadata, const uint8_t *, size_t, bool, + struct zcbor_string *, struct zcbor_string *, enum suit_cose_alg *, unsigned int *); + +static inline void mock_suit_processor_reset(void) +{ + RESET_FAKE(suit_processor_init); + RESET_FAKE(suit_process_sequence); + RESET_FAKE(suit_processor_get_manifest_metadata); +} + +#endif /* MOCK_SUIT_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_crypto.h b/tests/subsys/suit/unit/mocks/include/mock_suit_crypto.h new file mode 100644 index 000000000000..cbefde63f794 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_crypto.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_CRYPTO_H__ +#define MOCK_SUIT_CRYPTO_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(psa_status_t, psa_hash_setup, psa_hash_operation_t *, psa_algorithm_t); +FAKE_VALUE_FUNC(psa_status_t, psa_hash_update, psa_hash_operation_t *, const uint8_t *, size_t); +FAKE_VALUE_FUNC(psa_status_t, psa_hash_abort, psa_hash_operation_t *); +FAKE_VALUE_FUNC(psa_status_t, psa_hash_verify, psa_hash_operation_t *, const uint8_t *, size_t); +FAKE_VALUE_FUNC(psa_status_t, psa_verify_message, mbedtls_svc_key_id_t, psa_algorithm_t, + const uint8_t *, size_t, const uint8_t *, size_t); + +static inline void mock_suit_crypto_reset(void) +{ + RESET_FAKE(psa_hash_setup); + RESET_FAKE(psa_hash_update); + RESET_FAKE(psa_hash_abort); + RESET_FAKE(psa_hash_verify); + RESET_FAKE(psa_verify_message); +} + +#endif /* MOCK_SUIT_CRYPTO_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_kernel.h b/tests/subsys/suit/unit/mocks/include/mock_suit_kernel.h new file mode 100644 index 000000000000..3ff790b8b054 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_kernel.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_KERNEL_H__ +#define MOCK_SUIT_KERNEL_H__ + +#include + +FAKE_VALUE_FUNC(int, k_mutex_lock, struct k_mutex *, k_timeout_t); +FAKE_VALUE_FUNC(int, k_mutex_unlock, struct k_mutex *); + +static inline void mock_suit_kernel_reset(void) +{ + RESET_FAKE(k_mutex_lock); + RESET_FAKE(k_mutex_unlock); +} + +#endif /* MOCK_SUIT_KERNEL_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h b/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h new file mode 100644 index 000000000000..fa8bc1c2a2dc --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_mci.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_MCI_H__ +#define MOCK_SUIT_MCI_H__ + +#include +#include + +#include + +/* suit_generic_ids.c */ +#ifdef CONFIG_MOCK_SUIT_MCI_GENERIC_IDS +FAKE_VALUE_FUNC(int, suit_mci_nordic_vendor_id_get, const suit_uuid_t **); +#endif /* CONFIG_MOCK_SUIT_MCI_GENERIC_IDS */ + +/* utils.c */ +#ifdef CONFIG_MOCK_SUIT_MCI_UTILS +FAKE_VALUE_FUNC(int, suit_metadata_uuid_compare, const suit_uuid_t *, const suit_uuid_t *); +FAKE_VALUE_FUNC(int, suit_mci_manifest_parent_child_validate, const suit_manifest_class_id_t *, + const suit_manifest_class_id_t *); +#endif /* CONFIG_MOCK_SUIT_MCI_UTILS */ + +/* mci_.c */ +FAKE_VALUE_FUNC(int, suit_mci_supported_manifest_class_ids_get, suit_manifest_class_info_t *, + size_t *); +FAKE_VALUE_FUNC(int, suit_mci_invoke_order_get, const suit_manifest_class_id_t **, size_t *); +FAKE_VALUE_FUNC(int, suit_mci_downgrade_prevention_policy_get, const suit_manifest_class_id_t *, + suit_downgrade_prevention_policy_t *); +FAKE_VALUE_FUNC(int, suit_mci_independent_update_policy_get, const suit_manifest_class_id_t *, + 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_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 *, + void *, size_t); +FAKE_VALUE_FUNC(int, suit_mci_platform_specific_component_rights_validate, + const suit_manifest_class_id_t *, int); +FAKE_VALUE_FUNC(int, suit_mci_vendor_id_for_manifest_class_id_get, const suit_manifest_class_id_t *, + const suit_uuid_t **); +FAKE_VALUE_FUNC(int, suit_mci_manifest_parent_child_declaration_validate, + const suit_manifest_class_id_t *, const suit_manifest_class_id_t *); +FAKE_VALUE_FUNC(int, suit_mci_manifest_process_dependency_validate, + const suit_manifest_class_id_t *, const suit_manifest_class_id_t *); +FAKE_VALUE_FUNC(int, suit_mci_init); + +static inline void mock_suit_mci_reset(void) +{ +#ifdef CONFIG_MOCK_SUIT_MCI_GENERIC_IDS + RESET_FAKE(suit_mci_nordic_vendor_id_get); +#endif /* CONFIG_MOCK_SUIT_MCI_GENERIC_IDS */ + +#ifdef CONFIG_MOCK_SUIT_MCI_UTILS + RESET_FAKE(suit_metadata_uuid_compare); + RESET_FAKE(suit_mci_manifest_parent_child_validate); +#endif /* CONFIG_MOCK_SUIT_MCI_UTILS */ + + RESET_FAKE(suit_mci_supported_manifest_class_ids_get); + RESET_FAKE(suit_mci_invoke_order_get); + RESET_FAKE(suit_mci_downgrade_prevention_policy_get); + 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_processor_start_rights_validate); + RESET_FAKE(suit_mci_memory_access_rights_validate); + RESET_FAKE(suit_mci_platform_specific_component_rights_validate); + RESET_FAKE(suit_mci_vendor_id_for_manifest_class_id_get); + RESET_FAKE(suit_mci_manifest_process_dependency_validate); + RESET_FAKE(suit_mci_manifest_parent_child_declaration_validate); + RESET_FAKE(suit_mci_init); +} + +#endif /* MOCK_SUIT_MCI_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_memory_layout.h b/tests/subsys/suit/unit/mocks/include/mock_suit_memory_layout.h new file mode 100644 index 000000000000..ca3a695c189e --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_memory_layout.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + +#ifndef MOCK_SUIT_MEMORY_LAYOUT_H__ +#define MOCK_SUIT_MEMORY_LAYOUT_H__ + +#include +#include +#include + +FAKE_VALUE_FUNC(bool, suit_memory_global_address_is_in_external_memory, uintptr_t); + +static inline void mock_suit_memory_layout_reset(void) +{ + RESET_FAKE(suit_memory_global_address_is_in_external_memory); +} + +#endif /* MOCK_SUIT_MEMORY_LAYOUT_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_memptr_storage.h b/tests/subsys/suit/unit/mocks/include/mock_suit_memptr_storage.h new file mode 100644 index 000000000000..a607465bfaef --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_memptr_storage.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_MEMPTR_STORAGE_H__ +#define MOCK_SUIT_MEMPTR_STORAGE_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(int, suit_memptr_storage_get, memptr_storage_handle_t *); +FAKE_VALUE_FUNC(int, suit_memptr_storage_release, memptr_storage_handle_t); +FAKE_VALUE_FUNC(int, suit_memptr_storage_ptr_store, memptr_storage_handle_t, const uint8_t *, + size_t); +FAKE_VALUE_FUNC(int, suit_memptr_storage_ptr_get, memptr_storage_handle_t, const uint8_t **, + size_t *); + +static inline void mock_suit_memptr_storage_reset(void) +{ + RESET_FAKE(suit_memptr_storage_get); + RESET_FAKE(suit_memptr_storage_release); + RESET_FAKE(suit_memptr_storage_ptr_store); + RESET_FAKE(suit_memptr_storage_ptr_get); + + suit_memptr_storage_get_fake.return_val = SUIT_PLAT_SUCCESS; + suit_memptr_storage_release_fake.return_val = SUIT_PLAT_SUCCESS; + suit_memptr_storage_ptr_store_fake.return_val = SUIT_PLAT_SUCCESS; + suit_memptr_storage_ptr_get_fake.return_val = SUIT_PLAT_SUCCESS; +} + +#endif /* MOCK_SUIT_MEMPTR_STORAGE_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_metadata.h b/tests/subsys/suit/unit/mocks/include/mock_suit_metadata.h new file mode 100644 index 000000000000..e86d12871361 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_metadata.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_METADATA_H__ +#define MOCK_SUIT_METADATA_H__ + +#include +#include + +#include + +/* suit_metadata.c */ +FAKE_VALUE_FUNC(suit_plat_err_t, suit_metadata_version_from_array, suit_version_t *, int32_t *, + size_t); + +static inline void mock_suit_metadata_reset(void) +{ + RESET_FAKE(suit_metadata_version_from_array); +} + +#endif /* MOCK_SUIT_MCI_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_plat_component_compatibility.h b/tests/subsys/suit/unit/mocks/include/mock_suit_plat_component_compatibility.h new file mode 100644 index 000000000000..52c563a6e39c --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_plat_component_compatibility.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ +#define MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(int, suit_plat_component_compatibility_check, const suit_manifest_class_id_t *, + struct zcbor_string *); + +static inline void mock_suit_plat_component_compatibility_check_reset(void) +{ + RESET_FAKE(suit_plat_component_compatibility_check); +} + +#endif /* MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_plat_decode_util.h b/tests/subsys/suit/unit/mocks/include/mock_suit_plat_decode_util.h new file mode 100644 index 000000000000..6b639af8e353 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_plat_decode_util.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_PLAT_DECODE_UTIL_H__ +#define MOCK_SUIT_PLAT_DECODE_UTIL_H__ + +#include +#include +#include + +/* suit_plat_decode_util.c */ +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_component_id, struct zcbor_string *, uint8_t *, + intptr_t *, size_t *); +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_address_size, struct zcbor_string *, intptr_t *, + size_t *); +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_component_number, struct zcbor_string *, + uint32_t *); +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_key_id, struct zcbor_string *, uint32_t *); + +#ifdef CONFIG_SUIT_PLATFORM +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_component_type, struct zcbor_string *, + suit_component_type_t *); +#endif /* CONFIG_SUIT_PLATFORM */ + +#ifdef CONFIG_SUIT_MCI +FAKE_VALUE_FUNC(suit_plat_err_t, suit_plat_decode_manifest_class_id, struct zcbor_string *, + suit_manifest_class_id_t **); +#endif /* CONFIG_SUIT_MCI */ + +static inline void mock_suit_plat_decode_util_reset(void) +{ + RESET_FAKE(suit_plat_decode_component_id); +#ifdef CONFIG_SUIT_PLATFORM + RESET_FAKE(suit_plat_decode_component_type); +#endif /* CONFIG_SUIT_PLATFORM */ + RESET_FAKE(suit_plat_decode_address_size); + RESET_FAKE(suit_plat_decode_component_number); + RESET_FAKE(suit_plat_decode_key_id); + +#ifdef CONFIG_SUIT_MCI + RESET_FAKE(suit_plat_decode_manifest_class_id); +#endif /* CONFIG_SUIT_MCI */ +} + +#endif /* MOCK_SUIT_PLAT_DECODE_UTIL_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_platform.h b/tests/subsys/suit/unit/mocks/include/mock_suit_platform.h new file mode 100644 index 000000000000..59f1a690d55d --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_platform.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_PLATFORM_H__ +#define MOCK_SUIT_PLATFORM_H__ + +#include +#include + +#include + +FAKE_VALUE_FUNC(int, suit_plat_check_digest, enum suit_cose_alg, struct zcbor_string *, + struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authenticate_manifest, struct zcbor_string *, enum suit_cose_alg, + struct zcbor_string *, struct zcbor_string *, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authorize_unsigned_manifest, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_create_component_handle, struct zcbor_string *, suit_component_t *); +FAKE_VALUE_FUNC(int, suit_plat_release_component_handle, suit_component_t); + +#ifdef CONFIG_CHECK_IMAGE_MATCH_TEST +FAKE_VALUE_FUNC(int, suit_plat_check_image_match, suit_component_t, enum suit_cose_alg, + struct zcbor_string *); +#endif /* CONFIG_CHECK_IMAGE_MATCH_TEST */ + +FAKE_VALUE_FUNC(int, suit_plat_check_content, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_slot, suit_component_t, unsigned int); +FAKE_VALUE_FUNC(int, suit_plat_check_vid, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_cid, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_did, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_authorize_sequence_num, enum suit_command_sequence, + struct zcbor_string *, unsigned int); +FAKE_VALUE_FUNC(int, suit_plat_authorize_component_id, struct zcbor_string *, + struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_fetch, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_fetch_integrated, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_copy, suit_component_t, suit_component_t); +FAKE_VALUE_FUNC(int, suit_plat_swap, suit_component_t, suit_component_t); +FAKE_VALUE_FUNC(int, suit_plat_write, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_invoke, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_report, unsigned int, struct suit_report *); +FAKE_VALUE_FUNC(int, suit_plat_sequence_completed, enum suit_command_sequence, + struct zcbor_string *, const uint8_t *, size_t); +FAKE_VALUE_FUNC(int, suit_plat_retrieve_manifest, suit_component_t, const uint8_t **, size_t *); +FAKE_VALUE_FUNC(int, suit_plat_override_image_size, suit_component_t, size_t); + +#ifdef CONFIG_SUIT_PLATFORM_DRY_RUN_SUPPORT +FAKE_VALUE_FUNC(int, suit_plat_check_fetch, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_fetch_integrated, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_copy, suit_component_t, suit_component_t); +FAKE_VALUE_FUNC(int, suit_plat_check_swap, suit_component_t, suit_component_t); +FAKE_VALUE_FUNC(int, suit_plat_check_write, suit_component_t, struct zcbor_string *); +FAKE_VALUE_FUNC(int, suit_plat_check_invoke, suit_component_t, struct zcbor_string *); +#endif /* CONFIG_SUIT_PLATFORM_DRY_RUN_SUPPORT */ + +static inline void mock_suit_platform_reset(void) +{ + RESET_FAKE(suit_plat_check_digest); + RESET_FAKE(suit_plat_authenticate_manifest); + RESET_FAKE(suit_plat_authorize_unsigned_manifest); + RESET_FAKE(suit_plat_create_component_handle); + RESET_FAKE(suit_plat_release_component_handle); + +#ifdef CONFIG_CHECK_IMAGE_MATCH_TEST + RESET_FAKE(suit_plat_check_image_match); +#endif /* CONFIG_CHECK_IMAGE_MATCH_TEST */ + + RESET_FAKE(suit_plat_check_content); + RESET_FAKE(suit_plat_check_slot); + RESET_FAKE(suit_plat_check_vid); + RESET_FAKE(suit_plat_check_cid); + RESET_FAKE(suit_plat_check_did); + RESET_FAKE(suit_plat_authorize_sequence_num); + RESET_FAKE(suit_plat_authorize_component_id); + RESET_FAKE(suit_plat_fetch); + RESET_FAKE(suit_plat_fetch_integrated); + RESET_FAKE(suit_plat_copy); + RESET_FAKE(suit_plat_swap); + RESET_FAKE(suit_plat_write); + RESET_FAKE(suit_plat_invoke); + RESET_FAKE(suit_plat_report); + RESET_FAKE(suit_plat_sequence_completed); + RESET_FAKE(suit_plat_retrieve_manifest); + RESET_FAKE(suit_plat_override_image_size); + +#ifdef CONFIG_SUIT_PLATFORM_DRY_RUN_SUPPORT + RESET_FAKE(suit_plat_check_fetch); + RESET_FAKE(suit_plat_check_fetch_integrated); + RESET_FAKE(suit_plat_check_copy); + RESET_FAKE(suit_plat_check_swap); + RESET_FAKE(suit_plat_check_write); + RESET_FAKE(suit_plat_check_invoke); +#endif /* CONFIG_SUIT_PLATFORM_DRY_RUN_SUPPORT */ +} +#endif /* MOCK_SUIT_PLATFORM_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_platform_internal.h b/tests/subsys/suit/unit/mocks/include/mock_suit_platform_internal.h new file mode 100644 index 000000000000..4ccf95d0b2e9 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_platform_internal.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_PLATFORM_INTERNAL_H__ +#define MOCK_SUIT_PLATFORM_INTERNAL_H__ + +#include +#include + +#include + + +FAKE_VALUE_FUNC(int, suit_plat_component_id_get, suit_component_t, struct zcbor_string **); +FAKE_VALUE_FUNC(int, suit_plat_component_impl_data_set, suit_component_t, void *); +FAKE_VALUE_FUNC(int, suit_plat_component_impl_data_get, suit_component_t, void **); + +static inline void mock_suit_platform_internal_reset(void) +{ + RESET_FAKE(suit_plat_component_id_get); + RESET_FAKE(suit_plat_component_impl_data_set); + RESET_FAKE(suit_plat_component_impl_data_get); +} +#endif /* MOCK_SUIT_PLATFORM_INTERNAL_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h b/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h new file mode 100644 index 000000000000..bb97edf2b0cb --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mock_suit_storage.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_SUIT_STORAGE_H__ +#define MOCK_SUIT_STORAGE_H__ + +#include +#include + +#include + +/* suit_storage.c */ +FAKE_VALUE_FUNC(int, suit_storage_init); +FAKE_VALUE_FUNC(int, suit_storage_installed_envelope_get, const suit_manifest_class_id_t *, + const uint8_t **, size_t *); +FAKE_VALUE_FUNC(int, suit_storage_install_envelope, const suit_manifest_class_id_t *, uint8_t *, + size_t); + +/* suit_storage_update.c */ +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); + +static inline void mock_suit_storage_reset(void) +{ + RESET_FAKE(suit_storage_init); + RESET_FAKE(suit_storage_installed_envelope_get); + RESET_FAKE(suit_storage_install_envelope); + RESET_FAKE(suit_storage_update_cand_get); + RESET_FAKE(suit_storage_update_cand_set); +} + +#endif /* MOCK_SUIT_STORAGE_H__ */ diff --git a/tests/subsys/suit/unit/mocks/include/mocks.h b/tests/subsys/suit/unit/mocks/include/mocks.h new file mode 100644 index 000000000000..8772c88627e0 --- /dev/null +++ b/tests/subsys/suit/unit/mocks/include/mocks.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#ifndef MOCK_H__ +#define MOCK_H__ + +#include +#include + +#ifdef CONFIG_MOCK_SUIT_PROCESSOR +#include +#endif /* CONFIG_MOCK_SUIT_PROCESSOR */ + +#ifdef CONFIG_MOCK_SUIT_MCI +#include +#endif /* CONFIG_MOCK_SUIT_MCI */ + +#ifdef CONFIG_MOCK_SUIT_METADATA +#include +#endif /* CONFIG_MOCK_SUIT_METADATA */ + +#ifdef CONFIG_MOCK_SUIT_STORAGE +#include +#endif /* CONFIG_MOCK_SUIT_STORAGE */ + +#ifdef CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL +#include +#endif /* CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL */ + +#ifdef CONFIG_MOCK_SUIT_CRYPTO +#include +#endif + +#ifdef CONFIG_MOCK_SUIT_KERNEL +#include +#endif + +#ifdef CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY +#include +#endif /* CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY */ + +#ifdef CONFIG_MOCK_SUIT_PLATFORM_INTERNAL +#include +#endif + +#ifdef CONFIG_MOCK_SUIT_MEMPTR_STORAGE +#include +#endif /* CONFIG_MOCK_SUIT_MEMPTR_STORAGE */ + +#ifdef CONFIG_MOCK_SUIT_PLATFORM +#include +#endif /* CONFIG_MOCK_SUIT_PLATFORM */ + +#ifdef CONFIG_MOCK_DIGEST_SINK +#include +#endif /* CONFIG_MOCK_DIGEST_SINK */ + +#ifdef CONFIG_MOCK_GENERIC_ADDRESS_STREAMER +#include +#endif /* CONFIG_MOCK_GENERIC_ADDRESS_STREAMER */ + +#ifdef CONFIG_MOCK_DFU_CACHE_SINK +#include +#endif /* CONFIG_MOCK_DFU_CACHE_SINK */ + +#ifdef CONFIG_MOCK_DFU_CACHE_STREAMER +#include +#endif /* CONFIG_MOCK_DFU_CACHE_STREAMER */ + +#ifdef CONFIG_MOCK_FETCH_SOURCE_STREAMER +#include +#endif /* CONFIG_MOCK_FETCH_SOURCE_STREAMER */ + +#ifdef CONFIG_MOCK_SDFW_BUILTIN_KEYS +#include +#endif /* CONFIG_MOCK_SDFW_BUILTIN_KEYS */ + +#ifdef CONFIG_MOCK_SUIT_MEMORY_LAYOUT +#include +#endif /* CONFIG_MOCK_SUIT_MEMORY_LAYOUT */ + +static inline void mocks_reset(void) +{ +#ifdef CONFIG_MOCK_SUIT_PROCESSOR + mock_suit_processor_reset(); +#endif /* CONFIG_MOCK_SUIT_PROCESSOR */ + +#ifdef CONFIG_MOCK_SUIT_MCI + mock_suit_mci_reset(); +#endif /* CONFIG_MOCK_SUIT_MCI */ + +#ifdef CONFIG_MOCK_SUIT_METADATA + mock_suit_metadata_reset(); +#endif /* CONFIG_MOCK_SUIT_METADATA */ + +#ifdef CONFIG_MOCK_SUIT_STORAGE + mock_suit_storage_reset(); +#endif /* CONFIG_MOCK_SUIT_STORAGE */ + +#ifdef CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL + mock_suit_plat_decode_util_reset(); +#endif /* CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL */ + +#ifdef CONFIG_MOCK_SUIT_CRYPTO + mock_suit_crypto_reset(); +#endif + +#ifdef CONFIG_MOCK_SUIT_KERNEL + mock_suit_kernel_reset(); +#endif + +#ifdef CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY + mock_suit_plat_component_compatibility_check_reset(); +#endif + +#ifdef CONFIG_MOCK_SUIT_PLATFORM_INTERNAL + mock_suit_platform_internal_reset(); +#endif + +#ifdef CONFIG_MOCK_SUIT_MEMPTR_STORAGE + mock_suit_memptr_storage_reset(); +#endif + +#ifdef CONFIG_MOCK_SUIT_PLATFORM + mock_suit_platform_reset(); +#endif /* CONFIG_MOCK_SUIT_PLATFORM */ + +#ifdef CONFIG_MOCK_DIGEST_SINK + mock_digest_sink_reset(); +#endif /* CONFIG_MOCK_DIGEST_SINK */ + +#ifdef CONFIG_MOCK_GENERIC_ADDRESS_STREAMER + mock_generic_address_streamer_reset(); +#endif /* CONFIG_MOCK_GENERIC_ADDRESS_STREAMER */ + +#ifdef CONFIG_MOCK_DFU_CACHE_SINK + mock_dfu_cache_sink_reset(); +#endif /* CONFIG_MOCK_DFU_CACHE_SINK */ + +#ifdef CONFIG_MOCK_DFU_CACHE_STREAMER + mock_dfu_cache_streamer_reset(); +#endif /* CONFIG_MOCK_DFU_CACHE_STREAMER */ + +#ifdef CONFIG_MOCK_FETCH_SOURCE_STREAMER + mock_fetch_source_streamer_reset(); +#endif /* CONFIG_MOCK_FETCH_SOURCE_STREAMER */ + +#ifdef CONFIG_MOCK_SDFW_BUILTIN_KEYS + mock_sdfw_builtin_keys_reset(); +#endif /* CONFIG_MOCK_SDFW_BUILTIN_KEYS */ + +#ifdef CONFIG_MOCK_SUIT_MEMORY_LAYOUT + mock_suit_memory_layout_reset(); +#endif /* CONFIG_MOCK_SUIT_MEMORY_LAYOUT */ + +} +#endif /* MOCK_H__ */ diff --git a/tests/subsys/suit/unit/plat_devconfig/CMakeLists.txt b/tests/subsys/suit/unit/plat_devconfig/CMakeLists.txt new file mode 100644 index 000000000000..6ee7061db9ab --- /dev/null +++ b/tests/subsys/suit/unit/plat_devconfig/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(plat_devconfig) + +target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_devconfig.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) diff --git a/tests/subsys/suit/unit/plat_devconfig/Kconfig b/tests/subsys/suit/unit/plat_devconfig/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/plat_devconfig/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/plat_devconfig/prj.conf b/tests/subsys/suit/unit/plat_devconfig/prj.conf new file mode 100644 index 000000000000..3982b8a8a81f --- /dev/null +++ b/tests/subsys/suit/unit/plat_devconfig/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_STORAGE=y +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_UTILS=y diff --git a/tests/subsys/suit/unit/plat_devconfig/src/main.c b/tests/subsys/suit/unit/plat_devconfig/src/main.c new file mode 100644 index 000000000000..1839e8e39377 --- /dev/null +++ b/tests/subsys/suit/unit/plat_devconfig/src/main.c @@ -0,0 +1,995 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +static suit_manifest_class_id_t sample_class_id = {{0xca, 0xd8, 0x52, 0x3a, 0xf8, 0x29, 0x5a, 0x9a, + 0xba, 0x85, 0x2e, 0xa0, 0xb2, 0xf5, 0x77, + 0xc9}}; +static struct zcbor_string valid_manifest_component_id = { + .value = (const uint8_t *)0x1234, + .len = 123, +}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +ZTEST_SUITE(suit_platform_devconfig_seq_tests, NULL, NULL, test_before, NULL, NULL); + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_correct_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_manifest_component_id, component_id, + "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = &sample_class_id; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_invalid_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_manifest_component_id, component_id, + "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = NULL; + + return SUIT_PLAT_ERR_CRASH; +} + +static int suit_processor_get_manifest_metadata_seq_one_fake_func( + const uint8_t *envelope_str, size_t envelope_len, bool authenticate, + struct zcbor_string *manifest_component_id, struct zcbor_string *digest, + enum suit_cose_alg *alg, unsigned int *seq_num) +{ + zassert_not_equal( + seq_num, NULL, + "The API must provide a valid pointer, to read the sequence number of a manifest"); + *seq_num = 1; + + return SUIT_SUCCESS; +} + +static int suit_processor_get_manifest_metadata_decoder_busy_fake_func( + const uint8_t *envelope_str, size_t envelope_len, bool authenticate, + struct zcbor_string *manifest_component_id, struct zcbor_string *digest, + enum suit_cose_alg *alg, unsigned int *seq_num) +{ + zassert_not_equal( + seq_num, NULL, + "The API must provide a valid pointer, to read the sequence number of a manifest"); + + return SUIT_ERR_WAIT; +} + +static mci_err_t suit_mci_downgrade_prevention_policy_get_enabled_fake_func( + const suit_manifest_class_id_t *class_id, suit_downgrade_prevention_policy_t *policy) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal( + policy, NULL, + "The API must provide a valid pointer, to read the downgrade prevention policy"); + *policy = SUIT_DOWNGRADE_PREVENTION_ENABLED; + + return SUIT_PLAT_SUCCESS; +} + +static mci_err_t suit_mci_downgrade_prevention_policy_get_disabled_fake_func( + const suit_manifest_class_id_t *class_id, suit_downgrade_prevention_policy_t *policy) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal( + policy, NULL, + "The API must provide a valid pointer, to read the downgrade prevention policy"); + *policy = SUIT_DOWNGRADE_PREVENTION_DISABLED; + + return SUIT_PLAT_SUCCESS; +} + +static mci_err_t suit_mci_downgrade_prevention_policy_get_unsupported_fake_func( + const suit_manifest_class_id_t *class_id, suit_downgrade_prevention_policy_t *policy) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + zassert_not_equal( + policy, NULL, + "The API must provide a valid pointer, to read the downgrade prevention policy"); + *policy = (suit_downgrade_prevention_policy_t)0x1234; + + return SUIT_PLAT_SUCCESS; +} + +ZTEST(suit_platform_devconfig_seq_tests, test_null_arg) +{ + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 and NULL component ID + */ + int ret = suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, NULL, 1); + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Invalid manifest class ID authorized"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_null_component_id) +{ + struct zcbor_string invalid_manifest_component_id; + + /* GIVEN the manifest component ID points to the NULL. */ + invalid_manifest_component_id.value = NULL; + invalid_manifest_component_id.len = 123; + + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 + */ + int ret = suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, &invalid_manifest_component_id, + 1); + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Invalid manifest class ID authorized"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_invalid_manifest_component_id) +{ + /* GIVEN the manifest component ID contains an invalid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_invalid_fake_func; + + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 + */ + int ret = + suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Invalid manifest class ID authorized"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_unsupported_class_id) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is not supported */ + suit_mci_manifest_class_id_validate_fake.return_val = MCI_ERR_MANIFESTCLASSID; + + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 + */ + int ret = + suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized with unauthorized class ID"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_boot_no_installed_envelope) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_VALIDATE, + SUIT_SEQ_LOAD, + SUIT_SEQ_INVOKE, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_ERR_NOT_FOUND; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is enabled */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_enabled_fake_func; + + /* WHEN platform is asked for authorization of VALIDATE, LOAD or INVOKE sequence + * from manifest with sequence number 1 + */ + int ret = suit_plat_authorize_sequence_num(suit_seq[i], + &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized too boot from update area"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); + } +} + +ZTEST(suit_platform_devconfig_seq_tests, test_update_no_installed_envelope) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_PARSE, SUIT_SEQ_SHARED, SUIT_SEQ_DEP_RESOLUTION, + SUIT_SEQ_PAYLOAD_FETCH, SUIT_SEQ_INSTALL, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains an invalid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is enabled */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_enabled_fake_func; + + /* WHEN platform is asked for authorization of PARSE, SHARED, DEP_RESOLUTION, + * PAYLOAD_FETCH, INSTALL, sequence from manifest with sequence number 1 + */ + int ret = suit_plat_authorize_sequence_num(suit_seq[i], + &valid_manifest_component_id, 1); + + /* THEN manifest is authorized... */ + zassert_equal(SUIT_SUCCESS, ret, "Manifest sequence number unauthorized"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); + } +} + +ZTEST(suit_platform_devconfig_seq_tests, test_decode_busy) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_PARSE, SUIT_SEQ_SHARED, SUIT_SEQ_DEP_RESOLUTION, + SUIT_SEQ_PAYLOAD_FETCH, SUIT_SEQ_INSTALL, SUIT_SEQ_VALIDATE, + SUIT_SEQ_LOAD, SUIT_SEQ_INVOKE, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable, but the decoder is busy */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_decoder_busy_fake_func; + + /* WHEN platform is asked for authorization of any sequence from manifest with + * sequence number 1 + */ + int ret = suit_plat_authorize_sequence_num(suit_seq[i], + &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal( + SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized, without checking installed manifest"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside SUIT storage */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is not asked for the downgrade prevention policy, associated with + * given class ID + */ + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); + } +} + +ZTEST(suit_platform_devconfig_seq_tests, test_manifest_present_no_downgrade_policy) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is unknown */ + suit_mci_downgrade_prevention_policy_get_fake.return_val = MCI_ERR_MANIFESTCLASSID; + + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 + */ + int ret = + suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal( + SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized for unknown downgrade prevention policy"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside SUIT storage */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is asked for the downgrade prevention policy, associated with given class ID + */ + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 1, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_manifest_present_unsupported_downgrade_policy) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is unsupported */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_unsupported_fake_func; + + /* WHEN platform is asked for authorization of INSTALL sequence from manifest with sequence + * number 1 + */ + int ret = + suit_plat_authorize_sequence_num(SUIT_SEQ_INSTALL, &valid_manifest_component_id, 1); + + /* THEN manifest is not authorized... */ + zassert_equal( + SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized for unsupported downgrade prevention policy"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside SUIT storage */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is asked for the downgrade prevention policy, associated with given class ID + */ + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 1, + "Incorrect number of suit_mci_downgrade_prevention_policy_get() calls"); +} + +ZTEST(suit_platform_devconfig_seq_tests, test_update_manifest_present_disabled_downgrade_prevention) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_PARSE, SUIT_SEQ_SHARED, SUIT_SEQ_DEP_RESOLUTION, + SUIT_SEQ_PAYLOAD_FETCH, SUIT_SEQ_INSTALL, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + for (uint32_t seq_num = 0; seq_num < 2; seq_num++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is enabled */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_disabled_fake_func; + + /* WHEN platform is asked for authorization of any sequence from manifest + * with any sequence number + */ + int ret = suit_plat_authorize_sequence_num( + suit_seq[i], &valid_manifest_component_id, seq_num); + + /* THEN manifest is authorized... */ + zassert_equal(SUIT_SUCCESS, ret, + "Manifest sequence number unauthorized for sequence %d with " + "number %d", + suit_seq[i], seq_num); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal( + suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal( + suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID */ + zassert_equal( + suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside SUIT + * storage + */ + zassert_equal( + suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is asked for the downgrade prevention policy, associated with + * given class ID + */ + zassert_equal(suit_mci_downgrade_prevention_policy_get_fake.call_count, 1, + "Incorrect number of " + "suit_mci_downgrade_prevention_policy_get() calls"); + } + } +} + +ZTEST(suit_platform_devconfig_seq_tests, test_boot_manifest_present_disabled_downgrade_prevention) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_VALIDATE, + SUIT_SEQ_LOAD, + SUIT_SEQ_INVOKE, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + for (uint32_t seq_num = 0; seq_num < 2; seq_num++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is enabled */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_disabled_fake_func; + + /* WHEN platform is asked for authorization of any sequence from manifest + * with any sequence number + */ + int ret = suit_plat_authorize_sequence_num( + suit_seq[i], &valid_manifest_component_id, seq_num); + + if (seq_num == 1) { + /* .. and the sequence number matches the installed envelope */ + + /* THEN manifest is authorized... */ + zassert_equal(SUIT_SUCCESS, ret, + "Manifest sequence number unauthorized for sequence " + "%d with number %d", + suit_seq[i], seq_num); + + /* ... and manifest class ID is decoded from the manifest component + * ID + */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of " + "suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, + 1, + "Incorrect number of " + "suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID + */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, + 1, + "Incorrect number of " + "suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside + * SUIT storage + */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, + 1, + "Incorrect number of " + "suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is not asked for the downgrade prevention policy, + * associated with given class ID + */ + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of " + "suit_mci_downgrade_prevention_policy_get() calls"); + } else { + /* .. and the sequence number doe not match the installed envelope + */ + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized for sequence %d " + "with number %d", + suit_seq[i], seq_num); + + /* ... and manifest class ID is decoded from the manifest component + * ID + */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of " + "suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, + 1, + "Incorrect number of " + "suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID + */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, + 1, + "Incorrect number of " + "suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside + * SUIT storage + */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, + 1, + "Incorrect number of " + "suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is not asked for the downgrade prevention policy, + * associated with given class ID + */ + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 0, + "Incorrect number of " + "suit_mci_downgrade_prevention_policy_get() calls"); + } + } + } +} + +ZTEST(suit_platform_devconfig_seq_tests, test_update_manifest_present_enabled_downgrade_prevention) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_PARSE, SUIT_SEQ_SHARED, SUIT_SEQ_DEP_RESOLUTION, + SUIT_SEQ_PAYLOAD_FETCH, SUIT_SEQ_INSTALL, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + for (uint32_t seq_num = 0; seq_num < 2; seq_num++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage contains a valid envelope with given class ID */ + suit_storage_installed_envelope_get_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the envelope from SUIT storage is decodeable */ + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_seq_one_fake_func; + /* ... and the downgrade prevention policy is enabled */ + suit_mci_downgrade_prevention_policy_get_fake.custom_fake = + suit_mci_downgrade_prevention_policy_get_enabled_fake_func; + + /* WHEN platform is asked for authorization of any sequence from manifest + * with any sequence number + */ + int ret = suit_plat_authorize_sequence_num( + suit_seq[i], &valid_manifest_component_id, seq_num); + + if (seq_num >= 1) { + /* .. and the sequence number is not smaller than the installed + * envelope sequence + */ + + /* THEN manifest is authorized... */ + zassert_equal(SUIT_SUCCESS, ret, + "Manifest sequence number unauthorized for sequence " + "%d with number %d", + suit_seq[i], seq_num); + + /* ... and manifest class ID is decoded from the manifest component + * ID + */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of " + "suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, + 1, + "Incorrect number of " + "suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID + */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, + 1, + "Incorrect number of " + "suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside + * SUIT storage + */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, + 1, + "Incorrect number of " + "suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is not asked for the downgrade prevention policy, + * associated with given class ID + */ + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 1, + "Incorrect number of " + "suit_mci_downgrade_prevention_policy_get() calls"); + } else { + /* .. and the sequence number doe not match the installed envelope + */ + + /* THEN manifest is not authorized... */ + zassert_equal(SUIT_ERR_AUTHENTICATION, ret, + "Manifest sequence number authorized for sequence %d " + "with number %d", + suit_seq[i], seq_num); + + /* ... and manifest class ID is decoded from the manifest component + * ID + */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of " + "suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, + 1, + "Incorrect number of " + "suit_mci_manifest_class_id_validate() calls"); + /* ... and SUIT storage is searched for manifest with given class ID + */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, + 1, + "Incorrect number of " + "suit_storage_installed_envelope_get() calls"); + /* ... and class ID is extracted from the envelope stored inside + * SUIT storage + */ + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, + 1, + "Incorrect number of " + "suit_processor_get_manifest_metadata() calls"); + /* ... and MCI is not asked for the downgrade prevention policy, + * associated with given class ID + */ + zassert_equal( + suit_mci_downgrade_prevention_policy_get_fake.call_count, 1, + "Incorrect number of " + "suit_mci_downgrade_prevention_policy_get() calls"); + } + } + } +} + +ZTEST_SUITE(suit_platform_devconfig_completed_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_platform_devconfig_completed_tests, test_null_arg) +{ + /* WHEN sequence is completed in a manifest with unknown component ID */ + int ret = suit_plat_sequence_completed(SUIT_SEQ_PARSE, NULL, NULL, 0); + + /* THEN manifest is not accepted... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest class ID handled"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_install_envelope_fake.call_count, 0, + "Incorrect number of suit_storage_install_envelope() calls"); +} + +ZTEST(suit_platform_devconfig_completed_tests, test_null_component_id) +{ + struct zcbor_string invalid_manifest_component_id; + + /* GIVEN the manifest component ID points to the NULL. */ + invalid_manifest_component_id.value = NULL; + invalid_manifest_component_id.len = 123; + + /* WHEN sequence is completed in a manifest with component ID set to NULL */ + int ret = suit_plat_sequence_completed(SUIT_SEQ_PARSE, &invalid_manifest_component_id, NULL, + 0); + + /* THEN manifest is not accepted... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest class ID handled"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_install_envelope_fake.call_count, 0, + "Incorrect number of suit_storage_install_envelope() calls"); +} + +ZTEST(suit_platform_devconfig_completed_tests, test_invalid_manifest_component_id) +{ + /* GIVEN the manifest component ID contains an invalid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_invalid_fake_func; + + /* WHEN sequence is completed */ + int ret = + suit_plat_sequence_completed(SUIT_SEQ_PARSE, &valid_manifest_component_id, NULL, 0); + + /* THEN manifest is not accepted... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest class ID handled"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_storage_install_envelope_fake.call_count, 0, + "Incorrect number of suit_storage_install_envelope() calls"); +} + +ZTEST(suit_platform_devconfig_completed_tests, test_unsupported_class_id) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is not supported */ + suit_mci_manifest_class_id_validate_fake.return_val = MCI_ERR_MANIFESTCLASSID; + + /* WHEN sequence is completed */ + int ret = + suit_plat_sequence_completed(SUIT_SEQ_PARSE, &valid_manifest_component_id, NULL, 0); + + /* THEN manifest is not accepted... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Manifest accepted with unauthorized class ID"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and other checks were not performed */ + zassert_equal(suit_storage_install_envelope_fake.call_count, 0, + "Incorrect number of suit_storage_install_envelope() calls"); +} + +ZTEST(suit_platform_devconfig_completed_tests, test_non_install_seq) +{ + enum suit_command_sequence suit_seq[] = { + SUIT_SEQ_PARSE, SUIT_SEQ_SHARED, SUIT_SEQ_DEP_RESOLUTION, SUIT_SEQ_PAYLOAD_FETCH, + SUIT_SEQ_VALIDATE, SUIT_SEQ_LOAD, SUIT_SEQ_INVOKE, + }; + + for (size_t i = 0; i < ARRAY_SIZE(suit_seq); i++) { + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + + /* WHEN sequence is completed */ + int ret = suit_plat_sequence_completed(suit_seq[i], &valid_manifest_component_id, + NULL, 0); + + /* THEN manifest is accepted... */ + zassert_equal(SUIT_SUCCESS, ret, "Manifest not accepted for sequence %d", + suit_seq[i]); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and the manifest is not passed to be installed in the SUIT storage */ + zassert_equal(suit_storage_install_envelope_fake.call_count, 0, + "Incorrect number of suit_storage_install_envelope() calls"); + } +} + +ZTEST(suit_platform_devconfig_completed_tests, test_install_seq_storage_failed) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage is unable to handle the manifest */ + suit_storage_install_envelope_fake.return_val = SUIT_PLAT_ERR_NOT_FOUND; + + /* WHEN sequence is completed */ + int ret = suit_plat_sequence_completed(SUIT_SEQ_INSTALL, &valid_manifest_component_id, NULL, + 0); + + /* THEN manifest is accepted... */ + zassert_equal(SUIT_ERR_CRASH, ret, "Manifest accepted but not installed"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and the manifest is passed to be installed in the SUIT storage */ + zassert_equal(suit_storage_install_envelope_fake.call_count, 1, + "Incorrect number of suit_storage_install_envelope() calls"); +} + +ZTEST(suit_platform_devconfig_completed_tests, test_install_seq_storage_succeed) +{ + /* GIVEN the manifest component ID contains a valid manifest class ID. */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + /* ... and the manifest class ID is supported */ + suit_mci_manifest_class_id_validate_fake.return_val = SUIT_PLAT_SUCCESS; + /* ... and the SUIT storage is able to handle the manifest */ + suit_storage_install_envelope_fake.return_val = SUIT_PLAT_SUCCESS; + + /* WHEN sequence is completed */ + int ret = suit_plat_sequence_completed(SUIT_SEQ_INSTALL, &valid_manifest_component_id, NULL, + 0); + + /* THEN manifest is accepted... */ + zassert_equal(SUIT_SUCCESS, ret, "Manifest not accepted"); + + /* ... and manifest class ID is decoded from the manifest component ID */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest class ID is validated */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + /* ... and the manifest is passed to be installed in the SUIT storage */ + zassert_equal(suit_storage_install_envelope_fake.call_count, 1, + "Incorrect number of suit_storage_install_envelope() calls"); +} diff --git a/tests/subsys/suit/unit/plat_devconfig/testcase.yaml b/tests/subsys/suit/unit/plat_devconfig/testcase.yaml new file mode 100644 index 000000000000..4aa6a7012f76 --- /dev/null +++ b/tests/subsys/suit/unit/plat_devconfig/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.unit.platform.devconfig: + type: unit + tags: >- + suit + suit_platform + suit_plat_sequence_completed + suit_plat_authorize_sequence_num diff --git a/tests/subsys/suit/unit/suit_metadata/CMakeLists.txt b/tests/subsys/suit/unit/suit_metadata/CMakeLists.txt new file mode 100644 index 000000000000..7283391a1b84 --- /dev/null +++ b/tests/subsys/suit/unit/suit_metadata/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_metadata) + +target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/metadata/include) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/metadata/src/suit_metadata.c +) diff --git a/tests/subsys/suit/unit/suit_metadata/Kconfig b/tests/subsys/suit/unit/suit_metadata/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_metadata/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_metadata/prj.conf b/tests/subsys/suit/unit/suit_metadata/prj.conf new file mode 100644 index 000000000000..b4ab30aba692 --- /dev/null +++ b/tests/subsys/suit/unit/suit_metadata/prj.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y diff --git a/tests/subsys/suit/unit/suit_metadata/src/main.c b/tests/subsys/suit/unit/suit_metadata/src/main.c new file mode 100644 index 000000000000..9fb9bd27cba4 --- /dev/null +++ b/tests/subsys/suit/unit/suit_metadata/src/main.c @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) +#endif /* ARRAY_SIZE */ + +typedef struct { + int32_t array[5]; + size_t array_size; + suit_version_t exp_version; +} version_test_vect; + +static int32_t test_version[] = {0, 0, 0, 0, 0}; +static suit_version_t sem_version; + +static void test_before(void *data) +{ + /* Reset common test structures */ + memset(&test_version, 0, sizeof(test_version)); + memset(&sem_version, 0, sizeof(sem_version)); + + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +ZTEST_SUITE(suit_metadata_version_from_array_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_metadata_version_from_array_tests, test_null_semver) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + + /* GIVEN the pointer to the output structure points to the NULL. */ + version = NULL; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, ARRAY_SIZE(test_version)); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_INVAL, ret, "Failed to catch null output argument"); +} + +ZTEST(suit_metadata_version_from_array_tests, test_null_array) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + + /* GIVEN the pointer to the input array points to the NULL. */ + array = NULL; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, ARRAY_SIZE(test_version)); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_INVAL, ret, "Failed to catch null input argument"); +} + +ZTEST(suit_metadata_version_from_array_tests, test_too_small_array) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + + /* GIVEN the input array size is zero. */ + int array_size = 0; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, array_size); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_SIZE, ret, "Failed to catch too small input array"); +} + +ZTEST(suit_metadata_version_from_array_tests, test_invalid_release_type) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + int32_t invalid_version_types[] = { + 3, 2, 1, -4, -5, -6, + }; + + for (int i = 0; i < ARRAY_SIZE(invalid_version_types); i++) { + /* GIVEN the input array describes unsupported release type. */ + array[2] = invalid_version_types[i]; + + /* WHEN the version conversion is attempted. */ + int ret = + suit_metadata_version_from_array(version, array, ARRAY_SIZE(test_version)); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_OUT_OF_BOUNDS, ret, + "Failed to catch unsupported release type"); + } +} + +ZTEST(suit_metadata_version_from_array_tests, test_negative_release_values) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + int32_t invalid_versions[3][3] = { + {-1, 2, 3}, + {1, -2, -3}, + {1, 2, -4}, + }; + + for (int i = 0; i < ARRAY_SIZE(invalid_versions); i++) { + /* GIVEN the input array describes negative release. */ + array = invalid_versions[i]; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, + ARRAY_SIZE(invalid_versions[0])); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_OUT_OF_BOUNDS, ret, + "Failed to catch negative release value"); + } +} + +ZTEST(suit_metadata_version_from_array_tests, test_negative_prerelease_values) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + int32_t invalid_versions[3][4] = { + {-1, 2, -1, 3}, + {1, -2, -1, 3}, + {1, 2, -1, -3}, + }; + + for (int i = 0; i < ARRAY_SIZE(invalid_versions); i++) { + /* GIVEN the input array describes negative pre-release. */ + array = invalid_versions[i]; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, + ARRAY_SIZE(invalid_versions[0])); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_OUT_OF_BOUNDS, ret, + "Failed to catch negative pre-release value"); + } +} + +ZTEST(suit_metadata_version_from_array_tests, test_too_long_release_version) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + int32_t invalid_version[] = {1, 2, 3, 0}; + + /* GIVEN the input array describes negative pre-release. */ + array = invalid_version; + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, ARRAY_SIZE(invalid_version)); + + /* THEN manifest version conversion fails */ + zassert_equal(SUIT_PLAT_ERR_OUT_OF_BOUNDS, ret, + "Failed to catch 4-digit regular release value"); +} + +ZTEST(suit_metadata_version_from_array_tests, test_valid_release_versions) +{ + int32_t *array = test_version; + suit_version_t *version = &sem_version; + version_test_vect versions[] = { + {.array = {1, 0, 0, 0, 0}, + .array_size = 1, + .exp_version = { + .type = SUIT_VERSION_RELEASE_NORMAL, + .major = 1, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {1, 2, 0, 0, 0}, + .array_size = 2, + .exp_version = { + .type = SUIT_VERSION_RELEASE_NORMAL, + .major = 1, + .minor = 2, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {1, 2, 3, 0, 0}, + .array_size = 3, + .exp_version = { + .type = SUIT_VERSION_RELEASE_NORMAL, + .major = 1, + .minor = 2, + .patch = 3, + .pre_release_number = 0, + }}, + {.array = {0, 0, 0, 0, 0}, + .array_size = 3, + .exp_version = { + .type = SUIT_VERSION_RELEASE_NORMAL, + .major = 0, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {0, 0, -1, 0, 0}, + .array_size = 3, + .exp_version = { + .type = SUIT_VERSION_RELEASE_RC, + .major = 0, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {0, 0, -2, 0, 0}, + .array_size = 3, + .exp_version = { + .type = SUIT_VERSION_RELEASE_BETA, + .major = 0, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {0, 0, -3, 0, 0}, + .array_size = 4, + .exp_version = { + .type = SUIT_VERSION_RELEASE_ALPHA, + .major = 0, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + {.array = {3, 2, -1, 1, 0}, + .array_size = 4, + .exp_version = { + .type = SUIT_VERSION_RELEASE_RC, + .major = 3, + .minor = 2, + .patch = 0, + .pre_release_number = 1, + }}, + {.array = {3, 2, -2, 1, 0}, + .array_size = 4, + .exp_version = { + .type = SUIT_VERSION_RELEASE_BETA, + .major = 3, + .minor = 2, + .patch = 0, + .pre_release_number = 1, + }}, + {.array = {3, 2, 1, -3, 1}, + .array_size = 5, + .exp_version = { + .type = SUIT_VERSION_RELEASE_ALPHA, + .major = 3, + .minor = 2, + .patch = 1, + .pre_release_number = 1, + }}, + {.array = {3, 2, -3, 1, 0}, + .array_size = 4, + .exp_version = { + .type = SUIT_VERSION_RELEASE_ALPHA, + .major = 3, + .minor = 2, + .patch = 0, + .pre_release_number = 1, + }}, + {.array = {3, -3, 1, 0, 0}, + .array_size = 3, + .exp_version = { + .type = SUIT_VERSION_RELEASE_ALPHA, + .major = 3, + .minor = 0, + .patch = 0, + .pre_release_number = 1, + }}, + {.array = {3, -3, 0, 0, 0}, + .array_size = 2, + .exp_version = { + .type = SUIT_VERSION_RELEASE_ALPHA, + .major = 3, + .minor = 0, + .patch = 0, + .pre_release_number = 0, + }}, + }; + + for (int i = 0; i < ARRAY_SIZE(versions); i++) { + /* GIVEN the input array describes a valid release. */ + array = versions[i].array; + + printk("\tTEST: %d.%d.%d.%d\n", array[0], array[1], array[2], array[3]); + + /* WHEN the version conversion is attempted. */ + int ret = suit_metadata_version_from_array(version, array, versions[i].array_size); + + /* THEN manifest version conversion succeeds ... */ + zassert_equal(SUIT_PLAT_SUCCESS, ret, "Failed to catch negative release value"); + + /* ... and the version has the expected value */ + zassert_equal(version->type, versions[i].exp_version.type, + "Incorrect version type returned"); + zassert_equal(version->major, versions[i].exp_version.major, + "Incorrect major version returned"); + zassert_equal(version->minor, versions[i].exp_version.minor, + "Incorrect minor version returned"); + zassert_equal(version->patch, versions[i].exp_version.patch, + "Incorrect patch version returned"); + zassert_equal(version->pre_release_number, + versions[i].exp_version.pre_release_number, + "Incorrect pre-release version number returned"); + } +} diff --git a/tests/subsys/suit/unit/suit_metadata/testcase.yaml b/tests/subsys/suit/unit/suit_metadata/testcase.yaml new file mode 100644 index 000000000000..5fa4bb726e2b --- /dev/null +++ b/tests/subsys/suit/unit/suit_metadata/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.metadata: + type: unit + tags: >- + suit + suit_metadata + suit_metadata_version_from_array diff --git a/tests/subsys/suit/unit/suit_plat_authorize_component_id/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_authorize_component_id/CMakeLists.txt new file mode 100644 index 000000000000..43138e54d332 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_component_id/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_authorize_component_id) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_authenticate.c +) diff --git a/tests/subsys/suit/unit/suit_plat_authorize_component_id/Kconfig b/tests/subsys/suit/unit/suit_plat_authorize_component_id/Kconfig new file mode 100644 index 000000000000..a9a82b6b9c24 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_component_id/Kconfig @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +config CHECK_IMAGE_MATCH_TEST + bool "Define and set to true to disable suit_plat_check_image_match fake" + default true + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_authorize_component_id/prj.conf b/tests/subsys/suit/unit/suit_plat_authorize_component_id/prj.conf new file mode 100644 index 000000000000..7973d092bd30 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_component_id/prj.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_CRYPTO=y +CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y diff --git a/tests/subsys/suit/unit/suit_plat_authorize_component_id/src/main.c b/tests/subsys/suit/unit/suit_plat_authorize_component_id/src/main.c new file mode 100644 index 000000000000..94121e2a6a64 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_component_id/src/main.c @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +static suit_manifest_class_id_t sample_class_id = {{0xca, 0xd8, 0x52, 0x3a, 0xf8, 0x29, 0x5a, 0x9a, + 0xba, 0x85, 0x2e, 0xa0, 0xb2, 0xf5, 0x77, + 0xc9}}; + +static struct zcbor_string valid_manifest_component_id = { + .value = (const uint8_t *)0x1234, + .len = 123, +}; + +static struct zcbor_string valid_component_id = { + .value = (const uint8_t *)0x4321, + .len = 321, +}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static int +suit_plat_component_compatibility_check_invalid_fake_func(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int +suit_plat_component_compatibility_check_correct_fake_func(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + + return SUIT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_correct_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_manifest_component_id, component_id, + "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = &sample_class_id; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_invalid_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_manifest_component_id, component_id, + "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = NULL; + + return SUIT_PLAT_ERR_CRASH; +} + +ZTEST_SUITE(suit_platform_authorize_component_id_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_platform_authorize_component_id_tests, test_null_manifest_component_id) +{ + int ret = suit_plat_authorize_component_id(NULL, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_manifest_component_id_null_value) +{ + struct zcbor_string invalid_manifest_component_id = { + .value = NULL, + .len = 8, + }; + + int ret = suit_plat_authorize_component_id(&invalid_manifest_component_id, + &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_manifest_component_id_0_len) +{ + struct zcbor_string invalid_manifest_component_id = { + .value = (const uint8_t *)0x1234, + .len = 0, + }; + + int ret = suit_plat_authorize_component_id(&invalid_manifest_component_id, + &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_null_component_id) +{ + int ret = suit_plat_authorize_component_id(&valid_manifest_component_id, NULL); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_component_id_null_value) +{ + struct zcbor_string invalid_component_id = { + .value = NULL, + .len = 8, + }; + + int ret = suit_plat_authorize_component_id(&valid_manifest_component_id, + &invalid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_component_id_0_len) +{ + struct zcbor_string invalid_component_id = { + .value = (const uint8_t *)0x1234, + .len = 0, + }; + + int ret = suit_plat_authorize_component_id(&valid_manifest_component_id, + &invalid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_decode_manifest_class_id) +{ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_invalid_fake_func; + + int ret = + suit_plat_authorize_component_id(&valid_manifest_component_id, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_UNAUTHORIZED_COMPONENT, ret, "Authorization should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_invalid_sut_plat_check_component_id) +{ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_invalid_fake_func; + + int ret = + suit_plat_authorize_component_id(&valid_manifest_component_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_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} + +ZTEST(suit_platform_authorize_component_id_tests, test_OK) +{ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_correct_fake_func; + + int ret = + suit_plat_authorize_component_id(&valid_manifest_component_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_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); +} diff --git a/tests/subsys/suit/unit/suit_plat_authorize_component_id/testcase.yaml b/tests/subsys/suit/unit/suit_plat_authorize_component_id/testcase.yaml new file mode 100644 index 000000000000..b564174e4008 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_component_id/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_authorize_component_id: + type: unit + tags: >- + suit + suit_platform + suit_plat_authorize_component_id diff --git a/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/CMakeLists.txt new file mode 100644 index 000000000000..f068f9c5a825 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_authorize_process_dependency) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_authenticate.c +) diff --git a/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/Kconfig b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/Kconfig new file mode 100644 index 000000000000..3f9efe4e184e --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/prj.conf b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/prj.conf new file mode 100644 index 000000000000..01332c0fbdf6 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/prj.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_CRYPTO=y +CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y diff --git a/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/src/main.c b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/src/main.c new file mode 100644 index 000000000000..66605e7f76ac --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/src/main.c @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +static suit_manifest_class_id_t parent_class_id = {{0x97, 0x05, 0x48, 0x23, 0x4c, 0x3d, 0x59, 0xa1, + 0x89, 0x86, 0xa5, 0x46, 0x60, 0xa1, 0x4b, + 0x0a}}; + +static suit_manifest_class_id_t child_class_id = {{0x5b, 0x46, 0x9f, 0xd1, 0x90, 0xee, 0x53, 0x9c, + 0xa3, 0x18, 0x68, 0x1b, 0x03, 0x69, 0x5e, 0x36}}; + +static struct zcbor_string parent_component_id = { + .value = (const uint8_t *)0x4321, + .len = 321, +}; + +static struct zcbor_string child_component_id = { + .value = (const uint8_t *)0xabcd, + .len = 987, +}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_predefined_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + if (component_id == &parent_component_id) { + *class_id = &parent_class_id; + } else if (component_id == &child_component_id) { + *class_id = &child_class_id; + } else { + zassert_unreachable("Invalid manifest component ID value"); + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + return SUIT_PLAT_SUCCESS; +} + +ZTEST_SUITE(suit_platform_authorize_process_dependency_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_platform_authorize_process_dependency_tests, test_null_parent_component_id) +{ + int class_id_decode_results[] = {SUIT_PLAT_ERR_INVAL}; + + SET_RETURN_SEQ(suit_plat_decode_manifest_class_id, class_id_decode_results, + ARRAY_SIZE(class_id_decode_results)); + + int ret = suit_plat_authorize_process_dependency(NULL, &child_component_id, SUIT_SEQ_PARSE); + + /* Manifest sequence authorization fails */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Failed to catch null argument (NULL, _, PARSE)"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, + ARRAY_SIZE(class_id_decode_results), + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.arg0_history[0], NULL, + "Invalid manifest class ID value (1st call)"); + zassert_not_equal( + suit_plat_decode_manifest_class_id_fake.arg1_history[0], NULL, + "The API must provide a valid pointer, to decode manifest class ID (1st call)"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_process_dependency_validate() calls"); +} + +ZTEST(suit_platform_authorize_process_dependency_tests, test_null_child_component_id) +{ + int class_id_decode_results[] = {SUIT_PLAT_SUCCESS, SUIT_PLAT_ERR_INVAL}; + + SET_RETURN_SEQ(suit_plat_decode_manifest_class_id, class_id_decode_results, + ARRAY_SIZE(class_id_decode_results)); + + int ret = + suit_plat_authorize_process_dependency(&parent_component_id, NULL, SUIT_SEQ_PARSE); + + /* Manifest sequence authorization fails */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Failed to catch null argument (NULL, _, PARSE)"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, + ARRAY_SIZE(class_id_decode_results), + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.arg0_history[0], &parent_component_id, + "Invalid manifest class ID value (1st call)"); + zassert_not_equal( + suit_plat_decode_manifest_class_id_fake.arg1_history[0], NULL, + "The API must provide a valid pointer, to decode manifest class ID (1st call)"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.arg0_history[1], NULL, + "Invalid manifest class ID value (2nd call)"); + zassert_not_equal( + suit_plat_decode_manifest_class_id_fake.arg1_history[1], NULL, + "The API must provide a valid pointer, to decode manifest class ID (2nd call)"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_process_dependency_validate() calls"); +} + +ZTEST(suit_platform_authorize_process_dependency_tests, test_processing_denied) +{ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_predefined_fake_func; + suit_mci_manifest_process_dependency_validate_fake.return_val = MCI_ERR_NOACCESS; + + int ret = suit_plat_authorize_process_dependency(&parent_component_id, &child_component_id, + SUIT_SEQ_PARSE); + + /* Manifest sequence authorization fails */ + zassert_equal(SUIT_ERR_UNAUTHORIZED_COMPONENT, ret, + "Failed to block processing of invalid manifest hierarchy"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 2, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_process_dependency_validate() calls"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.arg0_history[0], + &parent_class_id, "Invalid parent manifest class ID value"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.arg1_history[0], + &child_class_id, "Invalid child manifest class ID value"); +} + +ZTEST(suit_platform_authorize_process_dependency_tests, test_processing_allowed) +{ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_predefined_fake_func; + suit_mci_manifest_process_dependency_validate_fake.return_val = SUIT_PLAT_SUCCESS; + + int ret = suit_plat_authorize_process_dependency(&parent_component_id, &child_component_id, + SUIT_SEQ_PARSE); + + /* Manifest sequence authorization succeeds */ + zassert_equal(SUIT_SUCCESS, ret, "Failed to process valid manifest hierarchy"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 2, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_process_dependency_validate() calls"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.arg0_history[0], + &parent_class_id, "Invalid parent manifest class ID value"); + zassert_equal(suit_mci_manifest_process_dependency_validate_fake.arg1_history[0], + &child_class_id, "Invalid child manifest class ID value"); +} diff --git a/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/testcase.yaml b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/testcase.yaml new file mode 100644 index 000000000000..5b0bfbba91d0 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_authorize_process_dependency/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_authorize_process_dependency: + type: unit + tags: >- + suit + suit_platform + suit_plat_authorize_process_dependency diff --git a/tests/subsys/suit/unit/suit_plat_check_image_match/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_check_image_match/CMakeLists.txt new file mode 100644 index 000000000000..f59ad82f4275 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_check_image_match/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) + +include(../cmake/test_template.cmake) + +project(suit_plat_check_image_match) +target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLATFORM + -DCONFIG_SUIT_STREAM_SINK_DIGEST) +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_check_image_match_sdfw_specific.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_check_image_match.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) diff --git a/tests/subsys/suit/unit/suit_plat_check_image_match/Kconfig b/tests/subsys/suit/unit/suit_plat_check_image_match/Kconfig new file mode 100644 index 000000000000..3f9efe4e184e --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_check_image_match/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_check_image_match/prj.conf b/tests/subsys/suit/unit/suit_plat_check_image_match/prj.conf new file mode 100644 index 000000000000..ce4c9cc534b3 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_check_image_match/prj.conf @@ -0,0 +1,17 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL=y +CONFIG_MOCK_SUIT_PLATFORM=y +CONFIG_MOCK_DIGEST_SINK=y +CONFIG_MOCK_GENERIC_ADDRESS_STREAMER=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_MEMPTR_STORAGE=y +CONFIG_MOCK_SUIT_CRYPTO=y +CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y diff --git a/tests/subsys/suit/unit/suit_plat_check_image_match/src/main.c b/tests/subsys/suit/unit/suit_plat_check_image_match/src/main.c new file mode 100644 index 000000000000..10e2ec5c45e4 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_check_image_match/src/main.c @@ -0,0 +1,866 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define TEST_ENVELOPE_ADDRESS ((uint8_t *)0xabcd) +#define TEST_ENVELOPE_SIZE ((size_t)0xef01) +#define TEST_MEMPTR_STORAGE_HANDLE ((memptr_storage_handle_t)0x2345) +#define TEST_MEMPTR_COMP_ADDRESS ((uint8_t *)0xabcd) +#define TEST_MEMPTR_COMP_SIZE ((size_t)0xef01) + +static int valid_component_number = 1; +static int invalid_component_number = 2; +static intptr_t valid_component_handle = 0x1234; +static struct zcbor_string valid_component_id = {.value = (const uint8_t *)0x1234, .len = 123}; +static uint8_t valid_manifest_digest[] = { + 0xE6, 0x34, 0x39, 0x3D, 0x82, 0x64, 0x93, 0xF4, 0x2C, 0x42, 0xCA, + 0x81, 0x08, 0x82, 0x7E, 0xF6, 0x10, 0x31, 0x47, 0x85, 0xB0, 0xA0, + 0xAF, 0xAE, 0xF4, 0x85, 0xA5, 0x05, 0x14, 0xE8, 0x38, 0x56, +}; +static struct zcbor_string valid_digest = {.value = valid_manifest_digest, + .len = sizeof(valid_manifest_digest)}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static suit_plat_err_t release_fake_func(void *ctx) +{ + return SUIT_SUCCESS; +} + +static int suit_plat_component_id_get_invalid_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(valid_component_handle, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_id_get_correct_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(valid_component_handle, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + *component_id = &valid_component_id; + + return SUIT_SUCCESS; +} + +int suit_plat_retrieve_manifest_invalid_fake_func(suit_component_t component_handle, + const uint8_t **envelope_str, + size_t *envelope_len) +{ + zassert_equal(valid_component_handle, component_handle, "Invalid component handle value"); + zassert_not_null(envelope_str, "The API must provide a valid pointer"); + zassert_not_null(envelope_len, "The API must provide a valid pointer"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +int suit_plat_retrieve_manifest_correct_fake_func(suit_component_t component_handle, + const uint8_t **envelope_str, + size_t *envelope_len) +{ + zassert_equal(valid_component_handle, component_handle, "Invalid component handle value"); + zassert_not_null(envelope_str, "The API must provide a valid pointer"); + zassert_not_null(envelope_len, "The API must provide a valid pointer"); + + *envelope_str = TEST_ENVELOPE_ADDRESS; + *envelope_len = TEST_ENVELOPE_SIZE; + + return SUIT_SUCCESS; +} + +int suit_processor_get_manifest_metadata_invalid_fake_func( + const uint8_t *envelope_str, size_t envelope_len, bool authenticate, + struct zcbor_string *manifest_component_id, struct zcbor_string *digest, + enum suit_cose_alg *alg, unsigned int *seq_num) +{ + zassert_equal(TEST_ENVELOPE_ADDRESS, envelope_str, "Invalid envelope_str"); + zassert_equal(TEST_ENVELOPE_SIZE, envelope_len, "Invalid envelope_len"); + zassert_not_null(digest, "The API must provide a valid pointer"); + zassert_not_null(alg, "The API must provide a valid pointer"); + + return SUIT_ERR_DECODING; +} + +int suit_processor_get_manifest_metadata_correct_fake_func( + const uint8_t *envelope_str, size_t envelope_len, bool authenticate, + struct zcbor_string *manifest_component_id, struct zcbor_string *digest, + enum suit_cose_alg *alg, unsigned int *seq_num) +{ + zassert_equal(TEST_ENVELOPE_ADDRESS, envelope_str, "Invalid envelope_str"); + zassert_equal(TEST_ENVELOPE_SIZE, envelope_len, "Invalid envelope_len"); + zassert_not_null(digest, "The API must provide a valid pointer"); + zassert_not_null(alg, "The API must provide a valid pointer"); + + *alg = suit_cose_sha256; + digest->value = valid_manifest_digest; + digest->len = sizeof(valid_manifest_digest); + + return SUIT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_invalid_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + + *type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_type_invalid_type_ret_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + + *type = SUIT_COMPONENT_TYPE_CACHE_POOL + + 30; /* Arbitrary value added to get type out of bounds */ + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_mem_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_MEM; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_special_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_SOC_SPEC; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_unsupported_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_UNSUPPORTED; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_cand_mfst_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_MFST; + + 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) +{ + 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_INSTLD_MFST; + + 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) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(number, NULL, + "The API must provide a valid number pointer, to decode component ID"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_number_correct_fake_func(struct zcbor_string *component_id, + uint32_t *number) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(number, NULL, + "The API must provide a valid number pointer, to decode component ID"); + + *number = valid_component_number; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_number_invalid_ret_number_fake_func(struct zcbor_string *component_id, + uint32_t *number) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(number, NULL, + "The API must provide a valid number pointer, to decode component ID"); + + *number = invalid_component_number; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_plat_component_impl_data_get_invalid_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(valid_component_handle, handle, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_impl_data_get_correct_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(valid_component_handle, handle, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + *impl_data = TEST_MEMPTR_STORAGE_HANDLE; + + return SUIT_SUCCESS; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_get_invalid_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_get_correct_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + *payload_ptr = TEST_MEMPTR_COMP_ADDRESS; + *payload_size = TEST_MEMPTR_COMP_SIZE; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_digest_sink_get_correct_fake_func(struct stream_sink *sink, + psa_algorithm_t algorithm, + const uint8_t *expected_digest) +{ + zassert_not_null(sink, "The API must provide a valid pointer"); + zassert_not_null(expected_digest, "The API must provide a valid pointer"); + + sink->release = release_fake_func; + + return SUIT_PLAT_SUCCESS; +} + +suit_plat_err_t suit_digest_sink_get_invalid_fake_func(struct stream_sink *sink, + psa_algorithm_t algorithm, + const uint8_t *expected_digest) +{ + zassert_not_null(sink, "The API must provide a valid pointer"); + zassert_not_null(expected_digest, "The API must provide a valid pointer"); + + return SUIT_PLAT_ERR_CRASH; +} + +suit_plat_err_t suit_generic_address_streamer_stream_correct_fake_func(const uint8_t *payload, + size_t payload_size, + struct stream_sink *sink) +{ + zassert_not_null(payload, "The API must provide a valid pointer"); + zassert_not_equal(payload_size, 0, "The API must provide a valid payload size"); + zassert_not_null(sink, "The API must provide a valid pointer"); + + return SUIT_SUCCESS; +} + +suit_plat_err_t suit_generic_address_streamer_stream_invalid_fake_func(const uint8_t *payload, + size_t payload_size, + struct stream_sink *sink) +{ + zassert_not_null(payload, "The API must provide a valid pointer"); + zassert_not_equal(payload_size, 0, "The API must provide a valid payload size"); + zassert_not_null(sink, "The API must provide a valid pointer"); + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +digest_sink_err_t suit_digest_sink_digest_match_invalid_fake_func(void *ctx) +{ + zassert_not_null(ctx, "The API must provide a valid pointer"); + + return DIGEST_SINK_ERR_DIGEST_MISMATCH; +} + +digest_sink_err_t suit_digest_sink_digest_match_correct_fake_func(void *ctx) +{ + zassert_not_null(ctx, "The API must provide a valid pointer"); + + return SUIT_PLAT_SUCCESS; +} + +ZTEST_SUITE(suit_plat_check_image_match_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_check_image_match_tests, test_instld_mfst_OK) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_correct_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_correct_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_SUCCESS, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 1, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_cand_mfst_OK) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_mfst_correct_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_correct_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_correct_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_SUCCESS, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 1, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_instld_mfst_get_manifest_metadata_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_correct_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal( + SUIT_ERR_DECODING, ret, + "Check should have failed - suit_processor_get_manifest_metadata returned error"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 1, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 1, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_instld_mfst_retrieve_manifest_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_mfst_correct_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_invalid_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - suit_plat_retrieve_manifest returned error"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 1, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_decode_component_type_invalid_type_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_invalid_type_ret_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_invalid_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal( + SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - suit_plat_decode_component_type returned invalid type"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 0, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_decode_component_type_unsupported_type_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_unsupported_correct_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_invalid_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal( + SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - suit_plat_decode_component_type returned invalid type"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 0, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_decode_component_type_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_invalid_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_invalid_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - suit_plat_decode_component_type returned error"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 0, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_component_id_get_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_invalid_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_invalid_fake_func; + suit_plat_retrieve_manifest_fake.custom_fake = + suit_plat_retrieve_manifest_invalid_fake_func; + suit_processor_get_manifest_metadata_fake.custom_fake = + suit_processor_get_manifest_metadata_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - suit_plat_component_id_get returned error"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_retrieve_manifest_fake.call_count, 0, + "Incorrect number of suit_plat_retrieve_manifest() calls"); + zassert_equal(suit_processor_get_manifest_metadata_fake.call_count, 0, + "Incorrect number of suit_processor_get_manifest_metadata() calls"); +} + +/**************************************************************************************************/ +ZTEST(suit_plat_check_image_match_tests, test_soc_spec_OK) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_special_correct_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_correct_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + +#ifdef CONFIG_SOC_SERIES_NRF54HX + zassert_equal(SUIT_SUCCESS, ret, "Check have failed: %i", ret); +#else /* CONFIG_SOC_SERIES_NRF54HX */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed for HW other than NRF54H20"); +#endif /* CONFIG_SOC_SERIES_NRF54HX */ + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_soc_spec_invalid_component_number_ret) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_special_correct_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_invalid_ret_number_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - invalid component number"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_soc_spec_invalid_component_number) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_special_correct_fake_func; + suit_plat_decode_component_number_fake.custom_fake = + suit_plat_decode_component_number_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Check should have failed - invalid component number"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_component_number_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_number() calls"); +} + +/**************************************************************************************************/ +ZTEST(suit_plat_check_image_match_tests, test_mem_OK) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_correct_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_correct_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_correct_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_SUCCESS, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 1, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 1, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 1, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_mem_sink_digest_match_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_correct_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_correct_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_FAIL_CONDITION, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 1, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 1, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 1, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_mem_generic_address_streamer_stream_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_correct_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_invalid_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_CRASH, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 1, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 1, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 0, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_mem_digest_sink_get_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_invalid_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_invalid_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_CRASH, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 1, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 0, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_mem_memptr_storage_ptr_get_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_invalid_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_invalid_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_invalid_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_CRASH, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 0, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 0, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} + +ZTEST(suit_plat_check_image_match_tests, test_mem_component_impl_data_get_fail) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_invalid_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_invalid_fake_func; + suit_digest_sink_get_fake.custom_fake = suit_digest_sink_get_invalid_fake_func; + suit_generic_address_streamer_stream_fake.custom_fake = + suit_generic_address_streamer_stream_invalid_fake_func; + suit_digest_sink_digest_match_fake.custom_fake = + suit_digest_sink_digest_match_invalid_fake_func; + + int ret = suit_plat_check_image_match(valid_component_handle, suit_cose_sha256, + &valid_digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Check have failed: %i", ret); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_digest_sink_get_fake.call_count, 0, + "Incorrect number of suit_digest_sink_get() calls"); + zassert_equal(suit_generic_address_streamer_stream_fake.call_count, 0, + "Incorrect number of suit_generic_address_streamer_stream() calls"); + zassert_equal(suit_digest_sink_digest_match_fake.call_count, 0, + "Incorrect number of suit_digest_sink_digest_match() calls"); +} diff --git a/tests/subsys/suit/unit/suit_plat_check_image_match/testcase.yaml b/tests/subsys/suit/unit/suit_plat_check_image_match/testcase.yaml new file mode 100644 index 000000000000..0123f2e923f8 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_check_image_match/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_check_image_match: + type: unit + tags: >- + suit + suit_platform + suit_plat_check_image_match diff --git a/tests/subsys/suit/unit/suit_plat_class_check/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_class_check/CMakeLists.txt new file mode 100644 index 000000000000..8ed3536afe5f --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_class_check/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_class_check) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_class_check.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_manifest_info.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) diff --git a/tests/subsys/suit/unit/suit_plat_class_check/Kconfig b/tests/subsys/suit/unit/suit_plat_class_check/Kconfig new file mode 100644 index 000000000000..2b6852447359 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_class_check/Kconfig @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +config MAX_NUMBER_OF_MANIFEST_CLASS_IDS + int "Maximum number of supported manifest class IDs that can be handled" + range 1 200 + default 8 if SOC_SOC_SERIES_NRF54HX + default 5 if SOC_NRF52840 + default 5 if SOC_POSIX + help + Check SUIT_STORAGE_N_ENVELOPES + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_class_check/prj.conf b/tests/subsys/suit/unit/suit_plat_class_check/prj.conf new file mode 100644 index 000000000000..16884f702b31 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_class_check/prj.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y +CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_MOCK_SUIT_UTILS=y diff --git a/tests/subsys/suit/unit/suit_plat_class_check/src/main.c b/tests/subsys/suit/unit/suit_plat_class_check/src/main.c new file mode 100644 index 000000000000..4f9b369a6438 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_class_check/src/main.c @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +static suit_manifest_class_id_t sample_class_id = {{0xca, 0xd8, 0x52, 0x3a, 0xf8, 0x29, 0x5a, 0x9a, + 0xba, 0x85, 0x2e, 0xa0, 0xb2, 0xf5, 0x77, + 0xc9}}; + +static const suit_uuid_t nordic_vendor_id = {{0x76, 0x17, 0xda, 0xa5, 0x71, 0xfd, 0x5a, 0x85, 0x8f, + 0x94, 0xe2, 0x8d, 0x73, 0x5c, 0xe9, 0xf4}}; + +static intptr_t valid_component_handle = 0x1234; +static struct zcbor_string valid_component_id = {.value = (const uint8_t *)0x1234, .len = 123}; +static struct zcbor_string valid_cid_uuid = {.value = (const uint8_t *)0x5678, .len = 16}; +static struct zcbor_string valid_vid_uuid = {.value = (const uint8_t *)0x9012, .len = 16}; +static struct zcbor_string valid_did_uuid = {.value = (const uint8_t *)0x3456, .len = 16}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static int suit_plat_component_id_get_invalid_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(valid_component_handle, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_id_get_correct_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(valid_component_handle, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + *component_id = &valid_component_id; + + return SUIT_SUCCESS; +} + +int suit_mci_supported_manifest_class_ids_get_correct_fake_func( + suit_manifest_class_info_t *class_info, size_t *size) +{ + zassert_not_null(class_info, "The API must provide a valid class_id pointer"); + zassert_not_null(size, "The API must provide a valid size pointer"); + zassert_not_equal(*size, 0, "Invalid size value. Must be > 0"); + + *size = 1; + class_info[0].class_id = &sample_class_id; + class_info[0].vendor_id = &nordic_vendor_id; + + return SUIT_PLAT_SUCCESS; +} + +int suit_mci_supported_manifest_class_ids_get_invalid_fake_func( + suit_manifest_class_info_t *class_info, size_t *size) +{ + zassert_not_null(class_info, "The API must provide a valid class_id pointer"); + zassert_not_null(size, "The API must provide a valid size pointer"); + zassert_not_equal(*size, 0, "Invalid size value. Must be > 0"); + + return SUIT_PLAT_ERR_SIZE; +} + +static int +suit_plat_component_compatibility_check_invalid_fake_func(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int +suit_plat_component_compatibility_check_correct_fake_func(const suit_manifest_class_id_t *class_id, + struct zcbor_string *component_id) +{ + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + + return SUIT_SUCCESS; +} + +int suit_metadata_uuid_compare_invalid_fake_func(const suit_uuid_t *uuid1, const suit_uuid_t *uuid2) +{ + zassert_not_null(uuid1, "The API must provide a valid uuid1 pointer"); + zassert_not_null(uuid2, "The API must provide a valid uuid2 pointer"); + + return MCI_ERR_MANIFESTCLASSID; +} + +int suit_metadata_uuid_compare_correct_fake_func(const suit_uuid_t *uuid1, const suit_uuid_t *uuid2) +{ + zassert_not_null(uuid1, "The API must provide a valid uuid1 pointer"); + zassert_not_null(uuid2, "The API must provide a valid uuid2 pointer"); + + return SUIT_PLAT_SUCCESS; +} + +ZTEST_SUITE(suit_plat_class_check_cid_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_class_check_cid_tests, test_null_cid_uuid) +{ + int ret = suit_plat_check_cid(valid_component_handle, NULL); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_null_cid_value_uuid) +{ + static struct zcbor_string invalid_cid_uuid = {.value = NULL, .len = 123}; + + int ret = suit_plat_check_cid(valid_component_handle, &invalid_cid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_cid_len_0_uuid) +{ + static struct zcbor_string invalid_cid_uuid = {.value = (const uint8_t *)0x5678, .len = 0}; + + int ret = suit_plat_check_cid(valid_component_handle, &invalid_cid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_invalid_suit_mci_supported_manifest_class_ids_get) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_invalid_fake_func; + + int ret = suit_plat_check_cid(valid_component_handle, &valid_cid_uuid); + + zassert_equal(SUIT_ERR_CRASH, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_invalid_suit_plat_component_id_get) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_invalid_fake_func; + + int ret = suit_plat_check_cid(valid_component_handle, &valid_cid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_invalid_suit_plat_component_compatibility_check) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_invalid_fake_func; + + int ret = suit_plat_check_cid(valid_component_handle, &valid_cid_uuid); + + zassert_equal(SUIT_FAIL_CONDITION, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_invalid_suit_metadata_uuid_compare) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_correct_fake_func; + suit_metadata_uuid_compare_fake.custom_fake = suit_metadata_uuid_compare_invalid_fake_func; + + int ret = suit_plat_check_cid(valid_component_handle, &valid_cid_uuid); + + zassert_equal(SUIT_FAIL_CONDITION, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 1, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_cid_tests, test_OK) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_correct_fake_func; + suit_metadata_uuid_compare_fake.custom_fake = suit_metadata_uuid_compare_correct_fake_func; + + int ret = suit_plat_check_cid(valid_component_handle, &valid_cid_uuid); + + zassert_equal(SUIT_SUCCESS, ret, "Check should have succeeded"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 1, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST_SUITE(suit_plat_class_check_vid_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_class_check_vid_tests, test_null_vid_uuid) +{ + int ret = suit_plat_check_vid(valid_component_handle, NULL); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_null_vid_value_uuid) +{ + static struct zcbor_string invalid_vid_uuid = {.value = NULL, .len = 123}; + + int ret = suit_plat_check_vid(valid_component_handle, &invalid_vid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_vid_len_0_uuid) +{ + static struct zcbor_string invalid_vid_uuid = {.value = (const uint8_t *)0x5678, .len = 0}; + + int ret = suit_plat_check_vid(valid_component_handle, &invalid_vid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 0, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_invalid_suit_mci_supported_manifest_class_ids_get) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_invalid_fake_func; + + int ret = suit_plat_check_vid(valid_component_handle, &valid_vid_uuid); + + zassert_equal(SUIT_ERR_CRASH, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_invalid_suit_plat_component_id_get) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_invalid_fake_func; + + int ret = suit_plat_check_vid(valid_component_handle, &valid_vid_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 0, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_invalid_suit_plat_component_compatibility_check) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_invalid_fake_func; + + int ret = suit_plat_check_vid(valid_component_handle, &valid_vid_uuid); + + zassert_equal(SUIT_FAIL_CONDITION, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 0, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_invalid_suit_metadata_uuid_compare) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_correct_fake_func; + suit_metadata_uuid_compare_fake.custom_fake = suit_metadata_uuid_compare_invalid_fake_func; + + int ret = suit_plat_check_vid(valid_component_handle, &valid_vid_uuid); + + zassert_equal(SUIT_FAIL_CONDITION, ret, "Check should have failed"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 1, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST(suit_plat_class_check_vid_tests, test_OK) +{ + suit_mci_supported_manifest_class_ids_get_fake.custom_fake = + suit_mci_supported_manifest_class_ids_get_correct_fake_func; + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_component_compatibility_check_fake.custom_fake = + suit_plat_component_compatibility_check_correct_fake_func; + suit_metadata_uuid_compare_fake.custom_fake = suit_metadata_uuid_compare_correct_fake_func; + + int ret = suit_plat_check_vid(valid_component_handle, &valid_vid_uuid); + + zassert_equal(SUIT_SUCCESS, ret, "Check should have succeeded"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_supported_manifest_class_ids_get_fake.call_count, 1, + "Incorrect number of suit_mci_supported_manifest_class_ids_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_compatibility_check_fake.call_count, 1, + "Incorrect number of suit_plat_component_compatibility_check() calls"); + zassert_equal(suit_metadata_uuid_compare_fake.call_count, 1, + "Incorrect number of suit_metadata_uuid_compare() calls"); +} + +ZTEST_SUITE(suit_plat_class_check_did_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_class_check_did_tests, test_null_did_uuid) +{ + int ret = suit_plat_check_did(valid_component_handle, NULL); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); +} + +ZTEST(suit_plat_class_check_did_tests, test_null_did_value_uuid) +{ + static struct zcbor_string invalid_did_uuid = {.value = NULL, .len = 123}; + + int ret = suit_plat_check_did(valid_component_handle, &invalid_did_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); +} + +ZTEST(suit_plat_class_check_did_tests, test_did_len_0_uuid) +{ + static struct zcbor_string invalid_did_uuid = {.value = (const uint8_t *)0x5678, .len = 0}; + + int ret = suit_plat_check_did(valid_component_handle, &invalid_did_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); +} + +ZTEST(suit_plat_class_check_did_tests, test_did_valid_did) +{ + int ret = suit_plat_check_did(valid_component_handle, &valid_did_uuid); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMMAND, ret, "Failed to catch null argument"); +} diff --git a/tests/subsys/suit/unit/suit_plat_class_check/testcase.yaml b/tests/subsys/suit/unit/suit_plat_class_check/testcase.yaml new file mode 100644 index 000000000000..cceafd3cff15 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_class_check/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_class_check: + type: unit + tags: >- + suit + suit_platform + suit_plat_class_check diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_component_compatibility/CMakeLists.txt new file mode 100644 index 000000000000..6ebca23f44f5 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_check_component_id) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_component_compatibility.c +) diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/Kconfig b/tests/subsys/suit/unit/suit_plat_component_compatibility/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf b/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf new file mode 100644 index 000000000000..b9afa4d1aba9 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=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 new file mode 100644 index 000000000000..3c3a907f80e6 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/src/main.c @@ -0,0 +1,941 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +static suit_manifest_class_id_t sample_class_id = {{0xca, 0xd8, 0x52, 0x3a, 0xf8, 0x29, 0x5a, 0x9a, + 0xba, 0x85, 0x2e, 0xa0, 0xb2, 0xf5, 0x77, + 0xc9}}; +static int valid_component_number = 1; +static int valid_cpu_id = 2; +intptr_t valid_address = 0x80000; +size_t valid_size = 256; + +static struct zcbor_string valid_component_id = { + .value = (const uint8_t *)0x4321, + .len = 321, +}; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_correct_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = &sample_class_id; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_invalid_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(&valid_component_id, component_id, "Invalid manifest component ID value"); + zassert_not_equal(class_id, NULL, + "The API must provide a valid pointer, to decode manifest class ID"); + *class_id = NULL; + + return SUIT_PLAT_ERR_CRASH; +} + +static int +suit_mci_manifest_class_id_validate_correct_fake_func(const suit_manifest_class_id_t *class_id) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + + return SUIT_PLAT_SUCCESS; +} + +static int suit_mci_manifest_parent_child_declaration_validate_correct_fake_func( + const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + zassert_equal(parent_class_id, &sample_class_id, "Invalid parent manifest class ID value"); + zassert_equal(child_class_id, &sample_class_id, "Invalid child manifest class ID value"); + + return SUIT_PLAT_SUCCESS; +} + +static int suit_mci_manifest_parent_child_declaration_validate_invalid_fake_func( + const suit_manifest_class_id_t *parent_class_id, + const suit_manifest_class_id_t *child_class_id) +{ + zassert_equal(parent_class_id, &sample_class_id, "Invalid parent manifest class ID value"); + zassert_equal(child_class_id, &sample_class_id, "Invalid child manifest class ID value"); + + return SUIT_ERR_UNAUTHORIZED_COMPONENT; +} + +static int +suit_mci_manifest_class_id_validate_invalid_fake_func(const suit_manifest_class_id_t *class_id) +{ + zassert_equal(class_id, &sample_class_id, "Invalid manifest class ID value"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_id_invalid_fake_func(struct zcbor_string *component_id, uint8_t *cpu_id, + intptr_t *run_address, size_t *size) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(cpu_id, NULL, + "The API must provide a valid cpu_id pointer, to decode component ID"); + zassert_not_equal( + run_address, NULL, + "The API must provide a valid run_address pointer, to decode component ID"); + zassert_not_equal(size, NULL, + "The API must provide a valid size pointer, to decode component ID"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_id_correct_fake_func(struct zcbor_string *component_id, uint8_t *cpu_id, + intptr_t *run_address, size_t *size) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(cpu_id, NULL, + "The API must provide a valid cpu_id pointer, to decode component ID"); + zassert_not_equal( + run_address, NULL, + "The API must provide a valid run_address pointer, to decode component ID"); + zassert_not_equal(size, NULL, + "The API must provide a valid size pointer, to decode component ID"); + + *cpu_id = valid_cpu_id; + *run_address = valid_address; + *size = valid_size; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_invalid_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + + *type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_type_mem_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_MEM; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_special_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_SOC_SPEC; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_unsupported_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_UNSUPPORTED; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_cand_mfst_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_MFST; + + 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) +{ + 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_INSTLD_MFST; + + 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) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(number, NULL, + "The API must provide a valid number pointer, to decode component ID"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_number_correct_fake_func(struct zcbor_string *component_id, + uint32_t *number) +{ + zassert_equal(&valid_component_id, component_id, "Invalid component ID value"); + zassert_not_equal(number, NULL, + "The API must provide a valid number pointer, to decode component ID"); + + *number = valid_component_number; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_mci_platform_specific_component_rights_validate_invalid_fake_func( + const suit_manifest_class_id_t *class_id, int platform_specific_component_number) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_component_number, platform_specific_component_number, + "Invalid component number value"); + + return MCI_ERR_NOACCESS; +} + +static int suit_mci_platform_specific_component_rights_validate_correct_fake_func( + const suit_manifest_class_id_t *class_id, int platform_specific_component_number) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_component_number, platform_specific_component_number, + "Invalid component number value"); + + return SUIT_PLAT_SUCCESS; +} + +static int +suit_mci_processor_start_rights_validate_invalid_fake_func(const suit_manifest_class_id_t *class_id, + int processor_id) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_cpu_id, processor_id, "Invalid processor_id value"); + + return MCI_ERR_NOACCESS; +} + +int suit_mci_processor_start_rights_validate_correct_fake_func( + const suit_manifest_class_id_t *class_id, int processor_id) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_cpu_id, processor_id, "Invalid processor_id value"); + + return SUIT_PLAT_SUCCESS; +} + +static int +suit_mci_memory_access_rights_validate_invalid_fake_func(const suit_manifest_class_id_t *class_id, + void *address, size_t mem_size) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_address, (intptr_t)address, "Invalid address value: 0x%X - 0x%X", + valid_address, address); + zassert_equal(valid_size, mem_size, "Invalid processor_id value"); + + return MCI_ERR_NOACCESS; +} + +static int +suit_mci_memory_access_rights_validate_correct_fake_func(const suit_manifest_class_id_t *class_id, + void *address, size_t mem_size) +{ + zassert_equal(&sample_class_id, class_id, "Invalid class ID value"); + zassert_equal(valid_address, (intptr_t)address, "Invalid address value: 0x%X - 0x%X", + valid_address, address); + zassert_equal(valid_size, mem_size, "Invalid processor_id value"); + + return SUIT_PLAT_SUCCESS; +} + +ZTEST_SUITE(suit_plat_component_compatibility_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_component_compatibility_tests, test_null_manifest_class_id) +{ + int ret = suit_plat_component_compatibility_check(NULL, &valid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "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_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_null_component_id) +{ + int ret = suit_plat_component_compatibility_check(&sample_class_id, NULL); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "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_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_invalid_component_id_null_value) +{ + struct zcbor_string invalid_component_id = { + .value = NULL, + .len = 8, + }; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &invalid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "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_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_invalid_component_id_0_len) +{ + struct zcbor_string invalid_component_id = { + .value = (const uint8_t *)0x1234, + .len = 0, + }; + + int ret = suit_plat_component_compatibility_check(&sample_class_id, &invalid_component_id); + + /* Manifest authentication fails */ + zassert_equal(SUIT_ERR_DECODING, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_mci_manifest_class_id_validate_fake.call_count, 0, + "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_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_invalid_validate_manifest_class_id) +{ + suit_mci_manifest_class_id_validate_fake.custom_fake = + suit_mci_manifest_class_id_validate_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, 0, + "Incorrect number of suit_plat_decode_component_type() 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_invalid_decode_component_type) +{ + 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_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_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_decode_component_id) +{ + 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_plat_decode_component_id_fake.custom_fake = + suit_plat_decode_component_id_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_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, + "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_processor_start_rights) +{ + 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_plat_decode_component_id_fake.custom_fake = + suit_plat_decode_component_id_correct_fake_func; + suit_mci_processor_start_rights_validate_fake.custom_fake = + suit_mci_processor_start_rights_validate_invalid_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 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_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, + "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_memory_access_rights) +{ + 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_plat_decode_component_id_fake.custom_fake = + suit_plat_decode_component_id_correct_fake_func; + suit_mci_processor_start_rights_validate_fake.custom_fake = + suit_mci_processor_start_rights_validate_correct_fake_func; + suit_mci_memory_access_rights_validate_fake.custom_fake = + suit_mci_memory_access_rights_validate_invalid_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 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_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, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 1, + "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_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_mem_correct_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 = + suit_mci_processor_start_rights_validate_correct_fake_func; + suit_mci_memory_access_rights_validate_fake.custom_fake = + suit_mci_memory_access_rights_validate_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_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, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_mci_memory_access_rights_validate_fake.call_count, 1, + "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_special_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_special_correct_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_DECODING, 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_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_special_type_invalid_validate_platform_specific_component_rights) +{ + 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_special_correct_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 = + suit_mci_platform_specific_component_rights_validate_invalid_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 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_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, 1, + "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_special_type_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_special_correct_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 = + suit_mci_platform_specific_component_rights_validate_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_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, 1, + "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_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_mfst_correct_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_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_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_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_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_instld_mfst_type_invalid_suit_plat_decode_manifest_class_id) +{ + 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_instld_mfst_correct_fake_func; + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_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_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, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal( + suit_mci_manifest_parent_child_declaration_validate_fake.call_count, 0, + "Incorrect number of suit_mci_manifest_parent_child_declaration_validate() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_invalid_relationship) +{ + 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_instld_mfst_correct_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 = + suit_mci_manifest_parent_child_declaration_validate_invalid_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 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_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, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal( + suit_mci_manifest_parent_child_declaration_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_parent_child_declaration_validate() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_instld_mfst_type_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_instld_mfst_correct_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 = + suit_mci_manifest_parent_child_declaration_validate_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_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, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal( + suit_mci_manifest_parent_child_declaration_validate_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_parent_child_declaration_validate() calls"); +} + +ZTEST(suit_plat_component_compatibility_tests, test_unsupported_type_err) +{ + 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_unsupported_correct_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_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"); +} diff --git a/tests/subsys/suit/unit/suit_plat_component_compatibility/testcase.yaml b/tests/subsys/suit/unit/suit_plat_component_compatibility/testcase.yaml new file mode 100644 index 000000000000..2cb258b5914b --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_component_compatibility/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_component_compatibility: + type: unit + tags: >- + suit + suit_platform + suit_plat_component_compatibility diff --git a/tests/subsys/suit/unit/suit_plat_components/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_components/CMakeLists.txt new file mode 100644 index 000000000000..57aa43bb5275 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_components/CMakeLists.txt @@ -0,0 +1,19 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_suit_plat_components) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_components.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) +target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLATFORM) +target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) diff --git a/tests/subsys/suit/unit/suit_plat_components/Kconfig b/tests/subsys/suit/unit/suit_plat_components/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_components/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_components/prj.conf b/tests/subsys/suit/unit/suit_plat_components/prj.conf new file mode 100644 index 000000000000..20faccb49446 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_components/prj.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_UTILS=y + +CONFIG_MOCK_SUIT_MEMPTR_STORAGE=y diff --git a/tests/subsys/suit/unit/suit_plat_components/src/main.c b/tests/subsys/suit/unit/suit_plat_components/src/main.c new file mode 100644 index 000000000000..ec24c095abb2 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_components/src/main.c @@ -0,0 +1,781 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +uint8_t valid_mem_component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', + 0x41, 0x02, 0x41, 0x00, 0x41, 0x00}; + +uint8_t valid_cand_img_id_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'I', 'M', 'G', 0x41, 0x02}; + +uint8_t valid_cand_mfst_id_value[] = {0x82, 0x49, 0x68, 'C', 'A', 'N', 'D', + '_', 'M', 'F', 'S', 'T', 0x41, 0x02}; + +struct zcbor_string valid_mem_component_id = { + .value = valid_mem_component_id_value, + .len = sizeof(valid_mem_component_id_value), +}; + +struct zcbor_string valid_cand_img_id = { + .value = valid_cand_img_id_value, + .len = sizeof(valid_cand_img_id_value), +}; + +struct zcbor_string valid_cand_mfst_id = { + .value = valid_cand_mfst_id_value, + .len = sizeof(valid_cand_mfst_id_value), +}; + +static memptr_storage_handle_t valid_memptr_storage_handle; +static intptr_t memptr_address = (intptr_t)NULL; + +static suit_component_type_t component_type; + +static suit_component_t component_handles[SUIT_MAX_NUM_COMPONENT_PARAMS]; + +static void mocks_return_values_reset(void) +{ + suit_memptr_storage_get_fake.return_val = SUIT_PLAT_SUCCESS; + suit_memptr_storage_ptr_store_fake.return_val = SUIT_PLAT_SUCCESS; + suit_memptr_storage_release_fake.return_val = SUIT_PLAT_SUCCESS; + suit_plat_decode_component_type_fake.return_val = SUIT_PLAT_SUCCESS; + suit_plat_decode_address_size_fake.return_val = SUIT_PLAT_SUCCESS; +} + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + memptr_address = (intptr_t)NULL; + component_type = 0; + + mocks_return_values_reset(); + + /* release all component handles*/ + for (size_t i = 0; i < SUIT_MAX_NUM_COMPONENT_PARAMS; i++) { + suit_plat_release_component_handle(component_handles[i]); + } + + /* Reset mocks and history again - releasing component handles could + * have influenced them + */ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); +} + +static int suit_plat_decode_component_type_correct_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_not_null(type, "The API must provide a valid pointer"); + + *type = component_type; + return SUIT_PLAT_SUCCESS; +} + +static int suit_memptr_storage_get_correct_fake_func(memptr_storage_handle_t *handle) +{ + zassert_not_null(handle, "The API must provide a valid pointer"); + + *handle = &valid_memptr_storage_handle; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_plat_decode_address_size_correct_fake_func(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size) +{ + + zassert_not_null(component_id, "The API must provide valid pointers"); + zassert_not_null(run_address, "The API must provide valid pointers"); + zassert_not_null(size, "The API must provide valid pointers"); + + *run_address = memptr_address; + (void)size; /* Returned size isn't used and can be ignored */ + + return SUIT_PLAT_SUCCESS; +} + +static void create_valid_component(suit_component_type_t type) +{ + int ret; + + component_type = type; + + suit_memptr_storage_get_fake.custom_fake = suit_memptr_storage_get_correct_fake_func; + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + /* Reset mocks to only look at the results of the next call*/ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); +} + +ZTEST_SUITE(suit_plat_components_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_components_tests, test_create_component_handle_null_component_handle) +{ + int ret = suit_plat_create_component_handle(&valid_mem_component_id, NULL); + + zassert_equal(SUIT_ERR_UNSUPPORTED_PARAMETER, ret, "Failed to catch null argument"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "incorrect number of suit_memptr_storage_ptr_store() calls"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_null_component_id) +{ + int ret = suit_plat_create_component_handle(NULL, &component_handles[0]); + + zassert_equal(SUIT_ERR_UNSUPPORTED_PARAMETER, ret, "Failed to catch null argument"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_too_many_components) +{ + suit_component_t test_handle; + int ret; + + for (size_t i = 0; i < SUIT_MAX_NUM_COMPONENT_PARAMS; i++) { + ret = suit_plat_create_component_handle(&valid_mem_component_id, + &component_handles[i]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + } + + /* Reset mocks to only look at the results of the next call*/ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &test_handle); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, + "Failed to record overflow in " + "components count"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_other_component_type) +{ + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + + component_type = SUIT_COMPONENT_TYPE_SOC_SPEC; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_mem_ok) +{ + struct zcbor_string *component_id; + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_memptr_storage_get_fake.custom_fake = suit_memptr_storage_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_correct_fake_func; + + component_type = SUIT_COMPONENT_TYPE_MEM; + memptr_address = 0x12345000; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + suit_plat_component_id_get(component_handles[0], &component_id); + zassert_true(suit_compare_zcbor_strings(suit_plat_decode_address_size_fake.arg0_val, + component_id)); + + zassert_equal_ptr(suit_memptr_storage_ptr_store_fake.arg0_val, + &valid_memptr_storage_handle); + zassert_equal_ptr(suit_memptr_storage_ptr_store_fake.arg1_val, (uint8_t *)memptr_address); + zassert_equal(suit_memptr_storage_ptr_store_fake.arg2_val, 0); + + suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal_ptr(impl_data, &valid_memptr_storage_handle); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_mem_decode_component_type_fail) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + /* Make sure the component is not allocated */ + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after failed " + "component creation"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_mem_decode_address_size_fail) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_plat_decode_address_size_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + + component_type = SUIT_COMPONENT_TYPE_MEM; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + /* Make sure the component is not allocated */ + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after failed " + "component creation"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_mem_memptr_storage_get_fail) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_correct_fake_func; + suit_memptr_storage_get_fake.return_val = SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; + + component_type = SUIT_COMPONENT_TYPE_MEM; + memptr_address = 0x12345000; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_ERR_CRASH, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + /* Make sure the component is not allocated */ + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after failed " + "component creation"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_cand_img_memptr_storage_get_fail) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_memptr_storage_get_fake.return_val = SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; + + component_type = SUIT_COMPONENT_TYPE_CAND_IMG; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_ERR_CRASH, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + /* Make sure the component is not allocated */ + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after failed " + "component creation"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_mem_memptr_storage_store_fail) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_correct_fake_func; + suit_memptr_storage_get_fake.custom_fake = suit_memptr_storage_get_correct_fake_func; + suit_memptr_storage_ptr_store_fake.return_val = SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; + + component_type = SUIT_COMPONENT_TYPE_MEM; + memptr_address = 0x12345000; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + + zassert_equal(SUIT_ERR_CRASH, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + /* Ensure the memptr_storage has been freed */ + zassert_equal(suit_memptr_storage_release_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_release() calls"); + zassert_equal_ptr(suit_memptr_storage_release_fake.arg0_val, + suit_memptr_storage_ptr_store_fake.arg0_val); + + /* Make sure the component is not allocated */ + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal(ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after failed " + "component creation"); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_cand_img_ok) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_memptr_storage_get_fake.custom_fake = suit_memptr_storage_get_correct_fake_func; + + component_type = SUIT_COMPONENT_TYPE_CAND_IMG; + + ret = suit_plat_create_component_handle(&valid_cand_img_id, &component_handles[0]); + + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal_ptr(impl_data, &valid_memptr_storage_handle); +} + +ZTEST(suit_plat_components_tests, test_create_component_handle_cand_mfst_ok) +{ + void *impl_data; + int ret; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_memptr_storage_get_fake.custom_fake = suit_memptr_storage_get_correct_fake_func; + + component_type = SUIT_COMPONENT_TYPE_CAND_MFST; + + ret = suit_plat_create_component_handle(&valid_cand_mfst_id, &component_handles[0]); + + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_get() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_address_size() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_store() calls"); + + suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal_ptr(impl_data, &valid_memptr_storage_handle); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_invalid_handle) +{ + int ret; + + /* Handle address to low */ + ret = suit_plat_release_component_handle((suit_component_t)0); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + /* Handle address to high */ + ret = suit_plat_release_component_handle((suit_component_t)0xFFFFFF00); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_release() calls"); + + /* Unaligned handle */ + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + /* Reset mocks to only look at the results of the next call*/ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); + + ret = suit_plat_release_component_handle( + (suit_component_t)((intptr_t)component_handles[0] + 1)); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_release() calls"); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_already_released) +{ + int ret; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to release component handle"); + + /* Reset mocks to only look at the results of the next call*/ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_release() calls"); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_decoding_type_failed) +{ + int ret; + + ret = suit_plat_create_component_handle(&valid_mem_component_id, &component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to create valid component handle"); + + /* Reset mocks to only look at the results of the next call*/ + mocks_reset(); + FFF_RESET_HISTORY(); + mocks_return_values_reset(); + + suit_plat_decode_component_type_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_release() calls"); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_storage_release_failed) +{ + void *impl_data; + int ret; + + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + component_type = SUIT_COMPONENT_TYPE_MEM; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + suit_memptr_storage_release_fake.return_val = SUIT_PLAT_ERR_INVAL; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_ERR_CRASH, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_release() calls"); + + /* Verify that component data was not cleared */ + suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal_ptr(impl_data, &valid_memptr_storage_handle); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_mem_mapped_ok) +{ + void *impl_data; + int ret; + + /* TYPE MEM */ + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + component_type = SUIT_COMPONENT_TYPE_MEM; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to release component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_release() calls"); + + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal( + ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after releasing handle"); + + /* TYPE CAND_IMG */ + create_valid_component(SUIT_COMPONENT_TYPE_CAND_IMG); + component_type = SUIT_COMPONENT_TYPE_CAND_IMG; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to release component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_release() calls"); + + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal( + ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after releasing handle"); + + /* TYPE CAND_MFST */ + create_valid_component(SUIT_COMPONENT_TYPE_CAND_MFST); + component_type = SUIT_COMPONENT_TYPE_CAND_MFST; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to release component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_release() calls"); + + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal( + ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after releasing handle"); +} + +ZTEST(suit_plat_components_tests, test_release_component_handle_other_type_ok) +{ + void *impl_data; + int ret; + + /* Currently releasing component of unsupported type will succeed but will not + * do anything apart marking the component as not used. + */ + create_valid_component(SUIT_COMPONENT_TYPE_SOC_SPEC); + + component_type = SUIT_COMPONENT_TYPE_SOC_SPEC; + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + + ret = suit_plat_release_component_handle(component_handles[0]); + zassert_equal(SUIT_SUCCESS, ret, "Failed to release component handle"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_memptr_storage_release_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_release() calls"); + + ret = suit_plat_component_impl_data_get(component_handles[0], &impl_data); + zassert_equal( + ret, SUIT_ERR_UNSUPPORTED_COMPONENT_ID, + "Retrieving impl_data did not fail with appropriate error after releasing handle"); +} + +ZTEST(suit_plat_components_tests, test_impl_data_set_component_not_created) +{ + int ret; + uint8_t data; + + ret = suit_plat_component_impl_data_set(component_handles[0], &data); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); +} + +ZTEST(suit_plat_components_tests, test_impl_data_get_component_not_created) +{ + int ret; + uint8_t *data_out; + + ret = suit_plat_component_impl_data_get(component_handles[0], (void **)&data_out); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); +} + +ZTEST(suit_plat_components_tests, test_impl_data_set_get_ok) +{ + int ret; + uint8_t data; + uint8_t *data_out; + + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + + ret = suit_plat_component_impl_data_set(component_handles[0], &data); + zassert_equal(SUIT_SUCCESS, ret, "Setting implementation data failed"); + + ret = suit_plat_component_impl_data_get(component_handles[0], (void **)&data_out); + zassert_equal(SUIT_SUCCESS, ret, "Getting implementation data failed"); + + zassert_equal_ptr(&data, data_out); +} + +ZTEST(suit_plat_components_tests, test_component_id_get_component_not_created) +{ + int ret; + struct zcbor_string *component_id_out; + + ret = suit_plat_component_id_get(component_handles[0], &component_id_out); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); +} + +ZTEST(suit_plat_components_tests, test_component_id_get_component_ok) +{ + int ret; + struct zcbor_string *component_id_out; + + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + + ret = suit_plat_component_id_get(component_handles[0], &component_id_out); + zassert_equal(SUIT_SUCCESS, ret, "Getting component id failed"); + zassert_true(suit_compare_zcbor_strings(component_id_out, &valid_mem_component_id)); +} + +ZTEST(suit_plat_components_tests, test_type_get_component_not_created) +{ + int ret; + suit_component_type_t type_out; + + ret = suit_plat_component_type_get(component_handles[0], &type_out); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); +} + +ZTEST(suit_plat_components_tests, test_type_get_decoding_failed) +{ + int ret; + suit_component_type_t type_out; + + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + + suit_plat_decode_component_type_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + + ret = suit_plat_component_type_get(component_handles[0], &type_out); + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Incorrect returned error code"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); +} + +ZTEST(suit_plat_components_tests, test_type_get_mem_ok) +{ + int ret; + suit_component_type_t type_out; + + create_valid_component(SUIT_COMPONENT_TYPE_MEM); + + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_correct_fake_func; + component_type = SUIT_COMPONENT_TYPE_MEM; + + ret = suit_plat_component_type_get(component_handles[0], &type_out); + zassert_equal(SUIT_SUCCESS, ret, "Getting component type failed"); + + zassert_equal(type_out, SUIT_COMPONENT_TYPE_MEM, "Incorrect returned component type"); + + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); +} diff --git a/tests/subsys/suit/unit/suit_plat_components/testcase.yaml b/tests/subsys/suit/unit/suit_plat_components/testcase.yaml new file mode 100644 index 000000000000..9a17e9e29db3 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_components/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_components: + type: unit + tags: >- + suit + suit_platform + suit_plat_components diff --git a/tests/subsys/suit/unit/suit_plat_digest_cache/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_digest_cache/CMakeLists.txt new file mode 100644 index 000000000000..a799ae651067 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_digest_cache/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_digest_cache) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_digest_cache.c +) diff --git a/tests/subsys/suit/unit/suit_plat_digest_cache/Kconfig b/tests/subsys/suit/unit/suit_plat_digest_cache/Kconfig new file mode 100644 index 000000000000..0bd73c3fffd1 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_digest_cache/Kconfig @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +config SUIT_DIGEST_CACHE_SIZE + int "Maximum number of entries in the digest cache" + default 3 + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_digest_cache/prj.conf b/tests/subsys/suit/unit/suit_plat_digest_cache/prj.conf new file mode 100644 index 000000000000..fb6bb15906da --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_digest_cache/prj.conf @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_CRYPTO=y +CONFIG_MOCK_SUIT_KERNEL=y +CONFIG_MOCK_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y + +CONFIG_SUIT_DIGEST_CACHE_SIZE=3 diff --git a/tests/subsys/suit/unit/suit_plat_digest_cache/src/main.c b/tests/subsys/suit/unit/suit_plat_digest_cache/src/main.c new file mode 100644 index 000000000000..d8d28585a637 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_digest_cache/src/main.c @@ -0,0 +1,561 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +static uint8_t component_ids_mem[][4] = { + {0x1, 0x2, 0x3, 0x4}, + {0xA, 0xB, 0xC}, + {0x2, 0x4, 0x8, 0x10}, + {0x4, 0x3, 0x2, 0x1}, + {0x11, 0x22, 0x33, 0x44}, +}; + +static size_t component_id_lengths[] = {4, 3, 4, 4, 4}; + +static uint8_t component_id_copies_mem[ARRAY_SIZE(component_ids_mem)][4]; + +static uint8_t digests_mem[][8] = { + {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}, + {0xAA, 0xBB, 0xDD, 0xCC, 0xDD, 0xEE, 0xFF}, + {0x12, 0x34, 0x56, 0x78, 0x9A, 0xAB, 0xCD, 0xEF}, + {0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02}, + {0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22} +}; + +static size_t digest_lengths[] = {8, 7, 8, 8, 8}; + +static uint8_t digest_copies_mem[ARRAY_SIZE(digests_mem)][8]; + +static struct zcbor_string m_component_id_for_fake; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + suit_plat_digest_cache_remove_all(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static void *suite_setup(void) +{ + memcpy(component_id_copies_mem, component_ids_mem, sizeof(component_id_copies_mem)); + memcpy(digest_copies_mem, digests_mem, sizeof(digest_copies_mem)); + + return NULL; +} + +ZTEST_SUITE(suit_plat_digest_cache_tests, NULL, suite_setup, test_before, NULL, NULL); + +static int add_digest_for_component(int index) +{ + int ret = 0; + struct zcbor_string component_id; + struct zcbor_string digest; + + if (index < sizeof(component_id_lengths) / sizeof(size_t)) { + component_id.len = component_id_lengths[index]; + component_id.value = component_ids_mem[index]; + digest.len = digest_lengths[index]; + digest.value = digests_mem[index]; + + ret = suit_plat_digest_cache_add(&component_id, suit_cose_sha256, &digest); + } + + return ret; +} + +static int remove_digest(int index) +{ + int ret; + struct zcbor_string component_id; + + if (index < sizeof(component_id_lengths) / sizeof(size_t)) { + component_id.len = component_id_lengths[index]; + component_id.value = component_ids_mem[index]; + + ret = suit_plat_digest_cache_remove(&component_id); + } + + return ret; +} + +static void fill_cache(void) +{ + int ret; + + ret = add_digest_for_component(0); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + ret = add_digest_for_component(1); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + ret = add_digest_for_component(2); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); +} + +static void verify_matching_component_in_cache(int index) +{ + int ret; + /* The data of the component_id and digest is copied to make sure the cache compares + * the contents of the strings, not their pointers + */ + struct zcbor_string component_id_copy; + struct zcbor_string digest_copy; + + if (index < sizeof(component_id_lengths) / sizeof(size_t)) { + component_id_copy.len = component_id_lengths[index]; + component_id_copy.value = component_id_copies_mem[index]; + digest_copy.len = digest_lengths[index]; + digest_copy.value = digest_copies_mem[index]; + + ret = suit_plat_digest_cache_compare(&component_id_copy, suit_cose_sha256, + &digest_copy); + + zassert_equal(SUIT_SUCCESS, ret, + "Matching digest for a given component ID" + " was not found"); + } +} + +static void verify_component_missing_from_cache(int index) +{ + int ret; + + struct zcbor_string component_id; + + if (index < sizeof(component_id_lengths) / sizeof(size_t)) { + component_id.len = component_id_lengths[index]; + component_id.value = component_ids_mem[index]; + + /* Value of the digest does not matter, it won't be verified due to the missing + * component ID + */ + ret = suit_plat_digest_cache_compare(&component_id, suit_cose_sha256, NULL); + + zassert_equal(SUIT_ERR_MISSING_COMPONENT, ret, + "Attempt to retrieve missing does not report correctly"); + } +} + +static void verify_cache_is_empty(void) +{ + int ret; + struct zcbor_string component_id; + + for (size_t i = 0; i < sizeof(component_id_lengths) / sizeof(size_t); i++) { + component_id.len = component_id_lengths[i]; + component_id.value = component_ids_mem[i]; + + /* Value of the digest does not matter, it won't be verified due to the missing + * component ID + */ + ret = suit_plat_digest_cache_compare(&component_id, suit_cose_sha256, NULL); + zassert_equal(SUIT_ERR_MISSING_COMPONENT, ret, "Cache is not empty"); + } +} + +static int suit_plat_component_id_get_correct_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + *component_id = &m_component_id_for_fake; + + return SUIT_SUCCESS; +} + +ZTEST(suit_plat_digest_cache_tests, test_cache_add_single) +{ + int ret; + + ret = add_digest_for_component(0); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + + verify_matching_component_in_cache(0); + /* Ensure the mutex was locked the same number of times as it was unlocked*/ + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_cache_fill) +{ + fill_cache(); + + verify_matching_component_in_cache(0); + verify_matching_component_in_cache(1); + verify_matching_component_in_cache(2); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_cache_add_when_full) +{ + int ret; + + fill_cache(); + + ret = add_digest_for_component(3); + zassert_equal(SUIT_ERR_OVERFLOW, ret, + "Adding element to full cache does not return overflow"); + + verify_component_missing_from_cache(3); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_get_uncached_element) +{ + fill_cache(); + + verify_component_missing_from_cache(3); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_add_null_digest) +{ + int ret; + struct zcbor_string component_id; + + component_id.len = component_id_lengths[0]; + component_id.value = component_ids_mem[0]; + + ret = suit_plat_digest_cache_add(&component_id, suit_cose_sha256, NULL); + + zassert_equal(SUIT_ERR_UNSUPPORTED_PARAMETER, ret, + "Passing NULL digest parameter to suit_plat_digest_cache_add" + " does not report correctly"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_add_null_component_id) +{ + int ret; + struct zcbor_string digest; + + digest.len = digest_lengths[0]; + digest.value = digests_mem[0]; + + ret = suit_plat_digest_cache_add(NULL, suit_cose_sha256, &digest); + + zassert_equal(SUIT_ERR_UNSUPPORTED_PARAMETER, ret, + "Passing NULL component_id parameter to suit_plat_digest_cache_add" + " does not report correctly"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_replace_existing_component) +{ + int ret; + struct zcbor_string component_id; + struct zcbor_string digest; + struct zcbor_string digest_copy; + + fill_cache(); + + component_id.len = component_id_lengths[1]; + component_id.value = component_ids_mem[1]; + digest.len = digest_lengths[4]; + digest.value = digests_mem[4]; + + /* Replace the component digest with a new digest */ + ret = suit_plat_digest_cache_add(&component_id, suit_cose_sha256, &digest); + zassert_equal(SUIT_SUCCESS, ret, "Replacing the component digest failed"); + + digest_copy.len = digest_lengths[4]; + digest_copy.value = digest_copies_mem[4]; + ret = suit_plat_digest_cache_compare(&component_id, suit_cose_sha256, &digest_copy); + + zassert_equal(SUIT_SUCCESS, ret, "Verifying the replaced component ID failed"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_not_matching_same_length) +{ + int ret; + struct zcbor_string mismatched_digest; + struct zcbor_string component_id; + + component_id.len = component_id_lengths[0]; + component_id.value = component_ids_mem[0]; + + ret = add_digest_for_component(0); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + + mismatched_digest.len = digest_lengths[3]; + mismatched_digest.value = digests_mem[3]; + + ret = suit_plat_digest_cache_compare(&component_id, suit_cose_sha256, &mismatched_digest); + zassert_equal(SUIT_FAIL_CONDITION, ret, + "Comparing against a mismatched digest" + " does not return the correct error code"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_not_matching_same_content_different_length) +{ + int ret; + struct zcbor_string mismatched_digest; + struct zcbor_string component_id; + + component_id.len = component_id_lengths[0]; + component_id.value = component_ids_mem[0]; + + ret = add_digest_for_component(0); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + + mismatched_digest.len = digest_lengths[0] - 1; + mismatched_digest.value = digests_mem[0]; + + ret = suit_plat_digest_cache_compare(&component_id, suit_cose_sha256, &mismatched_digest); + zassert_equal(SUIT_FAIL_CONDITION, ret, + "Comparing against a mismatched digest" + " does not return the correct error code"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_single) +{ + int ret; + + fill_cache(); + + ret = remove_digest(1); + zassert_equal(SUIT_SUCCESS, ret, "Removing element from cache failed"); + + verify_component_missing_from_cache(1); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_removing_from_full_cache_frees_slot) +{ + int ret; + + fill_cache(); + + ret = remove_digest(1); + zassert_equal(SUIT_SUCCESS, ret, "Removing element from cache failed"); + + ret = add_digest_for_component(3); + zassert_equal(SUIT_SUCCESS, ret, "Adding element to cache failed"); + + verify_matching_component_in_cache(3); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_all) +{ + int ret; + + fill_cache(); + + ret = suit_plat_digest_cache_remove_all(); + + zassert_equal(SUIT_SUCCESS, ret, "Removing all elements from cache failed"); + + verify_cache_is_empty(); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_all_one_by_one) +{ + int ret; + + fill_cache(); + + ret = remove_digest(0); + zassert_equal(SUIT_SUCCESS, ret, "Removing element from cache failed"); + + ret = remove_digest(1); + zassert_equal(SUIT_SUCCESS, ret, "Removing element from cache failed"); + + ret = remove_digest(2); + zassert_equal(SUIT_SUCCESS, ret, "Removing element from cache failed"); + + verify_cache_is_empty(); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_suit_plat_digest_cache_remove_by_handle_invalid_handle) +{ + int ret; + int dummy = 0; + suit_component_t handle = (intptr_t)&dummy; /* just ensure that it's a valid address */ + + fill_cache(); + + suit_plat_component_id_get_fake.return_val = SUIT_ERR_MISSING_COMPONENT; + + ret = suit_plat_digest_cache_remove_by_handle(handle); + + zassert_equal(SUIT_ERR_MISSING_COMPONENT, ret, + "Removing based on unavailable handle does not report correctly"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.arg0_val, handle, + "Incorrect handle passed to suit_plat_component_id_get()"); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_suit_plat_digest_cache_remove_by_handle) +{ + int ret; + int dummy = 0; + suit_component_t handle = (intptr_t)&dummy; /* just ensure that it's a valid address */ + + fill_cache(); + + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + + m_component_id_for_fake.len = component_id_lengths[0]; + m_component_id_for_fake.value = component_ids_mem[0]; + + ret = suit_plat_digest_cache_remove_by_handle(handle); + + zassert_equal(SUIT_SUCCESS, ret, + "Removing based on unavailable handle does not report correctly"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.arg0_val, handle, + "Incorrect handle passed to suit_plat_component_id_get()"); + + verify_component_missing_from_cache(0); + verify_matching_component_in_cache(1); /* Verify other components were not deleted */ + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_suit_plat_digest_cache_remove_by_handle_2) +{ + int ret; + int dummy = 0; + suit_component_t handle = (intptr_t)&dummy; /* just ensure that it's a valid address */ + + fill_cache(); + + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + + m_component_id_for_fake.len = component_id_lengths[1]; + m_component_id_for_fake.value = component_ids_mem[1]; + + ret = suit_plat_digest_cache_remove_by_handle(handle); + + zassert_equal(SUIT_SUCCESS, ret, + "Removing based on unavailable handle does not report correctly"); + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_component_id_get_fake.arg0_val, handle, + "Incorrect handle passed to suit_plat_component_id_get()"); + + verify_component_missing_from_cache(1); + + zassert_equal(k_mutex_lock_fake.call_count, k_mutex_unlock_fake.call_count); +} + +ZTEST(suit_plat_digest_cache_tests, test_add_mutex_lock_failed) +{ + int ret = 0; + + k_mutex_lock_fake.return_val = -EAGAIN; + + ret = add_digest_for_component(0); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failing to lock mutex did not result in correct error"); + + /* Do not fail locking the mutex on calls used to verify cache state */ + k_mutex_lock_fake.return_val = 0; + verify_component_missing_from_cache(0); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_mutex_lock_failed) +{ + int ret = 0; + + fill_cache(); + + k_mutex_lock_fake.return_val = -EAGAIN; + + ret = remove_digest(0); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failing to lock mutex did not result in correct error"); + + /* Do not fail locking the mutex on calls used to verify cache state */ + k_mutex_lock_fake.return_val = 0; + verify_matching_component_in_cache(0); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_all_mutex_lock_failed) +{ + int ret = 0; + + fill_cache(); + + k_mutex_lock_fake.return_val = -EAGAIN; + + ret = suit_plat_digest_cache_remove_all(); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failing to lock mutex did not result in correct error"); + + /* Do not fail locking the mutex on calls used to verify cache state */ + k_mutex_lock_fake.return_val = 0; + verify_matching_component_in_cache(0); + verify_matching_component_in_cache(1); + verify_matching_component_in_cache(2); +} + +ZTEST(suit_plat_digest_cache_tests, test_remove_by_handle_mutex_lock_failed) +{ + int ret = 0; + int dummy = 0; + suit_component_t handle = (intptr_t)&dummy; /* just ensure that it's a valid address */ + + fill_cache(); + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + + m_component_id_for_fake.len = component_id_lengths[0]; + m_component_id_for_fake.value = component_ids_mem[0]; + + k_mutex_lock_fake.return_val = -EAGAIN; + + ret = suit_plat_digest_cache_remove_by_handle(handle); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failing to lock mutex did not result in correct error"); + + /* Do not fail locking the mutex on calls used to verify cache state */ + k_mutex_lock_fake.return_val = 0; + verify_matching_component_in_cache(0); +} + +ZTEST(suit_plat_digest_cache_tests, test_compare_mutex_lock_failed) +{ + int ret = 0; + struct zcbor_string component_id_copy; + struct zcbor_string digest_copy; + + fill_cache(); + + component_id_copy.len = component_id_lengths[0]; + component_id_copy.value = component_id_copies_mem[0]; + digest_copy.len = digest_lengths[0]; + digest_copy.value = digest_copies_mem[0]; + + k_mutex_lock_fake.return_val = -EAGAIN; + + ret = suit_plat_digest_cache_compare(&component_id_copy, suit_cose_sha256, &digest_copy); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failing to lock mutex did not result in correct error"); +} diff --git a/tests/subsys/suit/unit/suit_plat_digest_cache/testcase.yaml b/tests/subsys/suit/unit/suit_plat_digest_cache/testcase.yaml new file mode 100644 index 000000000000..2f65ca3fc9b7 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_digest_cache/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_digest_cache: + type: unit + tags: >- + suit + suit_platform + suit_plat_digest_cache diff --git a/tests/subsys/suit/unit/suit_plat_memptr_size_update/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_memptr_size_update/CMakeLists.txt new file mode 100644 index 000000000000..6472ce3a8879 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_memptr_size_update/CMakeLists.txt @@ -0,0 +1,16 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(suit_plat_digest_cache) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_memptr_size_update.c +) diff --git a/tests/subsys/suit/unit/suit_plat_memptr_size_update/Kconfig b/tests/subsys/suit/unit/suit_plat_memptr_size_update/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_memptr_size_update/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_memptr_size_update/prj.conf b/tests/subsys/suit/unit/suit_plat_memptr_size_update/prj.conf new file mode 100644 index 000000000000..3690b6c807fc --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_memptr_size_update/prj.conf @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y +CONFIG_MOCK_SUIT_MEMPTR_STORAGE=y diff --git a/tests/subsys/suit/unit/suit_plat_memptr_size_update/src/main.c b/tests/subsys/suit/unit/suit_plat_memptr_size_update/src/main.c new file mode 100644 index 000000000000..e8d0d39f1890 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_memptr_size_update/src/main.c @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define TEST_COMPONENT_HANDLE ((suit_component_t)0x123) +#define TEST_COMPONENT_ID ((struct zcbor_string *)0x456) +#define TEST_MEMPTR_COMP_ADDRESS ((uint8_t *)0xabcd) +#define TEST_MEMPTR_COMP_SIZE ((size_t)0xef01) +#define TEST_MEMPTR_STORAGE_HANDLE ((memptr_storage_handle_t)0x2345) +#define TEST_NEW_SIZE ((size_t)256) +#define TEST_RUN_ADDRESS ((intptr_t)0x12345) +#define TEST_COMPONENT_SIZE_SMALLER ((size_t)128) +#define TEST_COMPONENT_SIZE_BIGGER ((size_t)512) + +static size_t smaller_component_size = 128, bigger_component_size = 512; + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +static int suit_plat_component_id_get_invalid_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(TEST_COMPONENT_HANDLE, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_id_get_correct_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(TEST_COMPONENT_HANDLE, handle, "Invalid component handle value"); + zassert_not_null(component_id, "The API must provide a valid pointer"); + + *component_id = TEST_COMPONENT_ID; + + return SUIT_SUCCESS; +} + +static int suit_plat_decode_address_size_invalid_fake_func(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size) +{ + zassert_equal(TEST_COMPONENT_ID, component_id, "Invalid component_id"); + zassert_not_null(run_address, "The API must provide a valid pointer"); + zassert_not_null(size, "The API must provide a valid pointer"); + + return SUIT_PLAT_ERR_CBOR_DECODING; +} + +static int +suit_plat_decode_address_size_smaller_correct_fake_func(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size) +{ + zassert_equal(TEST_COMPONENT_ID, component_id, "Invalid component_id"); + zassert_not_null(run_address, "The API must provide a valid pointer"); + zassert_not_null(size, "The API must provide a valid pointer"); + + *run_address = TEST_RUN_ADDRESS; + *size = TEST_COMPONENT_SIZE_SMALLER; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_plat_decode_address_size_bigger_correct_fake_func(struct zcbor_string *component_id, + intptr_t *run_address, + size_t *size) +{ + zassert_equal(TEST_COMPONENT_ID, component_id, "Invalid component_id"); + zassert_not_null(run_address, "The API must provide a valid pointer"); + zassert_not_null(size, "The API must provide a valid pointer"); + + *run_address = TEST_RUN_ADDRESS; + *size = TEST_COMPONENT_SIZE_BIGGER; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_plat_component_impl_data_get_invalid_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(TEST_COMPONENT_HANDLE, handle, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_impl_data_get_correct_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(TEST_COMPONENT_HANDLE, handle, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + *impl_data = TEST_MEMPTR_STORAGE_HANDLE; + + return SUIT_SUCCESS; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_get_invalid_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_get_correct_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + *payload_ptr = TEST_MEMPTR_COMP_ADDRESS; + *payload_size = TEST_MEMPTR_COMP_SIZE; + + return SUIT_PLAT_SUCCESS; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_store_invalid_fake_func(memptr_storage_handle_t handle, + const uint8_t *payload_ptr, size_t payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static suit_memptr_storage_err_t +suit_memptr_storage_ptr_store_correct_fake_func(memptr_storage_handle_t handle, + const uint8_t *payload_ptr, size_t payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + + return SUIT_PLAT_SUCCESS; +} + +ZTEST_SUITE(suit_plat_memptr_size_update_tests, NULL, NULL, test_before, NULL, NULL); + +ZTEST(suit_plat_memptr_size_update_tests, test_invalid_suit_plat_component_id_get) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_invalid_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_invalid_suit_plat_decode_address_size) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_invalid_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_valid_suit_plat_decode_address_size_smaller) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_smaller_correct_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_UNSUPPORTED_PARAMETER, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_valid_suit_plat_decode_address_size_bigger) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_bigger_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_invalid_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_invalid_suit_memptr_storage_ptr_get) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_bigger_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_invalid_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 0, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_invalid_suit_memptr_storage_ptr_store) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_bigger_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_memptr_storage_ptr_store_fake.custom_fake = + suit_memptr_storage_ptr_store_invalid_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_ERR_CRASH, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 1, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} + +ZTEST(suit_plat_memptr_size_update_tests, test_all_OK) +{ + suit_plat_component_id_get_fake.custom_fake = suit_plat_component_id_get_correct_fake_func; + suit_plat_decode_address_size_fake.custom_fake = + suit_plat_decode_address_size_bigger_correct_fake_func; + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_correct_fake_func; + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_correct_fake_func; + suit_memptr_storage_ptr_store_fake.custom_fake = + suit_memptr_storage_ptr_store_correct_fake_func; + + int ret = suit_plat_memptr_size_update(TEST_COMPONENT_HANDLE, TEST_NEW_SIZE); + + zassert_equal(SUIT_SUCCESS, ret, "Failed to catch null argument"); + + /* Check expected call counts for fake functions */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_mci_manifest_class_id_validate() calls"); + zassert_equal(suit_plat_decode_address_size_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_id() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_mci_processor_start_rights_validate() calls"); + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, 1, + "Incorrect number of suit_mci_memory_access_rights_validate() calls"); +} diff --git a/tests/subsys/suit/unit/suit_plat_memptr_size_update/testcase.yaml b/tests/subsys/suit/unit/suit_plat_memptr_size_update/testcase.yaml new file mode 100644 index 000000000000..902ba1a970c8 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_memptr_size_update/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.suit_plat_memptr_size_update: + type: unit + tags: >- + suit + suit_platform + suit_plat_memptr_size_update diff --git a/tests/subsys/suit/unit/suit_plat_override_image_size/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_override_image_size/CMakeLists.txt new file mode 100644 index 000000000000..f1b19a060107 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_override_image_size/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(plat_override_image_size) + +target_include_directories(testbinary PRIVATE ${SUIT_SUBSYS_DIR}/platform/include) +target_compile_options(test_interface INTERFACE -DCONFIG_SUIT_PLATFORM) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_components.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_error_convert.c +) diff --git a/tests/subsys/suit/unit/suit_plat_override_image_size/Kconfig b/tests/subsys/suit/unit/suit_plat_override_image_size/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_override_image_size/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_override_image_size/prj.conf b/tests/subsys/suit/unit/suit_plat_override_image_size/prj.conf new file mode 100644 index 000000000000..8af41aa236e9 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_override_image_size/prj.conf @@ -0,0 +1,11 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_MEMPTR_STORAGE=y +CONFIG_MOCK_SUIT_PLAT_DECODE_UTIL=y +CONFIG_MOCK_SUIT_LOG=y diff --git a/tests/subsys/suit/unit/suit_plat_override_image_size/src/main.c b/tests/subsys/suit/unit/suit_plat_override_image_size/src/main.c new file mode 100644 index 000000000000..5e775b2fef6a --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_override_image_size/src/main.c @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define TEST_FAKE_ADDRESS ((intptr_t)0xDEADBEEF) +#define TEST_FAKE_SIZE ((size_t)42) + +static uint8_t component_id_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, + 0x45, 0x1A, 0xC0, 0xFE, 0x00, 0x00, 0x41, 0x04}; + +static struct zcbor_string component_id = { + .value = component_id_value, + .len = sizeof(component_id_value), +}; + +static suit_component_t component; + +static suit_plat_err_t +suit_plat_decode_component_type_fake_mem_ok(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + *type = SUIT_COMPONENT_TYPE_MEM; + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t suit_plat_decode_component_type_fake_false(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_type_fake_cand_img_ok(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + *type = SUIT_COMPONENT_TYPE_CAND_IMG; + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t suit_plat_decode_address_size_fake_ok(struct zcbor_string *component_id, + intptr_t *run_address, size_t *size) +{ + *run_address = TEST_FAKE_ADDRESS; + *size = TEST_FAKE_SIZE; + return SUIT_PLAT_SUCCESS; +} + +static int suit_memptr_storage_ptr_get_fake_invalid_record(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static int suit_memptr_storage_ptr_store_fake_unallocated_record(memptr_storage_handle_t handle, + const uint8_t *payload_ptr, + size_t payload_size) +{ + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); + + /* Create MEM component handle */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_fake_mem_ok; + suit_plat_decode_address_size_fake.custom_fake = suit_plat_decode_address_size_fake_ok; + + int err = suit_plat_create_component_handle(&component_id, &component); + + zassert_equal(SUIT_SUCCESS, err, "test setup error - create_component_handle failed: %d", + err); +} + +static void test_after(void *data) +{ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_fake_mem_ok; + + int err = suit_plat_release_component_handle(component); + + zassert_equal(SUIT_SUCCESS, err, + "test teardown error - suit_plat_release_component failed: %d", err); +} + +ZTEST_SUITE(suit_platform_override_image_size_tests, NULL, NULL, test_before, test_after, NULL); + +ZTEST(suit_platform_override_image_size_tests, test_suit_plat_override_image_size_init_and_override) +{ + /* GIVEN a MEM-type component */ + /* WHEN a component handle is created (in test setup step) */ + /* THEN memptr_storage size should be set to 0 */ + int expected_call_count = 1; + size_t expected_size = 0; + + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, expected_call_count, + "Wrong initial size store call count", + suit_memptr_storage_ptr_store_fake.call_count, expected_call_count); + zassert_equal(suit_memptr_storage_ptr_store_fake.arg2_history[0], expected_size, + "Wrong initial size: %d instead of %d", + suit_memptr_storage_ptr_store_fake.arg2_history[0], expected_size); + + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + + zassert_equal(SUIT_SUCCESS, err, "Failed to override image size: %d", err); + + /* THEN memptr_storage size should be updated to given value */ + expected_call_count = 2; + expected_size = TEST_FAKE_SIZE; + zassert_equal(suit_memptr_storage_ptr_store_fake.call_count, expected_call_count, + "Wrong size store call count: %d instead of %d", + suit_memptr_storage_ptr_store_fake.call_count, expected_call_count); + zassert_equal(suit_memptr_storage_ptr_store_fake.arg2_history[1], expected_size, + "Wrong size: %d instead of %d", + suit_memptr_storage_ptr_store_fake.arg2_history[1], expected_size); +} + +ZTEST(suit_platform_override_image_size_tests, + test_suit_plat_override_image_size_wrong_component_type) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN internal function call is going to fail */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_fake_false; + + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_DECODING; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} + +ZTEST(suit_platform_override_image_size_tests, test_suit_plat_override_image_size_fail_get) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN internal function is going to fail */ + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_fake_invalid_record; + + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_CRASH; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} + +ZTEST(suit_platform_override_image_size_tests, test_suit_plat_override_image_size_fail_store) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN internal function is going to fail */ + suit_memptr_storage_ptr_store_fake.custom_fake = + suit_memptr_storage_ptr_store_fake_unallocated_record; + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_CRASH; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} + +ZTEST(suit_platform_override_image_size_tests, + test_suit_plat_override_image_size_component_released) +{ + /* GIVEN a released MEM-type component */ + suit_memptr_storage_release_fake.return_val = SUIT_PLAT_SUCCESS; + suit_plat_release_component_handle(component); + + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); + + /* Cleanup: create component to satisfy test_after */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_fake_mem_ok; + suit_plat_decode_address_size_fake.custom_fake = suit_plat_decode_address_size_fake_ok; + err = suit_plat_create_component_handle(&component_id, &component); + zassert_equal(SUIT_SUCCESS, err, "test setup error - create_component_handle failed: %d", + err); +} + +ZTEST(suit_platform_override_image_size_tests, + test_suit_plat_override_image_size_unsupported_component_type) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN an unsupported component type is used */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_fake_cand_img_ok; + + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_UNSUPPORTED_COMMAND; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} + +ZTEST(suit_platform_override_image_size_tests, + test_suit_plat_override_image_size_fail_decode_address_size) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN internal function is going to fail */ + suit_plat_decode_address_size_fake.custom_fake = NULL; + suit_plat_decode_address_size_fake.return_val = SUIT_PLAT_ERR_CBOR_DECODING; + /* WHEN size override is called */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} + +ZTEST(suit_platform_override_image_size_tests, test_suit_plat_override_image_size_exceeding_size) +{ + /* GIVEN a MEM-type component (created in test setup step)*/ + /* WHEN size override is called with size exceeding the boundaries */ + int err = suit_plat_override_image_size(component, TEST_FAKE_SIZE + 1); + /* THEN appropriate error code is returned */ + int expected_error = SUIT_ERR_UNSUPPORTED_PARAMETER; + + zassert_equal(expected_error, err, "Unexpected error code: %d instead of %d", err, + expected_error); +} diff --git a/tests/subsys/suit/unit/suit_plat_override_image_size/testcase.yaml b/tests/subsys/suit/unit/suit_plat_override_image_size/testcase.yaml new file mode 100644 index 000000000000..fe0c1dff9642 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_override_image_size/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit.unit.platform.override_image_size: + type: unit + tags: >- + suit + suit_platform + suit_plat_override_image_size + suit_plat_create_component_handle diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/CMakeLists.txt b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/CMakeLists.txt new file mode 100644 index 000000000000..5880265a20d1 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/CMakeLists.txt @@ -0,0 +1,21 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +include(../cmake/test_template.cmake) + +project(plat_retrieve_manifest) + +target_sources(testbinary PRIVATE + src/main.c + ${SUIT_SUBSYS_DIR}/platform/src/suit_plat_retrieve_manifest.c + ${SUIT_SUBSYS_DIR}/platform/sdfw/src/suit_plat_retrieve_manifest_sdfw_specific.c +) + +if (CONFIG_MOCK_SUIT_MEMORY_LAYOUT) + target_include_directories(testbinary PRIVATE .) +endif() diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/Kconfig b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/Kconfig new file mode 100644 index 000000000000..b080ec5b6085 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Include and define MOCK_* Kconfigs +rsource "../mocks/Kconfig" + +source "Kconfig.zephyr" diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/prj.conf b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/prj.conf new file mode 100644 index 000000000000..3663310b79b9 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/prj.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2023 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_MOCK_SUIT_STORAGE=y +CONFIG_MOCK_SUIT_PROCESSOR=y +CONFIG_MOCK_SUIT_PLATFORM_INTERNAL=y +CONFIG_MOCK_SUIT_UTILS=y +CONFIG_MOCK_SUIT_MCI=y +CONFIG_MOCK_SUIT_METADATA=y +CONFIG_MOCK_SUIT_MEMPTR_STORAGE=y +CONFIG_MOCK_SUIT_MEMORY_LAYOUT=y diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/src/main.c b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/src/main.c new file mode 100644 index 000000000000..dc0a23677be9 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/src/main.c @@ -0,0 +1,990 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include + +#define TEST_COMPONENT_HANDLE ((suit_component_t)0x123) +#define TEST_COMPONENT_ID ((struct zcbor_string *)0x456) +#define TEST_CLASS_ID ((suit_manifest_class_id_t *)0x789) +#define TEST_ENVELOPE_ADDRESS ((uint8_t *)0xabcd) +#define TEST_ENVELOPE_SIZE ((size_t)0xef01) +#define TEST_MEMPTR_STORAGE_HANDLE ((memptr_storage_handle_t)0x2345) + +static void test_before(void *data) +{ + /* Reset mocks */ + mocks_reset(); + + /* Reset common FFF internal structures */ + FFF_RESET_HISTORY(); +} + +ZTEST_SUITE(suit_platform_retrieve_manifest_tests, NULL, NULL, test_before, NULL, NULL); + +static int +suit_plat_component_id_get_invalid_component_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(handle, TEST_COMPONENT_HANDLE, "Unexpected component handle value"); + zassert_not_equal(component_id, NULL, + "API must provide valid address to get component ID value"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_id_get_valid_component_fake_func(suit_component_t handle, + struct zcbor_string **component_id) +{ + zassert_equal(handle, TEST_COMPONENT_HANDLE, "Unexpected component handle value"); + zassert_not_equal(component_id, NULL, + "API must provide valid address to get component ID value"); + + *component_id = TEST_COMPONENT_ID; + + return SUIT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_unknown_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_component_type_unsupported_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + *type = SUIT_COMPONENT_TYPE_UNSUPPORTED; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_mem_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + *type = SUIT_COMPONENT_TYPE_MEM; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_cand_img_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + *type = SUIT_COMPONENT_TYPE_CAND_IMG; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_instld_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + *type = SUIT_COMPONENT_TYPE_INSTLD_MFST; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_component_type_cand_fake_func(struct zcbor_string *component_id, + suit_component_type_t *type) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(type, NULL, "API must provide valid address to get component type value"); + + *type = SUIT_COMPONENT_TYPE_CAND_MFST; + + return SUIT_PLAT_SUCCESS; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_invalid_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(class_id, NULL, + "API must provide valid address to get manifest class ID value"); + + return SUIT_PLAT_ERR_CRASH; +} + +static suit_plat_err_t +suit_plat_decode_manifest_class_id_valid_fake_func(struct zcbor_string *component_id, + suit_manifest_class_id_t **class_id) +{ + zassert_equal(component_id, TEST_COMPONENT_ID, "Unexpected component ID value"); + zassert_not_equal(class_id, NULL, + "API must provide valid address to get manifest class ID value"); + + *class_id = TEST_CLASS_ID; + + return SUIT_PLAT_SUCCESS; +} + +static int +suit_storage_installed_envelope_get_not_found_fake_func(const suit_manifest_class_id_t *id, + uint8_t **addr, size_t *size) +{ + zassert_equal(id, TEST_CLASS_ID, "Unexpected manifest class ID value"); + zassert_not_equal(addr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(size, NULL, + "API must provide valid address to get installed manifest size value"); + + return SUIT_PLAT_ERR_NOT_FOUND; +} + +static int +suit_storage_installed_envelope_get_invalid_address_fake_func(const suit_manifest_class_id_t *id, + uint8_t **addr, size_t *size) +{ + zassert_equal(id, TEST_CLASS_ID, "Unexpected manifest class ID value"); + zassert_not_equal(addr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(size, NULL, + "API must provide valid address to get installed manifest size value"); + + *addr = NULL; + *size = TEST_ENVELOPE_SIZE; + + return SUIT_SUCCESS; +} + +static int +suit_storage_installed_envelope_get_invalid_size_fake_func(const suit_manifest_class_id_t *id, + uint8_t **addr, size_t *size) +{ + zassert_equal(id, TEST_CLASS_ID, "Unexpected manifest class ID value"); + zassert_not_equal(addr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(size, NULL, + "API must provide valid address to get installed manifest size value"); + + *addr = TEST_ENVELOPE_ADDRESS; + *size = 0; + + return SUIT_SUCCESS; +} + +static int suit_storage_installed_envelope_get_found_fake_func(const suit_manifest_class_id_t *id, + uint8_t **addr, size_t *size) +{ + zassert_equal(id, TEST_CLASS_ID, "Unexpected manifest class ID value"); + zassert_not_equal(addr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(size, NULL, + "API must provide valid address to get installed manifest size value"); + + *addr = TEST_ENVELOPE_ADDRESS; + *size = TEST_ENVELOPE_SIZE; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_plat_component_impl_data_get_no_data_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(handle, TEST_COMPONENT_HANDLE, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; +} + +static int suit_plat_component_impl_data_get_data_fake_func(suit_component_t handle, + void **impl_data) +{ + zassert_equal(handle, TEST_COMPONENT_HANDLE, "Unexpected component handle value"); + zassert_not_equal(impl_data, NULL, + "API must provide valid address to get imeplementation-specific data"); + + *impl_data = TEST_MEMPTR_STORAGE_HANDLE; + + return SUIT_SUCCESS; +} + +static int suit_memptr_storage_ptr_get_no_data_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + return SUIT_MEMPTR_STORAGE_ERR_UNALLOCATED_RECORD; +} + +static int suit_memptr_storage_ptr_get_invalid_addr_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + *payload_ptr = NULL; + *payload_size = TEST_ENVELOPE_SIZE; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_memptr_storage_ptr_get_invalid_size_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + *payload_ptr = TEST_ENVELOPE_ADDRESS; + *payload_size = 0; + + return SUIT_PLAT_SUCCESS; +} + +static int suit_memptr_storage_ptr_get_valid_fake_func(memptr_storage_handle_t handle, + const uint8_t **payload_ptr, + size_t *payload_size) +{ + zassert_equal(handle, TEST_MEMPTR_STORAGE_HANDLE, "Unexpected memory storage handle value"); + zassert_not_equal(payload_ptr, NULL, + "API must provide valid address to get installed manifest address value"); + zassert_not_equal(payload_size, NULL, + "API must provide valid address to get installed manifest size value"); + + *payload_ptr = TEST_ENVELOPE_ADDRESS; + *payload_size = TEST_ENVELOPE_SIZE; + + return SUIT_PLAT_SUCCESS; +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_handle_null_args) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* WHEN platform is asked to return manifest and input parameters are invalid */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, NULL, NULL); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_CRASH, ret, "Invalid manifest retrieved"); + + /* WHEN platform is asked to return manifest and input parameters are invalid */ + ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, NULL, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_CRASH, ret, "Invalid manifest retrieved"); + + /* WHEN platform is asked to return manifest and input parameters are invalid */ + ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, NULL); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_CRASH, ret, "Invalid manifest retrieved"); + + /* ... and other checks were not performed in any of those scenarios */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_id_get() calls"); + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_handle_invalid) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is invalid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_invalid_component_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 0, + "Incorrect number of suit_plat_decode_component_type() calls"); + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_component_unknown) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is unknown (not decoded) */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_unknown_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_component_unsupported) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is unsupported (but decoded) */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_unsupported_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_component_mem) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is memory-mapped component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_mem_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_component_cand_img) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate image component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_img_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_instld_invalid_class) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is installed manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_fake_func; + /* ... and the manifest class ID for given component is invalid */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_invalid_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and manifest class ID for given component ID was fetched */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_instld_manifest_not_found) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is installed manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_fake_func; + /* ... and the manifest class ID for given component is valid */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_valid_fake_func; + /* ... and the manifest with given class ID is not found in SUIT storage */ + suit_storage_installed_envelope_get_fake.custom_fake = + suit_storage_installed_envelope_get_not_found_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and manifest class ID for given component ID was fetched */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest for given class ID was fetched */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_instld_manifest_invalid_address) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is installed manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_fake_func; + /* ... and the manifest class ID for given component is valid */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_valid_fake_func; + /* ... and the manifest with given class ID is not found in SUIT storage */ + suit_storage_installed_envelope_get_fake.custom_fake = + suit_storage_installed_envelope_get_invalid_address_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and manifest class ID for given component ID was fetched */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest for given class ID was fetched */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_instld_manifest_invalid_size) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is installed manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_fake_func; + /* ... and the manifest class ID for given component is valid */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_valid_fake_func; + /* ... and the manifest with given class ID is not found in SUIT storage */ + suit_storage_installed_envelope_get_fake.custom_fake = + suit_storage_installed_envelope_get_invalid_size_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and manifest class ID for given component ID was fetched */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest for given class ID was fetched */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_instld_manifest_found) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is installed manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_instld_fake_func; + /* ... and the manifest class ID for given component is valid */ + suit_plat_decode_manifest_class_id_fake.custom_fake = + suit_plat_decode_manifest_class_id_valid_fake_func; + /* ... and the manifest with given class ID is not found in SUIT storage */ + suit_storage_installed_envelope_get_fake.custom_fake = + suit_storage_installed_envelope_get_found_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_SUCCESS, ret, "Invalid manifest retrieved"); + zassert_equal(TEST_ENVELOPE_ADDRESS, envelope_str, "Invalid envelope address received"); + zassert_equal(TEST_ENVELOPE_SIZE, envelope_len, "Invalid envelope size received"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and manifest class ID for given component ID was fetched */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 1, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + /* ... and manifest for given class ID was fetched */ + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 1, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 0, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_no_data) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is no implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_no_data_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 0, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_no_ptr) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_data_fake_func; + /* ... and there is no data in memory pointer storage */ + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_no_data_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + /* ... and envelope was fetched from the memory pointer storage */ + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_invalid_addr) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_data_fake_func; + /* ... and there is data in memory pointer storage */ + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_invalid_addr_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + /* ... and envelope was fetched from the memory pointer storage */ + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_invalid_size) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_data_fake_func; + /* ... and there is data in memory pointer storage */ + suit_memptr_storage_ptr_get_fake.custom_fake = + suit_memptr_storage_ptr_get_invalid_size_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, &envelope_str, &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + /* ... and envelope was fetched from the memory pointer storage */ + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_valid) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_data_fake_func; + /* ... and there is data in memory pointer storage */ + suit_memptr_storage_ptr_get_fake.custom_fake = suit_memptr_storage_ptr_get_valid_fake_func; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, (const uint8_t *)&envelope_str, + &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_SUCCESS, ret, "Invalid manifest retrieved"); + zassert_equal(TEST_ENVELOPE_ADDRESS, envelope_str, "Invalid envelope address received"); + zassert_equal(TEST_ENVELOPE_SIZE, envelope_len, "Invalid envelope size received"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + /* ... and envelope was fetched from the memory pointer storage */ + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_memory_global_address_is_in_external_memory_fake.call_count, 1, + "Incorrect number of suit_memory_global_address_is_in_external_memory() " + "calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); +} + +ZTEST(suit_platform_retrieve_manifest_tests, test_cand_manifest_in_external_memory) +{ + uint8_t *envelope_str; + size_t envelope_len; + + /* GIVEN the component handle value is valid. */ + suit_plat_component_id_get_fake.custom_fake = + suit_plat_component_id_get_valid_component_fake_func; + /* ... and the component type is candidate manifest component */ + suit_plat_decode_component_type_fake.custom_fake = + suit_plat_decode_component_type_cand_fake_func; + /* ... and there is implementation-specific data */ + suit_plat_component_impl_data_get_fake.custom_fake = + suit_plat_component_impl_data_get_data_fake_func; + /* ... and there is data in memory pointer storage */ + suit_memptr_storage_ptr_get_fake.custom_fake = suit_memptr_storage_ptr_get_valid_fake_func; + + /* ... and the data pointer points to an area in external memory */ + suit_memory_global_address_is_in_external_memory_fake.return_val = true; + + /* WHEN platform is asked to return manifest */ + int ret = suit_plat_retrieve_manifest(TEST_COMPONENT_HANDLE, (const uint8_t *)&envelope_str, + &envelope_len); + + /* THEN manifest is not returned... */ + zassert_equal(SUIT_ERR_UNSUPPORTED_COMPONENT_ID, ret, "Invalid manifest retrieved"); + + /* ... and component ID for given component handle was fetched */ + zassert_equal(suit_plat_component_id_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_id_get() calls"); + /* ... and component type for given component ID was fetched */ + zassert_equal(suit_plat_decode_component_type_fake.call_count, 1, + "Incorrect number of suit_plat_decode_component_type() calls"); + /* ... and implementation data for given component handle was fetched */ + zassert_equal(suit_plat_component_impl_data_get_fake.call_count, 1, + "Incorrect number of suit_plat_component_impl_data_get() calls"); + /* ... and envelope was fetched from the memory pointer storage */ + zassert_equal(suit_memptr_storage_ptr_get_fake.call_count, 1, + "Incorrect number of suit_memptr_storage_ptr_get() calls"); + zassert_equal(suit_memory_global_address_is_in_external_memory_fake.call_count, 1, + "Incorrect number of suit_memory_global_address_is_in_external_memory() " + "calls"); + + /* ... and other checks were not performed */ + zassert_equal(suit_plat_decode_manifest_class_id_fake.call_count, 0, + "Incorrect number of suit_plat_decode_manifest_class_id() calls"); + zassert_equal(suit_storage_installed_envelope_get_fake.call_count, 0, + "Incorrect number of suit_storage_installed_envelope_get() calls"); +} diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/suit_memory_layout.h b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/suit_memory_layout.h new file mode 100644 index 000000000000..68df72696e49 --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/suit_memory_layout.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* @brief File with copies of selected function headers + * to satisfy the compiler. The real header includes unneeded bloat from + * zephyr/device.h + */ + +#ifndef SUIT_MEMORY_LAYOUT_H__ +#define SUIT_MEMORY_LAYOUT_H__ + +#include + +bool suit_memory_global_address_is_in_external_memory(uintptr_t address); + +#endif /* SUIT_MEMORY_LAYOUT_H__ */ diff --git a/tests/subsys/suit/unit/suit_plat_retrieve_manifest/testcase.yaml b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/testcase.yaml new file mode 100644 index 000000000000..52c285280eef --- /dev/null +++ b/tests/subsys/suit/unit/suit_plat_retrieve_manifest/testcase.yaml @@ -0,0 +1,7 @@ +tests: + suit.unit.platform.retrieve_manifest: + type: unit + tags: >- + suit + suit_platform + suit_plat_retrieve_manifest diff --git a/tests/subsys/suit/write/CMakeLists.txt b/tests/subsys/suit/write/CMakeLists.txt new file mode 100644 index 000000000000..26b8f42d40bd --- /dev/null +++ b/tests/subsys/suit/write/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}) + +project(integration_test_copy) +include(../cmake/test_template.cmake) + +zephyr_library_link_libraries(suit) +zephyr_library_link_libraries(suit_platform_interface) +zephyr_library_link_libraries(suit_memptr_storage_interface) +zephyr_library_link_libraries(suit_sink_selector_interface) +zephyr_library_link_libraries(suit_memory_layout_interface) diff --git a/tests/subsys/suit/write/boards/native_posix.conf b/tests/subsys/suit/write/boards/native_posix.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/write/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/write/boards/native_posix.overlay b/tests/subsys/suit/write/boards/native_posix.overlay new file mode 100644 index 000000000000..c79b0b9b9a33 --- /dev/null +++ b/tests/subsys/suit/write/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 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/write/boards/native_posix_64.conf b/tests/subsys/suit/write/boards/native_posix_64.conf new file mode 100644 index 000000000000..70a0fa912cb2 --- /dev/null +++ b/tests/subsys/suit/write/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/write/boards/native_posix_64.overlay b/tests/subsys/suit/write/boards/native_posix_64.overlay new file mode 100644 index 000000000000..c79b0b9b9a33 --- /dev/null +++ b/tests/subsys/suit/write/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 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; + +/ { + sram0: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_K(256)>; + }; +}; diff --git a/tests/subsys/suit/write/boards/nrf52840dk_nrf52840.overlay b/tests/subsys/suit/write/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..7a41c2d53e70 --- /dev/null +++ b/tests/subsys/suit/write/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 8KB of NVM as dfu_partition. */ + dfu_partition: partition@fe000 { + reg = <0xfe000 DT_SIZE_K(8)>; + }; + }; +}; diff --git a/tests/subsys/suit/write/prj.conf b/tests/subsys/suit/write/prj.conf new file mode 100644 index 000000000000..426569e21035 --- /dev/null +++ b/tests/subsys/suit/write/prj.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_ZTEST=y + +CONFIG_SUIT=y +CONFIG_SUIT_PROCESSOR=y +CONFIG_SUIT_PLATFORM=y + +CONFIG_SUIT_STREAM=y +CONFIG_SUIT_SINK_SELECTOR=y +CONFIG_SUIT_STREAM_SOURCE_MEMPTR=y +CONFIG_SUIT_STREAM_SINK_FLASH=y +CONFIG_SUIT_STREAM_SINK_RAM=y +CONFIG_SUIT_STREAM_SINK_MEMPTR=y + +CONFIG_SUIT_UTILS=y +CONFIG_SUIT_MEMPTR_STORAGE=y + +CONFIG_ZCBOR=y +CONFIG_ZCBOR_CANONICAL=y + +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y diff --git a/tests/subsys/suit/write/src/main.c b/tests/subsys/suit/write/src/main.c new file mode 100644 index 000000000000..2ff363ad4343 --- /dev/null +++ b/tests/subsys/suit/write/src/main.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DFU_PARTITION_OFFSET FIXED_PARTITION_OFFSET(dfu_partition) +#define FLASH_WRITE_ADDR (suit_plat_mem_nvm_ptr_get(DFU_PARTITION_OFFSET)) +#define RAM_WRITE_ADDR ((uint8_t *)suit_memory_global_address_to_ram_address(0x2003EC00)) + +static uint8_t test_data[] = {0xDE, 0xAD, 0xBE, 0xEF}; + +ZTEST_SUITE(write_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(write_tests, test_write_to_flash_sink_OK) +{ + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A000FE000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x0F, 0xE0, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_write failed - error %i", ret); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); + zassert_mem_equal(FLASH_WRITE_ADDR, test_data, sizeof(test_data), + "Data in destination is invalid"); +} + +ZTEST(write_tests, test_write_to_ram_sink_OK) +{ + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A20000000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x20, 0x03, 0xEC, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, &source); + zassert_equal(ret, SUIT_SUCCESS, "suit_plat_write failed - error %i", ret); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); + zassert_mem_equal(RAM_WRITE_ADDR, test_data, sizeof(test_data), + "Data in destination is invalid"); +} + +ZTEST(write_tests, test_write_flash_sink_NOK_size_not_aligned) +{ + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A000FE000', h'10'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, + 0x45, 0x1A, 0x00, 0x0F, 0xE0, 0x00, 0x41, 0x10}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, &source); + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_write should have failed on erase"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); +} + +ZTEST(write_tests, test_write_flash_sink_NOK_handle_released) +{ + struct zcbor_string source = {.value = test_data, .len = sizeof(test_data)}; + + /* handle that will be used as destination */ + suit_component_t dst_handle = 0; + + int ret = suit_plat_write(dst_handle, &source); + + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_write should have failed - invalid handle"); +} + +ZTEST(write_tests, test_write_to_flash_sink_NOK_source_null) +{ + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A000FE000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x0F, 0xE0, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, NULL); + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_write should have failed - source null"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); +} + +ZTEST(write_tests, test_write_to_flash_sink_NOK_source_value_null) +{ + struct zcbor_string source = {.value = NULL, .len = sizeof(test_data)}; + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A000FE000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x0F, 0xE0, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, &source); + zassert_not_equal(ret, SUIT_SUCCESS, + "suit_plat_write should have failed - source value null"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); +} + +ZTEST(write_tests, test_write_to_flash_sink_NOK_source_len_0) +{ + struct zcbor_string source = {.value = test_data, .len = 0}; + + /* Create handle that will be used as destination */ + suit_component_t dst_handle; + /* [h'MEM', h'02', h'1A000FE000', h'191000'] */ + uint8_t valid_dst_value[] = {0x84, 0x44, 0x63, 'M', 'E', 'M', 0x41, 0x02, 0x45, + 0x1A, 0x00, 0x0F, 0xE0, 0x00, 0x43, 0x19, 0x10, 0x00}; + + struct zcbor_string valid_dst_component_id = { + .value = valid_dst_value, + .len = sizeof(valid_dst_value), + }; + + int ret = suit_plat_create_component_handle(&valid_dst_component_id, &dst_handle); + + zassert_equal(ret, SUIT_SUCCESS, "create_component_handle failed - error %i", ret); + + ret = suit_plat_write(dst_handle, &source); + zassert_not_equal(ret, SUIT_SUCCESS, "suit_plat_write should have failed - source len 0"); + + ret = suit_plat_release_component_handle(dst_handle); + zassert_equal(ret, SUIT_SUCCESS, "dst_handle release failed - error %i", ret); +} diff --git a/tests/subsys/suit/write/testcase.yaml b/tests/subsys/suit/write/testcase.yaml new file mode 100644 index 000000000000..915794c53c08 --- /dev/null +++ b/tests/subsys/suit/write/testcase.yaml @@ -0,0 +1,8 @@ +tests: + suit-platform.integration.write: + platform_allow: nrf52840dk/nrf52840 native_posix native_posix/native/64 + tags: suit-processor suit_platform + integration_platforms: + - nrf52840dk/nrf52840 + - native_posix + - native_posix/native/64 diff --git a/tests/subsys/zigbee/osif/crypto/CMakeLists.txt b/tests/subsys/zigbee/osif/crypto/CMakeLists.txt index 98cafc997ea2..0b01a9c5597e 100644 --- a/tests/subsys/zigbee/osif/crypto/CMakeLists.txt +++ b/tests/subsys/zigbee/osif/crypto/CMakeLists.txt @@ -19,7 +19,7 @@ target_compile_definitions(app PRIVATE # nrfxlib_crypto is linked in here because it can't be linked # in Zigbee subsys CMakeLists.txt. -if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp") +if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP) target_compile_definitions(app PRIVATE CONFIG_ZIGBEE_USE_SOFTWARE_AES=1 ) diff --git a/tests/subsys/zigbee/osif/crypto/testcase.yaml b/tests/subsys/zigbee/osif/crypto/testcase.yaml index 2c5caf396613..a39ebde1fbbb 100644 --- a/tests/subsys/zigbee/osif/crypto/testcase.yaml +++ b/tests/subsys/zigbee/osif/crypto/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.osif.crypto: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: osif_crypto integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/osif/nvram/testcase.yaml b/tests/subsys/zigbee/osif/nvram/testcase.yaml index a9c31577beb5..5e2e8f6a4e00 100644 --- a/tests/subsys/zigbee/osif/nvram/testcase.yaml +++ b/tests/subsys/zigbee/osif/nvram/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.osif.nvram: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: zigbee_nvram integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/osif/serial/serial_async_api/testcase.yaml b/tests/subsys/zigbee/osif/serial/serial_async_api/testcase.yaml index df0ff7abe583..1855ec00b18b 100644 --- a/tests/subsys/zigbee/osif/serial/serial_async_api/testcase.yaml +++ b/tests/subsys/zigbee/osif/serial/serial_async_api/testcase.yaml @@ -1,7 +1,7 @@ tests: zigbee.osif.serial.async: depends_on: gpio - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: osif_serial harness: ztest harness_config: diff --git a/tests/subsys/zigbee/osif/serial/serial_basic_api/testcase.yaml b/tests/subsys/zigbee/osif/serial/serial_basic_api/testcase.yaml index 919d2d645a31..d1dccbbcedd8 100644 --- a/tests/subsys/zigbee/osif/serial/serial_basic_api/testcase.yaml +++ b/tests/subsys/zigbee/osif/serial/serial_basic_api/testcase.yaml @@ -1,7 +1,7 @@ tests: zigbee.osif.serial.basic: depends_on: gpio - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: osif_serial harness: ztest harness_config: diff --git a/tests/subsys/zigbee/osif/serial/serial_via_logger/testcase.yaml b/tests/subsys/zigbee/osif/serial/serial_via_logger/testcase.yaml index 2a1aa7629b34..63379758dacc 100644 --- a/tests/subsys/zigbee/osif/serial/serial_via_logger/testcase.yaml +++ b/tests/subsys/zigbee/osif/serial/serial_via_logger/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.osif.serial.logger: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: osif_logger integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/osif/timer_counter/testcase.yaml b/tests/subsys/zigbee/osif/timer_counter/testcase.yaml index de1e20a01a7d..174f7128ad68 100644 --- a/tests/subsys/zigbee/osif/timer_counter/testcase.yaml +++ b/tests/subsys/zigbee/osif/timer_counter/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.osif.timer.counter: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: zigbee_osif integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/osif/timer_ktimer/testcase.yaml b/tests/subsys/zigbee/osif/timer_ktimer/testcase.yaml index 967a3650598d..757ce3a12e7e 100644 --- a/tests/subsys/zigbee/osif/timer_ktimer/testcase.yaml +++ b/tests/subsys/zigbee/osif/timer_ktimer/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.osif.timer.ktimer: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: zigbee_osif integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/zboss_api/alarm_api/src/main.c b/tests/subsys/zigbee/zboss_api/alarm_api/src/main.c index 20c5df932f16..d8e9a2a7a9de 100644 --- a/tests/subsys/zigbee/zboss_api/alarm_api/src/main.c +++ b/tests/subsys/zigbee/zboss_api/alarm_api/src/main.c @@ -206,11 +206,11 @@ void test_main(void) zigbee_enable(); /* Only zboss_api_signals test suite should run now. */ - ztest_run_all(&zboss_startup_finished); + ztest_run_all(&zboss_startup_finished, false, 1, 1); /* Only zboss_api_alarm test suite should run now. */ zboss_startup_finished = true; - ztest_run_all(&zboss_startup_finished); + ztest_run_all(&zboss_startup_finished, false, 1, 1); ztest_verify_all_test_suites_ran(); } diff --git a/tests/subsys/zigbee/zboss_api/alarm_api/testcase.yaml b/tests/subsys/zigbee/zboss_api/alarm_api/testcase.yaml index 1bf629a52fe1..555878e1cab1 100644 --- a/tests/subsys/zigbee/zboss_api/alarm_api/testcase.yaml +++ b/tests/subsys/zigbee/zboss_api/alarm_api/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.zboss_api.alarm_api: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: zboss_api_alarm integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/subsys/zigbee/zboss_api/callback_api/src/main.c b/tests/subsys/zigbee/zboss_api/callback_api/src/main.c index a9f1a7b8e496..a48802049941 100644 --- a/tests/subsys/zigbee/zboss_api/callback_api/src/main.c +++ b/tests/subsys/zigbee/zboss_api/callback_api/src/main.c @@ -192,11 +192,11 @@ void test_main(void) zigbee_enable(); /* Only zboss_api_signals test suite should run now. */ - ztest_run_all(&zboss_startup_finished); + ztest_run_all(&zboss_startup_finished, false, 1, 1); /* Only zboss_api_alarm test suite should run now. */ zboss_startup_finished = true; - ztest_run_all(&zboss_startup_finished); + ztest_run_all(&zboss_startup_finished, false, 1, 1); ztest_verify_all_test_suites_ran(); } diff --git a/tests/subsys/zigbee/zboss_api/callback_api/testcase.yaml b/tests/subsys/zigbee/zboss_api/callback_api/testcase.yaml index 824551081074..58eb4811b94b 100644 --- a/tests/subsys/zigbee/zboss_api/callback_api/testcase.yaml +++ b/tests/subsys/zigbee/zboss_api/callback_api/testcase.yaml @@ -1,8 +1,8 @@ tests: zigbee.zboss_api.callback_api: - platform_allow: nrf52840dk_nrf52840 nrf52833dk_nrf52833 nrf5340dk_nrf5340_cpuapp + platform_allow: nrf52840dk/nrf52840 nrf52833dk/nrf52833 nrf5340dk/nrf5340/cpuapp tags: zboss_api_callback integration_platforms: - - nrf52840dk_nrf52840 - - nrf52833dk_nrf52833 - - nrf5340dk_nrf5340_cpuapp + - nrf52840dk/nrf52840 + - nrf52833dk/nrf52833 + - nrf5340dk/nrf5340/cpuapp diff --git a/tests/tfm/secure_services/testcase.yaml b/tests/tfm/secure_services/testcase.yaml index d6c5d264f870..0f1eb30c701c 100644 --- a/tests/tfm/secure_services/testcase.yaml +++ b/tests/tfm/secure_services/testcase.yaml @@ -1,7 +1,7 @@ tests: tfm.secure_services: - platform_allow: nrf9160dk_nrf9160_ns nrf5340dk_nrf5340_cpuapp_ns + platform_allow: nrf9160dk/nrf9160/ns nrf5340dk/nrf5340/cpuapp/ns tags: tfm secure_services integration_platforms: - - nrf9160dk_nrf9160_ns - - nrf5340dk_nrf5340_cpuapp_ns + - nrf9160dk/nrf9160/ns + - nrf5340dk/nrf5340/cpuapp/ns diff --git a/tests/tfm/tfm_psa_test/CMakeLists.txt b/tests/tfm/tfm_psa_test/CMakeLists.txt index 613972103c1f..1ad62febf50f 100644 --- a/tests/tfm/tfm_psa_test/CMakeLists.txt +++ b/tests/tfm/tfm_psa_test/CMakeLists.txt @@ -87,6 +87,12 @@ set_property(TARGET zephyr_property_target include(ExternalProject) +if(CONFIG_DEBUG_OPTIMIZATIONS) + set(tfm_ns_CMAKE_BUILD_TYPE Debug) +else() + set(tfm_ns_CMAKE_BUILD_TYPE RelWithDebInfo) +endif() + ExternalProject_Add(tfm_psa_arch_test_app SOURCE_DIR ${TFM_TEST_REPO_PATH}/tests_psa_arch BINARY_DIR ${PROJECT_BINARY_DIR}/tfm_ns @@ -100,7 +106,7 @@ ExternalProject_Add(tfm_psa_arch_test_app -DCROSS_COMPILE=${TFM_TOOLCHAIN_PATH}/${TFM_TOOLCHAIN_PREFIX} -DPSA_TOOLCHAIN_FILE=${TFM_BINARY_DIR}/api_ns/cmake/${TFM_TOOLCHAIN_NS_FILE} -DQCBOR_PATH${QCBOR_PATH_TYPE}=${CONFIG_TFM_QCBOR_PATH} - -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_BUILD_TYPE=${tfm_ns_CMAKE_BUILD_TYPE} -DTEST_PSA_API=${TEST_PSA_API} -DZEPHYR_NRF_MODULE_DIR=${ZEPHYR_NRF_MODULE_DIR} BUILD_COMMAND ${CMAKE_COMMAND} --build . diff --git a/tests/tfm/tfm_psa_test/README.rst b/tests/tfm/tfm_psa_test/README.rst index db059adc7c69..9bc07f4fcabf 100644 --- a/tests/tfm/tfm_psa_test/README.rst +++ b/tests/tfm/tfm_psa_test/README.rst @@ -54,7 +54,7 @@ Building and running For programming, use the :ref:`programming command without --erase `. Programming with ``--erase`` or ``--recover`` (or similar parameters) will erase the PSA platform security parameters. -You can indicate the desired test suite by using a configuration flag when building (replace ```` with your board name, for example ``nrf5340dk_nrf5340_cpuapp_ns``): +You can indicate the desired test suite by using a configuration flag when building (replace ```` with your board name, for example ``nrf5340dk/nrf5340/cpuapp/ns``): .. code-block:: console diff --git a/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf b/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf deleted file mode 100644 index 24befd536769..000000000000 --- a/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.conf +++ /dev/null @@ -1,11 +0,0 @@ -# enable/Disable features that 54l supports/does not support - -CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n - - -CONFIG_TFM_PSA_TEST_CRYPTO=n -CONFIG_TFM_PSA_TEST_PROTECTED_STORAGE=n -CONFIG_TFM_PSA_TEST_STORAGE=n -CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION=n - -CONFIG_TFM_PSA_TEST_INTERNAL_TRUSTED_STORAGE=y diff --git a/tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay b/tests/tfm/tfm_psa_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay similarity index 100% rename from tests/tfm/tfm_psa_test/boards/nrf54l15dk_nrf54l15_cpuapp_ns.overlay rename to tests/tfm/tfm_psa_test/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.overlay diff --git a/tests/tfm/tfm_psa_test/prj.conf b/tests/tfm/tfm_psa_test/prj.conf index 587088df9b1e..36afd189d05e 100644 --- a/tests/tfm/tfm_psa_test/prj.conf +++ b/tests/tfm/tfm_psa_test/prj.conf @@ -19,7 +19,10 @@ CONFIG_PSA_WANT_GENERATE_RANDOM=y # Keys CONFIG_PSA_WANT_KEY_TYPE_AES=y CONFIG_PSA_WANT_KEY_TYPE_CHACHA20=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR=y # Ciphers diff --git a/tests/tfm/tfm_psa_test/testcase.yaml b/tests/tfm/tfm_psa_test/testcase.yaml index 25d38fb3dd05..65decb722cd0 100644 --- a/tests/tfm/tfm_psa_test/testcase.yaml +++ b/tests/tfm/tfm_psa_test/testcase.yaml @@ -1,10 +1,6 @@ common: tags: tfm build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns - integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns harness: console harness_config: type: multi_line @@ -12,43 +8,71 @@ common: - "\\*\\*\\*\\*\\* PSA Architecture Test Suite - Version .* \\*\\*\\*\\*\\*" - "TOTAL FAILED *: 0" tests: - tfm.psa_test_protected_storage_lvl1: - tags: tfm_lvl1 - extra_args: "CONFIG_TFM_PSA_TEST_PROTECTED_STORAGE=y CONFIG_TFM_ISOLATION_LEVEL=1" - timeout: 120 - tfm.psa_test_protected_storage_lvl2: - tags: tfm_lvl2 - extra_args: "CONFIG_TFM_PSA_TEST_PROTECTED_STORAGE=y" - timeout: 120 - tfm.psa_test_internal_trusted_storage_lvl1: - tags: tfm_lvl1 - extra_args: "CONFIG_TFM_PSA_TEST_INTERNAL_TRUSTED_STORAGE=y CONFIG_TFM_ISOLATION_LEVEL=1" - tfm.psa_test_internal_trusted_storage_lvl2: - tags: tfm_lvl2 - extra_args: "CONFIG_TFM_PSA_TEST_INTERNAL_TRUSTED_STORAGE=y" tfm.psa_test_storage_lvl1: tags: tfm_lvl1 extra_args: "CONFIG_TFM_PSA_TEST_STORAGE=y CONFIG_TFM_ISOLATION_LEVEL=1" timeout: 130 + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + nrf54l15pdk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf54l15pdk/nrf54l15/cpuapp/ns tfm.psa_test_storage_lvl2: tags: tfm_lvl2 extra_args: "CONFIG_TFM_PSA_TEST_STORAGE=y" timeout: 130 + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + nrf54l15pdk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf54l15pdk/nrf54l15/cpuapp/ns tfm.psa_test_crypto_lvl1: tags: tfm_lvl1 extra_args: "CONFIG_TFM_PSA_TEST_CRYPTO=y CONFIG_TFM_ISOLATION_LEVEL=1" timeout: 120 + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + nrf54l15pdk/nrf54l15/cpuapp/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns + - nrf54l15pdk/nrf54l15/cpuapp/ns tfm.psa_test_crypto_lvl2: tags: tfm_lvl2 extra_args: "CONFIG_TFM_PSA_TEST_CRYPTO=y" timeout: 120 + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns tfm.psa_test_initial_attestation_lvl1: tags: tfm_lvl1 extra_args: > CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION=y CONFIG_TFM_ISOLATION_LEVEL=1 CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_NRF_PROVISIONING=y + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns tfm.psa_test_initial_attestation_lvl2: tags: tfm_lvl2 extra_args: > CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION=y CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=y CONFIG_TFM_NRF_PROVISIONING=y + platform_allow: > + nrf5340dk/nrf5340/cpuapp/ns + nrf9160dk/nrf9160/ns + integration_platforms: + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns diff --git a/tests/tfm/tfm_regression_test/prj.conf b/tests/tfm/tfm_regression_test/prj.conf index cbad9d66d7f0..6e98ad5ab6df 100644 --- a/tests/tfm/tfm_regression_test/prj.conf +++ b/tests/tfm/tfm_regression_test/prj.conf @@ -28,7 +28,10 @@ CONFIG_PSA_WANT_GENERATE_RANDOM=y # Keys CONFIG_PSA_WANT_KEY_TYPE_AES=y -CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y +CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR=y # Ciphers diff --git a/tests/tfm/tfm_regression_test/testcase.yaml b/tests/tfm/tfm_regression_test/testcase.yaml index 8feeda719e9f..3207864011a9 100644 --- a/tests/tfm/tfm_regression_test/testcase.yaml +++ b/tests/tfm/tfm_regression_test/testcase.yaml @@ -1,10 +1,10 @@ common: tags: tfm build_only: true - platform_allow: nrf5340dk_nrf5340_cpuapp_ns nrf9160dk_nrf9160_ns + platform_allow: nrf5340dk/nrf5340/cpuapp/ns nrf9160dk/nrf9160/ns integration_platforms: - - nrf5340dk_nrf5340_cpuapp_ns - - nrf9160dk_nrf9160_ns + - nrf5340dk/nrf5340/cpuapp/ns + - nrf9160dk/nrf9160/ns harness: console harness_config: type: multi_line diff --git a/tests/unity/CMakeLists.txt b/tests/unity/CMakeLists.txt index f4c032eea1a6..244404a8243f 100644 --- a/tests/unity/CMakeLists.txt +++ b/tests/unity/CMakeLists.txt @@ -68,6 +68,8 @@ zephyr_library_sources( zephyr_library_sources(src/generic_teardown.c) zephyr_compile_definitions(UNITY_INCLUDE_CONFIG_H) +# Override Zephyr's Wdouble-promotion, as unity gives warnings. +zephyr_library_compile_options(-Wno-double-promotion) # Generate test runner file. function(test_runner_generate test_file_path) diff --git a/west.yml b/west.yml index afa1bb3222e0..9f514a0c5506 100644 --- a/west.yml +++ b/west.yml @@ -39,6 +39,8 @@ manifest: url-base: https://github.com/BabbleSim - name: bosch url-base: https://github.com/boschsensortec + - name: eembc + url-base: https://github.com/eembc # If not otherwise specified, the projects below should be obtained # from the ncs remote. @@ -61,7 +63,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: v3.5.99-ncs1 + revision: 046e281be0bdaa45f512981431fe7f20c028aa9a import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -112,7 +114,7 @@ manifest: - name: hostap repo-path: sdk-hostap path: modules/lib/hostap - revision: dda5457ad2cfce99e333980c7764c8d480ae4010 + revision: 3ac5008029de16f83d585d2735768ada53c5b05e userdata: ncs: upstream-url: https://w1.fi/cgit/hostap/ @@ -129,7 +131,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: v2.0.99-ncs1 + revision: 0b5810de95eb93bbd4fba8e20a2152b33880fc43 path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR @@ -138,15 +140,19 @@ manifest: - name: mbedtls path: modules/crypto/mbedtls repo-path: sdk-mbedtls - revision: v3.5.2-ncs1 + revision: c99e53f8bacdce37db400e5c46b26ee26937234c + - name: oberon-psa-crypto + path: modules/crypto/oberon-psa-crypto + repo-path: sdk-oberon-psa-crypto + revision: 51af9c47069d24b0794b31a0b4392a90e219ca50 - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: v2.6.0 + revision: pull/1325/head - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m - revision: v2.0.0-ncs1 + revision: 7b734feaad68ae53d98dbdd916d80d45ffda9a9f - name: psa-arch-tests repo-path: sdk-psa-arch-tests path: modules/tee/tf-m/psa-arch-tests @@ -154,7 +160,8 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: v2.6.0 + revision: e734b7924bf2b6bdc78e20d8416267f42ba95675 + west-commands: scripts/west/west-commands.yml submodules: - name: nlio path: third_party/nlio/repo @@ -169,19 +176,19 @@ manifest: userdata: ncs: upstream-url: https://github.com/project-chip/connectedhomeip - upstream-sha: 8f66f4215bc0708efc8cc73bda80620e67d8955f + upstream-sha: 181b0cb14ff007ec912f2ba6627e05dfb066c008 compare-by-default: false - name: nrf-802154 repo-path: sdk-nrf-802154 path: nrf-802154 - revision: v2.6.0 + revision: d28f2f4f8e6c3c19256136ee69bf1f6c08ed2a41 groups: - nrf-802154 - name: dragoon # Only for internal Nordic development repo-path: dragoon.git remote: dragoon - revision: 36f0e50e876848fb02fd9f82cc32e57b91b15ced + revision: 41dc7d3303c9ca8ae53747c8b9831d749fe8ec58 submodules: true groups: - dragoon @@ -196,12 +203,12 @@ manifest: compare-by-default: false - name: sidewalk repo-path: sdk-sidewalk - revision: v2.6.0 + revision: 2f8856f408f4c9ae466d33fa7f6230e3bd6f30a8 groups: - sidewalk - name: find-my repo-path: sdk-find-my - revision: v2.6.0 + revision: 68a3f93bffcd844a90630d4e70f323f327bdf33f groups: - find-my - name: azure-sdk-for-c @@ -225,12 +232,18 @@ manifest: - name: openthread repo-path: sdk-openthread path: modules/lib/openthread - revision: b9dcdbca4edd348e924d7579a2bada48bf085645 + revision: 226f239c5d85bfc0eb02cd771ddca65a34ca8f73 userdata: ncs: upstream-url: https://github.com/openthread/openthread upstream-sha: c6eaeda5a1c1c5dbb24dce7e027340cb8893a77b compare-by-default: false + - name: suit-generator + revision: c0165159dac566fafbf67be75d86ca64a34834f0 + path: modules/lib/suit-generator + - name: suit-processor + revision: 5603911b75f037dc3822fd95542c3435c0bf812d + path: modules/lib/suit-processor # Other third-party repositories. - name: cmock @@ -244,14 +257,14 @@ manifest: remote: memfault - name: ant repo-path: sdk-ant - revision: fcfcd1bc801b0ad2ef08117c7a681514729a5c4b + revision: 39a2222ad786ee2f069dde41b16c8bbe775d9484 remote: ant-nrfconnect groups: - ant - name: bsim repo-path: bsim_west remote: babblesim - revision: 384a091445c57b44ac8cbd18ebd245b47c71db94 + revision: 68f6282c6a7f54641b75f5f9fc953c85e272a983 import: path-prefix: tools - name: bme68x @@ -268,6 +281,12 @@ manifest: revision: v1.5.2400 groups: - bsec + - name: coremark + remote: eembc + path: modules/benchmark/coremark + revision: d5fad6bd094899101a4e5fd53af7298160ced6ab + groups: + - benchmark # West-related configuration for the nrf repository.